From f1aaebab6905f0f4dfa89c430dd39a318957f0e8 Mon Sep 17 00:00:00 2001 From: cheng.xu Date: Fri, 1 Nov 2019 10:11:01 +0800 Subject: [PATCH] 购买页面 --- pages/user/plus/plus.js | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- pages/user/plus/plus.wxml | 68 ++++++++++++++++++++++++-------------------------------------------- pages/user/plus/plus.wxss | 6 ++++++ 3 files changed, 105 insertions(+), 49 deletions(-) diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index e1f9c6e..7c51f29 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -5,11 +5,12 @@ var e = function(e) { }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, - o = t.globalData.setting, + o = t.globalData.setting, os = o, i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), + w = require("../../../utils/wxParse/wxParse.js"), n = new e.default(); var regeneratorRuntime = require('../../../utils/runtime.js'); var api = require('../../../api/api.js'); @@ -23,13 +24,16 @@ Page({ images: [o.imghost + "/miniapp/images/plus/card_one.jpg", o.imghost + "/miniapp/images/plus/card_two.jpg", o.imghost + "/miniapp/images/plus/card_three.jpg"], currentId: 0, url: o.imghost, - j: false, screenWidth: 0, screenheight: 0, canvasHidden: true, shareImgPath: null, - plusCard: "", - imagePath: "" + is_plusCard: "",//卡的列表 + imagePath: "", + is_pulscardname: "",//plus会员的名字 + is_card:0,//用于判断是否是续费页和购买页面 0不是puls会员 + content:"",//等级卡规则 + is_card_rule: "",//等级卡规则判断用 }, swiperChange: function(e) { var currentId = e.detail.current; @@ -42,7 +46,30 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function(options) { + console.log(); var that = this; + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { + success: function (res) { + var user_information=res.data.data; + console.log(res, "会员个人信息"); + //判断是是不是会员 + if (user_information == null || user_information == ""){ + + } + //判断是是不是plus会员 + if (user_information.card_field == null || user_information.card_fiel == "") { + that.setData({ is_card:1}); + + } + if (user_information.card_expiredate == null || user_information.card_expiredate == ""){ + + } + + } + }); + + + //获取用户设备信息,屏幕宽度 wx.getSystemInfo({ success: res => { @@ -53,14 +80,57 @@ Page({ }) this.getPlusCardType(); this.saveImageToPhotosAlbum(); + this.puls_user(); + //-----------商家配置信息----- 等级卡规则------------ + + getApp().request.get("/api/weshop/storeconfig/get/"+ os.stoid, { + success: function (res) { + var is_cardrule=res.data.data.cardrules; + w.wxParse("content", "html", is_cardrule, that, 6); + + console.log("等级卡规则8888888888888", is_cardrule); + that.setData({ + is_card_rule: is_cardrule + }); + } + }); }, + + //-----Plus会员获取----------- + puls_user: function () { + var th = this; + getApp().request.get("/api/weshop/plus/vip/mem/list", { + data: { + storeId: os.stoid, + userId: getApp().globalData.user_id, + }, + success: function (su) { + if (su.data.code == 0) { + var cardname = su.data.data[0].MemCardName; + console.log("卡的名字", cardname); + th.setData({ pulscardname: cardname }); + } + } + }); + }, + + + + + //获取卡类 getPlusCardType: function(e) { var storid = o.stoid; var th = this; getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { + var plusCard = res.data.data; + var arr = [1219, 2089, 3031]; + for(var i = 0; i < plusCard.length;i++){ + plusCard[i].free=arr[i]; + } + th.setData({ - plusCard: res.data.data + is_plusCard: plusCard }) }) diff --git a/pages/user/plus/plus.wxml b/pages/user/plus/plus.wxml index 468cf4b..68905c5 100644 --- a/pages/user/plus/plus.wxml +++ b/pages/user/plus/plus.wxml @@ -1,8 +1,9 @@ + - + @@ -10,28 +11,30 @@ - + + - + {{item.CardName}} - 开通会员年卡仅199元 + 开通会员年卡仅{{item.CardFee}}元 - 立即开通 + 立即开通 - - - 根据大家购买数据,您成为超级会员预计可省¥2899元 + + + + 根据大家购买数据,您成为超级会员预计可省¥{{item.free}}元 @@ -40,11 +43,8 @@ + - - - - @@ -74,7 +74,7 @@ - + 已邀请 @@ -123,24 +123,13 @@ - - - - 1、 - 可以领取880元黑卡专享礼包 - - - - - - 2、 - 可以领取880元黑卡专享礼包 - + - - 3、 - 可以领取880元黑卡专享礼包 - + + + + + @@ -190,14 +179,14 @@ - + 请完善下面信息 - + @@ -205,7 +194,7 @@ - + @@ -219,7 +208,7 @@ - + @@ -228,14 +217,5 @@ - - - --> + \ No newline at end of file diff --git a/pages/user/plus/plus.wxss b/pages/user/plus/plus.wxss index c2500a2..22d930d 100644 --- a/pages/user/plus/plus.wxss +++ b/pages/user/plus/plus.wxss @@ -1,3 +1,4 @@ +@import "../../../utils/wxParse/wxParse.wxss"; page { width: 100%; height: 100%; @@ -161,6 +162,10 @@ swiper { width: 30rpx; height: 30rpx; margin-right: 5rpx; + background-size: 100% 100%; +position: relative; +left: -40rpx; + } .Membership .Opening { @@ -350,6 +355,7 @@ swiper { } input { + overflow: visible; width: 360rpx; } -- libgit2 0.21.4