mygs.vue 9.7 KB

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