一. 安装 npm。
二. 自定义 底部 tab bar。
三. 短视频模式 video-swiper。
四. 全局分享。
app.js
App({
onLaunch() {
this.onShare();
},
// 自定义全局分享
onShare() {
wx.onAppRoute((res) => {
//获取当前页面的对象
let pages = getCurrentPages();
let view = pages[pages.length - 1];
if (view) {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
let shareOption = JSON.parse(JSON.stringify(view.options));
let shareOptionStr = '';
for (let i in shareOption) {
shareOptionStr += `&${i}=${shareOption[i]}`
};
if (!view.onShareAppMessage &&
Object.prototype.toString.call(view.onShareAppMessage) !== '[object Function]') {
view.onShareAppMessage = function () {
return {
title: 'xxx',
path: view.route + (!shareOptionStr ? '' : '?' + shareOptionStr)
}
};
};
if (!view.onShareTimeline &&
Object.prototype.toString.call(view.onShareTimeline) !== '[object Function]') {
view.onShareTimeline = function () {
return {
title: 'xxx',
path: view.route + (!shareOptionStr ? '' : '?' + shareOptionStr)
}
};
};
};
});
},
})
Good luck。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。