Commit e6851784 authored by lizhishu's avatar lizhishu

Merge branch 'develop' into uat

parents 995d2555 ebadde84
......@@ -89,9 +89,17 @@
"disableHostCheck": true,
"proxy": {
"/": {
"target": "https://dev-az-cloud-api.xiaopay.net",
"target": "https://fpdev.xiaopay.net",
"changeOrigin": true,
"secure": false
},
"/cgi-xpay": {
"target": "https://fpdev.xiaopay.net",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"/cgi-xpay": "/"
}
}
}
},
......@@ -115,4 +123,4 @@
"enable": true
}
}
}
}
\ No newline at end of file
......@@ -488,6 +488,116 @@
}
}
,{
"path" : "pages/ApplyConsumption/Home/Home",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "校园消费",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/CommonProblem/CommonProblem",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "常见问题",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/ConsumptIoninfo/ConsumptIoninfo",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费记录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/ConsumptionQuota/ConsumptionQuota",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费限额",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/OrderClearSuspicions/OrderClearSuspicions",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "待还款订单",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/pendingOrder/pendingOrder",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "待还款订单",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/consumptionDetail/consumptionDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/rechargeDetail/rechargeDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "充值详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/topupDetail/topupDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "充值明细",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/consumptionRecord/consumptionRecord",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费记录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/ApplyConsumption/pendingOrderDetail/pendingOrderDetail",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "消费详情",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
......
<template>
<view class="CommonProblem container">
<view class="questionbox">
<view class="questionList" v-for="(item,index) in questionList" :key="index"
@tap="jumpClick(item.jumurl,item.jumtype)">
<view class="line1">
<view class="lable">
<text>{{item.alable}}</text>
</view>
<view class="content">
{{(index+1)+'.'+item.question}}
</view>
</view>
<view class="line2">
<view class="lable">
<text>{{item.qlable}}</text>
</view>
<view class="content">
<text>{{item.answer}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "CommonProblem",
data() {
return {
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
"questionList": [{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "学生在校外刷脸,会扣家长的钱么? ",
"answer": "一脸通行服务仅限校园内使用。在不同的学校使用刷脸服务需要用户分别去开通。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "学生刷脸的照片或信息会泄露么? ",
"answer": "一脸通行集成了支付宝刷脸算法和支付能力,具有金融级准确性和安全性。人脸数据由支付宝管理,用户可以随时关闭刷脸服务。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "孩子可以正常刷脸取餐,为什么会产生欠费? ",
"answer": "校园刷脸采用“先取餐后扣费”的模式,账户余额不足就会产生欠费订单。请及时偿还,否则无法继续刷脸吃饭。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "为什么有订单刷脸时间和扣款时间不一致? ",
"answer": "为保障孩子及时就餐,只要账户未欠款,孩子刷脸成功后就可以先取餐,由于学校网络原因,扣款时间可能晚于刷脸时间。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "开通刷脸时,提示“相同名称的孩子已存在”怎么办?",
"answer": "平台安全合规限制,一个支付宝账号,不能绑定重名的孩子。出现该情况的原因是,您的支付宝账号使用其他证件号绑定了同名孩子,需要在刷脸服务管理中,关闭之前的开通记录,才能使用新的证件号进行开通刷脸服务。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "跳转到一脸通行小程序采脸时,为什么会提示:ISV操作学校水平受限?",
"answer": "您在开通时刷脸服务时,选择输入的学校未配置支付宝一脸通行服务,请检查选择的学校信息是否正确,或者联系学校工作人员修改学校配置信息。"
},
{
"jumurl": "",
"jumtype": "1",
"qlable": "",
"alable": "",
"question": "一脸通行刷脸支付支持信用卡和花呗支付吗?",
"answer": "因支付宝平台安全合规限制,不支持信用卡与花呗。"
}
]
};
},
onLoad: function() {
this.GetQuestionList()
},
methods: {
// 获取问题列表
async GetQuestionList() {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
const [err, data] = await uni.request({
url: this.ImgUrl2 + 'question.json',
})
console.warn(data)
if (Array.isArray(data.questionList)) {
this.questionList = data.questionList
}
uni.hideLoading()
} catch (error) {
console.warn(error)
uni.showToast({
icon: "error",
title: error.message
})
}
},
// 扩展跳转
jumpClick(jumurl, jumtype) {
if (!jumurl) {
return
}
switch (jumtype) {
case '1':
uni.navigateTo({
url: jumurl,
fail: () => {
uni.switchTab({
url: jumurl
})
}
})
break;
case '2':
uni.navigateTo({
url: '/pages_subpack/pages/ClsWeekReport/main?ExternalLink=' +
encodeURIComponent(
jumurl)
});
break;
case '3':
uni.navigateToMiniProgram({
appId: jumurl
});
break;
default:
break;
}
},
}
}
</script>
<style lang="scss">
page {
width: 100%;
background: #F3F3F3;
}
.CommonProblem {
padding-top: 24rpx;
padding-bottom: 100rpx;
.questionbox {
width: 702rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 auto;
.questionList {
padding-left: 32rpx;
padding-top: 39rpx;
border-bottom: 2rpx solid #E4E4E4;
padding-bottom: 40rpx;
.lable {
width: 44rpx;
height: 44rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 44rpx;
text-align: center;
}
.line1 {
display: flex;
// justify-content: space-between;
.lable {
background: #04B871;
}
.content {
// height: 40rpx;
width: 572rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 40rpx;
margin-right: 32rpx;
margin-left: 22rpx;
}
}
.line2 {
display: flex;
margin-top: 17rpx;
// justify-content: space-between;
.lable {
background: #F9BA0C;
}
.content {
width: 572rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 40rpx;
margin-right: 32rpx;
margin-left: 22rpx;
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="ConsumptIoninfo container">
<van-tabs color="#04B871" @click="changeAct" title-inactive-color="#969799" title-active-color="#323233">
<van-tab :title='item.name' :name="index" v-for="(item,index) in list" :key="index">
</van-tab>
</van-tabs>
<view class="" style="border-bottom: 1rpx solid #E5E5E5;height: 1rpx;margin-top: 1rpx;"></view>
<!-- 条件选择 -->
<view class="condition">
<view class="coll" style="margin-left: 57rpx;">
<picker mode="date" :value="date" fields="month" :start="startDate" :end="endDate"
@change="bindDateChange">
<view class="" style="display: flex;align-items: center;">
<text class="lable">{{query.datatime||date}}</text>
<image class="datachoice" :src="ImgUrl2+'down.png'" mode="aspectFit"></image>
</view>
</picker>
</view>
<view class="coll rightInfo" style="margin-left: 139rpx;">
<text class="money" style="font-size: 40rpx;">{{totalAmount}}</text>
</view>
</view>
<!-- 内容的改变 -->
<view class="content">
<view class="orderList" v-if="orderList.length>0">
<view class="orderitem" v-for="(item,index) in orderList" :key="index">
<view class="row rowlin1">
<view class="left name">
{{item.storeName}}
</view>
<view class="right money">
{{item.amount}}
</view>
</view>
<view class="row rowlin2">
<view class="left schoolname">
{{item.userName}}({{item.schoolName}})
</view>
<view class="right paystatus"
:style="{ 'color':['#FA6400'][item.status]||item.debt==1?'#FA6400':'' }">
<text v-if="item.debt">
<text v-if="item.status==3">支付宝垫资,已退款 </text>
<text v-else>支付宝垫资,待支付</text>
</text>
<text v-else>{{orderStatus[item.status]}}</text>
</view>
</view>
<view class="row rowlin3">
<text class="left paytime"> {{item.dealTime}}</text>
</view>
</view>
<!-- -->
<view class="listover">
— 已展示全部数据 —
</view>
</view>
<!-- 没有数据 -->
<view class="nodata" v-else>
<image :src="ImgUrl3+'xzf/noData-01.png'" mode="aspectFit"></image>
<view>无明细数据</view>
</view>
<view class="answeringQuestion" @click="goToPage(1)" v-if="act==3">
为什么有待支付订单?
</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 {
name: "ConsumptIoninfo",
data() {
const currentDate = this.getDate()
return {
ImgUrl3: this.$ImgUrl,
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
ImgUrl: this.$ImgUrl + '/static/weapp/',
// 默认激活样式是第一个
act: 0,
list: [{
value: -1,
name: '全部'
},
{
value: 1,
name: '已付款'
},
{
value: 3,
name: '已退款'
},
{
value: 0,
name: '待支付'
}
],
orderList: [],
totalAmount: 0,
orderStatus: {
"-1": "全部",
"0": "已欠费,待支付",
"1": "已付款",
"2": "已撤销",
"3": "已退款",
"4": "异常订单"
},
content: '',
userList: [],
userIndex: 0,
date: currentDate,
// 选择的数据
query: {
accountId: 0,
month: this.getDate({}),
status: -1
}
}
},
onShow() {
// 页面默认显示的是list列表中第一条数据
this.content = this.list[0]
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
onLoad: function(options) {
console.log(options);
console.log(this.query);
this.getOrderList()
this.userList = [{
"userName": "全部用户",
"id": 0
}].concat(this.userList)
},
methods: {
// 跳转页面
async goToPage(value) {
switch (value) {
case 1:
uni.navigateTo({
url: '../OrderClearSuspicions/OrderClearSuspicions'
})
break;
case 2:
break;
case 3:
break;
default:
break;
}
},
// nav
async changeAct(index, item) {
// 激活样式是当前点击的对应下标--list中对应id
this.act = index;
// 可以根据点击事件改变内容
this.content = this.list[index]
this.query.status = this.list[index].value
this.getOrderList()
},
// 获取订单列表
async getOrderList() {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
let respes = await requestPost('/cgi-xpay/app/h5/OrderList', this.query)
if (respes['code'] != 200) {
await Dialog({
title: '温馨提示',
message: respes['message'],
confirmButtonText: "知道了"
})
return
}
uni.hideLoading()
if (respes.data && respes.data.orderList) {
let tmp = []
for (let s of respes.data.orderList) {
s.amount = (s.amount / 100).toFixed(2)
tmp.push(s)
}
this.orderList = tmp
this.totalAmount = (respes.data.totalAmount / 100).toFixed(2)
// 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用户姓名
// }
// })
} else {
this.orderList = []
}
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
// 订单详情
async getOrderDetai(item) {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 1000);
})
uni.hideLoading()
uni.navigateTo({
url: `../consumptionRecord/consumptionRecord?devflowNo=${item.devflowNo}`
})
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
// 下拉选择器
async bindPickerChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = e.detail.value
this.query.accountId = this.userList[this.index].id
this.getOrderList()
},
bindDateChange: function(e) {
if (e.detail.value) {
let str = e.detail.value.split("-")
this.date = str[0] + "" + str[1] + ""
this.query.datatime = str[0] + "" + str[1] + ""
this.query.month = e.detail.value
this.getOrderList()
}
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year;
} else if (type === 'end') {
year = year;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
if (type instanceof Object) {
return `${year}-${month}`;
}
return `${year}${month}月`;
}
}
}
</script>
<style lang="scss">
page {
background-color: #FFFEFF;
height: 100%;
}
.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;
}
.orderList {
width: 725rpx;
float: right;
padding-bottom: 126rpx;
.orderitem {
height: 172rpx;
background-color: #FFFEFF;
font-family: PingFangSC-Regular, PingFang SC;
border-bottom: 1rpx solid #E5E5E5;
display: flex;
flex-direction: column;
.row {
display: flex;
align-items: center;
}
.rowlin1 {
margin-top: 23rpx;
justify-content: space-between;
padding-right: 24rpx;
}
.rowlin2 {
margin-top: 6rpx;
justify-content: space-between;
padding-right: 24rpx;
}
.rowlin3 {
margin-top: 2rpx;
}
.name {
height: 45rpx;
font-size: 32rpx;
font-weight: 400;
color: #333333;
line-height: 45rpx;
}
.money {
height: 45rpx;
font-size: 32rpx;
font-weight: 400;
color: #333333;
line-height: 45rpx;
}
.schoolname {
height: 37rpx;
font-size: 26rpx;
font-weight: 400;
color: #CCCCCC;
line-height: 37rpx;
}
.paystatus {
height: 37rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 37rpx;
color: #CCCCCC;
}
.paytime {
height: 37rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
line-height: 37rpx;
}
}
.listover {
// width: 252rpx;
height: 37rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
line-height: 37rpx;
text-align: center;
margin-top: 30rpx;
}
}
.nodata {
text-align: center;
margin-top: 169rpx;
image {
width: 500rpx;
height: 254rpx;
position: relative;
}
view {
height: 40rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 40rpx;
}
}
.nav {
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-around;
background-color: #FFFFFF;
font-size: 34rpx;
color: #969799;
}
.nav-list {
height: 100%;
line-height: 78rpx;
}
.nav-list .name {
color: #323233;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
.nav-list .line {
// margin-top: 10rpx;
width: 68rpx;
height: 8rpx;
background-color: #04B871;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
margin: 0 auto;
// #ifdef APP
height: 8rpx !important;
// #endif
border-radius: 4rpx
}
.condition {
height: 136rpx;
width: 100%;
line-height: 136rpx;
display: flex;
justify-content: space-around;
align-items: center;
border-bottom: 1rpx solid #E5E5E5;
.coll {
display: flex;
align-items: center;
image {
left: 12rpx;
}
.lable {
height: 42rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 42rpx;
cursor: pointer;
}
}
.rightInfo {
height: 56rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 40rpx;
.money::before {
content: '¥';
position: relative;
font-size: 28rpx;
padding-right: 12rpx;
}
}
image {
width: 17rpx;
height: 10rpx;
position: relative;
}
}
</style>
\ No newline at end of file
<template>
<view class="ConsumptionQuota container">
<!-- 自定义消费限额开关 -->
<view class="customSwitch" v-if="schoolConsumeLimit.parentConsumeLimit == 1">
<view class="itemInfo">
<view class="">
<text class="name">自定义消费限额</text>
</view>
<view class="value">
<switch color="#04B871" :checked="parentConsumeLimit.switch" @change="switchChange"
v-model="parentConsumeLimit.switch" />
</view>
</view>
</view>
<!-- 消费限额设置 -->
<view class="ConsumptionSetting">
<!-- 默认消费限额 -->
<view class="SchoolSetting">
<view class="lable">
<text>{{parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1 ? '自定义' : '默认'}}消费限额</text>
</view>
<view class="itembox">
<view class="itemInfo">
<view class="">
<text class="name">单笔限额</text>
</view>
<view class="value"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<input type="digit" @blur="handleInput_0" v-model="parentConsumeLimit.singleLimit"
placeholder="请输入金额" placeholder-class="placeholders" />
<view></view>
</view>
<view class="value" v-else>
<text>{{schoolConsumeLimit.singleLimit}}</text>
</view>
</view>
<view style="height: 1rpx;background: #EEEEEE;">
</view>
<view class="itemInfo">
<view class="">
<text class="name">单日限额</text>
</view>
<view class="value"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<input type="digit" @blur="handleInput_1" v-model="parentConsumeLimit.dailyLimit"
placeholder="请输入金额" placeholder-class="placeholders" />
<view></view>
</view>
<view class="value" v-else>
<text>{{schoolConsumeLimit.dailyLimit}}</text>
</view>
</view>
<view style="height: 1rpx;background: #EEEEEE;">
</view>
</view>
</view>
<view class="senceTip" v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<image class="sumTip" :src="ImgUrl2+'sumTip.png'" mode="aspectFit"></image>所有场景实际消费之和不高于单日限额
</view>
<!-- 默认场景限额 -->
<view class="ParentSetting">
<view class="lable">
<text>{{parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1 ? '自定义' : '默认'}}场景限额</text>
<text class="grey"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1 ">每个场景限额不高于{{parentConsumeLimit.dailyLimit}}</text>
</view>
<view class="Settings">
<view class="itembox">
<view class="itemInfo">
<text class="cantTip"
v-if="parentConsumeLimit.switch && canteenTip && schoolConsumeLimit.parentConsumeLimit == 1">限额0元,将无法在食堂消费</text>
<view style="position: relative;">
<text class="name">食堂</text>
</view>
<view class="value" style="display: flex;align-items: center;"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<input type="digit" @blur="handleInput"
v-model="parentConsumeLimit.canteenConsumptionLimit" placeholder="请输入0 ~150之间整数"
placeholder-class="placeholders" />
<view></view>
</view>
<view class="value" style="display: flex;align-items: center;" v-else>
<view>{{schoolConsumeLimit.canteenConsumptionLimit}}</view>
</view>
</view>
<view style="height: 1rpx;background: #EEEEEE;">
</view>
<view class="itemInfo">
<text class="cantTip"
v-if="parentConsumeLimit.switch && superTip && schoolConsumeLimit.parentConsumeLimit == 1">限额0元,将无法在超市消费</text>
<view class="">
<text class="name">超市</text>
</view>
<view class="value" style="display: flex;align-items: center;"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<input type="digit" @blur="handleInput2"
v-model="parentConsumeLimit.supermarketConsumptionLimit" placeholder="请输入0 ~150之间整数"
placeholder-class="placeholders" />
<view></view>
</view>
<view class="value" style="display: flex;align-items: center;" v-else>
<view>{{schoolConsumeLimit.supermarketConsumptionLimit}}</view>
</view>
</view>
<view style="height: 1rpx;background: #EEEEEE;">
</view>
<view class="itemInfo">
<text class="cantTip"
v-if="parentConsumeLimit.switch && otherTip && schoolConsumeLimit.parentConsumeLimit == 1">限额0元,将无法在其他场景消费</text>
<view class="">
<text class="name">其他</text>
</view>
<view class="value" style="display: flex;align-items: center;"
v-if="parentConsumeLimit.switch && schoolConsumeLimit.parentConsumeLimit == 1">
<input type="digit" @blur="handleInput3"
v-model="parentConsumeLimit.otherConsumptionLimit" placeholder="请输入0 ~150之间整数"
placeholder-class="placeholders" />
<view></view>
</view>
<view class="value" style="display: flex;align-items: center;" v-else>
<view>{{schoolConsumeLimit.otherConsumptionLimit}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 提示文字 -->
<view class="tisptxt">
<view class="" v-if="schoolConsumeLimit.parentConsumeLimit && schoolConsumeLimit.parentConsumeLimit == 1">
<text>· 用户消费限制优先级高于学校消费限制</text>
</view>
<view class="">
<text>· 消费限额仅在学校消费机联网状态下生效</text>
</view>
</view>
<!-- 消费会员限制弹框 -->
<van-dialog v-model="contractMenber" :show-confirm-button="false">
<view class="modalDlgBox">
<view class="modalDlgHeader">
<text>温馨提示</text>
</view>
<view class="contentt">
<view class="line1">
<text>您还未开通消费会员,</text>
</view>
<view class="line2">
成为会员即可开启消费限额,自定义设置单日限额与场景限额
</view>
</view>
<view class="btngroup">
<button @tap="BtnEvent(1)">取消</button>
<button @tap="BtnEvent(2)">马上开通</button>
</view>
</view>
</van-dialog>
<!-- 设置保存按钮 -->
<view class="savebtn" @tap="ConsumptionQuota" v-if="schoolConsumeLimit.parentConsumeLimit == 1">
<text>保存</text>
</view>
</view>
</template>
<script>
import {
Dialog
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default {
components: {},
name: "ConsumptionQuota",
data() {
return {
phone: '***********',
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
ImgUrl: this.$ImgUrl + '/static/weapp/',
usertype: ['', '学生', '老师'],
// 消费限额选择胡用户
ConsumptionQuotaUser: {
userName: '李书记',
usertype: 1
},
// 自定义限额设置
parentConsumeLimit: {
"dailyCntLimit": 0, //单日累计次数限制
"dailyLimit": 0, //单日累计消费上限 单位分
"singleLimit": 0, //单笔消费上限 单位分
"switch": true, //限额开关 1开启 0关闭
"supermarketConsumptionLimit": "", // 超市
"canteenConsumptionLimit": "", // 食堂
"otherConsumptionLimit": "", // 其他
},
// 默认限额设置
schoolConsumeLimit: {
// 20230706
'parentConsumeLimit': 1,
"dailyLimit": 0, //单日累计消费上限 单位分
"singleLimit": 0, //单笔消费上限 单位分
"dailyCntLimit": 0, //单日累计次数限制
"supermarketConsumptionLimit": "", // 超市
"canteenConsumptionLimit": "", // 食堂
"otherConsumptionLimit": "", // 其他
},
canteenTip: false,
otherTip: false,
superTip: false,
// 消费会员弹框
contractMenber: false,
};
},
onLoad: function() {
this.getConsumeLimitData()
},
methods: {
// 弹框点击事情
async BtnEvent(type) {
if (type == 1) {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
if (type == 2) {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index'
})
}
this.contractMenber = false
},
// 查询消费会员权益项
async QueryProductContractItem(serviceItemCode = '1008') {
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', {
accountId: sessionStorage.getItem('accountId') * 1,
serviceItemCode
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
if (data.data['result'] == "fail") {
this.contractMenber = true
throw ('您还未开通消费会员,')
}
},
handleInput_0(e) {
let price = e.detail.value;
let that = this;
price = price.replace(/[^\d.]/g, "");
price = price.replace(/\.{2,}/g, ".");
price = price.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
price = price.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
if (price.indexOf(".") < 0 && price != "") {
price = parseFloat(price);
}
that.parentConsumeLimit.singleLimit = price
console.warn("handleInput", price)
return {
value: price,
}
},
handleInput_1(e) {
let price = e.detail.value;
let that = this;
price = price.replace(/[^\d.]/g, "");
price = price.replace(/\.{2,}/g, ".");
price = price.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
price = price.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
if (price.indexOf(".") < 0 && price != "") {
price = parseFloat(price);
}
that.parentConsumeLimit.dailyLimit = price
console.warn("handleInput", price)
return {
value: price,
}
},
handleInput(e) {
let price = e.detail.value;
let that = this;
if (price == 0 && price != "") {
that.canteenTip = true;
} else {
that.canteenTip = false;
}
price = price.replace(/[^\d.]/g, "");
price = price.replace(/\.{2,}/g, ".");
price = price.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
price = price.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
if (price.indexOf(".") < 0 && price != "") {
price = parseFloat(price);
}
price = price > 150 ? 150 : price;
that.parentConsumeLimit.canteenConsumptionLimit = price
console.warn("handleInput", price)
return {
value: price,
}
},
handleInput2(e) {
let price = e.detail.value;
let that = this;
if (price == 0 && price != "") {
that.superTip = true;
} else {
that.superTip = false;
}
price = price.replace(/[^\d.]/g, "");
price = price.replace(/\.{2,}/g, ".");
price = price.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
price = price.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
if (price.indexOf(".") < 0 && price != "") {
price = parseFloat(price);
}
price = price > 150 ? 150 : price;
console.warn("handleInput2", price)
that.parentConsumeLimit.supermarketConsumptionLimit = price
return {
value: price,
}
},
handleInput3(e) {
let price = e.detail.value;
let that = this;
// price = price.replace(/[^\d.]/g, "");
// price = price.replace(/\.{2,}/g, ".");
// price = price.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
// price = price.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
// if (price.indexOf(".") < 0 && price != "") {
// price = parseFloat(price);
// }
price == 0 && price != "" ? (price = 0, that.otherTip = true) : ("", that.otherTip = false);
price = price > 150 ? 150 : price;
price = price != 0 ? price.replace(/[^\d]/g, '') : "0"
that.parentConsumeLimit.otherConsumptionLimit = price
return {
value: price,
}
},
async switchChange(e) {
console.warn("开启限额", e.detail.value)
await this.QueryProductContractItem()
this.parentConsumeLimit.switch = e.detail.value
if (this.parentConsumeLimit.singleLimit == 0) {
this.parentConsumeLimit.singleLimit = '50.00';
}
if (this.parentConsumeLimit.dailyLimit == 0) {
this.parentConsumeLimit.dailyLimit = '200.00';
}
if (this.parentConsumeLimit.dailyCntLimit == 0) {
this.parentConsumeLimit.dailyCntLimit = 30;
}
},
// 消费限额页数据
async getConsumeLimitData() {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 10);
})
const respes = await requestPost('/cgi-xpay/app/h5/ConsumeLimitData', {
accountId: sessionStorage.getItem('accountId') * 1
})
uni.hideLoading()
if (respes['code'] != 200) {
await Dialog({
title: '温馨提示',
message: respes['message'],
confirmButtonText: "知道了"
})
return
}
// 家长限额设置
this.parentConsumeLimit = respes.data.parentConsumeLimit || {
"dailyCntLimit": 0,
"dailyLimit": 0,
"singleLimit": 0,
"switch": false,
"supermarketConsumptionLimit": "", // 超市
"canteenConsumptionLimit": "", // 食堂
"otherConsumptionLimit": "", // 其他
};
this.parentConsumeLimit.dailyLimit = (this.parentConsumeLimit.dailyLimit / 100).toFixed(2);
this.parentConsumeLimit.singleLimit = (this.parentConsumeLimit.singleLimit / 100).toFixed(2);
this.parentConsumeLimit.switch = this.parentConsumeLimit.switch == 1 ? true : false;
this.parentConsumeLimit.supermarketConsumptionLimit = this.parentConsumeLimit
.supermarketConsumptionLimit > 0 ? (this.parentConsumeLimit.supermarketConsumptionLimit / 100)
.toFixed(2) : "--";
this.parentConsumeLimit.canteenConsumptionLimit = this.parentConsumeLimit.canteenConsumptionLimit >
0 ? (this.parentConsumeLimit.canteenConsumptionLimit / 100).toFixed(2) : "--";
this.parentConsumeLimit.otherConsumptionLimit = this.parentConsumeLimit.otherConsumptionLimit > 0 ?
(this.parentConsumeLimit.otherConsumptionLimit / 100).toFixed(2) : "--";
// 默认限额设置
this.schoolConsumeLimit = respes.data.schoolConsumeLimit || {
"dailyLimit": 0,
"singleLimit": 0,
"dailyCntLimit": 0,
"supermarketConsumptionLimit": "", // 超市
"canteenConsumptionLimit": "", // 食堂
"otherConsumptionLimit": "", // 其他
"parentConsumeLimit": "" // 自定义消费限额
}
this.schoolConsumeLimit.dailyLimit = (this.schoolConsumeLimit.dailyLimit / 100).toFixed(2);
this.schoolConsumeLimit.singleLimit = (this.schoolConsumeLimit.singleLimit / 100).toFixed(2);
this.schoolConsumeLimit.supermarketConsumptionLimit = this.schoolConsumeLimit
.supermarketConsumptionLimit >
0 ? (this.schoolConsumeLimit.supermarketConsumptionLimit / 100).toFixed(2) : "--";
this.schoolConsumeLimit.canteenConsumptionLimit = this.schoolConsumeLimit
.canteenConsumptionLimit >
0 ? (this.schoolConsumeLimit.canteenConsumptionLimit / 100).toFixed(2) : "--";
this.schoolConsumeLimit.otherConsumptionLimit = this.schoolConsumeLimit
.otherConsumptionLimit >
0 ? (this.schoolConsumeLimit.otherConsumptionLimit / 100).toFixed(2) : "--";
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
// 设置保存按钮
async ConsumptionQuota() {
try {
if (this.parentConsumeLimit.singleLimit === 0) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单笔消费上限不能为0"
})
return
}
if (this.parentConsumeLimit.singleLimit === "") {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单笔消费上限不能为空"
})
return
}
if (this.parentConsumeLimit.singleLimit > 100) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单笔上限不能高于100元"
})
return
}
if (this.parentConsumeLimit.dailyCntLimit === 0) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日累计次数限制不能为0"
})
return
}
if (this.parentConsumeLimit.dailyCntLimit === "") {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日累计次数限制不能为空"
})
return
}
if (this.parentConsumeLimit.dailyLimit === 0) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日累计消费上限不能为0"
})
return
}
if (this.parentConsumeLimit.dailyLimit === "") {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日累计消费上限不能为空"
})
return
}
if (this.parentConsumeLimit.dailyLimit > 500) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日上限不能高于500元"
})
return
}
let sumTip = Number(this.parentConsumeLimit.canteenConsumptionLimit) + Number(this
.parentConsumeLimit.otherConsumptionLimit) + Number(this.parentConsumeLimit
.supermarketConsumptionLimit)
if (this.parentConsumeLimit.dailyLimit < sumTip) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "所有场景限额之和不高于单日限额"
})
return
}
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 10);
})
let switchs = this.parentConsumeLimit.switch ? 1 : 0;
let dailyLimit = parseInt(this.parentConsumeLimit.dailyLimit * 100);
let singleLimit = parseInt(this.parentConsumeLimit.singleLimit * 100);
let canteenConsumptionLimit = this.parentConsumeLimit.canteenConsumptionLimit > 0 ? (parseInt(this
.parentConsumeLimit.canteenConsumptionLimit * 100) + "") : "";
let otherConsumptionLimit = this.parentConsumeLimit.otherConsumptionLimit > 0 ? (parseInt(this
.parentConsumeLimit.otherConsumptionLimit * 100) + "") : "";
let supermarketConsumptionLimit = this.parentConsumeLimit.supermarketConsumptionLimit > 0 ? (
parseInt(this.parentConsumeLimit.supermarketConsumptionLimit *
100) + "") : "";
let dailyCntLimit = parseInt(this.parentConsumeLimit.dailyCntLimit);
if (switchs == 1) {
if (dailyLimit == 0 || singleLimit == 0) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "消费上限设置不能为0"
})
uni.hideLoading()
return
}
if (dailyLimit < singleLimit) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: "单日累计需要大于单笔限额"
})
uni.hideLoading()
return
}
}
let params = {
switch: switchs,
dailyLimit: dailyLimit,
singleLimit: singleLimit,
dailyCntLimit: dailyCntLimit,
canteenConsumptionLimit: canteenConsumptionLimit,
otherConsumptionLimit: otherConsumptionLimit,
supermarketConsumptionLimit: supermarketConsumptionLimit,
};
// 设置消费限额
const respes = await requestPost('/cgi-xpay/app/h5/SetParentConsumeLimit', Object.assign({
accountId: sessionStorage.getItem('accountId') * 1, // 消费用户账户id
}, params))
if (respes.code != 200) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: respes.message
})
return
}
uni.hideLoading()
uni.showToast({
icon: "success",
title: "保存成功!"
})
setTimeout(() => {
uni.navigateBack()
}, 1000)
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
},
}
}
</script>
<style lang="scss">
page {
width: 100%;
background: #F3F3F3;
}
.modalDlgBox {
width: 622rpx;
height: 467rpx;
top: 480rpx;
background-color: #FFFFFF;
border-radius: 26rpx;
margin: 0 auto;
.modalDlgHeader {
width: 100%;
height: 124rpx;
background: linear-gradient(270deg, #FFF9E7 0%, #FFFAEB 100%);
border-radius: 20rpx 20rpx 0rpx 0rpx;
// filter: blur(21rpx);
line-height: 124rpx;
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #512C19;
text-align: center;
background-image: url(https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/user/mengban.png);
background-size: cover;
background-repeat: no-repeat;
}
.contentt {
width: 512rpx;
margin: 0 auto;
text-align: center;
margin-top: 28rpx;
line-height: 45rpx;
.line1 {
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.line2 {
margin-top: 14rpx;
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
}
.btngroup {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 40rpx;
justify-content: space-around;
button {
width: 254rpx;
height: 88rpx;
border-radius: 12rpx;
line-height: 88rpx;
text-align: center;
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
button:nth-child(1) {
color: rgba(0, 0, 0, 0.85);
background-color: #EBEBEB;
}
button:nth-child(2) {
color: #512C19;
background: linear-gradient(270deg, #EEC16F 0%, #FADCA9 100%);
}
}
}
.ConsumptionQuota {
padding-top: 23rpx;
padding-bottom: 200rpx;
.customSwitch {
display: flex;
padding: 0 24rpx;
height: 101rpx;
margin: 24rpx 0;
.itemInfo {
width: 100%;
padding: 0 32rpx 0 24rpx;
background-color: white;
border: 1rpx solid white;
display: flex;
justify-content: space-between;
border-radius: 16rpx;
view {
align-self: center;
}
}
}
.senceTip {
margin-top: 24rpx;
font-size: 28rpx;
color: #FA6400;
height: 40rpx;
line-height: 40rpx;
padding: 0 48rpx;
display: flex;
.sumTip {
width: 28rpx;
height: 28rpx;
align-self: center;
margin-right: 6rpx;
}
}
.ConsumptionSetting {
margin-top: 16rpx;
.SchoolSetting,
.ParentSetting {
width: 702rpx;
max-height: 503rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 auto;
.lable {
height: 101rpx;
padding-left: 24rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 101rpx;
display: flex;
justify-content: space-between;
.grey {
color: rgba(0, 0, 0, 0.5);
font-size: 28rpx;
padding-right: 32rpx;
}
}
.name {
height: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 28rpx;
}
}
.SchoolSetting {
.itembox {
width: 654rpx;
margin: 0 auto;
.itemInfo {
display: flex;
height: 100rpx;
line-height: 100rpx;
align-items: center;
justify-content: space-between;
}
}
.value {
height: 38rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 38rpx;
display: flex;
input {
text-align: right;
align-self: center;
}
}
}
.placeholders {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
}
.ParentSetting {
margin-top: 24rpx;
.value {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
input {
height: 100%;
text-align: right;
padding-right: 16rpx;
width: 320rpx;
}
}
.cantTip {
position: absolute;
top: 0;
left: 104rpx;
line-height: 100rpx;
color: #E02020;
font-size: 24rpx;
z-index: 1;
}
.itembox {
width: 654rpx;
margin: 0 auto;
.itemInfo {
display: flex;
height: 100rpx;
line-height: 100rpx;
align-items: center;
justify-content: space-between;
position: relative;
}
}
}
}
.tisptxt {
height: 33rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ABABAB;
line-height: 33rpx;
margin-left: 48rpx;
margin-top: 24rpx;
}
.savebtn {
width: 686rpx;
height: 90rpx;
border-radius: 45rpx;
background: #04B871;
margin: 0 auto;
line-height: 90rpx;
text-align: center;
font-size: 36rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
position: fixed;
bottom: 52rpx;
left: 0;
right: 0;
}
}
.userInfo {
width: 702rpx;
height: 247rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin: 0 auto;
.lablet {
height: 101rpx;
// background: #FFFFFF;
border-bottom: 1rpx solid #F6F6F6;
line-height: 101rpx;
padding-left: 24rpx;
}
.ItemInfoT {
display: flex;
height: 146rpx;
padding-left: 24rpx;
padding-top: 34rpx;
.box2 {
margin-left: 14rpx;
}
.username {
height: 36rpx;
font-size: 36rpx;
font-weight: 500;
color: #333333;
line-height: 36rpx;
}
.usertype {
height: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 28rpx;
margin-left: 16rpx;
}
.schoolname {
margin-top: 12rpx;
height: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #ABABAB;
line-height: 28rpx;
}
}
.student {
width: 72rpx;
height: 72rpx;
position: relative;
}
}
</style>
\ No newline at end of file
<template>
<view class="CampusConsumption">
<!-- 头部卡片 -->
<view class="cardInfo"
:style="'background-image: url('+this.$ImgUrl + (HomeDataInfo['vipStatus']==1? 'applyCons/bgm.png':'applyCons/bgm1.png')+')'">
<view class="userInfo">
<view class="left">
<view class="useravatar" :style="'background-image: url('+this.$ImgUrl + 'applyCons/icon.png'+')'">
</view>
<view class="name"
:style="HomeDataInfo['vipStatus']==1 ?'color: #512C19;':'color: rgba(0,0,0,0.85);' ">
{{HomeDataInfo['userName']||'安小智'}}
</view>
</view>
<view class="right">
<image v-if="HomeDataInfo['vipStatus']==1" :src="this.$ImgUrl + 'applyCons/menber.png'"
mode="aspectFit"></image>
<view class="lable" v-if="HomeDataInfo['vipStatus']==1">
您已开通消费会员
</view>
<view class="lable" v-else :style="HomeDataInfo['vipStatus']==1 ?'':'color: rgba(0,0,0,0.85);' ">
您尚未开通消费会员
</view>
</view>
</view>
<!-- 消费数据 -->
<view class="cdatabox">
<view class="cdatal">
<span class="integer">{{HomeDataInfo['schoolConsumption']['dailySpend_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['dailySpend_decimal']}}</span>
<view class="lable">
今日消费(元)
</view>
</view>
<view class="cdatar">
<span class="integer">{{HomeDataInfo['schoolConsumption']['monthlySpend_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['monthlySpend_decimal']}}</span>
<view class="lable">
本月消费(元)
</view>
</view>
</view>
<!-- -->
<view class="cdatabox2">
<view class="cdatal"
:style="HomeDataInfo['schoolConsumption']['pendingcharge_decimal']>0?'color: red;':''"
@click="goToPage(1)">
<span class="integer">{{HomeDataInfo['schoolConsumption']['pendingcharge_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['pendingcharge_decimal']}}</span>
<view class="lable">
<span>待还款订单</span>
<image class="rigth" :src="this.$ImgUrl + 'applyCons/rigth.png'" mode="aspectFit"></image>
</view>
</view>
<view class="cdatar" @click="goToPage(2)">
<span class="integer">{{HomeDataInfo['schoolConsumption']['amount_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['amount_decimal']}}</span>
<view class="lable">
<span>钱包余额</span>
<image class="rigth" :src="this.$ImgUrl + 'applyCons/rigth.png'" mode="aspectFit"></image>
</view>
</view>
<view class="cdatar" @click="goToPage(3)">
<span class="integer">{{HomeDataInfo['schoolConsumption']['subsidyBalance_integer']}}</span>
<span class="decimal">.{{HomeDataInfo['schoolConsumption']['subsidyBalance_decimal']}}</span>
<view class="lable">
<span>补助金</span>
<image style="visibility: hidden;" class="rigth" :src="this.$ImgUrl + 'applyCons/rigth.png'"
mode="aspectFit"></image>
</view>
</view>
</view>
</view>
<!-- 功能菜单 -->
<view class="menuList">
<view class="menuitem" v-for="(item,index) in menuList" :key="index" @click="menuClick(item)">
<view class="">
<view class="title">{{item.title||''}}</view>
<view class="sketch">{{item.sketch||''}}</view>
</view>
<view class="icon">
<image :src="item.icon" mode="aspectFit"></image>
</view>
</view>
</view>
<!-- 会员尊享权益 -->
<view class="menberImg">
<image :src="this.$ImgUrl + 'applyCons/menberImg.png'" mode="aspectFit"></image>
<view class="tomenber" @tap="openAzMenber"></view>
</view>
</view>
</template>
<script>
import {
Dialog
} from 'vant';
import config from '../common/config.js'
// console.warn(config['ServiceEnum'])
import {
requestGet,
requestPost
} from '../common/request.js'
export default {
name: "CampusConsumption",
data() {
return {
ImgUrl: this.$ImgUrl,
menuList: Array(4).fill(1).map((v, index) => {
return {
path: ['../ConsumptIoninfo/ConsumptIoninfo', '../ConsumptionQuota/ConsumptionQuota',
'/pages/ConsumptionSystem/AbnormalConsumption/AbnormalConsumption?userId=4145549&schoolId=60804',
'../CommonProblem/CommonProblem'
][index],
title: ['消费记录', '消费限额', '消费异常', '常见问题'][index],
sketch: ['消费记录 笔笔可查', '设置额度 管控消费', '消费异常 每日提醒', '使用疑问 一一解答'][index],
icon: this.$ImgUrl + `applyCons/menu${index+1}.png`
}
}),
HomeDataInfo: {
// 账户id
"accountId": 0,
"schoolConsumption": {
// 钱包余额 单位分
"amount": 0,
// 今日消费 单位分
"dailySpend": 0,
// 本月消费 单位分
"monthlySpend": 0,
// 欠款金额 单位分
"pendingcharge": 0,
// 补助余额 单位分
"subsidyBalance": 0
},
// 用户姓名
"userName": "",
// 刷脸消费会员剩余天数
"vipDaysRemaining": 0,
// 刷脸消费会员到期时间
"vipExpiredDt": "",
// 刷脸消费会员开通状态 1已开通并生效 2未开通 3已过期 4未生效
"vipStatus": 1
}
};
},
onLoad(options) {
if (!options['token']) {
Dialog({
title: '系统提示',
message: 'token为空!',
confirmButtonText: "知道了"
}).then(res => {
window.close()
})
return;
}
this.UserLogin(options['token'])
},
methods: {
//登录获取用户信息
async UserLogin(token) {
let data = await requestPost('/cgi-xpay/app/Login', {
grantType: 'GT_azCloud_h5',
code: token,
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
uni.setStorageSync('token', data.data['token'])
this.HomePageData()
},
// 查询消费会员权益项
async QueryProductContractItem(serviceItemCode = '1008') {
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', {
accountId: this.HomeDataInfo['accountId'],
serviceItemCode
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
return data.data['result']
},
// 获取首页数据
async HomePageData() {
const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
const schoolConsumption = data.data['schoolConsumption']
for (let s in schoolConsumption) {
let integer = 0,
decimal = 0
const value = (schoolConsumption[s] / 100).toFixed(2)
integer = value.split(".")[0]
decimal = value.split(".")[1]
schoolConsumption[`${s}_integer`] = integer
schoolConsumption[`${s}_decimal`] = decimal
}
data.data['schoolConsumption'] = schoolConsumption
this.HomeDataInfo = data.data
sessionStorage.setItem('accountId', this.HomeDataInfo['accountId'])
// 查询消费会员权益项
this.QueryProductContractItem()
},
// 跳转页面
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() {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index'
})
},
// 菜单跳转
async menuClick(item) {
console.warn(item)
if (!item.path) {
return
}
uni.switchTab({
url: item.path,
fail: () => {
uni.navigateTo({
url: item.path
})
}
})
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
background: #F1F1F3;
}
.CampusConsumption {
.cardInfo {
width: 686rpx;
height: 435rpx;
margin: 0 auto;
margin-top: 24rpx;
background-size: 100% 100%;
background-repeat: no-repeat;
position: relative;
.cdatabox2 {
display: flex;
justify-content: space-around;
margin-top: 57rpx;
.cdatal,
.cdatar {
font-family: DINAlternate-Bold, DINAlternate;
color: rgba(0, 0, 0, 0.85);
.lable {
display: flex;
align-items: center;
height: 37rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.4);
line-height: 37rpx;
.rigth {
position: relative;
height: 24rpx;
width: 24rpx;
left: 5rpx;
}
}
}
.integer {
display: inline-block;
font-size: 36rpx;
}
.integer::before {
content: '\00A5';
font-size: 28rpx;
font-family: DIN Alternate Bold;
font-weight: bold;
}
.decimal {
font-size: 30rpx;
}
}
.cdatabox {
display: flex;
margin-top: 20rpx;
.cdatal,
.cdatar {
font-family: DINAlternate-Bold, DINAlternate;
color: rgba(0, 0, 0, 0.85);
.lable {
height: 40rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.4);
line-height: 40rpx;
}
}
.cdatal {
margin-left: 53rpx;
}
.cdatar {
margin-left: 219rpx;
}
.integer {
font-size: 60rpx;
}
.decimal {
font-size: 30rpx;
}
}
.userInfo {
height: 110rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
padding-left: 30rpx;
.name {
margin-left: 14rpx;
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
.useravatar {
height: 52rpx;
width: 52rpx;
border-radius: 50%;
background-color: white;
background-size: 100% 100%;
background-repeat: no-repeat;
border: 4rpx solid white;
}
image {
position: relative;
height: 100%;
width: 100%;
}
}
.right {
padding-right: 24rpx;
display: flex;
align-items: center;
.lable {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(81, 44, 25, 0.7);
}
image {
position: relative;
height: 36rpx;
width: 36rpx;
left: -9rpx;
}
}
}
}
.menberImg {
height: 516rpx;
width: 686rpx;
margin: 0 auto;
margin-top: 32rpx;
position: relative;
image {
position: relative;
height: 100%;
width: 100%;
}
.tomenber {
width: 600rpx;
height: 90rpx;
background: linear-gradient(270deg, #FDC359 0%, #FADDA3 100%);
border-radius: 12rpx;
position: absolute;
margin: 0 auto;
left: 0;
right: 0;
bottom: 35rpx;
opacity: 0;
}
}
.menuList {
width: 686rpx;
background: #F1F1F3;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
margin: 0 auto;
.menuitem {
width: 331rpx;
height: 136rpx;
background: #FFFFFF;
border-radius: 16rpx;
margin-top: 24rpx;
display: flex;
align-items: center;
justify-content: space-evenly;
.title {
height: 42rpx;
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 42rpx;
}
.sketch {
height: 28rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.3);
line-height: 28rpx;
}
image {
position: relative;
height: 80rpx;
width: 80rpx;
}
}
}
}
</style>
\ No newline at end of file
<template>
<view class="OrderClearSuspicions">
<view class="problem">
<span>为什么有待支付订单?</span>
</view>
<view class="problemdesc">
校园刷脸消费采用“先取餐后扣费”模式。孩子刷脸后验证是本人后先取餐,平台再进行扣费,账户余额不足就会产生欠费订单。请及时支付,否则后续无法继续刷脸吃饭。
</view>
<view class="step_guide">
<image :src="this.$ImgUrl + 'applyCons/step_guide.png'" mode="aspectFit"></image>
</view>
</view>
</template>
<script>
export default {
name: "OrderClearSuspicions",
data() {
return {
ImgUrl: this.$ImgUrl,
};
}
}
</script>
<style lang="scss" scoped>
page {
width: 100%;
background: #E4F3EE;
}
.OrderClearSuspicions {
.step_guide {
width: 686rpx;
height: 1484rpx;
margin: 0 auto;
margin-top: 40rpx;
image {
position: relative;
height: 100%;
width: 100%;
}
}
.problemdesc {
width: 677rpx;
height: 111rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.5);
line-height: 37rpx;
margin: 0 auto;
margin-top: 16rpx;
}
.problem {
text-align: center;
height: 54rpx;
font-size: 36rpx;
font-family: SourceHanSansSC-Bold, SourceHanSansSC;
font-weight: bold;
color: rgba(0, 0, 0, 0.85);
line-height: 54rpx;
padding-top: 49rpx;
}
}
</style>
\ No newline at end of file
H5消费应用模块
\ No newline at end of file
/**
* @name
*全局配置文件
*
*/
let baseURL = "https://" + window.location.host;
let env = 'dev'
if (window.location.protocol != "https:") {
env = "dev";
baseURL = 'https://fpdev.xiaopay.net'
}
if (window.location.host == 'fpdev.xiaopay.net') {
env = "dev";
baseURL = 'https://fpdev.xiaopay.net'
}
if (window.location.host == 'uat.xiaopay.net') {
env = "test";
baseURL = 'https://uat.xiaopay.net'
}
if (window.location.host == 'pay.xiaopay.net') {
env = "product";
baseURL = 'https://pay.xiaopay.net'
}
const ServiceEnum = {
Auth1: '1001', //'消费方式-刷脸模式',
Auth2: '1002', //'消费周报/月报',
Auth3: '1003', //'消费方式-刷卡模式',
Auth4: '1004', //'扣款方式-微信代扣',
Auth5: '1005', //'扣款方式-钱包代扣',
Auth6: '1006', //'在线充值',
Auth7: '1007', //'微信垫资',
Auth8: '1008', //'家长自定义限额',
Auth9: '1009', //'微信公众号推送',
Auth10: '1010', //'消费记录明细',
Auth11: '1011', //'每日异常小报告'
}
const json = {
env,
baseURL,
ServiceEnum
}
export default json;
\ No newline at end of file
/**
*
* 请求封装
*
*/
import config from './config.js'
const HEADER = {
'content-type': 'application/json'
}; //头部
const baseURL = ''
const request = options => {
let headerObj = HEADER;
const token = uni.getStorageSync('token');
if (token) {
headerObj = {
'Authorization': token,
...HEADER
}
}
if (options.data.header) {
headerObj = Object.assign(headerObj, options.data.header || {})
}
return new Promise((resolve, reject) => {
uni.request({
url: baseURL + options.url,
method: options.method || 'GET',
header: headerObj,
data: options.data || {},
dataType: 'json',
success: res => {
if (res.statusCode != 200) {
reject(res);
return
}
resolve(res.data || false);
},
fail: err => {
reject(err);
}
});
});
};
export const requestGet = (url, data) => {
return request({
method: 'GET',
url,
data
})
}
export const requestPost = (url, data) => {
return request({
method: 'POST',
url,
data
})
}
\ No newline at end of file
<template>
<view class="consumptionDetail">
<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">东门食堂-早餐</view>
<view class="amount">-24.50</view>
<view class="status">待支付</view>
<view class="rowItem">
<view class="label">学生姓名</view>
<view class="value">安小智</view>
</view>
<view class="rowItem">
<view class="label">年级班级</view>
<view class="value">三年级/101班</view>
</view>
<view class="rowItem">
<view class="label">手续费</view>
<view class="value"> 0.02</view>
</view>
<view class="rowItem">
<view class="label">消费设备</view>
<view class="value">消费机-1</view>
</view>
<view class="rowItem">
<view class="label">消费场景</view>
<view class="value">食堂</view>
</view>
<view class="rowItem">
<view class="label">消费时间</view>
<view class="value">2022-06-11 07:00.00</view>
</view>
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">4202000000000000000000</view>
</view>
<view class="btn">
<view class="button">对此订单有疑问?</view>
</view>
</view>
<view class="bottomBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgBottom.png'+')'"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
ImgUrl: this.$ImgUrl,
}
},
methods: {
}
}
</script>
<style lang="scss">
.consumptionDetail {
width: 100%;
height: 100%;
min-height: 100vh;
background: #F1F1F3;
.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: 46rpx;
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;
line-height: 90rpx;
text-align: center;
}
.status {
width: 100%;
height: 45rpx;
font-size: 32rpx;
color: #FA6400;
line-height: 45rpx;
text-align: center;
margin-bottom: 92rpx;
}
.rowItem {
padding: 0 32rpx;
margin-bottom: 37rpx;
display: inline-flex;
justify-content: space-between;
height: 42rpx;
line-height: 42rpx;
font-size: 30rpx;
color: #333333;
.value {
color: rgba(0, 0, 0, 0.5);
}
}
.btn {
padding: 49rpx 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
<template>
<view class="consumptionRecord">
<view class="firstLine">
<view class="left" @click="show = true">
<view>{{currentDate}}</view>
<view class="arrowImg" :style="'background-image: url('+ImgUrl + 'user/arrowDown.png'+')'"></view>
</view>
<view class="right">
<view class="font28">¥</view>
<view class="font40"> 40.00</view>
</view>
</view>
<van-tabs v-model="active" title-active-color="#323233" title-inactive-color="#969799" line-height="4px"
color="#04B871">
<van-tab title="全部" :title-style="active == 0 ? 'font-weight: bold' : ''"></van-tab>
<van-tab title="待支付" :title-style="active == 1 ? 'font-weight: bold' : ''"></van-tab>
<van-tab title="已支付" :title-style="active == 2 ? 'font-weight: bold' : ''"></van-tab>
<van-tab title="已退款" :title-style="active == 3 ? 'font-weight: bold' : ''"></van-tab>
</van-tabs>
<scroll-view scroll-y="true" class="scrollY">
<view class="pannels">
<view class="item">
<view class="p1">
<view class="left">
<view>二食堂卤面小炒</view>
<view class="meal">早餐</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 class="left">
<view>二食堂卤面小炒</view>
<view class="meal">早餐</view>
</view>
<view class="num">-10.00</view>
</view>
<view class="p2">2023-08-09 08:02:01</view>
</view>
<view class="item">
<view class="p1">
<view class="left">
<view>二食堂卤面小炒</view>
<view class="meal">早餐</view>
</view>
<view class="num">-10.00</view>
</view>
<view class="p2">08-09 08:02:01</view>
</view>
</view>
<view class="bottomTip">— 已展示全部数据 —</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" />
</view>
</scroll-view>
</view>
</template>
<script>
import moment from "moment";
import {
DatetimePicker
} from 'vant';
export default {
data() {
return {
active: 0,
ImgUrl: this.$ImgUrl,
minDate: new Date(2022, 10, 0),
maxDate: new Date(2999, 10, 1),
currentDate: '',
show: false,
}
},
created() {
this.currentDate = moment(new Date()).format('YYYY年M月');
},
methods: {
formatter(type, val) {
if (type === 'year') {
return `${val}年`;
} else if (type === 'month') {
return `${val}月`;
}
return val;
},
onConfirm(val) {
this.currentDate = moment(val).format('YYYY年M月')
this.show = false
},
onCancel() {
this.show = false
}
}
}
</script>
<style lang="scss">
.consumptionRecord {
width: 100%;
height: 100%;
min-height: calc(100vh - calc(44px + env(safe-area-inset-top)));
background: #F1F1F3;
font-family: PingFangSC-Regular, PingFang SC;
.firstLine {
display: inline-flex;
justify-content: space-between;
height: 88rpx;
line-height: 88rpx;
width: calc(100% - 130rpx);
padding: 0 38rpx 0 92rpx;
background: #FFFFFF;
border-top: 1rpx solid #E5E5E5;
border-bottom: 1rpx solid #E5E5E5;
font-size: 30rpx;
color: #333333;
.left,
.right {
display: inline-flex;
height: 100%;
view {
align-self: center;
}
.arrowImg {
margin-left: 12rpx;
width: 17rpx;
height: 11rpx;
background-size: cover;
background-position: center center;
}
.font28 {
font-size: 28rpx;
}
.font40 {
font-size: 40rpx;
margin-left: 15rpx;
}
}
}
.scrollY {
position: fixed;
height: calc(100vh - 178rpx - 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%;
background-color: white;
display: flex;
flex-direction: column;
.item {
margin-left: 32rpx;
width: calc(100% - 32rpx);
border-bottom: 1px solid #E5E5E5;
display: flex;
flex-direction: column;
.p1 {
margin-top: 26rpx;
margin-bottom: 6rpx;
width: calc(100% - 40rpx);
height: 45rpx;
line-height: 45rpx;
display: flex;
justify-content: space-between;
color: #333333;
font-size: 32rpx;
padding-right: 40rpx;
.left {
display: flex;
view {
align-self: center;
}
.meal {
width: 80rpx;
height: 34rpx;
line-height: 34rpx;
background: rgba(4, 184, 113, 0.09);
border-radius: 5rpx;
font-size: 24rpx;
color: #04B871;
margin-left: 20rpx;
text-align: center;
}
}
}
.p2 {
width: calc(100% - 40rpx);
height: 37rpx;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.35);
line-height: 37rpx;
padding-right: 40rpx;
margin-bottom: 24rpx;
}
}
}
.bottomTip {
margin-top: 32rpx;
padding-bottom: 32rpx;
width: 100%;
height: 33rpx;
font-size: 24rpx;
color: rgba(0, 0, 0, 0.25);
line-height: 33rpx;
text-align: center;
}
}
</style>
\ No newline at end of file
<template>
<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>
</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 {
activeTab: 1, // 1 还款 2 历史
orderList: [],
ImgUrl: this.$ImgUrl,
mealType: {
1: '早餐',
2: '中餐',
3: '晚餐',
4: '夜宵',
5: '夜夜宵'
},
status: {
0: '待扣款',
1: '已付款',
2: '已撤销',
3: '已退款',
4: '异常订单'
}
}
},
onLoad(options) {
this.WaitPayList(this.activeTab);
},
onShow() {},
methods: {
// 订单详情
async getOrderDetai(item) {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 200);
})
uni.hideLoading()
uni.navigateTo({
url: `../pendingOrderDetail/pendingOrderDetail?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 WaitPayList(activeTab) {
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/WaitPayList', {
accountId: sessionStorage.getItem('accountId') * 1,
status: activeTab - 1
})
uni.hideLoading()
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
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用户姓名
// }
// })
},
changeTab(name, title) {
this.activeTab = name;
this.WaitPayList(this.activeTab);
},
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return "0.00"
}
}
},
},
onReachBottom() {},
//下拉刷新
onPullDownRefresh() {
this.WaitPayList(this.activeTab);
uni.stopPullDownRefresh()
},
}
</script>
<style lang="scss">
page {
background: #F1F1F3;
}
#pendingOrderBox {
.orderList {
padding-left: 33rpx;
}
.orderitem {
height: 135rpx;
border-bottom: 2rpx solid #E5E5E5;
.rigth {
display: flex;
justify-items: center;
align-items: center;
padding-top: 24rpx;
position: relative;
}
.storeName {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 45rpx;
}
.mealType {
width: 80rpx;
height: 34rpx;
background: rgba(4, 184, 113, 0.09);
border-radius: 5rpx;
line-height: 34rpx;
text-align: center;
margin-left: 20rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #04B871;
}
.amount {
position: absolute;
height: 45rpx;
font-size: 32rpx;
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;
}
}
.dataBox {
border-top: 2rpx solid #F1F1F3;
background: #FFFFFF;
}
.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;
}
.showall {
height: 33rpx;
font-size: 24rpx;
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;
}
.active {
color: #01BC73;
font-weight: bold;
}
.noCostInfo {
width: 500rpx;
margin: 10vh auto;
text-align: center;
color: #484C54;
font-size: 30rpx;
image {
width: 500rpx;
height: 255rpx;
margin-bottom: 3vh;
}
}
}
</style>
\ No newline at end of file
<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
<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">{{Record['optionName']||''}}</view>
<view class="amount">{{itemAmount(Record['amount']||0)}}</view>
<view class="rowItem" style="margin-top: 92rpx;">
<view class="label">学生姓名</view>
<view class="value">{{Record['userName']||''}}</view>
</view>
<view class="rowItem">
<view class="label">年级班级</view>
<view class="value">{{Record['gradeName']||''}}/{{Record['className']||''}}</view>
</view>
<view class="rowItem">
<view class="label">服务费</view>
<view class="value"> {{Record['serviceFee']||'0.00'}}</view>
</view>
<view class="rowItem">
<view class="label">消费时间</view>
<view class="value">{{Record['payTime']||''}}</view>
</view>
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">{{Record['outTradeNo']||''}}</view>
</view>
<view class="rowItem">
<view class="label">支付订单号</view>
<view class="value">{{Record['tradeNo']||''}}</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: '异常订单'
},
Record: uni.getStorageSync('rechargeDetail')
}
},
onLoad(options) {},
onUnload: function() {
uni.removeStorageSync('rechargeDetail')
},
computed: {
itemAmount() {
return function(Amount) {
if (Amount) {
return (Amount / 100).toFixed(2)
} else {
return "0.00"
}
}
},
},
methods: {
// 跳转页面
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
<template>
<view class="topupDetail">
<view class="firstLine">
<view class="left" @click="show = true">
<view>{{currentDate}}</view>
<view class="arrowImg" :style="'background-image: url('+ImgUrl + 'user/arrowDown.png'+')'"></view>
</view>
<view class="right">
<view class="font28">¥</view>
<view class="font40">{{itemAmount(expenditure||0)}}</view>
</view>
</view>
<scroll-view scroll-y="true" class="scrollY">
<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>{{item.optionName||''}}</view>
<view class="num">{{itemAmount(item.amount||0)}}</view>
</view>
<view class="p2">{{itemTimeFormat(item.payTime)}}</view>
</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" 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" />
</view>
<view class="answeringQuestion" @click="goToPage(1)">
为什么有待支付订单?
</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';
export default {
data() {
return {
ImgUrl: this.$ImgUrl,
minDate: new Date(2022, 10, 0),
maxDate: new Date(2999, 10, 1),
currentDate: '',
currentDate_: '',
show: false,
list: [],
// 支出 单位分
expenditure: 0,
// 收入 单位分
revenue: 0
}
},
onLoad(options) {
this.currentDate = moment(new Date()).format('YYYY年M月');
this.currentDate_ = moment(new Date()).format('YYYY-MM');
this.QueryRechargeRecord();
},
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.setStorageSync('rechargeDetail', item)
uni.hideLoading()
uni.navigateTo({
url: `../rechargeDetail/rechargeDetail`
})
} 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 QueryRechargeRecord() {
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/QueryRechargeRecord', {
accountId: sessionStorage.getItem('accountId') * 1,
month: this.currentDate_
})
uni.hideLoading()
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
// amount integer金额 单位分 有正负值
// balance integer余额 单位分
// id integer
// recordName string记录名称
// recordTime 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: 'd3456345', // string支付订单号
// }
// })
},
formatter(type, val) {
if (type === 'year') {
return `${val}年`;
} else if (type === 'month') {
return `${val}月`;
}
return val;
},
onConfirm(val) {
this.currentDate = moment(val).format('YYYY年M月')
this.currentDate_ = moment(val).format('YYYY-MM');
this.show = false
this.QueryRechargeRecord()
},
onCancel() {
this.show = false
}
}
}
</script>
<style lang="scss">
.topupDetail {
width: 100%;
height: 100%;
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;
height: 88rpx;
line-height: 88rpx;
width: calc(100% - 130rpx);
padding: 0 38rpx 0 92rpx;
background: #FFFFFF;
border-top: 1rpx solid #E5E5E5;
border-bottom: 1rpx solid #E5E5E5;
font-size: 30rpx;
color: #333333;
.left,
.right {
display: inline-flex;
height: 100%;
view {
align-self: center;
}
.arrowImg {
margin-left: 12rpx;
width: 17rpx;
height: 11rpx;
background-size: cover;
background-position: center center;
}
.font28 {
font-size: 28rpx;
}
.font40 {
font-size: 40rpx;
margin-left: 15rpx;
}
}
}
.scrollY {
// 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%;
background-color: white;
display: flex;
flex-direction: column;
.item {
margin-left: 32rpx;
width: calc(100% - 32rpx);
border-bottom: 1px solid #E5E5E5;
display: flex;
flex-direction: column;
.p1 {
margin-top: 26rpx;
margin-bottom: 6rpx;
width: calc(100% - 40rpx);
height: 45rpx;
line-height: 45rpx;
display: flex;
justify-content: space-between;
color: #333333;
font-size: 32rpx;
padding-right: 40rpx;
.num {
color: #E02020;
}
}
.p2 {
width: calc(100% - 40rpx);
height: 37rpx;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.35);
line-height: 37rpx;
padding-right: 40rpx;
margin-bottom: 24rpx;
}
}
}
.bottomTip {
margin-top: 32rpx;
padding-bottom: 32rpx;
width: 100%;
height: 33rpx;
font-size: 24rpx;
color: rgba(0, 0, 0, 0.25);
line-height: 33rpx;
text-align: center;
}
}
</style>
\ No newline at end of file
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