Commit 220f58779915746e137abb3d271bf87bd9c98ae9

Authored by F5VT98DI7XY4X12\Administrator
1 parent a28e9635

小程序测试7个bug修复

pages/cart/cart/cart.js
@@ -527,6 +527,9 @@ Page({ @@ -527,6 +527,9 @@ Page({
527 }) 527 })
528 } catch (e) { err=e;} 528 } catch (e) { err=e;}
529 if (isok==0){ 529 if (isok==0){
  530 + if (gname.length > 10) {
  531 + gname = gname.substr(0, 10); gname+="...";
  532 + }
530 t.confirmBox(gname+":"+ err); return false; 533 t.confirmBox(gname+":"+ err); return false;
531 } 534 }
532 wx.navigateTo({ 535 wx.navigateTo({
pages/cart/cart2/cart2.js
@@ -101,8 +101,7 @@ Page({ @@ -101,8 +101,7 @@ Page({
101 }, 101 },
102 102
103 //------获取会员收货地址----- 103 //------获取会员收货地址-----
104 - getuser_addr:function(func){  
105 - 104 + getuser_addr:function(func){
106 a.get("/api/weshop/useraddress/page", { 105 a.get("/api/weshop/useraddress/page", {
107 data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 }, 106 data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 },
108 success: function (su) { 107 success: function (su) {
@@ -323,6 +322,9 @@ Page({ @@ -323,6 +322,9 @@ Page({
323 quanlist=res.data.data.pageData; 322 quanlist=res.data.data.pageData;
324 }) 323 })
325 324
  325 + t.data.data.prom_id = 0;
  326 + t.data.data.prom_type = 0;
  327 +
326 th.setData({ 328 th.setData({
327 bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, 329 bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,
328 bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist 330 bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist
pages/cart/cart2_pt/cart2_pt.js
@@ -54,6 +54,7 @@ Page({ @@ -54,6 +54,7 @@ Page({
54 is_pt_tz:0,//是否开团团长 54 is_pt_tz:0,//是否开团团长
55 qh:'', //期号 55 qh:'', //期号
56 pt_listno:'',//期号 56 pt_listno:'',//期号
  57 + is_normal:0
57 }, 58 },
58 onLoad: function(t) { 59 onLoad: function(t) {
59 console.log("onLoad_pt_cart"); 60 console.log("onLoad_pt_cart");
@@ -160,7 +161,7 @@ Page({ @@ -160,7 +161,7 @@ Page({
160 t.data.data.is_normal=1; 161 t.data.data.is_normal=1;
161 th.setData({ 162 th.setData({
162 bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, 163 bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,
163 - bn_pick: gg.pick_id, bn_t_exp_t: distr_t 164 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, is_normal:1
164 }); 165 });
165 th.calculatePrice2(); 166 th.calculatePrice2();
166 }else{ 167 }else{
@@ -472,9 +473,18 @@ Page({ @@ -472,9 +473,18 @@ Page({
472 app.my_warnning("支付成功",1,th); 473 app.my_warnning("支付成功",1,th);
473 setTimeout(function () { 474 setTimeout(function () {
474 th.setData({ isclose: 0 }); 475 th.setData({ isclose: 0 });
475 - wx.navigateTo({  
476 - url: "/pages/team/team_success/team_success?ordersn=" + data.data,  
477 - }) 476 +
  477 + if(th.data.is_normal==1){
  478 + wx.navigateTo({
  479 + url: "/pages/user/order_list/order_list",
  480 + })
  481 + }else{
  482 + wx.navigateTo({
  483 + url: "/pages/team/team_success/team_success?ordersn=" + data.data,
  484 + })
  485 + }
  486 +
  487 +
478 }, 1000) 488 }, 1000)
479 } 489 }
480 }); 490 });
pages/cart/cart2_pt/cart2_pt.wxml
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 </view> 50 </view>
51 51
52 <!--阶梯团是不显示的--> 52 <!--阶梯团是不显示的-->
53 - <view class="use-item" wx:if="{{kt_type!=3}}"> 53 + <view class="use-item" wx:if="{{kt_type!=3 || is_normal==1}}">
54 <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> 54 <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};">
55 <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> 55 <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
56 <view class="yu_er">自提</view> 56 <view class="yu_er">自提</view>
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </view> 62 </view>
63 63
64 <!--阶梯团是不显示的--> 64 <!--阶梯团是不显示的-->
65 - <block wx:if="{{kt_type!=3}}"> 65 + <block wx:if="{{kt_type!=3 || is_normal==1 }}">
66 <view class="use-item" hidden='{{bn_exp_type==1}}'> 66 <view class="use-item" hidden='{{bn_exp_type==1}}'>
67 <view>使用物流:</view> 67 <view>使用物流:</view>
68 <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name"> 68 <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name">
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 </block> 91 </block>
92 92
93 <view class="information"> 93 <view class="information">
94 - <view class="item" wx:if="{{kt_type<3}}"> 94 + <view class="item" wx:if="{{kt_type<3 || is_normal==1}}">
95 <view>商品金额</view> 95 <view>商品金额</view>
96 <view class="co-red">¥ {{formData.all_price}}元</view> 96 <view class="co-red">¥ {{formData.all_price}}元</view>
97 </view> 97 </view>
pages/cart/cart_wk/cart_wk.wxml
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 </view> 83 </view>
84 <view class='ct_one jc_sb'> 84 <view class='ct_one jc_sb'>
85 <view class='ct_one_left'>支付定金</view> 85 <view class='ct_one_left'>支付定金</view>
86 - <view class='ct_one_right'>¥<text class='redwz'>{{order.order_amount+order.user_money}}</text> 86 + <view class='ct_one_right'>¥<text class='redwz'>{{filters.toFix(order.order_amount+order.user_money,2)}}</text>
87 </view> 87 </view>
88 </view> 88 </view>
89 </view> 89 </view>
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 <view class='zf'> 107 <view class='zf'>
108 <view class='zf_left'> 108 <view class='zf_left'>
109 <text class='zf_left_wz'>支付合计:</text> 109 <text class='zf_left_wz'>支付合计:</text>
110 - <text class='zf_left_red'>¥{{order.tail_money+exp_price}}</text> 110 + <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text>
111 </view> 111 </view>
112 <view class='zf_btn' bindtap="to_pay"> 112 <view class='zf_btn' bindtap="to_pay">
113 <text>支付尾款</text> 113 <text>支付尾款</text>
pages/user/add_address/add_address.js
@@ -94,15 +94,40 @@ Page({ @@ -94,15 +94,40 @@ Page({
94 }else{ 94 }else{
95 a['user_id'] = oo.user_id; 95 a['user_id'] = oo.user_id;
96 a['store_id'] = os.stoid; 96 a['store_id'] = os.stoid;
97 - //-----新增地址-------  
98 - t.post("/api/weshop/useraddress/save", {  
99 - data: a,  
100 - success: function (s) {  
101 - e.showSuccess(s.data.msg, function () {  
102 - wx.navigateBack(); 97 +
  98 +
  99 + if (a.is_default == 1) {
  100 + t.put("/api/weshop/useraddress/update", {
  101 + data: { user_id: oo.user_id, is_default: 0 },
  102 + success: function (s) {
  103 +
  104 + //-----新增地址-------
  105 + t.post("/api/weshop/useraddress/save", {
  106 + data: a,
  107 + success: function (s) {
  108 + e.showSuccess(s.data.msg, function () {
  109 + wx.navigateBack();
  110 + });
  111 + }
  112 + });
  113 +
  114 + }
  115 + })
  116 + }else{
  117 +
  118 + //-----新增地址-------
  119 + t.post("/api/weshop/useraddress/save", {
  120 + data: a,
  121 + success: function (s) {
  122 + e.showSuccess(s.data.msg, function () {
  123 + wx.navigateBack();
  124 + });
  125 + }
103 }); 126 });
104 - }  
105 - }); 127 + }
  128 +
  129 +
  130 +
106 } 131 }
107 }, 132 },
108 133
pages/user/address_list/address_list.js
@@ -6,25 +6,45 @@ Page({ @@ -6,25 +6,45 @@ Page({
6 url: e.globalData.setting.url, 6 url: e.globalData.setting.url,
7 resourceUrl: e.globalData.setting.resourceUrl, 7 resourceUrl: e.globalData.setting.resourceUrl,
8 iurl: e.globalData.setting.imghost, 8 iurl: e.globalData.setting.imghost,
9 - addresses: null,  
10 - operate: null 9 + addresses: [],
  10 + operate: null,
  11 + curpage:1,
  12 + total:0,
  13 + ismore:0,
  14 +
11 }, 15 },
12 onLoad: function(e) { 16 onLoad: function(e) {
13 this.data.operate = e.operate; 17 this.data.operate = e.operate;
14 }, 18 },
15 onShow: function() { 19 onShow: function() {
  20 + this.data.curpage=1;
  21 + this.data.addresses=[];
16 this.requestAddressList(); 22 this.requestAddressList();
17 }, 23 },
18 - onPullDownRefresh: function() {  
19 - this.requestAddressList();  
20 - },  
21 - requestAddressList: function() { 24 +
  25 +
  26 + onReachBottom: function () {
  27 + if(this.data.total<=6) return;
  28 + if(this.data.ismore) return;
  29 + this.requestAddressList();
  30 + },
  31 +
  32 + requestAddressList: function() {
  33 + var tt= Math.random() * 100
22 var e = this; 34 var e = this;
23 t.get(e.data.url + "/api/weshop/useraddress/page", { 35 t.get(e.data.url + "/api/weshop/useraddress/page", {
24 - data: { store_id: os.stoid, user_id: oo.user_id}, 36 + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage,pageSize:6,t:tt},
25 success: function(t) { 37 success: function(t) {
26 - e.setData({  
27 - addresses: t.data.data.pageData, 38 + e.data.curpage++;
  39 + var arr1 = e.data.addresses;
  40 + var arr2 = t.data.data.pageData;
  41 + var arr3 = [...arr1, ...arr2];
  42 +
  43 + var ismore=0;
  44 + if (arr3.length == t.data.data.total) ismore=1
  45 +
  46 + e.setData({
  47 + addresses: arr3, total: t.data.data.total, ismore: ismore
28 }), wx.stopPullDownRefresh(); 48 }), wx.stopPullDownRefresh();
29 } 49 }
30 }); 50 });
@@ -58,5 +78,12 @@ Page({ @@ -58,5 +78,12 @@ Page({
58 var t = this.data.addresses; 78 var t = this.data.addresses;
59 for (var s in t) if (t[s].address_id == e) break; 79 for (var s in t) if (t[s].address_id == e) break;
60 return s ? t[s] : {}; 80 return s ? t[s] : {};
  81 + },
  82 +
  83 + go_url:function(e){
  84 + var url=e.currentTarget.dataset.url;
  85 + getApp().goto(url);
61 } 86 }
  87 +
  88 +
62 }); 89 });
63 \ No newline at end of file 90 \ No newline at end of file
pages/user/address_list/address_list.wxml
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <image src="{{iurl}}/miniapp/images/address_edit.png"></image> 12 <image src="{{iurl}}/miniapp/images/address_edit.png"></image>
13 </view> 13 </view>
14 </view> 14 </view>
15 - <navigator class="address-create" url="/pages/user/add_address/add_address"> 15 + <view bindtap="go_url" class="address-create" data-url="/pages/user/add_address/add_address">
16 <view class="create-btn">+新建地址</view> 16 <view class="create-btn">+新建地址</view>
17 - </navigator> 17 + </view>
18 </view> 18 </view>
pages/user/address_list/address_list.wxss
@@ -62,14 +62,20 @@ page { @@ -62,14 +62,20 @@ page {
62 } 62 }
63 63
64 .address-create { 64 .address-create {
65 - width: 50%; 65 + background-color: #fff;
  66 + width: 100%;
66 text-align: center; 67 text-align: center;
67 position: fixed; 68 position: fixed;
68 - bottom: 80rpx;  
69 - left: 25%; 69 + bottom: 0rpx;
  70 + height: 200rpx;
  71 + border-top:1rpx solid #eee
  72 +
70 } 73 }
71 74
72 .create-btn { 75 .create-btn {
  76 + width: 50%;
  77 + margin: 0 auto;
  78 + margin-top: 60rpx;
73 font-size: 28rpx; 79 font-size: 28rpx;
74 color: white; 80 color: white;
75 background-color: #f23030; 81 background-color: #f23030;