|
|
@@ -67,14 +67,15 @@
|
|
|
</view>
|
|
|
<view class="products-container">
|
|
|
<!-- 使用网络图片作为书的封面占位 -->
|
|
|
- <image v-for="(item, index) in bookList" :key="index" :src="item.imgUrl" class="product-cover" mode="aspectFill" @click="navigateTo(item.jumpUrl)"></image>
|
|
|
+ <image v-for="(item, index) in bookList" :key="index" :src="item.imgUrl" class="product-cover"
|
|
|
+ mode="aspectFill" @click="navigateTo(item.jumpUrl)"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 健康与成长双卡片 -->
|
|
|
<view class="info-dual-card">
|
|
|
- <swiper class="info-card-swiper" :autoplay="true" :interval="3000" :circular="true" >
|
|
|
+ <swiper class="info-card-swiper" :autoplay="true" :interval="3000" :circular="true">
|
|
|
<swiper-item v-for="(item, index) in leftBookList" :key="index">
|
|
|
<view class="info-card bg-orange" @click="navigateTo(item.jumpUrl)">
|
|
|
<view class="info-text-group">
|
|
|
@@ -113,9 +114,10 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 书嗨推荐 -->
|
|
|
- <view class="recommend-section" @click="navigateTo(item.jumpUrl)" v-for="(item, index) in topicList" :key="index">
|
|
|
+ <view class="recommend-section" @click="navigateTo(item.jumpUrl)" v-for="(item, index) in topicList"
|
|
|
+ :key="index">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">{{item.showCateName}}</text>
|
|
|
+ <text class="section-title">{{ item.showCateName }}</text>
|
|
|
<view class="view-more">
|
|
|
<text>查看全部</text>
|
|
|
<image src="/pages-sell/static/right-arrow.png" class="arrow-icon" mode="widthFix"></image>
|
|
|
@@ -123,7 +125,8 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="book-list">
|
|
|
- <view class="book-item" v-for="(book, index) in getDisplayBooks(item)" :key="index" @click="navigateTo('/pages-sell/pages/detail?isbn=' + book.bookIsbn)">
|
|
|
+ <view class="book-item" v-for="(book, index) in getDisplayBooks(item)" :key="index"
|
|
|
+ @click="navigateTo('/pages-sell/pages/detail?isbn=' + book.bookIsbn)">
|
|
|
<image :src="book.bookImg" class="book-image" mode="aspectFill"></image>
|
|
|
<text class="book-name">{{ book.bookName }}</text>
|
|
|
<view class="price-row">
|
|
|
@@ -138,7 +141,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 底部留白,防止遮挡 -->
|
|
|
<view class="bottom-safe-area"></view>
|
|
|
</view>
|
|
|
@@ -179,9 +182,9 @@
|
|
|
{ title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' },
|
|
|
{ title: '山河岁月', price: '6.80', original: '36.80', cover: 'https://img.yzcdn.cn/vant/cat.jpeg' }
|
|
|
],
|
|
|
- topicList:[], //专题推荐
|
|
|
- leftBookList:[], // 左侧推荐书籍
|
|
|
- rightBookList:[] // 右侧推荐书籍
|
|
|
+ topicList: [], //专题推荐
|
|
|
+ leftBookList: [], // 左侧推荐书籍
|
|
|
+ rightBookList: [] // 右侧推荐书籍
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -192,7 +195,7 @@
|
|
|
},
|
|
|
methods: {
|
|
|
handleCategory(item) {
|
|
|
- if(!item.jumpUrl) return
|
|
|
+ if (!item.jumpUrl) return
|
|
|
this.navigateTo(item.jumpUrl)
|
|
|
},
|
|
|
changeHotTag(index) {
|
|
|
@@ -201,15 +204,33 @@
|
|
|
},
|
|
|
//跳转 URL
|
|
|
navigateTo(url) {
|
|
|
- if(!url) return
|
|
|
+ if (!url) return
|
|
|
console.log(url)
|
|
|
uni.navigateTo({
|
|
|
url: url
|
|
|
});
|
|
|
},
|
|
|
navigateToOfficialAccount() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages-mine/pages/customer-service'
|
|
|
+ // 打开公众号
|
|
|
+ uni.getProvider({
|
|
|
+ service: "oauth",
|
|
|
+ success: function (res) {
|
|
|
+ if (res.provider.includes("weixin")) {
|
|
|
+ // 调用微信小程序的 wx.openOfficialAccountProfile
|
|
|
+ wx.openOfficialAccountProfile({
|
|
|
+ username: "bookersea",
|
|
|
+ success: function (res) {
|
|
|
+ console.log("打开公众号资料页成功", res);
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ console.log("打开公众号资料页失败", err);
|
|
|
+ },
|
|
|
+ complete: function () {
|
|
|
+ console.log("接口调用结束");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
|