Commit 24d28a68 authored by 李智书's avatar 李智书

1.修改周消费报告页面

parent 2e811de2
<template> <template>
<view class="container"> <view class="container">
<!-- 头部背景图 -->
<view class="headerImg">
<image src="../../static/images/header.png" mode="aspectFit"></image>
</view>
<view class="bgmbox"> <view class="bgmbox">
<!-- 头部背景图 -->
<view class="headerImg">
<image src="../../static/images/header.png" mode="aspectFit"></image>
</view>
<!-- 班级汇总选择切换 --> <!-- 班级汇总选择切换 -->
<picker class="classpicker" @change="bindPickerChange" :value="index" :range="array" range-key="Name"> <picker class="classpicker" @change="bindPickerChange" :value="index" :range="array" range-key="Name">
<view class="selectClass" @click="selectReport"> <view class="selectClass" @click="selectReport">
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
}], }],
index: 0, index: 0,
time: '12:01', time: '12:01',
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJwZW5nemhpbG9uZyIsImNvcnBJZCI6Ind3NGY1ZjRkMzgwYjYwYjMzNCIsInNjaG9vbElkIjoxLCJ1c2VyVHlwZSI6MywiZXhwIjoxNzA3MDM3NDQ2LCJpc3MiOiJhZG1pbiIsIm5iZiI6MTYyMDYzNjQ0Nn0.GnvWd800Zi1rKUEDjNgnqmjmSsKyS7n21_wFBwzyZwI", token: "",
weekid: -1, weekid: -1,
consume_prefs: [], consume_prefs: [],
consume_trend: [], consume_trend: [],
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
// 切换班级获取报告 // 切换班级获取报告
this.QueryClsReport(this.array[e.target.value].DepId) this.QueryClsReport(this.array[e.target.value].DepId)
}, },
// 切换班级选择汇总 // 切换班级选择汇总
async selectReport() { async selectReport() {
...@@ -189,6 +189,7 @@ ...@@ -189,6 +189,7 @@
}, },
// 二维码加密内容转tokenqrcode2Token // 二维码加密内容转tokenqrcode2Token
async tokenqrcode2Token() { async tokenqrcode2Token() {
let this_ = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 二维码加密内容获取token // 二维码加密内容获取token
$.ajax({ $.ajax({
...@@ -201,13 +202,12 @@ ...@@ -201,13 +202,12 @@
}, },
success: function(res) { success: function(res) {
if (res.code == 10000) { if (res.code == 10000) {
this_.schoolName = res.results.schoolName
this_.teacherName = res.results.teacherName
this_.token = res.results.token
resolve(res) resolve(res)
} else { } else {
resolve(res) reject(res)
uni.showToast({
icon: "none",
title: res.message
})
} }
}, },
error: function(error) { error: function(error) {
...@@ -266,11 +266,7 @@ ...@@ -266,11 +266,7 @@
if (res.code == 10000) { if (res.code == 10000) {
resolve(res) resolve(res)
} else { } else {
resolve(res) reject(res)
uni.showToast({
icon: "none",
title: res.message
})
} }
}, },
error: function(error) { error: function(error) {
...@@ -293,7 +289,8 @@ ...@@ -293,7 +289,8 @@
data: JSON.stringify({ data: JSON.stringify({
"clsId": clsId + '', "clsId": clsId + '',
"qyToken": this_.token, "qyToken": this_.token,
"weekId": -1 "weekId": getQueryParams('weekid') ? parseInt(getQueryParams(
'weekid')) : -1
}), }),
success: function(res) { success: function(res) {
if (res.code == 10000) { if (res.code == 10000) {
...@@ -315,11 +312,7 @@ ...@@ -315,11 +312,7 @@
this_.piechart() this_.piechart()
resolve(res) resolve(res)
} else { } else {
resolve(res) reject(res)
uni.showToast({
icon: "none",
title: res.message
})
} }
}, },
error: function(error) { error: function(error) {
...@@ -599,8 +592,12 @@ ...@@ -599,8 +592,12 @@
}, },
// 初始化 // 初始化
async init_() { async init_() {
uni.showLoading({
title: "加载中....."
})
try { try {
// await this.tokenqrcode2Token(); await this.tokenqrcode2Token();
let AdminCls = await this.QueryAdminCls(); let AdminCls = await this.QueryAdminCls();
if (AdminCls.results) { if (AdminCls.results) {
this.array = AdminCls.results this.array = AdminCls.results
...@@ -615,11 +612,12 @@ ...@@ -615,11 +612,12 @@
// Name: "102班周消费报告 " // Name: "102班周消费报告 "
// }] // }]
} }
await this.QueryClsReport(AdminCls.results[0].DepId); await this.QueryClsReport(AdminCls.results[0].DepId);
// await this.CaptureEvent() await this.CaptureEvent()
uni.hideLoading()
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
uni.hideLoading()
uni.showModal({ uni.showModal({
title: "系统提示", title: "系统提示",
showCancel: false, showCancel: false,
...@@ -637,7 +635,6 @@ ...@@ -637,7 +635,6 @@
content: "hex参数错误", content: "hex参数错误",
}) })
} }
this_.init_() this_.init_()
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.$nextTick(function() { this.$nextTick(function() {
...@@ -645,9 +642,9 @@ ...@@ -645,9 +642,9 @@
myChart.resize() myChart.resize()
}) })
}) })
setTimeout(function() { // setTimeout(function() {
this_.js_sdk_init() // this_.js_sdk_init()
}, 2000) // }, 2000)
} }
} }
</script> </script>
...@@ -675,7 +672,9 @@ ...@@ -675,7 +672,9 @@
} }
.headerImg { .headerImg {
height: 206rpx; width: 670rpx;
height: 130rpx;
margin: 0 auto;
} }
.headerImg image { .headerImg image {
...@@ -702,7 +701,7 @@ ...@@ -702,7 +701,7 @@
.classpicker { .classpicker {
position: relative; position: relative;
top: -130rpx; top: -90rpx;
} }
.selectClass image { .selectClass image {
...@@ -742,7 +741,7 @@ ...@@ -742,7 +741,7 @@
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
padding-right: 20rpx; padding-right: 20rpx;
margin-top: -50rpx; margin-top: -30rpx;
} }
.huizongTime { .huizongTime {
......
static/images/header.png

88.1 KB | W: | H:

static/images/header.png

7.68 KB | W: | H:

static/images/header.png
static/images/header.png
static/images/header.png
static/images/header.png
  • 2-up
  • Swipe
  • Onion skin
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