workspace.vue 11 KB

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