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

@@ -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(() => {});
},
// 三级地址联动回调

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,10 +34,10 @@
</view>
<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:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>
</template>

View File

@@ -34,10 +34,10 @@
<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:show="showAction" @click="deleteAddressMessage"></u-action-sheet>
</view>

View File

@@ -122,9 +122,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
> * {
margin: 10rpx 0;
}
gap: 20rpx;
width: 33%;
// color: #fff;
}

View File

@@ -6,13 +6,15 @@
<div class="bagbar">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
</div>
<u-card @click="goDetail(row.sn,row.logi_id,row.ship_no)" :title="title" title-color="#666666" title-size="24" sub-title-color="#666666" sub-title-size="24" :border="false" :sub-title=row.status>
<view class="msg-body" #body>
<template #body>
<view class="msg-body">
<image class="msgImg" :src="row.goods_img" mode=""></image>
<view class="msgView">
<view>{{row.goodsName}}</view>
<view class="msgNum">订单号:{{row.sn}}</view>
</view>
</view>
</view>
</template>
</u-card>
</view>
</block>
@@ -99,7 +101,7 @@ export default {
color: #fff;
font-size: 24rpx;
padding: 10rpx 20rpx;
background: $u-type-info-disabled;
background: $u-info-disabled;
}
.storeImg {
width: 100%;

View File

@@ -10,11 +10,11 @@
</div>
<div class="msgMsg">{{$u.timeFormat(row.send_time, 'yyyy-mm-dd')}}</div>
<u-card :title="title" :title-size="35" :border="false">
<view class #body>
<template #body>
<view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">{{row.content}}</view>
</view>
</view>
</template>
</u-card>
</view>
</block>

View File

@@ -1,64 +1,96 @@
<template>
<view class="content">
<u-navbar>
<u-tabs :active-color="lightColor" class="slot-wrap" :list="navList" :is-scroll="true" :current="tabCurrentIndex" @change="tabClick"></u-tabs>
<u-navbar
:fixed="true"
:placeholder="true"
:border="false"
left-icon=""
title=""
>
<template #center>
<view class="slot-wrap">
<u-tabs
:active-color="lightColor"
class="collect-tabs"
:list="navList"
:is-scroll="true"
:current="tabCurrentIndex"
@change="tabClick"
></u-tabs>
</view>
</template>
</u-navbar>
<view class="swiper-box">
<view class="collect-body">
<!-- 显示商品栏 -->
<view v-if="tabCurrentIndex == 0" class="tab-content">
<scroll-view class="list-scroll-content" scroll-y>
<!-- 空白页 -->
<u-empty style="margin-top: 40rpx" text="暂无收藏商品数据" mode="favor" v-if="goodsEmpty"></u-empty>
<!-- 商品展示数据 -->
<u-swipe-action v-else v-for="(item, index) in goodList" :key="index">
<u-swipe-action-item @open="openLeftChange(item, index, 'goods')" :show="item.selected"
:options="LeftOptions"
@click="clickGoodsSwiperAction(item, index)" :name="index">
<view class="goods" @click="goGoodsDetail(item)">
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
<template #loading><u-loading></u-loading></template>
</u-image>
<view class="goods-intro">
<view>{{ item.goodsName }}</view>
<view class="goods-sn">{{ item.goods_sn }}</view>
<view>{{unitPrice(item.price) }}</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
<template v-else>
<u-swipe-action
v-for="(item, index) in goodList"
:key="index"
class="collect-swipe"
>
<u-swipe-action-item
@open="openLeftChange(item, 'goods')"
:show="item.selected"
:options="LeftOptions"
@click="clickGoodsSwiperAction(item, index)"
:name="index"
>
<view class="goods" @click="goGoodsDetail(item)">
<u-image width="131rpx" height="131rpx" :src="item.image" mode="aspectFit">
<template #loading><u-loading></u-loading></template>
</u-image>
<view class="goods-intro">
<view class="goods-name">{{ item.goodsName }}</view>
<view class="goods-sn">{{ item.goods_sn }}</view>
<view class="goods-price">{{ unitPrice(item.price) }}</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</template>
</scroll-view>
</view>
<!-- 显示收藏的店铺栏 -->
<view v-else class="tab-content">
<scroll-view class="list-scroll-content" scroll-y>
<!-- 空白页 -->
<u-empty style="margin-top: 40rpx" text="暂无收藏店铺数据" mode="favor" v-if="storeEmpty"></u-empty>
<!-- 店铺展示数据 -->
<u-swipe-action v-else v-for="(item, index) in storeList" :key="index">
<u-swipe-action-item @open="openLeftChange(item, 'store')" :show="item.selected"
:options="LeftOptions"
@click="clickStoreSwiperAction(item)">
<view class="store" @click="goStoreMainPage(item.id)">
<view class="intro">
<view class="store-logo">
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName"
mode="aspectFit">
<template #loading><u-loading></u-loading></template>
</u-image>
<template v-else>
<u-swipe-action
v-for="(item, index) in storeList"
:key="index"
class="collect-swipe"
>
<u-swipe-action-item
@open="openLeftChange(item, 'store')"
:show="item.selected"
:options="LeftOptions"
@click="clickStoreSwiperAction(item)"
:name="index"
>
<view class="store" @click="goStoreMainPage(item.id)">
<view class="intro">
<view class="store-logo">
<u-image width="102rpx" height="102rpx" :src="item.storeLogo" :alt="item.storeName"
mode="aspectFit">
<template #loading><u-loading></u-loading></template>
</u-image>
</view>
<view class="store-name">
<view>{{ item.storeName }}</view>
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated"
text="自营" mode="plain" shape="circle" />
</view>
<view class="store-collect">
<view>进店逛逛</view>
</view>
</view>
</view>
<view class="store-name">
<view>{{ item.storeName }}</view>
<u-tag size="mini" type="error" :color="$mainColor" v-if="item.selfOperated"
text="自营" mode="plain" shape="circle" />
</view>
<view class="store-collect">
<view>进店逛逛</view>
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</u-swipe-action-item>
</u-swipe-action>
</template>
</scroll-view>
</view>
</view>
@@ -142,16 +174,10 @@
* 打开商品左侧取消收藏
*/
openLeftChange(val, type) {
const {
goodList,
storeList
} = this;
let way;
type == "goods" ? (way = goodList) : (way = storeList);
const way = type === "goods" ? this.goodList : this.storeList;
way.forEach((item) => {
item["selected"] = false;
item.selected = false;
});
val["selected"] = false;
val.selected = true;
},
@@ -284,19 +310,30 @@
height: 100%;
}
.slot-wrap{
flex: 1;
display: flex;
justify-content: center;
padding-right: 72rpx;
}
.content {
width: 100%;
display: flex;
flex-direction: column;
min-height: 100vh;
}
.slot-wrap {
width: 100%;
display: flex;
justify-content: center;
}
.collect-tabs {
width: 100%;
}
.swiper-box {
overflow-y: auto;
.collect-body {
flex: 1;
min-height: 0;
}
.tab-content {
height: 100%;
}
.list-scroll-content {
@@ -304,63 +341,52 @@
width: 100%;
}
::v-deep .u-swipe-content {
.collect-swipe,
:deep(.u-swipe-action),
:deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) {
width: 100%;
}
:deep(.u-swipe-action-item__content) {
overflow: hidden;
}
.goods {
background-color: #fff;
border-bottom: 1px solid $border-color-light;
height: 190rpx;
min-height: 190rpx;
box-sizing: border-box;
display: flex;
align-items: center;
padding: 30rpx 20rpx;
margin-top: 20rpx;
image {
width: 131rpx;
height: 131rpx;
border-radius: 10rpx;
}
width: 100%;
.goods-intro {
flex: 1;
min-width: 0;
font-size: $font-base;
line-height: 48rpx;
margin-left: 30rpx;
view:nth-child(1) {
.goods-name {
line-height: 1.4em;
font-size: 24rpx;
max-height: 2.8em; //height是line-height的整数倍防止文字显示不全
max-height: 2.8em;
overflow: hidden;
color: #666;
}
view:nth-child(2) {
.goods-sn {
color: #cccccc;
font-size: 24rpx;
}
view:nth-child(3) {
.goods-price {
color: $light-color;
}
}
button {
color: $main-color;
height: 50rpx;
width: 120rpx;
font-size: $font-sm;
padding: 0;
line-height: 50rpx;
background-color: #ffffff;
margin-top: 80rpx;
&::after {
border-color: $main-color;
}
}
}
.store {
@@ -368,90 +394,42 @@
border: 1px solid $border-color-light;
border-radius: 16rpx;
margin: 20rpx 10rpx;
width: calc(100% - 20rpx);
box-sizing: border-box;
.intro {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 30rpx 0 40rpx;
height: 170rpx;
min-height: 170rpx;
.store-logo {
width: 102rpx;
height: 102rpx;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
flex-shrink: 0;
}
.store-name {
flex: 1;
min-width: 0;
margin-left: 30rpx;
line-height: 2em;
:first-child {
font-size: $font-base;
}
:last-child {
font-size: $font-sm;
color: #999;
}
}
.store-collect {
flex-shrink: 0;
border-left: 1px solid $border-color-light;
padding-left: 20rpx;
text-align: center;
:last-child {
color: #999;
font-size: $font-sm;
}
}
}
}
.navbar {
display: flex;
height: 40px;
padding: 0 5px;
background: #fff;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
position: relative;
z-index: 10;
.nav-item {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 26rpx;
text {
position: relative;
}
text.current {
color: $light-color;
font-weight: bold;
font-size: 28rpx;
&::after {
content: "";
position: absolute;
left: 20rpx;
bottom: -10rpx;
width: 30rpx;
height: 0;
border-bottom: 2px solid $light-color;
}
color: #999;
font-size: $font-sm;
}
}
}

View File

@@ -5,46 +5,52 @@
<div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '编辑' : '完成'}}</div>
</template>
</u-navbar>
<u-notice-bar mode="vertical" :list="['右划删除浏览记录']"></u-notice-bar>
<view class="tracks-tip">
<u-icon name="volume" color="#f9ae3d" size="19"></u-icon>
<text class="tracks-tip-text">右划删除浏览记录</text>
</view>
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<div v-else>
<view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navigateToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
<u-swipe-action style="width: 100%;">
<u-swipe-action-item :show="item.show" :name="index"
@click="delTracks" @open="open" :options="options">
<view v-else class="tracks-list">
<block v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navigateToStore(item)">{{ item.storeName }}</view>
<u-swipe-action class="myTracks-swipe">
<u-swipe-action-item
:show="item.show"
:name="index"
@click="delTracks"
@open="open"
:options="options"
>
<view class="myTracks-item">
<u-checkbox-group v-if="isEdit" class="store-line-check">
<u-checkbox shape="circle" :active-color="lightColor" v-model="item.checked"
@change="checkboxChangeDP(item)"></u-checkbox>
<u-checkbox
usedAlone
shape="circle"
:active-color="lightColor"
v-model:checked="item.checked"
@change="checkboxChangeDP(item)"
></u-checkbox>
</u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navigateToDetail(item)">
<image :src="item.thumbnail"></image>
<image class="track-thumb" :src="item.thumbnail"></image>
</view>
<view class="myTracks-item-content" @click.stop="navigateToDetail(item)">
<view class="myTracks-item-title">
{{ item.goodsName }}
<view class="myTracks-item-title-desc"> </view>
</view>
<view class="myTracks-item-price">
{{unitPrice(item.price) }}
{{ unitPrice(item.price) }}
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</u-swipe-action>
<view class="myTracks-divider"></view>
</view>
<div @click="handleClickDeleteSelected" v-if="isEdit" class="submit">
</block>
<view v-if="isEdit" class="submit" @click="handleClickDeleteSelected">
删除所选
</div>
</div>
</view>
</view>
</view>
</template>
@@ -165,8 +171,11 @@
/**
* 删除足迹
*/
delTracks(index,ids) {
deleteHistoryListId(ids || this.trackList[index].goodsId).then((res) => {
delTracks(e, ids) {
const index = typeof e === 'object' ? (e.name ?? e.index) : e;
const goodsId = ids || this.trackList[index]?.goodsId;
if (!goodsId) return;
deleteHistoryListId(goodsId).then((res) => {
if (res.data.code == 200) {
this.trackList = [];
this.params.pageNumber = 1
@@ -185,9 +194,10 @@
</script>
<style lang="scss" scoped>
.submit{
.submit {
position: fixed;
bottom: 20rpx;
bottom: calc(20rpx + constant(safe-area-inset-bottom));
bottom: calc(20rpx + env(safe-area-inset-bottom));
left: 10%;
width: 80%;
height: 80rpx;
@@ -197,110 +207,110 @@
align-items: center;
justify-content: center;
background: $light-color;
z-index: 99;
}
.myTracks {
width: 100%;
padding-top: 2rpx;
}
.tracks-tip {
display: flex;
align-items: center;
padding: 18rpx 24rpx;
background: #fdf6ec;
}
.tracks-tip-text {
margin-left: 10rpx;
font-size: 28rpx;
color: #f9ae3d;
line-height: 1.4;
}
.tracks-list {
width: 100%;
}
.myTracks-swipe,
:deep(.u-swipe-action),
:deep(.u-swipe-action-item),
:deep(.u-swipe-action-item__content) {
width: 100%;
}
:deep(.u-swipe-action-item__content) {
overflow: hidden;
}
.myTracks-title {
width: 100%;
height: 110rpx;
padding-left: 20rpx;
padding: 0 20rpx;
font-size: 28rpx;
color: #666;
font-weight: bold;
background-color: #fff;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.myTracks-items {
padding-top: 2rpx;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.myTracks-item {
width: 100%;
height: 226rpx;
padding-left: 20rpx;
padding-right: 20rpx;
margin-bottom: 2rpx;
// border-radius: 6/@px;
min-height: 226rpx;
padding: 30rpx 20rpx;
background-color: #fff;
position: relative;
align-items: center;
display: -webkit-box;
display: -webkit-flex;
box-sizing: border-box;
display: flex;
align-items: center;
}
.store-line-check {
margin-right: 16rpx;
flex-shrink: 0;
}
.myTracks-item-img {
margin-right: 20rpx;
border-radius: 8rpx;
flex-shrink: 0;
image {
.track-thumb {
width: 130rpx;
height: 130rpx;
border-radius: 8rpx;
display: block;
}
}
.myTracks-item-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: center;
}
.myTracks-item-title {
font-size: 28rpx;
color: #333;
}
.myTracks-item-title-desc {
font-size: 28rpx;
color: #999;
line-height: 1.4;
}
.myTracks-item-price {
font-size: 28rpx;
color: $light-color;
padding: 10rpx 0 0 0;
}
.myTracks-action {
display: flex;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: #fff;
height: 75rpx;
align-items: center;
padding: 0 32rpx;
}
.myTracks-action-btn {
width: 130rpx;
height: 60rpx;
line-height: 60rpx;
padding-top: 10rpx;
}
.myTracks-divider {
width: 100%;
height: 20rpx;
background: #f5f5f5;
}
.myTracks-action-check {
align-items: center;
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.edit{
padding-right: 32rpx;
.edit {
padding-right: 32rpx;
}
</style>

View File

@@ -8,24 +8,27 @@
</view>
</view>
<u-row class="portrait-box2">
<u-col span="6" class="portrait-box2-col" :gutter="16">
<view class="point-summary">
<view class="point-summary-item">
<text>累计获得</text>
<text class="pcolor">{{ pointData.totalPoint || 0 }}</text>
</u-col>
<u-col span="6" class="portrait-box2-col">
</view>
<view class="point-summary-divider"></view>
<view class="point-summary-item">
<text>剩余积分</text>
<text class="pcolor">{{ pointData.point || 0 }}</text>
</u-col>
</u-row>
</view>
</view>
<div class="point-list">
<view class="point-item" v-for="(item, index) in pointList" :key="index">
<view>
<view class="point-item-left">
<view class="point-label">{{ item.content }}</view>
<view>{{ item.createTime}}</view>
<view class="point-item-time">{{ item.createTime }}</view>
</view>
<view class="point-item-value" :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']">
<text>{{ item.pointType == "INCREASE" ? "+" : "-" }}</text>{{ item.variablePoint }}
</view>
<view :class="[item.pointType == 'INCREASE' ? 'plus' : 'reduce']"><span>{{item.pointType == "INCREASE" ? '+' : '-'}}</span>{{ item.variablePoint }}</view>
</view>
<uni-load-more :status="count.loadStatus"></uni-load-more>
</div>
@@ -99,8 +102,8 @@ export default {
</script>
<style lang="scss" scoped>
.point-list{
margin-top: 50rpx;
.point-list {
margin-top: 20rpx;
}
.title {
height: 80rpx;
@@ -120,45 +123,61 @@ export default {
.point-item {
width: 100%;
height: 130rpx;
padding: 0 20rpx;
min-height: 130rpx;
padding: 24rpx 20rpx;
background: #ffffff;
font-size: $font-sm;
border-bottom: 1px solid $border-color-light;
display: flex;
justify-content: end;
justify-content: space-between;
align-items: center;
> view:nth-child(1) {
box-sizing: border-box;
.point-item-left {
flex: 1;
min-width: 0;
line-height: 40rpx;
view {
color: #666666;
}
:last-child {
color: #999;
}
}
> view:nth-child(2) {
.point-item-time {
color: #999;
}
.point-item-value {
flex-shrink: 0;
width: 100rpx;
text-align: center;
}
}
.portrait-box2 {
height: 100rpx;
.point-summary {
display: flex;
align-items: center;
min-height: 100rpx;
padding: 28rpx 0;
background: #ffffff;
border-radius: 0 0 20rpx 20rpx;
margin: 0 20rpx;
font-size: 26rpx;
::v-deep .u-col {
text-align: center !important;
box-sizing: border-box;
.point-summary-item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
::v-deep .u-col:first-child {
border-right: 1px solid $border-color-light;
.point-summary-divider {
width: 1px;
height: 48rpx;
background: $border-color-light;
flex-shrink: 0;
}
.pcolor {
color: $light-color;
margin-left: 8rpx;
}
}
@@ -222,8 +241,9 @@ export default {
}
}
.point-label{
font-weight: bold;
margin-bottom: 10rpx;
.point-label {
font-weight: bold;
margin-bottom: 10rpx;
color: #666666;
}
</style>