Commit bceba90f authored by 袁玲利's avatar 袁玲利

校园报告鉴权逻辑修改

parent f10bcbba
......@@ -136,7 +136,7 @@
// 鉴权服务项code
serviceItemCode: [config['ServiceEnum']['Auth10'], config['ServiceEnum']['Auth8'], config[
'ServiceEnum']['Auth11'], '', config[
'ServiceEnum']['Auth02']]
'ServiceEnum']['Auth2']]
[index]
}
}),
......
......@@ -66,7 +66,7 @@
</view>
<!-- 遮罩层 -->
<template v-if="!isVip">
<template v-if="false">
<div class="Covers">
<div class="Covers_head" @click="openAzMenber">
<span>
......@@ -83,7 +83,7 @@
</template>
</view>
<template v-if="isVip">
<template >
<!-- 生活费额度 -->
<view class="living">
<view class="hed">
......@@ -223,10 +223,10 @@
<span>消费明细</span>
</view>
<view class="consume_detail_mesg">
<span>早餐 <text class="prefer_light">{{userDealReportListAndSumObj.zaoSumAmount}}</text>
<span>早餐 <text class="prefer_light">{{userDealReportListAndSumObj.zaoSumAmount || 0}}</text>
元,午餐<text
class="prefer_light">{{userDealReportListAndSumObj.wuSumAmount}}</text>元,晚餐<text
class="prefer_light">{{userDealReportListAndSumObj.wanSumAmount}}</text></span>
class="prefer_light">{{userDealReportListAndSumObj.wuSumAmount || 0}}</text>元,晚餐<text
class="prefer_light">{{userDealReportListAndSumObj.wanSumAmount || 0}}</text></span>
</view>
<view class="detail_lists">
<view class="listsHead" v-if="userDealReportListAndSumObj.list.length">
......@@ -263,7 +263,7 @@
<view class="footer_left">
<view class="footer_left_top">到期后将无法查看完整报告</view>
<view class="footer_left_bottom">有效期至<span class="special">{{vipExpiredDt}}</span>,剩余<span
class="special">{{homeDataInfo['vipDaysRemaining']}}</span></view>
class="special">{{vipDaysRemaining}}</span></view>
</view>
<view class="footer_right" @click="openAzMenber">
<span>延长权益</span>
......@@ -321,6 +321,7 @@
requestGet,
requestPost
} from '../common/request.js'
import config from '../common/config.js'
export default {
name: 'campusReport',
data() {
......@@ -362,6 +363,7 @@
},
homeDataInfo: {},
vipExpiredDt: "", // 有效期
vipDaysRemaining: 0, //有效天数
}
},
components: {
......@@ -389,30 +391,50 @@
},
created() {
this.dataRangeArr = this.repastDateTimeFormat()
this.currentDate.month = moment(this.dataRangeArr[this.dataRangeIndex].startDate).month()
this.currentDate.month = moment(this.dataRangeArr[this.dataRangeIndex].startDate).month() || 0
this.currentDate.year = moment(this.dataRangeArr[this.dataRangeIndex].startDate).year()
this.currentDate.date = moment(this.dataRangeArr[this.dataRangeIndex].startDate).date()
this.shareDate = moment(this.dataRangeArr[this.dataRangeIndex].startDate).format('YYYY-MM-DD 00:00:00')
this.today.date = (this.currentDate.month + 1) + '月1日'
console.log(this.currentDate, 'currentDate1111111111111', this.shareDate, 'this.homeDataInfo', this
.homeDataInfo)
},
mounted() {
console.log(this.dataRangeArr, 'dataRangeArr')
this.homeDataInfo = JSON.parse(sessionStorage.getItem('HomeDataInfo'))
this.QueryProductContractItemDetailResp(config['ServiceEnum']['Auth2']);
this.getCampusConsumerReport()
if (this.homeDataInfo.vipStatus === 1) {
this.isVip = true;
this.vipExpiredDt = moment(this.homeDataInfo.vipExpiredDt).format('YYYY年MM月DD日')
console.log(this.vipExpiredDt, 'this.vipExpiredDt')
this.initPieCharts()
this.getCateringAbnormalTypeGroupList()
}
this.getCateringAbnormalTypeGroupList()
console.log(this.isVip, 'isVip')
this.columns = this.dataRangeArr.map(x => x.month)
console.log(this.columns, 'columns')
},
methods: {
// 查询消费会员权益项
async QueryProductContractItemDetailResp(serviceItemCode = '1002') {
console.log(config['ServiceEnum']['Auth2'], 'Auth2',this.homeDataInfo)
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItemDetail', {
accountId: this.homeDataInfo['accountId'],
serviceItemCode
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
this.vipExpiredDt = data.data.expiredDt ? (moment(data.data.expiredDt).format('YYYY年MM月DD日')) : ''
this.vipDaysRemaining = data.data.daysRemaining || 0
console.log(data.data, 'result')
},
shareHandler: function() {
let htmlCanvasImg = document.getElementsByClassName("htmlCanvasImg")[0];
if (htmlCanvasImg) {
......@@ -444,7 +466,7 @@
},
// 切换日期
changeToday(today) {
this.today.date = (today.month + 1) + '' + today.date + ''
this.today.date = (today.month + 1) + '' + (today.date || '1') + ''
if (Reflect.has(today, 'unrecordedZao')) {
this.today.zao = today.unrecordedZao
}
......@@ -469,10 +491,11 @@
console.log(this.currentDate, 'currentDate222222222222222', this.shareDate)
console.log(obj, 'obj', this.dataRangeIndex)
this.getCampusConsumerReport()
if (this.homeDataInfo.vipStatus === 1) {
this.initPieCharts()
// if (this.homeDataInfo.vipStatus === 1) {
// this.initPieCharts()
this.getCateringAbnormalTypeGroupList()
}
// }
this.pickerShow = !this.pickerShow;
},
choosePicker() {
......@@ -516,6 +539,7 @@
return
}
this.campusConsumerReportInfo = data.data;
this.initPieCharts()
} catch (e) {
console.warn(e)
//TODO handle the exception
......@@ -622,9 +646,6 @@
getDataRangeArr() {
console.log(this.dataRangeArr, 'dataRangeArr')
},
init() {
this.initPieCharts();
},
show() {
this.getUserDealReportListAndSum()
this.isShow = !this.isShow;
......@@ -657,15 +678,15 @@
series: [{
type: 'pie',
data: [{
value: this.campusConsumerReportInfo.supermarketAmountF,
value: this.campusConsumerReportInfo.supermarketAmountF || 0,
name: '超市'
},
{
value: this.campusConsumerReportInfo.canteenAmountF,
value: this.campusConsumerReportInfo.canteenAmountF || 0,
name: '食堂'
},
{
value: this.campusConsumerReportInfo.otherAmountF,
value: this.campusConsumerReportInfo.otherAmountF || 0,
name: '其他'
}
],
......@@ -733,13 +754,13 @@
{
type: 'pie',
data: [{
value: 620,
value: this.campusConsumerReportInfo.supermarketAmountF || 0,
},
{
value: 240,
value: this.campusConsumerReportInfo.canteenAmountF || 0,
},
{
value: 100,
value: this.campusConsumerReportInfo.otherAmountF || 0,
}
],
radius: ['69%', '82%'],
......
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