Commit 5140358a authored by lizhishu's avatar lizhishu

1.消费应用更新;

parent c4d5aa28
......@@ -588,6 +588,16 @@
}
}
,{
"path" : "pages/ApplyConsumption/pendingOrderDetail/pendingOrderDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
......
......@@ -221,14 +221,21 @@
async goToPage(value) {
switch (value) {
case 1:
uni.navigateTo({
url: '../pendingOrder/pendingOrder'
})
break;
case 2:
uni.navigateTo({
url: '../topupDetail/topupDetail'
})
break;
case 3:
break;
default:
break;
}
},
// 跳转云平台权益中心
async openAzMenber() {
......
<template>
<div id="pendingOrderBox">
<van-dialog id="contactBTN" />
<van-toast id="van-toast" />
<van-toast id="custom-selector" />
<div class="switTab">
<div :class="activeTab==1?'active':''" @click="changeTab(1);">待支付</div><span style='color:#EEEEEE;'>|</span>
<div :class="activeTab==2?'active':''" @click="changeTab(2);">还款历史</div>
<p :style="activeTab==2?'left:70vw;':''" class="underLine"></p>
</div>
<div class="orderListBox">
<ul v-if="activeTab == 1" class="ulList" v-for="(item,index) in orderList" :key="index">
<li class="titileName" style="border-bottom:1rpx solid #EEEEEE;">订单时间:{{item.ordertime}}</li>
<li class="liCenter" @click="getChecked(index,item)">
<div style="width:66%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
<span>
<!-- <img class="checkImg" v-if="item.checked" src="@static/images/choice.png" alt="" /> -->
<!-- <span class="noChoice" v-else></span> -->
</span>
<span style="color:#000;font-size:30rpx;">{{item.businessname}}</span>
</div>
<div style="text-align:right;padding-right:30rpx;width:30%;">
<span style="color:#000;font-size:53rpx;">{{item.realPay}}</span>
</div>
</li>
<li class="titileName" style="color:#04B871;text-align:center;" @click="toDetailFun(item)">查看订单详情</li>
</ul>
<div v-if='activeTab == 1 && orderList.length==0&&manualrepay==1' class="noCostInfo">
<view id="pendingOrderBox">
<van-tabs color="#04B871" @click="changeTab" title-inactive-color="#969799" title-active-color="#323233">
<van-tab title='待支付' name="1">
</van-tab>
<van-tab title='还款历史' name="2">
</van-tab>
</van-tabs>
<view class="dataBox" :style="orderList.length==0?'background:#F1F1F3':''">
<view class="orderList" v-if='orderList.length>0'>
<view class="orderitem" @tap="getOrderDetai(item)" v-for="(item,index) in orderList" :key="index">
<view class="rigth">
<view class="storeName"> {{item.storeName||''}}</view>
<view class="mealType"> {{ mealType[item.mealType]||''}}</view>
<view class="amount"> {{itemAmount(item.amount||0)}} </view>
</view>
<view class="datatime">
{{item.dealTime||''}}
</view>
</view>
</view>
<view v-if='orderList.length==0' class="noCostInfo">
<image :src="ImgUrl+'xzf/noData-01.png'" mode='widthFix' />
<p>没有欠款订单~</p>
</div>
<div v-if="activeTab==1 && orderList.length>0 && manualrepay==1" class="bottomFixed">
<div @click="CheckedAllFun" v-if="false">
<img v-if="isAllChecked" class="checkImg" src="@static/images/choice.png" alt="" />
<span v-else class="noChoice"></span>
<span style="font-weight:bold;font-size:30rpx;">全选</span>
</div>
<div style="color:#888888;font-size:28rpx;text-align:right;width:50vw;">合计支付金额:<span
style='color:#FF1722;font-size:35rpx;'>{{totalAmount}}</span></div>
<button style="margin-top:30rpx;font-size:32rpx;" @click="ToPayOrderFun">支付</button>
</div>
<scroll-view v-if="activeTab == 2" class="sc" scroll-y="true">
<ul class="ulList" v-for="(item,index) in orderHistory" :key="index">
<li class="titileName" style="display:flex;border-bottom:1rpx solid #EEEEEE;">
<div style="text-align:left;width:70%;">扣款时间:{{item.pay_time}}</div>
<div style="text-align:right;width:30%;margin-right:30rpx;"
:style="item.handle_status==1?'color:#04B872;':'color:red;'">
{{item.handle_status==1?'还款成功':'还款失败'}}
</div>
</li>
<li class="liCenter">
<div style="width:66%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
<span style="color:#000;font-size:30rpx;">商户:{{item.bus_name}}</span>
</div>
<div style="text-align:right;padding-right:30rpx;width:30%;">
<span style="color:#000;font-size:53rpx;">{{item.amount}}</span>
</div>
</li>
<li class="titileName" style="color:#04B871;text-align:center;" @click="toDetailFun(item)">查看详情</li>
</ul>
</scroll-view>
<div v-if='activeTab == 2 && orderHistory.length==0' class="noCostInfo">
<image :src="ImgUrl+'xzf/noData-05.png'" mode='widthFix' />
<p>暂无还款历史~</p>
</div>
</div>
</div>
</view>
</view>
<view class="showall">
— 已展示全部数据 —
</view>
<view class="answeringQuestion" @click="goToPage(1)" v-if="activeTab==1">
为什么有待支付订单?
</view>
</view>
</template>
<script>
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default {
data() {
return {
bindUserInfo: {},
activeTab: 1, // 1 还款 2 历史
isAllChecked: false, //是否全选
checkedLength: 0, //选中的多少条订单
totalAmount: 0, //合计支付金额
walletAmount: 0, //钱包余额
toPayAmount: 0, //选择支付的金额
toPayOrderNum: [], //支付的订单流水合集
orderList: [],
orderHistory: [],
totalCount: 0, //总条数
pagenum: 1,
ImgUrl: this.$ImgUrl,
// 20220113
manualrepay: 1 //手动还款开关(0-关闭 1-开启)
mealType: {
1: '早餐',
2: '中餐',
3: '晚餐',
4: '夜宵',
5: '夜夜宵'
},
status: {
0: '待扣款',
1: '已付款',
2: '已撤销',
3: '已退款',
4: '异常订单'
}
}
},
onShow() {
let self = this;
// self.orderList = [];
// self.activeTab = 1;
// self.orderHistory = [];
// self.totalAmount = 0;
// self.toPayOrderNum = [];
// self.pagenum = 1;
// self.totalCount = 0;
// wx.getStorage({
// key: 'bindUserInfo',
// success(res) {
// self.bindUserInfo = res.data;
// // 20220113
// self.getUserInfo(res.data.userinfo.id)
// }
// })
// self.getOrderListInfo();
// self.queryUserWallet();
onLoad(options) {
this.WaitPayList(this.activeTab);
},
onShow() {},
methods: {
//获取用户信息
async getUserInfo(id) {
// 订单详情
async getOrderDetai(item) {
try {
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
let res = await this.$httpWX.post({
url: "/wechat/svweapp/QueryPersonalInfo",
data: {
userid: id,
}
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
toast.clear();
if (res.code == 10000) {
this.manualrepay = res.results.manualrepay
} else {
Toast(res.message)
}
} catch (err) {
toast.clear();
Toast(err.message);
}
},
//支付
ToPayOrderFun: function() {
if (this.globalData.limitBtnSend) {
// Toast('操作太频繁啦~')
return
} else {
this.globalData.limitBtnSend = true;
await new Promise((res, rej) => {
setTimeout(() => {
this.globalData.limitBtnSend = false;
}, 2000);
}
if (this.checkedLength == 0) {
Toast('请先选择要支付的订单哦~')
return
}
let self = this;
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
self.toPayAmount = (self.totalAmount * 100).toFixed(0);
console.log('钱包余额:' + self.walletAmount + '; 支付金额:' + self.toPayAmount)
if (self.walletAmount > self.toPayAmount || self.walletAmount == self.toPayAmount) { //直接钱包平账
toast.clear();
self.CustomDeductionFun();
} else { // 充值后平账
toast.clear();
self.$httpWX.post({ //
url: "/wechat/svweapp/CustomDeductionPayCharge",
data: {
amount: (self.toPayAmount) * 1,
devflownos: JSON.stringify(self.toPayOrderNum),
}
}).then(resp => {
if (resp.code == "10000") {
self.ordernumber = resp.results.ordernumber;
var resorder = resp.results.orderdata;
self.$httpWX.post({
url: "/wechat/svweapp/Wechatunifiedorder",
data: {
owid: resorder.id,
ipaddress: '127.0.0.1'
}
}).then(respv2 => {
toast.clear()
if (respv2.code == "10000") {
var reqdata = respv2.results;
wx.requestPayment({
timeStamp: reqdata.timeStamp,
nonceStr: reqdata.nonceStr,
package: reqdata.packagestr,
signType: reqdata.signType,
paySign: reqdata.paySign,
success(res) {
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
setTimeout(res => {
self.$httpWX.post({
url: "/wechat/svweapp/QueryFinanceCharge",
data: {
ownumber: self
.ordernumber + '',
}
}).then(res => {
if (res.results) {
toast.clear();
self
.CustomDeductionFun();
} else {
toast.clear();
Toast(res.message);
}
}).catch(res => {
toast.clear();
Toast(res.message);
res()
}, 200);
})
}, 2000)
},
fail(res) {
if (res.errMsg == "requestPayment:fail cancel") {
// Toast('用户取消支付');
return;
} else {
Toast("请求付款失败..[" + res.errMsg + "]");
return;
}
}
uni.hideLoading()
uni.navigateTo({
url: `../pendingOrderDetail/pendingOrderDetail?devflowNo=` + item.devflowNo || ''
})
} else {
Toast(respv2.message);
return;
}
})
} else {
toast.clear()
Toast(resp.message);
return;
}
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
changeTab: function(num) {
console.log(111111111111111111111111)
if (num == 1) {
this.activeTab = 1;
} else {
this.activeTab = 2;
this.orderHistory = [];
this.pagenum = 1;
this.totalCount = 0;
this.getHistory();
}
},
//自定义补扣
CustomDeductionFun: function() {
console.log(this.orderList)
let self = this;
let ordernosList = [];
self.orderList.forEach(res => {
if (res.checked) {
ordernosList.push(res.devflowno);
}
// 跳转页面
async goToPage(value) {
switch (value) {
case 1:
uni.navigateTo({
url: '../OrderClearSuspicions/OrderClearSuspicions'
})
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
self.$httpWX.post({
url: "/wechat/svweapp/CustomDeduction",
data: {
ordernos: JSON.stringify(ordernosList),
break;
case 2:
break;
case 3:
break;
default:
break;
}
}).then(res => {
toast.clear();
if (res.code == 10000) {
Dialog.alert({
message: '系统已受理,预计1分钟左右还款成功,可前往“还款历史”查看还款状态,期间请勿重复提交还款订单。',
confirmButtonText: '完成',
selector: '#contactBTN'
}).then(() => {
const toast = Toast.loading({
duration: 0,
forbidClick: true,
loadingType: 'spinner',
selector: '#custom-selector'
});
setTimeout(res => {
toast.clear();
var url = `/pages/UserMain/main`;
wx.reLaunch({
url
});
}, 1000)
});
} else {
Toast(res.message)
}
})
},
//查询用户钱包
queryUserWallet: function() {
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
this.$httpWX.post({
url: "/wechat/svweapp/QueryPayAccwallInfo",
data: {}
}).then(res => {
toast.clear();
if (res.code == 10000) {
this.walletAmount = res.results.walletinfo.amount;
} else {
Toast(res.message);
}
}).catch(response => {
toast.clear();
Toast(response.message)
// 待支付订单列表
async WaitPayList(activeTab) {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
},
//单选
getChecked: function(ind, item) {
this.totalAmount = 0;
this.toPayOrderNum = [];
let judgeAllCheck = true;
this.checkedLength = 0;
this.orderList.forEach((res, index) => {
if (ind == index) {
this.orderList[index].checked = !this.orderList[index].checked;
}
if (this.orderList[index].checked) {
this.totalAmount += this.orderList[index].realPay * 1;
this.toPayOrderNum.push(this.orderList[index].devflowno);
this.checkedLength += 1;
}
if (this.orderList[index].checked == false) {
judgeAllCheck = false;
}
})
this.totalAmount = this.totalAmount.toFixed(2);
judgeAllCheck ? this.isAllChecked = true : this.isAllChecked = false;
},
//全选点击
CheckedAllFun: function() {
this.totalAmount = 0;
this.toPayOrderNum = [];
this.checkedLength = 0;
if (this.isAllChecked) { //已经全选,取消全选
this.orderList.forEach((res, index) => {
this.orderList[index].checked = false;
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 200);
})
this.isAllChecked = false;
} else { //没有全选,全选
this.orderList.forEach((res, index) => {
this.orderList[index].checked = true;
if (this.orderList[index].checked) {
this.totalAmount += this.orderList[index].realPay * 1;
this.toPayOrderNum.push(this.orderList[index].devflowno)
}
const data = await requestPost('/cgi-xpay/app/h5/WaitPayList', {
accountId: sessionStorage.getItem('accountId') * 1,
status: activeTab - 1
})
this.checkedLength = this.orderList.length;
this.totalAmount = this.totalAmount.toFixed(2);
this.isAllChecked = true;
}
},
//获取历史订单
getHistory: function() {
let self = this;
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
self.$httpWX.post({
url: "/wechat/svweapp/QueryDeductionRecordPage",
data: {
pageindex: self.pagenum,
pagesize: 10
}
}).then(res => {
toast.clear();
if (res.code == 10000) {
self.totalCount = res.results.count;
res.results.backdata.forEach((res, index) => {
res.dealtime = self.$Utils.GMTToStr(res.deal_time);
res.amount = (res.amount / 100).toFixed(2);
res.id = res.dev_flow_id; //欠款订单id转为订单id 详情页查询用
res.pay_time = self.$Utils.GMTToStr(res.pay_time);
uni.hideLoading()
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
self.orderHistory = self.orderHistory.concat(res.results.backdata);
} else {
Toast(res.message)
return
}
})
},
//获取订单详情
// getOrderInfo: function() {
// const toast = Toast.loading({
// duration: 0, // 持续展示 toast
// forbidClick: true, // 禁用背景点击
// loadingType: 'spinner',
// selector: '#custom-selector'
// });
// this.$httpWX.post({
// url: "/wechat/svweapp/QueryPaymentDetailById",
// data: {
// id: this.globalData.outerOrderInfo.id,
// year:this.globalData.outerOrderInfo.year
// }
// }).then(res => {
// toast.clear();
// if (res.code == 10000) {
// this.orderList.push(res.results);
// this.orderList.forEach((res,index)=>{
// this.$set(this.orderList[index],'checked',true);
// this.$set(this.orderList[index],'ordertime',res.dealtime);
// this.$set(this.orderList[index],'realPay',((res.amount)/100).toFixed(2));
// res.amount = (res.amount/100).toFixed(2);
// // this.orderList[index].dealtime = res.dealtime.split('T')[0]+' '+(res.dealtime.split('T')[1]).split('+')[0];
// this.totalAmount+=res.realPay*1;
// })
// this.checkedLength = this.orderList.length;
// this.totalAmount = this.totalAmount.toFixed(2);
// this.isAllChecked = true;
// }else{
// Toast(res.message)
this.orderList = data.data['orderList'] || []
// this.orderList = Array(10).fill(1).map((v, index) => {
// return {
// accountId: index, // integer刷脸用户账户id,该id为绑定用户id
// amount: 100, // integer消费金额 单位分
// dealTime: '2023-08-09 08:02:01', // string消费时间
// debt: 1, // integer是否垫资 1支付宝垫资 0未垫资
// devflowNo: 'sdfasdfsdfsd', // string终端消费流水号
// mealType: 1, // integer餐别:1早餐,2中餐,3晚餐,4夜宵,5夜夜宵
// schoolName: '学校名称', // string学校名称
// status: 1, //integer订单状态 0待扣款 1已付款 2已撤销 3已退款 4异常订单
// storeName: '商家名称', // string商家名称
// userName: '用户姓名', // string用户姓名
// }
// })
// },
//跳转详情
toDetailFun: function(item) {
item.year = item.dealtime.split('-')[0];
this.globalData.outerOrderInfo = item;
this.globalData.tabTag = this.activeTab;
var url = '/pages/consumeData/main';
wx.navigateTo({
url
})
},
//获取订单列表
getOrderListInfo: function() {
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
selector: '#custom-selector'
});
this.$httpWX.post({
url: "/wechat/svweapp/QueryToDoRepayment",
data: {}
}).then(res => {
toast.clear();
if (res.code == 10000) {
this.orderList = res.results.backdata;
this.orderList.forEach((res, index) => {
this.$set(this.orderList[index], 'checked', true);
this.$set(this.orderList[index], 'realPay', ((res.amount) / 100).toFixed(
2));
this.$set(this.orderList[index], 'ordertime', this.$Utils.GMTToStr(res
.dealtime));
res.amount = (res.amount / 100).toFixed(2);
// this.orderList[index].dealtime = this.$Utils.GMTToStr(res.dealtime);
this.totalAmount += res.realPay * 1;
this.toPayOrderNum.push(res.devflowno);
})
this.checkedLength = this.orderList.length;
this.totalAmount = this.totalAmount.toFixed(2);
this.isAllChecked = true;
} else {
Toast(res.message)
}
})
changeTab(name, title) {
this.activeTab = name;
this.WaitPayList(this.activeTab);
},
},
// 上拉加载,拉到底部触发
onReachBottom() {
// 到这底部在这里需要做什么事情
if (this.activeTab == 2) {
if (this.orderHistory.length < this.totalCount) {
this.pagenum++;
this.getHistory();
} else if (this.orderHistory.length == this.totalCount) {
Toast('没有更多了~');
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
console.log('数据错了!!!')
return "0.00"
}
}
},
//下拉刷新
onPullDownRefresh: function() {
if (this.activeTab == 2) { //还款历史
this.pagenum = 1;
this.totalCount = 0;
this.orderHistory = [];
this.getHistory();
} else { // 还款订单
this.orderList = [];
this.toPayOrderNum = [];
this.totalAmount = 0;
this.getOrderListInfo();
this.queryUserWallet();
}
wx.stopPullDownRefresh()
},
onShareAppMessage: function() {
return {
path: `pages/index/main`
}
onReachBottom() {},
//下拉刷新
onPullDownRefresh() {
this.WaitPayList(this.activeTab);
uni.stopPullDownRefresh()
},
}
</script>
<style lang="scss">
#pendingOrderBox {
.underLine {
position: fixed;
width: 40rpx;
border-bottom: 5rpx solid #01BC73;
top: 115rpx;
border-radius: 5rpx;
left: 21vw;
page {
background: #F1F1F3;
}
.checkImg {
width: 32rpx;
height: 32rpx;
vertical-align: -5rpx;
margin-right: 15rpx;
#pendingOrderBox {
.orderList {
padding-left: 33rpx;
}
.noChoice {
display: inline-block;
width: 28rpx;
height: 28rpx;
margin-right: 15rpx;
border-radius: 50%;
background: #fff;
vertical-align: -5rpx;
border: 2rpx solid #01BC73;
.orderitem {
height: 135rpx;
border-bottom: 2rpx solid #E5E5E5;
.rigth {
display: flex;
justify-items: center;
align-items: center;
padding-top: 24rpx;
position: relative;
}
.active {
color: #01BC73;
font-weight: bold;
.storeName {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 45rpx;
}
.noCostInfo {
width: 500rpx;
margin: 10vh auto;
.mealType {
width: 80rpx;
height: 34rpx;
background: rgba(4, 184, 113, 0.09);
border-radius: 5rpx;
line-height: 34rpx;
text-align: center;
color: #484C54;
font-size: 30rpx;
margin-left: 20rpx;
image {
width: 500rpx;
height: 255rpx;
margin-bottom: 3vh;
}
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #04B871;
}
.switTab {
height: 118rpx;
width: 100vw;
position: fixed;
background: #fff;
z-index: 99;
top: 0;
div {
display: inline-block;
width: 48%;
line-height: 118rpx;
.amount {
position: absolute;
height: 45rpx;
font-size: 32rpx;
text-align: center;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #E02020;
line-height: 45rpx;
right: 40rpx;
}
.datatime {
height: 37rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.35);
line-height: 37rpx;
margin-top: 6rpx;
}
}
.orderListBox {
background: #F7F7FA;
min-height: calc(100vh - 287rpx);
padding-top: 40rpx;
padding-bottom: 130rpx;
margin-top: 118rpx;
.dataBox {
border-top: 2rpx solid #F1F1F3;
background: #FFFFFF;
}
.ulList {
width: 90vw;
height: 274rpx;
border: 2rpx solid #EEEEEE;
border-radius: 6rpx;
margin: 0 5vw 40rpx 5vw;
.answeringQuestion {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #858585;
line-height: 45rpx;
text-align: center;
margin-top: 30rpx;
padding-bottom: 50rpx;
}
.liCenter {
height: 133rpx;
padding-left: 30rpx;
line-height: 133rpx;
.showall {
height: 33rpx;
font-size: 24rpx;
background: #FAFAFC;
border-bottom: 1rpx solid #EEEEEE;
display: flex;
}
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.25);
line-height: 33rpx;
text-align: center;
margin-top: 32rpx;
}
.titileName {
color: #888888;
padding-left: 30rpx;
background: #fff;
height: 70.5rpx;
line-height: 70.5rpx;
font-size: 26rpx;
.active {
color: #01BC73;
font-weight: bold;
}
.bottomFixed {
position: fixed;
bottom: 0;
width: 100vw;
height: 128rpx;
background: #fff;
line-height: 128rpx;
display: flex;
padding: 0 30rpx;
.noCostInfo {
width: 500rpx;
margin: 10vh auto;
text-align: center;
color: #484C54;
font-size: 30rpx;
button {
width: 150rpx;
height: 70rpx;
line-height: 70rpx;
border-radius: 35rpx;
background: #04B871;
color: #fff;
font-size: 32rpx;
}
image {
width: 500rpx;
height: 255rpx;
margin-bottom: 3vh;
}
}
}
......
<template>
<view class="rechargeDetail">
<view class="contentWrapper">
<view class="wrapper">
<view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'">
<view class="line"></view>
</view>
<view class="title">{{orderInfo['storeName']||''}}-{{mealType[orderInfo['mealType']]}}</view>
<view class="amount">-{{itemAmount(orderInfo['amount']||0)}}</view>
<!-- 订单状态 -->
<view class="status" v-if="orderInfo['status']==0||orderInfo['status']==1">
{{['待支付','已支付'][orderInfo['status']]}}
</view>
<view class="rowItem" style="margin-top: 92rpx;">
<view class="label">学生姓名</view>
<view class="value">{{orderInfo['userName']||''}}</view>
</view>
<view class="rowItem">
<view class="label">年级班级</view>
<view class="value">{{orderInfo['gradeName']||''}}/{{orderInfo['className']||''}}</view>
</view>
<view class="rowItem">
<view class="label">手续费</view>
<view class="value"> {{orderInfo['serviceFee']||'0.00'}}</view>
</view>
<view class="rowItem">
<view class="label">消费设备</view>
<view class="value"> {{orderInfo['deviceName']||''}}</view>
</view>
<view class="rowItem">
<view class="label">消费场景</view>
<view class="value"> {{orderInfo['consumeScene']||''}}</view>
</view>
<view class="rowItem">
<view class="label">消费时间</view>
<view class="value">{{orderInfo['dealTime']||''}}</view>
</view>
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">{{orderInfo['platflowNo']||''}}</view>
</view>
<view class="btn" @click="goToPage(1)">
<view class="button">对此订单有疑问?</view>
</view>
</view>
<view class="bottomBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgBottom.png'+')'"></view>
</view>
</view>
</template>
<script>
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default {
data() {
return {
ImgUrl: this.$ImgUrl,
mealType: {
1: '早餐',
2: '中餐',
3: '晚餐',
4: '夜宵',
5: '夜夜宵'
},
status: {
0: '待扣款',
1: '已付款',
2: '已撤销',
3: '已退款',
4: '异常订单'
},
orderInfo: {
accountId: '', // integer刷脸用户账户id,该id为绑定用户id
amount: '', // integer消费金额 单位分
dealTime: '', // string消费时间(刷脸时间)
debt: '', // integer是否垫资 1支付宝垫资 0未垫资
devflowNo: '', // string终端消费流水号
mealType: 1, // integer餐别:1早餐,2中餐,3晚餐,4夜宵,5夜夜宵
payTime: '', // string支付时间
payType: '', // integer消费类型 1.刷卡 2.刷脸
platflowNo: '', // string平台交易流水(订单编号)
respMsg: '', // string响应描述 (欠款原因)
schoolName: '', // string学校名称
status: '', // integer订单状态 0待扣款 1已付款 2已撤销 3已退款 4异常订单
storeName: '', // string食堂档口名称
tradeNo: '', // string支付宝订单号(支付宝流水号)
userName: '', // string用户姓名
gradeName: '', //年级
className: '', //班级
serviceFee: '', //服务费(手续费) 格式0.02
deviceName: '', //消费设备
consumeScene: '' //消费场景
}
}
},
onLoad(options) {
this.OrderDetail(options['devflowNo'] || '');
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return "0.00"
}
}
},
},
methods: {
// 订单详情
async OrderDetail(devflowNo) {
const data = await requestPost('/cgi-xpay/app/h5/OrderDetail', {
devflowNo
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
this.orderInfo = data.data['data'] || {}
},
// 跳转页面
async goToPage(value) {
switch (value) {
case 1:
uni.makePhoneCall({
phoneNumber: '400-9656-210'
})
break;
case 2:
break;
case 3:
break;
default:
break;
}
},
}
}
</script>
<style lang="scss">
.rechargeDetail {
width: 100%;
height: 100%;
min-height: 100vh;
background: #F1F1F3;
.status {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FA6400;
line-height: 45rpx;
text-align: center;
}
.contentWrapper {
padding: 25rpx 22rpx 0 25rpx;
display: flex;
flex-direction: column;
.wrapper {
margin: 0 8rpx;
padding-top: 59rpx;
width: 686rpx;
display: flex;
flex-direction: column;
background: white;
font-family: PingFangSC-Regular, PingFang SC;
position: relative;
.topBg {
position: absolute;
top: 0;
left: -8rpx;
width: 703rpx;
height: 59rpx;
background-size: cover;
background-position: center center;
z-index: 1;
.line {
width: 686rpx;
height: 22rpx;
margin-top: 9rpx;
margin-left: 8rpx;
background: linear-gradient(180deg, #D9D9D9 0%, #FFFFFF 100%);
opacity: 0.75;
}
}
.title {
margin-top: 78rpx;
width: 100%;
height: 42rpx;
font-size: 30rpx;
font-weight: 400;
color: #333333;
line-height: 42rpx;
text-align: center;
}
.amount {
margin-top: 4rpx;
width: 100%;
height: 90rpx;
font-size: 64rpx;
color: #333333;
font-weight: 600;
line-height: 90rpx;
text-align: center;
}
.rowItem {
padding: 0 32rpx;
margin-bottom: 37rpx;
display: inline-flex;
justify-content: space-between;
height: 42rpx;
line-height: 42rpx;
font-size: 30rpx;
color: #333333;
.label {
height: 42rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 42rpx;
}
.value {
color: rgba(0, 0, 0, 0.5);
}
}
.btn {
padding: 165rpx 0 35rpx;
.button {
margin: 0 auto;
width: 622rpx;
height: 71rpx;
line-height: 71rpx;
background: #F1F1F3;
border-radius: 12rpx;
text-align: center;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
}
}
}
.bottomBg {
width: 686rpx;
height: 29rpx;
background-size: cover;
background-position: center center;
margin: 0 8rpx;
}
}
}
</style>
\ No newline at end of file
......@@ -5,33 +5,41 @@
<view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'">
<view class="line"></view>
</view>
<view class="title">东门食堂-早餐</view>
<view class="amount">-24.50</view>
<view class="rowItem">
<view class="title">{{orderInfo['storeName']||''}}-{{mealType[orderInfo['mealType']]}}</view>
<view class="amount">-{{itemAmount(orderInfo['amount']||0)}}</view>
<!-- 订单状态 -->
<view class="status" v-if="orderInfo['status']==0||orderInfo['status']==1">
{{['待支付','已支付'][orderInfo['status']]}}
</view>
<view class="rowItem" style="margin-top: 92rpx;">
<view class="label">学生姓名</view>
<view class="value">安小智</view>
<view class="value">{{orderInfo['userName']||''}}</view>
</view>
<view class="rowItem">
<view class="label">年级班级</view>
<view class="value">三年级/101班</view>
<view class="value">{{orderInfo['gradeName']||''}}/{{orderInfo['className']||''}}</view>
</view>
<view class="rowItem">
<view class="label">服务</view>
<view class="value"> 0.02</view>
<view class="label">手续</view>
<view class="value"> {{orderInfo['serviceFee']||'0.00'}}</view>
</view>
<view class="rowItem">
<view class="label">消费时间</view>
<view class="value">2022-06-11 07:00.00</view>
<view class="label">消费设备</view>
<view class="value"> {{orderInfo['deviceName']||''}}</view>
</view>
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">4202000000000000000000</view>
<view class="label">消费场景</view>
<view class="value"> {{orderInfo['consumeScene']||''}}</view>
</view>
<view class="rowItem">
<view class="label">支付订单号</view>
<view class="value">4202000000000000000000</view>
<view class="label">消费时间</view>
<view class="value">{{orderInfo['dealTime']||''}}</view>
</view>
<view class="btn">
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">{{orderInfo['platflowNo']||''}}</view>
</view>
<view class="btn" @click="goToPage(1)">
<view class="button">对此订单有疑问?</view>
</view>
</view>
......@@ -41,14 +49,103 @@
</template>
<script>
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default {
data() {
return {
ImgUrl: this.$ImgUrl,
mealType: {
1: '早餐',
2: '中餐',
3: '晚餐',
4: '夜宵',
5: '夜夜宵'
},
status: {
0: '待扣款',
1: '已付款',
2: '已撤销',
3: '已退款',
4: '异常订单'
},
orderInfo: {
accountId: '', // integer刷脸用户账户id,该id为绑定用户id
amount: '', // integer消费金额 单位分
dealTime: '', // string消费时间(刷脸时间)
debt: '', // integer是否垫资 1支付宝垫资 0未垫资
devflowNo: '', // string终端消费流水号
mealType: 1, // integer餐别:1早餐,2中餐,3晚餐,4夜宵,5夜夜宵
payTime: '', // string支付时间
payType: '', // integer消费类型 1.刷卡 2.刷脸
platflowNo: '', // string平台交易流水(订单编号)
respMsg: '', // string响应描述 (欠款原因)
schoolName: '', // string学校名称
status: '', // integer订单状态 0待扣款 1已付款 2已撤销 3已退款 4异常订单
storeName: '', // string食堂档口名称
tradeNo: '', // string支付宝订单号(支付宝流水号)
userName: '', // string用户姓名
gradeName: '', //年级
className: '', //班级
serviceFee: '', //服务费(手续费) 格式0.02
deviceName: '', //消费设备
consumeScene: '' //消费场景
}
}
},
onLoad(options) {
this.OrderDetail(options['devflowNo'] || '');
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return "0.00"
}
}
},
},
methods: {
// 订单详情
async OrderDetail(devflowNo) {
const data = await requestPost('/cgi-xpay/app/h5/OrderDetail', {
devflowNo
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
this.orderInfo = data.data['data'] || {}
},
// 跳转页面
async goToPage(value) {
switch (value) {
case 1:
uni.makePhoneCall({
phoneNumber: '400-9656-210'
})
break;
case 2:
break;
case 3:
break;
default:
break;
}
},
}
}
</script>
......@@ -60,6 +157,16 @@
min-height: 100vh;
background: #F1F1F3;
.status {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FA6400;
line-height: 45rpx;
text-align: center;
}
.contentWrapper {
padding: 25rpx 22rpx 0 25rpx;
display: flex;
......@@ -117,7 +224,6 @@
font-weight: 600;
line-height: 90rpx;
text-align: center;
margin-bottom: 87rpx;
}
.rowItem {
......@@ -130,6 +236,15 @@
font-size: 30rpx;
color: #333333;
.label {
height: 42rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 42rpx;
}
.value {
color: rgba(0, 0, 0, 0.5);
}
......
......@@ -7,46 +7,46 @@
</view>
<view class="right">
<view class="font28">¥</view>
<view class="font40"> 40.00</view>
<view class="font40">{{itemAmount(expenditure||0)}}</view>
</view>
</view>
<scroll-view scroll-y="true" class="scrollY">
<view class="pannels">
<view class="item">
<view class="pannels" v-if="list.length>0">
<view class="item" v-for="(item,index) in list" :key="index" @tap="rechargeRecordDetai(item)">
<view class="p1">
<view>线下充值</view>
<view class="num">10.00</view>
<view>{{item.optionName||''}}</view>
<view class="num">{{itemAmount(item.amount||0)}}</view>
</view>
<view class="p2">08-09 08:02:01</view>
<view class="p2">{{itemTimeFormat(item.payTime)}}</view>
</view>
<view class="item">
<view class="p1">
<view>线下充值</view>
<view class="num">10.00</view>
</view>
<view class="p2">08-09 08:02:01</view>
</view>
<view class="item">
<view class="p1">
<view>线下充值</view>
<view class="num">10.00</view>
</view>
<view class="p2">08-09 08:02:01</view>
</view>
<view v-if='list.length==0' class="noCostInfo">
<image :src="ImgUrl+'xzf/noData-01.png'" mode='widthFix' />
<p>没有更多数据~</p>
</view>
<view class="bottomTip">— 已展示全部数据 —</view>
<view class="bottomTip" v-if="list.length>0">— 已展示全部数据 —</view>
</scroll-view>
<view class="popup" v-if="show">
<van-datetime-picker :value="currentDate" type="year-month" title="选择年月" :min-date="minDate"
position="bottom" :max-date="maxDate" :formatter="formatter" @confirm="onConfirm" @cancel="onCancel"
/>
position="bottom" :max-date="maxDate" :formatter="formatter" @confirm="onConfirm" @cancel="onCancel" />
</view>
<view class="answeringQuestion" @click="goToPage(1)">
为什么有待支付订单?
</view>
</scroll-view>
</view>
</template>
<script>
import moment from "moment";
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
import {
DatetimePicker
} from 'vant';
......@@ -57,13 +57,133 @@
minDate: new Date(2022, 10, 0),
maxDate: new Date(2999, 10, 1),
currentDate: '',
currentDate_: '',
show: false,
list: [],
// 支出 单位分
expenditure: 0,
// 收入 单位分
revenue: 0
}
},
created() {
onLoad(options) {
this.currentDate = moment(new Date()).format('YYYY年M月');
this.currentDate_ = moment(new Date()).format('YYYY-MM');
this.QueryAccountExchangeList();
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return "0.00"
}
}
},
itemTimeFormat() {
return function(time) {
if (time) {
return moment(time).format('MM-DD HH:mm:ss')
} else {
return time
}
}
},
},
methods: {
// 充值详情
async rechargeRecordDetai(item) {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 200);
})
uni.hideLoading()
uni.navigateTo({
url: `../rechargeDetail/rechargeDetail?devflowNo=` + item.devflowNo || ''
})
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
// 跳转页面
async goToPage(value) {
switch (value) {
case 1:
uni.navigateTo({
url: '../OrderClearSuspicions/OrderClearSuspicions'
})
break;
case 2:
break;
case 3:
break;
default:
break;
}
},
// 充值明细列表
async QueryAccountExchangeList() {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 200);
})
const data = await requestPost('/cgi-xpay/app/h5/QueryAccountExchangeList', {
accountId: sessionStorage.getItem('accountId') * 1,
month: this.currentDate_
})
uni.hideLoading()
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
// amount integer金额 单位分
// className string班级
// gradeName string年级
// id integer
// optionName string操作名称 示例:线上充值
// outTradeNo string交易订单号
// payTime string消费时间
// serviceFee string服务费 格式¥0.02
// tradeNo string支付订单号
this.list = data.data['list'] || []
this.expenditure = data.data['expenditure'] || 0
// this.list = Array(10).fill(1).map((v, index) => {
// return {
// amount: 100, // integer金额 单位分
// className: '班级', // string班级
// gradeName: '年级', // string年级
// id: index + 1, // integer
// optionName: '线上充值', // string操作名称 示例:线上充值
// outTradeNo: '易订单号', // string交易订单号
// payTime: '2023-09-10 08:22:56', // string消费时间
// serviceFee: '0.02', // string服务费 格式¥0.02
// tradeNo: '支付订单号', // string支付订单号
// }
// })
},
formatter(type, val) {
if (type === 'year') {
return `${val}年`;
......@@ -74,7 +194,9 @@
},
onConfirm(val) {
this.currentDate = moment(val).format('YYYY年M月')
this.currentDate_ = moment(val).format('YYYY-MM');
this.show = false
this.QueryAccountExchangeList()
},
onCancel() {
this.show = false
......@@ -87,10 +209,36 @@
.topupDetail {
width: 100%;
height: 100%;
min-height: calc(100vh - calc(44px + env(safe-area-inset-top)));
min-height: 100vh;
background: #F1F1F3;
font-family: PingFangSC-Regular, PingFang SC;
.noCostInfo {
width: 500rpx;
margin: 10vh auto;
text-align: center;
color: #484C54;
font-size: 30rpx;
image {
width: 500rpx;
height: 255rpx;
margin-bottom: 3vh;
}
}
.answeringQuestion {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #858585;
line-height: 45rpx;
text-align: center;
margin-top: 30rpx;
padding-bottom: 50rpx;
}
.firstLine {
display: inline-flex;
justify-content: space-between;
......@@ -133,18 +281,20 @@
}
.scrollY {
position: fixed;
height: calc(100vh - 91rpx - calc(44px + env(safe-area-inset-top)));
bottom: 0;
left: 0;
right: 0;
// position: fixed;
// height: calc(100vh - 91rpx - calc(44px + env(safe-area-inset-top)));
// bottom: 0;
// left: 0;
// right: 0;
}
.popup {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.pannels {
width: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment