mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-06-24 02:40:13 +08:00
refactor:项目升级Vue3+uView Plus
- 改造入口文件、全量替换组件引入 - 过滤器迁移混入,更新忽略配置,新增迁移文档
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<u-navbar :border-bottom="false"></u-navbar>
|
||||
<u-navbar :border="false"></u-navbar>
|
||||
<step1 v-if="current == 1" :companyData="companyData" @callback="next()" />
|
||||
<step2 v-if="current == 2" :companyData="companyData" @callback="next()" />
|
||||
<step3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<u-navbar :border-bottom="false"></u-navbar>
|
||||
<u-navbar :border="false"></u-navbar>
|
||||
<div>
|
||||
<div class="title">店铺入驻</div>
|
||||
<div class="step-list">
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if(this.$options.filters.tipsToLogin()){
|
||||
if(this.tipsToLogin()){
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -116,12 +116,10 @@
|
||||
<div>
|
||||
<u-upload
|
||||
:file-list="licencePhotoFileList"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
:action="action"
|
||||
:auto-upload="false"
|
||||
width="200"
|
||||
@on-uploaded="onUploaded($event, 'licencePhoto')"
|
||||
@afterRead="onUploadAfterRead($event, 'licencePhoto', 'licencePhotoFileList')"
|
||||
:max-count="1"
|
||||
:show-progress="false"
|
||||
></u-upload>
|
||||
|
||||
<div class="tips">
|
||||
@@ -155,21 +153,17 @@
|
||||
<div>
|
||||
<u-upload
|
||||
:file-list="legalPhotoFileList"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
:action="action"
|
||||
:auto-upload="false"
|
||||
width="200"
|
||||
@on-uploaded="onUploaded($event, 'legalPhoto')"
|
||||
@afterRead="onUploadAfterRead($event, 'legalPhoto', 'legalPhotoFileList')"
|
||||
:max-count="1"
|
||||
:show-progress="false"
|
||||
></u-upload>
|
||||
<u-upload
|
||||
:file-list="legalPhotoFileList"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
:action="action"
|
||||
:file-list="legalPhotoBackFileList"
|
||||
:auto-upload="false"
|
||||
width="200"
|
||||
@on-uploaded="onUploaded($event, 'legalPhoto')"
|
||||
@afterRead="onUploadAfterRead($event, 'legalPhoto', 'legalPhotoBackFileList')"
|
||||
:max-count="1"
|
||||
:show-progress="false"
|
||||
></u-upload>
|
||||
</div>
|
||||
</u-form-item>
|
||||
@@ -192,20 +186,20 @@
|
||||
import { applyFirst } from "@/api/entry";
|
||||
import city from "@/components/m-city/m-city.vue";
|
||||
import storage from "@/utils/storage.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import { handleUploadAfterRead, getUploadedUrls } from "@/utils/uploadHelper.js";
|
||||
import * as RegExp from "@/utils/RegExp.js";
|
||||
export default {
|
||||
components: { "m-city": city },
|
||||
data() {
|
||||
return {
|
||||
storage,
|
||||
action: upload, //图片上传数据
|
||||
defaultInputStyle: {
|
||||
background: "#f7f7f7",
|
||||
padding: "0 20rpx",
|
||||
"border-radius": "10rpx",
|
||||
},
|
||||
legalPhotoFileList: [],
|
||||
legalPhotoBackFileList: [],
|
||||
licencePhotoFileList: [],
|
||||
form: {
|
||||
companyName: "",
|
||||
@@ -316,7 +310,7 @@ export default {
|
||||
companyData: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.$set(this, "form", val);
|
||||
this["form"] = val;
|
||||
// 给图片赋值
|
||||
const judgeDeepPhoto = ["legalPhoto", "licencePhoto"];
|
||||
judgeDeepPhoto.forEach((key) => {
|
||||
@@ -332,16 +326,20 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 图片上传
|
||||
onUploaded(lists, key) {
|
||||
let images = [];
|
||||
if(!this.form[key]){
|
||||
onUploadAfterRead(event, key, fileListKey) {
|
||||
if (!Array.isArray(this.form[key])) {
|
||||
this.form[key] = [];
|
||||
}
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
handleUploadAfterRead(event, this[fileListKey], () => {
|
||||
if (key === "legalPhoto") {
|
||||
this.form[key] = [
|
||||
...getUploadedUrls(this.legalPhotoFileList),
|
||||
...getUploadedUrls(this.legalPhotoBackFileList),
|
||||
];
|
||||
} else {
|
||||
this.form[key] = getUploadedUrls(this[fileListKey]);
|
||||
}
|
||||
});
|
||||
this.form[key].push(images[0]);
|
||||
},
|
||||
getPickerParentValue(e) {
|
||||
this.form.companyAddressIdPath = [];
|
||||
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
watch: {
|
||||
companyData: {
|
||||
handler(val) {
|
||||
this.$set(this, "form", val);
|
||||
this["form"] = val;
|
||||
console.log(this.form)
|
||||
},
|
||||
deep: true,
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
<div>
|
||||
<u-upload
|
||||
:file-list="storeLogoFileList"
|
||||
:header="{ accessToken: storage.getAccessToken() }"
|
||||
:action="action"
|
||||
:auto-upload="false"
|
||||
width="200"
|
||||
@on-uploaded="onUploaded($event, 'storeLogo')"
|
||||
@afterRead="onUploadAfterRead($event, 'storeLogo', 'storeLogoFileList')"
|
||||
:max-count="1"
|
||||
:show-progress="false"
|
||||
></u-upload>
|
||||
</div>
|
||||
</u-form-item>
|
||||
@@ -101,7 +99,7 @@
|
||||
</m-city>
|
||||
|
||||
<u-select
|
||||
v-model="enableCategory"
|
||||
v-model:show="enableCategory"
|
||||
@confirm="confirmCategory"
|
||||
:list="categoryList"
|
||||
></u-select>
|
||||
@@ -115,7 +113,7 @@ import { applyThird } from "@/api/entry";
|
||||
import { getCategoryList } from "@/api/goods";
|
||||
import city from "@/components/m-city/m-city.vue";
|
||||
import storage from "@/utils/storage.js";
|
||||
import { upload } from "@/api/common.js";
|
||||
import { handleUploadAfterRead } from "@/utils/uploadHelper.js";
|
||||
import uniMap from "@/components/uniMap";
|
||||
import permision from "@/js_sdk/wa-permission/permission.js";
|
||||
export default {
|
||||
@@ -124,7 +122,6 @@ export default {
|
||||
return {
|
||||
storage,
|
||||
mapFlag: false,
|
||||
action: upload, //图片上传数据
|
||||
defaultInputStyle: {
|
||||
background: "#f7f7f7",
|
||||
padding: "0 20rpx",
|
||||
@@ -171,7 +168,7 @@ export default {
|
||||
watch: {
|
||||
companyData: {
|
||||
handler(val) {
|
||||
this.$set(this, "form", val);
|
||||
this["form"] = val;
|
||||
// 给图片赋值
|
||||
const judgeDeepPhoto = ["storeLogo"];
|
||||
|
||||
@@ -282,13 +279,10 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 图片上传
|
||||
onUploaded(lists, key) {
|
||||
let images = [];
|
||||
lists.forEach((item) => {
|
||||
images.push(item.response.result);
|
||||
onUploadAfterRead(event, key, fileListKey) {
|
||||
handleUploadAfterRead(event, this[fileListKey], (urls) => {
|
||||
this.form[key] = urls;
|
||||
});
|
||||
this.form[key] = images;
|
||||
},
|
||||
getPickerParentValue(e) {
|
||||
this.form.storeAddressIdPath = [];
|
||||
@@ -303,7 +297,7 @@ export default {
|
||||
} else {
|
||||
name += item.localName + ",";
|
||||
}
|
||||
this.$set(this.form,'storeAddressPath',name)
|
||||
this.form['storeAddressPath'] = name
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user