Commit 585708cc authored by 袁玲利's avatar 袁玲利

校园报告

parent c653188d
......@@ -4,7 +4,7 @@
<div class="orderHeadWrapper">
<img :src="ImgUrl+'wechatXZF/orderHead.png'" class="orderHead" alt="">
</div>
<div class="fixedBottomBtn" @click="openAzMenber">
<div class="fixedBottomBtn" @click="openAzMenber_">
<img :src="ImgUrl+'wechatXZF/goToCost.png'" class="goToCost" alt="">
</div>
</view>
......@@ -260,17 +260,30 @@
import dayjs from "dayjs";
import { Dialog } from "vant";
let gHost = "https://" + window.location.host;
var azAppId = 'wx5decb3fc29c94953'
if (window.location.protocol != "https:") {
gHost = "https://test-az-cloud-api.xiaopay.net";
gHost = "https://uat-pay.xiaopay.net";
azAppId = 'wx008a4a07f3d9f7a7'
}
let az_gHost = "https://" + window.location.host;
if (window.location.protocol != "https:") {
az_gHost = "https://uat-az-cloud-api.xiaopay.net";
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "fpdev.xiaopay.net") {
gHost = "https://dev-az-cloud-api.xiaopay.net";
az_gHost = "https://dev-az-cloud-api.xiaopay.net";
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "uat.xiaopay.net" || window.location.host == "uat-pay.xiaopay.net") {
gHost = "https://uat-az-cloud-api.xiaopay.net";
if (
window.location.host == "uat.xiaopay.net" ||
window.location.host == "uat-pay.xiaopay.net"
) {
az_gHost = "https://uat-az-cloud-api.xiaopay.net";
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "pay.xiaopay.net") {
gHost = "https://az-cloud-api.xiaopay.net";
az_gHost = "https://az-cloud-api.xiaopay.net";
azAppId = 'wx5decb3fc29c94953'
}
export default {
name: "AbnormalConsumption",
......@@ -304,9 +317,48 @@ export default {
},
methods: {
// 跳转云平台权益中心
async openAzMenber() {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index?productId=3'
// async openAzMenber() {
// jWeixin.miniProgram.navigateTo({
// url: '/pages/nationalCenterForLesbianRights/index?productId=3'
// })
// },
// 跳转云平台权益中心-支付宝
async openAzMenber_() {
// const AuthOauthToken = await this.$getAuthOauthToken(this.currentSwiperInfo['id'])
let AuthOauthToken = await this.$http.post(
{
url: az_gHost + "/cgi-xpay/app/user/GetUserLoginCode",
},
{
accountId: getQueryParams("accountId")
}
);
if (!AuthOauthToken) {
uni.showToast({
icon: "none",
title: '没有获取到云平台凭证!'
})
return
}
const path =
`pages/sys/quickLogin/quickLogin?AuthOauthToken=${AuthOauthToken}&origin='XZF'&productId=[3,4,7]&to=${encodeURIComponent('/pages/nationalCenterForLesbianRights/index')}`;
console.warn('跳转云平台参数', path);
uni.navigateToMiniProgram({
// 安智云校小程序
appId: azAppId,
path: path,
query: {
AuthOauthToken: AuthOauthToken,
origin: "XZF",
to: encodeURIComponent('/pages/nationalCenterForLesbianRights/index')
},
success: (res) => {},
fail: (fail) => {
uni.showToast({
icon: "none",
title: '您已取消'
})
}
})
},
// 页面跳转
......
......@@ -1262,7 +1262,10 @@
</view>
</view>
<view class="school-report-footer-item-two">
<view class="school-report-footer-item-btn" @tap="equityPay">
<view class="school-report-footer-item-btn" @tap="openAzMenber" v-if="from == 'wechat'">
<text>延长权益</text>
</view>
<view class="school-report-footer-item-btn" @tap="openAzMenber_" v-else-if="from == 'alipay'">
<text>延长权益</text>
</view>
</view>
......@@ -1521,21 +1524,36 @@
// import html2cancas from "html2canvas"
import { requestPost } from "../ApplyConsumption/common/request.js";
var gHost = "https://" + window.location.host;
var envVersion = 'release';
var azAppId = 'wx5decb3fc29c94953'
if (window.location.protocol != "https:") {
gHost = "https://uat-pay.xiaopay.net";
envVersion = 'trial';
azAppId = 'wx008a4a07f3d9f7a7'
}
let az_gHost = "https://" + window.location.host;
if (window.location.protocol != "https:") {
az_gHost = "https://uat-az-cloud-api.xiaopay.net";
envVersion = 'trial';
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "fpdev.xiaopay.net") {
az_gHost = "https://dev-az-cloud-api.xiaopay.net";
envVersion = 'trial';
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "uat.xiaopay.net" || window.location.host == "uat-pay.xiaopay.net") {
if (
window.location.host == "uat.xiaopay.net" ||
window.location.host == "uat-pay.xiaopay.net"
) {
az_gHost = "https://uat-az-cloud-api.xiaopay.net";
envVersion = 'trial';
azAppId = 'wx008a4a07f3d9f7a7'
}
if (window.location.host == "pay.xiaopay.net") {
az_gHost = "https://az-cloud-api.xiaopay.net";
envVersion = 'release';
azAppId = 'wx5decb3fc29c94953'
}
//获取参数
function getQueryParams(params) {
......@@ -1722,7 +1740,7 @@ export default {
},
async mounted() {
await this.init();
this.piechart()
this.piechart();
},
methods: {
async init() {
......@@ -1820,7 +1838,6 @@ export default {
);
await this.queryConsumerSummaryAmount(1);
this.queryLivingCostsAmount();
// this.queryDayConsumerTrend(1).then((e) =>
// // this.linechart(this.reportTypeIndex)
......@@ -1927,7 +1944,7 @@ export default {
// if (this.isOpen) {
// if (true) {
await this.queryConsumerSummaryAmount(1);
this.piechart()
this.piechart();
this.queryLivingCostsAmount();
// this.queryDayConsumerTrend(1).then((e) =>
......@@ -2063,12 +2080,17 @@ export default {
});
},
shareHandler: function () {
uni.showLoading({
title: "请稍后",
mask: true,
});
let htmlCanvasImg = document.getElementsByClassName("htmlCanvasImg")[0];
if (htmlCanvasImg) {
htmlCanvasImg.parentNode.removeChild(htmlCanvasImg);
}
this.toImage();
this.dialogShow = true;
uni.hideLoading();
},
schoolReportChange: function (e) {
this.reportTypeIndex = e.target.value;
......@@ -2297,7 +2319,11 @@ export default {
},
piechart() {
this.$nextTick(() => {
console.log(document.getElementById("consumer-preferences-pie"), 'xxxxxxxxxxxxxxxxxxxxxx', this.pieDatas);
console.log(
document.getElementById("consumer-preferences-pie"),
"xxxxxxxxxxxxxxxxxxxxxx",
this.pieDatas
);
let arr = this.pieDatas;
let myChart = echarts.init(
document.getElementById("consumer-preferences-pie")
......@@ -2336,8 +2362,7 @@ export default {
window.addEventListener("resize", function () {
myChart.resize();
});
})
});
},
// 获取某月的所有周六
getMonthSaturdayDate: function (year, month) {
......@@ -3253,14 +3278,14 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
if (data.code == 200) {
this.campusConsumerDetailObj = {}
this.campusConsumerDetailObj.campusConsumerDetailList = []
this.trendColorList = []
this.consumerDetailCalculateObj.canteenData = 0
this.consumerDetailCalculateObj.totalData = 0
this.consumerDetailCalculateObj.cateringNumber = 0
this.consumerDetailCalculateObj.notCateringNumber = 0
if(!data.obj){
this.campusConsumerDetailObj = {};
this.campusConsumerDetailObj.campusConsumerDetailList = [];
this.trendColorList = [];
this.consumerDetailCalculateObj.canteenData = 0;
this.consumerDetailCalculateObj.totalData = 0;
this.consumerDetailCalculateObj.cateringNumber = 0;
this.consumerDetailCalculateObj.notCateringNumber = 0;
if (!data.obj) {
return;
}
if (
......@@ -3596,7 +3621,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
],
];
}
this.$forceUpdate()
this.$forceUpdate();
// this.consumerAmountObj = tmpObj;
// this.isReasonable = this.consumerAmountObj.gtgraderate >= 40 && this
// .consumerAmountObj.gtgraderate <=
......@@ -3744,8 +3769,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
obj.mealTypeTotalAmount =
obj.mealTypeTotalAmount + arr[4].mealTypeTotalAmount;
obj.gradeMealTypeTotalAmount =
obj.gradeMealTypeTotalAmount +
arr[4].gradeMealTypeTotalAmount;
obj.gradeMealTypeTotalAmount + arr[4].gradeMealTypeTotalAmount;
obj.schoolMealTypeTotalAmount =
obj.schoolMealTypeTotalAmount +
arr[4].schoolMealTypeTotalAmount;
......@@ -3757,8 +3781,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
obj.mealTypeTotalAmount =
obj.mealTypeTotalAmount + arr[3].mealTypeTotalAmount;
obj.gradeMealTypeTotalAmount =
obj.gradeMealTypeTotalAmount +
arr[3].gradeMealTypeTotalAmount;
obj.gradeMealTypeTotalAmount + arr[3].gradeMealTypeTotalAmount;
obj.schoolMealTypeTotalAmount =
obj.schoolMealTypeTotalAmount +
arr[3].schoolMealTypeTotalAmount;
......@@ -3769,7 +3792,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
newArr.push(nullObj);
}
this.consumerAmountObj.campusMealTypeConsumerSummaryList = newArr;
console.log(this.consumerAmountObj.campusMealTypeConsumerSummaryList)
console.log(this.consumerAmountObj.campusMealTypeConsumerSummaryList);
// } else {
// this.consumerAmountObj.campusMealTypeConsumerSummaryList = [];
// }
......@@ -4372,10 +4395,15 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
}
);
if (data["code"] != 200) {
await Dialog({
title: "温馨提示",
message: data["message"],
confirmButtonText: "知道了",
// await Dialog({
// title: "温馨提示",
// message: data["message"],
// confirmButtonText: "知道了",
// });
uni.showToast({
icon: "none",
mask: true,
title: data.message,
});
return;
}
......@@ -4438,23 +4466,115 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
// });
}
},
equityPay: function () {
// jWeixin.miniProgram.switchTab({
// url: `/pages/Member/main`,
// success: function success() {
// console.log("skip success");
// },
// fail: function fail(_fail) {
// console.warn(_fail);
// uni.showModal({
// content: JSON.stringify(_fail),
// });
// },
// });
jWeixin.miniProgram.navigateTo({
url: "/pages/nationalCenterForLesbianRights/index?productId=3",
// 获取云平台鉴权Token
async getAuthOauthToken() {
uni.showLoading({
title: "请稍后",
mask: true,
});
let respes = await this.$http.post(
{
url: gHost + "/wechat/svweapp/GetUserLoginCode",
},
{}
);
// let respes = await this.$httpWX.post({
// url: `/wechat/svweapp/GetUserLoginCode`
// }, {})
console.log(respes);
uni.hideLoading();
if (respes.code != "10000") {
uni.showToast({
icon: "none",
title: respes.message,
});
throw respes.message;
}
return respes.results.token;
},
// 跳转云平台权益中心-微信
async openAzMenber() {
let AuthOauthToken = await this.getAuthOauthToken();
let path = `pages/sys/quickLogin/quickLogin?AuthOauthToken=${AuthOauthToken}&origin='XZF'&productId=3&serviceItemCodeList=${JSON.stringify(
["1008"]
)}&to=${encodeURIComponent(
"/pages/nationalCenterForLesbianRights/index"
)}&productId=[3,4,7]`;
uni.navigateToMiniProgram({
// 安智云校小程序
appId: azAppId,
path: path,
query: {
AuthOauthToken: AuthOauthToken,
origin: "XZF",
to: encodeURIComponent("/pages/nationalCenterForLesbianRights/index"),
},
envVersion: envVersion,
success: (res) => {},
fail: (fail) => {
uni.showToast({
icon: "none",
title: "您已取消",
});
},
});
},
// 跳转云平台权益中心-支付宝
async openAzMenber_() {
// const AuthOauthToken = await this.$getAuthOauthToken(this.currentSwiperInfo['id'])
let AuthOauthToken = await this.$http.post(
{
url: az_gHost + "/cgi-xpay/app/user/GetUserLoginCode",
},
{
accountId: getQueryParams("accountId")
}
);
if (!AuthOauthToken) {
uni.showToast({
icon: "none",
title: '没有获取到云平台凭证!'
})
return
}
const path =
`pages/sys/quickLogin/quickLogin?AuthOauthToken=${AuthOauthToken}&origin='XZF'&productId=[3,4,7]&to=${encodeURIComponent('/pages/nationalCenterForLesbianRights/index')}`;
console.warn('跳转云平台参数', path);
uni.navigateToMiniProgram({
// 安智云校小程序
appId: azAppId,
path: path,
query: {
AuthOauthToken: AuthOauthToken,
origin: "XZF",
to: encodeURIComponent('/pages/nationalCenterForLesbianRights/index')
},
success: (res) => {},
fail: (fail) => {
uni.showToast({
icon: "none",
title: '您已取消'
})
}
})
},
// equityPay: function () {
// // jWeixin.miniProgram.switchTab({
// // url: `/pages/Member/main`,
// // success: function success() {
// // console.log("skip success");
// // },
// // fail: function fail(_fail) {
// // console.warn(_fail);
// // uni.showModal({
// // content: JSON.stringify(_fail),
// // });
// // },
// // });
// jWeixin.miniProgram.navigateTo({
// url: "/pages/nationalCenterForLesbianRights/index?productId=3",
// });
// },
imageClick: function (src) {
this.imageDialogSrc = src;
this.imageDialogShow = true;
......@@ -4574,12 +4694,13 @@ uni-page-wrapper {
background: no-repeat center/100%
url(https://xiaopay2020.oss-cn-shenzhen.aliyuncs.com/static/weapp/SchoolReport/costReportIMG7.png);
position: relative;
margin-top: -80rpx;
}
.school-report-header-position {
width: 100%;
height: 120rpx;
padding: 200rpx 0 0 32rpx;
padding: 40rpx 0 0 32rpx;
box-sizing: border-box;
position: fixed;
top: 0;
......@@ -5918,7 +6039,7 @@ uni-page-wrapper {
}
.school-report-context-card-three {
height: 526rpx;
height: 600rpx;
background: #ffffff;
border-radius: 16rpx;
margin-bottom: 40rpx;
......@@ -5950,7 +6071,7 @@ uni-page-wrapper {
#consumer-preferences-pie {
height: 385rpx;
top: -60rpx;
top: -30rpx;
z-index: 100;
}
}
......
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