123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- <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.good_integral }}</view>
- <view>余额</view>
- </view>
- </view>
- <view class="titlebox flex-center padding-t-30 padding-b-30">
- <view class="rich">
- <view class="richmin left">
-
- </view>
- </view>
- <view class="name">
- 产品交付区
- </view>
- <view class="rich right">
- <view class="richmin right">
-
- </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 class="list">
- <view v-for="(item, index) in orderList" :key="index" class="priduct-item">
- <view class="priduct-main-image">
- <image :src="item.image" mode="aspectFill"></image>
- </view>
- <!-- <text class="title clamp">{{ item.title }}</text> -->
- <view class="priduct-main-name clamp2 margin-c-20">{{ item.title }}</view>
- <view class="priduct-main-price">
- <view class="price">
- <image class="instip" src="../../static/icon/quick1.png" mode="scaleToFill"></image>
- <text class="padding-l-10">
- {{ item.good_integral }}
- </text>
- <text class="font-size-sm">
- 积分
- </text>
- </view>
- </view>
- <view class="priduct-main-price">
- <view class="price">
- +
- <text class="padding-l-10">
- {{ item.integral }}
- </text>
- <text class="font-size-sm">
- 趣豆
- </text>
- </view>
- </view>
- <view class="flex padding-l-20 padding-b-20">
- <view class="buttom" @click="openPay(item)">
- 立即提货
- </view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- good_exchange
- } from '@/api/wallet.js';
- import {
- getMoneyStyle
- } from '@/utils/rocessor.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- getUserInfo
- } from '@/api/user.js';
- 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'])
- },
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- loadingType: 'more',
- orderList: [],
- page: 1, //当前页数
- limit: 10, //每次信息条数
- maxheight: 0
- };
- },
- filters: {
- moneyNum(value) {
- return +value;
- }
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.list-scroll-content').boundingClientRect().exec(function(res) {
- _this.maxheight = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- onShow() {
- this.loadData();
- this.getUserInfo();
- },
- methods: {
- ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
- getUserInfo() {
- getUserInfo({})
- .then(({
- data
- }) => {
- this.setUserInfo(data);
- })
- .catch(e => {
- console.log(e);
- });
- },
- openPay(item){
- uni.navigateTo({
- url:"./goodProduct?id="+item.id
- })
- // uni.showModal({
- // title: '支付提示',
- // content: `是否立即兑换兑换`,
- // cancelText: '取消',
- // confirmText: '兑换',
- // success: res => {
- // if(res.confirm){
-
- // }
- // },
- // });
- },
- // 转换金额为数字
- moneyNum(value) {
- return +value;
- },
- // 页面跳转
- navto(e) {
- uni.navigateTo({
- url: e
- });
- },
- // 点击返回 我的页面
- toBack() {
- uni.navigateBack({});
- },
- //获取收入支出信息
- async loadData(source) {
- let obj = this;
- good_exchange({
- page: obj.page,
- limit: obj.limit
- })
- .then(({
- data
- }) => {
- obj.orderList = obj.orderList.concat(data);
- // 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%;
- }
- .titlebox {
- .rich {
- width: 20rpx;
- height: 20rpx;
- background: #FFA5A5;
- border-radius: 50%;
- position: relative;
- .richmin {
- width: 14rpx;
- height: 14rpx;
- border-radius: 50%;
- border: 1px solid #333333;
- &.left {
- position: absolute;
- left: -4rpx;
- bottom: -4rpx;
- }
- &.right {
- position: absolute;
- right: -4rpx;
- bottom: -4rpx;
- }
- }
- }
- .name {
- color: #FF6B2E;
- font-weight: 500;
- font-size: 33rpx;
- padding: 0 40rpx;
- }
- }
- .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 {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- padding: 0 32rpx;
- .priduct-item {
- width: 48%;
- background-color: #ffffff;
- border-radius: 12rpx;
- margin-bottom: 24rpx;
- &:nth-child(2n + 1) {
- margin-right: 24rpx;
- }
- .buttom{
- color: #fffeff;
- background-color:#FF6B2E ;
- padding: 6rpx 20rpx;
- border-radius: 100rpx;
- }
- .priduct-main-image {
- width: 100%;
- height: 330rpx;
- // background: red;
- border-radius: 3px;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- opacity: 1;
- border-radius: 12rpx 12rpx 0 0;
- }
- }
- .priduct-main-name {
- font-size: $font-base;
- color: $font-color-dark;
- font-weight: bold;
- height: 3em;
- }
- .priduct-main-price {
- display: flex;
- justify-content: space-between;
- padding: 0 16rpx 12rpx;
- .price {
- font-size: 36rpx;
- font-weight: bold;
- color: #FF6B2E;
- .instip{
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- }
- }
- </style>
|