mine.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view :style="{'padding-top':navHeight+ 'px'}">
  3. <header-nav>
  4. <view style="font-size:#333333 ;font-weight: 550;font-size: 14px;" class="term-name"
  5. @click="selectTermShow=true">
  6. <u-icon name="arrow-down-fill" style="margin-right: 5px;"></u-icon>{{term_name}}
  7. </view>
  8. <u-picker v-model="selectTermShow" mode="selector" :range="term_list" range-key="name"
  9. @confirm="changeTerm"></u-picker>
  10. </header-nav>
  11. <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30 min-top">
  12. <view class="u-flex-1">
  13. <view class="u-font-18 u-p-b-20" style="font-size: 18px;font-weight: bold;">{{username.name}}</view>
  14. <view class="u-font-14 u-tips-color">
  15. {{username.department.name == '--' ? '超级管理员' : username.department.name}}
  16. </view>
  17. </view>
  18. <view class="u-m-l-10 u-p-10" @click="history">
  19. <view class="message">
  20. <u-icon name="bell-fill" class="notice-icon" size="28">
  21. </u-icon>历史消息
  22. </view>
  23. </view>
  24. </view>
  25. <view class="list">
  26. <view class="list-item" @click="laboratory" v-if="$transformAuth('100701')">
  27. <image src="../../static/image/mine/icon_1.png" mode="" class="icon"></image>
  28. <view class="text">
  29. 实验室管理
  30. </view>
  31. <view class="right-icon">
  32. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  33. </view>
  34. </view>
  35. <view class="list-item" @click="tutorial" v-if="$transformAuth('100205')|| $transformAuth('100207') || $transformAuth('100208')">
  36. <image src="../../static/image/mine/icon_2.png" mode="" class="icon"></image>
  37. <view class="text">
  38. 调/停/补课审批记录
  39. </view>
  40. <view class="right-icon">
  41. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  42. </view>
  43. </view>
  44. <view class="list-item" @click="record" v-if="$transformAuth('100103')|| $transformAuth('100101')||$transformAuth('100102')">
  45. <image src="../../static/image/mine/icon_3.png" mode="" class="icon"></image>
  46. <view class="text">
  47. 开放预约记录
  48. </view>
  49. <view class="right-icon">
  50. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  51. </view>
  52. </view>
  53. <view class="list-item" @click="userApproval" v-if="$transformAuth('100301')">
  54. <image src="../../static/image/mine/icon_4.png" mode="" class="icon"></image>
  55. <view class="text">
  56. 账号审批记录
  57. </view>
  58. <view class="right-icon">
  59. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  60. </view>
  61. </view>
  62. <view class="list-item" @click="notice">
  63. <image src="../../static/image/mine/icon_5.png" mode="" class="icon"></image>
  64. <view class="text">
  65. 通知公告
  66. </view>
  67. <view class="right-icon">
  68. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  69. </view>
  70. </view>
  71. <view class="list-item" @click="revisePass">
  72. <image src="../../static/image/mine/edit1.png" mode="" class="icon"></image>
  73. <view class="text">
  74. 修改密码
  75. </view>
  76. <view class="right-icon">
  77. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  78. </view>
  79. </view>
  80. <view class="list-item" @click="logout">
  81. <image src="../../static/image/mine/icon_6.png" mode="" class="icon"></image>
  82. <view class="text">
  83. 退出登录
  84. </view>
  85. <view class="right-icon">
  86. <u-icon name="arrow-right" class="notice-icon" size="28" color="#999999"></u-icon>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. var app = getApp()
  94. export default {
  95. data() {
  96. return {
  97. pic: 'https://uviewui.com/common/logo.png',
  98. show: true,
  99. username: this.$store.state.vuex_user,
  100. is_monitor: false,
  101. is_polling: false,
  102. is_admin: false,
  103. navHeight: app.globalData.navHeight,
  104. term_name: '',
  105. selectTermShow: false,
  106. term_list: []
  107. }
  108. },
  109. onShow() {
  110. console.log(this.$store.state.vuex_user, 'this.$store.state.vuex_user')
  111. this.checkRole()
  112. this.term_name = this.vuex_term_name
  113. },
  114. onLoad() {
  115. this.getTermList()
  116. },
  117. methods: {
  118. //切换学期
  119. changeTerm(e) {
  120. let index = e[0]
  121. console.log(index, '---------')
  122. let data=this.term_list[index]
  123. this.$u.vuex('vuex_term_name', data.name);
  124. this.$u.vuex('vuex_term_id', data.id)
  125. this.$u.vuex('vuex_term_weeks', data.weeks)
  126. uni.reLaunch({
  127. url:'/pages/mine/mine'
  128. })
  129. },
  130. //获取学期
  131. getTermList() {
  132. this.$u.get('/school/term-select-options', {
  133. status: 1
  134. }).then(res => {
  135. this.term_list = res.data
  136. })
  137. },
  138. //判断权限
  139. checkRole() {
  140. let status = false
  141. let roles = this.$store.state.vuex_user.roles
  142. let arr = []
  143. // roles.map(item => {
  144. // arr.push(item.name)
  145. // })
  146. let index = arr.indexOf('polling')
  147. if (index >= 0) this.is_polling = true
  148. let index2 = arr.indexOf('monitor')
  149. if (index2 >= 0) this.is_monitor = true
  150. let index3 = arr.indexOf('admin')
  151. if (index3 >= 0) this.is_admin = true
  152. console.log(index, index2, index3)
  153. },
  154. //修改密码
  155. changePwd() {
  156. uni.navigateTo({
  157. url: './changePwd'
  158. })
  159. },
  160. //分配历史
  161. fenpeiHistory() {
  162. uni.navigateTo({
  163. url: './history'
  164. })
  165. },
  166. //历史任务
  167. myTask() {
  168. uni.navigateTo({
  169. url: './myTask'
  170. })
  171. },
  172. //我的反馈
  173. feedBack() {
  174. uni.navigateTo({
  175. url: './fankui'
  176. })
  177. },
  178. //历史记录
  179. history() {
  180. uni.navigateTo({
  181. url: '/pages/laboratory/history'
  182. })
  183. },
  184. //实验室管理
  185. laboratory() {
  186. uni.navigateTo({
  187. url: '/pages/laboratory/manage'
  188. })
  189. },
  190. tutorial() {
  191. //调停补课记录
  192. uni.navigateTo({
  193. url: '/pages/record/tutorialRecord'
  194. })
  195. },
  196. userApproval() {
  197. //账号审批记录
  198. uni.navigateTo({
  199. url: '/pages/record/userApproval'
  200. })
  201. },
  202. //通知公告
  203. notice() {
  204. uni.navigateTo({
  205. url: '/pages/mine/notice'
  206. })
  207. },
  208. //开放预约记录
  209. record() {
  210. uni.navigateTo({
  211. url: '/pages/record/reserve'
  212. })
  213. },
  214. revisePass() {
  215. //修改密码
  216. uni.navigateTo({
  217. url: '/pages/mine/revisePass'
  218. })
  219. },
  220. //退出登录
  221. logout() {
  222. this.$u.get('/auth/logout').then(res => {
  223. this.$u.toast('修改成功请重新登陆')
  224. this.$u.vuex('vuex_token', '');
  225. this.$u.vuex('vuex_user', '');
  226. this.$u.vuex('vuex_id', '');
  227. uni.reLaunch({
  228. url: '/pages/login/login'
  229. })
  230. })
  231. },
  232. }
  233. }
  234. </script>
  235. <style lang="scss" scoped>
  236. .user-box {
  237. padding-top: 15px;
  238. background-color: #fff;
  239. border-bottom: solid 1px #F2F2F2;
  240. }
  241. .term-name {
  242. overflow: hidden;
  243. white-space: nowrap;
  244. text-overflow: ellipsis;
  245. }
  246. // .min-top {
  247. // border-bottom: solid 1px #F2F2F2;
  248. // }
  249. .message {
  250. display: inline-block;
  251. background-color: #3665FF;
  252. color: #FFFFFF;
  253. padding: 5px 10px;
  254. font-size: 12px;
  255. border-radius: 14px;
  256. }
  257. .list-item {
  258. display: flex;
  259. // height: 65px;
  260. // line-height: 65px;
  261. align-items: center;
  262. padding: 15px;
  263. font-size: 15px;
  264. font-weight: bold;
  265. border-bottom: solid 1px #F2F2F2;
  266. .text {
  267. flex: 1;
  268. }
  269. .icon {
  270. margin-right: 8px;
  271. height: 24px;
  272. width: 24px;
  273. }
  274. }
  275. </style>