From d94bc88efc9fd5a0a9a0c2bd616eaf682dd7f031 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Fri, 6 Jun 2025 16:20:11 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/login.js | 107 +++++++++--------- pages/login.vue | 3 + pages/notice/detail.vue | 23 +++- .../uni-popup-share/uni-popup-share.vue | 19 +--- 4 files changed, 78 insertions(+), 74 deletions(-) diff --git a/api/login.js b/api/login.js index 48a11a6..cebebe3 100644 --- a/api/login.js +++ b/api/login.js @@ -1,75 +1,76 @@ import request from '@/utils/request' // 微信登录授权 -export function wxLogin(code, encryptedIv, encryptedData) { - const data = { - code, - encryptedIv, - encryptedData - } - return request({ - 'url': '/wxLogin', - headers: { - isToken: false - }, - 'method': 'post', - 'data': data - }) +export function wxLogin(code, encryptedIv, encryptedData, inviteId) { + const data = { + code, + encryptedIv, + encryptedData, + inviteId + } + return request({ + 'url': '/wxLogin', + headers: { + isToken: false + }, + 'method': 'post', + 'data': data + }) } // 登录方法 export function login(username, password, code, uuid) { - const data = { - username, - password, - code, - uuid - } - return request({ - 'url': '/login', - headers: { - isToken: false - }, - 'method': 'post', - 'data': data - }) + const data = { + username, + password, + code, + uuid + } + return request({ + 'url': '/login', + headers: { + isToken: false + }, + 'method': 'post', + 'data': data + }) } // 注册方法 export function register(data) { - return request({ - url: '/register', - headers: { - isToken: false - }, - method: 'post', - data: data - }) + return request({ + url: '/register', + headers: { + isToken: false + }, + method: 'post', + data: data + }) } // 获取用户详细信息 export function getInfo() { - return request({ - 'url': '/getInfo', - 'method': 'get' - }) + return request({ + 'url': '/getInfo', + 'method': 'get' + }) } // 退出方法 export function logout() { - return request({ - 'url': '/logout', - 'method': 'post' - }) + return request({ + 'url': '/logout', + 'method': 'post' + }) } // 获取验证码 export function getCodeImg() { - return request({ - 'url': '/captchaImage', - headers: { - isToken: false - }, - method: 'get', - timeout: 20000 - }) -} + return request({ + 'url': '/captchaImage', + headers: { + isToken: false + }, + method: 'get', + timeout: 20000 + }) +} \ No newline at end of file diff --git a/pages/login.vue b/pages/login.vue index 08e87aa..8f7dfcf 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -159,6 +159,9 @@ }, //向后端发起登录请求 sendWxLoginFormToLocalService() { + if (uni.getStorageSync("inviteId")) { + this.wxLoginForm.inviteId = uni.getStorageSync("inviteId") + } this.$store.dispatch('WxLogin', this.wxLoginForm).then(() => { this.$modal.closeLoading() this.loginSuccess() diff --git a/pages/notice/detail.vue b/pages/notice/detail.vue index 8afe63e..009c665 100644 --- a/pages/notice/detail.vue +++ b/pages/notice/detail.vue @@ -253,6 +253,9 @@ import html2canvas from 'html2canvas'; import shareImages from '@/components/hj-placard/shareImages.vue' import constant from '@/utils/constant'; + import { + getInfo + } from '@/api/login.js' import { changeUserType, getUserType, @@ -352,7 +355,8 @@ shareImage: '/static/bg.jpg', // 背景图片 qrSize: 100, // 二维码大小 qrUrl: 'https://ext.dcloud.net.cn/plugin?id=5747', // 生成二维码的链接 - type: 'common' + type: 'common', + isXs: '0' } }, onReady() { @@ -369,7 +373,6 @@ if (params.type) { this.type = params.type } - console.log(params, 336); this.noticeId = params.id if (params.noticeId && !this.noticeId) { this.noticeId = params.noticeId @@ -379,17 +382,27 @@ this.navigatePath = "/pages/index" } + if (params.inviteId) { + uni.setStorageSync("inviteId", params.inviteId) + } + }, onShow() { - this.$refs.popupNew.open('center') - console.log(366); if (null != getJSONData(constant.userInfo)) { this.userInfo = getJSONData(constant.userInfo) } + this.getRole() this.getDetail() this.viewNotice() }, methods: { + getRole() { + getInfo().then(res => { + if (res.roles.indexOf('xsry') > -1) { + this.isXs = '1' + } + }) + }, copyUrl(url) { uni.setClipboardData({ data: url, @@ -1117,4 +1130,4 @@ padding: 20rpx 0; } } - + \ No newline at end of file diff --git a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue index 669a400..e1badc9 100644 --- a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +++ b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue @@ -24,6 +24,7 @@ initVueI18n } from '@dcloudio/uni-i18n' import messages from '../uni-popup/i18n/index.js' + const { t } = initVueI18n(messages) @@ -57,22 +58,7 @@ text: '举报', icon: '/static/detail/jubao.png', name: 'jb' - }, - // { - // text: '新浪', - // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/0dacdbe0-50bf-11eb-8ff1-d5dcf8779628.png', - // name: 'sina' - // }, - // { - // text: '百度', - // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/1ec6e920-50bf-11eb-8a36-ebb87efcf8c0.png', - // name: 'copy' - // }, - // { - // text: '其他', - // icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/2e0fdfe0-50bf-11eb-b997-9918a5dda011.png', - // name: 'more' - // } + } ] } }, @@ -93,6 +79,7 @@ if (res.from === 'button') { // 来自页面内分享按钮 console.log(res.target) } + console.log(82); return { title: '【' + this.noticeDetail.platformName + '】' + this.noticeDetail.title, path: '/pages/notice/detail?id=' + this.noticeDetail.id