Browse Source

关注列表

dev_des
1054425342@qq.com 2 months ago
parent
commit
ca86d667d5
  1. 8
      components/DynamicIsland.vue
  2. 6
      components/ProductSection.vue
  3. 2
      components/WaterfallLayout.vue
  4. 553
      pages/index/components/FollowTab.vue
  5. 13
      pages/index/iSoul.vue
  6. 92
      pages/index/timeShopBank.vue
  7. 488
      pages/notes/detail.vue
  8. 3
      static/image/empty-cart.png
  9. 2
      static/image/search.png
  10. 13
      static/js/CommonFunction.js
  11. 28
      subPackages/equityGoods/detail.vue
  12. 5
      subPackages/orderQy/detail.vue
  13. 5
      subPackages/orderQy/list.vue
  14. 585
      subPackages/user/gwc.vue

8
components/DynamicIsland.vue

@ -62,7 +62,7 @@
<view class="time-reward-container"> <view class="time-reward-container">
<text class="time-reward-title" style="margin-bottom: 5rpx;">时间奖励</text> <text class="time-reward-title" style="margin-bottom: 5rpx;">时间奖励</text>
<view class="time-reward-stats"> <view class="time-reward-stats">
<text class="time-reward-number">120</text> <text class="time-reward-number">0</text>
<text class="time-reward-unit"></text> <text class="time-reward-unit"></text>
</view> </view>
<text class="time-reward-label" style="font-weight: bold;">旅行时间行</text> <text class="time-reward-label" style="font-weight: bold;">旅行时间行</text>
@ -84,7 +84,7 @@
<view class="time-reward-container" style="width: 200rpx;"> <view class="time-reward-container" style="width: 200rpx;">
<text class="time-reward-title">时间奖励</text> <text class="time-reward-title">时间奖励</text>
<view class="time-reward-stats"> <view class="time-reward-stats">
<text class="time-reward-number">120</text> <text class="time-reward-number">0</text>
<text class="time-reward-unit"></text> <text class="time-reward-unit"></text>
</view> </view>
<text class="time-reward-label" <text class="time-reward-label"
@ -114,13 +114,13 @@
<image style="width: 22rpx;height: 22rpx;margin-right: 15rpx;" <image style="width: 22rpx;height: 22rpx;margin-right: 15rpx;"
:src="showImg('/uploads/20250822/c8ee7615823a1ffaba400a4d5746de9a.png')"> :src="showImg('/uploads/20250822/c8ee7615823a1ffaba400a4d5746de9a.png')">
</image> </image>
点赞:120 点赞:0
</view> </view>
<view class=""> <view class="">
<image style="width: 22rpx;height: 22rpx;margin: 0 15rpx;" <image style="width: 22rpx;height: 22rpx;margin: 0 15rpx;"
:src="showImg('/uploads/20250822/84c49f78f1c86b7340aaaa391bd4b7cf.png')"> :src="showImg('/uploads/20250822/84c49f78f1c86b7340aaaa391bd4b7cf.png')">
</image> </image>
留言:120 留言:0
</view> </view>
</view> </view>
</view> </view>

6
components/ProductSection.vue

@ -50,6 +50,7 @@
<view class="title-price-heart"> <view class="title-price-heart">
<view class="card-title">{{ item.title }}</view> <view class="card-title">{{ item.title }}</view>
<view class="card-price">{{ item.price }}</view> <view class="card-price">{{ item.price }}</view>
<template v-if="!isFeel">
<image <image
v-if="!item.type" v-if="!item.type"
class="heart-icon" class="heart-icon"
@ -62,7 +63,8 @@
src="https://epic.js-dyyj.com/uploads/20250728/dd7ed269b24e84a2dd141da6ab980fd6.png" src="https://epic.js-dyyj.com/uploads/20250728/dd7ed269b24e84a2dd141da6ab980fd6.png"
@click.stop="handleLikeClick(item, index)" @click.stop="handleLikeClick(item, index)"
></image> ></image>
<template v-if="isFeel"> </template>
<!-- <template v-if="isFeel">
<image <image
v-if="!item.isShop" v-if="!item.isShop"
class="shop-icon" class="shop-icon"
@ -75,7 +77,7 @@
src="https://epic.js-dyyj.com/uploads/20250728/77c4546ac6415f9db69bb10888d2a975.png" src="https://epic.js-dyyj.com/uploads/20250728/77c4546ac6415f9db69bb10888d2a975.png"
@click.isShop="handleLikeClick(item, index)" @click.isShop="handleLikeClick(item, index)"
></image> ></image>
</template> </template> -->
</view> </view>
</view> </view>
</view> </view>

2
components/WaterfallLayout.vue

@ -7,6 +7,7 @@
v-for="(item, index) in leftItems" v-for="(item, index) in leftItems"
:key="item.id || index" :key="item.id || index"
class="waterfall-item" class="waterfall-item"
@click="handleItemClick(item)"
> >
<image <image
v-if="item.image" v-if="item.image"
@ -40,6 +41,7 @@
v-for="(item, index) in rightItems" v-for="(item, index) in rightItems"
:key="item.id || index" :key="item.id || index"
class="waterfall-item" class="waterfall-item"
@click="handleItemClick(item)"
> >
<image <image

553
pages/index/components/FollowTab.vue

@ -0,0 +1,553 @@
<template>
<view class="follow-tab-container">
<!-- 搜索栏 -->
<view class="search-section">
<view class="search-bar">
<image class="search-icon" :src="showImg('/uploads/20250826/a4d605e82622223c270df0af4e378ab3.png')"></image>
<input
class="search-input"
placeholder="搜索已关注的人"
v-model="searchText"
@input="handleSearch"
/>
</view>
</view>
<!-- 我的关注标题和排序 -->
<view class="follows-header">
<text class="follows-title">我的关注 ({{ followsList.length }})</text>
<view class="sort-option" @click="toggleSort">
<text class="sort-text">综合排序</text>
<image class="sort-arrow" :src="showImg('/uploads/20250826/8e40deaa0bc67da3a9b104ff0e6b3e7c.png')"></image>
</view>
</view>
<!-- 分类导航 -->
<view class="category-tabs">
<view
class="tab-item"
:class="{ active: activeCategory === 'all' }"
@click="switchCategory('all')"
>
全部
</view>
<view
class="tab-item"
:class="{ active: activeCategory === 'merchant' }"
@click="switchCategory('merchant')"
>
商家
</view>
</view>
<!-- 关注用户列表 -->
<view class="follows-list">
<view
class="follow-item"
v-for="(item, index) in filteredFollowsList"
:key="item.id"
>
<image class="user-avatar" src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" mode="aspectFill"></image>
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<view class="update-tag" v-if="item.newItems > 0">
{{ item.newItems }}件商品上新
</view>
</view>
<view class="action-buttons">
<view class="follow-status-btn">
已关注
</view>
<view class="more-options" @click="showOptions(item)">
<text class="more-dots"></text>
</view>
</view>
</view>
</view>
<!-- 推荐用户分隔线 -->
<view class="divider-line"></view>
<!-- 推荐用户区域 -->
<view class="recommend-section">
<view class="recommend-header">
<view class="recommend-title" style="display: flex;align-items: center;">
你可能感兴趣的人
<image style="width: 30rpx;height: 30rpx;margin-left: 10rpx;" :src="showImg('/uploads/20250826/f1422cbef4c33e8c21d9e7e805c8bad9.png')"></image>
</view>
<view class="close-btn" @click="closeRecommend">
<text class="close-text">关闭</text>
</view>
</view>
<view class="recommend-list">
<view
class="recommend-item"
v-for="(item, index) in recommendList"
:key="item.id"
>
<image
class="user-avatar"
src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png"
mode="aspectFill"
></image>
<view class="user-info">
<text class="user-name">{{ item.name }}</text>
<text class="user-desc">{{ item.description }}</text>
</view>
<view class="action-buttons">
<view class="follow-btn" @click="followUser(item)">
关注
</view>
<view class="dismiss-btn" @click="dismissUser(item)">
<text class="dismiss-text">×</text>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "FollowTab",
data() {
return {
searchText: "",
activeCategory: "all",
followsList: [
{
id: 1,
name: "主理人—颜真卿",
avatar: "/uploads/20250826/avatar1.png",
newItems: 1,
category: "merchant",
},
{
id: 2,
name: "主理人—颜真卿",
avatar: "/uploads/20250826/avatar1.png",
newItems: 0,
category: "merchant",
},
{
id: 3,
name: "主理人—颜真卿",
avatar: "/uploads/20250826/avatar1.png",
newItems: 2,
category: "user",
},
],
recommendList: [
{
id: 101,
name: "颜真卿",
avatar: "/uploads/20250826/avatar1.png",
description: "介绍介绍介绍",
},
{
id: 102,
name: "颜真卿",
avatar: "/uploads/20250826/avatar1.png",
description: "介绍介绍介绍",
},
],
};
},
computed: {
filteredFollowsList() {
let filtered = this.followsList;
//
if (this.activeCategory !== "all") {
filtered = filtered.filter(
(item) => item.category === this.activeCategory
);
}
//
if (this.searchText.trim()) {
filtered = filtered.filter((item) =>
item.name.toLowerCase().includes(this.searchText.toLowerCase())
);
}
return filtered;
},
},
methods: {
handleSearch() {
// computed
},
toggleSort() {
//
uni.showToast({
title: "排序功能开发中",
icon: "none",
});
},
switchCategory(category) {
this.activeCategory = category;
},
showOptions(item) {
uni.showActionSheet({
itemList: ["取消关注", "举报", "拉黑"],
success: (res) => {
switch (res.tapIndex) {
case 0:
this.unfollowUser(item);
break;
case 1:
this.reportUser(item);
break;
case 2:
this.blockUser(item);
break;
}
},
});
},
unfollowUser(item) {
const index = this.followsList.findIndex((user) => user.id === item.id);
if (index > -1) {
this.followsList.splice(index, 1);
uni.showToast({
title: "已取消关注",
icon: "success",
});
}
},
reportUser(item) {
uni.showToast({
title: "举报功能开发中",
icon: "none",
});
},
blockUser(item) {
uni.showToast({
title: "拉黑功能开发中",
icon: "none",
});
},
followUser(item) {
//
this.followsList.unshift({
id: item.id,
name: item.name,
avatar: item.avatar,
newItems: 0,
category: "user",
});
//
const index = this.recommendList.findIndex((user) => user.id === item.id);
if (index > -1) {
this.recommendList.splice(index, 1);
}
uni.showToast({
title: "关注成功",
icon: "success",
});
},
dismissUser(item) {
const index = this.recommendList.findIndex((user) => user.id === item.id);
if (index > -1) {
this.recommendList.splice(index, 1);
uni.showToast({
title: "已移除推荐",
icon: "success",
});
}
},
closeRecommend() {
this.recommendList = [];
uni.showToast({
title: "已关闭推荐",
icon: "success",
});
},
},
};
</script>
<style lang="scss" scoped>
.follow-tab-container {
background: #fff;
min-height: 100vh;
}
/* 搜索栏 */
.search-section {
padding: 32rpx;
background: #fff;
}
.search-bar {
display: flex;
align-items: center;
background: #f8f9fa;
border-radius: 40rpx;
padding: 0 32rpx;
height: 80rpx;
.search-icon {
width:32rpx ;
height:32rpx ;
margin-right: 16rpx;
color: #999;
}
.search-input {
flex: 1;
font-size: 28rpx;
color: #333;
&::placeholder {
color: #999;
}
}
}
/* 关注标题和排序 */
.follows-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
padding: 0 32rpx 24rpx;
margin-bottom: 20rpx;
.follows-title {
font-size: 32rpx;
font-weight: 600;
color: #333;
}
.sort-option {
display: flex;
align-items: center;
.sort-text {
font-size: 28rpx;
color: #000000;
margin-right: 8rpx;
}
.sort-arrow {
width:9rpx;
height: 24rpx;
}
}
}
/* 分类导航 */
.category-tabs {
display: flex;
padding: 0 32rpx 32rpx;
gap: 16rpx;
.tab-item {
border-radius: 32rpx;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
padding: 15rpx 30rpx;
font-size: 28rpx;
color: #000000;
font-weight: bold;
&.active {
background: #00FFFF;
color: #000000;
}
}
}
/* 关注用户列表 */
.follows-list {
padding: 0 32rpx;
.follow-item {
display: flex;
align-items: center;
padding: 32rpx 0;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.user-avatar {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-right: 24rpx;
}
.user-info {
flex: 1;
.user-name {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #000000;
margin-bottom: 8rpx;
}
.update-tag {
display: inline-block;
background: #f8f9fa;
border-radius: 16rpx;
padding: 10rpx 12rpx;
font-size: 24rpx;
color: #666;
}
}
.action-buttons {
display: flex;
align-items: center;
gap: 16rpx;
.follow-status-btn {
border-radius: 24rpx;
padding: 12rpx 24rpx;
border: 2rpx solid #e5e5e5;
font-size: 26rpx;
color: #666;
}
.more-options {
padding: 8rpx;
.more-dots {
font-size: 24rpx;
color: #000;
letter-spacing: 2rpx;
}
}
}
}
}
/* 分隔线 */
.divider-line {
height: 1rpx;
background: #f0f0f0;
margin: 32rpx 0;
}
/* 推荐用户区域 */
.recommend-section {
padding: 0 32rpx;
.recommend-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
.recommend-title {
font-size: 28rpx;
font-weight: 500;
color: #666666;
margin-right: 10rpx;
}
.close-btn {
padding: 8rpx 16rpx;
.close-text {
font-size: 28rpx;
color: #666;
}
}
}
.recommend-list {
.recommend-item {
display: flex;
align-items: center;
padding: 32rpx 0;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.user-avatar {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-right: 24rpx;
}
.user-info {
flex: 1;
.user-name {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.user-desc {
font-size: 26rpx;
color: #999;
}
}
.action-buttons {
display: flex;
align-items: center;
gap: 16rpx;
.follow-btn {
border: 2rpx solid #00FFFF;
border-radius: 24rpx;
padding: 12rpx 24rpx;
font-size: 26rpx;
color: #000;
font-weight: bold;
}
.dismiss-btn {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
background: #f8f9fa;
display: flex;
align-items: center;
justify-content: center;
.dismiss-text {
font-size: 32rpx;
color: #999;
font-weight: 300;
}
}
}
}
}
}
</style>

13
pages/index/iSoul.vue

@ -43,19 +43,19 @@
<view class="stats-section"> <view class="stats-section">
<view class="stats-left"> <view class="stats-left">
<view class="stat-item"> <view class="stat-item">
<view class="stat-number">{{ userStats.following || "140" }}</view> <view class="stat-number">{{ userStats.following || "0" }}</view>
<view class="stat-label">关注</view> <view class="stat-label">关注</view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-number">{{ userStats.followers || "2462" }}</view> <view class="stat-number">{{ userStats.followers || "0" }}</view>
<view class="stat-label">粉丝</view> <view class="stat-label">粉丝</view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-number">{{ userStats.likes || "5.4万" }}</view> <view class="stat-number">{{ userStats.likes || "0" }}</view>
<view class="stat-label">点赞</view> <view class="stat-label">点赞</view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-number">{{ userStats.likes || "5.4万" }}</view> <view class="stat-number">{{ userStats.likes || "0" }}</view>
<view class="stat-label">收藏</view> <view class="stat-label">收藏</view>
</view> </view>
</view> </view>
@ -501,10 +501,7 @@
url: `/subPackages/orderQy/confrim?goodsId=${item.goodsId}&orderChildId=${item.childId}`, url: `/subPackages/orderQy/confrim?goodsId=${item.goodsId}&orderChildId=${item.childId}`,
}); });
} else { } else {
uni.showToast({ this.toJdszWx('pages/user/order/sceneOrderInfo/index??id='+item.thirdOrderId)
title: "使用门票",
icon: "none",
});
} }
}, },

92
pages/index/timeShopBank.vue

@ -4,7 +4,11 @@
<headerVue fixed></headerVue> <headerVue fixed></headerVue>
<!-- 灵动岛组件 --> <!-- 灵动岛组件 -->
<DynamicIsland ref="dynamicIsland" :page-id="'timeShopBank_page'" :style-type="'timeShop'" /> <DynamicIsland
ref="dynamicIsland"
:page-id="'timeShopBank_page'"
:style-type="'timeShop'"
/>
<!-- Tab切换组件 --> <!-- Tab切换组件 -->
<view class="tab-container"> <view class="tab-container">
@ -22,12 +26,18 @@
</view> </view>
</view> </view>
<!-- 内容区域 -->
<view class="content-area">
<!-- 笔记tab内容 -->
<view v-if="currentTab === 0" class="notes-content">
<!-- 发布按钮 --> <!-- 发布按钮 -->
<view class="fab-container"> <view class="fab-container">
<image :src="showImg('/uploads/20250825/7ea7864b8abb89c3dd7834f025e49b3f.png')" style="width: 91rpx;height: 91rpx;"></image> <image
<!-- <button class="fab-btn" @click="goToPublish"> :src="
<text class="fab-icon">+</text> showImg('/uploads/20250825/7ea7864b8abb89c3dd7834f025e49b3f.png')
</button> --> "
style="width: 91rpx; height: 91rpx"
></image>
</view> </view>
<!-- 瀑布流组件 --> <!-- 瀑布流组件 -->
@ -39,6 +49,18 @@
@item-click="handleItemClick" @item-click="handleItemClick"
style="margin-top: 20rpx" style="margin-top: 20rpx"
/> />
</view>
<!-- 关注tab内容 -->
<view v-if="currentTab === 1" class="follow-content">
<FollowTab />
</view>
<!-- 推荐tab内容 -->
<view v-if="currentTab === 2" class="recommend-content">
<text class="coming-soon">推荐功能开发中...</text>
</view>
</view>
<!-- 控制按钮 --> <!-- 控制按钮 -->
<!-- <view class="controls"> <!-- <view class="controls">
@ -61,6 +83,7 @@ import WaterfallLayout from "@/components/WaterfallLayout.vue";
import headerVue from "@/components/header.vue"; import headerVue from "@/components/header.vue";
import CustomTabBar from "@/components/CustomTabBar.vue"; import CustomTabBar from "@/components/CustomTabBar.vue";
import DynamicIsland from "@/components/DynamicIsland.vue"; import DynamicIsland from "@/components/DynamicIsland.vue";
import FollowTab from "./components/FollowTab.vue";
export default { export default {
name: "TimeShopBank", name: "TimeShopBank",
@ -69,6 +92,7 @@ export default {
headerVue, headerVue,
CustomTabBar, CustomTabBar,
DynamicIsland, DynamicIsland,
FollowTab,
}, },
data() { data() {
return { return {
@ -79,10 +103,22 @@ export default {
{ name: "推荐", id: "recommend" }, { name: "推荐", id: "recommend" },
], ],
waterfallItems: [ waterfallItems: [
{title:'生命的扶持|风景之旅',image:'/uploads/20250824/2cf1f49920b911c9d14e4abf3b67a59c.png'}, {
{title:'苏州丨园林之美 鱼戏莲叶间心随鱼鸟闲',image:'/uploads/20250824/c209044a821630158f6e6771805682a7.png'}, title: "生命的扶持|风景之旅",
{title:'蘇州|你一句春不晚,我便出现在真江南',image:'/uploads/20250824/74101a77233375625282209392dc69e3.png'}, image: "/uploads/20250824/2cf1f49920b911c9d14e4abf3b67a59c.png",
{title:'收好这天然氧吧',image:'/uploads/20250824/e0ab7fd0483d05742451e8f10ab3ce24.png'}, },
{
title: "苏州丨园林之美 鱼戏莲叶间心随鱼鸟闲",
image: "/uploads/20250824/c209044a821630158f6e6771805682a7.png",
},
{
title: "蘇州|你一句春不晚,我便出现在真江南",
image: "/uploads/20250824/74101a77233375625282209392dc69e3.png",
},
{
title: "收好这天然氧吧",
image: "/uploads/20250824/e0ab7fd0483d05742451e8f10ab3ce24.png",
},
], ],
autoAddEnabled: false, autoAddEnabled: false,
// URL // URL
@ -148,15 +184,13 @@ export default {
JSON.parse(uni.getStorageSync("userInfo"))) || JSON.parse(uni.getStorageSync("userInfo"))) ||
this.$store.state.user.userInfo || this.$store.state.user.userInfo ||
{}; {};
}, },
onShow() { onShow() {
if (this.userInfo && this.userInfo.token) { if (this.userInfo && this.userInfo.token) {
this.getUserInfo() this.getUserInfo();
} }
}, },
// //
onReachBottom() { onReachBottom() {
this.loadMoreItems(); this.loadMoreItems();
@ -170,12 +204,12 @@ export default {
methods: { methods: {
getUserInfo() { getUserInfo() {
this.Post({}, "/framework/user/getInfo", "DES").then((res) => { this.Post({}, "/framework/user/getInfo", "DES").then((res) => {
res.data.token = this.userInfo.token res.data.token = this.userInfo.token;
uni.setStorageSync("userInfo", JSON.stringify(res.data)); uni.setStorageSync("userInfo", JSON.stringify(res.data));
this.userInfo = res.data this.userInfo = res.data;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dynamicIsland.getUserInfo(); this.$refs.dynamicIsland.getUserInfo();
}) });
}); });
}, },
// //
@ -430,5 +464,33 @@ page {
} }
} }
/* 内容区域样式 */
.content-area {
flex: 1;
overflow: hidden;
}
.notes-content {
position: relative;
height: 100%;
}
.follow-content {
height: 100%;
overflow-y: auto;
}
.recommend-content {
display: flex;
align-items: center;
justify-content: center;
height: 400rpx;
.coming-soon {
font-size: 28rpx;
color: #999;
}
}
/* 自定义样式已移至WaterfallLayout组件内部 */ /* 自定义样式已移至WaterfallLayout组件内部 */
</style> </style>

488
pages/notes/detail.vue

@ -2,48 +2,62 @@
<view class="note-detail-container"> <view class="note-detail-container">
<!-- 笔记内容区域 --> <!-- 笔记内容区域 -->
<view class="content-scroll"> <view class="content-scroll">
<!-- 轮播图区域 -->
<view class="banner-content">
<swiper
class="top-banner"
:circular="true"
:interval="6000"
:duration="800"
:indicator-dots="false"
:autoplay="true"
@change="swiperChange"
>
<swiper-item v-for="(item, index) in topBanner" :key="index">
<image
class="top-banner"
:src="showImg(item)"
mode="aspectFill"
></image>
</swiper-item>
</swiper>
<view class="dot-container">
<view
:class="['dot-line', index == swiperIndex ? 'active' : '']"
v-for="(item, index) in topBanner"
:key="index"
></view>
</view>
</view>
<!-- 内容卡片 -->
<view class="content-card">
<!-- 作者信息 --> <!-- 作者信息 -->
<view class="author-section"> <view class="author-section">
<image <image
class="author-avatar" class="author-avatar"
:src="noteDetail.user.avatar" :src="showImg(noteDetail.user.avatar)"
mode="aspectFill" mode="aspectFill"
/> />
<view class="author-info"> <view class="author-info">
<text class="author-name">{{ noteDetail.user.name }}</text> <text class="author-name">{{ noteDetail.user.name }}</text>
<text class="publish-time">{{
formatTime(noteDetail.createTime)
}}</text>
</view> </view>
<button <view
class="follow-btn" class="follow-btn"
:class="{ followed: noteDetail.user.isFollowed }" :class="{ followed: noteDetail.user.isFollowed }"
@click="toggleFollow" @click="toggleFollow"
> >
{{ noteDetail.user.isFollowed ? "已关注" : "+ 关注" }} {{ noteDetail.user.isFollowed ? "已关注" : "关注" }}
</button> </view>
</view> </view>
<!-- 笔记标题 --> <!-- 笔记标题 -->
<view class="note-title"> <view class="note-title">
{{ noteDetail.title }} {{ noteDetail.title }}
</view> </view>
<!-- 笔记主图 -->
<view class="note-image-container" v-if="noteDetail.image">
<image
class="note-image"
:src="noteDetail.image"
mode="aspectFill"
@click="previewImage(noteDetail.image)"
/>
</view>
<!-- 笔记内容 -->
<view class="note-content">
<text class="content-text">{{ noteDetail.content }}</text>
</view>
<!-- 标签 --> <!-- 标签 -->
<view <view
class="tags-section" class="tags-section"
@ -54,26 +68,13 @@
</view> </view>
</view> </view>
<!-- 互动数据 --> <!-- 笔记内容 -->
<view class="interaction-section"> <view class="note-content">
<view class="interaction-item" @click="toggleLike"> <text class="content-text">{{ noteDetail.content }}</text>
<text class="interaction-icon" :class="{ liked: noteDetail.isLiked }"
></text
>
<text class="interaction-text">{{ noteDetail.likes }}</text>
</view>
<view class="interaction-item" @click="toggleCollect">
<text
class="interaction-icon"
:class="{ collected: noteDetail.isCollected }"
></text
>
<text class="interaction-text">{{ noteDetail.collects }}</text>
</view> </view>
<view class="interaction-item" @click="showShareMenu">
<text class="interaction-icon"></text>
<text class="interaction-text">分享</text>
</view> </view>
<view class="" style="width: auto;height: 1rpx;background-color: #999999;margin: 60rpx 32rpx;">
</view> </view>
<!-- 评论区域 --> <!-- 评论区域 -->
@ -91,7 +92,7 @@
> >
<image <image
class="comment-avatar" class="comment-avatar"
:src="comment.user.avatar" :src="showImg(comment.user.avatar)"
mode="aspectFill" mode="aspectFill"
/> />
<view class="comment-content"> <view class="comment-content">
@ -102,14 +103,6 @@
}}</text> }}</text>
</view> </view>
<text class="comment-text">{{ comment.content }}</text> <text class="comment-text">{{ comment.content }}</text>
<view class="comment-actions">
<view class="comment-like" @click="toggleCommentLike(comment)">
<text class="like-icon" :class="{ liked: comment.isLiked }"
></text
>
<text class="like-count">{{ comment.likes }}</text>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -119,6 +112,7 @@
</view> </view>
<!-- 底部评论输入框 --> <!-- 底部评论输入框 -->
<view class="comment-input-section-box">
<view class="comment-input-section"> <view class="comment-input-section">
<input <input
class="comment-input" class="comment-input"
@ -133,6 +127,17 @@
> >
发送 发送
</button> </button>
<view class="like-section">
<image class="like-icon" mode="widthFix" :src="showImg('/uploads/20250826/3f4c0ccaaaccbef50bf8c5c27ff6a87b.png')"></image>
<!-- <text
class="like-icon"
:class="{ liked: noteDetail.isLiked }"
@click="toggleLike"
></text
> -->
<text class="like-count">{{ noteDetail.likes }}</text>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -149,6 +154,8 @@ export default {
return { return {
noteId: "", noteId: "",
commentText: "", commentText: "",
topBanner: ["/uploads/20250826/17356ed4dcdeedcd13de60ca28909d22.png"],
swiperIndex: 0,
noteDetail: { noteDetail: {
id: "", id: "",
title: "", title: "",
@ -156,9 +163,7 @@ export default {
image: "", image: "",
tags: [], tags: [],
likes: 0, likes: 0,
collects: 0,
isLiked: false, isLiked: false,
isCollected: false,
createTime: "", createTime: "",
user: { user: {
id: "", id: "",
@ -179,6 +184,9 @@ export default {
} }
}, },
methods: { methods: {
swiperChange(e) {
this.swiperIndex = e.detail.current;
},
// //
async loadNoteDetail() { async loadNoteDetail() {
try { try {
@ -201,48 +209,43 @@ export default {
loadMockData() { loadMockData() {
this.noteDetail = { this.noteDetail = {
id: "mock001", id: "mock001",
title: "这里是用户发布内容的标题", title: "首期「桃园山河令」",
content: content:
"这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容这里是用户发布的内容", "一周前,我们种下了一片想象中的桃园,并向江湖发出了一封「桃园山河令」,邀请你来分享属于自己的“桃园时刻”。未曾想到,这片初生的桃园,会迎来五湖四海如此多的“桃园客”——这是我们想送给每一位「EpicSoul交响」星球上「三个桃子」粉丝的名字。这些回响,来自每一位被「三个桃子」IP故事所触动的你。因为是你们,用一个个真实、温暖的故事,让我们想象中的那片桃园,迅速地枝繁叶茂,长满了沉甸甸的果实。",
image: "https://picsum.photos/800/600", image: "https://static.ticket.sz-trip.com/epicSoul/canal-town.jpg",
tags: ["时间力", "阅读体验"], tags: ["时间里的约定", "审美", "治愈系调色"],
likes: 128, likes: 30,
collects: 64,
isLiked: false, isLiked: false,
isCollected: false, createTime: "2025-08-20 14:30:00",
createTime: "2024-01-15 14:30:00",
user: { user: {
id: "user001", id: "user001",
name: "杨璐摄影", name: "发布者",
avatar: avatar: "/uploads/20250826/b4b7c64ce37481e75742454c037e6407.png",
"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=100",
isFollowed: false, isFollowed: false,
}, },
comments: [ comments: [
{ {
id: "comment001", id: "comment001",
content: "很棒的分享,学到了很多!", content:
likes: 5, "我的「桃园时刻」是和发小一起玩耍,阳光透过桃叶洒下斑驳光影,空气中弥漫着桃子的香甜。我们一起摘桃子,分享秘密,笑声在桃园里回荡。",
isLiked: false, createTime: "2025-08-20 15:00:00",
createTime: "2024-01-15 15:00:00",
user: { user: {
id: "user002", id: "user002",
name: "读书爱好者", name: "@小新",
avatar: avatar:
"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&w=100", "/uploads/20250826/d68433653e8b8cceba9bc4a6ab2a394d.png",
}, },
}, },
{ {
id: "comment002", id: "comment002",
content: "感谢分享,很有启发性的内容", content:
likes: 3, "我的「桃园时刻」是和家人一起野餐,在桃树下享受美食,孩子们在周围嬉戏,欢声笑语让时光变得缓慢而美好。",
isLiked: false, createTime: "2025-08-20 16:20:00",
createTime: "2024-01-15 16:20:00",
user: { user: {
id: "user003", id: "user003",
name: "时间管理达人", name: "Mr.曾",
avatar: avatar:
"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?auto=format&fit=crop&w=100", "/uploads/20250826/d68433653e8b8cceba9bc4a6ab2a394d.png",
}, },
}, },
], ],
@ -272,31 +275,6 @@ export default {
this.noteDetail.likes += this.noteDetail.isLiked ? 1 : -1; this.noteDetail.likes += this.noteDetail.isLiked ? 1 : -1;
}, },
//
toggleCollect() {
this.noteDetail.isCollected = !this.noteDetail.isCollected;
this.noteDetail.collects += this.noteDetail.isCollected ? 1 : -1;
},
//
showShareMenu() {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
href: `https://example.com/notes/${this.noteDetail.id}`,
title: this.noteDetail.title,
summary: this.noteDetail.content.substring(0, 100),
imageUrl: this.noteDetail.image,
});
},
//
toggleCommentLike(comment) {
comment.isLiked = !comment.isLiked;
comment.likes += comment.isLiked ? 1 : -1;
},
// //
async submitComment() { async submitComment() {
if (!this.commentText.trim()) { if (!this.commentText.trim()) {
@ -306,14 +284,12 @@ export default {
const newComment = { const newComment = {
id: "comment" + Date.now(), id: "comment" + Date.now(),
content: this.commentText, content: this.commentText,
likes: 0,
isLiked: false,
createTime: new Date().toISOString(), createTime: new Date().toISOString(),
user: { user: {
id: "current_user", id: "current_user",
name: "当前用户", name: "",
avatar: avatar:
"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=100", "https://static.ticket.sz-trip.com/epicSoul/avatar-current.png",
}, },
}; };
@ -329,18 +305,10 @@ export default {
// //
formatTime(timeString) { formatTime(timeString) {
const time = new Date(timeString); const time = new Date(timeString);
const now = new Date(); const year = time.getFullYear();
const diff = now.getTime() - time.getTime(); const month = String(time.getMonth() + 1).padStart(2, "0");
const day = String(time.getDate()).padStart(2, "0");
if (diff < 60 * 1000) { return `${year}/${month}/${day}`;
return "刚刚";
} else if (diff < 60 * 60 * 1000) {
return Math.floor(diff / (60 * 1000)) + "分钟前";
} else if (diff < 24 * 60 * 60 * 1000) {
return Math.floor(diff / (60 * 60 * 1000)) + "小时前";
} else {
return time.toLocaleDateString();
}
}, },
// API - // API -
@ -352,7 +320,7 @@ export default {
code: 200, code: 200,
data: this.noteDetail, data: this.noteDetail,
}); });
}, 500); }, 100);
}); });
}, },
}, },
@ -362,27 +330,39 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.note-detail-container { .note-detail-container {
min-height: 100vh; min-height: 100vh;
background: #fff; background: #f5f5f5;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.content-scroll { .content-scroll {
flex: 1; flex: 1;
padding: 0 32rpx; padding: 0;
}
//
.note-image-container {
width: 100%;
height: 500rpx;
overflow: hidden;
.note-image {
width: 100%;
height: 100%;
object-fit: cover;
}
} }
// //
.author-section { .author-section {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 32rpx 0; background: #fff;
border-bottom: 1rpx solid #f0f0f0;
.author-avatar { .author-avatar {
width: 80rpx; width: 95rpx;
height: 80rpx; height: 95rpx;
border-radius: 40rpx; border-radius: 50%;
margin-right: 24rpx; margin-right: 24rpx;
} }
@ -392,61 +372,44 @@ export default {
.author-name { .author-name {
display: block; display: block;
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: bold;
color: #333; color: #333;
margin-bottom: 8rpx;
}
.publish-time {
font-size: 24rpx;
color: #999;
} }
} }
.follow-btn { .follow-btn {
border-radius: 30rpx; border-radius: 30rpx;
font-size: 24rpx; font-size: 28rpx;
border: 2rpx solid #ff4757;
background: transparent;
color: #ff4757;
font-weight: 600;
&.followed {
background: #ff4757;
color: #fff; color: #fff;
font-weight: bold;
border: 2rpx solid #02fcfc;
color: #333333;
background-color: white;
padding: 12rpx 30rpx;
&.followed {
background: #ccc;
}
} }
} }
//
.content-card {
margin: 32rpx;
background: #fff;
border-radius: 0rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
overflow: hidden;
padding: 40rpx;
} }
// //
.note-title { .note-title {
font-size: 40rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
line-height: 1.4; line-height: 1.4;
margin: 32rpx 0; margin-bottom: 14rpx;
} margin-top: 24rpx;
//
.note-image-container {
margin: 32rpx 0;
.note-image {
width: 100%;
max-height: 800rpx;
border-radius: 16rpx;
}
}
//
.note-content {
margin: 32rpx 0;
.content-text {
font-size: 32rpx;
line-height: 1.6;
color: #333;
}
} }
// //
@ -454,62 +417,36 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16rpx; gap: 16rpx;
margin: 32rpx 0; margin-bottom: 32rpx;
.tag-item { .tag-item {
padding: 12rpx 24rpx; // background: #f8f9fa;
background: #f8f9fa; // border-radius: 20rpx;
border-radius: 32rpx; font-size: 26rpx;
font-size: 24rpx;
color: #666; color: #666;
} }
} }
// //
.interaction-section { .note-content {
display: flex; .content-text {
align-items: center; font-size: 30rpx;
gap: 48rpx; line-height: 1.6;
padding: 32rpx 0; color: #333;
border-bottom: 1rpx solid #f0f0f0; font-weight: bold;
.interaction-item {
display: flex;
align-items: center;
gap: 8rpx;
cursor: pointer;
.interaction-icon {
font-size: 32rpx;
color: #999;
transition: color 0.3s;
&.liked {
color: #ff4757;
}
&.collected {
color: #ffd700;
}
}
.interaction-text {
font-size: 28rpx;
color: #666;
}
} }
} }
// //
.comments-section { .comments-section {
margin: 32rpx 0; margin: 0 32rpx 32rpx;
border-radius: 0rpx;
.comments-header { .comments-header {
margin-bottom: 32rpx; margin-bottom: 32rpx;
.comments-title { .comments-title {
font-size: 32rpx; font-size: 34rpx;
font-weight: 600; font-weight: bold;
color: #333; color: #333;
} }
} }
@ -535,66 +472,42 @@ export default {
margin-bottom: 12rpx; margin-bottom: 12rpx;
.comment-user { .comment-user {
font-size: 28rpx; font-size: 30rpx;
font-weight: 600; font-weight: bold;
color: #333; color: #000000;
} }
.comment-time { .comment-time {
font-size: 24rpx; font-size: 26rpx;
color: #999; color: #999;
} }
} }
.comment-text { .comment-text {
font-size: 30rpx; font-size: 28rpx;
line-height: 1.5; line-height: 1.5;
color: #333; color: #000000;
margin-bottom: 16rpx;
}
.comment-actions {
display: flex;
align-items: center;
.comment-like {
display: flex;
align-items: center;
gap: 8rpx;
cursor: pointer;
.like-icon {
font-size: 24rpx;
color: #999;
&.liked {
color: #ff4757;
}
}
.like-count {
font-size: 24rpx;
color: #999;
}
}
} }
} }
} }
} }
.comment-input-section-box{
//
.comment-input-section {
display: flex;
align-items: center;
padding: 24rpx 32rpx;
background: #fff;
border-top: 1rpx solid #f0f0f0;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 999; z-index: 999;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
border-top: 1rpx solid #f0f0f0;
background: #fff;
}
//
.comment-input-section {
display: flex;
align-items: center;
padding: 24rpx 32rpx 0;
padding-bottom: max(env(safe-area-inset-bottom),24rpx);
.comment-input { .comment-input {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
@ -607,25 +520,94 @@ z-index: 999;
} }
.send-btn { .send-btn {
width: 120rpx; width: 140rpx;
height: 60rpx; height: 67rpx;
line-height: 60rpx; line-height: 67rpx;
background: #ff4757; background: #94fafa;
color: #fff; color: #000000;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 28rpx; font-size: 30rpx;
border: none; border: none;
font-weight: 600; font-weight: 500;
margin-right: 24rpx;
&:disabled { &:disabled {
background: #ccc; background: #ccc;
} }
} }
.like-section {
display: flex;
align-items: center;
gap: 8rpx;
.like-icon {
width:36rpx;
transition: color 0.3s;
&.liked {
color: #ff4757;
}
}
.like-count {
font-size: 30rpx;
color: #666;
font-weight: bold;
}
}
} }
.bottom-placeholder { .bottom-placeholder {
height: 130rpx; height: 130rpx;
width: 100%;
padding-bottom: calc(24rpx + env(safe-area-inset-bottom)); padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
padding-bottom: calc(24rpx + constant(safe-area-inset-bottom)); padding-bottom: calc(24rpx + constant(safe-area-inset-bottom));
box-sizing: content-box;
}
.banner-content {
width: 100%;
height: 1000rpx;
position: relative;
.top-banner {
width: 100%;
height: 100%;
}
.dot-container {
position: absolute;
bottom: 43rpx;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
left: 0;
.dot-line {
width: 52rpx;
height: 4rpx;
margin: 0 8rpx;
background: RGBA(189, 170, 173, 0.8);
&.active {
background: white;
}
}
}
.page-indicator {
position: absolute;
bottom: 20rpx;
right: 20rpx;
// background: rgba(0, 0, 0, 0.5);
border-radius: 10rpx;
padding: 10rpx 20rpx;
.page-text {
font-size: 24rpx;
color: #fff;
font-weight: 500;
}
}
} }
</style> </style>

3
static/image/empty-cart.png

@ -0,0 +1,3 @@
# 这是一个空购物车图标的占位文件
# 在实际项目中,请替换为真实的空购物车图标图片文件
# 建议使用简洁的购物车图标,颜色为灰色或浅色

2
static/image/search.png

@ -0,0 +1,2 @@
# 这是一个搜索图标的占位文件
# 在实际项目中,请替换为真实的搜索图标图片文件

13
static/js/CommonFunction.js

@ -416,3 +416,16 @@ Vue.prototype.addImgStyleToHtml = (htmlStr) => {
} }
}); });
} }
Vue.prototype.toJdszWx = (path) => {
wx.navigateToMiniProgram({
appId: 'wx4bb7b6050831f585',
path: path,
envVersion: process.env.NODE_ENV === 'development'?'trial':'release',
success(res) {
// 打开成功
},
fail(e){
console.log(e)
}
})
}

28
subPackages/equityGoods/detail.vue

@ -29,10 +29,12 @@
</view> </view>
<!-- 页码指示器 --> <!-- 页码指示器 -->
<view class="page-indicator"> <view class="page-indicator" v-if="goodsInfo.agent">
<text class="page-text" <image
>{{ swiperIndex + 1 }}/{{ topBanner.length }}</text class="avatar"
> :src="showImg(goodsInfo.agent.headImage)"
mode="aspectFill"
></image>
</view> </view>
</view> </view>
@ -280,18 +282,7 @@ export default {
// //
handlePurchase() { handlePurchase() {
let id = this.goodsInfo.sku&&this.goodsInfo.sku.product.sceneId let id = this.goodsInfo.sku&&this.goodsInfo.sku.product.sceneId
wx.navigateToMiniProgram({ this.toJdszWx('pages/info/sceneProductInfo/index?id='+id)
appId: 'wx4bb7b6050831f585',
path: 'pages/info/sceneProductInfo/index?id='+id,
envVersion: process.env.NODE_ENV === 'development'?'trial':'release',
success(res) {
//
},
fail(e){
console.log(e)
}
})
// //
}, },
@ -817,4 +808,9 @@ export default {
.detail-container { .detail-container {
padding-bottom: 140rpx; padding-bottom: 140rpx;
} }
.avatar{
width: 119rpx;
height: 119rpx;
border-radius: 50%;
}
</style> </style>

5
subPackages/orderQy/detail.vue

@ -639,10 +639,7 @@ export default {
// 使 // 使
useTicket(goods) { useTicket(goods) {
// 使 // 使
uni.showToast({ this.toJdszWx('pages/user/order/sceneOrderInfo/index??id='+goods.thirdOrderId)
title: "使用门票",
icon: "none",
});
}, },
// //

5
subPackages/orderQy/list.vue

@ -440,10 +440,7 @@ export default {
// 使 // 使
useTicket(goods) { useTicket(goods) {
// 使 // 使
uni.showToast({ this.toJdszWx('pages/user/order/sceneOrderInfo/index??id='+goods.thirdOrderId)
title: "使用门票",
icon: "none",
});
}, },
// //

585
subPackages/user/gwc.vue

@ -1,27 +1,62 @@
<template> <template>
<view class="bg"> <view class="bg">
<view class="guanli" v-if="list && list.length>0" @click="guanli">{{operate}}</view> <view class="guanli" v-if="list && list.length > 0" @click="guanli">{{
operate
}}</view>
<view v-for="(item, index) in list" :key="index"> <view v-for="(item, index) in list" :key="index">
<view class="goodBox" v-if="item.data && item.data.length > 0"> <view class="goodBox" v-if="item.data && item.data.length > 0">
<view class="title" v-if="item.data.some(v => v.flag == 1)">{{item.merchant_name}} ></view> <view class="title" v-if="item.data.some((v) => v.flag == 1)"
<view class="goodItem" v-for="(goodItem,goodIndex) in item.data" :key="goodIndex" >{{ item.merchant_name }}<uni-icons size="16" color="#000000" type="arrowright" /></view
v-if="goodItem.flag != 0"> >
<view class="noSelect" v-if="!goodItem.is_select" @click="changeSelect(goodItem)"></view> <view
<view class="selectBox flex-around" v-else @click="changeSelect(goodItem)"> class="goodItem"
<img src="https://static.ticket.sz-trip.com/cgc/images/order/dui.png"> v-for="(goodItem, goodIndex) in item.data"
:key="goodIndex"
v-if="goodItem.flag != 0"
>
<view
class="noSelect"
v-if="!goodItem.is_select"
@click="changeSelect(goodItem)"
></view>
<view
class="selectBox flex-around"
v-else
@click="changeSelect(goodItem)"
>
<img
src="https://static.ticket.sz-trip.com/cgc/images/order/dui.png"
/>
</view> </view>
<image :src="showImg(goodItem.specifications_image)" mode="aspectFill" <image
@click="goDetails(goodItem.good_id)"></image> :src="showImg(goodItem.specifications_image)"
mode="aspectFill"
@click="goDetails(goodItem.good_id)"
></image>
<view class="contentBox"> <view class="contentBox">
<view class="title text-overflow">{{ goodItem.good_name }}</view> <view class="title text-overflow">{{ goodItem.good_name }}</view>
<view class="subTitle text-overflow">{{goodItem.Specifications_name}}</view> <view class="subTitle text-overflow">{{
goodItem.Specifications_name
}}</view>
<view class="priceBox flex-between"> <view class="priceBox flex-between">
<view class="price">{{goodItem.Specifications_money / 100}}</view> <view class="price">{{
<view class="flex-between" style="width: 165rpx;font-size: 29rpx;"> goodItem.Specifications_money / 100
<view :class="['jian', goodItem.num == 1 ? 'zhihui' : '']" @click="delNum(goodItem)">- }}</view>
<view class="quantity-control">
<view
:class="[
'quantity-btn',
'minus-btn',
goodItem.num == 1 ? 'disabled' : '',
]"
@click="delNum(goodItem)"
>
-
</view>
<view class="quantity-input">{{ goodItem.num }}</view>
<view class="quantity-btn plus-btn" @click="addNum(goodItem)">
+
</view> </view>
<view>{{goodItem.num}}</view>
<view class="jia" @click="addNum(goodItem)">+</view>
</view> </view>
</view> </view>
</view> </view>
@ -30,13 +65,24 @@
</view> </view>
<view class="loseGood" v-if="loseList && loseList.length > 0"> <view class="loseGood" v-if="loseList && loseList.length > 0">
<view class="title flex-between">失效商品<span @click="delLoseGood('',1)">清空失效商品</span></view> <view class="title flex-between"
<view class="goodItem" v-for="(goodItem,goodIndex) in loseList" :key="goodIndex"> >失效商品<span @click="delLoseGood('', 1)">清空失效商品</span></view
>
<view
class="goodItem"
v-for="(goodItem, goodIndex) in loseList"
:key="goodIndex"
>
<view class="noSelect"></view> <view class="noSelect"></view>
<image :src="showImg(goodItem.specifications_image)" mode="aspectFill"></image> <image
:src="showImg(goodItem.specifications_image)"
mode="aspectFill"
></image>
<view class="contentBox"> <view class="contentBox">
<view class="title text-overflow">{{ goodItem.good_name }}</view> <view class="title text-overflow">{{ goodItem.good_name }}</view>
<view class="subTitle text-overflow">{{goodItem.Specifications_name}}</view> <view class="subTitle text-overflow">{{
goodItem.Specifications_name
}}</view>
<view class="priceBox flex-between"> <view class="priceBox flex-between">
<view class="price">{{ goodItem.Specifications_money / 100 }}</view> <view class="price">{{ goodItem.Specifications_money / 100 }}</view>
<view class="btn" @click="delLoseGood(goodItem.id, 0)">删除</view> <view class="btn" @click="delLoseGood(goodItem.id, 0)">删除</view>
@ -59,8 +105,16 @@
<view class="btn" @click="delGood" v-else>删除</view> <view class="btn" @click="delGood" v-else>删除</view>
</view> </view>
<view class="noProduct" v-if="list.length == 0 && loseList.length == 0"> <!-- 空状态 -->
暂无商品 <view class="empty-state" v-if="list.length == 0 && loseList.length == 0">
<image
class="empty-icon"
:src="showImg('/uploads/20250826/empty-cart.png')"
mode="aspectFit"
></image>
<text class="empty-title">购物车空空如也</text>
<text class="empty-desc">快去挑选心仪的商品吧</text>
<view class="empty-btn" @click="goShopping">去逛逛</view>
</view> </view>
</view> </view>
</template> </template>
@ -69,166 +123,278 @@
export default { export default {
data() { data() {
return { return {
operate: '管理', operate: "管理",
list: [], list: [],
loseList: [], loseList: [],
allSelect: false, allSelect: false,
} };
}, },
onShow() { onShow() {
this.getShoppingList() this.getShoppingList();
this.allSelect = false this.allSelect = false;
}, },
methods: { methods: {
getShoppingList() { getShoppingList() {
this.Post({ this.Post(
{
is_post: 1, is_post: 1,
// lon: this.$store.state.user.location.lon || '120.63132', // lon: this.$store.state.user.location.lon || '120.63132',
// lat: this.$store.state.user.location.lat || '31.30227' // lat: this.$store.state.user.location.lat || '31.30227'
}, '/api/shopping/getShoppingList').then(res => { },
this.list = res.data.merchant "/api/shopping/getShoppingList"
this.loseList = [] )
this.list.forEach(item => { .then((res) => {
item.data.forEach(items => { this.list = res.data.merchant || [];
this.loseList = [];
this.list.forEach((item) => {
if (item.data && item.data.length > 0) {
item.data.forEach((items) => {
if (items.flag === 0) { if (items.flag === 0) {
this.loseList.push(items) this.loseList.push(items);
} }
});
}) }
}) });
console.log('打印', this.loseList); console.log("购物车数据更新:", this.list);
console.log("失效商品:", this.loseList);
}) })
.catch((err) => {
console.error("获取购物车数据失败:", err);
this.list = [];
this.loseList = [];
});
}, },
// //
guanli() { guanli() {
if (this.operate == '管理') { if (this.operate == "管理") {
this.operate = '退出管理' this.operate = "退出管理";
} else { } else {
this.operate = '管理' this.operate = "管理";
} }
console.log(this.operate) console.log(this.operate);
}, },
delNum(item) { delNum(item) {
if (item.num <= 1) { if (item.num <= 1) {
item.num = 1 item.num = 1;
uni.showToast({ uni.showToast({
title: '已经最少了,不能再减了', title: "已经最少了,不能再减了",
icon: 'none' icon: "none",
}) });
} else { } else {
item.num -= 1 item.num -= 1;
this.updateCart(item) this.updateCart(item);
} }
}, },
addNum(item) { addNum(item) {
item.num += 1 item.num += 1;
this.updateCart(item) this.updateCart(item);
}, },
updateCart(item) { updateCart(item) {
let that = this let that = this;
that.Post({ that
.Post(
{
s_id: item.id, s_id: item.id,
num: item.num num: item.num,
}, '/api/shopping/updateShopping').then(function(res) { },
"/api/shopping/updateShopping"
)
.then(function (res) {
if (res) { if (res) {
// that.$toast.clear() // that.$toast.clear()
} }
}) });
}, },
// //
changeSelect(item) { changeSelect(item) {
item.is_select = !item.is_select item.is_select = !item.is_select;
this.list.forEach(item => { this.list.forEach((item) => {
let checkAll = item.data.findIndex(items => { let checkAll = item.data.findIndex((items) => {
return !items.is_select return !items.is_select;
}) });
if (checkAll == -1) { if (checkAll == -1) {
this.allSelect = true this.allSelect = true;
} else { } else {
this.allSelect = false this.allSelect = false;
} }
}) });
this.$forceUpdate() this.$forceUpdate();
}, },
// //
goDetails(id) { goDetails(id) {
uni.navigateTo({ uni.navigateTo({
url: '/subPackages/techan/detail?id=' + id url: "/subPackages/techan/detail?id=" + id,
});
},
//
goShopping() {
uni.switchTab({
url: "/pages/index/timeShopBank",
}); });
}, },
// //
changeAllSelect() { changeAllSelect() {
this.allSelect = !this.allSelect this.allSelect = !this.allSelect;
this.list.forEach(item => { this.list.forEach((item) => {
item.data.forEach(items => { item.data.forEach((items) => {
if (this.allSelect) items.is_select = true if (this.allSelect) items.is_select = true;
else items.is_select = false else items.is_select = false;
}) });
}) });
}, },
// //
delLoseGood(id, index) { delLoseGood(id, index) {
if (index == 0) { if (index == 0) {
this.Post({ //
s_id: id uni.showModal({
}, '/api/shopping/delShopping').then(res => { title: "确认删除",
this.getShoppingList() content: "确定要删除这个失效商品吗?",
this.$forceUpdate() success: (res) => {
if (res.confirm) {
this.Post(
{
s_id: id,
},
"/api/shopping/delShopping"
)
.then((res) => {
uni.showToast({
title: "删除成功",
icon: "success",
});
//
setTimeout(() => {
this.getShoppingList();
}, 100);
}) })
.catch((err) => {
console.error("删除失效商品失败:", err);
uni.showToast({
title: "删除失败",
icon: "none",
});
});
}
},
});
} else { } else {
let ids = [] //
this.loseList.forEach(item => { uni.showModal({
ids.push(item.id) title: "确认清空",
}) content: `确定要清空所有失效商品吗?`,
this.Post({ success: (res) => {
s_id: ids.toString() if (res.confirm) {
}, '/api/shopping/delShopping').then(res => { let ids = [];
this.getShoppingList() this.loseList.forEach((item) => {
this.$forceUpdate() ids.push(item.id);
});
this.Post(
{
s_id: ids.toString(),
},
"/api/shopping/delShopping"
)
.then((res) => {
uni.showToast({
title: "清空成功",
icon: "success",
});
//
setTimeout(() => {
this.getShoppingList();
}, 100);
}) })
.catch((err) => {
console.error("清空失效商品失败:", err);
uni.showToast({
title: "清空失败",
icon: "none",
});
});
}
},
});
} }
}, },
// //
delGood() { delGood() {
let ids = [] let ids = [];
this.list.forEach(item => { this.list.forEach((item) => {
item.data.forEach(items => { if (item.data && item.data.length > 0) {
item.data.forEach((items) => {
if (items.is_select == true) { if (items.is_select == true) {
ids.push(items.id) ids.push(items.id);
} }
});
}
});
if (ids.length === 0) {
uni.showToast({
title: "请选择要删除的商品",
icon: "none",
});
return;
}
uni.showModal({
title: "确认删除",
content: `确定要删除选中的${ids.length}件商品吗?`,
success: (res) => {
if (res.confirm) {
this.Post(
{
s_id: ids.toString(),
},
"/api/shopping/delShopping"
)
.then((res) => {
uni.showToast({
title: "删除成功",
icon: "success",
});
//
setTimeout(() => {
this.getShoppingList();
}, 100);
this.operate = "管理"; // 退
}) })
}) .catch((err) => {
this.Post({ console.error("删除失败:", err);
s_id: ids.toString() uni.showToast({
}, '/api/shopping/delShopping').then(res => { title: "删除失败",
this.getShoppingList() icon: "none",
this.$forceUpdate() });
}) });
}
},
});
}, },
// //
getAllPrice() { getAllPrice() {
let allPrice = 0 let allPrice = 0;
this.list.forEach(item => { this.list.forEach((item) => {
item.data.forEach(items => { item.data.forEach((items) => {
if (items.is_select == true) { if (items.is_select == true) {
allPrice += items.Specifications_money * items.num allPrice += items.Specifications_money * items.num;
} }
}) });
}) });
return (allPrice / 100).toFixed(2) return (allPrice / 100).toFixed(2);
}, },
// //
order() { order() {
let list = [] let list = [];
let ids = [] let ids = [];
this.list.forEach(item => { this.list.forEach((item) => {
item.data.forEach((items, index) => { item.data.forEach((items, index) => {
if (items.is_select == true) { if (items.is_select == true) {
ids.push(items.merchant_id) ids.push(items.merchant_id);
list.push(items) list.push(items);
} }
}) });
}) });
// if (Array.from(new Set(ids)).length > 1) { // if (Array.from(new Set(ids)).length > 1) {
// uni.showToast({ // uni.showToast({
// title: '', // title: '',
@ -238,19 +404,19 @@
// } // }
if (list.length == 0) { if (list.length == 0) {
uni.showToast({ uni.showToast({
title: '请选择商品', title: "请选择商品",
icon: 'none' icon: "none",
}) });
return; return;
} }
console.log('list参数', list); console.log("list参数", list);
this.$store.commit("changeOrderSCart", list) this.$store.commit("changeOrderSCart", list);
// this.gotoPath('/subPackages/order/eCartOrder') // this.gotoPath('/subPackages/order/eCartOrder')
this.gotoPath('/subPackages/order/gwcOrder') this.gotoPath("/subPackages/order/gwcOrder");
// this.gotoPath('/subPackages/goods/goodsOrder') // this.gotoPath('/subPackages/goods/goodsOrder')
} },
} },
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -259,7 +425,7 @@
min-height: 100vh; min-height: 100vh;
padding: 0 27rpx 200rpx; padding: 0 27rpx 200rpx;
box-sizing: border-box; box-sizing: border-box;
background-color: #F8F8F8; background-color: #f8f8f8;
} }
.guanli { .guanli {
@ -267,15 +433,23 @@
text-align: right; text-align: right;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 500;
color: #000000; color: #6ca5aa;
line-height: 76rpx; line-height: 76rpx;
padding: 0 20rpx;
border-radius: 20rpx;
transition: all 0.3s ease;
&:active {
background: rgba(108, 165, 170, 0.1);
transform: scale(0.95);
}
} }
.goodBox { .goodBox {
width: 697rpx; width: 697rpx;
height: auto; height: auto;
background: #FFFFFF; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
margin: 0 auto 27rpx; margin: 0 auto 27rpx;
padding: 25rpx 20rpx; padding: 25rpx 20rpx;
@ -340,7 +514,7 @@
font-size: 27rpx; font-size: 27rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #7C7C7C; color: #7c7c7c;
margin-top: 13rpx; margin-top: 13rpx;
} }
@ -351,7 +525,7 @@
font-size: 40rpx; font-size: 40rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FF2D3B; color: #ff2d3b;
} }
.price:before { .price:before {
@ -359,15 +533,57 @@
font-size: 27rpx; font-size: 27rpx;
} }
.jian, .quantity-control {
.jia { display: flex;
width: 47rpx; align-items: center;
height: 47rpx; border: 2rpx solid #e5e5e5;
background: #6CA5AA; border-radius: 25rpx;
border-radius: 50%; overflow: hidden;
text-align: center;
color: #FFFFFF; .quantity-btn {
line-height: 47rpx; width: 60rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
background: #f8f9fa;
transition: all 0.3s ease;
&.minus-btn {
border-right: 1rpx solid #e5e5e5;
}
&.plus-btn {
border-left: 1rpx solid #e5e5e5;
}
&.disabled {
background: #f1f1f1;
color: #ccc;
}
&:not(.disabled):active {
background: #e9ecef;
}
font-size: 50rpx;
font-weight: 500;
color: #333;
.btn-text {
}
}
.quantity-input {
width: 80rpx;
height: 50rpx;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
font-size: 28rpx;
color: #333;
font-weight: 500;
}
} }
} }
} }
@ -377,7 +593,7 @@
.loseGood { .loseGood {
width: 697rpx; width: 697rpx;
height: auto; height: auto;
background: #FFFFFF; background: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
margin: 0 auto 27rpx; margin: 0 auto 27rpx;
padding: 25rpx 20rpx; padding: 25rpx 20rpx;
@ -393,7 +609,7 @@
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #2791F7; color: #2791f7;
} }
} }
@ -408,8 +624,8 @@
width: 37rpx; width: 37rpx;
height: 37rpx; height: 37rpx;
border-radius: 50%; border-radius: 50%;
border: 2rpx solid #CCCCCC; border: 2rpx solid #cccccc;
background: #F1F1F1; background: #f1f1f1;
box-sizing: border-box; box-sizing: border-box;
margin-right: 25rpx; margin-right: 25rpx;
margin-top: 68rpx; margin-top: 68rpx;
@ -462,26 +678,66 @@
font-size: 29rpx; font-size: 29rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
} }
} }
} }
} }
} }
.noProduct { /* 空状态样式 */
width: 100%; .empty-state {
height: 300rpx; display: flex;
text-align: center; flex-direction: column;
line-height: 300rpx; align-items: center;
color: #999999; justify-content: center;
font-size: 32rpx; padding: 200rpx 0;
.empty-icon {
width: 200rpx;
height: 200rpx;
margin-bottom: 40rpx;
opacity: 0.6;
}
.empty-title {
font-size: 36rpx;
color: #333;
font-weight: 500;
margin-bottom: 20rpx;
}
.empty-desc {
font-size: 28rpx;
color: #999;
margin-bottom: 60rpx;
}
.empty-btn {
width: 240rpx;
height: 80rpx;
background: #6ca5aa;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 30rpx;
font-weight: 500;
box-shadow: 0 8rpx 20rpx rgba(108, 165, 170, 0.3);
transition: all 0.3s ease;
&:active {
transform: scale(0.95);
box-shadow: 0 4rpx 10rpx rgba(108, 165, 170, 0.2);
}
}
} }
.orderBox { .orderBox {
width: 750rpx; width: 750rpx;
height: 151rpx; height: 151rpx;
background: #FFFFFF; background: #ffffff;
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
padding: 0 27rpx; padding: 0 27rpx;
box-sizing: border-box; box-sizing: border-box;
@ -508,7 +764,7 @@
font-size: 36rpx; font-size: 36rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FF2D3B; color: #ff2d3b;
margin-top: -5rpx; margin-top: -5rpx;
} }
@ -538,19 +794,48 @@
.btn { .btn {
width: 219rpx; width: 219rpx;
height: 77rpx; height: 77rpx;
background: #6CA5AA; background: #6ca5aa;
border-radius: 39rpx; border-radius: 39rpx;
text-align: center; text-align: center;
line-height: 77rpx; line-height: 77rpx;
font-size: 33rpx; font-size: 33rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
} }
} }
/* 移除旧的样式 */
.zhihui { .zhihui {
background: #E8E8E8 !important; background: #e8e8e8 !important;
color: #999999 !important; color: #999999 !important;
} }
/* 优化商品卡片样式 */
.goodBox {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
&:hover {
transform: translateY(-2rpx);
box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.12);
}
}
/* 优化选择框样式 */
.noSelect {
transition: all 0.3s ease;
&:active {
transform: scale(0.9);
}
}
.selectBox {
transition: all 0.3s ease;
&:active {
transform: scale(0.9);
}
}
</style> </style>
Loading…
Cancel
Save