From 796977e24baa7c1d3a333e2c1c8e06ca73fd9a56 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 19 十一月 2025 18:08:35 +0800
Subject: [PATCH] 优惠劵
---
pages/goods-manager/goodsList/goodsList.vue | 137 +++++++++++++++++++++++++++++++++++----------
1 files changed, 105 insertions(+), 32 deletions(-)
diff --git a/pages/goods-manager/goodsList/goodsList.vue b/pages/goods-manager/goodsList/goodsList.vue
index e77a8be..4e74f30 100644
--- a/pages/goods-manager/goodsList/goodsList.vue
+++ b/pages/goods-manager/goodsList/goodsList.vue
@@ -5,7 +5,7 @@
<!-- 閫氳繃 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)">
+ v-for="item in data" :key="item.id" @click="toggle(item)">
<!-- 閫氳繃header鎻掓Ы瀹氫箟鍒楄〃宸︿晶鍥剧墖 -->
<view class="uni-thumb shop-picture" :class="{ 'shop-picture-column': formData.waterfall }">
@@ -28,13 +28,15 @@
<text>.00</text>
</view>
<view class="uni-flex-row">
- <view class="uni-note">{{ item.commentNum || 0 }}鏉¤瘎璁� 鏈堥攢閲� {{
- item.buyCount || 0 }}
+ <view class="uni-note">{{ item.commentNum || 0 }}鏉¤瘎璁�
</view>
<view class="uni-note ellipsis">
- <text class="uni-link">涓婃灦</text>
-
- <text class="uni-link" style="color:red;">鍒犻櫎</text>
+ <!-- <text :class="item.marketEnable == 'DOWN' ? 'market-down' : 'market-up'">{{
+ item.marketEnable == 'DOWN' ? "宸蹭笅鏋�" : "宸蹭笂鏋�" }}</text> -->
+ <text :class="item.authFlag == 'TOBEAUDITED' ? 'market-down' : item.authFlag == 'PASS' ? 'market-up' : 'market-down'">
+ {{ item.authFlag == 'TOBEAUDITED' ? "寰呭鏍�" : (item.authFlag == 'PASS' ? '閫氳繃' : '鏈�氳繃') }}
+ </text>
+ <!--<text class="uni-link" style="color:red;">鍒犻櫎</text> -->
</view>
</view>
</view>
@@ -43,6 +45,7 @@
</view>
</view>
+ <view style="height: 80px;"></view>
</view>
<button type="default" class="btn" @click="addGoods('')">
@@ -51,18 +54,29 @@
</button>
<!-- 閫氳繃 loadMore 缁勪欢瀹炵幇涓婃媺鍔犺浇鏁堟灉锛屽闇�鑷畾涔夋樉绀哄唴瀹癸紝鍙弬鑰冿細https://ext.dcloud.net.cn/plugin?id=29 -->
<uni-load-more v-if="loading || formData.status === 'noMore'" :status="formData.status" />
+ <view>
+ <!-- 鏅�氬脊绐� -->
+ <uni-popup ref="popup" background-color="#fff">
+ <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
+
+ <button type="default" @click="underOrup">{{ selectGoods.marketEnable == 'DOWN' ? '涓婃灦' : "涓嬫灦"
+ }}</button>
+
+ <button type="default" @click="stocks">璋冩暣搴撳瓨</button>
+ </view>
+ </uni-popup>
+ </view>
</view>
</template>
<script>
-import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue';
+import '@/components/uview-components/uview-ui';
import * as API_GOODS from "@/api/goods.js";
export default {
- components: { UIcon },
data() {
return {
formData: {
@@ -73,31 +87,11 @@
pageNumber: 1,
pageSize: 10,
},
- 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": [
- "鐑崠涓�",
- ]
- }
- ],
+ data: [],
formData: {
status: 'loading', // 鍔犺浇鐘舵��
},
+ selectGoods: {},
tipShow: false // 鏄惁鏄剧ず椤堕儴鎻愮ず妗�
};
},
@@ -109,6 +103,48 @@
}
},
methods: {
+ underOrup() {
+ let params = {
+ goodsId: this.selectGoods.id,
+ };
+ this.$refs.popup.close()
+ if (this.selectGoods.marketEnable == 'DOWN') {
+ API_GOODS.upGoods(params).then((res) => {
+ uni.showLoading({
+ title: '涓婃灦鎴愬姛'
+ });
+
+ setTimeout(function () {
+ uni.hideLoading();
+ }, 2000);
+ this.getGoodsList();
+ })
+ }
+ else {
+ API_GOODS.lowGoods(params).then((res) => {
+ uni.showLoading({
+ title: '涓嬫灦鎴愬姛'
+ });
+
+ setTimeout(function () {
+ uni.hideLoading();
+ }, 2000);
+ this.getGoodsList();
+ })
+ }
+ },
+ stocks() {
+
+ this.$refs.popup.close()
+ var goodsId = this.selectGoods.id
+ uni.navigateTo({
+ url: `/pages/goods-manager/updateSkus/updateSkus${"?goodsId=" + goodsId}`,
+ });
+ },
+ toggle(item) {
+ // this.$refs.popup.open('bottom')
+ // this.selectGoods = item;
+ },
getGoodsList() {
uni.showLoading();
@@ -123,7 +159,7 @@
},
addGoods(id) {
uni.navigateTo({
- url: `/pages/goods-manager/addGoods/addGoods${id ? "?id=" + id : ""}`,
+ url: `/pages/supplier/publish-goods/publishGoods`,
});
}
@@ -256,7 +292,6 @@
// 灏忕▼搴� 缂栬瘧鍚庝細澶氫竴灞傛爣绛撅紝鑰屽叾浠栧钩鍙版病鏈夛紝鎵�浠ラ渶瑕佺壒娈婂鐞嗕竴涓�
/deep/ .uni-list {
/* #endif */
- height: calc(100vh - 100px - 80px - 60px);
display: flex;
flex-direction: row;
flex-wrap: wrap;
@@ -303,4 +338,42 @@
margin-right: 10rpx;
}
}
+
+@mixin flex {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+}
+
+@mixin height {
+ /* #ifndef APP-NVUE */
+ height: 100%;
+ /* #endif */
+ /* #ifdef APP-NVUE */
+ flex: 1;
+ /* #endif */
+}
+
+.popup-content {
+ @include flex;
+ align-items: center;
+ justify-content: center;
+ padding: 15px;
+ height: 150px;
+ background-color: #fff;
+}
+
+.popup-height {
+ @include height;
+ width: 200px;
+}
+
+.market-down {
+ color: red;
+}
+
+.market-up {
+ color: green;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0