登录页面两种文章的获取

This commit is contained in:
WindowBird 2025-08-19 16:02:13 +08:00
parent 37fb325872
commit b40da3b4c1
2 changed files with 22 additions and 22 deletions

View File

@ -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:隐私政策
},
})
}

View File

@ -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;