index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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" v-if="$transformAuth('100202')">
  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" v-if="$transformAuth('101100')">
  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" v-if="$transformAuth('101702')">
  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. <tab-bar :current="4"></tab-bar>
  151. </view>
  152. </template>
  153. <script>
  154. export default {
  155. data() {
  156. return {
  157. background: 'rgba(255,255,255,0)',
  158. mine: '',
  159. statistical: '', //统计信息
  160. Isopen:false,
  161. type:''
  162. }
  163. },
  164. onShow() {
  165. if (this.is_weixin()) {
  166. this.navTitle()
  167. }
  168. console.log(this.$store.state.vuex_user)
  169. this.$u.get('/base/auth/me').then(res => {
  170. this.mine = res.data
  171. if(this.mine.type_model){
  172. this.type = this.mine.type_model.type
  173. }
  174. console.log(this.mine,'mine')
  175. })
  176. this.getStatistical()
  177. },
  178. onLoad() {
  179. this.getIsopen()
  180. },
  181. methods: {
  182. //判断是否是微信
  183. is_weixin() {
  184. let ua = navigator.userAgent.toLowerCase();
  185. return ua.indexOf('micromessenger') != -1;
  186. },
  187. navTitle() {
  188. let navTitle = document.getElementsByTagName('uni-page-head');
  189. navTitle[0].style.display = 'none'
  190. },
  191. //统计信息
  192. getStatistical() {
  193. this.$u.get('/statistical').then(res => {
  194. console.log(res, 'ppp')
  195. this.statistical = res.data
  196. })
  197. },
  198. notice() {
  199. uni.navigateTo({
  200. url: './notice'
  201. })
  202. },
  203. //历史发布
  204. history() {
  205. uni.navigateTo({
  206. url: '../activity/history'
  207. })
  208. },
  209. record() {
  210. uni.navigateTo({
  211. url: './record'
  212. })
  213. },
  214. //退出登录
  215. exit() {
  216. this.$u.get('/base/auth/logout').then(res => {
  217. this.$u.vuex('vuex_token', '');
  218. this.$u.vuex('vuex_user', '');
  219. uni.reLaunch({
  220. url: '../login/index'
  221. })
  222. })
  223. },
  224. //编辑资料
  225. edit() {
  226. uni.navigateTo({
  227. url: '../index/realname?type=0'
  228. })
  229. },
  230. to_pingjia(){
  231. console.log(this.mine.type_model.id,'this.mine.type_model.id')
  232. uni.navigateTo({
  233. url:'../wenjuan/wenjuan?id='+this.mine.type_model.id
  234. })
  235. },
  236. getIsopen(){
  237. this.$u.get('/answer/is-answer-display-status').then(res => {
  238. console.log(res, '=======')
  239. this.Isopen = res.data.status
  240. })
  241. },
  242. change_password(){
  243. uni.navigateTo({
  244. url:'change_pwd'
  245. })
  246. },
  247. to_liuyan(){
  248. uni.navigateTo({
  249. url:'liuyan?tea_id='+this.mine.type_id
  250. })
  251. },
  252. to_shuangchuang(){
  253. uni.navigateTo({
  254. url:'shuangchuang'
  255. })
  256. }
  257. }
  258. }
  259. </script>
  260. <style lang="scss">
  261. page {
  262. background-color: #eee;
  263. padding-bottom: 70px;
  264. }
  265. .mine {
  266. .top {
  267. height:214px;
  268. background: url(../../static/images/mine_bg.png);
  269. .info{
  270. display: flex;
  271. flex-direction: column;
  272. align-items: center;
  273. justify-content: center;
  274. padding-top: 38px;
  275. .img{
  276. width: 60px;
  277. height: 60px;
  278. border-radius: 50%;
  279. overflow: hidden;
  280. margin-bottom: 2px;
  281. background-position: center;
  282. background-repeat: no-repeat;
  283. background-size: cover;
  284. // image{
  285. // width: 60px;
  286. // height: 60px;
  287. // }
  288. }
  289. .info_name{
  290. font-weight: 500;
  291. font-size: 18px;
  292. line-height: 25px;
  293. color: #FFFFFF;
  294. }
  295. .edit {
  296. height: 17px;
  297. color: #fff;
  298. opacity: 0.8;
  299. font-weight: normal;
  300. font-size: 12px;
  301. line-height: 17px;
  302. margin-left: 3px;
  303. image{
  304. display: inline-block;
  305. vertical-align: middle;
  306. width: 4px;
  307. height: 6px;
  308. margin-left: 5px;
  309. }
  310. }
  311. }
  312. }
  313. .content {
  314. padding: 0 15px;
  315. margin-top: -60px;
  316. z-index: 2;
  317. .header {
  318. padding: 20px 15px 0;
  319. background-color: #fff;
  320. width: 100%;
  321. border-radius: 4px;
  322. .header_wrap{
  323. display: flex;
  324. flex-wrap: wrap;
  325. align-items: center;
  326. justify-items: center;
  327. }
  328. image {
  329. flex: 0 0 68px;
  330. height: 68px;
  331. width: 68px;
  332. margin-right: 16px;
  333. border-radius: 50%;
  334. }
  335. .right {
  336. width: 45%;
  337. display: flex;
  338. align-items: center;
  339. .dot{
  340. width: 5px;
  341. height: 5px;
  342. border-radius: 50%;
  343. background-color: #F1A321;
  344. margin-right: 8px;
  345. display: inline-block;
  346. flex-shrink: 0;
  347. }
  348. .text{
  349. overflow: hidden; //超出部分隐藏
  350. text-overflow: ellipsis; //超出部分使用省略号
  351. display: -webkit-box;//布局
  352. -webkit-line-clamp: 1;
  353. line-clamp: 1;//设置两行显示
  354. -webkit-box-orient: vertical;
  355. word-break: break-all;
  356. font-weight: normal;
  357. font-size: 13px;
  358. line-height: 14px;
  359. color: #222222;
  360. opacity: 0.8;
  361. text{
  362. font-weight: normal;
  363. font-size: 13px;
  364. line-height: 14px;
  365. color: #666666;
  366. opacity: 0.8;
  367. }
  368. }
  369. }
  370. .first{
  371. width: 55%;
  372. }
  373. .third{
  374. width: 100%;
  375. margin-bottom: 20px;
  376. margin-top: 10px;
  377. }
  378. .tip {
  379. padding: 30px 0;
  380. display: flex;
  381. align-items: center;
  382. justify-content: space-around;
  383. padding: 15px 0 25px 0;
  384. border-top: 1px solid #DDDDDD;
  385. .item {
  386. text-align: center;
  387. .nums {
  388. margin-right: 6px;
  389. font-weight: 500;
  390. font-size: 18px;
  391. line-height: 25px;
  392. color: #138E57;
  393. }
  394. .text {
  395. font-weight: normal;
  396. font-size: 14px;
  397. line-height: 20px;
  398. color: #353535;
  399. }
  400. }
  401. }
  402. }
  403. .list {
  404. background-color: #fff;
  405. padding: 0 16px;
  406. margin-top: 15px;
  407. .item {
  408. height:55px;
  409. line-height: 55px;
  410. display: flex;
  411. align-items: center;
  412. border-bottom: 1px solid rgba(238, 238, 238, .53);
  413. .left {
  414. font-weight: normal;
  415. font-size: 15px;
  416. flex: 1;
  417. color: #0C0C0C;
  418. display: flex;
  419. align-items: center;
  420. image{
  421. width: 24px;
  422. height: 24px;
  423. margin-right: 10px;
  424. }
  425. }
  426. .right{
  427. flex-shrink: 0;
  428. image{
  429. width: 4px;
  430. height: 6px;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. .exit {
  437. font-size: 18px;
  438. font-family: PingFang SC;
  439. font-weight: bold;
  440. line-height: 20px;
  441. color: #393939;
  442. padding: 18px 0;
  443. text-align: center;
  444. margin: 20px 16px 0;
  445. background-color: #fff;
  446. }
  447. .banben{
  448. text-align: center;
  449. color: #999999;
  450. font-size: 12px;
  451. margin-top: 20px;
  452. margin-bottom: 10px;
  453. }
  454. }
  455. </style>