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