|
@@ -38,12 +38,46 @@
|
|
|
<view class="font-title">服务时长(<text class="activeColor">{{ serviceKeys.threeKeyname ||
|
|
|
serviceKeys.itemKeyname ||
|
|
|
serviceKeys.classKeyname }}</text>)</view>
|
|
|
+ <view class="service-list price-box">
|
|
|
+ <up-input
|
|
|
+ v-model="serviceKeys.time"
|
|
|
+ placeholder="请输入服务时长"
|
|
|
+ @blur="validateTimeInput"
|
|
|
+ class="price-input"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <text>分钟</text>
|
|
|
+ </template>
|
|
|
+ </up-input>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <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>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="font-title">购买单位</view>
|
|
|
+ <view class="service-list price-box">
|
|
|
+ <up-input
|
|
|
+ v-model="serviceKeys.businessUnit"
|
|
|
+ placeholder="请输入购买单位,如:(1件、1次、1小时)"
|
|
|
+ class="price-input"
|
|
|
+ ></up-input>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="font-title">服务描述</view>
|
|
|
<view class="service-list">
|
|
|
- <view v-for="item in timeList" :key="item.id" @click="serviceChange(item, 'time')"
|
|
|
- :class="serviceKeys.time === item.id ? 'servicetab classActive' : 'servicetab'">
|
|
|
- {{ item.lable }}
|
|
|
- </view>
|
|
|
+ <up-textarea
|
|
|
+ v-model="serviceKeys.businessDescribe"
|
|
|
+ placeholder="服务描述内容,如:提供上门取衣、送衣服服务、您只需线上下单,我们工作人员便会按约定时间上门收取衣物"
|
|
|
+ ></up-textarea>
|
|
|
</view>
|
|
|
+
|
|
|
<view class="font-title">服务价格(<text class="activeColor">{{ serviceKeys.threeKeyname ||
|
|
|
serviceKeys.itemKeyname ||
|
|
|
serviceKeys.classKeyname }}</text>)</view>
|
|
@@ -158,7 +192,10 @@ const serviceKeys = reactive({
|
|
|
threeKey: '',//服务项
|
|
|
threeKeyname: '',
|
|
|
time: '',//时间
|
|
|
- price: '',//价格
|
|
|
+ price: '',//价格
|
|
|
+ minQuantity: '',//最小购买次数
|
|
|
+ businessUnit: '',//购买单位
|
|
|
+ businessDescribe: '',//服务描述
|
|
|
})
|
|
|
|
|
|
const timeList = [
|
|
@@ -206,6 +243,44 @@ const validatePriceInput = (value) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const validateTimeInput = (value) => {
|
|
|
+ // 确保输入是纯数字
|
|
|
+ if (!/^\d*$/.test(value)) {
|
|
|
+ serviceKeys.time = value.replace(/\D/g, ''); // 移除非数字字符
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const time = parseInt(serviceKeys.time, 10);
|
|
|
+
|
|
|
+ // 检查是否大于0
|
|
|
+ if (time <= 0) {
|
|
|
+ serviceKeys.time = null;
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入大于0的服务时长',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const validateMinQuantity = (value) => {
|
|
|
+ // 确保输入是纯数字
|
|
|
+ if (!/^\d*$/.test(value)) {
|
|
|
+ serviceKeys.minQuantity = value.replace(/\D/g, ''); // 移除非数字字符
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const quantity = parseInt(serviceKeys.minQuantity, 10);
|
|
|
+
|
|
|
+ // 检查是否大于0
|
|
|
+ if (quantity <= 0) {
|
|
|
+ serviceKeys.minQuantity = null;
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入大于0的购买数量',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
//根据类型获取表单item 值
|
|
|
const com_column = computed(() => {
|
|
|
let column_list = data.value ? column : [];
|
|
@@ -244,7 +319,7 @@ function onSubmit() {
|
|
|
}
|
|
|
if (!serviceKeys.time) {
|
|
|
uni.showToast({
|
|
|
- title: '请选择服务时长',
|
|
|
+ title: '请输入服务时长',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
@@ -256,13 +331,37 @@ function onSubmit() {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (!serviceKeys.minQuantity) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入最少购买数量',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!serviceKeys.businessUnit) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入购买单位',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!serviceKeys.businessDescribe) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入服务描述',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
const parmas = {
|
|
|
serviceCategory: data.value.key,
|
|
|
...file_url,
|
|
|
businessManagementId: serviceKeys.threeKey || serviceKeys.itemKey || serviceKeys.classKey,
|
|
|
businessPrice: serviceKeys.price,
|
|
|
- businessDuration: serviceKeys.time
|
|
|
+ businessDuration: serviceKeys.time,
|
|
|
+ businessUnit: serviceKeys.businessUnit,
|
|
|
+ minQuantity: serviceKeys.minQuantity,
|
|
|
+ businessDescribe: serviceKeys.businessDescribe
|
|
|
};
|
|
|
for (const key in res) {
|
|
|
parmas[key] = key == 'sex' ? sex_status[res[key]] : res[key];
|