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

换接口地址转发

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