zhaoxiaohai 3 gadi atpakaļ
vecāks
revīzija
471596d7e8

+ 1 - 0
app.js

@@ -56,6 +56,7 @@ App({
                 if (this.globalData.count < 5) setTimeout(() => this.getBanner(), 200)
                 return;
             }
+            wx.setStorageSync('servicehotline', res.data[0].servicehotline);
             wx.setStorageSync('bannerDataList', res.data)
         })
     },

+ 52 - 3
components/My_SupplyAndDemandList/imges.js

@@ -4,14 +4,56 @@ Component({
      * 组件的属性列表
      */
     properties: {
-        attinfos:Array
+        attinfos: Array,
+        ftype: { //供需类型
+            type: String,
+            value: ''
+        },
+        isEmpty: {
+            type: Boolean,
+            value: true
+        }
     },
+    observers: {
+        'attinfos': function (newValue) {
+            if (newValue.length == 0 && this.data.ftype) {
+                let obj = {},
+                    url = 'https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/supplyAndDemand/'
+                switch (this.data.ftype) {
+                    case '寻找主播':
+                        obj.fobsurl = `${url}icon-06.png`
+                        break;
+                    case '摄影摄像':
+                        obj.fobsurl = `${url}icon-01.png`
+                        break;
+                    case '寻找面料':
+                        obj.fobsurl = `${url}icon-04.png`
+                        break;
+                    case '商业培训':
+                        obj.fobsurl = `${url}icon-05.png`
+                        break;
+                    case '面料设计':
+                        obj.fobsurl = `${url}icon-07.png`
+                        break;
+                    case '平面设计':
+                        obj.fobsurl = `${url}icon-03.png`
+                        break;
+                    default:
+                        obj.fobsurl = `https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/tacitly-approve/MRproduct.png`
+                        break;
+                }
+                this.setData({
+                    emptyImage: obj
+                })
+            }
 
+        }
+    },
     /**
      * 组件的初始数据
      */
     data: {
-
+        emptyImage: {},
     },
 
     /**
@@ -33,5 +75,12 @@ Component({
                 urls
             })
         },
+        eviewImage(e) {
+            let arr = [e.currentTarget.dataset.url]
+            wx.previewImage({
+                current: arr[0],
+                urls: arr
+            })
+        },
     }
-})
+})

+ 2 - 1
components/My_SupplyAndDemandList/imges.wxml

@@ -1,4 +1,5 @@
 <!-- 供需图片 -->
 <view class="images">
-    <van-image class="img" wx:for="{{attinfos}}" data-images='{{attinfos}}'  wx:for-item='it' wx:for-index='i' data-index='{{i}}' wx:key="{{it.fobsurl}}" width="222rpx" height="222rpx" src="{{it.fobsurl}}" lazy-load catchtap="viewImage" />
+    <van-image class="img" wx:for="{{attinfos}}" data-images='{{attinfos}}' wx:for-item='it' wx:for-index='i' data-index='{{i}}' wx:key="{{it.fobsurl}}" width="222rpx" height="222rpx" src="{{it.fobsurl}}" lazy-load catchtap="viewImage" />
+    <van-image class="img" wx:if="{{attinfos.length==0 && isEmpty}}" data-url='{{emptyImage.fobsurl}}' width="222rpx" height="222rpx" src="{{emptyImage.fobsurl}}" lazy-load catchtap="eviewImage" />
 </view>

+ 1 - 1
components/My_SupplyAndDemandList/index.js

@@ -19,7 +19,7 @@ Component({
      * 组件的初始数据
      */
     data: {
-        isLogin: false
+        isLogin: false,
     },
     pageLifetimes: {
         show: function () {

+ 1 - 1
components/My_SupplyAndDemandList/index.wxml

@@ -24,7 +24,7 @@
         {{item.fcontent}}
     </view>
     <!-- 供需图片九宫格 -->
-    <Images attinfos='{{item.attinfos}}' />
+    <Images attinfos='{{item.attinfos}}' ftype='{{item.ftype}}' />
     <view class="my-footer">
         <view>浏览{{item.freadtimes}}</view>
         <van-button custom-class='shareBut' icon="share-o" open-type="{{isLogin ? 'share':''}}" data-item="{{item}}" type="info" catchtap="shareCall">

+ 1 - 1
custom-tab-bar/index.js

@@ -62,7 +62,7 @@ Component({
     methods: {
         /* tabbar */
         onChange(event) {
-            if (!queryLogin()) return;
+            if (event.currentTarget.dataset.index > 3 && !queryLogin()) return;
             if (this.data.phoneNumber == '') this.setData({
                 phoneNumber: wx.getStorageSync('servicehotline')
             });

+ 1 - 1
pages/login/index.js

@@ -164,6 +164,7 @@ Page({
             "password": utilMd5.hexMD5(this.data.password),
             "client": "wechat_customer"
         }).then(res => {
+            console.log("用户登录",res)
             /* 结果验证 */
             if (res.msg != '成功') {
                 this.setData({
@@ -177,7 +178,6 @@ Page({
             };
             //账号列表保存到全局变量中
             wx.setStorageSync('account_list', res.account_list);
-            wx.setStorageSync('servicehotline', res.servicehotline);
             /* 判断账号 新 单 多  isnewregister*/
             if (res.account_list.length == 1 && res.account_list[0].isnewregister == 1) {
                 //新账号

+ 25 - 32
pages/tabbar-pages/home/analysis/index.js

@@ -14,7 +14,6 @@ Page({
         productList: [], //列表
         line: 0, //显示列表下标
         active: 0, //tabs下标
-        statisticsData: {}, //统计数据
         isCanDraw: false,
         pageNumber: 1,
         pageTotal: 1,
@@ -103,15 +102,36 @@ Page({
                 }
             }
         }).then(res => {
+            console.log("供需", res)
             if (res.msg != "成功") return wx.showToast({
                 title: res.data,
             })
+            //格式化时间
+            for (let i = 0; i < res.data.length; i++) {
+                if (res.data[i].phone.length != 0) {
+                    let data = res.data[i].phone;
+                    for (let index = 0; index < data.length; index++) {
+                        res.data[i].phone[index].createdate = data[index].createdate.slice(5, 16)
+                    }
+                }
+                if (res.data[i].read.length != 0) {
+                    let data = res.data[i].read;
+                    for (let index = 0; index < data.length; index++) {
+                        res.data[i].read[index].createdate = data[index].createdate.slice(5, 16)
+                    }
+                }
+                if (res.data[i].share.length != 0) {
+                    let data = res.data[i].share;
+                    for (let index = 0; index < data.length; index++) {
+                        res.data[i].share[index].createdate = data[index].createdate.slice(5, 16)
+                    }
+                }
+            }
             let data = (res.data.length > 0) ? handleList.getYTD(res.data) : [];
             (res.pageNumber == 1) ? '' : data = this.data.productList.concat(data);
             this.setData({
                 productList: data
             })
-            if (res.pageNumber == 1) this.getsupplyanddemandLogTop10(0);
         })
     },
 
@@ -134,40 +154,13 @@ Page({
             line,
             active: index - 0
         })
-        this.getsupplyanddemandLogTop10(line)
-    },
-    /* 获取十条数据 */
-    getsupplyanddemandLogTop10(index) {
-        _Http.basic({
-            "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.supplyanddemand.supplyanddemand",
-            "method": "getsupplyanddemandLogTop10",
-            "content": {
-                "tsupplyanddemandid": this.data.productList[index].tsupplyanddemandid
-            }
-        }).then(res => {
-            if (res.msg != '成功') return wx.showToast({
-                title: res.data,
-                icon: "none"
-            })
-            for (let i in res.data) {
-                let data = res.data[i];
-                if (data.length > 0) {
-                    for (let index = 0; index < data.length; index++) {
-                        data[index].createdate = data[index].createdate.slice(5, 16)
-                    }
-                    res.data[i] = data
-                };
-            }
-            this.setData({
-                statisticsData: res.data
-            })
-        })
     },
     /* tabs改变 */
     tabsOnChange(e) {
+        let productList = this.data.productList;
+        productList[e.currentTarget.dataset.line].indexTab = e.detail.index
         this.setData({
-            active: e.detail.index
+            productList
         })
     },
     startDraw(e) {

+ 6 - 6
pages/tabbar-pages/home/analysis/index.wxml

@@ -27,22 +27,22 @@
         <view class="title">[{{item.ftype}}]{{item.ftitle}}</view>
     </view>
     <view class="tabs">
-        <view class="fake-tabs" wx:if="{{line!=index}}" data-line="{{index}}" bindtap="changeIndex">
+        <!-- <view class="fake-tabs" wx:if="{{line!=index}}" data-line="{{index}}" bindtap="changeIndex">
             <view data-index="0">分享数{{item.fsharetimes}}</view>
             <view data-index="1">电话数{{item.fphonetimes}}</view>
             <view data-index="2">浏览数{{item.freadtimes}}</view>
-        </view>
-        <van-tabs wx:else active="{{ active }}" color='#00C1D2' title-active-color='#00C1D2' bind:change="tabsOnChange">
+        </view> wx:else -->
+        <van-tabs active="{{ item.indexTab }}" color='#00C1D2' title-active-color='#00C1D2' bind:change="tabsOnChange" data-line="{{index}}">
             <van-tab title='分享数{{item.fsharetimes}}'>
-                <UserMsg wx:if="{{statisticsData.share.length}}" item='{{item}}' index='0' list='{{statisticsData.share}}' />
+                <UserMsg wx:if="{{item.share.length}}" item='{{item}}' index='0' list='{{item.share}}' />
                 <van-empty wx:else description="暂无数据" />
             </van-tab>
             <van-tab title='电话数{{item.fphonetimes}}'>
-                <UserMsg wx:if="{{statisticsData.phone.length}}" item='{{item}}' index='1' list='{{statisticsData.phone}}' />
+                <UserMsg wx:if="{{item.phone.length}}" item='{{item}}' index='1' list='{{item.phone}}' />
                 <van-empty wx:else description="暂无数据" />
             </van-tab>
             <van-tab title='浏览数{{item.freadtimes}}'>
-                <UserMsg wx:if="{{statisticsData.read.length}}" item='{{item}}' index='2' list='{{statisticsData.read}}' />
+                <UserMsg wx:if="{{item.read.length}}" item='{{item}}' index='2' list='{{item.read}}' />
                 <van-empty wx:else description="暂无数据" />
             </van-tab>
         </van-tabs>

+ 10 - 1
pages/tabbar-pages/home/index.js

@@ -260,7 +260,16 @@ Page({
             });
         }
     },
-
+    backGetList() {
+        console.log('被调佣')
+        this.setData({
+            pageNumber: 1,
+            pageTotal: 1,
+            ftype: "全部",
+            condition: "",
+        })
+        this.supplyanddemandList();
+    },
     /* 选择分类 */
     typeCallBack({
         detail

+ 3 - 0
pages/tabbar-pages/home/release/index.js

@@ -266,6 +266,9 @@ Page({
                 title: '保存成功',
             })
             setTimeout(() => {
+                let pages = getCurrentPages();
+                let prevPage = pages[pages.length - 2];
+                prevPage.backGetList();
                 wx.navigateBack({
                     delta: 1,
                 })

+ 42 - 1
pages/tabbar-pages/home/sdDetalis.js

@@ -49,8 +49,9 @@ Page({
                 productList: data
             });
         });
+        let ism = item.tenterprise_userid == wx.getStorageSync('userData').userid
         /* 浏览计数 */
-        if (item.tenterprise_userid != wx.getStorageSync('userData').userid) _Http.basic({
+        if (!ism) _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
             "classname": "customer.supplyanddemand.supplyanddemand",
             "method": "query_supplyanddemandMain",
@@ -66,6 +67,9 @@ Page({
                     "tagentsid": item.tagentsid
                 }
             })
+        });
+        this.setData({
+            ism
         })
     },
     /* 电话联系 */
@@ -103,6 +107,43 @@ Page({
             })
         })
     },
+    /* 删除供需 */
+    deleteItem() {
+        console.log()
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该供需',
+            success: (res) => {
+                if (res.confirm) _Http.basic({
+                    "accesstoken": wx.getStorageSync('userData').token,
+                    "classname": "customer.supplyanddemand.supplyanddemand",
+                    "method": "deletesupplyanddemand",
+                    "content": {
+                        "tsupplyanddemandid": this.data.detalis.tsupplyanddemandid
+                    }
+                }).then(res => {
+                    wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    })
+                    if (res.msg == '成功') setTimeout(() => {
+                        let pages = getCurrentPages(),
+                            prevPage = pages[pages.length - 2];
+                        prevPage.backGetList();
+                        wx.navigateBack({
+                            delta: 1
+                        })
+                    }, 1000)
+                })
+            }
+        })
+    },
+    noToLinkUp() {
+        wx.showToast({
+            title: '该供需当前不可联系',
+            icon: "none"
+        })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 4 - 3
pages/tabbar-pages/home/sdDetalis.wxml

@@ -12,7 +12,8 @@
         </view>
         <view>
             <van-button custom-class='v-but' style="margin-right: 16rpx;" color='#00C1D2' data-phone="{{detalis.fphonenumber}}" catchtap="callUp">电话联系</van-button>
-            <van-button custom-class='v-but' bindtap="toLinkUp" color='#FFB600'>在线联系</van-button>
+            <van-button wx:if="{{detalis.fstatus=='待对接'}}" custom-class='v-but' bindtap="toLinkUp" color='#FFB600'>在线联系</van-button>
+            <van-button wx:else custom-class='v-but' bindtap="noToLinkUp" color='#F2F2F2'><text style="color: #A8A8A8;">{{detalis.fstatus}}</text></van-button>
         </view>
     </view>
 </van-sticky>
@@ -20,7 +21,7 @@
 <view class="content">{{detalis.fcontent}}</view>
 <!-- 图片 -->
 <view style="width: 100vw; background-color: #fff;">
-    <Images attinfos='{{detalis.attinfos}}' />
+    <Images attinfos='{{detalis.attinfos}}' isEmpty="{{false}}" />
 </view>
 <!-- 供需数据与操作 -->
 <view class="footer">
@@ -28,7 +29,7 @@
         <text style="margin-right: 30rpx;">浏览数{{detalis.freadtimes}}</text>
         <text>分享数{{detalis.fsharetimes}}</text>
     </view>
-    <van-button round color="#F6F7F8" custom-class='deleteBut'>删除</van-button>
+    <van-button round color="#F6F7F8" wx:if="{{ism}}" catchtap="deleteItem" custom-class='deleteBut'>删除</van-button>
 </view>
 <!-- 分割 -->
 <My_CenterTheTitle title='为你推荐' />

+ 24 - 2
pages/tabbar-pages/liveBroadcast/index.js

@@ -14,6 +14,7 @@ Page({
         tiveList: [], //直播列表
         pageNumber: 1,
         pageTotal: 1,
+        condition: ''
     },
 
     /**
@@ -32,7 +33,10 @@ Page({
             "content": {
                 "getdatafromdbanyway": true,
                 "livestatus": "",
-                'pageNumber': this.data.pageNumber
+                'pageNumber': this.data.pageNumber,
+                "where": {
+                    "condition": this.data.condition
+                }
             }
         }).then(res => {
             console.log("直播列表", res)
@@ -42,7 +46,7 @@ Page({
                     icon: "none"
                 });
             } else {
-                let tiveList=(res.pageNumber == 1) ? res.data : this.data.tiveList.concat(res.data);
+                let tiveList = (res.pageNumber == 1) ? res.data : this.data.tiveList.concat(res.data);
                 this.setData({
                     tiveList,
                     pageTotal: res.data
@@ -51,6 +55,24 @@ Page({
         })
     },
 
+    onSearch({
+        detail
+    }) {
+        if (detail.trim() == this.data.condition) return;
+        this.setData({
+            pageNumber: 1,
+            pageTotal: 1,
+            condition: detail.trim()
+        })
+        this.getHomeLive()
+    },
+    onClear() {
+        if (this.data.condition == '') return;
+        this.setData({
+            condition: ''
+        })
+        this.getHomeLive()
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 2 - 1
pages/tabbar-pages/liveBroadcast/index.json

@@ -1,6 +1,7 @@
 {
     "navigationStyle": "custom",
     "usingComponents": {
-        "LiveList": "/components/My_LiveList/live"
+        "LiveList": "/components/My_LiveList/live",
+        "van-search": "@vant/weapp/search/index"
     }
 }

+ 2 - 1
pages/tabbar-pages/liveBroadcast/index.wxml

@@ -1,6 +1,7 @@
 <!-- 自定义头部 -->
 <My_navBar></My_navBar>
-
+<!-- 搜索 -->
+<van-search value="{{ value }}" shape="round" background="#F6F7F8" bind:search='onSearch' bind:clear='onClear' placeholder="请输入搜索关键词" />
 <!-- 直播列表 -->
 <LiveList list='{{tiveList}}' />
 

+ 5 - 0
pages/tabbar-pages/liveBroadcast/index.wxss

@@ -12,4 +12,9 @@
     background: #00C1D2;
     box-shadow: 0px 6rpx 6rpx 0px rgba(0, 0, 0, 0.1);
     border-radius: 41rpx 0px 0px 41rpx;
+}
+
+/* 搜索框 */
+.van-search__content {
+    background-color: #FFFFFF !important;
 }

+ 9 - 1
pages/tabbar-pages/user/mySupplyAndDemand/index.js

@@ -13,7 +13,15 @@ Page({
         ftype: '',
         condition: '',
     },
-
+    backGetList() {
+        console.log('被调佣')
+        this.setData({
+            pageNumber: 1,
+            pageTotal: 1,
+            condition: "",
+        })
+        this.query_mysupplyanddemandList();
+    },
     /**
      * 生命周期函数--监听页面加载
      */

+ 1 - 1
pages/tabbar-pages/user/mySupplyAndDemand/index.wxml

@@ -1,5 +1,5 @@
 <!-- 搜索 -->
-<van-search value="{{ value }}" shape="round" background="#F6F7F8" custom-class='field-class' bind:search='onSearch' bind:clear='onClear' placeholder="请输入搜索关键词" />
+<van-search shape="round" background="#F6F7F8" bind:search='onSearch' bind:clear='onClear' placeholder="请输入搜索关键词" />
 <!-- 列表 -->
 <My_SupplyAndDemandItemBox wx:for="{{productList}}" wx:key="index" title="【{{item.ftype}}】{{item.ftitle}}" time="{{item.checkdate}}" imageList="{{item.attinfos}}" data-item="{{item}}" bindtap="jumpForDetails" type='{{item.ftype}}' content="{{item.fcontent}}">
     <!-- 我的需求左上状态插槽 -->

+ 3 - 2
project.private.config.json

@@ -7,7 +7,7 @@
         "autoAudits": false,
         "showShadowRootInWxmlPanel": true,
         "checkInvalidKey": true,
-        "compileHotReLoad": false,
+        "compileHotReLoad": true,
         "lazyloadPlaceholderEnable": false,
         "useMultiFrameRuntime": true,
         "showES6CompileOption": false,
@@ -54,5 +54,6 @@
                 }
             ]
         }
-    }
+    },
+    "projectname": "%E5%B8%83%E4%B8%87%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F"
 }