@@ -306,7 +306,9 @@ var config = { | |||||
activityJoin:"/wxActivityJoin/join", | activityJoin:"/wxActivityJoin/join", | ||||
//签到 | //签到 | ||||
activitySign:"/wxActivityJoin/sign", | activitySign:"/wxActivityJoin/sign", | ||||
activityList: "/wxActivityJoin/list" | |||||
activityList: "/wxActivityJoin/list", | |||||
//获取未支付的订单 | |||||
getUnPaidOrder: "/order/getUnPaidOrder" | |||||
}, | }, | ||||
weapp: { | weapp: { | ||||
AppId: weappId | AppId: weappId | ||||
@@ -572,8 +572,12 @@ Page({ | |||||
/** | /** | ||||
* 邀请好友继续砍价 | * 邀请好友继续砍价 | ||||
*/ | */ | ||||
inviteFriend: function() { | |||||
inviteFriend: function(e) { | |||||
let that = this; | let that = this; | ||||
let formId = e.detail.formId; | |||||
that.setData({ | |||||
formId: formId | |||||
}) | |||||
that.orderFunc("discount"); | that.orderFunc("discount"); | ||||
that.setData({ | that.setData({ | ||||
showbutton1: true | showbutton1: true | ||||
@@ -762,16 +766,17 @@ Page({ | |||||
}); | }); | ||||
} else if (err.code == 3012) { | } else if (err.code == 3012) { | ||||
if(that.data.data.type == 8){ | if(that.data.data.type == 8){ | ||||
wx.showModal({ | |||||
title: '提示', | |||||
content: "您有未支付订单,请到'我的-我的砍价'进行支付", | |||||
showCancel:false, | |||||
success: function (res) { | |||||
console.log(res.confirm) | |||||
if (res.confirm) { | |||||
} | |||||
} | |||||
}) | |||||
that.getUnPaidOrder(that.data.couponId); | |||||
// wx.showModal({ | |||||
// title: '提示', | |||||
// content: "您有未支付订单,请到'我的-我的砍价'进行支付", | |||||
// showCancel:false, | |||||
// success: function (res) { | |||||
// console.log(res.confirm) | |||||
// if (res.confirm) { | |||||
// } | |||||
// } | |||||
// }) | |||||
}else{ | }else{ | ||||
wx.showModal({ | wx.showModal({ | ||||
title: '提示', | title: '提示', | ||||
@@ -914,7 +919,20 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
// 获得未支付的订单 | |||||
getUnPaidOrder(couponId){ | |||||
let that = this; | |||||
Http.get({ | |||||
url: config.api.getUnPaidOrder, | |||||
data: { | |||||
couponId: couponId | |||||
} | |||||
}).then(res=>{ | |||||
console.log(res); | |||||
}).catch(error=>{ | |||||
console.log(error) | |||||
}) | |||||
}, | |||||
onShow() { | onShow() { | ||||
this.setData({ | this.setData({ | ||||
showbutton: false, | showbutton: false, | ||||
@@ -144,9 +144,11 @@ | |||||
<text>立即购买</text> | <text>立即购买</text> | ||||
</button> | </button> | ||||
</form> | </form> | ||||
<button class="fr" bindtap='inviteFriend' disabled='{{showbutton1}}'> | |||||
发起砍价 | |||||
</button> | |||||
<form bindsubmit="inviteFriend" report-submit='true' class="fr"> | |||||
<button form-type="submit" style='background:transparent;color:#fff;font-size:32rpx;line-height:91rpx;' disabled='{{showbutton1}}'> | |||||
发起砍价 | |||||
</button> | |||||
</form> | |||||
</view> | </view> | ||||
<!-- 问卷调查 --> | <!-- 问卷调查 --> | ||||
@@ -558,7 +558,7 @@ button::after { | |||||
background: #fff; | background: #fff; | ||||
} | } | ||||
.btns > button,.btns .fl { | |||||
.btns .fr,.btns .fl { | |||||
width: 277rpx; | width: 277rpx; | ||||
height: 95rpx; | height: 95rpx; | ||||
border-radius: 48rpx; | border-radius: 48rpx; | ||||
@@ -13,6 +13,7 @@ Page({ | |||||
flagsex: 0, | flagsex: 0, | ||||
useImg:0, | useImg:0, | ||||
showReceiptUrl:false, | showReceiptUrl:false, | ||||
receiptUrl:"", | |||||
items: [{ | items: [{ | ||||
name: 1, | name: 1, | ||||
value: '男', | value: '男', | ||||
@@ -140,18 +141,23 @@ Page({ | |||||
} else { | } else { | ||||
console.log(that.data.answer) | console.log(that.data.answer) | ||||
if (this.data.answerflag == 'noanswer'){ | if (this.data.answerflag == 'noanswer'){ | ||||
}else{ | }else{ | ||||
let data ={}; | |||||
data = { | |||||
sex: sex, | |||||
address: address, | |||||
name: username, | |||||
birthday: birthday, | |||||
answer: JSON.stringify(that.data.answer), | |||||
activityId: that.data.activityId | |||||
}; | |||||
if (that.data.receiptUrl){ | |||||
data.imgUrl = "[" + '"' + that.data.receiptUrl + '"' + "]"; | |||||
} | |||||
Http.post({ | Http.post({ | ||||
url: config.api.activityJoin, | url: config.api.activityJoin, | ||||
data: { | |||||
sex: sex, | |||||
address: address, | |||||
name: username, | |||||
birthday: birthday, | |||||
answer: JSON.stringify(that.data.answer), | |||||
activityId: that.data.activityId | |||||
} | |||||
data: data | |||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
wx.reLaunch({ | wx.reLaunch({ | ||||