From 62b483cc627b0a5f7d626d6b333a3ef7c7c1f4f4 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 25 二月 2026 18:41:01 +0800
Subject: [PATCH] 调试
---
mini-program/pages/details/details.vue | 38 +++++++++++++++++++++++++++++---------
1 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/mini-program/pages/details/details.vue b/mini-program/pages/details/details.vue
index 512ff82..682eca0 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>
@@ -71,9 +72,33 @@
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?id=' + this.id
+ url: '/pages/confirm-order/confirm-order'
})
},
addCard(e) {
@@ -91,11 +116,6 @@
toCard() {
uni.navigateTo({
url: '/pages/shopping-cart/shopping-cart'
- })
- },
- toIndex() {
- uni.switchTab({
- url: '/pages/index/index'
})
},
cardNum() {
--
Gitblit v1.9.3