Browse Source

联系人

zhaoxiaohai 2 năm trước cách đây
mục cha
commit
b73000e490

+ 82 - 0
packageA/contacts/details.js

@@ -0,0 +1,82 @@
+Page({
+    data: {
+        contacts: [],
+        form1: [],
+        form2: [],
+        show: false,
+        actions: [{
+            name: "呼叫"
+        }, {
+            name: "复制"
+        }]
+    },
+    onLoad(options) {
+        this.handleData(JSON.parse(options.item))
+    },
+    handleData(item) {
+        const form1 = [{
+                label: "性别",
+                content: item.sex
+            }, {
+                label: "生日",
+                content: item.birthday
+            }, {
+                label: "家庭住址",
+                content: item.homeaddress
+            }, {
+                label: "邮箱",
+                content: item.email
+            }],
+            form2 = [{
+                label: "单位",
+                content: item.company
+            }, {
+                label: "部门",
+                content: item.depname
+            }, {
+                label: "职位",
+                content: item.position
+            }]
+        this.setData({
+            contacts: item,
+            form1,
+            form2
+        })
+    },
+    changeShow() {
+        this.setData({
+            show: !this.data.show
+        })
+    },
+    /* 处理选择 */
+    handleSelect(e) {
+        let phone = this.data.contacts.phonenumber;
+        if (e.detail.name == '复制') {
+            wx.setClipboardData({
+                data: phone
+            });
+        } else {
+            wx.makePhoneCall({
+                phoneNumber: phone,
+            })
+        };
+        this.changeShow()
+    },
+    /* 拷贝内容 */
+    copyContents(e) {
+        const {
+            data
+        } = e.currentTarget.dataset;
+        if (data) wx.setClipboardData({
+            data,
+        });
+    },
+    /* 去编辑 */
+    toEdit() {
+        let data = JSON.stringify(this.data.contacts);
+        wx.navigateTo({
+            url: '../contacts/edit?data=' + data,
+        })
+    },
+    onShareAppMessage() {}
+})

+ 4 - 0
packageA/contacts/details.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "联系人详情"
+}

+ 83 - 0
packageA/contacts/details.scss

@@ -0,0 +1,83 @@
+@import './modules/list/index.scss';
+
+.contacts {
+    margin-bottom: 20rpx;
+}
+
+.box {
+    margin-bottom: 20rpx;
+    background-color: #ffffff;
+
+    .row {
+        width: 100vw;
+        box-sizing: border-box;
+        padding-left: 30rpx;
+
+        .cell {
+            display: flex;
+            justify-content: space-between;
+            width: 100%;
+            padding: 30rpx 30rpx 28rpx 0;
+            border-bottom: 2rpx solid #DDDDDD;
+            box-sizing: border-box;
+
+            .label {
+                width: 200rpx;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #000000;
+                flex-shrink: 0;
+            }
+
+            .content {
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #333333;
+            }
+        }
+    }
+
+    .row:last-child {
+        .cell {
+            padding-bottom: 30rpx;
+            border-bottom: none;
+        }
+    }
+}
+
+/* 底部 */
+.footer {
+    position: fixed;
+    display: flex;
+    justify-content: space-between;
+    width: 100vw;
+    padding: 20rpx 30rpx;
+    bottom: 0;
+    box-sizing: border-box;
+    background-color: #ffffff;
+    z-index: 999;
+
+    .delete {
+        width: 200rpx;
+        height: 90rpx;
+        background: #FFFFFF;
+        border-radius: 100rpx;
+        border: 1px solid #CCCCCC;
+
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #999999;
+    }
+
+    .edit {
+        width: 460rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 100rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+    }
+}

+ 49 - 0
packageA/contacts/details.wxml

@@ -0,0 +1,49 @@
+<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>
+<!-- 点击手机号操作 -->
+<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="item.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="box">
+    <navigator url="#" class="row" wx:for="{{form2}}" wx:key="item.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="box">
+    <navigator url="#" class="row" bindtap="copyContents" data-data="{{contacts.remarks}}">
+        <view class="cell">
+            <view class="label">备注</view>
+            <view class="content">{{contacts.remarks}}</view>
+        </view>
+    </navigator>
+</view>
+<view class="footer">
+    <van-button custom-class='delete'>删除</van-button>
+    <van-button custom-class='edit' bindtap="toEdit">编辑</van-button>
+</view>
+<view style="height: 140rpx;" />
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 326 - 0
packageA/contacts/edit.js

@@ -0,0 +1,326 @@
+const _Http = getApp().globalData.http,
+    deleteMark = require("../../utils/deleteMark");
+Page({
+    data: {
+        sys_phonebookid: 0,
+        from1: [{
+            label: "姓名",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "name", //绑定的字段名称
+            required: true, //必填
+        }, {
+            label: "手机号码",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "phonenumber", //绑定的字段名称
+            required: true, //必填
+            callback: null,
+        }, {
+            label: "性别",
+            error: false,
+            errMsg: "",
+            type: "sex",
+            value: "",
+            placeholder: "请填写",
+            valueName: "sex",
+            required: false, //必填
+        }, {
+            label: "生日",
+            error: false,
+            errMsg: "",
+            type: "date",
+            value: "",
+            placeholder: "请填写",
+            valueName: "birthday",
+            required: false, //必填
+        }, {
+            label: "家庭住址",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "homeaddress",
+            required: false, //必填
+        }, {
+            label: "邮箱",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "email",
+            required: false, //必填
+        }],
+        from2: [{
+            label: "单位",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "company",
+            required: false, //必填
+        }, {
+            label: "部门",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "depname",
+            required: false, //必填
+        }, {
+            label: "职位",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "position",
+            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,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "请填写",
+            valueName: "remarks",
+            required: false, //必填
+        }],
+        disabled: true, //按钮禁用
+        groupList: [],
+        groupNameList: [],
+        groupName: null,
+        popupShow: false,
+        checked: false,
+        radio: '',
+        loading: false
+    },
+    onLoad(options) {
+        if (options.group) {
+            const group = JSON.parse(options.group);
+            this.setData({
+                groupName: group.groupname,
+                'from3[1].value': group.sys_phonebookgroupid
+            })
+        };
+        if (options.data) {
+            const item = JSON.parse(options.data);
+            this.setData({
+                'from1[0].value': item.name,
+                'from1[1].value': item.phonenumber,
+                'from1[2].value': item.sex,
+                'from1[3].value': item.birthday,
+                'from1[4].value': item.homeaddress,
+                'from1[5].value': item.email,
+                'from2[0].value': item.company,
+                'from2[1].value': item.depname,
+                'from2[2].value': item.position,
+                '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
+            });
+            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 ? '添加联系人' : '修改联系人',
+        })
+    },
+    /* 监听表单必填项 */
+    form1CompletedOrNot({
+        detail
+    }) {
+        this.setData({
+            disabled: !detail
+        })
+    },
+    /* 提交表单 */
+    submit() {
+        if (this.data.disabled) return wx.showToast({
+            title: '请完成必填项',
+            icon: "none"
+        })
+        let from = {
+            ...this.selectComponent("#from1").getData().returnData,
+            ...this.selectComponent("#from2").getData().returnData,
+            ...this.selectComponent("#from3").getData().returnData,
+        }
+        if (!deleteMark.CheckPhoneNumber(from.phonenumber)) return;
+        if (from.email && !deleteMark.CheckEmail(from.email)) return;
+        if (from.sys_phonebookgroupid == '') from.sys_phonebookgroupid = 0;
+        if (from.tag == '') from.tag = [];
+        this.setData({
+            loading: true
+        })
+        _Http.basic({
+            "id": "20220831164503",
+            "version": 1,
+            "content": {
+                "sys_phonebookid": this.data.sys_phonebookid, //sys_phonebookid<=0时 为新增
+                ...from
+            }
+        }).then(res => {
+            this.setData({
+                loading: false
+            })
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            try {
+                res.data.tag1 = 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
+                        })
+                    } else if (v.route === 'packageA/contacts/details') {
+                        v.handleData(res.data);
+                    }
+                });
+            } catch (e) {
+                wx.showToast({
+                    title: `错误!${e}`,
+                    icon: "none"
+                })
+            };
+            wx.showToast({
+                title: this.data.sys_phonebookid == 0 ? '添加成功' : '保存成功'
+            })
+            this.setData({
+                disabled: true,
+            })
+            setTimeout(() => {
+                wx.navigateBack({
+                    delta: 0
+                })
+            }, 700);
+        })
+    },
+    /* 获取分组 */
+    getGroup() {
+        _Http.basic({
+            "id": "20220831164603",
+            "version": 1,
+            "content": {
+                "nocache": true,
+                "where": {
+                    "condition": ""
+                }
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            })
+            const data = res.data.filter(v => v.groupname != '客户联系人' && v.groupname != '项目联系人');
+            this.setData({
+                groupList: data,
+                groupNameList: data.map(v => v.groupname)
+            })
+        });
+    },
+    /* 选择部门 */
+    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
+        })
+    },
+    onShareAppMessage() {}
+})

+ 8 - 0
packageA/contacts/edit.json

@@ -0,0 +1,8 @@
+{
+    "usingComponents": {
+        "My_form": "/components/My_form/index",
+        "van-checkbox": "@vant/weapp/checkbox/index",
+        "van-radio": "@vant/weapp/radio/index",
+        "van-radio-group": "@vant/weapp/radio-group/index"
+    }
+}

+ 54 - 0
packageA/contacts/edit.scss

@@ -0,0 +1,54 @@
+.checkboxes {
+    justify-content: flex-end;
+    font-size: 0 !important;
+}
+
+.popup-title {
+    height: 80rpx;
+    line-height: 80rpx;
+    text-align: center;
+    font-weight: 700;
+    font-size: 30rpx;
+}
+
+.popup-button {
+    width: 100%;
+    display: flex;
+    justify-content: space-around;
+    box-sizing: border-box;
+    padding: 0 80rpx;
+    margin-top: 30rpx;
+
+    .but {
+        width: 180rpx;
+        height: 80rpx;
+        border-radius: 8rpx;
+    }
+}
+
+.tag {
+    height: 40rpx;
+    padding: 0 15rpx;
+    margin-right: 10rpx;
+    border-radius: 8rpx;
+}
+
+.footer {
+    text-align: center;
+    position: fixed;
+    bottom: 0;
+    width: 100vw;
+    padding: 20rpx 0;
+    background-color: #ffffff;
+    z-index: 99;
+
+    .button {
+        width: 500rpx;
+        height: 90rpx;
+        border-radius: 100rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+    }
+}

+ 49 - 0
packageA/contacts/edit.wxml

@@ -0,0 +1,49 @@
+<My_form id='from1' fromList='{{from1}}' bindCompletedOrNot='form1CompletedOrNot'>
+</My_form>
+<view style="height: 20rpx;" />
+<My_form id='from2' fromList='{{from2}}' />
+<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>
+<!-- 标签弹出层 -->
+<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 class="footer">
+    <van-button wx:if="{{sys_phonebookid==0}}" custom-class='button' loading='{{loading}}' loading-text="添加中..." disabled='{{disabled}}' color="#3874F6" bindtap="submit">确定添加</van-button>
+    <van-button wx:else custom-class='button' disabled='{{disabled}}' loading='{{loading}}' loading-text="保存中..." color="#FA8C16" bindtap="submit">保存</van-button>
+</view>
+
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 26 - 0
packageA/contacts/list.js

@@ -0,0 +1,26 @@
+Page({
+    data: {
+        phonebook: [],
+        group: {}
+    },
+    onLoad(options) {
+        const item = JSON.parse(options.item);
+        console.log(item)
+        wx.setNavigationBarTitle({
+            title: item.groupname,
+        })
+        this.setData({
+            phonebook: item.phonebook,
+            group: {
+                groupname: item.groupname,
+                sys_phonebookgroupid: item.sys_phonebookgroupid
+            }
+        })
+    },
+    toAddContacts() {
+        wx.navigateTo({
+            url: '../contacts/edit?group=' + JSON.stringify(this.data.group),
+        })
+    },
+    onShareAppMessage() {}
+})

+ 6 - 0
packageA/contacts/list.json

@@ -0,0 +1,6 @@
+{
+    "usingComponents": {
+        "add": "./modules/add/index",
+        "list": "./modules/list/index"
+    }
+}

+ 0 - 0
packageA/contacts/list.scss


+ 3 - 0
packageA/contacts/list.wxml

@@ -0,0 +1,3 @@
+<add bind:callBack='toAddContacts' wx:if="{{group.groupname!='客户联系人'&&group.groupname!='项目联系人'&&group.groupname!='搜索'}}" />
+<view style="height: 20rpx;" />
+<list phonebook='{{phonebook}}'></list>

+ 63 - 0
packageA/contacts/modules/add/index.js

@@ -0,0 +1,63 @@
+const _Http = getApp().globalData.http,
+    dMark = require('../../../../utils/deleteMark');
+Component({
+    properties: {
+        isGroup: true,
+        callBack: {
+            type: Function
+        }
+    },
+    data: {
+        show: false,
+        groupName: ''
+    },
+    methods: {
+        addGroup() {
+            this.setData({
+                show: true
+            })
+        },
+        inputName({
+            detail
+        }) {
+            this.setData({
+                groupName: dMark.queryStr(detail.value)
+            })
+        },
+        handleAddGroup() {
+            let name = this.data.groupName.trim()
+            if (name.length == 0) return wx.showToast({
+                title: '群组名称不可为空',
+                icon: "none"
+            })
+            _Http.basic({
+                "id": "20220831164203",
+                "version": 1,
+                "content": {
+                    "sys_phonebookgroupid": 0,
+                    "groupname": name
+                }
+            }).then(res => {
+                if (res.msg != '成功') {
+                    wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    })
+                }
+                this.setData({
+                    groupName: ""
+                })
+                let pages = getCurrentPages();
+                pages[pages.length - 1].getGroup();
+            })
+        },
+        onClose() {
+            this.setData({
+                show: false
+            })
+        },
+        handleCallBack() {
+            this.triggerEvent('callBack')
+        }
+    }
+})

+ 6 - 0
packageA/contacts/modules/add/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-dialog": "@vant/weapp/dialog/index"
+    }
+}

+ 46 - 0
packageA/contacts/modules/add/index.scss

@@ -0,0 +1,46 @@
+.add {
+    .box {
+        width: 100vw;
+        background-color: #fff;
+        padding-left: 30rpx;
+        box-sizing: border-box;
+
+        .content {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            width: 100%;
+            height: 100rpx;
+            border-bottom: 1px solid #ddd;
+            box-sizing: border-box;
+
+            .text {
+                flex: 1;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #333333;
+            }
+        }
+    }
+
+    .box:last-child {
+        .content {
+            border: none;
+        }
+    }
+}
+
+.group-box {
+    padding: 40rpx 0 50rpx;
+
+    .group-name {
+        width: 70%;
+        height: 50rpx !important;
+        margin: auto;
+        border: 1px solid rgb(116, 114, 114);
+        text-align: center;
+        font-family: PingFang SC-Regular, PingFang SC;
+        font-size: 26rpx;
+        border-radius: 12rpx;
+    }
+}

+ 23 - 0
packageA/contacts/modules/add/index.wxml

@@ -0,0 +1,23 @@
+<view class="add">
+    <navigator class="box" url="#" bindtap="handleCallBack">
+        <view class="content">
+            <image style="height: 48rpx; width: 48rpx; background: aqua; margin-right: 30rpx;" />
+            <view class="text">添加联系人{{types}}</view>
+            <van-icon size='14' color='#D2D2D2' style="margin-right: 30rpx;" name="arrow" />
+        </view>
+    </navigator>
+    <navigator wx:if="{{isGroup}}" class="box" url="#" bindtap="addGroup">
+        <view class="content">
+            <image style="height: 48rpx; width: 48rpx; background: aqua; margin-right: 30rpx;" />
+            <view class="text">添加群组</view>
+            <van-icon size='14' color='#D2D2D2' style="margin-right: 30rpx;" name="arrow" />
+        </view>
+    </navigator>
+</view>
+
+<van-dialog use-slot title="添加群组" show="{{ show }}" showCancelButton confirmButtonText='确定' confirm-button-color='var(--assist)' bind:confirm='handleAddGroup' bind:cancel='onClose'>
+    <view class="group-box">
+        <input type="text" placeholder="请输入群组名称" bindinput="inputName" value="{{groupName}}" class="group-name" />
+    </view>
+</van-dialog>
+<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 23 - 0
packageA/contacts/modules/list/index.js

@@ -0,0 +1,23 @@
+// packageA/contacts/modules/list/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        phonebook: Array
+    },
+    data: {
+
+    },
+
+    methods: {
+        toDetails(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            wx.navigateTo({
+                url: './details?item=' + JSON.stringify(item),
+            });
+        },
+    }
+})

+ 4 - 0
packageA/contacts/modules/list/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 37 - 0
packageA/contacts/modules/list/index.scss

@@ -0,0 +1,37 @@
+/* 联系人 */
+.contacts {
+    display: flex;
+    align-items: center;
+    width: 100vw;
+    height: 112rpx;
+    background-color: #ffffff;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+
+    .circle {
+        width: 64rpx;
+        height: 64rpx;
+        line-height: 64rpx;
+        text-align: center;
+        border-radius: 50%;
+        background-color: #3874F6;
+        font-size: 26rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #FFFFFF;
+        margin-right: 20rpx;
+    }
+
+    .text {
+        flex: 1;
+        font-size: 30rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+
+        .tag {
+            height: 48rpx;
+            padding: 0 15rpx;
+            margin-right: 10rpx;
+            border-radius: 8rpx;
+        }
+    }
+}

+ 12 - 0
packageA/contacts/modules/list/index.wxml

@@ -0,0 +1,12 @@
+<navigator class="contacts" url="#" wx:for="{{phonebook}}" wx:key="item.sys_phonebookid" bindtap="toDetails" data-item="{{item}}">
+    <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" />