| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <template>
- <view :style="vuex_skin">
- <u-navbar title-color="#fff" z-index="90" :border-bottom="false" :is-back="false" title="积分商城"
- :background="{'backgroundColor': vuex_theme.shopBg}"></u-navbar>
- <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="userData.avatar">
- </image>
- <view class="center data">
- <text style="color: #FFD7D9;">我的积分:</text>
- <text class="text-bold text-xxl">{{userData.pufaPoint}}</text>
- </view>
- </view>
- <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 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" @click="$u.toast('暂未开放')">
- <button class="cu-btn round text-white bg-base"
- style="width: 140upx;height: 50upx;">兑换</button>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body-diy>
- <login ref="login" @signIn="signIn" @phoneSuccess="phoneSuccess"></login>
- </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],
- components: {
- MescrollBodyDiy,
- },
- data() {
- return {
- swiperList: [
- 'https://gx.vote.activity.obs.cn-south-1.myhuaweicloud.com:443/3b23192e2b684e1e8d606790216d9d19-bff40cda56a61fb3151002945d87ad7.jpg'
- ],
- downOption: {
- auto: false
- },
- userData: {},
- list: []
- }
- },
- onShow() {
- this.fetchUserInfo()
- },
- methods: {
- fetchUserInfo(){
- if (!this.vuex_userId) {
- return
- }
- let params = {
- id: this.vuex_userId
- }
- this.$api.loginUser.detail(params).then(res => {
- if (this.$isNotEmpty(res.data.data)) {
- this.userData=res.data.data
- let userInfo=this.userData
- userInfo.sessionKey=this.$cache.get('userInfo').sessionKey
- this.$cache.put('userInfo',userInfo)
- this.$u.vuex('vuex_phone',this.userData.phone)
- }
- })
- },
- 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>
- <style lang="scss" scoped>
- .rule {
- background-color: var(--shopRule);
- color: #FFFFFF;
- padding: 20rpx 40rpx 20rpx 30rpx;
- }
- .bg-card {
- // position: relative;
- width: 100vw;
- height: 260rpx;
- background-color: var(--shopBg);
- border-radius: 0 0 10% 10%;
- .info {
- display: flex;
- padding: 30rpx 0rpx 0rpx 40rpx;
- .data {
- color: #FFFFFF;
- margin-left: 10rpx;
- }
- }
- }
- .swiper {
- margin-top: -120rpx;
- padding: 0 20rpx;
- }
- /* 为你推荐 */
- .recommend-info {
- padding-top: 30rpx;
- width: 100%;
- border-radius: 20rpx;
- .recommend-title {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100rpx;
- .title {
- display: flex;
- align-items: center;
- image {
- width: 416rpx;
- height: 40rpx;
- }
- }
- }
- .goods-list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- padding: 0 20rpx;
- .list {
- width: 49%;
- height: 550rpx;
- margin-bottom: 20rpx;
- background-color: #FFFFFF;
- border-radius: 12rpx;
- overflow: hidden;
- .pictrue {
- display: flex;
- justify-content: center;
- width: 100%;
- image {
- width: 100%;
- height: 340rpx;
- }
- }
- .title-tag {
- // display: flex;
- height: 70rpx;
- padding: 20rpx;
- }
- .price-info {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: center;
- padding: 0 20rpx;
- height: 50rpx;
- .user-price {
- display: flex;
- justify-content: center;
- align-items: center;
- text {
- color: #e72226;
- }
- .min {
- font-size: 24rpx;
- }
- .max {
- font-size: 32rpx;
- }
- }
- .vip-price {
- padding-left: 20rpx;
- display: flex;
- align-items: center;
- image {
- width: 26rpx;
- height: 26rpx;
- margin-right: 10rpx;
- }
- text {
- text-decoration: line-through;
- color: #8c8c8c;
- font-size: 24rpx;
- }
- }
- }
- .bottom {
- margin: 10rpx 0;
- display: flex;
- justify-content: center;
- align-items: flex-end;
- }
- }
- }
- }
- </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>
- -->
|