From a997c45ed4675d2eb045090fddb933235f4279cd Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期六, 28 二月 2026 14:21:57 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/details/details.vue |   52 ++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/mini-program/pages/details/details.vue b/mini-program/pages/details/details.vue
index 6fc5b10..cdd2378 100644
--- a/mini-program/pages/details/details.vue
+++ b/mini-program/pages/details/details.vue
@@ -27,9 +27,10 @@
 		<view class="footer">
 			<view class="edit">
 				<view class="edit-left">
-					<view class="edit-left-row" @click="toIndex">
-						<image src="/static/icon/detail_ic_home@2x.png" mode="widthFix"></image>
-						<text>棣栭〉</text>
+					<view class="edit-left-row" @click="shoucang">
+						<image src="/static/icon/ic_collect_sel@2x.png" mode="widthFix" v-if="info.collectStatus === 1"></image>
+						<image src="/static/icon/ic_collect@2x.png" mode="widthFix" v-else></image>
+						<text>{{info.collectStatus === 1 ? '宸叉敹钘�' : '鏀惰棌'}}</text>
 					</view>
 					<view class="edit-left-row">
 						<button open-type="contact">瀹㈡湇</button>
@@ -44,7 +45,7 @@
 				</view>
 				<view class="edit-btn">
 					<view class="edit-btn-a" @click="addCard(info)">鍔犲叆璐墿杞�</view>
-					<view class="edit-btn-b">绔嬪嵆璐拱</view>
+					<view class="edit-btn-b" @click="submit">绔嬪嵆璐拱</view>
 				</view>
 			</view>
 			<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
@@ -54,7 +55,9 @@
 
 <script>
 	import { mapState } from 'vuex'
+	import Login from '@/components/login/login.vue'
 	export default {
+		components: { Login },
 		computed: {
 			...mapState(['userInfo'])
 		},
@@ -68,9 +71,43 @@
 		onLoad(option) {
 			this.id = option.id
 			this.getDetails()
-			this.cardNum()
+			
+		},
+		onShow() {
+			if (this.userInfo) {
+				this.cardNum()
+			}
 		},
 		methods: {
+			shoucang() {
+				if (this.info.collectStatus === 1) {
+					this.$u.api.cancelbatch({ ids: this.info.id })
+						.then(res => {
+							if (res.code === 200) {
+								this.info.collectStatus = 0
+							}
+						})
+				} else {
+					this.$u.api.saveCollect({ objId: this.info.id, type: 1 })
+						.then(res => {
+							if (res.code === 200) {
+								this.info.collectStatus = 1
+							}
+						})
+				}
+			},
+			submit() {
+				let shop = [
+					{
+						goodsNum: 1,
+						goodsSkuId: this.info.goodsSkuResponseList[0].id
+					}
+				]
+				uni.setStorageSync('shop', shop)
+				uni.navigateTo({
+					url: '/pages/confirm-order/confirm-order'
+				})
+			},
 			addCard(e) {
 				this.$u.api.addCart({
 					goodsId: e.id,
@@ -86,11 +123,6 @@
 			toCard() {
 				uni.navigateTo({
 					url: '/pages/shopping-cart/shopping-cart'
-				})
-			},
-			toIndex() {
-				uni.switchTab({
-					url: '/pages/index/index'
 				})
 			},
 			cardNum() {

--
Gitblit v1.9.3