|
@@ -9,32 +9,40 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- Book Info -->
|
|
<!-- Book Info -->
|
|
|
- <view class="book-info">
|
|
|
|
|
- <image :src="item.cover" class="book-cover" mode="aspectFill"></image>
|
|
|
|
|
|
|
+ <view class="book-info" @click.stop="navigateToDetail">
|
|
|
|
|
+ <image :src="item.bookImg" class="book-cover" mode="aspectFill"></image>
|
|
|
|
|
|
|
|
<view class="info-right">
|
|
<view class="info-right">
|
|
|
- <text class="title">{{ item.name || '-' }}</text>
|
|
|
|
|
- <text class="author">{{ item.author }}</text>
|
|
|
|
|
|
|
+ <text class="title">{{ item.bookName || '-' }}</text>
|
|
|
|
|
+ <text class="author">{{ item.author || '-' }}</text>
|
|
|
|
|
|
|
|
<view class="bottom-row">
|
|
<view class="bottom-row">
|
|
|
<view class="price-box">
|
|
<view class="price-box">
|
|
|
<text class="currency">¥</text>
|
|
<text class="currency">¥</text>
|
|
|
- <text class="price">{{ item.productPrice }}</text>
|
|
|
|
|
- <text class="original">¥{{ item.price }}</text>
|
|
|
|
|
|
|
+ <text class="price">{{ item.bookPrice }}</text>
|
|
|
|
|
+ <text class="original">¥{{ item.bookOriginalPrice }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view class="cart-btn">
|
|
|
|
|
|
|
+ <view class="cart-btn" @click.stop="handleAddToCart">
|
|
|
<text>加入购物车</text>
|
|
<text>加入购物车</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- Product Selection Popup -->
|
|
|
|
|
+ <SelectGoodPopup ref="popup" @confirm="onPopupConfirm"></SelectGoodPopup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import SelectGoodPopup from '../select-good-popup/index.vue';
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'HotSellItem',
|
|
name: 'HotSellItem',
|
|
|
|
|
+ components: {
|
|
|
|
|
+ SelectGoodPopup
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
rank: {
|
|
rank: {
|
|
|
type: Number,
|
|
type: Number,
|
|
@@ -44,6 +52,20 @@ export default {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
required: true
|
|
required: true
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ navigateToDetail() {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages-sell/pages/detail?isbn=' + this.item.bookIsbn || ''
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleAddToCart() {
|
|
|
|
|
+ this.item.isbn = this.item.bookIsbn || '';
|
|
|
|
|
+ this.$refs.popup.open(this.item, 1);
|
|
|
|
|
+ },
|
|
|
|
|
+ onPopupConfirm(data) {
|
|
|
|
|
+ this.$emit('add-cart', data);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -98,7 +120,7 @@ export default {
|
|
|
padding: 10rpx 0;
|
|
padding: 10rpx 0;
|
|
|
|
|
|
|
|
.title {
|
|
.title {
|
|
|
- font-size: 36rpx;
|
|
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
color: #303030;
|
|
color: #303030;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
line-height: 1.2;
|
|
line-height: 1.2;
|