myincome.vue 15 KB

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