From f743011dadb21b5fb102aecdad35ce498eb72f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=99=96?= Date: Fri, 8 Mar 2019 15:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E5=88=86=E4=BA=AB=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/joinFrDpell/index.js | 15 ++++---- pages/spellDetail/index.js | 41 ++++++++++++++++++-- pages/spellDetail/index.wxml | 65 +++++++++++++------------------- pages/spellDetail/index.wxss | 5 ++- pages/spellGroup/spellGroup.js | 45 +++++++++++++++++++--- pages/spellGroup/spellGroup.wxml | 8 ++-- 6 files changed, 118 insertions(+), 61 deletions(-) diff --git a/pages/joinFrDpell/index.js b/pages/joinFrDpell/index.js index 9a9628d..da0f6d3 100644 --- a/pages/joinFrDpell/index.js +++ b/pages/joinFrDpell/index.js @@ -32,25 +32,26 @@ Page({ orderGroupId: options.orderGroupId, orderId:options.orderId }) - this.checkUser(); - this.getDetail(options.couponChannelId); - this.getOneSpell(options.couponId) + this.checkUser(options); }, /** * 判断用户是否已经在团中 */ - checkUser(){ + checkUser(options){ let that = this; Http.get({ url: config.api.queryAttendStatus, data: { - id: this.data.orderGroupId, + id: options.orderGroupId, } }).then(res => { - if (res.data==true) { + if (res.data.attend == true || res.data.status!=10) { wx.redirectTo({ - url: `/pages/spellDetail/index?orderId=${this.data.orderId}&couponId=${this.data.couponId}&orderGroupId=${this.data.orderGroupId}&couponChannelId=${this.data.couponChannelId}`, + url: `/pages/spellDetail/index?orderId=${options.orderId}&couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}`, }) + }else{ + that.getDetail(that.data.couponChannelId); + that.getOneSpell(that.data.couponId) } }); }, diff --git a/pages/spellDetail/index.js b/pages/spellDetail/index.js index d22ac1a..43b92e6 100644 --- a/pages/spellDetail/index.js +++ b/pages/spellDetail/index.js @@ -19,21 +19,55 @@ Page({ hour: "00", min: "00", sec: "00", - spellStatusList: spellStatus + spellStatusList: spellStatus, + isMyself:false + }, + gotoAgain(){ + let data = this.data.data; + wx.navigateTo({ + url: `/pages/spellGroup/mySpellGroup/index?couponId=${data.couponId}&couponChannelId=${data.couponChannelId}`, + }) + }, + gotoshare(){ + wx.navigateTo({ + url: `/pages/spellGroup/mySpellGroup/index?orderId=${this.data.paramData.orderId}&couponId=${this.data.paramData.couponId}&orderGroupId=${this.data.paramData.orderGroupId}&couponChannelId=${this.data.paramData.couponChannelId}`, + }) + }, + gotoSearch(){ + wx.navigateTo({ + url: `/pages/spellGroup/spellGroup`, + }) }, - /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - console.log(this.data.spellStatusList,7777777) + console.log(this.data.spellStatusList, options,7777777) this.setData({ paramData:options }) this.getDetail(options); + this.checkUser(options) // 关闭来自于左上角的分享 wx.hideShareMenu() }, + /** + * 判断用户是否已经在团中 + */ + checkUser(options) { + let that = this; + Http.get({ + url: config.api.queryAttendStatus, + data: { + id: options.orderGroupId, + } + }).then(res => { + console.log(res.data,3333333333) + that.setData({ + isMyself: res.data.attend + }) + }); + }, /** * 去使用 */ @@ -166,7 +200,6 @@ Page({ onReachBottom: function () { }, - /** * 用户点击右上角分享 */ diff --git a/pages/spellDetail/index.wxml b/pages/spellDetail/index.wxml index 3bc803b..902979f 100644 --- a/pages/spellDetail/index.wxml +++ b/pages/spellDetail/index.wxml @@ -1,16 +1,16 @@ - + {{data.statustext}} - 结束 - {{sec}} - : - {{min}} - : - {{hour}} - 剩余 + 结束 + {{sec}} + : + {{min}} + : + {{hour}} + 剩余 @@ -60,55 +60,43 @@ 拼团价 - + {{data.salePrice}} 实付款 - - - - 好友的拼团已完成 + + + + {{data.statustext}} - + - - - + + + - + - - - - - - - - - - - - - - + + ? - - - + + + - 广场地址:北京市朝阳区东三环中路123号 + 广场地址:{{data.addr}} @@ -124,7 +112,8 @@ - - + + + diff --git a/pages/spellDetail/index.wxss b/pages/spellDetail/index.wxss index 7fa4689..31dc406 100644 --- a/pages/spellDetail/index.wxss +++ b/pages/spellDetail/index.wxss @@ -105,12 +105,13 @@ page { } .tuan-icon{ position: absolute; - bottom: 20rpx; + bottom: 0rpx; left: 8rpx; width: 64rpx; height: 27rpx; } .tuan-icon image{ + display: block; width: 64rpx; height: 27rpx; } @@ -180,7 +181,7 @@ page { } .detail-top03{ float: left; - padding-top: 170rpx; + padding-top: 180rpx; width: 230rpx; } .detail-p-name{ diff --git a/pages/spellGroup/spellGroup.js b/pages/spellGroup/spellGroup.js index 0a31130..3b2eca1 100644 --- a/pages/spellGroup/spellGroup.js +++ b/pages/spellGroup/spellGroup.js @@ -46,6 +46,20 @@ Page({ }) this.getList(1, "spellList") }, + //去使用 + gotoUse(e){ + console.log(e) + wx.navigateTo({ + url: '/pages/couponorder/index/index', + }) + }, + //重新拼团 + gotoAgain(){ + let data = e.currentTarget.dataset.data + wx.navigateTo({ + url: `/pages/spellGroup/mySpellGroup/index?couponId=${data.couponId}&couponChannelId=${data.couponChannelId}`, + }) + }, //跳转到我的拼团详情 gotoStatusDetail(e){ console.log(e,333) @@ -94,6 +108,31 @@ Page({ } }, + /** + * 用户点击右上角分享 + */ + // paramData + onShareAppMessage: function (res) { + if (res.from === 'button') { + console.log(res, 3333333333333333333333) + // 来自页面内转发按钮 + let _this = this; + let data = res.target.dataset.data + return { + title: '拼团', + path: `/pages/index/index?couponId=${data.couponId}&orderGroupId=${data.orderGroupId}&couponChannelId=${data.couponChannelId}&orderId=${data.orderId}`, + imageUrl: data.coverImg, + success: function (res) { + // 转发成功 + }, + fail: function (res) { + // 转发失败 + } + } + } else { + console.log(res, 444444444444444444) + } + }, getList(pageNum, flag) { var that = this; console.log(pageNum) @@ -295,12 +334,6 @@ Page({ url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${couponChannelId}&couponId=${couponId}` }) } - }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - }, //加载更多 onReachBottom: function () { diff --git a/pages/spellGroup/spellGroup.wxml b/pages/spellGroup/spellGroup.wxml index ee5d1d1..49f24eb 100644 --- a/pages/spellGroup/spellGroup.wxml +++ b/pages/spellGroup/spellGroup.wxml @@ -52,13 +52,13 @@ - + - {{item.statusText}} + {{item.statusText}} - {{item.statusText}} + {{item.statusText}} - {{item.statusText}} + {{item.statusText}}