@@ -45,10 +45,8 @@ Page({ | |||||
let that = this; | let that = this; | ||||
wx.scanCode({ | wx.scanCode({ | ||||
success: (res) => { | success: (res) => { | ||||
that.merChantId = res.result; | |||||
console.log(res); | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/scanPay/scanPay?`, | |||||
url: `/pages/scanPay/scanPay?merChant=${res.result}&cardid=${e.currentTarget.dataset.cardid}`, | |||||
}) | }) | ||||
}, | }, | ||||
fail: (res) => { | fail: (res) => { | ||||
@@ -56,27 +54,7 @@ Page({ | |||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
// gotoPayMoney:function(){ | |||||
// let that = this; | |||||
// Http.post({ | |||||
// url: config.api.orderCreate, | |||||
// data: { | |||||
// cardId: e.currentTarget.dataset.cardid, | |||||
// merchantCode: that.data.merChantId, | |||||
// totalFee: "5" | |||||
// } | |||||
// }) | |||||
// .then(res => { | |||||
// console.log(res) | |||||
// }) | |||||
// .catch(err => { | |||||
// wx.showModal({ | |||||
// title: "抱歉", | |||||
// content: err.message, | |||||
// showCancel: false | |||||
// }) | |||||
// }) | |||||
// }, | |||||
//点击跳转到券详情页面 | //点击跳转到券详情页面 | ||||
gotouse: function (e) { | gotouse: function (e) { | ||||
if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { | if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { | ||||
@@ -124,6 +102,15 @@ Page({ | |||||
} | } | ||||
res.data.list.map(file => { | res.data.list.map(file => { | ||||
file.expiredTime = util.fmtDate(file.expiredTime); | file.expiredTime = util.fmtDate(file.expiredTime); | ||||
if (file.remainingAmount > 0 && 500 >= file.remainingAmount){ | |||||
file.background = '#7184E2' | |||||
} | |||||
else if (file.remainingAmount > 500 && 5000 >= file.remainingAmount) { | |||||
file.background = '#63AAE6' | |||||
} | |||||
else if (file.remainingAmount > 5000) { | |||||
file.background = '#E2A471' | |||||
} | |||||
}); | }); | ||||
setTimeout(function () { | setTimeout(function () { | ||||
that.setData({ | that.setData({ | ||||
@@ -14,27 +14,22 @@ | |||||
</view> | </view> | ||||
<view class='section' wx:for='{{list}}' wx:key='{{index}}'> | <view class='section' wx:for='{{list}}' wx:key='{{index}}'> | ||||
<view class='mms'> | |||||
<view class='mms' style='background:{{item.background}}'> | |||||
<view class='detail_msg'> | <view class='detail_msg'> | ||||
<view class='logo'> | |||||
<image mode="aspectFill" src='{{item.coverImg}}'></image> | |||||
</view> | |||||
<view class='info'> | <view class='info'> | ||||
<view class='title'> | <view class='title'> | ||||
<text>{{item.title}}</text> | <text>{{item.title}}</text> | ||||
<image class='fr' src='./../../../assets/images/icon01.png' mode="widthFix"></image> | |||||
</view> | </view> | ||||
<view class='subtitle'> | |||||
<text>{{item.subTitle}}</text> | |||||
<view class='expiretime'> | |||||
<text class="txt2">{{item.expiredTime}}到期</text> | |||||
<text class='txt2 fr'>金额<text class='money'>{{item.remainingAmount/10000}}</text>元</text> | |||||
</view> | </view> | ||||
<view hover-class='active' bindtap='gotoPay' data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫</view> | |||||
<view hover-class='active' wx:if="{{item.couponOrderStatus!=4}}" class="btns">已失效</view> | |||||
<view hover-class='active' bindtap='gotoPay' data-cardId="{{item.id}}" data-couponorderstatus="{{item.couponOrderStatus}}" wx:if="{{item.couponOrderStatus==4}}" class="btns">扫一扫付款</view> | |||||
<view hover-class='active' wx:if="{{item.couponOrderStatus!=4}}" class="btns">已失效</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<image class="liness" src='{{linessUrl}}' mode="widthFix"></image> | |||||
<view class='expiretime'> | |||||
<text class="txt1">有效期至:</text> | |||||
<text class="txt2">{{item.expiredTime}}</text> | |||||
</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="loading" wx:if="{{loading}}"> | <view class="loading" wx:if="{{loading}}"> | ||||
@@ -26,23 +26,16 @@ | |||||
.mms { | .mms { | ||||
width: 690rpx; | width: 690rpx; | ||||
height: 170rpx !important; | |||||
background: #fff; | background: #fff; | ||||
padding: 30rpx 0 0; | |||||
padding: 36rpx 0 0; | |||||
margin: 0 auto 40rpx; | margin: 0 auto 40rpx; | ||||
border-radius: 16rpx; | border-radius: 16rpx; | ||||
border-top: 8rpx solid #02b7ff; | |||||
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); | box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.10); | ||||
} | } | ||||
.detail_msg { | |||||
display: flex; | |||||
padding-bottom: 26rpx; | |||||
} | |||||
.expiretime { | .expiretime { | ||||
display: block; | display: block; | ||||
width: 100%; | |||||
width: 100%!important; | |||||
text-align: left; | text-align: left; | ||||
text-indent: 1em; | text-indent: 1em; | ||||
height: 40rpx; | height: 40rpx; | ||||
@@ -51,7 +44,14 @@ | |||||
color: #333; | color: #333; | ||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
.expiretime .fr{ | |||||
margin-right: 20rpx; | |||||
} | |||||
.money{ | |||||
margin-left: 10rpx; | |||||
font-size: 30rpx; | |||||
font-weight: bold; | |||||
} | |||||
.liness { | .liness { | ||||
display: block; | display: block; | ||||
width: 100%; | width: 100%; | ||||
@@ -86,19 +86,19 @@ | |||||
font-size: 32rpx; | font-size: 32rpx; | ||||
line-height: 32rpx; | line-height: 32rpx; | ||||
height: 32rpx; | height: 32rpx; | ||||
color: #333; | |||||
color: #fff; | |||||
letter-spacing: 0; | letter-spacing: 0; | ||||
width: 400rpx; | width: 400rpx; | ||||
display: inline-block; | display: inline-block; | ||||
white-space: nowrap; | white-space: nowrap; | ||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
overflow: hidden; | overflow: hidden; | ||||
margin-bottom: 10rpx; | |||||
} | } | ||||
.info view:nth-child(2) { | .info view:nth-child(2) { | ||||
padding-left: 2%; | |||||
font-size: 22rpx; | |||||
color: #333; | |||||
font-size: 26rpx; | |||||
color: #fff; | |||||
letter-spacing: 0; | letter-spacing: 0; | ||||
margin-top: 6rpx; | margin-top: 6rpx; | ||||
display: inline-block; | display: inline-block; | ||||
@@ -108,32 +108,25 @@ | |||||
width: 400rpx; | width: 400rpx; | ||||
} | } | ||||
.info view:nth-child(3) { | |||||
margin-left: 20rpx; | |||||
} | |||||
.btns { | .btns { | ||||
position: absolute; | |||||
right: 57rpx; | |||||
top: 38rpx; | |||||
width: 120rpx; | |||||
height: 48rpx; | |||||
line-height: 48rpx; | |||||
height: 80rpx; | |||||
line-height: 80rpx; | |||||
text-align: center; | text-align: center; | ||||
border: 2rpx solid #02c0ff; | |||||
border-radius: 60rpx; | |||||
color: #02c0ff; | |||||
color: #fff; | |||||
font-size: 28rpx; | font-size: 28rpx; | ||||
margin-top: 46rpx; | |||||
border-top:1px solid #e6e6e6; | |||||
} | } | ||||
.active { | .active { | ||||
color: #fff; | color: #fff; | ||||
background: #02c0ff; | |||||
opacity: .6; | |||||
} | } | ||||
.txt1 { | .txt1 { | ||||
font-size: 22rpx; | |||||
color: #333; | |||||
font-size: 24rpx; | |||||
color: #fff; | |||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
@@ -203,3 +196,7 @@ | |||||
text-align: center; | text-align: center; | ||||
line-height: 32px; | line-height: 32px; | ||||
} | } | ||||
.title .fr{ | |||||
width: 30rpx; | |||||
margin-right: 10rpx; | |||||
} |
@@ -36,6 +36,7 @@ | |||||
<text class="txt2">{{item.expiredTime}}</text> | <text class="txt2">{{item.expiredTime}}</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<image class='sendImg' wx:if="{{item.sendChannelType!=1&&item.sendChannelType!=undefined}}" src='./../../../assets/images/give.png' mode='widthFix'></image> | |||||
</view> | </view> | ||||
<view class="loading" wx:if="{{loading}}"> | <view class="loading" wx:if="{{loading}}"> | ||||
<image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | <image src="{{loadingUrl}}" mode="widthFix"></image>{{content}} | ||||
@@ -25,8 +25,9 @@ | |||||
} | } | ||||
.mms { | .mms { | ||||
position: relative; | |||||
width: 690rpx; | width: 690rpx; | ||||
height: 170rpx !important; | |||||
height: 197rpx !important; | |||||
background: #fff; | background: #fff; | ||||
padding: 30rpx 0 0; | padding: 30rpx 0 0; | ||||
margin: 0 auto 40rpx; | margin: 0 auto 40rpx; | ||||
@@ -45,9 +46,9 @@ | |||||
width: 100%; | width: 100%; | ||||
text-align: left; | text-align: left; | ||||
text-indent: 1em; | text-indent: 1em; | ||||
height: 40rpx; | |||||
line-height: 36rpx; | |||||
font-size: 22rpx; | |||||
height:54rpx; | |||||
line-height:54rpx; | |||||
font-size: 26rpx; | |||||
color: #333; | color: #333; | ||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
@@ -114,14 +115,14 @@ | |||||
.btns { | .btns { | ||||
position: absolute; | position: absolute; | ||||
right: 57rpx; | |||||
right: 30rpx; | |||||
top: 38rpx; | top: 38rpx; | ||||
width: 120rpx; | width: 120rpx; | ||||
height: 48rpx; | height: 48rpx; | ||||
line-height: 48rpx; | line-height: 48rpx; | ||||
text-align: center; | text-align: center; | ||||
border: 2rpx solid #02c0ff; | border: 2rpx solid #02c0ff; | ||||
border-radius: 60rpx; | |||||
border-radius: 10rpx; | |||||
color: #02c0ff; | color: #02c0ff; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
} | } | ||||
@@ -132,7 +133,7 @@ | |||||
} | } | ||||
.txt1 { | .txt1 { | ||||
font-size: 22rpx; | |||||
font-size: 26rpx; | |||||
color: #333; | color: #333; | ||||
letter-spacing: 0; | letter-spacing: 0; | ||||
} | } | ||||
@@ -203,3 +204,9 @@ | |||||
text-align: center; | text-align: center; | ||||
line-height: 32px; | line-height: 32px; | ||||
} | } | ||||
.sendImg{ | |||||
position: absolute; | |||||
width: 100rpx; | |||||
top:109rpx; | |||||
right:72rpx; | |||||
} |
@@ -21,6 +21,9 @@ | |||||
</view> | </view> | ||||
<view class="sub">{{item.subTitle}}</view> | <view class="sub">{{item.subTitle}}</view> | ||||
<view class="value">面额:<text wx:if="{{item.unit==0}}">{{item.price/100}}元</text><text wx:if="{{item.unit==1}}">{{item.price/100}}小时</text></view> | <view class="value">面额:<text wx:if="{{item.unit==0}}">{{item.price/100}}元</text><text wx:if="{{item.unit==1}}">{{item.price/100}}小时</text></view> | ||||
<image class='sendImg' wx:if="{{item.sendChannelType!=1&&item.sendChannelType!=undefined}}" src='./../../../assets/images/give.png' mode='widthFix'></image> | |||||
<view class="value">下单时间:<text>{{item.createDate}}</text> | <view class="value">下单时间:<text>{{item.createDate}}</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -41,15 +44,6 @@ | |||||
<view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | <view wx:if="{{item.orderStatus==0}}" class="btn" data-id="{{item.id}}" bindtap="gotopay"> | ||||
<text>去支付</text> | <text>去支付</text> | ||||
</view> | </view> | ||||
<!-- <view wx:if="{{item.orderStatus==2}}" style="background:#999;opacity: .6;" class="btn"> | |||||
<text>已取消</text> | |||||
</view> --> | |||||
<!-- <view wx:if="{{item.orderStatus==3}}" style="background:#999;opacity: .6;color:#fff;" class="btn"> | |||||
<text>待退款</text> | |||||
</view> --> | |||||
<!-- <view wx:if="{{item.orderStatus==4}}" style="background:#999;opacity: .6;" class="btn"> | |||||
<text>已退款</text> | |||||
</view> --> | |||||
<view wx:if="{{item.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn"> | <view wx:if="{{item.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn"> | ||||
<text>退款失败</text> | <text>退款失败</text> | ||||
</view> | </view> | ||||
@@ -20,6 +20,7 @@ | |||||
} | } | ||||
.detail_msg { | .detail_msg { | ||||
position: relative; | |||||
width: 92%; | width: 92%; | ||||
background: #fff; | background: #fff; | ||||
display: flex; | display: flex; | ||||
@@ -28,6 +29,12 @@ | |||||
padding-top: 30rpx; | padding-top: 30rpx; | ||||
border-bottom: 1rpx solid #eee; | border-bottom: 1rpx solid #eee; | ||||
} | } | ||||
.sendImg{ | |||||
position: absolute; | |||||
width: 100rpx; | |||||
top: 100rpx; | |||||
right: 6rpx; | |||||
} | |||||
.logo { | .logo { | ||||
display: block; | display: block; | ||||
@@ -188,7 +195,7 @@ text-overflow: ellipsis; | |||||
float: right; | float: right; | ||||
font-size: 28rpx; | font-size: 28rpx; | ||||
border: 2rpx solid #02c0ff; | border: 2rpx solid #02c0ff; | ||||
border-radius: 30rpx; | |||||
border-radius: 10rpx; | |||||
} | } | ||||
.payment view:nth-child(2) text { | .payment view:nth-child(2) text { | ||||
@@ -1,20 +1,96 @@ | |||||
// pages/scanPay/scanPay.js | |||||
const util = require("../../utils/util.js"); | |||||
const config = require("../../config/config.js"); | |||||
const Http = require("../../utils/HttpBasics"); | |||||
let app = getApp(); | |||||
Page({ | Page({ | ||||
/** | /** | ||||
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
merChant:{}, | |||||
focus: true, | |||||
inputValue: '' | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad: function (options) { | onLoad: function (options) { | ||||
console.log(options) | |||||
let that = this; | |||||
that.setData({ | |||||
merChant: JSON.parse(options.merChant), | |||||
cardid:options.cardid | |||||
}) | |||||
}, | |||||
bindKeyInput(e) { | |||||
console.log(e) | |||||
this.setData({ | |||||
inputValue: e.detail.value | |||||
}) | |||||
console.log(this.data.inputValue) | |||||
}, | |||||
gotoPayMoney:function(){ | |||||
let that = this; | |||||
Http.post({ | |||||
url: config.api.orderCreate, | |||||
data: { | |||||
cardId: that.data.cardid, | |||||
merchantCode: that.data.merChant.merchant_id, | |||||
totalFee: that.data.inputValue | |||||
} | |||||
}) | |||||
.then(res => { | |||||
console.log(res) | |||||
}) | |||||
.catch(err => { | |||||
wx.showModal({ | |||||
title: "抱歉", | |||||
content: err.message, | |||||
showCancel: false | |||||
}) | |||||
}) | |||||
}, | |||||
gotoPayMoneys(e) { | |||||
var that = this; | |||||
if (wx.canIUse("checkIsSupportSoterAuthentication")) { | |||||
//判断此接口是否可用 | |||||
console.log(e) | |||||
wx.checkIsSupportSoterAuthentication({ | |||||
success: function (res) { | |||||
console.log('本机支持的 SOTER 生物认证', res); | |||||
var keys = []; | |||||
for (var key in res) { | |||||
keys.push(res[key]) | |||||
} | |||||
console.log(res) | |||||
that.setData({ | |||||
print: keys//页面中输出支持情况 | |||||
}) | |||||
if (res.supportMode == "fingerPrint") { | |||||
wx.startSoterAuthentication({ | |||||
requestAuthModes: ['fingerPrint'], | |||||
challenge: '123456', | |||||
authContent: "请用指纹解锁", | |||||
success: function (res) { | |||||
console.log('js', res); | |||||
}, | |||||
fail: function (res) { | |||||
that.setData({ | |||||
c: "用户取消了指纹识别,或调用出现错误" | |||||
}) | |||||
} | |||||
}) | |||||
} else { | |||||
that.setData({ | |||||
b: "当前该设备不支持指纹识别" | |||||
}) | |||||
} | |||||
} | |||||
}) | |||||
} | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面初次渲染完成 | * 生命周期函数--监听页面初次渲染完成 | ||||
*/ | */ | ||||
@@ -1,12 +1,12 @@ | |||||
<view class='content'> | <view class='content'> | ||||
<view class='head clearfix'> | <view class='head clearfix'> | ||||
<text class='fl'>付款给呷脯呷脯</text> | |||||
<image class='fr' src='./../../assets/img/logo.png' mode='widthFix'></image> | |||||
<text class='fl'>付款给{{merChant.merchant_name}}</text> | |||||
<image class='fr' src='{{merChant.merchant_img_url}}' mode='widthFix'></image> | |||||
</view> | </view> | ||||
<text class='txt1'>金额</text> | <text class='txt1'>金额</text> | ||||
<view class='money'> | <view class='money'> | ||||
<text class='icon'>¥</text> | <text class='icon'>¥</text> | ||||
<text class='num'>200</text> | |||||
<button>确认付款</button> | |||||
<input bindinput="bindKeyInput" class='num' type="digit" focus='true' placeholder="" /> | |||||
<button bindtap='gotoPayMoney'>确认付款</button> | |||||
</view> | </view> | ||||
</view> | </view> |
@@ -36,8 +36,13 @@ | |||||
color:rgba(51,51,51,1); | color:rgba(51,51,51,1); | ||||
} | } | ||||
.money .num{ | .money .num{ | ||||
font-size:77rpx; | |||||
font-size:60rpx!important; | |||||
font-family:PingFang-SC-Bold; | font-family:PingFang-SC-Bold; | ||||
font-weight:bold; | font-weight:bold; | ||||
color:rgba(51,51,51,1); | color:rgba(51,51,51,1); | ||||
display: inline-block!important; | |||||
width: 300rpx; | |||||
height: 60rpx; | |||||
margin-top: 20rpx; | |||||
line-height: 60rpx; | |||||
} | } |
@@ -29,23 +29,6 @@ | |||||
<view class="user-btn app-border-bottom"> | <view class="user-btn app-border-bottom"> | ||||
<view> | <view> | ||||
<image class='icons' style='width:36rpx;' src="{{dingUrl}}" mode='widthFix'></image>我的订单</view> | <image class='icons' style='width:36rpx;' src="{{dingUrl}}" mode='widthFix'></image>我的订单</view> | ||||
<view> | |||||
<text class='look'>查看全部</text> | |||||
<text class="iconfont icon-right"></text> | |||||
</view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/order/index/index?id=0"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view style='padding-left:64rpx;color:#666;'>待付款</view> | |||||
<view> | |||||
<text class="iconfont icon-right"></text> | |||||
</view> | |||||
</view> | |||||
</navigator> | |||||
<navigator url="/pages/order/index/index?id=1"> | |||||
<view class="user-btn app-border-bottom"> | |||||
<view style='padding-left:64rpx;color:#666;'>已完成</view> | |||||
<view> | <view> | ||||
<text class="iconfont icon-right"></text> | <text class="iconfont icon-right"></text> | ||||
</view> | </view> | ||||
@@ -183,11 +183,11 @@ page{ | |||||
right: 0; | right: 0; | ||||
top: 0; | top: 0; | ||||
bottom: 0; | bottom: 0; | ||||
width: 44rpx; | |||||
height: 44rpx; | |||||
width: 30rpx; | |||||
height: 30rpx; | |||||
line-height: 44rpx; | line-height: 44rpx; | ||||
color: #c7c7cc; | color: #c7c7cc; | ||||
font-size: 44rpx; | |||||
font-size: 30rpx; | |||||
margin: auto; | margin: auto; | ||||
} | } | ||||