李双庆 1 year ago
parent
commit
e6b3ed35a2
  1. 24
      common/axios.js
  2. 9
      pages.json
  3. 16
      pages/student/index/index.vue
  4. 127
      pages/student/index/job_list.vue
  5. 47
      pages/student/my/personal_data.vue
  6. BIN
      static/images/index/check_mark.png
  7. BIN
      static/images/index/img.jpg

24
common/axios.js

@ -49,9 +49,17 @@ export default {
var [error, res] = data; var [error, res] = data;
uni.hideLoading() uni.hideLoading()
var res_code = res.statusCode.toString(); var res_code = res.statusCode.toString();
var res_codes = res.data.code.toString();
if (res_code.charAt(0) == 2) { if (res_code.charAt(0) == 2) {
if (res_code == 200) { if (res_code == 200) {
if (res_codes == 401) {
uni.navigateTo({
url: '/pages/student/login/login'
})
}else{
cback(res.data); cback(res.data);
}
} else { } else {
console.log('201', url) console.log('201', url)
uni.showToast({ uni.showToast({
@ -60,18 +68,10 @@ export default {
}) })
} }
} else { } else {
if (res_code == 401) { if (res_codes == 401) {
//登录失效 uni.navigateTo({
console.log('401', url) url: '/pages/student/login/login'
if (again_quest) { })
// token.getTokenFromServer(()=>{
// const again_res=that.uni_request(url,param,method,false)
// //注意这里需要cback,因为是上一个promis的cback
// cback(again_res);
// });
} else {
console.log('再次登陆仍然失败', url)
}
} else { } else {
console.log('400/500', url, error, res) console.log('400/500', url, error, res)
uni.showToast({ uni.showToast({

9
pages.json

@ -144,6 +144,15 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{
"path" : "pages/student/index/job_list",
"style": {
"navigationBarTitleText": "作业列表",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#29d3b4",
"navigationBarTextStyle": "white"
}
},

16
pages/student/index/index.vue

@ -5,7 +5,8 @@
</view> </view>
<view class="head"> <view class="head">
<view class="head-img"> <view class="head-img">
<fui-avatar width="136" :src="$util.img(member_info.headimg)"></fui-avatar> <!-- <fui-avatar width="136" :src="$util.img(member_info.headimg)"></fui-avatar> -->
<image class="pic" :src="$util.img(member_info.headimg)"></image>
<view class="head-text">{{member_info.name}}</view> <view class="head-text">{{member_info.name}}</view>
</view> </view>
</view> </view>
@ -65,7 +66,7 @@
<view class="after-class"> <view class="after-class">
<view class="after-class-title"> <view class="after-class-title">
<view class="after-class-title-left">课后作业</view> <view class="after-class-title-left">课后作业</view>
<view class="after-class-title-right">全部</view> <view class="after-class-title-right" @click="jobList">全部</view>
</view> </view>
<view class="after-class-con"> <view class="after-class-con">
<view class="after-class-con-txt"> <view class="after-class-con-txt">
@ -144,6 +145,11 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/student/index/physical_examination' url: '/pages/student/index/physical_examination'
}) })
},
jobList(){
uni.navigateTo({
url: '/pages/student/index/job_list'
})
} }
} }
} }
@ -395,4 +401,10 @@
width: 100%; width: 100%;
align-content: space-around; align-content: space-around;
} }
.pic {
width: 144rpx;
height: 144rpx;
border-radius: 50%;
}
</style> </style>

127
pages/student/index/job_list.vue

@ -0,0 +1,127 @@
<template>
<view class="main_box">
<view class="after-class-title">
<view class="after-class-title-left">课后作业</view>
</view>
<view>
<view class="con-list">
<view class="con-list-img">
<image class="pic" src="@/static/images/index/img.jpg"></image>
</view>
<view class="con" style="margin-top: 20rpx;">
时间2020.05:25 15:30
</view>
<view class="con" style="margin-bottom: 20rpx;">
作业描述作业描述作业描述作业描述作业描述作业描述作业描述作业描述作业描述
</view>
<view class="mark" v-if="true">
<image class="check_mark" src="@/static/images/index/check_mark.png"></image>
</view>
<view class="assignment">
班级作业
</view>
</view>
<view class="con-list">
<view class="con-list-img">
<video class="pic" style="width: 100%;border-radius: 15rpx;"></video>
</view>
<view class="con" style="margin-top: 20rpx;">
时间2020.05:25 15:30
</view>
<view class="con" style="margin-bottom: 20rpx;">
作业描述作业描述作业描述作业描述作业描述作业描述作业描述作业描述作业描述
</view>
<view class="mark" v-if="false">
<image class="check_mark" src="@/static/images/index/check_mark.png"></image>
</view>
<view class="assignment">
班级作业
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
.main_box{
width: 100%;
height: 100vh;
background: #292929;
overflow: auto;
}
.after-class-title {
width: 92%;
display: flex;
justify-content: space-between;
margin: auto;
padding-top: 30rpx;
}
.after-class-title-left {
color: #fff;
font-size: 35rpx;
border-bottom: 4rpx #29d3b4 solid;
}
.con-list{
width: 100%;
padding: 30rpx;
margin-top: 20rpx;
border-bottom: 2rpx #fff solid;
position: relative;
}
.con-list-img{
width: 100%;
height: 280rpx;
display: flex;
align-items: center;
justify-content: center;
}
.pic{
width: 85%;
height: 100%;
}
.con{
width: 75%;
color: #fff;
padding-top: 30rpx;
}
.mark{
position: absolute;
right: 8%;
bottom: 23%;
width: 70rpx;
height: 70rpx;
border-radius: 100%;
background: #29d3b4;
display: flex;
align-items: center;
justify-content: center;
}
.check_mark{
width: 80%;
height: 80%;
}
.assignment{
position: absolute;
right: 3%;
bottom: 10%;
width: 150rpx;
text-align: center;
border-radius: 10rpx;
padding: 6rpx 12rpx;
color: #6b9d53;
border: 2rpx #6b9d53 solid;
}
</style>

47
pages/student/my/personal_data.vue

@ -5,7 +5,8 @@
<view class="main_section"> <view class="main_section">
<view class="section"> <view class="section">
<view class="item"> <view class="item">
<image @click="changeAvatar()" class="pic" :src="$util.img(formData.headimg)" v-if="upload_type == 1"> <image @click="changeAvatar()" class="pic" :src="$util.img(formData.headimg)"
v-if="upload_type == 1">
<image @click="changeAvatar()" class="pic" :src="uploadHeadimg" v-else> <image @click="changeAvatar()" class="pic" :src="uploadHeadimg" v-else>
</image> </image>
<view class="btn" @click="changeAvatar()">修改头像</view> <view class="btn" @click="changeAvatar()">修改头像</view>
@ -89,7 +90,7 @@
手机 <text class="required">*</text> 手机 <text class="required">*</text>
</view> </view>
<view class="input"> <view class="input">
<input v-model="formData.mobile" placeholder="请输入手机" /> <input v-model="formData.phone" placeholder="请输入手机" />
</view> </view>
</view> </view>
</view> </view>
@ -132,9 +133,6 @@
picker_show_sex: false, picker_show_sex: false,
sex_name: '请选择', sex_name: '请选择',
options_sex_arr: [{ options_sex_arr: [{
value: 0,
text: '保密'
},{
value: 1, value: 1,
text: '男' text: '男'
}, },
@ -150,6 +148,7 @@
picker_show_birthday: false, picker_show_birthday: false,
upload_type: 1, upload_type: 1,
uploadHeadimg: '', uploadHeadimg: '',
editHeadimg: '',
} }
}, },
onLoad() {}, onLoad() {},
@ -164,22 +163,17 @@
}, },
// //
member_init() { async member_init() {
member.member().then(res => { const member_in = await member.member();
if(res.code == 1){ if (member_in.code == 1) {
this.member_info = res.data this.member_info = member_in.data
this.formData = {...this.member_info} this.formData = {
if(res.data.sex == 0){ ...this.member_info
this.sex_name = '保密'
}else if(this.formData.sex == 1){
this.sex_name = '男'
}else if(this.formData.sex == 2){
this.sex_name = '女'
} }
this.sex_name = member_in.data.gender
} else { } else {
this.member_info = [] this.member_info = []
} }
})
}, },
// //
@ -195,10 +189,8 @@
} }
}) })
}, },
async uploadFilePromise(url) { uploadFilePromise(url) {
let token = uni.getStorageSync('token') || '' let token = uni.getStorageSync('token') || ''
console.log(token,'AQ', this.uploadUrl, this.$store.state.token)
return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: this.uploadUrl, // url: this.uploadUrl, //
filePath: url, filePath: url,
@ -212,6 +204,7 @@
if (res.code == 1) { if (res.code == 1) {
this.upload_type = 2 this.upload_type = 2
this.formData.headimg = res.data.path this.formData.headimg = res.data.path
this.editHeadimg = res.data.path
this.uploadHeadimg = res.data.url this.uploadHeadimg = res.data.url
} else { } else {
uni.showToast({ uni.showToast({
@ -219,12 +212,8 @@
icon: 'none' icon: 'none'
}) })
} }
setTimeout(() => {
resolve(res.data);
}, 1000);
}, },
}); });
});
}, },
// //
changePickerSex(e) { changePickerSex(e) {
@ -283,14 +272,18 @@
// //
submit() { submit() {
console.log(this.editHeadimg, '111')
if(this.editHeadimg == ''){
this.editHeadimg = this.formData.headimg
}
member.member_edit({ member.member_edit({
header: this.formData.headimg, header: this.editHeadimg,
name: this.formData.name, name: this.formData.name,
address: this.formData.address, address: this.formData.address,
gender: this.formData.sex, gender: this.sex_name,
birthday: this.formData.birthday, birthday: this.formData.birthday,
email: this.formData.email, email: this.formData.email,
phone: this.formData.mobile, phone: this.formData.phone,
}).then(res => { }).then(res => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ uni.showToast({

BIN
static/images/index/check_mark.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/images/index/img.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Loading…
Cancel
Save