Commit a3668b22 authored by 李智书's avatar 李智书

Merge branch 'develop' into uat

parents 72af34ae b74097cf
......@@ -451,6 +451,15 @@
}
}
,{
"path" : "pages/socialmailbox/socialmailbox",
"style" :
{
"navigationStyle": "custom",
"navigationBarTitleText": "匿名投递故事"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
......
......@@ -268,13 +268,14 @@
</view>
<view class="school-report-context-card-eight-details">
<view class="consumer-details-header">
<view v-for="item in consumerDetailsHeaderList" class="consumer-details-header-item">
<view v-for="(item,index) in consumerDetailsHeaderList" :key="index"
class="consumer-details-header-item">
<text>{{item}}</text>
</view>
</view>
<view v-if="isOpen" class="consumer-details-body-box">
<view v-for="(item,index) in campusConsumerDetailObj.campusConsumerDetailList"
class="consumer-details-body"
:key="index" class="consumer-details-body"
:style="{background:Number.isInteger(index/2)?'#FFFFFF':'#F8F8F7'}">
<view class="consumer-details-body-item" v-for="(e,i) in item.consumerDetailsArr"
:class="i?'':'consumer-details-body-data'">
......@@ -286,14 +287,14 @@
<view class="consumer-details-body" style="background: #FFFFFF;">
<view class="consumer-details-body-item"
v-for="(e,i) in campusConsumerDetailObj.campusConsumerDetailList[0].consumerDetailsArr"
:class="i?'':'consumer-details-body-data'">
:key="i" :class="i?'':'consumer-details-body-data'">
<text>{{e}}</text>
</view>
</view>
<view class="consumer-details-body" style="background: #F8F8F7;">
<view class="consumer-details-body-item"
v-for="(e,i) in campusConsumerDetailObj.campusConsumerDetailList[1].consumerDetailsArr"
:class="i?'':'consumer-details-body-data'">
:key="i" :class="i?'':'consumer-details-body-data'">
<text>{{e}}</text>
</view>
</view>
......@@ -313,11 +314,12 @@
v-if="isOpen&&campusConsumerDetailObj.campusConsumerDetailList.length<=7">
</view>
<view v-if="isOpen"
v-for="item in campusConsumerDetailObj.campusConsumerDetailCalculateList"
class="consumer-details-sum">
v-for="(item,index) in campusConsumerDetailObj.campusConsumerDetailCalculateList"
:key="index" class="consumer-details-sum">
<view v-for="(e,i) in item.consumerDetailsSumArr" class="consumer-details-sum-item"
:class="i?'':'consumer-details-sum-type'">
{{e}}
:key="i" :class="i?'':'consumer-details-sum-type'">
<text :style="{color:item.calculateType=='较上月'?trendColorList[i]:''}"> {{e}} </text>
<template v-if="i ==0"><span class="type-unit">{{unitTypeList[index]}}</span></template>
</view>
</view>
</view>
......@@ -444,12 +446,14 @@
class="consume-total">{{consumerAmountObj.gtgraderate}}%</text>的同学<text
v-if="isReasonable">,请及时评估生活费是否合理</text></text> -->
<text v-if="consumerDetailCalculateObj.totalData>0">消费总额<text
class="consume-total">{{livingExpensesAllowance.userConsumeAmount}}</text>元,同比上{{['',''][reportTypeIndex]}}<text
class="consume-total">{{livingExpensesAllowance.userConsumeAmount}}</text><text
v-if="livingExpensesAllowance.gradeAverageAmount>0">,同比上{{['月','周'][reportTypeIndex]}}<text
class="consume-total">{{livingExpensesAllowance.lastMonthRateStr}}
<van-icon :class="livingExpensesAllowance.lastMonthRate>0?'':'livingCostUp'"
<van-icon :class="livingExpensesAllowance.lastMonthRate>0?'livingCostUp':''"
name="down" />
</text>
</text>
</text>
<text v-else>
所选日期内暂无消费
</text>
......@@ -1214,6 +1218,8 @@
cateringNumber: '', // 就餐次数
notCateringNumber: '', //未就餐次数
},
trendColorList: [],
unitTypeList: ['(次)', '(次)', '(元)', '', '(元)'],
// 就餐情况
diningSituations: {
diningSituationsDate: '',
......@@ -1522,7 +1528,6 @@
this.queryConsumerDetail(this.dataRangeArr[this.dataRangeIndex].startDate, this.dataRangeArr[this
.dataRangeIndex].endDate);
this.queryConsumerSummaryAmount();
this.queryLivingCostsAmount();
this.queryIsDredgeMember(1002, 1).then(() => {
if (this.isOpen) {
this.queryConsumerSummaryAmount(1).then(e => this.piechart());
......@@ -1562,7 +1567,6 @@
// })
} else {
this.queryConsumerSummaryAmount();
this.queryLivingCostsAmount();
this.queryDayConsumerTrend();
}
})
......@@ -2593,20 +2597,30 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
})
this.campusConsumerDetailObj.campusConsumerDetailCalculateList.sort(this
.sortCalculateType);
let tmpColorList = [''];
this.campusConsumerDetailObj.campusConsumerDetailCalculateList.forEach((e, index) => {
e.calculateType = ['均值(元)', '较上月', '就餐(次)', '未就餐(次)', '总计(元)'][e
e.calculateType = ['就餐', '未就餐', '均值', '较上月', '总计'][e
.calculateType -
1
];
if (e.calculateType == '较上月') {
for (let item in e) {
if (item != 'calculateType') {
if (e[item] > 0) {
tmpColorList.push('#FA2B00');
} else if (e[item] > 0) {
tmpColorList.push('#00A367');
} else {
tmpColorList.push('');
}
e[item] = e[item] > 0 ? e[item] +
'%↑' : (e[item] < 0 ? e[item].toString().slice(1) + '%↓' :
0);
}
}
}
this.trendColorList = JSON.parse(JSON.stringify(tmpColorList));
e.consumerDetailsSumArr = Object.values(e);
})
if (this.campusConsumerDetailObj.campusConsumerDetailCalculateList[4]) {
......@@ -2618,15 +2632,15 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
this.consumerDetailCalculateObj.totalData = this.campusConsumerDetailObj
.campusConsumerDetailCalculateList[4].totalAmount;
}
if (this.campusConsumerDetailObj.campusConsumerDetailCalculateList[2]) {
if (this.campusConsumerDetailObj.campusConsumerDetailCalculateList[0]) {
// 就餐次数
this.consumerDetailCalculateObj.cateringNumber = this.campusConsumerDetailObj
.campusConsumerDetailCalculateList[2].totalAmount;
.campusConsumerDetailCalculateList[0].totalAmount;
}
if (this.campusConsumerDetailObj.campusConsumerDetailCalculateList[3]) {
if (this.campusConsumerDetailObj.campusConsumerDetailCalculateList[1]) {
// 未就餐次数
this.consumerDetailCalculateObj.notCateringNumber = this.campusConsumerDetailObj
.campusConsumerDetailCalculateList[3].totalAmount;
.campusConsumerDetailCalculateList[1].totalAmount;
}
}
} else if (data.code == 500) { // 暂无消费数据
......@@ -2646,7 +2660,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
this.campusConsumerDetailObj.campusConsumerDetailList = JSON.parse(JSON.stringify(
tmpDetailList));
let tmpCalculatList = [];
let calculateTypeList = ['均值(元)', '较上月', '就餐(次)', '未就餐(次)', '总计(元)'];
let calculateTypeList = ['就餐', '未就餐', '均值', '较上月', '总计'];
calculateTypeList.forEach(e => {
tmpCalculatList.push({
"calculateType": e,
......@@ -2660,6 +2674,13 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
});
this.campusConsumerDetailObj.campusConsumerDetailCalculateList = JSON.parse(JSON.stringify(
tmpCalculatList));
this.trendColorList = ['', '', '', '', '', ''];
this.consumerDetailCalculateObj = {
canteenData: '', // 食堂消费
totalData: '', // 总消费
cateringNumber: '', // 就餐次数
notCateringNumber: '', //未就餐次数
};
} else {
uni.showToast({
icon: "none",
......@@ -2731,7 +2752,7 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
if (obj1.num > obj2.num) {
temp = JSON.parse(JSON.stringify(obj1));
obj1 = JSON.parse(JSON.stringify(obj2));
obj2.num = JSON.parse(JSON.stringify(temp));
obj2 = JSON.parse(JSON.stringify(temp));
}
if (obj2.num > obj3.num) {
temp = JSON.parse(JSON.stringify(obj2));
......@@ -2903,15 +2924,15 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
if (this.consumerAmountObj[0]) {
this.livingExpensesAllowance.userConsumeAmount = this.consumerAmountObj[0]
.livingCostAmount; //本月
this.livingExpensesAllowance.lastMonthRate = this.consumerAmountObj[0].rate;
this.livingExpensesAllowance.lastMonthRateStr = this.consumerAmountObj[0].rate > 0 ? this
.consumerAmountObj[0].rate + '%' : (this.consumerAmountObj[0].rate < 0 ? this
.consumerAmountObj[0].rate.toString()
.slice(1) + '%' : 0 + '%');
}
if (this.consumerAmountObj[1]) {
this.livingExpensesAllowance.gradeAverageAmount = this.consumerAmountObj[1]
.livingCostAmount; //上月
this.livingExpensesAllowance.lastMonthRate = this.consumerAmountObj[1].rate;
this.livingExpensesAllowance.lastMonthRateStr = this.consumerAmountObj[1].rate > 0 ? this
.consumerAmountObj[1].rate + '%' : (this.consumerAmountObj[1].rate < 0 ? this
.consumerAmountObj[1].rate.toString()
.slice(1) + '%' : 0 + '%');
}
if (this.consumerAmountObj[2]) {
this.livingExpensesAllowance.schoolAverageAmount = this.consumerAmountObj[2]
......@@ -5144,7 +5165,8 @@ color: #FF8646;padding:13rpx 12rpx 30rpx 17rpx;`,
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
text-align: left;
display: inline-block;
position: absolute;
}
}
......
<template>
<view class="content" :style="'background-image: url('+ImgUrl2+'background.png);'">
<view class="textareabox">
<textarea v-model="SubmitInfo.messageContent" maxlength="500" :placeholder="placeholder"
placeholder-class="textareaplace" />
</view>
<view class="textareabox2">
<view class="title" v-if="!keyword">
<image :src="ImgUrl2+'remarks.png'" mode="aspectFit"></image>
<text>您可在此备注部分信息</text>
</view>
<view class="title2" v-if="keyword">
<image :src="ImgUrl2+'shuru.png'" mode="aspectFit"></image>
<text>{{keyword}}</text>
</view>
<textarea v-model="SubmitInfo.remark" :placeholder="placeholder2" placeholder-class="textareaplace" />
</view>
<view class="envelope" :style="'background-image: url('+ImgUrl2+'envelope2.png);'">
<image class="toudibtn" @tap="saveOrUpdateMessage" :src="ImgUrl2+'toudi.png'" mode="aspectFit"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
ImgUrl2: this.$ImgUrl + 'social_front/',
ImgUrl: this.$ImgUrl,
placeholder: "写下您想对孩子说的话,或者分享您与孩子之间发生的真实故事。无论对错,您的故事将被认真倾听和尊重,请避免广告、迷信等违规或不适内容。",
placeholder2: "如:父亲/母亲等、孩子就读学校、您的所在地",
// 提交信息
SubmitInfo: {
"bindPhone": "", //微信绑定电话
"classId": 0, //班级id
"className": "", //班级名称
"gradeId": 0, //年级id
"gradeName": "", //年级名称
"messageContent": "", //投稿内容
"openId": "", //微信openid
"remark": "", //投稿备注
"sourceType": 3, //数据来源:0未知、1公众号、2小程序、3H5页面
"studentId": 0, //学生id
"studentName": "", //学生名
"wechatName": "" // 微信名
},
// keyword
keyword:''
}
},
onLoad() {
},
computed: {
keywordMessageContent: function() {
console.log(this.SubmitInfo.messageContent);
return this.SubmitInfo.messageContent.split('').reverse().join('')
}
},
methods: {
// 投递信箱
async saveOrUpdateMessage() {
try {
if (!this.SubmitInfo.messageContent) {
uni.showModal({
title: "温馨提示",
showCancel: false,
content: "请写下您对孩子说的话...",
})
return
}
uni.showLoading({
title: "请稍后",
// #ifndef MP-ALIPAY
mask: true,
// #endif
})
await new Promise((res, rej) => {
setTimeout(() => {
res()
}, 300);
})
let url = `https://dev-az-cloud-api.xiaopay.net`
if (window.location.hostname.includes('uat.xiaopay.net')) {
url = `https://test-az-cloud-api.xiaopay.net`
}
if (window.location.hostname.includes('pay.xiaopay.net')) {
url = `https://az-cloud-api.xiaopay.net`
}
let [err, respes] = await uni.request({
url: url + '/cloud-gateway/social-web/openApi/bmailboxinfo/saveOrUpdateMessage',
method: "POST",
dataType: "json",
data: this.SubmitInfo
})
if (err) {
uni.showToast({
icon: "none",
title: err.errMsg
})
return
}
uni.hideLoading()
if (respes.data.code != "10000") {
uni.showToast({
icon: "none",
title: respes.data.message
})
return
}
uni.showModal({
title: "温馨提示",
showCancel: false,
content: "投递成功!",
success: () => {
this.SubmitInfo = {
"bindPhone": "", //微信绑定电话
"classId": 0, //班级id
"className": "", //班级名称
"gradeId": 0, //年级id
"gradeName": "", //年级名称
"messageContent": "", //投稿内容
"openId": "", //微信openid
"remark": "", //投稿备注
"sourceType": 0, //数据来源:0未知、1公众号、2小程序、3H5页面
"studentId": 0, //学生id
"studentName": "", //学生名
"wechatName": "" // 微信名
}
}
})
} catch (error) {
uni.showToast({
icon: "error",
title: error.message
})
}
}
}
}
</script>
<style scoped>
.content {
width: 100%;
/* height: 100vh; */
height: 1624rpx;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.envelope {
width: 100%;
height: 330rpx;
background-repeat: no-repeat;
background-size: 110% 110%;
position: fixed;
/* margin-bottom: 60rpx; */
background-position: center;
text-align: center;
bottom: 0;
}
.toudibtn {
width: 194rpx;
height: 194rpx;
position: relative;
top: 40rpx;
}
.textareabox,
.textareabox2 {
width: 613rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin: 0 auto;
}
.textareabox2 image {
width: 28rpx;
height: 28rpx;
position: relative;
}
.textareabox {
width: 613rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin: 0 auto;
/* position: absolute;
left: 0;
right: 0;
top: 15%; */
height: 840rpx;
padding-top: 250rpx;
}
.textareabox2 {
width: 613rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin: 0 auto;
height: 200rpx;
/* height: 10vh; */
margin-top: 30rpx;
}
.textareabox2 .title {
display: flex;
align-items: center;
}
.textareabox2 .title2 {
display: flex;
align-items: center;
background-color: rgba(255, 95, 11, 0.1);
border-radius: 24rpx;
padding-left: 18rpx;
}
.title2 text {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FF5F0B !important;
}
.textareabox2 text {
display: inline-block;
margin-left: 13rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.15);
}
textarea {
line-height: 60rpx;
height: 100%;
width: 100%;
}
.textareaplace {
color: rgba(0, 0, 0, 0.15);
line-height: 60rpx;
}
</style>
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