Commit 3a5fc5ba0f100adda5983a1262e32cd8d54826ea

Authored by 后端研发-苏明海
2 parents e95b6b4d 3b3e94a8

Merge branch 'dev' into 'test'

Dev

See merge request !951
Showing 65 changed files with 6844 additions and 2006 deletions
app.json
... ... @@ -91,44 +91,45 @@
91 91 "pages/quan_pro/quan_pro",
92 92 "pages/liveStream/liveStream",
93 93 "pages/liveStreamDetails/liveStreamDetails",
94   - "pages/addCustomer/addCustomer",
95   - "pages/goods_share/goods_share",
96   - "pages/activity_share/activity_share",
97   - "pages/live_share/live_share",
98   - "pages/quan/quan",
99   - "pages/chongzhi/chongzhi",
100   - "pages/chongzhiDetails/chongzhiDetails",
101   - "pages/jfbuy/jfbuy",
102   - "pages/hongBao/hongBao",
103   - "pages/hongBaoDetails/hongBaoDetails",
104   - "pages/service_record/service_record",
105   - "pages/checkin/checkin",
106   - "pages/distribution/myteam/myteam",
107   - "pages/distribution/order/order",
108   - "pages/distribution/commision/commision",
109   - "pages/distribution/rank/rank",
110   - "pages/distribution/card/card",
111   - "pages/distribution/goods/goods",
112   - "pages/distribution/shop/shop",
113   - "pages/distribution/rookie/rookie",
114   - "pages/service_share/service_share",
115   - "pages/cardList/cardList",
116   - "pages/goodsInfo/goodsInfo",
117   - "pages/my_service/appment_main",
118   - "pages/my_service/i_service",
119   - "pages/my_service/cosmetology_list",
120   - "pages/my_service/hist_service",
121   - "pages/my_service/tment_details",
122   - "pages/my_service/tment_eval",
123   - "pages/my_service/tment_order_list",
124   - "pages/my_service/beauty_deta",
125   - "pages/my_service2/appment_main",
126   - "pages/profile/profile",
127   - "pages/parseHtml/parseHtml",
128   - "pages/myGift/myGift",
129   - "pages/myGiftDetails/myGiftDetails",
130   - "pages/cart2_ser/cart2_ser",
131   - "pages/libao_payment/payment"
  94 + "pages/addCustomer/addCustomer",
  95 + "pages/goods_share/goods_share",
  96 + "pages/activity_share/activity_share",
  97 + "pages/live_share/live_share",
  98 + "pages/quan/quan",
  99 + "pages/chongzhi/chongzhi",
  100 + "pages/chongzhiDetails/chongzhiDetails",
  101 + "pages/jfbuy/jfbuy",
  102 + "pages/hongBao/hongBao",
  103 + "pages/hongBaoDetails/hongBaoDetails",
  104 + "pages/service_record/service_record",
  105 + "pages/checkin/checkin",
  106 + "pages/distribution/myteam/myteam",
  107 + "pages/distribution/order/order",
  108 + "pages/distribution/commision/commision",
  109 + "pages/distribution/rank/rank",
  110 + "pages/distribution/card/card",
  111 + "pages/distribution/goods/goods",
  112 + "pages/distribution/shop/shop",
  113 + "pages/distribution/rookie/rookie",
  114 + "pages/service_share/service_share",
  115 + "pages/cardList/cardList",
  116 + "pages/goodsInfo/goodsInfo",
  117 + "pages/my_service/appment_main",
  118 + "pages/my_service/i_service",
  119 + "pages/my_service/cosmetology_list",
  120 + "pages/my_service/hist_service",
  121 + "pages/my_service/tment_details",
  122 + "pages/my_service/tment_eval",
  123 + "pages/my_service/tment_order_list",
  124 + "pages/my_service/beauty_deta",
  125 + "pages/my_service2/appment_main",
  126 + "pages/profile/profile",
  127 + "pages/parseHtml/parseHtml",
  128 + "pages/myGift/myGift",
  129 + "pages/myGiftDetails/myGiftDetails",
  130 + "pages/cart2_ser/cart2_ser",
  131 + "pages/libao_payment/payment",
  132 + "pages/details_serviceCard/details_serviceCard"
132 133 ]
133 134  
134 135 },
... ... @@ -151,7 +152,9 @@
151 152 "pages/zuhegou/list/list",
152 153 "pages/user/binding_info/binding_info",
153 154 "pages/user/choice_guide/choice_guide",
154   - "pages/video/index"
  155 + "pages/video/index",
  156 + "pages/boxes-list/boxes-list",
  157 + "pages/boxes-details/boxes-details"
155 158 ]
156 159 },
157 160 {
... ...
app.wxss
... ... @@ -135,6 +135,7 @@
135 135 box-sizing: border-box;
136 136 }
137 137  
  138 +
138 139 .c-green {
139 140 color: #7CFC00;
140 141 }
... ... @@ -159,6 +160,14 @@
159 160 color: #c7c7c7;
160 161 }
161 162  
  163 +.c-6 {
  164 + color: #666;
  165 +}
  166 +
  167 +.c-9 {
  168 + color: #999;
  169 +}
  170 +
162 171  
163 172  
164 173 .c-d {
... ... @@ -232,6 +241,11 @@
232 241 margin-top: 30rpx;
233 242 }
234 243  
  244 +.mgt40 {
  245 + margin-top: 40rpx;
  246 +}
  247 +
  248 +
235 249 .h68 {
236 250 height: 68rpx;
237 251 }
... ... @@ -729,9 +743,9 @@ background: #ffe3e2;
729 743 /* 图标字体(ty) */
730 744 @font-face {
731 745 font-family: 'iconfont'; /* Project id 2054717 */
732   - src: url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff2?t=1635844276600') format('woff2'),
733   - url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff?t=1635844276600') format('woff'),
734   - url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.ttf?t=1635844276600') format('truetype');
  746 + src: url('//at.alicdn.com/t/font_2054717_y42sikta7lc.woff2?t=1642407649188') format('woff2'),
  747 + url('//at.alicdn.com/t/font_2054717_y42sikta7lc.woff?t=1642407649188') format('woff'),
  748 + url('//at.alicdn.com/t/font_2054717_y42sikta7lc.ttf?t=1642407649188') format('truetype');
735 749 }
736 750  
737 751 .iconfont {
... ... @@ -742,6 +756,18 @@ background: #ffe3e2;
742 756 -moz-osx-font-smoothing: grayscale;
743 757 }
744 758  
  759 +.icon-shangpin:before {
  760 + content: "\e661";
  761 +}
  762 +
  763 +.icon-bankcard:before {
  764 + content: "\e693";
  765 +}
  766 +
  767 +.icon-tongbu:before {
  768 + content: "\e6ca";
  769 +}
  770 +
745 771 .icon-luck:before {
746 772 content: "\e621";
747 773 }
... ...
components/diy_serviceCard/diy_serviceCard.js
1 1 var t = getApp(),
2   - a = t.request,
3   - o = t.globalData.setting,
4   - os = o,
5   - i = require("../../utils/util.js"),
6   - ut = i,
7   - s = require("../../utils/common.js");
  2 + a = t.request,
  3 + o = t.globalData.setting,
  4 + os = o,
  5 + i = require("../../utils/util.js"),
  6 + ut = i,
  7 + s = require("../../utils/common.js");
8 8 var regeneratorRuntime = require('../../utils/runtime.js');
9 9  
10 10 Component({
11 11 options: {
12 12 addGlobalClass: true,
13 13 },
14   - properties: {
15   - // 这里定义了innerText属性,属性值可以在组件使用时指定
16   - object: {
17   - type: Object,
18   - value: null,
19   - },
20   -
21   - },
22   - data: {
23   - // 这里是一些组件内部数据
24   - group: false,
25   - imghost: o.imghost,
26   - is_recommend: 0,
27   - is_hot: 0,
28   - is_new: 0,
29   - baseUrl: "/api/weshop/goods/page",
30   - resourceUrl: t.globalData.setting.resourceUrl,
31   - url: t.globalData.setting.imghost,
32   - currentPage: 1,
33   - requestData: null,
34   - requestUrl: "",
35   - goods_array: null,
36   - total: null,
37   - prom_id: 0,
38   - classstyle_id: null,
39   - g_id: null,
40   - wgroup: null,
41   - goods_btn: null,
42   - loadText: '加载更多',
43   - someData: {},
44   - goodscount: null,
45   - firist_type_data: null,
46   - firist_type_curr: 0,
47   - is_nav:0,
48   - nav_list:null,
49   - title_index:0,
50   - swiper_hei:0,
51   - title_class:"",
52   - },
53   -
54   - ready: function () {},
55   -
56   - lifetimes: {
57   - attached: function() {
58   -
59   -
60   - //要兼容性的写法,因为有些商家都还未更新商品分组的最新的效果~~3.0公众号的html页面所以不用兼容写法
61   - var nav_item=this.data.object;
62   - var nav_list= this.data.object.nav_list;
63   -
64   - if(parseInt(nav_item.is_automore)){
65   - if(!getApp().globalData.func_list) getApp().globalData.func_list=[];
66   - getApp().globalData.func_list.push(this);
67   - }
68   -
69   -
70   - //最新的版本才有nav_list
71   - if(nav_list){
72   - nav_item=nav_list[0];
73   - //要算一下商品goodsid
74   - for(var ij in nav_list){
75   - var item=nav_list[ij];
76   - var idlist="";
77   - //如果商品有手动选择的时候
78   - if(item.data && item.data.length>0){
79   - for(var im in item.data){
80   - idlist+= item.data[im]+",";
81   - }
82   - }
83   - if(idlist) idlist=ut.sub_last(idlist);
84   - nav_list[ij].idlist=idlist;
85   - }
86   - this.setData({nav_list:nav_list,is_nav:parseInt(this.data.object.is_nav)});
87   - }
88   -
89   - // 在组件实例进入页面节点树时执行
90   - if(nav_item) {
91   - this.data.classstyle_id = nav_item.classstyle;
92   - this.data.wgroup =nav_item.wgroup;
93   - }
94   -
95   - this.data.goodscount = this.data.object.goodscount;
96   -
97   -
98   - var hei=280;
99   - if(this.data.object.goodstit) hei+=80;
100   - if(this.data.object.goodsprice) hei+=80;
101   - if(this.data.object.goodsnum) hei+=80;
102   -
103   - if(this.data.object.title_color){
104   - this.data.title_class=`color:${this.data.object.title_color};`
105   - }
  14 + properties: {
  15 + // 这里定义了innerText属性,属性值可以在组件使用时指定
  16 + object: {
  17 + type: Object,
  18 + value: null,
  19 + },
106 20  
107   - if(this.data.object.title_font_size){
108   - this.data.title_class=this.data.title_class.concat(`font-size:${this.data.object.title_font_size}px;`)
109   - }
110   - this.setData({
111   - swiper_hei:hei,
112   - title_class:this.data.title_class,
113   - });
114   -
115   - if (nav_item && nav_item.goodsclass == 1) {
116   - this.data.is_recommend = 1
117   - }
118   - if (nav_item && nav_item.goodsclass == 2) {
119   - this.data.is_hot = 1
120   - }
121   - if (nav_item && nav_item.goodsclass == 3) {
122   - this.data.is_new = 1
123   - }
124   -
125   - this.data.requestData = new Array();
126   - this.data.g_id = nav_item.data;
127   - var arr = [];
128   -
129   - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
130   - arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
131   - }
132   - this.data.firist_type_data = arr;
133   - this.init(this.data.classstyle_id, this.data.wgroup);
134   - },
135   - detached: function() {
136   - // 在组件实例被从页面节点树移除时执行
137   - },
138   - },
139   -
140   - pageLifetimes: {
141   - //游客登录后,只要更新卡的情况
142   - show: function () {
143   - //--初始化卡类--
144   - this.card_init();
145   - },
146   - },
147   -
148   - methods: {
149   - // 这里是一个自定义方法
150   - init:async function (classstyle_id, wgroup) {
151   -
152   - this.setData({classstyle_id:classstyle_id})
153   -
154   - var th = this;
155   - var g_id = this.data.g_id;
156   - var len=this.data.firist_type_data.length;
157   - if (classstyle_id == 1) {
158   - //---手动选择的时候---
159   - g_id = this.data.firist_type_data[th.data.firist_type_curr];
160   - th.data.firist_type_curr++;
161   - }
162   -
163   - var th = this,
164   - app = getApp(),
165   - index = 0,
166   - gdata = [];
167   -
168   - var user_id=getApp().globalData.user_id;
169   - if(!user_id) user_id=0;
170   -
171   - //--初始化卡类--
172   - th.card_init();
173   - var os=getApp().globalData.setting;
174   - classstyle_id = classstyle_id + "";
175   - switch (classstyle_id) {
176   - //---手动选择商品---
177   - case "1":
178   - var str="";
179   - for (var i = 0; i < g_id.length; i++) {
180   - str += g_id[i].goodsid + ",";
181   - }
182   - str=str.substring(0, str.length - 1);
183   -
184   - await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, {
185   - data:{user_id:user_id},
186   - isShowLoading:false,
187   - success: function(res) {
188   - th.data.loading=0;
189   -
190   - if(res.data.code==0 && res.data.data){
191   -
192   - var goods = res.data.data;
193   - /*--
194   - var rData = th.data.requestData;
195   - if (rData == null) rData=[];
196   - var now=ut.gettimestamp();
197   -
198   - var new_arr=[];
199   - for (var ii in res.data.data){
200   - var item=res.data.data[ii];
201   - item.goods_img=th.data.imghost + item.original_img;
202   - if(item.e_time<now) {item.prom_type=0; item.prom_price=0;}
203   - if(item.warm_uptime>now) {item.prom_type=0; item.prom_price=0;}
204   - new_arr.push(item);
205   - }
206   - rData = rData.concat(new_arr);
207   -
208   - th.data.requestData = rData;
209   -
210   - if(th.data.object.column==5){
211   - var arr = new Array();
212   - //--三个三个一组---
213   - for(var i=0;i< rData.length;i+=3){
214   - arr.push(rData.slice(i,i+3));
215   - }
216   - th.setData({ goods_array: arr });
217   - }else{
218   - th.setData({ goods_array: rData });
219   - }--*/
220   -
221   - th.set_good(goods);
222   -
223   - //---控制有没有加载更多的按钮---
224   - if (th.data.firist_type_curr >= len) {th.setData({ goods_btn: [] }); }
225   - else th.setData({ goods_btn: [1,2]});
  21 + },
  22 + data: {
  23 + // 这里是一些组件内部数据
  24 + group: false,
  25 + imghost: o.imghost,
  26 + is_recommend: 0,
  27 + is_hot: 0,
  28 + is_new: 0,
  29 + baseUrl: "/api/weshop/goods/page",
  30 + resourceUrl: t.globalData.setting.resourceUrl,
  31 + url: t.globalData.setting.imghost,
  32 + currentPage: 1,
  33 + requestData: null,
  34 + requestUrl: "",
  35 + goods_array: null,
  36 + total: null,
  37 + prom_id: 0,
  38 + classstyle_id: null,
  39 + g_id: null,
  40 + wgroup: null,
  41 + goods_btn: null,
  42 + loadText: '加载更多',
  43 + someData: {},
  44 + goodscount: null,
  45 + firist_type_data: null,
  46 + firist_type_curr: 0,
  47 + is_nav: 0,
  48 + nav_list: null,
  49 + title_index: 0,
  50 + swiper_hei: 0,
  51 + title_class: "",
  52 + },
  53 +
  54 + ready: function() {},
  55 +
  56 + lifetimes: {
  57 + attached: function() {
  58 + let myStyle = '';
  59 + //要兼容性的写法,因为有些商家都还未更新商品分组的最新的效果~~3.0公众号的html页面所以不用兼容写法
  60 + var nav_item = this.data.object;
  61 + var nav_list = this.data.object.nav_list;
  62 +
  63 + if (parseInt(nav_item.is_automore)) {
  64 + if (!getApp().globalData.func_list) getApp().globalData.func_list = [];
  65 + getApp().globalData.func_list.push(this);
  66 + }
  67 +
  68 +
  69 + //最新的版本才有nav_list
  70 + if (nav_list) {
  71 + nav_item = nav_list[0];
  72 + //要算一下商品goodsid
  73 + for (var ij in nav_list) {
  74 + var item = nav_list[ij];
  75 + var idlist = "";
  76 + //如果商品有手动选择的时候
  77 + if (item.data && item.data.length > 0) {
  78 + for (var im in item.data) {
  79 + idlist += item.data[im] + ",";
  80 + }
226 81 }
  82 + if (idlist) idlist = ut.sub_last(idlist);
  83 + nav_list[ij].idlist = idlist;
227 84 }
228   -
229   - })
230   -
231   - break;
232   - case "2":
233   - var item = {};
234   - var r_data={
235   - store_id: os.stoid ,
236   - pageSize: th.data.goodscount,
237   - page: th.data.currentPage,
238   - isonsale: 1,
239   - orderField: "sort",
240   - orderType: 'asc',
241   - };
242   - if(th.data.is_recommend) r_data.is_recommend=th.data.is_recommend;
243   - if(th.data.is_hot) r_data.is_hot=th.data.is_hot;
244   - if(th.data.is_new) r_data.is_new=th.data.is_new;
245   -
246   - var user_id=getApp().globalData.user_id;
247   - if(!user_id) user_id=0;
248   - r_data.user_id=user_id;
249   -
250   - await app.request.promiseGet("/api/weshop/goods/page", {
251   - data:r_data
252   - }).then(res => {
253   - th.data.loading=0;
254   - //商品地址
255   - var goods = res.data.data.pageData;
256   - th.setData({
257   - goods_btn: res.data.data.pageData,
258   - total: res.data.data.total
259   - })
260   - th.data.currentPage++;
261   - //设置商品熏染
262   - th.set_good(goods);
263   -
264   - })
265   - break;
266   - case "3":
267   - var item = {};
268   - await app.request.promiseGet("/api/weshop/goodsGroup/pageGoodsList", {
269   - data: {
270   - store_id:os.stoid ,
271   - gpid: wgroup,
272   - pageSize: th.data.goodscount,
273   - page: th.data.currentPage,
274   - isonsale: 1,
275   - orderField: "sort",
276   - orderType: 'asc',
277   - user_id:user_id
278   - }
279   - }).then(res => {
280   - th.data.loading=0;
281   - //商品地址
282   - var goods = res.data.data.pageData;
283   - th.setData({
284   - goods_btn: res.data.data.pageData, total: res.data.data.total
285   - })
286   -
287   - th.data.currentPage++;
288   - //设置商品熏染
289   - th.set_good(goods);
290   -
291   - })
292   - break;
293   - }
294   - },
295   -
296   - setLoading: function () {
297   - var that = this;
298   - if(this.data.loading) return false;
299   - this.data.loading=1;
300   - that.init(that.data.classstyle_id, that.data.wgroup);
301   - },
302   -
303   - //图片失败,默认图片
304   - bind_bnerr3: function (e) {
305   - var _errImg = e.target.dataset.errorimg;
306   - var _errObj = {};
307   - _errObj[_errImg] = this.data.imghost + "/public/images/default_goods_image_240.gif";
308   - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
309   - },
310   -
311   - //---卡的初始化----
312   - card_init: function() {
313   - var th = this,os=getApp().globalData.setting;
314   - if(!getApp().globalData.user_id) return false;
315   - getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
316   - isShowLoading:false,
317   - success: function(e) {
318   - getApp().globalData.userInfo = e.data.data;
319   - getApp().getConfig2(function(e) {
320   - var swithc_list = e.switch_list;
321   - var sw_arr = JSON.parse(swithc_list);
322   - //---如果后台又开等级卡的开关---
323   - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
324   - th.setData({
325   - rank_switch: true
326   - });
327   - //---回调卡的列表---
328   - th.getPlusCardType(function(ob) {
329   - th.setData({
330   - card_list: ob.card_list
331   - });
332   - var ti = setInterval(function() {
333   - var user = getApp().globalData.userInfo;
334   - if (!user) return false;
335   - clearInterval(ti);
336   -
337   - if (user.card_field && user['card_expiredate']) {
338   - var str = user['card_expiredate'].replace(/-/g, '/');
339   - var end = new Date(str);
340   - end = Date.parse(end) / 1000;
341   - var now = ut.gettimestamp();
342   -
343   - //--- 判断是等级会员,且在有效期范围内 ---
344   - if (user.card_field && now < end) {
345   - var card_name = ob.name_map.get(user.card_field);
346   - if (card_name.length > 4) card_name = card_name.substring(0, 4);
347   - th.setData({
348   - card_field: user.card_field,
349   - card_name: card_name,
350   - card_list: ob.card_list
351   - });
352   - }
353   -
354   - }
355   -
356   - }, 500)
357   - })
358   -
359   - }
360   - })
361   - }
362   - })
363   -
364   - },
365   -
366   - //--- 获取卡类列表 ---
367   - getPlusCardType: function(func) {
368   - var storid = o.stoid;
369   - var th = this;
370   - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
371   - var plusCard = res.data.data;
372   - var arr = [1219, 2089, 3031];
373   - var new_arr = new Array();
374   - var card_name_map = new Map();
375   -
376   - var user = getApp().globalData.userInfo;
377   -
378   - if(plusCard) {
379   -
380   - for (var i = 0; i < plusCard.length; i++) {
381   - if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
382   - continue;
383   - }
384   -
385   - var name = "card" + plusCard[i].CorrPrice.toLowerCase();
386   - card_name_map.set(name, plusCard[i].CardName);
387   - new_arr.push(plusCard[i]);
  85 + this.setData({
  86 + nav_list: nav_list,
  87 + is_nav: parseInt(this.data.object.is_nav)
  88 + });
  89 + }
  90 +
  91 + // 在组件实例进入页面节点树时执行
  92 + if (nav_item) {
  93 + this.data.classstyle_id = nav_item.classstyle;
  94 + this.data.wgroup = nav_item.wgroup;
  95 + }
  96 +
  97 + this.data.goodscount = this.data.object.goodscount;
  98 +
  99 +
  100 + var hei = 280;
  101 + if (this.data.object.goodstit) hei += 80;
  102 + if (this.data.object.goodsprice) hei += 80;
  103 + if (this.data.object.goodsnum) hei += 80;
  104 +
  105 + if (this.data.object.title_color) {
  106 + // this.data.title_class = `color:${this.data.object.title_color};`
  107 + }
  108 +
  109 + if (this.data.object.font_size) {
  110 + this.data.title_class = this.data.title_class.concat(`font-size:${this.data.object.font_size}px;`);
  111 + }
  112 +
  113 + if (this.data.object.font_color) {
  114 + this.data.title_class = this.data.title_class.concat(`color:${this.data.object.font_color};`);
  115 + }
  116 +
  117 + if (this.data.object.acitve_font_color) {
  118 + this.setData({
  119 + myStyle: `
  120 + --border-color:${this.data.object.acitve_font_color};
  121 + --font-color:${this.data.object.acitve_font_color};
  122 + `,
  123 + });
  124 + }
  125 +
  126 + if (this.data.object.list_border_type == 0) {
  127 + this.data.title_class = this.data.title_class.concat('border-radius: 80rpx;');
  128 + }
  129 +
  130 + if (this.data.object.list_border_type == 1) {
  131 + this.data.title_class = this.data.title_class.concat('border-radius: 0;');
  132 + }
  133 +
  134 + if (this.data.object.list_border_type == 2) {
  135 + this.data.title_class = this.data.title_class.concat('border-width: 0;');
  136 + }
  137 +
  138 +
  139 +
  140 + this.setData({
  141 + swiper_hei: hei,
  142 + title_class: this.data.title_class,
  143 + });
  144 +
  145 + if (nav_item && nav_item.goodsclass == 1) {
  146 + this.data.is_recommend = 1
  147 + }
  148 + if (nav_item && nav_item.goodsclass == 2) {
  149 + this.data.is_hot = 1
  150 + }
  151 + if (nav_item && nav_item.goodsclass == 3) {
  152 + this.data.is_new = 1
388 153 }
389   - }
390   -
391   - var ob = {
392   - "card_list": new_arr,
393   - "name_map": card_name_map
394   - };
395   - func(ob);
396   - })
  154 +
  155 + this.data.requestData = new Array();
  156 + this.data.g_id = nav_item.data;
  157 + var arr = [];
  158 +
  159 + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
  160 + arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
  161 + }
  162 + this.data.firist_type_data = arr;
  163 + this.init(this.data.classstyle_id, this.data.wgroup);
  164 + },
  165 + detached: function() {
  166 + // 在组件实例被从页面节点树移除时执行
  167 + },
397 168 },
398   -
399   - //--- 点击tab的事件 ---
400   - gr_set_nav:function(e){
401   -
402   - var title_idx=e.currentTarget.dataset.index;
403   - if(title_idx==this.data.title_index) return false;
404   - wx.showLoading();
405   -
406   - var nav_item=this.data.object.nav_list[title_idx];
407   - this.data.g_id =[];
408   - if(this.data.object.nav_list && this.data.object.nav_list[title_idx] && this.data.object.nav_list[title_idx].data)
409   - this.data.g_id=this.data.object.nav_list[title_idx].data;
410   - var arr = [];
411   - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
412   - arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
413   - }
414   - this.data.firist_type_data = arr;
415   - this.data.firist_type_curr=0;
416   - this.data.requestData=[];
417   -
418   - // 在组件实例进入页面节点树时执行
419   - if(nav_item){
420   - this.data.classstyle_id = nav_item.classstyle;
421   - this.data.wgroup =nav_item.wgroup;
422   - }
423   -
424   -
425   - this.data.is_recommend = this.data.is_hot=this.data.is_new=0;
426   - //推荐,热卖,新品
427   - if (nav_item && nav_item.goodsclass == 1) {
428   - this.data.is_recommend = 1
429   - }
430   - if (nav_item && nav_item.goodsclass == 2) {
431   - this.data.is_hot = 1
432   - }
433   - if (nav_item && nav_item.goodsclass == 3) {
434   - this.data.is_new = 1
435   - }
436   -
437   -
438   - this.data.currentPage=1;
439   - this.setData({goods_array:null,total:null,title_index:title_idx});
440   - //初始化
441   - this.init(this.data.classstyle_id, this.data.wgroup);
442   - setTimeout(function(){ wx.hideLoading();},1000)
  169 +
  170 + pageLifetimes: {
  171 + //游客登录后,只要更新卡的情况
  172 + show: function() {
  173 + //--初始化卡类--
  174 + // this.card_init();
  175 + },
443 176 },
444 177  
445   - //--- 设置 ---
446   - set_good:async function(goods){
447   - var now=ut.gettimestamp();
448   - var th=this;
449   - if(!goods || goods.length==0) return false;
450   - var user_id=getApp().globalData.userInfo.user_id;
451   - if(!user_id) user_id=0;
452   - for(var i in goods){
453   - var val=goods[i];
454   - var item = {};
455   - var prom_id = null;
456   - //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => {
457   -
458   - var url="/api/weshop/activitylist/getGoodActInfo";
459   - var req_data={
460   - store_id:os.stoid,goodsidlist:val.goods_id,is_detail:1,user_id:user_id
461   - };
462   -
463   - //获取商品的实际活动
464   - await getApp().request.promiseGet(url, {data:req_data}).then(res=>{
465   - if(res.data.code==0 && res.data.data && res.data.data.length==1){
466   - item.prom_type=res.data.data[0].prom_type;
467   - item.prom_id=res.data.data[0].act_id;
468   - }
469   - })
470   -
471   - item.goods_name = val.goods_name;
472   - item.goods_img = th.data.imghost + val.original_img;
473   - item.market_price = val.market_price;
474   - item.shop_price = val.shop_price;
475   - item.sales_sum = val.sales_sum;
476   - item.goods_id = val.goods_id;
477   -
478   - item.cardprice1 = val.cardprice1;
479   - item.cardprice2 = val.cardprice2;
480   - item.cardprice3 = val.cardprice3;
481   - item.prom_type = val.prom_type;
482   - item.prom_id = val.prom_id;
483   -
484   - if(val.prom_price) item.prom_price = val.prom_price;
485   - if(val.prom_integral) item.prom_integral = val.prom_integral;
486   -
487   - prom_id = val.prom_id;
488   -
489   - var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
490   -
491   - var url = "";
492   -
493   - switch (prom_type){
494   - case 1:
495   - var user_id=getApp().globalData.user_id;
496   - if(!user_id) user_id=0;
497   - url = "/api/ms/flash_sale/getNew/" +os.stoid + "/" +user_id+"/"+ prom_id;
498   - break;
499   - case 2:
500   - url ="/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +val.goods_id+"/"+ prom_id
501   - break;
502   - case 4:
503   - url ="/api/weshop/integralbuy/get/"+os.stoid +"/"+prom_id;
504   - break;
505   - case 6:
506   - url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id;
507   - break;
508   - case 8:
509   - var presell_id = prom_id;
510   - var url1 = "/api/weshop/marketing/marketingPresellList/list";
511   - var rd= {
512   - store_id: os.stoid,
513   - presell_id: presell_id,
514   - goods_id: val.goods_id
515   - }
516   - //------获取预售从表----------
517   - await getApp().request.promiseGet(url1, {
518   - data: rd
519   - }).then(res => {
520   - if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
521   - var arr = res.data.data[0];
522   - item.prom_price = arr.luck_goods_price;
523   - item.sales_sum=arr.buy_goodnum+(arr.virtual_qty?arr.virtual_qty:0);
524   - }
525   - })
526   - break;
527   - default:
528   - break
529   - }
530   -
531   - if(url!=null && url!=''){
532   - await getApp().request.promiseGet(url, {}).then(res => {
533   - var prom =null;
534   - if(res && res.data) prom=res.data.data;
535   - if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time<now || (prom.show_time && prom.show_time<now)) ) {
536   - item.prom_price = res.data.data.price;
537   - if(res.data.data.user_price) item.prom_price=res.data.data.user_price;
538   - var vNum=res.data.data.virtual_num?res.data.data.virtual_num:0;
539   - var vNum1=res.data.data.virtualNum?res.data.data.virtualNum:0;
540   - var vNum2=res.data.data.virtual?res.data.data.virtual:0;
541   - item.sales_sum=res.data.data.buy_num+(vNum+vNum1+vNum2);
542   - }else{
543   - item.prom_type=0;
544   - item.prom_id=0;
545   - item.prom_price=null;
546   - }
  178 + methods: {
  179 + // 这里是一个自定义方法
  180 + init: async function(classstyle_id, wgroup) {
  181 +
  182 + this.setData({
  183 + classstyle_id: classstyle_id
  184 + })
  185 +
  186 + var th = this;
  187 + var g_id = this.data.g_id;
  188 + var len = this.data.firist_type_data.length;
  189 + if (classstyle_id == 1) {
  190 + //---手动选择的时候---
  191 + g_id = this.data.firist_type_data[th.data.firist_type_curr];
  192 + th.data.firist_type_curr++;
  193 + }
547 194  
548   - th.data.requestData.push(item);
549   - })
550   - }else{
551   - th.data.requestData.push(item);
  195 + var th = this,
  196 + app = getApp(),
  197 + index = 0,
  198 + gdata = [];
  199 +
  200 + var user_id = getApp().globalData.user_id;
  201 + if (!user_id) user_id = 0;
  202 +
  203 + //--初始化卡类--
  204 + // th.card_init();
  205 +
  206 + var os = getApp().globalData.setting;
  207 + classstyle_id = classstyle_id + "";
  208 + switch (classstyle_id) {
  209 + //---手动选择商品---
  210 + case "1":
  211 + var str = "";
  212 + for (var i = 0; i < g_id.length; i++) {
  213 + str += g_id[i].goodsid + ",";
  214 + }
  215 + str = str.substring(0, str.length - 1);
  216 +
  217 + // await app.request.get("/api/weshop/serviceCard/page?store_id=" + os.stoid + "&goodsidlist=" + str, {
  218 + await app.request.get("/api/weshop/serviceCard/page?store_id=" + os.stoid + "&ids=" + str, {
  219 + data: {
  220 + user_id: user_id
  221 + },
  222 + isShowLoading: false,
  223 + success: function(res) {
  224 + th.data.loading = 0;
  225 +
  226 + if (res.data.code == 0 && res.data.data) {
  227 +
  228 + var goods = res.data.data.pageData;
  229 + // console.log('goods', goods);
  230 + // var rData = th.data.requestData;
  231 + // if (rData == null) rData=[];
  232 + // var now=ut.gettimestamp();
  233 +
  234 + // var new_arr=[];
  235 + // for (var ii in res.data.data){
  236 + // var item=res.data.data[ii];
  237 + // item.goods_img=th.data.imghost + item.original_img;
  238 + // if(item.e_time<now) {item.prom_type=0; item.prom_price=0;}
  239 + // if(item.warm_uptime>now) {item.prom_type=0; item.prom_price=0;}
  240 + // new_arr.push(item);
  241 + // }
  242 + // rData = rData.concat(new_arr);
  243 +
  244 + // th.data.requestData = rData;
  245 +
  246 + // if(th.data.object.column==5){
  247 + // var arr = new Array();
  248 + // //--三个三个一组---
  249 + // for(var i=0;i< rData.length;i+=3){
  250 + // arr.push(rData.slice(i,i+3));
  251 + // }
  252 + // th.setData({ goods_array: arr });
  253 + // }else{
  254 + // th.setData({ goods_array: rData });
  255 + // }--
  256 +
  257 + th.set_good(goods);
  258 +
  259 + //---控制有没有加载更多的按钮---
  260 + if (th.data.firist_type_curr >= len) {
  261 + th.setData({
  262 + goods_btn: []
  263 + });
  264 + } else th.setData({
  265 + goods_btn: [1, 2]
  266 + });
  267 + }
  268 + }
  269 +
  270 + })
  271 +
  272 + break;
  273 + case "2":
  274 + var item = {};
  275 + var r_data = {
  276 + store_id: os.stoid,
  277 + pageSize: th.data.goodscount,
  278 + page: th.data.currentPage,
  279 + isonsale: 1,
  280 + orderField: "sort",
  281 + orderType: 'asc',
  282 + };
  283 + if (th.data.is_recommend) r_data.is_recommend = th.data.is_recommend;
  284 + if (th.data.is_hot) r_data.is_hot = th.data.is_hot;
  285 + if (th.data.is_new) r_data.is_new = th.data.is_new;
  286 +
  287 + var user_id = getApp().globalData.user_id;
  288 + if (!user_id) user_id = 0;
  289 + r_data.user_id = user_id;
  290 +
  291 + await app.request.promiseGet("/api/weshop/goods/page", {
  292 + data: r_data
  293 + }).then(res => {
  294 + th.data.loading = 0;
  295 + //商品地址
  296 + var goods = res.data.data.pageData;
  297 + th.setData({
  298 + goods_btn: res.data.data.pageData,
  299 + total: res.data.data.total
  300 + })
  301 + th.data.currentPage++;
  302 + //设置商品熏染
  303 + th.set_good(goods);
  304 +
  305 + })
  306 + break;
  307 + case "3":
  308 + var item = {};
  309 + await app.request.promiseGet("/api/weshop/goodsGroup/pageGoodsList", {
  310 + data: {
  311 + store_id: os.stoid,
  312 + gpid: wgroup,
  313 + pageSize: th.data.goodscount,
  314 + page: th.data.currentPage,
  315 + isonsale: 1,
  316 + orderField: "sort",
  317 + orderType: 'asc',
  318 + user_id: user_id
  319 + }
  320 + }).then(res => {
  321 + th.data.loading = 0;
  322 + //商品地址
  323 + var goods = res.data.data.pageData;
  324 + th.setData({
  325 + goods_btn: res.data.data.pageData,
  326 + total: res.data.data.total
  327 + })
  328 +
  329 + th.data.currentPage++;
  330 + //设置商品熏染
  331 + th.set_good(goods);
  332 +
  333 + })
  334 + break;
552 335 }
553   - }
554   -
555   - if(th.data.object.column==5){
556   - var arr = new Array();
557   - var rData=th.data.requestData;
558   - //--三个三个一组---
559   - for(var i=0;i< rData.length;i+=3){
560   - arr.push(rData.slice(i,i+3));
561   - }
562   - th.setData({ goods_array: arr,page: th.data.currentPage - 1, });
563   - }else{
564   - th.setData({
565   - goods_array: th.data.requestData,
566   - page: th.data.currentPage - 1,
  336 +
  337 + },
  338 +
  339 + setLoading: function() {
  340 + var that = this;
  341 + if (this.data.loading) return false;
  342 + this.data.loading = 1;
  343 + that.init(that.data.classstyle_id, that.data.wgroup);
  344 + },
  345 +
  346 + //图片失败,默认图片
  347 + bind_bnerr3: function(e) {
  348 + var _errImg = e.target.dataset.errorimg;
  349 + var _errObj = {};
  350 + _errObj[_errImg] = this.data.imghost + "/public/images/default_goods_image_240.gif";
  351 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  352 + },
  353 +
  354 + //---卡的初始化----
  355 + card_init: function() {
  356 + // var th = this,
  357 + // os = getApp().globalData.setting;
  358 + // if (!getApp().globalData.user_id) return false;
  359 + // getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
  360 + // isShowLoading: false,
  361 + // success: function(e) {
  362 + // getApp().globalData.userInfo = e.data.data;
  363 + // getApp().getConfig2(function(e) {
  364 + // var swithc_list = e.switch_list;
  365 + // var sw_arr = JSON.parse(swithc_list);
  366 + // //---如果后台又开等级卡的开关---
  367 + // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  368 + // th.setData({
  369 + // rank_switch: true
  370 + // });
  371 + // //---回调卡的列表---
  372 + // th.getPlusCardType(function(ob) {
  373 + // th.setData({
  374 + // card_list: ob.card_list
  375 + // });
  376 + // var ti = setInterval(function() {
  377 + // var user = getApp().globalData.userInfo;
  378 + // if (!user) return false;
  379 + // clearInterval(ti);
  380 +
  381 + // if (user.card_field && user['card_expiredate']) {
  382 + // var str = user['card_expiredate'].replace(/-/g, '/');
  383 + // var end = new Date(str);
  384 + // end = Date.parse(end) / 1000;
  385 + // var now = ut.gettimestamp();
  386 +
  387 + // //--- 判断是等级会员,且在有效期范围内 ---
  388 + // if (user.card_field && now < end) {
  389 + // var card_name = ob.name_map.get(user.card_field);
  390 + // if (card_name.length > 4) card_name = card_name.substring(0, 4);
  391 + // th.setData({
  392 + // card_field: user.card_field,
  393 + // card_name: card_name,
  394 + // card_list: ob.card_list
  395 + // });
  396 + // }
  397 +
  398 + // }
  399 +
  400 + // }, 500)
  401 + // })
  402 +
  403 + // }
  404 + // })
  405 + // }
  406 + // })
  407 +
  408 + },
  409 +
  410 + //--- 获取卡类列表 ---
  411 + getPlusCardType: function(func) {
  412 + // var storid = o.stoid;
  413 + // var th = this;
  414 + // getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  415 + // var plusCard = res.data.data;
  416 + // var arr = [1219, 2089, 3031];
  417 + // var new_arr = new Array();
  418 + // var card_name_map = new Map();
  419 +
  420 + // var user = getApp().globalData.userInfo;
  421 +
  422 + // if (plusCard) {
  423 +
  424 + // for (var i = 0; i < plusCard.length; i++) {
  425 + // if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  426 + // continue;
  427 + // }
  428 +
  429 + // var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  430 + // card_name_map.set(name, plusCard[i].CardName);
  431 + // new_arr.push(plusCard[i]);
  432 + // }
  433 + // }
  434 +
  435 + // var ob = {
  436 + // "card_list": new_arr,
  437 + // "name_map": card_name_map
  438 + // };
  439 + // func(ob);
  440 + // })
  441 + },
  442 +
  443 +
  444 + //--- 点击tab的事件 ---
  445 + gr_set_nav: function(e) {
  446 +
  447 + var title_idx = e.currentTarget.dataset.index;
  448 + if (title_idx == this.data.title_index) return false;
  449 + wx.showLoading();
  450 +
  451 + var nav_item = this.data.object.nav_list[title_idx];
  452 + this.data.g_id = [];
  453 + if (this.data.object.nav_list && this.data.object.nav_list[title_idx] && this.data.object.nav_list[title_idx].data)
  454 + this.data.g_id = this.data.object.nav_list[title_idx].data;
  455 + var arr = [];
  456 + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
  457 + // for (var i = 0; i < this.data.g_id.length; i ++) {
  458 + arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
  459 + }
  460 + this.data.firist_type_data = arr;
  461 + this.data.firist_type_curr = 0;
  462 + this.data.requestData = [];
  463 +
  464 + // 在组件实例进入页面节点树时执行
  465 + if (nav_item) {
  466 + this.data.classstyle_id = nav_item.classstyle;
  467 + this.data.wgroup = nav_item.wgroup;
  468 + }
  469 +
  470 +
  471 + this.data.is_recommend = this.data.is_hot = this.data.is_new = 0;
  472 + //推荐,热卖,新品
  473 + if (nav_item && nav_item.goodsclass == 1) {
  474 + this.data.is_recommend = 1
  475 + }
  476 + if (nav_item && nav_item.goodsclass == 2) {
  477 + this.data.is_hot = 1
  478 + }
  479 + if (nav_item && nav_item.goodsclass == 3) {
  480 + this.data.is_new = 1
  481 + }
  482 +
  483 +
  484 + this.data.currentPage = 1;
  485 + this.setData({
  486 + goods_array: null,
  487 + total: null,
  488 + title_index: title_idx
567 489 });
  490 + //初始化
  491 + this.init(this.data.classstyle_id, this.data.wgroup);
  492 + setTimeout(function() {
  493 + wx.hideLoading();
  494 + }, 1000)
  495 + },
  496 +
  497 + //--- 设置 ---
  498 + set_good: async function(goods) {
  499 + var now = ut.gettimestamp();
  500 + var th = this;
  501 + if (!goods || goods.length == 0) return false;
  502 + var user_id = getApp().globalData.userInfo.user_id;
  503 + if (!user_id) user_id = 0;
  504 + for (var i in goods) {
  505 + var val = goods[i];
  506 + var item = {};
  507 + var prom_id = null;
  508 + //app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goods_id, {}).then(res => {
  509 +
  510 + // var url = "/api/weshop/activitylist/getGoodActInfo";
  511 + // var req_data = {
  512 + // store_id: os.stoid,
  513 + // goodsidlist: val.goods_id,
  514 + // is_detail: 1,
  515 + // user_id: user_id
  516 + // };
  517 +
  518 + //获取商品的实际活动
  519 + // await getApp().request.promiseGet(url, {
  520 + // data: req_data
  521 + // }).then(res => {
  522 + // if (res.data.code == 0 && res.data.data && res.data.data.length == 1) {
  523 + // item.prom_type = res.data.data[0].prom_type;
  524 + // item.prom_id = res.data.data[0].act_id;
  525 + // }
  526 + // })
  527 + // console.log('val++++++<<<<<', val);
  528 + item.goods_name = val.serviceName;
  529 + item.goods_img = th.data.imghost + val.imgUrl;
  530 + item.market_price = val.show_price;
  531 + item.shop_price = val.money;
  532 + item.sales_sum = val.sales_sum;
  533 + item.goods_id = val.id;
  534 +
  535 + // item.cardprice1 = val.cardprice1;
  536 + // item.cardprice2 = val.cardprice2;
  537 + // item.cardprice3 = val.cardprice3;
  538 + // item.prom_type = val.prom_type;
  539 + // item.prom_id = val.prom_id;
  540 +
  541 + if (val.prom_price) item.prom_price = val.prom_price;
  542 + if (val.prom_integral) item.prom_integral = val.prom_integral;
  543 +
  544 + prom_id = val.prom_id;
  545 +
  546 + var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
  547 +
  548 + var url = "";
  549 +
  550 + // switch (prom_type) {
  551 + // case 1:
  552 + // var user_id = getApp().globalData.user_id;
  553 + // if (!user_id) user_id = 0;
  554 + // url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id;
  555 + // break;
  556 + // case 2:
  557 + // url = "/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id
  558 + // break;
  559 + // case 4:
  560 + // url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id;
  561 + // break;
  562 + // case 6:
  563 + // url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id;
  564 + // break;
  565 + // case 8:
  566 + // var presell_id = prom_id;
  567 + // var url1 = "/api/weshop/marketing/marketingPresellList/list";
  568 + // var rd = {
  569 + // store_id: os.stoid,
  570 + // presell_id: presell_id,
  571 + // goods_id: val.goods_id
  572 + // }
  573 + // //------获取预售从表----------
  574 + // await getApp().request.promiseGet(url1, {
  575 + // data: rd
  576 + // }).then(res => {
  577 + // if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
  578 + // var arr = res.data.data[0];
  579 + // item.prom_price = arr.luck_goods_price;
  580 + // item.sales_sum = arr.buy_goodnum + (arr.virtual_qty ? arr.virtual_qty : 0);
  581 + // }
  582 + // })
  583 + // break;
  584 + // default:
  585 + // break
  586 + // }
  587 +
  588 + if (url != null && url != '') {
  589 + await getApp().request.promiseGet(url, {}).then(res => {
  590 + var prom = null;
  591 + if (res && res.data) prom = res.data.data;
  592 + if (prom != null && prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom.show_time &&
  593 + prom.show_time < now))) {
  594 + item.prom_price = res.data.data.price;
  595 + if (res.data.data.user_price) item.prom_price = res.data.data.user_price;
  596 + var vNum = res.data.data.virtual_num ? res.data.data.virtual_num : 0;
  597 + var vNum1 = res.data.data.virtualNum ? res.data.data.virtualNum : 0;
  598 + var vNum2 = res.data.data.virtual ? res.data.data.virtual : 0;
  599 + item.sales_sum = res.data.data.buy_num + (vNum + vNum1 + vNum2);
  600 + } else {
  601 + item.prom_type = 0;
  602 + item.prom_id = 0;
  603 + item.prom_price = null;
  604 + }
  605 +
  606 + th.data.requestData.push(item);
  607 + })
  608 + } else {
  609 + th.data.requestData.push(item);
  610 + }
  611 + }
  612 +
  613 + if (th.data.object.column == 5) {
  614 + var arr = new Array();
  615 + var rData = th.data.requestData;
  616 + //--三个三个一组---
  617 + for (var i = 0; i < rData.length; i += 3) {
  618 + arr.push(rData.slice(i, i + 3));
  619 + }
  620 + th.setData({
  621 + goods_array: arr,
  622 + page: th.data.currentPage - 1,
  623 + });
  624 + } else {
  625 + th.setData({
  626 + goods_array: th.data.requestData,
  627 + page: th.data.currentPage - 1,
  628 + });
  629 + }
  630 +
  631 +
  632 + // console.log('goods_array0000000000====>>>', th.data.goods_array);
  633 +
  634 + },
  635 +
  636 + re_show: function() {
  637 + if (this.data.object.goodscount * this.data.page < this.data.total) {
  638 + this.setLoading()
  639 + }
568 640 }
569   -
570   - },
571 641  
572   - re_show:function () {
573   - if(this.data.object.goodscount *this.data.page <this.data.total ){
574   - this.setLoading()
575   - }
576   - }
577 642  
578 643  
579 644  
580   -
581   - }
582   -})
583 645 \ No newline at end of file
  646 + }
  647 +})
... ...
components/diy_serviceCard/diy_serviceCard.wxml
... ... @@ -12,36 +12,33 @@
12 12 </block> -->
13 13  
14 14 <!-- 服务卡项顶部标题 -->
15   -<scroll-view scroll-x="true" enhanced="true" fast-deceleration="true" show-scrollbar="false">
16   - <view class="flex fs28">
17   - <view class="scroll-view-item active">标题1</view>
18   - <view class="scroll-view-item">标题标题2</view>
19   - <view class="scroll-view-item">标题3</view>
20   - <view class="scroll-view-item">标题标题标题4</view>
21   - <view class="scroll-view-item">标题5</view>
22   - <view class="scroll-view-item">标题6</view>
23   - <view class="scroll-view-item">标题题7</view>
24   - <view class="scroll-view-item">标题8</view>
25   - <view class="scroll-view-item">标题题9</view>
26   - <view class="scroll-view-item">标题10</view>
27   - <view class="scroll-view-item">标题11</view>
28   - <view class="scroll-view-item">标题12222</view>
  15 +<!-- class="scroll-view-item {{index == title_index ? 'active':''}}" -->
  16 +<scroll-view scroll-x="true" enhanced="true" fast-deceleration="true" show-scrollbar="false" wx:if="{{is_nav}}">
  17 + <view class="flex" style="{{myStyle}}">
  18 + <view
  19 + wx:for="{{nav_list}}"
  20 + data-index="{{index}}"
  21 + data-idlist="{{item.idlist}}"
  22 + data-wgroup="{{item.wgroup}}"
  23 + data-classstyle="{{item.classstyle}}"
  24 + bindtap="gr_set_nav"
  25 + class="scroll-view-item {{index == title_index ? 'active':''}}"
  26 + style="{{title_class}}">{{item.title}}</view>
29 27 </view>
30 28 </scroll-view>
31 29  
32 30  
33 31 <!--1个列表的时候-->
34 32 <view class="zs_goods_wai" wx:if='{{object.column==1}}'>
35   - <block wx:for="{{goods_array}}" >
  33 + <block wx:for="{{goods_array}}">
36 34 <view class='zs_goods {{g_filter.get_border_type(object.big_order_type)}}'>
37   - <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1">
38   - <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&prom_id={{item.prom_id}}&&prom_type={{item.prom_type}}" class="s1_gk_a1"> -->
  35 + <!-- <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> -->
  36 + <navigator url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1">
39 37 <view class='zs_top rel'>
40 38  
41 39 <block wx:if="{{object.big_order_type==3}}">
42 40 <view style="position: relative; width: 100%; height: 100%">
43   - <image class='zs_t_img' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true"
44   - binderror="bind_bnerr3"></image>
  41 + <image class='zs_t_img' src="{{object.pic_back}}" data-errorimg="object.pic_back" lazy-load="true" binderror="bind_bnerr3"></image>
45 42 <image class="n_box" style="top: {{object.top}}%;left:{{object.left}}%;width: {{object.width}}%;height: {{object.width}}%" src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" binderror="bind_bnerr3"></image>
46 43 </view>
47 44 </block>
... ... @@ -68,7 +65,8 @@
68 65 </block>
69 66 </view>
70 67 <view class='zs_center'>
71   - <view class='zs_wz1' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
  68 + <!-- <view class='zs_wz1' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> -->
  69 + <view class='zs_wz1'>{{item.goods_name}}</view>
72 70 <!--如果有显示价格 -->
73 71 <view class='zs_wz2' wx:if="{{object.goodsprice}}">
74 72 <block wx:if="{{item.prom_price || item.prom_integral}}">
... ... @@ -190,7 +188,7 @@
190 188 <view class="flex flex-wrap" wx:if="{{object.column==2}}" style="padding: 0 10rpx 20rpx 10rpx;">
191 189 <block wx:for="{{goods_array}}" >
192 190 <view class="nav-container">
193   - <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1 {{g_filter.get_border_type(object.big_order_type)}}">
  191 + <navigator url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1 {{g_filter.get_border_type(object.big_order_type)}}">
194 192 <view class="zs_goods_wai_ban">
195 193 <!-- <view class="zs_goods_ban"> -->
196 194 <!-- <view class='zs_goods_2l'> -->
... ... @@ -352,7 +350,7 @@
352 350 <view class="flex wrap pdh10">
353 351 <block wx:for="{{goods_array}}" >
354 352 <view class="nav-box">
355   - <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1">
  353 + <navigator url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1">
356 354 <view class="zs_goods_wai_san {{g_filter.get_border_type(object.big_order_type)}}" >
357 355 <view class="zs_goods_san">
358 356 <view class='zs_goods_3l'>
... ... @@ -511,7 +509,7 @@
511 509 <!-- 列表显示 -->
512 510 <view class="zs_goods_xiao_wai" wx:if='{{object.column==4}}'>
513 511 <block wx:for="{{goods_array}}" >
514   - <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1">
  512 + <navigator url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" class="s1_gk_a1">
515 513 <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}" >
516 514 <view class='zs_top_x'>
517 515 <block wx:if="{{object.big_order_type==3}}">
... ... @@ -694,7 +692,7 @@
694 692 <view class="sp">
695 693 <swiper-item class="s_it" wx:for="{{goods_array}}">
696 694 <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind">
697   - <navigator url="{{g_filter.get_url_by_type(aitem)}}" style="width: 32%" >
  695 + <navigator url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" style="width: 32%" >
698 696 <view class="one {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}">
699 697 <view class='sp_top'>
700 698 <view class='s_img' style="position: relative; width: 100%">
... ...
components/diy_serviceCard/diy_serviceCard.wxss
1 1 /* pages/diy_zs/diy_zs.wxss */
  2 +:root {
  3 +
  4 +}
2 5  
3 6 .zwp_3 {
4 7 margin-top: 10rpx;
... ... @@ -104,7 +107,7 @@
104 107 width: 56rpx;
105 108 height: 56rpx;
106 109 position: absolute;
107   - left: 0rpx;
  110 + left: 10rpx;
108 111 top: 10rpx;
109 112 }
110 113  
... ... @@ -112,7 +115,7 @@
112 115 width: 56rpx;
113 116 height: 56rpx;
114 117 position: absolute;
115   - right: 0rpx;
  118 + right: 10rpx;
116 119 top: 10rpx;
117 120 }
118 121  
... ... @@ -120,7 +123,7 @@
120 123 width: 56rpx;
121 124 height: 56rpx;
122 125 position: absolute;
123   - left: 0rpx;
  126 + left: 10rpx;
124 127 bottom: 10rpx;
125 128 }
126 129  
... ... @@ -128,7 +131,7 @@
128 131 width: 56rpx;
129 132 height: 56rpx;
130 133 position: absolute;
131   - right: 20rpx;
  134 + right: 10rpx;
132 135 bottom: 10rpx;
133 136 }
134 137  
... ... @@ -237,11 +240,12 @@
237 240 }
238 241  
239 242 .zs_t1_x {
  243 + position: absolute;
240 244 width: 56rpx;
241 245 height: 56rpx;
242   - position: relative;
243   - right: 62rpx;
244   - top: 6rpx;
  246 + /* position: relative; */
  247 + right: 10rpx;
  248 + top: 10rpx;
245 249 }
246 250  
247 251 .zs_t1_x1 {
... ... @@ -254,19 +258,21 @@
254 258 }
255 259  
256 260 .zs_t1_x2 {
  261 + position: absolute;
257 262 width: 56rpx;
258 263 height: 56rpx;
259   - position: relative;
260   - right: 56rpx;
261   - top: 0rpx;
  264 + /* position: relative; */
  265 + right: 10rpx;
  266 + top: 10rpx;
262 267 }
263 268  
264 269 .zs_t1_x3 {
  270 + position: absolute;
265 271 width: 56rpx;
266 272 height: 56rpx;
267   - position: relative;
268   - right: 288rpx;
269   - top: 234rpx;
  273 + /* position: relative; */
  274 + left: 10rpx;
  275 + bottom: 10rpx;
270 276 }
271 277  
272 278 /*1列2个*/
... ... @@ -906,17 +912,22 @@ top: 10rpx;
906 912  
907 913 .scroll-view-item {
908 914 flex-shrink: 0;
909   - border: 2rpx solid #ddd;
  915 + border-width: 2rpx;
  916 + border-style: solid;
  917 + border-color: #ddd;
910 918 border-radius: 80rpx;
911   - padding: 10rpx 20rpx;
  919 + padding: 10rpx 30rpx;
912 920 margin: 20rpx 10rpx;
913 921 /* font-size: 28rpx; */
914 922 box-sizing: border-box;
  923 + text-align: center;
  924 + /* flex: 1; */
  925 + flex-grow: 1;
915 926 }
916 927  
917 928 .scroll-view-item.active {
918   - color: red;
919   - border-color: red;
  929 + color: var(--font-color) !important;
  930 + border-color: var(--border-color) !important;
920 931 }
921 932  
922 933  
... ... @@ -925,7 +936,7 @@ top: 10rpx;
925 936 padding-top: 20rpx;
926 937 padding-left: 10rpx;
927 938 padding-right: 10rpx;
928   - flex: 1;
  939 + /* flex: 1; */
929 940 flex-basis: 50%;
930 941 }
931 942  
... ...
components/serviceCard_list/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + //-- 判断是不是有等级价 --
  3 + is_has_rank:function(rank_switch,item){
  4 + if(!rank_switch) return false;
  5 + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
  6 + return false;
  7 + },
  8 +
  9 + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
  10 + get_card_price:function(goods,all_card,type){
  11 + var price1=parseFloat(goods['cardprice1']);
  12 + var price2 = parseFloat(goods['cardprice2']);
  13 + var price3 = parseFloat(goods['cardprice3']);
  14 + if(!all_card){
  15 + if(type==0) return 0;
  16 + return "";
  17 + }
  18 +
  19 + var min_price=null;
  20 + var min_name=null;
  21 + //---设置对应的价格名字----
  22 + for(var i=0;i<3;i++) {
  23 + var vl=all_card[i];
  24 + if(!vl) continue;
  25 +
  26 + if(vl['CorrPrice']=="Price1" && price1>0)
  27 + {
  28 + if(min_price==null) {
  29 + min_price=price1;min_name=vl['CardName'];
  30 + }
  31 + else if(price1<min_price) {
  32 + min_price=price1;min_name=vl['CardName'];
  33 + }
  34 + }
  35 + if(vl['CorrPrice']=="Price2" && price2>0)
  36 + {
  37 + if(min_price==null) {
  38 + min_price=price2;min_name=vl['CardName'];
  39 + }
  40 + else if(price2<min_price) {
  41 + min_price=price2;min_name=vl['CardName'];
  42 + }
  43 + }
  44 +
  45 + if(vl['CorrPrice']=="Price3" && price3>0)
  46 + {
  47 + if(min_price==null) {
  48 + min_price=price3;min_name=vl['CardName'];
  49 + }
  50 + else if(price3<min_price) {
  51 + min_price=price3;min_name=vl['CardName'];
  52 + }
  53 + }
  54 +
  55 + }
  56 + if(min_price==null){
  57 + if(type==0) return 0;
  58 + return "";
  59 + }
  60 +
  61 + if(type==0) return min_price;
  62 + if(min_name.length>4 ) min_name=min_name.substring(0, 8);
  63 + return min_name;
  64 + },
  65 +
  66 + get_url_by_type: function(item) {
  67 + var url = '';
  68 + if(item.prom_type == 9) {
  69 + url = '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id;
  70 + }
  71 + else if(item.prom_type==8){
  72 + url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id
  73 + }
  74 + else {
  75 + url = '/pages/goods/goodsInfo/goodsInfo?goods_id=' + item.goods_id + '&prom_id=' + item.prom_id + '&prom_type=' + item.prom_type;
  76 + };
  77 + return url;
  78 + },
  79 +
  80 +}
  81 +module.exports = {
  82 + is_has_rank:g_filters.is_has_rank,
  83 + get_card_price:g_filters.get_card_price,
  84 + get_url_by_type:g_filters.get_url_by_type,
  85 +}
0 86 \ No newline at end of file
... ...
components/serviceCard_list/serviceCard_list.js 0 → 100644
  1 +var t = getApp(),
  2 + a = t.request,
  3 + o = t.globalData.setting,
  4 + os = o,
  5 + i = require("../../utils/util.js"),
  6 + ut = i,
  7 + s = require("../../utils/common.js");
  8 +Component({
  9 + data: {
  10 + url: o.imghost,
  11 + object: null,
  12 + curPage: 1,
  13 + is_no_more: 1, //加载完所有数据的控制器
  14 + load_complete: 0, //加载完成,
  15 + rank_switch: false,
  16 + card_field: "",
  17 + card_name: "",
  18 + max_card_field: "",
  19 + card_list: null
  20 + },
  21 + properties: {
  22 + // 这⾥定义了innerText属性,属性值可以在组件使⽤时指定
  23 + },
  24 + ready: function () {},
  25 + pageLifetimes: {
  26 + //要处理一下,游客登录后的界面的变化,主要还该是改变会员
  27 + show: function () {
  28 + console.log('page-show');
  29 + this.init();
  30 + if(getApp().globalData.login_back==1){
  31 + getApp().globalData.login_back==0;
  32 + this.data.curPage=1;
  33 + this.setData({ recommend: [] });
  34 + this.get_list();
  35 + }
  36 + }
  37 + },
  38 +
  39 + methods: {
  40 + init: function () {
  41 + var th = this;
  42 + if (!getApp().globalData.user_id) return false;
  43 + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
  44 + isShowLoading: false,
  45 + success: function (e) {
  46 + if (e.data.code == 0 && e.data && e.data.data) {
  47 + getApp().globalData.userInfo = e.data.data;
  48 + getApp().getConfig2(function (e) {
  49 + var swithc_list = e.switch_list;
  50 + var sw_arr = JSON.parse(swithc_list);
  51 + //---如果后台有开等级卡的开关---
  52 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  53 + th.setData({
  54 + rank_switch: true
  55 + });
  56 + //---回调卡的列表---
  57 + th.getPlusCardType(function (ob) {
  58 + th.setData({
  59 + card_list: ob.card_list
  60 + });
  61 + var ti = setInterval(function () {
  62 + var user = getApp().globalData.userInfo;
  63 + if (!user) return false;
  64 + clearInterval(ti);
  65 + if (user.card_field && user['card_expiredate']) {
  66 + var str = user['card_expiredate'].replace(/-/g, '/');
  67 + var end = new Date(str);
  68 + end = Date.parse(end) / 1000;
  69 + var now = ut.gettimestamp();
  70 + //--- 判断是等级会员,且在有效期范围内 ---
  71 + if (user.card_field && now < end) {
  72 + var card_name = ob.name_map.get(user.card_field);
  73 + if (card_name.length > 4) card_name = card_name.substring(0, 8);
  74 + th.setData({
  75 + card_field: user.card_field,
  76 + card_name: card_name,
  77 + card_list: ob.card_list
  78 + });
  79 + }
  80 + }
  81 + }, 500)
  82 + })
  83 + }
  84 + })
  85 +
  86 + }
  87 +
  88 +
  89 +
  90 + }
  91 + })
  92 + },
  93 + // get_list: function () {
  94 + // var th = this;
  95 + // var url = "http://172.20.0.233:8022/api/weshop/display";
  96 + // wx.request({
  97 + // url: url,
  98 + // success: function (res) {
  99 + // th.setData({
  100 + // recommend: res.data.data.pageData
  101 + // })
  102 + // }
  103 + // })
  104 + // },
  105 + get_list: function () {
  106 + var that = this;
  107 + if (that.data.is_no_more == 0) return false;
  108 + var user_id=getApp().globalData.user_id;
  109 + if(!user_id) user_id=0;
  110 +
  111 + var curPage = that.data.curPage;
  112 +
  113 + // page: curPage,
  114 + // pageSize: 6,
  115 + // orderField: "sort",
  116 + // orderType: 'asc',
  117 + // // user_id: user_id,
  118 + // // is_mainshow: 1,
  119 + // // isonsale: 1,
  120 + // // is_on_sale: 1,
  121 + // is_recommend: 1,
  122 + // store_id: o.stoid,
  123 +
  124 + getApp().request.get('/api/weshop/serviceCard/page', {
  125 + isShowLoading: false,
  126 + data: {
  127 + is_recommend: 1,
  128 + store_id: o.stoid,
  129 + },
  130 + success: function (res) {
  131 + console.log('获取卡项推荐', res.data.data);
  132 + var data = res.data;
  133 + var total = data.data.total;
  134 + if (total <= curPage * 6) {
  135 + that.setData({
  136 + is_no_more: 0
  137 + });
  138 + } else {
  139 + that.data.curPage++;
  140 + }
  141 + //加载完成
  142 + if (data.data.pageData) {
  143 +
  144 + for(let i in data.data.pageData){
  145 + let item=data.data.pageData[i];
  146 + if(item.user_price)
  147 + item.prom_price=item.user_price;
  148 + }
  149 +
  150 + that.setData({
  151 + load_complete: 1
  152 + });
  153 + }
  154 + if (that.data.recommend != null) {
  155 + var ra = that.data.recommend.concat(data.data.pageData);
  156 + that.setData({
  157 + recommend: ra
  158 + });
  159 + } else {
  160 + that.setData({
  161 + recommend: data.data.pageData
  162 + });
  163 + }
  164 +
  165 + console.log('卡项推荐按~~~~~~', that.data.recommend)
  166 + }
  167 + })
  168 + },
  169 + bind_bnerr_xc: function (e) {
  170 + var _errImg = e.target.dataset.errorimg;
  171 + var _errurl = e.target.dataset.url;
  172 + var _errObj = {};
  173 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  174 + this.setData(_errObj) //注意这⾥的赋值⽅式,只是将数据列表中的此项图⽚路径值替换掉 ;
  175 + },
  176 + reset: function () {
  177 + curPage = 1;
  178 + },
  179 + //--- 获取卡类列表 ---
  180 + getPlusCardType: function (func) {
  181 + var storid = o.stoid;
  182 + var th = this;
  183 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  184 +
  185 + if (res.data.code != 0 || !res.data.data) {
  186 + var ob = {
  187 + "card_list": [],
  188 + "name_map": ""
  189 + };
  190 + func(ob);
  191 + return false;
  192 + }
  193 +
  194 + var plusCard = res.data.data;
  195 + var arr = [1219, 2089, 3031];
  196 + var new_arr = new Array();
  197 + var card_name_map = new Map();
  198 +
  199 + var user = getApp().globalData.userInfo;
  200 + if (plusCard) {
  201 + for (var i = 0; i < plusCard.length; i++) {
  202 + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  203 + continue;
  204 + }
  205 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  206 + card_name_map.set(name, plusCard[i].CardName);
  207 + new_arr.push(plusCard[i]);
  208 +
  209 + }
  210 + }
  211 + var ob = {
  212 + "card_list": new_arr,
  213 + "name_map": card_name_map
  214 + };
  215 + func(ob);
  216 + })
  217 + },
  218 +
  219 + go_url:function (e) {
  220 + var url=e.currentTarget.dataset.url;
  221 + console.log('url===>>>>', url);
  222 + getApp().goto(url);
  223 + }
  224 +
  225 + },
  226 +})
0 227 \ No newline at end of file
... ...
components/serviceCard_list/serviceCard_list.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
components/serviceCard_list/serviceCard_list.wxml 0 → 100644
  1 +<!-- 商品列表 -->
  2 +<wxs module="filter" src="../../utils/filter.wxs"></wxs>
  3 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  4 +<view class="collects">
  5 + <view class="hang ">
  6 + <!-- 商品详情 -->
  7 +
  8 + <view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.id}}">
  9 + <!--<view class="collect ib" wx:for="{{recommend}}" bindtap="go_url" data-url="{{item.prom_type == 9 ? ('/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id):('/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&title='+item.goods_name+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id)}}">-->
  10 + <!-- <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&title={{item.goods_name}}&prom_type={{item.prom_type}}&prom_id={{item.prom_id}}" hover-class="none"> -->
  11 + <navigator hover-class="none">
  12 + <!-- 商品图⽚ -->
  13 + <image class="sp" src="{{url+item.imgUrl}}" mode="aspectFill" binderror="bind_bnerr_xc" data-url="{{url+item.original_img}}" data-errorimg="recommend[{{index}}].imgUrl"></image>
  14 + <view class="bottom">
  15 + <!-- 商品名称 -->
  16 + <view class="goods_name ellipsis-2 fs28">{{item.serviceName}}</view>
  17 + <!-- 判断是否有活动价 -->
  18 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}">
  19 + <view class="pdt10">
  20 + <view class="money flex xc-wc" >
  21 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  22 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  23 + <!-- 活动价 -->
  24 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
  25 + <view class="fs24">¥</view>
  26 + <view class="fs35">{{item.prom_price}}</view>
  27 + </view>
  28 + </view>
  29 + <view class="flex">
  30 + <!-- 原价 -->
  31 + <view class="price flex xc-ash line_th">
  32 + <view class="fs22">¥</view>
  33 + <view class="fs22">{{item.market_price}}</view>
  34 + </view>
  35 + </view>
  36 + </view>
  37 +
  38 + </block>
  39 + <block wx:else>
  40 + <!-- 商品价格,先判断下是后⼜等级价-->
  41 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  42 + <!-- 当会员是等级卡的时候 -->
  43 + <block wx:if="{{card_field}}">
  44 + <!-- 等级价>0 -->
  45 + <block wx:if="{{item[card_field]>0}}">
  46 + <view class="money flex">
  47 + <!-- 办卡价 -->
  48 + <view class="flex xc-wc ai_and">
  49 + <view class="fs24">¥</view>
  50 + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view>
  51 + <view class="card_bg ellipsis-1">
  52 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  53 + <text class="card_name">{{card_name}}</text>
  54 + </view>
  55 + </view>
  56 + </view>
  57 + <view class="flex">
  58 + <!-- 原价 -->
  59 + <view class="price flex xc-ash line_th">
  60 + <view class="fs22">¥</view>
  61 + <view class="fs22">{{item.market_price}}</view>
  62 + </view>
  63 + </view>
  64 + </block>
  65 + <blocK wx:else>
  66 + <view class="money flex">
  67 + <!-- 办卡价 -->
  68 + <view class="flex xc-wc">
  69 + <view class="fs24">¥</view>
  70 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  71 + </view>
  72 + </view>
  73 + <view class="flex">
  74 + <!-- 原价 -->
  75 + <view class="price flex xc-ash line_th">
  76 + <view class="fs22">¥</view>
  77 + <view class="fs22">{{item.market_price}}</view>
  78 + </view>
  79 + </view>
  80 + </blocK>
  81 + </block>
  82 + <block wx:else>
  83 + <!-- 如果商品有设置等级价⼤于0的 -->
  84 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  85 + <view class="money flex">
  86 + <!-- 办卡价 -->
  87 + <view class="flex xc-wc">
  88 + <view class="fs24">¥</view>
  89 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  90 + </view>
  91 + <!-- 原价 -->
  92 + <view class="price flex xc-ash line_th">
  93 + <view class="fs22">¥</view>
  94 + <view class="fs22">{{item.market_price}}</view>
  95 + </view>
  96 + </view>
  97 + <view class="flexr" style="">
  98 + <!-- 等级价 -->
  99 + <view class="price flex ai-center">
  100 + <view class="fs22">¥</view>
  101 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  102 + <view class="card_bg ellipsis-1">
  103 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>
  104 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  105 + </view>
  106 + </view>
  107 + </view>
  108 + </block>
  109 + <block wx:else>
  110 + <view class="money flex">
  111 + <!-- 办卡价 -->
  112 + <view class="flex xc-wc">
  113 + <view class="fs24">¥</view>
  114 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  115 + </view>
  116 + </view>
  117 + <view class="flex">
  118 + <!-- 原价 -->
  119 + <view class="price flex xc-ash line_th">
  120 + <view class="fs22">¥</view>
  121 + <view class="fs22">{{item.market_price}}</view>
  122 + </view>
  123 + </view>
  124 + </block>
  125 + </block>
  126 + </block>
  127 + <!-- 商品压根就没有等级价 -->
  128 + <view class="pdt10" wx:else>
  129 + <view class="money flex">
  130 + <!-- 办卡价 -->
  131 + <view class="flex xc-wc">
  132 + <view class="fs24">¥</view>
  133 + <view class="fs35">{{filter.toFix(item.money,2)}}</view>
  134 + </view>
  135 + </view>
  136 + <view class="flex" style="">
  137 + <!-- 原价 -->
  138 + <view class="price flex xc-ash line_th">
  139 + <view class="fs22">¥</view>
  140 + <view class="fs22">{{item.show_price}}</view>
  141 + </view>
  142 + </view>
  143 + </view>
  144 + </block>
  145 + </view>
  146 + </navigator>
  147 + </view>
  148 + </view>
  149 + <view class="nothing flex-center" wx:if="{{is_no_more==0}}">
  150 + <view class="Foil"></view>
  151 + <view class="no_content fs24">没有更多内容了</view>
  152 + <view class="Foil"></view>
  153 + </view>
  154 +</view>
0 155 \ No newline at end of file
... ...
components/serviceCard_list/serviceCard_list.wxss 0 → 100644
  1 +.collects {
  2 + /* margin-top: 40rpx; */
  3 + /* margin-bottom: 40rpx; */
  4 +}
  5 +
  6 +.pdt10 {
  7 + padding-top: 10rpx;
  8 +}
  9 +
  10 +.ai-center{
  11 + align-items: center;
  12 +}
  13 +
  14 +.ib {
  15 + display: inline-block;
  16 +}
  17 +
  18 +.fs20 {
  19 + font-size: 20rpx;
  20 +}
  21 +
  22 +.fs22 {
  23 + font-size: 22rpx;
  24 +}
  25 +
  26 +.fs24 {
  27 + font-size: 24rpx;
  28 +}
  29 +
  30 +.fs26 {
  31 + font-size: 26rpx;
  32 +}
  33 +
  34 +.fs28 {
  35 + font-size: 28rpx;
  36 +}
  37 +
  38 +.fs35 {
  39 + font-size: 35rpx;
  40 +}
  41 +
  42 +.flex-center {
  43 + display: flex;
  44 + justify-content: center;
  45 + align-items: center;
  46 +}
  47 +
  48 +.ellipsis-1 {
  49 + overflow: hidden;
  50 + white-space: nowrap;
  51 + text-overflow: ellipsis;
  52 +}
  53 +
  54 +/* .ellipsis-1x {
  55 + overflow: hidden;
  56 + text-overflow: ellipsis;
  57 + display: -webkit-box;
  58 + -webkit-box-orient: vertical;
  59 + -webkit-line-clamp: 1;
  60 +} */
  61 +
  62 +.xc-wc {
  63 + color: #d60021;
  64 +}
  65 +
  66 +.xc-ash {
  67 + color: #b9b9b9;
  68 +}
  69 +
  70 +.choice_box .choice_list .choice_footer .price {
  71 + color: #f23030;
  72 + height: 10px;
  73 +}
  74 +
  75 +.flex {
  76 + display: flex;
  77 +}
  78 +
  79 +.ellipsis-2 {
  80 + overflow: hidden;
  81 + text-overflow: ellipsis;
  82 + display: -webkit-box;
  83 + -webkit-box-orient: vertical;
  84 + -webkit-line-clamp: 2;
  85 +}
  86 +
  87 +.goods_name {
  88 + height: 62rpx;
  89 + /* margin-top: 6rpx; */
  90 + line-height: 1.2;
  91 + margin-bottom: 10rpx;
  92 +}
  93 +
  94 +.hang {
  95 + /* width: 100%; */
  96 + /* margin: auto;
  97 + padding-left: 21rpx; */
  98 + display: flex;
  99 + flex-wrap: wrap;
  100 + /* margin: 0 auto; */
  101 + padding: 0 20rpx;
  102 + box-sizing: border-box;
  103 + /* justify-content: space-evenly; */
  104 +}
  105 +
  106 +.hang .collect {
  107 + width: calc((100% - 20rpx) / 2);
  108 + /* height: 520rpx; */
  109 + border-radius: 25rpx;
  110 + border: 2rpx solid #ebedf0;
  111 + overflow: hidden;
  112 + box-sizing: border-box;
  113 + margin-top: 20rpx;
  114 + /* margin-right: 14rpx;
  115 + margin-bottom: 5rpx; */
  116 +}
  117 +
  118 +.hang .collect:nth-child(2n+1) {
  119 + margin-right: 20rpx;
  120 +}
  121 +
  122 +.collect .bottom {
  123 + padding: 20rpx;
  124 +}
  125 +
  126 +.collect .sp {
  127 + width: 100%;
  128 + height: 340rpx;
  129 + display: block;
  130 +}
  131 +
  132 +.collect .money {
  133 + /* margin-top: 28rpx;
  134 + margin-bottom: 8rpx;
  135 + line-height: 28rpx;
  136 + align-items: baseline; */
  137 +}
  138 +
  139 +.collect .money view {
  140 + line-height: 28rpx;
  141 +}
  142 +
  143 +.collect .money .flex {
  144 + font-weight: bold;
  145 +}
  146 +
  147 +.collect .money .flex .fs24 {
  148 + padding-top: 5rpx;
  149 +}
  150 +
  151 +.collect .Discount {
  152 + width: 156rpx;
  153 + height: 28rpx;
  154 + border-radius: 20rpx;
  155 + background-color: rgb(56, 56, 56);
  156 + font-size: 18rpx;
  157 + color: rgb(255, 255, 255);
  158 +}
  159 +
  160 +.collect .Discount image {
  161 + height: 18rpx;
  162 + width: 18rpx;
  163 + line-height: 28rpx;
  164 + margin-right: 3rpx;
  165 +}
  166 +
  167 +.collect.ml20 {
  168 + margin-left: 13rpx;
  169 +}
  170 +
  171 +.fs24.dollar {
  172 + padding: 0rpx;
  173 +}
  174 +
  175 +.money .price {
  176 + margin-left: 12rpx;
  177 + text-decoration: line-through;
  178 + line-height: 23rpx;
  179 +}
  180 +
  181 +.province {
  182 + line-height: 26rpx;
  183 +}
  184 +
  185 +.nothing {
  186 + height: 75rpx;
  187 + width: 100%;
  188 +}
  189 +
  190 +.nothing .no_content {
  191 + margin: 0rpx 11rpx;
  192 + color: rgb(138, 138, 138);
  193 +}
  194 +
  195 +.nothing .Foil {
  196 + width: 80rpx;
  197 + height: 2rpx;
  198 + background-color: #ebedf0;
  199 +}
  200 +
  201 +.line_th {
  202 + text-decoration: line-through;
  203 +}
  204 +
  205 +.card_bg {
  206 + box-sizing: border-box;
  207 + padding: 2rpx 10rpx;
  208 + height: 28rpx;
  209 + border-radius: 26rpx;
  210 + font-size: 18rpx;
  211 + line-height: 28rpx;
  212 + max-width: 210rpx;
  213 + background: #333;
  214 + color: #fff;
  215 + margin-left: 8rpx;
  216 +}
  217 +
  218 +.card_bg image {
  219 + width: 19rpx;
  220 + height: 19rpx;
  221 + margin-right: 8rpx;
  222 +}
  223 +
  224 +/* .card_bg .card_name {
  225 + max-width: 76rpx;
  226 + width: auto;
  227 + overflow: hidden;
  228 + white-space: nowrap;
  229 +} */
  230 +
  231 +.card_name {
  232 + position: relative;
  233 + top: -4rpx;
  234 +}
  235 +
  236 +
... ...
custom-tab-bar/index.js
... ... @@ -5,13 +5,14 @@ Component({
5 5 fontcolor:'#6e6d6b',
6 6 fontcolor_sele:'#f23030',
7 7 backgroundColor:'#ffffff',
8   - active:-1,
9 8 list:app.def_list,
10 9 cartGoodsNum:0,
  10 + active: 0,
11 11 },
12 12  
13 13 lifetimes: {
14 14 attached: function() {
  15 +
15 16 var th=this;
16 17 getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{
17 18 var dis=rs.data.data;
... ... @@ -51,7 +52,8 @@ Component({
51 52 var th=this;
52 53  
53 54 var is_read=getApp().globalData.is_read;
54   - var custum_data=getApp().globalData.custum_data;
  55 + var custum_data=getApp().globalData.custum_data;
  56 +
55 57 if(is_read){
56 58 if(custum_data){
57 59 this.set_list(custum_data);
... ... @@ -105,16 +107,33 @@ Component({
105 107 fontcolor:data.fontcolor,
106 108 is_custum:1
107 109 })
108   -
  110 + // console.log('abc=======<<<<<', this.data.list);
109 111 },
110 112  
111 113 nav_goto:function(e){
  114 + // const data = e.currentTarget.dataset
  115 + // this.setData({
  116 + // active: data.index
  117 + // })
  118 + // console.log('active***********<<<<<', this.data.active);
112 119 var url=e.currentTarget.dataset.url;
113 120 if(!url) return false;
114 121 if(url[0]!='/') url='/'+url;
115 122 //wx.switchTab({url:url,})
116 123 getApp().goto(url);
117   - }
  124 + },
  125 +
  126 +
  127 + // switchTab(e) {
  128 + // const data = e.currentTarget.dataset
  129 + // const url = data.path
  130 + // wx.switchTab({url})
  131 + // this.setData({
  132 + // selected: data.index
  133 + // })
  134 + // }
  135 +
  136 +
118 137  
119 138 }
120 139  
... ...
custom-tab-bar/index.wxml
1 1 <!-- 如果是自定义的话 -->
2 2 <view class="main_bar {{is_custum?'custom':''}}" style=" background: {{backgroundColor}}; font-size: 22rpx;">
3   - <block wx:for="{{list}}" wx:for-index="idx">
4   - <block wx:if="{{item.nav_name !== '分销' && item.weappurl!= '/pages/distribution/distribution'}}">
5   - <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
6   - style="color: {{active==idx?fontcolor_sele:fontcolor}};">
7   - <!-- <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
8   - style="width:{{100 / list.length}}%;color: {{active==idx?fontcolor_sele:fontcolor}};"> -->
9   -
10   - <view class="tab_img">
11   - <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view>
12   - <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
13   - </view>
14   - <view>{{item.nav_name}}</view>
15   - </view>
16   - </block>
17   - <!-- 是分销商且没有关闭,可以显示 -->
  3 + <block wx:for="{{list}}" wx:for-index="idx">
  4 + <block wx:if="{{item.nav_name !== '分销' && item.weappurl != '/pages/distribution/distribution'}}">
  5 + <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
  6 + style="color: {{active==idx?fontcolor_sele:fontcolor}};">
  7 + <!-- <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
  8 + style="width:{{100 / list.length}}%;color: {{active==idx?fontcolor_sele:fontcolor}};"> -->
  9 + <!-- <view class="tabbar_item_wrapper"> -->
  10 + <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
  11 + <view class="tab_img">
  12 + <view wx:if="{{item.nav_name=='购物车' && cartGoodsNum != 0}}" class="cart_num" >{{cartGoodsNum}}</view>
  13 + <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
  14 + </view>
  15 + <view>{{item.nav_name}}</view>
  16 + </view>
  17 +
  18 + </view>
  19 + </block>
  20 +
  21 +
  22 + <!-- 是分销商且没有关闭,可以显示 -->
18 23 <block wx:if="{{(item.nav_name === '分销' || item.weappurl === '/pages/distribution/distribution') && !is_no_distri}}">
19 24 <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
20 25 style="color: {{active==idx?fontcolor_sele:fontcolor}};">
21 26 <!-- <view data-url="{{item.weappurl}}" bindtap="nav_goto" class="tabbar_item" data-act="{{active==idx?1:0}}"
22 27 style="width:{{100 / list.length}}%;color: {{active==idx?fontcolor_sele:fontcolor}};"> -->
23   - <view class="tab_img">
24   - <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
25   - </view>
26   - <view>{{item.nav_name}}</view>
27   - </view>
  28 + <view class="{{item.specific ? 'tabbar_item_wrapper':''}}" style="background-color: {{item.specific ? item.button_background:'transparent'}};">
  29 + <view class="tab_img">
  30 + <view class="nav_imgage" style="background-image: url({{active==idx?item.src_sele:item.src}});"></view>
  31 + </view>
  32 + <view>{{item.nav_name}}</view>
  33 + </view>
  34 +
  35 + </view>
28 36 </block>
29   - </block>
  37 + </block>
30 38 </view >
31 39  
32 40  
... ...
custom-tab-bar/index.wxss
... ... @@ -7,6 +7,7 @@
7 7 z-index: 10000;
8 8 display: flex;
9 9 justify-content: space-around;
  10 + align-items: center;
10 11 height: 100rpx;
11 12 }
12 13 .main_bar.custom {
... ... @@ -19,14 +20,14 @@
19 20 /* float: left; */
20 21 text-align: center;
21 22 padding: 0;
22   - display: flex;
  23 + /* display: flex; */
23 24 flex: 1;
24   - flex-direction: column;
25   - justify-content: center;
  25 + /* flex-direction: column; */
  26 + /* justify-content: center; */
26 27 }
27 28  
28 29 .tab_img {
29   - display: flex;
  30 + /* display: flex; */
30 31 justify-content: center;
31 32 position: relative;
32 33 }
... ... @@ -39,6 +40,7 @@
39 40 /* background-position: center;
40 41 background-repeat: no-repeat; */
41 42 background-size: 100%;
  43 + margin: 0 auto;
42 44 }
43 45  
44 46 .cart_num {
... ... @@ -55,3 +57,17 @@
55 57 right: 34rpx;
56 58 /* margin-right: -70rpx; */
57 59 }
  60 +
  61 +.tabbar_item_wrapper {
  62 + background-color: white;
  63 + position: relative;
  64 + width: 120rpx;
  65 + height: 120rpx;
  66 + border-radius: 50%;
  67 + bottom: 14rpx;
  68 + display: flex;
  69 + flex-direction: column;
  70 + justify-content: center;
  71 + margin: 0 auto;
  72 +}
  73 +
... ...
packageA/pages/cardList/cardList.js
... ... @@ -24,6 +24,7 @@ Page({
24 24 */
25 25 onLoad: function (options) {
26 26 self = this;//保存全局指针
  27 + this.data.options = options;
27 28 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
28 29 self.setData({
29 30 userInfo: data,
... ... @@ -60,7 +61,9 @@ Page({
60 61 imghost: app.globalData.setting.imghost,
61 62 isLogin: true,
62 63 });
63   -
  64 + if(this.data.options.cat_id) {
  65 + currentQuery.cat_id = this.data.options.cat_id;
  66 + };
64 67 currentQuery.page=1;
65 68 this.getData(true, url, currentQuery);
66 69 // app.request.promiseGet("/api/weshop/ad/page?pid=2&store_id=" + app.globalData.setting.stoid, {
... ...
packageA/pages/cardList/cardList.wxml
... ... @@ -52,7 +52,7 @@
52 52 </block>
53 53  
54 54 <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
55   - <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
  55 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
56 56 </view>
57 57 </block>
58 58  
... ... @@ -85,7 +85,7 @@
85 85 <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
86 86 </view>
87 87  
88   - <view wx:if="{{noMore}}" class="noMore">- 已经到底了 -</view>
  88 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
89 89 </scroll-view>
90 90 </view>
91 91 </block>
... ...
packageA/pages/cart2_ser/cart2_ser.js
1   -var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"),
2   - s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp();
3   -var oo=t.globalData.setting,os=oo;
  1 +var t = getApp(),
  2 + app = t,
  3 + a = t.request,
  4 + e = require("../../../utils/common.js"),
  5 + s = require("../../../utils/util.js"),
  6 + o = require("../../../utils/md5.js"),
  7 + to = getApp();
  8 +var oo = t.globalData.setting,
  9 + os = oo;
4 10 var regeneratorRuntime = require('../../../utils/runtime.js');
5 11 var util_pay = require("../../../utils/pay.js");
6 12  
7 13 Page({
8   - data: {
9   - url: t.globalData.setting.url,
10   - resourceUrl: t.globalData.setting.resourceUrl,
11   - imgUrl: t.globalData.setting.imghost,
12   -
13   - invoiceToggle: !0,
14   - payWithUserMoney: !0,
15   - payWithPoints: !0,
16   - maxWord: 0,
17   - enterAddressPage: !1,
18   -
19   - //页面获取的参数
20   - param:null,
21   - postdata:null,
22   - //提交订单的格式
23   - formData: {
24   - order_amount:0,//支付金额
25   - total_amount:0,//总价
26   - all_price:0,//商品卖的总价
27   - pay_points: 0,//使用积分
28   - user_money: 0,//使用余额
29   - couponCode: "",//使用优惠券(多单就用逗号隔开)
30   - shipping_price:0,//物流费用
31   - },
32   -
33   - /*----------------立即购买---------------------*/
34   - is_b_now:0, //0是购物车结算 1立即购买
35   - bn_goods:null, //立即购买时候的调用商品
36   - bn_use_money:0,//是否使用余额
37   - bn_pick:0, //选择的门店
38   - bn_pickname: "", //选择的门店名称
39   -
40   - /*------------------------*/
41   - yuer:0,
42   - is_cart:0, //是不是购物车进来的购买
43   - },
44   - onLoad: function(t) {
  14 + data: {
  15 + url: t.globalData.setting.url,
  16 + resourceUrl: t.globalData.setting.resourceUrl,
  17 + imgUrl: t.globalData.setting.imghost,
  18 +
  19 + invoiceToggle: !0,
  20 + payWithUserMoney: !0,
  21 + payWithPoints: !0,
  22 + maxWord: 0,
  23 + enterAddressPage: !1,
  24 +
  25 + //页面获取的参数
  26 + param: null,
  27 + postdata: null,
  28 + //提交订单的格式
  29 + formData: {
  30 + order_amount: 0, //支付金额
  31 + total_amount: 0, //总价
  32 + all_price: 0, //商品卖的总价
  33 + pay_points: 0, //使用积分
  34 + user_money: 0, //使用余额
  35 + couponCode: "", //使用优惠券(多单就用逗号隔开)
  36 + shipping_price: 0, //物流费用
  37 + },
  38 +
  39 + /*----------------立即购买---------------------*/
  40 + is_b_now: 0, //0是购物车结算 1立即购买
  41 + bn_goods: null, //立即购买时候的调用商品
  42 + bn_use_money: 0, //是否使用余额
  43 + bn_pick: 0, //选择的门店
  44 + bn_pickname: "", //选择的门店名称
  45 +
  46 + /*------------------------*/
  47 + yuer: 0,
  48 + is_cart: 0, //是不是购物车进来的购买
  49 + },
  50 + onLoad: function(t) {
45 51 wx.setNavigationBarTitle({
46   - title: "填写订单",
  52 + title: "填写订单",
47 53 });
48   -
49   - var appD=getApp().globalData.service_now;
50   - this.data.postdata=appD;
51   - this.data.param=t;
52   - if(t.is_cart){
53   - this.setData({is_cart:1});
54   - }
55   -
56   - var th=this;
57   -
  54 +
  55 + var appD = getApp().globalData.service_now;
  56 + this.data.postdata = appD;
  57 + this.data.param = t;
  58 + if (t.is_cart) {
  59 + this.setData({
  60 + is_cart: 1
  61 + });
  62 + }
  63 +
  64 + var th = this;
  65 +
58 66 getApp().promiseGet("/api/wx/weappSendlist/page", {
59   - data: {
60   - store_id: os.stoid,
61   - typeid: "1001"
62   - }}).then(res=>{
63   - if (res.data.code == 0 && res.data.data.pageData.length > 0) {
64   - var template_id = res.data.data.pageData[0].template_id;
65   - th.setData({template_id:template_id});
66   - }
67   - })
68   -
69   - },
70   - onUnload: function () { this.setData({ isclose: 1 })},
71   -
72   - //------获取会员信息-----先获取用户信息,在进行下一步---
73   - get_info:function(func){
74   - var user_id = t.globalData.user_id;
75   - to.auth.get_u(func);
76   - },
77   -
78   - //----------------展示页面,是再获取用户信息之后--------------
79   - show_page:function(){
80   - var th=this;
81   - //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取
82   - var user=getApp().globalData.userInfo;
83   - getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
84   - data:{r:Math.random()},
85   - success: function (e) {
86   -
87   - getApp().globalData.userInfo = e.data.data;
88   - th.setData({userinfo:e.data.data});
89   - //获取立即购买的商品信息
90   - if(th.data.is_cart){
91   - //读取门店
92   - to.get_allsto(function (e) {
93   - th.setData({ allsto: e });
94   - th.get_cart();
95   - })
96   - }else{
97   - th.get_buy_goods();
98   - }
99   -
100   - //获取提现金额
101   - getApp().request.get("/api/weshop/withdrawals/summoney", {
102   - data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
103   - success: function (su) {
104   - if (su.data.code == 0) {
105   - var yuer = parseFloat(th.data.userinfo.user_money -
106   - (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
107   - th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  67 + data: {
  68 + store_id: os.stoid,
  69 + typeid: "1001"
  70 + }
  71 + }).then(res => {
  72 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  73 + var template_id = res.data.data.pageData[0].template_id;
  74 + th.setData({
  75 + template_id: template_id
  76 + });
  77 + }
  78 + })
  79 +
  80 + },
  81 + onUnload: function() {
  82 + this.setData({
  83 + isclose: 1
  84 + })
  85 + },
  86 +
  87 + //------获取会员信息-----先获取用户信息,在进行下一步---
  88 + get_info: function(func) {
  89 + var user_id = t.globalData.user_id;
  90 + to.auth.get_u(func);
  91 + },
  92 +
  93 + //----------------展示页面,是再获取用户信息之后--------------
  94 + show_page: function() {
  95 + var th = this;
  96 + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取
  97 + var user = getApp().globalData.userInfo;
  98 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  99 + data: {
  100 + r: Math.random()
  101 + },
  102 + success: function(e) {
  103 +
  104 + getApp().globalData.userInfo = e.data.data;
  105 + th.setData({
  106 + userinfo: e.data.data
  107 + });
  108 + //获取立即购买的商品信息
  109 + if (th.data.is_cart) {
  110 + //读取门店
  111 + to.get_allsto(function(e) {
  112 + th.setData({
  113 + allsto: e
  114 + });
  115 + th.get_cart();
  116 + })
  117 + } else {
  118 + th.get_buy_goods();
  119 + }
  120 +
  121 + //获取提现金额
  122 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  123 + data: {
  124 + user_id: to.globalData.user_id,
  125 + store_id: oo.stoid,
  126 + status: 0
  127 + },
  128 + success: function(su) {
  129 + if (su.data.code == 0) {
  130 + var yuer = parseFloat(th.data.userinfo.user_money -
  131 + (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(
  132 + 2);
  133 + th.setData({
  134 + txmon: su.data.data.summoney,
  135 + yuer: yuer
  136 + });
  137 + }
  138 + }
  139 + });
  140 + }
  141 + });
  142 + },
  143 +
  144 + //-----获取购物车,入口--------
  145 + get_cart: function() {
  146 + var th = this,
  147 + app = getApp();
  148 + a.get("/api/weshop/cartService/page", {
  149 + data: {
  150 + user_id: to.globalData.user_id,
  151 + selected: 1,
  152 + store_id: oo.stoid,
  153 + pageSize: 600
  154 + },
  155 + success: async function(su) {
  156 + //按门店分类的数组
  157 + var arr = new Array();
  158 + var carr = su.data.data.pageData;
  159 + th.data.cartlist_y = carr; //存储原始购物车列表
  160 +
  161 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  162 + var is_card_back = getApp().globalData.is_card_back;
  163 +
  164 +
  165 + //在分组的时候,就不要再调用接口,await
  166 + for (var i = 0; i < carr.length; i++) {
  167 + var good = null;
  168 + var item = carr[i];
  169 + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}).then(
  170 + res => {
  171 + good = res.data.data;
  172 + })
  173 +
  174 + item.img_url = oo.imghost + good.imgUrl;
  175 + item.erpItemID = good.erpItemID;
  176 +
  177 + /*----接口要弄出来的,先顶着-----*/
  178 + var pcid = item.pick_id;
  179 + var find = 0;
  180 + //----如果有就加进去,没有就新增一个----
  181 + //-----------循环查找门店-------------
  182 + if (arr.length > 0) {
  183 + for (var j = 0; j < arr.length; j++) {
  184 + if (arr[j].pickup_id == pcid) {
  185 + arr[j].goods.push(item);
  186 + find = 1;
  187 + break;
  188 + }
  189 + }
  190 + }
  191 + //------如果没有找到-----
  192 + if (find == 0) {
  193 + var pikname = '',
  194 + sto = null;
  195 + //----找到门店名称-----
  196 + for (var k = 0; k < th.data.allsto.length; k++) {
  197 + if (pcid == th.data.allsto[k].pickup_id) {
  198 + pikname = th.data.allsto[k].pickup_name;
  199 + sto = th.data.allsto[k];
  200 + break;
108 201 }
109 202 }
110   - });
  203 + var narr = new Array();
  204 + narr.push(item);
  205 + var ie = {
  206 + pickup_id: pcid,
  207 + pname: pikname,
  208 + goods: narr,
  209 + keyid: sto.keyid,
  210 + goods_price: 0,
  211 + shipping_price: 0,
  212 + user_money: 0,
  213 + total_amount: 0,
  214 + order_amount: 0
  215 + };
  216 + arr.push(ie);
  217 +
  218 + }
  219 + }
  220 +
  221 + //深拷贝
  222 + th.data.old_cartlist = JSON.parse(JSON.stringify(arr));
  223 + th.setData({
  224 + cartlist: arr,
  225 + });
  226 + th.calculatePrice();
  227 + }
  228 + });
  229 + },
  230 +
  231 + //-----获取立即购买的商品信息----
  232 + get_buy_goods: function() {
  233 + var th = this,
  234 + a = getApp().request;
  235 + var gg = th.data.postdata;
  236 + var url = "/api/weshop/serviceCard/get/" + oo.stoid + "/" + gg.id
  237 + //调用商品
  238 + a.get(url, {
  239 + success: function(t) {
  240 + var gd = t.data.data;
  241 + t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
  242 + t.data.data['buynum'] = gg.goods_num;
  243 + t.data.data.shop_price = gd.money;
  244 +
  245 + th.setData({
  246 + bn_goods: t.data.data,
  247 + bn_pickname: gg.pick_name,
  248 + bn_pick: gg.pick_id
  249 + });
  250 + th.calculatePrice2();
  251 +
  252 + }
  253 + });
  254 + },
  255 +
  256 + //----------子页返回父页触发----------
  257 + onShow: function() {
  258 + var th = this;
  259 + if (th.data.isclose == 0) {
  260 + wx.navigateTo({
  261 + url: "/pages/index/index/index"
  262 + })
  263 + }
  264 + //先获取是否有关闭使用优惠券
  265 + getApp().getConfig2(function(ee) {
  266 + //var json_d = JSON.parse(ee.switch_list);
  267 + //th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  268 + //th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  269 + th.show_page();
  270 + })
  271 + },
  272 +
  273 +
  274 + showInvoice: function() {
  275 + this.setData({
  276 + invoiceToggle: !this.data.invoiceToggle
  277 + });
  278 + },
  279 +
  280 +
  281 + //-------------------计算购物车订单价格-------------------
  282 + calculatePrice: function() {
  283 + var th = this;
  284 + to.getConfig2(async function(ee) {
  285 + wx.showLoading({
  286 + title: "处理中."
  287 + })
  288 + var all_price = 0; //所有的商品总价
  289 + var all_shipping_m = 0; //所有的物流总价
  290 + var all_total_m = 0; //所有的订单应付总价
  291 + var all_order_m = 0; //所有的订单应付总价
  292 + var all_user_m = 0; //所有的订单用户使用金额
  293 + var all_coupon_price_m = 0; //所有的订单用户使用优惠券价格
  294 + var all_cutprice = 0; //所有的优惠减件
  295 + var all_order_prom = 0; //所有的订单优惠
  296 +
  297 + var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money :
  298 + 0);
  299 + var freight_free = ee.freight_free; //全场满多少包邮
  300 + var no_ex_id = ee.no_ex_id;
  301 + var no_ex_good = null;
  302 + var by_qc = {};
  303 + var c_arr = JSON.parse(JSON.stringify(th.data.old_cartlist));
  304 +
  305 + //---循环购物车---
  306 + for (var i in c_arr) {
  307 +
  308 + var cart_item = c_arr[i]; //就是每一单的意思
  309 + var pickid = cart_item.pickup_id;
  310 + var o_price = 0;
  311 + var o_shipping_price = 0,
  312 + goods_weight = -1,
  313 + goods_piece = -1;
  314 + var item = c_arr[i].goods; //就是每一单的从表的意思
  315 +
  316 + //---如果有选择优惠券的情况下---
  317 + var quan_price = 0;
  318 + var coupon_price = 0;
  319 + var quan_no = null;
  320 +
  321 + //--------循环计算总价-----------
  322 + for (var j = 0; j < item.length; j++) {
  323 + o_price += item[j].money * item[j].goods_num;
  324 + }
  325 + var f_o_price = o_price;
  326 + cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
  327 + //计算物流费用
  328 + cart_item.shipping_price = 0;
  329 +
  330 + //总价计算,总价不包含运费
  331 + cart_item.order_amount = (o_price - quan_price).toFixed(2);
  332 + cart_item.total_amount = f_o_price.toFixed(2);
  333 +
  334 + var order_prom_amount = 0;
  335 + var order_prom_id = 0;
  336 + var o_condition = cart_item.order_amount;
  337 + var order_m = 0;
  338 + cart_item.order_prom_amount = 0;
  339 + coupon_price = quan_price;
  340 +
  341 +
  342 + cart_item.total_amount = parseFloat(cart_item.total_amount) + parseFloat(cart_item.shipping_price); //总金额
  343 + cart_item.order_amount = parseFloat(cart_item.order_amount) + parseFloat(cart_item.shipping_price); //总金额
  344 + cart_item.total_amount = cart_item.total_amount.toFixed(2);
  345 + cart_item.order_amount = cart_item.order_amount.toFixed(2);
  346 +
  347 + //搭配购在使用余额
  348 + if (th.data.bn_use_money == 1 && th.data.is_b_now == 1) {
  349 +
  350 + if (umoney > cart_item.order_amount) {
  351 + cart_item.user_money = cart_item.order_amount;
  352 + umoney = umoney - cart_item.order_amount;
  353 + } else {
  354 + cart_item.user_money = umoney;
  355 + umoney = 0;
  356 + }
  357 +
  358 + } else {
  359 + //--------------如果使用余额,购物车购买---------------------
  360 + if (th.data.js_use_money == 1) {
  361 + if (umoney > cart_item.order_amount) {
  362 + cart_item.user_money = cart_item.order_amount;
  363 + umoney = umoney - cart_item.order_amount;
  364 + } else {
  365 + cart_item.user_money = umoney;
  366 + umoney = 0;
  367 + }
  368 + } else {
  369 + cart_item.user_money = 0;
  370 + }
  371 + }
  372 + all_price += parseFloat(f_o_price);
  373 + all_total_m += parseFloat(cart_item.total_amount);
  374 + all_shipping_m += parseFloat(cart_item.shipping_price);
  375 + all_order_m += parseFloat(cart_item.order_amount);
111 376 }
112   - });
113   - },
114   -
115   - //-----获取购物车,入口--------
116   - get_cart: function () {
117   - var th = this,app=getApp();
118   - a.get("/api/weshop/cartService/page", {
119   - data: {
120   - user_id: to.globalData.user_id, selected:1,
121   - store_id: oo.stoid, pageSize: 600 },
122   - success:async function (su) {
123   - //按门店分类的数组
124   - var arr = new Array();
125   - var carr = su.data.data.pageData;
126   - th.data.cartlist_y = carr; //存储原始购物车列表
127   -
128   - //---是不是购买等级卡成功的返回---等级卡显示的判断---
129   - var is_card_back=getApp().globalData.is_card_back;
130   -
131   -
132   - //在分组的时候,就不要再调用接口,await
133   - for (var i = 0; i < carr.length; i++) {
134   - var good=null;
135   - var item = carr[i];
136   - await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}).then(res => {
137   - good = res.data.data;
138   - })
139   -
140   - item.img_url = oo.imghost + good.imgUrl;
141   - item.erpItemID=good.erpItemID;
142   -
143   - /*----接口要弄出来的,先顶着-----*/
144   - var pcid = item.pick_id;
145   - var find = 0;
146   - //----如果有就加进去,没有就新增一个----
147   - //-----------循环查找门店-------------
148   - if (arr.length > 0) {
149   - for (var j = 0; j < arr.length; j++) {
150   - if (arr[j].pickup_id == pcid) {
151   - arr[j].goods.push(item);
152   - find = 1;break;
153   - }
154   - }
155   - }
156   - //------如果没有找到-----
157   - if (find == 0) {
158   - var pikname = '',sto=null;
159   - //----找到门店名称-----
160   - for (var k = 0; k < th.data.allsto.length; k++) {
161   - if (pcid == th.data.allsto[k].pickup_id) {
162   - pikname = th.data.allsto[k].pickup_name; sto = th.data.allsto[k]; break;
163   - }
164   - }
165   - var narr = new Array(); narr.push(item);
166   - var ie = {
167   - pickup_id: pcid, pname: pikname, goods: narr,keyid:sto.keyid,
168   - goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0};
169   - arr.push(ie);
170   -
171   - }
172   - }
173   -
174   - //深拷贝
175   - th.data.old_cartlist= JSON.parse(JSON.stringify(arr));
176   - th.setData({
177   - cartlist: arr,
178   - });
179   - th.calculatePrice();
180   - }
181   - });
182   - },
183   -
184   - //-----获取立即购买的商品信息----
185   - get_buy_goods: function (){
186   - var th=this,a=getApp().request;
187   - var gg = th.data.postdata;
188   - var url="/api/weshop/serviceCard/get/" + oo.stoid + "/" + gg.id
189   - //调用商品
190   - a.get(url, {
191   - success: function (t) {
192   - var gd = t.data.data;
193   - t.data.data.original_img = oo.imghost + t.data.data.imgUrl;
194   - t.data.data['buynum'] = gg.goods_num;
195   - t.data.data.shop_price=gd.money;
196   -
197   - th.setData({
198   - bn_goods: t.data.data, bn_pickname: gg.pick_name,
199   - bn_pick: gg.pick_id
200   - });
201   - th.calculatePrice2();
202   -
203   - }
204   - });
205   - },
206   -
207   - //----------子页返回父页触发----------
208   - onShow: function() {
209   - var th=this;
210   - if (th.data.isclose==0){
211   - wx.navigateTo({
212   - url: "/pages/index/index/index"
213   - })
214   - }
215   - //先获取是否有关闭使用优惠券
216   - getApp().getConfig2(function (ee) {
217   - //var json_d = JSON.parse(ee.switch_list);
218   - //th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
219   - //th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
220   - th.show_page();
221   - })
222   - },
223   -
224   -
225   - showInvoice: function() {
226   - this.setData({
227   - invoiceToggle: !this.data.invoiceToggle
228   - });
229   - },
230   -
231   -
232   - //-------------------计算购物车订单价格-------------------
233   - calculatePrice: function() {
234   - var th = this;
235   - to.getConfig2(async function(ee){
236   - wx.showLoading({
237   - title:"处理中."
238   - })
239   - var all_price=0; //所有的商品总价
240   - var all_shipping_m= 0; //所有的物流总价
241   - var all_total_m = 0; //所有的订单应付总价
242   - var all_order_m = 0; //所有的订单应付总价
243   - var all_user_m=0; //所有的订单用户使用金额
244   - var all_coupon_price_m=0; //所有的订单用户使用优惠券价格
245   - var all_cutprice=0; //所有的优惠减件
246   - var all_order_prom=0; //所有的订单优惠
247   -
248   - var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money?th.data.userinfo.frozen_money:0);
249   - var freight_free = ee.freight_free; //全场满多少包邮
250   - var no_ex_id=ee.no_ex_id;
251   - var no_ex_good=null;
252   - var by_qc={};
253   - var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist));
254   -
255   - //---循环购物车---
256   - for(var i in c_arr){
257   -
258   - var cart_item=c_arr[i]; //就是每一单的意思
259   - var pickid=cart_item.pickup_id;
260   - var o_price=0;
261   - var o_shipping_price=0,goods_weight=-1, goods_piece=-1;
262   - var item=c_arr[i].goods; //就是每一单的从表的意思
263   -
264   - //---如果有选择优惠券的情况下---
265   - var quan_price=0;
266   - var coupon_price=0;
267   - var quan_no= null;
268   -
269   - //--------循环计算总价-----------
270   - for(var j=0;j<item.length;j++){
271   - o_price += item[j].money * item[j].goods_num;
272   - }
273   - var f_o_price=o_price;
274   - cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
275   - //计算物流费用
276   - cart_item.shipping_price = 0;
277   -
278   - //总价计算,总价不包含运费
279   - cart_item.order_amount= (o_price -quan_price).toFixed(2);
280   - cart_item.total_amount= f_o_price.toFixed(2);
281   -
282   - var order_prom_amount=0; var order_prom_id=0; var o_condition=cart_item.order_amount;
283   - var order_m=0;
284   - cart_item.order_prom_amount=0;
285   - coupon_price=quan_price;
286   -
287   -
288   - cart_item.total_amount= parseFloat(cart_item.total_amount)+parseFloat(cart_item.shipping_price); //总金额
289   - cart_item.order_amount=parseFloat(cart_item.order_amount)+parseFloat(cart_item.shipping_price); //总金额
290   - cart_item.total_amount= cart_item.total_amount.toFixed(2);
291   - cart_item.order_amount=cart_item.order_amount.toFixed(2);
292   -
293   - //搭配购在使用余额
294   - if(th.data.bn_use_money==1 && th.data.is_b_now==1){
295   -
296   - if (umoney > cart_item.order_amount) {
297   - cart_item.user_money = cart_item.order_amount;
298   - umoney = umoney - cart_item.order_amount;
299   - }else {
300   - cart_item.user_money = umoney;
301   - umoney=0;
302   - }
303   -
304   - }else{
305   - //--------------如果使用余额,购物车购买---------------------
306   - if (th.data.js_use_money == 1) {
307   - if (umoney > cart_item.order_amount) {
308   - cart_item.user_money = cart_item.order_amount;
309   - umoney = umoney - cart_item.order_amount;
310   - }else {
311   - cart_item.user_money = umoney;
312   - umoney=0;
313   - }
314   - }else{
315   - cart_item.user_money=0;
316   - }
317   - }
318   - all_price += parseFloat(f_o_price);
319   - all_total_m += parseFloat(cart_item.total_amount);
320   - all_shipping_m += parseFloat(cart_item.shipping_price);
321   - all_order_m += parseFloat(cart_item.order_amount);
322   - }
323   -
324   -
325   - all_total_m = parseFloat(all_total_m).toFixed(2);
326   - all_order_m = parseFloat(all_order_m).toFixed(2);
327   - all_price = parseFloat(all_price).toFixed(2);
328   - all_total_m = parseFloat(all_total_m).toFixed(2);
329   -
330   - var atxt = "formData.total_amount";
331   - var atxt1 = "formData.order_amount";
332   - var atxt2 = "formData.all_price";
333   -
334   - th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m,
335   - [atxt2]: all_price,show_submit:1
336   - })
337   - th.data.order_prom_list_cart=c_arr;
338   - wx.hideLoading();
339   - });
340   - },
341   -
342   - //---------计算立即购买----------
343   - calculatePrice2: function () {
344   - console.log('calculatePrice2');
345   - var th = this, good = this.data.bn_goods;
346   - //-----------计算商品总价--------------
347   - var allpice = good.shop_price * good.buynum;
348   - allpice=parseFloat(allpice).toFixed(2);
349   - var txt = "formData.all_price";
350   - th.setData({ [txt]: allpice, });
351   -
352   - var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
353   - //-----------------总价-----------------
354   - var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price);
355   - total_m = parseFloat(total_m).toFixed(2);
356   -
357   - var atxt= "formData.total_amount";
358   - th.setData({ [atxt]: total_m, })
359   - var order_m = total_m;
360   - var txt = "formData.user_money";
361   - var txt2 = "formData.order_amount";
362   -
363   - th.setData({ [txt]: 0, [txt2]: order_m })
364   -
365   - },
366   -
367   - submitForm:function(){
368   - var th=this;
369   - this.sendsm(function(){
  377 +
  378 +
  379 + all_total_m = parseFloat(all_total_m).toFixed(2);
  380 + all_order_m = parseFloat(all_order_m).toFixed(2);
  381 + all_price = parseFloat(all_price).toFixed(2);
  382 + all_total_m = parseFloat(all_total_m).toFixed(2);
  383 +
  384 + var atxt = "formData.total_amount";
  385 + var atxt1 = "formData.order_amount";
  386 + var atxt2 = "formData.all_price";
  387 +
  388 + th.setData({
  389 + [atxt]: all_total_m,
  390 + [atxt1]: all_order_m,
  391 + [atxt2]: all_price,
  392 + show_submit: 1
  393 + })
  394 + th.data.order_prom_list_cart = c_arr;
  395 + wx.hideLoading();
  396 + });
  397 + },
  398 +
  399 + //---------计算立即购买----------
  400 + calculatePrice2: function() {
  401 + console.log('calculatePrice2');
  402 + var th = this,
  403 + good = this.data.bn_goods;
  404 + //-----------计算商品总价--------------
  405 + var allpice = good.shop_price * good.buynum;
  406 + allpice = parseFloat(allpice).toFixed(2);
  407 + var txt = "formData.all_price";
  408 + th.setData({
  409 + [txt]: allpice,
  410 + });
  411 +
  412 + var o_shipping_price = 0,
  413 + goods_weight = -1,
  414 + goods_piece = -1;
  415 + //-----------------总价-----------------
  416 + var total_m = parseFloat(allpice) + parseFloat(th.data.formData.shipping_price);
  417 + total_m = parseFloat(total_m).toFixed(2);
  418 +
  419 + var atxt = "formData.total_amount";
  420 + th.setData({
  421 + [atxt]: total_m,
  422 + })
  423 + var order_m = total_m;
  424 + var txt = "formData.user_money";
  425 + var txt2 = "formData.order_amount";
  426 +
  427 + th.setData({
  428 + [txt]: 0,
  429 + [txt2]: order_m
  430 + })
  431 +
  432 + },
  433 +
  434 + submitForm: function() {
  435 + var th = this;
  436 + this.sendsm(function() {
370 437 th.submit_func();
371 438 })
372 439 },
373   -
374   - //--------------------提交订单-----------------------
375   - submit_func: async function(){
376   -
377   - if(this.data.is_summit_ing==1) return false; //--提交中退出--
378   - this.data.is_summit_ing=1;
379   - var th=this,pdata=new Array();
380   -
381   - var item={
382   - 'user_id': to.globalData.user_id,
383   - 'account': th.data.formData.order_amount, //使用余额
384   - 'store_id':oo.stoid, //商家
385   - 'list':new Array(),
386   - };
387   -
388   - //判断是不是购物车购买还是立即购买
389   - if(this.data.is_cart){
390   - var list= th.data.cartlist;
391   - for(var i in list){
392   - var gglist = list[i].goods;
393   - for(var j in gglist){
394   - var gg=gglist[j];
395   - if(!gg.pick_id){
396   - getApp().showWarning("未找到门店");
397   - return false;
398   - }
399   -
400   - var goods={
401   - 'card_id': gg.service_id,
402   - 'itemid': gg.erpItemID,
403   - 'qty': gg.goods_num,
404   - 'price': gg.money,
405   - 'pickup_id':gg.pick_id,
406   - 'pickup_keyid':list[i].keyid,
407   - };
408   - //--导购分享过来的id--
409   - if(gg.guide_id){
410   - goods.guide_id=gg.guide_id;
411   - goods.guide_type=gg.guide_type;
412   - //调用接口判断是不是会员
413   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
414   - if(res.data.code==0){
415   - goods.guide_name=res.data.data.salesman;
416   - goods.guide_sn=res.data.data.salesman_no;
417   - }
418   - })
419   - }
420   - item.list.push(goods);
421   - }
422   - }
423   - }else{
424   - var gg = getApp().globalData.service_now;
425   - if(!gg.pick_id){
426   - getApp().showWarning("未找到门店");
427   - return false;
428   - }
429   -
430   - var goods={
431   - 'card_id': th.data.bn_goods.id,
432   - 'itemid': th.data.bn_goods.erpItemID,
433   - 'qty': gg.goods_num,
434   - 'price': th.data.formData.order_amount,
435   - 'pickup_id':gg.pick_id,
436   - 'pickup_keyid':gg.keyid,
437   - };
438   -
439   - //--导购分享过来的id--
440   - if(gg.guide_id){
441   - goods.guide_id=gg.guide_id;
442   - goods.guide_type=gg.guide_type;
443   - //调用接口判断是不是会员
444   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
445   - if(res.data.code==0){
446   - goods.guide_name=res.data.data.salesman;
447   - goods.guide_sn=res.data.data.salesman_no;
448   - }
449   - })
450   - }
451   - item.list.push(goods);
452   - }
453   -
454   -
455   - pdata=item;
456   - var str = JSON.stringify(pdata);
457   - console.log("支付数据");
458   - console.log(str);
459   - //return false;
460   - wx.showLoading({title: "加载中"});
461   - wx.request({
462   - url: oo.url + '/api/weshop/recharge/saveRecharge',
463   - data: str,
464   - method: 'POST',
465   - header: {
466   - 'content-type': 'application/json'
467   - },// 设置请求的 header
468   - success: function (res) {
469   -
470   - wx.hideLoading();
471   - if (res.statusCode == 200) {
472   - var data=res.data;
473   - if(data.code==0){
474   - if(th.data.is_cart){
475   - var list = th.data.cartlist_y;
476   - for (var i = 0; i < list.length; i++) {
477   - //删除购物车
478   - a.delete("/api/weshop/cartService/del/" + oo.stoid + "/" + list[i].id, {});
479   - }
480   - }
481   - var order_amount = pdata.account;
482   - //要进行判断,如果是用微信支付,就要跳转到支付界面
483   - if (order_amount > 0) {
484   - th.setData({ isclose: 0 });
485   -
486   - getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
487   - data: {
488   - parentSn: data.data.order_sn,
489   - store_id: oo.stoid
490   - },
491   - success: function (su) {
492   - var n=su.data.data;
493   - th.weixinPay(n,
494   - function () {
495   - getApp().showWarning("购买成功");
496   - setTimeout(function () {
497   - wx.reLaunch({
498   - url: "/pages/user/my_service/i_service",
499   - })
500   - },1000)
501   - }, function () {
502   - getApp().showWarning("支付失败");
503   - setTimeout(function () {
504   - wx.reLaunch({
505   - url: "/packageA/pages/cardList/cardList",
506   - })
507   - },1000)
508   - })
509   - }
510   - })
511   - }
512   - }
513   - else{
514   - th.data.is_summit_ing=0; //是否提交中
515   - getApp().confirmBox(data.msg);
516   - }
517   - } else {
518   - th.data.is_summit_ing=0; //是否提交中
519   - console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
520   - }
521   - },
522   - fail: function () {
523   - th.data.is_summit_ing=0; //是否提交中
524   - wx.hideLoading();
525   - console.log("index.js wx.request CheckCallUser fail");
526   - },
527   - complete: function () {}
528   - })
529   - },
530   -
531   - cart_set_err: function (e) {
  440 +
  441 + //--------------------提交订单-----------------------
  442 + submit_func: async function() {
  443 +
  444 + if (this.data.is_summit_ing == 1) return false; //--提交中退出--
  445 + this.data.is_summit_ing = 1;
  446 + var th = this,
  447 + pdata = new Array();
  448 +
  449 + var item = {
  450 + 'user_id': to.globalData.user_id,
  451 + 'account': th.data.formData.order_amount, //使用余额
  452 + 'store_id': oo.stoid, //商家
  453 + 'list': new Array(),
  454 + };
  455 +
  456 + //判断是不是购物车购买还是立即购买
  457 + if (this.data.is_cart) {
  458 + var list = th.data.cartlist;
  459 + for (var i in list) {
  460 + var gglist = list[i].goods;
  461 + for (var j in gglist) {
  462 + var gg = gglist[j];
  463 + if (!gg.pick_id) {
  464 + getApp().showWarning("未找到门店");
  465 + return false;
  466 + }
  467 + var goods = {
  468 + 'card_id': gg.service_id,
  469 + 'itemid': gg.erpItemID,
  470 + 'qty': gg.goods_num,
  471 + 'price': gg.money,
  472 + 'pickup_id': gg.pick_id,
  473 + 'pickup_keyid': list[i].keyid,
  474 + };
  475 + //--导购分享过来的id--
  476 + if (gg.guide_id) {
  477 + goods.guide_id = gg.guide_id;
  478 + goods.guide_type = gg.guide_type;
  479 + //调用接口判断是不是会员
  480 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(
  481 + res => {
  482 + if (res.data.code == 0) {
  483 + goods.guide_name = res.data.data.salesman;
  484 + goods.guide_sn = res.data.data.salesman_no;
  485 + }
  486 + })
  487 + }
  488 + item.list.push(goods);
  489 + }
  490 + }
  491 + } else {
  492 + var gg = getApp().globalData.service_now;
  493 + if (!gg.pick_id) {
  494 + getApp().showWarning("未找到门店");
  495 + return false;
  496 + }
  497 + var goods = {
  498 + 'card_id': th.data.bn_goods.id,
  499 + 'itemid': th.data.bn_goods.erpItemID,
  500 + 'qty': gg.goods_num,
  501 + 'price': th.data.bn_goods.money,
  502 + // 'price': th.data.formData.order_amount,
  503 + 'pickup_id': gg.pick_id,
  504 + 'pickup_keyid': gg.keyid,
  505 + };
  506 +
  507 + //--导购分享过来的id--
  508 + if (gg.guide_id) {
  509 + goods.guide_id = gg.guide_id;
  510 + goods.guide_type = gg.guide_type;
  511 + //调用接口判断是不是会员
  512 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(
  513 + res => {
  514 + if (res.data.code == 0) {
  515 + goods.guide_name = res.data.data.salesman;
  516 + goods.guide_sn = res.data.data.salesman_no;
  517 + }
  518 + })
  519 + }
  520 + item.list.push(goods);
  521 + }
  522 +
  523 +
  524 + pdata = item;
  525 + var str = JSON.stringify(pdata);
  526 + console.log("支付数据");
  527 + console.log(str);
  528 + //return false;
  529 + wx.showLoading({
  530 + title: "加载中"
  531 + });
  532 + wx.request({
  533 + url: oo.url + '/api/weshop/recharge/saveRecharge',
  534 + data: str,
  535 + method: 'POST',
  536 + header: {
  537 + 'content-type': 'application/json'
  538 + }, // 设置请求的 header
  539 + success: function(res) {
  540 +
  541 + wx.hideLoading();
  542 + if (res.statusCode == 200) {
  543 + var data = res.data;
  544 + if (data.code == 0) {
  545 + // console.log('myyyyyyyyyyyyyyyyyy', data.data);
  546 + if (th.data.is_cart) {
  547 + var list = th.data.cartlist_y;
  548 + for (var i = 0; i < list.length; i++) {
  549 + //删除购物车
  550 + a.delete("/api/weshop/cartService/del/" + oo.stoid + "/" + list[i].id, {});
  551 + }
  552 + }
  553 + var order_amount = pdata.account;
  554 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  555 + if (order_amount > 0) {
  556 + th.setData({
  557 + isclose: 0
  558 + });
  559 +
  560 + getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
  561 + data: {
  562 + parentSn: data.data.order_sn,
  563 + store_id: oo.stoid
  564 + },
  565 + success: function(su) {
  566 + var n = su.data.data;
  567 + let order_id = data.data.order_id;
  568 + th.weixinPay(n,
  569 + function() {
  570 + getApp().showWarning("购买成功");
  571 + setTimeout(function() {
  572 + wx.reLaunch({
  573 + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id,
  574 + })
  575 + }, 1000)
  576 + },
  577 + function() {
  578 + getApp().showWarning("支付失败");
  579 + setTimeout(function() {
  580 + wx.reLaunch({
  581 + url: "/pages/user/order_list/order_list?index=2&tabindex=1",
  582 + })
  583 + }, 1000)
  584 + })
  585 + }
  586 + })
  587 + }
  588 + } else {
  589 + th.data.is_summit_ing = 0; //是否提交中
  590 + getApp().confirmBox(data.msg);
  591 + }
  592 + } else {
  593 + th.data.is_summit_ing = 0; //是否提交中
  594 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  595 + }
  596 + },
  597 + fail: function() {
  598 + th.data.is_summit_ing = 0; //是否提交中
  599 + wx.hideLoading();
  600 + console.log("index.js wx.request CheckCallUser fail");
  601 + },
  602 + complete: function() {}
  603 + })
  604 + },
  605 +
  606 + cart_set_err: function(e) {
532 607 var txt = e.currentTarget.dataset.err;
533 608 var ob = {};
534 609 ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
535 610 this.setData(ob);
536 611 },
537   -
  612 +
538 613 //------调起支付框--------
539   - weixinPay: function (n, success, fail) {
540   - if(!n) return false;
541   - wx.requestPayment({
542   - timeStamp: String(n.timeStamp),
543   - nonceStr: n.nonceStr,
544   - package: n.packageValue,
545   - signType: n.signType,
546   - paySign: n.paySign,
547   - success: function (n) {
548   - console.log(n), getApp().showSuccess("支付成功!");
549   - "function" == typeof success && success();
550   - wx.redirectTo({
551   - url: "../deposit/deposit"
552   - });
553   - },
554   - fail: function (n) {
555   - console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
556   - "function" == typeof fail && fail();
557   - }
558   - });
  614 + weixinPay: function(n, success, fail) {
  615 + if (!n) return false;
  616 + wx.requestPayment({
  617 + timeStamp: String(n.timeStamp),
  618 + nonceStr: n.nonceStr,
  619 + package: n.packageValue,
  620 + signType: n.signType,
  621 + paySign: n.paySign,
  622 + success: function(n) {
  623 + console.log(n), getApp().showSuccess("支付成功!");
  624 + "function" == typeof success && success();
  625 + wx.redirectTo({
  626 + url: "../deposit/deposit"
  627 + });
  628 + },
  629 + fail: function(n) {
  630 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") :
  631 + "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n
  632 + .errMsg.substr("requestPayment:fail ".length)),
  633 + "function" == typeof fail && fail();
  634 + }
  635 + });
559 636 },
560   -
  637 +
561 638 //订阅消息提醒
562   - sendsm:function(func)
563   - {
564   - var template_id = this.data.template_id;
565   - // //授权订阅
566   - wx.requestSubscribeMessage({
567   - tmplIds: [template_id],
568   - success(res) {
569   - func();
570   - },
571   - fail(res) {
572   - func();
573   - }
574   - })
575   -
576   - },
577   -
578   -
  639 + sendsm: function(func) {
  640 + var template_id = this.data.template_id;
  641 + // //授权订阅
  642 + wx.requestSubscribeMessage({
  643 + tmplIds: [template_id],
  644 + success(res) {
  645 + func();
  646 + },
  647 + fail(res) {
  648 + func();
  649 + }
  650 + })
  651 +
  652 + },
  653 +
  654 +
579 655 });
... ...
packageA/pages/details_serviceCard/details_serviceCard.js
1 1 // packageA/pages/details_serviceCard/details_serviceCard.js
  2 +const app = getApp();
  3 +const os = app.globalData.setting;
  4 +let self = null;
  5 +
2 6 Page({
3 7  
4   - /**
5   - * 页面的初始数据
6   - */
7   - data: {
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + is_summit_ing: 0,
  13 + },
  14 +
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function(options) {
  19 + self = this;
  20 + this.data.options = options;
  21 +
  22 + wx.setNavigationBarTitle({
  23 + title: '订单详情',
  24 + });
  25 +
  26 + app.isLogin().then(function(data) {
  27 + self.setData({
  28 + userInfo: data,
  29 + });
  30 + self.getConfig();
  31 + });
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面初次渲染完成
  36 + */
  37 + onReady: function() {
  38 +
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面显示
  43 + */
  44 + onShow: function() {
  45 + if (app.globalData.userInfo) {
  46 + if (!this.data.isLogin) {
  47 + this.setData({
  48 + userInfo: app.globalData.userInfo,
  49 + imghost: app.globalData.setting.imghost,
  50 + isLogin: true,
  51 + });
  52 +
  53 + let url = '/api/weshop/recharge/user/page'
  54 + let data = {
  55 + store_id: app.globalData.setting.stoid,
  56 + user_id: this.data.userInfo.user_id,
  57 + order_id: this.data.options.order_id,
  58 + };
  59 +
  60 + // 请求数据
  61 + app.promiseGet(url, {
  62 + data: data,
  63 + }).then(res => {
  64 + if (res.data.code == 0) {
  65 + // console.log('请求成功', res);
  66 + this.setData({
  67 + details: res.data.data.pageData[0],
  68 + });
  69 + } else {
  70 + throw (res);
  71 + };
  72 + }).catch(err => {
  73 + wx.showToast({
  74 + title: err.data.data,
  75 + icon: 'error',
  76 + });
  77 + });
  78 +
  79 + };
  80 + };
  81 + },
  82 +
  83 + /**
  84 + * 生命周期函数--监听页面隐藏
  85 + */
  86 + onHide: function() {
  87 +
  88 + },
  89 +
  90 + /**
  91 + * 生命周期函数--监听页面卸载
  92 + */
  93 + onUnload: function() {
  94 +
  95 + },
  96 +
  97 + /**
  98 + * 页面相关事件处理函数--监听用户下拉动作
  99 + */
  100 + onPullDownRefresh: function() {
  101 +
  102 + },
  103 +
  104 + /**
  105 + * 页面上拉触底事件的处理函数
  106 + */
  107 + onReachBottom: function() {
  108 +
  109 + },
  110 +
  111 + /**
  112 + * 用户点击右上角分享
  113 + */
  114 + onShareAppMessage: function() {
  115 +
  116 + },
  117 +
  118 +
  119 + // 内容复制到剪贴板
  120 + copy() {
  121 + // console.log('点击了复制按钮');
  122 + wx.setClipboardData({
  123 + data: this.data.details.order_sn,
  124 + success(res) {
  125 + wx.getClipboardData({
  126 + success(res) {
  127 + console.log(res.data);
  128 + }
  129 + })
  130 + }
  131 + })
  132 + },
  133 +
  134 +
  135 + // 图片异常时加载默认图片
  136 + bind_bnerr(e) {
  137 + var errImg = e.currentTarget.dataset.errorimg;
  138 + var errObj = {};
  139 + errObj[errImg] = 'public/images/default_goods_image_240.gif';
  140 + this.setData(errObj); // this.setData({ details.list[0].img_url});
  141 + },
  142 +
  143 +
  144 + // 查看商品详情
  145 + viewDetails(e) {
  146 + let goods_id = e.currentTarget.dataset.gid;
  147 + let url = '/packageA/pages/goodsInfo/goodsInfo?goods_id=' + goods_id;
  148 + app.goto(url);
  149 + },
  150 +
  151 + // 获取系统参数
  152 + getConfig() {
  153 + app.getConfig2(function(e) {
  154 + // console.log('101',e);
  155 + let json_d = JSON.parse(e.switch_list);
  156 + self.setData({
  157 + sys_switch: json_d,
  158 + // weapp_customertype: json_d.weapp_customertype,
  159 + });
  160 + }, 1);
  161 + },
  162 +
  163 +
  164 + // 联系微信客服
  165 + contact_wx() {
  166 + var url = this.data.sys_switch.weapp_customertype_url;
  167 + var id = this.data.sys_switch.weapp_customertype_appid;
  168 + wx.openCustomerServiceChat({
  169 + extInfo: {
  170 + url: url
  171 + },
  172 + corpId: id,
  173 + success(res) {}
  174 + })
  175 + },
  176 +
  177 +
  178 + // 联系电话客服
  179 + contactService() {
  180 + app.getConfig(function(t) {
  181 + if (t.store_tel == undefined) {
  182 + app.request.get('/api/weshop/store/get/' + os.stoid, {
  183 + isShowLoading: 1,
  184 + data: {},
  185 + success: function(rs) {
  186 + app.globalData.config = rs.data.data;
  187 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  188 + app.my_warnning('商家未设置电话', 0, self);
  189 + return false;
  190 + }
  191 + app.confirmBox('请联系客服:' + rs.data.data.store_tel);
  192 + }
  193 + })
  194 + } else {
  195 + app.confirmBox('请联系客服:' + t.store_tel);
  196 + }
  197 + });
  198 + },
  199 +
  200 +
  201 + // 评价商品
  202 + access() {
  203 + let listLength = this.data.details.list.length;
  204 + let order_id = this.data.details.order_id;
  205 + let url = '';
  206 +
  207 + // 卡项订单跳转到评论页要多加个参数card=1
  208 + // 卡项订单goods_id要带card_id
  209 + if (listLength == 1) {
  210 + let price = this.data.details.list[0].price;
  211 + let card_id = this.data.details.list[0].card_id;
  212 + url =
  213 + `/packageB/pages/user/add_comment/add_comment?card=1&goods_id=${card_id}&order_id=${order_id}&price=${price}`
  214 + };
  215 + if (listLength > 1) {
  216 + url = `/packageB/pages/user/comment/comment?card=1&status=0&order_id=${order_id}`;
  217 + };
  218 + f
  219 + // console.log('url', url);
  220 + app.goto(url);
  221 + },
  222 +
  223 +
  224 + // 查看评论
  225 + viewComment() {
  226 + let order_id = this.data.details.order_id;
  227 + let card_id = this.data.details.list[0].card_id;
  228 + let listLength = this.data.details.list.length;
  229 + let url = '';
  230 +
  231 + // 卡项订单单个商品
  232 + if (listLength == 1) {
  233 + url = `/packageB/pages/user/view_comment/view_comment?card=1&goods_id=${card_id}&order_id=${order_id}`;
  234 + };
  235 + // 卡项订单多个商品
  236 + if (listLength > 1) {
  237 + // status控制评论列表页的activeStatus
  238 + url = `/packageB/pages/user/comment/comment?card=1&status=1&order_id=${order_id}`;
  239 + };
  240 +
  241 + app.goto(url);
  242 + },
  243 +
  244 +
  245 + // 再来一单
  246 + buy2(t) {
  247 + let details = this.data.details;
  248 + var th = this;
  249 + var ind = 1; // 1:加入购物车
  250 + // var ind = t.currentTarget.dataset.openSpecModal_ind;
  251 + // var action= t.currentTarget.dataset.action;
  252 + var action = 'add'; //
  253 + // if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
  254 +
  255 + th.setData({
  256 + open_ind_store: ind
  257 + });
  258 +
  259 + // if(!th.data.sto_sele_name){
  260 + // getApp().my_warnning('请选择门店', 1, th, 450);
  261 + // return false;
  262 + // }
  263 +
  264 +
  265 + if (action == "buy") {
  266 + //--------------此时操作的数据------------
  267 + // var newd = {
  268 + // id: th.data.data.id,
  269 + // goods_num: th.data.goodsInputNum,
  270 + // pick_id: th.data.sto_sele_id,
  271 + // keyid: th.data.sto_sele_keyid,
  272 + // };
  273 + // newd['pick_name'] = th.data.sto_sele_name;
  274 + // newd['guide_id'] = getApp().globalData.guide_id;
  275 + // newd['guide_type']=0;
  276 + // th.buyNow(newd);
  277 + } else {
  278 +
  279 + var newd = {
  280 + // service_id: th.data.data.id,
  281 + // service_sn:th.data.data.service_sn,
  282 + // service_name:th.data.data.goods_name,
  283 + // goods_num: th.data.goodsInputNum,
  284 + // pick_id: th.data.sto_sele_id,
  285 + // user_id:oo.user_id,
  286 + // store_id:os.stoid,
  287 + // money:th.data.data.shop_price,
  288 +
  289 + service_id: details.list[0].card_id,
  290 + service_sn: details.list[0].service_sn,
  291 + service_name: details.list[0].service_name,
  292 + goods_num: details.list[0].qty,
  293 + pick_id: details.list[0].pickup_id,
  294 + user_id: this.data.userInfo.user_id,
  295 + store_id: app.globalData.setting.stoid,
  296 + money: details.list[0].price,
  297 + };
  298 + if (getApp().globalData.guide_id) {
  299 + newd['guide_id'] = getApp().globalData.guide_id;
  300 + newd['guide_type'] = 0;
  301 + }
  302 +
  303 + //----先看会员在购物车中是否加入了该商品-----
  304 + app.request.get("/api/weshop/cartService/page", {
  305 + data: {
  306 + store_id: app.globalData.setting.stoid,
  307 + user_id: this.data.userInfo.user_id,
  308 + service_id: details.list[0].card_id,
  309 + pick_id: details.list[0].pickup_id,
  310 + },
  311 + success: function(re) {
  312 +
  313 + //-------如果购物车中有相关的数据---------
  314 + if (re.data.data.total > 0) {
  315 + var item = re.data.data.pageData[0];
  316 + var updata = {
  317 + id: item.id,
  318 + goods_num: details.list[0].qty + item.goods_num,
  319 + money: details.list[0].price,
  320 + store_id: app.globalData.setting.stoid,
  321 + };
  322 +
  323 + if (getApp().globalData.guide_id) {
  324 + updata['guide_id'] = getApp().globalData.guide_id;
  325 + updata['guide_type'] = 1;
  326 + }
  327 + getApp().request.put("/api/weshop/cartService/update", {
  328 + data: updata,
  329 + success: function(t) {
  330 + // getApp().my_warnning('加入购物车成功', 1, th, 450);
  331 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  332 + th.setData({
  333 + cartGoodsNum: c_num
  334 + });
  335 + app.goto('/pages/cart/cart/cart');
  336 + // th.closeSpecModal();
  337 + }
  338 + });
  339 + } else {
  340 +
  341 + getApp().request.post("/api/weshop/cartService/save", {
  342 + data: newd,
  343 + success: function(t) {
  344 + // getApp().my_warnning('加入购物车成功', 1, th, 450);
  345 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  346 + th.setData({
  347 + cartGoodsNum: c_num
  348 + });
  349 + app.goto('/pages/cart/cart/cart');
  350 + // th.closeSpecModal();
  351 + }
  352 + });
  353 + }
  354 + }
  355 + });
  356 +
  357 + }
  358 + },
  359 +
  360 +
  361 + // 取消订单
  362 + // api/weshop/recharge/update?store_id=&order_id=&order_status=3
  363 + cancle() {
  364 + wx.showModal({
  365 + title: '提示',
  366 + content: '确定取消订单吗?',
  367 + success(res) {
  368 + if (res.confirm) {
  369 + console.log('用户点击确定');
  370 + let order_id = self.data.details.order_id;
  371 + let order_sn = self.data.details.order_sn;
  372 + app.request.put('/api/weshop/recharge/update', {
  373 + data: {
  374 + store_id: os.stoid,
  375 + order_id: order_id,
  376 + order_sn: order_sn,
  377 + order_status: 3,
  378 + },
  379 + success: function(res) {
8 380  
9   - },
  381 + //取消成功刷新订单
  382 + let url = '/api/weshop/recharge/user/page'
  383 + let data = {
  384 + store_id: app.globalData.setting.stoid,
  385 + user_id: self.data.userInfo.user_id,
  386 + order_id: self.data.options.order_id,
  387 + };
10 388  
11   - /**
12   - * 生命周期函数--监听页面加载
13   - */
14   - onLoad: function (options) {
  389 + // 请求数据
  390 + app.promiseGet(url, {
  391 + data: data,
  392 + }).then(res => {
  393 + if (res.data.code == 0) {
  394 + console.log('请求成功', res);
  395 + wx.showToast({
  396 + title: '取消成功',
  397 + });
  398 + self.setData({
  399 + details: res.data.data.pageData[0],
  400 + });
  401 + } else {
  402 + throw (res);
  403 + };
  404 + }).catch(err => {
  405 + wx.showToast({
  406 + title: err.data.data,
  407 + icon: 'error',
  408 + });
  409 + });
15 410  
16   - },
  411 + },
  412 + })
  413 + } else if (res.cancel) {
  414 + console.log('用户点击取消');
  415 + }
  416 + }
  417 + });
  418 + },
17 419  
18   - /**
19   - * 生命周期函数--监听页面初次渲染完成
20   - */
21   - onReady: function () {
22 420  
23   - },
  421 + // 立即支付
  422 + pay() {
  423 + let order_sn = this.data.details.order_sn;
  424 + let order_id = this.data.details.order_id;
  425 + let store_id = app.globalData.setting.stoid;
24 426  
25   - /**
26   - * 生命周期函数--监听页面显示
27   - */
28   - onShow: function () {
  427 + app.request.post('/api/weshop/order/pay/createRechargeOrder', {
  428 + data: {
  429 + parentSn: order_sn,
  430 + store_id: store_id,
  431 + },
29 432  
30   - },
  433 + success: function(res) {
  434 + var n = res.data.data;
  435 + self.weixinPay(n, function() {
  436 + app.showWarning('支付成功');
  437 + setTimeout(function() {
  438 + wx.reLaunch({
  439 + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id,
  440 + })
  441 + }, 1000)
  442 + }, function() {
  443 + app.showWarning('支付失败');
  444 + // setTimeout(function() {
  445 + // wx.reLaunch({
  446 + // url: '/packageA/pages/cardList/cardList',
  447 + // })
  448 + // }, 1000)
  449 + });
  450 + }
  451 + })
  452 + },
31 453  
32   - /**
33   - * 生命周期函数--监听页面隐藏
34   - */
35   - onHide: function () {
36 454  
37   - },
  455 + //------调起支付框--------
  456 + weixinPay: function(n, success, fail) {
  457 + if (!n) return false;
  458 + wx.requestPayment({
  459 + timeStamp: String(n.timeStamp),
  460 + nonceStr: n.nonceStr,
  461 + package: n.packageValue,
  462 + signType: n.signType,
  463 + paySign: n.paySign,
  464 + success: function(n) {
  465 + console.log(n), getApp().showSuccess("支付成功!");
  466 + "function" == typeof success && success();
  467 + wx.redirectTo({
  468 + url: "../deposit/deposit"
  469 + });
  470 + },
  471 + fail: function(n) {
  472 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") :
  473 + "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n
  474 + .errMsg.substr("requestPayment:fail ".length)),
  475 + "function" == typeof fail && fail();
  476 + }
  477 + });
  478 + },
38 479  
39   - /**
40   - * 生命周期函数--监听页面卸载
41   - */
42   - onUnload: function () {
43 480  
44   - },
45 481  
46   - /**
47   - * 页面相关事件处理函数--监听用户下拉动作
48   - */
49   - onPullDownRefresh: function () {
50 482  
51   - },
52 483  
53   - /**
54   - * 页面上拉触底事件的处理函数
55   - */
56   - onReachBottom: function () {
57 484  
58   - },
59 485  
60   - /**
61   - * 用户点击右上角分享
62   - */
63   - onShareAppMessage: function () {
64 486  
65   - }
66   -})
67 487 \ No newline at end of file
  488 +})
... ...
packageA/pages/details_serviceCard/details_serviceCard.wxml
  1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  2 +
1 3 <view class="main">
2 4 <view class="bg-white pdh20 bdr12">
3   - <!-- 门店名称栏 -->
4   - <view class="flex jc_sb ai_c pdv20">
5   - <view class="ellipsis-1 pdr40 fs30"><text class="iconfont icon-shop c-red pdr10"></text>门店名称名称名称名称名称名称名称名称名称名称</view>
6   - <text class="c-red shrink0 fs26">待评价</text>
7   - </view>
8   - <!-- 列表栏 -->
9   - <view>
10   - <view class="flex pdv20">
11   - <view class="pic-box shrink0"><image class="img-block" src="../../images/wx2.png"></image></view>
12   - <view class="pdl20 f1">
13   - <view class="flex jc_sb ai_c">
14   - <view class="title ellipsis-2 pdr40">我是商品标题</view>
15   - <text class="rmb c-6">10</text>
  5 + <block wx:for="{{details.list}}">
  6 + <!-- 门店名称栏 -->
  7 + <view class="flex jc_sb ai_c pdv20">
  8 + <view class="ellipsis-1 pdr40 fs30"><text class="iconfont icon-shop c-red pdr10"></text>{{item.pickup_name}}</view>
  9 + <!-- 订单状态 -->
  10 + <block>
  11 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 0}}">待支付</text>
  12 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 1}}">待评价</text>
  13 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 2}}">已评价</text>
  14 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 3}}">已取消</text>
  15 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 5}}">已作废</text>
  16 + </block>
  17 + </view>
  18 +
  19 + <!-- 列表栏 -->
  20 + <view>
  21 + <!-- <view class="flex pdv20" wx:for="{{details.list}}" bindtap="viewDetails" data-gid="{{item.card_id}}"> -->
  22 + <view class="flex pdv20" bindtap="viewDetails" data-gid="{{item.card_id}}">
  23 + <view class="pic-box shrink0">
  24 + <image class="img-block" src="{{imghost + item.img_url}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="details.list[{{index}}].img_url"></image>
16 25 </view>
17   - <view class="flex jc_sb ai_c c-9 fs24">
18   - <text>10个/蓝色</text>
19   - <text>x1</text>
  26 + <view class="pdl20 f1">
  27 + <view class="flex jc_sb ai_c">
  28 + <view class="title ellipsis-2 pdr40">{{item.service_name}}</view>
  29 + <text class="rmb c-6">{{item.price}}</text>
  30 + </view>
  31 + <view class="flex jc_sb ai_c c-9 fs24">
  32 + <!-- <text>10个/蓝色</text> -->
  33 + <text>x{{item.qty}}</text>
  34 + </view>
20 35 </view>
21 36 </view>
22 37 </view>
23   - </view>
  38 + </block>
  39 +
  40 +
24 41 <!-- 统计栏 -->
25   - <view class="t-r bdt pdv20">共2件商品,合计:<text class="rmb c-red bold fs30">21.00</text></view>
  42 + <view class="t-r bdt pdv20">共{{filter.count(details.list)}}件商品,合计:<text class="rmb c-red bold fs30">{{details.account}}</text></view>
26 43 </view>
  44 +
  45 +
27 46 <view class="bg-white pdh20 mgt20 bdr12">
28 47 <!-- 订单信息栏 -->
29 48 <view class="pdv20">订单信息</view>
  49 +
30 50 <view class="flex jc_sb pdb20 ai_c">
31   - <view><text class="c-9">订单编号:</text>fwk20221252125222212 </view>
32   - <text class="btn-copy">复制</text>
  51 + <view><text class="c-9">订单编号:</text>{{details.order_sn}}</view>
  52 + <text class="btn-copy" bindtap="copy">复制</text>
33 53 </view>
34   - <view class="pdb20"><text class="c-9">下单时间:</text>2021-12-27 18:00:00</view>
  54 + <view class="pdb20"><text class="c-9">下单时间:</text>{{filter.format_time(details.ctime, 1)}}</view>
  55 +
35 56 <!-- 联系客服栏 -->
36 57 <view class="flex t-c bdt">
37   - <view class="f1 pd20"><text class="iconfont icon-kefu c29f pdr20"></text>联系客服</view>
38   - <view class="f1 pd20 separator"><text class="iconfont icon-tongbu c-orange pdr20"></text>卡项同步</view>
  58 + <!-- 客服 -->
  59 + <block>
  60 + <button class="f1" wx:if="{{sys_switch.weapp_customertype == 1}}" hover-class="none" open-type="contact"
  61 + session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</button>
  62 + <view class="f1 pd20" wx:elif="{{sys_switch.weapp_customertype== 2}}" bindtap="contact_wx"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
  63 + <view class="f1 pd20" wx:else bindtap="contactService"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
  64 + </block>
  65 + <!-- 卡项同步先不做 -->
  66 + <!-- <view class="f1 pd20 separator"><text class="iconfont icon-tongbu c-orange pdr20"></text>卡项同步</view> -->
39 67 </view>
40 68 </view>
  69 +
41 70 <!-- 底部按钮栏 -->
42 71 <view class="btn-bar t-r bg-white pd20">
43   - <text class="btn btn-border">立即评价</text>
44   - <text class="btn bg-red white mgl20">再来一单</text>
  72 + <!-- 待支付 -->
  73 + <block wx:if="{{details.order_status == 0}}">
  74 + <text class="btn btn-border" bindtap="cancle">取消订单</text>
  75 + <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text>
  76 + </block>
  77 + <!-- 已支付/未评价 -->
  78 + <block wx:if="{{details.order_status == 1}}">
  79 + <text class="btn bg-orange white" bindtap="buy2">再来一单</text>
  80 + <text class="btn bg-red white mgl20" bindtap="access">立即评价</text>
  81 + </block>
  82 + <!-- 已评价 -->
  83 + <block wx:if="{{details.order_status == 2}}">
  84 + <text class="btn bg-orange white" bindtap="buy2">再来一单</text>
  85 + <text class="btn bg-red white mgl20" bindtap="viewComment">查看评价</text>
  86 + </block>
45 87 </view>
46 88 </view>
... ...
packageA/pages/details_serviceCard/details_serviceCard.wxss
... ... @@ -18,6 +18,7 @@ page {
18 18 border: 2rpx solid #808080;
19 19 }
20 20  
  21 +
21 22 .bg-red {
22 23 background-image: -webkit-linear-gradient(315deg,#f2140c,#f2270c 70%,#f24d0c);
23 24 background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c);
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -8,6 +8,9 @@ var t = require(&quot;../../../utils/util.js&quot;),
8 8 oo = s.globalData,
9 9 o = s.globalData.setting,
10 10 os = o;
  11 +
  12 +let self = null;
  13 +
11 14 //评价加载更多
12 15 var more = function(e) {
13 16 return e && e.__esModule ? e : {
... ... @@ -54,11 +57,14 @@ Page({
54 57 shippingCost: 0,
55 58 enterAddressPage: !1,
56 59 categories: [{
57   - name: "商品",
  60 + name: "卡项",
58 61 id: 0
59 62 }, {
60 63 name: "详情",
61 64 id: 1
  65 + },{
  66 + name: "评价",
  67 + id: 2
62 68 }],
63 69 activeCategoryId2: 0,
64 70 categories2: [{
... ... @@ -68,7 +74,7 @@ Page({
68 74 name: "规格参数",
69 75 id: 1
70 76 }],
71   - activeCategoryId3: 1,
  77 + activeCategoryId3: 1, // 点击评价-全部、有图、好评、中评时对应的id
72 78 categories3: [{
73 79 name: "全部",
74 80 id: 1,
... ... @@ -148,7 +154,16 @@ Page({
148 154 current: 0, //图片计数
149 155 swiperCurrent: 0, //轮播的下标
150 156 hiddenn: 0, //控制轮播计数显示
151   -
  157 +
  158 + currentTab: 0, // 选择器控制参数
  159 + mapurl: "",
  160 + mapurl_f_img: "",
  161 + videopicture: 0, //视频图片的控制
  162 +
  163 + video: 0, //视频图片切换器
  164 + index: 0,
  165 + noon: 0, //开始视频的隐藏
  166 +
152 167 screenWidth: 0,
153 168 canvasHidden: 1,
154 169  
... ... @@ -195,60 +210,62 @@ Page({
195 210  
196 211 //------初始化加载----------
197 212 onLoad: function(t) {
198   -
199   - // console.log("--服务卡项--");
200   - // console.log('fdsfasfasf111111111111111====================',t);
201   -
202   -
203   -
  213 +
  214 + self = this;
  215 + this.data.options = t; // { goods_id: ...}
  216 +
  217 +
204 218 var ee = this,
205 219 that = ee,
206 220 th = ee,
207 221 gid = t.goods_id,
208 222 first_leader=t.first_leader;
209 223  
  224 +
210 225 //-- 自定义海报 --
211   - getApp().request.promiseGet("/api/weshop/goods/poster/page", {
212   - data:{store_id:os.stoid, type:1, is_use:1}
213   - }).then(res=>{
214   - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){
215   - var poster_data=res.data.data.pageData[0];
216   - var json_str=poster_data.jsonStr;
217   - if(json_str){
218   - var json_data=JSON.parse(json_str);
219   - if(json_data.bg_img){
220   - //-- 把图片那到本地 --
221   - wx.getImageInfo({
222   - src:json_data.bg_img,
223   - success: function(res) {
224   - var path= res.path;
225   - th.setData({share_b_img:path})
226   - },
227   - fail: function(res) {}
228   - });
229   - }
230   - th.setData({poster:json_data})
231   - }
232   - }
233   - })
  226 + // getApp().request.promiseGet("/api/weshop/goods/poster/page", {
  227 + // data:{store_id:os.stoid, type:1, is_use:1}
  228 + // }).then(res=>{
  229 + // if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){
  230 + // var poster_data=res.data.data.pageData[0];
  231 + // var json_str=poster_data.jsonStr;
  232 + // if(json_str){
  233 + // var json_data=JSON.parse(json_str);
  234 + // if(json_data.bg_img){
  235 + // //-- 把图片那到本地 --
  236 + // wx.getImageInfo({
  237 + // src:json_data.bg_img,
  238 + // success: function(res) {
  239 + // var path= res.path;
  240 + // th.setData({share_b_img:path})
  241 + // },
  242 + // fail: function(res) {}
  243 + // });
  244 + // }
  245 + // th.setData({poster:json_data})
  246 + // }
  247 + // }
  248 + // })
  249 +
234 250  
235 251 //---获取手机地址坐标--
236 252 //--如果tg_id是空的话,分享回来--
237 253 if (gid == undefined || gid == null || gid == "") {
238   - var gid_str = decodeURIComponent(t.scene);
  254 + var gid_str = decodeURIComponent(t.scene);
239 255 gid_str=gid_str.split("_");
240 256 gid=gid_str[0];
241 257 if(gid_str.length>1){
242 258 first_leader=gid_str[1];
243 259 }
244   - //-- 如果有room_id的获取 --
245   - if(gid_str.length>2 && gid_str[2]){
246   - room_id=gid_str[2];
247   - room_user_share=1;
248   - }
249   -
250   - }
  260 + //-- 如果有room_id的获取 --
  261 + if(gid_str.length>2 && gid_str[2]){
  262 + room_id=gid_str[2];
  263 + room_user_share=1;
  264 + }
  265 + };
  266 +
251 267 ee.setData({ gid: gid});
  268 +
252 269 if(first_leader){
253 270 getApp().globalData.first_leader=first_leader;
254 271 //调用接口判断是不是会员
... ... @@ -268,21 +285,76 @@ Page({
268 285 })
269 286  
270 287 //----获取系统参数-----
271   - getApp().getConfig2(function(e) {
272   -
  288 + getApp().getConfig2(function (e) {
  289 + ee.setData({
  290 + bconfig: e,
  291 + sales_rules: e.sales_rules,
  292 + });
  293 +
  294 + if (e.categoryset.indexOf("," + 1 + ",") != -1) {
  295 + ee.setData({
  296 + is_show_pl: 1
  297 + });
  298 + }
  299 + if (e.categoryset.indexOf("," + 3 + ",") != -1) {
  300 + ee.setData({
  301 + is_show_pp: 1
  302 + });
  303 + }
  304 + if (e.categoryset.indexOf("," + 2 + ",") != -1) {
  305 + ee.setData({
  306 + is_show_gb: 1
  307 + });
  308 + }
  309 + console.log(e);
273 310 var json_d = JSON.parse(e.switch_list);
274 311 ee.setData({
275 312 store_config: e,
276   - sys_switch:json_d,
  313 + sys_switch: json_d,
  314 + is_closecoupon: json_d.is_closecoupon,
  315 + is_newsales_rules: json_d.is_newsales_rules
277 316 });
278   -
279   -
  317 + ee.init(gid);
  318 + //------几人评价-------
  319 + //n.init(th, "", "comments");
  320 +
280 321 th.requestCardNum(), wx.pageScrollTo && th.setData({
281 322 supportPageScroll: !0
282 323 });
283   -
284   -
285   - },1);
  324 +
  325 + //计算等级价相关
  326 + // var swithc_list = e.switch_list;
  327 + // var sw_arr = JSON.parse(swithc_list);
  328 + // //---如果后台又开等级卡的开关---
  329 + // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  330 + // th.setData({ rank_switch: true });
  331 + // //---回调卡的列表---
  332 + // th.getPlusCardType(function (ob) {
  333 + // th.setData({ card_list: ob.card_list });
  334 + // var ti = setInterval(function () {
  335 + // var user = getApp().globalData.userInfo;
  336 + // if (!user) return false;
  337 + // clearInterval(ti);
  338 + // if (user.card_field && user['card_expiredate']) {
  339 + // var str = user['card_expiredate'].replace(/-/g, '/');
  340 + // var end = new Date(str);
  341 + // end = Date.parse(end) / 1000;
  342 + // var now = ut.gettimestamp();
  343 + // //--- 判断是等级会员,且在有效期范围内 ---
  344 + // if (user.card_field && now < end) {
  345 + // var card_name = ob.name_map.get(user.card_field);
  346 + // //if(card_name.length>6) card_name=card_name.substring(0,6);
  347 +
  348 + // var is_near_date = 0;
  349 + // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
  350 + // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
  351 + // }
  352 + // }
  353 + // }, 500)
  354 + // })
  355 + // }
  356 +
  357 + }, 1);
286 358  
287 359 //获取用户设备信息,屏幕宽度
288 360 wx.getSystemInfo({
... ... @@ -376,20 +448,175 @@ Page({
376 448  
377 449 },
378 450 //------------程序初始化入口-------------
379   - async init(gid) {},
  451 + async init(gid) {
  452 + var ee = this,
  453 + th = ee,
  454 + gallery = null,
  455 + is_collect = 0,
  456 + collect_id = 0,
  457 + categories3 = ee.data.categories3,
  458 + fir_com = null,
  459 + fir_quan = null,
  460 + mapurl = null,
  461 + mapurl_f_img = null;
  462 +
  463 +
  464 + //------图片滚动----------
  465 + // await getApp().request.promiseGet("/api/weshop/goodsimages/page", {
  466 + // data: {
  467 + // store_id: os.stoid,
  468 + // goods_id: gid,
  469 + // },
  470 + // }).then(res => {
  471 +
  472 + // var t = res;
  473 + // var g = t.data.data.pageData;
  474 + // if (g.length == 0) {
  475 + // var ie = {
  476 + // "image_url": o.imghost + "/public/images/default_goods_image_240.gif"
  477 + // };
  478 + // g.push(ie);
  479 + // gallery = g;
  480 + // return;
  481 + // }
  482 + // for (var i = 0; i < g.length; i++) {
  483 + // if (g[i].image_url.indexOf(o.imghost) == -1)
  484 + // g[i].image_url = o.imghost + g[i].image_url;
  485 + // }
  486 + // gallery = g;
  487 + // })
  488 +
  489 +
  490 + //------是否收藏----------
  491 + await getApp().request.promiseGet("/api/weshop/goodscollect/page", {
  492 + data: {
  493 + store_id: os.stoid,
  494 + goods_id: gid,
  495 + user_id: oo.user_id,
  496 + }
  497 + }).then(res => {
  498 + var t = res;
  499 + var data = t.data.data.pageData;
  500 + if (data && data.length > 0) {
  501 + //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, });
  502 + is_collect = 1;
  503 + collect_id = data[0].collect_id;
  504 + }
  505 + })
  506 +
  507 + //------获取评价的统计数量----
  508 + await getApp().request.promiseGet("/api/weshop/serviceComment/countlist/", {
  509 + data: {
  510 + store_id: os.stoid,
  511 + service_id: gid
  512 + },
  513 + //failRollback: !0,
  514 +
  515 + }).then(res => {
  516 + console.log('get评价统计数量', res.data.data);
  517 + var t = res;
  518 + var g = t.data.data[0];
  519 + if (g != null && g != undefined) {
  520 + var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5;
  521 + var num2 = g.c4 + g.c5;
  522 + var num3 = g.c3;
  523 + var num4 = g.c0 + g.c1 + g.c2;
  524 +
  525 + var dd = ee.data.categories3;
  526 + dd[0].num = allnum;
  527 + dd[1].num = g.cimg;
  528 + dd[2].num = num2;
  529 + dd[3].num = num3;
  530 + dd[4].num = num4;
  531 +
  532 + categories3 = dd;
  533 + }
  534 + })
  535 +
  536 + //----获取详情页的评价----
  537 + await getApp().request.promiseGet("/api/weshop/serviceComment/pageComment", {
  538 + data: {
  539 + store_id: os.stoid,
  540 + service_id: gid,
  541 + pageSize: 3,
  542 + parent_id: 0,
  543 + page: 1,
  544 + is_show: 1,
  545 + },
  546 + }).then(res => {
  547 + console.log('get详情页评价', res.data.data);
  548 + fir_com = res.data.data.pageData;
  549 + })
  550 +
  551 + if (fir_com) {
  552 + for (var ind in fir_com) {
  553 + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png";
  554 + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img);
  555 + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img);
  556 + }
  557 + }
  558 +
  559 + // if (th.data.is_closecoupon != 1 && (!th.data.fir_quan || th.data.fir_quan.length<=0)) {
  560 + // //----获取详情页的券的数量----
  561 + // await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", {
  562 + // data: {
  563 + // store_id: os.stoid,
  564 + // type: 1,
  565 + // pageSize: 3,
  566 + // page: 1,
  567 + // is_share: 0,
  568 + // },
  569 + // }).then(res1 => {
  570 + // fir_quan = res1.data.data.pageData;
  571 + // })
  572 + // }
  573 +
  574 +
  575 + //this.getHistoryBuy(); //获取历史购买
  576 + ee.setData({
  577 + is_collect: is_collect,
  578 + collect_id: collect_id,
  579 + categories3: categories3,
  580 + fir_quan: fir_quan,
  581 + fir_comments: fir_com,
  582 + // cardComments: fir_com,
  583 + });
  584 +
  585 + },
380 586  
381 587 //---展示---
  588 + // gid 在onload阶段已经保存在this.data中
382 589 onShow: function() {
383 590 var that=this;
384   - this.data.is_timer = 1;
385 591 var ee = this,gid = this.data.gid, i = getApp().request;
386   - this.wait_for_store_config();
  592 + this.data.is_timer = 1;
  593 + this.wait_for_store_config();
387 594  
388 595 i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
389 596 failRollback: !0,
390 597 success: function(t) {
391 598 if (t.data.code == 0) {
392   -
  599 + // console.log('GET pic and video');
  600 + if(t.data.data.listServiceVideos && t.data.data.listServiceVideos[0] && t.data.data.listServiceVideos[0].video_url) {
  601 + that.setData({
  602 + mapurl: t.data.data.listServiceVideos[0].video_url,
  603 + });
  604 + };
  605 + if(t.data.data.listServiceVideos && t.data.data.listServiceVideos[0] && t.data.data.listServiceVideos[0].video_img) {
  606 + that.setData({
  607 + mapurl_f_img: t.data.data.listServiceVideos[0].video_img,
  608 + });
  609 + };
  610 + if(t.data.data.listServiceImages) {
  611 + that.setData({
  612 + gallery: t.data.data.listServiceImages,
  613 + });
  614 + };
  615 + if(t.data.data.listServiceItem) {
  616 + that.setData({
  617 + listServiceItem: t.data.data.listServiceItem,
  618 + });
  619 + };
393 620 that.setData({
394 621 'data.goods_name': t.data.data.serviceName,
395 622 'data.shop_price': t.data.data.money,
... ... @@ -401,9 +628,14 @@ Page({
401 628 'data.sales_sum': t.data.data.sales_sum,
402 629 'data.storageId':t.data.data.storageId,
403 630 'data.service_sn':t.data.data.serviceSn,
  631 + 'data.listServiceVideos': t.data.data.listServiceVideos,
  632 + // gallery: t.data.data.listServiceImages,
  633 + // mapurl: t.data.data.listServiceVideos[0].video_url,
  634 + // mapurl_f_img: t.data.data.listServiceVideos[0].video_img,
  635 + //listServiceItem: t.data.data.listServiceItem,
404 636 });
405 637  
406   -
  638 + console.log('0xxxxx999999', t.data.data);
407 639 //-----商品详情---
408 640 if(!t.data.data.serviceContent) t.data.data.serviceContent=" ";
409 641 a.wxParse("content", "html", t.data.data.serviceContent, ee, 6);
... ... @@ -433,9 +665,10 @@ Page({
433 665 }
434 666 });
435 667 this.data.enterAddressPage && (this.data.enterAddressPage = !1);
436   - this.get_sto();
  668 + this.get_sto();
437 669  
438 670 },
  671 +
439 672 enterAddress: function() {
440 673 this.data.enterAddressPage = !0, wx.navigateTo({
441 674 url: "/pages/user/address_list/address_list?operate=selectAddress"
... ... @@ -697,6 +930,7 @@ Page({
697 930 user_id: s.globalData.user_id,
698 931 store_id: o.stoid,
699 932 add_time: timestamp,
  933 + type: 1,
700 934 };
701 935 //加入收藏夹就是导购的ID
702 936 if(getApp().globalData.guide_id){
... ... @@ -797,7 +1031,7 @@ Page({
797 1031 }
798 1032  
799 1033  
800   - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  1034 + var url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
801 1035 if(getApp().globalData.user_id){
802 1036 url+="&first_leader="+getApp().globalData.user_id;
803 1037 }
... ... @@ -815,25 +1049,25 @@ Page({
815 1049 path:url,
816 1050 imageUrl: img,
817 1051 };
818   - if(th.data.prom_type==6){
819   - title+='\n'+th.data.prom_act.share_remark;
820   - ob.title=title;
821   - ob.desc=th.data.prom_act.share_remark;
822   - }
  1052 + // if(th.data.prom_type==6){
  1053 + // title+='\n'+th.data.prom_act.share_remark;
  1054 + // ob.title=title;
  1055 + // ob.desc=th.data.prom_act.share_remark;
  1056 + // }
823 1057  
824 1058 //如果是积分购的时候
825   - if(th.data.prom_type==4){
826   - var name = th.data.prom_act.name;
827   - //-- 积分购的 --
828   - var pri0 = th.data.prom_act.addmoney;
829   - var integral=th.data.prom_act.integral;
830   - var text="";
831   - if(integral){text=integral+"积分"; }
832   - if(pri0 && integral){ text+="+";}
833   - if(pri0){ text+="¥"+pri0;}
  1059 + // if(th.data.prom_type==4){
  1060 + // var name = th.data.prom_act.name;
  1061 + // //-- 积分购的 --
  1062 + // var pri0 = th.data.prom_act.addmoney;
  1063 + // var integral=th.data.prom_act.integral;
  1064 + // var text="";
  1065 + // if(integral){text=integral+"积分"; }
  1066 + // if(pri0 && integral){ text+="+";}
  1067 + // if(pri0){ text+="¥"+pri0;}
834 1068  
835   - ob.title= text+" "+name;
836   - }
  1069 + // ob.title= text+" "+name;
  1070 + // }
837 1071  
838 1072 return ob;
839 1073  
... ... @@ -1642,7 +1876,7 @@ Page({
1642 1876  
1643 1877 // ----视频图片----
1644 1878 // 图片计数器
1645   - swiperChange: function(e) {
  1879 + swiperChange: function (e) {
1646 1880 var that = this;
1647 1881 if (e.detail.current > 0) {
1648 1882 that.setData({
... ... @@ -1661,6 +1895,31 @@ Page({
1661 1895 })
1662 1896 }
1663 1897 },
  1898 +
  1899 + /*---视频相关--*/
  1900 + videopicture: function (e) {
  1901 + var vipi = e.currentTarget.dataset.vipi;
  1902 + this.setData({
  1903 + videopicture: vipi,
  1904 + swiperCurrent: vipi,
  1905 + noon: 0,
  1906 + current: 1
  1907 + });
  1908 + },
  1909 +
  1910 + videoPlay: function (e) {
  1911 + var _index = e.currentTarget.id
  1912 + this.setData({
  1913 + _index: _index,
  1914 + noon: 1
  1915 + })
  1916 +
  1917 + setTimeout(function () {
  1918 + //将点击视频进行播放
  1919 + var videoContext = wx.createVideoContext(_index)
  1920 + videoContext.play();
  1921 + }, 500)
  1922 + },
1664 1923  
1665 1924 //--获取头像的本地缓存,回调写法--
1666 1925 get_head_temp: function(tt, func) {
... ... @@ -2244,10 +2503,210 @@ Page({
2244 2503 corpId: id,
2245 2504 success(res) {}
2246 2505 })
2247   - }
2248   -
2249   -
  2506 + },
  2507 +
  2508 + //评论的调用
  2509 + requestComments_new: async function () {
  2510 + var e = this, th = e, ee = e; var tp = e.data.activeCategoryId3;
  2511 + var t = '/api/weshop/serviceComment/pageComment?page=' + e.data.c_curr_p;
  2512 +
  2513 + wx.showLoading();
  2514 + var req_where = {
  2515 + store_id: o.stoid, pageSize: 5, is_show: 1,
  2516 + parent_id: 0, goods_id: th.data.gid, commenttype: tp,
  2517 + service_id: this.data.gid,
  2518 + }
  2519 + if (getApp().globalData.userInfo) {
  2520 + req_where.userId = getApp().globalData.user_id;
  2521 + }
  2522 +
  2523 + var rs_data = null;
  2524 + await getApp().request.promiseGet(t, { data: req_where }).then(res => {
  2525 + var tot = res.data.data.total;
  2526 + e.data.c_curr_p++;
  2527 + e.setData({
  2528 + com_num: tot, //已经有加载
  2529 + });
  2530 + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
  2531 + rs_data = res.data.data.pageData;
  2532 + } else {
  2533 + th.setData({ comments_no_more: 1, auto: 1 });
  2534 + }
  2535 + })
  2536 +
  2537 + if (rs_data) {
  2538 + //var cda = th.data.comments;
  2539 + var cda = rs_data, com_data = th.data.comments;
  2540 + for (var ind in cda) {
  2541 + var ep = cda[ind];
  2542 + if (cda[ind].head_pic == '') {
  2543 + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png";
  2544 + }
  2545 + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) {
  2546 + cda[ind].weapp_img = JSON.parse(ep.weapp_img);
  2547 + }
  2548 + if (ep.img != "" && ut.isString(ep.img)) {
  2549 + cda[ind].img = ut.unserialize(ep.img);
  2550 + }
  2551 +
  2552 + //--测量多有字的宽带,计算有多少行--
  2553 + var widh = ut.measureText(ep.content, 30);
  2554 + var lines = widh / 712;
  2555 + cda[ind].seeMore = false;
  2556 + if (lines > 3) cda[ind].seeMore = true;
  2557 +
  2558 + await getApp().request.promiseGet("/api/weshop/serviceComment/pageComment", {
  2559 + data: {
  2560 + store_id: o.stoid,
  2561 + parent_id: ep.comment_id,
  2562 + service_id: this.data.gid,
  2563 + }
  2564 + }).then(res => {
  2565 + if (res.data.data.pageData && res.data.data.pageData.length > 0) {
  2566 + cda[ind].replay_list = res.data.data.pageData;
  2567 + }
  2568 + })
  2569 + }
  2570 +
  2571 + if (!com_data) com_data = cda;
  2572 + else com_data = com_data.concat(cda);
  2573 +
  2574 + th.setData({ comments: com_data });
  2575 + }
  2576 + th.setData({ get_c: 1 });
  2577 + wx.hideLoading();
  2578 + },
  2579 +
  2580 +
  2581 +
  2582 + //--点赞功能--
  2583 + click_zan: function (e) {
  2584 + var com_id = e.currentTarget.dataset.com_id;
  2585 + var item_id = e.currentTarget.dataset.item_id;
  2586 + var app = getApp(),
  2587 + th = this;
  2588 +
  2589 + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) {
  2590 + app.confirmBox("您还未登录");
  2591 + return false;
  2592 + }
  2593 +
  2594 + var iszan = th.data.comments[item_id].userZanNum;
  2595 + if (this.data.iszaning) return false;
  2596 + this.data.iszaning = 1;
  2597 +
  2598 +
  2599 + app.request.post("/api/weshop/serviceCommentZan/save", {
  2600 + data: {
  2601 + store_id: o.stoid,
  2602 + user_id: app.globalData.user_id,
  2603 + goods_id: th.data.gid,
  2604 + service_id: th.data.gid,
  2605 + comment_id: com_id
  2606 + },
  2607 + success: function (ee) {
  2608 +
  2609 + if (ee.data.code == "-1") {
  2610 + app.my_warnning("不能给自己点赞", 0, th);
  2611 + th.data.iszaning = 0;
  2612 + return;
  2613 + }
  2614 +
  2615 + if (ee.data.code == 0 && iszan != 1) {
  2616 + var num = th.data.comments[item_id].zan_num;
  2617 + num++;
  2618 + var text = "comments[" + item_id + "].zan_num";
  2619 + var text1 = "comments[" + item_id + "].userZanNum";
  2620 + var _errObj = {};
  2621 + _errObj[text] = num;
  2622 + _errObj[text1] = 1;
  2623 + th.setData(_errObj);
  2624 +
  2625 + } else {
  2626 + var num = th.data.comments[item_id].zan_num;
  2627 + num--;
  2628 + var text = "comments[" + item_id + "].zan_num";
  2629 + var text1 = "comments[" + item_id + "].userZanNum";
  2630 + var _errObj = {};
  2631 + _errObj[text] = num;
  2632 + _errObj[text1] = 0;
  2633 + th.setData(_errObj);
  2634 + }
  2635 +
  2636 + setTimeout(function () {
  2637 + th.data.iszaning = 0;
  2638 + }, 500)
  2639 +
  2640 + }
  2641 + })
  2642 + },
  2643 +
  2644 +
  2645 + //--外侧评价的点击效果---
  2646 + clik_evaluate: function (e) {
  2647 + var val = e.currentTarget.dataset.val;
  2648 + this.setData({
  2649 + activeCategoryId: 2,
  2650 + activeCategoryId3: val,
  2651 + comments: null
  2652 + });
  2653 + this.requestComments_new();
  2654 + },
  2655 +
  2656 +
  2657 + //显示全部
  2658 + toggleHandler: function (e) {
  2659 + var that = this,
  2660 + index = e.currentTarget.dataset.index;
  2661 + for (var i = 0; i < that.data.comments.length; i++) {
  2662 + if (index == i) {
  2663 + for (var i = 0; i < that.data.comments.length; i++) {
  2664 + that.data.comments[index].auto = true;
  2665 + that.data.comments[index].seeMore = false;
  2666 + }
  2667 + }
  2668 + }
  2669 + that.setData({
  2670 + comments: that.data.comments
  2671 + })
  2672 + },
  2673 +
  2674 + //收起更多
  2675 + toggleContent: function (e) {
  2676 + var that = this,
  2677 + index = e.currentTarget.dataset.index;
  2678 + for (var i = 0; i < that.data.comments.length; i++) {
  2679 + if (index == i) {
  2680 + that.data.comments[index].auto = true;
  2681 + that.data.comments[index].seeMore = true;
  2682 + }
  2683 + }
  2684 + that.setData({
  2685 + comments: that.data.comments
  2686 + })
  2687 + },
  2688 +
  2689 + //--查看评价--
  2690 + look_pj: function () {
  2691 + this.tabComment();
  2692 + this.doScrollTop();
  2693 + },
  2694 +
  2695 + previewCommentImgs_w: function (t) {
  2696 + var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img;
  2697 + var b = e.slice()
  2698 + // for (var i in b) {
  2699 + // b[i] = this.data.iurl + e[i];
  2700 + // }
  2701 + this.data.show_prew_img = 1;
  2702 + wx.previewImage({
  2703 + current: b[t.currentTarget.dataset.id],
  2704 + urls: b
  2705 + });
  2706 + },
  2707 +
2250 2708  
  2709 +
2251 2710 });
2252 2711  
2253 2712  
... ...
packageA/pages/goodsInfo/goodsInfo.json
... ... @@ -4,6 +4,6 @@
4 4 "usingComponents": {
5 5 "nav_box": "/components/nav_box/nav_box",
6 6 "warn": "/components/long_warn/long_warn",
7   - "goods_recommend": "/components/goods_list/goods_list"
  7 + "serviceCard_recommend": "/components/serviceCard_list/serviceCard_list"
8 8 }
9 9 }
10 10 \ No newline at end of file
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -15,7 +15,44 @@
15 15 </view>
16 16 <view class="goods-detail">
17 17 <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}">
18   - <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove">
  18 +
  19 + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:if="{{mapurl}}">
  20 + <view class="xc-videos-picture rel">
  21 + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
  22 + <swiper-item wx:if="{{mapurl}}">
  23 + <view wx:if="{{noon == 0}}">
  24 + <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit">
  25 + <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image>
  26 + </image>
  27 + </view>
  28 + <view wx:else>
  29 + <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video>
  30 + </view>
  31 + </swiper-item>
  32 + <swiper-item wx:for="{{gallery}}" wx:key="gallery">
  33 + <view class="wh100 g_img_box" style="background-image:url({{iurl}}{{data.image_url?data.image_url:'miniapp/images/default_g_img.gif'}});"></view>
  34 + </swiper-item>
  35 + </swiper>
  36 + <block wx:if="{{mapurl}}">
  37 + <view wx:if="{{hiddenn==1}}">
  38 + <view class="xc-imageCount">{{current}}/{{gallery.length}}</view>
  39 + </view>
  40 + <view class="xc-video-picture abs">
  41 + <view class="xc-video" data-vipi="0" bindtap="videopicture">
  42 + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}">
  43 + 视频
  44 + </view>
  45 + </view>
  46 + <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture">
  47 + <view>图片</view>
  48 + </view>
  49 + </view>
  50 + </block>
  51 + </view>
  52 + </view>
  53 +
  54 +
  55 + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove" wx:else>
19 56 <view class="xc-videos-picture rel">
20 57 <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}"
21 58 indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange">
... ... @@ -27,7 +64,8 @@
27 64 </view>
28 65 </view>
29 66  
30   - <block>
  67 +
  68 + <!-- <block> -->
31 69  
32 70 <view class="goods-price rel">
33 71 <view class="co-red" style="overflow: hidden">
... ... @@ -35,7 +73,7 @@
35 73 </view>
36 74  
37 75 <view>
38   - <view class="co-red"><text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
  76 + <view class="co-red"><text class="rel yuan fs28">¥</text>{{filters.toFix(data.shop_price,2)}}</view>
39 77 <view class="goods-title">
40 78 <view class="goods-name elli">{{data.goods_name}}</view>
41 79 </view>
... ... @@ -47,7 +85,7 @@
47 85 </view>
48 86  
49 87 </view>
50   - </block>
  88 + <!-- </block> -->
51 89  
52 90  
53 91  
... ... @@ -101,7 +139,60 @@
101 139  
102 140  
103 141  
104   -
  142 + <!-- - 宝贝评价 -- -->
  143 + <view class="bdt16">
  144 + <view class="bb_view">
  145 + <view class="bold">宝贝评价({{categories3[0].num}})</view>
  146 + <view class="red_bb fs26" bindtap="look_pj">
  147 + 查看全部
  148 + <text class="bg_jj"></text>
  149 + </view>
  150 + </view>
  151 + <view class="xc_comment">
  152 + <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate">
  153 + 有图({{categories3[1].num}})
  154 + </view>
  155 + <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate">
  156 + 好评({{categories3[2].num}})
  157 + </view>
  158 + <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate">
  159 + 中评({{categories3[3].num}})
  160 + </view>
  161 + <view class="xc_comment-discuss" data-val="4" bindtap="clik_evaluate">
  162 + 差评({{categories3[4].num}})
  163 + </view>
  164 + </view>
  165 + <scroll-view scroll-x="true" class="pj_scroll">
  166 + <view class="flex">
  167 + <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="{{item}}">
  168 + <view class="xc_comment-left">
  169 + <view class="xc_comment-user">
  170 + <view class="xc_user-img">
  171 + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image>
  172 + </view>
  173 + <view class="xc_user">
  174 + <view class="xc_user-name five-level-word">
  175 + {{item.is_anonymous!=1?item.username:'匿名'}}
  176 + </view>
  177 + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
  178 + </view>
  179 + </view>
  180 + <view class="xc_comment-font pj_word_size ellipsis-1 pdt12">
  181 + <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}}</text>
  182 + </view>
  183 + <view class="xc_comment-val">
  184 + <view class="xc_comment-time">{{item.add_time}}</view>
  185 + </view>
  186 + </view>
  187 + <view class="xc_goods-img-frame">
  188 + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image>
  189 + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image>
  190 + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image>
  191 + </view>
  192 + </view>
  193 + </view>
  194 + </scroll-view>
  195 + </view>
105 196  
106 197  
107 198  
... ... @@ -110,7 +201,25 @@
110 201 <view class="red_shu"></view>
111 202 <view class="fs30 bold">商品详情</view>
112 203 </view>
113   - <view class="pd20">
  204 + <view class="pdh20">
  205 +
  206 + <view wx:if="{{listServiceItem && listServiceItem.length > 0}}">
  207 + <view class="card fs28" wx:for="{{listServiceItem}}">
  208 + <view class="flex ai_c jc_sb" style="height: 88rpx;">
  209 + <view class="ellipsis-2">{{item.projectName}}({{item.frequency}}次)</view>
  210 + <view class="pdl30 t-r">
  211 + <view class="rmb fs36 bold c-red" wx:if="{{item.money}}">{{item.money}}</view>
  212 + <view class="fs22 c-9" wx:if="{{item.showPrice}}">零售价:¥{{item.showPrice}}</view>
  213 + </view>
  214 + </view>
  215 + <view class="flex ai_c jc_sb fs24 c-6">
  216 + <view class="ellipsis-1">备注:{{filters.show_default(item.remark, '无')}}</view>
  217 + <!-- <view class="pdl30 shrink0">有效期:50天/2022-02-02</view> -->
  218 + </view>
  219 + </view>
  220 +
  221 + </view>
  222 +
114 223 <view class="table_s" wx:if="{{service_list}}">
115 224 <view class="tb_item tb-l">
116 225 <view class="item_left f1">
... ... @@ -141,8 +250,20 @@
141 250 </view>
142 251  
143 252 </view>
  253 +
  254 + <!-- 推荐商品 -->
  255 + <view class="flex-center rel xc-linellae-frame">
  256 + <view class="xc-linellae"></view>
  257 + <view class="abs flex-center xc-recommend-frame ">
  258 + <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png"></image>
  259 + <view class="xc-recommend-word">推荐</view>
  260 + </view>
  261 + </view>
  262 + <serviceCard_recommend id="goods_list"></serviceCard_recommend>
  263 +
144 264 </view>
145 265  
  266 +
146 267 <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}">
147 268 <view class="pd20">
148 269 <view class="table_s" wx:if="{{service_list}}">
... ... @@ -176,36 +297,122 @@
176 297  
177 298 </view>
178 299 </view>
179   -
  300 +
  301 + <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}">
  302 + <view class="topframe">
  303 + <view class="topframe-top">
  304 + <view class="topframe-top-content">
  305 + <view>宝贝评价</view>
  306 + <view class="topframe-top-val">({{categories3[0].num}})</view>
  307 + </view>
  308 + <view class="topframe-praise" wx:if="{{categories3[0].num}}">
  309 + 好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}%
  310 + </view>
  311 + <view wx:else>好评 0%</view>
  312 + </view>
  313 + <view class="buttem-list">
  314 + <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}">
  315 + {{item.name}}({{item.num}})
  316 + </view>
  317 + </view>
  318 + </view>
  319 + <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="{{cIdx}}">
  320 + <view style='border-bottom:4rpx solid #eee;'>
  321 + <view class="middle">
  322 + <view class="middle-img-frame">
  323 + <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image>
  324 + <view class="middle-user-frame">
  325 + <view class="middle-user">
  326 + {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}
  327 + </view>
  328 + <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image>
  329 + </view>
  330 + </view>
  331 + <view class="xc-pirces">
  332 + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" style="word-break: break-all;">
  333 + {{item.content?item.content:'此用户没有填写评价。'}}
  334 + </view>
  335 + </view>
  336 + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>
  337 + 全部显示
  338 + </view>
  339 + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>
  340 + 收起
  341 + </view>
  342 + <view class="img-ul">
  343 + <block wx:if="{{item.source_type==0}}">
  344 + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}">
  345 + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image>
  346 + </view>
  347 + </block>
  348 + <block wx:if="{{item.source_type==1}}">
  349 + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem">
  350 + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image>
  351 + </view>
  352 + </block>
  353 + </view>
  354 + <view class="z_parameter">
  355 + <view class="parameter-font">{{item.add_time}}</view>
  356 + <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}">
  357 + <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image>
  358 + <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image>
  359 + <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}'>
  360 + {{item.zan_num}}
  361 + </view>
  362 + </view>
  363 + </view>
  364 + </view>
  365 + <view class="reply rel" wx:if="{{item.replay_list}}">
  366 + <view class="line_bulge"></view>
  367 + <view class="shop-reply">店家回复:</view>
  368 + <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
  369 + {{r_item.content}}
  370 + </view>
  371 + </view>
  372 + </view>
  373 + </block>
  374 + <block wx:if="{{(!comments || comments.length==0) && get_c }}">
  375 + <text class="no_pj_list">暂无评价</text>
  376 + </block>
  377 + <block wx:if="{{comments.length>10 && comments_no_more}}">
  378 + <text class="no_pj_list">已经加载到底部</text>
  379 + </block>
  380 + </view>
180 381 </view>
181 382 </view>
182 383 <!---滚动到顶部---->
183   - <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
  384 + <!-- <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}">
184 385 <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image>
185   - </view>
  386 + </view> -->
186 387  
187 388 <!-- 底部按钮 -->
188   - <view class="join-cart jc_sb">
  389 + <view class="join-cart jc_sb ai_c">
189 390  
190 391 <view class="flex">
191   - <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split f1" open-type="contact"
192   - session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}" style="text-align: center">
  392 + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split pdh20" open-type="contact"
  393 + session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}">
193 394 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
194 395 <view>客服</view>
195 396 </button>
196 397  
197   - <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split f1" bindtap="con_weixin"
  398 + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split pdh20" bindtap="con_weixin"
198 399 style="text-align: center">
199 400 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
200 401 <view>客服</view>
201 402 </view>
202 403  
203   - <view wx:else class="custom-service cart-ico new_split f1" bindtap="contactService" style="text-align: center">
  404 + <view wx:else class="custom-service cart-ico new_split pdh20" bindtap="contactService" style="text-align: center">
204 405 <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image>
205 406 <view>客服</view>
206 407 </view>
  408 +
  409 + <view bindtap="collectGoods" class="custom-service cart-ico new_split t-c pdh20">
  410 + <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image>
  411 + <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image>
  412 + <view>收藏</view>
  413 + </view>
207 414  
208   - <view class="shopping-cart cart-ico new_split f1">
  415 + <view class="shopping-cart cart-ico new_split pdh20">
209 416 <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center">
210 417 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
211 418 <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>
... ... @@ -215,8 +422,7 @@
215 422 </view>
216 423  
217 424  
218   - <view class="flex f1 pdh20">
219   -
  425 + <view class="flex f1 btn-group">
220 426 <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn f1">加入购物车</view>
221 427 <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn f1">立即购买</view>
222 428 </view>
... ...
packageA/pages/goodsInfo/goodsInfo.wxss
... ... @@ -361,15 +361,18 @@ image {
361 361  
362 362 }
363 363  
364   -.join-cart>view {
365   - width: 29%;
  364 +.join-cart > view {
  365 + /* width: 29%; */
366 366 }
367 367  
368   -.join-cart>.new_split {
369   - width: 13%;
370   - text-align: center;
371   - padding: 0;
372   - margin: 0;
  368 +.join-cart .new_split {
  369 + /* width: 13%; */
  370 + /* text-align: center; */
  371 + /* padding: 20rpx; */
  372 + /* box-sizing: border-box; */
  373 + /* flex-shrink: 0; */
  374 + /* padding: 0;
  375 + margin: 0; */
373 376 }
374 377  
375 378 .cart-ico {
... ... @@ -384,13 +387,13 @@ image {
384 387 .cs-img {
385 388 width: 45rpx;
386 389 height: 40rpx;
387   - margin-top: 15rpx;
  390 + /* margin-top: 15rpx; */
388 391 }
389 392  
390 393 .sc-img {
391 394 width: 42rpx;
392 395 height: 40rpx;
393   - margin-top: 15rpx;
  396 + /* margin-top: 15rpx; */
394 397 }
395 398  
396 399 .cart-num {
... ... @@ -410,7 +413,7 @@ image {
410 413 font-size: 28rpx;
411 414 color: #fff;
412 415 line-height: 70rpx;
413   - margin-top: 16rpx;
  416 + /* margin-top: 16rpx; */
414 417 text-align: center;
415 418  
416 419  
... ... @@ -419,8 +422,8 @@ image {
419 422 .join-btn {
420 423 background-color: #ffb03f;
421 424 height: 70rpx;
422   -border-radius: 55rpx 0rpx 0rpx 55rpx;
423   -margin-top: 16rpx;
  425 +/* border-radius: 55rpx 0rpx 0rpx 55rpx;
  426 +margin-top: 16rpx; */
424 427  
425 428  
426 429 }
... ... @@ -432,7 +435,7 @@ view.cart-btn-lg {
432 435 .buy-btn {
433 436 background-color: #f23030;
434 437 height: 70rpx;
435   -border-radius: 0 56rpx 55rpx 0;
  438 +/* border-radius: 0 56rpx 55rpx 0; */
436 439  
437 440 }
438 441  
... ... @@ -1206,7 +1209,7 @@ left:31rpx;}
1206 1209 /* 回复 */
1207 1210 .reply{
1208 1211 width: 95%;
1209   - height: 120rpx;
  1212 + /* height: 120rpx; */
1210 1213 padding-top: 14rpx;
1211 1214 border-top:3rpx solid #eeeeee;
1212 1215 margin:0 auto;
... ... @@ -1331,7 +1334,8 @@ left:31rpx;}
1331 1334 }
1332 1335  
1333 1336 .xc_goods-img{
1334   - width: 180rpx;height: 180rpx;
  1337 + width: 190rpx;
  1338 + height: 190rpx;
1335 1339 }
1336 1340 .xc_comment-left{
1337 1341 display:inline-block;
... ... @@ -2848,4 +2852,43 @@ button.custom-service::after{
2848 2852 flex: 1;
2849 2853 }
2850 2854  
2851   -.gray{ background-color: #dcdcdc !important;}
2852 2855 \ No newline at end of file
  2856 +.gray{ background-color: #dcdcdc !important;}
  2857 +
  2858 +
  2859 +.card {
  2860 + position: relative;
  2861 + padding: 20rpx;
  2862 + margin-bottom: 20rpx;
  2863 + border-radius: 8rpx;
  2864 + background: #ffdcdc;
  2865 + overflow: hidden;
  2866 + /* background: #ffdcdc url(https://mshopimg.yolipai.net/miniapp/images/fwk/crown_bg.png) no-repeat left top;
  2867 + background-position: 10rpx 10rpx;
  2868 + background-size: 206rpx 136rpx; */
  2869 +}
  2870 +
  2871 +.card::before {
  2872 + position: absolute;
  2873 + font-family: iconfont;
  2874 + content: '\e630';
  2875 + color: rgba(255,0,0,.1);
  2876 + font-size: 260rpx;
  2877 + /* transform: rotateZ(45deg); */
  2878 + top: -110rpx;
  2879 + left: -70rpx;
  2880 +}
  2881 +
  2882 +.rmb::before {
  2883 + content: '¥';
  2884 + font-size: 24rpx;
  2885 +}
  2886 +
  2887 +.c-red {
  2888 + color: #f23030;
  2889 +}
  2890 +
  2891 +.btn-group {
  2892 + border-radius: 70rpx;
  2893 + overflow: hidden;
  2894 + margin-right: 10rpx;
  2895 +}
... ...
packageA/pages/myGiftDetails/myGiftDetails.js
... ... @@ -15,6 +15,7 @@ Page({
15 15 content: "当前核销码仅限当面使用!"
16 16 },
17 17 showBtn: true,
  18 + isClick: false,
18 19 },
19 20  
20 21 /**
... ... @@ -332,27 +333,35 @@ Page({
332 333  
333 334 //一键领取券
334 335 show_get_quan:function (e) {
335   - var th=this;
336   - var json = {
337   - store_id:os.stoid,
338   - user_id:getApp().globalData.user_id,
339   - id:this.data.id
340   - };
341   - var url = "/api/weshop/libao/libaoFormvip/saveLibaoQuan";
342   - getApp().request.post(url,{
343   - data:json,
344   - success:function(res) {
345   - if (res.data.code == 0) {
346   - th.setData({'details.isget':1});
347   - } else {
348   - wx.showToast({
349   - title: res.data.msg,
350   - icon: 'none',
351   - duration: 2000
352   - })
353   - }
354   - },
355   - })
  336 + if(this.data.isClick) return false;
  337 + if(!this.data.isClick) {
  338 + this.data.isClick = true;
  339 + let th=this;
  340 + let json = {
  341 + store_id:os.stoid,
  342 + user_id:getApp().globalData.user_id,
  343 + id:this.data.id
  344 + };
  345 + let url = "/api/weshop/libao/libaoFormvip/saveLibaoQuan";
  346 + getApp().request.post(url,{
  347 + data:json,
  348 + success:function(res) {
  349 + if (res.data.code == 0) {
  350 + th.setData({'details.isget':1});
  351 + } else {
  352 + wx.showToast({
  353 + title: res.data.msg,
  354 + icon: 'none',
  355 + duration: 2000
  356 + })
  357 + th.data.isClick = false;
  358 + }
  359 +
  360 + },
  361 + });
  362 +
  363 + }
  364 +
356 365  
357 366 }
358 367  
... ...
packageB/pages/boxes-details/boxes-details.js 0 → 100644
  1 +// packageA/pages/details_serviceCard/details_serviceCard.js
  2 +const app = getApp();
  3 +const os = app.globalData.setting;
  4 +let self = null;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + is_summit_ing: 0,
  13 +
  14 + showQr: false,
  15 + },
  16 +
  17 + /**
  18 + * 生命周期函数--监听页面加载
  19 + */
  20 + onLoad: function(options) {
  21 + self = this;
  22 + this.data.options = options;
  23 + app.isLogin().then(function(data) {
  24 + self.setData({
  25 + userInfo: data,
  26 + });
  27 + self.getConfig();
  28 + });
  29 + },
  30 +
  31 + /**
  32 + * 生命周期函数--监听页面初次渲染完成
  33 + */
  34 + onReady: function() {
  35 +
  36 + },
  37 +
  38 + /**
  39 + * 生命周期函数--监听页面显示
  40 + */
  41 + onShow: function() {
  42 + if (app.globalData.userInfo) {
  43 + if (!this.data.isLogin) {
  44 + this.setData({
  45 + userInfo: app.globalData.userInfo,
  46 + imghost: app.globalData.setting.imghost,
  47 + isLogin: true,
  48 + });
  49 +
  50 + let url = '/api/weshop/recharge/user/page'
  51 + let data = {
  52 + store_id: app.globalData.setting.stoid,
  53 + user_id: this.data.userInfo.user_id,
  54 + order_id: this.data.options.order_id,
  55 + };
  56 +
  57 + // 请求数据
  58 + app.promiseGet(url, {
  59 + data: data,
  60 + }).then(res => {
  61 + if (res.data.code == 0) {
  62 + console.log('请求成功', res);
  63 + this.setData({
  64 + details: res.data.data.pageData[0],
  65 + });
  66 + } else {
  67 + throw (res);
  68 + };
  69 + }).catch(err => {
  70 + wx.showToast({
  71 + title: err.data.data,
  72 + icon: 'error',
  73 + });
  74 + });
  75 +
  76 + };
  77 + };
  78 + },
  79 +
  80 + /**
  81 + * 生命周期函数--监听页面隐藏
  82 + */
  83 + onHide: function() {
  84 +
  85 + },
  86 +
  87 + /**
  88 + * 生命周期函数--监听页面卸载
  89 + */
  90 + onUnload: function() {
  91 +
  92 + },
  93 +
  94 + /**
  95 + * 页面相关事件处理函数--监听用户下拉动作
  96 + */
  97 + onPullDownRefresh: function() {
  98 +
  99 + },
  100 +
  101 + /**
  102 + * 页面上拉触底事件的处理函数
  103 + */
  104 + onReachBottom: function() {
  105 +
  106 + },
  107 +
  108 + /**
  109 + * 用户点击右上角分享
  110 + */
  111 + onShareAppMessage: function() {
  112 +
  113 + },
  114 +
  115 +
  116 + // 内容复制到剪贴板
  117 + copy() {
  118 + console.log('点击了复制按钮');
  119 + wx.setClipboardData({
  120 + data: this.data.details.order_sn,
  121 + success(res) {
  122 + wx.getClipboardData({
  123 + success(res) {
  124 + console.log(res.data);
  125 + }
  126 + })
  127 + }
  128 + })
  129 + },
  130 +
  131 +
  132 + // 图片异常时加载默认图片
  133 + bind_bnerr(e) {
  134 + var errImg = e.currentTarget.dataset.errorimg;
  135 + var errObj = {};
  136 + errObj[errImg] = 'public/images/default_goods_image_240.gif';
  137 + this.setData(errObj); // this.setData({ details.list[0].img_url});
  138 + },
  139 +
  140 +
  141 + // 查看商品详情
  142 + viewDetails(e) {
  143 + let goods_id = e.currentTarget.dataset.gid;
  144 + let url = '/packageA/pages/goodsInfo/goodsInfo?goods_id=' + goods_id;
  145 + app.goto(url);
  146 + },
  147 +
  148 + // 获取系统参数
  149 + getConfig() {
  150 + app.getConfig2(function(e) {
  151 + // console.log('101',e);
  152 + let json_d = JSON.parse(e.switch_list);
  153 + self.setData({
  154 + sys_switch: json_d,
  155 + // weapp_customertype: json_d.weapp_customertype,
  156 + });
  157 + }, 1);
  158 + },
  159 +
  160 +
  161 + // 联系微信客服
  162 + contact_wx() {
  163 + var url = this.data.sys_switch.weapp_customertype_url;
  164 + var id = this.data.sys_switch.weapp_customertype_appid;
  165 + wx.openCustomerServiceChat({
  166 + extInfo: {
  167 + url: url
  168 + },
  169 + corpId: id,
  170 + success(res) {}
  171 + })
  172 + },
  173 +
  174 +
  175 + // 联系电话客服
  176 + contactService() {
  177 + app.getConfig(function(t) {
  178 + if (t.store_tel == undefined) {
  179 + app.request.get('/api/weshop/store/get/' + os.stoid, {
  180 + isShowLoading: 1,
  181 + data: {},
  182 + success: function(rs) {
  183 + app.globalData.config = rs.data.data;
  184 + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
  185 + app.my_warnning('商家未设置电话', 0, self);
  186 + return false;
  187 + }
  188 + app.confirmBox('请联系客服:' + rs.data.data.store_tel);
  189 + }
  190 + })
  191 + } else {
  192 + app.confirmBox('请联系客服:' + t.store_tel);
  193 + }
  194 + });
  195 + },
  196 +
  197 +
  198 + // 评价商品
  199 + access() {
  200 + let listLength = this.data.details.list.length;
  201 + let order_id = this.data.details.order_id;
  202 + let url = '';
  203 +
  204 + // 卡项订单跳转到评论页要多加个参数card=1
  205 + // 卡项订单goods_id要带card_id
  206 + if (listLength == 1) {
  207 + let price = this.data.details.list[0].price;
  208 + let card_id = this.data.details.list[0].card_id;
  209 + url =
  210 + `/packageB/pages/user/add_comment/add_comment?card=1&goods_id=${card_id}&order_id=${order_id}&price=${price}`
  211 + };
  212 + if (listLength > 1) {
  213 + url = `/packageB/pages/user/comment/comment?card=1&status=0&order_id=${order_id}`;
  214 + };
  215 + f
  216 + // console.log('url', url);
  217 + app.goto(url);
  218 + },
  219 +
  220 +
  221 + // 查看评论
  222 + viewComment() {
  223 + let order_id = this.data.details.order_id;
  224 + let card_id = this.data.details.list[0].card_id;
  225 + let listLength = this.data.details.list.length;
  226 + let url = '';
  227 +
  228 + // 卡项订单单个商品
  229 + if (listLength == 1) {
  230 + url = `/packageB/pages/user/view_comment/view_comment?card=1&goods_id=${card_id}&order_id=${order_id}`;
  231 + };
  232 + // 卡项订单多个商品
  233 + if (listLength > 1) {
  234 + // status控制评论列表页的activeStatus
  235 + url = `/packageB/pages/user/comment/comment?card=1&status=1&order_id=${order_id}`;
  236 + };
  237 +
  238 + app.goto(url);
  239 + },
  240 +
  241 +
  242 + // 再来一单
  243 + buy2(t) {
  244 + let details = this.data.details;
  245 + var th = this;
  246 + var ind = 1; // 1:加入购物车
  247 + // var ind = t.currentTarget.dataset.openSpecModal_ind;
  248 + // var action= t.currentTarget.dataset.action;
  249 + var action = 'add'; //
  250 + // if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
  251 +
  252 + th.setData({
  253 + open_ind_store: ind
  254 + });
  255 +
  256 + // if(!th.data.sto_sele_name){
  257 + // getApp().my_warnning('请选择门店', 1, th, 450);
  258 + // return false;
  259 + // }
  260 +
  261 +
  262 + if (action == "buy") {
  263 + //--------------此时操作的数据------------
  264 + // var newd = {
  265 + // id: th.data.data.id,
  266 + // goods_num: th.data.goodsInputNum,
  267 + // pick_id: th.data.sto_sele_id,
  268 + // keyid: th.data.sto_sele_keyid,
  269 + // };
  270 + // newd['pick_name'] = th.data.sto_sele_name;
  271 + // newd['guide_id'] = getApp().globalData.guide_id;
  272 + // newd['guide_type']=0;
  273 + // th.buyNow(newd);
  274 + } else {
  275 +
  276 + var newd = {
  277 + // service_id: th.data.data.id,
  278 + // service_sn:th.data.data.service_sn,
  279 + // service_name:th.data.data.goods_name,
  280 + // goods_num: th.data.goodsInputNum,
  281 + // pick_id: th.data.sto_sele_id,
  282 + // user_id:oo.user_id,
  283 + // store_id:os.stoid,
  284 + // money:th.data.data.shop_price,
  285 +
  286 + service_id: details.list[0].card_id,
  287 + service_sn: details.list[0].service_sn,
  288 + service_name: details.list[0].service_name,
  289 + goods_num: details.list[0].qty,
  290 + pick_id: details.list[0].pickup_id,
  291 + user_id: this.data.userInfo.user_id,
  292 + store_id: app.globalData.setting.stoid,
  293 + money: details.list[0].price,
  294 + };
  295 + if (getApp().globalData.guide_id) {
  296 + newd['guide_id'] = getApp().globalData.guide_id;
  297 + newd['guide_type'] = 0;
  298 + }
  299 +
  300 + //----先看会员在购物车中是否加入了该商品-----
  301 + app.request.get("/api/weshop/cartService/page", {
  302 + data: {
  303 + store_id: app.globalData.setting.stoid,
  304 + user_id: this.data.userInfo.user_id,
  305 + service_id: details.list[0].card_id,
  306 + pick_id: details.list[0].pickup_id,
  307 + },
  308 + success: function(re) {
  309 +
  310 + //-------如果购物车中有相关的数据---------
  311 + if (re.data.data.total > 0) {
  312 + var item = re.data.data.pageData[0];
  313 + var updata = {
  314 + id: item.id,
  315 + goods_num: details.list[0].qty + item.goods_num,
  316 + money: details.list[0].price,
  317 + store_id: app.globalData.setting.stoid,
  318 + };
  319 +
  320 + if (getApp().globalData.guide_id) {
  321 + updata['guide_id'] = getApp().globalData.guide_id;
  322 + updata['guide_type'] = 1;
  323 + }
  324 + getApp().request.put("/api/weshop/cartService/update", {
  325 + data: updata,
  326 + success: function(t) {
  327 + // getApp().my_warnning('加入购物车成功', 1, th, 450);
  328 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  329 + th.setData({
  330 + cartGoodsNum: c_num
  331 + });
  332 + app.goto('/pages/cart/cart/cart');
  333 + // th.closeSpecModal();
  334 + }
  335 + });
  336 + } else {
  337 +
  338 + getApp().request.post("/api/weshop/cartService/save", {
  339 + data: newd,
  340 + success: function(t) {
  341 + // getApp().my_warnning('加入购物车成功', 1, th, 450);
  342 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  343 + th.setData({
  344 + cartGoodsNum: c_num
  345 + });
  346 + app.goto('/pages/cart/cart/cart');
  347 + // th.closeSpecModal();
  348 + }
  349 + });
  350 + }
  351 + }
  352 + });
  353 +
  354 + }
  355 + },
  356 +
  357 +
  358 + // 取消订单
  359 + // api/weshop/recharge/update?store_id=&order_id=&order_status=3
  360 + cancle() {
  361 + wx.showModal({
  362 + title: '提示',
  363 + content: '确定取消订单吗?',
  364 + success(res) {
  365 + if (res.confirm) {
  366 + console.log('用户点击确定');
  367 + let order_id = self.data.details.order_id;
  368 + let order_sn = self.data.details.order_sn;
  369 + app.request.put('/api/weshop/recharge/update', {
  370 + data: {
  371 + store_id: os.stoid,
  372 + order_id: order_id,
  373 + order_sn: order_sn,
  374 + order_status: 3,
  375 + },
  376 + success: function(res) {
  377 +
  378 + //取消成功刷新订单
  379 + let url = '/api/weshop/recharge/user/page'
  380 + let data = {
  381 + store_id: app.globalData.setting.stoid,
  382 + user_id: self.data.userInfo.user_id,
  383 + order_id: self.data.options.order_id,
  384 + };
  385 +
  386 + // 请求数据
  387 + app.promiseGet(url, {
  388 + data: data,
  389 + }).then(res => {
  390 + if (res.data.code == 0) {
  391 + console.log('请求成功', res);
  392 + wx.showToast({
  393 + title: '取消成功',
  394 + });
  395 + self.setData({
  396 + details: res.data.data.pageData[0],
  397 + });
  398 + } else {
  399 + throw (res);
  400 + };
  401 + }).catch(err => {
  402 + wx.showToast({
  403 + title: err.data.data,
  404 + icon: 'error',
  405 + });
  406 + });
  407 +
  408 + },
  409 + })
  410 + } else if (res.cancel) {
  411 + console.log('用户点击取消');
  412 + }
  413 + }
  414 + });
  415 + },
  416 +
  417 +
  418 + // 立即支付
  419 + pay() {
  420 + let order_sn = this.data.details.order_sn;
  421 + let store_id = app.globalData.setting.stoid;
  422 +
  423 + app.request.post('/api/weshop/order/pay/createRechargeOrder', {
  424 + data: {
  425 + parentSn: order_sn,
  426 + store_id: store_id,
  427 + },
  428 +
  429 + success: function(res) {
  430 + var n = res.data.data;
  431 + self.weixinPay(n, function() {
  432 + app.showWarning('支付成功');
  433 + // setTimeout(function() {
  434 + // wx.reLaunch({
  435 + // url: '/pages/user/my_service/i_service',
  436 + // })
  437 + // }, 1000)
  438 + }, function() {
  439 + app.showWarning('支付失败');
  440 + // setTimeout(function() {
  441 + // wx.reLaunch({
  442 + // url: '/packageA/pages/cardList/cardList',
  443 + // })
  444 + // }, 1000)
  445 + });
  446 + }
  447 + })
  448 + },
  449 +
  450 +
  451 + //------调起支付框--------
  452 + weixinPay: function(n, success, fail) {
  453 + if (!n) return false;
  454 + wx.requestPayment({
  455 + timeStamp: String(n.timeStamp),
  456 + nonceStr: n.nonceStr,
  457 + package: n.packageValue,
  458 + signType: n.signType,
  459 + paySign: n.paySign,
  460 + success: function(n) {
  461 + console.log(n), getApp().showSuccess("支付成功!");
  462 + "function" == typeof success && success();
  463 + wx.redirectTo({
  464 + url: "../deposit/deposit"
  465 + });
  466 + },
  467 + fail: function(n) {
  468 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") :
  469 + "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n
  470 + .errMsg.substr("requestPayment:fail ".length)),
  471 + "function" == typeof fail && fail();
  472 + }
  473 + });
  474 + },
  475 +
  476 +
  477 +
  478 +
  479 +
  480 +
  481 +
  482 +
  483 + showQr() {
  484 + this.setData({
  485 + showQr: true,
  486 + });
  487 + },
  488 +
  489 + closeQr() {
  490 + this.setData({
  491 + showQr: false,
  492 + });
  493 + },
  494 +
  495 + touchMove() {}
  496 +
  497 +
  498 +
  499 +
  500 +
  501 +
  502 +
  503 +
  504 +})
... ...
packageB/pages/boxes-details/boxes-details.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "订单详情",
  3 + "usingComponents": {
  4 + "nodata": "/components/nodata/nodata",
  5 + "share_button": "/components/share/share"
  6 + },
  7 + "enablePullDownRefresh": false
  8 +}
0 9 \ No newline at end of file
... ...
packageB/pages/boxes-details/boxes-details.wxml 0 → 100644
  1 +<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
  2 +
  3 +<view class="main">
  4 + <view class="bg-white pdh20 bdr12">
  5 + <block>
  6 + <!-- 门店名称栏 -->
  7 + <!-- <view class="flex jc_sb ai_c pdv20">
  8 + <view class="ellipsis-1 pdr40 fs30"><text class="iconfont icon-shop c-red pdr10"></text>{{item.pickup_name}}</view>
  9 + <block>
  10 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 0}}">待支付</text>
  11 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 1}}">待评价</text>
  12 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 2}}">已评价</text>
  13 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 3}}">已取消</text>
  14 + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 5}}">已作废</text>
  15 + </block>
  16 + </view> -->
  17 +
  18 + <!-- 列表栏 -->
  19 + <view>
  20 + <!-- <view class="flex pdv20" wx:for="{{details.list}}" bindtap="viewDetails" data-gid="{{item.card_id}}"> -->
  21 + <view class="flex pdv20" bindtap="viewDetails" data-gid="{{item.card_id}}" wx:for="{{14}}">
  22 + <view class="pic-box shrink0">
  23 + <text class="iconfont icon-shangpin fs60 white"></text>
  24 + </view>
  25 + <view class="pdl20 f1">
  26 + <view class="flex jc_sb ai_c">
  27 + <view class="title ellipsis-2 pdr40">商品名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称</view>
  28 + <text class="c-6">x1{{item.price}}</text>
  29 + </view>
  30 + <view class="flex ai_c c-9 fs26">
  31 + <!-- <text>10个/蓝色</text> -->
  32 + <text class="rmb c-red">2{{filters.price(item.group_price)}}</text>
  33 + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view>
  34 + </view>
  35 + </view>
  36 + </view>
  37 + </view>
  38 + </block>
  39 +
  40 +
  41 + <!-- 统计栏 -->
  42 + <!-- <view class="t-r bdt pdv20">共{{filter.count(details.list)}}件商品,合计:<text class="rmb c-red bold fs30">{{details.account}}</text></view> -->
  43 + </view>
  44 +
  45 +
  46 +
  47 +
  48 + <!-- 底部按钮栏 -->
  49 + <view class="btn-bar bg-white pd20 t-c">
  50 + <!-- <text class="btn bg-orange white" bindtap="buy2">再来一单</text> -->
  51 + <text class="btn bg-red white" bindtap="showQr">立即兑换</text>
  52 + </view>
  53 +</view>
  54 +
  55 +
  56 +
  57 +
  58 +
  59 +
  60 +<!-- 遮罩层 -->
  61 +<view class="mask" hidden="{{!showQr}}" catchtouchmove="touchMove"></view>
  62 +<!-- 码 -->
  63 +<view class="popup-container" hidden="{{!showQr}}" catchtouchmove="touchMove">
  64 + <view class="t-r pdb20"><text class="iconfont icon-close fs40" bindtap="closeQr"></text></view>
  65 + <view class="popup">
  66 + <!-- <view class="popup-title">
  67 + <block wx:if="{{details[useIndex].isby == 1}}">包邮券</block>
  68 + <block wx:else>
  69 + {{filter.getNum(details[useIndex].Sum)}}元微券
  70 + </block>
  71 + </view> -->
  72 + <!-- <view class="pdt20 c-fe0000"><text class="rmb fs80" wx:if="{{details[useIndex].isby != 1}}">{{filter.getNum(details[useIndex].Sum)}}</text></view> -->
  73 + <!-- 条形码 -->
  74 + <view class="bar-container">
  75 + <canvas class="barcode" canvas-id="barcode"/>
  76 + <view class="pdt20 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view>
  77 + <view class="pdt20 fs26" wx:else>{{details[useIndex].no}}</view>
  78 + </view>
  79 + <!-- 二维码 -->
  80 + <view class="qr-container">
  81 + <canvas class="qrcode" canvas-id="qrcode"/>
  82 + </view>
  83 + <view class="pdv20 c-7b fs26 bdt">
  84 + <text wx:if="{{details[useIndex].ValidDate}}" class="ellipsis-1x">有效期:{{details[useIndex].BeginDate==null ? " " : time.replace_time2(details[useIndex].BeginDate)}} 至 {{time.replace_time2(details[useIndex].ValidDate)}}</text>
  85 + <text wx:elif="{{details[useIndex].use_end_time}}" class="ellipsis-1x">有效期:{{details[useIndex].use_start_time==null ? " " : time.format_time(details[useIndex].use_start_time)}} 至 {{time.format_time(details[useIndex].use_end_time)}}</text>
  86 + <text wx:else>有效期:不限</text>
  87 + </view>
  88 + </view>
  89 +</view>
... ...
packageB/pages/boxes-details/boxes-details.wxss 0 → 100644
  1 +page {
  2 + box-sizing: border-box;
  3 + padding: 20rpx 20rpx 0;
  4 + background-color: #f2f2f2;
  5 + font-size: 28rpx;
  6 +}
  7 +
  8 +.bdr12 {
  9 + border-radius: 12rpx;
  10 +}
  11 +
  12 +.w40 {
  13 + width: 40%;
  14 + box-sizing: border-box;
  15 +}
  16 +
  17 +.btn-border {
  18 + border: 2rpx solid #808080;
  19 +}
  20 +
  21 +
  22 +.bg-red {
  23 + background-image: -webkit-linear-gradient(315deg,#f2140c,#f2270c 70%,#f24d0c);
  24 + background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c);
  25 +}
  26 +
  27 +.bg-orange {
  28 + background-image: -webkit-linear-gradient(315deg,#ffba0d,#ffc30d 69%,#ffcf0d);
  29 + background-image: linear-gradient(135deg,#ffba0d,#ffc30d 69%,#ffcf0d);
  30 +}
  31 +
  32 +.c-orange {
  33 + color: #ff9000;
  34 +}
  35 +
  36 +.main {
  37 + padding-bottom: 134rpx;
  38 +}
  39 +
  40 +.pic-box {
  41 + width: 130rpx;
  42 + height: 130rpx;
  43 + border-radius: 12rpx;
  44 + overflow: hidden;
  45 + display: flex;
  46 + justify-content: center;
  47 + align-items: center;
  48 + background-color: pink;
  49 +}
  50 +
  51 +.rmb::before {
  52 + content: '¥';
  53 +}
  54 +
  55 +.title {
  56 + height: 88rpx;
  57 +}
  58 +
  59 +.separator {
  60 + position: relative;
  61 +}
  62 +
  63 +.separator::before {
  64 + content: '';
  65 + position: absolute;
  66 + width: 2rpx;
  67 + height: 30%;
  68 + background-color: #f8f8f8;
  69 + left: 0;
  70 + top: 0;
  71 + bottom: 0;
  72 + margin: auto;
  73 +}
  74 +
  75 +.btn-bar {
  76 + box-sizing: border-box;
  77 + position: fixed;
  78 + left: 0;
  79 + bottom: 0;
  80 + width: 100%;
  81 + font-size: 26rpx;
  82 + border-top: 2rpx solid #f2f2f2;
  83 +}
  84 +
  85 +.btn {
  86 + width: 50%;
  87 + box-sizing: border-box;
  88 + display: inline-block;
  89 + height: 70rpx;
  90 + line-height: 70rpx;
  91 + padding: 0 40rpx;
  92 + border-radius: 100rpx;
  93 +}
  94 +
  95 +.btn-copy {
  96 + display: block;
  97 + color: #666;
  98 + font-size: 22rpx;
  99 + padding: 0 20rpx;
  100 + border-radius: 6rpx;
  101 + background-color: #f0f0f0;
  102 +}
  103 +
  104 +.del {
  105 + text-decoration: line-through;
  106 +}
  107 +
  108 +
  109 +
  110 +
  111 +
  112 +.mask {
  113 + position: fixed;
  114 + width: 100%;
  115 + height: 100%;
  116 + top: 0;
  117 + left: 0;
  118 + background-color: rgba(0,0,0,.7);
  119 + z-index: 1;
  120 + }
  121 +
  122 + .popup-container {
  123 + position: fixed;
  124 + width: 70%;
  125 + border-radius: 12rpx;
  126 + top: 50%;
  127 + left: 50%;
  128 + transform: translate(-50%, -50%);
  129 + z-index: 3;
  130 + }
  131 +
  132 + .popup {
  133 + text-align: center;
  134 + border-radius: 12rpx;
  135 + background-color: white;
  136 + overflow: hidden;
  137 + /* width: 80%; */
  138 + }
  139 +
  140 + .popup-container .icon-close {
  141 + color: rgba(255,255,255,.6);
  142 + }
  143 +
  144 + .popup-title {
  145 + padding: 40rpx 0;
  146 + color: #fe0000;
  147 + background-color: #FFD3D6;
  148 + position: relative;
  149 + }
  150 +
  151 + .popup-title::after {
  152 + content: '';
  153 + position: absolute;
  154 + left: -20rpx;
  155 + bottom: -12rpx;
  156 + width: 130%;
  157 + height: 20rpx;
  158 + background: -webkit-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent);
  159 + background: -moz-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent);
  160 + background: -o-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent);
  161 + background: radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent);
  162 + background-size: 40rpx 40rpx;
  163 + transform: rotate(180deg);
  164 + -webkit-transform: rotate(180deg);
  165 + }
  166 +
  167 +
  168 + .popup .rmb::before {
  169 + font-size: 40rpx;
  170 + }
  171 +
  172 + .img-qr {
  173 + display: block;
  174 + width: 300rpx;
  175 + height: 300rpx;
  176 + margin: 0 auto;
  177 + background-color: pink;
  178 + }
  179 +
  180 + .qrcode {
  181 + width: 300rpx;
  182 + height: 300rpx;
  183 + margin: 0 auto;
  184 + }
  185 +
  186 +
  187 + .noMore {
  188 + padding: 20rpx;
  189 + color: #bbb;
  190 + text-align: center;
  191 + font-size: 22rpx;
  192 + }
  193 +
  194 + .breakall {
  195 + word-break: break-all;
  196 + }
  197 +
  198 +
  199 +
... ...
packageB/pages/boxes-list/boxes-list.js 0 → 100644
  1 +const app = getApp();
  2 +let self = null;
  3 +
  4 +Page({
  5 + data: {
  6 + tabArr: ['待核销','已核销'],
  7 + currentTabIndex: 0,
  8 +
  9 + isLogin: false,
  10 + list: null,
  11 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  12 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  13 + pageNum: 1, // 当前页数
  14 +
  15 + // showReward: false,
  16 + // prizesArr: [],
  17 +
  18 + // typeArr: [{
  19 + // key: 'point',
  20 + // name: '积分',
  21 + // },{
  22 + // key: 'grow',
  23 + // name: '成长值',
  24 + // },{
  25 + // key: 'point',
  26 + // name: '优惠券',
  27 + // },{
  28 + // key: 'prestore_name',
  29 + // name: '项目服务',
  30 + // },{
  31 + // key: 'prestore_money',
  32 + // name: '预存金额',
  33 + // }],
  34 + },
  35 +
  36 + onLoad: function () {
  37 + self = this;
  38 + app.isLogin().then(function(data) {
  39 + self.setData({
  40 + userInfo: data,
  41 + });
  42 + });
  43 + },
  44 +
  45 + onShow: function() {
  46 + if(app.globalData.userInfo) {
  47 + if(!this.data.isLogin) {
  48 + this.setData({
  49 + userInfo: app.globalData.userInfo,
  50 + imghost: app.globalData.setting.imghost,
  51 + isLogin: true,
  52 + });
  53 +
  54 + let data = {
  55 + store_id: app.globalData.setting.stoid,
  56 + user_id: this.data.userInfo.user_id,
  57 + };
  58 +
  59 + // 默认获取'全部'
  60 + this.getData(true, '/api/weshop/prom/luckyOrder/page', data)
  61 + .then(()=>{
  62 + this.setData({
  63 + currentData: data,
  64 + });
  65 + });
  66 +
  67 + };
  68 + };
  69 + },
  70 +
  71 +
  72 + /**
  73 + * 页面上拉触底事件的处理函数
  74 + */
  75 + onReachBottom: function () {
  76 + this.scrollToLower('/api/weshop/prom/luckyOrder/page', this.data.currentData);
  77 + },
  78 +
  79 +
  80 + // 图片异常时加载默认图片
  81 + bind_bnerr: function (e) {
  82 + var _errImg = e.target.dataset.errorimg;
  83 + var val = e.target.dataset.val;
  84 + if(val!=undefined && val!=null && val!='null' ){
  85 + var _errObj = {};
  86 + _errObj[_errImg] = "/public/images/default_goods_image_240.gif";
  87 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  88 + }
  89 + },
  90 +
  91 +
  92 +
  93 + // 点击tab选项卡
  94 + clickTab(e) {
  95 + this.setData({
  96 + currentTabIndex: e.target.dataset.index,
  97 + noMore: false,
  98 + pageNum: 1,
  99 + list: null,
  100 + });
  101 +
  102 + let currentTabIndex = parseInt(this.data.currentTabIndex);
  103 + let currentData = this.data.currentData;
  104 +
  105 + delete currentData.page;
  106 +
  107 + switch(currentTabIndex) {
  108 + case 0: {
  109 + delete currentData.team_status;
  110 + break;
  111 + };
  112 + case 1: {
  113 + currentData.team_status = 0;
  114 + break;
  115 + };
  116 + case 2: {
  117 + currentData.team_status = 2;
  118 + break;
  119 + };
  120 + case 3: {
  121 + currentData.team_status = 1;
  122 + break;
  123 + };
  124 + };
  125 +
  126 + // 请求
  127 + this.getData(true, '/api/weshop/prom/luckyOrder/page', currentData);
  128 +
  129 + },
  130 +
  131 +
  132 + /**
  133 + * 请求数据
  134 + */
  135 + getData: function(isInit, url, data) {
  136 + let p = app.request.promiseGet(url, {
  137 + data: data,
  138 + isShowLoading: true,
  139 + })
  140 + .then(function(res) {
  141 + if(res.data.code == 0) {
  142 +
  143 + self.setData({
  144 + isLoading: false
  145 + });
  146 +
  147 + if(isInit) {// 第一次加载
  148 + self.setData({
  149 + list: res.data.data
  150 + });
  151 + } else {
  152 + self.setData({
  153 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  154 + });
  155 + };
  156 +
  157 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  158 + self.setData({
  159 + noMore: true
  160 + });
  161 + };
  162 +
  163 + } else {
  164 + self.setData({
  165 + 'list.pageData': []
  166 + });
  167 + };
  168 +
  169 + });
  170 +
  171 + return p;
  172 + },
  173 +
  174 +
  175 + /**
  176 + * 上拉加载
  177 + */
  178 + scrollToLower(url, requestData) {
  179 + // 数据总量
  180 + let total = this.data.list.total;
  181 + // 单页最大数据量
  182 + let pageSize = this.data.list.pageSize;
  183 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  184 + if((total != 0)&&(total <= pageSize)) {
  185 + this.setData({
  186 + noMore: true
  187 + });
  188 + };
  189 +
  190 + if(!this.data.isLoading && !this.data.noMore) {
  191 + this.setData({
  192 + isLoading: true,
  193 + pageNum: this.data.pageNum + 1
  194 + });
  195 + requestData.page = this.data.pageNum;
  196 + this.getData(false, url, requestData);
  197 + };
  198 + },
  199 +
  200 +
  201 + //跳转
  202 + go: function (e) {
  203 + var url = e.currentTarget.dataset.url;
  204 + getApp().goto(url);
  205 + },
  206 +
  207 + //查看奖励
  208 + showReward: function(e) {
  209 + this.setData({
  210 + currentItemIndex: e.target.dataset.index,
  211 + currentItemAid: e.target.dataset.aid,
  212 + });
  213 + this.getPrizes(this.data.currentItemIndex);
  214 + },
  215 +
  216 + //关闭奖励
  217 + closeReward: function() {
  218 + this.setData({
  219 + showReward: false,
  220 + });
  221 + },
  222 +
  223 +
  224 + // 获取优惠券奖励和服务项目奖励
  225 + getPrizes: function(currentItemIndex) {
  226 + let currentItem = this.data.list.pageData[currentItemIndex];
  227 + let type = currentItem.type;
  228 +
  229 + // 分割type字符串
  230 + let typeArr = this.splitStringToArr(type);
  231 + let prizesArr = [];
  232 + let promiseArr = [];
  233 + typeArr.forEach(function(item) {
  234 +
  235 + let obj = {};
  236 + obj.type = item;
  237 +
  238 + let promise = new Promise((resolve, reject) => {
  239 + switch(item) {
  240 + case 1: { //积分
  241 + obj.name = '积分';
  242 + obj.num = 'point';
  243 + prizesArr.push(obj);
  244 + resolve();
  245 + break;
  246 + };
  247 + case 2: { //成长值
  248 + obj.name = '成长值';
  249 + obj.num = 'grow';
  250 + prizesArr.push(obj);
  251 + resolve();
  252 + break;
  253 + };
  254 + case 3: { //优惠券
  255 + app.request.promiseGet('/api/weshop/prom/luckyCoupon/page', {
  256 + data: {
  257 + store_id: app.globalData.setting.stoid,
  258 + aid: self.data.currentItemAid,
  259 + }
  260 + }).then(res => {
  261 + if(res.data.code == 0) {
  262 + obj.couponList = res.data.data.pageData;
  263 + prizesArr.push(obj);
  264 + resolve();
  265 + };
  266 + });
  267 + break;
  268 + };
  269 + case 4: { //服务项目
  270 + app.request.promiseGet('/api/weshop/prom/luckyService/page', {
  271 + data: {
  272 + store_id: app.globalData.setting.stoid,
  273 + aid: self.data.currentItemAid,
  274 + }
  275 + }).then(res => {
  276 + if(res.data.code == 0) {
  277 + obj.serviceList = res.data.data.pageData;
  278 + prizesArr.push(obj);
  279 + resolve();
  280 + };
  281 + });
  282 + break;
  283 + };
  284 + case 5: { //预存金额
  285 + obj.name = 'prestore_name';
  286 + obj.num = 'prestore_money';
  287 + prizesArr.push(obj);
  288 + resolve();
  289 + break;
  290 + };
  291 + };
  292 + });
  293 +
  294 + promiseArr.push(promise);
  295 +
  296 +
  297 + Promise.all(promiseArr).then(()=> {
  298 + self.setData({
  299 + prizesArr,
  300 + showReward: true,
  301 + });
  302 + });
  303 +
  304 + });
  305 + },
  306 +
  307 + // 将type字符串分割成数组
  308 + splitStringToArr: function(typeStr) {
  309 + var index;
  310 + var newTypeArr = [];
  311 + var typeStrArr = typeStr.split(',');
  312 + typeStrArr.forEach(function(item) {
  313 + index = parseInt(item);
  314 + newTypeArr.push(index);
  315 + });
  316 + return newTypeArr;
  317 + },
  318 +
  319 +
  320 +
  321 +
  322 +
  323 + viewDetails() {
  324 + let url = '/packageB/pages/boxes-details/boxes-details';
  325 + app.goto(url);
  326 + }
  327 +
  328 +
  329 +})
  330 +
... ...
packageB/pages/boxes-list/boxes-list.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "套盒商品",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nodata": "/components/nodata/nodata"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageB/pages/boxes-list/boxes-list.wxml 0 → 100644
  1 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +
  3 +<!-- tabbar -->
  4 +<view class="tab-hd" bindtap="clickTab">
  5 + <view class="tab-hd-item {{currentTabIndex == index ? 'active':''}}"
  6 + wx:for="{{tabArr}}"
  7 + data-index="{{index}}">{{item}}</view>
  8 +</view>
  9 +
  10 +<view class="tab-bd">
  11 + <view class="list">
  12 +
  13 +
  14 + <view class="list-item" wx:if="{{currentTabIndex == 0}}" bindtap="viewDetails">
  15 + <view class="pd20">
  16 + <view class=""><text class="fs24 c-9">订单编号:</text>191561561565555</view>
  17 + <view class="ellipsis-2 title">卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称</view>
  18 + <view class="flex ai-center">
  19 + <text class="rmb fs40 c-red">2{{filters.price(item.group_price)}}</text>
  20 + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view>
  21 + </view>
  22 + <view class="fs24 c-red">*兑换截止日期:2022-01-01至2022-12-31</view>
  23 + </view>
  24 +
  25 + <view class="pd20 bdt fs24 t-r">
  26 + <view class="btn bg-gray white">已过期</view>
  27 + <view class="btn bg-red white">立即兑换</view>
  28 + </view>
  29 + </view>
  30 +
  31 +
  32 + <view class="list-item" wx:if="{{currentTabIndex == 1}}">
  33 + <view class="pd20">
  34 + <view class=""><text class="fs24 c-9">订单编号:</text>191561561565555</view>
  35 + <view class="ellipsis-2 title">卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称</view>
  36 + <view class="flex ai-center">
  37 + <text class="rmb fs40 c-red">2{{filters.price(item.group_price)}}</text>
  38 + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view>
  39 + </view>
  40 + <view class="fs24 c-red">*兑换截止日期:2022-01-01至2022-12-31</view>
  41 + </view>
  42 +
  43 + <view class="pd20 bdt fs24 t-r">
  44 + <view class="btn bg-gray white">已核销</view>
  45 + </view>
  46 + </view>
  47 +
  48 + </view>
  49 +</view>
  50 +
  51 +
  52 +
  53 +
  54 +<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底啦 ——</view>
  55 +<nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
  56 +
  57 +
... ...
packageB/pages/boxes-list/boxes-list.wxss 0 → 100644
  1 +.bdt {
  2 + border-top: 2rpx solid #f5f5f5;
  3 +}
  4 +
  5 +page {
  6 + background-color: #f2f2f2;
  7 +}
  8 +
  9 +.btn {
  10 + display: inline-block;
  11 + min-width: 120rpx;
  12 + text-align: center;
  13 + /* border: 2rpx solid #ff6768; */
  14 + padding: 10rpx 20rpx;
  15 + border-radius: 40rpx;
  16 +}
  17 +
  18 +.btn.gray {
  19 + border-color: #ccc;
  20 +}
  21 +
  22 +.tab-hd {
  23 + display: flex;
  24 + text-align: center;
  25 + font-size: 28rpx;
  26 + background-color: white;
  27 + position: sticky;
  28 + top: 0;
  29 + z-index: 2;
  30 +}
  31 +
  32 +.tab-hd-item {
  33 + flex-grow: 1;
  34 + padding: 20rpx;
  35 + position: relative;
  36 +}
  37 +
  38 +.tab-hd-item.active {
  39 + color: #ff6768;
  40 +}
  41 +
  42 +.tab-hd-item.active::after {
  43 + content: '';
  44 + position: absolute;
  45 + width: 30%;
  46 + height: 4rpx;
  47 + left: 0;
  48 + right: 0;
  49 + bottom: 0;
  50 + margin: 0 auto;
  51 + background-color: #ff6768;
  52 +}
  53 +
  54 +.title {
  55 + /* max-height: 88rpx; */
  56 + box-sizing: border-box;
  57 + margin-top: 10rpx;
  58 + margin-bottom: 10rpx;
  59 + height: 90rpx;
  60 +}
  61 +
  62 +.tab-bd {
  63 + padding-left: 20rpx;
  64 + padding-right: 20rpx;
  65 +}
  66 +
  67 +.list {
  68 + overflow: hidden;
  69 +}
  70 +
  71 +.list-item {
  72 + background-color: white;
  73 + margin-top: 20rpx;
  74 + border-radius: 12rpx;
  75 + font-size: 28rpx;
  76 +}
  77 +
  78 +.arrow {
  79 + position: relative;
  80 +}
  81 +
  82 +.arrow::after {
  83 + font-family: iconfont;
  84 + content: '\e61f';
  85 + position: absolute;
  86 + right: 0;
  87 + color: #ccc;
  88 +}
  89 +
  90 +.img-container {
  91 + width: 200rpx;
  92 + height: 200rpx;
  93 + flex-shrink: 0;
  94 + margin-right: 20rpx;
  95 + border-radius: 14rpx;
  96 + overflow: hidden;
  97 +}
  98 +
  99 +.rmb::before {
  100 + content: '¥';
  101 + font-size: 24rpx;
  102 +}
  103 +
  104 +.del {
  105 + text-decoration: line-through;
  106 +}
  107 +
  108 +.no-more {
  109 + font-size: 24rpx;
  110 + line-height: 3;
  111 + text-align: center;
  112 + /* margin-top: 10rpx; */
  113 + color: #ccc;
  114 +}
  115 +
  116 +
  117 +.popup-container {
  118 + position: fixed;
  119 + top: 0;
  120 + bottom: 0;
  121 + left: 0;
  122 + right: 0;
  123 + background-color: rgba(0,0,0,.8);
  124 +}
  125 +
  126 +.popup {
  127 + background-color: #FFFAE7;
  128 + position: fixed;
  129 + left: 50%;
  130 + top: 50%;
  131 + transform: translate(-50%, -50%);
  132 + border-radius: 12rpx;
  133 + min-width: 600rpx;
  134 + color: #AF481D;
  135 +}
  136 +
  137 +.popup-list {
  138 + max-height: 700rpx;
  139 + overflow-y: auto;
  140 +}
  141 +
  142 +.popup-list-item {
  143 + display: flex;
  144 + align-items: center;
  145 + padding: 20rpx;
  146 +}
  147 +
  148 +.popup-list-item .img-container {
  149 + width: 120rpx;
  150 + height: 100rpx;
  151 +}
  152 +
  153 + .popup-title {
  154 + font-size: 28rpx;
  155 + height: 88rpx;
  156 + }
  157 +
  158 + .bg-red {
  159 + background-image: -webkit-linear-gradient(315deg,#f2140c,#f2270c 70%,#f24d0c);
  160 + background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c);
  161 + }
  162 +
  163 + .bg-gray {
  164 + background-image: -webkit-linear-gradient(315deg,#bfbfbf,#c3c3c3 70%,#d4d3d3);
  165 + background-image: linear-gradient(135deg,#bfbfbf,#c3c3c3 70%,#d4d3d3);
  166 + }
0 167 \ No newline at end of file
... ...
packageB/pages/user/add_comment/add_comment.js
... ... @@ -25,14 +25,45 @@ Page({
25 25 },
26 26 onLoad: async function (a) {
27 27 var th = this;
28   - await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => {
29   -
30   - if(ut.ajax_ok(res)) {
31   - a.img = th.data.iurl + res.data.data.pageData[0].original_img;
32   - a.goods_name = res.data.data.pageData[0].goods_name;
33   - a.goods_num = res.data.data.pageData[0].goods_num;
34   - }
35   - })
  28 + if(a.card == 1) {
  29 + wx.setNavigationBarTitle({
  30 + title: '评价卡项',
  31 + });
  32 + // console.log('card==1');
  33 + await getApp().request.promiseGet('/api/weshop/recharge/user/servicelist/list',{
  34 + data:{
  35 + store_id:os.stoid,
  36 + card_id:a.goods_id,
  37 + order_id:a.order_id,
  38 + },
  39 + }).then(res => {
  40 + // console.log('card===1', res.data);
  41 + if(res.data.code == 0) {
  42 + a.img = th.data.iurl + res.data.data[0].img_url;
  43 + a.goods_name = res.data.data[0].service_name;
  44 + a.goods_num = res.data.data[0].qty;
  45 + };
  46 + // if(ut.ajax_ok(res)) {
  47 + // a.img = th.data.iurl + res.data.data.pageData[0].original_img;
  48 + // a.goods_name = res.data.data.pageData[0].goods_name;
  49 + // a.goods_num = res.data.data.pageData[0].goods_num;
  50 + // }
  51 + });
  52 + } else {
  53 + wx.setNavigationBarTitle({
  54 + title: '评价宝贝',
  55 + });
  56 + // console.log('card==0');
  57 + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => {
  58 +
  59 + if(ut.ajax_ok(res)) {
  60 + a.img = th.data.iurl + res.data.data.pageData[0].original_img;
  61 + a.goods_name = res.data.data.pageData[0].goods_name;
  62 + a.goods_num = res.data.data.pageData[0].goods_num;
  63 + }
  64 + })
  65 + };
  66 +
36 67 this.setData({ options: a });
37 68 t.getUserInfo(function (e) {
38 69 console.log(e);
... ... @@ -64,9 +95,9 @@ Page({
64 95 });
65 96 },
66 97 checkDeliverRank: function (t) {
67   - this.setData({
68   - deliver_rank: parseInt(t.currentTarget.dataset.i) + 1
69   - });
  98 + this.setData({
  99 + deliver_rank: parseInt(t.currentTarget.dataset.i) + 1
  100 + });
70 101 },
71 102 selectPhotos: function (t) {
72 103 if (this.data.isLongPress) this.data.isLongPress = !1; else {
... ... @@ -88,8 +119,20 @@ Page({
88 119 },
89 120 submitComment: function (i) {
90 121 var a = this;
91   - if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank)
92   - return getApp().my_warnning("请先打分",0,a);
  122 + let url = '';
  123 + if(this.options.card == 1) {
  124 + this.setData({
  125 + deliver_rank: 5
  126 + });
  127 + if (!a.data.service_rank || !a.data.goods_rank)
  128 + return getApp().my_warnning("请先打分",0,a);
  129 + } else {
  130 + if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank)
  131 + return getApp().my_warnning("请先打分",0,a);
  132 + };
  133 +
  134 +
  135 +
93 136 // if(a.data.content=="")
94 137 // return getApp().my_warnning("请填写评价内容",0,a);
95 138  
... ... @@ -114,18 +157,26 @@ Page({
114 157 if(a.data.is_anonymous){
115 158 p_data['is_anonymous']=1;
116 159 }
  160 + if(this.data.options.card == 1) {
  161 + // delete p_data.goods_id;
  162 + p_data['service_id'] = this.data.options.goods_id;
  163 + url = '/api/weshop/serviceComment/savecomment';
  164 + } else {
  165 + url = '/api/weshop/comment/savecomment';
  166 + };
  167 +
117 168  
118   - e.post("/api/weshop/comment/savecomment", {
  169 + e.post(url, {
119 170 data:p_data,
120   - success: function (a) {
121   - if(a.data.code==0){
  171 + success: function (res) {
  172 + if(res.data.code==0){
122 173 wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () {
123 174 // wx.navigateBack();
124 175 var url = i.currentTarget.dataset.url;
125 176 getApp().goto(url);
126 177 });
127 178 }else{
128   - getApp().my_warnning(a.data.msg,0,a);
  179 + getApp().my_warnning(res.data.msg,0,a);
129 180 }
130 181 }
131 182 });
... ...
packageB/pages/user/add_comment/add_comment.json
1 1 {
2   - "navigationBarTitleText": "评价宝贝",
3 2 "enablePullDownRefresh": false,
4 3 "usingComponents": {
5 4 "warn": "/components/long_warn/long_warn"
... ...
packageB/pages/user/add_comment/add_comment.wxml
... ... @@ -30,7 +30,7 @@
30 30  
31 31 <!-- 商品评价信息 -->
32 32 <view class="addComment">
33   - <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!" bindinput="txtInpt" placeholder-class="fs24" maxlength="500" value="{{content}}"></textarea>
  33 + <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!" bindinput="txtInpt" placeholder-class="fs24" maxlength="500" value="{{content}}" />
34 34 <view class="flex addimages">
35 35 <!-- 评论图片集合 -->
36 36 <view class="images">
... ... @@ -74,8 +74,9 @@
74 74 </view>
75 75 </view>
76 76 </view>
77   -
78   - <view class="score-item flex-vertical">
  77 + <!-- 卡项订单不用给予物流服务评价 -->
  78 + <view class="score-item flex-vertical" wx:if="{{!options.card}}">
  79 + <!-- <view class="score-item flex-vertical"> -->
79 80 <view class="fs24">物流服务</view>
80 81 <view class="stars flex-vertical">
81 82 <view class="flex-vertical" bindtap="checkDeliverRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}">
... ... @@ -106,7 +107,12 @@
106 107 </view>
107 108  
108 109 <view class="Submission flex-level ">
109   - <view class="fs30 flex-level white " bindtap="submitComment" data-url="/packageB/pages/user/view_comment/view_comment?goods_id={{goods_id}}&order_id={{order_id}}">提交评价</view>
  110 + <block>
  111 + <!-- 卡项订单 -->
  112 + <view class="fs30 flex-level white " bindtap="submitComment" data-url="/packageB/pages/user/view_comment/view_comment?card=1&goods_id={{options.goods_id}}&order_id={{order_id}}" wx:if="{{options.card == 1}}">提交评价</view>
  113 + <!-- 其他订单 -->
  114 + <view class="fs30 flex-level white " bindtap="submitComment" data-url="/packageB/pages/user/view_comment/view_comment?goods_id={{goods_id}}&order_id={{order_id}}" wx:else>提交评价</view>
  115 + </block>
110 116 </view>
111 117 </view>
112 118  
... ...
packageB/pages/user/collect_list/collect_list.js
... ... @@ -88,10 +88,14 @@ Page({
88 88 for (var e = 0; e < this.data.collects.length; e++)
89 89 if (this.data.collects[e].collect_id == t) {
90 90 this.data.collects.splice(e, 1), this.setData({
91   - collects: this.data.collects
  91 + collects: this.data.collects,
92 92 });
93 93 break;
94 94 }
  95 +
  96 + this.setData({
  97 + total_collects: this.data.collects.length,
  98 + });
95 99 },
96 100 //图片失败,默认图片
97 101 bind_bnerr: function(e) {
... ...
packageB/pages/user/collect_list/collect_list.wxml
... ... @@ -22,7 +22,7 @@
22 22 <!-- 商品集合 -->
23 23 <view class="{{editEd?'collects_max colls_max':'collects_max'}}">
24 24 <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}"
25   - data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id:''}}">
  25 + data-url="{{item.type == 1 ? '/packageA/pages/goodsInfo/goodsInfo?goods_id=' + item.goods_id : (editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id+'&prom_type='+item.prom_type+'&prom_id='+item.prom_id:'')}}">
26 26  
27 27 <view class="radioCheck iconClick" wx:if="{{editEd}}">
28 28 <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio>
... ... @@ -56,7 +56,12 @@
56 56 </view>
57 57  
58 58 <view class="money_right flex line" wx:if="{{!editEd}}">
59   - <view class="similar flex-level fs22" catchtap="go_to" data-url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}">
  59 + <!-- 卡项订单 -->
  60 + <view wx:if="{{item.type == 1}}" class="similar flex-level fs22" catchtap="go_to" data-url="/packageA/pages/cardList/cardList?cat_id={{item.cat_id}}">
  61 + <view>找相似</view>
  62 + </view>
  63 + <!-- 其他 -->
  64 + <view wx:elif="{{item.type == 0}}" class="similar flex-level fs22" catchtap="go_to" data-url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}">
60 65 <view>找相似</view>
61 66 </view>
62 67 <image src="{{url}}miniapp/images/trash.png" catchtap="cancelCollect" data-id="{{item.collect_id}}"></image>
... ...
packageB/pages/user/comment/comment.js
... ... @@ -12,6 +12,8 @@ var t = function(t) {
12 12 os = e.globalData.setting;
13 13 var regeneratorRuntime = require('../../../../utils/runtime.js');
14 14  
  15 +
  16 +
15 17 Page({
16 18 data: {
17 19 url: e.globalData.setting.url,
... ... @@ -28,24 +30,29 @@ Page({
28 30 status: 1
29 31 }],
30 32 activeStatus: 0,
31   - comments: null,
  33 + comments: [],
32 34 currentPage: 1,
33 35 isloaded: 0,
34 36 order_id:0,
35 37 is_no_more:0,
36 38 },
  39 +
37 40 onLoad: function(t) {
38 41 var e = void 0 === t.status ? this.data.activeStatus : t.status;
39 42 this.data.order_id=t.order_id;
40   -
  43 + this.setData({
  44 + options: t,
  45 + });
41 46 //a.init(this, "", "comments"),
42 47 //this.requestComments(e);
43 48 this.requestComments_new(e);
44 49 },
  50 +
45 51 onShow: function() {
46 52 wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1),
47 53 this.resetData(), this.requestComments_new(this.data.activeStatus));
48 54 },
  55 +
49 56 changeTab: function(t) {
50 57 var e = this;
51 58 if (this.data.activeStatus == t.currentTarget.dataset.status)
... ... @@ -54,23 +61,34 @@ Page({
54 61 },
55 62  
56 63 requestComments_new:async function(t){
57   - var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage;
  64 + var e = this, th = e;
  65 + let n = '';
  66 + if(this.data.options.card == 1) { // 卡项订单
  67 + n = os.url + '/api/weshop/serviceComment/list?page=' + this.data.currentPage;
  68 + } else {
  69 + n = os.url + '/api/weshop/comment/list?page=' + this.data.currentPage;
  70 + };
  71 +
58 72 this.setData({
59   - activeStatus: t
  73 + activeStatus: t, // t为tabIndex
60 74 });
61 75  
62   - if(e.data.order_id) n+="&order_id="+e.data.order_id;
  76 + if(this.data.order_id) n+="&order_id="+e.data.order_id;
63 77 var rq_data={store_id: os.stoid, user_id: oo.user_id};
64 78 if (t!= 2) {rq_data['is_comment']=t;}
65 79  
66 80 var rs_data=null,com_data=this.data.comments;
67 81 await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{
68   - e.data.currentPage++
  82 + e.data.currentPage++;
69 83 if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
70 84 rs_data=res.data.data.pageData;
71 85 }else{
72   - th.setData({ is_no_more: 1, })
73   - }
  86 + th.setData({is_no_more: 1, comments: null});
  87 + };
  88 + if(res.data.data && res.data.data.total <= res.data.data.pageSize) {
  89 + // console.log('res======>>>', res.data.data);
  90 + th.setData({ is_no_more: 1, });
  91 + };
74 92 })
75 93  
76 94 if(rs_data){
... ... @@ -94,7 +112,7 @@ Page({
94 112 th.setData({ comments: com_data })
95 113 }
96 114  
97   - th.setData({isloaded: 1,})
  115 + th.setData({isloaded: 1,});
98 116 },
99 117  
100 118 onReachBottom: function() {
... ... @@ -130,6 +148,7 @@ Page({
130 148 _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif";
131 149 th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
132 150 },
  151 +
133 152 //预览图片
134 153 previewImg: function(e) {
135 154 var index = e.currentTarget.dataset.index;
... ...
packageB/pages/user/comment/comment.wxml
1 1 <wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
2 2 <view class="container">
  3 + <!-- tabbar -->
3 4 <view class="type-navbar padding">
4 5 <view class="type-box fs28 type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}" wx:for="{{categories}}" wx:key="{{index}}">
5 6 <view class="title_width" bindtap="changeTab" data-status="{{item.status}}">{{item.name}}</view>
6 7 </view>
7   -
8 8 </view>
9 9  
10 10 <!-- 无评价 -->
11   - <view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}">
  11 + <!-- <view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}"> -->
  12 + <view class="noCollection" wx:if="{{!comments}}" data-c="{{comments}}">
12 13 <view class="flex-level">
13 14 <image src="{{iurl}}/miniapp/images/comment.png"></image>
14 15 </view>
... ... @@ -21,41 +22,44 @@
21 22 </view>
22 23  
23 24 <!-- 待评价栏 -->
24   - <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}">
25   -
  25 + <view class="stay_evaluate" wx:if="{{comments && comments.length>0}}" wx:for="{{comments}}">
26 26 <!-- 商品编号和状态 -->
27 27 <view class="Commodity_number flex-vertical-between fs26 padding border_bottom">
28 28 <!--商品编号 -->
29   - <view>订单编号:{{item.order_sn}}</view>
  29 + <block>
  30 + <!-- 卡项订单 -->
  31 + <view wx:if="{{options.card == 1}}">订单编号:{{item.service_sn}}</view>
  32 + <view wx:else>订单编号:{{item.order_sn}}</view>
  33 + </block>
30 34 <!-- 商品评价状态 -->
31 35 <view class="xc-wc">{{item.comment_id>0?'已评价':'待评价'}}</view>
32 36 </view>
33 37  
34   - <!-- 商品详情集合 -->
35   - <view class="detail_commoditys">
  38 + <!-- 商品详情集合 - 卡项订单 -->
  39 + <view class="detail_commoditys" wx:if="{{options.card == 1}}">
36 40 <!-- 单个商品 -->
37 41 <view>
38   - <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
  42 + <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/packageA/pages/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
39 43 <!-- 商品图片 -->
40   - <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image>
  44 + <image src="{{iurl + item.img_url}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image>
41 45 <!-- 商品内容 -->
42 46 <view class="Commodity_content">
43 47 <view class="Commodity_goods">
44 48 <!-- 商品名称 -->
45   - <view class="goods_name ellipsis-2 fs26">{{item.goods_name}}</view>
  49 + <view class="goods_name ellipsis-2 fs26">{{item.service_name}}</view>
46 50 <!-- 商品规格 -->
47   - <view class="Commodity_spec fs20">
  51 + <!-- <view class="Commodity_spec fs20">
48 52 <view class="flex-center">{{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}}</view>
49   - </view>
  53 + </view> -->
50 54 </view>
51 55 <!-- 商品价格数量 -->
52 56 <view class="Commodity_money flex-vertical-between baseline">
53 57 <!-- 商品价格 -->
54 58 <view class="flex-vertical xc-wc baseline">
55 59 <view class="fs20">¥</view>
56   - <view class="fs30">{{filter.toFix(item.goods_price,2)}}</view>
  60 + <view class="fs30">{{filter.toFix(item.price,2)}}</view>
57 61 </view>
58   - <view class="fs26">x{{item.goods_num}}</view>
  62 + <view class="fs26">x{{item.qty}}</view>
59 63  
60 64 </view>
61 65 </view>
... ... @@ -72,9 +76,7 @@
72 76 <!-- 评价内容 -->
73 77 <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view>
74 78 <view class="Comment_images flex">
75   - <image wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{iurl+aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image>
76   - <image wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{iurl+aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image>
77   -
  79 + <image src="{{aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image>
78 80 </view>
79 81  
80 82 <!-- 商家回复 -->
... ... @@ -95,31 +97,122 @@
95 97 <view class="commodity_evaluate flex jc_sb padding baseline fs26">
96 98 <!-- 商品数量 -->
97 99 <view class="commodity_smy flex">
98   - <view>共{{item.goods_num}}件商品</view>
  100 + <view>共{{item.qty}}件商品</view>
99 101 <!-- 商品总价格 -->
100 102 <view class="flex commodity_money">
101 103 <view>合计:</view>
102 104 <view class="flex baseline xc-wc">
103 105 <view class="fs24">¥</view>
104   - <view>{{filter.toFix(item.goods_price,2)}}</view>
  106 + <view>{{filter.toFix(item.price,2)}}</view>
105 107 </view>
106 108 </view>
107 109 </view>
108 110 <view class="flex">
109   - <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">
  111 + <!-- <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">
110 112 <view>查看订单</view>
111   - </navigator>
  113 + </navigator> -->
112 114  
113   - <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/packageB/pages/user/view_comment/view_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}">
  115 + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/packageB/pages/user/view_comment/view_comment?card=1&goods_id={{item.card_id}}&order_id={{item.order_id}}">
114 116 <view>查看评价</view>
115 117 </navigator>
116 118  
117   - <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?'/packageB/pages/user/add_comment/add_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}':''}}">
  119 + <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.card_id}}&order_id={{item.order_id}}&price={{item.price}}">
118 120 <view class="fs24">去评价</view>
119 121 </navigator>
120 122 </view>
121 123 </view>
122 124 </view>
  125 +
  126 + <!-- 商品详情集合 -->
  127 + <view class="detail_commoditys" wx:else>
  128 + <!-- 单个商品 -->
  129 + <view>
  130 + <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
  131 + <!-- 商品图片 -->
  132 + <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image>
  133 + <!-- 商品内容 -->
  134 + <view class="Commodity_content">
  135 + <view class="Commodity_goods">
  136 + <!-- 商品名称 -->
  137 + <view class="goods_name ellipsis-2 fs26">{{item.goods_name}}</view>
  138 + <!-- 商品规格 -->
  139 + <view class="Commodity_spec fs20">
  140 + <view class="flex-center">{{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}}</view>
  141 + </view>
  142 + </view>
  143 + <!-- 商品价格数量 -->
  144 + <view class="Commodity_money flex-vertical-between baseline">
  145 + <!-- 商品价格 -->
  146 + <view class="flex-vertical xc-wc baseline">
  147 + <view class="fs20">¥</view>
  148 + <view class="fs30">{{filter.toFix(item.goods_price,2)}}</view>
  149 + </view>
  150 + <view class="fs26">x{{item.goods_num}}</view>
  151 +
  152 + </view>
  153 + </view>
  154 + </navigator>
  155 + <!-- 评论信息 -->
  156 + <view class="Commodity_evaluation padding border_bottom" wx:if="{{item.comment_id>0}}">
  157 + <!-- 评价星级 -->
  158 + <view class="starss flex fs26">
  159 + <view class="commen">评价:</view>
  160 + <view class="stars">
  161 + <image src="{{imaitem>=item.deliver_rank?iurl+'/miniapp/images/StarswhiteUnCk.png':iurl+'/miniapp/images/StarsredCk.png'}}" data-ind="{{imaitem}}" data-oo="{{item.deliver_rank}}" wx:for="{{5}}" wx:for-index="imaitem" wx:for-item="{{item_start}}"></image>
  162 + </view>
  163 + </view>
  164 + <!-- 评价内容 -->
  165 + <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view>
  166 + <view class="Comment_images flex">
  167 + <image wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{iurl+aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image>
  168 + <image wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{iurl+aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image>
  169 +
  170 + </view>
  171 +
  172 + <!-- 商家回复 -->
  173 + <view class="reply rel" wx:if="{{item.replay_list}}">
  174 + <view class="line_bulge"></view>
  175 + <view class="shop-reply fs26">店家回复: </view>
  176 + <view class="shop-font fs24" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}">
  177 + {{r_item.content}}
  178 + </view>
  179 + </view>
  180 +
  181 +
  182 + <!-- 评价时间 -->
  183 + <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view>
  184 + </view>
  185 + </view>
  186 + <!-- 去评价 -->
  187 + <view class="commodity_evaluate flex jc_sb padding baseline fs26">
  188 + <!-- 商品数量 -->
  189 + <view class="commodity_smy flex">
  190 + <view>共{{item.goods_num}}件商品</view>
  191 + <!-- 商品总价格 -->
  192 + <view class="flex commodity_money">
  193 + <view>合计:</view>
  194 + <view class="flex baseline xc-wc">
  195 + <view class="fs24">¥</view>
  196 + <view>{{filter.toFix(item.goods_price,2)}}</view>
  197 + </view>
  198 + </view>
  199 + </view>
  200 + <view class="flex">
  201 + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">
  202 + <view>查看订单</view>
  203 + </navigator>
  204 +
  205 + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level comment_go" url="/packageB/pages/user/view_comment/view_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}">
  206 + <view>查看评价</view>
  207 + </navigator>
  208 +
  209 + <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?'/packageB/pages/user/add_comment/add_comment?goods_id={{item.goods_id}}&order_id={{item.order_id}}':''}}">
  210 + <view class="fs24">去评价</view>
  211 + </navigator>
  212 + </view>
  213 + </view>
  214 + </view>
  215 +
123 216 </view>
124 217  
125 218 <view class="get_bottom fs26" wx:if="{{comments.length>0 && is_no_more}}">已经加载到底部</view>
... ...
packageB/pages/user/view_comment/view_comment.js
... ... @@ -28,7 +28,8 @@ Page({
28 28 var th = this;
29 29 th.setData({
30 30 goods_id: options.goods_id,
31   - order_id: options.order_id
  31 + order_id: options.order_id,
  32 + options: options,
32 33 })
33 34 th.query_comment();
34 35 },
... ... @@ -41,10 +42,17 @@ Page({
41 42 },
42 43 query_comment: function() {
43 44 var th = this;
  45 + let url = '';
44 46 wx.showLoading({
45 47 title: '加载中'
46 48 })
47   - var url = "/api/weshop/comment/list";
  49 +
  50 + if(this.data.options.card == 1) { // 卡项订单
  51 + url = `/api/weshop/serviceComment/list?card_id=${this.data.goods_id}`;
  52 + } else {
  53 + url = '/api/weshop/comment/list';
  54 + }
  55 +
48 56 getApp().request.promiseGet(url, {
49 57 data: {
50 58 store_id: a.stoid,
... ... @@ -105,7 +113,7 @@ Page({
105 113 if (image != "") {
106 114 image = imgArr[0].weapp_img[index];
107 115 wx.previewImage({
108   - current: iurl + image,
  116 + current: image,
109 117 //当前图片地址
110 118 urls: imgArr[0].weapp_img, //所有要预览的图片的地址集合 数组形式
111 119 })
... ... @@ -117,6 +125,8 @@ Page({
117 125 urls: imgArr[0].img, //所有要预览的图片的地址集合 数组形式
118 126 })
119 127 }
  128 +
  129 +
120 130 },
121 131 goto: function(e) {
122 132 var th = this;
... ...
packageB/pages/user/view_comment/view_comment.wxml
1 1 <view class="commoditymax" wx:for="{{comment}}" wx:if="{{index==0}}" wx:for-item="item">
2 2 <!-- 商品评价 -->
3 3 <view class='commodity'>
4   - <!-- 商品信息 -->
5   - <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}">
  4 + <!-- 卡项 -->
  5 + <navigator class='information flex-vertical' url="{{'/packageA/pages/goodsInfo/goodsInfo?goods_id='+options.goods_id}}" wx:if="{{options.card == 1}}">
  6 + <image src="{{iurl+item.img_url}}" binderror="bind_bnerr2" data-errorimg="item.img_url"></image>
  7 + <view class="goods_name xc-black">
  8 + <!-- 商品名称 -->
  9 + <view class='ellipsis-2 fs32'>{{item.service_name}}</view>
  10 +
  11 + <!-- 商品价格,数量 -->
  12 + <view class='flex jc_sb balin'>
  13 + <!-- 价格 -->
  14 + <view class='flex-vertical balin'>
  15 + <view class="fs24">¥</view>
  16 + <view class="fs35">{{item.price}}</view>
  17 + </view>
  18 +
  19 + <!-- 商品数量 -->
  20 + <view class='sum flex-vertical balin xc-black'>
  21 + <view class="fs24">x</view>
  22 + <view class="fs28">{{item.qty}}</view>
  23 + </view>
  24 +
  25 + </view>
  26 +
  27 + </view>
  28 +
  29 + </navigator>
  30 +
  31 + <!-- 其他商品 -->
  32 + <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}" wx:else>
6 33 <image src="{{iurl+item.original_img}}" binderror="bind_bnerr2" data-errorimg="item.original_img"></image>
7 34 <view class="goods_name xc-black">
8 35 <!-- 商品名称 -->
9   - <view class='ellipsis-2 fs32'>{{item.goods_name}}</view>
  36 + <view class='ellipsis-2 fs32'>{{item.goods_name}}</view>
  37 +
10 38 <!-- 商品价格,数量 -->
11 39 <view class='flex jc_sb balin'>
12 40 <!-- 价格 -->
... ... @@ -35,8 +63,16 @@
35 63 <!-- 评论图片集合 -->
36 64 <view class="images">
37 65 <block wx:if="{{item.weapp_img!=''}}">
38   - <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{iurl+item}}" wx:for="{{item.weapp_img}}" lazy-load="true">
39   - </image>
  66 + <!-- 卡项 -->
  67 + <block wx:if="{{options.card == 1}}" >
  68 + <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{item}}" wx:for="{{item.weapp_img}}" lazy-load="true"></image>
  69 + </block>
  70 +
  71 + <!-- 其他商品 -->
  72 + <block wx:else>
  73 + <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{iurl+item}}" wx:for="{{item.weapp_img}}" lazy-load="true"></image>
  74 + </block>
  75 +
40 76 </block>
41 77 <block wx:else>
42 78 <image wx:if="{{item.img!=''}}" class="rel" catchtap="previewImg" data-index="{{index}}" src="{{iurl+item}}" wx:for="{{item.img}}" lazy-load="true">
... ... @@ -68,7 +104,7 @@
68 104 </view>
69 105 </view>
70 106  
71   - <view class="score-item flex-vertical">
  107 + <view class="score-item flex-vertical" wx:if="{{!options.card}}">
72 108 <view class="fs24">物流服务</view>
73 109 <view class="stars flex-vertical">
74 110 <view class="flex-vertical" wx:for="{{5}}" wx:for-item="deliver" wx:for-index="deliver">
... ... @@ -91,14 +127,17 @@
91 127 </view>
92 128 </view>
93 129 <!-- 是否匿名评价 -->
94   -<view class="Whether" wx:if="{{comment.length>0}}">
95   - <view class="Submission flex-level ">
96   - <view class="fs30 flex-level white " bindtap="goto" data-url="/packageB/pages/user/comment/comment">评价其他</view>
97   - </view>
98   - <view class="flex-level" wx:if="{{is_act}}">
99   - <view class="fs30 flex-level white receive" data-url="/pages/giftpack/evaluategift/evaluategift?actId={{actId}}&orderNumber={{order_id}}&orderGoodsId={{goods_id}}&giftBagId={{giftBagId}}" bindtap="goto">点击领取礼品</view>
100   - </view>
101   -</view>
  130 +<block wx:if="{{!options.card}}">
  131 + <view class="Whether" wx:if="{{comment.length>0}}">
  132 + <view class="Submission flex-level ">
  133 + <view class="fs30 flex-level white " bindtap="goto" data-url="/packageB/pages/user/comment/comment">评价其他</view>
  134 + </view>
  135 + <view class="flex-level" wx:if="{{is_act}}">
  136 + <view class="fs30 flex-level white receive" data-url="/pages/giftpack/evaluategift/evaluategift?actId={{actId}}&orderNumber={{order_id}}&orderGoodsId={{goods_id}}&giftBagId={{giftBagId}}" bindtap="goto">点击领取礼品</view>
  137 + </view>
  138 + </view>
  139 +</block>
  140 +
102 141  
103 142 <!-- 引入提示组件 -->
104 143 <warn id="warn"></warn>
... ...
packageB/pages/user/view_comment/view_comment.wxss
... ... @@ -69,11 +69,12 @@ page{
69 69 margin-bottom: 15rpx;
70 70 }
71 71 .comment{
72   - overflow: hidden;
  72 + word-break: break-all;
  73 + /* overflow: hidden;
73 74 text-overflow: ellipsis;
74 75 display: -webkit-box;
75 76 -webkit-box-orient: vertical;
76   - -webkit-line-clamp: 3;
  77 + -webkit-line-clamp: 3; */
77 78 }
78 79 .addComment .addimages .images {
79 80 height: 140rpx;
... ...
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... ... @@ -121,22 +121,22 @@ Page({
121 121 tabs: ['门店自提', '快递邮寄'],
122 122 currentTabIndex: 1,
123 123  
124   - in_zhact_gdmap:{}, //不同门店参与同一活动的限购
125   - hid_inp:1,
126   - user_note:{},
127   - zuhe_map_good:{},
  124 + in_zhact_gdmap: {}, //不同门店参与同一活动的限购
  125 + hid_inp: 1,
  126 + user_note: {},
  127 + zuhe_map_good: {},
128 128 },
129   -
  129 +
130 130 onLoad: function (t) {
131   - wx.setNavigationBarTitle({title: "填写订单",})
  131 + wx.setNavigationBarTitle({ title: "填写订单", })
132 132 var th = this;
133   - this.setData({is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow,});
  133 + this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, });
134 134 th.data.param = t;
135 135 //清理一下,确保最新的系统配置
136 136 getApp().globalData.config2 = null;
137 137 //清空is_pick_up
138 138 getApp().request.put("/api/weshop/useraddress/updatePickUp", {
139   - data: {user_id: getApp().globalData.user_id, is_pickup: 0},
  139 + data: { user_id: getApp().globalData.user_id, is_pickup: 0 },
140 140 success: function (s) {
141 141 }
142 142 });
... ... @@ -144,7 +144,7 @@ Page({
144 144  
145 145 },
146 146 onUnload: function () {
147   - this.setData({isclose: 1})
  147 + this.setData({ isclose: 1 })
148 148 },
149 149 onHide: function () {
150 150 this.setData({
... ... @@ -157,7 +157,7 @@ Page({
157 157 //----------子页返回父页触发----------
158 158 onShow: function () {
159 159 var th = this;
160   - th.setData({show_submit: 0}); //让提交先掩藏
  160 + th.setData({ show_submit: 0 }); //让提交先掩藏
161 161 th.data.g_cart_q_time = null;
162 162  
163 163 if (th.data.isclose == 0) {
... ... @@ -190,20 +190,20 @@ Page({
190 190 th.data.is_summit_ing = 0;
191 191 //更换地址回来要重新调用计算价钱的接口
192 192 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
193   - th.setData({user_addr: ie});
  193 + th.setData({ user_addr: ie });
194 194 if (th.data.is_b_now == 1) {
195 195 if (th.data.bn_goods) {
196   - th.setData({add_back: 1});
  196 + th.setData({ add_back: 1 });
197 197 //th.calculatePrice2();
198 198 }
199 199 } else {
200 200 if (th.data.cartlist) {
201   - th.setData({add_back: 1});
  201 + th.setData({ add_back: 1 });
202 202 //th.calculatePrice();
203 203 }
204 204 }
205 205 } else {
206   - th.setData({user_addr: ie});
  206 + th.setData({ user_addr: ie });
207 207 }
208 208 var going = 0;
209 209  
... ... @@ -257,34 +257,34 @@ Page({
257 257 //-- 获取所有的等级卡, --
258 258 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
259 259 {}).then(res => {
260   - if (res.data.code == 0) {
261   - var plusCard = res.data.data;
262   - //-- 循环判断,拿到最贵的那张卡 --
263   - for (var ih in plusCard) {
264   - if (plusCard[ih].IsStopBuy == true) {
265   - continue;
266   - }
267   - if (max_price < 0) {
268   - max_price = plusCard[ih].CardFee;
269   - name = 'card' + plusCard[ih]['CorrPrice'];
270   - show_card = plusCard[ih];
271   - } else {
272   - if (max_price < plusCard[ih].CardFee) {
  260 + if (res.data.code == 0) {
  261 + var plusCard = res.data.data;
  262 + //-- 循环判断,拿到最贵的那张卡 --
  263 + for (var ih in plusCard) {
  264 + if (plusCard[ih].IsStopBuy == true) {
  265 + continue;
  266 + }
  267 + if (max_price < 0) {
273 268 max_price = plusCard[ih].CardFee;
274 269 name = 'card' + plusCard[ih]['CorrPrice'];
275 270 show_card = plusCard[ih];
  271 + } else {
  272 + if (max_price < plusCard[ih].CardFee) {
  273 + max_price = plusCard[ih].CardFee;
  274 + name = 'card' + plusCard[ih]['CorrPrice'];
  275 + show_card = plusCard[ih];
  276 + }
276 277 }
277 278 }
278   - }
279 279  
280   - if (show_card) {
281   - name = name.toLowerCase();
282   - th.setData({card_name: name, show_card: show_card})
  280 + if (show_card) {
  281 + name = name.toLowerCase();
  282 + th.setData({ card_name: name, show_card: show_card })
  283 + }
283 284 }
284   - }
285   - //-----先获取物流,再获取用户信息,再展示页面-----
286   - th.get_wuliu(th.get_info(th.show_page));
287   - })
  285 + //-----先获取物流,再获取用户信息,再展示页面-----
  286 + th.get_wuliu(th.get_info(th.show_page));
  287 + })
288 288 } else {
289 289 //-----先获取物流,再获取用户信息,再展示页面-----
290 290 th.get_wuliu(th.get_info(th.show_page));
... ... @@ -303,10 +303,10 @@ Page({
303 303 if (th.data.is_default_logistics) {
304 304 //如果第一个不是开启默认,说明要让用户自己选
305 305 if (!e[0].is_default) {
306   - th.setData({is_default_logistics: 0});
  306 + th.setData({ is_default_logistics: 0 });
307 307 }
308 308 }
309   - th.setData({wu_arr: e})
  309 + th.setData({ wu_arr: e })
310 310 typeof func == "function" && func();
311 311 })
312 312 },
... ... @@ -320,7 +320,7 @@ Page({
320 320 getuser_addr: function (func) {
321 321 var th = this;
322 322 a.get("/api/weshop/useraddress/page", {
323   - data: {user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random()},
  323 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random() },
324 324 success: function (su) {
325 325 /*---
326 326 var user_addr=[
... ... @@ -345,7 +345,7 @@ Page({
345 345 }
346 346  
347 347 if (item == undefined) item = null;
348   - if (!item) th.setData({user_addr: null}); //地址为空的时候,要清空,因为返回的时候,有缓存
  348 + if (!item) th.setData({ user_addr: null }); //地址为空的时候,要清空,因为返回的时候,有缓存
349 349  
350 350 func(item);
351 351 }
... ... @@ -360,19 +360,19 @@ Page({
360 360 //会员的信息,要获取最新
361 361 var user = getApp().globalData.userInfo;
362 362 getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
363   - data: {r: Math.random()},
  363 + data: { r: Math.random() },
364 364 success: function (e) {
365 365 getApp().globalData.userInfo = e.data.data;
366   - th.setData({userinfo: e.data.data});
  366 + th.setData({ userinfo: e.data.data });
367 367  
368 368 //选获取地址
369 369 th.getuser_addr(function (addr) {
370   - th.setData({user_addr: addr});
  370 + th.setData({ user_addr: addr });
371 371 //--------------------------立即购买------------------
372 372 if (ta.is_bnow == 1) {
373 373 //读取门店
374 374 to.get_allsto(function (e) {
375   - th.setData({allsto: e});
  375 + th.setData({ allsto: e });
376 376 //获取立即购买的商品信息
377 377 th.get_buy_goods(ta.goods_id);
378 378 });
... ... @@ -380,7 +380,7 @@ Page({
380 380 //------------------------购物车结算----------------------
381 381 //读取门店
382 382 to.get_allsto(function (e) {
383   - th.setData({allsto: e});
  383 + th.setData({ allsto: e });
384 384 //-------获取购物车已经选择的商品--------
385 385 th.get_cart();
386 386 })
... ... @@ -389,12 +389,12 @@ Page({
389 389  
390 390 //获取提现金额
391 391 getApp().request.get("/api/weshop/withdrawals/summoney", {
392   - data: {user_id: to.globalData.user_id, store_id: oo.stoid, status: 0},
  392 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
393 393 success: function (su) {
394 394 if (su.data.code == 0) {
395 395 var yuer = parseFloat(th.data.userinfo.user_money -
396 396 (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2);
397   - th.setData({txmon: su.data.data.summoney, yuer: yuer});
  397 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
398 398 }
399 399 }
400 400 });
... ... @@ -418,7 +418,7 @@ Page({
418 418 var arr = new Array();
419 419 var carr = su.data.data.pageData;
420 420 th.data.cartlist_y = carr; //存储原始购物车列表
421   - th.data.in_zhact_gdmap={};
  421 + th.data.in_zhact_gdmap = {};
422 422  
423 423 //---是不是购买等级卡成功的返回---等级卡显示的判断---
424 424 var is_card_back = getApp().globalData.is_card_back;
... ... @@ -427,7 +427,7 @@ Page({
427 427 var item1 = carr[i];
428 428 //把已经购买了多少见的内容填入
429 429  
430   - var goodsbuynum=0,promgoodsbuynum=0;
  430 + var goodsbuynum = 0, promgoodsbuynum = 0;
431 431 //--要获得商品,该用户买了多少件,同步应用--
432 432 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
433 433 data: {
... ... @@ -445,7 +445,7 @@ Page({
445 445 goodsbuynum = buy_num_data.goodsbuynum;
446 446 })
447 447 //如果有购买活动
448   - item1.promgoodsbuynum=promgoodsbuynum;
  448 + item1.promgoodsbuynum = promgoodsbuynum;
449 449  
450 450 //要把优惠活动加入,prom_goods_map中,赠品不要运算
451 451 if (item1.prom_type == 3 && item1.is_gift != 1) {
... ... @@ -455,9 +455,9 @@ Page({
455 455 //要把组合购的东西拿出来算一下
456 456 if (item1.prom_type == 7) {
457 457 var isok = 1;
458   - var is_flag=1;
  458 + var is_flag = 1;
459 459 //如果有组合购
460   - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id;
  460 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id + '/' + getApp().globalData.userInfo.user_id;
461 461 await getApp().request.promiseGet(url, {}).then(res => {
462 462 if (res.data.code == 0 && res.data.data) {
463 463 //如果活动已经结束
... ... @@ -488,16 +488,16 @@ Page({
488 488 data: req_data
489 489 }).then(res => {
490 490 if (ut.ajax_ok(res)) {
491   - var gdlist = res.data.data.pageData;
492   - gdlist.forEach(i=>{
493   - if(item1.goods_id==i.goods_id&&!is_flag){
494   - item1.prom_type=0;
495   - item1.prom_type1=0;
496   - item1.prom_id=0;
497   - item1.prom_id1=0
  491 + var gdlist = res.data.data.pageData;
  492 + gdlist.forEach(i => {
  493 + if (item1.goods_id == i.goods_id && !is_flag) {
  494 + item1.prom_type = 0;
  495 + item1.prom_type1 = 0;
  496 + item1.prom_id = 0;
  497 + item1.prom_id1 = 0
498 498 }
499 499 })
500   - th.data.zuhe_map_good[item1.prom_id]=gdlist;
  500 + th.data.zuhe_map_good[item1.prom_id] = gdlist;
501 501 }
502 502 })
503 503 }
... ... @@ -532,7 +532,7 @@ Page({
532 532  
533 533 item.original_img = oo.imghost + item.original_img;
534 534  
535   - var car_item=item;
  535 + var car_item = item;
536 536 /*----接口要弄出来的,先顶着-----*/
537 537 var pcid = car_item.pick_id;
538 538 var find = 0;
... ... @@ -560,7 +560,7 @@ Page({
560 560 break;
561 561 }
562 562 arr[j].exp_type = e_t;
563   - if (e_t == 0) th.setData({is_all_zt: 0});
  563 + if (e_t == 0) th.setData({ is_all_zt: 0 });
564 564 //}
565 565  
566 566 //-- 把等级卡会优惠多少钱装进去 --
... ... @@ -603,7 +603,7 @@ Page({
603 603 break;
604 604 }
605 605 //如果是物流的话,全部自提的控制要弄成0
606   - if (e_t == 0) th.setData({is_all_zt: 0});
  606 + if (e_t == 0) th.setData({ is_all_zt: 0 });
607 607  
608 608 var narr = new Array();
609 609 narr.push(car_item);
... ... @@ -662,11 +662,11 @@ Page({
662 662 var offline_price = 0;
663 663 var offline_num = 0;
664 664 for (var c = 0; c < item.length; c++) {
665   - if(th.data.sales_rules!=2){
666   - item[c].offline_price=0;
  665 + if (th.data.sales_rules != 2) {
  666 + item[c].offline_price = 0;
667 667 }
668 668 //-- 如果这个商品是线下取价的时候 --
669   - if (item[c].offline_price > 0 && item[c].prom_type != 7 ) {
  669 + if (item[c].offline_price > 0 && item[c].prom_type != 7) {
670 670 offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num;
671 671 offline_num += item[c].goods_num;
672 672 }
... ... @@ -689,10 +689,10 @@ Page({
689 689 //存储不同活动的商品列表
690 690 u_item.zh_prom_goods = {};
691 691 for (let var1 in obj) {
692   - var h_item=obj[var1];
693   - var gdlist= th.data.zuhe_map_good[h_item.prom_id];
694   - //获取活动需要的商品列表
695   - // u_item.zh_prom_goods[h_item.prom_id]=gdlist;
  692 + var h_item = obj[var1];
  693 + var gdlist = th.data.zuhe_map_good[h_item.prom_id];
  694 + //获取活动需要的商品列表
  695 + // u_item.zh_prom_goods[h_item.prom_id]=gdlist;
696 696 // var h_item = obj[var1];
697 697 // var gdlist = null;
698 698 // var url1 = "/api/weshop/prom/zhbuyGoods/page";
... ... @@ -710,7 +710,7 @@ Page({
710 710 // }
711 711 // })
712 712 //获取活动需要的商品列表
713   - u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act};
  713 + u_item.zh_prom_goods[h_item.prom_id] = { gdlist: gdlist, act: h_item.act };
714 714 }
715 715 zh_calc.fir_set_arr(u_item, th);
716 716 }
... ... @@ -723,7 +723,7 @@ Page({
723 723 setTimeout(function () {
724 724 var frozenQuan = null;
725 725 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
726   - app.request.promiseGet(url0, {1: 1}).then(res => {
  726 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
727 727 if (res.data.code == 0) {
728 728 frozenQuan = res.data.data;
729 729 th.data.frozenQuan = frozenQuan;
... ... @@ -794,7 +794,7 @@ Page({
794 794 th.data.card_name = th.data.userinfo.card_field;
795 795 gg.goods_price = gd[th.data.card_name];
796 796 getApp().globalData.is_card_back = 0;
797   - th.setData({card_cut_price: 0});
  797 + th.setData({ card_cut_price: 0 });
798 798 //如果是秒杀的返回
799 799 if (gd.prom_type == 1) gd.prom_type = 0;
800 800 } else {
... ... @@ -802,13 +802,13 @@ Page({
802 802 //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 --
803 803 if (!gg.collocation_goods && gd['prom_type'] != 6 && th.data.card_name && gd[th.data.card_name] > 0 && gg.goods_price > gd[th.data.card_name] && !th.data.userinfo.card_field) {
804 804 var cut_p = (gg.goods_price - gd[th.data.card_name]) * gg.goods_num;
805   - th.setData({card_cut_price: cut_p});
  805 + th.setData({ card_cut_price: cut_p });
806 806 }
807 807 }
808 808  
809 809  
810   - gd.prom_type=gg.prom_type;
811   - gd.prom_id=gg.prom_id;
  810 + gd.prom_type = gg.prom_type;
  811 + gd.prom_id = gg.prom_id;
812 812  
813 813 switch (gd.prom_type) {
814 814 case 0:
... ... @@ -872,7 +872,7 @@ Page({
872 872 ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式
873 873 ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额
874 874  
875   - th.setData({buy_now_gift_goods: ob});
  875 + th.setData({ buy_now_gift_goods: ob });
876 876 }
877 877 }
878 878  
... ... @@ -900,7 +900,7 @@ Page({
900 900 t.data.data.guide_id = gg.guide_id;
901 901 t.data.data.guide_type = gg.guide_type;
902 902 }
903   - th.setData({collocation_goods: gg.collocation_goods});
  903 + th.setData({ collocation_goods: gg.collocation_goods });
904 904  
905 905 var cart_arr = new Array();
906 906 //var narr=gg.collocation_goods;
... ... @@ -915,7 +915,7 @@ Page({
915 915 for (var hi in narr) {
916 916 var dis_t = narr[hi].distr_type;
917 917 if (dis_t == 2) {
918   - th.setData({is_all_zt: 0});
  918 + th.setData({ is_all_zt: 0 });
919 919 et = 0;
920 920 }
921 921 if (dis_t > 0) {
... ... @@ -957,7 +957,7 @@ Page({
957 957 if (gg.prom_type == 5) {
958 958 var frozenQuan = null;
959 959 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
960   - app.request.promiseGet(url0, {1: 1}).then(res => {
  960 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
961 961 if (res.data.code == 0) {
962 962 frozenQuan = res.data.data;
963 963 th.data.frozenQuan = frozenQuan;
... ... @@ -978,13 +978,13 @@ Page({
978 978 case 1: //---秒杀-----
979 979 var quanlist = null;
980 980 getApp().request.get("/api/weshop/activitylist/getSJGoodsPriceNew/" + gd.store_id
981   - + "/" + gd.goods_id + "/1/" + gd.prom_id+"/"+app.globalData.user_id, {
  981 + + "/" + gd.goods_id + "/1/" + gd.prom_id + "/" + app.globalData.user_id, {
982 982 success: async function (tt) {
983 983 if (tt.data.code == 0) {
984 984 //t.data.data.shop_price = tt.data.data.prom_price;
985 985 t.data.data.shop_price = tt.data.data.prom_user_price;
986   - th.data.ckeck_quan_price=0;
987   - gd.is_xz_yh=1;
  986 + th.data.ckeck_quan_price = 0;
  987 + gd.is_xz_yh = 1;
988 988 } else {
989 989 t.data.data.prom_id = 0;
990 990 t.data.data.prom_type = 0;
... ... @@ -1006,7 +1006,7 @@ Page({
1006 1006 //计算价格
1007 1007 th.calculatePrice2();
1008 1008 //获取优惠券,如果有券的钱,就调用
1009   - if(th.data.ckeck_quan_price>0) th.get_buy_now_quan();
  1009 + if (th.data.ckeck_quan_price > 0) th.get_buy_now_quan();
1010 1010 }
1011 1011 });
1012 1012  
... ... @@ -1014,7 +1014,7 @@ Page({
1014 1014  
1015 1015 case 2: //--- 团购 ---
1016 1016 var quanlist = null;
1017   - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, {
  1017 + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, {
1018 1018 success: async function (tt) {
1019 1019 if (tt.data.code == 0) {
1020 1020 //t.data.data.shop_price = tt.data.data.prom_price;
... ... @@ -1024,12 +1024,12 @@ Page({
1024 1024 t.data.data.prom_type = 0;
1025 1025 }
1026 1026  
1027   - if(tt.data.data.isQuan){
  1027 + if (tt.data.data.isQuan) {
1028 1028 th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
1029 1029 th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
1030 1030 th.data.check_quan_ware_list = t.data.data.erpwareid + "";
1031   - }else{
1032   - gd.is_xz_yh=1;
  1031 + } else {
  1032 + gd.is_xz_yh = 1;
1033 1033 }
1034 1034  
1035 1035 th.setData({
... ... @@ -1045,7 +1045,7 @@ Page({
1045 1045 //-- 计算价格 --
1046 1046 th.calculatePrice2();
1047 1047 //获取优惠券,如果有券的钱,就调用
1048   - if(th.data.ckeck_quan_price>0) th.get_buy_now_quan();
  1048 + if (th.data.ckeck_quan_price > 0) th.get_buy_now_quan();
1049 1049 }
1050 1050 });
1051 1051  
... ... @@ -1060,14 +1060,14 @@ Page({
1060 1060 checkAddressList: function () {
1061 1061 var t = this;
1062 1062 return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
1063   - title: "请先填写或选择收货地址~",
1064   - success: function (a) {
1065   - a.confirm ? t.enterAddressPage() : wx.navigateBack();
1066   - },
1067   - fail: function () {
1068   - wx.navigateBack();
1069   - }
1070   - }), !1);
  1063 + title: "请先填写或选择收货地址~",
  1064 + success: function (a) {
  1065 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  1066 + },
  1067 + fail: function () {
  1068 + wx.navigateBack();
  1069 + }
  1070 + }), !1);
1071 1071 },
1072 1072 showInvoice: function () {
1073 1073 this.setData({
... ... @@ -1086,7 +1086,7 @@ Page({
1086 1086 },
1087 1087 keyUpChangeNum: function (t) {
1088 1088 var index = t.currentTarget.dataset.index;
1089   - var txt="user_note."+index;
  1089 + var txt = "user_note." + index;
1090 1090 this.setData({
1091 1091 maxWord: t.detail.value.length,
1092 1092 [txt]: t.detail.value
... ... @@ -1176,7 +1176,7 @@ Page({
1176 1176 }
1177 1177  
1178 1178 var pt_res = null;
1179   - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
  1179 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
1180 1180 is_json: 1,
1181 1181 data: pt_data
1182 1182 }).then(res => {
... ... @@ -1231,11 +1231,11 @@ Page({
1231 1231 if (item_map.s_coupon_id) {
1232 1232 if (!cart_item.s_coupon_id) {
1233 1233 cart_item.s_coupon_id = item_map.s_coupon_id + "";
1234   - cart_item.g_coupon_num = [{'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}];
  1234 + cart_item.g_coupon_num = [{ 'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num }];
1235 1235 }
1236 1236 else {
1237 1237 cart_item.s_coupon_id += "," + item_map.s_coupon_id;
1238   - cart_item.g_coupon_num.push({'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num})
  1238 + cart_item.g_coupon_num.push({ 'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num })
1239 1239 }
1240 1240 }
1241 1241  
... ... @@ -1243,11 +1243,11 @@ Page({
1243 1243 if (item_map.s_libao) {
1244 1244 if (!cart_item.s_libao) {
1245 1245 cart_item.s_libao = item_map.s_libao + "";
1246   - cart_item.g_lb_num = [{'l_id': item_map.s_libao, "num": item_map.s_lb_num}];
  1246 + cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num }];
1247 1247 }
1248 1248 else {
1249 1249 cart_item.s_libao += "," + item_map.s_libao;
1250   - cart_item.g_lb_num.push({'l_id': item_map.s_libao, "num": item_map.s_lb_num})
  1250 + cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num })
1251 1251 }
1252 1252 }
1253 1253 }
... ... @@ -1272,7 +1272,7 @@ Page({
1272 1272 var all_cutprice = 0; //所有的优惠减
1273 1273 var all_zh_cutprice = 0; //所有的组合优惠减
1274 1274 var all_order_prom = 0; //所有的订单优惠
1275   - var out_of_weight=0; //超出多少重量
  1275 + var out_of_weight = 0; //超出多少重量
1276 1276 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
1277 1277 var freight_free = ee.freight_free; //全场满多少包邮
1278 1278 var weight_free = ee.weight_free; //多少kg内包邮
... ... @@ -1283,7 +1283,7 @@ Page({
1283 1283 if (no_ex_id && freight_free > 0) {
1284 1284 //-----------获取不包邮区域,不包邮商品-------
1285 1285 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
1286   - data: {store_id: os.stoid, id: no_ex_id}
  1286 + data: { store_id: os.stoid, id: no_ex_id }
1287 1287 }).then(res => {
1288 1288 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
1289 1289 by_qc = res.data.data[0];
... ... @@ -1303,7 +1303,7 @@ Page({
1303 1303 //调用函数计算每件商品的单价
1304 1304 await th.calc_per(c_arr);
1305 1305 //调用函数计算每件组合购商品的单价,
1306   - await zh_calc.calc_zh_split_price(c_arr,th);
  1306 + await zh_calc.calc_zh_split_price(c_arr, th);
1307 1307 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
1308 1308 await th.get_cart_quan(c_arr);
1309 1309 //---循环购物车---
... ... @@ -1326,7 +1326,7 @@ Page({
1326 1326 var cart_item = c_arr[i]; //就是每一单的意思
1327 1327 var pickid = cart_item.pickup_id;
1328 1328 var o_price = 0;
1329   - var o_price_no_zh=0; //参与订单优惠叠加--组合购的金额汇总
  1329 + var o_price_no_zh = 0; //参与订单优惠叠加--组合购的金额汇总
1330 1330 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
1331 1331 var item = c_arr[i].goods; //就是每一单的从表的意思
1332 1332  
... ... @@ -1334,8 +1334,8 @@ Page({
1334 1334 var quan_price = 0;
1335 1335 var coupon_price = 0;
1336 1336 var quan_no = null;
1337   - var is_has_zh=c_arr[i].is_has_zh;
1338   - var zh_prom_goods=c_arr[i].zh_prom_goods; //组合购计算的原始数据存储空间
  1337 + var is_has_zh = c_arr[i].is_has_zh;
  1338 + var zh_prom_goods = c_arr[i].zh_prom_goods; //组合购计算的原始数据存储空间
1339 1339  
1340 1340 if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined)
1341 1341 quan_no = th.data.using_quan[pickid].coupon_no;
... ... @@ -1363,43 +1363,42 @@ Page({
1363 1363  
1364 1364 //--------循环计算总价-----------
1365 1365 for (var j = 0; j < item.length; j++) {
1366   - if(item[j].prom_type!=7){
  1366 + if (item[j].prom_type != 7) {
1367 1367 o_price_no_zh += item[j].goods_price * item[j].goods_num;
1368 1368 }
1369 1369 //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
1370   - else if(zh_prom_goods && zh_prom_goods[item[j].prom_id] && zh_prom_goods[item[j].prom_id].act.is_orderyh )
1371   - {
  1370 + else if (zh_prom_goods && zh_prom_goods[item[j].prom_id] && zh_prom_goods[item[j].prom_id].act.is_orderyh) {
1372 1371 o_price_no_zh += item[j].goods_price * item[j].goods_num;
1373 1372 }
1374 1373 o_price += item[j].goods_price * item[j].goods_num;
1375 1374  
1376 1375 //判断是否有设置限制重量包邮
1377   - if(item[j]['is_past']!==1 && item[j]['exp_sum_type']==2){
  1376 + if (item[j]['is_past'] !== 1 && item[j]['exp_sum_type'] == 2) {
1378 1377 if (goods_weight < 0) goods_weight = 0;
1379   - //累积商品重量 每种商品的重量 * 数量
  1378 + //累积商品重量 每种商品的重量 * 数量
1380 1379 goods_weight += item[j]['weight'] * item[j]['goods_num'];
1381   - if(weight_free > 0){
1382   - out_of_weight = (weight_free*1000) - goods_weight;
  1380 + if (weight_free > 0) {
  1381 + out_of_weight = (weight_free * 1000) - goods_weight;
1383 1382 }
1384 1383 }
1385 1384 }
1386 1385 //判断是不是有组合购的金额
1387 1386 var f_o_price = o_price;
1388 1387 //如果又优惠的钱,就要减价
1389   - if (c_arr[i].cut_price > 0){
  1388 + if (c_arr[i].cut_price > 0) {
1390 1389 o_price -= c_arr[i].cut_price;
1391   - o_price_no_zh-=c_arr[i].cut_price;
  1390 + o_price_no_zh -= c_arr[i].cut_price;
1392 1391 }
1393 1392 //如果有组合购优惠的钱,就要减价
1394   - if (c_arr[i].zh_cut_price>0 || c_arr[i].zh_cut_price<0){
  1393 + if (c_arr[i].zh_cut_price > 0 || c_arr[i].zh_cut_price < 0) {
1395 1394 o_price -= c_arr[i].zh_cut_price;
1396   - if(o_price_no_zh>0){
  1395 + if (o_price_no_zh > 0) {
1397 1396 //找到那些可以订单优惠叠加的
1398   - for(let ij in zh_prom_goods){
1399   - let kitem=zh_prom_goods[ij];
1400   - var is_has_zh=kitem.is_has_zh;
1401   - if(kitem.act.is_orderyh)
1402   - o_price_no_zh-=kitem.cut_price;
  1397 + for (let ij in zh_prom_goods) {
  1398 + let kitem = zh_prom_goods[ij];
  1399 + var is_has_zh = kitem.is_has_zh;
  1400 + if (kitem.act.is_orderyh)
  1401 + o_price_no_zh -= kitem.cut_price;
1403 1402 }
1404 1403 }
1405 1404 }
... ... @@ -1407,12 +1406,12 @@ Page({
1407 1406 //-- 计算线下取价的功能 --
1408 1407 if (cart_item.is_offline == 1) {
1409 1408 o_price = o_price - cart_item.offline_price;
1410   - o_price_no_zh-=c_arr[i].offline_price;
  1409 + o_price_no_zh -= c_arr[i].offline_price;
1411 1410 }
1412 1411 //判断包邮券的钱,组合购的商品不使用优惠券
1413 1412 var q_conditin = 0;
1414 1413 q_conditin = o_price - quan_price;
1415   - if(is_has_zh){
  1414 + if (is_has_zh) {
1416 1415 q_conditin = o_price_no_zh - quan_price;
1417 1416 }
1418 1417 cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
... ... @@ -1426,12 +1425,17 @@ Page({
1426 1425 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1427 1426 if (th.check_by_area(by_qc.region_list)) {
1428 1427 freight_free = 0;
  1428 + goods_weight = -1;
  1429 + out_of_weight = 0;
1429 1430 th.data.is_no_by[pickid] = 1;
1430 1431 }
1431 1432 }
1432 1433 //如果有设置不包邮区商品
1433 1434 if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) {
1434 1435 freight_free = 0;
  1436 + goods_weight = -1;
  1437 + out_of_weight = 0;
  1438 + th.data.is_no_by[pickid] = 1;
1435 1439 no_ex_good = by_qc.goods_list;
1436 1440 }
1437 1441 }
... ... @@ -1446,7 +1450,7 @@ Page({
1446 1450 store_id: os.stoid,
1447 1451 isuse: 0,
1448 1452 //condition: q_conditin,
1449   - condition:cart_item.ckeck_quan_price,
  1453 + condition: cart_item.ckeck_quan_price,
1450 1454 user_id: getApp().globalData.user_id,
1451 1455 pageSize: 2000
1452 1456 }
... ... @@ -1471,7 +1475,7 @@ Page({
1471 1475 }
1472 1476 if (arr) {
1473 1477 th.data.get_by_quan_list_cart[pickid] = arr;
1474   - th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart});
  1478 + th.setData({ get_by_quan_list_cart: th.data.get_by_quan_list_cart });
1475 1479 //if (th.data.is_b_now) {
1476 1480 // th.setData({get_by_quan_list: arr});
1477 1481 //}
... ... @@ -1496,7 +1500,7 @@ Page({
1496 1500 if (ut.isContained(arr, arr2)) {
1497 1501 getApp().my_warnning("全场不包邮商品和包邮券的重复", 0, th);
1498 1502 th.data.using_quan[pickid] = {};
1499   - th.setData({using_quan: th.data.using_quan})
  1503 + th.setData({ using_quan: th.data.using_quan })
1500 1504 return false;
1501 1505 }
1502 1506 var n_arr = ut.mergeArray(arr, arr2);
... ... @@ -1522,7 +1526,7 @@ Page({
1522 1526 }
1523 1527  
1524 1528 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮
1525   - if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1) {
  1529 + if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >= 0) {
1526 1530 continue;
1527 1531 }
1528 1532  
... ... @@ -1535,7 +1539,7 @@ Page({
1535 1539 if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');
1536 1540  
1537 1541 //----------------如果是选择了物流---------------------
1538   - if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1 )) {
  1542 + if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1)) {
1539 1543  
1540 1544 //如果地址不为空
1541 1545 if (th.data.user_addr != null) {
... ... @@ -1545,7 +1549,7 @@ Page({
1545 1549 o_shipping_price += item[j]['uniform_exp_sum'];
1546 1550 break;
1547 1551 // case 2: //1464行已计算 不必重复计算 注释为:判断是否有设置限制重量包邮
1548   - // +''
  1552 + // +''
1549 1553 // if (goods_weight < 0) goods_weight = 0;
1550 1554 // //累积商品重量 每种商品的重量 * 数量
1551 1555 // goods_weight += item[j]['weight'] * item[j]['goods_num'];
... ... @@ -1559,12 +1563,10 @@ Page({
1559 1563 }
1560 1564 }
1561 1565  
1562   - }else{
1563   - if(item[j]['exp_sum_type']==2){
1564   - if(out_of_weight !==0){
1565   - goods_weight=-1;
1566   - out_of_weight=0;
1567   - }
  1566 + } else {
  1567 + if (item[j]['exp_sum_type'] == 2 && out_of_weight !== 0) {
  1568 + goods_weight = -1;
  1569 + out_of_weight = 0;
1568 1570 }
1569 1571 }
1570 1572 }
... ... @@ -1576,8 +1578,8 @@ Page({
1576 1578 if (th.data.wu_arr && th.data.wu_arr[cart_item.wind])
1577 1579 code = th.data.wu_arr[cart_item.wind].code;
1578 1580 cart_item.shipping_price =
1579   - th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,
1580   - goods_piece, th.data.user_addr, freight_free, o_price - quan_price, rs);
  1581 + th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  1582 + goods_piece, th.data.user_addr, freight_free, o_price - quan_price, rs, pickid);
1581 1583  
1582 1584 if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) {
1583 1585 if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了
... ... @@ -1596,19 +1598,19 @@ Page({
1596 1598 var order_prom_id = 0;
1597 1599 var o_condition = cart_item.order_amount;
1598 1600 //看一下是不是不用组合购的订单优惠的叠加
1599   - if(is_has_zh){
1600   - o_condition=o_price_no_zh-quan_price;
  1601 + if (is_has_zh) {
  1602 + o_condition = o_price_no_zh - quan_price;
1601 1603 }
1602 1604  
1603 1605 var order_m = 0;
1604 1606 //---判断是不是有订单优惠---
1605   - await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
1606   - data: {store_id: os.stoid, orderAmount: o_condition}
  1607 + await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  1608 + data: { store_id: os.stoid, orderAmount: o_condition }
1607 1609 }).then(res => {
1608 1610 if (res.data.code == 0) {
1609 1611 var ord_prom = res.data.data;
1610 1612 //么有使用券,或者活动没有限制使用优惠券
1611   - if(quan_price<=0 || !ord_prom.is_xz_yh) {
  1613 + if (quan_price <= 0 || !ord_prom.is_xz_yh) {
1612 1614 order_prom_id = ord_prom['id'];
1613 1615 switch (ord_prom['type']) {
1614 1616 case 0:
... ... @@ -1749,7 +1751,7 @@ Page({
1749 1751 }
1750 1752 }
1751 1753 var set_txt = "cartlist[" + iter + "].can_num";
1752   - th.setData({[set_txt]: num});
  1754 + th.setData({ [set_txt]: num });
1753 1755 }
1754 1756 },
1755 1757  
... ... @@ -1781,10 +1783,10 @@ Page({
1781 1783  
1782 1784 allpice = parseFloat(allpice).toFixed(2);
1783 1785 var txt = "formData.all_price";
1784   - th.setData({[txt]: allpice,});
  1786 + th.setData({ [txt]: allpice, });
1785 1787 if (cut_price) {
1786 1788 var c_txt = "formData.cut_price";
1787   - th.setData({[c_txt]: cut_price,});
  1789 + th.setData({ [c_txt]: cut_price, });
1788 1790  
1789 1791 }
1790 1792  
... ... @@ -1798,7 +1800,7 @@ Page({
1798 1800 to.getwuliuprice(async function (rs) {
1799 1801  
1800 1802 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
1801   - var out_of_weight=null; //超出多少重量
  1803 + var out_of_weight = null; //超出多少重量
1802 1804 var freight_free = ee.freight_free; //全场满多少包邮
1803 1805 var weight_free = ee.weight_free; //多少kg内包邮
1804 1806 var no_ex_id = ee.no_ex_id;
... ... @@ -1852,7 +1854,7 @@ Page({
1852 1854 arr.push(item);
1853 1855 }
1854 1856 if (arr) {
1855   - th.setData({get_by_quan_list: arr});
  1857 + th.setData({ get_by_quan_list: arr });
1856 1858 }
1857 1859 th.data.isget_by_quan[th.data.bn_pick] = 1;
1858 1860 }
... ... @@ -1868,8 +1870,8 @@ Page({
1868 1870 if (goods_weight < 0) goods_weight = 0;
1869 1871 //累积商品重量 每种商品的重量 * 数量
1870 1872 goods_weight += good['weight'] * good['buynum'];
1871   - if(weight_free > 0){
1872   - out_of_weight = (weight_free * 1000 ) - goods_weight;
  1873 + if (weight_free > 0) {
  1874 + out_of_weight = (weight_free * 1000) - goods_weight;
1873 1875 }
1874 1876 break;
1875 1877 case 3:
... ... @@ -1881,7 +1883,7 @@ Page({
1881 1883  
1882 1884 var code = "";
1883 1885 if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
1884   -
  1886 +
1885 1887 th.data.is_no_by[th.data.bn_pick] = 0;
1886 1888  
1887 1889 var no_by_data = null;
... ... @@ -1892,7 +1894,7 @@ Page({
1892 1894 if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) {
1893 1895 //-----------获取不包邮区域,不包邮商品-------
1894 1896 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
1895   - data: {store_id: os.stoid, id: no_ex_id}
  1897 + data: { store_id: os.stoid, id: no_ex_id }
1896 1898 }).then(res => {
1897 1899 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
1898 1900 no_by_data = res.data.data[0];
... ... @@ -1900,7 +1902,7 @@ Page({
1900 1902 if (res.data.data[0].region_list) {
1901 1903 if (th.check_by_area(res.data.data[0].region_list)) {
1902 1904 freight_free = 0;
1903   - out_of_weight=0;
  1905 + out_of_weight = 0;
1904 1906 th.data.is_no_by[th.data.bn_pick] = 1;
1905 1907 }
1906 1908 }
... ... @@ -1908,7 +1910,7 @@ Page({
1908 1910 if (res.data.data[0].goods_list && freight_free) {
1909 1911 if (th.check_by_goods(res.data.data[0].goods_list)) {
1910 1912 freight_free = 0;
1911   - out_of_weight=0;
  1913 + out_of_weight = 0;
1912 1914 th.data.is_no_by[th.data.bn_pick] = 1;
1913 1915 }
1914 1916 }
... ... @@ -1919,12 +1921,12 @@ Page({
1919 1921 th.data.is_by[th.data.bn_pick] = 0;
1920 1922 //--------------开始计算物流------------------
1921 1923 var shipping_price =
1922   - th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,
1923   - goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs);
  1924 + th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  1925 + goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs,th.data.bn_pick);
1924 1926  
1925 1927 //如果有赠品的时候,也要计算赠品的物流费用
1926 1928 if (th.data.buy_now_gift_goods) {
1927   - shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,out_of_weight,
  1929 + shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free, out_of_weight,
1928 1930 parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece);
1929 1931 }
1930 1932  
... ... @@ -1934,18 +1936,18 @@ Page({
1934 1936  
1935 1937 shipping_price = parseFloat(shipping_price).toFixed(2);
1936 1938 var wl_txt = "formData.shipping_price";
1937   - th.setData({[wl_txt]: shipping_price,})
  1939 + th.setData({ [wl_txt]: shipping_price, })
1938 1940  
1939 1941 } else {
1940 1942 var wl_txt = "formData.shipping_price";
1941   - th.setData({[wl_txt]: 0,})
  1943 + th.setData({ [wl_txt]: 0, })
1942 1944 }
1943 1945  
1944 1946 if (quan_no) {
1945 1947 if (th.data.using_quan[bn_pick].isby == 1) {
1946 1948 shipping_price = 0;
1947 1949 var wl_txt = "formData.shipping_price";
1948   - th.setData({[wl_txt]: 0,})
  1950 + th.setData({ [wl_txt]: 0, })
1949 1951 }
1950 1952 }
1951 1953 //-----------------支付价,优惠券不减物流-----------------
... ... @@ -1966,7 +1968,7 @@ Page({
1966 1968 var ord_prom = th.data.order_prom[th.data.bn_pick];
1967 1969  
1968 1970 //么有使用券,或者活动没有限制使用优惠券
1969   - if(coupon_price<=0 || !ord_prom.is_xz_yh) {
  1971 + if (coupon_price <= 0 || !ord_prom.is_xz_yh) {
1970 1972 order_prom_id = ord_prom['id'];
1971 1973 switch (ord_prom['type']) {
1972 1974 case 0:
... ... @@ -1984,7 +1986,7 @@ Page({
1984 1986 if (order_prom_id > 0) {
1985 1987 var order_prom_txt1 = "formData.order_prom_id";
1986 1988 var order_prom_txt2 = "formData.order_prom_amount";
1987   - th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount})
  1989 + th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
1988 1990 }
1989 1991  
1990 1992 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
... ... @@ -1994,7 +1996,7 @@ Page({
1994 1996 order_m = order_m.toFixed(2);
1995 1997  
1996 1998 var atxt = "formData.total_amount";
1997   - th.setData({[atxt]: total_m,})
  1999 + th.setData({ [atxt]: total_m, })
1998 2000  
1999 2001 var txt = "formData.user_money";
2000 2002 var txt2 = "formData.order_amount";
... ... @@ -2004,44 +2006,44 @@ Page({
2004 2006 if (th.data.bn_use_money == 1) {
2005 2007 if (amoney > order_m) {
2006 2008 order_m = parseFloat(order_m).toFixed(2);
2007   - th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1})
  2009 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
2008 2010 } else {
2009 2011 order_m = parseFloat(order_m) - parseFloat(amoney);
2010 2012 order_m = order_m.toFixed(2);
2011   - th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  2013 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2012 2014 }
2013 2015 } else {
2014   - th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  2016 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2015 2017 }
2016 2018 //优惠活动送积分
2017 2019 if (good.s_intValue) {
2018 2020 txt = "formData.give_integral";
2019   - th.setData({[txt]: good.s_intValue});
  2021 + th.setData({ [txt]: good.s_intValue });
2020 2022 }
2021 2023 //优惠送券
2022 2024 if (good.s_coupon_id) {
2023 2025 var i_txt = "formData.give_coupon_id";
2024 2026 //这个是json格式的
2025 2027 var i_txt1 = "formData.g_coupon_num";
2026   - var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}];
  2028 + var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
2027 2029 ob = JSON.stringify(ob);
2028   - th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob});
  2030 + th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
2029 2031 }
2030 2032 //优惠礼包
2031 2033 if (good.s_libao) {
2032 2034 var l_txt = "formData.give_lb_id";
2033 2035 //这个是json格式的
2034 2036 var l_txt1 = "formData.g_lb_num";
2035   - var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}];
  2037 + var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
2036 2038 ob = JSON.stringify(ob);
2037   - th.setData({[l_txt]: good.s_libao, [l_txt1]: ob});
  2039 + th.setData({ [l_txt]: good.s_libao, [l_txt1]: ob });
2038 2040 }
2039 2041 })
2040 2042 } else {
2041 2043  
2042 2044 var order_prom_txt1 = "formData.order_prom_id";
2043 2045 var order_prom_txt2 = "formData.order_prom_amount";
2044   - th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0})
  2046 + th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
2045 2047  
2046 2048  
2047 2049 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
... ... @@ -2051,7 +2053,7 @@ Page({
2051 2053 total_m = total_m.toFixed(2);
2052 2054 order_m = order_m.toFixed(2);
2053 2055  
2054   - th.setData({[atxt]: total_m,})
  2056 + th.setData({ [atxt]: total_m, })
2055 2057  
2056 2058 var txt = "formData.user_money";
2057 2059 var txt2 = "formData.order_amount";
... ... @@ -2061,37 +2063,37 @@ Page({
2061 2063 if (th.data.bn_use_money == 1) {
2062 2064 if (amoney > order_m) {
2063 2065 order_m = parseFloat(order_m).toFixed(2);
2064   - th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1})
  2066 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
2065 2067 } else {
2066 2068 order_m = parseFloat(order_m) - parseFloat(amoney);
2067 2069 order_m = order_m.toFixed(2);
2068   - th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  2070 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2069 2071 }
2070 2072 } else {
2071   - th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1})
  2073 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2072 2074 }
2073 2075 //优惠活动送积分
2074 2076 if (good.s_intValue) {
2075 2077 txt = "formData.give_integral";
2076   - th.setData({[txt]: good.s_intValue});
  2078 + th.setData({ [txt]: good.s_intValue });
2077 2079 }
2078 2080 //优惠送券
2079 2081 if (good.s_coupon_id) {
2080 2082 var i_txt = "formData.give_coupon_id";
2081 2083 //这个是json格式的
2082 2084 var i_txt1 = "formData.g_coupon_num";
2083   - var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}];
  2085 + var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
2084 2086 ob = JSON.stringify(ob);
2085   - th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob});
  2087 + th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
2086 2088 }
2087 2089 //优惠礼包
2088 2090 if (good.s_libao) {
2089 2091 var l_txt = "formData.give_lb_id";
2090 2092 //这个是json格式的
2091 2093 var l_txt1 = "formData.g_lb_num";
2092   - var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}];
  2094 + var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
2093 2095 ob = JSON.stringify(ob);
2094   - th.setData({[l_txt]: good.s_coupon_id, [l_txt1]: ob});
  2096 + th.setData({ [l_txt]: good.s_coupon_id, [l_txt1]: ob });
2095 2097 }
2096 2098 }
2097 2099  
... ... @@ -2102,7 +2104,7 @@ Page({
2102 2104 },
2103 2105  
2104 2106 //--------------------提交订单-----------------------
2105   - async submitForm(t){
  2107 + async submitForm(t) {
2106 2108 var sub_value = t;
2107 2109  
2108 2110 if (this.data.is_summit_ing == 1) return false; //--提交中退出--
... ... @@ -2174,7 +2176,7 @@ Page({
2174 2176 }
2175 2177  
2176 2178 //--判断优惠活动的提交--
2177   - if (th.data.formData.cut_price > 0 ) {
  2179 + if (th.data.formData.cut_price > 0) {
2178 2180 order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2);
2179 2181 var ob = [{
2180 2182 "prom_id": th.data.bn_goods.prom_id,
... ... @@ -2237,7 +2239,7 @@ Page({
2237 2239 goods.guide_id = gg.guide_id;
2238 2240 goods.guide_type = gg.guide_type;
2239 2241 //调用接口判断是不是会员
2240   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
  2242 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
2241 2243 if (res.data.code == 0) {
2242 2244 goods.guide_name = res.data.data.salesman;
2243 2245 goods.guide_sn = res.data.data.salesman_no;
... ... @@ -2289,7 +2291,7 @@ Page({
2289 2291 }
2290 2292  
2291 2293 var pt_res = null;
2292   - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
  2294 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
2293 2295 is_json: 1,
2294 2296 data: pt_data
2295 2297 }).then(res => {
... ... @@ -2409,14 +2411,14 @@ Page({
2409 2411 order_prom_list.order_prom_amount = t_item.order_prom_amount;
2410 2412 }
2411 2413  
2412   - order_prom_list.discount_amount =0;
  2414 + order_prom_list.discount_amount = 0;
2413 2415 //--判断优惠活动的提交--
2414 2416 if (t_item.cut_price > 0) {
2415 2417 order_prom_list.discount_amount += t_item.cut_price;
2416 2418 order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json);
2417 2419 }
2418 2420 //--判断组合优惠活动的提交--
2419   - if (t_item.zh_cut_price > 0 || t_item.zh_cut_price<0) {
  2421 + if (t_item.zh_cut_price > 0 || t_item.zh_cut_price < 0) {
2420 2422 order_prom_list.discount_amount += t_item.zh_cut_price;
2421 2423 order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json);
2422 2424 }
... ... @@ -2431,11 +2433,11 @@ Page({
2431 2433 order_prom_list.give_lb_id = t_item.s_libao;
2432 2434 order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num);
2433 2435 }
2434   - if (Object.keys(order_prom_list).length > 0){
2435   - if(order_prom_list.discount_amount)
2436   - order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);
2437   - if(order_prom_list.order_prom_amount)
2438   - order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2);
  2436 + if (Object.keys(order_prom_list).length > 0) {
  2437 + if (order_prom_list.discount_amount)
  2438 + order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2);
  2439 + if (order_prom_list.order_prom_amount)
  2440 + order_prom_list.order_prom_amount = parseFloat(order_prom_list.order_prom_amount).toFixed(2);
2439 2441 item.order_prom_list = order_prom_list;
2440 2442 }
2441 2443  
... ... @@ -2459,7 +2461,7 @@ Page({
2459 2461 //-------------让商品添加到商品列表--------------------
2460 2462 for (var k = 0; k < t_item.goods.length; k++) {
2461 2463 var g_item = t_item.goods[k];
2462   - if(g_item.goods_num<=0) continue;
  2464 + if (g_item.goods_num <= 0) continue;
2463 2465 var goods = {
2464 2466 'goods_id': g_item.goods_id,
2465 2467 'goods_name': g_item.goods_name,
... ... @@ -2472,7 +2474,7 @@ Page({
2472 2474 };
2473 2475  
2474 2476 //-- 线下取价也要写入,组合购的商品不能去线下价格 --
2475   - if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type!=7) {
  2477 + if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type != 7) {
2476 2478 goods.goods_price = g_item.offline_price;
2477 2479 goods.member_goods_price = g_item.offline_price;
2478 2480 goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
... ... @@ -2483,7 +2485,7 @@ Page({
2483 2485 if (t_item.quan_youhui_list && t_item.coupon_price) {
2484 2486 for (var kk in t_item.quan_youhui_list) {
2485 2487 var you_item = t_item.quan_youhui_list[kk];
2486   - if (g_item.prom_type!=7 && g_item.erpwareid == you_item.WareId) {
  2488 + if (g_item.prom_type != 7 && g_item.erpwareid == you_item.WareId) {
2487 2489 goods.quan_num = you_item.WareCashSum;
2488 2490 goods.quan_no = you_item.CashRepNo;
2489 2491 }
... ... @@ -2493,7 +2495,7 @@ Page({
2493 2495 //--判断活动的类型--
2494 2496 switch (g_item.prom_type) {
2495 2497 case 1:
2496   - case 2:
  2498 + case 2:
2497 2499 goods.prom_type = g_item.prom_type;
2498 2500 goods.prom_id = g_item.prom_id;
2499 2501 break;
... ... @@ -2535,7 +2537,7 @@ Page({
2535 2537 }
2536 2538  
2537 2539 //把优惠的平摊结果写进去
2538   - if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account!=undefined)) {
  2540 + if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account != undefined)) {
2539 2541 if (g_item.account >= 0) goods.account = g_item.account;
2540 2542 if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu;
2541 2543 item.is_discount_amount = 1;
... ... @@ -2546,7 +2548,7 @@ Page({
2546 2548 goods.guide_id = g_item.guide_id;
2547 2549 goods.guide_type = g_item.guide_type;
2548 2550 //调用接口判断是不是会员
2549   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
  2551 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
2550 2552 if (res.data.code == 0) {
2551 2553 goods.guide_name = res.data.data.salesman;
2552 2554 goods.guide_sn = res.data.data.salesman_no;
... ... @@ -2572,7 +2574,7 @@ Page({
2572 2574 if (pdata.length == 0) return;
2573 2575 var str = JSON.stringify(pdata);
2574 2576  
2575   - wx.showLoading({title: "加载中"});
  2577 + wx.showLoading({ title: "加载中" });
2576 2578 wx.request({
2577 2579 url: oo.url + '/api/weshop/order/createWxdOrder',
2578 2580 data: str,
... ... @@ -2603,7 +2605,7 @@ Page({
2603 2605 })
2604 2606 //要进行判断,如果是用微信支付,就要跳转到支付界面
2605 2607 if (order_amount > 0) {
2606   - th.setData({isclose: 0});
  2608 + th.setData({ isclose: 0 });
2607 2609 //void e.jumpToCart4({
2608 2610 // order_sn: data.data,
2609 2611 //}, 1);
... ... @@ -2618,12 +2620,12 @@ Page({
2618 2620 }, function () {
2619 2621 //支付失败
2620 2622 setTimeout(function () {
2621   - var cps=getCurrentPages();
2622   - if(cps.length>1){
2623   - wx.navigateBack({delta: 1})
2624   - }else{
2625   - getApp().goto("/pages/index/index/index");
2626   - }
  2623 + var cps = getCurrentPages();
  2624 + if (cps.length > 1) {
  2625 + wx.navigateBack({ delta: 1 })
  2626 + } else {
  2627 + getApp().goto("/pages/index/index/index");
  2628 + }
2627 2629  
2628 2630 }, 1000)
2629 2631 }, oo.stoid);
... ... @@ -2641,7 +2643,7 @@ Page({
2641 2643 if (t.data.code == 0) {
2642 2644 //app.my_warnning("支付成功",1,th);
2643 2645 //setTimeout(function () {
2644   - th.setData({isclose: 0});
  2646 + th.setData({ isclose: 0 });
2645 2647 wx.redirectTo({
2646 2648 url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data,
2647 2649 })
... ... @@ -2666,7 +2668,7 @@ Page({
2666 2668 cancelText: '取消',
2667 2669 confirmText: '确定',
2668 2670 showCancel: true,
2669   - success(res){
  2671 + success(res) {
2670 2672 if (res.cancel) {
2671 2673 return;
2672 2674 } else if (res.confirm) {
... ... @@ -2700,11 +2702,11 @@ Page({
2700 2702  
2701 2703 },
2702 2704 //---确认线下门店的数量足不足---
2703   - async check_store_num(goods_id, pick, goods_num, func){
  2705 + async check_store_num(goods_id, pick, goods_num, func) {
2704 2706 var lock = 0, pick_no, plist, erpwareid;
2705 2707 //先读取门店的lock
2706 2708 await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
2707   - data: {store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000}
  2709 + data: { store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000 }
2708 2710 }).then(res => {
2709 2711 if (res.data.code == 0 && res.data.data.total > 0) {
2710 2712 for (var i in res.data.data.pageData)
... ... @@ -2713,7 +2715,7 @@ Page({
2713 2715 })
2714 2716 //先获取门店的编号
2715 2717 await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, {
2716   - data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick}
  2718 + data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick }
2717 2719 }).then(res => {
2718 2720 if (res.data.code == 0) {
2719 2721 pick_no = res.data.data.pickup_no;
... ... @@ -2721,7 +2723,7 @@ Page({
2721 2723 })
2722 2724 //先获取商品的线下库存
2723 2725 await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
2724   - data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick}
  2726 + data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick }
2725 2727 }).then(res => {
2726 2728 if (res.data.code == 0) {
2727 2729 erpwareid = res.data.data.erpwareid;
... ... @@ -2729,7 +2731,7 @@ Page({
2729 2731 })
2730 2732 //读取线下的门店库存
2731 2733 await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
2732   - data: {storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000}
  2734 + data: { storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000 }
2733 2735 }).then(res => {
2734 2736 if (res.data.code == 0) {
2735 2737 plist = res.data.data.pageData[0];
... ... @@ -2771,11 +2773,11 @@ Page({
2771 2773 wl_txt = t.currentTarget.dataset.wl_txt,
2772 2774 ont = t.currentTarget.dataset.ont;
2773 2775  
2774   - th.setData({[txt]: ty});
  2776 + th.setData({ [txt]: ty });
2775 2777 var iszt = 1;
2776 2778  
2777 2779 if (ty == 0) {
2778   - th.setData({is_all_zt: 0});
  2780 + th.setData({ is_all_zt: 0 });
2779 2781 } else {
2780 2782 for (var i = 0; i < th.data.cartlist.length; i++) {
2781 2783 var item = th.data.cartlist[i];
... ... @@ -2785,7 +2787,7 @@ Page({
2785 2787 }
2786 2788 }
2787 2789  
2788   - th.setData({is_all_zt: iszt});
  2790 + th.setData({ is_all_zt: iszt });
2789 2791  
2790 2792 var ind = t.currentTarget.dataset.ind;
2791 2793 var c_item = th.data.cartlist[ind];
... ... @@ -2793,7 +2795,7 @@ Page({
2793 2795  
2794 2796 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1) {
2795 2797 th.data.using_quan[pickid] = {};
2796   - th.setData({using_quan: th.data.using_quan});
  2798 + th.setData({ using_quan: th.data.using_quan });
2797 2799 }
2798 2800  
2799 2801  
... ... @@ -2805,7 +2807,7 @@ Page({
2805 2807 for (var i = 0; i < wu_arr.length; i++) {
2806 2808 if (wu_arr[i].shipping_code == def_exp_code) {
2807 2809 var set_txt = "cartlist"
2808   - th.setData({wl_txt: i});
  2810 + th.setData({ wl_txt: i });
2809 2811 }
2810 2812 }
2811 2813 }
... ... @@ -2818,9 +2820,9 @@ Page({
2818 2820 setexptype: function (t) {
2819 2821 var th = this;
2820 2822 var ty = t.currentTarget.dataset.t, def_exp_code = getApp().globalData.userInfo.def_exp_code;
2821   - th.setData({bn_exp_type: ty});
  2823 + th.setData({ bn_exp_type: ty });
2822 2824 if (ty == 0) {
2823   - th.setData({is_all_zt: 0});
  2825 + th.setData({ is_all_zt: 0 });
2824 2826 }
2825 2827  
2826 2828 //当物流为空的时候。
... ... @@ -2833,7 +2835,7 @@ Page({
2833 2835 if (ty == 1) {
2834 2836 th.data.isget_by_quan = {};
2835 2837 if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby == 1) {
2836   - th.setData({using_quan: {}});
  2838 + th.setData({ using_quan: {} });
2837 2839 }
2838 2840 }
2839 2841  
... ... @@ -2843,7 +2845,7 @@ Page({
2843 2845 if (wu_arr != null && wu_arr != "") {
2844 2846 for (var i = 0; i < wu_arr.length; i++) {
2845 2847 if (wu_arr[i].shipping_code == def_exp_code) {
2846   - th.setData({index: i});
  2848 + th.setData({ index: i });
2847 2849 }
2848 2850 }
2849 2851 }
... ... @@ -2855,17 +2857,17 @@ Page({
2855 2857 //--------立即购买时,使用余额--------
2856 2858 set_bn_useyuer: function () {
2857 2859 var th = this;
2858   - th.setData({bn_use_money: !th.data.bn_use_money});
  2860 + th.setData({ bn_use_money: !th.data.bn_use_money });
2859 2861 th.calculatePrice2();
2860 2862 },
2861 2863 set_js_useyuer: function () {
2862 2864 var th = this;
2863   - th.setData({js_use_money: !th.data.js_use_money});
  2865 + th.setData({ js_use_money: !th.data.js_use_money });
2864 2866 th.calculatePrice();
2865 2867 },
2866 2868 //-------------------计算物流---------------
2867   - calculatewuliu: function (code, o_shipping_price, goods_weight,out_of_weight,
2868   - goods_piece, user_addr, freight_free, o_price, rs) {
  2869 + calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight,
  2870 + goods_piece, user_addr, freight_free, o_price, rs, pickid) {
2869 2871 var price = 0, th = this;
2870 2872 price += parseFloat(o_shipping_price);
2871 2873 //如果是包邮
... ... @@ -2896,7 +2898,7 @@ Page({
2896 2898 }
2897 2899 }
2898 2900 //------超出重量----------
2899   - if(out_of_weight < 0 && o_price >= freight_free){
  2901 + if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
2900 2902 fw_price = parseFloat(item['money']);
2901 2903 var out_of_weight = Math.abs(out_of_weight);
2902 2904 if (out_of_weight > item['first_weight']) {
... ... @@ -2942,13 +2944,13 @@ Page({
2942 2944 //----------立即购买,选择物流-------------
2943 2945 bindPickerChange: function (e) {
2944 2946 var ind = e.detail.value
2945   - this.setData({index: ind});
  2947 + this.setData({ index: ind });
2946 2948 this.calculatePrice2();
2947 2949 },
2948 2950 //----------购物车结算,选择物流-------------
2949 2951 bindPickerChange_w: function (e) {
2950 2952 var ind = e.detail.value, txt = e.currentTarget.dataset.txt;
2951   - this.setData({[txt]: ind});
  2953 + this.setData({ [txt]: ind });
2952 2954 this.calculatePrice();
2953 2955 },
2954 2956  
... ... @@ -2962,7 +2964,7 @@ Page({
2962 2964  
2963 2965  
2964 2966 if (bn == 1) {
2965   - th.setData({open_quan: 1, selected_quan_pick: pickid, disabled: 1});
  2967 + th.setData({ open_quan: 1, selected_quan_pick: pickid, disabled: 1 });
2966 2968 } else {
2967 2969 //---多单打开券的时候,就要判断券在其他门店是否有使用---
2968 2970 var quanlist = th.data.cartlist[cindx].quan_list;
... ... @@ -2988,9 +2990,9 @@ Page({
2988 2990 else
2989 2991 get_by_quan_list_cart[i].show_red = 0;
2990 2992 }
2991   - th.setData({by_quan_list_cart: get_by_quan_list_cart});
  2993 + th.setData({ by_quan_list_cart: get_by_quan_list_cart });
2992 2994 } else {
2993   - th.setData({by_quan_list_cart: null});
  2995 + th.setData({ by_quan_list_cart: null });
2994 2996 }
2995 2997  
2996 2998 console.log("2222222券的列表", quanlist);
... ... @@ -3006,7 +3008,7 @@ Page({
3006 3008 },
3007 3009 close_coupon: function (e) {
3008 3010 var th = this;
3009   - th.setData({open_quan: 0, disabled: 0});
  3011 + th.setData({ open_quan: 0, disabled: 0 });
3010 3012 },
3011 3013  
3012 3014 //---判断券时候在已经选择的列表中---
... ... @@ -3077,14 +3079,14 @@ Page({
3077 3079 for (var i in quanlist) {
3078 3080 quanlist[i].show_red = 0;
3079 3081 }
3080   - this.setData({selected_quan_list: quanlist});
  3082 + this.setData({ selected_quan_list: quanlist });
3081 3083 var by_quanlist = this.data.get_by_quan_list;
3082 3084 if (by_quanlist) {
3083 3085 //---所有的券的显示红色选择都清理一遍---
3084 3086 for (var inb in by_quanlist) {
3085 3087 by_quanlist[inb].show_red = 0;
3086 3088 }
3087   - this.setData({get_by_quan_list: by_quanlist});
  3089 + this.setData({ get_by_quan_list: by_quanlist });
3088 3090 }
3089 3091  
3090 3092 var by_cart_list = this.data.by_quan_list_cart;
... ... @@ -3093,7 +3095,7 @@ Page({
3093 3095 for (var inc in by_cart_list) {
3094 3096 by_cart_list[inc].show_red = 0;
3095 3097 }
3096   - this.setData({by_quan_list_cart: by_cart_list});
  3098 + this.setData({ by_quan_list_cart: by_cart_list });
3097 3099 }
3098 3100  
3099 3101 var using_quan = this.data.using_quan;
... ... @@ -3105,9 +3107,9 @@ Page({
3105 3107 using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
3106 3108 }
3107 3109 else {
3108   - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1};
  3110 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 };
3109 3111 }
3110   - this.setData({using_quan: using_quan, is_coupon: 2222});
  3112 + this.setData({ using_quan: using_quan, is_coupon: 2222 });
3111 3113 return;
3112 3114 }
3113 3115  
... ... @@ -3124,9 +3126,9 @@ Page({
3124 3126 using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
3125 3127 }
3126 3128 else {
3127   - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0};
  3129 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 };
3128 3130 }
3129   - this.setData({using_quan: using_quan});
  3131 + this.setData({ using_quan: using_quan });
3130 3132  
3131 3133 },
3132 3134  
... ... @@ -3141,7 +3143,7 @@ Page({
3141 3143 for (var ind in by_quanlist) {
3142 3144 by_quanlist[ind].show_red = 0;
3143 3145 }
3144   - this.setData({get_by_quan_list: by_quanlist});
  3146 + this.setData({ get_by_quan_list: by_quanlist });
3145 3147 }
3146 3148  
3147 3149 //--购物车过来的包邮券--
... ... @@ -3151,7 +3153,7 @@ Page({
3151 3153 for (var ind in by_cart_list) {
3152 3154 by_cart_list[ind].show_red = 0;
3153 3155 }
3154   - this.setData({by_quan_list_cart: by_cart_list});
  3156 + this.setData({ by_quan_list_cart: by_cart_list });
3155 3157 }
3156 3158 //普通券
3157 3159 var quanlist = this.data.selected_quan_list;
... ... @@ -3160,7 +3162,7 @@ Page({
3160 3162 for (var ind in quanlist) {
3161 3163 quanlist[ind].show_red = 0;
3162 3164 }
3163   - this.setData({selected_quan_list: quanlist});
  3165 + this.setData({ selected_quan_list: quanlist });
3164 3166 }
3165 3167  
3166 3168 var th = this;
... ... @@ -3171,9 +3173,9 @@ Page({
3171 3173 using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
3172 3174 }
3173 3175 else {
3174   - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1};
  3176 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 };
3175 3177 }
3176   - this.setData({using_quan: using_quan, is_coupon: 2222});
  3178 + this.setData({ using_quan: using_quan, is_coupon: 2222 });
3177 3179 return;
3178 3180 }
3179 3181  
... ... @@ -3202,9 +3204,9 @@ Page({
3202 3204 using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
3203 3205 }
3204 3206 else {
3205   - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0};
  3207 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 };
3206 3208 }
3207   - this.setData({using_quan: using_quan});
  3209 + this.setData({ using_quan: using_quan });
3208 3210 },
3209 3211  
3210 3212 //--确认使用券---
... ... @@ -3264,14 +3266,14 @@ Page({
3264 3266 //选择了的券,看是不是点击了不使用券,点击了不使用优惠券
3265 3267 if (using_quan[pickid]) {
3266 3268 if (using_quan[pickid].is_nouse_red == 1) {
3267   - using_quan[pickid] = {is_nouse_red: 1};
3268   - th.setData({using_quan: using_quan});
  3269 + using_quan[pickid] = { is_nouse_red: 1 };
  3270 + th.setData({ using_quan: using_quan });
3269 3271 if (th.data.is_b_now == 1) {
3270 3272 th.calculatePrice2();
3271 3273 } else {
3272 3274 th.calculatePrice();
3273 3275 }
3274   - th.setData({open_quan: 0});
  3276 + th.setData({ open_quan: 0 });
3275 3277 return;
3276 3278 }
3277 3279 }
... ... @@ -3290,16 +3292,16 @@ Page({
3290 3292 };
3291 3293 using_quan[pickid].isby = 1;
3292 3294 } else {
3293   - using_quan[pickid] = {coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0};
  3295 + using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 };
3294 3296 using_quan[pickid].isby = 0;
3295 3297 }
3296   - this.setData({using_quan: using_quan});
  3298 + this.setData({ using_quan: using_quan });
3297 3299 if (th.data.is_b_now == 1) {
3298 3300 th.calculatePrice2();
3299 3301 } else {
3300 3302 th.calculatePrice();
3301 3303 }
3302   - th.setData({open_quan: 0});
  3304 + th.setData({ open_quan: 0 });
3303 3305 },
3304 3306  
3305 3307 cart_set_err: function (e) {
... ... @@ -3336,7 +3338,7 @@ Page({
3336 3338 var wu_arr_txt = e.currentTarget.dataset.txt;
3337 3339 var w_sele_index = e.currentTarget.dataset.w_sele_index;
3338 3340 var is_express = null;
3339   - var ob = {open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1};
  3341 + var ob = { open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1 };
3340 3342  
3341 3343 //--如果是多个门店的时候--
3342 3344 if (w_sele_index != undefined) {
... ... @@ -3347,20 +3349,20 @@ Page({
3347 3349 },
3348 3350 // 关闭物流的弹窗
3349 3351 close_express: function () {
3350   - this.setData({open_express: 0, disabled: 0});
  3352 + this.setData({ open_express: 0, disabled: 0 });
3351 3353 },
3352 3354 // 选择物流
3353 3355 click_express_name: function (e) {
3354 3356 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
3355 3357 var index = e.currentTarget.dataset.idxe;
3356   - var ob = {is_express: index, is_shipping_code: shippingcode, disabled: 0};
  3358 + var ob = { is_express: index, is_shipping_code: shippingcode, disabled: 0 };
3357 3359 ob[this.data.wu_arr_txt] = index;
3358 3360 this.setData(ob);
3359 3361 },
3360 3362  
3361 3363 //点击确定物流
3362 3364 determine_expres: function (e) {
3363   - this.setData({open_express: 0});
  3365 + this.setData({ open_express: 0 });
3364 3366 if (this.data.is_b_now == 1)
3365 3367 this.calculatePrice2();
3366 3368 else
... ... @@ -3380,7 +3382,7 @@ Page({
3380 3382 obj[txt] = is_open;
3381 3383  
3382 3384 this.setData(obj);
3383   - this.setData({disabled: 1})
  3385 + this.setData({ disabled: 1 })
3384 3386 },
3385 3387  
3386 3388 clik_coupons2: function (e) {
... ... @@ -3395,7 +3397,7 @@ Page({
3395 3397 obj[txt] = is_open;
3396 3398  
3397 3399 this.setData(obj);
3398   - this.setData({disabled: 1})
  3400 + this.setData({ disabled: 1 })
3399 3401 },
3400 3402  
3401 3403  
... ... @@ -3404,11 +3406,11 @@ Page({
3404 3406 var th = this;
3405 3407 var is_shipping_code = this.data.is_shipping_code
3406 3408 getApp().request.put("/api/weshop/users/update", {
3407   - data: {user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
  3409 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code },
3408 3410 success: function (rse) {
3409 3411 if (rse.data.code == 0) {
3410 3412 getApp().globalData.userInfo.def_exp_code = is_shipping_code;
3411   - th.setData({open_express: 0});
  3413 + th.setData({ open_express: 0 });
3412 3414 //----计算此时购物车的价格----
3413 3415 if (th.data.is_b_now == 1) th.calculatePrice2();
3414 3416 else th.calculatePrice();
... ... @@ -3418,7 +3420,7 @@ Page({
3418 3420 },
3419 3421  
3420 3422 //更新下默认,在onshow里面
3421   - update_code(){
  3423 + update_code() {
3422 3424 var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
3423 3425 //--定时器,判断wu_arr不未空--
3424 3426 var uii = setInterval(function () {
... ... @@ -3432,7 +3434,7 @@ Page({
3432 3434 }
3433 3435 //--如果是立即购买--
3434 3436 if (th.data.is_b_now == 1) {
3435   - th.setData({index: m_wind, is_express: m_wind});
  3437 + th.setData({ index: m_wind, is_express: m_wind });
3436 3438 } else {
3437 3439 var ui = setInterval(function () {
3438 3440 if (th.data.cartlist) {
... ... @@ -3440,7 +3442,7 @@ Page({
3440 3442 for (var i in c_arr) {
3441 3443 c_arr[i].wind = m_wind;
3442 3444 }
3443   - th.setData({cartlist: c_arr, is_express: m_wind})
  3445 + th.setData({ cartlist: c_arr, is_express: m_wind })
3444 3446 clearInterval(ui);
3445 3447 }
3446 3448 }, 500)
... ... @@ -3479,13 +3481,13 @@ Page({
3479 3481 }
3480 3482  
3481 3483 //--如果是团购,要判断有没有限制使用优惠券
3482   - if(gd.prom_type == 2){
3483   - var prom1=null;
  3484 + if (gd.prom_type == 2) {
  3485 + var prom1 = null;
3484 3486 await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, {
3485 3487 }).then(res => {
3486 3488 if (res.data.code == 0) prom1 = res.data.data;
3487 3489 })
3488   - if(!prom1.isQuan){
  3490 + if (!prom1.isQuan) {
3489 3491 continue;
3490 3492 }
3491 3493 }
... ... @@ -3555,10 +3557,10 @@ Page({
3555 3557 if (th.data.is_b_now) {
3556 3558 if (arr && arr.length > 0) {
3557 3559 var quanlist = arr[0].quan_list;
3558   - th.setData({selected_quan_list: quanlist, cartlist: arr})
  3560 + th.setData({ selected_quan_list: quanlist, cartlist: arr })
3559 3561 }
3560 3562 } else {
3561   - th.setData({cartlist: arr})
  3563 + th.setData({ cartlist: arr })
3562 3564 th.set_can_num();
3563 3565 }
3564 3566  
... ... @@ -3578,7 +3580,7 @@ Page({
3578 3580 if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) {
3579 3581 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
3580 3582 var url = "/api/weshop/couponList/getUseCouponList";
3581   - app.request.promiseGet(url0, {1: 1}).then(res => {
  3583 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
3582 3584 if (res.data.code == 0) {
3583 3585 frozenQuan = res.data.data;
3584 3586 th.data.frozenQuan = frozenQuan;
... ... @@ -3596,7 +3598,7 @@ Page({
3596 3598 quanlist = res.data.data.pageData;
3597 3599 if (quanlist) {
3598 3600 quanlist = th.check_is_frozenQuan(quanlist, frozenQuan);
3599   - th.setData({selected_quan_list: quanlist})
  3601 + th.setData({ selected_quan_list: quanlist })
3600 3602 }
3601 3603 }
3602 3604 }
... ... @@ -3624,7 +3626,7 @@ Page({
3624 3626 if (!goods_id) goods_id = this.data.bn_goods.goods_id;
3625 3627 for (var i in arr) {
3626 3628 var item = arr[i];
3627   - if (goods_id == item) return 0;
  3629 + if (goods_id == item) return 0;
3628 3630 }
3629 3631 return 1;
3630 3632 },
... ... @@ -3695,7 +3697,7 @@ Page({
3695 3697 if (this.data.is_b_now == 1) pick = this.data.bn_pick;
3696 3698 //---获取订单优惠---
3697 3699 getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
3698   - data: {store_id: os.stoid, orderAmount: condition}
  3700 + data: { store_id: os.stoid, orderAmount: condition }
3699 3701 }).then(res => {
3700 3702 if (res.data.code == 0) {
3701 3703 var data = res.data.data;
... ... @@ -3717,7 +3719,7 @@ Page({
3717 3719 var ob = map[pickid][item.prom_id];
3718 3720 ob.price += item.goods_price * item.goods_num;
3719 3721 ob.goods_num += item.goods_num;
3720   - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3722 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3721 3723  
3722 3724 } else {
3723 3725 var prom = null;
... ... @@ -3733,7 +3735,7 @@ Page({
3733 3735 ob.is_bz = prom.is_bz;
3734 3736 ob.is_xz_yh = prom.is_xz_yh;
3735 3737 ob.goods = new Array();
3736   - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3738 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3737 3739 map[pickid][item.prom_id] = ob;
3738 3740 }
3739 3741 } else {
... ... @@ -3750,7 +3752,7 @@ Page({
3750 3752 ob.is_bz = prom.is_bz;
3751 3753 ob.is_xz_yh = prom.is_xz_yh;
3752 3754 ob.goods = new Array();
3753   - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num});
  3755 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3754 3756  
3755 3757 var obj = {};
3756 3758 obj[item.prom_id] = ob;
... ... @@ -3760,7 +3762,7 @@ Page({
3760 3762 },
3761 3763  
3762 3764 //计算立即购买赠品的物流费用
3763   - get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free,gift_weight_free, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
  3765 + get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free, gift_weight_free, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
3764 3766 var good = this.data.buy_now_gift_goods;
3765 3767 var goods_weight = -1, goods_piece = -1;
3766 3768 var gift_shipping_price = 0;
... ... @@ -3776,8 +3778,9 @@ Page({
3776 3778 //累积商品重量 每种商品的重量 * 数量
3777 3779 goods_weight += good['weight'] * good['buynum'];
3778 3780 if (goods_weight1 > 0) {
  3781 + out_of_weight = gift_weight_free - goods_weight;
  3782 + //不能调换位置 下面goods_weight会变大
3779 3783 goods_weight += goods_weight1;
3780   - out_of_weight = (gift_weight_free*1000) - goods_weight;
3781 3784 }
3782 3785 break;
3783 3786 case 3:
... ... @@ -3795,7 +3798,7 @@ Page({
3795 3798 if (no_by_data && no_by_data.region_list) {
3796 3799 if (th.check_by_area(no_by_data.region_list)) {
3797 3800 gift_freight_free = 0;
3798   - out_of_weight=0;
  3801 + out_of_weight = 0;
3799 3802 th.data.is_no_by[th.data.bn_pick] = 1;
3800 3803 }
3801 3804 }
... ... @@ -3803,14 +3806,15 @@ Page({
3803 3806 if (no_by_data && no_by_data.goods_list && gift_freight_free) {
3804 3807 if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) {
3805 3808 gift_freight_free = 0;
3806   - out_of_weight=0;
  3809 + out_of_weight = 0;
  3810 + th.data.is_no_by[th.data.bn_pick] = 1;
3807 3811 //th.data.is_no_by[th.data.bn_pick]=1;
3808 3812 }
3809 3813 }
3810 3814  
3811 3815 var t_shipping_price =
3812   - this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight,
3813   - goods_piece, user_addr, gift_freight_free, allpice, rs);
  3816 + this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight,
  3817 + goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick);
3814 3818 return t_shipping_price;
3815 3819  
3816 3820 },
... ... @@ -3867,7 +3871,7 @@ Page({
3867 3871  
3868 3872 //跳转关闭弹出框的显示
3869 3873 close_offline: function () {
3870   - this.setData({is_offline_show: 0});
  3874 + this.setData({ is_offline_show: 0 });
3871 3875 },
3872 3876  
3873 3877 //立即购买显示弹出框
... ... @@ -3875,7 +3879,7 @@ Page({
3875 3879 var off_price = this.data.bn_goods.shop_price - this.data.bn_goods.offline_price;
3876 3880 //是不是线下
3877 3881 var is_get_offline = this.data.bn_goods.is_offline;
3878   - this.setData({is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline});
  3882 + this.setData({ is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline });
3879 3883 },
3880 3884  
3881 3885 //确定使用线下取价
... ... @@ -3883,14 +3887,14 @@ Page({
3883 3887 var bn_goods = this.data.bn_goods;
3884 3888 if (bn_goods && bn_goods.prom_type == 0) {
3885 3889 bn_goods.is_offline = 1;
3886   - this.setData({is_offline_show: 0, bn_goods: bn_goods});
  3890 + this.setData({ is_offline_show: 0, bn_goods: bn_goods });
3887 3891 this.calculatePrice2();
3888 3892 }
3889 3893 //就是购物车结算时的
3890 3894 else {
3891 3895 var index = this.data.pop_offline_index;
3892 3896 var txt = "cartlist[" + index + "].is_offline";
3893   - this.setData({[txt]: 1, is_offline_show: 0,});
  3897 + this.setData({ [txt]: 1, is_offline_show: 0, });
3894 3898 this.data.old_cartlist[index].is_offline = 1;
3895 3899 this.calculatePrice();
3896 3900 }
... ... @@ -3902,14 +3906,14 @@ Page({
3902 3906 var bn_goods = this.data.bn_goods;
3903 3907 if (bn_goods && bn_goods.prom_type == 0) {
3904 3908 bn_goods.is_offline = 0;
3905   - this.setData({is_offline_show: 0, bn_goods: bn_goods});
  3909 + this.setData({ is_offline_show: 0, bn_goods: bn_goods });
3906 3910 this.calculatePrice2();
3907 3911 }
3908 3912 //就是购物车结算时的
3909 3913 else {
3910 3914 var index = this.data.pop_offline_index;
3911 3915 var txt = "cartlist[" + index + "].is_offline";
3912   - this.setData({[txt]: 0, is_offline_show: 0,})
  3916 + this.setData({ [txt]: 0, is_offline_show: 0, })
3913 3917 this.data.old_cartlist[index].is_offline = 0;
3914 3918 this.calculatePrice();
3915 3919 }
... ... @@ -3930,19 +3934,19 @@ Page({
3930 3934 });
3931 3935 },
3932 3936  
3933   - set_hid_inp:function (e) {
  3937 + set_hid_inp: function (e) {
3934 3938 var index = e.currentTarget.dataset.index;
3935 3939 var txt = "cartlist[" + index + "].focus";
3936   - this.setData({[txt]:1})
  3940 + this.setData({ [txt]: 1 })
3937 3941 },
3938 3942  
3939   - clear_hid_inp:function (e) {
  3943 + clear_hid_inp: function (e) {
3940 3944 var index = e.currentTarget.dataset.index;
3941 3945 var txt = "cartlist[" + index + "].focus";
3942   - this.setData({[txt]:0})
  3946 + this.setData({ [txt]: 0 })
3943 3947 },
3944 3948  
3945   - go_url:function (e) {
  3949 + go_url: function (e) {
3946 3950 var url = e.currentTarget.dataset.url;
3947 3951 getApp().goto(url);
3948 3952 }
... ...
pages/cart/cart/cart.js
... ... @@ -1097,7 +1097,7 @@ Page({
1097 1097 goods_id: a.goods_id,
1098 1098 store_id: oo.stoid
1099 1099 };
1100   - // this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  1100 + this.postCardList_ser(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
1101 1101  
1102 1102 },
1103 1103 //-------------减数量---------------------
... ... @@ -1111,7 +1111,7 @@ Page({
1111 1111 a = this.data.service_data[b].goods[a];
1112 1112 this.data.btn_click = 1;
1113 1113  
1114   - if (a.goods_num - 1 < 0) {
  1114 + if (a.goods_num - 1 <= 0) {
1115 1115 this.data.up_dating = 0;
1116 1116 return false;
1117 1117 }
... ...
pages/cart/cart/cart.wxml
... ... @@ -128,8 +128,7 @@
128 128 <view class="count">
129 129 <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
130 130 <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}"
131   - bindinput="refresh_input"
132   - type="number" value="{{items.goods_num}}"></input>
  131 + bindinput="refresh_input" type="number" value="{{items.goods_num}}"></input>
133 132 <view class="add" bindtap="addNum" data-pitems="{{pidx}}" data-item="{{idx}}">+</view>
134 133 </view>
135 134 </view>
... ...
pages/cart/cart/cart.wxss
... ... @@ -109,7 +109,7 @@ radio {
109 109 }
110 110  
111 111 .count>view, .count>input {
112   - width: 45rpx;
  112 + width: 50rpx;
113 113 height: 40rpx;
114 114 line-height: 40rpx;
115 115 text-align: center;
... ... @@ -139,7 +139,7 @@ radio {
139 139 color: #ccc;
140 140 }
141 141 .count>input {
142   - margin: 0 10rpx;
  142 + margin: 0 14rpx;
143 143 line-height: normal;
144 144 }
145 145  
... ...
pages/cart/cart2/cart2.js
... ... @@ -6,6 +6,9 @@ var util_pay = require(&quot;../../../utils/pay.js&quot;);
6 6 var zh_calc = require("zh_calculate.js");
7 7 var ladder_calc = require("ladder_calculate.js");
8 8  
  9 +// 防抖函数用定时器
  10 +let timer;
  11 +
9 12 Page({
10 13 data: {
11 14 url: t.globalData.setting.url,
... ... @@ -1014,7 +1017,7 @@ Page({
1014 1017 }
1015 1018 //自选的时候,系统配置了默认的配送方式是物流的时候
1016 1019 if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) {
1017   - et = 2;
  1020 + et = 0;
1018 1021 }
1019 1022  
1020 1023  
... ... @@ -1647,8 +1650,8 @@ Page({
1647 1650 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
1648 1651 }
1649 1652  
1650   - //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮
1651   - if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1) {
  1653 + //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量
  1654 + if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >=0 ) {
1652 1655 continue;
1653 1656 }
1654 1657  
... ... @@ -1670,15 +1673,14 @@ Page({
1670 1673 //统一运费
1671 1674 o_shipping_price += item[j]['uniform_exp_sum'];
1672 1675 break;
1673   - case 2:
1674   - +''
1675   - if (goods_weight < 0) goods_weight = 0;
1676   - //累积商品重量 每种商品的重量 * 数量
1677   - goods_weight += item[j]['weight'] * item[j]['goods_num'];
1678   - if (weight_free > 0) {
1679   - out_of_weight = (weight_free * 1000) - goods_weight;
1680   - }
1681   - break;
  1676 + // case 2:
  1677 + // if (goods_weight < 0) goods_weight = 0;
  1678 + // //累积商品重量 每种商品的重量 * 数量
  1679 + // goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1680 + // if (weight_free > 0) {
  1681 + // out_of_weight = (weight_free * 1000) - goods_weight;
  1682 + // }
  1683 + // break;
1682 1684 case 3:
1683 1685 if (goods_piece < 0) goods_piece = 0;
1684 1686 //累积商品数量
... ... @@ -1686,6 +1688,11 @@ Page({
1686 1688 break;
1687 1689 }
1688 1690 }
  1691 + }else{
  1692 + if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
  1693 + goods_weight = -1;
  1694 + out_of_weight = 0;
  1695 + }
1689 1696 }
1690 1697 }
1691 1698  
... ... @@ -2094,7 +2101,7 @@ Page({
2094 2101 th.check_is_order_prom(o_condition, function () {
2095 2102 var order_prom_amount = 0;
2096 2103 var order_prom_id = 0;
2097   - if (th.data.order_prom[th.data.bn_pick]) {
  2104 + if (th.data.order_prom[th.data.bn_pick] && th.data.order_prom[th.data.bn_pick]['money'] <= o_condition) {
2098 2105 var ord_prom = th.data.order_prom[th.data.bn_pick];
2099 2106 //么有使用券,或者活动没有限制使用优惠券
2100 2107 if (coupon_price <= 0 || !ord_prom.is_xz_yh) {
... ... @@ -4260,6 +4267,24 @@ Page({
4260 4267 })
4261 4268  
4262 4269 },
  4270 +
  4271 +
  4272 +
  4273 + setexptype2: function(e) {
  4274 + this.debounce(this.setexptype.bind(this, e),400)();
  4275 + },
  4276 +
  4277 + setexptype_w2: function(e) {
  4278 + this.debounce(this.setexptype_w.bind(this, e),400)();
  4279 + },
  4280 +
  4281 + // 函数防抖
  4282 + debounce: function (func, wait) {
  4283 + return () => {
  4284 + clearTimeout(timer);
  4285 + timer = setTimeout(func, wait);
  4286 + };
  4287 + },
4263 4288  
4264 4289  
4265 4290 });
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -9,10 +9,10 @@
9 9 <block wx:if="{{is_b_now==1}}">
10 10 <view class="tab-container">
11 11 <view class="tab-wrapper">
12   - <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  12 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype2' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
13 13 data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
14 14  
15   - <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  15 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype2' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
16 16 data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
17 17  
18 18 </view>
... ... @@ -22,10 +22,10 @@
22 22 <block wx:if="{{is_b_now==0 && cartlist.length==1}}">
23 23 <view class="tab-container">
24 24 <view class="tab-wrapper">
25   - <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}"
  25 + <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w2' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}"
26 26 data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
27 27  
28   - <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}"
  28 + <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w2' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}"
29 29 data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
30 30  
31 31 </view>
... ... @@ -145,7 +145,7 @@
145 145 <!-- 当是物流很多单的时候 -->
146 146 <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}">
147 147 <view class="flex-vertical" >
148   - <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
  148 + <view bindtap='setexptype_w2' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
149 149 style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
150 150 <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> -->
151 151  
... ... @@ -156,10 +156,10 @@
156 156 <block wx:else>
157 157 <view class="circle xc-hookts on"></view>
158 158 </block>
159   - <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
  159 + <view bindtap='setexptype_w2' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
160 160 </view>
161 161  
162   - <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};">
  162 + <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w2" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};">
163 163 <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> -->
164 164 <block wx:if="{{item.exp_type==0}}">
165 165 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
... ... @@ -169,7 +169,7 @@
169 169 <view class="circle xc-hookts on"></view>
170 170 </block>
171 171  
172   - <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
  172 + <view bindtap='setexptype_w2' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
173 173 class="yu_er">快递邮寄</view>
174 174 </view>
175 175 </view>
... ...
pages/distribution/distribution.js
... ... @@ -3,6 +3,19 @@ const app = getApp();
3 3 let self = null, os = app.globalData.setting;
4 4 var regeneratorRuntime = require('../../utils/runtime.js');
5 5  
  6 +// Component({
  7 +// pageLifetimes: {
  8 +// show() {
  9 +// if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  10 +// this.getTabBar().setData({
  11 +// active: 2
  12 +// })
  13 +// }
  14 +// }
  15 +// }
  16 +// })
  17 +
  18 +
6 19 Page({
7 20  
8 21 /**
... ... @@ -57,7 +70,13 @@ Page({
57 70 /**
58 71 * 生命周期函数--监听页面显示
59 72 */
60   - onShow: function () {
  73 + onShow: function () {
  74 + if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  75 + this.getTabBar().setData({
  76 + active: 2
  77 + })
  78 + };
  79 +
61 80 var self=this,userinfo=app.globalData.userInfo;
62 81 if(!app.globalData.userInfo){
63 82 return false;
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -60,14 +60,17 @@ Page({
60 60 is_hot: 0,
61 61 msgStatus:false, //页面显示暂无数据状态
62 62 countDownNum: 3,
63   - timer: '', //定时器
  63 + timer: null, //定时器
64 64 lastMsg:false,
65 65 toView:"",
66 66 is_show_class:false,//是否添加新样式
67 67 status_show:0,
68 68 currentTab: 0, //预设当前项的值
69 69  
70   - load:0,
  70 + load:0,
  71 + xmlist: null,
  72 +
  73 +
71 74 },
72 75  
73 76  
... ... @@ -134,6 +137,7 @@ Page({
134 137  
135 138 if (this.data.is_used_share==0){
136 139 this.get_nation();
  140 + this.getServiceCategory();
137 141 }
138 142  
139 143 //风格三
... ... @@ -202,7 +206,7 @@ Page({
202 206 if(this.data.load) return false;
203 207  
204 208 getApp().getConfig2(function (e) {
205   -
  209 + console.log('card------------>>>>', e);
206 210 var data=e;
207 211 var switch_list_data = data.switch_list;
208 212 var switch_list = JSON.parse(switch_list_data);
... ... @@ -215,13 +219,14 @@ Page({
215 219 if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); }
216 220 if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); }
217 221 if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); }
  222 + if (e.categoryset.indexOf("," + 4 + ",") != -1) { that.setData({ is_show_xm: 1 }); }
218 223 that.setData({ store_config: e,is_do:1 });
219 224  
220 225 //---有勾品类---
221 226 if (that.data.is_show_pl){
222 227 that.requestFirstCategoris();
223 228 }
224   - if (that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl){
  229 + if (that.data.is_show_xm != 1 && that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl){
225 230 that.data.pl_timer = setInterval(function () {
226 231 if (that.data.one_level_classify.length>0){
227 232 var item=that.data.one_level_classify[0],arr=item.array;
... ... @@ -259,6 +264,7 @@ Page({
259 264 if (that.data.is_show_pl) that.setData({ currentTab: 0 });
260 265 else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); }
261 266 else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); }
  267 + else if (that.data.is_show_xm) {that.setData({ currentTab: 3 });that.getServiceCategory(); }
262 268  
263 269 //----求传参过来的控制-----
264 270 if (getApp().globalData.cat_type == 1 && that.data.is_show_gb ) {
... ... @@ -267,6 +273,9 @@ Page({
267 273 } else if (getApp().globalData.cat_type == 2 && that.data.is_show_pp ) {
268 274 that.setData({ currentTab: 2 });
269 275 that.get_brand();
  276 + } else if (getApp().globalData.cat_type == 3 && that.data.is_show_xm ) {
  277 + that.setData({ currentTab: 3 });
  278 + that.getServiceCategory();
270 279 } else if (that.data.is_show_pl) {
271 280 that.setData({ currentTab: 0 });
272 281 }
... ... @@ -277,7 +286,7 @@ Page({
277 286 that.setData({ status_show: 2 });
278 287 }
279 288  
280   - that.data.load=1;
  289 + that.data.load=1;
281 290 })
282 291  
283 292 },
... ... @@ -402,6 +411,13 @@ Page({
402 411 if (e.detail.current == 2 && that.data.groups == null) {
403 412 that.get_brand();
404 413 }
  414 +
  415 + //获取服务卡项
  416 + if (e.detail.current == 3 && that.data.xmlist == null) {
  417 + that.getServiceCategory();
  418 + }
  419 +
  420 +
405 421 },
406 422 //-----------点击切换-----------
407 423 clickTab: function (e) {
... ... @@ -422,9 +438,15 @@ Page({
422 438 if (e.detail.current == 2 && that.data.groups == null) {
423 439 that.get_brand();
424 440 }
  441 +
  442 + //获取服务卡项
  443 + if (e.detail.current == 3 && that.data.xmlist == null) {
  444 + that.getServiceCategory();
  445 + }
  446 +
425 447 },
426 448  
427   - tabLetter(e) {
  449 + tabLetter(e) {
428 450 const index = e.currentTarget.dataset.index;
429 451 this.setData({
430 452 selected: index,
... ... @@ -488,8 +510,9 @@ Page({
488 510 var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid;
489 511 wx.navigateTo({ url: lurl });
490 512 },
  513 +
491 514 //获取国别
492   - get_nation:function(){
  515 + get_nation:function() {
493 516 var s = this;
494 517 e.get("/api/weshop/nation/page", {
495 518 data: {
... ... @@ -575,6 +598,33 @@ Page({
575 598 }
576 599 });
577 600 },
  601 +
  602 +
  603 + // 获取服务卡项分类
  604 + getServiceCategory: function() {
  605 + var s = this;
  606 + e.get("/api/weshop/serviceCategory/page", {
  607 + data: {
  608 + is_show: 1,
  609 + store_id:oo.stoid,
  610 + pageSize: 1000,
  611 + },
  612 + success: function (e) {
  613 + var dda = e.data.data.pageData;
  614 + s.setData({
  615 + xmlist:dda,
  616 + });
  617 + }
  618 + });
  619 + },
  620 +
  621 +
  622 + goServiceCategoryList: function(t) {
  623 + var cid = t.currentTarget.dataset.cid;
  624 + var lurl = "/packageA/pages/cardList/cardList?cat_id=" + cid;
  625 + wx.navigateTo({ url: lurl });
  626 + },
  627 +
578 628 //---------分享配置--------
579 629 onShareAppMessage: function (e) {
580 630  
... ... @@ -656,10 +706,12 @@ Page({
656 706 // 新的版本分类点击一级分类
657 707 click_classify:function(e){
658 708 // 在风格三的时候,才会有current
  709 + clearInterval(this.data.timer);
  710 +
659 711 let cur = e.currentTarget.dataset.current;
660 712 if(cur) {
661 713 if (this.data.currentTab == cur) {
662   - if (this.data.select_classify_on != 220 && this.data.select_classify_on != 223) {
  714 + if (this.data.select_classify_on != 220 && this.data.select_classify_on != 221 && this.data.select_classify_on != 223) {
663 715 return false;
664 716 } else if (cur != 0) {
665 717 return false;
... ... @@ -675,6 +727,9 @@ Page({
675 727 this.checkCor();
676 728 }
677 729 }
  730 + this.setData({
  731 + countDownNum: 3,
  732 + });
678 733 // if(e.currentTarget.dataset.index == 223){
679 734 // this.setData({ status_show: 1});
680 735 // }else if(e.currentTarget.dataset.index == 220){
... ... @@ -692,7 +747,7 @@ Page({
692 747 }
693 748 this.setData({ one_level_classify: arr2});
694 749 //this.data.one_level_classify[e.currentTarget.dataset.index]['items']['is_show_class'] = true
695   - console.log(e.currentTarget.dataset.index)
  750 + // console.log(e.currentTarget.dataset.index)
696 751 clearInterval(this.data.timer);
697 752 this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0});
698 753 this.data.ishaf_three = 0;
... ... @@ -746,6 +801,8 @@ Page({
746 801 _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
747 802 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
748 803 },
  804 +
  805 +
749 806 //选择更多
750 807 select_more:function(e){
751 808 var cid = e.currentTarget.dataset.cid;
... ... @@ -754,6 +811,8 @@ Page({
754 811 wx.navigateTo({ url: lurl });
755 812  
756 813 },
  814 +
  815 +
757 816 //扫一扫
758 817 getScancode:function(){
759 818 var _this = this;
... ... @@ -767,6 +826,8 @@ Page({
767 826 }
768 827 })
769 828 },
  829 +
  830 +
770 831 onUnload: function () {
771 832 //this.destroyActivityTimer();
772 833 },
... ...
pages/goods/categoryList/categoryList.wxml
... ... @@ -12,6 +12,8 @@
12 12 data-current="1" bindtap="clickTab">国家</view>
13 13 <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}"
14 14 data-current="2" bindtap="clickTab">品牌</view>
  15 + <view wx:if="{{is_show_xm}}" class="swiper-tab-item {{currentTab==3?'active':''}}"
  16 + data-current="3" bindtap="clickTab">项目</view>
15 17 </view>
16 18 </view>
17 19 <view class="search-box " bindtap="goseach">
... ... @@ -22,7 +24,7 @@
22 24 <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input>
23 25 </view>
24 26 </view>
25   - <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
  27 + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
26 28 <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;margin-bottom:120rpx">
27 29 <!--------分类---------->
28 30 <swiper-item >
... ... @@ -86,6 +88,31 @@
86 88 </view>
87 89 </view>
88 90 </swiper-item>
  91 + <!-------项目---------->
  92 + <swiper-item wx:if="{{is_show_xm}}">
  93 + <scroll-view scroll-y="true" class="fenlei-list"
  94 + scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;" >
  95 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  96 + <block wx:for="{{xmlist}}" wx:for-item="fitem" >
  97 + <view class='f_item'>
  98 + <view class="pic_view" bindtap="goServiceCategoryList" data-cid="{{fitem.id}}" data-pid="0">
  99 +
  100 + <image wx:if="{{fitem.showImgType==1}}" binderror="bind_bnerr2" class='fl_img' data-errorimg="xmlist[{{index}}].showImg" src='{{fitem.showImg}}'></image>
  101 + <image wx:else class='fl_img' binderror="bind_bnerr2" data-errorimg="xmlist[{{index}}].showImg" src='{{iurl}}{{fitem.showImg}}'></image>
  102 +
  103 + <view class='over_view'></view>
  104 + <text class='f_item_over_t'>{{fitem.name}}</text></view>
  105 + <view class='fenlei_text_v'>
  106 + <view class='f_text' wx:for="{{fitem.array}}" wx:for-item="item" bindtap="goServiceCategoryList" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view>
  107 + </view>
  108 + </view>
  109 + </block>
  110 + </block>
  111 +
  112 +
  113 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
  114 + </scroll-view>
  115 + </swiper-item>
89 116 </swiper>
90 117 <view class="no-data" wx:if="{{!is_date}}">
91 118 <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
... ... @@ -103,7 +130,7 @@
103 130 </block>
104 131 <!-- 风格2 -->
105 132 <block wx:elif="{{is_used_share == 1}}">
106   - <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
  133 + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
107 134 <!-- 新版分类头部 -->
108 135 <view class="xc-search-box flex jc_sb ai-center" style="position:fixed;top:0;z-index:99">
109 136 <!-- <view class="xc-search-inner ">
... ... @@ -129,38 +156,47 @@
129 156 <!-- 分类项目的类型 -->
130 157 <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;">
131 158 <view class="project_type-frame" style="margin-bottom:120rpx;">
132   - <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">
  159 + <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">
133 160 <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
134   - <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}">
135   -
136   - <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> -->
137   - <view class="tab-bar-item sort-name ellipsis-1" style="">国家</view>
  161 + <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 {{select_classify_on==223?'select_classify':''}}" data-index="223" data-name="国家" wx:if="{{is_country}}">
  162 +
  163 + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view> -->
  164 + <view class="tab-bar-item sort-name ellipsis-1" style="">国家</view>
138 165  
  166 + </view>
139 167 </view>
140   - </view>
141   - <view wx:if="{{is_show_pp}}" class="{{status_show == 2?'':''}}">
  168 +
  169 + <view wx:if="{{is_show_pp}}">
142 170 <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
143   - <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30" wx:if="{{is_brand}}"data-index="220"data-name="品牌">
  171 + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30" wx:if="{{is_brand}}" data-index="220" data-name="品牌">
144 172  
145   - <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> -->
146   - <view class="tab-bar-item sort-name ellipsis-1" style="">品牌</view>
147   - </view>
  173 + <!-- <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view> -->
  174 + <view class="tab-bar-item sort-name ellipsis-1" style="">品牌</view>
  175 + </view>
148 176 </view>
  177 +
  178 + <!-- 项目 -->
  179 + <view wx:if="{{is_show_xm}}">
  180 + <view bindtap="click_classify" class="fs30 {{select_classify_on==221?'select_classify':''}}" data-index="221" data-name="项目">
  181 + <view class="tab-bar-item sort-name ellipsis-1">项目</view>
  182 + </view>
  183 + </view>
  184 +
  185 +
  186 + <!-- 品类 -->
149 187 <view wx:if="{{is_show_pl}}">
150   -
151   - <view wx:for="{{one_level_classify}}" wx:for-item="ittms" >
152   - <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">
153   - <!-- 添加左边红色条 -->
154   - <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
155   - <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} fs30 t-c {{select_classify_on==index&&ittms.items.name.length==2?'':''}} {{select_classify_on==index&&ittms.items.name.length==3?'':''}}"data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">
156   -
157   - <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>
158   - </view>
159   -
160   - </view>
  188 + <view wx:for="{{one_level_classify}}" wx:for-item="ittms">
  189 + <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">
  190 + <!-- 添加左边红色条 -->
  191 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  192 + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} fs30 t-c {{select_classify_on==index&&ittms.items.name.length==2?'':''}} {{select_classify_on==index&&ittms.items.name.length==3?'':''}}" data-index="{{index}}" data-name="{{ittms.items.mobile_name}}">
  193 + <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>
  194 + </view>
  195 + </view>
  196 + </view>
  197 + </view>
  198 +
161 199 </view>
162   - </view>
163   - </view>
164 200  
165 201 </view>
166 202 <!-- 分类项目的内容 -->
... ... @@ -204,18 +240,44 @@
204 240 <view class="t-c">
205 241 <image class="brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
206 242 <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>
207   - </view>
  243 + </view>
208 244 </view>
209 245  
210 246  
211 247 </block>
212 248 </view>
213 249 </block>
  250 +
  251 + <!-- 卡项 -->
  252 + <!-- <block wx:if="{{select_classify_on==220&&is_show_xm}}"> -->
  253 + <block wx:if="{{select_classify_on==221&&is_show_xm}}">
  254 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  255 + <view class="classify_name fs28 flex-space-between">
  256 + <view>{{classify_name}}</view>
  257 + </view>
  258 +
  259 + <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">
  260 + <block wx:for="{{xmlist}}">
  261 + <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}" >
  262 + <view class="t-c">
  263 + <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>
  264 + <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>
  265 + <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>
  266 + </view>
  267 + </view>
  268 + </block>
  269 + </view>
  270 + </block>
  271 +
  272 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
  273 + </block>
  274 +
214 275 <!-- 品类-->
215   - <block wx:if="{{is_show_pl}}">
216   - <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}">
  276 + <block wx:if="{{is_show_pl&&select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223}}">
  277 + <block wx:if="{{select_classify_on!=221&&select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}">
  278 + <!-- <block wx:if="{{select_classify_on == 0&&is_level_three!=1}}"> -->
217 279 <view class="my-container">
218   - <view class="classify_name fs28 flex-space-between ai-center"data-pid="0"data-cid="{{cat_id}}" bindtap='select_more'>
  280 + <view class="classify_name fs28 flex-space-between ai-center" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more'>
219 281 <view class="classify_title ellipsis-1">{{classify_name}}</view>
220 282 <view class="flex select_more ai-center" >
221 283 <view class="red-co fs24" >更多</view>
... ... @@ -227,7 +289,7 @@
227 289 <block wx:if="{{goodslist && goodslist.length>0}}">
228 290 <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="indx">
229 291 <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate">
230   - <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>
  292 + <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}" binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image>
231 293 <view class="brand_img_name fs24 ellipsis-1 pdh10">{{goods.items.name}}</view>
232 294 </view>
233 295 </block>
... ... @@ -241,8 +303,8 @@
241 303 </block>
242 304  
243 305 <!-- 商品 含有3级的-->
244   - <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three==1}}">
245   - <block wx:for="{{goodslist}}"wx:for-item="goods"wx:for-index="inds">
  306 + <block wx:if="{{select_classify_on!=220&&select_classify_on!=221&&select_classify_on!=223&&is_level_three==1}}">
  307 + <block wx:for="{{goodslist}}" wx:for-item="goods" wx:for-index="inds">
246 308 <view>
247 309  
248 310 <view class="classify_name fs28 flex-space-between ai-center"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'>
... ... @@ -282,7 +344,7 @@
282 344 </block>
283 345 <!-- 风格3 -->
284 346 <block wx:elif="{{is_used_share == 2}}">
285   - <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
  347 + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp || is_show_xm}}">
286 348 <!-- 头部 -->
287 349 <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99">
288 350 <!-- <view class="share-height t-c" bindtap="getScancode" >
... ... @@ -314,16 +376,27 @@
314 376 <view class="project_type" style="background-color:#f4f4f4;overflow-y:auto;position:fixed;left:0;z-index:99;top:108rpx;" id="thress_type3">
315 377 <view class="project_type-frame" style="margin-bottom:120rpx;">
316 378 <view wx:if="{{is_show_gb}}">
317   - <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-current="223" data-index="223" data-name="国家" wx:if="{{is_country}}">
  379 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-index="223" data-name="国家" wx:if="{{is_country}}" data-current="223">
318 380 <text style="">国家</text>
319 381 </view>
320 382 </view>
  383 +
321 384 <view wx:if="{{is_show_pp}}">
322   -
323   - <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-current="220" data-index="220" data-name="品牌">
  385 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-index="220" data-name="品牌" data-current="220">
324 386 <text style="">品牌</text>
325 387 </view>
326 388 </view>
  389 +
  390 +
  391 + <!-- 卡项 -->
  392 + <view wx:if="{{is_show_xm}}">
  393 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on == 221 ? 'active' : ''}}" data-index="221" data-name="项目" data-current="221">
  394 + <text>项目</text>
  395 + </view>
  396 + </view>
  397 +
  398 +
  399 +
327 400 <view wx:if="{{is_show_pl}}">
328 401 <!-- <view wx:for="{{one_level_classify}}" wx:for-item="ittms" class="class_set_height"> -->
329 402 <!-- <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}"> -->
... ... @@ -356,6 +429,9 @@
356 429  
357 430 <!-- </view> -->
358 431 </view>
  432 +
  433 +
  434 +
359 435 </view>
360 436 </view>
361 437 <!-- 分类项目的内容 -->
... ... @@ -383,6 +459,8 @@
383 459 </view>
384 460 </view>
385 461 </block>
  462 +
  463 +
386 464 <!-- 品牌 -->
387 465 <block wx:if="{{select_classify_on==220&&is_show_pp}}">
388 466  
... ... @@ -396,7 +474,7 @@
396 474 <view class="brand_img_frame "wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" >
397 475  
398 476 <view class="t-c">
399   - <image class=" brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
  477 + <image class="brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
400 478 <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>
401 479 </view>
402 480 </view>
... ... @@ -405,9 +483,38 @@
405 483 </block>
406 484 </view>
407 485 </block>
  486 +
  487 +
  488 + <!-- 卡项 -->
  489 + <block wx:if="{{select_classify_on==221&&is_show_xm}}">
  490 + <block wx:if="{{xmlist && xmlist.length != 0}}">
  491 + <view class="classify_name fs28 flex-space-between">
  492 + <view>{{classify_name}}</view>
  493 + </view>
  494 +
  495 + <view class="classify_content-frame flex flex-wrap" style="padding-bottom: 130rpx;">
  496 + <block wx:for="{{xmlist}}">
  497 + <view class="brand_img_frame" bindtap="goServiceCategoryList" data-cid="{{item.id}}">
  498 + <view class="t-c">
  499 + <image wx:if="{{item.ico}}" class="brand_img" src="{{item.ico}}" mode="heightFix"></image>
  500 + <image wx:else class="brand_img" src="{{iurl + '/miniapp/images/no_cate_def.png'}}" mode="heightFix"></image>
  501 + <view class="brand_img_name ellipsis-1 fs24">{{item.name}}</view>
  502 + </view>
  503 + </view>
  504 + </block>
  505 + </view>
  506 + </block>
  507 +
  508 + <view wx:else class="t-c fs28 c-9 pdt50">暂无项目</view>
  509 +
  510 + </block>
  511 +
  512 +
408 513 <!-- 品类-->
409   - <block wx:if="{{is_show_pl}}">
410   - <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}">
  514 + <!-- <block wx:if="{{select_classify_on==0&&is_show_pl}}"> -->
  515 + <block wx:if="{{is_show_pl&&select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}">
  516 + <!-- <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}"> -->
  517 + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&select_classify_on!=221}}">
411 518 <view style="width:100%;height:100%;position: relative;">
412 519 <view class="classify_name fs28 flex ai-center flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="box-sizing:border-box;position:fixed;z-index: 999;width:74%;background-color:#ffffff;padding:0 20rpx;">
413 520 <view class="classify_title ellipsis-1">{{classify_name}}</view>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -33,6 +33,8 @@ Page({
33 33 iurl: o.imghost,
34 34 defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
35 35  
  36 + viplimited_timetype: 0,
  37 +
36 38 data: null,
37 39 content: "", //商品详情
38 40 comments: null, //商品评论
... ... @@ -740,7 +742,8 @@ Page({
740 742 i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, {
741 743 failRollback: !0,
742 744 success: function (t) {
743   - console.log(t);
  745 +
  746 + ee.data.viplimited_timetype = t.data.data.viplimited_timetype;
744 747 if (t.data.code == 0) {
745 748 if (t.data.data.is_on_sale != 1) {
746 749 wx.showModal({
... ... @@ -3719,7 +3722,8 @@ Page({
3719 3722 data: {
3720 3723 store_id: os.stoid,
3721 3724 user_id: user_id,
3722   - goods_id: gd.goods_id
  3725 + goods_id: gd.goods_id,
  3726 + timetype: th.data.viplimited_timetype
3723 3727 },
3724 3728 success: function (t) {
3725 3729 if (t.data.code == 0) {
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -1678,6 +1678,7 @@ view.cart-btn-lg {
1678 1678 text-align: center;
1679 1679 line-height: 38rpx;
1680 1680 margin-left: 20rpx;
  1681 + justify-content: center;
1681 1682 }
1682 1683  
1683 1684 .buttem-list .item.red {
... ...
pages/index/index/index.json
... ... @@ -17,10 +17,11 @@
17 17 "picMax": "/components/diy_picMax/diy_picMax",
18 18 "mvideo": "/components/diy_video/diy_video",
19 19 "service": "/components/diy_service/diy_service",
20   - "scan": "/components/diy_scan/diy_scan",
21   - "store_select": "/components/diy_store_select/diy_store_select",
  20 + "scan": "/components/diy_scan/diy_scan",
  21 + "store_select": "/components/diy_store_select/diy_store_select",
22 22 "presell": "/components/diy_pregoods/diy_pregoods",
23   - "luckyGo": "/components/diy_luckyGo/diy_luckyGo"
  23 + "luckyGo": "/components/diy_luckyGo/diy_luckyGo",
  24 + "serviceCard": "/components/diy_serviceCard/diy_serviceCard"
24 25 },
25 26 "enablePullDownRefresh": false
26 27 }
27 28 \ No newline at end of file
... ...
pages/index/index/index.wxml
... ... @@ -9,14 +9,15 @@
9 9 <!--普通界面-->
10 10 <wxs module="filter" src="../../../utils/filter.wxs"></wxs>
11 11  
  12 +
12 13 <view class="container rel nor" wx:if="{{ishow}}">
13 14 <block wx:if="{{banner}}">
14 15 <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image><!-- 红色背景 -->
15 16 </block>
16 17  
17 18 <view class="top-bar">
18   - <!-- 顶部关注公众号 -->
19   - <view id="off_top" wx:if="{{is_gz_h5}}"><official-account></official-account></view>
  19 + <!-- 顶部关注公众号 -->
  20 + <view id="off_top" wx:if="{{is_gz_h5}}"><official-account></official-account></view>
20 21  
21 22 <!-- 控制要不要显示顶部门店选择 -->
22 23 <block wx:if="{{is_topstore}}">
... ... @@ -45,9 +46,9 @@
45 46 </view>
46 47 </view>
47 48 <!-- 如果有关注,要 -->
48   - <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view>
  49 + <!-- <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view> -->
49 50 <!-- 如果有顶部门店 -->
50   - <view wx:if="{{is_topstore}}" style="height: 60rpx"></view>
  51 + <!-- <view wx:if="{{is_topstore}}" style="height: 60rpx"></view> -->
51 52  
52 53 <!--滚动广告-->
53 54 <view class="rel title-img" wx:if="{{banner}}">
... ... @@ -431,14 +432,14 @@
431 432 <!-- 撑开层 -->
432 433 <view>
433 434 <!-- 关注层的撑开 -->
434   - <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view>
435   - <block wx:for="{{template_arr}}" >
  435 + <!-- <view wx:if="{{is_gz_h5 && is_ok_h5}}" style="height: 84px"></view> -->
  436 + <!-- <block wx:for="{{template_arr}}" >
436 437 <block wx:if="{{item.content.is_top==1 && item.ename=='searchbox'}}">
437 438 <view wx:if="{{item.content.style==1}}" style="height: 115rpx;"></view>
438 439 <view wx:if="{{item.content.style==2}}" style="height: 89rpx;"></view>
439 440 </block>
440 441 <view wx:if="{{item.content.is_top==1 && item.ename=='store_select'}}" style="height: 100rpx;"></view>
441   - </block>
  442 + </block> -->
442 443 </view>
443 444  
444 445 <block wx:for="{{template_arr}}" wx:key="{{index}}">
... ... @@ -522,6 +523,10 @@
522 523 <luckyGo object="{{item.content}}"></luckyGo>
523 524 </block>
524 525  
  526 + <!-- 服务卡项 -->
  527 + <block wx:if="{{item.ename=='servicecategory'}}">
  528 + <serviceCard object="{{item.content}}"></serviceCard>
  529 + </block>
525 530  
526 531 </view>
527 532  
... ...
pages/index/index/index.wxss
... ... @@ -1011,7 +1011,8 @@ page {
1011 1011 }
1012 1012  
1013 1013 .container {
1014   - overflow: hidden;
  1014 + /* overflow: hidden; */
  1015 + overflow: visible;
1015 1016 /* padding-top: 140rpx; */
1016 1017 }
1017 1018  
... ... @@ -1064,7 +1065,7 @@ page {
1064 1065 }
1065 1066  
1066 1067 .dis_top {
1067   - position: fixed;
  1068 + position: sticky;
1068 1069 top: 0;
1069 1070 left: 0;
1070 1071 width: 100%;
... ...
pages/payment/pay_success/pay_success.js
... ... @@ -24,44 +24,84 @@ Page({
24 24 wx.setNavigationBarTitle({
25 25 title: '支付成功',
26 26 });
27   -
  27 + this.setData({
  28 + options,
  29 + });
28 30 var type=options.type,order_sn=options.order_sn;
29 31 var th=this,order=null;
30   - //如果是等1,就是单个订单的订单号
31   - if(type==1){
32   - await getApp().request.promiseGet("/api/weshop/order/page",
33   - {data:{store_id:e.globalData.setting.stoid,order_sn:order_sn}}).then(res=>{
34   - if(ut.ajax_ok(res)){
35   - order=res.data.data.pageData[0];
36   - th.setData({order:order,order_sn:order_sn})
37   - }
38   -
39   - })
40   - }else{
41   - await getApp().request.promiseGet("/api/weshop/order/page",
42   - {data:{store_id:e.globalData.setting.stoid,parent_sn:order_sn}}).then(res=>{
43   -
44   - if(ut.ajax_ok(res)){
45   - var allmoney=0,user_money=0;
46   - for(var i in res.data.data.pageData){
47   - var item=res.data.data.pageData[i];
48   - allmoney+=item.order_amount;
49   - user_money += item.user_money?item.user_money:0;
50   - }
51   - order=res.data.data.pageData[0];
52   - th.setData({ order: order, type: 2, allmoney: allmoney, order_sn: order_sn, user_money: user_money})
53   - }
54   -
55   -
56   - })
57   - }
58   - //--获取门店--
59   - if(order.exp_type==1) {
60   - await getApp().request.promiseGet("/api/weshop/pickup/get/"+ e.globalData.setting.stoid+"/"+order.pickup_id,
61   - {1:1}).then(res => {
62   - th.setData({pick:res.data.data})
63   - });
64   - }
  32 +
  33 +
  34 + // 卡项订单
  35 + if(options.card == 1) {
  36 + let url = '/api/weshop/recharge/user/page'
  37 + let data = {
  38 + store_id: getApp().globalData.setting.stoid,
  39 + user_id: getApp().globalData.userInfo.user_id,
  40 + order_id: this.data.options.order_id,
  41 + };
  42 +
  43 + // 请求数据
  44 + getApp().promiseGet(url, {
  45 + data: data,
  46 + }).then(res => {
  47 + if (res.data.code == 0) {
  48 + console.log('请求成功', res);
  49 + this.setData({
  50 + order: res.data.data.pageData[0],
  51 + order_sn: res.data.data.pageData[0].order_sn,
  52 + });
  53 + } else {
  54 + throw (res);
  55 + };
  56 + }).catch(err => {
  57 + wx.showToast({
  58 + title: err.data.data,
  59 + icon: 'error',
  60 + });
  61 + });
  62 + } else {
  63 +
  64 + //如果是等1,就是单个订单的订单号
  65 + if(type==1){
  66 + await getApp().request.promiseGet("/api/weshop/order/page",
  67 + {data:{store_id:e.globalData.setting.stoid,order_sn:order_sn}}).then(res=>{
  68 + if(ut.ajax_ok(res)){
  69 + order=res.data.data.pageData[0];
  70 + th.setData({order:order,order_sn:order_sn})
  71 + }
  72 +
  73 + })
  74 + }else{
  75 + await getApp().request.promiseGet("/api/weshop/order/page",
  76 + {data:{store_id:e.globalData.setting.stoid,parent_sn:order_sn}}).then(res=>{
  77 +
  78 + if(ut.ajax_ok(res)){
  79 + var allmoney=0,user_money=0;
  80 + for(var i in res.data.data.pageData){
  81 + var item=res.data.data.pageData[i];
  82 + allmoney+=item.order_amount;
  83 + user_money += item.user_money?item.user_money:0;
  84 + }
  85 + order=res.data.data.pageData[0];
  86 + th.setData({ order: order, type: 2, allmoney: allmoney, order_sn: order_sn, user_money: user_money})
  87 + }
  88 +
  89 +
  90 + })
  91 + }
  92 + //--获取门店--
  93 + if(order.exp_type==1) {
  94 + await getApp().request.promiseGet("/api/weshop/pickup/get/"+ e.globalData.setting.stoid+"/"+order.pickup_id,
  95 + {1:1}).then(res => {
  96 + th.setData({pick:res.data.data})
  97 + });
  98 + };
  99 +
  100 +
  101 + };
  102 +
  103 +
  104 +
65 105 },
66 106  
67 107 goto: function() {
... ...
pages/payment/pay_success/pay_success.wxml
... ... @@ -25,25 +25,38 @@
25 25 <view class="payitem flex">
26 26 <view>实付金额 :</view>
27 27 <!-- {{filters.toFix()}} -->
28   - <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view>
29   - <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view>
  28 + <!-- 卡项订单 -->
  29 + <view class="pay_money" wx:if="{{options.card == 1}}">{{filters.toFix(order.account,2) }}元</view>
  30 +
  31 + <block wx:else>
  32 + <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view>
  33 + <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view>
  34 + </block>
30 35 </view>
31 36  
32 37 <!-- 支付方式 -->
33   - <view class="payitem flex" wx:if="type==1">
34   - <view>支付方式 :</view>
35   - <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view>
36   - <view wx:elif="{{order.order_amount>0}}">微信支付</view>
37   - <view wx:elif="{{order.user_money>0}}">余额支付</view>
38   - <view wx:else>免单</view>
39   - </view>
40   - <view class="payitem flex" wx:else>
41   - <view>支付方式 :</view>
42   - <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view>
43   - <view wx:elif="{{allmoney>0}}">微信支付</view>
44   - <view wx:elif="{{user_money>0}}">余额支付</view>
45   - <view wx:else>免单</view>
46   - </view>
  38 + <view class="payitem flex" wx:if="{{options.card == 1}}">
  39 + <view>支付方式 :</view>
  40 + <view>微信支付</view>
  41 + </view>
  42 +
  43 + <block wx:else>
  44 + <view class="payitem flex" wx:if="{{type==1}}">
  45 + <view>支付方式 :</view>
  46 + <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view>
  47 + <view wx:elif="{{order.order_amount>0}}">微信支付</view>
  48 + <view wx:elif="{{order.user_money>0}}">余额支付</view>
  49 + <view wx:else>免单</view>
  50 + </view>
  51 + <view class="payitem flex" wx:else>
  52 + <view>支付方式 :</view>
  53 + <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view>
  54 + <view wx:elif="{{allmoney>0}}">微信支付</view>
  55 + <view wx:elif="{{user_money>0}}">余额支付</view>
  56 + <view wx:else>免单</view>
  57 + </view>
  58 + </block>
  59 +
47 60  
48 61  
49 62  
... ... @@ -72,23 +85,42 @@
72 85 <view class="pay_User fs28" wx:else>
73 86 <view class="payitem flex">
74 87 <view class="pay_Receiving">门店 :</view>
75   - <view class="pay_name ellipsis-1">{{pick.pickup_name}}</view>
  88 + <view class="pay_name ellipsis-1" wx:if="{{options.card == 1}}">{{order.list[0].pickup_name}}</view>
  89 + <view class="pay_name ellipsis-1" wx:else>{{pick.pickup_name}}</view>
76 90 </view>
77 91 <view class="payitem flex">
78 92 <view class="pay_Receiving">门店地址 :</view>
79   - <view class="address ellipsis-2">{{pick.fulladdress}}</view>
  93 + <view class="pay_name" wx:if="{{options.card == 1}}">{{order.list[0].fulladdress}}</view>
  94 + <view class="address ellipsis-2" wx:else>{{pick.fulladdress}}</view>
80 95 </view>
81 96 </view>
82 97  
83 98 <!-- 链接 -->
84   - <view class="fs32">
85   - <view class="flex-center">
86   - <navigator class="pay_order flex-center" url="/pages/user/order_list/order_list">
87   - <view>查看订单</view>
88   - </navigator>
89   - </view>
90   - <view class="flex-center">
91   - <navigator class="pay_home flex-center" bindtap="goto">
  99 + <view class="fs28 pd20 mgt40">
  100 + <view class="flex">
  101 +
  102 + <block wx:if="{{options.card == 1}}">
  103 + <!-- <view class="flex-center"> -->
  104 + <navigator class="btn f1 bg-yellow white" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{order.order_id}}">
  105 + <view>订单详情</view>
  106 + </navigator>
  107 + <!-- </view> -->
  108 + <!-- <view class="flex-center"> -->
  109 + <navigator class="btn f1 bg-red white mgl20" url="/pages/user/my_service/i_service">
  110 + <view>立即预约</view>
  111 + </navigator>
  112 + <!-- </view> -->
  113 + </block>
  114 +
  115 + <block wx:else>
  116 + <navigator class="btn f1 bg-yellow white" url="/pages/user/order_list/order_list">
  117 + <view>查看订单</view>
  118 + </navigator>
  119 + </block>
  120 +
  121 + </view>
  122 + <view class="mgt30">
  123 + <navigator class="btn border c-6" bindtap="goto">
92 124 <view>回到首页</view>
93 125 </navigator>
94 126 </view>
... ...
pages/payment/pay_success/pay_success.wxss
... ... @@ -59,26 +59,38 @@ page {
59 59  
60 60 .pay_User .payitem .pay_name {
61 61 margin-right: 38rpx;
62   - max-width: 250rpx;
  62 + /* max-width: 250rpx; */
63 63 }
64 64  
65   -.pay_order {
66   - margin-top: 115rpx;
67   - color: rgb(104, 104, 104);
68   - width: 560rpx;
69   - height: 62rpx;
70   - border-radius: 30rpx;
71   - border: 3rpx solid rgb(209, 209, 209);
  65 +.btn {
  66 + box-sizing: border-box;
  67 + height: 80rpx;
  68 + line-height: 80rpx;
  69 + /* padding: 10rpx; */
  70 + text-align: center;
  71 + border-radius: 40rpx;
72 72 }
73 73  
74 74 .pay_home {
75   - margin-top: 35rpx;
  75 + /* margin-top: 35rpx; */
76 76 color: rgb(255, 255, 255);
77   - width: 566rpx;
78   - height: 68rpx;
  77 + /* width: 566rpx;
  78 + height: 68rpx; */
79 79 border-radius: 30rpx;
80 80 background-color: rgb(219, 27, 52);
81 81 }
82 82 .address{
83 83 width: 470rpx;
84   -}
85 84 \ No newline at end of file
  85 +}
  86 +
  87 +.bg-red {
  88 + background-color: rgb(219, 27, 52);
  89 +}
  90 +
  91 +.bg-yellow {
  92 + background-color: #feca53;
  93 +}
  94 +
  95 +.border {
  96 + border: 2rpx solid #ccc;
  97 +}
... ...
pages/store/index.wxss
1   -.box{
  1 +/* .box{
2 2 padding: 10px;
3 3 border-bottom: 10px solid #f5f5f5;
4 4 color: #000000;
... ... @@ -44,5 +44,278 @@ position: relative;
44 44 .sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;}
45 45 .sear_inp input{width: 400rpx;}
46 46 .select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center }
47   -.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;}
  47 +.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;} */
  48 +
  49 +.border-bottom {
  50 + border-bottom: 2rpx solid #e0e0e0;
  51 +}
  52 +
  53 +.fs22 {
  54 + font-size: 22rpx;
  55 +}
  56 +
  57 +.flexShrink-0 {
  58 + flex-shrink: 0;
  59 +}
  60 +
  61 +.pt16 {
  62 + padding-top: 16rpx;
  63 +}
  64 +
  65 +.maxWidth-340 {
  66 + max-width: 340rpx;
  67 +}
  68 +
  69 +.maxWidth-400 {
  70 + max-width: 400rpx;
  71 +}
  72 +
  73 +
  74 +/* 图标字体 */
  75 +/* @font-face {
  76 + font-family: 'iconfont';
  77 + src: url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.eot');
  78 + src: url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.eot?#iefix') format('embedded-opentype'),
  79 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.woff2') format('woff2'),
  80 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.woff') format('woff'),
  81 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.ttf') format('truetype'),
  82 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.svg#iconfont') format('svg');
  83 +}
  84 +
  85 +.iconfont {
  86 + font-family: "iconfont" !important;
  87 + font-size: 28rpx;
  88 + font-style: normal;
  89 + -webkit-font-smoothing: antialiased;
  90 + -moz-osx-font-smoothing: grayscale;
  91 +}
  92 +
  93 +.icon-weizhi:before {
  94 + content: "\e615";
  95 + color: #FFBA10;
  96 +}
  97 +
  98 +.icon-arrow_down:before {
  99 + content: "\e600";
  100 +}
  101 +
  102 +.icon-arrow_right:before {
  103 + content: "\e61f";
  104 +} */
  105 +/* 图标字体 */
  106 +
  107 +
  108 +
  109 +.icon-weizhi {
  110 + color: #FFBA10;
  111 +}
  112 +
  113 +page {
  114 + height: 100%;
  115 + font-size: 28rpx;
  116 +}
  117 +
  118 +.container {
  119 + height: 100%;
  120 +}
  121 +#map {
  122 + /* width: 100%;
  123 + height: ; */
  124 + display: block;
  125 + width: 100%;
  126 + height: 100%;
  127 +}
  128 +.tab-container.active {
  129 + height: calc(100% - 86rpx);
  130 +}
  131 +.map-container.active ~ .tab-container .list-container {
  132 + height: 204rpx;
  133 + overflow: hidden;
  134 +}
  135 +.map-container.active ~ .tab-container .list {
  136 + overflow: hidden;
  137 +}
  138 +.tab-container.active .list-container {
  139 + height: calc(100% - 108rpx - 84rpx);
  140 + background-color: #F7F7F7;
  141 +}
  142 +
  143 +
  144 +.search-container {
  145 + display: flex;
  146 + align-items: center;
  147 + padding: 0 32rpx;
  148 + border-bottom: 2rpx solid #F0F0F0;
  149 +}
  150 +
  151 +.city:after {
  152 + display: inline-block;
  153 + content: '◣';
  154 + font-size: 14rpx;
  155 + padding-left: 8rpx;
  156 + padding-right: 20rpx;
  157 + transform: rotateZ(-45deg);
  158 + position: relative;
  159 + top: -16rpx;
  160 +}
  161 +
  162 +.input-container {
  163 + padding: 12rpx 0;
  164 + flex: 1;
  165 +}
  166 +
  167 +.input {
  168 + padding: 0 20rpx;
  169 + height: 60rpx;
  170 + line-height: 60rpx;
  171 + border-radius: 30rpx;
  172 + background-color: #F3F3F3;
  173 +}
  174 +
  175 +.placeholder {
  176 + color: #676767;
  177 + font-size: 24rpx;
  178 +}
  179 +
  180 +
  181 +
  182 +
  183 +
  184 +/* 切换卡 */
  185 +.tab-title-container {
  186 + display: flex;
  187 + text-align: center;
  188 + border-bottom: 20rpx solid #F7F7F7;
  189 +}
  190 +.tab-title {
  191 + width: 50%;
  192 + line-height: 88rpx;
  193 + position: relative;
  194 +}
  195 +.tab-title.active {
  196 + font-weight: bold;
  197 +}
  198 +.tab-title.active::after {
  199 + position: absolute;
  200 + content: '';
  201 + width: 110rpx;
  202 + height: 4rpx;
  203 + left: 50%;
  204 + bottom: 0;
  205 + transform: translateX(-50%);
  206 + background-color: #FFBA10;
  207 +}
  208 +
  209 +.map-container {
  210 + transition: 0.1s all linear;
  211 + background-color: pink;
  212 +}
  213 +
  214 +.map-container.active {
  215 + height: calc(100% - 86rpx - 80rpx - 200rpx);
  216 + transition: 0.1s all linear;
  217 +}
  218 +
  219 +
  220 +
  221 +
  222 +/* 查看地图 */
  223 +.view-map {
  224 + line-height: 80rpx;
  225 + text-align: center;
  226 + font-size: 24rpx;
  227 + color: #000;
  228 + border-bottom: 2rpx solid #F0F0F0;
  229 +}
  230 +
  231 +
  232 +/* 列表 */
  233 +.list {
  234 + height: 100%;
  235 +}
  236 +.list-item {
  237 + padding: 40rpx 28rpx;
  238 + border-bottom: 2rpx solid #F0F0F0;
  239 + justify-content: space-between;
  240 + background-color: #fff;
  241 +}
  242 +.list-item:last-child {
  243 + border-bottom: none;
  244 +}
  245 +radio .wx-radio-input {
  246 + width: 32rpx;
  247 + height: 32rpx;
  248 +}
  249 +radio .wx-radio-input.wx-radio-input-checked {
  250 + border-color: #333;
  251 + /* border-color: #FFBA10; */
  252 + background-color: white;
  253 +}
  254 +radio .wx-radio-input.wx-radio-input-checked::before {
  255 + display: inline-block;
  256 + content: '';
  257 + width: 24rpx;
  258 + height: 24rpx;
  259 + border-radius: 50%;
  260 + background-color: #333;
  261 + /* background-color: #FFBA10; */
  262 +}
  263 +.name-container {
  264 + padding-left: 14rpx;
  265 + padding-right: 30rpx;
  266 + box-sizing: border-box;
  267 +}
  268 +.name {
  269 + display: flex;
  270 + align-items: center;
  271 + font-size: 30rpx;
  272 + position: relative;
  273 +}
  274 +.address {
  275 + color: #6E6E6E;
  276 + font-size: 26rpx;
  277 + line-height: 34rpx;
  278 + padding-top: 16rpx;
  279 + /* padding-right: 40rpx; */
  280 + text-align: justify;
  281 +}
  282 +.tag {
  283 + color: #FF5B5A;
  284 + border-radius: 6rpx;
  285 + border: 2rpx solid #FF5B5A;
  286 + font-size: 22rpx;
  287 + padding: 0 4rpx;
  288 + flex-shrink: 0;
  289 + margin-left: 4rpx;
  290 +}
  291 +
  292 +.distance {
  293 + color: #6E6E6E;
  294 + font-size: 22rpx;
  295 + line-height: 34rpx;
  296 + padding-top: 16rpx;
  297 + /* word-break: break-all; */
  298 +}
  299 +
  300 +.icon-arrow_right {
  301 + padding-left: 20rpx;
  302 +}
  303 +
  304 +.right {
  305 + min-width: 200rpx;
  306 + text-align: right;
  307 +}
  308 +
  309 +.icon-arrow_down.active {
  310 + display: inline-block;
  311 + transform: rotateZ(180deg);
  312 +}
  313 +
  314 +
  315 +
  316 +
  317 +
  318 +
  319 +
  320 +
48 321  
... ...
pages/user/order_list/order_list.js
1 1 const app = getApp();
  2 +let self = null;
2 3 var t = function(t) {
3 4 return t && t.__esModule ? t : {
4 5 default: t
... ... @@ -36,6 +37,16 @@ Page({
36 37 name: "待评价",
37 38 id: 4
38 39 }],
  40 + tab_serviceCard: [{
  41 + name: "全部",
  42 + id: 0,
  43 + },{
  44 + name: "待付款",
  45 + id: 1,
  46 + },{
  47 + name: "待评价",
  48 + id: 2,
  49 + }],
39 50 activeCategoryId: 0,
40 51 orderList: null,
41 52 currentPage: 1,
... ... @@ -50,6 +61,7 @@ Page({
50 61  
51 62 back_goods_arr:null, //返回商品的列表
52 63 currentIndex: 0,
  64 + tabIndex: 0,
53 65  
54 66 startDate: '',
55 67 endDate: '',
... ... @@ -60,11 +72,12 @@ Page({
60 72 is_no_data2: 0,
61 73 is_no_more2: 0,
62 74  
63   -
  75 + cardList: [],
64 76 // 搜索内容
65 77 searchContent: '',
66 78 },
67 79 onLoad: function(t) {
  80 + self = this;
68 81 // 设置日期选择器的结束时间为当前日期
69 82 var now=new Date();
70 83 var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();
... ... @@ -72,10 +85,12 @@ Page({
72 85 var startDate=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
73 86  
74 87  
75   - if(t.index) {
  88 + if(t.index && t.tabindex) {
76 89 this.setData({
77   - currentIndex: t.index
  90 + currentIndex: t.index,
  91 + tabIndex: t.tabindex,
78 92 });
  93 + this.clickTab();
79 94 };
80 95  
81 96 this.setData({
... ... @@ -131,7 +146,7 @@ Page({
131 146 },1)
132 147  
133 148 this.resetData(), this.requestOrderList(this.data.activeCategoryId);
134   -
  149 + this.clickTab();
135 150 },
136 151 changeTab: function(t) {
137 152 if (this.data.activeCategoryId == t.currentTarget.id) return false;
... ... @@ -329,6 +344,7 @@ Page({
329 344 wx.stopPullDownRefresh();
330 345 }, null, {store_id: os.stoid, user_id: oo.user_id});
331 346 },
  347 +
332 348 //滑倒底部
333 349 onReachBottom: function() {
334 350 if(this.data.currentIndex == 0) {
... ... @@ -339,13 +355,23 @@ Page({
339 355 }
340 356 s.canloadMore() && this.requestOrderList(this.data.activeCategoryId);
341 357 } else {
342   - this.request_list({
343   - store_id: os.stoid,
344   - user_id: oo.user_id,
  358 + if(this.data.currentIndex == 1) {
  359 + this.request_list({
  360 + store_id: os.stoid,
  361 + user_id: oo.user_id,
345 362 page: this.data.currentPage2,
346   - });
  363 + });
  364 + } else { // 卡项订单
  365 + this.request_list({
  366 + store_id: os.stoid,
  367 + user_id: oo.user_id,
  368 + page: this.data.currentPage2,
  369 + });
  370 + }
  371 +
347 372 }
348 373 },
  374 +
349 375 onPullDownRefresh: function(t) {
350 376 // sty取消
351 377 // this.resetData(), this.requestOrderList(this.data.activeCategoryId);
... ... @@ -1833,8 +1859,16 @@ Page({
1833 1859 // var req_data = {
1834 1860 // page:th.data.currentPage2
1835 1861 // }
1836   -
1837   - app.request.promiseGet("/api/weshop/order/pagePosOrder", {
  1862 + let currentIndex = this.data.currentIndex;
  1863 + let url = '';
  1864 + if(currentIndex == 1) {
  1865 + url = '/api/weshop/order/pagePosOrder';
  1866 + };
  1867 + if(currentIndex == 2) {
  1868 + url = '/api/weshop/recharge/user/page';
  1869 + };
  1870 +
  1871 + app.request.promiseGet(url, {
1838 1872 data: data
1839 1873 }).then(res=>{
1840 1874 // 关闭加载状态
... ... @@ -1846,9 +1880,20 @@ Page({
1846 1880 var data = res.data.data.pageData;
1847 1881 // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有
1848 1882 if(res.data.data.page*res.data.data.pageSize > res.data.data.total){th.setData({is_no_more2:1});}
1849   - var list=th.data.list2;
1850   - list=list.concat(data);
1851   - th.setData({list2:list});
  1883 + let list= [];
  1884 +
  1885 + if(currentIndex == 1) {
  1886 + list = th.data.list2;
  1887 + list = list.concat(data);
  1888 + th.setData({list2:list});
  1889 + };
  1890 + if(currentIndex == 2) { // 卡项订单
  1891 + list = th.data.cardList;
  1892 + list = list.concat(data);
  1893 + th.setData({cardList:list});
  1894 + console.log('currentCard', list);
  1895 + };
  1896 +
1852 1897 } else {
1853 1898 if(th.data.currentPage2==1){
1854 1899 th.setData({is_no_data2:1});
... ... @@ -1858,11 +1903,11 @@ Page({
1858 1903 }
1859 1904 if(callback) callback(res);
1860 1905 } else {
1861   - wx.showToast({
1862   - title: res.data.msg,
1863   - icon: 'none',
1864   - duration: 2000
1865   - })
  1906 + // wx.showToast({
  1907 + // title: res.data.msg,
  1908 + // icon: 'none',
  1909 + // duration: 2000
  1910 + // })
1866 1911 }
1867 1912 })
1868 1913 },
... ... @@ -1873,7 +1918,7 @@ Page({
1873 1918 this.setData({
1874 1919 currentIndex: currentIndex
1875 1920 });
1876   - console.log(this.data.currentIndex);
  1921 +
1877 1922 this.setData({
1878 1923 is_no_data2: 0,
1879 1924 is_no_more2: 0,
... ... @@ -1886,7 +1931,8 @@ Page({
1886 1931 startDate: '选择开始时间',
1887 1932 endDate: '选择结束时间',
1888 1933 });--*/
1889   - } else if(currentIndex == 1) {
  1934 + };
  1935 + if(currentIndex == 1) {
1890 1936 console.log('线下订单');
1891 1937 this.request_list({
1892 1938 store_id: os.stoid,
... ... @@ -1896,6 +1942,43 @@ Page({
1896 1942 EndDate: this.data.endDate
1897 1943 });
1898 1944 };
  1945 + if(currentIndex == 2) {
  1946 + console.log('卡项订单');
  1947 + // this.setData({
  1948 + // orderList: null,
  1949 + // });
  1950 + // 默认请求全部卡项订单
  1951 + this.request_list({
  1952 + store_id: os.stoid,
  1953 + user_id: oo.user_id,
  1954 + });
  1955 + // let url = '/api/weshop/recharge/user/page';
  1956 + // let data = {
  1957 + // store_id: os.stoid,
  1958 + // user_id: oo.user_id,
  1959 + // };
  1960 + // app.promiseGet(url, {
  1961 + // data: data,
  1962 + // }).then(res => {
  1963 + // if(res.data.code == 0) {
  1964 + // console.log('卡项订单请求成功', res);
  1965 + // this.setData({
  1966 + // orderList: res.data.data.pageData,
  1967 + // });
  1968 + // } else {
  1969 + // throw(res);
  1970 + // };
  1971 + // }).catch(err => {
  1972 + // console.log('卡项订单请求失败', err);
  1973 + // this.setData({
  1974 + // orderList: null,
  1975 + // });
  1976 + // wx.showToast({
  1977 + // title: err.data.data,
  1978 + // icon: 'error',
  1979 + // });
  1980 + // });
  1981 + };
1899 1982 },
1900 1983  
1901 1984 bindDateChange1: function(e) {
... ... @@ -1917,10 +2000,48 @@ Page({
1917 2000 },
1918 2001  
1919 2002 searchOnline() {
1920   - console.log('online',this.data.searchContent);
  2003 + let currentIndex = this.data.currentIndex;
  2004 + // console.log('online',this.data.searchContent, currentIndex);
1921 2005 if(this.data.searchContent) {
1922 2006 console.log(this.data.searchContent);
1923   - this.resetData(), this.requestOrderList(this.data.activeCategoryId);
  2007 + if(currentIndex == 0) {
  2008 + this.resetData(), this.requestOrderList(this.data.activeCategoryId);
  2009 + };
  2010 + if(currentIndex == 2) { // 卡项订单
  2011 + let url = '/api/weshop/recharge/user/page';
  2012 + let data = {
  2013 + store_id: os.stoid,
  2014 + user_id: oo.user_id,
  2015 + keyWord: this.data.searchContent,
  2016 + };
  2017 + this.setData({
  2018 + tabIndex: 0,
  2019 + });
  2020 + // 请求数据
  2021 + app.promiseGet(url, {
  2022 + data: data,
  2023 + }).then(res => {
  2024 + if(res.data.code == 0) {
  2025 + // console.log('卡项订单请求成功', res);
  2026 + this.setData({
  2027 + cardList: res.data.data.pageData,
  2028 + });
  2029 + } else {
  2030 + throw(res);
  2031 + };
  2032 + }).catch(err => {
  2033 + // console.log('卡项订单请求失败', err);
  2034 + this.setData({
  2035 + cardList: [],
  2036 + is_no_data2: 0,
  2037 + is_no_more2: 0,
  2038 + });
  2039 + // wx.showToast({
  2040 + // title: '搜索失败',
  2041 + // icon: 'none',
  2042 + // });
  2043 + });
  2044 + };
1924 2045 } else {
1925 2046 wx.showToast({
1926 2047 title: '您还没有输入搜索内容~',
... ... @@ -2014,10 +2135,298 @@ Page({
2014 2135 })
2015 2136 },
2016 2137  
2017   - go_url(e){
2018   - var url=e.currentTarget.dataset.url;
2019   - getApp().goto(url);
2020   - }
  2138 + go_url(e){
  2139 + var url=e.currentTarget.dataset.url;
  2140 + getApp().goto(url);
  2141 + },
  2142 +
  2143 + // 点击卡项订单二级tabbar
  2144 + clickTab(e) {
  2145 + // console.log('服务卡项index', e.target.dataset.index);
  2146 + let currentIndex = 0;
  2147 + if(e) {
  2148 + currentIndex = e.target.dataset.index;
  2149 + } else {
  2150 + currentIndex = this.data.tabIndex
  2151 + };
  2152 +
  2153 + // let || this.data.tabIndex;
  2154 +
  2155 + let url = '/api/weshop/recharge/user/page';
  2156 + let data = {
  2157 + store_id: os.stoid,
  2158 + user_id: oo.user_id,
  2159 + };
  2160 + this.setData({
  2161 + tabIndex: currentIndex,
  2162 + is_no_data2: 0,
  2163 + is_no_more2: 0,
  2164 + cardList: [],
  2165 + });
  2166 +
  2167 +
  2168 + switch(currentIndex) {
  2169 + case 0: { // 全部
  2170 + delete data.order_status;
  2171 + break;
  2172 + };
  2173 + case 1: { // 待支付
  2174 + data.order_status = 0;
  2175 + break;
  2176 + };
  2177 + case 2: { // 待评价
  2178 + data.order_status = 1;
  2179 + break;
  2180 + };
  2181 + };
  2182 + // 请求数据
  2183 + this.request_list(data);
  2184 +
  2185 + // app.promiseGet(url, {
  2186 + // data: data,
  2187 + // }).then(res => {
  2188 + // if(res.data.code == 0) {
  2189 + // console.log('卡项订单请求成功', res);
  2190 + // this.setData({
  2191 + // orderList: res.data.data.pageData,
  2192 + // });
  2193 + // } else {
  2194 + // throw(res);
  2195 + // };
  2196 + // }).catch(err => {
  2197 + // console.log('卡项订单请求失败', err);
  2198 + // this.setData({
  2199 + // orderList: null,
  2200 + // });
  2201 + // wx.showToast({
  2202 + // title: err.data.data,
  2203 + // icon: 'error',
  2204 + // });
  2205 + // });
  2206 + },
  2207 +
  2208 + // 卡项订单 - 查看详情
  2209 + viewDetails() {
  2210 + let url = '/packageA/pages/details_serviceCard/details_serviceCard';
  2211 + app.goto(url);
  2212 + },
  2213 +
  2214 + // 卡项订单 - 立即支付
  2215 + pay(e) {
  2216 + let index = e.currentTarget.dataset.index;
  2217 + let item = this.data.cardList[index];
  2218 + let order_sn = item.order_sn;
  2219 + let order_id = item.order_id;
  2220 + let store_id = app.globalData.setting.stoid;
  2221 + // console.log('go1!!!!!!!!!!!!!!!!!!!!!!!!!',index,item,order_sn,store_id);
  2222 +
  2223 + app.request.post('/api/weshop/order/pay/createRechargeOrder', {
  2224 + data: {
  2225 + parentSn: order_sn,
  2226 + store_id: store_id,
  2227 + },
  2228 +
  2229 + success: function(res) {
  2230 + var n = res.data.data;
  2231 + self.weixinPay(n, function() {
  2232 + app.showWarning('支付成功');
  2233 + setTimeout(function() {
  2234 + wx.reLaunch({
  2235 + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id,
  2236 + })
  2237 + }, 1000)
  2238 + }, function() {
  2239 + app.showWarning('支付失败');
  2240 + // setTimeout(function() {
  2241 + // wx.reLaunch({
  2242 + // url: '/packageA/pages/cardList/cardList',
  2243 + // })
  2244 + // }, 1000)
  2245 + });
  2246 + }
  2247 + })
  2248 + },
  2249 +
  2250 + //------调起支付框--------
  2251 + weixinPay: function(n, success, fail) {
  2252 + if (!n) return false;
  2253 + wx.requestPayment({
  2254 + timeStamp: String(n.timeStamp),
  2255 + nonceStr: n.nonceStr,
  2256 + package: n.packageValue,
  2257 + signType: n.signType,
  2258 + paySign: n.paySign,
  2259 + success: function(n) {
  2260 + console.log(n), getApp().showSuccess("支付成功!");
  2261 + "function" == typeof success && success();
  2262 + wx.redirectTo({
  2263 + url: "../deposit/deposit"
  2264 + });
  2265 + },
  2266 + fail: function(n) {
  2267 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") :
  2268 + "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n
  2269 + .errMsg.substr("requestPayment:fail ".length)),
  2270 + "function" == typeof fail && fail();
  2271 + }
  2272 + });
  2273 + },
  2274 +
  2275 + // 卡项订单 - 取消订单
  2276 + // api/weshop/recharge/update?store_id=&order_id=&order_status=3
  2277 + cancle(e) {
  2278 + wx.showModal({
  2279 + title: '提示',
  2280 + content: '确定取消订单吗?',
  2281 + success (res) {
  2282 + if (res.confirm) {
  2283 + console.log('取消订单~');
  2284 + let order_id = e.currentTarget.dataset.orderid;
  2285 + let order_sn = e.currentTarget.dataset.ordersn;
  2286 + app.request.put('/api/weshop/recharge/update', {
  2287 + data: {
  2288 + store_id: os.stoid,
  2289 + order_id: order_id,
  2290 + order_sn: order_sn,
  2291 + order_status: 3,
  2292 + },
  2293 + success: function(res) {
  2294 + wx.showToast({
  2295 + title: '取消成功',
  2296 + success: function() {
  2297 +
  2298 + // 这里还可以优化不刷新,后面有时间再优化
  2299 + self.setData({
  2300 + is_no_data2: 0,
  2301 + is_no_more2: 0,
  2302 + });
  2303 +
  2304 + // 这里还可以优化不刷新,后面有时间再优化
  2305 + self.clickTab(e);
  2306 + },
  2307 + });
  2308 +
  2309 + // let index = e.currentTarget.dataset.index;
  2310 + // let cardList = self.data.cardList;
  2311 + // cardList.splice(index, 1);
  2312 + // self.setData({
  2313 + // cardList,
  2314 + // });
  2315 +
  2316 + //self.request_list(self.data.currentRequestData);
  2317 + },
  2318 + })
  2319 + } else if (res.cancel) {
  2320 + console.log('用户点击取消');
  2321 + }
  2322 + }
  2323 + });
  2324 + },
  2325 +
  2326 +
  2327 + // 卡项订单 - 再来一单
  2328 + addCart: function(t) {
  2329 + var th = this;
  2330 + var ind = t.currentTarget.dataset.openSpecModal_ind;
  2331 + var action= t.currentTarget.dataset.action;
  2332 + if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind;
  2333 +
  2334 + th.setData({
  2335 + open_ind_store: ind
  2336 + });
  2337 +
  2338 + if(!th.data.sto_sele_name){
  2339 + getApp().my_warnning('请选择门店', 1, th, 450);
  2340 + return false;
  2341 + }
  2342 +
  2343 +
  2344 + if(action=="buy"){
  2345 + //--------------此时操作的数据------------
  2346 + var newd = {
  2347 + id: th.data.data.id,
  2348 + goods_num: th.data.goodsInputNum,
  2349 + pick_id: th.data.sto_sele_id,
  2350 + keyid: th.data.sto_sele_keyid,
  2351 + };
  2352 + newd['pick_name'] = th.data.sto_sele_name;
  2353 + newd['guide_id'] = getApp().globalData.guide_id;
  2354 + newd['guide_type']=0;
  2355 + th.buyNow(newd);
  2356 + }else{
  2357 +
  2358 + var newd = {
  2359 + service_id: th.data.data.id,
  2360 + service_sn:th.data.data.service_sn,
  2361 + service_name:th.data.data.goods_name,
  2362 + goods_num: th.data.goodsInputNum,
  2363 + pick_id: th.data.sto_sele_id,
  2364 + user_id:oo.user_id,
  2365 + store_id:os.stoid,
  2366 + money:th.data.data.shop_price
  2367 + };
  2368 + if(getApp().globalData.guide_id){
  2369 + newd['guide_id'] = getApp().globalData.guide_id;
  2370 + newd['guide_type']=0;
  2371 + }
  2372 +
  2373 + //----先看会员在购物车中是否加入了该商品-----
  2374 + getApp().request.get("/api/weshop/cartService/page", {
  2375 + data: {
  2376 + store_id: os.stoid,
  2377 + user_id: oo.user_id,
  2378 + service_id: th.data.data.id,
  2379 + pick_id: th.data.sto_sele_id,
  2380 + },
  2381 + success: function(re) {
  2382 +
  2383 + //-------如果购物车中有相关的数据---------
  2384 + if (re.data.data.total > 0) {
  2385 + var item = re.data.data.pageData[0];
  2386 + var updata = {
  2387 + id: item.id,
  2388 + goods_num: th.data.goodsInputNum + item.goods_num,
  2389 + money: th.data.data.shop_price,
  2390 + store_id: os.stoid,
  2391 + };
  2392 +
  2393 + if (getApp().globalData.guide_id) {
  2394 + updata['guide_id'] = getApp().globalData.guide_id;
  2395 + updata['guide_type'] = 1;
  2396 + }
  2397 + getApp().request.put("/api/weshop/cartService/update", {
  2398 + data: updata,
  2399 + success: function(t) {
  2400 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  2401 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  2402 + th.setData({
  2403 + cartGoodsNum: c_num
  2404 + });
  2405 + th.closeSpecModal();
  2406 + }
  2407 + });
  2408 + } else {
  2409 +
  2410 + getApp().request.post("/api/weshop/cartService/save", {
  2411 + data: newd,
  2412 + success: function(t) {
  2413 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  2414 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  2415 + th.setData({
  2416 + cartGoodsNum: c_num
  2417 + });
  2418 + th.closeSpecModal();
  2419 + }
  2420 + });
  2421 + }
  2422 + }
  2423 + });
  2424 +
  2425 + }
  2426 + },
  2427 +
  2428 +
  2429 +
2021 2430  
2022 2431  
2023 2432 });
2024 2433 \ No newline at end of file
... ...
pages/user/order_list/order_list.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +
2 3 <view class="container">
  4 + <!-- 一级tabbar -->
3 5 <view class="tab-container" bindtap="onClickTab">
4 6 <view class="tab {{currentIndex == 0 ? 'active':''}}" data-index="0"><text class="iconfont icon-cloud"></text>线上订单</view>
  7 + <view class="tab {{currentIndex == 2 ? 'active':''}}" data-index="2"><text class="iconfont icon-bankcard"></text>卡项订单</view>
5 8 <view class="tab {{currentIndex == 1 ? 'active':''}}" data-index="1"><text class="iconfont icon-shop"></text>线下订单</view>
6 9 </view>
7   - <view class="search-container flex" wx:if="{{currentIndex == 0}}">
  10 +
  11 + <!-- 搜索框 -->
  12 + <view class="search-container flex" wx:if="{{currentIndex != 1 }}">
8 13 <input class="search-input" type="text" placeholder="请输入您所搜索的商品" bindinput="bindInput" bindconfirm="bindInput" placeholder-style="color:#ccc;"/>
9 14 <view class="search-btn" bindtap="searchOnline">搜索</view>
10 15 </view>
  16 +
  17 + <!-- 二级tabbar - 线上订单 -->
11 18 <view class="type-navbar fs28" wx:if="{{currentIndex == 0}}">
12 19 <view class="type-box flex-center" wx:for="{{categories}}" wx:key="{{index}}">
13 20 <view id="{{item.id}}" bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}">
... ... @@ -15,6 +22,8 @@
15 22 </view>
16 23 </view>
17 24 </view>
  25 +
  26 + <!-- 二级tabbar - 线下订单 -->
18 27 <view class="search-container" wx:if="{{currentIndex == 1}}">
19 28 <view class="flex jc_sb">
20 29 <view class="picker-container flex f1">
... ... @@ -30,7 +39,17 @@
30 39 </view>
31 40 <view class="fs24 c-9 pdt20">注:读取时段内近10笔记录</view>
32 41 </view>
  42 +
  43 + <!-- 二级tabbar - 卡项订单 -->
  44 + <view class="type-navbar fs28" wx:if="{{currentIndex == 2}}">
  45 + <view class="type-box flex-center f1" wx:for="{{tab_serviceCard}}" wx:key="{{index}}">
  46 + <view data-index="{{index}}" bindtap="clickTab" class="type-navbar-item {{tabIndex ==index?'type-item-on':''}}">
  47 + {{item.name}}
  48 + </view>
  49 + </view>
  50 + </view>
33 51 </view>
  52 +
34 53 <!-- 线上订单 -->
35 54 <view class="list-container" wx:if="{{currentIndex == 0}}">
36 55 <view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}">
... ... @@ -263,8 +282,115 @@
263 282 </view>
264 283 </view>
265 284 </view>
  285 +
  286 +<!-- 服务卡项 -->
  287 +<!-- 订单状态:0=未付款 1=已付款、待评价 2已评价、完成 3已取消 5作废 -->
  288 +<view class="list-container" wx:elif="{{currentIndex == 2}}">
  289 + <view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{cardList}}" wx:key="{{item}}">
  290 + <!-- 商品编号和状态 -->
  291 + <view class="Commodity_number flex-vertical-between fs24 padding border_bottom">
  292 + <!--商品编号 -->
  293 + <text selectable='true'>订单编号:{{item.order_sn}}</text>
  294 + <!-- 订单状态 -->
  295 + <view class="flex-center c-r">
  296 + <view wx:if="{{item.order_status == 0}}">待支付</view>
  297 + <view wx:if="{{item.order_status == 1}}">待评价</view>
  298 + <view wx:if="{{item.order_status == 2}}">已评价</view>
  299 + <view wx:if="{{item.order_status == 3}}" class="c-a9">已取消</view>
  300 + <view wx:if="{{item.order_status == 5}}">已作废</view>
  301 + </view>
  302 + </view>
  303 +
  304 + <!-- 商品详情集合 -->
  305 + <view class="detail_commoditys">
  306 + <!-- 单个商品 -->
  307 + <view>
  308 + <navigator class="detail_commodity flex-vertical padding" wx:for="{{item.list}}" wx:for-item="goods" wx:for-index="pinx" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">
  309 + <!-- 商品图片 -->
  310 + <navigator class="rel">
  311 + <image src="{{resourceUrl+goods.img_url}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].list[{{pinx}}].img_url"></image>
  312 + <!-- <view class="abs flex-center fs26">服务卡</view> -->
  313 + </navigator>
  314 + <!-- 商品内容 -->
  315 + <view class="Commodity_content">
  316 + <view class="Commodity_goods">
  317 + <!-- 商品名称 -->
  318 + <view class="goods_name ellipsis-2 fs26">{{goods.service_name}}</view>
  319 + <view class="flex-space-between">
  320 + <!-- 商品规格 -->
  321 + <!-- <view class="Commodity_spec fs28 flex-center"> -->
  322 + <!--<text class="ellipsis-1" wx:if="{{goods.goods_color.length>1 && goods.goods_spec.length>1}}">{{goods.goods_color+"/"+goods.goods_spec}}</text>-->
  323 + <!--<text class="ellipsis-1" wx:elif="{{goods.goods_color.length>1 || goods.goods_spec.length>1}}">{{goods.goods_color==undefined?"":goods.goods_color}}{{goods.goods_spec==undefined?"":goods.goods_spec}}</text>-->
  324 + <!--<text class="ellipsis-1" wx:else>规格1</text>-->
  325 + <!-- <text class="ellipsis-1">{{filters.show_gui_ge(goods.goods_spec, goods.goods_color)}}</text> -->
  326 + <!-- </view> -->
  327 + </view>
  328 + </view>
  329 + <!-- 商品价格数量 -->
  330 + <view class="Commodity_money flex-vertical-between baseline">
  331 + <!-- 商品价格 -->
  332 + <view class="flex-vertical c-tb baseline">
  333 + <view class="fs24">¥</view>
  334 + <!-- 幸运购prom_type等于9 -->
  335 + <!-- 如果是幸运购就显示幸运购参团价格 -->
  336 + <view class="fs26">{{filters.toFix(goods.price,2)}}</view>
  337 + <!-- <view class="fs26" wx:else>{{filters.toFix(goods.member_goods_price,2)}} <text wx:if="{{goods.prom_type==10}}">({{goods.ladder_discount}}折)</text> </view> -->
  338 + </view>
  339 + <view class="fs26 c-a9">x{{goods.qty}}</view>
  340 + </view>
  341 + </view>
  342 + </navigator>
  343 + <!-- 去评价 -->
  344 + <view class="commodity_evaluate jc_sb baseline fs26">
  345 + <!-- 商品数量 -->
  346 + <view class="commodity_smy fs24">
  347 + <view class="order-total">
  348 + <view>
  349 + 共{{filters.count(item.list)}}件商品
  350 + </view>
  351 + <view class="goods-total flex">
  352 + <block>
  353 + <view class="commodity_money flex baseline">
  354 + <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
  355 + <view class="fs24 c-r">¥</view>
  356 + <view class="c-r">{{filters.toFix(item.account,2)}}
  357 + </view>
  358 +
  359 + </view>
  360 + </block>
  361 +
  362 + </view>
  363 + </view>
  364 + </view>
  365 +
  366 + <view class="links flex-right-vertical fs24 padding">
  367 + <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1 && !(item.order_goods[0].prom_type==9))}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
  368 + <view bindtap="cancle" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{tabIndex}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" wx:if="{{(item.order_status==0)}}" data-index="{{tabIndex}}">取消订单</view>
  369 +
  370 +
  371 + <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">订单详情</navigator>
  372 +
  373 +
  374 + <block wx:if="{{item.order_status==1}}">
  375 + <navigator wx:if="{{item.list.length > 1}}" class="order-btn white bg-orange"
  376 + url="/packageB/pages/user/comment/comment?card=1&status=0&order_id={{item.list[index].order_id}}">评价</navigator>
  377 + <navigator wx:else class="order-btn white bg-orange"
  378 + url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.list[0].card_id}}&order_id={{item.list[0].order_id}}&price={{item.list[0].price}}">评价</navigator>
  379 + </block>
  380 +
  381 + <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="pay" data-index="{{index}}" wx:if="{{item.order_status==0}}">立即支付</navigator>
  382 +
  383 +
  384 +
  385 + </view>
  386 + </view>
  387 + </view>
  388 + </view>
  389 + </view>
  390 +</view>
  391 +
266 392 <!-- 线下订单 -->
267   -<view class="offline-container" wx:else>
  393 +<view class="offline-container" wx:elif="{{currentIndex == 1}}">
268 394 <view class="offline-list">
269 395 <view class="item" wx:for="{{list2}}">
270 396 <view class="title">
... ... @@ -298,14 +424,14 @@
298 424  
299 425  
300 426 <!-- 没有数据 -->
301   -<view class="After_all flex-center" wx:if="{{(iscodeall==1 && orderList.length>1 && currentIndex ==0) || (is_no_more2 && currentIndex == 1)}}">
302   - <view class="Line"></view>
  427 +<view class="After_all flex-center" wx:if="{{(iscodeall==1 && orderList.length>1 && currentIndex ==0) || (is_no_more2 && currentIndex == 1) || (is_no_more2 && currentIndex == 2)}}">
  428 + <!-- <view class="Line"></view> -->
303 429 <view class="end fs26 xc-black">——— 到底了 ———</view>
304   - <view class="Line"></view>
  430 + <!-- <view class="Line"></view> -->
305 431 </view>
306 432  
307 433 <!-- 无订单 -->
308   -<view class="empty_order" wx:if="{{((!orderList||orderList.length==0) && is_get && currentIndex == 0) || (list2.length==0 && currentIndex == 1)}}">
  434 +<view class="empty_order" wx:if="{{((!orderList||orderList.length==0) && is_get && currentIndex == 0) || (list2.length==0 && currentIndex == 1) || (cardList.length == 0 && currentIndex == 2)}}">
309 435 <view class="flex-level">
310 436 <image src="{{iurl}}miniapp/images/order/empty_order.png"></image>
311 437 </view>
... ... @@ -316,5 +442,6 @@
316 442 </navigator>
317 443 </view>
318 444 </view>
  445 +
319 446 <!-- 弹出框扫描 -->
320 447 <qr_code id="qc_com"></qr_code>
... ...
pages/user/order_list/order_list.wxss
... ... @@ -617,5 +617,8 @@ page {
617 617 border-bottom-left-radius: 8rpx;
618 618 }
619 619  
  620 +.bg-orange {
  621 + background-color: #ff9000;
  622 +}
620 623  
621 624  
... ...
utils/filter.wxs
... ... @@ -171,7 +171,18 @@ var filters = {
171 171  
172 172 JSONStringify: function(val) {
173 173 return JSON.stringify(val);
174   - }
  174 + },
  175 +
  176 + // 循环列表计算数量
  177 + count: function(list) {
  178 + var sum = 0;
  179 + if(list && list.length != 0) {
  180 + list.forEach(function(item) {
  181 + sum += item.qty;
  182 + });
  183 + return sum;
  184 + };
  185 + },
175 186  
176 187  
177 188  
... ... @@ -194,4 +205,5 @@ module.exports = {
194 205 price: filters.price,
195 206 div100: filters.div100,
196 207 JSONStringify: filters.JSONStringify,
  208 + count: filters.count,
197 209 }
198 210 \ No newline at end of file
... ...
utils/request.js
... ... @@ -2,6 +2,10 @@ var t = require(&quot;util.js&quot;);
2 2  
3 3 module.exports = {
4 4 uniqueId: "",
  5 + // i: url
  6 + // e: method
  7 + // s: data
  8 + // a: header
5 9 request: function(e, i, o) {
6 10 var n = this, a = o.header ? o.header : {
7 11 "content-type": "application/x-www-form-urlencoded"
... ... @@ -39,7 +43,9 @@ module.exports = {
39 43  
40 44 uploadFile: function(t, e) {
41 45 var i = this;
42   - t = this.modifyUrl(t, e), console.log("app.request", t, e), e.isShowLoading = void 0 === e.isShowLoading || e.isShowLoading,
  46 + t = this.modifyUrl(t, e),
  47 + // console.log("app.request", t, e),
  48 + e.isShowLoading = void 0 === e.isShowLoading || e.isShowLoading,
43 49 e.isShowLoading && this.showLoading(), wx.uploadFile(Object.assign({}, e, {
44 50 url: t,
45 51 filePath: e.filePath,
... ...