Files
frontend-app/components/choiceness/choiceness.vue
T

114 lines
2.4 KiB
Vue
Raw Normal View History

2025-08-05 15:25:23 +08:00
<template>
<view class="choiceness_warp">
<view class="choiceness_title">
<up-image src="/static/common/jingxuan_left.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
<view class="choiceness_title_msg">为您精选</view>
<up-image src="/static/common/jingxuan_right.png" width="24" height="8" bgColor="#f1f6ff00"></up-image>
</view>
<view class="choiceness_product">
<view v-for="item in productList" :key="item.id" class="choiceness_product_item" @click="jumpInfo(item)">
<up-image :src="item.url" width="100%" height="140" bgColor="#f1f6ff00"></up-image>
2025-08-19 00:11:16 +08:00
<view class="product_item_name">{{ item.title }}</view>
2025-08-05 15:25:23 +08:00
<view class="product_item_price">
<view class="price_">
<text>¥</text>
2025-08-19 00:11:16 +08:00
<text style="color:36rpx;">{{ item.price }}</text>
2025-08-05 15:25:23 +08:00
</view>
2025-08-19 00:11:16 +08:00
<view class="price_sell">已售{{ item.sales }}件</view>
2025-08-05 15:25:23 +08:00
</view>
</view>
</view>
</view>
</template>
<script>
2025-08-19 00:11:16 +08:00
import { searchList } from '@/api/product.js';
2025-08-06 20:25:41 +08:00
2025-08-19 00:11:16 +08:00
export default {
name: "choiceness",
data() {
return {
productList: []
};
},
mounted() {
this.getSearchList();
},
methods: {
//
jumpInfo(item) {
uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id=' + item.id,
})
2025-08-05 15:25:23 +08:00
},
2025-08-19 00:11:16 +08:00
async getSearchList() {
const params = {
isRecomm: true,
page: 1,
pageSize: 66,
}
const resp = await searchList(params);
if (resp && resp.bizcode === 100) {
this.productList = resp.data
2025-08-05 15:25:23 +08:00
}
}
}
2025-08-19 00:11:16 +08:00
}
2025-08-05 15:25:23 +08:00
</script>
<style lang="scss" scoped>
2025-08-19 00:11:16 +08:00
.choiceness_warp {
margin-top: 50rpx;
}
.choiceness_title {
display: flex;
justify-content: center;
.choiceness_title_msg {
margin: 0 18rpx;
2025-08-05 15:25:23 +08:00
}
2025-08-19 00:11:16 +08:00
}
.choiceness_product {
margin-top: 40rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.choiceness_product_item {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 10rpx 0rpx #EEEEEE;
border-radius: 24rpx;
width: 43%;
margin-bottom: 20rpx;
padding: 20rpx;
2025-08-05 15:25:23 +08:00
}
2025-08-19 00:11:16 +08:00
.product_item_name {
font-weight: bold;
font-size: 26rpx;
color: #333333;
margin-top: 20rpx;
}
.product_item_price {
2025-08-05 15:25:23 +08:00
display: flex;
justify-content: space-between;
2025-08-19 00:11:16 +08:00
align-items: center;
margin-top: 10rpx;
.price_ {
2025-08-05 15:25:23 +08:00
font-weight: bold;
font-size: 26rpx;
2025-08-19 00:11:16 +08:00
color: $app-bt-bj;
2025-08-05 15:25:23 +08:00
}
2025-08-19 00:11:16 +08:00
.price_sell {
font-weight: 400;
font-size: 18rpx;
color: #999999;
2025-08-05 15:25:23 +08:00
}
}
2025-08-19 00:11:16 +08:00
}
2025-03-20 08:46:07 +08:00
</style>