|
@@ -1,117 +1,109 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view :style="vuex_skin">
|
|
<view :style="vuex_skin">
|
|
|
- <u-navbar title-color="#fff" :border-bottom="false" :is-back="false" title="积分商城"
|
|
|
|
|
|
|
+ <u-navbar title-color="#fff" z-index="90" :border-bottom="false" :is-back="false" title="积分商城"
|
|
|
:background="{'backgroundColor': vuex_theme.shopBg}"></u-navbar>
|
|
:background="{'backgroundColor': vuex_theme.shopBg}"></u-navbar>
|
|
|
|
|
|
|
|
- <view class="bg-card">
|
|
|
|
|
- <view class="info" style="display: flex;justify-content: space-between;">
|
|
|
|
|
- <view class="flex">
|
|
|
|
|
- <image style="width: 90rpx;height: 90rpx;border-radius: 50%;" src="../../static/test/avatar.png">
|
|
|
|
|
- </image>
|
|
|
|
|
- <view class="center data">
|
|
|
|
|
- <text style="color: #FFD7D9;">我的积分:</text>
|
|
|
|
|
- <text class="text-bold text-xxl">2356</text>
|
|
|
|
|
|
|
+ <mescroll-body-diy ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback"
|
|
|
|
|
+ @up="upCallback">
|
|
|
|
|
+ <view class="bg-card">
|
|
|
|
|
+ <view class="info" style="display: flex;justify-content: space-between;">
|
|
|
|
|
+ <view class="flex" v-if="vuex_userId">
|
|
|
|
|
+ <image style="width: 90rpx;height: 90rpx;border-radius: 50%;" :src="$cache.get('userInfo').avatar">
|
|
|
|
|
+ </image>
|
|
|
|
|
+ <view class="center data">
|
|
|
|
|
+ <text style="color: #FFD7D9;">我的积分:</text>
|
|
|
|
|
+ <text class="text-bold text-xxl">{{$cache.get('userInfo').pufaPoint}}</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="center" style="margin-right: -30rpx;">
|
|
|
|
|
- <view class="cu-btn round sm rule">
|
|
|
|
|
- 积分规则
|
|
|
|
|
|
|
+ <view class="flex" v-else @click="showLogin">
|
|
|
|
|
+ <image style="width: 90rpx;height: 90rpx;border-radius: 50%;" src="/static/icon/unlogin.png">
|
|
|
|
|
+ </image>
|
|
|
|
|
+ <view class="center data">
|
|
|
|
|
+ <text style="color: #FFFFFF;font-weight: 800;">点击授权登录</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="center" style="margin-right: -30rpx;">
|
|
|
|
|
+ <view class="cu-btn round sm rule">
|
|
|
|
|
+ 积分规则
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="swiper">
|
|
|
|
|
- <u-swiper :list="swiperList" border-radius="12" height="250"></u-swiper>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="recommend-info">
|
|
|
|
|
- <view class="goods-list">
|
|
|
|
|
- <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
|
- <view class="pictrue">
|
|
|
|
|
- <image :src="item.image"></image>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="title-tag" style="text-align: center;font-weight: 800;">
|
|
|
|
|
- <text>{{item.name}}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="price-info">
|
|
|
|
|
- <view class="user-price">
|
|
|
|
|
- <text class="min">¥</text>
|
|
|
|
|
- <text class="max">{{item.points}}积分</text>
|
|
|
|
|
|
|
+ <view class="swiper">
|
|
|
|
|
+ <u-swiper :list="swiperList" border-radius="12" height="250"></u-swiper>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="recommend-info">
|
|
|
|
|
+ <view class="goods-list">
|
|
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index">
|
|
|
|
|
+ <view class="pictrue">
|
|
|
|
|
+ <image :src="item.imgUrl"></image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="title-tag" style="text-align: center;font-weight: 800;">
|
|
|
|
|
+ <text>{{item.name}}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="price-info">
|
|
|
|
|
+ <view class="user-price">
|
|
|
|
|
+ <text class="min">¥</text>
|
|
|
|
|
+ <text class="max">{{item.point}}积分</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="bottom padding-top-20">
|
|
|
|
|
+ <button class="cu-btn round text-white bg-base"
|
|
|
|
|
+ style="width: 140upx;height: 50upx;">兑换</button>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- <view class="bottom padding-top-20">
|
|
|
|
|
- <button class="cu-btn round text-white bg-base" style="width: 140upx;height: 50upx;">兑换</button>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
|
+ </mescroll-body-diy>
|
|
|
|
|
+ <login ref="login" @signIn="signIn" @phoneSuccess="phoneSuccess"></login>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import MescrollBodyDiy from "@/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-body.vue";
|
|
|
|
|
+ import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ mixins: [MescrollMixin],
|
|
|
|
|
+ components: {
|
|
|
|
|
+ MescrollBodyDiy,
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
swiperList: [
|
|
swiperList: [
|
|
|
'https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/a20288db71c24a8983801f0c0cd66ea8-bg.jpg'
|
|
'https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/a20288db71c24a8983801f0c0cd66ea8-bg.jpg'
|
|
|
],
|
|
],
|
|
|
- list: [{
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- image: '/static/test/goods.png',
|
|
|
|
|
- name: '迪士尼门票',
|
|
|
|
|
- points: 200
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+
|
|
|
|
|
+ downOption: {
|
|
|
|
|
+ auto: false
|
|
|
|
|
+ },
|
|
|
|
|
+ top: 0,
|
|
|
|
|
+ list: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
|
|
+ downCallback() {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.mescroll.resetUpScroll();
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ upCallback(mescroll) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ current: mescroll.num,
|
|
|
|
|
+ size: mescroll.size,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.pointgoods.list(params).then(res => {
|
|
|
|
|
+ let data = res.data.data.records
|
|
|
|
|
+ let total = res.data.data.total
|
|
|
|
|
+ mescroll.endBySize(data.length, total);
|
|
|
|
|
+ if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
|
|
|
|
+ this.list = this.list.concat(data); //追加新数据
|
|
|
|
|
+ })
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ this.mescroll.endErr()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -256,3 +248,61 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+<!-- <template>
|
|
|
|
|
+ <view :style="vuex_skin">
|
|
|
|
|
+ <mescroll-body-diy ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
|
|
|
|
|
+ @up="upCallback">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </mescroll-body-diy>
|
|
|
|
|
+ </view>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+ import MescrollBodyDiy from "@/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-body.vue";
|
|
|
|
|
+ import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
|
|
|
+ export default {
|
|
|
|
|
+ mixins: [MescrollMixin],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+
|
|
|
|
|
+ downOption: {
|
|
|
|
|
+ auto: false
|
|
|
|
|
+ },
|
|
|
|
|
+ list: [],
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ downCallback() {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.mescroll.resetUpScroll();
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ upCallback(mescroll) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ current: mescroll.num,
|
|
|
|
|
+ size: mescroll.size,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.pointgoods.list(params).then(res => {
|
|
|
|
|
+ let data = res.data.data.records
|
|
|
|
|
+ let total = res.data.data.total
|
|
|
|
|
+ mescroll.endBySize(data.length, total);
|
|
|
|
|
+ if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
|
|
|
|
+ this.list = this.list.concat(data); //追加新数据
|
|
|
|
|
+ })
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ this.mescroll.endErr()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ -->
|