| @@ -177,11 +177,12 @@ Page({ | |||
| /** | |||
| * 如果是重新砍价,需要重新下单 | |||
| */ | |||
| orderSave: function (couponId,couponChannelId) { | |||
| orderSave: function (couponId,couponChannelId,formId) { | |||
| Http.post({ | |||
| url: config.api.orderSave, | |||
| data: { | |||
| couponId: "" + couponId, | |||
| formId:formId, | |||
| couponChannelId:""+couponChannelId, | |||
| press: true | |||
| } | |||
| @@ -210,10 +211,11 @@ Page({ | |||
| barginAgain: function (e) { | |||
| let that = this; | |||
| console.log(e) | |||
| let formId = e.detail.formId; | |||
| let couponId = e.currentTarget.dataset.couponid; | |||
| let couponChannelId = e.currentTarget.dataset.couponchannelid; | |||
| // let orderId = e.currentTarget.dataset.id; | |||
| that.orderSave(couponId,couponChannelId) | |||
| that.orderSave(couponId,couponChannelId,formId) | |||
| }, | |||
| mybargain: function () { | |||
| let that = this; | |||
| @@ -39,10 +39,15 @@ | |||
| <view class="botton2" hover-class="none" hover-stop-propagation="false">立即支付</view> | |||
| <image class="icon" src="{{bargainsuccess}}" lazy-load="true"/> | |||
| </view> | |||
| <view class='again' wx:if="{{item.orderStatus == 8||item.orderStatus == 6&&todayDate>item.pressEndDate}}" data-couponChannelId="{{item.couponChannelId}}" data-couponId="{{item.productId}}" data-id="{{item.id}}" bindtap="barginAgain"> | |||
| <view class="botton3" hover-class="none" hover-stop-propagation="false">重新砍价</view> | |||
| <image class="icon" src="{{bargainfail}}" lazy-load="true"/> | |||
| </view> | |||
| <form bindsubmit="submit" report-submit='true' > | |||
| <view class='again' wx:if="{{item.orderStatus == 8||item.orderStatus == 6&&todayDate>item.pressEndDate}}" | |||
| data-couponChannelId="{{item.couponChannelId}}" data-couponId="{{item.productId}}" data-id="{{item.id}}" bindtap="barginAgain"> | |||
| <button form-type="submit" class="botton3" hover-class="none" hover-stop-propagation="false">重新砍价</button> | |||
| <image class="icon" src="{{bargainfail}}" lazy-load="true"/> | |||
| </view> | |||
| </form> | |||
| <view wx:if="{{item.orderStatus == 2 || item.orderStatus == 9}}"> | |||
| <image class="icon" style="margin-top:60rpx;" src="{{bargaincancel}}" lazy-load="true"/> | |||
| </view> | |||
| @@ -297,6 +297,7 @@ Page({ | |||
| */ | |||
| orderFunc1(e) { | |||
| var that = this; | |||
| let formId = e.detail.formId; | |||
| that.setData({ | |||
| showButton: true | |||
| }) | |||
| @@ -313,7 +314,8 @@ Page({ | |||
| */ | |||
| var data = { | |||
| couponChannelId:e.currentTarget.dataset.couponchannelid, | |||
| couponId:e.currentTarget.dataset.couponid | |||
| couponId:e.currentTarget.dataset.couponid, | |||
| formId:formId | |||
| } | |||
| return Http.post({ | |||
| url: config.api.orderSave, | |||
| @@ -60,13 +60,15 @@ | |||
| </view> | |||
| </view> | |||
| <view class="btns clearfix" wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1&&data.orderStatus != 9}}" hover-class="none" hover-stop-propagation="false"> | |||
| <button class="fl" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'> | |||
| <text>{{data.price/100}}元</text> | |||
| <text>立即购买</text> | |||
| </button> | |||
| <button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友砍价</button> | |||
| </view> | |||
| <form bindsubmit="submit" report-submit='true' > | |||
| <view class="btns clearfix" wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1&&data.orderStatus != 9}}" hover-class="none" hover-stop-propagation="false"> | |||
| <button class="fl" form-type="submit" bindtap='orderFunc1' data-couponChannelId="{{data.couponChannelId}}" data-price="{{data.price/100}}" data-couponId="{{data.productId}}" disabled='{{showButton}}' data-rushtobuy='rushtobuy'> | |||
| <text>{{data.price/100}}元</text> | |||
| <text>立即购买</text> | |||
| </button> | |||
| <button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友砍价</button> | |||
| </view> | |||
| </form> | |||
| <view style='display:{{display}}' wx:if="{{data.orderStatus == 7&&discountStatus == 1}}" class="btns01 clearfix" hover-class="none" hover-stop-propagation="false"> | |||
| <button bindtap='orderFunc' data-orderId="{{data.id}}" data-salePrice="{{data.salePrice/100}}" hover-class="other-button-hover">{{data.salePrice/100}}元 底价购买</button> | |||
| </view> | |||
| @@ -324,7 +324,7 @@ Page({ | |||
| .then(res => { | |||
| var data = { | |||
| couponChannelId: "" + that.data.couponChannelId, | |||
| couponId: "" + that.data.couponId | |||
| couponId: "" + that.data.couponId, | |||
| }; | |||
| if (that.data.couponChannelId == null) { | |||
| var data = { | |||
| @@ -254,6 +254,7 @@ Page({ | |||
| */ | |||
| gotopay: function(e) { | |||
| let that = this; | |||
| console.log(e) | |||
| let formId = e.detail.formId; | |||
| var discount = e.currentTarget.dataset.discount; | |||
| that.setData({ | |||
| @@ -105,16 +105,18 @@ | |||
| </view> | |||
| </form> | |||
| </view> | |||
| <view wx:if="{{data.remainInventory!=0&&data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||
| <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <button class="fl" bindtap='gotopay' data-discount='discount1' disabled='{{showbutton}}'> | |||
| <text>{{data.priceStr}}元</text> | |||
| <text>立即购买</text> | |||
| </button> | |||
| <button class="fr" bindtap='inviteFriend' disabled='{{showbutton1}}'> | |||
| 发起砍价 | |||
| </button> | |||
| </view> | |||
| <form bindsubmit="submit" report-submit='true' > | |||
| <view wx:if="{{data.remainInventory!=0&&data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||
| <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <button class="fl" form-type="submit" bindtap='gotopay' data-discount='discount1' disabled='{{showbutton}}'> | |||
| <text>{{data.priceStr}}元</text> | |||
| <text>立即购买</text> | |||
| </button> | |||
| <button class="fr" bindtap='inviteFriend' disabled='{{showbutton1}}'> | |||
| 发起砍价 | |||
| </button> | |||
| </view> | |||
| </form> | |||
| <!-- 问卷调查 --> | |||
| <view class="b1" style="opacity:{{opacity}};display: {{display}};" animation="{{queueData}}"> | |||
| @@ -84,8 +84,12 @@ Page({ | |||
| /** | |||
| * 直接购买 | |||
| */ | |||
| gotoBuy() { | |||
| gotoBuy(e) { | |||
| console.log(22222) | |||
| let formId = e.detail.formId; | |||
| that.setData({ | |||
| formId:formId | |||
| }) | |||
| this.setData({ | |||
| canBuyIf: false | |||
| }) | |||
| @@ -272,7 +276,8 @@ Page({ | |||
| orderFunc(orderGroupId) { | |||
| let data = { | |||
| couponChannelId: this.data.data.id, | |||
| couponId: this.data.data.couponId | |||
| couponId: this.data.data.couponId, | |||
| orderId:this.data.formId | |||
| } | |||
| /** | |||
| * 拼团订单 | |||
| @@ -43,24 +43,29 @@ | |||
| <image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" /> | |||
| </view> | |||
| </view> | |||
| <view class='edit'> | |||
| <button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <view class='edit-left' wx:if='{{data.id}}' bindtap='{{canBuyIf?"gotoBuy":""}}'> | |||
| <view class='edit-left-top'> | |||
| <view class='price'>{{data.price}}</view> | |||
| <view class='price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-left-bottom'>立即购买</view> | |||
| </view> | |||
| <!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
| <view class='edit-right' wx:if='{{data.id}}' bindtap='{{canSpell?"gotoSpell":""}}'> | |||
| <view class='edit-right-top'> | |||
| <view class='real-price'>{{data.salePrice}}</view> | |||
| <view class='real-price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-right-bottom'>参加拼团</view> | |||
| <form bindsubmit="submit" report-submit='true' > | |||
| <view class='edit'> | |||
| <button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <button form-type="submit" class='edit-left' wx:if='{{data.id}}' bindtap='{{canBuyIf?"gotoBuy":""}}'> | |||
| <view class='edit-left-top'> | |||
| <view class='price'>{{data.price}}</view> | |||
| <view class='price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-left-bottom'>立即购买</view> | |||
| </button> | |||
| <!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
| <view class='edit-right' wx:if='{{data.id}}' bindtap='{{canSpell?"gotoSpell":""}}'> | |||
| <view class='edit-right-top'> | |||
| <view class='real-price'>{{data.salePrice}}</view> | |||
| <view class='real-price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-right-bottom'>参加拼团</view> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </form> | |||
| </view> | |||
| </view> | |||
| <view class='al-bg' wx:if='{{showErr}}'></view> | |||
| @@ -73,10 +73,11 @@ Page({ | |||
| /** | |||
| * 直接购买 | |||
| */ | |||
| gotoBuy(){ | |||
| gotoBuy(e){ | |||
| console.log(22222) | |||
| this.setData({ | |||
| canBuyIf: false | |||
| canBuyIf: false, | |||
| formId:e.detail.formId | |||
| }) | |||
| this.orderFunc() | |||
| }, | |||
| @@ -262,7 +263,8 @@ Page({ | |||
| orderFunc(orderGroupId) { | |||
| let data = { | |||
| couponChannelId: this.data.data.id, | |||
| couponId: this.data.data.couponId | |||
| couponId: this.data.data.couponId, | |||
| formId:this.data.formId | |||
| } | |||
| /** | |||
| * 拼团订单 | |||
| @@ -49,24 +49,26 @@ | |||
| <image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" /> | |||
| </view> | |||
| </view> | |||
| <view class='edit'> | |||
| <button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <view class='edit-left' wx:if='{{data.id}}' bindtap='{{canBuyIf?"gotoBuy":""}}'> | |||
| <view class='edit-left-top'> | |||
| <view class='price'>{{data.price}}</view> | |||
| <view class='price-unit'>元</view> | |||
| <form bindsubmit="submit" report-submit='true' > | |||
| <view class='edit'> | |||
| <button class='goback' bindtap='gotoIndex'><image src='{{wmhome}}' mode="widthFix"></image></button> | |||
| <button class='edit-left' form-type="submit" wx:if='{{data.id}}' bindtap='{{canBuyIf?"gotoBuy":""}}'> | |||
| <view class='edit-left-top'> | |||
| <view class='price'>{{data.price}}</view> | |||
| <view class='price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-left-bottom'>立即购买</view> | |||
| </button> | |||
| <!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
| <view class='edit-right' wx:if='{{data.id}}' bindtap='{{canSpell?"gotoSpell":""}}'> | |||
| <view class='edit-right-top'> | |||
| <view class='real-price'>{{data.salePrice}}</view> | |||
| <view class='real-price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-right-bottom'>发起拼团</view> | |||
| </view> | |||
| </view> | |||
| <view class='edit-left-bottom'>立即购买</view> | |||
| </view> | |||
| <!-- <button class='edit-right' id="shareBtn" open-type="share"></button> --> | |||
| <view class='edit-right' wx:if='{{data.id}}' bindtap='{{canSpell?"gotoSpell":""}}'> | |||
| <view class='edit-right-top'> | |||
| <view class='real-price'>{{data.salePrice}}</view> | |||
| <view class='real-price-unit'>元</view> | |||
| </view> | |||
| <view class='edit-right-bottom'>发起拼团</view> | |||
| </view> | |||
| </view> | |||
| </form> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -339,30 +339,30 @@ Page({ | |||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${e.currentTarget.dataset.id}` | |||
| }) | |||
| }, | |||
| barginAgain: function (e) { | |||
| let that = this; | |||
| console.log(e) | |||
| let couponId = e.currentTarget.dataset.couponid; | |||
| let couponChannelId = e.currentTarget.dataset.couponchannelid; | |||
| // let orderId = e.currentTarget.dataset.id; | |||
| that.orderSave(couponId, couponChannelId) | |||
| }, | |||
| myspellList: function () { | |||
| let that = this; | |||
| that.setData({ | |||
| spellList: false, | |||
| myspellList: true, | |||
| flag: "myspellList", | |||
| allow_load: true, | |||
| loading: false, | |||
| content: "", | |||
| page: 1 | |||
| }) | |||
| that.getList(1, 'myspellList'); | |||
| wx.setNavigationBarTitle({ | |||
| title: '我的砍价' | |||
| }) | |||
| }, | |||
| // barginAgain: function (e) { | |||
| // let that = this; | |||
| // console.log(e) | |||
| // let couponId = e.currentTarget.dataset.couponid; | |||
| // let couponChannelId = e.currentTarget.dataset.couponchannelid; | |||
| // // let orderId = e.currentTarget.dataset.id; | |||
| // that.orderSave(couponId, couponChannelId) | |||
| // }, | |||
| // myspellList: function () { | |||
| // let that = this; | |||
| // that.setData({ | |||
| // spellList: false, | |||
| // myspellList: true, | |||
| // flag: "myspellList", | |||
| // allow_load: true, | |||
| // loading: false, | |||
| // content: "", | |||
| // page: 1 | |||
| // }) | |||
| // that.getList(1, 'myspellList'); | |||
| // wx.setNavigationBarTitle({ | |||
| // title: '我的砍价' | |||
| // }) | |||
| // }, | |||
| spellList: function () { | |||
| let that = this; | |||
| that.setData({ | |||
| @@ -403,8 +403,8 @@ Page({ | |||
| that.getList(that.data.page, that.data.flag); | |||
| }, | |||
| /** | |||
| * 刷新 | |||
| */ | |||
| * 刷新 | |||
| */ | |||
| onPullDownRefresh: function (e) { | |||
| let that = this; | |||
| if (that.data.flag == 'spellList') { | |||