first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:27:25 +08:00
commit 85b89ccea7
1694 changed files with 168292 additions and 0 deletions

33
com/share.js Normal file
View File

@@ -0,0 +1,33 @@
module.exports = {
onLoad(options) {
if (options && options.invite_code) {
uni.setStorageSync('invite_code', options.invite_code);
}
//设置默认的转发参数
uni.$u.mpShare = {
title: '羿充电', // 默认为小程序名称
path: '', // 默认为当前页面路径
imageUrl: '' // 默认为当前页面的截图
}
},
// #ifdef MP-WEIXIN
onShareAppMessage() {
let user = uni.getStorageSync('user');
let invite_code = user ? user.invite_code : '';
uni.$u.mpShare.path = uni.$u.page() + '?invite_code=' + invite_code; // 默认为当前页面路径
return uni.$u.mpShare
},
// #endif
// #ifdef MP-WEIXIN
onShareTimeline() {
let user = uni.getStorageSync('user');
let invite_code = user ? user.invite_code : '';
uni.$u.mpShare.path = uni.$u.page() + '?invite_code=' + invite_code; // 默认为当前页面路径
return uni.$u.mpShare
}
// #endif
}