mycenter.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view style="margin-top: 160rpx;"></view>
  6. <view>
  7. <view class="head" v-if="token">
  8. <view class="head-avator">
  9. <image :src="avatarUrl" mode="" style="border-radius: 50%; width: 100%;height: 100%;">
  10. </image>
  11. </view>
  12. <view>
  13. <p style="padding-bottom: 20rpx;font-size: 35rpx;">{{information.talent_wx_nickname}}</p>
  14. <p style="font-size: 25rpx;">ID:{{information.id}}</p>
  15. </view>
  16. <image class="head-message" :src="picture.icon_message"></image>
  17. </view>
  18. <view class="head" v-if="!token">
  19. <view class="head-avator">
  20. <image :src="picture.defaultavatarUrl" mode="" @tap="login"
  21. style="border-radius: 50%; width: 100%;height: 100%;"></image>
  22. </view>
  23. <view class="head-text">
  24. <p @tap="login" style="font-size: 35rpx;padding-bottom: 10rpx;">未登录</p>
  25. <p @tap="login" style="font-size: 30rpx;">点击登录账号</p>
  26. </view>
  27. </view>
  28. <view class="show-income1">
  29. <view class="show-income1-text">
  30. <p>我获得的收益总数</p>
  31. <p style="font-size: 40rpx;font-weight:bold;color: #F0D232;" @click="toincome('all')">
  32. {{information.income?information.income:0}}
  33. </p>
  34. </view>
  35. <view class="show-income1-text2">
  36. <button class="show-income1-btn" type="default" @click="withdraw()">提现</button>
  37. </view>
  38. </view>
  39. <view class="show-income2">
  40. <view class="show-income2-text" @click="toincome('can')">
  41. <p style="padding-bottom: 20rpx;">可提现</p>
  42. <p>{{information.canwithdraw?information.canwithdraw:0}}</p>
  43. </view>
  44. <view class="show-income2-text" @click="toincome('ed')">
  45. <p style="padding-bottom: 20rpx;">已提现</p>
  46. <p>{{information.withdrawed?information.withdrawed:0}}</p>
  47. </view>
  48. <view class="show-income2-text" @click="toincome('ing')">
  49. <p style="padding-bottom: 20rpx;">提现中</p>
  50. <p>{{information.withdrawing?information.withdrawing:0}}</p>
  51. </view>
  52. </view>
  53. <view class="show-body" style="border-bottom: 1rpx solid #c8c8c8;">
  54. <view class="show-body1">
  55. <view class="show-body1-text1" @click="tomytask('all')">
  56. <p>我的任务</p>
  57. </view>
  58. <view class="show-body1-text2" @click="tomytask('all')">
  59. <image class="show-body1-icon" :src="picture.icon_right"></image>
  60. </view>
  61. </view>
  62. <view class="show-body2">
  63. <view class="show-body2-text" style="padding-left: 30rpx;" @click="tomytask('all')">
  64. <p class="task-num-p">{{information.task_all?information.task_all:0}}</p>
  65. <p padding>全部任务</p>
  66. </view>
  67. <view class="show-body2-text" @click="tomytask('apply')">
  68. <p class="task-num-p">{{information.task_apply?information.task_apply:0}}
  69. <p>
  70. <p>已报名</p>
  71. </view>
  72. <view class="show-body2-text" @click="tomytask('execute')">
  73. <p class="task-num-p">{{information.task_execute?information.task_execute:0}}</p>
  74. <p>执行中</p>
  75. </view>
  76. <view class="show-body2-text" @click="tomytask('end')">
  77. <p class="task-num-p">{{ information.task_end ? information.task_end:0}}</p>
  78. <p>已结束</p>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="show-body">
  83. <view class="show-body1">
  84. <view class="show-body1-text1">
  85. <p>我的信息</p>
  86. </view>
  87. <view class="show-body1-text2">
  88. <image class="show-body1-icon" :src="picture.icon_right"></image>
  89. </view>
  90. </view>
  91. <view class="show-info">
  92. <view class="show-info-text" @click="personinfo()">
  93. <image class="show-info-icon" :src="picture.icon_person"></image>
  94. <p>个人资料</p>
  95. </view>
  96. <view class="show-info-text" @click="mylocation()">
  97. <image class="show-info-icon" :src="picture.icon_location"></image>
  98. <p>收货地址</p>
  99. </view>
  100. <view class="show-info-text" @click="myaccount()">
  101. <image class="show-info-icon" :src="picture.icon_account"></image>
  102. <p>社媒账号</p>
  103. </view>
  104. <view class="show-info-text" @click="mybank()">
  105. <image class="show-info-icon" :src="picture.icon_rmb"></image>
  106. <p>提现绑定</p>
  107. </view>
  108. </view>
  109. </view>
  110. <!-- 普通弹窗 公众号-->
  111. <uni-popup ref="popup2" class="share" background-color="#fff" @change="change">
  112. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  113. <view class="sharepage">
  114. <view class="Tasktext1">
  115. <image :src="picture.task15" mode=""></image>
  116. <span>YoungGee</span>
  117. </view>
  118. <view class="" style="margin-top: 5%;">
  119. <p style='color: #333333;font-size: 28rpx;text-align: center;'>不错过任何上新</p>
  120. </view>
  121. <view class="" style="margin-top: 5%;">
  122. <p style='color: #333333;font-size: 24rpx;'>公众号:</p>
  123. </view>
  124. <view class="sharemap">
  125. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/gzh.png" mode="">
  126. </image>
  127. </view>
  128. </view>
  129. </view>
  130. </uni-popup>
  131. <!-- 普通弹窗 商务合作-->
  132. <uni-popup ref="popup3" class="share" background-color="#fff" @change="change">
  133. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  134. <view class="sharepage">
  135. <view class="Tasktext1">
  136. <image :src="picture.task15" mode=""></image>
  137. <span>YoungGee</span>
  138. </view>
  139. <view class="" style="margin-top: 5%;">
  140. <p style='color: #333333;font-size: 28rpx;text-align: center;'>商务合作请联系我们</p>
  141. </view>
  142. <view class="" style="margin-top: 5%;">
  143. <p style='color: #333333;font-size: 24rpx;'>电话:010-53355656</p>
  144. <p style='color: #333333;font-size: 24rpx;'>商务:</p>
  145. </view>
  146. <view class="sharemap" style="margin-bottom: 5%;margin-top: 5%;">
  147. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/shangwu.png" mode="">
  148. </image>
  149. </view>
  150. </view>
  151. </view>
  152. </uni-popup>
  153. <!-- 普通弹窗 客服-->
  154. <uni-popup ref="popup4" class="share" background-color="#fff" @change="change">
  155. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  156. <view class="sharepage">
  157. <view class="Tasktext1">
  158. <image :src="picture.task15" mode=""></image>
  159. <span>YoungGee</span>
  160. </view>
  161. <view class="" style="margin-top: 5%;">
  162. <p style='color: #333333;font-size: 28rpx;text-align: center;'>扫码联系</p>
  163. </view>
  164. <view class="sharemap">
  165. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu.png" mode="">
  166. </image>
  167. </view>
  168. </view>
  169. </view>
  170. </uni-popup>
  171. </view>
  172. </view>
  173. </template>
  174. <script>
  175. import mvBar from "@/components/mys_navBar/mysNavBar";
  176. export default {
  177. components: {
  178. mvBar,
  179. },
  180. data() {
  181. return {
  182. picture: {
  183. icon_person: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-person.png',
  184. icon_location: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-location.png',
  185. icon_account: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-account.png',
  186. icon_rmb: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-rmb.png',
  187. icon_message: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-message.png',
  188. icon_right: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/icon-arrow-right.png',
  189. defaultavatarUrl: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/logoxin01.png',
  190. },
  191. token: '',
  192. nickName: '',
  193. avatarUrl: '',
  194. type: 'center',
  195. type2: 'center',
  196. type3: 'center',
  197. type4: 'center',
  198. mysNavConfig: {
  199. /* 开启单页显示首页图标 */
  200. isHome: true,
  201. /* 固定导航 */
  202. navFixed: true,
  203. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  204. navTitle: {
  205. text: "我的",
  206. color: "",
  207. fontSize: "32rpx", // px upx rpx
  208. fontWeight: "normal", // 100 - 700
  209. },
  210. },
  211. codeImg: '',
  212. information: {},
  213. };
  214. },
  215. onShow() {
  216. // 显示加载中
  217. uni.showLoading({
  218. title: '加载中'
  219. });
  220. // 判断是否登录
  221. this.isLogin()
  222. if (this.token !== '') { // 若登录
  223. this.nickName = uni.getStorageSync('nickName')
  224. this.avatarUrl = uni.getStorageSync('avatarUrl')
  225. this.gettalentinfo() // 获取达人基本信息
  226. this.getTaskNum() // 获取参与任务数量
  227. } else { // 未登录
  228. uni.hideLoading();
  229. }
  230. },
  231. onLoad() {},
  232. methods: {
  233. // 判断登陆是否过期
  234. isLogin() {
  235. if (this.token == '') {
  236. this.token = uni.getStorageSync('token')
  237. }
  238. this.$https.get('/youngee/c/t/g/is-login')
  239. .then(res => {
  240. console.log(res)
  241. if (res.data.code == 403) {
  242. this.token = ""
  243. uni.clearStorage();
  244. }
  245. })
  246. },
  247. // 获取达人基本信息
  248. gettalentinfo() {
  249. this.$https.get('/youngee/c/t/g/get-talent-info')
  250. .then(res => {
  251. console.log(res)
  252. this.information = res.data.data
  253. })
  254. },
  255. // 获取达人参与任务数量
  256. getTaskNum() {
  257. this.$https.get('/youngee/c/t/g/get-task-num')
  258. .then(res => {
  259. console.log(res)
  260. this.information.task_all = res.data.data.all_num
  261. this.information.task_apply = res.data.data.sign_up_num
  262. this.information.task_execute = res.data.data.going_on_num
  263. this.information.task_end = res.data.data.completed_num
  264. uni.hideLoading();
  265. })
  266. },
  267. // 进入登录页面
  268. login() {
  269. uni.navigateTo({
  270. url: '../login/login'
  271. });
  272. },
  273. // 进入个人资料
  274. personinfo() {
  275. if (this.token !== '')
  276. uni.navigateTo({
  277. url: '/pages/mycenter/myinformation/personinfo'
  278. });
  279. else
  280. this.login()
  281. },
  282. // 进入收货地址
  283. mylocation() {
  284. if (this.token !== '')
  285. uni.navigateTo({
  286. url: '/pages/mycenter/myinformation/mylocation'
  287. });
  288. else
  289. this.login()
  290. },
  291. // 进入社媒账号
  292. myaccount() {
  293. if (this.token !== '')
  294. uni.navigateTo({
  295. url: '/pages/mycenter/myinformation/myaccount'
  296. });
  297. else
  298. this.login()
  299. },
  300. // 进入个人账号页面
  301. mybank() {
  302. if (this.token !== '')
  303. uni.navigateTo({
  304. url: '/pages/mycenter/myinformation/mybank'
  305. });
  306. else
  307. this.login()
  308. },
  309. // 提现
  310. withdraw() {
  311. console.log("提现")
  312. },
  313. // 进入收益页面
  314. toincome(tab) {
  315. console.log(tab)
  316. },
  317. // 进入我的任务页面
  318. tomytask(tab) {
  319. if (this.token !== '') {
  320. switch (tab) {
  321. case "all":
  322. uni.navigateTo({
  323. url: '/pages/mycenter/mytask/mytask'
  324. });
  325. break;
  326. case "execute":
  327. uni.navigateTo({
  328. url: '/pages/mycenter/mytask/executetask'
  329. });
  330. break;
  331. case "apply":
  332. uni.navigateTo({
  333. url: '/pages/mycenter/mytask/applytask'
  334. });
  335. break;
  336. case "end":
  337. uni.navigateTo({
  338. url: '/pages/mycenter/mytask/endtask'
  339. });
  340. break;
  341. }
  342. } else
  343. this.login()
  344. console.log(tab)
  345. },
  346. // 保留两位小数点
  347. toDecimal(x) {
  348. var f = parseFloat(x);
  349. if (isNaN(f)) {
  350. return;
  351. }
  352. f = Math.round(x * 100) / 100;
  353. return f;
  354. },
  355. //弹出层
  356. change(e) {
  357. console.log('当前模式:' + e.type + ',状态:' + e.show);
  358. },
  359. togo2(type) {
  360. this.type2 = type
  361. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  362. this.$refs.popup2.open(type)
  363. // this.$refs.popup1.close()
  364. },
  365. togo3(type) {
  366. this.type3 = type
  367. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  368. this.$refs.popup3.open(type)
  369. // this.$refs.popup1.close()
  370. },
  371. togo4(type) {
  372. this.type4 = type
  373. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  374. this.$refs.popup4.open(type)
  375. // this.$refs.popup1.close()
  376. },
  377. },
  378. };
  379. </script>
  380. <style>
  381. /deep/ .share .uni-popup .uni-popup__wrapper {
  382. width: 70% !important;
  383. border-radius: 15rpx !important;
  384. }
  385. </style>
  386. <style lang="scss" scoped>
  387. p {
  388. font-size: 30rpx;
  389. }
  390. .head {
  391. display: flex;
  392. /* 垂直居中 */
  393. align-items: center;
  394. height: 200rpx;
  395. position: relative;
  396. margin: 2% 3% 3%;
  397. }
  398. .head-avator {
  399. display: inline-block;
  400. margin: 0 25rpx;
  401. width: 120rpx;
  402. height: 120rpx;
  403. background-color: #F0D232;
  404. border-radius: 50%;
  405. }
  406. .head-text {
  407. display: inline-block;
  408. }
  409. .head-message {
  410. margin: 10rpx 20rpx 10rpx 100rpx;
  411. width: 60rpx;
  412. height: 60rpx;
  413. }
  414. .show-income1 {
  415. display: flex;
  416. align-items: center;
  417. height: 120rpx;
  418. margin: 0 3%;
  419. }
  420. .show-income1-text {
  421. margin-left: 20rpx;
  422. margin-right: 200rpx;
  423. }
  424. .show-income1-text2 {
  425. flex: 1;
  426. display: flex;
  427. }
  428. .show-income1-btn {
  429. width: 200rpx;
  430. text-align: center;
  431. background-color: #F0D232;
  432. border-radius: 15rpx;
  433. font-size: 35rpx;
  434. line-height: 180%;
  435. }
  436. .show-income2 {
  437. display: flex;
  438. align-items: center;
  439. justify-content: space-between;
  440. height: 150rpx;
  441. margin: 0 3% 3%;
  442. background-color: #F0D232;
  443. border-radius: 10rpx;
  444. }
  445. .show-income2-text {
  446. padding: 0 50rpx;
  447. text-align: center;
  448. }
  449. .show-body {
  450. height: 250rpx;
  451. margin: 0 3% 3%;
  452. }
  453. .show-body1 {
  454. display: flex;
  455. align-items: center;
  456. height: 80rpx;
  457. }
  458. .show-body1-text1 {
  459. display: flex;
  460. justify-content: flex-start;
  461. margin-left: 20rpx;
  462. // margin-right: 480rpx;
  463. }
  464. .show-body1-text2 {
  465. display: flex;
  466. justify-content: flex-end;
  467. margin-right: 20rpx;
  468. flex: 1;
  469. // display: flex;
  470. }
  471. .show-body1-icon {
  472. width: 30rpx;
  473. height: 30rpx;
  474. }
  475. .show-body2 {
  476. display: flex;
  477. align-items: center;
  478. // justify-content: space-between;
  479. }
  480. .show-body2-text {
  481. width: 150rpx;
  482. text-align: center;
  483. }
  484. .task-num-p {
  485. padding-bottom: 40rpx;
  486. font-size: 35rpx;
  487. font-weight: bold;
  488. color: #F0D232;
  489. }
  490. .shu-line {
  491. border: 1rpx solid #BCBCBC;
  492. float: left;
  493. height: 70rpx;
  494. margin: 0 10rpx;
  495. margin-bottom: 30rpx;
  496. }
  497. .show-info {
  498. display: flex;
  499. align-items: center;
  500. justify-content: space-between;
  501. padding: 0 40rpx;
  502. }
  503. .show-info-text {
  504. text-align: center;
  505. }
  506. .show-info-icon {
  507. width: 50rpx;
  508. height: 50rpx;
  509. }
  510. .butto {
  511. text-align: center;
  512. }
  513. .option {
  514. padding: 20rpx;
  515. }
  516. .uni-margin-wrap {
  517. width: 690rpx;
  518. width: 100%;
  519. ;
  520. }
  521. .swiper {
  522. height: 300rpx;
  523. }
  524. .swiper-item {
  525. display: block;
  526. height: 300rpx;
  527. line-height: 300rpx;
  528. text-align: center;
  529. }
  530. .swiper-list {
  531. margin-top: 40rpx;
  532. margin-bottom: 0;
  533. }
  534. .uni-common-mt {
  535. margin-top: 60rpx;
  536. position: relative;
  537. }
  538. .info {
  539. position: absolute;
  540. right: 20rpx;
  541. }
  542. .uni-padding-wrap {
  543. width: 550rpx;
  544. padding: 0 100rpx;
  545. }
  546. .card {
  547. width: 88%;
  548. // height: 200rpx;
  549. padding: 24rpx;
  550. margin-top: 30rpx;
  551. border-radius: 15rpx;
  552. background-color: #ffffff;
  553. margin: 0 auto;
  554. box-shadow: 0px 0px 10rpx 2rpx #ffffff;
  555. }
  556. .iimmg {
  557. width: 80rpx;
  558. height: 80rpx;
  559. background-color: #FFFFFF;
  560. border-radius: 15%;
  561. }
  562. .iimmg image {
  563. width: 60%;
  564. height: 60%;
  565. padding: 20%;
  566. }
  567. .ppan {
  568. font-size: 60%;
  569. margin-top: 1%;
  570. }
  571. .headportrait {
  572. margin: 0 auto;
  573. width: 180rpx;
  574. height: 180rpx;
  575. background-color: #FEE58E;
  576. border-radius: 50%;
  577. }
  578. .task22 {
  579. width: 80%;
  580. height: 80%;
  581. padding: 10%;
  582. }
  583. .but1 {
  584. // width: 120%;
  585. text-align: center;
  586. background-color: #1890FF;
  587. color: #FFFFFF;
  588. border-radius: 10rpx;
  589. font-size: 34rpx;
  590. line-height: 150%;
  591. font-weight: 500;
  592. height: 60%;
  593. }
  594. .dou p {
  595. font-size: 26rpx;
  596. color: #333333;
  597. font-weight: 550;
  598. text-align: center;
  599. }
  600. .dou span {
  601. font-size: 24rpx;
  602. color: #666666;
  603. text-align: center;
  604. }
  605. .title-left {
  606. width: 4rpx;
  607. height: 80rpx;
  608. background: #E2E2E2;
  609. display: inline-block;
  610. border-radius: 1rpx;
  611. margin-top: 4rpx;
  612. vertical-align: top;
  613. }
  614. //弹窗
  615. .sharepage {
  616. width: 90%;
  617. margin: 0 auto;
  618. // position: relative;
  619. }
  620. /deep/ .share.uni-popup .uni-popup__wrapper {
  621. width: 70%;
  622. border-radius: 15rpx;
  623. }
  624. .Tasktext1 {
  625. // padding-top: 5%;
  626. padding: 0 0 0 1%;
  627. height: 80rpx;
  628. margin-top: 7%;
  629. text-align: center;
  630. }
  631. .Tasktext1 span {
  632. color: #333333;
  633. font-size: 100%;
  634. font-weight: 550;
  635. text-indent: 2em;
  636. }
  637. .Tasktext1 image {
  638. vertical-align: middle;
  639. width: 80rpx;
  640. height: 80rpx;
  641. display: inline-block;
  642. padding-right: 14rpx;
  643. }
  644. .sharemap {
  645. margin: 0 auto;
  646. text-align: center;
  647. margin-top: 15%;
  648. margin-bottom: 15%;
  649. }
  650. .sharemap image {
  651. width: 400rpx;
  652. height: 400rpx;
  653. }
  654. .butmin {
  655. height: 48rpx;
  656. background-color: #3397FA;
  657. color: #FFFFFF;
  658. line-height: 48rpx;
  659. }
  660. </style>