Commit a3555b3f6a9a68e32ed07ccbbac40216ee7bc4e2

Authored by pengye
1 parent c2128e2b

更新券数量、充值页去掉倒计时

... ... @@ -67,7 +67,8 @@
"pages/reserve/sellerGift",
"pages/customer/login",
"pages/me/consumeAmount",
"pages/me/consumeDetails"
"pages/me/consumeDetails",
"pages/me/myBalance"
],
"requiredPrivateInfos": [
"getLocation",
... ...
... ... @@ -3,6 +3,7 @@ import util from '../../utils/util'
Component({
data:{
menuhidden:true,
customer_activity:'',
url:'pages/reserve/index_new',
},
attached: function() {
... ... @@ -10,8 +11,25 @@ Component({
this.getuser();
this.getautomenu();
this.getorder();
this.getlist()
},
methods:{
//获取用户未使用优惠券列表数量
getlist() {
App.Activity.GetNewRechargeListByOpenid({
openid: getApp().openid,
}).then((res) => {
if (res.ret == 200) {
let list = res.data;
list = list.filter(item => {
return (item.recharge_name || item.aname)
})
this.setData({
'customer_activity': list.length,
})
}
})
},
getuser(){
App.User.GetBalance().then(res=>{
this.setData({
... ...
... ... @@ -46,13 +46,13 @@
<block wx:if="{{'pages/me/coupon_news'!=url}}">
<view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon_news">
<view class="font24r">卡包</view>
<view class="font24r">({{user.customer_activity}})</view>
<view class="font24r">({{customer_activity}})</view>
</view>
</block>
<block wx:else>
<view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon_news">
<view class="font24r">卡包</view>
<view class="font24r">({{user.customer_activity}})</view>
<view class="font24r">({{customer_activity}})</view>
</view>
</block>
<!-- <block wx:if="{{'pages/me/invitation'!=url}}">
... ...
... ... @@ -4,6 +4,7 @@
"usingComponents": {
"nav": "/components/nav/nav",
"my-modal": "/components/modal/modal",
"toast": "/components/toast/index"
"toast": "/components/toast/index",
"scroll-number": "/components/scroll-number/index"
}
}
\ No newline at end of file
... ...
... ... @@ -16,8 +16,6 @@ Page({
types: '',
},
type: '',
time: 300,
countdown: '',
name: "",
date: "",
phone: "",
... ... @@ -48,6 +46,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('options---',options);
this.setData({
opt: {
detail: options.detail ? JSON.parse(options.detail) : '',
... ... @@ -73,7 +72,6 @@ Page({
calendarData: obj.calendarData,
})
}
this.countdown()
this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
this.getSellerTemplateConfFun(options.sid)
},
... ... @@ -154,7 +152,7 @@ Page({
}
})
},
// 支付成功/失败回调 types 1邀请函 2提前点餐 3商家端app分享
// 支付成功/失败回调 types 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值
callbackFun() {
let that = this;
let url = '/pack-invitation/pages/detail_owner_invitation1?id=' + that.data.opt.detail.oid;
... ... @@ -187,6 +185,9 @@ Page({
if (that.data.opt.types == '3') {
url = '/pages/reserve/index_new';
}
if (that.data.opt.types == '4' || this.data.opt.types == '5') {
return wx.navigateBack(2)
}
setTimeout(function () {
wx.reLaunch({
url
... ... @@ -228,9 +229,6 @@ Page({
},
// 点击确认支付
formSubmit() {
if (this.data.time == 0) {
return util.toast('当前订单已过期,请重新进入优惠券购买页面下单', 'none');
}
if (this.data.type == '2') {
let data = this.data
if (!data.name) {
... ... @@ -343,26 +341,10 @@ Page({
onShow() {
},
// 倒计时
countdown() {
var minute = Math.floor(this.data.time * 1 / 60);
var second = this.data.time % 60;
second < 10 ? second = '0' + second : '';
this.setData({
countdown: minute + ':' + second,
time: this.data.time - 1
})
if (this.data.time == 0) {
this.setData({
countdown: '0:00'
})
return false;
}
setTimeout(this.countdown, 1000);
},
// 返回
navEvent() {
// 1 邀请函 2 提前点餐 3商家端分享
console.log('types---------',this.data.opt.types);
// 1 邀请函 2 提前点餐 3商家端分享 4支付页充值 5我的页面余额充值
if (this.data.opt.types == '1') {
let arr = [9, 10, 11, 12, 13, 14, 15, 16, 17];
let StyleType = this.data.StyleType
... ... @@ -401,6 +383,9 @@ Page({
url: '/pages/reserve/index_new',
})
}
if (this.data.opt.types == '4' || this.data.opt.types == '5') {
wx.navigateBack(2)
}
},
/**
* 生命周期函数--监听页面隐藏
... ...
<!--pack-activity/pack/confirmPayment.wxml 代金券和充值支付页面-->
<nav bindNavEvent="navEvent" back="none">{{opt.detail.name}}</nav>
<nav bindNavEvent="navEvent">{{opt.detail.name}}</nav>
<view class="box_wrap">
<view wx:if="{{type=='1'}}" class="box">
<view class="countdown font24r">
支付剩余时间 {{countdown}}
</view>
<view class="money_text">
¥{{opt.totalize}}
</view>
... ... @@ -48,12 +45,6 @@
{{opt.detail.recharge_money}}元
</view>
</view>
<view class="page-section">
<view class="page-section-title font32r">支付剩余时间 </view>
<view class="weui-cells weui-cell__bd sum colorSty">
{{countdown}}
</view>
</view>
<view wx:if="{{type=='2'}}" class="fixed_box">
<button class="font32r btns" formType="submit">确认支付
</button>
... ...
... ... @@ -29,7 +29,7 @@
font-family: PingFang SC;
font-weight: 500;
font-size: 64rpx;
margin: 44rpx 0;
margin: 20% 0 44rpx 0;
}
.nameText {
... ...
... ... @@ -12,7 +12,7 @@ Page({
id:'',
sid:'',
oid:'',
types:'',// 1邀请函 2提前点餐 3商家端app分享
types:'',// 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值
rid:'',
},
exp_date:{},
... ... @@ -98,7 +98,7 @@ Page({
if(res.ret=='200'){
let url = util.http_build_query({
type:'2',
types: this.data.opt.types,// 1邀请函 2提前点餐 3商家端app分享
types: this.data.opt.types,// 1邀请函 2提前点餐 3商家端app分享 4支付页充值 5我的页面余额充值
detail: JSON.stringify(detail),
sid: this.data.opt.sid,
combine_out_trade_no:res.data.combine_out_trade_no,
... ...
... ... @@ -7,6 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
type:'',//1消费金 2余额
sellerList: [],
},
... ... @@ -14,7 +15,14 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getInfo()
console.log('options',options);
let type = options.type;
if(type){
this.setData({
type
})
}
if(type == 1) this.getInfo()
},
// 获取用户消费金商家余额列表
getInfo() {
... ... @@ -32,11 +40,20 @@ Page({
},
// 跳转用户商家消费金消费记录
getSeller(event) {
wx.navigateTo({
url: util.http_build_query({
sellerid: event.currentTarget.dataset.id
}, '/pages/me/consumeDetails')
})
if (this.data.type == '1') {
wx.navigateTo({
url: util.http_build_query({
sellerid: event.currentTarget.dataset.id,
type: this.data.type,
}, '/pages/me/consumeDetails')
})
} else {
wx.navigateTo({
url: util.http_build_query({
sellerid: event.currentTarget.dataset.id,
}, '/pages/me/myBalance')
})
}
},
// 换号查看
switchAccount() {
... ...
<!--pages/me/consumeAmount.wxml-->
<wxs src="../../utils/util.wxs" module="util" />
<nav hasHome>我的消费金</nav>
<nav hasHome>我的{{type == '1' ? '消费金' : '余额'}}</nav>
<view class="{{sellerList.length>0?'box':'box1'}}">
<block wx:if="{{sellerList.length>0}}">
<view class="items" wx:for="{{sellerList}}" bind:tap="getSeller" data-id="{{item.sellerid}}">
... ...
... ... @@ -7,6 +7,7 @@ Page({
* 页面的初始数据
*/
data: {
type: '', //1消费金 2余额
sellerid: '',
consumeList: []
},
... ... @@ -15,10 +16,25 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
sellerid: options.sellerid
console.log('options', options);
let type = options.type;
if (type) {
this.setData({
type,
sellerid: options.sellerid
})
}
if (type == 1) this.getInfo(options.sellerid)
},
getSeller() {
let type = this.data.type;
if (type == '1') return
wx.navigateTo({
url: util.http_build_query({
sellerid: event.currentTarget.dataset.id,
type: this.data.type,
}, '/pages/me/myBalance')
})
this.getInfo(options.sellerid)
},
getInfo(sellerid) {
App.Activity.GetConsumeListByOpenid({
... ...
<!--pages/me/consumeDetails.wxml-->
<wxs src="../../utils/util.wxs" module="util" />
<nav hasHome>消费金明细</nav>
<nav hasHome>{{type == '1'?'消费金':'余额'}}明细</nav>
<view class="box">
<view class="items" wx:for="{{consumeList}}" bind:tap="getSeller" data-id="{{item.sellerid}}">
<view class="topInfo">
<view class="types font28r">{{item.type=='1'?'消耗':'获取'}}</view>
<view class="types font28r" wx:if="{{type == '1'}}">{{item.type=='1'?'消耗':'获取'}}</view>
<view class="types font28r" wx:else>{{item.type=='1'?'消费':'充值'}}</view>
<view class="priceInfo font40r {{item.type=='1'?'colors1':'colors2'}}">{{item.type=='1'?'-':'+'}}¥{{item.price}}</view>
</view>
<view class="bottomInfo">
... ...
... ... @@ -36,12 +36,18 @@
<view class="money-title">卡券</view>
</view>
</navigator>
<navigator url="/pages/me/consumeAmount" class="money-item">
<navigator url="/pages/me/consumeAmount?type=1" class="money-item">
<view class="flex-vc">
<view class="money-value">¥{{price?price:'0.00'}}</view>
<view class="money-title">消费金</view>
</view>
</navigator>
<!-- <navigator url="/pages/me/consumeAmount?type=2" class="money-item">
<view class="flex-vc">
<view class="money-value">¥{{user.balance.price||0}}</view>
<view class="money-title">余额</view>
</view>
</navigator> -->
</view>
<view class="block-rev">
<navigator url="/pages/me/list" open-type="redirect">
... ...
// pages/me/myBalance.js
import App from '../../utils/api';
import util from '../../utils/util';
Page({
/**
* 页面的初始数据
*/
data: {
sellerid: '',
seller: {},
dataStr: Date.now() * 1 / 1000,
recharge_data: [], //所有满赠充值活动
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
sellerid: options.sellerid
})
this.getSellerDetailFun(options.sellerid)
this.getRechargeDetail(options.sellerid)
},
// 获取店铺名称
getSellerDetailFun(sid) {
App.Customer.GetSellerDetail({
sid
}).then(res => {
let data = res.data;
this.setData({
seller: {
seller_image: data.seller_image,
sellername: data.sellername,
sid: data.id
}
})
})
},
// 根据充值ID获取充值详情
getRechargeDetail(sellerid) {
App.Activity.GetNewRechargeList({
sellerid,
}).then(res => {
if (res.data) {
let arr = []
res.data.forEach(i => {
if (i.status != '1') {
arr.push(i)
}
})
let recharge_data = arr;
console.log('arrarr-----', arr);
recharge_data.forEach(item => {
item.recharge_list = item.recharge_list ? JSON.parse(item.recharge_list) : '';
let recharge_list = item.recharge_list;
item.priceInfo = '';
item.scoreInfo = '';
item.certificate = '';
if (recharge_list.is_price == '1') item.priceInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.price + '元余额';
if (recharge_list.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) item.certificate = recharge_list.coupons_names.join('、');
item.timeStr = util.unixtoTime(item.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(item.etime, 'YYYY-MM-DD')
})
// 筛选出 未过期的 && 开启状态的充值活动
recharge_data = recharge_data.filter(item => {
return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
})
console.log('所有充值活动--------------', recharge_data);
this.setData({
recharge_data,
})
} else {
this.setData({
recharge_data: [],
})
}
})
},
// 跳转用户商家消费金消费记录
getSeller() {
wx.navigateTo({
url: util.http_build_query({
sellerid: this.data.sellerid,
type: '2',
}, '/pages/me/consumeDetails')
})
},
// 选择充值活动
checkRechargeData(e) {
let id = e.currentTarget.dataset['id'];
wx.navigateTo({
url: util.http_build_query({
id,
name: this.data.seller.sellername,
sid: this.data.sellerid,
types: '5'
}, '/pack-activity/pack/vipRecharge')
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {
"nav": "/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/me/myBalance.wxml-->
<nav>我的余额</nav>
<view class="topBox">
<view class="names">
<image src="{{seller.seller_image}}" mode="aspectFill" />
<view class="font32r">{{seller.sellername}}</view>
</view>
<view class="balance">
<view class="info font28r">我的余额</view>
<view class="news">
<view class="priceInfo">¥500.00</view>
<view class="details font24r" bind:tap="getSeller">余额明细</view>
</view>
</view>
</view>
<view class="bottomBox">
<view class="info font28r">储值优惠活动</view>
<view class="rechargeBox">
<view class="rechargeItems" wx:for="{{recharge_data}}" bindtap="checkRechargeData" data-id="{{item.id}}">
<view class="font24r">充<text>{{item.recharge_money}}</text>元</view>
<view class="font24r" wx:if="{{item.recharge_list.price && item.recharge_list.price*1 > 0}}">送{{item.recharge_list.price}}元</view>
</view>
</view>
<view class="rechargeItems rechargeItems1">
<text class="font36r">¥</text><input class="font28r" maxlength="5" type="number" placeholder="输入自定义金额" />
</view>
<view class="infoAgreement font24r">充值即代表同意<text>《用户协议》</text>及<text>《会员充值协议》</text></view>
</view>
<view class="payBtnBox">
<view class="payBtn font32r" bindtap="confirmPayment">提交充值</view>
</view>
\ No newline at end of file
... ...
/* pages/me/myBalance.wxss */
page {
background: #F5F5F5;
}
.topBox {
padding: 20rpx 40rpx;
border-radius: 10rpx;
background: #ffffff;
margin: 12rpx;
}
.names {
border-bottom: 2rpx solid #CBCBCB;
display: flex;
padding-bottom: 20rpx;
align-items: center;
}
.names image {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
margin-right: 20rpx;
}
.names view {
color: #000000;
font-family: "PingFang SC";
font-weight: 500;
}
.info {
font-family: "PingFang SC";
font-weight: 600;
font-size: 28rpx;
margin: 20rpx 0;
}
.news {
display: flex;
align-items: center;
justify-content: space-between;
}
.priceInfo {
color: #fe6d03;
font-family: "PingFang SC";
font-weight: 500;
font-size: 60rpx;
}
.details {
font-family: "PingFang SC";
font-weight: 400;
border: 2rpx solid #fe6d03;
padding: 8rpx 28rpx;
border-radius: 198rpx;
color: #fe6d03;
}
.bottomBox {
padding: 20rpx 40rpx;
border-radius: 10rpx;
background: #ffffff;
margin: 0 12rpx;
}
.rechargeBox {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 28rpx;
}
.rechargeItems {
width: 46%;
padding: 20rpx 0rpx;
border-radius: 10rpx;
border: 2rpx solid #cbcbcb;
background: #fff7f5;
color: #B56737;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
margin-bottom: 28rpx;
height: 84rpx;
}
.rechargeItems view text {
font-size: 48rpx;
margin: 0 4rpx;
font-family: PingFang SC;
font-weight: 600;
}
.rechargeItems view text:nth-last-of-type(1) {
font-size: 48rpx;
font-family: PingFang SC;
font-weight: 600;
}
.rechargeItems view {
display: flex;
align-items: center;
justify-content: center;
}
.rechargeItems1 {
width: 100%;
flex-direction: row;
justify-content: flex-start;
padding-left: 20rpx;
box-sizing: border-box;
}
.rechargeItems1 input {
flex: 1;
}
.infoAgreement {
color: #696969;
font-family: "PingFang SC";
font-weight: 400;
}
.infoAgreement text {
color: #ED7B2F;
}
.payBtnBox {
position: fixed;
left: 0;
bottom: 0;
height: 160rpx;
padding: 0 40rpx;
box-sizing: border-box;
z-index: 10;
justify-content: space-between;
width: 100%;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.payBtn {
background: linear-gradient(90deg, #fe6d03 0%, #fe7600 100%);
color: #fff;
width: 80%;
height: 72rpx;
border-radius: 198rpx;
font-weight: 600;
margin-right: 20rpx;
padding: 0 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
... ...