workbench.vue 8.4 KB

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