123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <view class="container home clearfix" :style="{ paddingTop: CustomBar + 'px' }">
- <tui-skeleton
- v-if="skeletonShow"
- backgroundColor="#fafafa"
- borderRadius="10rpx"
- :isLoading="true"
- :loadingType="5"
- />
- <customer ref="customer" :isScroll="isScroll" :navbar-data="nvabarData" :navBarsList="navBarsList" v-if="isNavRequest" /> <!-- 主页内容 -->
- <view class="container-home tui-skeleton">
- <!-- 轮播 -->
- <banner :list="bannerImageList" v-if="isNavRequest" />
- <!-- 金刚区菜单 -->
- <navbars :list="shortcutList" v-if="isNavRequest" />
- <!-- 优惠券入口 -->
- <!-- <coupon v-if="isNavRequest" /> -->
- <!-- 直播 -->
- <page-special :templateData="templateData" v-if="isLiveRequest" />
- <!-- 新品橱窗 -->
- <hot-floor
- :list="hotListPageFloor"
- :usserIdentity="userIdentity"
- :autoplay="autoplay"
- v-if="isRequest && hotListPageFloor.length > 0"
- />
- </view>
- <!-- 楼层 -->
- <view class="container-section tui-skeleton">
- <page-floor :list="pageList" :userIdentity="userIdentity" :pageType="1" v-if="isRequest" />
- <supplier-list :supplierObj="supplierObj" v-if="isRequest" />
- </view>
- <!-- 侧边 -->
- <scroll-top :isScrollTop="isScrollTop" :isShowSupplier="true" :isShowKefu='false' :bottom="130" />
- <!-- 活动弹窗 -->
- <!-- <activityAlert :show="isActivity" @click="handleClick" @cancel="handleCancelClick" /> -->
- <!-- 活动弹窗 -->
- <activityAlert :show="centerImageShow" :list="centerImage" @click="handleCenterImageClick" @cancel="handleCenterImageCancelClick" />
- <!-- 采美豆提示弹窗 -->
- <activityBean
- v-if="isActivityBean"
- :show="isActivityBean"
- :beansType="beansType"
- :beanNumber="beanNumber"
- @cancel="handleBeanlClick"
- />
- <cm-seller-modal :suid="suid" />
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import customer from './components/customer.vue'
- import banner from './components/banner.vue'
- import navbars from './components/navbars.vue'
- import coupon from './components/coupon.vue'
- import pageFloor from './components/pageFloor.vue'
- import hotFloor from './components/hotFloor.vue'
- import pageSpecial from './components/pageSpecial.vue'
- import supplierList from './components/supplierList.vue'
- import activityAlert from '@/components/cm-module/activity/activities.vue'
- import activityBean from '@/components/cm-module/activity/activityBean.vue'
- import cmSellerModal from '@/components/cm-share-popup/cm-seller-modal.vue'
- import homeMiXins from './index.js'
- export default {
- mixins: [ homeMiXins ],
- components: {
- customer,
- banner,
- navbars,
- coupon,
- pageFloor,
- hotFloor,
- pageSpecial,
- supplierList,
- activityAlert,
- activityBean,
- cmSellerModal
- },
- data() {
- return {
- nvabarData: {
- // 顶部自定义导航
- showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
- showSearch: 0,
- title: '采美采购商城', // 导航栏 中间的标题
- haveBack: false,
- textLeft: this.$store.state.isIphone,
- textColor: '#333333'
- },
- CustomBar: this.CustomBar, // 顶部导航栏高度
- isScrollTop: false,
- }
- },
- onLoad(option) {
- this.options = option
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onPageScroll(e) {
- if (e.scrollTop > 0) {
- this.isScroll = true
- } else {
- this.isScroll = false
- }
- if (e.scrollTop > 400) {
- this.isScrollTop = true
- } else {
- this.isScrollTop = false
- }
- },
- onPullDownRefresh() {
- //下拉刷新
- this.getHomeInformation()
- uni.stopPullDownRefresh()
- },
- onShareAppMessage(res) {
- //分享转发
- if (res.from === 'button') {
- // 来自页面内转发按钮
- }
- return {
- title: '生美医美正品采购服务平台',
- path: 'pages/tabBar/home/index',
- imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
- }
- },
- onShow() {
- this.autoplay = true
- this.GetWxAuthorize()
- const suid = this.options.suid ? this.options.suid : uni.getStorageSync('suid') * 1 ? uni.getStorageSync('suid') * 1 : 0 // 协销userId
- const spId = this.options.spId ? this.options.spId : uni.getStorageSync('spId') * 1 ? uni.getStorageSync('spId') * 1 : 0 // 协销id
- const isShare = this.options.type == 4 ? true : false //是否从分享页进入
- if ((isShare || uni.getStorageSync('suid') * 1 > 0) && this.userInfo.userIdentity !== 1) { // 分享进入 且 用户非协销
- if (!uni.getStorageSync('spUserId') || (uni.getStorageSync('spUserId') * 1 === uni.getStorageSync('suid') * 1)) {// 如果未分配或者分配相同
- this.suid = suid
- uni.setStorageSync('suid', suid)
- uni.setStorageSync('spId', spId)
- } else {
- uni.setStorageSync('suid', 0)
- this.suid = 0
- uni.setStorageSync('spId', 0)
- }
-
- }
- console.log(this.suid, 'uni.getStorageSync(\'spId\')', uni.getStorageSync('spId'))
- },
- onHide() {
- this.autoplay = false
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #ffffff;
- }
- .container-section {
- width: 100%;
- height: auto;
- background-color: #f7f7f7;
- }
- </style>
|