Commit ec6a62175bec92a7ff3ff1e1fd89c1fb1c472151

Authored by antploy
1 parent 91b7bfc3

预售详情

packageC/pages/presell/goodsInfo/goodsInfo.js
1 var t = require("../../../../utils/util.js"), 1 var t = require("../../../../utils/util.js"),
2 - ut = t,  
3 - e = require("../../../../utils/common.js"),  
4 - a = require("../../../../utils/wxParse/wxParse.js"),  
5 - s = getApp(),  
6 - i = s.request,  
7 - rq = i,  
8 - oo = s.globalData,  
9 - o = s.globalData.setting,  
10 - os = o; 2 + ut = t,
  3 + e = require("../../../../utils/common.js"),
  4 + a = require("../../../../utils/wxParse/wxParse.js"),
  5 + s = getApp(),
  6 + i = s.request,
  7 + rq = i,
  8 + oo = s.globalData,
  9 + o = s.globalData.setting,
  10 + os = o;
11 //评价加载更多 11 //评价加载更多
12 -var more = function(e) {  
13 - return e && e.__esModule ? e : {  
14 - default: e  
15 - };  
16 - }(require("../../../../utils/LoadMore.js")),  
17 - n = new more.default(); 12 +var more = function (e) {
  13 + return e && e.__esModule ? e : {
  14 + default: e
  15 + };
  16 +}(require("../../../../utils/LoadMore.js")),
  17 + n = new more.default();
18 var utils = require('../../../../utils/util.js'); 18 var utils = require('../../../../utils/util.js');
19 var regeneratorRuntime = require('../../../../utils/runtime.js'); 19 var regeneratorRuntime = require('../../../../utils/runtime.js');
20 20
@@ -25,13 +25,13 @@ Page({ @@ -25,13 +25,13 @@ Page({
25 color_type_one: 0, 25 color_type_one: 0,
26 color_type_two: 1, 26 color_type_two: 1,
27 27
28 - gid: "", 28 + gid: '',
29 stoid: o.stoid, 29 stoid: o.stoid,
30 url: o.url, 30 url: o.url,
31 resourceUrl: o.h5_url, //公众号那边的图片文件域名 31 resourceUrl: o.h5_url, //公众号那边的图片文件域名
32 iurl: o.imghost, 32 iurl: o.imghost,
33 defaultAvatar: o.resourceUrl + "/static/images/user68.jpg", 33 defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
34 - 34 +
35 data: null, 35 data: null,
36 content: "", //商品详情 36 content: "", //商品详情
37 comments: null, //商品评论 37 comments: null, //商品评论
@@ -80,25 +80,25 @@ Page({ @@ -80,25 +80,25 @@ Page({
80 id: 1, 80 id: 1,
81 num: 0 81 num: 0
82 }, 82 },
83 - {  
84 - name: "有图",  
85 - id: 5,  
86 - num: 0  
87 - }, 83 + {
  84 + name: "有图",
  85 + id: 5,
  86 + num: 0
  87 + },
88 88
89 - {  
90 - name: "好评",  
91 - id: 2,  
92 - num: 0  
93 - }, {  
94 - name: "中评",  
95 - id: 3,  
96 - num: 0  
97 - }, {  
98 - name: "差评",  
99 - id: 4,  
100 - num: 0  
101 - }, 89 + {
  90 + name: "好评",
  91 + id: 2,
  92 + num: 0
  93 + }, {
  94 + name: "中评",
  95 + id: 3,
  96 + num: 0
  97 + }, {
  98 + name: "差评",
  99 + id: 4,
  100 + num: 0
  101 + },
102 ], 102 ],
103 103
104 select: { 104 select: {
@@ -126,7 +126,7 @@ Page({ @@ -126,7 +126,7 @@ Page({
126 def_pickpu_list: null, //一开始5个门店list 126 def_pickpu_list: null, //一开始5个门店list
127 sec_pick_index: 0, //第二级门店选择ID 127 sec_pick_index: 0, //第二级门店选择ID
128 fir_pick_index: 0, //第一级门店选择ID 128 fir_pick_index: 0, //第一级门店选择ID
129 - all_pick_list:null,//所有的门店先记录起来 129 + all_pick_list: null,//所有的门店先记录起来
130 //同一条形码的所有商品 130 //同一条形码的所有商品
131 sku_g: null, 131 sku_g: null,
132 sku_g_pt: null, //---拼单的普通购买--- 132 sku_g_pt: null, //---拼单的普通购买---
@@ -137,7 +137,7 @@ Page({ @@ -137,7 +137,7 @@ Page({
137 brand_name: '', 137 brand_name: '',
138 nation_name: '', 138 nation_name: '',
139 139
140 - //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单 140 + //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单 8预售
141 prom_type: 0, 141 prom_type: 0,
142 prom_time_text: "", 142 prom_time_text: "",
143 prom_price: null, 143 prom_price: null,
@@ -219,7 +219,7 @@ Page({ @@ -219,7 +219,7 @@ Page({
219 new_user: 0, //新用户 219 new_user: 0, //新用户
220 220
221 def_pick_store: null, // 默认的门店 221 def_pick_store: null, // 默认的门店
222 - fir_def_store:null, //客户默认的门店的 222 + fir_def_store: null, //客户默认的门店的
223 lat: null, //维度 223 lat: null, //维度
224 lon: null, //经度 224 lon: null, //经度
225 225
@@ -229,121 +229,119 @@ Page({ @@ -229,121 +229,119 @@ Page({
229 open_ind_store: 0, //哪里打开的门店列表的控制属性 229 open_ind_store: 0, //哪里打开的门店列表的控制属性
230 default_store: {}, //创建添加默认门店地址的对象 230 default_store: {}, //创建添加默认门店地址的对象
231 231
232 - comments_no_more:0,  
233 - get_c:0, //获取评价是不是成  
234 - is_collect_load:0, //是不是处理  
235 - is_newsales_rules:0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存  
236 - sales_rules:1, //默认是线上销售 232 + comments_no_more: 0,
  233 + get_c: 0, //获取评价是不是成
  234 + is_collect_load: 0, //是不是处理
  235 + is_newsales_rules: 0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存
  236 + sales_rules: 1, //默认是线上销售
237 237
238 - wait_for_user_store:null,  
239 - prom_goods:null, //商品优惠列表  
240 - order_prom:null, //订单优惠  
241 - collocationGoods:null, //搭配购  
242 -  
243 - poster:null, //自定义海报  
244 - share_b_img:'', //自定义分享的背景  
245 -  
246 - showPoster: false,  
247 - hui_condition:null,  
248 - sto_sele_name_1:'',//分享的门店名称  
249 - fir_goods:null, 238 + wait_for_user_store: null,
  239 + prom_goods: null, //商品优惠列表
  240 + order_prom: null, //订单优惠
  241 + collocationGoods: null, //搭配购
250 242
251 - share_hidden: false, 243 + poster: null, //自定义海报
  244 + share_b_img: '', //自定义分享的背景
  245 +
  246 + showPoster: false,
  247 + hui_condition: null,
  248 + sto_sele_name_1: '',//分享的门店名称
  249 + fir_goods: null,
  250 +
  251 + share_hidden: false,
252 }, 252 },
253 253
254 //------初始化加载---------- 254 //------初始化加载----------
255 - onLoad: function(t) { 255 + onLoad: function (t) {
256 256
  257 + var ee = this,
  258 + that = ee,
  259 + th = ee,
  260 + gid =t.goods_id,
  261 + first_leader = t.first_leader,
  262 + room_id = t.room_id,
  263 + room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
  264 +
  265 + //-- 自定义海报 --
  266 + getApp().request.promiseGet("/api/weshop/goods/poster/page", {
  267 + data: { store_id: os.stoid, type: 1, is_use: 1 }
  268 + }).then(res => {
  269 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]) {
  270 +
  271 + var poster_data = res.data.data.pageData[0];
  272 + var json_str = poster_data.jsonStr;
  273 +
  274 + if (json_str) {
  275 + var json_data = JSON.parse(json_str);
  276 + if (json_data.bg_img) {
  277 +
  278 + //-- 把图片那到本地 --
  279 + wx.getImageInfo({
  280 + src: json_data.bg_img,
  281 + success: function (res) {
  282 + var path = res.path;
  283 + th.setData({ share_b_img: path })
  284 + },
  285 + fail: function (res) { }
  286 + });
  287 + }
  288 + th.setData({ poster: json_data })
257 289
  290 + }
  291 + }
  292 + })
258 293
259 - var ee = this,  
260 - that = ee,  
261 - th = ee,  
262 - gid = t.goods_id,  
263 - first_leader=t.first_leader,  
264 - room_id=t.room_id,  
265 - room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id  
266 -  
267 - //-- 自定义海报 --  
268 - getApp().request.promiseGet("/api/weshop/goods/poster/page", {  
269 - data:{store_id:os.stoid, type:1, is_use:1}  
270 - }).then(res=>{  
271 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){  
272 -  
273 - var poster_data=res.data.data.pageData[0];  
274 - var json_str=poster_data.jsonStr;  
275 -  
276 - if(json_str){  
277 - var json_data=JSON.parse(json_str);  
278 - if(json_data.bg_img){  
279 -  
280 - //-- 把图片那到本地 --  
281 - wx.getImageInfo({  
282 - src:json_data.bg_img,  
283 - success: function(res) {  
284 - var path= res.path;  
285 - th.setData({share_b_img:path})  
286 - },  
287 - fail: function(res) {}  
288 - });  
289 - }  
290 - th.setData({poster:json_data})  
291 -  
292 - }  
293 - }  
294 - })  
295 -  
296 //---获取手机地址坐标-- 294 //---获取手机地址坐标--
297 //--如果tg_id是空的话,分享回来-- 295 //--如果tg_id是空的话,分享回来--
298 if (gid == undefined || gid == null || gid == "") { 296 if (gid == undefined || gid == null || gid == "") {
299 - var gid_str = decodeURIComponent(t.scene);  
300 - gid_str=gid_str.split("_");  
301 - gid=gid_str[0];  
302 - if(gid_str.length>1){  
303 - first_leader=gid_str[1];  
304 - }  
305 - //-- 如果有room_id的获取 --  
306 - if(gid_str.length>2 && gid_str[2]){  
307 - room_id=gid_str[2];  
308 - room_user_share=1;  
309 - }  
310 - 297 + var gid_str = decodeURIComponent(t.scene);
  298 + gid_str = gid_str.split("_");
  299 + gid = gid_str[0];
  300 + if (gid_str.length > 1) {
  301 + first_leader = gid_str[1];
  302 + }
  303 + //-- 如果有room_id的获取 --
  304 + if (gid_str.length > 2 && gid_str[2]) {
  305 + room_id = gid_str[2];
  306 + room_user_share = 1;
  307 + }
  308 +
311 } 309 }
312 - ee.setData({ gid: gid});  
313 - if(first_leader){  
314 - console.log("log---".first_leader);  
315 - getApp().globalData.first_leader=first_leader; 310 + ee.setData({ gid: gid });
  311 + if (first_leader) {
  312 + console.log("log---".first_leader);
  313 + getApp().globalData.first_leader = first_leader;
316 //调用接口判断是不是会员 314 //调用接口判断是不是会员
317 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{  
318 - if(res.data.code==0){  
319 - getApp().globalData.guide_id=res.data.data.id; 315 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  316 + if (res.data.code == 0) {
  317 + getApp().globalData.guide_id = res.data.data.id;
320 } 318 }
321 }) 319 })
322 } 320 }
323 321
324 //-- 如果有房间号 -- 322 //-- 如果有房间号 --
325 - if(room_id){  
326 - getApp().globalData.room_id=room_id;  
327 - getApp().globalData.room_goods_id=gid;  
328 - //如果是会员分享过来的要记录  
329 - if(room_user_share)  
330 - getApp().globalData.room_user_share=room_user_share; 323 + if (room_id) {
  324 + getApp().globalData.room_id = room_id;
  325 + getApp().globalData.room_goods_id = gid;
  326 + //如果是会员分享过来的要记录
  327 + if (room_user_share)
  328 + getApp().globalData.room_user_share = room_user_share;
331 } 329 }
332 330
333 - var c_guide_id=t.c_guide_id;  
334 - if(c_guide_id){  
335 - th.data.c_guide_id=c_guide_id; 331 + var c_guide_id = t.c_guide_id;
  332 + if (c_guide_id) {
  333 + th.data.c_guide_id = c_guide_id;
336 } 334 }
337 -  
338 - getApp().getConfig(function(e) {  
339 - ee.setData({sto_sele_name_1:e.store_name})  
340 - }) 335 +
  336 + getApp().getConfig(function (e) {
  337 + ee.setData({ sto_sele_name_1: e.store_name })
  338 + })
341 339
342 //----获取系统参数----- 340 //----获取系统参数-----
343 - getApp().getConfig2(function(e) { 341 + getApp().getConfig2(function (e) {
344 ee.setData({ 342 ee.setData({
345 bconfig: e, 343 bconfig: e,
346 - sales_rules:e.sales_rules, 344 + sales_rules: e.sales_rules,
347 }); 345 });
348 346
349 if (e.categoryset.indexOf("," + 1 + ",") != -1) { 347 if (e.categoryset.indexOf("," + 1 + ",") != -1) {
@@ -365,9 +363,9 @@ Page({ @@ -365,9 +363,9 @@ Page({
365 var json_d = JSON.parse(e.switch_list); 363 var json_d = JSON.parse(e.switch_list);
366 ee.setData({ 364 ee.setData({
367 store_config: e, 365 store_config: e,
368 - sys_switch:json_d, 366 + sys_switch: json_d,
369 is_closecoupon: json_d.is_closecoupon, 367 is_closecoupon: json_d.is_closecoupon,
370 - is_newsales_rules:json_d.is_newsales_rules 368 + is_newsales_rules: json_d.is_newsales_rules
371 }); 369 });
372 ee.init(gid); 370 ee.init(gid);
373 //------几人评价------- 371 //------几人评价-------
@@ -378,39 +376,39 @@ Page({ @@ -378,39 +376,39 @@ Page({
378 }); 376 });
379 377
380 //计算等级价相关 378 //计算等级价相关
381 - var swithc_list=e.switch_list;  
382 - var sw_arr=JSON.parse(swithc_list); 379 + var swithc_list = e.switch_list;
  380 + var sw_arr = JSON.parse(swithc_list);
383 //---如果后台又开等级卡的开关--- 381 //---如果后台又开等级卡的开关---
384 - if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){  
385 - th.setData({rank_switch:true}); 382 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  383 + th.setData({ rank_switch: true });
386 //---回调卡的列表--- 384 //---回调卡的列表---
387 - th.getPlusCardType(function(ob){  
388 - th.setData({card_list:ob.card_list}); 385 + th.getPlusCardType(function (ob) {
  386 + th.setData({ card_list: ob.card_list });
389 var ti = setInterval(function () { 387 var ti = setInterval(function () {
390 var user = getApp().globalData.userInfo; 388 var user = getApp().globalData.userInfo;
391 if (!user) return false; 389 if (!user) return false;
392 clearInterval(ti); 390 clearInterval(ti);
393 391
394 - if(user.card_field && user['card_expiredate']){ 392 + if (user.card_field && user['card_expiredate']) {
395 var str = user['card_expiredate'].replace(/-/g, '/'); 393 var str = user['card_expiredate'].replace(/-/g, '/');
396 var end = new Date(str); 394 var end = new Date(str);
397 end = Date.parse(end) / 1000; 395 end = Date.parse(end) / 1000;
398 var now = ut.gettimestamp(); 396 var now = ut.gettimestamp();
399 //--- 判断是等级会员,且在有效期范围内 --- 397 //--- 判断是等级会员,且在有效期范围内 ---
400 - if(user.card_field && now<end){  
401 - var card_name=ob.name_map.get(user.card_field); 398 + if (user.card_field && now < end) {
  399 + var card_name = ob.name_map.get(user.card_field);
402 //if(card_name.length>6) card_name=card_name.substring(0,6); 400 //if(card_name.length>6) card_name=card_name.substring(0,6);
403 401
404 - var is_near_date=0;  
405 - if(end-now<60*60*30*24) is_near_date=1; //如果小于30天  
406 - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list,is_near_date:is_near_date}); 402 + var is_near_date = 0;
  403 + if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
  404 + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
407 } 405 }
408 } 406 }
409 }, 500) 407 }, 500)
410 }) 408 })
411 } 409 }
412 410
413 - },1); 411 + }, 1);
414 412
415 //获取用户设备信息,屏幕宽度 413 //获取用户设备信息,屏幕宽度
416 wx.getSystemInfo({ 414 wx.getSystemInfo({
@@ -420,164 +418,172 @@ Page({ @@ -420,164 +418,172 @@ Page({
420 }) 418 })
421 } 419 }
422 }); 420 });
423 - 421 +
424 //获取用户的默认门店 422 //获取用户的默认门店
425 - getApp().get_user_store(function(e) {  
426 - if(!e) {  
427 - th.data.fir_def_store={}; //赋值空对象 423 + getApp().get_user_store(function (e) {
  424 + if (!e) {
  425 + th.data.fir_def_store = {}; //赋值空对象
428 return false; 426 return false;
429 } 427 }
430 - var ee=JSON.parse(JSON.stringify(e)); 428 + var ee = JSON.parse(JSON.stringify(e));
431 //--定时器推迟一下-- 429 //--定时器推迟一下--
432 setTimeout(function () { 430 setTimeout(function () {
433 - if(th.data.fir_goods) var g_distr_type=th.data.fir_goods.distr_type; 431 + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
434 //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对-- 432 //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
435 - if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){ 433 + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
436 //th.data.fir_def_store={}; //赋值空对象 434 //th.data.fir_def_store={}; //赋值空对象
437 //return false; 435 //return false;
438 - //th.data.fir_def_store.is_no_dis=1;  
439 - ee.is_no_dis=1; 436 + //th.data.fir_def_store.is_no_dis=1;
  437 + ee.is_no_dis = 1;
440 } 438 }
441 439
442 - var appd=getApp().globalData;  
443 - var w_time = setInterval(function() { 440 + var appd = getApp().globalData;
  441 + var w_time = setInterval(function () {
444 if (that.data.is_get_local_ok == 0) return false; 442 if (that.data.is_get_local_ok == 0) return false;
445 clearInterval(w_time); 443 clearInterval(w_time);
446 var distance = null; 444 var distance = null;
447 - var e=JSON.parse(JSON.stringify(ee)); 445 + var e = JSON.parse(JSON.stringify(ee));
448 446
449 //如果有开启近距离的话,同时距离优不一样了 447 //如果有开启近距离的话,同时距离优不一样了
450 if (that.data.lat != null) { 448 if (that.data.lat != null) {
451 //如果经纬度有变化的话 449 //如果经纬度有变化的话
452 - if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){  
453 - //that.data.fir_def_store=e;  
454 - // that.setData({  
455 - // def_pick_store: e,  
456 - // sto_sele_name: e.pickup_name,  
457 - // sto_sele_id: e.pickup_id,  
458 - // sto_sele_distr: e.distr_type  
459 - // })  
460 - that.set_def_storage(e);  
461 -  
462 - }else{ 450 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
  451 + that.set_def_storage(e);
  452 +
  453 + } else {
463 //要用接口是获取距离,js的计算不准 454 //要用接口是获取距离,js的计算不准
464 - getApp().request.promiseGet("/api/weshop/pickup/list",{  
465 - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},  
466 - }).then(res=>{  
467 - if(res.data.code==0){  
468 - e=res.data.data.pageData[0];  
469 - if (e){  
470 - e.is_no_dis=ee.is_no_dis;  
471 - appd.pk_store=e;  
472 - // that.data.fir_def_store=e;  
473 - // that.setData({  
474 - // def_pick_store: e,  
475 - // sto_sele_name: e.pickup_name,  
476 - // sto_sele_id: e.pickup_id,  
477 - // sto_sele_distr: e.distr_type  
478 - // })  
479 - that.set_def_storage(e); 455 + getApp().request.promiseGet("/api/weshop/pickup/list", {
  456 + data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon },
  457 + }).then(res => {
  458 + if (res.data.code == 0) {
  459 + e = res.data.data.pageData[0];
  460 + if (e) {
  461 + e.is_no_dis = ee.is_no_dis;
  462 + appd.pk_store = e;
  463 + that.set_def_storage(e);
480 } 464 }
481 465
482 } 466 }
483 }) 467 })
484 } 468 }
485 - //e.distance = distance;  
486 - appd.lat=that.data.lat;  
487 - appd.lon=that.data.lon; 469 + appd.lat = that.data.lat;
  470 + appd.lon = that.data.lon;
488 471
489 - }else{ 472 + } else {
490 if (e) { 473 if (e) {
491 e.distance = null; 474 e.distance = null;
492 - // that.data.fir_def_store=e;  
493 - // that.setData({  
494 - // def_pick_store: e,  
495 - // sto_sele_name: e.pickup_name,  
496 - // sto_sele_id: e.pickup_id,  
497 - // sto_sele_distr: e.distr_type  
498 - // })  
499 - that.set_def_storage(e); 475 +
  476 + that.set_def_storage(e);
500 } 477 }
501 } 478 }
502 }, 500) 479 }, 500)
503 - },700)  
504 - });  
505 - 480 + }, 700)
  481 + });
  482 +
506 //更新点击量 483 //更新点击量
507 - getApp().request.put("/api/weshop/goods/updateClick",{  
508 - data:{store_id:os.stoid,goods_id:gid}  
509 - }) 484 + getApp().request.put("/api/weshop/goods/updateClick", {
  485 + data: { store_id: os.stoid, goods_id: gid }
  486 + })
510 }, 487 },
511 -  
512 - 488 +
  489 +
513 //--- 设置一下默认库存的数量 ---- 490 //--- 设置一下默认库存的数量 ----
514 - set_def_storage(ee){  
515 - var that=this,th=this;  
516 - getApp().getConfig2(function(e){  
517 - var sales_rules=e.sales_rules;  
518 - if(sales_rules==2){  
519 - getApp().waitfor2(that,"wait_for_user_store","fir_goods",function(){  
520 - var lock=0,plist=null;  
521 - var gd=that.data.fir_goods;  
522 - //先读取门店的lock,采用链式写法,少用await  
523 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
524 - data:{store_id:os.stoid,wareId:that.data.fir_goods.goods_id,storageId:ee.pickup_id,pageSize:1000}  
525 - }).then(res=>{  
526 - if(res.data.code==0 && res.data.data.total>0){  
527 - for(var i in res.data.data.pageData)  
528 - lock+=res.data.data.pageData[i].outQty  
529 - }  
530 - //---通过接口获取门店的线下库存信息--  
531 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
532 - data:{storageNos:ee.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}  
533 - })  
534 - }).then(res=>{  
535 - if(res.data.code==0 && res.data.data.total>0){  
536 - plist=res.data.data.pageData[0];  
537 - }  
538 - if(plist && plist.CanOutQty-lock>0){  
539 - ee.CanOutQty=plist.CanOutQty-lock;  
540 - }else{  
541 - ee.CanOutQty=0;  
542 - }  
543 - //--给门店赋值线下库存--  
544 - that.data.fir_def_store=ee;  
545 - that.setData({  
546 - def_pick_store: ee,  
547 - sto_sele_name: ee.pickup_name,  
548 - sto_sele_id: ee.pickup_id,  
549 - sto_sele_distr: ee.distr_type  
550 - })  
551 - })  
552 - })  
553 - }else{  
554 - that.data.fir_def_store=ee;  
555 - that.setData({  
556 - def_pick_store: ee,  
557 - sto_sele_name: ee.pickup_name,  
558 - sto_sele_id: ee.pickup_id,  
559 - sto_sele_distr: ee.distr_type  
560 - })  
561 - }  
562 - })  
563 -  
564 - },  
565 - 491 + set_def_storage(ee) {
  492 + var that = this, th = this;
  493 + getApp().getConfig2(function (e) {
  494 + var sales_rules = e.sales_rules;
  495 + if (sales_rules == 2) {
  496 + getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () {
  497 + var lock = 0, plist = null;
  498 + var gd = that.data.fir_goods;
  499 + //先读取门店的lock,采用链式写法,少用await
  500 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  501 + data: { store_id: os.stoid, wareId: that.data.fir_goods.goods_id, storageId: ee.pickup_id, pageSize: 1000 }
  502 + }).then(res => {
  503 + if (res.data.code == 0 && res.data.data.total > 0) {
  504 + for (var i in res.data.data.pageData)
  505 + lock += res.data.data.pageData[i].outQty
  506 + }
  507 + //---通过接口获取门店的线下库存信息--
  508 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  509 + data: { storageNos: ee.pickup_no, wareIds: encodeURIComponent(th.data.data.erpwareid), storeId: os.stoid }
  510 + })
  511 + }).then(res => {
  512 + if (res.data.code == 0 && res.data.data.total > 0) {
  513 + plist = res.data.data.pageData[0];
  514 + }
  515 + if (plist && plist.CanOutQty - lock > 0) {
  516 + ee.CanOutQty = plist.CanOutQty - lock;
  517 + } else {
  518 + ee.CanOutQty = 0;
  519 + }
  520 + //--给门店赋值线下库存--
  521 + that.data.fir_def_store = ee;
  522 + that.setData({
  523 + def_pick_store: ee,
  524 + sto_sele_name: ee.pickup_name,
  525 + sto_sele_id: ee.pickup_id,
  526 + sto_sele_distr: ee.distr_type
  527 + })
  528 + })
  529 + })
  530 + } else {
  531 + that.data.fir_def_store = ee;
  532 + that.setData({
  533 + def_pick_store: ee,
  534 + sto_sele_name: ee.pickup_name,
  535 + sto_sele_id: ee.pickup_id,
  536 + sto_sele_distr: ee.distr_type
  537 + })
  538 + }
  539 + })
  540 +
  541 + },
  542 +
566 543
567 //------------程序初始化入口------------- 544 //------------程序初始化入口-------------
568 async init(gid) { 545 async init(gid) {
569 var ee = this, 546 var ee = this,
570 - th = ee,  
571 - gallery = null,  
572 - is_collect = 0,  
573 - collect_id = 0,  
574 - categories3 = ee.data.categories3,  
575 - fir_com = null,  
576 - fir_quan = null,  
577 - mapurl = null,  
578 - mapurl_f_img = null;  
579 -  
580 - 547 + th = ee,
  548 + gallery = null,
  549 + is_collect = 0,
  550 + collect_id = 0,
  551 + categories3 = ee.data.categories3,
  552 + fir_com = null,
  553 + fir_quan = null,
  554 + mapurl = null,
  555 + mapurl_f_img = null;
  556 + //------获取预售从表----------
  557 + await getApp().request.get("/api/weshop/marketing/marketingPresellList/page", {
  558 + data: {
  559 + is_end: 0,
  560 + store_id: os.stoid,
  561 + timetype: 1,
  562 + goods_id: gid
  563 + },
  564 + success: function (res) {
  565 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
  566 + var arr = res.data.data.pageData[0];
  567 + let presell_id=arr.presell_id;
  568 + th.setData({
  569 + presellList: arr,
  570 + })
  571 + //------获取预售主表----------
  572 + getApp().request.get(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {
  573 + success: function (res) {
  574 + console.log(res);
  575 + if (res.data.code == 0 && res.data.data) {
  576 + th.setData({
  577 + presellForm: res.data.data,
  578 + });
  579 + th.countDown(res.data.data.end_time)
  580 + }
  581 + }
  582 + })
  583 + }
  584 + }
  585 + });
  586 + this.get_sto();
581 //------图片滚动---------- 587 //------图片滚动----------
582 await getApp().request.promiseGet("/api/weshop/goodsimages/page", { 588 await getApp().request.promiseGet("/api/weshop/goodsimages/page", {
583 data: { 589 data: {
@@ -628,6 +634,7 @@ Page({ @@ -628,6 +634,7 @@ Page({
628 //failRollback: !0, 634 //failRollback: !0,
629 635
630 }).then(res => { 636 }).then(res => {
  637 + console.log(res);
631 var t = res; 638 var t = res;
632 var g = t.data.data[0]; 639 var g = t.data.data[0];
633 if (g != null && g != undefined) { 640 if (g != null && g != undefined) {
@@ -654,10 +661,11 @@ Page({ @@ -654,10 +661,11 @@ Page({
654 goods_id: gid, 661 goods_id: gid,
655 pageSize: 3, 662 pageSize: 3,
656 parent_id: 0, 663 parent_id: 0,
657 - page:1,  
658 - is_show:1, 664 + page: 1,
  665 + is_show: 1,
659 }, 666 },
660 }).then(res => { 667 }).then(res => {
  668 + console.log(res);
661 fir_com = res.data.data.pageData; 669 fir_com = res.data.data.pageData;
662 }) 670 })
663 671
@@ -677,7 +685,7 @@ Page({ @@ -677,7 +685,7 @@ Page({
677 type: 1, 685 type: 1,
678 pageSize: 3, 686 pageSize: 3,
679 page: 1, 687 page: 1,
680 - is_share:0, 688 + is_share: 0,
681 }, 689 },
682 }).then(res1 => { 690 }).then(res1 => {
683 fir_quan = res1.data.data.pageData; 691 fir_quan = res1.data.data.pageData;
@@ -708,21 +716,21 @@ Page({ @@ -708,21 +716,21 @@ Page({
708 }, 716 },
709 717
710 //---展示--- 718 //---展示---
711 - onShow: function() {  
712 - console.log('djfijsaoifjoisadjfoij');  
713 - var goods_list = null,th = this,that=this;  
714 - var show_prew_img= this.data.show_prew_img  
715 - if(show_prew_img){  
716 - show_prew_img=0; 719 + onShow: function () {
  720 + console.log('djfijsaoifjoisadjfoij');
  721 + var goods_list = null, th = this, that = this;
  722 + var show_prew_img = this.data.show_prew_img
  723 + if (show_prew_img) {
  724 + show_prew_img = 0;
717 return false; 725 return false;
718 } 726 }
719 727
720 //优惠券要实时更新 728 //优惠券要实时更新
721 - getApp().getConfig2(function(e) { 729 + getApp().getConfig2(function (e) {
722 var json_d = JSON.parse(e.switch_list); 730 var json_d = JSON.parse(e.switch_list);
723 - th.setData({is_closecoupon: json_d.is_closecoupon})  
724 - th.setData({is_open_offline: json_d.is_pricing_open})  
725 - },1) 731 + th.setData({ is_closecoupon: json_d.is_closecoupon })
  732 + th.setData({ is_open_offline: json_d.is_pricing_open })
  733 + }, 1)
726 734
727 735
728 var ui = setInterval(function () { 736 var ui = setInterval(function () {
@@ -736,20 +744,20 @@ Page({ @@ -736,20 +744,20 @@ Page({
736 744
737 this.data.is_timer = 1; 745 this.data.is_timer = 1;
738 var ee = this, 746 var ee = this,
739 - gid = this.data.gid,  
740 - i = getApp().request; 747 + gid = this.data.gid,
  748 + i = getApp().request;
741 749
742 this.wait_for_store_config(); 750 this.wait_for_store_config();
743 -  
744 i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { 751 i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
745 failRollback: !0, 752 failRollback: !0,
746 - success: function(t) { 753 + success: function (t) {
  754 + console.log(t);
747 if (t.data.code == 0) { 755 if (t.data.code == 0) {
748 if (t.data.data.is_on_sale != 1) { 756 if (t.data.data.is_on_sale != 1) {
749 wx.showModal({ 757 wx.showModal({
750 title: '商品已经下架', 758 title: '商品已经下架',
751 showCancel: !1, 759 showCancel: !1,
752 - complete: function() { 760 + complete: function () {
753 wx.navigateBack(); 761 wx.navigateBack();
754 } 762 }
755 }); 763 });
@@ -761,7 +769,7 @@ Page({ @@ -761,7 +769,7 @@ Page({
761 wx.showModal({ 769 wx.showModal({
762 title: '商品还未上架', 770 title: '商品还未上架',
763 showCancel: !1, 771 showCancel: !1,
764 - complete: function() { 772 + complete: function () {
765 wx.navigateBack(); 773 wx.navigateBack();
766 } 774 }
767 }); 775 });
@@ -772,7 +780,7 @@ Page({ @@ -772,7 +780,7 @@ Page({
772 wx.showModal({ 780 wx.showModal({
773 title: '商品已经到期下架', 781 title: '商品已经到期下架',
774 showCancel: !1, 782 showCancel: !1,
775 - complete: function() { 783 + complete: function () {
776 wx.navigateBack(); 784 wx.navigateBack();
777 } 785 }
778 }); 786 });
@@ -780,46 +788,46 @@ Page({ @@ -780,46 +788,46 @@ Page({
780 } 788 }
781 //动态获取商品名称 789 //动态获取商品名称
782 wx.setNavigationBarTitle({ 790 wx.setNavigationBarTitle({
783 - title: t.data.data.goods_name, 791 + title: t.data.data.goods_name,
784 }); 792 });
785 793
786 //-- 判断是不是组合购活动,必须要登录后才能判断 -- 794 //-- 判断是不是组合购活动,必须要登录后才能判断 --
787 - if(getApp().globalData.userInfo && t.data.data.prom_type==7 ){  
788 - //获取活动信息  
789 - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +  
790 - t.data.data.prom_id+"/"+getApp().globalData.userInfo.user_id;  
791 - getApp().request.get(url, {  
792 - success:function (e) {  
793 - if (e.data.code == 0 && e.data.data) {  
794 - if(ut.gettimestamp()<e.data.data.start_time){  
795 - return false;  
796 - }  
797 - if (e.data.data.is_end == 0 && ut.gettimestamp()<e.data.data.end_time ) {  
798 - //-- 获取商品列表 --  
799 - th.setData({zh_act:e.data.data });  
800 - }  
801 -  
802 - } 795 + if (getApp().globalData.userInfo && t.data.data.prom_type == 7) {
  796 + //获取活动信息
  797 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" +
  798 + t.data.data.prom_id + "/" + getApp().globalData.userInfo.user_id;
  799 + getApp().request.get(url, {
  800 + success: function (e) {
  801 + if (e.data.code == 0 && e.data.data) {
  802 + if (ut.gettimestamp() < e.data.data.start_time) {
  803 + return false;
803 } 804 }
804 - }); 805 + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) {
  806 + //-- 获取商品列表 --
  807 + th.setData({ zh_act: e.data.data });
  808 + }
  809 +
  810 + }
  811 + }
  812 + });
805 } 813 }
806 814
807 - //-- 把商品的赋值 --  
808 - ee.data.fir_goods=JSON.parse(JSON.stringify(t.data.data)); 815 + //-- 把商品的赋值 --
  816 + ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data));
809 ee.check_is_youhui(ee.data.gid); 817 ee.check_is_youhui(ee.data.gid);
810 818
811 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); 819 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
812 -  
813 - var cur_price=t.data.data.shop_price;  
814 - if(getApp().globalData.userInfo && getApp().globalData.userInfo.card_field){  
815 - var cfile=getApp().globalData.userInfo.card_field;  
816 - if(t.data.data[cfile]){  
817 - cur_price=t.data.data[cfile];  
818 - }  
819 - }  
820 - var txt =(cur_price / t.data.data.market_price * 10).toFixed(2).toString();  
821 - txt=parseFloat(txt);  
822 - 820 +
  821 + var cur_price = t.data.data.shop_price;
  822 + if (getApp().globalData.userInfo && getApp().globalData.userInfo.card_field) {
  823 + var cfile = getApp().globalData.userInfo.card_field;
  824 + if (t.data.data[cfile]) {
  825 + cur_price = t.data.data[cfile];
  826 + }
  827 + }
  828 + var txt = (cur_price / t.data.data.market_price * 10).toFixed(2).toString();
  829 + txt = parseFloat(txt);
  830 +
823 t.data.data['disc'] = txt; 831 t.data.data['disc'] = txt;
824 832
825 if (t.data.data.original_img.indexOf(o.imghost) == -1) 833 if (t.data.data.original_img.indexOf(o.imghost) == -1)
@@ -828,55 +836,24 @@ Page({ @@ -828,55 +836,24 @@ Page({
828 if (t.data.data.goods_content == null) t.data.data.goods_content = ""; 836 if (t.data.data.goods_content == null) t.data.data.goods_content = "";
829 837
830 //-----商品详情--- 838 //-----商品详情---
831 - if(!t.data.data.goods_content) t.data.data.goods_content=" "; 839 + if (!t.data.data.goods_content) t.data.data.goods_content = " ";
832 a.wxParse("content", "html", t.data.data.goods_content, ee, 6); 840 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
833 e.wxParseAddFullImageUrl(ee, "content"); 841 e.wxParseAddFullImageUrl(ee, "content");
834 842
835 ee.setData({ 843 ee.setData({
836 data: t.data.data, 844 data: t.data.data,
837 sele_g: t.data.data, 845 sele_g: t.data.data,
838 - userInfo:getApp().globalData.userInfo 846 + userInfo: getApp().globalData.userInfo
839 }); 847 });
840 848
841 849
842 //获取统一条形码,普通商品和优惠促销的商品 850 //获取统一条形码,普通商品和优惠促销的商品
843 - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7){ 851 + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) {
844 //默认门店要拿下门店库存 852 //默认门店要拿下门店库存
845 - if(that.data.sales_rules==2 && that.data.is_newsales_rules){ 853 + if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
846 //获取门店 854 //获取门店
847 ee.get_sto(); 855 ee.get_sto();
848 - //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存  
849 - /*---  
850 - getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){  
851 - if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){  
852 - var lock=0,plist=null;  
853 - //先读取门店的lock,采用链式写法,少用await  
854 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
855 - data:{store_id:os.stoid,wareId:ee.data.data.goods_id,storageId:that.data.fir_def_store.pickup_id,pageSize:1000}  
856 - }).then(res=>{  
857 - if(res.data.code==0 && res.data.data.total>0){  
858 - for(var i in res.data.data.pageData)  
859 - lock+=res.data.data.pageData[i].outQty  
860 - }  
861 - //---通过接口获取门店的线下库存信息--  
862 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
863 - data:{storageNos:that.data.fir_def_store.pickup_no,wareIds:encodeURIComponent(th.data.data.erpwareid),storeId:os.stoid}  
864 - })  
865 - }).then(res=>{  
866 - if(res.data.code==0 && res.data.data.total>0){  
867 - plist=res.data.data.pageData[0];  
868 - }  
869 - if(plist && plist.CanOutQty-lock>0){  
870 - that.data.fir_def_store.CanOutQty=plist.CanOutQty-lock;  
871 - }else{  
872 - that.data.fir_def_store.CanOutQty=0;  
873 - }  
874 - //--给门店赋值线下库存--  
875 - th.setData({def_pick_store:that.data.fir_def_store});  
876 - })  
877 - }  
878 - })--*/  
879 - }else{ 856 + } else {
880 //获取门店 857 //获取门店
881 ee.get_sto(); 858 ee.get_sto();
882 } 859 }
@@ -886,8 +863,8 @@ Page({ @@ -886,8 +863,8 @@ Page({
886 else { 863 else {
887 var gg = "", item = t.data.data; 864 var gg = "", item = t.data.data;
888 865
889 - if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";  
890 - if(item.goods_color=="null" || item.goods_color==null) item.goods_color=""; 866 + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  867 + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
891 868
892 if (item.goods_spec != "" && item.goods_color != "") { 869 if (item.goods_spec != "" && item.goods_color != "") {
893 gg = item.goods_spec + "/" + item.goods_color; 870 gg = item.goods_spec + "/" + item.goods_color;
@@ -910,7 +887,7 @@ Page({ @@ -910,7 +887,7 @@ Page({
910 if (ee.data.cat_name == '') { 887 if (ee.data.cat_name == '') {
911 //过去国别,分类,品牌的名称 888 //过去国别,分类,品牌的名称
912 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { 889 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
913 - success: function(t) { 890 + success: function (t) {
914 var dd = t.data.data; 891 var dd = t.data.data;
915 if (t.data.code == 0) { 892 if (t.data.code == 0) {
916 th.setData({ 893 th.setData({
@@ -921,7 +898,7 @@ Page({ @@ -921,7 +898,7 @@ Page({
921 }); 898 });
922 //过去国别,分类,品牌的名称 899 //过去国别,分类,品牌的名称
923 i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, { 900 i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {
924 - success: function(t) { 901 + success: function (t) {
925 var dd = t.data.data; 902 var dd = t.data.data;
926 if (t.data.code == 0) { 903 if (t.data.code == 0) {
927 th.setData({ 904 th.setData({
@@ -932,7 +909,7 @@ Page({ @@ -932,7 +909,7 @@ Page({
932 }); 909 });
933 //过去国别,分类,品牌的名称 910 //过去国别,分类,品牌的名称
934 i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, { 911 i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {
935 - success: function(t) { 912 + success: function (t) {
936 var dd = t.data.data; 913 var dd = t.data.data;
937 if (t.data.code == 0) { 914 if (t.data.code == 0) {
938 th.setData({ 915 th.setData({
@@ -944,77 +921,77 @@ Page({ @@ -944,77 +921,77 @@ Page({
944 } 921 }
945 922
946 } 923 }
947 - else{  
948 - wx.showModal({  
949 - title: t.data.msg,  
950 - showCancel: !1,  
951 - complete: function() {  
952 - wx.navigateBack();  
953 - }  
954 - });  
955 - }  
956 - } 924 + else {
  925 + wx.showModal({
  926 + title: t.data.msg,
  927 + showCancel: !1,
  928 + complete: function () {
  929 + wx.navigateBack();
  930 + }
  931 + });
  932 + }
  933 + }
957 }); 934 });
958 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 935 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
959 936
960 }, 937 },
961 - enterAddress: function() { 938 + enterAddress: function () {
962 this.data.enterAddressPage = !0, wx.navigateTo({ 939 this.data.enterAddressPage = !0, wx.navigateTo({
963 url: "/pages/user/address_list/address_list?operate=selectAddress" 940 url: "/pages/user/address_list/address_list?operate=selectAddress"
964 }); 941 });
965 }, 942 },
966 - onUnload: function() {  
967 - for(var i = 1; i < 100; i++) {  
968 - clearInterval(i);  
969 - } 943 + onUnload: function () {
  944 + for (var i = 1; i < 100; i++) {
  945 + clearInterval(i);
  946 + }
970 }, 947 },
971 - onHide: function() { 948 + onHide: function () {
972 this.data.is_timer = 0; 949 this.data.is_timer = 0;
973 - for(var i = 1; i < 100; i++) { 950 + for (var i = 1; i < 100; i++) {
974 clearInterval(i); 951 clearInterval(i);
975 } 952 }
976 }, 953 },
977 //----------三个选项按钮----------- 954 //----------三个选项按钮-----------
978 - tabClick: function(t) { 955 + tabClick: function (t) {
979 var e = t.currentTarget.id; 956 var e = t.currentTarget.id;
980 this.setData({ 957 this.setData({
981 activeCategoryId: e 958 activeCategoryId: e
982 }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); 959 }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment();
983 }, 960 },
984 - tabClick2: function(t) { 961 + tabClick2: function (t) {
985 this.setData({ 962 this.setData({
986 activeCategoryId2: t.currentTarget.id 963 activeCategoryId2: t.currentTarget.id
987 }); 964 });
988 }, 965 },
989 966
990 - tabClick3: function(t) { 967 + tabClick3: function (t) {
991 var e = this; 968 var e = this;
992 if (t.currentTarget.id != this.data.activeCategoryId3) { 969 if (t.currentTarget.id != this.data.activeCategoryId3) {
993 e.data.c_curr_p = 1; 970 e.data.c_curr_p = 1;
994 this.setData({ 971 this.setData({
995 activeCategoryId3: t.currentTarget.id, 972 activeCategoryId3: t.currentTarget.id,
996 - comments: null,comments_no_more:0,get_c:0, 973 + comments: null, comments_no_more: 0, get_c: 0,
997 }); 974 });
998 this.requestComments_new(); 975 this.requestComments_new();
999 } 976 }
1000 }, 977 },
1001 978
1002 - doScrollTop: function() { 979 + doScrollTop: function () {
1003 wx.pageScrollTo({ 980 wx.pageScrollTo({
1004 scrollTop: 0 981 scrollTop: 0
1005 }); 982 });
1006 }, 983 },
1007 984
1008 - tabComment: function() { 985 + tabComment: function () {
1009 this.setData({ 986 this.setData({
1010 - activeCategoryId: 2,comments_no_more:0,get_c:0 987 + activeCategoryId: 2, comments_no_more: 0, get_c: 0
1011 }), this.data.comments || this.requestComments_new(); 988 }), this.data.comments || this.requestComments_new();
1012 }, 989 },
1013 990
1014 //商品详情的时候调用 991 //商品详情的时候调用
1015 - tabGoodsContent: function() { 992 + tabGoodsContent: function () {
1016 var th = this, 993 var th = this,
1017 - i = getApp().request; 994 + i = getApp().request;
1018 this.setData({ 995 this.setData({
1019 activeCategoryId: 1 996 activeCategoryId: 1
1020 }); 997 });
@@ -1022,7 +999,7 @@ Page({ @@ -1022,7 +999,7 @@ Page({
1022 if (th.data.cat_name == '') { 999 if (th.data.cat_name == '') {
1023 //过去国别,分类,品牌的名称 1000 //过去国别,分类,品牌的名称
1024 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { 1001 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
1025 - success: function(t) { 1002 + success: function (t) {
1026 var dd = t.data.data; 1003 var dd = t.data.data;
1027 if (t.data.code == 0) { 1004 if (t.data.code == 0) {
1028 th.setData({ 1005 th.setData({
@@ -1033,7 +1010,7 @@ Page({ @@ -1033,7 +1010,7 @@ Page({
1033 }); 1010 });
1034 //过去国别,分类,品牌的名称 1011 //过去国别,分类,品牌的名称
1035 i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, { 1012 i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, {
1036 - success: function(t) { 1013 + success: function (t) {
1037 var dd = t.data.data; 1014 var dd = t.data.data;
1038 if (t.data.code == 0) { 1015 if (t.data.code == 0) {
1039 th.setData({ 1016 th.setData({
@@ -1044,7 +1021,7 @@ Page({ @@ -1044,7 +1021,7 @@ Page({
1044 }); 1021 });
1045 //过去国别,分类,品牌的名称 1022 //过去国别,分类,品牌的名称
1046 i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, { 1023 i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, {
1047 - success: function(t) { 1024 + success: function (t) {
1048 var dd = t.data.data; 1025 var dd = t.data.data;
1049 if (t.data.code == 0) { 1026 if (t.data.code == 0) {
1050 th.setData({ 1027 th.setData({
@@ -1059,8 +1036,8 @@ Page({ @@ -1059,8 +1036,8 @@ Page({
1059 //获取redis中的数量 1036 //获取redis中的数量
1060 async getactLen(func) { 1037 async getactLen(func) {
1061 var r_num = 0, 1038 var r_num = 0,
1062 - prom_type = this.data.prom_type,  
1063 - prom_id = this.data.prom_id; 1039 + prom_type = this.data.prom_type,
  1040 + prom_id = this.data.prom_id;
1064 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { 1041 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
1065 1: 1 1042 1: 1
1066 }).then(res => { 1043 }).then(res => {
@@ -1073,16 +1050,16 @@ Page({ @@ -1073,16 +1050,16 @@ Page({
1073 }, 1050 },
1074 1051
1075 //------------加入购物车-------------- 1052 //------------加入购物车--------------
1076 - addCart: function(t) { 1053 + addCart: function (t) {
1077 var th = this; 1054 var th = this;
1078 var ind = t.currentTarget.dataset.openSpecModal_ind; 1055 var ind = t.currentTarget.dataset.openSpecModal_ind;
1079 - if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; 1056 + if (!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
1080 th.setData({ 1057 th.setData({
1081 open_ind_store: ind 1058 open_ind_store: ind
1082 }); 1059 });
1083 //如果是秒杀的话,要看redis够不够 1060 //如果是秒杀的话,要看redis够不够
1084 if (this.data.prom_type == 1) { 1061 if (this.data.prom_type == 1) {
1085 - this.getactLen(function(num) { 1062 + this.getactLen(function (num) {
1086 if (num < th.data.goodsInputNum) { 1063 if (num < th.data.goodsInputNum) {
1087 getApp().my_warnning("秒杀库存不足!", 0, th); 1064 getApp().my_warnning("秒杀库存不足!", 0, th);
1088 return false; 1065 return false;
@@ -1094,27 +1071,27 @@ Page({ @@ -1094,27 +1071,27 @@ Page({
1094 th.add_cart_func(t); 1071 th.add_cart_func(t);
1095 } 1072 }
1096 }, 1073 },
1097 -  
1098 -  
1099 - 1074 +
  1075 +
  1076 +
1100 //-- 加入购物的函数 -- 1077 //-- 加入购物的函数 --
1101 - add_cart_func_inte: function(t) { 1078 + add_cart_func_inte: function (t) {
1102 var i = getApp().request; 1079 var i = getApp().request;
1103 if (oo.user_id == null) { 1080 if (oo.user_id == null) {
1104 return s.my_warnning("还未登录!", 0, this); 1081 return s.my_warnning("还未登录!", 0, this);
1105 } 1082 }
1106 - if(!getApp().globalData.userInfo){  
1107 - return s.my_warnning("还未登录!", 0, this);  
1108 - }  
1109 - 1083 + if (!getApp().globalData.userInfo) {
  1084 + return s.my_warnning("还未登录!", 0, this);
  1085 + }
  1086 +
1110 var e = this, 1087 var e = this,
1111 - th = e,  
1112 - a = 0,  
1113 - o = this.data.data; 1088 + th = e,
  1089 + a = 0,
  1090 + o = this.data.data;
1114 a = o.goods_id; 1091 a = o.goods_id;
1115 - 1092 +
1116 //----------添加到购物车时,要判断限购数量,-------- 1093 //----------添加到购物车时,要判断限购数量,--------
1117 - e.get_buy_num(o, function(ee) { 1094 + e.get_buy_num(o, function (ee) {
1118 //---判断商品是否超出限购--- 1095 //---判断商品是否超出限购---
1119 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 1096 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1120 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { 1097 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
@@ -1135,14 +1112,14 @@ Page({ @@ -1135,14 +1112,14 @@ Page({
1135 return false; 1112 return false;
1136 } 1113 }
1137 } 1114 }
1138 - 1115 +
1139 if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); 1116 if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
1140 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) 1117 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
1141 this.setData({ 1118 this.setData({
1142 sto_sele_name: "" 1119 sto_sele_name: ""
1143 }); 1120 });
1144 if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); 1121 if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
1145 - 1122 +
1146 //--------------此时操作的数据------------ 1123 //--------------此时操作的数据------------
1147 var newd = { 1124 var newd = {
1148 goods_id: o.goods_id, 1125 goods_id: o.goods_id,
@@ -1151,72 +1128,72 @@ Page({ @@ -1151,72 +1128,72 @@ Page({
1151 user_id: oo.user_id, 1128 user_id: oo.user_id,
1152 store_id: th.data.stoid, 1129 store_id: th.data.stoid,
1153 goods_price: th.data.prom_price, 1130 goods_price: th.data.prom_price,
1154 - integral:th.data.prom_integral, 1131 + integral: th.data.prom_integral,
1155 member_goods_price: o.shop_price, 1132 member_goods_price: o.shop_price,
1156 goods_name: o.goods_name, 1133 goods_name: o.goods_name,
1157 goods_sn: o.goods_sn, 1134 goods_sn: o.goods_sn,
1158 sku: o.sku, 1135 sku: o.sku,
1159 - };  
1160 - 1136 + };
  1137 +
1161 //---是不是从收藏夹出来的--- 1138 //---是不是从收藏夹出来的---
1162 - if(th.data.c_guide_id){ 1139 + if (th.data.c_guide_id) {
1163 newd['guide_id'] = th.data.c_guide_id; 1140 newd['guide_id'] = th.data.c_guide_id;
1164 - newd['guide_type']=2;  
1165 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1166 - }else{  
1167 - if(getApp().globalData.guide_id){ 1141 + newd['guide_type'] = 2;
  1142 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3;
  1143 + } else {
  1144 + if (getApp().globalData.guide_id) {
1168 newd['guide_id'] = getApp().globalData.guide_id; 1145 newd['guide_id'] = getApp().globalData.guide_id;
1169 - newd['guide_type']=0;  
1170 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1; 1146 + newd['guide_type'] = 0;
  1147 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1171 } 1148 }
1172 } 1149 }
1173 - 1150 +
1174 //让商品带上房间号 1151 //让商品带上房间号
1175 //让商品带上房间号 1152 //让商品带上房间号
1176 - if(th.data.sys_switch.is_skuroom_id==1){  
1177 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1178 - newd.room_id=getApp().globalData.room_id; 1153 + if (th.data.sys_switch.is_skuroom_id == 1) {
  1154 + if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
  1155 + newd.room_id = getApp().globalData.room_id;
1179 } 1156 }
1180 - }else{  
1181 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id; 1157 + } else {
  1158 + if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id;
1182 } 1159 }
1183 - 1160 +
1184 //如果是积分够,is_integral_normal就要有积分购普通购买字段 1161 //如果是积分够,is_integral_normal就要有积分购普通购买字段
1185 //if(o.prom_type==4){ 1162 //if(o.prom_type==4){
1186 - //newd.is_integral_normal=1; 1163 + //newd.is_integral_normal=1;
1187 //} 1164 //}
1188 -  
1189 - //-----如果是秒杀,团购,积分购,拼团-----  
1190 - newd.prom_type = th.data.prom_type;  
1191 - newd.prom_id = th.data.prom_id;  
1192 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1193 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1194 -  
1195 -  
1196 - th.add_cart_next(e,t,a,o,newd); //立即购买下一步  
1197 -  
1198 - })  
1199 - },  
1200 - 1165 +
  1166 + //-----如果是秒杀,团购,积分购,拼团-----
  1167 + newd.prom_type = th.data.prom_type;
  1168 + newd.prom_id = th.data.prom_id;
  1169 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1170 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1171 +
  1172 +
  1173 + th.add_cart_next(e, t, a, o, newd); //立即购买下一步
  1174 +
  1175 + })
  1176 + },
  1177 +
1201 //-- 加入购物的函数 -- 1178 //-- 加入购物的函数 --
1202 - add_cart_func: function(t) { 1179 + add_cart_func: function (t) {
1203 var i = getApp().request; 1180 var i = getApp().request;
1204 if (oo.user_id == null) { 1181 if (oo.user_id == null) {
1205 return s.my_warnning("还未登录!", 0, this); 1182 return s.my_warnning("还未登录!", 0, this);
1206 } 1183 }
1207 -  
1208 - if(!getApp().globalData.userInfo){  
1209 - return s.my_warnning("还未登录!", 0, this);  
1210 - }  
1211 - 1184 +
  1185 + if (!getApp().globalData.userInfo) {
  1186 + return s.my_warnning("还未登录!", 0, this);
  1187 + }
  1188 +
1212 var e = this, 1189 var e = this,
1213 - th = e,  
1214 - a = 0,  
1215 - o = this.data.sele_g; 1190 + th = e,
  1191 + a = 0,
  1192 + o = this.data.sele_g;
1216 a = o.goods_id; 1193 a = o.goods_id;
1217 1194
1218 //----------添加到购物车时,要判断限购数量,-------- 1195 //----------添加到购物车时,要判断限购数量,--------
1219 - e.get_buy_num(o, function(ee) { 1196 + e.get_buy_num(o, function (ee) {
1220 //---判断商品是否超出限购--- 1197 //---判断商品是否超出限购---
1221 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 1198 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1222 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { 1199 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
@@ -1257,193 +1234,193 @@ Page({ @@ -1257,193 +1234,193 @@ Page({
1257 goods_name: o.goods_name, 1234 goods_name: o.goods_name,
1258 goods_sn: o.goods_sn, 1235 goods_sn: o.goods_sn,
1259 sku: o.sku, 1236 sku: o.sku,
1260 - };  
1261 - 1237 + };
  1238 +
1262 //---是不是从收藏夹出来的--- 1239 //---是不是从收藏夹出来的---
1263 - if(th.data.c_guide_id){ 1240 + if (th.data.c_guide_id) {
1264 newd['guide_id'] = th.data.c_guide_id; 1241 newd['guide_id'] = th.data.c_guide_id;
1265 - newd['guide_type']=2;  
1266 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;  
1267 - }else{  
1268 - if(getApp().globalData.guide_id){ 1242 + newd['guide_type'] = 2;
  1243 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3;
  1244 + } else {
  1245 + if (getApp().globalData.guide_id) {
1269 newd['guide_id'] = getApp().globalData.guide_id; 1246 newd['guide_id'] = getApp().globalData.guide_id;
1270 - newd['guide_type']=0;  
1271 - if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1; 1247 + newd['guide_type'] = 0;
  1248 + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1;
1272 } 1249 }
1273 } 1250 }
1274 1251
1275 //让商品带上房间号 1252 //让商品带上房间号
1276 //让商品带上房间号 1253 //让商品带上房间号
1277 - if(th.data.sys_switch.is_skuroom_id==1){  
1278 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
1279 - newd.room_id=getApp().globalData.room_id; 1254 + if (th.data.sys_switch.is_skuroom_id == 1) {
  1255 + if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
  1256 + newd.room_id = getApp().globalData.room_id;
1280 } 1257 }
1281 - }else{  
1282 - if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id; 1258 + } else {
  1259 + if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id;
1283 } 1260 }
1284 1261
1285 //如果是积分够,is_integral_normal就要有积分购普通购买字段 1262 //如果是积分够,is_integral_normal就要有积分购普通购买字段
1286 - if(o.prom_type==4){  
1287 - newd.is_integral_normal=1; 1263 + if (o.prom_type == 4) {
  1264 + newd.is_integral_normal = 1;
  1265 + }
  1266 +
  1267 + //如果有线下取价
  1268 + if (o.offline_price) {
  1269 + newd.offline_price = o.offline_price;
  1270 + newd.pricing_type = o.pricing_type;
1288 } 1271 }
1289 -  
1290 - //如果有线下取价  
1291 - if(o.offline_price){  
1292 - newd.offline_price=o.offline_price;  
1293 - newd.pricing_type=o.pricing_type;  
1294 - }  
1295 - 1272 +
1296 //-----如果是秒杀,团购,积分购,拼团----- 1273 //-----如果是秒杀,团购,积分购,拼团-----
1297 if (th.data.prom_type == 1) { 1274 if (th.data.prom_type == 1) {
1298 newd.goods_price = th.data.prom_price; 1275 newd.goods_price = th.data.prom_price;
1299 newd.member_goods_price = th.data.prom_price, 1276 newd.member_goods_price = th.data.prom_price,
1300 - newd.prom_type = th.data.prom_type; 1277 + newd.prom_type = th.data.prom_type;
1301 newd.prom_id = th.data.prom_id; 1278 newd.prom_id = th.data.prom_id;
1302 1279
1303 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); 1280 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
1304 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1305 -  
1306 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步  
1307 -  
1308 - }else if(o.prom_type==7){  
1309 -  
1310 - //判断进行中的活动,是不是要判断线下库存  
1311 - th.check_zh_acting(function (ee){  
1312 - newd.prom_id = 0;  
1313 - newd.prom_type = 0;  
1314 - if(ee && th.data.sele_g.act){  
1315 - newd.prom_id = th.data.sele_g.act.id;  
1316 - newd.prom_type = 7;  
1317 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1318 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1319 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步  
1320 - return false;  
1321 - }else{  
1322 - //---如果是线下门店销售的时候---  
1323 - if(th.data.sales_rules==2){  
1324 - var pick=th.get_pick_from_list(th.data.sto_sele_id)  
1325 - //---通过接口获取门店的线下库存信息--  
1326 - getApp().request.get("/api/weshop/goods/getWareStorages",{  
1327 - data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},  
1328 - success:function(res){  
1329 - if(res.data.code==0){  
1330 - if(res.data.data.pageData.length>0){  
1331 - var CanOutQty=res.data.data.pageData[0].CanOutQty;  
1332 - if(CanOutQty<e.data.goodsInputNum){  
1333 - return s.my_warnning("库存不足!", 0, th);  
1334 - }  
1335 - //在调一次接口,读取商品的预出库的数量,lock  
1336 - getApp().request.get("/api/weshop/order/ware/lock/page",{  
1337 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},  
1338 - success:function(res_data){  
1339 - if(res_data.data.code==0 && res_data.data.data.total>0){  
1340 -  
1341 - var lock=0;  
1342 - for(var i in res_data.data.data.pageData){  
1343 - lock+=res_data.data.data.pageData[i].outQty;  
1344 - }  
1345 -  
1346 - if(CanOutQty<=lock){  
1347 - return s.my_warnning("库存不足!", 0, th);  
1348 - }  
1349 - th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);  
1350 - }else{  
1351 - th.add_cart_next(e,t,a,o,newd,CanOutQty);  
1352 - }  
1353 - }  
1354 - })  
1355 - }else{  
1356 - return s.my_warnning("库存不足!", 0, th);  
1357 - }  
1358 -  
1359 - }  
1360 - }  
1361 - })  
1362 - }else{  
1363 - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);  
1364 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1365 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步  
1366 - }  
1367 - }  
1368 - }) 1281 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1282 +
  1283 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  1284 +
  1285 + } else if (o.prom_type == 7) {
  1286 +
  1287 + //判断进行中的活动,是不是要判断线下库存
  1288 + th.check_zh_acting(function (ee) {
  1289 + newd.prom_id = 0;
  1290 + newd.prom_type = 0;
  1291 + if (ee && th.data.sele_g.act) {
  1292 + newd.prom_id = th.data.sele_g.act.id;
  1293 + newd.prom_type = 7;
  1294 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1295 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1296 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  1297 + return false;
  1298 + } else {
  1299 + //---如果是线下门店销售的时候---
  1300 + if (th.data.sales_rules == 2) {
  1301 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
  1302 + //---通过接口获取门店的线下库存信息--
  1303 + getApp().request.get("/api/weshop/goods/getWareStorages", {
  1304 + data: { storageNos: pick.pickup_no, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid },
  1305 + success: function (res) {
  1306 + if (res.data.code == 0) {
  1307 + if (res.data.data.pageData.length > 0) {
  1308 + var CanOutQty = res.data.data.pageData[0].CanOutQty;
  1309 + if (CanOutQty < e.data.goodsInputNum) {
  1310 + return s.my_warnning("库存不足!", 0, th);
  1311 + }
  1312 + //在调一次接口,读取商品的预出库的数量,lock
  1313 + getApp().request.get("/api/weshop/order/ware/lock/page", {
  1314 + data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, storageId: pick.pickup_id, pageSize: 1000 },
  1315 + success: function (res_data) {
  1316 + if (res_data.data.code == 0 && res_data.data.data.total > 0) {
  1317 +
  1318 + var lock = 0;
  1319 + for (var i in res_data.data.data.pageData) {
  1320 + lock += res_data.data.data.pageData[i].outQty;
  1321 + }
  1322 +
  1323 + if (CanOutQty <= lock) {
  1324 + return s.my_warnning("库存不足!", 0, th);
  1325 + }
  1326 + th.add_cart_next(e, t, a, o, newd, CanOutQty - lock);
  1327 + } else {
  1328 + th.add_cart_next(e, t, a, o, newd, CanOutQty);
  1329 + }
  1330 + }
  1331 + })
  1332 + } else {
  1333 + return s.my_warnning("库存不足!", 0, th);
  1334 + }
  1335 +
  1336 + }
  1337 + }
  1338 + })
  1339 + } else {
  1340 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1341 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1342 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  1343 + }
  1344 + }
  1345 + })
1369 1346
1370 } 1347 }
1371 - else if ( th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) { 1348 + else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 2 || th.data.prom_type == 4 || th.data.prom_type == 5) {
1372 newd.prom_type = 0; 1349 newd.prom_type = 0;
1373 newd.prom_id = 0; 1350 newd.prom_id = 0;
1374 1351
1375 //---如果是线下门店销售的时候--- 1352 //---如果是线下门店销售的时候---
1376 - if(th.data.sales_rules==2){  
1377 - var pick=th.get_pick_from_list(th.data.sto_sele_id) 1353 + if (th.data.sales_rules == 2) {
  1354 + var pick = th.get_pick_from_list(th.data.sto_sele_id)
1378 //---通过接口获取门店的线下库存信息-- 1355 //---通过接口获取门店的线下库存信息--
1379 - getApp().request.get("/api/weshop/goods/getWareStorages",{  
1380 - data:{storageNos:pick.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid},  
1381 - success:function(res){  
1382 - if(res.data.code==0){  
1383 - if(res.data.data.pageData.length>0){  
1384 - var CanOutQty=res.data.data.pageData[0].CanOutQty;  
1385 - if(CanOutQty<e.data.goodsInputNum){ 1356 + getApp().request.get("/api/weshop/goods/getWareStorages", {
  1357 + data: { storageNos: pick.pickup_no, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid },
  1358 + success: function (res) {
  1359 + if (res.data.code == 0) {
  1360 + if (res.data.data.pageData.length > 0) {
  1361 + var CanOutQty = res.data.data.pageData[0].CanOutQty;
  1362 + if (CanOutQty < e.data.goodsInputNum) {
1386 return s.my_warnning("库存不足!", 0, th); 1363 return s.my_warnning("库存不足!", 0, th);
1387 } 1364 }
1388 //在调一次接口,读取商品的预出库的数量,lock 1365 //在调一次接口,读取商品的预出库的数量,lock
1389 - getApp().request.get("/api/weshop/order/ware/lock/page",{  
1390 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,storageId:pick.pickup_id,pageSize:1000},  
1391 - success:function(res_data){  
1392 - if(res_data.data.code==0 && res_data.data.data.total>0){  
1393 -  
1394 - var lock=0;  
1395 - for(var i in res_data.data.data.pageData){  
1396 - lock+=res_data.data.data.pageData[i].outQty; 1366 + getApp().request.get("/api/weshop/order/ware/lock/page", {
  1367 + data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, storageId: pick.pickup_id, pageSize: 1000 },
  1368 + success: function (res_data) {
  1369 + if (res_data.data.code == 0 && res_data.data.data.total > 0) {
  1370 +
  1371 + var lock = 0;
  1372 + for (var i in res_data.data.data.pageData) {
  1373 + lock += res_data.data.data.pageData[i].outQty;
1397 } 1374 }
1398 1375
1399 - if(CanOutQty<=lock){ 1376 + if (CanOutQty <= lock) {
1400 return s.my_warnning("库存不足!", 0, th); 1377 return s.my_warnning("库存不足!", 0, th);
1401 } 1378 }
1402 - th.add_cart_next(e,t,a,o,newd,CanOutQty-lock);  
1403 - }else{  
1404 - th.add_cart_next(e,t,a,o,newd,CanOutQty); 1379 + th.add_cart_next(e, t, a, o, newd, CanOutQty - lock);
  1380 + } else {
  1381 + th.add_cart_next(e, t, a, o, newd, CanOutQty);
1405 } 1382 }
1406 } 1383 }
1407 }) 1384 })
1408 - }else{ 1385 + } else {
1409 return s.my_warnning("库存不足!", 0, th); 1386 return s.my_warnning("库存不足!", 0, th);
1410 } 1387 }
1411 1388
1412 } 1389 }
1413 } 1390 }
1414 }) 1391 })
1415 - }else{ 1392 + } else {
1416 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); 1393 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
1417 - if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);  
1418 - th.add_cart_next(e,t,a,o,newd); //加入购物车下一步 1394 + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1395 + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
1419 } 1396 }
1420 } 1397 }
1421 }) 1398 })
1422 }, 1399 },
1423 1400
1424 //---加入购物车的最后一步--- 1401 //---加入购物车的最后一步---
1425 - add_cart_next(e,t,a,o,newd,CanOutQty){  
1426 - var th=this,i=getApp().request; 1402 + add_cart_next(e, t, a, o, newd, CanOutQty) {
  1403 + var th = this, i = getApp().request;
1427 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 1404 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1428 - if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){  
1429 - var conf=th.data.bconfig;  
1430 - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']){  
1431 - var s_list=JSON.parse(conf.switch_list);  
1432 - var now=ut.gettimestamp();  
1433 - 1405 + if (o.prom_type != 1 && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) {
  1406 + var conf = th.data.bconfig;
  1407 + if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) {
  1408 + var s_list = JSON.parse(conf.switch_list);
  1409 + var now = ut.gettimestamp();
  1410 +
1434 1411
1435 var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/'); 1412 var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/');
1436 var end = new Date(str); 1413 var end = new Date(str);
1437 end = Date.parse(end) / 1000; 1414 end = Date.parse(end) / 1000;
1438 1415
1439 //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下-- 1416 //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下--
1440 - if(parseInt(s_list.rank_switch)==2 && end>now){  
1441 - var card_price=o[getApp().globalData.userInfo['card_field']]; 1417 + if (parseInt(s_list.rank_switch) == 2 && end > now) {
  1418 + var card_price = o[getApp().globalData.userInfo['card_field']];
1442 //如果会员有等级价 1419 //如果会员有等级价
1443 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
1444 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
1445 - newd.goods_price=card_price;  
1446 - newd.member_goods_price=card_price; 1420 + if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null
  1421 + && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) {
  1422 + newd.goods_price = card_price;
  1423 + newd.member_goods_price = card_price;
1447 } 1424 }
1448 } 1425 }
1449 } 1426 }
@@ -1452,7 +1429,7 @@ Page({ @@ -1452,7 +1429,7 @@ Page({
1452 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); 1429 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
1453 if ("add" == t.currentTarget.dataset.action) { 1430 if ("add" == t.currentTarget.dataset.action) {
1454 1431
1455 - if(th.data.prom_goods){ 1432 + if (th.data.prom_goods) {
1456 newd.prom_type = 3; 1433 newd.prom_type = 3;
1457 newd.prom_id = th.data.prom_goods[0].prom_id; 1434 newd.prom_id = th.data.prom_goods[0].prom_id;
1458 } 1435 }
@@ -1465,7 +1442,7 @@ Page({ @@ -1465,7 +1442,7 @@ Page({
1465 goods_id: a, 1442 goods_id: a,
1466 pick_id: e.data.sto_sele_id, 1443 pick_id: e.data.sto_sele_id,
1467 }, 1444 },
1468 - success: function(re) { 1445 + success: function (re) {
1469 1446
1470 //-------如果购物车中有相关的数据--------- 1447 //-------如果购物车中有相关的数据---------
1471 if (re.data.data.total > 0) { 1448 if (re.data.data.total > 0) {
@@ -1473,12 +1450,12 @@ Page({ @@ -1473,12 +1450,12 @@ Page({
1473 var item = re.data.data.pageData[0]; 1450 var item = re.data.data.pageData[0];
1474 1451
1475 //判断数量,要看下购物车中有没有该商品 1452 //判断数量,要看下购物车中有没有该商品
1476 - if(CanOutQty){  
1477 - if(item.goods_num+ th.data.goodsInputNum>CanOutQty){ 1453 + if (CanOutQty) {
  1454 + if (item.goods_num + th.data.goodsInputNum > CanOutQty) {
1478 return s.my_warnning("库存不足!", 0, th); 1455 return s.my_warnning("库存不足!", 0, th);
1479 } 1456 }
1480 - }else{  
1481 - if(item.goods_num+ th.data.goodsInputNum>o.store_count){ 1457 + } else {
  1458 + if (item.goods_num + th.data.goodsInputNum > o.store_count) {
1482 return s.my_warnning("库存不足!", 0, th); 1459 return s.my_warnning("库存不足!", 0, th);
1483 } 1460 }
1484 } 1461 }
@@ -1487,15 +1464,15 @@ Page({ @@ -1487,15 +1464,15 @@ Page({
1487 id: item.id, 1464 id: item.id,
1488 goods_num: e.data.goodsInputNum + item.goods_num, 1465 goods_num: e.data.goodsInputNum + item.goods_num,
1489 goods_price: newd.goods_price, 1466 goods_price: newd.goods_price,
1490 - member_goods_price:newd.goods_price, 1467 + member_goods_price: newd.goods_price,
1491 store_id: th.data.stoid, 1468 store_id: th.data.stoid,
1492 }; 1469 };
1493 1470
1494 //---是不是从收藏夹出来的--- 1471 //---是不是从收藏夹出来的---
1495 - if(th.data.c_guide_id){ 1472 + if (th.data.c_guide_id) {
1496 updata['guide_id'] = th.data.c_guide_id; 1473 updata['guide_id'] = th.data.c_guide_id;
1497 - updata['guide_type']=3; //加入购物车之后就变成了3  
1498 - }else { 1474 + updata['guide_type'] = 3; //加入购物车之后就变成了3
  1475 + } else {
1499 if (getApp().globalData.guide_id) { 1476 if (getApp().globalData.guide_id) {
1500 updata['guide_id'] = getApp().globalData.guide_id; 1477 updata['guide_id'] = getApp().globalData.guide_id;
1501 updata['guide_type'] = 0; 1478 updata['guide_type'] = 0;
@@ -1504,7 +1481,7 @@ Page({ @@ -1504,7 +1481,7 @@ Page({
1504 1481
1505 i.put("/api/weshop/cart/update", { 1482 i.put("/api/weshop/cart/update", {
1506 data: updata, 1483 data: updata,
1507 - success: function(t) { 1484 + success: function (t) {
1508 getApp().my_warnning('加入购物车成功', 1, th, 450); 1485 getApp().my_warnning('加入购物车成功', 1, th, 450);
1509 var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; 1486 var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
1510 th.setData({ 1487 th.setData({
@@ -1518,7 +1495,7 @@ Page({ @@ -1518,7 +1495,7 @@ Page({
1518 1495
1519 i.post("/api/weshop/cart/save", { 1496 i.post("/api/weshop/cart/save", {
1520 data: newd, 1497 data: newd,
1521 - success: function(t) { 1498 + success: function (t) {
1522 getApp().my_warnning('加入购物车成功', 1, th, 450); 1499 getApp().my_warnning('加入购物车成功', 1, th, 450);
1523 var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; 1500 var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;
1524 th.setData({ 1501 th.setData({
@@ -1535,20 +1512,20 @@ Page({ @@ -1535,20 +1512,20 @@ Page({
1535 //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d); 1512 //else "exchange" == t.currentTarget.dataset.action ? this.exchange(d) : this.buyNow(d);
1536 else { 1513 else {
1537 1514
1538 - if(th.data.prom_goods){  
1539 - var prom_d=th.data.prom_goods;  
1540 - for(var i in prom_d){ 1515 + if (th.data.prom_goods) {
  1516 + var prom_d = th.data.prom_goods;
  1517 + for (var i in prom_d) {
1541 //判断活动有俩种条件,0元 1件 1518 //判断活动有俩种条件,0元 1件
1542 - var condition_t=prom_d[i].prom_type;  
1543 - switch(condition_t) { 1519 + var condition_t = prom_d[i].prom_type;
  1520 + switch (condition_t) {
1544 case 0: //按钱 1521 case 0: //按钱
1545 - if(newd.goods_price>=condition_t){ 1522 + if (newd.goods_price >= condition_t) {
1546 newd.prom_type = 3; 1523 newd.prom_type = 3;
1547 newd.prom_id = prom_d[i].prom_id; 1524 newd.prom_id = prom_d[i].prom_id;
1548 } 1525 }
1549 break 1526 break
1550 case 1://按购买数量 1527 case 1://按购买数量
1551 - if(newd.goods_num>=condition_t){ 1528 + if (newd.goods_num >= condition_t) {
1552 newd.prom_type = 3; 1529 newd.prom_type = 3;
1553 newd.prom_id = prom_d[i].prom_id; 1530 newd.prom_id = prom_d[i].prom_id;
1554 } 1531 }
@@ -1566,7 +1543,7 @@ Page({ @@ -1566,7 +1543,7 @@ Page({
1566 1543
1567 1544
1568 //----------购买虚拟商品------ 1545 //----------购买虚拟商品------
1569 - buyVirtualGoods: function(e) { 1546 + buyVirtualGoods: function (e) {
1570 Object.assign(e, { 1547 Object.assign(e, {
1571 goods_name: this.data.data.goods.goods_name, 1548 goods_name: this.data.data.goods.goods_name,
1572 spec_name: this.data.select.specName, 1549 spec_name: this.data.select.specName,
@@ -1576,102 +1553,102 @@ Page({ @@ -1576,102 +1553,102 @@ Page({
1576 }); 1553 });
1577 }, 1554 },
1578 //----------积分兑换--------- 1555 //----------积分兑换---------
1579 - exchange: function(e) { 1556 + exchange: function (e) {
1580 this.data.shippingCost < 0 || this.data.select.stock <= 0 || wx.navigateTo({ 1557 this.data.shippingCost < 0 || this.data.select.stock <= 0 || wx.navigateTo({
1581 url: "/pages/cart/integral/integral?" + t.Obj2Str(e) 1558 url: "/pages/cart/integral/integral?" + t.Obj2Str(e)
1582 }); 1559 });
1583 }, 1560 },
1584 -  
1585 - 1561 +
  1562 +
1586 //----------立即购买----------- 1563 //----------立即购买-----------
1587 - buyNow: function(e) { 1564 + buyNow: function (e) {
1588 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, { 1565 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1589 // action: "buy_now" 1566 // action: "buy_now"
1590 // }), 1567 // }),
1591 this.setData({ 1568 this.setData({
1592 - openSpecModal:0,  
1593 - openSpecModal_inte:0,  
1594 - openSpecModal_inte_normal:0,  
1595 - openSpecModal_pt:0, 1569 + openSpecModal: 0,
  1570 + openSpecModal_inte: 0,
  1571 + openSpecModal_inte_normal: 0,
  1572 + openSpecModal_pt: 0,
1596 }) 1573 })
1597 -  
1598 - if(e.prom_type==4){  
1599 - s.set_b_now(e);  
1600 - var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;  
1601 - getApp().goto(url);  
1602 - }else{  
1603 - //要判断积分购的普通购买有没有参加优惠活动  
1604 - if(e.is_integral_normal==1){  
1605 - this.check_nor_promgood(e.goods_id,function(res){  
1606 - if(res && res.cat_id){  
1607 - e.prom_type=3;  
1608 - e.prom_id=res.cat_id  
1609 - }  
1610 - s.set_b_now(e);  
1611 - /*--  
1612 - wx.redirectTo({  
1613 - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,  
1614 - });--*/  
1615 - getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)  
1616 -  
1617 - })  
1618 - }else{  
1619 - s.set_b_now(e);  
1620 - /*--  
1621 - wx.redirectTo({  
1622 - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,  
1623 - });--*/  
1624 - getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)  
1625 - }  
1626 -  
1627 - } 1574 +
  1575 + if (e.prom_type == 4) {
  1576 + s.set_b_now(e);
  1577 + var url = "/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;
  1578 + getApp().goto(url);
  1579 + } else {
  1580 + //要判断积分购的普通购买有没有参加优惠活动
  1581 + if (e.is_integral_normal == 1) {
  1582 + this.check_nor_promgood(e.goods_id, function (res) {
  1583 + if (res && res.cat_id) {
  1584 + e.prom_type = 3;
  1585 + e.prom_id = res.cat_id
  1586 + }
  1587 + s.set_b_now(e);
  1588 + /*--
  1589 + wx.redirectTo({
  1590 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1591 + });--*/
  1592 + getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)
  1593 +
  1594 + })
  1595 + } else {
  1596 + s.set_b_now(e);
  1597 + /*--
  1598 + wx.redirectTo({
  1599 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1600 + });--*/
  1601 + getApp().goto("/packageC/pages/presell/cart/cart?is_bnow=1&goods_id=" + e.goods_id)
  1602 + }
  1603 +
  1604 + }
1628 }, 1605 },
1629 1606
1630 //----------增加购买数量----------- 1607 //----------增加购买数量-----------
1631 - addCartNum: function(t) { 1608 + addCartNum: function (t) {
1632 this.checkCartNum(this.data.goodsInputNum + 1); 1609 this.checkCartNum(this.data.goodsInputNum + 1);
1633 }, 1610 },
1634 //----------减少购买数量----------- 1611 //----------减少购买数量-----------
1635 - subCartNum: function(t) { 1612 + subCartNum: function (t) {
1636 this.checkCartNum(this.data.goodsInputNum - 1); 1613 this.checkCartNum(this.data.goodsInputNum - 1);
1637 }, 1614 },
1638 //----------输入框输入购买数量----------- 1615 //----------输入框输入购买数量-----------
1639 - inputCartNum: function(t) { 1616 + inputCartNum: function (t) {
1640 this.checkCartNum(Number(t.detail.value)); 1617 this.checkCartNum(Number(t.detail.value));
1641 }, 1618 },
1642 - 1619 +
1643 //----------增加购买数量----------- 1620 //----------增加购买数量-----------
1644 - addCartNum_inte: function(t) { 1621 + addCartNum_inte: function (t) {
1645 this.checkCartNum_inte(this.data.goodsInputNum + 1); 1622 this.checkCartNum_inte(this.data.goodsInputNum + 1);
1646 }, 1623 },
1647 //----------减少购买数量----------- 1624 //----------减少购买数量-----------
1648 - subCartNum_inte: function(t) { 1625 + subCartNum_inte: function (t) {
1649 this.checkCartNum_inte(this.data.goodsInputNum - 1); 1626 this.checkCartNum_inte(this.data.goodsInputNum - 1);
1650 }, 1627 },
1651 //----------输入框输入购买数量----------- 1628 //----------输入框输入购买数量-----------
1652 - inputCartNum_inte: function(t) { 1629 + inputCartNum_inte: function (t) {
1653 this.checkCartNum_inte(Number(t.detail.value)); 1630 this.checkCartNum_inte(Number(t.detail.value));
1654 }, 1631 },
1655 - 1632 +
1656 1633
1657 //------检查数量是不是超出限购------ 1634 //------检查数量是不是超出限购------
1658 - checkCartNum: function(t) { 1635 + checkCartNum: function (t) {
1659 var th = this; 1636 var th = this;
1660 - this.get_buy_num(this.data.sele_g, async function() { 1637 + this.get_buy_num(this.data.sele_g, async function () {
1661 1638
1662 //--判断商品是否超出限购-- 1639 //--判断商品是否超出限购--
1663 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 1640 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1664 1641
1665 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id); 1642 + var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
1666 1643
1667 if (t + gd_buy_num > th.data.sele_g.viplimited) { 1644 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1668 wx.showModal({ 1645 wx.showModal({
1669 title: '超出商品限购', 1646 title: '超出商品限购',
1670 }); 1647 });
1671 1648
1672 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1673 - if(num<0) num=0;  
1674 - th.setData({goodsInputNum:num}) 1649 + var num = th.data.sele_g.viplimited - gd_buy_num;
  1650 + if (num < 0) num = 0;
  1651 + th.setData({ goodsInputNum: num })
1675 return false; 1652 return false;
1676 } 1653 }
1677 } 1654 }
@@ -1683,9 +1660,9 @@ Page({ @@ -1683,9 +1660,9 @@ Page({
1683 title: '超出商品活动限购', 1660 title: '超出商品活动限购',
1684 }); 1661 });
1685 1662
1686 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1687 - if(num<0) num=0;  
1688 - th.setData({goodsInputNum:num}) 1663 + var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  1664 + if (num < 0) num = 0;
  1665 + th.setData({ goodsInputNum: num })
1689 return false; 1666 return false;
1690 } 1667 }
1691 } 1668 }
@@ -1694,7 +1671,7 @@ Page({ @@ -1694,7 +1671,7 @@ Page({
1694 var redis_num = 0; 1671 var redis_num = 0;
1695 //------判断活动是否抢光----- 1672 //------判断活动是否抢光-----
1696 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + 1673 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
1697 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, { 1674 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
1698 1: 1 1675 1: 1
1699 }).then(res => { 1676 }).then(res => {
1700 redis_num = res.data.data; 1677 redis_num = res.data.data;
@@ -1704,131 +1681,133 @@ Page({ @@ -1704,131 +1681,133 @@ Page({
1704 wx.showModal({ 1681 wx.showModal({
1705 title: '超出商品活动库存', 1682 title: '超出商品活动库存',
1706 }); 1683 });
1707 - th.setData({goodsInputNum:redis_num}) 1684 + th.setData({ goodsInputNum: redis_num })
1708 return false; 1685 return false;
1709 } 1686 }
1710 } 1687 }
1711 var e = th.data.sele_g.store_count; 1688 var e = th.data.sele_g.store_count;
1712 - var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4  
1713 - if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){  
1714 - if(!th.data.def_pick_store){ 1689 + var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4
  1690 + if (th.data.sales_rules == 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) {
  1691 + if (!th.data.def_pick_store) {
1715 wx.showModal({ title: '请选择门店', }); 1692 wx.showModal({ title: '请选择门店', });
1716 return false; 1693 return false;
1717 - }else{  
1718 - e=th.data.def_pick_store.CanOutQty; 1694 + } else {
  1695 + e = th.data.def_pick_store.CanOutQty;
1719 } 1696 }
1720 } 1697 }
1721 - if(!e) e=0; 1698 + if (!e) e = 0;
1722 //库存不足,不增加 1699 //库存不足,不增加
1723 - if(e<t){ wx.showModal({ title: '库存不足', });  
1724 - if(e<0) e=0;  
1725 - th.setData({ goodsInputNum: e }); return false; 1700 + if (e < t) {
  1701 + wx.showModal({ title: '库存不足', });
  1702 + if (e < 0) e = 0;
  1703 + th.setData({ goodsInputNum: e }); return false;
1726 } 1704 }
1727 t > e || 0 == e ? t = e : t < 1 && (t = 1); 1705 t > e || 0 == e ? t = e : t < 1 && (t = 1);
1728 th.setData({ goodsInputNum: t }); 1706 th.setData({ goodsInputNum: t });
1729 - th.is_show_more_buy(); 1707 + th.is_show_more_buy();
1730 1708
1731 }) 1709 })
1732 }, 1710 },
1733 1711
1734 //----- 检查一下积分购的限购之类的问题 ----- 1712 //----- 检查一下积分购的限购之类的问题 -----
1735 - checkCartNum_inte: function(t) { 1713 + checkCartNum_inte: function (t) {
1736 var th = this; 1714 var th = this;
1737 - this.get_buy_num(this.data.data, async function() {  
1738 - 1715 + this.get_buy_num(this.data.data, async function () {
  1716 +
1739 //--判断商品是否超出限购-- 1717 //--判断商品是否超出限购--
1740 if (th.data.g_buy_num != null && th.data.data.viplimited > 0) { 1718 if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
1741 -  
1742 - var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);  
1743 - 1719 +
  1720 + var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
  1721 +
1744 if (t + gd_buy_num > th.data.sele_g.viplimited) { 1722 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1745 wx.showModal({ 1723 wx.showModal({
1746 title: '超出商品限购', 1724 title: '超出商品限购',
1747 }); 1725 });
1748 -  
1749 - var num= th.data.sele_g.viplimited-gd_buy_num;  
1750 - if(num<0) num=0;  
1751 - th.setData({goodsInputNum:num}) 1726 +
  1727 + var num = th.data.sele_g.viplimited - gd_buy_num;
  1728 + if (num < 0) num = 0;
  1729 + th.setData({ goodsInputNum: num })
1752 return false; 1730 return false;
1753 } 1731 }
1754 } 1732 }
1755 - 1733 +
1756 //--判断商品是否超出活动限购-- 1734 //--判断商品是否超出活动限购--
1757 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { 1735 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1758 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { 1736 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1759 wx.showModal({ 1737 wx.showModal({
1760 title: '超出商品活动限购', 1738 title: '超出商品活动限购',
1761 }); 1739 });
1762 -  
1763 - var num=th.data.prom_buy_limit- th.data.prom_buy_num ;  
1764 - if(num<0) num=0;  
1765 - th.setData({goodsInputNum:num}) 1740 +
  1741 + var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  1742 + if (num < 0) num = 0;
  1743 + th.setData({ goodsInputNum: num })
1766 return false; 1744 return false;
1767 } 1745 }
1768 } 1746 }
1769 - 1747 +
1770 if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) { 1748 if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
1771 var redis_num = 0; 1749 var redis_num = 0;
1772 //------判断活动是否抢光----- 1750 //------判断活动是否抢光-----
1773 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + 1751 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
1774 - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, { 1752 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
1775 1: 1 1753 1: 1
1776 }).then(res => { 1754 }).then(res => {
1777 redis_num = res.data.data; 1755 redis_num = res.data.data;
1778 }); 1756 });
1779 - 1757 +
1780 if (t > redis_num) { 1758 if (t > redis_num) {
1781 wx.showModal({ 1759 wx.showModal({
1782 title: '超出商品活动库存', 1760 title: '超出商品活动库存',
1783 }); 1761 });
1784 - th.setData({goodsInputNum:redis_num}) 1762 + th.setData({ goodsInputNum: redis_num })
1785 return false; 1763 return false;
1786 } 1764 }
1787 - 1765 +
1788 } 1766 }
1789 - 1767 +
1790 var e = th.data.sele_g.store_count; 1768 var e = th.data.sele_g.store_count;
1791 - var p_type=th.data.prom_type; //&& p_type!=1 && p_type!=4  
1792 - if(th.data.sales_rules==2 && (p_type!=1 && p_type!=4 && p_type!=6 || th.data.openSpecModal_inte_normal==1 || th.data.is_normal== 1) ){  
1793 - if(!th.data.def_pick_store){ 1769 + var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4
  1770 + if (th.data.sales_rules == 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) {
  1771 + if (!th.data.def_pick_store) {
1794 wx.showModal({ title: '请选择门店', }); 1772 wx.showModal({ title: '请选择门店', });
1795 return false; 1773 return false;
1796 - }else{  
1797 - e=th.data.def_pick_store.CanOutQty; 1774 + } else {
  1775 + e = th.data.def_pick_store.CanOutQty;
1798 } 1776 }
1799 } 1777 }
1800 - if(!e) e=0; 1778 + if (!e) e = 0;
1801 //库存不足,不增加 1779 //库存不足,不增加
1802 - if(e<t){ wx.showModal({ title: '库存不足', });  
1803 - if(e<0) e=0;  
1804 - th.setData({ goodsInputNum: e }); return false; 1780 + if (e < t) {
  1781 + wx.showModal({ title: '库存不足', });
  1782 + if (e < 0) e = 0;
  1783 + th.setData({ goodsInputNum: e }); return false;
1805 } 1784 }
1806 t > e || 0 == e ? t = e : t < 1 && (t = 1); 1785 t > e || 0 == e ? t = e : t < 1 && (t = 1);
1807 - th.setData({ goodsInputNum: t }); 1786 + th.setData({ goodsInputNum: t });
1808 }) 1787 })
1809 }, 1788 },
1810 1789
1811 1790
1812 - closeSpecModal: function() {  
1813 - if(this.data.openSpecModal_pt && this.data.is_normal){  
1814 - this.get_sto();  
1815 - this.setData({  
1816 - sele_g:this.data.data,  
1817 - gid:this.data.data.goods_id  
1818 - })  
1819 -  
1820 - this.sele_spec_chech_activity();  
1821 -  
1822 - }  
1823 - 1791 + closeSpecModal: function () {
  1792 + if (this.data.openSpecModal_pt && this.data.is_normal) {
  1793 + this.get_sto();
  1794 + this.setData({
  1795 + sele_g: this.data.data,
  1796 + gid: this.data.data.goods_id
  1797 + })
  1798 +
  1799 + this.sele_spec_chech_activity();
  1800 +
  1801 + }
  1802 +
1824 this.setData({ 1803 this.setData({
1825 openSpecModal: !1, 1804 openSpecModal: !1,
1826 openSpecModal_pt: !1 1805 openSpecModal_pt: !1
1827 }); 1806 });
1828 }, 1807 },
1829 -  
1830 - openSpecModel: function(t) {  
1831 - var th=this; 1808 +
  1809 + openSpecModel: function (t) {
  1810 + var th = this;
1832 var open_store = t.currentTarget.dataset.ind; 1811 var open_store = t.currentTarget.dataset.ind;
1833 this.setData({ 1812 this.setData({
1834 store: 0, 1813 store: 0,
@@ -1848,7 +1827,7 @@ Page({ @@ -1848,7 +1827,7 @@ Page({
1848 var ind = t.currentTarget.dataset.ind; 1827 var ind = t.currentTarget.dataset.ind;
1849 1828
1850 //回调。判断是不是优惠促销 1829 //回调。判断是不是优惠促销
1851 - th.check_is_prom_goods(function (){ 1830 + th.check_is_prom_goods(function () {
1852 th.setData({ 1831 th.setData({
1853 openSpecModal: !0, 1832 openSpecModal: !0,
1854 openSpecModal_ind: ind, 1833 openSpecModal_ind: ind,
@@ -1857,127 +1836,129 @@ Page({ @@ -1857,127 +1836,129 @@ Page({
1857 th.get_off_price(); 1836 th.get_off_price();
1858 }) 1837 })
1859 }, 1838 },
1860 - 1839 +
1861 //判断是不是优惠促销 1840 //判断是不是优惠促销
1862 - check_is_prom_goods:function(callback){  
1863 - var th=this;  
1864 - var usr=getApp().globalData.userInfo;  
1865 - if(this.data.sele_g.prom_type!=0 && this.data.sele_g.prom_type!=3){  
1866 - callback();  
1867 - }else{  
1868 - //-- 判断有没有优惠活动 --  
1869 - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+th.data.sele_g.goods_id+"/0", {}).then(res => {  
1870 - if(res.data.code==0){  
1871 - var r_data=res.data.data;  
1872 - th.data.prom_goods=r_data.promGoodsLists;  
1873 - if(!th.data.prom_goods){  
1874 - callback();  
1875 - return false;  
1876 - }  
1877 -  
1878 - ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1  
1879 - getApp().promiseGet("/api/weshop/order/getWPayOrder",{  
1880 - data:{store_id:os.stoid,user_id:usr.user_id,goods_id:th.data.sele_g.goods_id,prom_id:th.data.prom_goods[0].prom_id}  
1881 - }).then(res=>{  
1882 - if(res.data.code==0){  
1883 - wx.showToast({  
1884 - title: "您已经购买了该商品待支付中",  
1885 - icon: 'none',  
1886 - duration: 2000  
1887 - })  
1888 - setTimeout(function (){  
1889 - getApp().goto("/pages/user/order_detail/order_detail?order_id=" + res.data.data.order_id,)  
1890 - },1000)  
1891 - }  
1892 - //未找到相关记录  
1893 - else{  
1894 - callback();  
1895 - }  
1896 - })  
1897 - }  
1898 -  
1899 - })  
1900 -  
1901 - }  
1902 - },  
1903 -  
1904 -  
1905 - 1841 + check_is_prom_goods: function (callback) {
  1842 + var th = this;
  1843 + var usr = getApp().globalData.userInfo;
  1844 + if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3) {
  1845 + callback();
  1846 + } else {
  1847 + //-- 判断有没有优惠活动 --
  1848 + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0", {}).then(res => {
  1849 + if (res.data.code == 0) {
  1850 + var r_data = res.data.data;
  1851 + th.data.prom_goods = r_data.promGoodsLists;
  1852 + if (!th.data.prom_goods) {
  1853 + callback();
  1854 + return false;
  1855 + }
  1856 +
  1857 + ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1
  1858 + getApp().promiseGet("/api/weshop/order/getWPayOrder", {
  1859 + data: { store_id: os.stoid, user_id: usr.user_id, goods_id: th.data.sele_g.goods_id, prom_id: th.data.prom_goods[0].prom_id }
  1860 + }).then(res => {
  1861 + if (res.data.code == 0) {
  1862 + wx.showToast({
  1863 + title: "您已经购买了该商品待支付中",
  1864 + icon: 'none',
  1865 + duration: 2000
  1866 + })
  1867 + setTimeout(function () {
  1868 + getApp().goto("/pages/user/order_detail/order_detail?order_id=" + res.data.data.order_id,)
  1869 + }, 1000)
  1870 + }
  1871 + //未找到相关记录
  1872 + else {
  1873 + callback();
  1874 + }
  1875 + })
  1876 + }
  1877 +
  1878 + })
  1879 +
  1880 + }
  1881 + },
  1882 +
  1883 +
  1884 +
1906 //----获取线下价格------- 1885 //----获取线下价格-------
1907 - get_off_price(){  
1908 - var th=this;  
1909 - //没有开启就返回  
1910 - if(!th.data.is_open_offline) return false;  
1911 - //先看下购买的功能有没有到期  
1912 - getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=6",{}).then(res=>{  
1913 - //未购买  
1914 - if(res.data.code!=0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length){  
1915 - return false;  
1916 - }else{  
1917 - //已经过期  
1918 - var item=res.data.data.pageData[0];  
1919 - if(item.end_time<ut.gettimestamp()){  
1920 - return false;  
1921 - }  
1922 - }  
1923 -  
1924 -  
1925 - var cur_goods=this.data.sele_g;  
1926 - var cur_price=cur_goods.shop_price;  
1927 - if(th.data.card_field && cur_goods[th.data.card_field]>0){  
1928 - cur_price=cur_goods[th.data.card_field];  
1929 - }  
1930 -  
1931 - var user_info = getApp().globalData.userInfo;  
1932 - //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行  
1933 - if(cur_goods.prom_type==0 && !this.data.prom_goods){  
1934 - cur_goods.offline_price=null;  
1935 - //如果没有门店,不用计算线下价格  
1936 - var def_pick_store=this.data.def_pick_store;  
1937 - if(!def_pick_store) return false;  
1938 - getApp().request.get("/api/weshop/goods/listWarePrice", {  
1939 - data:{VIPId:encodeURIComponent(user_info.erpvipid),  
1940 - store_id:os.stoid,  
1941 - PickupId:def_pick_store.pickup_id,  
1942 - WareIds:encodeURIComponent(cur_goods.erpwareid)},  
1943 - success:function(res){  
1944 - if(res.data.code==0 && res.data.data && res.data.data.length>0){  
1945 - var datalist=res.data.data;  
1946 - if(datalist[0].WarePrice<cur_price){  
1947 - cur_goods.offline_price=datalist[0].WarePrice; //存储线下活动的价格  
1948 - cur_goods.pricing_type=datalist[0].PriceType; //存储线下活动的类型  
1949 - }  
1950 - }  
1951 - th.setData({sele_g:cur_goods});  
1952 - }  
1953 -  
1954 - })  
1955 - }  
1956 -  
1957 - })  
1958 -  
1959 -  
1960 - },  
1961 -  
1962 - 1886 + get_off_price() {
  1887 + var th = this;
  1888 + //没有开启就返回
  1889 + if (!th.data.is_open_offline) return false;
  1890 + //先看下购买的功能有没有到期
  1891 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=6", {}).then(res => {
  1892 + //未购买
  1893 + if (res.data.code != 0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length) {
  1894 + return false;
  1895 + } else {
  1896 + //已经过期
  1897 + var item = res.data.data.pageData[0];
  1898 + if (item.end_time < ut.gettimestamp()) {
  1899 + return false;
  1900 + }
  1901 + }
  1902 +
  1903 +
  1904 + var cur_goods = this.data.sele_g;
  1905 + var cur_price = cur_goods.shop_price;
  1906 + if (th.data.card_field && cur_goods[th.data.card_field] > 0) {
  1907 + cur_price = cur_goods[th.data.card_field];
  1908 + }
  1909 +
  1910 + var user_info = getApp().globalData.userInfo;
  1911 + //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行
  1912 + if (cur_goods.prom_type == 0 && !this.data.prom_goods) {
  1913 + cur_goods.offline_price = null;
  1914 + //如果没有门店,不用计算线下价格
  1915 + var def_pick_store = this.data.def_pick_store;
  1916 + if (!def_pick_store) return false;
  1917 + getApp().request.get("/api/weshop/goods/listWarePrice", {
  1918 + data: {
  1919 + VIPId: encodeURIComponent(user_info.erpvipid),
  1920 + store_id: os.stoid,
  1921 + PickupId: def_pick_store.pickup_id,
  1922 + WareIds: encodeURIComponent(cur_goods.erpwareid)
  1923 + },
  1924 + success: function (res) {
  1925 + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  1926 + var datalist = res.data.data;
  1927 + if (datalist[0].WarePrice < cur_price) {
  1928 + cur_goods.offline_price = datalist[0].WarePrice; //存储线下活动的价格
  1929 + cur_goods.pricing_type = datalist[0].PriceType; //存储线下活动的类型
  1930 + }
  1931 + }
  1932 + th.setData({ sele_g: cur_goods });
  1933 + }
  1934 +
  1935 + })
  1936 + }
  1937 +
  1938 + })
  1939 +
  1940 +
  1941 + },
  1942 +
  1943 +
1963 //---------点击收藏和不收藏------------ 1944 //---------点击收藏和不收藏------------
1964 - collectGoods: function() { 1945 + collectGoods: function () {
1965 var t = this, 1946 var t = this,
1966 - i = getApp().request; 1947 + i = getApp().request;
1967 var user_id = s.globalData.user_id; 1948 var user_id = s.globalData.user_id;
1968 if (user_id == '') { 1949 if (user_id == '') {
1969 - getApp().getUserFir(function() {}); 1950 + getApp().getUserFir(function () { });
1970 getApp().showWarning("未登录"); 1951 getApp().showWarning("未登录");
1971 return false; 1952 return false;
1972 } else { 1953 } else {
1973 1954
1974 - if(t.data.is_collect_load) return false;  
1975 - t.data.is_collect_load=1; 1955 + if (t.data.is_collect_load) return false;
  1956 + t.data.is_collect_load = 1;
1976 1957
1977 if (t.data.is_collect == 1) { //删除收藏 1958 if (t.data.is_collect == 1) { //删除收藏
1978 i.delete("/api/weshop/goodscollect/del/" + o.stoid + "/" + t.data.collect_id, { 1959 i.delete("/api/weshop/goodscollect/del/" + o.stoid + "/" + t.data.collect_id, {
1979 - success: function(e) {  
1980 - t.data.is_collect_load=0; 1960 + success: function (e) {
  1961 + t.data.is_collect_load = 0;
1981 if (e.data.code == 0) { 1962 if (e.data.code == 0) {
1982 t.setData({ 1963 t.setData({
1983 is_collect: 0, 1964 is_collect: 0,
@@ -1996,15 +1977,15 @@ Page({ @@ -1996,15 +1977,15 @@ Page({
1996 add_time: timestamp, 1977 add_time: timestamp,
1997 }; 1978 };
1998 //加入收藏夹就是导购的ID 1979 //加入收藏夹就是导购的ID
1999 - if(getApp().globalData.guide_id){  
2000 - d.guide_id=getApp().globalData.guide_id;  
2001 - d.guide_type=2; 1980 + if (getApp().globalData.guide_id) {
  1981 + d.guide_id = getApp().globalData.guide_id;
  1982 + d.guide_type = 2;
2002 } 1983 }
2003 1984
2004 i.post("/api/weshop/goodscollect/save", { //添加收藏 1985 i.post("/api/weshop/goodscollect/save", { //添加收藏
2005 data: d, 1986 data: d,
2006 - success: function(e) {  
2007 - t.data.is_collect_load=0; 1987 + success: function (e) {
  1988 + t.data.is_collect_load = 0;
2008 if (e.data.code == 0) { 1989 if (e.data.code == 0) {
2009 t.setData({ 1990 t.setData({
2010 is_collect: 1, 1991 is_collect: 1,
@@ -2018,13 +1999,13 @@ Page({ @@ -2018,13 +1999,13 @@ Page({
2018 }, 1999 },
2019 2000
2020 //---------联系客服------------ 2001 //---------联系客服------------
2021 - contactService: function() {  
2022 - s.getConfig(function(t) { 2002 + contactService: function () {
  2003 + s.getConfig(function (t) {
2023 if (t.store_tel == undefined) { 2004 if (t.store_tel == undefined) {
2024 getApp().request.get("/api/weshop/store/get/" + os.stoid, { 2005 getApp().request.get("/api/weshop/store/get/" + os.stoid, {
2025 isShowLoading: 1, 2006 isShowLoading: 1,
2026 data: {}, 2007 data: {},
2027 - success: function(rs) { 2008 + success: function (rs) {
2028 getApp().globalData.config = rs.data.data; 2009 getApp().globalData.config = rs.data.data;
2029 if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { 2010 if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
2030 getApp().my_warnning("商家未设置电话", 0, th); 2011 getApp().my_warnning("商家未设置电话", 0, th);
@@ -2039,44 +2020,44 @@ Page({ @@ -2039,44 +2020,44 @@ Page({
2039 }); 2020 });
2040 }, 2021 },
2041 //-------获取购物车数量---------- 2022 //-------获取购物车数量----------
2042 - requestCardNum: function() { 2023 + requestCardNum: function () {
2043 var t = this; 2024 var t = this;
2044 getApp().request.get("/api/weshop/cart/page", { 2025 getApp().request.get("/api/weshop/cart/page", {
2045 data: { 2026 data: {
2046 store_id: o.stoid, 2027 store_id: o.stoid,
2047 user_id: s.globalData.user_id, 2028 user_id: s.globalData.user_id,
2048 - state:0,  
2049 - is_gift:0 2029 + state: 0,
  2030 + is_gift: 0
2050 }, 2031 },
2051 - success: function(e) { 2032 + success: function (e) {
2052 var num = 0; 2033 var num = 0;
2053 for (var i = 0; i < e.data.data.pageData.length; i++) { 2034 for (var i = 0; i < e.data.data.pageData.length; i++) {
2054 num += e.data.data.pageData[i].goods_num; 2035 num += e.data.data.pageData[i].goods_num;
2055 } 2036 }
2056 2037
2057 //-- 读取服务卡的数量 -- 2038 //-- 读取服务卡的数量 --
2058 - getApp().promiseGet("/api/weshop/cartService/page",{  
2059 - data:{ 2039 + getApp().promiseGet("/api/weshop/cartService/page", {
  2040 + data: {
2060 store_id: s.globalData.setting.stoid, 2041 store_id: s.globalData.setting.stoid,
2061 user_id: s.globalData.user_id, 2042 user_id: s.globalData.user_id,
2062 } 2043 }
2063 - }).then(res=>{ 2044 + }).then(res => {
2064 for (var i = 0; i < res.data.data.pageData.length; i++) { 2045 for (var i = 0; i < res.data.data.pageData.length; i++) {
2065 num += res.data.data.pageData[i].goods_num; 2046 num += res.data.data.pageData[i].goods_num;
2066 } 2047 }
2067 - t.setData({cartGoodsNum:num}); 2048 + t.setData({ cartGoodsNum: num });
2068 }) 2049 })
2069 } 2050 }
2070 }); 2051 });
2071 }, 2052 },
2072 2053
2073 - previewCommentImgs: function(t) { 2054 + previewCommentImgs: function (t) {
2074 var e = this.data.comments[t.currentTarget.dataset.cidx].img; 2055 var e = this.data.comments[t.currentTarget.dataset.cidx].img;
2075 var b = e.slice() 2056 var b = e.slice()
2076 - for(var i in b){ 2057 + for (var i in b) {
2077 b[i] = this.data.iurl + e[i]; 2058 b[i] = this.data.iurl + e[i];
2078 } 2059 }
2079 - this.data.show_prew_img=1; 2060 + this.data.show_prew_img = 1;
2080 2061
2081 wx.previewImage({ 2062 wx.previewImage({
2082 current: b[t.currentTarget.dataset.id], 2063 current: b[t.currentTarget.dataset.id],
@@ -2084,106 +2065,106 @@ Page({ @@ -2084,106 +2065,106 @@ Page({
2084 }); 2065 });
2085 }, 2066 },
2086 2067
2087 - previewCommentImgs_w: function(t) { 2068 + previewCommentImgs_w: function (t) {
2088 var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img; 2069 var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;
2089 var b = e.slice() 2070 var b = e.slice()
2090 for (var i in b) { 2071 for (var i in b) {
2091 b[i] = this.data.iurl + e[i]; 2072 b[i] = this.data.iurl + e[i];
2092 } 2073 }
2093 - this.data.show_prew_img=1; 2074 + this.data.show_prew_img = 1;
2094 wx.previewImage({ 2075 wx.previewImage({
2095 current: b[t.currentTarget.dataset.id], 2076 current: b[t.currentTarget.dataset.id],
2096 urls: b 2077 urls: b
2097 }); 2078 });
2098 }, 2079 },
2099 2080
2100 - previewGoodsCommentImgs: function(t) { 2081 + previewGoodsCommentImgs: function (t) {
2101 var e = this, 2082 var e = this,
2102 - a = this.data.data.comment[t.currentTarget.dataset.cidx].img;  
2103 - a = a.map(function(t) { 2083 + a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
  2084 + a = a.map(function (t) {
2104 return e.data.url + t; 2085 return e.data.url + t;
2105 }), wx.previewImage({ 2086 }), wx.previewImage({
2106 current: a[t.currentTarget.dataset.id], 2087 current: a[t.currentTarget.dataset.id],
2107 urls: a 2088 urls: a
2108 }); 2089 });
2109 - this.data.show_prew_img=1; 2090 + this.data.show_prew_img = 1;
2110 }, 2091 },
2111 - closePromModal: function() { 2092 + closePromModal: function () {
2112 this.setData({ 2093 this.setData({
2113 openPromModal: !1 2094 openPromModal: !1
2114 }); 2095 });
2115 }, 2096 },
2116 - openPromModal: function() { 2097 + openPromModal: function () {
2117 this.setData({ 2098 this.setData({
2118 openPromModal: !0 2099 openPromModal: !0
2119 }); 2100 });
2120 }, 2101 },
2121 2102
2122 //--点击分享事件--- 2103 //--点击分享事件---
2123 - onShareAppMessage: function(t) {  
2124 - 2104 + onShareAppMessage: function (t) {
  2105 +
2125 var th = this; 2106 var th = this;
2126 var price = th.data.data.shop_price; 2107 var price = th.data.data.shop_price;
2127 if (th.data.prom_act) { 2108 if (th.data.prom_act) {
2128 price = th.data.prom_act.price; 2109 price = th.data.prom_act.price;
2129 2110
2130 } 2111 }
2131 - var title= th.data.data.goods_name;  
2132 - var img=th.data.data.original_img;  
2133 - if(th.data.prom_type==6 || th.data.prom_type==1 || th.data.prom_type==4){  
2134 - title=th.data.prom_act.share_title;  
2135 - if(!title) title=th.data.prom_act.title;  
2136 - if(th.data.prom_type==4) title=th.data.prom_act.name;  
2137 -  
2138 - if(th.data.prom_act.share_imgurl)  
2139 - img=th.data.iurl+th.data.prom_act.share_imgurl; 2112 + var title = th.data.data.goods_name;
  2113 + var img = th.data.data.original_img;
  2114 + if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) {
  2115 + title = th.data.prom_act.share_title;
  2116 + if (!title) title = th.data.prom_act.title;
  2117 + if (th.data.prom_type == 4) title = th.data.prom_act.name;
  2118 +
  2119 + if (th.data.prom_act.share_imgurl)
  2120 + img = th.data.iurl + th.data.prom_act.share_imgurl;
  2121 + }
  2122 +
  2123 +
  2124 + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  2125 + if (getApp().globalData.user_id) {
  2126 + url += "&first_leader=" + getApp().globalData.user_id;
2140 } 2127 }
2141 2128
2142 -  
2143 - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;  
2144 - if(getApp().globalData.user_id){  
2145 - url+="&first_leader="+getApp().globalData.user_id; 2129 + //-- 如果房间分享,且不是会员分享的 --
  2130 + if (getApp().globalData.room_id &&
  2131 + th.data.data.goods_id == getApp().globalData.room_goods_id &&
  2132 + !getApp().globalData.room_user_share
  2133 + ) {
  2134 + url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1";
2146 } 2135 }
2147 -  
2148 - //-- 如果房间分享,且不是会员分享的 --  
2149 - if(getApp().globalData.room_id &&  
2150 - th.data.data.goods_id==getApp().globalData.room_goods_id &&  
2151 - !getApp().globalData.room_user_share  
2152 - ){  
2153 - url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";  
2154 - }  
2155 -  
2156 - var ob={  
2157 - title: price + "元 " +title,  
2158 - path:url, 2136 +
  2137 + var ob = {
  2138 + title: price + "元 " + title,
  2139 + path: url,
2159 imageUrl: img, 2140 imageUrl: img,
2160 - };  
2161 - if(th.data.prom_type==6){  
2162 - title+='\n'+th.data.prom_act.share_remark;  
2163 - ob.title=title;  
2164 - ob.desc=th.data.prom_act.share_remark;  
2165 - }  
2166 -  
2167 - //如果是积分购的时候  
2168 - if(th.data.prom_type==4){  
2169 - var name = th.data.prom_act.name;  
2170 - //-- 积分购的 --  
2171 - var pri0 = th.data.prom_act.addmoney;  
2172 - var integral=th.data.prom_act.integral;  
2173 - var text="";  
2174 - if(integral){text=integral+"积分"; }  
2175 - if(pri0 && integral){ text+="+";}  
2176 - if(pri0){ text+="¥"+pri0;}  
2177 -  
2178 - ob.title= text+" "+name;  
2179 - }  
2180 - 2141 + };
  2142 + if (th.data.prom_type == 6) {
  2143 + title += '\n' + th.data.prom_act.share_remark;
  2144 + ob.title = title;
  2145 + ob.desc = th.data.prom_act.share_remark;
  2146 + }
  2147 +
  2148 + //如果是积分购的时候
  2149 + if (th.data.prom_type == 4) {
  2150 + var name = th.data.prom_act.name;
  2151 + //-- 积分购的 --
  2152 + var pri0 = th.data.prom_act.addmoney;
  2153 + var integral = th.data.prom_act.integral;
  2154 + var text = "";
  2155 + if (integral) { text = integral + "积分"; }
  2156 + if (pri0 && integral) { text += "+"; }
  2157 + if (pri0) { text += "¥" + pri0; }
  2158 +
  2159 + ob.title = text + " " + name;
  2160 + }
  2161 +
2181 return ob; 2162 return ob;
2182 - 2163 +
2183 }, 2164 },
2184 2165
2185 //-----图片失败,默认图片----- 2166 //-----图片失败,默认图片-----
2186 - bind_bnerr: function(e) { 2167 + bind_bnerr: function (e) {
2187 var _errImg = e.target.dataset.errorimg; 2168 var _errImg = e.target.dataset.errorimg;
2188 var _errObj = {}; 2169 var _errObj = {};
2189 _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; 2170 _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
@@ -2191,7 +2172,7 @@ Page({ @@ -2191,7 +2172,7 @@ Page({
2191 }, 2172 },
2192 2173
2193 //-----图片失败,默认图片----- 2174 //-----图片失败,默认图片-----
2194 - bind_bnerr2: function(e) { 2175 + bind_bnerr2: function (e) {
2195 2176
2196 var _errImg = e.target.dataset.errorimg; 2177 var _errImg = e.target.dataset.errorimg;
2197 var _errObj = {}; 2178 var _errObj = {};
@@ -2201,79 +2182,79 @@ Page({ @@ -2201,79 +2182,79 @@ Page({
2201 2182
2202 //----------装载同一条形码的商品---------- 2183 //----------装载同一条形码的商品----------
2203 async get_sku(stoid, gd, g_id, is_normal, func) { 2184 async get_sku(stoid, gd, g_id, is_normal, func) {
2204 - var tt = this,arrdata=null;  
2205 - var now=ut.gettimestamp(); 2185 + var tt = this, arrdata = null;
  2186 + var now = ut.gettimestamp();
2206 await getApp().request.promiseGet("/api/weshop/goods/page", { 2187 await getApp().request.promiseGet("/api/weshop/goods/page", {
2207 data: { 2188 data: {
2208 store_id: o.stoid, 2189 store_id: o.stoid,
2209 sku: gd.sku, 2190 sku: gd.sku,
2210 - more_spec:gd.more_spec, 2191 + more_spec: gd.more_spec,
2211 isonsale: 1, 2192 isonsale: 1,
2212 is_on_sale: 1, 2193 is_on_sale: 1,
2213 - pageSize:500,  
2214 - orderField: 'sort' 2194 + pageSize: 500,
  2195 + orderField: 'sort'
2215 } 2196 }
2216 }).then(res => { 2197 }).then(res => {
2217 var e = res; 2198 var e = res;
2218 if (e.data.code == 0) arrdata = e.data.data.pageData; 2199 if (e.data.code == 0) arrdata = e.data.data.pageData;
2219 }) 2200 })
2220 - if(!arrdata) return false; 2201 + if (!arrdata) return false;
2221 2202
2222 var arrsku = new Array(); 2203 var arrsku = new Array();
2223 var gitem = null; 2204 var gitem = null;
2224 - var gb = 1,gg = ""; 2205 + var gb = 1, gg = "";
2225 for (var i = 0; i < arrdata.length; i++) { 2206 for (var i = 0; i < arrdata.length; i++) {
2226 - var goodsinfo=arrdata[i],prom=null; 2207 + var goodsinfo = arrdata[i], prom = null;
2227 if (goodsinfo.goods_id != g_id) { 2208 if (goodsinfo.goods_id != g_id) {
2228 -  
2229 - switch(goodsinfo.prom_type){  
2230 - case 1:  
2231 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2232 - }).then(res=>{  
2233 - if(res.data.code==0) prom=res.data.data;  
2234 - })  
2235 -  
2236 - break;  
2237 - case 6:  
2238 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2239 - }).then(res=>{  
2240 - if(res.data.code==0) prom=res.data.data;  
2241 - })  
2242 -  
2243 - break;  
2244 - case 2:  
2245 - await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{  
2246 - }).then(res=>{  
2247 - if(res.data.code==0) prom=res.data.data;  
2248 - })  
2249 - break;  
2250 - case 4:  
2251 - await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{  
2252 - }).then(res=>{  
2253 - if(res.data.code==0) prom=res.data.data;  
2254 - })  
2255 - break  
2256 -  
2257 - }  
2258 -  
2259 -  
2260 - }  
2261 - //---如果有活动,不算在一起---  
2262 - if(prom){  
2263 - if(goodsinfo.prom_type==1 || goodsinfo.prom_type==6){  
2264 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now) continue;  
2265 - }else{  
2266 - continue;  
2267 - }  
2268 - }  
2269 -  
2270 2209
2271 - var item = arrdata[i],gg = "";  
2272 - if(item.goods_spec=="null" || item.goods_spec==null) item.goods_spec="";  
2273 - if(item.goods_color=="null" || item.goods_color==null) item.goods_color=""; 2210 + switch (goodsinfo.prom_type) {
  2211 + case 1:
  2212 + await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, {
  2213 + }).then(res => {
  2214 + if (res.data.code == 0) prom = res.data.data;
  2215 + })
  2216 +
  2217 + break;
  2218 + case 6:
  2219 + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {
  2220 + }).then(res => {
  2221 + if (res.data.code == 0) prom = res.data.data;
  2222 + })
  2223 +
  2224 + break;
  2225 + case 2:
  2226 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {
  2227 + }).then(res => {
  2228 + if (res.data.code == 0) prom = res.data.data;
  2229 + })
  2230 + break;
  2231 + case 4:
  2232 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {
  2233 + }).then(res => {
  2234 + if (res.data.code == 0) prom = res.data.data;
  2235 + })
  2236 + break
2274 2237
2275 - if (item.goods_spec != "" && item.goods_color != "") {  
2276 - gg = item.goods_spec + "/" + item.goods_color; 2238 + }
  2239 +
  2240 +
  2241 + }
  2242 + //---如果有活动,不算在一起---
  2243 + if (prom) {
  2244 + if (goodsinfo.prom_type == 1 || goodsinfo.prom_type == 6) {
  2245 + if (prom.is_end == 0 && prom.end_time > now && prom.start_time < now) continue;
  2246 + } else {
  2247 + continue;
  2248 + }
  2249 + }
  2250 +
  2251 +
  2252 + var item = arrdata[i], gg = "";
  2253 + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = "";
  2254 + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = "";
  2255 +
  2256 + if (item.goods_spec != "" && item.goods_color != "") {
  2257 + gg = item.goods_spec + "/" + item.goods_color;
2277 } else if (item.goods_spec != "" || item.goods_color != "") { 2258 } else if (item.goods_spec != "" || item.goods_color != "") {
2278 gg = item.goods_spec + item.goods_color; 2259 gg = item.goods_spec + item.goods_color;
2279 } else { 2260 } else {
@@ -2282,10 +2263,10 @@ Page({ @@ -2282,10 +2263,10 @@ Page({
2282 } 2263 }
2283 item.gg = gg; 2264 item.gg = gg;
2284 2265
2285 - if(item.spec_img)  
2286 - item.original_img=os.imghost+item.spec_img; 2266 + if (item.spec_img)
  2267 + item.original_img = os.imghost + item.spec_img;
2287 else 2268 else
2288 - item.original_img=os.imghost+item.original_img; 2269 + item.original_img = os.imghost + item.original_img;
2289 2270
2290 2271
2291 if (item.goods_id == g_id) { 2272 if (item.goods_id == g_id) {
@@ -2311,16 +2292,16 @@ Page({ @@ -2311,16 +2292,16 @@ Page({
2311 }, 2292 },
2312 2293
2313 //-----------选择属性的按钮事件---------- 2294 //-----------选择属性的按钮事件----------
2314 - sele_spec: function(e) {  
2315 - var that=this,ee=this,th=this; 2295 + sele_spec: function (e) {
  2296 + var that = this, ee = this, th = this;
2316 var gid = e.currentTarget.dataset.gid; 2297 var gid = e.currentTarget.dataset.gid;
2317 - var nor=e.currentTarget.dataset.nor;  
2318 - 2298 + var nor = e.currentTarget.dataset.nor;
  2299 +
2319 var sku_g = this.data.sku_g; 2300 var sku_g = this.data.sku_g;
2320 - if(nor){  
2321 - sku_g = this.data.sku_g_pt;  
2322 - }  
2323 - 2301 + if (nor) {
  2302 + sku_g = this.data.sku_g_pt;
  2303 + }
  2304 +
2324 var item = null; 2305 var item = null;
2325 for (var i in sku_g) { 2306 for (var i in sku_g) {
2326 if (sku_g[i].goods_id == gid) { 2307 if (sku_g[i].goods_id == gid) {
@@ -2332,41 +2313,41 @@ Page({ @@ -2332,41 +2313,41 @@ Page({
2332 sele_g: item, 2313 sele_g: item,
2333 gid: gid 2314 gid: gid
2334 }); 2315 });
2335 -  
2336 -  
2337 2316
2338 - that.check_is_youhui(gid,that.data.is_normal);  
2339 -  
2340 - var ty=0; 2317 +
  2318 +
  2319 + that.check_is_youhui(gid, that.data.is_normal);
  2320 +
  2321 + var ty = 0;
2341 this.get_sto(that.data.is_normal); 2322 this.get_sto(that.data.is_normal);
2342 -  
2343 - 2323 +
  2324 +
2344 //默认门店要拿下门店库存 2325 //默认门店要拿下门店库存
2345 - if(that.data.sales_rules==2 && that.data.def_pick_store){  
2346 - var lock=0,plist=null; 2326 + if (that.data.sales_rules == 2 && that.data.def_pick_store) {
  2327 + var lock = 0, plist = null;
2347 //先读取门店的lock,采用链式写法,少用await 2328 //先读取门店的lock,采用链式写法,少用await
2348 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2349 - data:{store_id:os.stoid,wareId:ee.data.sele_g.goods_id,storageId:that.data.def_pick_store.pickup_id,pageSize:1000}  
2350 - }).then(res=>{  
2351 - if(res.data.code==0 && res.data.data.total>0){  
2352 - for(var i in res.data.data.pageData)  
2353 - lock+=res.data.data.pageData[i].outQty 2329 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  2330 + data: { store_id: os.stoid, wareId: ee.data.sele_g.goods_id, storageId: that.data.def_pick_store.pickup_id, pageSize: 1000 }
  2331 + }).then(res => {
  2332 + if (res.data.code == 0 && res.data.data.total > 0) {
  2333 + for (var i in res.data.data.pageData)
  2334 + lock += res.data.data.pageData[i].outQty
2354 } 2335 }
2355 //---通过接口获取门店的线下库存信息-- 2336 //---通过接口获取门店的线下库存信息--
2356 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2357 - data:{storageNos:that.data.def_pick_store.pickup_no,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid} 2337 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  2338 + data: { storageNos: that.data.def_pick_store.pickup_no, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid }
2358 }) 2339 })
2359 - }).then(res=>{  
2360 - if(res.data.code==0 && res.data.data.total>0){  
2361 - plist=res.data.data.pageData[0]; 2340 + }).then(res => {
  2341 + if (res.data.code == 0 && res.data.data.total > 0) {
  2342 + plist = res.data.data.pageData[0];
2362 } 2343 }
2363 - if(plist && plist.CanOutQty-lock>0){  
2364 - that.data.def_pick_store.CanOutQty=plist.CanOutQty-lock;  
2365 - }else{  
2366 - that.data.def_pick_store.CanOutQty=0; 2344 + if (plist && plist.CanOutQty - lock > 0) {
  2345 + that.data.def_pick_store.CanOutQty = plist.CanOutQty - lock;
  2346 + } else {
  2347 + that.data.def_pick_store.CanOutQty = 0;
2367 } 2348 }
2368 //--给门店赋值线下库存-- 2349 //--给门店赋值线下库存--
2369 - th.setData({def_pick_store:that.data.def_pick_store}); 2350 + th.setData({ def_pick_store: that.data.def_pick_store });
2370 }) 2351 })
2371 } 2352 }
2372 2353
@@ -2375,58 +2356,58 @@ Page({ @@ -2375,58 +2356,58 @@ Page({
2375 }, 2356 },
2376 2357
2377 //选择了不同的规格的时候要判断是不是有活动正在进行中 2358 //选择了不同的规格的时候要判断是不是有活动正在进行中
2378 - async sele_spec_chech_activity(){ 2359 + async sele_spec_chech_activity() {
2379 //---如果是活动的时候--- 2360 //---如果是活动的时候---
2380 - var prom=null,goodsinfo=this.data.sele_g,th=this;  
2381 - if(goodsinfo.prom_type==1){  
2382 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2383 - }).then(res=>{  
2384 - if(res.data.code==0){  
2385 - prom=res.data.data; 2361 + var prom = null, goodsinfo = this.data.sele_g, th = this;
  2362 + if (goodsinfo.prom_type == 1) {
  2363 + await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, {
  2364 + }).then(res => {
  2365 + if (res.data.code == 0) {
  2366 + prom = res.data.data;
  2367 + }
  2368 + })
  2369 + }
  2370 + if (goodsinfo.prom_type == 6) {
  2371 + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {
  2372 + }).then(res => {
  2373 + if (res.data.code == 0) {
  2374 + prom = res.data.data;
2386 } 2375 }
2387 }) 2376 })
2388 } 2377 }
2389 - if(goodsinfo.prom_type==6){  
2390 - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{  
2391 - }).then(res=>{  
2392 - if(res.data.code==0){  
2393 - prom=res.data.data; 2378 +
  2379 + if (goodsinfo.prom_type == 4) {
  2380 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {
  2381 + }).then(res => {
  2382 + if (res.data.code == 0) {
  2383 + prom = res.data.data;
2394 } 2384 }
2395 }) 2385 })
2396 } 2386 }
2397 -  
2398 - if(goodsinfo.prom_type==4){  
2399 - await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{  
2400 - }).then(res=>{  
2401 - if(res.data.code==0){  
2402 - prom=res.data.data;  
2403 - }  
2404 - })  
2405 - }  
2406 - 2387 +
2407 //----------如果有活动,并且在进行中,就不计算线下库存--------------- 2388 //----------如果有活动,并且在进行中,就不计算线下库存---------------
2408 - var now=ut.gettimestamp();  
2409 - if(prom){  
2410 - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){ 2389 + var now = ut.gettimestamp();
  2390 + if (prom) {
  2391 + if (prom.is_end == 0 && prom.end_time > now && prom.start_time < now) {
2411 th.setData({ 2392 th.setData({
2412 - prom_type:goodsinfo.prom_type,  
2413 - prom_price:prom.price,  
2414 - prom_buy_limit:prom.buy_limit,  
2415 - prom_end_time:prom.end_time,  
2416 - prom_start_time:prom.start_time,  
2417 - prom_st:1, 2393 + prom_type: goodsinfo.prom_type,
  2394 + prom_price: prom.price,
  2395 + prom_buy_limit: prom.buy_limit,
  2396 + prom_end_time: prom.end_time,
  2397 + prom_start_time: prom.start_time,
  2398 + prom_st: 1,
2418 }) 2399 })
2419 return false; 2400 return false;
2420 } 2401 }
2421 } 2402 }
2422 //---设置普通商品--- 2403 //---设置普通商品---
2423 th.setData({ 2404 th.setData({
2424 - prom_type:0,  
2425 - prom_price:null,  
2426 - prom_buy_limit:null,  
2427 - prom_end_time:null,  
2428 - prom_start_time:null,  
2429 - prom_st:null, 2405 + prom_type: 0,
  2406 + prom_price: null,
  2407 + prom_buy_limit: null,
  2408 + prom_end_time: null,
  2409 + prom_start_time: null,
  2410 + prom_st: null,
2430 }) 2411 })
2431 2412
2432 }, 2413 },
@@ -2434,20 +2415,20 @@ Page({ @@ -2434,20 +2415,20 @@ Page({
2434 2415
2435 //---------拿出门店分类和门店------------ 2416 //---------拿出门店分类和门店------------
2436 get_sto(e) { 2417 get_sto(e) {
2437 - var th = this,that=this;  
2438 - var is_normal=e;  
2439 -  
2440 - if(e==1){  
2441 - th.setData({is_normal:1})  
2442 - }else{  
2443 - th.setData({is_normal:0})  
2444 - }  
2445 -  
2446 - var timer_get = setInterval(function() { 2418 + var th = this, that = this;
  2419 + var is_normal = e;
  2420 +
  2421 + if (e == 1) {
  2422 + th.setData({ is_normal: 1 })
  2423 + } else {
  2424 + th.setData({ is_normal: 0 })
  2425 + }
  2426 +
  2427 + var timer_get = setInterval(function () {
2447 if (th.data.is_get_local_ok == 0) return false; 2428 if (th.data.is_get_local_ok == 0) return false;
2448 - var dd = null,i = getApp().request;  
2449 - if (!th.data.sele_g) return false;  
2450 - 2429 + var dd = null, i = getApp().request;
  2430 + if (!th.data.sele_g) return false;
  2431 +
2451 var g_distr_type = th.data.sele_g.distr_type; 2432 var g_distr_type = th.data.sele_g.distr_type;
2452 if (g_distr_type != 0) { 2433 if (g_distr_type != 0) {
2453 dd = { 2434 dd = {
@@ -2469,42 +2450,42 @@ Page({ @@ -2469,42 +2450,42 @@ Page({
2469 dd.lon = th.data.lon; 2450 dd.lon = th.data.lon;
2470 } 2451 }
2471 clearInterval(timer_get); 2452 clearInterval(timer_get);
2472 -  
2473 - //如果会员是有默认的门店话  
2474 - if(!th.data.def_pick_store && th.data.fir_def_store){  
2475 - th.setData({def_pick_store:th.data.fir_def_store});  
2476 - }  
2477 -  
2478 - /*--最新的,不用这里筛选配送方式  
2479 - if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){  
2480 - th.setData({def_pick_store:null});  
2481 - }--*/  
2482 -  
2483 -  
2484 - wx.showLoading({  
2485 - title:'加载中.'  
2486 - }); 2453 +
  2454 + //如果会员是有默认的门店话
  2455 + if (!th.data.def_pick_store && th.data.fir_def_store) {
  2456 + th.setData({ def_pick_store: th.data.fir_def_store });
  2457 + }
  2458 +
  2459 + /*--最新的,不用这里筛选配送方式
  2460 + if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){
  2461 + th.setData({def_pick_store:null});
  2462 + }--*/
  2463 +
  2464 +
  2465 + wx.showLoading({
  2466 + title: '加载中.'
  2467 + });
2487 //----------获取门店---------------- 2468 //----------获取门店----------------
2488 getApp().request.promiseGet("/api/weshop/pickup/list", { 2469 getApp().request.promiseGet("/api/weshop/pickup/list", {
2489 data: dd, 2470 data: dd,
2490 }).then(res => { 2471 }).then(res => {
2491 var e = res; 2472 var e = res;
2492 -  
2493 - if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length>0) { 2473 +
  2474 + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) {
2494 2475
2495 //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 2476 //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
2496 - if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){ 2477 + if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) {
2497 th.setData({ 2478 th.setData({
2498 - def_pick_store:e.data.data.pageData[0], 2479 + def_pick_store: e.data.data.pageData[0],
2499 sto_sele_name: e.data.data.pageData[0].pickup_name, 2480 sto_sele_name: e.data.data.pageData[0].pickup_name,
2500 sto_sele_id: e.data.data.pageData[0].pickup_id, 2481 sto_sele_id: e.data.data.pageData[0].pickup_id,
2501 sto_sele_distr: e.data.data.pageData[0].distr_type 2482 sto_sele_distr: e.data.data.pageData[0].distr_type
2502 }); 2483 });
2503 - th.data.fir_def_store=e.data.data.pageData[0]; 2484 + th.data.fir_def_store = e.data.data.pageData[0];
2504 } 2485 }
2505 2486
2506 //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- 2487 //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 --
2507 - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){ 2488 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') {
2508 for (var k = 0; k < e.data.data.pageData.length; k++) { 2489 for (var k = 0; k < e.data.data.pageData.length; k++) {
2509 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { 2490 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
2510 e.data.data.pageData.splice(k, 1); //删除 2491 e.data.data.pageData.splice(k, 1); //删除
@@ -2515,17 +2496,17 @@ Page({ @@ -2515,17 +2496,17 @@ Page({
2515 } 2496 }
2516 2497
2517 2498
2518 - th.setData({all_pick_list:e.data.data.pageData}); 2499 + th.setData({ all_pick_list: e.data.data.pageData });
2519 2500
2520 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- 2501 //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
2521 - if(th.data.sales_rules==2 && !th.data.is_newsales_rules && ((th.data.prom_type!=1 && th.data.prom_type!=6 && th.data.prom_type!=4) || is_normal==1)){  
2522 - setTimeout(function(){ 2502 + if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) {
  2503 + setTimeout(function () {
2523 th.deal_pickup_dline(e); 2504 th.deal_pickup_dline(e);
2524 - },800)  
2525 - }else{  
2526 - setTimeout(function(){ 2505 + }, 800)
  2506 + } else {
  2507 + setTimeout(function () {
2527 th.deal_pickup(e); //--普通门店排版-- 2508 th.deal_pickup(e); //--普通门店排版--
2528 - },800) 2509 + }, 800)
2529 } 2510 }
2530 } 2511 }
2531 }) 2512 })
@@ -2533,14 +2514,14 @@ Page({ @@ -2533,14 +2514,14 @@ Page({
2533 2514
2534 }, 2515 },
2535 2516
2536 - 2517 +
2537 //------------处理门店--------------- 2518 //------------处理门店---------------
2538 - deal_pickup(e){  
2539 - var th=this;  
2540 - if(!th.data.sele_g) return false  
2541 -  
2542 - var g_distr_type=th.data.sele_g.distr_type;  
2543 - wx.hideLoading(); 2519 + deal_pickup(e) {
  2520 + var th = this;
  2521 + if (!th.data.sele_g) return false
  2522 +
  2523 + var g_distr_type = th.data.sele_g.distr_type;
  2524 + wx.hideLoading();
2544 2525
2545 //单总量超出5个的时候 2526 //单总量超出5个的时候
2546 if (e.data.data.total > 5) { 2527 if (e.data.data.total > 5) {
@@ -2549,13 +2530,13 @@ Page({ @@ -2549,13 +2530,13 @@ Page({
2549 store_id: o.stoid, 2530 store_id: o.stoid,
2550 is_show: 1, 2531 is_show: 1,
2551 pageSize: 1000, 2532 pageSize: 1000,
2552 - orderField:"sort",  
2553 - orderType:'asc', 2533 + orderField: "sort",
  2534 + orderType: 'asc',
2554 }, 2535 },
2555 - success: function(ee) { 2536 + success: function (ee) {
2556 if (ee.data.code == 0) { 2537 if (ee.data.code == 0) {
2557 -  
2558 - if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) { 2538 +
  2539 + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
2559 var def_arr = new Array(); 2540 var def_arr = new Array();
2560 var ishas = 0; 2541 var ishas = 0;
2561 //-- 开始就看5个门店 -- 2542 //-- 开始就看5个门店 --
@@ -2576,7 +2557,7 @@ Page({ @@ -2576,7 +2557,7 @@ Page({
2576 //----要进行门店分组-------- 2557 //----要进行门店分组--------
2577 for (var i = 0; i < sto_arr.length; i++) { 2558 for (var i = 0; i < sto_arr.length; i++) {
2578 //找一下这个门店有没有在分类数组内 2559 //找一下这个门店有没有在分类数组内
2579 - var find2 = 0, find2name = "",sort=0; 2560 + var find2 = 0, find2name = "", sort = 0;
2580 for (var m = 0; m < sto_cate.length; m++) { 2561 for (var m = 0; m < sto_cate.length; m++) {
2581 if (sto_arr[i].category_id == sto_cate[m].cat_id) { 2562 if (sto_arr[i].category_id == sto_cate[m].cat_id) {
2582 find2 = sto_cate[m].cat_id; 2563 find2 = sto_cate[m].cat_id;
@@ -2603,7 +2584,7 @@ Page({ @@ -2603,7 +2584,7 @@ Page({
2603 var item = { 2584 var item = {
2604 cat_id: find2, 2585 cat_id: find2,
2605 name: find2name, 2586 name: find2name,
2606 - sort:sort, 2587 + sort: sort,
2607 s_arr: arr0 2588 s_arr: arr0
2608 }; 2589 };
2609 newarr.push(item); 2590 newarr.push(item);
@@ -2619,7 +2600,7 @@ Page({ @@ -2619,7 +2600,7 @@ Page({
2619 var item = { 2600 var item = {
2620 cat_id: find2, 2601 cat_id: find2,
2621 name: find2name, 2602 name: find2name,
2622 - sort:sort, 2603 + sort: sort,
2623 s_arr: arr0 2604 s_arr: arr0
2624 }; 2605 };
2625 newarr.push(item); 2606 newarr.push(item);
@@ -2628,18 +2609,18 @@ Page({ @@ -2628,18 +2609,18 @@ Page({
2628 } 2609 }
2629 } 2610 }
2630 } 2611 }
2631 -  
2632 - //门店分类要排序下  
2633 - function compare(property){  
2634 - return function(a,b){  
2635 - var value1 = a[property];  
2636 - var value2 = b[property];  
2637 - return value1 - value2;  
2638 - }  
2639 - }  
2640 - if(newarr.length>0)  
2641 - newarr.sort(compare("sort"));  
2642 - 2612 +
  2613 + //门店分类要排序下
  2614 + function compare(property) {
  2615 + return function (a, b) {
  2616 + var value1 = a[property];
  2617 + var value2 = b[property];
  2618 + return value1 - value2;
  2619 + }
  2620 + }
  2621 + if (newarr.length > 0)
  2622 + newarr.sort(compare("sort"));
  2623 +
2643 2624
2644 //----安排其他的分类----- 2625 //----安排其他的分类-----
2645 if (qita.length > 0) { 2626 if (qita.length > 0) {
@@ -2650,7 +2631,7 @@ Page({ @@ -2650,7 +2631,7 @@ Page({
2650 }; 2631 };
2651 newarr.push(item); 2632 newarr.push(item);
2652 } 2633 }
2653 - 2634 +
2654 th.setData({ 2635 th.setData({
2655 is_show_sto_cat: 1, 2636 is_show_sto_cat: 1,
2656 all_sto: newarr 2637 all_sto: newarr
@@ -2663,7 +2644,7 @@ Page({ @@ -2663,7 +2644,7 @@ Page({
2663 }); 2644 });
2664 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ 2645 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
2665 if (!th.data.def_pick_store) { 2646 if (!th.data.def_pick_store) {
2666 - th.setData({def_pick_store:e.data.data.pageData[0]}) 2647 + th.setData({ def_pick_store: e.data.data.pageData[0] })
2667 } 2648 }
2668 } 2649 }
2669 } else { 2650 } else {
@@ -2673,13 +2654,13 @@ Page({ @@ -2673,13 +2654,13 @@ Page({
2673 }); 2654 });
2674 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ 2655 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
2675 if (!th.data.def_pick_store) { 2656 if (!th.data.def_pick_store) {
2676 - th.setData({def_pick_store:e.data.data.pageData[0]}) 2657 + th.setData({ def_pick_store: e.data.data.pageData[0] })
2677 } 2658 }
2678 2659
2679 } 2660 }
2680 } 2661 }
2681 }); 2662 });
2682 - } else { 2663 + } else {
2683 th.setData({ 2664 th.setData({
2684 is_show_sto_cat: 0, 2665 is_show_sto_cat: 0,
2685 only_pk: e.data.data.pageData 2666 only_pk: e.data.data.pageData
@@ -2687,7 +2668,7 @@ Page({ @@ -2687,7 +2668,7 @@ Page({
2687 //-----如果没有默认门店,要取第一个门店作为默认店------ 2668 //-----如果没有默认门店,要取第一个门店作为默认店------
2688 if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { 2669 if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) {
2689 th.setData({ 2670 th.setData({
2690 - def_pick_store:e.data.data.pageData[0], 2671 + def_pick_store: e.data.data.pageData[0],
2691 sto_sele_name: e.data.data.pageData[0].pickup_name, 2672 sto_sele_name: e.data.data.pageData[0].pickup_name,
2692 sto_sele_id: e.data.data.pageData[0].pickup_id, 2673 sto_sele_id: e.data.data.pageData[0].pickup_id,
2693 sto_sele_distr: e.data.data.pageData[0].distr_type 2674 sto_sele_distr: e.data.data.pageData[0].distr_type
@@ -2695,66 +2676,66 @@ Page({ @@ -2695,66 +2676,66 @@ Page({
2695 } 2676 }
2696 } 2677 }
2697 }, 2678 },
2698 - 2679 +
2699 //------------处理线下门店库存-------- 2680 //------------处理线下门店库存--------
2700 - deal_pickup_dline(e){  
2701 - var pkno=[],th=this;  
2702 - if(!th.data.sele_g) return false;  
2703 -  
2704 - if(this.data.def_pick_store){ 2681 + deal_pickup_dline(e) {
  2682 + var pkno = [], th = this;
  2683 + if (!th.data.sele_g) return false;
  2684 +
  2685 + if (this.data.def_pick_store) {
2705 pkno.push(this.data.def_pick_store.pickup_no); 2686 pkno.push(this.data.def_pick_store.pickup_no);
2706 } 2687 }
2707 - for(var i in e.data.data.pageData){  
2708 - var item=e.data.data.pageData[i];  
2709 - if(pkno.indexOf(item.pickup_no)<0) 2688 + for (var i in e.data.data.pageData) {
  2689 + var item = e.data.data.pageData[i];
  2690 + if (pkno.indexOf(item.pickup_no) < 0)
2710 pkno.push(item.pickup_no); 2691 pkno.push(item.pickup_no);
2711 } 2692 }
2712 - pkno.sort();  
2713 - var pkno_str=pkno.join(",");  
2714 - var o_plist=e.data.data.pageData;  
2715 - var new_list=[];  
2716 - var is_find_def_store=0; 2693 + pkno.sort();
  2694 + var pkno_str = pkno.join(",");
  2695 + var o_plist = e.data.data.pageData;
  2696 + var new_list = [];
  2697 + var is_find_def_store = 0;
2717 2698
2718 2699
2719 - var g_distr_type=th.data.sele_g.distr_type;  
2720 - var lock=[]; 2700 + var g_distr_type = th.data.sele_g.distr_type;
  2701 + var lock = [];
2721 //先读取门店的lock,采用链式写法,少用await 2702 //先读取门店的lock,采用链式写法,少用await
2722 - getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
2723 - data:{store_id:os.stoid,wareId:th.data.sele_g.goods_id,pageSize:1000}  
2724 - }).then(res=>{  
2725 - if(res.data.code==0 && res.data.data.total>0){  
2726 - lock=res.data.data.pageData 2703 + getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  2704 + data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, pageSize: 1000 }
  2705 + }).then(res => {
  2706 + if (res.data.code == 0 && res.data.data.total > 0) {
  2707 + lock = res.data.data.pageData
2727 } 2708 }
2728 //---通过接口获取门店的线下库存信息-- 2709 //---通过接口获取门店的线下库存信息--
2729 - return getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
2730 - data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000} 2710 + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  2711 + data: { storageNos: pkno_str, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid, pageSize: 2000 }
2731 }) 2712 })
2732 - }).then(res=>{ 2713 + }).then(res => {
2733 2714
2734 - wx.hideLoading();  
2735 - if(res.data.code==0){  
2736 - if(res.data.data.pageData && res.data.data.pageData.length>0){  
2737 - var plist=res.data.data.pageData;  
2738 - var def_pick_store=th.data.def_pick_store; 2715 + wx.hideLoading();
  2716 + if (res.data.code == 0) {
  2717 + if (res.data.data.pageData && res.data.data.pageData.length > 0) {
  2718 + var plist = res.data.data.pageData;
  2719 + var def_pick_store = th.data.def_pick_store;
2739 //以原来的数组为外循环,保证距离的顺序 2720 //以原来的数组为外循环,保证距离的顺序
2740 - for(var kk in o_plist){  
2741 - for(var ii in plist){ 2721 + for (var kk in o_plist) {
  2722 + for (var ii in plist) {
2742 //线下的门店小心 2723 //线下的门店小心
2743 - var n_item=plist[ii];  
2744 - if(n_item.StorageNo==o_plist[kk].pickup_no){ 2724 + var n_item = plist[ii];
  2725 + if (n_item.StorageNo == o_plist[kk].pickup_no) {
2745 2726
2746 //拿到锁库的数量 2727 //拿到锁库的数量
2747 - var lock_num=th.find_lock_num(o_plist[kk].pickup_id,lock); 2728 + var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock);
2748 //可出库数大于预出库库存的数量,可以判断为有库存 2729 //可出库数大于预出库库存的数量,可以判断为有库存
2749 - if(n_item.CanOutQty>lock_num){  
2750 - o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; 2730 + if (n_item.CanOutQty > lock_num) {
  2731 + o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num;
2751 new_list.push(o_plist[kk]); 2732 new_list.push(o_plist[kk]);
2752 //--如果找到默认门店,同时也应该判断配送方式对不对-- 2733 //--如果找到默认门店,同时也应该判断配送方式对不对--
2753 - if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2754 - th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num;  
2755 - if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id)  
2756 - th.setData({def_pick_store:th.data.fir_def_store})  
2757 - is_find_def_store=1; 2734 + if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) {
  2735 + th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num;
  2736 + if (def_pick_store.pickup_id == th.data.fir_def_store.pickup_id)
  2737 + th.setData({ def_pick_store: th.data.fir_def_store })
  2738 + is_find_def_store = 1;
2758 } 2739 }
2759 } 2740 }
2760 break; 2741 break;
@@ -2763,54 +2744,54 @@ Page({ @@ -2763,54 +2744,54 @@ Page({
2763 } 2744 }
2764 2745
2765 //数据组装下 2746 //数据组装下
2766 - var em={};em.data={};em.data.data={};  
2767 - em.data.data.total=new_list.length;  
2768 - em.data.data.pageData=new_list; 2747 + var em = {}; em.data = {}; em.data.data = {};
  2748 + em.data.data.total = new_list.length;
  2749 + em.data.data.pageData = new_list;
2769 2750
2770 //--如果找到默认门店,同时也应该判断配送方式对不对-- 2751 //--如果找到默认门店,同时也应该判断配送方式对不对--
2771 - if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){  
2772 - th.data.fir_def_store.CanOutQty=0; 2752 + if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) {
  2753 + th.data.fir_def_store.CanOutQty = 0;
2773 //--当选择的门店是客户默认的门店的时候-- 2754 //--当选择的门店是客户默认的门店的时候--
2774 - if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) {  
2775 - th.setData({def_pick_store:th.data.fir_def_store}); 2755 + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) {
  2756 + th.setData({ def_pick_store: th.data.fir_def_store });
2776 em.data.data.pageData.unshift(th.data.def_pick_store); 2757 em.data.data.pageData.unshift(th.data.def_pick_store);
2777 - }else{  
2778 - em.data.data.pageData.splice(1,0,th.data.fir_def_store); 2758 + } else {
  2759 + em.data.data.pageData.splice(1, 0, th.data.fir_def_store);
2779 } 2760 }
2780 } 2761 }
2781 2762
2782 //---把数组组装进去--- 2763 //---把数组组装进去---
2783 th.deal_pickup(em); 2764 th.deal_pickup(em);
2784 - }else{  
2785 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null}) 2765 + } else {
  2766 + th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null })
2786 } 2767 }
2787 - }else{  
2788 - th.setData({def_pick_store:null,all_sto:null,only_pk:null,def_pickpu_list:null}) 2768 + } else {
  2769 + th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null })
2789 } 2770 }
2790 }) 2771 })
2791 }, 2772 },
2792 2773
2793 - find_lock_num(pick_id,lock){  
2794 - var lock_num=0;  
2795 - if(!lock) return 0;  
2796 - if(lock.length<0) return 0;  
2797 - for(var i in lock){  
2798 - if(pick_id==lock[i].pickupId){  
2799 - lock_num+=lock[i].outQty; 2774 + find_lock_num(pick_id, lock) {
  2775 + var lock_num = 0;
  2776 + if (!lock) return 0;
  2777 + if (lock.length < 0) return 0;
  2778 + for (var i in lock) {
  2779 + if (pick_id == lock[i].pickupId) {
  2780 + lock_num += lock[i].outQty;
2800 } 2781 }
2801 } 2782 }
2802 return lock_num; 2783 return lock_num;
2803 }, 2784 },
2804 2785
2805 //----------取货门店被点击的效果------ 2786 //----------取货门店被点击的效果------
2806 - getmendian: function(t) { 2787 + getmendian: function (t) {
2807 this.setData({ 2788 this.setData({
2808 ismend: 1, 2789 ismend: 1,
2809 }); 2790 });
2810 }, 2791 },
2811 2792
2812 //----------隐藏取货门店,选取门店---------- 2793 //----------隐藏取货门店,选取门店----------
2813 - hidemend: function(e) { 2794 + hidemend: function (e) {
2814 var pid = e.target.dataset.p_id; 2795 var pid = e.target.dataset.p_id;
2815 var pname = e.target.dataset.p_name; 2796 var pname = e.target.dataset.p_name;
2816 var p_distr_t = e.target.dataset.p_dis; 2797 var p_distr_t = e.target.dataset.p_dis;
@@ -2824,7 +2805,7 @@ Page({ @@ -2824,7 +2805,7 @@ Page({
2824 }, 2805 },
2825 2806
2826 //------显示取货2级---------- 2807 //------显示取货2级----------
2827 - show_sec: function(t) { 2808 + show_sec: function (t) {
2828 var index = t.target.dataset.index; 2809 var index = t.target.dataset.index;
2829 var item = this.data.all_sto[index]; 2810 var item = this.data.all_sto[index];
2830 this.setData({ 2811 this.setData({
@@ -2834,43 +2815,43 @@ Page({ @@ -2834,43 +2815,43 @@ Page({
2834 }, 2815 },
2835 2816
2836 //------隐藏取货门店2级---- 2817 //------隐藏取货门店2级----
2837 - hide_sec_mend: function() { 2818 + hide_sec_mend: function () {
2838 this.setData({ 2819 this.setData({
2839 is_sec_mend: 0, 2820 is_sec_mend: 0,
2840 }); 2821 });
2841 }, 2822 },
2842 2823
2843 //评论的调用 2824 //评论的调用
2844 - requestComments_new: async function(){  
2845 - var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3; 2825 + requestComments_new: async function () {
  2826 + var e = this, th = e, ee = e; var tp = e.data.activeCategoryId3;
2846 var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p; 2827 var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;
2847 2828
2848 wx.showLoading(); 2829 wx.showLoading();
2849 var req_where = { 2830 var req_where = {
2850 - store_id: o.stoid, pageSize: 5,is_show:1, 2831 + store_id: o.stoid, pageSize: 5, is_show: 1,
2851 parent_id: 0, goods_id: th.data.gid, commenttype: tp, 2832 parent_id: 0, goods_id: th.data.gid, commenttype: tp,
2852 } 2833 }
2853 if (getApp().globalData.userInfo) { 2834 if (getApp().globalData.userInfo) {
2854 req_where.userId = getApp().globalData.userInfo.user_id; 2835 req_where.userId = getApp().globalData.userInfo.user_id;
2855 } 2836 }
2856 2837
2857 - var rs_data=null;  
2858 - await getApp().request.promiseGet(t, { data: req_where}).then(res=>{ 2838 + var rs_data = null;
  2839 + await getApp().request.promiseGet(t, { data: req_where }).then(res => {
2859 var tot = res.data.data.total; 2840 var tot = res.data.data.total;
2860 e.data.c_curr_p++; 2841 e.data.c_curr_p++;
2861 e.setData({ 2842 e.setData({
2862 com_num: tot, //已经有加载 2843 com_num: tot, //已经有加载
2863 }); 2844 });
2864 - if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
2865 - rs_data=res.data.data.pageData;  
2866 - }else{  
2867 - th.setData({comments_no_more:1,auto:1}); 2845 + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
  2846 + rs_data = res.data.data.pageData;
  2847 + } else {
  2848 + th.setData({ comments_no_more: 1, auto: 1 });
2868 } 2849 }
2869 }) 2850 })
2870 2851
2871 - if (rs_data){ 2852 + if (rs_data) {
2872 //var cda = th.data.comments; 2853 //var cda = th.data.comments;
2873 - var cda = rs_data,com_data=th.data.comments; 2854 + var cda = rs_data, com_data = th.data.comments;
2874 for (var ind in cda) { 2855 for (var ind in cda) {
2875 var ep = cda[ind]; 2856 var ep = cda[ind];
2876 if (cda[ind].head_pic == '') { 2857 if (cda[ind].head_pic == '') {
@@ -2884,13 +2865,13 @@ Page({ @@ -2884,13 +2865,13 @@ Page({
2884 } 2865 }
2885 2866
2886 //--测量多有字的宽带,计算有多少行-- 2867 //--测量多有字的宽带,计算有多少行--
2887 - var widh=ut.measureText(ep.content,30);  
2888 - var lines=widh/712;  
2889 - cda[ind].seeMore=false;  
2890 - if(lines>3) cda[ind].seeMore=true; 2868 + var widh = ut.measureText(ep.content, 30);
  2869 + var lines = widh / 712;
  2870 + cda[ind].seeMore = false;
  2871 + if (lines > 3) cda[ind].seeMore = true;
2891 2872
2892 await getApp().request.promiseGet("/api/weshop/comment/pageComment", { 2873 await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
2893 - data: {store_id: o.stoid, parent_id: ep.comment_id } 2874 + data: { store_id: o.stoid, parent_id: ep.comment_id }
2894 }).then(res => { 2875 }).then(res => {
2895 if (res.data.data.pageData && res.data.data.pageData.length > 0) { 2876 if (res.data.data.pageData && res.data.data.pageData.length > 0) {
2896 cda[ind].replay_list = res.data.data.pageData; 2877 cda[ind].replay_list = res.data.data.pageData;
@@ -2901,16 +2882,16 @@ Page({ @@ -2901,16 +2882,16 @@ Page({
2901 if (!com_data) com_data = cda; 2882 if (!com_data) com_data = cda;
2902 else com_data = com_data.concat(cda); 2883 else com_data = com_data.concat(cda);
2903 2884
2904 - th.setData({ comments: com_data}); 2885 + th.setData({ comments: com_data });
2905 } 2886 }
2906 - th.setData({get_c: 1}); 2887 + th.setData({ get_c: 1 });
2907 wx.hideLoading(); 2888 wx.hideLoading();
2908 }, 2889 },
2909 2890
2910 //加载更多是靠这个函数 2891 //加载更多是靠这个函数
2911 - onReachBottom: function() {  
2912 - if (this.data.activeCategoryId == 2){  
2913 - if(!this.data.comments_no_more) this.requestComments_new(); 2892 + onReachBottom: function () {
  2893 + if (this.data.activeCategoryId == 2) {
  2894 + if (!this.data.comments_no_more) this.requestComments_new();
2914 } 2895 }
2915 2896
2916 var goods_list = this.selectComponent("#goods_list"); //组件的id 2897 var goods_list = this.selectComponent("#goods_list"); //组件的id
@@ -2920,361 +2901,37 @@ Page({ @@ -2920,361 +2901,37 @@ Page({
2920 //--------检查是否活动,活动是否开始,或者是否结束------- 2901 //--------检查是否活动,活动是否开始,或者是否结束-------
2921 async check_prom(gid, prom_type, prom_id) { 2902 async check_prom(gid, prom_type, prom_id) {
2922 var ee = this, 2903 var ee = this,
2923 - th = ee;  
2924 - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) { 2904 + th = ee;
  2905 + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5 || prom_type == 7) {
2925 this.setData({ 2906 this.setData({
2926 prom_type: 0, 2907 prom_type: 0,
2927 isshow: 1, 2908 isshow: 1,
2928 }); 2909 });
2929 return false; 2910 return false;
2930 - }  
2931 -  
2932 -  
2933 -  
2934 - //if (prom_type != 3 && prom_type!=0){  
2935 - //---判断秒杀----  
2936 - if (prom_type == 1) {  
2937 - //-------判断活动是否抢光---------  
2938 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
2939 - 1: 1  
2940 - }).then(res => {  
2941 - var em = res;  
2942 - if (em.data.code == 0) {  
2943 -  
2944 - if (em.data.data <= 0) ee.setData({  
2945 - prom_r_null: 1  
2946 - });  
2947 - //拿取价格并且判断时间--  
2948 - getApp().request.get("/api/ms/flash_sale/get/" +  
2949 - os.stoid + "/" + prom_id, {  
2950 - success: function(t) {  
2951 - if (t.data.code != 0) {  
2952 - ee.setData({  
2953 - prom_type: 0,  
2954 - isshow: 1,  
2955 - });  
2956 - ee.get_sku(os.stoid, ee.data.data, gid);  
2957 - return false;  
2958 - }  
2959 - //----已经结束-----  
2960 - if (t.data.data.is_end == 1) {  
2961 - ee.setData({  
2962 - prom_type: 0,  
2963 - isshow: 1,  
2964 - });  
2965 - ee.get_sku(os.stoid, ee.data.data, gid);  
2966 - ee.get_sto();  
2967 - return false;  
2968 - }  
2969 - //----已经过期-----  
2970 - var now = ut.gettimestamp();  
2971 - if (t.data.data.end_time < now) {  
2972 - ee.setData({  
2973 - prom_type: 0,  
2974 - isshow: 1,  
2975 - });  
2976 - ee.get_sku(os.stoid, ee.data.data, gid);  
2977 - return false;  
2978 - }  
2979 -  
2980 - /*-- 还没有开始预热的也不显示 --*/  
2981 - if (t.data.data.show_time > now) {  
2982 - ee.setData({  
2983 - prom_type: 0,  
2984 - isshow: 1,  
2985 - });  
2986 - ee.get_sku(os.stoid, ee.data.data, gid);  
2987 - ee.get_sto();  
2988 - return false;  
2989 - }  
2990 -  
2991 - var t_gd = ee.data.data;  
2992 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
2993 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
2994 -  
2995 - ee.setData({  
2996 - prom_price: t.data.data.price,  
2997 - prom_type: 1,  
2998 - prom_id: prom_id,  
2999 - prom_buy_limit: t.data.data.buy_limit,  
3000 - prom_act: t.data.data,  
3001 - prom_end_time: prom_end_time,  
3002 - prom_start_time: prom_start_time,  
3003 - isshow: 1,  
3004 - });  
3005 -  
3006 - ee.get_sto();  
3007 -  
3008 -  
3009 - var newTime = ut.gettimestamp();  
3010 - var endTime2 = t.data.data.end_time;  
3011 - var endTime1 = t.data.data.start_time;  
3012 -  
3013 - //---苹果机不兼容---  
3014 - /*----  
3015 - var endTime2 = new Date(prom_end_time).getTime();  
3016 - var endTime1 = new Date(prom_start_time).getTime();----*/  
3017 -  
3018 - if (endTime1 > newTime) {  
3019 - ee.setData({  
3020 - prom_time_text: '距秒杀开始还有'  
3021 - })  
3022 - ee.countDown(endTime1, 0);  
3023 - } else {  
3024 - if (endTime2 > newTime) {  
3025 - ee.setData({  
3026 - prom_time_text: '距秒杀结束还有',  
3027 - prom_st: 1  
3028 - })  
3029 - ee.countDown(endTime2);  
3030 - }  
3031 - }  
3032 - }  
3033 - });  
3034 - }  
3035 - })  
3036 - }  
3037 -  
3038 - if(prom_type==4){  
3039 - //th.setData({is_integral_normal:1});  
3040 - var rdata={  
3041 - store_id:o.stoid,stype:1,stypeup:1,goods_id:gid  
3042 - }  
3043 -  
3044 - var integrals=0;  
3045 - var get_datas= {  
3046 - user_id:getApp().globalData.user_id, store_id:o.stoid,  
3047 - };  
3048 - await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {  
3049 - data: get_datas  
3050 - }).then(res => {  
3051 - if(res.data.code==0){  
3052 - integrals=res.data.data.Integral;  
3053 - }  
3054 - })  
3055 -  
3056 - //获取一下积分活动  
3057 - await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {  
3058 - data: rdata  
3059 - }).then(res => {  
3060 - //调用接口有数据的时候  
3061 - if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {  
3062 - var inte_data=res.data.data.pageData[0];  
3063 - var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));  
3064 - ee.setData({  
3065 - prom_price:parseFloat(inte_data.addmoney),  
3066 - prom_integral:parseFloat(inte_data.integral),  
3067 - prom_type: 4,  
3068 - prom_id: inte_data.id,  
3069 - prom_buy_limit: inte_data.limitvipqty,  
3070 - prom_act: inte_data,  
3071 - isshow: 1,  
3072 - can_integral:can_integral,  
3073 - is_shopbuy: parseInt(inte_data.is_shopbuy?inte_data.is_shopbuy:0)  
3074 - });  
3075 - ee.get_sto();  
3076 -  
3077 - }else{  
3078 - ee.setData({prom_type: 0, isshow: 1,});  
3079 - ee.get_sku(os.stoid, ee.data.data, gid);  
3080 - ee.get_sto();  
3081 - return false;  
3082 - }  
3083 - })  
3084 -  
3085 - }  
3086 -  
3087 -  
3088 - //---判断拼单----  
3089 - if (prom_type == 6) {  
3090 - //-------判断活动是否抢光---------  
3091 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {  
3092 - 1: 1  
3093 - }).then(res => {  
3094 - var em = res;  
3095 - if (em.data.code == 0) {  
3096 -  
3097 -  
3098 - if (em.data.data <= 0) ee.setData({  
3099 - prom_r_null: 1  
3100 - });  
3101 - //拿取价格并且判断时间--  
3102 - getApp().request.get("/api/weshop/teamlist/get/" +  
3103 - os.stoid + "/" + prom_id, {  
3104 - success: function(t) {  
3105 - if (t.data.code != 0) {  
3106 - ee.setData({  
3107 - prom_type: 0,  
3108 - isshow: 1,  
3109 - });  
3110 - ee.get_sku(os.stoid, ee.data.data, gid);  
3111 - ee.get_sto();  
3112 - return false;  
3113 - }  
3114 - //----已经结束-----  
3115 - if (t.data.data.is_end == 1) {  
3116 - ee.setData({  
3117 - prom_type: 0,  
3118 - isshow: 1,  
3119 - });  
3120 - ee.get_sku(os.stoid, ee.data.data, gid);  
3121 - return false;  
3122 - }  
3123 - //----已经过期-----  
3124 - var now = ut.gettimestamp();  
3125 - if (t.data.data.end_time < now) {  
3126 - ee.setData({  
3127 - prom_type: 0,  
3128 - isshow: 1,  
3129 - });  
3130 - ee.get_sku(os.stoid, ee.data.data, gid);  
3131 - ee.get_sto();  
3132 - return false;  
3133 - }  
3134 -  
3135 - /*-- 还没有开始预热的也不显示 --*/  
3136 - if (t.data.data.show_time > now) {  
3137 - ee.setData({  
3138 - prom_type: 0,  
3139 - isshow: 1,  
3140 - });  
3141 - ee.get_sku(os.stoid, ee.data.data, gid);  
3142 - ee.get_sto();  
3143 - return false;  
3144 - }  
3145 -  
3146 - //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中-------  
3147 - getApp().request.get("/api/weshop/order/page", {  
3148 - data: {  
3149 - pt_prom_id: prom_id,  
3150 - user_id: oo.user_id,  
3151 - store_id: os.stoid,  
3152 - pageSize: 1,  
3153 - page: 1  
3154 - },  
3155 - success: function(e) {  
3156 - if (e.data.code == 0 && e.data.data.pageData.length > 0) {  
3157 - var odr = e.data.data.pageData[0];  
3158 - th.data.buy_order = odr;  
3159 - if (odr.pt_status == 0 && odr.order_status == 1) {  
3160 - th.setData({  
3161 - user_order_pt_state: 1  
3162 - });  
3163 - }  
3164 - if (odr.pt_status == 1 && odr.order_status == 1) {  
3165 - if (odr.is_zsorder == 4) {  
3166 - getApp().request.promiseGet("/api/weshop/teamgroup/page/", {  
3167 - data: {  
3168 - store_id: os.stoid,  
3169 - team_id: odr.pt_prom_id,  
3170 - listno: odr.pt_listno  
3171 - }  
3172 - }).then(res => {  
3173 - var now = ut.gettimestamp();  
3174 - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){  
3175 - var tgr = res.data.data.pageData[0];  
3176 - //如果团的时间已经到了  
3177 - if (now >= tgr.kt_end_time) {  
3178 - th.update_jiti(tgr.id);  
3179 - } else {  
3180 - th.setData({  
3181 - user_order_pt_state: 2  
3182 - });  
3183 - }  
3184 - }  
3185 - })  
3186 -  
3187 - } else {  
3188 - th.setData({  
3189 - user_order_pt_state: 2  
3190 - });  
3191 - }  
3192 - }  
3193 -  
3194 - if (odr.pt_status == 2 && odr.is_zsorder == 4) {  
3195 - th.setData({  
3196 - user_order_pt_state: 3,  
3197 - });  
3198 - th.data.wk_order_id = odr.order_id;  
3199 - }  
3200 - }  
3201 - },  
3202 - });  
3203 -  
3204 - //----------查看阶梯团------------  
3205 - if (t.data.data.ct_rylist != "null" && t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {  
3206 - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);  
3207 - var max_num = 0;  
3208 - t.data.data.ct_rylist.forEach(function(val, ind) {  
3209 - if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum);  
3210 - })  
3211 - t.data.data.max_ct_num = max_num;  
3212 - }  
3213 -  
3214 - var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");  
3215 - var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");  
3216 - ee.setData({  
3217 - prom_price: t.data.data.price,  
3218 - prom_type: 6,  
3219 - prom_id: prom_id,  
3220 - prom_buy_limit: t.data.data.buy_limit,  
3221 - prom_act: t.data.data,  
3222 - prom_end_time: prom_end_time,  
3223 - prom_start_time: prom_start_time,  
3224 - isshow: 1,  
3225 - });  
3226 -  
3227 - ee.get_sto();  
3228 -  
3229 - var newTime = now;  
3230 - var endTime2 = t.data.data.end_time;  
3231 - var endTime1 = t.data.data.start_time;  
3232 -  
3233 - if (endTime1 > newTime) {  
3234 - ee.setData({  
3235 - prom_time_text: '距拼单开始还剩:'  
3236 - })  
3237 - ee.countDown(endTime1, 0);  
3238 - } else {  
3239 - if (endTime2 > newTime) {  
3240 - ee.setData({  
3241 - prom_time_text: '距拼单结束还剩:',  
3242 - prom_st: 1  
3243 - })  
3244 - ee.countDown(endTime2);  
3245 - }  
3246 - }  
3247 - //-------查看有多少人在开这个团-------  
3248 - th.get_team_group(prom_id);  
3249 - }  
3250 - });  
3251 - }  
3252 - })  
3253 - }  
3254 - 2911 + }
3255 }, 2912 },
3256 2913
3257 //--获取有多少人在开团-- 2914 //--获取有多少人在开团--
3258 async get_team_group(prom_id) { 2915 async get_team_group(prom_id) {
3259 var teamgroup = [], 2916 var teamgroup = [],
3260 - th = this,  
3261 - grounp_tatal = 0; 2917 + th = this,
  2918 + grounp_tatal = 0;
3262 //如果活动是开团不是商家团 2919 //如果活动是开团不是商家团
3263 if (this.data.prom_act.kttype > 1) { 2920 if (this.data.prom_act.kttype > 1) {
3264 -  
3265 - var req_data={  
3266 - store_id: os.stoid,  
3267 - pageSize: 3,  
3268 - page: 1,  
3269 - state: 2,  
3270 - team_id: prom_id,  
3271 - ordernum:1  
3272 - };  
3273 -  
3274 - if(this.data.prom_act.kttype==3 && this.data.prom_act.max_ct_num ){  
3275 - req_data.max_num=this.data.prom_act.max_ct_num;  
3276 - }  
3277 - 2921 +
  2922 + var req_data = {
  2923 + store_id: os.stoid,
  2924 + pageSize: 3,
  2925 + page: 1,
  2926 + state: 2,
  2927 + team_id: prom_id,
  2928 + ordernum: 1
  2929 + };
  2930 +
  2931 + if (this.data.prom_act.kttype == 3 && this.data.prom_act.max_ct_num) {
  2932 + req_data.max_num = this.data.prom_act.max_ct_num;
  2933 + }
  2934 +
3278 //获取活动从表信息team_id 2935 //获取活动从表信息team_id
3279 await getApp().request.promiseGet("/api/weshop/teamgroup/page", { 2936 await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
3280 data: req_data 2937 data: req_data
@@ -3346,7 +3003,7 @@ Page({ @@ -3346,7 +3003,7 @@ Page({
3346 prom_time_text: '距结束还剩:', 3003 prom_time_text: '距结束还剩:',
3347 prom_st: 1 3004 prom_st: 1
3348 }) 3005 })
3349 - setTimeout(function() { 3006 + setTimeout(function () {
3350 th.countDown(endTime2) 3007 th.countDown(endTime2)
3351 }, 1000); 3008 }, 1000);
3352 return false; 3009 return false;
@@ -3373,17 +3030,17 @@ Page({ @@ -3373,17 +3030,17 @@ Page({
3373 th.setData({ 3030 th.setData({
3374 djs: obj 3031 djs: obj
3375 }); 3032 });
3376 - setTimeout(function() { 3033 + setTimeout(function () {
3377 th.countDown(endTime) 3034 th.countDown(endTime)
3378 }, 1000); 3035 }, 1000);
3379 }, 3036 },
3380 3037
3381 3038
3382 //-------------获取购买数量的总函数---------------- 3039 //-------------获取购买数量的总函数----------------
3383 - get_buy_num: function(gd, func) { 3040 + get_buy_num: function (gd, func) {
3384 var map = this.data.g_buy_num, 3041 var map = this.data.g_buy_num,
3385 - th = this,  
3386 - user_id = getApp().globalData.user_id; 3042 + th = this,
  3043 + user_id = getApp().globalData.user_id;
3387 if (user_id == null) { 3044 if (user_id == null) {
3388 map.set(gd.goods_id, 0); 3045 map.set(gd.goods_id, 0);
3389 th.setData({ 3046 th.setData({
@@ -3404,7 +3061,7 @@ Page({ @@ -3404,7 +3061,7 @@ Page({
3404 user_id: user_id, 3061 user_id: user_id,
3405 goods_id: gd.goods_id 3062 goods_id: gd.goods_id
3406 }, 3063 },
3407 - success: function(t) { 3064 + success: function (t) {
3408 if (t.data.code == 0) { 3065 if (t.data.code == 0) {
3409 var g_buy_num = t.data.data.goodsbuynum; 3066 var g_buy_num = t.data.data.goodsbuynum;
3410 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) { 3067 if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
@@ -3418,7 +3075,7 @@ Page({ @@ -3418,7 +3075,7 @@ Page({
3418 prom_id: gd.prom_id 3075 prom_id: gd.prom_id
3419 }, 3076 },
3420 //-----获取----- 3077 //-----获取-----
3421 - success: function(tt) { 3078 + success: function (tt) {
3422 if (tt.data.code == 0) { 3079 if (tt.data.code == 0) {
3423 map.set(gd.goods_id, g_buy_num); 3080 map.set(gd.goods_id, g_buy_num);
3424 th.setData({ 3081 th.setData({
@@ -3443,7 +3100,7 @@ Page({ @@ -3443,7 +3100,7 @@ Page({
3443 }, 3100 },
3444 3101
3445 //--拼单推荐的显示--- 3102 //--拼单推荐的显示---
3446 - tj_Click: function(e) { 3103 + tj_Click: function (e) {
3447 var ind = parseInt(e.target.dataset.ind); 3104 var ind = parseInt(e.target.dataset.ind);
3448 this.setData({ 3105 this.setData({
3449 is_show_gz: ind 3106 is_show_gz: ind
@@ -3451,113 +3108,20 @@ Page({ @@ -3451,113 +3108,20 @@ Page({
3451 }, 3108 },
3452 3109
3453 //--------拼团玩法显示详情-------- 3110 //--------拼团玩法显示详情--------
3454 - show_pt_xx: function(e) { 3111 + show_pt_xx: function (e) {
3455 this.setData({ 3112 this.setData({
3456 pd_xx: 1, 3113 pd_xx: 1,
3457 }) 3114 })
3458 }, 3115 },
3459 - close_pt_xx: function() { 3116 + close_pt_xx: function () {
3460 this.setData({ 3117 this.setData({
3461 pd_xx: 0, 3118 pd_xx: 0,
3462 }) 3119 })
3463 }, 3120 },
3464 3121
3465 - //--点击弹起拼单--  
3466 - openSpecModel_pt: function(e) {  
3467 -  
3468 -  
3469 - this.setData({ open_ind_store: 4,goodsInputNum:1});//拼团直接给4  
3470 -  
3471 -  
3472 - //--先判断会员状态--  
3473 - var user_info = getApp().globalData.userInfo;  
3474 - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {  
3475 - wx.navigateTo({  
3476 - url: '/pages/togoin/togoin',  
3477 - })  
3478 - return false;  
3479 - }  
3480 -  
3481 - var th = this;  
3482 - var ind = parseInt(e.currentTarget.dataset.it);  
3483 - //如果是拼单活动的普通购买  
3484 - if (ind == 1) {  
3485 - //如果拼单的sku data是空的,就要先获取一下  
3486 - if (th.data.sku_g_pt) {  
3487 - th.get_sto(1);  
3488 - th.setData({  
3489 - is_normal: ind,  
3490 - openSpecModal_pt: 1  
3491 - });  
3492 - } else {  
3493 - th.get_sto(1);  
3494 - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function() {  
3495 - th.setData({  
3496 - is_normal: ind,  
3497 - openSpecModal_pt: 1  
3498 - });  
3499 - });  
3500 - }  
3501 - th.check_is_youhui(th.data.gid,1);  
3502 - } else {  
3503 -  
3504 - //拼单商品从这里进,先判断有没有买过商品,  
3505 - getApp().request.get("/api/weshop/order/page", {  
3506 - data: {  
3507 - pt_prom_id: th.data.prom_act.id,  
3508 - user_id: oo.user_id,  
3509 - store_id: os.stoid,  
3510 - pageSize: 1,  
3511 - page: 1  
3512 - },  
3513 - success: function(e) {  
3514 - //--跳转到已经购买的情况--  
3515 - if (e.data.data.pageData.length > 0) {  
3516 - var odr = e.data.data.pageData[0];  
3517 - //还未支付  
3518 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {  
3519 - wx.showModal({  
3520 - title: "您已经购买了该商品待支付中",  
3521 - success: function(a) {  
3522 - if (a.confirm) {  
3523 - wx.navigateTo({  
3524 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
3525 - });  
3526 - }  
3527 - }  
3528 - });  
3529 - } else if (odr.pt_status == 1 && odr.order_status == 1) {  
3530 -  
3531 - if(this.data.is_go_to_team_show) return false;  
3532 - this.data.is_go_to_team_show=1;  
3533 - wx.showLoading();  
3534 -  
3535 - /*---  
3536 - wx.redirectTo({  
3537 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3538 - });--*/  
3539 - getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);  
3540 -  
3541 - } else {  
3542 - th.setData({  
3543 - is_normal: ind,  
3544 - openSpecModal_pt: 1  
3545 - });  
3546 - }  
3547 -  
3548 - } else {  
3549 - th.setData({  
3550 - is_normal: ind,  
3551 - openSpecModal_pt: 1  
3552 - });  
3553 - }  
3554 - }  
3555 - });  
3556 - }  
3557 - },  
3558 3122
3559 //-----------------拼单生成方法--------------------- 3123 //-----------------拼单生成方法---------------------
3560 - addCart_pt: function() { 3124 + addCart_pt: function () {
3561 var th = this; 3125 var th = this;
3562 if (this.data.is_normal == 0) { 3126 if (this.data.is_normal == 0) {
3563 //看一下有没有起购数,如果有起购数,要计算起购数 3127 //看一下有没有起购数,如果有起购数,要计算起购数
@@ -3573,18 +3137,18 @@ Page({ @@ -3573,18 +3137,18 @@ Page({
3573 } 3137 }
3574 }, 3138 },
3575 3139
3576 - addcart_pt_func: function() { 3140 + addcart_pt_func: function () {
3577 if (oo.user_id == null) { 3141 if (oo.user_id == null) {
3578 s.my_warnning("还未登录!", 0, this); 3142 s.my_warnning("还未登录!", 0, this);
3579 return; 3143 return;
3580 } 3144 }
3581 var e = this, 3145 var e = this,
3582 - th = e,  
3583 - o = this.data.sele_g; 3146 + th = e,
  3147 + o = this.data.sele_g;
3584 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); 3148 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
3585 3149
3586 //----------添加到购物车时,要判断限购数量,-------- 3150 //----------添加到购物车时,要判断限购数量,--------
3587 - e.get_buy_num(o, async function(ee) { 3151 + e.get_buy_num(o, async function (ee) {
3588 3152
3589 //---判断商品是否超出限购--- 3153 //---判断商品是否超出限购---
3590 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 3154 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
@@ -3594,30 +3158,30 @@ Page({ @@ -3594,30 +3158,30 @@ Page({
3594 content: '超出商品限购' 3158 content: '超出商品限购'
3595 }); 3159 });
3596 3160
3597 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3598 - if(num<0) num=0;  
3599 - th.setData({goodsInputNum:num}) 3161 + var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  3162 + if (num < 0) num = 0;
  3163 + th.setData({ goodsInputNum: num })
3600 return false; 3164 return false;
3601 } 3165 }
3602 } 3166 }
3603 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- 3167 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
3604 - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal!=1) { 3168 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) {
3605 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { 3169 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
3606 wx.showModal({ 3170 wx.showModal({
3607 title: '提示', 3171 title: '提示',
3608 content: '超出商品活动限购' 3172 content: '超出商品活动限购'
3609 }); 3173 });
3610 3174
3611 - var num=th.data.prom_buy_limit-th.data.prom_buy_num;  
3612 - if(num<0) num=0;  
3613 - th.setData({goodsInputNum:num}) 3175 + var num = th.data.prom_buy_limit - th.data.prom_buy_num;
  3176 + if (num < 0) num = 0;
  3177 + th.setData({ goodsInputNum: num })
3614 return false; 3178 return false;
3615 } 3179 }
3616 } 3180 }
3617 3181
3618 var redis_num = 0 3182 var redis_num = 0
3619 //不是普通购买的时候 3183 //不是普通购买的时候
3620 - if(th.data.is_normal!=1){ 3184 + if (th.data.is_normal != 1) {
3621 //-------判断活动是否抢光--------- 3185 //-------判断活动是否抢光---------
3622 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { 3186 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {
3623 1: 1 3187 1: 1
@@ -3631,7 +3195,7 @@ Page({ @@ -3631,7 +3195,7 @@ Page({
3631 content: '超出商品活动库存' 3195 content: '超出商品活动库存'
3632 }); 3196 });
3633 3197
3634 - th.setData({goodsInputNum:redis_num}) 3198 + th.setData({ goodsInputNum: redis_num })
3635 3199
3636 return false; 3200 return false;
3637 } 3201 }
@@ -3639,7 +3203,7 @@ Page({ @@ -3639,7 +3203,7 @@ Page({
3639 3203
3640 if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); 3204 if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
3641 if (th.data.goodsInputNum > o.store_count) { 3205 if (th.data.goodsInputNum > o.store_count) {
3642 - th.setData({goodsInputNum:o.store_count}) 3206 + th.setData({ goodsInputNum: o.store_count })
3643 return s.my_warnning("超出商品库存", 0, th); 3207 return s.my_warnning("超出商品库存", 0, th);
3644 } 3208 }
3645 3209
@@ -3662,42 +3226,42 @@ Page({ @@ -3662,42 +3226,42 @@ Page({
3662 }; 3226 };
3663 3227
3664 //---是不是从收藏夹出来的--- 3228 //---是不是从收藏夹出来的---
3665 - if(th.data.c_guide_id){ 3229 + if (th.data.c_guide_id) {
3666 newd['guide_id'] = th.data.c_guide_id; 3230 newd['guide_id'] = th.data.c_guide_id;
3667 - newd['guide_type']=2; 3231 + newd['guide_type'] = 2;
3668 3232
3669 - }else{  
3670 - if(getApp().globalData.guide_id){ 3233 + } else {
  3234 + if (getApp().globalData.guide_id) {
3671 newd['guide_id'] = getApp().globalData.guide_id; 3235 newd['guide_id'] = getApp().globalData.guide_id;
3672 - newd['guide_type']=0; 3236 + newd['guide_type'] = 0;
3673 3237
3674 } 3238 }
3675 } 3239 }
3676 3240
3677 //让商品带上房间号 3241 //让商品带上房间号
3678 - if(th.data.sys_switch.is_skuroom_id==1){  
3679 - if(th.data.data.goods_id==getApp().globalData.room_goods_id){  
3680 - newd.room_id=getApp().globalData.room_id; 3242 + if (th.data.sys_switch.is_skuroom_id == 1) {
  3243 + if (th.data.data.goods_id == getApp().globalData.room_goods_id) {
  3244 + newd.room_id = getApp().globalData.room_id;
3681 } 3245 }
3682 - }else{  
3683 - if(newd.goods_id==getApp().globalData.room_goods_id){  
3684 - newd.room_id=getApp().globalData.room_id; 3246 + } else {
  3247 + if (newd.goods_id == getApp().globalData.room_goods_id) {
  3248 + newd.room_id = getApp().globalData.room_id;
3685 } 3249 }
3686 } 3250 }
3687 3251
3688 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 3252 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
3689 3253
3690 - if(th.data.is_normal == 1){  
3691 - var conf=th.data.bconfig;  
3692 - if(conf.switch_list){  
3693 - var s_list=JSON.parse(conf.switch_list); 3254 + if (th.data.is_normal == 1) {
  3255 + var conf = th.data.bconfig;
  3256 + if (conf.switch_list) {
  3257 + var s_list = JSON.parse(conf.switch_list);
3694 //如果后台有开启等级价的功能 3258 //如果后台有开启等级价的功能
3695 - if(parseInt(s_list.rank_switch)==2){  
3696 - var card_price=o[getApp().globalData.userInfo['card_field']]; 3259 + if (parseInt(s_list.rank_switch) == 2) {
  3260 + var card_price = o[getApp().globalData.userInfo['card_field']];
3697 //如果会员有等级价 3261 //如果会员有等级价
3698 - if(getApp().globalData.userInfo['card_field']!=undefined && getApp().globalData.userInfo['card_field']!=null  
3699 - && getApp().globalData.userInfo['card_field']!="" && card_price>0){  
3700 - newd.goods_price=card_price; 3262 + if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null
  3263 + && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) {
  3264 + newd.goods_price = card_price;
3701 } 3265 }
3702 } 3266 }
3703 } 3267 }
@@ -3705,7 +3269,7 @@ Page({ @@ -3705,7 +3269,7 @@ Page({
3705 3269
3706 3270
3707 //-----如果是秒杀,团购,积分购,拼团,且不是普通购买----- 3271 //-----如果是秒杀,团购,积分购,拼团,且不是普通购买-----
3708 - if (th.data.prom_type == 6 && th.data.is_normal!= 1) { 3272 + if (th.data.prom_type == 6 && th.data.is_normal != 1) {
3709 newd.goods_price = th.data.prom_price; 3273 newd.goods_price = th.data.prom_price;
3710 newd.prom_type = th.data.prom_type; 3274 newd.prom_type = th.data.prom_type;
3711 newd.prom_id = th.data.prom_id; 3275 newd.prom_id = th.data.prom_id;
@@ -3727,23 +3291,23 @@ Page({ @@ -3727,23 +3291,23 @@ Page({
3727 newd['pick_name'] = th.data.sto_sele_name; 3291 newd['pick_name'] = th.data.sto_sele_name;
3728 newd['pick_dis'] = th.data.sto_sele_distr; 3292 newd['pick_dis'] = th.data.sto_sele_distr;
3729 newd['is_normal'] = th.data.is_normal; 3293 newd['is_normal'] = th.data.is_normal;
3730 -  
3731 - if(newd['is_normal']){  
3732 - newd['is_pd_normal']=1;  
3733 - //判断一下有没有全局优惠活动  
3734 - th.check_nor_promgood(newd.goods_id,function(e){  
3735 - if(e && e.act_id){  
3736 - newd['prom_type']=3;  
3737 - newd['prom_id']=e.act_id;  
3738 - }  
3739 - th.buyNow(newd)  
3740 - })  
3741 - } 3294 +
  3295 + if (newd['is_normal']) {
  3296 + newd['is_pd_normal'] = 1;
  3297 + //判断一下有没有全局优惠活动
  3298 + th.check_nor_promgood(newd.goods_id, function (e) {
  3299 + if (e && e.act_id) {
  3300 + newd['prom_type'] = 3;
  3301 + newd['prom_id'] = e.act_id;
  3302 + }
  3303 + th.buyNow(newd)
  3304 + })
  3305 + }
3742 else th.buyNow_pt(newd); 3306 else th.buyNow_pt(newd);
3743 }) 3307 })
3744 }, 3308 },
3745 //----------立即购买_pt----------- 3309 //----------立即购买_pt-----------
3746 - buyNow_pt: function(e) { 3310 + buyNow_pt: function (e) {
3747 s.set_b_now(e); 3311 s.set_b_now(e);
3748 wx.navigateTo({ 3312 wx.navigateTo({
3749 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id, 3313 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id,
@@ -3751,27 +3315,27 @@ Page({ @@ -3751,27 +3315,27 @@ Page({
3751 }, 3315 },
3752 3316
3753 //-------跳转pt商品------- 3317 //-------跳转pt商品-------
3754 - go_to_nopay: function() {  
3755 - var th = this;  
3756 - url="/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;  
3757 - getApp().goto(url);  
3758 - 3318 + go_to_nopay: function () {
  3319 + var th = this;
  3320 + url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id;
  3321 + getApp().goto(url);
  3322 +
3759 }, 3323 },
3760 //-------跳转pt teamshow------- 3324 //-------跳转pt teamshow-------
3761 - go_to_team_show: function() {  
3762 -  
3763 - if(this.data.is_go_to_team_show) return false;  
3764 - this.data.is_go_to_team_show=1;  
3765 - wx.showLoading();  
3766 -  
3767 - var th = this;  
3768 - var url="/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;  
3769 - /*--  
3770 - wx.redirectTo({  
3771 - url:url,  
3772 - })--*/  
3773 - getApp().goto(url);  
3774 - 3325 + go_to_team_show: function () {
  3326 +
  3327 + if (this.data.is_go_to_team_show) return false;
  3328 + this.data.is_go_to_team_show = 1;
  3329 + wx.showLoading();
  3330 +
  3331 + var th = this;
  3332 + var url = "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn;
  3333 + /*--
  3334 + wx.redirectTo({
  3335 + url:url,
  3336 + })--*/
  3337 + getApp().goto(url);
  3338 +
3775 }, 3339 },
3776 3340
3777 //---拼团倒计时--- 3341 //---拼团倒计时---
@@ -3816,7 +3380,7 @@ Page({ @@ -3816,7 +3380,7 @@ Page({
3816 setTimeout(th.countDown2, 1000); 3380 setTimeout(th.countDown2, 1000);
3817 }, 3381 },
3818 //跳转参加团 3382 //跳转参加团
3819 - go_cj_team: function(e) { 3383 + go_cj_team: function (e) {
3820 var ind = e.currentTarget.dataset.ind; 3384 var ind = e.currentTarget.dataset.ind;
3821 var item = this.data.teamgroup[ind]; 3385 var item = this.data.teamgroup[ind];
3822 var id = item.id; 3386 var id = item.id;
@@ -3830,7 +3394,7 @@ Page({ @@ -3830,7 +3394,7 @@ Page({
3830 pageSize: 1, 3394 pageSize: 1,
3831 page: 1 3395 page: 1
3832 }, 3396 },
3833 - success: function(e) { 3397 + success: function (e) {
3834 if (e.data.code != 0) { 3398 if (e.data.code != 0) {
3835 getApp().my_warnning("读取订单失败", 0, th); 3399 getApp().my_warnning("读取订单失败", 0, th);
3836 return fasle; 3400 return fasle;
@@ -3842,7 +3406,7 @@ Page({ @@ -3842,7 +3406,7 @@ Page({
3842 if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { 3406 if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
3843 wx.showModal({ 3407 wx.showModal({
3844 title: "您已经购买了该商品待支付中", 3408 title: "您已经购买了该商品待支付中",
3845 - success: function(a) { 3409 + success: function (a) {
3846 if (a.confirm) { 3410 if (a.confirm) {
3847 wx.navigateTo({ 3411 wx.navigateTo({
3848 url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, 3412 url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
@@ -3851,16 +3415,16 @@ Page({ @@ -3851,16 +3415,16 @@ Page({
3851 } 3415 }
3852 }); 3416 });
3853 } else if (odr.pt_status == 1 && odr.order_status == 1) { 3417 } else if (odr.pt_status == 1 && odr.order_status == 1) {
3854 -  
3855 - if(this.data.is_go_to_team_show) return false;  
3856 - this.data.is_go_to_team_show=1;  
3857 - wx.showLoading();  
3858 - /*--  
3859 - wx.redirectTo({  
3860 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
3861 - });--*/  
3862 3418
3863 - getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn); 3419 + if (this.data.is_go_to_team_show) return false;
  3420 + this.data.is_go_to_team_show = 1;
  3421 + wx.showLoading();
  3422 + /*--
  3423 + wx.redirectTo({
  3424 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3425 + });--*/
  3426 +
  3427 + getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
3864 3428
3865 } else { 3429 } else {
3866 wx.navigateTo({ 3430 wx.navigateTo({
@@ -3880,7 +3444,7 @@ Page({ @@ -3880,7 +3444,7 @@ Page({
3880 }, 3444 },
3881 3445
3882 //跳到团更多 3446 //跳到团更多
3883 - go_t_more: function() { 3447 + go_t_more: function () {
3884 var team_id = this.data.prom_id; 3448 var team_id = this.data.prom_id;
3885 wx.navigateTo({ 3449 wx.navigateTo({
3886 url: "/pages/team/team_more/team_more?team_id=" + team_id, 3450 url: "/pages/team/team_more/team_more?team_id=" + team_id,
@@ -3888,11 +3452,11 @@ Page({ @@ -3888,11 +3452,11 @@ Page({
3888 }, 3452 },
3889 3453
3890 //--点赞功能-- 3454 //--点赞功能--
3891 - click_zan: function(e) { 3455 + click_zan: function (e) {
3892 var com_id = e.currentTarget.dataset.com_id; 3456 var com_id = e.currentTarget.dataset.com_id;
3893 var item_id = e.currentTarget.dataset.item_id; 3457 var item_id = e.currentTarget.dataset.item_id;
3894 var app = getApp(), 3458 var app = getApp(),
3895 - th = this; 3459 + th = this;
3896 3460
3897 if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) { 3461 if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {
3898 app.confirmBox("您还未登录"); 3462 app.confirmBox("您还未登录");
@@ -3911,7 +3475,7 @@ Page({ @@ -3911,7 +3475,7 @@ Page({
3911 goods_id: th.data.gid, 3475 goods_id: th.data.gid,
3912 comment_id: com_id 3476 comment_id: com_id
3913 }, 3477 },
3914 - success: function(ee) { 3478 + success: function (ee) {
3915 3479
3916 if (ee.data.code == "-1") { 3480 if (ee.data.code == "-1") {
3917 app.my_warnning("不能给自己点赞", 0, th); 3481 app.my_warnning("不能给自己点赞", 0, th);
@@ -3940,7 +3504,7 @@ Page({ @@ -3940,7 +3504,7 @@ Page({
3940 th.setData(_errObj); 3504 th.setData(_errObj);
3941 } 3505 }
3942 3506
3943 - setTimeout(function() { 3507 + setTimeout(function () {
3944 th.data.iszaning = 0; 3508 th.data.iszaning = 0;
3945 }, 500) 3509 }, 500)
3946 3510
@@ -3949,7 +3513,7 @@ Page({ @@ -3949,7 +3513,7 @@ Page({
3949 }, 3513 },
3950 3514
3951 /*----券的开关---*/ 3515 /*----券的开关---*/
3952 - switchCoupon: async function(event) { 3516 + switchCoupon: async function (event) {
3953 var coupon = event.currentTarget.dataset.coupon; 3517 var coupon = event.currentTarget.dataset.coupon;
3954 var app = getApp(); 3518 var app = getApp();
3955 var url = "/api/weshop/prom/coupon/pageCouponList"; 3519 var url = "/api/weshop/prom/coupon/pageCouponList";
@@ -3966,7 +3530,7 @@ Page({ @@ -3966,7 +3530,7 @@ Page({
3966 pageSize: 100, 3530 pageSize: 100,
3967 page: 1, 3531 page: 1,
3968 user_id: app.globalData.user_id, 3532 user_id: app.globalData.user_id,
3969 - is_share:0 3533 + is_share: 0
3970 } 3534 }
3971 }).then(res => { 3535 }).then(res => {
3972 wx.hideLoading(); 3536 wx.hideLoading();
@@ -3997,13 +3561,13 @@ Page({ @@ -3997,13 +3561,13 @@ Page({
3997 }, 3561 },
3998 3562
3999 //--查看评价-- 3563 //--查看评价--
4000 - look_pj: function() { 3564 + look_pj: function () {
4001 this.tabComment(); 3565 this.tabComment();
4002 this.doScrollTop(); 3566 this.doScrollTop();
4003 }, 3567 },
4004 3568
4005 //-----领取券----- 3569 //-----领取券-----
4006 - get_quan: function(e) { 3570 + get_quan: function (e) {
4007 var cid = e.currentTarget.dataset.cid; 3571 var cid = e.currentTarget.dataset.cid;
4008 var index = e.currentTarget.dataset.ind; 3572 var index = e.currentTarget.dataset.ind;
4009 var item = this.data.quan_list[index]; 3573 var item = this.data.quan_list[index];
@@ -4039,17 +3603,17 @@ Page({ @@ -4039,17 +3603,17 @@ Page({
4039 'store_id': os.stoid, 3603 'store_id': os.stoid,
4040 'type': 5 3604 'type': 5
4041 }; 3605 };
4042 -  
4043 - //-- 导购ID --  
4044 - if(getApp().globalData.guide_id){  
4045 - pdata.guide_id=getApp().globalData.guide_id;  
4046 - }  
4047 - 3606 +
  3607 + //-- 导购ID --
  3608 + if (getApp().globalData.guide_id) {
  3609 + pdata.guide_id = getApp().globalData.guide_id;
  3610 + }
  3611 +
4048 var app = getApp(), 3612 var app = getApp(),
4049 - th = this; 3613 + th = this;
4050 app.request.post("/api/weshop/couponList/saveCouponList", { 3614 app.request.post("/api/weshop/couponList/saveCouponList", {
4051 data: pdata, 3615 data: pdata,
4052 - success: function(res) { 3616 + success: function (res) {
4053 if (res.data.code == 0) { 3617 if (res.data.code == 0) {
4054 app.my_warnning("领取成功", 1, th); 3618 app.my_warnning("领取成功", 1, th);
4055 lq_num++; 3619 lq_num++;
@@ -4069,9 +3633,9 @@ Page({ @@ -4069,9 +3633,9 @@ Page({
4069 } 3633 }
4070 }) 3634 })
4071 }, 3635 },
4072 - 3636 +
4073 //--定义的保存图片方法,分享团--- 3637 //--定义的保存图片方法,分享团---
4074 - saveImageToPhotosAlbum: function() { 3638 + saveImageToPhotosAlbum: function () {
4075 //--先判断会员状态-- 3639 //--先判断会员状态--
4076 var user_info = getApp().globalData.userInfo; 3640 var user_info = getApp().globalData.userInfo;
4077 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { 3641 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
@@ -4079,12 +3643,12 @@ Page({ @@ -4079,12 +3643,12 @@ Page({
4079 wx.navigateTo({ url: '/pages/togoin/togoin', }) 3643 wx.navigateTo({ url: '/pages/togoin/togoin', })
4080 return false; 3644 return false;
4081 } 3645 }
4082 -  
4083 - if(this.data.share_hidden) {  
4084 - this.setData({  
4085 - share_hidden: false,  
4086 - });  
4087 - }; 3646 +
  3647 + if (this.data.share_hidden) {
  3648 + this.setData({
  3649 + share_hidden: false,
  3650 + });
  3651 + };
4088 3652
4089 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 3653 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
4090 var type = this.data.prom_type; 3654 var type = this.data.prom_type;
@@ -4095,7 +3659,7 @@ Page({ @@ -4095,7 +3659,7 @@ Page({
4095 title: '生成中...', 3659 title: '生成中...',
4096 }) 3660 })
4097 var that = this, 3661 var that = this,
4098 - th = that; 3662 + th = that;
4099 //设置画板显示,才能开始绘图 3663 //设置画板显示,才能开始绘图
4100 that.setData({ 3664 that.setData({
4101 canvasHidden: false 3665 canvasHidden: false
@@ -4104,230 +3668,230 @@ Page({ @@ -4104,230 +3668,230 @@ Page({
4104 var app = getApp(); 3668 var app = getApp();
4105 var unit = that.data.screenWidth / 750 * 1.35; //基础单位, 3669 var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
4106 var path2 = that.data.data.original_img; 3670 var path2 = that.data.data.original_img;
4107 - var scene = th.data.gid+"";  
4108 - var user_id = getApp().globalData.user_id?getApp().globalData.user_id:0;  
4109 - if(user_id>0) {  
4110 - scene+="_"+user_id; 3671 + var scene = th.data.gid + "";
  3672 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  3673 + if (user_id > 0) {
  3674 + scene += "_" + user_id;
  3675 + }
  3676 + //-- 如果不是会员分享过来的要分享给别人 --
  3677 + if (getApp().globalData.room_id && th.data.data.goods_id == getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) {
  3678 + //固定房间是第3个字符
  3679 + if (!user_id) scene += "_0";
  3680 + scene += "_" + getApp().globalData.room_id;
4111 } 3681 }
4112 - //-- 如果不是会员分享过来的要分享给别人 --  
4113 - if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) {  
4114 - //固定房间是第3个字符  
4115 - if(!user_id) scene+="_0";  
4116 - scene+="_"+getApp().globalData.room_id ;  
4117 - }  
4118 ///二微码 3682 ///二微码
4119 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 3683 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
4120 - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; 3684 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
4121 3685
4122 console.log(path3); 3686 console.log(path3);
4123 3687
4124 //读取文件成功则OK-- 3688 //读取文件成功则OK--
4125 wx.getImageInfo({ 3689 wx.getImageInfo({
4126 src: path3, 3690 src: path3,
4127 - success: function(res) { 3691 + success: function (res) {
4128 //回调写法 3692 //回调写法
4129 - th.get_head_temp(th.get_goods_temp, function() { 3693 + th.get_head_temp(th.get_goods_temp, function () {
4130 var vpath = res.path; 3694 var vpath = res.path;
4131 var context = wx.createCanvasContext('share'); 3695 var context = wx.createCanvasContext('share');
4132 //先画背景 3696 //先画背景
4133 var pg_path = "../../../../images/share/share_bg.png"; 3697 var pg_path = "../../../../images/share/share_bg.png";
4134 -  
4135 - // context.fillStyle="#FFFFFF";  
4136 - // context.fillRect(0,0,554 * unit, 899 * unit);  
4137 -  
4138 - //-- 如果有自定义海报的时候,判断背景的图片 --  
4139 - if(th.data.share_b_img){  
4140 - pg_path=th.data.share_b_img;  
4141 - } 3698 +
  3699 + // context.fillStyle="#FFFFFF";
  3700 + // context.fillRect(0,0,554 * unit, 899 * unit);
  3701 +
  3702 + //-- 如果有自定义海报的时候,判断背景的图片 --
  3703 + if (th.data.share_b_img) {
  3704 + pg_path = th.data.share_b_img;
  3705 + }
4142 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 3706 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
4143 -  
4144 - //-- 是自定义海报的情况下 --  
4145 - if(th.data.poster && parseInt(th.data.poster.style)==2) {  
4146 - //在线上分享人的情况下  
4147 - if(parseInt(th.data.poster.show_headpic)){  
4148 - //获取坐标  
4149 - var x=parseFloat(th.data.poster.head_x)*2;  
4150 - var y=parseFloat(th.data.poster.head_y)*2;  
4151 - var x1=(x+90) *unit;  
4152 - var y1=(y+50) *unit;  
4153 - //--昵称---  
4154 - context.setFontSize(24 * unit)  
4155 - context.setFillStyle("black")  
4156 - context.fillText(app.globalData.userInfo.nickname, x1, y1);  
4157 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;  
4158 - //强烈推荐 改许程  
4159 - var tj_path = "../../../../images/share/q_tj.png";  
4160 - context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);  
4161 - context.setFontSize(16 * unit)  
4162 - context.setLineJoin('round'); //交点设置成圆角  
4163 - context.setFillStyle("white")  
4164 - context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);  
4165 -  
4166 - //context.setFillStyle("black")  
4167 - //context.setFontSize(24 * unit)  
4168 - //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);  
4169 - }  
4170 - } else {  
4171 - //--昵称---  
4172 - context.setFontSize(24 * unit)  
4173 - context.setFillStyle("black")  
4174 - context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);  
4175 - var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;  
4176 - //强烈推荐 改许程  
4177 - var tj_path = "../../../../images/share/q_tj.png";  
4178 - context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);  
4179 - context.setFontSize(16 * unit);  
4180 - context.setLineJoin('round'); //交点设置成圆角  
4181 - context.setFillStyle("white");  
4182 - context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);  
4183 - }  
4184 -  
4185 - var share_title=th.data.data.goods_name;  
4186 - if(th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4){  
4187 - share_title=th.data.prom_act.share_title;  
4188 - if(!share_title) share_title=th.data.prom_act.title;  
4189 - if(th.data.prom_type==4) share_title=th.data.prom_act.name; 3707 +
  3708 + //-- 是自定义海报的情况下 --
  3709 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  3710 + //在线上分享人的情况下
  3711 + if (parseInt(th.data.poster.show_headpic)) {
  3712 + //获取坐标
  3713 + var x = parseFloat(th.data.poster.head_x) * 2;
  3714 + var y = parseFloat(th.data.poster.head_y) * 2;
  3715 + var x1 = (x + 90) * unit;
  3716 + var y1 = (y + 50) * unit;
  3717 + //--昵称---
  3718 + context.setFontSize(24 * unit)
  3719 + context.setFillStyle("black")
  3720 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  3721 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  3722 + //强烈推荐 改许程
  3723 + var tj_path = "../../../../images/share/q_tj.png";
  3724 + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit);
  3725 + context.setFontSize(16 * unit)
  3726 + context.setLineJoin('round'); //交点设置成圆角
  3727 + context.setFillStyle("white")
  3728 + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit);
  3729 +
  3730 + //context.setFillStyle("black")
  3731 + //context.setFontSize(24 * unit)
  3732 + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit);
  3733 + }
  3734 + } else {
  3735 + //--昵称---
  3736 + context.setFontSize(24 * unit)
  3737 + context.setFillStyle("black")
  3738 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  3739 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  3740 + //强烈推荐 改许程
  3741 + var tj_path = "../../../../images/share/q_tj.png";
  3742 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  3743 + context.setFontSize(16 * unit);
  3744 + context.setLineJoin('round'); //交点设置成圆角
  3745 + context.setFillStyle("white");
  3746 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit);
  3747 + }
  3748 +
  3749 + var share_title = th.data.data.goods_name;
  3750 + if (th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) {
  3751 + share_title = th.data.prom_act.share_title;
  3752 + if (!share_title) share_title = th.data.prom_act.title;
  3753 + if (th.data.prom_type == 4) share_title = th.data.prom_act.name;
4190 } 3754 }
4191 3755
4192 //---产品名称--- 3756 //---产品名称---
4193 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 3757 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
4194 - if(type!=4){  
4195 - context.setFillStyle("black");  
4196 - context.setFontSize(21.3 * unit)  
4197 - th.draw_Text(context, share_title,  
4198 - 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);  
4199 -  
4200 - //------产品的价格-------  
4201 - context.setFontSize(23 * unit)  
4202 - context.setFillStyle("red")  
4203 -  
4204 -  
4205 - var pri0 = th.data.data.shop_price;  
4206 - if (th.data.prom_act)  
4207 - pri0 = th.data.prom_act.price;  
4208 - pri0 = parseFloat(pri0).toFixed(2);  
4209 - var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25;  
4210 - context.fillText("¥", wd1-15, 185 * unit);  
4211 - context.setFontSize(31 * unit)  
4212 - context.fillText(pri0, wd1, 185 * unit);  
4213 -  
4214 - //---市场价划掉---  
4215 - context.setFillStyle("gray")  
4216 - context.setFontSize(22 * unit)  
4217 - pri0="¥" + th.data.data.market_price.toFixed(2);  
4218 - var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25;  
4219 - context.fillText(pri0, wd2, 213 * unit);  
4220 -  
4221 - context.setStrokeStyle('gray');  
4222 - context.setLineWidth(1 * unit);  
4223 - context.moveTo(wd2-5, 206 * unit);  
4224 - context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 206 * unit);  
4225 - context.stroke();  
4226 -  
4227 - }else{  
4228 - context.setFillStyle("black");  
4229 - context.setFontSize(21.3 * unit)  
4230 - th.draw_Text(context, share_title,  
4231 - 38 * unit, 170 * unit, 20 * unit, 300*unit, unit);  
4232 - //------ 产品的价格 -----  
4233 - var pri0 = th.data.prom_act.addmoney;  
4234 - var integral=th.data.prom_act.integral;  
4235 - var text= "";  
4236 - if(integral){text=integral+"积分"; }  
4237 - if(pri0 && integral){ text+="+";}  
4238 - if(pri0){ text+="¥"+pri0;}  
4239 -  
4240 - if(!pri0 && !integral){ text="0积分";}  
4241 - context.setFillStyle("red");  
4242 - context.fillText(text, 38 * unit, 235 * unit);  
4243 -  
4244 - }  
4245 - 3758 + if (type != 4) {
  3759 + context.setFillStyle("black");
  3760 + context.setFontSize(21.3 * unit)
  3761 + th.draw_Text(context, share_title,
  3762 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  3763 +
  3764 + //------产品的价格-------
  3765 + context.setFontSize(23 * unit)
  3766 + context.setFillStyle("red")
  3767 +
  3768 +
  3769 + var pri0 = th.data.data.shop_price;
  3770 + if (th.data.prom_act)
  3771 + pri0 = th.data.prom_act.price;
  3772 + pri0 = parseFloat(pri0).toFixed(2);
  3773 + var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25;
  3774 + context.fillText("¥", wd1 - 15, 185 * unit);
  3775 + context.setFontSize(31 * unit)
  3776 + context.fillText(pri0, wd1, 185 * unit);
  3777 +
  3778 + //---市场价划掉---
  3779 + context.setFillStyle("gray")
  3780 + context.setFontSize(22 * unit)
  3781 + pri0 = "¥" + th.data.data.market_price.toFixed(2);
  3782 + var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25;
  3783 + context.fillText(pri0, wd2, 213 * unit);
  3784 +
  3785 + context.setStrokeStyle('gray');
  3786 + context.setLineWidth(1 * unit);
  3787 + context.moveTo(wd2 - 5, 206 * unit);
  3788 + context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
  3789 + context.stroke();
  3790 +
  3791 + } else {
  3792 + context.setFillStyle("black");
  3793 + context.setFontSize(21.3 * unit)
  3794 + th.draw_Text(context, share_title,
  3795 + 38 * unit, 170 * unit, 20 * unit, 300 * unit, unit);
  3796 + //------ 产品的价格 -----
  3797 + var pri0 = th.data.prom_act.addmoney;
  3798 + var integral = th.data.prom_act.integral;
  3799 + var text = "";
  3800 + if (integral) { text = integral + "积分"; }
  3801 + if (pri0 && integral) { text += "+"; }
  3802 + if (pri0) { text += "¥" + pri0; }
  3803 +
  3804 + if (!pri0 && !integral) { text = "0积分"; }
  3805 + context.setFillStyle("red");
  3806 + context.fillText(text, 38 * unit, 235 * unit);
  3807 +
  3808 + }
  3809 +
4246 //---中间大图--- 3810 //---中间大图---
4247 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); 3811 context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
4248 //-------大图后面就不一样了----------- 3812 //-------大图后面就不一样了-----------
4249 switch (type) { 3813 switch (type) {
4250 case 0: //普通商品的展示 3814 case 0: //普通商品的展示
4251 - case 4: 3815 + case 4:
4252 //中间的几个字 3816 //中间的几个字
4253 - if(th.data.poster && parseInt(th.data.poster.style)==2 ){  
4254 - if(parseInt(th.data.poster.show_quality)){  
4255 - var g_path = "../../../../images/share/s_gou.png";  
4256 - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);  
4257 - context.setFillStyle("red")  
4258 - context.setFontSize(18 * unit)  
4259 - context.fillText("正品保证", 84 * unit, 690 * unit);  
4260 -  
4261 - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);  
4262 - context.setFillStyle("red")  
4263 - context.setFontSize(18 * unit)  
4264 - context.fillText("纯实体店", 246 * unit, 690 * unit);  
4265 -  
4266 - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);  
4267 - context.setFillStyle("red")  
4268 - context.setFontSize(18 * unit)  
4269 - context.fillText("官方验证", 420 * unit, 690 * unit);  
4270 - }  
4271 -  
4272 - }else{  
4273 - var g_path = "../../../../images/share/s_gou.png";  
4274 - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);  
4275 - context.setFillStyle("red")  
4276 - context.setFontSize(18 * unit)  
4277 - context.fillText("正品保证", 84 * unit, 690 * unit);  
4278 -  
4279 - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);  
4280 - context.setFillStyle("red")  
4281 - context.setFontSize(18 * unit)  
4282 - context.fillText("纯实体店", 246 * unit, 690 * unit);  
4283 -  
4284 - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);  
4285 - context.setFillStyle("red")  
4286 - context.setFontSize(18 * unit)  
4287 - context.fillText("官方验证", 420 * unit, 690 * unit);  
4288 - }  
4289 -  
4290 -  
4291 - //---画线---  
4292 - context.setLineWidth(1 * unit)  
4293 - context.moveTo(32 * unit, 710 * unit)  
4294 - context.lineTo(520 * unit, 710 * unit)  
4295 - context.stroke();  
4296 -  
4297 - //---文字---  
4298 - context.setFillStyle("black")  
4299 - context.setFontSize(22 * unit)  
4300 -  
4301 - if(type==0){  
4302 - // 原来start --->  
4303 - context.setFontSize(24 * unit)  
4304 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);  
4305 -  
4306 - context.setFontSize(22 * unit)  
4307 - context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 806 * unit);  
4308 - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);  
4309 -  
4310 - }else{  
4311 - context.setFontSize(24 * unit)  
4312 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);  
4313 - context.setFontSize(22 * unit)  
4314 - context.fillText("长按识别二维码", 40 * unit, 806 * unit);  
4315 - context.fillText("立即开始兑换", 40 * unit, 846 * unit);  
4316 -  
4317 -  
4318 - }  
4319 - 3817 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  3818 + if (parseInt(th.data.poster.show_quality)) {
  3819 + var g_path = "../../../../images/share/s_gou.png";
  3820 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  3821 + context.setFillStyle("red")
  3822 + context.setFontSize(18 * unit)
  3823 + context.fillText("正品保证", 84 * unit, 690 * unit);
  3824 +
  3825 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  3826 + context.setFillStyle("red")
  3827 + context.setFontSize(18 * unit)
  3828 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  3829 +
  3830 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  3831 + context.setFillStyle("red")
  3832 + context.setFontSize(18 * unit)
  3833 + context.fillText("官方验证", 420 * unit, 690 * unit);
  3834 + }
  3835 +
  3836 + } else {
  3837 + var g_path = "../../../../images/share/s_gou.png";
  3838 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  3839 + context.setFillStyle("red")
  3840 + context.setFontSize(18 * unit)
  3841 + context.fillText("正品保证", 84 * unit, 690 * unit);
  3842 +
  3843 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  3844 + context.setFillStyle("red")
  3845 + context.setFontSize(18 * unit)
  3846 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  3847 +
  3848 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  3849 + context.setFillStyle("red")
  3850 + context.setFontSize(18 * unit)
  3851 + context.fillText("官方验证", 420 * unit, 690 * unit);
  3852 + }
  3853 +
  3854 +
  3855 + //---画线---
  3856 + context.setLineWidth(1 * unit)
  3857 + context.moveTo(32 * unit, 710 * unit)
  3858 + context.lineTo(520 * unit, 710 * unit)
  3859 + context.stroke();
  3860 +
  3861 + //---文字---
  3862 + context.setFillStyle("black")
  3863 + context.setFontSize(22 * unit)
  3864 +
  3865 + if (type == 0) {
  3866 + // 原来start --->
  3867 + context.setFontSize(24 * unit)
  3868 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  3869 +
  3870 + context.setFontSize(22 * unit)
  3871 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 806 * unit);
  3872 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
  3873 +
  3874 + } else {
  3875 + context.setFontSize(24 * unit)
  3876 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 766 * unit);
  3877 + context.setFontSize(22 * unit)
  3878 + context.fillText("长按识别二维码", 40 * unit, 806 * unit);
  3879 + context.fillText("立即开始兑换", 40 * unit, 846 * unit);
  3880 +
  3881 +
  3882 + }
  3883 +
4320 //---二维吗图--- 3884 //---二维吗图---
4321 - //-- 自定义海报 --  
4322 - if(th.data.poster){  
4323 - var erm_x= parseFloat(th.data.poster.ewm_x)*2;  
4324 - var erm_y= parseFloat(th.data.poster.ewm_y)*2;  
4325 - context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);  
4326 - }else{  
4327 - //---二维吗图---  
4328 - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);  
4329 - }  
4330 - 3885 + //-- 自定义海报 --
  3886 + if (th.data.poster) {
  3887 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3888 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3889 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3890 + } else {
  3891 + //---二维吗图---
  3892 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  3893 + }
  3894 +
4331 break; 3895 break;
4332 case 1: //秒杀商品的展示 3896 case 1: //秒杀商品的展示
4333 //---画线--- 3897 //---画线---
@@ -4339,27 +3903,27 @@ Page({ @@ -4339,27 +3903,27 @@ Page({
4339 //画秒杀的图片 3903 //画秒杀的图片
4340 var miaos_path = '../../../../images/share/miao_share.png'; 3904 var miaos_path = '../../../../images/share/miao_share.png';
4341 context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); 3905 context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
4342 -  
4343 - context.setFillStyle("black")  
4344 - context.setFontSize(24 * unit)  
4345 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 786 * unit); 3906 +
  3907 + context.setFillStyle("black")
  3908 + context.setFontSize(24 * unit)
  3909 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 786 * unit);
4346 //---文字--- 3910 //---文字---
4347 context.setFontSize(22 * unit) 3911 context.setFontSize(22 * unit)
4348 context.setFillStyle("black") 3912 context.setFillStyle("black")
4349 context.fillText("特惠好物,限时秒杀", 40 * unit, 826 * unit); 3913 context.fillText("特惠好物,限时秒杀", 40 * unit, 826 * unit);
4350 context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit); 3914 context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit);
4351 -  
4352 - 3915 +
  3916 +
4353 //---二维吗图--- 3917 //---二维吗图---
4354 //-- 自定义海报 -- 3918 //-- 自定义海报 --
4355 - if(th.data.poster){  
4356 - var erm_x= parseFloat(th.data.poster.ewm_x)*2;  
4357 - var erm_y= parseFloat(th.data.poster.ewm_y)*2;  
4358 - context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);  
4359 - }else{  
4360 - //---二维吗图---  
4361 - context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);  
4362 - } 3919 + if (th.data.poster) {
  3920 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3921 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3922 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 135 * unit, 135 * unit);
  3923 + } else {
  3924 + //---二维吗图---
  3925 + context.drawImage(vpath, 390 * unit, 726 * unit, 135 * unit, 135 * unit);
  3926 + }
4363 break; 3927 break;
4364 3928
4365 case 2: //会员团和商家团的展示 3929 case 2: //会员团和商家团的展示
@@ -4369,10 +3933,10 @@ Page({ @@ -4369,10 +3933,10 @@ Page({
4369 context.lineTo(520 * unit, 670 * unit) 3933 context.lineTo(520 * unit, 670 * unit)
4370 context.stroke(); 3934 context.stroke();
4371 //---文字--- 3935 //---文字---
4372 -  
4373 - context.setFillStyle("black")  
4374 - context.setFontSize(24 * unit)  
4375 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit); 3936 +
  3937 + context.setFillStyle("black")
  3938 + context.setFontSize(24 * unit)
  3939 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
4376 3940
4377 //绘制成团图片 3941 //绘制成团图片
4378 var ct_img = "../../../../images/share/ct_num.png"; 3942 var ct_img = "../../../../images/share/ct_num.png";
@@ -4388,25 +3952,25 @@ Page({ @@ -4388,25 +3952,25 @@ Page({
4388 } 3952 }
4389 context.setFontSize(22 * unit) 3953 context.setFontSize(22 * unit)
4390 context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit); 3954 context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
4391 -  
4392 - context.setFillStyle("gray") 3955 +
  3956 + context.setFillStyle("gray")
4393 context.fillText("快来和我一起拼团吧!", 40 * unit, 806 * unit); 3957 context.fillText("快来和我一起拼团吧!", 40 * unit, 806 * unit);
4394 context.setFillStyle("black") 3958 context.setFillStyle("black")
4395 context.font = 'normal bold 18px sans-serif'; 3959 context.font = 'normal bold 18px sans-serif';
4396 context.setFontSize(21.3 * unit) 3960 context.setFontSize(21.3 * unit)
4397 context.fillText("长按识别二维码,立即参团", 40 * unit, 836 * unit); 3961 context.fillText("长按识别二维码,立即参团", 40 * unit, 836 * unit);
4398 -  
4399 - 3962 +
  3963 +
4400 //---二维吗图--- 3964 //---二维吗图---
4401 //-- 自定义海报 -- 3965 //-- 自定义海报 --
4402 - if(th.data.poster){  
4403 - var erm_x= parseFloat(th.data.poster.ewm_x)*2;  
4404 - var erm_y= parseFloat(th.data.poster.ewm_y)*2;  
4405 - context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);  
4406 - }else{  
4407 - //---二维吗图---  
4408 - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);  
4409 - } 3966 + if (th.data.poster) {
  3967 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  3968 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  3969 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  3970 + } else {
  3971 + //---二维吗图---
  3972 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  3973 + }
4410 break 3974 break
4411 case 3: //阶梯团的展示 3975 case 3: //阶梯团的展示
4412 //---画线--- 3976 //---画线---
@@ -4415,11 +3979,11 @@ Page({ @@ -4415,11 +3979,11 @@ Page({
4415 context.lineTo(520 * unit, 670 * unit) 3979 context.lineTo(520 * unit, 670 * unit)
4416 context.stroke(); 3980 context.stroke();
4417 //---文字--- 3981 //---文字---
4418 -  
4419 - context.setFillStyle("black")  
4420 - context.setFontSize(24 * unit)  
4421 - context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);  
4422 - 3982 +
  3983 + context.setFillStyle("black")
  3984 + context.setFontSize(24 * unit)
  3985 + context.fillText(th.data.sto_sele_name_1, 40 * unit, 720 * unit);
  3986 +
4423 //---绘制中间阶梯的价格--- 3987 //---绘制中间阶梯的价格---
4424 var list = th.data.prom_act.ct_rylist; 3988 var list = th.data.prom_act.ct_rylist;
4425 for (var i = 0; i < list.length; i++) { 3989 for (var i = 0; i < list.length; i++) {
@@ -4436,80 +4000,80 @@ Page({ @@ -4436,80 +4000,80 @@ Page({
4436 context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); 4000 context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
4437 } 4001 }
4438 //----------------下面部分---------------- 4002 //----------------下面部分----------------
4439 - // context.setFillStyle("gray")  
4440 - // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);  
4441 - // context.setFillStyle("black")  
4442 - // context.font = 'normal bold 18px sans-serif';  
4443 - // context.setFontSize(22 * unit)  
4444 - // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); 4003 + // context.setFillStyle("gray")
  4004 + // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
  4005 + // context.setFillStyle("black")
  4006 + // context.font = 'normal bold 18px sans-serif';
  4007 + // context.setFontSize(22 * unit)
  4008 + // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
4445 //context.setFillStyle("gray") 4009 //context.setFillStyle("gray")
4446 - context.setFillStyle("black")  
4447 - context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit); 4010 + context.setFillStyle("black")
  4011 + context.fillText("快来和我一起拼团吧!", 40 * unit, 820 * unit);
4448 //context.font = 'normal bold 18px sans-serif'; 4012 //context.font = 'normal bold 18px sans-serif';
4449 context.setFontSize(21 * unit) 4013 context.setFontSize(21 * unit)
4450 context.fillText("长按识别二维码,立即参团", 40 * unit, 850 * unit); 4014 context.fillText("长按识别二维码,立即参团", 40 * unit, 850 * unit);
4451 -  
4452 -  
4453 - //-- 自定义海报 --  
4454 - if(th.data.poster){  
4455 - var erm_x= parseFloat(th.data.poster.ewm_x)*2;  
4456 - var erm_y= parseFloat(th.data.poster.ewm_y)*2;  
4457 - context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);  
4458 - }else{  
4459 - //---二维吗图---  
4460 - context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);  
4461 - } 4015 +
  4016 +
  4017 + //-- 自定义海报 --
  4018 + if (th.data.poster) {
  4019 + var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
  4020 + var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
  4021 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
  4022 + } else {
  4023 + //---二维吗图---
  4024 + context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
  4025 + }
4462 break 4026 break
4463 -  
4464 - 4027 +
  4028 +
4465 } 4029 }
4466 -  
4467 -  
4468 - //--- 如果是自定义海报的时候 ---  
4469 - if(th.data.poster && parseInt(th.data.poster.style)==2){  
4470 -  
4471 - //如果显示会员信息的话  
4472 - if(parseInt(th.data.poster.show_headpic)){  
4473 - //获取坐标  
4474 - var x= parseFloat(th.data.poster.head_x)*2;  
4475 - var y=parseFloat(th.data.poster.head_y)*2;  
4476 - //---绘制圆形要放在最后----  
4477 - context.save();  
4478 - context.beginPath();  
4479 - var h_x = x* unit;  
4480 - var h_y = y * unit;  
4481 - var h_r = 40 * unit;  
4482 - var cx = h_x + h_r;  
4483 - var cy = h_y + h_r;  
4484 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
4485 - context.closePath();  
4486 - context.fill();  
4487 - context.clip();  
4488 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
4489 - context.restore();  
4490 - }  
4491 -  
4492 - }else{  
4493 - //---绘制圆形要放在最后----  
4494 - context.save();  
4495 - context.beginPath();  
4496 - var h_x = 60 * unit;  
4497 - var h_y = 24 * unit;  
4498 - var h_r = 40 * unit;  
4499 - var cx = h_x + h_r;  
4500 - var cy = h_y + h_r;  
4501 - context.arc(cx, cy, h_r, 0, Math.PI * 2, false);  
4502 - context.closePath();  
4503 - context.fill();  
4504 - context.clip();  
4505 - context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);  
4506 - context.restore();  
4507 - }  
4508 -  
4509 - 4030 +
  4031 +
  4032 + //--- 如果是自定义海报的时候 ---
  4033 + if (th.data.poster && parseInt(th.data.poster.style) == 2) {
  4034 +
  4035 + //如果显示会员信息的话
  4036 + if (parseInt(th.data.poster.show_headpic)) {
  4037 + //获取坐标
  4038 + var x = parseFloat(th.data.poster.head_x) * 2;
  4039 + var y = parseFloat(th.data.poster.head_y) * 2;
  4040 + //---绘制圆形要放在最后----
  4041 + context.save();
  4042 + context.beginPath();
  4043 + var h_x = x * unit;
  4044 + var h_y = y * unit;
  4045 + var h_r = 40 * unit;
  4046 + var cx = h_x + h_r;
  4047 + var cy = h_y + h_r;
  4048 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4049 + context.closePath();
  4050 + context.fill();
  4051 + context.clip();
  4052 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4053 + context.restore();
  4054 + }
  4055 +
  4056 + } else {
  4057 + //---绘制圆形要放在最后----
  4058 + context.save();
  4059 + context.beginPath();
  4060 + var h_x = 60 * unit;
  4061 + var h_y = 24 * unit;
  4062 + var h_r = 40 * unit;
  4063 + var cx = h_x + h_r;
  4064 + var cy = h_y + h_r;
  4065 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  4066 + context.closePath();
  4067 + context.fill();
  4068 + context.clip();
  4069 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  4070 + context.restore();
  4071 + }
  4072 +
  4073 +
4510 //把画板内容绘制成图片,并回调 画板图片路径 4074 //把画板内容绘制成图片,并回调 画板图片路径
4511 - context.draw(false, function() {  
4512 - setTimeout(function() { 4075 + context.draw(false, function () {
  4076 + setTimeout(function () {
4513 wx.canvasToTempFilePath({ 4077 wx.canvasToTempFilePath({
4514 x: 0, 4078 x: 0,
4515 y: 0, 4079 y: 0,
@@ -4518,40 +4082,40 @@ Page({ @@ -4518,40 +4082,40 @@ Page({
4518 destWidth: 1.2 * 750 * 750 / that.data.screenWidth, 4082 destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
4519 destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, 4083 destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
4520 canvasId: 'share', 4084 canvasId: 'share',
4521 - success: function (res) { 4085 + success: function (res) {
4522 4086
4523 - that.setData({  
4524 - shareImgPath: res.tempFilePath,  
4525 - canvasHidden: true  
4526 - })  
4527 -  
4528 - if (!res.tempFilePath) {  
4529 - wx.showModal({  
4530 - title: '提示',  
4531 - content: '图片绘制中,请稍后重试',  
4532 - showCancel: false  
4533 - })  
4534 - return false;  
4535 - } 4087 + that.setData({
  4088 + shareImgPath: res.tempFilePath,
  4089 + canvasHidden: true
  4090 + })
4536 4091
4537 - // wx.previewImage({  
4538 - // //将图片预览出来  
4539 - // urls: [that.data.shareImgPath]  
4540 - // });  
4541 - that.setData({  
4542 - showPoster: true,  
4543 - });  
4544 - wx.hideLoading(); 4092 + if (!res.tempFilePath) {
  4093 + wx.showModal({
  4094 + title: '提示',
  4095 + content: '图片绘制中,请稍后重试',
  4096 + showCancel: false
  4097 + })
  4098 + return false;
4545 } 4099 }
  4100 +
  4101 + // wx.previewImage({
  4102 + // //将图片预览出来
  4103 + // urls: [that.data.shareImgPath]
  4104 + // });
  4105 + that.setData({
  4106 + showPoster: true,
  4107 + });
  4108 + wx.hideLoading();
  4109 + }
4546 }) 4110 })
4547 }, 500) 4111 }, 500)
4548 4112
4549 }); 4113 });
4550 }); 4114 });
4551 }, 4115 },
4552 - fail: function(res) {  
4553 - console.log(res);  
4554 - wx.hideLoading(); 4116 + fail: function (res) {
  4117 + console.log(res);
  4118 + wx.hideLoading();
4555 4119
4556 } 4120 }
4557 }); 4121 });
@@ -4559,7 +4123,7 @@ Page({ @@ -4559,7 +4123,7 @@ Page({
4559 4123
4560 4124
4561 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 4125 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
4562 - draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { 4126 + draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
4563 var lineWidth = 0; 4127 var lineWidth = 0;
4564 var lastSubStrIndex = 0; //每次开始截取的字符串的索引 4128 var lastSubStrIndex = 0; //每次开始截取的字符串的索引
4565 var han = 0; 4129 var han = 0;
@@ -4588,7 +4152,7 @@ Page({ @@ -4588,7 +4152,7 @@ Page({
4588 4152
4589 // ----视频图片---- 4153 // ----视频图片----
4590 // 图片计数器 4154 // 图片计数器
4591 - swiperChange: function(e) { 4155 + swiperChange: function (e) {
4592 var that = this; 4156 var that = this;
4593 if (e.detail.current > 0) { 4157 if (e.detail.current > 0) {
4594 that.setData({ 4158 that.setData({
@@ -4609,7 +4173,7 @@ Page({ @@ -4609,7 +4173,7 @@ Page({
4609 }, 4173 },
4610 4174
4611 /*---视频相关--*/ 4175 /*---视频相关--*/
4612 - videopicture: function(e) { 4176 + videopicture: function (e) {
4613 var vipi = e.currentTarget.dataset.vipi; 4177 var vipi = e.currentTarget.dataset.vipi;
4614 this.setData({ 4178 this.setData({
4615 videopicture: vipi, 4179 videopicture: vipi,
@@ -4619,14 +4183,14 @@ Page({ @@ -4619,14 +4183,14 @@ Page({
4619 }); 4183 });
4620 }, 4184 },
4621 4185
4622 - videoPlay: function(e) { 4186 + videoPlay: function (e) {
4623 var _index = e.currentTarget.id 4187 var _index = e.currentTarget.id
4624 this.setData({ 4188 this.setData({
4625 _index: _index, 4189 _index: _index,
4626 noon: 1 4190 noon: 1
4627 }) 4191 })
4628 4192
4629 - setTimeout(function() { 4193 + setTimeout(function () {
4630 //将点击视频进行播放 4194 //将点击视频进行播放
4631 var videoContext = wx.createVideoContext(_index) 4195 var videoContext = wx.createVideoContext(_index)
4632 videoContext.play(); 4196 videoContext.play();
@@ -4636,7 +4200,7 @@ Page({ @@ -4636,7 +4200,7 @@ Page({
4636 4200
4637 4201
4638 //--获取头像的本地缓存,回调写法-- 4202 //--获取头像的本地缓存,回调写法--
4639 - get_head_temp: function(tt, func) { 4203 + get_head_temp: function (tt, func) {
4640 var ee = this; 4204 var ee = this;
4641 if (ee.data.share_head) { 4205 if (ee.data.share_head) {
4642 tt(func); 4206 tt(func);
@@ -4652,12 +4216,12 @@ Page({ @@ -4652,12 +4216,12 @@ Page({
4652 path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); 4216 path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
4653 wx.getImageInfo({ 4217 wx.getImageInfo({
4654 src: path2, 4218 src: path2,
4655 - success: function(res) { 4219 + success: function (res) {
4656 //res.path是网络图片的本地地址 4220 //res.path是网络图片的本地地址
4657 ee.data.share_head = res.path; 4221 ee.data.share_head = res.path;
4658 tt(func); 4222 tt(func);
4659 }, 4223 },
4660 - fail: function(res) { 4224 + fail: function (res) {
4661 ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 4225 ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
4662 tt(func); 4226 tt(func);
4663 } 4227 }
@@ -4665,35 +4229,35 @@ Page({ @@ -4665,35 +4229,35 @@ Page({
4665 } 4229 }
4666 }, 4230 },
4667 //--获取商品图片的本地缓存,回调写法-- 4231 //--获取商品图片的本地缓存,回调写法--
4668 - get_goods_temp: function(tt) { 4232 + get_goods_temp: function (tt) {
4669 var ee = this; 4233 var ee = this;
4670 if (ee.data.share_goods_img) { 4234 if (ee.data.share_goods_img) {
4671 tt(); 4235 tt();
4672 return false; 4236 return false;
4673 } 4237 }
4674 4238
4675 - var img_url=ee.data.data.original_img;  
4676 - if((this.data.prom_type==1 || this.data.prom_type==6) && this.data.prom_act.share_imgurl){  
4677 - img_url=this.data.iurl+this.data.prom_act.share_imgurl; 4239 + var img_url = ee.data.data.original_img;
  4240 + if ((this.data.prom_type == 1 || this.data.prom_type == 6) && this.data.prom_act.share_imgurl) {
  4241 + img_url = this.data.iurl + this.data.prom_act.share_imgurl;
4678 } 4242 }
4679 4243
4680 //获取商品是分享图信息 4244 //获取商品是分享图信息
4681 wx.getImageInfo({ 4245 wx.getImageInfo({
4682 src: img_url, 4246 src: img_url,
4683 - success: function(res) {  
4684 - //res.path是网络图片的本地地址  
4685 - ee.data.share_goods_img = res.path;  
4686 - tt(); 4247 + success: function (res) {
  4248 + //res.path是网络图片的本地地址
  4249 + ee.data.share_goods_img = res.path;
  4250 + tt();
4687 }, 4251 },
4688 - fail: function(res) {  
4689 - ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的  
4690 - tt(); 4252 + fail: function (res) {
  4253 + ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  4254 + tt();
4691 } 4255 }
4692 }); 4256 });
4693 }, 4257 },
4694 4258
4695 //--外侧评价的点击效果--- 4259 //--外侧评价的点击效果---
4696 - clik_evaluate: function(e) { 4260 + clik_evaluate: function (e) {
4697 var val = e.currentTarget.dataset.val; 4261 var val = e.currentTarget.dataset.val;
4698 this.setData({ 4262 this.setData({
4699 activeCategoryId: 2, 4263 activeCategoryId: 2,
@@ -4704,19 +4268,19 @@ Page({ @@ -4704,19 +4268,19 @@ Page({
4704 }, 4268 },
4705 4269
4706 //--跳转到商品详情页面-- 4270 //--跳转到商品详情页面--
4707 - go_goods: function(e) { 4271 + go_goods: function (e) {
4708 var gid = e.currentTarget.dataset.gid; 4272 var gid = e.currentTarget.dataset.gid;
4709 var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; 4273 var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid;
4710 getApp().goto(url); 4274 getApp().goto(url);
4711 }, 4275 },
4712 4276
4713 //--跳转到支付尾款界面-- 4277 //--跳转到支付尾款界面--
4714 - go_pay_wk: function() { 4278 + go_pay_wk: function () {
4715 var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id; 4279 var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;
4716 getApp().goto(url); 4280 getApp().goto(url);
4717 }, 4281 },
4718 4282
4719 - pop_err_img: function(e) { 4283 + pop_err_img: function (e) {
4720 var txt = e.currentTarget.dataset.errorimg; 4284 var txt = e.currentTarget.dataset.errorimg;
4721 var ob = {}; 4285 var ob = {};
4722 ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; 4286 ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
@@ -4724,11 +4288,11 @@ Page({ @@ -4724,11 +4288,11 @@ Page({
4724 }, 4288 },
4725 4289
4726 //--调用更新阶梯团的接口-- 4290 //--调用更新阶梯团的接口--
4727 - update_jiti: function(id) { 4291 + update_jiti: function (id) {
4728 var th = this; 4292 var th = this;
4729 //--更新阶梯团-- 4293 //--更新阶梯团--
4730 getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, { 4294 getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {
4731 - success: function(ee) { 4295 + success: function (ee) {
4732 //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- 4296 //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--
4733 if (ee.data.code == 0) { 4297 if (ee.data.code == 0) {
4734 th.setData({ 4298 th.setData({
@@ -4743,21 +4307,21 @@ Page({ @@ -4743,21 +4307,21 @@ Page({
4743 }) 4307 })
4744 }, 4308 },
4745 // 选择门店 4309 // 选择门店
4746 - choice_store: function(ee) { 4310 + choice_store: function (ee) {
4747 var th = this; 4311 var th = this;
4748 - var ind=ee.currentTarget.dataset.ind; 4312 + var ind = ee.currentTarget.dataset.ind;
4749 var bconfig = th.data.bconfig; 4313 var bconfig = th.data.bconfig;
4750 4314
4751 - if(!th.data.only_pk && !th.data.def_pickpu_list){ 4315 + if (!th.data.only_pk && !th.data.def_pickpu_list) {
4752 getApp().confirmBox("门店库存不足", null, 25000, !1); 4316 getApp().confirmBox("门店库存不足", null, 25000, !1);
4753 return false; 4317 return false;
4754 } 4318 }
4755 4319
4756 - if(th.data.only_pk && !th.data.only_pk.length){ 4320 + if (th.data.only_pk && !th.data.only_pk.length) {
4757 getApp().confirmBox("门店库存不足", null, 25000, !1); 4321 getApp().confirmBox("门店库存不足", null, 25000, !1);
4758 return false; 4322 return false;
4759 } 4323 }
4760 - if(th.data.def_pickpu_list && !th.data.def_pickpu_list.length){ 4324 + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
4761 getApp().confirmBox("门店库存不足", null, 25000, !1); 4325 getApp().confirmBox("门店库存不足", null, 25000, !1);
4762 return false; 4326 return false;
4763 } 4327 }
@@ -4766,7 +4330,7 @@ Page({ @@ -4766,7 +4330,7 @@ Page({
4766 if (bconfig && bconfig.is_sort_storage) { 4330 if (bconfig && bconfig.is_sort_storage) {
4767 wx.getLocation({ 4331 wx.getLocation({
4768 type: 'gcj02', 4332 type: 'gcj02',
4769 - success: function(res) { 4333 + success: function (res) {
4770 4334
4771 th.data.lat = res.latitude; 4335 th.data.lat = res.latitude;
4772 th.data.lon = res.longitude; 4336 th.data.lon = res.longitude;
@@ -4777,7 +4341,7 @@ Page({ @@ -4777,7 +4341,7 @@ Page({
4777 //th.onShow(); 4341 //th.onShow();
4778 th.get_sto(th.data.is_normal); 4342 th.get_sto(th.data.is_normal);
4779 }, 4343 },
4780 - fail: function(res) { 4344 + fail: function (res) {
4781 //th.onShow(); 4345 //th.onShow();
4782 th.data.is_get_local_ok = 1; 4346 th.data.is_get_local_ok = 1;
4783 th.get_sto(th.data.is_normal); 4347 th.get_sto(th.data.is_normal);
@@ -4796,19 +4360,19 @@ Page({ @@ -4796,19 +4360,19 @@ Page({
4796 4360
4797 } 4361 }
4798 }) 4362 })
4799 - }else{ 4363 + } else {
4800 th.data.is_get_local_ok = 1; 4364 th.data.is_get_local_ok = 1;
4801 th.get_sto(th.data.is_normal); 4365 th.get_sto(th.data.is_normal);
4802 } 4366 }
4803 4367
4804 - if(ind!=undefined && ind!=null ){ 4368 + if (ind != undefined && ind != null) {
4805 this.setData({ 4369 this.setData({
4806 open_ind_store: ind, 4370 open_ind_store: ind,
4807 store: 1, 4371 store: 1,
4808 openSpecModal: !1, 4372 openSpecModal: !1,
4809 openSpecModal_pt: !1 4373 openSpecModal_pt: !1
4810 }) 4374 })
4811 - }else{ 4375 + } else {
4812 this.setData({ 4376 this.setData({
4813 store: 1, 4377 store: 1,
4814 openSpecModal: !1, 4378 openSpecModal: !1,
@@ -4817,17 +4381,17 @@ Page({ @@ -4817,17 +4381,17 @@ Page({
4817 } 4381 }
4818 }, 4382 },
4819 //关闭选择门店 4383 //关闭选择门店
4820 - close_popup: function(e) {  
4821 - var th=this; 4384 + close_popup: function (e) {
  4385 + var th = this;
4822 this.setData({ 4386 this.setData({
4823 store: 0, 4387 store: 0,
4824 choice_sort_store: 0, 4388 choice_sort_store: 0,
4825 sort_store: 0, 4389 sort_store: 0,
4826 - fir_pick_index:0,  
4827 - sec_pick_index:0 4390 + fir_pick_index: 0,
  4391 + sec_pick_index: 0
4828 }) 4392 })
4829 4393
4830 - var openindstore=this.data.open_ind_store; 4394 + var openindstore = this.data.open_ind_store;
4831 if (openindstore == 1) { 4395 if (openindstore == 1) {
4832 th.setData({ 4396 th.setData({
4833 openSpecModal: !0, 4397 openSpecModal: !0,
@@ -4859,23 +4423,23 @@ Page({ @@ -4859,23 +4423,23 @@ Page({
4859 }, 4423 },
4860 4424
4861 //选择更多门店 4425 //选择更多门店
4862 - more_store: function() { 4426 + more_store: function () {
4863 this.setData({ 4427 this.setData({
4864 sort_store: 1 4428 sort_store: 1
4865 }); 4429 });
4866 }, 4430 },
4867 - sort_store: function() { 4431 + sort_store: function () {
4868 4432
4869 }, 4433 },
4870 // 返回按钮 4434 // 返回按钮
4871 - returns: function() { 4435 + returns: function () {
4872 this.setData({ 4436 this.setData({
4873 sort_store: 0, 4437 sort_store: 0,
4874 choice_sort_store: 0 4438 choice_sort_store: 0
4875 }); 4439 });
4876 }, 4440 },
4877 //---选择分类门店--- 4441 //---选择分类门店---
4878 - choice_sort_store: function(e) { 4442 + choice_sort_store: function (e) {
4879 var index = e.currentTarget.dataset.index; 4443 var index = e.currentTarget.dataset.index;
4880 var region_name = e.currentTarget.dataset.region; 4444 var region_name = e.currentTarget.dataset.region;
4881 var item = this.data.all_sto[index]; 4445 var item = this.data.all_sto[index];
@@ -4888,9 +4452,9 @@ Page({ @@ -4888,9 +4452,9 @@ Page({
4888 }); 4452 });
4889 }, 4453 },
4890 4454
4891 - choose_for_store_fir: function(e) { 4455 + choose_for_store_fir: function (e) {
4892 var index_c = e.currentTarget.dataset.ind; 4456 var index_c = e.currentTarget.dataset.ind;
4893 - var th=this; 4457 + var th = this;
4894 th.setData({ 4458 th.setData({
4895 fir_pick_index: index_c 4459 fir_pick_index: index_c
4896 }) 4460 })
@@ -4898,53 +4462,53 @@ Page({ @@ -4898,53 +4462,53 @@ Page({
4898 }, 4462 },
4899 4463
4900 //如果开启线下库存,已经急速库存才会使用 4464 //如果开启线下库存,已经急速库存才会使用
4901 - async check_the_pick(item,func){  
4902 - var th=this;  
4903 - var goodsinfo=th.data.sele_g;  
4904 - var erpwareid=goodsinfo.erpwareid;  
4905 - var plist=null;  
4906 - var lock=0; 4465 + async check_the_pick(item, func) {
  4466 + var th = this;
  4467 + var goodsinfo = th.data.sele_g;
  4468 + var erpwareid = goodsinfo.erpwareid;
  4469 + var plist = null;
  4470 + var lock = 0;
4907 4471
4908 //---如果是活动的时候,同时不是普通购买--- 4472 //---如果是活动的时候,同时不是普通购买---
4909 - if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) { 4473 + if ((th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) && !th.data.is_normal) {
4910 func(); return false; 4474 func(); return false;
4911 } 4475 }
4912 4476
4913 - if(this.data.sales_rules!=2){ 4477 + if (this.data.sales_rules != 2) {
4914 func(); 4478 func();
4915 - }else{ 4479 + } else {
4916 4480
4917 //先读取门店的lock 4481 //先读取门店的lock
4918 - await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{  
4919 - data:{store_id:os.stoid,wareId:goodsinfo.goods_id,storageId:item.pickup_id,pageSize:1000}  
4920 - }).then(res=>{  
4921 - if(res.data.code==0 && res.data.data.total>0){  
4922 - for(var i in res.data.data.pageData )  
4923 - lock+=res.data.data.pageData[i].outQty; 4482 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
  4483 + data: { store_id: os.stoid, wareId: goodsinfo.goods_id, storageId: item.pickup_id, pageSize: 1000 }
  4484 + }).then(res => {
  4485 + if (res.data.code == 0 && res.data.data.total > 0) {
  4486 + for (var i in res.data.data.pageData)
  4487 + lock += res.data.data.pageData[i].outQty;
4924 } 4488 }
4925 }) 4489 })
4926 //读取线下的门店库存 4490 //读取线下的门店库存
4927 - await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{  
4928 - data:{storageNos:item.pickup_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}  
4929 - }).then(res=>{  
4930 - if(res.data.code==0 && res.data.data.total>0){  
4931 - plist=res.data.data.pageData[0]; 4491 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
  4492 + data: { storageNos: item.pickup_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid }
  4493 + }).then(res => {
  4494 + if (res.data.code == 0 && res.data.data.total > 0) {
  4495 + plist = res.data.data.pageData[0];
4932 } 4496 }
4933 }) 4497 })
4934 4498
4935 - if(plist && plist.CanOutQty-lock>0){  
4936 - item.CanOutQty=plist.CanOutQty-lock; 4499 + if (plist && plist.CanOutQty - lock > 0) {
  4500 + item.CanOutQty = plist.CanOutQty - lock;
4937 func(); 4501 func();
4938 return false; 4502 return false;
4939 } 4503 }
4940 - getApp().my_warnning(item.pickup_name+"库存不足!", 0, th); 4504 + getApp().my_warnning(item.pickup_name + "库存不足!", 0, th);
4941 4505
4942 } 4506 }
4943 }, 4507 },
4944 4508
4945 4509
4946 //确定def_pick为选择的门店 4510 //确定def_pick为选择的门店
4947 - sure_pick: function(e) { 4511 + sure_pick: function (e) {
4948 var th = this; 4512 var th = this;
4949 var item = null; 4513 var item = null;
4950 var openindstore = th.data.open_ind_store; 4514 var openindstore = th.data.open_ind_store;
@@ -4962,20 +4526,20 @@ Page({ @@ -4962,20 +4526,20 @@ Page({
4962 item = th.data.sec_sto.s_arr[index]; 4526 item = th.data.sec_sto.s_arr[index];
4963 } 4527 }
4964 4528
4965 - if(!th.data.sele_g) return false;  
4966 - //判断门店的配送方式是不是匹配  
4967 - var g_distr_type = th.data.sele_g.distr_type;  
4968 - if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){  
4969 - wx.showToast({  
4970 - title: "门店配送方式不匹配",  
4971 - icon: 'none',  
4972 - duration: 2000  
4973 - });  
4974 - return false;  
4975 - }  
4976 - 4529 + if (!th.data.sele_g) return false;
  4530 + //判断门店的配送方式是不是匹配
  4531 + var g_distr_type = th.data.sele_g.distr_type;
  4532 + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) {
  4533 + wx.showToast({
  4534 + title: "门店配送方式不匹配",
  4535 + icon: 'none',
  4536 + duration: 2000
  4537 + });
  4538 + return false;
  4539 + }
  4540 +
4977 //--回调函数的用法-- 4541 //--回调函数的用法--
4978 - th.check_the_pick(item,function(){ 4542 + th.check_the_pick(item, function () {
4979 th.setData({ 4543 th.setData({
4980 def_pick_store: item, 4544 def_pick_store: item,
4981 sto_sele_name: item.pickup_name, 4545 sto_sele_name: item.pickup_name,
@@ -5011,15 +4575,15 @@ Page({ @@ -5011,15 +4575,15 @@ Page({
5011 choice_sort_store: 0, 4575 choice_sort_store: 0,
5012 sort_store: 0 4576 sort_store: 0
5013 }) 4577 })
5014 - }  
5015 - //如果商品没有其他活动,要取一下线下价格  
5016 - th.get_off_price(); 4578 + }
  4579 + //如果商品没有其他活动,要取一下线下价格
  4580 + th.get_off_price();
5017 }) 4581 })
5018 }, 4582 },
5019 //---点击二级之后的选择--- 4583 //---点击二级之后的选择---
5020 - choose_for_store: function(e) { 4584 + choose_for_store: function (e) {
5021 var index_c = e.currentTarget.dataset.ind; 4585 var index_c = e.currentTarget.dataset.ind;
5022 - var th=this; 4586 + var th = this;
5023 th.setData({ 4587 th.setData({
5024 sec_pick_index: index_c, 4588 sec_pick_index: index_c,
5025 fir_pick_index: index_c 4589 fir_pick_index: index_c
@@ -5027,7 +4591,7 @@ Page({ @@ -5027,7 +4591,7 @@ Page({
5027 4591
5028 }, 4592 },
5029 //把选择的门店设置成默认的门店def_pick 4593 //把选择的门店设置成默认的门店def_pick
5030 - set_def_pick: function(e) { 4594 + set_def_pick: function (e) {
5031 var th = this; 4595 var th = this;
5032 var item = null; 4596 var item = null;
5033 if (th.data.choice_sort_store == 0) { 4597 if (th.data.choice_sort_store == 0) {
@@ -5041,30 +4605,30 @@ Page({ @@ -5041,30 +4605,30 @@ Page({
5041 var index = th.data.sec_pick_index; 4605 var index = th.data.sec_pick_index;
5042 item = th.data.sec_sto.s_arr[index]; 4606 item = th.data.sec_sto.s_arr[index];
5043 } 4607 }
5044 -  
5045 - //判断门店的配送方式是不是匹配  
5046 - var g_distr_type = th.data.sele_g.distr_type;  
5047 - if(item.distr_type!=0 && g_distr_type!=0 && item.distr_type!=g_distr_type){  
5048 - wx.showToast({  
5049 - title: "门店配送方式不匹配",  
5050 - icon: 'none',  
5051 - duration: 2000  
5052 - });  
5053 - return false;  
5054 - } 4608 +
  4609 + //判断门店的配送方式是不是匹配
  4610 + var g_distr_type = th.data.sele_g.distr_type;
  4611 + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) {
  4612 + wx.showToast({
  4613 + title: "门店配送方式不匹配",
  4614 + icon: 'none',
  4615 + duration: 2000
  4616 + });
  4617 + return false;
  4618 + }
5055 4619
5056 //先设置之前,要判断是不是有库存 4620 //先设置之前,要判断是不是有库存
5057 - th.check_the_pick(item,function(){ 4621 + th.check_the_pick(item, function () {
5058 var store_id = o.stoid; 4622 var store_id = o.stoid;
5059 var user_id = getApp().globalData.user_id; 4623 var user_id = getApp().globalData.user_id;
5060 var def_pickup_id = item.pickup_id; 4624 var def_pickup_id = item.pickup_id;
5061 4625
5062 getApp().request.put('/api/weshop/users/update', { 4626 getApp().request.put('/api/weshop/users/update', {
5063 data: { 4627 data: {
5064 - user_id:user_id,  
5065 - def_pickup_id:def_pickup_id 4628 + user_id: user_id,
  4629 + def_pickup_id: def_pickup_id
5066 }, 4630 },
5067 - success: function(res) { 4631 + success: function (res) {
5068 if (res.data.code == 0) { 4632 if (res.data.code == 0) {
5069 if (th.data.choice_sort_store == 0) th.setData({ 4633 if (th.data.choice_sort_store == 0) th.setData({
5070 fir_pick_index: 0 4634 fir_pick_index: 0
@@ -5072,7 +4636,7 @@ Page({ @@ -5072,7 +4636,7 @@ Page({
5072 getApp().globalData.pk_store = item; 4636 getApp().globalData.pk_store = item;
5073 } else { 4637 } else {
5074 //s.showWarning("设置默认门店地址失败", null, 500, !1); 4638 //s.showWarning("设置默认门店地址失败", null, 500, !1);
5075 - getApp().my_warnning("设置默认门店地址失败",0,th) 4639 + getApp().my_warnning("设置默认门店地址失败", 0, th)
5076 } 4640 }
5077 4641
5078 } 4642 }
@@ -5121,27 +4685,27 @@ Page({ @@ -5121,27 +4685,27 @@ Page({
5121 sort_store: 0, 4685 sort_store: 0,
5122 }) 4686 })
5123 } 4687 }
5124 -  
5125 - //如果商品没有其他活动,要取一下线下价格  
5126 - th.get_off_price();  
5127 - 4688 +
  4689 + //如果商品没有其他活动,要取一下线下价格
  4690 + th.get_off_price();
  4691 +
5128 }) 4692 })
5129 }, 4693 },
5130 4694
5131 - wait_for_store_config: function() { 4695 + wait_for_store_config: function () {
5132 var th = this; 4696 var th = this;
5133 - var t_time = setInterval(function() { 4697 + var t_time = setInterval(function () {
5134 if (th.data.bconfig == null) false; 4698 if (th.data.bconfig == null) false;
5135 var e = th.data.bconfig; 4699 var e = th.data.bconfig;
5136 if (e && e.is_sort_storage) { 4700 if (e && e.is_sort_storage) {
5137 wx.getLocation({ 4701 wx.getLocation({
5138 type: 'gcj02', 4702 type: 'gcj02',
5139 - success: function(res) { 4703 + success: function (res) {
5140 th.data.lat = res.latitude; 4704 th.data.lat = res.latitude;
5141 th.data.lon = res.longitude; 4705 th.data.lon = res.longitude;
5142 th.data.is_get_local_ok = 1; 4706 th.data.is_get_local_ok = 1;
5143 }, 4707 },
5144 - fail: function(res) { 4708 + fail: function (res) {
5145 if (res.errCode == 2) { 4709 if (res.errCode == 2) {
5146 th.setData({ 4710 th.setData({
5147 is_gps: 0 4711 is_gps: 0
@@ -5166,9 +4730,9 @@ Page({ @@ -5166,9 +4730,9 @@ Page({
5166 }, 500) 4730 }, 500)
5167 }, 4731 },
5168 //显示全部 4732 //显示全部
5169 - toggleHandler: function(e) { 4733 + toggleHandler: function (e) {
5170 var that = this, 4734 var that = this,
5171 - index = e.currentTarget.dataset.index; 4735 + index = e.currentTarget.dataset.index;
5172 for (var i = 0; i < that.data.comments.length; i++) { 4736 for (var i = 0; i < that.data.comments.length; i++) {
5173 if (index == i) { 4737 if (index == i) {
5174 for (var i = 0; i < that.data.comments.length; i++) { 4738 for (var i = 0; i < that.data.comments.length; i++) {
@@ -5183,9 +4747,9 @@ Page({ @@ -5183,9 +4747,9 @@ Page({
5183 }, 4747 },
5184 4748
5185 //收起更多 4749 //收起更多
5186 - toggleContent: function(e) { 4750 + toggleContent: function (e) {
5187 var that = this, 4751 var that = this,
5188 - index = e.currentTarget.dataset.index; 4752 + index = e.currentTarget.dataset.index;
5189 for (var i = 0; i < that.data.comments.length; i++) { 4753 for (var i = 0; i < that.data.comments.length; i++) {
5190 if (index == i) { 4754 if (index == i) {
5191 that.data.comments[index].auto = true; 4755 that.data.comments[index].auto = true;
@@ -5201,390 +4765,385 @@ Page({ @@ -5201,390 +4765,385 @@ Page({
5201 getPlusCardType: function (func) { 4765 getPlusCardType: function (func) {
5202 var storid = os.stoid; 4766 var storid = os.stoid;
5203 var th = this; 4767 var th = this;
5204 - var user=getApp().globalData.userInfo;  
5205 - if(!user) return false; 4768 + var user = getApp().globalData.userInfo;
  4769 + if (!user) return false;
5206 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { 4770 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
5207 var plusCard = res.data.data; 4771 var plusCard = res.data.data;
5208 var arr = [1219, 2089, 3031]; 4772 var arr = [1219, 2089, 3031];
5209 var new_arr = new Array(); 4773 var new_arr = new Array();
5210 - var card_name_map=new Map();  
5211 -  
5212 - var list=[];  
5213 - for (var i = 0; i < plusCard.length; i++) {  
5214 - if((!user || user.card_field==null || user.card_field=="") && plusCard[i].IsStopBuy==true) continue;  
5215 - var name="card"+plusCard[i].CorrPrice.toLowerCase();  
5216 - card_name_map.set(name,plusCard[i].CardName);  
5217 - list.push(plusCard[i]); 4774 + var card_name_map = new Map();
  4775 +
  4776 + var list = [];
  4777 + for (var i = 0; i < plusCard.length; i++) {
  4778 + if ((!user || user.card_field == null || user.card_field == "") && plusCard[i].IsStopBuy == true) continue;
  4779 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  4780 + card_name_map.set(name, plusCard[i].CardName);
  4781 + list.push(plusCard[i]);
5218 } 4782 }
5219 -  
5220 - var ob={"card_list":list,"name_map":card_name_map}; 4783 +
  4784 + var ob = { "card_list": list, "name_map": card_name_map };
5221 func(ob); 4785 func(ob);
5222 }) 4786 })
5223 }, 4787 },
5224 4788
5225 - go_plus:function(){ 4789 + go_plus: function () {
5226 getApp().goto("/pages/user/plus/plus"); 4790 getApp().goto("/pages/user/plus/plus");
5227 }, 4791 },
5228 - go_card_info:function(){ 4792 + go_card_info: function () {
5229 getApp().goto("/pages/user/cardinfo/cardinfo"); 4793 getApp().goto("/pages/user/cardinfo/cardinfo");
5230 }, 4794 },
5231 //-- 根据ID拿出门店 -- 4795 //-- 根据ID拿出门店 --
5232 - get_pick_from_list(pid){  
5233 - var all_pick_list=this.data.all_pick_list;  
5234 - for(var i in all_pick_list){  
5235 - var item=all_pick_list[i];  
5236 - if(item.pickup_id==pid){ 4796 + get_pick_from_list(pid) {
  4797 + var all_pick_list = this.data.all_pick_list;
  4798 + for (var i in all_pick_list) {
  4799 + var item = all_pick_list[i];
  4800 + if (item.pickup_id == pid) {
5237 return item; 4801 return item;
5238 } 4802 }
5239 } 4803 }
5240 }, 4804 },
5241 //-----显示优惠券的时候情况----- 4805 //-----显示优惠券的时候情况-----
5242 - show_more_cx:function () {  
5243 - if(this.data.is_more_cx){  
5244 - this.setData({is_more_cx:0});  
5245 - }else{  
5246 - this.setData({is_more_cx:1}); 4806 + show_more_cx: function () {
  4807 + if (this.data.is_more_cx) {
  4808 + this.setData({ is_more_cx: 0 });
  4809 + } else {
  4810 + this.setData({ is_more_cx: 1 });
5247 } 4811 }
5248 }, 4812 },
5249 4813
5250 //----跳转到搭配购买---- 4814 //----跳转到搭配购买----
5251 - go_prom_list:function () {  
5252 -  
5253 - var url= "../../../../packageA/pages/prom_list/prom_list?goods_id="+this.data.gid;  
5254 - var room_id= getApp().globalData.room_id;  
5255 - if(room_id && this.data.gid==getApp().globalData.room_goods_id){  
5256 - url+="&room_id="+room_id;  
5257 - }  
5258 - wx.navigateTo({ url: url,}) 4815 + go_prom_list: function () {
  4816 +
  4817 + var url = "../../../../packageA/pages/prom_list/prom_list?goods_id=" + this.data.gid;
  4818 + var room_id = getApp().globalData.room_id;
  4819 + if (room_id && this.data.gid == getApp().globalData.room_goods_id) {
  4820 + url += "&room_id=" + room_id;
  4821 + }
  4822 + wx.navigateTo({ url: url, })
5259 }, 4823 },
5260 4824
5261 //---检查有没有优惠活动--- 4825 //---检查有没有优惠活动---
5262 - check_is_youhui:function(gid,is_nor){  
5263 - var th=this;  
5264 - //如果是普通购买的时候,要进行调用  
5265 - if(is_nor){  
5266 - getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid+"/"+gid, {  
5267 - success:function(res){  
5268 - if(res.data.code==0){  
5269 - var r_data=res.data.data;  
5270 - th.setData({  
5271 - prom_goods:r_data.promGoodsLists,  
5272 - })  
5273 - th.is_show_more_buy();  
5274 - }  
5275 - },  
5276 - })  
5277 -  
5278 - }else{  
5279 - //调用接口判断订单优惠,  
5280 - getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {  
5281 - success:function(res){  
5282 - if(res.data.code==0){  
5283 - var r_data=res.data.data;  
5284 - var max=0,min=0;  
5285 - if(r_data.collocationList){  
5286 - for(var i in r_data.collocationList){  
5287 - if(max==0) max=r_data.collocationList[i].price;  
5288 - if(min==0) min=r_data.collocationList[i].price;  
5289 -  
5290 - if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;  
5291 - if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;  
5292 - }  
5293 - r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);  
5294 - r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);  
5295 - }  
5296 - th.setData({  
5297 - order_prom:r_data.promOrder,  
5298 - collocationGoods:r_data.collocationPromList,  
5299 - prom_goods:r_data.promGoodsLists,  
5300 - })  
5301 - th.is_show_more_buy();  
5302 - }  
5303 - }  
5304 -  
5305 - })  
5306 - }  
5307 -  
5308 -  
5309 - },  
5310 -  
5311 - closePoster() {  
5312 - this.setData({  
5313 - showPoster: false,  
5314 - });  
5315 - },  
5316 -  
5317 - // 保存图片到手机  
5318 - savePic() {  
5319 - console.log('保存图片');  
5320 - var self = this;  
5321 - // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限  
5322 - this.getSetting().then((res) => {  
5323 - // 判断用户是否授权了保存到相册的权限,如果没有发起授权  
5324 - if (!res.authSetting['scope.writePhotosAlbum']) {  
5325 - this.authorize().then(() => {  
5326 - // 同意授权后保存下载文件  
5327 - this.saveImage(self.data.shareImgPath)  
5328 - .then(() => {  
5329 - self.setData({  
5330 - showPoster: false  
5331 - });  
5332 - });  
5333 - })  
5334 - } else {  
5335 - // 如果已经授权,保存下载文件  
5336 - this.saveImage(self.data.shareImgPath)  
5337 - .then(() => {  
5338 - self.setData({  
5339 - showPoster: false  
5340 - });  
5341 - });  
5342 - }  
5343 -  
5344 - })  
5345 - },  
5346 -  
5347 - // 获取用户已经授予了哪些权限  
5348 - getSetting() {  
5349 - return new Promise((resolve, reject) => {  
5350 - wx.getSetting({  
5351 - success: res => {  
5352 - resolve(res)  
5353 - }  
5354 - })  
5355 - })  
5356 - },  
5357 -  
5358 - // 发起首次授权请求  
5359 - authorize() {  
5360 - // isFirst 用来记录是否为首次发起授权,  
5361 - // 如果首次授权拒绝后,isFirst赋值为1  
5362 - let isFirst = wx.getStorageSync('isFirst') || 0;  
5363 - return new Promise((resolve, reject) => {  
5364 - wx.authorize({  
5365 - scope: 'scope.writePhotosAlbum',  
5366 - // 同意授权  
5367 - success: () => {  
5368 - resolve();  
5369 - },  
5370 - // 拒绝授权,这里是用户拒绝授权后的回调  
5371 - fail: res => {  
5372 - if(isFirst === 0) {  
5373 - wx.setStorageSync('isFirst', 1);  
5374 - wx.showToast({  
5375 - title: '保存失败',  
5376 - icon: 'none',  
5377 - duration: 1000  
5378 - })  
5379 - } else {  
5380 - this.showModal();  
5381 - }  
5382 - console.log('拒绝授权');  
5383 - reject();  
5384 - }  
5385 - })  
5386 - })  
5387 - },  
5388 -  
5389 -  
5390 - // 保存图片到系统相册  
5391 - saveImage(saveUrl) {  
5392 - var self = this;  
5393 - return new Promise((resolve, reject) => {  
5394 - wx.saveImageToPhotosAlbum({  
5395 - filePath: saveUrl,  
5396 - success: (res) => {  
5397 - wx.showToast({  
5398 - title: '保存成功',  
5399 - duration: 1000,  
5400 - });  
5401 - self.setData({  
5402 - showPlaybill: 'true'  
5403 - });  
5404 - resolve();  
5405 - },  
5406 - fail: () => {  
5407 - wx.showToast({  
5408 - title: '保存失败',  
5409 - duration: 1000,  
5410 - });  
5411 - }  
5412 - })  
5413 - })  
5414 - },  
5415 -  
5416 - previewImage() {  
5417 - this.data.show_prew_img=1;  
5418 - wx.previewImage({  
5419 - //将图片预览出来  
5420 - urls: [this.data.shareImgPath]  
5421 - });  
5422 - },  
5423 -  
5424 - is_show_more_buy:function(){  
5425 - var prom_goods=this.data.prom_goods;  
5426 - var per_price=this.data.sele_g.shop_price  
5427 - if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){  
5428 - per_price=this.data.sele_g[this.data.card_field];  
5429 - }  
5430 - var all_price=per_price*this.data.goodsInputNum;  
5431 - var con=null;  
5432 - for(var i in prom_goods){  
5433 - var item=prom_goods[i];  
5434 - if(item.prom_type==1){  
5435 - if(item.condition>this.data.goodsInputNum) {  
5436 - con=item;  
5437 - con.need=(item.condition-this.data.goodsInputNum).toFixed(2)+"件";  
5438 - break;  
5439 - }  
5440 - }else{  
5441 - if(item.condition>all_price){  
5442 - con=item;  
5443 - con.need=(item.condition-all_price).toFixed(2)+"元";  
5444 - break;  
5445 - }  
5446 - }  
5447 - }  
5448 -  
5449 - this.setData({hui_condition:con});  
5450 -  
5451 - },  
5452 -  
5453 - //-- 积分购 --  
5454 - go_pay_integral:function(){  
5455 - this.get_sto(0)  
5456 - this.setData({openSpecModal_inte:1,goodsInputNum:1});  
5457 - },  
5458 - //-- 积分购普通购买 --  
5459 - go_pay_integral_normal:function(){  
5460 - var th=this;  
5461 - if (th.data.sku_g_pt) {  
5462 - this.get_sto(1)  
5463 - this.setData({openSpecModal_inte_normal:1});  
5464 - }else{  
5465 - th.get_sto(1);  
5466 - th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function() {  
5467 - th.setData({  
5468 - is_normal: 1,  
5469 - openSpecModal_inte_normal:1  
5470 - });  
5471 - });  
5472 - }  
5473 - this.check_is_youhui(th.data.gid,1);  
5474 - },  
5475 -  
5476 - closeSpecModal_inte:function(){  
5477 - this.setData({openSpecModal_inte:0});  
5478 - } ,  
5479 - closeSpecModal_inte_normal:function(){  
5480 - this.setData({openSpecModal_inte_normal:0});  
5481 - //要进行还原  
5482 - this.get_sto();  
5483 - this.setData({  
5484 - sele_g:this.data.data,  
5485 - gid:this.data.data.goods_id  
5486 - })  
5487 -  
5488 - this.sele_spec_chech_activity();  
5489 - },  
5490 -  
5491 - addCart_inte:function(t){  
5492 - this.add_cart_func_inte(t);  
5493 - },  
5494 -  
5495 -  
5496 -  
5497 -  
5498 - onShareTimeline() {  
5499 - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:'';  
5500 - if(!store_name)  
5501 - store_name=getApp().globalData.setting.appName;  
5502 - return {  
5503 - title:this.data.data.goods_name + '-' + store_name,  
5504 - imageUrl:this.data.gallery[0].image_url,  
5505 - }  
5506 - },  
5507 -  
5508 -  
5509 - clickCollapse() {  
5510 - this.setData({  
5511 - flag: !this.data.flag,  
5512 - })  
5513 - },  
5514 -  
5515 - clickShare() {  
5516 - this.setData({  
5517 - share_hidden: true,  
5518 - });  
5519 - },  
5520 -  
5521 - send() {  
5522 - this.setData({  
5523 - share_hidden:false,  
5524 - });  
5525 - },  
5526 -  
5527 - cancel() {  
5528 - this.setData({  
5529 - share_hidden:false,  
5530 - });  
5531 - },  
5532 -  
5533 - //积分购和拼团的普通购买的的时候,要判断有没有全场优惠活动  
5534 - check_nor_promgood(goods_id,back){  
5535 - getApp().request.get("/api/weshop/goods/getGoodsPromNormal/"+os.stoid+"/"+goods_id,{  
5536 - success:function(res){  
5537 - if(res.data.code==0 && res.data.data && res.data.data.promGoodsLists && res.data.data.promGoodsLists.length>0){  
5538 - var obj={  
5539 - act_id:res.data.data.promGoodsLists[0].prom_id,  
5540 - }  
5541 - back(obj);  
5542 - }else{  
5543 - back(0)  
5544 - }  
5545 - }  
5546 - })  
5547 - },  
5548 -  
5549 - go_zh:function (e) {  
5550 - var id=e.currentTarget.dataset.id;  
5551 - getApp().goto("/packageB/pages/zuhegou/index/index?id="+id);  
5552 - },  
5553 -  
5554 - check_zh_acting:function (func) {  
5555 - var isok = 1,item=this.data.sele_g;  
5556 - //如果有组合购  
5557 - var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id;  
5558 - getApp().request.promiseGet(url, {}).then(res => {  
5559 - if(res.data.code==0 && res.data.data){  
5560 - if(res.data.data.is_show!=1){  
5561 - isok=0;  
5562 - }  
5563 - //如果活动已经结束  
5564 - if(res.data.data.is_end==1){  
5565 - isok=0;  
5566 - }  
5567 - //已经结束  
5568 - if(ut.gettimestamp()>res.data.data.end_time){  
5569 - isok=0;  
5570 - }  
5571 - //还未开始  
5572 - if(ut.gettimestamp()<res.data.data.start_time){  
5573 - isok=0;  
5574 - }  
5575 -  
5576 - }else{  
5577 - //未找到商品的活动  
5578 - isok = 0;  
5579 - }  
5580 - item.act=res.data.data;  
5581 - func(isok);  
5582 - })  
5583 - }  
5584 -  
5585 -  
5586 -  
5587 -  
5588 -  
5589 - 4826 + check_is_youhui: function (gid, is_nor) {
  4827 + var th = this;
  4828 + //如果是普通购买的时候,要进行调用
  4829 + if (is_nor) {
  4830 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid + "/" + gid, {
  4831 + success: function (res) {
  4832 + if (res.data.code == 0) {
  4833 + var r_data = res.data.data;
  4834 + th.setData({
  4835 + prom_goods: r_data.promGoodsLists,
  4836 + })
  4837 + th.is_show_more_buy();
  4838 + }
  4839 + },
  4840 + })
  4841 +
  4842 + } else {
  4843 + //调用接口判断订单优惠,
  4844 + getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + gid + "/0", {
  4845 + success: function (res) {
  4846 + if (res.data.code == 0) {
  4847 + var r_data = res.data.data;
  4848 + var max = 0, min = 0;
  4849 + if (r_data.collocationList) {
  4850 + for (var i in r_data.collocationList) {
  4851 + if (max == 0) max = r_data.collocationList[i].price;
  4852 + if (min == 0) min = r_data.collocationList[i].price;
  4853 +
  4854 + if (max < parseFloat(r_data.collocationList[i].price)) max = r_data.collocationList[i].price;
  4855 + if (min > parseFloat(r_data.collocationList[i].price)) min = r_data.collocationList[i].price;
  4856 + }
  4857 + r_data.collocationPromList.max = (max + th.data.data.shop_price).toFixed(2);
  4858 + r_data.collocationPromList.min = (min + th.data.data.shop_price).toFixed(2);
  4859 + }
  4860 + th.setData({
  4861 + order_prom: r_data.promOrder,
  4862 + collocationGoods: r_data.collocationPromList,
  4863 + prom_goods: r_data.promGoodsLists,
  4864 + })
  4865 + th.is_show_more_buy();
  4866 + }
  4867 + }
  4868 +
  4869 + })
  4870 + }
  4871 +
  4872 +
  4873 + },
  4874 +
  4875 + closePoster() {
  4876 + this.setData({
  4877 + showPoster: false,
  4878 + });
  4879 + },
  4880 +
  4881 + // 保存图片到手机
  4882 + savePic() {
  4883 + console.log('保存图片');
  4884 + var self = this;
  4885 + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
  4886 + this.getSetting().then((res) => {
  4887 + // 判断用户是否授权了保存到相册的权限,如果没有发起授权
  4888 + if (!res.authSetting['scope.writePhotosAlbum']) {
  4889 + this.authorize().then(() => {
  4890 + // 同意授权后保存下载文件
  4891 + this.saveImage(self.data.shareImgPath)
  4892 + .then(() => {
  4893 + self.setData({
  4894 + showPoster: false
  4895 + });
  4896 + });
  4897 + })
  4898 + } else {
  4899 + // 如果已经授权,保存下载文件
  4900 + this.saveImage(self.data.shareImgPath)
  4901 + .then(() => {
  4902 + self.setData({
  4903 + showPoster: false
  4904 + });
  4905 + });
  4906 + }
  4907 +
  4908 + })
  4909 + },
  4910 +
  4911 + // 获取用户已经授予了哪些权限
  4912 + getSetting() {
  4913 + return new Promise((resolve, reject) => {
  4914 + wx.getSetting({
  4915 + success: res => {
  4916 + resolve(res)
  4917 + }
  4918 + })
  4919 + })
  4920 + },
  4921 +
  4922 + // 发起首次授权请求
  4923 + authorize() {
  4924 + // isFirst 用来记录是否为首次发起授权,
  4925 + // 如果首次授权拒绝后,isFirst赋值为1
  4926 + let isFirst = wx.getStorageSync('isFirst') || 0;
  4927 + return new Promise((resolve, reject) => {
  4928 + wx.authorize({
  4929 + scope: 'scope.writePhotosAlbum',
  4930 + // 同意授权
  4931 + success: () => {
  4932 + resolve();
  4933 + },
  4934 + // 拒绝授权,这里是用户拒绝授权后的回调
  4935 + fail: res => {
  4936 + if (isFirst === 0) {
  4937 + wx.setStorageSync('isFirst', 1);
  4938 + wx.showToast({
  4939 + title: '保存失败',
  4940 + icon: 'none',
  4941 + duration: 1000
  4942 + })
  4943 + } else {
  4944 + this.showModal();
  4945 + }
  4946 + console.log('拒绝授权');
  4947 + reject();
  4948 + }
  4949 + })
  4950 + })
  4951 + },
  4952 +
  4953 +
  4954 + // 保存图片到系统相册
  4955 + saveImage(saveUrl) {
  4956 + var self = this;
  4957 + return new Promise((resolve, reject) => {
  4958 + wx.saveImageToPhotosAlbum({
  4959 + filePath: saveUrl,
  4960 + success: (res) => {
  4961 + wx.showToast({
  4962 + title: '保存成功',
  4963 + duration: 1000,
  4964 + });
  4965 + self.setData({
  4966 + showPlaybill: 'true'
  4967 + });
  4968 + resolve();
  4969 + },
  4970 + fail: () => {
  4971 + wx.showToast({
  4972 + title: '保存失败',
  4973 + duration: 1000,
  4974 + });
  4975 + }
  4976 + })
  4977 + })
  4978 + },
  4979 +
  4980 + previewImage() {
  4981 + this.data.show_prew_img = 1;
  4982 + wx.previewImage({
  4983 + //将图片预览出来
  4984 + urls: [this.data.shareImgPath]
  4985 + });
  4986 + },
  4987 +
  4988 + is_show_more_buy: function () {
  4989 + var prom_goods = this.data.prom_goods;
  4990 + var per_price = this.data.sele_g.shop_price
  4991 + if (this.data.card_field && this.data.sele_g[this.data.card_field] > 0) {
  4992 + per_price = this.data.sele_g[this.data.card_field];
  4993 + }
  4994 + var all_price = per_price * this.data.goodsInputNum;
  4995 + var con = null;
  4996 + for (var i in prom_goods) {
  4997 + var item = prom_goods[i];
  4998 + if (item.prom_type == 1) {
  4999 + if (item.condition > this.data.goodsInputNum) {
  5000 + con = item;
  5001 + con.need = (item.condition - this.data.goodsInputNum).toFixed(2) + "件";
  5002 + break;
  5003 + }
  5004 + } else {
  5005 + if (item.condition > all_price) {
  5006 + con = item;
  5007 + con.need = (item.condition - all_price).toFixed(2) + "元";
  5008 + break;
  5009 + }
  5010 + }
  5011 + }
  5012 +
  5013 + this.setData({ hui_condition: con });
  5014 +
  5015 + },
  5016 +
  5017 + //-- 积分购 --
  5018 + go_pay_integral: function () {
  5019 + this.get_sto(0)
  5020 + this.setData({ openSpecModal_inte: 1, goodsInputNum: 1 });
  5021 + },
  5022 + //-- 积分购普通购买 --
  5023 + go_pay_integral_normal: function () {
  5024 + var th = this;
  5025 + if (th.data.sku_g_pt) {
  5026 + this.get_sto(1)
  5027 + this.setData({ openSpecModal_inte_normal: 1 });
  5028 + } else {
  5029 + th.get_sto(1);
  5030 + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () {
  5031 + th.setData({
  5032 + is_normal: 1,
  5033 + openSpecModal_inte_normal: 1
  5034 + });
  5035 + });
  5036 + }
  5037 + this.check_is_youhui(th.data.gid, 1);
  5038 + },
  5039 +
  5040 + closeSpecModal_inte: function () {
  5041 + this.setData({ openSpecModal_inte: 0 });
  5042 + },
  5043 + closeSpecModal_inte_normal: function () {
  5044 + this.setData({ openSpecModal_inte_normal: 0 });
  5045 + //要进行还原
  5046 + this.get_sto();
  5047 + this.setData({
  5048 + sele_g: this.data.data,
  5049 + gid: this.data.data.goods_id
  5050 + })
  5051 +
  5052 + this.sele_spec_chech_activity();
  5053 + },
  5054 +
  5055 + addCart_inte: function (t) {
  5056 + this.add_cart_func_inte(t);
  5057 + },
  5058 +
  5059 +
  5060 +
  5061 +
  5062 + onShareTimeline() {
  5063 + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : '';
  5064 + if (!store_name)
  5065 + store_name = getApp().globalData.setting.appName;
  5066 + return {
  5067 + title: this.data.data.goods_name + '-' + store_name,
  5068 + imageUrl: this.data.gallery[0].image_url,
  5069 + }
  5070 + },
  5071 +
  5072 +
  5073 + clickCollapse() {
  5074 + this.setData({
  5075 + flag: !this.data.flag,
  5076 + })
  5077 + },
  5078 +
  5079 + clickShare() {
  5080 + this.setData({
  5081 + share_hidden: true,
  5082 + });
  5083 + },
  5084 +
  5085 + send() {
  5086 + this.setData({
  5087 + share_hidden: false,
  5088 + });
  5089 + },
  5090 +
  5091 + cancel() {
  5092 + this.setData({
  5093 + share_hidden: false,
  5094 + });
  5095 + },
  5096 +
  5097 + //积分购和拼团的普通购买的的时候,要判断有没有全场优惠活动
  5098 + check_nor_promgood(goods_id, back) {
  5099 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid + "/" + goods_id, {
  5100 + success: function (res) {
  5101 + if (res.data.code == 0 && res.data.data && res.data.data.promGoodsLists && res.data.data.promGoodsLists.length > 0) {
  5102 + var obj = {
  5103 + act_id: res.data.data.promGoodsLists[0].prom_id,
  5104 + }
  5105 + back(obj);
  5106 + } else {
  5107 + back(0)
  5108 + }
  5109 + }
  5110 + })
  5111 + },
  5112 +
  5113 + go_zh: function (e) {
  5114 + var id = e.currentTarget.dataset.id;
  5115 + getApp().goto("/packageB/pages/zuhegou/index/index?id=" + id);
  5116 + },
  5117 +
  5118 + check_zh_acting: function (func) {
  5119 + var isok = 1, item = this.data.sele_g;
  5120 + //如果有组合购
  5121 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.userInfo.user_id;
  5122 + getApp().request.promiseGet(url, {}).then(res => {
  5123 + if (res.data.code == 0 && res.data.data) {
  5124 + if (res.data.data.is_show != 1) {
  5125 + isok = 0;
  5126 + }
  5127 + //如果活动已经结束
  5128 + if (res.data.data.is_end == 1) {
  5129 + isok = 0;
  5130 + }
  5131 + //已经结束
  5132 + if (ut.gettimestamp() > res.data.data.end_time) {
  5133 + isok = 0;
  5134 + }
  5135 + //还未开始
  5136 + if (ut.gettimestamp() < res.data.data.start_time) {
  5137 + isok = 0;
  5138 + }
  5139 +
  5140 + } else {
  5141 + //未找到商品的活动
  5142 + isok = 0;
  5143 + }
  5144 + item.act = res.data.data;
  5145 + func(isok);
  5146 + })
  5147 + }
  5148 +
5590 }); 5149 });
packageC/pages/presell/goodsInfo/goodsInfo.wxml
1 -<import src="../../../utils/wxParse/wxParse.wxml"></import> 1 +<import src="../../../../utils/wxParse/wxParse.wxml"></import>
2 <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> 2 <wxs module="filters" src="../../../../utils/filter.wxs"></wxs>
3 <wxs module="g_filters" src="g_filter.wxs"></wxs> 3 <wxs module="g_filters" src="g_filter.wxs"></wxs>
4 <wxs module="tool" src="filter.wxs"></wxs> 4 <wxs module="tool" src="filter.wxs"></wxs>
5 -  
6 <!-- 商品内容区域,普通商品,秒杀,拼团 --> 5 <!-- 商品内容区域,普通商品,秒杀,拼团 -->
7 -<block wx:if="{{isshow}}">  
8 - <view class="container">  
9 - <view class="type-navbar">  
10 - <view class="type-box" wx:for="{{categories}}" wx:key="categories">  
11 - <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">  
12 - {{item.name}}  
13 - </view> 6 +<view class="container">
  7 + <view class="type-navbar">
  8 + <view class="type-box" wx:for="{{categories}}" wx:key="categories">
  9 + <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}">
  10 + {{item.name}}
14 </view> 11 </view>
15 </view> 12 </view>
16 -  
17 - <view class="goods-detail">  
18 - <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">  
19 - <!-- 视频 -->  
20 - <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}" 13 + </view>
  14 + <view class="goods-detail">
  15 + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
  16 + <!-- 视频 -->
  17 + <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}"
21 indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> --> 18 indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> -->
22 - <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">  
23 -  
24 - <view class="xc-videos-picture rel">  
25 - <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">  
26 -  
27 - <swiper-item wx:if="{{mapurl}}">  
28 - <view wx:if="{{noon == 0}}">  
29 - <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">  
30 - <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>  
31 - </image>  
32 - </view>  
33 - <view wx:else>  
34 - <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"> </video>  
35 - </view>  
36 - </swiper-item>  
37 -  
38 - <swiper-item wx:for="{{gallery}}" wx:key="gallery">  
39 - <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> -->  
40 - <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view>  
41 - </swiper-item>  
42 - </swiper>  
43 - <block wx:if="{{mapurl}}">  
44 - <view wx:if="{{hiddenn==1}}">  
45 - <view class="xc-imageCount">{{current}}/{{gallery.length}}</view> 19 + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
  20 + <view class="xc-videos-picture rel">
  21 + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
  22 + <swiper-item wx:if="{{mapurl}}">
  23 + <view wx:if="{{noon == 0}}">
  24 + <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">
  25 + <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>
  26 + </image>
46 </view> 27 </view>
47 - <view class="xc-video-picture abs">  
48 - <view class="xc-video" data-vipi="0" bindtap="videopicture">  
49 - <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">  
50 - 视频  
51 - </view>  
52 - </view>  
53 - <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">  
54 - <view>  
55 - 图片  
56 - </view> 28 + <view wx:else>
  29 + <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
  30 + </view>
  31 + </swiper-item>
  32 + <swiper-item wx:for="{{gallery}}" wx:key="gallery">
  33 + <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> -->
  34 + <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view>
  35 + </swiper-item>
  36 + </swiper>
  37 + <block wx:if="{{mapurl}}">
  38 + <view wx:if="{{hiddenn==1}}">
  39 + <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
  40 + </view>
  41 + <view class="xc-video-picture abs">
  42 + <view class="xc-video" data-vipi="0" bindtap="videopicture">
  43 + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">
  44 + 视频
57 </view> 45 </view>
58 </view> 46 </view>
59 - </block>  
60 - </view> 47 + <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">
  48 + <view>图片</view>
  49 + </view>
  50 + </view>
  51 + </block>
61 </view> 52 </view>
62 -  
63 -  
64 - <!----显示秒杀价,团购,积分购---->  
65 - <view class="prom_show rel" wx:if="{{prom_type==1}}">  
66 -  
67 - <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image>  
68 - <!-- <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> -->  
69 - <view class="abs price-container">  
70 - <view class="fs28">预售价</view>  
71 - <view>  
72 - <text class="rmb">99.99</text>  
73 - <text class="rmb line-through fs24 no-bold">125.00</text>  
74 - </view>  
75 - </view>  
76 - <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
77 - <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view>  
78 - <view class="secview flex abs fs24 xc-miaosha-time"> 53 + </view>
  54 + <view class="goo">
  55 + <view class="pt_view rel">
  56 + <!-- 许程 7. 24 -->
  57 + <image class="secondkill-img" src="{{iurl+'/miniapp/images/red_jx.png'}}"></image>
  58 + <!-- <view class=""> -->
  59 + <!-- <view class="flex" style='height:40rpx; margin-top:5rpx;'> -->
  60 + <view class="abs xc-qt-price fs28 xc-qtsign">预售价</view>
  61 + <view class="abs flex presell_price">
  62 + <view class="fs28 val" style="margin-right:100rpx">¥{{presellList.presell_price}}</view>
  63 + <view class="word-line fs26 xc-qtunit-price">
  64 + 零售价¥{{filters.toFix(data.market_price,2)}}
  65 + </view>
  66 + </view>
  67 + <!-- </view> -->
  68 + <view class="hy-stop word-color fs26 abs">距活动结束还有</view>
  69 + <!-- <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view> -->
  70 + <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">
79 <block wx:if="djs.day"> 71 <block wx:if="djs.day">
80 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.day}}</view>  
81 - <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
82 - </block>  
83 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
84 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
85 - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
86 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
87 - <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
88 - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view>  
89 - </view>  
90 - </view>  
91 -  
92 - <!----拼单---->  
93 - <view class="pt_show " wx:if="{{prom_type==6}}">  
94 - <view class="pt_view rel">  
95 - <!--许程 7. 24 -->  
96 - <image class="secondkill-img" src="{{prom_st==1? iurl+'/miniapp/images/red_jx.png':iurl+'/miniapp/images/blue_ks.png'}}"></image>  
97 - <view class="abs xc-qt-price">  
98 - <view class="flex" style='height:40rpx; margin-top:5rpx'>  
99 - <view class="flex fs35 xc-qtsign">¥</view>  
100 - <view class="fs50 val">{{prom_price}}</view> 72 + <view class='day-val' style="color:#d40022;margin-top:-34rpx;">
  73 + {{djs.day}}
101 </view> 74 </view>
102 - <view class="word-line fs20 xc-qtunit-price">零售价¥{{filters.toFix(data.market_price,2)}}</view>  
103 - </view>  
104 - <view class="abs white xc-nanber">  
105 - <text class="fs22">已拼{{prom_act.buy_num}}件</text>  
106 - <view class="flex" style='margin-top:-34rpx'>  
107 - <view class="xc-people-img">  
108 - <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image>  
109 - </view>  
110 - <view class="t-s fs20 xc-people-val">  
111 - {{prom_act.ct_num}}人拼  
112 - </view> 75 + <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color:#d40022">
  76 + 天
113 </view> 77 </view>
  78 + </block>
  79 + <view class='xc-time-val white t-c' style="background:#d40022">
  80 + {{djs.hou}}
114 </view> 81 </view>
115 - <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view>  
116 - <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view>  
117 - <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;">  
118 - <block wx:if="djs.day">  
119 - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}};margin-top:-34rpx;">{{djs.day}}</view>  
120 - <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view>  
121 - </block>  
122 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.hou}}</view>  
123 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view>  
124 - <view class='xc-time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.min}}</view>  
125 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}"> 分</view>  
126 - <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}">{{djs.sec}}</view>  
127 - <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> 82 + <view class="xc-time" style="color:#d40022">时</view>
  83 + <view class='xc-time-val white t-c' style="background:#d40022">
  84 + {{djs.min}}
128 </view> 85 </view>
  86 + <view class="xc-time" style="color:#d40022">分</view>
  87 + <view class='xc-time-val white t-c' style=";background:#d40022">
  88 + {{djs.sec}}
  89 + </view>
  90 + <view class="xc-time" style="color:#d40022">秒</view>
129 </view> 91 </view>
130 -  
131 - <view class="pt_fir pd20">  
132 - <!----显示团类型和团价格---->  
133 - <view class="pt_fir_title ">  
134 - <!-- 许程 商家团主页 -->  
135 - <view class="xc-goods-explain flex-vertical-between">  
136 - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}"> 92 + </view>
  93 + <view class="pt_fir pd20">
  94 + <!-- --显示团类型和团价格-- -->
  95 + <view class="pt_fir_title ">
  96 + <view class="xc-goods-explain flex-vertical-between">
  97 + <view class="xc-explain fs32 ellipsis-2">
137 {{data.goods_name}} 98 {{data.goods_name}}
138 </view> 99 </view>
139 -  
140 - <!-- 这个是分享按钮 -->  
141 - <view class="xc-share-frame t-c" bindtap="clickShare">  
142 - <view class="iconfont icon-share fs60"></view>  
143 - <view class="fs22 c-7b">分享</view>  
144 - </view> 100 + <!-- 这个是分享按钮 -->
  101 + <view class="xc-share-frame t-c" bindtap="clickShare">
  102 + <view class="iconfont icon-share fs60"></view>
  103 + <view class="fs22 c-7b">分享</view>
145 </view> 104 </view>
146 </view> 105 </view>
147 -  
148 - <!----显示价格,阶梯团---->  
149 - <block wx:if="{{prom_act.kttype==3}}">  
150 - <view class="jie_price flex">  
151 - <view style='margin-right:26rpx' wx:for="{{prom_act.ct_rylist}}">  
152 - <view class="fs35 word-color">  
153 - <text class="fs24">¥</text>{{item.price}}</view>  
154 - <view class="fs24 t-c xc-person-number ">满{{item.rynum}}人</view>  
155 - </view>  
156 - </view> 106 + </view>
  107 + <view class="fs24" style="padding-bottom:20rpx">
  108 + <view class="stock" style="color:#999">尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}}</view>
  109 + </view>
  110 + <view class="goods-num">
  111 + <block wx:if="{{presellList.virtual_qty}}">
  112 + <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view>
  113 + <view class="stock">限购:{{presellList.vip_butyqty}}件</view>
  114 + <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view>
  115 + </block>
  116 + <block wx:else>
  117 + <view class="stock">总数量:{{presellList.presell_sumqty}}件</view>
  118 + <view class="stock">限购:{{presellList.vip_butyqty}}件</view>
  119 + <view class="sales">已购:{{presellList.buy_goodnum}}件</view>
157 </block> 120 </block>
158 </view> 121 </view>
159 -  
160 - <view class="t_gz" wx:if="{{is_show_gz==1}}">  
161 - {{prom_act.remark}} 122 + </view>
  123 + <view class="t_gz" wx:if="{{is_show_gz==1}}">{{prom_act.remark}}</view>
  124 + </view>
  125 + <!-- 门店收货地址 -->
  126 + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}">
  127 + <view class="address_frame" bindtap="choice_store" data-ind="0">
  128 + <view class="flex-vertical-between ">
  129 + <view class="flex-vertical select_store_height">
  130 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  131 + <view class="fs30" style="color:black;">选择门店</view>
  132 + </view>
  133 + <view class="red_bb fs26">
  134 + 更多门店
  135 + <text class="bg_jj"></text>
  136 + </view>
162 </view> 137 </view>
163 -  
164 - <!----------正有多少人在开团---------->  
165 - <view class="pt_fir se2 bdt16" wx:if="{{teamgroup}}">  
166 - <view class="xc-partner-frame">  
167 - <view class="zzk-1 flex jc_sb" bindtap="go_t_more">  
168 - <view class="pdl10">以下小伙伴正在拼单,可直接参与</view>  
169 - <view class="ckgd flex ai_c">查看详细  
170 - <view class="bg_right arrow-one"></view>  
171 - </view> 138 + <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  139 + <view class="flex-space-between address ai_end pdv10">
  140 + <view>
  141 + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
  142 + </view>
  143 + <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}">
  144 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
172 </view> 145 </view>
173 </view> 146 </view>
174 - <view class='group' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup">  
175 - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}">  
176 - <!-- <view class="flex ai_c"> -->  
177 - <!--//选项框头像-->  
178 - <view class='gtou'>  
179 - <image src='{{item.user.head_pic}}'></image>  
180 - </view>  
181 - <!--//等你来拼-->  
182 - <view class='gdn ellipsis-1'>{{item.user.nickname}}</view>  
183 - <!-- </view> -->  
184 -  
185 - <!--//还差几人,剩余时间-->  
186 - <view class="rel">  
187 - <view class='ghaicha ellipsis-2'>  
188 - <text class='gred' wx:if="{{prom_act.max_ct_num >0}}"><text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}">还差<text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text>人享最低优惠</text><text wx:else>您已经享最低优惠</text></text>  
189 - <text class='gred' wx:else>还差<text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text>人成团 </text>  
190 - <view class="t_show">  
191 - 剩余  
192 - <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text>  
193 - <text>{{timer[t_ind].hou}}</text>:  
194 - <text>{{timer[t_ind].min}}</text>:  
195 - <text>{{timer[t_ind].sec}}</text> 147 + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  148 + <block wx:else>
  149 + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  150 + (库存不足)
  151 + </view>
  152 + <block wx:else>
  153 + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">
  154 + (配送不匹配)
  155 + </view>
  156 + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">
  157 + (库存不足)
  158 + </view>
  159 + </block>
  160 + </block>
  161 + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>
  162 + </view>
  163 + </view>
  164 + </view>
  165 + <!-- - 宝贝评价 -- -->
  166 + <view class="bdt16">
  167 + <view class="bb_view">
  168 + <view class="bold">宝贝评价({{categories3[0].num}})</view>
  169 + <view class="red_bb fs26" bindtap="look_pj">
  170 + 查看全部
  171 + <text class="bg_jj"></text>
  172 + </view>
  173 + </view>
  174 + <view class="xc_comment">
  175 + <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">
  176 + 有图({{categories3[1].num}})
  177 + </view>
  178 + <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">
  179 + 好评({{categories3[2].num}})
  180 + </view>
  181 + <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">
  182 + 中评({{categories3[3].num}})
  183 + </view>
  184 + <view class="xc_comment-discuss" data-val="4" bindtap="clik_evaluate">
  185 + 差评({{categories3[4].num}})
  186 + </view>
  187 + </view>
  188 + <scroll-view scroll-x="true" class="pj_scroll">
  189 + <view class="flex">
  190 + <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="fir_comments">
  191 + <view class="xc_comment-left">
  192 + <view class="xc_comment-user">
  193 + <view class="xc_user-img">
  194 + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
  195 + </view>
  196 + <view class="xc_user">
  197 + <view class="xc_user-name five-level-word">
  198 + {{item.is_anonymous!=1?item.username:'匿名'}}
196 </view> 199 </view>
  200 + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
197 </view> 201 </view>
198 </view> 202 </view>
199 - <!--//参加团-->  
200 - <view class='cjt t-c'>  
201 - 去参团 203 + <view class="xc_comment-font pj_word_size ellipsis-1 pdt12">
  204 + <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}}</text>
  205 + </view>
  206 + <view class="xc_comment-val">
  207 + <view class="xc_comment-time">{{item.add_time}}</view>
202 </view> 208 </view>
203 - <!-- <view class="clear"></view> --> 209 + </view>
  210 + <view class="xc_goods-img-frame">
  211 + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  212 + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
  213 + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
204 </view> 214 </view>
205 </view> 215 </view>
206 </view> 216 </view>
207 -  
208 - 217 + </scroll-view>
  218 + </view>
  219 + <!-- 图文详情 -->
  220 + <view class="bdt16">
  221 + <view class="t_g_info">
  222 + <view class="red_shu"></view>
  223 + <view class="fs30 bold">商品详情</view>
209 </view> 224 </view>
210 -  
211 - <!-- 积分购 -->  
212 - <view wx:if="{{prom_type==4}}">  
213 - <view class="goods-price">  
214 - <!-- 价格显示 -->  
215 - <view class="co-red flex jc_sb ai-center">  
216 - <view class="market-price" style="overflow: hidden; height: 66rpx;display: flex; align-items: flex-end;">  
217 - <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>  
218 - <block wx:if="{{prom_integral}}"><text style="position: relative;top:10rpx">{{prom_integral}}</text><text class="rel_txt">积分</text></block>  
219 - <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>  
220 - <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>  
221 - <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>  
222 - <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{filters.toFix(data.market_price,2)}}</text>  
223 - </view>  
224 -  
225 - <!-- 这个是分享按钮 -->  
226 - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->  
227 - <view class="xc-share-frame t-c" bindtap="clickShare">  
228 - <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->  
229 - <view class="iconfont icon-share fs60"></view>  
230 - <!-- <view class="share-font">1分享</view> -->  
231 - <view class="fs22 c-7b">分享</view>  
232 - </view>  
233 - </view>  
234 -  
235 -  
236 -  
237 - <view class="goods-title">  
238 - <view class="goods-name elli">{{data.goods_name}}</view>  
239 - </view>  
240 -  
241 - <view class="goods-num">  
242 - <view class="sales">销量:{{prom_act.buy_num}}件</view>  
243 - <view class="stock">折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折</view>  
244 - <view class="stock">{{categories3[0].num}}人评价</view>  
245 - </view>  
246 - </view>  
247 - </view>  
248 -  
249 - <!-- 不是拼团,不是积分购 -->  
250 - <block wx:if="{{prom_type!=6 && prom_type!=4}}">  
251 - <view class="goods-price">  
252 -  
253 - <view class="flex jc_sb">  
254 - <view class="co-red" style="" wx:if="{{prom_type==0 || prom_type==3}}">  
255 - <view class="market-price flex" style="align-items: baseline;">  
256 - <block wx:if="{{card_field && data[card_field]>0}}">  
257 - <view class="flex ai-center grade-card-frame">  
258 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
259 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
260 - </view>  
261 - <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}  
262 - <view class='yj' style="top:35rpx">  
263 - <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>  
264 - </view>  
265 - </block>  
266 - <block wx:else>  
267 - <text class="yuan">¥</text>{{filters.toFix(data.shop_price,2)}}  
268 - <view class='yj'><text>零售价:¥{{filters.toFix(data.market_price,2)}}</text></view>  
269 - </block>  
270 - </view>  
271 -  
272 - </view>  
273 -  
274 - <!-- 这个是分享按钮 -->  
275 - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->  
276 - <view class="xc-share-frame t-c" bindtap="clickShare" wx:if="{{prom_type != 1}}">  
277 - <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->  
278 - <view class="iconfont icon-share fs60"></view>  
279 - <!-- <view class="share-font">1分享</view> -->  
280 - <view class="fs22 c-7b">分享</view>  
281 - </view>  
282 - </view>  
283 -  
284 -  
285 -  
286 - <!-- 不是秒杀 -->  
287 - <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 -->  
288 - <view class="flex ai_and" wx:if="{{!card_field && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && card_list && card_list.length>0}}">  
289 -  
290 - <view class="flex ai-center grade-card-frame card-frame" >  
291 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
292 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
293 - </view>  
294 - <view class="fs32 xc-black3 ai_and carde_frame">  
295 - <text class="fs26">  
296 - ¥</text>{{g_filters.get_card_price(data,card_list,0)}}  
297 - </view>  
298 - </view>  
299 -  
300 - <!-- 等级卡的显示,购买, 等级卡近30天要显示续费-->  
301 -  
302 - <block wx:if="{{g_filters.is_has_rank(rank_switch,data)}}">  
303 -  
304 - <!-- 不是秒杀,且会员不是等级会员 -->  
305 - <view wx:if="{{!card_field && prom_type!=1 && card_list && card_list.length>0}}">  
306 - <view class="beauty-makeup-frame flex ai-center">  
307 - <view class="left flex ai-center jc_sa">  
308 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
309 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
310 - <view class="fs24 white view card-name ellipsis-1">{{g_filters.get_card_price(data,card_list,1)}}</view>  
311 - </view>  
312 - <view class="card-effect">  
313 - <view class="fs24 xc-black3">成为{{g_filters.get_card_price(data,card_list,1)}}立<text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元</view>  
314 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
315 - </view>  
316 - </view>  
317 - <view class="right flex jc-center ai-center" bindtap="go_plus">  
318 - <view class="at_once_carde xc-black3 fs28">立即开卡</view>  
319 - <view class="bg_right"></view>  
320 - </view>  
321 -  
322 - </view> 225 + <view class="pd20">
  226 + <view class="table_s">
  227 + <view class="tb_item tb-l">
  228 + <view class="item_left">
  229 + <text>商品名称</text>
  230 + </view>
  231 + <view class="item_right">
  232 + <text>{{data.goods_name}}</text>
  233 + </view>
323 </view> 234 </view>
324 - <!-- 立即续费的显示 -->  
325 - <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1}}">  
326 - <view class="beauty-makeup-frame flex ai-center">  
327 - <view class="left flex ai-center jc_sa">  
328 - <view class="flex ai-center grade-card-frame card-frame advert-card">  
329 - <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image>  
330 - <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>  
331 - </view>  
332 - <view class="card-effect">  
333 - <view class="fs24 xc-black3">成为{{card_name}}立<text class="co-red">省{{filters.toFix(data.shop_price[card_field],2)}}</text>元</view>  
334 - <view class="fs22 xc-ash"> 开通会员 尽享更多优惠 </view>  
335 - </view>  
336 - </view>  
337 - <view class="right flex jc-center ai-center" bindtap="go_card_info">  
338 - <view class="at_once_carde xc-black3 fs28">立即续费</view>  
339 - <view class="bg_right"></view>  
340 - </view>  
341 -  
342 - </view>  
343 -  
344 - </view>  
345 -  
346 - </block>  
347 - <!--许程商品名字-->  
348 -  
349 - <view wx:if="{{prom_type!=1}}">  
350 - <view class="goods-title">  
351 - <view class="goods-name elli">{{data.goods_name}}</view> 235 + <view class="tb_item tb-l">
  236 + <view class="item_left">
  237 + <text>商品编号</text>
  238 + </view>
  239 + <view class="item_right">
  240 + <text>{{data.goods_sn}}</text>
352 </view> 241 </view>
353 </view> 242 </view>
354 -  
355 - <view class="goods-num" wx:if="{{prom_type!=1}}">  
356 - <view class="sales">销量:{{data.sales_sum}}件</view>  
357 - <view class="stock">折扣:{{data.disc}}折</view>  
358 - <view class="stock">{{categories3[0].num}}人评价</view> 243 + <view class="tb_item tb-l">
  244 + <view class="item_left">
  245 + <text>商品条码</text>
  246 + </view>
  247 + <view class="item_right">
  248 + <text>{{data.sku}}</text>
  249 + </view>
359 </view> 250 </view>
360 - <view wx:if="{{prom_type==1}}">  
361 - <view class="flex jc_sb">  
362 - <view class="flex" style="align-items: baseline;">  
363 - <view class="flex xc-price-frame"><text class="fs30">¥</text>{{prom_price}}</view>  
364 - <view class="word-line fs24">零售价¥{{filters.toFix(data.market_price,2)}}</view>  
365 - </view>  
366 -  
367 - <!-- 这个是分享按钮 -->  
368 - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> -->  
369 - <view class="xc-share-frame t-c" bindtap="clickShare">  
370 - <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> -->  
371 - <view class="iconfont icon-share fs60"></view>  
372 - <!-- <view class="share-font">1分享</view> -->  
373 - <view class="fs22 c-7b">分享</view>  
374 - </view>  
375 - <!-- <view class="xc-val-price">  
376 - <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>  
377 - <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>  
378 - <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>  
379 - </view> --> 251 + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">
  252 + <view class="item_left">
  253 + <text>品类</text>
  254 + </view>
  255 + <view class="item_right">
  256 + <text>{{cat_name}}</text>
380 </view> 257 </view>
381 </view> 258 </view>
382 -  
383 - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">  
384 - {{data.goods_name}} 259 + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">
  260 + <view class="item_left">
  261 + <text>品牌</text>
  262 + </view>
  263 + <view class="item_right">
  264 + <text>{{brand_name}}</text>
  265 + </view>
385 </view> 266 </view>
386 -  
387 - <!-- <view wx:if="{{prom_type==1}}" style='height:58rpx'></view> -->  
388 - <!-- 许程 7.24 暂时注释 -->  
389 - <view wx:if="{{prom_type==1}}">  
390 - <view class="goods-num" wx:if="{{prom_type==1}}">  
391 -  
392 - <block wx:if="prom_st>0" >  
393 - <view class="stock">总数量:{{prom_act.goods_num+prom_act.virtual}}件</view>  
394 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
395 - <block wx:if="{{prom_st==0}}">  
396 - <view class="sales">已购:0件</view>  
397 - </block>  
398 - <block wx:else>  
399 - <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view>  
400 - </block>  
401 - </block>  
402 -  
403 - <block wx:else>  
404 - <view class="stock">总数量:{{prom_act.goods_num}}件</view>  
405 - <view class="stock">限购:{{prom_act.buy_limit}}件</view>  
406 - <view class="sales">已购:{{prom_act.buy_num}}件</view>  
407 - </block>  
408 - 267 + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">
  268 + <view class="item_left">
  269 + <text>国别</text>
  270 + </view>
  271 + <view class="item_right">
  272 + <text>{{nation_name}}</text>
409 </view> 273 </view>
410 </view> 274 </view>
411 -  
412 - </view>  
413 - </block>  
414 -  
415 - <!-- 门店收货地址 -->  
416 - <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" >  
417 - <view class="address_frame" bindtap="choice_store" data-ind="0">  
418 - <view class="flex-vertical-between ">  
419 - <view class="flex-vertical select_store_height">  
420 - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>  
421 - <view class="fs30" style="color:black;">选择门店</view>  
422 - </view>  
423 - <view class="red_bb fs26">  
424 - 更多门店  
425 - <text class="bg_jj"></text>  
426 - </view>  
427 - </view>  
428 -  
429 - <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}">  
430 - <view class="flex-space-between address ai_end pdv10">  
431 - <view>  
432 - <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>  
433 - </view>  
434 - <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}">  
435 - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}  
436 -  
437 - </view>  
438 - </view>  
439 -  
440 -  
441 - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>  
442 - <block wx:else>  
443 - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>  
444 - <block wx:else>  
445 - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view>  
446 - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>  
447 - </block>  
448 - </block>  
449 -  
450 - <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view>  
451 - </view>  
452 - </view>  
453 - 275 + <view class="tb_item tb-l">
  276 + <view class="item_left">
  277 + <text>规格</text>
  278 + </view>
  279 + <view class="item_right">
  280 + <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text>
  281 + </view>
454 </view> 282 </view>
455 -  
456 - <!--许程 7.24暂时注释 -->  
457 - <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}">  
458 - <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}">  
459 - <view class="cx-sizs fs30">领券</view>  
460 - <view class="flex ai_c f1 pdh20">  
461 - <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}">  
462 - <view class="circle xc-circular xc-one"></view>  
463 - <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view>  
464 - <view class="circle xc-circular xc-two"></view>  
465 - </view>  
466 - </view>  
467 -  
468 - <view data-coupon="1" bindtap="switchCoupon" class="cx-obtain-coupon wsize">  
469 - <text class="bg_jj"></text> 283 + <view class="tb_item tb-l">
  284 + <view class="item_left">
  285 + <text>上架时间</text>
  286 + </view>
  287 + <view class="item_right">
  288 + <text>{{data.on_time}}</text>
  289 + </view>
470 </view> 290 </view>
471 </view> 291 </view>
472 </view> 292 </view>
473 -  
474 -  
475 -  
476 -  
477 - <!-- 要判断是不是有促销活动 -->  
478 - <block wx:if="{{prom_goods}}">  
479 - <view class="cx-frame flex" style="position: relative; height: auto" >  
480 - <view class="cx-sizs fs30">促销</view>  
481 - <!-- 中间显示层 -->  
482 - <view class="f1 pdh20">  
483 -  
484 - <view class="cx_show_view flex fs28" wx:for="{{prom_goods}}">  
485 - <view class="prom_condition">消费满{{item.condition}}<text wx:if="{{item.prom_type==1}}">件</text><text wx:else>元</text></view>  
486 - <view class="word {{is_more_cx?'':'ellipsis-1'}}">  
487 - <text wx:if="{{item.money>0}}">减价{{item.money}}元;</text>  
488 - <text wx:if="{{item.sale>0}}">打{{item.sale}}折;</text>  
489 - <text wx:if="{{item.past==1}}">包邮;</text>  
490 - <text wx:if="{{item.intValue>0}}">送{{tem.intValue}}积分;</text>  
491 - <text wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券;</text>  
492 - <text wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}};</text>  
493 - <text wx:if="{{item.lb_id>0}}">送{{item.lbtitle}};</text>  
494 - </view>  
495 - </view>  
496 - </view>  
497 - <view data-coupon="1" bindtap="show_more_cx" class="cx-obtain-coupon wsize">  
498 - <text class="bg_jj {{is_more_cx?'down1':''}}"></text>  
499 - </view>  
500 - </view>  
501 - </block>  
502 -  
503 - <!-- 要判断是不是有订单优惠 -->  
504 - <block wx:if="{{order_prom}}">  
505 - <view class="cx-frame flex" style="position: relative; height: auto" >  
506 - <view class="cx-sizs wsize" style="width: 144rpx">订单优惠</view>  
507 - <!-- 中间显示层 -->  
508 - <view class="flex ai-center">  
509 - <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>  
510 - <view class="order_hui">  
511 - <view class="fs28 ellipsis-1">{{order_prom.name}}</view>  
512 - <view class="fs26" >(活动时间:{{tool.format_tt(order_prom.start_time)}} - {{tool.format_tt(order_prom.end_time)}})</view>  
513 - </view>  
514 - </view>  
515 - </view>  
516 - </block>  
517 -  
518 -  
519 - <!-- 要判断是不是有组合优惠 -->  
520 - <block wx:if="{{zh_act}}">  
521 - <view class="cx-frame flex" style="position: relative; height: auto" >  
522 - <view class="cx-sizs wsize" style="width: 144rpx">组合购</view>  
523 - <!-- 中间显示层 -->  
524 - <view class="flex ai-center jc_sb" style="width: 570rpx" bindtap="go_zh" data-id="{{zh_act.id}}" >  
525 - <view class="flex">  
526 - <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image>  
527 - <view class="order_hui">  
528 - <view class="fs28 ellipsis-1">{{zh_act.name}}</view>  
529 - <view class="fs26" >(活动时间:{{tool.format_tt(zh_act.start_time)}} - {{tool.format_tt(zh_act.end_time)}})</view>  
530 - </view>  
531 - </view>  
532 - <view><text class="bg_jj is_more_cx" style="position: relative;top:-10rpx"></text></view>  
533 - </view>  
534 - </view>  
535 - </block>  
536 -  
537 -  
538 - <view class="bz_view flex bdt16" wx:if="{{bconfig}}" style="">  
539 - <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image>  
540 - <view class="flex f1 ai_c rel">  
541 - <view class="bz-content {{flag ? '':'ellipsis-1'}} f1">{{bconfig.service_bz}}</view>  
542 - <view bindtap="clickCollapse" class="cx-obtain-coupon wsize arrow">  
543 - <text class="bg_jj {{flag?'down1':''}}"></text>  
544 - </view>  
545 - <!-- <text class="bg_jj" bindtap="clickCollapse"></text> -->  
546 - <!-- <text class="iconfont icon-shuangjiantouxia c-db"></text> -->  
547 - </view>  
548 - 293 + <!-- 详情图片 -->
  294 + <view class="wxParse">
  295 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
549 </view> 296 </view>
550 -  
551 -  
552 - <!--- 搭配促销 ---->  
553 - <view class="dp_cx_view" wx:if="{{collocationGoods}}">  
554 - <view class="bb_view">  
555 - <view>优惠热配</view>  
556 - <view class="red_bb" bindtap="go_prom_list">查看全部  
557 - <text class="bg_jj"></text>  
558 - </view> 297 + </view>
  298 + <!-- 推荐商品 -->
  299 + <view class="flex-center rel xc-linellae-frame">
  300 + <view class="xc-linellae"></view>
  301 + <view class="abs flex-center xc-recommend-frame ">
  302 + <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png"></image>
  303 + <view class="xc-recommend-word">推荐</view>
  304 + </view>
  305 + </view>
  306 + <goods_recommend id="goods_list"></goods_recommend>
  307 + <!-- 技术支持 -->
  308 + <view class="logo-container t-c">
  309 + <view class="flex ai_c fs24 jc-center pdv30 white">
  310 + <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image>
  311 + 提供技术支持
  312 + </view>
  313 + </view>
  314 + </view>
  315 + <!-- ----------商品详情图片页面-------------- -->
  316 + <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
  317 + <view class="table_s">
  318 + <view class="tb_item tb-l">
  319 + <view class="item_left">
  320 + <text>商品名称</text>
559 </view> 321 </view>
560 -  
561 - <!-- 搭配的显示 -->  
562 - <view class="flex" bindtap="go_prom_list">  
563 - <image class="dp_img" src="{{iurl+collocationGoods.img_url}}"></image>  
564 - <view class="act_content">  
565 - <view class="fs32">{{collocationGoods.title}}</view>  
566 - <view class="fs30 color_b" wx:if="{{collocationGoods.max!=collocationGoods.min}}">搭配价¥{{collocationGoods.min}}-{{collocationGoods.max}}</view>  
567 - <view class="fs30 color_b" wx:else>搭配价¥{{collocationGoods.min}}</view>  
568 - <view class="fs30 color-gray">活动至{{filters.format_time(collocationGoods.end_time,1)}}</view>  
569 - </view> 322 + <view class="item_right">
  323 + <text>{{data.goods_name}}</text>
570 </view> 324 </view>
571 </view> 325 </view>
572 -  
573 -  
574 - <!--- 宝贝评价 ---->  
575 - <view class="bdt16">  
576 - <view class="bb_view">  
577 - <view class="bold">宝贝评价({{categories3[0].num}})</view>  
578 - <view class="red_bb fs26" bindtap="look_pj">查看全部  
579 - <text class="bg_jj"></text>  
580 - </view> 326 + <view class="tb_item tb-l">
  327 + <view class="item_left">
  328 + <text>商品编号</text>
581 </view> 329 </view>
582 -  
583 - <view class="xc_comment">  
584 - <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">有图({{categories3[1].num}}) </view>  
585 - <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">好评({{categories3[2].num}}) </view>  
586 - <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">中评({{categories3[3].num}}) </view>  
587 - <view class="xc_comment-discuss" data-val="4"bindtap="clik_evaluate">差评({{categories3[4].num}}) </view> 330 + <view class="item_right">
  331 + <text>{{data.goods_sn}}</text>
588 </view> 332 </view>
589 -  
590 - <scroll-view scroll-x="true" class="pj_scroll">  
591 - <view class="flex">  
592 - <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="fir_comments">  
593 - <view class="xc_comment-left">  
594 - <view class="xc_comment-user">  
595 - <view class="xc_user-img">  
596 - <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>  
597 - </view>  
598 -  
599 - <view class="xc_user">  
600 - <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view>  
601 - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>  
602 - </view>  
603 - </view>  
604 - <view class="xc_comment-font pj_word_size ellipsis-1 pdt12">  
605 - <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}} </text>  
606 - </view>  
607 - <view class="xc_comment-val">  
608 - <view class="xc_comment-time">{{item.add_time}}</view>  
609 -  
610 - </view>  
611 - </view>  
612 - <view class="xc_goods-img-frame">  
613 - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>  
614 - <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>  
615 - <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>  
616 - </view>  
617 - </view>  
618 - </view>  
619 - </scroll-view>  
620 </view> 333 </view>
621 -  
622 - <!-- 图文详情 -->  
623 - <view class="bdt16">  
624 - <!-- <view class="tuwen_title">  
625 - <view class="g_line"></view>  
626 - <view class="center_s">  
627 - <image src="{{iurl}}/miniapp/images/tuwen_c.png"></image>  
628 - <text>详情</text>  
629 - </view>  
630 - </view> -->  
631 - <view class="t_g_info">  
632 - <view class="red_shu"></view>  
633 - <view class="fs30 bold">商品详情</view> 334 + <view class="tb_item tb-l">
  335 + <view class="item_left">
  336 + <text>商品条码</text>
634 </view> 337 </view>
635 - <view class="pd20">  
636 - <view class="table_s">  
637 - <view class="tb_item tb-l">  
638 - <view class="item_left">  
639 - <text>商品名称</text>  
640 - </view>  
641 - <view class="item_right">  
642 - <text>{{data.goods_name}}</text>  
643 - </view>  
644 - </view>  
645 - <view class="tb_item tb-l">  
646 - <view class="item_left">  
647 - <text>商品编号</text>  
648 - </view>  
649 - <view class="item_right">  
650 - <text>{{data.goods_sn}}</text>  
651 - </view>  
652 - </view>  
653 - <view class="tb_item tb-l">  
654 - <view class="item_left">  
655 - <text>商品条码</text>  
656 - </view>  
657 - <view class="item_right">  
658 - <text>{{data.sku}}</text>  
659 - </view>  
660 - </view>  
661 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
662 - <view class="item_left">  
663 - <text>品类</text>  
664 - </view>  
665 - <view class="item_right">  
666 - <text>{{cat_name}}</text>  
667 - </view>  
668 - </view>  
669 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
670 - <view class="item_left">  
671 - <text>品牌</text>  
672 - </view>  
673 - <view class="item_right">  
674 - <text>{{brand_name}}</text>  
675 - </view>  
676 - </view>  
677 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
678 - <view class="item_left">  
679 - <text>国别</text>  
680 - </view>  
681 - <view class="item_right">  
682 - <text>{{nation_name}}</text>  
683 - </view>  
684 - </view>  
685 - <view class="tb_item tb-l">  
686 - <view class="item_left">  
687 - <text>规格</text>  
688 - </view>  
689 - <view class="item_right">  
690 - <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text>  
691 - </view>  
692 - </view>  
693 - <view class="tb_item tb-l">  
694 - <view class="item_left">  
695 - <text>上架时间</text>  
696 - </view>  
697 - <view class="item_right">  
698 - <text>{{data.on_time}}</text>  
699 - </view>  
700 - </view>  
701 - </view>  
702 - </view>  
703 -  
704 - <!--详情图片-->  
705 - <view class="wxParse">  
706 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> 338 + <view class="item_right">
  339 + <text>{{data.sku}}</text>
707 </view> 340 </view>
708 </view> 341 </view>
709 -  
710 - <!-- 推荐商品 -->  
711 - <view class="flex-center rel xc-linellae-frame">  
712 - <view class="xc-linellae"></view>  
713 - <view class="abs flex-center xc-recommend-frame ">  
714 - <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png">  
715 - </image>  
716 - <view class="xc-recommend-word">推荐</view> 342 + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">
  343 + <view class="item_left">
  344 + <text>品类</text>
  345 + </view>
  346 + <view class="item_right">
  347 + <text>{{cat_name}}</text>
717 </view> 348 </view>
718 </view> 349 </view>
719 -  
720 - <goods_recommend id="goods_list"></goods_recommend>  
721 -  
722 - <!-- 技术支持 -->  
723 - <view class="logo-container t-c">  
724 - <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>  
725 - </view>  
726 - </view>  
727 -  
728 - <!------------商品详情图片页面---------------->  
729 - <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">  
730 - <view class="table_s">  
731 - <view class="tb_item tb-l">  
732 - <view class="item_left">  
733 - <text>商品名称</text>  
734 - </view>  
735 - <view class="item_right">  
736 - <text>{{data.goods_name}}</text>  
737 - </view> 350 + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">
  351 + <view class="item_left">
  352 + <text>品牌</text>
738 </view> 353 </view>
739 - <view class="tb_item tb-l">  
740 - <view class="item_left">  
741 - <text>商品编号</text>  
742 - </view>  
743 - <view class="item_right">  
744 - <text>{{data.goods_sn}}</text>  
745 - </view> 354 + <view class="item_right">
  355 + <text>{{brand_name}}</text>
746 </view> 356 </view>
747 - <view class="tb_item tb-l">  
748 - <view class="item_left">  
749 - <text>商品条码</text>  
750 - </view>  
751 - <view class="item_right">  
752 - <text>{{data.sku}}</text>  
753 - </view> 357 + </view>
  358 + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">
  359 + <view class="item_left">
  360 + <text>国别</text>
754 </view> 361 </view>
755 - <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}">  
756 - <view class="item_left">  
757 - <text>品类</text>  
758 - </view>  
759 - <view class="item_right">  
760 - <text>{{cat_name}}</text>  
761 - </view> 362 + <view class="item_right">
  363 + <text>{{nation_name}}</text>
762 </view> 364 </view>
763 - <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}">  
764 - <view class="item_left">  
765 - <text>品牌</text>  
766 - </view>  
767 - <view class="item_right">  
768 - <text>{{brand_name}}</text>  
769 - </view> 365 + </view>
  366 + <view class="tb_item tb-l">
  367 + <view class="item_left">
  368 + <text>规格</text>
770 </view> 369 </view>
771 - <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}">  
772 - <view class="item_left">  
773 - <text>国别</text>  
774 - </view>  
775 - <view class="item_right">  
776 - <text>{{nation_name}}</text>  
777 - </view> 370 + <view class="item_right">
  371 + <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text>
778 </view> 372 </view>
779 - <view class="tb_item tb-l">  
780 - <view class="item_left">  
781 - <text>规格</text>  
782 - </view>  
783 - <view class="item_right">  
784 - <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text>  
785 - </view> 373 + </view>
  374 + <view class="tb_item tb-l">
  375 + <view class="item_left">
  376 + <text>上架时间</text>
786 </view> 377 </view>
787 - <view class="tb_item tb-l">  
788 - <view class="item_left">  
789 - <text>上架时间</text>  
790 - </view>  
791 - <view class="item_right">  
792 - <text>{{data.on_time}}</text>  
793 - </view> 378 + <view class="item_right">
  379 + <text>{{data.on_time}}</text>
794 </view> 380 </view>
795 </view> 381 </view>
796 -  
797 - <view class="wxParse">  
798 - <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>  
799 - </view>  
800 </view> 382 </view>
801 - <!---------------评价页面-------------->  
802 - <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">  
803 - <view class="topframe">  
804 - <view class="topframe-top">  
805 - <view class="topframe-top-content">  
806 - <view>宝贝评价</view>  
807 - <view class="topframe-top-val">({{categories3[0].num}})</view>  
808 - </view>  
809 - <view class="topframe-praise" wx:if="{{categories3[0].num}}">好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%</view>  
810 - <view wx:else>好评 0%</view>  
811 - </view>  
812 - <view class="buttem-list">  
813 - <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">{{item.name}}({{item.num}})</view> 383 + <view class="wxParse">
  384 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  385 + </view>
  386 + </view>
  387 + <!-- -------------评价页面------------ -->
  388 + <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
  389 + <view class="topframe">
  390 + <view class="topframe-top">
  391 + <view class="topframe-top-content">
  392 + <view>宝贝评价</view>
  393 + <view class="topframe-top-val">({{categories3[0].num}})</view>
  394 + </view>
  395 + <view class="topframe-praise" wx:if="{{categories3[0].num}}">
  396 + 好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%
  397 + </view>
  398 + <view wx:else>好评 0%</view>
  399 + </view>
  400 + <view class="buttem-list">
  401 + <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">
  402 + {{item.name}}({{item.num}})
814 </view> 403 </view>
815 </view> 404 </view>
816 -  
817 - <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">  
818 - <view style='border-bottom:4rpx solid #eee;'> 405 + </view>
  406 + <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="cIdx">
  407 + <view style='border-bottom:4rpx solid #eee;'>
819 <view class="middle"> 408 <view class="middle">
820 <view class="middle-img-frame"> 409 <view class="middle-img-frame">
821 <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image> 410 <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
822 <view class="middle-user-frame"> 411 <view class="middle-user-frame">
823 - <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view> 412 + <view class="middle-user">
  413 + {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}
  414 + </view>
824 <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> 415 <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
825 </view> 416 </view>
826 </view> 417 </view>
827 <view class="xc-pirces"> 418 <view class="xc-pirces">
828 - <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >  
829 - {{item.content?item.content:'此用户没有填写评价。'}}  
830 - </view> 419 + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}">
  420 + {{item.content?item.content:'此用户没有填写评价。'}}
  421 + </view>
  422 + </view>
  423 + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>
  424 + 全部显示
  425 + </view>
  426 + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>
  427 + 收起
831 </view> 428 </view>
832 - <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>  
833 - <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>  
834 <view class="img-ul"> 429 <view class="img-ul">
835 -  
836 <block wx:if="{{item.source_type==0}}"> 430 <block wx:if="{{item.source_type==0}}">
837 - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">  
838 - <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}"  
839 - data-id="{{index}}" src="{{iurl}}{{item}}"></image>  
840 - </view> 431 + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
  432 + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  433 + </view>
841 </block> 434 </block>
842 <block wx:if="{{item.source_type==1}}"> 435 <block wx:if="{{item.source_type==1}}">
843 - <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">  
844 - <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}"  
845 - data-id="{{index}}" src="{{aitem}}"></image>  
846 - </view> 436 + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">
  437 + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image>
  438 + </view>
847 </block> 439 </block>
848 </view> 440 </view>
849 -  
850 <view class="z_parameter"> 441 <view class="z_parameter">
851 <view class="parameter-font">{{item.add_time}}</view> 442 <view class="parameter-font">{{item.add_time}}</view>
852 <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}"> 443 <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">
853 <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image> 444 <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>
854 <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image> 445 <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>
855 - <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}' >{{item.zan_num}}</view> 446 + <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}'>
  447 + {{item.zan_num}}
  448 + </view>
856 </view> 449 </view>
857 </view> 450 </view>
858 -  
859 </view> 451 </view>
860 <view class="reply rel" wx:if="{{item.replay_list}}"> 452 <view class="reply rel" wx:if="{{item.replay_list}}">
861 <view class="line_bulge"></view> 453 <view class="line_bulge"></view>
862 - <view class="shop-reply">店家回复: </view> 454 + <view class="shop-reply">店家回复:</view>
863 <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}"> 455 <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
864 {{r_item.content}} 456 {{r_item.content}}
865 </view> 457 </view>
866 </view> 458 </view>
867 - </view>  
868 - </block>  
869 - <block wx:if="{{(!comments || comments.length==0) && get_c }}">  
870 - <text class="no_pj_list">暂无评价</text>  
871 - </block>  
872 - <block wx:if="{{comments.length>10 && comments_no_more}}">  
873 - <text class="no_pj_list">已经加载到底部</text>  
874 - </block>  
875 - </view> 459 + </view>
  460 + </block>
  461 + <block wx:if="{{(!comments || comments.length==0) && get_c }}">
  462 + <text class="no_pj_list">暂无评价</text>
  463 + </block>
  464 + <block wx:if="{{comments.length>10 && comments_no_more}}">
  465 + <text class="no_pj_list">已经加载到底部</text>
  466 + </block>
876 </view> 467 </view>
877 -  
878 -  
879 </view> 468 </view>
880 - <!---滚动到顶部---->  
881 - <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">  
882 - <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> 469 +</view>
  470 +<!-- -滚动到顶部-- -->
  471 +<view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
  472 + <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
  473 +</view>
  474 +<!-- -----------------底部按钮------------------ -->
  475 +<view class="join-cart">
  476 + <!-- bindtap="contactService" -->
  477 + <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
  478 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  479 + <view>客服</view>
  480 + </button>
  481 + <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">
  482 + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
  483 + <view>客服</view>
883 </view> 484 </view>
884 -  
885 - <!-------------------底部按钮-------------------->  
886 - <view class="join-cart">  
887 - <!-- bindtap="contactService" -->  
888 - <button wx:if="{{sys_switch.weapp_customertype}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">  
889 - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>  
890 - <view>客服</view>  
891 - </button>  
892 - <view wx:else class="custom-service cart-ico new_split" bindtap="contactService">  
893 - <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>  
894 - <view>客服</view>  
895 - </view>  
896 -  
897 - <view bindtap="collectGoods" class="custom-service cart-ico new_split">  
898 - <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>  
899 - <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>  
900 - <view>收藏</view>  
901 - </view>  
902 - <view class="shopping-cart cart-ico new_split">  
903 - <navigator open-type="switchTab" url="/pages/cart/cart/cart">  
904 - <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>  
905 - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>  
906 - <view>购物车</view>  
907 - </navigator> 485 + <view bindtap="collectGoods" class="custom-service cart-ico new_split">
  486 + <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
  487 + <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
  488 + <view>收藏</view>
  489 + </view>
  490 + <view class="shopping-cart cart-ico new_split">
  491 + <navigator open-type="switchTab" url="/pages/cart/cart/cart">
  492 + <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
  493 + <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view>
  494 + <view>购物车</view>
  495 + </navigator>
  496 + </view>
  497 + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">
  498 + 立即购买
  499 + </view>
  500 + <view class="fs24 f1 flex ai-center bg-FF4732 t-c white">
  501 + <view class="pdh20">
  502 + <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view>
  503 + <!-- <view class="">08.30 23:59:59 开始发货</view> -->
  504 + <view class="" wx:if="{{presellForm.delivery_type==1}}">{{filters.format_time(presellForm.delivery_date,2)}} 开始发货</view>
  505 + <view class="" wx:else>付款{{presellForm.delivery_daynum}} 天后发货</view>
908 </view> 506 </view>
909 - <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>  
910 -  
911 - <!-- 普通商品购买 -->  
912 - <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">  
913 -  
914 - <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->  
915 - <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}">  
916 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
917 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view>  
918 - </block>  
919 - <block wx:else>  
920 - <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%">库存不足</view>  
921 - </block>  
922 -  
923 - </block>  
924 -  
925 - <!-------秒杀-------->  
926 - <block wx:if="{{prom_type==1}}">  
927 - <view class="fs24 f1 flex ai-center bg-FF4732 t-c white">  
928 - <view class="pdh20">  
929 - <view class="">08.30 23:59:59 预售结束</view>  
930 - <!-- <view class="">08.30 23:59:59 开始发货</view> -->  
931 - <view class="">付款3天后发货</view>  
932 - </view>  
933 - <view class="pdh20 line" bindtap="openSpecModel" data-ind="2">  
934 - <view class="">支付定金</view>  
935 - <view class="">定金<text class="rmb">9.9</text></view>  
936 - </view>  
937 - </view>  
938 - <!-- <block wx:if="{{prom_st==1 && !prom_r_null}}">  
939 - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>  
940 - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view>  
941 - </block>  
942 - <block wx:if="{{prom_st==0 && !prom_r_null}}">  
943 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">即将开始</view>  
944 - </block>  
945 - <block wx:if="{{prom_r_null}}">  
946 - <view class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view>  
947 - </block>  
948 - <block wx:if="{{prom_st==3 && !prom_r_null}}">  
949 - <view class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view>  
950 - </block> -->  
951 - </block>  
952 507
953 - <!-------拼单-------->  
954 - <block wx:if="{{prom_type==6}}">  
955 - <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h">  
956 - <view class="fir-v">  
957 - <!-- ¥{{data.shop_price,2)}} -->  
958 - <block wx:if="{{card_field && sele_g[card_field]>0}}">  
959 - {{filters.toFix(sele_g[card_field],2)}}  
960 - </block>  
961 - <block wx:else>  
962 - {{filters.toFix(sele_g.shop_price,2)}}  
963 - </block>  
964 - </view>  
965 - <view>单独购买</view> 508 + <view class="pdh20 line" bindtap="openSpecModel" data-ind="2">
  509 + <view class="">支付定金</view>
  510 + <view class="flex">
  511 + 定金
  512 + <text class="rmb">{{presellList.presell_money}}</text>
966 </view> 513 </view>
967 -  
968 - <block wx:if="{{user_order_pt_state==0}}">  
969 - <!----商家团---->  
970 - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h">  
971 - <view class="fir-v">¥{{prom_act.price}}</view>  
972 - <view>去参团</view>  
973 - </view>  
974 - <!----会员团---->  
975 - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h">  
976 - <!--<view class="fir-v">¥{{prom_act.price}}</view>-->  
977 - <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}">  
978 - <view>一键开团</view>  
979 - <view wx:if="{{prom_act.tz_yhjgtype==3}}">佣金<text style="font-size: 23rpx">¥</text>{{filters.toFix(prom_act.tz_yyhjg,2)}}</view>  
980 - <view wx:if="{{prom_act.tz_yhjgtype==2}}">团长免单</view>  
981 - </view>  
982 - <view wx:else>  
983 - <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view>  
984 - <view>一键开团</view>  
985 - </view>  
986 -  
987 - </view>  
988 - <!---阶梯团---->  
989 - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h">  
990 - <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view>  
991 - <view>支付定金</view>  
992 - </view>  
993 -  
994 - <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view>  
995 - <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view>  
996 - <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view>  
997 - </block>  
998 - <block wx:else>  
999 - <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise">您还未支付</view>  
1000 - <view bindtap="go_to_team_show" wx:if="{{user_order_pt_state==2}}" class="buy-btn cart-btn">查看支付详情</view>  
1001 - <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>  
1002 - </block>  
1003 - </block>  
1004 -  
1005 -  
1006 - <!-------积分购-------->  
1007 - <block wx:if="{{prom_type==4}}">  
1008 -  
1009 - <block wx:if="{{is_shopbuy}}">  
1010 - <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">  
1011 - <view class="fir-v">  
1012 - <block wx:if="{{card_field && sele_g[card_field]>0}}">  
1013 - {{filters.toFix(sele_g[card_field],2)}}  
1014 - </block>  
1015 - <block wx:else>  
1016 - {{filters.toFix(sele_g.shop_price,2)}}  
1017 - </block>  
1018 - </view>  
1019 - <view>单独购买</view>  
1020 - </view>  
1021 - <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>  
1022 - <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >积分不足</view>  
1023 - </block>  
1024 -  
1025 - <block wx:else>  
1026 - <view bindtap="go_pay_integral" class="buy-btn-all cart-btn" style="width: 58%; margin-left:1%;" wx:if="{{can_integral}}" >立即兑换</view>  
1027 - <view class="buy-btn-all cart-btn" style="background-color: #aaa; width: 58%;margin-left:1%" wx:else >积分不足</view>  
1028 - </block>  
1029 -  
1030 - </block>  
1031 -  
1032 - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>--> 514 + </view>
1033 </view> 515 </view>
1034 -  
1035 - <!-- 制作一个圆球导航 -->  
1036 - <nav_box></nav_box>  
1037 -  
1038 -</block>  
1039 -  
1040 -<!----弹起来,选择规格数量,普通商品购买和秒杀------> 516 +</view>
  517 +<!-- 制作一个圆球导航 -->
  518 +<nav_box></nav_box>
  519 +<!-- --弹起来,选择规格数量,普通商品购买和秒杀---- -->
1041 <view hidden="{{!openSpecModal}}"> 520 <view hidden="{{!openSpecModal}}">
1042 - <view bindtap="closeSpecModal" class="cover-layer"></view> 521 + <view bindtap="closeSpecModal" class="cover-layer"></view>
1043 <view class="spec-model"> 522 <view class="spec-model">
1044 - <view class="pding"> 523 + <view class="pding">
1045 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> 524 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
1046 <view class="spec-goods"> 525 <view class="spec-goods">
1047 <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"></image> 526 <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"></image>
1048 <view class="spec-goods-info"> 527 <view class="spec-goods-info">
1049 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> 528 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
1050 - <view class="flex ai_end xc-val-money" >  
1051 - <view class="spec-goods-price" wx:if="{{prom_price==null}}" >  
1052 - <text class="fs20">¥</text>  
1053 - <!-- 如果是等级会员,且有等级价 -->  
1054 - <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>  
1055 - <block wx:else>{{sele_g.shop_price}}</block>  
1056 - </view>  
1057 - <view class="spec-goods-price tag" wx:else><text class="fs20">¥</text>{{prom_price}}</view>  
1058 - <!-- 显示线下价格 -->  
1059 - <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">  
1060 - 券后¥<text class="fs32">{{sele_g.offline_price}}</text>  
1061 - </view>  
1062 - </view>  
1063 - 529 + <view class="flex ai_end xc-val-money">
  530 + <view class="spec-goods-price" wx:if="{{prom_price==null}}">
  531 + <text class="fs20">¥</text>
  532 + <!-- 如果是等级会员,且有等级价 -->
  533 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block>
  534 + <block wx:else>{{sele_g.shop_price}}</block>
  535 + </view>
  536 + <view class="spec-goods-price tag" wx:else>
  537 + <text class="fs20">¥</text>
  538 + {{prom_price}}
  539 + </view>
  540 + <!-- 显示线下价格 -->
  541 + <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center">
  542 + 券后¥
  543 + <text class="fs32">{{sele_g.offline_price}}</text>
  544 + </view>
  545 + </view>
1064 <block wx:if="{{prom_type==0}}"> 546 <block wx:if="{{prom_type==0}}">
1065 - <view class="flex">  
1066 - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>  
1067 - <block wx:if="{{sales_rules==2}}">  
1068 - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>  
1069 - <view class="spec-goods-stock" wx:else>可售:0</view>  
1070 - </block>  
1071 - <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>  
1072 - </view> 547 + <view class="flex">
  548 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  549 + <block wx:if="{{sales_rules==2}}">
  550 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">
  551 + 可售:{{def_pick_store.CanOutQty}}
  552 + </view>
  553 + <view class="spec-goods-stock" wx:else>可售:0</view>
  554 + </block>
  555 + <block wx:else>
  556 + <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
  557 + </block>
  558 + </view>
1073 </block> 559 </block>
1074 <block wx:if="{{prom_type==1}}"> 560 <block wx:if="{{prom_type==1}}">
1075 - <view class="flex">  
1076 - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>  
1077 - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>  
1078 - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>  
1079 - </view> 561 + <view class="flex">
  562 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">
  563 + 已售:{{prom_act.buy_num+prom_act.virtual}}
  564 + </view>
  565 + <view class="spec-goods-stock" wx:else>已售:{{prom_act.buy_num}}</view>
  566 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  567 + </view>
1080 </block> 568 </block>
1081 </view> 569 </view>
1082 -  
1083 <!-- 选择门店模块 --> 570 <!-- 选择门店模块 -->
1084 - <view class="flex-space-between address ai_end xc-width ">  
1085 -  
1086 - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">  
1087 - <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>  
1088 - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">  
1089 - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}  
1090 -  
1091 - </view>  
1092 - </view>  
1093 -  
1094 - <!-- 没有门店的时候 -->  
1095 - <view class="flex" bindtap="choice_store" wx:else>  
1096 - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>  
1097 - <view class="fs30" style="color:black;">选择门店</view>  
1098 - </view>  
1099 -  
1100 - <view class="red-co fs28" bindtap="choice_store" >  
1101 - 更多门店  
1102 - <text class="right-arrow"></text>  
1103 - </view>  
1104 - </view>  
1105 - <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>  
1106 - <block wx:else>  
1107 - <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>  
1108 - <block wx:else>  
1109 - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>  
1110 - <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>  
1111 - </block>  
1112 - </block>  
1113 -  
1114 - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.fulladdress}}">地址:{{def_pick_store.fulladdress}}</view>  
1115 - </view>  
1116 -  
1117 - <!--商品的属性项目-->  
1118 - <view class="xc-goods-attribute">  
1119 - <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>  
1120 - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">  
1121 - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">  
1122 - {{item.gg}}  
1123 - </view>  
1124 - </view> 571 + <view class="flex-space-between address ai_end xc-width ">
  572 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
  573 + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text>
  574 + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}">
  575 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  576 + </view>
  577 + </view>
  578 + <!-- 没有门店的时候 -->
  579 + <view class="flex" bindtap="choice_store" wx:else>
  580 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  581 + <view class="fs30" style="color:black;">选择门店</view>
  582 + </view>
  583 + <view class="red-co fs28" bindtap="choice_store">
  584 + 更多门店
  585 + <text class="right-arrow"></text>
  586 + </view>
1125 </view> 587 </view>
1126 -  
1127 -  
1128 - <view class="b_num">  
1129 - <view>购买数量</view>  
1130 - <view class="count">  
1131 - <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>  
1132 - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>  
1133 - <view bindtap="addCartNum" class="add">+</view> 588 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  589 + <block wx:else>
  590 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  591 + <block wx:else>
  592 + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
  593 + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">
  594 + (库存不足)
  595 + </view>
  596 + </block>
  597 + </block>
  598 + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}">
  599 + 地址:{{def_pick_store.fulladdress}}
  600 + </view>
  601 + </view>
  602 + <!-- 商品的属性项目 -->
  603 + <view class="xc-goods-attribute">
  604 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
  605 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  606 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  607 + {{item.gg}}
1134 </view> 608 </view>
1135 </view> 609 </view>
1136 -  
1137 - <!-- 提示再买多少优惠 -->  
1138 - <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">  
1139 - 再买{{hui_condition.need}}  
1140 - <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>  
1141 - <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>  
1142 - <text wx:if="{{hui_condition.past==1}}">,包邮</text>  
1143 - <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>  
1144 - <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>  
1145 - <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>  
1146 - <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>  
1147 - </view>  
1148 -  
1149 -  
1150 </view> 610 </view>
1151 -  
1152 - <view class="spec-cart-btns">  
1153 - <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color:#FF4835;color:white;" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">支付定金(¥9.9)</view>  
1154 - <block wx:else>  
1155 -  
1156 - <!-- 根本就找不到门店 -->  
1157 - <block wx:if="{{!only_pk && !def_pickpu_list}}">  
1158 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1159 - </block>  
1160 - <block wx:else>  
1161 -  
1162 -  
1163 - <block wx:if="{{only_pk.length && !only_pk.length}}">  
1164 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>  
1165 - </block>  
1166 - <block wx:else>  
1167 - <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">  
1168 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1169 - </block>  
1170 - <block wx:else>  
1171 - <block wx:if="{{!def_pick_store}}">  
1172 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>  
1173 - </block>  
1174 - <block wx:else>  
1175 - <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->  
1176 - <block wx:if="{{sales_rules==2 && prom_type==0}}">  
1177 - <block wx:if="{{!def_pick_store.CanOutQty}}">  
1178 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1179 - </block>  
1180 - <block wx:else>  
1181 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1182 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1183 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1184 - class="spec-cart-btn spec-buy" data-action="buy">  
1185 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1186 - </view>  
1187 - </block>  
1188 - </block>  
1189 - <!-- 线上销售 -->  
1190 - <block wx:else>  
1191 - <block wx:if="{{sele_g.store_count<=0}}">  
1192 - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>  
1193 - </block>  
1194 - <block wx:else>  
1195 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}"  
1196 - class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>  
1197 - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}"  
1198 - class="spec-cart-btn spec-buy" data-action="buy">  
1199 - {{sele_g.offline_price?"券后购买":"立即购买"}}  
1200 - </view>  
1201 - </block>  
1202 - </block>  
1203 - </block>  
1204 - </block>  
1205 - </block>  
1206 - </block>  
1207 -  
1208 - </block>  
1209 - </view>  
1210 -  
1211 - <view class="clear"></view>  
1212 - <!-- 选择门店的列表 -->  
1213 - <view hidden="{{ismend==0}}" class="sto_v">  
1214 - <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">  
1215 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店 611 + <view class="b_num">
  612 + <view>购买数量</view>
  613 + <view class="count">
  614 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">
  615 + -
  616 + </view>
  617 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  618 + <view bindtap="addCartNum" class="add">+</view>
1216 </view> 619 </view>
1217 - <!-----第一级显示------>  
1218 - <view class="itemlists" hidden="{{is_sec_mend==1}}">  
1219 - <block wx:if="{{is_show_sto_cat}}">  
1220 - <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view> 620 + </view>
  621 + <!-- 提示再买多少优惠 -->
  622 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">
  623 + 再买{{hui_condition.need}}
  624 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  625 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  626 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  627 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  628 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  629 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  630 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  631 + </view>
  632 + </view>
  633 + <view class="spec-cart-btns">
  634 + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color:#FF4835;color:white;" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">
  635 + 支付定金(¥9.9)
  636 + </view>
  637 + <block wx:else>
  638 + <!-- 根本就找不到门店 -->
  639 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  640 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
  641 + 库存不足
  642 + </view>
  643 + </block>
  644 + <block wx:else>
  645 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  646 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">
  647 + 库存不足
  648 + </view>
1221 </block> 649 </block>
1222 <block wx:else> 650 <block wx:else>
1223 - <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}</view> 651 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  652 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
  653 + 库存不足
  654 + </view>
  655 + </block>
  656 + <block wx:else>
  657 + <block wx:if="{{!def_pick_store}}">
  658 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
  659 + 请先选择门店
  660 + </view>
  661 + </block>
  662 + <block wx:else>
  663 + <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
  664 + <block wx:if="{{sales_rules==2 && prom_type==0}}">
  665 + <block wx:if="{{!def_pick_store.CanOutQty}}">
  666 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
  667 + 库存不足
  668 + </view>
  669 + </block>
  670 + <block wx:else>
  671 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">
  672 + 加入购物车
  673 + </view>
  674 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
  675 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  676 + </view>
  677 + </block>
  678 + </block>
  679 + <!-- 线上销售 -->
  680 + <block wx:else>
  681 + <block wx:if="{{sele_g.store_count<=0}}">
  682 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
  683 + 库存不足
  684 + </view>
  685 + </block>
  686 + <block wx:else>
  687 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">
  688 + 加入购物车
  689 + </view>
  690 + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">
  691 + {{sele_g.offline_price?"券后购买":"立即购买"}}
  692 + </view>
  693 + </block>
  694 + </block>
  695 + </block>
  696 + </block>
1224 </block> 697 </block>
1225 - </view>  
1226 - <!-----第二级显示------>  
1227 - <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">  
1228 - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}  
1229 - </view>  
1230 - <view class="itemlists" hidden="{{is_sec_mend==0}}">  
1231 - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}} 698 + </block>
  699 + </block>
  700 + </view>
  701 + <view class="clear"></view>
  702 + <!-- 选择门店的列表 -->
  703 + <view hidden="{{ismend==0}}" class="sto_v">
  704 + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
  705 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>
  706 + 选择门店
  707 + </view>
  708 + <!-- ---第一级显示---- -->
  709 + <view class="itemlists" hidden="{{is_sec_mend==1}}">
  710 + <block wx:if="{{is_show_sto_cat}}">
  711 + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">
  712 + {{item.name}}
  713 + </view>
  714 + </block>
  715 + <block wx:else>
  716 + <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">
  717 + {{item.pickup_name}}
1232 </view> 718 </view>
  719 + </block>
  720 + </view>
  721 + <!-- ---第二级显示---- -->
  722 + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
  723 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>
  724 + {{sec_sto.name}}
  725 + </view>
  726 + <view class="itemlists" hidden="{{is_sec_mend==0}}">
  727 + <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">
  728 + {{item.pickup_name}}
1233 </view> 729 </view>
1234 </view> 730 </view>
1235 - </view> 731 + </view>
  732 + </view>
1236 </view> 733 </view>
1237 -  
1238 -<!-- 弹起来,购买积分购 --> 734 +<!-- 弹起来,购买积分购 -->
1239 <view hidden="{{!openSpecModal_inte}}"> 735 <view hidden="{{!openSpecModal_inte}}">
1240 - <include src="buy_integral.wxml" />  
1241 -</view>  
1242 -<!-- 弹起来,购买积分购的普通购买 --> 736 + <include src="buy_integral.wxml" />
  737 +</view>
  738 +<!-- 弹起来,购买积分购的普通购买 -->
1243 <view hidden="{{!openSpecModal_inte_normal}}"> 739 <view hidden="{{!openSpecModal_inte_normal}}">
1244 - <include src="buy_integral_normal.wxml" />  
1245 -</view>  
1246 -  
1247 -<!----弹起来,选择规格数量,拼单商品购买------> 740 + <include src="buy_integral_normal.wxml" />
  741 +</view>
  742 +<!-- --弹起来,选择规格数量,拼单商品购买---- -->
1248 <view hidden="{{!openSpecModal_pt}}"> 743 <view hidden="{{!openSpecModal_pt}}">
1249 - <include src="buy_pt.wxml" /> 744 + <include src="buy_pt.wxml" />
1250 </view> 745 </view>
1251 -  
1252 -<!----弹起来优惠信息------> 746 +<!-- --弹起来优惠信息---- -->
1253 <view hidden="{{!openPromModal}}"> 747 <view hidden="{{!openPromModal}}">
1254 <view bindtap="closePromModal" class="cover-layer"></view> 748 <view bindtap="closePromModal" class="cover-layer"></view>
1255 <view class="prom-model"> 749 <view class="prom-model">
@@ -1263,38 +757,44 @@ @@ -1263,38 +757,44 @@
1263 </view> 757 </view>
1264 </view> 758 </view>
1265 </view> 759 </view>
1266 -<!----弹起的----> 760 +<!-- --弹起的-- -->
1267 <block wx:if="{{pd_xx==1}}"> 761 <block wx:if="{{pd_xx==1}}">
1268 <view class="bview"></view> 762 <view class="bview"></view>
1269 <view class="juzhong"> 763 <view class="juzhong">
1270 <view class="xq"> 764 <view class="xq">
1271 - <view class="title" bindtap="close_pt_xx">拼团玩法介绍 765 + <view class="title" bindtap="close_pt_xx">
  766 + 拼团玩法介绍
1272 <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image> 767 <image src="{{iurl}}/miniapp/images/gbi.png" class="close"></image>
1273 </view> 768 </view>
1274 - <view>1.开团: 769 + <view>
  770 + 1.开团:
1275 <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text> 771 <text class="hs1">选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;</text>
1276 </view> 772 </view>
1277 - <view>2.参团: 773 + <view>
  774 + 2.参团:
1278 <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text> 775 <text class="hs1">进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;</text>
1279 </view> 776 </view>
1280 - <view>3.成团: 777 + <view>
  778 + 3.成团:
1281 <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text> 779 <text class="hs1">在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;</text>
1282 </view> 780 </view>
1283 - <view>4.组团失败: 781 + <view>
  782 + 4.组团失败:
1284 <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text> 783 <text class="hs1">在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;</text>
1285 </view> 784 </view>
1286 - <view>5.  
1287 - <text class="hs1">组团有效期间内,拼购商品订单不允许取消。 </text> 785 + <view>
  786 + 5.
  787 + <text class="hs1">组团有效期间内,拼购商品订单不允许取消。</text>
1288 </view> 788 </view>
1289 </view> 789 </view>
1290 </view> 790 </view>
1291 </block> 791 </block>
1292 -<!----弹起领券----> 792 +<!-- --弹起领券-- -->
1293 <view wx:if='{{coupon==1}}'> 793 <view wx:if='{{coupon==1}}'>
1294 <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view> 794 <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view>
1295 <view class="cx-popup {{coupon== true ? 'up' : 'down'}} "> 795 <view class="cx-popup {{coupon== true ? 'up' : 'down'}} ">
1296 <view class="top-frame"> 796 <view class="top-frame">
1297 - <!-- <view class="top two-level-word t-c"> --> 797 + <!-- <view class="top two-level-word t-c"> -->
1298 <view class="top t-c">优惠券领取</view> 798 <view class="top t-c">优惠券领取</view>
1299 </view> 799 </view>
1300 <!-- <view class="top-frame"> 800 <!-- <view class="top-frame">
@@ -1303,209 +803,203 @@ @@ -1303,209 +803,203 @@
1303 <view class="xc-frame"> 803 <view class="xc-frame">
1304 <view class="top-frame"> 804 <view class="top-frame">
1305 <view class="xc-coupon-frame "> 805 <view class="xc-coupon-frame ">
1306 - <!---单张的券--->  
1307 - <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}">  
1308 - <view class="coupon flex">  
1309 - <view class="circle xc-circular-one"></view>  
1310 - <view class="xc-coupon-left ">  
1311 - <view class="flex ai_c xc-money-frame">  
1312 - <text class="xc-money two-level-word xc-rmb">¥</text>  
1313 - <text class="one-level-word xc-money">{{item.money}}</text>  
1314 - </view>  
1315 - <view class="xc-money four-level-word xc-spacing">  
1316 - 满{{item.condition}}元可用  
1317 - </view> 806 + <!-- -单张的券- -->
  807 + <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}">
  808 + <view class="coupon flex">
  809 + <view class="circle xc-circular-one"></view>
  810 + <view class="xc-coupon-left ">
  811 + <view class="flex ai_c xc-money-frame">
  812 + <text class="xc-money two-level-word xc-rmb">¥</text>
  813 + <text class="one-level-word xc-money">{{item.money}}</text>
1318 </view> 814 </view>
1319 - <view class="xc-coupon-right flex">  
1320 - <view class="xc-detail-coupon">  
1321 - <view class="four-level-word">订单金额满{{item.condition}}元可用</view>  
1322 - <view class="four-level-word xc-below">{{filters.replace_time2(item.start)}} 至 {{filters.replace_time2(item.end)}}</view> 815 + <view class="xc-money four-level-word xc-spacing">满{{item.condition}}元可用</view>
  816 + </view>
  817 + <view class="xc-coupon-right flex">
  818 + <view class="xc-detail-coupon">
  819 + <view class="four-level-word">订单金额满{{item.condition}}元可用</view>
  820 + <view class="four-level-word xc-below">
  821 + {{filters.replace_time2(item.start)}} 至 {{filters.replace_time2(item.end)}}
1323 </view> 822 </view>
1324 - <view class="flex-vertical">  
1325 - <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}"  
1326 - data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">{{ item.linging==1?'领取中':'领取'}}</view> 823 + </view>
  824 + <view class="flex-vertical">
  825 + <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}" data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan">
  826 + {{ item.linging==1?'领取中':'领取'}}
1327 </view> 827 </view>
1328 </view> 828 </view>
1329 - <view class="circle xc-circular-two"></view>  
1330 </view> 829 </view>
  830 + <view class="circle xc-circular-two"></view>
1331 </view> 831 </view>
  832 + </view>
1332 </view> 833 </view>
1333 </view> 834 </view>
1334 </view> 835 </view>
1335 <view class="cx-confirm pd20" data-coupon='0' bindtap="switchCoupon"> 836 <view class="cx-confirm pd20" data-coupon='0' bindtap="switchCoupon">
1336 - <view class="confirm t-c">关闭</view> 837 + <view class="confirm t-c">关闭</view>
1337 </view> 838 </view>
1338 </view> 839 </view>
1339 </view> 840 </view>
1340 -  
1341 <!-- 选择门店的弹框,1.1版最新的 --> 841 <!-- 选择门店的弹框,1.1版最新的 -->
1342 <block wx:if="{{store==1}}"> 842 <block wx:if="{{store==1}}">
1343 <view class="mongolia-layer" bindtap="close_popup"></view> 843 <view class="mongolia-layer" bindtap="close_popup"></view>
1344 <view class="popup-frame"> 844 <view class="popup-frame">
1345 - <block wx:if="{{sort_store==0}}">  
1346 - <!-- 头部 标题 -->  
1347 - <view class="popup-top flex-space-between">  
1348 - <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> 845 + <block wx:if="{{sort_store==0}}">
  846 + <!-- 头部 标题 -->
  847 + <view class="popup-top flex-space-between">
  848 + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text>
1349 <view> 849 <view>
1350 - <view>  
1351 - <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>  
1352 - </view>  
1353 - <view class="felx choose_more" bindtap="more_store">  
1354 - <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text>  
1355 - <view class="bg_rights" wx:if="{{is_show_sto_cat}}"></view>  
1356 - </view> 850 + <view>
  851 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
1357 </view> 852 </view>
1358 - </view>  
1359 - <!-- 门店列表,最外层的门店列表,一开始 -->  
1360 - <view class="store-list">  
1361 - <!--如果还没有点击更多门店的时候 -->  
1362 - <block wx:if="{{choice_sort_store==0}}">  
1363 - <!-- 需要for循环 -->  
1364 - <block wx:if="{{is_show_sto_cat==1}}">  
1365 - <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">  
1366 - <view class="store flex-vertical"> 853 + <view class="felx choose_more" bindtap="more_store">
  854 + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text>
  855 + <view class="bg_rights" wx:if="{{is_show_sto_cat}}"></view>
  856 + </view>
  857 + </view>
  858 + </view>
  859 + <!-- 门店列表,最外层的门店列表,一开始 -->
  860 + <view class="store-list">
  861 + <!-- 如果还没有点击更多门店的时候 -->
  862 + <block wx:if="{{choice_sort_store==0}}">
  863 + <!-- 需要for循环 -->
  864 + <block wx:if="{{is_show_sto_cat==1}}">
  865 + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  866 + <view class="store flex-vertical">
1367 <!-- 需要点击事件 --> 867 <!-- 需要点击事件 -->
1368 <block wx:if="{{index==fir_pick_index}}"> 868 <block wx:if="{{index==fir_pick_index}}">
1369 - <view class="circle white xc-hook fs20 red-b">Г</view>  
1370 - </block> 869 + <view class="circle white xc-hook fs20 red-b">Г</view>
  870 + </block>
1371 <block wx:else> 871 <block wx:else>
1372 - <view class="circle xc-hooks"></view>  
1373 - </block> 872 + <view class="circle xc-hooks"></view>
  873 + </block>
1374 <view class="address-frame xc-ash"> 874 <view class="address-frame xc-ash">
1375 - <view class="flex-vertical-between butttem5">  
1376 - <view class="flex xc-ash">  
1377 - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>  
1378 - </view>  
1379 - <view>  
1380 - <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">  
1381 - 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view> 875 + <view class="flex-vertical-between butttem5">
  876 + <view class="flex xc-ash">
  877 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  878 + </view>
  879 + <view>
  880 + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
  881 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}
  882 + </view>
  883 + </view>
1382 </view> 884 </view>
  885 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  886 + </view>
1383 </view> 887 </view>
1384 - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>  
1385 - </view>  
1386 </view> 888 </view>
1387 - </view>  
1388 - </block>  
1389 - <block wx:else>  
1390 - <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">  
1391 - <view class="store flex-vertical">  
1392 - <!-- 需要点击事件 -->  
1393 - <block wx:if="{{index==fir_pick_index}}" >  
1394 - <view class="circle white xc-hook fs20 red-b">Г</view>  
1395 - </block>  
1396 - <block wx:else>  
1397 - <view class="circle xc-hooks"></view>  
1398 - </block>  
1399 -  
1400 - <view class="address-frame xc-ash">  
1401 - <view class="flex-vertical-between ">  
1402 - <view class="flex xc-ash">  
1403 - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>  
1404 - </view>  
1405 - <view>  
1406 - <view class="distance fs24 address-val"  
1407 - wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}  
1408 - </view>  
1409 - </view>  
1410 - </view>  
1411 - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>  
1412 - </view>  
1413 - </view>  
1414 - </view>  
1415 - </block>  
1416 - </block>  
1417 - <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 -->  
1418 - <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store">  
1419 - <view class="store flex-vertical">  
1420 - <!-- 需要点击事件 -->  
1421 - <block wx:if="{{index==sec_pick_index}}">  
1422 - <view class="circle white xc-hook fs20 red-b">Г</view>  
1423 - </block>  
1424 - <block wx:else>  
1425 - <view class="circle xc-hooks"></view>  
1426 - </block>  
1427 -  
1428 - <view class="address-frame xc-ash">  
1429 - <view class="flex-vertical-between ">  
1430 - <view class="flex xc-ash">  
1431 - <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>  
1432 - </view>  
1433 - <view>  
1434 - <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}">  
1435 - 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view>  
1436 - </view> 889 + </block>
  890 + <block wx:else>
  891 + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}">
  892 + <view class="store flex-vertical">
  893 + <!-- 需要点击事件 -->
  894 + <block wx:if="{{index==fir_pick_index}}">
  895 + <view class="circle white xc-hook fs20 red-b">Г</view>
  896 + </block>
  897 + <block wx:else>
  898 + <view class="circle xc-hooks"></view>
  899 + </block>
  900 + <view class="address-frame xc-ash">
  901 + <view class="flex-vertical-between ">
  902 + <view class="flex xc-ash">
  903 + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view>
  904 + </view>
  905 + <view>
  906 + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
  907 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
1437 </view> 908 </view>
1438 - <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>  
1439 </view> 909 </view>
1440 </view> 910 </view>
  911 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
1441 </view> 912 </view>
  913 + </view>
  914 + </view>
  915 + </block>
  916 + </block>
  917 + <block wx:else>
  918 + <!-- 如果是点击选择门店分类后显示分类下的门店 -->
  919 + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store">
  920 + <view class="store flex-vertical">
  921 + <!-- 需要点击事件 -->
  922 + <block wx:if="{{index==sec_pick_index}}">
  923 + <view class="circle white xc-hook fs20 red-b">Г</view>
1442 </block> 924 </block>
1443 -  
1444 - </view>  
1445 -  
1446 - <!-- 门店列表底部 -->  
1447 - <view class="store-bottom-frame">  
1448 - <view class="store-bottom flex-vertical-between">  
1449 - <view class="determine red-b fs28 white t-c" bindtap="sure_pick"  
1450 - data-openindstore="{{open_ind_store}}">确定</view>  
1451 - <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view>  
1452 - </view> 925 + <block wx:else>
  926 + <view class="circle xc-hooks"></view>
  927 + </block>
  928 + <view class="address-frame xc-ash">
  929 + <view class="flex-vertical-between ">
  930 + <view class="flex xc-ash">
  931 + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view>
  932 + </view>
  933 + <view>
  934 + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">
  935 + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}
  936 + </view>
  937 + </view>
  938 + </view>
  939 + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view>
  940 + </view>
  941 + </view>
1453 </view> 942 </view>
1454 -  
1455 - </block>  
1456 -  
1457 -  
1458 - <block wx:else>  
1459 - <view class="popup-top flex-space-between">  
1460 - <text class="fs32 nearby_store">门店分类选择</text> 943 + </block>
  944 + </view>
  945 + <!-- 门店列表底部 -->
  946 + <view class="store-bottom-frame">
  947 + <view class="store-bottom flex-vertical-between">
  948 + <view class="determine red-b fs28 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}">
  949 + 确定
  950 + </view>
  951 + <view class="default t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">
  952 + 设为默认
  953 + </view>
  954 + </view>
  955 + </view>
  956 + </block>
  957 + <block wx:else>
  958 + <view class="popup-top flex-space-between">
  959 + <text class="fs32 nearby_store">门店分类选择</text>
1461 <view> 960 <view>
1462 - <view>  
1463 - <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>  
1464 - </view>  
1465 - <view class="felx choose_mores" bindtap="returns">  
1466 - <text class="fs26 red-co">返回</text>  
1467 - </view> 961 + <view>
  962 + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon>
1468 </view> 963 </view>
1469 - </view>  
1470 - <view class="sort_store_list">  
1471 -  
1472 - <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">  
1473 - <view class="sort-store flex-vertical-between" >  
1474 - <view class="fs30" di>{{item.name}}</view>  
1475 - <view class="black_rights-frame">  
1476 - <view class="black_rights"></view>  
1477 - </view>  
1478 - </view> 964 + <view class="felx choose_mores" bindtap="returns">
  965 + <text class="fs26 red-co">返回</text>
1479 </view> 966 </view>
1480 -  
1481 - </view>  
1482 - </block> 967 + </view>
  968 + </view>
  969 + <view class="sort_store_list">
  970 + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}">
  971 + <view class="sort-store flex-vertical-between">
  972 + <view class="fs30" di>{{item.name}}</view>
  973 + <view class="black_rights-frame">
  974 + <view class="black_rights"></view>
  975 + </view>
  976 + </view>
  977 + </view>
  978 + </view>
  979 + </block>
1483 </view> 980 </view>
1484 -</block>  
1485 -<!-- ---------------分享弹窗--------------- -->  
1486 -<!--二维码显示页面--> 981 +</block>
  982 +<!-- ---------------分享弹窗--------------- -->
  983 +<!-- 二维码显示页面 -->
1487 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> 984 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
1488 <warn id="warn"></warn> 985 <warn id="warn"></warn>
1489 -  
1490 -  
1491 <!-- 分享控件,底部弹出 --> 986 <!-- 分享控件,底部弹出 -->
1492 -<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>  
1493 -  
1494 - 987 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
1495 <view wx:if="{{showPoster}}"> 988 <view wx:if="{{showPoster}}">
1496 - <view class="mask" catchtap="closePoster"></view>  
1497 - <view class="poster-container">  
1498 - <view class="poster-wrapper">  
1499 - <view class="poster">  
1500 - <!-- <view class="poster" bindtap="previewImage"> -->  
1501 - <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>  
1502 - <view class="btn-close" catchtap="closePoster"><text class="iconfont icon-close"></text></view>  
1503 - </view>  
1504 - <!-- <view class="btn-container"> 989 + <view class="mask" catchtap="closePoster"></view>
  990 + <view class="poster-container">
  991 + <view class="poster-wrapper">
  992 + <view class="poster">
  993 + <!-- <view class="poster" bindtap="previewImage"> -->
  994 + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image>
  995 + <view class="btn-close" catchtap="closePoster">
  996 + <text class="iconfont icon-close"></text>
  997 + </view>
  998 + </view>
  999 + <!-- <view class="btn-container">
1505 <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> 1000 <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>
1506 <button class="btn-share" bindtap="savePic">保存到相册</button> 1001 <button class="btn-share" bindtap="savePic">保存到相册</button>
1507 </view> --> 1002 </view> -->
  1003 + </view>
1508 </view> 1004 </view>
1509 - </view>  
1510 -</view>  
1511 - 1005 +</view>
1512 \ No newline at end of file 1006 \ No newline at end of file
packageC/pages/presell/goodsInfo/goodsInfo.wxss
@@ -140,6 +140,7 @@ image { @@ -140,6 +140,7 @@ image {
140 .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} 140 .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;}
141 141
142 .goods-num { 142 .goods-num {
  143 + color: #999;
143 display: flex; 144 display: flex;
144 font-size: 24rpx; 145 font-size: 24rpx;
145 justify-content: space-between; 146 justify-content: space-between;
@@ -2300,9 +2301,18 @@ right:87rpx; @@ -2300,9 +2301,18 @@ right:87rpx;
2300 background: #e5e5e5; 2301 background: #e5e5e5;
2301 } 2302 }
2302 .xc-qt-price{ 2303 .xc-qt-price{
2303 - top:-15rpx;  
2304 -left:25rpx; 2304 + font-style: italic;
  2305 + top:-23rpx;
  2306 +left:40rpx;
  2307 + color: #fff;
  2308 +}
  2309 +.presell_price{
  2310 + font-style: italic;
  2311 +
  2312 + top: 23rpx;
  2313 + left:40rpx;
2305 color: #fff; 2314 color: #fff;
  2315 + justify-content: space-between;
2306 } 2316 }
2307 .xc-qt-price .xc-qtunit-price{ 2317 .xc-qt-price .xc-qtunit-price{
2308 margin-left:6rpx; 2318 margin-left:6rpx;
packageC/pages/presell/list/list.js
@@ -110,6 +110,7 @@ Page({ @@ -110,6 +110,7 @@ Page({
110 getApp().request.get("/api/weshop/marketing/marketingPresellList/page", { 110 getApp().request.get("/api/weshop/marketing/marketingPresellList/page", {
111 data: req, 111 data: req,
112 success: function (res) { 112 success: function (res) {
  113 + console.log(res);
113 self.data.loading = 0; 114 self.data.loading = 0;
114 if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { 115 if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
115 var list = self.data.goodlist ? self.data.goodlist : []; 116 var list = self.data.goodlist ? self.data.goodlist : [];
packageC/pages/presell/list/list.wxml
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> 37 data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image>
38 </navigator> 38 </navigator>
39 <view class="kill-cont"> 39 <view class="kill-cont">
40 - <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">{{item.act_name}}</navigator> 40 + <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">{{item.goods_name}}</navigator>
41 <view class="flex-vertical xc-strip-frame"> 41 <view class="flex-vertical xc-strip-frame">
42 <view class="xc-strip-blank rel"> 42 <view class="xc-strip-blank rel">
43 43
utils/filter.wxs
@@ -30,7 +30,7 @@ var filters = { @@ -30,7 +30,7 @@ var filters = {
30 if (ts == null || ts == undefined || ts == '') return ""; 30 if (ts == null || ts == undefined || ts == '') return "";
31 var d = getDate(ts * 1000) 31 var d = getDate(ts * 1000)
32 var fm = [appendZero(d.getFullYear()), appendZero(d.getMonth() + 1), appendZero(d.getDate())].join('-'); 32 var fm = [appendZero(d.getFullYear()), appendZero(d.getMonth() + 1), appendZero(d.getDate())].join('-');
33 - var md = (d.getMonth() + 1) + '月' + d.getDate() + '日'; 33 + var md = appendZero(d.getMonth() + 1) + '月' + appendZero(d.getDate()) + '日';
34 if (isFull == 1) 34 if (isFull == 1)
35 fm = fm + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes()), appendZero(d.getSeconds())].join(':'); 35 fm = fm + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes()), appendZero(d.getSeconds())].join(':');
36 if (isFull == 2) { 36 if (isFull == 2) {