|
@@ -72,6 +72,39 @@
|
|
|
<image :src="activity.logoUrl" @tap="showActivity()" />
|
|
<image :src="activity.logoUrl" @tap="showActivity()" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 引导页轮播弹窗 -->
|
|
|
|
|
+ <view class="guide-popup" v-if="guideShow">
|
|
|
|
|
+ <view class="guide-mask"></view>
|
|
|
|
|
+ <view class="guide-wrap">
|
|
|
|
|
+ <view class="guide-card">
|
|
|
|
|
+ <swiper
|
|
|
|
|
+ class="guide-swiper"
|
|
|
|
|
+ :current="guideCurrent"
|
|
|
|
|
+ @change="onGuideSwiperChange"
|
|
|
|
|
+ :indicator-dots="false"
|
|
|
|
|
+ :autoplay="false"
|
|
|
|
|
+ :circular="false"
|
|
|
|
|
+ >
|
|
|
|
|
+ <swiper-item v-for="(item, index) in guideList" :key="'guide-' + index">
|
|
|
|
|
+ <image class="guide-img" :src="item.value" mode="aspectFit" />
|
|
|
|
|
+ </swiper-item>
|
|
|
|
|
+ </swiper>
|
|
|
|
|
+ <view class="guide-dots" v-if="guideList.length > 1">
|
|
|
|
|
+ <view
|
|
|
|
|
+ v-for="(item, index) in guideList"
|
|
|
|
|
+ :key="'guide-dot-' + index"
|
|
|
|
|
+ class="guide-dot"
|
|
|
|
|
+ :class="{ active: guideCurrent === index }"
|
|
|
|
|
+ ></view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="guide-btn" @tap="onGuideAction">{{ isGuideLast ? '立即体验' : '下一页' }}</view>
|
|
|
|
|
+ <view class="guide-close" @tap="closeGuide">
|
|
|
|
|
+ <u-icon name="close-circle" color="#fff" size="36"></u-icon>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<z-modal :show="tuiModalControl" placeholderText="请输入邀请码" :btnGroup="btnGroup" :contentType="2"
|
|
<z-modal :show="tuiModalControl" placeholderText="请输入邀请码" :btnGroup="btnGroup" :contentType="2"
|
|
|
titleText="填写邀请码" @cancle="cancleTui" @sure="submitTui"></z-modal>
|
|
titleText="填写邀请码" @cancle="cancleTui" @sure="submitTui"></z-modal>
|
|
|
<Server />
|
|
<Server />
|
|
@@ -82,7 +115,7 @@
|
|
|
import zModal from '@/components/z-modal/z-modal.vue'
|
|
import zModal from '@/components/z-modal/z-modal.vue'
|
|
|
import { getMenu, getIndexData, getCartCount } from '@/api/index'
|
|
import { getMenu, getIndexData, getCartCount } from '@/api/index'
|
|
|
import { getStoreConfig } from '@/api/common'
|
|
import { getStoreConfig } from '@/api/common'
|
|
|
-import { getHomeInit, getHomeRecommend, getHomeGoods, listPublicCourse, getHisStoreConfig } from '@/api/home.js'
|
|
|
|
|
|
|
+import { getHomeInit, getHomeRecommend, getHomeGoods, listPublicCourse, getHisStoreConfig, getStoreActivityGuide, viewStoreActivityGuide } from '@/api/home.js'
|
|
|
import HotProduct from './components/HotProduct.vue'
|
|
import HotProduct from './components/HotProduct.vue'
|
|
|
//import TuiProduct from '@/components/tuiProduct.vue'
|
|
//import TuiProduct from '@/components/tuiProduct.vue'
|
|
|
import SearchBar from './components/SearchBar.vue'
|
|
import SearchBar from './components/SearchBar.vue'
|
|
@@ -143,10 +176,18 @@ export default {
|
|
|
imageUrl:[
|
|
imageUrl:[
|
|
|
'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page01.png',
|
|
'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page01.png',
|
|
|
'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page02.png'
|
|
'https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/class/page02.png'
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ guideShow: false,
|
|
|
|
|
+ guideList: [],
|
|
|
|
|
+ guideCurrent: 0,
|
|
|
|
|
+ guideViewed: true,
|
|
|
|
|
+ guideScrollTop: 0
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ isGuideLast() {
|
|
|
|
|
+ return this.guideList.length > 0 && this.guideCurrent >= this.guideList.length - 1
|
|
|
|
|
+ },
|
|
|
bgColor() {
|
|
bgColor() {
|
|
|
const t = this.top / 30
|
|
const t = this.top / 30
|
|
|
if(t>0){
|
|
if(t>0){
|
|
@@ -205,6 +246,7 @@ export default {
|
|
|
this.getMenu()
|
|
this.getMenu()
|
|
|
if (uni.getStorageSync('AppToken')) {
|
|
if (uni.getStorageSync('AppToken')) {
|
|
|
this.getUserInfo()
|
|
this.getUserInfo()
|
|
|
|
|
+ this.getStoreActivityGuide()
|
|
|
} else {
|
|
} else {
|
|
|
this.isuser = true
|
|
this.isuser = true
|
|
|
}
|
|
}
|
|
@@ -451,6 +493,37 @@ export default {
|
|
|
else uni.showToast({ icon: 'none', title: '请求失败' })
|
|
else uni.showToast({ icon: 'none', title: '请求失败' })
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ getStoreActivityGuide() {
|
|
|
|
|
+ if (!this.utils.checkLoginState()) return
|
|
|
|
|
+ getStoreActivityGuide().then(res => {
|
|
|
|
|
+ if (res.code != 200) return
|
|
|
|
|
+ this.guideList = res.guideData || []
|
|
|
|
|
+ if (!res.viewed && this.guideList.length > 0) {
|
|
|
|
|
+ this.guideCurrent = 0
|
|
|
|
|
+ this.guideScrollTop = this.top || 0
|
|
|
|
|
+ this.guideShow = true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onGuideSwiperChange(e) {
|
|
|
|
|
+ this.guideCurrent = e.detail.current
|
|
|
|
|
+ },
|
|
|
|
|
+ onGuideAction() {
|
|
|
|
|
+ if (this.isGuideLast) {
|
|
|
|
|
+ this.closeGuide()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.guideCurrent++
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ closeGuide() {
|
|
|
|
|
+ if (!this.guideShow) return
|
|
|
|
|
+ this.guideShow = false
|
|
|
|
|
+ this.guideViewed = true
|
|
|
|
|
+ // viewStoreActivityGuide().catch(() => {})
|
|
|
|
|
+ // if (this.guideScrollTop > 0) {
|
|
|
|
|
+ // uni.pageScrollTo({ scrollTop: this.guideScrollTop, duration: 0 })
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
getCartCount() {
|
|
getCartCount() {
|
|
|
this.utils.isLogin().then(res => {
|
|
this.utils.isLogin().then(res => {
|
|
|
if (res) getCartCount().then(cartRes => {
|
|
if (res) getCartCount().then(cartRes => {
|
|
@@ -671,4 +744,96 @@ export default {
|
|
|
.popup-box .info-form image {
|
|
.popup-box .info-form image {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
+.guide-popup {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ z-index: 1001;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-mask {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ background: rgba(0,0,0,0.55);
|
|
|
|
|
+}
|
|
|
|
|
+.guide-wrap {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ width: 670rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-card {
|
|
|
|
|
+ width: 670rpx;
|
|
|
|
|
+ border-radius: 40rpx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ //background: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-swiper {
|
|
|
|
|
+ width: 670rpx;
|
|
|
|
|
+ height: 880rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-dots {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 24rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 12rpx;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-dot {
|
|
|
|
|
+ width: 12rpx;
|
|
|
|
|
+ height: 12rpx;
|
|
|
|
|
+ border-radius: 6rpx;
|
|
|
|
|
+ background: rgba(255, 255, 255, 0.45);
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-dot.active {
|
|
|
|
|
+ width: 28rpx;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-btn {
|
|
|
|
|
+ margin-top: 30rpx;
|
|
|
|
|
+ width: 590rpx;
|
|
|
|
|
+ height: 104rpx;
|
|
|
|
|
+ background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
|
|
|
|
|
+ border-radius: 52rpx;
|
|
|
|
|
+ font-family: PingFangSC, PingFang SC;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ font-size: 40rpx;
|
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
|
+ line-height: 104rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-close {
|
|
|
|
|
+ width: 60rpx;
|
|
|
|
|
+ height: 60rpx;
|
|
|
|
|
+ margin-top: 30rpx;
|
|
|
|
|
+ // border: 2rpx solid rgba(255, 255, 255, 0.85);
|
|
|
|
|
+ // border-radius: 50%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+.guide-close-x {
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 40rpx;
|
|
|
|
|
+ line-height: 1;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|