Commit 2ec4b83ac4839be1b7d55c5025ec720c250f390b

Authored by 后端研发-苏明海
2 parents 1bbe59ff a1c7edf8

Merge branch 'dev' into 'test'

Dev

See merge request !972
Showing 136 changed files with 6817 additions and 5320 deletions

Too many changes.

To preserve performance only 100 of 136 files are displayed.

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: null,//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,406 @@ App({ @@ -202,394 +206,406 @@ 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 - } 265 + getConfig2: function (t, o) {
  266 + var e = this;
  267 + if (!e.globalData.setting.stoid) {
  268 + t(null);
  269 + return false;
296 } 270 }
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 - }  
321 - }  
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 + icon: 'error',
  366 + // image: "/images/gt.png",
  367 + complete: function () {
363 "function" == typeof o && setTimeout(o, a); 368 "function" == typeof o && setTimeout(o, a);
364 } 369 }
365 }); 370 });
366 }, 371 },
367 372
368 - confirmBox: function(t, o) { 373 + confirmBox: function (t, o) {
369 wx.showModal({ 374 wx.showModal({
370 title: t, 375 title: t,
371 showCancel: !1, 376 showCancel: !1,
372 - complete: function() { 377 + complete: function () {
373 "function" == typeof o && o(); 378 "function" == typeof o && o();
374 } 379 }
375 }); 380 });
376 }, 381 },
377 382
378 //----------获取所有的门店------------ 383 //----------获取所有的门店------------
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 - }) 384 + get_allsto(func) {
  385 + var th = this;
  386 + if (this.globalData.picklist != null) {
  387 + "function" == typeof func && func(th.globalData.picklist);
  388 + } else {
  389 + th.request.get("/api/weshop/pickup/page", {
  390 + data: { store_id: th.globalData.setting.stoid, pageSize: 600 },
  391 + success: function (da) {
  392 + //设置门店
  393 + //th.setData({ allsto: da.data.data.pageData });
  394 + th.globalData.picklist = da.data.data.pageData;
  395 + "function" == typeof func && func(th.globalData.picklist);
  396 + }
  397 + })
393 } 398 }
394 }, 399 },
395 400
396 //同步化,在调用的时候要await 401 //同步化,在调用的时候要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 - }  
416 - })  
417 - }  
418 - ob.isbuy = isbuy;  
419 - th.globalData.wxapp_buy_obj=ob;  
420 - if(func){  
421 - func();  
422 - } 402 + async get_isbuy(func) {
  403 + var th = this
  404 + var stoid = os.stoid;
  405 +
  406 + await this.promiseGet("/store/storemoduleendtime/page?store_id=" + stoid + "&type=5", {}).then(res => {
  407 + var o = res;
  408 + if (o.data.code == 0) {
  409 + var ob = { isout: 0, isbuy: 1 };
  410 + var arr = o.data.data.pageData;
  411 + var isbuy = 0;
  412 + //----如果数组不为空----
  413 + if (arr.length > 0) {
  414 + arr.forEach(function (val, ind) {
  415 + if (val.is_sy == 0 && val.type == 5) {
  416 + isbuy = 1;
  417 + var now = ut.gettimestamp();
  418 + if (now > val.end_time) ob.isout = 1;
  419 + return false;
  420 + }
  421 + })
  422 + }
  423 + ob.isbuy = isbuy;
  424 + th.globalData.wxapp_buy_obj = ob;
  425 + if (func) {
  426 + func();
  427 + }
  428 + }
  429 + })
  430 + },
  431 + //获取场景值 判断是否是单页面
  432 + is_Single_page(_this,func) {
  433 + let scene = wx.getLaunchOptionsSync().scene;
  434 + //--判断是否是单页面--
  435 + if(scene !== 1154){
  436 + typeof func =="function" && func.bind(_this)();
  437 + }else{
  438 + return false;
423 } 439 }
424 - }) 440 + // return scene == 1154? false:true;
425 }, 441 },
426 442
  443 +
427 //--同步化,在调用的时候要await,获取商家config-- 444 //--同步化,在调用的时候要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 - }) 445 + async getConfig_ays() {
  446 + if (this.globalData.config != null) return false;
  447 + var th = this;
  448 + await api.get_config(this.globalData.setting.stoid).then(res => {
  449 + var o = res;
  450 + if (o.data.code == 0) {
  451 + th.globalData.config = o.data.data;
  452 + }
  453 + })
437 }, 454 },
438 455
439 //----智能跳转,判断 非tabBar,tabBar页面的跳转---- 456 //----智能跳转,判断 非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{ 457 + goto: function (url) {
  458 + var arr = getCurrentPages();
  459 + if (arr.length > 8) {
  460 + arr.splice(0, 2);
  461 + }
  462 + var arr_tabbar = ["/pages/index/index/index",
  463 + "/pages/goods/categoryList/categoryList",
  464 + "/pages/goods/categoryList/categoryList?type=2",
  465 + "/pages/goods/categoryList/categoryList?type=1",
  466 + "/pages/cart/cart/cart", "/pages/user/index/index",
  467 + "/pages/distribution/distribution"];
  468 + if (arr_tabbar.indexOf(url) != -1) {
  469 + if (url.indexOf("categoryList?type=1") != -1) this.globalData.cat_type = 1;
  470 + if (url.indexOf("categoryList?type=2") != -1) this.globalData.cat_type = 2;
  471 + wx.switchTab({ url: url, }) //跳到tabbar页
  472 +
  473 + } else {
457 if (getCurrentPages().length > 9) { 474 if (getCurrentPages().length > 9) {
458 - wx.redirectTo({url: url,}) //跳到非tabbar页  
459 - }else{  
460 - wx.navigateTo({url: url,}) //跳到tabbar页 475 + wx.redirectTo({ url: url, }) //跳到非tabbar页
  476 + } else {
  477 + wx.navigateTo({ url: url, }) //跳到tabbar页
461 } 478 }
462 } 479 }
463 //wx.navigateTo({ url: url, }) //跳到非tabbar页 480 //wx.navigateTo({ url: url, }) //跳到非tabbar页
464 }, 481 },
465 482
466 //显示提示,word提示内容,type 0失败,提示 1成功 483 //显示提示,word提示内容,type 0失败,提示 1成功
467 - my_warnning(word,type,that,width){ 484 + my_warnning(word, type, that, width) {
468 var warn = that.selectComponent("#warn"); //组件的id 485 var warn = that.selectComponent("#warn"); //组件的id
469 - warn.open(word,type,width); 486 + warn.open(word, type, width);
470 return 1; 487 return 1;
471 }, 488 },
472 489
473 //获取会员门店 490 //获取会员门店
474 - get_user_store:function (func)  
475 - {  
476 - var th=this; 491 + get_user_store: function (func) {
  492 + var th = this;
477 this.getConfig2(function (conf) { 493 this.getConfig2(function (conf) {
478 //---空会员的情况--- 494 //---空会员的情况---
479 - if(!th.globalData.userInfo){ 495 + if (!th.globalData.userInfo) {
480 return func(null); 496 return func(null);
481 } 497 }
482 - if(!th.globalData.pk_store){  
483 - var pick_id=0; 498 + if (!th.globalData.pk_store) {
  499 + var pick_id = 0;
484 //先找一个会员是否有设置默认的地址 500 //先找一个会员是否有设置默认的地址
485 - if(th.globalData.userInfo.def_pickup_id){  
486 - pick_id= th.globalData.userInfo.def_pickup_id 501 + if (th.globalData.userInfo.def_pickup_id) {
  502 + pick_id = th.globalData.userInfo.def_pickup_id
487 } 503 }
488 //查找会员的注册的地址 504 //查找会员的注册的地址
489 - else if(th.globalData.userInfo.pickup_id){ 505 + else if (th.globalData.userInfo.pickup_id) {
490 //--购买门店是否默认登记门店-- 506 //--购买门店是否默认登记门店--
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 507 + if (conf.switch_list) {
  508 + var t_swi = JSON.parse(conf.switch_list);
  509 + if (t_swi.is_regstores) {
  510 + pick_id = th.globalData.userInfo.pickup_id
495 } 511 }
496 } 512 }
497 513
498 } 514 }
499 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- 515 //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
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{ 516 + if (pick_id == 0) return func(null);
  517 +
  518 + //返回门店的数量
  519 + th.get_pk_num(function (num) {
  520 + //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭
  521 + th.request.get("/api/weshop/pickup/get/" + os.stoid + "/" + pick_id, {
  522 + data: {},
  523 + success: function (res) {
  524 + th.globalData.pk_store = null;
  525 + if (res.data.code == 0 && res.data.data && res.data.data.isstop == 0 && res.data.data.is_pos == 1) {
  526 +
  527 + //--门店的数量大于10个才要关心门店的分类有没有关闭--
  528 + if (res.data.data.category_id && num > 10) {
  529 + th.request.get("/api/weshop/storagecategory/get/" + os.stoid + "/" + res.data.data.category_id, {
  530 + data: {},
  531 + success: function (ee) {
  532 + if (ee.data.code == 0 && ee.data.data) {
  533 + if (ee.data.data.is_show == 1) {
  534 + th.globalData.pk_store = res.data.data;
  535 + func(th.globalData.pk_store);
  536 + } else {
  537 + //看一下有没有显示的门店分类
  538 + getApp().request.get("/api/weshop/storagecategory/page", {
  539 + data: {
  540 + store_id: os.stoid,
  541 + is_show: 1,
  542 + pageSize: 1,
  543 + },
  544 + success: function (ee) {
  545 + if (ee.data.code == 0) {
  546 + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
  547 + func(null);
  548 + } else {
  549 + th.globalData.pk_store = res.data.data;
  550 + func(th.globalData.pk_store);
  551 + }
  552 + } else {
  553 + th.globalData.pk_store = res.data.data;
  554 + func(th.globalData.pk_store);
  555 + }
  556 + }
  557 + })
  558 + }
  559 + } else {
544 func(null); 560 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{ 561 + }
  562 + }
  563 + })
  564 + } else {
  565 + th.globalData.pk_store = res.data.data;
  566 + func(th.globalData.pk_store);
  567 + }
  568 + } else {
  569 + func(null);
  570 + }
  571 + }
  572 + })
  573 +
  574 + })
  575 +
  576 + } else {
561 func(th.globalData.pk_store); 577 func(th.globalData.pk_store);
562 } 578 }
563 }) 579 })
564 }, 580 },
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 - }, 581 +
  582 + //-- 获取门店的数量 --
  583 + get_pk_num: function (func) {
  584 + this.request.get("/api/weshop/pickup/page", {
  585 + data: { page: 1, pageSize: 1, isstop: 0, store_id: os.stoid },
  586 + success: function (res) {
  587 + if (res.data.code == 0) {
  588 + func(res.data.data.total); //门店数量
  589 + }
  590 + }
  591 + });
  592 + },
577 //-------获取购物车数量---------- 593 //-------获取购物车数量----------
578 - requestCardNum: function(th) {  
579 - if(!this.globalData.user_id) return false;  
580 - var that=this; 594 + requestCardNum: function (th) {
  595 + if (!this.globalData.user_id) return false;
  596 + var that = this;
581 this.request.get("/api/weshop/cart/page", { 597 this.request.get("/api/weshop/cart/page", {
582 - isShoeLoading:false, 598 + isShoeLoading: false,
583 data: { 599 data: {
584 store_id: this.globalData.setting.stoid, 600 store_id: this.globalData.setting.stoid,
585 user_id: this.globalData.user_id, 601 user_id: this.globalData.user_id,
586 - state:0,  
587 - is_gift:0,  
588 - pageSize:300 602 + state: 0,
  603 + is_gift: 0,
  604 + pageSize: 300
589 }, 605 },
590 - success: function(e) { 606 + success: function (e) {
591 var num = 0; 607 var num = 0;
592 - if(e.data.data && e.data.data.pageData) { 608 + if (e.data.data && e.data.data.pageData) {
593 for (var i = 0; i < e.data.data.pageData.length; i++) { 609 for (var i = 0; i < e.data.data.pageData.length; i++) {
594 num += e.data.data.pageData[i].goods_num; 610 num += e.data.data.pageData[i].goods_num;
595 } 611 }
@@ -600,131 +616,131 @@ App({ @@ -600,131 +616,131 @@ App({
600 text: '' + num //显示的内容 616 text: '' + num //显示的内容
601 });--*/ 617 });--*/
602 //-- 读取服务卡的数量 -- 618 //-- 读取服务卡的数量 --
603 - that.promiseGet("/api/weshop/cartService/page",{  
604 - data:{ 619 + that.promiseGet("/api/weshop/cartService/page", {
  620 + data: {
605 store_id: that.globalData.setting.stoid, 621 store_id: that.globalData.setting.stoid,
606 user_id: that.globalData.user_id, 622 user_id: that.globalData.user_id,
607 } 623 }
608 - }).then(res=>{ 624 + }).then(res => {
609 625
610 for (var i = 0; i < res.data.data.pageData.length; i++) { 626 for (var i = 0; i < res.data.data.pageData.length; i++) {
611 num += res.data.data.pageData[i].goods_num; 627 num += res.data.data.pageData[i].goods_num;
612 } 628 }
613 629
614 - that.globalData.cartGoodsNum=num; 630 + that.globalData.cartGoodsNum = num;
615 th.data.up_dating = 0 631 th.data.up_dating = 0
616 - th.getTabBar().setData({cartGoodsNum:num}); 632 + th.getTabBar().setData({ cartGoodsNum: num });
617 }) 633 })
618 634
619 } 635 }
620 }); 636 });
621 }, 637 },
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){ 638 +
  639 + //------定时等待某个值,有值才进行运算--------
  640 + waitfor: function (page, key, pop_value, func) {
  641 + var n = 0;
  642 + if (!page.data[key]) {
  643 + page.data[key] = setInterval(function () {
  644 + console.log(page.data[key]); n++;
  645 + if (pop_value) {
  646 + clearInterval(page.data[key]);
  647 + func();
  648 + }
  649 + if (n > 15) clearInterval(page.data[key]);
  650 + }, 1000);
  651 + }
  652 + },
  653 +
  654 + //------定时等待某个值,有值才进行运算--------
  655 + waitfor2: function (page, key, pop_value_key, func) {
  656 + var n = 0;
  657 + if (!page.data[key]) {
  658 + page.data[key] = setInterval(function () {
  659 + console.log(page.data[key]); n++;
  660 + if (page.data[pop_value_key] && Object.keys(page.data[pop_value_key]).length > 0) {
  661 + clearInterval(page.data[key]);
  662 + func();
  663 + }
  664 + if (n > 15) {
649 clearInterval(page.data[key]); 665 clearInterval(page.data[key]);
650 func(); 666 func();
651 } 667 }
652 - },1000);  
653 - }  
654 - }, 668 + }, 1000);
  669 + }
  670 + },
655 671
656 //清空登录时候缓存的值 672 //清空登录时候缓存的值
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, ''); 673 + onHide: function () {
  674 + this.globalData.is_test = 0;
  675 + this.globalData.guide_id = null; //导购清空
  676 + this.globalData.first_leader = null; //分享的会员清空
  677 + this.globalData.wuliu = null; //关闭要把物流清空
  678 + this.globalData.room_id = null; //关闭要把房间号关闭
  679 + this.globalData.room_goods_id = null; //关闭要把物流清空
  680 + this.globalData.config2 = null; //清除config2的缓存
  681 + this.globalData.config = null; //清除config的缓存
  682 + this.globalData.gr_index = 0; //商品分组的序列
  683 + this.globalData.pk_store = null;
  684 + this.globalData.wxapp_buy_obj = null;
  685 + this.globalData.dis_buy_obj = null; //等级卡的购买记录
  686 + this.globalData.storeFooter = null; //底部的导航
  687 + this.globalData.full_screen = null; //全屏
  688 +
  689 + },
  690 +
  691 + clear_word: function (word) {
  692 +
  693 + var str = word;
  694 + 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,
  695 + indexArr = reg.exec(str);
  696 + if (str.match(reg)) {
  697 + str = str.replace(reg, '');
  698 + }
  699 + return str;
  700 + },
  701 +
  702 + getPageIndex: function (curPage) {
  703 +
  704 + var pagePath = curPage.route; //当前页面url
  705 + if (pagePath.indexOf('/') != 0) {
  706 + pagePath = '/' + pagePath;
  707 + }
  708 +
  709 + var index = 0;
  710 +
  711 + if (this.globalData.custum_data) {
  712 + var itemList = this.globalData.custum_data.data;
  713 + itemList = JSON.parse(itemList);
  714 + for (var i in itemList) {
  715 + var item = itemList[i]
  716 + if (pagePath.indexOf(item.weappurl) != -1) {
  717 + index = i; break;
  718 + }
  719 + }
  720 +
  721 + } else {
  722 + var itemList = this.def_list;
  723 + for (var i in itemList) {
  724 + var item = itemList[i]
  725 + if (pagePath.indexOf(item.weappurl) != -1) {
  726 + index = i; break;
  727 + }
682 } 728 }
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 - }, 729 + }
  730 + return index;
  731 +
  732 + },
717 733
718 //---promise的使用get---- 734 //---promise的使用get----
719 - promiseGet:function(url,data){  
720 - if(url.indexOf("http")==-1) url=this.globalData.setting.url +url; 735 + promiseGet: function (url, data) {
  736 + if (url.indexOf("http") == -1) url = this.globalData.setting.url + url;
721 return new Promise((resolve, reject) => { 737 return new Promise((resolve, reject) => {
722 data.isShowLoading && wx.showLoading(); 738 data.isShowLoading && wx.showLoading();
723 wx.request({ 739 wx.request({
724 url, 740 url,
725 method: 'GET', 741 method: 'GET',
726 - header: {"content-type": "application/x-www-form-urlencoded" },  
727 - data:data.data, 742 + header: { "content-type": "application/x-www-form-urlencoded" },
  743 + data: data.data,
728 success(res) { 744 success(res) {
729 data.isShowLoading && wx.hideLoading(); 745 data.isShowLoading && wx.hideLoading();
730 resolve(res); 746 resolve(res);
@@ -736,40 +752,40 @@ App({ @@ -736,40 +752,40 @@ App({
736 752
737 753
738 //---promise的使用get---- 754 //---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 - }) 755 + requestGet: function (url, data) {
  756 + if (url.indexOf("http") == -1) url = this.globalData.setting.url + url;
  757 + data.isShowLoading && wx.showLoading();
  758 + wx.request({
  759 + url,
  760 + method: 'GET',
  761 + header: { "content-type": "application/x-www-form-urlencoded" },
  762 + data: data.data,
  763 + success(res) {
  764 + data.isShowLoading && wx.hideLoading();
  765 + data.success(res);
  766 + },
  767 + fail(err) {
  768 + data.isShowLoading && wx.hideLoading();
  769 + if (data.fail) data.fail(err);
  770 + }
  771 + })
  772 + },
  773 +
  774 +
  775 + // 判断是否登录
  776 + isLogin() {
  777 + return new Promise(function (resolve, reject) {
  778 + let user_info = getApp().globalData.userInfo;
  779 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  780 + wx.navigateTo({
  781 + url: '/pages/togoin/togoin',
  782 + })
  783 + return false;
  784 + } else {
  785 + resolve(user_info);
  786 + };
  787 + });
756 }, 788 },
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 789
774 790
775 checkUpdateVersion() { 791 checkUpdateVersion() {
@@ -777,19 +793,21 @@ App({ @@ -777,19 +793,21 @@ App({
777 if (wx.canIUse('getUpdateManager')) { 793 if (wx.canIUse('getUpdateManager')) {
778 //创建 UpdateManager 实例 794 //创建 UpdateManager 实例
779 const updateManager = wx.getUpdateManager(); 795 const updateManager = wx.getUpdateManager();
780 - console.log('是否进入模拟更新'); 796 + if(!updateManager) {
  797 + return false;
  798 + }
781 //检测版本更新 799 //检测版本更新
782 - updateManager.onCheckForUpdate(function(res) { 800 + updateManager.onCheckForUpdate(function (res) {
783 console.log('是否获取版本'); 801 console.log('是否获取版本');
784 // 请求完新版本信息的回调 802 // 请求完新版本信息的回调
785 if (res.hasUpdate) { 803 if (res.hasUpdate) {
786 //监听小程序有版本更新事件 804 //监听小程序有版本更新事件
787 - updateManager.onUpdateReady(function() { 805 + updateManager.onUpdateReady(function () {
788 806
789 //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作) 807 //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作)
790 updateManager.applyUpdate(); 808 updateManager.applyUpdate();
791 }) 809 })
792 - updateManager.onUpdateFailed(function() { 810 + updateManager.onUpdateFailed(function () {
793 // 新版本下载失败 811 // 新版本下载失败
794 wx.showModal({ 812 wx.showModal({
795 title: '已经有新版本喽~', 813 title: '已经有新版本喽~',
@@ -810,6 +828,6 @@ App({ @@ -810,6 +828,6 @@ App({
810 828
811 829
812 830
813 - 831 +
814 832
815 }); 833 });
app.json
@@ -19,10 +19,8 @@ @@ -19,10 +19,8 @@
19 "pages/user/coupon/coupon", 19 "pages/user/coupon/coupon",
20 "pages/user/checkcoupon/checkcoupon", 20 "pages/user/checkcoupon/checkcoupon",
21 "pages/user/add_address/add_address", 21 "pages/user/add_address/add_address",
22 - "pages/user/withdrawals_list/withdrawals_list",  
23 "pages/user/return_goods_info/return_goods_info", 22 "pages/user/return_goods_info/return_goods_info",
24 "pages/user/return_goods/return_goods", 23 "pages/user/return_goods/return_goods",
25 - "pages/user/withdrawals/withdrawals",  
26 "pages/user/express/express", 24 "pages/user/express/express",
27 "pages/user/get_user_info/get_user_info", 25 "pages/user/get_user_info/get_user_info",
28 "pages/activity/seckill_list/seckill_list", 26 "pages/activity/seckill_list/seckill_list",
@@ -155,7 +153,6 @@ @@ -155,7 +153,6 @@
155 "pages/video/index", 153 "pages/video/index",
156 "pages/boxes-list/boxes-list", 154 "pages/boxes-list/boxes-list",
157 "pages/boxes-details/boxes-details" 155 "pages/boxes-details/boxes-details"
158 -  
159 ] 156 ]
160 }, 157 },
161 { 158 {
@@ -195,6 +192,7 @@ @@ -195,6 +192,7 @@
195 "pages/AI-test-skin/analyse/analyse" 192 "pages/AI-test-skin/analyse/analyse"
196 ] 193 ]
197 } 194 }
  195 +
198 ], 196 ],
199 "permission": { 197 "permission": {
200 "scope.userLocation": { 198 "scope.userLocation": {
@@ -256,4 +254,5 @@ @@ -256,4 +254,5 @@
256 "useExtendedLib": { 254 "useExtendedLib": {
257 "weui": true 255 "weui": true
258 } 256 }
  257 +
259 } 258 }
260 \ No newline at end of file 259 \ No newline at end of file
app.wxss
@@ -743,9 +743,25 @@ background: #ffe3e2; @@ -743,9 +743,25 @@ background: #ffe3e2;
743 /* 图标字体(ty) */ 743 /* 图标字体(ty) */
744 @font-face { 744 @font-face {
745 font-family: 'iconfont'; /* Project id 2054717 */ 745 font-family: 'iconfont'; /* Project id 2054717 */
746 - src: url('//at.alicdn.com/t/font_2054717_lrw1n4v54a9.woff2?t=1645426251412') format('woff2'),  
747 - url('//at.alicdn.com/t/font_2054717_lrw1n4v54a9.woff?t=1645426251412') format('woff'),  
748 - url('//at.alicdn.com/t/font_2054717_lrw1n4v54a9.ttf?t=1645426251412') format('truetype'); 746 + src: url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff2?t=1645781927179') format('woff2'),
  747 + url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff?t=1645781927179') format('woff'),
  748 + url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.ttf?t=1645781927179') format('truetype');
  749 +}
  750 +
  751 +.icon-infofill:before {
  752 + content: "\e6e6";
  753 +}
  754 +
  755 +.icon-geren:before {
  756 + content: "\e71d";
  757 +}
  758 +
  759 +.icon-tupian:before {
  760 + content: "\e997";
  761 +}
  762 +
  763 +.icon-wenhao:before {
  764 + content: "\e72d";
749 } 765 }
750 766
751 .icon-suoxiao:before { 767 .icon-suoxiao:before {
components/diy_goodsGroup/diy_goodsGroup.js
@@ -46,6 +46,7 @@ Component({ @@ -46,6 +46,7 @@ Component({
46 title_index: 0, 46 title_index: 0,
47 swiper_hei: 0, 47 swiper_hei: 0,
48 title_class: "", 48 title_class: "",
  49 + is_no_plus: 1,
49 }, 50 },
50 51
51 ready: function () { }, 52 ready: function () { },
@@ -106,7 +107,7 @@ Component({ @@ -106,7 +107,7 @@ Component({
106 } 107 }
107 if (this.data.object.bg_color) { 108 if (this.data.object.bg_color) {
108 this.setData({ 109 this.setData({
109 - bg_color:this.data.object.bg_color, 110 + bg_color: this.data.object.bg_color,
110 }) 111 })
111 } 112 }
112 this.setData({ 113 this.setData({
@@ -190,38 +191,8 @@ Component({ @@ -190,38 +191,8 @@ Component({
190 th.data.loading = 0; 191 th.data.loading = 0;
191 192
192 if (res.data.code == 0 && res.data.data) { 193 if (res.data.code == 0 && res.data.data) {
193 -  
194 var goods = res.data.data; 194 var goods = res.data.data;
195 - /*--  
196 - var rData = th.data.requestData;  
197 - if (rData == null) rData=[];  
198 - var now=ut.gettimestamp();  
199 -  
200 - var new_arr=[];  
201 - for (var ii in res.data.data){  
202 - var item=res.data.data[ii];  
203 - item.goods_img=th.data.imghost + item.original_img;  
204 - if(item.e_time<now) {item.prom_type=0; item.prom_price=0;}  
205 - if(item.warm_uptime>now) {item.prom_type=0; item.prom_price=0;}  
206 - new_arr.push(item);  
207 - }  
208 - rData = rData.concat(new_arr);  
209 -  
210 - th.data.requestData = rData;  
211 -  
212 - if(th.data.object.column==5){  
213 - var arr = new Array();  
214 - //--三个三个一组---  
215 - for(var i=0;i< rData.length;i+=3){  
216 - arr.push(rData.slice(i,i+3));  
217 - }  
218 - th.setData({ goods_array: arr });  
219 - }else{  
220 - th.setData({ goods_array: rData });  
221 - }--*/  
222 -  
223 th.set_good(goods); 195 th.set_good(goods);
224 -  
225 //---控制有没有加载更多的按钮--- 196 //---控制有没有加载更多的按钮---
226 if (th.data.firist_type_curr >= len) { th.setData({ goods_btn: [] }); } 197 if (th.data.firist_type_curr >= len) { th.setData({ goods_btn: [] }); }
227 else th.setData({ goods_btn: [1, 2] }); 198 else th.setData({ goods_btn: [1, 2] });
@@ -362,6 +333,21 @@ Component({ @@ -362,6 +333,21 @@ Component({
362 }) 333 })
363 } 334 }
364 }) 335 })
  336 + //调用接口判断商家plus有没有过期
  337 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  338 + if (res.data.code == 0) {
  339 + var arr = res.data.data.pageData;
  340 + if (arr.length > 0) {
  341 + var item = arr[0];
  342 + if (item.is_sy == 0) {
  343 + var now = Date.parse(new Date()); now = now / 1000;
  344 + if (item.end_time < now) {
  345 + th.setData({ is_no_plus: 0 })
  346 + }
  347 + }
  348 + }
  349 + }
  350 + })
365 351
366 }, 352 },
367 353
@@ -455,7 +441,6 @@ Component({ @@ -455,7 +441,6 @@ Component({
455 var val = goods[i]; 441 var val = goods[i];
456 var item = {}; 442 var item = {};
457 var prom_id = null; 443 var prom_id = null;
458 - //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => {  
459 444
460 var url = "/api/weshop/activitylist/getGoodActInfo"; 445 var url = "/api/weshop/activitylist/getGoodActInfo";
461 var req_data = { 446 var req_data = {
components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -102,7 +102,7 @@ @@ -102,7 +102,7 @@
102 </block> 102 </block>
103 <block wx:else> 103 <block wx:else>
104 <!-- 如果商品有设置等级价大于0的 --> 104 <!-- 如果商品有设置等级价大于0的 -->
105 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> 105 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
106 <view class="money flex"> 106 <view class="money flex">
107 <!-- 办卡价 --> 107 <!-- 办卡价 -->
108 <view class="flex xc-wc"> 108 <view class="flex xc-wc">
@@ -253,7 +253,7 @@ @@ -253,7 +253,7 @@
253 </block> 253 </block>
254 <block wx:else> 254 <block wx:else>
255 <!-- 如果商品有设置等级价大于0的 --> 255 <!-- 如果商品有设置等级价大于0的 -->
256 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> 256 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
257 <view class="money flex"> 257 <view class="money flex">
258 <!-- 办卡价 --> 258 <!-- 办卡价 -->
259 <view class="flex xc-wc"> 259 <view class="flex xc-wc">
@@ -403,7 +403,7 @@ @@ -403,7 +403,7 @@
403 </block> 403 </block>
404 <block wx:else> 404 <block wx:else>
405 <!-- 如果商品有设置等级价大于0的 --> 405 <!-- 如果商品有设置等级价大于0的 -->
406 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> 406 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
407 <view class="money flex"> 407 <view class="money flex">
408 <!-- 办卡价 --> 408 <!-- 办卡价 -->
409 <view class="flex xc-wc"> 409 <view class="flex xc-wc">
@@ -577,7 +577,7 @@ @@ -577,7 +577,7 @@
577 <!-- 等级价 --> 577 <!-- 等级价 -->
578 <view class="price flex ai_and"> 578 <view class="price flex ai_and">
579 <view class="fs22">¥</view> 579 <view class="fs22">¥</view>
580 - <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view> 580 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2) && is_no_plus}}</view>
581 <view class="card_bg"> 581 <view class="card_bg">
582 <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}} 582 <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}
583 </view> 583 </view>
@@ -734,7 +734,7 @@ @@ -734,7 +734,7 @@
734 </block> 734 </block>
735 <block wx:else> 735 <block wx:else>
736 <!-- 如果商品有设置等级价大于0的 --> 736 <!-- 如果商品有设置等级价大于0的 -->
737 - <block wx:if="{{g_filter.get_card_price(aitem,card_list,0)}}"> 737 + <block wx:if="{{g_filter.get_card_price(aitem,card_list,0) && is_no_plus}}">
738 <view class="money flex"> 738 <view class="money flex">
739 <!-- 办卡价 --> 739 <!-- 办卡价 -->
740 <view class="flex xc-wc"> 740 <view class="flex xc-wc">
components/diy_luckyGo/diy_luckyGo.js
1 -// var e = function(e) {  
2 -// return e && e.__esModule ? e : {  
3 -// default: e  
4 -// };  
5 -// }(require("../../utils/LoadMore3.js")),  
6 -// n = new e.default(),  
7 var t = getApp(), 1 var t = getApp(),
8 a = t.request, 2 a = t.request,
9 o = t.globalData.setting, 3 o = t.globalData.setting,
components/diy_pingd_buy/diy_pingd_buy.js
1 -// var e = function(e) {  
2 -// return e && e.__esModule ? e : {  
3 -// default: e  
4 -// };  
5 -// }(require("../../utils/LoadMore3.js")),  
6 -// n = new e.default(), 1 +
7 var t = getApp(), 2 var t = getApp(),
8 a = t.request, 3 a = t.request,
9 o = t.globalData.setting, 4 o = t.globalData.setting,
components/diy_richtext/diy_richtext.js
@@ -4,7 +4,7 @@ Component({ @@ -4,7 +4,7 @@ Component({
4 4
5 nodes: { 5 nodes: {
6 type: String, 6 type: String,
7 - value: '<div><h3>javascript - <em>js同步编程</em>与异步编程的区别,异步有哪些优点,为什么...</h3><div><span>2016年5月20日 - </span>从编程方式来讲当然是<em>同步编程</em>的方式更为简单,但是同步有其局限性一是假如是单线程那么一旦遇到阻塞调用,会造成整个线程阻塞,导致cpu无法得到有效利用...</div><div><div></div><span ><span ></span></span> - 百度快照</div><div ><span>为您推荐:</span>js同步和异步ajax异步和同步的区别</div></div>', 7 + value: '',
8 }, 8 },
9 my:{ 9 my:{
10 type: String, 10 type: String,
components/diy_richtext/diy_richtext.wxml
1 -<!--pages/diy_fwb/diy_fwb.wxml-->  
2 <rich-text nodes="{{nodes}}"></rich-text> 1 <rich-text nodes="{{nodes}}"></rich-text>
3 2
4 -  
5 -  
6 -<!-- <view>  
7 -  
8 -<w-test inner-text="sssszwpwpwpww"></w-test>  
9 - <component-tag-name inner-text="Some text"></component-tag-name>  
10 -</view> -->  
11 -  
components/diy_seckill/diy_seckill.wxml
@@ -15,7 +15,8 @@ @@ -15,7 +15,8 @@
15 <view class='sp' wx:if="{{object.style==1}}"> 15 <view class='sp' wx:if="{{object.style==1}}">
16 <swiper-item class="s_it" wx:for="{{goods_array}}"> 16 <swiper-item class="s_it" wx:for="{{goods_array}}">
17 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 17 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
18 - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> 18 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
  19 + <navigator url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" class="s1_gk_a1">
19 <view class='one'> 20 <view class='one'>
20 <view class='sp_top'> 21 <view class='sp_top'>
21 <view class='po'></view> 22 <view class='po'></view>
@@ -74,10 +75,13 @@ @@ -74,10 +75,13 @@
74 </view> 75 </view>
75 </swiper> 76 </swiper>
76 77
  78 +
  79 +
77 <view class="sp2" wx:if="{{object.style==2}}"> 80 <view class="sp2" wx:if="{{object.style==2}}">
78 <block wx:for="{{goods_array}}"> 81 <block wx:for="{{goods_array}}">
79 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> 82 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
80 - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> 83 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=1&prom_id={{aitem.id}}" class="s1_gk_a1"> -->
  84 + <navigator url="{{aitem.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + aitem.goods_id + '&title=' + aitem.goods_name + '&prom_type=1&prom_id=' + aitem.id )}}" class="s1_gk_a1">
81 <view class='one1'> 85 <view class='one1'>
82 86
83 <view class="o1_img"> 87 <view class="o1_img">
components/diy_serviceCard/diy_serviceCard.js
@@ -226,33 +226,6 @@ Component({ @@ -226,33 +226,6 @@ Component({
226 if (res.data.code == 0 && res.data.data) { 226 if (res.data.code == 0 && res.data.data) {
227 227
228 var goods = res.data.data.pageData; 228 var goods = res.data.data.pageData;
229 - // console.log('goods', goods);  
230 - // var rData = th.data.requestData;  
231 - // if (rData == null) rData=[];  
232 - // var now=ut.gettimestamp();  
233 -  
234 - // var new_arr=[];  
235 - // for (var ii in res.data.data){  
236 - // var item=res.data.data[ii];  
237 - // item.goods_img=th.data.imghost + item.original_img;  
238 - // if(item.e_time<now) {item.prom_type=0; item.prom_price=0;}  
239 - // if(item.warm_uptime>now) {item.prom_type=0; item.prom_price=0;}  
240 - // new_arr.push(item);  
241 - // }  
242 - // rData = rData.concat(new_arr);  
243 -  
244 - // th.data.requestData = rData;  
245 -  
246 - // if(th.data.object.column==5){  
247 - // var arr = new Array();  
248 - // //--三个三个一组---  
249 - // for(var i=0;i< rData.length;i+=3){  
250 - // arr.push(rData.slice(i,i+3));  
251 - // }  
252 - // th.setData({ goods_array: arr });  
253 - // }else{  
254 - // th.setData({ goods_array: rData });  
255 - // }--  
256 229
257 th.set_good(goods); 230 th.set_good(goods);
258 231
@@ -353,91 +326,13 @@ Component({ @@ -353,91 +326,13 @@ Component({
353 326
354 //---卡的初始化---- 327 //---卡的初始化----
355 card_init: function() { 328 card_init: function() {
356 - // var th = this,  
357 - // os = getApp().globalData.setting;  
358 - // if (!getApp().globalData.user_id) return false;  
359 - // getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {  
360 - // isShowLoading: false,  
361 - // success: function(e) {  
362 - // getApp().globalData.userInfo = e.data.data;  
363 - // getApp().getConfig2(function(e) {  
364 - // var swithc_list = e.switch_list;  
365 - // var sw_arr = JSON.parse(swithc_list);  
366 - // //---如果后台又开等级卡的开关---  
367 - // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {  
368 - // th.setData({  
369 - // rank_switch: true  
370 - // });  
371 - // //---回调卡的列表---  
372 - // th.getPlusCardType(function(ob) {  
373 - // th.setData({  
374 - // card_list: ob.card_list  
375 - // });  
376 - // var ti = setInterval(function() {  
377 - // var user = getApp().globalData.userInfo;  
378 - // if (!user) return false;  
379 - // clearInterval(ti);  
380 -  
381 - // if (user.card_field && user['card_expiredate']) {  
382 - // var str = user['card_expiredate'].replace(/-/g, '/');  
383 - // var end = new Date(str);  
384 - // end = Date.parse(end) / 1000;  
385 - // var now = ut.gettimestamp();  
386 -  
387 - // //--- 判断是等级会员,且在有效期范围内 ---  
388 - // if (user.card_field && now < end) {  
389 - // var card_name = ob.name_map.get(user.card_field);  
390 - // if (card_name.length > 4) card_name = card_name.substring(0, 4);  
391 - // th.setData({  
392 - // card_field: user.card_field,  
393 - // card_name: card_name,  
394 - // card_list: ob.card_list  
395 - // });  
396 - // }  
397 -  
398 - // }  
399 -  
400 - // }, 500)  
401 - // })  
402 -  
403 - // }  
404 - // })  
405 - // }  
406 - // }) 329 +
407 330
408 }, 331 },
409 332
410 //--- 获取卡类列表 --- 333 //--- 获取卡类列表 ---
411 getPlusCardType: function(func) { 334 getPlusCardType: function(func) {
412 - // var storid = o.stoid;  
413 - // var th = this;  
414 - // getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {  
415 - // var plusCard = res.data.data;  
416 - // var arr = [1219, 2089, 3031];  
417 - // var new_arr = new Array();  
418 - // var card_name_map = new Map();  
419 -  
420 - // var user = getApp().globalData.userInfo;  
421 -  
422 - // if (plusCard) {  
423 -  
424 - // for (var i = 0; i < plusCard.length; i++) {  
425 - // if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {  
426 - // continue;  
427 - // }  
428 -  
429 - // var name = "card" + plusCard[i].CorrPrice.toLowerCase();  
430 - // card_name_map.set(name, plusCard[i].CardName);  
431 - // new_arr.push(plusCard[i]);  
432 - // }  
433 - // }  
434 -  
435 - // var ob = {  
436 - // "card_list": new_arr,  
437 - // "name_map": card_name_map  
438 - // };  
439 - // func(ob);  
440 - // }) 335 +
441 }, 336 },
442 337
443 338
@@ -499,32 +394,13 @@ Component({ @@ -499,32 +394,13 @@ Component({
499 var now = ut.gettimestamp(); 394 var now = ut.gettimestamp();
500 var th = this; 395 var th = this;
501 if (!goods || goods.length == 0) return false; 396 if (!goods || goods.length == 0) return false;
502 - var user_id = getApp().globalData.userInfo.user_id; 397 + var user_id = getApp().globalData.user_id;
503 if (!user_id) user_id = 0; 398 if (!user_id) user_id = 0;
504 for (var i in goods) { 399 for (var i in goods) {
505 var val = goods[i]; 400 var val = goods[i];
506 var item = {}; 401 var item = {};
507 var prom_id = null; 402 var prom_id = null;
508 - //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => {  
509 -  
510 - // var url = "/api/weshop/activitylist/getGoodActInfo";  
511 - // var req_data = {  
512 - // store_id: os.stoid,  
513 - // goodsidlist: val.goods_id,  
514 - // is_detail: 1,  
515 - // user_id: user_id  
516 - // };  
517 -  
518 - //获取商品的实际活动  
519 - // await getApp().request.promiseGet(url, {  
520 - // data: req_data  
521 - // }).then(res => {  
522 - // if (res.data.code == 0 && res.data.data && res.data.data.length == 1) {  
523 - // item.prom_type = res.data.data[0].prom_type;  
524 - // item.prom_id = res.data.data[0].act_id;  
525 - // }  
526 - // })  
527 - // console.log('val++++++<<<<<', val); 403 +
528 item.goods_name = val.serviceName; 404 item.goods_name = val.serviceName;
529 item.goods_img = th.data.imghost + val.imgUrl; 405 item.goods_img = th.data.imghost + val.imgUrl;
530 item.market_price = val.show_price; 406 item.market_price = val.show_price;
@@ -532,12 +408,6 @@ Component({ @@ -532,12 +408,6 @@ Component({
532 item.sales_sum = val.sales_sum; 408 item.sales_sum = val.sales_sum;
533 item.goods_id = val.id; 409 item.goods_id = val.id;
534 410
535 - // item.cardprice1 = val.cardprice1;  
536 - // item.cardprice2 = val.cardprice2;  
537 - // item.cardprice3 = val.cardprice3;  
538 - // item.prom_type = val.prom_type;  
539 - // item.prom_id = val.prom_id;  
540 -  
541 if (val.prom_price) item.prom_price = val.prom_price; 411 if (val.prom_price) item.prom_price = val.prom_price;
542 if (val.prom_integral) item.prom_integral = val.prom_integral; 412 if (val.prom_integral) item.prom_integral = val.prom_integral;
543 413
@@ -547,44 +417,6 @@ Component({ @@ -547,44 +417,6 @@ Component({
547 417
548 var url = ""; 418 var url = "";
549 419
550 - // switch (prom_type) {  
551 - // case 1:  
552 - // var user_id = getApp().globalData.user_id;  
553 - // if (!user_id) user_id = 0;  
554 - // url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id;  
555 - // break;  
556 - // case 2:  
557 - // url = "/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id  
558 - // break;  
559 - // case 4:  
560 - // url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id;  
561 - // break;  
562 - // case 6:  
563 - // url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id;  
564 - // break;  
565 - // case 8:  
566 - // var presell_id = prom_id;  
567 - // var url1 = "/api/weshop/marketing/marketingPresellList/list";  
568 - // var rd = {  
569 - // store_id: os.stoid,  
570 - // presell_id: presell_id,  
571 - // goods_id: val.goods_id  
572 - // }  
573 - // //------获取预售从表----------  
574 - // await getApp().request.promiseGet(url1, {  
575 - // data: rd  
576 - // }).then(res => {  
577 - // if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {  
578 - // var arr = res.data.data[0];  
579 - // item.prom_price = arr.luck_goods_price;  
580 - // item.sales_sum = arr.buy_goodnum + (arr.virtual_qty ? arr.virtual_qty : 0);  
581 - // }  
582 - // })  
583 - // break;  
584 - // default:  
585 - // break  
586 - // }  
587 -  
588 if (url != null && url != '') { 420 if (url != null && url != '') {
589 await getApp().request.promiseGet(url, {}).then(res => { 421 await getApp().request.promiseGet(url, {}).then(res => {
590 var prom = null; 422 var prom = null;
@@ -627,9 +459,7 @@ Component({ @@ -627,9 +459,7 @@ Component({
627 page: th.data.currentPage - 1, 459 page: th.data.currentPage - 1,
628 }); 460 });
629 } 461 }
630 -  
631 -  
632 - // console.log('goods_array0000000000====>>>', th.data.goods_array); 462 +
633 463
634 }, 464 },
635 465
components/goods_list/goods_list.js
@@ -16,21 +16,22 @@ Component({ @@ -16,21 +16,22 @@ Component({
16 card_field: "", 16 card_field: "",
17 card_name: "", 17 card_name: "",
18 max_card_field: "", 18 max_card_field: "",
19 - card_list: null 19 + card_list: null,
  20 + is_no_plus: 1,
20 }, 21 },
21 properties: { 22 properties: {
22 // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定 23 // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定
23 }, 24 },
24 - ready: function () {}, 25 + ready: function () { },
25 pageLifetimes: { 26 pageLifetimes: {
26 //要处理一下,游客登录后的界面的变化,主要还该是改变会员 27 //要处理一下,游客登录后的界面的变化,主要还该是改变会员
27 show: function () { 28 show: function () {
28 this.init(); 29 this.init();
29 - if(getApp().globalData.login_back==1){  
30 - getApp().globalData.login_back==0;  
31 - this.data.curPage=1;  
32 - this.setData({ recommend: [] });  
33 - this.get_list(); 30 + if (getApp().globalData.login_back == 1) {
  31 + getApp().globalData.login_back == 0;
  32 + this.data.curPage = 1;
  33 + this.setData({ recommend: [] });
  34 + this.get_list();
34 } 35 }
35 } 36 }
36 }, 37 },
@@ -83,29 +84,30 @@ Component({ @@ -83,29 +84,30 @@ Component({
83 }) 84 })
84 85
85 } 86 }
86 -  
87 -  
88 - 87 + }
  88 + })
  89 + //调用接口判断商家plus有没有过期
  90 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  91 + if (res.data.code == 0) {
  92 + var arr = res.data.data.pageData;
  93 + if (arr.length > 0) {
  94 + var item = arr[0];
  95 + if (item.is_sy == 0) {
  96 + var now = Date.parse(new Date()); now = now / 1000;
  97 + if (item.end_time < now) {
  98 + th.setData({ is_no_plus: 0 })
  99 + }
  100 + }
  101 + }
89 } 102 }
90 }) 103 })
91 }, 104 },
92 - // get_list: function () {  
93 - // var th = this;  
94 - // var url = "http://172.20.0.233:8022/api/weshop/display";  
95 - // wx.request({  
96 - // url: url,  
97 - // success: function (res) {  
98 - // th.setData({  
99 - // recommend: res.data.data.pageData  
100 - // })  
101 - // }  
102 - // })  
103 - // }, 105 +
104 get_list: function () { 106 get_list: function () {
105 var that = this; 107 var that = this;
106 if (that.data.is_no_more == 0) return false; 108 if (that.data.is_no_more == 0) return false;
107 - var user_id=getApp().globalData.user_id;  
108 - if(!user_id) user_id=0; 109 + var user_id = getApp().globalData.user_id;
  110 + if (!user_id) user_id = 0;
109 111
110 var curPage = that.data.curPage; 112 var curPage = that.data.curPage;
111 getApp().request.get('/api/weshop/goods/page?page', { 113 getApp().request.get('/api/weshop/goods/page?page', {
@@ -135,10 +137,10 @@ Component({ @@ -135,10 +137,10 @@ Component({
135 //加载完成 137 //加载完成
136 if (data.data.pageData) { 138 if (data.data.pageData) {
137 139
138 - for(let i in data.data.pageData){  
139 - let item=data.data.pageData[i];  
140 - if(item.user_price)  
141 - item.prom_price=item.user_price; 140 + for (let i in data.data.pageData) {
  141 + let item = data.data.pageData[i];
  142 + if (item.user_price)
  143 + item.prom_price = item.user_price;
142 } 144 }
143 145
144 that.setData({ 146 that.setData({
@@ -208,10 +210,10 @@ Component({ @@ -208,10 +210,10 @@ Component({
208 }) 210 })
209 }, 211 },
210 212
211 - go_url:function (e) {  
212 - var url=e.currentTarget.dataset.url;  
213 - getApp().goto(url);  
214 - } 213 + go_url: function (e) {
  214 + var url = e.currentTarget.dataset.url;
  215 + getApp().goto(url);
  216 + }
215 217
216 }, 218 },
217 }) 219 })
218 \ No newline at end of file 220 \ No newline at end of file
components/goods_list/goods_list.wxml
@@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
6 <!-- 商品详情 --> 6 <!-- 商品详情 -->
7 7
8 <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{g_filter.get_url_by_type(item)}}"> 8 <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{g_filter.get_url_by_type(item)}}">
9 - <!--<view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&title='+item.goods_name+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id)}}">--> 9 + <!--<view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&title='+item.goods_name+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id)}}">-->
10 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> --> 10 <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> -->
11 - <navigator hover-class="none"> 11 + <navigator hover-class="none">
12 <!-- 商品图⽚ --> 12 <!-- 商品图⽚ -->
13 <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image> 13 <image class="sp" src="{{url+item.original_img}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].original_img"></image>
14 <view class="bottom"> 14 <view class="bottom">
@@ -16,25 +16,25 @@ @@ -16,25 +16,25 @@
16 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view> 16 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
17 <!-- 判断是否有活动价 --> 17 <!-- 判断是否有活动价 -->
18 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}"> 18 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}">
19 - <view class="pdt10">  
20 - <view class="money flex xc-wc" >  
21 - <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>  
22 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
23 - <!-- 活动价 -->  
24 - <view class="flex xc-wc" wx:if="{{item.prom_price}}">  
25 - <view class="fs24">¥</view>  
26 - <view class="fs35">{{item.prom_price}}</view>  
27 - </view>  
28 - </view>  
29 - <view class="flex">  
30 - <!-- 原价 -->  
31 - <view class="price flex xc-ash line_th">  
32 - <view class="fs22">¥</view>  
33 - <view class="fs22">{{item.market_price}}</view>  
34 - </view>  
35 - </view>  
36 - </view>  
37 - 19 + <view class="pdt10">
  20 + <view class="money flex xc-wc">
  21 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  22 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  23 + <!-- 活动价 -->
  24 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
  25 + <view class="fs24">¥</view>
  26 + <view class="fs35">{{item.prom_price}}</view>
  27 + </view>
  28 + </view>
  29 + <view class="flex">
  30 + <!-- 原价 -->
  31 + <view class="price flex xc-ash line_th">
  32 + <view class="fs22">¥</view>
  33 + <view class="fs22">{{item.market_price}}</view>
  34 + </view>
  35 + </view>
  36 + </view>
  37 +
38 </block> 38 </block>
39 <block wx:else> 39 <block wx:else>
40 <!-- 商品价格,先判断下是后⼜等级价--> 40 <!-- 商品价格,先判断下是后⼜等级价-->
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 </block> 81 </block>
82 <block wx:else> 82 <block wx:else>
83 <!-- 如果商品有设置等级价⼤于0的 --> 83 <!-- 如果商品有设置等级价⼤于0的 -->
84 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}"> 84 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
85 <view class="money flex"> 85 <view class="money flex">
86 <!-- 办卡价 --> 86 <!-- 办卡价 -->
87 <view class="flex xc-wc"> 87 <view class="flex xc-wc">
@@ -94,16 +94,16 @@ @@ -94,16 +94,16 @@
94 <view class="fs22">{{item.market_price}}</view> 94 <view class="fs22">{{item.market_price}}</view>
95 </view> 95 </view>
96 </view> 96 </view>
97 - <view class="flexr" style=""> 97 + <view class="flexr">
98 <!-- 等级价 --> 98 <!-- 等级价 -->
99 - <view class="price flex ai-center">  
100 - <view class="fs22">¥</view>  
101 - <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>  
102 - <view class="card_bg ellipsis-1">  
103 - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>  
104 - <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>  
105 - </view>  
106 - </view> 99 + <view class="price flex ai-center">
  100 + <view class="fs22">¥</view>
  101 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  102 + <view class="card_bg ellipsis-1">
  103 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"/>
  104 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  105 + </view>
  106 + </view>
107 </view> 107 </view>
108 </block> 108 </block>
109 <block wx:else> 109 <block wx:else>
components/serviceCard_list/serviceCard_list.js
@@ -90,18 +90,6 @@ Component({ @@ -90,18 +90,6 @@ Component({
90 } 90 }
91 }) 91 })
92 }, 92 },
93 - // get_list: function () {  
94 - // var th = this;  
95 - // var url = "http://172.20.0.233:8022/api/weshop/display";  
96 - // wx.request({  
97 - // url: url,  
98 - // success: function (res) {  
99 - // th.setData({  
100 - // recommend: res.data.data.pageData  
101 - // })  
102 - // }  
103 - // })  
104 - // },  
105 get_list: function () { 93 get_list: function () {
106 var that = this; 94 var that = this;
107 if (that.data.is_no_more == 0) return false; 95 if (that.data.is_no_more == 0) return false;
@@ -109,18 +97,8 @@ Component({ @@ -109,18 +97,8 @@ Component({
109 if(!user_id) user_id=0; 97 if(!user_id) user_id=0;
110 98
111 var curPage = that.data.curPage; 99 var curPage = that.data.curPage;
112 -  
113 - // page: curPage,  
114 - // pageSize: 6,  
115 - // orderField: "sort",  
116 - // orderType: 'asc',  
117 - // // user_id: user_id,  
118 - // // is_mainshow: 1,  
119 - // // isonsale: 1,  
120 - // // is_on_sale: 1,  
121 - // is_recommend: 1,  
122 - // store_id: o.stoid,  
123 - 100 +
  101 +
124 getApp().request.get('/api/weshop/serviceCard/page', { 102 getApp().request.get('/api/weshop/serviceCard/page', {
125 isShowLoading: false, 103 isShowLoading: false,
126 data: { 104 data: {
components/timePicker/timePicker.js
@@ -83,14 +83,10 @@ Component({ @@ -83,14 +83,10 @@ Component({
83 * 组件的初始数据 83 * 组件的初始数据
84 */ 84 */
85 data: { 85 data: {
86 - // pickerShow:true  
87 - // limitStartTime: new Date().getTime()-1000*60*60*24*30,  
88 - // limitEndTime: new Date().getTime(),  
89 - // yearStart:2000,  
90 - // yearEnd:2100 86 +
91 }, 87 },
92 detached: function() { 88 detached: function() {
93 - console.log("dele"); 89 +
94 }, 90 },
95 attached: function() {}, 91 attached: function() {},
96 ready: function() { 92 ready: function() {
@@ -384,11 +380,7 @@ Component({ @@ -384,11 +380,7 @@ Component({
384 this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond); 380 this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond);
385 this.setEndDate(endYear, endMonth, endDay, endHour, endMinute, endSecond); 381 this.setEndDate(endYear, endMonth, endDay, endHour, endMinute, endSecond);
386 382
387 - //!!!  
388 - // setTimeout(() => {  
389 - // this.setStartDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)  
390 - // this.setEndDate(nowYear, nowMonth, nowDay, nowHour, nowMinute)  
391 - // }, 0); 383 +
392 }, 384 },
393 setPickerDateArr(type, year, month, day, hour, minute, second) { 385 setPickerDateArr(type, year, month, day, hour, minute, second) {
394 let yearIdx = 0; 386 let yearIdx = 0;
custom-tab-bar/index.js
@@ -107,15 +107,11 @@ Component({ @@ -107,15 +107,11 @@ Component({
107 fontcolor:data.fontcolor, 107 fontcolor:data.fontcolor,
108 is_custum:1 108 is_custum:1
109 }) 109 })
110 - // console.log('abc=======<<<<<', this.data.list); 110 +
111 }, 111 },
112 112
113 nav_goto:function(e){ 113 nav_goto:function(e){
114 - // const data = e.currentTarget.dataset  
115 - // this.setData({  
116 - // active: data.index  
117 - // })  
118 - // console.log('active***********<<<<<', this.data.active); 114 +
119 var url=e.currentTarget.dataset.url; 115 var url=e.currentTarget.dataset.url;
120 if(!url) return false; 116 if(!url) return false;
121 if(url[0]!='/') url='/'+url; 117 if(url[0]!='/') url='/'+url;
@@ -123,18 +119,7 @@ Component({ @@ -123,18 +119,7 @@ Component({
123 getApp().goto(url); 119 getApp().goto(url);
124 }, 120 },
125 121
126 -  
127 - // switchTab(e) {  
128 - // const data = e.currentTarget.dataset  
129 - // const url = data.path  
130 - // wx.switchTab({url})  
131 - // this.setData({  
132 - // selected: data.index  
133 - // })  
134 - // }  
135 -  
136 122
137 -  
138 } 123 }
139 124
140 125
custom-tab-bar/index.wxml
@@ -4,9 +4,6 @@ @@ -4,9 +4,6 @@
4 <block wx:if="{{item.nav_name !== '分销' && item.weappurl != '/pages/distribution/distribution'}}"> 4 <block wx:if="{{item.nav_name !== '分销' && item.weappurl != '/pages/distribution/distribution'}}">
5 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}" 5 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
6 style="color: {{active==idx?fontcolor_sele:fontcolor}};"> 6 style="color: {{active==idx?fontcolor_sele:fontcolor}};">
7 - <!-- <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"  
8 - style="width:{{100 / list.length}}%;color: {{active==idx?fontcolor_sele:fontcolor}};"> -->  
9 - <!-- <view class="tabbar_item_wrapper"> -->  
10 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};"> 7 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
11 <view class="tab_img"> 8 <view class="tab_img">
12 <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view> 9 <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view>
@@ -23,8 +20,7 @@ @@ -23,8 +20,7 @@
23 <block wx:if="{{(item.nav_name === '分销' || item.weappurl === '/pages/distribution/distribution') && !is_no_distri}}"> 20 <block wx:if="{{(item.nav_name === '分销' || item.weappurl === '/pages/distribution/distribution') && !is_no_distri}}">
24 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}" 21 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
25 style="color: {{active==idx?fontcolor_sele:fontcolor}};"> 22 style="color: {{active==idx?fontcolor_sele:fontcolor}};">
26 - <!-- <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"  
27 - style="width:{{100 / list.length}}%;color: {{active==idx?fontcolor_sele:fontcolor}};"> --> 23 +
28 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};"> 24 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
29 <view class="tab_img"> 25 <view class="tab_img">
30 <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view> 26 <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
images/gt.png

1.72 KB | W: | H:

1.26 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/ct_num.png

3.63 KB | W: | H:

703 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/default_g_img.gif

7.54 KB | W: | H:

4.23 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/hui_hear_pic.png

5.13 KB | W: | H:

2.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/mackground.png

3.96 KB | W: | H:

1.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/miao_share.png

6.07 KB | W: | H:

3.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/q_tj.png

1.81 KB | W: | H:

364 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/s_gou.png

3.87 KB | W: | H:

2.22 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
images/share/share_bg.png

7.03 KB | W: | H:

1.57 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
packageA/pages/cart2_ser/cart2_ser.js
@@ -249,6 +249,11 @@ Page({ @@ -249,6 +249,11 @@ Page({
249 t.data.data.original_img = oo.imghost + t.data.data.imgUrl; 249 t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
250 t.data.data['buynum'] = gg.goods_num; 250 t.data.data['buynum'] = gg.goods_num;
251 t.data.data.shop_price = gd.money; 251 t.data.data.shop_price = gd.money;
  252 +
  253 + if(th.data.postdata.prom_type == 1) {
  254 + let postdata = th.data.postdata;
  255 + t.data.data.shop_price = postdata.prom_price;
  256 + };
252 257
253 th.setData({ 258 th.setData({
254 bn_goods: t.data.data, 259 bn_goods: t.data.data,
@@ -510,6 +515,12 @@ Page({ @@ -510,6 +515,12 @@ Page({
510 // 'price': th.data.formData.order_amount, 515 // 'price': th.data.formData.order_amount,
511 'pickup_id': gg.pick_id, 516 'pickup_id': gg.pick_id,
512 'pickup_keyid': gg.keyid, 517 'pickup_keyid': gg.keyid,
  518 + 'prom_type': this.data.postdata.prom_type, //促销活动类型
  519 + 'prom_id': this.data.postdata.prom_id, //促销活动id
  520 + };
  521 +
  522 + if(this.data.postdata.prom_type == 1) {
  523 + goods.price = this.data.postdata.prom_price;
513 }; 524 };
514 525
515 //--导购分享过来的id-- 526 //--导购分享过来的id--
@@ -525,6 +536,7 @@ Page({ @@ -525,6 +536,7 @@ Page({
525 } 536 }
526 }) 537 })
527 } 538 }
  539 + console.log('goooooooooooooooooods', goods);
528 item.list.push(goods); 540 item.list.push(goods);
529 } 541 }
530 542
packageA/pages/distribution/goods/goods.js
@@ -14,22 +14,19 @@ Page({ @@ -14,22 +14,19 @@ Page({
14 inputVal: '',//记录搜索输入框的内容 14 inputVal: '',//记录搜索输入框的内容
15 isSort: false,//控制排序开关状态,true开启排序 15 isSort: false,//控制排序开关状态,true开启排序
16 isDescending: false, //isDescending降序,ascending升序 16 isDescending: false, //isDescending降序,ascending升序
17 -  
18 -  
19 tabArr: [], 17 tabArr: [],
20 currentTabIndex: 0, 18 currentTabIndex: 0,
21 isShowRow: false,//控制视图切换状态 19 isShowRow: false,//控制视图切换状态
22 isHiddenDropdown: true,//控制筛选下拉菜单显隐 20 isHiddenDropdown: true,//控制筛选下拉菜单显隐
23 -  
24 list: null, 21 list: null,
25 isLoading: false, // 检测是否已经发送请求,防止重复发送请求 22 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
26 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 23 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
27 pageNum: 1, // 当前页数 24 pageNum: 1, // 当前页数
28 -  
29 isCheckAll: false, //记录是否全选 25 isCheckAll: false, //记录是否全选
30 currentQuery: { 26 currentQuery: {
31 store_id: app.globalData.setting.stoid, 27 store_id: app.globalData.setting.stoid,
32 }, 28 },
  29 + is_no_plus:1,
33 default_img: '/miniapp/images/default_g_img.gif', 30 default_img: '/miniapp/images/default_g_img.gif',
34 }, 31 },
35 32
@@ -67,6 +64,22 @@ Page({ @@ -67,6 +64,22 @@ Page({
67 options, 64 options,
68 tabArr, 65 tabArr,
69 }); 66 });
  67 +
  68 + //调用接口判断商家plus有没有过期
  69 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  70 + if (res.data.code == 0) {
  71 + var arr = res.data.data.pageData;
  72 + if (arr.length > 0) {
  73 + var item = arr[0];
  74 + if (item.is_sy == 0) {
  75 + var now = Date.parse(new Date()); now = now / 1000;
  76 + if (item.end_time < now) {
  77 + self.setData({ is_no_plus: 0 })
  78 + }
  79 + }
  80 + }
  81 + }
  82 + })
70 83
71 84
72 85
packageA/pages/distribution/goods/goods.wxml
@@ -5,12 +5,12 @@ @@ -5,12 +5,12 @@
5 <!-- 搜索 --> 5 <!-- 搜索 -->
6 <view class="flex ai-center fs26 bg-white pd20"> 6 <view class="flex ai-center fs26 bg-white pd20">
7 <view class="input-container f1"> 7 <view class="input-container f1">
8 - <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" confirm-type="search" bindconfirm="search"/> 8 + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" confirm-type="search" bindconfirm="search" />
9 <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text> 9 <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
10 <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 --> 10 <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
11 </view> 11 </view>
12 <view class="pd20 filter {{isHiddenDropdown ? '':'c-red'}}" bindtap="clickFilter">筛选</view> 12 <view class="pd20 filter {{isHiddenDropdown ? '':'c-red'}}" bindtap="clickFilter">筛选</view>
13 - 13 +
14 <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}"> 14 <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}">
15 <view class="dropdown-wrapper"> 15 <view class="dropdown-wrapper">
16 <view class="pd20 bsbb" wx:if="{{nationList.length != 0}}"> 16 <view class="pd20 bsbb" wx:if="{{nationList.length != 0}}">
@@ -28,9 +28,9 @@ @@ -28,9 +28,9 @@
28 <view class="pd20 bsbb"> 28 <view class="pd20 bsbb">
29 <view class="pdb20">价格区间</view> 29 <view class="pdb20">价格区间</view>
30 <view class="flex t-c ai-center jc-center"> 30 <view class="flex t-c ai-center jc-center">
31 - <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最低价" class="input-price" bindinput="getPrice" data-ismax="0"/></view> 31 + <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最低价" class="input-price" bindinput="getPrice" data-ismax="0" /></view>
32 <view class="mgh20">-</view> 32 <view class="mgh20">-</view>
33 - <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最高价" class="input-price" bindinput="getPrice" data-ismax="1"/></view> 33 + <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最高价" class="input-price" bindinput="getPrice" data-ismax="1" /></view>
34 <!-- <view class="w25 pdt20"><text class="label">品牌一</text></view> --> 34 <!-- <view class="w25 pdt20"><text class="label">品牌一</text></view> -->
35 </view> 35 </view>
36 </view> 36 </view>
@@ -50,12 +50,12 @@ @@ -50,12 +50,12 @@
50 </view> 50 </view>
51 <view class="mask" bindtap="clickMask"></view> 51 <view class="mask" bindtap="clickMask"></view>
52 </view> 52 </view>
53 -  
54 - 53 +
  54 +
55 <view class="flex t-c fs26 bg-white bdb" bindtap="clickTab"> 55 <view class="flex t-c fs26 bg-white bdb" bindtap="clickTab">
56 <block wx:for="{{tabArr}}"> 56 <block wx:for="{{tabArr}}">
57 <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">{{item}}</view> 57 <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">{{item}}</view>
58 - <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort"> 58 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort">
59 {{item}}<text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}" data-index="{{index}}"></text> 59 {{item}}<text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}" data-index="{{index}}"></text>
60 <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" data-index="{{index}}" wx:else></text> 60 <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" data-index="{{index}}" wx:else></text>
61 </view> 61 </view>
@@ -64,287 +64,291 @@ @@ -64,287 +64,291 @@
64 <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text> 64 <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>
65 </view> 65 </view>
66 </view> 66 </view>
67 - 67 +
68 </view> 68 </view>
69 -  
70 - 69 +
  70 +
71 <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}"> 71 <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}">
72 <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange"> 72 <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange">
73 <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}"> 73 <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}">
74 <!-- <label> 74 <!-- <label>
75 75
76 </label> --> 76 </label> -->
77 - <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> 77 + <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}" />
78 <view class="flex pdl10" bindtap="goto" data-url="{{g_filter.get_goods_url(item)}}"> 78 <view class="flex pdl10" bindtap="goto" data-url="{{g_filter.get_goods_url(item)}}">
79 - <view class="pdr20"><image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load/></view> 79 + <view class="pdr20">
  80 + <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load />
  81 + </view>
80 <view class="flex fdc jc_sb"> 82 <view class="flex fdc jc_sb">
81 <view class="ellipsis-2">{{item.goods_name}}</view> 83 <view class="ellipsis-2">{{item.goods_name}}</view>
82 <view> 84 <view>
83 <!-- 判断是否有活动价 --> 85 <!-- 判断是否有活动价 -->
84 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}"> 86 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
85 - <view class="flex xc-wc ai-center" >  
86 - <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>  
87 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
88 - <!-- 活动价 -->  
89 - <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">  
90 - <!-- <view class="fs24">¥</view> -->  
91 - <view class="fs30 money">{{item.prom_price}}</view>  
92 - </view>  
93 - </view>  
94 - <view class="flex" style="line-height: 28rpx;">  
95 - <!-- 原价 -->  
96 - <view class="price flex xc-ash line_th">  
97 - <!-- <view class="fs22">¥</view> -->  
98 - <view class="fs22 money">{{item.market_price}}</view>  
99 - </view>  
100 - </view> 87 + <view class="flex xc-wc ai-center">
  88 + <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>
  89 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  90 + <!-- 活动价 -->
  91 + <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">
  92 + <!-- <view class="fs24">¥</view> -->
  93 + <view class="fs30 money">{{item.prom_price}}</view>
  94 + </view>
  95 + </view>
  96 + <view class="flex" style="line-height: 28rpx;">
  97 + <!-- 原价 -->
  98 + <view class="price flex xc-ash line_th">
  99 + <!-- <view class="fs22">¥</view> -->
  100 + <view class="fs22 money">{{item.market_price}}</view>
  101 + </view>
  102 + </view>
101 </block> 103 </block>
102 <block wx:else> 104 <block wx:else>
103 - <!-- 商品价格,先判断下是后⼜等级价-->  
104 - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">  
105 - <!-- 当会员是等级卡的时候 -->  
106 - <block wx:if="{{card_field}}">  
107 - <!-- 等级价>0 -->  
108 - <block wx:if="{{item[card_field]>0}}">  
109 - <view class="flex">  
110 - <!-- 办卡价 -->  
111 - <view class="flex xc-wc ai-center">  
112 - <!-- <view class="fs24">¥</view> -->  
113 - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>  
114 - <view class="card_bg">  
115 - <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}"></image>  
116 - <text class="card_name ellipsis-1">{{card_name}}</text>  
117 - </view>  
118 - </view>  
119 - </view>  
120 - <view class="flex" style="line-height: 28rpx;">  
121 - <!-- 原价 -->  
122 - <view class="price flex xc-ash line_th">  
123 - <!-- <view class="fs22">¥</view> -->  
124 - <view class="fs22 money">{{item.market_price}}</view>  
125 - </view>  
126 - </view>  
127 - </block>  
128 - <blocK wx:else>  
129 - <view class="flex">  
130 - <!-- 办卡价 -->  
131 - <view class="flex xc-wc ai-center">  
132 - <!-- <view class="fs24">¥</view> -->  
133 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
134 - </view>  
135 - </view>  
136 - <view class="flex" style="line-height: 28rpx;">  
137 - <!-- 原价 -->  
138 - <view class="price flex xc-ash line_th">  
139 - <!-- <view class="fs22">¥</view> -->  
140 - <view class="fs22 money">{{item.market_price}}</view>  
141 - </view>  
142 - </view>  
143 - </blocK>  
144 - </block>  
145 - <block wx:else>  
146 - <!-- 如果商品有设置等级价⼤于0的 -->  
147 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">  
148 - <view class="flex">  
149 - <!-- 办卡价 -->  
150 - <view class="flex xc-wc ai-center">  
151 - <!-- <view class="fs24">¥</view> -->  
152 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
153 - </view>  
154 - <!-- 原价 -->  
155 - <view class="price flex xc-ash line_th">  
156 - <!-- <view class="fs22">¥</view> -->  
157 - <view class="fs22 money">{{item.market_price}}</view>  
158 - </view>  
159 - </view>  
160 - <view class="flexr">  
161 - <!-- 等级价 -->  
162 - <view class="price flex ai-center">  
163 - <!-- <view class="fs22">¥</view> -->  
164 - <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>  
165 - <view class="card_bg">  
166 - <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}" class="badge"></ image>  
167 - <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>  
168 - </view>  
169 - </view>  
170 - </view>  
171 - </block>  
172 - <block wx:else>  
173 - <view class="flex">  
174 - <!-- 办卡价 -->  
175 - <view class="flex xc-wc ai-center">  
176 - <!-- <view class="fs24">¥</view> -->  
177 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
178 - </view>  
179 - </view>  
180 - <view class="flex" style="line-height: 28rpx;">  
181 - <!-- 原价 -->  
182 - <view class="price flex xc-ash line_th">  
183 - <!-- <view class="fs22">¥</view> -->  
184 - <view class="fs22 money">{{item.market_price}}</view>  
185 - </view>  
186 - </view>  
187 - </block>  
188 - </block>  
189 - </block>  
190 - <!-- 商品压根就没有等级价 -->  
191 - <block wx:else>  
192 - <view class="flex">  
193 - <!-- 办卡价 -->  
194 - <view class="flex xc-wc ai-center">  
195 - <!-- <view class="fs24">¥</view> -->  
196 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
197 - </view>  
198 - </view>  
199 - <view class="flex" style="line-height: 28rpx;">  
200 - <!-- 原价 -->  
201 - <view class="price flex xc-ash line_th">  
202 - <!-- <view class="fs22">¥</view> -->  
203 - <view class="fs22 money">{{item.market_price}}</view>  
204 - </view>  
205 - </view>  
206 - </block> 105 + <!-- 商品价格,先判断下是后⼜等级价-->
  106 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  107 + <!-- 当会员是等级卡的时候 -->
  108 + <block wx:if="{{card_field}}">
  109 + <!-- 等级价>0 -->
  110 + <block wx:if="{{item[card_field]>0}}">
  111 + <view class="flex">
  112 + <!-- 办卡价 -->
  113 + <view class="flex xc-wc ai-center">
  114 + <!-- <view class="fs24">¥</view> -->
  115 + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>
  116 + <view class="card_bg">
  117 + <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}"></image>
  118 + <text class="card_name ellipsis-1">{{card_name}}</text>
  119 + </view>
  120 + </view>
  121 + </view>
  122 + <view class="flex" style="line-height: 28rpx;">
  123 + <!-- 原价 -->
  124 + <view class="price flex xc-ash line_th">
  125 + <!-- <view class="fs22">¥</view> -->
  126 + <view class="fs22 money">{{item.market_price}}</view>
  127 + </view>
  128 + </view>
  129 + </block>
  130 + <blocK wx:else>
  131 + <view class="flex">
  132 + <!-- 办卡价 -->
  133 + <view class="flex xc-wc ai-center">
  134 + <!-- <view class="fs24">¥</view> -->
  135 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  136 + </view>
  137 + </view>
  138 + <view class="flex" style="line-height: 28rpx;">
  139 + <!-- 原价 -->
  140 + <view class="price flex xc-ash line_th">
  141 + <!-- <view class="fs22">¥</view> -->
  142 + <view class="fs22 money">{{item.market_price}}</view>
  143 + </view>
  144 + </view>
  145 + </blocK>
  146 + </block>
  147 + <block wx:else>
  148 + <!-- 如果商品有设置等级价⼤于0的 -->
  149 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
  150 + <view class="flex">
  151 + <!-- 办卡价 -->
  152 + <view class="flex xc-wc ai-center">
  153 + <!-- <view class="fs24">¥</view> -->
  154 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  155 + </view>
  156 + <!-- 原价 -->
  157 + <view class="price flex xc-ash line_th">
  158 + <!-- <view class="fs22">¥</view> -->
  159 + <view class="fs22 money">{{item.market_price}}</view>
  160 + </view>
  161 + </view>
  162 + <view class="flexr">
  163 + <!-- 等级价 -->
  164 + <view class="price flex ai-center">
  165 + <!-- <view class="fs22">¥</view> -->
  166 + <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  167 + <view class="card_bg">
  168 + <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}" class="badge">
  169 + </ image>
  170 + <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>
  171 + </view>
  172 + </view>
  173 + </view>
  174 + </block>
  175 + <block wx:else>
  176 + <view class="flex">
  177 + <!-- 办卡价 -->
  178 + <view class="flex xc-wc ai-center">
  179 + <!-- <view class="fs24">¥</view> -->
  180 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  181 + </view>
  182 + </view>
  183 + <view class="flex" style="line-height: 28rpx;">
  184 + <!-- 原价 -->
  185 + <view class="price flex xc-ash line_th">
  186 + <!-- <view class="fs22">¥</view> -->
  187 + <view class="fs22 money">{{item.market_price}}</view>
  188 + </view>
  189 + </view>
  190 + </block>
  191 + </block>
  192 + </block>
  193 + <!-- 商品压根就没有等级价 -->
  194 + <block wx:else>
  195 + <view class="flex">
  196 + <!-- 办卡价 -->
  197 + <view class="flex xc-wc ai-center">
  198 + <!-- <view class="fs24">¥</view> -->
  199 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  200 + </view>
  201 + </view>
  202 + <view class="flex" style="line-height: 28rpx;">
  203 + <!-- 原价 -->
  204 + <view class="price flex xc-ash line_th">
  205 + <!-- <view class="fs22">¥</view> -->
  206 + <view class="fs22 money">{{item.market_price}}</view>
  207 + </view>
  208 + </view>
  209 + </block>
207 </block> 210 </block>
208 <!-- <view class="money fs32 c-red">{{item.market_price}}</view> --> 211 <!-- <view class="money fs32 c-red">{{item.market_price}}</view> -->
209 <view class="fs24 c-a">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view> 212 <view class="fs24 c-a">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view>
210 </view> 213 </view>
211 </view> 214 </view>
212 </view> 215 </view>
213 - </view> 216 + </view>
214 </checkbox-group> 217 </checkbox-group>
215 -  
216 - <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else> 218 +
  219 + <checkbox-group class="fs26 flex pd16 wrap" catchchange="checkboxChange" wx:else>
217 <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{g_filter.get_goods_url(item)}}"> 220 <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{g_filter.get_goods_url(item)}}">
218 - <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load/> 221 + <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" mode="aspectFit" lazy-load />
219 <view class="pd20 fs26 flex jc_sb fdc f1"> 222 <view class="pd20 fs26 flex jc_sb fdc f1">
220 <view class="ellipsis-2">{{item.goods_name}}</view> 223 <view class="ellipsis-2">{{item.goods_name}}</view>
221 <view class="flex ai-center pdt20"> 224 <view class="flex ai-center pdt20">
222 - <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"/> 225 + <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}" />
223 <view> 226 <view>
224 <!-- 判断是否有活动价 --> 227 <!-- 判断是否有活动价 -->
225 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}"> 228 <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}">
226 - <view class="flex xc-wc ai-center" >  
227 - <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>  
228 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
229 - <!-- 活动价 -->  
230 - <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">  
231 - <!-- <view class="fs24">¥</view> -->  
232 - <view class="fs30 money">{{item.prom_price}}</view>  
233 - </view>  
234 - </view>  
235 - <view class="flex" style="line-height: 28rpx;">  
236 - <!-- 原价 -->  
237 - <view class="price flex xc-ash line_th">  
238 - <!-- <view class="fs22">¥</view> -->  
239 - <view class="fs22 money">{{item.market_price}}</view>  
240 - </view>  
241 - </view> 229 + <view class="flex xc-wc ai-center">
  230 + <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>
  231 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  232 + <!-- 活动价 -->
  233 + <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">
  234 + <!-- <view class="fs24">¥</view> -->
  235 + <view class="fs30 money">{{item.prom_price}}</view>
  236 + </view>
  237 + </view>
  238 + <view class="flex" style="line-height: 28rpx;">
  239 + <!-- 原价 -->
  240 + <view class="price flex xc-ash line_th">
  241 + <!-- <view class="fs22">¥</view> -->
  242 + <view class="fs22 money">{{item.market_price}}</view>
  243 + </view>
  244 + </view>
242 </block> 245 </block>
243 <block wx:else> 246 <block wx:else>
244 - <!-- 商品价格,先判断下是后⼜等级价-->  
245 - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">  
246 - <!-- 当会员是等级卡的时候 -->  
247 - <block wx:if="{{card_field}}">  
248 - <!-- 等级价>0 -->  
249 - <block wx:if="{{item[card_field]>0}}">  
250 - <view class="flex">  
251 - <!-- 办卡价 -->  
252 - <view class="flex xc-wc ai-center">  
253 - <!-- <view class="fs24">¥</view> -->  
254 - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>  
255 - <view class="card_bg">  
256 - <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}" class="badge"></image>  
257 - <text class="card_name ellipsis-1">{{card_name}}</text>  
258 - </view>  
259 - </view>  
260 - </view>  
261 - <view class="flex" style="line-height: 28rpx;">  
262 - <!-- 原价 -->  
263 - <view class="price flex xc-ash line_th">  
264 - <!-- <view class="fs22">¥</view> -->  
265 - <view class="fs22 money">{{item.market_price}}</view>  
266 - </view>  
267 - </view>  
268 - </block>  
269 - <blocK wx:else>  
270 - <view class="flex">  
271 - <!-- 办卡价 -->  
272 - <view class="flex xc-wc ai-center">  
273 - <!-- <view class="fs24">¥</view> -->  
274 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
275 - </view>  
276 - </view>  
277 - <view class="flex" style="line-height: 28rpx;">  
278 - <!-- 原价 -->  
279 - <view class="price flex xc-ash line_th">  
280 - <!-- <view class="fs22">¥</view> -->  
281 - <view class="fs22 money">{{item.market_price}}</view>  
282 - </view>  
283 - </view>  
284 - </blocK>  
285 - </block>  
286 - <block wx:else>  
287 - <!-- 如果商品有设置等级价⼤于0的 -->  
288 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">  
289 - <view class="flex">  
290 - <!-- 办卡价 -->  
291 - <view class="flex xc-wc ai-center">  
292 - <!-- <view class="fs24">¥</view> -->  
293 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
294 - </view>  
295 - <!-- 原价 -->  
296 - <view class="price flex xc-ash line_th">  
297 - <!-- <view class="fs22">¥</view> -->  
298 - <view class="fs22 money">{{item.market_price}}</view>  
299 - </view>  
300 - </view>  
301 - <view class="flexr" style="">  
302 - <!-- 等级价 -->  
303 - <view class="price flex ai-center">  
304 - <!-- <view class="fs22">¥</view> -->  
305 - <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>  
306 - <view class="card_bg">  
307 - <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}"></ image> 247 + <!-- 商品价格,先判断下是后⼜等级价-->
  248 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  249 + <!-- 当会员是等级卡的时候 -->
  250 + <block wx:if="{{card_field}}">
  251 + <!-- 等级价>0 -->
  252 + <block wx:if="{{item[card_field]>0}}">
  253 + <view class="flex">
  254 + <!-- 办卡价 -->
  255 + <view class="flex xc-wc ai-center">
  256 + <!-- <view class="fs24">¥</view> -->
  257 + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>
  258 + <view class="card_bg">
  259 + <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}" class="badge"></image>
  260 + <text class="card_name ellipsis-1">{{card_name}}</text>
  261 + </view>
  262 + </view>
  263 + </view>
  264 + <view class="flex" style="line-height: 28rpx;">
  265 + <!-- 原价 -->
  266 + <view class="price flex xc-ash line_th">
  267 + <!-- <view class="fs22">¥</view> -->
  268 + <view class="fs22 money">{{item.market_price}}</view>
  269 + </view>
  270 + </view>
  271 + </block>
  272 + <blocK wx:else>
  273 + <view class="flex">
  274 + <!-- 办卡价 -->
  275 + <view class="flex xc-wc ai-center">
  276 + <!-- <view class="fs24">¥</view> -->
  277 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  278 + </view>
  279 + </view>
  280 + <view class="flex" style="line-height: 28rpx;">
  281 + <!-- 原价 -->
  282 + <view class="price flex xc-ash line_th">
  283 + <!-- <view class="fs22">¥</view> -->
  284 + <view class="fs22 money">{{item.market_price}}</view>
  285 + </view>
  286 + </view>
  287 + </blocK>
  288 + </block>
  289 + <block wx:else>
  290 + <!-- 如果商品有设置等级价⼤于0的 -->
  291 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
  292 + <view class="flex">
  293 + <!-- 办卡价 -->
  294 + <view class="flex xc-wc ai-center">
  295 + <!-- <view class="fs24">¥</view> -->
  296 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  297 + </view>
  298 + <!-- 原价 -->
  299 + <view class="price flex xc-ash line_th">
  300 + <!-- <view class="fs22">¥</view> -->
  301 + <view class="fs22 money">{{item.market_price}}</view>
  302 + </view>
  303 + </view>
  304 + <view class="flexr">
  305 + <!-- 等级价 -->
  306 + <view class="price flex ai-center">
  307 + <!-- <view class="fs22">¥</view> -->
  308 + <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  309 + <view class="card_bg">
  310 + <image src="{{imghost + 'miniapp/images/plus/dj_icon.png'}}">
  311 + </ image>
308 <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text> 312 <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>
309 - </view>  
310 </view> 313 </view>
311 - </view>  
312 - </block>  
313 - <block wx:else>  
314 - <view class="flex">  
315 - <!-- 办卡价 -->  
316 - <view class="flex xc-wc ai-center">  
317 - <!-- <view class="fs24">¥</view> -->  
318 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
319 - </view>  
320 - </view>  
321 - <view class="flex" style="line-height: 28rpx;">  
322 - <!-- 原价 -->  
323 - <view class="price flex xc-ash line_th">  
324 - <!-- <view class="fs22">¥</view> -->  
325 - <view class="fs22 money">{{item.market_price}}</view>  
326 - </view>  
327 - </view>  
328 - </block>  
329 - </block>  
330 - </block>  
331 - <!-- 商品压根就没有等级价 -->  
332 - <block wx:else>  
333 - <view class="flex">  
334 - <!-- 办卡价 -->  
335 - <view class="flex xc-wc ai-center">  
336 - <!-- <view class="fs24">¥</view> -->  
337 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
338 - </view>  
339 - </view>  
340 - <view class="flex" style="line-height: 28rpx;">  
341 - <!-- 原价 -->  
342 - <view class="price flex xc-ash line_th">  
343 - <!-- <view class="fs22">¥</view> -->  
344 - <view class="fs22 money">{{item.market_price}}</view>  
345 - </view>  
346 - </view>  
347 - </block> 314 + </view>
  315 + </view>
  316 + </block>
  317 + <block wx:else>
  318 + <view class="flex">
  319 + <!-- 办卡价 -->
  320 + <view class="flex xc-wc ai-center">
  321 + <!-- <view class="fs24">¥</view> -->
  322 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  323 + </view>
  324 + </view>
  325 + <view class="flex" style="line-height: 28rpx;">
  326 + <!-- 原价 -->
  327 + <view class="price flex xc-ash line_th">
  328 + <!-- <view class="fs22">¥</view> -->
  329 + <view class="fs22 money">{{item.market_price}}</view>
  330 + </view>
  331 + </view>
  332 + </block>
  333 + </block>
  334 + </block>
  335 + <!-- 商品压根就没有等级价 -->
  336 + <block wx:else>
  337 + <view class="flex">
  338 + <!-- 办卡价 -->
  339 + <view class="flex xc-wc ai-center">
  340 + <!-- <view class="fs24">¥</view> -->
  341 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  342 + </view>
  343 + </view>
  344 + <view class="flex" style="line-height: 28rpx;">
  345 + <!-- 原价 -->
  346 + <view class="price flex xc-ash line_th">
  347 + <!-- <view class="fs22">¥</view> -->
  348 + <view class="fs22 money">{{item.market_price}}</view>
  349 + </view>
  350 + </view>
  351 + </block>
348 </block> 352 </block>
349 <!-- <view class="money c-red fs32">{{item.market_price}}</view> --> 353 <!-- <view class="money c-red fs32">{{item.market_price}}</view> -->
350 <view class="c-a fs24">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view> 354 <view class="c-a fs24">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view>
@@ -353,25 +357,17 @@ @@ -353,25 +357,17 @@
353 </view> 357 </view>
354 </view> 358 </view>
355 </checkbox-group> 359 </checkbox-group>
356 - 360 +
357 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata> 361 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
358 <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view> 362 <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
359 </view> 363 </view>
360 -  
361 -  
362 -  
363 -  
364 -  
365 <view class="bottomBar flex pd20 jc_sb fs26 ai-center" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}"> 364 <view class="bottomBar flex pd20 jc_sb fs26 ai-center" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}">
366 <!-- <view> --> 365 <!-- <view> -->
367 - <label class="flex ai-center" bindtap="clickCheckAll" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}">  
368 - <checkbox checked="{{isCheckAll}}"/>全选  
369 - </label> 366 + <label class="flex ai-center" bindtap="clickCheckAll" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}">
  367 + <checkbox checked="{{isCheckAll}}" />全选
  368 + </label>
370 <!-- </view> --> 369 <!-- </view> -->
371 <view class="pd20 btn" wx:if="{{options.index == 0}}" bindtap="putOn">一键上架</view> 370 <view class="pd20 btn" wx:if="{{options.index == 0}}" bindtap="putOn">一键上架</view>
372 <view class="pd20 btn" wx:else bindtap="pullOff">一键下架</view> 371 <view class="pd20 btn" wx:else bindtap="pullOff">一键下架</view>
373 </view> 372 </view>
374 -  
375 -  
376 -  
377 -</view> 373 +</view>
378 \ No newline at end of file 374 \ No newline at end of file
packageA/pages/distribution/shop/shop.js
@@ -17,26 +17,21 @@ Page({ @@ -17,26 +17,21 @@ Page({
17 isDescending: false, //isDescending降序,ascending升序 17 isDescending: false, //isDescending降序,ascending升序
18 imghost: '', 18 imghost: '',
19 url: os.imghost, 19 url: os.imghost,
20 -  
21 tabArr: ['最新', '销量', '评论', '价格'], 20 tabArr: ['最新', '销量', '评论', '价格'],
22 currentTabIndex: 0, 21 currentTabIndex: 0,
23 isShowRow: false,//控制视图切换状态 22 isShowRow: false,//控制视图切换状态
24 isHiddenDropdown: true,//控制筛选下拉菜单显隐 23 isHiddenDropdown: true,//控制筛选下拉菜单显隐
25 -  
26 list: [], 24 list: [],
27 isLoading: false, // 检测是否已经发送请求,防止重复发送请求 25 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
28 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 26 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
29 pageNum: 1, // 当前页数 27 pageNum: 1, // 当前页数
30 -  
31 -  
32 rank_switch: false, 28 rank_switch: false,
33 card_field: "", 29 card_field: "",
34 card_name: "", 30 card_name: "",
35 max_card_field: "", 31 max_card_field: "",
36 card_list: null, 32 card_list: null,
37 -  
38 isAll: true, 33 isAll: true,
39 - 34 + is_no_plus:1,
40 default_img: '/miniapp/images/default_g_img.gif', 35 default_img: '/miniapp/images/default_g_img.gif',
41 }, 36 },
42 37
@@ -213,6 +208,21 @@ Page({ @@ -213,6 +208,21 @@ Page({
213 }) 208 })
214 } 209 }
215 }) 210 })
  211 + //调用接口判断商家plus有没有过期
  212 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  213 + if (res.data.code == 0) {
  214 + var arr = res.data.data.pageData;
  215 + if (arr.length > 0) {
  216 + var item = arr[0];
  217 + if (item.is_sy == 0) {
  218 + var now = Date.parse(new Date()); now = now / 1000;
  219 + if (item.end_time < now) {
  220 + th.setData({ is_no_plus: 0 })
  221 + }
  222 + }
  223 + }
  224 + }
  225 + })
216 } 226 }
217 227
218 if (app.globalData.key_word) { 228 if (app.globalData.key_word) {
packageA/pages/distribution/shop/shop.wxml
1 <wxs src="../../../../utils/filter.wxs" module="filter"></wxs> 1 <wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
2 <wxs module="g_filter" src="g_filter.wxs"></wxs> 2 <wxs module="g_filter" src="g_filter.wxs"></wxs>
3 <view> 3 <view>
4 - <view class="head pr">  
5 - <view class="bdb">  
6 - <!-- <view><image src="../../../images/jfbuy.jpg" mode="widthFix" class="banner"/></view> -->  
7 - <view>  
8 - <image src="{{imghost + (ad_img ? ad_img:'/miniapp/images/user_index_powder.jpg')}}" mode="widthFix" class="banner" />  
9 - </view>  
10 - <view class="flex bg-white pdh20 jc_sb pr">  
11 - <!-- 分享人的头像 -->  
12 - <view class="avatar-container" wx:if="{{userInfo2}}">  
13 - <image class="avatar" src="{{userInfo2.head_pic}}" />  
14 - <view class="pdt20">  
15 - <text class="nickname">{{userInfo2.nickname}}</text>  
16 - </view>  
17 - </view>  
18 - <!-- 自己的头像 -->  
19 - <view class="avatar-container" wx:else>  
20 - <image class="avatar" src="{{userInfo.head_pic}}" />  
21 - <view class="pdt20">  
22 - <text class="nickname">{{userInfo.nickname}}</text>  
23 - </view>  
24 - </view>  
25 - <view class="flex t-c fs24 f1 jc_fe">  
26 - <view class="pdv20 pdh40 {{isAll ? 'selected':''}}" bindtap="clickAll">  
27 - <view class="fs30">{{filter.show_default(total)}}</view>  
28 - <view>全部商品</view>  
29 - </view>  
30 - <view class="pdv20 pdh40 {{!isAll ? 'selected':''}}" bindtap="clickNew">  
31 - <view class="fs30">{{filter.show_default(newListTotal)}}</view>  
32 - <view>新品</view>  
33 - </view>  
34 - <view class="pdv20 pdh40" bindtap="goto" data-url="/pages/user/index/index">  
35 - <view class="fs26">  
36 - <text class="iconfont icon-ren1 bold"></text>  
37 - </view>  
38 - <view>会员中心</view>  
39 - </view>  
40 - </view>  
41 - </view>  
42 - </view>  
43 - <!-- 搜索 -->  
44 - <view class="flex ai-center fs26 bg-white pd20">  
45 - <text class="pdr20 c-a iconfont icon-fenlei" catch:tap="goto" data-url="/packageC/pages/goods/distributionCategoryList/index"></text>  
46 - <view class="input-container f1">  
47 - <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" placeholder-style="color:#aaa;" confirm-type="search" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" bindconfirm="search" />  
48 - <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>  
49 - <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->  
50 - </view>  
51 - <view class="pdl20 c-a" bindtap="search">搜索</view>  
52 - </view>  
53 - </view>  
54 - <view class="flex t-c fs26 bg-white bdb sticky c-a" catchtap="clickTab">  
55 - <block wx:for="{{tabArr}}">  
56 - <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">  
57 - {{item}}  
58 - </view>  
59 - <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort">  
60 - {{item}}  
61 - <text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}"></text>  
62 - <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" wx:else></text>  
63 - </view>  
64 - </block>  
65 - <view class="f1 pd20" catchtap="change">  
66 - <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>  
67 - </view>  
68 - </view>  
69 - <view class="content">  
70 - <view class="fs26" wx:if="{{isShowRow}}">  
71 - <view class="item bg-white flex ai-center pd20" wx:for="{{list}}">  
72 - <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">  
73 - <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}">  
74 - <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" />  
75 - </view>  
76 - <view class="flex fdc jc_sb">  
77 - <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>  
78 - <!-- 判断是否有活动价 -->  
79 - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">  
80 - <view class="flex xc-wc pdt20">  
81 - <text wx:if="{{item.prom_integral}}">  
82 - <text class="fs30">{{item.prom_integral}}</text>  
83 - 积分  
84 - </text>  
85 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
86 - <!-- 活动价 -->  
87 - <view class="flex xc-wc ai_and" wx:if="{{item.prom_price}}">  
88 - <!-- <view class="fs24">¥</view> -->  
89 - <view class="fs30 money">{{item.prom_price}}</view>  
90 - </view>  
91 - </view>  
92 - <view class="flex" style="line-height: 28rpx;">  
93 - <!-- 原价 -->  
94 - <view class="price flex xc-ash line_th">  
95 - <!-- <view class="fs22">¥</view> -->  
96 - <view class="fs22 money">{{item.market_price}}</view>  
97 - </view>  
98 - </view>  
99 - </block>  
100 - <block wx:else>  
101 - <!-- 商品价格,先判断下是后⼜等级价 -->  
102 - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">  
103 - <!-- 当会员是等级卡的时候 -->  
104 - <block wx:if="{{card_field}}">  
105 - <!-- 等级价>0 -->  
106 - <block wx:if="{{item[card_field]>0}}">  
107 - <view class="flex">  
108 - <!-- 办卡价 -->  
109 - <view class="flex xc-wc ai_and">  
110 - <!-- <view class="fs24">¥</view> -->  
111 - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>  
112 - <view class="card_bg">  
113 - <image src="{{url + 'miniapp/images/plus/dj_icon.png'}}" />  
114 - <text class="card_name ellipsis-1">{{card_name}}</text>  
115 - </view>  
116 - </view>  
117 - </view>  
118 - <view class="flex" style="line-height: 28rpx;">  
119 - <!-- 原价 -->  
120 - <view class="price flex xc-ash line_th">  
121 - <!-- <view class="fs22">¥</view> -->  
122 - <view class="fs22 money">{{item.market_price}}</view>  
123 - </view>  
124 - </view>  
125 - </block>  
126 - <blocK wx:else>  
127 - <view class="flex">  
128 - <!-- 办卡价 -->  
129 - <view class="flex xc-wc">  
130 - <!-- <view class="fs24">¥</view> -->  
131 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
132 - </view>  
133 - </view>  
134 - <view class="flex" style="line-height: 28rpx;">  
135 - <!-- 原价 -->  
136 - <view class="price flex xc-ash line_th">  
137 - <!-- <view class="fs22">¥</view> -->  
138 - <view class="fs22 money">{{item.market_price}}</view>  
139 - </view>  
140 - </view>  
141 - </blocK>  
142 - </block>  
143 - <block wx:else>  
144 - <!-- 如果商品有设置等级价⼤于0的 -->  
145 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">  
146 - <view class="flex">  
147 - <!-- 办卡价 -->  
148 - <view class="flex xc-wc">  
149 - <!-- <view class="fs24">¥</view> -->  
150 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
151 - </view>  
152 - <!-- 原价 -->  
153 - <view class="price flex xc-ash line_th">  
154 - <!-- <view class="fs22">¥</view> -->  
155 - <view class="fs22 money">{{item.market_price}}</view>  
156 - </view>  
157 - </view>  
158 - <view class="flexr" style="">  
159 - <!-- 等级价 -->  
160 - <view class="price flex ai-center">  
161 - <!-- <view class="fs22">¥</view> -->  
162 - <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>  
163 - <view class="card_bg">  
164 - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>  
165 - <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}} </text>  
166 - </view>  
167 - </view>  
168 - </view>  
169 - </block>  
170 - <block wx:else>  
171 - <view class="flex">  
172 - <!-- 办卡价 -->  
173 - <view class="flex xc-wc">  
174 - <!-- <view class="fs24">¥</view> -->  
175 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
176 - </view>  
177 - </view>  
178 - <view class="flex" style="line-height: 28rpx;">  
179 - <!-- 原价 -->  
180 - <view class="price flex xc-ash line_th">  
181 - <!-- <view class="fs22">¥</view> -->  
182 - <view class="fs22 money">{{item.market_price}}</view>  
183 - </view>  
184 - </view>  
185 - </block>  
186 - </block>  
187 - </block>  
188 - <!-- 商品压根就没有等级价 -->  
189 - <block wx:else>  
190 - <view class="flex">  
191 - <!-- 办卡价 -->  
192 - <view class="flex xc-wc">  
193 - <!-- <view class="fs24">¥</view> -->  
194 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
195 - </view>  
196 - </view>  
197 - <view class="flex" style="line-height: 28rpx;">  
198 - <!-- 原价 -->  
199 - <view class="price flex xc-ash line_th">  
200 - <!-- <view class="fs22">¥</view> -->  
201 - <view class="fs22 money">{{item.market_price}}</view>  
202 - </view>  
203 - </view>  
204 - </block>  
205 - </block>  
206 - <!-- 分层金额 -->  
207 - <view hidden="{{ishidden_comise}}" class="fs24 c-a">  
208 - 分成金额:  
209 - <text class="money c-red">{{filter.toFix(item.commission,2)}}</text>  
210 - </view>  
211 - </view>  
212 - </view>  
213 - </view>  
214 - </view>  
215 - <view class="fs26 flex pd20 wrap" wx:else>  
216 - <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">  
217 - <view class="img-container" data-txt="已售:{{item.sales_sum}}">  
218 - <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" />  
219 - </view>  
220 - <view class="pd20 fs26">  
221 - <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>  
222 - <!-- 判断是否有活动价 -->  
223 - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">  
224 - <view class="flex xc-wc">  
225 - <text wx:if="{{item.prom_integral}}">  
226 - <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text>  
227 - 积分  
228 - </text>  
229 - <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>  
230 - <!-- 活动价 -->  
231 - <view class="flex xc-wc" wx:if="{{item.prom_price}}">  
232 - <!-- <view class="fs24">¥</view> -->  
233 - <view class="fs30 money">{{item.prom_price}}</view>  
234 - </view>  
235 - </view>  
236 - <view class="flex" style="line-height: 28rpx;">  
237 - <!-- 原价 -->  
238 - <view class="price flex xc-ash line_th">  
239 - <!-- <view class="fs22">¥</view> -->  
240 - <view class="fs22 money">{{item.market_price}}</view>  
241 - </view>  
242 - </view>  
243 - </block>  
244 - <block wx:else>  
245 - <!-- 商品价格,先判断下是后⼜等级价 -->  
246 - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">  
247 - <!-- 当会员是等级卡的时候 -->  
248 - <block wx:if="{{card_field}}">  
249 - <!-- 等级价>0 -->  
250 - <block wx:if="{{item[card_field]>0}}">  
251 - <view class="flex">  
252 - <!-- 办卡价 -->  
253 - <view class="flex xc-wc ai_and">  
254 - <!-- <view class="fs24">¥</view> -->  
255 - <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>  
256 - <view class="card_bg">  
257 - <image src="{{url}}/miniapp/images/plus/dj_icon.png" />  
258 - <text class="card_name ellipsis-1">{{card_name}}</text>  
259 - </view>  
260 - </view>  
261 - </view>  
262 - <view class="flex" style="line-height: 28rpx;">  
263 - <!-- 原价 -->  
264 - <view class="price flex xc-ash line_th">  
265 - <!-- <view class="fs22">¥</view> -->  
266 - <view class="fs22 money">{{item.market_price}}</view>  
267 - </view>  
268 - </view>  
269 - </block>  
270 - <blocK wx:else>  
271 - <view class="flex">  
272 - <!-- 办卡价 -->  
273 - <view class="flex xc-wc ai_and">  
274 - <!-- <view class="fs24">¥</view> -->  
275 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
276 - </view>  
277 - </view>  
278 - <view class="flex" style="line-height: 28rpx;">  
279 - <!-- 原价 -->  
280 - <view class="price flex xc-ash line_th">  
281 - <!-- <view class="fs22">¥</view> -->  
282 - <view class="fs22 money">{{item.market_price}}</view>  
283 - </view>  
284 - </view>  
285 - </blocK>  
286 - </block>  
287 - <block wx:else>  
288 - <!-- 如果商品有设置等级价⼤于0的 -->  
289 - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">  
290 - <view class="flex">  
291 - <!-- 办卡价 -->  
292 - <view class="flex xc-wc ai_and">  
293 - <!-- <view class="fs24">¥</view> -->  
294 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
295 - </view>  
296 - <!-- 原价 -->  
297 - <view class="price flex xc-ash line_th">  
298 - <!-- <view class="fs22">¥</view> -->  
299 - <view class="fs22 money">{{item.market_price}}</view>  
300 - </view>  
301 - </view>  
302 - <view class="flexr" style="">  
303 - <!-- 等级价 -->  
304 - <view class="price flex ai-center">  
305 - <!-- <view class="fs22">¥</view> -->  
306 - <view class="fs28 money">  
307 - {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}  
308 - </view>  
309 - <view class="card_bg">  
310 - <image src="{{url}}/miniapp/images/plus/dj_icon.png" />  
311 - <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>  
312 - </view>  
313 - </view>  
314 - </view>  
315 - </block>  
316 - <block wx:else>  
317 - <view class="flex">  
318 - <!-- 办卡价 -->  
319 - <view class="flex xc-wc ai_and">  
320 - <!-- <view class="fs24">¥</view> -->  
321 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
322 - </view>  
323 - </view>  
324 - <view class="flex" style="line-height: 28rpx;">  
325 - <!-- 原价 -->  
326 - <view class="price flex xc-ash line_th">  
327 - <!-- <view class="fs22">¥</view> -->  
328 - <view class="fs22 money">{{item.market_price}}</view>  
329 - </view>  
330 - </view>  
331 - </block>  
332 - </block>  
333 - </block>  
334 - <!-- 商品压根就没有等级价 -->  
335 - <block wx:else>  
336 - <view class="flex">  
337 - <!-- 办卡价 -->  
338 - <view class="flex xc-wc ai_and">  
339 - <!-- <view class="fs24">¥</view> -->  
340 - <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>  
341 - </view>  
342 - </view>  
343 - <view class="flex" style="line-height: 28rpx;">  
344 - <!-- 原价 -->  
345 - <view class="price flex xc-ash line_th">  
346 - <!-- <view class="fs22">¥</view> -->  
347 - <view class="fs22 money">{{item.market_price}}</view>  
348 - </view>  
349 - </view>  
350 - </block>  
351 - </block>  
352 - <!-- 分层金额 -->  
353 - <view class="fs24 c-a">  
354 - 分成金额:  
355 - <text class="money c-red">{{filter.toFix(item.commission,2)}}</text>  
356 - </view>  
357 - </view>  
358 - </view>  
359 - </view>  
360 - <nodata class="t-c" wx:if="{{list.length == 0 && list}}"></nodata>  
361 - <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.length !== 0}}">  
362 - - 已经到底了 -  
363 - </view>  
364 - </view> 4 + <view class="head pr">
  5 + <view class="bdb">
  6 + <!-- <view><image src="../../../images/jfbuy.jpg" mode="widthFix" class="banner"/></view> -->
  7 + <view>
  8 + <image src="{{imghost + (ad_img ? ad_img:'/miniapp/images/user_index_powder.jpg')}}" mode="widthFix" class="banner" />
  9 + </view>
  10 + <view class="flex bg-white pdh20 jc_sb pr">
  11 + <!-- 分享人的头像 -->
  12 + <view class="avatar-container" wx:if="{{userInfo2}}">
  13 + <image class="avatar" src="{{userInfo2.head_pic}}" />
  14 + <view class="pdt20">
  15 + <text class="nickname">{{userInfo2.nickname}}</text>
  16 + </view>
  17 + </view>
  18 + <!-- 自己的头像 -->
  19 + <view class="avatar-container" wx:else>
  20 + <image class="avatar" src="{{userInfo.head_pic}}" />
  21 + <view class="pdt20">
  22 + <text class="nickname">{{userInfo.nickname}}</text>
  23 + </view>
  24 + </view>
  25 + <view class="flex t-c fs24 f1 jc_fe">
  26 + <view class="pdv20 pdh40 {{isAll ? 'selected':''}}" bindtap="clickAll">
  27 + <view class="fs30">{{filter.show_default(total)}}</view>
  28 + <view>全部商品</view>
  29 + </view>
  30 + <view class="pdv20 pdh40 {{!isAll ? 'selected':''}}" bindtap="clickNew">
  31 + <view class="fs30">{{filter.show_default(newListTotal)}}</view>
  32 + <view>新品</view>
  33 + </view>
  34 + <view class="pdv20 pdh40" bindtap="goto" data-url="/pages/user/index/index">
  35 + <view class="fs26">
  36 + <text class="iconfont icon-ren1 bold"></text>
  37 + </view>
  38 + <view>会员中心</view>
  39 + </view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <!-- 搜索 -->
  44 + <view class="flex ai-center fs26 bg-white pd20">
  45 + <text class="pdr20 c-a iconfont icon-fenlei" catch:tap="goto" data-url="/packageC/pages/goods/distributionCategoryList/index"></text>
  46 + <view class="input-container f1">
  47 + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" placeholder-style="color:#aaa;" confirm-type="search" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" bindconfirm="search" />
  48 + <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
  49 + <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
  50 + </view>
  51 + <view class="pdl20 c-a" bindtap="search">搜索</view>
  52 + </view>
  53 + </view>
  54 + <view class="flex t-c fs26 bg-white bdb sticky c-a" catchtap="clickTab">
  55 + <block wx:for="{{tabArr}}">
  56 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">
  57 + {{item}}
  58 + </view>
  59 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort">
  60 + {{item}}
  61 + <text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}"></text>
  62 + <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" wx:else></text>
  63 + </view>
  64 + </block>
  65 + <view class="f1 pd20" catchtap="change">
  66 + <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>
  67 + </view>
  68 + </view>
  69 + <view class="content">
  70 + <view class="fs26" wx:if="{{isShowRow}}">
  71 + <view class="item bg-white flex ai-center pd20" wx:for="{{list}}">
  72 + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
  73 + <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}">
  74 + <image class="img" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load mode="aspectFit" />
  75 + </view>
  76 + <view class="flex fdc jc_sb">
  77 + <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>
  78 + <!-- 判断是否有活动价 -->
  79 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
  80 + <view class="flex xc-wc pdt20">
  81 + <text wx:if="{{item.prom_integral}}">
  82 + <text class="fs30">{{item.prom_integral}}</text>
  83 + 积分
  84 + </text>
  85 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  86 + <!-- 活动价 -->
  87 + <view class="flex xc-wc ai_and" wx:if="{{item.prom_price}}">
  88 + <!-- <view class="fs24">¥</view> -->
  89 + <view class="fs30 money">{{item.prom_price}}</view>
  90 + </view>
  91 + </view>
  92 + <view class="flex" style="line-height: 28rpx;">
  93 + <!-- 原价 -->
  94 + <view class="price flex xc-ash line_th">
  95 + <!-- <view class="fs22">¥</view> -->
  96 + <view class="fs22 money">{{item.market_price}}</view>
  97 + </view>
  98 + </view>
  99 + </block>
  100 + <block wx:else>
  101 + <!-- 商品价格,先判断下是后⼜等级价 -->
  102 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  103 + <!-- 当会员是等级卡的时候 -->
  104 + <block wx:if="{{card_field}}">
  105 + <!-- 等级价>0 -->
  106 + <block wx:if="{{item[card_field]>0}}">
  107 + <view class="flex">
  108 + <!-- 办卡价 -->
  109 + <view class="flex xc-wc ai_and">
  110 + <!-- <view class="fs24">¥</view> -->
  111 + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>
  112 + <view class="card_bg">
  113 + <image src="{{url + 'miniapp/images/plus/dj_icon.png'}}" />
  114 + <text class="card_name ellipsis-1">{{card_name}}</text>
  115 + </view>
  116 + </view>
  117 + </view>
  118 + <view class="flex" style="line-height: 28rpx;">
  119 + <!-- 原价 -->
  120 + <view class="price flex xc-ash line_th">
  121 + <!-- <view class="fs22">¥</view> -->
  122 + <view class="fs22 money">{{item.market_price}}</view>
  123 + </view>
  124 + </view>
  125 + </block>
  126 + <blocK wx:else>
  127 + <view class="flex">
  128 + <!-- 办卡价 -->
  129 + <view class="flex xc-wc">
  130 + <!-- <view class="fs24">¥</view> -->
  131 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  132 + </view>
  133 + </view>
  134 + <view class="flex" style="line-height: 28rpx;">
  135 + <!-- 原价 -->
  136 + <view class="price flex xc-ash line_th">
  137 + <!-- <view class="fs22">¥</view> -->
  138 + <view class="fs22 money">{{item.market_price}}</view>
  139 + </view>
  140 + </view>
  141 + </blocK>
  142 + </block>
  143 + <block wx:else>
  144 + <!-- 如果商品有设置等级价⼤于0的 -->
  145 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
  146 + <view class="flex">
  147 + <!-- 办卡价 -->
  148 + <view class="flex xc-wc">
  149 + <!-- <view class="fs24">¥</view> -->
  150 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  151 + </view>
  152 + <!-- 原价 -->
  153 + <view class="price flex xc-ash line_th">
  154 + <!-- <view class="fs22">¥</view> -->
  155 + <view class="fs22 money">{{item.market_price}}</view>
  156 + </view>
  157 + </view>
  158 + <view class="flexr">
  159 + <!-- 等级价 -->
  160 + <view class="price flex ai-center">
  161 + <!-- <view class="fs22">¥</view> -->
  162 + <view class="fs28 money">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  163 + <view class="card_bg">
  164 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  165 + <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}} </text>
  166 + </view>
  167 + </view>
  168 + </view>
  169 + </block>
  170 + <block wx:else>
  171 + <view class="flex">
  172 + <!-- 办卡价 -->
  173 + <view class="flex xc-wc">
  174 + <!-- <view class="fs24">¥</view> -->
  175 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  176 + </view>
  177 + </view>
  178 + <view class="flex" style="line-height: 28rpx;">
  179 + <!-- 原价 -->
  180 + <view class="price flex xc-ash line_th">
  181 + <!-- <view class="fs22">¥</view> -->
  182 + <view class="fs22 money">{{item.market_price}}</view>
  183 + </view>
  184 + </view>
  185 + </block>
  186 + </block>
  187 + </block>
  188 + <!-- 商品压根就没有等级价 -->
  189 + <block wx:else>
  190 + <view class="flex">
  191 + <!-- 办卡价 -->
  192 + <view class="flex xc-wc">
  193 + <!-- <view class="fs24">¥</view> -->
  194 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  195 + </view>
  196 + </view>
  197 + <view class="flex" style="line-height: 28rpx;">
  198 + <!-- 原价 -->
  199 + <view class="price flex xc-ash line_th">
  200 + <!-- <view class="fs22">¥</view> -->
  201 + <view class="fs22 money">{{item.market_price}}</view>
  202 + </view>
  203 + </view>
  204 + </block>
  205 + </block>
  206 + <!-- 分层金额 -->
  207 + <view hidden="{{ishidden_comise}}" class="fs24 c-a">
  208 + 分成金额:
  209 + <text class="money c-red">{{filter.toFix(item.commission,2)}}</text>
  210 + </view>
  211 + </view>
  212 + </view>
  213 + </view>
  214 + </view>
  215 + <view class="fs26 flex pd20 wrap" wx:else>
  216 + <view class="item2 bg-white" wx:for="{{list}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}">
  217 + <view class="img-container" data-txt="已售:{{item.sales_sum}}">
  218 + <image class="img2" src="{{imghost + (item.original_img ? item.original_img : default_img)}}" lazy-load="true" />
  219 + </view>
  220 + <view class="pd20 fs26">
  221 + <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>
  222 + <!-- 判断是否有活动价 -->
  223 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
  224 + <view class="flex xc-wc">
  225 + <text wx:if="{{item.prom_integral}}">
  226 + <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text>
  227 + 积分
  228 + </text>
  229 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  230 + <!-- 活动价 -->
  231 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
  232 + <!-- <view class="fs24">¥</view> -->
  233 + <view class="fs30 money">{{item.prom_price}}</view>
  234 + </view>
  235 + </view>
  236 + <view class="flex" style="line-height: 28rpx;">
  237 + <!-- 原价 -->
  238 + <view class="price flex xc-ash line_th">
  239 + <!-- <view class="fs22">¥</view> -->
  240 + <view class="fs22 money">{{item.market_price}}</view>
  241 + </view>
  242 + </view>
  243 + </block>
  244 + <block wx:else>
  245 + <!-- 商品价格,先判断下是后⼜等级价 -->
  246 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  247 + <!-- 当会员是等级卡的时候 -->
  248 + <block wx:if="{{card_field}}">
  249 + <!-- 等级价>0 -->
  250 + <block wx:if="{{item[card_field]>0}}">
  251 + <view class="flex">
  252 + <!-- 办卡价 -->
  253 + <view class="flex xc-wc ai_and">
  254 + <!-- <view class="fs24">¥</view> -->
  255 + <view class="fs30 money">{{filter.toFix(item[card_field],2)}}</view>
  256 + <view class="card_bg">
  257 + <image src="{{url}}/miniapp/images/plus/dj_icon.png" />
  258 + <text class="card_name ellipsis-1">{{card_name}}</text>
  259 + </view>
  260 + </view>
  261 + </view>
  262 + <view class="flex" style="line-height: 28rpx;">
  263 + <!-- 原价 -->
  264 + <view class="price flex xc-ash line_th">
  265 + <!-- <view class="fs22">¥</view> -->
  266 + <view class="fs22 money">{{item.market_price}}</view>
  267 + </view>
  268 + </view>
  269 + </block>
  270 + <blocK wx:else>
  271 + <view class="flex">
  272 + <!-- 办卡价 -->
  273 + <view class="flex xc-wc ai_and">
  274 + <!-- <view class="fs24">¥</view> -->
  275 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  276 + </view>
  277 + </view>
  278 + <view class="flex" style="line-height: 28rpx;">
  279 + <!-- 原价 -->
  280 + <view class="price flex xc-ash line_th">
  281 + <!-- <view class="fs22">¥</view> -->
  282 + <view class="fs22 money">{{item.market_price}}</view>
  283 + </view>
  284 + </view>
  285 + </blocK>
  286 + </block>
  287 + <block wx:else>
  288 + <!-- 如果商品有设置等级价⼤于0的 -->
  289 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
  290 + <view class="flex">
  291 + <!-- 办卡价 -->
  292 + <view class="flex xc-wc ai_and">
  293 + <!-- <view class="fs24">¥</view> -->
  294 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  295 + </view>
  296 + <!-- 原价 -->
  297 + <view class="price flex xc-ash line_th">
  298 + <!-- <view class="fs22">¥</view> -->
  299 + <view class="fs22 money">{{item.market_price}}</view>
  300 + </view>
  301 + </view>
  302 + <view class="flexr">
  303 + <!-- 等级价 -->
  304 + <view class="price flex ai-center">
  305 + <!-- <view class="fs22">¥</view> -->
  306 + <view class="fs28 money">
  307 + {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}
  308 + </view>
  309 + <view class="card_bg">
  310 + <image src="{{url}}/miniapp/images/plus/dj_icon.png" />
  311 + <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>
  312 + </view>
  313 + </view>
  314 + </view>
  315 + </block>
  316 + <block wx:else>
  317 + <view class="flex">
  318 + <!-- 办卡价 -->
  319 + <view class="flex xc-wc ai_and">
  320 + <!-- <view class="fs24">¥</view> -->
  321 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  322 + </view>
  323 + </view>
  324 + <view class="flex" style="line-height: 28rpx;">
  325 + <!-- 原价 -->
  326 + <view class="price flex xc-ash line_th">
  327 + <!-- <view class="fs22">¥</view> -->
  328 + <view class="fs22 money">{{item.market_price}}</view>
  329 + </view>
  330 + </view>
  331 + </block>
  332 + </block>
  333 + </block>
  334 + <!-- 商品压根就没有等级价 -->
  335 + <block wx:else>
  336 + <view class="flex">
  337 + <!-- 办卡价 -->
  338 + <view class="flex xc-wc ai_and">
  339 + <!-- <view class="fs24">¥</view> -->
  340 + <view class="fs30 money">{{filter.toFix(item.shop_price,2)}}</view>
  341 + </view>
  342 + </view>
  343 + <view class="flex" style="line-height: 28rpx;">
  344 + <!-- 原价 -->
  345 + <view class="price flex xc-ash line_th">
  346 + <!-- <view class="fs22">¥</view> -->
  347 + <view class="fs22 money">{{item.market_price}}</view>
  348 + </view>
  349 + </view>
  350 + </block>
  351 + </block>
  352 + <!-- 分层金额 -->
  353 + <view class="fs24 c-a">
  354 + 分成金额:
  355 + <text class="money c-red">{{filter.toFix(item.commission,2)}}</text>
  356 + </view>
  357 + </view>
  358 + </view>
  359 + </view>
  360 + <nodata class="t-c" wx:if="{{list.length == 0 && list}}"></nodata>
  361 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.length !== 0}}">
  362 + - 已经到底了 -
  363 + </view>
  364 + </view>
365 </view> 365 </view>
366 \ No newline at end of file 366 \ No newline at end of file
packageA/pages/goodsInfo/goodsInfo.js
@@ -113,7 +113,7 @@ Page({ @@ -113,7 +113,7 @@ Page({
113 is_sec_mend: 0, 113 is_sec_mend: 0,
114 sto_sele_name: "", //选中的门店名称 114 sto_sele_name: "", //选中的门店名称
115 sto_sele_id: "", //选中的门店id 115 sto_sele_id: "", //选中的门店id
116 - sto_sele_keyid:'', //选中的门店线下 116 + sto_sele_keyid:'', //选中的门店线下
117 sto_sele_distr: "", //选择的门店的配送方式 117 sto_sele_distr: "", //选择的门店的配送方式
118 is_show_sto_cat: 1, //是否显示门店分类 118 is_show_sto_cat: 1, //是否显示门店分类
119 only_pk: null, 119 only_pk: null,
@@ -205,14 +205,18 @@ Page({ @@ -205,14 +205,18 @@ Page({
205 hui_condition:null, 205 hui_condition:null,
206 sto_sele_name_1:'',//分享的门店名称 206 sto_sele_name_1:'',//分享的门店名称
207 207
  208 + // 秒杀
  209 + prom_st: 1,
  210 + prom_r_null: 0,
208 }, 211 },
209 212
210 //------初始化加载---------- 213 //------初始化加载----------
211 onLoad: function(t) { 214 onLoad: function(t) {
212 -  
213 self = this; 215 self = this;
214 - this.data.options = t; // { goods_id: ...}  
215 - 216 +
  217 + this.setData({
  218 + options: t,
  219 + });
216 220
217 var ee = this, 221 var ee = this,
218 that = ee, 222 that = ee,
@@ -265,11 +269,11 @@ Page({ @@ -265,11 +269,11 @@ Page({
265 269
266 ee.setData({ gid: gid}); 270 ee.setData({ gid: gid});
267 271
268 - if(first_leader){ 272 + if(first_leader) {
269 getApp().globalData.first_leader=first_leader; 273 getApp().globalData.first_leader=first_leader;
270 //调用接口判断是不是会员 274 //调用接口判断是不是会员
271 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ 275 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
272 - if(res.data.code==0){ 276 + if(res.data.code==0) {
273 getApp().globalData.guide_id=res.data.data.id; 277 getApp().globalData.guide_id=res.data.data.id;
274 } 278 }
275 }) 279 })
@@ -377,7 +381,7 @@ Page({ @@ -377,7 +381,7 @@ Page({
377 var ser_card=th.data.data; 381 var ser_card=th.data.data;
378 //--如果默认门店不在等级卡的默认们店以内 382 //--如果默认门店不在等级卡的默认们店以内
379 if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){ 383 if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
380 - ee.is_no_dis=1; 384 + ee.is_no_dis=1;
381 } 385 }
382 386
383 var appd=getApp().globalData; 387 var appd=getApp().globalData;
@@ -446,6 +450,25 @@ Page({ @@ -446,6 +450,25 @@ Page({
446 }); 450 });
447 451
448 }, 452 },
  453 +
  454 +
  455 + onReady() {
  456 +
  457 + setTimeout(()=>{
  458 + wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
  459 + // console.log('node@@@@@@@', res);
  460 + if(res.length != 0) {
  461 + this.setData({
  462 + showFold: res[0].height < res[1].height,
  463 + });
  464 + };
  465 +
  466 + }).exec();
  467 + }, 1000);
  468 +
  469 + },
  470 +
  471 +
449 //------------程序初始化入口------------- 472 //------------程序初始化入口-------------
450 async init(gid) { 473 async init(gid) {
451 var ee = this, 474 var ee = this,
@@ -486,6 +509,59 @@ Page({ @@ -486,6 +509,59 @@ Page({
486 // }) 509 // })
487 510
488 511
  512 + // ----> 秒杀
  513 + let prom_type = this.data.options.prom_type;
  514 +
  515 + let goods_id = this.data.options.goods_id;
  516 + if(!goods_id) goods_id = this.data.data.goods_id;
  517 +
  518 + if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入
  519 + let prom_id = this.data.options.prom_id;
  520 + this.check_prom(goods_id, prom_type, prom_id);
  521 + } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数
  522 + getApp().request.promiseGet('/api/weshop/activitylist/getGoodActInfo', {
  523 + data: {
  524 + store_id: os.stoid,
  525 + goodsidlist: goods_id,
  526 + is_detail: 1,
  527 + goods_type: 1,
  528 + user_id: oo.user_id,
  529 + }
  530 + }).then(res => {
  531 + if (res.data.code == 0) {
  532 + let result = res.data.data;
  533 + let resLength = result.length;
  534 + if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动
  535 + let goods_id = this.data.options.goods_id;
  536 + let prom_type = result[0].prom_type;
  537 + let prom_id = result[0].act_id;
  538 + this.setData({
  539 + 'options.prom_type': prom_type,
  540 + });
  541 + this.check_prom(goods_id, prom_type, prom_id);
  542 + } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动
  543 + this.setData({
  544 + actList: res.data.data,
  545 + });
  546 + };
  547 +
  548 + // console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!');
  549 +
  550 + // this.setData({
  551 + // prom,
  552 + // });
  553 +
  554 + };
  555 + });
  556 + };
  557 + // <---- 秒杀
  558 +
  559 +
  560 +
  561 +
  562 +
  563 +
  564 +
489 //------是否收藏---------- 565 //------是否收藏----------
490 await getApp().request.promiseGet("/api/weshop/goodscollect/page", { 566 await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
491 data: { 567 data: {
@@ -509,8 +585,6 @@ Page({ @@ -509,8 +585,6 @@ Page({
509 store_id: os.stoid, 585 store_id: os.stoid,
510 service_id: gid 586 service_id: gid
511 }, 587 },
512 - //failRollback: !0,  
513 -  
514 }).then(res => { 588 }).then(res => {
515 console.log('get评价统计数量', res.data.data); 589 console.log('get评价统计数量', res.data.data);
516 var t = res; 590 var t = res;
@@ -530,7 +604,7 @@ Page({ @@ -530,7 +604,7 @@ Page({
530 604
531 categories3 = dd; 605 categories3 = dd;
532 } 606 }
533 - }) 607 + });
534 608
535 //----获取详情页的评价---- 609 //----获取详情页的评价----
536 await getApp().request.promiseGet("/api/weshop/serviceComment/pageComment", { 610 await getApp().request.promiseGet("/api/weshop/serviceComment/pageComment", {
@@ -545,7 +619,7 @@ Page({ @@ -545,7 +619,7 @@ Page({
545 }).then(res => { 619 }).then(res => {
546 console.log('get详情页评价', res.data.data); 620 console.log('get详情页评价', res.data.data);
547 fir_com = res.data.data.pageData; 621 fir_com = res.data.data.pageData;
548 - }) 622 + });
549 623
550 if (fir_com) { 624 if (fir_com) {
551 for (var ind in fir_com) { 625 for (var ind in fir_com) {
@@ -553,7 +627,7 @@ Page({ @@ -553,7 +627,7 @@ Page({
553 if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img); 627 if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
554 if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img); 628 if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
555 } 629 }
556 - } 630 + };
557 631
558 this.getTaohe(); 632 this.getTaohe();
559 633
@@ -592,6 +666,11 @@ Page({ @@ -592,6 +666,11 @@ Page({
592 var ee = this,gid = this.data.gid, i = getApp().request; 666 var ee = this,gid = this.data.gid, i = getApp().request;
593 this.data.is_timer = 1; 667 this.data.is_timer = 1;
594 this.wait_for_store_config(); 668 this.wait_for_store_config();
  669 +
  670 +
  671 +
  672 +
  673 +
595 674
596 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { 675 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
597 failRollback: !0, 676 failRollback: !0,
@@ -668,6 +747,8 @@ Page({ @@ -668,6 +747,8 @@ Page({
668 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 747 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
669 this.get_sto(); 748 this.get_sto();
670 749
  750 +
  751 +
671 }, 752 },
672 753
673 enterAddress: function() { 754 enterAddress: function() {
@@ -681,6 +762,7 @@ Page({ @@ -681,6 +762,7 @@ Page({
681 clearInterval(i); 762 clearInterval(i);
682 } 763 }
683 }, 764 },
  765 +
684 onHide: function() { 766 onHide: function() {
685 this.data.is_timer = 0; 767 this.data.is_timer = 0;
686 for(var i = 1; i < 100; i++) { 768 for(var i = 1; i < 100; i++) {
@@ -694,11 +776,12 @@ Page({ @@ -694,11 +776,12 @@ Page({
694 activeCategoryId: e 776 activeCategoryId: e
695 }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); 777 }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment();
696 }, 778 },
697 - tabClick2: function(t) {  
698 - this.setData({  
699 - activeCategoryId2: t.currentTarget.id  
700 - });  
701 - }, 779 +
  780 + // tabClick2: function(t) {
  781 + // this.setData({
  782 + // activeCategoryId2: t.currentTarget.id
  783 + // });
  784 + // },
702 785
703 tabClick3: function(t) { 786 tabClick3: function(t) {
704 var e = this; 787 var e = this;
@@ -712,11 +795,11 @@ Page({ @@ -712,11 +795,11 @@ Page({
712 } 795 }
713 }, 796 },
714 797
715 - doScrollTop: function() {  
716 - wx.pageScrollTo({  
717 - scrollTop: 0  
718 - });  
719 - }, 798 + // doScrollTop: function() {
  799 + // wx.pageScrollTo({
  800 + // scrollTop: 0
  801 + // });
  802 + // },
720 803
721 tabComment: function() { 804 tabComment: function() {
722 this.setData({ 805 this.setData({
@@ -727,7 +810,7 @@ Page({ @@ -727,7 +810,7 @@ Page({
727 //商品详情的时候调用 810 //商品详情的时候调用
728 tabGoodsContent: function() { 811 tabGoodsContent: function() {
729 var th = this, 812 var th = this,
730 - i = getApp().request; 813 + i = getApp().request;
731 this.setData({ 814 this.setData({
732 activeCategoryId: 1 815 activeCategoryId: 1
733 }); 816 });
@@ -741,7 +824,7 @@ Page({ @@ -741,7 +824,7 @@ Page({
741 var action= t.currentTarget.dataset.action; 824 var action= t.currentTarget.dataset.action;
742 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 825 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
743 826
744 - th.setData({ 827 + th.setData({
745 open_ind_store: ind 828 open_ind_store: ind
746 }); 829 });
747 830
@@ -762,8 +845,16 @@ Page({ @@ -762,8 +845,16 @@ Page({
762 newd['pick_name'] = th.data.sto_sele_name; 845 newd['pick_name'] = th.data.sto_sele_name;
763 newd['guide_id'] = getApp().globalData.guide_id; 846 newd['guide_id'] = getApp().globalData.guide_id;
764 newd['guide_type']=0; 847 newd['guide_type']=0;
  848 +
  849 + if(this.data.prom_type && this.data.prom_type == 1) {
  850 + newd['prom_type'] = this.data.prom_type;
  851 + newd['prom_id'] = this.data.prom_id;
  852 + newd['prom_price'] = this.data.prom_price;
  853 + }
  854 +
  855 + // console.log('newd++++++++', newd);
765 th.buyNow(newd); 856 th.buyNow(newd);
766 - }else{ 857 + } else {
767 858
768 var newd = { 859 var newd = {
769 service_id: th.data.data.id, 860 service_id: th.data.data.id,
@@ -873,7 +964,8 @@ Page({ @@ -873,7 +964,8 @@ Page({
873 }, 964 },
874 965
875 openSpecModel: function(t) { 966 openSpecModel: function(t) {
876 - var th=this; 967 + // console.log('****ttttttt***', t);
  968 + var th=this;
877 var open_store = t.currentTarget.dataset.ind; 969 var open_store = t.currentTarget.dataset.ind;
878 this.setData({ 970 this.setData({
879 store: 0, 971 store: 0,
@@ -2741,7 +2833,318 @@ Page({ @@ -2741,7 +2833,318 @@ Page({
2741 }; 2833 };
2742 }; 2834 };
2743 }); 2835 });
2744 - } 2836 + },
  2837 +
  2838 +
  2839 +
  2840 +
  2841 + //---小于10的格式化函数----
  2842 + // timeFormat(param) {
  2843 + // return param < 10 ? '0' + param : param;
  2844 + // },
  2845 +
  2846 + //----倒计时函数-----
  2847 + countDown(time, prom_st) {
  2848 + if (!this.data.is_timer) return false;
  2849 + var th = this;
  2850 + // 获取当前时间,同时得到活动结束时间数组
  2851 + var endTime = time;
  2852 + var newTime = ut.gettimestamp();
  2853 + // 对结束时间进行处理渲染到页面
  2854 + var obj = null;
  2855 + // 如果活动未结束,对时间进行处理
  2856 + if (endTime - newTime > 0) {
  2857 + var time = (endTime - newTime);
  2858 + // 获取天、时、分、秒
  2859 + var day = parseInt(time / (60 * 60 * 24));
  2860 + var hou = parseInt(time % (60 * 60 * 24) / 3600);
  2861 + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  2862 + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  2863 + obj = {
  2864 + day: this.timeFormat(day),
  2865 + hou: this.timeFormat(hou),
  2866 + min: this.timeFormat(min),
  2867 + sec: this.timeFormat(sec)
  2868 + }
  2869 + } else {
  2870 + if (th.data.prom_st == 0) {
  2871 + //var endTime2 = new Date(th.data.prom_end_time).getTime();
  2872 + var endTime2 = th.data.prom_act.end_time;
  2873 + th.setData({
  2874 + prom_time_text: '距结束还剩:',
  2875 + prom_st: 1
  2876 + })
  2877 + setTimeout(function () {
  2878 + th.countDown(endTime2)
  2879 + }, 1000);
  2880 + return false;
  2881 +
  2882 + } else {
  2883 + //活动已结束,全部设置为'00'
  2884 + obj = {
  2885 + day: '00',
  2886 + hou: '00',
  2887 + min: '00',
  2888 + sec: '00'
  2889 + }
  2890 + th.setData({
  2891 + prom_time_text: '活动已经结束:',
  2892 + prom_st: 3
  2893 + })
  2894 + th.setData({
  2895 + djs: obj
  2896 + });
  2897 + return false;
  2898 + }
  2899 + }
  2900 +
  2901 + th.setData({
  2902 + djs: obj
  2903 + });
  2904 + setTimeout(function () {
  2905 + th.countDown(endTime)
  2906 + }, 1000);
  2907 + },
  2908 +
  2909 +
  2910 + get_normal(gid) {
  2911 + this.setData({
  2912 + prom_type: 0,
  2913 + isshow: 1,
  2914 + });
  2915 + // this.get_sku(os.stoid, this.data.data, gid);
  2916 + // this.get_sto();
  2917 + // this.check_is_youhui(gid, 1);
  2918 + this.data.is_normal = 1;
  2919 + },
  2920 +
  2921 +
  2922 +
  2923 +
  2924 + //--------检查是否活动,活动是否开始,或者是否结束-------
  2925 + async check_prom(gid, prom_type, prom_id) {
  2926 + console.log('check_prom');
  2927 + var ee = this, th = ee;
  2928 + var user_id = getApp().globalData.user_id;
  2929 + if (!user_id) user_id = 0;
  2930 +
  2931 + // if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7 || prom_type == 9 || prom_type == 10) {
  2932 + // this.setData({
  2933 + // prom_type: 0, isshow: 1,
  2934 + // });
  2935 + // return false;
  2936 + // }
  2937 +
  2938 +
  2939 +
  2940 + // if (prom_type == 1 && prom_id == 0) {
  2941 + // this.setData({
  2942 + // prom_type: 0, isshow: 1,
  2943 + // });
  2944 +
  2945 + // //获取门店
  2946 + // this.get_sto();
  2947 + // this.get_sku(o.stoid, this.data.data, gid);
  2948 + // this.check_has_flash();
  2949 + // this.data.is_normal = 1;
  2950 + // this.check_is_youhui(gid, 1);
  2951 + // return false;
  2952 + // }
  2953 +
  2954 + //if (prom_type != 3 && prom_type!=0){
  2955 + //---判断秒杀----
  2956 + if (prom_type == 1 && prom_id > 0) {
  2957 + //-------判断活动是否抢光---------
  2958 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
  2959 + 1: 1
  2960 + }).then(res => {
  2961 + var em = res;
  2962 + if (res.data.code == 0) {
  2963 + // console.log('!!!!!!res!!!!', res);
  2964 + if (res.data.data <= 0) ee.setData({
  2965 + prom_r_null: 1
  2966 + });
  2967 + //拿取价格并且判断时间--
  2968 + getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, {
  2969 + success: function (t) {
  2970 + // console.log('!!!!!!t!!!!', t);
  2971 + if (t.data.code != 0) {
  2972 + ee.get_normal(gid);
  2973 + return false;
  2974 + }
  2975 + //----已经结束-----
  2976 + if (t.data.data.is_end == 1) {
  2977 + ee.get_normal(gid);
  2978 + return false;
  2979 + }
  2980 + //----已经过期-----
  2981 + var now = ut.gettimestamp();
  2982 + if (t.data.data.end_time < now) {
  2983 + ee.get_normal(gid);
  2984 + return false;
  2985 + }
  2986 + /*-- 还没有开始预热的也不显示 --*/
  2987 + if (t.data.data.show_time > now) {
  2988 + ee.get_normal(gid);
  2989 + return false;
  2990 + }
  2991 +
  2992 + var t_gd = ee.data.data;
  2993 + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
  2994 + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
  2995 +
  2996 + ee.setData({
  2997 + 'data.shop_price': t.data.data.user_price,
  2998 + prom_price: t.data.data.user_price,
  2999 + prom_type: 1,
  3000 + prom_id: prom_id,
  3001 + prom_buy_limit: t.data.data.buy_limit,
  3002 + prom_act: t.data.data,
  3003 + prom_end_time: prom_end_time,
  3004 + prom_start_time: prom_start_time,
  3005 + isshow: 1,
  3006 + });
  3007 +
  3008 + ee.get_sto();
  3009 + var newTime = ut.gettimestamp();
  3010 + var endTime2 = t.data.data.end_time;
  3011 + var endTime1 = t.data.data.start_time;
  3012 + if (endTime1 > newTime) {
  3013 + ee.setData({
  3014 + prom_time_text: '距秒杀开始还有',
  3015 + prom_st: 0,
  3016 + })
  3017 + ee.countDown(endTime1, 0);
  3018 + } else {
  3019 + if (endTime2 > newTime) {
  3020 + ee.setData({
  3021 + prom_time_text: '距秒杀结束还有',
  3022 + prom_st: 1
  3023 + })
  3024 + ee.countDown(endTime2);
  3025 + }
  3026 + }
  3027 +
  3028 + //如果是进行中的话
  3029 + // if (endTime1 < newTime) {
  3030 + // //-- 获取秒杀活动的多少规格 --
  3031 + // ee.get_more_flahs(function (list) {
  3032 + // if (list && list.length > 1) {
  3033 +
  3034 + // var n_item = list[0];
  3035 + // var ind = list.findIndex(function (ele) {
  3036 + // return ele.goods_id == ee.data.data.goods_id;
  3037 + // })
  3038 + // if (ind < 0) return false;
  3039 + // if (ind > 0) {
  3040 + // n_item = JSON.parse(JSON.stringify(list[ind]));
  3041 + // list.splice(ind, 1);
  3042 + // list.unshift(n_item);
  3043 + // }
  3044 +
  3045 + // ee.data.sele_g.viplimited = n_item.viplimited;
  3046 + // ee.data.data.viplimited = n_item.viplimited;
  3047 +
  3048 + // var gb = 1;
  3049 + // //-- 显示多规格 --
  3050 + // for (let i in list) {
  3051 + // let item = list[i];
  3052 + // var gg = "";
  3053 + // if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  3054 + // if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
  3055 +
  3056 + // if (item.goods_spec != "" && item.goods_color != "") {
  3057 + // gg = item.goods_spec + "/" + item.goods_color;
  3058 + // } else if (item.goods_spec != "" || item.goods_color != "") {
  3059 + // gg = item.goods_spec + item.goods_color;
  3060 + // } else {
  3061 + // gg = "规格" + gb;
  3062 + // gb++;
  3063 + // }
  3064 + // item.gg = gg;
  3065 + // item.prom_id = item.prom_id;
  3066 + // item.prom_type = 1;
  3067 + // }
  3068 +
  3069 + // ee.setData({
  3070 + // sku_g: list,
  3071 + // });
  3072 +
  3073 + // }
  3074 + // })
  3075 + // }
  3076 +
  3077 + }
  3078 + });
  3079 + }
  3080 + })
  3081 + }
  3082 +
  3083 + },
  3084 +
  3085 +
  3086 +
  3087 + viewFlash(e) {
  3088 + let prom_type = e.currentTarget.dataset.promtype;
  3089 + let prom_id = e.currentTarget.dataset.promid;
  3090 + let goods_id = this.data.data.goods_id;
  3091 + let url = `/packageA/pages/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${prom_type}&prom_id=${prom_id}`;
  3092 + // console.log('url~~~~', url);
  3093 + getApp().goto(url);
  3094 + },
  3095 +
  3096 +
  3097 +
  3098 +
  3099 + //-- 检验商品的活动情况 --
  3100 + check_gd_prom_new: function (func) {
  3101 + var th = this;
  3102 + var user_id = getApp().globalData.user_id;
  3103 + if (!user_id) user_id = 0;
  3104 +
  3105 + var url = '/api/weshop/activitylist/listGoodActInfo2';
  3106 + var req_d = {
  3107 + "store_id": os.stoid,
  3108 + "goods_id": this.data.gid,
  3109 + "user_id": user_id,
  3110 + }
  3111 + getApp().request.get(url, {
  3112 + data: req_d,
  3113 + success: function (e) {
  3114 + if (e.data.code == 0 && e.data.data && e.data.data.length > 0) {
  3115 + var arr = e.data.data;
  3116 + var arr2 = arr.filter(function (e) {
  3117 + return e.s_time < ut.gettimestamp();
  3118 + })
  3119 + //-- 如果只有一个活动的话 --
  3120 + if (arr.length == 1) {
  3121 + th.data.prom_type = arr[0].prom_type;
  3122 + th.data.prom_id = arr[0].act_id;
  3123 + }
  3124 + //-- 如果只有一个进行中的活动的话 --
  3125 + else if (arr2.length == 1) {
  3126 + th.data.prom_type = arr2[0].prom_type;
  3127 + th.data.prom_id = arr2[0].act_id;
  3128 + }
  3129 + }
  3130 + //-- 调用回调 --
  3131 + func();
  3132 + }
  3133 + });
  3134 + },
  3135 +
  3136 +
  3137 +
  3138 +
  3139 +
  3140 +
  3141 +
  3142 +
  3143 +
  3144 +
  3145 +
  3146 +
  3147 +
2745 3148
2746 3149
2747 3150
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -51,6 +51,7 @@ @@ -51,6 +51,7 @@
51 </view> 51 </view>
52 </view> 52 </view>
53 53
  54 +
54 55
55 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else> 56 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else>
56 <view class="xc-videos-picture rel"> 57 <view class="xc-videos-picture rel">
@@ -63,6 +64,30 @@ @@ -63,6 +64,30 @@
63 </swiper> 64 </swiper>
64 </view> 65 </view>
65 </view> 66 </view>
  67 +
  68 +
  69 + <!-- --显示秒杀价 -->
  70 + <view class="prom_show rel" wx:if="{{options.prom_type == 1}}">
  71 + <!-- 即将开始 -->
  72 + <image class="secondkill-img" src='{{iurl+"/miniapp/images/blue_ks.png"}}' wx:if="{{prom_st==0}}"></image>
  73 + <!-- 进行中 -->
  74 + <image class="secondkill-img" src='{{iurl+"/miniapp/images/red_jx.png"}}' wx:elif="{{prom_st!=0}}"></image>
  75 + <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image>
  76 + <view class="start fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>
  77 + <view class="stop fs26 abs" wx:if="{{prom_st==1 || prom_st==3}}">距活动结束还有</view>
  78 + <view class="secview flex abs fs24 xc-miaosha-time">
  79 + <block wx:if="djs.day">
  80 + <view class='day-val' style="color:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.day}}</view>
  81 + <view class="day white" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">天</view>
  82 + </block>
  83 + <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.hou}}</view>
  84 + <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">时</view>
  85 + <view class='time-val white t-c' style=" background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.min}}</view>
  86 + <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">分</view>
  87 + <view class='time-val white t-c' style=";background:{{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">{{djs.sec}}</view>
  88 + <view class="time" style="color: {{(prom_st==1 || prom_st==3)?'#d40022':'#0097e0'}}">秒</view>
  89 + </view>
  90 + </view>
66 91
67 92
68 <!-- <block> --> 93 <!-- <block> -->
@@ -73,6 +98,9 @@ @@ -73,6 +98,9 @@
73 </view> 98 </view>
74 99
75 <view> 100 <view>
  101 + <!-- 秒杀价 -->
  102 + <!-- <view class="co-red" wx:if="{{options.prom_type == 1}}"><text class="rel yuan fs28">¥</text>{{filters.toFix(prom_price,2)}}</view> -->
  103 + <!-- 手店价 -->
76 <view class="co-red"><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view> 104 <view class="co-red"><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
77 <view class="goods-title"> 105 <view class="goods-title">
78 <view class="goods-name elli">{{data.goods_name}}</view> 106 <view class="goods-name elli">{{data.goods_name}}</view>
@@ -124,18 +152,54 @@ @@ -124,18 +152,54 @@
124 </view> 152 </view>
125 153
126 </view> 154 </view>
127 -  
128 - <view class="bz_view flex bdt16" wx:if="{{store_config}}"> 155 +
  156 +
  157 + <view class="bdt16" wx:if="{{actList}}">
  158 + <view class="cx-frame" style="position: relative; height: auto">
  159 + <!-- <block> -->
  160 + <view class="flex ai_c" wx:for="{{actList}}">
  161 + <view class="cx-sizs fs30 pdr40" wx:if="{{item.prom_type == 1}}">秒杀{{index+1}}</view>
  162 + <view class="f1">
  163 + <!-- <view class="fs28 f1"> -->
  164 + <!-- <view>
  165 + <text class="prom_condition">
  166 + <text class="fill-box">消费满</text>享优惠
  167 + </text>
  168 + </view> -->
  169 +
  170 + <!-- <view class="word f1 fs26"> -->
  171 + <!-- <text class="tick lh2 pdr20" wx:if="{{item.money>0}}">减价{{item.money}}元</text>
  172 + <text class="tick lh2 pdr20" wx:if="{{item.sale>0}}">打{{item.sale}}折</text>
  173 + <text class="tick lh2 pdr20" wx:if="{{item.past==1}}">包邮</text>
  174 + <text class="tick lh2 pdr20" wx:if="{{item.intValue>0}}">送{{item.intValue}}积分</text>
  175 + <view class="tick lh2 pdr20" wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券</view>
  176 + <view class="tick ellipsis-1x lh2" wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}}</view>
  177 + <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.lb_id>0}}" data-id="{{item.lb_id}}" bindtap="viewLbDetails">送{{item.lbtitle}}</view> -->
  178 + <view class="tick ellipsis-1x lh2 details pdr40" bindtap="viewFlash" data-promtype="{{item.prom_type}}" data-promid="{{item.act_id}}">{{item.act_name}}</view>
  179 + <!-- </view> -->
  180 + <!-- </view> -->
  181 + </view>
  182 + </view>
  183 +
  184 +
  185 + <!-- </block> -->
  186 + </view>
  187 + </view>
  188 +
  189 +
  190 + <!-- 保障服务 -->
  191 + <view class="bz_view flex bdt16 ai_c" wx:if="{{store_config.service_bz}}">
129 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> 192 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
130 - <view class="flex f1 ai_c rel">  
131 - <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{store_config.service_bz}}</view>  
132 - <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow">  
133 - <text class="bg_jj {{flag?'down1':''}}"></text>  
134 - </view>  
135 - <!-- <text class="bg_jj" bindtap="clickCollapse"></text> -->  
136 - <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> --> 193 + <view class="flex f1 ai_c rel" style="position: relative;" bindtap="{{showFold ? 'clickCollapse':''}}">
  194 + <view class="bz-content showArea {{flag ? '':'ellipsis-1x'}}">{{store_config.service_bz}}</view>
  195 + <view class="bz-content hideArea">{{store_config.service_bz}}</view>
  196 + <view class="cx-obtain-coupon wsize arrow" wx:if="{{showFold}}">
  197 + <text class="bg_jj down {{flag ? 'up':''}}"></text>
  198 + </view>
137 </view> 199 </view>
138 </view> 200 </view>
  201 +
  202 +
139 203
140 204
141 205
@@ -199,7 +263,7 @@ @@ -199,7 +263,7 @@
199 <!-- 图文详情 --> 263 <!-- 图文详情 -->
200 <view class="t_g_info bdt16"> 264 <view class="t_g_info bdt16">
201 <view class="red_shu"></view> 265 <view class="red_shu"></view>
202 - <view class="fs30 bold">商品详情</view> 266 + <view class="fs30 bold">卡项详情</view>
203 </view> 267 </view>
204 <view class="pdh20"> 268 <view class="pdh20">
205 269
@@ -238,7 +302,7 @@ @@ -238,7 +302,7 @@
238 </block> 302 </block>
239 </block> 303 </block>
240 304
241 - <view class="table_s" wx:if="{{service_list}}"> 305 + <!-- <view class="table_s" wx:if="{{service_list}}">
242 <view class="tb_item tb-l"> 306 <view class="tb_item tb-l">
243 <view class="item_left f1"> 307 <view class="item_left f1">
244 <text>项目名称</text> 308 <text>项目名称</text>
@@ -261,7 +325,7 @@ @@ -261,7 +325,7 @@
261 <text>{{item.frequency}}</text> 325 <text>{{item.frequency}}</text>
262 </view> 326 </view>
263 </view> 327 </view>
264 - </view> 328 + </view> -->
265 329
266 <view class="wxParse"> 330 <view class="wxParse">
267 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> 331 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
@@ -284,7 +348,7 @@ @@ -284,7 +348,7 @@
284 348
285 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}"> 349 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
286 <view class="pd20"> 350 <view class="pd20">
287 - <view class="table_s" wx:if="{{service_list}}"> 351 + <!-- <view class="table_s" wx:if="{{service_list}}">
288 <view class="tb_item tb-l"> 352 <view class="tb_item tb-l">
289 <view class="item_left f1"> 353 <view class="item_left f1">
290 <text>项目名称</text> 354 <text>项目名称</text>
@@ -307,7 +371,42 @@ @@ -307,7 +371,42 @@
307 <text>{{item.frequency}}</text> 371 <text>{{item.frequency}}</text>
308 </view> 372 </view>
309 </view> 373 </view>
310 - </view> 374 + </view> -->
  375 +
  376 + <block wx:if="{{listServiceItem && listServiceItem.length > 0}}">
  377 + <view class="card fs28" wx:for="{{listServiceItem}}">
  378 + <view class="flex ai_c jc_sb" style="height: 88rpx;">
  379 + <view class="ellipsis-2 f1">{{item.projectName}}({{item.frequency}}次)</view>
  380 + <view class="pdl30 t-r">
  381 + <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
  382 + <view class="fs22 c-9 del" wx:if="{{item.showPrice}}">零售价:¥{{item.showPrice}}</view>
  383 + </view>
  384 + </view>
  385 + <view class="flex ai_c jc_sb fs24 c-6">
  386 + <view class="ellipsis-1">备注:{{filters.show_default(item.remark, '无')}}</view>
  387 + <!-- 指定开始日期和结束日期 -->
  388 + <view class="pdl30 shrink0">有效期:{{filters.showStartAndEndDate(item, data.validDays)}}</view>
  389 + </view>
  390 + </view>
  391 + </block>
  392 +
  393 + <block wx:if="{{enableMeiye}}">
  394 + <block wx:if="{{taoheList && taoheList.length > 0}}">
  395 + <view class="taohe fs28" wx:for="{{taoheList}}">
  396 + <view class="flex ai_c jc_sb" style="height: 88rpx;">
  397 + <view class="ellipsis-2 f1">{{item.goods_name}} ({{item.goods_sn}}) ({{item.frequency}}个)</view>
  398 + <view class="pdl30 t-r">
  399 + <view class="rmb fs36 bold c-red">{{item.vipprice}}</view>
  400 + <view class="fs22 c-9 del">零售价:¥{{item.show_price}}</view>
  401 + </view>
  402 + </view>
  403 + <view class="flex ai_c jc_sb fs24 c-6 pdt10">
  404 + <view class="ellipsis-1">备注:{{filters.show_default(item.remark, '无')}}</view>
  405 + <view class="pdl30 shrink0">有效期:{{filters.showStartAndEndDate(item,data.validDays)}}</view>
  406 + </view>
  407 + </view>
  408 + </block>
  409 + </block>
311 410
312 <view class="wxParse"> 411 <view class="wxParse">
313 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> 412 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
@@ -439,11 +538,63 @@ @@ -439,11 +538,63 @@
439 </view> 538 </view>
440 </view> 539 </view>
441 540
442 - 541 +
443 <view class="flex f1 btn-group"> 542 <view class="flex f1 btn-group">
444 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>  
445 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view> 543 +
  544 + <!-- 从“秒杀”入口进入购买商品 -->
  545 + <!-- <block wx:if="{{options.prom_type == 1}}"> -->
  546 + <block wx:if="{{options.prom_type == 1}}">
  547 + <block wx:if="{{prom_st==1 && !prom_r_null}}">
  548 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
  549 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即抢购</view>
  550 + </block>
  551 +
  552 + <block wx:if="{{prom_st == 0 && !prom_r_null}}">
  553 + <!-- 秒杀预热要单独购买 -->
  554 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  555 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  556 + <view class="buy-btn cart-btn lanse">即将开始</view>
  557 + </block>
  558 + <block wx:else>
  559 + <view class="buy-btn cart-btn cart-btn-lg lanse set_width f1">即将开始</view>
  560 + </block>
  561 + </block>
  562 +
  563 +
  564 + <block wx:if="{{prom_r_null}}">
  565 +
  566 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  567 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  568 + <view class="buy-btn cart-btn huise f1">已抢光</view>
  569 + </block>
  570 + <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">已抢光</view>
  571 + </block>
  572 +
  573 + <block wx:if="{{prom_st==3 && !prom_r_null}}">
  574 + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}">
  575 + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn f1">单独购买</view>
  576 + <view class="buy-btn cart-btn huise f1">活动已经结束</view>
  577 + </block>
  578 +
  579 + <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width f1">活动已经结束</view>
  580 + </block>
  581 + </block>
  582 + <!-- </block> -->
  583 +
  584 +
  585 + <!-- 从“我的服务”入口进入购买商品 -->
  586 + <block wx:else>
  587 + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
  588 + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view>
  589 + </block>
  590 +
  591 +
  592 +
446 </view> 593 </view>
  594 +
  595 +
  596 +
  597 +
447 598
448 </view> 599 </view>
449 600
@@ -558,10 +709,20 @@ @@ -558,10 +709,20 @@
558 <block wx:else> 709 <block wx:else>
559 <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32 {{!sto_sele_name?'gray':''}}" 710 <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32 {{!sto_sele_name?'gray':''}}"
560 data-action="add">加入购物车</view> 711 data-action="add">加入购物车</view>
561 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}"  
562 - data-action="buy">  
563 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
564 - </view> 712 + <!-- 秒杀 -->
  713 + <block wx:if="{{options.prom_type == 1}}">
  714 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}"
  715 + data-action="buy" data-promtype="{{options.prom_type}}" data-promid="{{options.prom_id}}">
  716 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  717 + </view>
  718 + </block>
  719 + <!-- 普通商品 -->
  720 + <block wx:else>
  721 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy {{!sto_sele_name?'gray':''}}"
  722 + data-action="buy">
  723 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  724 + </view>
  725 + </block>
565 </block> 726 </block>
566 </block> 727 </block>
567 </block> 728 </block>
packageA/pages/goodsInfo/goodsInfo.wxss
@@ -1025,25 +1025,37 @@ left:31rpx;} @@ -1025,25 +1025,37 @@ left:31rpx;}
1025 .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx; 1025 .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx;
1026 /* border-bottom: 3rpx solid #eee; */ 1026 /* border-bottom: 3rpx solid #eee; */
1027 /* border-top: 3rpx solid #eee; */} 1027 /* border-top: 3rpx solid #eee; */}
1028 - .bz_view view{ width: 460rpx; /* max-height: 70rpx; */ /* overflow: hidden; */} 1028 + .bz_view view{ width: 520rpx; /* max-height: 70rpx; */ /* overflow: hidden; */}
1029 1029
1030 .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333; 1030 .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333;
1031 font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ } 1031 font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ }
1032 .red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */} 1032 .red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */}
1033 -.bg_jj{ width: 14rpx; height:14rpx;  
1034 - border-top: 2rpx solid #d70026;  
1035 - border-right: 2rpx solid #d70026;  
1036 - transform: rotate(45deg);display:inline-block;  
1037 - margin-bottom:3rpx; 1033 +
  1034 +.bg_jj {
  1035 + width: 14rpx;
  1036 + height: 14rpx;
  1037 + border-top: 2rpx solid #d70026;
  1038 + border-right: 2rpx solid #d70026;
  1039 + transform: rotateZ(45deg);
  1040 + display: inline-block;
  1041 + margin-bottom: 3rpx;
  1042 +}
  1043 +
  1044 +.bg_jj.down {
  1045 + transform: rotateZ(135deg);
  1046 +}
  1047 +
  1048 +.bg_jj.up {
  1049 + transform: rotateZ(-45deg);
  1050 + margin-top: 6rpx;
1038 } 1051 }
1039 -.bg_jj.down1{transform: rotate(135deg);}  
1040 1052
1041 .bz-content { 1053 .bz-content {
1042 - flex-grow: 1;  
1043 - text-align: justify;  
1044 - padding: 0 30rpx 0 20rpx; 1054 + padding: 0 0 0 20rpx;
1045 } 1055 }
1046 1056
  1057 +
  1058 +
1047 /* 顶部边框 */ 1059 /* 顶部边框 */
1048 .topframe{ 1060 .topframe{
1049 width: 100%; 1061 width: 100%;
@@ -2845,7 +2857,8 @@ button.custom-service::after{ @@ -2845,7 +2857,8 @@ button.custom-service::after{
2845 width: auto !important; 2857 width: auto !important;
2846 position: absolute; 2858 position: absolute;
2847 right: 0; 2859 right: 0;
2848 - top: 10rpx; 2860 + top: 50%;
  2861 + transform: translateY(-50%);
2849 } 2862 }
2850 2863
2851 .stock { 2864 .stock {
@@ -2907,3 +2920,51 @@ button.custom-service::after{ @@ -2907,3 +2920,51 @@ button.custom-service::after{
2907 .del { 2920 .del {
2908 text-decoration: line-through; 2921 text-decoration: line-through;
2909 } 2922 }
  2923 +
  2924 +
  2925 +
  2926 +
  2927 +.tick {
  2928 + position: relative;
  2929 +}
  2930 +
  2931 +.tick:before {
  2932 + content: '';
  2933 + display: inline-block;
  2934 + vertical-align: middle;
  2935 + margin-top: -4rpx;
  2936 + margin-right: 12rpx;
  2937 + width: 22rpx;
  2938 + height: 22rpx;
  2939 + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABCUExURUdwTPInDPInDPgoDfMnDPYqEvInDPInDPInDP87NPUoDv8vEvMoDPInDPIoDPMnDvInDPInDPInDPIoDPQoDfInDEON4KMAAAAVdFJOUwD45yawG4zz3gQ0DmLOfECQZpPlS54kMQ4AAAC0SURBVBjTbZFREoMgDERDS0xQQNHu/a/alEGtaIYfHrBhs0S1pujVifo40VkhC+BUHSDzQTlBhjHY8bjogXmDZ+orJKwXwMUeUoa/0PeGbH8Q4Y5CJopYOjosiOQxdpRGk1UXOkrBKdkimtN8UrKrJBVXdzsllSYSjR/0J9JaGn81WluWtonYKQ0op51P3M2L2bmZN9n8MKoVqTph/RsseyjfYxAkfgot/82CpuJVLOLSIv4Cd5AJ37BgpFwAAAAASUVORK5CYII=) no-repeat;
  2940 + background-size: 22rpx auto;
  2941 +}
  2942 +
  2943 +.details::after {
  2944 + content: '';
  2945 + position: absolute;
  2946 + right: 0;
  2947 + top: 0;
  2948 + bottom: 0;
  2949 + margin: auto;
  2950 + display: inline-block;
  2951 + width: 40rpx;
  2952 + height: 40rpx;
  2953 + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAVUExURUdwTIyMjCYmJiYmJi0tLY+PjyYmJidnOsIAAAAGdFJOUwDt6aYcSSEXj/YAAAA8SURBVCjPY2AYBTQBLEbKDhiCTmlpKggeq2AAiDJLS0tGcBkFBUActbS0JAY4F6sgVu1YLcLnpFFAFQAATwgLKVhjC9UAAAAASUVORK5CYII=);
  2954 + background-repeat: no-repeat;
  2955 + background-size: 40rpx auto;
  2956 +}
  2957 +
  2958 +.lh2 {
  2959 + line-height: 2;
  2960 +}
  2961 +
  2962 +.huise {
  2963 + background: gray
  2964 +}
  2965 +
  2966 +.hideArea {
  2967 + position: absolute;
  2968 + left: -1000px;
  2969 + top: -1000px;
  2970 +}
packageA/pages/jfbuy/jfbuy.wxss
@@ -130,7 +130,7 @@ page { @@ -130,7 +130,7 @@ page {
130 .img-container { 130 .img-container {
131 background-color: #f0f0f0; 131 background-color: #f0f0f0;
132 width: 280rpx; 132 width: 280rpx;
133 - height: 248rpx; 133 + height: 280rpx;
134 display: flex; 134 display: flex;
135 align-items: center; 135 align-items: center;
136 justify-content: center; 136 justify-content: center;
packageA/pages/liveStream/liveStream.js
@@ -208,14 +208,14 @@ Page({ @@ -208,14 +208,14 @@ Page({
208 * 生命周期函数--监听页面加载 208 * 生命周期函数--监听页面加载
209 */ 209 */
210 onLoad: function (options) { 210 onLoad: function (options) {
211 - self = this;  
212 - // console.log('ppppp',this.pageTotal(4, 10)); 211 + getApp().is_Single_page(this,function(){
  212 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  213 + this.setData({
  214 + userInfo: data,
  215 + });
  216 + });
  217 + })
213 218
214 - app.isLogin().then(function(data) {//进入页面前已经授权登录成功  
215 - self.setData({  
216 - userInfo: data,  
217 - });  
218 - });  
219 }, 219 },
220 220
221 /** 221 /**
packageA/pages/quan_list/quan_list.wxml
@@ -4,44 +4,46 @@ @@ -4,44 +4,46 @@
4 4
5 <block wx:if="{{config2.couponset}}"> 5 <block wx:if="{{config2.couponset}}">
6 <view class="header"> 6 <view class="header">
7 - <rich-text nodes="{{config2.couponset}}" class="r_txt fs26"></rich-text> 7 + <rich-text nodes="{{config2.couponset}}" class="r_txt fs26"></rich-text>
8 </view> 8 </view>
9 </block> 9 </block>
10 <view class="content"> 10 <view class="content">
11 - <view bindtap="go_detail" data-ind="{{index}}" class="quan_item flex fs30" wx:for="{{dataList}}"> 11 + <view bindtap="go_detail" data-ind="{{index}}" class="quan_item flex fs30" wx:for="{{dataList}}">
12 <!-- 左边 --> 12 <!-- 左边 -->
13 <view class="left {{tool.get_color(index,dataList)}} flex ai-center jc-center co-w"> 13 <view class="left {{tool.get_color(index,dataList)}} flex ai-center jc-center co-w">
14 <view class="t-c"> 14 <view class="t-c">
15 - <view class="fs40"><text class="fs24">¥</text>{{filters.toFix(item.money,2)}}</view>  
16 - <view>满{{filters.toFix(item.condition,2)}}可用</view> 15 + <view class="fs40"><text class="fs24">¥</text>{{filters.toFix(item.money,2)}}</view>
  16 + <view>满{{filters.toFix(item.condition,2)}}可用</view>
17 </view> 17 </view>
18 </view> 18 </view>
19 - <!-- 右边 --> 19 + <!-- 右边 -->
20 <view class="right fs24 co_g pding" style="background-image:url({{iurl}}/miniapp/images/coupon_img/white.png); position: relative"> 20 <view class="right fs24 co_g pding" style="background-image:url({{iurl}}/miniapp/images/coupon_img/white.png); position: relative">
21 - <view class="fs28 co_b" style="margin-top: 15rpx">{{item.name}}</view> 21 + <view class="fs28 co_b" style="margin-top: 15rpx">{{item.name}}</view>
22 22
23 - <view class="ellipsis-1" style="margin-top: 5rpx" wx:if="{{item.coupon_remark!=null && item.coupon_remark!=''}}">{{item.coupon_remark}}</view>  
24 - <view style="margin-top: 5rpx" wx:else>所有门店通用</view>  
25 - <view wx:if="{{item.endtype==0}}">有效期  
26 - <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text>  
27 - <text wx:if="{{item.starttype==0 && item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>至  
28 - <text wx:if="{{item.use_end_time>0}}"> {{filters.format_time(item.use_end_time)}}</text><text wx:else>不限</text>  
29 - </view>  
30 - <view wx:else>有效期 <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text> 23 + <view class="ellipsis-1" style="margin-top: 5rpx" wx:if="{{item.coupon_remark!=null && item.coupon_remark!=''}}">{{item.coupon_remark}}</view>
  24 + <view style="margin-top: 5rpx" wx:else>所有门店通用</view>
  25 + <view wx:if="{{item.endtype==0}}">有效期
  26 + <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text>
  27 + <text wx:if="{{item.starttype==0 && item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>
  28 + 至
  29 + <text wx:if="{{item.use_end_time>0}}"> {{filters.format_time(item.use_end_time)}}</text><text wx:else>不限</text>
  30 + </view>
  31 + <view wx:else>有效期
  32 + <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text>
31 <text wx:else>{{filters.format_time(getcurday)}}</text> 33 <text wx:else>{{filters.format_time(getcurday)}}</text>
32 34
33 - <text wx:if="{{item.days>0}}">{{filters.format_time(getcurday+3600*24*item.days)}}</text>  
34 - <text wx:else>不限</text>  
35 -  
36 - </view>  
37 - <view>每人限领:<text wx:if="{{item.everyone_num>0}}">{{item.everyone_num}}</text><text wx:else>不限</text></view>  
38 - <!-- 领取按钮 -->  
39 - <view data-ind="{{index}}" data-cid="{{item.id}}" catchtap="get_quan"> 35 + <text wx:if="{{item.days>0}}">{{filters.format_time(getcurday+3600*24*item.days+3600*24*item.startdays)}}</text>
  36 + <text wx:else>不限</text>
  37 +
  38 + </view>
  39 + <view>每人限领:<text wx:if="{{item.everyone_num>0}}">{{item.everyone_num}}</text><text wx:else>不限</text></view>
  40 + <!-- 领取按钮 -->
  41 + <view data-ind="{{index}}" data-cid="{{item.id}}" catchtap="get_quan">
40 <view wx:if="{{item.everyone_num>0 && item.lqnum>=item.everyone_num}}" class="btn flex jc-center ai-center is_get">已领取</view> 42 <view wx:if="{{item.everyone_num>0 && item.lqnum>=item.everyone_num}}" class="btn flex jc-center ai-center is_get">已领取</view>
41 <view wx:else class="btn flex jc-center ai-center">立即领取</view> 43 <view wx:else class="btn flex jc-center ai-center">立即领取</view>
42 - </view> 44 + </view>
43 </view> 45 </view>
44 - </view> 46 + </view>
45 </view> 47 </view>
46 48
47 <view wx:if="{{show_success}}"> 49 <view wx:if="{{show_success}}">
@@ -58,5 +60,4 @@ @@ -58,5 +60,4 @@
58 </view> 60 </view>
59 61
60 <warn id="warn"></warn> 62 <warn id="warn"></warn>
61 -<nav_box id="nav"></nav_box>  
62 - 63 +<nav_box id="nav"></nav_box>
63 \ No newline at end of file 64 \ No newline at end of file
packageA/pages/quan_pro/quan_pro.wxml
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <view wx:else class="lower fs30">有效期 40 <view wx:else class="lower fs30">有效期
41 <text wx:if="{{ q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> 41 <text wx:if="{{ q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text>
42 <text wx:else>{{filters.format_time(getcurday)}}</text>至 42 <text wx:else>{{filters.format_time(getcurday)}}</text>至
43 - <text wx:if="{{q_data.days>0}}"> {{filters.format_time(getcurday+3600*24*q_data.days)}}</text><text wx:else>不限</text> 43 + <text wx:if="{{q_data.days>0}}"> {{filters.format_time(getcurday+3600*24*q_data.days+3600*24*q_data.startdays)}}</text><text wx:else>不限</text>
44 </view> 44 </view>
45 </block> 45 </block>
46 46
packageB/pages/luckactivity/luckinfo/luckinfo.js
@@ -1379,35 +1379,6 @@ Page({ @@ -1379,35 +1379,6 @@ Page({
1379 }; 1379 };
1380 }, 500); 1380 }, 500);
1381 }; 1381 };
1382 - // if(this.data.isImgOk) {  
1383 - // setTimeout(function() {  
1384 - // wx.hideLoading();  
1385 - // self.setData({  
1386 - // myimg: self.data.imgPath,  
1387 - // hiddenCanvas: true,  
1388 - // showMask: true,  
1389 - // showPoster: true,  
1390 - // });  
1391 - // }, 300);  
1392 -  
1393 - // } else {  
1394 - // wx.showToast({  
1395 - // title: '生成失败,请重新点击',  
1396 - // icon: 'none',  
1397 - // });  
1398 - // };  
1399 -  
1400 - // setTimeout(function() {  
1401 - // // if(self.data.myimg) {  
1402 - // if(self.data.imgPath) {  
1403 - // wx.hideLoading();  
1404 -  
1405 - // } else {  
1406 - // console.log('没有生成图片!!!!!!', self.data.imgPath);  
1407 - // };  
1408 -  
1409 - // // }  
1410 - // }, 300);  
1411 }, 1382 },
1412 1383
1413 closePoster() { 1384 closePoster() {
packageB/pages/zuhegou/index/index.js
@@ -11,80 +11,80 @@ let imgDraw = { @@ -11,80 +11,80 @@ let imgDraw = {
11 "height": "843px", 11 "height": "843px",
12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg", 12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg",
13 "views": [{ // 头像 13 "views": [{ // 头像
14 - "type": "image",  
15 - "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",  
16 - "css": {  
17 - "width": "100px",  
18 - "height": "100px",  
19 - "top": "20px",  
20 - "left": "275px",  
21 - "borderRadius": "100px",  
22 - "mode": "scaleToFill",  
23 - "borderWidth": "2px",  
24 - "borderColor": "#fff",  
25 - }  
26 - },  
27 - { //昵称  
28 - "type": "text",  
29 - "text": "我是店铺名",  
30 - "css": {  
31 - "width": "650px",  
32 - "color": "#fff",  
33 - "top": "136px",  
34 - // "left": "137px",  
35 - "textAlign": "center",  
36 - "fontSize": "26px",  
37 - "maxLines": "1",  
38 - }  
39 - },  
40 - { //10元任选3件  
41 - "type": "text",  
42 - "text": "10元3件",  
43 - "css": {  
44 - "color": "#fff",  
45 - "width": "650px",  
46 - "top": "270px",  
47 - "fontSize": "70px",  
48 - "maxLines": "1",  
49 - "textAlign": "center",  
50 - "fontWeight": "bold",  
51 - }  
52 - },  
53 - { //活动时间  
54 - "type": "text",  
55 - "text": "活动时间:2021.07.06 - 2021.07.08",  
56 - "css": {  
57 - "color": "#333",  
58 - "width": "650px",  
59 - "top": "440px",  
60 - "fontSize": "26px",  
61 - "fontWeight": "normal",  
62 - "maxLines": "1",  
63 - "textAlign": "center"  
64 - }  
65 - },  
66 - { // 码  
67 - "type": "image",  
68 - "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",  
69 - "css": {  
70 - "color": "#000",  
71 - "width": "200px",  
72 - "height": "200px",  
73 - "top": "525px",  
74 - "left": "225px",  
75 - }  
76 - },  
77 - { // 扫码提示  
78 - "type": "text",  
79 - "text": "长按扫码即可参与活动",  
80 - "css": {  
81 - "color": "#666",  
82 - "width": "650px",  
83 - "top": "750px",  
84 - "fontSize": "26px",  
85 - "textAlign": "center"  
86 - }  
87 - }, 14 + "type": "image",
  15 + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",
  16 + "css": {
  17 + "width": "100px",
  18 + "height": "100px",
  19 + "top": "20px",
  20 + "left": "275px",
  21 + "borderRadius": "100px",
  22 + "mode": "scaleToFill",
  23 + "borderWidth": "2px",
  24 + "borderColor": "#fff",
  25 + }
  26 + },
  27 + { //昵称
  28 + "type": "text",
  29 + "text": "我是店铺名",
  30 + "css": {
  31 + "width": "650px",
  32 + "color": "#fff",
  33 + "top": "136px",
  34 + // "left": "137px",
  35 + "textAlign": "center",
  36 + "fontSize": "26px",
  37 + "maxLines": "1",
  38 + }
  39 + },
  40 + { //10元任选3件
  41 + "type": "text",
  42 + "text": "10元3件",
  43 + "css": {
  44 + "color": "#fff",
  45 + "width": "650px",
  46 + "top": "270px",
  47 + "fontSize": "70px",
  48 + "maxLines": "1",
  49 + "textAlign": "center",
  50 + "fontWeight": "bold",
  51 + }
  52 + },
  53 + { //活动时间
  54 + "type": "text",
  55 + "text": "活动时间:2021.07.06 - 2021.07.08",
  56 + "css": {
  57 + "color": "#333",
  58 + "width": "650px",
  59 + "top": "440px",
  60 + "fontSize": "26px",
  61 + "fontWeight": "normal",
  62 + "maxLines": "1",
  63 + "textAlign": "center"
  64 + }
  65 + },
  66 + { // 码
  67 + "type": "image",
  68 + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",
  69 + "css": {
  70 + "color": "#000",
  71 + "width": "200px",
  72 + "height": "200px",
  73 + "top": "525px",
  74 + "left": "225px",
  75 + }
  76 + },
  77 + { // 扫码提示
  78 + "type": "text",
  79 + "text": "长按扫码即可参与活动",
  80 + "css": {
  81 + "color": "#666",
  82 + "width": "650px",
  83 + "top": "750px",
  84 + "fontSize": "26px",
  85 + "textAlign": "center"
  86 + }
  87 + },
88 ] 88 ]
89 }; 89 };
90 90
@@ -123,6 +123,7 @@ Page({ @@ -123,6 +123,7 @@ Page({
123 * 生命周期函数--监听页面加载 123 * 生命周期函数--监听页面加载
124 */ 124 */
125 onLoad: function (options) { 125 onLoad: function (options) {
  126 +
126 console.log(options, 111); 127 console.log(options, 111);
127 self = this; 128 self = this;
128 var the_id = options.id; 129 var the_id = options.id;
@@ -153,226 +154,224 @@ Page({ @@ -153,226 +154,224 @@ Page({
153 } 154 }
154 }) 155 })
155 } 156 }
156 -  
157 - //如果有会员的时候  
158 - var userInfo = getApp().globalData.userInfo;  
159 - if (!userInfo) {  
160 - getApp().goto("/pages/togoin/togoin");  
161 - return false;  
162 - }  
163 }, 157 },
164 158
165 /** 159 /**
166 * 生命周期函数--监听页面显示 160 * 生命周期函数--监听页面显示
167 */ 161 */
168 onShow: function () { 162 onShow: function () {
169 - var th = this,  
170 - that = this,  
171 - ee = this;  
172 - this.data.is_timer = 1;  
173 - if (this.data.act) this.countDown();  
174 - //如果有会员的时候  
175 - var userInfo = getApp().globalData.userInfo;  
176 - if (userInfo) {  
177 - if (!th.data.is_get_act) {  
178 - //获取活动信息  
179 - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + th.data.id + "/" + userInfo.user_id;  
180 - getApp().request.get(url, {  
181 - success: function (e) {  
182 - th.data.is_get_act = 1;  
183 - if (e.data.code == 0 && e.data.data) {  
184 - self.setData({  
185 - act: e.data.data  
186 - });  
187 - if (e.data.data.is_show != 1) {  
188 - th.setData({  
189 - error: '活动未开启'  
190 - });  
191 - return false;  
192 - }  
193 - if (ut.gettimestamp() < e.data.data.start_time) {  
194 - th.setData({  
195 - error: '活动还未开始' 163 + getApp().is_Single_page(this, function () {
  164 + var th = this,
  165 + that = this,
  166 + ee = this;
  167 + this.data.is_timer = 1;
  168 + if (this.data.act) this.countDown();
  169 + //如果有会员的时候
  170 + var userInfo = getApp().globalData.userInfo;
  171 + if (userInfo) {
  172 + if (!th.data.is_get_act) {
  173 + //获取活动信息
  174 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + th.data.id + "/" + userInfo.user_id;
  175 + getApp().request.get(url, {
  176 + success: function (e) {
  177 + th.data.is_get_act = 1;
  178 + if (e.data.code == 0 && e.data.data) {
  179 + self.setData({
  180 + act: e.data.data
196 }); 181 });
197 - return false;  
198 - }  
199 - if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) {  
200 - //-- 获取商品列表 --  
201 - self.get_list();  
202 - self.countDown(); 182 + if (e.data.data.is_show != 1) {
  183 + th.setData({
  184 + error: '活动未开启'
  185 + });
  186 + return false;
  187 + }
  188 + if (ut.gettimestamp() < e.data.data.start_time) {
  189 + th.setData({
  190 + error: '活动还未开始'
  191 + });
  192 + return false;
  193 + }
  194 + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) {
  195 + //-- 获取商品列表 --
  196 + self.get_list();
  197 + self.countDown();
  198 + } else {
  199 + th.setData({
  200 + error: '活动已经过期'
  201 + });
  202 + return false;
  203 + }
203 } else { 204 } else {
  205 + th.data.is_get_act = 0;
204 th.setData({ 206 th.setData({
205 - error: '活动已经过期' 207 + error: e.data.msg
206 }); 208 });
207 return false; 209 return false;
208 } 210 }
209 - } else {  
210 - th.data.is_get_act = 0;  
211 - th.setData({  
212 - error: e.data.msg  
213 - });  
214 - return false;  
215 } 211 }
216 - }  
217 - });  
218 - }  
219 -  
220 - //等待活动值  
221 - this.waitfor2(10, 'list', function () {  
222 - if (!th.data.list) return false;  
223 - if (ut.gettimestamp() < th.data.act.start_time) {  
224 - return false;  
225 - }  
226 - if (th.data.act.is_end == 10 || ut.gettimestamp() >= th.data.act.end_time) {  
227 - return false; 212 + });
228 } 213 }
229 - //获取头像的分享  
230 - th.get_head_temp(function () {  
231 - var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件";  
232 - imgDraw.views[0].url = th.data.share_head;  
233 - imgDraw.views[1].text = userInfo.nickname;  
234 - imgDraw.views[2].text = txt;  
235 -  
236 - var start = ut.formar_no_full(th.data.act.start_time, '.');  
237 - var end = ut.formar_no_full(th.data.act.end_time, '.');  
238 - txt = "活动时间:" + start + " - " + end;  
239 - imgDraw.views[3].text = txt;  
240 -  
241 - var scene = th.data.id + "";  
242 - var user_id = getApp().globalData.user_id;  
243 - scene += "_" + user_id;  
244 - ///二微码  
245 - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +  
246 - os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index";  
247 - wx.getImageInfo({  
248 - src: path3,  
249 - success: function (res) {  
250 - var vpath = res.path;  
251 - imgDraw.views[4].url = vpath;  
252 - th.setData({  
253 - imgDraw: imgDraw  
254 - })  
255 - }  
256 - })  
257 - })  
258 214
259 - //获取用户的默认门店  
260 - getApp().get_user_store(function (e) {  
261 - if (!e) {  
262 - th.data.fir_def_store = {}; //赋值空对象 215 + //等待活动值
  216 + this.waitfor2(10, 'list', function () {
  217 + if (!th.data.list) return false;
  218 + if (ut.gettimestamp() < th.data.act.start_time) {
  219 + return false;
  220 + }
  221 + if (th.data.act.is_end == 10 || ut.gettimestamp() >= th.data.act.end_time) {
263 return false; 222 return false;
264 } 223 }
  224 + //获取头像的分享
  225 + th.get_head_temp(function () {
  226 + var txt = th.data.act.zhprice + "元" + th.data.act.zhbuyqty + "件";
  227 + imgDraw.views[0].url = th.data.share_head;
  228 + imgDraw.views[1].text = userInfo.nickname;
  229 + imgDraw.views[2].text = txt;
  230 +
  231 + var start = ut.formar_no_full(th.data.act.start_time, '.');
  232 + var end = ut.formar_no_full(th.data.act.end_time, '.');
  233 + txt = "活动时间:" + start + " - " + end;
  234 + imgDraw.views[3].text = txt;
  235 +
  236 + var scene = th.data.id + "";
  237 + var user_id = getApp().globalData.user_id;
  238 + scene += "_" + user_id;
  239 + ///二微码
  240 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  241 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index";
  242 + wx.getImageInfo({
  243 + src: path3,
  244 + success: function (res) {
  245 + var vpath = res.path;
  246 + imgDraw.views[4].url = vpath;
  247 + th.setData({
  248 + imgDraw: imgDraw
  249 + })
  250 + }
  251 + })
  252 + })
265 253
  254 + //获取用户的默认门店
  255 + getApp().get_user_store(function (e) {
  256 + if (!e) {
  257 + th.data.fir_def_store = {}; //赋值空对象
  258 + return false;
  259 + }
266 260
267 261
268 - var ee = JSON.parse(JSON.stringify(e));  
269 - var appd = getApp().globalData;  
270 - //-- 等待定位系统的开启 --  
271 - th.waitfor2(15, 'is_get_local_ok', function () {  
272 262
273 - if (!th.data.is_get_local_ok) return false; 263 + var ee = JSON.parse(JSON.stringify(e));
  264 + var appd = getApp().globalData;
  265 + //-- 等待定位系统的开启 --
  266 + th.waitfor2(15, 'is_get_local_ok', function () {
274 267
275 - var e = JSON.parse(JSON.stringify(ee));  
276 - //如果有开启近距离的话,同时距离优不一样了  
277 - if (that.data.lat != null) {  
278 - //如果经纬度有变化的话  
279 - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {  
280 - that.set_def_storage(e);  
281 - } else {  
282 - //要用接口是获取距离,js的计算不准  
283 - getApp().request.promiseGet("/api/weshop/pickup/list", {  
284 - data: {  
285 - store_id: os.stoid,  
286 - pickup_id: e.pickup_id,  
287 - is_pos: 1,  
288 - lat: th.data.lat,  
289 - lon: th.data.lon  
290 - },  
291 - }).then(res => {  
292 - if (res.data.code == 0) {  
293 - e = res.data.data.pageData[0];  
294 - if (e) {  
295 - e.is_no_dis = ee.is_no_dis;  
296 - appd.pk_store = e;  
297 - that.set_def_storage(e);  
298 - } 268 + if (!th.data.is_get_local_ok) return false;
299 269
300 - }  
301 - })  
302 - }  
303 - appd.lat = that.data.lat;  
304 - appd.lon = that.data.lon;  
305 - } else {  
306 - if (e) {  
307 - e.distance = null;  
308 - that.set_def_storage(e);  
309 - }  
310 - }  
311 - })  
312 - }); 270 + var e = JSON.parse(JSON.stringify(ee));
  271 + //如果有开启近距离的话,同时距离优不一样了
  272 + if (that.data.lat != null) {
  273 + //如果经纬度有变化的话
  274 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  275 + that.set_def_storage(e);
  276 + } else {
  277 + //要用接口是获取距离,js的计算不准
  278 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  279 + data: {
  280 + store_id: os.stoid,
  281 + pickup_id: e.pickup_id,
  282 + is_pos: 1,
  283 + lat: th.data.lat,
  284 + lon: th.data.lon
  285 + },
  286 + }).then(res => {
  287 + if (res.data.code == 0) {
  288 + e = res.data.data.pageData[0];
  289 + if (e) {
  290 + e.is_no_dis = ee.is_no_dis;
  291 + appd.pk_store = e;
  292 + that.set_def_storage(e);
  293 + }
313 294
314 - //----获取系统参数-----  
315 - getApp().getConfig2(function (e) {  
316 - ee.setData({  
317 - bconfig: e,  
318 - sales_rules: e.sales_rules,  
319 - });  
320 - //设置基本参数  
321 - th.wait_for_store_config(e);  
322 -  
323 - var json_d = JSON.parse(e.switch_list);  
324 - ee.setData({  
325 - store_config: e,  
326 - sys_switch: json_d,  
327 - is_closecoupon: json_d.is_closecoupon,  
328 - is_newsales_rules: json_d.is_newsales_rules,  
329 - is_open_offline: json_d.is_pricing_open,  
330 - sales_rules: e.sales_rules 295 + }
  296 + })
  297 + }
  298 + appd.lat = that.data.lat;
  299 + appd.lon = that.data.lon;
  300 + } else {
  301 + if (e) {
  302 + e.distance = null;
  303 + that.set_def_storage(e);
  304 + }
  305 + }
  306 + })
331 }); 307 });
332 308
333 - //-- 计算等级价相关 --  
334 - var swithc_list = e.switch_list;  
335 - var sw_arr = JSON.parse(swithc_list);  
336 - //---如果后台又开等级卡的开关---  
337 - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {  
338 - th.setData({  
339 - rank_switch: true 309 + //----获取系统参数-----
  310 + getApp().getConfig2(function (e) {
  311 + ee.setData({
  312 + bconfig: e,
  313 + sales_rules: e.sales_rules,
  314 + });
  315 + //设置基本参数
  316 + th.wait_for_store_config(e);
  317 +
  318 + var json_d = JSON.parse(e.switch_list);
  319 + ee.setData({
  320 + store_config: e,
  321 + sys_switch: json_d,
  322 + is_closecoupon: json_d.is_closecoupon,
  323 + is_newsales_rules: json_d.is_newsales_rules,
  324 + is_open_offline: json_d.is_pricing_open,
  325 + sales_rules: e.sales_rules
340 }); 326 });
341 - //---回调卡的列表---  
342 - th.getPlusCardType(function (ob) { 327 +
  328 + //-- 计算等级价相关 --
  329 + var swithc_list = e.switch_list;
  330 + var sw_arr = JSON.parse(swithc_list);
  331 + //---如果后台又开等级卡的开关---
  332 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
343 th.setData({ 333 th.setData({
344 - card_list: ob.card_list 334 + rank_switch: true
345 }); 335 });
346 - var user = getApp().globalData.userInfo;  
347 - if (!user) return false;  
348 - if (user.card_field && user['card_expiredate']) {  
349 - var str = user['card_expiredate'].replace(/-/g, '/');  
350 - var end = new Date(str);  
351 - end = Date.parse(end) / 1000;  
352 - var now = ut.gettimestamp();  
353 - //--- 判断是等级会员,且在有效期范围内 ---  
354 - if (user.card_field && now < end) {  
355 - var card_name = ob.name_map.get(user.card_field);  
356 - th.setData({  
357 - card_field: user.card_field,  
358 - card_name: card_name,  
359 - card_list: ob.card_list  
360 - }); 336 + //---回调卡的列表---
  337 + th.getPlusCardType(function (ob) {
  338 + th.setData({
  339 + card_list: ob.card_list
  340 + });
  341 + var user = getApp().globalData.userInfo;
  342 + if (!user) return false;
  343 + if (user.card_field && user['card_expiredate']) {
  344 + var str = user['card_expiredate'].replace(/-/g, '/');
  345 + var end = new Date(str);
  346 + end = Date.parse(end) / 1000;
  347 + var now = ut.gettimestamp();
  348 + //--- 判断是等级会员,且在有效期范围内 ---
  349 + if (user.card_field && now < end) {
  350 + var card_name = ob.name_map.get(user.card_field);
  351 + th.setData({
  352 + card_field: user.card_field,
  353 + card_name: card_name,
  354 + card_list: ob.card_list
  355 + });
  356 + }
361 } 357 }
362 - } 358 + //获取购物车的内容
  359 + th.get_cart_val(e);
  360 +
  361 + })
  362 + } else {
363 //获取购物车的内容 363 //获取购物车的内容
364 th.get_cart_val(e); 364 th.get_cart_val(e);
  365 + }
  366 + }, 1);
365 367
366 - })  
367 - } else {  
368 - //获取购物车的内容  
369 - th.get_cart_val(e);  
370 - }  
371 - }, 1);  
372 -  
373 - }) 368 + })
374 369
375 - } 370 + } else {
  371 + getApp().goto("/pages/togoin/togoin");
  372 + return false;
  373 + }
  374 + })
376 }, 375 },
377 376
378 onHide: function () { 377 onHide: function () {
@@ -1895,7 +1894,7 @@ Page({ @@ -1895,7 +1894,7 @@ Page({
1895 1894
1896 getApp().request.put("/api/weshop/cart/update", { 1895 getApp().request.put("/api/weshop/cart/update", {
1897 data: updata, 1896 data: updata,
1898 - success: function (t) {} 1897 + success: function (t) { }
1899 }); 1898 });
1900 th.re_sum_price(); 1899 th.re_sum_price();
1901 }) 1900 })
@@ -1972,7 +1971,7 @@ Page({ @@ -1972,7 +1971,7 @@ Page({
1972 if (this.data.act.is_bzyh && zhqty_bz.length > 0) { 1971 if (this.data.act.is_bzyh && zhqty_bz.length > 0) {
1973 if (zhqty_bz.length > 1) { 1972 if (zhqty_bz.length > 1) {
1974 let zhqty_bz_arr = []; 1973 let zhqty_bz_arr = [];
1975 - let zhqty_bz_flag=this.zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr); 1974 + let zhqty_bz_flag = this.zhqty_bz_fun(zhqty_bz, be, zhqty_bz_arr);
1976 1975
1977 if (zhqty_bz_flag) { 1976 if (zhqty_bz_flag) {
1978 for (let i = 0; i < zhqty_bz.length; i++) { 1977 for (let i = 0; i < zhqty_bz.length; i++) {
@@ -1988,7 +1987,7 @@ Page({ @@ -1988,7 +1987,7 @@ Page({
1988 } 1987 }
1989 } 1988 }
1990 } else { 1989 } else {
1991 - zhqty_len=1; 1990 + zhqty_len = 1;
1992 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) { 1991 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
1993 return o['num']; 1992 return o['num'];
1994 })); 1993 }));
@@ -2012,9 +2011,9 @@ Page({ @@ -2012,9 +2011,9 @@ Page({
2012 } 2011 }
2013 bz_num_ok = be * vv.zhqty; 2012 bz_num_ok = be * vv.zhqty;
2014 } 2013 }
2015 -  
2016 - for(let i = 0; i < zhqty_bz.length; i++){  
2017 - let item1=zhqty_bz[i]; 2014 +
  2015 + for (let i = 0; i < zhqty_bz.length; i++) {
  2016 + let item1 = zhqty_bz[i];
2018 for (let j = 0; j < be * item1['zhqty']; j++) { 2017 for (let j = 0; j < be * item1['zhqty']; j++) {
2019 let index = no_in_arr.findIndex(i => { 2018 let index = no_in_arr.findIndex(i => {
2020 return item1.goods_id === i.goods_id 2019 return item1.goods_id === i.goods_id
@@ -2258,14 +2257,14 @@ Page({ @@ -2258,14 +2257,14 @@ Page({
2258 2257
2259 }, 2258 },
2260 2259
2261 - zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr){  
2262 - let zhqty_bz_flag =true;  
2263 - for(let i=0;i<zhqty_bz.length;i++){  
2264 - let item=zhqty_bz[i]; 2260 + zhqty_bz_fun(zhqty_bz, be, zhqty_bz_arr) {
  2261 + let zhqty_bz_flag = true;
  2262 + for (let i = 0; i < zhqty_bz.length; i++) {
  2263 + let item = zhqty_bz[i];
2265 let bz_num = be * item['zhqty']; //超量倍增 2264 let bz_num = be * item['zhqty']; //超量倍增
2266 let num = item['num'] - item['zhqty']; //购买数量减去超量 2265 let num = item['num'] - item['zhqty']; //购买数量减去超量
2267 if (bz_num > num) { 2266 if (bz_num > num) {
2268 - zhqty_bz_flag=false; 2267 + zhqty_bz_flag = false;
2269 zhqty_bz_arr.push(item); 2268 zhqty_bz_arr.push(item);
2270 // zhqty_bz.splice(i,1) 2269 // zhqty_bz.splice(i,1)
2271 } 2270 }
packageB/pages/zuhegou/index/index.json
1 { 1 {
2 "usingComponents": { 2 "usingComponents": {
3 - "catch": "/packageB//components/catch/catch", 3 + "catch": "/packageB/components/catch/catch",
4 "nodata": "/components/nodata/nodata", 4 "nodata": "/components/nodata/nodata",
5 "painter": "/packageB/components/painter/painter", 5 "painter": "/packageB/components/painter/painter",
6 "warn": "/components/long_warn/long_warn" 6 "warn": "/components/long_warn/long_warn"
packageB/pages/zuhegou/index/index.wxml
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 </view> 16 </view>
17 17
18 18
19 - <view class="c_w mt20 fs32">门店: 19 + <view class="c_w mt20 fs28">门店:
20 <block wx:if="{{def_pick_store}}"> 20 <block wx:if="{{def_pick_store}}">
21 <text wx:if="{{all_price>0}}">{{def_pick_store.pickup_name}}</text> 21 <text wx:if="{{all_price>0}}">{{def_pick_store.pickup_name}}</text>
22 <text wx:else bindtap="choose_store">{{def_pick_store.pickup_name}}</text> 22 <text wx:else bindtap="choose_store">{{def_pick_store.pickup_name}}</text>
@@ -77,16 +77,16 @@ @@ -77,16 +77,16 @@
77 <view class="bar-container"> 77 <view class="bar-container">
78 <block wx:if="{{all_num>=act.zhbuyqty}}"> 78 <block wx:if="{{all_num>=act.zhbuyqty}}">
79 <view wx:if="{{need_to_buy}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20"> 79 <view wx:if="{{need_to_buy}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20">
80 - 再买{{need_to_buy}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 80 + 再买{{need_to_buy}}件,下单立享【{{act.zhprice}}元选择{{act.zhbuyqty}}件】
81 </view> 81 </view>
82 - <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20">下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】</view> 82 + <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20">下单立享【{{act.zhprice}}元选择{{act.zhbuyqty}}件】</view>
83 </block> 83 </block>
84 <block wx:else> 84 <block wx:else>
85 <view wx:if="{{all_num>0}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20"> 85 <view wx:if="{{all_num>0}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20">
86 - 再买{{act.zhbuyqty-all_num>need_to_buy?act.zhbuyqty-all_num:need_to_buy}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 86 + 再买{{act.zhbuyqty-all_num>need_to_buy?act.zhbuyqty-all_num:need_to_buy}}件,下单立享【{{act.zhprice}}元选择{{act.zhbuyqty}}件】
87 </view> 87 </view>
88 <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20"> 88 <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20">
89 - 买{{act.zhbuyqty}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 89 + 买{{act.zhbuyqty}}件,下单立享【{{act.zhprice}}元选择{{act.zhbuyqty}}件】
90 </view> 90 </view>
91 </block> 91 </block>
92 <view class="flex jc_sb ai_c pd20"> 92 <view class="flex jc_sb ai_c pd20">
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 <view class="pdt40"> 118 <view class="pdt40">
119 <view class="pdb20">活动内容</view> 119 <view class="pdb20">活动内容</view>
120 <view class=""> 120 <view class="">
121 - <view class="pdb10">{{act.remark}}</view> 121 + <view class="pdb10">{{filters.show_default(act.remark, '无')}}</view>
122 </view> 122 </view>
123 </view> 123 </view>
124 </block> 124 </block>
packageB/pages/zuhegou/index/index.wxss
@@ -35,6 +35,10 @@ page { @@ -35,6 +35,10 @@ page {
35 font-size: 24rpx; 35 font-size: 24rpx;
36 } 36 }
37 37
  38 +.icon-zhuanfa {
  39 + line-height: 1;
  40 +}
  41 +
38 .list-container { 42 .list-container {
39 padding-top: 30rpx; 43 padding-top: 30rpx;
40 } 44 }
packageB/pages/zuhegou/preindex/index.js
@@ -11,80 +11,80 @@ let imgDraw = { @@ -11,80 +11,80 @@ let imgDraw = {
11 "height": "843px", 11 "height": "843px",
12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg", 12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg",
13 "views": [{ // 头像 13 "views": [{ // 头像
14 - "type": "image",  
15 - "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",  
16 - "css": {  
17 - "width": "100px",  
18 - "height": "100px",  
19 - "top": "20px",  
20 - "left": "275px",  
21 - "borderRadius": "100px",  
22 - "mode": "scaleToFill",  
23 - "borderWidth": "2px",  
24 - "borderColor": "#fff",  
25 - }  
26 - },  
27 - { //昵称  
28 - "type": "text",  
29 - "text": "我是店铺名",  
30 - "css": {  
31 - "width": "650px",  
32 - "color": "#fff",  
33 - "top": "136px",  
34 - // "left": "137px",  
35 - "textAlign": "center",  
36 - "fontSize": "26px",  
37 - "maxLines": "1",  
38 - }  
39 - },  
40 - { //10元任选3件  
41 - "type": "text",  
42 - "text": "10元任选3件",  
43 - "css": {  
44 - "color": "#fff",  
45 - "width": "650px",  
46 - "top": "270px",  
47 - "fontSize": "70px",  
48 - "maxLines": "1",  
49 - "textAlign": "center",  
50 - "fontWeight": "bold",  
51 - }  
52 - },  
53 - { //活动时间  
54 - "type": "text",  
55 - "text": "活动时间:2021.07.06 - 2021.07.08",  
56 - "css": {  
57 - "color": "#333",  
58 - "width": "650px",  
59 - "top": "440px",  
60 - "fontSize": "26px",  
61 - "fontWeight": "normal",  
62 - "maxLines": "1",  
63 - "textAlign": "center"  
64 - }  
65 - },  
66 - { // 码  
67 - "type": "image",  
68 - "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",  
69 - "css": {  
70 - "color": "#000",  
71 - "width": "200px",  
72 - "height": "200px",  
73 - "top": "525px",  
74 - "left": "225px",  
75 - }  
76 - },  
77 - { // 扫码提示  
78 - "type": "text",  
79 - "text": "长按扫码即可参与活动",  
80 - "css": {  
81 - "color": "#666",  
82 - "width": "650px",  
83 - "top": "750px",  
84 - "fontSize": "26px",  
85 - "textAlign": "center"  
86 - }  
87 - }, 14 + "type": "image",
  15 + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",
  16 + "css": {
  17 + "width": "100px",
  18 + "height": "100px",
  19 + "top": "20px",
  20 + "left": "275px",
  21 + "borderRadius": "100px",
  22 + "mode": "scaleToFill",
  23 + "borderWidth": "2px",
  24 + "borderColor": "#fff",
  25 + }
  26 + },
  27 + { //昵称
  28 + "type": "text",
  29 + "text": "我是店铺名",
  30 + "css": {
  31 + "width": "650px",
  32 + "color": "#fff",
  33 + "top": "136px",
  34 + // "left": "137px",
  35 + "textAlign": "center",
  36 + "fontSize": "26px",
  37 + "maxLines": "1",
  38 + }
  39 + },
  40 + { //10元任选3件
  41 + "type": "text",
  42 + "text": "10元任选3件",
  43 + "css": {
  44 + "color": "#fff",
  45 + "width": "650px",
  46 + "top": "270px",
  47 + "fontSize": "70px",
  48 + "maxLines": "1",
  49 + "textAlign": "center",
  50 + "fontWeight": "bold",
  51 + }
  52 + },
  53 + { //活动时间
  54 + "type": "text",
  55 + "text": "活动时间:2021.07.06 - 2021.07.08",
  56 + "css": {
  57 + "color": "#333",
  58 + "width": "650px",
  59 + "top": "440px",
  60 + "fontSize": "26px",
  61 + "fontWeight": "normal",
  62 + "maxLines": "1",
  63 + "textAlign": "center"
  64 + }
  65 + },
  66 + { // 码
  67 + "type": "image",
  68 + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg",
  69 + "css": {
  70 + "color": "#000",
  71 + "width": "200px",
  72 + "height": "200px",
  73 + "top": "525px",
  74 + "left": "225px",
  75 + }
  76 + },
  77 + { // 扫码提示
  78 + "type": "text",
  79 + "text": "长按扫码即可参与活动",
  80 + "css": {
  81 + "color": "#666",
  82 + "width": "650px",
  83 + "top": "750px",
  84 + "fontSize": "26px",
  85 + "textAlign": "center"
  86 + }
  87 + },
88 ] 88 ]
89 }; 89 };
90 90
@@ -153,227 +153,226 @@ Page({ @@ -153,227 +153,226 @@ Page({
153 } 153 }
154 }) 154 })
155 } 155 }
156 -  
157 - //如果有会员的时候  
158 - var userInfo = getApp().globalData.userInfo;  
159 - if (!userInfo) {  
160 - getApp().goto("/pages/togoin/togoin");  
161 - return false;  
162 - }  
163 }, 156 },
164 157
165 /** 158 /**
166 * 生命周期函数--监听页面显示 159 * 生命周期函数--监听页面显示
167 */ 160 */
168 onShow: function () { 161 onShow: function () {
169 - var th = this,  
170 - that = this,  
171 - ee = this;  
172 - this.data.is_timer = 1;  
173 - if (this.data.act) this.countDown();  
174 - //如果有会员的时候  
175 - var userInfo = getApp().globalData.userInfo;  
176 - if (userInfo) {  
177 - if (!th.data.is_get_act) {  
178 - //获取活动信息  
179 - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + th.data.id + "/" + userInfo.user_id;  
180 - getApp().request.get(url, {  
181 - success: function (e) {  
182 -  
183 - th.data.is_get_act = 1;  
184 - if (e.data.code == 0 && e.data.data) {  
185 - self.setData({  
186 - act: e.data.data  
187 - });  
188 - if (e.data.data.is_show != 1) {  
189 - th.setData({  
190 - error: '活动未开启' 162 + getApp().is_Single_page(this, function () {
  163 + var th = this,
  164 + that = this,
  165 + ee = this;
  166 + this.data.is_timer = 1;
  167 + if (this.data.act) this.countDown();
  168 + //如果有会员的时候
  169 + var userInfo = getApp().globalData.userInfo;
  170 + if (userInfo) {
  171 + if (!th.data.is_get_act) {
  172 + //获取活动信息
  173 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + th.data.id + "/" + userInfo.user_id;
  174 + getApp().request.get(url, {
  175 + success: function (e) {
  176 +
  177 + th.data.is_get_act = 1;
  178 + if (e.data.code == 0 && e.data.data) {
  179 + self.setData({
  180 + act: e.data.data
191 }); 181 });
192 - return false;  
193 - }  
194 - // if (ut.gettimestamp() < e.data.data.start_time) {  
195 - // th.setData({  
196 - // error: '活动还未开始'  
197 - // });  
198 - // return false;  
199 - // }  
200 - if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) {  
201 - //-- 获取商品列表 --  
202 - self.get_list();  
203 - self.countDown(); 182 + if (e.data.data.is_show != 1) {
  183 + th.setData({
  184 + error: '活动未开启'
  185 + });
  186 + return false;
  187 + }
  188 + // if (ut.gettimestamp() < e.data.data.start_time) {
  189 + // th.setData({
  190 + // error: '活动还未开始'
  191 + // });
  192 + // return false;
  193 + // }
  194 + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) {
  195 + //-- 获取商品列表 --
  196 + self.get_list();
  197 + self.countDown();
  198 + } else {
  199 + th.setData({
  200 + error: '活动已经过期'
  201 + });
  202 + return false;
  203 + }
204 } else { 204 } else {
  205 + th.data.is_get_act = 0;
205 th.setData({ 206 th.setData({
206 - error: '活动已经过期' 207 + error: e.data.msg
207 }); 208 });
208 return false; 209 return false;
209 } 210 }
210 - } else {  
211 - th.data.is_get_act = 0;  
212 - th.setData({  
213 - error: e.data.msg  
214 - });  
215 - return false;  
216 } 211 }
217 - }  
218 - });  
219 - }  
220 -  
221 - //等待活动值  
222 - this.waitfor2(10, 'list', function () {  
223 - if (!th.data.list) return false;  
224 - if (ut.gettimestamp() < th.data.act.start_time) {  
225 - return false;  
226 - }  
227 - if (th.data.act.is_end == 10 || ut.gettimestamp() >= th.data.act.end_time) {  
228 - return false; 212 + });
229 } 213 }
230 - //获取头像的分享  
231 - th.get_head_temp(function () {  
232 - var txt = th.data.act.zhprice + "元任选" + th.data.act.zhbuyqty + "件";  
233 - imgDraw.views[0].url = th.data.share_head;  
234 - imgDraw.views[1].text = userInfo.nickname;  
235 - imgDraw.views[2].text = txt;  
236 -  
237 - var start = ut.formar_no_full(th.data.act.start_time, '.');  
238 - var end = ut.formar_no_full(th.data.act.end_time, '.');  
239 - txt = "活动时间:" + start + " - " + end;  
240 - imgDraw.views[3].text = txt;  
241 -  
242 - var scene = th.data.id + "";  
243 - var user_id = getApp().globalData.user_id;  
244 - scene += "_" + user_id;  
245 - ///二微码  
246 - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +  
247 - os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index";  
248 - wx.getImageInfo({  
249 - src: path3,  
250 - success: function (res) {  
251 - var vpath = res.path;  
252 - imgDraw.views[4].url = vpath;  
253 - th.setData({  
254 - imgDraw: imgDraw  
255 - })  
256 - }  
257 - })  
258 - })  
259 214
260 - //获取用户的默认门店  
261 - getApp().get_user_store(function (e) {  
262 - if (!e) {  
263 - th.data.fir_def_store = {}; //赋值空对象 215 + //等待活动值
  216 + this.waitfor2(10, 'list', function () {
  217 + if (!th.data.list) return false;
  218 + if (ut.gettimestamp() < th.data.act.start_time) {
264 return false; 219 return false;
265 } 220 }
  221 + if (th.data.act.is_end == 10 || ut.gettimestamp() >= th.data.act.end_time) {
  222 + return false;
  223 + }
  224 + //获取头像的分享
  225 + th.get_head_temp(function () {
  226 + var txt = th.data.act.zhprice + "元任选" + th.data.act.zhbuyqty + "件";
  227 + imgDraw.views[0].url = th.data.share_head;
  228 + imgDraw.views[1].text = userInfo.nickname;
  229 + imgDraw.views[2].text = txt;
  230 +
  231 + var start = ut.formar_no_full(th.data.act.start_time, '.');
  232 + var end = ut.formar_no_full(th.data.act.end_time, '.');
  233 + txt = "活动时间:" + start + " - " + end;
  234 + imgDraw.views[3].text = txt;
  235 +
  236 + var scene = th.data.id + "";
  237 + var user_id = getApp().globalData.user_id;
  238 + scene += "_" + user_id;
  239 + ///二微码
  240 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  241 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index";
  242 + wx.getImageInfo({
  243 + src: path3,
  244 + success: function (res) {
  245 + var vpath = res.path;
  246 + imgDraw.views[4].url = vpath;
  247 + th.setData({
  248 + imgDraw: imgDraw
  249 + })
  250 + }
  251 + })
  252 + })
266 253
  254 + //获取用户的默认门店
  255 + getApp().get_user_store(function (e) {
  256 + if (!e) {
  257 + th.data.fir_def_store = {}; //赋值空对象
  258 + return false;
  259 + }
267 260
268 261
269 - var ee = JSON.parse(JSON.stringify(e));  
270 - var appd = getApp().globalData;  
271 - //-- 等待定位系统的开启 --  
272 - th.waitfor2(15, 'is_get_local_ok', function () {  
273 262
274 - if (!th.data.is_get_local_ok) return false; 263 + var ee = JSON.parse(JSON.stringify(e));
  264 + var appd = getApp().globalData;
  265 + //-- 等待定位系统的开启 --
  266 + th.waitfor2(15, 'is_get_local_ok', function () {
275 267
276 - var e = JSON.parse(JSON.stringify(ee));  
277 - //如果有开启近距离的话,同时距离优不一样了  
278 - if (that.data.lat != null) {  
279 - //如果经纬度有变化的话  
280 - if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {  
281 - that.set_def_storage(e);  
282 - } else {  
283 - //要用接口是获取距离,js的计算不准  
284 - getApp().request.promiseGet("/api/weshop/pickup/list", {  
285 - data: {  
286 - store_id: os.stoid,  
287 - pickup_id: e.pickup_id,  
288 - is_pos: 1,  
289 - lat: th.data.lat,  
290 - lon: th.data.lon  
291 - },  
292 - }).then(res => {  
293 - if (res.data.code == 0) {  
294 - e = res.data.data.pageData[0];  
295 - if (e) {  
296 - e.is_no_dis = ee.is_no_dis;  
297 - appd.pk_store = e;  
298 - that.set_def_storage(e);  
299 - } 268 + if (!th.data.is_get_local_ok) return false;
300 269
301 - }  
302 - })  
303 - }  
304 - appd.lat = that.data.lat;  
305 - appd.lon = that.data.lon;  
306 - } else {  
307 - if (e) {  
308 - e.distance = null;  
309 - that.set_def_storage(e);  
310 - }  
311 - }  
312 - })  
313 - }); 270 + var e = JSON.parse(JSON.stringify(ee));
  271 + //如果有开启近距离的话,同时距离优不一样了
  272 + if (that.data.lat != null) {
  273 + //如果经纬度有变化的话
  274 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  275 + that.set_def_storage(e);
  276 + } else {
  277 + //要用接口是获取距离,js的计算不准
  278 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  279 + data: {
  280 + store_id: os.stoid,
  281 + pickup_id: e.pickup_id,
  282 + is_pos: 1,
  283 + lat: th.data.lat,
  284 + lon: th.data.lon
  285 + },
  286 + }).then(res => {
  287 + if (res.data.code == 0) {
  288 + e = res.data.data.pageData[0];
  289 + if (e) {
  290 + e.is_no_dis = ee.is_no_dis;
  291 + appd.pk_store = e;
  292 + that.set_def_storage(e);
  293 + }
314 294
315 - //----获取系统参数-----  
316 - getApp().getConfig2(function (e) {  
317 - ee.setData({  
318 - bconfig: e,  
319 - sales_rules: e.sales_rules,  
320 - });  
321 - //设置基本参数  
322 - th.wait_for_store_config(e);  
323 -  
324 - var json_d = JSON.parse(e.switch_list);  
325 - ee.setData({  
326 - store_config: e,  
327 - sys_switch: json_d,  
328 - is_closecoupon: json_d.is_closecoupon,  
329 - is_newsales_rules: json_d.is_newsales_rules,  
330 - is_open_offline: json_d.is_pricing_open,  
331 - sales_rules: e.sales_rules 295 + }
  296 + })
  297 + }
  298 + appd.lat = that.data.lat;
  299 + appd.lon = that.data.lon;
  300 + } else {
  301 + if (e) {
  302 + e.distance = null;
  303 + that.set_def_storage(e);
  304 + }
  305 + }
  306 + })
332 }); 307 });
333 308
334 - //-- 计算等级价相关 --  
335 - var swithc_list = e.switch_list;  
336 - var sw_arr = JSON.parse(swithc_list);  
337 - //---如果后台又开等级卡的开关---  
338 - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {  
339 - th.setData({  
340 - rank_switch: true 309 + //----获取系统参数-----
  310 + getApp().getConfig2(function (e) {
  311 + ee.setData({
  312 + bconfig: e,
  313 + sales_rules: e.sales_rules,
  314 + });
  315 + //设置基本参数
  316 + th.wait_for_store_config(e);
  317 +
  318 + var json_d = JSON.parse(e.switch_list);
  319 + ee.setData({
  320 + store_config: e,
  321 + sys_switch: json_d,
  322 + is_closecoupon: json_d.is_closecoupon,
  323 + is_newsales_rules: json_d.is_newsales_rules,
  324 + is_open_offline: json_d.is_pricing_open,
  325 + sales_rules: e.sales_rules
341 }); 326 });
342 - //---回调卡的列表---  
343 - th.getPlusCardType(function (ob) { 327 +
  328 + //-- 计算等级价相关 --
  329 + var swithc_list = e.switch_list;
  330 + var sw_arr = JSON.parse(swithc_list);
  331 + //---如果后台又开等级卡的开关---
  332 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
344 th.setData({ 333 th.setData({
345 - card_list: ob.card_list 334 + rank_switch: true
346 }); 335 });
347 - var user = getApp().globalData.userInfo;  
348 - if (!user) return false;  
349 - if (user.card_field && user['card_expiredate']) {  
350 - var str = user['card_expiredate'].replace(/-/g, '/');  
351 - var end = new Date(str);  
352 - end = Date.parse(end) / 1000;  
353 - var now = ut.gettimestamp();  
354 - //--- 判断是等级会员,且在有效期范围内 ---  
355 - if (user.card_field && now < end) {  
356 - var card_name = ob.name_map.get(user.card_field);  
357 - th.setData({  
358 - card_field: user.card_field,  
359 - card_name: card_name,  
360 - card_list: ob.card_list  
361 - }); 336 + //---回调卡的列表---
  337 + th.getPlusCardType(function (ob) {
  338 + th.setData({
  339 + card_list: ob.card_list
  340 + });
  341 + var user = getApp().globalData.userInfo;
  342 + if (!user) return false;
  343 + if (user.card_field && user['card_expiredate']) {
  344 + var str = user['card_expiredate'].replace(/-/g, '/');
  345 + var end = new Date(str);
  346 + end = Date.parse(end) / 1000;
  347 + var now = ut.gettimestamp();
  348 + //--- 判断是等级会员,且在有效期范围内 ---
  349 + if (user.card_field && now < end) {
  350 + var card_name = ob.name_map.get(user.card_field);
  351 + th.setData({
  352 + card_field: user.card_field,
  353 + card_name: card_name,
  354 + card_list: ob.card_list
  355 + });
  356 + }
362 } 357 }
363 - } 358 + //获取购物车的内容
  359 + th.get_cart_val(e);
  360 +
  361 + })
  362 + } else {
364 //获取购物车的内容 363 //获取购物车的内容
365 th.get_cart_val(e); 364 th.get_cart_val(e);
  365 + }
  366 + }, 1);
366 367
367 - })  
368 - } else {  
369 - //获取购物车的内容  
370 - th.get_cart_val(e);  
371 - }  
372 - }, 1); 368 + })
373 369
374 - }) 370 + } else {
  371 + getApp().goto("/pages/togoin/togoin");
  372 + return false;
  373 + }
  374 + })
375 375
376 - }  
377 }, 376 },
378 377
379 onHide: function () { 378 onHide: function () {
@@ -1896,7 +1895,7 @@ Page({ @@ -1896,7 +1895,7 @@ Page({
1896 1895
1897 getApp().request.put("/api/weshop/cart/update", { 1896 getApp().request.put("/api/weshop/cart/update", {
1898 data: updata, 1897 data: updata,
1899 - success: function (t) {} 1898 + success: function (t) { }
1900 }); 1899 });
1901 th.re_sum_price(); 1900 th.re_sum_price();
1902 }) 1901 })
@@ -1915,7 +1914,7 @@ Page({ @@ -1915,7 +1914,7 @@ Page({
1915 var need_to_buy = 0; 1914 var need_to_buy = 0;
1916 var data = this.data.list; 1915 var data = this.data.list;
1917 var all_zhqty = 0; //所有商品要求起购数之后 1916 var all_zhqty = 0; //所有商品要求起购数之后
1918 - var zhqty_bz=[]; //超量 1917 + var zhqty_bz = []; //超量
1919 var no_in_arr = []; 1918 var no_in_arr = [];
1920 for (var i in data) { 1919 for (var i in data) {
1921 var item = data[i]; 1920 var item = data[i];
@@ -1966,28 +1965,28 @@ Page({ @@ -1966,28 +1965,28 @@ Page({
1966 1965
1967 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增 1966 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
1968 if (this.data.act.is_bz && no_in_arr.length >= this.data.act.zhbuyqty) { 1967 if (this.data.act.is_bz && no_in_arr.length >= this.data.act.zhbuyqty) {
1969 - let zhqty_map=new map();  
1970 - //看一下是几倍 1968 + let zhqty_map = new map();
  1969 + //看一下是几倍
1971 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); 1970 var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty);
1972 - if(this.data.act.is_bzyh && zhqty_bz.length > 0 ){  
1973 - for(let i=0;i<zhqty_bz.length;i++){  
1974 - let vv=zhqty_bz[i];  
1975 - let num=0;  
1976 - let bz_num=be*vv.zhqty;  
1977 - for(let j=0;j<no_in_arr.length;j++){  
1978 - let ii=no_in_arr[j];  
1979 - if(vv.goods_id===ii.goods_id){ 1971 + if (this.data.act.is_bzyh && zhqty_bz.length > 0) {
  1972 + for (let i = 0; i < zhqty_bz.length; i++) {
  1973 + let vv = zhqty_bz[i];
  1974 + let num = 0;
  1975 + let bz_num = be * vv.zhqty;
  1976 + for (let j = 0; j < no_in_arr.length; j++) {
  1977 + let ii = no_in_arr[j];
  1978 + if (vv.goods_id === ii.goods_id) {
1980 num++; 1979 num++;
1981 - zhqty_map.set('num',num);  
1982 - zhqty_map.set('price',ii.price); 1980 + zhqty_map.set('num', num);
  1981 + zhqty_map.set('price', ii.price);
1983 } 1982 }
1984 - 1983 +
1985 } 1984 }
1986 } 1985 }
1987 } 1986 }
1988 - if(bz_num <= num){ 1987 + if (bz_num <= num) {
1989 aprice += be * aprice; 1988 aprice += be * aprice;
1990 - let pop_num=(be * this.data.act.zhbuyqty)-bz_num; 1989 + let pop_num = (be * this.data.act.zhbuyqty) - bz_num;
1991 console.log(pop_num); 1990 console.log(pop_num);
1992 for (var m = 0; m < pop_num; m++) { 1991 for (var m = 0; m < pop_num; m++) {
1993 no_in_arr.pop(); 1992 no_in_arr.pop();
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <!-- 商品名称 --> 6 <!-- 商品名称 -->
7 <view class="spec-goods"> 7 <view class="spec-goods">
8 - <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> 8 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
9 <view class="spec-goods-info"> 9 <view class="spec-goods-info">
10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view> 10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
11 <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" > 11 <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -8,7 +8,7 @@ var t = require(&quot;../../../../utils/util.js&quot;), @@ -8,7 +8,7 @@ var t = require(&quot;../../../../utils/util.js&quot;),
8 oo = s.globalData, 8 oo = s.globalData,
9 o = s.globalData.setting, 9 o = s.globalData.setting,
10 os = o; 10 os = o;
11 - 11 +
12 //评价加载更多 12 //评价加载更多
13 var more = function (e) { 13 var more = function (e) {
14 return e && e.__esModule ? e : { 14 return e && e.__esModule ? e : {
@@ -251,48 +251,48 @@ Page({ @@ -251,48 +251,48 @@ Page({
251 fir_goods: null, 251 fir_goods: null,
252 252
253 share_hidden: false, 253 share_hidden: false,
254 -  
255 - showRules: false, // 控制规则显示与隐藏  
256 - showReward: false, //控制查看奖励显示与隐藏  
257 -  
258 - typeArr: [{  
259 - key: 'point',  
260 - name: '积分',  
261 - },{  
262 - key: 'grow',  
263 - name: '成长值',  
264 - },{  
265 - key: 'point',  
266 - name: '优惠券',  
267 - },{  
268 - key: 'prestore_name',  
269 - name: '项目服务',  
270 - },{  
271 - key: 'prestore_money',  
272 - name: '预存金额',  
273 - }],  
274 -  
275 -  
276 - luckGoInfo: {},  
277 - showDetails: false,  
278 - num_success: 0, //成团已中商品数量  
279 - isTimeUp: false,  
280 -  
281 - surplus: 0,  
282 - canBuy: false,  
283 - btnHidden: false, 254 +
  255 + showRules: false, // 控制规则显示与隐藏
  256 + showReward: false, //控制查看奖励显示与隐藏
  257 +
  258 + typeArr: [{
  259 + key: 'point',
  260 + name: '积分',
  261 + }, {
  262 + key: 'grow',
  263 + name: '成长值',
  264 + }, {
  265 + key: 'point',
  266 + name: '优惠券',
  267 + }, {
  268 + key: 'prestore_name',
  269 + name: '项目服务',
  270 + }, {
  271 + key: 'prestore_money',
  272 + name: '预存金额',
  273 + }],
  274 +
  275 +
  276 + luckGoInfo: {},
  277 + showDetails: false,
  278 + num_success: 0, //成团已中商品数量
  279 + isTimeUp: false,
  280 +
  281 + surplus: 0,
  282 + canBuy: false,
  283 + btnHidden: false,
284 }, 284 },
285 285
286 //------初始化加载---------- 286 //------初始化加载----------
287 onLoad: function (t) { 287 onLoad: function (t) {
288 - 288 +
289 // console.log('onload'); 289 // console.log('onload');
290 - if(t && t.group_id) {  
291 - this.data.group_id = t.group_id;  
292 - };  
293 - 290 + if (t && t.group_id) {
  291 + this.data.group_id = t.group_id;
  292 + };
  293 +
  294 +
294 295
295 -  
296 var ee = this, 296 var ee = this,
297 that = ee, 297 that = ee,
298 th = ee, 298 th = ee,
@@ -303,45 +303,45 @@ Page({ @@ -303,45 +303,45 @@ Page({
303 prom_type = t.prom_type, 303 prom_type = t.prom_type,
304 prom_id = t.group_id; //活动ID 304 prom_id = t.group_id; //活动ID
305 305
306 - if(prom_type) {  
307 - // this.data.prom_type = prom_type;  
308 - // this.data.prom_id = prom_id;  
309 - this.setData({  
310 - prom_type,  
311 - prom_id,  
312 - });  
313 - }  
314 -  
315 - 306 + if (prom_type) {
  307 + // this.data.prom_type = prom_type;
  308 + // this.data.prom_id = prom_id;
  309 + this.setData({
  310 + prom_type,
  311 + prom_id,
  312 + });
  313 + }
  314 +
  315 +
316 316
317 317
318 //---获取手机地址坐标-- 318 //---获取手机地址坐标--
319 //--如果tg_id是空的话,分享回来-- 319 //--如果tg_id是空的话,分享回来--
320 - // console.log('扫描海报gid'); 320 + // console.log('扫描海报gid');
321 if (gid == undefined || gid == null || gid == "") { 321 if (gid == undefined || gid == null || gid == "") {
322 var gid_str = decodeURIComponent(t.scene); 322 var gid_str = decodeURIComponent(t.scene);
323 gid_str = gid_str.split("_"); 323 gid_str = gid_str.split("_");
324 gid = gid_str[0]; 324 gid = gid_str[0];
325 - if(gid.indexOf('.')!=-1) {  
326 - var fir_arr=gid.split(".");  
327 - gid=fir_arr[0];  
328 - prom_type=fir_arr[1];  
329 - prom_id=fir_arr[2];  
330 - // this.setData({  
331 - // prom_type: prom_type,  
332 - // prom_id: prom_id,  
333 - // group_id: fir_arr[2],  
334 - // });  
335 - this.data.prom_type=prom_type;  
336 - this.data.prom_id=prom_id;  
337 - this.data.group_id = fir_arr[2]; 325 + if (gid.indexOf('.') != -1) {
  326 + var fir_arr = gid.split(".");
  327 + gid = fir_arr[0];
  328 + prom_type = fir_arr[1];
  329 + prom_id = fir_arr[2];
  330 + // this.setData({
  331 + // prom_type: prom_type,
  332 + // prom_id: prom_id,
  333 + // group_id: fir_arr[2],
  334 + // });
  335 + this.data.prom_type = prom_type;
  336 + this.data.prom_id = prom_id;
  337 + this.data.group_id = fir_arr[2];
338 } 338 }
339 339
340 340
341 if (gid_str.length > 1) { 341 if (gid_str.length > 1) {
342 first_leader = gid_str[1]; 342 first_leader = gid_str[1];
343 } 343 }
344 - 344 +
345 //-- 如果有room_id的获取 -- 345 //-- 如果有room_id的获取 --
346 if (gid_str.length > 2 && gid_str[2]) { 346 if (gid_str.length > 2 && gid_str[2]) {
347 room_id = gid_str[2]; 347 room_id = gid_str[2];
@@ -351,7 +351,7 @@ Page({ @@ -351,7 +351,7 @@ Page({
351 } 351 }
352 352
353 ee.setData({ gid: gid }); 353 ee.setData({ gid: gid });
354 - 354 +
355 if (first_leader) { 355 if (first_leader) {
356 356
357 getApp().globalData.first_leader = first_leader; 357 getApp().globalData.first_leader = first_leader;
@@ -418,10 +418,10 @@ Page({ @@ -418,10 +418,10 @@ Page({
418 th.requestCardNum(), wx.pageScrollTo && th.setData({ 418 th.requestCardNum(), wx.pageScrollTo && th.setData({
419 supportPageScroll: !0 419 supportPageScroll: !0
420 }); 420 });
421 -  
422 -  
423 -  
424 - 421 +
  422 +
  423 +
  424 +
425 425
426 //计算等级价相关 426 //计算等级价相关
427 var swithc_list = e.switch_list; 427 var swithc_list = e.switch_list;
@@ -496,7 +496,7 @@ Page({ @@ -496,7 +496,7 @@ Page({
496 } else { 496 } else {
497 //要用接口是获取距离,js的计算不准 497 //要用接口是获取距离,js的计算不准
498 getApp().request.promiseGet("/api/weshop/pickup/list", { 498 getApp().request.promiseGet("/api/weshop/pickup/list", {
499 - data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon,is_pos:1 }, 499 + data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
500 }).then(res => { 500 }).then(res => {
501 if (res.data.code == 0) { 501 if (res.data.code == 0) {
502 e = res.data.data.pageData[0]; 502 e = res.data.data.pageData[0];
@@ -532,12 +532,14 @@ Page({ @@ -532,12 +532,14 @@ Page({
532 //--先判断会员登陆状态-- 532 //--先判断会员登陆状态--
533 var user_info = getApp().globalData.userInfo; 533 var user_info = getApp().globalData.userInfo;
534 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 534 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  535 +
  536 + getApp().is_Single_page(th, function () {
535 wx.navigateTo({ 537 wx.navigateTo({
536 - url: '/pages/togoin/togoin', 538 + url: '/pages/togoin/togoin',
537 }) 539 })
538 return false; 540 return false;
  541 + })
539 } 542 }
540 -  
541 }, 543 },
542 544
543 545
@@ -633,7 +635,7 @@ Page({ @@ -633,7 +635,7 @@ Page({
633 } 635 }
634 gallery = g; 636 gallery = g;
635 }) 637 })
636 - 638 +
637 //------是否收藏---------- 639 //------是否收藏----------
638 await getApp().request.promiseGet("/api/weshop/goodscollect/page", { 640 await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
639 data: { 641 data: {
@@ -701,7 +703,7 @@ Page({ @@ -701,7 +703,7 @@ Page({
701 } 703 }
702 } 704 }
703 705
704 - if (th.data.is_closecoupon != 1 && (!th.data.fir_quan || th.data.fir_quan.length<=0)) { 706 + if (th.data.is_closecoupon != 1 && (!th.data.fir_quan || th.data.fir_quan.length <= 0)) {
705 //----获取详情页的券的数量---- 707 //----获取详情页的券的数量----
706 await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { 708 await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
707 data: { 709 data: {
@@ -725,16 +727,16 @@ Page({ @@ -725,16 +727,16 @@ Page({
725 mapurl_f_img = res1.data.data.video_img; 727 mapurl_f_img = res1.data.data.video_img;
726 } 728 }
727 }) 729 })
728 -  
729 -  
730 -  
731 -  
732 -  
733 -  
734 -  
735 -  
736 -  
737 - 730 +
  731 +
  732 +
  733 +
  734 +
  735 +
  736 +
  737 +
  738 +
  739 +
738 740
739 ee.setData({ 741 ee.setData({
740 gallery: gallery, 742 gallery: gallery,
@@ -751,7 +753,7 @@ Page({ @@ -751,7 +753,7 @@ Page({
751 753
752 //---展示--- 754 //---展示---
753 onShow: async function () { 755 onShow: async function () {
754 - // console.log('onshow'); 756 + // console.log('onshow');
755 var goods_list = null, th = this, that = this; 757 var goods_list = null, th = this, that = this;
756 var show_prew_img = this.data.show_prew_img 758 var show_prew_img = this.data.show_prew_img
757 if (show_prew_img) { 759 if (show_prew_img) {
@@ -761,57 +763,57 @@ Page({ @@ -761,57 +763,57 @@ Page({
761 763
762 // 判断活动是否暂停 764 // 判断活动是否暂停
763 //获取单个活动成团信息 765 //获取单个活动成团信息
764 - await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {  
765 - data: {  
766 - store_id: o.stoid,  
767 - is_end: 0,  
768 - timetype: 1,  
769 - id: this.data.group_id,  
770 - }  
771 - }).then(res => {  
772 - // console.log()  
773 - // console.log('判断活动是否暂停=======》', res.data.data);  
774 - if (res.data.code == 0) {  
775 - if(res.data.data.pageData && res.data.data.pageData.length == 0) {  
776 - let obj = {  
777 - day: '00',  
778 - hou: '00',  
779 - min: '00',  
780 - sec: '00'  
781 - };  
782 -  
783 - th.setData({  
784 - djs: obj,  
785 - isTimeUp: true,  
786 - });  
787 - } else {  
788 - th.setData({  
789 - luckGoInfo: res.data.data.pageData[0],  
790 - team_id: res.data.data.pageData[0].team_id,  
791 - luckGoMembers: [],  
792 - });  
793 -  
794 - th.countDown(th.data.luckGoInfo.end_time, 0);  
795 - };  
796 -  
797 - } else { 766 + await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
  767 + data: {
  768 + store_id: o.stoid,
  769 + is_end: 0,
  770 + timetype: 1,
  771 + id: this.data.group_id,
  772 + }
  773 + }).then(res => {
  774 + // console.log()
  775 + // console.log('判断活动是否暂停=======》', res.data.data);
  776 + if (res.data.code == 0) {
  777 + if (res.data.data.pageData && res.data.data.pageData.length == 0) {
  778 + let obj = {
  779 + day: '00',
  780 + hou: '00',
  781 + min: '00',
  782 + sec: '00'
  783 + };
  784 +
  785 + th.setData({
  786 + djs: obj,
  787 + isTimeUp: true,
  788 + });
  789 + } else {
  790 + th.setData({
  791 + luckGoInfo: res.data.data.pageData[0],
  792 + team_id: res.data.data.pageData[0].team_id,
  793 + luckGoMembers: [],
  794 + });
  795 +
  796 + th.countDown(th.data.luckGoInfo.end_time, 0);
  797 + };
  798 +
  799 + } else {
798 // this.data.isTimeUp = true; 800 // this.data.isTimeUp = true;
799 - th.setData({  
800 - isTimeUp: true, 801 + th.setData({
  802 + isTimeUp: true,
801 }); 803 });
802 -  
803 - };  
804 -  
805 - 804 +
  805 + };
  806 +
  807 +
806 }); 808 });
807 - 809 +
808 // 活动暂停显示空白 810 // 活动暂停显示空白
809 if (this.data.isTimeUp) { 811 if (this.data.isTimeUp) {
810 wx.showModal({ 812 wx.showModal({
811 title: '提示', 813 title: '提示',
812 content: '活动已经暂停', 814 content: '活动已经暂停',
813 showCancel: false, 815 showCancel: false,
814 - success: function(){ 816 + success: function () {
815 wx.navigateBack(); 817 wx.navigateBack();
816 } 818 }
817 }) 819 })
@@ -880,18 +882,18 @@ Page({ @@ -880,18 +882,18 @@ Page({
880 }); 882 });
881 } 883 }
882 } 884 }
883 - 885 +
884 //动态获取商品名称 886 //动态获取商品名称
885 wx.setNavigationBarTitle({ 887 wx.setNavigationBarTitle({
886 title: t.data.data.goods_name, 888 title: t.data.data.goods_name,
887 }); 889 });
888 890
889 - 891 +
890 892
891 //-- 把商品的赋值 -- 893 //-- 把商品的赋值 --
892 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); 894 ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data));
893 - if(ee.data.prom_type!=1 && ee.data.prom_type!=4 && ee.data.prom_type!=6)  
894 - ee.check_is_youhui(ee.data.gid); 895 + if (ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6)
  896 + ee.check_is_youhui(ee.data.gid);
895 897
896 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); 898 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
897 899
@@ -917,12 +919,12 @@ Page({ @@ -917,12 +919,12 @@ Page({
917 a.wxParse("content", "html", t.data.data.goods_content, ee, 6); 919 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
918 e.wxParseAddFullImageUrl(ee, "content"); 920 e.wxParseAddFullImageUrl(ee, "content");
919 921
920 - if(ee.data.prom_type){  
921 - //999  
922 - t.data.data.prom_type=ee.data.prom_type;  
923 - t.data.data.prom_id=ee.data.prom_id; 922 + if (ee.data.prom_type) {
  923 + //999
  924 + t.data.data.prom_type = ee.data.prom_type;
  925 + t.data.data.prom_id = ee.data.prom_id;
924 } 926 }
925 - 927 +
926 ee.setData({ 928 ee.setData({
927 data: t.data.data, 929 data: t.data.data,
928 sele_g: t.data.data, 930 sele_g: t.data.data,
@@ -935,7 +937,7 @@ Page({ @@ -935,7 +937,7 @@ Page({
935 //默认门店要拿下门店库存 937 //默认门店要拿下门店库存
936 // if (that.data.sales_rules == 2 && that.data.is_newsales_rules) { 938 // if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
937 // //获取门店 939 // //获取门店
938 - // ee.get_sto(1); 940 + // ee.get_sto(1);
939 941
940 // } else { 942 // } else {
941 // //获取门店 943 // //获取门店
@@ -1021,112 +1023,112 @@ Page({ @@ -1021,112 +1023,112 @@ Page({
1021 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 1023 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
1022 1024
1023 1025
1024 - //获取单个活动已成团数量  
1025 - getApp().request.get(`/api/weshop/prom/luckyTeam/getCtNum/${o.stoid}/${this.data.group_id}`, {  
1026 - success: function (res) {  
1027 - if(res.data.code == 0) {  
1028 - th.setData({  
1029 - group_num: res.data.data,  
1030 - });  
1031 - }  
1032 - }  
1033 - });  
1034 -  
1035 -  
1036 - //获取单个活动中奖记录  
1037 - getApp().request.promiseGet('/api/weshop/prom/luckyOrder/page', {  
1038 - data: {  
1039 - store_id: os.stoid,  
1040 - team_status: 2,  
1041 - goods_id: this.data.gid,  
1042 - rndid: 1,  
1043 - }  
1044 - }).then(res => {  
1045 - if (res.data.code == 0) {  
1046 - th.setData({  
1047 - luckGoWinners: res.data.data.pageData,  
1048 - });  
1049 - }  
1050 - });  
1051 -  
1052 -  
1053 - //获取单个活动成团已中商品数量  
1054 - let url_num_success = `/api/weshop/prom/luckyOrder/countActNum/${os.stoid}/${this.data.group_id}`;  
1055 - getApp().request.get(url_num_success, {  
1056 - success: function (res) {  
1057 - if (res.data.code == 0) {  
1058 - console.log('成团已中商品数量汇总',res.data.data);  
1059 - th.setData({  
1060 - num_success: res.data.data,  
1061 - });  
1062 - }  
1063 - }  
1064 - });  
1065 -  
1066 -  
1067 -  
1068 -  
1069 -  
1070 - // 获取购买次数,判断是否已经超出限购  
1071 - // {store_id}/{user_id}/{aid}  
1072 - let get_aid = this.data.prom_id || this.data.luckGoInfo.id;  
1073 - await getApp().request.get('/api/weshop/prom/luckyOrder/countActNum/' + os.stoid + '/' + oo.user_id + '/' + get_aid, {  
1074 - success: function (res) {  
1075 - if(res.data.code == 0) {  
1076 - console.log(oo.user_id, '判断是否超出限购,获取购买次数', res, );  
1077 - // th.setData({  
1078 - // num_joined: res.data.data,  
1079 - // });  
1080 - let num_joined = res.data.data;  
1081 - let group_join_num = th.data.luckGoInfo.group_join_num;  
1082 - let canBuy = num_joined >= group_join_num ? false : true;  
1083 - th.setData({  
1084 - canBuy,  
1085 - });  
1086 - // console.log('canBuy', th.data.canBuy);  
1087 - };  
1088 - },  
1089 - });  
1090 -  
1091 -  
1092 - //获取参团成员  
1093 - await getApp().request.promiseGet('/api/weshop/prom/luckyOrder/page', {  
1094 - data: {  
1095 - store_id: o.stoid,  
1096 - team_id: th.data.team_id,  
1097 - }  
1098 - }).then(res => {  
1099 - if (res.data.code == 0) {  
1100 - // console.log(th.data.team_id,'参团成员===============》', res.data.data.pageData);  
1101 - th.setData({  
1102 - luckGoMembers: res.data.data.pageData,  
1103 - });  
1104 - }  
1105 - });  
1106 -  
1107 - var p1 = new Promise((resolve, reject) => { 1026 + //获取单个活动已成团数量
  1027 + getApp().request.get(`/api/weshop/prom/luckyTeam/getCtNum/${o.stoid}/${this.data.group_id}`, {
  1028 + success: function (res) {
  1029 + if (res.data.code == 0) {
  1030 + th.setData({
  1031 + group_num: res.data.data,
  1032 + });
  1033 + }
  1034 + }
  1035 + });
  1036 +
  1037 +
  1038 + //获取单个活动中奖记录
  1039 + getApp().request.promiseGet('/api/weshop/prom/luckyOrder/page', {
  1040 + data: {
  1041 + store_id: os.stoid,
  1042 + team_status: 2,
  1043 + goods_id: this.data.gid,
  1044 + rndid: 1,
  1045 + }
  1046 + }).then(res => {
  1047 + if (res.data.code == 0) {
  1048 + th.setData({
  1049 + luckGoWinners: res.data.data.pageData,
  1050 + });
  1051 + }
  1052 + });
  1053 +
  1054 +
  1055 + //获取单个活动成团已中商品数量
  1056 + let url_num_success = `/api/weshop/prom/luckyOrder/countActNum/${os.stoid}/${this.data.group_id}`;
  1057 + getApp().request.get(url_num_success, {
  1058 + success: function (res) {
  1059 + if (res.data.code == 0) {
  1060 + console.log('成团已中商品数量汇总', res.data.data);
  1061 + th.setData({
  1062 + num_success: res.data.data,
  1063 + });
  1064 + }
  1065 + }
  1066 + });
  1067 +
  1068 +
  1069 +
  1070 +
  1071 +
  1072 + // 获取购买次数,判断是否已经超出限购
  1073 + // {store_id}/{user_id}/{aid}
  1074 + let get_aid = this.data.prom_id || this.data.luckGoInfo.id;
  1075 + await getApp().request.get('/api/weshop/prom/luckyOrder/countActNum/' + os.stoid + '/' + oo.user_id + '/' + get_aid, {
  1076 + success: function (res) {
  1077 + if (res.data.code == 0) {
  1078 + console.log(oo.user_id, '判断是否超出限购,获取购买次数', res,);
  1079 + // th.setData({
  1080 + // num_joined: res.data.data,
  1081 + // });
  1082 + let num_joined = res.data.data;
  1083 + let group_join_num = th.data.luckGoInfo.group_join_num;
  1084 + let canBuy = num_joined >= group_join_num ? false : true;
  1085 + th.setData({
  1086 + canBuy,
  1087 + });
  1088 + // console.log('canBuy', th.data.canBuy);
  1089 + };
  1090 + },
  1091 + });
  1092 +
  1093 +
  1094 + //获取参团成员
  1095 + await getApp().request.promiseGet('/api/weshop/prom/luckyOrder/page', {
  1096 + data: {
  1097 + store_id: o.stoid,
  1098 + team_id: th.data.team_id,
  1099 + }
  1100 + }).then(res => {
  1101 + if (res.data.code == 0) {
  1102 + // console.log(th.data.team_id,'参团成员===============》', res.data.data.pageData);
  1103 + th.setData({
  1104 + luckGoMembers: res.data.data.pageData,
  1105 + });
  1106 + }
  1107 + });
  1108 +
  1109 + var p1 = new Promise((resolve, reject) => {
1108 // 检查幸运购活动商品库存 1110 // 检查幸运购活动商品库存
1109 getApp().request.get("/api/weshop/activitylist/getActLen/" + o.stoid + "/9/" + this.data.group_id, { 1111 getApp().request.get("/api/weshop/activitylist/getActLen/" + o.stoid + "/9/" + this.data.group_id, {
1110 - success: function(res) { 1112 + success: function (res) {
1111 //console.log('当前幸运购活动的剩余库存', res.data.data); 1113 //console.log('当前幸运购活动的剩余库存', res.data.data);
1112 - if(res.data.code == 0) { 1114 + if (res.data.code == 0) {
1113 th.setData({ 1115 th.setData({
1114 // 剩余库存量 1116 // 剩余库存量
1115 surplus: res.data.data, 1117 surplus: res.data.data,
1116 }); 1118 });
1117 - }; 1119 + };
1118 resolve(); 1120 resolve();
1119 } 1121 }
1120 }); 1122 });
1121 - 1123 +
1122 }); 1124 });
1123 - 1125 +
1124 var p2 = new Promise((resolve, reject) => { 1126 var p2 = new Promise((resolve, reject) => {
1125 // 检查是否已经参团购买 1127 // 检查是否已经参团购买
1126 getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, { 1128 getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, {
1127 - success: function(res) { 1129 + success: function (res) {
1128 console.log('当前幸运购活动是否已经参团', res.data.code); 1130 console.log('当前幸运购活动是否已经参团', res.data.code);
1129 - if(res.data.code == 0) { 1131 + if (res.data.code == 0) {
1130 th.setData({ 1132 th.setData({
1131 showDetails: true, 1133 showDetails: true,
1132 buyInfo: res.data.data, 1134 buyInfo: res.data.data,
@@ -1139,52 +1141,52 @@ Page({ @@ -1139,52 +1141,52 @@ Page({
1139 resolve(); 1141 resolve();
1140 } 1142 }
1141 }); 1143 });
1142 - 1144 +
1143 }); 1145 });
1144 - 1146 +
1145 Promise.all([p1, p2]).then(res => { 1147 Promise.all([p1, p2]).then(res => {
1146 th.setData({ 1148 th.setData({
1147 btnHidden: true, 1149 btnHidden: true,
1148 }); 1150 });
1149 }); 1151 });
1150 -  
1151 -  
1152 - console.log('hidddddnnnnnnnn------>>>>', this.data.btnHidden, this.data.isTimeUp)  
1153 - 1152 +
  1153 +
  1154 + console.log('hidddddnnnnnnnn------>>>>', this.data.btnHidden, this.data.isTimeUp)
  1155 +
1154 1156
1155 }, 1157 },
1156 -  
1157 1158
1158 -  
1159 -  
1160 - // 页面卸载 1159 +
  1160 +
  1161 +
  1162 + // 页面卸载
1161 onUnload: function () { 1163 onUnload: function () {
1162 for (var i = 1; i < 100; i++) { 1164 for (var i = 1; i < 100; i++) {
1163 clearInterval(i); 1165 clearInterval(i);
1164 } 1166 }
1165 }, 1167 },
1166 -  
1167 - // 页面隐藏 1168 +
  1169 + // 页面隐藏
1168 onHide: function () { 1170 onHide: function () {
1169 this.data.is_timer = 0; 1171 this.data.is_timer = 0;
1170 for (var i = 1; i < 100; i++) { 1172 for (var i = 1; i < 100; i++) {
1171 clearInterval(i); 1173 clearInterval(i);
1172 } 1174 }
1173 }, 1175 },
1174 -  
1175 - // 点击顶部选项卡 1176 +
  1177 + // 点击顶部选项卡
1176 tabClick: function (t) { 1178 tabClick: function (t) {
1177 var e = t.currentTarget.id; 1179 var e = t.currentTarget.id;
1178 this.setData({ 1180 this.setData({
1179 activeCategoryId: e 1181 activeCategoryId: e
1180 - }),  
1181 - 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); 1182 + }),
  1183 + 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment();
1182 }, 1184 },
1183 -  
1184 -  
1185 1185
1186 1186
1187 - // 点击评价选项卡下的各评价按钮 1187 +
  1188 +
  1189 + // 点击评价选项卡下的各评价按钮
1188 tabClick3: function (t) { 1190 tabClick3: function (t) {
1189 var e = this; 1191 var e = this;
1190 if (t.currentTarget.id != this.data.activeCategoryId3) { 1192 if (t.currentTarget.id != this.data.activeCategoryId3) {
@@ -1197,7 +1199,7 @@ Page({ @@ -1197,7 +1199,7 @@ Page({
1197 } 1199 }
1198 }, 1200 },
1199 1201
1200 - // 滚动到顶部 1202 + // 滚动到顶部
1201 doScrollTop: function () { 1203 doScrollTop: function () {
1202 wx.pageScrollTo({ 1204 wx.pageScrollTo({
1203 scrollTop: 0 1205 scrollTop: 0
@@ -1280,9 +1282,9 @@ Page({ @@ -1280,9 +1282,9 @@ Page({
1280 th.setData({ 1282 th.setData({
1281 open_ind_store: ind 1283 open_ind_store: ind
1282 }); 1284 });
1283 -  
1284 -  
1285 - th.add_cart_func(t); 1285 +
  1286 +
  1287 + th.add_cart_func(t);
1286 }, 1288 },
1287 1289
1288 1290
@@ -1447,9 +1449,9 @@ Page({ @@ -1447,9 +1449,9 @@ Page({
1447 goods_name: o.goods_name, 1449 goods_name: o.goods_name,
1448 goods_sn: o.goods_sn, 1450 goods_sn: o.goods_sn,
1449 sku: o.sku, 1451 sku: o.sku,
1450 - prom_id:th.data.luckGoInfo.id, 1452 + prom_id: th.data.luckGoInfo.id,
1451 // prom_type:th.data.sele_g.prom_type, 1453 // prom_type:th.data.sele_g.prom_type,
1452 - prom_type:9, 1454 + prom_type: 9,
1453 }; 1455 };
1454 1456
1455 //---是不是从收藏夹出来的--- 1457 //---是不是从收藏夹出来的---
@@ -1617,7 +1619,7 @@ Page({ @@ -1617,7 +1619,7 @@ Page({
1617 add_cart_next(e, t, a, o, newd, CanOutQty) { 1619 add_cart_next(e, t, a, o, newd, CanOutQty) {
1618 var th = this, i = getApp().request; 1620 var th = this, i = getApp().request;
1619 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 1621 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1620 - if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { 1622 + if ((o.prom_type != 1 || o.prom_id <= 0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) {
1621 var conf = th.data.bconfig; 1623 var conf = th.data.bconfig;
1622 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { 1624 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
1623 var s_list = JSON.parse(conf.switch_list); 1625 var s_list = JSON.parse(conf.switch_list);
@@ -1780,7 +1782,7 @@ Page({ @@ -1780,7 +1782,7 @@ Page({
1780 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, { 1782 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1781 // action: "buy_now" 1783 // action: "buy_now"
1782 // }), 1784 // }),
1783 - var th = this; 1785 + var th = this;
1784 this.setData({ 1786 this.setData({
1785 openSpecModal: 0, 1787 openSpecModal: 0,
1786 openSpecModal_inte: 0, 1788 openSpecModal_inte: 0,
@@ -1788,15 +1790,15 @@ Page({ @@ -1788,15 +1790,15 @@ Page({
1788 openSpecModal_pt: 0, 1790 openSpecModal_pt: 0,
1789 }) 1791 })
1790 1792
1791 - // if (e.prom_type == 9) {  
1792 - // s.set_b_now(e);  
1793 - // // var url = '';  
1794 - // var url = "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id;  
1795 - // getApp().goto(url);  
1796 - // } else  
1797 -  
1798 - // if(e.prom_type == 9){  
1799 - if(true){ 1793 + // if (e.prom_type == 9) {
  1794 + // s.set_b_now(e);
  1795 + // // var url = '';
  1796 + // var url = "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id;
  1797 + // getApp().goto(url);
  1798 + // } else
  1799 +
  1800 + // if(e.prom_type == 9){
  1801 + if (true) {
1800 //要判断积分购的普通购买有没有参加优惠活动 1802 //要判断积分购的普通购买有没有参加优惠活动
1801 if (e.is_normal == 1) { 1803 if (e.is_normal == 1) {
1802 this.check_nor_promgood(e.goods_id, function (res) { 1804 this.check_nor_promgood(e.goods_id, function (res) {
@@ -1804,28 +1806,28 @@ Page({ @@ -1804,28 +1806,28 @@ Page({
1804 e.prom_type = 3; 1806 e.prom_type = 3;
1805 e.prom_id = res.cat_id; 1807 e.prom_id = res.cat_id;
1806 } else { 1808 } else {
1807 - e.prom_type = 0;  
1808 - // e.prom_id = 0;  
1809 - } 1809 + e.prom_type = 0;
  1810 + // e.prom_id = 0;
  1811 + }
1810 s.set_b_now(e); 1812 s.set_b_now(e);
1811 /*-- 1813 /*--
1812 wx.redirectTo({ 1814 wx.redirectTo({
1813 url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, 1815 url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
1814 });--*/ 1816 });--*/
1815 -  
1816 - // console.log('11111111111111111111111111======》'); 1817 +
  1818 + // console.log('11111111111111111111111111======》');
1817 // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id); 1819 // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id);
1818 - getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); 1820 + getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert);
1819 1821
1820 }) 1822 })
1821 } else { 1823 } else {
1822 - //console.log('222222222222222222222222222222======》'); 1824 + //console.log('222222222222222222222222222222======》');
1823 //s.set_b_now(e); 1825 //s.set_b_now(e);
1824 /*-- 1826 /*--
1825 wx.redirectTo({ 1827 wx.redirectTo({
1826 url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, 1828 url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
1827 });--*/ 1829 });--*/
1828 - //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&goods_id=" + e.goods_id) 1830 + //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&goods_id=" + e.goods_id)
1829 // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); 1831 // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert);
1830 } 1832 }
1831 1833
@@ -2051,36 +2053,36 @@ Page({ @@ -2051,36 +2053,36 @@ Page({
2051 }) 2053 })
2052 return false; 2054 return false;
2053 } 2055 }
2054 -  
2055 -  
2056 -  
2057 - if(th.data.more_flash && open_store==1){  
2058 - th.setData({is_pop_more:1});  
2059 - }else{  
2060 - var ind = t.currentTarget.dataset.ind;  
2061 - //回调。判断是不是优惠促销  
2062 - th.check_is_prom_goods(function () {  
2063 - th.setData({  
2064 - openSpecModal: !0,  
2065 - openSpecModal_ind: ind,  
2066 - });  
2067 - //var is_open=th.data.config  
2068 - th.get_off_price();  
2069 - })  
2070 - }  
2071 - },  
2072 2056
2073 - open_next(){  
2074 - var th=this; 2057 +
  2058 +
  2059 + if (th.data.more_flash && open_store == 1) {
  2060 + th.setData({ is_pop_more: 1 });
  2061 + } else {
  2062 + var ind = t.currentTarget.dataset.ind;
2075 //回调。判断是不是优惠促销 2063 //回调。判断是不是优惠促销
2076 th.check_is_prom_goods(function () { 2064 th.check_is_prom_goods(function () {
2077 - th.setData({  
2078 - openSpecModal: !0,  
2079 - openSpecModal_ind: 1,  
2080 - is_pop_more:0  
2081 - });  
2082 - th.get_off_price(); 2065 + th.setData({
  2066 + openSpecModal: !0,
  2067 + openSpecModal_ind: ind,
  2068 + });
  2069 + //var is_open=th.data.config
  2070 + th.get_off_price();
2083 }) 2071 })
  2072 + }
  2073 + },
  2074 +
  2075 + open_next() {
  2076 + var th = this;
  2077 + //回调。判断是不是优惠促销
  2078 + th.check_is_prom_goods(function () {
  2079 + th.setData({
  2080 + openSpecModal: !0,
  2081 + openSpecModal_ind: 1,
  2082 + is_pop_more: 0
  2083 + });
  2084 + th.get_off_price();
  2085 + })
2084 }, 2086 },
2085 2087
2086 //判断是不是优惠促销 2088 //判断是不是优惠促销
@@ -2407,47 +2409,47 @@ Page({ @@ -2407,47 +2409,47 @@ Page({
2407 // ob.title = text + " " + name; 2409 // ob.title = text + " " + name;
2408 // } 2410 // }
2409 2411
2410 - // var title = th.data.sele_g.goods_name;  
2411 - // var img = th.data.sele_g.original_img;  
2412 -  
2413 - // var url = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${th.data.sele_g.goods_id}&prom_type=9&group_id=${th.data.group_id}`; //当前页面url  
2414 - // if (getApp().globalData.user_id) {  
2415 - // url += "&first_leader=" + getApp().globalData.user_id;  
2416 - // }  
2417 -  
2418 - // console.log(url)  
2419 -  
2420 - // var ob = {  
2421 - // title: price + "元 " + title,  
2422 - // path: url,  
2423 - // imageUrl: img,  
2424 - // };  
2425 -  
2426 - // return ob;  
2427 -  
2428 -  
2429 - var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.sele_g.goods_id}&prom_type=9&group_id=${this.data.group_id}`; //当前页面url  
2430 - // console.log('pagePath=====xxxxxx>', pagePath);  
2431 - var imgPath = this.data.iurl + this.data.luckGoInfo.original_img;  
2432 - if (pagePath.indexOf('/') != 0) {  
2433 - pagePath = '/' + pagePath;  
2434 - }  
2435 - // if(getApp().globalData.user_id){  
2436 -  
2437 - // if(pagePath.indexOf("?")>0){  
2438 - // pagePath+="&first_leader="+getApp().globalData.user_id;  
2439 - // }else{  
2440 - // pagePath+="?first_leader="+getApp().globalData.user_id;  
2441 - // }  
2442 - // }  
2443 - return {  
2444 - title: "邀您一起参加幸运购",  
2445 - path: pagePath,  
2446 - imageUrl: imgPath,  
2447 - }  
2448 -  
2449 -  
2450 - 2412 + // var title = th.data.sele_g.goods_name;
  2413 + // var img = th.data.sele_g.original_img;
  2414 +
  2415 + // var url = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${th.data.sele_g.goods_id}&prom_type=9&group_id=${th.data.group_id}`; //当前页面url
  2416 + // if (getApp().globalData.user_id) {
  2417 + // url += "&first_leader=" + getApp().globalData.user_id;
  2418 + // }
  2419 +
  2420 + // console.log(url)
  2421 +
  2422 + // var ob = {
  2423 + // title: price + "元 " + title,
  2424 + // path: url,
  2425 + // imageUrl: img,
  2426 + // };
  2427 +
  2428 + // return ob;
  2429 +
  2430 +
  2431 + var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.sele_g.goods_id}&prom_type=9&group_id=${this.data.group_id}`; //当前页面url
  2432 + // console.log('pagePath=====xxxxxx>', pagePath);
  2433 + var imgPath = this.data.iurl + this.data.luckGoInfo.original_img;
  2434 + if (pagePath.indexOf('/') != 0) {
  2435 + pagePath = '/' + pagePath;
  2436 + }
  2437 + // if(getApp().globalData.user_id){
  2438 +
  2439 + // if(pagePath.indexOf("?")>0){
  2440 + // pagePath+="&first_leader="+getApp().globalData.user_id;
  2441 + // }else{
  2442 + // pagePath+="?first_leader="+getApp().globalData.user_id;
  2443 + // }
  2444 + // }
  2445 + return {
  2446 + title: "邀您一起参加幸运购",
  2447 + path: pagePath,
  2448 + imageUrl: imgPath,
  2449 + }
  2450 +
  2451 +
  2452 +
2451 }, 2453 },
2452 2454
2453 //-----图片失败,默认图片----- 2455 //-----图片失败,默认图片-----
@@ -2523,12 +2525,12 @@ Page({ @@ -2523,12 +2525,12 @@ Page({
2523 if (res.data.code == 0) prom = res.data.data; 2525 if (res.data.code == 0) prom = res.data.data;
2524 }) 2526 })
2525 break 2527 break
2526 -  
2527 - case 8:  
2528 - continue;  
2529 2528
2530 case 8: 2529 case 8:
2531 - continue; 2530 + continue;
  2531 +
  2532 + case 8:
  2533 + continue;
2532 2534
2533 } 2535 }
2534 2536
@@ -2653,14 +2655,14 @@ Page({ @@ -2653,14 +2655,14 @@ Page({
2653 async sele_spec_chech_activity() { 2655 async sele_spec_chech_activity() {
2654 //---如果是活动的时候--- 2656 //---如果是活动的时候---
2655 var prom = null, goodsinfo = this.data.sele_g, th = this; 2657 var prom = null, goodsinfo = this.data.sele_g, th = this;
2656 - var user_id=getApp().globalData.user_id;  
2657 - if(!user_id) user_id=0; 2658 + var user_id = getApp().globalData.user_id;
  2659 + if (!user_id) user_id = 0;
2658 if (goodsinfo.prom_type == 1) { 2660 if (goodsinfo.prom_type == 1) {
2659 - await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" +user_id+"/"+ goodsinfo.prom_id, { 2661 + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + goodsinfo.prom_id, {
2660 }).then(res => { 2662 }).then(res => {
2661 if (res.data.code == 0) { 2663 if (res.data.code == 0) {
2662 - prom = res.data.data;  
2663 - prom.price=prom.user_price; 2664 + prom = res.data.data;
  2665 + prom.price = prom.user_price;
2664 } 2666 }
2665 }) 2667 })
2666 } 2668 }
@@ -2686,11 +2688,11 @@ Page({ @@ -2686,11 +2688,11 @@ Page({
2686 var now = ut.gettimestamp(); 2688 var now = ut.gettimestamp();
2687 if (prom) { 2689 if (prom) {
2688 2690
2689 - var t1=prom.start_time;  
2690 - var prom_st=1;  
2691 - if(prom.show_time){  
2692 - t1=prom.show_time;  
2693 - if(prom.start_time>now) prom_st=0; 2691 + var t1 = prom.start_time;
  2692 + var prom_st = 1;
  2693 + if (prom.show_time) {
  2694 + t1 = prom.show_time;
  2695 + if (prom.start_time > now) prom_st = 0;
2694 } 2696 }
2695 if (prom.is_end == 0 && prom.end_time > now && t1 < now) { 2697 if (prom.is_end == 0 && prom.end_time > now && t1 < now) {
2696 th.setData({ 2698 th.setData({
@@ -2701,37 +2703,37 @@ Page({ @@ -2701,37 +2703,37 @@ Page({
2701 prom_start_time: prom.start_time, 2703 prom_start_time: prom.start_time,
2702 prom_st: prom_st, 2704 prom_st: prom_st,
2703 prom_act: prom, 2705 prom_act: prom,
2704 - prom_id:prom.id 2706 + prom_id: prom.id
2705 }) 2707 })
2706 2708
2707 - //却换图片  
2708 - th.init(goodsinfo.goods_id);  
2709 - var newTime = ut.gettimestamp();  
2710 - var endTime2 = prom.end_time;  
2711 - var endTime1 = prom.start_time; 2709 + //却换图片
  2710 + th.init(goodsinfo.goods_id);
  2711 + var newTime = ut.gettimestamp();
  2712 + var endTime2 = prom.end_time;
  2713 + var endTime1 = prom.start_time;
2712 2714
2713 - this.data.is_timer=0; 2715 + this.data.is_timer = 0;
2714 2716
2715 - setTimeout(function () {  
2716 - th.data.is_timer=1;  
2717 - if (endTime1 > newTime) {  
2718 - th.setData({  
2719 - prom_time_text: '距秒杀开始还有'  
2720 - })  
2721 - th.countDown(th.data.luckGoInfo.end_time, 0);  
2722 - } else {  
2723 - if (endTime2 > newTime) {  
2724 - th.setData({  
2725 - prom_time_text: '距秒杀结束还有',  
2726 - prom_st: 1  
2727 - })  
2728 - th.countDown(th.data.luckGoInfo.end_time);  
2729 - }  
2730 - } 2717 + setTimeout(function () {
  2718 + th.data.is_timer = 1;
  2719 + if (endTime1 > newTime) {
  2720 + th.setData({
  2721 + prom_time_text: '距秒杀开始还有'
  2722 + })
  2723 + th.countDown(th.data.luckGoInfo.end_time, 0);
  2724 + } else {
  2725 + if (endTime2 > newTime) {
  2726 + th.setData({
  2727 + prom_time_text: '距秒杀结束还有',
  2728 + prom_st: 1
  2729 + })
  2730 + th.countDown(th.data.luckGoInfo.end_time);
  2731 + }
  2732 + }
2731 2733
2732 - },1000) 2734 + }, 1000)
2733 2735
2734 - return false; 2736 + return false;
2735 } 2737 }
2736 } 2738 }
2737 //---设置普通商品--- 2739 //---设置普通商品---
@@ -3238,32 +3240,32 @@ Page({ @@ -3238,32 +3240,32 @@ Page({
3238 3240
3239 //--------检查是否活动,活动是否开始,或者是否结束------- 3241 //--------检查是否活动,活动是否开始,或者是否结束-------
3240 async check_prom(gid, prom_type, prom_id) { 3242 async check_prom(gid, prom_type, prom_id) {
3241 - var ee = this,th = ee;  
3242 - var user_id=getApp().globalData.user_id;  
3243 - if(!user_id) user_id=0; 3243 + var ee = this, th = ee;
  3244 + var user_id = getApp().globalData.user_id;
  3245 + if (!user_id) user_id = 0;
3244 3246
3245 - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7|| prom_type == 9) { 3247 + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7 || prom_type == 9) {
3246 this.setData({ 3248 this.setData({
3247 - prom_type: 0,isshow: 1, 3249 + prom_type: 0, isshow: 1,
3248 }); 3250 });
3249 return false; 3251 return false;
3250 } 3252 }
3251 3253
3252 - if (prom_type == 1 && prom_id==0){  
3253 - this.setData({  
3254 - prom_type: 0,isshow: 1,  
3255 - }); 3254 + if (prom_type == 1 && prom_id == 0) {
  3255 + this.setData({
  3256 + prom_type: 0, isshow: 1,
  3257 + });
3256 3258
3257 - //获取门店  
3258 - this.get_sto();  
3259 - this.get_sku(o.stoid, this.data.data, gid);  
3260 - this.check_has_flash();  
3261 - return false; 3259 + //获取门店
  3260 + this.get_sto();
  3261 + this.get_sku(o.stoid, this.data.data, gid);
  3262 + this.check_has_flash();
  3263 + return false;
3262 } 3264 }
3263 3265
3264 //if (prom_type != 3 && prom_type!=0){ 3266 //if (prom_type != 3 && prom_type!=0){
3265 //---判断秒杀---- 3267 //---判断秒杀----
3266 - if (prom_type == 1 && prom_id>0) { 3268 + if (prom_type == 1 && prom_id > 0) {
3267 //-------判断活动是否抢光--------- 3269 //-------判断活动是否抢光---------
3268 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { 3270 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
3269 1: 1 3271 1: 1
@@ -3275,7 +3277,7 @@ Page({ @@ -3275,7 +3277,7 @@ Page({
3275 prom_r_null: 1 3277 prom_r_null: 1
3276 }); 3278 });
3277 //拿取价格并且判断时间-- 3279 //拿取价格并且判断时间--
3278 - getApp().request.get("/api/ms/flash_sale/getNew/" +os.stoid + "/" +user_id+"/"+ prom_id, { 3280 + getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, {
3279 success: function (t) { 3281 success: function (t) {
3280 if (t.data.code != 0) { 3282 if (t.data.code != 0) {
3281 ee.setData({ 3283 ee.setData({
@@ -3353,51 +3355,51 @@ Page({ @@ -3353,51 +3355,51 @@ Page({
3353 3355
3354 //如果是进行中的话 3356 //如果是进行中的话
3355 if (endTime1 < newTime) { 3357 if (endTime1 < newTime) {
3356 - //-- 获取秒杀活动的多少规格 --  
3357 - ee.get_more_flahs(function (list) {  
3358 - if (list && list.length > 1) {  
3359 -  
3360 - var n_item = list[0];  
3361 - var ind = list.findIndex(function (ele) {  
3362 - return ele.goods_id == ee.data.data.goods_id;  
3363 - })  
3364 - if (ind < 0) return false;  
3365 - if (ind > 0) {  
3366 - n_item = JSON.parse(JSON.stringify(list[ind]));  
3367 - list.splice(ind, 1);  
3368 - list.unshift(n_item);  
3369 - }  
3370 -  
3371 - ee.data.sele_g.viplimited = n_item.viplimited;  
3372 - ee.data.data.viplimited = n_item.viplimited;  
3373 -  
3374 - var gb = 1;  
3375 - //-- 显示多规格 --  
3376 - for (let i in list) {  
3377 - let item = list[i];  
3378 - var gg = "";  
3379 - if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";  
3380 - if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";  
3381 -  
3382 - if (item.goods_spec != "" && item.goods_color != "") {  
3383 - gg = item.goods_spec + "/" + item.goods_color;  
3384 - } else if (item.goods_spec != "" || item.goods_color != "") {  
3385 - gg = item.goods_spec + item.goods_color;  
3386 - } else {  
3387 - gg = "规格" + gb;  
3388 - gb++;  
3389 - }  
3390 - item.gg = gg;  
3391 - item.prom_id = item.prom_id;  
3392 - item.prom_type = 1;  
3393 - } 3358 + //-- 获取秒杀活动的多少规格 --
  3359 + ee.get_more_flahs(function (list) {
  3360 + if (list && list.length > 1) {
3394 3361
3395 - ee.setData({  
3396 - sku_g: list,  
3397 - }); 3362 + var n_item = list[0];
  3363 + var ind = list.findIndex(function (ele) {
  3364 + return ele.goods_id == ee.data.data.goods_id;
  3365 + })
  3366 + if (ind < 0) return false;
  3367 + if (ind > 0) {
  3368 + n_item = JSON.parse(JSON.stringify(list[ind]));
  3369 + list.splice(ind, 1);
  3370 + list.unshift(n_item);
  3371 + }
3398 3372
  3373 + ee.data.sele_g.viplimited = n_item.viplimited;
  3374 + ee.data.data.viplimited = n_item.viplimited;
  3375 +
  3376 + var gb = 1;
  3377 + //-- 显示多规格 --
  3378 + for (let i in list) {
  3379 + let item = list[i];
  3380 + var gg = "";
  3381 + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  3382 + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
  3383 +
  3384 + if (item.goods_spec != "" && item.goods_color != "") {
  3385 + gg = item.goods_spec + "/" + item.goods_color;
  3386 + } else if (item.goods_spec != "" || item.goods_color != "") {
  3387 + gg = item.goods_spec + item.goods_color;
  3388 + } else {
  3389 + gg = "规格" + gb;
  3390 + gb++;
3399 } 3391 }
3400 - }) 3392 + item.gg = gg;
  3393 + item.prom_id = item.prom_id;
  3394 + item.prom_type = 1;
  3395 + }
  3396 +
  3397 + ee.setData({
  3398 + sku_g: list,
  3399 + });
  3400 +
  3401 + }
  3402 + })
3401 } 3403 }
3402 3404
3403 } 3405 }
@@ -3733,35 +3735,35 @@ Page({ @@ -3733,35 +3735,35 @@ Page({
3733 min: this.timeFormat(min), 3735 min: this.timeFormat(min),
3734 sec: this.timeFormat(sec) 3736 sec: this.timeFormat(sec)
3735 } 3737 }
3736 - // console.log('cd'); 3738 + // console.log('cd');
3737 } else { 3739 } else {
3738 -  
3739 -  
3740 -  
3741 - obj = {  
3742 - day: '00',  
3743 - hou: '00',  
3744 - min: '00',  
3745 - sec: '00'  
3746 - }  
3747 -  
3748 - th.setData({  
3749 - djs: obj,  
3750 - isTimeUp: true,  
3751 - });  
3752 - // console.log('i am here');  
3753 - return false; 3740 +
  3741 +
  3742 +
  3743 + obj = {
  3744 + day: '00',
  3745 + hou: '00',
  3746 + min: '00',
  3747 + sec: '00'
  3748 + }
  3749 +
  3750 + th.setData({
  3751 + djs: obj,
  3752 + isTimeUp: true,
  3753 + });
  3754 + // console.log('i am here');
  3755 + return false;
3754 } 3756 }
3755 -  
3756 - // ----  
3757 -  
3758 -  
3759 -  
3760 -  
3761 - th.setData({  
3762 - djs: obj  
3763 - });  
3764 - // ---- 3757 +
  3758 + // ----
  3759 +
  3760 +
  3761 +
  3762 +
  3763 + th.setData({
  3764 + djs: obj
  3765 + });
  3766 + // ----
3765 setTimeout(function () { 3767 setTimeout(function () {
3766 th.countDown(endTime) 3768 th.countDown(endTime)
3767 }, 1000); 3769 }, 1000);
@@ -3796,12 +3798,12 @@ Page({ @@ -3796,12 +3798,12 @@ Page({
3796 success: function (t) { 3798 success: function (t) {
3797 if (t.data.code == 0) { 3799 if (t.data.code == 0) {
3798 var g_buy_num = t.data.data.goodsbuynum; 3800 var g_buy_num = t.data.data.goodsbuynum;
3799 -  
3800 - //如果是秒杀的时候  
3801 - if(th.data.prom_type==0 && gd.prom_type == 1 ){  
3802 - gd.prom_type= 0;  
3803 - }  
3804 - 3801 +
  3802 + //如果是秒杀的时候
  3803 + if (th.data.prom_type == 0 && gd.prom_type == 1) {
  3804 + gd.prom_type = 0;
  3805 + }
  3806 +
3805 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { 3807 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
3806 //----获取活动购买数---- 3808 //----获取活动购买数----
3807 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { 3809 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
@@ -3858,7 +3860,7 @@ Page({ @@ -3858,7 +3860,7 @@ Page({
3858 }, 3860 },
3859 3861
3860 //--点击弹起拼单-- 3862 //--点击弹起拼单--
3861 - // ind == 1 为普通购买 3863 + // ind == 1 为普通购买
3862 openSpecModel_pt: function (e) { 3864 openSpecModel_pt: function (e) {
3863 3865
3864 this.setData({ open_ind_store: 9, goodsInputNum: 1 }); 3866 this.setData({ open_ind_store: 9, goodsInputNum: 1 });
@@ -3876,125 +3878,125 @@ Page({ @@ -3876,125 +3878,125 @@ Page({
3876 page: 1 3878 page: 1
3877 } 3879 }
3878 }).then(res => { 3880 }).then(res => {
3879 - if(res.data.code == 0){  
3880 - if (res.data.data.total > 0) {  
3881 - // 待支付订单页面  
3882 - wx.showModal({  
3883 - title: "您已经购买了该商品待支付中",  
3884 - success: function (a) {  
3885 - if (a.confirm) {  
3886 - switOn = false;  
3887 - wx.navigateTo({  
3888 - url: "/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id=" + res.data.data.pageData[0]['order_id']  
3889 - });  
3890 - } 3881 + if (res.data.code == 0) {
  3882 + if (res.data.data.total > 0) {
  3883 + // 待支付订单页面
  3884 + wx.showModal({
  3885 + title: "您已经购买了该商品待支付中",
  3886 + success: function (a) {
  3887 + if (a.confirm) {
  3888 + switOn = false;
  3889 + wx.navigateTo({
  3890 + url: "/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id=" + res.data.data.pageData[0]['order_id']
  3891 + });
3891 } 3892 }
3892 - });  
3893 - } else {  
3894 - //--先判断会员状态--  
3895 - var user_info = getApp().globalData.userInfo;  
3896 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {  
3897 - wx.navigateTo({  
3898 - url: '/pages/togoin/togoin',  
3899 - })  
3900 - return false;  
3901 - }; 3893 + }
  3894 + });
  3895 + } else {
  3896 + //--先判断会员状态--
  3897 + var user_info = getApp().globalData.userInfo;
  3898 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) {
  3899 + wx.navigateTo({
  3900 + url: '/pages/togoin/togoin',
  3901 + })
  3902 + return false;
  3903 + };
3902 3904
3903 - var th = this;  
3904 - var ind = parseInt(e.currentTarget.dataset.ind);  
3905 -  
3906 - console.log('当前ind========>>>>', ind);  
3907 -  
3908 - //ind == 1是普通购买  
3909 - if (ind == 1) {  
3910 - //如果拼单的sku data是空的,就要先获取一下  
3911 - if (th.data.sku_g_pt) {  
3912 - th.get_sto(1);  
3913 - th.setData({  
3914 - is_normal: ind,  
3915 - openSpecModal_pt: 1  
3916 - });  
3917 - } else {  
3918 - th.get_sto(1);  
3919 - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () {  
3920 - th.setData({  
3921 - is_normal: ind,  
3922 - openSpecModal_pt: 1  
3923 - });  
3924 - });  
3925 - 3905 + var th = this;
  3906 + var ind = parseInt(e.currentTarget.dataset.ind);
  3907 +
  3908 + console.log('当前ind========>>>>', ind);
  3909 +
  3910 + //ind == 1是普通购买
  3911 + if (ind == 1) {
  3912 + //如果拼单的sku data是空的,就要先获取一下
  3913 + if (th.data.sku_g_pt) {
  3914 + th.get_sto(1);
  3915 + th.setData({
  3916 + is_normal: ind,
  3917 + openSpecModal_pt: 1
  3918 + });
  3919 + } else {
  3920 + th.get_sto(1);
  3921 + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () {
3926 th.setData({ 3922 th.setData({
3927 is_normal: ind, 3923 is_normal: ind,
3928 openSpecModal_pt: 1 3924 openSpecModal_pt: 1
3929 }); 3925 });
3930 - };  
3931 - th.check_is_youhui(th.data.gid, 1);  
3932 - } else { 3926 + });
3933 3927
3934 - // //拼单商品从这里进,先判断有没有买过商品,  
3935 - // getApp().request.get("/api/weshop/order/page", {  
3936 - // data: {  
3937 - // // pt_prom_id: th.data.prom_act.id,  
3938 - // user_id: oo.user_id,  
3939 - // store_id: os.stoid,  
3940 - // pageSize: 1,  
3941 - // page: 1  
3942 - // },  
3943 - // success: function (e) {  
3944 - // //--跳转到已经购买的情况--  
3945 - // if (e.data.data.pageData.length > 0) {  
3946 - // var odr = e.data.data.pageData[0];  
3947 - // //还未支付  
3948 - // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3949 - // wx.showModal({  
3950 - // title: "您已经购买了该商品待支付中",  
3951 - // success: function (a) {  
3952 - // if (a.confirm) {  
3953 - // wx.navigateTo({  
3954 - // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3955 - // });  
3956 - // }  
3957 - // }  
3958 - // });  
3959 - // } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3960 -  
3961 - // if (this.data.is_go_to_team_show) return false;  
3962 - // this.data.is_go_to_team_show = 1;  
3963 - // wx.showLoading();  
3964 -  
3965 - // /*---  
3966 - // wx.redirectTo({  
3967 - // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3968 - // });--*/  
3969 - // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);  
3970 -  
3971 - // } else {  
3972 - // th.setData({  
3973 - // is_normal: ind,  
3974 - // openSpecModal_pt: 1  
3975 - // });  
3976 - // }  
3977 -  
3978 - // } else {  
3979 - // th.setData({  
3980 - // is_normal: ind,  
3981 - // openSpecModal_pt: 1  
3982 - // });  
3983 - // }  
3984 - // }  
3985 - // });  
3986 - th.get_sto(1);  
3987 th.setData({ 3928 th.setData({
3988 - is_normal: 0, 3929 + is_normal: ind,
3989 openSpecModal_pt: 1 3930 openSpecModal_pt: 1
3990 }); 3931 });
3991 -  
3992 - } 3932 + };
  3933 + th.check_is_youhui(th.data.gid, 1);
  3934 + } else {
  3935 +
  3936 + // //拼单商品从这里进,先判断有没有买过商品,
  3937 + // getApp().request.get("/api/weshop/order/page", {
  3938 + // data: {
  3939 + // // pt_prom_id: th.data.prom_act.id,
  3940 + // user_id: oo.user_id,
  3941 + // store_id: os.stoid,
  3942 + // pageSize: 1,
  3943 + // page: 1
  3944 + // },
  3945 + // success: function (e) {
  3946 + // //--跳转到已经购买的情况--
  3947 + // if (e.data.data.pageData.length > 0) {
  3948 + // var odr = e.data.data.pageData[0];
  3949 + // //还未支付
  3950 + // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  3951 + // wx.showModal({
  3952 + // title: "您已经购买了该商品待支付中",
  3953 + // success: function (a) {
  3954 + // if (a.confirm) {
  3955 + // wx.navigateTo({
  3956 + // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  3957 + // });
  3958 + // }
  3959 + // }
  3960 + // });
  3961 + // } else if (odr.pt_status == 1 && odr.order_status == 1) {
  3962 +
  3963 + // if (this.data.is_go_to_team_show) return false;
  3964 + // this.data.is_go_to_team_show = 1;
  3965 + // wx.showLoading();
  3966 +
  3967 + // /*---
  3968 + // wx.redirectTo({
  3969 + // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3970 + // });--*/
  3971 + // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
  3972 +
  3973 + // } else {
  3974 + // th.setData({
  3975 + // is_normal: ind,
  3976 + // openSpecModal_pt: 1
  3977 + // });
  3978 + // }
  3979 +
  3980 + // } else {
  3981 + // th.setData({
  3982 + // is_normal: ind,
  3983 + // openSpecModal_pt: 1
  3984 + // });
  3985 + // }
  3986 + // }
  3987 + // });
  3988 + th.get_sto(1);
  3989 + th.setData({
  3990 + is_normal: 0,
  3991 + openSpecModal_pt: 1
  3992 + });
  3993 +
3993 } 3994 }
3994 -  
3995 } 3995 }
  3996 +
  3997 + }
3996 }); 3998 });
3997 - 3999 +
3998 4000
3999 4001
4000 4002
@@ -4002,9 +4004,9 @@ Page({ @@ -4002,9 +4004,9 @@ Page({
4002 4004
4003 //-----------------拼单生成方法--------------------- 4005 //-----------------拼单生成方法---------------------
4004 addCart_pt: function () { 4006 addCart_pt: function () {
4005 - this.setData({  
4006 - openSpecModal_pt: 0,  
4007 - }); 4007 + this.setData({
  4008 + openSpecModal_pt: 0,
  4009 + });
4008 if (this.data.is_normal == 0) { 4010 if (this.data.is_normal == 0) {
4009 //看一下有没有起购数,如果有起购数,要计算起购数 4011 //看一下有没有起购数,如果有起购数,要计算起购数
4010 // var qnum = parseFloat(th.data.prom_act.minbuynum); 4012 // var qnum = parseFloat(th.data.prom_act.minbuynum);
@@ -4046,7 +4048,7 @@ Page({ @@ -4046,7 +4048,7 @@ Page({
4046 // return false; 4048 // return false;
4047 // } 4049 // }
4048 // } 4050 // }
4049 - 4051 +
4050 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- 4052 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
4051 // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { 4053 // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) {
4052 // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { 4054 // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
@@ -4095,7 +4097,7 @@ Page({ @@ -4095,7 +4097,7 @@ Page({
4095 sto_sele_name: "" 4097 sto_sele_name: ""
4096 }); 4098 });
4097 if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); 4099 if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
4098 - 4100 +
4099 //--------------此时操作的数据------------ 4101 //--------------此时操作的数据------------
4100 var newd = { 4102 var newd = {
4101 goods_id: o.goods_id, 4103 goods_id: o.goods_id,
@@ -4168,11 +4170,11 @@ Page({ @@ -4168,11 +4170,11 @@ Page({
4168 } 4170 }
4169 4171
4170 } 4172 }
4171 -  
4172 - // else if (th.data.prom_type == 3) {  
4173 - // newd.prom_type = 0;  
4174 - // newd.prom_id = 0;  
4175 - // } 4173 +
  4174 + // else if (th.data.prom_type == 3) {
  4175 + // newd.prom_type = 0;
  4176 + // newd.prom_id = 0;
  4177 + // }
4176 4178
4177 newd['pick_name'] = th.data.sto_sele_name; 4179 newd['pick_name'] = th.data.sto_sele_name;
4178 newd['pick_dis'] = th.data.sto_sele_distr; 4180 newd['pick_dis'] = th.data.sto_sele_distr;
@@ -4186,25 +4188,25 @@ Page({ @@ -4186,25 +4188,25 @@ Page({
4186 newd['prom_type'] = 0; 4188 newd['prom_type'] = 0;
4187 newd['prom_id'] = e.act_id; 4189 newd['prom_id'] = e.act_id;
4188 } 4190 }
4189 - console.log('aaaaa');  
4190 - newd['prom_type'] = 0; 4191 + console.log('aaaaa');
  4192 + newd['prom_type'] = 0;
4191 th.buyNow(newd); 4193 th.buyNow(newd);
4192 }); 4194 });
4193 } 4195 }
4194 else { 4196 else {
4195 - // 点击立即参团  
4196 - th.buyNow_pt(newd);  
4197 - }; 4197 + // 点击立即参团
  4198 + th.buyNow_pt(newd);
  4199 + };
4198 }) 4200 })
4199 }, 4201 },
4200 //----------立即购买_pt----------- 4202 //----------立即购买_pt-----------
4201 buyNow_pt: function (e) { 4203 buyNow_pt: function (e) {
4202 s.set_b_now(e); 4204 s.set_b_now(e);
4203 wx.navigateTo({ 4205 wx.navigateTo({
4204 - url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price/100 + '&is_show=' + this.data.luckGoInfo.is_show, 4206 + url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price / 100 + '&is_show=' + this.data.luckGoInfo.is_show,
4205 }); 4207 });
4206 -  
4207 - // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); 4208 +
  4209 + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert);
4208 }, 4210 },
4209 4211
4210 //-------跳转pt商品------- 4212 //-------跳转pt商品-------
@@ -4526,95 +4528,95 @@ Page({ @@ -4526,95 +4528,95 @@ Page({
4526 } 4528 }
4527 }) 4529 })
4528 }, 4530 },
4529 -  
4530 -  
4531 - drawPoster(context, unit, img, vpath) {  
4532 - // 1.灰色背景  
4533 - context.setFillStyle('#f2f1f6');  
4534 - context.rect(0,0,554*unit,899*unit);  
4535 - context.fill();  
4536 - // 2.商城名称  
4537 - let shopName = this.data.sto_sele_name_1;  
4538 - // let shopNameLen = context.measureText(shopName);  
4539 - // let x_shopNameLen = (554 - shopNameLen.width)/2*unit;  
4540 - // console.log('11111111111111',shopNameLen,x_shopNameLen);  
4541 - context.setTextAlign('center');  
4542 - context.setFontSize(26*unit);  
4543 - context.setFillStyle('black');  
4544 - context.fillText(shopName, 277*unit, 60*unit);  
4545 - // // 3.推荐来源  
4546 - let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;  
4547 - // let fromTextLen = context.measureText(fromText);  
4548 - // let x_fromText = (375 - fromTextLen.width)/2;  
4549 - // console.log('222222',fromTextLen,x_fromText);  
4550 - context.setTextAlign('center');  
4551 - context.setFontSize(22*unit);  
4552 - context.setFillStyle('#96959a');  
4553 - context.fillText(fromText, 277*unit, 105*unit);  
4554 - // 4.海报背景  
4555 - // context.beginPath();  
4556 - // context.setStrokeStyle('#f2f1f6');  
4557 - context.setFillStyle('white');  
4558 - context.fillRect(37*unit, 157*unit, 480*unit, 673*unit);  
4559 - // context.stroke();  
4560 - // context.fill();  
4561 - // 5.商品图片  
4562 - // 图片的x坐标  
4563 - let bg_x = 37*unit  
4564 - // 图片的y坐标  
4565 - let bg_y = 157*unit  
4566 - // 图片宽度  
4567 - let bg_w = 480*unit  
4568 - // 图片高度  
4569 - let bg_h = 474*unit  
4570 - // 图片圆角  
4571 - let bg_r = 4  
4572 - // 绘制海报背景图片圆角  
4573 - context.save()  
4574 - context.beginPath()  
4575 - context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI*1.5)  
4576 - context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)  
4577 - context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)  
4578 - context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)  
4579 - context.clip()  
4580 - context.drawImage(img, bg_x, bg_y, bg_w, bg_h);  
4581 - context.restore()  
4582 - // 6.强烈推荐  
4583 - // context.beginPath();  
4584 - let tj_path = "../../../../images/share/q_tj.png";  
4585 - context.beginPath()  
4586 - context.drawImage(tj_path, 54*unit, 648*unit, 85*unit, 30*unit);  
4587 - context.setFontSize(16*unit)  
4588 - context.setLineJoin('round'); //交点设置成圆角  
4589 - context.setFillStyle("white")  
4590 - context.setTextAlign('left');  
4591 - context.fillText('强烈推荐', 64*unit, 672*unit);  
4592 - // 7.商品价格  
4593 - let price = '¥' + this.data.data.shop_price;  
4594 - // if (th.data.prom_act)  
4595 - // pri0 = th.data.prom_act.price;  
4596 - context.setFontSize(32*unit);  
4597 - context.setFillStyle('#DE1117');  
4598 - context.fillText(price, 54*unit, 730*unit);  
4599 - // 8.商品标题  
4600 - context.setFontSize(20*unit);  
4601 - context.setFillStyle('#898989');  
4602 - this.draw_Text(context, this.data.data.goods_name,  
4603 - 54*unit, 770*unit, 240*unit, 240*unit, unit);  
4604 - // 9.小程序码  
4605 - context.drawImage(vpath, 375*unit, 660*unit, 120*unit, 120*unit);  
4606 - context.setFontSize(16*unit);  
4607 - context.setFillStyle('#777');  
4608 - context.fillText('长按识别二维码', 378*unit, 810*unit);  
4609 - // 10.竖线  
4610 - context.beginPath();  
4611 - context.setFillStyle('#eee');  
4612 - context.rect(354*unit, 670*unit, 1*unit, 130*unit);  
4613 - context.fill();  
4614 -  
4615 - },  
4616 -  
4617 - 4531 +
  4532 +
  4533 + drawPoster(context, unit, img, vpath) {
  4534 + // 1.灰色背景
  4535 + context.setFillStyle('#f2f1f6');
  4536 + context.rect(0, 0, 554 * unit, 899 * unit);
  4537 + context.fill();
  4538 + // 2.商城名称
  4539 + let shopName = this.data.sto_sele_name_1;
  4540 + // let shopNameLen = context.measureText(shopName);
  4541 + // let x_shopNameLen = (554 - shopNameLen.width)/2*unit;
  4542 + // console.log('11111111111111',shopNameLen,x_shopNameLen);
  4543 + context.setTextAlign('center');
  4544 + context.setFontSize(26 * unit);
  4545 + context.setFillStyle('black');
  4546 + context.fillText(shopName, 277 * unit, 60 * unit);
  4547 + // // 3.推荐来源
  4548 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  4549 + // let fromTextLen = context.measureText(fromText);
  4550 + // let x_fromText = (375 - fromTextLen.width)/2;
  4551 + // console.log('222222',fromTextLen,x_fromText);
  4552 + context.setTextAlign('center');
  4553 + context.setFontSize(22 * unit);
  4554 + context.setFillStyle('#96959a');
  4555 + context.fillText(fromText, 277 * unit, 105 * unit);
  4556 + // 4.海报背景
  4557 + // context.beginPath();
  4558 + // context.setStrokeStyle('#f2f1f6');
  4559 + context.setFillStyle('white');
  4560 + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
  4561 + // context.stroke();
  4562 + // context.fill();
  4563 + // 5.商品图片
  4564 + // 图片的x坐标
  4565 + let bg_x = 37 * unit
  4566 + // 图片的y坐标
  4567 + let bg_y = 157 * unit
  4568 + // 图片宽度
  4569 + let bg_w = 480 * unit
  4570 + // 图片高度
  4571 + let bg_h = 474 * unit
  4572 + // 图片圆角
  4573 + let bg_r = 4
  4574 + // 绘制海报背景图片圆角
  4575 + context.save()
  4576 + context.beginPath()
  4577 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
  4578 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  4579 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  4580 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  4581 + context.clip()
  4582 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  4583 + context.restore()
  4584 + // 6.强烈推荐
  4585 + // context.beginPath();
  4586 + let tj_path = "../../../../images/share/q_tj.png";
  4587 + context.beginPath()
  4588 + context.drawImage(tj_path, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  4589 + context.setFontSize(16 * unit)
  4590 + context.setLineJoin('round'); //交点设置成圆角
  4591 + context.setFillStyle("white")
  4592 + context.setTextAlign('left');
  4593 + context.fillText('强烈推荐', 64 * unit, 672 * unit);
  4594 + // 7.商品价格
  4595 + let price = '¥' + this.data.data.shop_price;
  4596 + // if (th.data.prom_act)
  4597 + // pri0 = th.data.prom_act.price;
  4598 + context.setFontSize(32 * unit);
  4599 + context.setFillStyle('#DE1117');
  4600 + context.fillText(price, 54 * unit, 730 * unit);
  4601 + // 8.商品标题
  4602 + context.setFontSize(20 * unit);
  4603 + context.setFillStyle('#898989');
  4604 + this.draw_Text(context, this.data.data.goods_name,
  4605 + 54 * unit, 770 * unit, 240 * unit, 240 * unit, unit);
  4606 + // 9.小程序码
  4607 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
  4608 + context.setFontSize(16 * unit);
  4609 + context.setFillStyle('#777');
  4610 + context.fillText('长按识别二维码', 378 * unit, 810 * unit);
  4611 + // 10.竖线
  4612 + context.beginPath();
  4613 + context.setFillStyle('#eee');
  4614 + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
  4615 + context.fill();
  4616 +
  4617 + },
  4618 +
  4619 +
4618 4620
4619 //--定义的保存图片方法,分享团--- 4621 //--定义的保存图片方法,分享团---
4620 saveImageToPhotosAlbum: function () { 4622 saveImageToPhotosAlbum: function () {
@@ -4627,16 +4629,16 @@ Page({ @@ -4627,16 +4629,16 @@ Page({
4627 } 4629 }
4628 4630
4629 if (this.data.share_hidden) { 4631 if (this.data.share_hidden) {
4630 - this.setData({ share_hidden: false,}); 4632 + this.setData({ share_hidden: false, });
4631 }; 4633 };
4632 4634
4633 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 9幸运购 4635 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 9幸运购
4634 var type = 9; 4636 var type = 9;
4635 - console.log('type',type); 4637 + console.log('type', type);
4636 if (type == 6) type = 2; 4638 if (type == 6) type = 2;
4637 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; 4639 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
4638 4640
4639 - wx.showLoading({ title: '生成中...',}) 4641 + wx.showLoading({ title: '生成中...', })
4640 var that = this, th = that; 4642 var that = this, th = that;
4641 //设置画板显示,才能开始绘图 4643 //设置画板显示,才能开始绘图
4642 that.setData({ 4644 that.setData({
@@ -4647,8 +4649,8 @@ Page({ @@ -4647,8 +4649,8 @@ Page({
4647 var unit = that.data.screenWidth / 750 * 1.35; //基础单位, 4649 var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
4648 var path2 = that.data.data.original_img; 4650 var path2 = that.data.data.original_img;
4649 var scene = th.data.gid + ""; 4651 var scene = th.data.gid + "";
4650 - scene+="."+th.data.sele_g.prom_type+"."+th.data.luckGoInfo.id;  
4651 - // th.data.sele_g.prom_id 4652 + scene += "." + th.data.sele_g.prom_type + "." + th.data.luckGoInfo.id;
  4653 + // th.data.sele_g.prom_id
4652 4654
4653 var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; 4655 var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
4654 if (user_id > 0) { 4656 if (user_id > 0) {
@@ -4661,13 +4663,13 @@ Page({ @@ -4661,13 +4663,13 @@ Page({
4661 scene += "_" + getApp().globalData.room_id; 4663 scene += "_" + getApp().globalData.room_id;
4662 } 4664 }
4663 ///二微码 4665 ///二微码
4664 - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +  
4665 - os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; 4666 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  4667 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo";
4666 // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 4668 // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
4667 // os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo"; 4669 // os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo";
4668 4670
4669 - console.log('path3......',path3);  
4670 - 4671 + console.log('path3......', path3);
  4672 +
4671 4673
4672 // 读取文件成功则OK-- 4674 // 读取文件成功则OK--
4673 wx.getImageInfo({ 4675 wx.getImageInfo({
@@ -4682,86 +4684,86 @@ Page({ @@ -4682,86 +4684,86 @@ Page({
4682 4684
4683 // context.fillStyle="#FFFFFF"; 4685 // context.fillStyle="#FFFFFF";
4684 // context.fillRect(0,0,554 * unit, 899 * unit); 4686 // context.fillRect(0,0,554 * unit, 899 * unit);
4685 -  
4686 - // if(type == 0) {  
4687 - // this.drawPoster(context);  
4688 - // return false;  
4689 - // };  
4690 - 4687 +
  4688 + // if(type == 0) {
  4689 + // this.drawPoster(context);
  4690 + // return false;
  4691 + // };
  4692 +
4691 4693
4692 //-- 如果有自定义海报的时候,判断背景的图片 -- 4694 //-- 如果有自定义海报的时候,判断背景的图片 --
4693 if (th.data.share_b_img) { 4695 if (th.data.share_b_img) {
4694 pg_path = th.data.share_b_img; 4696 pg_path = th.data.share_b_img;
4695 } 4697 }
4696 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 4698 // context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
4697 -  
4698 -  
4699 - if(type == 0) { // 如果是普通商品,绘制新海报  
4700 - th.drawPoster(context, unit, th.data.share_goods_img, vpath);  
4701 - } else {  
4702 - context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);  
4703 - };  
4704 -  
4705 - // th.drawPoster(context, unit, th.data.share_goods_img, vpath);  
4706 - 4699 +
  4700 +
  4701 + if (type == 0) { // 如果是普通商品,绘制新海报
  4702 + th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  4703 + } else {
  4704 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  4705 + };
  4706 +
  4707 + // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  4708 +
4707 4709
4708 //-- 是自定义海报的情况下 -- 4710 //-- 是自定义海报的情况下 --
4709 - if(type != 0) {  
4710 -  
4711 -  
4712 -  
4713 - if (th.data.poster && parseInt(th.data.poster.style) == 2) {  
4714 - //在线上分享人的情况下  
4715 - if (parseInt(th.data.poster.show_headpic)) {  
4716 - //获取坐标  
4717 - var x = parseFloat(th.data.poster.head_x) * 2;  
4718 - var y = parseFloat(th.data.poster.head_y) * 2;  
4719 - var x1 = (x + 90) * unit;  
4720 - var y1 = (y + 50) * unit;  
4721 - //--昵称---  
4722 - context.setFontSize(24 * unit)  
4723 - context.setFillStyle("black")  
4724 - context.fillText(app.globalData.userInfo.nickname, x1, y1);  
4725 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;  
4726 - //强烈推荐 改许程  
4727 - var tj_path = "../../../../images/share/q_tj.png";  
4728 - context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);  
4729 - context.setFontSize(16 * unit);  
4730 - context.setLineJoin('round'); //交点设置成圆角  
4731 - context.setFillStyle("white");  
4732 - context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);  
4733 -  
4734 - //context.setFillStyle("black")  
4735 - //context.setFontSize(24 * unit)  
4736 - //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);  
4737 - }  
4738 - } else {  
4739 - //--昵称---  
4740 - context.setFontSize(24 * unit);  
4741 - context.setFillStyle("black");  
4742 - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit);  
4743 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;  
4744 - //强烈推荐 改许程  
4745 - // var tj_path = "../../../../images/share/q_tj.png";  
4746 - // let txt_gn = th.data.luckGoInfo.group_num + '人团';  
4747 - // let width_gn = ut.measureText(txt_gn, 15);  
4748 - // context.drawImage(tj_path, 152 * unit + width, 54 * unit, (width_gn + 20) * unit, 30 * unit);  
4749 - // context.setFontSize(16 * unit);  
4750 - // context.setLineJoin('round'); //交点设置成圆角  
4751 - // context.setFillStyle("white");  
4752 - // context.fillText(txt_gn, 149 * unit + width + 15 * unit, 75 * unit);  
4753 - // 发出幸运购活动邀请  
4754 - context.setFillStyle("#7f7f7f")  
4755 - context.setFontSize(21.3 * unit)  
4756 - context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit);  
4757 -  
4758 - }  
4759 -  
4760 - };  
4761 -  
4762 -  
4763 -  
4764 - var share_title = th.data.data.goods_name; 4711 + if (type != 0) {
  4712 +
  4713 +
  4714 +
  4715 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  4716 + //在线上分享人的情况下
  4717 + if (parseInt(th.data.poster.show_headpic)) {
  4718 + //获取坐标
  4719 + var x = parseFloat(th.data.poster.head_x) * 2;
  4720 + var y = parseFloat(th.data.poster.head_y) * 2;
  4721 + var x1 = (x + 90) * unit;
  4722 + var y1 = (y + 50) * unit;
  4723 + //--昵称---
  4724 + context.setFontSize(24 * unit)
  4725 + context.setFillStyle("black")
  4726 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  4727 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  4728 + //强烈推荐 改许程
  4729 + var tj_path = "../../../../images/share/q_tj.png";
  4730 + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
  4731 + context.setFontSize(16 * unit);
  4732 + context.setLineJoin('round'); //交点设置成圆角
  4733 + context.setFillStyle("white");
  4734 + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);
  4735 +
  4736 + //context.setFillStyle("black")
  4737 + //context.setFontSize(24 * unit)
  4738 + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);
  4739 + }
  4740 + } else {
  4741 + //--昵称---
  4742 + context.setFontSize(24 * unit);
  4743 + context.setFillStyle("black");
  4744 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 60 * unit);
  4745 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  4746 + //强烈推荐 改许程
  4747 + // var tj_path = "../../../../images/share/q_tj.png";
  4748 + // let txt_gn = th.data.luckGoInfo.group_num + '人团';
  4749 + // let width_gn = ut.measureText(txt_gn, 15);
  4750 + // context.drawImage(tj_path, 152 * unit + width, 54 * unit, (width_gn + 20) * unit, 30 * unit);
  4751 + // context.setFontSize(16 * unit);
  4752 + // context.setLineJoin('round'); //交点设置成圆角
  4753 + // context.setFillStyle("white");
  4754 + // context.fillText(txt_gn, 149 * unit + width + 15 * unit, 75 * unit);
  4755 + // 发出幸运购活动邀请
  4756 + context.setFillStyle("#7f7f7f")
  4757 + context.setFontSize(21.3 * unit)
  4758 + context.fillText("向您发出幸运购邀请", 152 * unit, 90 * unit);
  4759 +
  4760 + }
  4761 +
  4762 + };
  4763 +
  4764 +
  4765 +
  4766 + var share_title = th.data.data.goods_name;
4765 if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) { 4767 if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) {
4766 share_title = th.data.prom_act.share_title; 4768 share_title = th.data.prom_act.share_title;
4767 if (!share_title) share_title = th.data.prom_act.title; 4769 if (!share_title) share_title = th.data.prom_act.title;
@@ -4781,8 +4783,8 @@ Page({ @@ -4781,8 +4783,8 @@ Page({
4781 context.setFillStyle("red") 4783 context.setFillStyle("red")
4782 4784
4783 4785
4784 - var pri0 = th.data.luckGoInfo.group_price/100;  
4785 - // console.log('pri0========>>>>>', pri0); 4786 + var pri0 = th.data.luckGoInfo.group_price / 100;
  4787 + // console.log('pri0========>>>>>', pri0);
4786 // if (th.data.prom_act) 4788 // if (th.data.prom_act)
4787 // pri0 = th.data.prom_act.price; 4789 // pri0 = th.data.prom_act.price;
4788 pri0 = parseFloat(pri0).toFixed(2); 4790 pri0 = parseFloat(pri0).toFixed(2);
@@ -4790,13 +4792,13 @@ Page({ @@ -4790,13 +4792,13 @@ Page({
4790 context.fillText("¥", wd1 - 15, 185 * unit); 4792 context.fillText("¥", wd1 - 15, 185 * unit);
4791 context.setFontSize(31 * unit) 4793 context.setFontSize(31 * unit)
4792 context.fillText(pri0, wd1, 185 * unit); 4794 context.fillText(pri0, wd1, 185 * unit);
4793 -  
4794 - var tj_path = "../../../../images/share/q_tj.png";  
4795 - context.drawImage(tj_path, 315 * unit, 158 * unit, 85 * unit, 30 * unit);  
4796 - context.setLineJoin('round'); //交点设置成圆角  
4797 - context.setFontSize(18 * unit);  
4798 - context.setFillStyle("white");  
4799 - context.fillText('参团价', 330 * unit, 179 * unit); 4795 +
  4796 + var tj_path = "../../../../images/share/q_tj.png";
  4797 + context.drawImage(tj_path, 315 * unit, 158 * unit, 85 * unit, 30 * unit);
  4798 + context.setLineJoin('round'); //交点设置成圆角
  4799 + context.setFontSize(18 * unit);
  4800 + context.setFillStyle("white");
  4801 + context.fillText('参团价', 330 * unit, 179 * unit);
4800 4802
4801 //---市场价划掉--- 4803 //---市场价划掉---
4802 context.setFillStyle("gray") 4804 context.setFillStyle("gray")
@@ -4811,7 +4813,7 @@ Page({ @@ -4811,7 +4813,7 @@ Page({
4811 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); 4813 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
4812 context.stroke(); 4814 context.stroke();
4813 4815
4814 - } else if(type == 4 && type != 0) { 4816 + } else if (type == 4 && type != 0) {
4815 context.setFillStyle("black"); 4817 context.setFillStyle("black");
4816 context.setFontSize(21.3 * unit) 4818 context.setFontSize(21.3 * unit)
4817 th.draw_Text(context, share_title, 4819 th.draw_Text(context, share_title,
@@ -4831,12 +4833,12 @@ Page({ @@ -4831,12 +4833,12 @@ Page({
4831 } 4833 }
4832 4834
4833 //---中间大图--- 4835 //---中间大图---
4834 - if(type != 0) {  
4835 - context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);  
4836 - };  
4837 -  
4838 -  
4839 - 4836 + if (type != 0) {
  4837 + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  4838 + };
  4839 +
  4840 +
  4841 +
4840 //-------大图后面就不一样了----------- 4842 //-------大图后面就不一样了-----------
4841 switch (type) { 4843 switch (type) {
4842 case 0: break;//普通商品的展示 4844 case 0: break;//普通商品的展示
@@ -5049,130 +5051,130 @@ Page({ @@ -5049,130 +5051,130 @@ Page({
5049 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit); 5051 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
5050 } 5052 }
5051 break; 5053 break;
5052 -  
5053 -  
5054 - case 9:  
5055 -  
5056 - //---画线---  
5057 - context.setLineWidth(1 * unit)  
5058 - context.moveTo(32 * unit, 680 * unit)  
5059 - context.lineTo(520 * unit, 680 * unit)  
5060 - context.stroke();  
5061 -  
5062 - //---文字---  
5063 - context.setFillStyle("black")  
5064 - context.setFontSize(24 * unit)  
5065 - context.font = 'normal bold 18px';  
5066 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);  
5067 -  
5068 - //还差N人,即可成团  
5069 - let group_num = th.data.luckGoInfo.group_num;  
5070 - let num_joined = th.data.luckGoInfo.num;  
5071 - let delta1 = group_num - num_joined;  
5072 - let width_delta1 = ut.measureText(delta1, 15);  
5073 - context.setFillStyle("black");  
5074 - context.setFontSize(21.3 * unit);  
5075 - context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit);  
5076 - context.setFillStyle("#FF6768");  
5077 - context.setFontSize(21.3 * unit);  
5078 - context.fillText(delta1, 160 * unit, 772 * unit);  
5079 - context.setFillStyle("black");  
5080 - context.setFontSize(21.3 * unit);  
5081 - context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit);  
5082 -  
5083 - // N人得商品,N人全额退款  
5084 - let group_win = th.data.luckGoInfo.group_win;  
5085 - let delta2 = group_num - group_win;  
5086 - let width_delta2 = ut.measureText(delta2, 16);  
5087 - let width_groupNum = ut.measureText(group_num, 15);  
5088 - let width_groupWin = ut.measureText(group_win, 15);  
5089 - context.setFillStyle("#FF6768");  
5090 - context.setFontSize(21.3 * unit);  
5091 - context.fillText(group_win, 40 * unit, 806 * unit);  
5092 - context.setFillStyle("black");  
5093 - context.setFontSize(21.3 * unit);  
5094 - context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit);  
5095 - context.setFillStyle("#FF6768");  
5096 - context.setFontSize(21.3 * unit);  
5097 - context.fillText(delta2, 160 * unit, 806 * unit);  
5098 - context.setFillStyle("black");  
5099 - context.setFontSize(21.3 * unit);  
5100 - context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit);  
5101 -  
5102 - // 并得帮团惊喜礼品  
5103 - context.setFillStyle("black")  
5104 - context.setFontSize(21.3 * unit)  
5105 - context.fillText("并得帮团", 40 * unit, 840 * unit);  
5106 - context.setFillStyle("#FF6768")  
5107 - context.setFontSize(21.3 * unit)  
5108 - context.fillText("惊喜礼品", 130 * unit, 840 * unit);  
5109 - context.setFillStyle("black")  
5110 - context.setFontSize(21.3 * unit)  
5111 - context.fillText("!", 220 * unit, 840 * unit);  
5112 -  
5113 -  
5114 - //---二维吗图---  
5115 - //-- 自定义海报 --  
5116 - if (th.data.poster) {  
5117 - var erm_x = parseFloat(th.data.poster.ewm_x) * 2;  
5118 - var erm_y = parseFloat(th.data.poster.ewm_y) * 2;  
5119 - context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);  
5120 - } else {  
5121 - //---二维吗图---  
5122 - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);  
5123 - }  
5124 -  
5125 - break; 5054 +
  5055 +
  5056 + case 9:
  5057 +
  5058 + //---画线---
  5059 + context.setLineWidth(1 * unit)
  5060 + context.moveTo(32 * unit, 680 * unit)
  5061 + context.lineTo(520 * unit, 680 * unit)
  5062 + context.stroke();
  5063 +
  5064 + //---文字---
  5065 + context.setFillStyle("black")
  5066 + context.setFontSize(24 * unit)
  5067 + context.font = 'normal bold 18px';
  5068 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  5069 +
  5070 + //还差N人,即可成团
  5071 + let group_num = th.data.luckGoInfo.group_num;
  5072 + let num_joined = th.data.luckGoInfo.num;
  5073 + let delta1 = group_num - num_joined;
  5074 + let width_delta1 = ut.measureText(delta1, 15);
  5075 + context.setFillStyle("black");
  5076 + context.setFontSize(21.3 * unit);
  5077 + context.fillText(group_num + "人团,还差", 40 * unit, 772 * unit);
  5078 + context.setFillStyle("#FF6768");
  5079 + context.setFontSize(21.3 * unit);
  5080 + context.fillText(delta1, 160 * unit, 772 * unit);
  5081 + context.setFillStyle("black");
  5082 + context.setFontSize(21.3 * unit);
  5083 + context.fillText("人,即可成团", (170 + width_delta1) * unit, 772 * unit);
  5084 +
  5085 + // N人得商品,N人全额退款
  5086 + let group_win = th.data.luckGoInfo.group_win;
  5087 + let delta2 = group_num - group_win;
  5088 + let width_delta2 = ut.measureText(delta2, 16);
  5089 + let width_groupNum = ut.measureText(group_num, 15);
  5090 + let width_groupWin = ut.measureText(group_win, 15);
  5091 + context.setFillStyle("#FF6768");
  5092 + context.setFontSize(21.3 * unit);
  5093 + context.fillText(group_win, 40 * unit, 806 * unit);
  5094 + context.setFillStyle("black");
  5095 + context.setFontSize(21.3 * unit);
  5096 + context.fillText("人得商品,", (54 + width_groupWin) * unit, 806 * unit);
  5097 + context.setFillStyle("#FF6768");
  5098 + context.setFontSize(21.3 * unit);
  5099 + context.fillText(delta2, 160 * unit, 806 * unit);
  5100 + context.setFillStyle("black");
  5101 + context.setFontSize(21.3 * unit);
  5102 + context.fillText("人全额退款", (170 + width_delta2) * unit, 806 * unit);
  5103 +
  5104 + // 并得帮团惊喜礼品
  5105 + context.setFillStyle("black")
  5106 + context.setFontSize(21.3 * unit)
  5107 + context.fillText("并得帮团", 40 * unit, 840 * unit);
  5108 + context.setFillStyle("#FF6768")
  5109 + context.setFontSize(21.3 * unit)
  5110 + context.fillText("惊喜礼品", 130 * unit, 840 * unit);
  5111 + context.setFillStyle("black")
  5112 + context.setFontSize(21.3 * unit)
  5113 + context.fillText("!", 220 * unit, 840 * unit);
  5114 +
  5115 +
  5116 + //---二维吗图---
  5117 + //-- 自定义海报 --
  5118 + if (th.data.poster) {
  5119 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  5120 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  5121 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  5122 + } else {
  5123 + //---二维吗图---
  5124 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  5125 + }
  5126 +
  5127 + break;
5126 5128
5127 5129
5128 } 5130 }
5129 5131
5130 5132
5131 //--- 如果是自定义海报的时候 --- 5133 //--- 如果是自定义海报的时候 ---
5132 - if(type != 0) {  
5133 -  
5134 - if (th.data.poster && parseInt(th.data.poster.style) == 2) {  
5135 -  
5136 - //如果显示会员信息的话  
5137 - if (parseInt(th.data.poster.show_headpic)) {  
5138 - //获取坐标  
5139 - var x = parseFloat(th.data.poster.head_x) * 2;  
5140 - var y = parseFloat(th.data.poster.head_y) * 2;  
5141 - //---绘制圆形要放在最后----  
5142 - context.save();  
5143 - context.beginPath();  
5144 - var h_x = x * unit;  
5145 - var h_y = y * unit;  
5146 - var h_r = 40 * unit;  
5147 - var cx = h_x + h_r;  
5148 - var cy = h_y + h_r;  
5149 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
5150 - context.closePath();  
5151 - context.fill();  
5152 - context.clip();  
5153 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
5154 - context.restore();  
5155 - }  
5156 -  
5157 - } else {  
5158 - //---绘制圆形要放在最后----  
5159 - context.save();  
5160 - context.beginPath();  
5161 - var h_x = 60 * unit;  
5162 - var h_y = 24 * unit;  
5163 - var h_r = 40 * unit;  
5164 - var cx = h_x + h_r;  
5165 - var cy = h_y + h_r;  
5166 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
5167 - context.closePath();  
5168 - context.fill();  
5169 - context.clip();  
5170 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
5171 - context.restore();  
5172 - }  
5173 -  
5174 - };  
5175 - 5134 + if (type != 0) {
  5135 +
  5136 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  5137 +
  5138 + //如果显示会员信息的话
  5139 + if (parseInt(th.data.poster.show_headpic)) {
  5140 + //获取坐标
  5141 + var x = parseFloat(th.data.poster.head_x) * 2;
  5142 + var y = parseFloat(th.data.poster.head_y) * 2;
  5143 + //---绘制圆形要放在最后----
  5144 + context.save();
  5145 + context.beginPath();
  5146 + var h_x = x * unit;
  5147 + var h_y = y * unit;
  5148 + var h_r = 40 * unit;
  5149 + var cx = h_x + h_r;
  5150 + var cy = h_y + h_r;
  5151 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  5152 + context.closePath();
  5153 + context.fill();
  5154 + context.clip();
  5155 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  5156 + context.restore();
  5157 + }
  5158 +
  5159 + } else {
  5160 + //---绘制圆形要放在最后----
  5161 + context.save();
  5162 + context.beginPath();
  5163 + var h_x = 60 * unit;
  5164 + var h_y = 24 * unit;
  5165 + var h_r = 40 * unit;
  5166 + var cx = h_x + h_r;
  5167 + var cy = h_y + h_r;
  5168 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  5169 + context.closePath();
  5170 + context.fill();
  5171 + context.clip();
  5172 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  5173 + context.restore();
  5174 + }
  5175 +
  5176 + };
  5177 +
5176 5178
5177 5179
5178 //把画板内容绘制成图片,并回调 画板图片路径 5180 //把画板内容绘制成图片,并回调 画板图片路径
@@ -5410,7 +5412,7 @@ Page({ @@ -5410,7 +5412,7 @@ Page({
5410 // } 5412 // }
5411 // }) 5413 // })
5412 }, 5414 },
5413 - 5415 +
5414 // 选择门店 5416 // 选择门店
5415 choice_store: function (ee) { 5417 choice_store: function (ee) {
5416 var th = this; 5418 var th = this;
@@ -5426,7 +5428,7 @@ Page({ @@ -5426,7 +5428,7 @@ Page({
5426 getApp().confirmBox("门店库存不足", null, 25000, !1); 5428 getApp().confirmBox("门店库存不足", null, 25000, !1);
5427 return false; 5429 return false;
5428 } 5430 }
5429 - 5431 +
5430 if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { 5432 if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
5431 getApp().confirmBox("门店库存不足", null, 25000, !1); 5433 getApp().confirmBox("门店库存不足", null, 25000, !1);
5432 return false; 5434 return false;
@@ -5486,7 +5488,7 @@ Page({ @@ -5486,7 +5488,7 @@ Page({
5486 }) 5488 })
5487 } 5489 }
5488 }, 5490 },
5489 - 5491 +
5490 //关闭选择门店 5492 //关闭选择门店
5491 close_popup: function (e) { 5493 close_popup: function (e) {
5492 var th = this; 5494 var th = this;
@@ -5538,7 +5540,7 @@ Page({ @@ -5538,7 +5540,7 @@ Page({
5538 sort_store: function () { 5540 sort_store: function () {
5539 5541
5540 }, 5542 },
5541 - 5543 +
5542 // 返回按钮 5544 // 返回按钮
5543 returns: function () { 5545 returns: function () {
5544 this.setData({ 5546 this.setData({
@@ -5546,7 +5548,7 @@ Page({ @@ -5546,7 +5548,7 @@ Page({
5546 choice_sort_store: 0 5548 choice_sort_store: 0
5547 }); 5549 });
5548 }, 5550 },
5549 - 5551 +
5550 //---选择分类门店--- 5552 //---选择分类门店---
5551 choice_sort_store: function (e) { 5553 choice_sort_store: function (e) {
5552 var index = e.currentTarget.dataset.index; 5554 var index = e.currentTarget.dataset.index;
@@ -5680,7 +5682,7 @@ Page({ @@ -5680,7 +5682,7 @@ Page({
5680 } 5682 }
5681 else { 5683 else {
5682 th.setData({ 5684 th.setData({
5683 - // openSpecModal_pt: 1, 5685 + // openSpecModal_pt: 1,
5684 store: 0, 5686 store: 0,
5685 choice_sort_store: 0, 5687 choice_sort_store: 0,
5686 sort_store: 0 5688 sort_store: 0
@@ -5690,7 +5692,7 @@ Page({ @@ -5690,7 +5692,7 @@ Page({
5690 th.get_off_price(); 5692 th.get_off_price();
5691 }) 5693 })
5692 }, 5694 },
5693 - 5695 +
5694 //---点击二级之后的选择--- 5696 //---点击二级之后的选择---
5695 choose_for_store: function (e) { 5697 choose_for_store: function (e) {
5696 var index_c = e.currentTarget.dataset.ind; 5698 var index_c = e.currentTarget.dataset.ind;
@@ -5701,7 +5703,7 @@ Page({ @@ -5701,7 +5703,7 @@ Page({
5701 }) 5703 })
5702 5704
5703 }, 5705 },
5704 - 5706 +
5705 //把选择的门店设置成默认的门店def_pick 5707 //把选择的门店设置成默认的门店def_pick
5706 set_def_pick: function (e) { 5708 set_def_pick: function (e) {
5707 var th = this; 5709 var th = this;
@@ -5901,11 +5903,11 @@ Page({ @@ -5901,11 +5903,11 @@ Page({
5901 go_plus: function () { 5903 go_plus: function () {
5902 getApp().goto("/pages/user/plus/plus"); 5904 getApp().goto("/pages/user/plus/plus");
5903 }, 5905 },
5904 - 5906 +
5905 go_card_info: function () { 5907 go_card_info: function () {
5906 getApp().goto("/pages/user/cardinfo/cardinfo"); 5908 getApp().goto("/pages/user/cardinfo/cardinfo");
5907 }, 5909 },
5908 - 5910 +
5909 //-- 根据ID拿出门店 -- 5911 //-- 根据ID拿出门店 --
5910 get_pick_from_list(pid) { 5912 get_pick_from_list(pid) {
5911 var all_pick_list = this.data.all_pick_list; 5913 var all_pick_list = this.data.all_pick_list;
@@ -6134,7 +6136,7 @@ Page({ @@ -6134,7 +6136,7 @@ Page({
6134 this.get_sto(0) 6136 this.get_sto(0)
6135 this.setData({ openSpecModal_inte: 1, goodsInputNum: 1 }); 6137 this.setData({ openSpecModal_inte: 1, goodsInputNum: 1 });
6136 }, 6138 },
6137 - 6139 +
6138 //-- 积分购普通购买 -- 6140 //-- 积分购普通购买 --
6139 go_pay_integral_normal: function () { 6141 go_pay_integral_normal: function () {
6140 var th = this; 6142 var th = this;
@@ -6259,227 +6261,236 @@ Page({ @@ -6259,227 +6261,236 @@ Page({
6259 // }) 6261 // })
6260 // }, 6262 // },
6261 6263
6262 - //获取更多秒杀  
6263 - // get_more_flahs: async function (func) {  
6264 - // var f_more=false;  
6265 - // var user_id=getApp().globalData.user_id;  
6266 - // if(!user_id) user_id=0;  
6267 -  
6268 - // var url="/api/weshop/goods/listSkuFlash?store_id="+os.stoid+"&goods_id="+this.data.data.goods_id+"&user_id="+user_id;  
6269 - // //获取秒杀的多规格  
6270 - // await getApp().request.promiseGet(url, {}).then(res=>{  
6271 - // if(res.data.code==0 && res.data.data && res.data.data.length>0){  
6272 - // f_more=res.data.data;  
6273 - // }  
6274 - // })  
6275 - // if(!f_more) {  
6276 - // func(false);  
6277 - // return false;  
6278 - // }  
6279 - // //-- 秒杀的价格要更新 --  
6280 - // for(let i in f_more){  
6281 -  
6282 - // let item=f_more[i];  
6283 - // f_more[i].prom_id=item.act_id;  
6284 - // f_more[i].prom_type=1;  
6285 - // if(item.goods_id==this.data.data.goods_id){  
6286 - // continue;  
6287 - // }  
6288 - // var url="/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+item.act_id;  
6289 - // await getApp().request.promiseGet(url, {}).then(rs=>{  
6290 - // if(rs.data.code==0){  
6291 - // f_more[i].price=rs.data.data.user_price; 6264 + //获取更多秒杀
  6265 + // get_more_flahs: async function (func) {
  6266 + // var f_more=false;
  6267 + // var user_id=getApp().globalData.user_id;
  6268 + // if(!user_id) user_id=0;
  6269 +
  6270 + // var url="/api/weshop/goods/listSkuFlash?store_id="+os.stoid+"&goods_id="+this.data.data.goods_id+"&user_id="+user_id;
  6271 + // //获取秒杀的多规格
  6272 + // await getApp().request.promiseGet(url, {}).then(res=>{
  6273 + // if(res.data.code==0 && res.data.data && res.data.data.length>0){
  6274 + // f_more=res.data.data;
  6275 + // }
  6276 + // })
  6277 + // if(!f_more) {
  6278 + // func(false);
  6279 + // return false;
  6280 + // }
  6281 + // //-- 秒杀的价格要更新 --
  6282 + // for(let i in f_more){
  6283 +
  6284 + // let item=f_more[i];
  6285 + // f_more[i].prom_id=item.act_id;
  6286 + // f_more[i].prom_type=1;
  6287 + // if(item.goods_id==this.data.data.goods_id){
  6288 + // continue;
  6289 + // }
  6290 + // var url="/api/ms/flash_sale/getNew/"+os.stoid+"/"+user_id+"/"+item.act_id;
  6291 + // await getApp().request.promiseGet(url, {}).then(rs=>{
  6292 + // if(rs.data.code==0){
  6293 + // f_more[i].price=rs.data.data.user_price;
  6294 +
  6295 + // }
  6296 + // })
  6297 + // }
  6298 + // func(f_more);
6292 6299
6293 - // }  
6294 - // }) 6300 + // },
  6301 +
  6302 + //-- 判断是否有秒杀 -- ccc
  6303 + check_has_flash: function () {
  6304 + // var th=this;
  6305 + // var url="/api/weshop/activitylist/getGoodActInfo";
  6306 + // var req_data={
  6307 + // store_id:os.stoid,goodsidlist:this.data.data.goods_id,is_detail:1
  6308 + // };
  6309 + // //获取秒杀的多规格
  6310 + // getApp().request.promiseGet(url, {data:req_data}).then(res=>{
  6311 + // if(res.data.code==0 && res.data.data && res.data.data.length){
  6312 + // th.setData({more_flash:res.data.data});
6295 // } 6313 // }
6296 - // func(f_more);  
6297 -  
6298 - // },  
6299 -  
6300 - //-- 判断是否有秒杀 -- ccc  
6301 - check_has_flash:function () {  
6302 - // var th=this;  
6303 - // var url="/api/weshop/activitylist/getGoodActInfo";  
6304 - // var req_data={  
6305 - // store_id:os.stoid,goodsidlist:this.data.data.goods_id,is_detail:1  
6306 - // };  
6307 - // //获取秒杀的多规格  
6308 - // getApp().request.promiseGet(url, {data:req_data}).then(res=>{  
6309 - // if(res.data.code==0 && res.data.data && res.data.data.length){  
6310 - // th.setData({more_flash:res.data.data});  
6311 - // }  
6312 - // })  
6313 - }, 6314 + // })
  6315 + },
6314 6316
6315 - //-- 跳转到秒杀商品详情页 -- ccc  
6316 - go_more_flash:function (e) {  
6317 - // var prom_id=e.currentTarget.dataset.id;  
6318 - // var goods_id=this.data.data.goods_id;  
6319 - // var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+goods_id+"&prom_id="+prom_id+"&prom_type=1";  
6320 - // getApp().goto(url);  
6321 - }, 6317 + //-- 跳转到秒杀商品详情页 -- ccc
  6318 + go_more_flash: function (e) {
  6319 + // var prom_id=e.currentTarget.dataset.id;
  6320 + // var goods_id=this.data.data.goods_id;
  6321 + // var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+goods_id+"&prom_id="+prom_id+"&prom_type=1";
  6322 + // getApp().goto(url);
  6323 + },
6322 6324
6323 - close_pop_more:function () {  
6324 - this.setData({is_pop_more:0})  
6325 - }, 6325 + close_pop_more: function () {
  6326 + this.setData({ is_pop_more: 0 })
  6327 + },
  6328 +
  6329 + con_weixin: function () {
  6330 + var url = this.data.sys_switch.weapp_customertype_url;
  6331 + var id = this.data.sys_switch.weapp_customertype_appid;
  6332 + wx.openCustomerServiceChat({
  6333 + extInfo: { url: url },
  6334 + corpId: id,
  6335 + success(res) { }
  6336 + })
  6337 + },
  6338 +
  6339 +
  6340 + // 显示幸运购规则
  6341 + showRules: function () {
  6342 + this.setData({
  6343 + showRules: true,
  6344 + });
  6345 + },
  6346 +
  6347 + // 关闭幸运购规则
  6348 + closeRules: function () {
  6349 + this.setData({
  6350 + showRules: false,
  6351 + });
  6352 + },
  6353 +
  6354 + // 跳转
  6355 + go: function (e) {
  6356 + var url = e.currentTarget.dataset.url;
  6357 + getApp().goto(url);
  6358 + },
  6359 +
  6360 + // 查看奖励
  6361 + showReward: function () {
  6362 +
  6363 + this.getPrizes(this.data.luckGoInfo.type);
  6364 +
  6365 + },
  6366 +
  6367 + // 关闭奖励
  6368 + closeReward: function () {
  6369 + this.setData({
  6370 + showReward: false,
  6371 + });
  6372 + },
  6373 +
  6374 +
  6375 + // 获取优惠券奖励和服务项目奖励
  6376 + getPrizes: function (type) {
  6377 + // let currentItem = this.data.list.pageData[currentItemIndex];
  6378 + // let type = type;
  6379 + let self = this;
  6380 + let app = getApp();
  6381 + // 分割type字符串
  6382 + let typeArr = this.splitStringToArr(type);
  6383 + let prizesArr = [];
  6384 + let promiseArr = [];
  6385 + typeArr.forEach(function (item) {
  6386 +
  6387 + let obj = {};
  6388 + obj.type = item;
  6389 +
  6390 + let promise = new Promise((resolve, reject) => {
  6391 + switch (item) {
  6392 + case 1: { //积分
  6393 + obj.name = '积分';
  6394 + obj.num = 'point';
  6395 + prizesArr.push(obj);
  6396 + resolve();
  6397 + break;
  6398 + };
  6399 + case 2: { //成长值
  6400 + obj.name = '成长值';
  6401 + obj.num = 'grow';
  6402 + prizesArr.push(obj);
  6403 + resolve();
  6404 + break;
  6405 + };
  6406 + case 3: { //优惠券
  6407 + app.request.promiseGet('/api/weshop/prom/luckyCoupon/page', {
  6408 + data: {
  6409 + store_id: os.stoid,
  6410 + aid: self.data.luckGoInfo.id,
  6411 + }
  6412 + }).then(res => {
  6413 + if (res.data.code == 0) {
  6414 + obj.couponList = res.data.data.pageData;
  6415 + prizesArr.push(obj);
  6416 + resolve();
  6417 + };
  6418 + });
  6419 + break;
  6420 + };
  6421 + case 4: { //服务项目
  6422 + app.request.promiseGet('/api/weshop/prom/luckyService/page', {
  6423 + data: {
  6424 + store_id: os.stoid,
  6425 + aid: self.data.luckGoInfo.id,
  6426 + }
  6427 + }).then(res => {
  6428 + if (res.data.code == 0) {
  6429 + obj.serviceList = res.data.data.pageData;
  6430 + prizesArr.push(obj);
  6431 + resolve();
  6432 + };
  6433 + });
  6434 + break;
  6435 + };
  6436 + case 5: { //预存金额
  6437 + obj.name = 'prestore_name';
  6438 + obj.num = 'prestore_money';
  6439 + prizesArr.push(obj);
  6440 + resolve();
  6441 + break;
  6442 + };
  6443 + };
  6444 + });
  6445 +
  6446 + promiseArr.push(promise);
  6447 +
  6448 +
  6449 + Promise.all(promiseArr).then(() => {
  6450 + self.setData({
  6451 + prizesArr,
  6452 + showReward: true,
  6453 + });
  6454 + });
  6455 +
  6456 +
  6457 +
  6458 + });
  6459 +
  6460 +
  6461 +
  6462 + },
  6463 +
  6464 + // 将type字符串分割成数组
  6465 + splitStringToArr: function (typeStr) {
  6466 + var index;
  6467 + var newTypeArr = [];
  6468 + var typeStrArr = typeStr.split(',');
  6469 + typeStrArr.forEach(function (item) {
  6470 + index = parseInt(item);
  6471 + newTypeArr.push(index);
  6472 + });
  6473 + // console.log('newTypeArr', newTypeArr);
  6474 + return newTypeArr;
  6475 + },
  6476 +
  6477 +
  6478 + //弹出活动已经结束
  6479 + timeUp() {
  6480 + wx.showToast({
  6481 + title: '本商品活动已经结束!',
  6482 + icon: 'none',
  6483 + });
  6484 + },
  6485 +
  6486 +
  6487 + // 预览海报
  6488 + previewPoster() {
  6489 + wx.previewImage({
  6490 + current: this.data.shareImgPath, // 当前显示图片的http链接
  6491 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
  6492 + });
  6493 + },
6326 6494
6327 - con_weixin:function () {  
6328 - var url=this.data.sys_switch.weapp_customertype_url;  
6329 - var id=this.data.sys_switch.weapp_customertype_appid;  
6330 - wx.openCustomerServiceChat({  
6331 - extInfo: {url: url},  
6332 - corpId: id,  
6333 - success(res) {}  
6334 - })  
6335 - },  
6336 -  
6337 -  
6338 - // 显示幸运购规则  
6339 - showRules: function() {  
6340 - this.setData({  
6341 - showRules: true,  
6342 - });  
6343 - },  
6344 -  
6345 - // 关闭幸运购规则  
6346 - closeRules: function() {  
6347 - this.setData({  
6348 - showRules: false,  
6349 - });  
6350 - },  
6351 -  
6352 - // 跳转  
6353 - go: function (e) {  
6354 - var url = e.currentTarget.dataset.url;  
6355 - getApp().goto(url);  
6356 - },  
6357 -  
6358 - // 查看奖励  
6359 - showReward: function() {  
6360 -  
6361 - this.getPrizes(this.data.luckGoInfo.type);  
6362 -  
6363 - },  
6364 -  
6365 - // 关闭奖励  
6366 - closeReward: function() {  
6367 - this.setData({  
6368 - showReward: false,  
6369 - });  
6370 - },  
6371 -  
6372 -  
6373 - // 获取优惠券奖励和服务项目奖励  
6374 - getPrizes: function(type) {  
6375 - // let currentItem = this.data.list.pageData[currentItemIndex];  
6376 - // let type = type;  
6377 - let self = this;  
6378 - let app = getApp();  
6379 - // 分割type字符串  
6380 - let typeArr = this.splitStringToArr(type);  
6381 - let prizesArr = [];  
6382 - let promiseArr = [];  
6383 - typeArr.forEach(function(item) {  
6384 -  
6385 - let obj = {};  
6386 - obj.type = item;  
6387 -  
6388 - let promise = new Promise((resolve, reject) => {  
6389 - switch(item) {  
6390 - case 1: { //积分  
6391 - obj.name = '积分';  
6392 - obj.num = 'point';  
6393 - prizesArr.push(obj);  
6394 - resolve();  
6395 - break;  
6396 - };  
6397 - case 2: { //成长值  
6398 - obj.name = '成长值';  
6399 - obj.num = 'grow';  
6400 - prizesArr.push(obj);  
6401 - resolve();  
6402 - break;  
6403 - };  
6404 - case 3: { //优惠券  
6405 - app.request.promiseGet('/api/weshop/prom/luckyCoupon/page', {  
6406 - data: {  
6407 - store_id: os.stoid,  
6408 - aid: self.data.luckGoInfo.id,  
6409 - }  
6410 - }).then(res => {  
6411 - if(res.data.code == 0) {  
6412 - obj.couponList = res.data.data.pageData;  
6413 - prizesArr.push(obj);  
6414 - resolve();  
6415 - };  
6416 - });  
6417 - break;  
6418 - };  
6419 - case 4: { //服务项目  
6420 - app.request.promiseGet('/api/weshop/prom/luckyService/page', {  
6421 - data: {  
6422 - store_id: os.stoid,  
6423 - aid: self.data.luckGoInfo.id,  
6424 - }  
6425 - }).then(res => {  
6426 - if(res.data.code == 0) {  
6427 - obj.serviceList = res.data.data.pageData;  
6428 - prizesArr.push(obj);  
6429 - resolve();  
6430 - };  
6431 - });  
6432 - break;  
6433 - };  
6434 - case 5: { //预存金额  
6435 - obj.name = 'prestore_name';  
6436 - obj.num = 'prestore_money';  
6437 - prizesArr.push(obj);  
6438 - resolve();  
6439 - break;  
6440 - };  
6441 - };  
6442 - });  
6443 -  
6444 - promiseArr.push(promise);  
6445 -  
6446 -  
6447 - Promise.all(promiseArr).then(()=> {  
6448 - self.setData({  
6449 - prizesArr,  
6450 - showReward: true,  
6451 - });  
6452 - });  
6453 -  
6454 -  
6455 -  
6456 - });  
6457 -  
6458 -  
6459 -  
6460 - },  
6461 -  
6462 - // 将type字符串分割成数组  
6463 - splitStringToArr: function(typeStr) {  
6464 - var index;  
6465 - var newTypeArr = [];  
6466 - var typeStrArr = typeStr.split(',');  
6467 - typeStrArr.forEach(function(item) {  
6468 - index = parseInt(item);  
6469 - newTypeArr.push(index);  
6470 - });  
6471 - // console.log('newTypeArr', newTypeArr);  
6472 - return newTypeArr;  
6473 - },  
6474 -  
6475 -  
6476 - //弹出活动已经结束  
6477 - timeUp() {  
6478 - wx.showToast({  
6479 - title: '本商品活动已经结束!',  
6480 - icon: 'none',  
6481 - });  
6482 - },  
6483 -  
6484 6495
6485 }); 6496 });
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -200,7 +200,7 @@ @@ -200,7 +200,7 @@
200 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> 200 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
201 <view class="xc-share-frame t-c" bindtap="{{isTimeUp ? 'timeUp':'clickShare'}}"> 201 <view class="xc-share-frame t-c" bindtap="{{isTimeUp ? 'timeUp':'clickShare'}}">
202 <view class="iconfont icon-share"></view> 202 <view class="iconfont icon-share"></view>
203 - <!-- <view class="fs22 c-7b">分享</view> --> 203 + <view class="fs22 c-7b">分享</view>
204 </view> 204 </view>
205 </view> 205 </view>
206 <!-- 不是秒杀 --> 206 <!-- 不是秒杀 -->
@@ -1515,7 +1515,7 @@ @@ -1515,7 +1515,7 @@
1515 <view class="mask" catchtap="closePoster"></view> 1515 <view class="mask" catchtap="closePoster"></view>
1516 <view class="poster-container"> 1516 <view class="poster-container">
1517 <view class="poster-wrapper"> 1517 <view class="poster-wrapper">
1518 - <view class="poster"> 1518 + <view class="poster" bindtap="previewPoster">
1519 <!-- <view class="poster" bindtap="previewImage"> --> 1519 <!-- <view class="poster" bindtap="previewImage"> -->
1520 <image src="{{shareImgPath}}" class="poster-img"></image> 1520 <image src="{{shareImgPath}}" class="poster-img"></image>
1521 <view class="btn-close" catchtap="closePoster"> 1521 <view class="btn-close" catchtap="closePoster">
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss
@@ -1624,7 +1624,7 @@ left:31rpx;} @@ -1624,7 +1624,7 @@ left:31rpx;}
1624 1624
1625 /* 分享 */ 1625 /* 分享 */
1626 .icon-share { 1626 .icon-share {
1627 - font-size: 46rpx; 1627 + font-size: 42rpx;
1628 color: #d60021; 1628 color: #d60021;
1629 line-height: 1; 1629 line-height: 1;
1630 } 1630 }
packageC/pages/presell/cart/cart2_pre.js
@@ -233,7 +233,7 @@ Page({ @@ -233,7 +233,7 @@ Page({
233 th.setData({ user_addr: ie }); 233 th.setData({ user_addr: ie });
234 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { 234 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
235 th.setData({ add_back: 1 }); 235 th.setData({ add_back: 1 });
236 - if (this.data.bn_goods) th.calculatePrice2(); 236 + if (th.data.bn_goods) th.calculatePrice2();
237 } 237 }
238 }) 238 })
239 //--更新默认地址--,看一下是不是跳到地址页面 239 //--更新默认地址--,看一下是不是跳到地址页面
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -4019,6 +4019,14 @@ Page({ @@ -4019,6 +4019,14 @@ Page({
4019 corpId: id, 4019 corpId: id,
4020 success(res) {} 4020 success(res) {}
4021 }) 4021 })
4022 - } 4022 + },
  4023 +
  4024 + // 预览海报
  4025 + previewPoster() {
  4026 + wx.previewImage({
  4027 + current: this.data.shareImgPath, // 当前显示图片的http链接
  4028 + urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
  4029 + });
  4030 + },
4023 4031
4024 }); 4032 });
packageC/pages/presell/goodsInfo/goodsInfo.wxml
@@ -121,7 +121,7 @@ @@ -121,7 +121,7 @@
121 </view> 121 </view>
122 <!-- 这个是分享按钮 --> 122 <!-- 这个是分享按钮 -->
123 <view class="xc-share-frame t-c" bindtap="clickShare"> 123 <view class="xc-share-frame t-c" bindtap="clickShare">
124 - <view class="iconfont icon-share fs60"></view> 124 + <view class="iconfont icon-share"></view>
125 <view class="fs22 c-7b">分享</view> 125 <view class="fs22 c-7b">分享</view>
126 </view> 126 </view>
127 </view> 127 </view>
@@ -527,7 +527,7 @@ @@ -527,7 +527,7 @@
527 <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view> 527 <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view>
528 <!-- <view class="">08.30 23:59:59 开始发货</view> --> 528 <!-- <view class="">08.30 23:59:59 开始发货</view> -->
529 <view class="" wx:if="{{presellForm.delivery_type==1}}">{{filters.format_time(presellForm.delivery_date,2)}} 开始发货</view> 529 <view class="" wx:if="{{presellForm.delivery_type==1}}">{{filters.format_time(presellForm.delivery_date,2)}} 开始发货</view>
530 - <view class="" wx:else>付款{{presellForm.delivery_daynum}} 天发货</view> 530 + <view class="" wx:else>付款{{presellForm.delivery_daynum}} 天发货</view>
531 </view> 531 </view>
532 532
533 <view class="line" bindtap="openSpecModel" data-ind="2" style="margin-left: 10rpx; padding-left: 10rpx"> 533 <view class="line" bindtap="openSpecModel" data-ind="2" style="margin-left: 10rpx; padding-left: 10rpx">
@@ -937,7 +937,7 @@ @@ -937,7 +937,7 @@
937 <view class="mask" catchtap="closePoster"></view> 937 <view class="mask" catchtap="closePoster"></view>
938 <view class="poster-container"> 938 <view class="poster-container">
939 <view class="poster-wrapper"> 939 <view class="poster-wrapper">
940 - <view class="poster"> 940 + <view class="poster" bindtap="previewPoster">
941 <!-- <view class="poster" bindtap="previewImage"> --> 941 <!-- <view class="poster" bindtap="previewImage"> -->
942 <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image> 942 <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
943 <view class="btn-close" catchtap="closePoster"> 943 <view class="btn-close" catchtap="closePoster">
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/ai_config/config.js 0 → 100644
  1 +/*
  2 + * @Author: your name
  3 + * @Date: 2022-02-26 09:44:36
  4 + * @LastEditTime: 2022-02-26 09:48:10
  5 + * @LastEditors: your name
  6 + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7 + * @FilePath: \MShopWeApp\utils\ai_config\config.js
  8 + */
  9 +let pluginGD = {
  10 + app_id: 'f1WwFd7W1lduYRQaUpDVdvi3w9infpUwe1o',
  11 + app_secret: 'ICYb2dw1QDCguPuArQKi4EegwKfyFzDbdh',
  12 + plugin_name: 'mtSkinSdk',
  13 + redirect_url: '/packageD/pages/AI-test-skin/index/aiskin',
  14 + share_qrcode: 'https://titan-h5.meitu.com/webar/eve/mini_skin_sdk/demo/mini_qrcode.jpg',
  15 + wx_api: {
  16 + getFileSystemManager: wx.getFileSystemManager,
  17 + },
  18 +};
  19 +export {
  20 + pluginGD,
  21 +};
packageD/pages/AI-test-skin/analyse/analyse.js
@@ -4,6 +4,14 @@ const request = app.request; @@ -4,6 +4,14 @@ 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'
  8 +// ,
  9 +// "plugins": {
  10 +// "mtSkinSdk": {
  11 +// "version": "1.4.2",
  12 +// "provider": "wx3636b350f8484f20"
  13 +// }
  14 +// }
7 Page({ 15 Page({
8 16
9 /** 17 /**
@@ -11,171 +19,173 @@ Page({ @@ -11,171 +19,173 @@ Page({
11 */ 19 */
12 data: { 20 data: {
13 iurl: setting.imghost, 21 iurl: setting.imghost,
14 - per:0,  
15 - timer:0,  
16 - img:null,  
17 - sourceimg:null,  
18 - err_map:null, 22 + per: 0,
  23 + timer: 0,
  24 + img: null,
  25 + sourceimg: null,
  26 + err_map: null,
  27 + skin_type: 0,
19 }, 28 },
20 29
21 /** 30 /**
22 * 生命周期函数--监听页面加载 31 * 生命周期函数--监听页面加载
23 */ 32 */
24 onLoad: function (options) { 33 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) 34 + if(this.data.skin_type){
  35 + var plugin = requirePlugin('mtSkinSdk')
  36 + plugin.setConfig(pluginGD)
  37 + }
  38 + var th = this;
  39 + //设置错误码分析
  40 + this.set_err_map();
  41 + //进度条加载
  42 + this.timer();
  43 + //接口开始分析
  44 + setTimeout(function () {
  45 + //先检验一下图片
  46 + th.data.skin_type ? th.img_check_mt() : th.img_check_bd();
  47 + }, 800)
38 48
39 }, 49 },
40 //定时器 50 //定时器
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 - } 51 + timer: function (func) {
  52 + var per = this.data.per + 5;
  53 + var th = this;
  54 + if (per < 96) {
  55 + th.setData({ per: per });
  56 + setTimeout(function () {
  57 + th.timer();
  58 + }, 400)
  59 + }
50 }, 60 },
51 61
52 //错误码表 62 //错误码表
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}); 63 + set_err_map: function () {
  64 + var map = {
  65 + "2": "服务暂不可用",
  66 + "4": "集群超限额",
  67 + "6": "没有接口权限",
  68 + "17": "每天流量超限额",
  69 + "18": "QPS超限额",
  70 + "19": "请求总量超限额",
  71 + "100": "无效的access_token参数",
  72 + "110": "Access Token失效",
  73 + "111": " Access token过期",
  74 + "222001": "必要参数未传入",
  75 + "222002": "参数格式错误",
  76 + "222003": "参数格式错误",
  77 + "222004": "参数格式错误",
  78 + "222005": "参数格式错误",
  79 + "222006": "参数格式错误",
  80 + "222007": "参数格式错误",
  81 + "222008": "参数格式错误",
  82 + "222009": "参数格式错误",
  83 + "222010": "参数格式错误",
  84 + "222011": "参数格式错误",
  85 + "222012": "参数格式错误",
  86 + "222013": "参数格式错误",
  87 + "222014": "参数格式错误",
  88 + "222015": "参数格式错误",
  89 + "222016": "参数格式错误",
  90 + "222017": "参数格式错误",
  91 + "222018": "参数格式错误",
  92 + "222019": "参数格式错误",
  93 + "222020": "参数格式错误",
  94 + "222021": "参数格式错误",
  95 + "222022": "身份证号不符合要求,备注:中国大陆身份证号的每一位数字都有其生成规则,不可随意填写。",
  96 + "222023": "参数格式错误",
  97 + "222024": "参数格式错误",
  98 + "222025": "参数格式错误",
  99 + "222026": "参数格式错误",
  100 + "222027": "验证码长度错误(最小值大于最大值)",
  101 + "222028": "参数格式错误",
  102 + "222029": "参数格式错误",
  103 + "222030": "参数格式错误",
  104 + "222039": "参数格式错误",
  105 + "222200": "该接口需使用application/json的格式进行请求",
  106 + "222201": "服务端请求失败",
  107 + "222202": "未识别到单个人脸",//未识别到单个人脸
  108 + "222203": "无法解析人脸",
  109 + "222204": "从图片的url下载图片失败",
  110 + "222205": "服务端请求失败",
  111 + "222206": "服务端请求失败",
  112 + "222207": "未找到匹配的用户",
  113 + "222208": "图片的数量错误",
  114 + "222209": "face token不存在",
  115 + "222210": "人脸库中用户下的人脸数目超过限制",
  116 + "222300": "人脸图片添加失败",
  117 + "222301": "获取人脸图片失败",
  118 + "222302": "服务端请求失败",
  119 + "222303": "获取人脸图片失败",
  120 + "222152": "人脸属性编辑,target参数错误",
  121 + "222514": "人脸属性编辑v2调用服务失败,请重试",
  122 + "223100": "操作的用户组不存在",
  123 + "223101": "该用户组已存在",
  124 + "223102": "找不到该用户",
  125 + "223103": "找不到该用户",
  126 + "223104": "group_list包含组数量过多",
  127 + "223105": "该人脸已存在",
  128 + "223106": "该人脸不存在",
  129 + "223107": "人脸库中人脸复制时源组与目标组的scene_type不同",
  130 + "223110": "uid_list包含数量过多",
  131 + "223111": "目标用户组不存在",
  132 + "223112": "quality_conf格式不正确",
  133 + "223113": "人脸有被遮挡",
  134 + "223114": "人脸模糊",
  135 + "223115": "人脸光照不好",
  136 + "223116": "人脸不完整",
  137 + "223117": "app_list包含app数量过多",
  138 + "223118": "质量控制项错误",
  139 + "223119": "活体控制项错误",
  140 + "223120": "活体检测未通过",
  141 + "223121": "质量检测未通过 左眼遮挡程度过高",
  142 + "223122": "质量检测未通过 右眼遮挡程度过高",
  143 + "223123": "质量检测未通过 左脸遮挡程度过高",
  144 + "223124": "质量检测未通过 右脸遮挡程度过高",
  145 + "223125": "质量检测未通过 下巴遮挡程度过高",
  146 + "223126": "质量检测未通过 鼻子遮挡程度过高",
  147 + "223127": "质量检测未通过 嘴巴遮挡程度过高",
  148 + "222901": "参数校验初始化失败",
  149 + "222902": "参数校验初始化失败",
  150 + "222903": "参数校验初始化失败",
  151 + "222904": "参数校验初始化失败",
  152 + "222905": "接口初始化失败",
  153 + "222906": "接口初始化失败",
  154 + "222907": "缓存处理失败",
  155 + "222908": "缓存处理失败",
  156 + "222909": "缓存处理失败",
  157 + "222910": "数据存储处理失败",
  158 + "222911": "数据存储处理失败",
  159 + "222912": "数据存储处理失败",
  160 + "222913": "接口初始化失败",
  161 + "222914": "接口初始化失败",
  162 + "222915": "后端服务连接失败",
  163 + "222916": "后端服务连接失败",
  164 + "222304": "图片尺寸太大",
  165 + "222305": "当前版本不支持图片存储",
  166 + "223128": "正在清理该用户组的数据",
  167 + "223136": "该组内存在关联图片,无法新建相同名称组",
  168 + "222361": "公安服务连接失败",
  169 + "222046": "参数格式错误",
  170 + "222101": "参数格式错误",
  171 + "222102": "参数格式错误",
  172 + "222307": "图片非法 鉴黄未通过",
  173 + "222308": "图片非法 含有政治敏感人物",
  174 + "222211": "人脸融合失败 模板图质量不合格",
  175 + "222212": "人脸融合失败",
  176 + "223129": "人脸未面向正前方(人脸的角度信息大于30度)",
  177 + "223130": "spoofing_control参数格式错误",
  178 + "223131": "合成图检测未通过",
  179 + "223201": "请求参数scene_type 格式错误",
  180 + "223202": "识别时请求的scene_type与group设置的scene_type不匹配",
  181 + }
  182 + this.setData({ err_map: map });
173 }, 183 },
174 184
175 /** 185 /**
176 * 生命周期函数--监听页面显示 186 * 生命周期函数--监听页面显示
177 */ 187 */
178 - onShow: function (){ }, 188 + onShow: function () { },
179 189
180 /** 190 /**
181 * 生命周期函数--监听页面隐藏 191 * 生命周期函数--监听页面隐藏
@@ -199,163 +209,367 @@ Page({ @@ -199,163 +209,367 @@ Page({
199 209
200 }, 210 },
201 211
202 - //检查图片有没有OK  
203 - img_check:function (func) {  
204 - var th=this;  
205 - var data={ 212 + //检查图片有没有OK 百度
  213 + img_check_bd: function (func) {
  214 + var th = this;
  215 + var data = {
206 "appid": "25521854", 216 "appid": "25521854",
207 "image": getApp().globalData.face_SourceImg, 217 "image": getApp().globalData.face_SourceImg,
208 "face_field": "age,expression,face_shape,gender,glasses,landmark,landmark150,quality,eye_status,emotion,face_type,mask,spoofing", 218 "face_field": "age,expression,face_shape,gender,glasses,landmark,landmark150,quality,eye_status,emotion,face_type,mask,spoofing",
209 - "image_type": "URL" 219 + "image_type": "URL",
  220 + "store_id":setting.stoid
210 } 221 }
211 - //开始调用接口,进行对图片进行判断是否符合标准  
212 - this.json_post("/api/weshop/baidubce/face/skindetect",data,function (res) {  
213 - if(res.data.code==0){ 222 + //开始调用百度接口,进行对图片进行判断是否符合标准
  223 + this.json_post("/api/weshop/baidubce/face/skindetect", data, function (res) {
  224 + if (res.data.code == 0) {
214 //检查的字段存储 225 //检查的字段存储
215 - var check_data=th.data.check_data=res.data.data;  
216 - check_data=check_data.face_list[0]; 226 +
  227 + var check_data = th.data.check_data = res.data.data;
  228 + check_data = check_data.face_list[0];
  229 + if(!check_data) {
  230 + getApp().showWarning('网络繁忙,请稍后再试');
  231 + return false;
  232 + }
  233 + let fail_result = new Array();
  234 +
217 console.log(check_data); 235 console.log(check_data);
218 //检查睁眼闭眼 236 //检查睁眼闭眼
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="未闭眼拍照";  
222 - th.go_error(msg);  
223 - return false; 237 + var eye_status = check_data.eye_status;
  238 + console.log('eye_status',eye_status);
  239 + if (eye_status.left_eye > 0.5 || eye_status.right_eye > 0.5) {
  240 + // var msg = "未闭眼拍照";
  241 + // th.go_error(msg);
  242 + // return false;
  243 + fail_result.push({
  244 + type: 1,
  245 + reason: "未闭眼拍摄"
  246 + })
224 } 247 }
225 //检查是不是有带眼镜 248 //检查是不是有带眼镜
226 - if(check_data.glasses.type!='none'){  
227 - var msg="有佩戴眼镜";  
228 - th.go_error(msg);  
229 - return false;  
230 - }  
231 - //检查头部的角度  
232 - var angle=check_data.angle;  
233 - if(Math.abs(angle.Pitch)>20) {  
234 - var msg="头部的俯仰角度过大";  
235 - th.go_error(msg);  
236 - return false; 249 + if (check_data.glasses.type != 'none') {
  250 + // var msg = "有佩戴眼镜";
  251 + // th.go_error(msg);
  252 + // return false;
  253 + fail_result.push({
  254 + type: 2,
  255 + reason: "未摘下眼镜拍摄"
  256 + })
237 } 257 }
238 - if(Math.abs(angle.Roll)>20) {  
239 - var msg="头部的平面角度过大";  
240 - th.go_error(msg);  
241 - return false;  
242 - }  
243 - if(Math.abs(angle.Yaw)>20) {  
244 - var msg="头部的左右角度过大";  
245 - th.go_error(msg);  
246 - return false; 258 + var quality = check_data.quality;
  259 + //检查框里人脸情况
  260 + if (quality.completeness = 0) {
  261 + // var msg = "人脸未显示完整";
  262 + // th.go_error(msg);
  263 + // return false;
  264 + fail_result.push({
  265 + type: 3,
  266 + reason: "未识别到单个人脸"
  267 + })
247 } 268 }
248 - var quality=check_data.quality;  
249 - if(quality.blur>0.7){  
250 - var msg="图片模糊";  
251 - th.go_error(msg);  
252 - return false; 269 + //检查环境情况
  270 + if (quality.blur > 0.7 || quality.illumination < 40) {
  271 + // var msg = "图片模糊";
  272 + // th.go_error(msg);
  273 + // return false;
  274 + fail_result.push({
  275 + type: 4,
  276 + reason: "质量检测未通过"
  277 + })
253 } 278 }
  279 +
  280 + // if (Math.abs(angle.Roll) > 20) {
  281 + // var msg = "头部的平面角度过大";
  282 + // th.go_error(msg);
  283 + // return false;
  284 + // }
  285 + // if (Math.abs(angle.Yaw) > 20) {
  286 + // var msg = "头部的左右角度过大";
  287 + // th.go_error(msg);
  288 + // return false;
  289 + // }
  290 +
254 //开始检查遮挡 291 //开始检查遮挡
255 - var occlusion=check_data.quality.occlusion;  
256 - if(occlusion.left_eye >0.6){  
257 - var msg="左眼被遮挡";  
258 - th.go_error(msg);  
259 - return false; 292 + var zhe_dnag = 0;
  293 + var occlusion = check_data.quality.occlusion;
  294 + if (occlusion.left_eye > 0.6) {
  295 + // var msg = "左眼被遮挡";
  296 + // th.go_error(msg);
  297 + // return false;
  298 + zhe_dnag = 1;
260 } 299 }
261 - if(occlusion.right_eye>0.6){  
262 - var msg="右眼被遮挡";  
263 - th.go_error(msg);  
264 - return false; 300 + if (occlusion.right_eye > 0.6) {
  301 + // var msg = "右眼被遮挡";
  302 + // th.go_error(msg);
  303 + // return false;
  304 + zhe_dnag = 1;
265 } 305 }
266 - if(occlusion.nose>0.7){  
267 - var msg="鼻子被遮挡";  
268 - th.go_error(msg);  
269 - return false; 306 + if (occlusion.nose > 0.7) {
  307 + // var msg = "鼻子被遮挡";
  308 + // th.go_error(msg);
  309 + // return false;
  310 + zhe_dnag = 1;
270 } 311 }
271 - if(occlusion.mouth>0.7){  
272 - var msg="嘴巴被遮挡";  
273 - th.go_error(msg);  
274 - return false; 312 + if (occlusion.mouth > 0.7) {
  313 + // var msg = "嘴巴被遮挡";
  314 + // th.go_error(msg);
  315 + // return false;
  316 + zhe_dnag = 1;
275 } 317 }
276 - if(occlusion.left_cheek >0.8){  
277 - var msg="左脸颊被遮挡";  
278 - th.go_error(msg);  
279 - return false; 318 + if (occlusion.left_cheek > 0.8) {
  319 + // var msg = "左脸颊被遮挡";
  320 + // th.go_error(msg);
  321 + // return false;
  322 + zhe_dnag = 1;
280 } 323 }
281 - if(occlusion.right_cheek >0.8){  
282 - var msg="右脸颊被遮挡";  
283 - th.go_error(msg);  
284 - return false; 324 + if (occlusion.right_cheek > 0.8) {
  325 + // var msg = "右脸颊被遮挡";
  326 + // th.go_error(msg);
  327 + // return false;
  328 + zhe_dnag = 1;
285 } 329 }
286 - if(occlusion.chin_contour >0.6){  
287 - var msg="下巴颊被遮挡";  
288 - th.go_error(msg);  
289 - return false; 330 + if (occlusion.chin_contour > 0.6) {
  331 + // var msg = "下巴颊被遮挡";
  332 + // th.go_error(msg);
  333 + // return false;
  334 + zhe_dnag = 1;
290 } 335 }
291 - if(quality.illumination<40){  
292 - var msg="图像光照不足";  
293 - th.go_error(msg);  
294 - return false; 336 + if (zhe_dnag) {
  337 + fail_result.push({
  338 + type: 7,
  339 + reason: "脸部有遮挡物"
  340 + })
  341 + }
  342 + //检查头部的角度
  343 + var angle = check_data.angle;
  344 + if (Math.abs(angle.Pitch) > 20 || Math.abs(angle.Roll) > 20 || Math.abs(angle.Yaw) > 20) {
  345 + // var msg = "头部的俯仰角度过大";
  346 + // th.go_error(msg);
  347 + // return false;
  348 + fail_result.push({
  349 + type: 8,
  350 + reason: "未保持正脸拍摄"
  351 + })
295 } 352 }
296 - if(quality.completeness=0){  
297 - var msg="人脸未显示完整";  
298 - th.go_error(msg); 353 + // if (quality.illumination < 40) {
  354 + // var msg = "图像光照不足";
  355 + // th.go_error(msg);
  356 + // return false;
  357 + // }
  358 + if (fail_result.length > 0) {
  359 + fail_result = JSON.stringify(fail_result);
  360 + th.go_error(fail_result);
299 return false; 361 return false;
300 } 362 }
301 //-- 开始调用分析的接口 -- 363 //-- 开始调用分析的接口 --
302 - var face_token=check_data.face_token;  
303 - var data={ 364 + var face_token = check_data.face_token;
  365 + var data = {
304 "image": face_token, 366 "image": face_token,
305 "face_field": "color,smooth,acnespotmole,wrinkle,eyesattr,blackheadpore,skinface,skinquality", 367 "face_field": "color,smooth,acnespotmole,wrinkle,eyesattr,blackheadpore,skinface,skinquality",
306 "image_type": "FACE_TOKEN" 368 "image_type": "FACE_TOKEN"
307 } 369 }
308 - th.analysis_img(data);  
309 - }else{  
310 - var msg=th.data.err_map[res.data.code+""];  
311 - th.go_error(msg); 370 + th.analyse_by_bd(data);
  371 + } else {
  372 + var msg = th.data.err_map[res.data.code + ""];
  373 + th.go_error1(msg);
312 } 374 }
313 }) 375 })
314 }, 376 },
315 -  
316 - //跳转到错误页面  
317 - go_error:function (msg) {  
318 - let url = "/packageB/pages/AI-test-skin/fail_result/fail_result?msg="+msg; //跳到分析页  
319 - wx.redirectTo({  
320 - url: url  
321 - });  
322 - }, 377 + //检查图片有没有OK 美图
  378 + img_check_mt() {
  379 + let img_info = getApp().globalData.skin_img_info;
  380 + var plugin = requirePlugin('mtSkinSdk');
  381 + console.log('plugin');
  382 + let th = this;
  383 + plugin.facePoseCorrect({
  384 + path: img_info['path'],
  385 + size: img_info['size'],
  386 + success(res) {
  387 + console.log('=========姿态校正 成功==========')
  388 + console.log('姿态校正结果', res)
  389 + let fail_result = new Array();
  390 + let analyse_info = res.data;
  391 + //检查闭眼情况
  392 + if (analyse_info.analyse_info) {
  393 + //检查睁眼闭眼
  394 + let { left, right } = analyse_info.analyse_info;
  395 + if (left !== 2 && right !== 2) {
  396 + fail_result.push({
  397 + type: 1,
  398 + reason: "未闭眼拍摄"
  399 + })
  400 + }
  401 + }
  402 + //检查佩戴情况
  403 + if (analyse_info.faceGlasses) {
  404 + let { none, normal, sunglasses } = analyse_info.faceGlasses;
  405 + if (normal > 0.8 || sunglasses > 0.8 || none < 0.1) {
  406 + fail_result.push({
  407 + type: 2,
  408 + reason: "未摘下眼镜拍摄"
  409 + })
  410 + }
  411 + }
  412 + //检查框里人脸情况
  413 + if (analyse_info.faceOutDetect.outBound == 1) {
  414 + fail_result.push({
  415 + type: 3,
  416 + reason: "未识别到单个人脸"
  417 + })
  418 + }
323 419
324 - analysis_img:function (data) {  
325 - var th=this; 420 + //检查环境情况
  421 + if (analyse_info.faceQuality) {
  422 + let { bright, blur } = analyse_info.faceQuality;
  423 + if (bright > 80 || bright < 20 || blur < 20) {
  424 + fail_result.push({
  425 + type: 4,
  426 + reason: "质量检测未通过"
  427 + })
  428 + }
  429 + }
  430 + //检查距离
  431 + if (analyse_info.faceRatio < 0.2) {
  432 + fail_result.push({
  433 + type: 5,
  434 + reason: "脸部与摄像头距离过远"
  435 + })
  436 + }
  437 + if (analyse_info.faceRatio > 0.8) {
  438 + fail_result.push({
  439 + type: 6,
  440 + reason: "脸部与摄像头距离过近"
  441 + })
  442 +
  443 + }
  444 + //检查遮挡物
  445 + if (analyse_info.faceVisibility) {
  446 + let fail = Object.keys(analyse_info.faceVisibility).filter(key => {
  447 + return analyse_info.faceVisibility[key] <= 80;
  448 + })
  449 + console.log('fail', fail);
  450 + if (fail.length > 0) {
  451 + fail_result.push({
  452 + type: 7,
  453 + reason: "脸部有遮挡物"
  454 + })
  455 + }
  456 + }
  457 + if (analyse_info.facePoseEuler) {
  458 + let { pitch, roll, yaw } = analyse_info.facePoseEuler;
  459 + if (pitch > 20 || roll > 20 || yaw > 20) {
  460 + fail_result.push({
  461 + type: 8,
  462 + reason: "未保持正脸拍摄"
  463 + })
  464 + }
  465 + }
  466 + if (fail_result.length > 0) {
  467 + fail_result = JSON.stringify(fail_result);
  468 + th.go_error(fail_result);
  469 + return false;
  470 + }
  471 + th.analyse_by_mt(img_info,analyse_info);
  472 + },
  473 + fail(err) {
  474 + console.log(err);
  475 + th.go_error1('识别有误,请重试');
  476 + return false;
  477 + }
  478 + })
  479 +
  480 + },
  481 + //美图测肤接口
  482 + analyse_by_mt(img_info,analyse_info) {
  483 + let th = this;
  484 + var plugin = requirePlugin('mtSkinSdk')
  485 + plugin.detectImage({
  486 + path: img_info['path'],
  487 + size: img_info['size'],
  488 + success(res) {
  489 + console.log('=========用户传图片链接获取检测结果 成功==========')
  490 + console.log('检测结果', res);
  491 + let analyse_data = res.data.face_attributes;
  492 + analyse_data['face_rectangle'] = res.data.face_rectangle;
  493 + let req_data = {
  494 + store_id: setting.stoid,
  495 + user_id: getApp().globalData.user_id,
  496 + img: getApp().globalData.face_img,
  497 + sourceimg: getApp().globalData.face_SourceImg,
  498 + addtime: ut.gettimestamp(),
  499 + resultjson: JSON.stringify(analyse_data),
  500 + detectjson: JSON.stringify(analyse_info),
  501 + skin_type: 1,
  502 + }
  503 + //要保存一下分析的结果
  504 + th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) {
  505 + if (res.data.code == 0) {
  506 + let url = "/packageD/pages/AI-test-skin/success_result/success_result?id=" + res.data.data.id; //跳到分析页
  507 + wx.redirectTo({
  508 + url: url
  509 + })
  510 + } else {
  511 + getApp().showWarning("保存失败");
  512 + }
  513 + })
  514 + },
  515 + fail(err) {
  516 + console.error('=========用户传图片链接获取检测结果 失败==========')
  517 + console.log('error', err)
  518 + getApp().showWarning(err);
  519 + }
  520 + })
  521 + },
  522 + //百度测肤接口
  523 + analyse_by_bd: function (data) {
  524 + var th = this;
326 //开始调用接口,进行分析 525 //开始调用接口,进行分析
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) 526 + this.json_post("/api/weshop/baidubce/face/skinAnalyze", data, function (res) {
  527 + if (res.data.code == 0) {
  528 + getApp().globalData.face_result = res.data.data;
  529 + var req_data = {
  530 + store_id: setting.stoid,
  531 + user_id: getApp().globalData.user_id,
  532 + img: getApp().globalData.face_img,
  533 + sourceimg: getApp().globalData.face_SourceImg,
  534 + addtime: ut.gettimestamp(),
  535 + resultjson: JSON.stringify(res.data.data),
  536 + detectjson: JSON.stringify(th.data.check_data),
  537 + skin_type: 0,
338 } 538 }
339 //要保存一下分析的结果 539 //要保存一下分析的结果
340 - th.json_post("/api/weshop/face/storeSkinface/save",req_data,function (res) {  
341 - if(res.data.code==0){  
342 - let url = "/packageB/pages/AI-test-skin/success_result/success_result?id="+res.data.data.id; //跳到分析页 540 + th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) {
  541 + if (res.data.code == 0) {
  542 + let url = "/packageD/pages/AI-test-skin/success_result/success_result?id=" + res.data.data.id; //跳到分析页
343 wx.redirectTo({ 543 wx.redirectTo({
344 url: url 544 url: url
345 }) 545 })
346 - }else{ 546 + } else {
347 getApp().showWarning("保存失败"); 547 getApp().showWarning("保存失败");
348 } 548 }
349 }) 549 })
350 - }else{  
351 - var msg=th.data.err_map[res.data.code+""];  
352 - let url = "/packageB/pages/AI-test-skin/fail_result/fail_result?msg="+msg; //跳到分析页 550 + } else {
  551 + var msg = th.data.err_map[res.data.code + ""];
  552 + let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页
353 wx.redirectTo({ 553 wx.redirectTo({
354 - url: url 554 + url: url
355 }) 555 })
356 } 556 }
357 }) 557 })
358 }, 558 },
  559 + //跳转到错误页面 美图
  560 + go_error: function (fail_result) {
  561 + let url = `/packageD/pages/AI-test-skin/fail_result/fail_result?fail_result=${fail_result}`; //跳到分析页
  562 + wx.redirectTo({
  563 + url: url
  564 + });
  565 + },
  566 + //跳转到错误页面
  567 + go_error1: function (msg) {
  568 + let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页
  569 + wx.redirectTo({
  570 + url: url
  571 + });
  572 + },
359 573
360 /** 574 /**
361 * @param {Object} url //url地址 575 * @param {Object} url //url地址
@@ -363,10 +577,10 @@ Page({ @@ -363,10 +577,10 @@ Page({
363 * @param {Object} succ //成功的回调 577 * @param {Object} succ //成功的回调
364 * @param {Object} fail //失败的回调 578 * @param {Object} fail //失败的回调
365 */ 579 */
366 - json_post:function(url,data,succ,fail,mathod){  
367 - var Mathod="POST"; 580 + json_post: function (url, data, succ, fail, mathod) {
  581 + var Mathod = "POST";
368 if (mathod) Mathod = mathod; 582 if (mathod) Mathod = mathod;
369 - if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; 583 + if (url.indexOf("http") == -1) url = getApp().globalData.setting.url + url;
370 var str = JSON.stringify(data); 584 var str = JSON.stringify(data);
371 wx.request({ 585 wx.request({
372 url: url, 586 url: url,
@@ -375,10 +589,8 @@ Page({ @@ -375,10 +589,8 @@ Page({
375 header: { 589 header: {
376 'content-type': 'application/json' 590 'content-type': 'application/json'
377 },// 设置请求的 header 591 },// 设置请求的 header
378 - success: function (res) {succ(res); },  
379 - fail:function(res){fail(res);} 592 + success: function (res) { succ(res); },
  593 + fail: function (res) { fail(res); }
380 }) 594 })
381 }, 595 },
382 -  
383 -  
384 }) 596 })
385 \ No newline at end of file 597 \ No newline at end of file
packageD/pages/AI-test-skin/analyse/analyse.json
1 { 1 {
2 - "usingComponents": {} 2 + "usingComponents": {},
  3 + "navigationBarTitleText": "测肤报告"
3 } 4 }
4 \ No newline at end of file 5 \ No newline at end of file
packageD/pages/AI-test-skin/analyse/analyse.wxml
1 <view class="content"> 1 <view class="content">
2 - <view class="img" style="margin-left: -38rpx"></view>  
3 - <view style="text-align: center;margin-top: -20%;">  
4 - <text style="color: #fff;">正在分析...</text>  
5 - <progress border-radius="6" percent="{{per}}" activeColor="#fff" backgroundColor="#85898a" class="progress"></progress> 2 + <view style="width: 750rpx; display: flex;justify-content: center; height: 310px">
  3 + <view class="img" style="background-image: url({{iurl}}/miniapp/images/skinimg/11.png);"></view>
  4 + </view>
  5 + <view style="text-align: center;">
  6 + <text style="color: #fff; font-size: 28rpx">正在分析...</text>
  7 + <progress border-radius="3" percent="{{per}}" activeColor="#fff" stroke-width="4"
  8 + backgroundColor="#85898a" class="progress"></progress>
6 </view> 9 </view>
7 </view> 10 </view>
packageD/pages/AI-test-skin/analyse/analyse.wxss
@@ -25,18 +25,17 @@ page { @@ -25,18 +25,17 @@ page {
25 } 25 }
26 26
27 .img { 27 .img {
28 - background: url("https://mshopimg.yolipai.net//miniapp/images/skinimg/11.png");  
29 margin-top: 15%; 28 margin-top: 15%;
30 display: inline-block; 29 display: inline-block;
31 width: 350px; 30 width: 350px;
32 height: 350px; 31 height: 350px;
33 - transform: scale(0.55);  
34 - animation: 1s mymove infinite steps(27, end); 32 + transform: scale(0.4);
  33 + animation: 2s mymove infinite steps(27, end);
35 } 34 }
36 35
37 .progress { 36 .progress {
38 margin-top: 3%; 37 margin-top: 3%;
39 - width: 60%; 38 + width: 48%;
40 /* text-align: center; */ 39 /* text-align: center; */
41 margin-left: 50%; 40 margin-left: 50%;
42 transform: translateX(-50%); 41 transform: translateX(-50%);
packageD/pages/AI-test-skin/fail_result/fail_result.js
1 /* 1 /*
2 * @Author: your name 2 * @Author: your name
3 * @Date: 2022-02-15 10:01:57 3 * @Date: 2022-02-15 10:01:57
4 - * @LastEditTime: 2022-02-16 15:40:54 4 + * @LastEditTime: 2022-02-28 15:51:37
5 * @LastEditors: Please set LastEditors 5 * @LastEditors: Please set LastEditors
6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl
7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js
@@ -20,15 +20,26 @@ Page({ @@ -20,15 +20,26 @@ Page({
20 data: { 20 data: {
21 iurl: setting.imghost, 21 iurl: setting.imghost,
22 msg:null, 22 msg:null,
  23 + fail_result:new Array(), //失败原因
23 }, 24 },
24 25
25 /** 26 /**
26 * 生命周期函数--监听页面加载 27 * 生命周期函数--监听页面加载
27 */ 28 */
28 onLoad: function (options) { 29 onLoad: function (options) {
29 - var msg=options.msg;  
30 - msg=decodeURIComponent(msg);  
31 - this.setData({msg:msg}); 30 + if(options?.fail_result){
  31 + var fail_result = JSON.parse(options.fail_result);
  32 + this.setData({
  33 + fail_result,
  34 + })
  35 + }
  36 + if(options?.msg){
  37 + this.setData({
  38 + msg:options.msg
  39 + })
  40 + }
  41 + // msg=decodeURIComponent(msg);
  42 + // this.setData({msg:msg});
32 }, 43 },
33 44
34 /** 45 /**
@@ -53,7 +64,7 @@ Page({ @@ -53,7 +64,7 @@ Page({
53 }, 64 },
54 //从相册中选择图片 65 //从相册中选择图片
55 back_to:function () { 66 back_to:function () {
56 - let url = "/packageB/pages/AI-test-skin/shoot_notice/shoot_notice"; 67 + let url = "/packageD/pages/AI-test-skin/shoot_notice/shoot_notice";
57 app.goto(url); 68 app.goto(url);
58 }, 69 },
59 70
packageD/pages/AI-test-skin/fail_result/fail_result.wxml
@@ -3,20 +3,32 @@ @@ -3,20 +3,32 @@
3 <view> 3 <view>
4 <view style="position: relative;display: inline-block"> 4 <view style="position: relative;display: inline-block">
5 <text class="iconfont icon-tupian" style="color: #4bd6df;font-size: 80rpx"></text> 5 <text class="iconfont icon-tupian" style="color: #4bd6df;font-size: 80rpx"></text>
6 - <text class="iconfont icon-prompt-filling" style="color:red;font-size: 40rpx;position:absolute;left: -8rpx;top: 0;"></text> 6 + <text class="iconfont .icon-infofill" style="color:red;font-size: 40rpx;position:absolute;left: -8rpx;top: 0;"></text>
7 </view> 7 </view>
8 </view> 8 </view>
9 - <view style="font-size:32rpx;color: #333">上传图片符合要求</view> 9 + <view style="font-size:32rpx;color: #333">上传图片不符合要求</view>
10 <view style="font-size: 26rpx;color: #555">请重新更换图片获取相关检测</view> 10 <view style="font-size: 26rpx;color: #555">请重新更换图片获取相关检测</view>
11 <view style="border-bottom: 1rpx solid #eee; margin:0 40rpx;margin-top:40rpx;"></view> 11 <view style="border-bottom: 1rpx solid #eee; margin:0 40rpx;margin-top:40rpx;"></view>
12 </view> 12 </view>
13 13
14 <view style="padding:60rpx; padding-bottom: 70rpx;"> 14 <view style="padding:60rpx; padding-bottom: 70rpx;">
15 - <view style="font-size: 32rpx;">失败原因:</view>  
16 - <view style="font-size: 26rpx;display: flex;align-items: center; margin-top: 20prx">  
17 - <text class="iconfont icon-account" style="font-size: 56rpx;margin-right: 20rpx"></text>  
18 - <view>{{msg}}</view>  
19 - </view> 15 + <view style="font-size: 32rpx;margin-bottom: 6rpx;">失败原因:</view>
  16 + <block wx:if="{{!msg}}">
  17 + <view style="font-size: 26rpx; margin-top: 20prx" wx:for="{{fail_result}}" wx:key="type">
  18 + <view style="display: flex;align-items: center;">
  19 + <text class="iconfont icon-info" style="margin-right: 20rpx"></text>
  20 + <view>{{item.reason}}</view>
  21 + </view>
  22 + </view>
  23 + </block>
  24 + <block wx:else>
  25 + <view style="font-size: 26rpx; margin-top: 20prx">
  26 + <view style="display: flex;align-items: center;">
  27 + <text class="iconfont icon-info" style="margin-right: 20rpx"></text>
  28 + <view>{{msg}}</view>
  29 + </view>
  30 + </view>
  31 + </block>
20 </view> 32 </view>
21 33
22 </view> 34 </view>
packageD/pages/AI-test-skin/fail_result/fail_result.wxss
@@ -25,10 +25,10 @@ page { @@ -25,10 +25,10 @@ page {
25 margin: 70rpx 0 30rpx 50%; 25 margin: 70rpx 0 30rpx 50%;
26 transform: translateX(-50%); 26 transform: translateX(-50%);
27 background: #4bd6df; 27 background: #4bd6df;
28 - padding: 20rpx;  
29 - width: 50%; 28 + padding: 15rpx 10rpx;
  29 + width: 46%;
30 text-align: center; 30 text-align: center;
31 - border-radius: 40rpx; 31 + border-radius: 50rpx;
32 color: #fff; 32 color: #fff;
33 } 33 }
34 .btn_fixed { 34 .btn_fixed {
@@ -60,43 +60,10 @@ page { @@ -60,43 +60,10 @@ page {
60 justify-content: center; 60 justify-content: center;
61 } 61 }
62 .ac{align-items: center} 62 .ac{align-items: center}
63 -  
64 -@font-face {  
65 - font-family: 'iconfont';  
66 - /* project id 2125414 */  
67 - src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot');  
68 - src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot?#iefix') format('embedded-opentype'),  
69 - url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff2') format('woff2'),  
70 - url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff') format('woff'),  
71 - url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.ttf') format('truetype'),  
72 - url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.svg#iconfont') format('svg');  
73 -}  
74 -  
75 -.icon-pic:before {  
76 - content: "\e620";  
77 -}  
78 -  
79 .t_c{text-align: center} 63 .t_c{text-align: center}
80 64
81 65
82 -@font-face {  
83 - font-family: "iconfont"; /* Project id 3188718 */  
84 - src: url('iconfont.woff2?t=1645080046840') format('woff2'),  
85 - url('iconfont.woff?t=1645080046840') format('woff'),  
86 - url('iconfont.ttf?t=1645080046840') format('truetype');  
87 -}  
88 66
89 -.icon-tupian:before {  
90 - content: "\e997";  
91 -}  
92 -  
93 -.icon-account:before {  
94 - content: "\e6a3";  
95 -}  
96 -  
97 -.icon-prompt-filling:before {  
98 - content: "\e68b";  
99 -}  
100 67
101 68
102 69
packageD/pages/AI-test-skin/history_record/history_record.js
@@ -177,69 +177,126 @@ Page({ @@ -177,69 +177,126 @@ Page({
177 return initChart; 177 return initChart;
178 } 178 }
179 }, 179 },
  180 + history: [],
  181 + page: 1,
  182 + no_more: 0,
  183 + isLoading: 0,
  184 + is_get: 0,
180 }, 185 },
181 186
182 /** 187 /**
183 * 生命周期函数--监听页面加载 188 * 生命周期函数--监听页面加载
184 */ 189 */
185 onLoad: function (options) { 190 onLoad: function (options) {
  191 + this.getHistoryData();
  192 + },
  193 +
  194 + /**
  195 + * 生命周期函数--监听页面初次渲染完成
  196 + */
  197 + onReady: function () {
  198 +
  199 + },
  200 +
  201 + time_sort(data) {
  202 + let arr = this.data.history;
  203 + for (let i = 0; i < data.length; i++) {
  204 + let history = data[i];
  205 + let id = history.id;
  206 + let now = new Date(history['addtime'] * 1000);
  207 + let year = now.getFullYear(); //年
  208 + let month = (now.getMonth() + 1).toString().padStart(2, 0); //月
  209 + let day = (now.getDate()).toString().padStart(2, 0); //日
  210 + let hour = (now.getHours()).toString().padStart(2, 0); //时
  211 + let minute = (now.getMinutes()).toString().padStart(2, 0); //分
  212 + let history_time = `${year}年${month}月`;
  213 + let time = `${year}/${month}/${day} ${hour}:${minute}`;
  214 + let time_obj = {
  215 + history_time,
  216 + time_arr: new Array(),
  217 + };
  218 + let obj = {
  219 + time,
  220 + id,
  221 + };
  222 + if (arr.length > 0) {
  223 + let index = arr.findIndex(item => {
  224 + return item['history_time'] === history_time;
  225 + })
  226 + if (index > -1) {
  227 + arr[index]['time_arr'].push(obj);
  228 + } else {
  229 + time_obj['time_arr'].push(obj);
  230 + arr.push(time_obj);
  231 + }
  232 + } else {
  233 + time_obj['time_arr'].push(obj);
  234 + arr.push(time_obj);
  235 + }
  236 + }
  237 + function _sort_by_history_time (property){
  238 + return function(a,b){
  239 + let val1 = a[property];
  240 + let val2 = b[property];
  241 + if(val2 > val1){
  242 + return 1
  243 + }else if(val2 < val1){
  244 + return -1
  245 + }else{
  246 + return 0
  247 + }
  248 + }
  249 + }
  250 + arr.sort(_sort_by_history_time('history_time'));
  251 + return arr;
  252 + },
  253 + bindscrolltolower(){
  254 + console.log(111);
  255 + },
  256 +
  257 + async getHistoryData() {
  258 + if (this.data.no_more) return false;
  259 + if (this.data.isLoading) return false;
  260 + this.data.isLoading = 1;
  261 + let history = this.data.history;
186 let url = `/api/weshop/face/storeSkinface/page`; 262 let url = `/api/weshop/face/storeSkinface/page`;
187 - app.request.promiseGet(url, { 263 + const { data: res } = await request.promiseGet(url, {
188 isShowLoading: true, 264 isShowLoading: true,
189 data: { 265 data: {
190 store_id: setting.stoid, 266 store_id: setting.stoid,
191 user_id: os.user_id, 267 user_id: os.user_id,
  268 + page: this.data.page,
  269 + pageSize:20
192 } 270 }
193 - }).then(res => {  
194 - console.log('111111111', res);  
195 - if (ut.ajax_ok(res)) {  
196 - let data = res.data.data.pageData;  
197 - let arr = [];  
198 - for (let i = 0; i < data.length; i++) {  
199 - let history = data[i];  
200 - let id = history.id;  
201 - let now = new Date(history['addtime'] * 1000);  
202 - let year = now.getFullYear(); //年  
203 - let month = (now.getMonth() + 1).toString().padStart(2, 0); //月  
204 - let day = (now.getDate()).toString().padStart(2, 0); //日  
205 - let hour = (now.getHours()).toString().padStart(2, 0); //时  
206 - let minute = (now.getMinutes()).toString().padStart(2, 0); //分  
207 - let history_time = `${year}年${month}月`;  
208 - let time = `${year}/${month}/${day} ${hour}:${minute}`;  
209 - let time_obj = {  
210 - history_time,  
211 - time_arr: new Array(),  
212 - };  
213 - if (arr.length > 0) {  
214 - let index = arr.findIndex(item => {  
215 - return item['history_time'] === history_time;  
216 - })  
217 - if (index > -1) {  
218 - let obj = {  
219 - time,  
220 - id,  
221 - };  
222 - arr[index]['time_arr'].push(obj);  
223 - } else {  
224 - arr.push(time_obj);  
225 - }  
226 - } else {  
227 - arr.push(time_obj);  
228 - }  
229 - } 271 + });
  272 + // initChart.setOption(option);
  273 + if (res.code == 0 && res.data.pageData.length > 0) {
  274 + history = this.time_sort(res.data.pageData);
  275 + if(res.data.pageData.length >= res.data.total){
230 this.setData({ 276 this.setData({
231 - history: arr, 277 + no_more: 1,
232 }) 278 })
233 - initChart.setOption(option);  
234 } 279 }
235 -  
236 - })  
237 - },  
238 -  
239 - /**  
240 - * 生命周期函数--监听页面初次渲染完成  
241 - */  
242 - onReady: function () { 280 + this.setData({
  281 + history,
  282 + isLoading: 0,
  283 + is_get: 1,
  284 + })
  285 + } else {
  286 + if (res.data.page > 1) {
  287 + this.setData({
  288 + history,
  289 + no_more: 1,
  290 + isLoading: 0,
  291 + is_get: 1,
  292 + })
  293 + } else {
  294 + this.setData({
  295 + history: [],
  296 + is_get: 1,
  297 + })
  298 + }
  299 + }
243 300
244 }, 301 },
245 302
@@ -247,12 +304,12 @@ Page({ @@ -247,12 +304,12 @@ Page({
247 * 生命周期函数--监听页面显示 304 * 生命周期函数--监听页面显示
248 */ 305 */
249 onShow: function () { 306 onShow: function () {
250 - setTimeout(() => {  
251 -  
252 - }, 1000); 307 +
253 }, 308 },
254 go_result(e) { 309 go_result(e) {
255 - 310 + let id = e.currentTarget.dataset.id;
  311 + let url =`/packageD/pages/AI-test-skin/success_result/success_result?id=${id}`;
  312 + app.goto(url);
256 }, 313 },
257 314
258 /** 315 /**
@@ -280,7 +337,8 @@ Page({ @@ -280,7 +337,8 @@ Page({
280 * 页面上拉触底事件的处理函数 337 * 页面上拉触底事件的处理函数
281 */ 338 */
282 onReachBottom: function () { 339 onReachBottom: function () {
283 - 340 + this.data.page++;
  341 + this.getHistoryData();
284 }, 342 },
285 343
286 /** 344 /**
packageD/pages/AI-test-skin/history_record/history_record.json
1 { 1 {
2 "navigationBarTitleText": "历史变化", 2 "navigationBarTitleText": "历史变化",
3 "usingComponents": { 3 "usingComponents": {
4 - "ec-canvas": "../../../components/ec-canvas/ec-canvas" 4 + "ec-canvas": "../../../components/ec-canvas/ec-canvas",
  5 + "nodata": "/components/nodata/nodata"
5 } 6 }
6 } 7 }
7 \ No newline at end of file 8 \ No newline at end of file
packageD/pages/AI-test-skin/history_record/history_record.wxml
1 <view class="content"> 1 <view class="content">
2 - <view style="margin-bottom: 5%;">历史分析</view>  
3 - <view class="echarts" style="border-radius: 30rpx;">  
4 - <view class="tubiao">  
5 - <ec-canvas id="mychart" canvas-id="mychart-bar" ec="{{ec}}"></ec-canvas> 2 + <view style="display: none;">
  3 + <view style="margin-bottom: 5%;">历史分析</view>
  4 + <view class="echarts" style="border-radius: 30rpx;">
  5 + <view class="tubiao">
  6 + <ec-canvas id="mychart" canvas-id="mychart-bar" ec="{{ec}}"></ec-canvas>
  7 + </view>
  8 + <text class="fs24" style="position:absolute;bottom:25px;color: #333;">
  9 + 注:请确保多次拍摄姿态和环境光线一致。拍摄姿态的偏移、环境光线变化或者皮肤状态变化都可能导致分数较大波动。
  10 + </text>
6 </view> 11 </view>
7 - <text class="fs24" style="position:absolute;bottom:25px;color: #333;">  
8 - 注:请确保多次拍摄姿态和环境光线一致。拍摄姿态的偏移、环境光线变化或者皮肤状态变化都可能导致分数较大波动。  
9 - </text>  
10 </view> 12 </view>
11 - <view class="mgv5">历史报告</view>  
12 - 13 + <view class="mgb5">历史报告</view>
13 <view class="history_list"> 14 <view class="history_list">
14 <view class="history_list_month" wx:for="{{history}}"> 15 <view class="history_list_month" wx:for="{{history}}">
15 - <view style="color:#333;font-size:26rpx;margin-top: 30rpx">{{item.time}}</view>  
16 - <view class="souce" wx:for="{{item.time_arr}}" wx:for-item="subitem" wx:for-index="subindex" wx:key="subindex">  
17 - <view style="font-weight: 600;">{{subitem}}</view>  
18 - <view style="color: #9b9b9b;" bindtap="go_result">去查看<text style="font-size: 24rpx;" class="iconfont icon-arrow_right"></text></view> 16 + <view style="color:#333;font-size:26rpx;margin-top: 30rpx">{{item.history_time}}</view>
  17 + <view class="souce" wx:for="{{item.time_arr}}" wx:for-item="subitem" bindtap="go_result" data-id="{{subitem.id}}" wx:for-index="subindex" wx:key="subindex">
  18 + <view style="font-weight: 600;">{{subitem.time}}</view>
  19 + <view style="color: #9b9b9b;" >去查看<text style="font-size: 24rpx;" class="iconfont icon-arrow_right"></text></view>
19 </view> 20 </view>
20 </view> 21 </view>
21 </view> 22 </view>
  23 + <view class="no-more txt-center" wx:if="{{history.length > 0 && no_more}}">- 没有更多了 -</view>
  24 + <nodata class="t-c" wx:if="{{history.length==0 && is_get}}"></nodata>
22 </view> 25 </view>
23 \ No newline at end of file 26 \ No newline at end of file
packageD/pages/AI-test-skin/history_record/history_record.wxss
@@ -4,10 +4,18 @@ page { @@ -4,10 +4,18 @@ page {
4 height: 100%; 4 height: 100%;
5 } 5 }
6 6
7 -.mgv5 { 7 +.mgb5 {
8 margin-top: 5%; 8 margin-top: 5%;
9 margin-bottom: 5%; 9 margin-bottom: 5%;
10 } 10 }
  11 +.txt-center {
  12 + text-align: center;
  13 +}
  14 +.no-more {
  15 + font-size: 24rpx;
  16 + line-height: 3;
  17 + color: #bbb;
  18 +}
11 19
12 .content { 20 .content {
13 padding: 5%; 21 padding: 5%;
packageD/pages/AI-test-skin/index/aiskin.js
@@ -43,7 +43,7 @@ Page({ @@ -43,7 +43,7 @@ Page({
43 * 生命周期函数--监听页面显示 43 * 生命周期函数--监听页面显示
44 */ 44 */
45 onShow: function () { 45 onShow: function () {
46 - 46 + this.getHistoryData();
47 }, 47 },
48 48
49 /** 49 /**
@@ -54,23 +54,27 @@ Page({ @@ -54,23 +54,27 @@ Page({
54 }, 54 },
55 55
56 goto(e) { 56 goto(e) {
57 - var user=getApp().globalData.userInfo;  
58 - if(!user){  
59 - wx.showToast({  
60 - title: "请先授权登陆",  
61 - icon: 'none',  
62 - duration: 2000  
63 - });  
64 -  
65 - setTimeout(function () {  
66 - let url = "/pages/togoin/togoin";  
67 - app.goto(url);  
68 - },1000)  
69 - return false;  
70 - }  
71 57
72 - let url = e.currentTarget.dataset.url;  
73 - app.goto(url); 58 + this.check_num(function () {
  59 + var user=getApp().globalData.userInfo;
  60 + if(!user){
  61 + wx.showToast({
  62 + title: "请先授权登陆",
  63 + icon: 'none',
  64 + duration: 2000
  65 + });
  66 +
  67 + setTimeout(function () {
  68 + let url = "/pages/togoin/togoin";
  69 + app.goto(url);
  70 + },1000)
  71 + return false;
  72 + }
  73 +
  74 + let url = e.currentTarget.dataset.url;
  75 + app.goto(url);
  76 + })
  77 +
74 }, 78 },
75 79
76 /** 80 /**
@@ -99,5 +103,49 @@ Page({ @@ -99,5 +103,49 @@ Page({
99 */ 103 */
100 onShareAppMessage: function () { 104 onShareAppMessage: function () {
101 105
  106 + },
  107 +
  108 + check_num:function (func) {
  109 + //判断右没有开AI测肤
  110 + getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+setting.stoid,{}).then(rs=>{
  111 + if(rs.data.code!=0 || !rs.data.data){
  112 + wx.showToast({
  113 + title: "未开通测肤功能,请联系商家",
  114 + icon: 'none',
  115 + duration: 3000
  116 + })
  117 + }else if(!rs.data.data.skin_num || rs.data.data.skin_num<=0){
  118 + wx.showToast({
  119 + title: "测肤功能的使用次数已经达到上限,请联系商家",
  120 + icon: 'none',
  121 + duration: 3000
  122 + })
  123 + }else{
  124 + func();
  125 + }
  126 + })
  127 + },
  128 +
  129 + async getHistoryData() {
  130 + if (!getApp().globalData.user_id) return false;
  131 + if (this.data.show_his) return false;
  132 +
  133 + let history = this.data.history;
  134 + let url = `/api/weshop/face/storeSkinface/page`;
  135 + const { data: res } = await request.promiseGet(url, {
  136 + isShowLoading: true,
  137 + data: {
  138 + store_id: setting.stoid,
  139 + user_id: os.user_id,
  140 + page: 1,
  141 + pageSize:1,
  142 + }
  143 + });
  144 + // initChart.setOption(option);
  145 + if (res.code == 0 && res.data.pageData.length > 0) {
  146 + this.setData({show_his:1})
  147 + }
102 } 148 }
  149 +
  150 +
103 }) 151 })
104 \ No newline at end of file 152 \ No newline at end of file
packageD/pages/AI-test-skin/index/aiskin.wxml
1 <view class="container1"> 1 <view class="container1">
2 - <view class="history">  
3 - <cover-view style="padding: 0 6rpx 0 25rpx;" bindtap="goto" data-url="/packageB/pages/AI-test-skin/history_record/history_record">历史档案</cover-view>  
4 - <text class="iconfont icon-arrow_right"></text> 2 + <view class="history" wx:if="{{show_his}}" style="font-size: 30rpx">
  3 + <cover-view style="padding: 6rpx 6rpx 6rpx 25rpx;" bindtap="goto" data-url="/packageD/pages/AI-test-skin/history_record/history_record">历史档案</cover-view>
  4 + <text class="iconfont icon-arrow_right" style="font-size: 30rpx"></text>
5 </view> 5 </view>
6 - <image src="{{iurl}}/miniapp/images/skinimg/shouye.jpeg"></image>  
7 - <view class="start_btn" bindtap="goto" data-url="/packageB/pages/AI-test-skin/shoot_notice/shoot_notice">  
8 - <text>开始测肤</text> 6 + <view style="position: relative;width: 100%">
  7 + <image style="width: 100%" src="{{iurl}}/miniapp/images/skinimg/shouye.jpeg" mode="widthFix"></image>
  8 + <view class="start_btn" bindtap="goto" data-url="/packageD/pages/AI-test-skin/shoot_notice/shoot_notice">
  9 + <text>开始测肤</text>
  10 + </view>
9 </view> 11 </view>
10 </view> 12 </view>
11 \ No newline at end of file 13 \ No newline at end of file
packageD/pages/AI-test-skin/index/aiskin.wxss
1 -/* packageB/pages/AI-test-skin/aiskin.wxss */  
2 -page {  
3 - width: 100%;  
4 - height: 100%;  
5 -}  
6 -image {  
7 - width: 100vw;  
8 - height: 100%;  
9 -} 1 +
10 .container1 { 2 .container1 {
11 position: relative; 3 position: relative;
12 width: 100%; 4 width: 100%;
13 - height: 100%;  
14 } 5 }
15 .history { 6 .history {
16 margin-top: 30rpx; 7 margin-top: 30rpx;
@@ -21,18 +12,19 @@ image { @@ -21,18 +12,19 @@ image {
21 border-radius: 50rpx 0 0 50rpx; 12 border-radius: 50rpx 0 0 50rpx;
22 box-shadow: 0 0 2px 2px #f7f5f5; 13 box-shadow: 0 0 2px 2px #f7f5f5;
23 color: #4ad5df; 14 color: #4ad5df;
  15 + align-items: center;
  16 + z-index: 100;
24 } 17 }
25 .start_btn { 18 .start_btn {
26 - position: fixed;  
27 - bottom: 50rpx;  
28 - /* margin: auto; */  
29 - /* text-align: center; */  
30 margin-left: 50%; 19 margin-left: 50%;
31 transform: translateX(-50%); 20 transform: translateX(-50%);
32 background: #4bd6df; 21 background: #4bd6df;
33 - padding: 20rpx; 22 + padding:16rpx 20rpx;
34 width: 67%; 23 width: 67%;
35 text-align: center; 24 text-align: center;
36 border-radius: 40rpx; 25 border-radius: 40rpx;
37 color: #fff; 26 color: #fff;
  27 + font-size: 30rpx;
  28 + position:absolute;
  29 + bottom: 90rpx;
38 } 30 }
39 \ No newline at end of file 31 \ No newline at end of file
packageD/pages/AI-test-skin/select_photo/select_photo.js
1 -/*  
2 - * @Author: your name  
3 - * @Date: 2022-02-16 14:34:42  
4 - * @LastEditTime: 2022-02-16 15:42:25  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\select_photo\select_photo.js  
8 - */  
9 // packageB/pages/AI-test-skin/select_photo/select_photo.js 1 // packageB/pages/AI-test-skin/select_photo/select_photo.js
10 const app = getApp(); 2 const app = getApp();
11 const request = app.request; 3 const request = app.request;
@@ -20,84 +12,191 @@ Page({ @@ -20,84 +12,191 @@ Page({
20 data: { 12 data: {
21 iurl: setting.imghost, 13 iurl: setting.imghost,
22 gl_skin_img: null, 14 gl_skin_img: null,
  15 + skin_type: 0,
23 }, 16 },
24 17
25 /** 18 /**
26 * 生命周期函数--监听页面加载 19 * 生命周期函数--监听页面加载
27 */ 20 */
28 onLoad: function (options) { 21 onLoad: function (options) {
29 - var img=getApp().globalData.skin_img;  
30 - this.setData({gl_skin_img:img})  
31 - },  
32 -  
33 - /**  
34 - * 生命周期函数--监听页面显示  
35 - */  
36 - onShow: function () {},  
37 -  
38 - /**  
39 - * 生命周期函数--监听页面隐藏  
40 - */  
41 - onHide: function () {  
42 -  
43 - },  
44 - /**  
45 - * 页面上拉触底事件的处理函数  
46 - */  
47 - onReachBottom: function () {  
48 -  
49 - },  
50 -  
51 - /**  
52 - * 用户点击右上角分享  
53 - */  
54 - onShareAppMessage: function () {  
55 - 22 + var img = getApp().globalData.skin_img_info;
  23 + this.setData({ gl_skin_img: img })
56 }, 24 },
57 25
58 //-- 完成选择 -- 26 //-- 完成选择 --
59 - ok_select:function () {  
60 - var th=this;  
61 - app.request.uploadFile("/api/weshop/baidubce/face/uploadImg?uploadPath=faceimg&storeId="+setting.stoid, {  
62 - filePath: th.data.gl_skin_img,  
63 - name: "file",  
64 - success: function (e) {  
65 - if(e.data.code==0) {  
66 - getApp().globalData.face_img=e.data.data.img;  
67 - getApp().globalData.face_SourceImg=e.data.data.SourceImg;  
68 -  
69 - let url = "/packageB/pages/AI-test-skin/analyse/analyse"; //跳到分析页  
70 - app.goto(url); 27 + ok_select: function () {
  28 + const th = this;
  29 + this.check_num(function () {
  30 + let filePath = th.data.gl_skin_img['path'];
  31 + app.request.uploadFile("/api/weshop/baidubce/face/uploadImg?uploadPath=faceimg&storeId=" + setting.stoid, {
  32 + filePath: th.data.gl_skin_img['path'],
  33 + name: "file",
  34 + success: function (e) {
  35 + if (e.data.code == 0) {
  36 + getApp().globalData.face_img = e.data.data.img;
  37 + getApp().globalData.face_SourceImg = e.data.data.SourceImg;
  38 + let url = "/packageD/pages/AI-test-skin/analyse/analyse"; //跳到分析页
  39 + app.goto(url);
  40 + } else {
  41 + wx.showToast({
  42 + title: e.data.msg,
  43 + icon: 'none',
  44 + duration: 2000
  45 + });
  46 + };
  47 + }
  48 + });
  49 + })
71 50
72 - } else {  
73 - wx.showToast({  
74 - title: e.data.msg,  
75 - icon: 'none',  
76 - duration: 2000  
77 - });  
78 - };  
79 - }  
80 - });  
81 }, 51 },
82 -  
83 //-- 重新从相册中选择图片 -- 52 //-- 重新从相册中选择图片 --
84 - show_pai_pop:function () {  
85 - var th=this; 53 + show_pai_pop: function () {
  54 + var th = this;
86 //选择和拍照一张图片 55 //选择和拍照一张图片
87 wx.chooseImage({ 56 wx.chooseImage({
88 count: 1, 57 count: 1,
89 sizeType: ['original', 'compressed'], 58 sizeType: ['original', 'compressed'],
90 sourceType: ['album', 'camera'], 59 sourceType: ['album', 'camera'],
91 - success (res) { 60 + success(res) {
92 let imgArr = res.tempFilePaths; 61 let imgArr = res.tempFilePaths;
93 - getApp().globalData.skin_img=imgArr[0];  
94 - th.setData({gl_skin_img:imgArr[0]}) 62 + if (th.data.skin_type) {
  63 + imgArr = res.tempFiles;
  64 + }
  65 + getApp().globalData.skin_img_info = imgArr[0];
  66 + th.setData({ gl_skin_img: imgArr[0] })
95 } 67 }
96 }) 68 })
97 - 69 + },
  70 + //选择图片
  71 + takePhoto() {
  72 + var that = this;
  73 + wx.chooseImage({
  74 + count: 1,
  75 + sizeType: ['compressed'],
  76 + sourceType: ['album', 'camera'],
  77 + success(res) {
  78 + var tempFilePaths = res.tempFilePaths
  79 + console.log(tempFilePaths);
  80 + console.log(res.tempFiles[0].size / 1024 + 'kb');
  81 + var size1 = res.tempFiles[0].size;
  82 + var size = res.tempFiles[0].size / 1024; //kb单位
  83 + // tempFilePath可以作为img标签的src属性显示图片
  84 + var img = tempFilePaths[0];
  85 + that.setData({
  86 + imagesrc: img,
  87 + })
  88 + that.imgToMin(img, size, size1); //获取图片后压缩
  89 +
  90 + },
  91 + fail(err) {
  92 + console.log(err);
  93 + }
  94 + })
  95 + },
  96 + //缩放图片
  97 + imgToMin(img, size, size1) {
  98 + var that = this;
  99 + //size小于100kb 时 直接转码识别
  100 + if (size < 1024) {
  101 + getApp().globalData.skin_img_info = {
  102 + path:img,
  103 + size,
  104 + }
  105 + let url = "/packageD/pages/AI-test-skin/select_photo/select_photo";
  106 + app.goto(url);
  107 + // that.base64(img,"jpg");
  108 + return;
  109 + }
  110 +
  111 + //先获取图片 然后根据长宽 缩小 之后获取图片
  112 + wx.getImageInfo({
  113 + src: img,
  114 + success(res) {
  115 + var ratio = Math.trunc(size / 1024);
  116 + size1 = size1 / ratio;
  117 + var canvasWidth = res.width //图片原始长宽
  118 + var canvasHeight = res.height
  119 + //while (canvasWidth > 375 || canvasHeight > 520){// 保证宽高在400以内
  120 + canvasWidth = Math.trunc(canvasWidth / ratio)
  121 + canvasHeight = Math.trunc(canvasHeight / ratio)
  122 + //ratio++;
  123 + //}
  124 + that.setData({ canvasWidth: canvasWidth, canvasHeight: canvasHeight })
  125 + console.log(canvasWidth)
  126 + console.log(canvasHeight)
  127 + //绘制图片
  128 + var ctx = wx.createCanvasContext('attendCanvasId')
  129 + ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
  130 + ctx.draw(false, setTimeout(function () {
  131 + wx.canvasToTempFilePath({
  132 + canvasId: 'attendCanvasId',
  133 + width: canvasWidth,
  134 + height: canvasHeight,
  135 + destWidth: canvasWidth,
  136 + destHeight: canvasHeight,
  137 + fileType: 'jpg',
  138 + success: function (res) {
  139 + console.log(res.tempFilePath)//最终图片路径
  140 + that.setData({
  141 + canvasImgUrl: res.tempFilePath
  142 + });
  143 + getApp().globalData.skin_img_info = {
  144 + path: res.tempFilePath,
  145 + size: size1
  146 + };
  147 + let url = "/packageD/pages/AI-test-skin/select_photo/select_photo";
  148 + app.goto(url);
  149 + },
  150 + fail: function (res) {
  151 + console.log("缩放图片失败");
  152 + console.log(res.errMsg)
  153 + wx.hideLoading();
  154 + wx.showToast({
  155 + title: '识别图片失败',
  156 + image: '../../utils/img/wrong.png',
  157 + duration: 2000
  158 + })
  159 + that.setData({
  160 + title: "识别失败",
  161 + })
  162 + }
  163 + }, this) //要填写this对象,表示canvas这个对象
  164 + }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty
  165 + },
  166 + fail: function (res) {
  167 + console.log("获取图片失败");
  168 + console.log(res.errMsg)
  169 + wx.hideLoading();
  170 + wx.showToast({
  171 + title: '识别图片失败',
  172 + image: '../../utils/img/wrong.png',
  173 + duration: 2000
  174 + })
  175 + that.setData({
  176 + title: "识别失败",
  177 + })
  178 + },
  179 + })
98 }, 180 },
99 181
100 -  
101 -  
102 - 182 + check_num:function (func) {
  183 + //判断右没有开AI测肤
  184 + getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+setting.stoid,{}).then(rs=>{
  185 + if(rs.data.code!=0 || !rs.data.data){
  186 + wx.showToast({
  187 + title: "未开通测肤功能,请联系商家",
  188 + icon: 'none',
  189 + duration: 3000
  190 + })
  191 + }else if(!rs.data.data.skin_num || rs.data.data.skin_num<=0){
  192 + wx.showToast({
  193 + title: "测肤功能的使用次数已经达到上限,请联系商家",
  194 + icon: 'none',
  195 + duration: 3000
  196 + })
  197 + }else{
  198 + func();
  199 + }
  200 + })
  201 + }
103 }) 202 })
104 \ No newline at end of file 203 \ No newline at end of file
packageD/pages/AI-test-skin/select_photo/select_photo.wxml
1 <view class="content" style="height: 70%;"> 1 <view class="content" style="height: 70%;">
2 - <view style="height: 100%;">  
3 - <image style="height: 100%;width: 100%;border-radius: 3%;" src="{{gl_skin_img}}"></image> 2 + <view style="height: 100%;;display:flex;align-items:center;overflow: hidden;">
  3 + <image style="width: 100%;border-radius: 3%;" mode="widthFix" src="{{gl_skin_img['path']}}"></image>
  4 + <!-- <image wx:else style="width: 100%;border-radius: 3%;" mode="widthFix" src="{{gl_skin_img['path']}}"></image> -->
4 </view> 5 </view>
5 <view class="foot_btn"> 6 <view class="foot_btn">
6 - <view class="reset_select" bindtap="show_pai_pop"> 7 + <view class="reset_select" bindtap="takePhoto">
7 <text class="iconfont icon-zuojiantou" style="font-size: 40rpx"></text> 8 <text class="iconfont icon-zuojiantou" style="font-size: 40rpx"></text>
8 <text style="font-size: 28rpx">重拍</text> 9 <text style="font-size: 28rpx">重拍</text>
9 </view> 10 </view>
packageD/pages/AI-test-skin/select_photo/select_photo.wxss
@@ -23,9 +23,8 @@ page { @@ -23,9 +23,8 @@ page {
23 23
24 .foot_btn .ok_btn { 24 .foot_btn .ok_btn {
25 background: #5dd9dc; 25 background: #5dd9dc;
26 - padding: 0 50rpx; 26 + padding: 16rpx 40rpx;
27 border-radius: 50rpx; 27 border-radius: 50rpx;
28 /* margin: 0 auto; */ 28 /* margin: 0 auto; */
29 - line-height: 100rpx;  
30 color: #fff; 29 color: #fff;
31 } 30 }
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js
1 /* 1 /*
2 * @Author: abson 2 * @Author: abson
3 * @Date: 2022-02-15 10:01:57 3 * @Date: 2022-02-15 10:01:57
4 - * @LastEditTime: 2022-02-17 09:40:38 4 + * @LastEditTime: 2022-03-02 11:44:11
5 * @LastEditors: Please set LastEditors 5 * @LastEditors: Please set LastEditors
6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl
7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js
@@ -19,6 +19,10 @@ Page({ @@ -19,6 +19,10 @@ Page({
19 */ 19 */
20 data: { 20 data: {
21 iurl: setting.imghost, 21 iurl: setting.imghost,
  22 + notice_show: "",
  23 + skin_type: 0,
  24 + cWidth: 0,
  25 + cHeight: 0,
22 }, 26 },
23 27
24 /** 28 /**
@@ -32,7 +36,12 @@ Page({ @@ -32,7 +36,12 @@ Page({
32 * 生命周期函数--监听页面显示 36 * 生命周期函数--监听页面显示
33 */ 37 */
34 onShow: function () { 38 onShow: function () {
35 - 39 + let th = this;
  40 + setTimeout(() => {
  41 + th.setData({
  42 + notice_show: 'none',
  43 + })
  44 + }, 3000)
36 }, 45 },
37 46
38 /** 47 /**
@@ -64,23 +73,156 @@ Page({ @@ -64,23 +73,156 @@ Page({
64 }, 73 },
65 74
66 //从相册中选择图片 75 //从相册中选择图片
67 - show_pai_pop:function () { 76 + show_pai_pop: function () {
  77 + let th = this;
68 //选择和拍照一张图片 78 //选择和拍照一张图片
69 wx.chooseImage({ 79 wx.chooseImage({
70 count: 1, 80 count: 1,
71 sizeType: ['original', 'compressed'], 81 sizeType: ['original', 'compressed'],
72 sourceType: ['album', 'camera'], 82 sourceType: ['album', 'camera'],
73 - success (res) { 83 + success(res) {
74 let imgArr = res.tempFilePaths; 84 let imgArr = res.tempFilePaths;
75 - getApp().globalData.skin_img=imgArr[0];  
76 - let url = "/packageB/pages/AI-test-skin/select_photo/select_photo"; 85 + //
  86 + if (th.data.skin_type) {
  87 + imgArr = res.tempFiles;
  88 + }
  89 + console.log(imgArr);
  90 + getApp().globalData.skin_img_info = imgArr[0];
  91 + let url = "/packageD/pages/AI-test-skin/select_photo/select_photo";
77 app.goto(url); 92 app.goto(url);
78 } 93 }
79 }) 94 })
80 95
81 }, 96 },
82 97
  98 + //选择图片
  99 + takePhoto() {
  100 + var that = this;
83 101
84 -  
85 - 102 + wx.chooseImage({
  103 + count: 1,
  104 + sizeType: ['compressed'],
  105 + sourceType: ['album', 'camera'],
  106 + success(res) {
  107 + var tempFilePaths = res.tempFilePaths
  108 + console.log(tempFilePaths);
  109 + console.log(res.tempFiles[0].size / 1024 + 'kb');
  110 + var size1 =res.tempFiles[0].size;
  111 + var size = res.tempFiles[0].size / 1024; //kb单位
  112 + // tempFilePath可以作为img标签的src属性显示图片
  113 + var img = tempFilePaths[0];
  114 + that.setData({
  115 + imagesrc: img,
  116 + })
  117 + that.imgToMin(img, size,size1); //获取图片后压缩
  118 +
  119 + },
  120 + fail(err) {
  121 + console.log(err);
  122 + }
  123 + })
  124 + },
  125 + //图片转码64
  126 + base64(url, type) {
  127 + var that = this;
  128 + return new Promise((resolve, reject) => {
  129 + wx.getFileSystemManager().readFile({
  130 + filePath: url, //选择图片返回的相对路径
  131 + encoding: 'base64', //编码格式
  132 + success: res => {
  133 + resolve('data:image/' + type.toLocaleLowerCase() + ';base64,' + res.data)
  134 + // console.log(res.data);
  135 + // that.doDiscernment(res.data);//提交后台
  136 + },
  137 + fail: res => reject(res.errMsg)
  138 + })
  139 + })
  140 + },
  141 + //缩放图片
  142 + imgToMin(img, size,size1) {
  143 + var that = this;
  144 + //size小于100kb 时 直接转码识别
  145 + if (size < 1024) {
  146 + getApp().globalData.skin_img_info = {
  147 + path:img,
  148 + size,
  149 + }
  150 + let url = "/packageD/pages/AI-test-skin/select_photo/select_photo";
  151 + app.goto(url);
  152 + // that.base64(img,"jpg");
  153 + return;
  154 + }
  155 +
  156 + //先获取图片 然后根据长宽 缩小 之后获取图片
  157 + wx.getImageInfo({
  158 + src: img,
  159 + success(res) {
  160 + console.log(res.width)
  161 + console.log(res.height)
  162 + var ratio = size / 1024;
  163 + size1 = size1 / ratio;
  164 + var canvasWidth = res.width //图片原始长宽
  165 + var canvasHeight = res.height
  166 + //while (canvasWidth > 375 || canvasHeight > 520){// 保证宽高在400以内
  167 + canvasWidth = Math.trunc(canvasWidth / ratio)
  168 + canvasHeight = Math.trunc(canvasHeight / ratio)
  169 + //ratio++;
  170 + //}
  171 + that.setData({ canvasWidth: canvasWidth, canvasHeight: canvasHeight })
  172 + console.log(canvasWidth)
  173 + console.log(canvasHeight)
  174 + //绘制图片
  175 + var ctx = wx.createCanvasContext('attendCanvasId')
  176 + ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
  177 + ctx.draw(false, setTimeout(function () {
  178 + wx.canvasToTempFilePath({
  179 + canvasId: 'attendCanvasId',
  180 + width: canvasWidth,
  181 + height: canvasHeight,
  182 + destWidth: canvasWidth,
  183 + destHeight: canvasHeight,
  184 + fileType: 'jpg',
  185 + success: function (res) {
  186 + console.log(res.tempFilePath)//最终图片路径
  187 + that.setData({
  188 + canvasImgUrl: res.tempFilePath
  189 + });
  190 + getApp().globalData.skin_img_info = {
  191 + path:res.tempFilePath,
  192 + size:size1
  193 + };
  194 + let url = "/packageD/pages/AI-test-skin/select_photo/select_photo";
  195 + app.goto(url);
  196 + },
  197 + fail: function (res) {
  198 + console.log("缩放图片失败");
  199 + console.log(res.errMsg)
  200 + wx.hideLoading();
  201 + wx.showToast({
  202 + title: '识别图片失败',
  203 + image: '../../utils/img/wrong.png',
  204 + duration: 2000
  205 + })
  206 + that.setData({
  207 + title: "识别失败",
  208 + })
  209 + }
  210 + }, this) //要填写this对象,表示canvas这个对象
  211 + }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty
  212 + },
  213 + fail: function (res) {
  214 + console.log("获取图片失败");
  215 + console.log(res.errMsg)
  216 + wx.hideLoading();
  217 + wx.showToast({
  218 + title: '识别图片失败',
  219 + image: '../../utils/img/wrong.png',
  220 + duration: 2000
  221 + })
  222 + that.setData({
  223 + title: "识别失败",
  224 + })
  225 + },
  226 + })
  227 + },
86 }) 228 })
87 \ No newline at end of file 229 \ No newline at end of file
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml
1 <!--packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml--> 1 <!--packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml-->
2 <view class="content"> 2 <view class="content">
  3 + <view class="notice_show" style="display: {{notice_show}};">根据要求拍摄,测肤结果更准确。</view>
3 <view> 4 <view>
4 <view class="work">准备工作</view> 5 <view class="work">准备工作</view>
5 <view class="hengxian"></view> 6 <view class="hengxian"></view>
@@ -49,9 +50,12 @@ @@ -49,9 +50,12 @@
49 </view> 50 </view>
50 </view> 51 </view>
51 </view> 52 </view>
  53 +
  54 +<canvas canvas-id="attendCanvasId" style="width:{{canvasWidth}}px;height:{{canvasHeight}}px;position: absolute;z-index:1003;left:-500rpx;"></canvas>
  55 +
52 <view style="height: 300rpx;background-color: #e7f5fb;"> 56 <view style="height: 300rpx;background-color: #e7f5fb;">
53 <view class="btn_fixed"> 57 <view class="btn_fixed">
54 - <view class="btn" bindtap="show_pai_pop">准备闭眼拍摄</view> 58 + <view class="btn" bindtap="takePhoto">准备闭眼拍摄</view>
55 <view class="notice" style="display:flex;justify-content:center;align-items: center;"> 59 <view class="notice" style="display:flex;justify-content:center;align-items: center;">
56 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text> 60 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text>
57 <text>如无闭眼,将导致图片分析失败</text> 61 <text>如无闭眼,将导致图片分析失败</text>
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss
@@ -6,7 +6,31 @@ page { @@ -6,7 +6,31 @@ page {
6 box-sizing: border-box; 6 box-sizing: border-box;
7 background-color: #e7f5fb; 7 background-color: #e7f5fb;
8 } 8 }
  9 +
  10 +@keyframes notice_show {
  11 + 0% {
  12 + top: -999rpx;
  13 + }
  14 +
  15 + 100% {
  16 + top: 10rpx;
  17 + }
  18 +}
  19 +
  20 +.notice_show {
  21 + text-align: center;
  22 + padding: 30rpx;
  23 + color: skyblue;
  24 + position: absolute;
  25 + right: 10%;
  26 + box-shadow: #f0f0f0 0px 0px 5px;
  27 + z-index: 999;
  28 + background: #fff;
  29 + animation: 2s notice_show linear;
  30 +}
  31 +
9 .content { 32 .content {
  33 + position: relative;
10 width: 100%; 34 width: 100%;
11 /* height: 100%; */ 35 /* height: 100%; */
12 border-radius: 25rpx; 36 border-radius: 25rpx;
@@ -26,11 +50,12 @@ page { @@ -26,11 +50,12 @@ page {
26 align-items: center; 50 align-items: center;
27 margin-bottom: 40rpx 51 margin-bottom: 40rpx
28 } 52 }
  53 +
29 .content .ready1 { 54 .content .ready1 {
30 display: flex; 55 display: flex;
31 flex-direction: column; 56 flex-direction: column;
32 align-items: center; 57 align-items: center;
33 - padding-bottom: 50rpx ; 58 + padding-bottom: 50rpx;
34 /* margin-bottom: 40rpx */ 59 /* margin-bottom: 40rpx */
35 } 60 }
36 61
@@ -65,19 +90,21 @@ page { @@ -65,19 +90,21 @@ page {
65 .content image { 90 .content image {
66 height: 100%; 91 height: 100%;
67 } 92 }
  93 +
68 .btn { 94 .btn {
69 - 95 +
70 /* height: 150rpx; */ 96 /* height: 150rpx; */
71 /* margin-left: 50%; */ 97 /* margin-left: 50%; */
72 margin: 70rpx 0 30rpx 50%; 98 margin: 70rpx 0 30rpx 50%;
73 transform: translateX(-50%); 99 transform: translateX(-50%);
74 background: #4bd6df; 100 background: #4bd6df;
75 - padding: 20rpx; 101 + padding: 15rpx 15rpx;
76 width: 50%; 102 width: 50%;
77 text-align: center; 103 text-align: center;
78 - border-radius: 40rpx; 104 + border-radius: 50rpx;
79 color: #fff; 105 color: #fff;
80 } 106 }
  107 +
81 .btn_fixed { 108 .btn_fixed {
82 position: fixed; 109 position: fixed;
83 width: 100%; 110 width: 100%;
@@ -85,6 +112,7 @@ page { @@ -85,6 +112,7 @@ page {
85 height: 300rpx; 112 height: 300rpx;
86 background: #e7f5fb; 113 background: #e7f5fb;
87 } 114 }
  115 +
88 .notice { 116 .notice {
89 text-align: center; 117 text-align: center;
90 color: red; 118 color: red;
@@ -98,36 +126,71 @@ page { @@ -98,36 +126,71 @@ page {
98 right: 0; 126 right: 0;
99 bottom: 0; 127 bottom: 0;
100 z-index: 11; 128 z-index: 11;
101 - background: rgba(0,0,0,0.4); 129 + background: rgba(0, 0, 0, 0.4);
102 width: 100%; 130 width: 100%;
103 height: 100%; 131 height: 100%;
104 } 132 }
105 133
106 -.flex{display: flex}  
107 -.jc-center{ 134 +.flex {
  135 + display: flex
  136 +}
  137 +
  138 +.jc-center {
108 justify-content: center; 139 justify-content: center;
109 } 140 }
110 -.ac{align-items: center}  
111 -.pai_content{  
112 - position: fixed;z-index: 100;bottom: 0;background: #FFFFFF;width: 100%;  
113 - border-top-left-radius:30rpx;  
114 - border-top-right-radius:30rpx; 141 +
  142 +.ac {
  143 + align-items: center
115 } 144 }
116 -.p_item{ height: 100rpx; line-height: 100rpx;text-align: center; border-bottom: 1rpx solid #eee}  
117 -.p_cancle{height: 100rpx; line-height: 100rpx;text-align: center; border-top:20rpx solid #f8f8f8;}  
118 145
119 -@keyframes p_up  
120 -{  
121 - from {transform:translateY(100%);}  
122 - to {transform:translateY(0);} 146 +.pai_content {
  147 + position: fixed;
  148 + z-index: 100;
  149 + bottom: 0;
  150 + background: #FFFFFF;
  151 + width: 100%;
  152 + border-top-left-radius: 30rpx;
  153 + border-top-right-radius: 30rpx;
  154 +}
  155 +
  156 +.p_item {
  157 + height: 100rpx;
  158 + line-height: 100rpx;
  159 + text-align: center;
  160 + border-bottom: 1rpx solid #eee
  161 +}
  162 +
  163 +.p_cancle {
  164 + height: 100rpx;
  165 + line-height: 100rpx;
  166 + text-align: center;
  167 + border-top: 20rpx solid #f8f8f8;
123 } 168 }
124 169
125 -@keyframes p_down  
126 -{  
127 - from {transform:translateY(0);}  
128 - to {transform:translateY(100%);} 170 +@keyframes p_up {
  171 + from {
  172 + transform: translateY(100%);
  173 + }
  174 +
  175 + to {
  176 + transform: translateY(0);
  177 + }
129 } 178 }
130 -.p_to_up{animation:p_up 1s;}  
131 -.p_to_down{animation:p_down 0.5s;}  
132 179
  180 +@keyframes p_down {
  181 + from {
  182 + transform: translateY(0);
  183 + }
  184 +
  185 + to {
  186 + transform: translateY(100%);
  187 + }
  188 +}
  189 +
  190 +.p_to_up {
  191 + animation: p_up 1s;
  192 +}
133 193
  194 +.p_to_down {
  195 + animation: p_down 0.5s;
  196 +}
134 \ No newline at end of file 197 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/acne/acne.wxml
@@ -4,7 +4,11 @@ @@ -4,7 +4,11 @@
4 <view> 4 <view>
5 <view style="color: #45d4eb;">#0{{acne_sort}}</view> 5 <view style="color: #45d4eb;">#0{{acne_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 - <text style="font-size: 42rpx;" class="bold">痤疮</text> 7 + <!-- <text style="font-size: 42rpx;" class="bold">痤疮</text> -->
  8 + <view class="bold">
  9 + <text style="font-size: 42rpx;">痤疮</text>
  10 + <text class="iconfont icon-wenhao" style="margin-left:10rpx" catchtap="show_yiwen_dialog" data-yiwen_type="3"></text>
  11 + </view>
8 <view class="fs26" catchtap="show_dailog" data-type="6" style="display: flex;align-items: center;"> 12 <view class="fs26" catchtap="show_dailog" data-type="6" style="display: flex;align-items: center;">
9 <text>问题标注</text> 13 <text>问题标注</text>
10 <text class="iconfont icon-xia"></text> 14 <text class="iconfont icon-xia"></text>
packageD/pages/AI-test-skin/success_result/dark/dark.wxml
@@ -4,7 +4,11 @@ @@ -4,7 +4,11 @@
4 <view> 4 <view>
5 <view style="color: #45d4eb;">#0{{dark_sort}}</view> 5 <view style="color: #45d4eb;">#0{{dark_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 - <text style="font-size: 42rpx;" class="bold">黑眼圈</text> 7 + <!-- <text style="font-size: 42rpx;" class="bold">黑眼圈</text> -->
  8 + <view class="bold">
  9 + <text style="font-size: 42rpx;">黑眼圈</text>
  10 + <text class="iconfont icon-wenhao" style="margin-left:10rpx" catchtap="show_yiwen_dialog" data-yiwen_type="2"></text>
  11 + </view>
8 <view class="fs26" catchtap="show_dailog" data-type="5" style="display: flex;align-items: center;"> 12 <view class="fs26" catchtap="show_dailog" data-type="5" style="display: flex;align-items: center;">
9 <text>问题标注</text> 13 <text>问题标注</text>
10 <text class="iconfont icon-xia"></text> 14 <text class="iconfont icon-xia"></text>
@@ -39,15 +43,15 @@ @@ -39,15 +43,15 @@
39 <view class="leixing"> 43 <view class="leixing">
40 <view class="_img"> 44 <view class="_img">
41 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan4.jpeg"></image> 45 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan4.jpeg"></image>
42 - <view class="fs28">色素性-中度</view> 46 + <view class="fs28">色素性</view>
43 </view> 47 </view>
44 <view class="_img"> 48 <view class="_img">
45 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan5.jpeg"></image> 49 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan5.jpeg"></image>
46 - <view class="fs28">血管性-轻度</view> 50 + <view class="fs28">血管性</view>
47 </view> 51 </view>
48 <view class="_img"> 52 <view class="_img">
49 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan6.jpeg"></image> 53 <image style="height:150rpx;width:150rpx;border-radius: 50%;" src="{{iurl}}/miniapp/images/skinimg/nan6.jpeg"></image>
50 - <view class="fs28" style="color: #666;">阴影型-无</view> 54 + <view class="fs28" style="color: #666;">阴影型</view>
51 </view> 55 </view>
52 </view> 56 </view>
53 </block> 57 </block>
packageD/pages/AI-test-skin/success_result/pore/pore.wxml
@@ -4,7 +4,10 @@ @@ -4,7 +4,10 @@
4 <view> 4 <view>
5 <view style="color: #45d4eb;">#0{{port_sort}}</view> 5 <view style="color: #45d4eb;">#0{{port_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 - <text style="font-size: 42rpx;" class="bold">毛孔</text> 7 + <view class="bold">
  8 + <text style="font-size: 42rpx;">毛孔</text>
  9 + <!-- <text class="iconfont icon-info" style="margin-left:10rpx" catchtap="show_yiwen_dialog" data-yiwen_type="1"></text> -->
  10 + </view>
8 <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;"> 11 <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;">
9 <text>问题标注</text> 12 <text>问题标注</text>
10 <text class="iconfont icon-xia"></text> 13 <text class="iconfont icon-xia"></text>
packageD/pages/AI-test-skin/success_result/sensitive/sensitive.js
@@ -2,7 +2,6 @@ module.exports = { @@ -2,7 +2,6 @@ module.exports = {
2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
3 get_goods: function (th, stoid,sort) { 3 get_goods: function (th, stoid,sort) {
4 th.setData({sensitive_sort:sort}); 4 th.setData({sensitive_sort:sort});
5 -  
6 var r_code = '12'; 5 var r_code = '12';
7 //获取毛孔的类型 6 //获取毛孔的类型
8 var arr = th.data.face_data.skinquality.skin_sensitive_check; 7 var arr = th.data.face_data.skinquality.skin_sensitive_check;
packageD/pages/AI-test-skin/success_result/success_result.js
1 /* 1 /*
2 * @Author: abson 2 * @Author: abson
3 * @Date: 2022-02-16 15:36:47 3 * @Date: 2022-02-16 15:36:47
4 - * @LastEditTime: 2022-02-24 14:16:37 4 + * @LastEditTime: 2022-02-28 16:01:07
5 * @LastEditors: Please set LastEditors 5 * @LastEditors: Please set LastEditors
6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js
@@ -19,18 +19,23 @@ const dark = require(&#39;dark/dark&#39;); @@ -19,18 +19,23 @@ const dark = require(&#39;dark/dark&#39;);
19 const pore = require('pore/pore'); 19 const pore = require('pore/pore');
20 const speckle = require('speckle/speckle'); 20 const speckle = require('speckle/speckle');
21 const wrinkle = require('wrinkle/wrinkle'); 21 const wrinkle = require('wrinkle/wrinkle');
  22 +const sensitive = require('sensitive/sensitive')
22 Page({ 23 Page({
23 /** 24 /**
24 * 页面的初始数据 25 * 页面的初始数据
25 */ 26 */
26 data: { 27 data: {
27 - tab: [{ id: 'zong_he', name: '综合肤质' }, { id: 'mao_kong', name: '毛孔' }, { id: 'hei_tou', name: '黑头' }, { id: 'se_ban', name: '色斑' }, { id: 'zhou_wen', name: '皱纹' }, { id: 'hei_yan_quan', name: '黑眼圈' }, { id: 'cuo_chuang', name: '痤疮' }, { id: 'min_gan_du', name: '敏感度' }], 28 + // tab: [{ id: 'zong_he', name: '综合肤质' }, { id: 'mao_kong', name: '毛孔' }, { id: 'hei_tou', name: '黑头' }, { id: 'se_ban', name: '色斑' }, { id: 'zhou_wen', name: '皱纹' }, { id: 'hei_yan_quan', name: '黑眼圈' }, { id: 'cuo_chuang', name: '痤疮' }, { id: 'min_gan_du', name: '敏感度' }],
28 zhouwen_arr: [{ id: 1, name: '全部皱纹' }, { id: 2, name: '抬头纹' }, { id: 3, name: '川字纹' }, { id: 4, name: '眼周细纹' }, { id: 5, name: '鱼尾纹' }, { id: 6, name: '法令纹' }, { id: 7, name: '口周纹' }], 29 zhouwen_arr: [{ id: 1, name: '全部皱纹' }, { id: 2, name: '抬头纹' }, { id: 3, name: '川字纹' }, { id: 4, name: '眼周细纹' }, { id: 5, name: '鱼尾纹' }, { id: 6, name: '法令纹' }, { id: 7, name: '口周纹' }],
29 - cuochuang_arr: [{ id: 1, name: '全部痤疮' }, { id: 2, name: '粉刺 ' }, { id: 3, name: '痘印 ' }, { id: 4, name: '脓包' }, { id: 5, name: '结节'}], 30 + cuochuang_arr: [{ id: 1, name: '全部痤疮' }, { id: 2, name: '粉刺 ' }, { id: 3, name: '痘印 ' }, { id: 4, name: '脓包' }, { id: 5, name: '结节' }],
  31 + zhouwen_arr1: [{ id: 1, name: '皱纹/细纹', des: '是指皮肤受到外界环境影响,形成游离自由基,自由基破坏正常细胞膜组织内的胶原蛋白、活性物质,氧化细胞,或缺水而形成的小细纹,继而严重形成皱纹', sign: 'zhou1', sign1: 'zhou2' }, { id: 2, name: '抬头皱纹/抬头细纹', des: '位于额头的皱纹、细纹。形成原因因人而异,后天因素是比较少的。-般多为横纹, 竖纹较少见。', sign: 'zhou3', sign1: 'zhou4' }, { id: 3, name: '眼部皱纹/眼部细纹', des: '眼部皱纹、细纹一般位于下眼睑部位,多见于下脸内1/3处。', sign: 'zhou5', sign1: 'zhou6' }, { id: 4, name: '鱼尾纹', des: '眼部皱纹的一种,是在人两侧外眼角和登角之间出现的皱纹,其纹路与鱼尾巴上的纹路很相似,故被形象地称为鱼尾纹。', sign: 'zhou7', sign1: 'zhou8' }, { id: 5, name: '眉间纹', des: '又叫川字纹,皱眉纹,是面部的一种正常的表情纹,随着年龄的增长,面部的皱纹会逐渐加深,双眉之间逐渐形成了较深的皱折,会使人看起来总是愁眉不展。', sign: 'zhou9', sign1: 'zhou10' }, { id: 6, name: '泪沟', des: '泪沟是指由内眼角开始出现在下眼睑靠鼻侧的两条凹沟,是由于眼眶隔膜下缘的软组织萎缩、下垂而生成的。', sign: 'zhou11', sign1: 'zhou12' }, { id: 7, name: '法令纹', des: '法令纹是位于鼻翼边延伸而下的两道纹路,是典型的皮肤组织老化、造成肌肤表面凹陷的现象。', sign: 'zhou15', sign1: 'zhou16' }, { id: 8, name: '口角纹', des: '口角纹又称木偶纹、括号纹,位于嘴角延伸而下的两道纹路,是表情肌、重力和遗传基因等几方面因素综合形成的。', sign: 'zhou13', sign1: 'zhou14' }],
  32 + cuochuang_arr1: [{ id: 1, name: '痘印,痘坑', des: '痤疮消退后留下的痕迹,- 般包括黑色痘印,红色痘印,凹洞性痘坑,增生性凸疤。', sign: 'cuo1', sign1: 'cuo2' }, { id: 2, name: '粉刺', des: '粉刺也称为白头,是毛囊漏斗部被角质层细胞堆积、堵塞,角化物质和皮脂充塞其中,形成白色丘疹,表面有表皮覆盖,与外界不相通,成为封闭式粉刺。(痤疮I级)', sign: 'cuo3', sign1: 'cuo4' }, { id: 3, name: '丘疹', des: '丘疹性痤疮是由皮损导致炎性弓|起的小米至豌豆大的坚硬的小丘疹,呈淡红色至深红色。丘疹中央可有一个黑头粉刺或顶端未变黑的皮脂栓。(痤疮II级)', sign: 'cuo5', sign1: 'cuo6' }, { id: 4, name: '结节囊肿', des: '表现为蚕豆至指甲大的炎性结节或囊肿,为重度痤疮,严重者可继发化脓感染、破溃流出血脓,后形成窦道及瘢痕。触摸有波动感。若面部相邻长着多个囊肿,可能通过皮下的“窦道"“暗通,可能需要手术解决。(痤疮IV级)', sign: 'cuo7', sign1: 'cuo8' }],
30 heitanquan_arr: [{ id: 1, name: '综合情况' }, { id: 2, name: '左眼' }, { id: 3, name: '右眼' }], 33 heitanquan_arr: [{ id: 1, name: '综合情况' }, { id: 2, name: '左眼' }, { id: 3, name: '右眼' }],
  34 + heitanquan_arr1: [{ id: 1, name: '色素性黑眼圈', des: '呈茶褐色,是因眼裂向外眼角的延伸段有色素沉着或因先天或外来刺激导致眼周肤色黯沉。', sign: 'hei1', sign1: 'hei2' }, { id: 2, name: '血管性黑眼圈', des: '呈青紫色,由于眼周血液循环不良,下眼脸处皮肤与皮下脂肪变薄,皮下血管透出颜色形成的。', sign: 'hei3', sign1: 'hei4' }, { id: 3, name: '阴影型黑眼圈', des: '表现为眼袋膨出、泪沟凹陷。由于年龄的增长,眼周皮肤肌肉都会变得松弛,脂肪量变化而引起。', sign: 'hei5', sign1: 'hei6' }],
31 currentIndex: 0, 35 currentIndex: 0,
32 scroll_index: 0, 36 scroll_index: 0,
33 - sex:'female', //female女 male男 37 + yiwen_index: 0,
  38 + sex: 'female', //female女 male男
34 tab_id: 'zong_he', 39 tab_id: 'zong_he',
35 iurl: setting.imghost, 40 iurl: setting.imghost,
36 showDialog: false, 41 showDialog: false,
@@ -40,21 +45,32 @@ Page({ @@ -40,21 +45,32 @@ Page({
40 img_scale_icon: true, 45 img_scale_icon: true,
41 show_problem: 1, //问题标注显示问题 46 show_problem: 1, //问题标注显示问题
42 img_scale: 1, //缩放问题 47 img_scale: 1, //缩放问题
43 - sex:'',  
44 - is_esys_show:0, //是不是显示眼睛  
45 - scroll_id:1, //初始为1  
46 -  
47 - wrinkle_num1:0, //抬头纹  
48 - wrinkle_num2:0, //川字纹  
49 - wrinkle_num3:0, //眼周细纹  
50 - wrinkle_num4:0, //鱼尾纹  
51 - wrinkle_num5:0, //法令纹  
52 - wrinkle_num6:0, //口周纹 48 + sex: '',
  49 + is_esys_show: 0, //是不是显示眼睛
  50 + scroll_id: 1, //初始为1
  51 +
  52 + wrinkle_num1: 0, //抬头纹
  53 + wrinkle_num2: 0, //川字纹
  54 + wrinkle_num3: 0, //眼周细纹
  55 + wrinkle_num4: 0, //鱼尾纹
  56 + wrinkle_num5: 0, //法令纹
  57 + wrinkle_num6: 0, //口周纹
  58 + yiwen_type: 0, //1皱纹 2黑眼圈 3痤疮
  59 + acne_num1: 0, //粉刺
  60 + acne_num2: 0, //痘印
  61 + acne_num3: 0, //脓包
  62 + acne_num4: 0, //结节
  63 + },
53 64
54 - acne_num1:0, //粉刺  
55 - acne_num2:0, //痘印  
56 - acne_num3:0, //脓包  
57 - acne_num4:0, //结节 65 + onReady: function () {
  66 + //用异步的获取比较准一点
  67 + wx.getSystemInfo({
  68 + success(res) {
  69 + console.log(111);
  70 + console.log(res.windowWidth);
  71 + console.log(res.windowHeight);
  72 + }
  73 + })
58 }, 74 },
59 75
60 /** 76 /**
@@ -69,211 +85,243 @@ Page({ @@ -69,211 +85,243 @@ Page({
69 //var face_data=face_result.face_list[0]; 85 //var face_data=face_result.face_list[0];
70 this.data.id = options.id; 86 this.data.id = options.id;
71 87
72 - //计算图片要显示的大小  
73 - th.data.cWidth = wx.getSystemInfoSync().windowWidth;  
74 - th.data.cHeight = wx.getSystemInfoSync().windowHeight;  
75 - th.data.face_height = th.data.cHeight * 0.8 * 0.75;  
76 -  
77 - var bi1= (th.data.cHeight * 0.8 * 0.8)/(th.data.cWidth*0.8);  
78 - this.get_data(function (json, json1, img) {  
79 - //-- 数据先存着 --  
80 - var face_data = th.data.face_data = json.face_list[0];  
81 - var face_data1 = th.data.face_data1 = json1.face_list[0];  
82 - var sex = face_data1.gender.type;  
83 - //痤疮数  
84 - var acne_num = face_data.acnespotmole.acne_num;  
85 - //色斑数  
86 - var speckle_num = face_data.acnespotmole.speckle_num;  
87 - //皱纹数  
88 - var wrinkle_num = face_data.wrinkle.wrinkle_num;  
89 - //黑头数  
90 - var blackhead_num = face_data.blackheadpore.blackhead_num;  
91 - //毛孔数  
92 - var pore_num = face_data.blackheadpore.pore_num;  
93 - //黑眼圈的严重程度  
94 - var dark_type = face_data.eyesattr.dark_circle_left_type.length > 0 ? face_data.eyesattr.dark_circle_left_type[0] : -1;  
95 - var dark_type1 = face_data.eyesattr.dark_circle_right_type.length > 0 ? face_data.eyesattr.dark_circle_right_type[0] : -1;  
96 -  
97 - var dk_type1=dark_type;  
98 - var dk_type2=dark_type1;  
99 - if (dark_type1 > dark_type) {  
100 - dark_type = dark_type1;  
101 - }  
102 - var skin_sensitive_check = parseInt(face_data.skinquality.skin_sensitive_check[0]);  
103 - var skin_dryoil_check = face_data.skinquality.skin_dryoil_check;  
104 -  
105 - var location = face_data.location;  
106 - var bili = th.data.face_height / (location.height + location.height / 2.3);  
107 -  
108 - //获取眼睛的画图比例  
109 - var eye_data1=face_data1.landmark150.eye_left_corner_right;  
110 - var eye_data2=face_data1.landmark150.eye_left_corner_left;  
111 - var eye_data3=face_data1.landmark150.eye_right_corner_left;  
112 -  
113 - var hei1=Math.abs(eye_data1.x-eye_data2.x);  
114 - var bili_eye = th.data.face_height /(2*hei1*bi1);  
115 - var eye_top=eye_data1.y-hei1*3/4  
116 - var eye_left1=eye_data1.x-hei1/2;  
117 - var eye_left2=eye_data3.x-hei1-hei1/2;  
118 -  
119 - var skin_dryoil_check_type=0;//干性  
120 - var skin_dryoil_check_arr=[]  
121 - for(let i in skin_dryoil_check){  
122 - let item=skin_dryoil_check[i];  
123 - if(item!='1' && skin_dryoil_check_arr.indexOf(item)==-1){  
124 - skin_dryoil_check_arr.push(item);  
125 - }  
126 - }  
127 - //皮肤干油性的判断  
128 - if(skin_dryoil_check_arr.length==0) skin_dryoil_check_type=1;  
129 - else if(skin_dryoil_check_arr.length==1) skin_dryoil_check_type=parseInt(skin_dryoil_check_arr[0]);  
130 - else skin_dryoil_check_type=3;  
131 -  
132 - var wrinkle_types=face_data.wrinkle.wrinkle_types;  
133 - var w_arr=wrinkle_types.filter(function (e) {  
134 - return e==1;  
135 - })  
136 - th.data.wrinkle_num1=w_arr.length; 88 + //用异步的获取比较准一点
  89 + wx.getSystemInfo({
  90 + success(res) {
  91 + //计算图片要显示的大小
  92 + th.data.cWidth = res.windowWidth;
  93 + th.data.cHeight = res.windowHeight;
  94 +
  95 + console.log(222);
  96 + console.log(res.windowWidth);
  97 + console.log(res.windowHeight);
  98 +
  99 +
  100 + th.data.face_height = th.data.cHeight * 0.8 * 0.75;
  101 +
  102 + var bi1 = (th.data.cHeight * 0.8 * 0.8) / (th.data.cWidth * 0.8);
  103 + th.get_data(function (json, json1, img) {
  104 + //-- 数据先存着 --
  105 + var face_data = th.data.face_data = json.face_list[0];
  106 + var face_data1 = th.data.face_data1 = json1.face_list[0];
  107 + var sex = face_data1.gender.type;
  108 + //痤疮数
  109 + var acne_num = face_data.acnespotmole.acne_num;
  110 + //色斑数
  111 + var speckle_num = face_data.acnespotmole.speckle_num;
  112 + //皱纹数
  113 + var wrinkle_num = face_data.wrinkle.wrinkle_num;
  114 + //黑头数
  115 + var blackhead_num = face_data.blackheadpore.blackhead_num;
  116 + //毛孔数
  117 + var pore_num = face_data.blackheadpore.pore_num;
  118 + //黑眼圈的严重程度
  119 + var dark_type = face_data.eyesattr.dark_circle_left_type.length > 0 ? face_data.eyesattr.dark_circle_left_type[0] : -1;
  120 + var dark_type1 = face_data.eyesattr.dark_circle_right_type.length > 0 ? face_data.eyesattr.dark_circle_right_type[0] : -1;
  121 +
  122 + var dk_type1 = dark_type;
  123 + var dk_type2 = dark_type1;
  124 + if (dark_type1 > dark_type) {
  125 + dark_type = dark_type1;
  126 + }
  127 + var skin_sensitive_check = parseInt(face_data.skinquality.skin_sensitive_check[0]);
  128 + var skin_dryoil_check = face_data.skinquality.skin_dryoil_check;
  129 +
  130 + var location = face_data.location;
  131 + var bili = th.data.face_height * 0.76 / location.height;
  132 +
  133 + //获取眼睛的画图比例
  134 + var eye_data1 = face_data1.landmark150.eye_left_corner_right;
  135 + var eye_data2 = face_data1.landmark150.eye_left_corner_left;
  136 + var eye_data3 = face_data1.landmark150.eye_right_corner_right;
  137 +
  138 + var hei1 = Math.abs(eye_data1.x - eye_data2.x);
  139 + var bili_eye = th.data.face_height * 0.56 / hei1;
  140 + var eye_top = eye_data1.y - hei1 / 2
  141 + var eye_left1 = eye_data1.x - hei1 / 6;
  142 + var eye_left2 = eye_data3.x - hei1 / 6;
  143 +
  144 + var skin_dryoil_check_type = 0;//干性
  145 + var skin_dryoil_check_arr = []
  146 + for (let i in skin_dryoil_check) {
  147 + let item = skin_dryoil_check[i];
  148 + if (item != '1' && skin_dryoil_check_arr.indexOf(item) == -1) {
  149 + skin_dryoil_check_arr.push(item);
  150 + }
  151 + }
  152 + //皮肤干油性的判断
  153 + if (skin_dryoil_check_arr.length == 0) skin_dryoil_check_type = 1;
  154 + else if (skin_dryoil_check_arr.length == 1) skin_dryoil_check_type = parseInt(skin_dryoil_check_arr[0]);
  155 + else skin_dryoil_check_type = 3;
  156 +
  157 + var wrinkle_types = face_data.wrinkle.wrinkle_types;
  158 + var w_arr = wrinkle_types.filter(function (e) {
  159 + return e == 1;
  160 + })
  161 + th.data.wrinkle_num1 = w_arr.length;
137 162
138 - //皱纹的数量的统计  
139 - w_arr=wrinkle_types.filter(function (e) {  
140 - return e==2;  
141 - })  
142 - th.data.wrinkle_num2=w_arr.length;  
143 - w_arr=wrinkle_types.filter(function (e) {  
144 - return e==3;  
145 - })  
146 - th.data.wrinkle_num3=w_arr.length;  
147 - w_arr=wrinkle_types.filter(function (e) {  
148 - return e==4;  
149 - })  
150 - th.data.wrinkle_num4=w_arr.length;  
151 - w_arr=wrinkle_types.filter(function (e) {  
152 - return e==5;  
153 - })  
154 - th.data.wrinkle_num5=w_arr.length;  
155 - w_arr=wrinkle_types.filter(function (e) {  
156 - return e==6;  
157 - })  
158 - th.data.wrinkle_num6=w_arr.length; 163 + //皱纹的数量的统计
  164 + w_arr = wrinkle_types.filter(function (e) {
  165 + return e == 2;
  166 + })
  167 + th.data.wrinkle_num2 = w_arr.length;
  168 + w_arr = wrinkle_types.filter(function (e) {
  169 + return e == 3;
  170 + })
  171 + th.data.wrinkle_num3 = w_arr.length;
  172 + w_arr = wrinkle_types.filter(function (e) {
  173 + return e == 4;
  174 + })
  175 + th.data.wrinkle_num4 = w_arr.length;
  176 + w_arr = wrinkle_types.filter(function (e) {
  177 + return e == 5;
  178 + })
  179 + th.data.wrinkle_num5 = w_arr.length;
  180 + w_arr = wrinkle_types.filter(function (e) {
  181 + return e == 6;
  182 + })
  183 + th.data.wrinkle_num6 = w_arr.length;
159 184
160 - //痘痘的不同的统计  
161 - var acne_list = face_data.acnespotmole.acne_list;  
162 - var a_arr=acne_list.filter(function (e) {  
163 - return e.type==0;  
164 - })  
165 - th.data.acne_num1=a_arr.length;  
166 - a_arr=acne_list.filter(function (e) {  
167 - return e.type==1;  
168 - })  
169 - th.data.acne_num2=a_arr.length;  
170 - a_arr=acne_list.filter(function (e) {  
171 - return e.type==2;  
172 - })  
173 - th.data.acne_num3=a_arr.length;  
174 - a_arr=acne_list.filter(function (e) {  
175 - return e.type==3;  
176 - })  
177 - th.data.acne_num4=a_arr.length;  
178 -  
179 - th.setData({  
180 - acne_num: acne_num,  
181 - speckle_num: speckle_num,  
182 - wrinkle_num: wrinkle_num,  
183 - wrinkle_types:wrinkle_types, //皱纹类型  
184 - blackhead_num: blackhead_num,  
185 - pore_num: pore_num,  
186 - dark_type: dark_type,  
187 - dark_typ1: dk_type1,  
188 - dark_type2: dk_type2,  
189 - skin_sensitive_check: skin_sensitive_check,  
190 - skin_dryoil_check: skin_dryoil_check,  
191 - skin_dryoil_check_type:skin_dryoil_check_type,  
192 - face_img: img,  
193 - m_top: (location.top - location.height / 2.5) * bili,  
194 - m_left: (location.left - location.width / 7) * bili,  
195 - bili: bili,  
196 - bili_eye:bili_eye,  
197 - sex:sex,  
198 - skin_dryoil_check_type:skin_dryoil_check_type,  
199 - eye_top:eye_top,  
200 - eye_left1:eye_left1* bili_eye,  
201 - eye_left2:eye_left2* bili_eye,  
202 -  
203 - wrinkle_num1:th.data.wrinkle_num1, //抬头纹  
204 - wrinkle_num2:th.data.wrinkle_num2, //川字纹  
205 - wrinkle_num3:th.data.wrinkle_num3, //眼周细纹  
206 - wrinkle_num4:th.data.wrinkle_num4, //鱼尾纹  
207 - wrinkle_num5:th.data.wrinkle_num5, //法令纹  
208 - wrinkle_num6:th.data.wrinkle_num6, //口周纹  
209 -  
210 - acne_num1:th.data.acne_num1, //粉刺  
211 - acne_num2:th.data.acne_num2, //痘印  
212 - acne_num3:th.data.acne_num3, //脓包  
213 - acne_num4:th.data.acne_num4, //结节  
214 - })  
215 - var sort = 1;  
216 - //-- 调用毛孔的推荐函数 --  
217 - if (pore_num > 0)  
218 - pore.get_goods(th, setting.stoid, sort++);  
219 - //-- 调用黑头的推荐函数 --  
220 - if (blackhead_num > 0)  
221 - blackhead.get_goods(th, setting.stoid, sort++);  
222 - //-- 调用色斑的推荐函数 --  
223 - if (speckle_num > 0)  
224 - speckle.get_goods(th, setting.stoid, sort++);  
225 - //-- 调用皱纹的推荐函数 --  
226 - if (wrinkle_num > 0)  
227 - wrinkle.get_goods(th, setting.stoid, sort++);  
228 - //-- 黑眼圈 --  
229 - if (dark_type > -1)  
230 - dark.get_goods(th, setting.stoid, sort++);  
231 - //-- 黑眼圈 --  
232 - if (acne_num > -0)  
233 - acne.get_goods(th, setting.stoid, sort++);  
234 -  
235 - //-- 获取一下分享要用的图片 --  
236 - th.set_share_img();  
237 - acne.get_goods(th, setting.stoid);  
238 - let { heightRecord, tab } = th.data;  
239 - tab.forEach(item => {  
240 - console.log(2);  
241 - var query = th.createSelectorQuery();  
242 - let class_name = `.${item['id']}`;  
243 - query.select(class_name).boundingClientRect(function (rect) {  
244 - // let ratio = 750 / rect.width;  
245 - let height = parseInt(rect.height); //加上导航栏50px  
246 - heightRecord.push(height);  
247 - // item['top'] = top;  
248 - }).exec();  
249 - });  
250 - heightRecord.sort((a, b) => {  
251 - return a - b;  
252 - });  
253 - th.setData({  
254 - heightRecord,  
255 - })  
256 - // setTimeout(() => {  
257 - // heightRecord.sort((a, b) => {  
258 - // return a - b;  
259 - // })  
260 - // let new_arr = [];  
261 - // if (heightRecord.length > 0) {  
262 - // heightRecord.reduce((pre, cur) => {  
263 - // let sum = pre + cur;  
264 - // new_arr.push(sum);  
265 - // return sum;  
266 - // })  
267 - // }  
268 - // th.setData({  
269 - // heightRecord:new_arr,  
270 - // })  
271 - // },1000) 185 + //痘痘的不同的统计
  186 + var acne_list = face_data.acnespotmole.acne_list;
  187 + var a_arr = acne_list.filter(function (e) {
  188 + return e.type == 0;
  189 + })
  190 + th.data.acne_num1 = a_arr.length;
  191 + a_arr = acne_list.filter(function (e) {
  192 + return e.type == 1;
  193 + })
  194 + th.data.acne_num2 = a_arr.length;
  195 + a_arr = acne_list.filter(function (e) {
  196 + return e.type == 2;
  197 + })
  198 + th.data.acne_num3 = a_arr.length;
  199 + a_arr = acne_list.filter(function (e) {
  200 + return e.type == 3;
  201 + })
  202 + th.data.acne_num4 = a_arr.length;
  203 + let tab_arr = [{ id: 'zong_he', name: '综合肤质' }];
  204 + if (pore_num) {
  205 + tab_arr.push({ id: 'mao_kong', name: '毛孔' });
  206 + }
  207 + if (blackhead_num) {
  208 + tab_arr.push({ id: 'hei_tou', name: '黑头' });
  209 + }
  210 + if (speckle_num) {
  211 + tab_arr.push({ id: 'se_ban', name: '色斑' });
  212 + }
  213 + if (wrinkle_num) {
  214 + tab_arr.push({ id: 'zhou_wen', name: '皱纹' });
  215 + }
  216 + if (dark_type > -1) {
  217 + tab_arr.push({ id: 'hei_yan_quan', name: '黑眼圈' });
  218 + }
  219 + if (acne_num) {
  220 + tab_arr.push({ id: 'cuo_chuang', name: '痤疮' });
  221 + }
  222 + tab_arr.push({ id: 'min_gan_du', name: '敏感度' });
  223 + th.setData({
  224 + acne_num: acne_num,
  225 + speckle_num: speckle_num,
  226 + wrinkle_num: wrinkle_num,
  227 + wrinkle_types: wrinkle_types, //皱纹类型
  228 + blackhead_num: blackhead_num,
  229 + pore_num: pore_num,
  230 + dark_type: dark_type,
  231 + dark_typ1: dk_type1,
  232 + dark_type2: dk_type2,
  233 + skin_sensitive_check: skin_sensitive_check,
  234 + skin_dryoil_check: skin_dryoil_check,
  235 + skin_dryoil_check_type: skin_dryoil_check_type,
  236 + face_img: img,
  237 + m_top: (location.top - location.height / 3) * bili,
  238 + m_left: Math.abs(th.data.cWidth * 0.8 - (location.width + location.left * 2) * bili) / 2,
  239 + bili: bili,
  240 + bili_eye: bili_eye,
  241 + sex: sex,
  242 + tab: tab_arr,
  243 + skin_dryoil_check_type: skin_dryoil_check_type,
  244 + eye_top: eye_top * bili_eye,
  245 + eye_left1: eye_left1 * bili_eye,
  246 + eye_left2: eye_left2 * bili_eye,
  247 +
  248 + wrinkle_num1: th.data.wrinkle_num1, //抬头纹
  249 + wrinkle_num2: th.data.wrinkle_num2, //川字纹
  250 + wrinkle_num3: th.data.wrinkle_num3, //眼周细纹
  251 + wrinkle_num4: th.data.wrinkle_num4, //鱼尾纹
  252 + wrinkle_num5: th.data.wrinkle_num5, //法令纹
  253 + wrinkle_num6: th.data.wrinkle_num6, //口周纹
  254 +
  255 + acne_num1: th.data.acne_num1, //粉刺
  256 + acne_num2: th.data.acne_num2, //痘印
  257 + acne_num3: th.data.acne_num3, //脓包
  258 + acne_num4: th.data.acne_num4, //结节
  259 + })
  260 + var sort = 1;
  261 + //-- 调用毛孔的推荐函数 --
  262 + if (pore_num > 0)
  263 + pore.get_goods(th, setting.stoid, sort++);
  264 + //-- 调用黑头的推荐函数 --
  265 + if (blackhead_num > 0)
  266 + blackhead.get_goods(th, setting.stoid, sort++);
  267 + //-- 调用色斑的推荐函数 --
  268 + if (speckle_num > 0)
  269 + speckle.get_goods(th, setting.stoid, sort++);
  270 + //-- 调用皱纹的推荐函数 --
  271 + if (wrinkle_num > 0)
  272 + wrinkle.get_goods(th, setting.stoid, sort++);
  273 + //-- 黑眼圈 --
  274 + if (dark_type > -1)
  275 + dark.get_goods(th, setting.stoid, sort++);
  276 + //-- 黑眼圈 --
  277 + if (acne_num > -0)
  278 + acne.get_goods(th, setting.stoid, sort++);
  279 + sensitive.get_goods(th, setting.stoid, sort++);
  280 + //-- 获取一下分享要用的图片 --
  281 + th.set_share_img();
  282 + acne.get_goods(th, setting.stoid);
  283 + // let { heightRecord, tab } = th.data;
  284 + // tab.forEach(item => {
  285 + // console.log(2);
  286 + // var query = th.createSelectorQuery();
  287 + // let class_name = `.${item['id']}`;
  288 + // query.select(class_name).boundingClientRect(function (rect) {
  289 + // // let ratio = 750 / rect.width;
  290 + // let height = parseInt(rect.height); //加上导航栏50px
  291 + // heightRecord.push(height);
  292 + // // item['top'] = top;
  293 + // }).exec();
  294 + // });
  295 + // heightRecord.sort((a, b) => {
  296 + // return a - b;
  297 + // });
  298 + // th.setData({
  299 + // heightRecord,
  300 + // })
  301 + // setTimeout(() => {
  302 + // heightRecord.sort((a, b) => {
  303 + // return a - b;
  304 + // })
  305 + // let new_arr = [];
  306 + // if (heightRecord.length > 0) {
  307 + // heightRecord.reduce((pre, cur) => {
  308 + // let sum = pre + cur;
  309 + // new_arr.push(sum);
  310 + // return sum;
  311 + // })
  312 + // }
  313 + // th.setData({
  314 + // heightRecord:new_arr,
  315 + // })
  316 + // },1000)
272 317
273 - })  
274 318
  319 + })
  320 + }
  321 + })
275 }, 322 },
276 323
  324 +
277 //-- 初始等级卡 -- 325 //-- 初始等级卡 --
278 init: function () { 326 init: function () {
279 var th = this; 327 var th = this;
@@ -384,25 +432,25 @@ Page({ @@ -384,25 +432,25 @@ Page({
384 }, 432 },
385 433
386 click_scroll(e) { 434 click_scroll(e) {
387 - let { index, scroll_id} = e.currentTarget.dataset; 435 + let { index, scroll_id } = e.currentTarget.dataset;
388 this.setData({ 436 this.setData({
389 scroll_index: index, 437 scroll_index: index,
390 scroll_id, 438 scroll_id,
391 }) 439 })
392 440
393 //-- 如果是黑眼圈的控制 -- 441 //-- 如果是黑眼圈的控制 --
394 - if(this.data.show_type==5){  
395 - switch (scroll_id){  
396 - case 1:  
397 - this.setData({is_esys_show:0})  
398 - break;  
399 - case 2:  
400 - this.setData({is_esys_show:1})  
401 - break;  
402 - default:  
403 - this.setData({is_esys_show:2})  
404 - break  
405 - } 442 + if (this.data.show_type == 5) {
  443 + switch (scroll_id) {
  444 + case 1:
  445 + this.setData({ is_esys_show: 0 })
  446 + break;
  447 + case 2:
  448 + this.setData({ is_esys_show: 1 })
  449 + break;
  450 + default:
  451 + this.setData({ is_esys_show: 2 })
  452 + break
  453 + }
406 } 454 }
407 }, 455 },
408 456
@@ -427,7 +475,23 @@ Page({ @@ -427,7 +475,23 @@ Page({
427 this.setData({ 475 this.setData({
428 img_scale: !this.data.img_scale, 476 img_scale: !this.data.img_scale,
429 img_scale_icon: !this.data.yanjing, 477 img_scale_icon: !this.data.yanjing,
430 - ig_scale:1,img_top:0,img_left:0 478 + ig_scale: 1, img_top: 0, img_left: 0
  479 + })
  480 + },
  481 +
  482 + click_yiwen_scroll(e) {
  483 + let { index, yiwen_id } = e.currentTarget.dataset;
  484 + this.setData({
  485 + yiwen_index: index,
  486 + yiwen_id,
  487 + })
  488 + },
  489 +
  490 + close_yiwen() {
  491 + this.setData({
  492 + question_dialog: false,
  493 + yiwen_index: 0,
  494 + yiwen_id: 'yiwen1'
431 }) 495 })
432 }, 496 },
433 497
@@ -445,15 +509,17 @@ Page({ @@ -445,15 +509,17 @@ Page({
445 509
446 }, 510 },
447 show_dailog(e) { 511 show_dailog(e) {
448 - var th=this; 512 + var th = this;
449 var type = parseInt(e.currentTarget.dataset.type); 513 var type = parseInt(e.currentTarget.dataset.type);
450 this.setData({ 514 this.setData({
451 - showDialog: true, show_type: type,is_esys_show:0,ig_scale:1,img_top:0,img_left:0,scroll_index:0,scroll_id:1 515 + showDialog: true, show_type: type, is_esys_show: 0, ig_scale: 1, img_top: 0, img_left: 0, scroll_index: 0, scroll_id: 1
452 }) 516 })
453 switch (type) { 517 switch (type) {
454 case 1: //毛孔 518 case 1: //毛孔
455 - var pore_list = this.data.face_data.blackheadpore.circles[0].pore;  
456 - this.setData({ pore_list: pore_list }); 519 + var pore_list = this.data.face_data.blackheadpore.circles.filter(function (e) {
  520 + return e.pore
  521 + })
  522 + this.setData({ pore_list: pore_list[0].pore });
457 break; 523 break;
458 case 2://色斑 524 case 2://色斑
459 var speckle_list = this.data.face_data.acnespotmole.speckle_list; 525 var speckle_list = this.data.face_data.acnespotmole.speckle_list;
@@ -461,18 +527,20 @@ Page({ @@ -461,18 +527,20 @@ Page({
461 break; 527 break;
462 case 3://皱纹 528 case 3://皱纹
463 var wrinkle_list = this.data.face_data.wrinkle.wrinkle_data; 529 var wrinkle_list = this.data.face_data.wrinkle.wrinkle_data;
464 - for(let i in wrinkle_list){  
465 - let item=wrinkle_list[i]; 530 + for (let i in wrinkle_list) {
  531 + let item = wrinkle_list[i];
466 item.map(function (e) { 532 item.map(function (e) {
467 - e.w_type=th.data.wrinkle_types[i]; 533 + e.w_type = th.data.wrinkle_types[i];
468 return e; 534 return e;
469 }) 535 })
470 } 536 }
471 this.setData({ wrinkle_list: wrinkle_list }); 537 this.setData({ wrinkle_list: wrinkle_list });
472 break; 538 break;
473 case 4://黑头 539 case 4://黑头
474 - var blackhead_list = this.data.face_data.blackheadpore.circles[0].blackhead;  
475 - this.setData({ blackhead_list: blackhead_list }); 540 + var blackhead_list = this.data.face_data.blackheadpore.circles.filter(function (e) {
  541 + return e.blackhead
  542 + })
  543 + this.setData({ blackhead_list: blackhead_list[0].blackhead });
476 break; 544 break;
477 case 5://黑眼圈 545 case 5://黑眼圈
478 var arr = this.data.face_data.eyesattr.dark_circle_left[0]; 546 var arr = this.data.face_data.eyesattr.dark_circle_left[0];
@@ -589,8 +657,8 @@ Page({ @@ -589,8 +657,8 @@ Page({
589 this.setData({ 657 this.setData({
590 iwidth: imgwidth * th.data.bili, 658 iwidth: imgwidth * th.data.bili,
591 iheight: imgheight * th.data.bili, 659 iheight: imgheight * th.data.bili,
592 - eye_w:imgwidth*th.data.bili_eye,  
593 - eye_h:imgheight*th.data.bili_eye, 660 + eye_w: imgwidth * th.data.bili_eye,
  661 + eye_h: imgheight * th.data.bili_eye,
594 bili1: w / imgwidth //图片放大时候的比例 662 bili1: w / imgwidth //图片放大时候的比例
595 }) 663 })
596 }, 664 },
@@ -650,7 +718,7 @@ Page({ @@ -650,7 +718,7 @@ Page({
650 touchendCallback: function (e) { 718 touchendCallback: function (e) {
651 this.data.tc_end = 1; 719 this.data.tc_end = 1;
652 720
653 - }, 721 + },
654 722
655 //--定义的保存图片方法,分享团--- 723 //--定义的保存图片方法,分享团---
656 saveImageToPhotosAlbum: function () { 724 saveImageToPhotosAlbum: function () {
@@ -665,7 +733,7 @@ Page({ @@ -665,7 +733,7 @@ Page({
665 if (this.data.share_hidden) { 733 if (this.data.share_hidden) {
666 this.setData({ share_hidden: false, }); 734 this.setData({ share_hidden: false, });
667 } 735 }
668 - ; 736 +
669 737
670 wx.showLoading({ title: '生成中...', }) 738 wx.showLoading({ title: '生成中...', })
671 var that = this, th = that; 739 var that = this, th = that;
@@ -686,93 +754,92 @@ Page({ @@ -686,93 +754,92 @@ Page({
686 wx.getImageInfo({ 754 wx.getImageInfo({
687 src: path3, 755 src: path3,
688 success: function (res) { 756 success: function (res) {
689 - var b=1.1;  
690 - //获取到二维码的图片  
691 - var vpath = res.path;  
692 - var context = wx.createCanvasContext('share');  
693 - // 先画背景  
694 - context.fillStyle = '#ebf6f8';  
695 - // 灰色实心矩形  
696 - // 1. 语法: x坐标, y坐标, 宽度, 高度  
697 - context.fillRect(0,0,750 * rpx,1338 * rpx);  
698 -  
699 - context.setFontSize(20* rpx)  
700 - context.setFillStyle("#00d8e9")  
701 - context.fillText("官方检测认证", 28*b* rpx, 80*b* rpx);  
702 -  
703 - //两个底部颜色  
704 - context.fillStyle = '#a7ecf5';  
705 - context.fillRect(28 *b* rpx,136 *b* rpx,262 *b* rpx,18 *b* rpx);  
706 - context.fillRect(28 *b* rpx,194 *b* rpx,262 *b* rpx,18 *b* rpx);  
707 -  
708 - context.setFontSize(42*b*rpx)  
709 - context.setFillStyle("#070609")  
710 - context.fillText("我的肌底强韧", 30*b* rpx, 140*b* rpx);  
711 - context.fillText("肌肤鲜活润泽", 30*b* rpx, 196*b* rpx);  
712 -  
713 - //先画一个圆形  
714 - th.circle(context,110*b*rpx, 280*b*rpx,140*b*rpx,"#e7f3f8");  
715 - th.circle(context,130*b*rpx, 300*b*rpx,120*b*rpx,"#c8f2fa");  
716 - //绘制人脸  
717 - context.drawImage(th.data.share_head, 132*b*rpx, 310*b*rpx, 230*b* rpx, 230 *b* rpx);  
718 -  
719 - //左右俩个框并填充文字  
720 - th.darwRoundRect(38 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context);  
721 - th.darwRoundRect(324 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context);  
722 - context.setFontSize(20*b*rpx)  
723 - context.setFillStyle("black")  
724 - context.fillText("黑眼圈 重度", 50*b* rpx, 368*b* rpx);  
725 - context.fillText("毛孔 "+th.data.pore_num, 336*b* rpx, 368*b* rpx);  
726 -  
727 - //左右俩个框并填充文字  
728 - th.darwRoundRect(40 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);  
729 - th.darwRoundRect(348 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);  
730 - context.setFillStyle("black")  
731 - context.fillText("黑头 "+th.data.blackhead_num, 52*b* rpx, 440*b* rpx);  
732 - context.fillText("色斑 "+th.data.speckle_num, 354*b* rpx, 440*b* rpx);  
733 -  
734 - //左右俩个框并填充文字  
735 - th.darwRoundRect(60 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);  
736 - th.darwRoundRect(328 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);  
737 - context.setFillStyle("black")  
738 - context.fillText("皱纹 "+th.data.wrinkle_num, 74*b* rpx, 510*b* rpx);  
739 - context.fillText("痤疮 "+th.data.acne_num, 344*b* rpx, 510*b* rpx);  
740 -  
741 - //底部的绘制  
742 - th.darwRoundRect(38 *b* rpx,650*b*rpx,430*b*rpx,160*b*rpx,10*b*rpx,context);  
743 - //绘制二维码  
744 - context.drawImage(vpath, 60*b*rpx, 672*b*rpx, 120 *b* rpx, 120 *b* rpx);  
745 - context.setFillStyle("black")  
746 - context.setFontSize(32*b*rpx)  
747 - context.fillText("美肤管家AI测肤", 200*b* rpx, 726*b* rpx);  
748 - context.setFontSize(22*b*rpx)  
749 - context.fillText("科学了解皮肤的真实状态", 200*b* rpx, 766*b* rpx);  
750 -  
751 - //把画板内容绘制成图片,并回调 画板图片路径  
752 - context.draw(false, function () {  
753 - setTimeout(function () {  
754 - wx.canvasToTempFilePath({  
755 - x: 0,  
756 - y: 0,  
757 - width: 750,  
758 - height: 1338,  
759 - destWidth: 1.4 * 750 * 750 / th.data.screenWidth,  
760 - destHeight: 1.4 * 750 * 750 / th.data.screenWidth,  
761 - canvasId: 'share',  
762 - success: function (res) {  
763 - that.setData({  
764 - shareImgPath: res.tempFilePath,  
765 - canvasHidden: true,  
766 - share_show:1  
767 - })  
768 - return false;  
769 -  
770 - /*--  
771 - wx.previewImage({  
772 - //将图片预览出来  
773 - ur--*/  
774 -  
775 - wx.hideLoading(); 757 +
  758 + var b = 1.1;
  759 + //获取到二维码的图片
  760 + var vpath = res.path;
  761 + var context = wx.createCanvasContext('share');
  762 + // 先画背景
  763 + context.fillStyle = '#ebf6f8';
  764 + // 灰色实心矩形
  765 + // 1. 语法: x坐标, y坐标, 宽度, 高度
  766 + context.fillRect(0, 0, 750 * rpx, 1338 * rpx);
  767 +
  768 + context.setFontSize(20 * rpx)
  769 + context.setFillStyle("#00d8e9")
  770 + context.fillText("官方检测认证", 28 * b * rpx, 80 * b * rpx);
  771 +
  772 + //两个底部颜色
  773 + context.fillStyle = '#a7ecf5';
  774 + context.fillRect(28 * b * rpx, 136 * b * rpx, 262 * b * rpx, 18 * b * rpx);
  775 + context.fillRect(28 * b * rpx, 194 * b * rpx, 262 * b * rpx, 18 * b * rpx);
  776 +
  777 + context.setFontSize(42 * b * rpx)
  778 + context.setFillStyle("#070609")
  779 + context.fillText("我的肌底强韧", 30 * b * rpx, 140 * b * rpx);
  780 + context.fillText("肌肤鲜活润泽", 30 * b * rpx, 196 * b * rpx);
  781 +
  782 + //先画一个圆形
  783 + th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8");
  784 + th.circle(context, 130 * b * rpx, 300 * b * rpx, 120 * b * rpx, "#c8f2fa");
  785 + //绘制人脸
  786 + context.drawImage(th.data.share_head, 132 * b * rpx, 310 * b * rpx, 230 * b * rpx, 230 * b * rpx);
  787 +
  788 + //左右俩个框并填充文字
  789 + th.darwRoundRect(38 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  790 + th.darwRoundRect(324 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  791 + context.setFontSize(20 * b * rpx)
  792 + context.setFillStyle("black")
  793 + context.fillText("黑眼圈 重度", 50 * b * rpx, 368 * b * rpx);
  794 + context.fillText("毛孔 " + th.data.pore_num, 336 * b * rpx, 368 * b * rpx);
  795 +
  796 + //左右俩个框并填充文字
  797 + th.darwRoundRect(40 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  798 + th.darwRoundRect(348 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  799 + context.setFillStyle("black")
  800 + context.fillText("黑头 " + th.data.blackhead_num, 52 * b * rpx, 440 * b * rpx);
  801 + context.fillText("色斑 " + th.data.speckle_num, 354 * b * rpx, 440 * b * rpx);
  802 +
  803 + //左右俩个框并填充文字
  804 + th.darwRoundRect(60 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  805 + th.darwRoundRect(328 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context);
  806 + context.setFillStyle("black")
  807 + context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 510 * b * rpx);
  808 + context.fillText("痤疮 " + th.data.acne_num, 344 * b * rpx, 510 * b * rpx);
  809 +
  810 + //底部的绘制
  811 + th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context);
  812 + //绘制二维码
  813 + context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx);
  814 + context.setFillStyle("black")
  815 + context.setFontSize(32 * b * rpx)
  816 + context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx);
  817 + context.setFontSize(22 * b * rpx)
  818 + context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx);
  819 +
  820 + //把画板内容绘制成图片,并回调 画板图片路径
  821 + context.draw(false, function () {
  822 + setTimeout(function () {
  823 + wx.canvasToTempFilePath({
  824 + x: 0,
  825 + y: 0,
  826 + width: 750,
  827 + height: 1338,
  828 + destWidth: 1.4 * 750 * 750 / th.data.screenWidth,
  829 + destHeight: 1.4 * 750 * 750 / th.data.screenWidth,
  830 + canvasId: 'share',
  831 + success: function (res) {
  832 + that.setData({
  833 + shareImgPath: res.tempFilePath,
  834 + canvasHidden: true,
  835 + share_show: 1
  836 + })
  837 + /*--
  838 + wx.previewImage({
  839 + //将图片预览出来
  840 + ur--*/
  841 +
  842 + wx.hideLoading();
776 } 843 }
777 }) 844 })
778 }, 500) 845 }, 500)
@@ -933,6 +1000,14 @@ Page({ @@ -933,6 +1000,14 @@ Page({
933 }) 1000 })
934 }, 1001 },
935 1002
  1003 + show_yiwen_dialog(e) {
  1004 + let yiwen_type = e.currentTarget.dataset.yiwen_type;
  1005 + this.setData({
  1006 + question_dialog: true,
  1007 + yiwen_type,
  1008 + })
  1009 + },
  1010 +
936 //-----领取券----- 1011 //-----领取券-----
937 get_quan: function (e) { 1012 get_quan: function (e) {
938 1013
packageD/pages/AI-test-skin/success_result/success_result.wxml
@@ -70,8 +70,8 @@ @@ -70,8 +70,8 @@
70 <view class="f1 ml20"> 70 <view class="f1 ml20">
71 <view class="bold">{{s_filter.get_dryoil_check(skin_dryoil_check_type)}}</view> 71 <view class="bold">{{s_filter.get_dryoil_check(skin_dryoil_check_type)}}</view>
72 <view class="fs24 mt10" wx:if="{{skin_dryoil_check_type==0 || skin_dryoil_check_type==2 || skin_dryoil_check_type==3}}"> 72 <view class="fs24 mt10" wx:if="{{skin_dryoil_check_type==0 || skin_dryoil_check_type==2 || skin_dryoil_check_type==3}}">
73 - <text wx:if="{{skin_dryoil_check_type==0 || skin_dryoil_check_type==3}}"class="gan" style="margin-right: 30rpx;">干性区</text>  
74 - <text wx:if="{{skin_dryoil_check_type==2 || skin_dryoil_check_type==3}}" class="you">油性区</text> 73 + <text wx:if="{{skin_dryoil_check_type==0 || skin_dryoil_check_type==3}}" class="gan" style="margin-right: 30rpx;">干性区</text>
  74 + <text wx:if="{{skin_dryoil_check_type==2 || skin_dryoil_check_type==3}}" class="you">油性区</text>
75 </view> 75 </view>
76 <view class="mt20 fs26" wx:if="{{skin_dryoil_check_type==3 }}"> 76 <view class="mt20 fs26" wx:if="{{skin_dryoil_check_type==3 }}">
77 <text>你的皮肤油脂过剩,部分干燥,容易引发皮肤问题。日常可使用一些具有控油和补水功效产品,帮助调理肌肤</text> 77 <text>你的皮肤油脂过剩,部分干燥,容易引发皮肤问题。日常可使用一些具有控油和补水功效产品,帮助调理肌肤</text>
@@ -119,22 +119,21 @@ @@ -119,22 +119,21 @@
119 </scroll-view> 119 </scroll-view>
120 120
121 121
122 -<view class="mask" catchtap="close_mask" wx:if="{{showDialog}}"></view>  
123 -<cover-view bindtap="saveImageToPhotosAlbum" class="share fs28">  
124 - <cover-view class="iconfont icon-zhuanfa1" style="padding: 0 10rpx;"></cover-view>  
125 - <cover-view>分享</cover-view>  
126 -</cover-view> 122 +<view class="mask" catchtap="close_mask" wx:if="{{showDialog || question_dialog}}"></view>
  123 +<view bindtap="saveImageToPhotosAlbum" class="share fs28">
  124 + <view class="iconfont icon-zhuanfa1" style="padding: 0 10rpx;"></view>
  125 + <view>分享</view>
  126 +</view>
127 127
128 <!-- 问题标注 --> 128 <!-- 问题标注 -->
129 <view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}"> 129 <view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}">
130 <!-- 局部放大的 --> 130 <!-- 局部放大的 -->
131 <block wx:if="{{img_scale}}"> 131 <block wx:if="{{img_scale}}">
132 <!-- 图片显示区 --> 132 <!-- 图片显示区 -->
133 - <view class="dialog_img" style="{{show_type == 5?'height:60%':'height:75%'}}"> 133 + <view class="dialog_img" style="{{show_type == 5?'height:60%':'height:85%'}}">
134 <view class="img_content rel"> 134 <view class="img_content rel">
135 <!-- 如果是黑眼圈的左眼右眼的时候 --> 135 <!-- 如果是黑眼圈的左眼右眼的时候 -->
136 - <view wx:if="{{is_esys_show}}" class="face_show_view rel"  
137 - style="width:{{eye_w}}px;height:{{eye_h}}px;margin-top: -{{eye_top}}px;margin-left: -{{is_esys_show==1?eye_left1:eye_left2}}px"> 136 + <view wx:if="{{is_esys_show}}" class="face_show_view rel" style="width:{{eye_w}}px;height:{{eye_h}}px;margin-top: -{{eye_top}}px;margin-left: -{{is_esys_show==1?eye_left1:eye_left2}}px">
138 137
139 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image> 138 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image>
140 <block wx:if="{{yanjing}}"> 139 <block wx:if="{{yanjing}}">
@@ -147,8 +146,7 @@ @@ -147,8 +146,7 @@
147 </block> 146 </block>
148 </view> 147 </view>
149 <!-- 其他显示 --> 148 <!-- 其他显示 -->
150 - <view wx:else class="face_show_view rel"  
151 - style="width:{{iwidth}}px;height:{{iheight}}px;margin-top: -{{m_top}}px;margin-left: -{{m_left}}px"> 149 + <view wx:else class="face_show_view rel" style="width:{{iwidth}}px;height:{{iheight}}px;margin-top: -{{m_top}}px;margin-left: -{{m_left}}px">
152 150
153 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image> 151 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image>
154 <block wx:if="{{yanjing}}"> 152 <block wx:if="{{yanjing}}">
@@ -172,11 +170,11 @@ @@ -172,11 +170,11 @@
172 <!-- 当点击了tabs --> 170 <!-- 当点击了tabs -->
173 <block wx:if="{{scroll_id>1}}"> 171 <block wx:if="{{scroll_id>1}}">
174 <block wx:for="{{item}}" wx:for-item="bitem"> 172 <block wx:for="{{item}}" wx:for-item="bitem">
175 - <view wx:if="{{bitem.w_type==(scroll_id-1)}}" class="abs p_point" style="left:{{(bitem.x)*bili}}px; top:{{(bitem.y)*bili}}px;"></view> 173 + <view wx:if="{{bitem.w_type==(scroll_id-1)}}" class="abs p_point" style="left:{{(bitem.x)*bili}}px; top:{{(bitem.y)*bili}}px;"></view>
176 </block> 174 </block>
177 </block> 175 </block>
178 <block wx:else> 176 <block wx:else>
179 - <view wx:for="{{item}}" wx:for-item="bitem" class="abs p_point" style="left:{{(bitem.x)*bili}}px; top:{{(bitem.y)*bili}}px;"></view> 177 + <view wx:for="{{item}}" wx:for-item="bitem" class="abs p_point" style="left:{{(bitem.x)*bili}}px; top:{{(bitem.y)*bili}}px;"></view>
180 </block> 178 </block>
181 </block> 179 </block>
182 </block> 180 </block>
@@ -199,12 +197,12 @@ @@ -199,12 +197,12 @@
199 <block wx:for="{{acne_list}}"> 197 <block wx:for="{{acne_list}}">
200 <!-- 当点击了tabs --> 198 <!-- 当点击了tabs -->
201 <block wx:if="{{scroll_id>1}}"> 199 <block wx:if="{{scroll_id>1}}">
202 - <view wx:if="{{item.type==(scroll_id-2)}}" class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili}}px; top:{{(item.center_y-item.radius)*bili}}px;height:{{2*item.radius*bili}}px;width: {{2*item.radius*bili}}px"></view> 200 + <view wx:if="{{item.type==(scroll_id-2)}}" class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili}}px; top:{{(item.center_y-item.radius)*bili}}px;height:{{2*item.radius*bili}}px;width: {{2*item.radius*bili}}px"></view>
203 </block> 201 </block>
204 <block wx:else> 202 <block wx:else>
205 <view class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili}}px; top:{{(item.center_y-item.radius)*bili}}px;height:{{2*item.radius*bili}}px;width: {{2*item.radius*bili}}px"></view> 203 <view class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili}}px; top:{{(item.center_y-item.radius)*bili}}px;height:{{2*item.radius*bili}}px;width: {{2*item.radius*bili}}px"></view>
206 </block> 204 </block>
207 - </block> 205 + </block>
208 </block> 206 </block>
209 207
210 </block> 208 </block>
@@ -229,55 +227,63 @@ @@ -229,55 +227,63 @@
229 <!-- <text class="iconfont icon-yanjing-guan mgb20"></text> --> 227 <!-- <text class="iconfont icon-yanjing-guan mgb20"></text> -->
230 <text catchtap="click_fangda" class="iconfont icon-fangda mgb20"></text> 228 <text catchtap="click_fangda" class="iconfont icon-fangda mgb20"></text>
231 </view> 229 </view>
  230 + <!-- <block wx:if="{{show_type == 6}}">
  231 + <view class="cuochuang">
  232 + <view class="cuochuang_icon">囊肿</view>
  233 + <view class="cuochuang_icon">丘疹</view>
  234 + <view class="cuochuang_icon">粉刺</view>
  235 + <view class="cuochuang_icon">痘印</view>
  236 + </view>
  237 + </block> -->
232 </view> 238 </view>
233 <!-- 文字显示区 --> 239 <!-- 文字显示区 -->
234 - <view class="dialog_txt" style="{{show_type == 5?'height:40%':'height:25%'}}"> 240 + <view class="dialog_txt" style="{{show_type == 5?'height:40%':'height:15%'}}">
235 <block wx:if="{{show_type == 5}}"> 241 <block wx:if="{{show_type == 5}}">
236 <view class="heiyanquan_img flex"> 242 <view class="heiyanquan_img flex">
237 - <view class="img1 t-c">  
238 - <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv4.jpeg"></image>  
239 - <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan4.jpeg"></image>  
240 - <view class="fs24">血管型</view>  
241 - </view>  
242 - <view class="img1 t-c">  
243 - <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv5.jpeg"></image>  
244 - <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan5.jpeg"></image>  
245 - <view class="fs24">色素型</view>  
246 - </view>  
247 - <view class="img1 t-c">  
248 - <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv6.jpeg"></image>  
249 - <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan6.jpeg"></image>  
250 - <view class="fs24">阴影型</view>  
251 - </view> 243 + <view class="img1 t-c">
  244 + <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv4.jpeg"></image>
  245 + <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan4.jpeg"></image>
  246 + <view class="fs24">血管型</view>
  247 + </view>
  248 + <view class="img1 t-c">
  249 + <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv5.jpeg"></image>
  250 + <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan5.jpeg"></image>
  251 + <view class="fs24">色素型</view>
  252 + </view>
  253 + <view class="img1 t-c">
  254 + <image wx:if="{{sex === 'female' }}" style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nv6.jpeg"></image>
  255 + <image wx:else style="width: 100%;height: 100rpx;" src="{{iurl}}/miniapp/images/skinimg/nan6.jpeg"></image>
  256 + <view class="fs24">阴影型</view>
  257 + </view>
252 </view> 258 </view>
253 </block> 259 </block>
254 <view class="dialog_progress"> 260 <view class="dialog_progress">
255 <view style="margin-right:7px;font-size:32rpx;"> 261 <view style="margin-right:7px;font-size:32rpx;">
256 - <text wx:if="{{show_type==1}}">毛孔粗大{{pore_num}}</text>  
257 - <text wx:if="{{show_type==2}}">色斑{{speckle_num}}</text> 262 + <text wx:if="{{show_type==1}}">毛孔粗大:{{pore_num}}</text>
  263 + <text wx:if="{{show_type==2}}">色斑:{{speckle_num}}</text>
258 <block wx:if="{{show_type==3}}"> 264 <block wx:if="{{show_type==3}}">
259 - <text wx:if="{{scroll_id==1}}">全部皱纹{{wrinkle_num}}</text>  
260 - <text wx:if="{{scroll_id==2}}">抬头纹{{wrinkle_num1}}</text>  
261 - <text wx:if="{{scroll_id==3}}">川字纹{{wrinkle_num2}}</text>  
262 - <text wx:if="{{scroll_id==4}}">眼周细纹{{wrinkle_num3}}</text>  
263 - <text wx:if="{{scroll_id==5}}">鱼尾纹{{wrinkle_num4}}</text>  
264 - <text wx:if="{{scroll_id==6}}">法令纹{{wrinkle_num5}}</text>  
265 - <text wx:if="{{scroll_id==7}}">口周纹{{wrinkle_num6}}</text> 265 + <text wx:if="{{scroll_id==1}}" style="position: relative;top: 25rpx;">全部皱纹:{{wrinkle_num}}</text>
  266 + <text wx:if="{{scroll_id==2}}" style="position: relative;top: 25rpx;">抬头纹:{{wrinkle_num1}}</text>
  267 + <text wx:if="{{scroll_id==3}}" style="position: relative;top: 25rpx;">川字纹:{{wrinkle_num2}}</text>
  268 + <text wx:if="{{scroll_id==4}}" style="position: relative;top: 25rpx;">眼周细纹:{{wrinkle_num3}}</text>
  269 + <text wx:if="{{scroll_id==5}}" style="position: relative;top: 25rpx;">鱼尾纹:{{wrinkle_num4}}</text>
  270 + <text wx:if="{{scroll_id==6}}" style="position: relative;top: 25rpx;">法令纹:{{wrinkle_num5}}</text>
  271 + <text wx:if="{{scroll_id==7}}" style="position: relative;top: 25rpx;">口周纹:{{wrinkle_num6}}</text>
266 </block> 272 </block>
267 - <text wx:if="{{show_type==4}}">黑头{{blackhead_num}}</text> 273 + <text wx:if="{{show_type==4}}">黑头{{blackhead_num}}</text>
268 <block wx:if="{{show_type==5}}"> 274 <block wx:if="{{show_type==5}}">
269 - <text wx:if="{{!s_dark_type}}">黑眼圈 {{s_filter.get_dark_type(dark_type)}}</text>  
270 - <text wx:if="{{s_dark_type==1}}">左眼黑眼圈 {{s_filter.get_dark_type(dark_type1)}}</text>  
271 - <text wx:if="{{s_dark_type==2}}">右眼黑眼圈 {{s_filter.get_dark_type(dark_type2)}}</text> 275 + <text wx:if="{{!s_dark_type}}">黑眼圈:{{s_filter.get_dark_type(dark_type)}}</text>
  276 + <text wx:if="{{s_dark_type==1}}">左眼黑眼圈:{{s_filter.get_dark_type(dark_type1)}}</text>
  277 + <text wx:if="{{s_dark_type==2}}">右眼黑眼圈:{{s_filter.get_dark_type(dark_type2)}}</text>
272 </block> 278 </block>
273 <block wx:if="{{show_type==6}}"> 279 <block wx:if="{{show_type==6}}">
274 - <text wx:if="{{scroll_id==1}}">全部痤疮{{acne_num}}</text>  
275 - <text wx:if="{{scroll_id==2}}">粉刺{{acne_num1}}</text>  
276 - <text wx:if="{{scroll_id==3}}">痘印{{acne_num2}}</text>  
277 - <text wx:if="{{scroll_id==4}}">脓包{{acne_num3}}</text>  
278 - <text wx:if="{{scroll_id==5}}">结节{{acne_num4}}</text> 280 + <text wx:if="{{scroll_id==1}}">全部痤疮:{{acne_num}}</text>
  281 + <text wx:if="{{scroll_id==2}}">粉刺:{{acne_num1}}</text>
  282 + <text wx:if="{{scroll_id==3}}">痘印:{{acne_num2}}</text>
  283 + <text wx:if="{{scroll_id==4}}">脓包:{{acne_num3}}</text>
  284 + <text wx:if="{{scroll_id==5}}">结节:{{acne_num4}}</text>
279 </block> 285 </block>
280 - <text wx:if="{{show_type==7}}">敏感度{{s_filter.get_nai_shou(skin_sensitive_check)}}</text> 286 + <text wx:if="{{show_type==7}}">敏感度{{s_filter.get_nai_shou(skin_sensitive_check)}}</text>
281 </view> 287 </view>
282 <view style="margin-top:10rpx;display: flex;display: none"> 288 <view style="margin-top:10rpx;display: flex;display: none">
283 <view class="pp"></view> 289 <view class="pp"></view>
@@ -293,21 +299,17 @@ @@ -293,21 +299,17 @@
293 </view> 299 </view>
294 <scroll-view wx:if="{{show_type == 3|| show_type == 5|| show_type == 6}}" style="margin-top: 20rpx;" enable-flex scroll-into-view="scroll{{scroll_id}}" scroll-with-animation scroll-x> 300 <scroll-view wx:if="{{show_type == 3|| show_type == 5|| show_type == 6}}" style="margin-top: 20rpx;" enable-flex scroll-into-view="scroll{{scroll_id}}" scroll-with-animation scroll-x>
295 <view class="flex fs28" style="height: 100%;"> 301 <view class="flex fs28" style="height: 100%;">
296 - <view wx:for="{{show_type == 3?zhouwen_arr:(show_type == 5?heitanquan_arr:cuochuang_arr)}}" bindtap="click_scroll" data-scroll_id="{{item.id}}" data-index="{{index}}" wx:key="id" id="scroll{{item.id}}" class="dialog_item {{scroll_index==index?'active1':''}}"> 302 + <view wx:for="{{show_type == 3?zhouwen_arr:(show_type == 5?heitanquan_arr:cuochuang_arr)}}" bindtap="click_scroll" data-scroll_id="{{item.id}}" data-index="{{index}}" wx:key="id" id="scroll{{item.id}}" class="dialog_item {{scroll_index==index?'active1':''}}">
297 {{item.name}} 303 {{item.name}}
298 </view> 304 </view>
299 </view> 305 </view>
300 </scroll-view> 306 </scroll-view>
301 </view> 307 </view>
302 -  
303 -  
304 </block> 308 </block>
305 -  
306 <!-- 全图的,能够自由拖拽和放大 --> 309 <!-- 全图的,能够自由拖拽和放大 -->
307 <block wx:else> 310 <block wx:else>
308 - <view bindtouchstart='touchstartCallback' bindtouchmove='touchmoveCallback' bindtouchEnd='touchendCallback'  
309 - style="position: relative;transform: scale({{ig_scale}});top: {{img_top}}px; left: {{img_left}}px;">  
310 - <image style="width: 100%;" src="{{iurl}}{{face_img}}" mode="widthFix" ></image> 311 + <view bindtouchstart='touchstartCallback' bindtouchmove='touchmoveCallback' bindtouchEnd='touchendCallback' style="position: relative;transform: scale({{ig_scale}});top: {{img_top}}px; left: {{img_left}}px;">
  312 + <image style="width: 100%;" src="{{iurl}}{{face_img}}" mode="widthFix"></image>
311 313
312 <block wx:if="{{yanjing}}"> 314 <block wx:if="{{yanjing}}">
313 <!-- 显示毛孔 --> 315 <!-- 显示毛孔 -->
@@ -330,11 +332,11 @@ @@ -330,11 +332,11 @@
330 <!-- 当点击了tabs --> 332 <!-- 当点击了tabs -->
331 <block wx:if="{{scroll_id>1}}"> 333 <block wx:if="{{scroll_id>1}}">
332 <block wx:for="{{item}}" wx:for-item="bitem"> 334 <block wx:for="{{item}}" wx:for-item="bitem">
333 - <view wx:if="{{bitem.w_type==(scroll_id-1)}}" class="abs p_point" style="left:{{(bitem.x)*bili1}}px; top:{{(bitem.y)*bili1}}px;"></view> 335 + <view wx:if="{{bitem.w_type==(scroll_id-1)}}" class="abs p_point" style="left:{{(bitem.x)*bili1}}px; top:{{(bitem.y)*bili1}}px;"></view>
334 </block> 336 </block>
335 </block> 337 </block>
336 <block wx:else> 338 <block wx:else>
337 - <view wx:for="{{item}}" wx:for-item="bitem" class="abs p_point" style="left:{{(bitem.x)*bili1}}px; top:{{(bitem.y)*bili1}}px;"></view> 339 + <view wx:for="{{item}}" wx:for-item="bitem" class="abs p_point" style="left:{{(bitem.x)*bili1}}px; top:{{(bitem.y)*bili1}}px;"></view>
338 </block> 340 </block>
339 </block> 341 </block>
340 </block> 342 </block>
@@ -357,7 +359,7 @@ @@ -357,7 +359,7 @@
357 <block wx:for="{{acne_list}}"> 359 <block wx:for="{{acne_list}}">
358 <!-- 当点击了tabs --> 360 <!-- 当点击了tabs -->
359 <block wx:if="{{scroll_id>1}}"> 361 <block wx:if="{{scroll_id>1}}">
360 - <view wx:if="{{item.type==(scroll_id-2)}}" class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili1}}px; top:{{(item.center_y-item.radius)*bili1}}px;height:{{2*item.radius*bili1}}px;width: {{2*item.radius*bili1}}px"></view> 362 + <view wx:if="{{item.type==(scroll_id-2)}}" class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili1}}px; top:{{(item.center_y-item.radius)*bili1}}px;height:{{2*item.radius*bili1}}px;width: {{2*item.radius*bili1}}px"></view>
361 </block> 363 </block>
362 <block wx:else> 364 <block wx:else>
363 <view class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili1}}px; top:{{(item.center_y-item.radius)*bili1}}px;height:{{2*item.radius*bili1}}px;width: {{2*item.radius*bili1}}px"></view> 365 <view class="abs p_circle colore{{item.type}}" style="left:{{(item.center_x-item.radius)*bili1}}px; top:{{(item.center_y-item.radius)*bili1}}px;height:{{2*item.radius*bili1}}px;width: {{2*item.radius*bili1}}px"></view>
@@ -379,12 +381,39 @@ @@ -379,12 +381,39 @@
379 <canvas canvas-id='share' style='width:750rpx;height:1338rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> 381 <canvas canvas-id='share' style='width:750rpx;height:1338rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
380 <!-- 展示分享图 --> 382 <!-- 展示分享图 -->
381 <view id="share_show" wx:if="{{share_show}}"> 383 <view id="share_show" wx:if="{{share_show}}">
382 - <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view>  
383 - <view class="share_content">  
384 - <view class="sh_close" bindtap="close_share"><text class="iconfont icon-close"></text></view>  
385 - <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image>  
386 - <view class="share_save_btn" bindtap="savePic">保存到相册</view>  
387 - </view> 384 + <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view>
  385 + <view class="share_content">
  386 + <view class="sh_close" bindtap="close_share"><text class="iconfont icon-guan"></text></view>
  387 + <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image>
  388 + <view class="share_save_btn" bindtap="savePic">保存到相册</view>
  389 + </view>
  390 +</view>
  391 +
  392 +
  393 +<!-- 疑问弹框 -->
  394 +<view class="dialog" wx:if="{{question_dialog}}" style="padding:5% 3% 3% 3%;background: #fff;">
  395 + <scroll-view enable-flex style="height: 80%;" scroll-into-view="yiwen{{yiwen_id}}" scroll-y scroll-with-animation enhanced show-scrollbar="false">
  396 + <view class="mt20" id="yiwen{{item.id}}" wx:for="{{yiwen_type==1?zhouwen_arr1:(yiwen_type==2?heitanquan_arr1:cuochuang_arr1)}}" wx:key="id">
  397 + <view>{{item.name}}</view>
  398 + <view class="fs28 mt10" style="color: #666;">
  399 + {{item.des}}
  400 + </view>
  401 + <image class="yiwen_img" mode="widthFix" src="{{iurl}}/miniapp/images/skinimg/{{item.sign}}.png"></image>
  402 + <image class="yiwen_img" mode="widthFix" src="{{iurl}}/miniapp/images/skinimg/{{item.sign1}}.png"></image>
  403 + </view>
  404 + </scroll-view>
  405 + <view style="position:fixed;bottom:0;width: 100%;">
  406 + <scroll-view enable-flex scroll-into-view="yiwen{{yiwen_id}}" scroll-with-animation scroll-x>
  407 + <view class="flex" style="padding: 30rpx 0;align-items: center;">
  408 + <view wx:for="{{yiwen_type==1?zhouwen_arr1:(yiwen_type==2?heitanquan_arr1:cuochuang_arr1)}}" bindtap="click_yiwen_scroll" data-yiwen_id="{{item.id}}" data-index="{{index}}" wx:key="id" id="yiwen{{item.id}}" class="dialog_item {{yiwen_index==index?'active1':''}}">
  409 + {{item.name}}
  410 + </view>
  411 + </view>
  412 + </scroll-view>
  413 + </view>
  414 + <view class="close_icon" bindtap="close_yiwen">
  415 + <text class="iconfont icon-guan"></text>
  416 + </view>
388 </view> 417 </view>
389 <!-- 提示 --> 418 <!-- 提示 -->
390 <warn id="warn"></warn> 419 <warn id="warn"></warn>
391 \ No newline at end of file 420 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/success_result.wxss
@@ -11,6 +11,7 @@ page { @@ -11,6 +11,7 @@ page {
11 z-index: 99; 11 z-index: 99;
12 display: flex; 12 display: flex;
13 height: 100rpx; 13 height: 100rpx;
  14 + background-color: #fff;
14 } 15 }
15 16
16 .share { 17 .share {
@@ -18,12 +19,13 @@ page { @@ -18,12 +19,13 @@ page {
18 position: fixed; 19 position: fixed;
19 bottom: 100rpx; 20 bottom: 100rpx;
20 right: 0; 21 right: 0;
21 - padding: 20rpx; 22 + padding:8rpx 20rpx;
22 background-color: #fff; 23 background-color: #fff;
23 border: 2rpx solid #f0f0f0; 24 border: 2rpx solid #f0f0f0;
24 /* color: #FFF; */ 25 /* color: #FFF; */
25 border-radius: 40rpx 0 0 40rpx; 26 border-radius: 40rpx 0 0 40rpx;
26 z-index: 99; 27 z-index: 99;
  28 + align-items: center;
27 } 29 }
28 30
29 .tab_scroll_item { 31 .tab_scroll_item {
@@ -274,9 +276,6 @@ page { @@ -274,9 +276,6 @@ page {
274 /* border-radius: 50%; */ 276 /* border-radius: 50%; */
275 } 277 }
276 278
277 -.bold {  
278 - font-weight: 600;  
279 -}  
280 279
281 280
282 .analyse_result .gan::before { 281 .analyse_result .gan::before {
@@ -450,8 +449,7 @@ page { @@ -450,8 +449,7 @@ page {
450 transform: translate(50%, -50%); 449 transform: translate(50%, -50%);
451 height: 80%; 450 height: 80%;
452 width: 80%; 451 width: 80%;
453 - border-top-left-radius: 12rpx;  
454 - border-top-right-radius: 12rpx; 452 + border-radius: 18rpx;
455 z-index: 99999999; 453 z-index: 99999999;
456 overflow: hidden; 454 overflow: hidden;
457 } 455 }
@@ -466,15 +464,16 @@ page { @@ -466,15 +464,16 @@ page {
466 flex-direction: column; 464 flex-direction: column;
467 justify-content: space-evenly; 465 justify-content: space-evenly;
468 background-color: #fff; 466 background-color: #fff;
469 - min-height: 25%; 467 + min-height: 10%;
470 } 468 }
471 469
472 .dialog_txt .heiyanquan_img { 470 .dialog_txt .heiyanquan_img {
473 justify-content: space-between; 471 justify-content: space-between;
474 padding: 2%; 472 padding: 2%;
475 } 473 }
  474 +
476 .dialog_txt .heiyanquan_img .img1 { 475 .dialog_txt .heiyanquan_img .img1 {
477 - width: 32%; 476 + width: 32%;color: #777;
478 } 477 }
479 478
480 .dialog .dialog_progress { 479 .dialog .dialog_progress {
@@ -490,9 +489,10 @@ page { @@ -490,9 +489,10 @@ page {
490 489
491 .dialog_item { 490 .dialog_item {
492 position: relative; 491 position: relative;
493 - padding: 3% 6%; 492 + padding: 3% 5%;
494 white-space: nowrap; 493 white-space: nowrap;
495 background-color: #fff; 494 background-color: #fff;
  495 + color: #a9a9a9;
496 } 496 }
497 497
498 .dialog .dialog_icon { 498 .dialog .dialog_icon {
@@ -516,6 +516,46 @@ page { @@ -516,6 +516,46 @@ page {
516 height: 50rpx; 516 height: 50rpx;
517 } 517 }
518 518
  519 +.cuochuang {
  520 + padding: 20rpx 30rpx;
  521 + position: absolute;
  522 + bottom: 50rpx;
  523 + left: 35rpx;
  524 + border-radius: 10rpx;
  525 + background-color: rgba(0, 0, 0, .2);
  526 + font-size: 24rpx;
  527 + color: #fff;
  528 +}
  529 +
  530 +.cuochuang_icon.cuochuang_icon {
  531 + margin-bottom: 10rpx;
  532 +}
  533 +
  534 +.cuochuang .cuochuang_icon::before {
  535 + content: "";
  536 + margin-right: 15rpx;
  537 + display: inline-block;
  538 + width: 16rpx;
  539 + height: 16rpx;
  540 + /* border: 2rpx solid red; */
  541 +}
  542 +
  543 +.cuochuang_icon:nth-child(1)::before {
  544 + border: 3rpx solid #d12126;
  545 +}
  546 +
  547 +.cuochuang_icon:nth-child(2)::before {
  548 + border: 3rpx solid #fff342;
  549 +}
  550 +
  551 +.cuochuang_icon:nth-child(3)::before {
  552 + border: 3rpx solid #d83fe4;
  553 +}
  554 +
  555 +.cuochuang_icon:nth-child(4)::before {
  556 + border: 3rpx solid #80c36c;
  557 +}
  558 +
519 .pp { 559 .pp {
520 width: 8rpx; 560 width: 8rpx;
521 height: 40rpx; 561 height: 40rpx;
@@ -697,7 +737,7 @@ page { @@ -697,7 +737,7 @@ page {
697 line-height: 80rpx; 737 line-height: 80rpx;
698 text-align: center; 738 text-align: center;
699 color: #fff; 739 color: #fff;
700 - background-color: #c3172d 740 + background-color: #45d4eb
701 } 741 }
702 742
703 .sh_close { 743 .sh_close {
@@ -715,38 +755,114 @@ page { @@ -715,38 +755,114 @@ page {
715 color: #fff 755 color: #fff
716 } 756 }
717 757
718 -@font-face {  
719 - font-family: "iconfont";  
720 - /* Project id */  
721 - src: url('iconfont.ttf?t=1645607343376') format('truetype'); 758 +.e_tou {
  759 + width: 50rpx;
  760 + height: 20rpx;
  761 + border-radius: 50%;
  762 + top: 70rpx;
  763 + left: 78rpx
  764 +}
  765 +
  766 +.e_bz {
  767 + width: 18rpx;
  768 + height: 40rpx;
  769 + border-radius: 50%;
  770 + top: 100rpx;
  771 + left: 93rpx
  772 +}
  773 +
  774 +.e_zlian {
  775 + width: 20rpx;
  776 + height: 30rpx;
  777 + border-radius: 50%;
  778 + top: 126rpx;
  779 + left: 60rpx
  780 +}
  781 +
  782 +.e_ylian {
  783 + width: 20rpx;
  784 + height: 30rpx;
  785 + border-radius: 50%;
  786 + top: 126rpx;
  787 + left: 126rpx
  788 +}
  789 +
  790 +.e_xb {
  791 + width: 20rpx;
  792 + height: 16rpx;
  793 + border-radius: 50%;
  794 + top: 170rpx;
  795 + left: 92rpx
722 } 796 }
723 797
724 -.icon-close:before {  
725 - content: "\e668"; 798 +.g_x {
  799 + background-color: #c0e2b7
726 } 800 }
727 801
728 -.e_tou{width: 50rpx; height: 20rpx;border-radius: 50%; top: 70rpx; left: 78rpx}  
729 -.e_bz{width: 18rpx; height: 40rpx;border-radius: 50%; top: 100rpx; left: 93rpx}  
730 -.e_zlian{width: 20rpx; height: 30rpx;border-radius: 50%; top: 126rpx; left: 60rpx}  
731 -.e_ylian{width: 20rpx; height: 30rpx; border-radius: 50%; top: 126rpx; left: 126rpx}  
732 -.e_xb{width: 20rpx; height: 16rpx; border-radius: 50%; top: 170rpx; left: 92rpx} 802 +.y_x {
  803 + background-color: #ffd6bd
  804 +}
733 805
734 -.g_x{ background-color: #c0e2b7 }  
735 -.y_x{ background-color: #ffd6bd } 806 +.acne_show_li {
  807 + border-radius: 10rpx;
  808 + position: absolute;
  809 + left: 10rpx;
  810 + bottom: 10rpx;
  811 + font-size: 20rpx;
  812 + color: #fff;
  813 + background-color: rgba(0, 0, 0, 0.5);
  814 + padding: 30rpx
  815 +}
736 816
737 -.acne_show_li{ border-radius: 10rpx; position: absolute; left: 10rpx; bottom: 10rpx;  
738 - font-size: 20rpx;color: #fff;background-color: rgba(0,0,0,0.5);padding: 30rpx} 817 +.acne_show_li_item {
  818 + width: 10rpx;
  819 + height: 10rpx;
  820 + border-radius: 50%;
  821 + display: inline-block;
  822 + margin-right: 10rpx
  823 +}
739 824
740 -.acne_show_li_item{width: 10rpx; height: 10rpx;border-radius: 50%;display: inline-block;margin-right: 10rpx}  
741 -.p_circle.colore0{  
742 - border: 4rpx solid #c8162c; 825 +.p_circle.colore0 {
  826 + border: 4rpx solid #c8162c;
743 } 827 }
744 -.p_circle.colore1{ 828 +
  829 +.p_circle.colore1 {
745 border: 4rpx solid #E1E10B; 830 border: 4rpx solid #E1E10B;
746 } 831 }
747 -.p_circle.colore2{ 832 +
  833 +.p_circle.colore2 {
748 border: 4rpx solid #4E8DF6; 834 border: 4rpx solid #4E8DF6;
749 } 835 }
750 -.p_circle.colore3{ 836 +
  837 +.p_circle.colore3 {
751 border: 4rpx solid #c0e2b7; 838 border: 4rpx solid #c0e2b7;
752 -}  
753 \ No newline at end of file 839 \ No newline at end of file
  840 +}
  841 +
  842 +.yiwen {
  843 + font-size: 42rpx;
  844 + display: flex;
  845 + align-items: center;
  846 +}
  847 +
  848 +.yiwen_img {
  849 + width: 100%;
  850 + margin-top: 40rpx;
  851 + /* width: 600rpx;
  852 + height: 600rpx; */
  853 +}
  854 +
  855 +.mt50 {
  856 + margin-top: 50rpx;
  857 +}
  858 +
  859 +.close_icon {
  860 + top: 15px;
  861 + position: absolute;
  862 + right: 50rpx;
  863 +}
  864 +
  865 +::-webkit-scrollbar {
  866 + width: 0;
  867 + height: 0;
  868 + color: transparent;
  869 +}
packageD/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml
@@ -4,7 +4,11 @@ @@ -4,7 +4,11 @@
4 <view> 4 <view>
5 <view style="color: #45d4eb;">#0{{wrinkle_sort}}</view> 5 <view style="color: #45d4eb;">#0{{wrinkle_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 - <text style="font-size: 42rpx;" class="bold">皱纹</text> 7 + <!-- <text style="font-size: 42rpx;" class="bold">皱纹</text> -->
  8 + <view class="bold">
  9 + <text style="font-size: 42rpx;">皱纹</text>
  10 + <text class="iconfont icon-wenhao" style="margin-left:10rpx" catchtap="show_yiwen_dialog" data-yiwen_type="1"></text>
  11 + </view>
8 <view class="fs26" catchtap="show_dailog" data-type="3" style="display: flex;align-items: center;"> 12 <view class="fs26" catchtap="show_dailog" data-type="3" style="display: flex;align-items: center;">
9 <text>问题标注</text> 13 <text>问题标注</text>
10 <text class="iconfont icon-xia"></text> 14 <text class="iconfont icon-xia"></text>
pages/activity/pind_list/pind_list.js
@@ -61,11 +61,6 @@ Page({ @@ -61,11 +61,6 @@ Page({
61 }); 61 });
62 } 62 }
63 }) 63 })
64 - // var user_id=getApp().globalData.user_id;  
65 - // if(!user_id) user_id=0;  
66 - // this.setData({  
67 - // user_id,  
68 - // })  
69 this.requestSalelist(); 64 this.requestSalelist();
70 }, 65 },
71 66
@@ -74,15 +69,7 @@ Page({ @@ -74,15 +69,7 @@ Page({
74 this.data.currentPage = 1; 69 this.data.currentPage = 1;
75 this.data.ismore = 1; 70 this.data.ismore = 1;
76 var th = this; 71 var th = this;
77 - // var userInfo = wx.getStorageSync('userinfo');  
78 - // if (userInfo) {  
79 - // //调用列表  
80 - // this.requestSalelist(userInfo.user_id);  
81 - // } else {  
82 - // getApp().goto("/pages/togoin/togoin");  
83 - // }  
84 72
85 -  
86 //设置全局定时器 73 //设置全局定时器
87 th.data.timer = setInterval(function () { 74 th.data.timer = setInterval(function () {
88 th.countDown(); 75 th.countDown();
pages/activity/seckill_list/seckill_list.wxml
@@ -33,13 +33,15 @@ @@ -33,13 +33,15 @@
33 33
34 <view class="kill-list abs seckill_list"> 34 <view class="kill-list abs seckill_list">
35 <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" > 35 <view class="kill-item" wx:for="{{goodlist}}" wx:if="{{item.djs.hide}}" >
36 - <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1"> 36 + <!-- <navigator class="kill-pic rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1"> -->
  37 + <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" class="kill-pic rel">
37 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image> 38 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image>
38 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" 39 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}"
39 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> 40 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
40 </navigator> 41 </navigator>
41 <view class="kill-cont"> 42 <view class="kill-cont">
42 - <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1">{{item.goods_name}}</navigator> 43 + <!-- <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1">{{item.goods_name}}</navigator> -->
  44 + <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" class="goods-name ellipsis-2">{{item.goods_name}}</navigator>
43 <view class="flex-vertical xc-strip-frame"> 45 <view class="flex-vertical xc-strip-frame">
44 <view class="xc-strip-blank rel"> 46 <view class="xc-strip-blank rel">
45 47
@@ -71,9 +73,12 @@ @@ -71,9 +73,12 @@
71 73
72 </view> 74 </view>
73 <view class="kill-btn "> 75 <view class="kill-btn ">
74 - <navigator style="background-color: #059de5;" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{type==0}}" >即将开始</navigator> 76 + <!-- <navigator style="background-color: #059de5;" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{type==0}}" >即将开始</navigator>
75 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==1 && type==1}}">马上抢</navigator> 77 <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==1 && type==1}}">马上抢</navigator>
76 - <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> 78 + <navigator class="huise"url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.id}}&prom_type=1" wx:if="{{item.status==3 && type==1}}">已抢光</navigator> -->
  79 + <navigator style="background-color: #059de5;" url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{type==0}}" >即将开始</navigator>
  80 + <navigator url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==1 && type==1}}">马上抢</navigator>
  81 + <navigator class="huise"url="{{item.goods_type == 0 ? ('/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id):('/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_type=1&prom_id=' + item.id )}}" wx:if="{{item.status==3 && type==1}}">已抢光</navigator>
77 </view> 82 </view>
78 </view> 83 </view>
79 </view> 84 </view>
pages/cart/cart/cart.js
@@ -1013,7 +1013,7 @@ Page({ @@ -1013,7 +1013,7 @@ Page({
1013 console.log('add+'); 1013 console.log('add+');
1014 if (a.goods_num < a.store_count) { 1014 if (a.goods_num < a.store_count) {
1015 var e = { 1015 var e = {
1016 - goods_num: a.goods_num + 1, 1016 + goods_num: a.goods_num + 1,
1017 id: a.id, 1017 id: a.id,
1018 goods_id: a.goods_id, 1018 goods_id: a.goods_id,
1019 store_id: oo.stoid 1019 store_id: oo.stoid
@@ -1021,10 +1021,14 @@ Page({ @@ -1021,10 +1021,14 @@ Page({
1021 // console.log('goods_num', e.goods_num); 1021 // console.log('goods_num', e.goods_num);
1022 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); 1022 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1023 } else { 1023 } else {
1024 - wx.showModal({  
1025 - title: '提示',  
1026 - content: '购买的数量不能超出库存数量',  
1027 - }); 1024 + // wx.showModal({
  1025 + // title: '提示',
  1026 + // content: '购买的数量不能超出库存数量',
  1027 + // });
  1028 + wx.showToast({
  1029 + title: '购买的数量不能超出库存数量',
  1030 + icon: 'none',
  1031 + });
1028 this.data.up_dating = 0; 1032 this.data.up_dating = 0;
1029 } 1033 }
1030 }, 1034 },
@@ -1740,16 +1744,24 @@ Page({ @@ -1740,16 +1744,24 @@ Page({
1740 1744
1741 }) 1745 })
1742 1746
1743 -  
1744 - var buyed_mum2 = t.goods_num + goodsbuynum;  
1745 - if (buyed_mum2 > limit && limit > 0) { 1747 + //--> by ty
  1748 + // var buyed_mum2 = t.goods_num + goodsbuynum;
  1749 + var buyed_mum2 = t.goods_num;
  1750 + //<--
  1751 +
  1752 + // 判断当前预购买的数量是否超过可购买的数量
  1753 + if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) {
1746 wx.showToast({ 1754 wx.showToast({
1747 title: '购买数量超出商品限购', 1755 title: '购买数量超出商品限购',
1748 icon: 'none', 1756 icon: 'none',
1749 - // content: '购买数量超出商品限购'  
1750 }); 1757 });
1751 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1758 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1752 - var cbuy = limit - buyed_mum2; 1759 +
  1760 + //--> by ty
  1761 + var cbuy = limit - goodsbuynum;
  1762 + // var cbuy = limit - buyed_mum2 + 1;
  1763 + //<--
  1764 +
1753 e.setData({ 1765 e.setData({
1754 // [txt]: cbuy > 0 ? cbuy : 0, 1766 // [txt]: cbuy > 0 ? cbuy : 0,
1755 [txt]: cbuy > 0 ? cbuy : limit, 1767 [txt]: cbuy > 0 ? cbuy : limit,
pages/cart/cart/cart.wxml
@@ -4,9 +4,9 @@ @@ -4,9 +4,9 @@
4 --> 4 -->
5 <!-- 广告图片 --> 5 <!-- 广告图片 -->
6 6
7 -<navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> 7 +<!-- <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}">
8 <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> 8 <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image>
9 -</navigator> 9 +</navigator> -->
10 10
11 <block wx:if="{{ad_data}}"> 11 <block wx:if="{{ad_data}}">
12 <swiper class="swiper" circular="true" autoplay="true" 12 <swiper class="swiper" circular="true" autoplay="true"
pages/cart/cart/cart.wxss
@@ -131,7 +131,7 @@ radio { @@ -131,7 +131,7 @@ radio {
131 131
132 .sub, .add, .count>input { 132 .sub, .add, .count>input {
133 /* border-right: 1px solid #000; */ 133 /* border-right: 1px solid #000; */
134 - background-color: #f8f8f8; 134 + background-color: #f0f0f0;
135 border-radius: 8rpx; 135 border-radius: 8rpx;
136 } 136 }
137 .sub.active { 137 .sub.active {
pages/cart/cart2/c_filter.wxs
@@ -15,6 +15,7 @@ var filters = { @@ -15,6 +15,7 @@ var filters = {
15 if(ind==1 ) return "green"; 15 if(ind==1 ) return "green";
16 if(ind==2) return "blue"; 16 if(ind==2) return "blue";
17 if(ind==11) return "green"; 17 if(ind==11) return "green";
  18 + if(ind==13) return "red";
18 if(ind==12) return "blue"; 19 if(ind==12) return "blue";
19 if(ind==20) return "green"; 20 if(ind==20) return "green";
20 return ""; 21 return "";
@@ -44,6 +45,7 @@ var filters = { @@ -44,6 +45,7 @@ var filters = {
44 if (ind == 2) return "指定品类"; 45 if (ind == 2) return "指定品类";
45 if (ind == 11) return "指定用途"; 46 if (ind == 11) return "指定用途";
46 if (ind == 12) return "指定分类1"; 47 if (ind == 12) return "指定分类1";
  48 + if (ind == 13) return "全场通用";
47 if (ind == 20) return "指定单品"; 49 if (ind == 20) return "指定单品";
48 return ""; 50 return "";
49 }, 51 },
pages/cart/cart2/cart2.js
@@ -227,23 +227,6 @@ Page({ @@ -227,23 +227,6 @@ Page({
227 } else { 227 } else {
228 th.setData({ user_addr: ie }); 228 th.setData({ user_addr: ie });
229 } 229 }
230 - var going = 0;  
231 -  
232 -  
233 - //使用计时器,避免空现象  
234 - /*---  
235 - var jishi= setInterval(function () {  
236 - if (th.data.is_b_now == 1 && going==0) {  
237 - if(th.data.bn_goods) {  
238 - th.calculatePrice2();going=1;clearInterval(jishi);  
239 - }  
240 - }else if(going==0) {  
241 - if (th.data.cartlist){  
242 - th.calculatePrice();going = 1; clearInterval(jishi);  
243 - }  
244 - }  
245 - },500)--*/  
246 -  
247 }); 230 });
248 var is_card_back = getApp().globalData.is_card_back; 231 var is_card_back = getApp().globalData.is_card_back;
249 //--更新默认地址--,看一下是不是跳到地址页面,同时也不是购买等级卡返回的,这里很重要,否则会重新更新收货物流公司 232 //--更新默认地址--,看一下是不是跳到地址页面,同时也不是购买等级卡返回的,这里很重要,否则会重新更新收货物流公司
@@ -392,6 +375,7 @@ Page({ @@ -392,6 +375,7 @@ Page({
392 th.setData({ user_addr: addr }); 375 th.setData({ user_addr: addr });
393 //--------------------------立即购买------------------ 376 //--------------------------立即购买------------------
394 if (ta.is_bnow == 1) { 377 if (ta.is_bnow == 1) {
  378 + console.log('is_bnow');
395 //读取门店 379 //读取门店
396 to.get_allsto(function (e) { 380 to.get_allsto(function (e) {
397 th.setData({ allsto: e }); 381 th.setData({ allsto: e });
@@ -404,6 +388,8 @@ Page({ @@ -404,6 +388,8 @@ Page({
404 to.get_allsto(function (e) { 388 to.get_allsto(function (e) {
405 th.setData({ allsto: e }); 389 th.setData({ allsto: e });
406 //-------获取购物车已经选择的商品-------- 390 //-------获取购物车已经选择的商品--------
  391 + console.log('购物车结算');
  392 +
407 th.get_cart(); 393 th.get_cart();
408 }) 394 })
409 } 395 }
@@ -533,7 +519,7 @@ Page({ @@ -533,7 +519,7 @@ Page({
533 } 519 }
534 if (item1.prom_type == 10) { 520 if (item1.prom_type == 10) {
535 if (!th.data.ladder_map[item1.prom_id]) { 521 if (!th.data.ladder_map[item1.prom_id]) {
536 - //如果有组合购 522 + //如果有预售
537 var isok = 1; 523 var isok = 1;
538 var is_flag = 1; 524 var is_flag = 1;
539 var act = null; 525 var act = null;
@@ -984,7 +970,6 @@ Page({ @@ -984,7 +970,6 @@ Page({
984 if (gg.prom_type == 5) { 970 if (gg.prom_type == 5) {
985 t.data.data.prom_id = gg.prom_id; 971 t.data.data.prom_id = gg.prom_id;
986 t.data.data.prom_type = 5; 972 t.data.data.prom_type = 5;
987 -  
988 // console.log('xxxxxxxxxxxxxxxxxx', gg.is_coupon) 973 // console.log('xxxxxxxxxxxxxxxxxx', gg.is_coupon)
989 th.is_coupon = gg.is_coupon; 974 th.is_coupon = gg.is_coupon;
990 th.setData({ 975 th.setData({
@@ -1378,6 +1363,15 @@ Page({ @@ -1378,6 +1363,15 @@ Page({
1378 wx.showLoading({ 1363 wx.showLoading({
1379 title: "处理中." 1364 title: "处理中."
1380 }) 1365 })
  1366 +
  1367 + //是不是区域包邮
  1368 + th.data.is_area_by=0;
  1369 + //当不是区域不包邮的时候,没有不包邮商品的时候
  1370 + th.data.free1=0;
  1371 + th.data.cut_o_shipping_price=0;
  1372 + th.data.cut_goods_piece=0;
  1373 + th.data.cut_goods_weight=0;
  1374 +
1381 var all_price = 0; //所有的商品总价 1375 var all_price = 0; //所有的商品总价
1382 var all_shipping_m = 0; //所有的物流总价 1376 var all_shipping_m = 0; //所有的物流总价
1383 var all_total_m = 0; //所有的订单应付总价 1377 var all_total_m = 0; //所有的订单应付总价
@@ -1391,6 +1385,9 @@ Page({ @@ -1391,6 +1385,9 @@ Page({
1391 1385
1392 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0); 1386 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
1393 var freight_free = ee.freight_free; //全场满多少包邮 1387 var freight_free = ee.freight_free; //全场满多少包邮
  1388 + var free1=freight_free;
  1389 +
  1390 +
1394 var weight_free = ee.weight_free; //多少kg内包邮 1391 var weight_free = ee.weight_free; //多少kg内包邮
1395 var no_ex_id = ee.no_ex_id; 1392 var no_ex_id = ee.no_ex_id;
1396 var no_ex_good = null; 1393 var no_ex_good = null;
@@ -1503,16 +1500,6 @@ Page({ @@ -1503,16 +1500,6 @@ Page({
1503 } 1500 }
1504 o_price += item[j].goods_price * item[j].goods_num; 1501 o_price += item[j].goods_price * item[j].goods_num;
1505 1502
1506 - //判断是否有设置限制重量包邮,先看商品有没有包邮  
1507 - if (item[j]['is_past'] !== 1 && item[j]['exp_sum_type'] == 2) {  
1508 - if (goods_weight < 0) goods_weight = 0;  
1509 - //累积商品重量 每种商品的重量 * 数量  
1510 - goods_weight += item[j]['weight'] * item[j]['goods_num'];  
1511 - if (weight_free > 0) {  
1512 - out_of_weight = (weight_free * 1000) - goods_weight;  
1513 - }  
1514 - }  
1515 -  
1516 } 1503 }
1517 //判断是不是有组合购的金额 1504 //判断是不是有组合购的金额
1518 var f_o_price = o_price; 1505 var f_o_price = o_price;
@@ -1564,12 +1551,14 @@ Page({ @@ -1564,12 +1551,14 @@ Page({
1564 1551
1565 th.data.is_no_past = 1; //不包邮标识符 1552 th.data.is_no_past = 1; //不包邮标识符
1566 1553
  1554 + var no_ex_good_arr = null;
1567 //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- 1555 //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额--
1568 if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list)) { 1556 if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list)) {
1569 //如果有设置不包邮区域的时候 1557 //如果有设置不包邮区域的时候
1570 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { 1558 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1571 if (th.check_by_area(by_qc.region_list)) { 1559 if (th.check_by_area(by_qc.region_list)) {
1572 freight_free = 0; 1560 freight_free = 0;
  1561 + th.data.is_area_by=1;
1573 //goods_weight = -1; 1562 //goods_weight = -1;
1574 //out_of_weight = 0; 1563 //out_of_weight = 0;
1575 th.data.is_no_by[pickid] = 1; 1564 th.data.is_no_by[pickid] = 1;
@@ -1580,11 +1569,67 @@ Page({ @@ -1580,11 +1569,67 @@ Page({
1580 freight_free = 0; 1569 freight_free = 0;
1581 //goods_weight = -1; 1570 //goods_weight = -1;
1582 //out_of_weight = 0; 1571 //out_of_weight = 0;
1583 - th.data.is_no_by[pickid] = 1; 1572 + //th.data.is_no_by[pickid] = 1;
1584 no_ex_good = by_qc.goods_list; 1573 no_ex_good = by_qc.goods_list;
  1574 + if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');
1585 } 1575 }
1586 } 1576 }
1587 1577
  1578 +
  1579 +
  1580 +
  1581 + var is_in_no_ex_goods_arr=0;
  1582 + var by_g_weight=0;
  1583 + //--------循环计算商品总物流-----------
  1584 + for (var jo = 0; jo < item.length; jo++) {
  1585 + //----------------如果是选择了物流---------------------
  1586 + if (cart_item.exp_type == 0 && item[jo].is_free_shipping == 0 && th.data.user_addr != null){
  1587 +
  1588 + //判断是否有设置限制重量包邮,先看商品有没有包邮
  1589 + if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[jo].goods_id + '')== -1){
  1590 + if(!th.data.is_area_by) th.data.free1=free1;
  1591 + //此时是 模板里面没有不包邮商品列表或者是 该商品没有再不包邮商品列表礼包
  1592 + if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
  1593 + if (goods_weight < 0) goods_weight = 0;
  1594 + //累积商品重量 每种商品的重量 * 数量
  1595 + goods_weight += item[jo]['weight'] * item[jo]['goods_num'];
  1596 + by_g_weight+=item[jo]['weight'] * item[jo]['goods_num'];
  1597 +
  1598 + if(free1>0){
  1599 + if (weight_free > 0) {
  1600 + out_of_weight = (weight_free * 1000) - by_g_weight;
  1601 + }else{
  1602 + out_of_weight= -by_g_weight;
  1603 + }
  1604 + }
  1605 +
  1606 + }
  1607 + }
  1608 + //这个是在不包邮列表礼包
  1609 + else if(no_ex_good_arr.indexOf(item[jo].goods_id + '') > -1){
  1610 + is_in_no_ex_goods_arr=1;
  1611 + if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
  1612 + if (goods_weight < 0) goods_weight = 0;
  1613 + //累积商品重量 每种商品的重量 * 数量
  1614 + goods_weight += item[jo]['weight'] * item[jo]['goods_num'];
  1615 + }
  1616 +
  1617 + }
  1618 + }
  1619 + }
  1620 +
  1621 + if(free1>0) {
  1622 + //当商品没有超出的时候
  1623 + if (out_of_weight >= 0) {
  1624 + out_of_weight = -by_g_weight;
  1625 + } else {
  1626 + if (weight_free > 0) out_of_weight = -weight_free * 1000;
  1627 + }
  1628 + }
  1629 +
  1630 + //所有的商品都不在不包邮商品列表,freight_free为0的时候,以及不是区域包邮
  1631 + if(!is_in_no_ex_goods_arr && !freight_free && !th.data.is_area_by) freight_free=free1;
  1632 +
1588 //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- 1633 //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额--
1589 if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) { 1634 if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) {
1590 //看是不是有调用过包邮券 1635 //看是不是有调用过包邮券
@@ -1669,23 +1714,20 @@ Page({ @@ -1669,23 +1714,20 @@ Page({
1669 if (no_ex_good) { 1714 if (no_ex_good) {
1670 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id); 1715 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
1671 } 1716 }
1672 -  
1673 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量 1717 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量
  1718 + /*--
1674 if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >=0 ) { 1719 if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >=0 ) {
1675 continue; 1720 continue;
1676 - }  
1677 - 1721 + }--*/
1678 //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- 1722 //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
1679 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) { 1723 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) {
1680 continue; 1724 continue;
1681 } 1725 }
1682 1726
1683 - var no_ex_good_arr = null;  
1684 - if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');  
1685 - 1727 + //var no_ex_good_arr = null;
  1728 + //if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');
1686 //----------------如果是选择了物流--------------------- 1729 //----------------如果是选择了物流---------------------
1687 - if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1)) {  
1688 - 1730 + if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0) {
1689 //如果地址不为空 1731 //如果地址不为空
1690 if (th.data.user_addr != null) { 1732 if (th.data.user_addr != null) {
1691 switch (item[j]['exp_sum_type']) { 1733 switch (item[j]['exp_sum_type']) {
@@ -1693,14 +1735,6 @@ Page({ @@ -1693,14 +1735,6 @@ Page({
1693 //统一运费 1735 //统一运费
1694 o_shipping_price += item[j]['uniform_exp_sum']; 1736 o_shipping_price += item[j]['uniform_exp_sum'];
1695 break; 1737 break;
1696 - // case 2:  
1697 - // if (goods_weight < 0) goods_weight = 0;  
1698 - // //累积商品重量 每种商品的重量 * 数量  
1699 - // goods_weight += item[j]['weight'] * item[j]['goods_num'];  
1700 - // if (weight_free > 0) {  
1701 - // out_of_weight = (weight_free * 1000) - goods_weight;  
1702 - // }  
1703 - // break;  
1704 case 3: 1738 case 3:
1705 if (goods_piece < 0) goods_piece = 0; 1739 if (goods_piece < 0) goods_piece = 0;
1706 //累积商品数量 1740 //累积商品数量
@@ -1708,12 +1742,28 @@ Page({ @@ -1708,12 +1742,28 @@ Page({
1708 break; 1742 break;
1709 } 1743 }
1710 } 1744 }
1711 - }else{  
1712 1745
  1746 +
  1747 + if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '')== -1){
  1748 + switch (item[j]['exp_sum_type']) {
  1749 + case 1:
  1750 + //统一运费
  1751 + th.data.cut_o_shipping_price += item[j]['uniform_exp_sum'];
  1752 + break;
  1753 + case 3:
  1754 + //累积商品数量
  1755 + th.data.cut_goods_piece += item[j]['goods_num'];
  1756 + break;
  1757 + }
  1758 + }
  1759 +
  1760 +
  1761 + }else{
  1762 + /*--
1713 if(item[j]['exp_sum_type']==2 && out_of_weight!==0){ 1763 if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
1714 goods_weight = -1; 1764 goods_weight = -1;
1715 out_of_weight = 0; 1765 out_of_weight = 0;
1716 - } 1766 + }--*/
1717 } 1767 }
1718 } 1768 }
1719 1769
@@ -1753,8 +1803,6 @@ Page({ @@ -1753,8 +1803,6 @@ Page({
1753 o_condition = o_price_no_zh - quan_price; 1803 o_condition = o_price_no_zh - quan_price;
1754 } 1804 }
1755 1805
1756 -  
1757 -  
1758 var order_m = 0; 1806 var order_m = 0;
1759 //---判断是不是有订单优惠--- 1807 //---判断是不是有订单优惠---
1760 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { 1808 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
@@ -3124,6 +3172,14 @@ Page({ @@ -3124,6 +3172,14 @@ Page({
3124 var fw_price = 0, fp_price = 0; 3172 var fw_price = 0, fp_price = 0;
3125 item = item.config; 3173 item = item.config;
3126 if (item == null) return o_shipping_price; 3174 if (item == null) return o_shipping_price;
  3175 +
  3176 + //------超出重量----------
  3177 + if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
  3178 + goods_weight=goods_weight+ out_of_weight;
  3179 + if(goods_weight==0) goods_weight=-1;
  3180 + }
  3181 +
  3182 +
3127 //------按重量---------- 3183 //------按重量----------
3128 if (goods_weight >= 0 && item['money']) { 3184 if (goods_weight >= 0 && item['money']) {
3129 fw_price = parseFloat(item['money']); 3185 fw_price = parseFloat(item['money']);
@@ -3133,16 +3189,13 @@ Page({ @@ -3133,16 +3189,13 @@ Page({
3133 fw_price = fw_price + n * parseFloat(item['add_money']); 3189 fw_price = fw_price + n * parseFloat(item['add_money']);
3134 } 3190 }
3135 } 3191 }
3136 - //------超出重量----------  
3137 - if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {  
3138 - fw_price = parseFloat(item['money']);  
3139 - var out_of_weight = Math.abs(out_of_weight);  
3140 - if (out_of_weight > item['first_weight']) {  
3141 - var fw = out_of_weight - item['first_weight'];  
3142 - var n = Math.ceil(fw / item['second_weight'])  
3143 - fw_price = fw_price + n * parseFloat(item['add_money']);  
3144 - }  
3145 - } 3192 +
  3193 + if(th.data.free1 && freight_free<=0) freight_free=th.data.free1;
  3194 +
  3195 +
  3196 + //当有包邮和不包邮混合在一起的时候,件数要重新计算
  3197 + if(freight_free>0 && o_price >= freight_free && goods_piece>0 && th.data.cut_goods_piece)
  3198 + goods_piece=goods_piece-th.data.cut_goods_piece;
3146 //------按件数---------- 3199 //------按件数----------
3147 if (goods_piece > 0 && item['piecemoney']) { 3200 if (goods_piece > 0 && item['piecemoney']) {
3148 fp_price = parseFloat(item['piecemoney']); 3201 fp_price = parseFloat(item['piecemoney']);
@@ -3152,6 +3205,9 @@ Page({ @@ -3152,6 +3205,9 @@ Page({
3152 fp_price = fp_price + m * parseFloat(item['add_piecemoney']); 3205 fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
3153 } 3206 }
3154 } 3207 }
  3208 + //当有包邮和不包邮混合在一起的时候,统一运费要重新计算
  3209 + if(freight_free>0 && o_price >= freight_free && th.data.cut_o_shipping_price && price>0) price=price-th.data.cut_o_shipping_price;
  3210 +
3155 var rspice = parseFloat(price + fw_price + fp_price); 3211 var rspice = parseFloat(price + fw_price + fp_price);
3156 return rspice; 3212 return rspice;
3157 }, 3213 },
@@ -3715,7 +3771,7 @@ Page({ @@ -3715,7 +3771,7 @@ Page({
3715 for (var i in goodlist) { 3771 for (var i in goodlist) {
3716 var gd = goodlist[i]; 3772 var gd = goodlist[i];
3717 //--如果是秒杀就跳出,如果是赠品,如果是组合购,如果是限制使用优惠券-- 3773 //--如果是秒杀就跳出,如果是赠品,如果是组合购,如果是限制使用优惠券--
3718 - if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) { 3774 + if (gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act.is_xz_yh)) {
3719 continue; 3775 continue;
3720 } 3776 }
3721 3777
pages/cart/cart2_inte/cart2_inte.js
@@ -161,19 +161,6 @@ Page({ @@ -161,19 +161,6 @@ Page({
161 161
162 } else { 162 } else {
163 this.getuser_addr(function (ie) { 163 this.getuser_addr(function (ie) {
164 - /*--  
165 - //地址切换要把包邮券清空  
166 - if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){  
167 - var using_quan=th.data.using_quan;  
168 - for(var i in using_quan){  
169 - var item=using_quan[i];  
170 - if(item.isby==1){  
171 - var ob={},txt="using_quan["+i+"]";ob[txt]={};  
172 - th.setData(ob);  
173 - }  
174 - }  
175 -  
176 - }--*/  
177 164
178 //th.data.prom_goods_map={}; 165 //th.data.prom_goods_map={};
179 //更换地址回来要重新调用计算价钱的接口 166 //更换地址回来要重新调用计算价钱的接口
pages/distribution/distribution.js
@@ -3,19 +3,6 @@ const app = getApp(); @@ -3,19 +3,6 @@ const app = getApp();
3 let self = null, os = app.globalData.setting; 3 let self = null, os = app.globalData.setting;
4 var regeneratorRuntime = require('../../utils/runtime.js'); 4 var regeneratorRuntime = require('../../utils/runtime.js');
5 5
6 -// Component({  
7 -// pageLifetimes: {  
8 -// show() {  
9 -// if (typeof this.getTabBar === 'function' && this.getTabBar()) {  
10 -// this.getTabBar().setData({  
11 -// active: 2  
12 -// })  
13 -// }  
14 -// }  
15 -// }  
16 -// })  
17 -  
18 -  
19 Page({ 6 Page({
20 7
21 /** 8 /**
@@ -243,14 +230,6 @@ Page({ @@ -243,14 +230,6 @@ Page({
243 }); 230 });
244 }, 231 },
245 232
246 -  
247 - /**  
248 - * 页面相关事件处理函数--监听用户下拉动作  
249 - */  
250 - onPullDownRefresh: function () {  
251 -  
252 - },  
253 -  
254 /** 233 /**
255 * 用户点击右上角分享 234 * 用户点击右上角分享
256 */ 235 */
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -29,6 +29,7 @@ Page({ @@ -29,6 +29,7 @@ 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 +
32 var th = this; 33 var th = this;
33 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 34 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
34 my_confirm.open_cancel(0); 35 my_confirm.open_cancel(0);
@@ -52,6 +53,7 @@ Page({ @@ -52,6 +53,7 @@ Page({
52 }) 53 })
53 } 54 }
54 55
  56 +
55 getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, { 57 getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {
56 data: { 58 data: {
57 enabled: 1 59 enabled: 1
@@ -70,18 +72,19 @@ Page({ @@ -70,18 +72,19 @@ Page({
70 }); 72 });
71 } 73 }
72 }) 74 })
73 - 75 +
74 76
75 }, 77 },
76 onShow: function () { 78 onShow: function () {
77 //--先判断会员状态-- 79 //--先判断会员状态--
78 - var user_info = getApp().globalData.userInfo;  
79 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
80 - getApp().goto('/pages/togoin/togoin');  
81 - return false;  
82 - }  
83 - this.getList();  
84 - 80 + getApp().is_Single_page(this,function(){
  81 + var user_info = getApp().globalData.userInfo;
  82 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  83 + getApp().goto('/pages/togoin/togoin');
  84 + return false;
  85 + }
  86 + this.getList();
  87 + })
85 }, 88 },
86 89
87 //购买礼包 90 //购买礼包
pages/giftpack/giftpacklist/giftpacklist.js
@@ -40,7 +40,7 @@ Page({ @@ -40,7 +40,7 @@ Page({
40 getUserID: d.user_id, 40 getUserID: d.user_id,
41 }) 41 })
42 42
43 - if(options.lbId) th.data.lbId=options.lbId; 43 + if (options.lbId) th.data.lbId = options.lbId;
44 //-- 获取分享人的ID -- 44 //-- 获取分享人的ID --
45 var first_leader = options.first_leader || getApp().globalData.first_leader; 45 var first_leader = options.first_leader || getApp().globalData.first_leader;
46 if (first_leader) { 46 if (first_leader) {
@@ -60,18 +60,19 @@ Page({ @@ -60,18 +60,19 @@ Page({
60 }, 60 },
61 61
62 onShow: function () { 62 onShow: function () {
63 - //--先判断会员状态--  
64 - var user_info = getApp().globalData.userInfo;  
65 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
66 - getApp().goto('/pages/togoin/togoin');  
67 - return false;  
68 - }  
69 - if (this.data.isBuy == 0) {  
70 - this.GetMyGiftList();  
71 - } else {  
72 - this.GetBuyGiftList();  
73 - }  
74 - 63 + getApp().is_Single_page(this,function () {
  64 + //--先判断会员状态--
  65 + var user_info = getApp().globalData.userInfo;
  66 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  67 + getApp().goto('/pages/togoin/togoin');
  68 + return false;
  69 + }
  70 + if (this.data.isBuy == 0) {
  71 + this.GetMyGiftList();
  72 + } else {
  73 + this.GetBuyGiftList();
  74 + }
  75 + })
75 }, 76 },
76 GetBuyPrice: function (e) { 77 GetBuyPrice: function (e) {
77 var that = this.data; 78 var that = this.data;
@@ -415,13 +416,13 @@ Page({ @@ -415,13 +416,13 @@ Page({
415 if (pagePath.indexOf('/') != 0) { 416 if (pagePath.indexOf('/') != 0) {
416 pagePath = '/' + pagePath; 417 pagePath = '/' + pagePath;
417 } 418 }
418 - pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader="+ this.data.getUserID; 419 + pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader=" + this.data.getUserID;
419 // if (this.data.isBuy == 0) { 420 // if (this.data.isBuy == 0) {
420 // pagePath += "&orderSn=" + this.data.orderSn; 421 // pagePath += "&orderSn=" + this.data.orderSn;
421 // } else { 422 // } else {
422 // pagePath += "&lbId=" + this.data.getGiftID; 423 // pagePath += "&lbId=" + this.data.getGiftID;
423 // } 424 // }
424 - // console.log('pagePath', pagePath); 425 + // console.log('pagePath', pagePath);
425 return { 426 return {
426 title: "礼包详情", 427 title: "礼包详情",
427 path: pagePath, 428 path: pagePath,
@@ -437,12 +438,13 @@ Page({ @@ -437,12 +438,13 @@ Page({
437 if (pagePath.indexOf('/') != 0) { 438 if (pagePath.indexOf('/') != 0) {
438 pagePath = '/' + pagePath; 439 pagePath = '/' + pagePath;
439 } 440 }
440 - pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader="+ this.data.getUserID; 441 + pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID;
441 // if (this.data.isBuy == 0) { 442 // if (this.data.isBuy == 0) {
442 // pagePath += "&orderSn=" + this.data.orderSn; 443 // pagePath += "&orderSn=" + this.data.orderSn;
443 // } else { 444 // } else {
444 // pagePath += "&lbId=" + this.data.getGiftID; 445 // pagePath += "&lbId=" + this.data.getGiftID;
445 // } 446 // }
  447 + console.log('pagePath', pagePath);
446 return { 448 return {
447 title: "礼包详情", 449 title: "礼包详情",
448 path: pagePath, 450 path: pagePath,
@@ -496,7 +498,7 @@ Page({ @@ -496,7 +498,7 @@ Page({
496 getApp().my_warnning(res.data.msg, 0, th); 498 getApp().my_warnning(res.data.msg, 0, th);
497 } 499 }
498 }, 500 },
499 - function (res) {} 501 + function (res) { }
500 502
501 ) 503 )
502 }) 504 })
pages/giftpack/mygiftpack/mygiftpack.js
@@ -74,12 +74,15 @@ Page({ @@ -74,12 +74,15 @@ Page({
74 }, 74 },
75 onShow: function() { 75 onShow: function() {
76 //--先判断会员状态-- 76 //--先判断会员状态--
77 - var user_info = getApp().globalData.userInfo;  
78 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
79 - getApp().goto('/pages/togoin/togoin');  
80 - return false;  
81 - }  
82 - this.getList(); 77 + getApp().is_Single_page(this,function () {
  78 + var user_info = getApp().globalData.userInfo;
  79 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  80 + getApp().goto('/pages/togoin/togoin');
  81 + return false;
  82 + }
  83 + this.getList();
  84 + })
  85 +
83 86
84 }, 87 },
85 getList: function() { 88 getList: function() {
pages/goods/categoryList/categoryList.js
@@ -655,18 +655,7 @@ Page({ @@ -655,18 +655,7 @@ Page({
655 var _errImg = e.target.dataset.errorimg; 655 var _errImg = e.target.dataset.errorimg;
656 var idx = e.target.dataset.idx; 656 var idx = e.target.dataset.idx;
657 var pix = e.target.dataset.pix; 657 var pix = e.target.dataset.pix;
658 - // for(var i=0;i< list.length;i++){  
659 - // for(var j=0;j<list[i].array.length;j++){  
660 - // if(list[i].array[j].logo == ""){  
661 - // list[i].array[j].logo= this.data.iurl+"/miniapp/images/no_brand_def.jpg";  
662 - // }  
663 - // }  
664 - // }  
665 - // this.setData({groups:list})  
666 - // var _errObj = {};  
667 - // _errObj[_errImg] = this.data.iurl+"/miniapp/images/no_brand_def.jpg\n";  
668 - //console.log(this.data.groups)  
669 - //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 658 +
670 }, 659 },
671 //商品图片失败,默认图片 660 //商品图片失败,默认图片
672 goods_bnerr: function (e) { 661 goods_bnerr: function (e) {
@@ -730,13 +719,7 @@ Page({ @@ -730,13 +719,7 @@ Page({
730 this.setData({ 719 this.setData({
731 countDownNum: 3, 720 countDownNum: 3,
732 }); 721 });
733 - // if(e.currentTarget.dataset.index == 223){  
734 - // this.setData({ status_show: 1});  
735 - // }else if(e.currentTarget.dataset.index == 220){  
736 - // this.setData({ status_show: 2});  
737 - // }else{  
738 - // this.setData({ status_show: 0});  
739 - // } 722 +
740 var arr2 = this.data.one_level_classify 723 var arr2 = this.data.one_level_classify
741 for(var i=0;i<arr2.length;i++){ 724 for(var i=0;i<arr2.length;i++){
742 if(i == e.currentTarget.dataset.index){ 725 if(i == e.currentTarget.dataset.index){
@@ -864,38 +847,10 @@ Page({ @@ -864,38 +847,10 @@ Page({
864 wx.stopPullDownRefresh(); 847 wx.stopPullDownRefresh();
865 } 848 }
866 }); 849 });
867 - // //不是商品分组的,不是默认排序的  
868 - // if (t.indexOf("group_id") == -1 || e.data.tabname != "goods_id") {  
869 - // t += "&orderField=" + e.data.tabname;  
870 - // t += "&orderType=" + e.data.adname;  
871 - // }  
872 - // + "&parent_id=0&orderField=goods_id&orderType=desc&page="+this.data.page+"&is_mainshow=1&isonsale=1&store_id=1&is_recommend=1"  
873 - // t += "&page=" + e.data.page;  
874 - // a.request(t,  
875 - // function (t) {  
876 - // e.setData({ is_go: 1 });  
877 - // e.data.page++ , null == e.data.allData && (e.data.allData = Object.assign({}, t.data.result)),  
878 - // wx.stopPullDownRefresh();  
879 - // },  
880 - // null, { is_mainshow: 1, isonsale: 1, store_id: oo.stoid }  
881 - // ); 850 +
882 }, 851 },
883 852
884 - // onReachBottom: function () {  
885 - // console.log('监听上拉:=')  
886 - // var that = this;  
887 - // clearInterval(that.data.timer);  
888 - // that.setData({  
889 - // stylePage: that.data.stylePage + 1,  
890 - // countDownNum: 3,  
891 - // lastMsg: false,  
892 - // });  
893 - // that.style(that.data.stylePage, that.data.cat_id);  
894 - // },  
895 - // onPullDownRefresh: function () {  
896 - // console.log('监听下拉:=' + this.data.requestUrl)  
897 - // this.resetData(), this.requestGoodsList(this.data.requestUrl);  
898 - // }, 853 +
899 // 左侧更新 854 // 左侧更新
900 scrollLower: function (data) { 855 scrollLower: function (data) {
901 if(this.data.is_no_more) return false; 856 if(this.data.is_no_more) return false;
pages/goods/goodsInfo/buy_flash_normal.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="pding"> 3 <view class="pding">
4 <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon> 4 <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
5 <view class="spec-goods"> 5 <view class="spec-goods">
6 - <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> 6 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
7 <view class="spec-goods-info"> 7 <view class="spec-goods-info">
8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> 8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
9 <view class="flex ai_end xc-val-money"> 9 <view class="flex ai_end xc-val-money">
pages/goods/goodsInfo/buy_integral.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="pding"> 3 <view class="pding">
4 <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon> 4 <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon>
5 <view class="spec-goods"> 5 <view class="spec-goods">
6 - <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> 6 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
7 <view class="spec-goods-info"> 7 <view class="spec-goods-info">
8 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view> 8 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
9 <view class="flex ai_end xc-val-money"> 9 <view class="flex ai_end xc-val-money">
pages/goods/goodsInfo/buy_integral_normal.wxml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="pding"> 3 <view class="pding">
4 <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon> 4 <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
5 <view class="spec-goods"> 5 <view class="spec-goods">
6 - <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> 6 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
7 <view class="spec-goods-info"> 7 <view class="spec-goods-info">
8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> 8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
9 <view class="flex ai_end xc-val-money"> 9 <view class="flex ai_end xc-val-money">
pages/goods/goodsInfo/buy_pt.wxml
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 5
6 <!-- 商品名称 --> 6 <!-- 商品名称 -->
7 <view class="spec-goods"> 7 <view class="spec-goods">
8 - <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> 8 + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
9 <view class="spec-goods-info"> 9 <view class="spec-goods-info">
10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view> 10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
11 <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" > 11 <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
pages/goods/goodsInfo/goodsInfo.js
@@ -8,6 +8,9 @@ var t = require(&quot;../../../utils/util.js&quot;), @@ -8,6 +8,9 @@ var t = require(&quot;../../../utils/util.js&quot;),
8 oo = s.globalData, 8 oo = s.globalData,
9 o = s.globalData.setting, 9 o = s.globalData.setting,
10 os = o; 10 os = o;
  11 +
  12 +let self = null;
  13 +
11 //评价加载更多 14 //评价加载更多
12 var more = function (e) { 15 var more = function (e) {
13 return e && e.__esModule ? e : { 16 return e && e.__esModule ? e : {
@@ -25,7 +28,7 @@ Page({ @@ -25,7 +28,7 @@ Page({
25 color_type: 0, //线条控制 28 color_type: 0, //线条控制
26 color_type_one: 0, 29 color_type_one: 0,
27 color_type_two: 1, 30 color_type_two: 1,
28 - 31 + is_no_plus:1,
29 gid: "", 32 gid: "",
30 stoid: o.stoid, 33 stoid: o.stoid,
31 url: o.url, 34 url: o.url,
@@ -251,6 +254,7 @@ Page({ @@ -251,6 +254,7 @@ Page({
251 254
252 share_hidden: false, 255 share_hidden: false,
253 all_activity_list: null, //所有活动的列表 256 all_activity_list: null, //所有活动的列表
  257 +
254 }, 258 },
255 259
256 //------初始化加载---------- 260 //------初始化加载----------
@@ -265,7 +269,8 @@ Page({ @@ -265,7 +269,8 @@ Page({
265 prom_type = t.prom_type, 269 prom_type = t.prom_type,
266 prom_id = t.prom_id; //活动ID 270 prom_id = t.prom_id; //活动ID
267 271
268 - 272 + self = this;
  273 +
269 //-- 自定义海报 -- 274 //-- 自定义海报 --
270 getApp().request.promiseGet("/api/weshop/goods/poster/page", { 275 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
271 data: {store_id: os.stoid, type: 1, is_use: 1} 276 data: {store_id: os.stoid, type: 1, is_use: 1}
@@ -354,6 +359,22 @@ Page({ @@ -354,6 +359,22 @@ Page({
354 th.data.c_guide_id = c_guide_id; 359 th.data.c_guide_id = c_guide_id;
355 } 360 }
356 361
  362 + //调用接口判断商家plus有没有过期
  363 + i.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  364 + if (res.data.code == 0) {
  365 + var arr = res.data.data.pageData;
  366 + if (arr.length > 0) {
  367 + var item = arr[0];
  368 + if (item.is_sy == 0) {
  369 + var now = Date.parse(new Date()); now = now / 1000;
  370 + if (item.end_time < now) {
  371 + th.setData({ is_no_plus: 0 })
  372 + }
  373 + }
  374 + }
  375 + }
  376 + })
  377 +
357 getApp().getConfig(function (e) { 378 getApp().getConfig(function (e) {
358 ee.setData({sto_sele_name_1: e.store_name}) 379 ee.setData({sto_sele_name_1: e.store_name})
359 }) 380 })
@@ -511,7 +532,9 @@ Page({ @@ -511,7 +532,9 @@ Page({
511 //更新点击量 532 //更新点击量
512 getApp().request.put("/api/weshop/goods/updateClick", { 533 getApp().request.put("/api/weshop/goods/updateClick", {
513 data: {store_id: os.stoid, goods_id: gid} 534 data: {store_id: os.stoid, goods_id: gid}
514 - }) 535 + });
  536 +
  537 +
515 }, 538 },
516 539
517 540
@@ -963,8 +986,27 @@ Page({ @@ -963,8 +986,27 @@ Page({
963 }) 986 })
964 987
965 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 988 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
966 -  
967 - }, 989 +
  990 +
  991 +
  992 + },
  993 +
  994 + onReady() {
  995 +
  996 + setTimeout(()=>{
  997 + wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
  998 + // console.log('node@@@@@@@', res);
  999 + if(res.length != 0) {
  1000 + this.setData({
  1001 + showFold: res[0].height < res[1].height,
  1002 + });
  1003 + };
  1004 +
  1005 + }).exec();
  1006 + }, 1000);
  1007 +
  1008 + },
  1009 +
968 enterAddress: function () { 1010 enterAddress: function () {
969 this.data.enterAddressPage = !0, wx.navigateTo({ 1011 this.data.enterAddressPage = !0, wx.navigateTo({
970 url: "/pages/user/address_list/address_list?operate=selectAddress" 1012 url: "/pages/user/address_list/address_list?operate=selectAddress"
@@ -3590,7 +3632,6 @@ Page({ @@ -3590,7 +3632,6 @@ Page({
3590 pageSize: 1000 3632 pageSize: 1000
3591 } 3633 }
3592 }).then(res => { 3634 }).then(res => {
3593 -  
3594 let pd_list = res.data.data.pageData; 3635 let pd_list = res.data.data.pageData;
3595 if (res.data.code == 0 && pd_list.length > 0) { 3636 if (res.data.code == 0 && pd_list.length > 0) {
3596 flag = pd_list.some(pd => { 3637 flag = pd_list.some(pd => {
@@ -3773,6 +3814,20 @@ Page({ @@ -3773,6 +3814,20 @@ Page({
3773 return param < 10 ? '0' + param : param; 3814 return param < 10 ? '0' + param : param;
3774 }, 3815 },
3775 3816
  3817 + // 显示拼单规则
  3818 + showRules: function() {
  3819 + this.setData({
  3820 + showRules: true,
  3821 + });
  3822 + },
  3823 +
  3824 + // 关闭拼单规则
  3825 + closeRules: function() {
  3826 + this.setData({
  3827 + showRules: false,
  3828 + });
  3829 + },
  3830 +
3776 //----倒计时函数----- 3831 //----倒计时函数-----
3777 countDown(time, prom_st) { 3832 countDown(time, prom_st) {
3778 if (!this.data.is_timer) return false; 3833 if (!this.data.is_timer) return false;
@@ -4306,6 +4361,7 @@ Page({ @@ -4306,6 +4361,7 @@ Page({
4306 go_cj_team: function (e) { 4361 go_cj_team: function (e) {
4307 var ind = e.currentTarget.dataset.ind; 4362 var ind = e.currentTarget.dataset.ind;
4308 var item = this.data.teamgroup[ind]; 4363 var item = this.data.teamgroup[ind];
  4364 + var goods_id = e.currentTarget.dataset.goodsid;
4309 var id = item.id; 4365 var id = item.id;
4310 var th = this; 4366 var th = this;
4311 4367
@@ -4350,15 +4406,17 @@ Page({ @@ -4350,15 +4406,17 @@ Page({
4350 getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); 4406 getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
4351 4407
4352 } else { 4408 } else {
  4409 + console.log(222,goods_id)
4353 wx.navigateTo({ 4410 wx.navigateTo({
4354 - url: "/pages/team/team_show/team_show?tg_id=" + id, 4411 + url: "/pages/team/team_show/team_show?tg_id=" + id +"&goods_id="+goods_id,
4355 }); 4412 });
4356 } 4413 }
4357 } 4414 }
4358 //--跳转到参团-- 4415 //--跳转到参团--
4359 else { 4416 else {
  4417 + console.log(1111,th.data.goods_id)
4360 wx.navigateTo({ 4418 wx.navigateTo({
4361 - url: "/pages/team/team_show/team_show?tg_id=" + id, 4419 + url: "/pages/team/team_show/team_show?tg_id=" + id+"&goods_id="+goods_id,
4362 }); 4420 });
4363 } 4421 }
4364 } 4422 }
@@ -4463,12 +4521,44 @@ Page({ @@ -4463,12 +4521,44 @@ Page({
4463 if (quan_list) { 4521 if (quan_list) {
4464 for (var ind in quan_list) { 4522 for (var ind in quan_list) {
4465 var ep = quan_list[ind]; 4523 var ep = quan_list[ind];
4466 - var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");  
4467 - var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");  
4468 - start = start.replace("00:00:00", "");  
4469 - end = end.replace("00:00:00", ""); 4524 + var start = "";
  4525 + var end = "";
  4526 + if(ep.endtype == 1){
  4527 + if(ep.starttype == 1) {
  4528 + start = ut.formatTime(ut.gettimestamp()+3600*24*ep.startdays,"yyyy-MM-dd");
  4529 + }else{
  4530 + start = ut.formatTime(ut.gettimestamp(),"yyyy-MM-dd");
  4531 + }
  4532 + if(ep.days > 0) {
  4533 + end = ut.formatTime(ut.gettimestamp()+3600*24*ep.startdays+3600*24*ep.days,"yyyy-MM-dd");
  4534 + }else{
  4535 + end = "不限";
  4536 + }
  4537 + }else {
  4538 + if(ep.starttype == 1 ){
  4539 + start = ut.formatTime(ut.gettimestamp()+3600*24*ep.startdays,"yyyy-MM-dd");
  4540 + }else{
  4541 + if(ep.starttype == 0 && ep.use_start_time >0) {
  4542 + start = ut.formatTime(ep.use_start_time ,"yyyy-MM-dd");
  4543 + }else{
  4544 + start = "不限"
  4545 + }
  4546 + }
  4547 +
  4548 + if(ep.use_end_time > 0 ) {
  4549 + end = ut.formatTime(ep.use_end_time ,"yyyy-MM-dd");
  4550 + }else{
  4551 + end = "不限"
  4552 + }
  4553 + }
4470 quan_list[ind].start = start; 4554 quan_list[ind].start = start;
4471 quan_list[ind].end = end; 4555 quan_list[ind].end = end;
  4556 + // var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");
  4557 + // var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");
  4558 + // start = start.replace("00:00:00", "");
  4559 + // end = end.replace("00:00:00", "");
  4560 + // quan_list[ind].start = start;
  4561 + // quan_list[ind].end = end;
4472 } 4562 }
4473 } 4563 }
4474 4564
@@ -4618,7 +4708,7 @@ Page({ @@ -4618,7 +4708,7 @@ Page({
4618 context.setLineJoin('round'); //交点设置成圆角 4708 context.setLineJoin('round'); //交点设置成圆角
4619 context.setFillStyle("white") 4709 context.setFillStyle("white")
4620 context.setTextAlign('left'); 4710 context.setTextAlign('left');
4621 - context.fillText('强烈推荐', 64 * unit, 672 * unit); 4711 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
4622 // 7.商品价格 4712 // 7.商品价格
4623 let price = '¥' + this.data.data.shop_price; 4713 let price = '¥' + this.data.data.shop_price;
4624 4714
@@ -6521,6 +6611,22 @@ Page({ @@ -6521,6 +6611,22 @@ Page({
6521 6611
6522 closeSpecModal_flash_normal: function () { 6612 closeSpecModal_flash_normal: function () {
6523 this.setData({openSpecModal_flash_normal: 0}); 6613 this.setData({openSpecModal_flash_normal: 0});
6524 - } 6614 + },
  6615 +
  6616 +
  6617 + // 预览海报
  6618 + previewPoster() {
  6619 + wx.previewImage({
  6620 + current: this.data.shareImgPath, // 当前显示图片的http链接
  6621 + urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
  6622 + });
  6623 + },
  6624 +
  6625 +
  6626 +
  6627 +
  6628 +
  6629 +
  6630 +
6525 6631
6526 }) 6632 })
pages/goods/goodsInfo/goodsInfo.wxml
@@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
6 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 6 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
7 <block wx:if="{{isshow}}"> 7 <block wx:if="{{isshow}}">
8 <view class="container"> 8 <view class="container">
  9 + <!-- 拼单规则规则 -->
  10 + <view wx:if="{{prom_type== 6}}" class="rules" bindtap="showRules">规则</view>
9 <view class="type-navbar"> 11 <view class="type-navbar">
10 <view class="type-box" wx:for="{{categories}}" wx:key="id"> 12 <view class="type-box" wx:for="{{categories}}" wx:key="id">
11 <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">{{item.name}}</view> 13 <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">{{item.name}}</view>
@@ -14,7 +16,7 @@ @@ -14,7 +16,7 @@
14 <view class="goods-detail"> 16 <view class="goods-detail">
15 <view class="goods-info" style="position: relative;" hidden="{{activeCategoryId==0?false:true}}"> 17 <view class="goods-info" style="position: relative;" hidden="{{activeCategoryId==0?false:true}}">
16 18
17 - <!-- 历史购买记录 --> 19 + <!-- 左上角轮播 历史购买记录 -->
18 <view class="swiper-container" wx:if="{{historyBuyInfo.length}}"> 20 <view class="swiper-container" wx:if="{{historyBuyInfo.length}}">
19 <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000"> 21 <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
20 <swiper-item class="swiper-item" wx:for="{{historyBuyInfo}}" wx:key="order_id"> 22 <swiper-item class="swiper-item" wx:for="{{historyBuyInfo}}" wx:key="order_id">
@@ -24,7 +26,6 @@ @@ -24,7 +26,6 @@
24 </view> 26 </view>
25 <view class="flex ai_c pd10"> 27 <view class="flex ai_c pd10">
26 <view class="nickname ellipsis-1x">{{item.nickname}}下单成功</view> 28 <view class="nickname ellipsis-1x">{{item.nickname}}下单成功</view>
27 - <!-- <view style="flex-shrink: 0;"></view> -->  
28 </view> 29 </view>
29 </view> 30 </view>
30 </swiper-item> 31 </swiper-item>
@@ -183,8 +184,8 @@ @@ -183,8 +184,8 @@
183 {{data.goods_name}} 184 {{data.goods_name}}
184 </view> 185 </view>
185 <!-- 这个是分享按钮 --> 186 <!-- 这个是分享按钮 -->
186 - <view class="xc-share-frame t-c" bindtap="clickShare">  
187 - <view class="iconfont icon-share fs60"></view> 187 + <view class="xc-share-frame t-c shrink0" bindtap="clickShare">
  188 + <view class="iconfont icon-share"></view>
188 <view class="fs22 c-7b">分享</view> 189 <view class="fs22 c-7b">分享</view>
189 </view> 190 </view>
190 </view> 191 </view>
@@ -215,7 +216,7 @@ @@ -215,7 +216,7 @@
215 </view> 216 </view>
216 </view> 217 </view>
217 <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup"> 218 <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup">
218 - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}"> 219 + <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}" data-goodsid="{{data.goods_id}}">
219 <!-- <view class="flex ai_c"> --> 220 <!-- <view class="flex ai_c"> -->
220 <!-- //选项框头像 --> 221 <!-- //选项框头像 -->
221 <view class='gtou'> 222 <view class='gtou'>
@@ -265,9 +266,9 @@ @@ -265,9 +266,9 @@
265 </view> 266 </view>
266 <!-- 这个是分享按钮 --> 267 <!-- 这个是分享按钮 -->
267 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> 268 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
268 - <view class="xc-share-frame t-c" bindtap="clickShare"> 269 + <view class="xc-share-frame t-c shrink0" bindtap="clickShare">
269 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> 270 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
270 - <view class="iconfont icon-share fs60"></view> 271 + <view class="iconfont icon-share"></view>
271 <!-- <view class="share-font">1分享</view> --> 272 <!-- <view class="share-font">1分享</view> -->
272 <view class="fs22 c-7b">分享</view> 273 <view class="fs22 c-7b">分享</view>
273 </view> 274 </view>
@@ -289,7 +290,7 @@ @@ -289,7 +290,7 @@
289 290
290 <view class="goods-price"> 291 <view class="goods-price">
291 292
292 - <view class="flex jc_sb"> 293 + <view class="flex jc_sb ai_c">
293 <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}"> 294 <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}">
294 295
295 <view class="market-price flex" style="align-items: baseline;"> 296 <view class="market-price flex" style="align-items: baseline;">
@@ -316,15 +317,15 @@ @@ -316,15 +317,15 @@
316 </view> 317 </view>
317 </view> 318 </view>
318 <!-- 这个是分享按钮 --> 319 <!-- 这个是分享按钮 -->
319 - <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1 && prom_type != 2}}"> 320 + <view class="xc-share-frame t-c shrink0" bindtap="clickShare" wx:if="{{prom_type != 1 && prom_type != 2}}">
320 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> 321 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
321 - <view class="iconfont icon-share fs60"></view> 322 + <view class="iconfont icon-share"></view>
322 <view class="fs22 c-7b">分享</view> 323 <view class="fs22 c-7b">分享</view>
323 </view> 324 </view>
324 </view> 325 </view>
325 <!-- 不是秒杀 --> 326 <!-- 不是秒杀 -->
326 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 --> 327 <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->
327 - <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && prom_type!=2 && prom_type!=4 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> 328 + <view class="flex ai_and" wx:if="{{!card_field && is_no_plus && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && prom_type!=2 && prom_type!=4 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}">
328 <view class="flex ai-center grade-card-frame card-frame"> 329 <view class="flex ai-center grade-card-frame card-frame">
329 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> 330 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
330 <view class="fs24 white view card-name ellipsis-1"> 331 <view class="fs24 white view card-name ellipsis-1">
@@ -336,7 +337,7 @@ @@ -336,7 +337,7 @@
336 </view> 337 </view>
337 </view> 338 </view>
338 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> 339 <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 -->
339 - <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}"> 340 + <block wx:if="{{g_filters.is_has_rank(rank_switch,data) && is_no_plus}}">
340 <!-- 不是秒杀,且会员不是等级会员 --> 341 <!-- 不是秒杀,且会员不是等级会员 -->
341 <view wx:if="{{!card_field && prom_type!=1 && prom_type!=2 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> 342 <view wx:if="{{!card_field && prom_type!=1 && prom_type!=2 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}">
342 <view class="beauty-makeup-frame flex ai-center"> 343 <view class="beauty-makeup-frame flex ai-center">
@@ -400,7 +401,7 @@ @@ -400,7 +401,7 @@
400 </view> 401 </view>
401 402
402 <view wx:if="{{prom_type==1}}"> 403 <view wx:if="{{prom_type==1}}">
403 - <view class="flex jc_sb"> 404 + <view class="flex jc_sb ai_c">
404 <view class="flex" style="align-items: baseline;"> 405 <view class="flex" style="align-items: baseline;">
405 <view class="flex xc-price-frame"> 406 <view class="flex xc-price-frame">
406 <text class="fs30">¥</text> 407 <text class="fs30">¥</text>
@@ -410,9 +411,9 @@ @@ -410,9 +411,9 @@
410 </view> 411 </view>
411 <!-- 这个是分享按钮 --> 412 <!-- 这个是分享按钮 -->
412 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> 413 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
413 - <view class="xc-share-frame t-c" bindtap="clickShare"> 414 + <view class="xc-share-frame t-c shrink0" bindtap="clickShare">
414 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> 415 <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->
415 - <view class="iconfont icon-share fs60"></view> 416 + <view class="iconfont icon-share"></view>
416 <!-- <view class="share-font">1分享</view> --> 417 <!-- <view class="share-font">1分享</view> -->
417 <view class="fs22 c-7b">分享</view> 418 <view class="fs22 c-7b">分享</view>
418 </view> 419 </view>
@@ -432,8 +433,8 @@ @@ -432,8 +433,8 @@
432 <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> 433 <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}">
433 <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view> 434 <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view>
434 <!-- 这个是分享按钮 --> 435 <!-- 这个是分享按钮 -->
435 - <view class="xc-share-frame t-c" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;">  
436 - <view class="iconfont icon-share fs60"></view> 436 + <view class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;">
  437 + <view class="iconfont icon-share"></view>
437 <view class="fs22 c-7b">分享</view> 438 <view class="fs22 c-7b">分享</view>
438 </view> 439 </view>
439 </view> 440 </view>
@@ -662,15 +663,17 @@ @@ -662,15 +663,17 @@
662 </block> 663 </block>
663 664
664 <!-- 保障服务 --> 665 <!-- 保障服务 -->
665 - <view class="bz_view flex bdt16" wx:if="{{bconfig}}" style=""> 666 + <view class="bz_view flex bdt16 ai_c" wx:if="{{bconfig.service_bz}}">
666 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> 667 <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>
667 - <view class="flex f1 ai_c rel">  
668 - <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{bconfig.service_bz}}</view>  
669 - <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow">  
670 - <text class="bg_jj {{flag?'down1':''}}"></text> 668 + <view class="flex f1 ai_c rel" style="position: relative;" bindtap="{{showFold ? 'clickCollapse':''}}">
  669 + <view class="bz-content showArea {{flag ? '':'ellipsis-1x'}}">{{bconfig.service_bz}}</view>
  670 + <view class="bz-content hideArea">{{bconfig.service_bz}}</view>
  671 + <view class="cx-obtain-coupon wsize arrow" wx:if="{{showFold}}">
  672 + <text class="bg_jj down {{flag ? 'up':''}}"></text>
671 </view> 673 </view>
672 </view> 674 </view>
673 </view> 675 </view>
  676 +
674 <!-- - 搭配促销 -- --> 677 <!-- - 搭配促销 -- -->
675 <view class="dp_cx_view" wx:if="{{collocationGoods}}"> 678 <view class="dp_cx_view" wx:if="{{collocationGoods}}">
676 <view class="bb_view"> 679 <view class="bb_view">
@@ -1466,7 +1469,7 @@ @@ -1466,7 +1469,7 @@
1466 <view class="top-frame"> 1469 <view class="top-frame">
1467 <view class="xc-coupon-frame "> 1470 <view class="xc-coupon-frame ">
1468 <!-- -单张的券- --> 1471 <!-- -单张的券- -->
1469 - <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}"> 1472 + <view class="rel" wx:for="{{quan_list}}" wx:key="id">
1470 <view class="coupon flex"> 1473 <view class="coupon flex">
1471 <view class="circle xc-circular-one"></view> 1474 <view class="circle xc-circular-one"></view>
1472 <view class="xc-coupon-left "> 1475 <view class="xc-coupon-left ">
@@ -1500,6 +1503,7 @@ @@ -1500,6 +1503,7 @@
1500 </view> 1503 </view>
1501 </view> 1504 </view>
1502 </view> 1505 </view>
  1506 +<view class="mask" catchtouchmove="true" wx:if="{{showRules}}"></view>
1503 <!-- 选择门店的弹框,1.1版最新的 --> 1507 <!-- 选择门店的弹框,1.1版最新的 -->
1504 <block wx:if="{{store==1}}"> 1508 <block wx:if="{{store==1}}">
1505 <view class="mongolia-layer" bindtap="close_popup"></view> 1509 <view class="mongolia-layer" bindtap="close_popup"></view>
@@ -1642,7 +1646,7 @@ @@ -1642,7 +1646,7 @@
1642 </block> 1646 </block>
1643 <!-- ---------------分享弹窗--------------- --> 1647 <!-- ---------------分享弹窗--------------- -->
1644 <!-- 二维码显示页面 --> 1648 <!-- 二维码显示页面 -->
1645 -<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> 1649 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas>
1646 <warn id="warn"></warn> 1650 <warn id="warn"></warn>
1647 <!-- 分享控件,底部弹出 --> 1651 <!-- 分享控件,底部弹出 -->
1648 <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> 1652 <share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
@@ -1650,7 +1654,7 @@ @@ -1650,7 +1654,7 @@
1650 <view class="mask" catchtap="closePoster"></view> 1654 <view class="mask" catchtap="closePoster"></view>
1651 <view class="poster-container"> 1655 <view class="poster-container">
1652 <view class="poster-wrapper"> 1656 <view class="poster-wrapper">
1653 - <view class="poster"> 1657 + <view class="poster" bindtap="previewPoster">
1654 <!-- <view class="poster" bindtap="previewImage"> --> 1658 <!-- <view class="poster" bindtap="previewImage"> -->
1655 <image src="{{shareImgPath}}" class="poster-img"></image> 1659 <image src="{{shareImgPath}}" class="poster-img"></image>
1656 <view class="btn-close" catchtap="closePoster"> 1660 <view class="btn-close" catchtap="closePoster">
@@ -1688,6 +1692,28 @@ @@ -1688,6 +1692,28 @@
1688 </view> 1692 </view>
1689 </view> 1693 </view>
1690 1694
  1695 +<view class="rule-pop-container" wx:if="{{showRules}}">
  1696 + <view class="pop-title">规则详情
  1697 + <text class="iconfont icon-guan" bindtap="closeRules"></text>
  1698 + </view>
  1699 + <view class="pdt40">
  1700 + <view class="pdb20">活动时间</view>
  1701 + <view class="">{{filters.format_time(prom_act.start_time,1)}} 至 {{filters.format_time(prom_act.end_time,1)}}
  1702 + </view>
  1703 + </view>
  1704 + <view class="pdt40">
  1705 + <view class="pdb20">活动内容</view>
  1706 + <view class="popup-content">
  1707 + <text class="pdb10">{{prom_act.remark}}</text>
  1708 + </view>
  1709 + </view>
  1710 +
  1711 +
  1712 + <view class="pdv20">
  1713 + <view class="btn" bindtap="closeRules">我知道了</view>
  1714 + </view>
  1715 + </view>
  1716 +
1691 <!-- 弹起来,购买预热商品的普通购买 --> 1717 <!-- 弹起来,购买预热商品的普通购买 -->
1692 <view hidden="{{!openSpecModal_flash_normal}}"> 1718 <view hidden="{{!openSpecModal_flash_normal}}">
1693 <include src="buy_flash_normal.wxml" /> 1719 <include src="buy_flash_normal.wxml" />