@@ -16,7 +16,8 @@ Page({ | |||||
min: null, | min: null, | ||||
sec: null, | sec: null, | ||||
showPage: false, | showPage: false, | ||||
discountStatus:null | |||||
discountStatus:null, | |||||
disabled:false | |||||
}, | }, | ||||
/** | /** | ||||
@@ -39,6 +40,14 @@ Page({ | |||||
that.pressOrderDetail(options.orderId); | that.pressOrderDetail(options.orderId); | ||||
} | } | ||||
}, | }, | ||||
onShow: function () { | |||||
let that = this; | |||||
console.log("--------------------------------onShow-------------------------------") | |||||
var todayDate = new Date().getTime(); | |||||
that.setData({ | |||||
todayDate: todayDate, | |||||
}) | |||||
}, | |||||
/** | /** | ||||
* 更多砍价商品 | * 更多砍价商品 | ||||
*/ | */ | ||||
@@ -59,6 +68,8 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
console.log(res) | |||||
console.log("--------------------------status------------------------------------") | |||||
if (res.data.status == 1) { | if (res.data.status == 1) { | ||||
that.setData({ | that.setData({ | ||||
discountStatus: 1 | discountStatus: 1 | ||||
@@ -75,9 +86,10 @@ Page({ | |||||
wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
console.log(err) | |||||
wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
wx.showToast({ | wx.showToast({ | ||||
title: err.message, | |||||
title: err.errMsg, | |||||
icon: "none" | icon: "none" | ||||
}) | }) | ||||
}) | }) | ||||
@@ -119,7 +131,6 @@ Page({ | |||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
console.log(res); | console.log(res); | ||||
that.getPressOrderStatus(orderId); | |||||
res.data.orderPressList.map(file => { | res.data.orderPressList.map(file => { | ||||
file.createDate = diffTime(file.createDate) | file.createDate = diffTime(file.createDate) | ||||
}) | }) | ||||
@@ -130,6 +141,7 @@ Page({ | |||||
remain: (res.data.pressCurrentValue / 100).toFixed(2), | remain: (res.data.pressCurrentValue / 100).toFixed(2), | ||||
showPage: true | showPage: true | ||||
}) | }) | ||||
that.getPressOrderStatus(orderId); | |||||
}) | }) | ||||
.catch(err => { | .catch(err => { | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -139,13 +151,7 @@ Page({ | |||||
wx.stopPullDownRefresh(); | wx.stopPullDownRefresh(); | ||||
}) | }) | ||||
}, | }, | ||||
onShow: function() { | |||||
let that = this; | |||||
var todayDate = new Date().getTime(); | |||||
that.setData({ | |||||
todayDate: todayDate, | |||||
}) | |||||
}, | |||||
countdown(end_time) { | countdown(end_time) { | ||||
let that = this; | let that = this; | ||||
var EndTime = end_time; | var EndTime = end_time; | ||||
@@ -53,7 +53,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
<view wx:if="{{data.orderStatus != 7&&discountStatus==1&&todayDate<=data.pressEndDate&&data.orderStatus!=1}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | |||||
<view class="fl" bindtap='orderFunc' data-orderId="{{data.id}}" data-price="{{data.price/100}}"> | <view class="fl" bindtap='orderFunc' data-orderId="{{data.id}}" data-price="{{data.price/100}}"> | ||||
<text>{{data.price/100}}元</text> | <text>{{data.price/100}}元</text> | ||||
<text>立即购买</text> | <text>立即购买</text> | ||||
@@ -61,6 +61,6 @@ | |||||
<button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友继续砍价</button> | <button class='share user-motto fr' data-orderId='{{data.id}}' id="shareBtn" open-type="share" hover-class="other-button-hover">邀请好友继续砍价</button> | ||||
</view> | </view> | ||||
<view wx:if="{{data.orderStatus == 7&&discountStatus == 1}}" class="btns01 clearfix" hover-class="none" hover-stop-propagation="false"> | <view 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> | |||||
<button bindtap='orderFunc' data-orderId="{{data.id}}" data-salePrice="{{data.salePrice/100}}" hover-class="other-button-hover" disabled="{{disabled}}">{{data.salePrice/100}}元 底价购买 </button> | |||||
</view> | </view> | ||||
</view> | </view> |
@@ -54,12 +54,12 @@ Page({ | |||||
let that = this; | let that = this; | ||||
wx.scanCode({ | wx.scanCode({ | ||||
success: (res) => { | success: (res) => { | ||||
console.log(res.result.indexOf('merchant_id_scan')) | |||||
if(res.result.indexOf('merchant_id_scan')!=-1){ | |||||
let value = JSON.parse(res.result); | |||||
if (value.END == 'B' && value.TYPE == 'merchant' && value.ID){ | |||||
Http.get({ | Http.get({ | ||||
url: config.api.findByCode, | url: config.api.findByCode, | ||||
data: { | data: { | ||||
merchantCode: JSON.parse(res.result).merchant_id_scan, | |||||
merchantCode:value.ID, | |||||
} | } | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
@@ -118,8 +118,9 @@ Page({ | |||||
/** | /** | ||||
* gotopay | * gotopay | ||||
*/ | */ | ||||
gotopay: function () { | |||||
gotopay: function (e) { | |||||
let that = this; | let that = this; | ||||
var discount = e.currentTarget.dataset.discount; | |||||
that.setData({ | that.setData({ | ||||
queueData: null, | queueData: null, | ||||
showbutton: true | showbutton: true | ||||
@@ -133,7 +134,7 @@ Page({ | |||||
.then(res => { | .then(res => { | ||||
console.log(res); | console.log(res); | ||||
if (res.data == undefined) { | if (res.data == undefined) { | ||||
that.orderFunc(); | |||||
that.orderFunc(discount); | |||||
that.setData({ | that.setData({ | ||||
flag: false | flag: false | ||||
}) | }) | ||||
@@ -338,13 +339,14 @@ Page({ | |||||
* 发起支付 | * 发起支付 | ||||
*/ | */ | ||||
orderFunc(discount) { | orderFunc(discount) { | ||||
console.log(discount) | |||||
var that = this; | var that = this; | ||||
Http.post({ | Http.post({ | ||||
url: config.api.checkPhoneStatus, | url: config.api.checkPhoneStatus, | ||||
data: {} | data: {} | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
if (discount == 'discount') { | |||||
if (discount == 'discount' || discount == 'discount1') { | |||||
var data = { | var data = { | ||||
couponChannelId: "" + that.data.couponChannelId, | couponChannelId: "" + that.data.couponChannelId, | ||||
couponId: "" + that.data.couponId, | couponId: "" + that.data.couponId, | ||||
@@ -94,7 +94,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view wx:if="{{data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | <view wx:if="{{data.type==8}}" class="btns clearfix" hover-class="none" hover-stop-propagation="false"> | ||||
<button class="fl" bindtap='gotopay' disabled='{{showbutton}}'> | |||||
<button class="fl" bindtap='gotopay' data-discount='discount1' disabled='{{showbutton}}'> | |||||
<text>{{data.priceStr}}元</text> | <text>{{data.priceStr}}元</text> | ||||
<text>立即购买</text> | <text>立即购买</text> | ||||
</button> | </button> | ||||
@@ -24,9 +24,9 @@ | |||||
<image wx:if="{{data.couponOrderStatus==2}}" src="{{wm02Url}}" mode='widthFix'></image> | <image wx:if="{{data.couponOrderStatus==2}}" src="{{wm02Url}}" mode='widthFix'></image> | ||||
<image wx:if="{{data.couponOrderStatus==3}}" src="{{wm03Url}}" mode='widthFix'></image> | <image wx:if="{{data.couponOrderStatus==3}}" src="{{wm03Url}}" mode='widthFix'></image> | ||||
<view class="panel" wx:if="{{data.couponOrderStatus==0}}"> | <view class="panel" wx:if="{{data.couponOrderStatus==0}}"> | ||||
<view class="barcode"> | |||||
<!-- <view class="barcode"> | |||||
<canvas canvas-id="barcode" /> | <canvas canvas-id="barcode" /> | ||||
</view> | |||||
</view> --> | |||||
<view class="qrcode"> | <view class="qrcode"> | ||||
<canvas canvas-id="qrcode" /> | <canvas canvas-id="qrcode" /> | ||||
</view> | </view> | ||||
@@ -16,7 +16,7 @@ page { | |||||
width: 600rpx; | width: 600rpx; | ||||
display: block; | display: block; | ||||
border-radius: 10rpx; | border-radius: 10rpx; | ||||
margin: 38rpx auto 0; | |||||
margin: 0 auto; | |||||
padding: 0; | padding: 0; | ||||
z-index: 10000000000; | z-index: 10000000000; | ||||
} | } | ||||
@@ -72,7 +72,11 @@ Page({ | |||||
var st = setTimeout(function () { | var st = setTimeout(function () { | ||||
wx.hideToast() | wx.hideToast() | ||||
var size = that.setCanvasSize(); | var size = that.setCanvasSize(); | ||||
var url = JSON.stringify({ flagid: that.data.memberId }); | |||||
var url = JSON.stringify({ | |||||
END: "C", | |||||
TYPE: "memberCode", | |||||
ID: that.data.memberId, | |||||
}); | |||||
that.createQrCode(url, "mycanvas2", size.w, size.h); | that.createQrCode(url, "mycanvas2", size.w, size.h); | ||||
that.setData({ | that.setData({ | ||||
maskHidden: true | maskHidden: true | ||||
@@ -33,6 +33,7 @@ Page({ | |||||
}, | }, | ||||
powerDrawer: function (e) { | powerDrawer: function (e) { | ||||
let that = this; | let that = this; | ||||
console.log(e) | |||||
// couponOrderStatus | // couponOrderStatus | ||||
// 0 未使用 | // 0 未使用 | ||||
// 1 已使用 | // 1 已使用 | ||||
@@ -48,7 +48,7 @@ | |||||
<text>查看详情</text> | <text>查看详情</text> | ||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus == 6}}" class="btn" data-id="{{item.id}}" bindtap="gotoDiscount"> | <view wx:if="{{item.orderStatus == 6}}" class="btn" data-id="{{item.id}}" bindtap="gotoDiscount"> | ||||
<text>查看详情</text> | |||||
<text>砍价详情</text> | |||||
</view> | </view> | ||||
<view wx:if="{{item.orderStatus==0 || item.orderStatus==7}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | <view wx:if="{{item.orderStatus==0 || item.orderStatus==7}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | ||||
<text>去支付</text> | <text>去支付</text> | ||||
@@ -50,7 +50,8 @@ Page({ | |||||
}, | }, | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
let that = this; | let that = this; | ||||
util.barcode("barcode", options.quancode, 500, 100); | |||||
let value = JSON.stringify({ END: "C", TYPE: "couponorder", ID: options.quancode}) | |||||
util.barcode("barcode", value.ID, 500, 100); | |||||
util.qrcode("qrcode", options.quancode, 350, 350); | util.qrcode("qrcode", options.quancode, 350, 350); | ||||
that.setData({ | that.setData({ | ||||
code: options.quancode, | code: options.quancode, | ||||
@@ -224,7 +224,11 @@ Page({ | |||||
var st = setTimeout(function () { | var st = setTimeout(function () { | ||||
wx.hideToast() | wx.hideToast() | ||||
var size = that.setCanvasSize(); | var size = that.setCanvasSize(); | ||||
var url = JSON.stringify({ flagid:that.data.memberId}); | |||||
var url = JSON.stringify({ | |||||
END:"C", | |||||
TYPE:"memberCode", | |||||
ID: that.data.memberId, | |||||
}) | |||||
that.createQrCode(url, "mycanvas1", size.w, size.h); | that.createQrCode(url, "mycanvas1", size.w, size.h); | ||||
that.setData({ | that.setData({ | ||||
maskHidden: true | maskHidden: true | ||||
@@ -105,7 +105,8 @@ page{ | |||||
position: absolute; | position: absolute; | ||||
right: 0; | right: 0; | ||||
bottom: 0; | bottom: 0; | ||||
top: 24rpx; | |||||
top: 0; | |||||
margin: auto; | |||||
text-align: center; | text-align: center; | ||||
} | } | ||||
@@ -251,14 +252,16 @@ page{ | |||||
width: 26rpx; | width: 26rpx; | ||||
vertical-align: middle; | vertical-align: middle; | ||||
} | } | ||||
.qrcode{ | |||||
display: none; | |||||
} | |||||
.qrcode image { | .qrcode image { | ||||
width: 70rpx; | width: 70rpx; | ||||
margin-right: 20rpx; | margin-right: 20rpx; | ||||
} | } | ||||
.edits { | .edits { | ||||
margin-top: -20rpx; | |||||
margin-top: 44rpx; | |||||
} | } | ||||
.showQrcode { | .showQrcode { | ||||