Commit 24216c60 authored by 袁玲利's avatar 袁玲利

换接口地址转发

parent 824c1a4f
...@@ -134,7 +134,9 @@ ...@@ -134,7 +134,9 @@
</view> </view>
<!-- 日历 --> <!-- 日历 -->
<view class="canlendar"> <view class="canlendar">
<Canlendar :currentDate="currentDate" :shareDate_="shareDate" :cateringAbnormalTypeGroupList="cateringAbnormalTypeGroupList" @changeToday="changeToday"></Canlendar> <Canlendar :currentDate="currentDate" :shareDate_="shareDate"
:cateringAbnormalTypeGroupList="cateringAbnormalTypeGroupList" @changeToday="changeToday">
</Canlendar>
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<view class="dining_footer"> <view class="dining_footer">
...@@ -287,10 +289,10 @@ ...@@ -287,10 +289,10 @@
<script> <script>
var gHost = "https://" + window.location.host; var gHost = "https://" + window.location.host;
var gHost1 = "https://" + window.location.host; // var gHost1 = "https://" + window.location.host;
if (window.location.protocol != "https:") { if (window.location.protocol != "https:") {
gHost = "https://fpdev.xiaopay.net"; gHost = "https://fpdev.xiaopay.net";
gHost1 = "https://dev-az-cloud-api.xiaopay.net/" // gHost1 = "https://dev-az-cloud-api.xiaopay.net/"
} }
//获取参数 //获取参数
function getQueryParams(params) { function getQueryParams(params) {
...@@ -313,6 +315,10 @@ ...@@ -313,6 +315,10 @@
Dialog, Dialog,
Toast Toast
} from 'vant'; } from 'vant';
import {
requestGet,
requestPost
} from '../common/request.js'
export default { export default {
name: 'campusReport', name: 'campusReport',
data() { data() {
...@@ -353,7 +359,7 @@ ...@@ -353,7 +359,7 @@
wan: false, wan: false,
}, },
homeDataInfo: {}, homeDataInfo: {},
vipExpiredDt: "", // 有效期 vipExpiredDt: "", // 有效期
} }
}, },
components: { components: {
...@@ -386,13 +392,13 @@ ...@@ -386,13 +392,13 @@
this.currentDate.date = moment(this.dataRangeArr[this.dataRangeIndex].startDate).date() 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.shareDate = moment(this.dataRangeArr[this.dataRangeIndex].startDate).format('YYYY-MM-DD 00:00:00')
this.today.date = (this.currentDate.month + 1) + '月1日' this.today.date = (this.currentDate.month + 1) + '月1日'
console.log(this.currentDate, 'currentDate1111111111111', this.shareDate, 'this.homeDataInfo', this
console.log(this.currentDate, 'currentDate1111111111111', this.shareDate,'this.homeDataInfo', this.homeDataInfo) .homeDataInfo)
}, },
async mounted() { async mounted() {
console.log(this.dataRangeArr, 'dataRangeArr') console.log(this.dataRangeArr, 'dataRangeArr')
this.homeDataInfo = JSON.parse(sessionStorage.getItem('HomeDataInfo')) this.homeDataInfo = JSON.parse(sessionStorage.getItem('HomeDataInfo'))
if(this.homeDataInfo.vipStatus === 1) { if (this.homeDataInfo.vipStatus === 1) {
this.isVip = true; this.isVip = true;
this.vipExpiredDt = moment(this.homeDataInfo.vipExpiredDt).format('YYYY年MM月DD日') this.vipExpiredDt = moment(this.homeDataInfo.vipExpiredDt).format('YYYY年MM月DD日')
console.log(this.vipExpiredDt, 'this.vipExpiredDt') console.log(this.vipExpiredDt, 'this.vipExpiredDt')
...@@ -400,6 +406,7 @@ ...@@ -400,6 +406,7 @@
console.log(this.isVip, 'isVip') console.log(this.isVip, 'isVip')
this.columns = this.dataRangeArr.map(x => x.month) this.columns = this.dataRangeArr.map(x => x.month)
console.log(this.columns, 'columns') console.log(this.columns, 'columns')
// await this.CloudGatewayToken()
await this.getCampusConsumerReport() await this.getCampusConsumerReport()
await this.initPieCharts() await this.initPieCharts()
await this.getCateringAbnormalTypeGroupList() await this.getCateringAbnormalTypeGroupList()
...@@ -436,15 +443,15 @@ ...@@ -436,15 +443,15 @@
}) })
}, },
// 切换日期 // 切换日期
changeToday(today){ changeToday(today) {
this.today.date = (today.month + 1) + '' + today.date + '' this.today.date = (today.month + 1) + '' + today.date + ''
if(Reflect.has(today, 'unrecordedZao')){ if (Reflect.has(today, 'unrecordedZao')) {
this.today.zao = today.unrecordedZao this.today.zao = today.unrecordedZao
} }
if(Reflect.has(today, 'unrecordedWu')){ if (Reflect.has(today, 'unrecordedWu')) {
this.today.wu = today.unrecordedWu this.today.wu = today.unrecordedWu
} }
if(Reflect.has(today, 'unrecordedWan')){ if (Reflect.has(today, 'unrecordedWan')) {
this.today.wan = today.unrecordedWan this.today.wan = today.unrecordedWan
} }
}, },
...@@ -483,7 +490,7 @@ ...@@ -483,7 +490,7 @@
async getCampusConsumerReport() { async getCampusConsumerReport() {
const this_ = this; const this_ = this;
let params = { let params = {
userId: getQueryParams('userId'), //'2882955', userId: getQueryParams('userId'), //'2882955',
schoolId: getQueryParams('schoolId'), //'90118', schoolId: getQueryParams('schoolId'), //'90118',
userType: getQueryParams('userType'), userType: getQueryParams('userType'),
startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_ startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_
...@@ -492,17 +499,15 @@ ...@@ -492,17 +499,15 @@
this_.dataRangeIndex].endDate : "", this_.dataRangeIndex].endDate : "",
timeType: 2, // 时间类型(1按周,2按月) timeType: 2, // 时间类型(1按周,2按月)
statisticalMonth: moment(this_ statisticalMonth: moment(this_
.dataRangeArr[this_.dataRangeIndex].startDate).format('YYYYMM') .dataRangeArr[this_.dataRangeIndex].startDate).format('YYYYMM'),
header: {
'content-type': 'application/x-www-form-urlencoded'
},
}; };
try { try {
let data = await this.$http.post({ let data = await requestPost(
header: { `${gHost}/cgi-xpay/app/ali-app/bill/campusConsumerReport/getCampusConsumerReport`,
'Authorization': uni.getStorageSync('Authorization') || '', params)
'AuthOauthToken': uni.getStorageSync('AuthOauthToken') || '',
'Content-Type': 'application/x-www-form-urlencoded'
},
url: `${gHost1}/cloud-gateway/bill/campusConsumerReport/getCampusConsumerReport`,
}, params)
if (data.code != 10000) { if (data.code != 10000) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
...@@ -533,17 +538,15 @@ ...@@ -533,17 +538,15 @@
startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_ startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_
.dataRangeArr[this_.dataRangeIndex].startDate : "", .dataRangeArr[this_.dataRangeIndex].startDate : "",
endDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_.dataRangeArr[ endDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_.dataRangeArr[
this_.dataRangeIndex].endDate : "" this_.dataRangeIndex].endDate : "",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
}; };
try { try {
let data = await this.$http.post({ let data = await requestPost(
header: { `${gHost}/cgi-xpay/app/ali-app/bill/cateringAbnormal/getCateringAbnormalTypeGroupList`,
'Authorization': uni.getStorageSync('Authorization') || '', params)
'AuthOauthToken': uni.getStorageSync('AuthOauthToken') || '',
'Content-Type': 'application/x-www-form-urlencoded'
},
url: `${gHost1}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalTypeGroupList`,
}, params)
if (data.code != 10000) { if (data.code != 10000) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
...@@ -553,8 +556,11 @@ ...@@ -553,8 +556,11 @@
} }
let res = data.data; let res = data.data;
console.log(res, 'res') console.log(res, 'res')
if(res.length){ if (res.length) {
res = res.map(x => { x.date = moment(x.statisticalDate).date(); return x}) res = res.map(x => {
x.date = moment(x.statisticalDate).date();
return x
})
} }
this.cateringAbnormalTypeGroupList = res; this.cateringAbnormalTypeGroupList = res;
console.log(res, '用户消费未就餐信息') console.log(res, '用户消费未就餐信息')
...@@ -585,17 +591,14 @@ ...@@ -585,17 +591,14 @@
startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_ startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_
.dataRangeArr[this_.dataRangeIndex].startDate : "", .dataRangeArr[this_.dataRangeIndex].startDate : "",
endDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_.dataRangeArr[ endDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_.dataRangeArr[
this_.dataRangeIndex].endDate : "" this_.dataRangeIndex].endDate : "",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
}; };
try { try {
let data = await this.$http.post({ let data = await requestPost(`${gHost}/cgi-xpay/app/ali-app/statement/getUserDealReportListAndSum`,
header: { params)
'Authorization': uni.getStorageSync('Authorization') || '',
'AuthOauthToken': uni.getStorageSync('AuthOauthToken') || '',
'Content-Type': 'application/x-www-form-urlencoded'
},
url: `${gHost1}/cloud-gateway/statement/getUserDealReportListAndSum`,
}, params)
if (data.code != 10000) { if (data.code != 10000) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
......
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