这次笔记只有逻辑代码:
<script>
const DETAIL_PAGE_PATH = '/pages/template/list2detail-detail/list2detail-detail';
function _handleShareChannels(provider) {
let channels = [];
for (let i = 0, len = provider.length; i < len; i++) {
switch (provider[i]) {
case 'weixin':
channels.push({
text: '分享到微信好友',
id: 'weixin',
sort: 0
});
channels.push({
text: '分享到微信朋友圈',
id: 'weixin',
sort: 1
});
break;
default:
break;
}
}
channels.sort(function(x, y) {
return x.sort - y.sort;
});
return channels;
}
export default {
data() {
return {
}
},
onNavigationBarButtonTap(event) {
const buttonIndex = event.index;
if (buttonIndex === 0) {
// 分享 H5 的页面
const shareProviders = [];
uni.getProvider({
service: 'share',