Ver código fonte

无经纪人直接联系平台

linwu 1 ano atrás
pai
commit
8073140e60

+ 5 - 2
app/mobile/controller/Worker.php

@@ -62,7 +62,7 @@ class Worker extends MobileBaseController
 
     public function recruitDetail()
     {
-        $this->get_agent();
+        $agent = $this->get_agent();
 
         $id = input('id/d', 0);
         if (empty($id)) {
@@ -74,7 +74,10 @@ class Worker extends MobileBaseController
             jump('该信息不存在或已下架');
         }
 
-        return view('worker/recruit_detail', ['info' => $info]);
+        $broker     = BrokerModel::where('agentid', $agent['id'])->find();
+        $has_broker = empty($broker) ? 'false' : 'true';
+
+        return view('worker/recruit_detail', ['info' => $info, 'has_broker' => $has_broker]);
     }
 
     /**

+ 12 - 1
app/mobile/view/worker/recruit_detail.html

@@ -48,6 +48,13 @@
             </div>
             <div class="company-name">{{info.company_name}}</div>
         </div>
+        <div class="phone-box" @click="onPhone" v-if="!has_broker">
+            <van-image
+                    width="30px"
+                    src="__MIMAGES__/icon_phone_white.png"
+            ></van-image>
+            <span class="text">拔号</span>
+        </div>
     </div>
     <div class="title">{{info.title}}</div>
     <div class="tags" v-if="info.tags.length > 0">
@@ -120,7 +127,7 @@
     </div>
 </div>
 
-<van-floating-bubble @click="onReport">报备</van-floating-bubble>
+<van-floating-bubble @click="onReport" v-if="has_broker">报备</van-floating-bubble>
 {/block}
 {block name="script"}
 <script>
@@ -130,6 +137,10 @@
         base.active = Vue.ref(0);
 
         base.info = Vue.reactive({$info});
+        base.has_broker = Vue.reactive({$has_broker});
+        base.onPhone = () => {
+            location.href = 'tel:' + base.info.telephone;
+        };
         base.showImage = (index) => {
             vant.showImagePreview({
                 images: base.info.picall,