Commit 2adb68f5 authored by lizhishu's avatar lizhishu

1.提交更新;

parent 5140358a
...@@ -68,6 +68,15 @@ ...@@ -68,6 +68,15 @@
</view> </view>
</template> </template>
<script> <script>
import {
Dialog,
Toast
} from 'vant';
import config from '../common/config.js'
import {
requestGet,
requestPost
} from '../common/request.js'
export default { export default {
name: "ConsumptIoninfo", name: "ConsumptIoninfo",
data() { data() {
...@@ -110,8 +119,6 @@ ...@@ -110,8 +119,6 @@
date: currentDate, date: currentDate,
// 选择的数据 // 选择的数据
query: { query: {
user: "",
datatime: "",
accountId: 0, accountId: 0,
month: this.getDate({}), month: this.getDate({}),
status: -1 status: -1
...@@ -133,7 +140,7 @@ ...@@ -133,7 +140,7 @@
onLoad: function(options) { onLoad: function(options) {
console.log(options); console.log(options);
console.log(this.query); console.log(this.query);
// this.getOrderList() this.getOrderList()
this.userList = [{ this.userList = [{
"userName": "全部用户", "userName": "全部用户",
"id": 0 "id": 0
...@@ -147,7 +154,7 @@ ...@@ -147,7 +154,7 @@
// 可以根据点击事件改变内容 // 可以根据点击事件改变内容
this.content = this.list[index] this.content = this.list[index]
this.query.status = this.list[index].value this.query.status = this.list[index].value
// this.getOrderList() this.getOrderList()
}, },
// 获取订单列表 // 获取订单列表
async getOrderList() { async getOrderList() {
...@@ -158,16 +165,12 @@ ...@@ -158,16 +165,12 @@
mask: true, mask: true,
// #endif // #endif
}) })
let respes = await this.$httpWX.post({ let respes = await requestPost('/cgi-xpay/app/h5/OrderList', this.query)
url: '/cgi-xpay/app/user/OrderList' if (respes['code'] != 200) {
}, this.query) await Dialog({
if (respes.code != 200) { title: '温馨提示',
uni.showToast({ message: respes['message'],
icon: "none", confirmButtonText: "知道了"
// #ifndef MP-ALIPAY
mask: true,
// #endif
title: respes.message
}) })
return return
} }
...@@ -207,7 +210,7 @@ ...@@ -207,7 +210,7 @@
}) })
uni.hideLoading() uni.hideLoading()
uni.navigateTo({ uni.navigateTo({
url: `../OrderDetai/OrderDetai?devflowNo=${item.devflowNo}` url: `../consumptionRecord/consumptionRecord?devflowNo=${item.devflowNo}`
}) })
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
...@@ -220,7 +223,6 @@ ...@@ -220,7 +223,6 @@
async bindPickerChange(e) { async bindPickerChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value) console.log('picker发送选择改变,携带值为', e.detail.value)
this.index = 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.query.accountId = this.userList[this.index].id
this.getOrderList() this.getOrderList()
}, },
......
...@@ -5,39 +5,31 @@ ...@@ -5,39 +5,31 @@
<view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'"> <view class="topBg" :style="'background-image: url('+this.$ImgUrl + 'user/greyBgTop.png'+')'">
<view class="line"></view> <view class="line"></view>
</view> </view>
<view class="title">{{orderInfo['storeName']||''}}-{{mealType[orderInfo['mealType']]}}</view> <view class="title">{{Record['optionName']||''}}</view>
<view class="amount">-{{itemAmount(orderInfo['amount']||0)}}</view> <view class="amount">{{itemAmount(Record['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="rowItem" style="margin-top: 92rpx;">
<view class="label">学生姓名</view> <view class="label">学生姓名</view>
<view class="value">{{orderInfo['userName']||''}}</view> <view class="value">{{Record['userName']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">年级班级</view> <view class="label">年级班级</view>
<view class="value">{{orderInfo['gradeName']||''}}/{{orderInfo['className']||''}}</view> <view class="value">{{Record['gradeName']||''}}/{{Record['className']||''}}</view>
</view>
<view class="rowItem">
<view class="label">手续费</view>
<view class="value"> {{orderInfo['serviceFee']||'0.00'}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">消费设备</view> <view class="label">服务费</view>
<view class="value"> {{orderInfo['deviceName']||''}}</view> <view class="value"> {{Record['serviceFee']||'0.00'}}</view>
</view>
<view class="rowItem">
<view class="label">消费场景</view>
<view class="value"> {{orderInfo['consumeScene']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">消费时间</view> <view class="label">消费时间</view>
<view class="value">{{orderInfo['dealTime']||''}}</view> <view class="value">{{Record['payTime']||''}}</view>
</view> </view>
<view class="rowItem"> <view class="rowItem">
<view class="label">交易订单号</view> <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>
<view class="btn" @click="goToPage(1)"> <view class="btn" @click="goToPage(1)">
<view class="button">对此订单有疑问?</view> <view class="button">对此订单有疑问?</view>
...@@ -76,32 +68,21 @@ ...@@ -76,32 +68,21 @@
3: '已退款', 3: '已退款',
4: '异常订单' 4: '异常订单'
}, },
orderInfo: { Record: {
accountId: '', // integer刷脸用户账户id,该id为绑定用户id amount: '', // integer金额 单位分
amount: '', // integer消费金额 单位分 className: '', // string班级
dealTime: '', // string消费时间(刷脸时间) gradeName: '', // string年级
debt: '', // integer是否垫资 1支付宝垫资 0未垫资 id: 0, // integer
devflowNo: '', // string终端消费流水号 optionName: '', // string操作名称 示例:线上充值
mealType: 1, // integer餐别:1早餐,2中餐,3晚餐,4夜宵,5夜夜宵 outTradeNo: '', // string交易订单号
payTime: '', // string支付时间 payTime: '', // string消费时间
payType: '', // integer消费类型 1.刷卡 2.刷脸 serviceFee: '', // string服务费 格式¥0.02
platflowNo: '', // string平台交易流水(订单编号) tradeNo: '', // 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) { onLoad(options) {
this.OrderDetail(options['devflowNo'] || ''); this.QueryRechargeRecord(options['month'] || '', options['id'] || '');
}, },
computed: { computed: {
itemAmount() { itemAmount() {
...@@ -115,11 +96,25 @@ ...@@ -115,11 +96,25 @@
}, },
}, },
methods: { methods: {
// 订单详情 // 充值明细列表
async OrderDetail(devflowNo) { async QueryRechargeRecord(month, id) {
const data = await requestPost('/cgi-xpay/app/h5/OrderDetail', { uni.showLoading({
devflowNo 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) { if (data['code'] != 200) {
await Dialog({ await Dialog({
title: '温馨提示', title: '温馨提示',
...@@ -128,7 +123,20 @@ ...@@ -128,7 +123,20 @@
}) })
return 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) { async goToPage(value) {
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
<view class="pannels" v-if="list.length>0"> <view class="pannels" v-if="list.length>0">
<view class="item" v-for="(item,index) in list" :key="index" @tap="rechargeRecordDetai(item)"> <view class="item" v-for="(item,index) in list" :key="index" @tap="rechargeRecordDetai(item)">
<view class="p1"> <view class="p1">
<view>{{item.optionName||''}}</view> <view>{{item.recordName||''}}</view>
<view class="num">{{itemAmount(item.amount||0)}}</view> <view class="num">{{itemAmount(item.amount||0)}}</view>
</view> </view>
<view class="p2">{{itemTimeFormat(item.payTime)}}</view> <view class="p2">{{itemTimeFormat(item.recordTime)}}</view>
</view> </view>
</view> </view>
<view v-if='list.length==0' class="noCostInfo"> <view v-if='list.length==0' class="noCostInfo">
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
}) })
uni.hideLoading() uni.hideLoading()
uni.navigateTo({ uni.navigateTo({
url: `../rechargeDetail/rechargeDetail?devflowNo=` + item.devflowNo || '' url: `../rechargeDetail/rechargeDetail?id=${item.id || ''}&month=${this.currentDate_}`
}) })
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
...@@ -159,30 +159,13 @@ ...@@ -159,30 +159,13 @@
}) })
return return
} }
// amount integer金额 单位分 // amount integer金额 单位分 有正负值
// className string班级 // balance integer余额 单位分
// gradeName string年级
// id integer // id integer
// optionName string操作名称 示例:线上充值 // recordName string记录名称
// outTradeNo string交易订单号 // recordTime string操作时间
// payTime string消费时间
// serviceFee string服务费 格式¥0.02
// tradeNo string支付订单号
this.list = data.data['list'] || [] this.list = data.data['list'] || []
this.expenditure = data.data['expenditure'] || 0 this.expenditure = data.data['expenditure'] || 0
// this.list = Array(10).fill(1).map((v, index) => {
// return {
// amount: 100, // integer金额 单位分
// className: '班级', // string班级
// gradeName: '年级', // string年级
// id: index + 1, // integer
// optionName: '线上充值', // string操作名称 示例:线上充值
// outTradeNo: '易订单号', // string交易订单号
// payTime: '2023-09-10 08:22:56', // string消费时间
// serviceFee: '0.02', // string服务费 格式¥0.02
// tradeNo: '支付订单号', // string支付订单号
// }
// })
}, },
formatter(type, val) { formatter(type, val) {
if (type === 'year') { if (type === 'year') {
......
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