From b40da3b4c19a1697e4d192c37468b5858fe5cd52 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Tue, 19 Aug 2025 16:02:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=B8=A4?= =?UTF-8?q?=E7=A7=8D=E6=96=87=E7=AB=A0=E7=9A=84=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/article/article.js | 12 ++++++------ pages/login/login.vue | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/api/article/article.js b/api/article/article.js index a6e3e58..b1a8c7e 100644 --- a/api/article/article.js +++ b/api/article/article.js @@ -24,11 +24,11 @@ export function getArticleByType(params = {}) { */ export function getServiceTerms() { return request({ - url: '/app/article/listByType', + url: '/app/article/getNew', method: 'GET', params: { - status: 1, - type: '5', + appId: '1', + type: '1', // 1:服务条款 }, }) } @@ -39,11 +39,11 @@ export function getServiceTerms() { */ export function getPrivacyPolicy() { return request({ - url: '/app/article/listByType', + url: '/app/article/getNew', method: 'GET', params: { - status: 1, - type: '6', + appId: '1', + type: '2', // 2:隐私政策 }, }) } diff --git a/pages/login/login.vue b/pages/login/login.vue index 538e710..1eb4884 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -231,27 +231,27 @@ export default { return } - const that = this + // 使用箭头函数保持this指向 uni.login({ - success(res) { + success: (res) => { if (res.code) { console.log('登录!', res) const data = { loginCode: res.code, } - if (that.pageLoading) { - that.pageLoading.show('登录中...') + if (this.pageLoading) { + this.pageLoading.show('登录中...') } wxLogin(data) - .then(res => { - if (that.pageLoading) { - that.pageLoading.hide() + .then((res) => { + if (this.pageLoading) { + this.pageLoading.hide() } forceHideLoading() - if (res.code == 200) { + if (res.code === 200) { console.log(res, 'resres') uni.setStorageSync('token', res.token) uni.showToast({ @@ -260,7 +260,7 @@ export default { duration: 1500, }) setTimeout(() => { - that.ceshi() + this.ceshi() }, 1500) } else { uni.showToast({ @@ -269,9 +269,9 @@ export default { }) } }) - .catch(error => { - if (that.pageLoading) { - that.pageLoading.hide() + .catch((error) => { + if (this.pageLoading) { + this.pageLoading.hide() } forceHideLoading() @@ -283,7 +283,7 @@ export default { }) } }, - fail(err) { + fail: (err) => { console.error('微信登录失败:', err) uni.showToast({ title: '微信登录失败', @@ -472,19 +472,19 @@ page { .popup-body { flex: 1; - padding: 30rpx; + overflow: hidden; position: relative; height: 0; } .terms-content { + padding: 20rpx; line-height: 1.8; font-size: 28rpx; color: #333; word-wrap: break-word; word-break: break-all; - padding-bottom: 20rpx; } .popup-footer { @@ -506,7 +506,7 @@ page { .popup-btn { width: 200rpx; height: 70rpx; - background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); + background: #f15a04; border-radius: 35rpx; font-size: 28rpx; color: #ffffff;