index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <view class="mine">
  3. <view class="top">
  4. <view class="info" >
  5. <view class="img" :style="{backgroundImage:'url('+ (mine.type_model? mine.type_model.headimg : '../../static/images/avator.png') +')'}">
  6. <!-- <image :src="mine.type_model? mine.type_model.headimg : '../../static/images/avator.png'" mode=""></image> -->
  7. </view>
  8. <view class="info_name">
  9. {{mine.type_model ? mine.type_model.truename :'--'}}
  10. </view>
  11. <view class="edit" @click="edit">
  12. <text>编辑资料</text>
  13. <image src="../../static/images/edit_arrow.png" mode=""></image>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="content">
  18. <view class="header">
  19. <view class="header_wrap">
  20. <view class="right first">
  21. <view class="dot">
  22. </view>
  23. <view class="text">
  24. <text>学科:</text>
  25. {{mine.type_model ? mine.type_model.subject :'--'}}
  26. </view>
  27. </view>
  28. <view class="right">
  29. <view class="dot">
  30. </view>
  31. <view class="text">
  32. <text>账号:</text>
  33. {{mine.type_model ? mine.type_model.account :'--'}}
  34. </view>
  35. </view>
  36. <view class="right third">
  37. <view class="dot">
  38. </view>
  39. <view class="text">
  40. <text>毕业院校:</text>
  41. {{mine.type_model ? mine.type_model.school :'--'}}
  42. </view>
  43. </view>
  44. <!-- <view class="right">
  45. <view class="dot">
  46. </view>
  47. <view class="text">
  48. <text>职称:</text>
  49. {{mine.type_model ? mine.type_model.rank :'--'}}
  50. </view>
  51. </view> -->
  52. </view>
  53. <view class="tip">
  54. <view class="item">
  55. <view class="nums">
  56. {{statistical.subscribe_nums}}
  57. </view>
  58. <view class="text">
  59. 学生人数
  60. </view>
  61. </view>
  62. <view class="item">
  63. <view class="nums">
  64. {{statistical.activity_nums}}
  65. </view>
  66. <view class="text">
  67. 发布活动
  68. </view>
  69. </view>
  70. <view class="item">
  71. <view class="nums">
  72. {{statistical.scheduling_nums}}
  73. </view>
  74. <view class="text">
  75. 值班次数
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="list">
  81. <view class="item" @click="record">
  82. <view class="left">
  83. <image src="../../static/images/list_1.png" mode=""></image>
  84. <text>我的值班</text>
  85. </view>
  86. <view class="right">
  87. <image src="../../static/images/list_arrow.png" mode=""></image>
  88. </view>
  89. </view>
  90. <view class="item" @click="notice">
  91. <view class="left">
  92. <image class="item_2" src="../../static/images/list_2.png" mode=""></image>
  93. <text>通知公告</text>
  94. </view>
  95. <view class="right">
  96. <image src="../../static/images/list_arrow.png" mode=""></image>
  97. </view>
  98. </view>
  99. <view class="item" @click="history">
  100. <view class="left">
  101. <image class="item_3" src="../../static/images/list_3.png" mode=""></image>
  102. <text>历史发布</text>
  103. </view>
  104. <view class="right">
  105. <image src="../../static/images/list_arrow.png" mode=""></image>
  106. </view>
  107. </view>
  108. <view class="item" v-if="Isopen && type==1" @click="to_pingjia">
  109. <view class="left">
  110. <image class="item_3" src="../../static/images/wenjuan.png" mode=""></image>
  111. <text>导师量化自评</text>
  112. </view>
  113. <view class="right">
  114. <image src="../../static/images/list_arrow.png" mode=""></image>
  115. </view>
  116. </view>
  117. <view class="item" @click="to_liuyan">
  118. <view class="left">
  119. <image class="item_3" src="../../static/images/liuyan.png" mode=""></image>
  120. <text>留言列表</text>
  121. </view>
  122. <view class="right">
  123. <image src="../../static/images/list_arrow.png" mode=""></image>
  124. </view>
  125. </view>
  126. <view class="item" @click="to_shuangchuang">
  127. <view class="left">
  128. <image class="item_3" src="../../static/images/chuang.png" mode=""></image>
  129. <text>双创列表</text>
  130. </view>
  131. <view class="right">
  132. <image src="../../static/images/list_arrow.png" mode=""></image>
  133. </view>
  134. </view>
  135. <view class="item" @click="change_password">
  136. <view class="left">
  137. <image class="item_3" src="../../static/images/change_pwd.png" mode=""></image>
  138. <text>修改密码</text>
  139. </view>
  140. <view class="right">
  141. <image src="../../static/images/list_arrow.png" mode=""></image>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="exit" @click="exit">
  147. 退出登录
  148. </view>
  149. <view class="banben">v1.0.1</view>
  150. </view>
  151. </template>
  152. <script>
  153. export default {
  154. data() {
  155. return {
  156. background: 'rgba(255,255,255,0)',
  157. mine: '',
  158. statistical: '', //统计信息
  159. Isopen:false,
  160. type:''
  161. }
  162. },
  163. onShow() {
  164. if (this.is_weixin()) {
  165. this.navTitle()
  166. }
  167. console.log(this.$store.state.vuex_user)
  168. this.$u.get('/base/auth/me').then(res => {
  169. this.mine = res.data
  170. if(this.mine.type_model){
  171. this.type = this.mine.type_model.type
  172. }
  173. console.log(this.mine,'mine')
  174. })
  175. this.getStatistical()
  176. },
  177. onLoad() {
  178. this.getIsopen()
  179. },
  180. methods: {
  181. //判断是否是微信
  182. is_weixin() {
  183. let ua = navigator.userAgent.toLowerCase();
  184. return ua.indexOf('micromessenger') != -1;
  185. },
  186. navTitle() {
  187. let navTitle = document.getElementsByTagName('uni-page-head');
  188. navTitle[0].style.display = 'none'
  189. },
  190. //统计信息
  191. getStatistical() {
  192. this.$u.get('/statistical').then(res => {
  193. console.log(res, 'ppp')
  194. this.statistical = res.data
  195. })
  196. },
  197. notice() {
  198. uni.navigateTo({
  199. url: './notice'
  200. })
  201. },
  202. //历史发布
  203. history() {
  204. uni.navigateTo({
  205. url: '../activity/history'
  206. })
  207. },
  208. record() {
  209. uni.navigateTo({
  210. url: './record'
  211. })
  212. },
  213. //退出登录
  214. exit() {
  215. this.$u.get('/base/auth/logout').then(res => {
  216. this.$u.vuex('vuex_token', '');
  217. this.$u.vuex('vuex_user', '');
  218. uni.reLaunch({
  219. url: '../login/index'
  220. })
  221. })
  222. },
  223. //编辑资料
  224. edit() {
  225. uni.navigateTo({
  226. url: '../index/realname?type=0'
  227. })
  228. },
  229. to_pingjia(){
  230. console.log(this.mine.type_model.id,'this.mine.type_model.id')
  231. uni.navigateTo({
  232. url:'../wenjuan/wenjuan?id='+this.mine.type_model.id
  233. })
  234. },
  235. getIsopen(){
  236. this.$u.get('/answer/is-answer-display-status').then(res => {
  237. console.log(res, '=======')
  238. this.Isopen = res.data.status
  239. })
  240. },
  241. change_password(){
  242. uni.navigateTo({
  243. url:'change_pwd'
  244. })
  245. },
  246. to_liuyan(){
  247. uni.navigateTo({
  248. url:'liuyan?tea_id='+this.mine.type_id
  249. })
  250. },
  251. to_shuangchuang(){
  252. uni.navigateTo({
  253. url:'shuangchuang'
  254. })
  255. }
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. page {
  261. background-color: #eee;
  262. }
  263. .mine {
  264. .top {
  265. height:214px;
  266. background: url(../../static/images/mine_bg.png);
  267. .info{
  268. display: flex;
  269. flex-direction: column;
  270. align-items: center;
  271. justify-content: center;
  272. padding-top: 38px;
  273. .img{
  274. width: 60px;
  275. height: 60px;
  276. border-radius: 50%;
  277. overflow: hidden;
  278. margin-bottom: 2px;
  279. background-position: center;
  280. background-repeat: no-repeat;
  281. background-size: cover;
  282. // image{
  283. // width: 60px;
  284. // height: 60px;
  285. // }
  286. }
  287. .info_name{
  288. font-weight: 500;
  289. font-size: 18px;
  290. line-height: 25px;
  291. color: #FFFFFF;
  292. }
  293. .edit {
  294. height: 17px;
  295. color: #fff;
  296. opacity: 0.8;
  297. font-weight: normal;
  298. font-size: 12px;
  299. line-height: 17px;
  300. margin-left: 3px;
  301. image{
  302. display: inline-block;
  303. vertical-align: middle;
  304. width: 4px;
  305. height: 6px;
  306. margin-left: 5px;
  307. }
  308. }
  309. }
  310. }
  311. .content {
  312. padding: 0 15px;
  313. margin-top: -60px;
  314. z-index: 2;
  315. .header {
  316. padding: 20px 15px 0;
  317. background-color: #fff;
  318. width: 100%;
  319. border-radius: 4px;
  320. .header_wrap{
  321. display: flex;
  322. flex-wrap: wrap;
  323. align-items: center;
  324. justify-items: center;
  325. }
  326. image {
  327. flex: 0 0 68px;
  328. height: 68px;
  329. width: 68px;
  330. margin-right: 16px;
  331. border-radius: 50%;
  332. }
  333. .right {
  334. width: 45%;
  335. display: flex;
  336. align-items: center;
  337. .dot{
  338. width: 5px;
  339. height: 5px;
  340. border-radius: 50%;
  341. background-color: #F1A321;
  342. margin-right: 8px;
  343. display: inline-block;
  344. flex-shrink: 0;
  345. }
  346. .text{
  347. overflow: hidden; //超出部分隐藏
  348. text-overflow: ellipsis; //超出部分使用省略号
  349. display: -webkit-box;//布局
  350. -webkit-line-clamp: 1;
  351. line-clamp: 1;//设置两行显示
  352. -webkit-box-orient: vertical;
  353. word-break: break-all;
  354. font-weight: normal;
  355. font-size: 13px;
  356. line-height: 14px;
  357. color: #222222;
  358. opacity: 0.8;
  359. text{
  360. font-weight: normal;
  361. font-size: 13px;
  362. line-height: 14px;
  363. color: #666666;
  364. opacity: 0.8;
  365. }
  366. }
  367. }
  368. .first{
  369. width: 55%;
  370. }
  371. .third{
  372. width: 100%;
  373. margin-bottom: 20px;
  374. margin-top: 10px;
  375. }
  376. .tip {
  377. padding: 30px 0;
  378. display: flex;
  379. align-items: center;
  380. justify-content: space-around;
  381. padding: 15px 0 25px 0;
  382. border-top: 1px solid #DDDDDD;
  383. .item {
  384. text-align: center;
  385. .nums {
  386. margin-right: 6px;
  387. font-weight: 500;
  388. font-size: 18px;
  389. line-height: 25px;
  390. color: #138E57;
  391. }
  392. .text {
  393. font-weight: normal;
  394. font-size: 14px;
  395. line-height: 20px;
  396. color: #353535;
  397. }
  398. }
  399. }
  400. }
  401. .list {
  402. background-color: #fff;
  403. padding: 0 16px;
  404. margin-top: 15px;
  405. .item {
  406. height:55px;
  407. line-height: 55px;
  408. display: flex;
  409. align-items: center;
  410. border-bottom: 1px solid rgba(238, 238, 238, .53);
  411. .left {
  412. font-weight: normal;
  413. font-size: 15px;
  414. flex: 1;
  415. color: #0C0C0C;
  416. display: flex;
  417. align-items: center;
  418. image{
  419. width: 24px;
  420. height: 24px;
  421. margin-right: 10px;
  422. }
  423. }
  424. .right{
  425. flex-shrink: 0;
  426. image{
  427. width: 4px;
  428. height: 6px;
  429. }
  430. }
  431. }
  432. }
  433. }
  434. .exit {
  435. font-size: 18px;
  436. font-family: PingFang SC;
  437. font-weight: bold;
  438. line-height: 20px;
  439. color: #393939;
  440. padding: 18px 0;
  441. text-align: center;
  442. margin: 20px 16px 0;
  443. background-color: #fff;
  444. }
  445. .banben{
  446. text-align: center;
  447. color: #999999;
  448. font-size: 12px;
  449. margin-top: 20px;
  450. margin-bottom: 10px;
  451. }
  452. }
  453. </style>