workspace.vue 11 KB

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