myincome.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view>
  7. <view class="show-income3">
  8. <p style="font-weight: bold;">收益明细</p>
  9. <view class="menu">
  10. <view class="menu-item" @click="toShow1()">
  11. <p v-bind:class="showList1?'lor':'unlor'">可提现</p>
  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>
  20. </view>
  21. <view class="income-list" v-if="showList1">
  22. <checkbox-group @change="changeCheck">
  23. <view class="income-list-cell" v-for="item in list1" :key="item.value">
  24. <view class="income-list-cell-left">
  25. <label>
  26. <view>
  27. <checkbox class="income-list-checkbox" :value="item.task_id"
  28. :checked="item.checked" />
  29. </view>
  30. </label>
  31. <view class="income-info">
  32. <view class="income-info-product">
  33. <image :src="item.product_photo.PhotoUrl"></image>
  34. </view>
  35. <view class="income-info-tp">
  36. <p>任务ID:{{item.task_id}}</p>
  37. <view class="income-info-project">
  38. <image :src="item.platform_icon_url"></image>
  39. <p>{{item.project_name}}</p>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="income-list-cell-right">
  45. <p style="color: #f2d22d;font-size: 36rpx;font-weight: 600;">+{{item.show_settle_amount}}
  46. </p>
  47. <p>任务收益</p>
  48. </view>
  49. </view>
  50. </checkbox-group>
  51. </view>
  52. <view class="income-list" v-if="showList2">
  53. <view class="income-list-cell" style="margin-left: 50rpx;" v-for="item in list2" :key="item.value">
  54. <view class="income-list-cell-left">
  55. <view class="income-info">
  56. <view class="income-info-product">
  57. <image :src="item.product_photo.PhotoUrl"></image>
  58. </view>
  59. <view class="income-info-tp">
  60. <p>任务ID:{{item.task_id}}</p>
  61. <view class="income-info-project">
  62. <image :src="item.platform_icon_url"></image>
  63. <p>{{item.project_name}}</p>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="income-list-cell-right">
  69. <p style="color: #f2d22d;font-size: 36rpx;font-weight: 600;">+{{item.show_settle_amount}}
  70. </p>
  71. <p>任务收益</p>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="income-list" v-if="showList3">
  76. <view class="income-list-cell" style="margin-left: 50rpx;" v-for="item in list3" :key="item.value">
  77. <view class="income-list-cell-left">
  78. <view class="income-info">
  79. <view class="income-info-product">
  80. <image :src="item.product_photo.PhotoUrl"></image>
  81. </view>
  82. <view class="income-info-tp">
  83. <p>任务ID:{{item.task_id}}</p>
  84. <view class="income-info-project">
  85. <image :src="item.platform_icon_url"></image>
  86. <p>{{item.project_name}}</p>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="income-list-cell-right">
  92. <p style="color: #f2d22d;font-size: 36rpx;font-weight: 600;">+{{item.show_settle_amount}}
  93. </p>
  94. <p>任务收益</p>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="interval2"></view>
  99. <view class="income-workList-buttons" v-if="showList1">
  100. <view>
  101. <label class="all-check-box left-btn">
  102. <view>
  103. <checkbox-group @change="changeAll">
  104. <checkbox class="income-list-checkbox" :value="allCheck.value"
  105. :checked="allCheck.checked" />
  106. </checkbox-group>
  107. </view>
  108. <view style="display: flex;justify-content: center;align-items: center;">
  109. <p>{{allCheck.name}}</p>
  110. </view>
  111. </label>
  112. </view>
  113. <view>
  114. <button class="right-btn" type="primary" @click="withdraw()">提现</button>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. import mvBar from "@/components/mys_navBar/mysNavBar";
  122. import {
  123. money,
  124. fansview
  125. } from '@/components/utils.js';
  126. export default {
  127. components: {
  128. mvBar,
  129. },
  130. data() {
  131. return {
  132. navH: getApp().globalData.navHeight,
  133. // 测试数据
  134. // list1: [{
  135. // task_id: "001abandon",
  136. // project_name: "PUYU朴郁小树茶冻干茶粉",
  137. // product_price: 78,
  138. // RecruitStrategy: {
  139. // followers_low: "1万",
  140. // followers_up: "3万",
  141. // show_fee_form: "创作者自报价",
  142. // offer: 350,
  143. // },
  144. // settle_amount: 350,
  145. // complete_date: "2022-3-2 14:00",
  146. // checked: false
  147. // }, {
  148. // task_id: "002abash",
  149. // project_name: "Pisco生姜气泡饮料",
  150. // product_price: 68,
  151. // RecruitStrategy: {
  152. // followers_low: "1万",
  153. // followers_up: "3万",
  154. // show_fee_form: "固定稿费",
  155. // offer: 300,
  156. // },
  157. // settle_amount: 150,
  158. // complete_date: "2022-3-2 14:00",
  159. // checked: false
  160. // }],
  161. // list2: [{
  162. // task_id: "003abash",
  163. // project_name: "小鹏海南试驾",
  164. // product_price: 68,
  165. // RecruitStrategy: {
  166. // followers_low: "1万",
  167. // followers_up: "3万",
  168. // show_fee_form: "固定稿费",
  169. // offer: 4000,
  170. // },
  171. // settle_amount: 4000,
  172. // complete_date: "2022-3-2 14:00",
  173. // }, {
  174. // task_id: "004abbreviate",
  175. // project_name: "优衣库三里屯店新店开业",
  176. // product_price: 100,
  177. // RecruitStrategy: {
  178. // followers_low: "5万",
  179. // followers_up: "10万",
  180. // show_fee_form: "固定稿费",
  181. // offer: 1200,
  182. // },
  183. // settle_amount: 1200,
  184. // complete_date: "2022-3-2 14:00",
  185. // }],
  186. // list3: [{
  187. // task_id: "001abandon",
  188. // project_name: "PUYU朴郁小树茶冻干茶粉",
  189. // product_price: 78,
  190. // RecruitStrategy: {
  191. // followers_low: "1万",
  192. // followers_up: "3万",
  193. // show_fee_form: "创作者自报价",
  194. // offer: 350,
  195. // },
  196. // settle_amount: 350,
  197. // complete_date: "2022-3-2 14:00",
  198. // }],
  199. list1: [],
  200. list2: [],
  201. list3: [],
  202. allCheck: {
  203. name: '全选',
  204. value: 'all',
  205. checked: false
  206. },
  207. showTab: "",
  208. showList1: true,
  209. showList2: false,
  210. showList3: false,
  211. picture: {
  212. icon_person: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-person.png',
  213. icon_location: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-location.png',
  214. icon_account: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-account.png',
  215. icon_rmb: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-rmb.png',
  216. icon_message: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-message.png',
  217. icon_right: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png',
  218. defaultavatarUrl: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/logoxin01.png',
  219. },
  220. mysNavConfig: {
  221. /* 开启单页显示首页图标 */
  222. isHome: true,
  223. /* 固定导航 */
  224. navFixed: true,
  225. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  226. navTitle: {
  227. text: "我的收益",
  228. color: "",
  229. fontSize: "32rpx", // px upx rpx
  230. fontWeight: "normal", // 100 - 700
  231. },
  232. btnType: "type2",
  233. onLeftClick: "/pages/mycenter/mycenter",
  234. /* type2 按钮 */
  235. type2Config: {
  236. // 左图标
  237. leftPath: "/static/img/png2.png",
  238. // 右图标
  239. rightPath: "/static/img/png4.png",
  240. // 圆角
  241. radius: "40rpx",
  242. },
  243. },
  244. codeImg: '',
  245. information: {},
  246. };
  247. },
  248. async onShow() {
  249. // 判断登录
  250. await this.isLogin();
  251. if (this.token === '') {
  252. uni.showModal({
  253. content: '请先登录',
  254. success: function(res) {
  255. if (res.confirm) {
  256. uni.navigateTo({
  257. url: '/pages/login/login'
  258. });
  259. } else if (res.cancel) {
  260. uni.navigateBack();
  261. }
  262. }
  263. });
  264. } else {
  265. this.getTaskInfo()
  266. }
  267. },
  268. onLoad(options) {
  269. console.log(options)
  270. this.showTab = options.showTab
  271. // 传过来的id
  272. if (this.showTab == '1') {
  273. this.toShow1();
  274. } else if (this.showTab == '2') {
  275. this.toShow2();
  276. } else if (this.showTab == '3') {
  277. this.toShow3();
  278. }
  279. },
  280. methods: {
  281. // 判断登陆是否过期
  282. isLogin() {
  283. return this.$https.get('/youngee/c/t/g/is-login')
  284. .then(res => {
  285. if (res.data.code === 403) {
  286. // 登陆已失效
  287. this.token = ""
  288. } else {
  289. this.token = uni.getStorageSync('token')
  290. }
  291. })
  292. },
  293. // 全选
  294. changeAll: function(e) {
  295. if (e.detail.value.length == 0) {
  296. this.list1.map(item => this.$set(item, 'checked', false));
  297. this.$set(this.allCheck, 'checked', false);
  298. } else {
  299. this.list1.map(item => this.$set(item, 'checked', true));
  300. this.$set(this.allCheck, 'checked', true);
  301. }
  302. },
  303. // 多选
  304. changeCheck: function(e) {
  305. var items = this.list1;
  306. var len = this.list1.length;
  307. var values = e.detail.value;
  308. console.log(values)
  309. for (var i = 0; i < len; i++) {
  310. var item = items[i];
  311. if (values.includes(String(item.task_id))) {
  312. this.$set(item, 'checked', true);
  313. } else {
  314. this.$set(item, 'checked', false);
  315. }
  316. }
  317. // 判断选中状态
  318. var isAll = this.list1.every(item => item.checked == true)
  319. isAll ? this.$set(this.allCheck, 'checked', true) : this.$set(this.allCheck, 'checked', false)
  320. },
  321. // 获取提现任务
  322. getTaskInfo() {
  323. return this.$https.get('/youngee/c/t/g/get-withdraw-task-info')
  324. .then(res => {
  325. this.list1 = []
  326. this.list2 = []
  327. this.list3 = []
  328. // console.log(res)
  329. if (res.data.data.can_withdraw_task_info_list != null) {
  330. this.list1 = res.data.data.can_withdraw_task_info_list
  331. for (let i = 0; i < this.list1.length; i++) {
  332. this.list1[i].show_task_reward = money(this.list1[i].task_reward)
  333. this.list1[i].show_settle_amount = money(this.list1[i].settle_amount)
  334. let ProductPhoto = JSON.parse(this.list1[i].product_photo);
  335. for (let j = 0; j < ProductPhoto.length; ++j) {
  336. if (ProductPhoto[j].Symbol == 1) {
  337. this.list1[i].product_photo = ProductPhoto[j]
  338. }
  339. }
  340. // this.list1[i].show_product_price = money(this.list1[i].product_price)
  341. // this.list1[i].RecruitStrategy.show_followers_low = fansview(this.list1[i]
  342. // .RecruitStrategy.followers_low)
  343. // this.list1[i].RecruitStrategy.show_followers_up = fansview(this.list1[i]
  344. // .RecruitStrategy.followers_up)
  345. // switch (this.list1[i].RecruitStrategy.fee_form) {
  346. // case 1:
  347. // this.list1[i].RecruitStrategy.show_fee_form = "产品置换"
  348. // break
  349. // case 2:
  350. // this.list1[i].RecruitStrategy.show_fee_form = "固定稿费"
  351. // break
  352. // case 3:
  353. // this.list1[i].RecruitStrategy.show_fee_form = "自报价"
  354. // break
  355. // }
  356. }
  357. }
  358. if (res.data.data.withdrawed_task_info_list != null) {
  359. this.list2 = res.data.data.withdrawed_task_info_list
  360. for (let i = 0; i < this.list2.length; i++) {
  361. this.list2[i].show_task_reward = money(this.list2[i].task_reward)
  362. this.list2[i].show_settle_amount = money(this.list2[i].settle_amount)
  363. let ProductPhoto = JSON.parse(this.list2[i].product_photo);
  364. for (let j = 0; j < ProductPhoto.length; ++j) {
  365. if (ProductPhoto[j].Symbol == 1) {
  366. this.list2[i].product_photo = ProductPhoto[j]
  367. }
  368. }
  369. // this.list2[i].show_product_price = money(this.list2[i].product_price)
  370. // this.list2[i].RecruitStrategy.show_followers_low = fansview(this.list2[i]
  371. // .RecruitStrategy.followers_low)
  372. // this.list2[i].RecruitStrategy.show_followers_up = fansview(this.list2[i]
  373. // .RecruitStrategy.followers_up)
  374. // switch (this.list2[i].RecruitStrategy.fee_form) {
  375. // case 1:
  376. // this.list2[i].RecruitStrategy.show_fee_form = "产品置换"
  377. // break
  378. // case 2:
  379. // this.list2[i].RecruitStrategy.show_fee_form = "固定稿费"
  380. // break
  381. // case 3:
  382. // this.list2[i].RecruitStrategy.show_fee_form = "自报价"
  383. // break
  384. // }
  385. }
  386. }
  387. if (res.data.data.withdrawing_task_info_list != null) {
  388. this.list3 = res.data.data.withdrawing_task_info_list
  389. for (let i = 0; i < this.list3.length; i++) {
  390. this.list3[i].show_task_reward = money(this.list3[i].task_reward)
  391. this.list3[i].show_settle_amount = money(this.list3[i].settle_amount)
  392. let ProductPhoto = JSON.parse(this.list3[i].product_photo);
  393. for (let j = 0; j < ProductPhoto.length; ++j) {
  394. if (ProductPhoto[j].Symbol == 1) {
  395. this.list3[i].product_photo = ProductPhoto[j]
  396. }
  397. }
  398. // this.list3[i].show_product_price = money(this.list3[i].product_price)
  399. // this.list3[i].RecruitStrategy.show_followers_low = fansview(this.list3[i]
  400. // .RecruitStrategy.followers_low)
  401. // this.list3[i].RecruitStrategy.show_followers_up = fansview(this.list3[i]
  402. // .RecruitStrategy.followers_up)
  403. // switch (this.list3[i].RecruitStrategy.fee_form) {
  404. // case 1:
  405. // this.list3[i].RecruitStrategy.show_fee_form = "产品置换"
  406. // break
  407. // case 2:
  408. // this.list3[i].RecruitStrategy.show_fee_form = "固定稿费"
  409. // break
  410. // case 3:
  411. // this.list3[i].RecruitStrategy.show_fee_form = "自报价"
  412. // break
  413. // }
  414. }
  415. }
  416. })
  417. },
  418. toShow1() {
  419. this.showList2 = false;
  420. this.showList3 = false;
  421. this.showList1 = true;
  422. },
  423. toShow2() {
  424. this.showList1 = false;
  425. this.showList3 = false;
  426. this.showList2 = true;
  427. },
  428. toShow3() {
  429. this.showList2 = false;
  430. this.showList1 = false;
  431. this.showList3 = true;
  432. },
  433. withdraw() {
  434. let taskIdList = []
  435. let totalAmount = 0
  436. for (let i = 0; i < this.list1.length; ++i) {
  437. if (this.list1[i].checked) {
  438. taskIdList.push(this.list1[i].task_id)
  439. totalAmount += this.list1[i].settle_amount
  440. }
  441. }
  442. if (taskIdList.length == 0) {
  443. uni.showToast({
  444. content: '请先选择提现任务',
  445. icon: 'none'
  446. });
  447. return
  448. }
  449. var data = {
  450. taskIdList: taskIdList,
  451. totalAmount: totalAmount
  452. };
  453. data = JSON.stringify(data)
  454. uni.navigateTo({
  455. url: './myincome/applywithdraw?textObj=' + encodeURIComponent(data)
  456. });
  457. }
  458. },
  459. };
  460. </script>
  461. <style>
  462. /deep/ .share .uni-popup .uni-popup__wrapper {
  463. width: 70% !important;
  464. border-radius: 15rpx !important;
  465. }
  466. </style>
  467. <style lang="scss" scoped>
  468. p {
  469. font-size: 32rpx;
  470. }
  471. .menu {
  472. display: flex;
  473. align-items: center;
  474. justify-content: space-between;
  475. }
  476. .menu-item p {
  477. font-weight: 600;
  478. &.lor {
  479. border-bottom: 5rpx solid #F0D232;
  480. color: #F0D232;
  481. padding-bottom: 15rpx;
  482. }
  483. &.unlor {
  484. color: #81838f;
  485. padding-bottom: 15rpx;
  486. border-bottom: 5rpx solid #ffffff;
  487. }
  488. }
  489. .show-income1 {
  490. display: flex;
  491. align-items: center;
  492. height: 120rpx;
  493. margin: 0 3%;
  494. }
  495. .show-income1-text {
  496. margin-left: 20rpx;
  497. margin-right: 200rpx;
  498. }
  499. .show-income1-text2 {
  500. flex: 1;
  501. display: flex;
  502. }
  503. .show-income1-btn {
  504. width: 200rpx;
  505. text-align: center;
  506. background-color: #F0D232;
  507. border-radius: 15rpx;
  508. font-size: 35rpx;
  509. line-height: 180%;
  510. }
  511. .show-income2 {
  512. display: flex;
  513. align-items: center;
  514. justify-content: space-around;
  515. height: 150rpx;
  516. margin: 0 3% 3%;
  517. background-color: #F0D232;
  518. border-radius: 10rpx;
  519. }
  520. .show-income2-text {
  521. // padding: 0 50rpx;
  522. text-align: center;
  523. }
  524. .show-income3 {
  525. margin: 0 50rpx;
  526. }
  527. .show-income3 p {
  528. margin-top: 50rpx;
  529. }
  530. .income-list {
  531. margin-bottom: 100rpx;
  532. }
  533. .income-list-cell {
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. }
  538. .income-list-cell-left {
  539. display: flex;
  540. align-items: center;
  541. margin: 20rpx 0;
  542. }
  543. .income-list-cell-right {
  544. display: flex;
  545. flex-direction: column;
  546. align-items: flex-end;
  547. }
  548. .income-list-cell-right p {
  549. // color: #F0D232;
  550. font-size: 32rpx;
  551. margin-right: 50rpx;
  552. }
  553. // .income-list-cell2 {
  554. // margin-left: 70rpx;
  555. // }
  556. .income-info {
  557. display: flex;
  558. // align-items: center;
  559. }
  560. .income-list-checkbox {
  561. width: 50rpx;
  562. transform: scale(0.7)
  563. }
  564. .income-info-product image {
  565. height: 120rpx;
  566. width: 120rpx;
  567. padding: 10rpx;
  568. }
  569. .income-info-tp {
  570. display: flex;
  571. flex-direction: column;
  572. }
  573. .income-info-project {
  574. display: flex;
  575. align-items: center;
  576. margin: 10rpx 0;
  577. }
  578. .income-info-project image {
  579. height: 40rpx;
  580. width: 40rpx;
  581. padding-right: 20rpx;
  582. }
  583. .interval2 {
  584. width: 100%;
  585. height: 120rpx;
  586. margin-top: 5%;
  587. }
  588. .income-workList-buttons {
  589. display: flex;
  590. justify-content: space-between;
  591. align-items: center;
  592. padding: 2% 50rpx;
  593. position: fixed;
  594. width: 90%;
  595. bottom: 20rpx;
  596. height: 90rpx;
  597. // padding-top: 2%;
  598. background-color: #FFFFFF;
  599. margin-top: 100rpx;
  600. }
  601. .all-check-box {
  602. display: flex;
  603. margin-left: -20rpx;
  604. }
  605. .right-btn {
  606. width: 150rpx;
  607. text-align: center;
  608. color: #000;
  609. background-color: #F0D232;
  610. border-radius: 15rpx;
  611. font-size: 32rpx;
  612. line-height: 180%;
  613. }
  614. </style>