workspace.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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. if (res.data.code == 403) {
  194. this.token = ""
  195. uni.clearStorage();
  196. }
  197. });
  198. if (this.token !== '') { // 若登录
  199. this.showList2 = false;
  200. this.showList3 = false;
  201. this.showList4 = false;
  202. this.showList1 = true;
  203. this.getList(1);
  204. // this.getExeNum();
  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. // getExeNum() {
  218. // return this.$https.get('/youngee/c/t/g/get-task-exe-num')
  219. // .then(res => {
  220. // if (res.data.data != null) {
  221. // let nums = res.data.data
  222. // this.showPoint1 = false
  223. // this.showPoint2 = false
  224. // this.showPoint3 = false
  225. // this.showPoint4 = false
  226. // for (let i = 0; i < nums.length; ++i) {
  227. // if (nums[i].task_stage == 7 && nums[i]["COUNT(*)"] != 0) {
  228. // this.showPoint1 = true
  229. // }
  230. // if (nums[i].task_stage == 9 && nums[i]["COUNT(*)"] != 0) {
  231. // this.showPoint2 = true
  232. // }
  233. // if (nums[i].task_stage == 11 && nums[i]["COUNT(*)"] != 0) {
  234. // this.showPoint3 = true
  235. // }
  236. // if (nums[i].task_stage == 13 && nums[i]["COUNT(*)"] != 0) {
  237. // this.showPoint4 = true
  238. // }
  239. // }
  240. // }
  241. // });
  242. // },
  243. async getList(value) {
  244. this.loading = true
  245. uni.showLoading({
  246. title: '加载中'
  247. });
  248. this.$https.get('/youngee/c/t/g/get-task-exe-num')
  249. .then(res => {
  250. if (res.data.data != null) {
  251. let nums = res.data.data
  252. this.showPoint1 = false
  253. this.showPoint2 = false
  254. this.showPoint3 = false
  255. this.showPoint4 = false
  256. for (let i = 0; i < nums.length; ++i) {
  257. if (nums[i].task_stage == 7 && nums[i]["COUNT(*)"] != 0) {
  258. this.showPoint1 = true
  259. }
  260. if (nums[i].task_stage == 9 && nums[i]["COUNT(*)"] != 0) {
  261. this.showPoint2 = true
  262. }
  263. if (nums[i].task_stage == 11 && nums[i]["COUNT(*)"] != 0) {
  264. this.showPoint3 = true
  265. }
  266. if (nums[i].task_stage == 13 && nums[i]["COUNT(*)"] != 0) {
  267. this.showPoint4 = true
  268. }
  269. }
  270. }
  271. });
  272. var taskList = [];
  273. await this.$https.get('/youngee/c/t/g/get-task-exe-list' +
  274. "?" +
  275. "taskStage" +
  276. "=" +
  277. value).then(res => {
  278. taskList = res.data.data.list1
  279. if (taskList != null) {
  280. for (let i = 0; i < taskList.length; ++i) {
  281. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  282. for (let j = 0; j < productPhoto.length; j++) {
  283. if (productPhoto[j].Symbol == 1) {
  284. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  285. }
  286. }
  287. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  288. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  289. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  290. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  291. taskList[i].isShowModify = true
  292. } else {
  293. taskList[i].isShowModify = false
  294. }
  295. for (let j = 0; j < this.taskStageList.length; ++j) {
  296. if (taskList[i].task_stage == this.taskStageList[j]
  297. .task_stage_id)
  298. taskList[i].task_stage_txt = this.taskStageList[j]
  299. .task_stage
  300. }
  301. }
  302. }
  303. switch (value) {
  304. case 1:
  305. this.List1 = taskList;
  306. break;
  307. case 2:
  308. this.List2 = taskList;
  309. break;
  310. case 3:
  311. this.List3 = taskList;
  312. break;
  313. case 4:
  314. this.List4 = taskList;
  315. break;
  316. default:
  317. break;
  318. }
  319. // taskList = res.data.data.list1
  320. // if (taskList != null) {
  321. // this.showPoint1 = true
  322. // for (let i = 0; i < taskList.length; ++i) {
  323. // let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  324. // for (let j = 0; j < productPhoto.length; j++) {
  325. // if (productPhoto[j].Symbol == 1) {
  326. // taskList[i].product_img_url = productPhoto[j].PhotoUrl
  327. // }
  328. // }
  329. // if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  330. // (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  331. // (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  332. // (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  333. // taskList[i].isShowModify = true
  334. // } else {
  335. // taskList[i].isShowModify = false
  336. // }
  337. // for (let j = 0; j < this.taskStageList.length; ++j) {
  338. // if (taskList[i].task_stage == this.taskStageList[j]
  339. // .task_stage_id)
  340. // taskList[i].task_stage_txt = this.taskStageList[j]
  341. // .task_stage
  342. // }
  343. // }
  344. // }
  345. // this.List1 = taskList;
  346. // taskList = res.data.data.list2
  347. // if (taskList != null) {
  348. // this.showPoint2 = true
  349. // for (let i = 0; i < taskList.length; ++i) {
  350. // let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  351. // for (let j = 0; j < productPhoto.length; j++) {
  352. // if (productPhoto[j].Symbol == 1) {
  353. // taskList[i].product_img_url = productPhoto[j].PhotoUrl
  354. // }
  355. // }
  356. // if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  357. // (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  358. // (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  359. // (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  360. // taskList[i].isShowModify = true
  361. // } else {
  362. // taskList[i].isShowModify = false
  363. // }
  364. // for (let j = 0; j < this.taskStageList.length; ++j) {
  365. // if (taskList[i].task_stage == this.taskStageList[j]
  366. // .task_stage_id)
  367. // taskList[i].task_stage_txt = this.taskStageList[j]
  368. // .task_stage
  369. // }
  370. // }
  371. // }
  372. // this.List2 = taskList;
  373. // taskList = res.data.data.list3
  374. // if (taskList != null) {
  375. // this.showPoint3 = true
  376. // for (let i = 0; i < taskList.length; ++i) {
  377. // let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  378. // for (let j = 0; j < productPhoto.length; j++) {
  379. // if (productPhoto[j].Symbol == 1) {
  380. // taskList[i].product_img_url = productPhoto[j].PhotoUrl
  381. // }
  382. // }
  383. // if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  384. // (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  385. // (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  386. // (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  387. // taskList[i].isShowModify = true
  388. // } else {
  389. // taskList[i].isShowModify = false
  390. // }
  391. // for (let j = 0; j < this.taskStageList.length; ++j) {
  392. // if (taskList[i].task_stage == this.taskStageList[j]
  393. // .task_stage_id)
  394. // taskList[i].task_stage_txt = this.taskStageList[j]
  395. // .task_stage
  396. // }
  397. // }
  398. // }
  399. // this.List3 = taskList;
  400. // taskList = res.data.data.list4
  401. // if (taskList != null) {
  402. // this.showPoint4 = true
  403. // for (let i = 0; i < taskList.length; ++i) {
  404. // let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  405. // for (let j = 0; j < productPhoto.length; j++) {
  406. // if (productPhoto[j].Symbol == 1) {
  407. // taskList[i].product_img_url = productPhoto[j].PhotoUrl
  408. // }
  409. // }
  410. // if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  411. // (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  412. // (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  413. // (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  414. // taskList[i].isShowModify = true
  415. // } else {
  416. // taskList[i].isShowModify = false
  417. // }
  418. // for (let j = 0; j < this.taskStageList.length; ++j) {
  419. // if (taskList[i].task_stage == this.taskStageList[j]
  420. // .task_stage_id)
  421. // taskList[i].task_stage_txt = this.taskStageList[j]
  422. // .task_stage
  423. // }
  424. // }
  425. // }
  426. // this.List4 = taskList;
  427. })
  428. uni.hideLoading();
  429. this.loading = false
  430. },
  431. toShow1() {
  432. this.showList2 = false;
  433. this.showList3 = false;
  434. this.showList4 = false;
  435. this.showList1 = true;
  436. this.getList(1);
  437. },
  438. toShow2() {
  439. this.showList1 = false;
  440. this.showList3 = false;
  441. this.showList4 = false;
  442. this.showList2 = true;
  443. this.getList(2);
  444. },
  445. toShow3() {
  446. this.showList2 = false;
  447. this.showList1 = false;
  448. this.showList4 = false;
  449. this.showList3 = true;
  450. this.getList(3);
  451. },
  452. toShow4() {
  453. this.showList2 = false;
  454. this.showList1 = false;
  455. this.showList3 = false;
  456. this.showList4 = true;
  457. this.getList(4);
  458. },
  459. toDetail(item) {
  460. uni.navigateTo({
  461. url: '/pages/workspace/taskdetail?taskId=' + item.task_id,
  462. success(res) {},
  463. fail(err) {}
  464. });
  465. },
  466. }
  467. }
  468. </script>
  469. <style lang="scss" scoped>
  470. view {
  471. font-size: 14px;
  472. line-height: inherit;
  473. }
  474. .menu {
  475. position: fixed;
  476. border-bottom: #FCCF41;
  477. background-color: #FFFFFF;
  478. justify-content: space-around;
  479. height: 100rpx;
  480. width: 100%;
  481. display: flex;
  482. z-index: 10;
  483. }
  484. .menu-item {
  485. display: flex;
  486. }
  487. .menu-item-p p {
  488. font-weight: 600;
  489. &.lor {
  490. border-bottom: 5rpx solid #F0D232;
  491. color: #F0D232;
  492. padding-bottom: 15rpx;
  493. }
  494. &.unlor {
  495. border-bottom: 5rpx solid #fff;
  496. color: #81838f;
  497. padding-bottom: 15rpx;
  498. }
  499. }
  500. .home {
  501. margin-top: 100rpx;
  502. }
  503. .task {
  504. margin-bottom: 20rpx;
  505. border-bottom: 1rpx #d7d7d7 solid;
  506. .task-head {
  507. display: flex;
  508. justify-content: space-between;
  509. align-items: center;
  510. padding: 10rpx 20rpx;
  511. .task-head-account {
  512. display: flex;
  513. }
  514. .task-head-status {
  515. color: red;
  516. }
  517. }
  518. .task-info {
  519. display: flex;
  520. align-items: center;
  521. justify-content: space-between;
  522. padding: 10rpx 20rpx;
  523. .task-info-left {
  524. display: flex;
  525. align-items: center;
  526. }
  527. .task-info-right {
  528. width: 100rpx;
  529. height: 100rpx;
  530. border-radius: 50%;
  531. border: #ffcb41 2rpx solid;
  532. display: flex;
  533. align-items: center;
  534. justify-content: center;
  535. }
  536. }
  537. }
  538. .line {
  539. border-bottom: 1rpx #AAAAAA solid;
  540. }
  541. .menu-point {
  542. position: relative;
  543. left: 30rpx;
  544. top: 20rpx;
  545. }
  546. .point {
  547. width: 20rpx;
  548. height: 20rpx;
  549. background: red;
  550. border-radius: 50%;
  551. }
  552. </style>