chore(package): fix lint caused error

This commit is contained in:
woody 2025-06-04 09:09:18 +08:00
parent 0890b44385
commit 158525544e
3 changed files with 14935 additions and 16406 deletions

30981
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -99,18 +99,18 @@
"@dcloudio/webpack-uni-pages-loader": "^2.0.2-3081220230817001", "@dcloudio/webpack-uni-pages-loader": "^2.0.2-3081220230817001",
"@vue/cli-plugin-babel": "~4.5.13", "@vue/cli-plugin-babel": "~4.5.13",
"@vue/cli-service": "~4.5.13", "@vue/cli-service": "~4.5.13",
"@vue/eslint-config-standard": "^9.0.1", "@vue/eslint-config-standard": "^8.0.1",
"babel-plugin-import": "^1.11.0", "babel-plugin-import": "^1.11.0",
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"eslint": "^9.27.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^10.1.5", "eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^10.1.0", "eslint-plugin-vue": "^9.27.0",
"jest": "^25.4.0", "jest": "^25.4.0",
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"postcss-comment": "^2.0.0", "postcss-comment": "^2.0.0",
"prettier": "^3.5.3", "prettier": "^2.8.8",
"sass": "^1.67.0", "sass": "^1.67.0",
"sass-loader": "^10.4.1", "sass-loader": "^10.4.1",
"vue-template-compiler": "^2.6.11" "vue-template-compiler": "^2.6.11"

View File

@ -13,20 +13,22 @@
<template> <template>
<view> <view>
<u-picker @cancel='pickershow=false' <u-picker
@cancel="pickershow = false"
:show="pickershow" :show="pickershow"
ref="uPicker" ref="uPicker"
:defaultIndex="defaultIndex" :defaultIndex="defaultIndex"
:columns="columns" :columns="columns"
@confirm="confirm" @confirm="confirm"
keyName='name' keyName="name"
@change="changeHandler"></u-picker> @change="changeHandler"
></u-picker>
</view> </view>
</template> </template>
<script> <script>
import * as api from '@/api/goods' import * as api from '@/api/goods';
export default { export default {
data() { data() {
return { return {
columns: [], columns: [],
@ -38,7 +40,7 @@ export default {
form: {}, form: {},
defaultIndex: [], defaultIndex: [],
user: '', user: '',
} };
}, },
props: { props: {
defaultCode: { defaultCode: {
@ -51,88 +53,96 @@ export default {
deep: true, deep: true,
handler(n) { handler(n) {
if (this.cityList.length > 0) { if (this.cityList.length > 0) {
this.getDefaultIndex(n) this.getDefaultIndex(n);
} else { } else {
this.getAllAreaList(uni.getStorageSync('pkCountry')||this.user.pkSettleCountry).then((res) => { this.getAllAreaList(
uni.getStorageSync('pkCountry') || this.user.pkSettleCountry
).then((res) => {
if (res) { if (res) {
this.getDefaultIndex(n) this.getDefaultIndex(n);
} }
}) });
} }
}, },
}, },
}, },
created() { created() {
this.user = uni.getStorageSync('User') this.user = uni.getStorageSync('User');
this.getAllAreaList(uni.getStorageSync('pkCountry')||this.user.pkSettleCountry) this.getAllAreaList(
uni.getStorageSync('pkCountry') || this.user.pkSettleCountry
);
}, },
methods: { methods: {
getDefaultIndex(arr) { getDefaultIndex(arr) {
let a = this.provinceList.findIndex((item) => item.pkId == arr[0]) const a = this.provinceList.findIndex((item) => item.pkId == arr[0]);
let b = this.cityList[a].arrList.findIndex((item) => item.pkId == arr[1]) const b = this.cityList[a].arrList.findIndex(
let c = this.quList.findIndex((item) => item.pkId == arr[1]) (item) => item.pkId == arr[1]
let d = this.quList[c].arrList.findIndex((item) => item.pkId == arr[2]) );
const c = this.quList.findIndex((item) => item.pkId == arr[1]);
const d = this.quList[c].arrList.findIndex(
(item) => item.pkId == arr[2]
);
this.columns = [ this.columns = [
this.provinceList, this.provinceList,
this.cityList[a].arrList, this.cityList[a].arrList,
this.quList[c].arrList, this.quList[c].arrList,
] ];
let diqu let diqu;
this.defaultIndex = [a, b, d > -1 ? d : 0] this.defaultIndex = [a, b, d > -1 ? d : 0];
if (d > -1) { if (d > -1) {
diqu = `${this.provinceList[a].name}-${this.cityList[a].arrList[b].name}-${this.quList[c].arrList[d].name}` diqu = `${this.provinceList[a].name}-${this.cityList[a].arrList[b].name}-${this.quList[c].arrList[d].name}`;
} else { } else {
diqu = `${this.provinceList[a].name}-${this.cityList[a].arrList[b].name}` diqu = `${this.provinceList[a].name}-${this.cityList[a].arrList[b].name}`;
} }
this.$emit('getAddressData', diqu) this.$emit('getAddressData', diqu);
}, },
setShow() { setShow() {
this.pickershow = true this.pickershow = true;
}, },
getAllAreaList(pkCountry) { getAllAreaList(pkCountry) {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
api api
.getAllAreaList({ .getAllAreaList({
pkCountry: pkCountry, pkCountry,
}) })
.then((res) => { .then((res) => {
this.provinceList = res.data.provinceList this.provinceList = res.data.provinceList;
// //
let cityList = [] const cityList = [];
res.data.provinceList.forEach((element, index) => { res.data.provinceList.forEach((element, index) => {
cityList.push({ cityList.push({
pkId: element.pkId, pkId: element.pkId,
arrList: [], arrList: [],
}) });
res.data.cityList.forEach((item, cndex) => { res.data.cityList.forEach((item, cndex) => {
if (element.pkId == item.parent) { if (element.pkId == item.parent) {
cityList[index].arrList.push(item) cityList[index].arrList.push(item);
} }
}) });
}) });
this.cityList = cityList this.cityList = cityList;
// //
let quList = [] const quList = [];
res.data.cityList.forEach((element, index) => { res.data.cityList.forEach((element, index) => {
quList.push({ quList.push({
pkId: element.pkId, pkId: element.pkId,
arrList: [], arrList: [],
}) });
res.data.countyList.forEach((item, cndex) => { res.data.countyList.forEach((item, cndex) => {
if (element.pkId == item.parent) { if (element.pkId == item.parent) {
quList[index].arrList.push(item) quList[index].arrList.push(item);
} }
}) });
}) });
this.quList = quList this.quList = quList;
this.columns = [ this.columns = [
res.data.provinceList, res.data.provinceList,
cityList[0].arrList, cityList[0].arrList,
quList[0].arrList, quList[0].arrList,
] ];
reslove(true) reslove(true);
}) });
}) });
}, },
changeHandler(e) { changeHandler(e) {
const { const {
@ -143,50 +153,50 @@ export default {
indexs, indexs,
// pickerref // pickerref
picker = this.$refs.uPicker, picker = this.$refs.uPicker,
} = e } = e;
// () // ()
if (columnIndex === 0) { if (columnIndex === 0) {
picker.setColumnValues(1, this.cityList[indexs[0]].arrList) picker.setColumnValues(1, this.cityList[indexs[0]].arrList);
let arr = [] let arr = [];
this.quList.forEach((item) => { this.quList.forEach((item) => {
if (item.pkId == this.cityList[indexs[0]].arrList[0].pkId) { if (item.pkId == this.cityList[indexs[0]].arrList[0].pkId) {
arr = item.arrList arr = item.arrList;
} }
}) });
picker.setColumnValues(2, arr) picker.setColumnValues(2, arr);
// pickerthis // pickerthis
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
let arr = [] let arr = [];
this.quList.forEach((item) => { this.quList.forEach((item) => {
if (item.pkId == this.cityList[indexs[0]].arrList[index].pkId) { if (item.pkId == this.cityList[indexs[0]].arrList[index].pkId) {
arr = item.arrList arr = item.arrList;
} }
}) });
picker.setColumnValues(2, arr) picker.setColumnValues(2, arr);
} }
}, },
// columnIndexvaluevalues // columnIndexvaluevalues
confirm(e) { confirm(e) {
this.pickershow = false this.pickershow = false;
if (e.value[2]) { if (e.value[2]) {
this.diqu = `${e.value[0].name}-${e.value[1].name}-${e.value[2].name}` this.diqu = `${e.value[0].name}-${e.value[1].name}-${e.value[2].name}`;
this.form.province = e.value[0].pkId this.form.province = e.value[0].pkId;
this.form.city = e.value[1].pkId this.form.city = e.value[1].pkId;
this.form.county = e.value[2].pkId this.form.county = e.value[2].pkId;
} else { } else {
this.diqu = `${e.value[0].name}-${e.value[1].name}` this.diqu = `${e.value[0].name}-${e.value[1].name}`;
this.form.province = e.value[0].pkId this.form.province = e.value[0].pkId;
this.form.city = e.value[1].pkId this.form.city = e.value[1].pkId;
this.form.county = '' this.form.county = '';
} }
this.$emit('addressData', this.diqu, this.form) this.$emit('addressData', this.diqu, this.form);
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.picker { .picker {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
@ -195,5 +205,5 @@ export default {
border-style: solid; border-style: solid;
border-radius: 4px; border-radius: 4px;
padding: 6px 9px; padding: 6px 9px;
} }
</style> </style>