init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.view12 {
|
||||
display: none;
|
||||
font-size: larger;
|
||||
background-color: aqua;
|
||||
}
|
||||
|
||||
.container {
|
||||
font-size: 12rpx;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
Page({
|
||||
data: {},
|
||||
onShareAppMessage(args) {
|
||||
console.log(' ==== onShareAppMessage 站内分享 log ===', args);
|
||||
const promise = new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
title: '这是测试 promise 转发标题',
|
||||
});
|
||||
}, 2000);
|
||||
});
|
||||
return {
|
||||
title: '这是测试转发标题',
|
||||
path: 'pages/index/detail?id=123',
|
||||
promise,
|
||||
};
|
||||
},
|
||||
onShareTimeline(res) {
|
||||
console.log(' ==== onShareTimeline 微信朋友圈分享 log ===', res);
|
||||
return {
|
||||
title: '这是微信「朋友圈」测试标题',
|
||||
path: 'pages/index/index?id=123',
|
||||
};
|
||||
},
|
||||
onShareChat(res) {
|
||||
console.log(' ==== onShareTimeline 微信聊天分享 log ===', res);
|
||||
return {
|
||||
title: '这是微信「聊天」测试标题',
|
||||
path: 'pages/index/index',
|
||||
};
|
||||
},
|
||||
nav() {
|
||||
xhs.navigateTo({
|
||||
url: '../detail/index',
|
||||
});
|
||||
},
|
||||
navAsync() {
|
||||
xhs.navigateTo({
|
||||
url: '../async/index',
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"enablePullDownRefresh": true,
|
||||
"disableScroll": false
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<view class="container">
|
||||
<view>share-entrance</view>
|
||||
<view>
|
||||
<view>当前页面配置了 onShareTimeline, onShareChat, onShareAppMessage</view>
|
||||
</view>
|
||||
|
||||
<button bindtap="nav"> 跳转 detail 测试 </button>
|
||||
<button bindtap="navAsync"> 跳转测试 shareChat 异步 </button>
|
||||
|
||||
<button open-type="share" data-share-type="normal"> open type share 测试 data-set = "normal"</button>
|
||||
<button open-type="share" data-share-type="shareTimeline"> open type share 测试 data-set = "shareTimeline"</button>
|
||||
<button open-type="share" data-share-type="shareChat"> open type share 测试 data-set = "shareChat"</button>
|
||||
</view>
|
||||
Reference in New Issue
Block a user