diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index 4c67c3f..0e858a4 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -57,6 +57,7 @@ Component({ var item = {}; goodsidlist+=val.goodsid+","; }) + goodsidlist=ut.sub_last(goodsidlist); //--调用接口,读取秒杀-- app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" diff --git a/components/my_confirm/my_confirm.js b/components/my_confirm/my_confirm.js index de6129e..dd401fb 100644 --- a/components/my_confirm/my_confirm.js +++ b/components/my_confirm/my_confirm.js @@ -29,10 +29,13 @@ Component({ }) }, go_sure: function() { - this.data.success(); + this.setData({ yu_e_show: 0}) + if(this.data.success) this.data.success(); + }, go_cancle: function() { - this.data.cancle(); + this.setData({ yu_e_show: 0}) + if(this.data.cancle) this.data.cancle(); }, close_yu_e: function() { this.setData({ diff --git a/components/my_confirm/my_confirm.wxml b/components/my_confirm/my_confirm.wxml index 00f519b..d82fc15 100644 --- a/components/my_confirm/my_confirm.wxml +++ b/components/my_confirm/my_confirm.wxml @@ -4,7 +4,7 @@ - {{title}} + {{title}} {{s_text}} {{c_text}} diff --git a/components/my_confirm/my_confirm.wxss b/components/my_confirm/my_confirm.wxss index aa124ba..f05f462 100644 --- a/components/my_confirm/my_confirm.wxss +++ b/components/my_confirm/my_confirm.wxss @@ -40,7 +40,7 @@ } .xc-qr-frame{ width:560rpx; - height: 280rpx; + min-zoom: 280rpx; background: #fff; z-index: 55; position: fixed; diff --git a/pages/user/cardinfo/cardinfo.js b/pages/user/cardinfo/cardinfo.js index dbb9a0f..ca417c9 100644 --- a/pages/user/cardinfo/cardinfo.js +++ b/pages/user/cardinfo/cardinfo.js @@ -42,7 +42,8 @@ Page({ expiryDate:"",//卡到期时间 is_guoqi:0, //卡是不是过期 IsStopBuy:0, //卡是否停用 - yu_e_show:0,//装入余额的弹窗 + yu_e_show:0,//装入余额的弹窗 + is_show_change_pop:0, }, /** @@ -70,23 +71,37 @@ Page({ //----------------------------获取最大的卡类----------------------- getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { - }).then(res => { var plusCard = res.data.data; var big_cards = null,big_card=null; - console.log(plusCard, "数据什么的", res); + if(!plusCard) return false; + + var new_card_arr=[]; for (var i = 0; i < plusCard.length; i++) { if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; - big_cards = Math.max(plusCard[i].CardFee) - if (plusCard[i].CardFee == big_cards) { - big_card = plusCard[i] + //big_cards = Math.max(plusCard[i].CardFee) + //if (plusCard[i].CardFee == big_cards) { + // big_card = plusCard[i] + //} + if(!plusCard[i].IsStopBuy) { + new_card_arr.push(plusCard[i]); } } - - console.log(big_cards, "是什么东西", big_card); + + //对比函数 + var compare = function (obj1, obj2) { + var val1 = obj1.CardFee;var val2 = obj2.CardFee; + if (val1 > val2) { + return -1; + }else if (val1 < val2) { + return 1; + }else{ return 0; } + } + new_card_arr.sort(compare); + big_card= new_card_arr[0]; ee.setData({ - is_plusCard: plusCard, - big_card: big_card + is_plusCard: new_card_arr, + big_card: big_card, }) //缓存分享卡的图片 @@ -101,7 +116,6 @@ Page({ }) - //获取用户设备信息,屏幕宽度 wx.getSystemInfo({ success: res => { @@ -138,12 +152,46 @@ Page({ end = Date.parse(end) / 1000; var is_guoqi=0; if(endparseFloat(cur_card.CardFee)){ + new_buy_list.push(item); + } + } + } + } + + if(new_buy_list.length>0){ + th.setData({buy_list:new_buy_list}); + } + } + + },1800) + }) //-----------会员分佣------------------- @@ -155,7 +203,6 @@ Page({ }else{ ee.setData({ free: 0 }); } - }) //-----------会员的卡类------------------- await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, { @@ -164,12 +211,10 @@ Page({ if (user_card.CardImg==""){ var index =parseInt(user_card.CorrPrice.replace("Price","")); user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1"; - } if (user_card.IsStopBuy==true){ this.setData({IsStopBuy:1}) } - console.log(user_card,"会员的卡类"); ee.setData({user_card: user_card}); @@ -736,9 +781,9 @@ Page({ return false; } - end_time=ut.format(end_time,'yyyy-MM-dd'); var errmsg=""; + //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", { data: { storeId: os.stoid,isRenewal:1,endData: end_time,userId:getApp().globalData.user_id} }).then(res => { @@ -746,7 +791,10 @@ Page({ else errmsg=res.data.msg; }) - if (is_card == 0){ getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th);} + if (is_card == 0){ + getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th); + return false; + } var item = th.data.user_card; var req = {}; @@ -764,6 +812,64 @@ Page({ //--支付成功,跳转到等级卡续费页面-- success:function () { getApp().my_warnning("支付成功",0,this); + this.init(); }, + + + //------计算俩种卡的------ + change_card:async function (e) { + var th = this,card_id =e.currentTarget.dataset.cid ,end_time=0; + await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", + {1:1}).then(res => { + if (res.data.code == 0) { + end_time=res.data.data.pageData[0].end_time; + } + }) + var now=ut.gettimestamp(); + if(end_time { + if (res.data.code == 0) { + my_con.open("\n 温馨提示,高于当前等级,是否立即升级!\n\n 升级价格:¥"+ res.data.data.payMoney.toFixed(2)+" \n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null) + } + }) + } + + }, + + sure_pay:function () { + var th=this; + var req = {}; + req.cardId = th.data.s_card_id; + req.rechargeType = 5; + //如果不是你导购,也不是等级会员分享 + req.storeId = os.stoid; + req.oldCardId=th.data.user_card.CardId; + req.userId = getApp().globalData.user_id; + t_pay.pay(req, th.success, function () { + getApp().my_warnning("支付失败", 0, th); + }); + }, + //显示弹出框 + show_change:function () { this.setData({is_show_change_pop:1}); } + + + }) \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.json b/pages/user/cardinfo/cardinfo.json index 9d1ba78..393a432 100644 --- a/pages/user/cardinfo/cardinfo.json +++ b/pages/user/cardinfo/cardinfo.json @@ -2,8 +2,9 @@ "usingComponents": { "pop_txt": "/components/userqy_pop_up/userqy_pop_up", "goods_recommend": "/components/goods_list/goods_list", - "warn": "/components/long_warn/long_warn", - "nav_box": "/components/nav_box_card/nav_box" + "warn": "/components/long_warn/long_warn", + "nav_box": "/components/nav_box_card/nav_box", + "my_confirm": "/components/my_confirm/my_confirm" }, "navigationBarTitleText": "plus会员" } \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.wxml b/pages/user/cardinfo/cardinfo.wxml index aeeb1af..79b9a00 100644 --- a/pages/user/cardinfo/cardinfo.wxml +++ b/pages/user/cardinfo/cardinfo.wxml @@ -17,8 +17,20 @@ 会员将在{{filters.replace_time2(expiryDate)}}到期 会员已在{{filters.replace_time2(expiryDate)}}过期 - 立即续费 - + + + 立即续费 + + + 卡类变更 + + + + 卡类升级 + + + + @@ -147,4 +159,28 @@ - \ No newline at end of file + + + + + + + + + + + + + {{item.CardName}} + + + {{item.CardFee}} + 立即变更 + 立即升级 + + + + + + + \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.wxss b/pages/user/cardinfo/cardinfo.wxss index 0f83393..e4f3bac 100644 --- a/pages/user/cardinfo/cardinfo.wxss +++ b/pages/user/cardinfo/cardinfo.wxss @@ -225,4 +225,17 @@ align-items:center; width: 100%; height: 320rpx; -} \ No newline at end of file +} + +.content{ position: fixed; top: 0;left:0; width: 100%; height: 100%; z-index: 12; } +.content .card_list{ width: 700rpx; margin: 0 auto; background-color: #ffe88b; border-radius: 15rpx} +.content .card_list .hg{ width: 100%;height: 156rpx} + +.content .card_list .list{ max-height: 700rpx; padding: 0 25rpx; margin-bottom: 20rpx; overflow-y: auto} +.content .card_list .item{ margin-bottom: 10rpx; background: #fff; height: 150rpx; border-radius: 10rpx} +.content .card_list .item .hg_img{ width: 70rpx; height: 60rpx; margin-left: 40rpx; margin-right: 20rpx } +.content .card_list .item .price_show{ width: 200rpx; height: 110rpx; background: #ffd430; + border-top-left-radius: 55rpx; border-bottom-left-radius:55rpx; } + .content .card_list .list .card_name{ max-width: 230rpx} + + .price_show .thr{color: #999; text-decoration:line-through } \ No newline at end of file diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index c428acd..135e67a 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -312,7 +312,8 @@ Page({ //--支付成功,跳转到等级卡续费页面-- success:function () { - + var u_url = "/pages/user/cardinfo/cardinfo"; + wx.reLaunch({url: u_url}) }, //--绑定邀请码的输入--