You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

669 lines
16 KiB

1 year ago
<template>
<view class="container">
1 year ago
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
1 year ago
<view class="wrap">
1 year ago
<view class="me">
1 year ago
<image class="me-top" :src="base.imgHost('me-top.png')"></image>
1 year ago
<view class="me-wrap">
1 year ago
<view class="me-name">
6 months ago
<view class="me-name-left">
<image mode="widthFix" :src="base.imgHost('login-logo.png')"></image>
1 year ago
<view class="userinfo">
6 months ago
<view class="userinfo-img" @click="changeAvatar">
2 months ago
<image :src="userAvatar?userAvatar:base.imgHost('logo-add.png')"></image>
1 year ago
</view>
6 months ago
<view>
<view class="usersigns">
<text>姓名</text>
<text>{{userInfo.username?userInfo.username:'-'}}</text>
2 months ago
</view>
<view class="usersigns" v-if="userInfo.no">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
6 months ago
</view>
<view class="usersigns" v-if="course_signs.length>0">
<block v-if="course_signs[0]['course']">
<text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</block>
</view>
1 year ago
</view>
1 year ago
</view>
6 months ago
</view>
2 months ago
<view v-if="myQrcode" class="me-name-right usercode" @click="showBigCode=true">
6 months ago
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode"
2 months ago
:sizeUnit="'rpx'" :size="160"
6 months ago
:options="{
1 year ago
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
1 year ago
</view>
</view>
1 year ago
</view>
1 year ago
1 year ago
</view>
1 year ago
<view class="menu">
1 year ago
<view @click="refreshCode">
<view>
<image :src="base.imgHost('me-icon3.png')" style="width:51rpx;height:46rpx;"></image>
<text>电子校友卡</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
1 year ago
<view @click="toUrl(2)">
1 year ago
<view>
1 year ago
<image :src="base.imgHost('me-icon1.png')" style="width:52rpx;height:48rpx;"></image>
1 year ago
<text>我的课程</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
2 months ago
</view>
<!-- <view @click="toUrl(6)">
<view>
<image :src="base.imgHost('me-icon1.png')" style="width:52rpx;height:48rpx;"></image>
<text>学院日程</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
4 months ago
</view> -->
1 year ago
<view @click="toUrl(3)">
1 year ago
<view>
1 year ago
<image :src="base.imgHost('me-icon2.png')" style="width:50rpx;height:50rpx;"></image>
1 year ago
<text>我的预约</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
1 year ago
<view @click="toUrl(5)">
1 year ago
<view>
1 year ago
<image :src="base.imgHost('me-icon6.png')" style="width:47rpx;height:50rpx;"></image>
<text>我要捐赠</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<view @click="toUrl(1)">
<view>
<image :src="base.imgHost('me-icon7.png')" style="width:48rpx;height:52rpx;"></image>
<text>个人信息</text>
1 year ago
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<view @click="showGzh = true">
<view>
1 year ago
<image :src="base.imgHost('me-icon4.png')" style="width:50rpx;height:47rpx;"></image>
1 year ago
<text>关注公众号</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
1 year ago
<view @click="toUrl(4)">
<view>
<image :src="base.imgHost('me-icon5.png')" style="width:48rpx;height:52rpx;"></image>
<text>联系我们</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
1 year ago
</view>
1 year ago
1 year ago
</view>
1 year ago
<!-- 校友卡 -->
1 year ago
<view class="modal-wrap" v-if="showCard">
<view class="modal-image">
<view class="modal-close" @click="showCard = false">X</view>
1 year ago
<image mode="widthFix" :src="base.imgHost('me-xyk1.png')"></image>
1 year ago
</view>
1 year ago
<view class="modal-xyk">
1 year ago
<view>
<!-- <view style="margin-bottom:40rpx;text-align: center;">电子校园卡</view> -->
<view class="modal-xyk-between">
6 months ago
<view class="modal-xyk-item modal-xyk-code">
1 year ago
<view style="display: flex;justify-content: center;" @click="bigCode">
1 year ago
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode"
6 months ago
:sizeUnit="'rpx'" :size="200" :options="{
1 year ago
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
2 months ago
</view>
<view class="modal-xyk-item-reload" @click="getQrCode" v-if="myQrcode">
<image :src="base.imgHost('me-reload.png')"></image>
<view>点击二维码刷新</view>
1 year ago
</view>
</view>
2 months ago
<view class="modal-xyk-item modal-xyk-name">
<view class="modal-xyk-name-img">
<image :src="userAvatar?userAvatar:base.imgHost('logo-user.png')"></image>
6 months ago
</view>
1 year ago
<view class="modal-xyk-name-course">
<text>姓名</text>
<text>{{userInfo.username}}</text>
2 months ago
</view>
<view class="modal-xyk-name-course">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
1 year ago
</view>
6 months ago
<view class="modal-xyk-name-course" v-if="course_signs.length>0">
1 year ago
<block v-if="course_signs[0]['course']">
<text>学籍</text>
<text>{{course_signs[0]['course'].year?course_signs[0]['course'].year+'年':''}}{{course_signs[0]['course'].type_detail?course_signs[0]['course']['type_detail'].name+"|":''}}{{course_signs[0]['course'].name}}</text>
</block>
1 year ago
</view>
</view>
</view>
6 months ago
1 year ago
1 year ago
</view>
</view>
1 year ago
</view>
1 year ago
<!-- 公众号 -->
1 year ago
<view class="modal-wrap" v-if="showGzh">
1 year ago
<view class="modal-image" style="height:68%;text-align: center;">
1 year ago
<view class="modal-close" @click="showGzh = false">X</view>
1 year ago
<image mode="heightFix" style="height:100%" show-menu-by-longpress :show-menu-by-longpress="true"
:src="base.imgHost('me-gzh.png')"></image>
1 year ago
</view>
1 year ago
</view>
<!-- 进入后没有手机号的话 绑定 或者 注册 -->
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
1 year ago
<view>
<view class="modal-tip">提示</view>
<view class="modal-content">
1 year ago
<view>如您已是我方校友请先绑定账号</view>
1 year ago
<view @click="goBind" class="modal-bind">
去绑定
</view>
1 year ago
<view>如您还不是我方校友请先注册</view>
1 year ago
<view @click="toRegister" class="modal-register">
去注册
</view>
1 year ago
</view>
</view>
</u-popup>
</view>
1 year ago
<view v-if="showBigCode" class="big">
<view class="big-wrap">
<view class="big-close" @click='showBigCode=false'>X</view>
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode" :sizeUnit="'rpx'"
6 months ago
:size="600" :options="{
1 year ago
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
1 year ago
</view>
1 year ago
<tabbar :currentPage="3"></tabbar>
</view>
</template>
<script>
1 year ago
import uqrcode from '@/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue'
1 year ago
import tabbar from '@/components/tabbar/tabbar.vue';
export default {
components: {
1 year ago
tabbar,
uqrcode
1 year ago
},
data() {
return {
2 months ago
showRegister: false,
6 months ago
userAvatar:'',
1 year ago
type: 'register',
1 year ago
showGzh: false,
showCard: false,
1 year ago
userInfo: {},
hasMobile: false,
1 year ago
course_signs: [],
showBigCode: false,
myQrcode: 'STBC',
timer: null
1 year ago
}
},
onShareAppMessage() {
return {
title: "苏州科技商学院",
imageUrl: "/static/share.jpg"
}
},
onShareTimeline() {
return {
title: "苏州科技商学院",
imageUrl: "/static/share.jpg"
1 year ago
}
},
onShow() {
1 year ago
this.showRegister = false
1 year ago
this.getUserInfo()
let that = this
if (!this.timer) {
this.timer = setInterval(function() {
that.getQrCode()
}, 3 * 60 * 1000)
1 year ago
}
},
1 year ago
onLoad() {
},
onUnload() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
},
onHide() {
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
1 year ago
},
methods: {
1 year ago
refreshCode() {
if (!this.hasMobile) {
this.base.toast("请先绑定或注册")
this.showRegister = true
return
1 year ago
}
1 year ago
this.showCard = true
1 year ago
},
bigCode() {
this.showCard = false
this.showBigCode = true
2 months ago
},
changeAvatar(){
uni.navigateTo({
url:'/packages/avatarUpload/index'
})
1 year ago
},
1 year ago
toUrl(type) {
if (type === 1 || type === 2 || type === 3) {
if (!this.hasMobile) {
this.base.toast("请先绑定或注册")
this.showRegister = true
return
}
}
1 year ago
if (type === 1) {
uni.navigateTo({
url: '/packages/my/index'
})
} else if (type === 2) {
uni.navigateTo({
url: '/packages/mycourse/index'
})
} else if (type === 3) {
uni.navigateTo({
url: '/packages/mybook/index'
})
1 year ago
} else if (type === 4) {
uni.navigateTo({
url: '/packages/webview/index?type=4'
})
1 year ago
} else if (type === 5) {
1 year ago
uni.navigateTo({
url: '/packages/donate/index'
})
5 months ago
} else if (type === 6) {
uni.navigateTo({
url: '/packages/courseCalendar/index'
})
1 year ago
}
},
getUserInfo() {
this.$u.api.user().then(res => {
console.log("res", res)
this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user
6 months ago
this.course_signs = res.user.course_signs ? res.user.course_signs : []
2 months ago
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
6 months ago
this.userAvatar = res.user.headimgurl?res.user.headimgurl:''
1 year ago
if (this.base.isNull(res.user.mobile)) {
1 year ago
this.showRegister = true
1 year ago
this.hasMobile = false
1 year ago
} else {
1 year ago
this.showRegister = false
1 year ago
this.hasMobile = true
1 year ago
}
})
1 year ago
},
getQrCode() {
uni.showLoading({
title: '...'
})
this.$u.api.user().then(res => {
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
setTimeout(function() {
uni.hideLoading()
}, 500)
})
1 year ago
},
1 year ago
// 去绑定登录
goBind() {
uni.navigateTo({
url: '/packages/register/login'
1 year ago
})
},
1 year ago
// 去注册
toRegister() {
uni.navigateTo({
url: '/packages/register/index'
1 year ago
})
},
}
}
</script>
<style scoped lang="scss">
1 year ago
.container {
padding: 30rpx;
width: 100%;
height: 100vh;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap {
position: relative;
height: calc(100% - 60rpx);
.me {
width: 690rpx;
height: 435rpx;
position: relative;
&-top {
width: 690rpx;
height: 435rpx;
}
1 year ago
&-wrap {
display: flex;
justify-content: space-between;
align-items: center;
position: absolute;
1 year ago
top: 0rpx;
1 year ago
left: 0;
1 year ago
padding: 30rpx;
1 year ago
width: 100%;
}
1 year ago
&-name {
1 year ago
width: 100%;
color: #fff;
1 year ago
font-size: 30rpx;
1 year ago
padding: 0 20rpx;
6 months ago
display: flex;
align-items: flex-start;
justify-content: space-between;
1 year ago
2 months ago
&-left {
width:100%;
&>image {
width: 200rpx;
margin-bottom: 30rpx;
// height: 110rpx;
// margin-right: 20rpx;
6 months ago
}
1 year ago
.userinfo {
line-height: 1.5;
6 months ago
display: flex;
align-items: center;
5 months ago
// margin-top: 40rpx;
6 months ago
image {
width: 120rpx;
height: 120rpx;
margin-right: 30rpx;
border-radius: 100%;
}
1 year ago
}
.usersigns {
display: flex;
&>text:first-child {
width: 100rpx;
}
&>text:last-child {
width: calc(100% - 100rpx);
}
}
2 months ago
}
.usercode {
width: 160rpx;
1 year ago
}
1 year ago
}
}
.menu {
position: absolute;
1 year ago
top: 320rpx;
1 year ago
width: 100%;
background-color: #fff;
// z-index: 999;
border-radius: 40rpx 40rpx 0 0;
1 year ago
height: calc(100% - 320rpx);
1 year ago
padding: 40rpx;
1 year ago
overflow: scroll;
1 year ago
&>view {
1 year ago
padding: 30rpx;
color: #666;
border-bottom: 1px solid #ddd;
display: flex;
align-items: center;
justify-content: space-between;
&>view:first-child {
display: flex;
align-items: center;
text {
margin-left: 20rpx
}
1 year ago
}
1 year ago
}
1 year ago
}
1 year ago
}
1 year ago
1 year ago
.modal {
1 year ago
::v-deep .u-drawer-bottom {
border-radius: 40rpx;
}
1 year ago
&-tip {
text-align: center;
padding: 30rpx;
1 year ago
font-size: 32rpx;
1 year ago
}
&-content {
1 year ago
height: 450rpx;
1 year ago
padding: 0 30rpx;
1 year ago
font-size: 32rpx;
text-align: center;
&>view {
1 year ago
margin: 30rpx auto;
1 year ago
}
1 year ago
}
1 year ago
&-bind {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #e4cdb4, #c69c6d);
}
&-register {
width: 45%;
text-align: center;
margin: 0 auto;
color: #fff;
border-radius: 30rpx;
padding: 20rpx;
background: linear-gradient(to right, #5e5fbc, #0d0398);
}
1 year ago
}
.modal-wrap {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
1 year ago
background-color: rgba(0, 0, 0, 0.8);
1 year ago
1 year ago
.modal-close {
width: 80rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
1 year ago
background: #6e6e77;
1 year ago
border-radius: 80rpx;
position: absolute;
1 year ago
top: -90rpx;
1 year ago
right: 0rpx;
}
.modal-image {
1 year ago
position: absolute;
1 year ago
top: 48%;
1 year ago
left: 50%;
transform: translate(-50%, -50%);
1 year ago
// height: 60%;
width: calc(100% - 60rpx);
1 year ago
&>image {
width: 100%;
height: 100%;
}
1 year ago
}
1 year ago
1 year ago
}
.modal-xyk {
position: absolute;
1 year ago
top: 57%;
1 year ago
left: 50%;
transform: translate(-50%, -50%);
1 year ago
// height: 70%;
1 year ago
color: #fff;
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: center;
&>view {
1 year ago
width: 100%;
padding: 30rpx;
1 year ago
}
1 year ago
&-between {
display: flex;
justify-content: space-between;
6 months ago
align-items: flex-start;
2 months ago
padding: 20rpx 60rpx;
6 months ago
padding-left:30rpx;
1 year ago
}
1 year ago
1 year ago
&-item {
&>view {
text-align: center;
}
1 year ago
&-reload {
display: flex;
align-items: center;
2 months ago
// padding: 10rpx 40rpx;
justify-content: center;
6 months ago
margin-top: 20rpx;
1 year ago
font-size: 24rpx;
1 year ago
image {
width: 27rpx;
height: 25rpx;
margin-right: 10rpx;
}
}
1 year ago
}
2 months ago
&-code{
width: 270rpx;
/* margin-right: 10rpx; */
border-right: 1rpx solid rgba(255,255,255,0.2);
padding-right: 30rpx;
6 months ago
}
1 year ago
&-name {
6 months ago
width: calc(100% - 310rpx);
1 year ago
margin-right: 0;
1 year ago
&>view {
text-align: left;
1 year ago
// margin-bottom: 20rpx;
1 year ago
}
2 months ago
&-img{
image{
width: 100rpx;
height: 100rpx;
margin-left: 30rpx;
margin-bottom:10rpx;
border-radius: 100%;
}
6 months ago
}
1 year ago
&-course {
display: flex;
6 months ago
margin-bottom:10rpx;
1 year ago
&>text:first-child {
width: 100rpx;
}
&>text:last-child {
width: calc(100% - 100rpx);
1 year ago
}
1 year ago
}
1 year ago
}
1 year ago
}
.big {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
overflow: scroll;
&-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 500rpx;
text-align: center;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
&-close {
width: 80rpx;
height: 80rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
background: #6e6e77;
border-radius: 80rpx;
position: absolute;
top: -80rpx;
right: 0;
}
1 year ago
}
}
</style>