Commit 9242b261e78abfacfc88b80a7bceb9f362c0e862

Authored by yvan.ni
1 parent 2f0aad02

商品详情修改,我的收藏,我的评价的修改

pages/goods/goodsInfo/goodsInfo.js
1 var t = require("../../../utils/util.js"), 1 var t = require("../../../utils/util.js"),
2 ut = t, 2 ut = t,
3 e = require("../../../utils/common.js"), 3 e = require("../../../utils/common.js"),
4 - a = require("../../../utils/wxParse/wxParse.js"), 4 + a = require("../../../utils/wxParse/wxParse.js"),
5 s = getApp(), 5 s = getApp(),
6 i = s.request, 6 i = s.request,
7 rq = i, 7 rq = i,
@@ -18,14 +18,14 @@ var more = function(e) { @@ -18,14 +18,14 @@ var more = function(e) {
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
21 - 21 +
22 Page({ 22 Page({
23 data: { 23 data: {
24 - start_stop:2,//秒杀开始 结束 的控制(1正在进行,2即将开始)  
25 - color_type:0,//线条控制  
26 - color_type_one:0,  
27 - color_type_two:1,  
28 - 24 + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始)
  25 + color_type: 0, //线条控制
  26 + color_type_one: 0,
  27 + color_type_two: 1,
  28 +
29 gid: "", 29 gid: "",
30 stoid: o.stoid, 30 stoid: o.stoid,
31 url: o.url, 31 url: o.url,
@@ -50,7 +50,8 @@ Page({ @@ -50,7 +50,8 @@ Page({
50 activeCategoryId: 0, 50 activeCategoryId: 0,
51 supportPageScroll: !1, 51 supportPageScroll: !1,
52 address: { 52 address: {
53 - address: "", district: 0 53 + address: "",
  54 + district: 0
54 }, 55 },
55 shipping: "", 56 shipping: "",
56 shippingCost: 0, 57 shippingCost: 0,
@@ -75,29 +76,30 @@ Page({ @@ -75,29 +76,30 @@ Page({
75 }], 76 }],
76 activeCategoryId3: 1, 77 activeCategoryId3: 1,
77 categories3: [{ 78 categories3: [{
78 - name: "全部",  
79 - id: 1,  
80 - num: 0  
81 - },  
82 - { 79 + name: "全部",
  80 + id: 1,
  81 + num: 0
  82 + },
  83 + {
83 name: "有图", 84 name: "有图",
84 id: 5, 85 id: 5,
85 num: 0 86 num: 0
86 }, 87 },
87 88
88 { 89 {
89 - name: "好评",  
90 - id: 2,  
91 - num: 0  
92 - }, {  
93 - name: "中评",  
94 - id: 3,  
95 - num: 0  
96 - }, {  
97 - name: "差评",  
98 - id: 4,  
99 - num: 0  
100 - }, ], 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 + ],
101 103
102 select: { 104 select: {
103 price: 0, 105 price: 0,
@@ -119,11 +121,11 @@ Page({ @@ -119,11 +121,11 @@ Page({
119 is_show_sto_cat: 1, //是否显示门店分类 121 is_show_sto_cat: 1, //是否显示门店分类
120 only_pk: null, 122 only_pk: null,
121 all_sto: null, 123 all_sto: null,
122 - sec_sto: null, //选择了的门店分类  
123 - pickpu_list:null, //读出的所有门店list  
124 - def_pickpu_list:null, //一开始5个门店list  
125 - sec_pick_index:0, //第二级门店选择ID  
126 - fir_pick_index:0, //第一级门店选择ID 124 + sec_sto: null, //选择了的门店分类
  125 + pickpu_list: null, //读出的所有门店list
  126 + def_pickpu_list: null, //一开始5个门店list
  127 + sec_pick_index: 0, //第二级门店选择ID
  128 + fir_pick_index: 0, //第一级门店选择ID
127 129
128 //同一条形码的所有商品 130 //同一条形码的所有商品
129 sku_g: null, 131 sku_g: null,
@@ -147,17 +149,17 @@ Page({ @@ -147,17 +149,17 @@ Page({
147 prom_start_time: null, 149 prom_start_time: null,
148 prom_act: null, 150 prom_act: null,
149 pd_xx: 0, 151 pd_xx: 0,
150 - is_normal: 0, //是否普通购买  
151 - teamgroup:null, //有多少人开团  
152 - grounp_tatal:0, //有几个人开团  
153 - timer:[], 152 + is_normal: 0, //是否普通购买
  153 + teamgroup: null, //有多少人开团
  154 + grounp_tatal: 0, //有几个人开团
  155 + timer: [],
154 156
155 //商品的购买次数 157 //商品的购买次数
156 prom_buy_num: -1, 158 prom_buy_num: -1,
157 g_buy_num: null, 159 g_buy_num: null,
158 - prom_goods_num:0, //活动商品数量  
159 - prom_buy_num:0, //活动商品购买数量  
160 - prom_redis_num:0, //活动商品redis数量 160 + prom_goods_num: 0, //活动商品数量
  161 + prom_buy_num: 0, //活动商品购买数量
  162 + prom_redis_num: 0, //活动商品redis数量
161 163
162 //拼单的规则显示 164 //拼单的规则显示
163 is_show_gz: 0, 165 is_show_gz: 0,
@@ -169,136 +171,167 @@ Page({ @@ -169,136 +171,167 @@ Page({
169 openSpecModal_ind: 0, 171 openSpecModal_ind: 0,
170 172
171 //---计时器开关---- 173 //---计时器开关----
172 - is_timer:1,  
173 - isshow:0,  
174 - bconfig:null, //基础配置 174 + is_timer: 1,
  175 + isshow: 0,
  176 + bconfig: null, //基础配置
175 177
176 - fir_comments:null, //详情页上的评价  
177 - fir_quan:null, //详情页上的券  
178 - quan_list:null, //券列表 178 + fir_comments: null, //详情页上的评价
  179 + fir_quan: null, //详情页上的券
  180 + quan_list: null, //券列表
179 181
180 - coupon:0, 182 + coupon: 0,
181 //会员分享的头像 183 //会员分享的头像
182 - share_head:"",  
183 - share_goods_img:"", 184 + share_head: "",
  185 + share_goods_img: "",
184 186
185 //----------视频图片data参数--------- 187 //----------视频图片data参数---------
186 - current: 0,//图片计数  
187 - swiperCurrent:0,//轮播的下标  
188 - hiddenn:0,//控制轮播计数显示 188 + current: 0, //图片计数
  189 + swiperCurrent: 0, //轮播的下标
  190 + hiddenn: 0, //控制轮播计数显示
189 191
190 - currentTab: 0,// 选择器控制参数 192 + currentTab: 0, // 选择器控制参数
191 mapurl: "", 193 mapurl: "",
192 - mapurl_f_img:"",  
193 - videopicture: 0,//视频图片的控制 194 + mapurl_f_img: "",
  195 + videopicture: 0, //视频图片的控制
194 196
195 - video: 0,//视频图片切换器 197 + video: 0, //视频图片切换器
196 index: 0, 198 index: 0,
197 - noon: 0,//开始视频的隐藏 199 + noon: 0, //开始视频的隐藏
198 200
199 - screenWidth:0,  
200 - canvasHidden:1, 201 + screenWidth: 0,
  202 + canvasHidden: 1,
201 203
202 //--推荐-- 204 //--推荐--
203 - recommend_list:[],  
204 - store_config:null,  
205 - is_show_pl:0, //是否品类  
206 - is_show_pp:0, //是否品牌  
207 - is_show_gb:0, //是否国别  
208 - is_closecoupon:0, 205 + recommend_list: [],
  206 + store_config: null,
  207 + is_show_pl: 0, //是否品类
  208 + is_show_pp: 0, //是否品牌
  209 + is_show_gb: 0, //是否国别
  210 + is_closecoupon: 0,
209 211
210 //是否点赞中 212 //是否点赞中
211 iszaning: 0, 213 iszaning: 0,
212 214
213 - select_store:0,//选择更多  
214 - index:1,  
215 - more_store:0,//选择门店  
216 - sort_store:0,//门店分类  
217 - choice_sort_store:0,//选择分类门店  
218 - new_user:0,//新用户 215 + select_store: 0, //选择更多
  216 + index: 1,
  217 + more_store: 0, //选择门店
  218 + sort_store: 0, //门店分类
  219 + choice_sort_store: 0, //选择分类门店
  220 + new_user: 0, //新用户
  221 +
  222 + def_pick_store: null, // 默认的门店
  223 + lat: null, //维度
  224 + lon: null, //经度
219 225
220 - def_pick_store:null,// 默认的门店  
221 - lat:null, //维度  
222 - lon:null, //经度 226 + is_get_local_ok: 0, //获取坐标是否完成
  227 + region_name: "门店分类", //区域的名字
  228 + is_gps: 1,
  229 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  230 + default_store: {}, //创建添加默认门店地址的对象
223 231
224 - is_get_local_ok:0,//获取坐标是否完成  
225 - region_name:"门店分类",//区域的名字  
226 - is_gps:1,  
227 - open_ind_store:0,//哪里打开的门店列表的控制属性  
228 - default_store:{},//创建添加默认门店地址的对象 232 + comments_no_more:0,
  233 + get_c:0,
229 }, 234 },
230 235
231 //------初始化加载---------- 236 //------初始化加载----------
232 onLoad: function(t) { 237 onLoad: function(t) {
233 - wx.setNavigationBarTitle({ title: "商品详情",})  
234 - var ee = this, that=ee,th=ee, 238 + wx.setNavigationBarTitle({
  239 + title: "商品详情",
  240 + })
  241 + var ee = this,
  242 + that = ee,
  243 + th = ee,
235 gid = t.goods_id; 244 gid = t.goods_id;
236 - 245 +
237 //---获取手机地址坐标-- 246 //---获取手机地址坐标--
238 //--如果tg_id是空的话,分享回来-- 247 //--如果tg_id是空的话,分享回来--
239 if (gid == undefined || gid == null || gid == "") { 248 if (gid == undefined || gid == null || gid == "") {
240 gid = decodeURIComponent(postdata.scene); 249 gid = decodeURIComponent(postdata.scene);
241 } 250 }
242 - ee.setData({ gid: gid }); 251 + ee.setData({
  252 + gid: gid
  253 + });
243 254
244 //----获取系统参数----- 255 //----获取系统参数-----
245 - getApp().getConfig2(function (e) {  
246 - ee.setData({bconfig:e});  
247 -  
248 - if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); }  
249 - if (e.categoryset.indexOf("," + 3 + ",") != -1) { ee.setData({ is_show_pp: 1 }); }  
250 - if (e.categoryset.indexOf("," + 2 + ",") != -1) { ee.setData({ is_show_gb: 1 }); }  
251 -  
252 - var json_d = JSON.parse(e.switch_list);  
253 - ee.setData({ store_config: e, is_closecoupon: json_d.is_closecoupon });  
254 - ee.init(gid);  
255 - //------几人评价-------  
256 - n.init(th, "", "comments");  
257 - th.requestCardNum(), wx.pageScrollTo && th.setData({  
258 - supportPageScroll: !0 256 + getApp().getConfig2(function(e) {
  257 + ee.setData({
  258 + bconfig: e
  259 + });
  260 +
  261 + if (e.categoryset.indexOf("," + 1 + ",") != -1) {
  262 + ee.setData({
  263 + is_show_pl: 1
259 }); 264 });
  265 + }
  266 + if (e.categoryset.indexOf("," + 3 + ",") != -1) {
  267 + ee.setData({
  268 + is_show_pp: 1
  269 + });
  270 + }
  271 + if (e.categoryset.indexOf("," + 2 + ",") != -1) {
  272 + ee.setData({
  273 + is_show_gb: 1
  274 + });
  275 + }
260 276
261 - 277 + var json_d = JSON.parse(e.switch_list);
  278 + ee.setData({
  279 + store_config: e,
  280 + is_closecoupon: json_d.is_closecoupon
  281 + });
  282 + ee.init(gid);
  283 + //------几人评价-------
  284 + //n.init(th, "", "comments");
  285 +
  286 + th.requestCardNum(), wx.pageScrollTo && th.setData({
  287 + supportPageScroll: !0
  288 + });
262 289
263 }); 290 });
264 291
265 //获取用户设备信息,屏幕宽度 292 //获取用户设备信息,屏幕宽度
266 wx.getSystemInfo({ 293 wx.getSystemInfo({
267 success: res => { 294 success: res => {
268 - that.setData({ screenWidth: res.screenWidth }) 295 + that.setData({
  296 + screenWidth: res.screenWidth
  297 + })
269 } 298 }
270 }); 299 });
271 300
272 //获取用户的默认门店 301 //获取用户的默认门店
273 - getApp().get_user_store(function (e) {  
274 - var w_time=setInterval(function () {  
275 - if(that.data.is_get_local_ok==0) return false;  
276 - var distance=null;  
277 - if( that.data.lat!=null && e.distance==undefined){  
278 - //distance=Math.sqrt((e.lat-th.data.lat)*(e.lat-th.data.lat)+(e.lon-th.data.lon)* (e.lon-th.data.lon));  
279 - var distance=ut.getDistance(e.lat,th.data.lat,e.lon,th.data.lon);  
280 - e.distance=distance;  
281 - }  
282 - if(e) that.setData({def_pick_store:e,sto_sele_name:e.pickup_name,sto_sele_id:e.pickup_id,sto_sele_distr:e.distr_type})  
283 - clearInterval(w_time);  
284 - },500)  
285 - }) 302 + getApp().get_user_store(function(e) {
  303 + var w_time = setInterval(function() {
  304 + if (that.data.is_get_local_ok == 0) return false;
  305 + var distance = null;
  306 + if (that.data.lat != null && e.distance == undefined) {
  307 + //distance=Math.sqrt((e.lat-th.data.lat)*(e.lat-th.data.lat)+(e.lon-th.data.lon)* (e.lon-th.data.lon));
  308 + var distance = ut.getDistance(e.lat, th.data.lat, e.lon, th.data.lon);
  309 + e.distance = distance;
  310 + }
  311 + if (e) that.setData({
  312 + def_pick_store: e,
  313 + sto_sele_name: e.pickup_name,
  314 + sto_sele_id: e.pickup_id,
  315 + sto_sele_distr: e.distr_type
  316 + })
  317 + clearInterval(w_time);
  318 + }, 500)
  319 + });
286 320
287 -  
288 -  
289 }, 321 },
290 322
291 //------------程序初始化入口------------- 323 //------------程序初始化入口-------------
292 async init(gid) { 324 async init(gid) {
293 - var ee = this,th=ee, 325 + var ee = this,
  326 + th = ee,
294 gallery = null, 327 gallery = null,
295 is_collect = 0, 328 is_collect = 0,
296 collect_id = 0, 329 collect_id = 0,
297 categories3 = ee.data.categories3, 330 categories3 = ee.data.categories3,
298 - fir_com=null,  
299 - fir_quan=null,  
300 - mapurl=null,  
301 - mapurl_f_img=null; 331 + fir_com = null,
  332 + fir_quan = null,
  333 + mapurl = null,
  334 + mapurl_f_img = null;
302 335
303 336
304 //------图片滚动---------- 337 //------图片滚动----------
@@ -381,51 +414,50 @@ Page({ @@ -381,51 +414,50 @@ Page({
381 is_show:1, 414 is_show:1,
382 }, 415 },
383 }).then(res => { 416 }).then(res => {
384 - fir_com=res.data.data.pageData; 417 + fir_com = res.data.data.pageData;
385 }) 418 })
386 419
387 - if(fir_com){  
388 - for(var ind in fir_com){  
389 - if(fir_com[ind].head_pic=="") fir_com[ind].head_pic= ee.data.iurl+"/miniapp/images/hui_hear_pic.png";  
390 - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);  
391 - if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);  
392 - } 420 + if (fir_com) {
  421 + for (var ind in fir_com) {
  422 + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";
  423 + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
  424 + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
  425 + }
393 } 426 }
394 427
395 - if (th.data.is_closecoupon!=1){ 428 + if (th.data.is_closecoupon != 1) {
396 //----获取详情页的券的数量---- 429 //----获取详情页的券的数量----
397 await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { 430 await getApp().request.promiseGet("/api/weshop/prom/coupon/page", {
398 data: { 431 data: {
399 store_id: os.stoid, 432 store_id: os.stoid,
400 - type:1, 433 + type: 1,
401 pageSize: 3, 434 pageSize: 3,
402 - page:1, 435 + page: 1,
403 }, 436 },
404 }).then(res1 => { 437 }).then(res1 => {
405 - fir_quan=res1.data.data.pageData; 438 + fir_quan = res1.data.data.pageData;
406 }) 439 })
407 } 440 }
408 441
409 -  
410 //--------获取视频图片--------- 442 //--------获取视频图片---------
411 - await getApp().request.promiseGet("/api/weshop/goodsVideos/get/"+os.stoid+"/"+ee.data.gid, {  
412 - 1:1 443 + await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, {
  444 + 1: 1
413 }).then(res1 => { 445 }).then(res1 => {
414 - if(res1.data.code==0){  
415 - mapurl=res1.data.data.video_url;  
416 - mapurl_f_img=res1.data.data.video_img;  
417 - } 446 + if (res1.data.code == 0) {
  447 + mapurl = res1.data.data.video_url;
  448 + mapurl_f_img = res1.data.data.video_img;
  449 + }
418 }) 450 })
419 - 451 +
420 ee.setData({ 452 ee.setData({
421 gallery: gallery, 453 gallery: gallery,
422 is_collect: is_collect, 454 is_collect: is_collect,
423 collect_id: collect_id, 455 collect_id: collect_id,
424 categories3: categories3, 456 categories3: categories3,
425 - fir_quan:fir_quan,  
426 - fir_comments:fir_com,  
427 - mapurl_f_img:mapurl_f_img,  
428 - mapurl:mapurl, 457 + fir_quan: fir_quan,
  458 + fir_comments: fir_com,
  459 + mapurl_f_img: mapurl_f_img,
  460 + mapurl: mapurl,
429 }); 461 });
430 462
431 ee.requestRecommend(); 463 ee.requestRecommend();
@@ -435,8 +467,10 @@ Page({ @@ -435,8 +467,10 @@ Page({
435 //---展示--- 467 //---展示---
436 onShow: function() { 468 onShow: function() {
437 469
438 - this.data.is_timer=1;  
439 - var ee = this,gid = this.data.gid,i=getApp().request; 470 + this.data.is_timer = 1;
  471 + var ee = this,
  472 + gid = this.data.gid,
  473 + i = getApp().request;
440 474
441 this.wait_for_store_config(); 475 this.wait_for_store_config();
442 476
@@ -485,7 +519,7 @@ Page({ @@ -485,7 +519,7 @@ Page({
485 if (t.data.data.original_img.indexOf(o.imghost) == -1) 519 if (t.data.data.original_img.indexOf(o.imghost) == -1)
486 t.data.data.original_img = o.imghost + t.data.data.original_img; 520 t.data.data.original_img = o.imghost + t.data.data.original_img;
487 521
488 - if(t.data.data.goods_content==null) t.data.data.goods_content=""; 522 + if (t.data.data.goods_content == null) t.data.data.goods_content = "";
489 //-----商品详情--- 523 //-----商品详情---
490 a.wxParse("content", "html", t.data.data.goods_content, ee, 6); 524 a.wxParse("content", "html", t.data.data.goods_content, ee, 6);
491 e.wxParseAddFullImageUrl(ee, "content"); 525 e.wxParseAddFullImageUrl(ee, "content");
@@ -513,12 +547,14 @@ Page({ @@ -513,12 +547,14 @@ Page({
513 t.data.data.gg = gg; 547 t.data.data.gg = gg;
514 var uu = []; 548 var uu = [];
515 uu.push(t.data.data); 549 uu.push(t.data.data);
516 - ee.setData({ sku_g: uu,}); 550 + ee.setData({
  551 + sku_g: uu,
  552 + });
517 } 553 }
518 ee.data.g_buy_num = new Map(); 554 ee.data.g_buy_num = new Map();
519 ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); 555 ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id);
520 556
521 - var th=ee; 557 + var th = ee;
522 if (ee.data.cat_name == '') { 558 if (ee.data.cat_name == '') {
523 //过去国别,分类,品牌的名称 559 //过去国别,分类,品牌的名称
524 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { 560 i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, {
@@ -560,7 +596,7 @@ Page({ @@ -560,7 +596,7 @@ Page({
560 }); 596 });
561 this.data.enterAddressPage && (this.data.enterAddressPage = !1); 597 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
562 598
563 - 599 +
564 600
565 }, 601 },
566 enterAddress: function() { 602 enterAddress: function() {
@@ -569,8 +605,8 @@ Page({ @@ -569,8 +605,8 @@ Page({
569 }); 605 });
570 }, 606 },
571 onUnload: function() {}, 607 onUnload: function() {},
572 - onHide:function(){  
573 - this.data.is_timer=0; 608 + onHide: function() {
  609 + this.data.is_timer = 0;
574 }, 610 },
575 //----------三个选项按钮----------- 611 //----------三个选项按钮-----------
576 tabClick: function(t) { 612 tabClick: function(t) {
@@ -591,9 +627,9 @@ Page({ @@ -591,9 +627,9 @@ Page({
591 e.data.c_curr_p = 1; 627 e.data.c_curr_p = 1;
592 this.setData({ 628 this.setData({
593 activeCategoryId3: t.currentTarget.id, 629 activeCategoryId3: t.currentTarget.id,
594 - comments: null 630 + comments: null,comments_no_more:0,get_c:0,
595 }); 631 });
596 - this.requestComments(); 632 + this.requestComments_new();
597 } 633 }
598 }, 634 },
599 635
@@ -605,13 +641,14 @@ Page({ @@ -605,13 +641,14 @@ Page({
605 641
606 tabComment: function() { 642 tabComment: function() {
607 this.setData({ 643 this.setData({
608 - activeCategoryId: 2  
609 - }), this.data.comments || this.requestComments(); 644 + activeCategoryId: 2,comments_no_more:0,get_c:0
  645 + }), this.data.comments || this.requestComments_new();
610 }, 646 },
611 647
612 //商品详情的时候调用 648 //商品详情的时候调用
613 tabGoodsContent: function() { 649 tabGoodsContent: function() {
614 - var th = this,i=getApp().request; 650 + var th = this,
  651 + i = getApp().request;
615 this.setData({ 652 this.setData({
616 activeCategoryId: 1 653 activeCategoryId: 1
617 }); 654 });
@@ -654,46 +691,53 @@ Page({ @@ -654,46 +691,53 @@ Page({
654 }, 691 },
655 692
656 //获取redis中的数量 693 //获取redis中的数量
657 - async getactLen(func){  
658 - var r_num=0,prom_type=this.data.prom_type,prom_id=this.data.prom_id;  
659 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { 694 + async getactLen(func) {
  695 + var r_num = 0,
  696 + prom_type = this.data.prom_type,
  697 + prom_id = this.data.prom_id;
  698 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
660 1: 1 699 1: 1
661 }).then(res => { 700 }).then(res => {
662 var em = res; 701 var em = res;
663 if (em.data.code == 0) { 702 if (em.data.code == 0) {
664 - r_num=em.data.data; 703 + r_num = em.data.data;
665 } 704 }
666 }) 705 })
667 func(r_num); 706 func(r_num);
668 }, 707 },
669 708
670 //------------加入购物车-------------- 709 //------------加入购物车--------------
671 - addCart: function(t) {  
672 - var th=this; 710 + addCart: function(t) {
  711 + var th = this;
673 var ind = t.currentTarget.dataset.openSpecModal_ind; 712 var ind = t.currentTarget.dataset.openSpecModal_ind;
674 - th.setData({open_ind_store: ind}); 713 + th.setData({
  714 + open_ind_store: ind
  715 + });
675 //如果是秒杀的话,要看redis够不够 716 //如果是秒杀的话,要看redis够不够
676 - if(this.data.prom_type==1){  
677 - this.getactLen(function (num) {  
678 - if(num<th.data.goodsInputNum) {  
679 - getApp().my_warnning("秒杀库存不足!",0,th);  
680 - return false;  
681 - }else{  
682 - th.add_cart_func(t);  
683 - }  
684 - });  
685 - }else{ 717 + if (this.data.prom_type == 1) {
  718 + this.getactLen(function(num) {
  719 + if (num < th.data.goodsInputNum) {
  720 + getApp().my_warnning("秒杀库存不足!", 0, th);
  721 + return false;
  722 + } else {
  723 + th.add_cart_func(t);
  724 + }
  725 + });
  726 + } else {
686 th.add_cart_func(t); 727 th.add_cart_func(t);
687 } 728 }
688 }, 729 },
689 //加入购物的函数 730 //加入购物的函数
690 - add_cart_func:function(t){  
691 - var i=getApp().request; 731 + add_cart_func: function(t) {
  732 + var i = getApp().request;
692 if (oo.user_id == null) { 733 if (oo.user_id == null) {
693 - return s.my_warnning("还未登录!",0,this); 734 + return s.my_warnning("还未登录!", 0, this);
694 } 735 }
695 - var e = this,th = e,a = 0,o = this.data.sele_g;  
696 - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th); 736 + var e = this,
  737 + th = e,
  738 + a = 0,
  739 + o = this.data.sele_g;
  740 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
697 a = o.goods_id; 741 a = o.goods_id;
698 742
699 //----------添加到购物车时,要判断限购数量,-------- 743 //----------添加到购物车时,要判断限购数量,--------
@@ -719,13 +763,13 @@ Page({ @@ -719,13 +763,13 @@ Page({
719 } 763 }
720 } 764 }
721 765
722 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th);  
723 - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th); 766 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  767 + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th);
724 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) 768 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
725 this.setData({ 769 this.setData({
726 sto_sele_name: "" 770 sto_sele_name: ""
727 }); 771 });
728 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th); 772 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
729 773
730 //--------------此时操作的数据------------ 774 //--------------此时操作的数据------------
731 var newd = { 775 var newd = {
@@ -744,8 +788,8 @@ Page({ @@ -744,8 +788,8 @@ Page({
744 //-----如果是秒杀,团购,积分购,拼团----- 788 //-----如果是秒杀,团购,积分购,拼团-----
745 if (th.data.prom_type == 1) { 789 if (th.data.prom_type == 1) {
746 newd.goods_price = th.data.prom_price; 790 newd.goods_price = th.data.prom_price;
747 - newd.member_goods_price= th.data.prom_price,  
748 - newd.prom_type = th.data.prom_type; 791 + newd.member_goods_price = th.data.prom_price,
  792 + newd.prom_type = th.data.prom_type;
749 newd.prom_id = th.data.prom_id; 793 newd.prom_id = th.data.prom_id;
750 } else if (th.data.prom_type == 3) { 794 } else if (th.data.prom_type == 3) {
751 newd.prom_type = 0; 795 newd.prom_type = 0;
@@ -776,20 +820,24 @@ Page({ @@ -776,20 +820,24 @@ Page({
776 i.put("/api/weshop/cart/update", { 820 i.put("/api/weshop/cart/update", {
777 data: updata, 821 data: updata,
778 success: function(t) { 822 success: function(t) {
779 - getApp().my_warnning('加入购物车成功', 1, th,450);  
780 - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;  
781 - th.setData({cartGoodsNum:c_num});  
782 - th.closeSpecModal(); 823 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  824 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  825 + th.setData({
  826 + cartGoodsNum: c_num
  827 + });
  828 + th.closeSpecModal();
783 } 829 }
784 }); 830 });
785 } else { 831 } else {
786 i.post("/api/weshop/cart/save", { 832 i.post("/api/weshop/cart/save", {
787 data: newd, 833 data: newd,
788 success: function(t) { 834 success: function(t) {
789 - getApp().my_warnning('加入购物车成功', 1, th,450);  
790 - var c_num=th.data.cartGoodsNum+e.data.goodsInputNum;  
791 - th.setData({cartGoodsNum:c_num});  
792 - th.closeSpecModal(); 835 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  836 + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum;
  837 + th.setData({
  838 + cartGoodsNum: c_num
  839 + });
  840 + th.closeSpecModal();
793 } 841 }
794 }); 842 });
795 } 843 }
@@ -845,11 +893,10 @@ Page({ @@ -845,11 +893,10 @@ Page({
845 this.checkCartNum(Number(t.detail.value)); 893 this.checkCartNum(Number(t.detail.value));
846 }, 894 },
847 895
848 -  
849 //------检查数量是不是超出限购------ 896 //------检查数量是不是超出限购------
850 checkCartNum: function(t) { 897 checkCartNum: function(t) {
851 var th = this; 898 var th = this;
852 - this.get_buy_num(this.data.sele_g,async function() { 899 + this.get_buy_num(this.data.sele_g, async function() {
853 900
854 //--判断商品是否超出限购-- 901 //--判断商品是否超出限购--
855 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 902 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
@@ -863,7 +910,7 @@ Page({ @@ -863,7 +910,7 @@ Page({
863 910
864 //--判断商品是否超出活动限购-- 911 //--判断商品是否超出活动限购--
865 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { 912 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
866 - if (t + th.data.prom_buy_num >th.data.prom_buy_limit) { 913 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
867 wx.showModal({ 914 wx.showModal({
868 title: '超出商品活动限购', 915 title: '超出商品活动限购',
869 }); 916 });
@@ -871,20 +918,22 @@ Page({ @@ -871,20 +918,22 @@ Page({
871 } 918 }
872 } 919 }
873 920
874 - if(th.data.sele_g.prom_type==1 || th.data.sele_g.prom_type==6 ){  
875 - var redis_num=0;  
876 - //------判断活动是否抢光-----  
877 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/"  
878 - + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {  
879 - 1:1 921 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  922 + var redis_num = 0;
  923 + //------判断活动是否抢光-----
  924 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  925 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  926 + 1: 1
880 }).then(res => { 927 }).then(res => {
881 - redis_num=res.data.data;  
882 - }); 928 + redis_num = res.data.data;
  929 + });
883 930
884 - if(t>redis_num){  
885 - wx.showModal({ title: '超出商品活动库存', });  
886 - return false;  
887 - } 931 + if (t > redis_num) {
  932 + wx.showModal({
  933 + title: '超出商品活动库存',
  934 + });
  935 + return false;
  936 + }
888 937
889 } 938 }
890 939
@@ -896,7 +945,6 @@ Page({ @@ -896,7 +945,6 @@ Page({
896 }) 945 })
897 }, 946 },
898 947
899 -  
900 closeSpecModal: function() { 948 closeSpecModal: function() {
901 this.setData({ 949 this.setData({
902 openSpecModal: !1, 950 openSpecModal: !1,
@@ -905,14 +953,19 @@ Page({ @@ -905,14 +953,19 @@ Page({
905 }, 953 },
906 openSpecModel: function(t) { 954 openSpecModel: function(t) {
907 var open_store = t.currentTarget.dataset.ind; 955 var open_store = t.currentTarget.dataset.ind;
908 - 956 +
909 this.setData({ 957 this.setData({
910 - store: 0, choice_sort_store: 0, sort_store: 0, open_ind_store: open_store, 958 + store: 0,
  959 + choice_sort_store: 0,
  960 + sort_store: 0,
  961 + open_ind_store: open_store,
911 }) 962 })
912 //--先判断会员状态-- 963 //--先判断会员状态--
913 - var user_info=getApp().globalData.userInfo;  
914 - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){  
915 - wx.navigateTo({ url: '/pages/getphone/getphone', }) 964 + var user_info = getApp().globalData.userInfo;
  965 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  966 + wx.navigateTo({
  967 + url: '/pages/getphone/getphone',
  968 + })
916 return false; 969 return false;
917 } 970 }
918 971
@@ -924,10 +977,11 @@ Page({ @@ -924,10 +977,11 @@ Page({
924 }, 977 },
925 //---------点击收藏和不收藏------------ 978 //---------点击收藏和不收藏------------
926 collectGoods: function() { 979 collectGoods: function() {
927 - var t = this,i=getApp().request; 980 + var t = this,
  981 + i = getApp().request;
928 var user_id = s.globalData.user_id; 982 var user_id = s.globalData.user_id;
929 if (user_id == '') { 983 if (user_id == '') {
930 - getApp().getUserFir(function () {}); 984 + getApp().getUserFir(function() {});
931 getApp().showWarning("未登录"); 985 getApp().showWarning("未登录");
932 return false; 986 return false;
933 } else { 987 } else {
@@ -936,7 +990,8 @@ Page({ @@ -936,7 +990,8 @@ Page({
936 success: function(e) { 990 success: function(e) {
937 if (e.data.code == 0) { 991 if (e.data.code == 0) {
938 t.setData({ 992 t.setData({
939 - is_collect: 0,collect_id: 0, 993 + is_collect: 0,
  994 + collect_id: 0,
940 }); 995 });
941 } 996 }
942 } 997 }
@@ -968,21 +1023,21 @@ Page({ @@ -968,21 +1023,21 @@ Page({
968 //---------联系客服------------ 1023 //---------联系客服------------
969 contactService: function() { 1024 contactService: function() {
970 s.getConfig(function(t) { 1025 s.getConfig(function(t) {
971 - if(t.store_tel==undefined){  
972 - getApp().request.get("/api/weshop/store/get/" + os.stoid,{  
973 - isShowLoading:1,  
974 - data:{},  
975 - success:function (rs) {  
976 - getApp().globalData.config = rs.data.data;  
977 - if(rs.data.data.store_tel==null && rs.data.data.store_tel==undefined ){  
978 - getApp().my_warnning("商家未设置电话",0,th);  
979 - return false;  
980 - }  
981 - s.confirmBox("请联系客服:" + rs.data.data.store_tel);  
982 - }  
983 - })  
984 - }else{  
985 - s.confirmBox("请联系客服:" + t.store_tel); 1026 + if (t.store_tel == undefined) {
  1027 + getApp().request.get("/api/weshop/store/get/" + os.stoid, {
  1028 + isShowLoading: 1,
  1029 + data: {},
  1030 + success: function(rs) {
  1031 + getApp().globalData.config = rs.data.data;
  1032 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  1033 + getApp().my_warnning("商家未设置电话", 0, th);
  1034 + return false;
  1035 + }
  1036 + s.confirmBox("请联系客服:" + rs.data.data.store_tel);
  1037 + }
  1038 + })
  1039 + } else {
  1040 + s.confirmBox("请联系客服:" + t.store_tel);
986 } 1041 }
987 }); 1042 });
988 }, 1043 },
@@ -1022,8 +1077,6 @@ Page({ @@ -1022,8 +1077,6 @@ Page({
1022 }); 1077 });
1023 }, 1078 },
1024 1079
1025 -  
1026 -  
1027 previewGoodsCommentImgs: function(t) { 1080 previewGoodsCommentImgs: function(t) {
1028 var e = this, 1081 var e = this,
1029 a = this.data.data.comment[t.currentTarget.dataset.cidx].img; 1082 a = this.data.data.comment[t.currentTarget.dataset.cidx].img;
@@ -1052,7 +1105,7 @@ Page({ @@ -1052,7 +1105,7 @@ Page({
1052 bind_bnerr: function(e) { 1105 bind_bnerr: function(e) {
1053 var _errImg = e.target.dataset.errorimg; 1106 var _errImg = e.target.dataset.errorimg;
1054 var _errObj = {}; 1107 var _errObj = {};
1055 - _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; 1108 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif";
1056 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 1109 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1057 }, 1110 },
1058 1111
@@ -1061,7 +1114,7 @@ Page({ @@ -1061,7 +1114,7 @@ Page({
1061 1114
1062 var _errImg = e.target.dataset.errorimg; 1115 var _errImg = e.target.dataset.errorimg;
1063 var _errObj = {}; 1116 var _errObj = {};
1064 - _errObj[_errImg] = this.data.iurl+"/miniapp/images/hui_hear_pic.png" 1117 + _errObj[_errImg] = this.data.iurl + "/miniapp/images/hui_hear_pic.png"
1065 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 1118 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
1066 }, 1119 },
1067 1120
@@ -1125,17 +1178,24 @@ Page({ @@ -1125,17 +1178,24 @@ Page({
1125 var sku_g = this.data.sku_g; 1178 var sku_g = this.data.sku_g;
1126 var item = null; 1179 var item = null;
1127 for (var i in sku_g) { 1180 for (var i in sku_g) {
1128 - if (sku_g[i].goods_id == gid) { item = sku_g[i]; break } 1181 + if (sku_g[i].goods_id == gid) {
  1182 + item = sku_g[i];
  1183 + break
  1184 + }
1129 } 1185 }
1130 - if (item) this.setData({ sele_g: item, gid: gid }); 1186 + if (item) this.setData({
  1187 + sele_g: item,
  1188 + gid: gid
  1189 + });
1131 1190
1132 }, 1191 },
1133 //---------拿出门店分类和门店------------ 1192 //---------拿出门店分类和门店------------
1134 get_sto(e) { 1193 get_sto(e) {
1135 - var th=this;  
1136 - var timer_get=setInterval(function () {  
1137 - if(th.data.is_get_local_ok==0) return false;  
1138 - var dd = null,i=getApp().request; 1194 + var th = this;
  1195 + var timer_get = setInterval(function() {
  1196 + if (th.data.is_get_local_ok == 0) return false;
  1197 + var dd = null,
  1198 + i = getApp().request;
1139 var g_distr_type = th.data.data.distr_type; 1199 var g_distr_type = th.data.data.distr_type;
1140 if (g_distr_type != 0) { 1200 if (g_distr_type != 0) {
1141 dd = { 1201 dd = {
@@ -1152,9 +1212,9 @@ Page({ @@ -1152,9 +1212,9 @@ Page({
1152 } 1212 }
1153 } 1213 }
1154 //如果有距离的话 1214 //如果有距离的话
1155 - if(th.data.lat!=null){  
1156 - dd.lat=th.data.lat;  
1157 - dd.lon=th.data.lon; 1215 + if (th.data.lat != null) {
  1216 + dd.lat = th.data.lat;
  1217 + dd.lon = th.data.lon;
1158 } 1218 }
1159 clearInterval(timer_get); 1219 clearInterval(timer_get);
1160 //----------获取门店---------------- 1220 //----------获取门店----------------
@@ -1164,9 +1224,9 @@ Page({ @@ -1164,9 +1224,9 @@ Page({
1164 var e = res; 1224 var e = res;
1165 if (e.data.code == 0) { 1225 if (e.data.code == 0) {
1166 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- 1226 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
1167 - if(th.data.def_pick_store) {  
1168 - for(var k=0;k<e.data.data.pageData.length;k++){  
1169 - if(e.data.data.pageData[k].pickup_id==th.data.def_pick_store.pickup_id){ 1227 + if (th.data.def_pick_store) {
  1228 + for (var k = 0; k < e.data.data.pageData.length; k++) {
  1229 + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
1170 e.data.data.pageData.splice(k, 1); //删除 1230 e.data.data.pageData.splice(k, 1); //删除
1171 break; 1231 break;
1172 } 1232 }
@@ -1185,15 +1245,18 @@ Page({ @@ -1185,15 +1245,18 @@ Page({
1185 success: function(ee) { 1245 success: function(ee) {
1186 if (ee.data.code == 0) { 1246 if (ee.data.code == 0) {
1187 if (ee.data.data.pageData.length > 0) { 1247 if (ee.data.data.pageData.length > 0) {
1188 - var def_arr=new Array();  
1189 - var ishas=0; 1248 + var def_arr = new Array();
  1249 + var ishas = 0;
1190 //-- 开始就看5个门店 -- 1250 //-- 开始就看5个门店 --
1191 - for(var k=0;k<5;k++){  
1192 - if(k==e.data.data.pageData.length) break; 1251 + for (var k = 0; k < 5; k++) {
  1252 + if (k == e.data.data.pageData.length) break;
1193 def_arr.push(e.data.data.pageData[k]); 1253 def_arr.push(e.data.data.pageData[k]);
1194 } 1254 }
1195 1255
1196 - th.setData({def_pickpu_list:def_arr,pickpu_list:ee.data.data.pageData}); 1256 + th.setData({
  1257 + def_pickpu_list: def_arr,
  1258 + pickpu_list: ee.data.data.pageData
  1259 + });
1197 var sto_cate = ee.data.data.pageData; 1260 var sto_cate = ee.data.data.pageData;
1198 var sto_arr = e.data.data.pageData; 1261 var sto_arr = e.data.data.pageData;
1199 var newarr = new Array(); 1262 var newarr = new Array();
@@ -1203,7 +1266,7 @@ Page({ @@ -1203,7 +1266,7 @@ Page({
1203 for (var i = 0; i < sto_arr.length; i++) { 1266 for (var i = 0; i < sto_arr.length; i++) {
1204 //找一下这个门店有没有在分类数组内 1267 //找一下这个门店有没有在分类数组内
1205 var find2 = 0, 1268 var find2 = 0,
1206 - find2name = ""; 1269 + find2name = "";
1207 for (var m = 0; m < sto_cate.length; m++) { 1270 for (var m = 0; m < sto_cate.length; m++) {
1208 if (sto_arr[i].category_id == sto_cate[m].cat_id) { 1271 if (sto_arr[i].category_id == sto_cate[m].cat_id) {
1209 find2 = sto_cate[m].cat_id; 1272 find2 = sto_cate[m].cat_id;
@@ -1289,7 +1352,7 @@ Page({ @@ -1289,7 +1352,7 @@ Page({
1289 } 1352 }
1290 } 1353 }
1291 }) 1354 })
1292 - },200) 1355 + }, 200)
1293 1356
1294 1357
1295 }, 1358 },
@@ -1333,62 +1396,77 @@ Page({ @@ -1333,62 +1396,77 @@ Page({
1333 }, 1396 },
1334 1397
1335 //评论的调用 1398 //评论的调用
1336 - requestComments: function() {  
1337 - var e = this, th = e;  
1338 - var tp = e.data.activeCategoryId3; 1399 + requestComments_new: async function(){
  1400 + var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3;
1339 var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p; 1401 var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p;
1340 1402
1341 - var req_where={  
1342 - store_id: o.stoid,  
1343 - pageSize: 5,  
1344 - parent_id: 0,  
1345 - goods_id: th.data.gid,  
1346 - commenttype: tp,  
1347 - is_show:1, 1403 + wx.showLoading();
  1404 + var req_where = {
  1405 + store_id: o.stoid, pageSize: 5,
  1406 + parent_id: 0, goods_id: th.data.gid, commenttype: tp,
1348 } 1407 }
1349 - if(getApp().globalData.userInfo){  
1350 - req_where.userId=getApp().globalData.userInfo.user_id; 1408 + if (getApp().globalData.userInfo) {
  1409 + req_where.userId = getApp().globalData.userInfo.user_id;
1351 } 1410 }
1352 1411
1353 - n.request(t, async function(ee) {  
1354 - var tot = ee.data.data.total;  
1355 - e.setData({  
1356 - com_num: tot,get_c:1  
1357 - }); 1412 + var rs_data=null;
  1413 + await getApp().request.promiseGet(t, { data: req_where}).then(res=>{
  1414 + var tot = res.data.data.total;
1358 e.data.c_curr_p++; 1415 e.data.c_curr_p++;
  1416 + e.setData({
  1417 + com_num: tot, //已经有加载
  1418 + });
  1419 + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  1420 + rs_data=res.data.data.pageData;
  1421 + }else{
  1422 + th.setData({comments_no_more:1,auto:1});
  1423 + }
  1424 + })
1359 1425
1360 - var cda = th.data.comments;  
1361 - for(var ind in cda){  
1362 - var ep= cda[ind];  
1363 - if(ep.is_req!=1){  
1364 - await getApp().request.promiseGet("/api/weshop/comment/pageComment",{  
1365 - data:{store_id:o.stoid ,parent_id:ep.comment_id}  
1366 - }).then(res=>{  
1367 - cda[ind].is_req=1;  
1368 - if(cda[ind].head_pic==''){  
1369 - cda[ind].head_pic= th.data.iurl+"/miniapp/images/hui_hear_pic.png";  
1370 - }  
1371 - if(res.data.data.pageData && res.data.data.pageData.length>0){  
1372 - cda[ind].replay_list=res.data.data.pageData;  
1373 - }  
1374 - if(ep.weapp_img!="" && ut.isString(ep.weapp_img)){  
1375 - cda[ind].weapp_img=JSON.parse(ep.weapp_img);  
1376 - }  
1377 - })  
1378 - } 1426 + if (rs_data){
  1427 + //var cda = th.data.comments;
  1428 + var cda = rs_data,com_data=th.data.comments;
  1429 + for (var ind in cda) {
  1430 + var ep = cda[ind];
  1431 + if (cda[ind].head_pic == '') {
  1432 + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";
  1433 + }
  1434 + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {
  1435 + cda[ind].weapp_img = JSON.parse(ep.weapp_img);
  1436 + }
  1437 + if (ep.img != "" && ut.isString(ep.img)) {
  1438 + cda[ind].img = ut.unserialize(ep.img);
  1439 + }
  1440 +
  1441 + //--测量多有字的宽带,计算有多少行--
  1442 + var widh=ut.measureText(ep.content,30);
  1443 + var lines=widh/712;
  1444 + cda[ind].seeMore=false;
  1445 + if(lines>3) cda[ind].seeMore=true;
  1446 +
  1447 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  1448 + data: {store_id: o.stoid, parent_id: ep.comment_id }
  1449 + }).then(res => {
  1450 + if (res.data.data.pageData && res.data.data.pageData.length > 0) {
  1451 + cda[ind].replay_list = res.data.data.pageData;
  1452 + }
  1453 + })
1379 } 1454 }
1380 1455
1381 - th.setData({  
1382 - comments: cda  
1383 - }); 1456 + if (!com_data) com_data = cda;
  1457 + else com_data = com_data.concat(cda);
1384 1458
1385 - }, null,req_where); 1459 + th.setData({ comments: com_data});
  1460 + }
  1461 + th.setData({get_c: 1});
  1462 + wx.hideLoading();
1386 }, 1463 },
1387 1464
1388 //加载更多是靠这个函数 1465 //加载更多是靠这个函数
1389 onReachBottom: function() { 1466 onReachBottom: function() {
1390 - if (this.data.activeCategoryId == 2)  
1391 - n.canloadMore() && this.requestComments(); 1467 + if (this.data.activeCategoryId == 2){
  1468 + if(!this.data.comments_no_more) this.requestComments_new();
  1469 + }
1392 }, 1470 },
1393 1471
1394 //--------检查是否活动,活动是否开始,或者是否结束------- 1472 //--------检查是否活动,活动是否开始,或者是否结束-------
@@ -1397,7 +1475,8 @@ Page({ @@ -1397,7 +1475,8 @@ Page({
1397 th = ee; 1475 th = ee;
1398 if (prom_type == 3 || prom_type == 0) { 1476 if (prom_type == 3 || prom_type == 0) {
1399 this.setData({ 1477 this.setData({
1400 - prom_type: prom_type,isshow:1, 1478 + prom_type: prom_type,
  1479 + isshow: 1,
1401 }); 1480 });
1402 return false; 1481 return false;
1403 } 1482 }
@@ -1420,7 +1499,8 @@ Page({ @@ -1420,7 +1499,8 @@ Page({
1420 success: function(t) { 1499 success: function(t) {
1421 if (t.data.code != 0) { 1500 if (t.data.code != 0) {
1422 ee.setData({ 1501 ee.setData({
1423 - prom_type: 0,isshow:1, 1502 + prom_type: 0,
  1503 + isshow: 1,
1424 }); 1504 });
1425 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1505 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1426 return false; 1506 return false;
@@ -1428,25 +1508,28 @@ Page({ @@ -1428,25 +1508,28 @@ Page({
1428 //----已经结束----- 1508 //----已经结束-----
1429 if (t.data.data.is_end == 1) { 1509 if (t.data.data.is_end == 1) {
1430 ee.setData({ 1510 ee.setData({
1431 - prom_type: 0,isshow:1, 1511 + prom_type: 0,
  1512 + isshow: 1,
1432 }); 1513 });
1433 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1514 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1434 return false; 1515 return false;
1435 } 1516 }
1436 //----已经过期----- 1517 //----已经过期-----
1437 var now = ut.gettimestamp(); 1518 var now = ut.gettimestamp();
1438 - if (t.data.data.end_time < now ) { 1519 + if (t.data.data.end_time < now) {
1439 ee.setData({ 1520 ee.setData({
1440 - prom_type: 0,isshow:1, 1521 + prom_type: 0,
  1522 + isshow: 1,
1441 }); 1523 });
1442 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1524 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1443 return false; 1525 return false;
1444 } 1526 }
1445 1527
1446 /*-- 还没有开始预热的也不显示 --*/ 1528 /*-- 还没有开始预热的也不显示 --*/
1447 - if (t.data.data.show_time >now) { 1529 + if (t.data.data.show_time > now) {
1448 ee.setData({ 1530 ee.setData({
1449 - prom_type: 0,isshow:1, 1531 + prom_type: 0,
  1532 + isshow: 1,
1450 }); 1533 });
1451 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1534 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1452 return false; 1535 return false;
@@ -1455,7 +1538,7 @@ Page({ @@ -1455,7 +1538,7 @@ Page({
1455 var t_gd = ee.data.data; 1538 var t_gd = ee.data.data;
1456 var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); 1539 var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
1457 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); 1540 var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss");
1458 - 1541 +
1459 ee.setData({ 1542 ee.setData({
1460 prom_price: t.data.data.price, 1543 prom_price: t.data.data.price,
1461 prom_type: 1, 1544 prom_type: 1,
@@ -1464,7 +1547,7 @@ Page({ @@ -1464,7 +1547,7 @@ Page({
1464 prom_act: t.data.data, 1547 prom_act: t.data.data,
1465 prom_end_time: prom_end_time, 1548 prom_end_time: prom_end_time,
1466 prom_start_time: prom_start_time, 1549 prom_start_time: prom_start_time,
1467 - isshow:1, 1550 + isshow: 1,
1468 }); 1551 });
1469 1552
1470 var newTime = ut.gettimestamp(); 1553 var newTime = ut.gettimestamp();
@@ -1515,7 +1598,8 @@ Page({ @@ -1515,7 +1598,8 @@ Page({
1515 success: function(t) { 1598 success: function(t) {
1516 if (t.data.code != 0) { 1599 if (t.data.code != 0) {
1517 ee.setData({ 1600 ee.setData({
1518 - prom_type: 0,isshow:1, 1601 + prom_type: 0,
  1602 + isshow: 1,
1519 }); 1603 });
1520 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1604 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1521 return false; 1605 return false;
@@ -1523,7 +1607,8 @@ Page({ @@ -1523,7 +1607,8 @@ Page({
1523 //----已经结束----- 1607 //----已经结束-----
1524 if (t.data.data.is_end == 1) { 1608 if (t.data.data.is_end == 1) {
1525 ee.setData({ 1609 ee.setData({
1526 - prom_type: 0,isshow:1, 1610 + prom_type: 0,
  1611 + isshow: 1,
1527 }); 1612 });
1528 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1613 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1529 return false; 1614 return false;
@@ -1532,7 +1617,8 @@ Page({ @@ -1532,7 +1617,8 @@ Page({
1532 var now = ut.gettimestamp(); 1617 var now = ut.gettimestamp();
1533 if (t.data.data.end_time < now) { 1618 if (t.data.data.end_time < now) {
1534 ee.setData({ 1619 ee.setData({
1535 - prom_type: 0,isshow:1, 1620 + prom_type: 0,
  1621 + isshow: 1,
1536 }); 1622 });
1537 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1623 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1538 return false; 1624 return false;
@@ -1541,7 +1627,8 @@ Page({ @@ -1541,7 +1627,8 @@ Page({
1541 /*-- 还没有开始预热的也不显示 --*/ 1627 /*-- 还没有开始预热的也不显示 --*/
1542 if (t.data.data.show_time > now) { 1628 if (t.data.data.show_time > now) {
1543 ee.setData({ 1629 ee.setData({
1544 - prom_type: 0,isshow:1, 1630 + prom_type: 0,
  1631 + isshow: 1,
1545 }); 1632 });
1546 ee.get_sku(os.stoid, ee.data.data.sku, gid); 1633 ee.get_sku(os.stoid, ee.data.data.sku, gid);
1547 return false; 1634 return false;
@@ -1562,51 +1649,55 @@ Page({ @@ -1562,51 +1649,55 @@ Page({
1562 th.data.buy_order = odr; 1649 th.data.buy_order = odr;
1563 if (odr.pt_status == 0 && odr.order_status == 1) { 1650 if (odr.pt_status == 0 && odr.order_status == 1) {
1564 th.setData({ 1651 th.setData({
1565 - user_order_pt_state: 1 1652 + user_order_pt_state: 1
1566 }); 1653 });
1567 } 1654 }
1568 if (odr.pt_status == 1 && odr.order_status == 1) { 1655 if (odr.pt_status == 1 && odr.order_status == 1) {
1569 - if (odr.is_zsorder == 4){  
1570 - getApp().request.promiseGet("/api/weshop/teamgroup/page/", {  
1571 - data: { store_id: os.stoid, team_id: odr.pt_prom_id, listno: odr.pt_listno }  
1572 - }).then(res => {  
1573 - var now=ut.gettimestamp();  
1574 - var tgr = res.data.data.pageData[0];  
1575 - //如果团的时间已经到了  
1576 - if (now >= tgr.kt_end_time){  
1577 - th.update_jiti(tgr.id);  
1578 - }else{  
1579 - th.setData({  
1580 - user_order_pt_state: 2  
1581 - });  
1582 - }  
1583 - })  
1584 -  
1585 - }else{  
1586 - th.setData({  
1587 - user_order_pt_state: 2  
1588 - });  
1589 - }  
1590 - }  
1591 -  
1592 - if (odr.pt_status == 2 && odr.is_zsorder == 4) { 1656 + if (odr.is_zsorder == 4) {
  1657 + getApp().request.promiseGet("/api/weshop/teamgroup/page/", {
  1658 + data: {
  1659 + store_id: os.stoid,
  1660 + team_id: odr.pt_prom_id,
  1661 + listno: odr.pt_listno
  1662 + }
  1663 + }).then(res => {
  1664 + var now = ut.gettimestamp();
  1665 + var tgr = res.data.data.pageData[0];
  1666 + //如果团的时间已经到了
  1667 + if (now >= tgr.kt_end_time) {
  1668 + th.update_jiti(tgr.id);
  1669 + } else {
  1670 + th.setData({
  1671 + user_order_pt_state: 2
  1672 + });
  1673 + }
  1674 + })
  1675 +
  1676 + } else {
1593 th.setData({ 1677 th.setData({
1594 - user_order_pt_state: 3, 1678 + user_order_pt_state: 2
1595 }); 1679 });
1596 - th.data.wk_order_id=odr.order_id; 1680 + }
  1681 + }
  1682 +
  1683 + if (odr.pt_status == 2 && odr.is_zsorder == 4) {
  1684 + th.setData({
  1685 + user_order_pt_state: 3,
  1686 + });
  1687 + th.data.wk_order_id = odr.order_id;
1597 } 1688 }
1598 } 1689 }
1599 }, 1690 },
1600 }); 1691 });
1601 1692
1602 //----------查看阶梯团------------ 1693 //----------查看阶梯团------------
1603 - if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined){  
1604 - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);  
1605 - var max_num=0;  
1606 - t.data.data.ct_rylist.forEach(function (val,ind) {  
1607 - if(val.rynum>max_num) max_num=val.rynum;  
1608 - })  
1609 - t.data.data.max_ct_num=max_num; 1694 + if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) {
  1695 + t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist);
  1696 + var max_num = 0;
  1697 + t.data.data.ct_rylist.forEach(function(val, ind) {
  1698 + if (val.rynum > max_num) max_num = val.rynum;
  1699 + })
  1700 + t.data.data.max_ct_num = max_num;
1610 } 1701 }
1611 1702
1612 var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); 1703 var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss");
@@ -1619,7 +1710,7 @@ Page({ @@ -1619,7 +1710,7 @@ Page({
1619 prom_act: t.data.data, 1710 prom_act: t.data.data,
1620 prom_end_time: prom_end_time, 1711 prom_end_time: prom_end_time,
1621 prom_start_time: prom_start_time, 1712 prom_start_time: prom_start_time,
1622 - isshow:1, 1713 + isshow: 1,
1623 }); 1714 });
1624 1715
1625 var newTime = now; 1716 var newTime = now;
@@ -1651,40 +1742,51 @@ Page({ @@ -1651,40 +1742,51 @@ Page({
1651 }, 1742 },
1652 1743
1653 //--获取有多少人在开团-- 1744 //--获取有多少人在开团--
1654 - async get_team_group(prom_id){  
1655 - var teamgroup=[],th=this,grounp_tatal=0;  
1656 - //如果活动是开团不是商家团  
1657 - if(this.data.prom_act.kttype>1) {  
1658 - //获取活动从表信息team_id  
1659 - await getApp().request.promiseGet("/api/weshop/teamgroup/page", { 1745 + async get_team_group(prom_id) {
  1746 + var teamgroup = [],
  1747 + th = this,
  1748 + grounp_tatal = 0;
  1749 + //如果活动是开团不是商家团
  1750 + if (this.data.prom_act.kttype > 1) {
  1751 + //获取活动从表信息team_id
  1752 + await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
  1753 + data: {
  1754 + store_id: os.stoid,
  1755 + pageSize: 3,
  1756 + page: 1,
  1757 + state: 2,
  1758 + team_id: prom_id
  1759 + }
  1760 + }).then(res => {
  1761 + teamgroup = res.data.data.pageData;
  1762 + grounp_tatal = res.data.data.total;
  1763 + })
  1764 + //获取订单的总数这个接口不能用
  1765 + for (i = 0; i < teamgroup.length; i++) {
  1766 + await getApp().request.promiseGet("/api/weshop/order/page", {
1660 data: { 1767 data: {
1661 - store_id: os.stoid, pageSize: 3, page: 1,  
1662 - state: 2,  
1663 - team_id: prom_id 1768 + store_id: os.stoid,
  1769 + pt_status: 1,
  1770 + pt_listno: teamgroup[i].listno
1664 } 1771 }
1665 }).then(res => { 1772 }).then(res => {
1666 - teamgroup = res.data.data.pageData;  
1667 - grounp_tatal = res.data.data.total; 1773 + var order = res.data.data.pageData;
  1774 + teamgroup[i].open_num = order.length;
1668 }) 1775 })
1669 - //获取订单的总数这个接口不能用  
1670 - for (i = 0; i < teamgroup.length; i++) {  
1671 - await getApp().request.promiseGet("/api/weshop/order/page", {  
1672 - data: { store_id: os.stoid, pt_status: 1, pt_listno: teamgroup[i].listno }  
1673 - }).then(res => {  
1674 - var order = res.data.data.pageData;  
1675 - teamgroup[i].open_num = order.length;  
1676 - })  
1677 - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {  
1678 - var user = res.data.data;  
1679 - teamgroup[i].user = user;  
1680 - })  
1681 - } 1776 + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => {
  1777 + var user = res.data.data;
  1778 + teamgroup[i].user = user;
  1779 + })
  1780 + }
1682 1781
1683 - if (teamgroup.length > 0) {  
1684 - th.setData({ teamgroup: teamgroup, grounp_tatal: grounp_tatal });  
1685 - th.countDown2();  
1686 - } 1782 + if (teamgroup.length > 0) {
  1783 + th.setData({
  1784 + teamgroup: teamgroup,
  1785 + grounp_tatal: grounp_tatal
  1786 + });
  1787 + th.countDown2();
1687 } 1788 }
  1789 + }
1688 }, 1790 },
1689 1791
1690 //---小于10的格式化函数---- 1792 //---小于10的格式化函数----
@@ -1694,7 +1796,7 @@ Page({ @@ -1694,7 +1796,7 @@ Page({
1694 1796
1695 //----倒计时函数----- 1797 //----倒计时函数-----
1696 countDown(time, prom_st) { 1798 countDown(time, prom_st) {
1697 - if(!this.data.is_timer) return false; 1799 + if (!this.data.is_timer) return false;
1698 var th = this; 1800 var th = this;
1699 // 获取当前时间,同时得到活动结束时间数组 1801 // 获取当前时间,同时得到活动结束时间数组
1700 var endTime = time; 1802 var endTime = time;
@@ -1799,8 +1901,8 @@ Page({ @@ -1799,8 +1901,8 @@ Page({
1799 if (tt.data.code == 0) { 1901 if (tt.data.code == 0) {
1800 map.set(gd.goods_id, g_buy_num); 1902 map.set(gd.goods_id, g_buy_num);
1801 th.setData({ 1903 th.setData({
1802 - g_buy_num: map,  
1803 - prom_buy_num: tt.data.data.goodsbuynum, 1904 + g_buy_num: map,
  1905 + prom_buy_num: tt.data.data.goodsbuynum,
1804 }); 1906 });
1805 "function" == typeof func && func(); 1907 "function" == typeof func && func();
1806 } 1908 }
@@ -1841,10 +1943,17 @@ Page({ @@ -1841,10 +1943,17 @@ Page({
1841 1943
1842 //--点击弹起拼单-- 1944 //--点击弹起拼单--
1843 openSpecModel_pt: function(e) { 1945 openSpecModel_pt: function(e) {
  1946 +
  1947 +
  1948 + this.setData({ open_ind_store: 4});//拼团直接给4
  1949 +
  1950 +
1844 //--先判断会员状态-- 1951 //--先判断会员状态--
1845 - var user_info=getApp().globalData.userInfo;  
1846 - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){  
1847 - wx.navigateTo({ url: '/pages/getphone/getphone', }) 1952 + var user_info = getApp().globalData.userInfo;
  1953 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  1954 + wx.navigateTo({
  1955 + url: '/pages/getphone/getphone',
  1956 + })
1848 return false; 1957 return false;
1849 } 1958 }
1850 1959
@@ -1877,7 +1986,7 @@ Page({ @@ -1877,7 +1986,7 @@ Page({
1877 pageSize: 1, 1986 pageSize: 1,
1878 page: 1 1987 page: 1
1879 }, 1988 },
1880 - success: function (e) { 1989 + success: function(e) {
1881 //--跳转到已经购买的情况-- 1990 //--跳转到已经购买的情况--
1882 if (e.data.data.pageData.length > 0) { 1991 if (e.data.data.pageData.length > 0) {
1883 var odr = e.data.data.pageData[0]; 1992 var odr = e.data.data.pageData[0];
@@ -1886,12 +1995,12 @@ Page({ @@ -1886,12 +1995,12 @@ Page({
1886 wx.showModal({ 1995 wx.showModal({
1887 title: "您已经购买了该商品待支付中", 1996 title: "您已经购买了该商品待支付中",
1888 success: function(a) { 1997 success: function(a) {
1889 - if(a.confirm){  
1890 - wx.navigateTo({  
1891 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
1892 - });  
1893 - }  
1894 - } 1998 + if (a.confirm) {
  1999 + wx.navigateTo({
  2000 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  2001 + });
  2002 + }
  2003 + }
1895 }); 2004 });
1896 } else if (odr.pt_status == 1 && odr.order_status == 1) { 2005 } else if (odr.pt_status == 1 && odr.order_status == 1) {
1897 wx.navigateTo({ 2006 wx.navigateTo({
@@ -1904,8 +2013,7 @@ Page({ @@ -1904,8 +2013,7 @@ Page({
1904 }); 2013 });
1905 } 2014 }
1906 2015
1907 - }  
1908 - else{ 2016 + } else {
1909 th.setData({ 2017 th.setData({
1910 is_normal: ind, 2018 is_normal: ind,
1911 openSpecModal_pt: 1 2019 openSpecModal_pt: 1
@@ -1918,30 +2026,33 @@ Page({ @@ -1918,30 +2026,33 @@ Page({
1918 2026
1919 //-----------------拼单生成方法--------------------- 2027 //-----------------拼单生成方法---------------------
1920 addCart_pt: function() { 2028 addCart_pt: function() {
1921 - var th=this;  
1922 - if(this.data.is_normal==0){  
1923 - //看一下有没有起购数,如果有起购数,要计算起购数  
1924 - var qnum=parseFloat(th.data.prom_act.minbuynum);  
1925 - if(qnum>0 && th.data.goodsInputNum<qnum ){  
1926 - getApp().confirmBox("拼团商品至少要买"+qnum+"件!");  
1927 - return false;  
1928 - } 2029 + var th = this;
  2030 + if (this.data.is_normal == 0) {
  2031 + //看一下有没有起购数,如果有起购数,要计算起购数
  2032 + var qnum = parseFloat(th.data.prom_act.minbuynum);
  2033 + if (qnum > 0 && th.data.goodsInputNum < qnum) {
  2034 + getApp().confirmBox("拼团商品至少要买" + qnum + "件!");
  2035 + return false;
  2036 + }
1929 2037
1930 - th.addcart_pt_func();  
1931 - }else{ 2038 + th.addcart_pt_func();
  2039 + } else {
1932 th.addcart_pt_func(); 2040 th.addcart_pt_func();
1933 } 2041 }
1934 }, 2042 },
1935 2043
1936 - addcart_pt_func:function(){ 2044 + addcart_pt_func: function() {
1937 if (oo.user_id == null) { 2045 if (oo.user_id == null) {
1938 - s.my_warnning("还未登录!",0,this);return; 2046 + s.my_warnning("还未登录!", 0, this);
  2047 + return;
1939 } 2048 }
1940 - var e = this, th = e,o = this.data.sele_g;  
1941 - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th); 2049 + var e = this,
  2050 + th = e,
  2051 + o = this.data.sele_g;
  2052 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
1942 2053
1943 //----------添加到购物车时,要判断限购数量,-------- 2054 //----------添加到购物车时,要判断限购数量,--------
1944 - e.get_buy_num(o,async function(ee) { 2055 + e.get_buy_num(o, async function(ee) {
1945 2056
1946 //---判断商品是否超出限购--- 2057 //---判断商品是否超出限购---
1947 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { 2058 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
@@ -1964,28 +2075,29 @@ Page({ @@ -1964,28 +2075,29 @@ Page({
1964 } 2075 }
1965 } 2076 }
1966 2077
1967 - var redis_num=0  
1968 - //-------判断活动是否抢光---------  
1969 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/"+th.data.sele_g.prom_id , {  
1970 - 1: 1  
1971 - }).then(res => {  
1972 - redis_num=res.data.data;  
1973 - }) 2078 + var redis_num = 0
  2079 + //-------判断活动是否抢光---------
  2080 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, {
  2081 + 1: 1
  2082 + }).then(res => {
  2083 + redis_num = res.data.data;
  2084 + })
1974 2085
1975 - if(th.data.goodsInputNum>redis_num){  
1976 - wx.showModal({  
1977 - title: '提示',content: '超出商品活动库存'  
1978 - });  
1979 - return false;  
1980 - } 2086 + if (th.data.goodsInputNum > redis_num) {
  2087 + wx.showModal({
  2088 + title: '提示',
  2089 + content: '超出商品活动库存'
  2090 + });
  2091 + return false;
  2092 + }
1981 2093
1982 - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th);  
1983 - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th); 2094 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  2095 + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th);
1984 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) 2096 if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
1985 this.setData({ 2097 this.setData({
1986 sto_sele_name: "" 2098 sto_sele_name: ""
1987 }); 2099 });
1988 - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th); 2100 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
1989 //--------------此时操作的数据------------ 2101 //--------------此时操作的数据------------
1990 var newd = { 2102 var newd = {
1991 goods_id: o.goods_id, 2103 goods_id: o.goods_id,
@@ -2010,8 +2122,8 @@ Page({ @@ -2010,8 +2122,8 @@ Page({
2010 if (newd.kt_type > 1) { 2122 if (newd.kt_type > 1) {
2011 newd.is_pt_tz = 1; //开团类型 2123 newd.is_pt_tz = 1; //开团类型
2012 } 2124 }
2013 - if (newd.kt_type == 3 && th.data.is_normal!=1){  
2014 - th.data.sto_sele_distr=1; 2125 + if (newd.kt_type == 3 && th.data.is_normal != 1) {
  2126 + th.data.sto_sele_distr = 1;
2015 } 2127 }
2016 2128
2017 } else if (th.data.prom_type == 3) { 2129 } else if (th.data.prom_type == 3) {
@@ -2036,14 +2148,14 @@ Page({ @@ -2036,14 +2148,14 @@ Page({
2036 2148
2037 //-------跳转pt商品------- 2149 //-------跳转pt商品-------
2038 go_to_nopay: function() { 2150 go_to_nopay: function() {
2039 - var th=this; 2151 + var th = this;
2040 wx.navigateTo({ 2152 wx.navigateTo({
2041 url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id, 2153 url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id,
2042 }); 2154 });
2043 }, 2155 },
2044 //-------跳转pt teamshow------- 2156 //-------跳转pt teamshow-------
2045 go_to_team_show: function() { 2157 go_to_team_show: function() {
2046 - var th=this; 2158 + var th = this;
2047 wx.navigateTo({ 2159 wx.navigateTo({
2048 url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn, 2160 url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn,
2049 }); 2161 });
@@ -2051,7 +2163,7 @@ Page({ @@ -2051,7 +2163,7 @@ Page({
2051 2163
2052 //---拼团倒计时--- 2164 //---拼团倒计时---
2053 countDown2() { 2165 countDown2() {
2054 - if(!this.data.is_timer) return false; 2166 + if (!this.data.is_timer) return false;
2055 var th = this; 2167 var th = this;
2056 // 获取当前时间,同时得到活动结束时间数组 2168 // 获取当前时间,同时得到活动结束时间数组
2057 var newTime = ut.gettimestamp(); 2169 var newTime = ut.gettimestamp();
@@ -2077,7 +2189,10 @@ Page({ @@ -2077,7 +2189,10 @@ Page({
2077 } else { 2189 } else {
2078 //活动已结束,全部设置为'00' 2190 //活动已结束,全部设置为'00'
2079 obj = { 2191 obj = {
2080 - day: '00',hou: '00',min: '00', sec: '00' 2192 + day: '00',
  2193 + hou: '00',
  2194 + min: '00',
  2195 + sec: '00'
2081 } 2196 }
2082 } 2197 }
2083 var txt = "timer[" + j + "]"; 2198 var txt = "timer[" + j + "]";
@@ -2088,11 +2203,11 @@ Page({ @@ -2088,11 +2203,11 @@ Page({
2088 setTimeout(th.countDown2, 1000); 2203 setTimeout(th.countDown2, 1000);
2089 }, 2204 },
2090 //跳转参加团 2205 //跳转参加团
2091 - go_cj_team:function (e) {  
2092 - var ind=e.currentTarget.dataset.ind;  
2093 - var item=this.data.teamgroup[ind];  
2094 - var id=item.id;  
2095 - var th=this; 2206 + go_cj_team: function(e) {
  2207 + var ind = e.currentTarget.dataset.ind;
  2208 + var item = this.data.teamgroup[ind];
  2209 + var id = item.id;
  2210 + var th = this;
2096 2211
2097 getApp().request.get("/api/weshop/order/page", { 2212 getApp().request.get("/api/weshop/order/page", {
2098 data: { 2213 data: {
@@ -2103,205 +2218,231 @@ Page({ @@ -2103,205 +2218,231 @@ Page({
2103 page: 1 2218 page: 1
2104 }, 2219 },
2105 success: function(e) { 2220 success: function(e) {
2106 - if (e.data.code != 0) {  
2107 - getApp().my_warnning("读取订单失败",0,th);  
2108 - return fasle;  
2109 - }  
2110 - //--跳转到已经购买的情况--  
2111 - if ( e.data.data.pageData.length > 0) {  
2112 - var odr = e.data.data.pageData[0];  
2113 - //还未支付  
2114 - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0) ) {  
2115 - wx.showModal({  
2116 - title: "您已经购买了该商品待支付中",  
2117 - success: function(a) {  
2118 - if(a.confirm){  
2119 - wx.navigateTo({  
2120 - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,  
2121 - });  
2122 - }  
2123 - }  
2124 - });  
2125 - }else if (odr.pt_status == 1 && odr.order_status == 1){  
2126 - wx.navigateTo({  
2127 - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,  
2128 - });  
2129 - }else{  
2130 - wx.navigateTo({  
2131 - url: "/pages/team/team_show/team_show?tg_id="+id,  
2132 - });  
2133 - }  
2134 - }  
2135 - //--跳转到参团--  
2136 - else{ 2221 + if (e.data.code != 0) {
  2222 + getApp().my_warnning("读取订单失败", 0, th);
  2223 + return fasle;
  2224 + }
  2225 + //--跳转到已经购买的情况--
  2226 + if (e.data.data.pageData.length > 0) {
  2227 + var odr = e.data.data.pageData[0];
  2228 + //还未支付
  2229 + if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  2230 + wx.showModal({
  2231 + title: "您已经购买了该商品待支付中",
  2232 + success: function(a) {
  2233 + if (a.confirm) {
  2234 + wx.navigateTo({
  2235 + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  2236 + });
  2237 + }
  2238 + }
  2239 + });
  2240 + } else if (odr.pt_status == 1 && odr.order_status == 1) {
2137 wx.navigateTo({ 2241 wx.navigateTo({
2138 - url: "/pages/team/team_show/team_show?tg_id="+id, 2242 + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  2243 + });
  2244 + } else {
  2245 + wx.navigateTo({
  2246 + url: "/pages/team/team_show/team_show?tg_id=" + id,
2139 }); 2247 });
2140 } 2248 }
  2249 + }
  2250 + //--跳转到参团--
  2251 + else {
  2252 + wx.navigateTo({
  2253 + url: "/pages/team/team_show/team_show?tg_id=" + id,
  2254 + });
  2255 + }
2141 } 2256 }
2142 }) 2257 })
2143 2258
2144 }, 2259 },
2145 2260
2146 - //跳到团更多  
2147 - go_t_more:function(){  
2148 - var team_id=this.data.prom_id;  
2149 - wx.navigateTo({  
2150 - url: "/pages/team/team_more/team_more?team_id="+team_id,  
2151 - });  
2152 - }, 2261 + //跳到团更多
  2262 + go_t_more: function() {
  2263 + var team_id = this.data.prom_id;
  2264 + wx.navigateTo({
  2265 + url: "/pages/team/team_more/team_more?team_id=" + team_id,
  2266 + });
  2267 + },
2153 2268
2154 - //--点赞功能--  
2155 - click_zan:function (e) {  
2156 - var com_id=e.currentTarget.dataset.com_id;  
2157 - var item_id=e.currentTarget.dataset.item_id;  
2158 - var app=getApp(),th=this; 2269 + //--点赞功能--
  2270 + click_zan: function(e) {
  2271 + var com_id = e.currentTarget.dataset.com_id;
  2272 + var item_id = e.currentTarget.dataset.item_id;
  2273 + var app = getApp(),
  2274 + th = this;
2159 2275
2160 - if(app.globalData.userInfo==null || app.globalData.userInfo==undefined ){  
2161 - app.confirmBox("您还未登录");  
2162 - return false;  
2163 - } 2276 + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {
  2277 + app.confirmBox("您还未登录");
  2278 + return false;
  2279 + }
2164 2280
2165 - var iszan=th.data.comments[item_id].userZanNum;  
2166 - if(this.data.iszaning) return false;  
2167 - this.data.iszaning=1; 2281 + var iszan = th.data.comments[item_id].userZanNum;
  2282 + if (this.data.iszaning) return false;
  2283 + this.data.iszaning = 1;
2168 2284
2169 2285
2170 - app.request.post("/api/weshop/commentZan/save",{  
2171 - data:{store_id:o.stoid,user_id:app.globalData.user_id,goods_id:th.data.gid,comment_id:com_id},  
2172 - success:function (ee) { 2286 + app.request.post("/api/weshop/commentZan/save", {
  2287 + data: {
  2288 + store_id: o.stoid,
  2289 + user_id: app.globalData.user_id,
  2290 + goods_id: th.data.gid,
  2291 + comment_id: com_id
  2292 + },
  2293 + success: function(ee) {
2173 2294
2174 - if (ee.data.code == "-1") {  
2175 - app.my_warnning("不能给自己点赞", 0, th);  
2176 - th.data.iszaning=0;  
2177 - return;  
2178 - } 2295 + if (ee.data.code == "-1") {
  2296 + app.my_warnning("不能给自己点赞", 0, th);
  2297 + th.data.iszaning = 0;
  2298 + return;
  2299 + }
2179 2300
2180 - if(ee.data.code==0 && iszan!=1){  
2181 - var num=th.data.comments[item_id].zan_num; num++;  
2182 - var text="comments["+item_id+"].zan_num";  
2183 - var text1="comments["+item_id+"].userZanNum";  
2184 - var _errObj = {};  
2185 - _errObj[text]=num;  
2186 - _errObj[text1]=1;  
2187 - th.setData(_errObj);  
2188 -  
2189 - }else{  
2190 - var num=th.data.comments[item_id].zan_num; num--;  
2191 - var text="comments["+item_id+"].zan_num";  
2192 - var text1="comments["+item_id+"].userZanNum";  
2193 - var _errObj = {};  
2194 - _errObj[text]=num;  
2195 - _errObj[text1]=0;  
2196 - th.setData(_errObj);  
2197 - } 2301 + if (ee.data.code == 0 && iszan != 1) {
  2302 + var num = th.data.comments[item_id].zan_num;
  2303 + num++;
  2304 + var text = "comments[" + item_id + "].zan_num";
  2305 + var text1 = "comments[" + item_id + "].userZanNum";
  2306 + var _errObj = {};
  2307 + _errObj[text] = num;
  2308 + _errObj[text1] = 1;
  2309 + th.setData(_errObj);
2198 2310
2199 - setTimeout(function(){  
2200 - th.data.iszaning = 0;  
2201 - },500)  
2202 -  
2203 - }  
2204 - })  
2205 - }, 2311 + } else {
  2312 + var num = th.data.comments[item_id].zan_num;
  2313 + num--;
  2314 + var text = "comments[" + item_id + "].zan_num";
  2315 + var text1 = "comments[" + item_id + "].userZanNum";
  2316 + var _errObj = {};
  2317 + _errObj[text] = num;
  2318 + _errObj[text1] = 0;
  2319 + th.setData(_errObj);
  2320 + }
  2321 +
  2322 + setTimeout(function() {
  2323 + th.data.iszaning = 0;
  2324 + }, 500)
  2325 +
  2326 + }
  2327 + })
  2328 + },
2206 2329
2207 /*----券的开关---*/ 2330 /*----券的开关---*/
2208 - switchCoupon:async function(event){ 2331 + switchCoupon: async function(event) {
2209 var coupon = event.currentTarget.dataset.coupon; 2332 var coupon = event.currentTarget.dataset.coupon;
2210 - var app=getApp();  
2211 - var url="/api/weshop/prom/coupon/pageCouponList";  
2212 - var quan_list=this.data.quan_list;  
2213 - var th=this; 2333 + var app = getApp();
  2334 + var url = "/api/weshop/prom/coupon/pageCouponList";
  2335 + var quan_list = this.data.quan_list;
  2336 + var th = this;
2214 2337
2215 //当开启,且列表为空的情况下要 2338 //当开启,且列表为空的情况下要
2216 - if(!quan_list && coupon=="1") {  
2217 - wx.showLoading();  
2218 - await app.request.promiseGet(url, {  
2219 - data: {  
2220 - store_id: os.stoid,  
2221 - type: 1,  
2222 - pageSize: 100,  
2223 - page: 1,  
2224 - user_id:app.globalData.user_id  
2225 - }  
2226 - }).then(res => {  
2227 - wx.hideLoading();  
2228 - quan_list = res.data.data.pageData;  
2229 - }) 2339 + if (!quan_list && coupon == "1") {
  2340 + wx.showLoading();
  2341 + await app.request.promiseGet(url, {
  2342 + data: {
  2343 + store_id: os.stoid,
  2344 + type: 1,
  2345 + pageSize: 100,
  2346 + page: 1,
  2347 + user_id: app.globalData.user_id
  2348 + }
  2349 + }).then(res => {
  2350 + wx.hideLoading();
  2351 + quan_list = res.data.data.pageData;
  2352 + })
2230 2353
2231 - if(quan_list){  
2232 - for(var ind in quan_list){  
2233 - var ep=quan_list[ind];  
2234 - var start=ut.formatTime(ep.use_start_time,"yyyy-MM-dd");  
2235 - var end=ut.formatTime(ep.use_end_time,"yyyy-MM-dd");  
2236 - start=start.replace("00:00:00","");  
2237 - end=end.replace("00:00:00","");  
2238 - quan_list[ind].start=start;  
2239 - quan_list[ind].end=end;  
2240 - } 2354 + if (quan_list) {
  2355 + for (var ind in quan_list) {
  2356 + var ep = quan_list[ind];
  2357 + var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd");
  2358 + var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd");
  2359 + start = start.replace("00:00:00", "");
  2360 + end = end.replace("00:00:00", "");
  2361 + quan_list[ind].start = start;
  2362 + quan_list[ind].end = end;
2241 } 2363 }
  2364 + }
2242 2365
2243 - th.setData({coupon: coupon, quan_list: quan_list});  
2244 - }else{  
2245 - th.setData({coupon: coupon}); 2366 + th.setData({
  2367 + coupon: coupon,
  2368 + quan_list: quan_list
  2369 + });
  2370 + } else {
  2371 + th.setData({
  2372 + coupon: coupon
  2373 + });
2246 } 2374 }
2247 }, 2375 },
2248 2376
2249 //--查看评价-- 2377 //--查看评价--
2250 - look_pj:function () {  
2251 - this.tabComment(); this.doScrollTop(); 2378 + look_pj: function() {
  2379 + this.tabComment();
  2380 + this.doScrollTop();
2252 }, 2381 },
2253 2382
2254 //-----领取券----- 2383 //-----领取券-----
2255 - get_quan:function (e) {  
2256 - var cid=e.currentTarget.dataset.cid;  
2257 - var index=e.currentTarget.dataset.ind;  
2258 - var item=this.data.quan_list[index];  
2259 - 2384 + get_quan: function(e) {
  2385 + var cid = e.currentTarget.dataset.cid;
  2386 + var index = e.currentTarget.dataset.ind;
  2387 + var item = this.data.quan_list[index];
  2388 +
2260 //如果券还在领取中,不能再点 2389 //如果券还在领取中,不能再点
2261 - if (item.linging==1){ 2390 + if (item.linging == 1) {
2262 getApp().my_warnning('领取中..', 0, this); 2391 getApp().my_warnning('领取中..', 0, this);
2263 return false; 2392 return false;
2264 } 2393 }
2265 2394
2266 //如果领取的次数到了 2395 //如果领取的次数到了
2267 - if(item.everyone_num>0 && item.lqnum>=item.everyone_num){  
2268 - getApp().my_warnning('领取失败,您已领完该券',0,this); 2396 + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {
  2397 + getApp().my_warnning('领取失败,您已领完该券', 0, this);
2269 return false; 2398 return false;
2270 } 2399 }
2271 2400
2272 - var lq_num=item.lqnum;  
2273 -  
2274 - var pdata={'uid':oo.user_id,'cid':cid,'store_id':os.stoid,'type':5};  
2275 - var app=getApp(),th=this;  
2276 - app.request.post("/api/weshop/couponList/saveCouponList",{  
2277 - data:pdata,  
2278 - success:function (res) {  
2279 - if(res.data.code==0){  
2280 - app.my_warnning("领取成功",1,th);  
2281 - lq_num++;  
2282 - var text="quan_list["+index+"].lqnum";  
2283 - var text2 = "quan_list[" + index + "].linging";  
2284 - var obj = {}; obj[text] = lq_num; obj[text2] = 0;  
2285 - th.setData(obj);  
2286 - }else{  
2287 - app.confirmBox(res.data.msg);  
2288 - var text2 = "quan_list[" + index + "].linging";  
2289 - var obj = {}; obj[text2] = 0;  
2290 - th.setData(obj);  
2291 - } 2401 + var lq_num = item.lqnum;
  2402 +
  2403 + var pdata = {
  2404 + 'uid': oo.user_id,
  2405 + 'cid': cid,
  2406 + 'store_id': os.stoid,
  2407 + 'type': 5
  2408 + };
  2409 + var app = getApp(),
  2410 + th = this;
  2411 + app.request.post("/api/weshop/couponList/saveCouponList", {
  2412 + data: pdata,
  2413 + success: function(res) {
  2414 + if (res.data.code == 0) {
  2415 + app.my_warnning("领取成功", 1, th);
  2416 + lq_num++;
  2417 + var text = "quan_list[" + index + "].lqnum";
  2418 + var text2 = "quan_list[" + index + "].linging";
  2419 + var obj = {};
  2420 + obj[text] = lq_num;
  2421 + obj[text2] = 0;
  2422 + th.setData(obj);
  2423 + } else {
  2424 + app.confirmBox(res.data.msg);
  2425 + var text2 = "quan_list[" + index + "].linging";
  2426 + var obj = {};
  2427 + obj[text2] = 0;
  2428 + th.setData(obj);
2292 } 2429 }
  2430 + }
2293 }) 2431 })
2294 }, 2432 },
2295 2433
2296 //--定义的保存图片方法,分享团--- 2434 //--定义的保存图片方法,分享团---
2297 - saveImageToPhotosAlbum: function () { 2435 + saveImageToPhotosAlbum: function() {
2298 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 2436 //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
2299 var type = this.data.prom_type; 2437 var type = this.data.prom_type;
2300 if (type == 6) type = 2; 2438 if (type == 6) type = 2;
2301 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; 2439 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
2302 2440
2303 - wx.showLoading({ title: '生成中...', })  
2304 - var that = this, th = that; 2441 + wx.showLoading({
  2442 + title: '生成中...',
  2443 + })
  2444 + var that = this,
  2445 + th = that;
2305 //设置画板显示,才能开始绘图 2446 //设置画板显示,才能开始绘图
2306 that.setData({ 2447 that.setData({
2307 canvasHidden: false 2448 canvasHidden: false
@@ -2318,9 +2459,9 @@ Page({ @@ -2318,9 +2459,9 @@ Page({
2318 //读取文件成功则OK-- 2459 //读取文件成功则OK--
2319 wx.getImageInfo({ 2460 wx.getImageInfo({
2320 src: path3, 2461 src: path3,
2321 - success: function (res) { 2462 + success: function(res) {
2322 //回调写法 2463 //回调写法
2323 - th.get_head_temp(th.get_goods_temp, function () { 2464 + th.get_head_temp(th.get_goods_temp, function() {
2324 var vpath = res.path; 2465 var vpath = res.path;
2325 var context = wx.createCanvasContext('share'); 2466 var context = wx.createCanvasContext('share');
2326 //先画背景 2467 //先画背景
@@ -2335,14 +2476,14 @@ Page({ @@ -2335,14 +2476,14 @@ Page({
2335 var tj_path = "../../../images/share/q_tj.png"; 2476 var tj_path = "../../../images/share/q_tj.png";
2336 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); 2477 context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
2337 context.setFontSize(16 * unit) 2478 context.setFontSize(16 * unit)
2338 - context.setLineJoin('round'); //交点设置成圆角 2479 + context.setLineJoin('round'); //交点设置成圆角
2339 context.setFillStyle("white") 2480 context.setFillStyle("white")
2340 context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); 2481 context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
2341 2482
2342 //---产品名称--- 2483 //---产品名称---
2343 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 2484 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
2344 console.log("ssssssss", th.data.data.goods_name); 2485 console.log("ssssssss", th.data.data.goods_name);
2345 - 2486 +
2346 context.setFillStyle("black"); 2487 context.setFillStyle("black");
2347 context.setFontSize(21.3 * unit) 2488 context.setFontSize(21.3 * unit)
2348 th.draw_Text(context, th.data.data.goods_name, 2489 th.draw_Text(context, th.data.data.goods_name,
@@ -2371,7 +2512,7 @@ Page({ @@ -2371,7 +2512,7 @@ Page({
2371 context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); 2512 context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
2372 //-------大图后面就不一样了----------- 2513 //-------大图后面就不一样了-----------
2373 switch (type) { 2514 switch (type) {
2374 - case 0: //普通商品的展示 2515 + case 0: //普通商品的展示
2375 //中间的几个字 2516 //中间的几个字
2376 var g_path = "../../../images/share/s_gou.png"; 2517 var g_path = "../../../images/share/s_gou.png";
2377 context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); 2518 context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
@@ -2401,7 +2542,7 @@ Page({ @@ -2401,7 +2542,7 @@ Page({
2401 //---二维吗图--- 2542 //---二维吗图---
2402 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); 2543 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
2403 break; 2544 break;
2404 - case 1: //秒杀商品的展示 2545 + case 1: //秒杀商品的展示
2405 //---画线--- 2546 //---画线---
2406 context.setLineWidth(1 * unit) 2547 context.setLineWidth(1 * unit)
2407 context.moveTo(32 * unit, 670 * unit) 2548 context.moveTo(32 * unit, 670 * unit)
@@ -2409,7 +2550,7 @@ Page({ @@ -2409,7 +2550,7 @@ Page({
2409 context.stroke(); 2550 context.stroke();
2410 2551
2411 //画秒杀的图片 2552 //画秒杀的图片
2412 - var miaos_path='../../../images/share/miao_share.png'; 2553 + var miaos_path = '../../../images/share/miao_share.png';
2413 context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); 2554 context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
2414 2555
2415 //---文字--- 2556 //---文字---
@@ -2421,7 +2562,7 @@ Page({ @@ -2421,7 +2562,7 @@ Page({
2421 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); 2562 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
2422 break; 2563 break;
2423 2564
2424 - case 2://会员团和商家团的展示 2565 + case 2: //会员团和商家团的展示
2425 //---画线--- 2566 //---画线---
2426 context.setLineWidth(1 * unit) 2567 context.setLineWidth(1 * unit)
2427 context.moveTo(32 * unit, 670 * unit) 2568 context.moveTo(32 * unit, 670 * unit)
@@ -2456,7 +2597,7 @@ Page({ @@ -2456,7 +2597,7 @@ Page({
2456 //---二维吗图--- 2597 //---二维吗图---
2457 context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); 2598 context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
2458 break 2599 break
2459 - case 3://阶梯团的展示 2600 + case 3: //阶梯团的展示
2460 //---画线--- 2601 //---画线---
2461 context.setLineWidth(1 * unit) 2602 context.setLineWidth(1 * unit)
2462 context.moveTo(32 * unit, 670 * unit) 2603 context.moveTo(32 * unit, 670 * unit)
@@ -2511,35 +2652,37 @@ Page({ @@ -2511,35 +2652,37 @@ Page({
2511 context.restore(); 2652 context.restore();
2512 2653
2513 //把画板内容绘制成图片,并回调 画板图片路径 2654 //把画板内容绘制成图片,并回调 画板图片路径
2514 - context.draw(false, function () {  
2515 - setTimeout(function () {  
2516 - wx.canvasToTempFilePath({  
2517 - x: 0, y: 0,  
2518 - width: 750,  
2519 - height: 1217,  
2520 - destWidth: 1.2 * 750 * 750 / that.data.screenWidth,  
2521 - destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,  
2522 - canvasId: 'share',  
2523 - success: function (res) {  
2524 - that.setData({  
2525 - shareImgPath: res.tempFilePath, canvasHidden: true  
2526 - })  
2527 - if (!res.tempFilePath) {  
2528 - wx.showModal({  
2529 - title: '提示',  
2530 - content: '图片绘制中,请稍后重试',  
2531 - showCancel: false  
2532 - })  
2533 - return false;  
2534 - }  
2535 - wx.previewImage({  
2536 - //将图片预览出来  
2537 - urls: [that.data.shareImgPath]  
2538 - });  
2539 - wx.hideLoading();  
2540 - }  
2541 - })  
2542 - },500) 2655 + context.draw(false, function() {
  2656 + setTimeout(function() {
  2657 + wx.canvasToTempFilePath({
  2658 + x: 0,
  2659 + y: 0,
  2660 + width: 750,
  2661 + height: 1217,
  2662 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  2663 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  2664 + canvasId: 'share',
  2665 + success: function(res) {
  2666 + that.setData({
  2667 + shareImgPath: res.tempFilePath,
  2668 + canvasHidden: true
  2669 + })
  2670 + if (!res.tempFilePath) {
  2671 + wx.showModal({
  2672 + title: '提示',
  2673 + content: '图片绘制中,请稍后重试',
  2674 + showCancel: false
  2675 + })
  2676 + return false;
  2677 + }
  2678 + wx.previewImage({
  2679 + //将图片预览出来
  2680 + urls: [that.data.shareImgPath]
  2681 + });
  2682 + wx.hideLoading();
  2683 + }
  2684 + })
  2685 + }, 500)
2543 2686
2544 }); 2687 });
2545 }); 2688 });
@@ -2549,21 +2692,21 @@ Page({ @@ -2549,21 +2692,21 @@ Page({
2549 2692
2550 2693
2551 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 2694 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
2552 - draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth,unit) { 2695 + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
2553 var lineWidth = 0; 2696 var lineWidth = 0;
2554 var lastSubStrIndex = 0; //每次开始截取的字符串的索引 2697 var lastSubStrIndex = 0; //每次开始截取的字符串的索引
2555 - var han=0; 2698 + var han = 0;
2556 for (let i = 0; i < str.length; i++) { 2699 for (let i = 0; i < str.length; i++) {
2557 - if(han==2) return; 2700 + if (han == 2) return;
2558 //lineWidth += ctx.measureText(str[i]).width; 2701 //lineWidth += ctx.measureText(str[i]).width;
2559 lineWidth += ut.measureText(str[i], 21.3 * unit); 2702 lineWidth += ut.measureText(str[i], 21.3 * unit);
2560 if (lineWidth > canvasWidth) { 2703 if (lineWidth > canvasWidth) {
2561 han++; 2704 han++;
2562 -  
2563 - if (han==2)  
2564 - ctx.fillText(str.substring(lastSubStrIndex, i)+'...', leftWidth, initHeight); //绘制截取部分 2705 +
  2706 + if (han == 2)
  2707 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
2565 else 2708 else
2566 - ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); 2709 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
2567 2710
2568 initHeight += 22; //22为字体的高度 2711 initHeight += 22; //22为字体的高度
2569 lineWidth = 0; 2712 lineWidth = 0;
@@ -2578,15 +2721,17 @@ Page({ @@ -2578,15 +2721,17 @@ Page({
2578 2721
2579 // ----视频图片---- 2722 // ----视频图片----
2580 // 图片计数器 2723 // 图片计数器
2581 - swiperChange: function (e) { 2724 + swiperChange: function(e) {
2582 var that = this; 2725 var that = this;
2583 - if (e.detail.current>0){ 2726 + if (e.detail.current > 0) {
2584 that.setData({ 2727 that.setData({
2585 - hiddenn:1, videopicture:1, 2728 + hiddenn: 1,
  2729 + videopicture: 1,
2586 }) 2730 })
2587 - }else{ 2731 + } else {
2588 that.setData({ 2732 that.setData({
2589 - hiddenn:0,videopicture:0, 2733 + hiddenn: 0,
  2734 + videopicture: 0,
2590 }) 2735 })
2591 } 2736 }
2592 if (e.detail.source == 'touch') { 2737 if (e.detail.source == 'touch') {
@@ -2597,18 +2742,24 @@ Page({ @@ -2597,18 +2742,24 @@ Page({
2597 }, 2742 },
2598 2743
2599 /*---视频相关--*/ 2744 /*---视频相关--*/
2600 - videopicture: function (e) { 2745 + videopicture: function(e) {
2601 var vipi = e.currentTarget.dataset.vipi; 2746 var vipi = e.currentTarget.dataset.vipi;
2602 - this.setData({ videopicture: vipi, swiperCurrent:vipi, noon: 0,current:1 }); 2747 + this.setData({
  2748 + videopicture: vipi,
  2749 + swiperCurrent: vipi,
  2750 + noon: 0,
  2751 + current: 1
  2752 + });
2603 }, 2753 },
2604 2754
2605 - videoPlay: function (e) { 2755 + videoPlay: function(e) {
2606 var _index = e.currentTarget.id 2756 var _index = e.currentTarget.id
2607 this.setData({ 2757 this.setData({
2608 - _index: _index, noon: 1 2758 + _index: _index,
  2759 + noon: 1
2609 }) 2760 })
2610 2761
2611 - setTimeout(function () { 2762 + setTimeout(function() {
2612 //将点击视频进行播放 2763 //将点击视频进行播放
2613 var videoContext = wx.createVideoContext(_index) 2764 var videoContext = wx.createVideoContext(_index)
2614 videoContext.play(); 2765 videoContext.play();
@@ -2617,46 +2768,59 @@ Page({ @@ -2617,46 +2768,59 @@ Page({
2617 2768
2618 2769
2619 //--加载更多商品-- 2770 //--加载更多商品--
2620 - requestRecommend: function () {  
2621 - var e = this, t = '/api/weshop/goods/page?page=1';  
2622 - var th_recommend_list=e.data.recommend_list;  
2623 - getApp().request.get(t,{  
2624 - data: { is_mainshow: 1, isonsale: 1, is_recommend:1, is_on_sale: 1, store_id: os.stoid, pageSize: 6 },  
2625 - success:function (ee) {  
2626 - var recommend_list=ee.data.data.pageData;  
2627 - if(recommend_list && recommend_list.length>0){  
2628 - var dd=[...th_recommend_list,...recommend_list];  
2629 - e.setData({recommend_list,dd});  
2630 - e.data.currentPage++;  
2631 - }else{  
2632 - e.setData({nomore:1}); 2771 + requestRecommend: function() {
  2772 + var e = this,
  2773 + t = '/api/weshop/goods/page?page=1';
  2774 + var th_recommend_list = e.data.recommend_list;
  2775 + getApp().request.get(t, {
  2776 + data: {
  2777 + is_mainshow: 1,
  2778 + isonsale: 1,
  2779 + is_recommend: 1,
  2780 + is_on_sale: 1,
  2781 + store_id: os.stoid,
  2782 + pageSize: 6
  2783 + },
  2784 + success: function(ee) {
  2785 + var recommend_list = ee.data.data.pageData;
  2786 + if (recommend_list && recommend_list.length > 0) {
  2787 + var dd = [...th_recommend_list, ...recommend_list];
  2788 + e.setData({
  2789 + recommend_list,
  2790 + dd
  2791 + });
  2792 + e.data.currentPage++;
  2793 + } else {
  2794 + e.setData({
  2795 + nomore: 1
  2796 + });
2633 } 2797 }
2634 } 2798 }
2635 }) 2799 })
2636 }, 2800 },
2637 2801
2638 //--获取头像的本地缓存,回调写法-- 2802 //--获取头像的本地缓存,回调写法--
2639 - get_head_temp:function (tt,func) {  
2640 - var ee=this;  
2641 - if(ee.data.share_head){ 2803 + get_head_temp: function(tt, func) {
  2804 + var ee = this;
  2805 + if (ee.data.share_head) {
2642 tt(func); 2806 tt(func);
2643 return false; 2807 return false;
2644 } 2808 }
2645 //---获取分享图片的本地地址,头像和商品图片---- 2809 //---获取分享图片的本地地址,头像和商品图片----
2646 var path2 = getApp().globalData.userInfo.head_pic; 2810 var path2 = getApp().globalData.userInfo.head_pic;
2647 - if(path2==""){  
2648 - ee.data.share_head ="../../../images/share/hui_hear_pic.png"; 2811 + if (path2 == "") {
  2812 + ee.data.share_head = "../../../images/share/hui_hear_pic.png";
2649 tt(func); 2813 tt(func);
2650 - }else {  
2651 - path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn"); 2814 + } else {
  2815 + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
2652 wx.getImageInfo({ 2816 wx.getImageInfo({
2653 src: path2, 2817 src: path2,
2654 - success: function (res) { 2818 + success: function(res) {
2655 //res.path是网络图片的本地地址 2819 //res.path是网络图片的本地地址
2656 ee.data.share_head = res.path; 2820 ee.data.share_head = res.path;
2657 tt(func); 2821 tt(func);
2658 }, 2822 },
2659 - fail: function (res) { 2823 + fail: function(res) {
2660 ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 2824 ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
2661 tt(func); 2825 tt(func);
2662 } 2826 }
@@ -2664,294 +2828,409 @@ Page({ @@ -2664,294 +2828,409 @@ Page({
2664 } 2828 }
2665 }, 2829 },
2666 //--获取商品图片的本地缓存,回调写法-- 2830 //--获取商品图片的本地缓存,回调写法--
2667 - get_goods_temp:function (tt) {  
2668 - var ee=this;  
2669 - if(ee.data.share_goods_img) { 2831 + get_goods_temp: function(tt) {
  2832 + var ee = this;
  2833 + if (ee.data.share_goods_img) {
2670 tt(); 2834 tt();
2671 return false; 2835 return false;
2672 } 2836 }
2673 //获取商品是分享图信息 2837 //获取商品是分享图信息
2674 wx.getImageInfo({ 2838 wx.getImageInfo({
2675 - src: ee.data.data.original_img,  
2676 - success: function (res) { 2839 + src: ee.data.data.original_img,
  2840 + success: function(res) {
2677 //res.path是网络图片的本地地址 2841 //res.path是网络图片的本地地址
2678 ee.data.share_goods_img = res.path; 2842 ee.data.share_goods_img = res.path;
2679 tt(); 2843 tt();
2680 }, 2844 },
2681 - fail: function (res) { 2845 + fail: function(res) {
2682 2846
2683 - ee.data.share_goods_img= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 2847 + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
2684 tt(); 2848 tt();
2685 } 2849 }
2686 }); 2850 });
2687 }, 2851 },
2688 2852
2689 //--外侧评价的点击效果--- 2853 //--外侧评价的点击效果---
2690 - clik_evaluate:function(e){  
2691 - var val=e.currentTarget.dataset.val; 2854 + clik_evaluate: function(e) {
  2855 + var val = e.currentTarget.dataset.val;
2692 this.setData({ 2856 this.setData({
2693 - activeCategoryId: 2, activeCategoryId3: val , comments: null 2857 + activeCategoryId: 2,
  2858 + activeCategoryId3: val,
  2859 + comments: null
2694 }); 2860 });
2695 this.requestComments(); 2861 this.requestComments();
2696 }, 2862 },
2697 2863
2698 //--跳转到商品详情页面-- 2864 //--跳转到商品详情页面--
2699 - go_goods: function (e) { 2865 + go_goods: function(e) {
2700 var gid = e.currentTarget.dataset.gid; 2866 var gid = e.currentTarget.dataset.gid;
2701 var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; 2867 var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid;
2702 getApp().goto(url); 2868 getApp().goto(url);
2703 }, 2869 },
2704 2870
2705 //--跳转到支付尾款界面-- 2871 //--跳转到支付尾款界面--
2706 - go_pay_wk:function () {  
2707 - var url = "/pages/cart/cart_wk/cart_wk?order_id="+ this.data.wk_order_id; 2872 + go_pay_wk: function() {
  2873 + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id;
2708 getApp().goto(url); 2874 getApp().goto(url);
2709 }, 2875 },
2710 2876
2711 - pop_err_img:function(e){  
2712 - var txt = e.currentTarget.dataset.errorimg;  
2713 - var ob={};  
2714 - ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";  
2715 - this.setData(ob); 2877 + pop_err_img: function(e) {
  2878 + var txt = e.currentTarget.dataset.errorimg;
  2879 + var ob = {};
  2880 + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif";
  2881 + this.setData(ob);
2716 }, 2882 },
2717 2883
2718 //--调用更新阶梯团的接口-- 2884 //--调用更新阶梯团的接口--
2719 - update_jiti:function(id){  
2720 - var th=this; 2885 + update_jiti: function(id) {
  2886 + var th = this;
2721 //--更新阶梯团-- 2887 //--更新阶梯团--
2722 - getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/"+os.stoid+"/"+id, {  
2723 - success: function (ee) {  
2724 - //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--  
2725 - if (ee.data.code==0) {  
2726 - th.setData({  
2727 - user_order_pt_state: 3,  
2728 - });  
2729 - }else if(ee.data.code==-1){  
2730 - th.setData({  
2731 - user_order_pt_state: 2,  
2732 - });  
2733 - }  
2734 - } 2888 + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, {
  2889 + success: function(ee) {
  2890 + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情--
  2891 + if (ee.data.code == 0) {
  2892 + th.setData({
  2893 + user_order_pt_state: 3,
  2894 + });
  2895 + } else if (ee.data.code == -1) {
  2896 + th.setData({
  2897 + user_order_pt_state: 2,
  2898 + });
  2899 + }
  2900 + }
2735 }) 2901 })
2736 }, 2902 },
2737 // 选择门店 2903 // 选择门店
2738 - choice_store:function(ee){  
2739 - var th=this;  
2740 - //var ind=ee.currentTarget.dataset.ind;  
2741 - var bconfig = th.data.bconfig;  
2742 -  
2743 - if (bconfig.is_sort_storage){  
2744 - wx.getLocation({  
2745 - type: 'wgs84',  
2746 - success: function (res) {  
2747 -  
2748 - th.data.lat = res.latitude;  
2749 - th.data.lon = res.longitude;  
2750 - th.data.is_get_local_ok = 1;  
2751 - th.setData({ is_gps: 1 });  
2752 - //th.onShow();  
2753 - th.get_sto();  
2754 - },  
2755 - fail: function (res) {  
2756 - //th.onShow();  
2757 - th.get_sto();  
2758 - if (res.errCode == 2) {  
2759 - th.setData({ is_gps: 0 });  
2760 - if (th.data.is_gps == 0) {  
2761 - getApp().confirmBox("请开启GPS定位", null, 25000, !1);  
2762 - }  
2763 - } else {  
2764 - th.setData({ is_gps: "3" });  
2765 - }  
2766 -  
2767 - th.data.is_get_local_ok = 1;  
2768 - }  
2769 - })  
2770 - }  
2771 - this.setData({  
2772 - //open_ind_store: ind,  
2773 - store:1,  
2774 - openSpecModal: !1,  
2775 - openSpecModal_pt: !1  
2776 - })  
2777 -},  
2778 - //关闭选择门店  
2779 -close_popup:function(e){  
2780 -  
2781 - this.setData({  
2782 - store: 0, choice_sort_store: 0, sort_store: 0  
2783 - })  
2784 -},  
2785 -//选择更多门店  
2786 - more_store:function(){  
2787 - this.setData({ sort_store: 1 });  
2788 - },  
2789 - sort_store:function() {  
2790 - 2904 + choice_store: function(ee) {
  2905 + var th = this;
  2906 + //var ind=ee.currentTarget.dataset.ind;
  2907 + var bconfig = th.data.bconfig;
  2908 +
  2909 + if (bconfig.is_sort_storage) {
  2910 + wx.getLocation({
  2911 + type: 'wgs84',
  2912 + success: function(res) {
  2913 +
  2914 + th.data.lat = res.latitude;
  2915 + th.data.lon = res.longitude;
  2916 + th.data.is_get_local_ok = 1;
  2917 + th.setData({
  2918 + is_gps: 1
  2919 + });
  2920 + //th.onShow();
  2921 + th.get_sto();
  2922 + },
  2923 + fail: function(res) {
  2924 + //th.onShow();
  2925 + th.get_sto();
  2926 + if (res.errCode == 2) {
  2927 + th.setData({
  2928 + is_gps: 0
  2929 + });
  2930 + if (th.data.is_gps == 0) {
  2931 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  2932 + }
  2933 + } else {
  2934 + th.setData({
  2935 + is_gps: "3"
  2936 + });
  2937 + }
  2938 +
  2939 + th.data.is_get_local_ok = 1;
  2940 + }
  2941 + })
  2942 + }else{
  2943 + th.get_sto();
  2944 + }
  2945 +
  2946 + this.setData({
  2947 + //open_ind_store: ind,
  2948 + store: 1,
  2949 + openSpecModal: !1,
  2950 + openSpecModal_pt: !1
  2951 + })
  2952 + },
  2953 + //关闭选择门店
  2954 + close_popup: function(e) {
  2955 +
  2956 + this.setData({
  2957 + store: 0,
  2958 + choice_sort_store: 0,
  2959 + sort_store: 0
  2960 + })
  2961 + },
  2962 + //选择更多门店
  2963 + more_store: function() {
  2964 + this.setData({
  2965 + sort_store: 1
  2966 + });
  2967 + },
  2968 + sort_store: function() {
  2969 +
2791 }, 2970 },
2792 // 返回按钮 2971 // 返回按钮
2793 - returns:function(){  
2794 - this.setData({ sort_store: 0,choice_sort_store:0}); 2972 + returns: function() {
  2973 + this.setData({
  2974 + sort_store: 0,
  2975 + choice_sort_store: 0
  2976 + });
2795 }, 2977 },
2796 //---选择分类门店--- 2978 //---选择分类门店---
2797 - choice_sort_store:function(e){  
2798 - var index=e.currentTarget.dataset.index; 2979 + choice_sort_store: function(e) {
  2980 + var index = e.currentTarget.dataset.index;
2799 var region_name = e.currentTarget.dataset.region; 2981 var region_name = e.currentTarget.dataset.region;
2800 - var item = this.data.all_sto[index];  
2801 - this.setData({ region_name: region_name, sort_store: 0, choice_sort_store:1, sec_sto: item,sec_pick_index:0 });  
2802 - }, 2982 + var item = this.data.all_sto[index];
  2983 + this.setData({
  2984 + region_name: region_name,
  2985 + sort_store: 0,
  2986 + choice_sort_store: 1,
  2987 + sec_sto: item,
  2988 + sec_pick_index: 0
  2989 + });
  2990 + },
2803 2991
2804 -  
2805 2992
2806 - choose_for_store_fir:function (e) {  
2807 - var index_c=e.currentTarget.dataset.ind;  
2808 -  
2809 - this.setData({fir_pick_index:index_c}) 2993 +
  2994 + choose_for_store_fir: function(e) {
  2995 + var index_c = e.currentTarget.dataset.ind;
  2996 +
  2997 + this.setData({
  2998 + fir_pick_index: index_c
  2999 + })
2810 }, 3000 },
2811 3001
2812 //确定def_pick为选择的门店 3002 //确定def_pick为选择的门店
2813 - sure_pick:function (e) {  
2814 - var th=this; var item=null;  
2815 - var openindstore = e.currentTarget.dataset.openindstore;  
2816 -  
2817 - if(th.data.choice_sort_store==0 ){  
2818 - var index=th.data.fir_pick_index;  
2819 - if(th.data.is_show_sto_cat==1){  
2820 - item=th.data.def_pickpu_list[index];  
2821 - }else{  
2822 - item=th.data.only_pk[index]; //当没有门店分类的时候  
2823 - } 3003 + sure_pick: function(e) {
  3004 + var th = this;
  3005 + var item = null;
  3006 + var openindstore = th.data.open_ind_store;
2824 3007
2825 - }else{  
2826 - var index=th.data.sec_pick_index;  
2827 - item=th.data.sec_sto.s_arr[index]; 3008 + if (th.data.choice_sort_store == 0) {
  3009 + var index = th.data.fir_pick_index;
  3010 + if (th.data.is_show_sto_cat == 1) {
  3011 + item = th.data.def_pickpu_list[index];
  3012 + } else {
  3013 + item = th.data.only_pk[index]; //当没有门店分类的时候
2828 } 3014 }
2829 3015
2830 - //th.setData({fir_pick_index:0});  
2831 - console.log("选择门店刷新","def_pick_store",item);  
2832 - th.setData({def_pick_store:item,sto_sele_name:item.pickup_name,  
2833 - sto_sele_id:item.pickup_id,sto_sele_distr:item.distr_type,store:0,choice_sort_store:0, fir_pick_index:0}); 3016 + } else {
  3017 + var index = th.data.sec_pick_index;
  3018 + item = th.data.sec_sto.s_arr[index];
  3019 + }
2834 3020
2835 - if (openindstore == 1) {  
2836 - th.setData({  
2837 - openSpecModal: !0,  
2838 - openSpecModal_ind: openindstore, });  
2839 - } else if (openindstore == 2) {  
2840 - th.setData({  
2841 - openSpecModal: !0,  
2842 - openSpecModal_ind: openindstore, });  
2843 - } else {  
2844 - th.setData({  
2845 - store: 0, choice_sort_store: 0, sort_store: 0  
2846 - })  
2847 - } 3021 + //th.setData({fir_pick_index:0});
  3022 + console.log("选择门店刷新", "def_pick_store", item);
  3023 + th.setData({
  3024 + def_pick_store: item,
  3025 + sto_sele_name: item.pickup_name,
  3026 + sto_sele_id: item.pickup_id,
  3027 + sto_sele_distr: item.distr_type,
  3028 + store: 0,
  3029 + choice_sort_store: 0,
  3030 + fir_pick_index: 0
  3031 + });
  3032 +
  3033 + if (openindstore == 1) {
  3034 + th.setData({
  3035 + openSpecModal: !0,
  3036 + openSpecModal_ind: openindstore,
  3037 + });
  3038 + } else if (openindstore == 2) {
  3039 + th.setData({
  3040 + openSpecModal: !0,
  3041 + openSpecModal_ind: openindstore,
  3042 +
  3043 + openSpecModal_pt:1
  3044 + });
  3045 + }
  3046 +
  3047 + else if (openindstore == 4) { //4就是拼团
  3048 + th.setData({
  3049 + openSpecModal_pt: 1, //打开拼团购买界面
  3050 + store: 0, //关闭门店
  3051 + choice_sort_store: 0, //关闭门店2级
  3052 + sort_store: 0, //关闭门店2级
  3053 + });
  3054 + }
  3055 +
  3056 + else {
  3057 + th.setData({
  3058 + store: 0,
  3059 + choice_sort_store: 0,
  3060 + sort_store: 0
  3061 + })
  3062 + }
2848 3063
2849 }, 3064 },
2850 //---点击二级之后的选择--- 3065 //---点击二级之后的选择---
2851 - choose_for_store: function (e) { 3066 + choose_for_store: function(e) {
2852 var index_c = e.currentTarget.dataset.ind; 3067 var index_c = e.currentTarget.dataset.ind;
2853 -  
2854 - this.setData({ sec_pick_index: index_c, fir_pick_index: index_c }) 3068 +
  3069 + this.setData({
  3070 + sec_pick_index: index_c,
  3071 + fir_pick_index: index_c
  3072 + })
2855 }, 3073 },
2856 //把选择的门店设置成默认的门店def_pick 3074 //把选择的门店设置成默认的门店def_pick
2857 - set_def_pick:function (e) {  
2858 - var th = this; var item = null;  
2859 -  
2860 - if(th.data.choice_sort_store==0 ){  
2861 -  
2862 - var index=th.data.fir_pick_index;  
2863 -  
2864 - if(th.data.is_show_sto_cat==1){  
2865 - item=th.data.def_pickpu_list[index];  
2866 - }else{  
2867 - item=th.data.only_pk[index]; //当没有门店分类的时候  
2868 -  
2869 - }  
2870 - }else{  
2871 - var index=th.data.sec_pick_index;  
2872 - item=th.data.sec_sto.s_arr[index]; 3075 + set_def_pick: function(e) {
  3076 + var th = this;
  3077 + var item = null;
  3078 +
  3079 + if (th.data.choice_sort_store == 0) {
  3080 +
  3081 + var index = th.data.fir_pick_index;
  3082 +
  3083 + if (th.data.is_show_sto_cat == 1) {
  3084 + item = th.data.def_pickpu_list[index];
  3085 + } else {
  3086 + item = th.data.only_pk[index]; //当没有门店分类的时候
  3087 +
2873 } 3088 }
2874 -  
2875 - var store_id=o.stoid; 3089 + } else {
  3090 + var index = th.data.sec_pick_index;
  3091 + item = th.data.sec_sto.s_arr[index];
  3092 + }
  3093 +
  3094 + var store_id = o.stoid;
2876 var user_id = getApp().globalData.user_id; 3095 var user_id = getApp().globalData.user_id;
2877 var def_pickup_id = item.pickup_id; 3096 var def_pickup_id = item.pickup_id;
2878 -  
2879 - getApp().request.put('/api/weshop/users/update',{  
2880 - data: { user_id,def_pickup_id},  
2881 - success:function(res){  
2882 -  
2883 - if (res.data.code==0){  
2884 - if (th.data.choice_sort_store == 0) th.setData({fir_pick_index:0});  
2885 - s.showWarning("设置门店地址成功", null, 500, !1);  
2886 - getApp().globalData.pk_store = item;  
2887 - }else{  
2888 - console.log("门店地址失败");  
2889 - s.showWarning("设置默认门店地址失败", null, 500, !1);  
2890 - }  
2891 3097
  3098 + getApp().request.put('/api/weshop/users/update', {
  3099 + data: {
  3100 + user_id,
  3101 + def_pickup_id
  3102 + },
  3103 + success: function(res) {
  3104 +
  3105 + if (res.data.code == 0) {
  3106 + if (th.data.choice_sort_store == 0) th.setData({
  3107 + fir_pick_index: 0
  3108 + });
  3109 + s.showWarning("设置门店地址成功", null, 500, !1);
  3110 + getApp().globalData.pk_store = item;
  3111 + } else {
  3112 + console.log("门店地址失败");
  3113 + s.showWarning("设置默认门店地址失败", null, 500, !1);
2892 } 3114 }
  3115 +
  3116 + }
2893 }); 3117 });
2894 - 3118 +
2895 th.setData({ 3119 th.setData({
2896 - def_pick_store: item, sto_sele_name: item.pickup_name,  
2897 - sto_sele_id: item.pickup_id, sto_sele_distr: item.distr_type, store: 0, choice_sort_store: 0 3120 + def_pick_store: item,
  3121 + sto_sele_name: item.pickup_name,
  3122 + sto_sele_id: item.pickup_id,
  3123 + sto_sele_distr: item.distr_type,
  3124 + store: 0,
  3125 + choice_sort_store: 0
2898 }); 3126 });
2899 3127
2900 3128
2901 - var openindstore = e.currentTarget.dataset.openindstore; 3129 + var openindstore = th.data.open_ind_store;
2902 if (openindstore == 1) { 3130 if (openindstore == 1) {
2903 th.setData({ 3131 th.setData({
2904 openSpecModal: !0, 3132 openSpecModal: !0,
2905 openSpecModal_ind: openindstore, 3133 openSpecModal_ind: openindstore,
2906 - store: 0, choice_sort_store: 0, sort_store: 0, 3134 + store: 0,
  3135 + choice_sort_store: 0,
  3136 + sort_store: 0,
2907 }); 3137 });
2908 } else if (openindstore == 2) { 3138 } else if (openindstore == 2) {
2909 th.setData({ 3139 th.setData({
2910 openSpecModal: !0, 3140 openSpecModal: !0,
2911 openSpecModal_ind: openindstore, 3141 openSpecModal_ind: openindstore,
2912 - store: 0, choice_sort_store: 0, sort_store: 0, 3142 + store: 0,
  3143 + choice_sort_store: 0,
  3144 + sort_store: 0,
2913 }); 3145 });
2914 - } else { 3146 + }
  3147 + else if (openindstore == 4) { //4就是拼团
  3148 + th.setData({
  3149 + openSpecModal_pt: 1, //打开拼团购买界面
  3150 + store: 0, //关闭门店
  3151 + choice_sort_store: 0, //关闭门店2级
  3152 + sort_store: 0, //关闭门店2级
  3153 + });
  3154 + }
  3155 +
  3156 + else {
2915 th.setData({ 3157 th.setData({
2916 - store: 0, choice_sort_store: 0, sort_store: 0, 3158 + store: 0,
  3159 + choice_sort_store: 0,
  3160 + sort_store: 0,
2917 }) 3161 })
2918 } 3162 }
2919 -  
2920 - },  
2921 3163
2922 - wait_for_store_config:function(){  
2923 - var th=this;  
2924 - var t_time=setInterval(function(){  
2925 - if (th.data.bconfig==null) false;  
2926 - var e = th.data.bconfig;  
2927 - if (e.is_sort_storage) {  
2928 - wx.getLocation({  
2929 - type: 'wgs84',  
2930 - success: function (res) {  
2931 - th.data.lat = res.latitude;  
2932 - th.data.lon = res.longitude;  
2933 - th.data.is_get_local_ok = 1;  
2934 - },  
2935 - fail: function (res) {  
2936 - if (res.errCode == 2) {  
2937 - th.setData({ is_gps: 0 });  
2938 - if (th.data.is_gps == 0) {  
2939 - getApp().confirmBox("请开启GPS定位", null, 10000, !1);  
2940 - } 3164 + },
2941 3165
2942 - } else {  
2943 - th.setData({ is_gps: "3" }); 3166 + wait_for_store_config: function() {
  3167 + var th = this;
  3168 + var t_time = setInterval(function() {
  3169 + if (th.data.bconfig == null) false;
  3170 + var e = th.data.bconfig;
  3171 + if (e.is_sort_storage) {
  3172 + wx.getLocation({
  3173 + type: 'wgs84',
  3174 + success: function(res) {
  3175 + th.data.lat = res.latitude;
  3176 + th.data.lon = res.longitude;
  3177 + th.data.is_get_local_ok = 1;
  3178 + },
  3179 + fail: function(res) {
  3180 + if (res.errCode == 2) {
  3181 + th.setData({
  3182 + is_gps: 0
  3183 + });
  3184 + if (th.data.is_gps == 0) {
  3185 + getApp().confirmBox("请开启GPS定位", null, 10000, !1);
2944 } 3186 }
2945 3187
2946 - th.data.is_get_local_ok = 1; 3188 + } else {
  3189 + th.setData({
  3190 + is_gps: "3"
  3191 + });
2947 } 3192 }
2948 - })  
2949 - } else {  
2950 - th.data.is_get_local_ok = 1; 3193 +
  3194 + th.data.is_get_local_ok = 1;
  3195 + }
  3196 + })
  3197 + } else {
  3198 + th.data.is_get_local_ok = 1;
  3199 + }
  3200 + clearInterval(t_time);
  3201 + }, 500)
  3202 + },
  3203 + //显示全部
  3204 + toggleHandler: function(e) {
  3205 + var that = this,
  3206 + index = e.currentTarget.dataset.index;
  3207 + for (var i = 0; i < that.data.comments.length; i++) {
  3208 + if (index == i) {
  3209 + for (var i = 0; i < that.data.comments.length; i++) {
  3210 + that.data.comments[index].auto = true;
  3211 + that.data.comments[index].seeMore = false;
2951 } 3212 }
2952 - clearInterval(t_time);  
2953 - },500)  
2954 - }  
2955 - 3213 + }
  3214 + }
  3215 + that.setData({
  3216 + comments: that.data.comments
  3217 + })
  3218 + },
  3219 +
  3220 + //收起更多
  3221 + toggleContent: function(e) {
  3222 + var that = this,
  3223 + index = e.currentTarget.dataset.index;
  3224 + for (var i = 0; i < that.data.comments.length; i++) {
  3225 + if (index == i) {
  3226 + that.data.comments[index].auto = true;
  3227 + that.data.comments[index].seeMore = true;
  3228 + }
  3229 + }
  3230 + that.setData({
  3231 + comments: that.data.comments
  3232 + })
  3233 + },
  3234 +
2956 3235
2957 }); 3236 });
2958 \ No newline at end of file 3237 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.wxml
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <wxs module="filters" src="../../../utils/filter.wxs"></wxs> 2 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
3 3
4 <wxs module="" src="filter.wxs"></wxs> 4 <wxs module="" src="filter.wxs"></wxs>
  5 +<!-- 商品内容区域,普通商品,秒杀,拼团 -->
5 <block wx:if="{{isshow}}"> 6 <block wx:if="{{isshow}}">
6 <view class="container"> 7 <view class="container">
7 <view class="type-navbar"> 8 <view class="type-navbar">
@@ -378,8 +379,8 @@ @@ -378,8 +379,8 @@
378 <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> 379 <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
379 </view> 380 </view>
380 </view> 381 </view>
381 - <view class="xc_comment-font pj_word_size ellipsis-3">  
382 - {{item.content?item.content:''}} 382 + <view class="xc_comment-font pj_word_size ellipsis-2">
  383 + {{item.content?item.content:''}}
383 </view> 384 </view>
384 <view class="xc_comment-val"> 385 <view class="xc_comment-val">
385 <view class="xc_comment-time">{{item.add_time}}</view> 386 <view class="xc_comment-time">{{item.add_time}}</view>
@@ -511,7 +512,7 @@ @@ -511,7 +512,7 @@
511 512
512 </view> 513 </view>
513 514
514 - <!------------商品详情图片页面--------------> 515 + <!------------商品详情图片页面---------------->
515 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}"> 516 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
516 <view class="table_s"> 517 <view class="table_s">
517 <view class="tb_item tb-l"> 518 <view class="tb_item tb-l">
@@ -584,7 +585,7 @@ @@ -584,7 +585,7 @@
584 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> 585 <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
585 </view> 586 </view>
586 </view> 587 </view>
587 - <!------------评价页面--------------> 588 + <!---------------评价页面-------------->
588 <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}"> 589 <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
589 <view class="topframe"> 590 <view class="topframe">
590 <view class="topframe-top"> 591 <view class="topframe-top">
@@ -611,10 +612,12 @@ @@ -611,10 +612,12 @@
611 </view> 612 </view>
612 </view> 613 </view>
613 <view class="xc-pirces"> 614 <view class="xc-pirces">
614 - <text class="middle-font"> 615 + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" >
615 {{item.content?item.content:''}} 616 {{item.content?item.content:''}}
616 - </text> 617 + </view>
617 </view> 618 </view>
  619 + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view>
  620 + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view>
618 <view class="img-ul"> 621 <view class="img-ul">
619 622
620 <block wx:if="{{item.source_type==0}}"> 623 <block wx:if="{{item.source_type==0}}">
@@ -650,8 +653,11 @@ @@ -650,8 +653,11 @@
650 </view> 653 </view>
651 </view> 654 </view>
652 </block> 655 </block>
653 - <block wx:if="{{comments.length==0 && get_c}}">  
654 - <text class="no_pj_list">暂无评价</text> 656 + <block wx:if="{{(!comments || comments.length==0) && get_c }}">
  657 + <text class="no_pj_list">暂无评价</text>
  658 + </block>
  659 + <block wx:if="{{comments.length>10 && comments_no_more}}">
  660 + <text class="no_pj_list">已经加载到底部</text>
655 </block> 661 </block>
656 </view> 662 </view>
657 </view> 663 </view>
@@ -660,6 +666,7 @@ @@ -660,6 +666,7 @@
660 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> 666 <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
661 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> 667 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
662 </view> 668 </view>
  669 +
663 <!-------------------底部按钮--------------------> 670 <!-------------------底部按钮-------------------->
664 <view class="join-cart"> 671 <view class="join-cart">
665 <view bindtap="contactService" class="custom-service cart-ico new_split"> 672 <view bindtap="contactService" class="custom-service cart-ico new_split">
@@ -679,7 +686,8 @@ @@ -679,7 +686,8 @@
679 </navigator> 686 </navigator>
680 </view> 687 </view>
681 <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view> 688 <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
682 - 689 +
  690 + <!---- 普通商品购买 ----->
683 <block wx:if="{{prom_type==0}}"> 691 <block wx:if="{{prom_type==0}}">
684 <block wx:if="{{sele_g.store_count>0}}"> 692 <block wx:if="{{sele_g.store_count>0}}">
685 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> 693 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view>
@@ -692,7 +700,6 @@ @@ -692,7 +700,6 @@
692 </block> 700 </block>
693 </block> 701 </block>
694 702
695 -  
696 <!-------秒杀--------> 703 <!-------秒杀-------->
697 <block wx:if="{{prom_type==1}}"> 704 <block wx:if="{{prom_type==1}}">
698 <block wx:if="{{prom_st==1 && !prom_r_null}}"> 705 <block wx:if="{{prom_st==1 && !prom_r_null}}">
@@ -760,7 +767,6 @@ @@ -760,7 +767,6 @@
760 <nav_box></nav_box> 767 <nav_box></nav_box>
761 768
762 </block> 769 </block>
763 -  
764 <!----弹起来,选择规格数量,普通商品购买和秒杀------> 770 <!----弹起来,选择规格数量,普通商品购买和秒杀------>
765 <view hidden="{{!openSpecModal}}"> 771 <view hidden="{{!openSpecModal}}">
766 <view bindtap="closeSpecModal" class="cover-layer"></view> 772 <view bindtap="closeSpecModal" class="cover-layer"></view>
@@ -793,6 +799,8 @@ @@ -793,6 +799,8 @@
793 </view> 799 </view>
794 </block> 800 </block>
795 </view> 801 </view>
  802 +
  803 + <!-- 选择门店模块 -->
796 <view class="flex-space-between address ai_end xc-width "> 804 <view class="flex-space-between address ai_end xc-width ">
797 805
798 <view class="flex ai_end" wx:if="{{def_pick_store}}"> 806 <view class="flex ai_end" wx:if="{{def_pick_store}}">
@@ -815,7 +823,8 @@ @@ -815,7 +823,8 @@
815 </view> 823 </view>
816 </view> 824 </view>
817 <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view> 825 <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
818 - </view> 826 + </view>
  827 +
819 <!----商品的属性项目----> 828 <!----商品的属性项目---->
820 <view class="xc-goods-attribute"> 829 <view class="xc-goods-attribute">
821 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> 830 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
@@ -839,7 +848,7 @@ @@ -839,7 +848,7 @@
839 <view class="spec-cart-btns"> 848 <view class="spec-cart-btns">
840 849
841 850
842 - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车{{prom_act.buy_num}}</view> 851 + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view>
843 <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> 852 <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
844 853
845 </view> 854 </view>
@@ -896,6 +905,32 @@ @@ -896,6 +905,32 @@
896 </block> 905 </block>
897 </view> 906 </view>
898 </view> 907 </view>
  908 +
  909 + <view style="clear: both"></view>
  910 + <view style="margin-top: 20rpx">
  911 + <view class="flex-space-between address ai_end xc-width ">
  912 +
  913 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  914 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  915 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  916 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  917 +
  918 + </view>
  919 + </view>
  920 +
  921 + <!-- 没有门店的时候 -->
  922 + <view class="flex" bindtap="choice_store"wx:else>
  923 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  924 + <view class="fs28 xc-ash-9f">选择门店</view>
  925 + </view>
  926 +
  927 + <view class="red-co fs28" bindtap="choice_store" >
  928 + 更多门店
  929 + <text class="right-arrow"></text>
  930 + </view>
  931 + </view>
  932 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  933 + </view>
899 <!----商品的属性项目----> 934 <!----商品的属性项目---->
900 <view> 935 <view>
901 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> 936 <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
@@ -914,17 +949,22 @@ @@ -914,17 +949,22 @@
914 </block> 949 </block>
915 <view class="clear"></view> 950 <view class="clear"></view>
916 </view> 951 </view>
  952 +
  953 +
917 <view> 954 <view>
918 - <view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">  
919 - <view wx:if="{{sto_sele_name==''}}">取货门店  
920 - <text class='small'>(选择门店)</text>  
921 - </view>  
922 - <view wx:else>{{sto_sele_name}}</view>  
923 - <view class="item-img">  
924 - <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>  
925 - </view>  
926 - </view>  
927 - <view class="b_num" hidden="{{ismend==1}}"> 955 +
  956 + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
  957 + <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
  958 + <!--<text class='small'>(选择门店)</text>-->
  959 + <!--</view>-->
  960 + <!--<view wx:else>{{sto_sele_name}}</view>-->
  961 + <!--<view class="item-img">-->
  962 + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
  963 + <!--</view>-->
  964 + <!--</view>-->
  965 +
  966 +
  967 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
928 <view>购买数量</view> 968 <view>购买数量</view>
929 <view class="count"> 969 <view class="count">
930 <view bindtap="subCartNum" class="sub">-</view> 970 <view bindtap="subCartNum" class="sub">-</view>
@@ -964,6 +1004,7 @@ @@ -964,6 +1004,7 @@
964 </view> 1004 </view>
965 </view> 1005 </view>
966 </view> 1006 </view>
  1007 +<!----弹起来优惠信息------>
967 <view hidden="{{!openPromModal}}"> 1008 <view hidden="{{!openPromModal}}">
968 <view bindtap="closePromModal" class="cover-layer"></view> 1009 <view bindtap="closePromModal" class="cover-layer"></view>
969 <view class="prom-model"> 1010 <view class="prom-model">
@@ -1160,7 +1201,7 @@ @@ -1160,7 +1201,7 @@
1160 <!-- 门店列表底部 --> 1201 <!-- 门店列表底部 -->
1161 <view class="store-bottom-frame"> 1202 <view class="store-bottom-frame">
1162 <view class="store-bottom flex-vertical-between"> 1203 <view class="store-bottom flex-vertical-between">
1163 - <view class="determine red-b fs28 white t-c" bindtap="sure_pick" 1204 + <view class="determine red-b fs28 white t-c" bindtap="sure_pick"
1164 data-openindstore="{{open_ind_store}}">确定</view> 1205 data-openindstore="{{open_ind_store}}">确定</view>
1165 <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view> 1206 <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view>
1166 </view> 1207 </view>
@@ -1201,6 +1242,4 @@ @@ -1201,6 +1242,4 @@
1201 <!-- ---------------分享弹窗--------------- --> 1242 <!-- ---------------分享弹窗--------------- -->
1202 <!--二维码显示页面--> 1243 <!--二维码显示页面-->
1203 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> 1244 <canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas>
1204 -  
1205 -  
1206 <warn id="warn"></warn> 1245 <warn id="warn"></warn>
1207 \ No newline at end of file 1246 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.wxss
@@ -26,6 +26,9 @@ image { @@ -26,6 +26,9 @@ image {
26 } 26 }
27 .type-navbar-item { 27 .type-navbar-item {
28 border-bottom: 4rpx solid #fff; 28 border-bottom: 4rpx solid #fff;
  29 + display: flex;
  30 + justify-content: center;
  31 + width: 100%;
29 } 32 }
30 .type-item-on { 33 .type-item-on {
31 border-bottom: 4rpx solid #333; 34 border-bottom: 4rpx solid #333;
@@ -282,6 +285,7 @@ image { @@ -282,6 +285,7 @@ image {
282 width: 150rpx; 285 width: 150rpx;
283 height: 150rpx; 286 height: 150rpx;
284 margin-top: 8rpx; 287 margin-top: 8rpx;
  288 + margin-right: 10rpx;
285 } 289 }
286 290
287 .comment-btn { 291 .comment-btn {
@@ -968,7 +972,7 @@ left:31rpx;} @@ -968,7 +972,7 @@ left:31rpx;}
968 margin-bottom: 36rpx; 972 margin-bottom: 36rpx;
969 color: #7d7d7d; 973 color: #7d7d7d;
970 padding-left: 20rpx; 974 padding-left: 20rpx;
971 - font-size: 28rpx; 975 + font-size: 32rpx;
972 } 976 }
973 /*评价人数量*/ 977 /*评价人数量*/
974 .topframe .topframe-top .topframe-top-val{ 978 .topframe .topframe-top .topframe-top-val{
@@ -996,7 +1000,7 @@ left:31rpx;} @@ -996,7 +1000,7 @@ left:31rpx;}
996 1000
997 .buttem-list .item{ 1001 .buttem-list .item{
998 min-width: 17%; 1002 min-width: 17%;
999 - font-size: 23rpx; 1003 + font-size: 24rpx;
1000 border-radius: 20rpx; 1004 border-radius: 20rpx;
1001 background:#ffe3e2; 1005 background:#ffe3e2;
1002 height:38rpx; 1006 height:38rpx;
@@ -1012,16 +1016,11 @@ left:31rpx;} @@ -1012,16 +1016,11 @@ left:31rpx;}
1012 1016
1013 /* 用户评价 */ 1017 /* 用户评价 */
1014 .middle{ 1018 .middle{
1015 -  
1016 width: 95%; 1019 width: 95%;
1017 - height:auto;  
1018 -  
1019 margin:0 auto; 1020 margin:0 auto;
1020 -  
1021 -  
1022 } 1021 }
1023 .middle-img-frame{ 1022 .middle-img-frame{
1024 - height:65rp; 1023 + height:65rpx;
1025 display: flex; 1024 display: flex;
1026 margin-top: 32rpx; 1025 margin-top: 32rpx;
1027 1026
@@ -1051,11 +1050,13 @@ left:31rpx;} @@ -1051,11 +1050,13 @@ left:31rpx;}
1051 text-align: center; 1050 text-align: center;
1052 margin-bottom:20rpx; 1051 margin-bottom:20rpx;
1053 margin-left:5rpx; 1052 margin-left:5rpx;
1054 - 1053 +}
  1054 +.xc-pirces{
  1055 + margin-top: 14rpx;
1055 } 1056 }
1056 /* 评价文字 */ 1057 /* 评价文字 */
1057 .middle-font{ 1058 .middle-font{
1058 - font-size: 24rpx; 1059 + font-size: 30rpx;
1059 1060
1060 } 1061 }
1061 .iddle-goods-img{ 1062 .iddle-goods-img{
@@ -1081,11 +1082,12 @@ left:31rpx;} @@ -1081,11 +1082,12 @@ left:31rpx;}
1081 height: 45rpx; 1082 height: 45rpx;
1082 display:flex; 1083 display:flex;
1083 line-height: 45rpx; 1084 line-height: 45rpx;
  1085 + margin-top: 20rpx;
1084 margin-bottom: 14rpx; 1086 margin-bottom: 14rpx;
1085 justify-content : space-between; 1087 justify-content : space-between;
1086 } 1088 }
1087 .parameter-font{ 1089 .parameter-font{
1088 - font-size: 24rpx; 1090 + font-size: 26rpx;
1089 1091
1090 } 1092 }
1091 /* 规格 */ 1093 /* 规格 */
@@ -1107,13 +1109,13 @@ left:31rpx;} @@ -1107,13 +1109,13 @@ left:31rpx;}
1107 } 1109 }
1108 /* 点赞图片 */ 1110 /* 点赞图片 */
1109 .parameter-img{ 1111 .parameter-img{
1110 - width: 25rpx;  
1111 - height: 25rpx; 1112 + width: 27rpx;
  1113 + height: 27rpx;
1112 margin-top: 3rpx; 1114 margin-top: 3rpx;
1113 } 1115 }
1114 .parameter-val{ 1116 .parameter-val{
1115 margin-left:25rpx; 1117 margin-left:25rpx;
1116 - font-size: 24rpx; 1118 + font-size: 26rpx;
1117 color: #999; 1119 color: #999;
1118 } 1120 }
1119 /* 回复 */ 1121 /* 回复 */
@@ -1186,7 +1188,7 @@ left:31rpx;} @@ -1186,7 +1188,7 @@ left:31rpx;}
1186 width: 524rpx; 1188 width: 524rpx;
1187 margin-left: 34rpx; 1189 margin-left: 34rpx;
1188 border-radius: 25rpx; 1190 border-radius: 25rpx;
1189 - border: 1rpx solid #d6d4d5; 1191 + border: 2rpx solid #d6d4d5;
1190 overflow: hidden; 1192 overflow: hidden;
1191 } 1193 }
1192 1194
@@ -1213,19 +1215,20 @@ left:31rpx;} @@ -1213,19 +1215,20 @@ left:31rpx;}
1213 margin-right: 5rpx 1215 margin-right: 5rpx
1214 } 1216 }
1215 .xc_comment-font{ 1217 .xc_comment-font{
1216 - height: 85rpx; 1218 + height: 75rpx;
1217 margin-left: 22rpx; 1219 margin-left: 22rpx;
1218 white-space:normal; 1220 white-space:normal;
1219 overflow: hidden; 1221 overflow: hidden;
1220 margin-top: 8rpx; 1222 margin-top: 8rpx;
  1223 +
1221 } 1224 }
1222 .xc_comment-val{ 1225 .xc_comment-val{
1223 width: 88%; 1226 width: 88%;
1224 height: 30rpx; 1227 height: 30rpx;
1225 margin-left: 22rpx; 1228 margin-left: 22rpx;
1226 display: flex; 1229 display: flex;
1227 - margin-top: 28rpx;  
1228 - margin-bottom:8rpx; 1230 + margin-top: 15rpx;
  1231 + margin-bottom:15rpx;
1229 } 1232 }
1230 1233
1231 .xc_comment-time{ 1234 .xc_comment-time{
@@ -2237,12 +2240,8 @@ right:17rpx; top:55rpx; @@ -2237,12 +2240,8 @@ right:17rpx; top:55rpx;
2237 .pd_top1{padding-top: 10rpx} 2240 .pd_top1{padding-top: 10rpx}
2238 .s_ms_bth{margin-top: 85rpx} 2241 .s_ms_bth{margin-top: 85rpx}
2239 2242
2240 -.xc-pirces{  
2241 - height:40rpx;  
2242 - line-height:15rpx;  
2243 -}  
2244 2243
2245 -.no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx} 2244 +.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx}
2246 /* 门店地址 */ 2245 /* 门店地址 */
2247 .xc-address_frame{ 2246 .xc-address_frame{
2248 border-top:1rpx solid #eee; 2247 border-top:1rpx solid #eee;
@@ -2308,7 +2307,7 @@ z-index: 20; @@ -2308,7 +2307,7 @@ z-index: 20;
2308 background: white; 2307 background: white;
2309 width: 100%; 2308 width: 100%;
2310 border-radius: 20rpx 20rpx 0 0; 2309 border-radius: 20rpx 20rpx 0 0;
2311 -height: 70%; 2310 +height: 72%;
2312 } 2311 }
2313 .popup-top{ 2312 .popup-top{
2314 border-bottom: 1rpx solid #eee; 2313 border-bottom: 1rpx solid #eee;
@@ -2397,9 +2396,7 @@ line-height: 38rpx; @@ -2397,9 +2396,7 @@ line-height: 38rpx;
2397 .store-bottom{ 2396 .store-bottom{
2398 width: 85%; 2397 width: 85%;
2399 margin: auto; 2398 margin: auto;
2400 - height: 97rpx;  
2401 -  
2402 - 2399 + height: 70rpx;
2403 } 2400 }
2404 .determine{ 2401 .determine{
2405 width: 260rpx; 2402 width: 260rpx;
@@ -2485,6 +2482,7 @@ border-radius: 55rpx; @@ -2485,6 +2482,7 @@ border-radius: 55rpx;
2485 height: 50rpx; 2482 height: 50rpx;
2486 } 2483 }
2487 .butttem5{ 2484 .butttem5{
2488 -margin-bottom: 5rpx; 2485 + margin-bottom: 5rpx;
  2486 +}
2489 2487
2490 -}  
2491 \ No newline at end of file 2488 \ No newline at end of file
  2489 +.s_btn{ margin-top: 25rpx; }
2492 \ No newline at end of file 2490 \ No newline at end of file
pages/user/collect_list/collect_list.wxml
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 98
99 <view class="Number flex-vertical"> 99 <view class="Number flex-vertical">
100 已选 100 已选
101 - <text class="co-red" style="top:2rpx; position:relative">{{sum>0?sum:'0'}}</text> 件 101 + <view class="co-red goods_num">{{sum>0?sum:'0'}}</view> 件
102 </view> 102 </view>
103 </view> 103 </view>
104 <view class="delete fs30 flex-center white {{isdelete==1?'Deleting':''}}" bindtap="alldelete"> 104 <view class="delete fs30 flex-center white {{isdelete==1?'Deleting':''}}" bindtap="alldelete">
pages/user/collect_list/collect_list.wxss
@@ -510,4 +510,11 @@ page { @@ -510,4 +510,11 @@ page {
510 margin-right: 18rpx; 510 margin-right: 18rpx;
511 letter-spacing: 0rpx; 511 letter-spacing: 0rpx;
512 font-size: 32rpx; 512 font-size: 32rpx;
  513 + height: 55rpx;
  514 +
513 } 515 }
  516 +.goods_num{
  517 + height: 55rpx;
  518 +line-height: 55rpx;
  519 +
  520 +}
514 \ No newline at end of file 521 \ No newline at end of file
pages/user/comment/comment.js
@@ -32,113 +32,81 @@ Page({ @@ -32,113 +32,81 @@ Page({
32 currentPage: 1, 32 currentPage: 1,
33 isloaded: 0, 33 isloaded: 0,
34 order_id:0, 34 order_id:0,
  35 + is_no_more:0,
35 }, 36 },
36 onLoad: function(t) { 37 onLoad: function(t) {
37 var e = void 0 === t.status ? this.data.activeStatus : t.status; 38 var e = void 0 === t.status ? this.data.activeStatus : t.status;
38 this.data.order_id=t.order_id; 39 this.data.order_id=t.order_id;
39 40
40 - a.init(this, "", "comments"), this.requestComments(e); 41 + //a.init(this, "", "comments"),
  42 + //this.requestComments(e);
  43 + this.requestComments_new(e);
41 }, 44 },
42 onShow: function() { 45 onShow: function() {
43 wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1), 46 wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1),
44 - this.resetData(), this.requestComments(this.data.activeStatus)); 47 + this.resetData(), this.requestComments_new(this.data.activeStatus));
45 }, 48 },
46 changeTab: function(t) { 49 changeTab: function(t) {
47 var e = this; 50 var e = this;
48 if (this.data.activeStatus == t.currentTarget.dataset.status) 51 if (this.data.activeStatus == t.currentTarget.dataset.status)
49 return false; 52 return false;
50 - this.resetData(), this.requestComments(t.currentTarget.dataset.status); 53 + this.resetData(), this.requestComments_new(t.currentTarget.dataset.status);
51 }, 54 },
52 - requestComments: function(t) {  
53 - var e = this,  
54 - th = e,  
55 - n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage;  
56 - this.setData({  
57 - activeStatus: t  
58 - });  
59 55
60 - if(e.data.order_id) n+="&order_id="+e.data.order_id;  
61 -  
62 - if (t == 2) {  
63 - a.request(n, function(t) {  
64 - e.data.currentPage++;  
65 - var da = th.data.comments;  
66 - da.forEach( function(em, ind) {  
67 -  
68 - getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
69 - data:{ store_id: os.stoid, goods_id: em.goods_id,  
70 - pageSize: 3, parent_id: em.comment_id, page:1}  
71 - }).then(res=>{  
72 - if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0)  
73 - da[ind].replay_list=res.data.data.pageData;  
74 - })  
75 -  
76 - if (em.img != undefined && em.img != null && ut.isString(em.img)) da[ind].img = ut.unserialize(em.img);  
77 - var str = da[ind].weapp_img;  
78 - if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);  
79 -  
80 - })  
81 -  
82 - th.setData({  
83 - comments: da,  
84 - isloaded: 1,  
85 - })  
86 -  
87 -  
88 - }, null, {  
89 - store_id: os.stoid,  
90 - user_id: oo.user_id  
91 - }),  
92 - wx.stopPullDownRefresh();  
93 - } else {  
94 - a.request(n, function(t) {  
95 - e.data.currentPage++;  
96 - var da = th.data.comments;  
97 -  
98 - da.forEach( function(em, ind) {  
99 -  
100 -  
101 - getApp().request.promiseGet("/api/weshop/comment/pageComment", {  
102 - data:{ store_id: os.stoid, goods_id: em.goods_id,  
103 - pageSize: 3, parent_id: em.comment_id, page:1}  
104 - }).then(res=>{  
105 - if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0)  
106 - da[ind].replay_list=res.data.data.pageData;  
107 - })  
108 -  
109 - if (em.img != undefined && em.img != null && ut.isString(em.img))  
110 - da[ind].img = ut.unserialize(em.img);  
111 - var str = da[ind].weapp_img;  
112 - if (str != "" && ut.isString(str)) da[ind].weapp_img = JSON.parse(str);  
113 -  
114 - });  
115 -  
116 - th.setData({  
117 - comments: da,  
118 - isloaded: 1,  
119 - })  
120 -  
121 -  
122 - }, null, {  
123 - is_comment: t,  
124 - store_id: os.stoid,  
125 - user_id: oo.user_id  
126 - }),  
127 - wx.stopPullDownRefresh();  
128 - } 56 + requestComments_new:async function(t){
  57 + var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage;
  58 + this.setData({
  59 + activeStatus: t
  60 + });
  61 + if(e.data.order_id) n+="&order_id="+e.data.order_id;
  62 + var rq_data={store_id: os.stoid, user_id: oo.user_id};
  63 + if (t!= 2) {rq_data['is_comment']=t;}
  64 +
  65 + var rs_data=null,com_data=this.data.comments;
  66 + await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{
  67 + e.data.currentPage++
  68 + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
  69 + rs_data=res.data.data.pageData;
  70 + }else{
  71 + th.setData({ is_no_more: 1, })
  72 + }
  73 + })
  74 +
  75 + if(rs_data){
  76 + for(var ind in rs_data ){
  77 + var em=rs_data[ind]
  78 + await getApp().request.promiseGet("/api/weshop/comment/pageComment", {
  79 + data:{ store_id: os.stoid, goods_id: em.goods_id,
  80 + pageSize: 3, parent_id: em.comment_id, page:1}
  81 + }).then(res=>{
  82 + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0)
  83 + rs_data[ind].replay_list=res.data.data.pageData;
  84 + })
  85 + if (em.img != undefined && em.img != null && ut.isString(em.img)) rs_data[ind].img = ut.unserialize(em.img);
  86 + var str = em.weapp_img;
  87 + if (str != "" && ut.isString(str)) rs_data[ind].weapp_img = JSON.parse(str);
  88 + rs_data[ind].original_img=this.data.iurl+rs_data[ind].original_img;
  89 +
  90 + }
  91 +
  92 + if(!com_data) com_data=rs_data;
  93 + else com_data= com_data.concat(rs_data);
  94 + th.setData({ comments: com_data, isloaded: 1, })
  95 + }
  96 + },
129 97
130 - },  
131 onReachBottom: function() { 98 onReachBottom: function() {
132 - if(a.data.goodsLoadFinishFlag) return false;  
133 - a.canloadMore() && this.requestComments(this.data.activeStatus); 99 + if(this.data.is_no_more) return false;
  100 + //a.canloadMore() && this.requestComments(this.data.activeStatus);
  101 + this.requestComments_new(this.data.activeStatus);
134 }, 102 },
135 103
136 104
137 onPullDownRefresh: function(t) { 105 onPullDownRefresh: function(t) {
138 - this.resetData(), this.requestComments(this.data.activeStatus); 106 + this.resetData(), this.requestComments_new(this.data.activeStatus);
139 }, 107 },
140 resetData: function() { 108 resetData: function() {
141 - this.data.comments = null, this.data.currentPage = 1, a.resetConfig(); 109 + this.data.comments = null, this.data.currentPage = 1, this.data.is_no_more=0, a.resetConfig();
142 }, 110 },
143 /*-----评论-----*/ 111 /*-----评论-----*/
144 comment: function(t) { 112 comment: function(t) {
pages/user/comment/comment.wxml
@@ -19,8 +19,8 @@ @@ -19,8 +19,8 @@
19 </view> 19 </view>
20 </view> 20 </view>
21 21
22 - <!-- 待评价栏 -->  
23 - <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> 22 + <!-- 待评价栏 -->
  23 + <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}">
24 24
25 <!-- 商品编号和状态 --> 25 <!-- 商品编号和状态 -->
26 <view class="Commodity_number flex-vertical-between fs26 padding border_bottom"> 26 <view class="Commodity_number flex-vertical-between fs26 padding border_bottom">
@@ -110,13 +110,10 @@ @@ -110,13 +110,10 @@
110 <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="item.comment_id>0?'/pages/user/add_comment/add_comment':'' "> 110 <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="item.comment_id>0?'/pages/user/add_comment/add_comment':'' ">
111 <view class="fs24">去评价</view> 111 <view class="fs24">去评价</view>
112 </navigator> 112 </navigator>
113 -  
114 </view> 113 </view>
115 -  
116 </view> 114 </view>
117 -  
118 -  
119 </view> 115 </view>
120 116
  117 + <view class="get_bottom fs26" wx:if="{{comments.length>0 && is_no_more}}">已经加载到底部</view>
121 118
122 </view> 119 </view>
123 \ No newline at end of file 120 \ No newline at end of file
pages/user/comment/comment.wxss
@@ -185,4 +185,5 @@ @@ -185,4 +185,5 @@
185 } 185 }
186 .title_width{ width: 146rpx; text-align:center } 186 .title_width{ width: 146rpx; text-align:center }
187 .shop-font{ color: rgb(153, 153, 153);} 187 .shop-font{ color: rgb(153, 153, 153);}
188 -.reply{ margin-top: 10rpx}  
189 \ No newline at end of file 188 \ No newline at end of file
  189 +.reply{ margin-top: 10rpx}
  190 +.get_bottom{ text-align: center; color: #999; margin-bottom: 20rpx}
190 \ No newline at end of file 191 \ No newline at end of file
utils/LoadMore.js
@@ -76,32 +76,33 @@ var e = function() { @@ -76,32 +76,33 @@ var e = function() {
76 76
77 //格式化 77 //格式化
78 var glist=""; 78 var glist="";
79 - for (var i = 0; i < g.length; i++) { 79 +
  80 + for (var ii = 0; ii < g.length; ii++) {
80 //if(g[i].prom_type == 1 || g[i].prom_type == 2 || g[i].prom_type == 6) { 81 //if(g[i].prom_type == 1 || g[i].prom_type == 2 || g[i].prom_type == 6) {
81 - if (g[i].prom_type == 1) {  
82 - glist += g[i].goods_id+","; 82 + if (g[ii].prom_type == 1) {
  83 + glist += g[ii].goods_id+",";
83 } 84 }
84 - if (g[i].original_img!=undefined){  
85 - if (g[i].original_img.indexOf(oo.imghost)==-1)  
86 - g[i].original_img = oo.imghost + g[i].original_img; 85 + if (g[ii].original_img!=undefined){
  86 + if (g[ii].original_img.indexOf(oo.imghost)==-1)
  87 + g[ii].original_img = oo.imghost + g[ii].original_img;
87 } 88 }
88 89
89 - if (g[i].add_time != undefined){  
90 - var tx = g[i].add_time + ""; 90 + if (g[ii].add_time != undefined){
  91 + var tx = g[ii].add_time + "";
91 if (tx.indexOf('-') == -1) { 92 if (tx.indexOf('-') == -1) {
92 - g[i].add_time = ut.formatTime(g[i].add_time, 'yyyy-MM-dd hh:mm:ss'); 93 + g[ii].add_time = ut.formatTime(g[ii].add_time, 'yyyy-MM-dd hh:mm:ss');
93 } 94 }
94 } 95 }
95 if (rurl.indexOf('comment/page')!=-1){ 96 if (rurl.indexOf('comment/page')!=-1){
96 console.log('comment/page'); 97 console.log('comment/page');
97 - console.log(g[i].img);  
98 - var tx1 = g[i].img; 98 + console.log(g[ii].img);
  99 + var tx1 = g[ii].img;
99 100
100 if (tx1 != "" && tx1 != null && ut.isString(tx1)){ 101 if (tx1 != "" && tx1 != null && ut.isString(tx1)){
101 var arr = ut.unserialize(tx1); 102 var arr = ut.unserialize(tx1);
102 - g[i].img=arr; 103 + g[ii].img=arr;
103 } else if (!ut.isArray(tx1)){ 104 } else if (!ut.isArray(tx1)){
104 - g[i].img=""; 105 + g[ii].img="";
105 } 106 }
106 } 107 }
107 } 108 }