Sfoglia il codice sorgente

[扫一扫,消费详情,付款成功]

tags/广东版3.2.1
meo 6 anni fa
parent
commit
a869c83e17
22 ha cambiato i file con 1170 aggiunte e 78 eliminazioni
  1. +2
    -0
      app.json
  2. BIN
      assets/images/success.png
  3. +1
    -0
      components/discountCard/index.wxss
  4. +9
    -3
      config/config.js
  5. +44
    -0
      ext.json
  6. +386
    -0
      pages/ConsumeDetail/ConsumeDetail.js
  7. +3
    -0
      pages/ConsumeDetail/ConsumeDetail.json
  8. +83
    -0
      pages/ConsumeDetail/ConsumeDetail.wxml
  9. +446
    -0
      pages/ConsumeDetail/ConsumeDetail.wxss
  10. +7
    -1
      pages/cardorder/index/index.js
  11. +2
    -2
      pages/cardorder/index/index.wxml
  12. +1
    -1
      pages/couponorder/index/index.json
  13. +1
    -1
      pages/discountCardList/discountCardList.wxml
  14. +2
    -1
      pages/order/detail/index.wxml
  15. +70
    -0
      pages/paySuccess/paySuccess.js
  16. +3
    -0
      pages/paySuccess/paySuccess.json
  17. +4
    -0
      pages/paySuccess/paySuccess.wxml
  18. +18
    -0
      pages/paySuccess/paySuccess.wxss
  19. +82
    -67
      pages/scanPay/scanPay.js
  20. +1
    -1
      pages/scanPay/scanPay.wxml
  21. +3
    -0
      pages/scanPay/scanPay.wxss
  22. +2
    -1
      project.config.json

+ 2
- 0
app.json Vedi File

@@ -39,6 +39,8 @@
"pages/freeBannerDetail/index", "pages/freeBannerDetail/index",
"pages/user/scoreHistory/index", "pages/user/scoreHistory/index",
"pages/scanPay/scanPay", "pages/scanPay/scanPay",
"pages/paySuccess/paySuccess",
"pages/ConsumeDetail/ConsumeDetail",
"pages/externallinks/index" "pages/externallinks/index"
], ],
"navigateToMiniProgramAppIdList": [ "navigateToMiniProgramAppIdList": [


BIN
assets/images/success.png Vedi File

Prima Dopo
Larghezza: 936  |  Altezza: 658  |  Dimensione: 251 KiB

+ 1
- 0
components/discountCard/index.wxss Vedi File

@@ -2,4 +2,5 @@
display: block; display: block;
margin: 30rpx auto 0; margin: 30rpx auto 0;
border: 1px solid red; border: 1px solid red;
height: 100rpx;
} }

+ 9
- 3
config/config.js Vedi File

@@ -181,7 +181,7 @@ var config = {
/** /**
* C端扫B端储值卡支付订单 * C端扫B端储值卡支付订单
*/ */
orderCreate:"/carday/order_create",
cardPayOrder:"/cardPay/order_create",
/** /**
* 兑换历史列表 * 兑换历史列表
*/ */
@@ -189,12 +189,18 @@ var config = {
/** /**
* 获取用户折扣率 * 获取用户折扣率
*/ */
getDiscount:"/user/getDiscount"
getDiscount:"/user/getDiscount",
/**
* C端扫B端储值卡交易流水列表接口
*/
cardpayList:"/cardPay/list"
}, },


weapp: { weapp: {
AppId: "wxea71200db93d756b"
AppId: "wxea71200db93d756b",
baseUrl:'https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/'
}, },

ErrorCode: { ErrorCode: {
NICK_NOT_AUTH: 11004, NICK_NOT_AUTH: 11004,
PHONE_NOT_AUTH: 11005, PHONE_NOT_AUTH: 11005,


+ 44
- 0
ext.json Vedi File

@@ -0,0 +1,44 @@
{
"extEnable": true,
"extAppid": "wxea71200db93d756b",
"directCommit": false,
"navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0",
"wxc07f9d67923d676d"
],
"tabBar": {
"color": "#9F9F9F",
"selectedColor": "#00C0FF",
"list": [
{
"pagePath": "pages/index/index",
"iconPath": "assets/images/home-n.png",
"selectedIconPath": "assets/images/home-y.png",
"text": "首页"
},
{
"pagePath": "pages/passCar/passCar",
"iconPath": "assets/images/pass1.png",
"selectedIconPath": "assets/images/pass0.png",
"text": "停车"
},
{
"pagePath": "pages/user/index",
"iconPath": "assets/images/user-n.png",
"selectedIconPath": "assets/images/user-y.png",
"text": "我的"
}
]
},
"window": {
"backgroundTextStyle": "red",
"navigationBarBackgroundColor": "#02C0FF",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "white"
},
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
},
"debug": false
}

+ 386
- 0
pages/ConsumeDetail/ConsumeDetail.js Vedi File

@@ -0,0 +1,386 @@
var config = require("../../config/config.js");
var app = getApp();
const Http = require("../../utils/HttpBasics");
const util = require("../../utils/util");
const imgurl = require("../../utils/imgurl");
Page({
data: {
fenxiangUrl:imgurl.fenxiang.url,
clockUrl:imgurl.clock.url,
teljpgUrl:imgurl.teljpg.url,
closedUrl:imgurl.closed.url,
quesGouUrl:imgurl.ques_gou.url,
headbgUrl:imgurl.headbg.url,
quesBgUrl:imgurl.ques_bg.url,
data: {
title: null
},
showPage:false,
questions1: null,
questions2: null,
carList: [],
couponChannelId: null,
couponId: null,
orderId: "",
hour: null,
minute: "",
tempFilePaths: null,
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
id: null,
result: [],
end_time: null,
checked:false,
clock: "已经截止",
questionnaire: {},
questionId: null,
widthScreen: null,
moveData: null,
rotateData: null,
alphaData: null,
scaleData: null,
skewData: null,
matrixData: null,
opacity:0,
queueData:null,
zIndex:11,
display:"none",
showbutton:false
},
phone: function (e) {
let that = this;
wx.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
});
},
onLoad(options) {
console.log(config.api.cardpayList);
let that = this;
wx.showLoading({
title: "加载中..."
});
var parmer = {
url: config.api.cardpayList,
data: {
cardId: options.cardId,
pageNum:1,
pageSize:10
}
};
Http.get(parmer)
.then(res => {
if(res.code==200){
that.setData({
showPage:true
})
}
if (res.data.endTime) {
that.countdown(res.data.endTime);
//当前时间与优惠券下架时间做计算
var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss");
if (util.timechuo(endTime).indexOf('-') == 0) {
that.setData({
endtime: "活动已结束",
});
} else {
that.setData({
endtime: util.timechuo(endTime)
});
}
}
wx.hideLoading();
that.setData({
data: res.data
});

if (res.data.validType == 1) {
that.setData({
validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"),
validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"),
});
} else {
that.setData({
validDays: res.data.validDays
});
}
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
},
/**
* 支付订单更新
*/
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => {
let that = this;
// 支付成功
Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
orderId: orderId,
status: status,
reason: reason
}
})
.then(res => {
wx.hideLoading()
// 有价券
if (!type&&type!='free') {
wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
}`
});
}else if(type=='free'){
wx.navigateTo({
url: `/pages/order/detail/index?orderId=${
orderId
}`
});
}
})
.catch(err => {
console.log(err);
if (!type) {
setTimeout(function () {
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this);
}, 2000)
}
})
},
/**
* 发起支付
*/
orderFunc(flag) {
var that = this;
// wx.showLoading({
// title: "加载中..."
// });
Http.post({
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId
};
if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId
};
}
/**
* orderSave 下单
*/
return Http.post({
url: config.api.orderSave,
data: data
});
})
.catch(err => {
if (err.code == "2011") {
wx.showToast({
title: "商户信息没找到",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "2013") {
wx.showToast({
title: "商户信息禁用",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "3000") {
wx.showToast({
title: "库存不足",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "3001") {
wx.showToast({
title: "领取达到上限",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "3002") {
wx.showToast({
title: "订单失败",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "3003") {
wx.showToast({
title: "订单不存在",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "3004") {
wx.showToast({
title: "订单不存在",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == "4003") {
wx.showToast({
title: "卡券已作废",
image:imgurl.fail.url,
duration: 2000,
mask: false
});
} else if (err.code == 11005) {
/**
* 将值传到用户手机号授权的页面
*
*/
wx.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else if (err.code == 11006) {
// 用户手机已加密
wx.redirectTo({
url: "/pages/phoneinput/phoneinput?couponChannelId=" +
that.data.couponChannelId +
"&couponId=" +
that.data.couponId
});
} else {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
}
})
.then(res => {
if (typeof (res) != "undefined") {
let orderId = "" + res.data.id;
that.setData({
orderId: orderId
});
if (res.data.payment > 0) {
// 支付金额不为0
/**
* 支付订单创建
*/
Http.post({
url: config.api.payOrderCreate,
data: {
orderId: orderId
}
}).then(res => {
var payOrderId = "" + res.data.payOrderId;
wx.hideLoading();
wx.requestPayment({
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: (res.data.signType) ? res.data.signType : "MD5",
paySign: res.data.paySign,
success: res => {
wx.showLoading({
title: '订单正在处理中...',
})
setTimeout(function(){
wx.hideLoading()
},5000)
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that);
if (res.errMsg == "requestPayment:ok") {
setTimeout(function () {
wx.hideLoading();
}, 2000);
/**
* 用户支付成功以后跳转到券包列表
*/
wx.setStorage({
key: 'couponNum',
data: "couponNum",
})
}
},
fail: res => {
/**
* 支付失败,需要更新订单的状态
*/
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that);
that.setData({
showbutton: false
})
return;
},
complete: res => {}
});
/// End payment --------
})
.catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free');
wx.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
})
.catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
},
onShow(){
this.setData({
showbutton:false
})
},
onShareAppMessage: function (options) {
var that = this;
var shareObj = {
title: that.data.data.title,
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}&couponId=${that.data.couponId}`,
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function (error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
}
};
// 来自页面内的按钮的转发
if (options.from == 'button') {
var eData = options.target.dataset.id;
var couponId = options.target.dataset.couponid;
shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${couponId}`;
}
// 返回shareObj
return shareObj;
},

});

+ 3
- 0
pages/ConsumeDetail/ConsumeDetail.json Vedi File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "券详情"
}

+ 83
- 0
pages/ConsumeDetail/ConsumeDetail.wxml Vedi File

@@ -0,0 +1,83 @@
<view wx:if="{{showPage}}">
<!-- 券的详情页面 -->
<view class='coupons'>
<view class="coupons-body">
<view class='banner'>
<image src='{{data.coverImg}}'></image>
</view>
<view class='coupons_info' style='position:relative;z-index:9'>
<view class='fenxiang'>
<image class="fenxiang" src='{{fenxiangUrl}}' mode="widthFix"></image>
<button class='share user-motto' data-id='{{data.id}}' data-couponId='{{data.couponId}}' data-title='{{data.title}}' id="shareBtn" open-type="share" hover-class="other-button-hover"></button>
</view>
<view>
<view class='distance' wx:if="{{data.targetAd==2&&data.endTime!=undefined&&data.type!=5}}">
<view style='text-align:center;display:inline-block;'>
<image class='clock' src='{{clockUrl}}' mode='widthFix'></image>
<text class="qiang">距结束还剩 :</text>
</view>
<view wx:if="{{clock=='已经截止'||data.remainInventory==0||data.status==1}}" class='times'>
<text>{{day}}</text>天
<text>{{hour}}</text>:
<text>{{min}}</text>:
<text>{{sec}}</text>
</view>
<view wx:if="{{clock!='已经截止'&&data.remainInventory!=0}}" class='times'>
<text>{{day}}</text>天
<text>{{hour}}</text>:
<text>{{min}}</text>:
<text>{{sec}}</text>
</view>
</view>
<text class='title'>{{data.title}}<text class="elecard">电子卡</text></text>
<text class="subTitle">{{data.subTitle}}</text>
<view class='salePriceStr clearfix'>
<view class="fl">售价:
<text class="pri01">{{data.salePriceStr}}</text>
<text class="yuan">元</text>
<text class='throgh' wx:if="{{data.unit==0}}">{{data.priceStr}}元</text>
<text wx:if="{{data.unit==1}}">{{data.priceStr}}小时</text>
</view>
<text class="restNum fr">剩余<text>{{data.remainInventory}}件</text></text>
</view>
<view class='rest' wx:if="{{data.validType==2}}">有效期:自领取之日起
<text class='time'>{{validDays}}</text>天内有效</view>
<view class='rest' wx:if="{{data.validType==1}}">有效期:
<text class='time'>{{validStartDate}}至{{validEndDate}}</text>
</view>
<view class='rest' wx:if="{{data.type==5}}">
<text class='time'>当次有效</text>
</view>
<view class='rest' wx:if="{{data.type==1}}">
<text class='txt01'>使用条件:</text>
<text class='time'>满{{data.usePriceStr}}元可用</text>
</view>
<view class='rest'>
<text class='txt01'>限购条件:</text>
<text class='time'>每人{{data.useLimitQuantity}}张</text>
</view>
</view>
</view>
<view class='posi'>
<view class='posi_logo' wx:for="{{data.merchantVoList}}" wx:key="index">
<view>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view>
<text>{{item.merchantName}}</text>
<text>{{item.addr}}{{item.buildingName}}{{item.floorName}}</text>
</view>
<image bindtap='phone' data-merchantLinkPhone='{{item.merchantLinkPhone}}' class="tel" src="{{teljpgUrl}}" mode="widthFix" />
</view>
</view>
<view class='notes'>
<view>
<text>购买须知</text>
</view>
<view>
<text><text class='spot'></text>{{data.remark}}</text>
</view>
</view>
</view>
</view>
</view>

+ 446
- 0
pages/ConsumeDetail/ConsumeDetail.wxss Vedi File

@@ -0,0 +1,446 @@
@import "../../app.wxss";
page {
background: #fff;
}

.coupons {
width: 100%;
position: relative;
overflow: hidden;
padding-bottom: 170rpx;
}

.banner {
position: relative;
width: 750rpx;
height: 534.5rpx;
}

.banner image {
width: 100%;
height: 100%;
}

.coupons_info {
width: 92%;
padding: 0 4%;
background: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
margin-top: -25rpx;
}

.fenxiang {
position: absolute;
right: 36rpx;
top: 27rpx;
width: 77rpx;
}

.fenxiang image {
width: 50rpx;
position: absolute;
top: 0;
right: 0;
}

.user-motto {
width: 100rpx;
border: 0;
background: none;
height: 60rpx;
color: #fff;
}

.user-motto::after {
border: none;
}

.title {
display: block;
font-size: 32rpx;
color: #000;
letter-spacing: 1.09rpx;
line-height: 45rpx;
width: 542rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-top: 30rpx;
}

.subTitle {
display: block;
width: 588rpx;
/* height: 37rpx; */
font-size: 26rpx;
color: #999;
letter-spacing: 1.16rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: 6rpx 0;
}

.rest {
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
height: 70rpx;
line-height: 70rpx;
/* border-bottom: 1px solid #eee; */
border-bottom: 1px solid #f9f9f9;
}

.restNum {
font-size: 24rpx;
color: #999;
letter-spacing: 1.16rpx;
text-align: right;
}

.time {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
line-height: 33rpx;
display: inline-block;
}

.txt01 {
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
}

.price {
font-size: 24rpx;
color: #999;
letter-spacing: 0;
}

.salePriceStr {
font-size: 24rpx;
color: #999;
letter-spacing: 0;
}

.salePriceStr .pri01 {
font-size: 40rpx;
color: #ff4949;
letter-spacing: 0;
margin-left: 10rpx;
}

.salePriceStr .yuan {
font-size: 24rpx;
color: #ff4949;
letter-spacing: 0;
}

.price text {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
}

.throgh {
text-decoration: line-through;
margin-left: 10rpx;
}

.posi {
position: relative;
width: 92%;
margin: 0 auto;
}

.fl {
float: left;
}

.fr {
float: right;
}

.posi>view:nth-child(2) {
width: 100%;
height: 87rpx;
display: flex;
justify-content: space-between;
border-top: 1px solid #f6f6f6;
line-height: 87rpx;
}

.posi>view:nth-child(2) text:nth-child(1) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi>view:nth-child(2) text:nth-child(2) {
font-size: 30rpx;
color: #a9a9a9;
}

.posi_logo {
width: 100%;
display: flex;
padding: 20rpx 0;
background: #fff;
height: 100rpx;
margin-bottom: 20rpx;
}

.posi_logo view:nth-child(1) {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
}

.posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
border: 1px solid #e5e5e5;
}

.posi_logo view:nth-child(2) {
display: flex;
flex-direction: column;
flex: 8;
padding-left: 30rpx;
}

.posi_logo view:nth-child(2) text:nth-child(1) {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
}

.posi_logo view:nth-child(2) text:nth-child(2) {
font-size: 24rpx;
color: #b8b8b8;
padding-top: 3rpx;
width: 450rpx;
height: 36rpx;
overflow: hidden;
}

.notes view:nth-child(1) {
width: 92%;
height: 87rpx;
padding: 0 4%;
line-height: 87rpx;
background: #fff;
}

.active {
opacity: 0.6;
}

.notes view:nth-child(1) text {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
}

.notes view:nth-child(2) {
width: 92%;
padding: 0 4%;
background: #fff;
display: flex;
flex-direction: column;
}

.notes view:nth-child(2)>text {
font-size: 24rpx;
color: #919191;
letter-spacing: 0;
line-height: 42rpx;
}

.buy-view {
background: #fff;
height: 96rpx;
bottom: 0;
left: 0;
right: 0;
padding-bottom: 22rpx;
padding-top: 22rpx;
}

.buy {
position: relative;
background: #00c0ff;
height: 94rpx;
width: 670rpx;
margin: 0 auto 30rpx;
color: #fff;
font-size: 36rpx;
line-height: 94rpx;
border-radius: 61rpx;
}

.tel {
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 50rpx;
height: 50rpx;
}

.txt {
margin-right: 30rpx;
}
.distance{
border: none;
border-radius:16rpx;
width: 600rpx;
padding: 16rpx 6rpx 0 0;
}
.distance .txt01{
display: block;
font-size: 26rpx;
color: #ff4949;
}
.clock{
width: 116rpx!important;
vertical-align: middle;
margin-right: 10rpx;
margin-top: -4rpx;
}
.qiang{
position: inline-block;
width: 60rpx;
height: 40rpx;
line-height: 40rpx;
color: #ff4949;
text-align: center;
font-size: 28rpx;
margin-right: 10rpx;
}
.times{
display: inline-block;
color: #ff4949;
font-weight:bold;
font-size: 26rpx;
text-align:center;
}
.times text{
display: inline-block;
margin: 6rpx;
width: 46rpx;
height: 56rpx;
text-align: center;
font-size: 28rpx;
line-height: 60rpx;
border-radius:12rpx;
color: #fff;
font-weight:bold;
background: #ff4949;
}

.b1 {
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: rgba(0, 0, 0, 0.8);
overflow: hidden;
z-index: 10;
}

.con {
position: absolute;
top: 35rpx;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 587rpx;
}

.con .image{
display: block;
width: 100%;
}

.img {
margin-top: -50rpx;
}
.question {
display: block;
width: 587rpx;
background: #fff;
border-bottom-left-radius: 22rpx;
border-bottom-right-radius: 22rpx;
overflow: hidden;
}

.ques {
display: block;
width: 511rpx;
margin: 0 auto;
height: 95rpx;
line-height: 95rpx;
font-size: 30rpx;
color: #333;
border-bottom: 1rpx solid #eee;
}

.titles {
width: 511rpx;
display: block;
text-align: center;
height: 50rpx;
margin: 0 auto;
padding-top:10rpx;
padding-bottom:20rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 41rpx;
border-bottom: 1rpx solid #eee;
}
.quessss >view:last-child{
border-bottom:0;
}
.close{
position: relative;
z-index: 10000;
display: block;
width: 70rpx;
}
.ques_gou{
position: absolute;
width: 20rpx;
top: 160rpx;
left: 23rpx;
}
.btns{
color: #f8755b;
font-weight: bold;
font-size: 30rpx!important;
text-align: center!important;
}
.radios{
display: block;
font-size:28rpx;
height: 95rpx;
line-height: 95rpx;
color: #333;
text-indent: .5em;
}
.elecard{
display: inline-block;
margin-left: 6rpx;
color: #00c0ff;
border: 1px solid #00c0ff;
border-radius:8rpx;
font-style: normal;
font-size: 30rpx;
line-height: 40rpx;
padding: 0 6rpx;
}

+ 7
- 1
pages/cardorder/index/index.js Vedi File

@@ -54,7 +54,13 @@ Page({
} }
}) })
}, },
// 跳转到详情
gotoConsumeDetail:function(e){
console.log(e.currentTarget.dataset.id)
wx.navigateTo({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${e.currentTarget.dataset.id}`,
})
},
//点击跳转到券详情页面 //点击跳转到券详情页面
gotouse: function (e) { gotouse: function (e) {
if (this.data.mystatus == '' || this.data.mystatus == 'undefined') { if (this.data.mystatus == '' || this.data.mystatus == 'undefined') {


+ 2
- 2
pages/cardorder/index/index.wxml Vedi File

@@ -19,11 +19,11 @@
<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>
<image data-id='{{item.id}}' bindtap='gotoConsumeDetail' class='fr' src='./../../../assets/images/icon01.png' mode="widthFix"></image>
</view> </view>
<view class='expiretime'> <view class='expiretime'>
<text class="txt2">{{item.expiredTime}}到期</text> <text class="txt2">{{item.expiredTime}}到期</text>
<text class='txt2 fr'>金额<text class='money'>{{item.remainingAmount/10000}}</text>元</text>
<text class='txt2 fr'>金额<text class='money'>{{item.remainingAmount/100}}</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' 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' wx:if="{{item.couponOrderStatus!=4}}" class="btns">已失效</view>


+ 1
- 1
pages/couponorder/index/index.json Vedi File

@@ -3,5 +3,5 @@
"i-tab": "../../../dist/tab/index", "i-tab": "../../../dist/tab/index",
"i-tabs": "../../../dist/tabs/index" "i-tabs": "../../../dist/tabs/index"
}, },
"navigationBarTitleText": "我的优惠劵"
"navigationBarTitleText": "我的券包"
} }

+ 1
- 1
pages/discountCardList/discountCardList.wxml Vedi File

@@ -27,6 +27,6 @@
</view> </view>
</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}}
</view> </view>
</view> </view>

+ 2
- 1
pages/order/detail/index.wxml Vedi File

@@ -51,8 +51,9 @@
</view> </view>
<view> <view>
<text>下单时间</text> <text>下单时间</text>
<text>{{createDate}}</text>
<text class='fr'>{{createDate}}</text>
</view> </view>

<view> <view>
<text>订单编号</text> <text>订单编号</text>
<text>{{order.orderNumber}}</text> <text>{{order.orderNumber}}</text>


+ 70
- 0
pages/paySuccess/paySuccess.js Vedi File

@@ -0,0 +1,70 @@
// pages/paySuccess/paySuccess.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},
goIndex:function(){
wx.switchTab({
url: '/pages/index/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/paySuccess/paySuccess.json Vedi File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "支付成功"
}

+ 4
- 0
pages/paySuccess/paySuccess.wxml Vedi File

@@ -0,0 +1,4 @@
<view class='content'>
<image src='./../../assets/images/success.png' mode="widthFix"></image>
<button bindtap='goIndex'>返回首页</button>
</view>

+ 18
- 0
pages/paySuccess/paySuccess.wxss Vedi File

@@ -0,0 +1,18 @@
.content image{
display: block;
width: 468rpx;
margin: 100rpx auto 0;
}
button::after{ border: none; }
.content button{
width: 670rpx;
height: 95rpx;
line-height: 95rpx;
text-align: center;
color: #333;
font-size: 36rpx;
background: #fff!important;
border-radius:60rpx!important;
margin-top: 169rpx;
border: 1px solid #C4C4C4;
}

+ 82
- 67
pages/scanPay/scanPay.js Vedi File

@@ -1,14 +1,14 @@
const util = require("../../utils/util.js"); const util = require("../../utils/util.js");
const config = require("../../config/config.js"); const config = require("../../config/config.js");
const Http = require("../../utils/HttpBasics"); const Http = require("../../utils/HttpBasics");
const AUTH_MODE = 'fingerPrint';
let app = getApp(); let app = getApp();
Page({ Page({

/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
merChant:{},
merChant: {},
focus: true, focus: true,
inputValue: '' inputValue: ''
}, },
@@ -16,12 +16,12 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) {
onLoad: function(options) {
console.log(options) console.log(options)
let that = this; let that = this;
that.setData({ that.setData({
merChant: JSON.parse(options.merChant), merChant: JSON.parse(options.merChant),
cardid:options.cardid
cardid: options.cardid
}) })
}, },
bindKeyInput(e) { bindKeyInput(e) {
@@ -29,114 +29,129 @@ Page({
this.setData({ this.setData({
inputValue: e.detail.value inputValue: e.detail.value
}) })
console.log(this.data.inputValue)
}, },
gotoPayMoney:function(){
gotoPayMoney: function() {
let that = this; let that = this;
Http.post({ 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
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',
})
})
.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])
// 指纹识别
startAuth() {
let that = this;
if (that.data.inputValue != "") {
const startSoterAuthentication = () => {
wx.startSoterAuthentication({
requestAuthModes: [AUTH_MODE],
challenge: 'test',
authContent: '小程序支付',
success: (res) => {
this.gotoPayMoney();
},
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({
success: (res) => {
console.log(res) console.log(res)
that.setData({
print: keys//页面中输出支持情况
checkIsEnrolled()
},
fail: (err) => {
console.error(err);
wx.showModal({
title: '错误',
content: '您的设备不支持指纹识别',
showCancel: false
}) })
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: "当前该设备不支持指纹识别"
})
}
} }
}) })
} else {
wx.showModal({
title: '抱歉',
content: '请输入金额',
showCancel: false
})
} }
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () {
onShow: function() {


}, },


/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () {
onHide: function() {


}, },


/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () {
onUnload: function() {


}, },


/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () {
onPullDownRefresh: function() {


}, },


/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () {
onReachBottom: function() {


}, },


/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {
onShareAppMessage: function() {


} }
}) })

+ 1
- 1
pages/scanPay/scanPay.wxml Vedi File

@@ -7,6 +7,6 @@
<view class='money'> <view class='money'>
<text class='icon'>¥</text> <text class='icon'>¥</text>
<input bindinput="bindKeyInput" class='num' type="digit" focus='true' placeholder="" /> <input bindinput="bindKeyInput" class='num' type="digit" focus='true' placeholder="" />
<button bindtap='gotoPayMoney'>确认付款</button>
<button bindtap='startAuth' hover-class='active'>确认付款</button>
</view> </view>
</view> </view>

+ 3
- 0
pages/scanPay/scanPay.wxss Vedi File

@@ -45,4 +45,7 @@
height: 60rpx; height: 60rpx;
margin-top: 20rpx; margin-top: 20rpx;
line-height: 60rpx; line-height: 60rpx;
}
.active{
opacity: .6;
} }

+ 2
- 1
project.config.json Vedi File

@@ -8,7 +8,8 @@
"es6": true, "es6": true,
"postcss": true, "postcss": true,
"minified": true, "minified": true,
"newFeature": true
"newFeature": true,
"autoAudits": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.0.9", "libVersion": "2.0.9",


Caricamento…
Annulla
Salva