refactor: 移动端升级 Vue3 + uView Plus

将 lilishop-uniapp 从 Vue2/uView 1.6 迁移到 Vue3/uview-plus,优先支持 H5/微商城与微信小程序;移除 vendored uview-ui,改用 npm 依赖、Vuex4 与迁移脚本/补丁,并补充 VUE3_MIGRATION.md 回归清单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pikachu1995@126.com
2026-06-30 18:50:38 +08:00
parent c290c7a329
commit dc2bef455a
299 changed files with 5507 additions and 43811 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="add-address">
<div class="uForm">
<u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules">
<u-form :border-bottom="false" :model="form" ref="uForm" error-type="toast" :rules="rules">
<!-- #ifndef H5 -->
<view class="selectAddress" @click="clickUniMap">
选择收货地址
@@ -25,9 +25,7 @@
<u-form-item label="地址别名" label-width="130">
<u-input v-model="form.alias" placeholder="请输入地址别名" />
</u-form-item>
<u-checkbox-group shape="circle" size="30">
<u-checkbox :active-color="lightColor" v-model="form.isDefault">设为默认地址</u-checkbox>
</u-checkbox-group>
<u-checkbox usedAlone shape="circle" size="30" :active-color="lightColor" v-model:checked="form.isDefault" label="设为默认地址"></u-checkbox>
<div class="saveBtn" @click="save">保存</div>
</u-form>
@@ -144,33 +142,43 @@ export default {
// 保存当前 地址
save() {
this.$refs.uForm.validate((valid) => {
if (valid) {
let pages = getCurrentPages(); //获取页面栈
let beforePage = pages[pages.length - 2]; //上个页面
this.$refs.uForm.validate().then(() => {
const params = { ...this.form };
delete params.___path;
// 如果没有id则为新增地址
if (!this.form.id) {
// 删除没有的数据
delete this.form.___path;
addAddress(this.form).then((res) => {
if (res.data.success) {
uni.navigateBack();
}
});
} else {
// 修改地址
delete this.form.___path;
delete this.form.updateBy;
delete this.form.updateTime;
editAddress(this.form).then((res) => {
if (res.data.success) {
uni.navigateBack();
}
});
}
if (Array.isArray(params.consigneeAddressIdPath)) {
params.consigneeAddressIdPath = params.consigneeAddressIdPath.join(",");
}
});
if (Array.isArray(params.consigneeAddressPath)) {
params.consigneeAddressPath = params.consigneeAddressPath.join(",");
}
if (!params.id) {
addAddress(params).then((res) => {
if (res.data.success) {
uni.navigateBack();
} else {
uni.showToast({
title: res.data.message || "保存失败",
icon: "none",
});
}
});
} else {
delete params.updateBy;
delete params.updateTime;
editAddress(params).then((res) => {
if (res.data.success) {
uni.navigateBack();
} else {
uni.showToast({
title: res.data.message || "保存失败",
icon: "none",
});
}
});
}
}).catch(() => {});
},
// 三级地址联动回调
@@ -277,7 +285,7 @@ export default {
getAddressDetail(option.id).then((res) => {
const params = res.data.result;
params.___path = params.consigneeAddressPath;
this.$set(this, "form", params);
this["form"] = params;
if (this.$store.state.isShowToast){ uni.hideLoading() };
});

View File

@@ -119,14 +119,22 @@
background: $light-color;
position: fixed;
width: 690rpx;
bottom: 60rpx;
bottom: calc(60rpx + constant(safe-area-inset-bottom));
bottom: calc(60rpx + env(safe-area-inset-bottom));
height: 80rpx;
left: 30rpx;
font-size: 30rpx;
line-height: 80rpx;
.u-icon {
margin-right: 10rpx;
color: #fff;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 99;
overflow: hidden;
.btn-text {
margin-left: 12rpx;
line-height: 1;
}
}
}

View File

@@ -34,11 +34,11 @@
</view>
<view style="height: 100px"></view>
</view>
<button type="default" class="btn" @click="addAddress('')">
<u-icon name="plus-circle"></u-icon>
添加新收货人
</button>
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
<view class="btn" @click="addAddress('')">
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
<text class="btn-text">添加新收货人</text>
</view>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>

View File

@@ -34,12 +34,12 @@
<view style="height: 100px"></view>
</view>
<button type="default" class="btn" @click="addAddress('')">
<u-icon name="plus-circle"></u-icon>
添加新收货人
</button>
<view class="btn" @click="addAddress('')">
<u-icon name="plus-circle" color="#ffffff" size="18"></u-icon>
<text class="btn-text">添加新收货人</text>
</view>
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>
@@ -86,7 +86,7 @@ export default {
* 进入页面检测当前账户是否登录
*/
onShow() {
if (this.$options.filters.tipsToLogin()) {
if (this.tipsToLogin()) {
this.getAddressList();
}
},

View File

@@ -16,7 +16,7 @@
</view>
<view style="height: 100px"></view>
</view>
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
<u-action-sheet :list="removeList" :tips="tips" v-model:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>