index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view>
  3. <navbar ref="navbar" :config="config" backColor="#666"></navbar>
  4. <view class="career-box">
  5. <view class="career-user">
  6. <view class="user-info">
  7. <view class="user-info-left">
  8. <view class="user-name" v-if="isLogin">{{userInformation.real_name}}
  9. <image class="star" v-if="orderEquity.userPayConsumption>=10000" src="/static/career/star.png" mode=""></image>
  10. <image class="star" v-if="orderEquity.userPayConsumption>=50000" src="/static/career/star.png" mode=""></image>
  11. </view>
  12. <view class="user-name" v-else>登陆/注册<text style="margin-left: 5px;" class="iconfont right">&#xe6c7;</text>
  13. </view>
  14. <view class="user-tag"><text
  15. class="iconfont3 user-tag-icon">&#xe728;</text>{{ userInformation.grade == 1 ? '店长' : '普通会员' }}</view>
  16. <view class="user-tag"><text
  17. class="iconfont3 user-tag-icon">&#xe744;</text>{{userInformation.register_time?userInformation.register_time.substr(0,11):''}}
  18. </view>
  19. <view class="user-tag"><text
  20. class="iconfont3 user-tag-icon">&#xe611;</text>推荐人:{{ userInformation.invited || '平台'}}</view>
  21. <view class="user-tag"><text
  22. class="iconfont3 user-tag-icon">&#xe617;</text>状态:{{ userInformation.activating ? '激活' : '未激活'}}</view>
  23. </view>
  24. <image class="user-head-img" v-if="userInformation.head_photo" :src="userInformation.head_photo"
  25. mode="aspectFill"></image>
  26. <image class="user-head-img" v-else :src="imgUrl+'/head-on.png'" mode="aspectFill"></image>
  27. </view>
  28. <view class="stateBox">
  29. <view class="stateBox_title">说明</view>
  30. <view class="stateBox_txt">惠选区消费得到消费值达到1万1颗星,达到5万2颗星</view>
  31. <view class="stateBox_list">
  32. <view class="line">
  33. <view class="stateBox_lab">{{orderEquity.userPayConsumption||0}}</view>
  34. <view class="stateBox_val">我的消费值</view>
  35. </view>
  36. <view>
  37. <view class="stateBox_lab">{{orderEquity.platformMonthEquity||0}}</view>
  38. <view class="stateBox_val">平台权益值</view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="user-integral" @click.stop="lookConsume()">
  43. <text class="user-integral-nums">{{ $addDecimals(userInformation.commission_able , 2) | integer }}.
  44. <text>{{ $addDecimals(userInformation.commission_able , 2) | decimals }}</text> </text>
  45. <text class="user-integral-hint">我的贡献值(贡献值可变积分)</text>
  46. <text class="user-integral-more iconfont">&#xe6c7;</text>
  47. </view>
  48. </view>
  49. <view class="popularize-info" v-if="userInformation.grade === 0">
  50. <view class="grand-total">
  51. 累计推广人员{{ updatestatisticsData.existing_count }}人,
  52. <span v-if="updatestatisticsData.without_count > 0">升级还需要推广{{ updatestatisticsData.without_count }}人</span>
  53. <span v-else>升级还需要推广{{updatestatisticsData.child_without_count}}人直推用户</span>
  54. </view>
  55. <view class="progress-box">
  56. <view class="progress-line"
  57. :style="{'width':progressWidth(updatestatisticsData.existing_count , updatestatisticsData.without_count)}">
  58. <view class="progress-icon">
  59. <image class="progress-img" src="../../static/career/career4.png" mode=""></image>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="popularize-btn" @click="goSublevelPage('/pages/user/invitationCode/invitationCode')">
  64. 去邀请
  65. </view>
  66. <view class="popularize-hint">
  67. 累计推广人员满{{ updatestatisticsData.count }}人,直推人员满{{ updatestatisticsData.num_direct_referrals }}人,且被推广的人员已激活,可自动升级为店长,尊享团队贡献值,享受更多收益
  68. </view>
  69. </view>
  70. <view class="other">
  71. <view class="other-top">
  72. <view class="left">
  73. 其他工具
  74. </view>
  75. </view>
  76. <view class="option">
  77. <view class="list" @click.stop="goSublevelPage('/pages/user/distribution/moneyList')">
  78. <image class="my-icon" src="../../static/career/career1.png" mode=""></image>
  79. <view class="name-one">推广订单</view>
  80. </view>
  81. <view class="list" @click="goNewPull()">
  82. <image class="my-icon" src="../../static/career/career2.png" mode=""></image>
  83. <view class="name-one">我的团队</view>
  84. </view>
  85. <view class="list" @click="goSublevelPage('/pages/user/invitationCode/invitationCode')">
  86. <image class="my-icon" src="../../static/career/career3.png" mode=""></image>
  87. <view class="name-one">会员码</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import {
  96. updatestatistics,
  97. operatingInfo,
  98. orderEquity
  99. } from "@/api/personal-center.js"
  100. import math from "@/common/math.js"
  101. export default {
  102. data() {
  103. return {
  104. imgUrl: this.$mConfig.staticUrl,
  105. config: {
  106. back: true, //false是tolbar页面 是则不写
  107. title: '事业',
  108. color: '#1a1a1a',
  109. backgroundColor: [1, '#fff'],
  110. rightSlot: true,
  111. },
  112. defaultHeadPhoto: false,
  113. userInformation: {},
  114. updatestatisticsData: {
  115. count: 20,
  116. existing_count: 0,
  117. without_count: 20
  118. },
  119. isLogin: false,
  120. orderEquity:{}
  121. };
  122. },
  123. onShow() {
  124. this.judgeLogin();
  125. this.getOrderEquity()
  126. },
  127. onPullDownRefresh() {
  128. this.judgeLogin();
  129. this.getOrderEquity()
  130. },
  131. computed: {
  132. progressWidth() {
  133. return function(num_1 = 0, num_2 = 1) {
  134. try {
  135. const num = num_1 / num_2 * 100
  136. if (num <= 0) {
  137. return '1px'
  138. } else if (num > 95 && num < 100) {
  139. return '95%'
  140. } else if (num >= 100) {
  141. return '100%'
  142. } else {
  143. return `${num}%`
  144. }
  145. } catch (err) {
  146. return '1px'
  147. }
  148. }
  149. }
  150. },
  151. methods: {
  152. getUpdatestatistics() {
  153. this.$http.get(updatestatistics).then(res => {
  154. if (res && res.code == 200) {
  155. this.updatestatisticsData = res.data;
  156. }
  157. })
  158. },
  159. //获取我的消费值 平台权益值
  160. getOrderEquity(){
  161. this.$http.get(orderEquity).then(res=>{
  162. if(res&&res.code==200){
  163. this.orderEquity=res.data
  164. }
  165. })
  166. },
  167. // lookHeadPhoto(){
  168. // }
  169. judgeLogin() {
  170. this.$http.get(operatingInfo).then(res => {
  171. uni.stopPullDownRefresh();
  172. if (res && res.code == 200) {
  173. this.isLogin = true
  174. this.userInformation = res.data;
  175. if (res.data.grade === 0) {
  176. this.getUpdatestatistics()
  177. }
  178. } else {
  179. this.isLogin = false
  180. }
  181. })
  182. },
  183. lookConsume() {
  184. uni.navigateTo({
  185. url: '/pages/user/consume-val'
  186. })
  187. },
  188. // 跳转 推广拉新
  189. goNewPull() {
  190. let obj = {
  191. real_name: this.userInformation.real_name,
  192. service_system_province: this.userInformation.service_system_province,
  193. head_photo: this.userInformation.head_photo
  194. }
  195. uni.navigateTo({
  196. url: "/pages/operationCenter/newPull?userInfo=" + JSON.stringify(obj)
  197. })
  198. },
  199. // 跳转子级页面
  200. goSublevelPage(page) {
  201. uni.navigateTo({
  202. url: page
  203. })
  204. // if(this.isLogin){
  205. // uni.navigateTo({
  206. // url: page
  207. // })
  208. // }else{
  209. // this.$mUtil.toast("请先登录")
  210. // }
  211. },
  212. }
  213. }
  214. </script>
  215. <style>
  216. page {
  217. background-color: #fff;
  218. }
  219. </style>
  220. <style lang="scss" scoped>
  221. .career-box {
  222. width: 100%;
  223. padding: 40rpx 30rpx 0;
  224. .career-user {
  225. width: 100%;
  226. background-color: #ffffff;
  227. padding: 35rpx 30rpx;
  228. border-radius: 20rpx;
  229. box-shadow: 0 0 40rpx rgb(250, 250, 250);
  230. .user-info {
  231. width: 100%;
  232. display: flex;
  233. justify-content: space-between;
  234. align-items: center;
  235. .user-info-left {
  236. .user-name {
  237. font-size: 36rpx;
  238. font-family: PingFang SC, PingFang SC-Bold;
  239. font-weight: 700;
  240. color: #1a1a1a;
  241. .star{
  242. width: 30rpx;
  243. height: 30rpx;
  244. margin-left: 10rpx;
  245. }
  246. }
  247. .user-tag {
  248. display: flex;
  249. align-items: center;
  250. font-size: 26rpx;
  251. font-family: PingFang SC, PingFang SC-Regular;
  252. font-weight: 400;
  253. color: #808080;
  254. margin-top: 11rpx;
  255. .user-tag-icon {
  256. color: #FA6138;
  257. font-size: 36rpx;
  258. margin-right: 11rpx;
  259. flex-shrink: 0;
  260. }
  261. }
  262. }
  263. .user-head-img {
  264. width: 130rpx;
  265. height: 130rpx;
  266. border-radius: 50%;
  267. }
  268. }
  269. .user-integral {
  270. width: 100%;
  271. height: 180rpx;
  272. background: #FA6138;
  273. border-radius: 20rpx;
  274. padding: 30rpx;
  275. margin-top: 30rpx;
  276. display: flex;
  277. flex-direction: column;
  278. justify-content: center;
  279. color: #fff;
  280. font-family: PingFang SC, PingFang SC-Regular;
  281. font-weight: 400;
  282. position: relative;
  283. .user-integral-nums {
  284. font-size: 38rpx;
  285. // color: #ffffff;
  286. text {
  287. font-size: 24rpx;
  288. }
  289. }
  290. .user-integral-hint {
  291. font-size: 26rpx;
  292. color: #f5f5f5;
  293. }
  294. .user-integral-more {
  295. position: absolute;
  296. right: 30rpx;
  297. top: 50%;
  298. transform: translateY(-50%);
  299. font-size: 37rpx;
  300. }
  301. // <view class="user-integral">
  302. // <text class="user-integral-nums">99999999.00</text>
  303. // <text class="user-integral-hint">我的贡献值(贡献值可变积分)</text>
  304. // <!-- <text class="iconfont">&#xe6c7;</text> -->
  305. // </view>
  306. }
  307. }
  308. .stateBox{
  309. background: #cccccc3d;
  310. border-radius: 20rpx;
  311. padding: 20rpx 40rpx;
  312. margin-top: 30rpx;
  313. .stateBox_title{
  314. font-size: 32rpx;
  315. font-weight: 700;
  316. }
  317. .stateBox_txt{
  318. font-size: 24rpx;
  319. color: #808080;
  320. margin-top: 16rpx;
  321. }
  322. .stateBox_list{
  323. display: flex;
  324. margin: 20rpx 0 10rpx;
  325. .line{
  326. position: relative;
  327. &::after{
  328. display: block;
  329. content: " ";
  330. position: absolute;
  331. width: 1rpx;
  332. height: 60rpx;
  333. right: 0;
  334. top: 10rpx;
  335. background: #cccccc;
  336. }
  337. }
  338. >view{
  339. width: 50%;
  340. padding-left: 30rpx;
  341. &:first-child{
  342. position: relative;
  343. }
  344. }
  345. .stateBox_lab{
  346. font-size: 28rpx;
  347. font-weight: 700;
  348. }
  349. .stateBox_val{
  350. font-size: 24rpx;
  351. color: #808080;
  352. margin-top: 10rpx;
  353. }
  354. }
  355. }
  356. .popularize-info {
  357. margin-top: 30rpx;
  358. background-color: #fff;
  359. width: 100%;
  360. padding: 37rpx 30rpx;
  361. border-radius: 20rpx;
  362. box-shadow: 0 0 40rpx rgb(250, 250, 250);
  363. .grand-total {
  364. padding: 10rpx 30rpx;
  365. background-color: #ECF2FF;
  366. font-size: 26rpx;
  367. font-family: PingFang SC, PingFang SC-Regular;
  368. font-weight: 400;
  369. color: #FA6138;
  370. border-radius: 40rpx;
  371. }
  372. .progress-box {
  373. width: 100%;
  374. height: 28rpx;
  375. background: #e6e6e6;
  376. border-radius: 14rpx;
  377. margin-top: 24rpx;
  378. .progress-line {
  379. height: 100%;
  380. border-radius: 14rpx;
  381. background-color: #FA6138;
  382. position: relative;
  383. .progress-icon {
  384. position: absolute;
  385. right: 0;
  386. top: 50%;
  387. width: 41rpx;
  388. height: 41rpx;
  389. background-color: #febdf7;
  390. border-radius: 50%;
  391. transform: translate(50%, -50%);
  392. .progress-img {
  393. width: 100%;
  394. height: 100%;
  395. border-radius: 50%;
  396. }
  397. }
  398. }
  399. }
  400. .popularize-btn {
  401. width: 570rpx;
  402. height: 80rpx;
  403. background: #FA6138;
  404. border-radius: 40rpx;
  405. font-size: 28rpx;
  406. font-family: PingFang SC, PingFang SC-Regular;
  407. font-weight: 400;
  408. text-align: center;
  409. color: #ffffff;
  410. line-height: 80rpx;
  411. margin: 45rpx auto 0;
  412. }
  413. .popularize-hint {
  414. width: 100%;
  415. margin-top: 30rpx;
  416. font-size: 26rpx;
  417. font-family: PingFang SC, PingFang SC-Regular;
  418. font-weight: 400;
  419. color: #666666;
  420. }
  421. }
  422. .other {
  423. margin-top: 30rpx;
  424. background-color: #ffffff;
  425. padding: 38rpx 28rpx 37rpx 28rpx;
  426. border-radius: 20rpx;
  427. box-shadow: 0 0 40rpx rgb(250, 250, 250);
  428. .other-top {
  429. display: flex;
  430. padding-bottom: 18rpx;
  431. align-items: center;
  432. margin-bottom: 32rpx;
  433. border-bottom: 1rpx solid #e6e6e6;
  434. .left {
  435. flex: 1;
  436. font-size: 30rpx;
  437. font-weight: 700;
  438. color: #1A1A1A;
  439. line-height: 30rpx;
  440. }
  441. }
  442. .option {
  443. display: flex;
  444. justify-content: space-between;
  445. &:nth-child(n + 1) {
  446. margin-top: 32rpx;
  447. }
  448. // flex-wrap: wrap;
  449. .list {
  450. display: flex;
  451. flex-direction: column;
  452. justify-content: center;
  453. align-items: center;
  454. .my-icon {
  455. width: 81rpx;
  456. height: 81rpx;
  457. }
  458. .name-one {
  459. padding-top: 14rpx;
  460. font-size: 26rpx;
  461. font-family: PingFang SC, PingFang SC-Regular;
  462. font-weight: 400;
  463. text-align: center;
  464. color: #1a1a1a;
  465. }
  466. }
  467. }
  468. }
  469. }
  470. </style>