Commit d75dc8e51b508531ba34348fdb95c93479d98579

Authored by 后端研发-苏明海
2 parents 6d1c1824 4aeb62c5

Merge branch 'test' into 'qa'

Test

See merge request !881
packageB/pages/zuhegou/list/list.js
... ... @@ -127,46 +127,26 @@ Page({
127 127 if(!this.data.ismore) return false;
128 128  
129 129 var e = this,th=e, i = "/api/weshop/prom/zhbuy/page?is_end=0&timetype=1&page=" + e.data.currentPage;
130   - var plist=null,alllist=th.data.goodlist;
131   - if(!alllist) alllist=[];
132   -
133   - await getApp().request.promiseGet(i,
134   - {isShowLoading:1,data:{store_id:os.stoid,user_id:getApp().globalData.user_id}}
135   - ).then(res=>{
136   - plist=res.data.data.pageData;
137   - console.log("是什么即将开始",plist);
138   - });
139   -
140   - if(plist.length<=0) {
141   -
  130 + // var plist=null,alllist=th.data.goodlist;
  131 + // if(!alllist) alllist=[];
  132 + let {goodlist}=this.data;
  133 + const {data:res}=await getApp().request.promiseGet(i,{
  134 + isShowLoading:1,
  135 + data:{store_id:os.stoid,user_id:getApp().globalData.user_id}
  136 + })
  137 + if(res.code==0 && res.data.pageData.length>0){
  138 + if(res.data.page>1){
  139 + goodlist=goodlist.concat(res.data.pageData)
  140 + }else{
  141 + goodlist=res.data.pageData;
  142 + }
  143 +
  144 + }else{
142 145 getApp().showWarning("没有更多数据");
143 146 th.data.ismore=0;
144   - if(e.data.currentPage==1 && this.data.type==1){
145   - // setTimeout(function () {
146   - // th.data.ismore=1;
147   - // th.setData({type:0});
148   - // th.requestSalelist();
149   - // },1000);
150   - }
151   - return false;
152 147 }
153   -
154   - //--循环读取接口---
155   - // for(var i=0;i<plist.length;i++) {
156   - // var prom_id = plist[i].id;
157   - // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
158   - // os.stoid + "/1/" + prom_id, {}
159   - // ).then(res=>{
160   - // if(res.data.code==0){
161   - // plist[i].status=1;
162   - // if(res.data.data<=0) plist[i].status=3;
163   - // }
164   - // })
165   - // alllist.push(plist[i]);
166   - // }
167 148 e.data.currentPage++;
168   - // console.log("秒杀商品列表", alllist);
169   - th.setData({goodlist:plist,isshow:1});
  149 + th.setData({goodlist,isshow:1});
170 150  
171 151 },
172 152 onPullDownRefresh: function() {
... ...
pages/goods/goodsInfo/g_filter.wxs
... ... @@ -93,7 +93,8 @@ var g_filters = {
93 93 //折扣数值处理,小数位数为1时,只显示1位;小数位数为2时,才显示2位;
94 94 num: function(value) {
95 95 if(value != 0) {
96   - return parseFloat(value);
  96 + var r=value.toFixed(2)+"";
  97 + return parseFloat(r);
97 98 } else {
98 99 return value.toFixed(0);
99 100 };
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1072,8 +1072,6 @@ Page({
1072 1072 }
1073 1073 },
1074 1074  
1075   -
1076   -
1077 1075 //-- 加入购物的函数 --
1078 1076 add_cart_func_inte: function (t) {
1079 1077 var i = getApp().request;
... ... @@ -1169,8 +1167,11 @@ Page({
1169 1167 if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
1170 1168 if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
1171 1169  
1172   -
1173   - th.add_cart_next(e, t, a, o, newd); //立即购买下一步
  1170 + var i_canbuy=th.data.prom_act.limitqty-th.data.prom_act.buy_num;
  1171 + if(i_canbuy<e.data.goodsInputNum){
  1172 + return s.my_warnning("活动库存不足!", 0, th);
  1173 + }
  1174 + th.add_cart_next(e, t, a, o, newd); //立即购买下一步
1174 1175  
1175 1176 })
1176 1177 },
... ... @@ -1205,7 +1206,7 @@ Page({
1205 1206 }
1206 1207 }
1207 1208 //---判断商品是否超出活动限购---
1208   - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1209 + if((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) {
1209 1210 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
1210 1211 wx.showModal({
1211 1212 title: '提示',
... ... @@ -1669,7 +1670,7 @@ Page({
1669 1670 }
1670 1671 }
1671 1672  
1672   - if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  1673 + if((th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) && !th.data.is_normal) {
1673 1674 var redis_num = 0;
1674 1675 //------判断活动是否抢光-----
1675 1676 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
... ... @@ -1715,7 +1716,7 @@ Page({
1715 1716 checkCartNum_inte: function (t) {
1716 1717 var th = this;
1717 1718 this.get_buy_num(this.data.data, async function () {
1718   -
  1719 + ;
1719 1720 //--判断商品是否超出限购--
1720 1721 if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
1721 1722  
... ... @@ -1764,7 +1765,18 @@ Page({
1764 1765 th.setData({ goodsInputNum: redis_num })
1765 1766 return false;
1766 1767 }
  1768 + }
1767 1769  
  1770 +
  1771 + //判断积分购库存
  1772 + if(!th.data.is_normal && th.data.prom_type==4){
  1773 + var i_canbuy=th.data.prom_act.limitqty-th.data.prom_act.buy_num;
  1774 + if(t>i_canbuy){
  1775 + wx.showModal({
  1776 + title: '超出商品活动库存',
  1777 + });
  1778 + return false;
  1779 + }
1768 1780 }
1769 1781  
1770 1782 var e = th.data.sele_g.store_count;
... ... @@ -2424,7 +2436,7 @@ Page({
2424 2436 th.setData({
2425 2437 prom_type: goodsinfo.prom_type,
2426 2438 prom_price: prom.price,
2427   - prom_buy_limit: prom.buy_limit,
  2439 + prom_buy_limit: prom.buy_limit?prom.buy_limit:(prom.limitvipqty? prom.limitvipqty:0),
2428 2440 prom_end_time: prom.end_time,
2429 2441 prom_start_time: prom.start_time,
2430 2442 prom_st: prom_st,
... ... @@ -3606,7 +3618,7 @@ Page({
3606 3618 gd.prom_type= 0;
3607 3619 }
3608 3620  
3609   - if (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6) {
  3621 + if (!th.data.is_normal && ( gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6)) {
3610 3622 //----获取活动购买数----
3611 3623 getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", {
3612 3624 data: {
... ... @@ -3679,8 +3691,14 @@ Page({
3679 3691  
3680 3692 var th = this;
3681 3693 var ind = parseInt(e.currentTarget.dataset.it);
  3694 +
3682 3695 //如果是拼单活动的普通购买
3683 3696 if (ind == 1) {
  3697 +
  3698 + if(!th.data.is_normal) {
  3699 + th.data.g_buy_num=new Map();
  3700 + }
  3701 +
3684 3702 //如果拼单的sku data是空的,就要先获取一下
3685 3703 if (th.data.sku_g_pt) {
3686 3704 th.get_sto(1);
... ... @@ -3700,6 +3718,10 @@ Page({
3700 3718 th.check_is_youhui(th.data.gid, 1);
3701 3719 } else {
3702 3720  
  3721 + if(th.data.is_normal) {
  3722 + th.data.g_buy_num=new Map();
  3723 + }
  3724 +
3703 3725 //拼单商品从这里进,先判断有没有买过商品,
3704 3726 getApp().request.get("/api/weshop/order/page", {
3705 3727 data: {
... ... @@ -5795,11 +5817,16 @@ Page({
5795 5817  
5796 5818 //-- 积分购 --
5797 5819 go_pay_integral: function () {
  5820 + this.data.g_buy_num = new Map();
5798 5821 this.get_sto(0)
5799 5822 this.setData({ openSpecModal_inte: 1, goodsInputNum: 1 });
  5823 +
  5824 +
5800 5825 },
5801 5826 //-- 积分购普通购买 --
5802 5827 go_pay_integral_normal: function () {
  5828 +
  5829 + this.data.g_buy_num = new Map();
5803 5830 var th = this;
5804 5831 if (th.data.sku_g_pt) {
5805 5832 this.get_sto(1)
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -435,11 +435,12 @@
435 435 <view class="goods-name elli">{{data.goods_name}}</view>
436 436 </view>
437 437 </view>
438   -
439   -
  438 +
  439 + -- 88888 --
  440 +
440 441 <view class="goods-num" wx:if="{{prom_type!=1 && prom_type!=2}}">
441 442 <view class="sales">销量:{{data.sales_sum}}件</view>
442   - <view class="stock">折扣:{{data.disc}}折</view>
  443 + <view class="stock">折扣:{{g_filters.num(data.disc)}}折</view>
443 444 <view class="stock">{{categories3[0].num}}人评价</view>
444 445 </view>
445 446  
... ... @@ -587,7 +588,7 @@
587 588 </view>
588 589 <!-- 要判断是不是有促销活动 -->
589 590 <block wx:if="{{prom_goods}}">
590   - <view class="cx-frame flex" style="position: relative; height: auto">
  591 + <view class="cx-frame flex" style="position: relative; height: auto" hidden="{{prom_type==4 || prom_type==6}}">
591 592 <view class="cx-sizs fs30">促销</view>
592 593 <!-- 中间显示层 -->
593 594 <view class="f1 pdh20">
... ...