style: 后端ES接口返回格式调整,前端字段调整

This commit is contained in:
学习很差啦
2023-04-04 16:07:22 +08:00
parent f0dcf473e8
commit c097a423f9
7 changed files with 44 additions and 44 deletions

View File

@@ -493,13 +493,13 @@ export default {
// 跳转到商品详情
navigateToDetailPage(item) {
uni.navigateTo({
url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`
});
},
// 跳转地址
navigateToStoreDetailPage(item) {
uni.navigateTo({
url: `/pages/product/shopPage?id=${item.content.storeId}`
url: `/pages/product/shopPage?id=${item.storeId}`
});
},
loadmore() {
@@ -627,14 +627,14 @@ export default {
}
//没有更多直接返回 #TODO
let goodsList = await getGoodsList(this.params);
if (goodsList.data.result.content.length < 10) {
if (goodsList.data.result.records.length < 10) {
this.loadingType = 'noMore';
this.empty = true;
} else {
this.empty = false;
}
this.goodsList.push(...goodsList.data.result.content);
this.goodsList.push(...goodsList.data.result.records);
this.initSortGoods();
uni.hideLoading();
},

View File

@@ -759,7 +759,7 @@ export default {
storeId: this.goodsDetail.storeId,
recommend: true,
}).then((res) => {
this.recommendList = res.data.result.content;
this.recommendList = res.data.result.records;
});
},
@@ -774,7 +774,7 @@ export default {
category: this.goodsDetail.categoryId,
keyword: this.goodsDetail.name,
}).then((res) => {
this.likeGoodsList = res.data.result.content;
this.likeGoodsList = res.data.result.records;
});
},

View File

@@ -24,15 +24,15 @@
<view class="store-recommend-title">商品推荐</view>
<view class="recommend-list">
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.thumbnail" height="218rpx">
<u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx; ">加载失败</view>
</u-image>
<view class="recommend-item-name">
{{ item.content.goodsName }}
{{ item.goodsName }}
</view>
<view class="item-price" v-if="item.price != undefined">
<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.content.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.content.price)[1] }}
<span class="item-price-blod">{{ $options.filters.goodsFormatPrice(item.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(item.price)[1] }}
</view>
</view>
</view>
@@ -51,7 +51,7 @@ export default {
// 点击商品
clickGoods(val) {
uni.navigateTo({
url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`,
});
},

View File

@@ -13,17 +13,17 @@
<view class="scroll-con">
<view v-if="nomsg">没有相似商品</view>
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
<image :src="item.content.thumbnail" mode=""></image>
<view class="nowrap">{{item.content.name}}</view>
<image :src="item.thumbnail" mode=""></image>
<view class="nowrap">{{item.name}}</view>
<view>
<text>{{item.content.price | unitPrice}}
<text>{{item.price | unitPrice}}
<!-- <text v-if="item.point">+{{item.point || 0}}积分</text> -->
</text>
<text>{{item.content.mktprice}}</text>
<text>{{item.mktprice}}</text>
</view>
<view>
<text>已售{{item.content.buy_count}}</text>
<text>{{item.content.grade}}%好评</text>
<text>已售{{item.buy_count}}</text>
<text>{{item.grade}}%好评</text>
</view>
</view>
</view>
@@ -74,7 +74,7 @@
},
goDetail(item) {
uni.navigateTo({
url: '/pages/product/goods?id=' + item.content.id + "&goodsId=" +item.content.goodsId
url: '/pages/product/goods?id=' + item.id + "&goodsId=" +item.goodsId
})
},
loadData() {