mygs.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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">
  7. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  8. </view>
  9. <view class="header">我的奖金</view>
  10. </view>
  11. <view class="content-bg">
  12. <image src="../../static/img/myfans.png" mode=""></image>
  13. </view>
  14. <view class="money-box">
  15. <view class="money">{{ userInfo.brokerage_price || 0 }}</view>
  16. <view>当前余额</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. <navigator url="./yjchange">
  42. <view class="action-btn">佣金转账</view>
  43. </navigator>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. seller
  49. } from '@/api/order.js';
  50. import {
  51. getMoneyStyle
  52. } from '@/utils/rocessor.js';
  53. import {
  54. mapState,
  55. mapMutations
  56. } from 'vuex';
  57. import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
  58. import empty from '@/uview-ui/components/u-empty/u-empty.vue';
  59. export default {
  60. filters: {
  61. getMoneyStyle
  62. },
  63. computed: {
  64. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  65. },
  66. components: {
  67. empty,
  68. uniLoadMore
  69. },
  70. data() {
  71. return {
  72. loadingType: 'more',
  73. orderList: [],
  74. page: 1, //当前页数
  75. limit: 10 //每次信息条数
  76. };
  77. },
  78. filters: {
  79. moneyNum(value) {
  80. return +value;
  81. }
  82. },
  83. onShow() {
  84. this.loadData();
  85. },
  86. methods: {
  87. // 转换金额为数字
  88. moneyNum(value) {
  89. return +value;
  90. },
  91. // 页面跳转
  92. navto(e) {
  93. uni.navigateTo({
  94. url: e
  95. });
  96. },
  97. // 点击返回 我的页面
  98. toBack() {
  99. uni.reLaunch({
  100. url:'/pages/user/user'
  101. })
  102. },
  103. //获取收入支出信息
  104. async loadData(source) {
  105. let obj = this;
  106. seller({
  107. type: 3,
  108. page: obj.page,
  109. limit: obj.limit
  110. })
  111. .then(({
  112. data
  113. }) => {
  114. let arr = data.map(e => {
  115. e.stateTip = '已完成';
  116. e.stateTipColor = '#909399';
  117. return e;
  118. });
  119. obj.orderList = obj.orderList.concat(arr);
  120. // console.log(navItem.orderList);
  121. obj.page++;
  122. if (obj.limit == data.length) {
  123. //判断是否还有数据, 有改为 more, 没有改为noMore
  124. obj.loadingType = 'more';
  125. return;
  126. } else {
  127. //判断是否还有数据, 有改为 more, 没有改为noMore
  128. obj.loadingType = 'noMore';
  129. }
  130. uni.hideLoading();
  131. })
  132. .catch(e => {
  133. console.log(e);
  134. });
  135. },
  136. //swiper 切换
  137. changeTab(e) {
  138. this.tabCurrentIndex = e.target.current;
  139. this.loadData('tabChange');
  140. },
  141. //顶部tab点击
  142. tabClick(index) {
  143. this.tabCurrentIndex = index;
  144. }
  145. }
  146. };
  147. </script>
  148. <style lang="scss">
  149. page {
  150. background: #f1f1f1;
  151. height: 100%;
  152. }
  153. .status_bar {
  154. height: var(--status-bar-height);
  155. width: 100%;
  156. }
  157. .content-money {
  158. position: relative;
  159. height: 400rpx;
  160. .content-bg {
  161. position: absolute;
  162. top: 0;
  163. left: 0;
  164. right: 0;
  165. width: 750rpx;
  166. height: 400rpx;
  167. image {
  168. width: 100%;
  169. height: 100%;
  170. }
  171. }
  172. .body-title {
  173. height: 80rpx;
  174. text-align: center;
  175. font-size: 35rpx;
  176. position: relative;
  177. .header {
  178. position: absolute;
  179. left: 0;
  180. top: 0;
  181. width: 100%;
  182. font-size: 36rpx;
  183. font-family: PingFang SC;
  184. font-weight: bold;
  185. color: #fffeff;
  186. height: 80rpx;
  187. font-size: 36rpx;
  188. font-weight: 700;
  189. z-index: 9;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. }
  194. .goback-box {
  195. position: absolute;
  196. left: 18rpx;
  197. top: 0;
  198. height: 80rpx;
  199. display: flex;
  200. align-items: center;
  201. }
  202. .goback {
  203. z-index: 100;
  204. width: 34rpx;
  205. height: 34rpx;
  206. }
  207. }
  208. }
  209. .money-box {
  210. position: relative;
  211. z-index: 2;
  212. padding-top: 90rpx;
  213. color: #ffffff;
  214. text-align: center;
  215. .money {
  216. font-size: 72rpx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #ffffff;
  220. }
  221. .text {
  222. font-size: 30rpx;
  223. }
  224. }
  225. .list-scroll-content {
  226. height: calc(100% - 175px);
  227. padding-top: 30rpx;
  228. }
  229. .order-item {
  230. display: flex;
  231. flex-direction: column;
  232. border-radius: 20rpx;
  233. background: #fff;
  234. margin: 0rpx 30rpx 30rpx 30rpx;
  235. .i-top {
  236. display: flex;
  237. align-items: center;
  238. height: 80rpx;
  239. font-size: $font-base;
  240. color: $font-color-dark;
  241. position: relative;
  242. padding: 0 30rpx;
  243. .time {
  244. flex: 1;
  245. }
  246. .state {
  247. color: $base-color;
  248. }
  249. }
  250. /* 单条商品 */
  251. .goods-box-single {
  252. display: flex;
  253. padding: 20rpx 30rpx;
  254. // background: #f7f7f7;
  255. .goods-img {
  256. display: block;
  257. width: 120rpx;
  258. height: 120rpx;
  259. }
  260. .right {
  261. flex: 1;
  262. display: flex;
  263. flex-direction: column;
  264. padding: 0 0 0 24rpx;
  265. overflow: hidden;
  266. .row {
  267. margin-top: 10rpx;
  268. }
  269. .title {
  270. font-size: $font-base + 2rpx;
  271. color: $font-color-dark;
  272. line-height: 1;
  273. width: 80%;
  274. }
  275. .attr-box {
  276. display: flex;
  277. justify-content: flex-end;
  278. font-size: $font-sm + 2rpx;
  279. color: $font-color-light;
  280. }
  281. .price {
  282. display: inline;
  283. font-size: $font-base + 2rpx;
  284. color: $font-color-dark;
  285. &:before {
  286. content: '¥';
  287. font-size: $font-sm;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. .action-btn {
  294. position: fixed;
  295. bottom: 0rpx;
  296. left: 0rpx;
  297. width: 750rpx;
  298. text-align: center;
  299. font-size: $font-lg;
  300. color:#E6C79D;
  301. background: #fff;
  302. border: 2rpx solid #E6C79D;
  303. padding: 20rpx;
  304. }
  305. </style>