mygs.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="status_bar"><!-- 这里是状态栏 --></view>
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  7. <view class="header">我的奖金</view>
  8. </view>
  9. <view class="content-bg"><image src="../../static/img/use-i.png" mode=""></image></view>
  10. <view class="money-box">
  11. <view class="money">{{ userInfo.brokeage_price || 0 }}</view>
  12. <view>当前余额</view>
  13. <view class="gn flex">
  14. <view class="ye">转成余额</view>
  15. <view class="ye">佣金提现</view>
  16. </view>
  17. </view>
  18. </view>
  19. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  20. <!-- 空白页 -->
  21. <empty v-if="orderList.length === 0"></empty>
  22. <!-- 订单列表 -->
  23. <view v-else>
  24. <view v-for="(item, index) in orderList" :key="index" class="order-item">
  25. <view class="i-top b-b">
  26. <text class="time">{{ item.order_id }}</text>
  27. <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
  28. </view>
  29. <view class="goods-box-single">
  30. <image class="goods-img" :src="item.image" mode="aspectFill"></image>
  31. <view class="right">
  32. <text class="title clamp">{{ item.name }}</text>
  33. <text class="attr-box">x1</text>
  34. <text class="price">{{ moneyNum(item.price) }}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <uni-load-more :status="loadingType"></uni-load-more>
  39. </view>
  40. </scroll-view>
  41. </view>
  42. </template>
  43. <script>
  44. import { seller } from '@/api/order.js';
  45. import { getMoneyStyle } from '@/utils/rocessor.js';
  46. import { mapState, mapMutations } from 'vuex';
  47. import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
  48. import empty from '@/uview-ui/components/u-empty/u-empty.vue';
  49. export default {
  50. filters: {
  51. getMoneyStyle
  52. },
  53. computed: {
  54. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  55. },
  56. components: {
  57. empty,
  58. uniLoadMore
  59. },
  60. data() {
  61. return {
  62. loadingType: 'more',
  63. orderList: [],
  64. page: 1, //当前页数
  65. limit: 10 //每次信息条数
  66. };
  67. },
  68. filters: {
  69. moneyNum(value) {
  70. return +value;
  71. }
  72. },
  73. onShow() {
  74. this.loadData();
  75. },
  76. methods: {
  77. // 转换金额为数字
  78. moneyNum(value) {
  79. return +value;
  80. },
  81. // 页面跳转
  82. navto(e) {
  83. uni.navigateTo({
  84. url: e
  85. });
  86. },
  87. // 点击返回 我的页面
  88. toBack() {
  89. uni.navigateBack({});
  90. },
  91. //获取收入支出信息
  92. async loadData(source) {
  93. let obj = this;
  94. seller({
  95. type: 3,
  96. page: obj.page,
  97. limit: obj.limit
  98. })
  99. .then(({ data }) => {
  100. let arr = data.map(e => {
  101. e.stateTip = '已完成';
  102. e.stateTipColor = '#909399';
  103. return e;
  104. });
  105. obj.orderList = obj.orderList.concat(arr);
  106. // console.log(navItem.orderList);
  107. obj.page++;
  108. if (obj.limit == data.length) {
  109. //判断是否还有数据, 有改为 more, 没有改为noMore
  110. obj.loadingType = 'more';
  111. return;
  112. } else {
  113. //判断是否还有数据, 有改为 more, 没有改为noMore
  114. obj.loadingType = 'noMore';
  115. }
  116. uni.hideLoading();
  117. })
  118. .catch(e => {
  119. console.log(e);
  120. });
  121. },
  122. //swiper 切换
  123. changeTab(e) {
  124. this.tabCurrentIndex = e.target.current;
  125. this.loadData('tabChange');
  126. },
  127. //顶部tab点击
  128. tabClick(index) {
  129. this.tabCurrentIndex = index;
  130. }
  131. }
  132. };
  133. </script>
  134. <style lang="scss">
  135. page {
  136. background: #f1f1f1;
  137. height: 100%;
  138. }
  139. .status_bar {
  140. height: var(--status-bar-height);
  141. width: 100%;
  142. }
  143. .content-money {
  144. position: relative;
  145. height: 400rpx;
  146. .content-bg {
  147. position: absolute;
  148. top: 0;
  149. left: 0;
  150. right: 0;
  151. width: 750rpx;
  152. height: 400rpx;
  153. image {
  154. width: 100%;
  155. height: 100%;
  156. }
  157. }
  158. .body-title {
  159. height: 80rpx;
  160. text-align: center;
  161. font-size: 35rpx;
  162. position: relative;
  163. .header {
  164. position: absolute;
  165. left: 0;
  166. top: 0;
  167. width: 100%;
  168. font-size: 36rpx;
  169. font-family: PingFang SC;
  170. font-weight: bold;
  171. color: #01A6A8;
  172. height: 80rpx;
  173. font-size: 36rpx;
  174. font-weight: 700;
  175. z-index: 9;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. }
  180. .goback-box {
  181. position: absolute;
  182. left: 18rpx;
  183. top: 0;
  184. height: 80rpx;
  185. display: flex;
  186. align-items: center;
  187. }
  188. .goback {
  189. z-index: 100;
  190. width: 34rpx;
  191. height: 34rpx;
  192. }
  193. }
  194. }
  195. .info-box {
  196. width: 670rpx;
  197. height: 186rpx;
  198. background: #ffffff;
  199. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  200. border-radius: 20rpx;
  201. margin: -100rpx auto 0;
  202. position: relative;
  203. z-index: 2;
  204. .info-item {
  205. width: 50%;
  206. display: flex;
  207. flex-direction: column;
  208. align-items: center;
  209. line-height: 1;
  210. .info-font {
  211. font-size: 30rpx;
  212. font-family: PingFang SC;
  213. font-weight: bold;
  214. color: #999999;
  215. }
  216. .info-num {
  217. margin-top: 30rpx;
  218. font-size: 30rpx;
  219. font-family: PingFang SC;
  220. font-weight: bold;
  221. color: #181818;
  222. }
  223. }
  224. .shu {
  225. width: 2rpx;
  226. height: 74rpx;
  227. background: #dcdfe6;
  228. }
  229. }
  230. .money-box {
  231. position: relative;
  232. z-index: 2;
  233. padding-top: 90rpx;
  234. color: #01A6A8;
  235. text-align: center;
  236. .money {
  237. font-size: 72rpx;
  238. font-family: PingFang SC;
  239. font-weight: bold;
  240. color: #01A6A8;
  241. }
  242. .ye {
  243. margin: 20rpx 50rpx;
  244. }
  245. }
  246. .list-scroll-content {
  247. height: calc(100% - 175px);
  248. padding-top: 30rpx;
  249. }
  250. .order-item {
  251. display: flex;
  252. flex-direction: column;
  253. border-radius: 20rpx;
  254. background: #fff;
  255. margin: 0rpx 30rpx 30rpx 30rpx;
  256. .i-top {
  257. display: flex;
  258. align-items: center;
  259. height: 80rpx;
  260. font-size: $font-base;
  261. color: $font-color-dark;
  262. position: relative;
  263. padding: 0 30rpx;
  264. .time {
  265. flex: 1;
  266. }
  267. .state {
  268. color: $base-color;
  269. }
  270. .del-btn {
  271. padding: 10rpx 0 10rpx 36rpx;
  272. font-size: $font-lg;
  273. color: $font-color-light;
  274. position: relative;
  275. &:after {
  276. content: '';
  277. width: 0;
  278. height: 30rpx;
  279. border-left: 1px solid $border-color-dark;
  280. position: absolute;
  281. left: 20rpx;
  282. top: 50%;
  283. transform: translateY(-50%);
  284. }
  285. }
  286. }
  287. /* 多条商品 */
  288. .goods-box {
  289. height: 160rpx;
  290. padding: 20rpx 0;
  291. white-space: nowrap;
  292. .goods-item {
  293. width: 120rpx;
  294. height: 120rpx;
  295. display: inline-block;
  296. margin-right: 24rpx;
  297. }
  298. .goods-img {
  299. display: block;
  300. width: 100%;
  301. height: 100%;
  302. }
  303. }
  304. /* 单条商品 */
  305. .goods-box-single {
  306. display: flex;
  307. padding: 20rpx 30rpx;
  308. // background: #f7f7f7;
  309. .goods-img {
  310. display: block;
  311. width: 120rpx;
  312. height: 120rpx;
  313. }
  314. .right {
  315. flex: 1;
  316. display: flex;
  317. flex-direction: column;
  318. padding: 0 0 0 24rpx;
  319. overflow: hidden;
  320. .row {
  321. margin-top: 10rpx;
  322. }
  323. .row_title {
  324. padding: 5rpx 10rpx;
  325. background-color: #dddddd;
  326. border-radius: 10rpx;
  327. font-size: 22rpx;
  328. color: #ffffff;
  329. }
  330. .title {
  331. font-size: $font-base + 2rpx;
  332. color: $font-color-dark;
  333. line-height: 1;
  334. width: 80%;
  335. }
  336. .attr-box {
  337. display: flex;
  338. justify-content: flex-end;
  339. font-size: $font-sm + 2rpx;
  340. color: $font-color-light;
  341. }
  342. .price {
  343. display: inline;
  344. font-size: $font-base + 2rpx;
  345. color: $font-color-dark;
  346. &:before {
  347. content: '¥';
  348. font-size: $font-sm;
  349. }
  350. }
  351. }
  352. }
  353. .buy-box {
  354. height: 84rpx;
  355. padding: 0 22rpx;
  356. background-color: #ffffff;
  357. .buy-info {
  358. height: 100%;
  359. display: flex;
  360. align-items: center;
  361. .font {
  362. font-size: 32rpx;
  363. font-family: PingFang SC;
  364. font-weight: 500;
  365. color: #333333;
  366. }
  367. .avter {
  368. margin-left: 10rpx;
  369. width: 46rpx;
  370. height: 46rpx;
  371. border-radius: 50%;
  372. }
  373. .buy-name {
  374. margin-left: 10rpx;
  375. font-size: 32rpx;
  376. font-family: PingFang SC;
  377. font-weight: bold;
  378. color: #333333;
  379. }
  380. .phone {
  381. margin-left: 12rpx;
  382. font-size: 24rpx;
  383. font-family: PingFang SC;
  384. font-weight: 500;
  385. color: #999999;
  386. }
  387. }
  388. }
  389. .upimg {
  390. padding-left: 20rpx;
  391. padding-top: 10rpx;
  392. padding-bottom: 10rpx;
  393. display: flex;
  394. .up-tit {
  395. display: inline-block;
  396. font-size: 26rpx;
  397. font-family: PingFang SC;
  398. font-weight: 500;
  399. color: #6d7c88;
  400. }
  401. .img-wrap {
  402. width: 153rpx;
  403. height: 152rpx;
  404. border-radius: 20rpx;
  405. image {
  406. border-radius: 20rpx;
  407. width: 153rpx;
  408. height: 152rpx;
  409. background-color: #ccc;
  410. }
  411. }
  412. }
  413. .price-box {
  414. display: flex;
  415. justify-content: flex-end;
  416. align-items: baseline;
  417. padding: 20rpx 30rpx;
  418. font-size: $font-sm + 2rpx;
  419. color: $font-color-light;
  420. .num {
  421. margin: 0 8rpx;
  422. color: $font-color-dark;
  423. }
  424. .price {
  425. font-size: $font-lg;
  426. color: $font-color-dark;
  427. &:before {
  428. content: '¥';
  429. font-size: $font-sm;
  430. margin: 0 2rpx 0 8rpx;
  431. }
  432. }
  433. }
  434. .action-box {
  435. padding: 0 30rpx;
  436. display: flex;
  437. justify-content: flex-end;
  438. align-items: center;
  439. height: 100rpx;
  440. position: relative;
  441. }
  442. .refuse {
  443. margin: 0;
  444. padding: 0;
  445. width: 160rpx;
  446. height: 60rpx;
  447. border: 2rpx solid #ebebeb;
  448. border-radius: 28rpx;
  449. text-align: center;
  450. line-height: 60rpx;
  451. font-size: 26rpx;
  452. font-family: PingFang SC;
  453. font-weight: 500;
  454. color: #999999;
  455. &:after {
  456. border-radius: 100px;
  457. }
  458. &.recom {
  459. color: #999999;
  460. &:after {
  461. border-color: #999999;
  462. }
  463. }
  464. }
  465. .action-btn {
  466. width: 160rpx;
  467. height: 60rpx;
  468. margin: 0;
  469. margin-left: 24rpx;
  470. padding: 0;
  471. text-align: center;
  472. line-height: 60rpx;
  473. font-size: $font-sm + 2rpx;
  474. color: $font-color-dark;
  475. background: #fff;
  476. border-radius: 100px;
  477. border: 2rpx solid #fd3b39;
  478. border-radius: 28px;
  479. &:after {
  480. border-radius: 100px;
  481. }
  482. &.recom {
  483. color: $base-color;
  484. &:after {
  485. border-color: $base-color;
  486. }
  487. }
  488. &.evaluate {
  489. color: $color-yellow;
  490. &:after {
  491. border-color: $color-yellow;
  492. }
  493. }
  494. }
  495. }
  496. </style>