From 9d928b12c49b7b604c0b52ce1d98846813d5b613 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期日, 15 六月 2025 19:30:13 +0800 Subject: [PATCH] 视频发布支持多商品 --- pages/goods-manager/goodsList/goodsList.vue | 88 ++++++++++++++++++++++++++----------------- 1 files changed, 53 insertions(+), 35 deletions(-) diff --git a/pages/goods-manager/goodsList/goodsList.vue b/pages/goods-manager/goodsList/goodsList.vue index 254202a..e77a8be 100644 --- a/pages/goods-manager/goodsList/goodsList.vue +++ b/pages/goods-manager/goodsList/goodsList.vue @@ -7,41 +7,38 @@ <view :border="!formData.waterfall" class="uni-list-item--waterfall" title="鑷畾涔夊晢鍝佸垪琛�" v-for="item in data" :key="item.id" @click="addGoods(item.id)"> <!-- 閫氳繃header鎻掓Ы瀹氫箟鍒楄〃宸︿晶鍥剧墖 --> - <template v-slot:header> - <view class="uni-thumb shop-picture" :class="{ 'shop-picture-column': formData.waterfall }"> - <image :src="item.goods_thumb" mode="aspectFill"></image> - </view> - </template> - <template v-slot:body> - <view class="shop"> - <view> - <view class="uni-title"> - <text class="uni-ellipsis-2">{{ item.name }}</text> - </view> - <!-- <view> + + <view class="uni-thumb shop-picture" :class="{ 'shop-picture-column': formData.waterfall }"> + <image :src="item.thumbnail" mode="aspectFill"></image> + </view> + <view class="shop"> + <view> + <view class="uni-title"> + <text class="uni-ellipsis-2">{{ item.goodsName }}</text> + </view> + <!-- <view> <text class="uni-tag hot-tag">{{ item.goods_tip }}</text> <text v-for="tag in item.tag" :key="tag" class="uni-tag">{{ tag }}</text> </view> --> + </view> + <view> + <view class="shop-price"> + <text>楼</text> + <text class="shop-price-text">{{ item.price }}</text> + <text>.00</text> </view> - <view> - <view class="shop-price"> - <text>楼</text> - <text class="shop-price-text">{{ item.goods_price }}</text> - <text>.00</text> + <view class="uni-flex-row"> + <view class="uni-note">{{ item.commentNum || 0 }}鏉¤瘎璁� 鏈堥攢閲� {{ + item.buyCount || 0 }} </view> - <view class="uni-flex-row"> - <view class="uni-note">{{ item.comment_count||0 }}鏉¤瘎璁� 鏈堥攢閲� {{ - item.month_sell_count||0 }} - </view> - <view class="uni-note ellipsis"> - <text class="uni-link">涓婃灦</text> + <view class="uni-note ellipsis"> + <text class="uni-link">涓婃灦</text> - <text class="uni-link" style="color:red;">鍒犻櫎</text> - </view> + <text class="uni-link" style="color:red;">鍒犻櫎</text> </view> </view> </view> - </template> + </view> <!-- 閫氳繃body鎻掓Ы瀹氫箟鍟嗗搧甯冨眬 --> </view> @@ -59,13 +56,22 @@ </template> <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: {}, + components: { UIcon }, data() { return { formData: { waterfall: false, // 甯冨眬鏂瑰悜鍒囨崲 status: 'loading', // 鍔犺浇鐘舵�� + }, + params: { + pageNumber: 1, + pageSize: 10, }, data: [ { @@ -95,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 : ""}`, }); @@ -239,6 +256,7 @@ // 灏忕▼搴� 缂栬瘧鍚庝細澶氫竴灞傛爣绛撅紝鑰屽叾浠栧钩鍙版病鏈夛紝鎵�浠ラ渶瑕佺壒娈婂鐞嗕竴涓� /deep/ .uni-list { /* #endif */ + height: calc(100vh - 100px - 80px - 60px); display: flex; flex-direction: row; flex-wrap: wrap; @@ -250,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