feat: 更新项目配置与组件使用

- 在入口文件中引入uview-plus的配置,优化字体加载逻辑
- 移除manifest.json中不必要的权限描述
- 更新package.json和package-lock.json,添加开发依赖
- 调整多个组件的样式和结构,提升用户体验
- 修复部分组件的逻辑和样式问题,确保兼容性
This commit is contained in:
pikachu1995@126.com
2026-06-30 16:02:40 +08:00
parent f4337fd030
commit e871509bf5
87 changed files with 3546 additions and 1506 deletions

View File

@@ -351,9 +351,7 @@ page {
flex-wrap: wrap;
/* height: 140rpx; */
overflow: hidden;
> * {
margin-right: 16rpx;
}
gap: 16rpx;
}
.bot {

View File

@@ -4,7 +4,6 @@
</view>
</template>
<script>
var chat = requirePlugin('myPlugin')
export default {
data() {
return {
@@ -15,6 +14,19 @@
},
onLoad (e) {
// 腾讯云智服客服插件需在 manifest.json 的 mp-weixin.plugins 中注册后方可使用,
// 未注册时 requirePlugin 会抛出 "has not registered any plugins",此处做容错处理。
let chat
try {
chat = requirePlugin('myPlugin')
} catch (err) {
uni.showToast({
title: '客服功能暂未配置',
icon: 'none',
duration: 2000
})
return
}
const params = JSON.parse((decodeURIComponent(e.params)))
chat.init({
sign: params.mpSign, //必传,公司渠道唯一标识,腾讯云智服后台系统创建「小程序插件」渠道后,在「渠道管理」获取

View File

@@ -17,7 +17,7 @@
:y="navbarListY" placement="top-start" />
<view class="index">
<!-- topBar -->
<u-navbar :bg-color="navbar.background" :auto-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
<u-navbar :bg-color="navbar.background" :auto-back="false" @leftClick="back" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
<div class="headerRow">
<div class="backs">
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
@@ -36,7 +36,7 @@
</u-navbar>
<u-navbar :border="false" v-show="!headerFlag" class="header-only-back" :bg-color="navbarOnlyBack.background"
:auto-back="false">
:auto-back="false" @leftClick="back">
<div>
<div class="bg-back">
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
@@ -198,15 +198,15 @@
<view class="page-bottom mp-iphonex-bottom" id="pageBottom">
<view class="icon-btn">
<view class="icon-btn-item" @click="navigateToStore(goodsDetail.storeId)">
<u-icon size="34" class="red" name="home-fill"></u-icon>
<u-icon size="22" class="red" name="home-fill"></u-icon>
<view class="red icon-btn-name">店铺</view>
</view>
<view class="icon-btn-item" @click="linkMsgDetail()">
<u-icon size="34" name="kefu-ermai"></u-icon>
<u-icon size="22" name="kefu-ermai"></u-icon>
<view class="icon-btn-name">客服</view>
</view>
<view class="icon-btn-item" @click="reluchToCart()">
<u-icon size="34" name="storeping-cart"></u-icon>
<u-icon size="22" name="shopping-cart"></u-icon>
<view class="icon-btn-name">购物车</view>
<view v-if="nums && nums > 0" class="num-icon">{{ nums }}</view>
</view>
@@ -574,6 +574,10 @@ export default {
}
/**商品信息以及规格信息存储 */
this.goodsDetail = response.data.result.data;
// 清洗缩略图,避免损坏地址(如 1?x-oss-process=style/400X400触发渲染层 500
if (this.goodsDetail) {
this.goodsDetail.thumbnail = this.parseGoodsImageUrl(this.goodsDetail.thumbnail);
}
this.wholesaleList = response.data.result.wholesaleList;
this.goodsSpec = response.data.result.specs;
this.PromotionList = response.data.result.promotionMap;
@@ -592,8 +596,12 @@ export default {
this.isSeckill = true
}
});
// 轮播图
this.imgList = this.goodsDetail.goodsGalleryList.filter(i => i.indexOf("\"url\":") === -1 && i.indexOf("\"status\":") === -1);
// 轮播图:兼容上传 JSON 与纯 URL解析后去重
const gallery = (this.goodsDetail.goodsGalleryList || [])
.map((i) => this.parseGoodsImageUrl(i, ""))
.filter(Boolean);
this.imgList = [...new Set(gallery)];
// 获取店铺基本信息
this.getStoreBaseInfoFun(this.goodsDetail.storeId);
@@ -740,6 +748,9 @@ export default {
API_store.getStoreBaseInfo(id).then((res) => {
if (res.data.success) {
this.storeDetail = res.data.result;
if (this.storeDetail) {
this.storeDetail.storeLogo = this.parseGoodsImageUrl(this.storeDetail.storeLogo);
}
}
});
},
@@ -780,7 +791,10 @@ export default {
storeId: this.goodsDetail.storeId,
recommend: true,
}).then((res) => {
this.recommendList = res.data.result.records;
this.recommendList = (res.data.result.records || []).map((item) => ({
...item,
thumbnail: this.parseGoodsImageUrl(item.thumbnail),
}));
});
},
@@ -795,7 +809,10 @@ export default {
currentGoodsId: this.goodsDetail.id,
keyword: this.goodsDetail.name
}).then((res) => {
this.likeGoodsList = res.data.result.records;
this.likeGoodsList = (res.data.result.records || []).map((item) => ({
...item,
thumbnail: this.parseGoodsImageUrl(item.thumbnail),
}));
});
},

View File

@@ -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;
}
}

View File

@@ -55,7 +55,7 @@ export default {
return {
goodsDetail: "",
style: {
img:"display:block"
img:"display:block;width:100%"
}
};
},
@@ -114,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;

View File

@@ -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%">
<template #loading><u-loading></u-loading></template>
</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;
}

View File

@@ -1,5 +1,5 @@
<template>
<u-popup class="popup" v-model:show="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)">
@@ -46,19 +46,19 @@ export default {
],
};
},
props: ["goodsId", "addressFlag"],
props: ["goodsId", "addressFlag"],
mounted() {
if (this.isLogin("auth")) {
this.getShippingAddress();
} else {
uni.navigateTo({
url: "/pages/passport/login",
});
}
},
methods: {
mounted() {
this.addressFlag = false;
if( this.isLogin("auth") ){
this.getShippingAddress()
}
else{
uni.navigateTo({
url: 'pages/passport/login'
});
},
/**关闭地址 */
closeAddress() {
this.$emit("closeAddress", false);
@@ -66,7 +66,6 @@ export default {
},
getpicker() {
// this.$refs.cityPicker.show();
uni.navigateTo({
url: "/pages/mine/address/add",
});
@@ -87,10 +86,6 @@ export default {
this.checked = addr[0];
this.$emit("deliveryData", this.checked);
}
// addr[0] ? "" : (addr = res.data);
// /**获取默认地址是否有货 */
// this.clickAddress(addr[0]);
}
});
}

View File

@@ -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'">{{unitPrice(item.price) }}</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">
@@ -21,7 +21,7 @@
<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>
@@ -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;

View File

@@ -116,9 +116,7 @@ export default {
text-align: left;
color: #333333;
margin-left: 20rpx;
> span {
margin-right: 15rpx;
}
word-spacing: 15rpx;
}
.wrapper {

View File

@@ -16,7 +16,7 @@
</div>
</view>
<view class="to-store-btn" @click="tostorePage(goodsDetail)">
<view>进店逛逛</view>
<view class="to-store-text">进店逛逛</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;
}
}

View File

@@ -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;
}
}
}