Showing
1 changed file
with
97 additions
and
86 deletions
| @@ -3,96 +3,107 @@ import App from '../../utils/api'; | @@ -3,96 +3,107 @@ import App from '../../utils/api'; | ||
| 3 | import TP from '../../utils/tpls'; | 3 | import TP from '../../utils/tpls'; |
| 4 | import RS from '../../utils/reserveStatus' | 4 | import RS from '../../utils/reserveStatus' |
| 5 | Page({ | 5 | Page({ |
| 6 | - /** | ||
| 7 | - * 页面的初始数据 | ||
| 8 | - */ | ||
| 9 | - data: { | ||
| 10 | - options: { | ||
| 11 | - tplid: '' | ||
| 12 | - }, | ||
| 13 | - }, | ||
| 14 | - /** | ||
| 15 | - * 生命周期函数--监听页面加载 | ||
| 16 | - */ | ||
| 17 | - onLoad(options) { | ||
| 18 | - let param = { | ||
| 19 | - options: options, | ||
| 20 | - } | ||
| 21 | - param.tpls = [TP.tpls(options.tplid)] | ||
| 22 | - console.log(param); | ||
| 23 | - console.log(options); | ||
| 24 | - this.setData(param) | ||
| 25 | - this.getDetail() | ||
| 26 | - }, | ||
| 27 | - // 页面滚动事件 | ||
| 28 | - onPageScroll: function (event) {}, | ||
| 29 | - /** | ||
| 30 | - * 用户点击右上角分享 | ||
| 31 | - */ | ||
| 32 | - onShareAppMessage: function () {}, | ||
| 33 | - /** | ||
| 34 | - * 监听用户点击分享到朋友圈按钮的操作 | ||
| 35 | - */ | ||
| 36 | - onShareTimeline() {}, | ||
| 37 | - /** | ||
| 38 | - * 生命周期函数--监听页面显示 | ||
| 39 | - */ | ||
| 40 | - onShow: function () {}, | ||
| 41 | - // 获取店铺详情 | ||
| 42 | - getDetail() { | ||
| 43 | - App.Reserve.Detail({ | ||
| 44 | - openid: getApp().openid, | ||
| 45 | - rid: this.data.options.id | ||
| 46 | - }).then(res => { | ||
| 47 | - this.getSellerTemplateConfFun(RS.reserve(res.data).sid); | ||
| 48 | - }).catch(res => { | ||
| 49 | - console.log(res, '详情请求失败'); | ||
| 50 | - }) | ||
| 51 | - }, | ||
| 52 | - // 获取商家设置营销信息 | ||
| 53 | - getSellerTemplateConfFun(sid) { | ||
| 54 | - App.Seller.GetSellerTemplateConf({ | ||
| 55 | - sid | ||
| 56 | - }).then(res => { | ||
| 57 | - let data = res.data | ||
| 58 | - let url = ''; | ||
| 59 | - if (data.type) { | ||
| 60 | - url = '/pages/customer/detail_owner_invitation' + data.type; | ||
| 61 | - } else { | ||
| 62 | - url = '/pages/customer/detail_owner_invitation6'; | ||
| 63 | - } | ||
| 64 | - url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid; | ||
| 65 | - console.log('url', url); | ||
| 66 | - wx.redirectTo({ | ||
| 67 | - url | ||
| 68 | - }) | ||
| 69 | - }).catch(res => { | ||
| 70 | - console.log('GetSellerTemplateConf请求失败'); | ||
| 71 | - }) | ||
| 72 | - }, | ||
| 73 | - /** | ||
| 74 | - * 生命周期函数--监听页面隐藏 | ||
| 75 | - */ | ||
| 76 | - onHide() {}, | 6 | + /** |
| 7 | + * 页面的初始数据 | ||
| 8 | + */ | ||
| 9 | + data: { | ||
| 10 | + options: { | ||
| 11 | + tplid: '' | ||
| 12 | + }, | ||
| 13 | + }, | ||
| 14 | + /** | ||
| 15 | + * 生命周期函数--监听页面加载 | ||
| 16 | + */ | ||
| 17 | + onLoad(options) { | ||
| 18 | + let param = { | ||
| 19 | + options: options, | ||
| 20 | + } | ||
| 21 | + param.tpls = [TP.tpls(options.tplid)] | ||
| 22 | + console.log(param); | ||
| 23 | + console.log(options); | ||
| 24 | + this.setData(param) | ||
| 25 | + this.getDetail() | ||
| 26 | + this.setSetRelation() | ||
| 27 | + }, | ||
| 28 | + // 页面滚动事件 | ||
| 29 | + onPageScroll: function (event) {}, | ||
| 30 | + /** | ||
| 31 | + * 用户点击右上角分享 | ||
| 32 | + */ | ||
| 33 | + onShareAppMessage: function () {}, | ||
| 34 | + /** | ||
| 35 | + * 监听用户点击分享到朋友圈按钮的操作 | ||
| 36 | + */ | ||
| 37 | + onShareTimeline() {}, | ||
| 38 | + /** | ||
| 39 | + * 生命周期函数--监听页面显示 | ||
| 40 | + */ | ||
| 41 | + onShow: function () {}, | ||
| 42 | + // 设置关系 | ||
| 43 | + setSetRelation() { | ||
| 44 | + if (this.data.options && this.data.options.uid) { | ||
| 45 | + App.Activity.SetRelation({ | ||
| 46 | + uid: this.data.options.uid, | ||
| 47 | + }).then(res => { | ||
| 48 | + console.log('设置关系', res); | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + }, | ||
| 52 | + // 获取店铺详情 | ||
| 53 | + getDetail() { | ||
| 54 | + App.Reserve.Detail({ | ||
| 55 | + openid: getApp().openid, | ||
| 56 | + rid: this.data.options.id | ||
| 57 | + }).then(res => { | ||
| 58 | + this.getSellerTemplateConfFun(RS.reserve(res.data).sid); | ||
| 59 | + }).catch(res => { | ||
| 60 | + console.log(res, '详情请求失败'); | ||
| 61 | + }) | ||
| 62 | + }, | ||
| 63 | + // 获取商家设置营销信息 | ||
| 64 | + getSellerTemplateConfFun(sid) { | ||
| 65 | + App.Seller.GetSellerTemplateConf({ | ||
| 66 | + sid | ||
| 67 | + }).then(res => { | ||
| 68 | + let data = res.data | ||
| 69 | + let url = ''; | ||
| 70 | + if (data.type) { | ||
| 71 | + url = '/pages/customer/detail_owner_invitation' + data.type; | ||
| 72 | + } else { | ||
| 73 | + url = '/pages/customer/detail_owner_invitation6'; | ||
| 74 | + } | ||
| 75 | + url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid; | ||
| 76 | + console.log('url', url); | ||
| 77 | + wx.redirectTo({ | ||
| 78 | + url | ||
| 79 | + }) | ||
| 80 | + }).catch(res => { | ||
| 81 | + console.log('GetSellerTemplateConf请求失败'); | ||
| 82 | + }) | ||
| 83 | + }, | ||
| 84 | + /** | ||
| 85 | + * 生命周期函数--监听页面隐藏 | ||
| 86 | + */ | ||
| 87 | + onHide() {}, | ||
| 77 | 88 | ||
| 78 | - /** | ||
| 79 | - * 生命周期函数--监听页面卸载 | ||
| 80 | - */ | ||
| 81 | - onUnload() { | 89 | + /** |
| 90 | + * 生命周期函数--监听页面卸载 | ||
| 91 | + */ | ||
| 92 | + onUnload() { | ||
| 82 | 93 | ||
| 83 | - }, | 94 | + }, |
| 84 | 95 | ||
| 85 | - /** | ||
| 86 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 87 | - */ | ||
| 88 | - onPullDownRefresh() { | 96 | + /** |
| 97 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 98 | + */ | ||
| 99 | + onPullDownRefresh() { | ||
| 89 | 100 | ||
| 90 | - }, | 101 | + }, |
| 91 | 102 | ||
| 92 | - /** | ||
| 93 | - * 页面上拉触底事件的处理函数 | ||
| 94 | - */ | ||
| 95 | - onReachBottom() { | 103 | + /** |
| 104 | + * 页面上拉触底事件的处理函数 | ||
| 105 | + */ | ||
| 106 | + onReachBottom() { | ||
| 96 | 107 | ||
| 97 | - }, | 108 | + }, |
| 98 | }) | 109 | }) |
-
Please register or login to post a comment