@@ -1,7 +1,7 @@ | |||
{ | |||
"pages": [ | |||
"pages/scanPay/scanPay", | |||
"pages/index/index", | |||
"pages/scanPay/scanPay", | |||
"pages/edit/edit", | |||
"pages/cartest/cartest", | |||
"pages/actdetail/actdetail", | |||
@@ -16,7 +16,7 @@ | |||
</view> | |||
</view> | |||
<view> | |||
<text class='title'>使用门店:</text> | |||
<text class='title'>适用门店:</text> | |||
<view class='posi'> | |||
<view class='posi_logo' wx:for="{{cardDetail.merchantVoList}}" wx:key="index"> | |||
<view> | |||
@@ -31,7 +31,7 @@ | |||
</view> | |||
</view> | |||
<view> | |||
<text class="title">交易明细:</text> | |||
<text wx:if="{{data.length>0}}" class="title">交易明细:</text> | |||
<view wx:for="{{data}}" wx:key="{{index}}"> | |||
<view class='record clearfix record1'> | |||
<text>{{item.merchantName}}</text> | |||
@@ -30,7 +30,7 @@ | |||
<view hover-class='active' bindtap='gotoPay' data-remainingAmount="{{item.remainingAmount/100}}" 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 clearfix"> | |||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 5}}">已过期</text> | |||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 6}}">余额不足</text> | |||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 6}}">余额已用完</text> | |||
<text class='txtstatus fl' wx:if="{{item.couponOrderStatus == 7}}">已线下退款</text> | |||
<button class='buyagain fr' bindtap='gotoBuy'>再次购买</button> | |||
</view> | |||
@@ -37,7 +37,7 @@ | |||
</view> | |||
</view> | |||
<view class='expect' wx:if="{{list.length==0}}"> | |||
<image src='./../../assets/images/shixiao.png' mode='widthFix'></image> | |||
<image src='./../../assets/images/gift.png' mode='widthFix'></image> | |||
<text>请您敬请期待</text> | |||
<text>我们正在筹备一大堆优惠活动</text> | |||
</view> | |||
@@ -10,7 +10,9 @@ Page({ | |||
data: { | |||
merChant: {}, | |||
focus: true, | |||
inputValue: '' | |||
inputValue: '', | |||
cardList: [], | |||
showModel: false, | |||
}, | |||
/** | |||
@@ -23,8 +25,6 @@ Page({ | |||
cardid: options.cardid, | |||
remainingAmount: options.remainingAmount | |||
}) | |||
console.log(that.data.remainingAmount) | |||
console.log("------------------remainingAmount-------------------") | |||
}, | |||
bindKeyInput(e) { | |||
console.log(e) | |||
@@ -34,99 +34,160 @@ Page({ | |||
}, | |||
gotoPayMoney: function() { | |||
let that = this; | |||
Http.post({ | |||
url: config.api.cardPayOrder, | |||
data: { | |||
cardId: that.data.cardid, | |||
merchantCode: that.data.merChant.merchant_id, | |||
totalFee: that.data.inputValue | |||
} | |||
}) | |||
.then(res => { | |||
console.log(res); | |||
wx.navigateTo({ | |||
url: '/pages/paySuccess/paySuccess', | |||
// 卡余额充足的时候,才可以付钱 | |||
console.log(Number(that.data.remainingAmount) >= Number(that.data.inputValue)) | |||
if (that.data.inputValue != "" && Number(that.data.remainingAmount) >= Number(that.data.inputValue)) { | |||
Http.post({ | |||
url: config.api.cardPayOrder, | |||
data: { | |||
cardId: that.data.cardid, | |||
merchantCode: that.data.merChant.merchant_id, | |||
totalFee: that.data.inputValue | |||
} | |||
}) | |||
}) | |||
.catch(err => { | |||
wx.showModal({ | |||
title: "抱歉", | |||
content: err.message, | |||
showCancel: false | |||
.then(res => { | |||
console.log(res); | |||
if(res.code==200){ | |||
that.startAuth(); | |||
} | |||
}) | |||
.catch(err => { | |||
wx.showModal({ | |||
title: "抱歉", | |||
content: err.message, | |||
showCancel: false | |||
}) | |||
}) | |||
} else if (that.data.inputValue == "") { | |||
wx.showModal({ | |||
title: '抱歉', | |||
content: '请输入金额', | |||
showCancel: false | |||
}) | |||
} else if (that.data.inputValue != "" && Number(that.data.remainingAmount) < Number(that.data.inputValue)) { | |||
// wx.showModal({ | |||
// title: '抱歉', | |||
// content: '余额不足', | |||
// showCancel: false | |||
// }) | |||
that.setData({ | |||
showModel: true | |||
}) | |||
that.getList(); | |||
} | |||
}, | |||
// 指纹识别 | |||
startAuth() { | |||
let that = this; | |||
// 卡余额充足的时候,才可以付钱 | |||
if (that.data.inputValue != "" && that.data.remainingAmount >= that.data.inputValue) { | |||
const startSoterAuthentication = () => { | |||
wx.startSoterAuthentication({ | |||
requestAuthModes: [AUTH_MODE], | |||
challenge: 'test', | |||
authContent: '小程序支付', | |||
success: (res) => { | |||
this.gotoPayMoney(); | |||
}, | |||
fail: (err) => { | |||
const startSoterAuthentication = () => { | |||
wx.startSoterAuthentication({ | |||
requestAuthModes: [AUTH_MODE], | |||
challenge: 'test', | |||
authContent: '请验证已有的指纹以继续', | |||
success: (res) => { | |||
wx.navigateTo({ | |||
url: '/pages/paySuccess/paySuccess', | |||
}) | |||
}, | |||
fail: (err) => { | |||
} | |||
}) | |||
} | |||
const checkIsEnrolled = () => { | |||
wx.checkIsSoterEnrolledInDevice({ | |||
checkAuthMode: AUTH_MODE, | |||
success: (res) => { | |||
console.log(res) | |||
if (parseInt(res.isEnrolled) <= 0) { | |||
wx.showModal({ | |||
title: '错误', | |||
content: '您暂未录入指纹信息,请录入后重试', | |||
showCancel: false | |||
}) | |||
return | |||
} | |||
startSoterAuthentication(); | |||
}, | |||
fail: (err) => { | |||
console.error(err) | |||
} | |||
}) | |||
} | |||
wx.checkIsSupportSoterAuthentication({ | |||
} | |||
}) | |||
} | |||
const checkIsEnrolled = () => { | |||
wx.checkIsSoterEnrolledInDevice({ | |||
checkAuthMode: AUTH_MODE, | |||
success: (res) => { | |||
console.log(res) | |||
checkIsEnrolled() | |||
if (parseInt(res.isEnrolled) <= 0) { | |||
wx.showModal({ | |||
title: '错误', | |||
content: '您暂未录入指纹信息,请录入后重试', | |||
showCancel: false | |||
}) | |||
return | |||
} | |||
startSoterAuthentication(); | |||
}, | |||
fail: (err) => { | |||
console.error(err); | |||
wx.showModal({ | |||
title: '错误', | |||
content: '您的设备不支持指纹识别', | |||
showCancel: false | |||
}) | |||
console.error(err) | |||
} | |||
}) | |||
} else if (that.data.inputValue == ""){ | |||
wx.showModal({ | |||
title: '抱歉', | |||
content: '请输入金额', | |||
showCancel: false | |||
} | |||
wx.checkIsSupportSoterAuthentication({ | |||
success: (res) => { | |||
console.log(res) | |||
checkIsEnrolled() | |||
}, | |||
fail: (err) => { | |||
console.error(err); | |||
wx.showModal({ | |||
title: '抱歉', | |||
content: '您的设备不支持指纹识别', | |||
showCancel: false | |||
}) | |||
} | |||
}) | |||
}, | |||
gotonewcard: function() { | |||
wx.navigateTo({ | |||
url: '/pages/discountCardList/discountCardList' | |||
}) | |||
this.setData({ | |||
showModel: false | |||
}) | |||
}, | |||
getList() { | |||
var that = this; | |||
var data = { | |||
pageNum: 1, | |||
pageSize: 100, | |||
couponType: "7", | |||
couponOrderStatus: 4 | |||
} | |||
Http.get({ | |||
url: config.api.cardorderList, | |||
data: data | |||
}) | |||
} else if (that.data.inputValue != ""&&that.data.remainingAmount < that.data.inputValue){ | |||
wx.showModal({ | |||
title: '抱歉', | |||
content: '余额不足', | |||
showCancel:false | |||
.then(res => { | |||
console.log(res) | |||
if (res.code == 200) { | |||
res.data.list.map(file => { | |||
file.merchantVoList.map(files => { | |||
console.log(files.id) | |||
if (files.id == that.data.merChant.merchant_id) { | |||
file.flag = true | |||
} | |||
}) | |||
}) | |||
that.setData({ | |||
showPage: true, | |||
cardList: res.data.list | |||
}) | |||
} | |||
}) | |||
.catch(err => { | |||
wx.showModal({ | |||
title: '提示', | |||
content: err.errMsg, | |||
showCancel: false | |||
}) | |||
}) | |||
} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function() { | |||
check: function(e) { | |||
let ids = e.currentTarget.dataset.id; | |||
this.setData({ | |||
ids: ids, | |||
cardId: ids, | |||
remainingAmount: e.currentTarget.dataset.remainingamount | |||
}) | |||
}, | |||
showModel: function() { | |||
this.setData({ | |||
showModel: false | |||
}) | |||
}, | |||
/** | |||
@@ -8,88 +8,35 @@ | |||
<view class='money'> | |||
<text class='icon'>¥</text> | |||
<input bindinput="bindKeyInput" class='num' type="digit" focus placeholder="" /> | |||
<button bindtap='startAuth' hover-class='active'>确认付款</button> | |||
<button bindtap='gotoPayMoney' hover-class='active'>确认付款</button> | |||
</view> | |||
<view class='model'> | |||
<view class='model' wx:if="{{showModel}}"> | |||
<view class='zhezhao'></view> | |||
<view class='card-model'> | |||
<view class='card-top'> | |||
<view class='card-top' bindtap='showModel'> | |||
余额不足,请选择其他优惠卡支付 | |||
</view> | |||
<view class='card-content'> | |||
<scroll-view | |||
scroll-y | |||
style="height: 500rpx;" | |||
bindscrolltoupper="upper" | |||
bindscrolltolower="lower" | |||
bindscroll="scroll" | |||
scroll-into-view="{{toView}}" | |||
scroll-top="{{scrollTop}}" | |||
> | |||
<view class='card-items'> | |||
<scroll-view scroll-y style="height: 500rpx;" bindscroll="scroll" scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}"> | |||
<view class='card-items {{item.remainingAmount/100>=inputValue&&item.flag?"":"opcacity"}}' wx:for="{{cardList}}" wx:key="{{index}}" data-remainingAmount='{{item.remainingAmount/100}}' data-id="{{item.id}}" bindtap='check'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
<view class='card-items-left-img'> | |||
<image src='{{item.coverImg}}'></image> | |||
</view> | |||
<view class='card-items-left-text'>{{item.title}}</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
</view> | |||
</view> | |||
<view class='card-items'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
</view> | |||
</view> | |||
<view class='card-items'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
</view> | |||
</view> | |||
<view class='card-items'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
</view> | |||
</view> | |||
<view class='card-items'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
</view> | |||
</view> | |||
<view class='card-items'> | |||
<view class='card-items-left'> | |||
<view class='card-items-left-img'><image src=''></image></view> | |||
<view class='card-items-left-text'>万达标准卡</view> | |||
</view> | |||
<view class='card-items-right'> | |||
<view class='card-items-right-text'>余额:2000</view> | |||
<view class='card-items-right-radio'><image src=''></image></view> | |||
<view class='card-items-right-text'>余额:{{item.remainingAmount/100}}元</view> | |||
<view class='card-items-right-radio' class='icons'> | |||
<image wx:if="{{item.id != ids}}" src='./../../assets/images/no.png' mode='widthFix'></image> | |||
<image wx:if="{{item.id == ids&&item.remainingAmount/100>=inputValue&&item.flag}}" src='./../../assets/images/yes.png' mode='widthFix'></image> | |||
</view> | |||
</view> | |||
</view> | |||
</scroll-view> | |||
</view> | |||
<view class='card-bottom'> | |||
<button type='primary' class='checkcard-box'>购买新卡</button> | |||
<button type='primary' bindtap='gotonewcard' class='checkcard-box'>购买新卡</button> | |||
</view> | |||
</view> | |||
</view> |
@@ -81,7 +81,7 @@ | |||
.card-top{ | |||
height: 75rpx; | |||
width: 100%; | |||
background: rgb(200, 89, 99); | |||
background: #E67663; | |||
line-height: 75rpx; | |||
text-align: center; | |||
font-size:30rpx; | |||
@@ -96,22 +96,31 @@ | |||
.card-content image{ | |||
width: 64rpx; | |||
height: 64rpx; | |||
border-radius:10rpx; | |||
position: absolute; | |||
left: 20rpx; | |||
top: 0; | |||
bottom: 0; | |||
margin: auto; | |||
} | |||
.card-items{ | |||
position: relative; | |||
height: 130rpx; | |||
line-height: 130rpx; | |||
overflow: hidden; | |||
width: 94%; | |||
margin: 0 auto; | |||
border-bottom: 1rpx solid #cecece; | |||
border-bottom: 1rpx solid #eee; | |||
} | |||
.card-items-left{ | |||
width: 50%; | |||
float: left; | |||
font-size: 30rpx; | |||
} | |||
.card-items-right{ | |||
width: 50%; | |||
float: left; | |||
float: right; | |||
font-size: 30rpx; | |||
} | |||
.card-items-left-img{ | |||
width: 30%; | |||
@@ -133,6 +142,21 @@ | |||
width: 20%; | |||
} | |||
.checkcard-box{ | |||
width: 80%; | |||
width: 84%; | |||
background: #02C0FF!important; | |||
} | |||
.opcacity{ | |||
opacity: .2!important; | |||
} | |||
.icons{ | |||
width: 40rpx; | |||
height: 40rpx; | |||
position: absolute; | |||
top: 0; | |||
bottom: 0; | |||
right: 20rpx; | |||
margin: auto; | |||
} | |||
.icons image{ | |||
width:100%; | |||
} |
@@ -5,7 +5,7 @@ | |||
<view class="title">以下为商城会员对应门店的优惠折扣</view> | |||
</view> | |||
<view class='cards clearfix'> | |||
<view class='card' wx:for="{{discountMerchantList}}" wx:key="{{index}}"> | |||
<view class='card' wx:for="{{discountMerchantList}}" wx:key="{{index}}" wx:if="{{item.vipDiscountRate1/1000!=10}}"> | |||
<view class='txt01'> | |||
<view class="triangle"> | |||
<text><i>></i></text> | |||