Commit 2adb68f5 authored by lizhishu's avatar lizhishu

1.提交更新;

parent 5140358a
......@@ -68,6 +68,15 @@
</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() {
......@@ -110,8 +119,6 @@
date: currentDate,
// 选择的数据
query: {
user: "",
datatime: "",
accountId: 0,
month: this.getDate({}),
status: -1
......@@ -133,7 +140,7 @@
onLoad: function(options) {
console.log(options);
console.log(this.query);
// this.getOrderList()
this.getOrderList()
this.userList = [{
"userName": "全部用户",
"id": 0
......@@ -147,7 +154,7 @@
// 可以根据点击事件改变内容
this.content = this.list[index]
this.query.status = this.list[index].value
// this.getOrderList()
this.getOrderList()
},
// 获取订单列表
async getOrderList() {
......@@ -158,16 +165,12 @@
mask: true,
// #endif
})
let respes = await this.$httpWX.post({
url: '/cgi-xpay/app/user/OrderList'
}, this.query)
if (respes.code != 200) {
uni.showToast({
icon: "none",
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: respes.message
let respes = await requestPost('/cgi-xpay/app/h5/OrderList', this.query)
if (respes['code'] != 200) {
await Dialog({
title: '温馨提示',
message: respes['message'],
confirmButtonText: "知道了"
})
return
}
......@@ -207,7 +210,7 @@
})
uni.hideLoading()
uni.navigateTo({
url: `../OrderDetai/OrderDetai?devflowNo=${item.devflowNo}`
url: `../consumptionRecord/consumptionRecord?devflowNo=${item.devflowNo}`
})
} catch (error) {
uni.showToast({
......@@ -220,7 +223,6 @@
async bindPickerChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = e.detail.value
this.query.user = this.userList[this.index].userName
this.query.accountId = this.userList[this.index].id
this.getOrderList()
},
......
......@@ -5,39 +5,31 @@
<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="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">{{orderInfo['userName']||''}}</view>
<view class="value">{{Record['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 class="value">{{Record['gradeName']||''}}/{{Record['className']||''}}</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 class="label">服务费</view>
<view class="value"> {{Record['serviceFee']||'0.00'}}</view>
</view>
<view class="rowItem">
<view class="label">消费时间</view>
<view class="value">{{orderInfo['dealTime']||''}}</view>
<view class="value">{{Record['payTime']||''}}</view>
</view>
<view class="rowItem">
<view class="label">交易订单号</view>
<view class="value">{{orderInfo['platflowNo']||''}}</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>
......@@ -76,32 +68,21 @@
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: '' //消费场景
Record: {
amount: '', // integer金额 单位分
className: '', // string班级
gradeName: '', // string年级
id: 0, // integer
optionName: '', // string操作名称 示例:线上充值
outTradeNo: '', // string交易订单号
payTime: '', // string消费时间
serviceFee: '', // string服务费 格式¥0.02
tradeNo: '', // string支付订单号
}
}
},
onLoad(options) {
this.OrderDetail(options['devflowNo'] || '');
this.QueryRechargeRecord(options['month'] || '', options['id'] || '');
},
computed: {
itemAmount() {
......@@ -115,11 +96,25 @@
},
},
methods: {
// 订单详情
async OrderDetail(devflowNo) {
const data = await requestPost('/cgi-xpay/app/h5/OrderDetail', {
devflowNo
// 充值明细列表
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: '温馨提示',
......@@ -128,7 +123,20 @@
})
return
}
this.orderInfo = data.data['data'] || {}
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) {
......
......@@ -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.optionName||''}}</view>
<view>{{item.recordName||''}}</view>
<view class="num">{{itemAmount(item.amount||0)}}</view>
</view>
<view class="p2">{{itemTimeFormat(item.payTime)}}</view>
<view class="p2">{{itemTimeFormat(item.recordTime)}}</view>
</view>
</view>
<view v-if='list.length==0' class="noCostInfo">
......@@ -108,7 +108,7 @@
})
uni.hideLoading()
uni.navigateTo({
url: `../rechargeDetail/rechargeDetail?devflowNo=` + item.devflowNo || ''
url: `../rechargeDetail/rechargeDetail?id=${item.id || ''}&month=${this.currentDate_}`
})
} catch (error) {
uni.showToast({
......@@ -159,30 +159,13 @@
})
return
}
// amount integer金额 单位分
// className string班级
// gradeName string年级
// amount integer金额 单位分 有正负值
// balance integer余额 单位分
// id integer
// optionName string操作名称 示例:线上充值
// outTradeNo string交易订单号
// payTime string消费时间
// serviceFee string服务费 格式¥0.02
// tradeNo string支付订单号
// 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: '支付订单号', // string支付订单号
// }
// })
},
formatter(type, val) {
if (type === 'year') {
......
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