Commit 640929ad4ff085bd2f8cf90818298dcfe8a22bf8

Authored by yvan.ni
1 parent 588b0234

返回的bug优化

packageA/pages/cart2_ser/cart2_ser.js
@@ -137,7 +137,7 @@ Page({ @@ -137,7 +137,7 @@ Page({
137 good = res.data.data; 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 item.erpItemID=good.erpItemID; 141 item.erpItemID=good.erpItemID;
142 142
143 /*----接口要弄出来的,先顶着-----*/ 143 /*----接口要弄出来的,先顶着-----*/
@@ -485,7 +485,7 @@ Page({ @@ -485,7 +485,7 @@ Page({
485 getApp().showWarning("购买成功"); 485 getApp().showWarning("购买成功");
486 setTimeout(function () { 486 setTimeout(function () {
487 wx.reLaunch({ 487 wx.reLaunch({
488 - url: "/packageA/pages/cardList/cardList", 488 + url: "/pages/user/my_service/i_service",
489 }) 489 })
490 },1000) 490 },1000)
491 }, function () { 491 }, function () {
packageA/pages/goodsInfo/goodsInfo.js
@@ -751,9 +751,26 @@ Page({ @@ -751,9 +751,26 @@ Page({
751 for (var i = 0; i < e.data.data.pageData.length; i++) { 751 for (var i = 0; i < e.data.data.pageData.length; i++) {
752 num += e.data.data.pageData[i].goods_num; 752 num += e.data.data.pageData[i].goods_num;
753 } 753 }
  754 +
  755 + /*--
754 t.setData({ 756 t.setData({
755 cartGoodsNum: num 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,7 +1799,7 @@ Page({
1799 1799
1800 //---加载更多是靠这个函数---- 1800 //---加载更多是靠这个函数----
1801 onReachBottom: function() { 1801 onReachBottom: function() {
1802 - if(this.data.requestData.length==0) { 1802 + if(this.data.requestData && this.data.requestData.length==0) {
1803 var goods_list = this.selectComponent("#goods_list"); //组件的id 1803 var goods_list = this.selectComponent("#goods_list"); //组件的id
1804 if (goods_list) goods_list.get_list(); 1804 if (goods_list) goods_list.get_list();
1805 } 1805 }
pages/cart/cart2/cart2.js
@@ -443,7 +443,10 @@ Page({ @@ -443,7 +443,10 @@ Page({
443 } 443 }
444 var e_t=0 444 var e_t=0
445 switch (arr[j].distr_t) { 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 case 1: e_t = 1; break; 450 case 1: e_t = 1; break;
448 case 2: e_t = 0; break; 451 case 2: e_t = 0; break;
449 } 452 }
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -158,7 +158,7 @@ Page({ @@ -158,7 +158,7 @@ Page({
158 var json = { 158 var json = {
159 "actId": '', //活动Id 159 "actId": '', //活动Id
160 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 160 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
161 - "buyType": '1', //1=积分兑换 2=余额购买 161 + "buyType": '1', //1=积分兑换 2=余额购买 3=免费领取
162 "giftBagId": id, //礼包Id 162 "giftBagId": id, //礼包Id
163 "storeId": that.getStorageID, //商家Id 163 "storeId": that.getStorageID, //商家Id
164 "userId": that.getUserID, //用户ID 164 "userId": that.getUserID, //用户ID
@@ -169,8 +169,7 @@ Page({ @@ -169,8 +169,7 @@ Page({
169 if(getApp().globalData.guide_id){ 169 if(getApp().globalData.guide_id){
170 json.guide_id=getApp().globalData.guide_id; 170 json.guide_id=getApp().globalData.guide_id;
171 } 171 }
172 -  
173 - 172 +
174 var data = JSON.stringify(json); 173 var data = JSON.stringify(json);
175 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; 174 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
176 getApp().request.json_post(url, json, 175 getApp().request.json_post(url, json,
@@ -181,15 +180,53 @@ Page({ @@ -181,15 +180,53 @@ Page({
181 getApp().my_warnning(res.data.msg, 0, th); 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 getList: function(e) { 230 getList: function(e) {
194 var th = this; 231 var th = this;
195 getApp().request.get('/api/weshop/marketing/giftbag/page', { 232 getApp().request.get('/api/weshop/marketing/giftbag/page', {
pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -84,6 +84,12 @@ @@ -84,6 +84,12 @@
84 </view> 84 </view>
85 </block> 85 </block>
86 </block> 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 </view> 93 </view>
88 </view> 94 </view>
89 </view> 95 </view>
pages/giftpack/giftpacklist/giftpacklist.js
@@ -202,6 +202,7 @@ Page({ @@ -202,6 +202,7 @@ Page({
202 202
203 203
204 }, 204 },
  205 +
205 GetMyGiftList: function() { 206 GetMyGiftList: function() {
206 var _this = this; 207 var _this = this;
207 var th = this; 208 var th = this;
@@ -419,6 +420,61 @@ Page({ @@ -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 \ No newline at end of file 481 \ No newline at end of file
pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -117,12 +117,10 @@ @@ -117,12 +117,10 @@
117 <block wx:if="{{isBuy==1 && giftTitle}}"> 117 <block wx:if="{{isBuy==1 && giftTitle}}">
118 <block wx:if="{{isStart==1}}"> 118 <block wx:if="{{isStart==1}}">
119 <view class="foot_button data-v-3a5b7e36"> 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 <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> 121 <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
122 <text class="data-v-3a5b7e36 ">立即购买</text> 122 <text class="data-v-3a5b7e36 ">立即购买</text>
123 </view> 123 </view>
124 - </block>  
125 - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">  
126 <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> 124 <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
127 <text class="data-v-3a5b7e36">立即兑换</text> 125 <text class="data-v-3a5b7e36">立即兑换</text>
128 </view> 126 </view>
@@ -137,6 +135,14 @@ @@ -137,6 +135,14 @@
137 <text class="data-v-3a5b7e36">立即兑换</text> 135 <text class="data-v-3a5b7e36">立即兑换</text>
138 </view> 136 </view>
139 </block> 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 </view> 146 </view>
141 </block> 147 </block>
142 <block wx:else> 148 <block wx:else>
pages/goods/goodsInfo/goodsInfo.js
@@ -1748,13 +1748,14 @@ Page({ @@ -1748,13 +1748,14 @@ Page({
1748 callback(); 1748 callback();
1749 return false; 1749 return false;
1750 } 1750 }
  1751 +
1751 ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1 1752 ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1
1752 getApp().promiseGet("/api/weshop/order/getWPayOrder",{ 1753 getApp().promiseGet("/api/weshop/order/getWPayOrder",{
1753 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 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 }).then(res=>{ 1755 }).then(res=>{
1755 if(res.data.code==0){ 1756 if(res.data.code==0){
1756 wx.showToast({ 1757 wx.showToast({
1757 - title: "您还有该商品订单未支付", 1758 + title: "您已经购买了该商品待支付中",
1758 icon: 'none', 1759 icon: 'none',
1759 duration: 2000 1760 duration: 2000
1760 }) 1761 })
@@ -1926,9 +1927,19 @@ Page({ @@ -1926,9 +1927,19 @@ Page({
1926 for (var i = 0; i < e.data.data.pageData.length; i++) { 1927 for (var i = 0; i < e.data.data.pageData.length; i++) {
1927 num += e.data.data.pageData[i].goods_num; 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,13 +170,14 @@ Page({
170 var plusCard = res.data.data; 170 var plusCard = res.data.data;
171 var arr = [1219, 2089, 3031]; 171 var arr = [1219, 2089, 3031];
172 var new_arr = new Array(); 172 var new_arr = new Array();
  173 + var parr=[];
173 for (var i = 0; i < plusCard.length; i++) { 174 for (var i = 0; i < plusCard.length; i++) {
174 //plusCard[i].free=arr[i]; 175 //plusCard[i].free=arr[i];
175 if(plusCard[i].IsStopBuy) { continue; } 176 if(plusCard[i].IsStopBuy) { continue; }
176 if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg"+(i + 1)+ ".jpg?v=1"; 177 if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg"+(i + 1)+ ".jpg?v=1";
177 var item = {"fee": plusCard[i].CardFee, 'index': i} 178 var item = {"fee": plusCard[i].CardFee, 'index': i}
178 new_arr.push(item); 179 new_arr.push(item);
179 - 180 + parr.push(plusCard[i]);
180 } 181 }
181 182
182 //看是不是还有卡项是可以购买的 183 //看是不是还有卡项是可以购买的
@@ -200,17 +201,17 @@ Page({ @@ -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 for (var j = 0; j < new_arr.length; j++) { 206 for (var j = 0; j < new_arr.length; j++) {
206 if (i == new_arr[j].index) { 207 if (i == new_arr[j].index) {
207 - plusCard[i].free = arr[j]; 208 + parr[i].free = arr[j];
208 break; 209 break;
209 } 210 }
210 } 211 }
211 } 212 }
212 th.setData({ 213 th.setData({
213 - is_plusCard: plusCard, is_show: 1 214 + is_plusCard: parr, is_show: 1
214 }) 215 })
215 216
216 }else{ 217 }else{
pages/user/plus/plus.wxml
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="60rpx" previous-margin="60rpx" bindchange="swiperChange"> 17 <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="60rpx" previous-margin="60rpx" bindchange="swiperChange">
18 <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}"> 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 <view class="flex-space-between Membership_go"> 21 <view class="flex-space-between Membership_go">
22 <view> 22 <view>
23 <view class="fs36">{{item.CardName}}</view> 23 <view class="fs36">{{item.CardName}}</view>