师傅入驻页面,完成三分之一
This commit is contained in:
parent
85e2d3b54e
commit
90d85ca1b7
|
|
@ -7,9 +7,11 @@ export default {
|
||||||
uni.addInterceptor('request', {
|
uni.addInterceptor('request', {
|
||||||
invoke(args) {
|
invoke(args) {
|
||||||
// request 触发前拼接 url
|
// request 触发前拼接 url
|
||||||
// args.url = 'http://www.opsoul.com' + args.url;
|
// args.url = 'https://www.opsoul.com' + args.url;
|
||||||
args.url = 'https://www.opsoul.com' + args.url;
|
args.url = 'http://127.0.0.1:80' + args.url;
|
||||||
args.data.deptId = globalData.deptId
|
if (args.data) {
|
||||||
|
args.data.deptId = globalData.deptId;
|
||||||
|
}
|
||||||
// console.log("停止触发");
|
// console.log("停止触发");
|
||||||
// return false;
|
// return false;
|
||||||
},
|
},
|
||||||
|
|
@ -138,5 +140,13 @@ export default {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
return res[1].data;
|
return res[1].data;
|
||||||
|
},
|
||||||
|
async areaListByStep(params = { parentCode: null }) {
|
||||||
|
let res = await uni.request({
|
||||||
|
url: '/system/area/list',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
return res[1].data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
<text>{{label}}</text>
|
<text>{{label}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-combox__input-box">
|
<view class="uni-combox__input-box">
|
||||||
<input class="uni-combox__input" type="text" :placeholder="placeholder"
|
<input class="uni-combox__input" type="text" :placeholder="placeholder"
|
||||||
placeholder-class="uni-combox__input-plac" v-model="inputVal.name" @input="onInput" @focus="onFocus"
|
placeholder-class="uni-combox__input-plac" v-model="inputVal[showField]" @input="onInput" @focus="onFocus"
|
||||||
@blur="onBlur" />
|
@blur="onBlur" />
|
||||||
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector">
|
||||||
</uni-icons>
|
</uni-icons>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"
|
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"
|
||||||
@click="onSelectorClick(index)">
|
@click="onSelectorClick(index)">
|
||||||
<text>{{item.name}}</text>
|
<text>{{item[showField]}}</text>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -63,19 +63,23 @@
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
showField: {
|
||||||
|
type: String,
|
||||||
|
default: 'name'
|
||||||
|
},
|
||||||
emptyTips: {
|
emptyTips: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '无匹配项'
|
default: '无匹配项'
|
||||||
},
|
},
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: [Object, String, Number],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef VUE3
|
// #ifdef VUE3
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: [String, Number],
|
type: [Object, String, Number],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
|
@ -138,7 +142,7 @@
|
||||||
this.inputVal = this.filterCandidates[index]
|
this.inputVal = this.filterCandidates[index]
|
||||||
this.showSelector = false
|
this.showSelector = false
|
||||||
this.$emit('input', this.inputVal)
|
this.$emit('input', this.inputVal)
|
||||||
this.$emit('update:modelValue', this.inputVal.name)
|
this.$emit('update:modelValue', this.inputVal[this.showField])
|
||||||
},
|
},
|
||||||
onInput() {
|
onInput() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
||||||
6
main.js
6
main.js
|
|
@ -8,7 +8,8 @@ import globalFun from './common/js/glogalFun.js';
|
||||||
import validate from './common/js/validate.js';
|
import validate from './common/js/validate.js';
|
||||||
import dateUtil from './common/js/dateUtil.js';
|
import dateUtil from './common/js/dateUtil.js';
|
||||||
import commonFun from './common/js/commonFun.js';
|
import commonFun from './common/js/commonFun.js';
|
||||||
import request from './common/js/request.js';
|
import request from './common/js/request.js';
|
||||||
|
import globalData from './common/js/globalData.js';
|
||||||
|
|
||||||
Vue.component('cu-custom', CuCustom)
|
Vue.component('cu-custom', CuCustom)
|
||||||
Vue.component('confirm-modal', ConfirmModal);
|
Vue.component('confirm-modal', ConfirmModal);
|
||||||
|
|
@ -21,7 +22,8 @@ const data = type => {
|
||||||
request.addInterceptor();
|
request.addInterceptor();
|
||||||
Vue.prototype.$api = {
|
Vue.prototype.$api = {
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
|
Vue.prototype.$globalData = globalData;
|
||||||
Vue.prototype.$globalFun = globalFun;
|
Vue.prototype.$globalFun = globalFun;
|
||||||
Vue.prototype.$validate = validate;
|
Vue.prototype.$validate = validate;
|
||||||
Vue.prototype.$dateUtil = dateUtil;
|
Vue.prototype.$dateUtil = dateUtil;
|
||||||
|
|
|
||||||
23
pages.json
23
pages.json
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "pages/index/index"
|
// "path": "pages/index/index"
|
||||||
|
"path": "pages/my/master-occupancy"
|
||||||
}],
|
}],
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "pages/area-proxy/",
|
"root": "pages/area-proxy/",
|
||||||
|
|
@ -25,14 +26,18 @@
|
||||||
}, {
|
}, {
|
||||||
"path": "finish-order"
|
"path": "finish-order"
|
||||||
}]
|
}]
|
||||||
}, {
|
}
|
||||||
"root": "pages/my/",
|
// {
|
||||||
"pages": [{
|
// "root": "pages/my/",
|
||||||
"path": "new-serv"
|
// "pages": [{
|
||||||
}, {
|
// "path": "new-serv"
|
||||||
"path": "goods-manage"
|
// }, {
|
||||||
}]
|
// "path": "goods-manage"
|
||||||
}],
|
// }, {
|
||||||
|
// "path": "master-occupancy"
|
||||||
|
// }]
|
||||||
|
// }
|
||||||
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "black"
|
"navigationBarTextStyle": "black"
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
moduleBarInfos: [],
|
moduleBarInfos: [],
|
||||||
curPageCode: 'myPage'
|
curPageCode: 'indexPage'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,189 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 顶部操作条 -->
|
||||||
|
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
|
||||||
|
<block slot="backText">返回</block>
|
||||||
|
<block slot="content">师傅入驻信息填写</block>
|
||||||
|
</cu-custom>
|
||||||
|
<!-- 步骤条 -->
|
||||||
|
<view class="bg-white padding">
|
||||||
|
<view class="cu-steps">
|
||||||
|
<view class="cu-item" :class="index>curStep?'':'text-main-color'" v-for="(stepName, index) in stepList">
|
||||||
|
<text class='cuIcon-radioboxfill'></text> {{stepName}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="curStep === 0">
|
||||||
|
<view class="margin-bottom-with-bar">
|
||||||
|
<view class="bg-white margin-top-sm" v-for="(item, index) in servArea">
|
||||||
|
<view class="cu-bar padding-lr solid-bottom">
|
||||||
|
<view class="text-lg">
|
||||||
|
<text class="cuIcon-titles"></text>
|
||||||
|
<text>服务区域{{index + 1}}(将按服务范围派单)</text>
|
||||||
|
</view>
|
||||||
|
<view @click="delServArea(index)">
|
||||||
|
<text class="text-main-color">删除</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding">
|
||||||
|
<view class="flex">
|
||||||
|
<my-uni-combox class="flex-sub margin-right-xs" :candidates="provinceList"
|
||||||
|
:showField="'areaName'" placeholder="选择省份" v-model="servArea[index].provinceObj"
|
||||||
|
@input="chooseRegion($event, 0, index)"></my-uni-combox>
|
||||||
|
<my-uni-combox class="flex-sub margin-right-xs" :candidates="servArea[index].cityList"
|
||||||
|
:showField="'areaName'" placeholder="选择城市" v-model="servArea[index].cityObj"
|
||||||
|
@input="chooseRegion($event, 1, index)"></my-uni-combox>
|
||||||
|
<my-uni-combox class="flex-sub" :candidates="servArea[index].districtList"
|
||||||
|
:showField="'areaName'" placeholder="选择地区" v-model="servArea[index].districtObj"
|
||||||
|
@input="chooseRegion($event, 2, index)"></my-uni-combox>
|
||||||
|
</view>
|
||||||
|
<checkbox-group @change="checkStreet($event, index)" class="grid col-2 margin-top-xs">
|
||||||
|
<view v-for="(item0, index0) in servArea[index].streetList" class="margin-tb-xs">
|
||||||
|
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="item0.areaCode" :checked="servArea[index].streetIds.indexOf(item0.areaCode) !== -1 ? true : false">
|
||||||
|
</checkbox>
|
||||||
|
<text>{{item0.areaName}}</text>
|
||||||
|
</view>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text-center margin-top">
|
||||||
|
<button class="cu-btn bg-main-color light" @click="addServArea">
|
||||||
|
<text class="margin-right-xs"><text class="cuIcon-add"></text></text>
|
||||||
|
<text>继续添加服务区域</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 下一步 -->
|
||||||
|
<view class="cu-bar tabbar border shop fixed-bottom-bar bg-back">
|
||||||
|
<button class="bg-main-color long-btn margin-lr" form-type="submit">下一步</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="curStep === 1" class="margin-top-sm">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view v-if="curStep === 2" class="margin-top-sm">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import myUniCombox from '@/components/uni-combox/my-uni-combox.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
myUniCombox
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.loadData();
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
curStep: 0,
|
||||||
|
stepList: ['服务范围', '服务技能', '特殊技能'],
|
||||||
|
provinceList: [],
|
||||||
|
servArea: [{
|
||||||
|
cityList: [],
|
||||||
|
districtList: [],
|
||||||
|
streetList: [],
|
||||||
|
provinceObj: {},
|
||||||
|
cityObj: {},
|
||||||
|
districtObj: {},
|
||||||
|
streetIds: []
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadData() {
|
||||||
|
this.loadProvinceList();
|
||||||
|
},
|
||||||
|
async loadProvinceList() {
|
||||||
|
let res = await this.$request.areaListByStep();
|
||||||
|
this.provinceList = res.data;
|
||||||
|
},
|
||||||
|
async chooseRegion(e, type, index) {
|
||||||
|
let that = this;
|
||||||
|
let res = await this.$request.areaListByStep({
|
||||||
|
parentCode: e.areaCode
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
// if (index > this.servArea.length - 1) {
|
||||||
|
// this.servArea.push({
|
||||||
|
// cityList: [],
|
||||||
|
// districtList: [],
|
||||||
|
// streetList: [],
|
||||||
|
// provinceObj: e,
|
||||||
|
// cityObj: {},
|
||||||
|
// districtObj: {},
|
||||||
|
// streetIds: []
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
switch (type) {
|
||||||
|
case 0: {
|
||||||
|
this.servArea[index].cityList = res.data;
|
||||||
|
this.servArea[index].districtList = [];
|
||||||
|
this.servArea[index].streetList = [];
|
||||||
|
this.servArea[index].cityObj = {};
|
||||||
|
this.servArea[index].districtObj = {};
|
||||||
|
this.servArea[index].streetIds = [];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1: {
|
||||||
|
this.servArea[index].districtList = res.data;
|
||||||
|
this.servArea[index].streetList = [];
|
||||||
|
this.servArea[index].districtObj = {};
|
||||||
|
this.servArea[index].streetIds = [];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: {
|
||||||
|
this.servArea[index].streetList = res.data;
|
||||||
|
this.servArea[index].streetIds = [];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkStreet(e, index) {
|
||||||
|
// let that = this;
|
||||||
|
let checkedIndexArr = e.detail.value;
|
||||||
|
// let streetIds = [];
|
||||||
|
// checkedIndexArr.forEach((checkedIndex) => {
|
||||||
|
// console.log("areaCode:" + that.servArea[index].streetList[checkedIndex].areaCode);
|
||||||
|
// streetIds.push(that.servArea[index].streetList[checkedIndex].areaCode)
|
||||||
|
// });
|
||||||
|
console.log(checkedIndexArr)
|
||||||
|
this.servArea[index].streetIds = checkedIndexArr;
|
||||||
|
console.log(this.servArea[index].streetIds)
|
||||||
|
},
|
||||||
|
addServArea() {
|
||||||
|
this.servArea.push({
|
||||||
|
cityList: [],
|
||||||
|
districtList: [],
|
||||||
|
streetList: [],
|
||||||
|
provinceObj: {},
|
||||||
|
cityObj: {},
|
||||||
|
districtObj: {},
|
||||||
|
streetIds: []
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delServArea(index) {
|
||||||
|
this.servArea.splice(index, 1);
|
||||||
|
console.log(this.servArea)
|
||||||
|
},
|
||||||
|
nextStep() {
|
||||||
|
this.curStep = this.curStep === this.stepList.length - 1 ? this.curStep : ++this.curStep
|
||||||
|
},
|
||||||
|
preStep() {
|
||||||
|
this.curStep = this.curStep === 0 ? 0 : --this.curStep
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .uni-combox__selector {
|
||||||
|
z-index: 99 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -83,8 +83,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="regionChange" :value="regionMultiIndex" :range-key="'name'" :range="regionList">
|
<picker :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" :value="regionMultiIndex" :range-key="'areaName'" :range="regionList">
|
||||||
<input class="line-input radius-input" :value="formData.region && formData.region.length ? formData.region[0].name + '-' + formData.region[1].name : ''"
|
<input class="line-input radius-input" :value="formData.region && formData.region.length ? formData.region[0].areaName + '-' + formData.region[1].areaName : ''"
|
||||||
placeholder="请选择区域"></input>
|
placeholder="请选择区域"></input>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<checkbox-group @change="checkDistirct" class="grid col-3">
|
<checkbox-group @change="checkDistirct" class="grid col-3">
|
||||||
<view v-for="(item, index) in formData.districtList" class="margin-tb-xs">
|
<view v-for="(item, index) in formData.districtList" class="margin-tb-xs">
|
||||||
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="index" :checked="item.checked"></checkbox>
|
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="index" :checked="item.checked"></checkbox>
|
||||||
<text>{{item.name}}</text>
|
<text>{{item.areaName}}</text>
|
||||||
</view>
|
</view>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -212,9 +212,10 @@
|
||||||
methods: {
|
methods: {
|
||||||
async loadData(goodId) {
|
async loadData(goodId) {
|
||||||
this.loadCategoryList();
|
this.loadCategoryList();
|
||||||
|
this.loadRegionList();
|
||||||
// TODO 如果存在goodId说明是修改,需要查询good信息进行回显
|
// TODO 如果存在goodId说明是修改,需要查询good信息进行回显
|
||||||
// this.categoryList = await this.$api.data('categoryList');
|
// this.categoryList = await this.$api.data('categoryList');
|
||||||
this.regionList = await this.$api.data('regionList');
|
// this.regionList = await this.$api.data('regionList');
|
||||||
},
|
},
|
||||||
async loadCategoryList(idArr) {
|
async loadCategoryList(idArr) {
|
||||||
let typeList = await this.$request.listByStep();
|
let typeList = await this.$request.listByStep();
|
||||||
|
|
@ -229,6 +230,17 @@
|
||||||
this.categoryList.push(subTypeList);
|
this.categoryList.push(subTypeList);
|
||||||
this.categoryList.push(subSubTypeList);
|
this.categoryList.push(subSubTypeList);
|
||||||
},
|
},
|
||||||
|
async loadRegionList() {
|
||||||
|
let regionList = await this.$request.areaListByStep();
|
||||||
|
regionList = regionList.data;
|
||||||
|
let subRegionList = [];
|
||||||
|
if (regionList && regionList.length > 0) {
|
||||||
|
subRegionList = await this.$request.areaListByStep({ parentCode: regionList[0].areaCode });
|
||||||
|
subRegionList = subRegionList.data;
|
||||||
|
}
|
||||||
|
this.regionList.push(regionList);
|
||||||
|
this.regionList.push(subRegionList);
|
||||||
|
},
|
||||||
async categoryChange(e) {
|
async categoryChange(e) {
|
||||||
this.categoryMultiIndex = e.detail.value;
|
this.categoryMultiIndex = e.detail.value;
|
||||||
let chosenCategory = [];
|
let chosenCategory = [];
|
||||||
|
|
@ -269,7 +281,20 @@
|
||||||
}
|
}
|
||||||
this.formData.region = chosenRegion;
|
this.formData.region = chosenRegion;
|
||||||
|
|
||||||
this.formData.districtList = await this.$api.data('districtList');
|
// 查询最后一级区域
|
||||||
|
let areaList = await this.$request.areaListByStep({parentCode: chosenRegion[1].areaCode});
|
||||||
|
this.formData.districtList = areaList.data;
|
||||||
|
},
|
||||||
|
async regionColChange(e) {
|
||||||
|
let colObj = e.detail;
|
||||||
|
if (colObj.column == 0) {
|
||||||
|
// 通过二级查三级
|
||||||
|
let subAreaList = await this.$request.areaListByStep({parentCode: this.regionList[0][colObj.value].areaCode});
|
||||||
|
subAreaList = subAreaList.data;
|
||||||
|
this.regionList.pop();
|
||||||
|
this.regionList.push(subAreaList);
|
||||||
|
this.regionMultiIndex = [colObj.value, 0];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
checkSpecs(e) {
|
checkSpecs(e) {
|
||||||
let checkedIndexArr = e.detail.value;
|
let checkedIndexArr = e.detail.value;
|
||||||
|
|
@ -296,7 +321,6 @@
|
||||||
this.formData.districtList[i].checked = false;
|
this.formData.districtList[i].checked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(this.formData)
|
|
||||||
},
|
},
|
||||||
chooseImgList(e) {
|
chooseImgList(e) {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
.bg-back {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
.line-default {
|
.line-default {
|
||||||
color: #aaaaaa;
|
color: #aaaaaa;
|
||||||
}
|
}
|
||||||
|
|
@ -39,6 +43,6 @@ radio.main-color.checked .uni-radio-input {
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-list.menu>.cu-item.bg-main-color.light {
|
.cu-list.menu>.cu-item.bg-main-color.light {
|
||||||
color: #0081ff;
|
color: #0081ff;
|
||||||
background-color: #cce6ff;
|
background-color: #cce6ff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue