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
1 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 3 var regeneratorRuntime = require('./utils/runtime.js');
4 4 var api = require("./api/api.js")
5   -
  5 +// import { pluginGD } from './utils/ai_config/config'
6 6 //公共方法和变量
7 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 75 auth: o,
77 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 84 this.initExt();
81 85  
82 86 //检查更新
... ... @@ -88,52 +92,52 @@ App({
88 92 var clientWidth = wx.getSystemInfoSync().windowWidth;
89 93 var rpxR = 750 / clientWidth;
90 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 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 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 137 var pages = getCurrentPages(); //获取加载的页面
134 138 var currentPage = pages[pages.length - 1]; //获取当前页面的对象
135 139  
136   - if(!th.globalData.wxapp_buy_obj) {
  140 + if (!th.globalData.wxapp_buy_obj) {
137 141 var turl = "/api/weshop/storeconfig/get/" + th.globalData.setting.stoid;
138 142 th.promiseGet(turl, {}).then(res => {
139 143 var o = res;
... ... @@ -176,7 +180,7 @@ App({
176 180 })
177 181  
178 182 }
179   - else{
  183 + else {
180 184 var tt = th.globalData.wxapp_buy_obj;
181 185 if (tt && tt.isout == 1) {
182 186 th.promiseGet('/api/weshop/store/get/' + t.stoid, {}).then(res => {
... ... @@ -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 211 console.log("initExt");
208 212 console.log(11);
209 213 var t = wx.getExtConfigSync(), o = this.globalData.setting;
210 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 231 var s = this;
228 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 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 333 void 0 === t && (t = 1);
330 334 var o = getCurrentPages();
331 335 return o[o.length - t - 1].data;
332 336 },
333   - showLoading: function(t, o) {
  337 + showLoading: function (t, o) {
334 338 void 0 === o && (o = 1500), wx.showToast({
335 339 title: "加载中",
336 340 icon: "loading",
337 341 duration: o,
338 342 mask: !0,
339   - complete: function() {
  343 + complete: function () {
340 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 349 void 0 === a && (a = 1e3), wx.showToast({
346 350 title: t,
347 351 icon: "success",
348 352 duration: a,
349 353 mask: !0,
350   - complete: function() {
  354 + complete: function () {
351 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 360 //var imghost=this.globalData.setting.imghost;
357 361 !a && (a = 1500), void 0 === e && (e = !0), wx.showToast({
358 362 title: t,
359 363 mask: e,
360 364 duration: a,
361   - image:"/images/gt.png",
362   - complete: function() {
  365 + icon: 'error',
  366 + // image: "/images/gt.png",
  367 + complete: function () {
363 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 374 wx.showModal({
370 375 title: t,
371 376 showCancel: !1,
372   - complete: function() {
  377 + complete: function () {
373 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 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 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 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 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 480 //wx.navigateTo({ url: url, }) //跳到非tabbar页
464 481 },
465 482  
466 483 //显示提示,word提示内容,type 0失败,提示 1成功
467   - my_warnning(word,type,that,width){
  484 + my_warnning(word, type, that, width) {
468 485 var warn = that.selectComponent("#warn"); //组件的id
469   - warn.open(word,type,width);
  486 + warn.open(word, type, width);
470 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 493 this.getConfig2(function (conf) {
478 494 //---空会员的情况---
479   - if(!th.globalData.userInfo){
  495 + if (!th.globalData.userInfo) {
480 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 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 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 597 this.request.get("/api/weshop/cart/page", {
582   - isShoeLoading:false,
  598 + isShoeLoading: false,
583 599 data: {
584 600 store_id: this.globalData.setting.stoid,
585 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 607 var num = 0;
592   - if(e.data.data && e.data.data.pageData) {
  608 + if (e.data.data && e.data.data.pageData) {
593 609 for (var i = 0; i < e.data.data.pageData.length; i++) {
594 610 num += e.data.data.pageData[i].goods_num;
595 611 }
... ... @@ -600,131 +616,131 @@ App({
600 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 621 store_id: that.globalData.setting.stoid,
606 622 user_id: that.globalData.user_id,
607 623 }
608   - }).then(res=>{
  624 + }).then(res => {
609 625  
610 626 for (var i = 0; i < res.data.data.pageData.length; i++) {
611 627 num += res.data.data.pageData[i].goods_num;
612 628 }
613 629  
614   - that.globalData.cartGoodsNum=num;
  630 + that.globalData.cartGoodsNum = num;
615 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 665 clearInterval(page.data[key]);
650 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 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 737 return new Promise((resolve, reject) => {
722 738 data.isShowLoading && wx.showLoading();
723 739 wx.request({
724 740 url,
725 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 744 success(res) {
729 745 data.isShowLoading && wx.hideLoading();
730 746 resolve(res);
... ... @@ -736,40 +752,40 @@ App({
736 752  
737 753  
738 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 791 checkUpdateVersion() {
... ... @@ -777,19 +793,21 @@ App({
777 793 if (wx.canIUse('getUpdateManager')) {
778 794 //创建 UpdateManager 实例
779 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 801 console.log('是否获取版本');
784 802 // 请求完新版本信息的回调
785 803 if (res.hasUpdate) {
786 804 //监听小程序有版本更新事件
787   - updateManager.onUpdateReady(function() {
  805 + updateManager.onUpdateReady(function () {
788 806  
789 807 //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作)
790 808 updateManager.applyUpdate();
791 809 })
792   - updateManager.onUpdateFailed(function() {
  810 + updateManager.onUpdateFailed(function () {
793 811 // 新版本下载失败
794 812 wx.showModal({
795 813 title: '已经有新版本喽~',
... ... @@ -810,6 +828,6 @@ App({
810 828  
811 829  
812 830  
813   -
  831 +
814 832  
815 833 });
... ...
app.json
... ... @@ -19,10 +19,8 @@
19 19 "pages/user/coupon/coupon",
20 20 "pages/user/checkcoupon/checkcoupon",
21 21 "pages/user/add_address/add_address",
22   - "pages/user/withdrawals_list/withdrawals_list",
23 22 "pages/user/return_goods_info/return_goods_info",
24 23 "pages/user/return_goods/return_goods",
25   - "pages/user/withdrawals/withdrawals",
26 24 "pages/user/express/express",
27 25 "pages/user/get_user_info/get_user_info",
28 26 "pages/activity/seckill_list/seckill_list",
... ... @@ -155,7 +153,6 @@
155 153 "pages/video/index",
156 154 "pages/boxes-list/boxes-list",
157 155 "pages/boxes-details/boxes-details"
158   -
159 156 ]
160 157 },
161 158 {
... ... @@ -195,6 +192,7 @@
195 192 "pages/AI-test-skin/analyse/analyse"
196 193 ]
197 194 }
  195 +
198 196 ],
199 197 "permission": {
200 198 "scope.userLocation": {
... ... @@ -256,4 +254,5 @@
256 254 "useExtendedLib": {
257 255 "weui": true
258 256 }
  257 +
259 258 }
260 259 \ No newline at end of file
... ...
app.wxss
... ... @@ -743,9 +743,25 @@ background: #ffe3e2;
743 743 /* 图标字体(ty) */
744 744 @font-face {
745 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 767 .icon-suoxiao:before {
... ...
components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -46,6 +46,7 @@ Component({
46 46 title_index: 0,
47 47 swiper_hei: 0,
48 48 title_class: "",
  49 + is_no_plus: 1,
49 50 },
50 51  
51 52 ready: function () { },
... ... @@ -106,7 +107,7 @@ Component({
106 107 }
107 108 if (this.data.object.bg_color) {
108 109 this.setData({
109   - bg_color:this.data.object.bg_color,
  110 + bg_color: this.data.object.bg_color,
110 111 })
111 112 }
112 113 this.setData({
... ... @@ -190,38 +191,8 @@ Component({
190 191 th.data.loading = 0;
191 192  
192 193 if (res.data.code == 0 && res.data.data) {
193   -
194 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 195 th.set_good(goods);
224   -
225 196 //---控制有没有加载更多的按钮---
226 197 if (th.data.firist_type_curr >= len) { th.setData({ goods_btn: [] }); }
227 198 else th.setData({ goods_btn: [1, 2] });
... ... @@ -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 441 var val = goods[i];
456 442 var item = {};
457 443 var prom_id = null;
458   - //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => {
459 444  
460 445 var url = "/api/weshop/activitylist/getGoodActInfo";
461 446 var req_data = {
... ...
components/diy_goodsGroup/diy_goodsGroup.wxml
... ... @@ -102,7 +102,7 @@
102 102 </block>
103 103 <block wx:else>
104 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 106 <view class="money flex">
107 107 <!-- 办卡价 -->
108 108 <view class="flex xc-wc">
... ... @@ -253,7 +253,7 @@
253 253 </block>
254 254 <block wx:else>
255 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 257 <view class="money flex">
258 258 <!-- 办卡价 -->
259 259 <view class="flex xc-wc">
... ... @@ -403,7 +403,7 @@
403 403 </block>
404 404 <block wx:else>
405 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 407 <view class="money flex">
408 408 <!-- 办卡价 -->
409 409 <view class="flex xc-wc">
... ... @@ -577,7 +577,7 @@
577 577 <!-- 等级价 -->
578 578 <view class="price flex ai_and">
579 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 581 <view class="card_bg">
582 582 <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}
583 583 </view>
... ... @@ -734,7 +734,7 @@
734 734 </block>
735 735 <block wx:else>
736 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 738 <view class="money flex">
739 739 <!-- 办卡价 -->
740 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 1 var t = getApp(),
8 2 a = t.request,
9 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 2 var t = getApp(),
8 3 a = t.request,
9 4 o = t.globalData.setting,
... ...
components/diy_richtext/diy_richtext.js
... ... @@ -4,7 +4,7 @@ Component({
4 4  
5 5 nodes: {
6 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 9 my:{
10 10 type: String,
... ...
components/diy_richtext/diy_richtext.wxml
1   -<!--pages/diy_fwb/diy_fwb.wxml-->
2 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 15 <view class='sp' wx:if="{{object.style==1}}">
16 16 <swiper-item class="s_it" wx:for="{{goods_array}}">
17 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 20 <view class='one'>
20 21 <view class='sp_top'>
21 22 <view class='po'></view>
... ... @@ -74,10 +75,13 @@
74 75 </view>
75 76 </swiper>
76 77  
  78 +
  79 +
77 80 <view class="sp2" wx:if="{{object.style==2}}">
78 81 <block wx:for="{{goods_array}}">
79 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 85 <view class='one1'>
82 86  
83 87 <view class="o1_img">
... ...
components/diy_serviceCard/diy_serviceCard.js
... ... @@ -226,33 +226,6 @@ Component({
226 226 if (res.data.code == 0 && res.data.data) {
227 227  
228 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 230 th.set_good(goods);
258 231  
... ... @@ -353,91 +326,13 @@ Component({
353 326  
354 327 //---卡的初始化----
355 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 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 394 var now = ut.gettimestamp();
500 395 var th = this;
501 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 398 if (!user_id) user_id = 0;
504 399 for (var i in goods) {
505 400 var val = goods[i];
506 401 var item = {};
507 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 404 item.goods_name = val.serviceName;
529 405 item.goods_img = th.data.imghost + val.imgUrl;
530 406 item.market_price = val.show_price;
... ... @@ -532,12 +408,6 @@ Component({
532 408 item.sales_sum = val.sales_sum;
533 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 411 if (val.prom_price) item.prom_price = val.prom_price;
542 412 if (val.prom_integral) item.prom_integral = val.prom_integral;
543 413  
... ... @@ -547,44 +417,6 @@ Component({
547 417  
548 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 420 if (url != null && url != '') {
589 421 await getApp().request.promiseGet(url, {}).then(res => {
590 422 var prom = null;
... ... @@ -627,9 +459,7 @@ Component({
627 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 16 card_field: "",
17 17 card_name: "",
18 18 max_card_field: "",
19   - card_list: null
  19 + card_list: null,
  20 + is_no_plus: 1,
20 21 },
21 22 properties: {
22 23 // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定
23 24 },
24   - ready: function () {},
  25 + ready: function () { },
25 26 pageLifetimes: {
26 27 //要处理一下,游客登录后的界面的变化,主要还该是改变会员
27 28 show: function () {
28 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 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 106 get_list: function () {
105 107 var that = this;
106 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 112 var curPage = that.data.curPage;
111 113 getApp().request.get('/api/weshop/goods/page?page', {
... ... @@ -135,10 +137,10 @@ Component({
135 137 //加载完成
136 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 146 that.setData({
... ... @@ -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 220 \ No newline at end of file
... ...
components/goods_list/goods_list.wxml
... ... @@ -6,9 +6,9 @@
6 6 <!-- 商品详情 -->
7 7  
8 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 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 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 14 <view class="bottom">
... ... @@ -16,25 +16,25 @@
16 16 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
17 17 <!-- 判断是否有活动价 -->
18 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 38 </block>
39 39 <block wx:else>
40 40 <!-- 商品价格,先判断下是后⼜等级价-->
... ... @@ -81,7 +81,7 @@
81 81 </block>
82 82 <block wx:else>
83 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 85 <view class="money flex">
86 86 <!-- 办卡价 -->
87 87 <view class="flex xc-wc">
... ... @@ -94,16 +94,16 @@
94 94 <view class="fs22">{{item.market_price}}</view>
95 95 </view>
96 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 107 </view>
108 108 </block>
109 109 <block wx:else>
... ...
components/serviceCard_list/serviceCard_list.js
... ... @@ -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 93 get_list: function () {
106 94 var that = this;
107 95 if (that.data.is_no_more == 0) return false;
... ... @@ -109,18 +97,8 @@ Component({
109 97 if(!user_id) user_id=0;
110 98  
111 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 102 getApp().request.get('/api/weshop/serviceCard/page', {
125 103 isShowLoading: false,
126 104 data: {
... ...
components/timePicker/timePicker.js
... ... @@ -83,14 +83,10 @@ Component({
83 83 * 组件的初始数据
84 84 */
85 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 88 detached: function() {
93   - console.log("dele");
  89 +
94 90 },
95 91 attached: function() {},
96 92 ready: function() {
... ... @@ -384,11 +380,7 @@ Component({
384 380 this.setStartDate(startYear, startMonth, startDay, startHour, startMinute, startSecond);
385 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 385 setPickerDateArr(type, year, month, day, hour, minute, second) {
394 386 let yearIdx = 0;
... ...
custom-tab-bar/index.js
... ... @@ -107,15 +107,11 @@ Component({
107 107 fontcolor:data.fontcolor,
108 108 is_custum:1
109 109 })
110   - // console.log('abc=======<<<<<', this.data.list);
  110 +
111 111 },
112 112  
113 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 115 var url=e.currentTarget.dataset.url;
120 116 if(!url) return false;
121 117 if(url[0]!='/') url='/'+url;
... ... @@ -123,18 +119,7 @@ Component({
123 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 4 <block wx:if="{{item.nav_name !== '分销' && item.weappurl != '/pages/distribution/distribution'}}">
5 5 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
6 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 7 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
11 8 <view class="tab_img">
12 9 <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view>
... ... @@ -23,8 +20,7 @@
23 20 <block wx:if="{{(item.nav_name === '分销' || item.weappurl === '/pages/distribution/distribution') && !is_no_distri}}">
24 21 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
25 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 24 <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
29 25 <view class="tab_img">
30 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 249 t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
250 250 t.data.data['buynum'] = gg.goods_num;
251 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 258 th.setData({
254 259 bn_goods: t.data.data,
... ... @@ -510,6 +515,12 @@ Page({
510 515 // 'price': th.data.formData.order_amount,
511 516 'pickup_id': gg.pick_id,
512 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 526 //--导购分享过来的id--
... ... @@ -525,6 +536,7 @@ Page({
525 536 }
526 537 })
527 538 }
  539 + console.log('goooooooooooooooooods', goods);
528 540 item.list.push(goods);
529 541 }
530 542  
... ...
packageA/pages/distribution/goods/goods.js
... ... @@ -14,22 +14,19 @@ Page({
14 14 inputVal: '',//记录搜索输入框的内容
15 15 isSort: false,//控制排序开关状态,true开启排序
16 16 isDescending: false, //isDescending降序,ascending升序
17   -
18   -
19 17 tabArr: [],
20 18 currentTabIndex: 0,
21 19 isShowRow: false,//控制视图切换状态
22 20 isHiddenDropdown: true,//控制筛选下拉菜单显隐
23   -
24 21 list: null,
25 22 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
26 23 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
27 24 pageNum: 1, // 当前页数
28   -
29 25 isCheckAll: false, //记录是否全选
30 26 currentQuery: {
31 27 store_id: app.globalData.setting.stoid,
32 28 },
  29 + is_no_plus:1,
33 30 default_img: '/miniapp/images/default_g_img.gif',
34 31 },
35 32  
... ... @@ -67,6 +64,22 @@ Page({
67 64 options,
68 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 5 <!-- 搜索 -->
6 6 <view class="flex ai-center fs26 bg-white pd20">
7 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 9 <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
10 10 <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
11 11 </view>
12 12 <view class="pd20 filter {{isHiddenDropdown ? '':'c-red'}}" bindtap="clickFilter">筛选</view>
13   -
  13 +
14 14 <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}">
15 15 <view class="dropdown-wrapper">
16 16 <view class="pd20 bsbb" wx:if="{{nationList.length != 0}}">
... ... @@ -28,9 +28,9 @@
28 28 <view class="pd20 bsbb">
29 29 <view class="pdb20">价格区间</view>
30 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 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 34 <!-- <view class="w25 pdt20"><text class="label">品牌一</text></view> -->
35 35 </view>
36 36 </view>
... ... @@ -50,12 +50,12 @@
50 50 </view>
51 51 <view class="mask" bindtap="clickMask"></view>
52 52 </view>
53   -
54   -
  53 +
  54 +
55 55 <view class="flex t-c fs26 bg-white bdb" bindtap="clickTab">
56 56 <block wx:for="{{tabArr}}">
57 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 59 {{item}}<text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}" data-index="{{index}}"></text>
60 60 <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" data-index="{{index}}" wx:else></text>
61 61 </view>
... ... @@ -64,287 +64,291 @@
64 64 <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>
65 65 </view>
66 66 </view>
67   -
  67 +
68 68 </view>
69   -
70   -
  69 +
  70 +
71 71 <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}">
72 72 <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange">
73 73 <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}">
74 74 <!-- <label>
75 75  
76 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 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 82 <view class="flex fdc jc_sb">
81 83 <view class="ellipsis-2">{{item.goods_name}}</view>
82 84 <view>
83 85 <!-- 判断是否有活动价 -->
84 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 103 </block>
102 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 210 </block>
208 211 <!-- <view class="money fs32 c-red">{{item.market_price}}</view> -->
209 212 <view class="fs24 c-a">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view>
210 213 </view>
211 214 </view>
212 215 </view>
213   - </view>
  216 + </view>
214 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 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 222 <view class="pd20 fs26 flex jc_sb fdc f1">
220 223 <view class="ellipsis-2">{{item.goods_name}}</view>
221 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 226 <view>
224 227 <!-- 判断是否有活动价 -->
225 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 245 </block>
243 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 312 <text class="card_name ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text>
309   - </view>
310 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 352 </block>
349 353 <!-- <view class="money c-red fs32">{{item.market_price}}</view> -->
350 354 <view class="c-a fs24">分成金额:<text class="money c-red">{{filter.toFix(item.commission, 2)}}</text></view>
... ... @@ -353,25 +357,17 @@
353 357 </view>
354 358 </view>
355 359 </checkbox-group>
356   -
  360 +
357 361 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
358 362 <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
359 363 </view>
360   -
361   -
362   -
363   -
364   -
365 364 <view class="bottomBar flex pd20 jc_sb fs26 ai-center" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}">
366 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 369 <!-- </view> -->
371 370 <view class="pd20 btn" wx:if="{{options.index == 0}}" bindtap="putOn">一键上架</view>
372 371 <view class="pd20 btn" wx:else bindtap="pullOff">一键下架</view>
373 372 </view>
374   -
375   -
376   -
377   -</view>
  373 +</view>
378 374 \ No newline at end of file
... ...
packageA/pages/distribution/shop/shop.js
... ... @@ -17,26 +17,21 @@ Page({
17 17 isDescending: false, //isDescending降序,ascending升序
18 18 imghost: '',
19 19 url: os.imghost,
20   -
21 20 tabArr: ['最新', '销量', '评论', '价格'],
22 21 currentTabIndex: 0,
23 22 isShowRow: false,//控制视图切换状态
24 23 isHiddenDropdown: true,//控制筛选下拉菜单显隐
25   -
26 24 list: [],
27 25 isLoading: false, // 检测是否已经发送请求,防止重复发送请求
28 26 noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
29 27 pageNum: 1, // 当前页数
30   -
31   -
32 28 rank_switch: false,
33 29 card_field: "",
34 30 card_name: "",
35 31 max_card_field: "",
36 32 card_list: null,
37   -
38 33 isAll: true,
39   -
  34 + is_no_plus:1,
40 35 default_img: '/miniapp/images/default_g_img.gif',
41 36 },
42 37  
... ... @@ -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 228 if (app.globalData.key_word) {
... ...
packageA/pages/distribution/shop/shop.wxml
1 1 <wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
2 2 <wxs module="g_filter" src="g_filter.wxs"></wxs>
3 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 365 </view>
366 366 \ No newline at end of file
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -113,7 +113,7 @@ Page({
113 113 is_sec_mend: 0,
114 114 sto_sele_name: "", //选中的门店名称
115 115 sto_sele_id: "", //选中的门店id
116   - sto_sele_keyid:'', //选中的门店线下
  116 + sto_sele_keyid:'', //选中的门店线下
117 117 sto_sele_distr: "", //选择的门店的配送方式
118 118 is_show_sto_cat: 1, //是否显示门店分类
119 119 only_pk: null,
... ... @@ -205,14 +205,18 @@ Page({
205 205 hui_condition:null,
206 206 sto_sele_name_1:'',//分享的门店名称
207 207  
  208 + // 秒杀
  209 + prom_st: 1,
  210 + prom_r_null: 0,
208 211 },
209 212  
210 213 //------初始化加载----------
211 214 onLoad: function(t) {
212   -
213 215 self = this;
214   - this.data.options = t; // { goods_id: ...}
215   -
  216 +
  217 + this.setData({
  218 + options: t,
  219 + });
216 220  
217 221 var ee = this,
218 222 that = ee,
... ... @@ -265,11 +269,11 @@ Page({
265 269  
266 270 ee.setData({ gid: gid});
267 271  
268   - if(first_leader){
  272 + if(first_leader) {
269 273 getApp().globalData.first_leader=first_leader;
270 274 //调用接口判断是不是会员
271 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 277 getApp().globalData.guide_id=res.data.data.id;
274 278 }
275 279 })
... ... @@ -377,7 +381,7 @@ Page({
377 381 var ser_card=th.data.data;
378 382 //--如果默认门店不在等级卡的默认们店以内
379 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 387 var appd=getApp().globalData;
... ... @@ -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 473 async init(gid) {
451 474 var ee = this,
... ... @@ -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 566 await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
491 567 data: {
... ... @@ -509,8 +585,6 @@ Page({
509 585 store_id: os.stoid,
510 586 service_id: gid
511 587 },
512   - //failRollback: !0,
513   -
514 588 }).then(res => {
515 589 console.log('get评价统计数量', res.data.data);
516 590 var t = res;
... ... @@ -530,7 +604,7 @@ Page({
530 604  
531 605 categories3 = dd;
532 606 }
533   - })
  607 + });
534 608  
535 609 //----获取详情页的评价----
536 610 await getApp().request.promiseGet("/api/weshop/serviceComment/pageComment", {
... ... @@ -545,7 +619,7 @@ Page({
545 619 }).then(res => {
546 620 console.log('get详情页评价', res.data.data);
547 621 fir_com = res.data.data.pageData;
548   - })
  622 + });
549 623  
550 624 if (fir_com) {
551 625 for (var ind in fir_com) {
... ... @@ -553,7 +627,7 @@ Page({
553 627 if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
554 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 632 this.getTaohe();
559 633  
... ... @@ -592,6 +666,11 @@ Page({
592 666 var ee = this,gid = this.data.gid, i = getApp().request;
593 667 this.data.is_timer = 1;
594 668 this.wait_for_store_config();
  669 +
  670 +
  671 +
  672 +
  673 +
595 674  
596 675 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
597 676 failRollback: !0,
... ... @@ -668,6 +747,8 @@ Page({
668 747 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
669 748 this.get_sto();
670 749  
  750 +
  751 +
671 752 },
672 753  
673 754 enterAddress: function() {
... ... @@ -681,6 +762,7 @@ Page({
681 762 clearInterval(i);
682 763 }
683 764 },
  765 +
684 766 onHide: function() {
685 767 this.data.is_timer = 0;
686 768 for(var i = 1; i < 100; i++) {
... ... @@ -694,11 +776,12 @@ Page({
694 776 activeCategoryId: e
695 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 786 tabClick3: function(t) {
704 787 var e = this;
... ... @@ -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 804 tabComment: function() {
722 805 this.setData({
... ... @@ -727,7 +810,7 @@ Page({
727 810 //商品详情的时候调用
728 811 tabGoodsContent: function() {
729 812 var th = this,
730   - i = getApp().request;
  813 + i = getApp().request;
731 814 this.setData({
732 815 activeCategoryId: 1
733 816 });
... ... @@ -741,7 +824,7 @@ Page({
741 824 var action= t.currentTarget.dataset.action;
742 825 if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
743 826  
744   - th.setData({
  827 + th.setData({
745 828 open_ind_store: ind
746 829 });
747 830  
... ... @@ -762,8 +845,16 @@ Page({
762 845 newd['pick_name'] = th.data.sto_sele_name;
763 846 newd['guide_id'] = getApp().globalData.guide_id;
764 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 856 th.buyNow(newd);
766   - }else{
  857 + } else {
767 858  
768 859 var newd = {
769 860 service_id: th.data.data.id,
... ... @@ -873,7 +964,8 @@ Page({
873 964 },
874 965  
875 966 openSpecModel: function(t) {
876   - var th=this;
  967 + // console.log('****ttttttt***', t);
  968 + var th=this;
877 969 var open_store = t.currentTarget.dataset.ind;
878 970 this.setData({
879 971 store: 0,
... ... @@ -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 51 </view>
52 52 </view>
53 53  
  54 +
54 55  
55 56 <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else>
56 57 <view class="xc-videos-picture rel">
... ... @@ -63,6 +64,30 @@
63 64 </swiper>
64 65 </view>
65 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 93 <!-- <block> -->
... ... @@ -73,6 +98,9 @@
73 98 </view>
74 99  
75 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 104 <view class="co-red"><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
77 105 <view class="goods-title">
78 106 <view class="goods-name elli">{{data.goods_name}}</view>
... ... @@ -124,18 +152,54 @@
124 152 </view>
125 153  
126 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 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 199 </view>
138 200 </view>
  201 +
  202 +
139 203  
140 204  
141 205  
... ... @@ -199,7 +263,7 @@
199 263 <!-- 图文详情 -->
200 264 <view class="t_g_info bdt16">
201 265 <view class="red_shu"></view>
202   - <view class="fs30 bold">商品详情</view>
  266 + <view class="fs30 bold">卡项详情</view>
203 267 </view>
204 268 <view class="pdh20">
205 269  
... ... @@ -238,7 +302,7 @@
238 302 </block>
239 303 </block>
240 304  
241   - <view class="table_s" wx:if="{{service_list}}">
  305 + <!-- <view class="table_s" wx:if="{{service_list}}">
242 306 <view class="tb_item tb-l">
243 307 <view class="item_left f1">
244 308 <text>项目名称</text>
... ... @@ -261,7 +325,7 @@
261 325 <text>{{item.frequency}}</text>
262 326 </view>
263 327 </view>
264   - </view>
  328 + </view> -->
265 329  
266 330 <view class="wxParse">
267 331 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
... ... @@ -284,7 +348,7 @@
284 348  
285 349 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
286 350 <view class="pd20">
287   - <view class="table_s" wx:if="{{service_list}}">
  351 + <!-- <view class="table_s" wx:if="{{service_list}}">
288 352 <view class="tb_item tb-l">
289 353 <view class="item_left f1">
290 354 <text>项目名称</text>
... ... @@ -307,7 +371,42 @@
307 371 <text>{{item.frequency}}</text>
308 372 </view>
309 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 411 <view class="wxParse">
313 412 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
... ... @@ -439,11 +538,63 @@
439 538 </view>
440 539 </view>
441 540  
442   -
  541 +
443 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 593 </view>
  594 +
  595 +
  596 +
  597 +
447 598  
448 599 </view>
449 600  
... ... @@ -558,10 +709,20 @@
558 709 <block wx:else>
559 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 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 726 </block>
566 727 </block>
567 728 </block>
... ...
packageA/pages/goodsInfo/goodsInfo.wxss
... ... @@ -1025,25 +1025,37 @@ left:31rpx;}
1025 1025 .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx;
1026 1026 /* border-bottom: 3rpx solid #eee; */
1027 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 1030 .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333;
1031 1031 font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ }
1032 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 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 1060 .topframe{
1049 1061 width: 100%;
... ... @@ -2845,7 +2857,8 @@ button.custom-service::after{
2845 2857 width: auto !important;
2846 2858 position: absolute;
2847 2859 right: 0;
2848   - top: 10rpx;
  2860 + top: 50%;
  2861 + transform: translateY(-50%);
2849 2862 }
2850 2863  
2851 2864 .stock {
... ... @@ -2907,3 +2920,51 @@ button.custom-service::after{
2907 2920 .del {
2908 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 130 .img-container {
131 131 background-color: #f0f0f0;
132 132 width: 280rpx;
133   - height: 248rpx;
  133 + height: 280rpx;
134 134 display: flex;
135 135 align-items: center;
136 136 justify-content: center;
... ...
packageA/pages/liveStream/liveStream.js
... ... @@ -208,14 +208,14 @@ Page({
208 208 * 生命周期函数--监听页面加载
209 209 */
210 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 4  
5 5 <block wx:if="{{config2.couponset}}">
6 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 8 </view>
9 9 </block>
10 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 13 <view class="left {{tool.get_color(index,dataList)}} flex ai-center jc-center co-w">
14 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 17 </view>
18 18 </view>
19   - <!-- 右边 -->
  19 + <!-- 右边 -->
20 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 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 42 <view wx:if="{{item.everyone_num>0 && item.lqnum>=item.everyone_num}}" class="btn flex jc-center ai-center is_get">已领取</view>
41 43 <view wx:else class="btn flex jc-center ai-center">立即领取</view>
42   - </view>
  44 + </view>
43 45 </view>
44   - </view>
  46 + </view>
45 47 </view>
46 48  
47 49 <view wx:if="{{show_success}}">
... ... @@ -58,5 +60,4 @@
58 60 </view>
59 61  
60 62 <warn id="warn"></warn>
61   -<nav_box id="nav"></nav_box>
62   -
  63 +<nav_box id="nav"></nav_box>
63 64 \ No newline at end of file
... ...
packageA/pages/quan_pro/quan_pro.wxml
... ... @@ -40,7 +40,7 @@
40 40 <view wx:else class="lower fs30">有效期
41 41 <text wx:if="{{ q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text>
42 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 44 </view>
45 45 </block>
46 46  
... ...
packageB/pages/luckactivity/luckinfo/luckinfo.js
... ... @@ -1379,35 +1379,6 @@ Page({
1379 1379 };
1380 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 1384 closePoster() {
... ...
packageB/pages/zuhegou/index/index.js
... ... @@ -11,80 +11,80 @@ let imgDraw = {
11 11 "height": "843px",
12 12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg",
13 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 123 * 生命周期函数--监听页面加载
124 124 */
125 125 onLoad: function (options) {
  126 +
126 127 console.log(options, 111);
127 128 self = this;
128 129 var the_id = options.id;
... ... @@ -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 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 204 } else {
  205 + th.data.is_get_act = 0;
204 206 th.setData({
205   - error: '活动已经过期'
  207 + error: e.data.msg
206 208 });
207 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 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 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 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 377 onHide: function () {
... ... @@ -1895,7 +1894,7 @@ Page({
1895 1894  
1896 1895 getApp().request.put("/api/weshop/cart/update", {
1897 1896 data: updata,
1898   - success: function (t) {}
  1897 + success: function (t) { }
1899 1898 });
1900 1899 th.re_sum_price();
1901 1900 })
... ... @@ -1972,7 +1971,7 @@ Page({
1972 1971 if (this.data.act.is_bzyh && zhqty_bz.length > 0) {
1973 1972 if (zhqty_bz.length > 1) {
1974 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 1976 if (zhqty_bz_flag) {
1978 1977 for (let i = 0; i < zhqty_bz.length; i++) {
... ... @@ -1988,7 +1987,7 @@ Page({
1988 1987 }
1989 1988 }
1990 1989 } else {
1991   - zhqty_len=1;
  1990 + zhqty_len = 1;
1992 1991 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
1993 1992 return o['num'];
1994 1993 }));
... ... @@ -2012,9 +2011,9 @@ Page({
2012 2011 }
2013 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 2017 for (let j = 0; j < be * item1['zhqty']; j++) {
2019 2018 let index = no_in_arr.findIndex(i => {
2020 2019 return item1.goods_id === i.goods_id
... ... @@ -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 2264 let bz_num = be * item['zhqty']; //超量倍增
2266 2265 let num = item['num'] - item['zhqty']; //购买数量减去超量
2267 2266 if (bz_num > num) {
2268   - zhqty_bz_flag=false;
  2267 + zhqty_bz_flag = false;
2269 2268 zhqty_bz_arr.push(item);
2270 2269 // zhqty_bz.splice(i,1)
2271 2270 }
... ...
packageB/pages/zuhegou/index/index.json
1 1 {
2 2 "usingComponents": {
3   - "catch": "/packageB//components/catch/catch",
  3 + "catch": "/packageB/components/catch/catch",
4 4 "nodata": "/components/nodata/nodata",
5 5 "painter": "/packageB/components/painter/painter",
6 6 "warn": "/components/long_warn/long_warn"
... ...
packageB/pages/zuhegou/index/index.wxml
... ... @@ -16,7 +16,7 @@
16 16 </view>
17 17  
18 18  
19   - <view class="c_w mt20 fs32">门店:
  19 + <view class="c_w mt20 fs28">门店:
20 20 <block wx:if="{{def_pick_store}}">
21 21 <text wx:if="{{all_price>0}}">{{def_pick_store.pickup_name}}</text>
22 22 <text wx:else bindtap="choose_store">{{def_pick_store.pickup_name}}</text>
... ... @@ -77,16 +77,16 @@
77 77 <view class="bar-container">
78 78 <block wx:if="{{all_num>=act.zhbuyqty}}">
79 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 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 83 </block>
84 84 <block wx:else>
85 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 87 </view>
88 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 90 </view>
91 91 </block>
92 92 <view class="flex jc_sb ai_c pd20">
... ... @@ -118,7 +118,7 @@
118 118 <view class="pdt40">
119 119 <view class="pdb20">活动内容</view>
120 120 <view class="">
121   - <view class="pdb10">{{act.remark}}</view>
  121 + <view class="pdb10">{{filters.show_default(act.remark, '无')}}</view>
122 122 </view>
123 123 </view>
124 124 </block>
... ...
packageB/pages/zuhegou/index/index.wxss
... ... @@ -35,6 +35,10 @@ page {
35 35 font-size: 24rpx;
36 36 }
37 37  
  38 +.icon-zhuanfa {
  39 + line-height: 1;
  40 +}
  41 +
38 42 .list-container {
39 43 padding-top: 30rpx;
40 44 }
... ...
packageB/pages/zuhegou/preindex/index.js
... ... @@ -11,80 +11,80 @@ let imgDraw = {
11 11 "height": "843px",
12 12 "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg",
13 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 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 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 204 } else {
  205 + th.data.is_get_act = 0;
205 206 th.setData({
206   - error: '活动已经过期'
  207 + error: e.data.msg
207 208 });
208 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 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 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 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 378 onHide: function () {
... ... @@ -1896,7 +1895,7 @@ Page({
1896 1895  
1897 1896 getApp().request.put("/api/weshop/cart/update", {
1898 1897 data: updata,
1899   - success: function (t) {}
  1898 + success: function (t) { }
1900 1899 });
1901 1900 th.re_sum_price();
1902 1901 })
... ... @@ -1915,7 +1914,7 @@ Page({
1915 1914 var need_to_buy = 0;
1916 1915 var data = this.data.list;
1917 1916 var all_zhqty = 0; //所有商品要求起购数之后
1918   - var zhqty_bz=[]; //超量
  1917 + var zhqty_bz = []; //超量
1919 1918 var no_in_arr = [];
1920 1919 for (var i in data) {
1921 1920 var item = data[i];
... ... @@ -1966,28 +1965,28 @@ Page({
1966 1965  
1967 1966 //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增
1968 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 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 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 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 1990 console.log(pop_num);
1992 1991 for (var m = 0; m < pop_num; m++) {
1993 1992 no_in_arr.pop();
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... ... @@ -5,7 +5,7 @@
5 5  
6 6 <!-- 商品名称 -->
7 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 9 <view class="spec-goods-info">
10 10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
11 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 8 oo = s.globalData,
9 9 o = s.globalData.setting,
10 10 os = o;
11   -
  11 +
12 12 //评价加载更多
13 13 var more = function (e) {
14 14 return e && e.__esModule ? e : {
... ... @@ -251,48 +251,48 @@ Page({
251 251 fir_goods: null,
252 252  
253 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 287 onLoad: function (t) {
288   -
  288 +
289 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 296 var ee = this,
297 297 that = ee,
298 298 th = ee,
... ... @@ -303,45 +303,45 @@ Page({
303 303 prom_type = t.prom_type,
304 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 319 //--如果tg_id是空的话,分享回来--
320   - // console.log('扫描海报gid');
  320 + // console.log('扫描海报gid');
321 321 if (gid == undefined || gid == null || gid == "") {
322 322 var gid_str = decodeURIComponent(t.scene);
323 323 gid_str = gid_str.split("_");
324 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 341 if (gid_str.length > 1) {
342 342 first_leader = gid_str[1];
343 343 }
344   -
  344 +
345 345 //-- 如果有room_id的获取 --
346 346 if (gid_str.length > 2 && gid_str[2]) {
347 347 room_id = gid_str[2];
... ... @@ -351,7 +351,7 @@ Page({
351 351 }
352 352  
353 353 ee.setData({ gid: gid });
354   -
  354 +
355 355 if (first_leader) {
356 356  
357 357 getApp().globalData.first_leader = first_leader;
... ... @@ -418,10 +418,10 @@ Page({
418 418 th.requestCardNum(), wx.pageScrollTo && th.setData({
419 419 supportPageScroll: !0
420 420 });
421   -
422   -
423   -
424   -
  421 +
  422 +
  423 +
  424 +
425 425  
426 426 //计算等级价相关
427 427 var swithc_list = e.switch_list;
... ... @@ -496,7 +496,7 @@ Page({
496 496 } else {
497 497 //要用接口是获取距离,js的计算不准
498 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 500 }).then(res => {
501 501 if (res.data.code == 0) {
502 502 e = res.data.data.pageData[0];
... ... @@ -532,12 +532,14 @@ Page({
532 532 //--先判断会员登陆状态--
533 533 var user_info = getApp().globalData.userInfo;
534 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 537 wx.navigateTo({
536   - url: '/pages/togoin/togoin',
  538 + url: '/pages/togoin/togoin',
537 539 })
538 540 return false;
  541 + })
539 542 }
540   -
541 543 },
542 544  
543 545  
... ... @@ -633,7 +635,7 @@ Page({
633 635 }
634 636 gallery = g;
635 637 })
636   -
  638 +
637 639 //------是否收藏----------
638 640 await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
639 641 data: {
... ... @@ -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 708 await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
707 709 data: {
... ... @@ -725,16 +727,16 @@ Page({
725 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 741 ee.setData({
740 742 gallery: gallery,
... ... @@ -751,7 +753,7 @@ Page({
751 753  
752 754 //---展示---
753 755 onShow: async function () {
754   - // console.log('onshow');
  756 + // console.log('onshow');
755 757 var goods_list = null, th = this, that = this;
756 758 var show_prew_img = this.data.show_prew_img
757 759 if (show_prew_img) {
... ... @@ -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 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 811 if (this.data.isTimeUp) {
810 812 wx.showModal({
811 813 title: '提示',
812 814 content: '活动已经暂停',
813 815 showCancel: false,
814   - success: function(){
  816 + success: function () {
815 817 wx.navigateBack();
816 818 }
817 819 })
... ... @@ -880,18 +882,18 @@ Page({
880 882 });
881 883 }
882 884 }
883   -
  885 +
884 886 //动态获取商品名称
885 887 wx.setNavigationBarTitle({
886 888 title: t.data.data.goods_name,
887 889 });
888 890  
889   -
  891 +
890 892  
891 893 //-- 把商品的赋值 --
892 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 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 919 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
918 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 928 ee.setData({
927 929 data: t.data.data,
928 930 sele_g: t.data.data,
... ... @@ -935,7 +937,7 @@ Page({
935 937 //默认门店要拿下门店库存
936 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 942 // } else {
941 943 // //获取门店
... ... @@ -1021,112 +1023,112 @@ Page({
1021 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 1111 getApp().request.get("/api/weshop/activitylist/getActLen/" + o.stoid + "/9/" + this.data.group_id, {
1110   - success: function(res) {
  1112 + success: function (res) {
1111 1113 //console.log('当前幸运购活动的剩余库存', res.data.data);
1112   - if(res.data.code == 0) {
  1114 + if (res.data.code == 0) {
1113 1115 th.setData({
1114 1116 // 剩余库存量
1115 1117 surplus: res.data.data,
1116 1118 });
1117   - };
  1119 + };
1118 1120 resolve();
1119 1121 }
1120 1122 });
1121   -
  1123 +
1122 1124 });
1123   -
  1125 +
1124 1126 var p2 = new Promise((resolve, reject) => {
1125 1127 // 检查是否已经参团购买
1126 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 1130 console.log('当前幸运购活动是否已经参团', res.data.code);
1129   - if(res.data.code == 0) {
  1131 + if (res.data.code == 0) {
1130 1132 th.setData({
1131 1133 showDetails: true,
1132 1134 buyInfo: res.data.data,
... ... @@ -1139,52 +1141,52 @@ Page({
1139 1141 resolve();
1140 1142 }
1141 1143 });
1142   -
  1144 +
1143 1145 });
1144   -
  1146 +
1145 1147 Promise.all([p1, p2]).then(res => {
1146 1148 th.setData({
1147 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 1163 onUnload: function () {
1162 1164 for (var i = 1; i < 100; i++) {
1163 1165 clearInterval(i);
1164 1166 }
1165 1167 },
1166   -
1167   - // 页面隐藏
  1168 +
  1169 + // 页面隐藏
1168 1170 onHide: function () {
1169 1171 this.data.is_timer = 0;
1170 1172 for (var i = 1; i < 100; i++) {
1171 1173 clearInterval(i);
1172 1174 }
1173 1175 },
1174   -
1175   - // 点击顶部选项卡
  1176 +
  1177 + // 点击顶部选项卡
1176 1178 tabClick: function (t) {
1177 1179 var e = t.currentTarget.id;
1178 1180 this.setData({
1179 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 1190 tabClick3: function (t) {
1189 1191 var e = this;
1190 1192 if (t.currentTarget.id != this.data.activeCategoryId3) {
... ... @@ -1197,7 +1199,7 @@ Page({
1197 1199 }
1198 1200 },
1199 1201  
1200   - // 滚动到顶部
  1202 + // 滚动到顶部
1201 1203 doScrollTop: function () {
1202 1204 wx.pageScrollTo({
1203 1205 scrollTop: 0
... ... @@ -1280,9 +1282,9 @@ Page({
1280 1282 th.setData({
1281 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 1449 goods_name: o.goods_name,
1448 1450 goods_sn: o.goods_sn,
1449 1451 sku: o.sku,
1450   - prom_id:th.data.luckGoInfo.id,
  1452 + prom_id: th.data.luckGoInfo.id,
1451 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 1619 add_cart_next(e, t, a, o, newd, CanOutQty) {
1618 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 1623 var conf = th.data.bconfig;
1622 1624 if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
1623 1625 var s_list = JSON.parse(conf.switch_list);
... ... @@ -1780,7 +1782,7 @@ Page({
1780 1782 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1781 1783 // action: "buy_now"
1782 1784 // }),
1783   - var th = this;
  1785 + var th = this;
1784 1786 this.setData({
1785 1787 openSpecModal: 0,
1786 1788 openSpecModal_inte: 0,
... ... @@ -1788,15 +1790,15 @@ Page({
1788 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 1803 if (e.is_normal == 1) {
1802 1804 this.check_nor_promgood(e.goods_id, function (res) {
... ... @@ -1804,28 +1806,28 @@ Page({
1804 1806 e.prom_type = 3;
1805 1807 e.prom_id = res.cat_id;
1806 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 1812 s.set_b_now(e);
1811 1813 /*--
1812 1814 wx.redirectTo({
1813 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 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 1823 } else {
1822   - //console.log('222222222222222222222222222222======》');
  1824 + //console.log('222222222222222222222222222222======》');
1823 1825 //s.set_b_now(e);
1824 1826 /*--
1825 1827 wx.redirectTo({
1826 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 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 2053 })
2052 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 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 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 2525 if (res.data.code == 0) prom = res.data.data;
2524 2526 })
2525 2527 break
2526   -
2527   - case 8:
2528   - continue;
2529 2528  
2530 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 2655 async sele_spec_chech_activity() {
2654 2656 //---如果是活动的时候---
2655 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 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 2662 }).then(res => {
2661 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 2688 var now = ut.gettimestamp();
2687 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 2697 if (prom.is_end == 0 && prom.end_time > now && t1 < now) {
2696 2698 th.setData({
... ... @@ -2701,37 +2703,37 @@ Page({
2701 2703 prom_start_time: prom.start_time,
2702 2704 prom_st: prom_st,
2703 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 3240  
3239 3241 //--------检查是否活动,活动是否开始,或者是否结束-------
3240 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 3248 this.setData({
3247   - prom_type: 0,isshow: 1,
  3249 + prom_type: 0, isshow: 1,
3248 3250 });
3249 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 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 3270 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
3269 3271 1: 1
... ... @@ -3275,7 +3277,7 @@ Page({
3275 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 3281 success: function (t) {
3280 3282 if (t.data.code != 0) {
3281 3283 ee.setData({
... ... @@ -3353,51 +3355,51 @@ Page({
3353 3355  
3354 3356 //如果是进行中的话
3355 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 3735 min: this.timeFormat(min),
3734 3736 sec: this.timeFormat(sec)
3735 3737 }
3736   - // console.log('cd');
  3738 + // console.log('cd');
3737 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 3767 setTimeout(function () {
3766 3768 th.countDown(endTime)
3767 3769 }, 1000);
... ... @@ -3796,12 +3798,12 @@ Page({
3796 3798 success: function (t) {
3797 3799 if (t.data.code == 0) {
3798 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 3807 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
3806 3808 //----获取活动购买数----
3807 3809 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
... ... @@ -3858,7 +3860,7 @@ Page({
3858 3860 },
3859 3861  
3860 3862 //--点击弹起拼单--
3861   - // ind == 1 为普通购买
  3863 + // ind == 1 为普通购买
3862 3864 openSpecModel_pt: function (e) {
3863 3865  
3864 3866 this.setData({ open_ind_store: 9, goodsInputNum: 1 });
... ... @@ -3876,125 +3878,125 @@ Page({
3876 3878 page: 1
3877 3879 }
3878 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 3922 th.setData({
3927 3923 is_normal: ind,
3928 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 3928 th.setData({
3988   - is_normal: 0,
  3929 + is_normal: ind,
3989 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 4004  
4003 4005 //-----------------拼单生成方法---------------------
4004 4006 addCart_pt: function () {
4005   - this.setData({
4006   - openSpecModal_pt: 0,
4007   - });
  4007 + this.setData({
  4008 + openSpecModal_pt: 0,
  4009 + });
4008 4010 if (this.data.is_normal == 0) {
4009 4011 //看一下有没有起购数,如果有起购数,要计算起购数
4010 4012 // var qnum = parseFloat(th.data.prom_act.minbuynum);
... ... @@ -4046,7 +4048,7 @@ Page({
4046 4048 // return false;
4047 4049 // }
4048 4050 // }
4049   -
  4051 +
4050 4052 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
4051 4053 // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) {
4052 4054 // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
... ... @@ -4095,7 +4097,7 @@ Page({
4095 4097 sto_sele_name: ""
4096 4098 });
4097 4099 if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
4098   -
  4100 +
4099 4101 //--------------此时操作的数据------------
4100 4102 var newd = {
4101 4103 goods_id: o.goods_id,
... ... @@ -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 4179 newd['pick_name'] = th.data.sto_sele_name;
4178 4180 newd['pick_dis'] = th.data.sto_sele_distr;
... ... @@ -4186,25 +4188,25 @@ Page({
4186 4188 newd['prom_type'] = 0;
4187 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 4193 th.buyNow(newd);
4192 4194 });
4193 4195 }
4194 4196 else {
4195   - // 点击立即参团
4196   - th.buyNow_pt(newd);
4197   - };
  4197 + // 点击立即参团
  4198 + th.buyNow_pt(newd);
  4199 + };
4198 4200 })
4199 4201 },
4200 4202 //----------立即购买_pt-----------
4201 4203 buyNow_pt: function (e) {
4202 4204 s.set_b_now(e);
4203 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 4212 //-------跳转pt商品-------
... ... @@ -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 4622 saveImageToPhotosAlbum: function () {
... ... @@ -4627,16 +4629,16 @@ Page({
4627 4629 }
4628 4630  
4629 4631 if (this.data.share_hidden) {
4630   - this.setData({ share_hidden: false,});
  4632 + this.setData({ share_hidden: false, });
4631 4633 };
4632 4634  
4633 4635 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 9幸运购
4634 4636 var type = 9;
4635   - console.log('type',type);
  4637 + console.log('type', type);
4636 4638 if (type == 6) type = 2;
4637 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 4642 var that = this, th = that;
4641 4643 //设置画板显示,才能开始绘图
4642 4644 that.setData({
... ... @@ -4647,8 +4649,8 @@ Page({
4647 4649 var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
4648 4650 var path2 = that.data.data.original_img;
4649 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 4655 var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
4654 4656 if (user_id > 0) {
... ... @@ -4661,13 +4663,13 @@ Page({
4661 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 4668 // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
4667 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 4674 // 读取文件成功则OK--
4673 4675 wx.getImageInfo({
... ... @@ -4682,86 +4684,86 @@ Page({
4682 4684  
4683 4685 // context.fillStyle="#FFFFFF";
4684 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 4695 if (th.data.share_b_img) {
4694 4696 pg_path = th.data.share_b_img;
4695 4697 }
4696 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 4767 if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) {
4766 4768 share_title = th.data.prom_act.share_title;
4767 4769 if (!share_title) share_title = th.data.prom_act.title;
... ... @@ -4781,8 +4783,8 @@ Page({
4781 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 4788 // if (th.data.prom_act)
4787 4789 // pri0 = th.data.prom_act.price;
4788 4790 pri0 = parseFloat(pri0).toFixed(2);
... ... @@ -4790,13 +4792,13 @@ Page({
4790 4792 context.fillText("¥", wd1 - 15, 185 * unit);
4791 4793 context.setFontSize(31 * unit)
4792 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 4804 context.setFillStyle("gray")
... ... @@ -4811,7 +4813,7 @@ Page({
4811 4813 context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
4812 4814 context.stroke();
4813 4815  
4814   - } else if(type == 4 && type != 0) {
  4816 + } else if (type == 4 && type != 0) {
4815 4817 context.setFillStyle("black");
4816 4818 context.setFontSize(21.3 * unit)
4817 4819 th.draw_Text(context, share_title,
... ... @@ -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 4843 switch (type) {
4842 4844 case 0: break;//普通商品的展示
... ... @@ -5049,130 +5051,130 @@ Page({
5049 5051 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
5050 5052 }
5051 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 5412 // }
5411 5413 // })
5412 5414 },
5413   -
  5415 +
5414 5416 // 选择门店
5415 5417 choice_store: function (ee) {
5416 5418 var th = this;
... ... @@ -5426,7 +5428,7 @@ Page({
5426 5428 getApp().confirmBox("门店库存不足", null, 25000, !1);
5427 5429 return false;
5428 5430 }
5429   -
  5431 +
5430 5432 if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
5431 5433 getApp().confirmBox("门店库存不足", null, 25000, !1);
5432 5434 return false;
... ... @@ -5486,7 +5488,7 @@ Page({
5486 5488 })
5487 5489 }
5488 5490 },
5489   -
  5491 +
5490 5492 //关闭选择门店
5491 5493 close_popup: function (e) {
5492 5494 var th = this;
... ... @@ -5538,7 +5540,7 @@ Page({
5538 5540 sort_store: function () {
5539 5541  
5540 5542 },
5541   -
  5543 +
5542 5544 // 返回按钮
5543 5545 returns: function () {
5544 5546 this.setData({
... ... @@ -5546,7 +5548,7 @@ Page({
5546 5548 choice_sort_store: 0
5547 5549 });
5548 5550 },
5549   -
  5551 +
5550 5552 //---选择分类门店---
5551 5553 choice_sort_store: function (e) {
5552 5554 var index = e.currentTarget.dataset.index;
... ... @@ -5680,7 +5682,7 @@ Page({
5680 5682 }
5681 5683 else {
5682 5684 th.setData({
5683   - // openSpecModal_pt: 1,
  5685 + // openSpecModal_pt: 1,
5684 5686 store: 0,
5685 5687 choice_sort_store: 0,
5686 5688 sort_store: 0
... ... @@ -5690,7 +5692,7 @@ Page({
5690 5692 th.get_off_price();
5691 5693 })
5692 5694 },
5693   -
  5695 +
5694 5696 //---点击二级之后的选择---
5695 5697 choose_for_store: function (e) {
5696 5698 var index_c = e.currentTarget.dataset.ind;
... ... @@ -5701,7 +5703,7 @@ Page({
5701 5703 })
5702 5704  
5703 5705 },
5704   -
  5706 +
5705 5707 //把选择的门店设置成默认的门店def_pick
5706 5708 set_def_pick: function (e) {
5707 5709 var th = this;
... ... @@ -5901,11 +5903,11 @@ Page({
5901 5903 go_plus: function () {
5902 5904 getApp().goto("/pages/user/plus/plus");
5903 5905 },
5904   -
  5906 +
5905 5907 go_card_info: function () {
5906 5908 getApp().goto("/pages/user/cardinfo/cardinfo");
5907 5909 },
5908   -
  5910 +
5909 5911 //-- 根据ID拿出门店 --
5910 5912 get_pick_from_list(pid) {
5911 5913 var all_pick_list = this.data.all_pick_list;
... ... @@ -6134,7 +6136,7 @@ Page({
6134 6136 this.get_sto(0)
6135 6137 this.setData({ openSpecModal_inte: 1, goodsInputNum: 1 });
6136 6138 },
6137   -
  6139 +
6138 6140 //-- 积分购普通购买 --
6139 6141 go_pay_integral_normal: function () {
6140 6142 var th = this;
... ... @@ -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 200 <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->
201 201 <view class="xc-share-frame t-c" bindtap="{{isTimeUp ? 'timeUp':'clickShare'}}">
202 202 <view class="iconfont icon-share"></view>
203   - <!-- <view class="fs22 c-7b">分享</view> -->
  203 + <view class="fs22 c-7b">分享</view>
204 204 </view>
205 205 </view>
206 206 <!-- 不是秒杀 -->
... ... @@ -1515,7 +1515,7 @@
1515 1515 <view class="mask" catchtap="closePoster"></view>
1516 1516 <view class="poster-container">
1517 1517 <view class="poster-wrapper">
1518   - <view class="poster">
  1518 + <view class="poster" bindtap="previewPoster">
1519 1519 <!-- <view class="poster" bindtap="previewImage"> -->
1520 1520 <image src="{{shareImgPath}}" class="poster-img"></image>
1521 1521 <view class="btn-close" catchtap="closePoster">
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss
... ... @@ -1624,7 +1624,7 @@ left:31rpx;}
1624 1624  
1625 1625 /* 分享 */
1626 1626 .icon-share {
1627   - font-size: 46rpx;
  1627 + font-size: 42rpx;
1628 1628 color: #d60021;
1629 1629 line-height: 1;
1630 1630 }
... ...
packageC/pages/presell/cart/cart2_pre.js
... ... @@ -233,7 +233,7 @@ Page({
233 233 th.setData({ user_addr: ie });
234 234 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
235 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 4019 corpId: id,
4020 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 121 </view>
122 122 <!-- 这个是分享按钮 -->
123 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 125 <view class="fs22 c-7b">分享</view>
126 126 </view>
127 127 </view>
... ... @@ -527,7 +527,7 @@
527 527 <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view>
528 528 <!-- <view class="">08.30 23:59:59 开始发货</view> -->
529 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 531 </view>
532 532  
533 533 <view class="line" bindtap="openSpecModel" data-ind="2" style="margin-left: 10rpx; padding-left: 10rpx">
... ... @@ -937,7 +937,7 @@
937 937 <view class="mask" catchtap="closePoster"></view>
938 938 <view class="poster-container">
939 939 <view class="poster-wrapper">
940   - <view class="poster">
  940 + <view class="poster" bindtap="previewPoster">
941 941 <!-- <view class="poster" bindtap="previewImage"> -->
942 942 <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
943 943 <view class="btn-close" catchtap="closePoster">
... ...
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... ... @@ -252,6 +252,9 @@ Page({
252 252  
253 253 //------初始化加载----------
254 254 onLoad: function (t) {
  255 + if(!getApp().is_Single_page()){
  256 + return false;
  257 + }
255 258 var ee = this, that = ee, th = ee,
256 259 pre_id = t.pre_id,
257 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 4 const os = app.globalData;
5 5 const setting = os.setting;
6 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 15 Page({
8 16  
9 17 /**
... ... @@ -11,171 +19,173 @@ Page({
11 19 */
12 20 data: {
13 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 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 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 216 "appid": "25521854",
207 217 "image": getApp().globalData.face_SourceImg,
208 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 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 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 366 "image": face_token,
305 367 "face_field": "color,smooth,acnespotmole,wrinkle,eyesattr,blackheadpore,skinface,skinquality",
306 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 543 wx.redirectTo({
344 544 url: url
345 545 })
346   - }else{
  546 + } else {
347 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 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 575 * @param {Object} url //url地址
... ... @@ -363,10 +577,10 @@ Page({
363 577 * @param {Object} succ //成功的回调
364 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 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 584 var str = JSON.stringify(data);
371 585 wx.request({
372 586 url: url,
... ... @@ -375,10 +589,8 @@ Page({
375 589 header: {
376 590 'content-type': 'application/json'
377 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 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 5 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/analyse/analyse.wxml
1 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 9 </view>
7 10 </view>
... ...
packageD/pages/AI-test-skin/analyse/analyse.wxss
... ... @@ -25,18 +25,17 @@ page {
25 25 }
26 26  
27 27 .img {
28   - background: url("https://mshopimg.yolipai.net//miniapp/images/skinimg/11.png");
29 28 margin-top: 15%;
30 29 display: inline-block;
31 30 width: 350px;
32 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 36 .progress {
38 37 margin-top: 3%;
39   - width: 60%;
  38 + width: 48%;
40 39 /* text-align: center; */
41 40 margin-left: 50%;
42 41 transform: translateX(-50%);
... ...
packageD/pages/AI-test-skin/fail_result/fail_result.js
1 1 /*
2 2 * @Author: your name
3 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 5 * @LastEditors: Please set LastEditors
6 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl
7 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js
... ... @@ -20,15 +20,26 @@ Page({
20 20 data: {
21 21 iurl: setting.imghost,
22 22 msg:null,
  23 + fail_result:new Array(), //失败原因
23 24 },
24 25  
25 26 /**
26 27 * 生命周期函数--监听页面加载
27 28 */
28 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 64 },
54 65 //从相册中选择图片
55 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 68 app.goto(url);
58 69 },
59 70  
... ...
packageD/pages/AI-test-skin/fail_result/fail_result.wxml
... ... @@ -3,20 +3,32 @@
3 3 <view>
4 4 <view style="position: relative;display: inline-block">
5 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 7 </view>
8 8 </view>
9   - <view style="font-size:32rpx;color: #333">上传图片符合要求</view>
  9 + <view style="font-size:32rpx;color: #333">上传图片不符合要求</view>
10 10 <view style="font-size: 26rpx;color: #555">请重新更换图片获取相关检测</view>
11 11 <view style="border-bottom: 1rpx solid #eee; margin:0 40rpx;margin-top:40rpx;"></view>
12 12 </view>
13 13  
14 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 32 </view>
21 33  
22 34 </view>
... ...
packageD/pages/AI-test-skin/fail_result/fail_result.wxss
... ... @@ -25,10 +25,10 @@ page {
25 25 margin: 70rpx 0 30rpx 50%;
26 26 transform: translateX(-50%);
27 27 background: #4bd6df;
28   - padding: 20rpx;
29   - width: 50%;
  28 + padding: 15rpx 10rpx;
  29 + width: 46%;
30 30 text-align: center;
31   - border-radius: 40rpx;
  31 + border-radius: 50rpx;
32 32 color: #fff;
33 33 }
34 34 .btn_fixed {
... ... @@ -60,43 +60,10 @@ page {
60 60 justify-content: center;
61 61 }
62 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 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 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 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 262 let url = `/api/weshop/face/storeSkinface/page`;
187   - app.request.promiseGet(url, {
  263 + const { data: res } = await request.promiseGet(url, {
188 264 isShowLoading: true,
189 265 data: {
190 266 store_id: setting.stoid,
191 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 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 304 * 生命周期函数--监听页面显示
248 305 */
249 306 onShow: function () {
250   - setTimeout(() => {
251   -
252   - }, 1000);
  307 +
253 308 },
254 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 337 * 页面上拉触底事件的处理函数
281 338 */
282 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 2 "navigationBarTitleText": "历史变化",
3 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 8 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/history_record/history_record.wxml
1 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 11 </view>
7   - <text class="fs24" style="position:absolute;bottom:25px;color: #333;">
8   - 注:请确保多次拍摄姿态和环境光线一致。拍摄姿态的偏移、环境光线变化或者皮肤状态变化都可能导致分数较大波动。
9   - </text>
10 12 </view>
11   - <view class="mgv5">历史报告</view>
12   -
  13 + <view class="mgb5">历史报告</view>
13 14 <view class="history_list">
14 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 20 </view>
20 21 </view>
21 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 25 </view>
23 26 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/history_record/history_record.wxss
... ... @@ -4,10 +4,18 @@ page {
4 4 height: 100%;
5 5 }
6 6  
7   -.mgv5 {
  7 +.mgb5 {
8 8 margin-top: 5%;
9 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 20 .content {
13 21 padding: 5%;
... ...
packageD/pages/AI-test-skin/index/aiskin.js
... ... @@ -43,7 +43,7 @@ Page({
43 43 * 生命周期函数--监听页面显示
44 44 */
45 45 onShow: function () {
46   -
  46 + this.getHistoryData();
47 47 },
48 48  
49 49 /**
... ... @@ -54,23 +54,27 @@ Page({
54 54 },
55 55  
56 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 103 */
100 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 152 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/index/aiskin.wxml
1 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 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 11 </view>
10 12 </view>
11 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 2 .container1 {
11 3 position: relative;
12 4 width: 100%;
13   - height: 100%;
14 5 }
15 6 .history {
16 7 margin-top: 30rpx;
... ... @@ -21,18 +12,19 @@ image {
21 12 border-radius: 50rpx 0 0 50rpx;
22 13 box-shadow: 0 0 2px 2px #f7f5f5;
23 14 color: #4ad5df;
  15 + align-items: center;
  16 + z-index: 100;
24 17 }
25 18 .start_btn {
26   - position: fixed;
27   - bottom: 50rpx;
28   - /* margin: auto; */
29   - /* text-align: center; */
30 19 margin-left: 50%;
31 20 transform: translateX(-50%);
32 21 background: #4bd6df;
33   - padding: 20rpx;
  22 + padding:16rpx 20rpx;
34 23 width: 67%;
35 24 text-align: center;
36 25 border-radius: 40rpx;
37 26 color: #fff;
  27 + font-size: 30rpx;
  28 + position:absolute;
  29 + bottom: 90rpx;
38 30 }
39 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 1 // packageB/pages/AI-test-skin/select_photo/select_photo.js
10 2 const app = getApp();
11 3 const request = app.request;
... ... @@ -20,84 +12,191 @@ Page({
20 12 data: {
21 13 iurl: setting.imghost,
22 14 gl_skin_img: null,
  15 + skin_type: 0,
23 16 },
24 17  
25 18 /**
26 19 * 生命周期函数--监听页面加载
27 20 */
28 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 56 wx.chooseImage({
88 57 count: 1,
89 58 sizeType: ['original', 'compressed'],
90 59 sourceType: ['album', 'camera'],
91   - success (res) {
  60 + success(res) {
92 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 203 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/select_photo/select_photo.wxml
1 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 5 </view>
5 6 <view class="foot_btn">
6   - <view class="reset_select" bindtap="show_pai_pop">
  7 + <view class="reset_select" bindtap="takePhoto">
7 8 <text class="iconfont icon-zuojiantou" style="font-size: 40rpx"></text>
8 9 <text style="font-size: 28rpx">重拍</text>
9 10 </view>
... ...
packageD/pages/AI-test-skin/select_photo/select_photo.wxss
... ... @@ -23,9 +23,8 @@ page {
23 23  
24 24 .foot_btn .ok_btn {
25 25 background: #5dd9dc;
26   - padding: 0 50rpx;
  26 + padding: 16rpx 40rpx;
27 27 border-radius: 50rpx;
28 28 /* margin: 0 auto; */
29   - line-height: 100rpx;
30 29 color: #fff;
31 30 }
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js
1 1 /*
2 2 * @Author: abson
3 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 5 * @LastEditors: Please set LastEditors
6 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEet urkl
7 7 * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\shoot_notice\shoot_notice.js
... ... @@ -19,6 +19,10 @@ Page({
19 19 */
20 20 data: {
21 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 36 * 生命周期函数--监听页面显示
33 37 */
34 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 73 },
65 74  
66 75 //从相册中选择图片
67   - show_pai_pop:function () {
  76 + show_pai_pop: function () {
  77 + let th = this;
68 78 //选择和拍照一张图片
69 79 wx.chooseImage({
70 80 count: 1,
71 81 sizeType: ['original', 'compressed'],
72 82 sourceType: ['album', 'camera'],
73   - success (res) {
  83 + success(res) {
74 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 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 229 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml
1 1 <!--packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml-->
2 2 <view class="content">
  3 + <view class="notice_show" style="display: {{notice_show}};">根据要求拍摄,测肤结果更准确。</view>
3 4 <view>
4 5 <view class="work">准备工作</view>
5 6 <view class="hengxian"></view>
... ... @@ -49,9 +50,12 @@
49 50 </view>
50 51 </view>
51 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 56 <view style="height: 300rpx;background-color: #e7f5fb;">
53 57 <view class="btn_fixed">
54   - <view class="btn" bindtap="show_pai_pop">准备闭眼拍摄</view>
  58 + <view class="btn" bindtap="takePhoto">准备闭眼拍摄</view>
55 59 <view class="notice" style="display:flex;justify-content:center;align-items: center;">
56 60 <text class="iconfont icon-info" style="margin-right: 10rpx;font-size: 26rpx"></text>
57 61 <text>如无闭眼,将导致图片分析失败</text>
... ...
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss
... ... @@ -6,7 +6,31 @@ page {
6 6 box-sizing: border-box;
7 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 32 .content {
  33 + position: relative;
10 34 width: 100%;
11 35 /* height: 100%; */
12 36 border-radius: 25rpx;
... ... @@ -26,11 +50,12 @@ page {
26 50 align-items: center;
27 51 margin-bottom: 40rpx
28 52 }
  53 +
29 54 .content .ready1 {
30 55 display: flex;
31 56 flex-direction: column;
32 57 align-items: center;
33   - padding-bottom: 50rpx ;
  58 + padding-bottom: 50rpx;
34 59 /* margin-bottom: 40rpx */
35 60 }
36 61  
... ... @@ -65,19 +90,21 @@ page {
65 90 .content image {
66 91 height: 100%;
67 92 }
  93 +
68 94 .btn {
69   -
  95 +
70 96 /* height: 150rpx; */
71 97 /* margin-left: 50%; */
72 98 margin: 70rpx 0 30rpx 50%;
73 99 transform: translateX(-50%);
74 100 background: #4bd6df;
75   - padding: 20rpx;
  101 + padding: 15rpx 15rpx;
76 102 width: 50%;
77 103 text-align: center;
78   - border-radius: 40rpx;
  104 + border-radius: 50rpx;
79 105 color: #fff;
80 106 }
  107 +
81 108 .btn_fixed {
82 109 position: fixed;
83 110 width: 100%;
... ... @@ -85,6 +112,7 @@ page {
85 112 height: 300rpx;
86 113 background: #e7f5fb;
87 114 }
  115 +
88 116 .notice {
89 117 text-align: center;
90 118 color: red;
... ... @@ -98,36 +126,71 @@ page {
98 126 right: 0;
99 127 bottom: 0;
100 128 z-index: 11;
101   - background: rgba(0,0,0,0.4);
  129 + background: rgba(0, 0, 0, 0.4);
102 130 width: 100%;
103 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 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 197 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/success_result/acne/acne.wxml
... ... @@ -4,7 +4,11 @@
4 4 <view>
5 5 <view style="color: #45d4eb;">#0{{acne_sort}}</view>
6 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 12 <view class="fs26" catchtap="show_dailog" data-type="6" style="display: flex;align-items: center;">
9 13 <text>问题标注</text>
10 14 <text class="iconfont icon-xia"></text>
... ...
packageD/pages/AI-test-skin/success_result/dark/dark.wxml
... ... @@ -4,7 +4,11 @@
4 4 <view>
5 5 <view style="color: #45d4eb;">#0{{dark_sort}}</view>
6 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 12 <view class="fs26" catchtap="show_dailog" data-type="5" style="display: flex;align-items: center;">
9 13 <text>问题标注</text>
10 14 <text class="iconfont icon-xia"></text>
... ... @@ -39,15 +43,15 @@
39 43 <view class="leixing">
40 44 <view class="_img">
41 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 47 </view>
44 48 <view class="_img">
45 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 51 </view>
48 52 <view class="_img">
49 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 55 </view>
52 56 </view>
53 57 </block>
... ...
packageD/pages/AI-test-skin/success_result/pore/pore.wxml
... ... @@ -4,7 +4,10 @@
4 4 <view>
5 5 <view style="color: #45d4eb;">#0{{port_sort}}</view>
6 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 11 <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;">
9 12 <text>问题标注</text>
10 13 <text class="iconfont icon-xia"></text>
... ...
packageD/pages/AI-test-skin/success_result/sensitive/sensitive.js
... ... @@ -2,7 +2,6 @@ module.exports = {
2 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
3 3 get_goods: function (th, stoid,sort) {
4 4 th.setData({sensitive_sort:sort});
5   -
6 5 var r_code = '12';
7 6 //获取毛孔的类型
8 7 var arr = th.data.face_data.skinquality.skin_sensitive_check;
... ...
packageD/pages/AI-test-skin/success_result/success_result.js
1 1 /*
2 2 * @Author: abson
3 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 5 * @LastEditors: Please set LastEditors
6 6 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7 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 19 const pore = require('pore/pore');
20 20 const speckle = require('speckle/speckle');
21 21 const wrinkle = require('wrinkle/wrinkle');
  22 +const sensitive = require('sensitive/sensitive')
22 23 Page({
23 24 /**
24 25 * 页面的初始数据
25 26 */
26 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 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 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 35 currentIndex: 0,
32 36 scroll_index: 0,
33   - sex:'female', //female女 male男
  37 + yiwen_index: 0,
  38 + sex: 'female', //female女 male男
34 39 tab_id: 'zong_he',
35 40 iurl: setting.imghost,
36 41 showDialog: false,
... ... @@ -40,21 +45,32 @@ Page({
40 45 img_scale_icon: true,
41 46 show_problem: 1, //问题标注显示问题
42 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 85 //var face_data=face_result.face_list[0];
70 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 326 init: function () {
279 327 var th = this;
... ... @@ -384,25 +432,25 @@ Page({
384 432 },
385 433  
386 434 click_scroll(e) {
387   - let { index, scroll_id} = e.currentTarget.dataset;
  435 + let { index, scroll_id } = e.currentTarget.dataset;
388 436 this.setData({
389 437 scroll_index: index,
390 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 475 this.setData({
428 476 img_scale: !this.data.img_scale,
429 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 509  
446 510 },
447 511 show_dailog(e) {
448   - var th=this;
  512 + var th = this;
449 513 var type = parseInt(e.currentTarget.dataset.type);
450 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 517 switch (type) {
454 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 523 break;
458 524 case 2://色斑
459 525 var speckle_list = this.data.face_data.acnespotmole.speckle_list;
... ... @@ -461,18 +527,20 @@ Page({
461 527 break;
462 528 case 3://皱纹
463 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 532 item.map(function (e) {
467   - e.w_type=th.data.wrinkle_types[i];
  533 + e.w_type = th.data.wrinkle_types[i];
468 534 return e;
469 535 })
470 536 }
471 537 this.setData({ wrinkle_list: wrinkle_list });
472 538 break;
473 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 544 break;
477 545 case 5://黑眼圈
478 546 var arr = this.data.face_data.eyesattr.dark_circle_left[0];
... ... @@ -589,8 +657,8 @@ Page({
589 657 this.setData({
590 658 iwidth: imgwidth * th.data.bili,
591 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 662 bili1: w / imgwidth //图片放大时候的比例
595 663 })
596 664 },
... ... @@ -650,7 +718,7 @@ Page({
650 718 touchendCallback: function (e) {
651 719 this.data.tc_end = 1;
652 720  
653   - },
  721 + },
654 722  
655 723 //--定义的保存图片方法,分享团---
656 724 saveImageToPhotosAlbum: function () {
... ... @@ -665,7 +733,7 @@ Page({
665 733 if (this.data.share_hidden) {
666 734 this.setData({ share_hidden: false, });
667 735 }
668   - ;
  736 +
669 737  
670 738 wx.showLoading({ title: '生成中...', })
671 739 var that = this, th = that;
... ... @@ -686,93 +754,92 @@ Page({
686 754 wx.getImageInfo({
687 755 src: path3,
688 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 845 }, 500)
... ... @@ -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 1012 get_quan: function (e) {
938 1013  
... ...
packageD/pages/AI-test-skin/success_result/success_result.wxml
... ... @@ -70,8 +70,8 @@
70 70 <view class="f1 ml20">
71 71 <view class="bold">{{s_filter.get_dryoil_check(skin_dryoil_check_type)}}</view>
72 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 75 </view>
76 76 <view class="mt20 fs26" wx:if="{{skin_dryoil_check_type==3 }}">
77 77 <text>你的皮肤油脂过剩,部分干燥,容易引发皮肤问题。日常可使用一些具有控油和补水功效产品,帮助调理肌肤</text>
... ... @@ -119,22 +119,21 @@
119 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 129 <view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}">
130 130 <!-- 局部放大的 -->
131 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 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 138 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image>
140 139 <block wx:if="{{yanjing}}">
... ... @@ -147,8 +146,7 @@
147 146 </block>
148 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 151 <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image>
154 152 <block wx:if="{{yanjing}}">
... ... @@ -172,11 +170,11 @@
172 170 <!-- 当点击了tabs -->
173 171 <block wx:if="{{scroll_id>1}}">
174 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 174 </block>
177 175 </block>
178 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 178 </block>
181 179 </block>
182 180 </block>
... ... @@ -199,12 +197,12 @@
199 197 <block wx:for="{{acne_list}}">
200 198 <!-- 当点击了tabs -->
201 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 201 </block>
204 202 <block wx:else>
205 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 204 </block>
207   - </block>
  205 + </block>
208 206 </block>
209 207  
210 208 </block>
... ... @@ -229,55 +227,63 @@
229 227 <!-- <text class="iconfont icon-yanjing-guan mgb20"></text> -->
230 228 <text catchtap="click_fangda" class="iconfont icon-fangda mgb20"></text>
231 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 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 241 <block wx:if="{{show_type == 5}}">
236 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 258 </view>
253 259 </block>
254 260 <view class="dialog_progress">
255 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 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 272 </block>
267   - <text wx:if="{{show_type==4}}">黑头{{blackhead_num}}</text>
  273 + <text wx:if="{{show_type==4}}">黑头{{blackhead_num}}</text>
268 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 278 </block>
273 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 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 287 </view>
282 288 <view style="margin-top:10rpx;display: flex;display: none">
283 289 <view class="pp"></view>
... ... @@ -293,21 +299,17 @@
293 299 </view>
294 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 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 303 {{item.name}}
298 304 </view>
299 305 </view>
300 306 </scroll-view>
301 307 </view>
302   -
303   -
304 308 </block>
305   -
306 309 <!-- 全图的,能够自由拖拽和放大 -->
307 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 314 <block wx:if="{{yanjing}}">
313 315 <!-- 显示毛孔 -->
... ... @@ -330,11 +332,11 @@
330 332 <!-- 当点击了tabs -->
331 333 <block wx:if="{{scroll_id>1}}">
332 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 336 </block>
335 337 </block>
336 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 340 </block>
339 341 </block>
340 342 </block>
... ... @@ -357,7 +359,7 @@
357 359 <block wx:for="{{acne_list}}">
358 360 <!-- 当点击了tabs -->
359 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 363 </block>
362 364 <block wx:else>
363 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 381 <canvas canvas-id='share' style='width:750rpx;height:1338rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
380 382 <!-- 展示分享图 -->
381 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 417 </view>
389 418 <!-- 提示 -->
390 419 <warn id="warn"></warn>
391 420 \ No newline at end of file
... ...
packageD/pages/AI-test-skin/success_result/success_result.wxss
... ... @@ -11,6 +11,7 @@ page {
11 11 z-index: 99;
12 12 display: flex;
13 13 height: 100rpx;
  14 + background-color: #fff;
14 15 }
15 16  
16 17 .share {
... ... @@ -18,12 +19,13 @@ page {
18 19 position: fixed;
19 20 bottom: 100rpx;
20 21 right: 0;
21   - padding: 20rpx;
  22 + padding:8rpx 20rpx;
22 23 background-color: #fff;
23 24 border: 2rpx solid #f0f0f0;
24 25 /* color: #FFF; */
25 26 border-radius: 40rpx 0 0 40rpx;
26 27 z-index: 99;
  28 + align-items: center;
27 29 }
28 30  
29 31 .tab_scroll_item {
... ... @@ -274,9 +276,6 @@ page {
274 276 /* border-radius: 50%; */
275 277 }
276 278  
277   -.bold {
278   - font-weight: 600;
279   -}
280 279  
281 280  
282 281 .analyse_result .gan::before {
... ... @@ -450,8 +449,7 @@ page {
450 449 transform: translate(50%, -50%);
451 450 height: 80%;
452 451 width: 80%;
453   - border-top-left-radius: 12rpx;
454   - border-top-right-radius: 12rpx;
  452 + border-radius: 18rpx;
455 453 z-index: 99999999;
456 454 overflow: hidden;
457 455 }
... ... @@ -466,15 +464,16 @@ page {
466 464 flex-direction: column;
467 465 justify-content: space-evenly;
468 466 background-color: #fff;
469   - min-height: 25%;
  467 + min-height: 10%;
470 468 }
471 469  
472 470 .dialog_txt .heiyanquan_img {
473 471 justify-content: space-between;
474 472 padding: 2%;
475 473 }
  474 +
476 475 .dialog_txt .heiyanquan_img .img1 {
477   - width: 32%;
  476 + width: 32%;color: #777;
478 477 }
479 478  
480 479 .dialog .dialog_progress {
... ... @@ -490,9 +489,10 @@ page {
490 489  
491 490 .dialog_item {
492 491 position: relative;
493   - padding: 3% 6%;
  492 + padding: 3% 5%;
494 493 white-space: nowrap;
495 494 background-color: #fff;
  495 + color: #a9a9a9;
496 496 }
497 497  
498 498 .dialog .dialog_icon {
... ... @@ -516,6 +516,46 @@ page {
516 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 559 .pp {
520 560 width: 8rpx;
521 561 height: 40rpx;
... ... @@ -697,7 +737,7 @@ page {
697 737 line-height: 80rpx;
698 738 text-align: center;
699 739 color: #fff;
700   - background-color: #c3172d
  740 + background-color: #45d4eb
701 741 }
702 742  
703 743 .sh_close {
... ... @@ -715,38 +755,114 @@ page {
715 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 830 border: 4rpx solid #E1E10B;
746 831 }
747   -.p_circle.colore2{
  832 +
  833 +.p_circle.colore2 {
748 834 border: 4rpx solid #4E8DF6;
749 835 }
750   -.p_circle.colore3{
  836 +
  837 +.p_circle.colore3 {
751 838 border: 4rpx solid #c0e2b7;
752   -}
753 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 4 <view>
5 5 <view style="color: #45d4eb;">#0{{wrinkle_sort}}</view>
6 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 12 <view class="fs26" catchtap="show_dailog" data-type="3" style="display: flex;align-items: center;">
9 13 <text>问题标注</text>
10 14 <text class="iconfont icon-xia"></text>
... ...
pages/activity/pind_list/pind_list.js
... ... @@ -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 64 this.requestSalelist();
70 65 },
71 66  
... ... @@ -74,15 +69,7 @@ Page({
74 69 this.data.currentPage = 1;
75 70 this.data.ismore = 1;
76 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 74 th.data.timer = setInterval(function () {
88 75 th.countDown();
... ...
pages/activity/seckill_list/seckill_list.wxml
... ... @@ -33,13 +33,15 @@
33 33  
34 34 <view class="kill-list abs seckill_list">
35 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 38 <image class="abs xc-miaosha" src="{{url}}/miniapp/images/zms.png"></image>
38 39 <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}"
39 40 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
40 41 </navigator>
41 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 45 <view class="flex-vertical xc-strip-frame">
44 46 <view class="xc-strip-blank rel">
45 47  
... ... @@ -71,9 +73,12 @@
71 73  
72 74 </view>
73 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 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 82 </view>
78 83 </view>
79 84 </view>
... ...
pages/cart/cart/cart.js
... ... @@ -1013,7 +1013,7 @@ Page({
1013 1013 console.log('add+');
1014 1014 if (a.goods_num < a.store_count) {
1015 1015 var e = {
1016   - goods_num: a.goods_num + 1,
  1016 + goods_num: a.goods_num + 1,
1017 1017 id: a.id,
1018 1018 goods_id: a.goods_id,
1019 1019 store_id: oo.stoid
... ... @@ -1021,10 +1021,14 @@ Page({
1021 1021 // console.log('goods_num', e.goods_num);
1022 1022 this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1023 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 1032 this.data.up_dating = 0;
1029 1033 }
1030 1034 },
... ... @@ -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 1754 wx.showToast({
1747 1755 title: '购买数量超出商品限购',
1748 1756 icon: 'none',
1749   - // content: '购买数量超出商品限购'
1750 1757 });
1751 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 1765 e.setData({
1754 1766 // [txt]: cbuy > 0 ? cbuy : 0,
1755 1767 [txt]: cbuy > 0 ? cbuy : limit,
... ...
pages/cart/cart/cart.wxml
... ... @@ -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 8 <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image>
9   -</navigator>
  9 +</navigator> -->
10 10  
11 11 <block wx:if="{{ad_data}}">
12 12 <swiper class="swiper" circular="true" autoplay="true"
... ...
pages/cart/cart/cart.wxss
... ... @@ -131,7 +131,7 @@ radio {
131 131  
132 132 .sub, .add, .count>input {
133 133 /* border-right: 1px solid #000; */
134   - background-color: #f8f8f8;
  134 + background-color: #f0f0f0;
135 135 border-radius: 8rpx;
136 136 }
137 137 .sub.active {
... ...
pages/cart/cart2/c_filter.wxs
... ... @@ -15,6 +15,7 @@ var filters = {
15 15 if(ind==1 ) return "green";
16 16 if(ind==2) return "blue";
17 17 if(ind==11) return "green";
  18 + if(ind==13) return "red";
18 19 if(ind==12) return "blue";
19 20 if(ind==20) return "green";
20 21 return "";
... ... @@ -44,6 +45,7 @@ var filters = {
44 45 if (ind == 2) return "指定品类";
45 46 if (ind == 11) return "指定用途";
46 47 if (ind == 12) return "指定分类1";
  48 + if (ind == 13) return "全场通用";
47 49 if (ind == 20) return "指定单品";
48 50 return "";
49 51 },
... ...
pages/cart/cart2/cart2.js
... ... @@ -227,23 +227,6 @@ Page({
227 227 } else {
228 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 231 var is_card_back = getApp().globalData.is_card_back;
249 232 //--更新默认地址--,看一下是不是跳到地址页面,同时也不是购买等级卡返回的,这里很重要,否则会重新更新收货物流公司
... ... @@ -392,6 +375,7 @@ Page({
392 375 th.setData({ user_addr: addr });
393 376 //--------------------------立即购买------------------
394 377 if (ta.is_bnow == 1) {
  378 + console.log('is_bnow');
395 379 //读取门店
396 380 to.get_allsto(function (e) {
397 381 th.setData({ allsto: e });
... ... @@ -404,6 +388,8 @@ Page({
404 388 to.get_allsto(function (e) {
405 389 th.setData({ allsto: e });
406 390 //-------获取购物车已经选择的商品--------
  391 + console.log('购物车结算');
  392 +
407 393 th.get_cart();
408 394 })
409 395 }
... ... @@ -533,7 +519,7 @@ Page({
533 519 }
534 520 if (item1.prom_type == 10) {
535 521 if (!th.data.ladder_map[item1.prom_id]) {
536   - //如果有组合购
  522 + //如果有预售
537 523 var isok = 1;
538 524 var is_flag = 1;
539 525 var act = null;
... ... @@ -984,7 +970,6 @@ Page({
984 970 if (gg.prom_type == 5) {
985 971 t.data.data.prom_id = gg.prom_id;
986 972 t.data.data.prom_type = 5;
987   -
988 973 // console.log('xxxxxxxxxxxxxxxxxx', gg.is_coupon)
989 974 th.is_coupon = gg.is_coupon;
990 975 th.setData({
... ... @@ -1378,6 +1363,15 @@ Page({
1378 1363 wx.showLoading({
1379 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 1375 var all_price = 0; //所有的商品总价
1382 1376 var all_shipping_m = 0; //所有的物流总价
1383 1377 var all_total_m = 0; //所有的订单应付总价
... ... @@ -1391,6 +1385,9 @@ Page({
1391 1385  
1392 1386 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
1393 1387 var freight_free = ee.freight_free; //全场满多少包邮
  1388 + var free1=freight_free;
  1389 +
  1390 +
1394 1391 var weight_free = ee.weight_free; //多少kg内包邮
1395 1392 var no_ex_id = ee.no_ex_id;
1396 1393 var no_ex_good = null;
... ... @@ -1503,16 +1500,6 @@ Page({
1503 1500 }
1504 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 1505 var f_o_price = o_price;
... ... @@ -1564,12 +1551,14 @@ Page({
1564 1551  
1565 1552 th.data.is_no_past = 1; //不包邮标识符
1566 1553  
  1554 + var no_ex_good_arr = null;
1567 1555 //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额--
1568 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 1558 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1571 1559 if (th.check_by_area(by_qc.region_list)) {
1572 1560 freight_free = 0;
  1561 + th.data.is_area_by=1;
1573 1562 //goods_weight = -1;
1574 1563 //out_of_weight = 0;
1575 1564 th.data.is_no_by[pickid] = 1;
... ... @@ -1580,11 +1569,67 @@ Page({
1580 1569 freight_free = 0;
1581 1570 //goods_weight = -1;
1582 1571 //out_of_weight = 0;
1583   - th.data.is_no_by[pickid] = 1;
  1572 + //th.data.is_no_by[pickid] = 1;
1584 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 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 1714 if (no_ex_good) {
1670 1715 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
1671 1716 }
1672   -
1673 1717 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量
  1718 + /*--
1674 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 1720 continue;
1676   - }
1677   -
  1721 + }--*/
1678 1722 //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
1679 1723 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) {
1680 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 1732 if (th.data.user_addr != null) {
1691 1733 switch (item[j]['exp_sum_type']) {
... ... @@ -1693,14 +1735,6 @@ Page({
1693 1735 //统一运费
1694 1736 o_shipping_price += item[j]['uniform_exp_sum'];
1695 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 1738 case 3:
1705 1739 if (goods_piece < 0) goods_piece = 0;
1706 1740 //累积商品数量
... ... @@ -1708,12 +1742,28 @@ Page({
1708 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 1763 if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
1714 1764 goods_weight = -1;
1715 1765 out_of_weight = 0;
1716   - }
  1766 + }--*/
1717 1767 }
1718 1768 }
1719 1769  
... ... @@ -1753,8 +1803,6 @@ Page({
1753 1803 o_condition = o_price_no_zh - quan_price;
1754 1804 }
1755 1805  
1756   -
1757   -
1758 1806 var order_m = 0;
1759 1807 //---判断是不是有订单优惠---
1760 1808 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
... ... @@ -3124,6 +3172,14 @@ Page({
3124 3172 var fw_price = 0, fp_price = 0;
3125 3173 item = item.config;
3126 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 3184 if (goods_weight >= 0 && item['money']) {
3129 3185 fw_price = parseFloat(item['money']);
... ... @@ -3133,16 +3189,13 @@ Page({
3133 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 3200 if (goods_piece > 0 && item['piecemoney']) {
3148 3201 fp_price = parseFloat(item['piecemoney']);
... ... @@ -3152,6 +3205,9 @@ Page({
3152 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 3211 var rspice = parseFloat(price + fw_price + fp_price);
3156 3212 return rspice;
3157 3213 },
... ... @@ -3715,7 +3771,7 @@ Page({
3715 3771 for (var i in goodlist) {
3716 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 3775 continue;
3720 3776 }
3721 3777  
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -161,19 +161,6 @@ Page({
161 161  
162 162 } else {
163 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 165 //th.data.prom_goods_map={};
179 166 //更换地址回来要重新调用计算价钱的接口
... ...
pages/distribution/distribution.js
... ... @@ -3,19 +3,6 @@ const app = getApp();
3 3 let self = null, os = app.globalData.setting;
4 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 6 Page({
20 7  
21 8 /**
... ... @@ -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 29 first_leader: e.globalData.first_leader || 0, // 推荐人ID
30 30 },
31 31 onLoad: function (options) {
  32 +
32 33 var th = this;
33 34 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
34 35 my_confirm.open_cancel(0);
... ... @@ -52,6 +53,7 @@ Page({
52 53 })
53 54 }
54 55  
  56 +
55 57 getApp().request.promiseGet("/api/weshop/ad/page?pid=901&store_id=" + os.stoid, {
56 58 data: {
57 59 enabled: 1
... ... @@ -70,18 +72,19 @@ Page({
70 72 });
71 73 }
72 74 })
73   -
  75 +
74 76  
75 77 },
76 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 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 44 //-- 获取分享人的ID --
45 45 var first_leader = options.first_leader || getApp().globalData.first_leader;
46 46 if (first_leader) {
... ... @@ -60,18 +60,19 @@ Page({
60 60 },
61 61  
62 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 77 GetBuyPrice: function (e) {
77 78 var that = this.data;
... ... @@ -415,13 +416,13 @@ Page({
415 416 if (pagePath.indexOf('/') != 0) {
416 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 420 // if (this.data.isBuy == 0) {
420 421 // pagePath += "&orderSn=" + this.data.orderSn;
421 422 // } else {
422 423 // pagePath += "&lbId=" + this.data.getGiftID;
423 424 // }
424   - // console.log('pagePath', pagePath);
  425 + // console.log('pagePath', pagePath);
425 426 return {
426 427 title: "礼包详情",
427 428 path: pagePath,
... ... @@ -437,12 +438,13 @@ Page({
437 438 if (pagePath.indexOf('/') != 0) {
438 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 442 // if (this.data.isBuy == 0) {
442 443 // pagePath += "&orderSn=" + this.data.orderSn;
443 444 // } else {
444 445 // pagePath += "&lbId=" + this.data.getGiftID;
445 446 // }
  447 + console.log('pagePath', pagePath);
446 448 return {
447 449 title: "礼包详情",
448 450 path: pagePath,
... ... @@ -496,7 +498,7 @@ Page({
496 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 74 },
75 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 88 getList: function() {
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -655,18 +655,7 @@ Page({
655 655 var _errImg = e.target.dataset.errorimg;
656 656 var idx = e.target.dataset.idx;
657 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 661 goods_bnerr: function (e) {
... ... @@ -730,13 +719,7 @@ Page({
730 719 this.setData({
731 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 723 var arr2 = this.data.one_level_classify
741 724 for(var i=0;i<arr2.length;i++){
742 725 if(i == e.currentTarget.dataset.index){
... ... @@ -864,38 +847,10 @@ Page({
864 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 855 scrollLower: function (data) {
901 856 if(this.data.is_no_more) return false;
... ...
pages/goods/goodsInfo/buy_flash_normal.wxml
... ... @@ -3,7 +3,7 @@
3 3 <view class="pding">
4 4 <icon bindtap="closeSpecModal_flash_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
5 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 7 <view class="spec-goods-info">
8 8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
9 9 <view class="flex ai_end xc-val-money">
... ...
pages/goods/goodsInfo/buy_integral.wxml
... ... @@ -3,7 +3,7 @@
3 3 <view class="pding">
4 4 <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon>
5 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 7 <view class="spec-goods-info">
8 8 <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
9 9 <view class="flex ai_end xc-val-money">
... ...
pages/goods/goodsInfo/buy_integral_normal.wxml
... ... @@ -3,7 +3,7 @@
3 3 <view class="pding">
4 4 <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
5 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 7 <view class="spec-goods-info">
8 8 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
9 9 <view class="flex ai_end xc-val-money">
... ...
pages/goods/goodsInfo/buy_pt.wxml
... ... @@ -5,7 +5,7 @@
5 5  
6 6 <!-- 商品名称 -->
7 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 9 <view class="spec-goods-info">
10 10 <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
11 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 8 oo = s.globalData,
9 9 o = s.globalData.setting,
10 10 os = o;
  11 +
  12 +let self = null;
  13 +
11 14 //评价加载更多
12 15 var more = function (e) {
13 16 return e && e.__esModule ? e : {
... ... @@ -25,7 +28,7 @@ Page({
25 28 color_type: 0, //线条控制
26 29 color_type_one: 0,
27 30 color_type_two: 1,
28   -
  31 + is_no_plus:1,
29 32 gid: "",
30 33 stoid: o.stoid,
31 34 url: o.url,
... ... @@ -251,6 +254,7 @@ Page({
251 254  
252 255 share_hidden: false,
253 256 all_activity_list: null, //所有活动的列表
  257 +
254 258 },
255 259  
256 260 //------初始化加载----------
... ... @@ -265,7 +269,8 @@ Page({
265 269 prom_type = t.prom_type,
266 270 prom_id = t.prom_id; //活动ID
267 271  
268   -
  272 + self = this;
  273 +
269 274 //-- 自定义海报 --
270 275 getApp().request.promiseGet("/api/weshop/goods/poster/page", {
271 276 data: {store_id: os.stoid, type: 1, is_use: 1}
... ... @@ -354,6 +359,22 @@ Page({
354 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 378 getApp().getConfig(function (e) {
358 379 ee.setData({sto_sele_name_1: e.store_name})
359 380 })
... ... @@ -511,7 +532,9 @@ Page({
511 532 //更新点击量
512 533 getApp().request.put("/api/weshop/goods/updateClick", {
513 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 986 })
964 987  
965 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 1010 enterAddress: function () {
969 1011 this.data.enterAddressPage = !0, wx.navigateTo({
970 1012 url: "/pages/user/address_list/address_list?operate=selectAddress"
... ... @@ -3590,7 +3632,6 @@ Page({
3590 3632 pageSize: 1000
3591 3633 }
3592 3634 }).then(res => {
3593   -
3594 3635 let pd_list = res.data.data.pageData;
3595 3636 if (res.data.code == 0 && pd_list.length > 0) {
3596 3637 flag = pd_list.some(pd => {
... ... @@ -3773,6 +3814,20 @@ Page({
3773 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 3832 countDown(time, prom_st) {
3778 3833 if (!this.data.is_timer) return false;
... ... @@ -4306,6 +4361,7 @@ Page({
4306 4361 go_cj_team: function (e) {
4307 4362 var ind = e.currentTarget.dataset.ind;
4308 4363 var item = this.data.teamgroup[ind];
  4364 + var goods_id = e.currentTarget.dataset.goodsid;
4309 4365 var id = item.id;
4310 4366 var th = this;
4311 4367  
... ... @@ -4350,15 +4406,17 @@ Page({
4350 4406 getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
4351 4407  
4352 4408 } else {
  4409 + console.log(222,goods_id)
4353 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 4416 else {
  4417 + console.log(1111,th.data.goods_id)
4360 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 4521 if (quan_list) {
4464 4522 for (var ind in quan_list) {
4465 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 4554 quan_list[ind].start = start;
4471 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 4708 context.setLineJoin('round'); //交点设置成圆角
4619 4709 context.setFillStyle("white")
4620 4710 context.setTextAlign('left');
4621   - context.fillText('强烈推荐', 64 * unit, 672 * unit);
  4711 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
4622 4712 // 7.商品价格
4623 4713 let price = '¥' + this.data.data.shop_price;
4624 4714  
... ... @@ -6521,6 +6611,22 @@ Page({
6521 6611  
6522 6612 closeSpecModal_flash_normal: function () {
6523 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 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
7 7 <block wx:if="{{isshow}}">
8 8 <view class="container">
  9 + <!-- 拼单规则规则 -->
  10 + <view wx:if="{{prom_type== 6}}" class="rules" bindtap="showRules">规则</view>
9 11 <view class="type-navbar">
10 12 <view class="type-box" wx:for="{{categories}}" wx:key="id">
11 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 16 <view class="goods-detail">
15 17 <view class="goods-info" style="position: relative;" hidden="{{activeCategoryId==0?false:true}}">
16 18  
17   - <!-- 历史购买记录 -->
  19 + <!-- 左上角轮播 历史购买记录 -->
18 20 <view class="swiper-container" wx:if="{{historyBuyInfo.length}}">
19 21 <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000">
20 22 <swiper-item class="swiper-item" wx:for="{{historyBuyInfo}}" wx:key="order_id">
... ... @@ -24,7 +26,6 @@
24 26 </view>
25 27 <view class="flex ai_c pd10">
26 28 <view class="nickname ellipsis-1x">{{item.nickname}}下单成功</view>
27   - <!-- <view style="flex-shrink: 0;"></view> -->
28 29 </view>
29 30 </view>
30 31 </swiper-item>
... ... @@ -183,8 +184,8 @@
183 184 {{data.goods_name}}
184 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 189 <view class="fs22 c-7b">分享</view>
189 190 </view>
190 191 </view>
... ... @@ -215,7 +216,7 @@
215 216 </view>
216 217 </view>
217 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 220 <!-- <view class="flex ai_c"> -->
220 221 <!-- //选项框头像 -->
221 222 <view class='gtou'>
... ... @@ -265,9 +266,9 @@
265 266 </view>
266 267 <!-- 这个是分享按钮 -->
267 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 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 272 <!-- <view class="share-font">1分享</view> -->
272 273 <view class="fs22 c-7b">分享</view>
273 274 </view>
... ... @@ -289,7 +290,7 @@
289 290  
290 291 <view class="goods-price">
291 292  
292   - <view class="flex jc_sb">
  293 + <view class="flex jc_sb ai_c">
293 294 <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}">
294 295  
295 296 <view class="market-price flex" style="align-items: baseline;">
... ... @@ -316,15 +317,15 @@
316 317 </view>
317 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 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 323 <view class="fs22 c-7b">分享</view>
323 324 </view>
324 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 329 <view class="flex ai-center grade-card-frame card-frame">
329 330 <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>
330 331 <view class="fs24 white view card-name ellipsis-1">
... ... @@ -336,7 +337,7 @@
336 337 </view>
337 338 </view>
338 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 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 343 <view class="beauty-makeup-frame flex ai-center">
... ... @@ -400,7 +401,7 @@
400 401 </view>
401 402  
402 403 <view wx:if="{{prom_type==1}}">
403   - <view class="flex jc_sb">
  404 + <view class="flex jc_sb ai_c">
404 405 <view class="flex" style="align-items: baseline;">
405 406 <view class="flex xc-price-frame">
406 407 <text class="fs30">¥</text>
... ... @@ -410,9 +411,9 @@
410 411 </view>
411 412 <!-- 这个是分享按钮 -->
412 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 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 417 <!-- <view class="share-font">1分享</view> -->
417 418 <view class="fs22 c-7b">分享</view>
418 419 </view>
... ... @@ -432,8 +433,8 @@
432 433 <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}">
433 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 438 <view class="fs22 c-7b">分享</view>
438 439 </view>
439 440 </view>
... ... @@ -662,15 +663,17 @@
662 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 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 673 </view>
672 674 </view>
673 675 </view>
  676 +
674 677 <!-- - 搭配促销 -- -->
675 678 <view class="dp_cx_view" wx:if="{{collocationGoods}}">
676 679 <view class="bb_view">
... ... @@ -1466,7 +1469,7 @@
1466 1469 <view class="top-frame">
1467 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 1473 <view class="coupon flex">
1471 1474 <view class="circle xc-circular-one"></view>
1472 1475 <view class="xc-coupon-left ">
... ... @@ -1500,6 +1503,7 @@
1500 1503 </view>
1501 1504 </view>
1502 1505 </view>
  1506 +<view class="mask" catchtouchmove="true" wx:if="{{showRules}}"></view>
1503 1507 <!-- 选择门店的弹框,1.1版最新的 -->
1504 1508 <block wx:if="{{store==1}}">
1505 1509 <view class="mongolia-layer" bindtap="close_popup"></view>
... ... @@ -1642,7 +1646,7 @@
1642 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 1650 <warn id="warn"></warn>
1647 1651 <!-- 分享控件,底部弹出 -->
1648 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 1654 <view class="mask" catchtap="closePoster"></view>
1651 1655 <view class="poster-container">
1652 1656 <view class="poster-wrapper">
1653   - <view class="poster">
  1657 + <view class="poster" bindtap="previewPoster">
1654 1658 <!-- <view class="poster" bindtap="previewImage"> -->
1655 1659 <image src="{{shareImgPath}}" class="poster-img"></image>
1656 1660 <view class="btn-close" catchtap="closePoster">
... ... @@ -1688,6 +1692,28 @@
1688 1692 </view>
1689 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 1718 <view hidden="{{!openSpecModal_flash_normal}}">
1693 1719 <include src="buy_flash_normal.wxml" />
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -9,10 +9,62 @@
9 9 image {
10 10 vertical-align: top;
11 11 }
  12 +.rules {
  13 + position: fixed;
  14 + background-color: rgba(0,0,0,.2);
  15 + color: white;
  16 + top: 22rpx;
  17 + right: 0;
  18 + z-index: 100;
  19 + font-size: 26rpx;
  20 + padding: 0 20rpx;
  21 + z-index: 99999;
  22 + border-radius: 20rpx 0 0 20rpx;
  23 +}
  24 +
  25 +.rule-pop-container {
  26 + position: fixed;
  27 + left: 0;
  28 + bottom: 0;
  29 + width: 100%;
  30 + background-color: white;
  31 + z-index: 99999;
  32 + border-radius: 16rpx 16rpx 0 0;
  33 + padding: 0 40rpx;
  34 + box-sizing: border-box;
  35 + font-size: 28rpx;
  36 + color: #444;
  37 +}
  38 +
  39 +.pop-title {
  40 + padding: 20rpx 0;
  41 + text-align: center;
  42 + font-size: 32rpx;
  43 + position: relative;
  44 +}
  45 +.icon-guan {
  46 + position: absolute;
  47 + right: 0;
  48 + font-size: 26rpx;
  49 + top: 50%;
  50 + transform: translateY(-50%);
  51 + color: #ccc;
  52 +}
  53 +.btn {
  54 + color: white;
  55 + padding: 20rpx 0;
  56 + text-align: center;
  57 + border-radius: 40rpx;
  58 + background: -webkit-linear-gradient(left,#ff5000,#ff2000) no-repeat;
  59 +}
12 60  
13 61 .goods-detail {
14 62 overflow: hidden
15 63 }
  64 +.popup-content {
  65 + max-height: 600rpx;
  66 + overflow-y: auto;
  67 +}
16 68  
17 69 .type-navbar {
18 70 display: flex;
... ... @@ -1582,7 +1634,7 @@ view.cart-btn-lg {
1582 1634 }
1583 1635  
1584 1636 .bz_view view {
1585   - width: 460rpx;
  1637 + width: 520rpx;
1586 1638 /* max-height: 70rpx; */
1587 1639 /* overflow: hidden; */
1588 1640 }
... ... @@ -1607,21 +1659,27 @@ view.cart-btn-lg {
1607 1659 height: 14rpx;
1608 1660 border-top: 2rpx solid #d70026;
1609 1661 border-right: 2rpx solid #d70026;
1610   - transform: rotate(45deg);
  1662 + transform: rotateZ(45deg);
1611 1663 display: inline-block;
1612 1664 margin-bottom: 3rpx;
1613 1665 }
1614 1666  
1615   -.bg_jj.down1 {
1616   - transform: rotate(135deg);
  1667 +.bg_jj.down {
  1668 + transform: rotateZ(135deg);
  1669 +}
  1670 +
  1671 +.bg_jj.up {
  1672 + transform: rotateZ(-45deg);
  1673 + margin-top: 6rpx;
1617 1674 }
1618 1675  
1619 1676 .bz-content {
1620   - flex-grow: 1;
1621   - text-align: justify;
1622   - padding: 0 30rpx 0 20rpx;
  1677 + padding: 0 0 0 20rpx;
1623 1678 }
1624 1679  
  1680 +
  1681 +
  1682 +
1625 1683 /* 顶部边框 */
1626 1684 .topframe {
1627 1685 width: 100%;
... ... @@ -2283,8 +2341,9 @@ view.cart-btn-lg {
2283 2341  
2284 2342 /* 分享 */
2285 2343 .icon-share {
2286   - font-size: 46rpx;
  2344 + font-size: 42rpx;
2287 2345 color: #d60021;
  2346 + line-height: 1;
2288 2347 }
2289 2348  
2290 2349 .xc-share-frame {
... ... @@ -3680,8 +3739,8 @@ button.custom-service::after {
3680 3739 .poster {
3681 3740 box-sizing: border-box;
3682 3741 width: 100%;
3683   - height: 915rpx;
3684   - border-radius: 20rpx;
  3742 + height: 940rpx;
  3743 + border-radius: 16rpx;
3685 3744 /* box-shadow: 0 8px 12px #666; */
3686 3745 position: relative;
3687 3746 z-index: 999;
... ... @@ -3737,10 +3796,10 @@ button.custom-service::after {
3737 3796 .btn-close {
3738 3797 /* background-color: rgba(0,0,0,.5); */
3739 3798 color: #ccc;
3740   - width: 50rpx;
  3799 + /* width: 50rpx;
3741 3800 height: 50rpx;
3742 3801 line-height: 50rpx;
3743   - text-align: center;
  3802 + text-align: center; */
3744 3803 border-radius: 50%;
3745 3804 position: absolute;
3746 3805 right: 20rpx;
... ... @@ -3748,7 +3807,7 @@ button.custom-service::after {
3748 3807 }
3749 3808  
3750 3809 .icon-close {
3751   - font-size: 48rpx;
  3810 + font-size: 36rpx;
3752 3811 }
3753 3812  
3754 3813 .quan_price {
... ... @@ -3774,7 +3833,8 @@ button.custom-service::after {
3774 3833 width: auto !important;
3775 3834 position: absolute;
3776 3835 right: 0;
3777   - top: 10rpx;
  3836 + top: 50%;
  3837 + transform: translateY(-50%);
3778 3838 }
3779 3839  
3780 3840  
... ... @@ -3935,3 +3995,9 @@ button.custom-service::after {
3935 3995 width: 100%;
3936 3996 height: 100%;
3937 3997 }
  3998 +
  3999 +.hideArea {
  4000 + position: absolute;
  4001 + left: -1000px;
  4002 + top: -1000px;
  4003 +}
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -19,7 +19,8 @@ Page({
19 19 tabname:"sort", //排序的字段
20 20 adname:"asc", //升降的字段
21 21 is_new:0,
22   - is_hot:0,
  22 + is_hot:0,
  23 + is_no_plus:1,
23 24 prom_goods_list:null,
24 25 rq_data:null,
25 26 isToggle: false, //切换商品视图控制符
... ... @@ -43,9 +44,6 @@ Page({
43 44 }
44 45  
45 46 var th=this;
46   -
47   - //a.init(this, "", "requestData");
48   -
49 47 var url = this.data.baseUrl;
50 48 this.data.is_new=t.is_new;
51 49 this.data.is_hot=t.is_hot;
... ... @@ -152,9 +150,6 @@ Page({
152 150 }
153 151 })
154 152 }
155   -
156   -
157   -
158 153 this.requestGoodsList(url);
159 154 getApp().getConfig2(function(rs){
160 155 //计算等级价相关
... ... @@ -186,7 +181,23 @@ Page({
186 181 })
187 182 },500)
188 183 }
189   - });
  184 + });
  185 +
  186 + //调用接口判断商家plus有没有过期
  187 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + oo.stoid + "&type=3", {}).then(res => {
  188 + if (res.data.code == 0) {
  189 + var arr = res.data.data.pageData;
  190 + if (arr.length > 0) {
  191 + var item = arr[0];
  192 + if (item.is_sy == 0) {
  193 + var now = Date.parse(new Date()); now = now / 1000;
  194 + if (item.end_time < now) {
  195 + th.setData({ is_no_plus: 0 })
  196 + }
  197 + }
  198 + }
  199 + }
  200 + })
190 201 },
191 202  
192 203 //设置优惠券的
... ... @@ -442,7 +453,10 @@ Page({
442 453  
443 454  
444 455 go_url:function (e) {
445   - var url=e.currentTarget.dataset.url;
  456 + var url = e.currentTarget.dataset.url;
  457 + var rq_data = JSON.stringify(this.data.rq_data);
  458 + url += `&o=${rq_data}`;
  459 + // console.log('url!!!=======<<<<', url);
446 460 getApp().goto(url);
447 461 }
448 462  
... ...
pages/goods/goodsList/goodsList.json
1 1 {
  2 + "backgroundTextStyle": "dark",
2 3 "navigationBarTitleText": "商品列表",
3 4 "usingComponents": {
4 5 "share_box": "/components/share_box/share_box"
... ...
pages/goods/goodsList/goodsList.wxml
... ... @@ -19,42 +19,44 @@
19 19 <view class="pd20 flex ai-center jc_sb search_fixed">
20 20 <!-- 搜索框 -->
21 21 <view class="search-box f1">
22   - <navigator hover-class="none" url="/pages/goods/search/search?ladder_id={{ladder_id}}"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</navigator>
  22 + <view hover-class="none" data-url="/pages/goods/search/search?ladder_id={{ladder_id}}" bindtap="go_url"><text class="iconfont icon-sousuo pdr10"></text>搜索店铺商品</view>
23 23 </view>
24 24 <!-- 单列/双列 显示切换 -->
25   - <text class="iconfont {{isToggle ? 'icon-fenxiang':'icon-fenlie'}} pdl30 fs36" bindtap="bindToggleDisplay"></text>
  25 + <text class="iconfont {{isToggle ? 'icon-fenlie':'icon-fenxiang'}} pdl30 fs36" bindtap="bindToggleDisplay"></text>
26 26 </view>
27 27  
28   - <view class="nav">
29   - <navigator bindtap="changeTab" class="nav-item" data-href="sort" data-ad="{{adname}}">综合
30   - <view class="ico-dg" wx:if="{{tabname=='sort'}}">
31   - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
32   - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
33   - </view>
34   - </navigator>
35   - <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量
36   - <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">
37   - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
38   - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
39   - </view>
  28 + <view class="nav-box">
  29 + <view class="nav">
  30 + <navigator bindtap="changeTab" class="nav-item" data-href="sort" data-ad="{{adname}}">综合
  31 + <view class="ico-dg" wx:if="{{tabname=='sort'}}">
  32 + <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  33 + <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  34 + </view>
  35 + </navigator>
  36 + <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量
  37 + <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">
  38 + <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  39 + <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  40 + </view>
40 41  
41   - </navigator>
42   - <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}">
43   - 价格
44   - <view class="ico-dg" wx:if="{{tabname=='final_price'}}">
45   - <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
46   - <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
47   - </view>
48   - </navigator>
49   - <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter">
50   - <image class="wh100" src="{{iurl}}/miniapp/images/xx.png"></image>
51   - </view>
52   - </navigator> -->
  42 + </navigator>
  43 + <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}">
  44 + 价格
  45 + <view class="ico-dg" wx:if="{{tabname=='final_price'}}">
  46 + <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  47 + <image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  48 + </view>
  49 + </navigator>
  50 + <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter">
  51 + <image class="wh100" src="{{iurl}}/miniapp/images/xx.png"></image>
  52 + </view>
  53 + </navigator> -->
53 54  
54   - <!-- <navigator class="nav-item search" url="/pages/goods/search/search">
55   - <image class="wh100 search-img" src="{{iurl}}/miniapp/images/search.png"></image>
56   - </navigator> -->
57   - </view>
  55 + <!-- <navigator class="nav-item search" url="/pages/goods/search/search">
  56 + <image class="wh100 search-img" src="{{iurl}}/miniapp/images/search.png"></image>
  57 + </navigator> -->
  58 + </view>
  59 + </view>
58 60  
59 61 <view class="choice_list" wx:if="{{!isToggle}}">
60 62 <navigator class="choice_item" url="{{g_filter.get_goods_url(item)}}" wx:for="{{requestData}}" wx:key="{{index}}">
... ... @@ -118,7 +120,7 @@
118 120 </block>
119 121 </block>
120 122 <block wx:else>
121   - <view wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  123 + <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
122 124 <view class="flex ai-center">
123 125 <view class="price rmb">{{item.shop_price}}</view>
124 126 <view class="word-line xc-ash mk_price rmb">{{item.market_price}}</view>
... ... @@ -233,7 +235,7 @@
233 235 </block>
234 236 </block>
235 237 <block wx:else>
236   - <view wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  238 + <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
237 239 <view class="flex ai-center">
238 240 <view class="price rmb">{{item.shop_price}}</view>
239 241 <view class="word-line xc-ash mk_price rmb">{{item.market_price}}</view>
... ...
pages/goods/goodsList/goodsList.wxss
... ... @@ -4,6 +4,7 @@ page {
4 4  
5 5 .container {
6 6 color: #666;
  7 + overflow-x: visible;
7 8 }
8 9  
9 10 .nav {
... ... @@ -41,13 +42,23 @@ page {
41 42 }
42 43  
43 44 .search_fixed {
44   - position: fixed;
  45 + box-sizing: border-box;
  46 + height: 114rpx;
  47 + position: sticky;
45 48 top: 0;
46   - width: 95%;
  49 + /* width: 95%; */
47 50 background-color: #f0f0f0;
48 51 z-index: 999;
49 52 }
50 53  
  54 +.nav-box {
  55 + position: sticky;
  56 + top: 114rpx;
  57 + /* width: 95%; */
  58 + background-color: #f0f0f0;
  59 + z-index: 999;
  60 +}
  61 +
51 62 .ico-dir {
52 63 width: 16rpx;
53 64 height: 22rpx;
... ...
pages/goods/search/search.js
... ... @@ -18,19 +18,23 @@ Page({
18 18 requestUrl: "",
19 19 //hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ]
20 20 hotWords: null,
21   -
  21 + is_no_plus:1,
22 22 tabname: "sort", //排序的字段
23 23 adname: "asc", //升降的字段
24 24 rq_data:null,
25   -
26   -
27   - searchRecord: [],
28   - keyword: '',
29   - is_his:0,
  25 + searchRecord: [],
  26 + keyword: '',
  27 + is_his:0,
  28 + hiddenClear: true,
30 29 },
31 30  
32 31 onLoad: function(t) {
33 32 this.data.rq_data=t;
  33 + if(t.o) {
  34 + this.data.rq_data.o = JSON.parse(t.o);
  35 + };
  36 +
  37 +
34 38 //接受有没有导购的参数
35 39 var first_leader=t.first_leader;
36 40 if(first_leader){
... ... @@ -43,8 +47,24 @@ Page({
43 47 })
44 48 }
45 49  
  50 + //调用接口判断商家plus有没有过期
  51 + rq.promiseGet("/store/storemoduleendtime/page?store_id=" + oo.stoid + "&type=3", {}).then(res => {
  52 + if (res.data.code == 0) {
  53 + var arr = res.data.data.pageData;
  54 + if (arr.length > 0) {
  55 + var item = arr[0];
  56 + if (item.is_sy == 0) {
  57 + var now = Date.parse(new Date()); now = now / 1000;
  58 + if (item.end_time < now) {
  59 + th.setData({ is_no_plus: 0 })
  60 + }
  61 + }
  62 + }
  63 + }
  64 + })
  65 +
46 66 var th=this;
47   - a.getConfig2(function(rs){
  67 + a.getConfig2(function(rs) {
48 68 var arr=new Array(),arr2=new Array();
49 69 if (rs.hot_keywords != null && ut.trim(rs.hot_keywords)!="" ){
50 70 var arr1 = rs.hot_keywords.split('|');
... ... @@ -100,7 +120,7 @@ Page({
100 120 //扫一扫过来,显示搜索的内容
101 121 var s_key = t.s_key;
102 122 if (s_key){
103   - s_key=s_key.trim();
  123 + s_key=s_key.trim();
104 124 this.search(s_key); this.openSearchModal();
105 125 return;
106 126 }
... ... @@ -112,14 +132,15 @@ Page({
112 132 url += "&ladder_id=" + t.ladder_id;
113 133 this.setData({
114 134 baseUrl:url,
115   -
116 135 })
117   - }
  136 + }
118 137 if (url != this.data.baseUrl) return this.requestSearch(url);
119 138 this.openSearchModal();
120 139 // 获取历史搜索记录
121   - this.getHistorySearch();
  140 + this.getHistorySearch();
122 141 },
  142 +
  143 +
123 144 changeTab: function(t) {
124 145 var ord = t.currentTarget.dataset.href;
125 146 var ad = t.currentTarget.dataset.ad;
... ... @@ -138,21 +159,44 @@ Page({
138 159  
139 160 //-----------真的调用地址进行搜索------------
140 161 requestSearch: function(t) {
  162 + // console.log('t===>', t);
141 163 if(this.data.loading) return false;
142 164 this.data.loading=1;
143 165 var e = this,th=e;
144   - if(getApp().globalData.userInfo){
145   - t += "&user_id=" + getApp().globalData.userInfo.user_id;
146   - }
  166 + if(getApp().globalData.userInfo) {
  167 + t += "&user_id=" + getApp().globalData.userInfo.user_id;
  168 + }
147 169 this.data.requestUrl = t;
148 170  
149 171 var user_id=getApp().globalData.user_id;
150 172 if(!user_id) user_id=0;
151   -
152   - getApp().request.promiseGet(t, {data:{is_mainshow: 1, isonsale: 1, store_id: oo.stoid,orderField: e.data.tabname, orderType: e.data.adname, page: e.data.currentPage}}).then(async res=>{
  173 + let data = {
  174 + is_mainshow: 1,
  175 + isonsale: 1,
  176 + store_id: oo.stoid,
  177 + orderField: e.data.tabname,
  178 + orderType: e.data.adname,
  179 + page: e.data.currentPage,
  180 + };
  181 +
  182 + let o = this.data.rq_data.o;
  183 + if(o) {
  184 + if(o.cat_id) data.cat_id = o.cat_id;
  185 + if(o.pid && o.pid != 'three') data.parent_id = o.pid;
  186 + if(o.nation_id) data.nation_id = o.nation_id;
  187 + if(o.brand_id) data.brand_id = o.brand_id;
  188 + };
  189 +
  190 +
  191 + getApp().request.promiseGet(t, {data:data}).then(async res=>{
153 192 th.data.loading=0;
154 193 if(ut.ajax_ok(res)){
155   - if(!e.data.requestData) e.data.requestData=[];
  194 + if(!e.data.requestData) {
  195 + // e.data.requestData=[];
  196 + e.setData({
  197 + requestData: [],
  198 + });
  199 + };
156 200 for(let i in res.data.data.pageData){
157 201 let item=res.data.data.pageData[i];
158 202 item.original_img = th.data.url + item.original_img;
... ... @@ -229,8 +273,8 @@ Page({
229 273 })
230 274 break;
231 275 default:
232   - break
233   - }
  276 + break;
  277 + };
234 278 if(url!=null && url!=''){
235 279 await getApp().request.promiseGet(url, {}).then(async res => {
236 280 var prom =null;
... ... @@ -249,11 +293,9 @@ Page({
249 293 item.prom_id=0;
250 294 item.prom_price=null;
251 295 }
252   -
253   -
254 296 }
255 297 })
256   - }
  298 + };
257 299 if(!th.data.requestData) th.data.requestData=[];
258 300 th.data.requestData.push(item);
259 301 e.setData({requestData: e.data.requestData});
... ... @@ -263,9 +305,13 @@ Page({
263 305 })
264 306 },
265 307 onReachBottom: function() {
  308 + console.log('触发上滑加载事件');
266 309 this.data.currentPage++
  310 + console.log('触发上滑加载事件currentPage',this.data.currentPage);
267 311 this.data.openSearchModal || e.canloadMore() && this.requestSearch(this.data.requestUrl);
268 312 },
  313 +
  314 +
269 315 openFilterModal: function() {
270 316 this.setData({
271 317 openFilterModal: !0
... ... @@ -279,8 +325,16 @@ Page({
279 325 filterGoods: function(t) {
280 326 this.resetData(), this.requestSearch(t.currentTarget.dataset.href), this.closeFilterModal();
281 327 },
  328 +
  329 +
  330 +
282 331 resetData: function() {
283   - e.resetConfig(), this.data.requestData = null, this.data.currentPage = 1;
  332 + e.resetConfig(),
  333 + // this.data.requestData = null,
  334 + this.data.currentPage = 1;
  335 + this.setData({
  336 + requestData: null,
  337 + });
284 338 },
285 339  
286 340 //---回复最初的设置---显示全部分类--
... ... @@ -300,32 +354,37 @@ Page({
300 354 openSearchModal: !1
301 355 });
302 356 },
  357 +
303 358 submitSearch: function(t) {
304   - console.log(111,t);
305   - var val=t.detail.value.word;
306   - if(val==undefined) val=t.detail.value;
307   - val=val?val.trim():'';
308   - if(!val){
309   - a.showWarning("请输入搜索关键词");
310   - }
311   - this.search(val);
312   -
  359 + var val=t.detail.value.word;
  360 + if(val==undefined) val=t.detail.value;
  361 + val=val?val.trim():'';
  362 + if(!val){
  363 + a.showWarning("请输入关键词");
  364 + }
  365 + this.search(val);
313 366 },
314 367  
315 368 //热搜关键字
316 369 searchHotWord: function(t) {
317   -
318   - var word= t.currentTarget.dataset.word;
319   - this.historyRecord(word);
  370 + var word = t.currentTarget.dataset.word;
  371 + if(word) {
  372 + this.setData({
  373 + keyword: word,
  374 + hiddenClear: false,
  375 + });
  376 + };
  377 + this.historyRecord(word);
320 378 this.search(word);
321 379 },
322 380  
323 381 //-----点击搜索按钮----
324 382 search: function(t) {
325   - if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词");
  383 + if ("string" != typeof t || "" == t) return a.showWarning("请输入关键词");
326 384 this.data.key_str=t;
327   - this.historyRecord();
328   - this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
  385 + this.resetData();
  386 + this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
  387 + this.historyRecord();
329 388 },
330 389  
331 390 //---------分享配置--------
... ... @@ -349,7 +408,7 @@ Page({
349 408 }
350 409 }
351 410  
352   - console.log("11-11"+pagePath);
  411 + // console.log("11-11"+pagePath);
353 412 return {
354 413 title: "商品搜索",
355 414 path:pagePath,
... ... @@ -393,9 +452,18 @@ Page({
393 452  
394 453  
395 454 getInput(e) {
396   - this.setData({
397   - keyword: e.detail.value
398   - });
  455 + let val = e.detail.value;
  456 + if(val) {
  457 + this.setData({
  458 + keyword: e.detail.value,
  459 + hiddenClear: false,
  460 + });
  461 + } else {
  462 + this.setData({
  463 + hiddenClear: true,
  464 + });
  465 + }
  466 +
399 467 },
400 468  
401 469 historyRecord(w) {
... ... @@ -449,13 +517,14 @@ Page({
449 517  
450 518  
451 519  
452   -
  520 + // 获取历史搜索记录
453 521 getHistorySearch() {
454 522 this.setData({
455 523 searchRecord: wx.getStorageSync('searchRecord') || [] //若无存储则为空
456 524 });
457 525 },
458 526  
  527 + // 清除历史搜素记录
459 528 clearSearchRecord() {
460 529 wx.clearStorageSync('searchRecord');
461 530 this.setData({
... ... @@ -466,5 +535,19 @@ Page({
466 535 go_url:function (e) {
467 536 var url=e.currentTarget.dataset.url;
468 537 getApp().goto(url);
469   - }
  538 + },
  539 +
  540 + clearInput() {
  541 + this.setData({
  542 + keyword: '',
  543 + hiddenClear: true,
  544 + openSearchModal: true,
  545 + });
  546 + },
  547 +
  548 + inputFocus() {
  549 + this.setData({
  550 + openSearchModal: true,
  551 + });
  552 + },
470 553 });
471 554 \ No newline at end of file
... ...
pages/goods/search/search.wxml
1 1 <wxs module="g_filter" src="g_filter.wxs"></wxs>
  2 +
2 3 <view class="container">
3   - <view class="nav">
4   - <navigator bindtap="changeTab" class="nav-item" data-href="sort" data-ad="{{adname}}">综合
5   - <view class="ico-dg" wx:if="{{tabname=='sort'}}">
6   - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
7   - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
8   - </view>
9   - </navigator>
10   - <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量
11   - <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">
12   - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
13   - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
14   - </view>
15   - </navigator>
16   - <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}">价格
17   - <view class="ico-dg" wx:if="{{tabname=='final_price'}}">
18   - <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
19   - <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
20   - </view>
21   - </navigator>
22   - <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter">
23   - <image class="wh100" src="{{url}}/miniapp/images/xx.png"></image>
24   - </view>
25   - </navigator> -->
26   - <navigator bindtap="openSearchModal" class="nav-item nav-search">
27   - <image class="wh100 search-img" src="{{url}}/miniapp/images/search.png"></image>
28   - </navigator>
29   - </view>
  4 + <!-- 搜索框 -->
  5 + <view class="search-bar">
  6 + <form bindsubmit="submitSearch">
  7 + <view class="pdh20 pdv10 flex ai_c jc_sb">
  8 + <view class="input-box">
  9 + <input autoFocus class="input-search" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/>
  10 + <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text>
  11 + </view>
  12 + <button class="btn" formType="submit" hover-class="none">搜索</button>
  13 + </view>
  14 + </form>
  15 + </view>
  16 +
  17 +
  18 + <view wx:if="{{openSearchModal}}">
  19 + <view class="pd20">
  20 + <view class="" wx:if="{{searchRecord.length != 0}}">
  21 + <view class="flex jc_sb ai_c">
  22 + <text class="fs28 bold">历史搜索</text>
  23 + <text class="iconfont icon-shanchu c-6" bindtap="clearSearchRecord" wx:if="{{searchRecord.length != 0}}"></text>
  24 + </view>
  25 + <block wx:if="{{searchRecord.length>0}}">
  26 + <view class="hot-row flex flex-wrap" wx:key="{{index}}">
  27 + <view class="hot-item history ellipsis-1" bindtap="searchHotWord" data-word="{{item}}" wx:for="{{searchRecord}}" wx:key="{{index}}">{{item}}</view>
  28 + </view>
  29 + </block>
  30 + <view wx:else class="fs24">暂无历史搜索记录</view>
  31 + </view>
  32 +
  33 + <view class="" wx:if="{{hotWords.length>0}}">
  34 + <view class="fs28 bold">热门搜索</view>
  35 + <block wx:if="{{hotWords.length>0}}">
  36 + <view class="hot-row" wx:for="{{hotWords}}" wx:key="{{index}}">
  37 + <view bindtap="searchHotWord" class="hot-item" data-word="{{item}}" wx:for="{{item}}" wx:key="{{index}}">{{item}}</view>
  38 + </view>
  39 + </block>
  40 + </view>
  41 + </view>
  42 + </view>
  43 +
  44 +
  45 +
  46 + <block wx:if="{{!openSearchModal}}">
  47 +
  48 + <view class="nav flex">
  49 + <navigator bindtap="changeTab" class="nav-item f1" data-href="sort" data-ad="{{adname}}">综合
  50 + <view class="ico-dg" wx:if="{{tabname=='sort'}}">
  51 + <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  52 + <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  53 + </view>
  54 + </navigator>
  55 + <navigator bindtap="changeTab" class="nav-item f1" data-href="sales_sum" data-ad="{{adname}}">销量
  56 + <view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">
  57 + <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  58 + <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  59 + </view>
  60 + </navigator>
  61 + <navigator bindtap="changeTab" class="nav-item f1" data-href="final_price" data-ad="{{adname}}">价格
  62 + <view class="ico-dg" wx:if="{{tabname=='final_price'}}">
  63 + <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>
  64 + <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>
  65 + </view>
  66 + </navigator>
  67 + <!-- <navigator bindtap="openFilterModal" class="nav-item">筛选<view class="ico-filter">
  68 + <image class="wh100" src="{{url}}/miniapp/images/xx.png"></image>
  69 + </view>
  70 + </navigator> -->
  71 + <!-- <navigator bindtap="openSearchModal" class="nav-item nav-search">
  72 + <image class="wh100 search-img" src="{{url}}/miniapp/images/search.png"></image>
  73 + </navigator> -->
  74 + </view>
  75 +
  76 +
  77 +
30 78 <view class="choice_list">
31 79 <navigator class="choice_item flex ai-center" url="{{g_filter.get_goods_url(item)}}" wx:for="{{requestData}}" wx:key="{{index}}">
32 80 <view class="img-wrap">
... ... @@ -76,7 +124,7 @@
76 124 </block>
77 125 </block>
78 126 <block wx:else>
79   - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  127 + <block wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
80 128 <view class="flex ai-center">
81 129 <view class="price">¥{{item.shop_price}}</view>
82 130 <view class="word-line xc-ash mk_price">¥{{item.market_price}}</view>
... ... @@ -113,15 +161,17 @@
113 161 </block>
114 162 </view>
115 163 </navigator>
116   -
117 164 <!-- 有商品列表的时候,要有分享攻击 -->
118 165 <share_box id="share"></share_box>
119 166 </view>
120   - <view class="no-data" wx:if="{{!requestData||requestData.length==0}}">
121   - <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image>
122   - <view class="no-data-title">没有相关的数据</view>
123   - <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index"> 去逛逛 </navigator>
124   - </view>
  167 + <!-- 无数据提示 -->
  168 + <view class="no-data" wx:if="{{!requestData||requestData.length==0}}">
  169 + <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image>
  170 + <view class="no-data-title">没有相关的数据</view>
  171 + <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index"> 去逛逛 </navigator>
  172 + </view>
  173 +
  174 + </block>
125 175 </view>
126 176 <view hidden="{{!openFilterModal}}">
127 177 <view bindtap="closeFilterModal" class="cover-layer"></view>
... ... @@ -157,36 +207,4 @@
157 207 </view>
158 208 </view>
159 209 </view>
160   -</view>
161   -<view wx:if="{{openSearchModal}}">
162   - <view class="search-modal">
163   - <view class="search-bar">
164   - <form bindsubmit="submitSearch">
165   - <input autoFocus class="search-input" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput"></input>
166   - <button class="search-btn" formType="submit">
167   - <image class="wh100 search-img" src="{{url}}/miniapp/images/sea.png"></image>
168   - </button>
169   - </form>
170   - </view>
171   - <view class="search-hot">
172   - <view class="hot-title">热门搜索</view>
173   - <block wx:if="{{hotWords.length>0}}">
174   - <view class="hot-row" wx:for="{{hotWords}}" wx:key="{{index}}">
175   - <view bindtap="searchHotWord" class="hot-item" data-word="{{item}}" wx:for="{{item}}" wx:key="{{index}}">{{item}}</view>
176   - </view>
177   - </block>
178   - </view>
179   - <view class="search-hot">
180   - <view class="hot-title flex jc_sb ai_c">
181   - <text>历史搜索</text>
182   - <text class="iconfont icon-shanchu xc-ash" bindtap="clearSearchRecord" wx:if="{{searchRecord.length != 0}}"></text>
183   - </view>
184   - <block wx:if="{{searchRecord.length>0}}">
185   - <view class="hot-row flex flex-wrap" wx:key="{{index}}">
186   - <view class="hot-item history ellipsis-1" bindtap="searchHotWord" data-word="{{item}}" wx:for="{{searchRecord}}" wx:key="{{index}}">{{item}}</view>
187   - </view>
188   - </block>
189   - <view wx:else class="fs24">暂无历史搜索记录</view>
190   - </view>
191   - </view>
192 210 </view>
193 211 \ No newline at end of file
... ...
pages/goods/search/search.wxss
1 1 .container {
2 2 color: #666;
  3 + overflow: visible;
  4 +}
  5 +
  6 +.nav {
  7 + position: sticky;
  8 + top: 90rpx;
  9 + background-color: white;
  10 + z-index: 999;
3 11 }
4 12  
5 13 .nav-item {
6   - float: left;
  14 + /* float: left;
7 15 width: 30%;
8 16 height: 90rpx;
9   - line-height: 90rpx;
  17 + line-height: 90rpx; */
  18 + padding: 14rpx 10rpx;
10 19 display: flex;
11 20 align-items: center;
12 21 justify-content: center;
13   - font-size: 32rpx;
  22 + font-size: 28rpx;
14 23 border-bottom: 2rpx solid #E6E6E6;
15 24 background-color: #fff;
16 25 }
... ... @@ -160,7 +169,7 @@
160 169 }
161 170  
162 171 .search-modal {
163   - position: fixed;
  172 + /* position: fixed;
164 173 top: 0;
165 174 right: 0;
166 175 left: 0;
... ... @@ -170,12 +179,16 @@
170 179 overflow-x: hidden;
171 180 padding: 80rpx 30rpx;
172 181 font-size: 30rpx;
173   - color: #555;
  182 + color: #555; */
174 183 }
175 184  
176 185 .search-bar {
177   - width: 100%;
178   - box-sizing: border-box;
  186 + /* width: 100%;
  187 + box-sizing: border-box; */
  188 + background-color: white;
  189 + position: sticky;
  190 + top: 0;
  191 + z-index: 1;
179 192 }
180 193  
181 194 .search-input {
... ... @@ -212,21 +225,21 @@
212 225 .hot-title {
213 226 font-size: 35rpx;
214 227 color: black;
215   - margin-bottom: 30rpx;
  228 + /* margin-bottom: 30rpx; */
216 229 }
217 230  
218 231 .hot-row {
219 232 display: flex;
220 233 /*--justify-content: space-between---*/
221   - padding: 15rpx 10rpx;
  234 + padding: 10rpx 0;
222 235 }
223 236  
224 237 .hot-item {
225   - padding: 8rpx 8rpx;
226   - border: 1rpx solid #e0e0e0;
227   - border-radius: 10rpx;
  238 + padding: 6rpx 20rpx;
  239 + border: 2rpx solid #e0e0e0;
  240 + border-radius: 40rpx;
228 241 font-size: 28rpx;
229   - margin-left: 15rpx;
  242 + margin-right: 16rpx;
230 243 }
231 244  
232 245 /* .card_bg {
... ... @@ -303,9 +316,69 @@
303 316 background-color: #f0f0f0;
304 317 color: #7b7b7b;
305 318 border: none;
306   - margin-bottom: 8rpx;
  319 + margin-bottom: 16rpx;
307 320 }
308 321  
309 322 .history:first-of-type {
  323 + /* margin-left: 0; */
  324 +}
  325 +
  326 +.input-box {
  327 + position: relative;
  328 + flex: 1;
  329 + padding-left: 50rpx;
  330 + padding-right: 70rpx;
  331 + background-color: #f0f0f0;
  332 + border-radius: 60rpx;
  333 +}
  334 +
  335 +.input-box::before {
  336 + font-family: iconfont;
  337 + position: absolute;
  338 + left: 20rpx;
  339 + top: 50%;
  340 + transform: translateY(-50%);
  341 + content: '\e618';
  342 +}
  343 +
  344 +.input-search {
  345 + position: relative;
  346 + padding: 10rpx;
  347 + font-size: 28rpx;
  348 +}
  349 +
  350 +
  351 +.btn {
310 352 margin-left: 0;
  353 + margin-right: 0;
  354 + line-height: 1;
  355 + padding: 20rpx;
  356 + font-size: 30rpx;
  357 +}
  358 +
  359 +.btn::after {
  360 + border: none;
  361 +}
  362 +
  363 +.icon-guan {
  364 + font-size: 20rpx;
  365 + padding: 10rpx;
  366 + position: absolute;
  367 + right: 20rpx;
  368 + top: 50%;
  369 + transform: translateY(-50%);
  370 +}
  371 +
  372 +.lookat {
  373 + display: inline-block;
  374 + color: #FF6768;
  375 + border: 2rpx solid #FF6768;
  376 + border-radius: 80rpx;
  377 + font-size: 30rpx;
  378 +}
  379 +
  380 +.no-data .no-data-title {
  381 + font-size: 28rpx;
  382 + color: #999;
311 383 }
  384 +
... ...
pages/index/index/index.js
... ... @@ -88,7 +88,6 @@ Page({
88 88 },
89 89  
90 90 onLoad: async function (tt) {
91   -
92 91 var th = this;
93 92 var first_leader = tt.first_leader;
94 93 if (!first_leader && tt.scene) {
... ...
pages/index/index/index.wxml
... ... @@ -172,21 +172,23 @@
172 172 <view class="seckill-list">
173 173 <swiper class="s_prom" indicator-dots="{{false}}" bindchange="flashSwiperChange">
174 174 <swiper-item wx:for="{{saleGoods}}" wx:key="{{index}}" class="p_swiper" wx:key="saleGoods" style="740rpx !important;padding: 0; margin-left: 10rpx">
175   - <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&title={{aitem.goods_name}}&prom_type=1&prom_id={{aitem.id}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind">
176   - <view class="imgview ">
177   - <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image>
178   -
179   - <image wx:if="{{aitem.status==0}}" class="status_img" src="{{url}}/miniapp/images/miao/yure.png"></image>
180   - <image wx:if="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image>
181   - <image wx:if="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image>
182   - </view>
183   - <view class="ellipsis-2 mar-top10" style="height: 76rpx;">{{aitem.goods_name}}</view>
184   - <!-- <view class="red-co mar-top10 is_seckill_height"> -->
185   - <view class="co-red mar-top10">
186   - <text class="fs20">¥</text>{{aitem.price}}
187   - <text class="un_line">¥{{aitem.market_price}}</text>
188   - </view>
189   - </navigator>
  175 + <navigator style="flex-shrink: 0;width: 247rpx" class="nav" hover-class="none" 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 )}}" wx:for="{{item}}" wx:key="item" wx:for-item="aitem" wx:for-index="aind">
  176 + <view class="imgview">
  177 + <image src="{{url+aitem.original_img}}" mode="aspectFill" lazy-load="true" data-errorimg="saleGoods[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3" data-img="{{aitem.original_img}}"></image>
  178 +
  179 + <image wx:if="{{aitem.status==0}}" class="status_img" src="{{url}}/miniapp/images/miao/yure.png"></image>
  180 + <image wx:if="{{aitem.status==1}}" class="status_img" src="{{url}}/miniapp/images/miao/going.png"></image>
  181 + <image wx:if="{{aitem.status==2}}" class="status_img" src="{{url}}/miniapp/images/miao/mend.png"></image>
  182 + </view>
  183 + <view class="ellipsis-2 mar-top10" style="height: 76rpx;">{{aitem.goods_name}}</view>
  184 + <!-- <view class="red-co mar-top10 is_seckill_height"> -->
  185 + <view class="co-red mar-top10">
  186 + <text class="fs20">¥</text>{{aitem.price}}
  187 + <text class="un_line">¥{{aitem.market_price}}</text>
  188 + </view>
  189 + </navigator>
  190 +
  191 +
190 192 </swiper-item>
191 193 </swiper>
192 194 <!-- <view class="flex-center-around translation">
... ...
pages/store/index.wxss
1   -/* .box{
  1 +.box{
2 2 padding: 10px;
3 3 border-bottom: 10px solid #f5f5f5;
4 4 color: #000000;
... ... @@ -44,7 +44,7 @@ position: relative;
44 44 .sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;}
45 45 .sear_inp input{width: 400rpx;}
46 46 .select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center }
47   -.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;} */
  47 +.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;}
48 48  
49 49 .border-bottom {
50 50 border-bottom: 2rpx solid #e0e0e0;
... ...
pages/team/team_ping/team_ping.js
... ... @@ -90,13 +90,6 @@ Page({
90 90 order_goods=null;//订单商品表
91 91  
92 92 //获取订单表的信息根据活动user_id,pt_prom_id>0 AND pay_time>0
93   - /*---
94   - await getApp().request.promiseGet("/api/weshop/order/page?"+where, {
95   - data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,}
96   - }).then(res => {
97   - order = res.data.data.pageData;
98   - this.data.currentPage++;
99   - })--*/
100 93  
101 94 await getApp().request.promiseGet("/api/weshop/order/pageTuan?"+where, {
102 95 data: { is_pt:1,store_id: os.stoid, user_id: user_id, pageSize: 6, page: this.data.currentPage,}
... ...
pages/user/Detailed/Detailed.js
... ... @@ -189,9 +189,10 @@ Page({
189 189 }
190 190  
191 191 this.data.is_loading=1;
192   - wx.showLoading({ title: '生成中...',})
193   -
194   - var th = this;
  192 + wx.showLoading({ title: '生成中...',})
  193 + this.setData({ canvasHidden: false })
  194 +
  195 + var th = this;
195 196  
196 197 //设置画板显示,才能开始绘图
197 198 var card_ming=th.data.bas_ming;//卡的图片
... ... @@ -217,7 +218,7 @@ Page({
217 218 success: function (res) {
218 219 th.get_head_temp(function(){
219 220 var vpath=res.path;
220   - th.setData({ canvasHidden: false })
  221 +
221 222 //开启画布
222 223 const ctx = wx.createCanvasContext('myCanvas');
223 224 //先画背景
... ...
pages/user/address_list/address_list.js
... ... @@ -80,15 +80,6 @@ Page({
80 80 /*-----选择地址返回确认------*/
81 81 selectAddress: function (e) {
82 82 if (null != this.data.operate) {
83   - /*----
84   - if ("select" == this.data.operate) wx.setStorageSync("cart:cart2:address_id", e.currentTarget.dataset.item.address_id); else if ("teamSelect" == this.data.operate) wx.setStorageSync("team:confirm:address_id", e.currentTarget.dataset.item.address_id); else if ("selectAddress" == this.data.operate) {
85   - var t = {
86   - address: e.currentTarget.dataset.item.province_name + e.currentTarget.dataset.item.city_name + e.currentTarget.dataset.item.district_name,
87   - district: e.currentTarget.dataset.item.district
88   - };
89   - wx.setStorageSync("goodsInfo:goodsInfo:address", t);
90   - }---*/
91   -
92 83 oo.baddr = e.currentTarget.dataset.item;
93 84 wx.navigateBack();
94 85 }
... ...
pages/user/address_list/address_list.wxml
1   -<!-- <view class="container">
2   - <view class="address-box" wx:for="{{addresses}}" wx:key="{{index}}">
3   - <view class="address-user">
4   - <view class="user-name">{{item.consignee}}</view>
5   - <text class="default" wx:if="{{item.is_default}}">默认</text>
6   - </view>
7   - <view bindtap="selectAddress" class="address-info" data-item="{{item}}">
8   - <view class="mobile">电话:{{item.mobile}}</view>
9   - <view class="address">{{item.more_address}} {{item.address}}</view>
10   - </view>
11   - <view bindtap="editAddress" class="address-edit" data-id="{{item.address_id}}">
12   - <image src="{{iurl}}/miniapp/images/address_edit.png"></image>
13   - </view>
14   - </view>
15   - <navigator class="address-create" url="/pages/user/add_address/add_address">
16   - <view class="create-btn">+新建地址</view>
17   - </navigator>
18   -</view> -->
19 1  
20 2 <!-- 无收货地址提醒页面 -->
21 3 <view class="topbcolor"></view>
... ...
pages/user/assistance/assistance.js
... ... @@ -28,18 +28,17 @@ Page({
28 28 timer: "", //任务列表的定时器
29 29 s_num: "", //多少人已经领取任务
30 30 page: 1, //我的任务的当前页
31   -
32   - imageUrl:'',
33   - btn_color:'',
34   - bg_color:'',
35   - font_color:'',
  31 +
  32 + imageUrl: '',
  33 + btn_color: '',
  34 + bg_color: '',
  35 + font_color: '',
36 36 },
37 37  
38 38 /**
39 39 * 生命周期函数--监听页面加载
40 40 */
41   - onLoad: function(options) {
42   -
  41 + onLoad: function (options) {
43 42 var th = this;
44 43 var nav_b = th.selectComponent("#nav_b"); //组件的id
45 44 nav_b.set_name("助力", "/pages/user/assistance/assistance");
... ... @@ -49,34 +48,33 @@ Page({
49 48 /**
50 49 * 生命周期函数--监听页面显示
51 50 */
52   - onShow: function() {
53   -
  51 + onShow: function () {
54 52 //--先判断会员状态--
55   - var user_info = getApp().globalData.userInfo;
56   - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
57   - getApp().goto('/pages/togoin/togoin');
58   - return false;
59   - }
  53 + getApp().is_Single_page(this, function () {
  54 + var user_info = getApp().globalData.userInfo;
  55 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  56 + getApp().goto('/pages/togoin/togoin');
  57 + return false;
  58 + }
  59 + // 助力活动
  60 + this.assistance();
  61 + })
  62 + },
60 63  
61   - var th = this;
62   - // 助力活动
63   - this.assistance();
  64 + print() {
  65 + var user_id = getApp().globalData.user_id;
  66 + var store_id = os.stoid;
  67 +
  68 + getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", {
  69 + data: {
  70 + storeId: store_id,
  71 + userId: user_id
  72 + }
  73 + }).then(res => {
  74 + console.log('res', res);
  75 + });
64 76 },
65   -
66   - print() {
67   - var user_id = getApp().globalData.user_id;
68   - var store_id = os.stoid;
69   -
70   - getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", {
71   - data: {
72   - storeId: store_id,
73   - userId: user_id
74   - }
75   - }).then(res => {
76   - console.log('res', res);
77   - });
78   - },
79   -
  77 +
80 78 // 助力活动
81 79 assistance() {
82 80 var th = this;
... ... @@ -95,10 +93,10 @@ Page({
95 93 th.setData({
96 94 zl_act: help_data,
97 95 help_id: help_data.id,
98   - btn_color: help_data.btn_color,
99   - bg_color: help_data.bg_color,
100   - font_color: help_data.font_color,
101   - imageUrl: help_data.imageUrl,
  96 + btn_color: help_data.btn_color,
  97 + bg_color: help_data.bg_color,
  98 + font_color: help_data.font_color,
  99 + imageUrl: help_data.imageUrl,
102 100 });
103 101 if (th.data.help_id != "" && th.data.help_id != null) {
104 102 //我的任务
... ... @@ -111,11 +109,11 @@ Page({
111 109 storeId: store_id
112 110 }
113 111 })
114   - }else
115   - getApp().my_warnning("暂无此活动或您不符合商家设置的会员参与对象,无法参与!", 0, th);
  112 + } else
  113 + getApp().my_warnning("暂无此活动或您不符合商家设置的会员参与对象,无法参与!", 0, th);
116 114 return ut.null_promise();
117 115 }).then(res => {
118   - if ( res && res.data &&res.data.code == 0)
  116 + if (res && res.data && res.data.code == 0)
119 117 th.setData({
120 118 s_num: res.data.data.countAll
121 119 })
... ... @@ -125,13 +123,13 @@ Page({
125 123 },
126 124  
127 125 //--点击获取用户任务列表--会员的任务列表
128   - get_list: function() {
  126 + get_list: function () {
129 127  
130 128 var th = this;
131 129 var page = th.data.page;
132   - if(page==1)th.data.zl_user_list=[];
  130 + if (page == 1) th.data.zl_user_list = [];
133 131 var help_id = this.data.help_id;
134   - var r=Math.random()*100;
  132 + var r = Math.random() * 100;
135 133 t.request.get("/api/weshop/marketing/help/help/user/page", {
136 134 isShowLoading: true,
137 135 data: {
... ... @@ -140,9 +138,9 @@ Page({
140 138 helpId: help_id,
141 139 page: page,
142 140 pageSize: 5,
143   - r:r,
  141 + r: r,
144 142 },
145   - success: function(res) {
  143 + success: function (res) {
146 144 clearTimeout(th.data.timer);
147 145  
148 146 if (!th.data.is_load)
... ... @@ -181,17 +179,17 @@ Page({
181 179 },
182 180  
183 181 //-----跳转到领取礼包的页面------
184   - go_task: function() {
  182 + go_task: function () {
185 183 var th = this;
186 184 var help_id = th.data.help_id;
187   - if (!help_id){
188   - getApp().my_warnning("暂无此活动或您不符合商家设置的会员参与对象,无法参与!", 0, th);
189   - return false;
190   - }
  185 + if (!help_id) {
  186 + getApp().my_warnning("暂无此活动或您不符合商家设置的会员参与对象,无法参与!", 0, th);
  187 + return false;
  188 + }
191 189  
192 190 getApp().goto("/pages/user/assistance/task_assistance?help_id=" + help_id);
193 191 },
194   - switch_head: function(e) {
  192 + switch_head: function (e) {
195 193 var th = this;
196 194 var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明
197 195 var switch_head = th.data.switch_head; //0任务,1活动说明
... ... @@ -203,50 +201,50 @@ Page({
203 201 },
204 202  
205 203 //关闭导航
206   - close: function() {
  204 + close: function () {
207 205 var th = this;
208 206 var nav_b = th.selectComponent("#nav_b"); //组件的id
209 207 nav_b.close_box();
210 208 },
211 209  
212 210 // 领取礼包
213   - get_libao: function(e) {
  211 + get_libao: function (e) {
214 212 var help_id = e.currentTarget.dataset.help_id;//活动id
215 213 var taskId = e.currentTarget.dataset.taskid;//任务id
216 214 var id = e.currentTarget.dataset.id;//用于跳到礼包详情一键全部领取用的任务id
217   - getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 1 + "&taskId=" + taskId+"&id="+id);
  215 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 1 + "&taskId=" + taskId + "&id=" + id);
218 216 },
219 217  
220 218 //查看礼包id
221   - select_libao: function(e) {
  219 + select_libao: function (e) {
222 220 var orderSn = e.currentTarget.dataset.ordersn; //订单号
223 221 getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
224 222 },
225 223  
226 224 //---查看任务---
227   - go_to_task:function (e) {
  225 + go_to_task: function (e) {
228 226 var help_id = this.data.help_id;
229   - var taskid=e.currentTarget.dataset.taskid;
230   - getApp().goto("/pages/user/assistance/task_assistance?help_id=" + help_id+"&taskid="+taskid);
  227 + var taskid = e.currentTarget.dataset.taskid;
  228 + getApp().goto("/pages/user/assistance/task_assistance?help_id=" + help_id + "&taskid=" + taskid);
  229 + },
  230 +
  231 + onShareAppMessage(res) {
  232 + if (res.from === 'button') {
  233 + // 来自页面内转发按钮
  234 + console.log(res.target)
  235 + }
  236 + return {
  237 + // title: '自定义转发标题',
  238 + }
  239 + },
  240 +
  241 + onShareTimeline() {
  242 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  243 + if (!store_name)
  244 + store_name = getApp().globalData.setting.appName;
  245 + return {
  246 + title: '好友助力-' + store_name,
  247 + }
231 248 },
232   -
233   - onShareAppMessage(res) {
234   - if (res.from === 'button') {
235   - // 来自页面内转发按钮
236   - console.log(res.target)
237   - }
238   - return {
239   - // title: '自定义转发标题',
240   - }
241   - },
242   -
243   - onShareTimeline() {
244   - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';
245   - if(!store_name)
246   - store_name=getApp().globalData.setting.appName;
247   - return {
248   - title: '好友助力-' + store_name,
249   - }
250   - },
251 249  
252 250 })
... ...
pages/user/assistance/task_assistance.js
... ... @@ -441,13 +441,7 @@ Page({
441 441  
442 442  
443 443 var user_list = su.data.data.pageData;
444   - // if (user_list == "" || user_list.length == 0 || user_list==null){
445   - // th.setData({
446   - // is_user_list: 1
447   - // });
448   - // console.log("走哪里1111");
449   - // }else{}
450   - console.log("走哪里22222222");
  444 +
451 445 var user_lists = th.data.user_task_list.concat(user_list);
452 446 th.setData({
453 447 user_task_list: user_lists
... ...
pages/user/cardinfo/cardinfo.js
... ... @@ -727,14 +727,19 @@ Page({
727 727  
728 728 //--转到用户余额--
729 729 to_user_money:function(){
730   - this.setData({yu_e_show:1})
  730 + //提现小于0的值也不提现
  731 + if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){
  732 + getApp().my_warnning("您目前没有可提现的金额",0,th); return false;
  733 + }
  734 + this.setData({yu_e_show:1})
731 735 },
732 736 close_yu_e:function(){
733 737 this.setData({yu_e_show:0})
734 738 },
735 739 go_yu_e:function(){
736 740 var th=this,free=th.data.free;
737   - if(!th.data.free.VIPRebate){
  741 + //提现小于0的值也不提现
  742 + if(!th.data.free.VIPRebate || parseFloat(th.data.free.VIPRebate)<=0){
738 743 getApp().my_warnning("您目前没有可提现的金额",0,th); return false;
739 744 }
740 745 wx.showModal({
... ...
pages/user/coupons/coupons.wxml
1 1 <wxs module="filter" src="filter.wxs"></wxs>
2 2 <wxs module="time" src="../../../utils/filter.wxs"></wxs>
3 3  
4   -
5   -<!-- <view class="big-rim">
6   - <form bindsubmit='Gettime'>
7   - <view class="min-rim">
8   - <view class="rq">日期:</view>
9   -
10   - <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'>
11   - <view class="rq-rim">
12   - <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> -->
13   - <!-- 清除输入框中的内容-->
14   - <!-- <view hidden='{{isBind}}' class="qc-rim">
15   - <button class="empty" catchtap="eliminate">x</button>
16   - </view>
17   - </view>
18   - </picker>
19   -
20   - <view class="zi">至 </view>
21   - <picker class="pi"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'>
22   - <view class="rim">
23   - <view class="kssj">
24   - <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text>
25   - </view> -->
26   - <!-- 清除输入框中的内容 -->
27   - <!-- <view class="end-rim" hidden="{{isBinds}}">
28   - <button class="end" catchtap="eliminates">x</button>
29   - </view>
30   - </view>
31   - </picker>
32   - </view>
33   - <view class="xknr-rim">
34   - <view class="cxnr">查询内容 </view>
35   - <view class='top'> -->
36   - <!-- 下拉框 -->
37   - <!-- <view class='top-selected' bindtap='bindShowMsg'>
38   - <input name="grade_name" class="texts" value='{{grade_name}}'>{{grade_name}}</input>
39   - <view class="rim-images">
40   - <image class="images" src='{{iurl}}/miniapp/images/usermoney/ico-pt4.png'></image>
41   - </view>
42   - </view> -->
43   - <!-- 下拉需要显示的列表 -->
44   - <!-- <view class="select-box" wx:if="{{select}}">
45   - <view wx:for="{{grades}}" wx:key="unique">
46   - <view class="select_one" bindtap="mySelect" data-name="{{item}}">{{item}}</view>
47   - </view>
48   - </view>
49   - </view>
50   - </view>
51   - <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button>
52   - </form>
53   -</view> -->
54   -
55 4 <view>
56 5  
57 6 <view class="tab-head" bindtap="clickTab">
... ...
pages/user/index/index.js
... ... @@ -25,6 +25,7 @@ Page({
25 25 txmon: 0,
26 26 byquan: 0,
27 27 yuer: 0,
  28 + is_no_plus:1,
28 29 currentPage: 1,
29 30 recommend_list: [],
30 31 tc_hide: true,
... ... @@ -41,7 +42,9 @@ Page({
41 42 actImg: "",
42 43 is_assistance: 0, //助力活动
43 44 ad_img:"",
44   - add_card_data:'', //等级卡的内容
  45 + add_card_data:'', //等级卡的内容
  46 +
  47 +
45 48 },
46 49 goto_nav: function(e) {
47 50 var th = this;
... ... @@ -58,39 +61,20 @@ Page({
58 61 * 生命周期函数--监听页面加载
59 62 */
60 63 onLoad: function(options) {
61   - var th=this;
62   - //-- 读取会员中心按钮列表 --
63   - getApp().request.get("/api/weshop/userTool/page?pageSize=100&store_id="+os.stoid, {
64   - success:function(res){
65   - if(ut.ajax_ok(res)) {
66   - var d_list=res.data.data.pageData;
67   - getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
68   - var dis=rs.data.data;
69   - for(var i in d_list){
70   - if(d_list[i].name=='我的分销' && (!dis || dis.switch==0)){
71   - d_list.splice(i,1);
72   - }
73   - }
74   - th.setData({user_tool:d_list});
75   -
76   - getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
77   - data: {
78   - enabled: 1
79   - },
80   - success:function(res){
81   - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
82   - var item=res.data.data.pageData[0];
83   - if (item && item.ad_code) th.setData({ad_img:item.ad_code})
84   - }
85   - }
86   - })
87   -
88   - app.getUserFir();
89   -
90   - })
91   - }
92   - }
93   - })
  64 + var th=this;
  65 + getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, {
  66 + data: {
  67 + enabled: 1
  68 + },
  69 + success:function(res){
  70 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
  71 + var item=res.data.data.pageData[0];
  72 + if (item && item.ad_code) th.setData({ad_img:item.ad_code})
  73 + }
  74 + }
  75 + })
  76 + app.getUserFir();
  77 + this.init_user_tool()
94 78  
95 79 },
96 80  
... ... @@ -98,10 +82,6 @@ Page({
98 82 * 生命周期函数--监听页面显示
99 83 */
100 84 onShow: function() {
101   -
102   -
103   -
104   -
105 85 //看一下小程序是不是过期了
106 86 getApp().getConfig2(function(config2){
107 87 if(config2 && config2.is_overdue==1){
... ... @@ -129,7 +109,21 @@ Page({
129 109 }
130 110 })
131 111  
132   -
  112 + //调用接口判断商家plus有没有过期
  113 + rq.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => {
  114 + if (res.data.code == 0) {
  115 + var arr = res.data.data.pageData;
  116 + if (arr.length > 0) {
  117 + var item = arr[0];
  118 + if (item.is_sy == 0) {
  119 + var now = Date.parse(new Date()); now = now / 1000;
  120 + if (item.end_time < now) {
  121 + th.setData({ is_no_plus: 0 })
  122 + }
  123 + }
  124 + }
  125 + }
  126 + })
133 127 var th=this;
134 128  
135 129 // 判断是否开启美业
... ... @@ -460,6 +454,8 @@ Page({
460 454  
461 455 },
462 456  
  457 +
  458 +
463 459 //判断会员是后有改服务项目
464 460 check_is_has_qy: function(item, g_qy_list) {
465 461 if (!g_qy_list) return false;
... ... @@ -870,6 +866,42 @@ Page({
870 866 corpId: id,
871 867 success(res) {}
872 868 })
  869 + },
  870 +
  871 + //初始话按钮图标
  872 + init_user_tool:async function () {
  873 + var d_list=null;
  874 + //读取user_tool按钮图标
  875 + await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id="+os.stoid, {
  876 + }).then(res=>{
  877 + if(ut.ajax_ok(res)) {
  878 + d_list=res.data.data.pageData;
  879 + }
  880 + })
  881 + if(!d_list) return false;
  882 + //过滤掉分销关闭的
  883 + await getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
  884 + if(rs.data.code==0){
  885 + var dis=rs.data.data;
  886 + for(var i in d_list){
  887 + if(d_list[i].name=='我的分销' && (!dis || dis.switch==0)){
  888 + d_list.splice(i,1);
  889 + }
  890 + }
  891 + }
  892 + })
  893 +
  894 + //判断右没有开AI测肤
  895 + await getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+os.stoid,{}).then(rs=>{
  896 + if(rs.data.code!=0 || !rs.data.data){
  897 + for(var i in d_list){
  898 + if(d_list[i].name=='AI测肤'){
  899 + d_list.splice(i,1);
  900 + }
  901 + }
  902 + }
  903 + })
  904 + this.setData({user_tool:d_list});
873 905 }
874 906  
875 907  
... ...
pages/user/index/index.wxml
... ... @@ -10,9 +10,10 @@
10 10 <image class="xc-user-img circle" bindtap="go_info" src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"></image>
11 11 <view class="xc-uesr-name">
12 12 <view class="flex ai-center">
13   - <text class="ellipsis-1" style="max-width: 290rpx;display: inline-block">{{userInfo.nickname}}</text>
14   - <view class="hvip" wx:if='{{GradeName && is_init}}'>
15   - <image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}</view>
  13 + <text class="ellipsis-1" style="max-width: 290rpx;display: inline-block">{{userInfo.nickname}}</text>
  14 + <view class="hvip" wx:if='{{GradeName && is_init}}'>
  15 + <image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}
  16 + </view>
16 17 </view>
17 18  
18 19 <view class="flex fs24 xc-grow-ups" style="margin-left:8rpx;margin-top:6rpx" wx:if="{{is_init && gradeId}}" bindtap='jump'>
... ... @@ -69,29 +70,31 @@
69 70 </image>
70 71  
71 72 </view>
72   - <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2 && show_buy_plus}}">
  73 + <block wx:if="{{is_no_plus}}">
  74 + <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2 && show_buy_plus }}">
73 75 <view class="xc-add-member flex-center-around ">
74   - <view class="flex jc-center ai-center">
75   - <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
76   - <view class="member fs28 "> 加入plus会员预计可省3031元</view>
77   - </view>
  76 + <view class="flex jc-center ai-center">
  77 + <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
  78 + <view class="member fs28 "> 加入plus会员预计可省3031元</view>
  79 + </view>
78 80 <view class="xc-opening-button t-c" data-url="/pages/user/plus/plus" bindtap="goto">
79 81 <view class="xc-opening fs28">立即开通</view>
80 82 </view>
81 83 </view>
82 84 </view>
83 85  
84   - <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3 && show_buy_plus}}">
  86 + <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==3 && show_buy_plus}}">
85 87 <view class="xc-add-member flex-center-around ">
86   - <view class="flex jc-center ai-center">
87   - <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
88   - <view class="member fs28 "> 加入plus会员预计可省3031元</view>
89   - </view>
  88 + <view class="flex jc-center ai-center">
  89 + <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
  90 + <view class="member fs28 "> 加入plus会员预计可省3031元</view>
  91 + </view>
90 92 <view class="xc-opening-button t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto">
91 93 <view class="xc-opening fs28">立即续费</view>
92 94 </view>
93 95 </view>
94   - </view>
  96 + </view>
  97 + </block>
95 98  
96 99 </view>
97 100 <view class="xc-after-sale rel">
... ... @@ -102,8 +105,8 @@
102 105 <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image>
103 106 <view class="three-level-word">我的订单</view>
104 107 </view>
105   - <!-- 物流信息提醒 -->
106   - <view class="fs26 c-5 pdl60" wx:if="{{countDadaOrder && countDadaOrder != 0}}" bindtap="go_order" data-url="/pages/user/order_list/order_list?index=1"><text class="iconfont icon-dingwei"></text>您有<text class="c-red">{{countDadaOrder}}</text>个同城配送订单</view>
  108 + <!-- 物流信息提醒 -->
  109 + <view class="fs26 c-5 pdl60" wx:if="{{countDadaOrder && countDadaOrder != 0}}" bindtap="go_order" data-url="/pages/user/order_list/order_list?index=1"><text class="iconfont icon-dingwei"></text>您有<text class="c-red">{{countDadaOrder}}</text>个同城配送订单</view>
107 110 </view>
108 111 <view class="three-level-word xc-more-frame flex-vertical" bindtap="go_order" data-url="/pages/user/order_list/order_list">
109 112 <view class="three-level-word xc-more">更多</view>
... ... @@ -152,7 +155,7 @@
152 155 <view class="xc-title-frame flex-space-between">
153 156 <view class="flex-vertical xc-title-content">
154 157 <image class="xc-title-img" src="{{iurl}}/miniapp/images/medal.png"></image>
155   - <view class="three-level-word">我的权益</view>
  158 + <view class="three-level-word">我的权益</view>
156 159 </view>
157 160 </view>
158 161 <view wx:if="{{is_grad_get}}" class="three-level-word xc-more-frame flex-vertical">
... ... @@ -168,32 +171,32 @@
168 171 <block wx:if="{{qy_list && gradeId}}">
169 172 <view class="xc-specific-more-frame flex-vertical" wx:if="{{qy_list}}">
170 173  
171   - <view bindtap="click_pre">
172   - <view class="bg_left xc-left bcolor"></view>
173   - </view>
  174 + <view bindtap="click_pre">
  175 + <view class="bg_left xc-left bcolor"></view>
  176 + </view>
174 177  
175   - <swiper current="{{sw_index}}" style='width:82.7%; height:108rpx' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}">
  178 + <swiper current="{{sw_index}}" style='width:82.7%; height:108rpx' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}">
176 179  
177   - <swiper-item wx:for="{{qy_list}}" wx:for-item="aitem" wx:for-index="pidx">
178   - <view class="flex xc-middle">
  180 + <swiper-item wx:for="{{qy_list}}" wx:for-item="aitem" wx:for-index="pidx">
  181 + <view class="flex xc-middle">
179 182  
180   - <view class="xc-center-frame t-c" wx:for="{{aitem}}" data-img="{{item.PrivilegeImageUrl}}" data-no="{{item.PrivilegeType}}" data-ind="{{index}}" data-find="{{pidx}}" bindtap="go_qy_url">
181   - <!-- <text>qy_list.privilegeICOUrl</text> -->
182   - <image class="xc-center-img {{item.ishas==1?'':'img_gray'}}" src="{{item.PrivilegeICOUrl}}"></image>
183   - <view class="four-level-word">{{item.PrivilegeName}}</view>
  183 + <view class="xc-center-frame t-c" wx:for="{{aitem}}" data-img="{{item.PrivilegeImageUrl}}" data-no="{{item.PrivilegeType}}" data-ind="{{index}}" data-find="{{pidx}}" bindtap="go_qy_url">
  184 + <!-- <text>qy_list.privilegeICOUrl</text> -->
  185 + <image class="xc-center-img {{item.ishas==1?'':'img_gray'}}" src="{{item.PrivilegeICOUrl}}"></image>
  186 + <view class="four-level-word">{{item.PrivilegeName}}</view>
  187 + </view>
184 188 </view>
185   - </view>
186   - </swiper-item>
  189 + </swiper-item>
187 190  
188   - </swiper>
  191 + </swiper>
189 192  
190   - <view bindtap="click_next">
191   - <view class="bg_right xc-right bcolor mt"></view>
  193 + <view bindtap="click_next">
  194 + <view class="bg_right xc-right bcolor mt"></view>
  195 + </view>
192 196 </view>
193   - </view>
194 197 </block>
195 198 <view wx:else style="text-align: center">
196   - 未找到数据
  199 + 未找到数据
197 200 </view>
198 201 </block>
199 202  
... ... @@ -202,87 +205,87 @@
202 205  
203 206 </view>
204 207 <!-- 生日营销 is_banner-->
205   - <block wx:if="{{is_banner}}">
206   - <view class="t-c banner-frame"bindtap="clike_banne">
  208 + <block wx:if="{{is_banner}}">
  209 + <view class="t-c banner-frame" bindtap="clike_banne">
207 210 <image class="banner-img" src="{{actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+actImg}}">
208 211 </image>
209   - </view>
210   - </block>
  212 + </view>
  213 + </block>
211 214  
212 215 <!-- 工具与服务 -->
213   - <view class="xc-tool-service" >
  216 + <view class="xc-tool-service">
214 217 <view class="xc-tool-service-title flex-vertical">
215   - <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image>
  218 + <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image>
216 219 <view class="three-level-word xc-tool-service-word">工具与服务</view>
217 220 </view>
218 221 <view class="xc-project-frame">
219 222 <!-- 跳转页面 -->
220 223 <view class="center_v" style="display: flex;flex-wrap: wrap;align-items: center;">
221   - <!-- 循环使用自定义菜单,显示和掩藏 -->
222   - <block wx:for="{{user_tool}}">
223   - <!-- 判断系统配置中有没有把菜单关闭 -->
224   - <block wx:if="{{!util.is_close(item.name,c_list)}}">
225   - <!-- 有链接地址的时候 -->
226   - <block wx:if="{{item.weappurl}}">
227   - <block wx:if="{{item.name=='PLUS会员'}}">
228   - <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto" wx:if="{{is_dengji==1}}">
229   - <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
230   - <view class="fs26">PLUS会员</view>
231   - </view>
232   - </block>
233   - <block wx:elif="{{item.name=='助力活动'}}">
234   - <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav" wx:if="{{is_assistance==1}}">
235   - <image class="xc-center-img" src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image>
236   - <view class="four-level-word">助力活动</view>
237   - </view>
238   - </block>
239   - <block wx:elif="{{item.name=='我的权益'}}">
240   - <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}">
241   - <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
242   - <view class="fs26">我的权益</view>
243   - </view>
244   - </block>
245   - <block wx:elif="{{item.name=='套盒商品'}}">
246   - <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto" wx:if="{{enableMeiye}}">
247   - <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
248   - <view class="fs26">套盒商品</view>
249   - </view>
250   - </block>
251   - <block wx:else>
252   - <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto_nav">
253   - <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
254   - <view class="fs26">{{item.name}}</view>
255   - </view>
256   - </block>
257   - </block>
258   - <!-- 没有链接地址的时候 -->
259   - <block wx:else>
260   - <block wx:if="{{item.name=='联系客服'}}">
261   - <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
262   - <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
263   - <view class="fs26">联系客服</view>
264   - </button>
265   -
266   - <view class="item t-c" bindtap="con_weixin" wx:elif="{{sys_switch.weapp_customertype==2}}">
267   - <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
268   - <view class="fs26">联系客服</view>
269   - </view>
270   -
271   - <view class="item t-c" bindtap="contactService" wx:else>
272   - <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
273   - <view class="fs26">联系客服</view>
274   - </view>
275   -
276   - </block>
277   - <block wx:elif="{{item.name=='收入卡包'}}">
278   - <view class="item t-c" bindtap="addcard" wx:if="{{add_card_data}}">
279   - <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
280   - <view class="four-level-word">收入卡包</view>
281   - </view>
282   - </block>
283   - </block>
284   - </block>
285   - </block>
  224 + <!-- 循环使用自定义菜单,显示和掩藏 -->
  225 + <block wx:for="{{user_tool}}">
  226 + <!-- 判断系统配置中有没有把菜单关闭 -->
  227 + <block wx:if="{{!util.is_close(item.name,c_list)}}">
  228 + <!-- 有链接地址的时候 -->
  229 + <block wx:if="{{item.weappurl}}">
  230 + <block wx:if="{{item.name=='PLUS会员'}}">
  231 + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto" wx:if="{{is_dengji==1}}">
  232 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  233 + <view class="fs26">PLUS会员</view>
  234 + </view>
  235 + </block>
  236 + <block wx:elif="{{item.name=='助力活动'}}">
  237 + <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav" wx:if="{{is_assistance==1}}">
  238 + <image class="xc-center-img" src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image>
  239 + <view class="four-level-word">助力活动</view>
  240 + </view>
  241 + </block>
  242 + <block wx:elif="{{item.name=='我的权益'}}">
  243 + <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}">
  244 + <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
  245 + <view class="fs26">我的权益</view>
  246 + </view>
  247 + </block>
  248 + <block wx:elif="{{item.name=='套盒商品'}}">
  249 + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto" wx:if="{{enableMeiye}}">
  250 + <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
  251 + <view class="fs26">套盒商品</view>
  252 + </view>
  253 + </block>
  254 + <block wx:else>
  255 + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto_nav">
  256 + <image class="xc-center-img" src="{{iurl+item.icoimg}}"></image>
  257 + <view class="fs26">{{item.name}}</view>
  258 + </view>
  259 + </block>
  260 + </block>
  261 + <!-- 没有链接地址的时候 -->
  262 + <block wx:else>
  263 + <block wx:if="{{item.name=='联系客服'}}">
  264 + <button class="item t-c" wx:if="{{sys_switch.weapp_customertype==1}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  265 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  266 + <view class="fs26">联系客服</view>
  267 + </button>
  268 +
  269 + <view class="item t-c" bindtap="con_weixin" wx:elif="{{sys_switch.weapp_customertype==2}}">
  270 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  271 + <view class="fs26">联系客服</view>
  272 + </view>
  273 +
  274 + <view class="item t-c" bindtap="contactService" wx:else>
  275 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  276 + <view class="fs26">联系客服</view>
  277 + </view>
  278 +
  279 + </block>
  280 + <block wx:elif="{{item.name=='收入卡包'}}">
  281 + <view class="item t-c" bindtap="addcard" wx:if="{{add_card_data}}">
  282 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  283 + <view class="four-level-word">收入卡包</view>
  284 + </view>
  285 + </block>
  286 + </block>
  287 + </block>
  288 + </block>
286 289 </view>
287 290  
288 291 </view>
... ... @@ -306,15 +309,17 @@
306 309 </view>
307 310 </view>
308 311 </view>
309   -
310   - <!-- 显示商品 -->
311   - <!-- 好物推荐 -->
312   - <goods_recommend id="goods_recommend"></goods_recommend>
313   -
314   - <!-- 技术支持 -->
315   - <view class="logo-container t-c">
316   - <view class="flex ai_c fs24 jc-center pdv30 white"><image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>提供技术支持</view>
317   - </view>
  312 +
  313 + <!-- 显示商品 -->
  314 + <!-- 好物推荐 -->
  315 + <goods_recommend id="goods_recommend"></goods_recommend>
  316 +
  317 + <!-- 技术支持 -->
  318 + <view class="logo-container t-c">
  319 + <view class="flex ai_c fs24 jc-center pdv30 white">
  320 + <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>提供技术支持
  321 + </view>
  322 + </view>
318 323 </view>
319 324  
320 325 <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"-->
... ... @@ -327,7 +332,7 @@
327 332 <view class="ctent_txt">
328 333 <view class='txt1'>{{userInfo.nickname}}
329 334 <image wx:if="{{userInfo.sex==2}}" class="arrow-right" style="width: 35rpx; height:35rpx; top: 5rpx" src="{{iurl}}/miniapp/images/user/wum.png"></image>
330   - <image wx:else class="arrow-right fu" style="width: 35rpx; height:35rpx;top:5rpx" src="{{iurl}}/miniapp/images/user/man.png"></image>
  335 + <image wx:else class="arrow-right fu" style="width: 35rpx; height:35rpx;top:5rpx" src="{{iurl}}/miniapp/images/user/man.png"></image>
331 336 </view>
332 337 <view wx:if="{{userInfo.address}}" class='txt2'>{{userInfo.address}}</view>
333 338 </view>
... ... @@ -341,4 +346,4 @@
341 346 </view>
342 347 </view>
343 348  
344 349 -<pop_txt id="pop_txt"></pop_txt>
  350 +<pop_txt id="pop_txt"></pop_txt>
345 351 \ No newline at end of file
... ...
pages/user/index/index.wxss
... ... @@ -372,6 +372,8 @@
372 372 margin-top: 30rpx;
373 373 display: inline-block;
374 374 line-height: 40rpx;
  375 + margin-left: 0 !important;
  376 + margin-right: 0 !important;
375 377 }
376 378  
377 379 .xc-project-frame .xc-project {
... ...
pages/user/my_service/beauty_deta.js
... ... @@ -51,7 +51,8 @@ Page({
51 51 modify: options.modify,
52 52 hours: hours,
53 53 projectId: options.projectId,
54   - storageId: storageId
  54 + storageId: storageId,
  55 + VipId:options.VipId,
55 56 })
56 57 if (options.url != undefined) {
57 58 th.setData({
... ...
pages/user/my_service/i_service.wxml
... ... @@ -99,4 +99,4 @@
99 99 <my_confirm id="my_confirm"></my_confirm>
100 100  
101 101 <!-- 批量预约图标 -->
102   -<view class="icon-container" bindtap="goto" data-url="/packageA/pages/my_service2/appment_main" ><text class="iconfont icon-plyy"></text></view>
103 102 \ No newline at end of file
  103 +<view class="icon-container" bindtap="goto" data-url="/packageA/pages/my_service2/appment_main" hidden><text class="iconfont icon-plyy"></text></view>
104 104 \ No newline at end of file
... ...
pages/user/my_service/tment_details.wxml
... ... @@ -101,7 +101,7 @@
101 101 <view class="yellow-b">我的服务</view>
102 102 </navigator>
103 103 <!-- 右边栏 -->
104   - <navigator wx:if="{{item.State==0}}" class="sub rb flex-center" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&number={{item.Number}}&itemId={{item.ServiceID}}&modify=1&projectId={{item.ProjectID}}">
  104 + <navigator wx:if="{{item.State==0}}" class="sub rb flex-center" url="/pages/user/my_service/beauty_deta?BeauticianID={{item.BeauticianID}}&number={{item.Number}}&itemId={{item.ServiceID}}&modify=1&projectId={{item.ProjectID}}&VipId={{item.VipID}}">
105 105 <view>更改时间</view>
106 106 </navigator>
107 107 <navigator wx:if="{{item.State==1}}" class="sub rb flex-center" url="/pages/user/my_service/tment_eval?Number={{item.Number}}&evaluate={{0}}">
... ...
pages/user/userinfo/userinfo.js
... ... @@ -49,6 +49,7 @@ Page({
49 49 fir_pick_index: 0,
50 50 sec_pick_index: 0,
51 51 is_gps: 1,
  52 + is_no_plus:1,
52 53 lon: 0,
53 54 only_pk: 0,
54 55 open_ind_store: 0, //哪里打开的门店列表的控制属性
... ... @@ -69,6 +70,10 @@ Page({
69 70 check_label: [], //我选择的兴趣标签
70 71 fir_guide_id:null, //存储会员详情接口出来的美导ID
71 72  
  73 + userInfo: {},
  74 + hasUserInfo: false,
  75 + canIUseGetUserProfile: false,
  76 +
72 77 },
73 78 //通过路径跳转到其他页面
74 79 goto: function(e) {
... ... @@ -604,6 +609,7 @@ Page({
604 609 },
605 610 //------初始化加载----------
606 611 onLoad: function(t) {
  612 + let th= this;
607 613 var user = getApp().globalData.userInfo;
608 614 if (user.card_field != '' && user.card_field != null && user.card_field != undefined && user.card_expiredate) {
609 615 var now = ut.gettimestamp();
... ... @@ -614,8 +620,70 @@ Page({
614 620 this.puls_user();
615 621 }
616 622 }
  623 + //调用接口判断商家plus有没有过期
  624 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + r.stoid + "&type=3", {}).then(res => {
  625 + if (res.data.code == 0) {
  626 + var arr = res.data.data.pageData;
  627 + if (arr.length > 0) {
  628 + var item = arr[0];
  629 + if (item.is_sy == 0) {
  630 + var now = Date.parse(new Date()); now = now / 1000;
  631 + if (item.end_time < now) {
  632 + th.setData({ is_no_plus: 0 })
  633 + }
  634 + }
  635 + }
  636 + }
  637 + })
617 638 this.initial_user();
  639 + // 获取用户昵称
  640 + if (wx.getUserProfile) {
  641 + this.setData({
  642 + canIUseGetUserProfile: true
  643 + })
  644 + }
  645 +
618 646 },
  647 +
  648 + // 获取用户头像昵称
  649 + getUserProfile(e) {
  650 + var th = this;
  651 + new Promise((resolve, reject) => {
  652 + wx.getUserProfile({
  653 + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
  654 + success: (res) => {
  655 + th.data.user.nickname = res.userInfo.nickName;
  656 + th.data.user.head_pic = res.userInfo.avatarUrl;
  657 + this.setData({
  658 + userInfo: res.userInfo,
  659 + hasUserInfo: true,
  660 + user: th.data.user,
  661 + });
  662 + resolve(res.userInfo);
  663 + },
  664 +
  665 + });
  666 + }).then((userInfo) => {
  667 + getApp().request.put("/api/weshop/users/update", {
  668 + data: {
  669 + storeId: r.stoid,
  670 + user_id: getApp().globalData.user_id,
  671 + nickname: userInfo.nickName,
  672 + head_pic: userInfo.avatarUrl
  673 +
  674 + },
  675 + success: function(su) {
  676 + if (su.data.code == 0) {
  677 + console.log("update user info OK");
  678 + }
  679 + }
  680 + });
  681 + });
  682 +
  683 +
  684 + },
  685 +
  686 +
619 687 //-----------会员是否初始化---------------------
620 688 initial_user: function() {
621 689  
... ...
pages/user/userinfo/userinfo.wxml
... ... @@ -8,15 +8,18 @@
8 8 <view class="flex-center">
9 9 <image class="Headportrait" src="{{user.head_pic}}"></image>
10 10 </view>
  11 +
11 12 <view class="flex-center vipmax">
12 13 <view>
13 14 <view>
14   - <view class="ellipsis-2 Nickname" style="font-size: 31rpx">{{user.nickname}}
  15 + <view class="ellipsis-2 Nickname" style="font-size: 31rpx">
  16 + <view style="float:left;">{{user.nickname}}</view>
  17 + <button bindtap="getUserProfile" style="margin-left:10rpx;float:left;width: 50rpx;height:50rpx;font-size:20rpx;background:rgba(217, 81, 99, 0.9);" class="flex-center fs30 confirmtext"><text class="iconfont icon-tongbu"></text></button>
15 18 </view>
16 19 </view>
17 20  
18 21 <view class="flex fs22 vip">
19   - <block wx:if="{{isBool&&gradename}}">
  22 + <block wx:if="{{isBool && gradename}}">
20 23 <navigator url="/pages/user/userqy/userqy">
21 24 <view class="flex-center AncrownMax">
22 25 <image class="Ancrown" src="{{iurl}}/miniapp/images/userqy/user_userqy_huang.png"></image>
... ... @@ -33,6 +36,8 @@
33 36 </navigator>
34 37 </block>
35 38 </view>
  39 +
  40 +
36 41 </view>
37 42 </view>
38 43 </view>
... ...
pages/user/withdrawals/withdrawals.js deleted
1   -var a = getApp(), n = a.request, e = require("../../../utils/common.js");
2   -
3   -Page({
4   - data: {
5   - url: a.globalData.setting.url,
6   - userMoney: 0,
7   - capacheUrl: ""
8   - },
9   - onLoad: function(a) {
10   - this.setData({
11   - userMoney: a.money
12   - }), this.getCapache();
13   - },
14   - submitWithdrawals: function(a) {
15   - var e = a.detail.value;
16   - if (!0 === this.checkFormData(e)) {
17   - var t = this;
18   - n.post("/api/user/withdrawals", {
19   - data: {
20   - account_bank: e.account_bank,
21   - account_name: e.account_name,
22   - bank_name: e.bank_name,
23   - money: e.money,
24   - verify_code: e.verify_code,
25   - paypwd: e.paypwd
26   - },
27   - success: function() {
28   - wx.showToast({
29   - title: "已提交申请",
30   - mask: !0,
31   - complete: function() {
32   - setTimeout(function() {
33   - wx.navigateBack();
34   - }, 1e3);
35   - }
36   - });
37   - },
38   - failStatus: function() {
39   - t.getCapache();
40   - }
41   - });
42   - }
43   - },
44   - checkFormData: function(n) {
45   - console.log(n);
46   - var e = parseFloat(n.money);
47   - return isNaN(e) ? a.showWarning("请填写合法的提现金额") : e < .01 ? a.showWarning("请填写大于等于1分的提现金额") : e > this.data.userMoney ? a.showWarning("可提现最大金额是 " + this.data.userMoney + " 元") : n.bank_name.length < 2 ? a.showWarning("请填写正确的银行名称") : isNaN(parseInt(n.account_bank)) || "" == n.account_bank ? a.showWarning("请填写正确的收款账号") : "" == n.account_name ? a.showWarning("请填写正确的开户号") : "" == n.paypwd.length ? a.showWarning("支付密码不能为空") : "" != n.verify_code || a.showWarning("请先输入验证码");
48   - },
49   - getCapache: function() {
50   - this.setData({
51   - capacheUrl: e.getCapache()
52   - });
53   - }
54   -});
55 0 \ No newline at end of file
pages/user/withdrawals/withdrawals.json deleted
1   -{
2   - "navigationBarTitleText": "申请提现"
3   -}
4 0 \ No newline at end of file
pages/user/withdrawals/withdrawals.wxml deleted
1   -<view class="panel pd-bg-fff">
2   - <form bindsubmit="submitWithdrawals">
3   - <view class="apply-item">
4   - <view class="title">提现金额 : </view>
5   - <input name="money" placeholder="可提现金额 : {{userMoney}}元" type="digit"></input>
6   - </view>
7   - <view class="apply-item">
8   - <view class="title">银行名称 : </view>
9   - <input name="bank_name" placeholder="如 : 工商银行,支付宝,微信" type="text"></input>
10   - </view>
11   - <view class="apply-item">
12   - <view class="title">收款账号 : </view>
13   - <input name="account_bank" placeholder="收款账号" type="number"></input>
14   - </view>
15   - <view class="apply-item">
16   - <view class="title">开户号 : </view>
17   - <input name="account_name" placeholder="持卡人姓名" type="text"></input>
18   - </view>
19   - <view class="apply-item">
20   - <view class="title">支付密码 : </view>
21   - <input name="paypwd" placeholder="支付密码" type="password"></input>
22   - </view>
23   - <view class="apply-item">
24   - <view class="title">验证码 : </view>
25   - <input class="v-code-text" name="verify_code" placeholder="请输入验证码" type="text"></input>
26   - <view bindtap="getCapache" class="v-code">
27   - <image class="wh100" src="{{capacheUrl}}"></image>
28   - </view>
29   - </view>
30   - <button class="apply-btn" formType="submit">提交申请</button>
31   - </form>
32   -</view>
pages/user/withdrawals/withdrawals.wxss deleted
1   -.panel {
2   - padding-bottom: 50rpx;
3   -}
4   -
5   -.apply-item {
6   - display: flex;
7   - align-items: center;
8   - font-size: 28rpx;
9   - height: 88rpx;
10   - border-bottom: 1px solid #ddd;
11   -}
12   -
13   -.title {
14   - color: #444;
15   - margin-right: 20rpx;
16   -}
17   -
18   -input {
19   - color: #777;
20   - width: 500rpx;
21   -}
22   -
23   -.v-code-text {
24   - width: 220rpx;
25   -}
26   -
27   -.v-code {
28   - width: 260rpx;
29   - height: 60rpx;
30   -}
31   -
32   -.apply-btn {
33   - margin: 60rpx auto 0;
34   - width: 580rpx;
35   - height: 88rpx;
36   - font-size: 28rpx;
37   - line-height: 88rpx;
38   - text-align: center;
39   - color: #fff;
40   - background-color: #e30000;
41   - border-radius: 8rpx;
42   -}
43 0 \ No newline at end of file
pages/user/withdrawals_list/withdrawals_list.js deleted
1   -var t = function(t) {
2   - return t && t.__esModule ? t : {
3   - default: t
4   - };
5   -}(require("../../../utils/LoadMore.js")), a = getApp(), e = new t.default(), r = require("../../../utils/util.js");
6   -
7   -Page({
8   - data: {
9   - url: a.globalData.setting.url,
10   - resourceUrl: a.globalData.setting.resourceUrl,
11   - withdrawals: null,
12   - currentPage: 1
13   - },
14   - onLoad: function() {
15   - e.init(this, "", "withdrawals"), this.requestWithdrawalsList();
16   - },
17   - requestWithdrawalsList: function() {
18   - var t = this, a = "/api/user/withdrawals_list/?p=" + t.data.currentPage;
19   - e.request(a, function(a) {
20   - t.data.currentPage++, a.data.result.forEach(function(t, a, e) {
21   - t.createTimeFommat = r.format(t.create_time, "yyyy-MM-dd");
22   - }), wx.stopPullDownRefresh();
23   - });
24   - },
25   - onReachBottom: function() {
26   - e.canloadMore() && this.requestWithdrawalsList();
27   - },
28   - onPullDownRefresh: function() {
29   - this.data.withdrawals = null, this.data.currentPage = 1, e.resetConfig(), this.requestWithdrawalsList();
30   - }
31   -});
32 0 \ No newline at end of file
pages/user/withdrawals_list/withdrawals_list.json deleted
1   -{
2   - "navigationBarTitleText": "提现申请记录"
3   -}
4 0 \ No newline at end of file
pages/user/withdrawals_list/withdrawals_list.wxml deleted
1   -<view class="container">
2   - <view class="withdrawal-box">
3   - <view class="withdrawal-item pay title">编号</view>
4   - <view class="withdrawal-item time title">申请日期</view>
5   - <view class="withdrawal-item price title">金额</view>
6   - <view class="withdrawal-item status title">状态</view>
7   - </view>
8   - <view class="withdrawal-box" wx:for="{{withdrawals}}" wx:key="{{index}}">
9   - <view class="withdrawal-item pay">{{item.id}}</view>
10   - <view class="withdrawal-item time">{{item.createTimeFommat}}</view>
11   - <view class="withdrawal-item price">{{item.money}}</view>
12   - <view class="withdrawal-item status">{{item.status==0?'申请中':''}}{{item.status==1?'申请成功':''}}{{item.status==2?'申请失败':''}}</view>
13   - </view>
14   -</view>
pages/user/withdrawals_list/withdrawals_list.wxss deleted
1   -page {
2   - background-color: white;
3   -}
4   -
5   -.withdrawal-box {
6   - font-size: 28rpx;
7   - padding: 25rpx 30rpx;
8   - border-bottom: 1rpx solid #f8f8f8;
9   -}
10   -
11   -.withdrawal-item {
12   - display: inline-block;
13   - word-break: keep-all;
14   - white-space: nowrap;
15   - overflow: hidden;
16   - text-overflow: ellipsis;
17   - color: #666666;
18   - box-sizing: border-box;
19   - text-align: center;
20   -}
21   -
22   -.withdrawal-box .pay {
23   - width: 20%;
24   -}
25   -
26   -.withdrawal-box .time {
27   - width: 27%;
28   -}
29   -
30   -.withdrawal-box .price {
31   - width: 28%;
32   -}
33   -
34   -.withdrawal-box .status {
35   - width: 25%;
36   - color: #e01222;
37   -}
38   -
39   -.withdrawal-box .title {
40   - color: #666666;
41   - font-size: 32rpx;
42   -}
43 0 \ No newline at end of file
utils/filter.wxs
... ... @@ -82,24 +82,7 @@ var filters = {
82 82 }
83 83 },
84 84  
85   -
86   - // show_default: function (value, placeholder, multiple) {
87   - // if(typeof value === 'number') {
88   - // if(isNaN(value) || value === 0) {
89   - // return placeholder || '0';
90   - // } else {
91   - // if(multiple) {
92   - // return value / multiple;
93   - // } else {
94   - // return value;
95   - // }
96   - // };
97   - // } else if(value === '' || value === undefined || value === null) {
98   - // return placeholder || '-';
99   - // } else {
100   - // return value;
101   - // }
102   - // },
  85 +
103 86 show_default: function (value, placeholder, multiple) {
104 87 if(typeof value === 'number') {
105 88 if(isNaN(value)) {
... ...