workbench.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. if (!uni.getStorageSync('authList').资料库) return false
  81. if (!uni.getStorageSync('authList').资料库.每日一签) return false
  82. return true
  83. }
  84. },
  85. methods: {
  86. selfCardClick () {
  87. this.$Http.refreshUserInfoData = function () {
  88. this.getUserInfo()
  89. delete this.$Http.refreshUserInfoData
  90. }.bind(this)
  91. },
  92. async init(callBack) {
  93. this.getUserInfo().then(() => {
  94. callBack()
  95. })
  96. this.updatePage = false;
  97. },
  98. async getUserInfo() {
  99. return new Promise(async (resolve) => {
  100. let res = await this.$Http.basic({
  101. "id": "20240510104102",
  102. "content": {}
  103. })
  104. if (this.cutoff(res.msg)) return;
  105. this.userInfoValue = res.data
  106. this.userInfoValue.headpic = this.userInfoValue.attinfos.find(v => v.usetype == "headportrait") && this.userInfoValue.attinfos.find(v => v.usetype == "headportrait").url || '';
  107. await this.$Http.basic({
  108. "id": 20240510104102,
  109. "content": {
  110. }
  111. }).then(res => {
  112. let data = res.data
  113. let temp = uni.getStorageSync('authList').工作台导航
  114. temp.中奖明细.count = data.count_awardmx
  115. temp.通讯录.count = data.count_addressbook
  116. temp.我的预约.count = data.count_appointment
  117. temp.我的收藏.count = data.count_collect
  118. temp.考试成绩.count = data.count_coursewaretest
  119. temp.意见反馈.count = data.count_feedback
  120. this.list2 = Object.values(temp)
  121. resolve()
  122. })
  123. this.list = Object.values(uni.getStorageSync('authList').工作台)
  124. this.list = this.dye(this.list, this.colors, 1)
  125. })
  126. },
  127. toDailyYttendance() {
  128. this.$Http.updateUserInfo = this.getUserInfo.bind(this)
  129. },
  130. onSearch() {
  131. uni.navigateTo({
  132. url: '/cloud/globalSearch/index',
  133. })
  134. }
  135. },
  136. }
  137. </script>
  138. <style lang="scss">
  139. .work-panel {
  140. padding: 10px 10px 80px 10px;
  141. .work-panel_header {
  142. display: flex;
  143. align-items: center;
  144. .image {
  145. width: 40px;
  146. height: 20px;
  147. margin-right: 10px;
  148. }
  149. }
  150. .work-panel_signin {
  151. display: flex;
  152. align-items: center;
  153. justify-content: space-between;
  154. padding: 9px 15px;
  155. font-family: Source Han Sans SC, Source Han Sans SC;
  156. background: #FFFFFF;
  157. border-radius: 8px 8px 8px 8px;
  158. .title {
  159. font-weight: 400;
  160. font-size: 14px;
  161. color: #333333;
  162. }
  163. .but {
  164. font-weight: 500;
  165. font-size: 14px;
  166. color: #FFFFFF;
  167. background: linear-gradient(90deg, #C30D23 0%, #E3041F 100%);
  168. border-radius: 50px 50px 50px 50px;
  169. padding: 6px 15px;
  170. }
  171. }
  172. .work-panel_applist {
  173. display: flex;
  174. flex-wrap: wrap;
  175. margin: 10px 0;
  176. background: #ffffff;
  177. border-radius: 8px 8px 8px 8px;
  178. box-sizing: border-box;
  179. .app {
  180. display: flex;
  181. flex-direction: column;
  182. align-items: center;
  183. border-radius: 8px;
  184. padding: 15px;
  185. width: 25%;
  186. box-sizing: border-box;
  187. .bg {
  188. width: 44px;
  189. height: 44px;
  190. border-radius: 12px 12px 12px 12px;
  191. display: flex;
  192. align-items: center;
  193. justify-content: space-evenly;
  194. align-content: center;
  195. background: linear-gradient(225deg, #81AEF3 0%, #6787E7 100%);
  196. .image {
  197. align-self: center;
  198. width: 24px;
  199. height: 24px;
  200. }
  201. }
  202. .name {
  203. font-family: Source Han Sans SC, Source Han Sans SC;
  204. font-weight: 400;
  205. font-size: 14px;
  206. color: #333333;
  207. margin-top: 10px;
  208. text-align: center;
  209. }
  210. }
  211. }
  212. .work-panel_options {
  213. background: #ffffff;
  214. border-radius: 8px;
  215. font-family: Source Han Sans SC, Source Han Sans SC;
  216. .option {
  217. padding: 15px 0 0 10px;
  218. &:first-child {
  219. border-top-left-radius: 8px;
  220. border-top-right-radius: 8px;
  221. }
  222. &:last-child {
  223. border-bottom-left-radius: 8px;
  224. border-bottom-right-radius: 8px;
  225. .box {
  226. border: none;
  227. }
  228. }
  229. .box {
  230. padding-bottom: 15px;
  231. padding-right: 15px;
  232. border-bottom: 1px solid #DDDDDD;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. align-content: center;
  237. .left {
  238. font-weight: 400;
  239. font-size: 14px;
  240. color: #333333;
  241. }
  242. .right {
  243. display: flex;
  244. align-items: center;
  245. align-content: center;
  246. .tag {
  247. background: #BBBBBB;
  248. border-radius: 50px 50px 50px 50px;
  249. padding: 3px 12px;
  250. margin-right: 10px;
  251. font-family: PingFang SC, PingFang SC;
  252. font-weight: 400;
  253. font-size: 10px;
  254. color: #FFFFFF;
  255. margin-right: 10px;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. </style>