From 22fded1beec519df7080775a2e49955367c39c99 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Wed, 15 May 2024 10:40:23 +0800 Subject: [PATCH] add --- pageQuota/Balance/bindAccout.vue | 9 ++++++++- pageQuota/Balance/detail.vue | 2 +- pageQuota/Balance/index.vue | 8 ++++---- pagesOrder/detail/detail.vue | 3 +++ pagesOrder/order/order.vue | 9 ++++++--- store/user.js | 4 ++-- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/pageQuota/Balance/bindAccout.vue b/pageQuota/Balance/bindAccout.vue index 69d702c..fa69f8b 100644 --- a/pageQuota/Balance/bindAccout.vue +++ b/pageQuota/Balance/bindAccout.vue @@ -5,6 +5,7 @@ 提现至 </view> <view style="font-weight: bold;"> + {{form.is_own}} <!-- 请选择提现账户 --> {{form.is_own?'对公账户':'个人账户'}} </view> @@ -15,7 +16,7 @@ <view class="form"> <up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" labelWidth='70'> <up-form-item label="开户银行" prop="userInfo.name" borderBottom ref="item1" @click="showPop=true"> - <text style="padding-left: 20rpx;" v-if="form.bank_id">{{form.bank_name}}</text> + <text style="padding-left: 20rpx;" v-if="form.bank_name">{{form.bank_name}}</text> <text v-else style="color: #20B128;padding-left: 20rpx;">点击选择开户银行</text> </up-form-item> <up-form-item label="账户名称" prop="userInfo.name" borderBottom ref="item1"> @@ -118,6 +119,11 @@ }) const getFormData = (form, target) => { + if (!target) { + form.value = {} + return + } + form.name = target.name || '' form.bank_id = target.bank_id || '' form.bank_name = target.bank_name || '' @@ -130,6 +136,7 @@ const choseAccount = (type) => { getFormData(form, bank_list.value[type]) + form.is_own = type showPop1.value = false } diff --git a/pageQuota/Balance/detail.vue b/pageQuota/Balance/detail.vue index 103a5c7..ed200fe 100644 --- a/pageQuota/Balance/detail.vue +++ b/pageQuota/Balance/detail.vue @@ -50,7 +50,7 @@ </template> <script setup> - import hDatetimePicker from "@/components/h-datetime-picker/components/h-datetime-picker/h-datetime-picker.vue" + // import hDatetimePicker from "@/components/h-datetime-picker/components/h-datetime-picker/h-datetime-picker.vue" import { ref, reactive diff --git a/pageQuota/Balance/index.vue b/pageQuota/Balance/index.vue index a56c0d6..63c995c 100644 --- a/pageQuota/Balance/index.vue +++ b/pageQuota/Balance/index.vue @@ -5,7 +5,7 @@ 账户总余额(元) </view> <view style="font-size: 36rpx;"> - ¥{{balance}} + ¥{{balance||0.00}} </view> </view> <view class="action"> @@ -20,7 +20,7 @@ <text>更换账户</text> <up-icon color="#20B128" name="arrow-right"></up-icon> </view> </view> - <view class="form" v-if='true'> + <view class="form" v-if='target_bank.bank_name'> <up-form labelPosition="left" borderBottom :label-style="{fontSize:'30rpx'}" ref="form1" labelWidth='70'> <up-form-item label="银行卡" prop="userInfo.name" borderBottom ref="item1"> <up-input style="border: none;" v-model="target_bank.bank_name" /> @@ -83,7 +83,7 @@ const showPop1 = ref(false) const choseAccount = (type) => { - target_bank.value = bank_list.value[type] + target_bank.value = bank_list.value[type] || {} console.log(target_bank.value) showPop1.value = false } @@ -121,7 +121,7 @@ amountAccountApi().then(res => { balance.value = res.data.balance bank_list.value = res.data.bank_list - target_bank.value = res.data.bank_list[0] + target_bank.value = res.data.bank_list[0] || {} console.log(target_bank.value) }) } diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue index 77fc2b4..338c95c 100644 --- a/pagesOrder/detail/detail.vue +++ b/pagesOrder/detail/detail.vue @@ -378,6 +378,9 @@ order_id: datas.value.id }).then(res => { uni.$u.toast('已加入购物车'); + uni.navigateTo({ + url: '/pages/cart/cart' + }) }) } diff --git a/pagesOrder/order/order.vue b/pagesOrder/order/order.vue index 291fafe..6d865e7 100644 --- a/pagesOrder/order/order.vue +++ b/pagesOrder/order/order.vue @@ -42,9 +42,9 @@ </swiper-item> </swiper> </view> - <orderCanclePopup :show="showCancel" @close="showCancel=false" @change="submitCancel" /> - <modal :show="showTake" title="确认收货" content="请确认您已收到货" @close="showTake=false" @change="confirmReceipt"> - </modal> + <orderCanclePopup :show="showCancel" @close="showCancel=false" @change="submitCancel" /> + <modal :show="showTake" title="确认收货" content="请确认您已收到货" @close="showTake=false" @change="confirmReceipt"> + </modal> </template> <script setup> @@ -142,6 +142,9 @@ order_id: e.id }).then(res => { uni.$u.toast('已加入购物车'); + uni.navigateTo({ + url: '/pages/cart/cart' + }) }) } diff --git a/store/user.js b/store/user.js index 3071014..7670c8e 100644 --- a/store/user.js +++ b/store/user.js @@ -25,7 +25,7 @@ const useUserStore = defineStore("user", () => { // #ifdef H5 - token.value = "f8503407982ed2391ff3dc740da26596" + token.value = "16d487cfde6bceefdfcb28d2f1d52bf8" // token.value = "95b24dd6d2dda836fe07854b08ba0944" userInfo.value = { avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png", @@ -35,7 +35,7 @@ const useUserStore = defineStore("user", () => { mobile: "19330904744", nickname: "用户1714964250", supplier: null, - token: "f8503407982ed2391ff3dc740da26596" + token: "16d487cfde6bceefdfcb28d2f1d52bf8" } // #endif