|
@@ -3,28 +3,39 @@
|
|
|
<view>
|
|
<view>
|
|
|
|
|
|
|
|
<view style="background-color: white;">
|
|
<view style="background-color: white;">
|
|
|
- <text style="margin-right:30upx;font-size:35upx;">充值优惠方式:</text>
|
|
|
|
|
- <view class="admin-button-com big blue" @click="">升会员</view>
|
|
|
|
|
- <view style="margin-left:60upx;" class="admin-button-com big default" @click="">送余额</view>
|
|
|
|
|
|
|
+ <text style="margin-right:30upx;font-size:35upx;margin-left:20upx;">充值优惠方式:</text>
|
|
|
|
|
+ <view :class="[rechargeWeal == 1 ? 'blue' : 'default']" class="admin-button-com big" @click="rechargeWeal=1">升会员</view>
|
|
|
|
|
+ <view :class="[rechargeWeal == 2 ? 'blue' : 'default']" style="margin-left:60upx;" class="admin-button-com big" @click="rechargeWeal=2">送余额</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view style="background-color: white;padding-bottom:30upx;"> </view>
|
|
|
|
|
|
|
+ <view style="background-color: white;padding-bottom:30upx;"></view>
|
|
|
<t-table :headerBackgroundColor="'#F0F2F6'">
|
|
<t-table :headerBackgroundColor="'#F0F2F6'">
|
|
|
<view>
|
|
<view>
|
|
|
- <view v-for="(item, inIndex) in map" :key="inIndex">
|
|
|
|
|
- <t-tr>
|
|
|
|
|
- <t-td align="center" color="info">
|
|
|
|
|
- <view style="color:black;font-weight:bold;font-size:30upx;">{{ item.name }}</view>
|
|
|
|
|
- </t-td>
|
|
|
|
|
- <t-td align="center" color="info">
|
|
|
|
|
- <view>
|
|
|
|
|
- <input v-model="item.discount" type="digit" style="border:1upx solid #cccccc;color:black;font-size:30upx;" @focus="item.discount=''" placeholder="" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </t-td>
|
|
|
|
|
- </t-tr>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view v-for="(item, inIndex) in map" :key="inIndex">
|
|
|
|
|
+ <t-tr>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view style="font-size:30upx;display: flex;align-items: center;">
|
|
|
|
|
+ 充值<input v-model="item.recharge" type="digit" style="border:1upx solid #cccccc;color:black;display:inline-block;width:130upx;margin-left:8upx;" @focus="item.recharge=''" placeholder="" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ <t-td align="center" color="info">
|
|
|
|
|
+ <view style="color:black;font-size:30upx;" v-if="rechargeWeal == 1">
|
|
|
|
|
+ 升{{ item.name }}
|
|
|
|
|
+ <text v-if="hasMemberDiscount == 1">({{(item.discount*100).toFixed(0)}}折)</text>
|
|
|
|
|
+ <text v-else>(无折扣)</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view style="font-size:30upx;display: flex;align-items: center;" v-if="rechargeWeal == 2">
|
|
|
|
|
+ 送<input v-model="item.give" type="digit" style="border:1upx solid #cccccc;color:black;display:inline-block;width:100upx;margin-left:8upx;" @focus="item.give=''" placeholder="" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </t-td>
|
|
|
|
|
+ </t-tr>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</t-table>
|
|
</t-table>
|
|
|
|
|
|
|
|
|
|
+ <view style="margin-top:50upx;text-align: center;" v-if="hasMemberDiscount == 0">
|
|
|
|
|
+ <view style="color:red;font-weight:bold;font-size:32upx;margin-bottom:20upx;">你还没有设置会员折扣,请先去设置</view>
|
|
|
|
|
+ <view style="margin:0 auto;" class="admin-button-com big blue" @click="setMember">去设置会员折扣</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="app-footer">
|
|
<view class="app-footer">
|
|
|
<view class="admin-button-com big blue" @click="goBack()">返回上级</view>
|
|
<view class="admin-button-com big blue" @click="goBack()">返回上级</view>
|
|
@@ -36,34 +47,40 @@
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import list from '@/mixins/list'
|
|
import list from '@/mixins/list'
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
-import { getInitData,modifyMember } from '@/api/member'
|
|
|
|
|
|
|
+import { getRechargeData,modifyRecharge } from '@/api/member'
|
|
|
export default {
|
|
export default {
|
|
|
- name: "addPrice",
|
|
|
|
|
|
|
+ name: "discount",
|
|
|
components: {
|
|
components: {
|
|
|
- AppWrapperEmpty,ModalModule
|
|
|
|
|
|
|
+ AppWrapperEmpty,
|
|
|
|
|
+ ModalModule
|
|
|
},
|
|
},
|
|
|
mixins:[list],
|
|
mixins:[list],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
map:[],
|
|
map:[],
|
|
|
- reduceDay:30
|
|
|
|
|
|
|
+ rechargeWeal:1,
|
|
|
|
|
+ hasMemberDiscount:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
init(){
|
|
init(){
|
|
|
- getInitData().then(res=>{
|
|
|
|
|
|
|
+ getRechargeData().then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
- this.map = res.data.member?res.data.member:[]
|
|
|
|
|
- this.reduceDay = res.data.reduceDay?res.data.reduceDay:30
|
|
|
|
|
|
|
+ this.map = res.data.recharge?res.data.recharge:[]
|
|
|
|
|
+ this.hasMemberDiscount = res.data.hasMemberDiscount ? res.data.hasMemberDiscount : 0
|
|
|
|
|
+ this.rechargeWeal = res.data.rechargeWeal ? res.data.rechargeWeal : 1
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
goBack(){
|
|
goBack(){
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
|
},
|
|
},
|
|
|
|
|
+ setMember(){
|
|
|
|
|
+ this.$util.pageTo({url: "/admin/member/discount",type:2})
|
|
|
|
|
+ },
|
|
|
saveData(){
|
|
saveData(){
|
|
|
- this.$util.confirmModal({content:'只能修改一次,提交后将不能再次修改,确认提交?'},() => {
|
|
|
|
|
- modifyMember({data:this.map,reduceDay:this.reduceDay}).then(res=>{
|
|
|
|
|
|
|
+ this.$util.confirmModal({content:'只能设置一次,提交后将不能再次修改,确认提交?'},() => {
|
|
|
|
|
+ modifyRecharge({data:this.map,rechargeWeal:this.rechargeWeal}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
this.$msg(res.msg)
|
|
this.$msg(res.msg)
|
|
|
}
|
|
}
|