From 220f58779915746e137abb3d271bf87bd9c98ae9 Mon Sep 17 00:00:00 2001 From: F5VT98DI7XY4X12\Administrator <765199919@qq.com> Date: Mon, 9 Sep 2019 08:52:58 +0800 Subject: [PATCH] 小程序测试7个bug修复 --- pages/cart/cart/cart.js | 3 +++ pages/cart/cart2/cart2.js | 6 ++++-- pages/cart/cart2_pt/cart2_pt.js | 18 ++++++++++++++---- pages/cart/cart2_pt/cart2_pt.wxml | 6 +++--- pages/cart/cart_wk/cart_wk.wxml | 4 ++-- pages/user/add_address/add_address.js | 41 +++++++++++++++++++++++++++++++++-------- pages/user/address_list/address_list.js | 45 ++++++++++++++++++++++++++++++++++++--------- pages/user/address_list/address_list.wxml | 4 ++-- pages/user/address_list/address_list.wxss | 12 +++++++++--- 9 files changed, 106 insertions(+), 33 deletions(-) diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index f27f9ee..9b8e343 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -527,6 +527,9 @@ Page({ }) } catch (e) { err=e;} if (isok==0){ + if (gname.length > 10) { + gname = gname.substr(0, 10); gname+="..."; + } t.confirmBox(gname+":"+ err); return false; } wx.navigateTo({ diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 3412ea7..6ff839f 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -101,8 +101,7 @@ Page({ }, //------获取会员收货地址----- - getuser_addr:function(func){ - + getuser_addr:function(func){ a.get("/api/weshop/useraddress/page", { data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 }, success: function (su) { @@ -323,6 +322,9 @@ Page({ quanlist=res.data.data.pageData; }) + t.data.data.prom_id = 0; + t.data.data.prom_type = 0; + th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js index ec125d0..a38357e 100644 --- a/pages/cart/cart2_pt/cart2_pt.js +++ b/pages/cart/cart2_pt/cart2_pt.js @@ -54,6 +54,7 @@ Page({ is_pt_tz:0,//是否开团团长 qh:'', //期号 pt_listno:'',//期号 + is_normal:0 }, onLoad: function(t) { console.log("onLoad_pt_cart"); @@ -160,7 +161,7 @@ Page({ t.data.data.is_normal=1; th.setData({ bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, - bn_pick: gg.pick_id, bn_t_exp_t: distr_t + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, is_normal:1 }); th.calculatePrice2(); }else{ @@ -472,9 +473,18 @@ Page({ app.my_warnning("支付成功",1,th); setTimeout(function () { th.setData({ isclose: 0 }); - wx.navigateTo({ - url: "/pages/team/team_success/team_success?ordersn=" + data.data, - }) + + if(th.data.is_normal==1){ + wx.navigateTo({ + url: "/pages/user/order_list/order_list", + }) + }else{ + wx.navigateTo({ + url: "/pages/team/team_success/team_success?ordersn=" + data.data, + }) + } + + }, 1000) } }); diff --git a/pages/cart/cart2_pt/cart2_pt.wxml b/pages/cart/cart2_pt/cart2_pt.wxml index a61ed73..ed4506d 100644 --- a/pages/cart/cart2_pt/cart2_pt.wxml +++ b/pages/cart/cart2_pt/cart2_pt.wxml @@ -50,7 +50,7 @@ - + 自提 @@ -62,7 +62,7 @@ - + - + 商品金额 ¥ {{formData.all_price}}元 diff --git a/pages/cart/cart_wk/cart_wk.wxml b/pages/cart/cart_wk/cart_wk.wxml index 2e17de5..1fb7997 100644 --- a/pages/cart/cart_wk/cart_wk.wxml +++ b/pages/cart/cart_wk/cart_wk.wxml @@ -83,7 +83,7 @@ 支付定金 - {{order.order_amount+order.user_money}} + {{filters.toFix(order.order_amount+order.user_money,2)}} @@ -107,7 +107,7 @@ 支付合计: - ¥{{order.tail_money+exp_price}} + ¥{{filters.toFix(order.tail_money+exp_price,2)}} 支付尾款 diff --git a/pages/user/add_address/add_address.js b/pages/user/add_address/add_address.js index 3bb1f5f..05e9080 100644 --- a/pages/user/add_address/add_address.js +++ b/pages/user/add_address/add_address.js @@ -94,15 +94,40 @@ Page({ }else{ a['user_id'] = oo.user_id; a['store_id'] = os.stoid; - //-----新增地址------- - t.post("/api/weshop/useraddress/save", { - data: a, - success: function (s) { - e.showSuccess(s.data.msg, function () { - wx.navigateBack(); + + + if (a.is_default == 1) { + t.put("/api/weshop/useraddress/update", { + data: { user_id: oo.user_id, is_default: 0 }, + success: function (s) { + + //-----新增地址------- + t.post("/api/weshop/useraddress/save", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); + }); + } + }); + + } + }) + }else{ + + //-----新增地址------- + t.post("/api/weshop/useraddress/save", { + data: a, + success: function (s) { + e.showSuccess(s.data.msg, function () { + wx.navigateBack(); + }); + } }); - } - }); + } + + + } }, diff --git a/pages/user/address_list/address_list.js b/pages/user/address_list/address_list.js index 7c1c7ff..40710c3 100644 --- a/pages/user/address_list/address_list.js +++ b/pages/user/address_list/address_list.js @@ -6,25 +6,45 @@ Page({ url: e.globalData.setting.url, resourceUrl: e.globalData.setting.resourceUrl, iurl: e.globalData.setting.imghost, - addresses: null, - operate: null + addresses: [], + operate: null, + curpage:1, + total:0, + ismore:0, + }, onLoad: function(e) { this.data.operate = e.operate; }, onShow: function() { + this.data.curpage=1; + this.data.addresses=[]; this.requestAddressList(); }, - onPullDownRefresh: function() { - this.requestAddressList(); - }, - requestAddressList: function() { + + + onReachBottom: function () { + if(this.data.total<=6) return; + if(this.data.ismore) return; + this.requestAddressList(); + }, + + requestAddressList: function() { + var tt= Math.random() * 100 var e = this; t.get(e.data.url + "/api/weshop/useraddress/page", { - data: { store_id: os.stoid, user_id: oo.user_id}, + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage,pageSize:6,t:tt}, success: function(t) { - e.setData({ - addresses: t.data.data.pageData, + e.data.curpage++; + var arr1 = e.data.addresses; + var arr2 = t.data.data.pageData; + var arr3 = [...arr1, ...arr2]; + + var ismore=0; + if (arr3.length == t.data.data.total) ismore=1 + + e.setData({ + addresses: arr3, total: t.data.data.total, ismore: ismore }), wx.stopPullDownRefresh(); } }); @@ -58,5 +78,12 @@ Page({ var t = this.data.addresses; for (var s in t) if (t[s].address_id == e) break; return s ? t[s] : {}; + }, + + go_url:function(e){ + var url=e.currentTarget.dataset.url; + getApp().goto(url); } + + }); \ No newline at end of file diff --git a/pages/user/address_list/address_list.wxml b/pages/user/address_list/address_list.wxml index abb0994..47eacf9 100644 --- a/pages/user/address_list/address_list.wxml +++ b/pages/user/address_list/address_list.wxml @@ -12,7 +12,7 @@ - + +新建地址 - + diff --git a/pages/user/address_list/address_list.wxss b/pages/user/address_list/address_list.wxss index de45c87..846283f 100644 --- a/pages/user/address_list/address_list.wxss +++ b/pages/user/address_list/address_list.wxss @@ -62,14 +62,20 @@ page { } .address-create { - width: 50%; + background-color: #fff; + width: 100%; text-align: center; position: fixed; - bottom: 80rpx; - left: 25%; + bottom: 0rpx; + height: 200rpx; + border-top:1rpx solid #eee + } .create-btn { + width: 50%; + margin: 0 auto; + margin-top: 60rpx; font-size: 28rpx; color: white; background-color: #f23030; -- libgit2 0.21.4