extension.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <view class="content">
  3. <view class="status_bar"><!-- 这里是状态栏 --></view>
  4. <view class="content-money">
  5. <view class="money-box">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
  7. <view class="header">我的推广</view>
  8. <image class="tuiguang_bg" src="../../static/img/share-bg.png"></image>
  9. <!-- <view class="money_img"><image :src="list.avatar || img"></image></view> -->
  10. <view class="money-frame">
  11. <!-- <view class="money_name">我的推广</view> -->
  12. <view class="money_num">
  13. {{ team || '0' }}
  14. <text class="money_ren">人</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="main flex">
  20. <view class="main-box flex">
  21. <view class="item">
  22. <view class="num">{{myPerformance || 0}}</view>
  23. <view class="font ">我的历史业绩</view>
  24. </view>
  25. <view class="item bottom">
  26. <view class="num">{{plotPerformance || 0}}</view>
  27. <view class="font ">历史小区业绩</view>
  28. </view>
  29. </view>
  30. <view class="main-box flex">
  31. <view class="item">
  32. <view class="num">{{push || 0}}</view>
  33. <view class="font ">直推人数</view>
  34. </view>
  35. <view class="item bottom">
  36. <view class="num">{{team || 0}}</view>
  37. <view class="font ">团队人数</view>
  38. </view>
  39. </view>
  40. <view class="main-box flex">
  41. <view class="item">
  42. <view class="num">{{achievement_month || 0}}</view>
  43. <view class="font ">本月新增业绩</view>
  44. </view>
  45. <view class="item bottom">
  46. <view class="num">{{small_achivement_month || 0}}</view>
  47. <view class="font ">本月新增小区业绩</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="box">
  52. <view class="box-item flex">
  53. <view class="box-left">昨日拼购奖励</view>
  54. <view class="box-right">{{yesterday.pink*1 || 0}}USDT</view>
  55. </view>
  56. <view class="box-item flex">
  57. <view class="box-left">昨日分享奖励</view>
  58. <view class="box-right">{{yesterday.recommend || 0}}USDT</view>
  59. </view>
  60. <view class="box-item flex">
  61. <view class="box-left">昨日团队奖励</view>
  62. <view class="box-right">{{yesterday.group || 0}}USDT</view>
  63. </view>
  64. </view>
  65. <view class="box">
  66. <view class="box-item flex">
  67. <view class="box-left">累计拼购奖励</view>
  68. <view class="box-right">{{all.pink*1 || 0}}USDT</view>
  69. </view>
  70. <view class="box-item flex">
  71. <view class="box-left">累计分享奖励</view>
  72. <view class="box-right">{{all.recommend || 0}}USDT</view>
  73. </view>
  74. <view class="box-item flex">
  75. <view class="box-left">累计团队奖励</view>
  76. <view class="box-right">{{all.group || 0}}USDT</view>
  77. </view>
  78. </view>
  79. <view class="liebiao flex" @click="navto('/pages/user/extensionList')">
  80. <view class="left flex">
  81. <image src="../../static/img/myTeam.png" mode=""></image>
  82. <view class="leibiao-font">推广列表</view>
  83. </view>
  84. <image src="../../static/img/jiantou.png" mode=""></image>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import { spread } from '@/api/finance.js';
  90. import { mapState, mapMutations } from 'vuex';
  91. import { gitExtension } from '@/api/user.js';
  92. export default {
  93. onReady() {
  94. // 初始化获取页面宽度
  95. uni.createSelectorQuery()
  96. .select('.content')
  97. .fields(
  98. {
  99. size: true
  100. },
  101. data => {
  102. // console.log(data);
  103. // console.log(Math.floor((data.width / 750) * 300));
  104. // 保存头部高度
  105. this.maxheight = data.height - Math.floor((data.width / 750) * 470) - 44;
  106. // console.log(this.maxheight);
  107. }
  108. )
  109. .exec();
  110. },
  111. data() {
  112. return {
  113. // 头部图高度
  114. maxheight: '',
  115. myPerformance:'',//我的业绩
  116. plotPerformance:'',//小区业绩
  117. push:'',//直推人数
  118. team:'',//团队人数
  119. achievement_month:'',//本月新增业绩
  120. small_achivement_month:'',// 本月新增小区业绩
  121. all: '', //累计奖励
  122. yesterday:'',//昨日
  123. };
  124. },
  125. onLoad(options) {
  126. this.loadData(); //onload只是在第一次进入页面会刷新数据,从二级页面回来不会重新加载数据
  127. },
  128. onShow() {
  129. //onShow没有参数
  130. this.loadData(); //onshow在每次打开页面都会加载数据,可以用于数据在需要刷新的环境下
  131. },
  132. methods: {
  133. async loadData() {
  134. gitExtension({}).then(({data}) => {
  135. console.log(data)
  136. this.myPerformance = data.achievement;
  137. this.plotPerformance = data.small_achivement;
  138. this.push = data.recommend_num;
  139. this.team = data.group_num;
  140. this.achievement_month = data.achievement_month;
  141. this.small_achivement_month = data.small_achivement_month;
  142. this.all = data.all;
  143. this.yesterday = data.yesterday;
  144. })
  145. },
  146. // 页面跳转
  147. navto(e) {
  148. uni.navigateTo({
  149. url: e
  150. });
  151. },
  152. // 点击返回 我的页面
  153. toBack() {
  154. uni.switchTab({
  155. url: '/pages/user/user'
  156. });
  157. },
  158. }
  159. };
  160. </script>
  161. <style lang="scss">
  162. .status_bar {
  163. height: var(--status-bar-height);
  164. width: 100%;
  165. background: linear-gradient(90deg, #60bab0, #45969b);
  166. }
  167. page {
  168. background: #f8f8f8;
  169. height: 100%;
  170. }
  171. .content-money {
  172. padding-bottom: 30rpx;
  173. background: $page-color-base;
  174. .buttom-box {
  175. position: relative;
  176. background-color: #ffffff;
  177. text-align: center;
  178. margin: 0 30rpx;
  179. padding: 30rpx 0;
  180. border-radius: $border-radius-sm;
  181. margin-top: -80rpx;
  182. .buttom {
  183. font-size: $font-lg;
  184. flex-grow: 1;
  185. .money {
  186. font-weight: bold;
  187. font-size: 32rpx;
  188. color: #ff0000;
  189. }
  190. }
  191. .text {
  192. color: #666666;
  193. }
  194. .interval {
  195. width: 2rpx;
  196. height: 60rpx;
  197. background-color: #eeeeee;
  198. }
  199. .icon {
  200. height: 50rpx;
  201. width: 48rpx;
  202. margin: 0 auto;
  203. .icon-img {
  204. width: 100%;
  205. height: 100%;
  206. }
  207. }
  208. }
  209. }
  210. .money-box {
  211. // background: $base-color;
  212. height: 424rpx;
  213. color: #ffffff;
  214. text-align: center;
  215. font-size: 35rpx;
  216. position: relative;
  217. // padding-top: 60rpx;
  218. .header {
  219. position: absolute;
  220. left: 0;
  221. top: 0;
  222. width: 100%;
  223. height: 80rpx;
  224. font-size: 32rpx;
  225. font-weight: 700;
  226. z-index: 99;
  227. display: flex;
  228. justify-content: center;
  229. align-items: center;
  230. }
  231. .goback-box {
  232. position: absolute;
  233. left: 18rpx;
  234. top: 0;
  235. height: 80rpx;
  236. display: flex;
  237. align-items: center;
  238. }
  239. .goback {
  240. z-index: 100;
  241. width: 34rpx;
  242. height: 34rpx;
  243. }
  244. .tuiguang_bg {
  245. width: 100%;
  246. height: 424rpx;
  247. position: relative;
  248. }
  249. .money_img {
  250. width: 100%;
  251. height: 120rpx;
  252. text-align: center;
  253. padding-top: 50rpx;
  254. padding-bottom: 135rpx;
  255. image {
  256. width: 120rpx;
  257. height: 120rpx;
  258. border: 4rpx solid #fd5f6f;
  259. border-radius: 50%;
  260. }
  261. }
  262. .money-frame {
  263. position: absolute;
  264. top: 0;
  265. width: 100%;
  266. padding-top: 120rpx;
  267. // left: 30rpx;
  268. // height: 460rpx;
  269. // display: flex;
  270. // align-items: flex-start;
  271. // flex-direction: column;
  272. // justify-content: center;
  273. }
  274. .money_name {
  275. width: 100%;
  276. text-align: center;
  277. font-size: 32rpx;
  278. font-family: PingFang SC;
  279. font-weight: bold;
  280. color: #ffffff;
  281. }
  282. .money_num {
  283. font-size: 72rpx;
  284. font-family: PingFang SC;
  285. font-weight: bold;
  286. color: #ffffff;
  287. .money_ren {
  288. font-size: 36rpx;
  289. }
  290. }
  291. }
  292. .navbar {
  293. display: flex;
  294. height: 40px;
  295. padding: 0 5px;
  296. background: #fff;
  297. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  298. position: relative;
  299. z-index: 10;
  300. .nav-item {
  301. flex: 1;
  302. display: flex;
  303. justify-content: center;
  304. align-items: center;
  305. height: 100%;
  306. font-size: 15px;
  307. color: $font-color-dark;
  308. position: relative;
  309. &.current {
  310. color: #ff0000;
  311. &:after {
  312. content: '';
  313. position: absolute;
  314. left: 50%;
  315. bottom: 0;
  316. transform: translateX(-50%);
  317. width: 44px;
  318. height: 0;
  319. border-bottom: 2px solid #ff0000;
  320. }
  321. }
  322. }
  323. }
  324. .main {
  325. position: relative;
  326. z-index: 10;
  327. width: 691rpx;
  328. height: auto;
  329. background: #ffffff;
  330. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  331. border-radius: 20rpx;
  332. margin: -160rpx auto 0;
  333. padding: 40rpx 40rpx;
  334. .main-box {
  335. flex-direction: column;
  336. align-items: center;
  337. .bottom {
  338. margin-top: 20rpx;
  339. }
  340. .item {
  341. display: flex;
  342. flex-direction: column;
  343. align-items: center;
  344. .num {
  345. font-size: 38rpx;
  346. font-family: PingFang SC;
  347. font-weight: bold;
  348. color: #0f253a;
  349. }
  350. .font {
  351. font-size: 24rpx;
  352. font-family: PingFang SC;
  353. font-weight: bold;
  354. color: #6d7c88;
  355. margin-top: 18rpx;
  356. }
  357. }
  358. }
  359. }
  360. .box {
  361. width: 690rpx;
  362. background: #FFFFFF;
  363. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  364. border-radius: 20rpx;
  365. margin: 20rpx auto;
  366. padding: 34rpx;
  367. .box-item:first-child{
  368. margin-top: 0;
  369. }
  370. .box-item {
  371. margin-top: 20rpx;
  372. justify-content: space-between;
  373. align-items: center;
  374. .box-left {
  375. font-size: 26rpx;
  376. font-family: PingFang SC;
  377. font-weight: 500;
  378. color: #6D7C88;
  379. }
  380. .box-right {
  381. font-size: 26rpx;
  382. font-family: PingFang SC;
  383. font-weight: bold;
  384. color: #0F253A;
  385. }
  386. }
  387. }
  388. .liebiao {
  389. width: 692rpx;
  390. background: #FFFFFF;
  391. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  392. border-radius: 20rpx;
  393. padding: 34rpx;
  394. margin: 24rpx auto 0;
  395. align-items: center;
  396. .left {
  397. justify-content: flex-start;
  398. align-items: center;
  399. image {
  400. width: 46rpx;
  401. height: 36rpx;
  402. }
  403. .leibiao-font{
  404. margin-left: 10rpx;
  405. font-size: 32rpx;
  406. font-family: PingFang SC;
  407. font-weight: bold;
  408. color: #333333;
  409. }
  410. }
  411. image {
  412. width: 15rpx;
  413. height: 27rpx;
  414. }
  415. }
  416. </style>