@@ -15,7 +15,6 @@ Page({ | |||||
close02: imgurl.close02.url, | close02: imgurl.close02.url, | ||||
share01: imgurl.share01.url, | share01: imgurl.share01.url, | ||||
fail: imgurl.fail.url, | fail: imgurl.fail.url, | ||||
share01: imgurl.share01.url, | |||||
wmhome: imgurl.wmhome.url, | wmhome: imgurl.wmhome.url, | ||||
hidden: "hidden", | hidden: "hidden", | ||||
height: "", | height: "", | ||||
@@ -856,6 +855,7 @@ Page({ | |||||
}, | }, | ||||
onShareAppMessage: function(options) { | onShareAppMessage: function(options) { | ||||
var that = this; | var that = this; | ||||
console.log(options) | |||||
var shareObj = { | var shareObj = { | ||||
title: that.data.data.title, | title: that.data.data.title, | ||||
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`, | path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`, | ||||
@@ -13,6 +13,17 @@ Page({ | |||||
}, | }, | ||||
onLoad: function(options) { | onLoad: function(options) { | ||||
var that = this; | var that = this; | ||||
console.log(options) | |||||
debugger | |||||
if (options && options.spellGroup){ | |||||
that.setData({ | |||||
spellGroup: options.spellGroup | |||||
}) | |||||
}else{ | |||||
that.setData({ | |||||
spellGroup: null | |||||
}) | |||||
} | |||||
if (options.couponChannelId && !options.cuserId||options.orderId) { | if (options.couponChannelId && !options.cuserId||options.orderId) { | ||||
that.setData({ | that.setData({ | ||||
couponChannelId: options.couponChannelId, | couponChannelId: options.couponChannelId, | ||||
@@ -89,17 +100,17 @@ Page({ | |||||
}); | }); | ||||
} else { | } else { | ||||
//返回主页 | //返回主页 | ||||
if (that.data.couponChannelId && !that.data.cuserId||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { | |||||
if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { | |||||
// 跳转普通券/消费卡/限时秒杀/砍价详情 | // 跳转普通券/消费卡/限时秒杀/砍价详情 | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | ||||
}); | }); | ||||
} else if (that.data.couponChannelId && that.data.cuserId) { | |||||
} else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup) { | |||||
// 来自转赠 | // 来自转赠 | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||
url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` | url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` | ||||
}); | }); | ||||
} else if (that.data.couponChannelId && app.globalData.type == 'sd') { | |||||
} else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { | |||||
// 拼团详情页 | // 拼团详情页 | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`, | url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`, | ||||
@@ -106,7 +106,7 @@ Page({ | |||||
return; | return; | ||||
} | } | ||||
else if (options && options.couponChannelId) { | |||||
else if (options && options.couponChannelId && !options.spellGroup) { | |||||
// 转赠判断 | // 转赠判断 | ||||
if (options.cuserId){ | if (options.cuserId){ | ||||
wx.redirectTo({ | wx.redirectTo({ | ||||
@@ -120,7 +120,7 @@ Page({ | |||||
} | } | ||||
} | } | ||||
// 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口) | // 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口) | ||||
else if (options && options.couponChannelId && app.globalData.type == 'sd') { | |||||
else if (options && options.couponChannelId && app.globalData.type == 'sd' || options && options.couponChannelId && options.spellGroup) { | |||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`, | url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`, | ||||
}) | }) | ||||
@@ -272,10 +272,19 @@ Page({ | |||||
}) | }) | ||||
return; | return; | ||||
} | } | ||||
if (options && options.couponChannelId && !options.cuserId) { | |||||
/** | |||||
* spellGroup | |||||
* 区分是通过拼团详情分享过来的还是从普通券分享过来的 | |||||
* 注意:拼团券和普通券是两个页面 | |||||
*/ | |||||
if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) { | |||||
wx.redirectTo({ | wx.redirectTo({ | ||||
url: `/pages/getuserinfo/index?couponChannelId=${options.couponChannelId}` | url: `/pages/getuserinfo/index?couponChannelId=${options.couponChannelId}` | ||||
}); | }); | ||||
} else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) { | |||||
wx.redirectTo({ | |||||
url: `/pages/getuserinfo/index?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}` | |||||
}); | |||||
} else if (options && options.couponChannelId && options.cuserId) { | } else if (options && options.couponChannelId && options.cuserId) { | ||||
/** | /** | ||||
* 转赠判断 | * 转赠判断 | ||||
@@ -263,45 +263,11 @@ Page({ | |||||
}); | }); | ||||
}); | }); | ||||
}, | }, | ||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function () { | |||||
}, | |||||
/** | /** | ||||
* 页面相关事件处理函数--监听用户下拉动作 | * 页面相关事件处理函数--监听用户下拉动作 | ||||
*/ | */ | ||||
onPullDownRefresh: function () { | onPullDownRefresh: function () { | ||||
this.getDetail(this.data.paramData.couponChannelId); | this.getDetail(this.data.paramData.couponChannelId); | ||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
} | } | ||||
}) | }) |
@@ -11,6 +11,7 @@ Page({ | |||||
data: { | data: { | ||||
teljpgUrl: imgurl.teljpg.url, | teljpgUrl: imgurl.teljpg.url, | ||||
wmhome: imgurl.wmhome.url, | wmhome: imgurl.wmhome.url, | ||||
share01: imgurl.share01.url, | |||||
couponChannelId: '', | couponChannelId: '', | ||||
couponId: '', | couponId: '', | ||||
data: null, | data: null, | ||||
@@ -184,7 +185,7 @@ Page({ | |||||
wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
let data = res.data; | let data = res.data; | ||||
wx.setNavigationBarTitle({ | wx.setNavigationBarTitle({ | ||||
title: res.data.title | |||||
title: res.data.title | |||||
}) | }) | ||||
data.price = (data.price / 100).toFixed(2) | data.price = (data.price / 100).toFixed(2) | ||||
data.salePrice = (data.salePrice / 100).toFixed(2); | data.salePrice = (data.salePrice / 100).toFixed(2); | ||||
@@ -202,21 +203,21 @@ Page({ | |||||
let that = this; | let that = this; | ||||
// 支付成功 | // 支付成功 | ||||
Http.post({ | Http.post({ | ||||
url: config.api.toOrderGroup, | |||||
data: { | |||||
id: orderGroupId, | |||||
orderId, | |||||
couponId: _this.data.data.couponId | |||||
} | |||||
}) | |||||
.then(res => { | |||||
wx.navigateTo({ | |||||
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
}) | |||||
url: config.api.toOrderGroup, | |||||
data: { | |||||
id: orderGroupId, | |||||
orderId, | |||||
couponId: _this.data.data.couponId | |||||
} | |||||
}) | |||||
.then(res => { | |||||
wx.navigateTo({ | |||||
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.data.couponId}&orderGroupId=${res.data.orderGroupId}&couponChannelId=${_this.data.couponChannelId}` | |||||
}); | |||||
}) | |||||
.catch(err => { | |||||
console.log(err); | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 支付订单更新 | * 支付订单更新 | ||||
@@ -226,31 +227,31 @@ Page({ | |||||
let that = this; | let that = this; | ||||
// 支付成功 | // 支付成功 | ||||
Http.post({ | Http.post({ | ||||
url: config.api.payOrderUpdate, | |||||
data: { | |||||
payOrderId: payOrderId, | |||||
orderId: orderId, | |||||
status: status, | |||||
reason: reason | |||||
} | |||||
}) | |||||
.then(res => { | |||||
wx.hideLoading() | |||||
if (orderGroupId == undefined) { | |||||
wx.navigateTo({ | |||||
url: '/pages/order/detail/index?orderId=' + res.data.id, | |||||
}) | |||||
} else { | |||||
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
if (err.code != 12002) { | |||||
setTimeout(function() { | |||||
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | |||||
}, 2000) | |||||
} | |||||
}) | |||||
url: config.api.payOrderUpdate, | |||||
data: { | |||||
payOrderId: payOrderId, | |||||
orderId: orderId, | |||||
status: status, | |||||
reason: reason | |||||
} | |||||
}) | |||||
.then(res => { | |||||
wx.hideLoading() | |||||
if (orderGroupId == undefined) { | |||||
wx.navigateTo({ | |||||
url: '/pages/order/detail/index?orderId=' + res.data.id, | |||||
}) | |||||
} else { | |||||
_this.goToOrderGroup(orderId, res.data.orderGroupId, _this) | |||||
} | |||||
}) | |||||
.catch(err => { | |||||
if (err.code != 12002) { | |||||
setTimeout(function() { | |||||
_this.payOrderUpdate(orderId, payOrderId, status, reason, _this, orderGroupId); | |||||
}, 2000) | |||||
} | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
* 发起支付 | * 发起支付 | ||||
@@ -345,12 +346,12 @@ Page({ | |||||
duration: 2000, | duration: 2000, | ||||
mask: false | mask: false | ||||
}); | }); | ||||
}else if (err.code == 3012) { | |||||
} else if (err.code == 3012) { | |||||
wx.showModal({ | wx.showModal({ | ||||
title: '提示', | title: '提示', | ||||
content: '您有未支付订单,请先进行支付', | content: '您有未支付订单,请先进行支付', | ||||
confirmText: "去支付", | confirmText: "去支付", | ||||
success: function (res) { | |||||
success: function(res) { | |||||
console.log(res.confirm) | console.log(res.confirm) | ||||
if (res.confirm) { | if (res.confirm) { | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
@@ -500,4 +501,25 @@ Page({ | |||||
that.getDetail(that.data.couponChannelId); | that.getDetail(that.data.couponChannelId); | ||||
that.getOneSpell(that.data.couponId) | that.getOneSpell(that.data.couponId) | ||||
}, | }, | ||||
onShareAppMessage: function (options) { | |||||
console.log(options) | |||||
var that = this; | |||||
var shareObj = { | |||||
title: that.data.data.title, | |||||
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}&spellGroup=spellGroup`, | |||||
success: function (res) { | |||||
if (res.errMsg == 'shareAppMessage:ok') { } | |||||
}, | |||||
fail: function (error) { | |||||
if (res.errMsg == 'shareAppMessage:fail cancel') { } else if (res.errMsg == 'shareAppMessage:fail') { } | |||||
} | |||||
}; | |||||
// 来自页面内的按钮的转发 | |||||
if (options.from == 'button') { | |||||
var eData = options.target.dataset.id; | |||||
shareObj.path = `/pages/index/index?couponChannelId=${eData}&spellGroup=spellGroup`; | |||||
} | |||||
// 返回shareObj | |||||
return shareObj; | |||||
}, | |||||
}) | }) |
@@ -6,6 +6,10 @@ | |||||
<view class='title'>{{data.title}}</view> | <view class='title'>{{data.title}}</view> | ||||
<view class='text'> | <view class='text'> | ||||
<view class='remark'>{{data.subTitle}}</view> | <view class='remark'>{{data.subTitle}}</view> | ||||
<view class='fenxiang' wx:if="{{data.type!=50&&data.type!=51}}"> | |||||
<image class="fenxiang" src='{{share01}}' mode="widthFix"></image> | |||||
<button class='share user-motto' data-id='{{data.id}}' data-couponId='{{data.couponId}}' data-title='{{data.title}}' id="shareBtn" open-type="share" hover-class="other-button-hover"></button> | |||||
</view> | |||||
<view class='des'> | <view class='des'> | ||||
<view class='des-peoplenum'>【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需</view> | <view class='des-peoplenum'>【拼团购】{{data.pressLimitNum}}人拼团成功,单价仅需</view> | ||||
<view class='des-saleprice'>{{data.salePriceStr}}元</view> | <view class='des-saleprice'>{{data.salePriceStr}}元</view> | ||||
@@ -44,6 +44,7 @@ button::after{ border: none; } | |||||
padding-bottom: 130rpx; | padding-bottom: 130rpx; | ||||
} | } | ||||
.text{ | .text{ | ||||
position: relative; | |||||
padding: 0 30rpx; | padding: 0 30rpx; | ||||
} | } | ||||
.title{ | .title{ | ||||
@@ -218,13 +219,11 @@ button::after{ border: none; } | |||||
font-family:PingFang-SC-Medium; | font-family:PingFang-SC-Medium; | ||||
font-weight:500; | font-weight:500; | ||||
color:rgba(254,254,254,1); | color:rgba(254,254,254,1); | ||||
margin-top: 6rpx; | |||||
} | } | ||||
.price-unit{ | .price-unit{ | ||||
display: inline; | display: inline; | ||||
font-size:27rpx; | font-size:27rpx; | ||||
line-height: 27rpx; | line-height: 27rpx; | ||||
margin-top: 11rpx; | |||||
font-family:PingFang-SC-Medium; | font-family:PingFang-SC-Medium; | ||||
font-weight:500; | font-weight:500; | ||||
color:rgba(254,254,254,1); | color:rgba(254,254,254,1); | ||||
@@ -394,4 +393,28 @@ button::after{ border: none; } | |||||
color: #fff; | color: #fff; | ||||
font-weight: bold; | font-weight: bold; | ||||
background: #ff4949; | background: #ff4949; | ||||
} | |||||
} | |||||
.fenxiang { | |||||
position:absolute; | |||||
right:28rpx; | |||||
top:-27rpx; | |||||
width:108rpx; | |||||
z-index:1000; | |||||
} | |||||
.fenxiang image { | |||||
width: 108rpx; | |||||
position: absolute; | |||||
top: 0; | |||||
right: 0; | |||||
z-index: 10; | |||||
} | |||||
.user-motto { | |||||
position: relative; | |||||
z-index: 100; | |||||
width:118rpx; | |||||
border:0; | |||||
background:none; | |||||
height:60rpx; | |||||
color:#fff; | |||||
} |