From d9f56e0fbbc0c14a6e24e30c48459296231b5c0f Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Sun, 23 Feb 2025 13:32:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jiuyi2/api/mine.js | 41 +++++ jiuyi2/common/js/util.js | 33 ++-- .../shop/productList/productList.vue | 1 - jiuyi2/pages/index/myTeam.vue | 2 +- jiuyi2/pages/index/videoDetail.nvue | 56 +++++- jiuyi2/pages/index/videoDetail.vue | 162 ++++++++++++++---- jiuyi2/pages/mine/myComment.vue | 2 +- jiuyi2/pages/mine/setting/bankCard.vue | 134 ++++++++++++++- jiuyi2/pages/mine/setting/bankCardAdd.vue | 112 ++++++++---- jiuyi2/pages/mine/setting/setting.vue | 1 + jiuyi2/readme.md | 1 + 11 files changed, 447 insertions(+), 98 deletions(-) diff --git a/jiuyi2/api/mine.js b/jiuyi2/api/mine.js index 1b08a2d9..57b3fca2 100644 --- a/jiuyi2/api/mine.js +++ b/jiuyi2/api/mine.js @@ -352,6 +352,47 @@ const mine = { method: 'GET', }) }, + + /** + * 查看已绑定的银行卡列表 + * @param {Object} param + */ + getBankCards(param) { + return util.request({ + url: '/user/bank-cards/getBankCards', + data: param.data, + query: param.query, + method: 'GET', + load: true, + }) + }, + + /** + * 添加银行卡 + * @param {Object} param + */ + addBankCard(param) { + return util.request({ + url: '/user/bank-cards/addBankCard', + data: param.data, + query: param.query, + method: 'POST', + load: true, + }) + }, + + /** + * 删除银行卡 + * @param {Object} param + */ + deleteBankCard(param) { + return util.request({ + url: '/user/bank-cards/deleteBankCard', + path: param.path, + method: 'DELETE', + load: true, + }) + }, } export default mine \ No newline at end of file diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index ea7d22cc..c15d4db3 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -190,6 +190,7 @@ const util = { ...params.header, } + console.log('token', token) if (token) params.header["Authorization"] = `Bearer ${token}` // console.log('request url', url) @@ -213,7 +214,7 @@ const util = { responseType: params.responseType || 'text', // 请求成功返回 success: res => { - // console.log('request success', url, res, params.data ? params.data : '') + console.log('request success', url, res, params.data ? params.data : '') // 关闭加载效果 if (params.load) { uni.hideLoading() @@ -224,8 +225,7 @@ const util = { // 登出 util.logout(() => { util.alert('请先登录') - reject(res.data) // 链式回调0 - + reject(res.data) // uni.reLaunch({ // url: '/login/login', // }) @@ -235,7 +235,6 @@ const util = { params.success ? params.success(res.data) : '' // 链式回调 resolve(res.data); - }, // 请求失败返回 fail: res => { @@ -1410,17 +1409,17 @@ const util = { * @param {Function} cb 回调函数 */ finalLogin(param, cb) { - try { - // 登录令牌 - const token = param.data - // 缓存token - uni.setStorageSync('token', token) - - // 开启加载 - uni.showLoading({ - mask: true - }) + // 登录令牌 + const token = param.data + // 缓存token + uni.setStorageSync('token', token) + console.log('set token', token) + // 开启加载 + uni.showLoading({ + mask: true + }) + setTimeout(() => { // 获取用户信息 util.getUserinfo((userinfo) => { // 登录 @@ -1435,9 +1434,7 @@ const util = { // cb ? cb() : '' }) - } catch (ev) { - console.log('finalLogin catch', ev) - } + }, 500) }, // 登录腾讯聊天 @@ -1767,7 +1764,7 @@ const util = { success: (res) => { if (res && res.result) { let result = JSON.parse(res.result) - if (result.type == 'ADDFRIEND') { + if (result.type == 'ADDFRIEND') { uni.navigateTo({ url: `/pages/news/addFriend?account=${result.account}` }); diff --git a/jiuyi2/components/shop/productList/productList.vue b/jiuyi2/components/shop/productList/productList.vue index 33cb6680..c786f718 100644 --- a/jiuyi2/components/shop/productList/productList.vue +++ b/jiuyi2/components/shop/productList/productList.vue @@ -57,7 +57,6 @@ // 加载更多列表 function getMoreList() { - console.log('getMoreList', listPrototype) if (listPrototype.total <= listPrototype.data.length) return listPrototype.pageNum++ getList() diff --git a/jiuyi2/pages/index/myTeam.vue b/jiuyi2/pages/index/myTeam.vue index 904c6c3b..026354d7 100644 --- a/jiuyi2/pages/index/myTeam.vue +++ b/jiuyi2/pages/index/myTeam.vue @@ -158,7 +158,7 @@ - {{item.userNickname}}{{item.isShop}} + {{item.userNickname}}