Showing
17 changed files
with
439 additions
and
55 deletions
| @@ -67,7 +67,8 @@ | @@ -67,7 +67,8 @@ | ||
| 67 | "pages/reserve/sellerGift", | 67 | "pages/reserve/sellerGift", |
| 68 | "pages/customer/login", | 68 | "pages/customer/login", |
| 69 | "pages/me/consumeAmount", | 69 | "pages/me/consumeAmount", |
| 70 | - "pages/me/consumeDetails" | 70 | + "pages/me/consumeDetails", |
| 71 | + "pages/me/myBalance" | ||
| 71 | ], | 72 | ], |
| 72 | "requiredPrivateInfos": [ | 73 | "requiredPrivateInfos": [ |
| 73 | "getLocation", | 74 | "getLocation", |
| @@ -3,6 +3,7 @@ import util from '../../utils/util' | @@ -3,6 +3,7 @@ import util from '../../utils/util' | ||
| 3 | Component({ | 3 | Component({ |
| 4 | data:{ | 4 | data:{ |
| 5 | menuhidden:true, | 5 | menuhidden:true, |
| 6 | + customer_activity:'', | ||
| 6 | url:'pages/reserve/index_new', | 7 | url:'pages/reserve/index_new', |
| 7 | }, | 8 | }, |
| 8 | attached: function() { | 9 | attached: function() { |
| @@ -10,8 +11,25 @@ Component({ | @@ -10,8 +11,25 @@ Component({ | ||
| 10 | this.getuser(); | 11 | this.getuser(); |
| 11 | this.getautomenu(); | 12 | this.getautomenu(); |
| 12 | this.getorder(); | 13 | this.getorder(); |
| 14 | + this.getlist() | ||
| 13 | }, | 15 | }, |
| 14 | methods:{ | 16 | methods:{ |
| 17 | + //获取用户未使用优惠券列表数量 | ||
| 18 | + getlist() { | ||
| 19 | + App.Activity.GetNewRechargeListByOpenid({ | ||
| 20 | + openid: getApp().openid, | ||
| 21 | + }).then((res) => { | ||
| 22 | + if (res.ret == 200) { | ||
| 23 | + let list = res.data; | ||
| 24 | + list = list.filter(item => { | ||
| 25 | + return (item.recharge_name || item.aname) | ||
| 26 | + }) | ||
| 27 | + this.setData({ | ||
| 28 | + 'customer_activity': list.length, | ||
| 29 | + }) | ||
| 30 | + } | ||
| 31 | + }) | ||
| 32 | + }, | ||
| 15 | getuser(){ | 33 | getuser(){ |
| 16 | App.User.GetBalance().then(res=>{ | 34 | App.User.GetBalance().then(res=>{ |
| 17 | this.setData({ | 35 | this.setData({ |
| @@ -46,13 +46,13 @@ | @@ -46,13 +46,13 @@ | ||
| 46 | <block wx:if="{{'pages/me/coupon_news'!=url}}"> | 46 | <block wx:if="{{'pages/me/coupon_news'!=url}}"> |
| 47 | <view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon_news"> | 47 | <view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon_news"> |
| 48 | <view class="font24r">卡包</view> | 48 | <view class="font24r">卡包</view> |
| 49 | - <view class="font24r">({{user.customer_activity}})</view> | 49 | + <view class="font24r">({{customer_activity}})</view> |
| 50 | </view> | 50 | </view> |
| 51 | </block> | 51 | </block> |
| 52 | <block wx:else> | 52 | <block wx:else> |
| 53 | <view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon_news"> | 53 | <view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon_news"> |
| 54 | <view class="font24r">卡包</view> | 54 | <view class="font24r">卡包</view> |
| 55 | - <view class="font24r">({{user.customer_activity}})</view> | 55 | + <view class="font24r">({{customer_activity}})</view> |
| 56 | </view> | 56 | </view> |
| 57 | </block> | 57 | </block> |
| 58 | <!-- <block wx:if="{{'pages/me/invitation'!=url}}"> | 58 | <!-- <block wx:if="{{'pages/me/invitation'!=url}}"> |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "nav": "/components/nav/nav", | 5 | "nav": "/components/nav/nav", |
| 6 | "my-modal": "/components/modal/modal", | 6 | "my-modal": "/components/modal/modal", |
| 7 | - "toast": "/components/toast/index" | 7 | + "toast": "/components/toast/index", |
| 8 | + "scroll-number": "/components/scroll-number/index" | ||
| 8 | } | 9 | } |
| 9 | } | 10 | } |
| @@ -16,8 +16,6 @@ Page({ | @@ -16,8 +16,6 @@ Page({ | ||
| 16 | types: '', | 16 | types: '', |
| 17 | }, | 17 | }, |
| 18 | type: '', | 18 | type: '', |
| 19 | - time: 300, | ||
| 20 | - countdown: '', | ||
| 21 | name: "", | 19 | name: "", |
| 22 | date: "", | 20 | date: "", |
| 23 | phone: "", | 21 | phone: "", |
| @@ -48,6 +46,7 @@ Page({ | @@ -48,6 +46,7 @@ Page({ | ||
| 48 | * 生命周期函数--监听页面加载 | 46 | * 生命周期函数--监听页面加载 |
| 49 | */ | 47 | */ |
| 50 | onLoad(options) { | 48 | onLoad(options) { |
| 49 | + console.log('options---',options); | ||
| 51 | this.setData({ | 50 | this.setData({ |
| 52 | opt: { | 51 | opt: { |
| 53 | detail: options.detail ? JSON.parse(options.detail) : '', | 52 | detail: options.detail ? JSON.parse(options.detail) : '', |
| @@ -73,7 +72,6 @@ Page({ | @@ -73,7 +72,6 @@ Page({ | ||
| 73 | calendarData: obj.calendarData, | 72 | calendarData: obj.calendarData, |
| 74 | }) | 73 | }) |
| 75 | } | 74 | } |
| 76 | - this.countdown() | ||
| 77 | this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 | 75 | this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 |
| 78 | this.getSellerTemplateConfFun(options.sid) | 76 | this.getSellerTemplateConfFun(options.sid) |
| 79 | }, | 77 | }, |
| @@ -154,7 +152,7 @@ Page({ | @@ -154,7 +152,7 @@ Page({ | ||
| 154 | } | 152 | } |
| 155 | }) | 153 | }) |
| 156 | }, | 154 | }, |
| 157 | - // 支付成功/失败回调 types 1邀请函 2提前点餐 3商家端app分享 | 155 | + // 支付成功/失败回调 types 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值 |
| 158 | callbackFun() { | 156 | callbackFun() { |
| 159 | let that = this; | 157 | let that = this; |
| 160 | let url = '/pack-invitation/pages/detail_owner_invitation1?id=' + that.data.opt.detail.oid; | 158 | let url = '/pack-invitation/pages/detail_owner_invitation1?id=' + that.data.opt.detail.oid; |
| @@ -187,6 +185,9 @@ Page({ | @@ -187,6 +185,9 @@ Page({ | ||
| 187 | if (that.data.opt.types == '3') { | 185 | if (that.data.opt.types == '3') { |
| 188 | url = '/pages/reserve/index_new'; | 186 | url = '/pages/reserve/index_new'; |
| 189 | } | 187 | } |
| 188 | + if (that.data.opt.types == '4' || this.data.opt.types == '5') { | ||
| 189 | + return wx.navigateBack(2) | ||
| 190 | + } | ||
| 190 | setTimeout(function () { | 191 | setTimeout(function () { |
| 191 | wx.reLaunch({ | 192 | wx.reLaunch({ |
| 192 | url | 193 | url |
| @@ -228,9 +229,6 @@ Page({ | @@ -228,9 +229,6 @@ Page({ | ||
| 228 | }, | 229 | }, |
| 229 | // 点击确认支付 | 230 | // 点击确认支付 |
| 230 | formSubmit() { | 231 | formSubmit() { |
| 231 | - if (this.data.time == 0) { | ||
| 232 | - return util.toast('当前订单已过期,请重新进入优惠券购买页面下单', 'none'); | ||
| 233 | - } | ||
| 234 | if (this.data.type == '2') { | 232 | if (this.data.type == '2') { |
| 235 | let data = this.data | 233 | let data = this.data |
| 236 | if (!data.name) { | 234 | if (!data.name) { |
| @@ -343,26 +341,10 @@ Page({ | @@ -343,26 +341,10 @@ Page({ | ||
| 343 | onShow() { | 341 | onShow() { |
| 344 | 342 | ||
| 345 | }, | 343 | }, |
| 346 | - // 倒计时 | ||
| 347 | - countdown() { | ||
| 348 | - var minute = Math.floor(this.data.time * 1 / 60); | ||
| 349 | - var second = this.data.time % 60; | ||
| 350 | - second < 10 ? second = '0' + second : ''; | ||
| 351 | - this.setData({ | ||
| 352 | - countdown: minute + ':' + second, | ||
| 353 | - time: this.data.time - 1 | ||
| 354 | - }) | ||
| 355 | - if (this.data.time == 0) { | ||
| 356 | - this.setData({ | ||
| 357 | - countdown: '0:00' | ||
| 358 | - }) | ||
| 359 | - return false; | ||
| 360 | - } | ||
| 361 | - setTimeout(this.countdown, 1000); | ||
| 362 | - }, | ||
| 363 | // 返回 | 344 | // 返回 |
| 364 | navEvent() { | 345 | navEvent() { |
| 365 | - // 1 邀请函 2 提前点餐 3商家端分享 | 346 | + console.log('types---------',this.data.opt.types); |
| 347 | + // 1 邀请函 2 提前点餐 3商家端分享 4支付页充值 5我的页面余额充值 | ||
| 366 | if (this.data.opt.types == '1') { | 348 | if (this.data.opt.types == '1') { |
| 367 | let arr = [9, 10, 11, 12, 13, 14, 15, 16, 17]; | 349 | let arr = [9, 10, 11, 12, 13, 14, 15, 16, 17]; |
| 368 | let StyleType = this.data.StyleType | 350 | let StyleType = this.data.StyleType |
| @@ -401,6 +383,9 @@ Page({ | @@ -401,6 +383,9 @@ Page({ | ||
| 401 | url: '/pages/reserve/index_new', | 383 | url: '/pages/reserve/index_new', |
| 402 | }) | 384 | }) |
| 403 | } | 385 | } |
| 386 | + if (this.data.opt.types == '4' || this.data.opt.types == '5') { | ||
| 387 | + wx.navigateBack(2) | ||
| 388 | + } | ||
| 404 | }, | 389 | }, |
| 405 | /** | 390 | /** |
| 406 | * 生命周期函数--监听页面隐藏 | 391 | * 生命周期函数--监听页面隐藏 |
| 1 | <!--pack-activity/pack/confirmPayment.wxml 代金券和充值支付页面--> | 1 | <!--pack-activity/pack/confirmPayment.wxml 代金券和充值支付页面--> |
| 2 | -<nav bindNavEvent="navEvent" back="none">{{opt.detail.name}}</nav> | 2 | +<nav bindNavEvent="navEvent">{{opt.detail.name}}</nav> |
| 3 | <view class="box_wrap"> | 3 | <view class="box_wrap"> |
| 4 | <view wx:if="{{type=='1'}}" class="box"> | 4 | <view wx:if="{{type=='1'}}" class="box"> |
| 5 | - <view class="countdown font24r"> | ||
| 6 | - 支付剩余时间 {{countdown}} | ||
| 7 | - </view> | ||
| 8 | <view class="money_text"> | 5 | <view class="money_text"> |
| 9 | ¥{{opt.totalize}} | 6 | ¥{{opt.totalize}} |
| 10 | </view> | 7 | </view> |
| @@ -48,12 +45,6 @@ | @@ -48,12 +45,6 @@ | ||
| 48 | {{opt.detail.recharge_money}}元 | 45 | {{opt.detail.recharge_money}}元 |
| 49 | </view> | 46 | </view> |
| 50 | </view> | 47 | </view> |
| 51 | - <view class="page-section"> | ||
| 52 | - <view class="page-section-title font32r">支付剩余时间 </view> | ||
| 53 | - <view class="weui-cells weui-cell__bd sum colorSty"> | ||
| 54 | - {{countdown}} | ||
| 55 | - </view> | ||
| 56 | - </view> | ||
| 57 | <view wx:if="{{type=='2'}}" class="fixed_box"> | 48 | <view wx:if="{{type=='2'}}" class="fixed_box"> |
| 58 | <button class="font32r btns" formType="submit">确认支付 | 49 | <button class="font32r btns" formType="submit">确认支付 |
| 59 | </button> | 50 | </button> |
| @@ -12,7 +12,7 @@ Page({ | @@ -12,7 +12,7 @@ Page({ | ||
| 12 | id:'', | 12 | id:'', |
| 13 | sid:'', | 13 | sid:'', |
| 14 | oid:'', | 14 | oid:'', |
| 15 | - types:'',// 1邀请函 2提前点餐 3商家端app分享 | 15 | + types:'',// 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值 |
| 16 | rid:'', | 16 | rid:'', |
| 17 | }, | 17 | }, |
| 18 | exp_date:{}, | 18 | exp_date:{}, |
| @@ -98,7 +98,7 @@ Page({ | @@ -98,7 +98,7 @@ Page({ | ||
| 98 | if(res.ret=='200'){ | 98 | if(res.ret=='200'){ |
| 99 | let url = util.http_build_query({ | 99 | let url = util.http_build_query({ |
| 100 | type:'2', | 100 | type:'2', |
| 101 | - types: this.data.opt.types,// 1邀请函 2提前点餐 3商家端app分享 | 101 | + types: this.data.opt.types,// 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值 |
| 102 | detail: JSON.stringify(detail), | 102 | detail: JSON.stringify(detail), |
| 103 | sid: this.data.opt.sid, | 103 | sid: this.data.opt.sid, |
| 104 | combine_out_trade_no:res.data.combine_out_trade_no, | 104 | combine_out_trade_no:res.data.combine_out_trade_no, |
| @@ -7,6 +7,7 @@ Page({ | @@ -7,6 +7,7 @@ Page({ | ||
| 7 | * 页面的初始数据 | 7 | * 页面的初始数据 |
| 8 | */ | 8 | */ |
| 9 | data: { | 9 | data: { |
| 10 | + type:'',//1消费金 2余额 | ||
| 10 | sellerList: [], | 11 | sellerList: [], |
| 11 | }, | 12 | }, |
| 12 | 13 | ||
| @@ -14,7 +15,14 @@ Page({ | @@ -14,7 +15,14 @@ Page({ | ||
| 14 | * 生命周期函数--监听页面加载 | 15 | * 生命周期函数--监听页面加载 |
| 15 | */ | 16 | */ |
| 16 | onLoad(options) { | 17 | onLoad(options) { |
| 17 | - this.getInfo() | 18 | + console.log('options',options); |
| 19 | + let type = options.type; | ||
| 20 | + if(type){ | ||
| 21 | + this.setData({ | ||
| 22 | + type | ||
| 23 | + }) | ||
| 24 | + } | ||
| 25 | + if(type == 1) this.getInfo() | ||
| 18 | }, | 26 | }, |
| 19 | // 获取用户消费金商家余额列表 | 27 | // 获取用户消费金商家余额列表 |
| 20 | getInfo() { | 28 | getInfo() { |
| @@ -32,11 +40,20 @@ Page({ | @@ -32,11 +40,20 @@ Page({ | ||
| 32 | }, | 40 | }, |
| 33 | // 跳转用户商家消费金消费记录 | 41 | // 跳转用户商家消费金消费记录 |
| 34 | getSeller(event) { | 42 | getSeller(event) { |
| 35 | - wx.navigateTo({ | ||
| 36 | - url: util.http_build_query({ | ||
| 37 | - sellerid: event.currentTarget.dataset.id | ||
| 38 | - }, '/pages/me/consumeDetails') | ||
| 39 | - }) | 43 | + if (this.data.type == '1') { |
| 44 | + wx.navigateTo({ | ||
| 45 | + url: util.http_build_query({ | ||
| 46 | + sellerid: event.currentTarget.dataset.id, | ||
| 47 | + type: this.data.type, | ||
| 48 | + }, '/pages/me/consumeDetails') | ||
| 49 | + }) | ||
| 50 | + } else { | ||
| 51 | + wx.navigateTo({ | ||
| 52 | + url: util.http_build_query({ | ||
| 53 | + sellerid: event.currentTarget.dataset.id, | ||
| 54 | + }, '/pages/me/myBalance') | ||
| 55 | + }) | ||
| 56 | + } | ||
| 40 | }, | 57 | }, |
| 41 | // 换号查看 | 58 | // 换号查看 |
| 42 | switchAccount() { | 59 | switchAccount() { |
| 1 | <!--pages/me/consumeAmount.wxml--> | 1 | <!--pages/me/consumeAmount.wxml--> |
| 2 | <wxs src="../../utils/util.wxs" module="util" /> | 2 | <wxs src="../../utils/util.wxs" module="util" /> |
| 3 | -<nav hasHome>我的消费金</nav> | 3 | +<nav hasHome>我的{{type == '1' ? '消费金' : '余额'}}</nav> |
| 4 | <view class="{{sellerList.length>0?'box':'box1'}}"> | 4 | <view class="{{sellerList.length>0?'box':'box1'}}"> |
| 5 | <block wx:if="{{sellerList.length>0}}"> | 5 | <block wx:if="{{sellerList.length>0}}"> |
| 6 | <view class="items" wx:for="{{sellerList}}" bind:tap="getSeller" data-id="{{item.sellerid}}"> | 6 | <view class="items" wx:for="{{sellerList}}" bind:tap="getSeller" data-id="{{item.sellerid}}"> |
| @@ -7,6 +7,7 @@ Page({ | @@ -7,6 +7,7 @@ Page({ | ||
| 7 | * 页面的初始数据 | 7 | * 页面的初始数据 |
| 8 | */ | 8 | */ |
| 9 | data: { | 9 | data: { |
| 10 | + type: '', //1消费金 2余额 | ||
| 10 | sellerid: '', | 11 | sellerid: '', |
| 11 | consumeList: [] | 12 | consumeList: [] |
| 12 | }, | 13 | }, |
| @@ -15,10 +16,25 @@ Page({ | @@ -15,10 +16,25 @@ Page({ | ||
| 15 | * 生命周期函数--监听页面加载 | 16 | * 生命周期函数--监听页面加载 |
| 16 | */ | 17 | */ |
| 17 | onLoad(options) { | 18 | onLoad(options) { |
| 18 | - this.setData({ | ||
| 19 | - sellerid: options.sellerid | 19 | + console.log('options', options); |
| 20 | + let type = options.type; | ||
| 21 | + if (type) { | ||
| 22 | + this.setData({ | ||
| 23 | + type, | ||
| 24 | + sellerid: options.sellerid | ||
| 25 | + }) | ||
| 26 | + } | ||
| 27 | + if (type == 1) this.getInfo(options.sellerid) | ||
| 28 | + }, | ||
| 29 | + getSeller() { | ||
| 30 | + let type = this.data.type; | ||
| 31 | + if (type == '1') return | ||
| 32 | + wx.navigateTo({ | ||
| 33 | + url: util.http_build_query({ | ||
| 34 | + sellerid: event.currentTarget.dataset.id, | ||
| 35 | + type: this.data.type, | ||
| 36 | + }, '/pages/me/myBalance') | ||
| 20 | }) | 37 | }) |
| 21 | - this.getInfo(options.sellerid) | ||
| 22 | }, | 38 | }, |
| 23 | getInfo(sellerid) { | 39 | getInfo(sellerid) { |
| 24 | App.Activity.GetConsumeListByOpenid({ | 40 | App.Activity.GetConsumeListByOpenid({ |
| 1 | <!--pages/me/consumeDetails.wxml--> | 1 | <!--pages/me/consumeDetails.wxml--> |
| 2 | <wxs src="../../utils/util.wxs" module="util" /> | 2 | <wxs src="../../utils/util.wxs" module="util" /> |
| 3 | -<nav hasHome>消费金明细</nav> | 3 | +<nav hasHome>{{type == '1'?'消费金':'余额'}}明细</nav> |
| 4 | <view class="box"> | 4 | <view class="box"> |
| 5 | <view class="items" wx:for="{{consumeList}}" bind:tap="getSeller" data-id="{{item.sellerid}}"> | 5 | <view class="items" wx:for="{{consumeList}}" bind:tap="getSeller" data-id="{{item.sellerid}}"> |
| 6 | <view class="topInfo"> | 6 | <view class="topInfo"> |
| 7 | - <view class="types font28r">{{item.type=='1'?'消耗':'获取'}}</view> | 7 | + <view class="types font28r" wx:if="{{type == '1'}}">{{item.type=='1'?'消耗':'获取'}}</view> |
| 8 | + <view class="types font28r" wx:else>{{item.type=='1'?'消费':'充值'}}</view> | ||
| 8 | <view class="priceInfo font40r {{item.type=='1'?'colors1':'colors2'}}">{{item.type=='1'?'-':'+'}}¥{{item.price}}</view> | 9 | <view class="priceInfo font40r {{item.type=='1'?'colors1':'colors2'}}">{{item.type=='1'?'-':'+'}}¥{{item.price}}</view> |
| 9 | </view> | 10 | </view> |
| 10 | <view class="bottomInfo"> | 11 | <view class="bottomInfo"> |
| @@ -36,12 +36,18 @@ | @@ -36,12 +36,18 @@ | ||
| 36 | <view class="money-title">卡券</view> | 36 | <view class="money-title">卡券</view> |
| 37 | </view> | 37 | </view> |
| 38 | </navigator> | 38 | </navigator> |
| 39 | - <navigator url="/pages/me/consumeAmount" class="money-item"> | 39 | + <navigator url="/pages/me/consumeAmount?type=1" class="money-item"> |
| 40 | <view class="flex-vc"> | 40 | <view class="flex-vc"> |
| 41 | <view class="money-value">¥{{price?price:'0.00'}}</view> | 41 | <view class="money-value">¥{{price?price:'0.00'}}</view> |
| 42 | <view class="money-title">消费金</view> | 42 | <view class="money-title">消费金</view> |
| 43 | </view> | 43 | </view> |
| 44 | </navigator> | 44 | </navigator> |
| 45 | + <!-- <navigator url="/pages/me/consumeAmount?type=2" class="money-item"> | ||
| 46 | + <view class="flex-vc"> | ||
| 47 | + <view class="money-value">¥{{user.balance.price||0}}</view> | ||
| 48 | + <view class="money-title">余额</view> | ||
| 49 | + </view> | ||
| 50 | + </navigator> --> | ||
| 45 | </view> | 51 | </view> |
| 46 | <view class="block-rev"> | 52 | <view class="block-rev"> |
| 47 | <navigator url="/pages/me/list" open-type="redirect"> | 53 | <navigator url="/pages/me/list" open-type="redirect"> |
miniprogram/pages/me/myBalance.js
0 → 100644
| 1 | +// pages/me/myBalance.js | ||
| 2 | +import App from '../../utils/api'; | ||
| 3 | +import util from '../../utils/util'; | ||
| 4 | +Page({ | ||
| 5 | + | ||
| 6 | + /** | ||
| 7 | + * 页面的初始数据 | ||
| 8 | + */ | ||
| 9 | + data: { | ||
| 10 | + sellerid: '', | ||
| 11 | + seller: {}, | ||
| 12 | + dataStr: Date.now() * 1 / 1000, | ||
| 13 | + recharge_data: [], //所有满赠充值活动 | ||
| 14 | + }, | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 生命周期函数--监听页面加载 | ||
| 18 | + */ | ||
| 19 | + onLoad(options) { | ||
| 20 | + this.setData({ | ||
| 21 | + sellerid: options.sellerid | ||
| 22 | + }) | ||
| 23 | + this.getSellerDetailFun(options.sellerid) | ||
| 24 | + this.getRechargeDetail(options.sellerid) | ||
| 25 | + }, | ||
| 26 | + // 获取店铺名称 | ||
| 27 | + getSellerDetailFun(sid) { | ||
| 28 | + App.Customer.GetSellerDetail({ | ||
| 29 | + sid | ||
| 30 | + }).then(res => { | ||
| 31 | + let data = res.data; | ||
| 32 | + this.setData({ | ||
| 33 | + seller: { | ||
| 34 | + seller_image: data.seller_image, | ||
| 35 | + sellername: data.sellername, | ||
| 36 | + sid: data.id | ||
| 37 | + } | ||
| 38 | + }) | ||
| 39 | + }) | ||
| 40 | + }, | ||
| 41 | + // 根据充值ID获取充值详情 | ||
| 42 | + getRechargeDetail(sellerid) { | ||
| 43 | + App.Activity.GetNewRechargeList({ | ||
| 44 | + sellerid, | ||
| 45 | + }).then(res => { | ||
| 46 | + if (res.data) { | ||
| 47 | + let arr = [] | ||
| 48 | + res.data.forEach(i => { | ||
| 49 | + if (i.status != '1') { | ||
| 50 | + arr.push(i) | ||
| 51 | + } | ||
| 52 | + }) | ||
| 53 | + let recharge_data = arr; | ||
| 54 | + console.log('arrarr-----', arr); | ||
| 55 | + recharge_data.forEach(item => { | ||
| 56 | + item.recharge_list = item.recharge_list ? JSON.parse(item.recharge_list) : ''; | ||
| 57 | + let recharge_list = item.recharge_list; | ||
| 58 | + item.priceInfo = ''; | ||
| 59 | + item.scoreInfo = ''; | ||
| 60 | + item.certificate = ''; | ||
| 61 | + if (recharge_list.is_price == '1') item.priceInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.price + '元余额'; | ||
| 62 | + if (recharge_list.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.score + '积分'; | ||
| 63 | + if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) item.certificate = recharge_list.coupons_names.join('、'); | ||
| 64 | + item.timeStr = util.unixtoTime(item.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(item.etime, 'YYYY-MM-DD') | ||
| 65 | + }) | ||
| 66 | + // 筛选出 未过期的 && 开启状态的充值活动 | ||
| 67 | + recharge_data = recharge_data.filter(item => { | ||
| 68 | + return this.data.dataStr < (item.etime * 1) && item.is_open == '1' | ||
| 69 | + }) | ||
| 70 | + console.log('所有充值活动--------------', recharge_data); | ||
| 71 | + this.setData({ | ||
| 72 | + recharge_data, | ||
| 73 | + }) | ||
| 74 | + } else { | ||
| 75 | + this.setData({ | ||
| 76 | + recharge_data: [], | ||
| 77 | + }) | ||
| 78 | + } | ||
| 79 | + }) | ||
| 80 | + }, | ||
| 81 | + // 跳转用户商家消费金消费记录 | ||
| 82 | + getSeller() { | ||
| 83 | + wx.navigateTo({ | ||
| 84 | + url: util.http_build_query({ | ||
| 85 | + sellerid: this.data.sellerid, | ||
| 86 | + type: '2', | ||
| 87 | + }, '/pages/me/consumeDetails') | ||
| 88 | + }) | ||
| 89 | + }, | ||
| 90 | + // 选择充值活动 | ||
| 91 | + checkRechargeData(e) { | ||
| 92 | + let id = e.currentTarget.dataset['id']; | ||
| 93 | + wx.navigateTo({ | ||
| 94 | + url: util.http_build_query({ | ||
| 95 | + id, | ||
| 96 | + name: this.data.seller.sellername, | ||
| 97 | + sid: this.data.sellerid, | ||
| 98 | + types: '5' | ||
| 99 | + }, '/pack-activity/pack/vipRecharge') | ||
| 100 | + }) | ||
| 101 | + }, | ||
| 102 | + /** | ||
| 103 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 104 | + */ | ||
| 105 | + onReady() { | ||
| 106 | + | ||
| 107 | + }, | ||
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 生命周期函数--监听页面显示 | ||
| 111 | + */ | ||
| 112 | + onShow() { | ||
| 113 | + | ||
| 114 | + }, | ||
| 115 | + | ||
| 116 | + /** | ||
| 117 | + * 生命周期函数--监听页面隐藏 | ||
| 118 | + */ | ||
| 119 | + onHide() { | ||
| 120 | + | ||
| 121 | + }, | ||
| 122 | + | ||
| 123 | + /** | ||
| 124 | + * 生命周期函数--监听页面卸载 | ||
| 125 | + */ | ||
| 126 | + onUnload() { | ||
| 127 | + | ||
| 128 | + }, | ||
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 132 | + */ | ||
| 133 | + onPullDownRefresh() { | ||
| 134 | + | ||
| 135 | + }, | ||
| 136 | + | ||
| 137 | + /** | ||
| 138 | + * 页面上拉触底事件的处理函数 | ||
| 139 | + */ | ||
| 140 | + onReachBottom() { | ||
| 141 | + | ||
| 142 | + }, | ||
| 143 | + | ||
| 144 | + /** | ||
| 145 | + * 用户点击右上角分享 | ||
| 146 | + */ | ||
| 147 | + onShareAppMessage() { | ||
| 148 | + | ||
| 149 | + } | ||
| 150 | +}) |
miniprogram/pages/me/myBalance.json
0 → 100644
miniprogram/pages/me/myBalance.wxml
0 → 100644
| 1 | +<!--pages/me/myBalance.wxml--> | ||
| 2 | +<nav>我的余额</nav> | ||
| 3 | +<view class="topBox"> | ||
| 4 | + <view class="names"> | ||
| 5 | + <image src="{{seller.seller_image}}" mode="aspectFill" /> | ||
| 6 | + <view class="font32r">{{seller.sellername}}</view> | ||
| 7 | + </view> | ||
| 8 | + <view class="balance"> | ||
| 9 | + <view class="info font28r">我的余额</view> | ||
| 10 | + <view class="news"> | ||
| 11 | + <view class="priceInfo">¥500.00</view> | ||
| 12 | + <view class="details font24r" bind:tap="getSeller">余额明细</view> | ||
| 13 | + </view> | ||
| 14 | + </view> | ||
| 15 | +</view> | ||
| 16 | +<view class="bottomBox"> | ||
| 17 | + <view class="info font28r">储值优惠活动</view> | ||
| 18 | + <view class="rechargeBox"> | ||
| 19 | + <view class="rechargeItems" wx:for="{{recharge_data}}" bindtap="checkRechargeData" data-id="{{item.id}}"> | ||
| 20 | + <view class="font24r">充<text>{{item.recharge_money}}</text>元</view> | ||
| 21 | + <view class="font24r" wx:if="{{item.recharge_list.price && item.recharge_list.price*1 > 0}}">送{{item.recharge_list.price}}元</view> | ||
| 22 | + </view> | ||
| 23 | + </view> | ||
| 24 | + <view class="rechargeItems rechargeItems1"> | ||
| 25 | + <text class="font36r">¥</text><input class="font28r" maxlength="5" type="number" placeholder="输入自定义金额" /> | ||
| 26 | + </view> | ||
| 27 | + <view class="infoAgreement font24r">充值即代表同意<text>《用户协议》</text>及<text>《会员充值协议》</text></view> | ||
| 28 | +</view> | ||
| 29 | +<view class="payBtnBox"> | ||
| 30 | + <view class="payBtn font32r" bindtap="confirmPayment">提交充值</view> | ||
| 31 | +</view> |
miniprogram/pages/me/myBalance.wxss
0 → 100644
| 1 | +/* pages/me/myBalance.wxss */ | ||
| 2 | +page { | ||
| 3 | + background: #F5F5F5; | ||
| 4 | +} | ||
| 5 | + | ||
| 6 | +.topBox { | ||
| 7 | + padding: 20rpx 40rpx; | ||
| 8 | + border-radius: 10rpx; | ||
| 9 | + background: #ffffff; | ||
| 10 | + margin: 12rpx; | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +.names { | ||
| 14 | + border-bottom: 2rpx solid #CBCBCB; | ||
| 15 | + display: flex; | ||
| 16 | + padding-bottom: 20rpx; | ||
| 17 | + align-items: center; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +.names image { | ||
| 21 | + width: 60rpx; | ||
| 22 | + height: 60rpx; | ||
| 23 | + border-radius: 10rpx; | ||
| 24 | + margin-right: 20rpx; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +.names view { | ||
| 28 | + color: #000000; | ||
| 29 | + font-family: "PingFang SC"; | ||
| 30 | + font-weight: 500; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.info { | ||
| 34 | + font-family: "PingFang SC"; | ||
| 35 | + font-weight: 600; | ||
| 36 | + font-size: 28rpx; | ||
| 37 | + margin: 20rpx 0; | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +.news { | ||
| 41 | + display: flex; | ||
| 42 | + align-items: center; | ||
| 43 | + justify-content: space-between; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +.priceInfo { | ||
| 47 | + color: #fe6d03; | ||
| 48 | + font-family: "PingFang SC"; | ||
| 49 | + font-weight: 500; | ||
| 50 | + font-size: 60rpx; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +.details { | ||
| 54 | + font-family: "PingFang SC"; | ||
| 55 | + font-weight: 400; | ||
| 56 | + border: 2rpx solid #fe6d03; | ||
| 57 | + padding: 8rpx 28rpx; | ||
| 58 | + border-radius: 198rpx; | ||
| 59 | + color: #fe6d03; | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +.bottomBox { | ||
| 63 | + padding: 20rpx 40rpx; | ||
| 64 | + border-radius: 10rpx; | ||
| 65 | + background: #ffffff; | ||
| 66 | + margin: 0 12rpx; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +.rechargeBox { | ||
| 70 | + display: flex; | ||
| 71 | + align-items: center; | ||
| 72 | + justify-content: space-between; | ||
| 73 | + flex-wrap: wrap; | ||
| 74 | + margin-top: 28rpx; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +.rechargeItems { | ||
| 78 | + width: 46%; | ||
| 79 | + padding: 20rpx 0rpx; | ||
| 80 | + border-radius: 10rpx; | ||
| 81 | + border: 2rpx solid #cbcbcb; | ||
| 82 | + background: #fff7f5; | ||
| 83 | + color: #B56737; | ||
| 84 | + display: flex; | ||
| 85 | + align-items: center; | ||
| 86 | + flex-direction: column; | ||
| 87 | + justify-content: center; | ||
| 88 | + margin-bottom: 28rpx; | ||
| 89 | + height: 84rpx; | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +.rechargeItems view text { | ||
| 93 | + font-size: 48rpx; | ||
| 94 | + margin: 0 4rpx; | ||
| 95 | + font-family: PingFang SC; | ||
| 96 | + font-weight: 600; | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | + | ||
| 100 | +.rechargeItems view text:nth-last-of-type(1) { | ||
| 101 | + font-size: 48rpx; | ||
| 102 | + font-family: PingFang SC; | ||
| 103 | + font-weight: 600; | ||
| 104 | +} | ||
| 105 | + | ||
| 106 | +.rechargeItems view { | ||
| 107 | + display: flex; | ||
| 108 | + align-items: center; | ||
| 109 | + justify-content: center; | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +.rechargeItems1 { | ||
| 113 | + width: 100%; | ||
| 114 | + flex-direction: row; | ||
| 115 | + justify-content: flex-start; | ||
| 116 | + padding-left: 20rpx; | ||
| 117 | + box-sizing: border-box; | ||
| 118 | +} | ||
| 119 | + | ||
| 120 | +.rechargeItems1 input { | ||
| 121 | + flex: 1; | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +.infoAgreement { | ||
| 125 | + color: #696969; | ||
| 126 | + font-family: "PingFang SC"; | ||
| 127 | + font-weight: 400; | ||
| 128 | +} | ||
| 129 | + | ||
| 130 | +.infoAgreement text { | ||
| 131 | + color: #ED7B2F; | ||
| 132 | +} | ||
| 133 | + | ||
| 134 | +.payBtnBox { | ||
| 135 | + position: fixed; | ||
| 136 | + left: 0; | ||
| 137 | + bottom: 0; | ||
| 138 | + height: 160rpx; | ||
| 139 | + padding: 0 40rpx; | ||
| 140 | + box-sizing: border-box; | ||
| 141 | + z-index: 10; | ||
| 142 | + justify-content: space-between; | ||
| 143 | + width: 100%; | ||
| 144 | + background: #fff; | ||
| 145 | + display: flex; | ||
| 146 | + align-items: center; | ||
| 147 | + justify-content: space-between; | ||
| 148 | +} | ||
| 149 | + | ||
| 150 | +.payBtn { | ||
| 151 | + background: linear-gradient(90deg, #fe6d03 0%, #fe7600 100%); | ||
| 152 | + color: #fff; | ||
| 153 | + width: 80%; | ||
| 154 | + height: 72rpx; | ||
| 155 | + border-radius: 198rpx; | ||
| 156 | + font-weight: 600; | ||
| 157 | + margin-right: 20rpx; | ||
| 158 | + padding: 0 60rpx; | ||
| 159 | + display: flex; | ||
| 160 | + align-items: center; | ||
| 161 | + justify-content: center; | ||
| 162 | +} |
-
Please register or login to post a comment