myincome.vue 16 KB

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