workbench.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <view class="work-panel">
  3. <view class="work-panel_header">
  4. <image class="image" src="/static/c+unselected.svg" mode="widthFix" />
  5. <view @click="onSearch" style="flex:1">
  6. <My_search placeholder="搜索全站关键字" disabled></My_search>
  7. </view>
  8. </view>
  9. <!-- 用户信息 -->
  10. <UserInfo :userInfoValue="userInfoValue" @selfCardClick="selfCardClick"></UserInfo>
  11. <view class="work-panel_signin" v-if="isSign">
  12. <text class="title">你已累计打卡{{ userInfoValue.signdays }}天</text>
  13. <navigator class="but" @click="toDailyYttendance" url="/packageA/dailyYttendance/index"
  14. hover-class="navigator-hover">
  15. 每日一签
  16. </navigator>
  17. </view>
  18. <view class="work-panel_applist">
  19. <template v-for="(item, index) in list">
  20. <navigator @click="switchPage(item)" class="app" url="#" :key="item.name">
  21. <view class="bg" :style="item.color">
  22. <image class="image" :src="`/static/workbench/${item.name}.svg`" mode="widthFix"></image>
  23. </view>
  24. <text class="name">{{ item.remark }}</text>
  25. </navigator>
  26. </template>
  27. </view>
  28. <view class="work-panel_options">
  29. <template v-for="(item, index) in list2">
  30. <navigator @click="switchPage(item)" class="option" :key="index" url="#" hover-class="navigator-hover"
  31. open-type="navigate">
  32. <view class="box">
  33. <text class="left">{{ item.remark }}</text>
  34. <view class="right">
  35. <view class="tag">{{ item.count }}</view>
  36. <u-icon name="arrow-right" color="#999999"></u-icon>
  37. </view>
  38. </view>
  39. </navigator>
  40. </template>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import UserInfo from './userInfo.vue'
  46. export default {
  47. components: { UserInfo },
  48. data() {
  49. return {
  50. updatePage: true,
  51. list: [],
  52. list2: [],
  53. colors: ['background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)',
  54. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  55. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  56. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  57. "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
  58. "background: linear-gradient( 225deg, #80D3EF 0%, #5DAAE6 100%)",
  59. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  60. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
  61. "background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)",
  62. "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)"
  63. ],
  64. content: {
  65. "pageNumber": 1,
  66. "pageSize": 20,
  67. "where": {
  68. "condition": "",
  69. "isnew": '',
  70. "class": ""
  71. }
  72. },
  73. userInfoValue: {rolenames:'',name:'',remarks:'',joindays:0,signdays:''},
  74. roles: [],
  75. auth:uni.getStorageSync('authList').资料库
  76. }
  77. },
  78. computed: {
  79. isSign () {
  80. console.log(!uni.getStorageSync('authList').资料库,!uni.getStorageSync('authList').资料库.每日一签,11111)
  81. if (!uni.getStorageSync('authList').资料库) return false
  82. if (!uni.getStorageSync('authList').资料库.每日一签) return false
  83. return true
  84. }
  85. },
  86. methods: {
  87. selfCardClick () {
  88. this.$Http.refreshUserInfoData = function () {
  89. this.getUserInfo()
  90. delete this.$Http.refreshUserInfoData
  91. }.bind(this)
  92. },
  93. async init(callBack) {
  94. this.getUserInfo().then(() => {
  95. callBack()
  96. })
  97. callBack()
  98. this.updatePage = false;
  99. },
  100. async getUserInfo() {
  101. return new Promise(async (resolve) => {
  102. let res = await this.$Http.basic({
  103. "id": "20240510104102",
  104. "content": {}
  105. })
  106. if (this.cutoff(res.msg)) return;
  107. this.userInfoValue = res.data
  108. this.userInfoValue.headpic = this.userInfoValue.attinfos.find(v => v.usetype == "headportrait") && this.userInfoValue.attinfos.find(v => v.usetype == "headportrait").url || '';
  109. await this.$Http.basic({
  110. "id": 20240510104102,
  111. "content": {
  112. }
  113. }).then(res => {
  114. let data = res.data
  115. let temp = uni.getStorageSync('authList').工作台导航
  116. temp.中奖明细.count = data.count_awardmx
  117. temp.通讯录.count = data.count_addressbook
  118. temp.我的预约.count = data.count_appointment
  119. temp.我的收藏.count = data.count_collect
  120. temp.考试成绩.count = data.count_coursewaretest
  121. temp.意见反馈.count = data.count_feedback
  122. this.list2 = Object.values(temp)
  123. resolve()
  124. })
  125. this.list = Object.values(uni.getStorageSync('authList').工作台)
  126. this.list = this.dye(this.list, this.colors, 1)
  127. })
  128. },
  129. toDailyYttendance() {
  130. this.$Http.updateUserInfo = this.getUserInfo.bind(this)
  131. },
  132. onSearch() {
  133. uni.navigateTo({
  134. url: '/cloud/globalSearch/index',
  135. })
  136. }
  137. },
  138. }
  139. </script>
  140. <style lang="scss">
  141. .work-panel {
  142. padding: 10px 10px 80px 10px;
  143. .work-panel_header {
  144. display: flex;
  145. align-items: center;
  146. .image {
  147. width: 40px;
  148. height: 20px;
  149. margin-right: 10px;
  150. }
  151. }
  152. .work-panel_signin {
  153. display: flex;
  154. align-items: center;
  155. justify-content: space-between;
  156. padding: 9px 15px;
  157. font-family: Source Han Sans SC, Source Han Sans SC;
  158. background: #FFFFFF;
  159. border-radius: 8px 8px 8px 8px;
  160. .title {
  161. font-weight: 400;
  162. font-size: 14px;
  163. color: #333333;
  164. }
  165. .but {
  166. font-weight: 500;
  167. font-size: 14px;
  168. color: #FFFFFF;
  169. background: linear-gradient(90deg, #C30D23 0%, #E3041F 100%);
  170. border-radius: 50px 50px 50px 50px;
  171. padding: 6px 15px;
  172. }
  173. }
  174. .work-panel_applist {
  175. display: flex;
  176. flex-wrap: wrap;
  177. margin: 10px 0;
  178. background: #ffffff;
  179. border-radius: 8px 8px 8px 8px;
  180. box-sizing: border-box;
  181. .app {
  182. display: flex;
  183. flex-direction: column;
  184. align-items: center;
  185. border-radius: 8px;
  186. padding: 15px;
  187. width: 25%;
  188. box-sizing: border-box;
  189. .bg {
  190. width: 44px;
  191. height: 44px;
  192. border-radius: 12px 12px 12px 12px;
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-evenly;
  196. align-content: center;
  197. background: linear-gradient(225deg, #81AEF3 0%, #6787E7 100%);
  198. .image {
  199. align-self: center;
  200. width: 24px;
  201. height: 24px;
  202. }
  203. }
  204. .name {
  205. font-family: Source Han Sans SC, Source Han Sans SC;
  206. font-weight: 400;
  207. font-size: 14px;
  208. color: #333333;
  209. margin-top: 10px;
  210. text-align: center;
  211. }
  212. }
  213. }
  214. .work-panel_options {
  215. background: #ffffff;
  216. border-radius: 8px;
  217. font-family: Source Han Sans SC, Source Han Sans SC;
  218. .option {
  219. padding: 15px 0 0 10px;
  220. &:first-child {
  221. border-top-left-radius: 8px;
  222. border-top-right-radius: 8px;
  223. }
  224. &:last-child {
  225. border-bottom-left-radius: 8px;
  226. border-bottom-right-radius: 8px;
  227. .box {
  228. border: none;
  229. }
  230. }
  231. .box {
  232. padding-bottom: 15px;
  233. padding-right: 15px;
  234. border-bottom: 1px solid #DDDDDD;
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. align-content: center;
  239. .left {
  240. font-weight: 400;
  241. font-size: 14px;
  242. color: #333333;
  243. }
  244. .right {
  245. display: flex;
  246. align-items: center;
  247. align-content: center;
  248. .tag {
  249. background: #BBBBBB;
  250. border-radius: 50px 50px 50px 50px;
  251. padding: 3px 12px;
  252. margin-right: 10px;
  253. font-family: PingFang SC, PingFang SC;
  254. font-weight: 400;
  255. font-size: 10px;
  256. color: #FFFFFF;
  257. margin-right: 10px;
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. </style>