Commit 5140358a authored by lizhishu's avatar lizhishu

1.消费应用更新;

parent c4d5aa28
...@@ -588,6 +588,16 @@ ...@@ -588,6 +588,16 @@
} }
} }
,{
"path" : "pages/ApplyConsumption/pendingOrderDetail/pendingOrderDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
...@@ -221,14 +221,21 @@ ...@@ -221,14 +221,21 @@
async goToPage(value) { async goToPage(value) {
switch (value) { switch (value) {
case 1: case 1:
uni.navigateTo({
url: '../pendingOrder/pendingOrder'
})
break; break;
case 2: case 2:
uni.navigateTo({
url: '../topupDetail/topupDetail'
})
break; break;
case 3: case 3:
break; break;
default: default:
break; break;
} }
}, },
// 跳转云平台权益中心 // 跳转云平台权益中心
async openAzMenber() { async openAzMenber() {
......
<template> <template>
<div id="pendingOrderBox"> <view id="pendingOrderBox">
<van-dialog id="contactBTN" /> <van-tabs color="#04B871" @click="changeTab" title-inactive-color="#969799" title-active-color="#323233">
<van-toast id="van-toast" /> <van-tab title='待支付' name="1">
<van-toast id="custom-selector" /> </van-tab>
<div class="switTab"> <van-tab title='还款历史' name="2">
<div :class="activeTab==1?'active':''" @click="changeTab(1);">待支付</div><span style='color:#EEEEEE;'>|</span> </van-tab>
<div :class="activeTab==2?'active':''" @click="changeTab(2);">还款历史</div> </van-tabs>
<p :style="activeTab==2?'left:70vw;':''" class="underLine"></p> <view class="dataBox" :style="orderList.length==0?'background:#F1F1F3':''">
</div> <view class="orderList" v-if='orderList.length>0'>
<div class="orderListBox"> <view class="orderitem" @tap="getOrderDetai(item)" v-for="(item,index) in orderList" :key="index">
<ul v-if="activeTab == 1" class="ulList" v-for="(item,index) in orderList" :key="index"> <view class="rigth">
<li class="titileName" style="border-bottom:1rpx solid #EEEEEE;">订单时间:{{item.ordertime}}</li> <view class="storeName"> {{item.storeName||''}}</view>
<li class="liCenter" @click="getChecked(index,item)"> <view class="mealType"> {{ mealType[item.mealType]||''}}</view>
<div style="width:66%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"> <view class="amount"> {{itemAmount(item.amount||0)}} </view>
<span> </view>
<!-- <img class="checkImg" v-if="item.checked" src="@static/images/choice.png" alt="" /> --> <view class="datatime">
<!-- <span class="noChoice" v-else></span> --> {{item.dealTime||''}}
</span> </view>
<span style="color:#000;font-size:30rpx;">{{item.businessname}}</span> </view>
</div> </view>
<div style="text-align:right;padding-right:30rpx;width:30%;"> <view v-if='orderList.length==0' class="noCostInfo">
<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">
<image :src="ImgUrl+'xzf/noData-01.png'" mode='widthFix' /> <image :src="ImgUrl+'xzf/noData-01.png'" mode='widthFix' />
<p>没有欠款订单~</p> <p>没有欠款订单~</p>
</div> </view>
<div v-if="activeTab==1 && orderList.length>0 && manualrepay==1" class="bottomFixed"> </view>
<div @click="CheckedAllFun" v-if="false"> <view class="showall">
<img v-if="isAllChecked" class="checkImg" src="@static/images/choice.png" alt="" /> — 已展示全部数据 —
<span v-else class="noChoice"></span> </view>
<span style="font-weight:bold;font-size:30rpx;">全选</span> <view class="answeringQuestion" @click="goToPage(1)" v-if="activeTab==1">
</div> 为什么有待支付订单?
<div style="color:#888888;font-size:28rpx;text-align:right;width:50vw;">合计支付金额:<span </view>
style='color:#FF1722;font-size:35rpx;'>{{totalAmount}}</span></div> </view>
<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>
</template> </template>
<script> <script>
import { import {
Dialog, Dialog,
Toast Toast
} from 'vant'; } from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default { export default {
data() { data() {
return { return {
bindUserInfo: {},
activeTab: 1, // 1 还款 2 历史 activeTab: 1, // 1 还款 2 历史
isAllChecked: false, //是否全选
checkedLength: 0, //选中的多少条订单
totalAmount: 0, //合计支付金额
walletAmount: 0, //钱包余额
toPayAmount: 0, //选择支付的金额
toPayOrderNum: [], //支付的订单流水合集
orderList: [], orderList: [],
orderHistory: [],
totalCount: 0, //总条数
pagenum: 1,
ImgUrl: this.$ImgUrl, ImgUrl: this.$ImgUrl,
// 20220113 mealType: {
manualrepay: 1 //手动还款开关(0-关闭 1-开启) 1: '早餐',
2: '中餐',
3: '晚餐',
4: '夜宵',
5: '夜夜宵'
},
status: {
0: '待扣款',
1: '已付款',
2: '已撤销',
3: '已退款',
4: '异常订单'
}
} }
}, },
onShow() { onLoad(options) {
let self = this; this.WaitPayList(this.activeTab);
// 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();
}, },
onShow() {},
methods: { methods: {
//获取用户信息 // 订单详情
async getUserInfo(id) { async getOrderDetai(item) {
try { try {
const toast = Toast.loading({ uni.showLoading({
duration: 0, // 持续展示 toast title: "请稍后",
forbidClick: true, // 禁用背景点击 // #ifndef MP-ALIPAY
loadingType: 'spinner', mask: true,
selector: '#custom-selector' // #endif
});
let res = await this.$httpWX.post({
url: "/wechat/svweapp/QueryPersonalInfo",
data: {
userid: id,
}
}) })
toast.clear(); await new Promise((res, rej) => {
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;
setTimeout(() => { setTimeout(() => {
this.globalData.limitBtnSend = false; res()
}, 2000); }, 200);
}
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);
}) })
}, 2000) uni.hideLoading()
uni.navigateTo({
}, url: `../pendingOrderDetail/pendingOrderDetail?devflowNo=` + item.devflowNo || ''
fail(res) {
if (res.errMsg == "requestPayment:fail cancel") {
// Toast('用户取消支付');
return;
} else {
Toast("请求付款失败..[" + res.errMsg + "]");
return;
}
}
}) })
} else { } catch (error) {
Toast(respv2.message); uni.showToast({
return; icon: "error",
} title: error.message
})
} else {
toast.clear()
Toast(resp.message);
return;
}
}) })
} }
}, },
changeTab: function(num) { // 跳转页面
console.log(111111111111111111111111) async goToPage(value) {
if (num == 1) { switch (value) {
this.activeTab = 1; case 1:
} else { uni.navigateTo({
this.activeTab = 2; url: '../OrderClearSuspicions/OrderClearSuspicions'
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);
}
}) })
const toast = Toast.loading({ break;
duration: 0, // 持续展示 toast case 2:
forbidClick: true, // 禁用背景点击 break;
loadingType: 'spinner', case 3:
selector: '#custom-selector' break;
}); default:
self.$httpWX.post({ break;
url: "/wechat/svweapp/CustomDeduction",
data: {
ordernos: JSON.stringify(ordernosList),
} }
}).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() { async WaitPayList(activeTab) {
const toast = Toast.loading({ uni.showLoading({
duration: 0, // 持续展示 toast title: "请稍后",
forbidClick: true, // 禁用背景点击 // #ifndef MP-ALIPAY
loadingType: 'spinner', mask: true,
selector: '#custom-selector' // #endif
});
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)
}) })
}, await new Promise((res, rej) => {
//单选 setTimeout(() => {
getChecked: function(ind, item) { res()
this.totalAmount = 0; }, 200);
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;
}) })
this.isAllChecked = false; const data = await requestPost('/cgi-xpay/app/h5/WaitPayList', {
} else { //没有全选,全选 accountId: sessionStorage.getItem('accountId') * 1,
this.orderList.forEach((res, index) => { status: activeTab - 1
this.orderList[index].checked = true;
if (this.orderList[index].checked) {
this.totalAmount += this.orderList[index].realPay * 1;
this.toPayOrderNum.push(this.orderList[index].devflowno)
}
}) })
this.checkedLength = this.orderList.length; uni.hideLoading()
this.totalAmount = this.totalAmount.toFixed(2); if (data['code'] != 200) {
this.isAllChecked = true; await Dialog({
} title: '温馨提示',
}, message: data['message'],
//获取历史订单 confirmButtonText: "知道了"
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);
}) })
self.orderHistory = self.orderHistory.concat(res.results.backdata); return
} else {
Toast(res.message)
} }
}) this.orderList = data.data['orderList'] || []
}, // this.orderList = Array(10).fill(1).map((v, index) => {
//获取订单详情 // return {
// getOrderInfo: function() { // accountId: index, // integer刷脸用户账户id,该id为绑定用户id
// const toast = Toast.loading({ // amount: 100, // integer消费金额 单位分
// duration: 0, // 持续展示 toast // dealTime: '2023-08-09 08:02:01', // string消费时间
// forbidClick: true, // 禁用背景点击 // debt: 1, // integer是否垫资 1支付宝垫资 0未垫资
// loadingType: 'spinner', // devflowNo: 'sdfasdfsdfsd', // string终端消费流水号
// selector: '#custom-selector' // mealType: 1, // integer餐别:1早餐,2中餐,3晚餐,4夜宵,5夜夜宵
// }); // schoolName: '学校名称', // string学校名称
// this.$httpWX.post({ // status: 1, //integer订单状态 0待扣款 1已付款 2已撤销 3已退款 4异常订单
// url: "/wechat/svweapp/QueryPaymentDetailById", // storeName: '商家名称', // string商家名称
// data: { // userName: '用户姓名', // string用户姓名
// 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)
// } // }
// }) // })
// },
//跳转详情
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
})
}, },
//获取订单列表 changeTab(name, title) {
getOrderListInfo: function() { this.activeTab = name;
const toast = Toast.loading({ this.WaitPayList(this.activeTab);
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)
}
})
}, },
}, },
// 上拉加载,拉到底部触发 computed: {
onReachBottom() { itemAmount() {
// 到这底部在这里需要做什么事情 return function(Amount) {
if (this.activeTab == 2) { if (Amount) {
if (this.orderHistory.length < this.totalCount) { return (Amount / 100).toFixed(2)
this.pagenum++;
this.getHistory();
} else if (this.orderHistory.length == this.totalCount) {
Toast('没有更多了~');
} else { } 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() { onReachBottom() {},
return { //下拉刷新
path: `pages/index/main` onPullDownRefresh() {
} this.WaitPayList(this.activeTab);
uni.stopPullDownRefresh()
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
#pendingOrderBox { page {
.underLine { background: #F1F1F3;
position: fixed;
width: 40rpx;
border-bottom: 5rpx solid #01BC73;
top: 115rpx;
border-radius: 5rpx;
left: 21vw;
} }
.checkImg { #pendingOrderBox {
width: 32rpx;
height: 32rpx; .orderList {
vertical-align: -5rpx; padding-left: 33rpx;
margin-right: 15rpx;
} }
.noChoice { .orderitem {
display: inline-block; height: 135rpx;
width: 28rpx; border-bottom: 2rpx solid #E5E5E5;
height: 28rpx;
margin-right: 15rpx; .rigth {
border-radius: 50%; display: flex;
background: #fff; justify-items: center;
vertical-align: -5rpx; align-items: center;
border: 2rpx solid #01BC73; padding-top: 24rpx;
position: relative;
} }
.active { .storeName {
color: #01BC73; height: 45rpx;
font-weight: bold; font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 45rpx;
} }
.noCostInfo { .mealType {
width: 500rpx; width: 80rpx;
margin: 10vh auto; height: 34rpx;
background: rgba(4, 184, 113, 0.09);
border-radius: 5rpx;
line-height: 34rpx;
text-align: center; text-align: center;
color: #484C54; margin-left: 20rpx;
font-size: 30rpx;
image { font-size: 24rpx;
width: 500rpx; font-family: PingFangSC-Regular, PingFang SC;
height: 255rpx; font-weight: 400;
margin-bottom: 3vh; color: #04B871;
}
} }
.switTab { .amount {
height: 118rpx; position: absolute;
width: 100vw; height: 45rpx;
position: fixed;
background: #fff;
z-index: 99;
top: 0;
div {
display: inline-block;
width: 48%;
line-height: 118rpx;
font-size: 32rpx; 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 { .dataBox {
background: #F7F7FA; border-top: 2rpx solid #F1F1F3;
min-height: calc(100vh - 287rpx); background: #FFFFFF;
padding-top: 40rpx; }
padding-bottom: 130rpx;
margin-top: 118rpx;
.ulList { .answeringQuestion {
width: 90vw; height: 45rpx;
height: 274rpx; font-size: 32rpx;
border: 2rpx solid #EEEEEE; font-family: PingFangSC-Regular, PingFang SC;
border-radius: 6rpx; font-weight: 400;
margin: 0 5vw 40rpx 5vw; color: #858585;
line-height: 45rpx;
text-align: center;
margin-top: 30rpx;
padding-bottom: 50rpx;
}
.liCenter { .showall {
height: 133rpx; height: 33rpx;
padding-left: 30rpx;
line-height: 133rpx;
font-size: 24rpx; font-size: 24rpx;
background: #FAFAFC; font-family: PingFangSC-Regular, PingFang SC;
border-bottom: 1rpx solid #EEEEEE; font-weight: 400;
display: flex; color: rgba(0, 0, 0, 0.25);
} line-height: 33rpx;
text-align: center;
margin-top: 32rpx;
} }
.titileName { .active {
color: #888888; color: #01BC73;
padding-left: 30rpx; font-weight: bold;
background: #fff;
height: 70.5rpx;
line-height: 70.5rpx;
font-size: 26rpx;
} }
.bottomFixed { .noCostInfo {
position: fixed; width: 500rpx;
bottom: 0; margin: 10vh auto;
width: 100vw; text-align: center;
height: 128rpx; color: #484C54;
background: #fff; font-size: 30rpx;
line-height: 128rpx;
display: flex;
padding: 0 30rpx;
button { image {
width: 150rpx; width: 500rpx;
height: 70rpx; height: 255rpx;
line-height: 70rpx; margin-bottom: 3vh;
border-radius: 35rpx;
background: #04B871;
color: #fff;
font-size: 32rpx;
}
} }
} }
} }
......
<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 @@ ...@@ -5,33 +5,41 @@
<view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'"> <view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'">
<view class="line"></view> <view class="line"></view>
</view> </view>
<view class="title">东门食堂-早餐</view> <view class="title">{{orderInfo['storeName']||''}}-{{mealType[orderInfo['mealType']]}}</view>
<view class="amount">-24.50</view> <view class="amount">-{{itemAmount(orderInfo['amount']||0)}}</view>
<view class="rowItem"> <!-- 订单状态 -->
<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="label">学生姓名</view>
<view class="value">安小智</view> <view class="value">{{orderInfo['userName']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">年级班级</view> <view class="label">年级班级</view>
<view class="value">三年级/101班</view> <view class="value">{{orderInfo['gradeName']||''}}/{{orderInfo['className']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">服务</view> <view class="label">手续</view>
<view class="value"> 0.02</view> <view class="value"> {{orderInfo['serviceFee']||'0.00'}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">消费时间</view> <view class="label">消费设备</view>
<view class="value">2022-06-11 07:00.00</view> <view class="value"> {{orderInfo['deviceName']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">交易订单号</view> <view class="label">消费场景</view>
<view class="value">4202000000000000000000</view> <view class="value"> {{orderInfo['consumeScene']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">支付订单号</view> <view class="label">消费时间</view>
<view class="value">4202000000000000000000</view> <view class="value">{{orderInfo['dealTime']||''}}</view>
</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 class="button">对此订单有疑问?</view>
</view> </view>
</view> </view>
...@@ -41,14 +49,103 @@ ...@@ -41,14 +49,103 @@
</template> </template>
<script> <script>
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default { export default {
data() { data() {
return { return {
ImgUrl: this.$ImgUrl, 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: { 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> </script>
...@@ -60,6 +157,16 @@ ...@@ -60,6 +157,16 @@
min-height: 100vh; min-height: 100vh;
background: #F1F1F3; 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 { .contentWrapper {
padding: 25rpx 22rpx 0 25rpx; padding: 25rpx 22rpx 0 25rpx;
display: flex; display: flex;
...@@ -117,7 +224,6 @@ ...@@ -117,7 +224,6 @@
font-weight: 600; font-weight: 600;
line-height: 90rpx; line-height: 90rpx;
text-align: center; text-align: center;
margin-bottom: 87rpx;
} }
.rowItem { .rowItem {
...@@ -130,6 +236,15 @@ ...@@ -130,6 +236,15 @@
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
.label {
height: 42rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 42rpx;
}
.value { .value {
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
} }
......
...@@ -7,46 +7,46 @@ ...@@ -7,46 +7,46 @@
</view> </view>
<view class="right"> <view class="right">
<view class="font28">¥</view> <view class="font28">¥</view>
<view class="font40"> 40.00</view> <view class="font40">{{itemAmount(expenditure||0)}}</view>
</view> </view>
</view> </view>
<scroll-view scroll-y="true" class="scrollY"> <scroll-view scroll-y="true" class="scrollY">
<view class="pannels"> <view class="pannels" v-if="list.length>0">
<view class="item"> <view class="item" v-for="(item,index) in list" :key="index" @tap="rechargeRecordDetai(item)">
<view class="p1"> <view class="p1">
<view>线下充值</view> <view>{{item.optionName||''}}</view>
<view class="num">10.00</view> <view class="num">{{itemAmount(item.amount||0)}}</view>
</view> </view>
<view class="p2">08-09 08:02:01</view> <view class="p2">{{itemTimeFormat(item.payTime)}}</view>
</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>
<view v-if='list.length==0' class="noCostInfo">
<image :src="ImgUrl+'xzf/noData-01.png'" mode='widthFix' />
<p>没有更多数据~</p>
</view> </view>
<view class="bottomTip">— 已展示全部数据 —</view> <view class="bottomTip" v-if="list.length>0">— 已展示全部数据 —</view>
</scroll-view>
<view class="popup" v-if="show"> <view class="popup" v-if="show">
<van-datetime-picker :value="currentDate" type="year-month" title="选择年月" :min-date="minDate" <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> </view>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
import moment from "moment"; import moment from "moment";
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
import { import {
DatetimePicker DatetimePicker
} from 'vant'; } from 'vant';
...@@ -57,13 +57,133 @@ ...@@ -57,13 +57,133 @@
minDate: new Date(2022, 10, 0), minDate: new Date(2022, 10, 0),
maxDate: new Date(2999, 10, 1), maxDate: new Date(2999, 10, 1),
currentDate: '', currentDate: '',
currentDate_: '',
show: false, 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年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: { 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) { formatter(type, val) {
if (type === 'year') { if (type === 'year') {
return `${val}年`; return `${val}年`;
...@@ -74,7 +194,9 @@ ...@@ -74,7 +194,9 @@
}, },
onConfirm(val) { onConfirm(val) {
this.currentDate = moment(val).format('YYYY年M月') this.currentDate = moment(val).format('YYYY年M月')
this.currentDate_ = moment(val).format('YYYY-MM');
this.show = false this.show = false
this.QueryAccountExchangeList()
}, },
onCancel() { onCancel() {
this.show = false this.show = false
...@@ -87,10 +209,36 @@ ...@@ -87,10 +209,36 @@
.topupDetail { .topupDetail {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: calc(100vh - calc(44px + env(safe-area-inset-top))); min-height: 100vh;
background: #F1F1F3; background: #F1F1F3;
font-family: PingFangSC-Regular, PingFang SC; 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 { .firstLine {
display: inline-flex; display: inline-flex;
justify-content: space-between; justify-content: space-between;
...@@ -133,18 +281,20 @@ ...@@ -133,18 +281,20 @@
} }
.scrollY { .scrollY {
position: fixed; // position: fixed;
height: calc(100vh - 91rpx - calc(44px + env(safe-area-inset-top))); // height: calc(100vh - 91rpx - calc(44px + env(safe-area-inset-top)));
bottom: 0; // bottom: 0;
left: 0; // left: 0;
right: 0; // right: 0;
} }
.popup { .popup {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
} }
.pannels { .pannels {
width: 100%; 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