上架修改
This commit is contained in:
parent
238d9edb4a
commit
54573b6cb9
|
|
@ -6,13 +6,13 @@
|
||||||
<block slot="content">服务上架</block>
|
<block slot="content">服务上架</block>
|
||||||
</cu-custom>
|
</cu-custom>
|
||||||
<!-- 表单内容 -->
|
<!-- 表单内容 -->
|
||||||
<form @submit="submit">
|
<form @submit="submit" style="position: relative; z-index: 1;">
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">服务名称<text class="text-red">*</text></view>
|
<view class="title">服务名称<text class="text-red">*</text></view>
|
||||||
<input name="servName" v-model="formData.servName" placeholder="请编辑上架标题(供客户搜索)"></input>
|
<input name="servName" v-model="formData.servName" placeholder="请编辑上架标题(供客户搜索)"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">关键词<text class="text-red">*</text></view>
|
<view class="title">搜索关键词<text class="text-red">*</text></view>
|
||||||
<input name="servDesc" v-model="formData.servDesc" placeholder="多个关键词用#分隔"></input>
|
<input name="servDesc" v-model="formData.servDesc" placeholder="多个关键词用#分隔"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="solid-top">
|
<view class="solid-top">
|
||||||
|
|
@ -20,14 +20,11 @@
|
||||||
<view class="title">选择类目<text class="text-red">*</text></view>
|
<view class="title">选择类目<text class="text-red">*</text></view>
|
||||||
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
|
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
|
||||||
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
||||||
<input v-if="formData.category"
|
<input v-if="formData.category" disabled class="line-input radius-input"
|
||||||
disabled class="line-input radius-input"
|
|
||||||
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
|
:value="formData.category && formData.category.length ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
|
||||||
placeholder="请选择类目" />
|
placeholder="请选择类目" />
|
||||||
<input v-else-if="formData.categoryConcatName"
|
<input v-else-if="formData.categoryConcatName" disabled class="line-input radius-input"
|
||||||
disabled class="line-input radius-input"
|
:value="formData.categoryConcatName" placeholder="请选择类目" />
|
||||||
:value="formData.categoryConcatName"
|
|
||||||
placeholder="请选择类目" />
|
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="formData.specsList && formData.specsList.length > 0">
|
<view v-if="formData.specsList && formData.specsList.length > 0">
|
||||||
|
|
@ -49,11 +46,13 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="flex margin-top-xs">
|
<view class="flex margin-top-xs">
|
||||||
<view class="margin-right-xs">
|
<view class="margin-right-xs">
|
||||||
<view class='text-red' style="position: absolute;">*</view>
|
<view class='text-red' style="position: absolute; z-index: 0;">*</view>
|
||||||
<zb-tooltip :content="'平' + parseInt(item.deptRate * 100) + '%+¥' + $calcUtil.curNumPlaces(item.deptMoney, 3) + '销' + parseInt((Number(item.oneRate) + Number(item.twoRate) + Number(item.threeRate) + Number(item.retainRate)) * 100) + '%+¥' + $calcUtil.curNumPlaces(item.retainMoney, 3)"
|
<zb-tooltip
|
||||||
|
:content="'平' + parseInt(item.deptRate * 100) + '%+¥' + $calcUtil.curNumPlaces(item.deptMoney, 3) + '销' + parseInt((Number(item.oneRate) + Number(item.twoRate) + Number(item.threeRate) + Number(item.retainRate)) * 100) + '%+¥' + $calcUtil.curNumPlaces(item.retainMoney, 3)"
|
||||||
placement="right" ref="goodsPriceTip">
|
placement="right" ref="goodsPriceTip">
|
||||||
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsPrice')"
|
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsPrice')"
|
||||||
:value="item.goodsPrice" placeholder="价格" @blur="hideTips('goodsPriceTip', index)"></input>
|
:value="item.goodsPrice" placeholder="价格"
|
||||||
|
@blur="hideTips('goodsPriceTip', index)"></input>
|
||||||
</zb-tooltip>
|
</zb-tooltip>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-right-xs" style="flex-basis: 21%;">
|
<view class="margin-right-xs" style="flex-basis: 21%;">
|
||||||
|
|
@ -69,7 +68,7 @@
|
||||||
:value="item.goodsUnit" placeholder="单位"></input>
|
:value="item.goodsUnit" placeholder="单位"></input>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex-basis: 14%;">
|
<view style="flex-basis: 14%;">
|
||||||
<view class='text-red' style="position: absolute;">*</view>
|
<view class='text-red' style="position: absolute; absolute; z-index: 0;">*</view>
|
||||||
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsNum')"
|
<input class="radius-input xs" @input="inputSpecs($event, index, 'goodsNum')"
|
||||||
:value="item.goodsNum" placeholder="库存数"></input>
|
:value="item.goodsNum" placeholder="库存数"></input>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -114,7 +113,7 @@
|
||||||
</my-uni-combox>
|
</my-uni-combox>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group justify-start">
|
<view class="cu-form-group justify-start">
|
||||||
<view class="title">质保期</view>
|
<view class="title">质保期<text class="text-red">*</text></view>
|
||||||
<my-uni-combox class="form-val-area" :candidates="warrantyPeriodList" placeholder="请选择"
|
<my-uni-combox class="form-val-area" :candidates="warrantyPeriodList" placeholder="请选择"
|
||||||
v-model="formData.warrantyPeriod">
|
v-model="formData.warrantyPeriod">
|
||||||
</my-uni-combox>
|
</my-uni-combox>
|
||||||
|
|
@ -122,7 +121,7 @@
|
||||||
<view class="cu-form-group justify-start">
|
<view class="cu-form-group justify-start">
|
||||||
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
||||||
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
||||||
<view class="title">服务活动</view>
|
<view class="title">服务活动<text class="text-red">*</text></view>
|
||||||
<my-uni-combox class="form-val-area" :candidates="servActivityList" placeholder="请选择"
|
<my-uni-combox class="form-val-area" :candidates="servActivityList" placeholder="请选择"
|
||||||
v-model="formData.servActivity">
|
v-model="formData.servActivity">
|
||||||
</my-uni-combox>
|
</my-uni-combox>
|
||||||
|
|
@ -130,7 +129,7 @@
|
||||||
<view class="cu-form-group justify-start">
|
<view class="cu-form-group justify-start">
|
||||||
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
|
||||||
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
|
||||||
<view class="title">服务时效</view>
|
<view class="title">服务时效<text class="text-red">*</text></view>
|
||||||
<my-uni-combox class="form-val-area" :candidates="expectDurationList" placeholder="请选择"
|
<my-uni-combox class="form-val-area" :candidates="expectDurationList" placeholder="请选择"
|
||||||
v-model="formData.expectDuration">
|
v-model="formData.expectDuration">
|
||||||
</my-uni-combox>
|
</my-uni-combox>
|
||||||
|
|
@ -144,8 +143,7 @@
|
||||||
:value="formData.region && formData.region.length ? formData.region[0].areaName + '-' + formData.region[1].areaName : ''"
|
:value="formData.region && formData.region.length ? formData.region[0].areaName + '-' + formData.region[1].areaName : ''"
|
||||||
placeholder="请选择区域"></input>
|
placeholder="请选择区域"></input>
|
||||||
<input disabled class="line-input radius-input" v-else-if="formData.areaConcatName"
|
<input disabled class="line-input radius-input" v-else-if="formData.areaConcatName"
|
||||||
:value="formData.areaConcatName"
|
:value="formData.areaConcatName" placeholder="请选择区域"></input>
|
||||||
placeholder="请选择区域"></input>
|
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-lr bg-white">
|
<view class="padding-lr bg-white">
|
||||||
|
|
@ -176,8 +174,10 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">上架区域<text class="text-red">*</text></view>
|
<view class="title">上架区域<text class="text-red">*</text></view>
|
||||||
<picker :mode="'multiSelector'" @change="multiRegionChange($event, index)" @columnchange="multiRegionColChange($event, index)"
|
<picker :mode="'multiSelector'" @change="multiRegionChange($event, index)"
|
||||||
:value="servArea[index].regionMultiIndex" :range-key="'areaName'" :range="servArea[index].regionList">
|
@columnchange="multiRegionColChange($event, index)"
|
||||||
|
:value="servArea[index].regionMultiIndex" :range-key="'areaName'"
|
||||||
|
:range="servArea[index].regionList">
|
||||||
<input disabled class="line-input radius-input" v-if="servArea[index].region"
|
<input disabled class="line-input radius-input" v-if="servArea[index].region"
|
||||||
:value="servArea[index].region && servArea[index].region.length ? servArea[index].region[0].areaName + '-' + servArea[index].region[1].areaName : ''"
|
:value="servArea[index].region && servArea[index].region.length ? servArea[index].region[0].areaName + '-' + servArea[index].region[1].areaName : ''"
|
||||||
placeholder="请选择区域"></input>
|
placeholder="请选择区域"></input>
|
||||||
|
|
@ -197,8 +197,9 @@
|
||||||
<view class="action text-black">区域描述<text class="text-red">*</text></view>
|
<view class="action text-black">区域描述<text class="text-red">*</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-lr-sm padding-bottom-sm">
|
<view class="padding-lr-sm padding-bottom-sm">
|
||||||
<textarea name="areaDesc" style="width: 100%; height: 150rpx;" class="solid radius text-left padding-sm"
|
<textarea name="areaDesc" style="width: 100%; height: 150rpx;"
|
||||||
v-model="servArea[index].areaDesc" maxlength="-1" placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
class="solid radius text-left padding-sm" v-model="servArea[index].areaDesc" maxlength="-1"
|
||||||
|
placeholder="如:XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center padding-bottom bg-white">
|
<view class="text-center padding-bottom bg-white">
|
||||||
|
|
@ -214,7 +215,7 @@
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action text-black">
|
<view class="action text-black">
|
||||||
商品封面图上传<text class="text-red">*</text>
|
商品封面图上传<text class="text-red">*</text>【只能一张一张上传】
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
|
|
@ -235,7 +236,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action text-black">
|
<view class="action text-black">
|
||||||
详情图上传<text class="text-red">*</text>
|
详情图上传<text class="text-red">*</text>【可多张勾选同时上传】
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
|
|
@ -256,7 +257,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action text-black">
|
<view class="action text-black">
|
||||||
轮播图上传<text class="text-red">*</text>
|
轮播图上传<text class="text-red">*</text>【只能一张一张上传】
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
|
|
@ -277,7 +278,7 @@
|
||||||
:maxHeight="cropHeight" :url="url2Crop" @cancel="oncancel" @ok="onok"></ksp-cropper>
|
:maxHeight="cropHeight" :url="url2Crop" @cancel="oncancel" @ok="onok"></ksp-cropper>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action text-black">
|
<view class="action text-black">
|
||||||
视频上传
|
视频上传【一分钟内的视频最佳】
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="bg-white padding-lr padding-bottom-sm">
|
<!-- <view class="bg-white padding-lr padding-bottom-sm">
|
||||||
|
|
@ -593,7 +594,8 @@
|
||||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
this.formData.category = chosenCategory;
|
this.formData.category = chosenCategory;
|
||||||
this.formData.deptGoodsCategoryId = this.formData.category[this.formData.category.length - 1].goodsCategoryId;
|
this.formData.deptGoodsCategoryId = this.formData.category[this.formData.category.length - 1]
|
||||||
|
.goodsCategoryId;
|
||||||
|
|
||||||
// 查询最后一级品类
|
// 查询最后一级品类
|
||||||
let res = await this.$request.listByStep({
|
let res = await this.$request.listByStep({
|
||||||
|
|
@ -654,7 +656,9 @@
|
||||||
this.servArea[regionIndex].regionMultiIndex = e.detail.value;
|
this.servArea[regionIndex].regionMultiIndex = e.detail.value;
|
||||||
let chosenRegion = [];
|
let chosenRegion = [];
|
||||||
for (let i = 0; i < this.servArea[regionIndex].regionList.length; i++) {
|
for (let i = 0; i < this.servArea[regionIndex].regionList.length; i++) {
|
||||||
chosenRegion.push(this.servArea[regionIndex].regionList[i][this.servArea[regionIndex].regionMultiIndex[i]]);
|
chosenRegion.push(this.servArea[regionIndex].regionList[i][this.servArea[regionIndex]
|
||||||
|
.regionMultiIndex[i]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
this.servArea[regionIndex].region = chosenRegion;
|
this.servArea[regionIndex].region = chosenRegion;
|
||||||
|
|
||||||
|
|
@ -833,7 +837,7 @@
|
||||||
if (!data.servName) {
|
if (!data.servName) {
|
||||||
errMsg = '服务名称不能为空';
|
errMsg = '服务名称不能为空';
|
||||||
} else if (!data.servDesc) {
|
} else if (!data.servDesc) {
|
||||||
errMsg = '服务描述不能为空';
|
errMsg = '搜索关键词不能为空';
|
||||||
} else if ((!data.category || !data.category.length) && (!data.categoryConcatName)) {
|
} else if ((!data.category || !data.category.length) && (!data.categoryConcatName)) {
|
||||||
errMsg = '请选择类目';
|
errMsg = '请选择类目';
|
||||||
} else if (!data.goodsStandardList || !data.goodsStandardList.length) {
|
} else if (!data.goodsStandardList || !data.goodsStandardList.length) {
|
||||||
|
|
@ -842,8 +846,14 @@
|
||||||
return false;
|
return false;
|
||||||
} else if (!data.goodsUnit) {
|
} else if (!data.goodsUnit) {
|
||||||
errMsg = '商品单位不能为空';
|
errMsg = '商品单位不能为空';
|
||||||
|
} else if (!data.warrantyPeriod) {
|
||||||
|
errMsg = '质保期不能为空';
|
||||||
|
} else if (!data.servActivity) {
|
||||||
|
errMsg = '服务活动不能为空';
|
||||||
|
} else if (!data.expectDuration) {
|
||||||
|
errMsg = '服务时效不能为空';
|
||||||
} else if (!data.goodsAreaList || !data.goodsAreaList.length) {
|
} else if (!data.goodsAreaList || !data.goodsAreaList.length) {
|
||||||
errMsg = '至少选择一个上架区域';
|
errMsg = '上架区域填写不完整';
|
||||||
} else if (!data.areaDesc) {
|
} else if (!data.areaDesc) {
|
||||||
errMsg = '区域描述不能为空';
|
errMsg = '区域描述不能为空';
|
||||||
} else if (!data.coverImgList || !data.coverImgList.length) {
|
} else if (!data.coverImgList || !data.coverImgList.length) {
|
||||||
|
|
@ -886,9 +896,9 @@
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
validMultiAreaList(list) {
|
validMultiAreaList(data) {
|
||||||
let errMsg = null;
|
let errMsg = null;
|
||||||
if (!list || !list.length) {
|
if (!data.goodsAreaList || !data.goodsAreaList.length || !data.areaDesc) {
|
||||||
errMsg = '上架区域填写不完整';
|
errMsg = '上架区域填写不完整';
|
||||||
}
|
}
|
||||||
if (errMsg) {
|
if (errMsg) {
|
||||||
|
|
@ -915,14 +925,15 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!this.validMultiAreaList(oneCheckedAreaList)) {
|
let oneServAreaObj = {
|
||||||
|
goodsAreaList: oneCheckedAreaList,
|
||||||
|
areaDesc: x.areaDesc
|
||||||
|
}
|
||||||
|
if (!this.validMultiAreaList(oneServAreaObj)) {
|
||||||
multiServAreaChecked = false;
|
multiServAreaChecked = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
multiServAreaList.push({
|
multiServAreaList.push(oneServAreaObj);
|
||||||
goodsAreaList: oneCheckedAreaList,
|
|
||||||
areaDesc: x.areaDesc
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (!multiServAreaChecked) {
|
if (!multiServAreaChecked) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -933,9 +944,7 @@
|
||||||
if (!item.goodsStandardName) {
|
if (!item.goodsStandardName) {
|
||||||
item.goodsStandardName = item.goodsCategoryName;
|
item.goodsStandardName = item.goodsCategoryName;
|
||||||
}
|
}
|
||||||
return {
|
return item;
|
||||||
...item
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let goodsAreaList = this.formData.districtList.filter((item) => {
|
let goodsAreaList = this.formData.districtList.filter((item) => {
|
||||||
|
|
@ -1046,6 +1055,16 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cu-form-group .title {
|
||||||
|
flex-basis: 26%;
|
||||||
|
text-align: justify;
|
||||||
|
padding-right: 10rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
position: relative;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.certern-height {
|
.certern-height {
|
||||||
max-height: 520rpx;
|
max-height: 520rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue