上架服务-选择品类 后台接口对接
This commit is contained in:
parent
a48ce70a24
commit
85e2d3b54e
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
deptId: 1,
|
deptId: 101,
|
||||||
initPageNum: 1,
|
initPageNum: 1,
|
||||||
initPageSize: 5
|
initPageSize: 5
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
import globalData from '@/common/js/globalData.js';
|
import globalData from '@/common/js/globalData.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
address: 'http://127.0.0.1:80',
|
address: 'https://www.opsoul.com',
|
||||||
// 异步接口拦截
|
// 异步接口拦截
|
||||||
addInterceptor() {
|
addInterceptor() {
|
||||||
uni.addInterceptor('request', {
|
uni.addInterceptor('request', {
|
||||||
invoke(args) {
|
invoke(args) {
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
// args.url = 'http://www.opsoul.com' + args.url;
|
// args.url = 'http://www.opsoul.com' + args.url;
|
||||||
args.url = this.address + args.url;
|
args.url = 'https://www.opsoul.com' + args.url;
|
||||||
|
args.data.deptId = globalData.deptId
|
||||||
// console.log("停止触发");
|
// console.log("停止触发");
|
||||||
// return false;
|
// return false;
|
||||||
},
|
},
|
||||||
|
|
@ -129,5 +130,13 @@ export default {
|
||||||
resObj = JSON.parse(resStr);
|
resObj = JSON.parse(resStr);
|
||||||
}
|
}
|
||||||
return resObj;
|
return resObj;
|
||||||
|
},
|
||||||
|
async listByStep(params = {goodsCategoryId : null}) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/goods/deptcategory/listByStep',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
pages.json
10
pages.json
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"pages": [{
|
"pages": [{
|
||||||
// "path": "pages/index/index"
|
"path": "pages/index/index"
|
||||||
"path": "pages/my/new-serv"
|
|
||||||
}],
|
}],
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "pages/area-proxy/",
|
"root": "pages/area-proxy/",
|
||||||
|
|
@ -26,6 +25,13 @@
|
||||||
}, {
|
}, {
|
||||||
"path": "finish-order"
|
"path": "finish-order"
|
||||||
}]
|
}]
|
||||||
|
}, {
|
||||||
|
"root": "pages/my/",
|
||||||
|
"pages": [{
|
||||||
|
"path": "new-serv"
|
||||||
|
}, {
|
||||||
|
"path": "goods-manage"
|
||||||
|
}]
|
||||||
}],
|
}],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
|
|
||||||
|
|
@ -10,31 +10,34 @@
|
||||||
<view class="cu-bar search bg-white">
|
<view class="cu-bar search bg-white">
|
||||||
<view class="search-form round">
|
<view class="search-form round">
|
||||||
<text class="cuIcon-search"></text>
|
<text class="cuIcon-search"></text>
|
||||||
<input @confirm="searchTasks" :adjust-position="true" type="text" placeholder="输入搜索的内容"
|
<input @confirm="searchTasks" :adjust-position="true" v-model="searchInputVal" type="text" placeholder="输入搜索的内容"
|
||||||
confirm-type="search"></input>
|
confirm-type="search"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="action">
|
<view class="action">
|
||||||
<button class="cu-btn bg-main-color shadow-blur round">搜索</button>
|
<button class="cu-btn bg-main-color shadow-blur round" @click="searchTasks">搜索</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 条件筛选栏 -->
|
<!-- 条件筛选栏 -->
|
||||||
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true"
|
<scroll-view scroll-x class="bg-white nav text-center" :scroll-with-animation="true"
|
||||||
:scroll-left="scrollLeft">
|
:scroll-left="scrollLeft">
|
||||||
<view class="cu-item"
|
<view class="cu-item" v-for="(item,index) in taskConditions" v-if="item.type !== 1" :key="index"
|
||||||
v-for="(item,index) in taskConditions" v-if="item.type !== 1" :key="index" @tap="tabSelect" :data-id="index">
|
@tap="tabSelect" :data-id="index">
|
||||||
<!-- 区域筛选picker -->
|
<!-- 区域筛选picker -->
|
||||||
<picker v-if="item.code === 'area'" :mode="'multiSelector'" @change="regionChange" :value="areaMultiIndex" :range-key="'name'" :range="areaList">
|
<picker v-if="item.code === 'area'" :mode="'multiSelector'" @change="regionChange"
|
||||||
|
:value="areaMultiIndex" :range-key="'name'" :range="areaList">
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</picker>
|
</picker>
|
||||||
<!-- 品类筛选picker -->
|
<!-- 品类筛选picker -->
|
||||||
<picker v-else-if="item.code === 'category'" :mode="'multiSelector'" @change="categoryChange" :value="categoryMultiIndex" :range-key="'name'" :range="categoryList">
|
<picker v-else-if="item.code === 'category'" :mode="'multiSelector'" @change="categoryChange"
|
||||||
|
:value="categoryMultiIndex" :range-key="'name'" :range="categoryList">
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</picker>
|
</picker>
|
||||||
<text v-else>
|
<text v-else>
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
<text v-if="item.type === 0" class="text-lg"><text :class="item.value === 0 ? 'cuIcon-triangleupfill' : 'cuIcon-triangledownfill'"></text></text>
|
<text v-if="item.type === 0" class="text-lg"><text
|
||||||
|
:class="item.value === 0 ? 'cuIcon-triangleupfill' : 'cuIcon-triangledownfill'"></text></text>
|
||||||
<text v-else class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
<text v-else class="text-lg"><text class="cuIcon-triangledownfill"></text></text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -59,7 +62,8 @@
|
||||||
<view v-for="(tagContent, index1) in task.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
|
<view v-for="(tagContent, index1) in task.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-locationfill"></text></text>
|
<text class="text-main-color text-lg margin-right-xs"><text
|
||||||
|
class="cuIcon-locationfill"></text></text>
|
||||||
<text>{{task.address}}</text>
|
<text>{{task.address}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm">
|
<view class="margin-top-sm">
|
||||||
|
|
@ -67,11 +71,15 @@
|
||||||
<text>{{task.doorTime}}</text>
|
<text>{{task.doorTime}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-top-sm flex justify-end">
|
<view class="padding-top-sm flex justify-end">
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal" @click="showModal($event, index)">转发</button>
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal"
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showAddPriceModal" @click="showModal($event, index)">加价</button>
|
@click="showModal($event, index)">转发</button>
|
||||||
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showAddPriceModal"
|
||||||
|
@click="showModal($event, index)">加价</button>
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" v-if="task.canQuote">报价</button>
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" v-if="task.canQuote">报价</button>
|
||||||
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" @click="showDemandDetail($event, index)">查看</button>
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur"
|
||||||
<button class="cu-btn bg-main-color shadow-blur" data-take-modal="showTakeSuccessModal" data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, index)">接单</button>
|
@click="showDemandDetail($event, index)">查看</button>
|
||||||
|
<button class="cu-btn bg-main-color shadow-blur" data-take-modal="showTakeSuccessModal"
|
||||||
|
data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, index)">接单</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -92,13 +100,15 @@
|
||||||
<text>元</text>
|
<text>元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="margin-top-sm flex justify-center">
|
<view class="margin-top-sm flex justify-center">
|
||||||
<textarea class="solid radius text-left padding-sm" maxlength="-1" name="comments" placeholder="加价原因备注"></textarea>
|
<textarea class="solid radius text-left padding-sm" maxlength="-1" name="comments"
|
||||||
|
placeholder="加价原因备注"></textarea>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action margin-0 flex-sub text-black" data-modal="showAddPriceModal" @tap="hideModal">取消</view>
|
<view class="action margin-0 flex-sub text-black" data-modal="showAddPriceModal" @tap="hideModal">取消
|
||||||
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal" data-modal="showAddPriceModal"
|
</view>
|
||||||
@click="applyAddPrice">立即提交</view>
|
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
|
||||||
|
data-modal="showAddPriceModal" @click="applyAddPrice">立即提交</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -121,9 +131,10 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action margin-0 flex-sub text-black" data-modal="showForwardModal" @tap="hideModal">取消</view>
|
<view class="action margin-0 flex-sub text-black" data-modal="showForwardModal" @tap="hideModal">取消
|
||||||
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showForwardModal" @tap="hideModal"
|
</view>
|
||||||
@click="forwardTask">立即推荐</view>
|
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showForwardModal"
|
||||||
|
@tap="hideModal" @click="forwardTask">立即推荐</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -135,9 +146,10 @@
|
||||||
<view>您还未进行认证</view>
|
<view>您还未进行认证</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal" @tap="hideModal">以后认证</view>
|
<view class="action margin-0 flex-sub text-black" data-modal="showTakeCertifiedModal"
|
||||||
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTakeCertifiedModal" @tap="hideModal"
|
@tap="hideModal">以后认证</view>
|
||||||
@click="goToCertify">立即认证</view>
|
<view class="action margin-0 flex-sub text-main-color solid-left"
|
||||||
|
data-modal="showTakeCertifiedModal" @tap="hideModal" @click="goToCertify">立即认证</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -150,8 +162,10 @@
|
||||||
<view>请在30分钟内联系客户,预约好上门时间,并在订单中操作排单时间,超时6倍将受平台处罚管理;该订单佣金在完成任务24小时内计入您的账户</view>
|
<view>请在30分钟内联系客户,预约好上门时间,并在订单中操作排单时间,超时6倍将受平台处罚管理;该订单佣金在完成任务24小时内计入您的账户</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-bar bg-white solid-top">
|
<view class="cu-bar bg-white solid-top">
|
||||||
<view class="action margin-0 flex-sub text-black" data-modal="showTakeSuccessModal" @click="contactCustomer">联系客户</view>
|
<view class="action margin-0 flex-sub text-black" data-modal="showTakeSuccessModal"
|
||||||
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTakeSuccessModal" @tap="hideModal">继续接单</view>
|
@click="contactCustomer">联系客户</view>
|
||||||
|
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTakeSuccessModal"
|
||||||
|
@tap="hideModal">继续接单</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -165,7 +179,29 @@
|
||||||
tabCur: 0,
|
tabCur: 0,
|
||||||
scrollLeft: 0,
|
scrollLeft: 0,
|
||||||
stickyTop: this.CustomBar,
|
stickyTop: this.CustomBar,
|
||||||
taskConditions: [],
|
// type: 0=升降序,1=功能按钮;order: 0=升序,1=降序;
|
||||||
|
taskConditions: [{
|
||||||
|
code: 'area',
|
||||||
|
title: '区域'
|
||||||
|
}, {
|
||||||
|
code: 'category',
|
||||||
|
title: '品类'
|
||||||
|
}, {
|
||||||
|
code: 'distance',
|
||||||
|
title: '距离',
|
||||||
|
type: 0,
|
||||||
|
value: 0,
|
||||||
|
}, {
|
||||||
|
code: 'time',
|
||||||
|
title: '时间',
|
||||||
|
type: 0,
|
||||||
|
value: 0,
|
||||||
|
}, {
|
||||||
|
code: 'reset',
|
||||||
|
type: 1,
|
||||||
|
title: '重置'
|
||||||
|
}],
|
||||||
|
searchInputVal: '',
|
||||||
tasks: [],
|
tasks: [],
|
||||||
curTask: null,
|
curTask: null,
|
||||||
takeCertify: false,
|
takeCertify: false,
|
||||||
|
|
@ -184,7 +220,6 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
async loadData() {
|
||||||
this.taskConditions = await this.$api.data('taskConditions');
|
|
||||||
this.tasks = await this.$api.data('tasks');
|
this.tasks = await this.$api.data('tasks');
|
||||||
this.takeCertify = await this.$api.data('takeCertify');
|
this.takeCertify = await this.$api.data('takeCertify');
|
||||||
this.areaList = await this.$api.data('areaList');
|
this.areaList = await this.$api.data('areaList');
|
||||||
|
|
@ -200,11 +235,20 @@
|
||||||
let orderVal = this.taskConditions[this.tabCur].value;
|
let orderVal = this.taskConditions[this.tabCur].value;
|
||||||
this.taskConditions[this.tabCur].value = orderVal === 0 ? 1 : 0;
|
this.taskConditions[this.tabCur].value = orderVal === 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
this.searchTasks();
|
||||||
|
},
|
||||||
|
searchTasks() {
|
||||||
|
let qryObj = {};
|
||||||
|
this.taskConditions.forEach((condition) => {
|
||||||
|
qryObj[condition.code] = condition.value;
|
||||||
|
})
|
||||||
|
qryObj.name = this.searchInputVal;
|
||||||
|
//TODO: 调用查询tasks的接口
|
||||||
},
|
},
|
||||||
regionChange(e) {
|
regionChange(e) {
|
||||||
this.areaMultiIndex = e.detail.value;
|
this.areaMultiIndex = e.detail.value;
|
||||||
let chosenArea = [];
|
let chosenArea = [];
|
||||||
for(let i = 0; i < this.areaList.length; i++) {
|
for (let i = 0; i < this.areaList.length; i++) {
|
||||||
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
|
chosenArea.push(this.areaList[i][this.areaMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
this.taskConditions[this.tabCur].value = chosenArea;
|
this.taskConditions[this.tabCur].value = chosenArea;
|
||||||
|
|
@ -212,7 +256,7 @@
|
||||||
categoryChange(e) {
|
categoryChange(e) {
|
||||||
this.categoryMultiIndex = e.detail.value;
|
this.categoryMultiIndex = e.detail.value;
|
||||||
let chosenCategory = [];
|
let chosenCategory = [];
|
||||||
for(let i = 0; i < this.categoryList.length; i++) {
|
for (let i = 0; i < this.categoryList.length; i++) {
|
||||||
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
chosenCategory.push(this.categoryList[i][this.categoryMultiIndex[i]]);
|
||||||
}
|
}
|
||||||
this.taskConditions[this.tabCur].value = chosenCategory;
|
this.taskConditions[this.tabCur].value = chosenCategory;
|
||||||
|
|
@ -222,7 +266,8 @@
|
||||||
orderId: this.tasks[taskIndex].id
|
orderId: this.tasks[taskIndex].id
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/demand-center/demand-detail?paramObj=' + encodeURIComponent(JSON.stringify(paramObj))
|
url: '/pages/demand-center/demand-detail?paramObj=' + encodeURIComponent(JSON.stringify(
|
||||||
|
paramObj))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
takeTask(e, taskIndex) {
|
takeTask(e, taskIndex) {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="editGood(good)">编辑</button>
|
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="addEditGood(good)">编辑</button>
|
||||||
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="offGood(good)">下架</button>
|
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="offGood(good)">下架</button>
|
||||||
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="copyGood(good)">复制</button>
|
<button class="cu-btn line-main-color margin-right-xs margin-top-sm" @click="copyGood(good)">复制</button>
|
||||||
<button class="cu-btn line-main-color margin-right-xs margin-top-sm">优惠券</button>
|
<button class="cu-btn line-main-color margin-right-xs margin-top-sm">优惠券</button>
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="cu-bar tabbar border shop fixed-bottom-bar bg-white">
|
<view class="cu-bar tabbar border shop fixed-bottom-bar bg-white">
|
||||||
<button class="cu-btn bg-main-color lg shadow-blur margin-left-xs">新增服务</button>
|
<button class="cu-btn bg-main-color lg shadow-blur margin-left-xs" @click="addEditGood(null)">新增服务</button>
|
||||||
<button class="cu-btn bg-main-color lg shadow-blur">优惠券</button>
|
<button class="cu-btn bg-main-color lg shadow-blur">优惠券</button>
|
||||||
<button class="cu-btn bg-main-color lg shadow-blur">暂停售卖</button>
|
<button class="cu-btn bg-main-color lg shadow-blur">暂停售卖</button>
|
||||||
<button class="cu-btn bg-main-color lg shadow-blur margin-right-xs" data-modal="communityModal" @tap="showModal">社区</button>
|
<button class="cu-btn bg-main-color lg shadow-blur margin-right-xs" data-modal="communityModal" @tap="showModal">社区</button>
|
||||||
|
|
@ -172,6 +172,15 @@
|
||||||
},
|
},
|
||||||
comfirmCommunity() {
|
comfirmCommunity() {
|
||||||
|
|
||||||
|
},
|
||||||
|
addEditGood(servItem) {
|
||||||
|
let params = '';
|
||||||
|
if (servItem != null) {
|
||||||
|
params = '?goodId=' + servItem.id
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/my/new-serv' + params
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
<view class="solid-top">
|
<view class="solid-top">
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">选择类目</view>
|
<view class="title">选择类目</view>
|
||||||
<picker :mode="'multiSelector'" @change="categoryChange" :value="categoryMultiIndex" :range-key="'name'" :range="categoryList">
|
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
|
||||||
<input class="line-input radius-input" :value="formData.category && formData.category.length ? formData.category[0].name + '-' + formData.category[1].name + '-' + formData.category[2].name : ''"
|
<input 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>
|
placeholder="请选择类目"></input>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -202,14 +202,33 @@
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.loadData();
|
let goodId = null;
|
||||||
|
if (options && options.goodId) {
|
||||||
|
goodId = options.goodId;
|
||||||
|
}
|
||||||
|
this.loadData(goodId);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadData() {
|
async loadData(goodId) {
|
||||||
this.categoryList = await this.$api.data('categoryList');
|
this.loadCategoryList();
|
||||||
|
// TODO 如果存在goodId说明是修改,需要查询good信息进行回显
|
||||||
|
// this.categoryList = await this.$api.data('categoryList');
|
||||||
this.regionList = await this.$api.data('regionList');
|
this.regionList = await this.$api.data('regionList');
|
||||||
},
|
},
|
||||||
|
async loadCategoryList(idArr) {
|
||||||
|
let typeList = await this.$request.listByStep();
|
||||||
|
typeList = typeList.data;
|
||||||
|
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
|
||||||
|
let subTypeList = await this.$request.listByStep({ goodsCategoryId: col1Id });
|
||||||
|
subTypeList = subTypeList.data;
|
||||||
|
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
|
||||||
|
let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: col2Id });
|
||||||
|
subSubTypeList = subSubTypeList.data;
|
||||||
|
this.categoryList.push(typeList);
|
||||||
|
this.categoryList.push(subTypeList);
|
||||||
|
this.categoryList.push(subSubTypeList);
|
||||||
|
},
|
||||||
async categoryChange(e) {
|
async categoryChange(e) {
|
||||||
this.categoryMultiIndex = e.detail.value;
|
this.categoryMultiIndex = e.detail.value;
|
||||||
let chosenCategory = [];
|
let chosenCategory = [];
|
||||||
|
|
@ -220,6 +239,28 @@
|
||||||
|
|
||||||
this.formData.specsList = await this.$api.data('specsList');
|
this.formData.specsList = await this.$api.data('specsList');
|
||||||
},
|
},
|
||||||
|
async categoryColChange(e) {
|
||||||
|
let colObj = e.detail;
|
||||||
|
if (colObj.column == 0) {
|
||||||
|
// 通过一级查询二级,通过二级查三级
|
||||||
|
let subTypeList = await this.$request.listByStep({goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId});
|
||||||
|
subTypeList = subTypeList.data;
|
||||||
|
let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: subTypeList[0].goodsCategoryId });
|
||||||
|
subSubTypeList = subSubTypeList.data;
|
||||||
|
this.categoryList.pop();
|
||||||
|
this.categoryList.pop();
|
||||||
|
this.categoryList.push(subTypeList);
|
||||||
|
this.categoryList.push(subSubTypeList);
|
||||||
|
this.categoryMultiIndex = [colObj.value, 0, 0];
|
||||||
|
} else if (colObj.column == 1) {
|
||||||
|
// 通过二级查三级
|
||||||
|
let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId });
|
||||||
|
subSubTypeList = subSubTypeList.data;
|
||||||
|
this.categoryList.pop();
|
||||||
|
this.categoryList.push(subSubTypeList);
|
||||||
|
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
|
||||||
|
}
|
||||||
|
},
|
||||||
async regionChange(e) {
|
async regionChange(e) {
|
||||||
this.regionMultiIndex = e.detail.value;
|
this.regionMultiIndex = e.detail.value;
|
||||||
let chosenRegion = [];
|
let chosenRegion = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue