var util = require('../../utils/util.js'); var api = require('../../utils/service-api.js'); var app=getApp(); Page({ data: { //常量定义 JOIN_STATUS_NOT_JOIN : 0, //1加入状态确认中 JOIN_STATUS_ING : 1, //1加入状态加入成功 JOIN_STATUS_Y : 2, //1加入状态加入失败 JOIN_STATUS_N : 3, JOIN_STATUS_END : 4, interval: 2000, duration: 1000, art: { }, products: [ ], //展示相册 imgUrls: [], imagetext: ['活动说明'], currentTabsIndex: 0, shareShow: false, isShare: 0, qrcode:false, lxdh:{}, showModel:0, }, onLoad: function(options) { console.log(options) var id = options.id; this.setData({ id: id,shopId:app.shopInfo.id }); var _this = this; util.request({ method: 'GET', api: api.shalong.findSalongById + id, callback: function (data) { let activity = data.mapInfo.activity; activity.actContent = activity.actContent.replace(/0){ _this.setData({ showModel:_this.data.JOIN_STATUS_ING }); } } }); }, onShow(options) { }, // 回到首页 goBack() { wx.switchTab({ url: '../index/index' }) }, goIndex() { wx.reLaunch({ url: '/pages/index/index' }) }, //转发 onShareAppMessage(res) { var _this=this; var shopId=this.shopId; var title = this.data.activity.actName; var id = this.data.id; return { title: title, imageUrl: _this.data.activity.actImg, path: "/pages/shalong/shalongDetail?id=" + id + "&&shopId=" +shopId , } }, // 分享 share(e) { this.setData({ shareShow: true, popupShow: true }) }, // 图文选项卡 onTabsItemEvent(e) { var index = e.currentTarget.dataset.index; this.setData({ currentTabsIndex: index }) }, // 生成卡片跳转 card(e) { var id = e.currentTarget.dataset.id wx.navigateTo({ url: '../card/card?id=' + id, }) }, popupTap(e) { this.setData({ shareShow: false }) }, // 进入商品页 intoDetail(e) { var id = e.currentTarget.dataset.id; console.log(id); wx.navigateTo({ url: '/pages/product/details?id=' + id, }) }, })