123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558 |
- <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/gssy.png" mode=""></image></view>
- <view class="money-box">
- <view class="money">{{ userInfo.profit }}</view>
- <view>总收益</view>
- </view>
- </view>
- <scroll-view :style="{ height: maxheight }" 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 class="price-box">
- 共
- <text class="num">1</text>
- 件商品 邮费
- <text class="price">0</text>
- 实付款
- <text class="price">{{ moneyNum(item.price) }}</text>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </scroll-view>
- </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 {
- maxheight:'',
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10 //每次信息条数
- };
- },
- filters: {
- moneyNum(value) {
- return +value;
- }
- },
- onReady() {
- const that = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.list-scroll-content').boundingClientRect();
- query.exec(function(res) {
- that.maxheight = resu.windowHeight - res[0].top + 'px';
- });
- },
- fail: res => {}
- });
- },
- onShow() {
- this.loadData();
- },
- methods: {
- // 转换金额为数字
- moneyNum(value) {
- return +value;
- },
- // 页面跳转
- navto(e) {
- uni.navigateTo({
- url: e
- });
- },
- // 点击返回 我的页面
- toBack() {
- uni.navigateBack({});
- },
- //获取收入支出信息
- async loadData(source) {
- let obj = this;
- if (obj.loadingType === 'loading'||obj.loadingType === 'nomore') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- obj.loadingType = 'loading';
- 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;
- }
- }
- }
- .info-box {
- width: 670rpx;
- height: 186rpx;
- background: #ffffff;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- margin: -100rpx auto 0;
- position: relative;
- z-index: 2;
- .info-item {
- width: 50%;
- display: flex;
- flex-direction: column;
- align-items: center;
- line-height: 1;
- .info-font {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #999999;
- }
- .info-num {
- margin-top: 30rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #181818;
- }
- }
- .shu {
- width: 2rpx;
- height: 74rpx;
- background: #dcdfe6;
- }
- }
- .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);
- }
- .order-item {
- display: flex;
- flex-direction: column;
- background: #fff;
- margin-top: 16rpx;
- .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;
- }
- .del-btn {
- padding: 10rpx 0 10rpx 36rpx;
- font-size: $font-lg;
- color: $font-color-light;
- position: relative;
- &:after {
- content: '';
- width: 0;
- height: 30rpx;
- border-left: 1px solid $border-color-dark;
- position: absolute;
- left: 20rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- }
- /* 多条商品 */
- .goods-box {
- height: 160rpx;
- padding: 20rpx 0;
- white-space: nowrap;
- .goods-item {
- width: 120rpx;
- height: 120rpx;
- display: inline-block;
- margin-right: 24rpx;
- }
- .goods-img {
- display: block;
- width: 100%;
- height: 100%;
- }
- }
- /* 单条商品 */
- .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;
- }
- .row_title {
- padding: 5rpx 10rpx;
- background-color: #dddddd;
- border-radius: 10rpx;
- font-size: 22rpx;
- color: #ffffff;
- }
- .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;
- }
- }
- }
- }
- .buy-box {
- height: 84rpx;
- padding: 0 22rpx;
- background-color: #ffffff;
- .buy-info {
- height: 100%;
- display: flex;
- align-items: center;
- .font {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .avter {
- margin-left: 10rpx;
- width: 46rpx;
- height: 46rpx;
- border-radius: 50%;
- }
- .buy-name {
- margin-left: 10rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .phone {
- margin-left: 12rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- }
- .upimg {
- padding-left: 20rpx;
- padding-top: 10rpx;
- padding-bottom: 10rpx;
- display: flex;
- .up-tit {
- display: inline-block;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #6d7c88;
- }
- .img-wrap {
- width: 153rpx;
- height: 152rpx;
- border-radius: 20rpx;
- image {
- border-radius: 20rpx;
- width: 153rpx;
- height: 152rpx;
- background-color: #ccc;
- }
- }
- }
- .price-box {
- display: flex;
- justify-content: flex-end;
- align-items: baseline;
- padding: 20rpx 30rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-light;
- .num {
- margin: 0 8rpx;
- color: $font-color-dark;
- }
- .price {
- font-size: $font-lg;
- color: $font-color-dark;
- &:before {
- content: '¥';
- font-size: $font-sm;
- margin: 0 2rpx 0 8rpx;
- }
- }
- }
- .action-box {
- padding: 0 30rpx;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- height: 100rpx;
- position: relative;
- }
- .refuse {
- margin: 0;
- padding: 0;
- width: 160rpx;
- height: 60rpx;
- border: 2rpx solid #ebebeb;
- border-radius: 28rpx;
- text-align: center;
- line-height: 60rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- &:after {
- border-radius: 100px;
- }
- &.recom {
- color: #999999;
- &:after {
- border-color: #999999;
- }
- }
- }
- .action-btn {
- width: 160rpx;
- height: 60rpx;
- margin: 0;
- margin-left: 24rpx;
- padding: 0;
- text-align: center;
- line-height: 60rpx;
- font-size: $font-sm + 2rpx;
- color: $font-color-dark;
- background: #fff;
- border-radius: 100px;
- border: 2rpx solid #fd3b39;
- border-radius: 28px;
- &:after {
- border-radius: 100px;
- }
- &.recom {
- color: $base-color;
- &:after {
- border-color: $base-color;
- }
- }
- &.evaluate {
- color: $color-yellow;
- &:after {
- border-color: $color-yellow;
- }
- }
- }
- }
- </style>
|