Commit ebadde84 authored by lizhishu's avatar lizhishu

1.提交更新;

parent 2adb68f5
<template>
<view class="ConsumptIoninfo container">
<view class="nav">
<view class="nav-list" v-for="(item,index) in list" :key="item.id" @tap="changeAct(item,index)">
<view :class="[act==index?'name':'']">
{{item.name}}
</view>
<view :class="[act==index?'line':'']">
</view>
</view>
</view>
<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">
......@@ -28,7 +23,7 @@
<!-- 内容的改变 -->
<view class="content">
<view class="orderList" v-if="orderList.length>0">
<view class="orderitem" v-for="(item,index) in orderList" :key="index" @tap="getOrderDetai(item)">
<view class="orderitem" v-for="(item,index) in orderList" :key="index">
<view class="row rowlin1">
<view class="left name">
{{item.storeName}}
......@@ -61,9 +56,12 @@
</view>
<!-- 没有数据 -->
<view class="nodata" v-else>
<image :src="ImgUrl2+'nodata.png'" mode="aspectFit"></image>
<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>
......@@ -82,6 +80,7 @@
data() {
const currentDate = this.getDate()
return {
ImgUrl3: this.$ImgUrl,
ImgUrl2: this.$ImgUrl + 'xzfalipay/',
ImgUrl: this.$ImgUrl + '/static/weapp/',
// 默认激活样式是第一个
......@@ -147,8 +146,24 @@
}].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(item, index) {
async changeAct(index, item) {
// 激活样式是当前点击的对应下标--list中对应id
this.act = index;
// 可以根据点击事件改变内容
......@@ -183,6 +198,20 @@
}
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 = []
}
......@@ -263,11 +292,26 @@
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;
......
......@@ -134,7 +134,26 @@
<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>
......@@ -190,56 +209,45 @@
otherTip: false,
superTip: false,
// 消费会员弹框
showDlgModal: false,
SchoolInfo: null
contractMenber: false,
};
},
onLoad: function() {
this.getConsumeLimitData()
// this.MySchoolInfo()
},
methods: {
// 我的学校信息
async MySchoolInfo() {
try {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 300);
})
let respes = await this.$httpWX.post({
url: '/cgi-xpay/app/user/MySchoolInfo'
}, {
"accountId": this.ConsumptionQuotaUser.id,
})
uni.hideLoading()
if (respes.code != 200) {
uni.showToast({
icon: "error",
title: respes.message
})
return
}
this.SchoolInfo = respes.data || {}
console.log(this.SchoolInfo, 'MySchoolInfoMySchoolInfo');
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
// 弹框点击事情
async BtnEvent(type) {
if (type == 1) {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
if (type == 2) {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index'
})
}
this.contractMenber = false
},
// 弹框点击事情
async BtnEvent(type) {
console.warn(type)
this.showDlgModal = false
uni.navigateBack()
// 查询消费会员权益项
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;
......@@ -337,6 +345,7 @@
},
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';
......@@ -613,6 +622,89 @@
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;
......
......@@ -68,21 +68,12 @@
3: '已退款',
4: '异常订单'
},
Record: {
amount: '', // integer金额 单位分
className: '', // string班级
gradeName: '', // string年级
id: 0, // integer
optionName: '', // string操作名称 示例:线上充值
outTradeNo: '', // string交易订单号
payTime: '', // string消费时间
serviceFee: '', // string服务费 格式¥0.02
tradeNo: '', // string支付订单号
}
Record: uni.getStorageSync('rechargeDetail')
}
},
onLoad(options) {
this.QueryRechargeRecord(options['month'] || '', options['id'] || '');
onLoad(options) {},
onUnload: function() {
uni.removeStorageSync('rechargeDetail')
},
computed: {
itemAmount() {
......@@ -96,48 +87,6 @@
},
},
methods: {
// 充值明细列表
async QueryRechargeRecord(month, id) {
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: month,
id
})
uni.hideLoading()
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
this.expenditure = data.data['expenditure'] || 0
this.Record = 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支付订单号
}
})
},
// 跳转页面
async goToPage(value) {
switch (value) {
......
......@@ -14,10 +14,10 @@
<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.recordName||''}}</view>
<view>{{item.optionName||''}}</view>
<view class="num">{{itemAmount(item.amount||0)}}</view>
</view>
<view class="p2">{{itemTimeFormat(item.recordTime)}}</view>
<view class="p2">{{itemTimeFormat(item.payTime)}}</view>
</view>
</view>
<view v-if='list.length==0' class="noCostInfo">
......@@ -69,7 +69,7 @@
onLoad(options) {
this.currentDate = moment(new Date()).format('YYYY年M月');
this.currentDate_ = moment(new Date()).format('YYYY-MM');
this.QueryAccountExchangeList();
this.QueryRechargeRecord();
},
computed: {
itemAmount() {
......@@ -106,9 +106,10 @@
res()
}, 200);
})
uni.setStorageSync('rechargeDetail', item)
uni.hideLoading()
uni.navigateTo({
url: `../rechargeDetail/rechargeDetail?id=${item.id || ''}&month=${this.currentDate_}`
url: `../rechargeDetail/rechargeDetail`
})
} catch (error) {
uni.showToast({
......@@ -134,7 +135,7 @@
}
},
// 充值明细列表
async QueryAccountExchangeList() {
async QueryRechargeRecord() {
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
......@@ -146,7 +147,7 @@
res()
}, 200);
})
const data = await requestPost('/cgi-xpay/app/h5/QueryAccountExchangeList', {
const data = await requestPost('/cgi-xpay/app/h5/QueryRechargeRecord', {
accountId: sessionStorage.getItem('accountId') * 1,
month: this.currentDate_
})
......@@ -166,6 +167,19 @@
// 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') {
......@@ -179,7 +193,7 @@
this.currentDate = moment(val).format('YYYY年M月')
this.currentDate_ = moment(val).format('YYYY-MM');
this.show = false
this.QueryAccountExchangeList()
this.QueryRechargeRecord()
},
onCancel() {
this.show = false
......
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