抖火调整自由服务包

This commit is contained in:
唐明明
2024-04-09 17:48:29 +08:00
parent 994ba4eb72
commit bf8fcdbf4c
8 changed files with 51 additions and 62 deletions

View File

@@ -28,7 +28,7 @@
<input class="from-block-val from-block-input" type="number" placeholder="请输入客户手机号码" v-model="phone" maxlength="11" />
</view>
<view class="from-block-item" v-if="needAmount > 0">
<label>标的额</label>
<label>{{priceTitle}}</label>
<input class="from-block-val from-block-input" type="number" v-model="amount" placeholder="请输入标的额"/>
</view>
<view class="from-block-item from-block-get" v-if="pickertype != 'free'">
@@ -55,6 +55,7 @@
export default {
data() {
return {
id : '',
pickerArr : [],
pickerIndex : 0,
pickertype : '',
@@ -67,16 +68,20 @@
needAmount : 0,
needDiff : 0,
selectP : [],
selectPIndex: 0
selectPIndex: 0,
priceTitle : '标的额'
};
},
onShow() {
const parentData = JSON.parse(decodeURIComponent(this.$Route.query.record))
console.log(parentData)
this.id = parentData.id
this.needDiff = parentData.need_diff
this.needAmount = parentData.need_amount
this.pickerArr = parentData.child.data
this.pickertype = parentData.type
this.selectP = parentData.select_p || []
this.priceTitle = parentData.price_title
if(parentData.child.has){
this.amountTypeInfo()
}
@@ -85,11 +90,12 @@
// 标的额比例计算
settleInfo() {
let { pickerArr, pickerIndex } = this
let id = pickerArr[pickerIndex].id
let id = pickerArr.length > 0 ? pickerArr[pickerIndex].id : this.id
settleAmount({
amount : this.pickertype == 'select' ? this.selectP[this.selectPIndex].key : this.amount,
username: this.phone
}, id).then(res => {
}, id).then(res => {
this.price = res.price
}).catch(err => {
this.price = 0
@@ -133,11 +139,12 @@
let { pickerArr, pickerIndex } = this
let id = pickerArr[pickerIndex].id
amountType(id).then(res => {
let { type, need_amount, select_p, need_diff } = res;
let { type, need_amount, select_p, need_diff, price_title } = res;
this.needDiff = need_diff
this.pickertype = type
this.needAmount = need_amount
this.selectP = select_p || []
this.priceTitle = price_title
// if(type == 'select'){
// this.settleInfo()
// }
@@ -154,42 +161,10 @@
// 提交表单
onSubmit(){
let { name, phone, pickerIndex, price, priceValue, amount, pickerArr, pickertype, selectP, selectPIndex, diffPrice } = this
if(pickertype != 'free') {
if(selectP.length <= 0 && amount === ''){
uni.showToast({
title: '请输入标的额',
icon : 'none'
})
return
}
} else {
if(priceValue === ''){
uni.showToast({
title: '请输入服务费金额',
icon : 'none'
})
return
}
}
if(name === ''){
uni.showToast({
title: '请输入客户姓名',
icon : 'none'
})
return
}
if(phone === ''){
uni.showToast({
title: '请输入客户手机号码',
icon : 'none'
})
return
}
uni.showLoading({
title: "提交中...",
mask : true
})
let params = {
big_id : pickerArr.length > 0 ? pickerArr[pickerIndex].id : this.$Route.query.bigFiveId,
name : name,