Commit 895b6d07 authored by 袁玲利's avatar 袁玲利

Merge branch 'v_req_0831' into uat

parents b393c02f 00eeff5c
<template> <template>
<view class="AbnormalConsumption"> <view class="AbnormalConsumption">
<view class="exceptionContent"> <view class="" v-if="auth == 'false'">
<div class="orderHeadWrapper">
<img :src="ImgUrl+'wechatXZF/orderHead.png'" class="orderHead" alt="">
</div>
<div class="fixedBottomBtn" @click="openAzMenber">
<img :src="ImgUrl+'wechatXZF/goToCost.png'" class="goToCost" alt="">
</div>
</view>
<view class="exceptionContent" v-else>
<view class="itemBar" v-if="cateringAbnormalGroupList.length"> <view class="itemBar" v-if="cateringAbnormalGroupList.length">
<view class="itemtitle"> <view class="itemtitle">
<image :src="ImgUrl+'user/remind.png'" class="img"> <image :src="ImgUrl+'user/remind.png'" class="img">
...@@ -101,7 +109,24 @@ ...@@ -101,7 +109,24 @@
</view> </view>
</view> </view>
</view> </view>
<view class="tips">【注】根据学校预设的餐标提醒,异常判定仅供参考</view> <view class="tips">
<view class="what">
<image :src="ImgUrl+'wechatXZF/question.png'" class="question">
<view>什么是消费异常提醒?</view>
</view>
<view class="tipBlock">
<view class="dotLine">在校消费超出学校建议范围时触发提醒,结果仅供参考:</view>
<view class="dotLine">
<view class="dot"></view>无就餐记录:餐别范围内无消费记录
</view>
<view class="dotLine">
<view class="dot"></view>就餐时间异常:用餐时间早于/晚于学校的建议范围
</view>
<view class="dotLine">
<view class="dot"></view>就餐金额提醒:餐别消费金额超出学校的建议范围
</view>
</view>
</view>
</view> </view>
<view class="nodatatoday" v-else> <view class="nodatatoday" v-else>
<view class="itemtitle"> <view class="itemtitle">
...@@ -231,122 +256,134 @@ ...@@ -231,122 +256,134 @@
</template> </template>
<script> <script>
// 时间处理模块 // 时间处理模块
import dayjs from 'dayjs' import dayjs from "dayjs";
import { import { Dialog } from "vant";
Dialog let gHost = "https://" + window.location.host;
} from 'vant'; if (window.location.protocol != "https:") {
let gHost = "https://" + window.location.host;
if (window.location.protocol != "https:") {
gHost = "https://dev-az-cloud-api.xiaopay.net"; gHost = "https://dev-az-cloud-api.xiaopay.net";
} }
if (window.location.host == 'fpdev.xiaopay.net') { if (window.location.host == "fpdev.xiaopay.net") {
gHost = "https://dev-az-cloud-api.xiaopay.net"; gHost = "https://dev-az-cloud-api.xiaopay.net";
} }
if (window.location.host == 'uat.xiaopay.net') { if (window.location.host == "uat.xiaopay.net") {
gHost = "https://test-az-cloud-api.xiaopay.net"; gHost = "https://test-az-cloud-api.xiaopay.net";
} }
if (window.location.host == 'pay.xiaopay.net') { if (window.location.host == "pay.xiaopay.net") {
gHost = "https://az-cloud-api.xiaopay.net"; gHost = "https://az-cloud-api.xiaopay.net";
} }
export default { export default {
name: "AbnormalConsumption", name: "AbnormalConsumption",
data() { data() {
return { return {
cateringAbnormalGroupList: [], cateringAbnormalGroupList: [],
ImgUrl: this.$ImgUrl, ImgUrl: this.$ImgUrl,
userInfo: { userInfo: {
name: '' name: "",
} },
auth: "",
}; };
}, },
onLoad(options) { onLoad(options) {
console.warn(options) console.warn(options);
if (!options['schoolId'] || !options['userId']) { this.auth = options.auth;
if (!options["schoolId"] || !options["userId"]) {
Dialog({ Dialog({
title: '温馨提示!', title: "温馨提示!",
message: '学生Id或学校Id为必传参数!', message: "学生Id或学校Id为必传参数!",
confirmButtonText: "知道了" confirmButtonText: "知道了",
}).then(res => { }).then((res) => {
window.close() window.close();
}) });
return; return;
} }
this.userInfo['name'] = options['name'] || '***' this.userInfo["name"] = options["name"] || "***";
// 查询记录 // 查询记录
this.getCateringAbnormalGroupList(options['schoolId'], options['userId']) this.getCateringAbnormalGroupList(options["schoolId"], options["userId"]);
// this.CloudGatewayToken(options['schoolId'], options['userId']) // this.CloudGatewayToken(options['schoolId'], options['userId'])
}, },
methods: { methods: {
// 跳转云平台权益中心
async openAzMenber() {
jWeixin.miniProgram.navigateTo({
url: '/pages/nationalCenterForLesbianRights/index?productId=3'
})
},
// 页面跳转 // 页面跳转
toDoOtherPage() { toDoOtherPage() {
try { try {
my.navigateTo({ my.navigateTo({
url: 'pages/ConsumptIoninfo/ConsumptIoninfo', url: "pages/ConsumptIoninfo/ConsumptIoninfo",
}); });
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '功能升级中!' title: "功能升级中!",
}) });
} }
}, },
// 根据学生id获取用户信息 // 根据学生id获取用户信息
getByStuInfo(studentId, Authorization, AuthOauthToken) { getByStuInfo(studentId, Authorization, AuthOauthToken) {
const header = { const header = {
'Authorization': Authorization || '', Authorization: Authorization || "",
'AuthOauthToken': AuthOauthToken || '', AuthOauthToken: AuthOauthToken || "",
} };
const student1 = this.$http.get({ const student1 = this.$http.get({
// 云平台 // 云平台
url: `${gHost}/cloud-gateway/basic-web/student/${studentId}`, url: `${gHost}/cloud-gateway/basic-web/student/${studentId}`,
header, header,
}) });
const student2 = this.$http.get({ const student2 = this.$http.get({
// 校园 // 校园
url: `${gHost}/cloud-gateway/basic-service/getByAzxyStuId/${studentId}`, url: `${gHost}/cloud-gateway/basic-service/getByAzxyStuId/${studentId}`,
header, header,
}) });
const student3 = this.$http.get({ const student3 = this.$http.get({
// 校智付 // 校智付
url: `${gHost}/cloud-gateway/basic-service/getByXzfStuId/${studentId}`, url: `${gHost}/cloud-gateway/basic-service/getByXzfStuId/${studentId}`,
header, header,
}) });
return Promise.all([student1, student2, student3]) return Promise.all([student1, student2, student3]);
}, },
// 获取云平台网关token // 获取云平台网关token
async CloudGatewayToken(schoolId, userId) { async CloudGatewayToken(schoolId, userId) {
let res = await this.$http.post({ let res = await this.$http.post(
{
url: `${gHost}/cloud-gateway/auth/oauth/token`, url: `${gHost}/cloud-gateway/auth/oauth/token`,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded' "Content-Type": "application/x-www-form-urlencoded",
}, },
}, { },
client_id: '', {
client_secret: '', client_id: "",
grant_type: '' client_secret: "",
}) grant_type: "",
}
);
if (res.code == 200) { if (res.code == 200) {
const Authorization = res.data.tokenHead + res.data const Authorization = res.data.tokenHead + res.data.token;
.token const AuthOauthToken = res.data.token;
const AuthOauthToken = res.data.token uni.setStorageSync("Authorization", Authorization);
uni.setStorageSync('Authorization', Authorization); uni.setStorageSync("AuthOauthToken", AuthOauthToken);
uni.setStorageSync('AuthOauthToken', AuthOauthToken);
// 查询记录 // 查询记录
this.getCateringAbnormalGroupList(schoolId, userId) this.getCateringAbnormalGroupList(schoolId, userId);
// 获取学生信息 // 获取学生信息
const StuInfo = await this.getByStuInfo(userId, Authorization, AuthOauthToken) const StuInfo = await this.getByStuInfo(
userId,
Authorization,
AuthOauthToken
);
for (let s of StuInfo) { for (let s of StuInfo) {
if (s.code == 10000 && s.data) { if (s.code == 10000 && s.data) {
this.userInfo = s.data this.userInfo = s.data;
} }
} }
} else { } else {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '获取云平台token失败!' title: "获取云平台token失败!",
}) });
} }
}, },
// 用户消费异常列表分组信息 // 用户消费异常列表分组信息
...@@ -354,55 +391,143 @@ ...@@ -354,55 +391,143 @@
const params = { const params = {
userId, userId,
schoolId, schoolId,
startDate: dayjs().subtract(30, 'days').format("YYYY-M-DD"), startDate: dayjs().subtract(30, "days").format("YYYY-M-DD"),
endDate: dayjs().format("YYYY-M-DD"), endDate: dayjs().format("YYYY-M-DD"),
} };
try { try {
let data = await this.$http.post({ let data = await this.$http.post(
{
header: { header: {
'Authorization': uni.getStorageSync('Authorization') || '', Authorization: uni.getStorageSync("Authorization") || "",
'AuthOauthToken': uni.getStorageSync('AuthOauthToken') || '', AuthOauthToken: uni.getStorageSync("AuthOauthToken") || "",
'Content-Type': 'application/x-www-form-urlencoded' "Content-Type": "application/x-www-form-urlencoded",
}, },
url: `${gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupList`, url: `${gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupList`,
}, params) },
params
);
if (data.code != 10000) { if (data.code != 10000) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: data.message || '发生异常!' title: data.message || "发生异常!",
}) });
return return;
} }
let res = data.data; let res = data.data;
this.cateringAbnormalGroupList = res; this.cateringAbnormalGroupList = res;
if (res.length) { if (res.length) {
this.lastMeal = new Date(res[0].statisticalDate).getMonth() + 1 + "" + new Date(res[0] this.lastMeal =
.statisticalDate).getDate() + ""; new Date(res[0].statisticalDate).getMonth() +
1 +
"" +
new Date(res[0].statisticalDate).getDate() +
"";
} }
} catch (e) { } catch (e) {
console.warn(e) console.warn(e);
//TODO handle the exception //TODO handle the exception
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: "发生异常错误!" title: "发生异常错误!",
}) });
} }
}, },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.AbnormalConsumption { .orderHeadWrapper {
background: #F0F1F1; width: 100%;
background: #f0f1f1;
display: flex;
flex-direction: column;
padding-top: 24rpx; padding-top: 24rpx;
padding-bottom: 160rpx;
.orderHead {
width: 702rpx;
height: 2275rpx;
margin: 0 auto;
}
}
.fixedBottomBtn {
width: 100%;
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 154rpx;
text-align: center;
.goToCost {
width: 742rpx;
height: 154rpx;
} }
}
.tips {
margin: 0 auto;
margin-top: 24rpx;
width: 622rpx;
height: 218rpx;
background: #f8f8f8;
display: flex;
flex-direction: column;
.exceptionContent { .what {
margin-top: 18rpx;
font-size: 26rpx;
color: rgba(0, 0, 0, 0.85);
height: 37rpx;
line-height: 37rpx;
padding-left: 25rpx;
display: inline-flex;
.question {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
align-self: center;
}
}
.tipBlock {
margin-top: 9rpx;
margin-left: 38rpx;
width: calc(100% - 38rpx);
display: flex;
flex-direction: column;
font-size: 22rpx;
margin-top: 9rpx;
line-height: 34rpx;
color: rgba(0, 0, 0, 0.5);
.dotLine {
height: 34rpx;
display: inline-flex;
.dot {
align-self: center;
width: 7rpx;
height: 7rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.5);
margin-right: 10rpx;
}
}
}
}
.AbnormalConsumption {
background: #f0f1f1;
padding-top: 24rpx;
}
.exceptionContent {
width: 702rpx; width: 702rpx;
height: 100%; height: 100%;
min-height: 100vh; min-height: 100vh;
background: #F0F1F1; background: #f0f1f1;
margin: 0 auto; margin: 0 auto;
// padding: 24rpx 5vw 0; // padding: 24rpx 5vw 0;
// margin-left: -5vw; // margin-left: -5vw;
...@@ -478,7 +603,7 @@ ...@@ -478,7 +603,7 @@
.itemBar { .itemBar {
width: 100%; width: 100%;
background: #FFFFFF; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -501,7 +626,7 @@ ...@@ -501,7 +626,7 @@
.redBlock { .redBlock {
display: inline-block; display: inline-block;
position: relative; position: relative;
color: #EF4034; color: #ef4034;
.line { .line {
position: absolute; position: absolute;
...@@ -524,7 +649,7 @@ ...@@ -524,7 +649,7 @@
margin: 20rpx 40rpx 0 40rpx; margin: 20rpx 40rpx 0 40rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #FCF5F5; background: #fcf5f5;
border-radius: 12rpx; border-radius: 12rpx;
padding-top: 20rpx; padding-top: 20rpx;
padding-bottom: 28rpx; padding-bottom: 28rpx;
...@@ -558,7 +683,7 @@ ...@@ -558,7 +683,7 @@
padding-left: 14rpx; padding-left: 14rpx;
padding-right: 10rpx; padding-right: 10rpx;
border-radius: 5rpx; border-radius: 5rpx;
color: #EF4034; color: #ef4034;
font-size: 28rpx; font-size: 28rpx;
.icon { .icon {
...@@ -608,7 +733,7 @@ ...@@ -608,7 +733,7 @@
} }
} }
.detail+.detail { .detail + .detail {
margin-top: 0; margin-top: 0;
} }
...@@ -621,8 +746,7 @@ ...@@ -621,8 +746,7 @@
.breakfast, .breakfast,
.lunch { .lunch {
// padding-bottom: 28rpx; // padding-bottom: 28rpx;
border-bottom: 1rpx dashed #FFCBC9; border-bottom: 1rpx dashed #ffcbc9;
;
} }
.dinner { .dinner {
...@@ -659,7 +783,7 @@ ...@@ -659,7 +783,7 @@
left: 46rpx; left: 46rpx;
top: 35rpx; top: 35rpx;
width: 1rpx; width: 1rpx;
background: #D2D2D2; background: #d2d2d2;
height: calc(100% + 20rpx); height: calc(100% + 20rpx);
z-index: 1; z-index: 1;
} }
...@@ -671,7 +795,7 @@ ...@@ -671,7 +795,7 @@
} }
} }
.lineBlock+.lineBlock { .lineBlock + .lineBlock {
margin-top: 32rpx; margin-top: 32rpx;
} }
...@@ -691,7 +815,7 @@ ...@@ -691,7 +815,7 @@
width: 12rpx; width: 12rpx;
height: 12rpx; height: 12rpx;
margin-right: 22rpx; margin-right: 22rpx;
background: #EF4034; background: #ef4034;
border-radius: 50%; border-radius: 50%;
align-self: center; align-self: center;
position: relative; position: relative;
...@@ -719,8 +843,6 @@ ...@@ -719,8 +843,6 @@
padding-bottom: 0; padding-bottom: 0;
} }
} }
} }
.more { .more {
...@@ -729,7 +851,7 @@ ...@@ -729,7 +851,7 @@
height: 94rpx; height: 94rpx;
line-height: 94rpx; line-height: 94rpx;
justify-content: center; justify-content: center;
background: #FFFFFF; background: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
font-size: 28rpx; font-size: 28rpx;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
...@@ -742,8 +864,8 @@ ...@@ -742,8 +864,8 @@
.green { .green {
margin-left: 4rpx; margin-left: 4rpx;
font-weight: 500; font-weight: 500;
color: #04B871; color: #04b871;
}
} }
} }
}
</style> </style>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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