Commit f1aaebab6905f0f4dfa89c430dd39a318957f0e8
1 parent
6428c9c0
购买页面
Showing
3 changed files
with
105 additions
and
49 deletions
pages/user/plus/plus.js
| @@ -5,11 +5,12 @@ var e = function(e) { | @@ -5,11 +5,12 @@ var e = function(e) { | ||
| 5 | }(require("../../../utils/LoadMore.js")), | 5 | }(require("../../../utils/LoadMore.js")), |
| 6 | t = getApp(), | 6 | t = getApp(), |
| 7 | a = t.request, | 7 | a = t.request, |
| 8 | - o = t.globalData.setting, | 8 | + o = t.globalData.setting, |
| 9 | os = o, | 9 | os = o, |
| 10 | i = require("../../../utils/util.js"), | 10 | i = require("../../../utils/util.js"), |
| 11 | ut = i, | 11 | ut = i, |
| 12 | s = require("../../../utils/common.js"), | 12 | s = require("../../../utils/common.js"), |
| 13 | + w = require("../../../utils/wxParse/wxParse.js"), | ||
| 13 | n = new e.default(); | 14 | n = new e.default(); |
| 14 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 15 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 15 | var api = require('../../../api/api.js'); | 16 | var api = require('../../../api/api.js'); |
| @@ -23,13 +24,16 @@ Page({ | @@ -23,13 +24,16 @@ Page({ | ||
| 23 | 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"], | 24 | 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"], |
| 24 | currentId: 0, | 25 | currentId: 0, |
| 25 | url: o.imghost, | 26 | url: o.imghost, |
| 26 | - j: false, | ||
| 27 | screenWidth: 0, | 27 | screenWidth: 0, |
| 28 | screenheight: 0, | 28 | screenheight: 0, |
| 29 | canvasHidden: true, | 29 | canvasHidden: true, |
| 30 | shareImgPath: null, | 30 | shareImgPath: null, |
| 31 | - plusCard: "", | ||
| 32 | - imagePath: "" | 31 | + is_plusCard: "",//卡的列表 |
| 32 | + imagePath: "", | ||
| 33 | + is_pulscardname: "",//plus会员的名字 | ||
| 34 | + is_card:0,//用于判断是否是续费页和购买页面 0不是puls会员 | ||
| 35 | + content:"",//等级卡规则 | ||
| 36 | + is_card_rule: "",//等级卡规则判断用 | ||
| 33 | }, | 37 | }, |
| 34 | swiperChange: function(e) { | 38 | swiperChange: function(e) { |
| 35 | var currentId = e.detail.current; | 39 | var currentId = e.detail.current; |
| @@ -42,7 +46,30 @@ Page({ | @@ -42,7 +46,30 @@ Page({ | ||
| 42 | * 生命周期函数--监听页面加载 | 46 | * 生命周期函数--监听页面加载 |
| 43 | */ | 47 | */ |
| 44 | onLoad: function(options) { | 48 | onLoad: function(options) { |
| 49 | + console.log(); | ||
| 45 | var that = this; | 50 | var that = this; |
| 51 | + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { | ||
| 52 | + success: function (res) { | ||
| 53 | + var user_information=res.data.data; | ||
| 54 | + console.log(res, "会员个人信息"); | ||
| 55 | + //判断是是不是会员 | ||
| 56 | + if (user_information == null || user_information == ""){ | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + //判断是是不是plus会员 | ||
| 60 | + if (user_information.card_field == null || user_information.card_fiel == "") { | ||
| 61 | + that.setData({ is_card:1}); | ||
| 62 | + | ||
| 63 | + } | ||
| 64 | + if (user_information.card_expiredate == null || user_information.card_expiredate == ""){ | ||
| 65 | + | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + } | ||
| 69 | + }); | ||
| 70 | + | ||
| 71 | + | ||
| 72 | + | ||
| 46 | //获取用户设备信息,屏幕宽度 | 73 | //获取用户设备信息,屏幕宽度 |
| 47 | wx.getSystemInfo({ | 74 | wx.getSystemInfo({ |
| 48 | success: res => { | 75 | success: res => { |
| @@ -53,14 +80,57 @@ Page({ | @@ -53,14 +80,57 @@ Page({ | ||
| 53 | }) | 80 | }) |
| 54 | this.getPlusCardType(); | 81 | this.getPlusCardType(); |
| 55 | this.saveImageToPhotosAlbum(); | 82 | this.saveImageToPhotosAlbum(); |
| 83 | + this.puls_user(); | ||
| 84 | + //-----------商家配置信息----- 等级卡规则------------ | ||
| 85 | + | ||
| 86 | + getApp().request.get("/api/weshop/storeconfig/get/"+ os.stoid, { | ||
| 87 | + success: function (res) { | ||
| 88 | + var is_cardrule=res.data.data.cardrules; | ||
| 89 | + w.wxParse("content", "html", is_cardrule, that, 6); | ||
| 90 | + | ||
| 91 | + console.log("等级卡规则8888888888888", is_cardrule); | ||
| 92 | + that.setData({ | ||
| 93 | + is_card_rule: is_cardrule | ||
| 94 | + }); | ||
| 95 | + } | ||
| 96 | + }); | ||
| 56 | }, | 97 | }, |
| 98 | + | ||
| 99 | + //-----Plus会员获取----------- | ||
| 100 | + puls_user: function () { | ||
| 101 | + var th = this; | ||
| 102 | + getApp().request.get("/api/weshop/plus/vip/mem/list", { | ||
| 103 | + data: { | ||
| 104 | + storeId: os.stoid, | ||
| 105 | + userId: getApp().globalData.user_id, | ||
| 106 | + }, | ||
| 107 | + success: function (su) { | ||
| 108 | + if (su.data.code == 0) { | ||
| 109 | + var cardname = su.data.data[0].MemCardName; | ||
| 110 | + console.log("卡的名字", cardname); | ||
| 111 | + th.setData({ pulscardname: cardname }); | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + }); | ||
| 115 | + }, | ||
| 116 | + | ||
| 117 | + | ||
| 118 | + | ||
| 119 | + | ||
| 120 | + | ||
| 57 | //获取卡类 | 121 | //获取卡类 |
| 58 | getPlusCardType: function(e) { | 122 | getPlusCardType: function(e) { |
| 59 | var storid = o.stoid; | 123 | var storid = o.stoid; |
| 60 | var th = this; | 124 | var th = this; |
| 61 | getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | 125 | getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { |
| 126 | + var plusCard = res.data.data; | ||
| 127 | + var arr = [1219, 2089, 3031]; | ||
| 128 | + for(var i = 0; i < plusCard.length;i++){ | ||
| 129 | + plusCard[i].free=arr[i]; | ||
| 130 | + } | ||
| 131 | + | ||
| 62 | th.setData({ | 132 | th.setData({ |
| 63 | - plusCard: res.data.data | 133 | + is_plusCard: plusCard |
| 64 | }) | 134 | }) |
| 65 | }) | 135 | }) |
| 66 | 136 |
pages/user/plus/plus.wxml
| 1 | <!-- 我的会员背景图片 --> | 1 | <!-- 我的会员背景图片 --> |
| 2 | +<import src="../../../utils/wxParse/wxParse.wxml"></import> | ||
| 2 | <view> | 3 | <view> |
| 3 | <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | 4 | <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> |
| 4 | </view> | 5 | </view> |
| 5 | - | 6 | + |
| 6 | <view class="plus"> | 7 | <view class="plus"> |
| 7 | <!-- 开通会员模块 --> | 8 | <!-- 开通会员模块 --> |
| 8 | <view class="Opening_plus"> | 9 | <view class="Opening_plus"> |
| @@ -10,28 +11,30 @@ | @@ -10,28 +11,30 @@ | ||
| 10 | <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> | 11 | <image src="{{url}}/miniapp/images/plus/card_bk.png"></image> |
| 11 | </view> | 12 | </view> |
| 12 | <view class="swiper"> | 13 | <view class="swiper"> |
| 13 | - <block wx:if="{{j}}"> | 14 | + <block wx:if="{{!is_card}}"> |
| 15 | + | ||
| 14 | <!-- 未开通会员swiper-item --> | 16 | <!-- 未开通会员swiper-item --> |
| 15 | <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="55rpx" previous-margin="55rpx" bindchange="swiperChange"> | 17 | <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="55rpx" previous-margin="55rpx" bindchange="swiperChange"> |
| 16 | 18 | ||
| 17 | - <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{plusCard}}"> | 19 | + <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}"> |
| 18 | <view 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}}"> |
| 19 | 21 | ||
| 20 | <view class="flex-space-between Membership_go"> | 22 | <view class="flex-space-between Membership_go"> |
| 21 | <view> | 23 | <view> |
| 22 | <view class="fs32">{{item.CardName}}</view> | 24 | <view class="fs32">{{item.CardName}}</view> |
| 23 | - <view class="fs24 Membership_remarks">开通会员年卡仅199元</view> | 25 | + <view class="fs24 Membership_remarks">开通会员年卡仅{{item.CardFee}}元</view> |
| 24 | </view> | 26 | </view> |
| 25 | - <view class="Opening fs24 xc-black" bindtap="Opening">立即开通 | 27 | + <view class="Opening fs24 xc-black"data-ind="{{index}}" style="background:{{item.CardColor}}" bindtap="Opening">立即开通 |
| 26 | </view> | 28 | </view> |
| 27 | 29 | ||
| 28 | </view> | 30 | </view> |
| 29 | 31 | ||
| 30 | <view class="flex-vertical-between consumption"> | 32 | <view class="flex-vertical-between consumption"> |
| 31 | 33 | ||
| 32 | - <view class="flex-vertical fs22"> | ||
| 33 | - <image class="Member" src="{{url}}/miniapp/images/plus/privilege_o.png"></image> | ||
| 34 | - <view>根据大家购买数据,您成为超级会员预计可省¥2899元 | 34 | + <view class="flex-vertical fs22" style="overflow:hidden"> |
| 35 | + <!-- <image class="Member" src="{{url}}/miniapp/images/plus/privilege_o.png" style="filter:drop-shadow( 20rpx 0 0px {{item.CardColor}});"></image> --> | ||
| 36 | + <view class="Member"style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view> | ||
| 37 | + <view>根据大家购买数据,您成为超级会员预计可省¥{{item.free}}元 | ||
| 35 | </view> | 38 | </view> |
| 36 | </view> | 39 | </view> |
| 37 | </view> | 40 | </view> |
| @@ -40,11 +43,8 @@ | @@ -40,11 +43,8 @@ | ||
| 40 | </swiper> | 43 | </swiper> |
| 41 | </block> | 44 | </block> |
| 42 | <block wx:else> | 45 | <block wx:else> |
| 46 | + | ||
| 43 | <!-- 已开通 --> | 47 | <!-- 已开通 --> |
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 47 | - | ||
| 48 | <view class="MemberPlus" style=" background-image: url({{url}}/miniapp/images/plus/card_one.jpg);"> | 48 | <view class="MemberPlus" style=" background-image: url({{url}}/miniapp/images/plus/card_one.jpg);"> |
| 49 | 49 | ||
| 50 | <view class="flex-space-between"> | 50 | <view class="flex-space-between"> |
| @@ -74,7 +74,7 @@ | @@ -74,7 +74,7 @@ | ||
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | </block> | 76 | </block> |
| 77 | - <view wx:if="{{j==false}}" class="flex-vertical-between Invitation fs30"> | 77 | + <view wx:if="{{is_card}}" class="flex-vertical-between Invitation fs30"> |
| 78 | 78 | ||
| 79 | <view class="flex"> | 79 | <view class="flex"> |
| 80 | 已邀请 | 80 | 已邀请 |
| @@ -123,24 +123,13 @@ | @@ -123,24 +123,13 @@ | ||
| 123 | </view> | 123 | </view> |
| 124 | 124 | ||
| 125 | <!-- 会员权益内容 --> | 125 | <!-- 会员权益内容 --> |
| 126 | - <view class="Courtesy_comment fs24"> | ||
| 127 | - | ||
| 128 | - <view class="flex"> | ||
| 129 | - <view>1、</view> | ||
| 130 | - <view>可以领取880元黑卡专享礼包</view> | ||
| 131 | - </view> | ||
| 132 | - <view class="flex-center"> | ||
| 133 | - <image class="t-c Equity_image" src="../../../images/plus/purchase_Bk.png"></image> | ||
| 134 | - </view> | ||
| 135 | - <view class="flex"> | ||
| 136 | - <view>2、</view> | ||
| 137 | - <view>可以领取880元黑卡专享礼包</view> | ||
| 138 | - </view> | 126 | + <view class="Courtesy_comment " wx:if="{{is_card_rule!=null&&is_card_rule!=''}}"> |
| 139 | 127 | ||
| 140 | - <view class="flex"> | ||
| 141 | - <view>3、</view> | ||
| 142 | - <view>可以领取880元黑卡专享礼包</view> | ||
| 143 | - </view> | 128 | + |
| 129 | + <view class="wxParse"> | ||
| 130 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | ||
| 131 | + </view> | ||
| 132 | + | ||
| 144 | </view> | 133 | </view> |
| 145 | </view> | 134 | </view> |
| 146 | 135 | ||
| @@ -190,14 +179,14 @@ | @@ -190,14 +179,14 @@ | ||
| 190 | <!-- 弹框 --> | 179 | <!-- 弹框 --> |
| 191 | <view class="Member_purchase"> | 180 | <view class="Member_purchase"> |
| 192 | <view class="rel purchase_Bk" style="background-image: url({{url}}/miniapp/images/plus/card_one.jpg);"> | 181 | <view class="rel purchase_Bk" style="background-image: url({{url}}/miniapp/images/plus/card_one.jpg);"> |
| 193 | - <image class="abs write" src="../../../images/plus/write.png"></image> | 182 | + <image class="abs write" src="{{url}}/miniapp/images/plus/write.png"></image> |
| 194 | </view> | 183 | </view> |
| 195 | <view class="fs26 inf_com"> | 184 | <view class="fs26 inf_com"> |
| 196 | <view class="fs36 flex-level perfect">请完善下面信息</view> | 185 | <view class="fs36 flex-level perfect">请完善下面信息</view> |
| 197 | <view class="fillin"> | 186 | <view class="fillin"> |
| 198 | <!-- 输入推荐人手机号 --> | 187 | <!-- 输入推荐人手机号 --> |
| 199 | <view class="flex ai_and Enter_phone"> | 188 | <view class="flex ai_and Enter_phone"> |
| 200 | - <image class="phone_image" src="../../../images/plus/Invitation_code.png"></image> | 189 | + <image class="phone_image" src="{{url}}/miniapp/images/plus/Invitation_code.png"></image> |
| 201 | <view class="phone"> | 190 | <view class="phone"> |
| 202 | <input placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="30" /> | 191 | <input placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="30" /> |
| 203 | </view> | 192 | </view> |
| @@ -205,7 +194,7 @@ | @@ -205,7 +194,7 @@ | ||
| 205 | 194 | ||
| 206 | <!-- 输入营业员 --> | 195 | <!-- 输入营业员 --> |
| 207 | <view class="flex ai_and enter_SalesClerk"> | 196 | <view class="flex ai_and enter_SalesClerk"> |
| 208 | - <image class="SalesClerk_image" src="../../../images/plus/Sales_Clerk.png"></image> | 197 | + <image class="SalesClerk_image" src="{{url}}/miniapp/images/plus/Sales_Clerk.png"></image> |
| 209 | <view class="SalesClerk"> | 198 | <view class="SalesClerk"> |
| 210 | <input placeholder="请输入营业员" maxlength="30" /> | 199 | <input placeholder="请输入营业员" maxlength="30" /> |
| 211 | </view> | 200 | </view> |
| @@ -219,7 +208,7 @@ | @@ -219,7 +208,7 @@ | ||
| 219 | </view> | 208 | </view> |
| 220 | </view> | 209 | </view> |
| 221 | <view class="flex-level"> | 210 | <view class="flex-level"> |
| 222 | - <image class="purchaseClose" bindtap="OpeningClose" src="../../../images/plus/Close.png"></image> | 211 | + <image class="purchaseClose" bindtap="OpeningClose" src="{{url}}/miniapp/images/plus/Close.png"></image> |
| 223 | </view> | 212 | </view> |
| 224 | </view> | 213 | </view> |
| 225 | 214 | ||
| @@ -228,14 +217,5 @@ | @@ -228,14 +217,5 @@ | ||
| 228 | <!-- 画布 --> | 217 | <!-- 画布 --> |
| 229 | 218 | ||
| 230 | <canvas canvas-id='myCanvas' style="width:750rpx;height:1330rpx;"></canvas> | 219 | <canvas canvas-id='myCanvas' style="width:750rpx;height:1330rpx;"></canvas> |
| 231 | -<!-- < 分享图片 --> | ||
| 232 | -<!-- <view class="mc" wx:if="{{isshare}}" catchtap="isshare"> | ||
| 233 | - <!-- 蒙尘 --> | ||
| 234 | - <!-- <view> | ||
| 235 | - <image src="{{imagePath}}"></image> | ||
| 236 | - </view> | ||
| 237 | - <view class="flex-center Close"> | ||
| 238 | - <image src="../../../images/plus/Close.png" bindtap="isshare"></image> | ||
| 239 | - </view> | ||
| 240 | -</view> --> --> | 220 | + |
| 241 | <warn id="warn"></warn> | 221 | <warn id="warn"></warn> |
| 242 | \ No newline at end of file | 222 | \ No newline at end of file |
pages/user/plus/plus.wxss
| 1 | +@import "../../../utils/wxParse/wxParse.wxss"; | ||
| 1 | page { | 2 | page { |
| 2 | width: 100%; | 3 | width: 100%; |
| 3 | height: 100%; | 4 | height: 100%; |
| @@ -161,6 +162,10 @@ swiper { | @@ -161,6 +162,10 @@ swiper { | ||
| 161 | width: 30rpx; | 162 | width: 30rpx; |
| 162 | height: 30rpx; | 163 | height: 30rpx; |
| 163 | margin-right: 5rpx; | 164 | margin-right: 5rpx; |
| 165 | + background-size: 100% 100%; | ||
| 166 | +position: relative; | ||
| 167 | +left: -40rpx; | ||
| 168 | + | ||
| 164 | } | 169 | } |
| 165 | 170 | ||
| 166 | .Membership .Opening { | 171 | .Membership .Opening { |
| @@ -350,6 +355,7 @@ swiper { | @@ -350,6 +355,7 @@ swiper { | ||
| 350 | } | 355 | } |
| 351 | 356 | ||
| 352 | input { | 357 | input { |
| 358 | + | ||
| 353 | overflow: visible; | 359 | overflow: visible; |
| 354 | width: 360rpx; | 360 | width: 360rpx; |
| 355 | } | 361 | } |