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,519 +256,616 @@ ...@@ -231,519 +256,616 @@
</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; gHost = "https://dev-az-cloud-api.xiaopay.net";
if (window.location.protocol != "https:") { }
gHost = "https://dev-az-cloud-api.xiaopay.net"; if (window.location.host == "fpdev.xiaopay.net") {
} gHost = "https://dev-az-cloud-api.xiaopay.net";
if (window.location.host == 'fpdev.xiaopay.net') { }
gHost = "https://dev-az-cloud-api.xiaopay.net"; if (window.location.host == "uat.xiaopay.net") {
} gHost = "https://test-az-cloud-api.xiaopay.net";
if (window.location.host == 'uat.xiaopay.net') { }
gHost = "https://test-az-cloud-api.xiaopay.net"; if (window.location.host == "pay.xiaopay.net") {
} gHost = "https://az-cloud-api.xiaopay.net";
if (window.location.host == 'pay.xiaopay.net') { }
gHost = "https://az-cloud-api.xiaopay.net"; export default {
} name: "AbnormalConsumption",
export default { data() {
name: "AbnormalConsumption", return {
data() { cateringAbnormalGroupList: [],
return { ImgUrl: this.$ImgUrl,
cateringAbnormalGroupList: [], userInfo: {
ImgUrl: this.$ImgUrl, name: "",
userInfo: { },
name: '' auth: "",
} };
}; },
}, onLoad(options) {
onLoad(options) { console.warn(options);
console.warn(options) this.auth = options.auth;
if (!options['schoolId'] || !options['userId']) { 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: {
// 页面跳转 // 跳转云平台权益中心
toDoOtherPage() { async openAzMenber() {
try { jWeixin.miniProgram.navigateTo({
my.navigateTo({ url: '/pages/nationalCenterForLesbianRights/index?productId=3'
url: 'pages/ConsumptIoninfo/ConsumptIoninfo', })
}); },
} catch (e) { // 页面跳转
//TODO handle the exception toDoOtherPage() {
uni.showToast({ try {
icon: 'none', my.navigateTo({
title: '功能升级中!' url: "pages/ConsumptIoninfo/ConsumptIoninfo",
}) });
} } catch (e) {
}, //TODO handle the exception
// 根据学生id获取用户信息 uni.showToast({
getByStuInfo(studentId, Authorization, AuthOauthToken) { icon: "none",
const header = { title: "功能升级中!",
'Authorization': Authorization || '', });
'AuthOauthToken': AuthOauthToken || '', }
} },
const student1 = this.$http.get({ // 根据学生id获取用户信息
// 云平台 getByStuInfo(studentId, Authorization, AuthOauthToken) {
url: `${gHost}/cloud-gateway/basic-web/student/${studentId}`, const header = {
header, Authorization: Authorization || "",
}) AuthOauthToken: AuthOauthToken || "",
const student2 = this.$http.get({ };
// 校园 const student1 = this.$http.get({
url: `${gHost}/cloud-gateway/basic-service/getByAzxyStuId/${studentId}`, // 云平台
header, url: `${gHost}/cloud-gateway/basic-web/student/${studentId}`,
}) header,
const student3 = this.$http.get({ });
// 校智付 const student2 = this.$http.get({
url: `${gHost}/cloud-gateway/basic-service/getByXzfStuId/${studentId}`, // 校园
header, url: `${gHost}/cloud-gateway/basic-service/getByAzxyStuId/${studentId}`,
}) header,
return Promise.all([student1, student2, student3]) });
}, const student3 = this.$http.get({
// 获取云平台网关token // 校智付
async CloudGatewayToken(schoolId, userId) { url: `${gHost}/cloud-gateway/basic-service/getByXzfStuId/${studentId}`,
let res = await this.$http.post({ header,
url: `${gHost}/cloud-gateway/auth/oauth/token`, });
header: { return Promise.all([student1, student2, student3]);
'Content-Type': 'application/x-www-form-urlencoded' },
}, // 获取云平台网关token
}, { async CloudGatewayToken(schoolId, userId) {
client_id: '', let res = await this.$http.post(
client_secret: '', {
grant_type: '' url: `${gHost}/cloud-gateway/auth/oauth/token`,
}) header: {
if (res.code == 200) { "Content-Type": "application/x-www-form-urlencoded",
const Authorization = res.data.tokenHead + res.data },
.token },
const AuthOauthToken = res.data.token {
uni.setStorageSync('Authorization', Authorization); client_id: "",
uni.setStorageSync('AuthOauthToken', AuthOauthToken); client_secret: "",
// 查询记录 grant_type: "",
this.getCateringAbnormalGroupList(schoolId, userId) }
// 获取学生信息 );
const StuInfo = await this.getByStuInfo(userId, Authorization, AuthOauthToken) if (res.code == 200) {
for (let s of StuInfo) { const Authorization = res.data.tokenHead + res.data.token;
if (s.code == 10000 && s.data) { const AuthOauthToken = res.data.token;
this.userInfo = s.data uni.setStorageSync("Authorization", Authorization);
} uni.setStorageSync("AuthOauthToken", AuthOauthToken);
} // 查询记录
} else { this.getCateringAbnormalGroupList(schoolId, userId);
uni.showToast({ // 获取学生信息
icon: 'none', const StuInfo = await this.getByStuInfo(
title: '获取云平台token失败!' userId,
}) Authorization,
} AuthOauthToken
}, );
// 用户消费异常列表分组信息 for (let s of StuInfo) {
async getCateringAbnormalGroupList(schoolId, userId) { if (s.code == 10000 && s.data) {
const params = { this.userInfo = s.data;
userId, }
schoolId, }
startDate: dayjs().subtract(30, 'days').format("YYYY-M-DD"), } else {
endDate: dayjs().format("YYYY-M-DD"), uni.showToast({
} icon: "none",
try { title: "获取云平台token失败!",
let data = await this.$http.post({ });
header: { }
'Authorization': uni.getStorageSync('Authorization') || '', },
'AuthOauthToken': uni.getStorageSync('AuthOauthToken') || '', // 用户消费异常列表分组信息
'Content-Type': 'application/x-www-form-urlencoded' async getCateringAbnormalGroupList(schoolId, userId) {
}, const params = {
url: `${gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupList`, userId,
}, params) schoolId,
if (data.code != 10000) { startDate: dayjs().subtract(30, "days").format("YYYY-M-DD"),
uni.showToast({ endDate: dayjs().format("YYYY-M-DD"),
icon: 'none', };
title: data.message || '发生异常!' try {
}) let data = await this.$http.post(
return {
} header: {
let res = data.data; Authorization: uni.getStorageSync("Authorization") || "",
this.cateringAbnormalGroupList = res; AuthOauthToken: uni.getStorageSync("AuthOauthToken") || "",
if (res.length) { "Content-Type": "application/x-www-form-urlencoded",
this.lastMeal = new Date(res[0].statisticalDate).getMonth() + 1 + "" + new Date(res[0] },
.statisticalDate).getDate() + ""; url: `${gHost}/cloud-gateway/bill/cateringAbnormal/getCateringAbnormalGroupList`,
} },
} catch (e) { params
console.warn(e) );
//TODO handle the exception if (data.code != 10000) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: "发生异常错误!" title: data.message || "发生异常!",
}) });
} return;
}, }
} let res = data.data;
} this.cateringAbnormalGroupList = res;
if (res.length) {
this.lastMeal =
new Date(res[0].statisticalDate).getMonth() +
1 +
"" +
new Date(res[0].statisticalDate).getDate() +
"";
}
} catch (e) {
console.warn(e);
//TODO handle the exception
uni.showToast({
icon: "none",
title: "发生异常错误!",
});
}
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
.AbnormalConsumption { .orderHeadWrapper {
background: #F0F1F1; width: 100%;
padding-top: 24rpx; background: #f0f1f1;
} display: flex;
flex-direction: column;
.exceptionContent { padding-top: 24rpx;
width: 702rpx; padding-bottom: 160rpx;
height: 100%;
min-height: 100vh; .orderHead {
background: #F0F1F1; width: 702rpx;
margin: 0 auto; height: 2275rpx;
// padding: 24rpx 5vw 0; margin: 0 auto;
// margin-left: -5vw; }
}
.nodatatoday {
display: flex; .fixedBottomBtn {
flex-direction: column; width: 100%;
background: white; position: fixed;
margin-bottom: 34rpx; left: 0;
border-radius: 16rpx; right: 0;
bottom: 0;
.nodataimg { height: 154rpx;
width: 100%; text-align: center;
height: 254rpx;
display: flex; .goToCost {
justify-content: center; width: 742rpx;
margin-top: 120rpx; height: 154rpx;
}
.nodata { }
width: 501rpx; .tips {
height: 254rpx; margin: 0 auto;
} margin-top: 24rpx;
} width: 622rpx;
height: 218rpx;
.tip { background: #f8f8f8;
display: flex; display: flex;
width: 100%; flex-direction: column;
justify-content: center;
height: 40rpx; .what {
font-size: 28rpx; margin-top: 18rpx;
color: rgba(0, 0, 0, 0.45); font-size: 26rpx;
line-height: 40rpx; color: rgba(0, 0, 0, 0.85);
padding-bottom: 84rpx; height: 37rpx;
} line-height: 37rpx;
} padding-left: 25rpx;
display: inline-flex;
.nodatatoday1 {
.nodataimg { .question {
margin-top: 130rpx; width: 24rpx;
height: 24rpx;
.nodata1 { margin-right: 8rpx;
width: 500rpx; align-self: center;
height: 232rpx; }
} }
}
} .tipBlock {
margin-top: 9rpx;
.itemtitle { margin-left: 38rpx;
width: 100%; width: calc(100% - 38rpx);
height: 43rpx; display: flex;
display: flex; flex-direction: column;
justify-content: center; font-size: 22rpx;
margin-top: 40rpx; margin-top: 9rpx;
position: relative; line-height: 34rpx;
margin-bottom: 45rpx; color: rgba(0, 0, 0, 0.5);
.img { .dotLine {
width: 232rpx; height: 34rpx;
height: 43rpx; display: inline-flex;
}
.dot {
.subTitle { align-self: center;
position: absolute; width: 7rpx;
left: 50%; height: 7rpx;
top: 46rpx; border-radius: 50%;
transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.5);
font-weight: 500; margin-right: 10rpx;
font-size: 34rpx; }
height: 48rpx; }
line-height: 48rpx; }
} }
} .AbnormalConsumption {
background: #f0f1f1;
.itemBar { padding-top: 24rpx;
width: 100%; }
background: #FFFFFF;
border-radius: 16rpx; .exceptionContent {
display: flex; width: 702rpx;
flex-direction: column; height: 100%;
margin-bottom: 24rpx; min-height: 100vh;
padding-bottom: 32rpx; background: #f0f1f1;
margin: 0 auto;
.record { // padding: 24rpx 5vw 0;
font-size: 28rpx; // margin-left: -5vw;
color: rgba(0, 0, 0, 0.85);
line-height: 40rpx; .nodatatoday {
display: flex; display: flex;
flex-wrap: wrap; flex-direction: column;
padding: 0 28rpx; background: white;
margin-bottom: 34rpx;
p { border-radius: 16rpx;
display: flex;
flex-wrap: wrap; .nodataimg {
} width: 100%;
height: 254rpx;
.redBlock { display: flex;
display: inline-block; justify-content: center;
position: relative; margin-top: 120rpx;
color: #EF4034;
.nodata {
.line { width: 501rpx;
position: absolute; height: 254rpx;
left: 0; }
top: calc(100% - 10rpx); }
width: 100%;
height: 5rpx; .tip {
background: rgba(239, 64, 52, 0.14); display: flex;
display: block; width: 100%;
} justify-content: center;
} height: 40rpx;
font-size: 28rpx;
.ml8 { color: rgba(0, 0, 0, 0.45);
margin-left: 8rpx; line-height: 40rpx;
} padding-bottom: 84rpx;
} }
} }
.mealBar { .nodatatoday1 {
margin: 20rpx 40rpx 0 40rpx; .nodataimg {
display: flex; margin-top: 130rpx;
flex-direction: column;
background: #FCF5F5; .nodata1 {
border-radius: 12rpx; width: 500rpx;
padding-top: 20rpx; height: 232rpx;
padding-bottom: 28rpx; }
}
.meal { }
display: flex;
margin-top: 13rpx; .itemtitle {
padding-bottom: 16rpx; width: 100%;
height: 43rpx;
.left { display: flex;
width: 88rpx; justify-content: center;
padding-right: 24rpx; margin-top: 40rpx;
line-height: 44rpx; position: relative;
font-weight: 500; margin-bottom: 45rpx;
color: rgba(0, 0, 0, 0.85);
font-size: 28rpx; .img {
text-align: right; width: 232rpx;
} height: 43rpx;
}
.right {
flex: 1; .subTitle {
display: flex; position: absolute;
flex-wrap: wrap; left: 50%;
top: 46rpx;
.banner { transform: translate(-50%, -50%);
display: flex; font-weight: 500;
width: auto; font-size: 34rpx;
height: 44rpx; height: 48rpx;
line-height: 44rpx; line-height: 48rpx;
background: rgba(239, 64, 52, 0.09); }
padding-left: 14rpx; }
padding-right: 10rpx;
border-radius: 5rpx; .itemBar {
color: #EF4034; width: 100%;
font-size: 28rpx; background: #ffffff;
border-radius: 16rpx;
.icon { display: flex;
align-self: center; flex-direction: column;
margin-right: 4rpx; margin-bottom: 24rpx;
} padding-bottom: 32rpx;
.icon1 { .record {
width: 29rpx; font-size: 28rpx;
height: 24rpx; color: rgba(0, 0, 0, 0.85);
} line-height: 40rpx;
display: flex;
.icon2 { flex-wrap: wrap;
width: 26rpx; padding: 0 28rpx;
height: 25rpx;
} p {
display: flex;
.icon3 { flex-wrap: wrap;
width: 25rpx; }
height: 25rpx;
} .redBlock {
} display: inline-block;
position: relative;
.mt20 { color: #ef4034;
margin-top: 20rpx;
} .line {
position: absolute;
.detail { left: 0;
width: 100%; top: calc(100% - 10rpx);
display: flex; width: 100%;
height: 37rpx; height: 5rpx;
margin-bottom: 10rpx; background: rgba(239, 64, 52, 0.14);
margin-top: 16rpx; display: block;
}
text { }
margin-right: 12rpx;
color: rgba(0, 0, 0, 0.85); .ml8 {
font-size: 26rpx; margin-left: 8rpx;
line-height: 37rpx; }
} }
}
text:nth-child(2) {
max-width: 180rpx; .mealBar {
overflow: hidden; margin: 20rpx 40rpx 0 40rpx;
white-space: nowrap; display: flex;
text-overflow: ellipsis; flex-direction: column;
} background: #fcf5f5;
} border-radius: 12rpx;
padding-top: 20rpx;
.detail+.detail { padding-bottom: 28rpx;
margin-top: 0;
} .meal {
display: flex;
.detail:last-child { margin-top: 13rpx;
margin-bottom: 4rpx; padding-bottom: 16rpx;
}
} .left {
} width: 88rpx;
padding-right: 24rpx;
.breakfast, line-height: 44rpx;
.lunch { font-weight: 500;
// padding-bottom: 28rpx; color: rgba(0, 0, 0, 0.85);
border-bottom: 1rpx dashed #FFCBC9; font-size: 28rpx;
; text-align: right;
} }
.dinner { .right {
padding-top: 21rpx; flex: 1;
padding-bottom: 32rpx; display: flex;
} flex-wrap: wrap;
.meal:last-child { .banner {
padding-bottom: 0; display: flex;
border-bottom: 0; width: auto;
} height: 44rpx;
} line-height: 44rpx;
background: rgba(239, 64, 52, 0.09);
.tips { padding-left: 14rpx;
padding: 16rpx 50rpx 0 50rpx; padding-right: 10rpx;
height: 30rpx; border-radius: 5rpx;
font-size: 22rpx; color: #ef4034;
color: rgba(0, 0, 0, 0.5); font-size: 28rpx;
line-height: 30rpx;
} .icon {
align-self: center;
.lastBar { margin-right: 4rpx;
width: 100%; }
display: flex;
.icon1 {
.lineBlock { width: 29rpx;
width: 100%; height: 24rpx;
display: flex; }
flex-direction: column;
position: relative; .icon2 {
width: 26rpx;
.leftLine { height: 25rpx;
position: absolute; }
left: 46rpx;
top: 35rpx; .icon3 {
width: 1rpx; width: 25rpx;
background: #D2D2D2; height: 25rpx;
height: calc(100% + 20rpx); }
z-index: 1; }
}
} .mt20 {
margin-top: 20rpx;
.lineBlock:last-child { }
.leftLine {
height: 0; .detail {
} width: 100%;
} display: flex;
height: 37rpx;
.lineBlock+.lineBlock { margin-bottom: 10rpx;
margin-top: 32rpx; margin-top: 16rpx;
}
text {
.week { margin-right: 12rpx;
display: flex; color: rgba(0, 0, 0, 0.85);
height: 56rpx; font-size: 26rpx;
font-size: 44rpx; line-height: 37rpx;
font-weight: 500; }
color: rgba(0, 0, 0, 0.85);
padding-left: 40rpx; text:nth-child(2) {
max-width: 180rpx;
view { overflow: hidden;
align-self: flex-end; white-space: nowrap;
} text-overflow: ellipsis;
}
.dot { }
width: 12rpx;
height: 12rpx; .detail + .detail {
margin-right: 22rpx; margin-top: 0;
background: #EF4034; }
border-radius: 50%;
align-self: center; .detail:last-child {
position: relative; margin-bottom: 4rpx;
z-index: 2; }
} }
}
view:last-child {
margin-left: 15rpx; .breakfast,
color: rgba(0, 0, 0, 0.85); .lunch {
font-size: 24rpx; // padding-bottom: 28rpx;
font-weight: 400; border-bottom: 1rpx dashed #ffcbc9;
} }
}
.dinner {
.mealBar { padding-top: 21rpx;
margin: 20rpx 48rpx 0 76rpx; padding-bottom: 32rpx;
position: relative; }
.breakfast, .meal:last-child {
.lunch { padding-bottom: 0;
border-bottom: 0; border-bottom: 0;
} }
}
.lunch {
padding-bottom: 0; .tips {
} padding: 16rpx 50rpx 0 50rpx;
} height: 30rpx;
font-size: 22rpx;
color: rgba(0, 0, 0, 0.5);
} line-height: 30rpx;
}
.more {
width: 100%; .lastBar {
display: inline-flex; width: 100%;
height: 94rpx; display: flex;
line-height: 94rpx;
justify-content: center; .lineBlock {
background: #FFFFFF; width: 100%;
border-radius: 16rpx; display: flex;
font-size: 28rpx; flex-direction: column;
color: rgba(0, 0, 0, 0.85); position: relative;
margin-bottom: 24rpx;
.leftLine {
.ml15 { position: absolute;
margin-left: 15rpx; left: 46rpx;
} top: 35rpx;
width: 1rpx;
.green { background: #d2d2d2;
margin-left: 4rpx; height: calc(100% + 20rpx);
font-weight: 500; z-index: 1;
color: #04B871; }
} }
}
} .lineBlock:last-child {
.leftLine {
height: 0;
}
}
.lineBlock + .lineBlock {
margin-top: 32rpx;
}
.week {
display: flex;
height: 56rpx;
font-size: 44rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
padding-left: 40rpx;
view {
align-self: flex-end;
}
.dot {
width: 12rpx;
height: 12rpx;
margin-right: 22rpx;
background: #ef4034;
border-radius: 50%;
align-self: center;
position: relative;
z-index: 2;
}
view:last-child {
margin-left: 15rpx;
color: rgba(0, 0, 0, 0.85);
font-size: 24rpx;
font-weight: 400;
}
}
.mealBar {
margin: 20rpx 48rpx 0 76rpx;
position: relative;
.breakfast,
.lunch {
border-bottom: 0;
}
.lunch {
padding-bottom: 0;
}
}
}
.more {
width: 100%;
display: inline-flex;
height: 94rpx;
line-height: 94rpx;
justify-content: center;
background: #ffffff;
border-radius: 16rpx;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 24rpx;
.ml15 {
margin-left: 15rpx;
}
.green {
margin-left: 4rpx;
font-weight: 500;
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