zhaoxiaohai преди 3 години
родител
ревизия
355c860618

+ 4 - 2
README.md

@@ -70,11 +70,13 @@
 
 ​	userData -- 用户基本数据 -- 保存数据:index-用户列表下标,token,fisadministrator--是否主账号,tagentsid,tenterpriseid,userid
 
+account_list: [], 用户列表
+bannerDataList: [], 轮播图列表
+servicehotline: '', 客服手机号
 
 
-# 全局变量
 
-​	account_list:[] -- 角色列表
+# 全局变量
 
 ​	myNavBorHeight -- 自定义头部高度
 

+ 1 - 4
app.js

@@ -40,15 +40,12 @@ App({
         if (this.globalData.count > 3) this.getBanner();
         return;
       }
-      this.globalData.bannerDataList = res.data;
+      wx.setStorageSync('bannerDataList', res.data)
     })
   },
   globalData: {
     myNavBorHeight: 0, //自定义头部导航高度
     safeAreaBottom: 0, //底部安全距离
-    account_list: [], //用户列表
-    bannerDataList: [], //轮播图列表
-    servicehotline: '', //客服手机号
     msgFcount: "", //徽标数量
     count: 0, //banner 请求次数
   }

+ 1 - 1
components/My_ChangeUser/index.js

@@ -24,7 +24,7 @@ Component({
     lifetimes: {
         attached: function () {
             // 在组件实例进入页面节点树时执行
-            let list = getApp().globalData.account_list;
+            let list = wx.getStorageSync('account_list');
             const userList = setData.imageType(list, "headportrait");
             this.setData({
                 userList

+ 1 - 1
components/My_DisplayItem/index.wxml

@@ -5,7 +5,7 @@
             <image src="{{content.attinfos[0].fobsurl}}" mode="aspectFill"></image>
         </block>
         <block wx:else>
-            <image wx:if="{{content.ftype=='摄影摄像'}}" src="/static/supplyAndDemand/icon-01.png" mode="aspectFit"></image>
+            <image wx:if="{{content.ftype=='摄影摄像'}}" src="/static/supplyAndDemand/008.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='产品策划'}}" src="/static/supplyAndDemand/icon-02.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='平面设计'}}" src="/static/supplyAndDemand/icon-03.png" mode="aspectFit"></image>
             <image wx:elif="{{content.ftype=='寻找面料'}}" src="/static/supplyAndDemand/icon-04.png" mode="aspectFit"></image>

+ 4 - 10
components/My_TwoDimensionalCode/index.js

@@ -20,7 +20,7 @@ Component({
     },
     lifetimes: {
         attached: function () {
-            /* _Http.basic({
+            _Http.basic({
                 "accesstoken": wx.getStorageSync('userData').token,
                 "classname": "customer.tagents.tagents",
                 "method": "query_enterpriseAgentsMain",
@@ -30,20 +30,14 @@ Component({
                     title: res.msg,
                     icon: "none"
                 });
-                let shopData = {
-                        fbrand: res.data[0].fbrand,
-                        tagentsid: res.data[0].tagentsid,
-                    },
-                    codeText = '';
-                const data = JSON.stringify(shopData);
+                let codeText = '';
                 if (this.data.title == '商户二维码') {
-                    codeText = 'https://www.cnd3b.com/qr?type=shop';
+                    codeText = 'https://www.cnd3b.com/qr?type=shop&fbrand=' + res.data[0].fbrand + '&tagentsid=' + res.data[0].tagentsid;
                 } else {
                     codeText = 'https://www.cnd3b.com/qr?type=partner&fbrand=' + res.data[0].fbrand + '&tagentsid=' + res.data[0].tagentsid;
                 };
                 this.qrCode(codeText)
-
-            }); */
+            });
         },
         detached: function () {
             // 在组件实例被从页面节点树移除时执行

+ 2 - 1
components/My_navBar/index.js

@@ -15,7 +15,8 @@ Component({
             //获取当前登录用户名
             const that = this;
             setTimeout(() => {
-                let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
+                // let data = getApp().globalData.account_list[wx.getStorageSync('userData').index];
+                let data = wx.getStorageSync('account_list')[[wx.getStorageSync('userData').index]]
                 let userName = '';
                 (data.fbrand != null && data.fbrand != undefined) ? userName = data.fbrand + '-': userName = data.fname + '-';
                 userName += (data.frole ? data.frole : '未知');

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

@@ -61,7 +61,7 @@ Component({
         /* tabbar */
         onChange(event) {
             if (this.data.phoneNumber == '') this.setData({
-                phoneNumber: getApp().globalData.servicehotline
+                phoneNumber: wx.getStorageSync('servicehotline')
             });
             if (event.target.dataset.index == 1) return this.setData({
                 show: true

+ 4 - 7
pages/login/QrCode.js

@@ -19,7 +19,8 @@ Page({
      query */
     onLoad: function () {
         const query = {
-            q: 'https://www.cnd3b.com/qr?type=shop&fbrand=测试品牌名&tagentsid=34205'
+            // q: 'https://www.cnd3b.com/qr?type=shop&fbrand=测试品牌名&tagentsid=34205'
+            q: 'https://www.cnd3b.com/qr?type=shop&fbrand=江南布业&tagentsid=36112'
         };
         /* const query = {} */
         if (query.q) {
@@ -50,6 +51,7 @@ Page({
             this.setData({
                 codeMsg: wx.getStorageSync('qrCodeMsg')
             })
+            wx.removeStorage('qrCodeMsg');
         }
     },
     /* 确定 */
@@ -77,7 +79,6 @@ Page({
                             wx.showToast({
                                 title: "合作申请成功",
                             });
-                            if (wx.getStorageSync('qrCodeMsg')) wx.removeStorage('qrCodeMsg');
                             setTimeout(() => {
                                 wx.switchTab({
                                     url: '/pages/tabbar-pages/home/index',
@@ -98,8 +99,7 @@ Page({
                             "method": "entryTeamApply",
                             "content": {
                                 "userid": wx.getStorageSync('userData').userid,
-                                "tagentsid": that.data.codeMsg.id,
-                                "fphonenumber": wx.getStorageSync('userData').fphonenumber
+                                "tagentsid": that.data.codeMsg.id
                             }
                         }).then(res => {
                             if (res.data != '成功') return wx.showToast({
@@ -109,7 +109,6 @@ Page({
                             wx.showToast({
                                 title: "申请成功",
                             });
-                            if (wx.getStorageSync('qrCodeMsg')) wx.removeStorage('qrCodeMsg');
                             setTimeout(() => {
                                 wx.switchTab({
                                     url: '/pages/tabbar-pages/home/index',
@@ -137,7 +136,6 @@ Page({
                             wx.switchTab({
                                 url: '/pages/tabbar-pages/home/index',
                             })
-                            if (wx.getStorageSync('qrCodeMsg')) wx.removeStorage('qrCodeMsg');
                         }, 500)
                     }
                 })
@@ -155,7 +153,6 @@ Page({
                             wx.switchTab({
                                 url: '/pages/tabbar-pages/home/index',
                             })
-                            if (wx.getStorageSync('qrCodeMsg')) wx.removeStorage('qrCodeMsg');
                         }, 500)
                     }
                 })

+ 4 - 5
pages/login/index.js

@@ -95,7 +95,7 @@ Page({
     /* 缓存登录用户关键数据 */
     retentionOfCriticalData(index) {
         //获取用户选择的信息列表
-        const user = getApp().globalData.account_list[index];
+        const user = wx.getStorageSync('account_list')[index];
         let data = {
             token: user.token,
             fisadministrator: user.fisadministrator,
@@ -107,7 +107,6 @@ Page({
         };
         /* 储存 */
         wx.setStorageSync('userData', data);
-        console.log(wx.getStorageSync('userData'))
     },
     /* 登录页面提交数据 */
     loginSubmit() {
@@ -144,8 +143,8 @@ Page({
                 return;
             };
             //账号列表保存到全局变量中
-            getApp().globalData.account_list = res.account_list;
-            getApp().globalData.servicehotline = res.servicehotline;
+            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) {
                 //新账号
@@ -386,7 +385,7 @@ Page({
             })
             let obj1 = wx.getStorageSync('userData');
             const data = [Object.assign(res.data[0], obj1)]
-            getApp().globalData.account_list = data
+            wx.setStorageSync('account_list', data);
             if (is) {
                 wx.reLaunch({
                     url: '/pages/tabbar-pages/home/index'

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

@@ -124,7 +124,8 @@ Page({
             })
         })
         /* 获取轮播图 */
-        const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'home_head');
+        /* getApp().globalData.bannerDataList */
+        const bannerList = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'home_head');
         this.setData({
             swiperBannerList: bannerList[0].banner
         });

+ 3 - 1
pages/tabbar-pages/message/index.wxml

@@ -31,4 +31,6 @@
     <My_pageReachBottom dummyStatus="{{msgList.length>0}}" loadMore='{{pageNumber>=pageTotal}}'></My_pageReachBottom>
 </scroll-view>
 <!-- 调用tabbar中的信息查询 -->
-<CusTabBar id="gxshuju"></CusTabBar>
+<view style="height: 0; width: 0;">
+    <CusTabBar id="gxshuju"></CusTabBar>
+</view>

+ 1 - 0
pages/tabbar-pages/message/index.wxss

@@ -1,5 +1,6 @@
 page {
     background-color: #fff !important;
+    padding-bottom: 0;
 }
 
 .msg-box {

+ 1 - 1
pages/tabbar-pages/supplyAndDemand/index.js

@@ -54,7 +54,7 @@ Page({
             });
         });
         /* 获取轮播图 */
-        const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'supplyanddemand_head');
+        const bannerList = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'supplyanddemand_head');
         this.setData({
             swiperBannerList: bannerList[0].banner
         });

+ 2 - 1
pages/tabbar-pages/user/index.js

@@ -67,7 +67,8 @@ Page({
                     //正在审核中
                     return wx.showModal({
                         title: "提示",
-                        content: '商户信息正在审核中'
+                        content: '商户信息正在审核中',
+                        showCancel: false
                     })
                 } else {
                     //无商户信息子账号

+ 14 - 2
pages/teamManagement/applyFor.js

@@ -29,7 +29,7 @@ Page({
             "classname": "customer.usercenter.teammsg.teammsg",
             "method": "getEntryTeamApplyList",
             "content": {
-                pageSize: 1000
+                pageSize: 20
             }
         }).then(res => {
             console.log("团队申请加入列表", res)
@@ -114,7 +114,19 @@ Page({
                 "tagentteamapplyid": this.data.joinList[this.data.showBtn].tagentteamapplyid
             }
         }).then(res => {
-            console.log(res)
+            if (res.data != '成功') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            wx.showToast({
+                title: res.msg,
+                icon: "none"
+            });
+            const joinList = this.data.joinList;
+            joinList.splice(this.data.showBtn, 1);
+            this.setData({
+                joinList
+            })
         })
     },
     /**

+ 2 - 1
pages/teamManagement/applyFor.wxml

@@ -8,7 +8,8 @@
     <scroll-view class="list-scroll-view" scroll-y bindscrolltolower="scrolltolower">
         <van-empty wx:if="{{!joinList.length>=1}}" description="暂无申请记录" />
         <view class="company-data" wx:for="{{joinList}}" data-index="{{index}}" bindtap="showBtnIndex">
-            <image class="company-data-image" src="{{item.attinfos[0].fobsurl}}"></image>
+            <image wx:if="{{item.attinfos[0].fobsurl}}" class="company-data-image" src="{{item.attinfos[0].fobsurl}}"></image>
+            <image wx:else class="company-data-image" src="/static/userCenter/userImg.png"></image>
             <view class="company-data-brandName u-line-1">
                 {{item.fname}}
             </view>

+ 1 - 1
pages/tradeShow/index.js

@@ -101,7 +101,7 @@ Page({
             }
         });
         /* 获取轮播图 */
-        const bannerList = getApp().globalData.bannerDataList.filter(value => value.flocation == 'activity_head');
+        const bannerList = wx.getStorageSync('bannerDataList').filter(value => value.flocation == 'activity_head');
         this.setData({
             swiperBannerList: bannerList[0].banner
         });

+ 1 - 1
project.config.json

@@ -4,7 +4,7 @@
         "ignore": []
     },
     "setting": {
-        "urlCheck": true,
+        "urlCheck": false,
         "es6": true,
         "enhance": true,
         "postcss": true,

BIN
static/supplyAndDemand/icon-01.png