Browse Source

feat:首页静态

dev_des
1054425342@qq.com 3 months ago
parent
commit
402de12fb7
  1. 36
      components/DynamicIsland.vue
  2. 11
      components/ProductSection.vue
  3. 12
      pages/index/index.vue

36
components/DynamicIsland.vue

@ -19,9 +19,7 @@
<view class="top-section">
<text class="welcome-text">{{ title }}</text>
<view class="qr-code">
<view class="qr-icon">
<image style="width: 39rpx;height: 39rpx;" src="https://epic.js-dyyj.com/uploads/20250728/ce88153acc92e0e2fca7acaa4ccec5c1.png"></image>
</view>
<image style="width: 39rpx;height: 39rpx;" src="https://epic.js-dyyj.com/uploads/20250728/88e0991e58e692c86c25e42537edc6ca.png"></image>
</view>
</view>
<view class="bottom-section">
@ -70,7 +68,7 @@ export default {
},
title: {
type: String,
default: "正在播放音乐",
default: "用户",
},
subtitle: {
type: String,
@ -92,10 +90,11 @@ export default {
isScrolled: false,
scrollThreshold: 160, // 160rpx
// props
currentTitle: "Hi!杰西卡酱,欢迎回来~",
currentTitle: "Hi!用户,欢迎回来~",
currentSubtitle: "2个权益 | 120时间银行",
currentAvatar: "https://picsum.photos/80/80",
currentAction: "激活你的Agent",
userInfo: {},
};
},
computed: {
@ -143,6 +142,8 @@ export default {
this.setStatusBarHeight();
//
this.addScrollListener();
//
this.getUserInfo();
},
beforeDestroy() {
//
@ -199,9 +200,11 @@ export default {
}
},
getCompactName() {
//
return "杰西卡酱";
//
if (this.userInfo && this.userInfo.nickname) {
return this.userInfo.nickname;
}
return "用户";
},
getStatNumber(type) {
//
@ -226,6 +229,19 @@ export default {
this.statusBarHeight = 0;
}
},
//
getUserInfo() {
try {
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {};
//
if (this.userInfo && this.userInfo.nickname) {
this.currentTitle = `Hi!${this.userInfo.nickname},欢迎回来~`;
}
} catch (e) {
console.warn("获取用户信息失败:", e);
this.userInfo = {};
}
},
},
};
</script>
@ -329,9 +345,7 @@ export default {
.qr-code {
width: 32rpx;
height: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.qr-icon {

11
components/ProductSection.vue

@ -23,7 +23,7 @@
mode="aspectFill"
></image>
<!-- 图片蒙层 -->
<view class="image-overlay"></view>
<view class="image-overlay" v-if="!isFeel"></view>
<!-- 智能体标签 -->
<view class="content-box-info" v-if="!isFeel">
<view class="ai-tag">
@ -41,7 +41,7 @@
<view class="card-content">
<view class="title-price-heart">
<view class="card-title">{{ item.title }}</view>
<view class="card-price">¥{{ item.price }}</view>
<view class="card-price">{{ item.price }}</view>
<image
v-if="!item.isLiked"
class="heart-icon"
@ -174,6 +174,10 @@ export default {
</script>
<style lang="scss" scoped>
@font-face {
font-family: 'Futura';
src: url(https://static.ticket.sz-trip.com/epicSoul/taozi/fonts/Futura.ttc);
}
.product-section {
width: 100%;
}
@ -315,10 +319,11 @@ export default {
.card-price {
font-size: 36rpx;
font-weight: bold;
color: #ff6b6b;
color: #000000;
margin-right: 24rpx;
flex-shrink: 0;
min-width: 120rpx;
font-family: Futura;
}
.heart-icon {

12
pages/index/index.vue

@ -91,10 +91,7 @@ export default {
{
id: 1,
image:
"https://epic.js-dyyj.com/uploads/20250728/58aed304917c9d60761f833c4f8dceb8.png",
avatar:
"https://epic.js-dyyj.com/uploads/20250728/d27ef6e6c26877da7775664fed376c6f.png",
aiName: "文徵明",
"https://epic.js-dyyj.com/uploads/20250728/22e319f3feb1b63fbb539d425c51fe70.png",
title: "OUT OF SPACE 东方线香",
price: "588.00",
isLiked: true,
@ -103,10 +100,7 @@ export default {
{
id: 2,
image:
"https://epic.js-dyyj.com/uploads/20250728/00e8704b23a0c9fd57023527146211b9.png",
avatar:
"https://epic.js-dyyj.com/uploads/20250728/d7bf0dd2f3f272afba687b525a7c575c.png",
aiName: "苏青壳",
"https://epic.js-dyyj.com/uploads/20250728/cc9907153c887a6428283a407928db9a.png",
title: "AI-Agent智能玩具",
price: "398.00",
isLiked: false,
@ -227,7 +221,7 @@ export default {
width: 100%;
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 30rpx;
margin-top: 20rpx;
}
.tab-bar-placeholder {

Loading…
Cancel
Save