1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- // pages/wv_page/index.js
- const { encodeParam, decodeParam, recordAccess } = require('../../utils/util.js');
- const { serverName, request } = require('../../utils/services');
- const app = getApp();
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- forwardImg:'https://4dscene.4dage.com/cgaii/images/join/forwardImg.jpg'
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- let id = (options.scene && decodeURIComponent(options.scene))|| options.id
- recordAccess({
- id
- })
- if (id){
- this.getExhibitionDetail(id)
- }
- },
- forward: function(url){
- this.setData({
- url: url.detail.data.pop()
- })
- },
-
- getExhibitionDetail: function (sceneId) {
- let exhibitionId = sceneId
- request["getExhibitionDetail"]({
- exhibitionId: exhibitionId
- }, "", res => {
- let { data: exhibitionDetail } = res.data;
- let { product } = exhibitionDetail
- this.setData({
- url: product.showLink,
- imageUrl: exhibitionDetail.imageUrl,
- relayUrl: exhibitionDetail.relayUrl,
- sceneId: exhibitionDetail.id
- })
- if (exhibitionDetail.name) {
- wx.setNavigationBarTitle({
- title: exhibitionDetail.name
- })
- }
- })
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- let {sceneId, imageUrl, relayUrl, forwardImg} = this.data;
- console.log(imageUrl || forwardImg)
- return {
- path: `/pages/wv_page/index?&id=${sceneId}`,
- imageUrl: relayUrl || imageUrl || forwardImg
- }
- }
- })
|