From 962764e90a4cd06b9f8a18ec8f542e689fd50131 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 16 六月 2025 12:08:21 +0800
Subject: [PATCH] 刷视频-轮播展示多商品,发布视频字段bug
---
pages/goods-manager/goodsList/goodsList.vue | 45 ++++++++++++++++++++++++++++++++-------------
1 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/pages/goods-manager/goodsList/goodsList.vue b/pages/goods-manager/goodsList/goodsList.vue
index ec15364..e77a8be 100644
--- a/pages/goods-manager/goodsList/goodsList.vue
+++ b/pages/goods-manager/goodsList/goodsList.vue
@@ -9,12 +9,12 @@
<!-- 閫氳繃header鎻掓Ы瀹氫箟鍒楄〃宸︿晶鍥剧墖 -->
<view class="uni-thumb shop-picture" :class="{ 'shop-picture-column': formData.waterfall }">
- <image :src="item.goods_thumb" mode="aspectFill"></image>
+ <image :src="item.thumbnail" mode="aspectFill"></image>
</view>
<view class="shop">
<view>
<view class="uni-title">
- <text class="uni-ellipsis-2">{{ item.name }}</text>
+ <text class="uni-ellipsis-2">{{ item.goodsName }}</text>
</view>
<!-- <view>
<text class="uni-tag hot-tag">{{ item.goods_tip }}</text>
@@ -24,12 +24,12 @@
<view>
<view class="shop-price">
<text>楼</text>
- <text class="shop-price-text">{{ item.goods_price }}</text>
+ <text class="shop-price-text">{{ item.price }}</text>
<text>.00</text>
</view>
<view class="uni-flex-row">
- <view class="uni-note">{{ item.comment_count || 0 }}鏉¤瘎璁� 鏈堥攢閲� {{
- item.month_sell_count || 0 }}
+ <view class="uni-note">{{ item.commentNum || 0 }}鏉¤瘎璁� 鏈堥攢閲� {{
+ item.buyCount || 0 }}
</view>
<view class="uni-note ellipsis">
<text class="uni-link">涓婃灦</text>
@@ -58,6 +58,9 @@
<script>
import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue';
+
+import * as API_GOODS from "@/api/goods.js";
+
export default {
components: { UIcon },
data() {
@@ -65,6 +68,10 @@
formData: {
waterfall: false, // 甯冨眬鏂瑰悜鍒囨崲
status: 'loading', // 鍔犺浇鐘舵��
+ },
+ params: {
+ pageNumber: 1,
+ pageSize: 10,
},
data: [
{
@@ -94,16 +101,27 @@
tipShow: false // 鏄惁鏄剧ず椤堕儴鎻愮ず妗�
};
},
- onLoad() { },
+ onLoad() {
+ },
+ onShow() {
+ if (this.$options.filters.tipsToLogin()) {
+ this.getGoodsList();
+ }
+ },
methods: {
- load(data, ended) {
- if (ended) {
- this.formData.status = 'noMore'
- }
+
+ getGoodsList() {
+ uni.showLoading();
+ API_GOODS.getStoreGoods(
+ this.params.pageNumber,
+ this.params.pageSize
+ ).then((res) => {
+ this.data = res.data.result.records;
+
+ if (this.$store.state.isShowToast) { uni.hideLoading() };
+ });
},
addGoods(id) {
- console.log("addGoods:" + id);
-
uni.navigateTo({
url: `/pages/goods-manager/addGoods/addGoods${id ? "?id=" + id : ""}`,
});
@@ -238,6 +256,7 @@
// 灏忕▼搴� 缂栬瘧鍚庝細澶氫竴灞傛爣绛撅紝鑰屽叾浠栧钩鍙版病鏈夛紝鎵�浠ラ渶瑕佺壒娈婂鐞嗕竴涓�
/deep/ .uni-list {
/* #endif */
+ height: calc(100vh - 100px - 80px - 60px);
display: flex;
flex-direction: row;
flex-wrap: wrap;
@@ -249,7 +268,7 @@
/deep/
/* #endif */
.uni-list-item--waterfall {
- // width: 50%;
+ width: 98%;
display: flex;
box-sizing: border-box;
margin-bottom: 10px;
--
Gitblit v1.8.0