Commit f913b368084bce852632c652778366d773b8fee5

Authored by taiyuan
2 parents a1e28b1c 5a491db8

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

packageA/pages/my_service2/appment_main.js
... ... @@ -3,6 +3,8 @@ var e = getApp(),
3 3 os = a,
4 4 t = e.request,
5 5 d = e.globalData;
  6 + var ut = require("../../../utils/util.js");
  7 +
6 8 Page({
7 9 /**
8 10 * 页面的初始数据
... ... @@ -11,21 +13,17 @@ Page({
11 13 inurl: a.url, //接口网址
12 14 iurl: a.imghost, //服务器网址
13 15 store: 0, //是否显示服务门店列表
14   - beautician: 0, //是否显示美容师列表
15   - beautician_name: "", //选中的美容师名称
16   - beauticianID: "", //美容师id
17   - bea_index: "", //美容师列表下标
  16 +
18 17 placeholder: "填写备注", //备注为空的placeholder
19 18 store_list: [], //门店列表
20   - beautician_list: [], //美容师列表
21   - store_name: "", //选择的服务门店
  19 +
  20 + store_name: "", //选择的服务门店
22 21 fir_pick_index: 0, //选择的门店下标
23 22 curpage: 1, //当前分页数
24 23 pageSize: 8, //页大小
25 24 total: 0,
26 25 ismore: 0, //是否加载完毕
27   - itemId: "", //服务id
28   - project_id: "", //项目id
  26 +
29 27 isScroll: true, //scroll-y是否可以滑动
30 28 key_word: "", //是否按门店文字查询
31 29 is_service_read: 0, //是否调用过门店接口
... ... @@ -34,8 +32,7 @@ Page({
34 32 remarks: "", //备注
35 33 storageId: "", //线下门店id
36 34 url: "/packageA/pages/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来
37   - buyType: "", //项目类型
38   - time: "", //选择预约时间
  35 +
39 36 tment_count: "", //可预约人数
40 37 lat: "", //纬度坐标
41 38 lon: "", //经度坐标
... ... @@ -44,19 +41,22 @@ Page({
44 41 is_sub: 0, //判断是否重复提交
45 42 is_textea: 1, //备注是否是可输入
46 43  
47   - // 拖拽参数
48   - writePosition: [], //默认定位参数
49   - writesize: [0, 0],// X Y 定位
50   - window: [0, 0], //屏幕尺寸
51   - write: [0, 0], //定位参数
52   - scrolltop: 0,//据顶部距离
53   - v:{},
54   -
55   - project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
56   - md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
57   - timeList: [],
58   - deltaX: 0,
59   - col_arr:[],
  44 + write: [0, 0], //定位参数
  45 + scrolltop: 0,//据顶部距离
  46 + v:{},
  47 +
  48 + //project: ['项目1', '项目2', '项目3', '项目4', '项目5', '项目6', '项目7'],
  49 + //md: [{name:'美导1',time:'08:30-22:00'},{name:'美导2',time:'09:30-18:00'},],
  50 + timeList: [],
  51 + deltaX: 0,
  52 + col_arr:[],
  53 + wp:[],
  54 + datet:null,
  55 + s_top:0,
  56 +
  57 + cur_sele_i:-1,
  58 + cur_sele_j:-1
  59 +
60 60 },
61 61 //控制备注输入
62 62 check_text: function() {
... ... @@ -67,6 +67,7 @@ Page({
67 67 beautician: 0
68 68 })
69 69 },
  70 +
70 71 onclickstore: function() {
71 72 var th = this;
72 73 var store = th.data.store;
... ... @@ -85,6 +86,8 @@ Page({
85 86 wx.showLoading({
86 87 title: '加载中',
87 88 })
  89 +
  90 + //获取门店
88 91 th.query_store();
89 92 }
90 93 }
... ... @@ -96,104 +99,82 @@ Page({
96 99 remarks: remarks
97 100 })
98 101 },
99   - //提交成功及发送模版代码
  102 +
  103 +
  104 + //单个预约的提交成功及发送模版代码
100 105 success: function() {
  106 + var user_id=getApp().globalData.userInfo.user_id;
  107 + wx.showLoading({ title: '加载中', });
101 108 var th = this;
102 109 var store = th.data.store_name; //门店名称
103   - var bea_name = th.data.beautician_name; //美容师名称
104   - var time = th.data.time; //预约时间
105   - var is_sub = th.data.is_sub; //是否重复提交
106   - var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/insert"; //接口路径
107   - var serviceId = th.data.itemId; //服务id
108   - var beauticianID = th.data.beauticianID; //美容师id
109   - var buyType = th.data.buyType; //服务项目类型
110   - var storeId = a.stoid; //商家id
111   - var storageId = th.data.storageId; //门店id
112   - var userId = th.data.options.userid; //用户id
113   - var remarks = th.data.remarks; //用户备注
114   - var project_id = th.data.project_id; //项目id
115   - var validay = th.data.validay;
116   - var json = {
117   - "arrangeTime": time + ":00",
118   - "beauticianId": beauticianID,
119   - "buyType": buyType,
120   - "effectiveDay": "",
121   - "number": "",
122   - "projectId": project_id,
123   - "remark": remarks,
124   - "serviceId": serviceId,
125   - "states": 0,
126   - "storageId": storageId,
127   - "storeId": storeId,
128   - "userId": userId,
129   - "validay": validay,
130   - "isxz": 1
131   -
132   - }
133   - var data = JSON.stringify(json);
  110 + var datet = th.data.datet; //预约时间
  111 + //接口路径
  112 + var url = th.data.inurl + "/api/weshop/marketing/reservation/reservation/batchinsert";
  113 + var req_arr={
  114 + "storageId": th.data.storageId,
  115 + "storeId": a.stoid,
  116 + "userId": user_id,
  117 + "remark": '',
  118 + "isxz": 1,
  119 + "states": 0,
  120 + "list":[]
  121 + };
  122 + for(var i in this.data.v){
  123 + for(var j in this.data.v[i]){
  124 + var item=this.data.v[i][j];
  125 + var md=this.data.md[i];
  126 + var tn=this.data.timeArr[j];
  127 + var json = {
  128 + "arrangeTime":datet+' '+ tn + ":00",
  129 + "beauticianId":encodeURIComponent(md.staffid) ,
  130 + "buyType": item.BuyType,
  131 + //"effectiveDay": "",
  132 + //"number": "",
  133 + "projectId": item.ProjectID,
  134 + "serviceId": item.ServiceID,
  135 + "validay": item.Validay,
  136 + }
  137 + req_arr.list.push(json);
  138 + }
  139 + }
  140 + console.log(req_arr);
  141 + //return false;
  142 + var js_data = JSON.stringify(req_arr);
134 143 wx.request({
135 144 url: url,
136   - data: json,
  145 + data: js_data,
137 146 method: 'post',
138 147 header: {
139 148 'content-type': 'application/json'
140 149 }, // 设置请求的 header
141 150 success: function(res) {
142   - th.setData({
143   - is_sub: 0
144   - })
  151 + th.setData({ is_sub: 0})
145 152 wx.hideLoading();
146 153 if (res.data.code == 0) {
147   - getApp().my_warnning("预约成功", 1, th);
148   - // var store_name = th.data.store_name; //预约门店
149   - var number = res.data.data.Number;
150   - // var temp_url = "/api/wx/open/app/user/sendSubscribeMsg"; //模版接口
151   - //var userinfo = getApp().globalData.userInfo;
152   - //var name = d.userInfo.nickname;
153   - // var json = {
154   - // // "formId": formid,
155   - // "keyWord": [{
156   - // "keyword": res.data.data.ServiceName
157   - // },
158   - // {
159   - // "keyword": time.substring(0, 16)
160   - // }, {
161   - // "keyword": res.data.data.BeauticianName
162   - // }, {
163   - // "keyword": res.data.data.StorageName
164   - // }, {
165   - // "keyword": res.data.data.Address
166   - // }
167   - // ],
168   - // "page": "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
169   - // "storeId": a.stoid,
170   - // "typeId": "1011",
171   - // "userId": th.data.options.userid
172   - // };
173   - // var data = JSON.stringify(json);
174   - // //调用发送预约成功模版接口
175   - // wx.request({
176   - // url: th.data.inurl + temp_url,
177   - // data: data,
178   - // method: 'post',
179   - // header: {
180   - // 'content-type': 'application/json'
181   - // }, // 设置请求的 header
182   - // success: function(data) {}
183   - // })
184   -
185   - wx.redirectTo({
186   - url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+th.data.options.userid,
187   - });
188   -
  154 + getApp().my_warnning("预约成功", 1, th);
  155 +
  156 + if(res.data.data.length>1){
  157 + var number = res.data.data[0].Number;
  158 + wx.redirectTo({
  159 + url: "/packageA/pages/my_service/tment_order_list?number=" + number+"&userid="+user_id,
  160 + });
  161 +
  162 + }else{
  163 + var number = res.data.data[0].Number;
  164 + wx.redirectTo({
  165 + url: "/packageA/pages/my_service/tment_details?number=" + number+"&userid="+user_id,
  166 + });
  167 + }
  168 +
189 169 } else {
190 170 getApp().my_warnning(res.data.msg, 0, th);
191 171 th.settime();
192 172 }
193 173 }
194 174 })
195   -
196 175 },
  176 +
  177 +
197 178 //定时显示texteat
198 179 settime: function() {
199 180 var th = this;
... ... @@ -203,141 +184,59 @@ Page({
203 184 })
204 185 }, 2000);
205 186 },
206   - //提交预约
  187 +
  188 +
  189 + //-- 提交预约 --
207 190 sub_success: function(e) {
208 191 var th = this;
209   - var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
  192 + //和推送消息有关系
  193 + var temp_url = th.data.inurl + "/api/wx/weappSendlist/page";
210 194 var template_id = "";
211   - if (th.data.is_sub == 1) {
212   - return false;
213   - }
214   - var store = th.data.store_name; //门店名称
215   - var bea_name = th.data.beautician_name; //美容师名称
216   - var time = th.data.time; //预约时间
217   - var is_sub = th.data.is_sub; //是否重复提交
218   - th.setData({
219   - is_textea: 0,
220   - is_sub: 1
221   - })
  195 +
  196 + //门店名称
  197 + var store = th.data.store_name;
222 198 //提交预约前的判断
223 199 if (store == "") {
224   - getApp().my_warnning("请选择服务门店", 0, th);
225   - th.setData({
226   - is_sub: 0
227   - })
228   - th.settime();
229   - return false;
230   - } else if (bea_name == "") {
231   - getApp().my_warnning("请选择美容师", 0, th);
232   - th.setData({
233   - is_sub: 0
234   - })
235   - th.settime();
236   - return false;
237   - } else if (time == undefined || time == '') {
238   - getApp().my_warnning("请选择预约时间", 0, th);
239   - th.setData({
240   - is_sub: 0
241   - })
242   - th.settime();
243   - return false;
244   - } else {
245   - var version ="";
246   - //判断微信版本是否达到预约成功订阅的要求
247   - wx.getSystemInfo({
248   - success(res) {
249   - version = res.version;
250   - }
251   - })
252   - wx.showLoading({
253   - title: '加载中',
254   - })
255   -
256   - th.success();
257   - // if (th.ver(version, '7.0.4') >= 0) {
258   - // //获取模版id
259   - // getApp().request.promiseGet(temp_url, {
260   - // data: {
261   - // store_id: a.stoid,
262   - // typeid: "1011"
263   - // }
264   - // }).then(res => {
265   - // if (res.data.code == 0 && res.data.data.pageData.length > 0) {
266   - // template_id = res.data.data.pageData[0].template_id;
267   - // // //授权订阅
268   - // wx.requestSubscribeMessage({
269   - // tmplIds: [template_id],
270   - // success(res) {
271   - // th.success();
272   - // },
273   - // fail(res) {
274   - // th.success();
275   - // }
276   - // })
277   - // } else {
278   - // th.success();
279   - // }
280   - // })
281   - // } else {
282   - // // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
283   - // wx.showModal({
284   - // title: '提示',
285   - // content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
286   - // })
287   - // th.setData({
288   - // is_sub: 0
289   - // })
290   - // }
291   -
292   - }
293   - },
294   - //版本判断
295   - ver:function(v1,v2){
296   - v1 = v1.split('.')
297   - v2 = v2.split('.')
298   - var num1 = "" ;
299   - var num2 = "";
300   - var len = Math.max(v1.length, v2.length)
301   -
302   - while (v1.length < len) {
303   - v1.push('0')
304   - }
305   - while (v2.length < len) {
306   - v2.push('0')
307   - }
308   -
309   - for (let i = 0; i < len; i++) {
310   - num1 = parseInt(v1[i])
311   - num2 = parseInt(v2[i])
312   -
313   - if (num1 > num2) {
314   - return 1
315   - } else if (num1 < num2) {
316   - return -1
317   - }
318   - }
319   - return 0
320   - },
321   - goto: function(e) {
322   - var th = this;
323   - th.setData({
324   - beautician: 0,
325   - is_textea: 0
326   - })
327   - if (th.data.store_name == "") {
328   - getApp().my_warnning("请选择服务门店", 0, th);
329   - th.settime();
330   - } else if (th.data.beautician_name == "") {
331   - getApp().my_warnning("请选择美容师", 0, th);
332   - th.settime();
333   - } else {
334   - th.setData({
335   - is_textea: 1
336   - })
337   - var url = e.currentTarget.dataset.url;
338   - getApp().goto(url);
339   - }
  200 + getApp().my_warnning("请选择服务门店", 0, th);
  201 + return false;
  202 + }
  203 +
  204 + if(Object.keys(th.data.v).length === 0){
  205 + getApp().my_warnning("请选择美导和预约时间", 0, th);
  206 + return false;
  207 + }
  208 +
  209 + if(th.data.is_sub) return false;
  210 + th.setData({ is_sub: 1});
  211 +
  212 +
  213 + //获取模版id
  214 + getApp().request.get(temp_url, {
  215 + data: {
  216 + store_id: a.stoid,
  217 + typeid: "1011"
  218 + },
  219 + success:function(res){
  220 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  221 + template_id = res.data.data.pageData[0].template_id;
  222 + // //授权订阅
  223 + wx.requestSubscribeMessage({
  224 + tmplIds: [template_id],
  225 + success(res) {
  226 + th.success();
  227 + },
  228 + fail(res) {
  229 + th.success();
  230 + }
  231 + })
  232 + } else {
  233 + th.success();
  234 + }
  235 + }
  236 + })
  237 +
340 238 },
  239 +
341 240 //点击选择门店
342 241 choose_for_store: function(e) {
343 242 var th = this;
... ... @@ -355,6 +254,7 @@ Page({
355 254 })
356 255 }
357 256 },
  257 +
358 258 //确认选择门店
359 259 choice_store: function() {
360 260 var th = this;
... ... @@ -367,8 +267,49 @@ Page({
367 267 storageId: Id,
368 268 is_textea: 1
369 269 })
  270 +
  271 + th.get_project_guide();
  272 +
370 273 },
371   - onReachBottom: function() {
  274 +
  275 + //获取美导和项目
  276 + get_project_guide(){
  277 + var th=this,user=getApp().globalData.userInfo;
  278 + var req={
  279 + storeId:os.stoid,
  280 + userId:user.user_id,
  281 + StorageId:encodeURIComponent(this.data.storageId),
  282 + }
  283 + getApp().request.get("/api/weshop/marketing/reservation/sm/pageNew",{
  284 + data:req,
  285 + success:function(res){
  286 + if(ut.ajax_ok(res)){
  287 + th.setData({project:res.data.data.pageData})
  288 + }
  289 + }
  290 + })
  291 +
  292 + req.SeekTime=this.data.datet;
  293 + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{
  294 + data:req,
  295 + success:function(res){
  296 + if(ut.ajax_ok2(res)){
  297 + th.setData({v:{},col_arr:[]})
  298 + //-- 有些时间是全部没有的 --
  299 + th.setTimeShow(res.data.data)
  300 + }
  301 + }
  302 + })
  303 +
  304 + //获取第一个元素的位置
  305 + setTimeout(function(){
  306 + th.queryMultipleNodes();
  307 + },1000)
  308 +
  309 + },
  310 +
  311 +
  312 + onGetBottom: function() {
372 313 var th = this;
373 314 if (this.data.total <= th.data.pageSize) return;
374 315 if (this.data.ismore) return;
... ... @@ -378,6 +319,7 @@ Page({
378 319 })
379 320 th.query_store();
380 321 },
  322 +
381 323 //分页查询门店信息
382 324 query_store: function() {
383 325 var th = this;
... ... @@ -385,14 +327,13 @@ Page({
385 327 is_textea: 0
386 328 })
387 329 var itemId = th.data.itemId; //服务id
388   - var url = "/api/weshop/marketing/reservation/storage/pagenew";
  330 + var url = "/api/weshop/marketing/reservation/storage/pageAll";
389 331 var key_word = th.data.key_word;
390 332 key_word = key_word.replace(/\s+/g, "");
391 333 getApp().request.promiseGet(url, {
392 334 data: {
393   - userId: th.data.options.userid,
  335 + userId: getApp().globalData.user_id,
394 336 storeId: a.stoid,
395   - serviceId: itemId,
396 337 latitude: th.data.lat,
397 338 longitude: th.data.lon,
398 339 page: th.data.curpage,
... ... @@ -534,8 +475,9 @@ Page({
534 475 th.setData({
535 476 is_textea: 1
536 477 })
537   - console.log('optionsxxx===>', this.data.options);
538   - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id);
  478 +
  479 + console.log('optionsxxx===>', this.data.options);
  480 + // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id);
539 481 wx.navigateTo({
540 482 url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id
541 483 });
... ... @@ -546,15 +488,30 @@ Page({
546 488 * 生命周期函数--监听页面加载
547 489 */
548 490 onLoad: function(options) {
  491 +
  492 +
  493 + // 如果数值位数为1,则补0
  494 + function appendZero(obj) {
  495 + if (obj < 10) {
  496 + return "0" + "" + obj;
  497 + } else {
  498 + return obj;
  499 + }
  500 + };
549 501  
550 502 this.getTimeList(23, 30);
551 503 var th = this;
  504 + var now_date = new Date();
  505 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate());
  506 +
552 507 th.setData({
553   - options,
  508 + options,
554 509 itemId: options.service_id,
555 510 buyType: options.BuyType,
556 511 project_id: options.ProjectID,
557   - validay: options.Validay
  512 + validay: options.Validay,
  513 + datet:md,
  514 + nowDate:md
558 515 });
559 516 wx.getLocation({
560 517 type: 'gcj02',
... ... @@ -584,87 +541,30 @@ Page({
584 541 th.data.is_get_local_ok = 1;
585 542 }
586 543 });
587   -
588   - // 获取当前默认导购信息及归属门店信息
589   - if(options.firstleader) {
590   - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
591   - if(res.data.code==0){
592   - getApp().globalData.guide_id=res.data.data.id;
593   -
594   - getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
595   - data: {
596   - store_id: a.stoid,
597   - guide_id: e.globalData.guide_id,
598   - UserCode: th.data.options.usercode,
599   - }
600   - }).then(res => {
601   - console.log('res==>', a.stoid, e.globalData.guide_id, th.data.options.usercode);
602   - if(res.data.data.Tech) {
603   -
604   - var data={
605   - store_name: res.data.data.StorageName,
606   - beautician_name: res.data.data.StaffName,
607   - beauticianID: res.data.data.StaffId,
608   - StorageId: res.data.data.StorageId,
609   - }
610   - th.check_firleader(data);
611   - }
612   - });
613   -
614   -
615   - };
616   - });
617   - };
618   -
619   -
  544 +
  545 + //--先判断会员状态--
  546 + var user_info = getApp().globalData.userInfo;
  547 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  548 + wx.navigateTo({
  549 + url: '/pages/togoin/togoin',
  550 + })
  551 + return false;
  552 + }
620 553 },
621   - //查询剩下可预约人数
622   - query_more: function() {
623   - var th = this;
624   - var url = "/api/weshop/marketing/reservation/can/reservation/countnew";
625   - var beauticianID = th.data.beauticianID; //美容师id
626   - var projectID = th.data.itemId; //服务id
627   - var seekTime = th.data.time; //预约日期
628   - var storageId = th.data.storageId; //门店id
629   - var storeId = a.stoid; //商家id
630   - getApp().request.promiseGet(url, {
631   - data: {
632   - beauticianId: beauticianID,
633   - seekTime: seekTime,
634   - serviceId: projectID,
635   - storageId: storageId,
636   - storeId: storeId
637   - }
638   - }).then(res => {
639   - if (res.data.code == 0) {
640   - var tment_count = res.data.data.CanReservation;
641   - th.setData({
642   - tment_count: tment_count
643   - })
644   - } else {
645   - getApp().my_warnning(res.data.msg, 0, th);
646   - th.settime();
647   - }
648   - })
  554 +
649 555  
650   - },
651 556 /**
652 557 * 生命周期函数--监听页面显示
653 558 */
654 559 onShow: function() {
655 560 var th = this;
656   - var seekTime = th.data.time; //预约日期
657   - if (seekTime != "") {
658   - th.query_more();
659   - }
660 561 th.setData({
661   - time: th.data.time.substring(0, 16),
662 562 is_textea: 1
663 563 })
664   - th.query_project();
665   -
666   - th.queryMultipleNodes();
  564 +
667 565 },
  566 +
  567 +
668 568 //获取单个服务项目信息
669 569 query_project: function() {
670 570 var th = this;
... ... @@ -687,81 +587,17 @@ Page({
687 587 }
688 588 })
689 589 },
690   - //关闭导航
691   - // close: function() {
692   - // var th = this;
693   - // var nav_b = th.selectComponent("#nav_b"); //组件的id
694   - // nav_b.close_box();
695   - // }
696   -
697   - //判断分享的导购是不是有门店,是不是该门店下又该会员
698   - check_firleader(data){
699   - var th=this;
700   - var itemId = this.data.itemId; //服务id
701   - var url = "/api/weshop/marketing/reservation/storage/pagenew";
702   - var key_word = data.store_name;
703   - key_word = key_word.replace(/\s+/g, "");
704   - getApp().request.promiseGet(url, {
705   - data: {
706   - userId: th.data.options.userid,
707   - storeId: os.stoid,
708   - serviceId: itemId,
709   - latitude: th.data.lat,
710   - longitude: th.data.lon,
711   - page: 1,
712   - pageSize: 1000,
713   - keyWord: key_word
714   - }
715   - }).then(res => {
716   - //-- 如果是门店的话 --
717   - if (res.data.code == 0 && res.data.data && res.data.data.pageData) {
718   - var store_data=null;
719   - for(var i in res.data.data.pageData){
720   - var it=res.data.data.pageData[i];
721   - if(it.Id==data.StorageId){
722   - store_data={
723   - store_name: data.store_name,
724   - StorageId: data.StorageId,
725   - };
726   - break;
727   - }
728   - }
729   - if(!store_data) return false;
730   - th.setData(store_data)
731   -
732   - }else{
733   - return false;
734   - }
735   -
736   - //导购接口地址
737   - var url = "/api/weshop/marketing/reservation/staff/pagenew";
738   - return getApp().request.promiseGet(url, {
739   - isShowLoading:1,
740   - data: {
741   - storeId: os.stoid,
742   - userId: th.data.options.userid,
743   - serviceId: itemId,
744   - storageId: data.StorageId
745   - }
746   - })
747   - }).then(res=>{
748   - if (res && res.data && res.data.code == 0) {
749   - var beautician_list=res.data.data;
750   - for(var i in beautician_list){
751   - var item=beautician_list[i];
752   - if(item.staffid==data.beauticianID){
753   - th.setData({
754   - beautician_name:data.beautician_name,
755   - beauticianID:data.beauticianID,
756   - })
757   - break;
758   - }
759   - }
760   -
761   - }
762   - })
763   - },
  590 +
764 591  
  592 +
  593 + //开始拖拽项目列表
  594 + touchmove1: function (e) {
  595 + var that = this;
  596 + var position = [e.touches[0].pageX-15, e.touches[0].pageY-that.data.s_top];
  597 + that.setData({
  598 + wp: position
  599 + });
  600 + },
765 601  
766 602 //开始拖拽
767 603 touchmove: function (e) {
... ... @@ -772,59 +608,233 @@ Page({
772 608 write: position
773 609 });
774 610 },
775   - touchend:function(e){
776   - var that = this,th=that;
777   - if(!that.data.copy_btn) return false;
778   - var position =th.data.write;
779   - var arr=th.data.col_arr;
780   - for(var i=0;i<this.data.md.length;i++){//i是列
781   - var item=this.data.md[i];
782   - var nd=new Date();
783   - var d_str=nd.getFullYear()+"-"+(nd.getMonth()+1)+"-"+nd.getDate()+" ";
784   - var d_arr=item.time.split("-");
785   - var t1=new Date(d_str+d_arr[0])
786   - var t2=d_arr.length>1?new Date(d_str+d_arr[1]):0;
787   -
788   - for(var j=0; j<this.data.timeArr.length;j++){//j是行
789   - if(arr.indexOf(j)!=-1) continue;
790   - var tn=new Date(d_str+this.data.timeArr[j]);
791   - //小于开始时间
792   - if(tn<t1) continue;
793   - //大于结束时间
794   - if(tn>t2 && t2>0) continue;
795   - //如果坐标在网格内
796   - if( position[0]>th.data.f_x+i*th.data.f_width && position[0]<th.data.f_x+ (i+1)*th.data.f_width &&
797   - position[1]>th.data.f_y +j*th.data.f_hei && position[1]<th.data.f_y+(j+1)*th.data.f_hei){
798   -
799   - var txt="v["+i+"]["+j+"]";
  611 +
  612 + //-- 点击空格选择 --
  613 + sele_tab:function(e){
  614 + if(!this.data.sele_project){
  615 + wx.showToast({
  616 + title: "请选择要预约的项目",
  617 + icon: 'none',
  618 + duration: 2000
  619 + })
  620 + return false;
  621 + }
  622 +
  623 + var th=this;
  624 + var arr=this.data.col_arr;
  625 + var i=e.currentTarget.dataset.index;
  626 + var j=e.currentTarget.dataset.subindex;
  627 +
  628 + var item=this.data.md[i]; //获得美导
  629 + var tn=this.data.timeArr[j]; //获得时间
  630 +
  631 + //查看时间段能不能预约
  632 + if(!item.listtime[j].iskyy){
  633 + wx.showToast({
  634 + title: "该时间不可以预约",
  635 + icon: 'none',
  636 + duration: 2000
  637 + })
  638 + return false;
  639 + }
  640 + //查看时间有没有被预约了
  641 + if(this.data.v && this.data.v[i] && this.data.v[i][j]){
  642 + wx.showToast({
  643 + title: "该时间已被预约",
  644 + icon: 'none',
  645 + duration: 2000
  646 + })
  647 + return false;
  648 + }
  649 +
  650 + if(!item.listtime[j].itemids){
  651 + wx.showToast({
  652 + title: "该时间不可预约该项目",
  653 + icon: 'none',
  654 + duration: 1500
  655 + })
  656 + return false;
  657 + }
  658 +
  659 + var project_arr=item.listtime[j].itemids.split(',');
  660 +
  661 + if(project_arr.indexOf(this.data.sele_project.ServiceID)==-1){
  662 + wx.showToast({
  663 + title: "该时间不可预约该项目",
  664 + icon: 'none',
  665 + duration: 1500
  666 + })
  667 + return false;
  668 + }
  669 +
  670 + //同一美导同一项目,能选择两次,只要时间段不重复
  671 + if(this.data.v[i] && Object.keys(this.data.v[i]).length){
  672 + for(var sj in this.data.v[i]){
  673 + if(this.data.v[i][sj] && this.data.v[i][sj].ProjectID==this.data.sele_project.ProjectID){
  674 + th.checK_is_can_yy(item,tn,function(res){
  675 + if(res){
  676 + if(res>1){
  677 + wx.showToast({
  678 + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000
  679 + });
  680 + return false;
  681 + }
  682 + wx.showModal({
  683 + title: "当前项目已有预约是否修改?",
  684 + success: function (res) {
  685 + if(res.confirm){
  686 + delete th.data.v[i][sj];
  687 + if(!th.data.v[i])
  688 + th.data.v[i]={}
  689 + th.data.v[i][j]=th.data.sele_project;
  690 + var ind=arr.indexOf(sj);
  691 + arr.splice(ind, 1);
  692 + arr.push(j);
  693 + th.setData({
  694 + v: th.data.v,col_arr:arr
  695 + });
  696 +
  697 + }
  698 + }
  699 + })
  700 + return false;
  701 + }else{
  702 + var txt="v["+i+"]["+j+"]";
800 703 arr.push(j);
801 704 th.setData({
802   - [txt]: th.data.projectName,
  705 + [txt]: th.data.sele_project,
803 706 col_arr:arr
804   - });
805   - break;
806   - }
  707 + });
  708 + return false;
  709 + }
  710 + })
  711 +
  712 + }
  713 + }
  714 +
  715 + }
  716 +
  717 + th.checK_is_can_yy(item,tn,function(res){
  718 + if(res){
  719 + if(res>1){
  720 + wx.showToast({
  721 + title: '当前项目预约次数已超出项目剩余数,请先修改', icon: 'none', duration: 2000
  722 + });
  723 + return false;
  724 + }
  725 +
  726 + wx.showModal({
  727 + title: "当前项目已有预约是否修改?",
  728 + success: function (res) {
  729 + if(res.confirm){
  730 +
  731 + var ii=th.data.cur_sele_i;
  732 + var jj=th.data.cur_sele_j;
  733 + delete th.data.v[ii][jj];
  734 + if(!th.data.v[i])
  735 + th.data.v[i]={}
  736 + th.data.v[i][j]=th.data.sele_project;
  737 + var ind=arr.indexOf(jj);
  738 + arr.splice(ind, 1);
  739 + arr.push(j);
  740 + th.setData({
  741 + v: th.data.v,col_arr:arr
  742 + });
  743 + }
  744 + }
  745 + })
  746 +
  747 + }else{
  748 + var txt="v["+i+"]["+j+"]";
  749 + arr.push(j);
  750 + th.setData({
  751 + [txt]: th.data.sele_project,
  752 + col_arr:arr
  753 + });
  754 + }
  755 +
807 756  
808   - }
809   - }
810   - th.setData({copy_btn:0})
  757 +
  758 + });
811 759 },
812 760  
813 761  
  762 +
  763 +
  764 +
  765 + //删除响应的预约
814 766 close_this:function (e){
815 767 var txt=e.currentTarget.dataset.txt;
816 768 var sindex=parseInt(e.currentTarget.dataset.sindex);
817   - var arr=this.data.col_arr;
818   - var ind=arr.indexOf(sindex);
  769 + var arr=this.data.col_arr;
  770 + var ind=arr.indexOf(sindex);
819 771 arr.splice(ind,1)
820 772 this.setData({[txt]:null,col_arr:arr})
821 773 },
822 774  
823   - onPageScroll(e) {
824   - // console.log('滚动距离', e);
825   - this.data.scrolltop = e.scrollTop;
826   - },
  775 + //计算滚蛋的距离
  776 + onPageScroll(e) { this.data.scrolltop = e.scrollTop;},
  777 +
  778 + //确认有没有预约
  779 + checK_is_can_yy(item, tn, back) {
  780 + var th = this;
  781 + var req = {
  782 + beauticianId: encodeURIComponent(item.staffid),
  783 + seekTime: this.data.datet + " " + tn + ":00",
  784 + serviceId: encodeURIComponent(this.data.sele_project.ServiceID),
  785 + storageId: encodeURIComponent(this.data.storageId),
  786 + storeId: os.stoid
  787 + }
  788 + getApp().request.get("/api/weshop/marketing/reservation/can/reservation/countnew", {
  789 + data: req,
  790 + success: function (res) {
  791 + th.setData({ copy_btn: 0 });
  792 + if (res.data.code == 0) {
  793 + if (!res.data.data.CanReservation && parseInt(res.data.data.canReservation) <= 0) {
  794 + wx.showToast({
  795 + title: '该项目不可以预约', icon: 'none', duration: 2000
  796 + });
  797 + return false;
  798 + }
  799 +
  800 + if (!th.data.v) { back(); return false; }
  801 +
  802 + var arr = Object.keys(th.data.v);
  803 + if (arr.length == 0) { back(); return false; }
827 804  
  805 + var num = 0;
  806 + var sele_arr=[];
  807 + for (var i in th.data.v) {
  808 + if (!th.data.v[i]) continue;
  809 + for (var j in th.data.v[i]) {
  810 + if (th.data.v[i][j] && th.data.v[i][j].ProjectID == th.data.sele_project.ProjectID) {
  811 + num++;
  812 + th.data.cur_sele_i=i;
  813 + th.data.cur_sele_j=j;
  814 + }
  815 + }
  816 + }
  817 +
  818 + if (!num) { back(); return false; }
  819 +
  820 + //如果已经超出次数的时候,就不能预约了
  821 + if (num >= parseInt(res.data.data.CanReservation)) {
  822 +
  823 + back(num);
  824 + return false;
  825 + }
  826 + back();
  827 +
  828 + } else {
  829 + wx.showToast({
  830 + title: res.data.msg,
  831 + icon: 'none',
  832 + duration: 2000
  833 + })
  834 + }
  835 + }
  836 + })
  837 + },
828 838  
829 839 //声明节点查询的方法
830 840 queryMultipleNodes: function() {
... ... @@ -838,11 +848,16 @@ Page({
838 848 th.data.f_y=res[0].top;
839 849 th.data.f_hei=res[0].height;
840 850 th.data.f_width=res[0].width;
841   -
842 851 })
  852 +
843 853 },
844 854  
  855 + /*--
845 856 getcopy(e) {
  857 +
  858 + },--*/
  859 + //项目元素点击后的效果
  860 + getName(e) {
846 861 var that=this;
847 862 console.log('e', e);
848 863 var x=e.currentTarget.dataset.offsetLeft;
... ... @@ -850,52 +865,73 @@ Page({
850 865 var position = [x, y];
851 866 that.setData({
852 867 write: position,copy_btn:1
853   - });
854   -
855   - },
856   -
857   - getName(e) {
858   - // console.log('e1', e);
859   - let name = e.currentTarget.dataset.name;
  868 + });
  869 + // console.log('e1', e);
  870 + let index = e.currentTarget.dataset.index;
  871 + let name = this.data.project[index];
  872 +
  873 +
860 874 this.setData({
861   - projectName: name,
  875 + sele_project: name,prj_index:index
862 876 });
863 877 },
  878 +
  879 + //-- 项目列表长按 --
  880 + setmove1(){
  881 + this.setData({move1:1});
  882 + },
864 883  
865   -
866   - // 生成时间段
867   - getTimeList(hours,step) {
868   - var minutes=60;
  884 + //-- 生成时间段 --
  885 + getTimeList(hours,step) {
  886 + var minutes=60;
869 887 var timeArr = [];
870 888 hours = hours;
871 889 step = step;
  890 +
  891 + // 如果数值位数为1,则补0
  892 + function appendZero(obj) {
  893 + if (obj < 10) {
  894 + return "0" + "" + obj;
  895 + } else {
  896 + return obj;
  897 + }
  898 + };
  899 +
  900 + var now_date=new Date();
  901 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1) + "-" + appendZero(now_date.getDate());
872 902  
873   - for(var i = 8; i < hours; i++){
874   - var str = '';
875   - if(i < 10) {
876   - str = 0 + '' + i;
877   - } else {
878   - str = '' + i;
879   - };
880   -
881   - for(var j = 0; j < minutes; j++) {
882   - if(j % step == 0){
883   - var s = j < 10 ? ':' + 0 + '' + j : ':' + j;
884   - s = str + s;
885   - timeArr.push(s);
886   - };
887   - };
888   - };
889   -
890   - // console.log('timeArr', timeArr);
891   - this.setData({
892   - timeArr,
893   - });
  903 + for(var i = 8; i < hours; i++){
  904 + var str = '';
  905 + if(i < 10) {
  906 + str = 0 + '' + i;
  907 + } else {
  908 + str = '' + i;
  909 + };
  910 +
  911 + for(var j = 0; j < minutes; j++) {
  912 + if(j % step == 0){
  913 + var s = ':' + appendZero(j);
  914 + s = str + s;
  915 + //-- 不是当天 --
  916 + if(this.data.datet && this.data.datet!=md){
  917 + timeArr.push(s);
  918 + }else{
  919 + var d1=md+" "+s;
  920 + var date1=new Date(d1);
  921 + //必须是大于
  922 + if(date1.getTime()>now_date.getTime()){
  923 + timeArr.push(s);
  924 + }
  925 + }
  926 +
  927 + };
  928 + };
  929 + };
  930 +
  931 + this.setData({timeArr,});
894 932  
895 933 },
896   -
897   -
898   -
  934 +
899 935 scroll(e) {
900 936 // console.log('e', e.detail.deltaX);
901 937 let deltaX = e.detail.deltaX;
... ... @@ -904,8 +940,100 @@ Page({
904 940 // };
905 941 this.data.deltaX = -deltaX;
906 942 },
907   -
  943 +
  944 + pickerTap:function() {
  945 + var date = new Date();
  946 + var monthDay = ['今天','明天'];
  947 + // 月-日
  948 + for (var i = 2; i <= 14; i++) {
  949 + var date1 = new Date(date);
  950 + date1.setDate(date.getDate() + i);
  951 + var md = (date1.getFullYear()+"-"+date1.getMonth() + 1) + "-" + date1.getDate();
  952 + monthDay.push(md);
  953 + }
  954 + this.setData(monthDay);
  955 + },
  956 +
  957 +
  958 + //-- 选择时间的时候 --
  959 + bindDateChenge: function(e) {
  960 + var th=this;
  961 + var nd=new Date(this.data.nowDate);
  962 + var nd1=new Date(e.detail.value);
  963 + if(nd1.getTime()<nd.getTime()){
  964 + wx.showToast({
  965 + title: "选择的日期不能小于今天",
  966 + icon: 'none',
  967 + duration: 2000
  968 + })
  969 + return false;
  970 + }
  971 +
  972 + this.setData({
  973 + datet: e.detail.value
  974 + });
  975 + this.getTimeList(23, 30);
  976 + //当时间变化的时候
  977 + if(this.data.storageId){
  978 + var req={
  979 + storeId:os.stoid,
  980 + userId:getApp().globalData.userInfo.user_id,
  981 + StorageId:encodeURIComponent(this.data.storageId),
  982 + }
  983 + req.SeekTime=this.data.datet;
  984 + getApp().request.get("/api/weshop/marketing/reservation/listStaffAndTime",{
  985 + data:req,
  986 + success:function(res){
  987 + if(ut.ajax_ok2(res)){
  988 + th.setData({v:{},col_arr:[]})
  989 + //-- 有些时间是全部没有的 --
  990 + th.setTimeShow(res.data.data)
  991 + }
  992 + }
  993 + })
  994 + }
  995 + },
908 996  
909   -
910   -
  997 + onPageScroll: function(e) {
  998 + this.data.s_top=e.scrollTop;
  999 + },
  1000 +
  1001 + //-- 时间段有些不显示,出来的时间和显示的对应 --
  1002 + setTimeShow:function(data){
  1003 + // 如果数值位数为1,则补0
  1004 + function appendZero(obj) {
  1005 + if (obj < 10) {
  1006 + return "0" + "" + obj;
  1007 + } else {
  1008 + return obj;
  1009 + }
  1010 + };
  1011 +
  1012 + var now_date=new Date();
  1013 + var md = now_date.getFullYear()+"-"+appendZero(now_date.getMonth() + 1)+ "-" + appendZero(now_date.getDate());
  1014 +
  1015 + if(this.data.datet && this.data.datet!=md){
  1016 + this.setData({md:data});
  1017 + return false;
  1018 + }
  1019 +
  1020 + for(var i in data){
  1021 + var ti_time_arr=data[i].listtime;
  1022 + var arr=[];
  1023 + for(var j in ti_time_arr){
  1024 + var d1=md+" "+ti_time_arr[j].stime;
  1025 + var date1=new Date(d1);
  1026 + //必须是大于
  1027 + if(date1.getTime()>now_date.getTime()){
  1028 + arr.push(ti_time_arr[j]);
  1029 + }
  1030 + }
  1031 + data[i].listtime=arr;
  1032 + }
  1033 + this.setData({md:data});
  1034 +
  1035 + },
  1036 +
  1037 +
  1038 +
911 1039 })
912 1040 \ No newline at end of file
... ...
packageA/pages/my_service2/appment_main.js.rej deleted
1   -diff a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js (rejected hunks)
2   -@@ -647,7 +647,7 @@
3   - var project_id = th.data.project_id; //服务项目id
4   - getApp().request.promiseGet(url, {
5   - data: {
6   -- storeId: a.stoid,
7   -+ storeId: th.data.options.storeid,
8   - userId: th.data.options.userid,
9   - projectId: project_id
10   - }
packageA/pages/my_service2/appment_main.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 2 <wxs module="fil" src="g_filter.wxs"></wxs>
3 3  
4   -<!-- <view class="btn-container">
5   - <navigator class="btn" url="/pages/user/my_service/tment_order_list">
6   - <view>我的预约</view>
7   - </navigator>
8   - <form report-submit='true' bindtap="sub_success">
9   - <button form-type="submit" class="btn">
10   - <view>提交预约</view>
11   - </button>
12   - </form>
13   - </view> -->
14   -
15   -<view class="card" bindlongtap="getcopy">
16   - <view class="t-c c-c7">
17   - <text class="iconfont icon-sandian"></text>
  4 +
  5 +<!-- 项目的拖动 -->
  6 +<view wx:if="{{!store && project}}" class="card" catchtouchmove='true' style="left:{{wp[0]}}px;top:{{wp[1]}}px;">
  7 + <view class="cp_btn t-c c-c7" bindtouchend="touchend1" bindtouchmove="touchmove1" catch:touchmove1 style="padding: 15rpx 0;" >
  8 + <text class="iconfont icon-sandian" style="font-size: 40rpx;"></text>
18 9 </view>
19   - <block wx:for="{{project}}">
20   - <view class="t-c pd20" hover-class="hover" bindtouchmove="touchmove" bindtouchend="touchend" catch:touchmove data-name="{{item}}" bindlongtap="getName">
21   - <text class="iconfont icon-meirong fs40"></text>
22   - <view class="fs24">{{item}}</view>
23   - </view>
  10 + <view style="overflow-y: auto; max-height:600rpx;">
  11 + <block wx:for="{{project}}">
  12 + <view class="t-c pd20 {{prj_index==index?'hover':''}}" data-index="{{index}}" catchtap="getName">
  13 + <text class="iconfont icon-meirong fs40"></text>
  14 + <view class="fs24">{{item.ServiceName}}</view>
  15 + </view>
  16 +
24 17 </block>
  18 + </view>
25 19 </view>
26 20  
27 21 <image class="main" src="{{iurl}}/miniapp/images/yyservice/main.png"></image>
28   -
29 22 <view class="pdb100">
30   - <!-- 选择门店 -->
  23 +
  24 + <!-- 选择日期 -->
  25 + <picker class='pi' mode="date" value='{{datet}}' start="2019-1-1" bindchange='bindDateChenge'>
  26 + <view class="flex-vertical pdv20 jc-center">
  27 + <!-- 门店 -->
  28 + <view class="flex-vertical-between head fs30">
  29 + <view>日</view>
  30 + <view>期</view>
  31 + </view>
  32 +
  33 + <view class="flex-vertical-between fs26 select">
  34 + <view class="{{datet==''?'color':''}} value ellipsis-1">{{datet==""?'选择日期':datet}}</view>
  35 + <view class="angle">∟</view>
  36 + </view>
  37 +
  38 + </view>
  39 + </picker>
  40 + <!-- 选择门店 -->
31 41 <view class="flex-vertical pdv20 jc-center">
32 42 <!-- 门店 -->
33 43 <view class="flex-vertical-between head fs30">
... ... @@ -40,8 +50,11 @@
40 50 <view class="{{store_name==''?'color':''}} value ellipsis-1">{{store_name==""?'选择服务门店':store_name}}</view>
41 51 <view class="angle">∟</view>
42 52 </view>
43   - </view>
44   - <view class="table flex fs26" style="width: 100%;height: 100%;">
  53 + </view>
  54 +
  55 +
  56 + <!-- 拖入的田框,主内容 -->
  57 + <view wx:if="{{md}}" class="table flex fs26" style="width: 100%;height: auto; overflow: hidden; margin-bottom: 10rpx;">
45 58 <view class="left t-c">
46 59 <view class="td pr" style="width: 120rpx">
47 60 <view class="time-box" bindtap="pickTime"><view class="time">时间</view></view>
... ... @@ -56,89 +69,21 @@
56 69 <view class="td" wx:for="{{timeArr.length}}"></view>
57 70 </view> -->
58 71 <view wx:for="{{md}}">
59   - <view class="td bg-pink">{{item.name}}</view>
  72 + <view class="td bg-pink">{{item.StaffName}}</view>
60 73 <!-- <view class="td content_view {{v[0][0]?'121':''}}">{{v[0][0]}}</view> -->
61 74 <block wx:for="{{timeArr.length}}" wx:for-item="subitem" wx:for-index="subindex">
62   - <view class="td content_view {{v[index][subindex] && v[index][subindex]? 'active':''}} {{filters.in_arr(subindex,col_arr) || fil.is_no_time(item,subindex,timeArr) ?'notactive':''}}">
63   - {{v[index][subindex]?v[index][subindex]:''}}
64   - <text wx:if="{{v[index][subindex]}}" catchtap="close_this" data-txt="v[{{index}}][{{subindex}}]" data-sindex="{{subindex}}" class="close_this">×</text>
  75 + <view bindtap="sele_tab" data-index="{{index}}" data-subindex="{{subindex}}"
  76 + class="td content_view {{v[index][subindex] && v[index][subindex]? 'active':''}} {{fil.is_no_time(item,subindex,timeArr,sele_project) ?'notactive':''}}">
  77 + <!-- 当项目是当前选中的项目的时候 -->
  78 + <block wx:if="{{v[index][subindex] && v[index][subindex].ProjectID==sele_project.ProjectID}}">
  79 + <text>{{v[index][subindex]?v[index][subindex].ServiceName:''}}</text>
  80 + <text catchtap="close_this" data-txt="v[{{index}}][{{subindex}}]" data-sindex="{{subindex}}" class="close_this">×</text>
  81 + </block>
65 82 </view>
66 83 </block>
67 84 </view>
68 85 </view>
69   - </scroll-view>
70   -
71   -
72   -
73   -
74   -
75   - <!-- 选择美容师 -->
76   - <!-- <view class="flex-vertical mabot"> -->
77   - <!-- 门店 -->
78   - <!-- <view class="flex-vertical-between head fs30">
79   - <view>美</view>
80   - <view>容</view>
81   - <view>师</view>
82   - </view> -->
83   -
84   - <!-- 选择美容师 -->
85   - <!-- <view class="rel fs26"> -->
86   - <!-- <view class="flex-vertical-between Cosmetology" bindtap="query_beautician">
87   - <view class="{{beautician_name==''?'color':''}} value ellipsis-1">{{beautician_name==''?'选择美容师':beautician_name}}</view>
88   - <view class="angle">∟</view>
89   - </view> -->
90   - <!-- 美容师下拉列表 -->
91   - <!-- <view class="beauticians abs" wx:if="{{beautician}}"> -->
92   - <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) -->
93   - <!-- <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key">
94   - <view class="StaffName ellipsis-1">{{item.StaffName}}</view>
95   - </view>
96   - <view>
97   - </view>
98   - </view> -->
99   - <!-- </view> -->
100   - <!-- <view class="flex-center users" bindtap="nav_bea">
101   - <image class="user" src="{{iurl}}/miniapp/images/yyservice/user.png"></image>
102   - </view> -->
103   - <!-- </view> -->
104   -
105   - <!-- 选择时间 -->
106   - <!-- <view class="flex-vertical mabot"> -->
107   - <!-- 门店 -->
108   - <!-- <view class="head fs30">
109   - <view>预约时间</view>
110   - </view> -->
111   -
112   - <!-- 选择时间 -->
113   - <!-- <view class="flex-vertical-between fs26 select" data-url="/packageA/pages/my_service/beauty_deta?url={{url}}&StorageId={{StorageId}}&BeauticianID={{beauticianID}}&itemId={{itemId}}&modify=0&projectId={{project_id}}" bindtap="goto">
114   - <view class="{{time==''?'color':''}}">{{time==""?'选择时间':time}}</view>
115   - <view class="angle angler">∟</view>
116   - </view> -->
117   - <!-- </view> -->
118   -
119   - <!-- 备注 -->
120   - <!-- <view class="flex Remarks"> -->
121   - <!-- 门店 -->
122   - <!-- <view class="flex-space-between head fs30">
123   - <view>备</view>
124   - <view>注</view>
125   - </view>
126   - <view class="flex fs26">
127   - <block wx:if="{{is_textea==1}}">
128   - <textarea class="textarea" placeholder="{{remarks==''?'填写备注':remarks}}" placeholder-class="fs26 color" value="{{remarks}}" bindinput="input_remarks" maxlength="100">
129   - </textarea>
130   - </block>
131   - <block wx:else>
132   - <view class="textarea {{remarks==''?'color':''}}" bindtap="check_text">{{remarks==''?'填写备注':remarks}}
133   - </view>
134   - </block>
135   - </view> -->
136   - <!-- </view>
137   - <view wx:if="{{tment_count!=''}}" class="notes flex-level-right fs24 color">
138   - <view>注:剩余可预约人数{{tment_count}}人</view>
139   - </view> -->
140   -
141   -
  86 + </scroll-view>
142 87 </view>
143 88 </view>
144 89  
... ... @@ -146,9 +91,10 @@
146 91 <navigator class="appment flex-center" url="/pages/user/my_service/tment_order_list">
147 92 <view>我的预约</view>
148 93 </navigator>
149   - <form report-submit='true' bindtap="sub_success">
150   - <button form-type="submit" class="sub_appment flex-center">帮你预约</button>
151   - </form>
  94 + <form report-submit='true' bindtap="sub_success">
  95 + <button wx:if="{{is_sub}}" class="sub_appment flex-center">预约中..</button>
  96 + <button wx:else form-type="submit" class="sub_appment flex-center">提交预约</button>
  97 + </form>
152 98 </view>
153 99  
154 100  
... ... @@ -165,7 +111,7 @@
165 111 </view>
166 112 </view>
167 113 <!-- 选择门店 -->
168   - <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onReachBottom">
  114 + <scroll-view class="stores" scroll-y="{{isScroll}}" enable-back-to-top="true" bindscrolltolower="onGetBottom">
169 115 <view class="store flex-vertical" wx:for="{{store_list}}" bindtap="choose_for_store" data-ind="{{index}}">
170 116 <block wx:if="{{index==fir_pick_index}}">
171 117 <icon class="icon" type="success" color="red" size="20"></icon>
... ... @@ -206,8 +152,9 @@
206 152  
207 153 <!-- 制作一个圆球导航 -->
208 154 <!-- <nav_b id="nav_b"></nav_b> -->
209   -
  155 +<!--
210 156 <view class="copy" wx:if="{{copy_btn}}" style="position:absolute;left:{{write[0]}}px;top:{{write[1]}}px;">
211 157 <text class="iconfont icon-meirong fs40"></text>
212   - <view class="fs24">{{projectName}}</view>
213   -</view>
214 158 \ No newline at end of file
  159 + <view class="fs24">{{sele_project.ServiceName}}</view>
  160 +</view>-->
  161 +
... ...
packageA/pages/my_service2/appment_main.wxml.rej deleted
1   -diff a/packageA/pages/my_service/appment_main.wxml b/packageA/pages/my_service/appment_main.wxml (rejected hunks)
2   -@@ -17,54 +17,120 @@
3   - <view class="angle">∟</view>
4   - </view>
5   - </view>
6   -+
7   -+
8   -+ <view class="table flex">
9   -+ <view class="left t-c">
10   -+ <view class="td">时间</view>
11   -+ <view class="td">8:00</view>
12   -+ <view class="td">9:00</view>
13   -+ </view>
14   -+ <scroll-view scroll-x class="right" bindscroll="scroll">
15   -+ <view class="flex t-c" bindtap="rect">
16   -+ <view bindtap="rect">
17   -+ <view class="td blue">张三</view>
18   -+ <view class="td" bindtap="print">100</view>
19   -+ <view class="td">200</view>
20   -+ </view>
21   -+ <view>
22   -+ <view class="td blue">张三</view>
23   -+ <view class="td">100</view>
24   -+ <view class="td">200</view>
25   -+ </view>
26   -+ <view>
27   -+ <view class="td blue">张三</view>
28   -+ <view class="td" bindtap="print">100</view>
29   -+ <view class="td">200</view>
30   -+ </view>
31   -+ <view>
32   -+ <view class="td blue">张三</view>
33   -+ <view class="td">100</view>
34   -+ <view class="td">200</view>
35   -+ </view>
36   -+ <view>
37   -+ <view class="td blue">张三</view>
38   -+ <view class="td">100</view>
39   -+ <view class="td">200</view>
40   -+ </view>
41   -+ <view>
42   -+ <view class="td blue">张三</view>
43   -+ <view class="td">100</view>
44   -+ <view class="td">200</view>
45   -+ </view>
46   -+ <view>
47   -+ <view class="td blue">张三</view>
48   -+ <view class="td">100</view>
49   -+ <view class="td">200</view>
50   -+ </view>
51   -+ <view>
52   -+ <view class="td blue">1张三</view>
53   -+ <view class="td">300</view>
54   -+ <view class="td">300</view>
55   -+ </view>
56   -+ </view>
57   -+ </scroll-view>
58   -+ <view class="card">
59   -+ <view class="t-c pd20">
60   -+ <text class="iconfont icon-meirong fs40"></text>
61   -+ <view class="fs24">项目1</view>
62   -+ </view>
63   -+ <view class="t-c pd20">
64   -+ <text class="iconfont icon-meirong fs40"></text>
65   -+ <view class="fs24">项目1</view>
66   -+ </view>
67   -+ </view>
68   -+ </view>
69   -+
70   -+
71   -+
72   - <!-- 选择美容师 -->
73   -- <view class="flex-vertical mabot">
74   -+ <!-- <view class="flex-vertical mabot"> -->
75   - <!-- 门店 -->
76   -- <view class="flex-vertical-between head fs30">
77   -+ <!-- <view class="flex-vertical-between head fs30">
78   - <view>美</view>
79   - <view>容</view>
80   - <view>师</view>
81   -- </view>
82   -+ </view> -->
83   -
84   - <!-- 选择美容师 -->
85   -- <view class="rel fs26">
86   -- <view class="flex-vertical-between Cosmetology" bindtap="query_beautician">
87   -+ <!-- <view class="rel fs26"> -->
88   -+ <!-- <view class="flex-vertical-between Cosmetology" bindtap="query_beautician">
89   - <view class="{{beautician_name==''?'color':''}} value ellipsis-1">{{beautician_name==''?'选择美容师':beautician_name}}</view>
90   - <view class="angle">∟</view>
91   -- </view>
92   -+ </view> -->
93   - <!-- 美容师下拉列表 -->
94   -- <view class="beauticians abs" wx:if="{{beautician}}">
95   -+ <!-- <view class="beauticians abs" wx:if="{{beautician}}"> -->
96   - <!-- 到时候要做判断如果是index==循环的最后一个则把下边线去掉:(beaclone去掉的css) -->
97   -- <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key">
98   -+ <!-- <view class="beautician flex-vertical fs26" wx:for="{{beautician_list}}" bindtap="choice_beautician" data-baaindex="{{key}}" wx:for-index="key">
99   - <view class="StaffName ellipsis-1">{{item.StaffName}}</view>
100   - </view>
101   - <view>
102   - </view>
103   -- </view>
104   -- </view>
105   -- <view class="flex-center users" bindtap="nav_bea">
106   -+ </view> -->
107   -+ <!-- </view> -->
108   -+ <!-- <view class="flex-center users" bindtap="nav_bea">
109   - <image class="user" src="{{iurl}}/miniapp/images/yyservice/user.png"></image>
110   -- </view>
111   -- </view>
112   -+ </view> -->
113   -+ <!-- </view> -->
114   -
115   - <!-- 选择时间 -->
116   -- <view class="flex-vertical mabot">
117   -+ <!-- <view class="flex-vertical mabot"> -->
118   - <!-- 门店 -->
119   -- <view class="head fs30">
120   -+ <!-- <view class="head fs30">
121   - <view>预约时间</view>
122   -- </view>
123   -+ </view> -->
124   -
125   - <!-- 选择时间 -->
126   -- <view class="flex-vertical-between fs26 select" data-url="/packageA/pages/my_service/beauty_deta?url={{url}}&StorageId={{StorageId}}&BeauticianID={{beauticianID}}&itemId={{itemId}}&modify=0&projectId={{project_id}}" bindtap="goto">
127   -+ <!-- <view class="flex-vertical-between fs26 select" data-url="/packageA/pages/my_service/beauty_deta?url={{url}}&StorageId={{StorageId}}&BeauticianID={{beauticianID}}&itemId={{itemId}}&modify=0&projectId={{project_id}}" bindtap="goto">
128   - <view class="{{time==''?'color':''}}">{{time==""?'选择时间':time}}</view>
129   - <view class="angle angler">∟</view>
130   -- </view>
131   -- </view>
132   -+ </view> -->
133   -+ <!-- </view> -->
134   -
135   - <!-- 备注 -->
136   -- <view class="flex Remarks">
137   -+ <!-- <view class="flex Remarks"> -->
138   - <!-- 门店 -->
139   -- <view class="flex-space-between head fs30">
140   -+ <!-- <view class="flex-space-between head fs30">
141   - <view>备</view>
142   - <view>注</view>
143   - </view>
packageA/pages/my_service2/appment_main.wxss
1 1 page,
2 2 .area {
3 3 width: 100%;
4   - height: 100%;
  4 + height: 100%;
  5 + position: relative;
5 6 }
6 7  
7   -
8   -
9   -
10 8 /* .container {
11 9 border-top: 7rpx solid rgb(245, 245, 245);
12 10 justify-content: baseline;
... ... @@ -188,7 +186,7 @@ button {
188 186 }
189 187  
190 188 .storeList {
191   - z-index: 5;
  189 + z-index: 1500;
192 190 left: 0rpx;
193 191 border-top-left-radius: 25rpx;
194 192 border-top-right-radius: 25rpx;
... ... @@ -301,7 +299,8 @@ button {
301 299 .table {
302 300 background-color: white;
303 301 /* border-top: 2rpx solid rgba(218, 217, 217, 1);
304   - border-left: 2rpx solid rgba(218, 217, 217, 1); */
  302 + border-left: 2rpx solid rgba(218, 217, 217, 1); */
  303 + width: 100%;height: auto; overflow: hidden; margin-bottom: 20rpx;
305 304 }
306 305 .blue {
307 306 background: rgba(241, 252, 255, 1);
... ... @@ -339,17 +338,17 @@ button {
339 338  
340 339 .card {
341 340 position: fixed;
342   - width: 110rpx;
343   - top: 50%;
  341 + width: 130rpx;
  342 + /* top: 50%; */
344 343 right: 0;
345 344 /* min-height: 400rpx; */
346   - max-height: 700rpx;
347   - overflow-y: auto;
348   - transform: translateY(-50%);
  345 + /* max-height: 700rpx; */
  346 + /* transform: translateY(-50%); */
349 347 background-color: white;
350 348 border-radius: 10rpx;
351 349 box-shadow: -2px 0px 6px #aaa;
352   - z-index: 1000;
  350 + z-index: 1000;
  351 + top:160rpx
353 352 }
354 353  
355 354 .icon-meirong {
... ... @@ -443,3 +442,6 @@ button {
443 442 }
444 443  
445 444  
  445 +
  446 +
  447 +
... ...
packageA/pages/my_service2/g_filter.wxs
1 1 var g_filters = {
2   - is_no_time:function(item,subindex,timeArr){
  2 + is_no_time:function(item,subindex,timeArr,sele_project){
  3 + if(!sele_project || !sele_project.ServiceID) return false;
3 4 var t_time=timeArr[subindex];
4   - var time_arr=item.time.split("-");
5   -
6   - var t_date=getDate();
7   - var t_date_str=t_date.getFullYear()+"-"+(t_date.getMonth() + 1)+"-"+t_date.getDate()+" "
8   -
9   - var this_time =t_date_str+t_time.substring(0, 19);
10   - var reg = getRegExp("-", "g");
11   - this_time = this_time.replace(reg, '/');
12   - var t1 = getDate(this_time);
13   -
14   - var fmt1 =t_date_str+time_arr[0].substring(0, 19);
15   - var reg = getRegExp("-", "g");
16   - var fmt2 = fmt1.replace(reg, '/');
17   - var t2 = getDate(fmt2);
18   -
19   - if(t1<t2) return true;
20   - if(time_arr.length>1){
21   - var ft1 =t_date_str+time_arr[1].substring(0, 19);
22   - var reg = getRegExp("-", "g");
23   - var ft2 = ft1.replace(reg, '/');
24   - var t3 = getDate(ft2);
25   - if(t1>t3) return true;
26   - }
27   - return false;
  5 + var time_arr=item.listtime;
  6 +
  7 + for(var i=0;i<time_arr.length;i++){
  8 + if(t_time==time_arr[i].stime && time_arr[i].iskyy==true){
  9 + //如果没有项目的话
  10 + if(time_arr[i].itemids){
  11 + var project_arr=time_arr[i].itemids.split(',');
  12 + //如果没有相应的项目的话
  13 + if(project_arr && project_arr.indexOf(sele_project.ServiceID)!=-1) return false;
  14 +
  15 + }
  16 + }
  17 + }
  18 +
  19 + return true;
28 20 },
29 21  
30 22 }
... ...
packageA/pages/prom_list/prom_list.wxml
... ... @@ -137,7 +137,7 @@
137 137 <view class="b_num">
138 138 <view>购买数量</view>
139 139 <view class="count">
140   - <view bindtap="subCartNum" class="sub">-</view>
  140 + <view bindtap="subCartNum" class="sub {{goodsInputNum<=1?'gray':''}}">-</view>
141 141 <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
142 142 <view bindtap="addCartNum" class="add">+</view>
143 143 </view>
... ...
packageA/pages/prom_list/prom_list.wxss
... ... @@ -30,7 +30,6 @@
30 30 font-size: 32rpx;
31 31 box-sizing: border-box;
32 32 border-radius: 20rpx;
33   - height: 72%;
34 33 }
35 34  
36 35 .spec-model .pding{padding: 0 30rpx;}
... ... @@ -138,12 +137,10 @@
138 137 .spec-cart-btns {
139 138 width: 92%;
140 139 line-height: 70rpx;
141   - margin: 0rpx auto;
142   - margin-top: 160rpx;
  140 + margin-top: 40rpx;
  141 + margin-bottom: 20rpx;
143 142 border-radius: 20rpx;
144   - position: fixed;
145   - bottom: 50rpx;
146   - left: 4%;
  143 + margin-left: 4%;
147 144 }
148 145  
149 146 .spec-cart-btn {
... ... @@ -362,4 +359,5 @@
362 359 .join-cart>view.no_store {
363 360 width: 58%; background-color: #adadad;
364 361 }
365   -.no_store{color:#d60021; font-size: 26rpx;}
366 362 \ No newline at end of file
  363 +.no_store{color:#d60021; font-size: 26rpx;}
  364 +.gray{color: #ccc;}
367 365 \ No newline at end of file
... ...
pages/cart/cart2/cart2.js
... ... @@ -226,8 +226,10 @@ Page({
226 226 getApp().getConfig2(function (ee) {
227 227 var json_d = JSON.parse(ee.switch_list);
228 228 th.data.json_d=json_d;
229   - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
230   - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  229 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  230 + var is_default_logistics=json_d.is_default_logistics;
  231 +
  232 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics});
231 233  
232 234 var rank_switch=json_d.rank_switch;
233 235 var max_price=-1;
... ... @@ -279,8 +281,15 @@ Page({
279 281 //-------------------获取物流---------------
280 282 get_wuliu(func) {
281 283 var th = this;
282   - to.getwuliu(function (e) {
283   - th.setData({ wu_arr: e })
  284 + to.getwuliu(function (e) {
  285 + //系统是是否开启了默认的物流
  286 + if(th.data.is_default_logistics){
  287 + //如果第一个不是开启默认,说明要让用户自己选
  288 + if(!e[0].is_default){
  289 + th.setData({is_default_logistics:0});
  290 + }
  291 + }
  292 + th.setData({ wu_arr: e })
284 293 typeof func == "function" && func();
285 294 })
286 295 },
... ... @@ -737,7 +746,13 @@ Page({
737 746 distr_t=dis_t;
738 747 }
739 748 }
740   -
  749 +
  750 + //自选的时候,系统配置了默认的配送方式是物流的时候
  751 + if(distr_t==0 && th.data.json_d.pickupway && th.data.json_d.pickupway==1 ){
  752 + et=0;
  753 + }
  754 +
  755 +
741 756 var ie = {
742 757 pickup_id: gg.pick_id, pname: gg.pick_name, goods: narr, exp_type: et, wind: m_wind, distr_t: distr_t,bn_t_exp_t: distr_t,
743 758 goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0};
... ... @@ -1627,6 +1642,10 @@ Page({
1627 1642  
1628 1643 total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
1629 1644 order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
  1645 +
  1646 + total_m=total_m.toFixed(2);
  1647 + order_m=order_m.toFixed(2);
  1648 +
1630 1649 var atxt= "formData.total_amount";
1631 1650 th.setData({ [atxt]: total_m, })
1632 1651  
... ... @@ -1675,6 +1694,10 @@ Page({
1675 1694 total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
1676 1695 order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
1677 1696 var atxt= "formData.total_amount";
  1697 +
  1698 + total_m=total_m.toFixed(2);
  1699 + order_m=order_m.toFixed(2);
  1700 +
1678 1701 th.setData({ [atxt]: total_m, })
1679 1702  
1680 1703 var txt = "formData.user_money";
... ... @@ -1871,7 +1894,10 @@ Page({
1871 1894  
1872 1895 //积分购,先要带is_integral_normal=1
1873 1896 if(gg.is_integral_normal) goods.is_integral_normal=1;
1874   -
  1897 +
  1898 + //先要带is_pd_normal=1
  1899 + if(gg.is_pd_normal) goods.is_pd_normal=1;
  1900 +
1875 1901 //如果不立即购买或者秒杀,如果是线下库存购买的时候
1876 1902 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){
1877 1903 var isok=1;
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -4,13 +4,35 @@
4 4  
5 5 <form bindsubmit="submitForm">
6 6 <view class="container">
7   - <view class="tab-container">
8   - <view class="tab-wrapper">
9   - <block wx:for="{{tabs}}">
10   - <view class="tab {{currentTabIndex == index ? 'active':''}}" data-t='{{!index ? 1:0}}' data-ind="0" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" bindtap="clickTab" style="display:{{item.distr_t==1 ? 'none':(item.distr_t==2 ? 'none':'')}};">{{item}}</view>
11   - </block>
  7 +
  8 + <!-- 立即购买的时候 -->
  9 + <block wx:if="{{is_b_now==1}}">
  10 + <view class="tab-container">
  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':''}}"
  13 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  14 +
  15 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  16 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  17 +
  18 + </view>
12 19 </view>
13   - </view>
  20 + </block>
  21 + <!-- 购物购买只有一单的时候 -->
  22 + <block wx:if="{{is_b_now==0 && cartlist.length==1}}">
  23 + <view class="tab-container">
  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':''}}"
  26 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  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':''}}"
  29 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  30 +
  31 + </view>
  32 + </view>
  33 + </block>
  34 +
  35 +
14 36 <!--要进行判断地址是否显示---->
15 37 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
16 38 <!---默认地址显示------>
... ... @@ -45,7 +67,7 @@
45 67 </view> -->
46 68 </view>
47 69  
48   - <!---------------------购物车进来,有可能多单---------------------->
  70 + <!-- -------------------购物车进来,有可能多单-------------------- -->
49 71 <block wx:if="{{is_b_now==0}}">
50 72 <!-- <view class="xc-border main-top"></view> -->
51 73 <view wx:for="{{cartlist}}" wx:for-index="pidx">
... ... @@ -124,63 +146,61 @@
124 146 <icon color="#f23030" size="16" type="info"></icon>
125 147 {{order.store_prom}}
126 148 </view>
127   -
128   - <view class="use-item flex-space-between" wx:if="{{item.exp_type==0}}">
129   - <!-- <view class="flex-vertical"> -->
130   - <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:none"> -->
131   - <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> -->
  149 +
  150 + <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}">
  151 + <view class="flex-vertical" >
  152 + <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
  153 + style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
132 154 <!-- <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> -->
133   -
134   -
135   -
136   - <!-- <block wx:if="{{item.exp_type==1}}">
  155 +
  156 + <block wx:if="{{item.exp_type==1}}">
137 157 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
138   - <!-- <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> -->
139   - <!-- </block> -->
140   - <!-- <block wx:else>
  158 + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
  159 + </block>
  160 + <block wx:else>
141 161 <view class="circle xc-hookts on"></view>
142   - </block> -->
143   - <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> -->
144   - <!-- </view> -->
145   -
146   - <!-- <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:none;"> -->
147   - <!-- <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 + </block>
  163 + <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>
  164 + </view>
  165 +
  166 + <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'}};">
148 167 <!-- <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> -->
149   - <!-- <block wx:if="{{item.exp_type==0}}">
  168 + <block wx:if="{{item.exp_type==0}}">
150 169 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
151   - <!-- <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
  170 + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
152 171 </block>
153 172 <block wx:else>
154 173 <view class="circle xc-hookts on"></view>
155 174 </block>
156   -
  175 +
157 176 <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
158 177 class="yu_er">快递邮寄</view>
159   - </view> -->
160   - <view>配送方式</view>
161   - <block wx:if="{{item.exp_type==0}}">
162   - <!-- 点击显示物流选择 -->
163   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
164   - <view>{{wu_arr[item.wind].name}}</view>
165   - <view class="xc-right"></view>
166   - </view>
167   - </block>
  178 + </view>
168 179 </view>
169   - <!-- <block wx:if="{{item.exp_type==0}}"> -->
170   - <!-- 点击显示物流选择 -->
171   - <!-- <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  180 + <!-- 当是物流很多单的时候 -->
  181 +
  182 + <!-- 点击显示物流选择,如果是默认使用的情况不成立 -->
  183 + <view wx:if="{{!is_default_logistics}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  184 + <view>{{wu_arr[item.wind].name}}</view>
  185 + <view class="xc-right"></view>
  186 + </view>
  187 +
  188 + </view>
  189 +
  190 + <!-- 当是物流,只有一单的时候 -->
  191 + <block wx:else >
  192 + <view class="use-item flex-space-between" wx:if="{{item.exp_type==0 && !is_default_logistics}}">
  193 + <view class="flex jc_sb" style="width: 100%; padding: 0 13rpx;">
  194 + <view>选择物流</view>
  195 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
172 196 <view>{{wu_arr[item.wind].name}}</view>
173 197 <view class="xc-right"></view>
174 198 </view>
175   - </block> -->
176   - <!-- </view> -->
177   -
178   - <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'>
179   - <view>选择物流:</view> -->
180   - <!-- <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name">
181   - <view >{{wu_arr[item.wind].name}}</view>
182   - </picker> -->
183   - <!-- </view> -->
  199 + </view>
  200 + </view>
  201 + </block>
  202 +
  203 +
184 204 </view>
185 205  
186 206 <!-- 留言 -->
... ... @@ -211,7 +231,7 @@
211 231  
212 232 </view>
213 233  
214   - <!-----使用余额------>
  234 + <!-- ---使用余额---- -->
215 235 <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}">
216 236 <view class="use-item" bindtap='set_js_useyuer'>
217 237 <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon>
... ... @@ -221,7 +241,7 @@
221 241  
222 242 </block>
223 243  
224   - <!------立即购买-------->
  244 + <!-- ----立即购买------ -->
225 245 <!-- <view class="xc-border xc-border"></view> -->
226 246 <block wx:if="{{is_b_now==1}}">
227 247 <view class="use-item bfff bdr_t-14 mgt20">
... ... @@ -247,7 +267,7 @@
247 267 </view>
248 268 </view>
249 269  
250   - <!-----商品名称规格------>
  270 + <!-- ---商品名称规格---- -->
251 271 <view class="order-num flex-space-between">
252 272 <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view>
253 273 <view class="goods-num">x{{bn_goods.buynum}}</view>
... ... @@ -270,7 +290,7 @@
270 290 <block><text>{{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}}</text></block>
271 291 </view>
272 292 </view>
273   - <!-----商品名称规格------>
  293 + <!-- ---商品名称规格---- -->
274 294 <view class="order-num flex-space-between">
275 295 <view class="co-red">¥<text class="fs36">0</text></view>
276 296 <view class="goods-num">x{{buy_now_gift_goods.buynum}}</view>
... ... @@ -293,7 +313,7 @@
293 313 <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block>
294 314 </view>
295 315 </view>
296   - <!-----商品名称规格------>
  316 + <!-- ---商品名称规格---- -->
297 317 <view class="order-num flex-space-between">
298 318 <view class="co-red">¥<text class="fs36">{{item.price}}</text></view>
299 319 <view class="goods-num">x{{item.goods_num}}</view>
... ... @@ -342,24 +362,14 @@
342 362 </view>
343 363 </view>
344 364  
345   - <view class="use-item flex-space-between">
346   - <view class="flex">
347   - <!-- <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
348   - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
349   - <view class="yu_er">门店自提</view>
350   - </view> -->
351   - <!-- <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
352   - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
353   - <view class="yu_er">快递邮寄</view>
354   - </view> -->
355   - <view>配送方式</view>
356   - </view>
357   - <block wx:if="{{bn_exp_type==0}}">
358   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
359   - <view class="logistics-name">{{wu_arr[index].name}}</view>
360   - <view class="xc-right"></view>
  365 + <view class="xc-coupon-frame" wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  366 + <view class="flex-space-between" style="padding: 20rpx 25rpx; font-size: 30rpx;">
  367 + <view>选择物流</view>
  368 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 12rpx;">
  369 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  370 + <view class="xc-right"></view>
361 371 </view>
362   - </block>
  372 + </view>
363 373 </view>
364 374 </view>
365 375 <!-- 留言 -->
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -93,8 +93,9 @@ Page({
93 93 getApp().getConfig2(function (ee) {
94 94 var json_d = JSON.parse(ee.switch_list);
95 95 th.data.json_d=json_d;
96   - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
97   - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  96 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  97 + var is_default_logistics=json_d.is_default_logistics;
  98 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch,is_default_logistics:is_default_logistics});
98 99  
99 100 var rank_switch=json_d.rank_switch;
100 101 var max_price=-1;
... ... @@ -204,8 +205,14 @@ Page({
204 205 get_wuliu(func) {
205 206 var th = this;
206 207 to.getwuliu(function (e) {
207   - th.setData({ wu_arr: e })
208   - typeof func == "function" && func();
  208 + if(th.data.is_default_logistics){
  209 + //如果第一个不是开启默认,说明要让用户自己选
  210 + if(!e[0].is_default){
  211 + th.setData({is_default_logistics:0});
  212 + }
  213 + }
  214 + th.setData({ wu_arr: e })
  215 + typeof func == "function" && func();
209 216 })
210 217 },
211 218 //------获取会员信息-----先获取用户信息,在进行下一步---
... ...
pages/cart/cart2_inte/cart2_inte.wxml
... ... @@ -4,6 +4,19 @@
4 4  
5 5 <form bindsubmit="submitForm">
6 6 <view class="container">
  7 +
  8 + <view class="tab-container">
  9 + <view class="tab-wrapper">
  10 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  11 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  12 +
  13 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  14 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  15 +
  16 + </view>
  17 + </view>
  18 +
  19 +
7 20 <!--要进行判断地址是否显示---->
8 21 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
9 22 <!---默认地址显示------>
... ... @@ -90,24 +103,18 @@
90 103 </view>
91 104 </view>
92 105  
93   - <view class="use-item flex-space-between">
94   - <view class="flex">
95   - <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
96   - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
97   - <view class="yu_er">门店自提</view>
98   - </view>
99   - <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
100   - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
101   - <view class="yu_er">快递邮寄</view>
102   - </view>
103   - </view>
104   - <block wx:if="{{bn_exp_type==0}}">
105   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
106   - <view class="logistics-name">{{wu_arr[index].name}}</view>
107   - <view class="xc-right"></view>
  106 +
  107 +
  108 + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  109 + <view class="use-item flex-space-between">
  110 + <view>选择物流</view>
  111 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">
  112 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  113 + <view class="xc-right"></view>
  114 + </view>
108 115 </view>
109 116 </block>
110   - </view>
  117 +
111 118 </view>
112 119  
113 120 <view class="coupon-mes flex-vertical">
... ...
pages/cart/cart2_inte/cart2_inte.wxss
... ... @@ -252,7 +252,7 @@ margin:auto; */
252 252 }
253 253  
254 254 .btn-wrap {
255   - height: 94rpx;
  255 + height: 100rpx;
256 256 box-sizing: border-box;
257 257 display: flex;
258 258 justify-content: space-between;
... ... @@ -262,7 +262,8 @@ margin:auto; */
262 262 bottom: 0;
263 263 left: 0;
264 264 width: 100%;
265   - padding: 0 30rpx;
  265 + padding: 0 30rpx;
  266 + font-size: 30rpx;
266 267 }
267 268  
268 269 .tips-btn {
... ... @@ -958,3 +959,28 @@ margin-left: 20rpx;
958 959 top:36rpx
959 960 }
960 961  
  962 +
  963 +.tab-container {
  964 + font-size: 28rpx;
  965 + margin-top: 20rpx;
  966 + display: flex;
  967 +}
  968 +
  969 +.tab-wrapper {
  970 + background-color: #ccc;
  971 + display: flex;
  972 + border-radius: 40rpx;
  973 + overflow: hidden;
  974 +}
  975 +
  976 +.tab {
  977 + padding: 20rpx 30rpx;
  978 +
  979 +}
  980 +
  981 +
  982 +.tab.active {
  983 + background-color: white;
  984 + border-radius: 40rpx;
  985 +}
  986 +
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -95,8 +95,12 @@ Page({
95 95 var th = this;
96 96 console.log("getwuliu4545");
97 97 to.getwuliu(function (e) {
98   - console.log("ws");
99   - console.log(e);
  98 + if (th.data.is_default_logistics) {
  99 + //如果第一个不是开启默认,说明要让用户自己选
  100 + if (!e[0].is_default) {
  101 + th.setData({ is_default_logistics: 0 });
  102 + }
  103 + }
100 104 th.setData({ wu_arr: e })
101 105 typeof func == "function" && func();
102 106 })
... ... @@ -277,80 +281,81 @@ Page({
277 281 },
278 282  
279 283 //----------子页返回父页触发----------
280   - onShow: function() {
281   - var th=this;
282   - if (th.data.isclose==0){
283   - wx.navigateTo({
284   - url: "/pages/index/index/index"
285   - })
286   - }else{
287   - this.getuser_addr(function(ie){
288   - //更换地址回来要重新调用计算价钱的接口
289   - th.setData({user_addr: ie });
290   - if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
291   - th.setData({add_back:1});
292   - if(this.data.bn_goods) th.calculatePrice2();
293   - }
294   - })
295   - //--更新默认地址--,看一下是不是跳到地址页面
296   - if(!getApp().globalData.is_cart_old){
297   - this.update_code();
298   - }else{
299   - getApp().globalData.is_cart_old=0;
300   - }
301   - }
302   -
303   -
304   - //先获取是否有关闭使用优惠券
305   - getApp().getConfig2(function (ee) {
306   - var json_d = JSON.parse(ee.switch_list);
307   - th.data.json_d=json_d;
308   - th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
309   - th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
310   -
311   - var rank_switch=json_d.rank_switch;
312   - var max_price=-1;
313   - var show_card=null;
314   - var name="";
315   - //如果有开等级卡的时候,
316   - //因为都是调接口,要返回在计算
317   - if(rank_switch==2){
318   - //-- 获取所有的等级卡, --
319   - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
320   - {}).then(res => {
321   - if(res.data.code==0){
322   - var plusCard = res.data.data;
323   - //-- 循环判断,拿到最贵的那张卡 --
324   - for(var ih in plusCard){
325   - if(plusCard[ih].IsStopBuy == true){ continue; }
326   - if(max_price<0){
327   - max_price=plusCard[ih].CardFee;
328   - name='card'+plusCard[ih]['CorrPrice'];
329   - show_card=plusCard[ih];
330   - }else{
331   - if(max_price<plusCard[ih].CardFee){
332   - max_price=plusCard[ih].CardFee;
333   - name='card'+plusCard[ih]['CorrPrice'];
334   - show_card=plusCard[ih];
335   - }
336   - }
337   - }
338   -
339   - if(show_card){
340   - name=name.toLowerCase();
341   - th.setData({card_name:name,show_card:show_card})
342   - }
343   - }
344   - //-----先获取物流,再获取用户信息,再展示页面-----
345   - th.get_wuliu(th.get_info(th.show_page));
346   - })
347   - }else{
348   - //-----先获取物流,再获取用户信息,再展示页面-----
349   - th.get_wuliu(th.get_info(th.show_page));
350   - }
351   - },1)
352   -
353   -
  284 + onShow: function () {
  285 + var th = this;
  286 + if (th.data.isclose == 0) {
  287 + wx.navigateTo({
  288 + url: "/pages/index/index/index"
  289 + })
  290 + } else {
  291 + this.getuser_addr(function (ie) {
  292 + //更换地址回来要重新调用计算价钱的接口
  293 + th.setData({ user_addr: ie });
  294 + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
  295 + th.setData({ add_back: 1 });
  296 + if (this.data.bn_goods) th.calculatePrice2();
  297 + }
  298 + })
  299 + //--更新默认地址--,看一下是不是跳到地址页面
  300 + if (!getApp().globalData.is_cart_old) {
  301 + this.update_code();
  302 + } else {
  303 + getApp().globalData.is_cart_old = 0;
  304 + }
  305 + }
  306 +
  307 +
  308 + //先获取是否有关闭使用优惠券
  309 + getApp().getConfig2(function (ee) {
  310 + var json_d = JSON.parse(ee.switch_list);
  311 + th.data.json_d = json_d;
  312 + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  313 + var is_default_logistics = json_d.is_default_logistics;
  314 +
  315 + th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules, rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics });
  316 +
  317 + var rank_switch = json_d.rank_switch;
  318 + var max_price = -1;
  319 + var show_card = null;
  320 + var name = "";
  321 + //如果有开等级卡的时候,
  322 + //因为都是调接口,要返回在计算
  323 + if (rank_switch == 2) {
  324 + //-- 获取所有的等级卡, --
  325 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
  326 + {}).then(res => {
  327 + if (res.data.code == 0) {
  328 + var plusCard = res.data.data;
  329 + //-- 循环判断,拿到最贵的那张卡 --
  330 + for (var ih in plusCard) {
  331 + if (plusCard[ih].IsStopBuy == true) { continue; }
  332 + if (max_price < 0) {
  333 + max_price = plusCard[ih].CardFee;
  334 + name = 'card' + plusCard[ih]['CorrPrice'];
  335 + show_card = plusCard[ih];
  336 + } else {
  337 + if (max_price < plusCard[ih].CardFee) {
  338 + max_price = plusCard[ih].CardFee;
  339 + name = 'card' + plusCard[ih]['CorrPrice'];
  340 + show_card = plusCard[ih];
  341 + }
  342 + }
  343 + }
  344 +
  345 + if (show_card) {
  346 + name = name.toLowerCase();
  347 + th.setData({ card_name: name, show_card: show_card })
  348 + }
  349 + }
  350 + //-----先获取物流,再获取用户信息,再展示页面-----
  351 + th.get_wuliu(th.get_info(th.show_page));
  352 + })
  353 + } else {
  354 + //-----先获取物流,再获取用户信息,再展示页面-----
  355 + th.get_wuliu(th.get_info(th.show_page));
  356 + }
  357 + }, 1)
  358 +
354 359 },
355 360 //---------------检查是否有收货地址-------------------
356 361 checkAddressList: function() {
... ... @@ -783,6 +788,7 @@ Page({
783 788 if (item == null) return o_shipping_price;
784 789 var fw_price = 0, fp_price=0;
785 790 item=item.config;
  791 + if (item == null) return o_shipping_price;
786 792 //------按重量----------
787 793 if (goods_weight>0) {
788 794 fw_price =parseFloat(item['money']);
... ...
pages/cart/cart2_pt/cart2_pt.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 2 <form bindsubmit="submitForm">
3 3 <view class="container">
  4 +
  5 + <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}">
  6 + <view class="tab-wrapper">
  7 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
  8 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  9 +
  10 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
  11 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  12 +
  13 + </view>
  14 + </view>
  15 +
  16 +
4 17 <!--要进行判断地址是否显示---->
5 18 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==1 || kt_type==3}}'>
6 19 <!---默认地址显示------>
... ... @@ -79,35 +92,14 @@
79 92 </view>
80 93  
81 94 <!--阶梯团是不显示的-->
82   - <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}">
83   - <view class="flex-vertical">
84   - <view bindtap='setexptype' data-t='1' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}}">
85   - <!-- <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> -->
86   - <block wx:if="{{bn_exp_type==1}}">
87   -
88   - <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
89   - </block>
90   - <block wx:else>
91   - <view class="circle xc-hookts on"></view>
92   - </block>
93   - <view class="yu_er">门店自提</view>
94   - </view>
95   - <view class="{{bn_t_exp_t==2?'':'xc-left'}}" bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}}">
96   - <!-- <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> -->
97   - <block wx:if="{{bn_exp_type==0}}">
98   -
99   - <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
100   - </block>
101   - <block wx:else>
102   - <view class="circle xc-hookts on"></view>
103   - </block>
104   - <view class="yu_er">快递邮寄</view>
105   - </view>
106   - </view>
107   - <block wx:if="{{bn_exp_type==0}}">
108   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view>
109   - </block>
110   - </view>
  95 + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}">
  96 + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}">
  97 + <view>选择物流</view>
  98 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">
  99 + <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view>
  100 + </view>
  101 + </view>
  102 + </block>
111 103  
112 104 <!--阶梯团是不显示的
113 105 <block wx:if="{{kt_type!=3 || is_normal==1 }}">
... ...
pages/cart/cart2_pt/cart2_pt.wxss
... ... @@ -957,3 +957,27 @@ margin-left: 20rpx;
957 957 top:36rpx
958 958 }
959 959  
  960 +
  961 +.tab-container {
  962 + font-size: 28rpx;
  963 + margin-top: 20rpx;
  964 + display: flex;
  965 +}
  966 +
  967 +.tab-wrapper {
  968 + background-color: #ccc;
  969 + display: flex;
  970 + border-radius: 40rpx;
  971 + overflow: hidden;
  972 +}
  973 +
  974 +.tab {
  975 + padding: 20rpx 30rpx;
  976 +
  977 +}
  978 +
  979 +
  980 +.tab.active {
  981 + background-color: white;
  982 + border-radius: 40rpx;
  983 +}
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -13,12 +13,13 @@ Page({
13 13 order: null, //订单所有字段
14 14 user_addr: null, //会员地址
15 15 pickup: null, //门店
16   - goods:null, //商品
  16 + goods: null, //商品
17 17 /*------------------------*/
18 18 userinfo: null, //获取会员
19 19 /*----------物流选择--------*/
20 20 wu_arr: null,
21 21 index: 0,
  22 + is_express:0,
22 23 //申请提现的金额
23 24 txmon: 0,
24 25 yuer: 0,
... ... @@ -33,8 +34,8 @@ Page({
33 34 exp_price: 0,
34 35 enterAddressPage: 0, //进入地址页面
35 36  
36   - allpice:0,
37   - show_pay_type:0,
  37 + allpice: 0,
  38 + show_pay_type: 0,
38 39  
39 40 teamgroup: null,
40 41 },
... ... @@ -42,11 +43,11 @@ Page({
42 43 /**
43 44 * 生命周期函数--监听页面加载
44 45 */
45   - onLoad: function(options) {
  46 + onLoad: function (options) {
46 47  
47 48 //清空is_pick_up
48 49 getApp().request.put("/api/weshop/useraddress/updatePickUp", {
49   - data: {user_id: getApp().globalData.user_id, is_pickup: 0},
  50 + data: { user_id: getApp().globalData.user_id, is_pickup: 0 },
50 51 success: function (s) {
51 52 }
52 53 });
... ... @@ -54,105 +55,111 @@ Page({
54 55 var th = this;
55 56 this.data.order_id = options.order_id;
56 57 //--初始化--
57   - getApp().getConfig2(function (e){
  58 + getApp().getConfig2(function (e) {
58 59 var json_d = JSON.parse(e.switch_list);
59   - th.data.json_d=json_d;
  60 + th.data.json_d = json_d;
  61 + var is_default_logistics = json_d.is_default_logistics;
  62 + th.setData({is_default_logistics:is_default_logistics});
  63 +
60 64 th.get_wuliu(th.get_info(th.show_page));
61   - },1)
  65 + }, 1)
62 66  
63 67 },
64 68 /**
65 69 * 生命周期函数--监听页面显示
66 70 */
67   - onShow: function() {
  71 + onShow: function () {
68 72 var th = this;
69 73 if (th.data.isclose == 0) {
70 74 wx.navigateTo({
71 75 url: "/pages/index/index/index"
72 76 })
73   - }
74   - th.getuser_addr(function(addr) {
75   - if(addr==null || addr==undefined || addr.length==0) {
76   - th.setData({ user_addr: null, enterAddressPage: 1,});
77   - }else {
  77 + }
  78 + th.getuser_addr(function (addr) {
  79 + if (addr == null || addr == undefined || addr.length == 0) {
  80 + th.setData({ user_addr: null, enterAddressPage: 1, });
  81 + } else {
78 82 th.setData({
79 83 user_addr: addr, enterAddressPage: 0,
80 84 });
81 85 }
82 86  
83   - if (th.data.exp_type == 0 && th.data.goods){
84   - th.calculate_wuliu();
85   - }
86   - })
87   -
  87 + if (th.data.exp_type == 0 && th.data.goods) {
  88 + th.calculate_wuliu();
  89 + }
  90 + })
  91 +
88 92 },
89 93 /**
90 94 * 用户点击右上角分享
91 95 */
92   - onShareAppMessage: function() {},
  96 + onShareAppMessage: function () { },
93 97 //---------------获取物流---------------
94 98 get_wuliu(func) {
95 99 var th = this,
96   - to = getApp();
97   - to.getwuliu(function(e) {
98   - th.setData({
99   - wu_arr: e
100   - })
  100 + to = getApp();
  101 + to.getwuliu(function (e) {
  102 + //如果第一个不是开启默认,说明要让用户自己选
  103 + if (!e[0].is_default) {
  104 + th.setData({ is_default_logistics: 0 });
  105 + }
  106 +
  107 + th.setData({ wu_arr: e })
101 108 typeof func == "function" && func();
102 109 })
103 110 },
104 111 //------获取会员信息-----先获取用户信息,在进行下一步---
105   - get_info: function(func) {
106   - var user_id = t.globalData.user_id,
  112 + get_info: function (func) {
  113 + var user_id = t.globalData.user_id,
107 114 to = getApp();
108   - to.auth.get_u(func);
  115 + to.auth.get_u(func);
109 116 },
110 117  
111 118 //------获取会员收货地址-----
112   - getuser_addr: function(func) {
113   - var to = getApp(),
  119 + getuser_addr: function (func) {
  120 + var to = getApp(),
114 121 a = to.request;
115 122  
116   - a.get("/api/weshop/useraddress/page", {
117   - data: {
118   - user_id: to.globalData.user_id,
119   - store_id: oo.stoid,
120   - pageSize: 600
121   - },
122   - success: function(su) {
123   - var user_addr = su.data.data.pageData;
124   - var item = null;
125   - var def_item = null;
126   - for (var i = 0; i < user_addr.length; i++) {
127   - if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; }
128   - if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
129   - }
130   -
131   - if (item == null) item = def_item;
132   - if (item == null) item = user_addr[0];
133   - if (item == undefined) item = null;
134   - func(item);
  123 + a.get("/api/weshop/useraddress/page", {
  124 + data: {
  125 + user_id: to.globalData.user_id,
  126 + store_id: oo.stoid,
  127 + pageSize: 600
  128 + },
  129 + success: function (su) {
  130 + var user_addr = su.data.data.pageData;
  131 + var item = null;
  132 + var def_item = null;
  133 + for (var i = 0; i < user_addr.length; i++) {
  134 + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; }
  135 + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
135 136 }
136   - });
137   -
  137 +
  138 + if (item == null) item = def_item;
  139 + if (item == null) item = user_addr[0];
  140 + if (item == undefined) item = null;
  141 + func(item);
  142 + }
  143 + });
  144 +
138 145 },
139 146  
140 147 //----------------展示页面,是再获取用户信息之后--------------
141   - show_page: function() {
  148 + show_page: function () {
142 149 var th = this,
143 150 to = getApp();
144 151 th.setData({
145 152 userinfo: to.globalData.userInfo,
146 153 });
147 154 //选获取地址
148   - th.getuser_addr(function(addr) {
  155 + th.getuser_addr(function (addr) {
149 156  
150   - if(addr==null || addr==undefined || addr.length==0) {
151   - th.setData({
  157 + if (addr == null || addr == undefined || addr.length == 0) {
  158 + th.setData({
152 159 enterAddressPage: 1,
153 160 });
154 161  
155   - }else {
  162 + } else {
156 163 th.setData({
157 164 user_addr: addr, enterAddressPage: 0,
158 165 });
... ... @@ -167,7 +174,7 @@ Page({
167 174 store_id: oo.stoid,
168 175 status: 0
169 176 },
170   - success: function(su) {
  177 + success: function (su) {
171 178 console.log("withdrawals");
172 179 if (su.data.code == 0) {
173 180 var yuer = parseFloat(th.data.userinfo.user_money -
... ... @@ -189,8 +196,8 @@ Page({
189 196 pickup = null,
190 197 distr_type = 0,
191 198 exp_type = 0,
192   - teamgroup=null,
193   - th=this;
  199 + teamgroup = null,
  200 + th = this;
194 201 //---获取订单---
195 202 await getApp().request.promiseGet("/api/weshop/order/get/" + oo.stoid + "/" + ord, {}).then(res => {
196 203 order = res.data.data;
... ... @@ -219,22 +226,22 @@ Page({
219 226  
220 227 //---获取尾款价格---
221 228 await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
222   - data:{store_id:oo.stoid,team_id:order.pt_prom_id,listno:order.pt_listno}
  229 + data: { store_id: oo.stoid, team_id: order.pt_prom_id, listno: order.pt_listno }
223 230 }).then(res => {
224 231 teamgroup = res.data.data.pageData[0];
225 232 });
226 233  
227   - var jsarr=JSON.parse(teamgroup.jt_json);
228   - var count=teamgroup.jt_ct_num;
  234 + var jsarr = JSON.parse(teamgroup.jt_json);
  235 + var count = teamgroup.jt_ct_num;
229 236 //要计算尾款的价钱
230   - var price=0;
231   - jsarr.forEach(function(value,index){
232   - if(count>=value['rynum']) price=value['price'];
  237 + var price = 0;
  238 + jsarr.forEach(function (value, index) {
  239 + if (count >= value['rynum']) price = value['price'];
233 240 })
234   - var tail_money =(price*order_goods.goods_num-order['order_amount']-order['user_money']).toFixed(2);
  241 + var tail_money = (price * order_goods.goods_num - order['order_amount'] - order['user_money']).toFixed(2);
235 242  
236 243 tail_money = parseFloat(tail_money);
237   - order.tail_money=tail_money;
  244 + order.tail_money = tail_money;
238 245  
239 246 //--判断物流--
240 247 if (goods.distr_type)
... ... @@ -246,7 +253,7 @@ Page({
246 253 case 0:
247 254 exp_type = 1;
248 255 //-- 系统后台有设置要默认的 --
249   - if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) exp_type=0;
  256 + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) exp_type = 0;
250 257 break; //自选
251 258 case 1:
252 259 exp_type = 1;
... ... @@ -263,14 +270,14 @@ Page({
263 270 distr_type: distr_type,
264 271 pickup: pickup,
265 272 exp_type: exp_type,
266   - goods:goods,
267   - teamgroup:teamgroup
  273 + goods: goods,
  274 + teamgroup: teamgroup
268 275 });
269 276  
270 277 //--计算物流--
271   - if(exp_type==0){
  278 + if (exp_type == 0) {
272 279 th.calculate_wuliu();
273   - }else{
  280 + } else {
274 281 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money;
275 282 allpice = allpice.toFixed(2);
276 283 th.setData({ exp_price: 0, allpice: allpice })
... ... @@ -278,17 +285,17 @@ Page({
278 285 },
279 286  
280 287 //--图片失败,默认图片--
281   - bind_bnerr: function(e) {
  288 + bind_bnerr: function (e) {
282 289 var _errImg = e.target.dataset.errorimg;
283 290 var _errObj = {};
284   - _errObj[_errImg] = this.data.imgUrl+ "/miniapp/images/del/logo.jpg";
  291 + _errObj[_errImg] = this.data.imgUrl + "/miniapp/images/del/logo.jpg";
285 292 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
286 293 },
287 294  
288 295 //-------------------获取物流---------------
289 296 get_wuliu(func) {
290   - var th = this,to = getApp();
291   - to.getwuliu(function(e) {
  297 + var th = this, to = getApp();
  298 + to.getwuliu(function (e) {
292 299 th.setData({
293 300 wu_arr: e
294 301 })
... ... @@ -297,8 +304,8 @@ Page({
297 304 },
298 305  
299 306 //--------点击选择----------
300   - set_wuliu: function(e) {
301   - var type = e.currentTarget.dataset.type,th=this;
  307 + set_wuliu: function (e) {
  308 + var type = e.currentTarget.dataset.type, th = this;
302 309 this.setData({
303 310 exp_type: type
304 311 });
... ... @@ -307,12 +314,12 @@ Page({
307 314  
308 315 //--计算物流的值--
309 316 if (type == 0) {
310   - th.calculate_wuliu();
311   - }else{
312   - var allpice= parseFloat(th.data.order.order_amount)
313   - + parseFloat(th.data.order.user_money)
314   - +parseFloat(th.data.order.tail_money);
315   - allpice=allpice.toFixed(2);
  317 + th.calculate_wuliu();
  318 + } else {
  319 + var allpice = parseFloat(th.data.order.order_amount)
  320 + + parseFloat(th.data.order.user_money)
  321 + + parseFloat(th.data.order.tail_money);
  322 + allpice = allpice.toFixed(2);
316 323 this.setData({
317 324 allpice: allpice, exp_price: 0,
318 325 });
... ... @@ -320,104 +327,104 @@ Page({
320 327 },
321 328  
322 329 //关闭支付
323   - close_show_pay:function(){
324   - this.setData({show_pay_type:0});
  330 + close_show_pay: function () {
  331 + this.setData({ show_pay_type: 0 });
325 332 },
326 333 //--弹起支付框--
327   - to_pay(){
328   - //--物流支付时要有地址--
329   - if (this.data.exp_type == 0 && this.data.user_addr == null) {
330   - return getApp().my_warnning("请选择收货地址", 0, this);
331   - }
  334 + to_pay() {
  335 + //--物流支付时要有地址--
  336 + if (this.data.exp_type == 0 && this.data.user_addr == null) {
  337 + return getApp().my_warnning("请选择收货地址", 0, this);
  338 + }
332 339  
333   - this.setData({show_pay_type:1});
  340 + this.setData({ show_pay_type: 1 });
334 341 },
335 342  
336 343 //选择支付方式
337   - set_pay_type:function(e){
338   - var type=e.currentTarget.dataset.type;
339   - this.to_pay_type(type);
  344 + set_pay_type: function (e) {
  345 + var type = e.currentTarget.dataset.type;
  346 + this.to_pay_type(type);
340 347 },
341 348  
342 349 //--立即支付--
343   - to_pay_type: function(ind) {
344   - var th=this;
  350 + to_pay_type: function (ind) {
  351 + var th = this;
345 352  
346   - //--物流支付时要有地址--
347   - if (th.data.exp_type == 0 && th.data.user_addr==null){
348   - return getApp().my_warnning("请选择收货地址",0,th);
349   - }
  353 + //--物流支付时要有地址--
  354 + if (th.data.exp_type == 0 && th.data.user_addr == null) {
  355 + return getApp().my_warnning("请选择收货地址", 0, th);
  356 + }
350 357  
351   - //---支付参数--
352   - var dd = {
353   - order_sn: th.data.order.order_sn,
354   - order_id: th.data.order.order_id,
355   - store_id: oo.stoid,
356   - exp_type:th.data.exp_type,
357   - user_id:t.globalData.user_id,
358   - listno:th.data.order.pt_listno,
359   - prom_id:th.data.order.pt_prom_id,
360   - tail_pay_type:ind,//0微信支付 1余额支付
361   - };
362   -
363   - if(th.data.exp_type==0){
364   - var index=th.data.index;
365   - dd.shipping_code=th.data.wu_arr[index].code;
366   - dd.shipping_name=th.data.wu_arr[index].name;
367   - dd.shipping_price=parseFloat(th.data.exp_price);
368   - dd.addressid=th.data.user_addr.address_id;
369   - }
  358 + //---支付参数--
  359 + var dd = {
  360 + order_sn: th.data.order.order_sn,
  361 + order_id: th.data.order.order_id,
  362 + store_id: oo.stoid,
  363 + exp_type: th.data.exp_type,
  364 + user_id: t.globalData.user_id,
  365 + listno: th.data.order.pt_listno,
  366 + prom_id: th.data.order.pt_prom_id,
  367 + tail_pay_type: ind,//0微信支付 1余额支付
  368 + };
  369 +
  370 + if (th.data.exp_type == 0) {
  371 + var index = th.data.index;
  372 + dd.shipping_code = th.data.wu_arr[index].code;
  373 + dd.shipping_name = th.data.wu_arr[index].name;
  374 + dd.shipping_price = parseFloat(th.data.exp_price);
  375 + dd.addressid = th.data.user_addr.address_id;
  376 + }
370 377  
371   - var arr=[];
372   - arr.push(dd);
373   - console.log(JSON.stringify(arr));
374   - wx.request({
375   - url: oo.url + '/api/weshop/order/pay/payTuanWk',
376   - data: JSON.stringify(arr),
377   - method: 'POST',
378   - header: {
379   - 'content-type': 'application/json'
380   - },// 设置请求的 header
381   - success: function (t) {
382   -
383   - //---用微信支付---
384   - if(dd.tail_pay_type==0){
385   - var n=t.data.data;
386   - th.weixinPay(n,
387   - function () {
388   - var allmoney=th.data.allpice;
389   - th.jumpPaymentPage(th.data.order.order_sn,allmoney);
390   - },function () {
391   - getApp().my_warnning("支付失败",0,th);
  378 + var arr = [];
  379 + arr.push(dd);
  380 + console.log(JSON.stringify(arr));
  381 + wx.request({
  382 + url: oo.url + '/api/weshop/order/pay/payTuanWk',
  383 + data: JSON.stringify(arr),
  384 + method: 'POST',
  385 + header: {
  386 + 'content-type': 'application/json'
  387 + },// 设置请求的 header
  388 + success: function (t) {
  389 +
  390 + //---用微信支付---
  391 + if (dd.tail_pay_type == 0) {
  392 + var n = t.data.data;
  393 + th.weixinPay(n,
  394 + function () {
  395 + var allmoney = th.data.allpice;
  396 + th.jumpPaymentPage(th.data.order.order_sn, allmoney);
  397 + }, function () {
  398 + getApp().my_warnning("支付失败", 0, th);
  399 + })
  400 + } else {
  401 + if (t.data.code == 0) {
  402 + //---用余额支付---
  403 + getApp().my_warnning("支付成功", 1, th);
  404 + setTimeout(function () {
  405 + th.setData({ isclose: 0 });
  406 + wx.redirectTo({
  407 + url: "/pages/user/order_list/order_list"
392 408 })
393   - }else {
394   - if(t.data.code==0){
395   - //---用余额支付---
396   - getApp().my_warnning("支付成功",1,th);
397   - setTimeout(function () {
398   - th.setData({ isclose: 0 });
399   - wx.redirectTo({
400   - url: "/pages/user/order_list/order_list"
401   - })
402   - }, 1000)
403   - }else{
404   - getApp().my_warnning(t.data.msg,1,th);
405   - }
  409 + }, 1000)
  410 + } else {
  411 + getApp().my_warnning(t.data.msg, 1, th);
406 412 }
407 413 }
408   - });
  414 + }
  415 + });
409 416 },
410 417  
411 418 //----计算物流的钱----
412 419 calculate_wuliu() {
413   - var to=getApp(),th=this;
414   - to.getConfig2(function(ee) {
415   - to.getwuliuprice(function(rs) {
  420 + var to = getApp(), th = this;
  421 + to.getConfig2(function (ee) {
  422 + to.getwuliuprice(function (rs) {
416 423 var o_shipping_price = 0,
417 424 goods_weight = -1,
418 425 goods_piece = -1,
419   - good=th.data.goods;
420   - //-----------当地址不为空,且是物流时,计算物流费用----------
  426 + good = th.data.goods;
  427 + //-----------当地址不为空,且是物流时,计算物流费用----------
421 428 if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) {
422 429 switch (good['exp_sum_type']) {
423 430 case 1:
... ... @@ -435,52 +442,53 @@ Page({
435 442 goods_piece += th.data.order.order_goods['goods_num'];
436 443 break;
437 444 }
438   - var code = th.data.wu_arr[th.data.index].code;
439   - var freight_free = ee.freight_free; //全场满多少包邮
440   - //--全部金额--
441   - var allpice=th.data.order.order_amount+th.data.order.user_money+th.data.order.pt_tail_money;
442   - var shipping_price =
443   - th.calculatewuliu(code, o_shipping_price, goods_weight,
  445 + var code = th.data.wu_arr[th.data.index].code;
  446 + var freight_free = ee.freight_free; //全场满多少包邮
  447 + //--全部金额--
  448 + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money;
  449 + var shipping_price =
  450 + th.calculatewuliu(code, o_shipping_price, goods_weight,
444 451 goods_piece, th.data.user_addr, freight_free, allpice, rs);
445   - var exp_price = parseFloat(shipping_price).toFixed(2);
446   - allpice=parseFloat(exp_price)+parseFloat(allpice);
447   - allpice=allpice.toFixed(2);
448   -
449   - exp_price = parseFloat(exp_price);
450   - th.setData({ exp_price: exp_price,allpice:allpice })
451   - }else {
452   - var allpice=th.data.order.order_amount+th.data.order.user_money+th.data.order.tail_money;
453   - allpice=allpice.toFixed(2);
454   - th.setData({ exp_price: 0,allpice:allpice })
  452 + var exp_price = parseFloat(shipping_price).toFixed(2);
  453 + allpice = parseFloat(exp_price) + parseFloat(allpice);
  454 + allpice = allpice.toFixed(2);
  455 +
  456 + exp_price = parseFloat(exp_price);
  457 + th.setData({ exp_price: exp_price, allpice: allpice })
  458 + } else {
  459 + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money;
  460 + allpice = allpice.toFixed(2);
  461 + th.setData({ exp_price: 0, allpice: allpice })
455 462 }
456 463 });
457 464 });
458 465 },
459 466  
460 467 //----------------计算物流---------------
461   - calculatewuliu:function(code, o_shipping_price, goods_weight,
462   - goods_piece,user_addr, freight_free, o_price, rs){
463   - var price =0,th=this;
464   - price +=parseFloat(o_shipping_price);
  468 + calculatewuliu: function (code, o_shipping_price, goods_weight,
  469 + goods_piece, user_addr, freight_free, o_price, rs) {
  470 + var price = 0, th = this;
  471 + price += parseFloat(o_shipping_price);
465 472 //如果是包邮
466   - if (freight_free > 0 && o_price > freight_free){ return 0;}
467   - if (user_addr==null) { return 0; }
  473 + if (freight_free > 0 && o_price > freight_free) { return 0; }
  474 + if (user_addr == null) { return 0; }
468 475 //计算物流的config item;
469   - var item=null;
  476 + var item = null;
470 477 //先根据 镇 县 区找计算的config
471   - item = th.get_wuliu_config(user_addr.district,code,rs);
472   - if (item==null) item = th.get_wuliu_config(user_addr.city, code, rs);
473   - if (item==null) item = th.get_wuliu_config(user_addr.province, code, rs);
474   - if (item == null) item = th.get_wuliu_default(code,rs);
  478 + item = th.get_wuliu_config(user_addr.district, code, rs);
  479 + if (item == null) item = th.get_wuliu_config(user_addr.city, code, rs);
  480 + if (item == null) item = th.get_wuliu_config(user_addr.province, code, rs);
  481 + if (item == null) item = th.get_wuliu_default(code, rs);
  482 + if (item == null) return o_shipping_price;
  483 + var fw_price = 0, fp_price = 0;
  484 + item = item.config;
475 485 if (item == null) return o_shipping_price;
476   - var fw_price = 0, fp_price=0;
477   - item=item.config;
478 486 //------按重量----------
479   - if (goods_weight>0) {
480   - fw_price =parseFloat(item['money']);
481   - if (goods_weight > item['first_weight']){
  487 + if (goods_weight > 0) {
  488 + fw_price = parseFloat(item['money']);
  489 + if (goods_weight > item['first_weight']) {
482 490 var fw = goods_weight - item['first_weight'];
483   - var n = Math.ceil(fw/item['second_weight'])
  491 + var n = Math.ceil(fw / item['second_weight'])
484 492 fw_price = fw_price + n * parseFloat(item['add_money']);
485 493 }
486 494 }
... ... @@ -493,89 +501,130 @@ Page({
493 501 fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
494 502 }
495 503 }
496   - var rspice =parseFloat(price + fw_price + fp_price);
  504 + var rspice = parseFloat(price + fw_price + fp_price);
497 505 return rspice;
498 506 },
499 507 //------------循环获取config-----------
500   - get_wuliu_config:function(region_id,code,rs){
501   - var item=null,rslist = rs.pageData;
502   - for (var i = 0; i < rslist.length;i++){
503   - if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i];}
  508 + get_wuliu_config: function (region_id, code, rs) {
  509 + var item = null, rslist = rs.pageData;
  510 + for (var i = 0; i < rslist.length; i++) {
  511 + if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i]; }
504 512 }
505 513 return item;
506 514 },
507 515  
508 516 //---------------检查是否有收货地址-------------------
509   - checkAddressList: function() {
  517 + checkAddressList: function () {
510 518 var t = this;
511 519 return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
512 520 title: "请先填写或选择收货地址~",
513   - success: function(a) {
  521 + success: function (a) {
514 522 a.confirm ? t.enterAddressPage() : wx.navigateBack();
515 523 },
516   - fail: function() {
  524 + fail: function () {
517 525 wx.navigateBack();
518 526 }
519 527 }), !1);
520 528 },
521 529  
522 530 //--进入收货地址的编辑页面--
523   - enterAddressPage: function() {
524   - getApp().globalData.is_cart_old=1;
525   - this.data.enterAddressPage =1, wx.navigateTo({
  531 + enterAddressPage: function () {
  532 + getApp().globalData.is_cart_old = 1;
  533 + this.data.enterAddressPage = 1, wx.navigateTo({
526 534 url: "/pages/user/address_list/address_list?is_back=1"
527 535 });
528 536 },
529   -
  537 +
530 538 //------------循环获取config-----------
531   - get_wuliu_config:function(region_id,code,rs){
532   - var item=null,rslist = rs.pageData;
533   - for (var i = 0; i < rslist.length;i++){
534   - if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i];}
  539 + get_wuliu_config: function (region_id, code, rs) {
  540 + var item = null, rslist = rs.pageData;
  541 + for (var i = 0; i < rslist.length; i++) {
  542 + if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i]; }
535 543 }
536 544 return item;
537 545 },
538 546 //-------循环获取config,code default-------
539 547 get_wuliu_default: function (code, rs) {
540   - var item = null, rslist=rs.pageData;
  548 + var item = null, rslist = rs.pageData;
541 549 for (var i = 0; i < rslist.length; i++) {
542 550 if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { item = rslist[i]; }
543 551 }
544 552 return item;
545 553 },
546   -
  554 +
547 555 //-------获取物流选项-------
548   - bindPickerChange:function(e){
549   - var ind = e.detail.value;
550   - this.setData({ index: ind });
  556 + bindPickerChange: function (e) {
  557 + var ind = e.detail.value;
  558 + this.setData({ index: ind });
551 559 },
552 560  
553 561 //------支付成功页面--------
554   - jumpPaymentPage: function(order_sn,order_amount) {
  562 + jumpPaymentPage: function (order_sn, order_amount) {
555 563 wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({
556 564 url: "/pages/payment/pay_success/pay_success?order_sn=" + order_sn + "&type=1",
557 565 });
558 566 },
559 567  
560 568 //------调起支付框--------
561   - weixinPay: function(n, success,fail) {
562   - if(!n) return false;
563   - var th=this;
  569 + weixinPay: function (n, success, fail) {
  570 + if (!n) return false;
  571 + var th = this;
564 572 wx.requestPayment({
565 573 timeStamp: String(n.timeStamp),
566 574 nonceStr: n.nonceStr,
567 575 package: n.packageValue,
568 576 signType: n.signType,
569 577 paySign: n.paySign,
570   - success: function(n) {
571   - console.log(n), getApp().showSuccess("支付成功!");
572   - "function" == typeof success && success();
  578 + success: function (n) {
  579 + console.log(n), getApp().showSuccess("支付成功!");
  580 + "function" == typeof success && success();
573 581 },
574   - fail: function(n) {
575   - console.log(n), "requestPayment:fail" == n.errMsg ? getApp().my_warnning("支付失败",0,th) : "requestPayment:fail cancel" == n.errMsg ? getApp().my_warnning("您已取消支付",0,th) : getApp().my_warnning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length),0,th),
576   - "function" == typeof fail && fail();
  582 + fail: function (n) {
  583 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().my_warnning("支付失败", 0, th) : "requestPayment:fail cancel" == n.errMsg ? getApp().my_warnning("您已取消支付", 0, th) : getApp().my_warnning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length), 0, th),
  584 + "function" == typeof fail && fail();
577 585 }
578 586 });
579   - }
  587 + },
  588 +
  589 +
  590 + //// 开启物流的弹窗
  591 + show_wu_arr: function (e) {
  592 + this.setData({ open_express: 1 });
  593 + },
  594 +
  595 + // 关闭物流的弹窗
  596 + close_express: function () {
  597 + this.setData({ open_express: 0 });
  598 + },
  599 + // 选择物流
  600 + click_express_name: function (e) {
  601 + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
  602 + var index = e.currentTarget.dataset.idxe;
  603 + var ob = { is_express: index, is_shipping_code: shippingcode, index: index };
  604 + this.setData(ob);
  605 + },
  606 +
  607 + //点击确定物流
  608 + determine_expres: function (e) {
  609 + this.setData({ open_express: 0 });
  610 + this.calculatePrice2();
  611 + },
  612 + //设置默认物流
  613 + select_default_logistics: function () {
  614 + var th = this;
  615 + var is_shipping_code = this.data.is_shipping_code
  616 + getApp().request.put("/api/weshop/users/update", {
  617 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code },
  618 + success: function (rse) {
  619 + if (rse.data.code == 0) {
  620 + getApp().globalData.userInfo.def_exp_code = is_shipping_code;
  621 + th.setData({ open_express: 0 });
  622 + //----计算此时购物车的价格----
  623 + if (th.data.is_b_now == 1) th.calculatePrice2();
  624 + else th.calculatePrice();
  625 + }
  626 + }
  627 + })
  628 + },
580 629  
581 630 })
582 631 \ No newline at end of file
... ...
pages/cart/cart_wk/cart_wk.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  2 +
  3 + <!-- 先选择配送方式,2021.7修改 -->
  4 + <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}">
  5 + <view class="tab-wrapper">
  6 + <view hidden="{{distr_type==2}}" bindtap='set_wuliu' data-type='1' class="tab {{exp_type == 1? 'active':''}}"
  7 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  8 +
  9 + <view hidden="{{distr_type==1}}" bindtap='set_wuliu' data-type='0' class="tab {{exp_type== 0 ? 'active':''}}"
  10 + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  11 +
  12 + </view>
  13 + </view>
  14 +
  15 +
2 16 <!----要进行判断地址是否显示---->
3 17 <view bindtap="enterAddressPage" class="user-mes mgt20"
4 18 hidden='{{exp_type==1 }}'>
... ... @@ -24,10 +38,10 @@
24 38 <!-- <view class="border-img"><image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> -->
25 39 </view>
26 40  
27   -<!--头部-->
  41 +<!--头部门店显示-->
28 42 <view class='top bdr_t-14 flex'>
29 43 <image class="t_img" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'></image>
30   - <view class='t_wz'>美得得超市{{pickup.pickup_name}}</view>
  44 + <view class='t_wz'>{{pickup.pickup_name}}</view>
31 45 </view>
32 46  
33 47 <!--商品图片显示-->
... ... @@ -49,8 +63,7 @@
49 63  
50 64 <!--取货方式-->
51 65  
52   -<view class='quhou bdr_b-14'>
53   -
  66 +<!-- <view class='quhou bdr_b-14'>
54 67 <view bindtap="set_wuliu" data-type="1" class='qu_fs' wx:if="{{distr_type==0 || distr_type==1}}">
55 68 <image wx:if="{{exp_type==0}}" src='{{imgUrl}}/miniapp/images/kon.png'></image>
56 69 <image wx:if="{{exp_type==1}}" src='{{imgUrl}}/miniapp/images/dd.png'></image>
... ... @@ -62,13 +75,13 @@
62 75 <image wx:if="{{exp_type==1}}" src='{{imgUrl}}/miniapp/images/kon.png'></image>
63 76 <text class='qu_wz'>快递邮寄</text>
64 77 </view>
  78 +</view> -->
65 79  
66   -</view>
67   -<view class="use-item bdr_b-14" wx:if='{{exp_type==0}}'>
68   - <view>使用物流:</view>
69   - <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name">
70   - <view >{{wu_arr[index].name}}</view>
71   - </picker>
  80 +<view class="use-item bdr_b-14 jc_sb" wx:if='{{exp_type==0 && !is_default_logistics}}'>
  81 + <view>选择物流:</view>
  82 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;">
  83 + <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view>
  84 + </view>
72 85 </view>
73 86  
74 87 <!--成团人数-->
... ... @@ -125,4 +138,49 @@
125 138 </view>
126 139 </block>
127 140  
128   -<warn id="warn"></warn>
129 141 \ No newline at end of file
  142 +<warn id="warn"></warn>
  143 +
  144 +<!----弹起选择物流名的列表---->
  145 +<view wx:if='{{open_express==1}}' >
  146 + <view class="cover-layer flex-center " bindtap='close_express'>
  147 + </view>
  148 +
  149 + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" >
  150 + <view class="tops flex">
  151 + <view class="top-content fs32">
  152 + <view>
  153 + 选择物流名字
  154 + </view>
  155 + </view>
  156 + <view class="close-frame" bindtap='close_express' >
  157 + <view class="xc-close-express">×</view>
  158 + </view>
  159 + </view>
  160 + <view class="express_list">
  161 + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
  162 + <view class="express_list_frame" bindtap="click_express_name"
  163 + data-shippingcode="{{express_list.shipping_code}}"
  164 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  165 +
  166 + <block wx:if="{{is_express==idx}}">
  167 + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
  168 + </block>
  169 + <block wx:else>
  170 + <view class="circle xc-hooks"></view>
  171 + </block>
  172 + <view class="fs30">{{express_list.name}}</view>
  173 +
  174 + </view>
  175 + </view>
  176 + </view>
  177 + <view class="flex click-buttem" >
  178 + <view class="xc-determine flex-center" bindtap="determine_expres">
  179 + <view class="flex-vertical t-c">确定</view>
  180 + </view>
  181 + <view class="xc-confirms flex-center" bindtap="select_default_logistics">
  182 + <view class="flex-vertical t-c">设为默认</view>
  183 + </view>
  184 + </view>
  185 +
  186 + </view >
  187 +</view>
... ...
pages/cart/cart_wk/cart_wk.wxss
  1 +page{ color: #333;}
1 2 .bdr_t-14 {
2 3 border-top-left-radius: 14rpx;
3 4 border-top-right-radius: 14rpx;
... ... @@ -329,5 +330,184 @@ page {
329 330 .anniu_view>view{width: 50%; border-right:1rpx solid #ededed;}
330 331  
331 332  
  333 +.tab-container {
  334 + font-size: 28rpx;
  335 + margin-top: 20rpx;
  336 + display: flex;
  337 +}
  338 +
  339 +.tab-wrapper {
  340 + background-color: #ccc;
  341 + display: flex;
  342 + border-radius: 40rpx;
  343 + overflow: hidden;
  344 +}
  345 +
  346 +.tab {
  347 + padding: 20rpx 30rpx;
  348 +
  349 +}
  350 +
  351 +
  352 +.tab.active {
  353 + background-color: white;
  354 + border-radius: 40rpx;
  355 +}
  356 +
  357 +.xc-right{
  358 + width:20rpx;
  359 + height:20rpx;
  360 + border-top:2rpx solid #666;
  361 + border-right:2rpx solid #666;
  362 + transform:rotate(45deg);
  363 + display:inline-block;
  364 +}
  365 +
  366 +
  367 +/* 自定义弹出窗口 */
  368 +.cx-popup{
  369 + width:100%;
  370 + height:880rpx;
  371 + background: #fff;
  372 + z-index: 35;
  373 + border-top-left-radius: 20rpx;
  374 + border-top-right-radius: 20rpx;
  375 + position:fixed;
  376 + bottom:0;
  377 + left: 0;
  378 + /* padding-bottom: 25rpx; */
  379 +}
  380 +
  381 +.cx-popup .top{
  382 + width:95%;
  383 + height:100rpx;
  384 + border-bottom:3rpx solid #ddd;
  385 + margin: auto;
  386 + margin-top: 30rpx;
  387 +
  388 +}
  389 +.xc-top-content{
  390 + width: 93%;
  391 + height:85rpx;
  392 + padding-top: 30rpx;
  393 + font-size: 34rpx;
  394 + font-weight: 600;
  395 +
  396 +}
  397 +
  398 +.xc-close{
  399 + width: 37rpx;
  400 +height: 37rpx;
  401 +border-radius: 50%;
  402 +border: 3rpx solid #333;
  403 +text-align: center;
  404 +line-height: 34rpx;
  405 +font-size: 29rpx;
  406 +color: #333;
  407 +
  408 +}
  409 +
  410 +.xc-confirm {
  411 + width: 50%;
  412 + border-radius: 50rpx;
  413 + height: 80rpx;
  414 + margin:0 auto;
  415 + background:#d60021;
  416 + color:#fff;
  417 + font-size:28rpx;
  418 + margin-top: 28rpx;
  419 +}
  420 +
  421 +.up{ animation: up .7s; }
  422 +.down{ animation: down 1s; }
  423 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  424 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  425 +
  426 +
  427 +.xc-close-express{
  428 + width: 40rpx;
  429 +height: 40rpx;
  430 +border-radius: 50%;
  431 +border: 3rpx solid #333;
  432 +text-align: center;
  433 +font-size:32rpx;
  434 +line-height: 38rpx;
  435 +color: #333;
  436 +margin-top: 5rpx;
  437 +}
  438 +.cx-popup .tops{
  439 + width: 100%;
  440 +height: 145rpx;
  441 +border-bottom: 3rpx solid #eee;
  442 +
  443 +}
  444 +.top-content {
  445 + width: 82%;
  446 +padding-top: 33px;
  447 +height: 100%;
  448 +padding-left: 40rpx;
  449 +}
  450 +.close-frame{
  451 + margin-top: 30rpx;
  452 +
  453 +}
  454 +
  455 +.xc-hook {
  456 +width: 33rpx;
  457 +height: 33rpx;
  458 +transform: rotate(-135deg);
  459 +line-height: 35rpx;
  460 +text-align: center;
  461 +margin-right: 20rpx
  462 +
  463 +
  464 +}
  465 +.xc-hooks {
  466 +width: 30rpx;
  467 +height: 30rpx;
  468 +border: 1rpx solid #999;
  469 +margin-right: 20rpx;
  470 +}
  471 +.express_list_frame{
  472 + display: flex;
  473 +height: 80rpx;
  474 +align-items: center;
  475 +padding-left: 40rpx;
  476 +border-bottom: 1rpx solid #eee;
  477 +
  478 +}
  479 +.express_list{
  480 + width: 100%;
  481 + height: 65%;
  482 + overflow-y: auto;
  483 + margin-bottom: 40rpx;
  484 +
  485 +}
  486 +.xc-confirms {
  487 + box-sizing: border-box;
  488 + width: 40%;
  489 + border-radius: 50rpx;
  490 + height: 80rpx;
  491 + margin:0 auto;
  492 + font-size:28rpx;
  493 + background: #fff;
  494 + color: #333;
  495 + border: 2rpx solid #333;
  496 +}
332 497  
  498 +.determine-frame{
  499 + width: 100%;
  500 + height: 130rpx;
  501 +
  502 +}
  503 +.xc-determine{
  504 + height: 80rpx;
  505 + width: 40%;
  506 + border-radius: 50rpx;
  507 +background: #d60021;
  508 +color: #fff;
  509 +font-size: 28rpx;
  510 +margin: 0 auto;
  511 +
  512 +}
333 513  
... ...
pages/goods/goodsInfo/buy_integral.wxml
... ... @@ -59,7 +59,7 @@
59 59  
60 60 <!--商品的属性项目-->
61 61 <view class="xc-goods-attribute">
62   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  62 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
63 63 <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
64 64 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
65 65 {{item.gg}}
... ...
pages/goods/goodsInfo/buy_integral_normal.wxml
... ... @@ -60,9 +60,9 @@
60 60  
61 61 <!--商品的属性项目-->
62 62 <view class="xc-goods-attribute">
63   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  63 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
64 64 <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
65   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  65 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">
66 66 {{item.gg}}
67 67 </view>
68 68 </view>
... ... @@ -78,6 +78,20 @@
78 78 </view>
79 79 </view>
80 80  
  81 +
  82 + <!-- 提示再买多少优惠 -->
  83 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition}}">
  84 + 再买{{hui_condition.need}}
  85 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  86 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  87 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  88 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  89 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  90 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  91 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  92 + </view>
  93 +
  94 +
81 95 <!-- 按钮部分 -->
82 96 <view class="spec-cart-btns">
83 97  
... ...
pages/goods/goodsInfo/buy_pt.wxml
... ... @@ -74,7 +74,7 @@
74 74 </view>
75 75 <!----商品的属性项目---->
76 76 <view>
77   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  77 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
78 78 <block wx:if="{{is_normal==0}}">
79 79 <view hidden="{{ismend==1}}" class="flex">
80 80 <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
... ... @@ -84,8 +84,8 @@
84 84  
85 85 <block wx:else>
86 86 <view hidden="{{ismend==1}}" class="flex">
87   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
88   - </view>
  87 + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}"
  88 + bindtap="sele_spec" data-nor="1" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g">{{item.gg}}</view>
89 89 </view>
90 90 </block>
91 91 <view class="clear"></view>
... ... @@ -107,11 +107,25 @@
107 107 <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
108 108 <view>购买数量</view>
109 109 <view class="count">
110   - <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum_inte'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  110 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
111 111 <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
112 112 <view bindtap="addCartNum" class="add">+</view>
113 113 </view>
114 114 </view>
  115 +
  116 +
  117 + <!-- 提示再买多少优惠 -->
  118 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && is_normal==1}}">
  119 + 再买{{hui_condition.need}}
  120 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  121 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  122 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  123 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  124 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  125 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  126 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  127 + </view>
  128 +
115 129  
116 130 <view class="clear"></view>
117 131 <!---当选取门店的时候会显示门店的选项---->
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -779,24 +779,16 @@ Page({
779 779 ee.check_is_youhui(ee.data.gid);
780 780  
781 781 t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
782   - var txt = (t.data.data.shop_price / t.data.data.market_price * 10).toFixed(2).toString();
783   -
784   -
785   - if(txt != 0) {
786   - if(txt.indexOf('.') != -1) {
787   - var arrtxt = txt.split('.');
788   - if(arrtxt[1].length == 1 && arrtxt[1][0] == 0) {
789   - txt = txt.slice(0,-2);
790   - };
791   -
792   - if(arrtxt[1].length == 2 && arrtxt[1][1] == 0) {
793   - txt = txt.slice(0,-1);
794   - };
795   - };
796   - } else {
797   - txt = 0;
798   - }
799   -
  782 +
  783 + var cur_price=t.data.data.shop_price;
  784 + if(getApp().globalData.userInfo && getApp().globalData.userInfo.card_field){
  785 + var cfile=getApp().globalData.userInfo.card_field;
  786 + if(t.data.data[cfile]){
  787 + cur_price=t.data.data[cfile];
  788 + }
  789 + }
  790 + var txt =(cur_price / t.data.data.market_price * 10).toFixed(2).toString();
  791 + txt=parseFloat(txt);
800 792  
801 793 t.data.data['disc'] = txt;
802 794  
... ... @@ -1262,9 +1254,9 @@ Page({
1262 1254  
1263 1255 //如果是积分够,is_integral_normal就要有积分购普通购买字段
1264 1256 if(o.prom_type==4){
1265   - newd.is_integral_normal=1;
  1257 + newd.is_integral_normal=1;
1266 1258 }
1267   -
  1259 +
1268 1260 //如果有线下取价
1269 1261 if(o.offline_price){
1270 1262 newd.offline_price=o.offline_price;
... ... @@ -1504,14 +1496,32 @@ Page({
1504 1496 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1505 1497 // action: "buy_now"
1506 1498 // }),
1507   - s.set_b_now(e);
  1499 +
1508 1500 if(e.prom_type==4){
  1501 + s.set_b_now(e);
1509 1502 var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;
1510 1503 getApp().goto(url);
1511 1504 }else{
1512   - wx.redirectTo({
1513   - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
1514   - });
  1505 + //要判断积分购的普通购买有没有参加优惠活动
  1506 + if(e.is_integral_normal==1){
  1507 + this.check_nor_promgood(e.goods_id,function(res){
  1508 + if(res && res.cat_id){
  1509 + e.prom_type=3;
  1510 + e.prom_id=res.cat_id
  1511 + }
  1512 + s.set_b_now(e);
  1513 + wx.redirectTo({
  1514 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1515 + });
  1516 +
  1517 + })
  1518 + }else{
  1519 + s.set_b_now(e);
  1520 + wx.redirectTo({
  1521 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1522 + });
  1523 + }
  1524 +
1515 1525 }
1516 1526 },
1517 1527  
... ... @@ -1700,6 +1710,13 @@ Page({
1700 1710 closeSpecModal: function() {
1701 1711 if(this.data.openSpecModal_pt && this.data.is_normal){
1702 1712 this.get_sto();
  1713 + this.setData({
  1714 + sele_g:this.data.data,
  1715 + gid:this.data.data.goods_id
  1716 + })
  1717 +
  1718 + this.sele_spec_chech_activity();
  1719 +
1703 1720 }
1704 1721  
1705 1722 this.setData({
... ... @@ -2088,7 +2105,8 @@ Page({
2088 2105 more_spec:gd.more_spec,
2089 2106 isonsale: 1,
2090 2107 is_on_sale: 1,
2091   - pageSize:500
  2108 + pageSize:500,
  2109 + orderField: 'sort'
2092 2110 }
2093 2111 }).then(res => {
2094 2112 var e = res;
... ... @@ -2102,25 +2120,48 @@ Page({
2102 2120 for (var i = 0; i < arrdata.length; i++) {
2103 2121 var goodsinfo=arrdata[i],prom=null;
2104 2122 if (goodsinfo.goods_id != g_id) {
2105   - if(goodsinfo.prom_type==1){
2106   - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{
2107   - }).then(res=>{
2108   - if(res.data.code==0) prom=res.data.data;
2109   - })
2110   - }
2111   - if(goodsinfo.prom_type==6){
2112   - await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
2113   - }).then(res=>{
2114   - if(res.data.code==0) prom=res.data.data;
2115   - })
2116   - }
  2123 +
  2124 + switch(goodsinfo.prom_type){
  2125 + case 1:
  2126 + await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2127 + }).then(res=>{
  2128 + if(res.data.code==0) prom=res.data.data;
  2129 + })
  2130 +
  2131 + break;
  2132 + case 6:
  2133 + await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
  2134 + }).then(res=>{
  2135 + if(res.data.code==0) prom=res.data.data;
  2136 + })
  2137 +
  2138 + break;
  2139 + case 2:
  2140 + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2141 + }).then(res=>{
  2142 + if(res.data.code==0) prom=res.data.data;
  2143 + })
  2144 + break;
  2145 + case 4:
  2146 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2147 + }).then(res=>{
  2148 + if(res.data.code==0) prom=res.data.data;
  2149 + })
  2150 + break
  2151 +
  2152 + }
  2153 +
  2154 +
2117 2155 }
2118 2156 //---如果有活动,不算在一起---
2119 2157 if(prom){
2120   - if(prom.is_end==0 && prom.end_time>now && prom.start_time<now){
2121   - continue;
2122   - }
  2158 + if(goodsinfo.prom_type==1 || goodsinfo.prom_type==6){
  2159 + if(prom.is_end==0 && prom.end_time>now && prom.start_time<now) continue;
  2160 + }else{
  2161 + continue;
  2162 + }
2123 2163 }
  2164 +
2124 2165  
2125 2166 var item = arrdata[i],gg = "";
2126 2167 if(item.goods_spec=="null" || item.goods_spec==null) item.goods_spec="";
... ... @@ -2168,7 +2209,13 @@ Page({
2168 2209 sele_spec: function(e) {
2169 2210 var that=this,ee=this,th=this;
2170 2211 var gid = e.currentTarget.dataset.gid;
  2212 + var nor=e.currentTarget.dataset.nor;
  2213 +
2171 2214 var sku_g = this.data.sku_g;
  2215 + if(nor){
  2216 + sku_g = this.data.sku_g_pt;
  2217 + }
  2218 +
2172 2219 var item = null;
2173 2220 for (var i in sku_g) {
2174 2221 if (sku_g[i].goods_id == gid) {
... ... @@ -2180,12 +2227,13 @@ Page({
2180 2227 sele_g: item,
2181 2228 gid: gid
2182 2229 });
  2230 +
  2231 +
2183 2232  
2184   - that.check_is_youhui(gid)
2185   -
  2233 + that.check_is_youhui(gid,that.data.is_normal);
  2234 +
2186 2235 var ty=0;
2187   -
2188   - this.get_sto();
  2236 + this.get_sto(that.data.is_normal);
2189 2237  
2190 2238  
2191 2239 //默认门店要拿下门店库存
... ... @@ -2241,6 +2289,16 @@ Page({
2241 2289 }
2242 2290 })
2243 2291 }
  2292 +
  2293 + if(goodsinfo.prom_type==4){
  2294 + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/"+os.stoid+"/"+goodsinfo.goods_id+"/"+goodsinfo.prom_id,{
  2295 + }).then(res=>{
  2296 + if(res.data.code==0){
  2297 + prom=res.data.data;
  2298 + }
  2299 + })
  2300 + }
  2301 +
2244 2302 //----------如果有活动,并且在进行中,就不计算线下库存---------------
2245 2303 var now=ut.gettimestamp();
2246 2304 if(prom){
... ... @@ -3334,7 +3392,8 @@ Page({
3334 3392 openSpecModal_pt: 1
3335 3393 });
3336 3394 });
3337   - }
  3395 + }
  3396 + th.check_is_youhui(th.data.gid,1);
3338 3397 } else {
3339 3398  
3340 3399 //拼单商品从这里进,先判断有没有买过商品,
... ... @@ -3560,8 +3619,19 @@ Page({
3560 3619 newd['pick_name'] = th.data.sto_sele_name;
3561 3620 newd['pick_dis'] = th.data.sto_sele_distr;
3562 3621 newd['is_normal'] = th.data.is_normal;
3563   -
3564   - th.buyNow_pt(newd);
  3622 +
  3623 + if(newd['is_normal']){
  3624 + newd['is_pd_normal']=1;
  3625 + //判断一下有没有全局优惠活动
  3626 + th.check_nor_promgood(newd.goods_id,function(e){
  3627 + if(e && e.act_id){
  3628 + newd['prom_type']=3;
  3629 + newd['prom_id']=e.act_id;
  3630 + }
  3631 + th.buyNow(newd)
  3632 + })
  3633 + }
  3634 + else th.buyNow_pt(newd);
3565 3635 })
3566 3636 },
3567 3637 //----------立即购买_pt-----------
... ... @@ -4025,7 +4095,7 @@ Page({
4025 4095 //---市场价划掉---
4026 4096 context.setFillStyle("gray")
4027 4097 context.setFontSize(22 * unit)
4028   - context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit);
  4098 + context.fillText("¥" + th.data.data.market_price.toFixed(2), 426 * unit, 213 * unit);
4029 4099 context.setStrokeStyle('gray');
4030 4100 context.setLineWidth(1 * unit);
4031 4101 context.moveTo(426 * unit, 206 * unit);
... ... @@ -5058,33 +5128,53 @@ Page({
5058 5128 },
5059 5129  
5060 5130 //---检查有没有优惠活动---
5061   - check_is_youhui:function(gid){
5062   - var th=this;
5063   - //调用接口判断订单优惠,
5064   - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {}).then(res => {
5065   - if(res.data.code==0){
5066   - var r_data=res.data.data;
5067   - var max=0,min=0;
5068   - if(r_data.collocationList){
5069   - for(var i in r_data.collocationList){
5070   - if(max==0) max=r_data.collocationList[i].price;
5071   - if(min==0) min=r_data.collocationList[i].price;
5072   -
5073   - if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;
5074   - if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;
5075   - }
5076   - r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);
5077   - r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);
5078   - }
5079   - th.setData({
5080   - order_prom:r_data.promOrder,
5081   - collocationGoods:r_data.collocationPromList,
5082   - prom_goods:r_data.promGoodsLists,
5083   - })
  5131 + check_is_youhui:function(gid,is_nor){
  5132 + var th=this;
  5133 + //如果是普通购买的时候,要进行调用
  5134 + if(is_nor){
  5135 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid+"/"+gid, {
  5136 + success:function(res){
  5137 + if(res.data.code==0){
  5138 + var r_data=res.data.data;
  5139 + th.setData({
  5140 + prom_goods:r_data.promGoodsLists,
  5141 + })
  5142 + th.is_show_more_buy();
  5143 + }
  5144 + },
  5145 + })
5084 5146  
5085   - th.is_show_more_buy();
5086   - }
5087   - })
  5147 + }else{
  5148 + //调用接口判断订单优惠,
  5149 + getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+gid+"/0", {
  5150 + success:function(res){
  5151 + if(res.data.code==0){
  5152 + var r_data=res.data.data;
  5153 + var max=0,min=0;
  5154 + if(r_data.collocationList){
  5155 + for(var i in r_data.collocationList){
  5156 + if(max==0) max=r_data.collocationList[i].price;
  5157 + if(min==0) min=r_data.collocationList[i].price;
  5158 +
  5159 + if(max<parseFloat(r_data.collocationList[i].price)) max=r_data.collocationList[i].price;
  5160 + if(min>parseFloat(r_data.collocationList[i].price)) min=r_data.collocationList[i].price;
  5161 + }
  5162 + r_data.collocationPromList.max=(max+th.data.data.shop_price).toFixed(2);
  5163 + r_data.collocationPromList.min=(min+th.data.data.shop_price).toFixed(2);
  5164 + }
  5165 + th.setData({
  5166 + order_prom:r_data.promOrder,
  5167 + collocationGoods:r_data.collocationPromList,
  5168 + prom_goods:r_data.promGoodsLists,
  5169 + })
  5170 + th.is_show_more_buy();
  5171 + }
  5172 + }
  5173 +
  5174 + })
  5175 + }
  5176 +
  5177 +
5088 5178 },
5089 5179  
5090 5180 closePoster() {
... ... @@ -5212,13 +5302,13 @@ Page({
5212 5302 if(item.prom_type==1){
5213 5303 if(item.condition>this.data.goodsInputNum) {
5214 5304 con=item;
5215   - con.need=(item.condition-this.data.goodsInputNum)+"件";
  5305 + con.need=(item.condition-this.data.goodsInputNum).toFixed(2)+"件";
5216 5306 break;
5217 5307 }
5218 5308 }else{
5219 5309 if(item.condition>all_price){
5220 5310 con=item;
5221   - con.need=(item.condition-all_price)+"元";
  5311 + con.need=(item.condition-all_price).toFixed(2)+"元";
5222 5312 break;
5223 5313 }
5224 5314 }
... ... @@ -5235,8 +5325,20 @@ Page({
5235 5325 },
5236 5326 //-- 积分购普通购买 --
5237 5327 go_pay_integral_normal:function(){
5238   - this.get_sto(1)
5239   - this.setData({openSpecModal_inte_normal:1});
  5328 + var th=this;
  5329 + if (th.data.sku_g_pt) {
  5330 + this.get_sto(1)
  5331 + this.setData({openSpecModal_inte_normal:1});
  5332 + }else{
  5333 + th.get_sto(1);
  5334 + th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function() {
  5335 + th.setData({
  5336 + is_normal: 1,
  5337 + openSpecModal_inte_normal:1
  5338 + });
  5339 + });
  5340 + }
  5341 + this.check_is_youhui(th.data.gid,1);
5240 5342 },
5241 5343  
5242 5344 closeSpecModal_inte:function(){
... ... @@ -5244,6 +5346,14 @@ Page({
5244 5346 } ,
5245 5347 closeSpecModal_inte_normal:function(){
5246 5348 this.setData({openSpecModal_inte_normal:0});
  5349 + //要进行还原
  5350 + this.get_sto();
  5351 + this.setData({
  5352 + sele_g:this.data.data,
  5353 + gid:this.data.data.goods_id
  5354 + })
  5355 +
  5356 + this.sele_spec_chech_activity();
5247 5357 },
5248 5358  
5249 5359 addCart_inte:function(t){
... ... @@ -5288,4 +5398,19 @@ Page({
5288 5398 });
5289 5399 },
5290 5400  
  5401 + //积分购和拼团的普通购买的的时候,要判断有没有全场优惠活动
  5402 + check_nor_promgood(goods_id,back){
  5403 + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/"+os.stoid+"/"+goods_id,{
  5404 + success:function(res){
  5405 + if(res.data.code==0 && res.data.data && res.data.data.promGoodsLists && res.data.data.promGoodsLists.length>0){
  5406 + var obj={
  5407 + act_id:res.data.data.promGoodsLists[0].prom_id,
  5408 + }
  5409 + back(obj);
  5410 + }else{
  5411 + back(0)
  5412 + }
  5413 + }
  5414 + })
  5415 + }
5291 5416 });
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -93,7 +93,7 @@
93 93 <view class="flex fs35 xc-qtsign">¥</view>
94 94 <view class="fs50 val">{{prom_price}}</view>
95 95 </view>
96   - <view class="word-line fs20 xc-qtunit-price">零售价¥{{data.market_price}}</view>
  96 + <view class="word-line fs20 xc-qtunit-price">零售价¥{{filters.toFix(data.market_price,2)}}</view>
97 97 </view>
98 98 <view class="abs white xc-nanber">
99 99 <text class="fs22">已拼{{prom_act.buy_num}}件</text>
... ... @@ -249,7 +249,7 @@
249 249 <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>
250 250 <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>
251 251 <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text>
252   - <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>
  252 + <text class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{filters.toFix(data.market_price,2)}}</text>
253 253 </view>
254 254  
255 255 <!-- 这个是分享按钮 -->
... ... @@ -297,12 +297,12 @@
297 297 </view>
298 298 <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}
299 299 <view class='yj' style="top:35rpx">
300   - <text>零售价:¥{{data.market_price}}</text>
  300 + <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>
301 301 </view>
302 302 </block>
303 303 <block wx:else>
304 304 <text class="yuan">¥</text>{{filters.toFix(data.shop_price,2)}}
305   - <view class='yj'><text>零售价:¥{{data.market_price}}</text></view>
  305 + <view class='yj'><text>零售价:¥{{filters.toFix(data.market_price,2)}}</text></view>
306 306 </block>
307 307 </view>
308 308  
... ... @@ -398,7 +398,7 @@
398 398 <view class="flex jc_sb">
399 399 <view class="flex" style="align-items: baseline;">
400 400 <view class="flex xc-price-frame"><text class="fs30">¥</text>{{prom_price}}</view>
401   - <view class="word-line fs24">零售价¥{{data.market_price}}</view>
  401 + <view class="word-line fs24">零售价¥{{filters.toFix(data.market_price,2)}}</view>
402 402 </view>
403 403  
404 404 <!-- 这个是分享按钮 -->
... ...
pages/team/team_show/team_show.wxml
... ... @@ -242,7 +242,7 @@
242 242 </view>
243 243 <!-- 商品的属性项目 -->
244 244 <view>
245   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  245 + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view>
246 246 <block>
247 247 <view hidden="{{ismend==1}}" class="flex">
248 248 <view class="spec_bt act" >{{goods.gg}}
... ...
pages/user/coupons/exchange/exchange.js
... ... @@ -61,8 +61,13 @@ Page({
61 61 */
62 62 async click(e) {
63 63 var th=this;
64   - this.data.monye=e.currentTarget.dataset.monye;
65   - this.data.integr=e.currentTarget.dataset.integr;
  64 +
  65 + var index=e.currentTarget.dataset.index;
  66 + var item=this.data.result[index];
  67 + this.data.monye=item.ToSum;
  68 + this.data.integr=item.Integral;
  69 + this.data.number=item.Number;
  70 +
66 71 var my_con = this.selectComponent("#my_con"); //组件的id
67 72 var title="是否使用"+th.data.integr+"积分兑换代金券面值"+th.data.monye+"元";
68 73 my_con.open(title, "确定", "取消", th.sure_pay, null)
... ... @@ -71,6 +76,7 @@ Page({
71 76 sure_pay:function(){
72 77 var monye=this.data.monye;
73 78 var integr=this.data.integr;
  79 + var number=this.data.number;
74 80  
75 81 var user_id = getApp().globalData.user_id;
76 82 console.log(integr,"是什么微卷",typeof integr,monye);
... ... @@ -81,6 +87,7 @@ Page({
81 87 store_id: store_id,
82 88 money:monye,
83 89 integ:integr,
  90 + number:number,
84 91 },
85 92 success: function (su) {
86 93 if (su.data.data!=null) {
... ...
pages/user/coupons/exchange/exchange.wxml
... ... @@ -6,7 +6,7 @@
6 6 <view><text class='f-big'>{{filter.getNum(result.ToSum)}}</text></view>
7 7 </view>
8 8 <view class='mb20'>{{result.Integral}}积分兑换{{filter.getNum(result.ToSum)}}元微券</view>
9   - <view class='jf-btn' bindtap='click' data-monye='{{result.ToSum}}' data-integr="{{result.Integral}}">立即兑换</view>
  9 + <view class='jf-btn' bindtap='click' data-index="{{idx}}">立即兑换</view>
10 10 </view>
11 11 </block>
12 12 <my_confirm id="my_con"></my_confirm>
13 13 \ No newline at end of file
... ...
pages/user/my_service/i_service.wxml
... ... @@ -99,4 +99,4 @@
99 99 <my_confirm id="my_confirm"></my_confirm>
100 100  
101 101 <!-- 批量预约图标 -->
102   -<!-- <view class="icon-container" bindtap="goto" data-url="/packageA/pages/my_service2/appment_main"><text class="iconfont icon-plyy"></text></view> -->
103 102 \ No newline at end of file
  103 +<view class="icon-container" bindtap="goto" data-url="/packageA/pages/my_service2/appment_main"><text class="iconfont icon-plyy"></text></view>
104 104 \ No newline at end of file
... ...
pages/user/order_detail/order_detail.wxml
... ... @@ -77,7 +77,7 @@
77 77 <view class="leave-word">{{order.user_note!=''?order.user_note:'无'}}</view>
78 78 </view>
79 79 </view>
80   - <view class="price-information information">
  80 + <view class="price-information information" style="margin-bottom: 120rpx;">
81 81 <view class="title" style="margin-bottom:10rpx" >价格信息</view>
82 82 <view class="item pnew" wx:if="{{order.is_zsorder==4}}">
83 83 <view>商品总价</view>
... ...