Преглед на файлове

客户公海客户联系人

zhaoxiaohai преди 2 години
родител
ревизия
bb54dbe3b6

+ 1 - 1
packageA/publicClue/distribution.js

@@ -51,7 +51,7 @@ Page({
         } = e.currentTarget.dataset;
         wx.showModal({
             title: '提示',
-            content: `是否将线索分配给"${item.enterprisename}"?`,
+            content: `是否将线索分配给"${item.name}"?`,
             complete: ({
                 confirm
             }) => {

+ 5 - 0
packageA/publicClue/distribution.scss

@@ -30,6 +30,11 @@
                 font-family: PingFang SC-Regular, PingFang SC;
                 color: #FFFFFF;
                 flex-shrink: 0;
+
+                image{
+                    width: 100%;
+                    height: 100%;
+                }
             }
 
             .exp {

+ 5 - 2
packageA/publicClue/distribution.wxml

@@ -3,8 +3,11 @@
 <view class="box">
     <navigator url="#" class="item" wx:for="{{list}}" wx:key="item.sa_agent_hrid" data-item="{{item}}" bindtap="onChange">
         <view class="user">
-            <view class="portrait">
-                {{item.enterprisename[0]}}
+            <view wx:if="{{item.headpic}}" class="portrait" style="background-color: #fff;">
+                <image src="{{item.headpic}}" mode="aspectFill"/>
+            </view>
+            <view wx:else class="portrait">
+                {{item.name[0]}}
             </view>
             <view class="exp">
                 <view class="line-1">

+ 12 - 0
packageA/setclient/modules/contacts/add/index.js

@@ -33,6 +33,17 @@ Page({
             valueName: "depname",
             required: false,
             checking: "base"
+        }, {
+            label: "单位",
+            error: false,
+            errMsg: "",
+            type: "text",
+            value: "",
+            placeholder: "",
+            valueName: "dw",
+            required: false,
+            checking: "base",
+            disabled: true
         }, {
             label: "职位",
             error: false,
@@ -126,6 +137,7 @@ Page({
                     }
                     return v
                 });
+            form[3].value = getCurrentPages()[getCurrentPages().length - 2].data.detail.enterprisename
             this.setData({
                 form,
                 "disabled": false,

+ 46 - 45
packageA/setclient/modules/contacts/quickly/index.js

@@ -2,41 +2,62 @@ const _Http = getApp().globalData.http;
 
 Page({
     data: {
-        sys_enterpriseid: "",
-        parems: {
-            id: '20221102110003',
-            content: {
-                nocache: true,
-                pageNumber: 1,
-                pageSize: 20,
-                pageTotal: 1,
-                total: 0,
-                where: {
-                    "condition": "",
-                }
+        active: 0,
+        content: {
+            sys_enterpriseid: "",
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 20,
+            pageTotal: 1,
+            total: 0,
+            where: {
+                "condition": "",
             }
         },
         list: [],
-        radio: "",
-        acitonItem: {},
+    },
+    getList(init = false) {
+        const content = this.data.content;
+        if (init) content.pageNumber = 1;
+        if (content.pageNumber > content.pageTotal) return;
+
+        _Http.basic({
+            id: this.data.active == 0 ? 20221219161202 : 20221219193002,
+            content
+        }).then(res => {
+            console.log("通讯录列表", res)
+
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+
+            content.pageNumber = res.pageNumber + 1;
+            content.pageTotal = res.pageTotal;
+            content.total = res.total;
+
+            this.setData({
+                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
+                content
+            })
+        })
+    },
+    onChange(e) {
+        this.setData({
+            active: e.detail.index
+        });
+        this.getList(true);
     },
     onLoad(options) {
         if (options.sys_enterpriseid) this.setData({
-            sys_enterpriseid: options.sys_enterpriseid
+            'content.sys_enterpriseid': options.sys_enterpriseid
         });
         this.getList();
     },
     /* 默认添加 */
     created() {
         wx.redirectTo({
-            url: '/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=' + this.data.sys_enterpriseid,
-        })
-    },
-    /* 快速添加 */
-    quickly() {
-        console.log(this.data.acitonItem)
-        wx.redirectTo({
-            url: `/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=${this.data.sys_enterpriseid}&data=${JSON.stringify(this.data.acitonItem)}`,
+            url: '/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=' + this.data.content.sys_enterpriseid,
         })
     },
     onClick(e) {
@@ -44,9 +65,8 @@ Page({
             item
         } = e.currentTarget.dataset;
         delete(item.tag1)
-        this.setData({
-            radio: item.sys_phonebookid,
-            acitonItem: item
+        wx.redirectTo({
+            url: `/packageA/setclient/modules/contacts/add/index?sys_enterpriseid=${this.data.content.sys_enterpriseid}&data=${JSON.stringify(item)}`,
         })
     },
     onSearch({
@@ -63,25 +83,6 @@ Page({
         });
         this.getList(true);
     },
-    getList(init = false) {
-        const parems = this.data.parems;
-        if (init) parems.content.pageNumber = 1;
-        if (parems.content.pageNumber > parems.content.pageTotal) return;
-        _Http.basic(parems).then(res => {
-            console.log("通讯录列表", res)
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            });
-            parems.content.pageNumber = res.pageNumber + 1;
-            parems.content.pageTotal = res.pageTotal;
-            parems.content.total = res.total;
-            this.setData({
-                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
-                parems
-            })
-        })
-    },
     onReachBottom() {
         this.getList();
     },

+ 44 - 41
packageA/setclient/modules/contacts/quickly/index.scss

@@ -1,55 +1,58 @@
-.item {
-    display: flex;
+.search{
+    border-top: 1rpx solid #ddd !important;
+}
+.box {
     width: 100vw;
-    height: 120rpx;
-    background: #FFFFFF;
-    align-items: center;
-
-    .radio {
-        padding: 0 30rpx;
-        flex-shrink: 0;
-    }
+    background-color: #fff;
+    box-sizing: border-box;
 
-    .user {
+    .item {
         display: flex;
-        flex: 1;
-        align-items: center;
-        height: 100%;
+        width: 100%;
+        padding-left: 30rpx;
         box-sizing: border-box;
-        border-bottom: 1px solid #ddd;
 
-        .portrait {
-            width: 80rpx;
-            height: 80rpx;
-            background-color: #E7EEFF;
-            border-radius: 50%;
-            text-align: center;
-            line-height: 80rpx;
-            font-size: 28rpx;
-            font-family: PingFang SC-Regular, PingFang SC;
-            color: #3874F6;
-            flex-shrink: 0;
-        }
-
-        .main {
-            height: 80rpx;
-            margin-left: 20rpx;
+        .user {
+            display: flex;
+            align-items: center;
+            width: 100%;
+            height: 120rpx;
+            border-bottom: 1px solid #ddd;
+            box-sizing: border-box;
 
-            .label {
-                height: 42rpx;
-                font-size: 30rpx;
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                background: #3874F6;
+                border-radius: 50%;
+                text-align: center;
+                line-height: 80rpx;
+                font-size: 28rpx;
                 font-family: PingFang SC-Regular, PingFang SC;
-                color: #333333;
+                color: #FFFFFF;
+                flex-shrink: 0;
             }
 
-            .phone {
-                height: 34rpx;
-                font-size: 24rpx;
-                font-family: PingFang SC-Regular, PingFang SC;
-                color: #999999;
-                margin-top: 4rpx;
+            .exp {
+                width: 100%;
+                margin-left: 20rpx;
+
+                .line-1 {
+                    height: 42rpx;
+                    font-size: 30rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #333333;
+                }
+
+                .phone {
+                    font-size: 24rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #999999;
+                    margin-top: 4rpx;
+                }
             }
         }
+
     }
 }
 

+ 19 - 12
packageA/setclient/modules/contacts/quickly/index.wxml

@@ -1,25 +1,32 @@
-<van-search shape="round" placeholder="请输入搜索关键词" bind:search="onSearch" bind:clear="onClear" />
+<van-tabs active="{{ active }}" bind:change="onChange" title-active-color='var(--assist)' color='var(--assist)'>
+    <van-tab title="我的联系人" />
+    <van-tab title="企业类型人" />
+</van-tabs>
+
+<van-search custom-class='search' value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='onSearch' bind:clear='onClear' />
 <view style="height: 20rpx;" />
-<van-radio-group value="{{ radio }}">
-    <navigator class="item" url="#" wx:for="{{list}}" wx:key="item.sys_phonebookid" data-item="{{item}}" bindtap="onClick">
-        <view class="radio">
-            <van-radio name="{{item.sys_phonebookid}}" icon-size="28rpx" />
-        </view>
+<view class="box">
+    <navigator url="#" class="item" wx:for="{{list}}" wx:key="index" data-item="{{item}}" bindtap="onClick">
         <view class="user">
             <view class="portrait">
                 {{item.name[0]}}
             </view>
-            <view class="main">
-                <view class="label">{{item.name}}</view>
-                <view class="phone">{{item.phonenumber}}</view>
+            <view class="exp">
+                <view class="line-1">
+                    {{item.name}}
+                    <text class="phone">{{item.enterprisename}}</text>
+                </view>
+                <view class="phone">
+                    {{item.position}}
+                    {{item.phonenumber}}
+                </view>
             </view>
         </view>
     </navigator>
-</van-radio-group>
-<My_empty wx:if="{{list.length==0}}" />
+</view>
 
+<My_empty wx:if="{{list.length==0}}" />
 <view style="height: 130rpx;" />
 <view class="footer">
     <van-button custom-class='base add' bindtap="created">创建\n联系人</van-button>
-    <van-button custom-class='base confirm' disabled='{{!radio}}' bind:click='quickly'>确定添加</van-button>
 </view>