myincome.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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. </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: 50rpx;" 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.show_product_price}}元</p>
  53. <p>粉丝量:{{item.RecruitStrategy.show_followers_low}}-{{item.RecruitStrategy.show_followers_up}}
  54. </p>
  55. <p>稿费:{{item.RecruitStrategy.show_fee_form}} {{item.show_task_reward}}</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: 50rpx;" 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.show_product_price}}元</p>
  70. <p>粉丝量:{{item.RecruitStrategy.show_followers_low}}-{{item.RecruitStrategy.show_followers_up}}
  71. </p>
  72. <p>稿费:{{item.RecruitStrategy.show_fee_form}} {{item.show_task_reward}}元</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. money,
  106. fansview
  107. } from '@/components/utils.js';
  108. export default {
  109. components: {
  110. mvBar,
  111. },
  112. data() {
  113. return {
  114. navH: getApp().globalData.navHeight,
  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. console.log(options)
  252. this.showTab = options.showTab
  253. // 传过来的id
  254. if (this.showTab == '1') {
  255. this.toShow1();
  256. } else if (this.showTab == '2') {
  257. this.toShow2();
  258. } else if (this.showTab == '3') {
  259. this.toShow3();
  260. }
  261. },
  262. methods: {
  263. // 判断登陆是否过期
  264. isLogin() {
  265. return this.$https.get('/youngee/c/t/g/is-login')
  266. .then(res => {
  267. if (res.data.code === 403) {
  268. // 登陆已失效
  269. this.token = ""
  270. } else {
  271. this.token = uni.getStorageSync('token')
  272. }
  273. })
  274. },
  275. // 全选
  276. changeAll: function(e) {
  277. if (e.detail.value.length == 0) {
  278. this.list1.map(item => this.$set(item, 'checked', false));
  279. this.$set(this.allCheck, 'checked', false);
  280. } else {
  281. this.list1.map(item => this.$set(item, 'checked', true));
  282. this.$set(this.allCheck, 'checked', true);
  283. }
  284. },
  285. // 多选
  286. changeCheck: function(e) {
  287. var items = this.list1;
  288. var len = this.list1.length;
  289. var values = e.detail.value;
  290. console.log(values)
  291. for (var i = 0; i < len; i++) {
  292. var item = items[i];
  293. if (values.includes(String(item.task_id))) {
  294. this.$set(item, 'checked', true);
  295. } else {
  296. this.$set(item, 'checked', false);
  297. }
  298. }
  299. // 判断选中状态
  300. var isAll = this.list1.every(item => item.checked == true)
  301. isAll ? this.$set(this.allCheck, 'checked', true) : this.$set(this.allCheck, 'checked', false)
  302. },
  303. // 获取提现任务
  304. getTaskInfo() {
  305. return this.$https.get('/youngee/c/t/g/get-withdraw-task-info')
  306. .then(res => {
  307. this.list1 = []
  308. this.list2 = []
  309. this.list3 = []
  310. // console.log(res)
  311. if (res.data.data.can_withdraw_task_info_list != null) {
  312. this.list1 = res.data.data.can_withdraw_task_info_list
  313. for (let i = 0; i < this.list1.length; i++) {
  314. this.list1[i].show_product_price = money(this.list1[i].product_price)
  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_product_price = money(this.list2[i].product_price)
  338. this.list2[i].show_task_reward = money(this.list2[i].task_reward)
  339. this.list2[i].show_settle_amount = money(this.list2[i].settle_amount)
  340. this.list2[i].RecruitStrategy.show_followers_low = fansview(this.list2[i]
  341. .RecruitStrategy.followers_low)
  342. this.list2[i].RecruitStrategy.show_followers_up = fansview(this.list2[i]
  343. .RecruitStrategy.followers_up)
  344. switch (this.list2[i].RecruitStrategy.fee_form) {
  345. case 1:
  346. this.list2[i].RecruitStrategy.show_fee_form = "产品置换"
  347. break
  348. case 2:
  349. this.list2[i].RecruitStrategy.show_fee_form = "固定稿费"
  350. break
  351. case 3:
  352. this.list2[i].RecruitStrategy.show_fee_form = "自报价"
  353. break
  354. }
  355. }
  356. }
  357. if (res.data.data.withdrawing_task_info_list != null) {
  358. this.list3 = res.data.data.withdrawing_task_info_list
  359. for (let i = 0; i < this.list3.length; i++) {
  360. this.list3[i].show_product_price = money(this.list3[i].product_price)
  361. this.list3[i].show_task_reward = money(this.list3[i].task_reward)
  362. this.list3[i].show_settle_amount = money(this.list3[i].settle_amount)
  363. this.list3[i].RecruitStrategy.show_followers_low = fansview(this.list3[i]
  364. .RecruitStrategy.followers_low)
  365. this.list3[i].RecruitStrategy.show_followers_up = fansview(this.list3[i]
  366. .RecruitStrategy.followers_up)
  367. switch (this.list3[i].RecruitStrategy.fee_form) {
  368. case 1:
  369. this.list3[i].RecruitStrategy.show_fee_form = "产品置换"
  370. break
  371. case 2:
  372. this.list3[i].RecruitStrategy.show_fee_form = "固定稿费"
  373. break
  374. case 3:
  375. this.list3[i].RecruitStrategy.show_fee_form = "自报价"
  376. break
  377. }
  378. }
  379. }
  380. })
  381. },
  382. toShow1() {
  383. this.showList2 = false;
  384. this.showList3 = false;
  385. this.showList1 = true;
  386. },
  387. toShow2() {
  388. this.showList1 = false;
  389. this.showList3 = false;
  390. this.showList2 = true;
  391. },
  392. toShow3() {
  393. this.showList2 = false;
  394. this.showList1 = false;
  395. this.showList3 = true;
  396. },
  397. withdraw() {
  398. let taskIdList = []
  399. let totalAmount = 0
  400. for (let i = 0; i < this.list1.length; ++i) {
  401. if (this.list1[i].checked) {
  402. taskIdList.push(this.list1[i].task_id)
  403. totalAmount += this.list1[i].settle_amount
  404. }
  405. }
  406. if (taskIdList.length == 0) {
  407. uni.showToast({
  408. content: '请先选择提现任务',
  409. icon: 'none'
  410. });
  411. return
  412. }
  413. var data = {
  414. taskIdList: taskIdList,
  415. totalAmount: totalAmount
  416. };
  417. data = JSON.stringify(data)
  418. uni.navigateTo({
  419. url: './myincome/applywithdraw?textObj=' + encodeURIComponent(data)
  420. });
  421. }
  422. },
  423. };
  424. </script>
  425. <style>
  426. /deep/ .share .uni-popup .uni-popup__wrapper {
  427. width: 70% !important;
  428. border-radius: 15rpx !important;
  429. }
  430. </style>
  431. <style lang="scss" scoped>
  432. p {
  433. font-size: 32rpx;
  434. }
  435. .menu {
  436. display: flex;
  437. align-items: center;
  438. justify-content: space-between;
  439. }
  440. .menu-item p {
  441. font-weight: 600;
  442. &.lor {
  443. border-bottom: 5rpx solid #F0D232;
  444. color: #F0D232;
  445. padding-bottom: 15rpx;
  446. }
  447. &.unlor {
  448. color: #81838f;
  449. padding-bottom: 15rpx;
  450. border-bottom: 5rpx solid #ffffff;
  451. }
  452. }
  453. .show-income1 {
  454. display: flex;
  455. align-items: center;
  456. height: 120rpx;
  457. margin: 0 3%;
  458. }
  459. .show-income1-text {
  460. margin-left: 20rpx;
  461. margin-right: 200rpx;
  462. }
  463. .show-income1-text2 {
  464. flex: 1;
  465. display: flex;
  466. }
  467. .show-income1-btn {
  468. width: 200rpx;
  469. text-align: center;
  470. background-color: #F0D232;
  471. border-radius: 15rpx;
  472. font-size: 35rpx;
  473. line-height: 180%;
  474. }
  475. .show-income2 {
  476. display: flex;
  477. align-items: center;
  478. justify-content: space-around;
  479. height: 150rpx;
  480. margin: 0 3% 3%;
  481. background-color: #F0D232;
  482. border-radius: 10rpx;
  483. }
  484. .show-income2-text {
  485. // padding: 0 50rpx;
  486. text-align: center;
  487. }
  488. .show-income3 {
  489. margin: 0 50rpx;
  490. }
  491. .show-income3 p {
  492. margin-top: 50rpx;
  493. }
  494. .income-list {
  495. margin-bottom: 100rpx;
  496. }
  497. .income-list-cell {
  498. display: flex;
  499. align-items: center;
  500. justify-content: space-between;
  501. }
  502. .income-list-cell-left {
  503. display: flex;
  504. align-items: center;
  505. margin: 20rpx 0;
  506. }
  507. .income-list-cell-right p {
  508. color: #F0D232;
  509. font-size: 35rpx;
  510. margin-right: 50rpx;
  511. }
  512. // .income-list-cell2 {
  513. // margin-left: 70rpx;
  514. // }
  515. .income-list-checkbox {
  516. width: 50rpx;
  517. transform: scale(0.7)
  518. }
  519. .interval2 {
  520. width: 100%;
  521. height: 120rpx;
  522. margin-top: 5%;
  523. }
  524. .income-workList-buttons {
  525. display: flex;
  526. justify-content: space-between;
  527. align-items: center;
  528. padding: 2% 50rpx;
  529. position: fixed;
  530. width: 90%;
  531. bottom: 20rpx;
  532. height: 90rpx;
  533. // padding-top: 2%;
  534. background-color: #FFFFFF;
  535. margin-top: 100rpx;
  536. }
  537. .all-check-box {
  538. display: flex;
  539. margin-left: -20rpx;
  540. }
  541. .right-btn {
  542. width: 150rpx;
  543. text-align: center;
  544. color: #000;
  545. background-color: #F0D232;
  546. border-radius: 15rpx;
  547. font-size: 32rpx;
  548. line-height: 180%;
  549. }
  550. </style>