xiaohaizhao 1 rok pred
rodič
commit
a4653b4563

+ 1 - 1
pages/group/index.js

@@ -93,7 +93,7 @@ Page({
             })
             let myuserid = wx.getStorageSync('userMsg').userid;
             res.data = res.data.map(v => {
-                v.ismyteam = (v.teamleader[0].userid == wx.getStorageSync('userMsg').userid) || this.data.editdataleader;
+                // v.ismyteam = (v.teamleader[0].userid == wx.getStorageSync('userMsg').userid) || this.data.editdataleader;
                 v.total = v.team.length + v.teamleader.length;
                 v.team = v.teamleader.concat(v.team);
                 v.team.map(s => {

+ 8 - 0
pages/group/index.wxml

@@ -1,5 +1,8 @@
 <van-collapse value="{{ activeNames }}" bind:change="onChange">
     <van-collapse-item content-class='content-class' title="{{item.teamleader[0].name+'的团队 ('+item.total+')'}}" name="{{index}}" wx:for="{{teams}}" wx:key="index">
+
+
+	
         <view class="head">
             <view class="search">
                 <van-icon name="search" />
@@ -15,6 +18,11 @@
             <My_empty />
             <view style="height: 30rpx;" />
         </block>
+
+
+
     </van-collapse-item>
+
+
 </van-collapse>
 <My_empty wx:if="{{teams.length==0}}" />

+ 49 - 1
pages/group/modules/list/index.js

@@ -22,7 +22,10 @@ Component({
         addGlobalClass: true
     },
     data: {
-        userid: wx.getStorageSync('userMsg').userid
+        userid: wx.getStorageSync('userMsg').userid,
+        show: false,
+        changeItem: {},
+        loading: false
     },
     methods: {
         /* 处理删除 */
@@ -103,5 +106,50 @@ Component({
                 }
             })
         },
+        changeRadio(e) {
+            this.setData({
+                'changeItem.editable': e.currentTarget.dataset.name
+            })
+        },
+        openPopup(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            this.setData({
+                changeItem: item,
+                show: true
+            })
+        },
+        onCancel() {
+            this.setData({
+                changeItem: {},
+                show: false
+            })
+        },
+        onConfirm() {
+            let that = this;
+            this.setData({
+                loading: true
+            })
+            _Http.basic({
+                "id": "20230302183101",
+                "content": {
+                    "editable": this.data.changeItem.editable,
+                    "sys_datateamid": this.data.changeItem.sys_datateamid
+                },
+            }).then(res => {
+                that.setData({
+                    loading: false
+                })
+                wx.showToast({
+                    title: res.msg == '成功' ? '设置成功' : res.msg,
+                    icon: "none"
+                })
+                if (res.msg == '成功') {
+                    getCurrentPages().find(v => v.__route__ == "pages/group/index").getList();
+                    that.onCancel()
+                }
+            })
+        }
     }
 })

+ 5 - 1
pages/group/modules/list/index.json

@@ -1,4 +1,8 @@
 {
     "component": true,
-    "usingComponents": {}
+    "usingComponents": {
+        "van-swipe-cell": "@vant/weapp/swipe-cell/index",
+        "van-radio": "@vant/weapp/radio/index",
+        "van-radio-group": "@vant/weapp/radio-group/index"
+    }
 }

+ 95 - 0
pages/group/modules/list/index.scss

@@ -79,4 +79,99 @@
     }
 
 
+}
+
+.van-swipe-cell__right {
+    width: 400rpx;
+    display: flex;
+    flex: 1;
+
+    navigator {
+        height: 124rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-size: 28rpx;
+        font-family: PingFang SC, PingFang SC;
+        color: #FFFFFF;
+    }
+
+    .edit {
+        flex: 1;
+        background-color: #F29C37;
+    }
+
+    .delete {
+        width: 160rpx;
+        background-color: #FF3B30;
+    }
+}
+
+
+
+.popup-title {
+    font-size: 28rpx;
+    font-family: PingFang SC, PingFang SC;
+    color: #333333;
+    text-align: center;
+    width: 100%;
+    font-weight: bold;
+    padding: 30rpx 0;
+}
+
+.popup-explain {
+    height: 34rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC, PingFang SC;
+    color: #888888;
+    margin-left: 30rpx;
+}
+
+.popup-item {
+    width: 100%;
+    box-sizing: border-box;
+    padding: 30rpx;
+
+    .label {
+        display: flex;
+        font-size: 28rpx;
+        font-family: PingFang SC, PingFang SC;
+        color: #333333;
+        font-weight: bold;
+    }
+
+    .value {
+        font-size: 24rpx;
+        font-family: PingFang SC, PingFang SC;
+        color: #888888;
+        margin-top: 10rpx;
+        margin-left: 50rpx;
+    }
+
+}
+
+.button-box {
+    display: flex;
+    justify-content: space-between;
+    width: 690rpx;
+    margin: 30rpx auto 30rpx;
+
+    .but {
+        width: 328rpx;
+        height: 90rpx;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+    }
+
+    .cancel {
+        background: #FFFFFF;
+        border: 1rpx solid #CCCCCC;
+        color: #666666;
+    }
+
+    .confirm {
+        background: #3874F6;
+        color: #fff;
+        border: 0;
+    }
 }

+ 55 - 16
pages/group/modules/list/index.wxml

@@ -1,22 +1,61 @@
 <navigator class="group-item" url="#" wx:for="{{list}}" wx:key="changeuserid">
-    <view class="main">
-        <view class="portrait">
-            <image wx:if="{{item.headpic}}" src="{{item.headpic}}" mode="aspectFill" />
-            <view wx:else class="alt">
-                {{item.name[0]}}
+    <van-swipe-cell right-width="{{item.isleader? 0: ismyteam?200:0 }}">
+        <view class="main">
+            <view class="portrait">
+                <image wx:if="{{item.headpic}}" src="{{item.headpic}}" mode="aspectFill" />
+                <view wx:else class="alt">
+                    {{item.name[0]}}
+                </view>
+                <text wx:if="{{item.isleader==1}}" class="iconfont icon-fuzeren" />
             </view>
-            <text wx:if="{{item.isleader==1}}" class="iconfont icon-fuzeren" />
+            <view class="content">
+                <view class="title line-1">
+                    {{item.name}}
+                </view>
+                <view class="role line-1">
+                    职位:{{item.position||" --"}}
+                </view>
+            </view>
+            <!--  <navigator wx:if="{{ismyteam && !item.identity}}" url='#' class="delete-box" data-item="{{item}}" bindtap="{{item.userid!=teamleaderId?'handleDelete':'changeUser'}}">
+            <text class="iconfont {{item.userid!=teamleaderId?'icon-shanchu':'icon-bianji1'}}" />
+        </navigator> -->
+        </view>
+        <view slot="right" class="van-swipe-cell__right">
+            <navigator url="#" class="edit" data-item="{{item}}" bindtap="openPopup">
+                设置权限
+            </navigator>
+            <navigator url="#" class="delete" data-item="{{item}}" bindtap="handleDelete">
+                删除
+            </navigator>
         </view>
-        <view class="content">
-            <view class="title line-1">
-                {{item.name}}
+    </van-swipe-cell>
+</navigator>
+
+
+<van-popup show="{{ show }}" position="bottom" bind:click-overlay='onCancel' z-index='99999999'>
+    <view class="popup-title">
+        设置权限
+    </view>
+    <view class="popup-explain">
+        请设置参与人权限:
+    </view>
+    <van-radio-group value="{{ changeItem.editable+'' }}">
+        <view class="popup-item" bindtap="changeRadio" data-name="1">
+            <view class="label">
+                <van-radio icon-size='16px' name="1" />允许编辑
             </view>
-            <view class="role line-1">
-                职位:{{item.position||" --"}}
+            <view class="value">允许参与人在有授权功能的情况下,可操作参与的数据的功能(包含数据主功能以及tab功能)。</view>
+        </view>
+        <view class="popup-item" bindtap="changeRadio" data-name="0">
+            <view class="label">
+                <van-radio icon-size='16px' name="0" />仅更新合作协议的产品类别折扣
             </view>
+            <view class="value">不允许参与人操作参与的数据的功能。</view>
         </view>
-        <navigator wx:if="{{ismyteam && !item.identity}}" url='#' class="delete-box" data-item="{{item}}" bindtap="{{item.userid!=teamleaderId?'handleDelete':'changeUser'}}">
-            <text class="iconfont {{item.userid!=teamleaderId?'icon-shanchu':'icon-bianji1'}}" />
-        </navigator>
-    </view>
-</navigator>
+
+        <view class="button-box">
+            <van-button custom-class='but cancel' disabled='{{loading}}' bindtap="onCancel">取消</van-button>
+            <van-button custom-class='but confirm' loading='{{loading}}' loading-text='保存中...' bindtap="onConfirm">确定</van-button>
+        </view>
+    </van-radio-group>
+</van-popup>

+ 14 - 0
project.private.config.json

@@ -76,6 +76,20 @@
                     "query": "id=6353",
                     "launchMode": "default",
                     "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/group/index",
+                    "query": "item=%7B%22ownertable%22%3A%22sa_customers%22%2C%22ownerid%22%3A%223768%22%7D",
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "9090",
+                    "pathName": "packageA/setclient/detail",
+                    "query": "id=3768",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }