mygs.vue 9.8 KB

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