Commit 640929ad4ff085bd2f8cf90818298dcfe8a22bf8

Authored by yvan.ni
1 parent 588b0234

返回的bug优化

packageA/pages/cart2_ser/cart2_ser.js
... ... @@ -137,7 +137,7 @@ Page({
137 137 good = res.data.data;
138 138 })
139 139  
140   - item.img_url = oo.imghost + good.img_url;
  140 + item.img_url = oo.imghost + good.imgUrl;
141 141 item.erpItemID=good.erpItemID;
142 142  
143 143 /*----接口要弄出来的,先顶着-----*/
... ... @@ -485,7 +485,7 @@ Page({
485 485 getApp().showWarning("购买成功");
486 486 setTimeout(function () {
487 487 wx.reLaunch({
488   - url: "/packageA/pages/cardList/cardList",
  488 + url: "/pages/user/my_service/i_service",
489 489 })
490 490 },1000)
491 491 }, function () {
... ...
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -751,9 +751,26 @@ Page({
751 751 for (var i = 0; i < e.data.data.pageData.length; i++) {
752 752 num += e.data.data.pageData[i].goods_num;
753 753 }
  754 +
  755 + /*--
754 756 t.setData({
755 757 cartGoodsNum: num
756   - });
  758 + });--*/
  759 +
  760 + //-- 读取服务卡的数量 --
  761 + getApp().promiseGet("/api/weshop/cartService/page",{
  762 + data:{
  763 + store_id: s.globalData.setting.stoid,
  764 + user_id: s.globalData.user_id,
  765 + }
  766 + }).then(res=>{
  767 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  768 + num += res.data.data.pageData[i].goods_num;
  769 + }
  770 + t.setData({cartGoodsNum:num});
  771 + })
  772 +
  773 +
757 774 }
758 775 });
759 776 },
... ...
pages/cart/cart/cart.js
... ... @@ -1799,7 +1799,7 @@ Page({
1799 1799  
1800 1800 //---加载更多是靠这个函数----
1801 1801 onReachBottom: function() {
1802   - if(this.data.requestData.length==0) {
  1802 + if(this.data.requestData && this.data.requestData.length==0) {
1803 1803 var goods_list = this.selectComponent("#goods_list"); //组件的id
1804 1804 if (goods_list) goods_list.get_list();
1805 1805 }
... ...
pages/cart/cart2/cart2.js
... ... @@ -443,7 +443,10 @@ Page({
443 443 }
444 444 var e_t=0
445 445 switch (arr[j].distr_t) {
446   - case 0: e_t = 1; break;
  446 + case 0:
  447 + e_t = 1;
  448 + if(th.data.json_d.pickupway && th.data.json_d.pickupway==1) e_t=0;
  449 + break;
447 450 case 1: e_t = 1; break;
448 451 case 2: e_t = 0; break;
449 452 }
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -158,7 +158,7 @@ Page({
158 158 var json = {
159 159 "actId": '', //活动Id
160 160 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
161   - "buyType": '1', //1=积分兑换 2=余额购买
  161 + "buyType": '1', //1=积分兑换 2=余额购买 3=免费领取
162 162 "giftBagId": id, //礼包Id
163 163 "storeId": that.getStorageID, //商家Id
164 164 "userId": that.getUserID, //用户ID
... ... @@ -169,8 +169,7 @@ Page({
169 169 if(getApp().globalData.guide_id){
170 170 json.guide_id=getApp().globalData.guide_id;
171 171 }
172   -
173   -
  172 +
174 173 var data = JSON.stringify(json);
175 174 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
176 175 getApp().request.json_post(url, json,
... ... @@ -181,15 +180,53 @@ Page({
181 180 getApp().my_warnning(res.data.msg, 0, th);
182 181 }
183 182 },
184   - function(res) {
185   -
186   - }
187   -
188   - )
  183 + function(res) {})
189 184  
190 185 })
191 186  
192 187 },
  188 + //免费领取
  189 + GetFree:function (e){
  190 + var that = this.data;
  191 + var th = this;
  192 + var id = e.currentTarget.dataset.id; //活动id
  193 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  194 + my_confirm.open(
  195 + "是否确定领取该礼包",
  196 + "取消",
  197 + "确定",
  198 + function() {
  199 + my_confirm.open_cancel(0);
  200 + },
  201 + function() {
  202 + my_confirm.open_cancel(0);
  203 + var json = {
  204 + "actId": '', //活动Id
  205 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  206 + "buyType": '3', //1=积分兑换 2=余额购买 3=免费领取
  207 + "giftBagId": id, //礼包Id
  208 + "storeId": that.getStorageID, //商家Id
  209 + "userId": that.getUserID, //用户ID
  210 + "buyFrom": 2
  211 + };
  212 + //-- 分享导购要记录 --
  213 + if(getApp().globalData.guide_id){
  214 + json.guide_id=getApp().globalData.guide_id;
  215 + }
  216 + var data = JSON.stringify(json);
  217 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  218 + getApp().request.json_post(url, json,
  219 + function(res) {
  220 + if (res.data.code == 0) {
  221 + getApp().my_warnning("兑换成功!", 1, th);
  222 + } else {
  223 + getApp().my_warnning(res.data.msg, 0, th);
  224 + }
  225 + },
  226 + function(res) {})
  227 + })
  228 + },
  229 +
193 230 getList: function(e) {
194 231 var th = this;
195 232 getApp().request.get('/api/weshop/marketing/giftbag/page', {
... ...
pages/giftpack/buygiftpack/giftpackbuy.wxml
... ... @@ -84,6 +84,12 @@
84 84 </view>
85 85 </block>
86 86 </block>
  87 + <block wx:if="{{!items.payMoney && !items.payIntegral}}">
  88 + <view class="flex" bindtap="GetFree" data-id="{{items.lbId}}">
  89 + <button class="box_button_dui box_button_buy">免费领取</button>
  90 + </view>
  91 + </block>
  92 +
87 93 </view>
88 94 </view>
89 95 </view>
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -202,6 +202,7 @@ Page({
202 202  
203 203  
204 204 },
  205 +
205 206 GetMyGiftList: function() {
206 207 var _this = this;
207 208 var th = this;
... ... @@ -419,6 +420,61 @@ Page({
419 420 }
420 421 },
421 422  
  423 + //免费领取
  424 + GetFree: function(e) {
  425 + var that = this.data;
  426 + var th = this;
  427 +
  428 + //如果还没有开始的话
  429 + if(th.data.isStart!=1){
  430 + getApp().my_warnning("活动还没有开始", 0, th);
  431 + return false;
  432 + }
  433 + // var id = e.currentTarget.dataset.id;//活动id
  434 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  435 + my_confirm.open(
  436 + "是否确定领取该礼包",
  437 + "取消",
  438 + "确定",
  439 + function() {
  440 + my_confirm.open_cancel(0);
  441 + },
  442 + function() {
  443 + my_confirm.open_cancel(0);
  444 + var json = {
  445 + "actId": '', //活动Id
  446 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  447 + "buyType": '3', //1=积分兑换 2=余额购买
  448 + "giftBagId": that.getGiftID, //礼包Id
  449 + "storeId": a.stoid, //商家ID
  450 + "userId": d.user_id, //用户ID
  451 + "buyFrom":2
  452 + };
  453 +
  454 + //-- 分享导购要记录 --
  455 + if(getApp().globalData.guide_id){
  456 + json.guide_id=getApp().globalData.guide_id;
  457 + }
  458 +
  459 +
  460 + var data = JSON.stringify(json);
  461 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  462 + getApp().request.json_post(url, json,
  463 + function(res) {
  464 + if (res.data.code == 0) {
  465 + getApp().my_warnning("兑换成功!", 1, th);
  466 + } else {
  467 + getApp().my_warnning(res.data.msg, 0, th);
  468 + }
  469 + },
  470 + function(res) {}
  471 +
  472 + )
  473 + })
  474 +
  475 +
  476 + },
  477 +
422 478  
423 479  
424 480 });
425 481 \ No newline at end of file
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -117,12 +117,10 @@
117 117 <block wx:if="{{isBuy==1 && giftTitle}}">
118 118 <block wx:if="{{isStart==1}}">
119 119 <view class="foot_button data-v-3a5b7e36">
120   - <block wx:if="{{giftPrice>0&&giftIntegral>0}}">
  120 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
121 121 <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
122 122 <text class="data-v-3a5b7e36 ">立即购买</text>
123 123 </view>
124   - </block>
125   - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
126 124 <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
127 125 <text class="data-v-3a5b7e36">立即兑换</text>
128 126 </view>
... ... @@ -137,6 +135,14 @@
137 135 <text class="data-v-3a5b7e36">立即兑换</text>
138 136 </view>
139 137 </block>
  138 +
  139 + <block wx:if="{{giftPrice<=0 && giftIntegral<=0}}">
  140 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}">
  141 + <text class="data-v-3a5b7e36">免费领取</text>
  142 + </view>
  143 + </block>
  144 +
  145 +
140 146 </view>
141 147 </block>
142 148 <block wx:else>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1748,13 +1748,14 @@ Page({
1748 1748 callback();
1749 1749 return false;
1750 1750 }
  1751 +
1751 1752 ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1
1752 1753 getApp().promiseGet("/api/weshop/order/getWPayOrder",{
1753 1754 data:{store_id:os.stoid,user_id:usr.user_id,goods_id:th.data.sele_g.goods_id,prom_id:th.data.prom_goods[0].prom_id}
1754 1755 }).then(res=>{
1755 1756 if(res.data.code==0){
1756 1757 wx.showToast({
1757   - title: "您还有该商品订单未支付",
  1758 + title: "您已经购买了该商品待支付中",
1758 1759 icon: 'none',
1759 1760 duration: 2000
1760 1761 })
... ... @@ -1926,9 +1927,19 @@ Page({
1926 1927 for (var i = 0; i < e.data.data.pageData.length; i++) {
1927 1928 num += e.data.data.pageData[i].goods_num;
1928 1929 }
1929   - t.setData({
1930   - cartGoodsNum: num
1931   - });
  1930 +
  1931 + //-- 读取服务卡的数量 --
  1932 + getApp().promiseGet("/api/weshop/cartService/page",{
  1933 + data:{
  1934 + store_id: s.globalData.setting.stoid,
  1935 + user_id: s.globalData.user_id,
  1936 + }
  1937 + }).then(res=>{
  1938 + for (var i = 0; i < res.data.data.pageData.length; i++) {
  1939 + num += res.data.data.pageData[i].goods_num;
  1940 + }
  1941 + t.setData({cartGoodsNum:num});
  1942 + })
1932 1943 }
1933 1944 });
1934 1945 },
... ...
pages/user/plus/plus.js
... ... @@ -170,13 +170,14 @@ Page({
170 170 var plusCard = res.data.data;
171 171 var arr = [1219, 2089, 3031];
172 172 var new_arr = new Array();
  173 + var parr=[];
173 174 for (var i = 0; i < plusCard.length; i++) {
174 175 //plusCard[i].free=arr[i];
175 176 if(plusCard[i].IsStopBuy) { continue; }
176 177 if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg"+(i + 1)+ ".jpg?v=1";
177 178 var item = {"fee": plusCard[i].CardFee, 'index': i}
178 179 new_arr.push(item);
179   -
  180 + parr.push(plusCard[i]);
180 181 }
181 182  
182 183 //看是不是还有卡项是可以购买的
... ... @@ -200,17 +201,17 @@ Page({
200 201 }
201 202  
202 203 //---给数组添加立省多少钱---
203   - for (i = 0; i < plusCard.length; i++) {
  204 + for (i = 0; i < parr.length; i++) {
204 205 //判断是否停用
205 206 for (var j = 0; j < new_arr.length; j++) {
206 207 if (i == new_arr[j].index) {
207   - plusCard[i].free = arr[j];
  208 + parr[i].free = arr[j];
208 209 break;
209 210 }
210 211 }
211 212 }
212 213 th.setData({
213   - is_plusCard: plusCard, is_show: 1
  214 + is_plusCard: parr, is_show: 1
214 215 })
215 216  
216 217 }else{
... ...
pages/user/plus/plus.wxml
... ... @@ -17,7 +17,7 @@
17 17 <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="60rpx" previous-margin="60rpx" bindchange="swiperChange">
18 18 <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}">
19 19  
20   - <view wx:if="{{item.IsStopBuy!=true}}" class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}">
  20 + <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}">
21 21 <view class="flex-space-between Membership_go">
22 22 <view>
23 23 <view class="fs36">{{item.CardName}}</view>
... ...