Commit 52c84b320c53c838e44be7641392f5382c745203

Authored by abson
1 parent 6fefee12

分享朋友圈单页面优化

1 var t = require("setting.js"), o = require("./utils/auth.js"), a = require("./utils/request.js"), e = require("./utils/common.js"), ut = require("./utils/util.js"); 1 var t = require("setting.js"), o = require("./utils/auth.js"), a = require("./utils/request.js"), e = require("./utils/common.js"), ut = require("./utils/util.js");
2 -var os=t; 2 +var os = t;
3 var regeneratorRuntime = require('./utils/runtime.js'); 3 var regeneratorRuntime = require('./utils/runtime.js');
4 var api = require("./api/api.js") 4 var api = require("./api/api.js")
5 - 5 +// import { pluginGD } from './utils/ai_config/config'
6 //公共方法和变量 6 //公共方法和变量
7 App({ 7 App({
8 8
9 - def_list:[  
10 - {  
11 - "weappurl": "pages/index/index/index",  
12 - "nav_name": "首页",  
13 - "src": t.imghost+"/miniapp/images/bar/index.png",  
14 - "src_sele": t.imghost+"/miniapp/images/bar/index_on.png",  
15 - },  
16 - {  
17 - "weappurl": "pages/goods/categoryList/categoryList",  
18 - "nav_name": "分类",  
19 - "src": t.imghost+"/miniapp/images/bar/fl.png",  
20 - "src_sele": t.imghost+"/miniapp/images/bar/fl_on.png"  
21 - },  
22 - {  
23 - "weappurl": "pages/distribution/distribution",  
24 - "nav_name": "分销",  
25 - "src": t.imghost+"/miniapp/images/bar/fx.png",  
26 - "src_sele": t.imghost+"/miniapp/images/bar/fx_on.png"  
27 - },  
28 - {  
29 - "weappurl": "pages/cart/cart/cart",  
30 - "nav_name": "购物车",  
31 - "src": t.imghost+"/miniapp/images/bar/car.png",  
32 - "src_sele": t.imghost+"/miniapp/images/bar/car_on.png"  
33 - },  
34 - {  
35 - "weappurl": "pages/user/index/index",  
36 - "nav_name": "我的",  
37 - "src": t.imghost+"/miniapp/images/bar/user.png",  
38 - "src_sele": t.imghost+"/miniapp/images/bar/user_on.png"  
39 - }  
40 - ],  
41 -  
42 - globalData: {  
43 - cartGoodsNum:0, //购物车总数量  
44 - isTabBar :false,  
45 - isIpx: false, //适配IPhoneX  
46 - url:"",  
47 - setting: t,  
48 - wechatUser: null,  
49 - userInfo: null,  
50 - config: null, //门店参数  
51 - config2: null, //门店配置  
52 - code: null,  
53 - user_id:null,//1564704,// 10153869,// 6453964,//5682094,  
54 - buy_now:null,  
55 - picklist:null, //门店列表  
56 - wuliuprice: null, //物流价格表  
57 - wuliu: null, //物流公司  
58 - baddr:null,  
59 - mobile: null, //记录手机  
60 - getu:null, //记录会员信息  
61 - sessionKey: null,//记录会员信息  
62 - openid: null, //记录会员信息  
63 -  
64 - to_group:null, //参团传递的数据  
65 - wxapp_buy_obj:null, //微信小程序购买的Object  
66 - pk_store:null, //选择的门店  
67 - first_leader:null, //分享会员ID  
68 - guide_id:null, //分享导购ID  
69 -  
70 - windowWidth:0, //整个窗体的宽度  
71 -  
72 - room_id:null, //直播间分享的房间ID  
73 - room_goods_id:null, //直播间分享的商品ID  
74 -  
75 - }, 9 + def_list: [
  10 + {
  11 + "weappurl": "pages/index/index/index",
  12 + "nav_name": "首页",
  13 + "src": t.imghost + "/miniapp/images/bar/index.png",
  14 + "src_sele": t.imghost + "/miniapp/images/bar/index_on.png",
  15 + },
  16 + {
  17 + "weappurl": "pages/goods/categoryList/categoryList",
  18 + "nav_name": "分类",
  19 + "src": t.imghost + "/miniapp/images/bar/fl.png",
  20 + "src_sele": t.imghost + "/miniapp/images/bar/fl_on.png"
  21 + },
  22 + {
  23 + "weappurl": "pages/distribution/distribution",
  24 + "nav_name": "分销",
  25 + "src": t.imghost + "/miniapp/images/bar/fx.png",
  26 + "src_sele": t.imghost + "/miniapp/images/bar/fx_on.png"
  27 + },
  28 + {
  29 + "weappurl": "pages/cart/cart/cart",
  30 + "nav_name": "购物车",
  31 + "src": t.imghost + "/miniapp/images/bar/car.png",
  32 + "src_sele": t.imghost + "/miniapp/images/bar/car_on.png"
  33 + },
  34 + {
  35 + "weappurl": "pages/user/index/index",
  36 + "nav_name": "我的",
  37 + "src": t.imghost + "/miniapp/images/bar/user.png",
  38 + "src_sele": t.imghost + "/miniapp/images/bar/user_on.png"
  39 + }
  40 + ],
  41 +
  42 +
  43 + globalData: {
  44 + cartGoodsNum: 0, //购物车总数量
  45 + isTabBar: false,
  46 + isIpx: false, //适配IPhoneX
  47 + url: "",
  48 + setting: t,
  49 + wechatUser: null,
  50 + userInfo: null,
  51 + config: null, //门店参数
  52 + config2: null, //门店配置
  53 + code: null,
  54 + user_id: 5682094,//1564704,// 10153869,// 6453964,//5682094,6520044,6520119 qa 4687 6519901
  55 + buy_now: null,
  56 + picklist: null, //门店列表
  57 + wuliuprice: null, //物流价格表
  58 + wuliu: null, //物流公司
  59 + baddr: null,
  60 + mobile: null, //记录手机
  61 + getu: null, //记录会员信息
  62 + sessionKey: null,//记录会员信息
  63 + openid: null, //记录会员信息
  64 +
  65 + to_group: null, //参团传递的数据
  66 + wxapp_buy_obj: null, //微信小程序购买的Object
  67 + pk_store: null, //选择的门店
  68 + first_leader: null, //分享会员ID
  69 + guide_id: null, //分享导购ID
  70 + windowWidth: 0, //整个窗体的宽度
  71 + room_id: null, //直播间分享的房间ID
  72 + room_goods_id: null, //直播间分享的商品ID
  73 +
  74 + },
76 auth: o, 75 auth: o,
77 request: a, 76 request: a,
78 - onLaunch: function() {  
79 - wx.hideTabBar(); 77 + onLaunch: function () {
  78 + //初始化美图测肤插件
  79 + // var plugin = requirePlugin('mtSkinSdk');
  80 + // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取
  81 + // plugin.setConfig(pluginGD)
  82 +
  83 + wx.hideTabBar();
80 this.initExt(); 84 this.initExt();
81 85
82 //检查更新 86 //检查更新
@@ -88,52 +92,52 @@ App({ @@ -88,52 +92,52 @@ App({
88 var clientWidth = wx.getSystemInfoSync().windowWidth; 92 var clientWidth = wx.getSystemInfoSync().windowWidth;
89 var rpxR = 750 / clientWidth; 93 var rpxR = 750 / clientWidth;
90 var calc = wx.getSystemInfoSync().windowHeight * rpxR; 94 var calc = wx.getSystemInfoSync().windowHeight * rpxR;
91 - this.globalData.heigth=calc;  
92 - this.globalData.windowWidth=clientWidth; 95 + this.globalData.heigth = calc;
  96 + this.globalData.windowWidth = clientWidth;
93 97
94 - var app=this;  
95 - if(!app.globalData.userInfo){ 98 + var app = this;
  99 + if (!app.globalData.userInfo) {
96 var user = wx.getStorageSync("userinfo"); 100 var user = wx.getStorageSync("userinfo");
97 - if (user && user.user_id){  
98 - //--生成会员 --  
99 - app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id,{}).then(res=>{  
100 - if(res.data.code==0){  
101 - user=res.data.data;  
102 - //-- 小程序会员被解绑了,就要清空会员 --  
103 - if(user['is_weappuser']==0){  
104 - user=null;  
105 - app.globalData.userInfo=null;  
106 - app.globalData.user_id= 0;  
107 - }else{  
108 - app.globalData.userInfo=user;  
109 - app.globalData.user_id= user.user_id;  
110 - }  
111 - wx.setStorageSync("userinfo",user);  
112 - }else{  
113 - user=null;  
114 - app.globalData.userInfo=null;  
115 - app.globalData.user_id= 0;  
116 - wx.setStorageSync("userinfo",null);  
117 - }  
118 - }) 101 + if (user && user.user_id) {
  102 + //--生成会员 --
  103 + app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id, {}).then(res => {
  104 + if (res.data.code == 0) {
  105 + user = res.data.data;
  106 + //-- 小程序会员被解绑了,就要清空会员 --
  107 + if (user['is_weappuser'] == 0) {
  108 + user = null;
  109 + app.globalData.userInfo = null;
  110 + app.globalData.user_id = 0;
  111 + } else {
  112 + app.globalData.userInfo = user;
  113 + app.globalData.user_id = user.user_id;
  114 + }
  115 + wx.setStorageSync("userinfo", user);
  116 + } else {
  117 + user = null;
  118 + app.globalData.userInfo = null;
  119 + app.globalData.user_id = 0;
  120 + wx.setStorageSync("userinfo", null);
  121 + }
  122 + })
119 } 123 }
120 } 124 }
121 wx.getSystemInfo({ 125 wx.getSystemInfo({
122 - success: (res) => {  
123 - // console.log(res)  
124 - let modelmes = res?res.model:null; //手机品牌  
125 - console.log('手机品牌', modelmes)  
126 - if (modelmes && modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来  
127 - this.globalData.isIpx = true  
128 - }  
129 - }, 126 + success: (res) => {
  127 + // console.log(res)
  128 + let modelmes = res ? res.model : null; //手机品牌
  129 + console.log('手机品牌', modelmes)
  130 + if (modelmes && modelmes.indexOf('iPhone X') != -1) {  //XS,XR,XS MAX均可以适配,因为indexOf()会将包含'iPhone X'的字段都查出来
  131 + this.globalData.isIpx = true
  132 + }
  133 + },
130 }) 134 })
131 135
132 - var th=this; 136 + var th = this;
133 var pages = getCurrentPages(); //获取加载的页面 137 var pages = getCurrentPages(); //获取加载的页面
134 var currentPage = pages[pages.length - 1]; //获取当前页面的对象 138 var currentPage = pages[pages.length - 1]; //获取当前页面的对象
135 139
136 - if(!th.globalData.wxapp_buy_obj) { 140 + if (!th.globalData.wxapp_buy_obj) {
137 var turl = "/api/weshop/storeconfig/get/" + th.globalData.setting.stoid; 141 var turl = "/api/weshop/storeconfig/get/" + th.globalData.setting.stoid;
138 th.promiseGet(turl, {}).then(res => { 142 th.promiseGet(turl, {}).then(res => {
139 var o = res; 143 var o = res;
@@ -176,7 +180,7 @@ App({ @@ -176,7 +180,7 @@ App({
176 }) 180 })
177 181
178 } 182 }
179 - else{ 183 + else {
180 var tt = th.globalData.wxapp_buy_obj; 184 var tt = th.globalData.wxapp_buy_obj;
181 if (tt && tt.isout == 1) { 185 if (tt && tt.isout == 1) {
182 th.promiseGet('/api/weshop/store/get/' + t.stoid, {}).then(res => { 186 th.promiseGet('/api/weshop/store/get/' + t.stoid, {}).then(res => {
@@ -202,394 +206,408 @@ App({ @@ -202,394 +206,408 @@ App({
202 }, 206 },
203 207
204 //---初始化第三方---- 208 //---初始化第三方----
205 - initExt: function() {  
206 - var tt=t; 209 + initExt: function () {
  210 + var tt = t;
207 console.log("initExt"); 211 console.log("initExt");
208 console.log(11); 212 console.log(11);
209 var t = wx.getExtConfigSync(), o = this.globalData.setting; 213 var t = wx.getExtConfigSync(), o = this.globalData.setting;
210 console.log(t); 214 console.log(t);
211 - t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt=1; 215 + t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt = 1;
212 216
213 }, 217 },
214 218
215 //首页的第一次登录 219 //首页的第一次登录
216 - getUserFir(t){  
217 - var s = this;  
218 - if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else {  
219 - if (!o.isAuth()) return o.wxLogin_fir(t);  
220 - if (null == s.globalData.userInfo) {  
221 - return o.wxLogin_fir(t); 220 + getUserFir(t) {
  221 + var s = this;
  222 + if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else {
  223 + if (!o.isAuth()) return o.wxLogin_fir(t);
  224 + if (null == s.globalData.userInfo) {
  225 + return o.wxLogin_fir(t);
  226 + }
222 } 227 }
223 - }  
224 }, 228 },
225 229
226 - getUserInfo: function(t, n, i) { 230 + getUserInfo: function (t, n, i) {
227 var s = this; 231 var s = this;
228 if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else { 232 if (o.isAuth()) "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser); else {
229 - if (!o.isAuth()) return o.auth(t);  
230 - if (null == s.globalData.userInfo){  
231 - return o.auth(t);  
232 - }  
233 - /*---  
234 - a.get("/api/user/userInfo", {  
235 - isShowLoading: void 0 === i || i,  
236 - success: function(o) {  
237 - s.globalData.userInfo = o.data.result, s.globalData.userInfo.head_pic = e.getFullUrl(s.globalData.userInfo.head_pic),  
238 - "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser);  
239 - }  
240 - });--*/ 233 + if (!o.isAuth()) return o.auth(t);
  234 + if (null == s.globalData.userInfo) {
  235 + return o.auth(t);
  236 + }
  237 + /*---
  238 + a.get("/api/user/userInfo", {
  239 + isShowLoading: void 0 === i || i,
  240 + success: function(o) {
  241 + s.globalData.userInfo = o.data.result, s.globalData.userInfo.head_pic = e.getFullUrl(s.globalData.userInfo.head_pic),
  242 + "function" == typeof t && t(s.globalData.userInfo, s.globalData.wechatUser);
  243 + }
  244 + });--*/
241 } 245 }
242 }, 246 },
243 //----------------获取配置参数-------------------- 247 //----------------获取配置参数--------------------
244 - getConfig: function(t, o) {  
245 - var e = this;  
246 - if(!e.globalData.setting.stoid){  
247 - t(null);  
248 - return false;  
249 - }  
250 - if(this.globalData.config==undefined) this.globalData.config=null;  
251 - this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.requestGet("/api/weshop/store/get/" + e.globalData.setting.stoid, {  
252 - success: function(o) {  
253 - console.log('getConfig');  
254 - if(o.data.code==0){ 248 + getConfig: function (t, o) {
  249 + var e = this;
  250 + if (!e.globalData.setting.stoid) {
  251 + t(null);
  252 + return false;
  253 + }
  254 + if (this.globalData.config == undefined) this.globalData.config = null;
  255 + this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.requestGet("/api/weshop/store/get/" + e.globalData.setting.stoid, {
  256 + success: function (o) {
  257 + console.log('getConfig', o);
  258 + if (o.data.code == 0) {
255 e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); 259 e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config);
256 } 260 }
257 } 261 }
258 }); 262 });
259 }, 263 },
260 //----------------获取配置参数-------------------- 264 //----------------获取配置参数--------------------
261 - getConfig2: function (t, o) {  
262 - var e = this;  
263 - if(!e.globalData.setting.stoid) {  
264 - t(null);  
265 - return false;  
266 - }  
267 - this.globalData.config2 && !o ?  
268 - "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, {  
269 - success: function (o) {  
270 - console.log('getConfig2');  
271 - if (o.data.code == 0) {  
272 - e.globalData.config2 = o.data.data, "function" == typeof t && t(e.globalData.config2);  
273 - }  
274 - }  
275 - });  
276 - },  
277 -  
278 - //----------------获取商家开启的物流--------------------  
279 - getwuliu: function (t, o){  
280 - this.globalData.wuliu=null;  
281 - var th = this, st = this.globalData.setting;  
282 - //获取物流不缓存  
283 - a.get("/api/weshop/storeshipping/list", {  
284 - data: { store_id: st.stoid, status: 1, pageSize:2000 },  
285 - success: function (o) {  
286 - console.log('getwuliu');  
287 - console.log(o);  
288 - if (o.data.code == 0 && o.data.data && o.data.data.pageData && o.data.data.pageData.length>0) {  
289 - var arr = o.data.data.pageData;  
290 - console.log(arr);  
291 - arr.forEach(function(item,index){  
292 - arr[index].code = item.shipping_code; arr[index].name = item.shipping_name;  
293 - })  
294 - th.globalData.wuliu = arr, "function" == typeof t && t(arr);  
295 - }  
296 - }  
297 - });  
298 - },  
299 -  
300 - //----------------获取物流价格表--------------------  
301 - getwuliuprice: function (t, o) {  
302 - var e = this,th=e, st = this.globalData.setting;  
303 - //获取物流不缓存  
304 - a.get("/api/weshop/shippingarea/list",{  
305 - data: { store_id: st.stoid,pageSize: 2000 },  
306 - success: function (o) {  
307 - console.log('getwuliuprice');  
308 - console.log(o);  
309 - if (o.data.code == 0) {  
310 - var arr=o.data.data.pageData;  
311 - console.log(arr);  
312 - if (arr.length>0){  
313 - for (var i = 0; i < arr.length;i++){  
314 - arr[i].code = arr[i].shipping_code;  
315 - if (arr[i].json_config != "" && arr[i].json_config != undefined && arr[i].json_config != null )  
316 - arr[i].config = JSON.parse(arr[i].json_config);  
317 - }  
318 - }  
319 - th.globalData.wuliuprice = o.data.data, "function" == typeof t && t(e.globalData.wuliuprice);  
320 - } 265 + getConfig2: function (t, o) {
  266 + var e = this;
  267 + if (!e.globalData.setting.stoid) {
  268 + t(null);
  269 + return false;
321 } 270 }
322 - });  
323 - }, 271 + this.globalData.config2 && !o ?
  272 + "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, {
  273 + success: function (o) {
  274 + console.log('getConfig2');
  275 + if (o.data.code == 0) {
  276 + e.globalData.config2 = o.data.data, "function" == typeof t && t(e.globalData.config2);
  277 + }
  278 + }
  279 + });
  280 + },
  281 +
  282 + //----------------获取商家开启的物流--------------------
  283 + getwuliu: function (t, o) {
  284 + this.globalData.wuliu = null;
  285 + var th = this, st = this.globalData.setting;
  286 + //获取物流不缓存
  287 + a.get("/api/weshop/storeshipping/list", {
  288 + data: { store_id: st.stoid, status: 1, pageSize: 2000 },
  289 + success: function (o) {
  290 + console.log('getwuliu');
  291 + console.log(o);
  292 + if (o.data.code == 0 && o.data.data && o.data.data.pageData && o.data.data.pageData.length > 0) {
  293 + var arr = o.data.data.pageData;
  294 + console.log(arr);
  295 + arr.forEach(function (item, index) {
  296 + arr[index].code = item.shipping_code; arr[index].name = item.shipping_name;
  297 + })
  298 + th.globalData.wuliu = arr, "function" == typeof t && t(arr);
  299 + }
  300 + }
  301 + });
  302 + },
  303 +
  304 + //----------------获取物流价格表--------------------
  305 + getwuliuprice: function (t, o) {
  306 + var e = this, th = e, st = this.globalData.setting;
  307 + //获取物流不缓存
  308 + a.get("/api/weshop/shippingarea/list", {
  309 + data: { store_id: st.stoid, pageSize: 2000 },
  310 + success: function (o) {
  311 + console.log('getwuliuprice');
  312 + console.log(o);
  313 + if (o.data.code == 0) {
  314 + var arr = o.data.data.pageData;
  315 + console.log(arr);
  316 + if (arr.length > 0) {
  317 + for (var i = 0; i < arr.length; i++) {
  318 + arr[i].code = arr[i].shipping_code;
  319 + if (arr[i].json_config != "" && arr[i].json_config != undefined && arr[i].json_config != null)
  320 + arr[i].config = JSON.parse(arr[i].json_config);
  321 + }
  322 + }
  323 + th.globalData.wuliuprice = o.data.data, "function" == typeof t && t(e.globalData.wuliuprice);
  324 + }
  325 + }
  326 + });
  327 + },
324 //----------------设置立即购买数组-------------------- 328 //----------------设置立即购买数组--------------------
325 - set_b_now: function (d) { this.globalData.buy_now=d;},  
326 - get_b_now: function () {return this.globalData.buy_now}, 329 + set_b_now: function (d) { this.globalData.buy_now = d; },
  330 + get_b_now: function () { return this.globalData.buy_now },
327 331
328 - getPrevPageData: function(t) { 332 + getPrevPageData: function (t) {
329 void 0 === t && (t = 1); 333 void 0 === t && (t = 1);
330 var o = getCurrentPages(); 334 var o = getCurrentPages();
331 return o[o.length - t - 1].data; 335 return o[o.length - t - 1].data;
332 }, 336 },
333 - showLoading: function(t, o) { 337 + showLoading: function (t, o) {
334 void 0 === o && (o = 1500), wx.showToast({ 338 void 0 === o && (o = 1500), wx.showToast({
335 title: "加载中", 339 title: "加载中",
336 icon: "loading", 340 icon: "loading",
337 duration: o, 341 duration: o,
338 mask: !0, 342 mask: !0,
339 - complete: function() { 343 + complete: function () {
340 "function" == typeof t && setTimeout(t, o); 344 "function" == typeof t && setTimeout(t, o);
341 } 345 }
342 }); 346 });
343 }, 347 },
344 - showSuccess: function(t, o, a) { 348 + showSuccess: function (t, o, a) {
345 void 0 === a && (a = 1e3), wx.showToast({ 349 void 0 === a && (a = 1e3), wx.showToast({
346 title: t, 350 title: t,
347 icon: "success", 351 icon: "success",
348 duration: a, 352 duration: a,
349 mask: !0, 353 mask: !0,
350 - complete: function() { 354 + complete: function () {
351 "function" == typeof o && setTimeout(o, a); 355 "function" == typeof o && setTimeout(o, a);
352 } 356 }
353 }); 357 });
354 }, 358 },
355 - showWarning: function(t, o, a, e) { 359 + showWarning: function (t, o, a, e) {
356 //var imghost=this.globalData.setting.imghost; 360 //var imghost=this.globalData.setting.imghost;
357 !a && (a = 1500), void 0 === e && (e = !0), wx.showToast({ 361 !a && (a = 1500), void 0 === e && (e = !0), wx.showToast({
358 title: t, 362 title: t,
359 mask: e, 363 mask: e,
360 duration: a, 364 duration: a,
361 - image:"/images/gt.png",  
362 - complete: function() { 365 + image: "/images/gt.png",
  366 + complete: function () {
363 "function" == typeof o && setTimeout(o, a); 367 "function" == typeof o && setTimeout(o, a);
364 } 368 }
365 }); 369 });
366 }, 370 },
367 371
368 - confirmBox: function(t, o) { 372 + confirmBox: function (t, o) {
369 wx.showModal({ 373 wx.showModal({
370 title: t, 374 title: t,
371 showCancel: !1, 375 showCancel: !1,
372 - complete: function() { 376 + complete: function () {
373 "function" == typeof o && o(); 377 "function" == typeof o && o();
374 } 378 }
375 }); 379 });
376 }, 380 },
377 381
378 //----------获取所有的门店------------ 382 //----------获取所有的门店------------
379 - get_allsto(func){  
380 - var th=this;  
381 - if (this.globalData.picklist!=null){  
382 - "function" == typeof func && func(th.globalData.picklist);  
383 - }else{  
384 - th.request.get("/api/weshop/pickup/page", {  
385 - data: { store_id: th.globalData.setting.stoid, pageSize: 600 },  
386 - success: function (da) {  
387 - //设置门店  
388 - //th.setData({ allsto: da.data.data.pageData });  
389 - th.globalData.picklist = da.data.data.pageData;  
390 - "function" == typeof func && func(th.globalData.picklist);  
391 - }  
392 - }) 383 + get_allsto(func) {
  384 + var th = this;
  385 + if (this.globalData.picklist != null) {
  386 + "function" == typeof func && func(th.globalData.picklist);
  387 + } else {
  388 + th.request.get("/api/weshop/pickup/page", {
  389 + data: { store_id: th.globalData.setting.stoid, pageSize: 600 },
  390 + success: function (da) {
  391 + //设置门店
  392 + //th.setData({ allsto: da.data.data.pageData });
  393 + th.globalData.picklist = da.data.data.pageData;
  394 + "function" == typeof func && func(th.globalData.picklist);
  395 + }
  396 + })
393 } 397 }
394 }, 398 },
395 399
396 //同步化,在调用的时候要await 400 //同步化,在调用的时候要await
397 - async get_isbuy(func) {  
398 - var th=this  
399 - var stoid=os.stoid;  
400 -  
401 - await this.promiseGet("/store/storemoduleendtime/page?store_id=" +stoid + "&type=5",{}).then(res=>{  
402 - var o=res;  
403 - if (o.data.code == 0) {  
404 - var ob = { isout: 0, isbuy: 1 };  
405 - var arr = o.data.data.pageData;  
406 - var isbuy = 0;  
407 - //----如果数组不为空----  
408 - if (arr.length > 0) {  
409 - arr.forEach(function (val, ind) {  
410 - if (val.is_sy == 0 && val.type == 5) {  
411 - isbuy = 1;  
412 - var now = ut.gettimestamp();  
413 - if (now > val.end_time) ob.isout = 1;  
414 - return false;  
415 - } 401 + async get_isbuy(func) {
  402 + var th = this
  403 + var stoid = os.stoid;
  404 +
  405 + await this.promiseGet("/store/storemoduleendtime/page?store_id=" + stoid + "&type=5", {}).then(res => {
  406 + var o = res;
  407 + if (o.data.code == 0) {
  408 + var ob = { isout: 0, isbuy: 1 };
  409 + var arr = o.data.data.pageData;
  410 + var isbuy = 0;
  411 + //----如果数组不为空----
  412 + if (arr.length > 0) {
  413 + arr.forEach(function (val, ind) {
  414 + if (val.is_sy == 0 && val.type == 5) {
  415 + isbuy = 1;
  416 + var now = ut.gettimestamp();
  417 + if (now > val.end_time) ob.isout = 1;
  418 + return false;
  419 + }
  420 + })
  421 + }
  422 + ob.isbuy = isbuy;
  423 + th.globalData.wxapp_buy_obj = ob;
  424 + if (func) {
  425 + func();
  426 + }
  427 + }
  428 + })
  429 + },
  430 + //获取场景值 判断是否是单页面
  431 + is_Single_page() {
  432 + let scene = wx.getLaunchOptionsSync().scene;
  433 + //--先判断会员状态--
  434 + if (scene == 1154) {
  435 + wx.showToast({
  436 + title: '请前往小程序',
  437 + icon: "error",
  438 + duration: 3000,
416 }) 439 })
417 - }  
418 - ob.isbuy = isbuy;  
419 - th.globalData.wxapp_buy_obj=ob;  
420 - if(func){  
421 - func();  
422 - } 440 + return false
423 } 441 }
424 - }) 442 + return true;
425 }, 443 },
426 444
  445 +
427 //--同步化,在调用的时候要await,获取商家config-- 446 //--同步化,在调用的时候要await,获取商家config--
428 - async getConfig_ays(){  
429 - if(this.globalData.config!=null) return false;  
430 - var th=this;  
431 - await api.get_config(this.globalData.setting.stoid).then(res=>{  
432 - var o=res;  
433 - if(o.data.code==0){  
434 - th.globalData.config = o.data.data;  
435 - }  
436 - }) 447 + async getConfig_ays() {
  448 + if (this.globalData.config != null) return false;
  449 + var th = this;
  450 + await api.get_config(this.globalData.setting.stoid).then(res => {
  451 + var o = res;
  452 + if (o.data.code == 0) {
  453 + th.globalData.config = o.data.data;
  454 + }
  455 + })
437 }, 456 },
438 457
439 //----智能跳转,判断 非tabBar,tabBar页面的跳转---- 458 //----智能跳转,判断 非tabBar,tabBar页面的跳转----
440 - goto:function (url) {  
441 - var arr=getCurrentPages();  
442 - if(arr.length>8){  
443 - arr.splice(0, 2);  
444 - }  
445 - var arr_tabbar=["/pages/index/index/index",  
446 - "/pages/goods/categoryList/categoryList",  
447 - "/pages/goods/categoryList/categoryList?type=2",  
448 - "/pages/goods/categoryList/categoryList?type=1",  
449 - "/pages/cart/cart/cart","/pages/user/index/index",  
450 - "/pages/distribution/distribution"];  
451 - if(arr_tabbar.indexOf(url)!=-1){  
452 - if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1;  
453 - if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2;  
454 - wx.switchTab({url: url,}) //跳到tabbar页  
455 -  
456 - }else{ 459 + goto: function (url) {
  460 + var arr = getCurrentPages();
  461 + if (arr.length > 8) {
  462 + arr.splice(0, 2);
  463 + }
  464 + var arr_tabbar = ["/pages/index/index/index",
  465 + "/pages/goods/categoryList/categoryList",
  466 + "/pages/goods/categoryList/categoryList?type=2",
  467 + "/pages/goods/categoryList/categoryList?type=1",
  468 + "/pages/cart/cart/cart", "/pages/user/index/index",
  469 + "/pages/distribution/distribution"];
  470 + if (arr_tabbar.indexOf(url) != -1) {
  471 + if (url.indexOf("categoryList?type=1") != -1) this.globalData.cat_type = 1;
  472 + if (url.indexOf("categoryList?type=2") != -1) this.globalData.cat_type = 2;
  473 + wx.switchTab({ url: url, }) //跳到tabbar页
  474 +
  475 + } else {
457 if (getCurrentPages().length > 9) { 476 if (getCurrentPages().length > 9) {
458 - wx.redirectTo({url: url,}) //跳到非tabbar页  
459 - }else{  
460 - wx.navigateTo({url: url,}) //跳到tabbar页 477 + wx.redirectTo({ url: url, }) //跳到非tabbar页
  478 + } else {
  479 + wx.navigateTo({ url: url, }) //跳到tabbar页
461 } 480 }
462 } 481 }
463 //wx.navigateTo({ url: url, }) //跳到非tabbar页 482 //wx.navigateTo({ url: url, }) //跳到非tabbar页
464 }, 483 },
465 484
466 //显示提示,word提示内容,type 0失败,提示 1成功 485 //显示提示,word提示内容,type 0失败,提示 1成功
467 - my_warnning(word,type,that,width){ 486 + my_warnning(word, type, that, width) {
468 var warn = that.selectComponent("#warn"); //组件的id 487 var warn = that.selectComponent("#warn"); //组件的id
469 - warn.open(word,type,width); 488 + warn.open(word, type, width);
470 return 1; 489 return 1;
471 }, 490 },
472 491
473 //获取会员门店 492 //获取会员门店
474 - get_user_store:function (func)  
475 - {  
476 - var th=this; 493 + get_user_store: function (func) {
  494 + var th = this;
477 this.getConfig2(function (conf) { 495 this.getConfig2(function (conf) {
478 //---空会员的情况--- 496 //---空会员的情况---
479 - if(!th.globalData.userInfo){ 497 + if (!th.globalData.userInfo) {
480 return func(null); 498 return func(null);
481 } 499 }
482 - if(!th.globalData.pk_store){  
483 - var pick_id=0; 500 + if (!th.globalData.pk_store) {
  501 + var pick_id = 0;
484 //先找一个会员是否有设置默认的地址 502 //先找一个会员是否有设置默认的地址
485 - if(th.globalData.userInfo.def_pickup_id){  
486 - pick_id= th.globalData.userInfo.def_pickup_id 503 + if (th.globalData.userInfo.def_pickup_id) {
  504 + pick_id = th.globalData.userInfo.def_pickup_id
487 } 505 }
488 //查找会员的注册的地址 506 //查找会员的注册的地址
489 - else if(th.globalData.userInfo.pickup_id){ 507 + else if (th.globalData.userInfo.pickup_id) {
490 //--购买门店是否默认登记门店-- 508 //--购买门店是否默认登记门店--
491 - if(conf.switch_list){  
492 - var t_swi=JSON.parse(conf.switch_list);  
493 - if(t_swi.is_regstores){  
494 - pick_id= th.globalData.userInfo.pickup_id 509 + if (conf.switch_list) {
  510 + var t_swi = JSON.parse(conf.switch_list);
  511 + if (t_swi.is_regstores) {
  512 + pick_id = th.globalData.userInfo.pickup_id
495 } 513 }
496 } 514 }
497 515
498 } 516 }
499 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- 517 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
500 - if(pick_id==0) return func(null);  
501 -  
502 - //返回门店的数量  
503 - th.get_pk_num(function(num){  
504 - //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭  
505 - th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{  
506 - data:{},  
507 - success:function (res) {  
508 - th.globalData.pk_store=null;  
509 - if(res.data.code==0 && res.data.data && res.data.data.isstop==0 && res.data.data.is_pos==1){  
510 -  
511 - //--门店的数量大于10个才要关心门店的分类有没有关闭--  
512 - if(res.data.data.category_id && num>10){  
513 - th.request.get( "/api/weshop/storagecategory/get/"+os.stoid+"/"+res.data.data.category_id, {  
514 - data: {},  
515 - success: function (ee) {  
516 - if(ee.data.code==0 && ee.data.data ){  
517 - if(ee.data.data.is_show==1){  
518 - th.globalData.pk_store = res.data.data;  
519 - func(th.globalData.pk_store);  
520 - }else{  
521 - //看一下有没有显示的门店分类  
522 - getApp().request.get("/api/weshop/storagecategory/page", {  
523 - data: {  
524 - store_id: os.stoid,  
525 - is_show: 1,  
526 - pageSize: 1,  
527 - },  
528 - success: function (ee) {  
529 - if(ee.data.code==0){  
530 - if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0){  
531 - func(null);  
532 - }else{  
533 - th.globalData.pk_store = res.data.data;  
534 - func(th.globalData.pk_store);  
535 - }  
536 - }else{  
537 - th.globalData.pk_store = res.data.data;  
538 - func(th.globalData.pk_store);  
539 - }  
540 - }  
541 - })  
542 - }  
543 - }else{ 518 + if (pick_id == 0) return func(null);
  519 +
  520 + //返回门店的数量
  521 + th.get_pk_num(function (num) {
  522 + //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭
  523 + th.request.get("/api/weshop/pickup/get/" + os.stoid + "/" + pick_id, {
  524 + data: {},
  525 + success: function (res) {
  526 + th.globalData.pk_store = null;
  527 + if (res.data.code == 0 && res.data.data && res.data.data.isstop == 0 && res.data.data.is_pos == 1) {
  528 +
  529 + //--门店的数量大于10个才要关心门店的分类有没有关闭--
  530 + if (res.data.data.category_id && num > 10) {
  531 + th.request.get("/api/weshop/storagecategory/get/" + os.stoid + "/" + res.data.data.category_id, {
  532 + data: {},
  533 + success: function (ee) {
  534 + if (ee.data.code == 0 && ee.data.data) {
  535 + if (ee.data.data.is_show == 1) {
  536 + th.globalData.pk_store = res.data.data;
  537 + func(th.globalData.pk_store);
  538 + } else {
  539 + //看一下有没有显示的门店分类
  540 + getApp().request.get("/api/weshop/storagecategory/page", {
  541 + data: {
  542 + store_id: os.stoid,
  543 + is_show: 1,
  544 + pageSize: 1,
  545 + },
  546 + success: function (ee) {
  547 + if (ee.data.code == 0) {
  548 + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
  549 + func(null);
  550 + } else {
  551 + th.globalData.pk_store = res.data.data;
  552 + func(th.globalData.pk_store);
  553 + }
  554 + } else {
  555 + th.globalData.pk_store = res.data.data;
  556 + func(th.globalData.pk_store);
  557 + }
  558 + }
  559 + })
  560 + }
  561 + } else {
544 func(null); 562 func(null);
545 - }  
546 - }  
547 - })  
548 - }else{  
549 - th.globalData.pk_store = res.data.data;  
550 - func(th.globalData.pk_store);  
551 - }  
552 - }else{  
553 - func(null);  
554 - }  
555 - }  
556 - })  
557 -  
558 - })  
559 -  
560 - }else{ 563 + }
  564 + }
  565 + })
  566 + } else {
  567 + th.globalData.pk_store = res.data.data;
  568 + func(th.globalData.pk_store);
  569 + }
  570 + } else {
  571 + func(null);
  572 + }
  573 + }
  574 + })
  575 +
  576 + })
  577 +
  578 + } else {
561 func(th.globalData.pk_store); 579 func(th.globalData.pk_store);
562 } 580 }
563 }) 581 })
564 }, 582 },
565 -  
566 - //-- 获取门店的数量 --  
567 - get_pk_num:function(func){  
568 - this.request.get("/api/weshop/pickup/page",{  
569 - data:{page:1,pageSize:1,isstop:0,store_id:os.stoid},  
570 - success:function (res) {  
571 - if(res.data.code==0){  
572 - func(res.data.data.total); //门店数量  
573 - }  
574 - }  
575 - });  
576 - }, 583 +
  584 + //-- 获取门店的数量 --
  585 + get_pk_num: function (func) {
  586 + this.request.get("/api/weshop/pickup/page", {
  587 + data: { page: 1, pageSize: 1, isstop: 0, store_id: os.stoid },
  588 + success: function (res) {
  589 + if (res.data.code == 0) {
  590 + func(res.data.data.total); //门店数量
  591 + }
  592 + }
  593 + });
  594 + },
577 //-------获取购物车数量---------- 595 //-------获取购物车数量----------
578 - requestCardNum: function(th) {  
579 - if(!this.globalData.user_id) return false;  
580 - var that=this; 596 + requestCardNum: function (th) {
  597 + if (!this.globalData.user_id) return false;
  598 + var that = this;
581 this.request.get("/api/weshop/cart/page", { 599 this.request.get("/api/weshop/cart/page", {
582 - isShoeLoading:false, 600 + isShoeLoading: false,
583 data: { 601 data: {
584 store_id: this.globalData.setting.stoid, 602 store_id: this.globalData.setting.stoid,
585 user_id: this.globalData.user_id, 603 user_id: this.globalData.user_id,
586 - state:0,  
587 - is_gift:0,  
588 - pageSize:300 604 + state: 0,
  605 + is_gift: 0,
  606 + pageSize: 300
589 }, 607 },
590 - success: function(e) { 608 + success: function (e) {
591 var num = 0; 609 var num = 0;
592 - if(e.data.data && e.data.data.pageData) { 610 + if (e.data.data && e.data.data.pageData) {
593 for (var i = 0; i < e.data.data.pageData.length; i++) { 611 for (var i = 0; i < e.data.data.pageData.length; i++) {
594 num += e.data.data.pageData[i].goods_num; 612 num += e.data.data.pageData[i].goods_num;
595 } 613 }
@@ -600,131 +618,131 @@ App({ @@ -600,131 +618,131 @@ App({
600 text: '' + num //显示的内容 618 text: '' + num //显示的内容
601 });--*/ 619 });--*/
602 //-- 读取服务卡的数量 -- 620 //-- 读取服务卡的数量 --
603 - that.promiseGet("/api/weshop/cartService/page",{  
604 - data:{ 621 + that.promiseGet("/api/weshop/cartService/page", {
  622 + data: {
605 store_id: that.globalData.setting.stoid, 623 store_id: that.globalData.setting.stoid,
606 user_id: that.globalData.user_id, 624 user_id: that.globalData.user_id,
607 } 625 }
608 - }).then(res=>{ 626 + }).then(res => {
609 627
610 for (var i = 0; i < res.data.data.pageData.length; i++) { 628 for (var i = 0; i < res.data.data.pageData.length; i++) {
611 num += res.data.data.pageData[i].goods_num; 629 num += res.data.data.pageData[i].goods_num;
612 } 630 }
613 631
614 - that.globalData.cartGoodsNum=num; 632 + that.globalData.cartGoodsNum = num;
615 th.data.up_dating = 0 633 th.data.up_dating = 0
616 - th.getTabBar().setData({cartGoodsNum:num}); 634 + th.getTabBar().setData({ cartGoodsNum: num });
617 }) 635 })
618 636
619 } 637 }
620 }); 638 });
621 }, 639 },
622 -  
623 - //------定时等待某个值,有值才进行运算--------  
624 - waitfor:function(page,key,pop_value,func){  
625 - var n=0;  
626 - if(!page.data[key]){  
627 - page.data[key]=setInterval(function(){  
628 - console.log(page.data[key]);n++;  
629 - if(pop_value) {  
630 - clearInterval(page.data[key]);  
631 - func();  
632 - }  
633 - if(n>15) clearInterval(page.data[key]);  
634 - },1000);  
635 - }  
636 - },  
637 -  
638 - //------定时等待某个值,有值才进行运算--------  
639 - waitfor2:function(page,key,pop_value_key,func){  
640 - var n=0;  
641 - if(!page.data[key]){  
642 - page.data[key]=setInterval(function(){  
643 - console.log(page.data[key]);n++;  
644 - if(page.data[pop_value_key] && Object.keys(page.data[pop_value_key]).length>0) {  
645 - clearInterval(page.data[key]);  
646 - func();  
647 - }  
648 - if(n>15){ 640 +
  641 + //------定时等待某个值,有值才进行运算--------
  642 + waitfor: function (page, key, pop_value, func) {
  643 + var n = 0;
  644 + if (!page.data[key]) {
  645 + page.data[key] = setInterval(function () {
  646 + console.log(page.data[key]); n++;
  647 + if (pop_value) {
649 clearInterval(page.data[key]); 648 clearInterval(page.data[key]);
650 func(); 649 func();
651 } 650 }
652 - },1000);  
653 - }  
654 - }, 651 + if (n > 15) clearInterval(page.data[key]);
  652 + }, 1000);
  653 + }
  654 + },
  655 +
  656 + //------定时等待某个值,有值才进行运算--------
  657 + waitfor2: function (page, key, pop_value_key, func) {
  658 + var n = 0;
  659 + if (!page.data[key]) {
  660 + page.data[key] = setInterval(function () {
  661 + console.log(page.data[key]); n++;
  662 + if (page.data[pop_value_key] && Object.keys(page.data[pop_value_key]).length > 0) {
  663 + clearInterval(page.data[key]);
  664 + func();
  665 + }
  666 + if (n > 15) {
  667 + clearInterval(page.data[key]);
  668 + func();
  669 + }
  670 + }, 1000);
  671 + }
  672 + },
655 673
656 //清空登录时候缓存的值 674 //清空登录时候缓存的值
657 - onHide:function () {  
658 - this.globalData.is_test=0;  
659 - this.globalData.guide_id=null; //导购清空  
660 - this.globalData.first_leader=null; //分享的会员清空  
661 - this.globalData.wuliu=null; //关闭要把物流清空  
662 - this.globalData.room_id=null; //关闭要把房间号关闭  
663 - this.globalData.room_goods_id=null; //关闭要把物流清空  
664 - this.globalData.config2=null; //清除config2的缓存  
665 - this.globalData.config=null; //清除config的缓存  
666 - this.globalData.gr_index=0; //商品分组的序列  
667 - this.globalData.pk_store=null;  
668 - this.globalData.wxapp_buy_obj=null;  
669 - this.globalData.dis_buy_obj=null; //等级卡的购买记录  
670 - this.globalData.storeFooter=null; //底部的导航  
671 - this.globalData.full_screen=null; //全屏  
672 -  
673 - },  
674 -  
675 - clear_word:function (word) {  
676 -  
677 - var str=word;  
678 - let reg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n])|(\s)/g ,  
679 - indexArr = reg.exec(str);  
680 - if(str.match(reg)) {  
681 - str = str.replace(reg, ''); 675 + onHide: function () {
  676 + this.globalData.is_test = 0;
  677 + this.globalData.guide_id = null; //导购清空
  678 + this.globalData.first_leader = null; //分享的会员清空
  679 + this.globalData.wuliu = null; //关闭要把物流清空
  680 + this.globalData.room_id = null; //关闭要把房间号关闭
  681 + this.globalData.room_goods_id = null; //关闭要把物流清空
  682 + this.globalData.config2 = null; //清除config2的缓存
  683 + this.globalData.config = null; //清除config的缓存
  684 + this.globalData.gr_index = 0; //商品分组的序列
  685 + this.globalData.pk_store = null;
  686 + this.globalData.wxapp_buy_obj = null;
  687 + this.globalData.dis_buy_obj = null; //等级卡的购买记录
  688 + this.globalData.storeFooter = null; //底部的导航
  689 + this.globalData.full_screen = null; //全屏
  690 +
  691 + },
  692 +
  693 + clear_word: function (word) {
  694 +
  695 + var str = word;
  696 + let reg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n])|(\s)/g,
  697 + indexArr = reg.exec(str);
  698 + if (str.match(reg)) {
  699 + str = str.replace(reg, '');
  700 + }
  701 + return str;
  702 + },
  703 +
  704 + getPageIndex: function (curPage) {
  705 +
  706 + var pagePath = curPage.route; //当前页面url
  707 + if (pagePath.indexOf('/') != 0) {
  708 + pagePath = '/' + pagePath;
  709 + }
  710 +
  711 + var index = 0;
  712 +
  713 + if (this.globalData.custum_data) {
  714 + var itemList = this.globalData.custum_data.data;
  715 + itemList = JSON.parse(itemList);
  716 + for (var i in itemList) {
  717 + var item = itemList[i]
  718 + if (pagePath.indexOf(item.weappurl) != -1) {
  719 + index = i; break;
  720 + }
682 } 721 }
683 - return str;  
684 - },  
685 -  
686 - getPageIndex:function(curPage){  
687 -  
688 - var pagePath = curPage.route; //当前页面url  
689 - if (pagePath.indexOf('/') != 0) {  
690 - pagePath = '/' + pagePath;  
691 - }  
692 -  
693 - var index=0;  
694 -  
695 - if(this.globalData.custum_data){  
696 - var itemList = this.globalData.custum_data.data;  
697 - itemList = JSON.parse(itemList);  
698 - for(var i in itemList){  
699 - var item=itemList[i]  
700 - if(pagePath.indexOf(item.weappurl)!=-1){  
701 - index=i;break;  
702 - }  
703 - }  
704 -  
705 - }else{  
706 - var itemList=this.def_list;  
707 - for(var i in itemList){  
708 - var item=itemList[i]  
709 - if(pagePath.indexOf(item.weappurl)!=-1){  
710 - index=i;break;  
711 - }  
712 - }  
713 - }  
714 - return index;  
715 -  
716 - }, 722 +
  723 + } else {
  724 + var itemList = this.def_list;
  725 + for (var i in itemList) {
  726 + var item = itemList[i]
  727 + if (pagePath.indexOf(item.weappurl) != -1) {
  728 + index = i; break;
  729 + }
  730 + }
  731 + }
  732 + return index;
  733 +
  734 + },
717 735
718 //---promise的使用get---- 736 //---promise的使用get----
719 - promiseGet:function(url,data){  
720 - if(url.indexOf("http")==-1) url=this.globalData.setting.url +url; 737 + promiseGet: function (url, data) {
  738 + if (url.indexOf("http") == -1) url = this.globalData.setting.url + url;
721 return new Promise((resolve, reject) => { 739 return new Promise((resolve, reject) => {
722 data.isShowLoading && wx.showLoading(); 740 data.isShowLoading && wx.showLoading();
723 wx.request({ 741 wx.request({
724 url, 742 url,
725 method: 'GET', 743 method: 'GET',
726 - header: {"content-type": "application/x-www-form-urlencoded" },  
727 - data:data.data, 744 + header: { "content-type": "application/x-www-form-urlencoded" },
  745 + data: data.data,
728 success(res) { 746 success(res) {
729 data.isShowLoading && wx.hideLoading(); 747 data.isShowLoading && wx.hideLoading();
730 resolve(res); 748 resolve(res);
@@ -736,40 +754,40 @@ App({ @@ -736,40 +754,40 @@ App({
736 754
737 755
738 //---promise的使用get---- 756 //---promise的使用get----
739 - requestGet:function(url,data){  
740 - if(url.indexOf("http")==-1) url=this.globalData.setting.url +url;  
741 - data.isShowLoading && wx.showLoading();  
742 - wx.request({  
743 - url,  
744 - method: 'GET',  
745 - header: {"content-type": "application/x-www-form-urlencoded" },  
746 - data:data.data,  
747 - success(res) {  
748 - data.isShowLoading && wx.hideLoading();  
749 - data.success(res);  
750 - },  
751 - fail(err) {  
752 - data.isShowLoading && wx.hideLoading();  
753 - if(data.fail) data.fail(err);  
754 - }  
755 - }) 757 + requestGet: function (url, data) {
  758 + if (url.indexOf("http") == -1) url = this.globalData.setting.url + url;
  759 + data.isShowLoading && wx.showLoading();
  760 + wx.request({
  761 + url,
  762 + method: 'GET',
  763 + header: { "content-type": "application/x-www-form-urlencoded" },
  764 + data: data.data,
  765 + success(res) {
  766 + data.isShowLoading && wx.hideLoading();
  767 + data.success(res);
  768 + },
  769 + fail(err) {
  770 + data.isShowLoading && wx.hideLoading();
  771 + if (data.fail) data.fail(err);
  772 + }
  773 + })
  774 + },
  775 +
  776 +
  777 + // 判断是否登录
  778 + isLogin() {
  779 + return new Promise(function (resolve, reject) {
  780 + let user_info = getApp().globalData.userInfo;
  781 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  782 + wx.navigateTo({
  783 + url: '/pages/togoin/togoin',
  784 + })
  785 + return false;
  786 + } else {
  787 + resolve(user_info);
  788 + };
  789 + });
756 }, 790 },
757 -  
758 -  
759 - // 判断是否登录  
760 - isLogin() {  
761 - return new Promise(function(resolve, reject) {  
762 - let user_info = getApp().globalData.userInfo;  
763 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
764 - wx.navigateTo({  
765 - url: '/pages/togoin/togoin',  
766 - })  
767 - return false;  
768 - } else {  
769 - resolve(user_info);  
770 - };  
771 - });  
772 - },  
773 791
774 792
775 checkUpdateVersion() { 793 checkUpdateVersion() {
@@ -781,17 +799,17 @@ App({ @@ -781,17 +799,17 @@ App({
781 return false; 799 return false;
782 } 800 }
783 //检测版本更新 801 //检测版本更新
784 - updateManager.onCheckForUpdate(function(res) { 802 + updateManager.onCheckForUpdate(function (res) {
785 console.log('是否获取版本'); 803 console.log('是否获取版本');
786 // 请求完新版本信息的回调 804 // 请求完新版本信息的回调
787 if (res.hasUpdate) { 805 if (res.hasUpdate) {
788 //监听小程序有版本更新事件 806 //监听小程序有版本更新事件
789 - updateManager.onUpdateReady(function() { 807 + updateManager.onUpdateReady(function () {
790 808
791 //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作) 809 //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作)
792 updateManager.applyUpdate(); 810 updateManager.applyUpdate();
793 }) 811 })
794 - updateManager.onUpdateFailed(function() { 812 + updateManager.onUpdateFailed(function () {
795 // 新版本下载失败 813 // 新版本下载失败
796 wx.showModal({ 814 wx.showModal({
797 title: '已经有新版本喽~', 815 title: '已经有新版本喽~',
@@ -812,6 +830,6 @@ App({ @@ -812,6 +830,6 @@ App({
812 830
813 831
814 832
815 - 833 +
816 834
817 }); 835 });
app.json
@@ -155,7 +155,6 @@ @@ -155,7 +155,6 @@
155 "pages/video/index", 155 "pages/video/index",
156 "pages/boxes-list/boxes-list", 156 "pages/boxes-list/boxes-list",
157 "pages/boxes-details/boxes-details" 157 "pages/boxes-details/boxes-details"
158 -  
159 ] 158 ]
160 }, 159 },
161 { 160 {
@@ -193,8 +192,15 @@ @@ -193,8 +192,15 @@
193 "pages/AI-test-skin/fail_result/fail_result", 192 "pages/AI-test-skin/fail_result/fail_result",
194 "pages/AI-test-skin/success_result/success_result", 193 "pages/AI-test-skin/success_result/success_result",
195 "pages/AI-test-skin/analyse/analyse" 194 "pages/AI-test-skin/analyse/analyse"
196 - ] 195 + ],
  196 + "plugins": {
  197 + "mtSkinSdk": {
  198 + "version": "1.4.2",
  199 + "provider": "wx3636b350f8484f20"
  200 + }
  201 + }
197 } 202 }
  203 +
198 ], 204 ],
199 "permission": { 205 "permission": {
200 "scope.userLocation": { 206 "scope.userLocation": {
@@ -256,4 +262,5 @@ @@ -256,4 +262,5 @@
256 "useExtendedLib": { 262 "useExtendedLib": {
257 "weui": true 263 "weui": true
258 } 264 }
  265 +
259 } 266 }
260 \ No newline at end of file 267 \ No newline at end of file
packageA/pages/goodsInfo/goodsInfo.js
@@ -209,7 +209,9 @@ Page({ @@ -209,7 +209,9 @@ Page({
209 209
210 //------初始化加载---------- 210 //------初始化加载----------
211 onLoad: function(t) { 211 onLoad: function(t) {
212 - 212 + if(!getApp().is_Single_page()){
  213 + return false;
  214 + }
213 self = this; 215 self = this;
214 this.data.options = t; // { goods_id: ...} 216 this.data.options = t; // { goods_id: ...}
215 217
packageA/pages/jfbuy/jfbuy.js
@@ -65,6 +65,9 @@ Page({ @@ -65,6 +65,9 @@ Page({
65 * 生命周期函数--监听页面加载 65 * 生命周期函数--监听页面加载
66 */ 66 */
67 onLoad: function (options) { 67 onLoad: function (options) {
  68 + if(!getApp().is_Single_page()){
  69 + return false;
  70 + }
68 var th=this; 71 var th=this;
69 this.data.requestData={ 72 this.data.requestData={
70 store_id:oo.stoid, 73 store_id:oo.stoid,
packageA/pages/liveStream/liveStream.js
@@ -208,6 +208,9 @@ Page({ @@ -208,6 +208,9 @@ Page({
208 * 生命周期函数--监听页面加载 208 * 生命周期函数--监听页面加载
209 */ 209 */
210 onLoad: function (options) { 210 onLoad: function (options) {
  211 + if(!getApp().is_Single_page()){
  212 + return false;
  213 + }
211 self = this; 214 self = this;
212 // console.log('ppppp',this.pageTotal(4, 10)); 215 // console.log('ppppp',this.pageTotal(4, 10));
213 216
packageB/pages/zuhegou/index/index.js
@@ -123,6 +123,9 @@ Page({ @@ -123,6 +123,9 @@ Page({
123 * 生命周期函数--监听页面加载 123 * 生命周期函数--监听页面加载
124 */ 124 */
125 onLoad: function (options) { 125 onLoad: function (options) {
  126 + if(!getApp().is_Single_page()){
  127 + return false;
  128 + }
126 console.log(options, 111); 129 console.log(options, 111);
127 self = this; 130 self = this;
128 var the_id = options.id; 131 var the_id = options.id;
packageB/pages/zuhegou/preindex/index.js
@@ -123,6 +123,9 @@ Page({ @@ -123,6 +123,9 @@ Page({
123 * 生命周期函数--监听页面加载 123 * 生命周期函数--监听页面加载
124 */ 124 */
125 onLoad: function (options) { 125 onLoad: function (options) {
  126 + if(!getApp().is_Single_page()){
  127 + return false;
  128 + }
126 console.log(options, 111); 129 console.log(options, 111);
127 self = this; 130 self = this;
128 var the_id = options.id; 131 var the_id = options.id;
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -285,7 +285,9 @@ Page({ @@ -285,7 +285,9 @@ Page({
285 285
286 //------初始化加载---------- 286 //------初始化加载----------
287 onLoad: function (t) { 287 onLoad: function (t) {
288 - 288 + if(!getApp().is_Single_page()){
  289 + return false;
  290 + }
289 // console.log('onload'); 291 // console.log('onload');
290 if(t && t.group_id) { 292 if(t && t.group_id) {
291 this.data.group_id = t.group_id; 293 this.data.group_id = t.group_id;
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -252,6 +252,9 @@ Page({ @@ -252,6 +252,9 @@ Page({
252 252
253 //------初始化加载---------- 253 //------初始化加载----------
254 onLoad: function (t) { 254 onLoad: function (t) {
  255 + if(!getApp().is_Single_page()){
  256 + return false;
  257 + }
255 var ee = this, that = ee, th = ee, 258 var ee = this, that = ee, th = ee,
256 pre_id = t.pre_id, 259 pre_id = t.pre_id,
257 gid = t.goods_id, 260 gid = t.goods_id,
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -252,6 +252,9 @@ Page({ @@ -252,6 +252,9 @@ Page({
252 252
253 //------初始化加载---------- 253 //------初始化加载----------
254 onLoad: function (t) { 254 onLoad: function (t) {
  255 + if(!getApp().is_Single_page()){
  256 + return false;
  257 + }
255 var ee = this, that = ee, th = ee, 258 var ee = this, that = ee, th = ee,
256 pre_id = t.pre_id, 259 pre_id = t.pre_id,
257 gid = t.goods_id, 260 gid = t.goods_id,
packageD/pages/AI-test-skin/analyse/analyse.js
@@ -4,6 +4,7 @@ const request = app.request; @@ -4,6 +4,7 @@ const request = app.request;
4 const os = app.globalData; 4 const os = app.globalData;
5 const setting = os.setting; 5 const setting = os.setting;
6 const ut = require('../../../../utils/util'); 6 const ut = require('../../../../utils/util');
  7 +import { pluginGD } from '../../../ai_config/config'
7 Page({ 8 Page({
8 9
9 /** 10 /**
@@ -11,171 +12,174 @@ Page({ @@ -11,171 +12,174 @@ Page({
11 */ 12 */
12 data: { 13 data: {
13 iurl: setting.imghost, 14 iurl: setting.imghost,
14 - per:0,  
15 - timer:0,  
16 - img:null,  
17 - sourceimg:null,  
18 - err_map:null, 15 + per: 0,
  16 + timer: 0,
  17 + img: null,
  18 + sourceimg: null,
  19 + err_map: null,
19 }, 20 },
20 21
21 /** 22 /**
22 * 生命周期函数--监听页面加载 23 * 生命周期函数--监听页面加载
23 */ 24 */
24 onLoad: function (options) { 25 onLoad: function (options) {
25 - var th=this;  
26 - //设置错误码分析  
27 - this.set_err_map();  
28 - //进度条加载  
29 - this.timer();  
30 - //接口开始分析  
31 - setTimeout(function () {  
32 - //th.analysis_img();  
33 - //先检验一下图片  
34 - th.img_check(function () {  
35 -  
36 - });  
37 - },800) 26 + //初始化美图测肤插件
  27 + var plugin = requirePlugin('mtSkinSdk')
  28 + plugin.setConfig(pluginGD)
  29 + var th = this;
  30 + //设置错误码分析
  31 + this.set_err_map();
  32 + //进度条加载
  33 + this.timer();
  34 + //接口开始分析
  35 + setTimeout(function () {
  36 + //th.analysis_img();
  37 + //先检验一下图片
  38 + th.mt_check(function () {
  39 +
  40 + });
  41 + }, 800)
38 42
39 }, 43 },
40 //定时器 44 //定时器
41 - timer:function (func) {  
42 - var per=this.data.per+5;  
43 - var th=this;  
44 - if(per<96){  
45 - th.setData({per:per});  
46 - setTimeout(function () {  
47 - th.timer();  
48 - },400)  
49 - } 45 + timer: function (func) {
  46 + var per = this.data.per + 5;
  47 + var th = this;
  48 + if (per < 96) {
  49 + th.setData({ per: per });
  50 + setTimeout(function () {
  51 + th.timer();
  52 + }, 400)
  53 + }
50 }, 54 },
51 55
52 //错误码表 56 //错误码表
53 - set_err_map:function () {  
54 - var map={  
55 - "2":"服务暂不可用",  
56 - "4":"集群超限额",  
57 - "6":"没有接口权限",  
58 - "17":"每天流量超限额",  
59 - "18":"QPS超限额",  
60 - "19":"请求总量超限额",  
61 - "100":"无效的access_token参数",  
62 - "110":"Access Token失效",  
63 - "111":" Access token过期",  
64 - "222001":"必要参数未传入",  
65 - "222002":"参数格式错误",  
66 - "222003":"参数格式错误",  
67 - "222004":"参数格式错误",  
68 - "222005":"参数格式错误",  
69 - "222006":"参数格式错误",  
70 - "222007":"参数格式错误",  
71 - "222008":"参数格式错误",  
72 - "222009":"参数格式错误",  
73 - "222010":"参数格式错误",  
74 - "222011":"参数格式错误",  
75 - "222012":"参数格式错误",  
76 - "222013":"参数格式错误",  
77 - "222014":"参数格式错误",  
78 - "222015":"参数格式错误",  
79 - "222016":"参数格式错误",  
80 - "222017":"参数格式错误",  
81 - "222018":"参数格式错误",  
82 - "222019":"参数格式错误",  
83 - "222020":"参数格式错误",  
84 - "222021":"参数格式错误",  
85 - "222022":"身份证号不符合要求,备注:中国大陆身份证号的每一位数字都有其生成规则,不可随意填写。",  
86 - "222023":"参数格式错误",  
87 - "222024":"参数格式错误",  
88 - "222025":"参数格式错误",  
89 - "222026":"参数格式错误",  
90 - "222027":"验证码长度错误(最小值大于最大值)",  
91 - "222028":"参数格式错误",  
92 - "222029":"参数格式错误",  
93 - "222030":"参数格式错误",  
94 - "222039":"参数格式错误",  
95 - "222200":"该接口需使用application/json的格式进行请求",  
96 - "222201":"服务端请求失败",  
97 - "222202":"图片中没有人脸",  
98 - "222203":"无法解析人脸",  
99 - "222204":"从图片的url下载图片失败",  
100 - "222205":"服务端请求失败",  
101 - "222206":"服务端请求失败",  
102 - "222207":"未找到匹配的用户",  
103 - "222208":"图片的数量错误",  
104 - "222209":"face token不存在",  
105 - "222210":"人脸库中用户下的人脸数目超过限制",  
106 - "222300":"人脸图片添加失败",  
107 - "222301":"获取人脸图片失败",  
108 - "222302":"服务端请求失败",  
109 - "222303":"获取人脸图片失败",  
110 - "222152":"人脸属性编辑,target参数错误",  
111 - "222514":"人脸属性编辑v2调用服务失败,请重试",  
112 - "223100":"操作的用户组不存在",  
113 - "223101":"该用户组已存在",  
114 - "223102":"找不到该用户",  
115 - "223103":"找不到该用户",  
116 - "223104":"group_list包含组数量过多",  
117 - "223105":"该人脸已存在",  
118 - "223106":"该人脸不存在",  
119 - "223107":"人脸库中人脸复制时源组与目标组的scene_type不同",  
120 - "223110":"uid_list包含数量过多",  
121 - "223111":"目标用户组不存在",  
122 - "223112":"quality_conf格式不正确",  
123 - "223113":"人脸有被遮挡",  
124 - "223114":"人脸模糊",  
125 - "223115":"人脸光照不好",  
126 - "223116":"人脸不完整",  
127 - "223117":"app_list包含app数量过多",  
128 - "223118":"质量控制项错误",  
129 - "223119":"活体控制项错误",  
130 - "223120":"活体检测未通过",  
131 - "223121":"质量检测未通过 左眼遮挡程度过高",  
132 - "223122":"质量检测未通过 右眼遮挡程度过高",  
133 - "223123":"质量检测未通过 左脸遮挡程度过高",  
134 - "223124":"质量检测未通过 右脸遮挡程度过高",  
135 - "223125":"质量检测未通过 下巴遮挡程度过高",  
136 - "223126":"质量检测未通过 鼻子遮挡程度过高",  
137 - "223127":"质量检测未通过 嘴巴遮挡程度过高",  
138 - "222901":"参数校验初始化失败",  
139 - "222902":"参数校验初始化失败",  
140 - "222903":"参数校验初始化失败",  
141 - "222904":"参数校验初始化失败",  
142 - "222905":"接口初始化失败",  
143 - "222906":"接口初始化失败",  
144 - "222907":"缓存处理失败",  
145 - "222908":"缓存处理失败",  
146 - "222909":"缓存处理失败",  
147 - "222910":"数据存储处理失败",  
148 - "222911":"数据存储处理失败",  
149 - "222912":"数据存储处理失败",  
150 - "222913":"接口初始化失败",  
151 - "222914":"接口初始化失败",  
152 - "222915":"后端服务连接失败",  
153 - "222916":"后端服务连接失败",  
154 - "222304":"图片尺寸太大",  
155 - "222305":"当前版本不支持图片存储",  
156 - "223128":"正在清理该用户组的数据",  
157 - "223136":"该组内存在关联图片,无法新建相同名称组",  
158 - "222361":"公安服务连接失败",  
159 - "222046":"参数格式错误",  
160 - "222101":"参数格式错误",  
161 - "222102":"参数格式错误",  
162 - "222307":"图片非法 鉴黄未通过",  
163 - "222308":"图片非法 含有政治敏感人物",  
164 - "222211":"人脸融合失败 模板图质量不合格",  
165 - "222212":"人脸融合失败",  
166 - "223129":"人脸未面向正前方(人脸的角度信息大于30度)",  
167 - "223130":"spoofing_control参数格式错误",  
168 - "223131":"合成图检测未通过",  
169 - "223201":"请求参数scene_type 格式错误",  
170 - "223202":"识别时请求的scene_type与group设置的scene_type不匹配",  
171 - }  
172 - this.setData({err_map:map}); 57 + set_err_map: function () {
  58 + var map = {
  59 + "2": "服务暂不可用",
  60 + "4": "集群超限额",
  61 + "6": "没有接口权限",
  62 + "17": "每天流量超限额",
  63 + "18": "QPS超限额",
  64 + "19": "请求总量超限额",
  65 + "100": "无效的access_token参数",
  66 + "110": "Access Token失效",
  67 + "111": " Access token过期",
  68 + "222001": "必要参数未传入",
  69 + "222002": "参数格式错误",
  70 + "222003": "参数格式错误",
  71 + "222004": "参数格式错误",
  72 + "222005": "参数格式错误",
  73 + "222006": "参数格式错误",
  74 + "222007": "参数格式错误",
  75 + "222008": "参数格式错误",
  76 + "222009": "参数格式错误",
  77 + "222010": "参数格式错误",
  78 + "222011": "参数格式错误",
  79 + "222012": "参数格式错误",
  80 + "222013": "参数格式错误",
  81 + "222014": "参数格式错误",
  82 + "222015": "参数格式错误",
  83 + "222016": "参数格式错误",
  84 + "222017": "参数格式错误",
  85 + "222018": "参数格式错误",
  86 + "222019": "参数格式错误",
  87 + "222020": "参数格式错误",
  88 + "222021": "参数格式错误",
  89 + "222022": "身份证号不符合要求,备注:中国大陆身份证号的每一位数字都有其生成规则,不可随意填写。",
  90 + "222023": "参数格式错误",
  91 + "222024": "参数格式错误",
  92 + "222025": "参数格式错误",
  93 + "222026": "参数格式错误",
  94 + "222027": "验证码长度错误(最小值大于最大值)",
  95 + "222028": "参数格式错误",
  96 + "222029": "参数格式错误",
  97 + "222030": "参数格式错误",
  98 + "222039": "参数格式错误",
  99 + "222200": "该接口需使用application/json的格式进行请求",
  100 + "222201": "服务端请求失败",
  101 + "222202": "图片中没有人脸",
  102 + "222203": "无法解析人脸",
  103 + "222204": "从图片的url下载图片失败",
  104 + "222205": "服务端请求失败",
  105 + "222206": "服务端请求失败",
  106 + "222207": "未找到匹配的用户",
  107 + "222208": "图片的数量错误",
  108 + "222209": "face token不存在",
  109 + "222210": "人脸库中用户下的人脸数目超过限制",
  110 + "222300": "人脸图片添加失败",
  111 + "222301": "获取人脸图片失败",
  112 + "222302": "服务端请求失败",
  113 + "222303": "获取人脸图片失败",
  114 + "222152": "人脸属性编辑,target参数错误",
  115 + "222514": "人脸属性编辑v2调用服务失败,请重试",
  116 + "223100": "操作的用户组不存在",
  117 + "223101": "该用户组已存在",
  118 + "223102": "找不到该用户",
  119 + "223103": "找不到该用户",
  120 + "223104": "group_list包含组数量过多",
  121 + "223105": "该人脸已存在",
  122 + "223106": "该人脸不存在",
  123 + "223107": "人脸库中人脸复制时源组与目标组的scene_type不同",
  124 + "223110": "uid_list包含数量过多",
  125 + "223111": "目标用户组不存在",
  126 + "223112": "quality_conf格式不正确",
  127 + "223113": "人脸有被遮挡",
  128 + "223114": "人脸模糊",
  129 + "223115": "人脸光照不好",
  130 + "223116": "人脸不完整",
  131 + "223117": "app_list包含app数量过多",
  132 + "223118": "质量控制项错误",
  133 + "223119": "活体控制项错误",
  134 + "223120": "活体检测未通过",
  135 + "223121": "质量检测未通过 左眼遮挡程度过高",
  136 + "223122": "质量检测未通过 右眼遮挡程度过高",
  137 + "223123": "质量检测未通过 左脸遮挡程度过高",
  138 + "223124": "质量检测未通过 右脸遮挡程度过高",
  139 + "223125": "质量检测未通过 下巴遮挡程度过高",
  140 + "223126": "质量检测未通过 鼻子遮挡程度过高",
  141 + "223127": "质量检测未通过 嘴巴遮挡程度过高",
  142 + "222901": "参数校验初始化失败",
  143 + "222902": "参数校验初始化失败",
  144 + "222903": "参数校验初始化失败",
  145 + "222904": "参数校验初始化失败",
  146 + "222905": "接口初始化失败",
  147 + "222906": "接口初始化失败",
  148 + "222907": "缓存处理失败",
  149 + "222908": "缓存处理失败",
  150 + "222909": "缓存处理失败",
  151 + "222910": "数据存储处理失败",
  152 + "222911": "数据存储处理失败",
  153 + "222912": "数据存储处理失败",
  154 + "222913": "接口初始化失败",
  155 + "222914": "接口初始化失败",
  156 + "222915": "后端服务连接失败",
  157 + "222916": "后端服务连接失败",
  158 + "222304": "图片尺寸太大",
  159 + "222305": "当前版本不支持图片存储",
  160 + "223128": "正在清理该用户组的数据",
  161 + "223136": "该组内存在关联图片,无法新建相同名称组",
  162 + "222361": "公安服务连接失败",
  163 + "222046": "参数格式错误",
  164 + "222101": "参数格式错误",
  165 + "222102": "参数格式错误",
  166 + "222307": "图片非法 鉴黄未通过",
  167 + "222308": "图片非法 含有政治敏感人物",
  168 + "222211": "人脸融合失败 模板图质量不合格",
  169 + "222212": "人脸融合失败",
  170 + "223129": "人脸未面向正前方(人脸的角度信息大于30度)",
  171 + "223130": "spoofing_control参数格式错误",
  172 + "223131": "合成图检测未通过",
  173 + "223201": "请求参数scene_type 格式错误",
  174 + "223202": "识别时请求的scene_type与group设置的scene_type不匹配",
  175 + }
  176 + this.setData({ err_map: map });
173 }, 177 },
174 178
175 /** 179 /**
176 * 生命周期函数--监听页面显示 180 * 生命周期函数--监听页面显示
177 */ 181 */
178 - onShow: function (){ }, 182 + onShow: function () { },
179 183
180 /** 184 /**
181 * 生命周期函数--监听页面隐藏 185 * 生命周期函数--监听页面隐藏
@@ -199,159 +203,317 @@ Page({ @@ -199,159 +203,317 @@ Page({
199 203
200 }, 204 },
201 205
  206 + mt_check() {
  207 + let img_info = getApp().globalData.skin_img_info;
  208 + var plugin = requirePlugin('mtSkinSdk');
  209 + let th = this;
  210 + plugin.facePoseCorrect({
  211 + path: img_info['path'],
  212 + size: img_info['size'],
  213 + success(res) {
  214 + console.log('=========姿态校正 成功==========')
  215 + console.log('姿态校正结果', res)
  216 + let analyse_info = res.data;
  217 + //检查闭眼情况
  218 + if (analyse_info.analyse_info) {
  219 + //检查睁眼闭眼
  220 + let { left, right } = analyse_info.analyse_info;
  221 + if (left !== 2 || right !== 2) {
  222 + var msg = "未闭眼拍照";
  223 + th.go_error(msg);
  224 + return false;
  225 + }
  226 + }
  227 + //检查佩戴情况
  228 + if (analyse_info.faceGlasses) {
  229 + let { none, normal, sunglasses } = analyse_info.faceGlasses;
  230 + if (normal > 0.8 || sunglasses > 0.8 || none < 0.1) {
  231 + var msg = "有佩戴眼镜";
  232 + th.go_error(msg);
  233 + return false;
  234 + }
  235 + }
  236 + //检查框里情况
  237 + if (analyse_info.faceOutDetect.outBound == 1) {
  238 + var msg = "未在取景框内";
  239 + th.go_error(msg);
  240 + return false;
  241 + }
  242 + // if (analyse_info.facePoseEuler) {
  243 + // let { pitch, roll, yaw } = analyse_info.facePoseEuler;
  244 + // if (normal > 0.8 || sunglasses > 0.8 || none < 0.1) {
  245 + // var msg = "有佩戴眼镜";
  246 + // th.go_error(msg);
  247 + // return false;
  248 + // }
  249 + // }
  250 + //检查环境情况
  251 + if (analyse_info.faceQuality) {
  252 + let { bright, blur, compression } = analyse_info.faceQuality;
  253 + if (bright > 80) {
  254 + var msg = "亮度过亮";
  255 + th.go_error(msg);
  256 + return false;
  257 + }
  258 + if (bright < 20 || blur < 20) {
  259 + var msg = "亮度过暗或图片过于模糊";
  260 + th.go_error(msg);
  261 + return false;
  262 + }
  263 + }
  264 + //检查距离
  265 + if (analyse_info.faceRatio < 0.2) {
  266 + var msg = "距离过远";
  267 + th.go_error(msg);
  268 + return false;
  269 + }
  270 + if (analyse_info.faceRatio > 0.8) {
  271 + var msg = "距离过近";
  272 + th.go_error(msg);
  273 + return false;
  274 + }
  275 + //检查遮挡物
  276 + if (analyse_info.faceVisibility) {
  277 + var msg = "";
  278 + let fail = Object.keys(analyse_info.faceVisibility).filter(key => {
  279 + return analyse_info.faceVisibility[key] <= 80;
  280 + })
  281 + console.log('fail', fail);
  282 + switch (fail[0]) {
  283 + case "jaw":
  284 + msg = "下巴有遮挡";
  285 + break;
  286 + case "leftcheek":
  287 + msg = "左脸有遮挡";
  288 + break;
  289 + case "lefteye":
  290 + msg = "左眼有遮挡";
  291 + break;
  292 + case "lefteyebrow":
  293 + msg = "左眉毛有遮挡";
  294 + break;
  295 + case "mouse":
  296 + msg = "嘴巴有遮挡";
  297 + break;
  298 + case "nose":
  299 + msg = "鼻子有遮挡";
  300 + break;
  301 + case "rightcheek":
  302 + msg = "右脸有遮挡";
  303 + break;
  304 + case "righteye":
  305 + msg = "右眼有遮挡";
  306 + break;
  307 + case "rightyebrow":
  308 + msg = "右眉毛有遮挡";
  309 + break;
  310 + }
  311 + if (msg) {
  312 + th.go_error(msg);
  313 + return false;
  314 + }
  315 + }
  316 + th.analyse_by_mtapi(img_info);
  317 + },
  318 + fail(err) {
  319 + th.go_error('识别有误,请重试');
  320 + return false;
  321 + }
  322 + })
  323 +
  324 + },
  325 +
  326 + analyse_by_mtapi(img_info) {
  327 + // let img_info = getApp().globalData.skin_img_info;
  328 + let th = this;
  329 + var plugin = requirePlugin('mtSkinSdk')
  330 + plugin.detectImage({
  331 + path: img_info['path'],
  332 + size: img_info['size'],
  333 + success(res) {
  334 + console.log('=========用户传图片链接获取检测结果 成功==========')
  335 + console.log('检测结果', res);
  336 + let req_data = {
  337 + store_id: setting.stoid,
  338 + user_id: getApp().globalData.user_id,
  339 + img: getApp().globalData.face_img,
  340 + sourceimg: getApp().globalData.face_SourceImg,
  341 + addtime: ut.gettimestamp(),
  342 + resultjson: JSON.stringify(res.data.data),
  343 + detectjson: JSON.stringify(th.data.check_data)
  344 + }
  345 + //要保存一下分析的结果
  346 + th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) {
  347 + if (res.data.code == 0) {
  348 + let url = "/packageD/pages/AI-test-skin/success_result/success_result?id=" + res.data.data.id; //跳到分析页
  349 + wx.redirectTo({
  350 + url: url
  351 + })
  352 + } else {
  353 + getApp().showWarning("保存失败");
  354 + }
  355 + })
  356 + },
  357 + fail(err) {
  358 + console.error('=========用户传图片链接获取检测结果 失败==========')
  359 + console.log('error', err)
  360 + }
  361 + })
  362 + },
  363 +
202 //检查图片有没有OK 364 //检查图片有没有OK
203 - img_check:function (func) {  
204 - var th=this;  
205 - var data={ 365 + img_check: function (func) {
  366 + var th = this;
  367 + var data = {
206 "appid": "25521854", 368 "appid": "25521854",
207 "image": getApp().globalData.face_SourceImg, 369 "image": getApp().globalData.face_SourceImg,
208 "face_field": "age,expression,face_shape,gender,glasses,landmark,landmark150,quality,eye_status,emotion,face_type,mask,spoofing", 370 "face_field": "age,expression,face_shape,gender,glasses,landmark,landmark150,quality,eye_status,emotion,face_type,mask,spoofing",
209 "image_type": "URL" 371 "image_type": "URL"
210 } 372 }
211 //开始调用接口,进行对图片进行判断是否符合标准 373 //开始调用接口,进行对图片进行判断是否符合标准
212 - this.json_post("/api/weshop/baidubce/face/skindetect",data,function (res) {  
213 - if(res.data.code==0){ 374 + this.json_post("/api/weshop/baidubce/face/skindetect", data, function (res) {
  375 + if (res.data.code == 0) {
214 //检查的字段存储 376 //检查的字段存储
215 - var check_data=th.data.check_data=res.data.data;  
216 - check_data=check_data.face_list[0]; 377 + var check_data = th.data.check_data = res.data.data;
  378 + check_data = check_data.face_list[0];
217 console.log(check_data); 379 console.log(check_data);
218 //检查睁眼闭眼 380 //检查睁眼闭眼
219 - var eye_status=check_data.eye_status;  
220 - if(eye_status.left_eye>0.1 || eye_status.right_eye>0.1) {  
221 - var msg="未闭眼拍照"; 381 + var eye_status = check_data.eye_status;
  382 + if (eye_status.left_eye > 0.1 || eye_status.right_eye > 0.1) {
  383 + var msg = "未闭眼拍照";
222 th.go_error(msg); 384 th.go_error(msg);
223 return false; 385 return false;
224 } 386 }
225 //检查是不是有带眼镜 387 //检查是不是有带眼镜
226 - if(check_data.glasses.type!='none'){  
227 - var msg="有佩戴眼镜"; 388 + if (check_data.glasses.type != 'none') {
  389 + var msg = "有佩戴眼镜";
228 th.go_error(msg); 390 th.go_error(msg);
229 return false; 391 return false;
230 } 392 }
231 //检查头部的角度 393 //检查头部的角度
232 - var angle=check_data.angle;  
233 - if(Math.abs(angle.Pitch)>20) {  
234 - var msg="头部的俯仰角度过大"; 394 + var angle = check_data.angle;
  395 + if (Math.abs(angle.Pitch) > 20) {
  396 + var msg = "头部的俯仰角度过大";
235 th.go_error(msg); 397 th.go_error(msg);
236 return false; 398 return false;
237 } 399 }
238 - if(Math.abs(angle.Roll)>20) {  
239 - var msg="头部的平面角度过大"; 400 + if (Math.abs(angle.Roll) > 20) {
  401 + var msg = "头部的平面角度过大";
240 th.go_error(msg); 402 th.go_error(msg);
241 return false; 403 return false;
242 } 404 }
243 - if(Math.abs(angle.Yaw)>20) {  
244 - var msg="头部的左右角度过大"; 405 + if (Math.abs(angle.Yaw) > 20) {
  406 + var msg = "头部的左右角度过大";
245 th.go_error(msg); 407 th.go_error(msg);
246 return false; 408 return false;
247 } 409 }
248 - var quality=check_data.quality;  
249 - if(quality.blur>0.7){  
250 - var msg="图片模糊"; 410 + var quality = check_data.quality;
  411 + if (quality.blur > 0.7) {
  412 + var msg = "图片模糊";
251 th.go_error(msg); 413 th.go_error(msg);
252 return false; 414 return false;
253 } 415 }
254 //开始检查遮挡 416 //开始检查遮挡
255 - var occlusion=check_data.quality.occlusion;  
256 - if(occlusion.left_eye >0.6){  
257 - var msg="左眼被遮挡"; 417 + var occlusion = check_data.quality.occlusion;
  418 + if (occlusion.left_eye > 0.6) {
  419 + var msg = "左眼被遮挡";
258 th.go_error(msg); 420 th.go_error(msg);
259 return false; 421 return false;
260 } 422 }
261 - if(occlusion.right_eye>0.6){  
262 - var msg="右眼被遮挡"; 423 + if (occlusion.right_eye > 0.6) {
  424 + var msg = "右眼被遮挡";
263 th.go_error(msg); 425 th.go_error(msg);
264 return false; 426 return false;
265 } 427 }
266 - if(occlusion.nose>0.7){  
267 - var msg="鼻子被遮挡"; 428 + if (occlusion.nose > 0.7) {
  429 + var msg = "鼻子被遮挡";
268 th.go_error(msg); 430 th.go_error(msg);
269 return false; 431 return false;
270 } 432 }
271 - if(occlusion.mouth>0.7){  
272 - var msg="嘴巴被遮挡"; 433 + if (occlusion.mouth > 0.7) {
  434 + var msg = "嘴巴被遮挡";
273 th.go_error(msg); 435 th.go_error(msg);
274 return false; 436 return false;
275 } 437 }
276 - if(occlusion.left_cheek >0.8){  
277 - var msg="左脸颊被遮挡"; 438 + if (occlusion.left_cheek > 0.8) {
  439 + var msg = "左脸颊被遮挡";
278 th.go_error(msg); 440 th.go_error(msg);
279 return false; 441 return false;
280 } 442 }
281 - if(occlusion.right_cheek >0.8){  
282 - var msg="右脸颊被遮挡"; 443 + if (occlusion.right_cheek > 0.8) {
  444 + var msg = "右脸颊被遮挡";
283 th.go_error(msg); 445 th.go_error(msg);
284 return false; 446 return false;
285 } 447 }
286 - if(occlusion.chin_contour >0.6){  
287 - var msg="下巴颊被遮挡"; 448 + if (occlusion.chin_contour > 0.6) {
  449 + var msg = "下巴颊被遮挡";
288 th.go_error(msg); 450 th.go_error(msg);
289 return false; 451 return false;
290 } 452 }
291 - if(quality.illumination<40){  
292 - var msg="图像光照不足"; 453 + if (quality.illumination < 40) {
  454 + var msg = "图像光照不足";
293 th.go_error(msg); 455 th.go_error(msg);
294 return false; 456 return false;
295 } 457 }
296 - if(quality.completeness=0){  
297 - var msg="人脸未显示完整"; 458 + if (quality.completeness = 0) {
  459 + var msg = "人脸未显示完整";
298 th.go_error(msg); 460 th.go_error(msg);
299 return false; 461 return false;
300 } 462 }
301 //-- 开始调用分析的接口 -- 463 //-- 开始调用分析的接口 --
302 - var face_token=check_data.face_token;  
303 - var data={ 464 + var face_token = check_data.face_token;
  465 + var data = {
304 "image": face_token, 466 "image": face_token,
305 "face_field": "color,smooth,acnespotmole,wrinkle,eyesattr,blackheadpore,skinface,skinquality", 467 "face_field": "color,smooth,acnespotmole,wrinkle,eyesattr,blackheadpore,skinface,skinquality",
306 "image_type": "FACE_TOKEN" 468 "image_type": "FACE_TOKEN"
307 } 469 }
308 th.analysis_img(data); 470 th.analysis_img(data);
309 - }else{  
310 - var msg=th.data.err_map[res.data.code+""]; 471 + } else {
  472 + var msg = th.data.err_map[res.data.code + ""];
311 th.go_error(msg); 473 th.go_error(msg);
312 } 474 }
313 }) 475 })
314 }, 476 },
315 - 477 +
316 //跳转到错误页面 478 //跳转到错误页面
317 - go_error:function (msg) {  
318 - let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg="+msg; //跳到分析页 479 + go_error: function (msg) {
  480 + let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页
319 wx.redirectTo({ 481 wx.redirectTo({
320 url: url 482 url: url
321 }); 483 });
322 }, 484 },
323 485
324 - analysis_img:function (data) {  
325 - var th=this; 486 + analysis_img: function (data) {
  487 + var th = this;
326 //开始调用接口,进行分析 488 //开始调用接口,进行分析
327 - this.json_post("/api/weshop/baidubce/face/skinAnalyze",data,function (res) {  
328 - if(res.data.code==0){  
329 - getApp().globalData.face_result=res.data.data;  
330 - var req_data={  
331 - store_id:setting.stoid,  
332 - user_id:getApp().globalData.user_id,  
333 - img:getApp().globalData.face_img,  
334 - sourceimg:getApp().globalData.face_SourceImg,  
335 - addtime:ut.gettimestamp(),  
336 - resultjson:JSON.stringify(res.data.data),  
337 - detectjson:JSON.stringify(th.data.check_data) 489 + this.json_post("/api/weshop/baidubce/face/skinAnalyze", data, function (res) {
  490 + if (res.data.code == 0) {
  491 + getApp().globalData.face_result = res.data.data;
  492 + var req_data = {
  493 + store_id: setting.stoid,
  494 + user_id: getApp().globalData.user_id,
  495 + img: getApp().globalData.face_img,
  496 + sourceimg: getApp().globalData.face_SourceImg,
  497 + addtime: ut.gettimestamp(),
  498 + resultjson: JSON.stringify(res.data.data),
  499 + detectjson: JSON.stringify(th.data.check_data)
338 } 500 }
339 //要保存一下分析的结果 501 //要保存一下分析的结果
340 - th.json_post("/api/weshop/face/storeSkinface/save",req_data,function (res) {  
341 - if(res.data.code==0){  
342 - let url = "/packageD/pages/AI-test-skin/success_result/success_result?id="+res.data.data.id; //跳到分析页 502 + th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) {
  503 + if (res.data.code == 0) {
  504 + let url = "/packageD/pages/AI-test-skin/success_result/success_result?id=" + res.data.data.id; //跳到分析页
343 wx.redirectTo({ 505 wx.redirectTo({
344 url: url 506 url: url
345 }) 507 })
346 - }else{ 508 + } else {
347 getApp().showWarning("保存失败"); 509 getApp().showWarning("保存失败");
348 } 510 }
349 }) 511 })
350 - }else{  
351 - var msg=th.data.err_map[res.data.code+""];  
352 - let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg="+msg; //跳到分析页 512 + } else {
  513 + var msg = th.data.err_map[res.data.code + ""];
  514 + let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页
353 wx.redirectTo({ 515 wx.redirectTo({
354 - url: url 516 + url: url
355 }) 517 })
356 } 518 }
357 }) 519 })
@@ -363,10 +525,10 @@ Page({ @@ -363,10 +525,10 @@ Page({
363 * @param {Object} succ //成功的回调 525 * @param {Object} succ //成功的回调
364 * @param {Object} fail //失败的回调 526 * @param {Object} fail //失败的回调
365 */ 527 */
366 - json_post:function(url,data,succ,fail,mathod){  
367 - var Mathod="POST"; 528 + json_post: function (url, data, succ, fail, mathod) {
  529 + var Mathod = "POST";
368 if (mathod) Mathod = mathod; 530 if (mathod) Mathod = mathod;
369 - if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; 531 + if (url.indexOf("http") == -1) url = getApp().globalData.setting.url + url;
370 var str = JSON.stringify(data); 532 var str = JSON.stringify(data);
371 wx.request({ 533 wx.request({
372 url: url, 534 url: url,
@@ -375,8 +537,8 @@ Page({ @@ -375,8 +537,8 @@ Page({
375 header: { 537 header: {
376 'content-type': 'application/json' 538 'content-type': 'application/json'
377 },// 设置请求的 header 539 },// 设置请求的 header
378 - success: function (res) {succ(res); },  
379 - fail:function(res){fail(res);} 540 + success: function (res) { succ(res); },
  541 + fail: function (res) { fail(res); }
380 }) 542 })
381 }, 543 },
382 544
pages/activity/pind_list/pind_list.js
@@ -22,6 +22,9 @@ Page({ @@ -22,6 +22,9 @@ Page({
22 22
23 //------初始化加载---------- 23 //------初始化加载----------
24 onLoad: function (t) { 24 onLoad: function (t) {
  25 + if(!getApp().is_Single_page()){
  26 + return false;
  27 + }
25 wx.setNavigationBarTitle({ 28 wx.setNavigationBarTitle({
26 title: "天天拼单", 29 title: "天天拼单",
27 }) 30 })
pages/activity/seckill_list/seckill_list.js
@@ -21,6 +21,9 @@ Page({ @@ -21,6 +21,9 @@ Page({
21 21
22 //------初始化加载---------- 22 //------初始化加载----------
23 onLoad: function (t) { 23 onLoad: function (t) {
  24 + if(!getApp().is_Single_page()){
  25 + return false;
  26 + }
24 wx.setNavigationBarTitle({ 27 wx.setNavigationBarTitle({
25 title: "商品秒杀", 28 title: "商品秒杀",
26 }) 29 })
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -29,6 +29,9 @@ Page({ @@ -29,6 +29,9 @@ Page({
29 first_leader: e.globalData.first_leader || 0, // 推荐人ID 29 first_leader: e.globalData.first_leader || 0, // 推荐人ID
30 }, 30 },
31 onLoad: function (options) { 31 onLoad: function (options) {
  32 + if(!getApp().is_Single_page()){
  33 + return false;
  34 + }
32 var th = this; 35 var th = this;
33 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 36 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
34 my_confirm.open_cancel(0); 37 my_confirm.open_cancel(0);
pages/giftpack/giftpacklist/giftpacklist.js
@@ -32,6 +32,9 @@ Page({ @@ -32,6 +32,9 @@ Page({
32 first_leader: e.globalData.first_leader || 0, // 推荐人ID 32 first_leader: e.globalData.first_leader || 0, // 推荐人ID
33 }, 33 },
34 onLoad: function (options) { 34 onLoad: function (options) {
  35 + if(!getApp().is_Single_page()){
  36 + return false;
  37 + }
35 var th = this; 38 var th = this;
36 th.setData({ 39 th.setData({
37 isBuy: options.isBuy, 40 isBuy: options.isBuy,
@@ -40,7 +43,7 @@ Page({ @@ -40,7 +43,7 @@ Page({
40 getUserID: d.user_id, 43 getUserID: d.user_id,
41 }) 44 })
42 45
43 - if(options.lbId) th.data.lbId=options.lbId; 46 + if (options.lbId) th.data.lbId = options.lbId;
44 //-- 获取分享人的ID -- 47 //-- 获取分享人的ID --
45 var first_leader = options.first_leader || getApp().globalData.first_leader; 48 var first_leader = options.first_leader || getApp().globalData.first_leader;
46 if (first_leader) { 49 if (first_leader) {
@@ -62,6 +65,10 @@ Page({ @@ -62,6 +65,10 @@ Page({
62 onShow: function () { 65 onShow: function () {
63 //--先判断会员状态-- 66 //--先判断会员状态--
64 var user_info = getApp().globalData.userInfo; 67 var user_info = getApp().globalData.userInfo;
  68 +
  69 + if(!getApp().is_Single_page()){
  70 + return false;
  71 + }
65 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 72 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
66 getApp().goto('/pages/togoin/togoin'); 73 getApp().goto('/pages/togoin/togoin');
67 return false; 74 return false;
@@ -415,13 +422,13 @@ Page({ @@ -415,13 +422,13 @@ Page({
415 if (pagePath.indexOf('/') != 0) { 422 if (pagePath.indexOf('/') != 0) {
416 pagePath = '/' + pagePath; 423 pagePath = '/' + pagePath;
417 } 424 }
418 - pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader="+ this.data.getUserID; 425 + pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader=" + this.data.getUserID;
419 // if (this.data.isBuy == 0) { 426 // if (this.data.isBuy == 0) {
420 // pagePath += "&orderSn=" + this.data.orderSn; 427 // pagePath += "&orderSn=" + this.data.orderSn;
421 // } else { 428 // } else {
422 // pagePath += "&lbId=" + this.data.getGiftID; 429 // pagePath += "&lbId=" + this.data.getGiftID;
423 // } 430 // }
424 - // console.log('pagePath', pagePath); 431 + // console.log('pagePath', pagePath);
425 return { 432 return {
426 title: "礼包详情", 433 title: "礼包详情",
427 path: pagePath, 434 path: pagePath,
@@ -437,12 +444,13 @@ Page({ @@ -437,12 +444,13 @@ Page({
437 if (pagePath.indexOf('/') != 0) { 444 if (pagePath.indexOf('/') != 0) {
438 pagePath = '/' + pagePath; 445 pagePath = '/' + pagePath;
439 } 446 }
440 - pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader="+ this.data.getUserID; 447 + pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID;
441 // if (this.data.isBuy == 0) { 448 // if (this.data.isBuy == 0) {
442 // pagePath += "&orderSn=" + this.data.orderSn; 449 // pagePath += "&orderSn=" + this.data.orderSn;
443 // } else { 450 // } else {
444 // pagePath += "&lbId=" + this.data.getGiftID; 451 // pagePath += "&lbId=" + this.data.getGiftID;
445 // } 452 // }
  453 + console.log('pagePath', pagePath);
446 return { 454 return {
447 title: "礼包详情", 455 title: "礼包详情",
448 path: pagePath, 456 path: pagePath,
@@ -496,7 +504,7 @@ Page({ @@ -496,7 +504,7 @@ Page({
496 getApp().my_warnning(res.data.msg, 0, th); 504 getApp().my_warnning(res.data.msg, 0, th);
497 } 505 }
498 }, 506 },
499 - function (res) {} 507 + function (res) { }
500 508
501 ) 509 )
502 }) 510 })
pages/giftpack/mygiftpack/mygiftpack.js
@@ -30,6 +30,9 @@ Page({ @@ -30,6 +30,9 @@ Page({
30 }, 30 },
31 31
32 onLoad: function(options) { 32 onLoad: function(options) {
  33 + if(!getApp().is_Single_page()){
  34 + return false;
  35 + }
33 var th = this; 36 var th = this;
34 th.setData({ 37 th.setData({
35 getStorageID: a.stoid, 38 getStorageID: a.stoid,
pages/goods/categoryList/categoryList.js
@@ -93,6 +93,9 @@ Page({ @@ -93,6 +93,9 @@ Page({
93 93
94 94
95 onLoad: function(tt) { 95 onLoad: function(tt) {
  96 + if(!getApp().is_Single_page()){
  97 + return false;
  98 + }
96 var that = this; 99 var that = this;
97 var first_leader=tt.first_leader; 100 var first_leader=tt.first_leader;
98 if(first_leader){ 101 if(first_leader){
pages/goods/goodsInfo/goodsInfo.js
@@ -255,6 +255,9 @@ Page({ @@ -255,6 +255,9 @@ Page({
255 255
256 //------初始化加载---------- 256 //------初始化加载----------
257 onLoad: function (t) { 257 onLoad: function (t) {
  258 + if(!getApp().is_Single_page()){
  259 + return false;
  260 + }
258 var ee = this, 261 var ee = this,
259 that = ee, 262 that = ee,
260 th = ee, 263 th = ee,
pages/index/index/index.js
@@ -88,7 +88,9 @@ Page({ @@ -88,7 +88,9 @@ Page({
88 }, 88 },
89 89
90 onLoad: async function (tt) { 90 onLoad: async function (tt) {
91 - 91 + if(!getApp().is_Single_page()){
  92 + return false;
  93 + }
92 var th = this; 94 var th = this;
93 var first_leader = tt.first_leader; 95 var first_leader = tt.first_leader;
94 if (!first_leader && tt.scene) { 96 if (!first_leader && tt.scene) {
pages/template/index.js
@@ -15,6 +15,9 @@ Page({ @@ -15,6 +15,9 @@ Page({
15 }, 15 },
16 16
17 onLoad: function(e) { 17 onLoad: function(e) {
  18 + if(!getApp().is_Single_page()){
  19 + return false;
  20 + }
18 var th = this; 21 var th = this;
19 this.data.temp_id=e.scene; 22 this.data.temp_id=e.scene;
20 if(!this.data.temp_id) 23 if(!this.data.temp_id)
pages/user/assistance/assistance.js
@@ -39,7 +39,9 @@ Page({ @@ -39,7 +39,9 @@ Page({
39 * 生命周期函数--监听页面加载 39 * 生命周期函数--监听页面加载
40 */ 40 */
41 onLoad: function(options) { 41 onLoad: function(options) {
42 - 42 + if(!getApp().is_Single_page()){
  43 + return false;
  44 + }
43 var th = this; 45 var th = this;
44 var nav_b = th.selectComponent("#nav_b"); //组件的id 46 var nav_b = th.selectComponent("#nav_b"); //组件的id
45 nav_b.set_name("助力", "/pages/user/assistance/assistance"); 47 nav_b.set_name("助力", "/pages/user/assistance/assistance");