123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <template>
- <view class="content">
- <view class="content-money">
- <view class="status_bar"><!-- 这里是状态栏 --></view>
- <view class="body-title">
- <view class="goback-box" @click="toBack">
- <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
- </view>
- <view class="header">我的奖金</view>
- </view>
- <view class="content-bg">
- <image src="../../static/img/myfans.png" mode=""></image>
- </view>
- <view class="money-box">
- <view class="money">{{ userInfo.brokerage_price || 0 }}</view>
- <view>当前余额</view>
- </view>
- </view>
- <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
- <!-- 空白页 -->
- <empty v-if="orderList.length === 0"></empty>
- <!-- 订单列表 -->
- <view v-else>
- <view v-for="(item, index) in orderList" :key="index" class="order-item">
- <view class="i-top b-b">
- <text class="time">{{ item.order_id }}</text>
- <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
- </view>
- <view class="goods-box-single">
- <image class="goods-img" :src="item.image" mode="aspectFill"></image>
- <view class="right">
- <text class="title clamp">{{ item.name }}</text>
- <text class="attr-box">x1</text>
- <text class="price">{{ moneyNum(item.price) }}</text>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </scroll-view>
- <navigator url="./yjchange">
- <view class="action-btn">佣金转账</view>
- </navigator>
- </view>
- </template>
- <script>
- import {
- seller
- } from '@/api/order.js';
- import {
- getMoneyStyle
- } from '@/utils/rocessor.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import uniLoadMore from '@/uview-ui/components/u-loadmore/u-loadmore.vue';
- import empty from '@/uview-ui/components/u-empty/u-empty.vue';
- export default {
- filters: {
- getMoneyStyle
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- };
- },
- filters: {
- moneyNum(value) {
- return +value;
- }
- },
- onShow() {
- this.loadData();
- },
- methods: {
- // 转换金额为数字
- moneyNum(value) {
- return +value;
- },
- // 页面跳转
- navto(e) {
- uni.navigateTo({
- url: e
- });
- },
- // 点击返回 我的页面
- toBack() {
- uni.reLaunch({
- url:'/pages/user/user'
- })
- },
- //获取收入支出信息
- async loadData(source) {
- let obj = this;
- seller({
- type: 3,
- page: obj.page,
- limit: obj.limit
- })
- .then(({
- data
- }) => {
- let arr = data.map(e => {
- e.stateTip = '已完成';
- e.stateTipColor = '#909399';
- return e;
- });
- obj.orderList = obj.orderList.concat(arr);
- // console.log(navItem.orderList);
- obj.page++;
- if (obj.limit == data.length) {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- obj.loadingType = 'more';
- return;
- } else {
- //判断是否还有数据, 有改为 more, 没有改为noMore
- obj.loadingType = 'noMore';
- }
- uni.hideLoading();
- })
- .catch(e => {
- console.log(e);
- });
- },
- //swiper 切换
- changeTab(e) {
- this.tabCurrentIndex = e.target.current;
- this.loadData('tabChange');
- },
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: #f1f1f1;
- height: 100%;
- }
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- }
- .content-money {
- position: relative;
- height: 400rpx;
- .content-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 750rpx;
- height: 400rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .body-title {
- height: 80rpx;
- text-align: center;
- font-size: 35rpx;
- position: relative;
- .header {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fffeff;
- height: 80rpx;
- font-size: 36rpx;
- font-weight: 700;
- z-index: 9;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .goback-box {
- position: absolute;
- left: 18rpx;
- top: 0;
- height: 80rpx;
- display: flex;
- align-items: center;
- }
- .goback {
- z-index: 100;
- width: 34rpx;
- height: 34rpx;
- }
- }
- }
- .money-box {
- position: relative;
- z-index: 2;
- padding-top: 90rpx;
- color: #ffffff;
- text-align: center;
- .money {
- font-size: 72rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- .text {
- font-size: 30rpx;
- }
- }
- .list-scroll-content {
- height: calc(100% - 175px);
- padding-top: 30rpx;
- }
- .order-item {
- display: flex;
- flex-direction: column;
- border-radius: 20rpx;
- background: #fff;
- margin: 0rpx 30rpx 30rpx 30rpx;
- .i-top {
- display: flex;
- align-items: center;
- height: 80rpx;
- font-size: $font-base;
- color: $font-color-dark;
- position: relative;
- padding: 0 30rpx;
- .time {
- flex: 1;
- }
- .state {
- color: $base-color;
- }
- }
- /* 单条商品 */
- .goods-box-single {
- display: flex;
- padding: 20rpx 30rpx;
- // background: #f7f7f7;
- .goods-img {
- display: block;
- width: 120rpx;
- height: 120rpx;
- }
- .right {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding: 0 0 0 24rpx;
- overflow: hidden;
- .row {
- margin-top: 10rpx;
- }
- .title {
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- line-height: 1;
- width: 80%;
- }
- .attr-box {
- display: flex;
- justify-content: flex-end;
- font-size: $font-sm + 2rpx;
- color: $font-color-light;
- }
- .price {
- display: inline;
- font-size: $font-base + 2rpx;
- color: $font-color-dark;
- &:before {
- content: '¥';
- font-size: $font-sm;
- }
- }
- }
- }
- }
- .action-btn {
- position: fixed;
- bottom: 0rpx;
- left: 0rpx;
- width: 750rpx;
- text-align: center;
- font-size: $font-lg;
- color:#E6C79D;
- background: #fff;
- border: 2rpx solid #E6C79D;
- padding: 20rpx;
- }
- </style>
|