workspace.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{paddingTop:navH}" style="background-color: #fff;"></view>
  6. <view class="menu-head">
  7. <view class="menu" style="padding-bottom: 10rpx;">
  8. <view class="menu-item" @click="toShowSec()">
  9. <view class="menu-item-p">
  10. <p v-bind:class="showSec?'lor':'unlor'">带货</p>
  11. </view>
  12. <!-- <span class="point" v-if="showPoint2" key="1"></span> -->
  13. </view>
  14. <view class="menu-item" @click="toShowTask()">
  15. <view class="menu-item-p">
  16. <p v-bind:class="showTask?'lor':'unlor'">种草</p>
  17. </view>
  18. <!-- <span class="point" v-if="showPoint1" key="0"></span> -->
  19. </view>
  20. </view>
  21. <!-- 种草子选项 -->
  22. <view class="menu" v-if="showTask">
  23. <view class="menu-item" @click="toShow(index)" v-for="(item,index) in taskTabList">
  24. <view class="menu-item-p">
  25. <p v-bind:class="showList[index]?'lor':'unlor'">{{item}}</p>
  26. </view>
  27. <span class="point" v-if="showPoint[index]" :key="index"></span>
  28. </view>
  29. </view>
  30. <!-- 带货子选项 -->
  31. <view class="menu" v-if="showSec">
  32. <view class="menu-item" @click="toShow(4)">
  33. <view class="menu-item-p">
  34. <p v-bind:class="showList[4]?'lor':'unlor'">已报名</p>
  35. </view>
  36. <span class="point" v-if="reward_stage_highlight==1" key="0"></span>
  37. </view>
  38. <view class="menu-item" @click="toShow(5)">
  39. <view class="menu-item-p">
  40. <p v-bind:class="showList[5]?'lor':'unlor'">待领悬赏</p>
  41. </view>
  42. <span class="point" v-if="reward_stage_highlight==1" key="1"></span>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="home" v-if="showList[0] && !loading">
  47. <view class="task" v-for="item in taskLists[0]" @click="toTaskDetail(item)">
  48. <view class="task-card">
  49. <view class="task-head">
  50. <view class="task-head-account">
  51. <image class="platform-img" :src="item.platform_icon_url"></image>
  52. <p>{{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 class="project-img" :src="item.product_img_url"></image>
  61. <view class="task-info-txt">
  62. <p style="color: #000;font-size: 32rpx;">{{item.project_name}}</p>
  63. <p style="color: #F0D232;" v-if="!item.time_out">上传截止时间:{{item.upload_ddl}}</p>
  64. <p style="color: #f70c0c;" v-else>超时:{{item.upload_ddl}}</p>
  65. <p>预计违约扣款金额:¥{{item.show_cut_payment}}</p>
  66. <p>预计收益:¥{{item.show_task_reward}}</p>
  67. </view>
  68. </view>
  69. <view class="task-info-right" v-if="item.isShowModify">
  70. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  71. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  72. </view>
  73. </view>
  74. <view style="text-align: right;" v-if="item.task_stage > 6">
  75. <p style="display: inline-block;">实际收益:¥{{item.show_real_reward}}</p>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="home" v-if="showList[1] && !loading">
  81. <view class="task" v-for="item in taskLists[1]" @click="toTaskDetail(item)">
  82. <view class="task-card">
  83. <view class="task-head">
  84. <view class="task-head-account">
  85. <image class="platform-img" :src="item.platform_icon_url"></image>
  86. <p>{{item.platform_nick_name}}</p>
  87. </view>
  88. <view class="task-head-status">
  89. <p>{{item.task_stage_txt}}</p>
  90. </view>
  91. </view>
  92. <view class="task-info">
  93. <view class="task-info-left">
  94. <image class="project-img" :src="item.product_img_url"></image>
  95. <view class="task-info-txt">
  96. <p style="color: #000;font-size: 32rpx;">{{item.project_name}}</p>
  97. <p style="color: #F0D232;" v-if="!item.time_out">上传截止时间:{{item.upload_ddl}}</p>
  98. <p style="color: #f70c0c;" v-else>超时:{{item.upload_ddl}}</p>
  99. <p>预计违约扣款金额:¥{{item.show_cut_payment}}</p>
  100. <p>预计收益:¥{{item.show_task_reward}}</p>
  101. </view>
  102. </view>
  103. <view class="task-info-right" v-if="item.isShowModify">
  104. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  105. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  106. </view>
  107. </view>
  108. <view style="text-align: right;" v-if="item.task_stage > 6">
  109. <p style="display: inline-block;">实际收益:¥{{item.show_real_reward}}</p>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="home" v-if="showList[2] && !loading">
  115. <view class="task" v-for="item in taskLists[2]" @click="toTaskDetail(item)">
  116. <view class="task-card">
  117. <view class="task-head">
  118. <view class="task-head-account">
  119. <image class="platform-img" :src="item.platform_icon_url"></image>
  120. <p>{{item.platform_nick_name}}</p>
  121. </view>
  122. <view class="task-head-status">
  123. <p>{{item.task_stage_txt}}</p>
  124. </view>
  125. </view>
  126. <view class="task-info">
  127. <view class="task-info-left">
  128. <image class="project-img" :src="item.product_img_url"></image>
  129. <view class="task-info-txt">
  130. <p style="color: #000;font-size: 32rpx;">{{item.project_name}}</p>
  131. <p style="color: #F0D232;" v-if="!item.time_out">上传截止时间:{{item.upload_ddl}}</p>
  132. <p style="color: #f70c0c;" v-else>超时:{{item.upload_ddl}}</p>
  133. <p>预计违约扣款金额:¥{{item.show_cut_payment}}</p>
  134. <p>预计收益:¥{{item.show_task_reward}}</p>
  135. </view>
  136. </view>
  137. <view class="task-info-right" v-if="item.isShowModify">
  138. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  139. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  140. </view>
  141. </view>
  142. <view style="text-align: right;" v-if="item.task_stage > 6">
  143. <p style="display: inline-block;">实际收益:¥{{item.show_real_reward}}</p>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. <view class="home" v-if="showList[3] && !loading">
  149. <view class="task" v-for="item in taskLists[3]" @click="toTaskDetail(item)">
  150. <view class="task-card">
  151. <view class="task-head">
  152. <view class="task-head-account">
  153. <image class="platform-img" :src="item.platform_icon_url"></image>
  154. <p>{{item.platform_nick_name}}</p>
  155. </view>
  156. <view class="task-head-status">
  157. <p>{{item.task_stage_txt}}</p>
  158. </view>
  159. </view>
  160. <view class="task-info">
  161. <view class="task-info-left">
  162. <image class="project-img" :src="item.product_img_url"></image>
  163. <view class="task-info-txt">
  164. <p style="color: #000;font-size: 32rpx;">{{item.project_name}}</p>
  165. <p style="color: #F0D232;" v-if="!item.time_out">上传截止时间:{{item.upload_ddl}}</p>
  166. <p style="color: #f70c0c;" v-else>超时:{{item.upload_ddl}}</p>
  167. <p v-if="item.fee_form != 1">预计违约扣款金额:¥{{item.show_cut_payment}}</p>
  168. <p>预计收益:¥{{item.show_task_reward}}</p>
  169. </view>
  170. </view>
  171. <view class="task-info-right" v-if="item.isShowModify">
  172. <image src="../../static/img/icon-edit.png" style="height: 60rpx;width: 60rpx;"></image>
  173. <p style="font-size: 32rpx;color: #ffcb41;font-weight: 600">改</p>
  174. </view>
  175. </view>
  176. <view style="text-align: right;" v-if="item.task_stage > 6">
  177. <p style="display: inline-block;">实际收益:¥{{item.show_real_reward}}</p>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <!-- 已报名 -->
  183. <view class="home" v-if="showList[4] && !loading">
  184. <view class="task" v-for="item in taskLists[4]" @click="toSecTaskDetail(item)">
  185. <view class="task-card">
  186. <view class="task-info">
  187. <!-- 左侧图片和文字 -->
  188. <view class="task-info-left">
  189. <!-- 图片 -->
  190. <image class="project-img" :src="item.product_img_url"></image>
  191. <image v-if="item.isFinished" class="overlay-img"
  192. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png"></image>
  193. <!-- 描述 -->
  194. <view class="task-info-txt">
  195. <view class="Tasktext">
  196. <image class="platform-img" :src="item.PlatformInfo.platform_icon"></image>
  197. <span>
  198. {{item.SelectionInfo.selection_name}}
  199. </span>
  200. </view>
  201. <p style="color: #ffcb41 ;">任务截至时间:{{item.ddl}}</p>
  202. <p>售价:¥{{item.price}} 佣金率:{{item.exclusive_commission}}%</p>
  203. <!-- sectask表有已经有 -->
  204. <p>全部销售量/有效销售量:{{item.sale_num_all}}单/{{item.sale_actual}}单</p>
  205. <p v-if="item.task_mode==1">悬赏金额/悬赏有效销售量:
  206. ¥{{item.RewardStrategy[0].per_reward}}/{{item.RewardStrategy[0].sale_actual}}单</p>
  207. <p v-if="item.sample_mode==1">免费领样状态:{{ getFreeStageText(item.free_stage) }}</p>
  208. </view>
  209. </view>
  210. <!-- 右侧图标 -->
  211. <view class="task-info-right">
  212. <image
  213. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png"
  214. style="height: 30rpx;width: 30rpx;"></image>
  215. </view>
  216. </view>
  217. <view class="container">
  218. <p class="left-text" v-if="item.reward_stage == 1">
  219. <span style="color: red;">待领悬赏</span>
  220. </p>
  221. <!-- 当 item.reward_stage 为 2 时,显示 "已领悬赏" 并设置文字颜色为绿色 -->
  222. <p class="left-text" v-else-if="item.reward_stage == 2">
  223. <span style="color: green;">已领悬赏</span>
  224. </p>
  225. <p class="right-text" v-if="item.reward_stage==2">实际收益:<span
  226. style="color: red;">¥{{item.RewardStrategy[0].per_reward}}</span></p>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. <!-- 待领悬赏 -->
  232. <view class="home" v-if="showList[5] && !loading">
  233. <view class="task" v-for="item in taskLists[5]" @click="toSecTaskDetail(item)">
  234. <view class="task-card">
  235. <view class="task-info">
  236. <!-- 左侧图片和文字 -->
  237. <view class="task-info-left">
  238. <!-- 图片 -->
  239. <image class="project-img" :src="item.product_img_url"></image>
  240. <image v-if="item.isFinished" class="overlay-img"
  241. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png"></image>
  242. <!-- 描述 -->
  243. <view class="task-info-txt">
  244. <view class="Tasktext">
  245. <image class="platform-img" :src="item.PlatformInfo.platform_icon"></image>
  246. <span>
  247. {{item.SelectionInfo.selection_name}}
  248. </span>
  249. </view>
  250. <p style="color: #ffcb41 ;">任务截至时间:{{item.ddl}}</p>
  251. <p>售价:¥{{item.price}} 佣金率:{{item.exclusive_commission}}%</p>
  252. <!-- sectask表有已经有 -->
  253. <p>全部销售量/有效销售量:{{item.sale_num_all}}单/{{item.sale_actual}}单</p>
  254. <p v-if="item.task_mode==1">悬赏金额/悬赏有效销售量:
  255. ¥{{item.RewardStrategy[0].per_reward}}/{{item.RewardStrategy[0].sale_actual}}单</p>
  256. <p v-if="item.sample_mode==1">免费领样状态:{{ getFreeStageText(item.free_stage) }}</p>
  257. </view>
  258. </view>
  259. <!-- 右侧图标 -->
  260. <view class="task-info-right">
  261. <image
  262. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png"
  263. style="height: 30rpx;width: 30rpx;"></image>
  264. </view>
  265. </view>
  266. <view class="container">
  267. <p class="left-text" v-if="item.reward_stage == 1">
  268. <span style="color: red;">待领悬赏</span>
  269. </p>
  270. <!-- 当 item.reward_stage 为 2 时,显示 "已领悬赏" 并设置文字颜色为绿色 -->
  271. <p class="left-text" v-else-if="item.reward_stage == 2">
  272. <span style="color: green;">已领悬赏</span>
  273. </p>
  274. <p class="right-text" v-if="item.reward_stage==2">实际收益:<span
  275. style="color: red;">¥{{item.RewardStrategy[0].per_reward}}</span></p>
  276. </view>
  277. </view>
  278. </view>
  279. </view>
  280. <view style="height: 100rpx;"></view>
  281. </view>
  282. </template>
  283. <script>
  284. import mvBar from "@/components/mys_navBar/mysNavBar";
  285. import {
  286. fansview,
  287. money,
  288. getDaysAndHoursBetweenDates,
  289. } from '@/components/utils.js';
  290. export default {
  291. components: {
  292. mvBar,
  293. },
  294. data() {
  295. return {
  296. navH: getApp().globalData.navHeight,
  297. loading: true,
  298. showPoint: [false, false, false, false, false, false],
  299. showTask: false,
  300. showSec: true,
  301. showList: [
  302. false, false, false, false, true, false
  303. ],
  304. taskLists: [
  305. [],
  306. [],
  307. [],
  308. [],
  309. []
  310. ],
  311. reward_stage_highlight: 0,
  312. taskTabList: [
  313. "待传脚本",
  314. "待传初稿",
  315. "待传链接",
  316. "待传数据"
  317. ],
  318. secTaskTabList: [
  319. "待传作业"
  320. ],
  321. secTaskTabList1: [
  322. "已报名",
  323. "待领悬赏"
  324. ],
  325. lastCallTime: null,
  326. taskStageList: [],
  327. secTaskStageList: [],
  328. mysNavConfig: {
  329. /* 开启单页显示首页图标 */
  330. isHome: true,
  331. /* 固定导航 */
  332. navFixed: true,
  333. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  334. navTitle: {
  335. text: "工作台",
  336. color: "",
  337. fontSize: "32rpx", // px upx rpx
  338. fontWeight: "normal", // 100 - 700
  339. },
  340. },
  341. list: [{
  342. account: {
  343. platform: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_MsjI7CSK_6e62AG2AGOvh1HgAcA_35_35.png",
  344. nickname: "丸子在成都",
  345. },
  346. status: "待确认",
  347. mainphoto: "https://static1.paizi.com/uploadfile/2018/1013/20181013013207465.png",
  348. taskname: "醉码头火锅太古里店",
  349. }, {
  350. account: {
  351. platform: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/pingtai2.png",
  352. nickname: "成都的一颗丸子",
  353. },
  354. status: "待确认",
  355. 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",
  356. taskname: "奥运吉祥物冰墩墩盲盒",
  357. }],
  358. }
  359. },
  360. async onShow() {
  361. this.token = uni.getStorageSync('token')
  362. await this.$https.get('/youngee/c/t/g/is-login')
  363. .then(res => {
  364. if (res.data.code == 403) {
  365. this.token = ""
  366. uni.clearStorage();
  367. }
  368. });
  369. if (this.token === '') {
  370. uni.showModal({
  371. content: '请先登录',
  372. success: function(res) {
  373. if (res.confirm) {
  374. uni.navigateTo({
  375. url: '/pages/login/login'
  376. });
  377. } else if (res.cancel) {
  378. uni.switchTab({
  379. url: '/pages/tasksquare/tasksquare'
  380. });
  381. }
  382. }
  383. });
  384. }
  385. let curTab = 0
  386. this.showList.forEach(async function(item, index) {
  387. if (item === true) {
  388. curTab = index
  389. }
  390. });
  391. await this.getInfoList()
  392. if (parseInt(curTab) < 4) {
  393. this.getTaskList(parseInt(curTab));
  394. } else {
  395. this.getSecTaskList(parseInt(curTab));
  396. }
  397. //展示小红点
  398. },
  399. methods: {
  400. getFreeStageText(freeStage) {
  401. switch (freeStage) {
  402. case 1:
  403. return '已申请';
  404. case 2:
  405. return '已拒绝';
  406. case 3:
  407. return '待发货';
  408. case 4:
  409. return '已发货';
  410. case 5:
  411. return '已收货';
  412. default:
  413. return '未知状态';
  414. }
  415. },
  416. handleCopy(content) {
  417. wx.setClipboardData({
  418. data: content,
  419. success: function(res) {
  420. console.log("复制成功");
  421. }
  422. });
  423. },
  424. toLogisticDetail(secTaskId) {
  425. var data = {
  426. taskId: secTaskId,
  427. };
  428. data = JSON.stringify(data)
  429. uni.navigateTo({
  430. url: '/page_workspace/selection/logistics/logisticsdetail?textObj=' + encodeURIComponent(data)
  431. });
  432. },
  433. getInfoList() {
  434. return this.$http.get('/youngee/c/g/get-info-tables')
  435. .then(res => {
  436. if (res.data.code == 0) {
  437. this.taskStageList = res.data.data.TaskStage
  438. this.secTaskStageList = res.data.data.SecTaskStage
  439. }
  440. })
  441. },
  442. // 默认选择0
  443. toShowTask() {
  444. this.showTask = true;
  445. this.showSec = false;
  446. this.toShow(0)
  447. },
  448. // 默认选择4
  449. toShowSec() {
  450. this.showTask = false;
  451. this.showSec = true;
  452. this.toShow(4)
  453. },
  454. toShow(value) {
  455. console.log("toshow的参数-->", value)
  456. let that = this
  457. // item表示当前遍历到的元素,index表示该元素在列表中的索引位置
  458. this.showList.forEach(function(item, index) {
  459. if (index == value) {
  460. that.showList[index] = true
  461. } else {
  462. that.showList[index] = false
  463. }
  464. })
  465. if (value < 4) {
  466. this.getTaskList(value);
  467. } else {
  468. this.getSecTaskList(value);
  469. }
  470. console.log("showList--->", that.showList)
  471. },
  472. toTaskDetail(item) {
  473. uni.navigateTo({
  474. url: '/page_workspace/task/taskdetail?taskId=' + item.task_id,
  475. success(res) {},
  476. fail(err) {}
  477. });
  478. },
  479. toSecTaskDetail(item) {
  480. uni.navigateTo({
  481. url: '/page_workspace/selection/sectaskdetail1?taskId=' + item.task_id,
  482. success(res) {},
  483. fail(err) {}
  484. });
  485. },
  486. async getTaskList(value) {
  487. let that = this
  488. this.loading = true
  489. uni.showLoading({
  490. title: '加载中'
  491. });
  492. await this.$https.get('/youngee/c/t/g/get-task-exe-num')
  493. .then(res => {
  494. if (res.data.data != null) {
  495. let nums = res.data.data
  496. this.showPoint.forEach(function(item, index) {
  497. that.showPoint[index] = false
  498. })
  499. for (let i = 0; i < nums.length; ++i) {
  500. if (nums[i].task_stage == 7 && nums[i]["COUNT(*)"] != 0) {
  501. this.showPoint[0] = true
  502. }
  503. if (nums[i].task_stage == 9 && nums[i]["COUNT(*)"] != 0) {
  504. this.showPoint[1] = true
  505. }
  506. if (nums[i].task_stage == 11 && nums[i]["COUNT(*)"] != 0) {
  507. this.showPoint[2] = true
  508. }
  509. if (nums[i].task_stage == 13 && nums[i]["COUNT(*)"] != 0) {
  510. this.showPoint[3] = true
  511. }
  512. }
  513. }
  514. });
  515. var taskList = [];
  516. await this.$https.get('/youngee/c/t/g/get-task-exe-list' +
  517. "?" +
  518. "taskStage" +
  519. "=" +
  520. value).then(res => {
  521. taskList = res.data.data
  522. if (taskList != null) {
  523. for (let i = 0; i < taskList.length; ++i) {
  524. // 主图
  525. let productPhoto = JSON.parse(taskList[i].product_photo_snap);
  526. for (let j = 0; j < productPhoto.length; j++) {
  527. if (productPhoto[j].Symbol == 1) {
  528. taskList[i].product_img_url = productPhoto[j].PhotoUrl
  529. }
  530. }
  531. // 带货链接
  532. taskList[i].product_url = product.product_url
  533. // 待修改标识
  534. if ((taskList[i].task_stage == 7 && taskList[i].script_status == 3) ||
  535. (taskList[i].task_stage == 9 && taskList[i].sketch_status == 3) ||
  536. (taskList[i].task_stage == 11 && taskList[i].link_status == 3) ||
  537. (taskList[i].task_stage == 13 && taskList[i].data_status == 3)) {
  538. taskList[i].isShowModify = true
  539. } else {
  540. taskList[i].isShowModify = false
  541. }
  542. // 任务阶段展示文字
  543. taskList[i].task_stage_txt = this.taskStageList[taskList[i].task_stage - 1]
  544. .task_stage
  545. // 任务收益
  546. taskList[i].real_reward = taskList[i].task_reward * (100 - taskList[i]
  547. .break_rate) / 100
  548. taskList[i].cut_payment = taskList[i].task_reward - taskList[i].real_reward
  549. taskList[i].show_task_reward = money(taskList[i].task_reward)
  550. taskList[i].show_real_reward = money(taskList[i].real_reward)
  551. taskList[i].show_cut_payment = money(taskList[i].cut_payment)
  552. // 截止时间
  553. let ddl = this.thistime(taskList[i].cur_break_at)
  554. console.log("isTimeOut", ddl.isTimeOut)
  555. console.log("ddl", ddl.deadline_time)
  556. taskList[i].time_out = ddl.isTimeOut
  557. taskList[i].upload_ddl = ddl.isTimeOut ? ddl.deadline_time : taskList[i]
  558. .cur_break_at.replace(/-/g,
  559. "/").slice(0, -3)
  560. }
  561. }
  562. this.taskLists[value] = taskList
  563. })
  564. uni.hideLoading();
  565. this.loading = false
  566. },
  567. getProductInfoApi(item) {
  568. console.log("into product")
  569. return this.$https.get('/youngee/c/t/g/get-product-detail' +
  570. "?productid=" +
  571. item
  572. )
  573. .then(res => {
  574. console.log("getproductsuccess---", res)
  575. this.productInfo = res.data.data
  576. this.lastCallTime = Date.now();
  577. })
  578. },
  579. async getSecTaskList(value) {
  580. this.loading = true
  581. uni.showLoading({
  582. title: '加载中'
  583. });
  584. var secTaskList = [];
  585. await this.$https.get('/youngee/c/t/g/get-exe-sec-task-list' +
  586. "?" +
  587. "taskStage" +
  588. "=" +
  589. value).then(res => {
  590. console.log("get-exe-sec-task-list----",res)
  591. secTaskList = res.data.data
  592. if (secTaskList != null) {
  593. for (let i = 0; i < secTaskList.length; ++i) {
  594. console.log("****secTaskList[i]*******", secTaskList[i])
  595. let product_info = secTaskList[i].YounggeeProduct
  596. let product_photo_info = secTaskList[i].YounggeeProductPhoto
  597. let selection_platform = secTaskList[i].PlatformInfo
  598. secTaskList[i].price = product_info.product_price
  599. secTaskList[i].exclusive_commission = product_info.exclusive_commission
  600. //小红点
  601. if(secTaskList[i].reward_stage==1){
  602. this.reward_stage_highlight=1
  603. }
  604. // 主图
  605. if (product_photo_info != null && product_photo_info != '') {
  606. for (let j = 0; j < product_photo_info.length; j++) {
  607. if (product_photo_info[j].symbol == 1) {
  608. secTaskList[i].product_img_url = product_photo_info[j].photo_url
  609. }
  610. }
  611. }
  612. //截至时间
  613. secTaskList[i].ddl = secTaskList[i].SelectionInfo.task_ddl
  614. // 判断是否到期
  615. secTaskList[i].isFinished = this.isFinish(secTaskList[i].ddl)
  616. }
  617. }
  618. this.taskLists[value] = secTaskList;
  619. })
  620. uni.hideLoading();
  621. this.loading = false
  622. },
  623. isFinish(ddl) {
  624. var timeNow = new Date();
  625. var ddl = new Date(ddl.replace(/-/g, "/"));
  626. var diff = getDaysAndHoursBetweenDates(timeNow, ddl);
  627. let remain_days = diff.days;
  628. let remain_hours = diff.hours;
  629. if (remain_days <= 0 & remain_hours <= 0) return true;
  630. else return false;
  631. },
  632. // 计算结束时间
  633. thistime(val) {
  634. // 转换格式
  635. var beginTime = new Date(val.replace(/-/g, "/"));
  636. // 当前时间
  637. var thisTime = new Date();
  638. // 相减
  639. var dateMiss = beginTime.getTime() - thisTime.getTime();
  640. let isTimeOut = dateMiss < 0 ? true : false
  641. dateMiss = dateMiss < 0 ? -dateMiss : dateMiss
  642. // 天数
  643. var day = Math.floor(dateMiss / (24 * 3600 * 1000));
  644. // 减去天数剩下的毫秒数
  645. var backOne = dateMiss % (24 * 3600 * 1000);
  646. // 小时数
  647. var hours = Math.floor(backOne / (3600 * 1000));
  648. // 减去小时数剩下的毫秒数
  649. var backHour = backOne % (3600 * 1000);
  650. // 分钟数
  651. var min = Math.floor(backHour / (60 * 1000));
  652. var deadline_time = day + '天' + hours + '时' + min + '分'
  653. var result = {
  654. isTimeOut: isTimeOut,
  655. deadline_time: deadline_time
  656. }
  657. return result
  658. },
  659. }
  660. }
  661. </script>
  662. <style lang="scss" scoped>
  663. view {
  664. font-size: 14px;
  665. line-height: inherit;
  666. }
  667. .overlay-img {
  668. position: absolute;
  669. width: 200rpx;
  670. height: 200rpx;
  671. background-color: black;
  672. opacity: 0.5;
  673. pointer-events: none;
  674. /* This makes the overlay image not interfere with any click events on the main image */
  675. }
  676. .container {
  677. display: flex;
  678. justify-content: space-between;
  679. align-items: center;
  680. height: 20rpx;
  681. }
  682. .left-text {
  683. text-align: left;
  684. flex: 1;
  685. font-size: 30rpx;
  686. padding-left: 20rpx;
  687. }
  688. .right-text {
  689. text-align: right;
  690. flex: 1;
  691. font-size: 30rpx;
  692. padding-right: 20rpx;
  693. padding-top: 15rpx;
  694. }
  695. .menu-head {
  696. // padding-top: 20rpx;
  697. background-color: #fff;
  698. position: fixed;
  699. width: 100%;
  700. }
  701. .menu {
  702. border-bottom: #FCCF41;
  703. background-color: #FFFFFF;
  704. justify-content: space-around;
  705. height: 60rpx;
  706. width: 100%;
  707. display: flex;
  708. z-index: 10;
  709. }
  710. .menu-item {
  711. display: flex;
  712. }
  713. .menu-item-p p {
  714. font-weight: 600;
  715. &.lor {
  716. border-bottom: 5rpx solid #F0D232;
  717. color: #F0D232;
  718. padding-bottom: 15rpx;
  719. }
  720. &.unlor {
  721. border-bottom: 5rpx solid #fff;
  722. color: #81838f;
  723. padding-bottom: 15rpx;
  724. }
  725. }
  726. .home {
  727. margin-top: 150rpx;
  728. }
  729. .task-card {
  730. margin: 10rpx 0;
  731. // border-bottom: 1rpx #d7d7d7 solid;
  732. height: 350rpx;
  733. background-color: #f2f2f2;
  734. .platform-img {
  735. width: 40rpx;
  736. height: 40rpx;
  737. margin-right: 10rpx;
  738. flex-shrink: 0;
  739. }
  740. .task-head {
  741. display: flex;
  742. justify-content: space-between;
  743. align-items: center;
  744. padding: 10rpx 20rpx;
  745. .task-head-account {
  746. display: flex;
  747. }
  748. .platform-img {
  749. width: 40rpx;
  750. height: 40rpx;
  751. margin-right: 10rpx;
  752. flex-shrink: 0;
  753. }
  754. .task-head-status p {
  755. color: red;
  756. }
  757. }
  758. .task-info {
  759. display: flex;
  760. justify-content: space-between;
  761. padding: 10rpx 20rpx;
  762. .task-info-left {
  763. display: flex;
  764. // align-items: center;
  765. .project-img {
  766. height: 200rpx;
  767. width: 200rpx;
  768. flex-shrink: 0;
  769. // background-color: #b3c96b;
  770. }
  771. .task-info-txt {
  772. margin-left: 10rpx;
  773. }
  774. .task-info-txt p {
  775. font-size: 24rpx;
  776. color: #85859d;
  777. letter-spacing: 2rpx;
  778. }
  779. }
  780. .task-info-right {
  781. // width: 100rpx;
  782. // height: 100rpx;
  783. border-radius: 50%;
  784. // border: #ffcb41 2rpx solid;
  785. display: flex;
  786. align-items: center;
  787. justify-content: center;
  788. }
  789. .task-info-right p {
  790. font-size: 24rpx;
  791. }
  792. }
  793. }
  794. // .task {
  795. // margin-bottom: 20rpx;
  796. // border-bottom: 1rpx #d7d7d7 solid;
  797. // .task-head {
  798. // display: flex;
  799. // justify-content: space-between;
  800. // align-items: center;
  801. // padding: 10rpx 20rpx;
  802. // .task-head-account {
  803. // display: flex;
  804. // }
  805. // .task-head-status {
  806. // color: red;
  807. // }
  808. // }
  809. // .task-info {
  810. // display: flex;
  811. // align-items: center;
  812. // justify-content: space-between;
  813. // padding: 10rpx 20rpx;
  814. // .task-info-left {
  815. // display: flex;
  816. // align-items: center;
  817. // }
  818. // .task-info-right {
  819. // width: 100rpx;
  820. // height: 100rpx;
  821. // border-radius: 50%;
  822. // border: #ffcb41 2rpx solid;
  823. // display: flex;
  824. // align-items: center;
  825. // justify-content: center;
  826. // }
  827. // }
  828. // }
  829. .line {
  830. border-bottom: 1rpx #AAAAAA solid;
  831. }
  832. .menu-point {
  833. position: relative;
  834. left: 30rpx;
  835. top: 20rpx;
  836. }
  837. .point {
  838. width: 20rpx;
  839. height: 20rpx;
  840. background: red;
  841. border-radius: 50%;
  842. }
  843. .but2 {
  844. background-color: #FFFFFF;
  845. border: 1rpx solid #f2d22d;
  846. border-radius: 20rpx;
  847. font-size: 28rpx;
  848. line-height: 180%;
  849. font-weight: 500;
  850. position: relative;
  851. height: 80%;
  852. margin: 0;
  853. }
  854. </style>