Kaynağa Gözat

通讯录改版

xiaohaizhao 2 yıl önce
ebeveyn
işleme
e025b1d5f7

+ 27 - 10
packageA/contacts/details.js

@@ -14,6 +14,10 @@ Page({
     onLoad(options) {
         this.handleData(JSON.parse(options.item))
     },
+    //更新标签
+    getTags() {
+        this.selectComponent("#Tags").getTags();
+    },
     handleData(item) {
         this.setData({
             contacts: item,
@@ -47,11 +51,22 @@ Page({
             }, {
                 label: "群组",
                 content: item.groupname
+            }, {
+                label: "来源项目",
+                content: item.projectname
             }, {
                 label: "备注",
                 content: item.remarks
+            }],
+            form2: [{
+                label: "创建人",
+                content: item.createby
+            }, {
+                label: "创建时间",
+                content: item.createdate
             }]
         })
+        this.getTags()
     },
     changeShow() {
         this.setData({
@@ -90,20 +105,26 @@ Page({
     },
     /* 删除 */
     deleteData() {
-        const that = this;
+        const that = this,
+            contacts = this.data.contacts;
+        console.log(contacts.groupname == '项目联系人' ? '20221111130904' : contacts.groupname == '客户联系人' ? "20221018145502" : "20220831164703")
         wx.showModal({
             title: "提示",
-            content: `是否确认删除${this.data.contacts.name}`,
+            content: `是否确认删除${contacts.name}`,
             success({
                 confirm
             }) {
                 if (confirm) _Http.basic({
-                    "id": "20220831164703",
+                    "id": contacts.groupname == '项目联系人' ? '20221111130904' : contacts.groupname == '客户联系人' ? "20221018145502" : "20220831164703",
                     "version": 1,
                     "content": {
-                        "sys_phonebookid": that.data.contacts.sys_phonebookid
+                        "sys_phonebookid": contacts.sys_phonebookid,
+                        "sa_project_contactsids": [contacts.sa_project_contactsid],
+                        "contactsid": contacts.contactsid,
+                        "sys_enterpriseid": contacts.sys_enterpriseid
                     }
                 }).then(res => {
+                    console.log("删除", res)
                     if (res.msg != '成功') return wx.showToast({
                         title: res.data,
                         icon: "none"
@@ -112,10 +133,7 @@ Page({
                         if (v.route === 'packageA/contacts/index') {
                             v.getGroup();
                         } else if (v.route === 'packageA/contacts/list') {
-                            let arr = v.data.phonebook.filter(v => v.sys_phonebookid != that.data.contacts.sys_phonebookid);
-                            v.setData({
-                                phonebook: arr
-                            })
+                            v.getGroup();
                         }
                     });
                     wx.showToast({
@@ -130,6 +148,5 @@ Page({
                 })
             }
         })
-    },
-    onShareAppMessage() {}
+    }
 })

+ 33 - 2
packageA/contacts/details.scss

@@ -1,9 +1,40 @@
-@import './modules/list/index.scss';
-
 .contacts {
+    width: 100vw;
+    background-color: #ffffff;
+    box-sizing: border-box;
     margin-bottom: 20rpx;
+    padding: 20rpx 30rpx;
+    display: flex;
+
+    .portrait {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 96rpx;
+        height: 96rpx;
+        background: #3874F6;
+        border-radius: 50%;
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #FFFFFF;
+        margin-right: 20rpx;
+        flex-shrink: 0;
+    }
+
+    .content {
+        .title {
+            font-size: 30rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #333333;
+        }
+
+        .tag {
+            margin-top: 16rpx;
+        }
+    }
 }
 
+
 .box {
     margin-bottom: 20rpx;
     background-color: #ffffff;

+ 48 - 23
packageA/contacts/details.wxml

@@ -1,33 +1,58 @@
+<!-- <view class="contacts">
+    <view class="circle">{{contacts.name[0]}}</view>
+    <view class="text">
+        <text style="margin-right: 10rpx;">{{contacts.name}}</text>
+    </view>
+</view> -->
+
 <view class="contacts">
-	<view class="circle">{{contacts.name[0]}}</view>
-	<view class="text">
-		<text style="margin-right: 10rpx;">{{contacts.name}}</text>
-		<van-tag plain custom-class='tag' wx:if="{{per.query(contacts.tag1,'关键决策人')}}" type="primary">关键决策人</van-tag>
-		<van-tag plain custom-class='tag' wx:if="{{per.query(contacts.tag1,'支持者')}}" type="warning">支持者</van-tag>
-		<van-tag plain custom-class='tag' wx:if="{{per.query(contacts.tag1,'反对者')}}" type="danger">反对者</van-tag>
-	</view>
+    <view class="portrait">
+        {{contacts.name[0]}}
+    </view>
+    <view class="content">
+        <view class="title">
+            {{contacts.name}}
+        </view>
+        <view class="tag">
+            <Yl-tags wx:if="{{contacts.groupname=='客户联系人'}}" id="Tags" add ownertable='sys_enterprise_contacts' ownerid='{{contacts.contactsid}}' />
+            <Yl-tags wx:elif="{{contacts.groupname=='项目联系人'}}" id="Tags" add ownertable='sa_project_contacts' ownerid='{{contacts.contactsid}}' />
+            <Yl-tags wx:else id="Tags" add ownertable='sys_phonebook' ownerid='{{contacts.sys_phonebookid}}' />
+        </view>
+    </view>
 </view>
+
 <!-- 点击手机号操作 -->
 <van-action-sheet show="{{ show }}" actions="{{ actions }}" z-index='9999' cancel-text="取消" bind:click-overlay='changeShow' bind:select='handleSelect' bind:cancel='changeShow' />
 <view class="box">
-	<navigator url="#" class="row" bindtap="changeShow">
-		<view class="cell">
-			<view class="label">联系方式</view>
-			<view class="content">{{contacts.phonenumber}}
-				<text class="iconfont icon-shujubodadianhua1" style="color: #FA8C16;margin-left: 20rpx;"></text>
-			</view>
-		</view>
-	</navigator>
-	<navigator url="#" class="row" wx:for="{{form1}}" wx:key="label" bindtap="copyContents" data-data="{{item.content}}">
-		<view class="cell">
-			<view class="label">{{item.label}}</view>
-			<view class="content">{{item.content}}</view>
-		</view>
-	</navigator>
+    <navigator url="#" class="row" bindtap="changeShow">
+        <view class="cell">
+            <view class="label">联系方式</view>
+            <view class="content">{{contacts.phonenumber}}
+                <text class="iconfont icon-shujubodadianhua1" style="color: #FA8C16;margin-left: 20rpx;"></text>
+            </view>
+        </view>
+    </navigator>
+    <navigator url="#" class="row" wx:for="{{form1}}" wx:key="label" bindtap="copyContents" data-data="{{item.content}}">
+        <view class="cell">
+            <view class="label">{{item.label}}</view>
+            <view class="content">{{item.content||'--'}}</view>
+        </view>
+    </navigator>
+</view>
+<view style="background-color: #F4F5F7; padding: 0rpx 30rpx 20rpx; font-weight: 600;font-size: 28rpx;">
+    系统信息
+</view>
+<view class="box">
+    <navigator url="#" class="row" wx:for="{{form2}}" wx:key="label" bindtap="copyContents" data-data="{{item.content}}">
+        <view class="cell">
+            <view class="label">{{item.label}}</view>
+            <view class="content">{{item.content||'--'}}</view>
+        </view>
+    </navigator>
 </view>
 <view class="footer">
-	<van-button custom-class='delete' bindtap="deleteData">删除</van-button>
-	<van-button custom-class='edit' bindtap="toEdit">编辑</van-button>
+    <van-button custom-class='delete' bindtap="deleteData">删除</van-button>
+    <van-button custom-class='edit' bindtap="toEdit">编辑</van-button>
 </view>
 <view style="height: 140rpx;" />
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 69 - 142
packageA/contacts/edit.js

@@ -1,8 +1,7 @@
-const _Http = getApp().globalData.http,
-    deleteMark = require("../../utils/deleteMark");
+const _Http = getApp().globalData.http;
 Page({
     data: {
-        sys_phonebookid: 0,
+        isEdit: false,
         form: [{
             label: "姓名",
             error: false,
@@ -125,25 +124,6 @@ Page({
             placeholder: "请填写",
             valueName: "homeaddress",
             required: false, //必填
-        }],
-        from3: [{
-            label: "标签",
-            error: false,
-            errMsg: "",
-            type: "slot",
-            value: "",
-            placeholder: "请填写",
-            valueName: "tag",
-            required: false, //必填
-        }, {
-            label: "群组",
-            error: false,
-            errMsg: "",
-            type: "custom",
-            value: "",
-            placeholder: "请填写",
-            valueName: "sys_phonebookgroupid",
-            required: false, //必填
         }, {
             label: "备注",
             error: false,
@@ -152,26 +132,29 @@ Page({
             value: "",
             placeholder: "请填写",
             valueName: "remarks",
-            required: false, //必填
+            required: false,
         }],
+        content: {
+            sys_phonebookid: 0
+        },
         disabled: true, //按钮禁用
-        groupList: [],
-        groupNameList: [],
-        groupName: null,
-        popupShow: false,
-        checked: false,
-        radio: '',
+        groupname: null,
         loading: false
     },
     onLoad(options) {
+        wx.setNavigationBarTitle({
+            title: '添加联系人'
+        })
         if (options.group) {
             const group = JSON.parse(options.group);
             this.setData({
-                groupName: group.groupname,
-                'from3[1].value': group.sys_phonebookgroupid
+                groupname: group.groupname
+            })
+            this.getGroup();
+        } else if (options.data) {
+            wx.setNavigationBarTitle({
+                title: '修改联系人'
             })
-        };
-        if (options.data) {
             let item = JSON.parse(options.data),
                 disabled = false,
                 arr = item.phonenumber.split("-");
@@ -208,59 +191,30 @@ Page({
                 disabled
             });
             this.data.content = item;
-            if (item.sys_phonebookid) this.setData({
-                sys_phonebookid: item.sys_phonebookid
-            })
-
             this.setData({
-                'from3[0].value': item.tag1,
-                'from3[1].value': item.sys_phonebookgroupid,
-                'from3[2].value': item.remarks,
-                groupName: item.groupname,
-                sys_phonebookid: item.sys_phonebookid,
-                disabled: false
+                groupname: item.groupname,
+                disabled: false,
+                isEdit: true
             });
-            if (item.tag1.length) {
-                let checked = false,
-                    radio = '';
-                item.tag1.forEach(v => {
-                    if (v == '关键决策人') {
-                        checked = true;
-                    } else {
-                        radio = v;
-                    }
-                })
-                this.setData({
-                    checked,
-                    radio
-                })
-            }
-        };
-        this.getGroup();
-        wx.setNavigationBarTitle({
-            title: this.data.sys_phonebookid == 0 ? '添加联系人' : '修改联系人',
-        })
+            if (item.groupname != '客户联系人' && item.groupname != '项目联系人') this.getGroup();
+        } else {
+            this.getGroup();
+        }
     },
     /* 提交表单 */
     submit() {
-        let from = Object.assign(this.selectComponent("#from3").getData().returnData, this.selectComponent("#Form").submit())
-        if (this.data.loading) return;
-        if (from.telephone) {
-            from.phonenumber = from.telephone.join("-");
-            delete(from.telephone)
+        let content = Object.assign(this.data.content, this.selectComponent("#Form").submit());
+        if (content.telephone) {
+            content.phonenumber = content.telephone.join("-");
+            delete(content.telephone)
         }
-        if (from.sys_phonebookgroupid == '') from.sys_phonebookgroupid = 0;
-        if (from.tag == '') from.tag = [];
         this.setData({
             loading: true
         })
         _Http.basic({
-            "id": "20220831164503",
+            "id": content.groupname == '客户联系人' || content.groupname == '项目联系人' ? '20221018141802' : "20220831164503",
             "version": 1,
-            "content": {
-                "sys_phonebookid": this.data.sys_phonebookid, //sys_phonebookid<=0时 为新增
-                ...from
-            }
+            content
         }).then(res => {
             console.log("新建联系人", res)
             this.setData({
@@ -270,31 +224,33 @@ Page({
                 title: res.data,
                 icon: "none"
             })
-            res.data.tag1 = res.data.tag.length ? JSON.parse(res.data.tag) : ""
             getCurrentPages().forEach(v => {
                 if (v.route === 'packageA/contacts/index') {
                     v.getGroup();
                 } else if (v.route === 'packageA/contacts/list') {
-                    let arr = v.data.phonebook,
-                        index = arr.findIndex(value => value.sys_phonebookid == res.data.sys_phonebookid);
-                    (index === -1) ? arr.push(res.data): arr[index] = res.data;
-                    v.setData({
-                        phonebook: arr
-                    })
+                    v.getGroup();
                 } else if (v.route === 'packageA/contacts/details') {
                     v.handleData(res.data);
                 }
             });
+            let isEdit = this.data.isEdit;
             wx.showToast({
-                title: this.data.sys_phonebookid == 0 ? '添加成功' : '保存成功'
-            })
+                title: isEdit ? '保存成功' : '添加成功',
+                mask: true
+            });
             this.setData({
                 disabled: true,
             })
             setTimeout(() => {
-                wx.navigateBack({
-                    delta: 0
-                })
+                if (isEdit) {
+                    wx.navigateBack({
+                        delta: 0
+                    })
+                } else {
+                    wx.redirectTo({
+                        url: '/packageA/contacts/details?item=' + JSON.stringify(res.data),
+                    })
+                }
             }, 700);
         })
     },
@@ -337,13 +293,15 @@ Page({
             this.setData({
                 form
             })
+        } else if (data.label == '群组') {
+            this.data.content.sys_phonebookgroupid = data.range.find(v => v.groupname == data.value).sys_phonebookgroupid;
         }
     },
     /* 监听表单必填项 */
     onConfirm({
         detail
     }) {
-        if (detail !== this.data.disabled) this.setData({
+        this.setData({
             disabled: detail
         })
     },
@@ -363,62 +321,31 @@ Page({
                 title: res.msg,
                 icon: "none"
             })
-            const data = res.data.filter(v => v.groupname != '客户联系人' && v.groupname != '项目联系人');
+            const range = res.data.filter(v => v.groupname != '客户联系人' && v.groupname != '项目联系人').map(v => {
+                    delete(v.count)
+                    delete(v.phonebook)
+                    delete(v.rowindex)
+                    return v
+                }),
+                groupname = this.data.groupname || '默认群组';
+            let form = this.data.form;
+            form.splice(form.length - 1, 0, {
+                label: "群组",
+                error: false,
+                errMsg: "",
+                type: "selector",
+                range,
+                rangeKey: "groupname",
+                rangeIndex: range.findIndex(v => v.groupname == groupname),
+                value: groupname,
+                placeholder: "选择群组",
+                valueName: "groupname",
+                required: false, //必填
+                interrupt: true
+            })
             this.setData({
-                groupList: data,
-                groupNameList: data.map(v => v.groupname)
+                form
             })
         });
-    },
-    /* 选择群组 */
-    bindPickerChange(e) {
-        const {
-            returnData
-        } = this.selectComponent("#from3").getData()
-        this.setData({
-            'from3[1].value': this.data.groupList[e.detail.value - 0].sys_phonebookgroupid,
-            groupName: this.data.groupNameList[e.detail.value - 0],
-            'from3[0].value': returnData.tag,
-            'from3[2].value': returnData.remarks
-        });
-    },
-    /* 打开弹出层 */
-    openPopup() {
-        this.setData({
-            popupShow: true
-        })
-    },
-    /* 关闭弹出层 */
-    closePopup() {
-        this.setData({
-            popupShow: false
-        })
-    },
-    /* 确定标签 */
-    handleTag() {
-        let tagArr = [];
-        if (this.data.checked) tagArr.push("关键决策人");
-        if (this.data.radio) tagArr.push(this.data.radio);
-        const {
-            returnData
-        } = this.selectComponent("#from3").getData()
-        this.setData({
-            'from3[0].value': tagArr,
-            'from3[1].value': returnData.sys_phonebookgroupid,
-            'from3[2].value': returnData.remarks
-        });
-        this.closePopup()
-    },
-    /* 是否关键决策人 */
-    changeChecked() {
-        this.setData({
-            checked: !this.data.checked
-        })
-    },
-    /* 单选 */
-    onChange(e) {
-        this.setData({
-            radio: e.currentTarget.dataset.name
-        })
     }
 })

+ 3 - 45
packageA/contacts/edit.wxml

@@ -1,50 +1,8 @@
 <Yl_field id='Form' form='{{form}}' bind:onConfirm='onConfirm' bind:interrupt='interrupt' />
-<view style="height: 20rpx;" />
-<My_form id='from3' fromList='{{from3}}'>
-	<view slot='slot' style="width: 100%;" bindtap="openPopup">
-		<view wx:if="{{from3[0].value}}">
-			<van-tag plain custom-class='tag' wx:if="{{per.query(from3[0].value,'支持者')}}" type="warning">支持者</van-tag>
-			<van-tag plain custom-class='tag' wx:if="{{per.query(from3[0].value,'反对者')}}" type="danger">反对者</van-tag>
-			<van-tag plain custom-class='tag' wx:if="{{per.query(from3[0].value,'关键决策人')}}" type="primary">关键决策人</van-tag>
-		</view>
-		<text wx:else style="color: rgba(0, 0, 0, .3); font-size: 28rpx;">请选择</text>
-	</view>
-	<view slot='slot1' style="width: 100%;">
-		<picker bindchange="bindPickerChange" value="{{groupname}}" range="{{groupNameList}}">
-			<text wx:if="{{groupName}}">{{groupName}}</text>
-			<text wx:else style="color: rgba(0, 0, 0, .3); font-size: 28rpx;">请选择</text>
-		</picker>
-	</view>
-</My_form>
-<view style="height: 200rpx;">
-	
-</view>
-
-<!-- 标签弹出层 -->
-<van-popup show="{{ popupShow }}" position="bottom" custom-style="height: 530rpx;" round bind:close="closePopup">
-	<view class="popup-title">选择联系人标签</view>
-	<van-cell title="关键决策人" value-class="value-class" clickable bind:click="changeChecked">
-		<van-checkbox catch:tap="noop" custom-class="checkboxes" bind:tap="changeChecked" value="{{ checked }}" />
-	</van-cell>
-	<van-radio-group value="{{ radio }}">
-		<van-cell-group>
-			<van-cell title="支持者" clickable data-name="支持者" bind:click="onChange">
-				<van-radio slot="right-icon" name="支持者" />
-			</van-cell>
-			<van-cell title="反对者" clickable data-name="反对者" bind:click="onChange">
-				<van-radio slot="right-icon" name="反对者" />
-			</van-cell>
-		</van-cell-group>
-	</van-radio-group>
-	<view class="popup-button">
-		<van-button custom-class='but' type="default" bindtap="closePopup">取消</van-button>
-		<van-button custom-class='but' type="info" bindtap="handleTag">确定</van-button>
-	</view>
-</van-popup>
-
+<view style="height: 130rpx;" />
 <view class="footer">
-	<van-button wx:if="{{sys_phonebookid==0}}" custom-class='button' loading='{{loading}}' loading-text="添加中..." disabled='{{disabled}}' color="#3874F6" bindclick="submit">确定添加</van-button>
-	<van-button wx:else custom-class='button' disabled='{{disabled}}' loading='{{loading}}' loading-text="保存中..." color="#FA8C16" bindclick="submit">保存</van-button>
+    <van-button wx:if="{{isEdit}}" custom-class='button' disabled='{{disabled}}' loading='{{loading}}' loading-text="保存中..." color="#FA8C16" bindclick="submit">保存</van-button>
+    <van-button wx:else custom-class='button' loading='{{loading}}' loading-text="添加中..." disabled='{{disabled}}' color="#3874F6" bindclick="submit">确定添加</van-button>
 </view>
 
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 9 - 4
packageA/contacts/index.js

@@ -38,8 +38,13 @@ Page({
                 title: res.msg,
                 icon: "none"
             })
-            console.log(res.data)
+            console.log("123123", res.data)
             if (condition != '') return res.data;
+
+            res.data = res.data.map(v => {
+                delete(v.phonebook)
+                return v
+            })
             let systemGroup = [],
                 myGroup = [];
             res.data.forEach(v => ['默认群组', '客户联系人', '项目联系人'].includes(v.groupname) ? systemGroup.push(v) : myGroup.push(v));
@@ -51,10 +56,10 @@ Page({
     },
     toCheckList(e) {
         const {
-            item
+            groupname
         } = e.currentTarget.dataset;
         wx.navigateTo({
-            url: './list?item=' + JSON.stringify(item),
+            url: './list?groupname=' + groupname,
         })
     },
     /* 删除自定义分组 */
@@ -89,7 +94,7 @@ Page({
                         myGroup
                     })
                     wx.showToast({
-                      title: '删除成功',
+                        title: '删除成功',
                     })
                 })
             }

+ 4 - 4
packageA/contacts/index.wxml

@@ -3,13 +3,13 @@
 <!-- 系统分组 -->
 <view class="group-box">
     <view class="title">系统群组</view>
-    <navigator url="#" class="group" wx:for="{{systemGroup}}" wx:key="groupname" bindtap="toCheckList" data-item="{{item}}">
+    <navigator url="#" class="group" wx:for="{{systemGroup}}" wx:key="groupname" bindtap="toCheckList" data-groupname="{{item.groupname}}">
         <view class="icon" style="background: #FA8C16;">
             <text class="iconfont icon-xiaochengxu_qunzu" />
         </view>
         <view class="text">
             <view class="name">{{item.groupname}}</view>
-            <view class="count">已有 {{item.phonebook.length}} 人</view>
+            <view class="count">已有 {{item.count}} 人</view>
         </view>
         <van-icon size='14' color='#D2D2D2' name="arrow" />
     </navigator>
@@ -19,13 +19,13 @@
     <view class="title">自定义群组</view>
     <van-swipe-cell id="swipe-cell" async-close right-width="{{ 120 }}" wx:for="{{myGroup}}" wx:key="groupname" bind:close="onClose">
         <van-cell-group>
-            <navigator url="#" class="group" bindtap="toCheckList" data-item="{{item}}">
+            <navigator url="#" class="group" bindtap="toCheckList" data-groupname="{{item.groupname}}">
                 <view class="icon" style="background: #52C41A;">
                     <text class="iconfont icon-xiaochengxu_qunzu" />
                 </view>
                 <view class="text">
                     <view class="name">{{item.groupname}}</view>
-                    <view class="count">已有 {{item.phonebook.length}} 人</view>
+                    <view class="count">已有 {{item.count}} 人</view>
                 </view>
                 <van-icon size='14' color='#D2D2D2' name="arrow" />
             </navigator>

+ 94 - 4
packageA/contacts/list.js

@@ -1,10 +1,81 @@
+const _Http = getApp().globalData.http;
+
 Page({
     data: {
+        showFiltrate: false,
         phonebook: [],
-        group: {}
+        group: {},
+        "where": {
+            "condition": "",
+            "groupname": "",
+            "tag": ""
+        }
     },
     onLoad(options) {
-        const item = JSON.parse(options.item);
+        if (options.item) {
+            this.randerList(JSON.parse(options.item))
+        } else if (options.groupname) {
+            this.setData({
+                "where.groupname": options.groupname,
+                "group.groupname": options.groupname,
+            })
+            this.getGroup();
+            if (options.groupname != '搜索') {
+                let param = {
+                    "id": 20220929085401,
+                    "content": {
+                        "ownertable": "sys_phonebook",
+                        "ownerid": "0"
+                    }
+                };
+                switch (options.groupname) {
+                    case '客户联系人':
+                        param.content.ownertable = 'sys_enterprise_contacts';
+                        break;
+                    case '项目联系人':
+                        param.content.ownertable = 'sa_project_contacts';
+                        break;
+                    default:
+                        param.content.ownertable = 'sys_phonebook';
+                        break;
+                }
+                _Http.basic(param).then(res => {
+                    console.log("获取标签", res)
+                    this.setData({
+                        filtratelist: [{
+                            label: "标签",
+                            index: null,
+                            showName: "tag", //显示字段
+                            valueKey: "tag", //返回Key
+                            selectKey: "tag", //传参 代表选着字段 不传参返回整个选择对象
+                            value: "", //选中值
+                            list: res.data.systemtag.concat(res.data.option)
+                        }]
+                    })
+                })
+            }
+        }
+    },
+    /* 获取分组 */
+    getGroup() {
+        const where = this.data.where;
+        _Http.basic({
+            "id": "20220831164603",
+            "version": 1,
+            "content": {
+                "nocache": true,
+                where
+            }
+        }).then(res => {
+            console.log("123123", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: "获取失败",
+                icon: "none"
+            })
+            this.randerList(res.data.find(v => v.groupname == where.groupname))
+        })
+    },
+    randerList(item) {
         console.log(item)
         wx.setNavigationBarTitle({
             title: item.groupname,
@@ -14,7 +85,8 @@ Page({
             group: {
                 groupname: item.groupname,
                 sys_phonebookgroupid: item.sys_phonebookgroupid
-            }
+            },
+            "where.groupname": item.groupname
         })
     },
     toAddContacts() {
@@ -22,5 +94,23 @@ Page({
             url: '../contacts/edit?group=' + JSON.stringify(this.data.group),
         })
     },
-    onShareAppMessage() {}
+    onSearch({
+        detail
+    }) {
+        this.data.where.condition = detail;
+        this.getGroup()
+    },
+    onClick() {
+        this.setData({
+            showFiltrate: true
+        })
+    },
+    handleFilter({
+        detail
+    }) {
+        this.setData({
+            "where.tag": detail.tag || ""
+        })
+        this.getGroup()
+    }
 })

+ 4 - 2
packageA/contacts/list.json

@@ -1,6 +1,8 @@
 {
     "usingComponents": {
         "add": "./modules/add/index",
-        "list": "./modules/list/index"
-    }
+        "list": "./modules/list/index",
+        "van-sticky": "@vant/weapp/sticky/index"
+    },
+    "navigationBarTitleText": "群组"
 }

+ 11 - 0
packageA/contacts/list.scss

@@ -0,0 +1,11 @@
+.search {
+    position: sticky;
+    top: 0;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    background-color: #fff;
+
+    .action {
+        color: #666;
+        padding: 0 10rpx;
+    }
+}

+ 17 - 3
packageA/contacts/list.wxml

@@ -1,3 +1,17 @@
-<add bind:callBack='toAddContacts' wx:if="{{group.groupname!='客户联系人'&&group.groupname!='项目联系人'&&group.groupname!='搜索'}}" />
-<view style="height: 20rpx;" />
-<list phonebook='{{phonebook}}'></list>
+<block wx:if="{{group.groupname!='搜索'}}">
+    <view class="search">
+        <van-search value="{{ value }}" shape="round" placeholder="请输入搜索关键词" use-action-slot bind:search="onSearch" bind:clear='onSearch'>
+            <navigator class="action" url="#" slot="action" bind:tap="onClick">
+                <text class="iconfont icon-shaixuan" />
+                筛选
+            </navigator>
+        </van-search>
+    </view>
+    <view style="height: 20rpx;" />
+</block>
+<block wx:if="{{group.groupname!='客户联系人' && group.groupname!='项目联系人' && group.groupname!='搜索'}}">
+    <add bind:callBack='toAddContacts' />
+    <view style="height: 20rpx;" />
+</block>
+<list phonebook='{{phonebook}}' />
+<Yl_Filtrate1 show='{{showFiltrate}}' list="{{filtratelist}}" bindhandle="handleFilter" />

+ 1 - 9
packageA/contacts/modules/list/index.js

@@ -1,17 +1,9 @@
-// packageA/contacts/modules/list/index.js
 Component({
-    /**
-     * 组件的属性列表
-     */
     properties: {
         phonebook: {
-            type:Array
+            type: Array
         }
     },
-    data: {
-
-    },
-
     methods: {
         toDetails(e) {
             const {

+ 1 - 5
packageA/contacts/modules/list/index.wxml

@@ -2,11 +2,7 @@
     <view class="circle">{{item.name[0]}}</view>
     <view class="text">
         <text style="margin-right: 10rpx;">{{item.name}}</text>
-        <van-tag plain custom-class='tag' wx:if="{{per.query(item.tag1,'关键决策人')}}" type="primary">关键决策人</van-tag>
-        <van-tag plain custom-class='tag' wx:if="{{per.query(item.tag1,'支持者')}}" type="warning">支持者</van-tag>
-        <van-tag plain custom-class='tag' wx:if="{{per.query(item.tag1,'反对者')}}" type="danger">反对者</van-tag>
     </view>
     <van-icon size='14' color='#D2D2D2' name="arrow" />
 </navigator>
-<My_empty wx:if="{{!phonebook.length}}" />
-<wxs src='../../../../utils/wxmlQueryPer.wxs' module="per" />
+<My_empty wx:if="{{!phonebook.length}}" />