FIX
This commit is contained in:
+33
-1
@@ -1,6 +1,17 @@
|
||||
// app.ts
|
||||
// import { BASE_URL, appId } from './env'
|
||||
|
||||
// const DEFAULT_SHARE_CONFIG = {
|
||||
// title: '吉林敖东控糖胶囊 辅助降血糖',
|
||||
// imageUrl: '/pages/index/assets/test.jpg',
|
||||
// }
|
||||
|
||||
App<IAppOption>({
|
||||
globalData: {},
|
||||
globalData: {
|
||||
// shareConfig: { ...DEFAULT_SHARE_CONFIG },
|
||||
},
|
||||
|
||||
|
||||
onLaunch() {
|
||||
const updateManager = wx.getUpdateManager()
|
||||
|
||||
@@ -35,7 +46,28 @@ App<IAppOption>({
|
||||
const envVersion = wx.getAccountInfoSync().miniProgram.envVersion
|
||||
if (envVersion !== 'release') {
|
||||
wx.reLaunch({ url: '/pages/tools/index' })
|
||||
return
|
||||
}
|
||||
|
||||
// this.fetchShareConfig()
|
||||
|
||||
},
|
||||
// fetchShareConfig() {
|
||||
// wx.request({
|
||||
// url: `${BASE_URL}/api/ad/ww-join-fans/share/${appId}`,
|
||||
// method: 'GET',
|
||||
// success: (res: any) => {
|
||||
// const data = res.data?.data ?? res.data
|
||||
// if (data?.title || data?.imageUrl) {
|
||||
// this.globalData.shareConfig = {
|
||||
// title: data.title || DEFAULT_SHARE_CONFIG.title,
|
||||
// imageUrl: data.imageUrl || DEFAULT_SHARE_CONFIG.imageUrl,
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// fail: () => {
|
||||
// // 请求失败时继续使用默认分享文案和背景图
|
||||
// },
|
||||
// })
|
||||
// },
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// index.ts
|
||||
import { BASE_URL, appId } from '../../env'
|
||||
|
||||
|
||||
Component({
|
||||
data: {
|
||||
showPopup: false,
|
||||
@@ -17,16 +18,18 @@ Component({
|
||||
methods: {
|
||||
// 转发给好友
|
||||
onShareAppMessage() {
|
||||
|
||||
return {
|
||||
title: '吉林敖东控糖胶囊 辅助降血糖 ¥89.22起',
|
||||
path: '/pages/index/index',
|
||||
title: '吉林敖东控糖胶囊 辅助降血糖',
|
||||
|
||||
imageUrl: '/pages/index/assets/test.jpg',
|
||||
}
|
||||
},
|
||||
// 分享到朋友圈
|
||||
onShareTimeline() {
|
||||
|
||||
return {
|
||||
title: '吉林敖东控糖胶囊 辅助降血糖 ¥89.22起',
|
||||
title: '吉林敖东控糖胶囊 辅助降血糖',
|
||||
imageUrl: '/pages/index/assets/test.jpg',
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user