workspace.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="menu">
  7. <view class="menu-item" @click="toShow1()">
  8. <view class="menu-item-p">
  9. <p v-bind:class="showList1?'lor':'unlor'">待传脚本</p>
  10. </view>
  11. <span class="point" v-if="showPoint1" key="0"></span>
  12. </view>
  13. <view class="menu-item" @click="toShow2()">
  14. <view class="menu-item-p">
  15. <p v-bind:class="showList2?'lor':'unlor'">待传初稿</p>
  16. </view>
  17. <span class="point" v-if="showPoint2" key="1"></span>
  18. </view>
  19. <view class="menu-item" @click="toShow3()">
  20. <view class="menu-item-p">
  21. <p v-bind:class="showList3?'lor':'unlor'">待传链接</p>
  22. </view>
  23. <span class="point" v-if="showPoint3" key="2"></span>
  24. </view>
  25. <view class="menu-item" @click="toShow4()">
  26. <view class="menu-item-p">
  27. <p v-bind:class="showList4?'lor':'unlor'">待传数据</p>
  28. </view>
  29. <span class="point" v-if="showPoint4" key="3"></span>
  30. </view>
  31. </view>
  32. <view class="home" v-if="showList1 && !loading" style="padding-top: 100rpx;">
  33. <view class="task" v-for="item in List1">
  34. <view @click="toDetail(item)">
  35. <view class="task-head">
  36. <view class="task-head-account">
  37. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  38. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  39. </view>
  40. <view class="task-head-status">
  41. <p>{{item.task_stage_txt}}</p>
  42. </view>
  43. </view>
  44. <view class="task-info">
  45. <view class="task-info-left">
  46. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  47. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  48. </view>
  49. <view class="task-info-right" v-if="item.isShowModify">
  50. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  51. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="home" v-if="showList2 && !loading" style="padding-top: 100rpx;">
  58. <view class="task" v-for="item in List2">
  59. <view @click="toDetail(item)">
  60. <view class="task-head">
  61. <view class="task-head-account">
  62. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  63. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  64. </view>
  65. <view class="task-head-status">
  66. <p>{{item.task_stage_txt}}</p>
  67. </view>
  68. </view>
  69. <view class="task-info">
  70. <view class="task-info-left">
  71. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  72. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  73. </view>
  74. <view class="task-info-right" v-if="item.isShowModify">
  75. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  76. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="home" v-if="showList3 && !loading" style="padding-top: 100rpx;">
  83. <view class="task" v-for="item in List3">
  84. <view @click="toDetail(item)">
  85. <view class="task-head">
  86. <view class="task-head-account">
  87. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  88. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  89. </view>
  90. <view class="task-head-status">
  91. <p>{{item.task_stage_txt}}</p>
  92. </view>
  93. </view>
  94. <view class="task-info">
  95. <view class="task-info-left">
  96. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  97. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  98. </view>
  99. <view class="task-info-right" v-if="item.isShowModify">
  100. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  101. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="home" v-if="showList4 && !loading" style="padding-top: 100rpx;">
  108. <view class="task" v-for="item in List4">
  109. <view @click="toDetail(item)">
  110. <view class="task-head">
  111. <view class="task-head-account">
  112. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  113. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  114. </view>
  115. <view class="task-head-status">
  116. <p>{{item.task_stage_txt}}</p>
  117. </view>
  118. </view>
  119. <view class="task-info">
  120. <view class="task-info-left">
  121. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  122. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  123. </view>
  124. <view class="task-info-right" v-if="item.isShowModify">
  125. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  126. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import mvBar from "@/components/mys_navBar/mysNavBar";
  136. export default {
  137. components: {
  138. mvBar,
  139. },
  140. data() {
  141. return {
  142. loading: true,
  143. showPoint1: false,
  144. showPoint2: false,
  145. showPoint3: false,
  146. showPoint4: false,
  147. navH: getApp().globalData.navHeight,
  148. showList1: true,
  149. showList2: false,
  150. showList3: false,
  151. showList4: false,
  152. List1: [],
  153. List2: [],
  154. List3: [],
  155. List4: [],
  156. taskStageList: [],
  157. mysNavConfig: {
  158. /* 开启单页显示首页图标 */
  159. isHome: true,
  160. /* 固定导航 */
  161. navFixed: true,
  162. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  163. navTitle: {
  164. text: "工作台",
  165. color: "",
  166. fontSize: "32rpx", // px upx rpx
  167. fontWeight: "normal", // 100 - 700
  168. },
  169. },
  170. list: [{
  171. account: {
  172. platform: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_MsjI7CSK_6e62AG2AGOvh1HgAcA_35_35.png",
  173. nickname: "丸子在成都",
  174. },
  175. status: "待确认",
  176. mainphoto: "https://static1.paizi.com/uploadfile/2018/1013/20181013013207465.png",
  177. taskname: "醉码头火锅太古里店",
  178. }, {
  179. account: {
  180. platform: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/pingtai2.png",
  181. nickname: "成都的一颗丸子",
  182. },
  183. status: "待确认",
  184. mainphoto: "https://tse1-mm.cn.bing.net/th/id/R-C.978cb3a3b27875a0cc9d78a254b30b8f?rik=yrP2kNCtfQYEgQ&riu=http%3a%2f%2fnews.southcn.com%2fgd%2fcontent%2fimages%2fattachement%2fpng%2fsite4%2f20190917%2feca86b61fd551eeb23c507.png&ehk=xuWbgLrNmyhNJaByMZPJrX81PrzXrLHqHM%2fdYatFhrs%3d&risl=&pid=ImgRaw&r=0&sres=1&sresct=1",
  185. taskname: "奥运吉祥物冰墩墩盲盒",
  186. }],
  187. }
  188. },
  189. async onShow() {
  190. this.token = uni.getStorageSync('token')
  191. await this.$https.get('/youngee/c/t/g/is-login')
  192. .then(res => {
  193. console.log(res)
  194. if (res.data.code == 403) {
  195. this.token = ""
  196. uni.clearStorage();
  197. }
  198. });
  199. if (this.token !== '') { // 若登录
  200. this.showList2 = false;
  201. this.showList3 = false;
  202. this.showList4 = false;
  203. this.showList1 = true;
  204. this.getList();
  205. } else {
  206. uni.showModal({
  207. content: '请先登录',
  208. success: function(res) {
  209. uni.navigateTo({
  210. url: '../login/login'
  211. });
  212. }
  213. });
  214. }
  215. },
  216. methods: {
  217. async getList() {
  218. this.loading = true
  219. uni.showLoading({
  220. title: '加载中'
  221. });
  222. var taskList = [];
  223. this.showPoint1 = false
  224. this.showPoint2 = false
  225. this.showPoint3 = false
  226. this.showPoint4 = false
  227. await this.$https.get('/youngee/c/t/g/get-task-exe-list').then(res => {
  228. console.log(res)
  229. taskList = res.data.data.list1
  230. if (taskList != null) {
  231. this.showPoint1 = true
  232. for (let i = 0; i < taskList.length; ++i) {
  233. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  234. for (let j = 0; j < productPhoto.length; j++) {
  235. if (productPhoto[j].Symbol == 1) {
  236. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  237. }
  238. }
  239. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  240. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  241. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  242. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  243. taskList[i].isShowModify = true
  244. } else {
  245. taskList[i].isShowModify = false
  246. }
  247. for (let j = 0; j < this.taskStageList.length; ++j) {
  248. if (taskList[i].task_stage == this.taskStageList[j]
  249. .task_stage_id)
  250. taskList[i].task_stage_txt = this.taskStageList[j]
  251. .task_stage
  252. }
  253. }
  254. }
  255. this.List1 = taskList;
  256. taskList = res.data.data.list2
  257. if (taskList != null) {
  258. this.showPoint2 = true
  259. for (let i = 0; i < taskList.length; ++i) {
  260. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  261. for (let j = 0; j < productPhoto.length; j++) {
  262. if (productPhoto[j].Symbol == 1) {
  263. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  264. }
  265. }
  266. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  267. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  268. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  269. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  270. taskList[i].isShowModify = true
  271. } else {
  272. taskList[i].isShowModify = false
  273. }
  274. for (let j = 0; j < this.taskStageList.length; ++j) {
  275. if (taskList[i].task_stage == this.taskStageList[j]
  276. .task_stage_id)
  277. taskList[i].task_stage_txt = this.taskStageList[j]
  278. .task_stage
  279. }
  280. }
  281. }
  282. this.List2 = taskList;
  283. taskList = res.data.data.list3
  284. if (taskList != null) {
  285. this.showPoint3 = true
  286. for (let i = 0; i < taskList.length; ++i) {
  287. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  288. for (let j = 0; j < productPhoto.length; j++) {
  289. if (productPhoto[j].Symbol == 1) {
  290. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  291. }
  292. }
  293. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  294. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  295. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  296. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  297. taskList[i].isShowModify = true
  298. } else {
  299. taskList[i].isShowModify = false
  300. }
  301. for (let j = 0; j < this.taskStageList.length; ++j) {
  302. if (taskList[i].task_stage == this.taskStageList[j]
  303. .task_stage_id)
  304. taskList[i].task_stage_txt = this.taskStageList[j]
  305. .task_stage
  306. }
  307. }
  308. }
  309. this.List3 = taskList;
  310. taskList = res.data.data.list4
  311. if (taskList != null) {
  312. this.showPoint4 = true
  313. for (let i = 0; i < taskList.length; ++i) {
  314. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  315. for (let j = 0; j < productPhoto.length; j++) {
  316. if (productPhoto[j].Symbol == 1) {
  317. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  318. }
  319. }
  320. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  321. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  322. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  323. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  324. taskList[i].isShowModify = true
  325. } else {
  326. taskList[i].isShowModify = false
  327. }
  328. for (let j = 0; j < this.taskStageList.length; ++j) {
  329. if (taskList[i].task_stage == this.taskStageList[j]
  330. .task_stage_id)
  331. taskList[i].task_stage_txt = this.taskStageList[j]
  332. .task_stage
  333. }
  334. }
  335. }
  336. this.List4 = taskList;
  337. })
  338. uni.hideLoading();
  339. this.loading = false
  340. },
  341. toShow1() {
  342. this.showList2 = false;
  343. this.showList3 = false;
  344. this.showList4 = false;
  345. this.showList1 = true;
  346. this.getList();
  347. },
  348. toShow2() {
  349. this.showList1 = false;
  350. this.showList3 = false;
  351. this.showList4 = false;
  352. this.showList2 = true;
  353. this.getList();
  354. },
  355. toShow3() {
  356. this.showList2 = false;
  357. this.showList1 = false;
  358. this.showList4 = false;
  359. this.showList3 = true;
  360. this.getList();
  361. },
  362. toShow4() {
  363. this.showList2 = false;
  364. this.showList1 = false;
  365. this.showList3 = false;
  366. this.showList4 = true;
  367. this.getList();
  368. },
  369. toDetail(item) {
  370. uni.navigateTo({
  371. url: '/pages/workspace/taskdetail?taskId=' + item.task_id,
  372. success(res) {
  373. console.log(res);
  374. },
  375. fail(err) {
  376. console.log(err);
  377. }
  378. });
  379. },
  380. }
  381. }
  382. </script>
  383. <style lang="scss" scoped>
  384. view {
  385. font-size: 14px;
  386. line-height: inherit;
  387. }
  388. .menu {
  389. position: fixed;
  390. border-bottom: #FCCF41;
  391. background-color: #FFFFFF;
  392. justify-content: space-around;
  393. height: 100rpx;
  394. width: 100%;
  395. display: flex;
  396. z-index: 10;
  397. }
  398. .menu-item {
  399. display: flex;
  400. }
  401. .menu-item-p p {
  402. font-weight: 600;
  403. &.lor {
  404. border-bottom: 5rpx solid #F0D232;
  405. color: #F0D232;
  406. padding-bottom: 15rpx;
  407. }
  408. &.unlor {
  409. border-bottom: 5rpx solid #fff;
  410. color: #81838f;
  411. padding-bottom: 15rpx;
  412. }
  413. }
  414. .home {
  415. margin-top: 100rpx;
  416. }
  417. .task {
  418. margin-bottom: 20rpx;
  419. border-bottom: 1rpx #d7d7d7 solid;
  420. .task-head {
  421. display: flex;
  422. justify-content: space-between;
  423. align-items: center;
  424. padding: 10rpx 20rpx;
  425. .task-head-account {
  426. display: flex;
  427. }
  428. .task-head-status {
  429. color: red;
  430. }
  431. }
  432. .task-info {
  433. display: flex;
  434. align-items: center;
  435. justify-content: space-between;
  436. padding: 10rpx 20rpx;
  437. .task-info-left {
  438. display: flex;
  439. align-items: center;
  440. }
  441. .task-info-right {
  442. width: 100rpx;
  443. height: 100rpx;
  444. border-radius: 50%;
  445. border: #ffcb41 2rpx solid;
  446. display: flex;
  447. align-items: center;
  448. justify-content: center;
  449. }
  450. }
  451. }
  452. .line {
  453. border-bottom: 1rpx #AAAAAA solid;
  454. }
  455. .menu-point {
  456. position: relative;
  457. left: 30rpx;
  458. top: 20rpx;
  459. }
  460. .point {
  461. width: 6px;
  462. height: 6px;
  463. background: red;
  464. border-radius: 50%;
  465. }
  466. </style>