From ae5bb0dc68ec9a0be23d2173cec320d5c41e79d1 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 28 五月 2025 09:05:57 +0800
Subject: [PATCH] Merge branch 'dev' of http://42.193.1.25:9521/r/lmk-shop-wx into dev

---
 pages/goods-manager/goodsList/goodsList.vue |  288 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 288 insertions(+), 0 deletions(-)

diff --git a/pages/goods-manager/goodsList/goodsList.vue b/pages/goods-manager/goodsList/goodsList.vue
new file mode 100644
index 0000000..254202a
--- /dev/null
+++ b/pages/goods-manager/goodsList/goodsList.vue
@@ -0,0 +1,288 @@
+<template>
+	<view class="list">
+		<view class='uni-list--waterfall'>
+			<view class="uni-list ">
+				<!-- 閫氳繃 uni-list--waterfall 绫诲喅瀹氶〉闈㈠竷灞�鏂瑰悜 -->
+				<!-- to 灞炴�ф惡甯﹀弬鏁拌烦杞鎯呴〉闈紝褰撳墠鍙负鍙傝�� -->
+				<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>
+									<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.goods_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>
+									<view class="uni-note ellipsis">
+										<text class="uni-link">涓婃灦</text>
+
+										<text class="uni-link" style="color:red;">鍒犻櫎</text>
+									</view>
+								</view>
+							</view>
+						</view>
+					</template>
+					<!-- 閫氳繃body鎻掓Ы瀹氫箟鍟嗗搧甯冨眬 -->
+
+				</view>
+			</view>
+		</view>
+
+		<button type="default" class="btn" @click="addGoods('')">
+			<u-icon name="plus-circle"></u-icon>
+			娣诲姞鍟嗗搧
+		</button>
+		<!-- 閫氳繃 loadMore 缁勪欢瀹炵幇涓婃媺鍔犺浇鏁堟灉锛屽闇�鑷畾涔夋樉绀哄唴瀹癸紝鍙弬鑰冿細https://ext.dcloud.net.cn/plugin?id=29 -->
+		<uni-load-more v-if="loading || formData.status === 'noMore'" :status="formData.status" />
+
+	</view>
+</template>
+
+<script>
+export default {
+	components: {},
+	data() {
+		return {
+			formData: {
+				waterfall: false, // 甯冨眬鏂瑰悜鍒囨崲
+				status: 'loading', // 鍔犺浇鐘舵��
+			},
+			data: [
+				{
+					"id": 122,
+					"goods_thumb": "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/83df593e6ba448ddbe6685d928e6fa65.jpg",
+					"name": "銆愮垎娆俱�慉pple iPhone 11 (A2223) 64GB 娣辩┖鐏拌壊 绉诲姩鑱旈�氱數淇�4G鎵嬫満",
+					"goods_price": "699.00",
+					"goods_tip": "鐑崠涓�",
+					"tag": [
+						"鐑崠涓�",
+					]
+				},
+				{
+					"id": 123,
+					"goods_thumb": "https://lilishop-oss.oss-cn-beijing.aliyuncs.com/83df593e6ba448ddbe6685d928e6fa65.jpg",
+					"name": "銆愮垎娆俱�慉pple iPhone 11 (A2223) 64GB 娣辩┖鐏拌壊 绉诲姩鑱旈�氱數淇�4G鎵嬫満",
+					"goods_price": "699.00",
+					"goods_tip": "鐑崠涓�",
+					"tag": [
+						"鐑崠涓�",
+					]
+				}
+			],
+			formData: {
+				status: 'loading', // 鍔犺浇鐘舵��
+			},
+			tipShow: false // 鏄惁鏄剧ず椤堕儴鎻愮ず妗�
+		};
+	},
+	onLoad() { },
+	methods: {
+		load(data, ended) {
+			if (ended) {
+				this.formData.status = 'noMore'
+			}
+		},
+		addGoods(id) {
+			console.log("addGoods:" + id);
+
+			uni.navigateTo({
+				url: `/pages/goods-manager/addGoods/addGoods${id ? "?id=" + id : ""}`,
+			});
+		}
+
+	},
+	/**
+	 * 涓嬫媺鍒锋柊鍥炶皟鍑芥暟
+	 */
+	onPullDownRefresh() {
+		this.formData.status = 'more'
+
+	},
+	/**
+	 * 涓婃媺鍔犺浇鍥炶皟鍑芥暟
+	 */
+	onReachBottom() {
+
+	}
+};
+</script>
+
+
+<style lang="scss" scoped>
+@import './goodsList.scss';
+
+page {
+	display: flex;
+	flex-direction: column;
+	box-sizing: border-box;
+	background-color: #efeff4;
+	min-height: 100%;
+	height: auto;
+}
+
+.tips {
+	color: #67c23a;
+	font-size: 14px;
+	line-height: 40px;
+	text-align: center;
+	background-color: #f0f9eb;
+	height: 0;
+	opacity: 0;
+	transform: translateY(-100%);
+	transition: all 0.3s;
+}
+
+.tips-ani {
+	transform: translateY(0);
+	height: 40px;
+	opacity: 1;
+}
+
+.shop {
+	flex: 1;
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+}
+
+.shop-picture {
+	width: 110px;
+	height: 110px;
+}
+
+.shop-picture-column {
+	width: 100%;
+	height: 170px;
+	margin-bottom: 10px;
+}
+
+.shop-price {
+	margin-top: 5px;
+	font-size: 12px;
+	color: #ff5a5f;
+}
+
+.shop-price-text {
+	font-size: 16px;
+}
+
+.hot-tag {
+	background: #ff5a5f;
+	border: none;
+	color: #fff;
+}
+
+.button-box {
+	height: 30px;
+	line-height: 30px;
+	font-size: 12px;
+	background: #007AFF;
+	color: #fff;
+}
+
+.uni-flex-row {
+	display: flex;
+
+}
+
+.uni-link {
+	flex-shrink: 0;
+	margin-right: 10px;
+}
+
+.ellipsis {
+	margin-left: auto;
+	display: flex;
+	overflow: hidden;
+}
+
+.uni-ellipsis-1 {
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+
+.uni-ellipsis-2 {
+	overflow: hidden;
+	text-overflow: ellipsis;
+	display: -webkit-box;
+	-webkit-line-clamp: 2;
+	-webkit-box-orient: vertical;
+}
+
+
+// 榛樿鍔犲叆 scoped 锛屾墍浠ュ闈㈠姞涓�灞傛彁鍗囨潈閲�
+.list {
+	.uni-list--waterfall {
+
+		/* #ifndef H5 || APP-VUE */
+		// 灏忕▼搴� 缂栬瘧鍚庝細澶氫竴灞傛爣绛撅紝鑰屽叾浠栧钩鍙版病鏈夛紝鎵�浠ラ渶瑕佺壒娈婂鐞嗕竴涓�
+		/deep/ .uni-list {
+			/* #endif */
+			display: flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+			padding: 5px;
+			box-sizing: border-box;
+
+			/* #ifdef H5 || APP-VUE */
+			// h5 鍜� app-vue 浣跨敤娣卞害閫夋嫨鍣紝鍥犱负榛樿浣跨敤浜� scoped 锛屾墍浠ユ牱寮忎細鏃犳硶绌块��
+			/deep/
+			/* #endif */
+			.uni-list-item--waterfall {
+				// width: 50%;
+				display: flex;
+				box-sizing: border-box;
+				margin-bottom: 10px;
+				background-color: white;
+				padding: 10px;
+
+				.uni-list-item__container {
+					padding: 5px;
+					flex-direction: column;
+				}
+			}
+
+			/* #ifndef H5 || APP-VUE */
+		}
+
+		/* #endif */
+	}
+}
+
+
+.btn {
+	background: $light-color;
+	position: fixed;
+	width: 690rpx;
+	bottom: 60rpx;
+	height: 80rpx;
+	left: 30rpx;
+	font-size: 30rpx;
+	line-height: 80rpx;
+
+	.u-icon {
+		margin-right: 10rpx;
+	}
+}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0