|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="ex-page">
|
|
<view class="ex-page">
|
|
|
<view class="title">
|
|
<view class="title">
|
|
|
- 活动状态:<switch style="transform: scale(0.8,0.8)" :checked="rechargeSwitch == 0 ? false : true" @change="rechargeChange" />
|
|
|
|
|
- <text v-if="rechargeSwitch == 0">关闭</text><text v-else>开启</text>
|
|
|
|
|
- <button class="admin-button-com middle blue" @click="addHb()" style="float:right;margin-right:20rpx;">新增红包</button>
|
|
|
|
|
|
|
+ 活动状态:<switch style="transform: scale(0.8,0.8)" :checked="rechargeSwitch == 0 ? false : true" @change="rechargeChange" />
|
|
|
|
|
+ <text v-if="rechargeSwitch == 0">关闭</text><text v-else>开启</text>
|
|
|
|
|
+ <button class="admin-button-com middle blue" @click="addHb()">新增选项</button>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="recharge-list">
|
|
<view class="recharge-list">
|
|
|
|
|
|
|
@@ -11,12 +11,12 @@
|
|
|
|
|
|
|
|
<view class="item">
|
|
<view class="item">
|
|
|
|
|
|
|
|
- <view>充值:<input v-model="item.amount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:150rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元</view>
|
|
|
|
|
- <view>赠送红包:<input v-model="item.num" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:100rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />个</view>
|
|
|
|
|
- <view>每个红包:<input v-model="item.hbAmount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:120rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0rpx 10rpx;" />元</view>
|
|
|
|
|
- <view>最低消费满:<input v-model="item.miniExpend" placeholder-class="phcolor" class="tui-input" type="digit" style="width:120rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元红包可用</view>
|
|
|
|
|
- <view>红包有效期:<input v-model="item.valid" placeholder-class="phcolor" class="tui-input" type="digit" style="width:100rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />天
|
|
|
|
|
- <button class="admin-button-com mini blue" @click="del(item)" style="margin-left:50rpx;">删除</button>
|
|
|
|
|
|
|
+ <view>充值金额:<input v-model="item.amount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:180rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元</view>
|
|
|
|
|
+ <view>赠送红包:<input v-model="item.num" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:180rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />个</view>
|
|
|
|
|
+ <view>每个红包:<input v-model="item.hbAmount" @click="discount=''" placeholder-class="phcolor" class="tui-input" type="digit" style="width:180rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0rpx 10rpx;" />元</view>
|
|
|
|
|
+ <view>最低消费:<input v-model="item.miniExpend" placeholder-class="phcolor" class="tui-input" type="digit" style="width:180rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />元可用</view>
|
|
|
|
|
+ <view>有效时长:<input v-model="item.valid" placeholder-class="phcolor" class="tui-input" type="digit" style="width:180rpx;border:1px solid #ddd;display:inline-block;margin:0 10rpx 0 10rpx;" />天
|
|
|
|
|
+ <button class="admin-button-com mini default" @click="delHb(item)" style="margin-left:150rpx;">删除</button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -69,16 +69,16 @@ export default {
|
|
|
that.rechargeSwitch = res.data.recharge;
|
|
that.rechargeSwitch = res.data.recharge;
|
|
|
if(!this.$util.isEmpty(res.data.list)){
|
|
if(!this.$util.isEmpty(res.data.list)){
|
|
|
that.recharge = res.data.list.map(e=>{
|
|
that.recharge = res.data.list.map(e=>{
|
|
|
- return {amount:e.amount,num:e.num,hbAmount:e.hbAmount,miniExpend:e.miniExpend,valid:e.valid}
|
|
|
|
|
|
|
+ return {amount:parseFloat(e.amount),num:e.num,hbAmount:parseFloat(e.hbAmount),miniExpend:parseFloat(e.miniExpend),valid:e.valid}
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
that.recharge = [
|
|
that.recharge = [
|
|
|
- {amount:'',num:'',hbAmount:'',miniExpend:'',valid:''}
|
|
|
|
|
|
|
+ {amount:5000,num:2,hbAmount:5,miniExpend:200,valid:30}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- del(item){
|
|
|
|
|
|
|
+ delHb(item){
|
|
|
if(this.recharge.length <= 1){
|
|
if(this.recharge.length <= 1){
|
|
|
this.$msg("最少需要保留一个")
|
|
this.$msg("最少需要保留一个")
|
|
|
return false
|
|
return false
|
|
@@ -86,9 +86,14 @@ export default {
|
|
|
var index = this.recharge.indexOf(item);
|
|
var index = this.recharge.indexOf(item);
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
|
this.recharge.splice(index, 1)
|
|
this.recharge.splice(index, 1)
|
|
|
|
|
+ this.$msg("删除成功")
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
addHb(){
|
|
addHb(){
|
|
|
|
|
+ if(this.recharge.length > 6){
|
|
|
|
|
+ this.$msg("最多只能设置6个")
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
this.recharge.push({amount:'',num:'',hbAmount:'',miniExpend:'',valid:''})
|
|
this.recharge.push({amount:'',num:'',hbAmount:'',miniExpend:'',valid:''})
|
|
|
},
|
|
},
|
|
|
saveHb(){
|
|
saveHb(){
|
|
@@ -150,15 +155,23 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.ex-page{
|
|
.ex-page{
|
|
|
.title{
|
|
.title{
|
|
|
- margin-bottom:50rpx;
|
|
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ z-index:999999;
|
|
|
padding-left:20rpx;
|
|
padding-left:20rpx;
|
|
|
font-size:30rpx;
|
|
font-size:30rpx;
|
|
|
|
|
+ background:white;
|
|
|
|
|
+ width:100%;
|
|
|
|
|
+ button{
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ right:10rpx;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.recharge-list{
|
|
.recharge-list{
|
|
|
line-height:80px;
|
|
line-height:80px;
|
|
|
padding-left:20rpx;
|
|
padding-left:20rpx;
|
|
|
font-size:30rpx;
|
|
font-size:30rpx;
|
|
|
padding-bottom:100rpx;
|
|
padding-bottom:100rpx;
|
|
|
|
|
+ padding-top:110rpx;
|
|
|
.item{
|
|
.item{
|
|
|
margin-bottom:60rpx;
|
|
margin-bottom:60rpx;
|
|
|
input{
|
|
input{
|