| xqd
@@ -1,13 +1,12 @@
|
|
|
<template>
|
|
|
<view class="home">
|
|
|
- <MyNav title="洲际酒店集团中国西区" bgColor="" :backIcon="false"></MyNav>
|
|
|
+ <MyNav title="洲际酒店集团中国西区" bgColor="" :backIcon="true"></MyNav>
|
|
|
<!-- swiper -->
|
|
|
<view class="home-swiper">
|
|
|
<uni-swiper-dot :info="infoList" :current="current1" :mode="mode" :dots-styles="dotsStyles">
|
|
|
<swiper class="swiper-box" @change="change1" circular>
|
|
|
<swiper-item v-for="(item ,index) in infoList" :key="index">
|
|
|
- <view class="swiper-item" v-if="item.resource_type == 1"
|
|
|
- @click="$utils.jump({
|
|
|
+ <view class="swiper-item" v-if="item.resource_type == 1" @click="$utils.jump({
|
|
|
jump_type: item.jump_type,
|
|
|
jump_config: item.jump_config
|
|
|
})">
|
| xqd
@@ -25,8 +24,7 @@
|
|
|
|
|
|
<!-- 金刚图 -->
|
|
|
<view class="home-nav">
|
|
|
- <view class="home-nav-item" v-for="(item,index) in navList" :key="index"
|
|
|
- @click="$utils.jump({
|
|
|
+ <view class="home-nav-item" v-for="(item,index) in navList" :key="index" @click="$utils.jump({
|
|
|
jump_type: item.jump_type,
|
|
|
jump_config: item.jump_config
|
|
|
})">
|
| xqd
@@ -52,7 +50,7 @@
|
|
|
|
|
|
<!-- 活动图片 -->
|
|
|
<view class="home-special-img">
|
|
|
- <template v-for="(item,index) in specialList" >
|
|
|
+ <template v-for="(item,index) in specialList">
|
|
|
<view class="ListItem" v-if="item.show_status" :key="index" @click="$utils.jump({
|
|
|
jump_type: 3,
|
|
|
jump_config: '/pages/index/active-detail/index',
|
| xqd
@@ -63,19 +61,19 @@
|
|
|
<view class="kudosicon" @click.stop="kudosActive(item.id,index)">
|
|
|
<image style="width:24rpx;height: 24rpx;" src="/static/icon/Kudos.png" v-if="item.is_like==0">
|
|
|
</image>
|
|
|
- <image style="width:24rpx;height: 24rpx;" src="/static/icon/Kudos(1).png" v-if="item.is_like==1">
|
|
|
+ <image style="width:24rpx;height: 24rpx;" src="/static/icon/Kudos(1).png"
|
|
|
+ v-if="item.is_like==1">
|
|
|
</image>
|
|
|
</view>
|
|
|
<text style="color: #333;font-weight: bold;font-size: 28rpx;">{{item.title}}</text>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
|
|
|
<!-- 广告图 -->
|
|
|
<view class="home-banner" v-if="!isShowAdver">
|
|
|
<view class="home-banner-img" v-if="in_page==1 && type == 1 ">
|
|
|
- <image style="width: 100%; height: 576rpx; border-radius: 12rpx;" :src="advData.img" mode=""
|
|
|
- @click="$utils.jump({
|
|
|
+ <image style="width: 100%; height: 576rpx; border-radius: 12rpx;" :src="advData.img" mode="" @click="$utils.jump({
|
|
|
jump_type: advData.jump_type,
|
|
|
jump_config: advData.jump_config
|
|
|
})"></image>
|
| xqd
@@ -105,16 +103,14 @@
|
|
|
</movable-area>
|
|
|
|
|
|
<!-- 广告的附图 -->
|
|
|
- <view class="home-attach"
|
|
|
- @click="$utils.jump({
|
|
|
+ <view class="home-attach" @click="$utils.jump({
|
|
|
jump_type: advInsetImg.jump_type,
|
|
|
jump_config: advInsetImg.jump_config
|
|
|
- })"
|
|
|
- >
|
|
|
+ })">
|
|
|
<image style="width: 690rpx;height: 156rpx;border-radius: 79rpx;" :src="advInsetImg.img" mode=""></image>
|
|
|
</view>
|
|
|
<!-- 酒店推荐 -->
|
|
|
- <view class="home-hotel home-special-area" v-if="false">
|
|
|
+ <view class="home-hotel home-special-area">
|
|
|
<view class="home-special-area-left">
|
|
|
<text>西区优品</text>
|
|
|
<view class="text-shadow"></view>
|
| xqd
@@ -124,12 +120,11 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 酒店推荐图片 -->
|
|
|
- <view class="home-hotel-img" v-if="false">
|
|
|
- <view class="home-hotel-img-content" v-if="isDevelopment">
|
|
|
- <template v-for="(item,index) in goodsList" >
|
|
|
+ <view class="home-hotel-img">
|
|
|
+ <view class="home-hotel-img-content">
|
|
|
+ <template v-for="(item,index) in goodsList">
|
|
|
<view v-if="item.status==1" class="home-hotel-img-content-item" :key="index"
|
|
|
- :style="{marginTop:item.marginTop || 0 }"
|
|
|
- @click="goToProduct(item.id)">
|
|
|
+ :style="{marginTop:item.marginTop || 0 }" @click="goToProduct(item.id)">
|
|
|
<image class="home-hotel-img-content-item-img"
|
|
|
:class="item.short?'home-hotel-img-content-item-img': 'home-hotel-img-content-item-img-long' "
|
|
|
:src="item.cover_img" mode=""></image>
|
| xqd
@@ -137,12 +132,10 @@
|
|
|
<text class="text-top">{{item.name}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
- <view v-if="isDevelopment" class="home-hotel-img-more" @click="$utils.jump({
|
|
|
- jump_type: 4,
|
|
|
- jump_config: '/pages/goods/goods'
|
|
|
- })">
|
|
|
+
|
|
|
+ <view class="home-hotel-img-more" @click='geMore'>
|
|
|
<text>查看更多商品</text>
|
|
|
</view>
|
|
|
</view>
|
| xqd
@@ -160,12 +153,10 @@
|
|
|
<uni-swiper-dot :info="info" mode="default" :current="current2" :dots-styles="dotsStylesBand">
|
|
|
<swiper class="swiper-box" circular @change="change2">
|
|
|
<swiper-item v-for="(items ,index) in info" :key="index">
|
|
|
- <view v-for="(item ,j) in items" :key="j" class="swiper-item"
|
|
|
- @click="$utils.jump({
|
|
|
+ <view v-for="(item ,j) in items" :key="j" class="swiper-item" @click="$utils.jump({
|
|
|
jump_type: item.jump_type,
|
|
|
jump_config: item.jump_config
|
|
|
- })"
|
|
|
- >
|
|
|
+ })">
|
|
|
<image style="width:144rpx;height:142rpx;" :src="item.img" mode="aspectFill"></image>
|
|
|
</view>
|
|
|
</swiper-item>
|
| xqd
@@ -218,11 +209,11 @@
|
|
|
jup_type: '',
|
|
|
jump_config: '',
|
|
|
//广告弹框图
|
|
|
- popupData:{},
|
|
|
+ popupData: {},
|
|
|
//弹窗的类型 1只弹一次首次 2就是每次都弹啊
|
|
|
- times_type:'',
|
|
|
+ times_type: '',
|
|
|
//弹窗的显示0不显示 1显示
|
|
|
- popupImgStatus:'',
|
|
|
+ popupImgStatus: '',
|
|
|
//视频封面图
|
|
|
isOpenVideo: false,
|
|
|
videoCoverImg: '',
|
| xqd
@@ -236,26 +227,25 @@
|
|
|
advData: {},
|
|
|
//广告附图展示图片
|
|
|
advertisInsetImg: '',
|
|
|
- advInsetImg:{},
|
|
|
+ advInsetImg: {},
|
|
|
//广告图展示图片:
|
|
|
advertisImg: '',
|
|
|
//广告图展示视频
|
|
|
- goodsList: [
|
|
|
- {
|
|
|
- cover_img:'https://t9.9026.com/imgs/11.png',
|
|
|
- name:'2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
+ goodsList: [{
|
|
|
+ cover_img: 'https://t9.9026.com/imgs/11.png',
|
|
|
+ name: '2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
},
|
|
|
{
|
|
|
- cover_img:'https://t9.9026.com/imgs/22.png',
|
|
|
- name:'2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
+ cover_img: 'https://t9.9026.com/imgs/22.png',
|
|
|
+ name: '2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
},
|
|
|
{
|
|
|
- cover_img:'https://t9.9026.com/imgs/33.png',
|
|
|
- name:'2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
+ cover_img: 'https://t9.9026.com/imgs/33.png',
|
|
|
+ name: '2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
},
|
|
|
{
|
|
|
- cover_img:'https://t9.9026.com/imgs/44.png',
|
|
|
- name:'2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
+ cover_img: 'https://t9.9026.com/imgs/44.png',
|
|
|
+ name: '2023新春福兔系列礼盒 倾心甄选 待你拥有'
|
|
|
},
|
|
|
],
|
|
|
status: 'noMore',
|
| xqd
@@ -292,10 +282,10 @@
|
|
|
navList: [],
|
|
|
//活动专区
|
|
|
specialList: [],
|
|
|
- isDevelopment:false,
|
|
|
+ isDevelopment: false,
|
|
|
}
|
|
|
},
|
|
|
- onTabItemTap(e){
|
|
|
+ onTabItemTap(e) {
|
|
|
console.log(e)
|
|
|
},
|
|
|
// 下拉刷新
|
| xqd
@@ -319,17 +309,13 @@
|
|
|
this.getGoodsList()
|
|
|
this.getAllSet()
|
|
|
// this.isDevelopment = process.env.NODE_ENV === 'development';
|
|
|
- this.isDevelopment = true;
|
|
|
- //用户访问
|
|
|
- this.getUserVisits()
|
|
|
-
|
|
|
- // uni.navigateTo({
|
|
|
- // url: "/pages/goods/goods-lucky/index"
|
|
|
- // })
|
|
|
+ // this.isDevelopment = true;
|
|
|
+
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
// **************** Data ***************//
|
|
|
+
|
|
|
//获取配置数据
|
|
|
getAllSet() {
|
|
|
this.$api.document.allSet().then(res => {
|
| xqd
@@ -337,7 +323,7 @@
|
|
|
this.infoList = this.$store.getters.allset.banners
|
|
|
this.navList = this.$store.getters.allset.nav_icon
|
|
|
this.info = this.$store.getters.allset.partner
|
|
|
-
|
|
|
+
|
|
|
//广告图
|
|
|
this.advertis = this.$store.getters.allset.advertises.filter(item => {
|
|
|
return item.in_page == 1
|
| xqd
@@ -362,8 +348,8 @@
|
|
|
//广告弹框图
|
|
|
this.popupData = this.$store.getters.allset.popup_ads[0]
|
|
|
//弹窗是否展示
|
|
|
- this.popupImgStatus = this.popupData?.status
|
|
|
- this.times_type = this.popupData?.times_type
|
|
|
+ this.popupImgStatus = this.popupData?.status
|
|
|
+ this.times_type = this.popupData?.times_type
|
|
|
//广告弹框跳转h5和小程序和内部
|
|
|
this.jump_type = this.popupData?.jump_type,
|
|
|
this.jump_config = this.popupData?.jump_config
|
| xqd
@@ -389,19 +375,19 @@
|
|
|
type: 1,
|
|
|
page: 0,
|
|
|
}).then(res => {
|
|
|
- this.goodsList = res.data.data.slice(0,4)
|
|
|
+ this.goodsList = res.data.data.slice(0, 4)
|
|
|
this.shortLong()
|
|
|
- console.log(this.goodsList,'------>产品图');
|
|
|
+ console.log(this.goodsList, '------>产品图');
|
|
|
})
|
|
|
},
|
|
|
//产品详情
|
|
|
- produceDetail(id){
|
|
|
-
|
|
|
+ produceDetail(id) {
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
- url:`/pages/goods/goods-detail/index?id=${id}&type=1`
|
|
|
+ url: `/pages/goods/goods-detail/index?id=${id}&type=1`
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// **************** Dev ***************//
|
|
|
shortLong() {
|
|
|
this.goodsList.forEach((item, index, arr) => {
|
| xqd
@@ -426,10 +412,10 @@
|
|
|
},
|
|
|
//打开弹框
|
|
|
open() {
|
|
|
- console.log(this.popupImgStatus,this.times_type);
|
|
|
+ console.log(this.popupImgStatus, this.times_type);
|
|
|
// 从本地缓存中同步获取指定 key 对应的内容,用于判断是否是第一次打开应用
|
|
|
- if(this.popupImgStatus == 1){
|
|
|
- if(this.times_type == 1){
|
|
|
+ if (this.popupImgStatus == 1) {
|
|
|
+ if (this.times_type == 1) {
|
|
|
//首次进入弹窗
|
|
|
const value = uni.getStorageSync('launchFlag');
|
|
|
if (value) {
|
| xqd
@@ -442,11 +428,11 @@
|
|
|
});
|
|
|
this.$refs.popup.open('center')
|
|
|
}
|
|
|
- }else{
|
|
|
- this.$refs.popup.open('center')//每次都弹
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.$refs.popup.close()//不显示广告弹框
|
|
|
+ } else {
|
|
|
+ this.$refs.popup.open('center') //每次都弹
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$refs.popup.close() //不显示广告弹框
|
|
|
}
|
|
|
},
|
|
|
//关闭弹框
|
| xqd
@@ -524,19 +510,19 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
//获取当前页面路径
|
|
|
getPageUrl() {
|
|
|
const pages = getCurrentPages();
|
|
|
- console.log(pages,'--------->pages')
|
|
|
- if(pages.length==1){
|
|
|
+ console.log(pages, '--------->pages')
|
|
|
+ if (pages.length == 1) {
|
|
|
const currentPage = pages[0];
|
|
|
let pageUrl = `/${currentPage.route}`;
|
|
|
return pageUrl
|
|
|
console.log('当前页面url:', pageUrl);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
const currentPage = pages[pages.length - 1];
|
|
|
let pageUrl = `/${currentPage.route}`;
|
|
|
return pageUrl
|
| xqd
@@ -568,7 +554,7 @@
|
|
|
}).then(res => {
|
|
|
console.log(res.data);
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
// 打开成功
|
|
|
},
|
|
|
fail(e) {
|
| xqd
@@ -576,18 +562,18 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//用户访问
|
|
|
- getUserVisits(){
|
|
|
+ getUserVisits() {
|
|
|
this.$api.my.userVisits({
|
|
|
- page:'/pages/index/index'
|
|
|
- }).then(res=>{
|
|
|
+ page: '/pages/index/index'
|
|
|
+ }).then(res => {
|
|
|
console.log(res.data);
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//跳转方法
|
|
|
// jumpHAppID(id, urls) {
|
|
|
// if (id == 1) {
|
| xqd
@@ -631,10 +617,31 @@
|
|
|
// })
|
|
|
// }
|
|
|
// },
|
|
|
- goToProduct(id){
|
|
|
- uni.navigateTo({
|
|
|
- url:`/pages/goods/goods-detail/index?id=${id}&type=1`
|
|
|
- })
|
|
|
+
|
|
|
+ //查看更多商品
|
|
|
+ geMore() {
|
|
|
+ if (this.admin == undefined) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/goods/goods'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //跳转产品详情
|
|
|
+ goToProduct(id) {
|
|
|
+ if (this.admin == undefined) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/goods/goods-detail/index?id=${id}&type=1`
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
//产品列表
|
|
|
goProduceList() {
|