workspace.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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>
  10. <view class="menu-item" @click="toShow2()">
  11. <p v-bind:class="showList2?'lor':'unlor'">待传初稿</p>
  12. </view>
  13. <view class="menu-item" @click="toShow3()">
  14. <p v-bind:class="showList3?'lor':'unlor'">待发布</p>
  15. </view>
  16. <view class="menu-item" @click="toShow4()">
  17. <p v-bind:class="showList4?'lor':'unlor'">待传数据</p>
  18. </view>
  19. </view>
  20. <view class="home" v-if="showList1" style="margin-top: 100rpx;">
  21. <view class="task" v-for="item in List1">
  22. <view @click="toDetail(item)">
  23. <view class="task-head">
  24. <view class="task-head-account">
  25. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  26. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  27. </view>
  28. <view class="task-head-status">
  29. <p>{{item.task_stage_txt}}</p>
  30. </view>
  31. </view>
  32. <view class="task-info">
  33. <view class="task-info-left">
  34. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  35. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  36. </view>
  37. <view class="task-info-right" v-if="item.isShowModify">
  38. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  39. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="home" v-if="showList2">
  46. <view class="task" v-for="item in List2">
  47. <view @click="toDetail(item)">
  48. <view class="task-head">
  49. <view class="task-head-account">
  50. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  51. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  52. </view>
  53. <view class="task-head-status">
  54. <p>{{item.task_stage_txt}}</p>
  55. </view>
  56. </view>
  57. <view class="task-info">
  58. <view class="task-info-left">
  59. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  60. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  61. </view>
  62. <view class="task-info-right" v-if="item.isShowModify">
  63. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  64. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="home" v-if="showList3">
  71. <view class="task" v-for="item in List3">
  72. <view @click="toDetail(item)">
  73. <view class="task-head">
  74. <view class="task-head-account">
  75. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  76. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  77. </view>
  78. <view class="task-head-status">
  79. <p>{{item.task_stage_txt}}</p>
  80. </view>
  81. </view>
  82. <view class="task-info">
  83. <view class="task-info-left">
  84. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  85. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  86. </view>
  87. <view class="task-info-right" v-if="item.isShowModify">
  88. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  89. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="home" v-if="showList4">
  96. <view class="task" v-for="item in List4">
  97. <view @click="toDetail(item)">
  98. <view class="task-head">
  99. <view class="task-head-account">
  100. <image :src="item.platform_icon_url" style="height: 50rpx;width: 50rpx;"></image>
  101. <p style="margin-left: 20rpx;">{{item.platform_nick_name}}</p>
  102. </view>
  103. <view class="task-head-status">
  104. <p>{{item.task_stage_txt}}</p>
  105. </view>
  106. </view>
  107. <view class="task-info">
  108. <view class="task-info-left">
  109. <image :src="item.product_img_url" style="height: 120rpx;width: 120rpx;"></image>
  110. <p style="margin-left: 50rpx;">{{item.project_name}}</p>
  111. </view>
  112. <view class="task-info-right" v-if="item.isShowModify">
  113. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  114. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. import mvBar from "@/components/mys_navBar/mysNavBar";
  124. export default {
  125. components: {
  126. mvBar,
  127. },
  128. data() {
  129. return {
  130. navH: getApp().globalData.navHeight,
  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. border-bottom: #FCCF41;
  308. background-color: #FFFFFF;
  309. justify-content: space-around;
  310. height: 100rpx;
  311. width: 100%;
  312. display: flex;
  313. z-index: 10;
  314. }
  315. .menu-item p {
  316. font-weight: 600;
  317. &.lor {
  318. border-bottom: 5rpx solid #F0D232;
  319. color: #F0D232;
  320. padding-bottom: 15rpx;
  321. }
  322. &.unlor {
  323. border-bottom: 5rpx solid #fff;
  324. color: #81838f;
  325. padding-bottom: 15rpx;
  326. }
  327. }
  328. .home {
  329. margin-top: 100rpx;
  330. }
  331. .task {
  332. margin-bottom: 20rpx;
  333. border-bottom: 1rpx #d7d7d7 solid;
  334. .task-head {
  335. display: flex;
  336. justify-content: space-between;
  337. align-items: center;
  338. padding: 10rpx 20rpx;
  339. .task-head-account {
  340. display: flex;
  341. }
  342. .task-head-status {
  343. color: red;
  344. }
  345. }
  346. .task-info {
  347. display: flex;
  348. align-items: center;
  349. justify-content: space-between;
  350. padding: 10rpx 20rpx;
  351. .task-info-left {
  352. display: flex;
  353. align-items: center;
  354. }
  355. .task-info-right {
  356. width: 100rpx;
  357. height: 100rpx;
  358. border-radius: 50%;
  359. border: #ffcb41 2rpx solid;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. }
  364. }
  365. }
  366. .line {
  367. border-bottom: 1rpx #AAAAAA solid;
  368. }
  369. </style>