积分抵扣、霸王餐、优惠券分享新增
This commit is contained in:
@@ -91,6 +91,10 @@
|
||||
})
|
||||
},
|
||||
memberindex(url) {
|
||||
// uni.pro.navigateTo("/pagesInviteFriends/index/index", {
|
||||
// shopId: uni.cache.get('shopId'),
|
||||
// type: 'index',
|
||||
// })
|
||||
uni.pro.navigateTo(url, {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index',
|
||||
|
||||
@@ -1,723 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<view class="location" @click="openLocation">
|
||||
<image class="location_icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/location.png" mode="aspectFill"></image>
|
||||
<view>{{ shopUserInfo.shopName }}</view>
|
||||
<u-icon name="arrow-right" color="#575B66" size="28"></u-icon>
|
||||
</view>
|
||||
|
||||
<view class="card_info flex-colum">
|
||||
<view class="title">账户余额(元)</view>
|
||||
<view class="card_info_con flex-between">
|
||||
<view class="balance">{{shopUserInfo.amount || '0.00'}}</view>
|
||||
<view class="card_info_con_right flex-end">
|
||||
<view class ="card_info_con_right_item flex-colum" @click="handleClick(item)" v-for="(item,index) in cardManageList" :key="index">
|
||||
<image class="card_info_con_right_item_icon" :src="item.icon" mode="aspectFill"></image>
|
||||
<text class="card_info_con_right_item_text">{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="customAmount" v-if="shopUserInfo.isUser == 1">
|
||||
<view class="customAmount_left">
|
||||
<text class="customAmount_left_tip">¥</text>
|
||||
<u-input
|
||||
type="number"
|
||||
v-model="amount"
|
||||
inputAlign="left"
|
||||
:placeholder="`充${amount}送${giftAmount}`"
|
||||
:customStyle="{border: '0'}"
|
||||
@input="amountChange"
|
||||
></u-input>
|
||||
</view>
|
||||
<text class="customAmount_right">自定义金额</text>
|
||||
</view>
|
||||
<view class="rechargeList">
|
||||
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
||||
<view class="rechargeList_item flex-colum " :class="index === inputshow?'active':''">
|
||||
<view class="rechargeList_item_title">充值</view>
|
||||
<view class="flex-colum-start">
|
||||
<view class="rechargeList_item_amount">¥<text>{{item.amount}}</text></view>
|
||||
<view class="rechargeList_item_gift" v-show="index === inputshow">
|
||||
<image class="rechargeList_item_gift_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/gift_icon.png" mode="aspectFill"></image>
|
||||
<view class="rechargeList_item_gift_text">
|
||||
<text>赠{{inputshow}}</text>
|
||||
<text>¥{{ item.giftAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rechargeList_item_handsel" v-show="index !== inputshow">赠送{{item.giftAmount}}元</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="gift" v-if="giftList && giftList.length > 0">
|
||||
<view class="gift_title">您将获得:</view>
|
||||
<view class="gift_list">
|
||||
<view class="gift_list_item" v-for="(item,index) in giftList" :key="index">
|
||||
<text class="icon"></text>
|
||||
<text class="text"> {{ item }} </text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="explain">
|
||||
<view class="explain-top flex-between">
|
||||
<text class="explain-top_title">适用门店</text>
|
||||
<text class="shopName">{{ shopUserInfo.shopName }}</text>
|
||||
</view>
|
||||
<view class="explain_content">
|
||||
<text class="explain_content_title">充值说明</text>
|
||||
<text class="explain_content_text">1.充值金额1家门店可用</text>
|
||||
<text class="explain_content_text">2.储值完成后不支持自助退款,可联系商家处理</text>
|
||||
<text class="explain_content_text">3.钱包余额不支持转赠,不可提现,长期有效</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="rechargeBox">
|
||||
<view class="agreement" @click="isProtocol = !isProtocol">
|
||||
<u-checkbox-group >
|
||||
<u-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F" @change="radioChange" size="35" iconSize="20">
|
||||
</u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text>已同意</text>
|
||||
<text class="agreement_text" @click.stop="viewProtocol">《用户隐私协议》</text>
|
||||
<!-- <text class="agreement_text" @click="viewProtocol">《用户储值协议》</text> -->
|
||||
<!-- <text class="agreement_text" @click="viewProtocol">《用户授权协议》</text> -->
|
||||
</view>
|
||||
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
|
||||
</view>
|
||||
<registermember :show="memberOpen" :shopId="shopId" @getRegisterMember="getRegisterMember"></registermember>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import registermember from './components/registermember.vue'
|
||||
export default {
|
||||
components: {
|
||||
registermember
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputshow: 0,
|
||||
memberOpen: false,
|
||||
isProtocol: false,
|
||||
listdata: [],
|
||||
amount: 0,
|
||||
giftAmount: 0,
|
||||
userInfo: {},
|
||||
shopUserInfo: null,
|
||||
shopId: '',
|
||||
giftList: [],
|
||||
cardManageList: [
|
||||
{name: "明细", url: "member/billDetails",icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/detail.png"},
|
||||
{name: "管理", url: "member/storedManage",icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/manage.png"}
|
||||
],
|
||||
type: "",
|
||||
}
|
||||
},
|
||||
async onLoad(options) {
|
||||
// if ( e.type == 'list' || e.type == 'index') {
|
||||
// this.shopId = e.shopId;
|
||||
// this.init();
|
||||
// }
|
||||
|
||||
uni.cache.set('forceUpdate',1)
|
||||
// #ifdef MP-WEIXIN
|
||||
if (options.q) {
|
||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
this.tokenShow = false;
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
// #endif
|
||||
|
||||
if (options.shopId) {
|
||||
this.shopId = options.shopId
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
}
|
||||
if (options.type) {
|
||||
this.type = options.type
|
||||
}
|
||||
if ( options.amount ) { this.amount = options.amount; }
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
async shopInfo() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
shopId: this.shopId,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.shopUserInfo = res.data;
|
||||
uni.cache.remove('memberOpen',this.memberOpen)
|
||||
if ( this.shopUserInfo.isVip == 0 ) {
|
||||
this.memberOpen = true;
|
||||
uni.cache.set('memberOpen',this.memberOpen)
|
||||
}
|
||||
} else {
|
||||
let pages = getCurrentPages()
|
||||
if ( pages.length > 1) {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.exitMiniProgram({
|
||||
success: function() {
|
||||
console.log('退出小程序成功');
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('退出小程序失败', err);
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.$forceUpdate();
|
||||
console.log(this.memberOpen)
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取充值金额列表
|
||||
*/
|
||||
async paygetActive() {
|
||||
let res = await this.api.paygetActive({
|
||||
shopId: this.shopId,
|
||||
page: 1,
|
||||
pageSize: 99
|
||||
})
|
||||
|
||||
try {
|
||||
this.listdata = res.data.list;
|
||||
this.giftList = this.listdata[0].gives;
|
||||
this.giftAmount = this.listdata[0].giftAmount
|
||||
if ( this.type == 'topUpActivity') {
|
||||
this.amountChange()
|
||||
} else {
|
||||
this.amount = this.listdata[0].amount;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听金额修改
|
||||
*/
|
||||
amountChange () {
|
||||
let item = this.listdata.filter(item=>this.amount==item.amount)
|
||||
|
||||
if ( item.length > 0 ) {
|
||||
this.listdata.forEach((v,e)=>{
|
||||
if ( this.amount == v.amount) {
|
||||
this.inputshow = e;
|
||||
this.clickinput(v,e)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.inputshow = '';
|
||||
this.giftList = [];
|
||||
this.giftAmount = '';
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 进入明细\管理
|
||||
* @param {Object} e
|
||||
*/
|
||||
handleClick (item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/${item.url}?shopUserInfo=${JSON.stringify(this.shopUserInfo)}`
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 查看协议
|
||||
*/
|
||||
viewProtocol (){
|
||||
wx.openPrivacyContract({
|
||||
success: () => {}, // 打开成功
|
||||
fail: () => {}, // 打开失败
|
||||
complete: () => {}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 是否同意协议
|
||||
* @param {Object} n
|
||||
*/
|
||||
radioChange(n) {
|
||||
this.isProtocol = n;
|
||||
},
|
||||
|
||||
/**
|
||||
* 注册会员卡
|
||||
* @param {Object} e
|
||||
*/
|
||||
getRegisterMember (e) {
|
||||
this.memberOpen = e;
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
},
|
||||
|
||||
/**
|
||||
* 拉起地图
|
||||
*/
|
||||
openLocation () {
|
||||
console.log('123');
|
||||
uni.openLocation({
|
||||
latitude: Number(this.shopUserInfo.lat), // 目的地的纬度,浮点数,范围为-90~90
|
||||
longitude: Number(this.shopUserInfo.lng), // 目的地的经度,浮点数,范围为-180~180
|
||||
scale: 18, // 缩放比例,范围5~18
|
||||
name: this.shopUserInfo.shopName, // 位置名
|
||||
address: this.shopUserInfo.address, // 地址的详细说明
|
||||
success() {
|
||||
console.log('导航启动成功');
|
||||
|
||||
},
|
||||
fail(error) {
|
||||
console.log('导航启动失败', error);
|
||||
if ( error.errMsg == "openLocation:fail invalid_coordinate") {
|
||||
uni.showToast({
|
||||
title: "门店经纬度无效",
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 解析地址传参
|
||||
* @param {Object} url
|
||||
* @param {Object} name
|
||||
*/
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* 充值金额切换
|
||||
* @param {Object} a
|
||||
* @param {Object} b
|
||||
*/
|
||||
clickinput(a, b) {
|
||||
this.inputshow = b;
|
||||
this.giftList = a.gives;
|
||||
this.amount = a.amount;
|
||||
this.giftAmount = a.giftAmount;
|
||||
},
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
async userbalancerechangesub() {
|
||||
let _this = this;
|
||||
if (!this.isProtocol) {
|
||||
uni.showToast({
|
||||
title: '请勾选协议',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.amount == null || this.amount == '') {
|
||||
uni.showToast({
|
||||
title: '金额不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.amount <= 0) {
|
||||
uni.showToast({
|
||||
title: '金额必须大于0',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.paymemeberIn({
|
||||
shopId: this.shopId, // 判断显示哪家的作品,
|
||||
amount: this.amount // 判断显示哪家的作品,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.nonceStr, // 随机字符串
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
uni.hideLoading()
|
||||
let pages = getCurrentPages()
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||
complete() {
|
||||
if ( _this.type && _this.type == "topUpActivity") {
|
||||
uni.pro.navigateBack()
|
||||
} else {
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
uni.hideLoading()
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 16rpx 20rpx 245rpx 20rpx;
|
||||
|
||||
.location{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding: 16rpx 28rpx 18rpx 28rpx;
|
||||
margin-bottom: 32rpx;
|
||||
border-radius: 12rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
.location_icon{
|
||||
width: 20rpx;
|
||||
height: 26rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card_info{
|
||||
width: 100%;
|
||||
height: 182rpx;
|
||||
background: linear-gradient( 132deg, #D6B68D 0%, #E6D6BC 100%);
|
||||
border-radius: 12rpx;
|
||||
padding: 32rpx 28rpx;
|
||||
align-items: initial;
|
||||
margin-bottom: 26rpx;
|
||||
.title{
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.card_info_con{
|
||||
align-items: flex-end;
|
||||
.balance{
|
||||
font-weight: 400;
|
||||
font-size: 48rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.card_info_con_right{
|
||||
.card_info_con_right_item{
|
||||
margin-left: 64rpx;
|
||||
.card_info_con_right_item_icon{
|
||||
width: 40rpx;
|
||||
height: 36rpx;
|
||||
margin-bottom: 5rpx;
|
||||
}
|
||||
.card_info_con_right_item_text{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.customAmount{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 14rpx 16rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
.customAmount_left{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.customAmount_left_tip{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
input{
|
||||
width: 100%;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
padding-left: 16rpx;
|
||||
}
|
||||
}
|
||||
.customAmount_right{
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.rechargeList{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.rechargeList_f{
|
||||
width: 33.333%;
|
||||
margin-bottom: 30rpx;
|
||||
padding-right: 20rpx;
|
||||
padding-left: 0;
|
||||
.rechargeList_item{
|
||||
border-radius: 0rpx 48rpx 0rpx 0rpx;
|
||||
border: 4rpx solid #E5E5E5;
|
||||
align-items: initial;
|
||||
padding: 26rpx 22rpx;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
.rechargeList_item_title{
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.rechargeList_item_title,.rechargeList_item_handsel{
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.rechargeList_item_amount{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
text{
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
.rechargeList_item_handsel{
|
||||
|
||||
}
|
||||
.rechargeList_item_gift{
|
||||
width: 92.52rpx;
|
||||
height: 88.74rpx;
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
right: 12rpx;
|
||||
.rechargeList_item_gift_bg{
|
||||
width: 92.52rpx;
|
||||
height: 88.74rpx;
|
||||
position: absolute;
|
||||
}
|
||||
.rechargeList_item_gift_text{
|
||||
width: 92.52rpx;
|
||||
height: 88.74rpx;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text:nth-child(1){
|
||||
font-weight: bold;
|
||||
font-size: 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
text:nth-child(2){
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.rechargeList_item.active{
|
||||
border: 4rpx solid #DCC19E;
|
||||
background: linear-gradient( 133deg, #F9F6ED 0%, #FFFFFF 100%);
|
||||
.rechargeList_item_title{
|
||||
color: #F7664E;
|
||||
margin-bottom: 47rpx;
|
||||
}
|
||||
.rechargeList_item_amount{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #FB604A;
|
||||
text{
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #FB604A;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rechargeList_f:nth-child(3n-1){
|
||||
padding-right: 10rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
.rechargeList_f:nth-child(3n){
|
||||
padding-right: 0;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.gift{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 22rpx;
|
||||
margin-bottom: 48rpx;
|
||||
.gift_title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.gift_list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.gift_list_item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.icon{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #F7853D;
|
||||
margin-right: 8rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.text{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.explain{
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 22rpx 24rpx;
|
||||
margin-bottom: 30rpx;
|
||||
.explain-top{
|
||||
// align-items: center;
|
||||
margin-bottom: 18rpx;
|
||||
.explain-top_title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.shopName{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.explain_content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.explain_content_title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.explain_content_text{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rechargeBox{
|
||||
width: 100%;
|
||||
padding: 0 28rpx 84rpx 28rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
.agreement{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding-top: 16rpx;
|
||||
padding-bottom: 20rpx;
|
||||
text{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.agreement_text{
|
||||
color: #E3AD7F;
|
||||
}
|
||||
}
|
||||
.recharge {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
background: #E3AD7F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -23,30 +23,32 @@
|
||||
<view class="customAmount" v-if="shopUserInfo.isUser == 1">
|
||||
<view class="customAmount_left">
|
||||
<text class="customAmount_left_tip">¥</text>
|
||||
<u-input
|
||||
<input
|
||||
type="number"
|
||||
v-model="amount"
|
||||
inputAlign="left"
|
||||
:placeholder="`充${minNum}送${handselNum}`"
|
||||
:placeholder="`充${amount}送${giftAmount}`"
|
||||
:customStyle="{border: '0'}"
|
||||
></u-input>
|
||||
controlled="true"
|
||||
@input="amountChange"
|
||||
></input>
|
||||
</view>
|
||||
<text class="customAmount_right">自定义金额</text>
|
||||
</view>
|
||||
<view class="rechargeList">
|
||||
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
||||
<view class="rechargeList_item flex-colum " :class="index == inputshow?'active':''">
|
||||
<view class="rechargeList_item flex-colum " :class="index === inputshow?'active':''">
|
||||
<view class="rechargeList_item_title">充值</view>
|
||||
<view class="flex-colum-start">
|
||||
<view class="rechargeList_item_amount">¥<text>{{item.minNum}}</text></view>
|
||||
<view class="rechargeList_item_gift" v-show="index == inputshow">
|
||||
<view class="rechargeList_item_amount">¥<text>{{item.amount}}</text></view>
|
||||
<view class="rechargeList_item_gift" v-show="index === inputshow">
|
||||
<image class="rechargeList_item_gift_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/gift_icon.png" mode="aspectFill"></image>
|
||||
<view class="rechargeList_item_gift_text">
|
||||
<text>赠</text>
|
||||
<text>¥{{ item.handselNum }}</text>
|
||||
<text>赠{{inputshow}}</text>
|
||||
<text>¥{{ item.giftAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rechargeList_item_handsel" v-show="index != inputshow">赠送{{item.handselNum}}元</view>
|
||||
<view class="rechargeList_item_handsel" v-show="index !== inputshow">赠送{{item.giftAmount}}元</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -108,8 +110,7 @@
|
||||
isProtocol: false,
|
||||
listdata: [],
|
||||
amount: 0,
|
||||
minNum: 0,
|
||||
handselNum: 0,
|
||||
giftAmount: 0,
|
||||
userInfo: {},
|
||||
shopUserInfo: null,
|
||||
shopId: '',
|
||||
@@ -118,33 +119,38 @@
|
||||
{name: "明细", url: "member/billDetails",icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/detail.png"},
|
||||
{name: "管理", url: "member/storedManage",icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/manage.png"}
|
||||
],
|
||||
|
||||
type: "",
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
async onLoad(options) {
|
||||
// if ( e.type == 'list' || e.type == 'index') {
|
||||
// this.shopId = e.shopId;
|
||||
// this.init();
|
||||
// }
|
||||
|
||||
console.log(e)
|
||||
uni.cache.set('forceUpdate',1)
|
||||
if (e.q) {
|
||||
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
|
||||
// #ifdef MP-WEIXIN
|
||||
if (options.q) {
|
||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
this.tokenShow = false;
|
||||
// 等待登录结果返回
|
||||
// if (!uni.cache.get('token')) {
|
||||
// await this.$onLaunched;
|
||||
// }
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
} else{
|
||||
this.shopId = e.shopId;
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
// #endif
|
||||
|
||||
if (options.shopId) {
|
||||
this.shopId = options.shopId
|
||||
uni.cache.set('shopId',this.shopId)
|
||||
}
|
||||
if (options.type) {
|
||||
this.type = options.type
|
||||
}
|
||||
if ( options.amount ) { this.amount = options.amount; }
|
||||
this.shopInfo();
|
||||
this.paygetActive()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -193,20 +199,43 @@
|
||||
let res = await this.api.paygetActive({
|
||||
shopId: this.shopId,
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
pageSize: 99
|
||||
})
|
||||
|
||||
try {
|
||||
this.listdata = res.data.list;
|
||||
this.giftList = this.listdata[0].gives;
|
||||
this.amount = this.listdata[0].minNum;
|
||||
this.minNum = this.listdata[0].minNum;
|
||||
this.handselNum = this.listdata[0].handselNum
|
||||
this.giftAmount = this.listdata[0].giftAmount
|
||||
if ( this.type == 'topUpActivity') {
|
||||
this.amountChange()
|
||||
} else {
|
||||
this.amount = this.listdata[0].amount;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听金额修改
|
||||
*/
|
||||
amountChange () {
|
||||
let item = this.listdata.filter(item=>this.amount==item.amount)
|
||||
if ( item.length > 0 ) {
|
||||
this.listdata.forEach((v,e)=>{
|
||||
if ( this.amount == v.amount) {
|
||||
this.inputshow = e;
|
||||
this.clickinput(v,e)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.inputshow = '';
|
||||
this.giftList = [];
|
||||
this.giftAmount = '';
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 进入明细\管理
|
||||
* @param {Object} e
|
||||
@@ -295,12 +324,10 @@
|
||||
* @param {Object} b
|
||||
*/
|
||||
clickinput(a, b) {
|
||||
console.log(a, b)
|
||||
this.inputshow = b;
|
||||
this.giftList = a.gives;
|
||||
this.amount = a.minNum;
|
||||
this.minNum = a.minNum;
|
||||
this.handselNum = a.handselNum;
|
||||
this.amount = a.amount;
|
||||
this.giftAmount = a.giftAmount;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -315,6 +342,7 @@
|
||||
});
|
||||
return false;
|
||||
}
|
||||
console.log(this.amount)
|
||||
if (this.amount == null || this.amount == '') {
|
||||
uni.showToast({
|
||||
title: '金额不能为空',
|
||||
@@ -331,7 +359,13 @@
|
||||
}
|
||||
let res = await this.api.paymemeberIn({
|
||||
shopId: this.shopId, // 判断显示哪家的作品,
|
||||
amount: this.amount // 判断显示哪家的作品,
|
||||
amount: this.amount ,// 判断显示哪家的作品,
|
||||
// #ifdef MP-WEIXIN
|
||||
payType: 'wechatPay',
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
payType: 'aliPay',
|
||||
// #endif
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
@@ -356,15 +390,20 @@
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||
complete() {
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
if ( _this.type && _this.type == "topUpActivity") {
|
||||
uni.pro.navigateBack()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
@@ -453,7 +492,7 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 14rpx 16rpx;
|
||||
padding: 22rpx 16rpx 22rpx 32rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
.customAmount_left{
|
||||
|
||||
@@ -108,12 +108,18 @@
|
||||
shopId: item.shopId,
|
||||
type: 'index',
|
||||
})
|
||||
} else if ( this.type && this.type == 'user_points') {
|
||||
uni.pro.navigateTo('/pagesPoints/index/index', {
|
||||
shopId: item.shopId,
|
||||
type: 'member_list',
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('member/memberdetails', {
|
||||
shopId: item.shopId
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -24,8 +24,13 @@
|
||||
<view class="price-wrap" style="padding-top: 0;" >
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{ item.salePrice }}</text>
|
||||
<text class="num" v-if="shopUserInfo.isVip ==1 && item.memberPrice>0" style="margin-right: 10rpx;">{{ item.memberPrice }}</text>
|
||||
<text class="i" v-if="shopUserInfo.isVip ==1 && item.memberPrice>0" :class="{lineThrough: shopUserInfo.isVip ==1 && item.memberPrice>0}">¥</text>
|
||||
<text class="num" :class="{lineThrough: shopUserInfo.isVip ==1 && item.memberPrice>0}">{{ item.salePrice }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="operation-wrap">
|
||||
<view class="btn" v-if="item.number" >
|
||||
<u-icon name="minus-circle-fill" size="50"></u-icon>
|
||||
@@ -82,7 +87,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
shopUserInfo: uni.cache.get('shopUserInfo')
|
||||
|
||||
}
|
||||
},
|
||||
@@ -297,6 +302,12 @@
|
||||
}
|
||||
|
||||
.num {}
|
||||
.lineThrough{
|
||||
font-weight: normal;
|
||||
text-decoration:line-through;
|
||||
color: #999!important;
|
||||
font-size: 24rpx!important;
|
||||
}
|
||||
}
|
||||
|
||||
.sku-wrap {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
</view>
|
||||
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{cartLists.amount||'0.00'}}</text>
|
||||
<text class="num" v-if="shopUserInfo.isVip == 1 && cartLists.memberAmount > 0">{{cartLists.memberAmount||'0.00'}}</text>
|
||||
<text class="num" v-else >{{cartLists.amount||'0.00'}}</text>
|
||||
</view>
|
||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)" >
|
||||
<text class="t">去结算</text>
|
||||
@@ -26,7 +27,7 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
shopUserInfo: uni.cache.get('shopUserInfo')
|
||||
}
|
||||
},
|
||||
props:{
|
||||
|
||||
@@ -61,7 +61,14 @@
|
||||
|
||||
<view v-if="item.isPauseSale != 0 || item.isSale == 0 " class="flex-between" style="margin-top: 32rpx;margin-bottom: 48rpx;">
|
||||
<view class="panelfiveitemsex flex-between">
|
||||
<view class="panelfiveitemsex_oen"><text>¥</text><text>{{item.lowPrice}}</text><text>/{{item.unitSnap}}</text></view>
|
||||
|
||||
<view class="panelfiveitemsex_oen">
|
||||
<text class="tips">¥</text>
|
||||
<text class="price" v-if="isVip ==1 && item.lowMemberPrice>0" style="margin-right: 10rpx;">{{item.lowMemberPrice}}</text>
|
||||
<text class="tips" v-if="isVip ==1 && item.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item.lowMemberPrice>0}">¥</text>
|
||||
<text class="price" :class="{lineThrough: isVip ==1 && item.lowMemberPrice>0}">{{item.lowPrice}}</text>
|
||||
<text class="unit" v-if="!(isVip ==1 && item.lowMemberPrice>0)">/{{item.unitSnap}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="panelfiveitemNum" >
|
||||
@@ -73,8 +80,17 @@
|
||||
</view>
|
||||
<view v-else class="flex-between" style="margin-top: 32rpx;margin-bottom: 48rpx;">
|
||||
<view class="panelfiveitemsex flex-between">
|
||||
<view class="panelfiveitemsex_oen"><text>¥</text><text>{{item.lowPrice}}</text><text>/{{item.unitSnap}}</text></view>
|
||||
|
||||
<view class="panelfiveitemsex_oen">
|
||||
<text class="tips">¥</text>
|
||||
<text class="price" v-if="isVip ==1 && item.lowMemberPrice>0" style="margin-right: 10rpx;">{{item.lowMemberPrice}}</text>
|
||||
<text class="tips" v-if="isVip ==1 && item.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item.lowMemberPrice>0}">¥</text>
|
||||
<text class="price" :class="{lineThrough: isVip ==1 && item.lowMemberPrice>0}">{{item.lowPrice}}</text>
|
||||
<text class="unit" v-if="!(isVip ==1 && item.lowMemberPrice>0)">/{{item.unitSnap}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="item.suit > 1">
|
||||
<view class="panelfiveitemNum">
|
||||
<view class="sku-wrap flex-center" @click.stop="clickspecifications(item,index,index1)">
|
||||
@@ -152,7 +168,13 @@
|
||||
|
||||
|
||||
<view v-if="item1.isPauseSale != 0 || item1.isSale == 0 " class="flex-between">
|
||||
<view class="money">¥<text class="money_num">{{ item1.lowPrice }}</text>/{{item1.unitSnap}}</view>
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="isVip ==1 && item1.lowMemberPrice>0" style="margin-right: 10rpx;">{{ item1.lowMemberPrice }}</text>
|
||||
<view v-if="isVip ==1 && item1.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">¥</view>
|
||||
<text class="money_num" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">{{ item1.lowPrice }}</text>
|
||||
<text v-if="!(isVip ==1 && item1.lowMemberPrice>0)">/{{item1.unitSnap}}</text>
|
||||
</view>
|
||||
<view class="flex-end" >
|
||||
<view class="sku-wrap flex-center" style="background-color: #CECECE;">
|
||||
<text class="t" v-if="item1.isSale == 0" >非可售时间</text>
|
||||
@@ -161,7 +183,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="flex-between">
|
||||
<view class="money">¥<text class="money_num">{{ item1.lowPrice }}</text>/{{item1.unitSnap}}</view>
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="isVip ==1 && item1.lowMemberPrice>0" style="margin-right: 10rpx;">{{ item1.lowMemberPrice }}</text>
|
||||
<view v-if="isVip ==1 && item1.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">¥</view>
|
||||
<text class="money_num" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">{{ item1.lowPrice }}</text>
|
||||
<text v-if="!(isVip ==1 && item1.lowMemberPrice>0)">/{{item1.unitSnap}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="item1.suit > 1">
|
||||
<view class="flex-end" >
|
||||
<view class="sku-wrap flex-center"
|
||||
@@ -356,6 +386,8 @@
|
||||
cartLists: {}, //购物车
|
||||
cartLists_count: 0,
|
||||
shopInfo: {}, //店铺信息
|
||||
shopUserInfo: {},
|
||||
isVip: null,
|
||||
shopProductList: {}, //商品信息
|
||||
specifications: {}, // 规格信息
|
||||
querySpecList: [],
|
||||
@@ -584,6 +616,7 @@
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.shopUserInfo = res.data;
|
||||
this.isVip = res.data.isVip;
|
||||
uni.cache.set('shopUserInfo', res.data)
|
||||
}
|
||||
},
|
||||
@@ -1321,33 +1354,27 @@
|
||||
.panelfiveitemsex {
|
||||
|
||||
.panelfiveitemsex_oen {
|
||||
text:nth-child(1) {
|
||||
.tips {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
.price {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(3) {
|
||||
.unit {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(4) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1900,7 +1927,8 @@
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
.money_num {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
@@ -1977,4 +2005,12 @@
|
||||
}
|
||||
|
||||
}
|
||||
.lineThrough{
|
||||
font-weight: normal;
|
||||
text-decoration:line-through;
|
||||
color: #999!important;
|
||||
font-size: 24rpx!important;
|
||||
}
|
||||
.money_num.lineThrough{
|
||||
}
|
||||
</style>
|
||||
@@ -37,7 +37,13 @@
|
||||
|
||||
|
||||
<view v-if="item1.isPauseSale != 0 " class="flex-between" >
|
||||
<view class="money">¥<text class="money_num">{{ item1.lowPrice }}</text>/{{item1.unitSnap}}</view>
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="isVip ==1 && item1.lowMemberPrice>0" style="margin-right: 10rpx;">{{ item1.lowMemberPrice }}</text>
|
||||
<view v-if="isVip ==1 && item1.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">¥</view>
|
||||
<text class="money_num" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">{{ item1.lowPrice }}</text>
|
||||
<text v-if="!(isVip ==1 && item1.lowMemberPrice>0)">/{{item1.unitSnap}}</text>
|
||||
</view>
|
||||
<view class="flex-end" >
|
||||
<view class="sku-wrap flex-center" style="background-color: #CECECE;">
|
||||
<text class="t" v-if="item1.isSale == 0" >非可售时间</text>
|
||||
@@ -46,7 +52,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="flex-between">
|
||||
<view class="money">¥<text class="money_num">{{ item1.lowPrice }}</text>/{{item1.unitSnap}}</view>
|
||||
<view class="money">
|
||||
<view>¥</view>
|
||||
<text class="money_num" v-if="isVip ==1 && item1.lowMemberPrice>0" style="margin-right: 10rpx;">{{ item1.lowMemberPrice }}</text>
|
||||
<view v-if="isVip ==1 && item1.lowMemberPrice>0" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">¥</view>
|
||||
<text class="money_num" :class="{lineThrough: isVip ==1 && item1.lowMemberPrice>0}">{{ item1.lowPrice }}</text>
|
||||
<text v-if="!(isVip ==1 && item1.lowMemberPrice>0)">/{{item1.unitSnap}}</text>
|
||||
</view>
|
||||
<view v-if="item1.suit > 1">
|
||||
<view class="flex-end" >
|
||||
<view class="sku-wrap flex-center"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<view class="towcontent">
|
||||
<view class="towcontentlistxitem flex-start">
|
||||
<view class="towcontentlistxitembox flex-colum"
|
||||
:class="tabIndex == index?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in tabList" :key="index" @click="towcontentclick(index,item)">
|
||||
:class="tabIndex == item.type?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in tabList" :key="index" @click="towcontentclick(item)">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<image v-if="tabIndex == index"
|
||||
<image v-if="tabIndex == item.type"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
@@ -74,10 +74,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabList: [{
|
||||
name: '全部',
|
||||
type: ''
|
||||
},
|
||||
tabList: [
|
||||
|
||||
{
|
||||
name: '未使用',
|
||||
type: '1'
|
||||
@@ -87,13 +85,17 @@
|
||||
type: '2'
|
||||
}
|
||||
],
|
||||
tabIndex: 0,
|
||||
tabIndex: 1,
|
||||
list: [],
|
||||
status: "",
|
||||
status: 1,
|
||||
type: "",
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
if (options.type) {
|
||||
this.type = options.type;
|
||||
}
|
||||
this.getCouponList()
|
||||
},
|
||||
|
||||
@@ -101,11 +103,10 @@
|
||||
|
||||
/**
|
||||
* 切换类型
|
||||
* @param {Object} index
|
||||
* @param {Object} item
|
||||
*/
|
||||
towcontentclick(index, item) {
|
||||
this.tabIndex = index;
|
||||
towcontentclick(item) {
|
||||
this.tabIndex = item.type;
|
||||
this.status = item.type;
|
||||
this.getCouponList()
|
||||
},
|
||||
@@ -115,7 +116,7 @@
|
||||
*/
|
||||
async getCouponList() {
|
||||
try {
|
||||
let res = await this.api.getUserConpons({
|
||||
let res = await this.api.conponList({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
shopId: uni.cache.get('shopId'),
|
||||
status: this.status
|
||||
@@ -156,7 +157,7 @@
|
||||
margin-top: 32rpx;
|
||||
|
||||
.towcontentlistxitembox {
|
||||
width: 33%;
|
||||
width: 50%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
@@ -170,8 +171,6 @@
|
||||
}
|
||||
|
||||
.towcontentlistxitemboxopacity {
|
||||
width: 33%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
text{
|
||||
color: #E3AD7F;
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
teblist: [],
|
||||
myAssetsList: [
|
||||
{ name: "储值", type: "recharge", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/storedValue.png"},
|
||||
// { name: "积分", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
|
||||
{ name: "积分", type: "points", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
|
||||
{ name: "优惠券", type: "my_coupon", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/coupon.png"},
|
||||
// { name: "权益卡", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/equityCard.png"}
|
||||
],
|
||||
@@ -121,6 +121,9 @@
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data);
|
||||
this.userInfo = res.data;
|
||||
this.myAssetsList[0].num = res.data.balanceAll || "";
|
||||
this.myAssetsList[1].num = res.data.pointsAll || "";
|
||||
this.myAssetsList[2].num = res.data.couponAll || "";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -180,9 +183,7 @@
|
||||
}
|
||||
switch (item.type) {
|
||||
case 'my_order':
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
uni.pro.switchTab('order/order')
|
||||
break
|
||||
case 'my_member':
|
||||
uni.pro.navigateTo('member/list')
|
||||
@@ -200,7 +201,19 @@
|
||||
}
|
||||
|
||||
break
|
||||
case 'my_coupon': //内部页面
|
||||
case 'points': //积分
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
uni.pro.navigateTo('/pagesPoints/index/index', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'user',
|
||||
})
|
||||
} else{
|
||||
uni.pro.navigateTo('member/list', {
|
||||
type: 'user_points'
|
||||
})
|
||||
}
|
||||
break;
|
||||
case 'my_coupon': //优惠券
|
||||
uni.pro.navigateTo('user/coupon')
|
||||
break;
|
||||
case 'my_info': //内部页面
|
||||
|
||||
Reference in New Issue
Block a user