product:完善 App 商品分页接口

This commit is contained in:
YunaiV
2022-12-15 19:48:21 +08:00
parent 652428a723
commit d453301455
15 changed files with 132 additions and 115 deletions

View File

@ -5,4 +5,4 @@ const { http } = uni.$u
export const productSpuPage = params => http.get('product/spu/page', { params })
// 查询商品
export const productSpu = params => http.get('product/spu/', { params })
export const productSpu = id => http.get('product/spu/get-detail?id=' + id, { })

View File

@ -15,11 +15,11 @@
<image :src="item.picUrls[0]" mode='widthFix' />
</view>
<view class="product-button">
<view class="product-text">{{ item.sellPoint }}{{ item.name }}</view>
<view class="product-text">{{ item.name }}</view>
<view class="product-price-button">
<text class="product-price">
<text class="price-size">{{ towNumber(item.price) }}</text></text>
<text class="product-like-ccount">销量 {{ item.likeCount }}</text>
<text class="price-size">{{ towNumber(item.minPrice) }}</text></text>
<text class="product-like-count">销量 {{ item.salesCount }}</text>
</view>
</view>
</view>
@ -144,7 +144,7 @@
}
}
.product-like-ccount {
.product-like-count {
font-size: 16rpx;
margin-left: 10rpx;
}

View File

@ -305,9 +305,7 @@ export default {
},
methods: {
loadProductData() {
let param = {}
param.spuId = this.product.id
productSpu(param).then(res => {
productSpu(this.product.id).then(res => {
this.product.images = res.data.picUrls;
this.product.sku = res.data.skus;
this.product.desc = res.data.description.replace(/<[^>]*>/g,'');