|
|
@ -7,13 +7,13 @@ |
|
|
|
<view class="vh-info"> |
|
|
|
<view class="vi-line">储值卡卡号:{{ orderInfo.card_no || '-' }}</view> |
|
|
|
<view class="vi-line">手机号码:{{ orderInfo.mobile || '-' }}</view> |
|
|
|
<view class="vi-line">储值卡余额:{{ orderInfo.balance || '0' }}</view> |
|
|
|
<view class="vi-line">储值卡余额:¥{{ orderInfo.balance || '0' }}</view> |
|
|
|
</view> |
|
|
|
<view class="vh-btns"> |
|
|
|
<view @click="toRecord">消费记录</view> |
|
|
|
<block v-if="orderInfo.status == 1"> |
|
|
|
<view class="red">扣费</view> |
|
|
|
<view class="orange">充值</view> |
|
|
|
<view class="red" @click="isDeductModal = true">扣费</view> |
|
|
|
<view class="orange" @click="isRechargeModal = true">充值</view> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
<image class="vh-tag"></image> |
|
|
@ -79,15 +79,15 @@ |
|
|
|
</a-line> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vc-mask" v-if="false"> |
|
|
|
<view class="vc-recharge"> |
|
|
|
<image class="vr-close"></image> |
|
|
|
<view class="vc-mask" v-if="isRechargeModal" @click="isRechargeModal = false"> |
|
|
|
<view class="vc-recharge" @click.stop="_=>false"> |
|
|
|
<image class="vr-close" @click="isRechargeModal = false"></image> |
|
|
|
<view class="vr-tit">充值</view> |
|
|
|
|
|
|
|
<view class="vr-info"> |
|
|
|
<view><text>储值卡号:</text>20195171564566</view> |
|
|
|
<view><text>手机号码:</text>18316553478</view> |
|
|
|
<view><text>余额:</text>¥75.25</view> |
|
|
|
<view><text>储值卡号:</text>{{ orderInfo.card_no || '-' }}</view> |
|
|
|
<view><text>手机号码:</text>{{ orderInfo.mobile || '-' }}</view> |
|
|
|
<view><text>余额:</text>¥{{ orderInfo.balance || '0' }}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vr-edit"> |
|
|
@ -95,11 +95,11 @@ |
|
|
|
<view class="vl-name"><text>*</text>充值金额</view> |
|
|
|
<view class="vl-ipt"> |
|
|
|
<view class="vi-box"> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.amount--"></view> |
|
|
|
<view class="vb-ipt"> |
|
|
|
<input /> |
|
|
|
<input type="number" v-model="rechargeInfo.amount" /> |
|
|
|
</view> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.amount++"></view> |
|
|
|
</view> |
|
|
|
<view class="vi-unit">元</view> |
|
|
|
</view> |
|
|
@ -108,11 +108,11 @@ |
|
|
|
<view class="vl-name"><text>*</text>充值赠送金额</view> |
|
|
|
<view class="vl-ipt"> |
|
|
|
<view class="vi-box"> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.giveAmount--"></view> |
|
|
|
<view class="vb-ipt"> |
|
|
|
<input /> |
|
|
|
<input type="number" v-model="rechargeInfo.giveAmount" /> |
|
|
|
</view> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.giveAmount++"></view> |
|
|
|
</view> |
|
|
|
<view class="vi-unit">元</view> |
|
|
|
</view> |
|
|
@ -121,11 +121,11 @@ |
|
|
|
<view class="vl-name"><text>*</text>赠送有效期</view> |
|
|
|
<view class="vl-ipt"> |
|
|
|
<view class="vi-box"> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.giveDate--"></view> |
|
|
|
<view class="vb-ipt"> |
|
|
|
<input /> |
|
|
|
<input type="number" v-model="rechargeInfo.giveDate" /> |
|
|
|
</view> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.giveDate++"></view> |
|
|
|
</view> |
|
|
|
<view class="vi-unit">天</view> |
|
|
|
</view> |
|
|
@ -134,11 +134,11 @@ |
|
|
|
<view class="vl-name"><text>*</text>延长有效期</view> |
|
|
|
<view class="vl-ipt"> |
|
|
|
<view class="vi-box"> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.extendDate--"></view> |
|
|
|
<view class="vb-ipt"> |
|
|
|
<input /> |
|
|
|
<input type="number" v-model="rechargeInfo.extendDate" /> |
|
|
|
</view> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="rechargeInfo.extendDate++"></view> |
|
|
|
</view> |
|
|
|
<view class="vi-unit">天</view> |
|
|
|
</view> |
|
|
@ -146,34 +146,39 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vr-btns"> |
|
|
|
<view class="white">取消</view> |
|
|
|
<view>确认</view> |
|
|
|
<view class="white" @click="isRechargeModal = false">取消</view> |
|
|
|
<view @click="rechargeConfirm">确认</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vc-mask" v-if="false"> |
|
|
|
<view class="vc-recharge vc-deductions"> |
|
|
|
<image class="vr-close"></image> |
|
|
|
<view class="vc-mask" v-if="isDeductModal" @click="isDeductModal = false"> |
|
|
|
<view class="vc-recharge vc-deductions" @click.stop="_=>false" > |
|
|
|
<image |
|
|
|
class="vr-close" |
|
|
|
mode="apsectFit" |
|
|
|
@click="isDeductModal = false" |
|
|
|
src="/subpackage/order/static/images/value_card/close.png" |
|
|
|
></image> |
|
|
|
<view class="vr-tit">扣费</view> |
|
|
|
|
|
|
|
<view class="vr-info"> |
|
|
|
<view><text>储值卡号:</text>20195171564566</view> |
|
|
|
<view><text>手机号码:</text>18316553478</view> |
|
|
|
<view><text>余额:</text>¥75.25</view> |
|
|
|
<view><text>储值卡号:</text>{{ orderInfo.card_no || '-' }}</view> |
|
|
|
<view><text>手机号码:</text>{{ orderInfo.mobile || '-' }}</view> |
|
|
|
<view><text>余额:</text>¥{{ orderInfo.balance || '0' }}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vr-edit"> |
|
|
|
<view class="ve-line"> |
|
|
|
<view class="vl-name"><text>*</text>充值金额</view> |
|
|
|
<view class="vl-name"><text>*</text>消费金额</view> |
|
|
|
<view class="vl-ipt"> |
|
|
|
<view class="vi-box"> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="deductAmount--"></view> |
|
|
|
<view class="vb-ipt"> |
|
|
|
<input /> |
|
|
|
<input v-model="deductAmount" type="number" /> |
|
|
|
</view> |
|
|
|
<view class="vb-btn"></view> |
|
|
|
<view class="vb-btn" @click="deductAmount++"></view> |
|
|
|
</view> |
|
|
|
<view class="vi-unit">元</view> |
|
|
|
</view> |
|
|
@ -183,22 +188,20 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="vd-ipt"> |
|
|
|
<picker> |
|
|
|
<picker mode="selector" :range="consumeTypeList" range-key="consume_type_name" @change="consumeTypePickerChange"> |
|
|
|
<view class="vi-box"> |
|
|
|
<input /> |
|
|
|
<image></image> |
|
|
|
<input placeholder="请选择消费场景" disabled :value="curConsumeType.consume_type_name" /> |
|
|
|
<image mode="aspectFit" src="/subpackage/order/static/images/value_card/arrow.png"></image> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
<view class="vi-box vi-remark"> |
|
|
|
<input /> |
|
|
|
<input placeholder="备注(选填)" v-model="deductRemark" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="vr-btns"> |
|
|
|
<view>确认</view> |
|
|
|
<view @click="deductConfirmBtn">确认</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -233,15 +236,111 @@ export default { |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return{ |
|
|
|
isDeductModal: false, // 扣费 |
|
|
|
deductAmount: 1, // 扣费金额 |
|
|
|
deductRemark: '', // 扣费备注 |
|
|
|
consumeTypeList: [], // 扣费类型 |
|
|
|
curConsumeType: {}, // 扣费选中类型 |
|
|
|
|
|
|
|
isRechargeModal: false, |
|
|
|
rechargeInfo: { |
|
|
|
amount: 0, |
|
|
|
giveAmount: 0, |
|
|
|
giveDate: 0, |
|
|
|
extendDate: 0 |
|
|
|
}, |
|
|
|
|
|
|
|
orderInfo: { |
|
|
|
records: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
this.getInfo(options.card_no); |
|
|
|
this.getConsumeTypeList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
rechargeConfirm: util.debounce(function(){ |
|
|
|
let { rechargeInfo, orderInfo } = this; |
|
|
|
if(rechargeInfo.amount< 0)return util.showNone('充值金额有误!'); |
|
|
|
if(rechargeInfo.giveAmount< 0)return util.showNone('充值赠送金额有误!'); |
|
|
|
if(rechargeInfo.giveDate< 0)return util.showNone('赠送有效期有误!'); |
|
|
|
if(rechargeInfo.extendDate< 0)return util.showNone('延长有效期有误!'); |
|
|
|
|
|
|
|
util.showLoad(); |
|
|
|
server.post({ |
|
|
|
url: ORDER_API.userValueCardRecharge, |
|
|
|
data: { |
|
|
|
card_no: orderInfo.card_no, |
|
|
|
amount: rechargeInfo.amount, |
|
|
|
day: rechargeInfo.extendDate, |
|
|
|
gift_amount: rechargeInfo.giveAmount, |
|
|
|
gift_day: rechargeInfo.giveDate, |
|
|
|
}, |
|
|
|
isDefaultGet: false, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
util.hideLoad(); |
|
|
|
if(res.data.code == 0){ |
|
|
|
this.refreshThis(); |
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
}else{ |
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
|
|
|
|
|
|
}, 300, true), |
|
|
|
refreshThis(){ |
|
|
|
this.isDeductModal = false; |
|
|
|
this.deductAmount = 1; |
|
|
|
this.deductRemark = ''; |
|
|
|
this.curConsumeType = {}; |
|
|
|
|
|
|
|
this.isRechargeModal = false; |
|
|
|
this.rechargeInfo['amount'] = 0; |
|
|
|
this.rechargeInfo['giveAmount'] = 0; |
|
|
|
this.rechargeInfo['giveDate'] = 0; |
|
|
|
this.rechargeInfo['extendDate'] = 0; |
|
|
|
|
|
|
|
let { orderInfo } = this; |
|
|
|
this.getInfo(orderInfo.card_no); |
|
|
|
|
|
|
|
}, |
|
|
|
consumeTypePickerChange(e){ |
|
|
|
let { consumeTypeList } = this; |
|
|
|
this.curConsumeType = consumeTypeList[e.detail.value]; |
|
|
|
}, |
|
|
|
deductConfirmBtn: util.debounce(function(){ |
|
|
|
let { deductAmount, deductRemark, curConsumeType, orderInfo } = this; |
|
|
|
if(deductAmount<0)return util.showNone('扣除价格有误!'); |
|
|
|
util.showLoad(); |
|
|
|
server.post({ |
|
|
|
url: ORDER_API.userValueCardDeduct, |
|
|
|
data: { |
|
|
|
consume_type: curConsumeType.consume_type, |
|
|
|
desc: deductRemark, |
|
|
|
card_no: orderInfo.card_no, |
|
|
|
amount: deductAmount, |
|
|
|
}, |
|
|
|
isDefaultGet: false, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
util.hideLoad(); |
|
|
|
if(res.data.code == 0){ |
|
|
|
this.refreshThis(); |
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
}else{ |
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
|
|
}, 300, true), |
|
|
|
toRecord(){ |
|
|
|
let { orderInfo } = this; |
|
|
|
util.routeTo(`/subpackage/order/pages/value_card/xpense_tracker/xpense_tracker?card_no=${orderInfo.card_no}`, 'nT'); |
|
|
@ -263,6 +362,16 @@ export default { |
|
|
|
2: '充值', |
|
|
|
} |
|
|
|
return _obj[order_way] || '-' |
|
|
|
}, |
|
|
|
getConsumeTypeList(){ |
|
|
|
server.get({ |
|
|
|
url: ORDER_API.consumeTypeList, |
|
|
|
data: {}, |
|
|
|
failMsg: '加载失败!' |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
this.consumeTypeList = res || {}; |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -382,7 +491,6 @@ export default { |
|
|
|
top: 30upx; |
|
|
|
width: 34upx; |
|
|
|
height: 34upx; |
|
|
|
background-color: skyblue; |
|
|
|
} |
|
|
|
.vr-tit{ |
|
|
|
margin-bottom: 34upx; |
|
|
@ -528,7 +636,7 @@ export default { |
|
|
|
width: 32upx; |
|
|
|
height: 32upx; |
|
|
|
margin-left: 20upx; |
|
|
|
background-color: skyblue; |
|
|
|
transform: rotateZ(90deg); |
|
|
|
} |
|
|
|
} |
|
|
|
.vi-remark{ |
|
|
|