充值活动相关增加
This commit is contained in:
@@ -161,7 +161,9 @@ export default {
|
|||||||
getUserConpons(data) { //我的优惠券
|
getUserConpons(data) { //我的优惠券
|
||||||
return uni.api.post("/userConpons/find", data);
|
return uni.api.post("/userConpons/find", data);
|
||||||
},
|
},
|
||||||
|
conponList(data) { //获取优惠券
|
||||||
|
return uni.api.post("/coupon/find", data);
|
||||||
|
},
|
||||||
ordergetYhqPara(data) { //获取优惠券参数列表
|
ordergetYhqPara(data) { //获取优惠券参数列表
|
||||||
return uni.api.get("/order/getYhqPara", data);
|
return uni.api.get("/order/getYhqPara", data);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,26 +27,27 @@
|
|||||||
type="number"
|
type="number"
|
||||||
v-model="amount"
|
v-model="amount"
|
||||||
inputAlign="left"
|
inputAlign="left"
|
||||||
:placeholder="`充${minNum}送${handselNum}`"
|
:placeholder="`充${amount}送${giftAmount}`"
|
||||||
:customStyle="{border: '0'}"
|
:customStyle="{border: '0'}"
|
||||||
|
@input="amountChange"
|
||||||
></u-input>
|
></u-input>
|
||||||
</view>
|
</view>
|
||||||
<text class="customAmount_right">自定义金额</text>
|
<text class="customAmount_right">自定义金额</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rechargeList">
|
<view class="rechargeList">
|
||||||
<view class="rechargeList_f" @click="clickinput(item,index)" v-for="(item,index) in listdata" :key="index">
|
<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="rechargeList_item_title">充值</view>
|
||||||
<view class="flex-colum-start">
|
<view class="flex-colum-start">
|
||||||
<view class="rechargeList_item_amount">¥<text>{{item.minNum}}</text></view>
|
<view class="rechargeList_item_amount">¥<text>{{item.amount}}</text></view>
|
||||||
<view class="rechargeList_item_gift" v-show="index == inputshow">
|
<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>
|
<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">
|
<view class="rechargeList_item_gift_text">
|
||||||
<text>赠</text>
|
<text>赠{{inputshow}}</text>
|
||||||
<text>¥{{ item.handselNum }}</text>
|
<text>¥{{ item.giftAmount }}</text>
|
||||||
</view>
|
</view>
|
||||||
</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>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -108,8 +109,7 @@
|
|||||||
isProtocol: false,
|
isProtocol: false,
|
||||||
listdata: [],
|
listdata: [],
|
||||||
amount: 0,
|
amount: 0,
|
||||||
minNum: 0,
|
giftAmount: 0,
|
||||||
handselNum: 0,
|
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
shopUserInfo: null,
|
shopUserInfo: null,
|
||||||
shopId: '',
|
shopId: '',
|
||||||
@@ -142,9 +142,11 @@
|
|||||||
} else{
|
} else{
|
||||||
this.shopId = e.shopId;
|
this.shopId = e.shopId;
|
||||||
this.type = e.type;
|
this.type = e.type;
|
||||||
|
if ( e.amount ) { this.amount = e.amount; }
|
||||||
uni.cache.set('shopId',this.shopId)
|
uni.cache.set('shopId',this.shopId)
|
||||||
this.shopInfo();
|
this.shopInfo();
|
||||||
this.paygetActive()
|
this.paygetActive()
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -200,14 +202,38 @@
|
|||||||
try {
|
try {
|
||||||
this.listdata = res.data.list;
|
this.listdata = res.data.list;
|
||||||
this.giftList = this.listdata[0].gives;
|
this.giftList = this.listdata[0].gives;
|
||||||
this.amount = this.listdata[0].minNum;
|
this.giftAmount = this.listdata[0].giftAmount
|
||||||
this.minNum = this.listdata[0].minNum;
|
if ( this.type == 'topUpActivity') {
|
||||||
this.handselNum = this.listdata[0].handselNum
|
this.amountChange()
|
||||||
|
} else {
|
||||||
|
this.amount = this.listdata[0].amount;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//TODO handle the exception
|
//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
|
* @param {Object} e
|
||||||
@@ -296,12 +322,10 @@
|
|||||||
* @param {Object} b
|
* @param {Object} b
|
||||||
*/
|
*/
|
||||||
clickinput(a, b) {
|
clickinput(a, b) {
|
||||||
console.log(a, b)
|
|
||||||
this.inputshow = b;
|
this.inputshow = b;
|
||||||
this.giftList = a.gives;
|
this.giftList = a.gives;
|
||||||
this.amount = a.minNum;
|
this.amount = a.amount;
|
||||||
this.minNum = a.minNum;
|
this.giftAmount = a.giftAmount;
|
||||||
this.handselNum = a.handselNum;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<view class="towcontent">
|
<view class="towcontent">
|
||||||
<view class="towcontentlistxitem flex-start">
|
<view class="towcontentlistxitem flex-start">
|
||||||
<view class="towcontentlistxitembox flex-colum"
|
<view class="towcontentlistxitembox flex-colum"
|
||||||
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
|
:class="tabIndex == index?'towcontentlistxitemboxopacity':''"
|
||||||
v-for="(item,index) in listbox" :key="index" @click="towcontentclick(index,item)">
|
v-for="(item,index) in tabList" :key="index" @click="towcontentclick(index,item)">
|
||||||
<text class="title">{{item.name}}</text>
|
<text class="title">{{item.name}}</text>
|
||||||
<image v-if="towcontentclickindex == index"
|
<image v-if="tabIndex == index"
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,27 +74,27 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listbox: [{
|
tabList: [{
|
||||||
name: '全部',
|
name: '全部',
|
||||||
type: ''
|
type: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '未使用',
|
name: '未使用',
|
||||||
type: '0'
|
type: '1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '已使用',
|
name: '已使用',
|
||||||
type: '1'
|
type: '2'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
towcontentclickindex: 0,
|
tabIndex: 0,
|
||||||
list: [],
|
list: [],
|
||||||
status: "",
|
status: "",
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.ordermineCouponsthis()
|
this.getCouponList()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -105,17 +105,17 @@
|
|||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
*/
|
*/
|
||||||
towcontentclick(index, item) {
|
towcontentclick(index, item) {
|
||||||
this.towcontentclickindex = index;
|
this.tabIndex = index;
|
||||||
this.status = item.type;
|
this.status = item.type;
|
||||||
this.ordermineCouponsthis()
|
this.getCouponList()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取优惠券数据
|
* 获取优惠券数据
|
||||||
*/
|
*/
|
||||||
async ordermineCouponsthis() {
|
async getCouponList() {
|
||||||
try {
|
try {
|
||||||
let res = await this.api.getUserConpons({
|
let res = await this.api.conponList({
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
shopId: uni.cache.get('shopId'),
|
shopId: uni.cache.get('shopId'),
|
||||||
status: this.status
|
status: this.status
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
<view class="topUpActivity">
|
<view class="topUpActivity">
|
||||||
<view class="topUpActivity_title">充值更划算</view>
|
<view class="topUpActivity_title">充值更划算</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="content_item" @click="goTopUp" v-for="(item,index) in list" :key="index">
|
<view class="content_item" @click="goTopUp(item)" v-for="(item,index) in list" :key="index">
|
||||||
<view class="fit">首充优惠</view>
|
<view class="fit">首充优惠</view>
|
||||||
<view class="amount">{{ item.minNum }}元</view>
|
<view class="amount">{{ item.amount }}元</view>
|
||||||
<view class="zs"><text class="zamount">赠{{ item.handselNum }}元</text><text class="points">50积分</text></view>
|
<view class="zs"><text class="zamount">赠{{ item.giftAmount }}元</text><text class="points">50积分</text></view>
|
||||||
<view class="coupon">赠送2张优惠券</view>
|
<view class="coupon">赠送2张优惠券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -35,10 +35,11 @@
|
|||||||
/**
|
/**
|
||||||
* 去充值
|
* 去充值
|
||||||
*/
|
*/
|
||||||
goTopUp() {
|
goTopUp( item ) {
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
uni.pro.navigateTo('/pages/member/index', {
|
||||||
shopId: uni.cache.get('shopId'),
|
shopId: uni.cache.get('shopId'),
|
||||||
type: "topUpActivity"
|
type: "topUpActivity",
|
||||||
|
amount: item.amount,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<!-- 充值免单 -->
|
<!-- 充值免单 -->
|
||||||
<!-- <rechargeFree ref="rechargeFree" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree> -->
|
<!-- <rechargeFree ref="rechargeFree" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree> -->
|
||||||
<!-- 充值活动 -->
|
<!-- 充值活动 -->
|
||||||
<!-- <topUpActivity ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity> -->
|
<topUpActivity ref="topUpActivity" :shopUserInfo="amountVIP" ></topUpActivity>
|
||||||
<!-- 支付方式 -->
|
<!-- 支付方式 -->
|
||||||
<paymentMethod ref="paymentMethod" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
<paymentMethod ref="paymentMethod" :amountVIP="amountVIP" v-if="storeInfo.registerType == 'munchies'" @groupChange="groupChange"></paymentMethod>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user