// pages/scene/scene.js const api = require('../../config/api.js'); import config from '../../config' var getUserInfo = require('../../utils/getUserInfo').default; Page({ onLoad() { this.setData({ url: '' }) }, getUserInfo, /** * 生命周期函数--监听页面加载 */ onShow: async function () { // let { data: { brand } } = await util.request(api.BrandDetail, options) let options = this.options let brand = { sceneNum: options.scene, // sceneNum: 't-sfytakg', id: options.id, shareUserId: options.shareUserId } let userInfo = this.getUserInfo() let query = { m: brand.sceneNum, id: brand.id, fireId: options.id, shareUserId: brand.shareUserId, token: wx.getStorageSync('token'), detailApi: api.fireDetail, userId: userInfo.id, attachListApi: api.getAttachList, } let url = config.viewHost + '?' + Object.keys(query).map(key => `${key}=${query[key]}`).join('&') wx.setNavigationBarTitle({ title: brand.name }) if (userInfo.id) { this.setData({ url }) } getApp().orderBuyCbs((order) => { setTimeout(() => { this.addOrderNew = true this.setData({ url: url + '#' + JSON.stringify(order) }) }, 300) }) }, /** * 用户点击右上角分享 */ onShareAppMessage: function (res) { let userInfo = this.getUserInfo() let title = '【好友推荐】场景还原,实现线上选座' if (this.addOrderNew) { title = '【好友分享】特设薄宴,静待贵客' } return { title, imageUrl: '/static/images/share.png', path: `pages/scene/scene?id=${this.options.id}&scene=${this.options.scene}&shareUserId=${userInfo.id}` } }, })