Browse Source

fix(分享): 优化分享逻辑和隐私处理

修复分享链接生成逻辑,避免未登录时分享参数错误
添加隐私协议处理函数调用
调整部分UI元素的间距和尺寸
master
前端-胡立永 2 days ago
parent
commit
1449aef417
3 changed files with 23 additions and 7 deletions
  1. +16
    -2
      main.js
  2. +6
    -5
      pages/component/recycle.vue
  3. +1
    -0
      pages/index/index.vue

+ 16
- 2
main.js View File

@ -32,18 +32,32 @@ export function createApp() {
const userInfo = uni.getStorageSync('userInfo') || {}; const userInfo = uni.getStorageSync('userInfo') || {};
const logoName = uni.getStorageSync('logoName') || '' const logoName = uni.getStorageSync('logoName') || ''
const logoImage = uni.getStorageSync('logoImage') || '' const logoImage = uni.getStorageSync('logoImage') || ''
let path = '/pages/index/index'
if(userInfo.id){
path += '?shareId=' + (userInfo.id || '')
}
return { return {
title: '欢迎体验'+(logoName), title: '欢迎体验'+(logoName),
path: '/pages/index/index?shareId=' + (userInfo.id || ''),
path,
imageUrl: logoImage imageUrl: logoImage
} }
}, },
//分享到朋友圈 //分享到朋友圈
onShareTimeline() { onShareTimeline() {
const userInfo = uni.getStorageSync('userInfo') || {}; const userInfo = uni.getStorageSync('userInfo') || {};
let path = ''
if(userInfo.id){
query = 'shareId=' + (userInfo.id || '')
}
return { return {
title: '欢迎体验'+(logoName), title: '欢迎体验'+(logoName),
query: 'shareId=' + (userInfo.id || ''),
query,
imageUrl: logoImage imageUrl: logoImage
} }
} }


+ 6
- 5
pages/component/recycle.vue View File

@ -1681,7 +1681,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
gap: 10rpx;
gap: 5rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
@ -1700,7 +1700,7 @@ export default {
font-size: 36rpx; font-size: 36rpx;
color: #ff7a0e; color: #ff7a0e;
font-weight: bold; font-weight: bold;
margin: 0 4rpx;
margin: 0 0rpx;
white-space: nowrap; white-space: nowrap;
} }
@ -2037,6 +2037,7 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
min-width: 0; min-width: 0;
} }
.panel-item-name { .panel-item-name {
font-size: 30rpx; font-size: 30rpx;
@ -2064,7 +2065,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 30rpx;
// margin-right: 30rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.panel-quantity-control button { .panel-quantity-control button {
@ -2779,9 +2780,9 @@ export default {
align-items: center; align-items: center;
flex-shrink: 0; flex-shrink: 0;
white-space: nowrap; white-space: nowrap;
gap: 16rpx; //
gap: 0rpx; //
button { button {
width: 72rpx; //
width: 30rpx; //
height: 72rpx; height: 72rpx;
padding: 0; padding: 0;
margin: 0; margin: 0;


+ 1
- 0
pages/index/index.vue View File

@ -79,6 +79,7 @@
onLoad(query) { onLoad(query) {
if (query.shareId) { if (query.shareId) {
uni.setStorageSync('shareId', query.shareId) uni.setStorageSync('shareId', query.shareId)
this.handleAgreePrivacy()
} }
this.getConfigData() this.getConfigData()
}, },


Loading…
Cancel
Save