删除debugger,证照信息需要上传正反面,修改店铺信息,地址回显,bug修改,代码优化,店铺详情展示优化

master
mabo 2021-08-13 18:03:07 +08:00
parent cfc5c94f5a
commit 14a8695cc9
6 changed files with 226 additions and 143 deletions

View File

@ -138,7 +138,7 @@
<script> <script>
import Promotion from './Promotion.vue'; import Promotion from './Promotion.vue';
import PicZoom from 'vue-piczoom'; // https://github.com/826327700/vue-piczoom import PicZoom from 'vue-piczoom'; //
import { collectGoods, isCollection, receiveCoupon, cancelCollect } from '@/api/member.js'; import { collectGoods, isCollection, receiveCoupon, cancelCollect } from '@/api/member.js';
import { addCartGoods } from '@/api/cart.js'; import { addCartGoods } from '@/api/cart.js';
export default { export default {
@ -173,7 +173,6 @@ export default {
methods: { methods: {
select (index, value) { // select (index, value) { //
this.$set(this.currentSelceted, index, value); this.$set(this.currentSelceted, index, value);
let selectedSkuId = this.goodsSpecList.find((i) => { let selectedSkuId = this.goodsSpecList.find((i) => {
let matched = true; let matched = true;
let specValues = i.specValues.filter((j) => j.specName !== 'images'); let specValues = i.specValues.filter((j) => j.specName !== 'images');
@ -200,7 +199,6 @@ export default {
}; };
this.loading = true; this.loading = true;
addCartGoods(params).then(res => { addCartGoods(params).then(res => {
debugger;
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
this.$router.push({path: '/shoppingCart', query: {detail: this.skuDetail, count: this.count}}); this.$router.push({path: '/shoppingCart', query: {detail: this.skuDetail, count: this.count}});
@ -208,7 +206,6 @@ export default {
this.$Message.warning(res.message); this.$Message.warning(res.message);
} }
}).catch(() => { }).catch(() => {
console.log('catch');
this.loading = false; this.loading = false;
}); });
}, },

View File

@ -158,7 +158,7 @@
<Button type="info" :loading="uploadLoading1">证照上传</Button> <Button type="info" :loading="uploadLoading1">证照上传</Button>
</Upload> </Upload>
<div class="describe"> <div class="describe">
请压缩图片在2M以内格式为gifjpgpng并确保文字清晰以免上传或审核失败 请压缩图片在2M以内身份证正反面两张照片确保图片清晰无缺角
</div> </div>
<div <div
class="img-list" class="img-list"
@ -299,8 +299,8 @@ export default {
// //
beforeUpload1 () { beforeUpload1 () {
this.uploadLoading1 = true; this.uploadLoading1 = true;
if (this.form.legalPhoto.length >= 3) { if (this.form.legalPhoto.length >= 2) {
this.$Message.warning('最多上传张图片') this.$Message.warning('最多上传张图片')
return false; return false;
} }
}, },
@ -313,8 +313,6 @@ export default {
handleSuccess1 (res, file) { handleSuccess1 (res, file) {
this.uploadLoading1 = false; this.uploadLoading1 = false;
this.form.legalPhoto.push(res.result); this.form.legalPhoto.push(res.result);
console.log(res);
console.log(file);
}, },
// //
uploadErr () { uploadErr () {

View File

@ -3,59 +3,39 @@
<Cascader <Cascader
:data="data" :data="data"
:load-data="loadData" :load-data="loadData"
change-on-select v-model="addr"
@on-visible-change="handleChangeOnSelect" placeholder="请选择地址"
@on-change="change" @on-change="change"
style="width: 350px"
></Cascader> ></Cascader>
</div> </div>
</template> </template>
<script> <script>
import {getChildRegion} from '@/api/common.js';
import * as API_Setup from "@/api/common.js";
export default { export default {
data () { data () {
return { return {
data: [], // data: [], //
selected: [], // addr: [] //
id: 0, // id
changeOnSelect: false, //
}; };
}, },
mounted() {
this.init();
},
props: ['addressId'], props: ['addressId'],
mounted () {},
methods: { methods: {
// change (val, selectedData) { //
change(val, selectedData) {
/** /**
* @returns [regionId,region] * @returns [regionId,region]
*/ */
this.$emit("selected", [ this.$emit('selected', [
val, val,
selectedData[selectedData.length - 1].__label.split("/"), selectedData[selectedData.length - 1].__label.split('/')
]); ]);
}, },
/** loadData (item, callback) { //
* 动态设置change-on-select的值
* 当级联选择器弹窗展开时设置change-on-select为true即可以点选菜单选项值发生变化
* 当级联选择器弹窗关闭时设置change-on-select为false即能够设置初始值
*/
handleChangeOnSelect(value) {
this.changeOnSelect = value;
},
//
loadData(item, callback) {
item.loading = true; item.loading = true;
API_Setup.getChildRegion(item.value).then((res) => { getChildRegion(item.value).then((res) => {
if (res.result.length <= 0) { if (res.result.length <= 0) {
item.loading = false; item.loading = false;
this.selected = item;
/**
* 处理数据并返回
*/
} else { } else {
res.result.forEach((child) => { res.result.forEach((child) => {
item.loading = false; item.loading = false;
@ -64,54 +44,138 @@ export default {
value: child.id, value: child.id,
label: child.name, label: child.name,
loading: false, loading: false,
children: [], children: []
}; };
if ( if (child.level === 'street' || item.label === '香港特别行政区') {
child.level == "street" ||
item.label == "香港特别行政区" ||
item.label == "澳门特别行政区"
) {
item.children.push({ item.children.push({
value: child.id, value: child.id,
label: child.name, label: child.name
}); });
} else { } else {
item.children.push(data); item.children.push(data);
} }
}); });
this.selected = item;
callback(); callback();
} }
}); });
}, },
// async init () { //
init() { let data = await getChildRegion(0);
API_Setup.getChildRegion(this.id).then((res) => { let arr = [];
let way = []; data.result.forEach((item) => {
let obj;
res.result.forEach((item) => {
let data;
// //
if (item.name == "台湾省") { if (item.name === '台湾省') {
data = { obj = {
value: item.id, value: item.id,
label: item.name, label: item.name
}; };
} else { } else {
data = { obj = {
value: item.id, value: item.id,
label: item.name, label: item.name,
loading: false, loading: false,
children: [], children: []
}; };
} }
way.push(data); arr.push(obj);
}); });
this.data = way; this.data = arr;
},
async reviewData () {
//
let addr = JSON.parse(JSON.stringify(this.addressId.split(',')));
let length = addr.length;
let data = await getChildRegion(0);
let arr0 = [];
let arr1 = [];
let arr2 = [];
//
data.result.forEach((item) => {
let obj;
//
if (item.name === '台湾省') {
obj = {
value: item.id,
label: item.name
};
} else {
obj = {
value: item.id,
label: item.name,
loading: false,
children: []
};
}
arr0.push(obj);
}); });
//
if (length > 0) {
let children = await getChildRegion(addr[0]);
children = this.handleData(children.result);
arr0.forEach((e) => {
if (e.value === addr[0]) {
e.children = arr1 = children;
}
});
}
if (length > 1) {
let children = await getChildRegion(addr[1]);
children = this.handleData(children.result);
arr1.forEach((e) => {
if (e.value === addr[1]) {
e.children = arr2 = children;
}
});
}
if (length > 2) {
let children = await getChildRegion(addr[2]);
children = this.handleData(children.result);
arr2.forEach((e) => {
if (e.value === addr[2]) {
e.children = children;
}
});
}
this.data = arr0;
this.addr = addr;
}, },
handleData (data) {
//
let item = [];
data.forEach((child) => {
let obj = {
value: child.id,
label: child.name,
loading: false,
children: []
};
if (child.level === 'street' || item.label === '香港特别行政区') {
item.push({
value: child.id,
label: child.name
});
} else {
item.push(obj);
}
});
return item;
}
}, },
watch: {
addressId: {
handler: function (v) {
if (v) {
this.reviewData();
} else {
this.init();
}
},
immediate: true
}
}
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -129,7 +129,7 @@
<p class="item"> <p class="item">
<span class="label">身份证照片</span> <span class="label">身份证照片</span>
<span class="info"> <span class="info">
<img style="height: 100px;width: 90px" :src="storeInfo.legalPhoto"> <img style="height: 100px;width: 100px" class="mr_10" v-for="item in storeInfo.legalPhoto" :src="item" :key="item">
</span> </span>
</p> </p>
<p class="item"> <p class="item">
@ -144,7 +144,7 @@
<p class="item"> <p class="item">
<span class="label">营业执照电子版</span> <span class="label">营业执照电子版</span>
<span class="info"> <span class="info">
<img style="height: 100px;width: 90px" :src="storeInfo.licencePhoto"> <img style="height: 100px;width: 100px" :src="storeInfo.licencePhoto">
</span> </span>
</p> </p>
@ -846,6 +846,7 @@
//switchtruefalse //switchtruefalse
this.storeInfo.storeDisable = this.storeInfo.storeDisable === "OPEN" ? true : false this.storeInfo.storeDisable = this.storeInfo.storeDisable === "OPEN" ? true : false
this.checkAllGroup = this.storeInfo.goodsManagementCategory.split(","); this.checkAllGroup = this.storeInfo.goodsManagementCategory.split(",");
this.storeInfo.legalPhoto = this.storeInfo.legalPhoto.split(",");
}); });
}, },
// //

View File

@ -3,7 +3,8 @@
<Card> <Card>
<Button class="mb_10" v-if="shopForm.storeDisable === 'APPLYING'" type="primary" @click="audit"></Button> <Button class="mb_10" v-if="shopForm.storeDisable === 'APPLYING'" type="primary" @click="audit"></Button>
<Tabs v-model="tabName" :animated="false" style="overflow: visible"> <Tabs v-model="tabName" :animated="false" style="overflow: visible">
<Form ref="shopForm" :model="shopForm" :label-width="130" label-position="right" :rules="shopValidate"> <Form ref="shopForm" :model="shopForm" :label-width="130" label-position="right" :rules="shopValidate" @on-validate="formValidate">
<TabPane label="基本信息" class="tab" name="base"> <TabPane label="基本信息" class="tab" name="base">
<Divider orientation="left">基本信息</Divider> <Divider orientation="left">基本信息</Divider>
<!-- 遮罩层 --> <!-- 遮罩层 -->
@ -13,7 +14,6 @@
<div class="item"> <div class="item">
<Input disabled v-model="shopForm.memberName" /> <Input disabled v-model="shopForm.memberName" />
<Button @click="selectMember()" v-if="!$route.query.shopId"></Button> <Button @click="selectMember()" v-if="!$route.query.shopId"></Button>
</div> </div>
</FormItem> </FormItem>
<FormItem label="店铺名称" prop="storeName"> <FormItem label="店铺名称" prop="storeName">
@ -57,35 +57,34 @@
</FormItem> </FormItem>
<FormItem label="店铺简介" prop="storeDesc" style="width: 350px"> <FormItem label="店铺简介" prop="storeDesc" style="width: 350px">
<Input v-model="shopForm.storeDesc" type="textarea" :rows="4" clearable style="width: 400px" /> <Input v-model="shopForm.storeDesc" type="textarea" :rows="4" maxlength="200"
show-word-limit clearable style="width: 400px" />
</FormItem> </FormItem>
<br> <br>
<Divider orientation="left">退货收件地址</Divider> <Divider orientation="left">退货收件地址</Divider>
<FormItem label="收件人姓名" prop="salesConsigneeName"> <FormItem label="收件人姓名">
<Input v-model="shopForm.salesConsigneeName" clearable style="width: 350px" /> <Input v-model="shopForm.salesConsigneeName" clearable style="width: 350px" />
</FormItem> </FormItem>
<FormItem label="收件人手机" prop="salesConsigneeMobile"> <FormItem label="收件人手机">
<Input v-model="shopForm.salesConsigneeMobile" clearable maxlength="11" style="width: 350px" /> <Input v-model="shopForm.salesConsigneeMobile" clearable maxlength="11" style="width: 350px" />
</FormItem> </FormItem>
<FormItem label="地址信息" prop="salesConsigneeAddressPath"> <FormItem label="地址信息">
<Input v-model="shopForm.salesConsigneeAddressPath" disabled style="width: 305px" v-if="showRegion == false" /> <region style="width: 350px" @selected="selectedConsigneeRegion" :addressId="returnAddress" />
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary" icon="ios-create-outline" style="margin-left: 8px">
</Button>
<region style="width: 350px" @selected="selectedConsigneeRegion" v-if="showRegion == true" />
</FormItem> </FormItem>
<FormItem label="详细地址" prop="salesConsigneeDetail"> <FormItem label="详细地址">
<Input v-model="shopForm.salesConsigneeDetail" clearable style="width: 350px" /> <Input v-model="shopForm.salesConsigneeDetail" clearable style="width: 350px" />
</FormItem> </FormItem>
<Divider orientation="left">腾讯云智服</Divider> <Divider orientation="left">腾讯云智服</Divider>
<FormItem label="唯一标识" prop="salesConsigneeDetail"> <FormItem label="唯一标识">
<Input v-model="shopForm.yzfSign" clearable style="width: 350px" /> <Input v-model="shopForm.yzfSign" clearable style="width: 350px" />
</FormItem> </FormItem>
<FormItem label="小程序唯一标识" prop="salesConsigneeDetail"> <FormItem label="小程序唯一标识">
<Input v-model="shopForm.yzfMpSign" clearable style="width: 350px" /> <Input v-model="shopForm.yzfMpSign" clearable style="width: 350px" />
</FormItem> </FormItem>
<Spin fix v-if="loading"></Spin> <Spin fix v-if="loading"></Spin>
</div> </div>
</TabPane> </TabPane>
<!-- 入驻信息 --> <!-- 入驻信息 -->
<TabPane label="入驻信息" class="tab" name="entry"> <TabPane label="入驻信息" class="tab" name="entry">
<!-- 遮罩层 --> <!-- 遮罩层 -->
@ -99,11 +98,8 @@
<FormItem label="公司电话" prop="companyPhone"> <FormItem label="公司电话" prop="companyPhone">
<Input v-model="shopForm.companyPhone" clearable style="width: 350px" /> <Input v-model="shopForm.companyPhone" clearable style="width: 350px" />
</FormItem> </FormItem>
<FormItem label="公司所在地" > <FormItem label="公司所在地" prop="companyAddressIdPath">
<Input v-model="shopForm.companyAddressPath" disabled style="width: 260px" v-if="showRegion == false" /> <region style="width: 350px" @selected="selectedRegion" :addressId="address" />
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary" icon="ios-create-outline" style="margin-left: 8px">
</Button>
<region style="width: 350px" @selected="selectedRegion" v-if="showRegion == true" />
</FormItem> </FormItem>
<FormItem label="公司详细地址" prop="companyAddress"> <FormItem label="公司详细地址" prop="companyAddress">
<Input v-model="shopForm.companyAddress" clearable style="width: 350px" /> <Input v-model="shopForm.companyAddress" clearable style="width: 350px" />
@ -145,11 +141,10 @@
<FormItem label="法人证件号" prop="legalId"> <FormItem label="法人证件号" prop="legalId">
<Input v-model="shopForm.legalId" clearable style="width: 200px" /> <Input v-model="shopForm.legalId" clearable style="width: 200px" />
</FormItem> </FormItem>
<FormItem label="法人身份证照片" ref="legalPhoto"> <FormItem label="法人身份证照片" prop="legalPhoto">
<Avatar style="height: 100px;width: 100px" v-if="shopForm.legalPhoto" shape="square" icon="ios-person" size="default" :src="shopForm.legalPhoto" /> <Avatar class="legal-photo" shape="square" size="100" icon="md-add" @click.native="handleCLickImg('legalPhoto', 0)" :src="shopForm.legalPhoto[0]" />
<div> <Avatar class="ml_10 legal-photo" shape="square" size="100" icon="md-add" @click.native="handleCLickImg('legalPhoto', 1)" :src="shopForm.legalPhoto[1]" />
<Button @click="handleCLickImg('legalPhoto')" type="primary">选择图片</Button> <span>点击图片上传身份证正反面要求身份证清晰四角无缺漏</span>
</div>
</FormItem> </FormItem>
<Divider orientation="left">结算银行信息</Divider> <Divider orientation="left">结算银行信息</Divider>
@ -259,6 +254,8 @@ export default {
isRead: false, // isRead: false, //
selectedFormBtnName: "", // form selectedFormBtnName: "", // form
picModalFlag: false, // picModalFlag: false, //
address: '', //
returnAddress: '', // 退
memberModalFlag: false, // memberModalFlag: false, //
settlementShow: false, // settlementShow: false, //
addSettlementConfirmBtn: false, // addSettlementConfirmBtn: false, //
@ -299,6 +296,9 @@ export default {
message: "员工总数不能为空", message: "员工总数不能为空",
trigger: "blur", trigger: "blur",
}, },
],
companyAddressIdPath: [
{ required: true, message: "请选择公司地址", },
], ],
registeredCapital: [ registeredCapital: [
{ {
@ -348,6 +348,7 @@ export default {
settlementBankJointName: [ settlementBankJointName: [
{ required: true, message: "支行联行号不能为空", }, { required: true, message: "支行联行号不能为空", },
], ],
salesConsigneeMobile: [ salesConsigneeMobile: [
{ {
type: "string", type: "string",
@ -360,16 +361,17 @@ export default {
indeterminate: true, // indeterminate: true, //
checkAll: false, // checkAll: false, //
checkAllGroup: [], // checkAllGroup: [], //
showRegion: false, //
submitLoading: false, // submitLoading: false, //
settlementCycle: [], // settlementCycle: [], //
shopForm: { // shopForm: { //
settlementCycle: "", settlementCycle: "",
selfOperated: "", selfOperated: false,
memberName: "", memberName: "",
companyName: "", companyName: "",
addressPath: "", addressPath: "",
addressIdPath: "", addressIdPath: "",
companyAddressPath: "",
companyAddressIdPath: "",
companyAddress: "", companyAddress: "",
companyEmail: "", companyEmail: "",
employeeNum: 1, employeeNum: 1,
@ -381,7 +383,7 @@ export default {
licencePhoto: "", licencePhoto: "",
legalName: "", legalName: "",
legalId: "", legalId: "",
legalPhoto: "", legalPhoto: ['', ''],
companyPhone: "", companyPhone: "",
settlementBankAccountName: "", settlementBankAccountName: "",
settlementBankAccountNum: "", settlementBankAccountNum: "",
@ -396,6 +398,7 @@ export default {
categories: [], // categories: [], //
infoResult: {}, // infoResult: {}, //
picIndex: '', // 便
}; };
}, },
methods: { methods: {
@ -455,26 +458,40 @@ export default {
this.day = 1; this.day = 1;
}, },
// //
selectedRegion(val) { selectedRegion(val) {
this.$set(this.shopForm, "companyAddressIdPath", val[0]); this.$set(this.shopForm, 'companyAddressIdPath', val[0].toString());
this.$set(this.shopForm, "companyAddressPath", val[1]); this.$set(
this.shopForm,
'companyAddressPath',
val[1].toString().replace(/\s/g, '')
);
}, },
// // 退
selectedConsigneeRegion(val) { selectedConsigneeRegion(val) {
this.shopForm.salesConsigneeAddressPath = val[1]; this.$set(this.shopForm, 'salesConsigneeAddressId', val[0].toString());
this.shopForm.salesConsigneeAddressId = val[0]; this.$set(
this.shopForm,
'salesConsigneeAddressPath',
val[1].toString().replace(/\s/g, '')
);
}, },
// modal // modal
handleCLickImg(val) { handleCLickImg(val, index) {
this.$refs.ossManage.selectImage = true; this.$refs.ossManage.selectImage = true;
this.picModalFlag = true; this.picModalFlag = true;
this.selectedFormBtnName = val; this.selectedFormBtnName = val;
this.picIndex = index
}, },
// //
callbackSelected(val) { callbackSelected(val) {
this.picModalFlag = false; this.picModalFlag = false;
if (this.picIndex===0 || this.picIndex === 1) {
this.shopForm[this.selectedFormBtnName][this.picIndex] = val.url;
} else {
this.shopForm[this.selectedFormBtnName] = val.url; this.shopForm[this.selectedFormBtnName] = val.url;
}
this.picIndex = ''
}, },
// //
init() { init() {
@ -491,18 +508,23 @@ export default {
let index = this.tabNameList.indexOf(this.tabName) - 1 let index = this.tabNameList.indexOf(this.tabName) - 1
this.tabName = this.tabNameList[index] this.tabName = this.tabNameList[index]
}, },
formValidate (prop, status, error) { //
console.log(prop, status, error);
},
// //
getShopDetail() { getShopDetail() {
shopDetail(this.shopId).then((res) => { shopDetail(this.shopId).then((res) => {
if (res.result) { if (res.success) {
this.infoResult = res.result; this.infoResult = res.result;
this.shopForm = res.result; this.shopForm = res.result;
console.warn(this.shopForm);
this.checkAllGroup = this.shopForm.goodsManagementCategory.split(","); this.checkAllGroup = this.shopForm.goodsManagementCategory.split(",");
if (this.shopForm.settlementCycle != "") if (this.shopForm.settlementCycle) {
this.shopForm.settlementCycle.split(",").forEach((e) => { this.settlementCycle = this.shopForm.settlementCycle.split(',')
this.settlementCycle.push(e); }
}); this.shopForm.legalPhoto = this.shopForm.legalPhoto.split(',')
this.address = this.shopForm.companyAddressIdPath;
this.returnAddress = this.shopForm.salesConsigneeAddressId;
} }
}); });
}, },
@ -514,23 +536,20 @@ export default {
this.$Message.error("请确认当前所填结算日信息"); this.$Message.error("请确认当前所填结算日信息");
return; return;
} }
if (valid) {
// //
if (this.checkAllGroup == "") { if (this.checkAllGroup == "") {
this.$Message.error("请选择店铺经营类目"); this.$Message.error("请选择店铺经营类目");
this.tabName = 'cagetory'
return; return;
} }
// if (valid) {
if (this.shopForm.companyAddressPath == "") { const params = JSON.parse(JSON.stringify(this.shopForm))
this.$Message.error("请选择公司所在地"); //
return; params.goodsManagementCategory = this.checkAllGroup;
} params.settlementCycle = this.settlementCycle;
//
this.shopForm.goodsManagementCategory = this.checkAllGroup;
this.shopForm.settlementCycle = this.settlementCycle;
if (this.shopId) { if (this.shopId) {
delete this.shopForm.memberId; delete params.memberId;
shopEdit(this.shopId, this.shopForm).then((res) => { shopEdit(this.shopId, params).then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("编辑成功"); this.$Message.success("编辑成功");
this.$router.push({ name: "shopList" }); this.$router.push({ name: "shopList" });
@ -538,11 +557,11 @@ export default {
}); });
} else { } else {
// //
if (this.shopForm.memberName == "") { if (params.memberName == "") {
this.$Message.error("请选择开店的会员"); this.$Message.error("请选择开店的会员");
return; return;
} }
shopAdd(this.shopForm).then((resp) => { shopAdd(params).then((resp) => {
if (resp.success) { if (resp.success) {
this.$Message.success("添加成功"); this.$Message.success("添加成功");
this.shopForm = {}; this.shopForm = {};
@ -553,7 +572,7 @@ export default {
} }
}); });
}, },
// //
getAddress(item) { getAddress(item) {
this.shopForm.storeCenter = item.position.lat + "," + item.position.lng; this.shopForm.storeCenter = item.position.lat + "," + item.position.lng;
this.$set(this.shopForm, "storeAddressPath", item.addr); this.$set(this.shopForm, "storeAddressPath", item.addr);
@ -678,4 +697,9 @@ export default {
margin: 0 4px; margin: 0 4px;
} }
} }
.legal-photo{
width: 100px;
height: 100px;
cursor: pointer;
}
</style> </style>

View File

@ -505,7 +505,6 @@ export default {
* @value 参数选项值 * @value 参数选项值
*/ */
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) { selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
debugger
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) { if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
this.baseInfoForm.goodsParamsDTOList[groupIndex] = { this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId: '', groupId: '',