123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- <template>
- <view :style="colorStyle">
- <view class="points-swiper">
- <image class="bag" src="../../static/images/jf-head.png" mode=""></image>
- <view class="swiper">
- <swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
- :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
- <block v-for="(item, index) in imgUrls" :key="index">
- <swiper-item>
- <image :src="item.img" class="slide-image" @click="goPages(item)"></image>
- </swiper-item>
- </block>
- </swiper>
- </view>
- </view>
- <view class="model">
- <view class="model-list" v-for="(model,index) in modelList" :key="index" @click="jump(model.url)">
- <image class="img" :src="model.imgUrl" mode=""></image>
- <text>{{model.title}}</text>
- </view>
- </view>
- <view class="body">
- <view class="body-title">
- <text class="title">大家都在换</text>
- <text class="jump-trip" @click="jumpMore">查看更多
- <text class="iconfont icon-xiangyou"></text></text>
- </view>
- <view class="product-list" v-if="goodList.length">
- <view class="product-item" v-for="(item, index) in goodList" @click="goGoodsDetail(item)">
- <image :src="item.image"></image>
- <view class="info">
- <view class="title line1">{{ item.title }}</view>
- <view class="price-box">
- {{ item.price }}积分
- </view>
- <view class="sales">{{item.sales}}人兑换</view>
- </view>
- </view>
- </view>
- <view v-else class="no-goods">
- <image :src="imgHost + '/statics/images/no-thing.png'" mode=""></image>
- <view class="fontimg">暂无商品,去看点别的吧</view>
- </view>
- <view class="footer">
- <view class="body-title">
- <text class="title">轻松赚积分</text>
- <text></text>
- </view>
- <view class="footer-list">
- <view class="list-left">
- <image class="icon-sty" src="static/go-shoping.png" mode=""></image>
- <view class="list-left-right">
- <view class="title">
- 购买商品
- </view>
- <view class="trip">
- 购买商品可获得积分奖励
- </view>
- </view>
- </view>
- <navigator url="/pages/index/index" open-type="switchTab">
- <text class="go-jump">
- 去完成
- </text>
- </navigator>
- </view>
- <view class="footer-list">
- <view class="list-left">
- <image class="icon-sty" src="static/everyday.png" mode=""></image>
- <view class="list-left-right">
- <view class="title">
- 每日签到活动
- </view>
- <view class="trip">
- 每日签到可获得积分奖励
- </view>
- </view>
- </view>
- <view @click="jump('/pages/users/user_sgin/index')">
- <text class="go-jump">
- 去完成
- </text>
- </view>
- </view>
- <view class="footer-list">
- <view class="list-left">
- <image class="icon-sty" src="static/luck-draw.png" mode=""></image>
- <view class="list-left-right">
- <view class="title">
- 九宫格抽奖活动
- </view>
- <view class="trip">
- 幸运抽奖可获得积分奖励
- </view>
- </view>
- </view>
- <view @click="jump('/pages/goods/lottery/grids/index?type=1')">
- <text class="go-jump">
- 去完成
- </text>
- </view>
- </view>
- </view>
- </view>
- <!-- #ifdef MP -->
- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
- <!-- #endif -->
- </view>
- </template>
- <script>
- // import swipers from './components/swiper.vue';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from 'vuex';
- import {
- getStoreIntegral
- } from '@/api/points_mall.js'
- import {
- goShopDetail
- } from '@/libs/order.js';
- import colors from "@/mixins/color";
- import {HTTP_REQUEST_URL} from '@/config/app';
- export default {
- components: {
- // swipers
- },
- mixins: [colors],
- data() {
- return {
- autoplay: true,
- circular: true,
- interval: 3000,
- duration: 500,
- imgUrls: [],
- goodList: [],
- modelList: [{
- title: '我的积分',
- imgUrl: 'static/my-point.png',
- url: "/pages/users/user_integral/index"
- },
- {
- title: '每日签到',
- imgUrl: 'static/sign-in.png',
- url: '/pages/users/user_sgin/index'
- }, {
- title: '积分抽奖',
- imgUrl: 'static/points-lottery.png',
- url: '/pages/goods/lottery/grids/index?type=1'
- }, {
- title: '兑换记录',
- imgUrl: 'static/exchange.png',
- url: "/pages/points_mall/exchange_record"
- },
- ],
- imgHost:HTTP_REQUEST_URL,
- isShowAuth: false
- }
- },
- computed: mapGetters(['isLogin']),
- onLoad() {
- this.getStoreIntegral()
- },
- watch: {
- isLogin: {
- handler: function(newV, oldV) {
- if (newV == true) {
- // this.getStoreIntegral();
- }
- },
- deep: true
- },
- },
- onShow(){
- uni.removeStorageSync('form_type_cart');
- },
- methods: {
- // 授权回调
- onLoadFun() {
- this.isShowAuth = false;
- },
- // 授权关闭
- authColse: function(e) {
- this.isShowAuth = e
- },
- getStoreIntegral() {
- getStoreIntegral().then(res => {
- this.imgUrls = res.data.banner
- this.goodList = res.data.list
- })
- },
- // 去商品详情
- goGoodsDetail(item) {
- goShopDetail(item).then(res => {
- uni.navigateTo({
- url: `/pages/points_mall/integral_goods_details?id=${item.id}`
- });
- });
- },
- jumpMore() {
- uni.navigateTo({
- url: '/pages/points_mall/integral_goods_list'
- })
- },
- goPages(item) {
- let url = item.link;
- if (url.indexOf("http") != -1) {
- // #ifdef H5
- location.href = url
- // #endif
- } else {
- if (['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/index/index','/pages/store_cate/store_cate']
- .indexOf(url) == -1) {
- uni.navigateTo({
- url: url
- })
- } else {
- uni.switchTab({
- url: url
- })
- }
- }
- },
- getIsLogin(){
- // #ifndef MP
- toLogin()
- // #endif
- // #ifdef MP
- this.isShowAuth = true;
- // #endif
- },
- jump(url) {
- if(this.isLogin){
- uni.navigateTo({
- url
- })
- }else{
- this.getIsLogin();
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .swiper,
- swiper,
- swiper-item,
- .slide-image {
- width: 100%;
- height: 280rpx;
- }
- /deep/ .uni-swiper-wrapper {
- border-radius: 10rpx;
- }
- .swiper {
- padding: 40rpx;
- }
- .points-swiper {
- position: relative;
- width: 100%;
- background-color: #fff;
- .bag {
- position: absolute;
- width: 100%;
- height: 285rpx;
- }
- .points-swiper-sty {
- padding: 20rpx 26rpx;
- }
- }
- .model {
- display: flex;
- justify-content: space-between;
- padding: 56rpx 42rpx;
- background-color: #fff;
- }
- .model-list {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- color: #333;
- margin-top: 27rpx;
- font-weight: 500;
- .img {
- width: 84rpx;
- height: 84rpx;
- margin-bottom: 19rpx;
- }
- }
- .body {
- background-color: #fff;
- padding: 0 30rpx;
- margin-top: 20rpx;
- .body-title {
- display: flex;
- justify-content: space-between;
- padding: 30rpx 0 10rpx 0;
- .title {
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- }
- .jump-trip,
- .icon-xiangyou {
- font-size: 24rpx;
- color: #999999;
- }
- }
- .product-list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin-top: 30rpx;
- .product-item {
- position: relative;
- width: 334rpx;
- background: #fff;
- border-radius: 10rpx;
- margin-bottom: 20rpx;
- box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.06);
- image {
- width: 100%;
- height: 344rpx;
- border-radius: 10rpx 10rpx 0 0;
- }
- .info {
- padding: 14rpx 16rpx;
- .title {
- font-size: 28rpx;
- }
- .price-box {
- font-size: 26rpx;
- font-weight: 700;
- margin-top: 8px;
- color: var(--view-theme);
- }
- .sales {
- font-size: 22rpx;
- color: #999999;
- }
- }
- }
- }
- }
- .footer {
- margin-top: 20rpx;
- .footer-list {
- display: flex;
- justify-content: space-between;
- padding: 26rpx 0;
- .list-left {
- display: flex;
- align-items: center;
- .icon-sty {
- width: 80rpx;
- height: 80rpx;
- margin-right: 18rpx;
- }
- .list-left-right {
- .title {
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- }
- .trip {
- font-size: 22rpx;
- color: #999999;
- }
- }
- }
- .go-jump {
- display: flex;
- align-items: center;
- background-color: #E93323;
- border-radius: 26rpx;
- color: #fff;
- font-size: 28rpx;
- height: 48rpx;
- line-height: 48rpx;
- padding: 6rpx 24rpx;
- }
- }
- }
- .no-goods {
- display: flex;
- flex-direction: column;
- height: 472rpx;
- image{
- width: 100%;
- display: block;
- margin: 0 auto;
- }
- .fontimg{
- text-align: center;
- color: #bebebe;
- }
- }
- </style>
|