refactor:项目升级Vue3+uView Plus

- 改造入口文件、全量替换组件引入
- 过滤器迁移混入,更新忽略配置,新增迁移文档
This commit is contained in:
lifenlong
2026-06-06 22:51:10 +08:00
parent d5663cfb4d
commit f4337fd030
269 changed files with 1956 additions and 42350 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="wrapper">
<u-popup class="popup" v-model="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()">
<u-popup class="popup" v-model:show="buyMask" :height="setup.height" closeable :mode="setup.mode" :border-radius="setup.radius" @close="closeMask()">
<!-- 商品 -->
<view class="goods-box bottom">
<view class="goods-header">
@@ -12,8 +12,8 @@
<view class="goods-price" v-if="goodsDetail.promotionPrice && ((isGroup && buyType === 'PINTUAN') || !isGroup)">
<span v-if="goodsDetail.promotionPrice && !pointDetail">
<span class="goods-price-promotionShow goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[0] }}</span>
.{{ $options.filters.goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
<span class="goods-price-promotionShow goods-price-bigshow">{{ goodsFormatPrice(goodsDetail.promotionPrice)[0] }}</span>
.{{ goodsFormatPrice(goodsDetail.promotionPrice)[1] }}
</span>
<span v-if="pointDetail.points">
<span class="goods-price-promotionShow goods-price-bigshow">{{ pointDetail.points }}</span>
@@ -21,8 +21,8 @@
</span>
<div class="promotion-box">
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
<span class="goods-price-bigshow">{{ goodsFormatPrice(goodsDetail.price)[0] }}</span>
.{{ goodsFormatPrice(goodsDetail.price)[1] }}
</div>
</view>
<!-- 正常商品的价格 -->
@@ -32,8 +32,8 @@
<div class="goods-price" v-for="(item, index) in wholesaleList" :key="index">
<span>
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>
.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
<span class="goods-price-bigshow">{{ goodsFormatPrice(item.price)[0] }}</span>
.{{ goodsFormatPrice(item.price)[1] }}
</span>
<span class="wholesale-item">{{ item.num }}{{ goodsDetail.goodsUnit }}</span>
</div>
@@ -41,8 +41,8 @@
<div class="goods-price" v-else>
<span>
<span class="goods-price-bigshow">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>
.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
<span class="goods-price-bigshow">{{ goodsFormatPrice(goodsDetail.price)[0] }}</span>
.{{ goodsFormatPrice(goodsDetail.price)[1] }}
</span>
</div>
</view>
@@ -261,7 +261,7 @@ export default {
}
});
if (selectedSkuId?.skuId) {
this.$set(this.currentSelected, index, specValue.value);
this.currentSelected[index] = specValue.value;
this.selectSkuList = {
spec: {
specName: val.name,

View File

@@ -1,7 +1,7 @@
<template>
<div class="index">
<u-modal v-model="show" :show-title="false" :show-confirm-button="false" mask-close-able>
<u-modal v-model:show="show" :show-title="false" :show-confirm-button="false" mask-close-able>
<view class="slot-content">
<image @click="downLoad()" class="img" :src="imgUrl" />
<div class="canvas-hide">

View File

@@ -208,7 +208,7 @@ export default {
this.tabCurrentIndex++;
// 当前距离重新为最上面
this.$set(this,'scrollTop',0)
this['scrollTop'] = 0
}
} catch (error) {
uni.hideLoading();

View File

@@ -10,7 +10,7 @@
height="330rpx"
mode="aspectFit"
>
<u-loading slot="loading"></u-loading>
<template #loading><u-loading></u-loading></template>
</u-image>
</view>
<view class="goods-detail">
@@ -23,9 +23,9 @@
<div class="price" v-if="item.price != undefined">
¥<span
>{{
$options.filters.goodsFormatPrice(item.price)[0]
goodsFormatPrice(item.price)[0]
}} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
>.{{ goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="count-config" @click="navigateToDetailPage(item)">
@@ -67,7 +67,7 @@
mode="aspectFit"
:src="item.goodsImage || item.thumbnail"
>
<u-loading slot="loading"></u-loading>
<template #loading><u-loading></u-loading></template>
</u-image>
</div>
<div class="goods-detail">
@@ -77,8 +77,8 @@
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price != undefined">
¥<span
>{{ $options.filters.goodsFormatPrice(item.price)[0] }} </span
>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
>{{ goodsFormatPrice(item.price)[0] }} </span
>.{{ goodsFormatPrice(item.price)[1] }}
</div>
</view>
<div class="promotion" @click="navigateToDetailPage(item)">

View File

@@ -5,7 +5,7 @@
<view v-for="(item, index) in res" :key="index" class="goods-item">
<view class="image-wrapper" @click="navigateToDetailPage(item)">
<u-image :src="item.thumbnail" width="100%" height='330rpx' mode="aspectFit">
<u-loading slot="loading"></u-loading>
<template #loading><u-loading></u-loading></template>
</u-image>
</view>
<view class="goods-detail">
@@ -15,8 +15,8 @@
</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.price )[1]
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1]
}}
</div>
</view>
@@ -53,15 +53,15 @@
<div class="flex goods-col">
<div class="goods-img" @click="navigateToDetailPage(item)">
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.thumbnail">
<u-loading slot="loading"></u-loading>
<template #loading><u-loading></u-loading></template>
</u-image>
</div>
<div class="goods-detail">
<div class="title clamp3" @click="navigateToDetailPage(item)">{{ item.goodsName }}</div>
<view class="price-box" @click="navigateToDetailPage(item)">
<div class="price" v-if="item.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.price )[1]
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1]
}}
</div>
</view>

View File

@@ -4,7 +4,7 @@
<div class="flex goods-col">
<div class="goods-img">
<u-image width="230rpx" mode="aspectFit" border-radius='16' height="230rpx" :src="item.goodsImage || item.thumbnail">
<u-loading slot="loading"></u-loading>
<template #loading><u-loading></u-loading></template>
</u-image>
</div>
<div class="goods-detail">
@@ -13,15 +13,15 @@
<view class="price-box">
<!-- 秒杀 / 拼团 -->
<div class="price" v-if="!type && item.price!=undefined">
¥<span>{{ $options.filters.goodsFormatPrice(item.price )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.price )[1]
¥<span>{{ goodsFormatPrice(item.price )[0] }} </span>.{{
goodsFormatPrice(item.price )[1]
}}
</div>
<!-- 砍价 -->
<div class="price" v-if="type && item.purchasePrice!=undefined">
最低
¥<span>{{ $options.filters.goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
$options.filters.goodsFormatPrice(item.purchasePrice )[1]
¥<span>{{ goodsFormatPrice(item.purchasePrice )[0] }} </span>.{{
goodsFormatPrice(item.purchasePrice )[1]
}}
</div>
<!-- 兜底策略如果金额是0 -->

View File

@@ -1,6 +1,6 @@
<template>
<!-- 遮罩层 -->
<u-popup @close="close" v-model="show" mode="bottom" border-radius="30" height="260rpx">
<u-popup @close="close" v-model:show="show" mode="bottom" border-radius="30" height="260rpx">
<view class="share-title">
<span>分享至</span>
@@ -31,7 +31,8 @@
<script>
import { h5Copy } from "@/js_sdk/h5-copy/h5-copy.js";
import configs from "@/config/config";
import mpShare from "uview-ui/libs/mixin/mpShare.js";
import mpShare from "@/utils/mpShare.js";
import { setClipboard } from "@/utils/filters.js";
export default {
mixins: [mpShare],
@@ -83,7 +84,7 @@ export default {
this.configs.shareLink +
getCurrentPages()[getCurrentPages().length - 1].__page__.fullPath;
}
this.$options.filters.setClipboard(content)
setClipboard(content)
},
// #endif

View File

@@ -1,6 +1,6 @@
<template>
<div>
<u-popup v-model="show" mode="bottom" height="800rpx" border-radius="14">
<u-popup v-model:show="show" mode="bottom" height="800rpx" border-radius="14">
<div class="wrapper">
<view class="down-goods-tips">该商品已下架</view>
<scroll-view scroll-y="true" style="height: 670rpx">

View File

@@ -31,7 +31,7 @@
:class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]"
>
<view :style="{ borderColor: boxActiveColor }" class="xt__middle-line" v-if="type === 'middle' && !code[index]"></view>
<text class="xt__code-text">{{ code[index] | codeFormat(isPassword) }}</text>
<text class="xt__code-text">{{ codeFormat(code[index], isPassword) }}</text>
</view>
</template>
</view>
@@ -178,14 +178,7 @@ export default {
// 输入失去焦点
inputBlur() {
this.cursorVisible = false;
}
},
watch: {
value(val) {
this.code = val;
}
},
filters: {
},
codeFormat(val, isPassword) {
let value = '';
if (val) {
@@ -193,6 +186,11 @@ export default {
}
return value;
}
},
watch: {
value(val) {
this.code = val;
}
}
};
</script>