12.16提交
This commit is contained in:
@@ -310,8 +310,13 @@ function createNativePopup() {
|
||||
verticalAlign: 'middle',
|
||||
weight: '500'
|
||||
});
|
||||
const items = [
|
||||
{ id: 'it-wechat', text: '微信' },
|
||||
{ id: 'it-moments', text: '朋友圈' },
|
||||
// { id: 'it-weibo', text: '微博' }
|
||||
];
|
||||
// 三个分享项区域(使用图标)
|
||||
const itemW = screenW / 3;
|
||||
const itemW = screenW / items.length;
|
||||
const iconTop = contentTop;
|
||||
const textTop = iconTop + iconSize + uni.upx2px(16);
|
||||
|
||||
@@ -330,11 +335,7 @@ function createNativePopup() {
|
||||
'share_sina.png' // 微博
|
||||
];
|
||||
|
||||
const items = [
|
||||
{ id: 'it-wechat', text: '微信' },
|
||||
{ id: 'it-moments', text: '朋友圈' },
|
||||
{ id: 'it-weibo', text: '微博' }
|
||||
];
|
||||
|
||||
|
||||
items.forEach((it, idx) => {
|
||||
const left = idx * itemW;
|
||||
@@ -527,7 +528,7 @@ function createNativePopup() {
|
||||
|
||||
if (relativeY >= shareAreaTop && relativeY <= shareAreaBottom) {
|
||||
// 计算点击的是第几个分享项(0:微信, 1:朋友圈, 2:微博)
|
||||
const itemWidth = info.screenW / 3;
|
||||
const itemWidth = info.screenW / items.length;
|
||||
const idx = Math.min(2, Math.max(0, Math.floor(relativeX / itemWidth)));
|
||||
|
||||
console.log('点击了分享项:', idx, ', x =', relativeX, ', itemWidth =', itemWidth);
|
||||
@@ -542,8 +543,8 @@ function createNativePopup() {
|
||||
closeNativePopup();
|
||||
} else if (idx === 2) {
|
||||
console.log('执行微博分享');
|
||||
shareToWeibo();
|
||||
closeNativePopup();
|
||||
// shareToWeibo();
|
||||
// closeNativePopup();
|
||||
}
|
||||
} else {
|
||||
console.log('点击位置不在分享区域内, relativeY =', relativeY, ', 需要范围:', shareAreaTop, '到', shareAreaBottom);
|
||||
|
||||
Reference in New Issue
Block a user