workspace.vue 17 KB

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