Commit 5acd57a9 by zhangzhen

功能优化

parent 2311cba4
......@@ -17,4 +17,8 @@ export const createRecharge=(data)=>{
return http.post(url,data)
}
export const balanceLog=(data)=>{
let url=`/balanceLog/query`
return http.get(url,data)
}
......@@ -192,6 +192,13 @@
}
},
{
"path": "recharge/record",
"style": {
"navigationBarTitleText": "余额使用记录",
"enablePullDownRefresh" : false
}
},
{
"path" : "rule/rule",
"style": {
"navigationBarTitleText": "活动规则",
......
......@@ -219,13 +219,6 @@
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view>
</view>
<view v-if="computePriceInfo.remainingDuration" class="flex-between price">
<text class="text-black text-left">可用时长</text>
<view class="flex-row">
<text class="text-pink text-lg text-bold">{{computePriceInfo.remainingDuration}}</text>
<text class="text-pink">小时</text>
</view>
</view>
<view v-if="computePriceInfo.totalFeeNow" class="flex-between price">
<text class="text-black text-left">应付金额</text>
<view class="flex-row">
......@@ -233,12 +226,19 @@
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.totalFeeNow||0}}</text>
</view>
</view>
</view>
<view class="flex-between price">
<text class="text-black text-left">可用时长</text>
<view class="flex-row">
<text class="text-pink text-lg text-bold">{{Number(computePriceInfo.availableDuration).toFixed(1)}}</text>
<text class="text-pink">小时</text>
</view>
</view>
<view v-if="computePriceInfo.duration" class="flex-between price">
<text class="text-black text-left">时长抵扣</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.duration||0}}</text>
<text class="text-pink text-lg text-bold">{{ Number(computePriceInfo.duration).toFixed(1)}}</text>
<text>小时</text>
</view>
</view>
<view v-if="computePriceInfo.remainingBalance" class="flex-between price">
......@@ -247,20 +247,21 @@
<text class="text-pink">优先使用钱包余额</text>
</view>
</view>
<view v-if="computePriceInfo.balance" class="flex-between price">
<text class="text-black text-left">余额抵扣</text>
<view v-if="computePriceInfo.availableBalance" class="flex-between price">
<text class="text-black text-left">可用余额</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.balance}}</text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.availableBalance}}</text>
</view>
</view>
<view v-if="computePriceInfo.remainingBalance" class="flex-between price">
<text class="text-black text-left">钱包余额</text>
<view v-if="computePriceInfo.balance" class="flex-between price">
<text class="text-black text-left">余额抵扣</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.remainingBalance}}</text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.balance}}</text>
</view>
</view>
<view v-if="computePriceInfo.totalFee - computePriceInfo.totalFeeNow > 0" class="flex-between price">
<view class="flex-row-center">
<text class="text-black text-left">会员折扣</text>
......
......@@ -53,6 +53,15 @@
<text class="text-gray ">订单编号</text>
<text class="text-title ">{{orderInfo.orderNo||'-'}}</text>
</view>
<view class="flex-between">
<text class="text-gray ">订单应付</text>
<view class="flex-row" style="align-items: center;text-decoration-line: line-through;">
<text class="text-lg">{{orderInfo.totalPrice||'0'}}</text>
<text style="margin-left: 4upx;"></text>
</view>
</view>
<view v-if="orderInfo.packName" class="flex-between">
<text class="text-gray ">购买套餐</text>
<text class="text-title ">{{orderInfo.packName||'-'}}</text>
......@@ -65,6 +74,22 @@
<text class="text-gray">优惠券抵扣</text>
<text class="text-title">{{orderInfo.couponName}}</text>
</view>
<view v-if="orderInfo.duration" class="flex-between">
<text class="text-gray">时长抵扣</text>
<view class="">
<text class="text-title">{{orderInfo.duration}}</text>
<text>小时</text>
</view>
</view>
<!-- <view v-if="orderInfo.discountRatio" class="flex-between">
<text class="text-gray">折扣优惠</text>
<view class="">
<text class="text-title">{{orderInfo.discountRatio}}</text>
</view>
</view> -->
<view v-if="orderInfo.balance>0" class="flex-between">
<text class="text-gray">余额支付</text>
<view class="flex-row" style="align-items: center;">
......
<template>
<view class="order-record">
<view class="flex-between record-box">
<view class="">
</view>
<view class="text-btn" @tap="onNav">
<text>使用记录</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view v-if="loginStatus" class="content-box">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
......@@ -176,6 +185,11 @@ import NoLogin from "@/components/noLogin/noLogin"
this.list = []
this.onLoading()
},
onNav(){
uni.navigateTo({
url:"/setting/recharge/record"
})
},
onNavToOrderInfo(val){
// uni.navigateTo({
// url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
......@@ -193,6 +207,16 @@ import NoLogin from "@/components/noLogin/noLogin"
.order-record {
display: flex;
flex-direction: column;
.record-box{
padding: 24upx 24upx 0;
.text-btn{
display: flex;
flex-direction: row;
align-items: center;
color: #55aaff;
font-size: 30upx;
}
}
.content-box {
display: flex;
flex-direction: column;
......
<template>
<view class="order-record">
<view v-if="loginStatus" class="content-box">
<view class="list-content">
<view v-for="(item,index) in list" :key="index" class="list-item" @tap="onNavToOrderInfo(item)">
<view class="flex-between part-1">
<view class="">
<text class="text-title">{{item.operationType? '退款' : "消费"}}</text>
</view>
<view class="flex-row">
<text class="text-bold text-xl" :class="item.sign=='income'?'text-red':'text-black'">{{item.operationType?'+':'-'}}</text>
<text class="text-black text-bold text-lg" >{{item.variableAmount}}</text>
</view>
</view>
<view class="flex-between part-1">
<text>{{item.operationTime}}</text>
<text>{{item.payType}}</text>
</view>
</view>
</view>
</view>
<view v-if="loginStatus && list.length == 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120"
:icon="listBlankImage">
</u-empty>
</view>
<view v-if="loginStatus && list.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<NoLogin v-model="loginStatus" />
</view>
</template>
<script>
import config from "@/config/index.config"
import {
balanceLog
} from "@/api/recharge.js"
import NoLogin from "@/components/noLogin/noLogin"
import {
getDictItem
} from "@/utils/tools.js"
export default {
components:{
NoLogin
},
data() {
return {
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
statusIndex: 0,
list: [],
statusList: [{
label: "全部",
value: "",
},
{
label: "已预约",
value: "0",
},
{
label: "使用中",
value: "1",
},
{
label: "已完成",
value: "2",
},
{
label: "退单",
value: "3",
}
],
queryParams: {
pageNum: 1,
pageSize: 10
},
loginStatus:true,
orderStatusEnum:{},
payTypeEnum:{
1:"微信支付",
2:"支付宝支付",
3:"余额支付"
},
payStatus:{
'0':'-',
'1':'+'
},
listBlankImage:config.assetsPath+'/no_data_icon.png',
};
},
onLoad() {
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryParams.pageNum += 1;
this.onLoading();
}
},
onShow() {
this.onGetDicts()
},
methods: {
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.onLoading()
})
}
},
onLoading() {
uni.showLoading({
title: '加载中'
})
this.status = 'loading'
this.queryParams.status = this.statusList[this.statusIndex].value;
balanceLog(this.queryParams).then(res => {
console.log(res)
uni.hideLoading()
if (res.data.code == 200) {
this.list = res.data.data
this.status = 'nomore'
}else if(res.data.code == 401){
this.loginStatus = false
}
})
},
tabSelect(i) {
console.log(i, 99999)
this.statusIndex = i;
this.queryParams.pageNum = 1;
this.list = []
this.onLoading()
},
onNavToOrderInfo(val){
uni.navigateTo({
url:"/pages/orderResult/orderResult?orderNo="+val.orderNo
})
}
}
}
</script>
<style>
page{
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.order-record {
display: flex;
flex-direction: column;
.content-box {
display: flex;
flex-direction: column;
.list-content{
display: flex;
flex-direction: column;
align-items: center;
.list-item{
width: 94%;
padding: 20upx 20upx;
border-radius: 20upx;
background-color: #ffffff;
margin-top: 30upx;
.part-1{
display: flex;
align-items: center;
padding: 10upx;
.flex-row{
display: flex;
flex-direction: row;
align-items: 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