123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <template>
- <view>
- <statusBar :item="navBarData"></statusBar>
-
- <view class="mineBox">
- <view class="userInformation" >
- <view class="userAvatar" @click="gotoMineEdit">
- <image
- :src="userAvatar!=='' ? userAvatar : 'https://teacherapi.cocorobo.cn/teaching-file/static//mine/Avatar_default.png'"
- mode="aspectFill"></image>
- </view>
- <view class="userInfo" @click="gotoMineEdit">
- <view class="infoTextone">
- <text class="twoZ-font">{{ !username ? '未登录' : username }}</text>
- <!-- <span v-if="isManage!==''" class="manage bq-font">管理员</span> -->
- </view>
- <view class="infoTexttwo">
- <text style="font-size: 26rpx;font-weight: 400;line-height: 42rpx;color: #999999;">
- {{signature!=='' ? signature : '个性签名' }}
- </text>
- <!-- <text style="font-size: 26rpx;font-weight: 400;line-height: 42rpx;color: #999999;"></text> -->
- </view>
- </view>
- <!-- <view class="msgInfo">
- <view class="msgImg" @click="goMsg">
- 消息
- </view>
- </view> -->
- </view>
- <view class="userOptionsBox">
- <view class="optionsItemBox">
- <view class="optionItem" @click="goMsg">
- <view class="option_left">
- <view class="option_icon">
- <image style="width: 80%;height: 80%;" src="../../static/Vectorldang.png" mode="aspectFill">
- </image>
- </view>
- <text class="option_text fwb-font">我的消息</text>
- </view>
- <view class="option_right">
- <view class="msgq" v-if="msgn>0">
- {{msgn}}
- </view>
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view>
- <view class="optionItem" @click="gotoMineCollect">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/Collect.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">我的收藏</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view>
- <view class="optionItem" @click="gotoMineActive">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static/mine/active.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">我的活动</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view>
- <!-- <view class="optionItem" @click="gotoMineClass">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/myClass.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">我的教研室</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view> -->
- <!-- <view class="optionItem" @click="gotomyRelease">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//fabu.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">我的发布</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view> -->
- </view>
- <view class="optionsItemBox">
- <view class="optionItem">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/help.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">反馈帮助</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view>
- <view class="optionItem" @click="gotoMineEdit">
- <view class="option_left">
- <span class="option_icon">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/setting.png" mode="aspectFill">
- </image>
- </span>
- <text class="option_text fwb-font">我的设置</text>
- </view>
- <view class="option_right">
- <image src="https://teacherapi.cocorobo.cn/teaching-file/static//mine/arrow-right.png" mode="aspectFill">
- </image>
- </view>
- </view>
- </view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- navBarData: {
- title: '我的',
- btn: 0
- },
- msgn:0,
- // 用户名
- username: '',
- // 头像
- userAvatar: 'https://teacherapi.cocorobo.cn/teaching-file/static/mine/Avatar.png',
- // 学校
- signature:'',
-
- };
- },
- methods: {
-
- // 我的收藏
- gotoMineCollect() {
- const value = this.$store.state.user.openid;
- if(!value){
- uni.showToast({title: '未登录,请登录',icon: 'none'})
- setTimeout(this.goLog,1000)
- return
- }
- uni.navigateTo({
- // url: '/pages/mineCollect/mineCollect'
- url:'/pages/mineCollNew/mineCollNew'
- })
- },
- // 我的设置
- gotoMineEdit() {
- const value = this.$store.state.user.openid;
- if(!value){
- uni.showToast({title: '未登录,请登录',icon: 'none'})
- setTimeout(this.goLog,1000)
- return
- }
- uni.navigateTo({
- url: '/pages/mineEdit/mineEdit'
- })
- },
- // 我的活动
- gotoMineActive() {
- const value = this.$store.state.user.openid;
- if(!value){
- uni.showToast({title: '未登录,请登录',icon: 'none'})
- setTimeout(this.goLog,1000)
- return
- }
- uni.navigateTo({
- url: '/pages/mineActive/mineActive'
- })
- },
- // 信息
- goMsg(){
- const value = this.$store.state.user.openid;
- if(!value){
- uni.showToast({title: '未登录,请登录',icon: 'none'})
- setTimeout(this.goLog,1000)
- return
- }
- uni.navigateTo({
- url: '/pages/msg/msg'
- })
- },
- // 获取未读信息
- getMag() {
- this.$request('/selectAllMessage', "POST", {
- oid: this.$store.state.user.openid
- }).then(res => {
- console.log('获取未读信息',res[0][0].msg);
- let num = res[0][0].msg
- this.msgn=num
- if (num == 0) {
- uni.hideTabBarRedDot({
- index: 3
- })
- } else {
-
- uni.setTabBarBadge({
- index: 3,
- text: num.toString()
- })
- }
- })
- },
- goLog() {
- uni.navigateTo({
- url: "/pages/login_Wechat/login_Wechat",
- });
- },
- },
- onShow() {
- this.getMag() // 调用app.js中的方法
-
- console.log(this.$store.state);
-
- this.userAvatar = this.$store.state.user.avatar;
-
- this.username = this.$store.state.user.username;
-
- // 学校
- this.signature=this.$store.state.user.school==null?'':this.$store.state.user.school;
- // this.isManage = this.$store.state.user.openid;
- // console.log(this.isManage == "");
- }
- };
- </script>
- <style lang="scss" scoped>
- .mineBox {
- width: 100%;
- // 头像信息
- .userInformation {
- width: 100%;
- height: 100px;
- padding: 0 18px;
- background-color: white;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .userAvatar {
- flex: 1;
- // height: 80%;
- display: flex;
- align-items: center;
- image {
- width: 128rpx;
- height: 128rpx;
- border-radius: 50%;
- }
- }
- .userInfo {
- margin-left: 10px;
- flex: 4;
- height: 80%;
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- .infoTextone {
- display: flex;
- align-items: center;
- span {
- &:first-child {
- color: #000;
- // font-size: 40rpx;
- font-weight: 600;
- }
- &.manage {
- border: 1px #ffa338 solid;
- // font-size: 11px;
- display: flex;
- white-space: nowrap;
- justify-content: center;
- align-items: center;
- padding: 2px 4px;
- border-radius: 3px;
- margin-right: 10rpx;
- color: #ffa338;
- margin-left: 5px;
- }
- }
- }
- .infoTexttwo {
- span {
- color: rgb(153, 153, 153);
- // font-size: 26rpx;
- }
- }
- }
- .msgInfo{
- width: 70rpx;
- position: relative;
- height: 80%;
- .msgImg{
- position: absolute;
- top: 0;
- right: 0;
-
- width: 64rpx;
- height: 64rpx;
- }
- }
- }
- // 个人资料选项
- .userOptionsBox {
- width: 100%;
- margin-top: 10px;
- .optionsItemBox {
- background-color: #fff;
- width: 100%;
- margin-bottom: 10px;
- padding: 5px 23px;
- .optionItem {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 81rpx;
- // font-size: 28rpx;
- .option_left {
- display: flex;
- align-items: center;
- height: 40rpx;
- .option_icon {
- height: 100%;
- width: 40rpx;
-
- image {
- width: 100%;
- height: 100%;
- }
- }
- .option_text {
- margin-left: 10px;
- color: rgba(0, 0, 0, 0.8);
- }
- }
- .option_right {
- height: 40rpx;
- display: flex;
- align-items: center;
- .msgq{
- width: 32rpx;height: 32rpx;background-color:rgba(213, 73, 65, 1);border-radius: 50rpx;
- color: #fff;
- font-size: 20rpx;
- display: flex;justify-content: center;align-items: center;
- }
- image {
- height: 34rpx;
- width: 30rpx;
- margin-left: 20rpx;
- }
- }
- }
- }
- }
-
- }
- </style>
|