mygs.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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/gssy.png" mode=""></image></view>
  10. <view class="money-box">
  11. <view class="money">{{ userInfo.profit }}</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. }
  252. .order-item {
  253. display: flex;
  254. flex-direction: column;
  255. background: #fff;
  256. margin-top: 16rpx;
  257. .i-top {
  258. display: flex;
  259. align-items: center;
  260. height: 80rpx;
  261. font-size: $font-base;
  262. color: $font-color-dark;
  263. position: relative;
  264. padding: 0 30rpx;
  265. .time {
  266. flex: 1;
  267. }
  268. .state {
  269. color: $base-color;
  270. }
  271. .del-btn {
  272. padding: 10rpx 0 10rpx 36rpx;
  273. font-size: $font-lg;
  274. color: $font-color-light;
  275. position: relative;
  276. &:after {
  277. content: '';
  278. width: 0;
  279. height: 30rpx;
  280. border-left: 1px solid $border-color-dark;
  281. position: absolute;
  282. left: 20rpx;
  283. top: 50%;
  284. transform: translateY(-50%);
  285. }
  286. }
  287. }
  288. /* 多条商品 */
  289. .goods-box {
  290. height: 160rpx;
  291. padding: 20rpx 0;
  292. white-space: nowrap;
  293. .goods-item {
  294. width: 120rpx;
  295. height: 120rpx;
  296. display: inline-block;
  297. margin-right: 24rpx;
  298. }
  299. .goods-img {
  300. display: block;
  301. width: 100%;
  302. height: 100%;
  303. }
  304. }
  305. /* 单条商品 */
  306. .goods-box-single {
  307. display: flex;
  308. padding: 20rpx 30rpx;
  309. background: #f7f7f7;
  310. .goods-img {
  311. display: block;
  312. width: 120rpx;
  313. height: 120rpx;
  314. }
  315. .right {
  316. flex: 1;
  317. display: flex;
  318. flex-direction: column;
  319. padding: 0 0 0 24rpx;
  320. overflow: hidden;
  321. .row {
  322. margin-top: 10rpx;
  323. }
  324. .row_title {
  325. padding: 5rpx 10rpx;
  326. background-color: #dddddd;
  327. border-radius: 10rpx;
  328. font-size: 22rpx;
  329. color: #ffffff;
  330. }
  331. .title {
  332. font-size: $font-base + 2rpx;
  333. color: $font-color-dark;
  334. line-height: 1;
  335. width: 80%;
  336. }
  337. .attr-box {
  338. display: flex;
  339. justify-content: flex-end;
  340. font-size: $font-sm + 2rpx;
  341. color: $font-color-light;
  342. }
  343. .price {
  344. display: inline;
  345. font-size: $font-base + 2rpx;
  346. color: $font-color-dark;
  347. &:before {
  348. content: '¥';
  349. font-size: $font-sm;
  350. }
  351. }
  352. }
  353. }
  354. .buy-box {
  355. height: 84rpx;
  356. padding: 0 22rpx;
  357. background-color: #ffffff;
  358. .buy-info {
  359. height: 100%;
  360. display: flex;
  361. align-items: center;
  362. .font {
  363. font-size: 32rpx;
  364. font-family: PingFang SC;
  365. font-weight: 500;
  366. color: #333333;
  367. }
  368. .avter {
  369. margin-left: 10rpx;
  370. width: 46rpx;
  371. height: 46rpx;
  372. border-radius: 50%;
  373. }
  374. .buy-name {
  375. margin-left: 10rpx;
  376. font-size: 32rpx;
  377. font-family: PingFang SC;
  378. font-weight: bold;
  379. color: #333333;
  380. }
  381. .phone {
  382. margin-left: 12rpx;
  383. font-size: 24rpx;
  384. font-family: PingFang SC;
  385. font-weight: 500;
  386. color: #999999;
  387. }
  388. }
  389. }
  390. .upimg {
  391. padding-left: 20rpx;
  392. padding-top: 10rpx;
  393. padding-bottom: 10rpx;
  394. display: flex;
  395. .up-tit {
  396. display: inline-block;
  397. font-size: 26rpx;
  398. font-family: PingFang SC;
  399. font-weight: 500;
  400. color: #6d7c88;
  401. }
  402. .img-wrap {
  403. width: 153rpx;
  404. height: 152rpx;
  405. border-radius: 20rpx;
  406. image {
  407. border-radius: 20rpx;
  408. width: 153rpx;
  409. height: 152rpx;
  410. background-color: #ccc;
  411. }
  412. }
  413. }
  414. .price-box {
  415. display: flex;
  416. justify-content: flex-end;
  417. align-items: baseline;
  418. padding: 20rpx 30rpx;
  419. font-size: $font-sm + 2rpx;
  420. color: $font-color-light;
  421. .num {
  422. margin: 0 8rpx;
  423. color: $font-color-dark;
  424. }
  425. .price {
  426. font-size: $font-lg;
  427. color: $font-color-dark;
  428. &:before {
  429. content: '¥';
  430. font-size: $font-sm;
  431. margin: 0 2rpx 0 8rpx;
  432. }
  433. }
  434. }
  435. .action-box {
  436. padding: 0 30rpx;
  437. display: flex;
  438. justify-content: flex-end;
  439. align-items: center;
  440. height: 100rpx;
  441. position: relative;
  442. }
  443. .refuse {
  444. margin: 0;
  445. padding: 0;
  446. width: 160rpx;
  447. height: 60rpx;
  448. border: 2rpx solid #ebebeb;
  449. border-radius: 28rpx;
  450. text-align: center;
  451. line-height: 60rpx;
  452. font-size: 26rpx;
  453. font-family: PingFang SC;
  454. font-weight: 500;
  455. color: #999999;
  456. &:after {
  457. border-radius: 100px;
  458. }
  459. &.recom {
  460. color: #999999;
  461. &:after {
  462. border-color: #999999;
  463. }
  464. }
  465. }
  466. .action-btn {
  467. width: 160rpx;
  468. height: 60rpx;
  469. margin: 0;
  470. margin-left: 24rpx;
  471. padding: 0;
  472. text-align: center;
  473. line-height: 60rpx;
  474. font-size: $font-sm + 2rpx;
  475. color: $font-color-dark;
  476. background: #fff;
  477. border-radius: 100px;
  478. border: 2rpx solid #fd3b39;
  479. border-radius: 28px;
  480. &:after {
  481. border-radius: 100px;
  482. }
  483. &.recom {
  484. color: $base-color;
  485. &:after {
  486. border-color: $base-color;
  487. }
  488. }
  489. &.evaluate {
  490. color: $color-yellow;
  491. &:after {
  492. border-color: $color-yellow;
  493. }
  494. }
  495. }
  496. }
  497. </style>