mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-08-06 19:07:23 +08:00
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:
@@ -12,7 +12,7 @@
|
||||
<view class="section-info">
|
||||
<u-avatar mode="circle" size="60" class="portrait" :src="commItem.memberProfile"></u-avatar>
|
||||
<view class="star-con">
|
||||
<text class="name">{{ commItem.memberName | noPassByName }}</text>
|
||||
<text class="name">{{noPassByName(commItem.memberName) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section-contant">
|
||||
@@ -38,7 +38,7 @@
|
||||
</view>
|
||||
<!-- 查看全部评价按钮 -->
|
||||
<view v-if="commDetail && commDetail.records && commDetail.records.length > 0" class="eva-section-btn" @click="toComment(goodsDetail.goodsId, goodsDetail.grade)">
|
||||
<text>查看全部评价</text>
|
||||
<text class="btn-text">查看全部评价</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
margin: 2px 0 20rpx 0;
|
||||
background: #fff;
|
||||
|
||||
text {
|
||||
.btn-text {
|
||||
width: 200rpx;
|
||||
height: 50rpx;
|
||||
font-size: 22rpx;
|
||||
@@ -207,7 +207,7 @@ export default {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
> view > text {
|
||||
> .star-con > .name {
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
<u-parse
|
||||
class="vhtml"
|
||||
:lazy-load="true"
|
||||
:use-cache="true"
|
||||
:show-with-animation="true"
|
||||
:html="res.mobileIntro"
|
||||
:content="res.mobileIntro"
|
||||
:tag-style="style"
|
||||
></u-parse>
|
||||
</view>
|
||||
@@ -57,7 +55,7 @@ export default {
|
||||
return {
|
||||
goodsDetail: "",
|
||||
style: {
|
||||
img:"display:block"
|
||||
img:"display:block;width:100%"
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -116,15 +114,6 @@ export default {
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
.vhtml {
|
||||
::v-deep img {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep img {
|
||||
width: 100%;
|
||||
}
|
||||
.goods-detail-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- 轮播图 -->
|
||||
<view class="carousel">
|
||||
|
||||
<swiper circular="true" duration="400" @change="swiperChange">
|
||||
<swiper class="goods-swiper" circular="true" duration="400" @change="swiperChange">
|
||||
<swiper-item v-if='video'>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<video class="video" show-mute-btn style="width:100%; height:100%;" muted autoplay :src='video' loop
|
||||
@@ -20,9 +20,7 @@
|
||||
<swiper-item class="swiper-item" v-for="(item, index) in res" :key="index">
|
||||
|
||||
<view class="image-wrapper">
|
||||
<u-image :src="item" mode="aspectFit" class="loaded" width="100%" height="100%">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
</u-image>
|
||||
<image class="swiper-img" :src="item" mode="aspectFit"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
@@ -63,7 +61,7 @@ export default {
|
||||
height: 750rpx;
|
||||
position: relative;
|
||||
|
||||
swiper {
|
||||
.goods-swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -72,17 +70,17 @@ export default {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.swiper-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
height: 750rpx;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
position: relative;
|
||||
@@ -104,7 +102,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .image-wrapper image {
|
||||
::v-deep .image-wrapper .u-image__image {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<u-popup class="popup" v-model="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable>
|
||||
<u-popup class="popup" :show="addressFlag" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius" @close="closeAddress()" closeable>
|
||||
<view class="header-title">选择地址</view>
|
||||
<view class="view-box" v-if="addressDetail">
|
||||
<view class="view-item" v-for="(item, index) in addressDetail" :key="index" @click="clickAddress(item)">
|
||||
@@ -8,7 +8,7 @@
|
||||
<u-icon v-if="item.isDefault" :class="{ active: item.isDefault }" name="checkmark" size="12"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="view-box-dress" :class="{ 'box-dress-blod': item.isDefault }">{{ item.consigneeAddressPath | clearStrComma }}</view>
|
||||
<view class="view-box-dress" :class="{ 'box-dress-blod': item.isDefault }">{{clearStrComma(item.consigneeAddressPath) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="view-box" v-else>
|
||||
@@ -46,21 +46,17 @@ export default {
|
||||
],
|
||||
};
|
||||
},
|
||||
filters: {},
|
||||
watch: {},
|
||||
props: ["goodsId", "addressFlag"],
|
||||
|
||||
mounted() {
|
||||
this.addressFlag = false;
|
||||
if( this.$options.filters.isLogin("auth") ){
|
||||
this.getShippingAddress()
|
||||
}
|
||||
else{
|
||||
if (this.isLogin("auth")) {
|
||||
this.getShippingAddress();
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: 'pages/passport/login'
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
props: ["goodsId", "addressFlag"],
|
||||
|
||||
methods: {
|
||||
/**关闭地址 */
|
||||
@@ -70,7 +66,6 @@ export default {
|
||||
},
|
||||
|
||||
getpicker() {
|
||||
// this.$refs.cityPicker.show();
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/address/add",
|
||||
});
|
||||
@@ -79,7 +74,7 @@ export default {
|
||||
|
||||
/**获取地址 */
|
||||
getShippingAddress() {
|
||||
if (this.$options.filters.isLogin("auth")) {
|
||||
if (this.isLogin("auth")) {
|
||||
API_Address.getAddressList(1, 50).then((res) => {
|
||||
if (res.data.success) {
|
||||
this.addressDetail = res.data.result.records;
|
||||
@@ -91,10 +86,6 @@ export default {
|
||||
this.checked = addr[0];
|
||||
this.$emit("deliveryData", this.checked);
|
||||
}
|
||||
// addr[0] ? "" : (addr = res.data);
|
||||
|
||||
// /**获取默认地址是否有货 */
|
||||
// this.clickAddress(addr[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
||||
<view class="group-item-user">
|
||||
<u-image shape="circle" width="40px" height="40px" :src="order.face || userImage"></u-image>
|
||||
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
||||
<span class="group-item-name">{{noPassByName(order.nickName) }}</span>
|
||||
</view>
|
||||
<view>
|
||||
<span class="group-item-name">还差{{ order.toBeGroupedNum }}人成团</span>
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
>
|
||||
¥
|
||||
<span class="flex-price">
|
||||
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.promotionPrice)[1]
|
||||
{{ goodsFormatPrice(detail.promotionPrice)[0] }}.{{
|
||||
goodsFormatPrice(detail.promotionPrice)[1]
|
||||
}}</span
|
||||
>
|
||||
</span>
|
||||
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||
<span class="old-price"
|
||||
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||
>¥{{ goodsFormatPrice(detail.price)[0] }}.{{
|
||||
goodsFormatPrice(detail.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">限时抢购</view>
|
||||
@@ -42,8 +42,8 @@
|
||||
<span
|
||||
class="flex-price"
|
||||
v-if="promotion.groupbuy_goods_vo.price != undefined"
|
||||
>¥{{ $options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
|
||||
>¥{{ goodsFormatPrice(promotion.groupbuy_goods_vo.price)[0] }}.{{
|
||||
goodsFormatPrice(promotion.groupbuy_goods_vo.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<!-- <span v-if="promotion.point">+{{promotion.point}}积分</span> -->
|
||||
@@ -53,9 +53,9 @@
|
||||
class="old-price"
|
||||
v-if="promotion.groupbuy_goods_vo.original_price != undefined"
|
||||
>¥{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
|
||||
goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[0]
|
||||
}}.{{
|
||||
$options.filters.goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
|
||||
goodsFormatPrice(promotion.groupbuy_goods_vo.original_price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">团购活动</view>
|
||||
@@ -68,13 +68,13 @@
|
||||
v-if="detail.promotionPrice != undefined"
|
||||
>
|
||||
¥<span class="flex-price">
|
||||
{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[0] }}.</span
|
||||
>{{ $options.filters.goodsFormatPrice(detail.promotionPrice)[1] }}
|
||||
{{ goodsFormatPrice(detail.promotionPrice)[0] }}.</span
|
||||
>{{ goodsFormatPrice(detail.promotionPrice)[1] }}
|
||||
</span>
|
||||
<view class="u-group-flex" v-if="detail.price != undefined">
|
||||
<span class="old-price"
|
||||
>¥{{ $options.filters.goodsFormatPrice(detail.price)[0] }}.{{
|
||||
$options.filters.goodsFormatPrice(detail.price)[1]
|
||||
>¥{{ goodsFormatPrice(detail.price)[0] }}.{{
|
||||
goodsFormatPrice(detail.price)[1]
|
||||
}}</span
|
||||
>
|
||||
<view class="promotion">拼团活动</view>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<view class="coupon-item">
|
||||
<view class="top">
|
||||
<div class="price">
|
||||
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||
<span v-if="item.couponType == 'PRICE'">¥{{ item.price | unitPrice }}</span>
|
||||
<span class="price-num" v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</span>
|
||||
<span class="price-num" v-if="item.couponType == 'PRICE'">¥{{unitPrice(item.price) }}</span>
|
||||
</div>
|
||||
<view class="text">
|
||||
<div class="coupon-List-title">
|
||||
@@ -18,16 +18,16 @@
|
||||
}}使用</view>
|
||||
</view>
|
||||
</div>
|
||||
<div>满{{ item.consumeThreshold | unitPrice }}可用</div>
|
||||
<div>满{{unitPrice(item.consumeThreshold) }}可用</div>
|
||||
</view>
|
||||
<view class="lingqu-btn" @click="getCoupon(item, index)">
|
||||
<div :class="yhqFlag[index] ? 'cur' : ''">
|
||||
<div class="lingqu-text" :class="yhqFlag[index] ? 'cur' : ''">
|
||||
{{ yhqFlag[index] ? "已领取或领完" : "立即领取" }}
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="time">{{ item.startTime / 1000 | unixToDate }} - {{ item.endTime / 1000 | unixToDate }}</view>
|
||||
<view class="time">{{ item.startTime /unixToDate(1000) }} - {{ item.endTime /unixToDate(1000) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -139,7 +139,7 @@
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
.price-num {
|
||||
font-size: 50rpx;
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@
|
||||
align-items: center;
|
||||
margin-left: 40rpx;
|
||||
|
||||
text {
|
||||
.lingqu-text {
|
||||
width: 140rpx;
|
||||
height: 40rpx;
|
||||
text-align: center;
|
||||
|
||||
@@ -116,9 +116,7 @@ export default {
|
||||
text-align: left;
|
||||
color: #333333;
|
||||
margin-left: 20rpx;
|
||||
> span {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
word-spacing: 15rpx;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</view>
|
||||
<view class="to-store-btn" @click="tostorePage(goodsDetail)">
|
||||
<view>进店逛逛</view>
|
||||
<view class="to-store-text">进店逛逛</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
<view class="recommend-list">
|
||||
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
|
||||
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.thumbnail" height="218rpx">
|
||||
<u-loading slot="loading"></u-loading>
|
||||
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
|
||||
<template #loading><u-loading></u-loading></template>
|
||||
<template #error><view style="font-size: 24rpx; ">加载失败</view></template>
|
||||
</u-image>
|
||||
<view class="recommend-item-name">
|
||||
{{ item.goodsName }}
|
||||
</view>
|
||||
<view class="item-price" v-if="item.price != undefined">
|
||||
¥<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
|
||||
¥<span class="item-price-blod">{{ goodsFormatPrice(item.price)[0] }}</span>.{{ goodsFormatPrice(item.price)[1] }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -122,11 +122,6 @@ export default {
|
||||
.logo {
|
||||
overflow: hidden;
|
||||
border-radius: 6px;
|
||||
|
||||
> img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.name-star {
|
||||
@@ -144,9 +139,6 @@ export default {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-left: 10px;
|
||||
text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +146,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
> view {
|
||||
> .to-store-text {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
width: 160rpx;
|
||||
@@ -171,18 +163,6 @@ export default {
|
||||
.star-con {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.star {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
background: url(https://image.shutterstock.com/image-vector/star-icon-vector-illustration-260nw-474687040.jpg);
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.recommend-list {
|
||||
@@ -230,8 +210,10 @@ export default {
|
||||
}
|
||||
.store-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 10rpx 0;
|
||||
> div {
|
||||
> .collectionNum,
|
||||
> .goodsNum {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ page {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
font-size: 22rpx;
|
||||
font-size: 20rpx;
|
||||
color: #262626;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -256,7 +256,8 @@ page {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
> .icon-btn-name {
|
||||
margin: 4rpx 0;
|
||||
margin-top: 2rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user