|
@@ -39,12 +39,8 @@
|
|
|
serviceKeys.itemKeyname ||
|
|
|
serviceKeys.classKeyname }}</text>)</view>
|
|
|
<view class="service-list price-box">
|
|
|
- <up-input
|
|
|
- v-model="serviceKeys.time"
|
|
|
- placeholder="请输入服务时长"
|
|
|
- @blur="validateTimeInput"
|
|
|
- class="price-input"
|
|
|
- >
|
|
|
+ <up-input v-model="serviceKeys.time" placeholder="请输入服务时长" @blur="validateTimeInput"
|
|
|
+ class="price-input">
|
|
|
<template #suffix>
|
|
|
<text>分钟</text>
|
|
|
</template>
|
|
@@ -53,29 +49,20 @@
|
|
|
|
|
|
<view class="font-title">最少购买</view>
|
|
|
<view class="service-list price-box">
|
|
|
- <up-input
|
|
|
- v-model="serviceKeys.minQuantity"
|
|
|
- placeholder="用户每次下单最少购买数量"
|
|
|
- class="price-input"
|
|
|
- @blur="validateMinQuantity"
|
|
|
- ></up-input>
|
|
|
+ <up-input v-model="serviceKeys.minQuantity" placeholder="用户每次下单最少购买数量" class="price-input"
|
|
|
+ @blur="validateMinQuantity"></up-input>
|
|
|
</view>
|
|
|
|
|
|
<view class="font-title">购买单位</view>
|
|
|
<view class="service-list price-box">
|
|
|
- <up-input
|
|
|
- v-model="serviceKeys.businessUnit"
|
|
|
- placeholder="请输入购买单位,如:(次、平方、小时)"
|
|
|
- class="price-input"
|
|
|
- ></up-input>
|
|
|
+ <up-input v-model="serviceKeys.businessUnit" placeholder="请输入购买单位,如:(次、平方、小时)"
|
|
|
+ class="price-input"></up-input>
|
|
|
</view>
|
|
|
|
|
|
<view class="font-title">服务描述</view>
|
|
|
<view class="service-list">
|
|
|
- <up-textarea
|
|
|
- v-model="serviceKeys.businessDescribe"
|
|
|
- placeholder="服务描述内容,如:提供上门取衣、送衣服服务、您只需线上下单,我们工作人员便会按约定时间上门收取衣物"
|
|
|
- ></up-textarea>
|
|
|
+ <up-textarea v-model="serviceKeys.businessDescribe"
|
|
|
+ placeholder="服务描述内容,如:提供上门取衣、送衣服服务、您只需线上下单,我们工作人员便会按约定时间上门收取衣物"></up-textarea>
|
|
|
</view>
|
|
|
|
|
|
<view class="font-title">服务价格(<text class="activeColor">{{ serviceKeys.threeKeyname ||
|
|
@@ -110,7 +97,8 @@
|
|
|
|
|
|
|
|
|
<view v-for="item in updata_list" :key="item.key" class="updata-imgs">
|
|
|
- <UpdataImgs :fileList="file_url[item.key]" :data="item" :fileCount="item.fileCount" ref="zsImg" @onSubmit="onChange" />
|
|
|
+ <UpdataImgs :fileList="file_url[item.key]" :data="item" :fileCount="item.fileCount" ref="zsImg"
|
|
|
+ @onSubmit="onChange" />
|
|
|
</view>
|
|
|
|
|
|
|
|
@@ -148,41 +136,39 @@ const updata_list = [
|
|
|
ref: userImg,
|
|
|
// permission: [1, 2],
|
|
|
required: true,
|
|
|
- fileCount:1,
|
|
|
- dece:'点击服务图片'
|
|
|
+ fileCount: 1,
|
|
|
+ dece: '点击服务图片'
|
|
|
},
|
|
|
{
|
|
|
- title: '身份证国徽面',
|
|
|
- text: '上传您的身份证国徽面',
|
|
|
+ title: '身份证人像面',
|
|
|
+ text: '上传您的身份证人像面',
|
|
|
img: '/static/img/updata-user-img.png',
|
|
|
key: 'idCardPictureFront',
|
|
|
ref: zsImg,
|
|
|
- // permission: [1, 2],
|
|
|
required: true,
|
|
|
- fileCount:1,
|
|
|
- dece:'点击上传身份证国徽面'
|
|
|
+ fileCount: 1,
|
|
|
+ dece: '点击上传身份证人像面'
|
|
|
},
|
|
|
{
|
|
|
- title: '身份证人像面',
|
|
|
- text: '上传您的身份证人像面',
|
|
|
+ title: '身份证国徽面',
|
|
|
+ text: '上传您的身份证国徽面',
|
|
|
img: '/static/img/updata-user-img.png',
|
|
|
key: 'idCardPictureBack',
|
|
|
ref: zsImg,
|
|
|
- // permission: [1, 2],
|
|
|
required: true,
|
|
|
- fileCount:1,
|
|
|
- dece:'点击上传身份证人像面'
|
|
|
+ fileCount: 1,
|
|
|
+ dece: '点击上传身份证国徽面'
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
title: '职业、资质证书',
|
|
|
text: '上传您的职业、资质证书',
|
|
|
img: '/static/img/updata-user-img.png',
|
|
|
key: 'certificationPicture',
|
|
|
ref: zsImg,
|
|
|
- // permission: [1, 2],
|
|
|
required: false,
|
|
|
- fileCount:6,
|
|
|
- dece:'点击上传职业、资质证书'
|
|
|
+ fileCount: 6,
|
|
|
+ dece: '点击上传职业、资质证书'
|
|
|
}
|
|
|
]
|
|
|
|
|
@@ -209,10 +195,10 @@ const serviceKeys = reactive({
|
|
|
threeKey: '',//服务项
|
|
|
threeKeyname: '',
|
|
|
time: '',//时间
|
|
|
- price: '',//价格
|
|
|
- minQuantity: '',//最小购买次数
|
|
|
- businessUnit: '',//购买单位
|
|
|
- businessDescribe: '',//服务描述
|
|
|
+ price: '',//价格
|
|
|
+ minQuantity: '',//最小购买次数
|
|
|
+ businessUnit: '',//购买单位
|
|
|
+ businessDescribe: '',//服务描述
|
|
|
})
|
|
|
|
|
|
const timeList = [
|
|
@@ -238,7 +224,7 @@ const sex_status = {
|
|
|
const validatePriceInput = (value) => {
|
|
|
// 确保输入是纯数字
|
|
|
if (!/^\d*$/.test(value)) {
|
|
|
- serviceKeys.price = value.replace(/[^0-9.]/g, '');// 移除非数字字符
|
|
|
+ serviceKeys.price = value.replace(/[^0-9.]/g, '');// 移除非数字字符
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -302,11 +288,11 @@ const com_column = computed(() => {
|
|
|
return column_list
|
|
|
})
|
|
|
|
|
|
-const onSubmit = () =>{
|
|
|
+const onSubmit = () => {
|
|
|
uni.$u.debounce(submitForm, 300)
|
|
|
}
|
|
|
function submitForm() {
|
|
|
- try {
|
|
|
+ try {
|
|
|
|
|
|
// return;
|
|
|
// 校验表单并获取数据
|
|
@@ -376,10 +362,11 @@ function submitForm() {
|
|
|
...file_url,
|
|
|
businessManagementId: serviceKeys.threeKey || serviceKeys.itemKey || serviceKeys.classKey,
|
|
|
businessPrice: serviceKeys.price,
|
|
|
- businessDuration: serviceKeys.time,
|
|
|
+ businessDuration: Number(serviceKeys.time),
|
|
|
businessUnit: serviceKeys.businessUnit,
|
|
|
- minQuantity: serviceKeys.minQuantity,
|
|
|
- businessDescribe: serviceKeys.businessDescribe
|
|
|
+ minQuantity: Number(serviceKeys.minQuantity),
|
|
|
+ businessDescribe: serviceKeys.businessDescribe,
|
|
|
+
|
|
|
};
|
|
|
for (const key in res) {
|
|
|
parmas[key] = key == 'sex' ? sex_status[res[key]] : res[key];
|
|
@@ -387,11 +374,14 @@ function submitForm() {
|
|
|
parmas['businessManagementId'] = res[key]
|
|
|
delete parmas['businessManagementIdkey'];
|
|
|
}
|
|
|
+
|
|
|
+ if (['age'].includes(key)) {
|
|
|
+ parmas[key] = Number(res[key])
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
console.log('提交', parmas);
|
|
|
|
|
|
- // return;
|
|
|
// 提交接口,注册人员
|
|
|
const submit_res = await add(parmas);
|
|
|
if (submit_res.code == 200) {
|
|
@@ -517,7 +507,12 @@ function servesInit() {
|
|
|
Object.assign(serviceKeys, {
|
|
|
time: details.value.businessDuration,//时间
|
|
|
price: details.value.businessPrice,//价格
|
|
|
- ...obj
|
|
|
+ ...obj,
|
|
|
+ businessPrice: details.value.price,
|
|
|
+ businessDuration: details.value.time,
|
|
|
+ businessUnit: details.value.businessUnit,
|
|
|
+ minQuantity: details.value.minQuantity,
|
|
|
+ businessDescribe: details.value.businessDescribe,
|
|
|
})
|
|
|
|
|
|
|