zhaoxiaohai před 3 roky
rodič
revize
58fe34cbd7

+ 10 - 1
pages/threadedTree/details/index.js

@@ -30,9 +30,13 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
+        let auth = [];
+        if (options.auth) auth = options.auth.split(",");
+
         this.setData({
             sat_orderclueid: options.id,
-            tagColor: options.color
+            tagColor: options.color,
+            auth
         })
         this.selectDetail();
         this.getFollowList();
@@ -189,6 +193,11 @@ Page({
         });
         this.getFollowList();
     },
+    callOut(e) {
+        wx.makePhoneCall({
+            phoneNumber: e.currentTarget.dataset.phonenumber
+        })
+    },
     onUnload() {
         if (this.data.isEdit) {
             let pages = getCurrentPages();

+ 6 - 4
pages/threadedTree/details/index.wxml

@@ -7,7 +7,7 @@
         <view class="label">客户名称</view>
         <view class="con line-1">{{detailsData.name}}</view>
     </view>
-    <view>
+    <view bindtap="callOut" data-phonenumber="{{detailsData.phonenumber}}">
         <view class="label">手机号码</view>
         <view class="con">{{detailsData.phonenumber}}</view>
     </view>
@@ -37,11 +37,11 @@
         <view class="iconfont icon-a-yingxiaowuliaofuzhi" />
         <view class="text">跟进</view>
     </navigator>
-    <navigator url="#" data-name="线索编辑" catchtap="openPoput">
+    <navigator wx:if="{{per.query(auth,'修改')}}" url="#" data-name="线索编辑" catchtap="openPoput">
         <view class="iconfont icon-a-yingxiaowuliaofuzhi" />
         <view class="text">编辑</view>
     </navigator>
-    <navigator url="#" data-name="线索转移" catchtap="openPoput">
+    <navigator wx:if="{{per.query(auth,'转移')}}" url="#" data-name="线索转移" catchtap="openPoput">
         <view class="iconfont icon-a-yingxiaowuliaofuzhi" />
         <view class="text">转移</view>
     </navigator>
@@ -75,4 +75,6 @@
         <text catchtap="determineScope">确定</text>
     </view>
     <My_datePicker bind:getDate='getDate' />
-</van-action-sheet>
+</van-action-sheet>
+
+<wxs src='../../../utils/wxmlQueryPer.wxs' module="per" />

+ 5 - 1
pages/threadedTree/details/modules/details/index.js

@@ -23,6 +23,10 @@ Component({
      * 组件的方法列表
      */
     methods: {
-
+        callOut(e) {
+            wx.makePhoneCall({
+                phoneNumber: e.currentTarget.dataset.phonenumber
+            })
+        },
     }
 })

+ 1 - 1
pages/threadedTree/details/modules/details/index.wxml

@@ -1,6 +1,6 @@
 <view class="title">线索详情</view>
 <van-cell title-width='130px' clickable title-class='title-class' title="客户名称" value="{{detailsData.name}}" />
-<van-cell title-width='130px' clickable title-class='title-class' title="手机号码" value="{{detailsData.phonenumber}}">
+<van-cell title-width='130px' clickable title-class='title-class' title="手机号码" value="{{detailsData.phonenumber}}" catchtap="callOut" data-phonenumber="{{detailsData.phonenumber}}">
     <view slot='right-icon'>
         <text class="iconfont icon-bodadianhua"></text>
     </view>

+ 7 - 0
pages/threadedTree/index.js

@@ -20,6 +20,13 @@ Page({
         isReverse: false,
     },
     onLoad(options) {
+        if (options.auth) {
+            let auth = [];
+            JSON.parse(options.auth)[0].meta.auth.forEach(v => auth.push(v.optionname))
+            this.setData({
+                auth
+            })
+        };
         this.getList()
     },
     /* 打开弹窗 */

+ 5 - 3
pages/threadedTree/index.wxml

@@ -10,12 +10,12 @@
 </van-tabs>
 
 <!-- 浮动按钮 -->
-<FloatingButton>
+<FloatingButton wx:if="{{per.query(auth,'新增')}}">
     <image style="width: 130rpx; height: 130rpx; transform: translate(-50%,-50%);" src='../../static/image/add.png' data-title="新建线索" bindtap="openSheet" />
 </FloatingButton>
 
 <My_listBox id='ListBox' bindgetlist="getList" height='{{scrollHeight}}'>
-    <List list='{{list}}' tagColor='{{tagColor}}' />
+    <List list='{{list}}' tagColor='{{tagColor}}' auth="{{auth}}" />
     <My_empty wx:if="{{list.length==0}}" />
     <view style="height: 50px;" />
 </My_listBox>
@@ -23,4 +23,6 @@
 <!-- 抽屉 -->
 <Popup sheetTitle='{{sheetTitle}}'>
     <Insert wx:if="{{initInsert}}" type="{{sheetTitle}}" bind:endInsert='endInsert' />
-</Popup>
+</Popup>
+
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 3 - 4
pages/threadedTree/modules/list/list.js

@@ -4,13 +4,12 @@ Component({
      * 组件的属性列表
      */
     properties: {
-        list: {
-            type: Array
-        },
+        list: Array,
         tagColor: {
             type: String,
             value: "#FA8C16"
-        }
+        },
+        auth: Array
     },
     options: {
         addGlobalClass: true

+ 1 - 1
pages/threadedTree/modules/list/list.wxml

@@ -1,4 +1,4 @@
-<navigator class="box" url="/pages/threadedTree/details/index?id={{item.sat_orderclueid}}&color={{tagColor!='#ffffff'?tagColor:''}}" wx:for="{{list}}">
+<navigator class="box" url="/pages/threadedTree/details/index?id={{item.sat_orderclueid}}&color={{tagColor!='#ffffff'?tagColor:''}}&auth={{auth}}" wx:for="{{list}}">
     <view class="title line-1">{{item.name}}</view>
     <view>最近跟进时间:{{item.followtime?item.followtime:'暂未跟进'}}</view>
     <view class="line-1">地址:{{item.province+item.city+item.county+item.address}}</view>