Browse Source

数据替换

dev_des
1054425342@qq.com 2 months ago
parent
commit
94e34bd3e8
  1. 31
      components/CustomTabBar.vue
  2. 22
      components/DynamicIsland.vue
  3. 90
      components/ProductSection.vue
  4. 14
      pages/index/index.vue
  5. 4
      static/js/request.js

31
components/CustomTabBar.vue

@ -1,17 +1,22 @@
<template> <template>
<view class="custom-tab-bar"> <view class="">
<view <!-- <view class="" style="width: 100%;height: 130rpx;">
class="tab-item"
v-for="(item, i) in tabBarList" </view> -->
:key="i" <view class="custom-tab-bar">
v-if="tabBarShowList[i]" <view
@click="switchTab(i)" class="tab-item"
> v-for="(item, i) in tabBarList"
<text :style="{ color: currentTab === i ? item.selectColor : '#fff' }">{{ :key="i"
item.text v-if="tabBarShowList[i]"
}}</text> @click="switchTab(i)"
</view> >
</view> <text :style="{ color: currentTab === i ? item.selectColor : '#fff' }">{{
item.text
}}</text>
</view>
</view>
</view>
</template> </template>
<script> <script>

22
components/DynamicIsland.vue

@ -23,10 +23,10 @@
<!-- 左侧欢迎信息 --> <!-- 左侧欢迎信息 -->
<view class="left-section"> <view class="left-section">
<view class="welcome-message"> <view class="welcome-message">
<text class="welcome-text" <view class="welcome-text"
>Hi!{{ >Hi!{{
userInfo && userInfo.token ? userInfo.nickname : "用户" userInfo && userInfo.token ? userInfo.nickname : "用户"
}}</text }}</view
> >
<text class="welcome-subtitle">欢迎回来~</text> <text class="welcome-subtitle">欢迎回来~</text>
</view> </view>
@ -440,7 +440,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
padding: 24rpx 20rpx; padding: 24rpx 25rpx;
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
transition: opacity 0.2s ease-in 0.1s, visibility 0s linear 0s; transition: opacity 0.2s ease-in 0.1s, visibility 0s linear 0s;
@ -484,6 +484,10 @@ export default {
color: #000000; color: #000000;
font-weight: bold; font-weight: bold;
line-height: 1.2; line-height: 1.2;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 140rpx;
} }
.welcome-subtitle { .welcome-subtitle {
@ -530,8 +534,7 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
align-items: flex-start; align-items: flex-start;
padding: 0 10rpx; width: 137rpx;
width: 160rpx;
} }
.time-reward-title { .time-reward-title {
@ -569,7 +572,7 @@ export default {
.right-section { .right-section {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
width: 375rpx; width: 320rpx;
} }
.avatar-container { .avatar-container {
@ -620,6 +623,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
flex: 1; flex: 1;
color: #000000;
} }
.stats-section { .stats-section {
@ -637,7 +641,7 @@ export default {
.stat-number { .stat-number {
font-size: 32rpx; font-size: 32rpx;
color: #ffffff; color: #000000;
font-weight: bold; font-weight: bold;
line-height: 1; line-height: 1;
margin-bottom: 4rpx; margin-bottom: 4rpx;
@ -645,7 +649,7 @@ export default {
.stat-label { .stat-label {
font-size: 28rpx; font-size: 28rpx;
color: white; color: #000000;
line-height: 1; line-height: 1;
font-weight: bold; font-weight: bold;
margin-top: 20rpx; margin-top: 20rpx;
@ -757,7 +761,7 @@ export default {
// } // }
// } // }
.action-text-box { .action-text-box {
color: white; color: #000000;
.action-text-box-des { .action-text-box-des {
font-size: 20rpx; font-size: 20rpx;

90
components/ProductSection.vue

@ -1,10 +1,10 @@
<template> <template>
<view class="product-section"> <view class="product-section" :style="{'background-color':color}">
<!-- 商品标题区域 --> <!-- 商品标题区域 -->
<view class="title-section" :style="{ background: titleBgColor }"> <view class="title-section" >
<div style="display: flex; align-items: center" @click="handleMoreClick"> <div style="display: flex; align-items: center;justify-content: space-between;" @click="handleMoreClick">
<text class="title">{{ title }}</text> <text class="title">{{ title }}</text>
<text class="more-btn">更多</text> <view class="more-btn">更多 <uni-icons size="16" color="#000000" type="arrowright" /></view>
</div> </div>
</view> </view>
@ -26,6 +26,12 @@
<view class="image-overlay" v-if="!isFeel"></view> <view class="image-overlay" v-if="!isFeel"></view>
<!-- 智能体标签 --> <!-- 智能体标签 -->
<view class="content-box-info" v-if="!isFeel&&item.agent"> <view class="content-box-info" v-if="!isFeel&&item.agent">
<!-- 头像 -->
<image
class="avatar"
:src="showImg(item.agent.headImage)"
mode="aspectFill"
></image>
<view class="ai-tag"> <view class="ai-tag">
<view <view
class="ai-label" class="ai-label"
@ -35,20 +41,15 @@
}" }"
>智能体</view >智能体</view
> >
<text class="ai-name">{{ item.agent.name }}</text>
</view> </view>
<!-- 头像 --> <view class="ai-name">{{ item.agent.name }}</view>
<image
class="avatar"
:src="showImg(item.agent.headImage)"
mode="aspectFill"
></image>
</view> </view>
</view> </view>
<view class="card-content"> <view class="card-content">
<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>
<image <image
v-if="!item.type" v-if="!item.type"
class="heart-icon" class="heart-icon"
@ -125,6 +126,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
color: {
type: String,
default: "#D3FCFF",
},
}, },
methods: { methods: {
@ -194,23 +199,28 @@ export default {
} }
.product-section { .product-section {
width: 100%; width: 100%;
background-color: #D3FCFF;
padding:40rpx 25rpx;
margin: 30rpx 0;
border-radius: 40rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1),
0 0 0 1rpx rgba(255, 255, 255, 0.2) inset;
} }
// //
.title-section { .title-section {
padding: 14rpx 24rpx 8rpx;
margin: 40rpx 16rpx 0rpx;
display: inline-block; display: inline-block;
border-radius: 14rpx 14rpx 0 0; padding: 0rpx 0 30rpx;
width: 100%;
.title { .title {
font-size: 36rpx; font-size: 34rpx;
font-weight: 500; font-weight: bold;
color: #4d4d4d; color: #000000;
} }
.more-btn { .more-btn {
font-size: 20rpx; font-size: 26rpx;
color: #999999; color: #000000;
margin-left: 35rpx; margin-left: 35rpx;
} }
} }
@ -220,16 +230,14 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24rpx; gap: 24rpx;
background-color: white;
padding: 22rpx;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08);
} }
// //
.product-card { .product-card {
background: #ffffff; background: #ffffff;
border-radius: 24rpx; border-radius: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1),
0 0 0 1rpx rgba(255, 255, 255, 0.2) inset;
overflow: hidden; overflow: hidden;
transition: transform 0.2s ease; transition: transform 0.2s ease;
@ -241,16 +249,16 @@ export default {
// //
.card-image-container { .card-image-container {
position: relative; position: relative;
height: 200rpx; height: 320rpx;
overflow: hidden; overflow: hidden;
border-radius: 20rpx; border-radius: 20rpx 20rpx 0 0 ;
} }
.card-image { .card-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
border-radius: 20rpx; border-radius: 20rpx 20rpx 0 0 ;
} }
// //
@ -268,26 +276,23 @@ export default {
// //
.content-box-info { .content-box-info {
position: absolute; position: absolute;
top: 0rpx; top: 30rpx;
left: 0rpx; right: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
width: 666rpx;
padding: 0rpx 20rpx; padding: 0rpx 20rpx;
text-align: center;
} }
.ai-tag { .ai-tag {
padding: 8rpx 0rpx; padding: 8rpx 0rpx;
display: flex;
align-items: center;
gap: 8rpx; gap: 8rpx;
.ai-label {
}
.ai-label {
border: 1rpx solid; border: 1rpx solid;
padding: 0rpx 15rpx; padding: 0rpx 15rpx;
height: 40rpx; height: 40rpx;
line-height: 38rpx; line-height: 38rpx;
font-weight: bold; font-weight: bold;
font-size: 16rpx; font-size: 20rpx;
border-radius: 4rpx; border-radius: 4rpx;
} }
@ -297,8 +302,6 @@ export default {
color: #ffffff; color: #ffffff;
margin-left: 10rpx; margin-left: 10rpx;
} }
}
// //
.avatar { .avatar {
width: 119rpx; width: 119rpx;
@ -308,8 +311,7 @@ export default {
// //
.card-content { .card-content {
padding: 24rpx 0; padding: 18rpx;
padding-bottom: 0;
} }
.title-price-heart { .title-price-heart {
@ -320,8 +322,7 @@ export default {
} }
.card-title { .card-title {
font-size: 27rpx; font-size: 30rpx;
font-weight: bold;
color: #000000; color: #000000;
line-height: 1.4; line-height: 1.4;
flex: 1; flex: 1;
@ -332,8 +333,7 @@ export default {
} }
.card-price { .card-price {
font-size: 36rpx; font-size: 30rpx;
font-weight: bold;
color: #000000; color: #000000;
margin-right: 24rpx; margin-right: 24rpx;
flex-shrink: 0; flex-shrink: 0;

14
pages/index/index.vue

@ -20,23 +20,25 @@
<!-- 权益商品区域 --> <!-- 权益商品区域 -->
<ProductSection <ProductSection
v-show="productList.length" v-show="productList.length"
title="权益商品" title="EPIC SOUL文旅权益商品"
:productList="productList" :productList="productList"
moreUrl="/subPackages/equityGoods/index" moreUrl="/subPackages/equityGoods/index"
detailUrlPrefix="/subPackages/equityGoods/detail" detailUrlPrefix="/subPackages/equityGoods/detail"
@like-toggle="handleLikeToggle" @like-toggle="handleLikeToggle"
color="#D2FFDE"
/> />
<ProductSection <ProductSection
titleBgColor="#92FF8F" titleBgColor="#92FF8F"
aiTagTextColor="#08FB05" aiTagTextColor="#08FB05"
aiTagBorderColor="#6EAA3D" aiTagBorderColor="#6EAA3D"
title="有感商品" title="EPIC SOUL文化有感商品"
:productList="productListFeeling" :productList="productListFeeling"
moreUrl="/pages/index/sensoryStore" moreUrl="/pages/index/sensoryStore"
detailUrlPrefix="/subPackages/techan/detail" detailUrlPrefix="/subPackages/techan/detail"
@like-toggle="handleLikeToggle" @like-toggle="handleLikeToggle"
isFeel isFeel
color="#D3FCFF"
/> />
<view class="tab-bar-placeholder"></view> <view class="tab-bar-placeholder"></view>
</view> </view>
@ -94,8 +96,8 @@ export default {
{ {
id: 34, id: 34,
image: image:
"https://epic.js-dyyj.com/uploads/20250728/22e319f3feb1b63fbb539d425c51fe70.png", "https://epic.js-dyyj.com/uploads/20250822/f0ade3dd98a5a5e24ed0b60a023979e4.png",
title: "OUT OF SPACE 东方线香", title: "中国神仙IP系列 丝织品",
price: "138.00", price: "138.00",
isLiked: true, isLiked: true,
isShop: true, isShop: true,
@ -103,8 +105,8 @@ export default {
{ {
id: 32, id: 32,
image: image:
"https://epic.js-dyyj.com/uploads/20250728/cc9907153c887a6428283a407928db9a.png", "https://epic.js-dyyj.com/uploads/20250822/19b1fb3e07fd459d347e727274af445c.png",
title: "AI-Agent智能玩具", title: "仙人乘槎 马克杯",
price: "398.00", price: "398.00",
isLiked: false, isLiked: false,
}, },

4
static/js/request.js

@ -7,8 +7,8 @@ const DEV_API_URL = 'https://epic.js-dyyj.com';
// const PROD_API_URL = 'https://epic.js-dyyj.com'; // const PROD_API_URL = 'https://epic.js-dyyj.com';
const PROD_API_URL = 'https://epic.new.js-dyyj.com'; const PROD_API_URL = 'https://epic.new.js-dyyj.com';
const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL; const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL;
const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx'; // const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx';
// const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx'; const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx';
const PROD_API_URL_DES = 'https://des.js-dyyj.com/xcx'; const PROD_API_URL_DES = 'https://des.js-dyyj.com/xcx';
const NEWAPIURL_DES = process.env.NODE_ENV === 'development' ? DEV_API_URL_DES : PROD_API_URL_DES; const NEWAPIURL_DES = process.env.NODE_ENV === 'development' ? DEV_API_URL_DES : PROD_API_URL_DES;
const getToken = () => { const getToken = () => {

Loading…
Cancel
Save