|
@@ -18,12 +18,11 @@
|
|
|
</swiper>
|
|
</swiper>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 公告-end -->
|
|
<!-- 公告-end -->
|
|
|
-
|
|
|
|
|
<!-- 专区入口 -->
|
|
<!-- 专区入口 -->
|
|
|
<div class="l_tabBar flex_r flex_jb">
|
|
<div class="l_tabBar flex_r flex_jb">
|
|
|
<div class="search-box flex_r flex_jb flex_ac">
|
|
<div class="search-box flex_r flex_jb flex_ac">
|
|
|
- <div class="district">
|
|
|
|
|
- <span>深圳</span>
|
|
|
|
|
|
|
+ <div class="district" @click="showAddress = !showAddress">
|
|
|
|
|
+ <span>{{ LocationCity }}</span>
|
|
|
<span class="iconfont"></span>
|
|
<span class="iconfont"></span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="search flex_r flex_jb flex_ac">
|
|
<div class="search flex_r flex_jb flex_ac">
|
|
@@ -31,15 +30,14 @@
|
|
|
<input v-model="searchKey" @confirm="toSearch" class="inp" placeholder="搜索你要的内容">
|
|
<input v-model="searchKey" @confirm="toSearch" class="inp" placeholder="搜索你要的内容">
|
|
|
<span class="search_btn" @click="toSearch">搜索</span>
|
|
<span class="search_btn" @click="toSearch">搜索</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="scan-ico iconfont"></div>
|
|
|
|
|
|
|
+ <!-- <div class="scan-ico iconfont"></div> -->
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="item" v-for="(i,s) in tabs" :key="s" @click="isActivation(i.url)">
|
|
|
|
|
|
|
+ <div class="item" v-for="(i,s) in tabs" :key="s" @click="goto(i.url)">
|
|
|
<img :src="i.ico" alt="" class="ico">
|
|
<img :src="i.ico" alt="" class="ico">
|
|
|
<!-- <div class="tit">{{ i.tit }}</div> -->
|
|
<!-- <div class="tit">{{ i.tit }}</div> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 专区-end -->
|
|
<!-- 专区-end -->
|
|
|
-
|
|
|
|
|
<!-- 活动 -->
|
|
<!-- 活动 -->
|
|
|
<view class="activity" v-if="homeImg.length">
|
|
<view class="activity" v-if="homeImg.length">
|
|
|
<image class="act_img act_one_img" :src="homeImg[0].image" @click="setPageUrl({ type: 4 })" mode=""></image>
|
|
<image class="act_img act_one_img" :src="homeImg[0].image" @click="setPageUrl({ type: 4 })" mode=""></image>
|
|
@@ -50,14 +48,12 @@
|
|
|
</view>
|
|
</view>
|
|
|
<!-- 活动-end -->
|
|
<!-- 活动-end -->
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
<view class="bou_head flex_r flex_ac flex_jc">
|
|
<view class="bou_head flex_r flex_ac flex_jc">
|
|
|
<image class="bou_img" src="/static/sgin/left.png" mode=""></image>
|
|
<image class="bou_img" src="/static/sgin/left.png" mode=""></image>
|
|
|
<view class="bou_title">今日推荐</view>
|
|
<view class="bou_title">今日推荐</view>
|
|
|
<image class="bou_img" src="/static/sgin/right.png" mode=""></image>
|
|
<image class="bou_img" src="/static/sgin/right.png" mode=""></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="list_bar">
|
|
<view class="list_bar">
|
|
|
- <!-- <div class="tit">猜你喜欢</div> -->
|
|
|
|
|
<view class="product-list">
|
|
<view class="product-list">
|
|
|
<view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
|
|
<view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
|
|
|
<view class="image-view">
|
|
<view class="image-view">
|
|
@@ -89,41 +85,45 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="fz_w_text">让数字经济赋能美好生活!</view>
|
|
<view class="fz_w_text">让数字经济赋能美好生活!</view>
|
|
|
- <xh-privacy title="隐私保护指引" color="#18bb88"></xh-privacy>
|
|
|
|
|
- <activation ref="activation" tit="激活" :close="isActivation"/>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <!-- 隐私指引 -->
|
|
|
|
|
+ <xh-privacy title="隐私保护指引" color="#18bb88"></xh-privacy>
|
|
|
|
|
+ <!-- 城市选择 -->
|
|
|
|
|
+ <h-address @select="selectaddress" :visible.sync="showAddress" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
|
|
import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
|
|
|
-import activation from "@/components/activation/activation.vue";
|
|
|
|
|
-import xhPrivacy from "@/components/xh-privacy/xh-privacy.vue";
|
|
|
|
|
|
|
+import xhPrivacy from "@/components/xh-privacy/xh-privacy.vue"; //隐私保护指引
|
|
|
|
|
+import hAddress from "@/components/h-address/address.vue"; //城市选择
|
|
|
|
|
+import tabs from '@/static/js/tabs' //专区入口
|
|
|
import { post } from "@/request/api.js";
|
|
import { post } from "@/request/api.js";
|
|
|
-import tabs from '@/pages/orderingfood/tabs.js'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "Appindex",
|
|
name: "Appindex",
|
|
|
components: {
|
|
components: {
|
|
|
swiperBanner, //轮播
|
|
swiperBanner, //轮播
|
|
|
- activation,
|
|
|
|
|
- xhPrivacy
|
|
|
|
|
|
|
+ xhPrivacy,
|
|
|
|
|
+ hAddress
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- BannerImg: [], // 轮播图列表
|
|
|
|
|
- not_list: [], // 公告列表
|
|
|
|
|
- homeImg: "", //活动列表
|
|
|
|
|
|
|
+ BannerImg: [], // 轮播图列表
|
|
|
|
|
+ not_list: [], // 公告列表
|
|
|
|
|
+ homeImg: "", //活动列表
|
|
|
productList: [], //商品数据
|
|
productList: [], //商品数据
|
|
|
searchKey: "", //搜索关键词
|
|
searchKey: "", //搜索关键词
|
|
|
|
|
+ LocationCity: "深圳",
|
|
|
|
|
+ showAddress: false,
|
|
|
tabs
|
|
tabs
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- onLoad(option) {},
|
|
|
|
|
- onLaunch() {},
|
|
|
|
|
|
|
+ onLoad(option) {
|
|
|
|
|
+ this.getToCity()
|
|
|
|
|
+ },
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.loadData();
|
|
this.loadData();
|
|
|
this.getBanner(); //获取轮播图
|
|
this.getBanner(); //获取轮播图
|
|
|
this.getAnnounce(); //获取公告列表
|
|
this.getAnnounce(); //获取公告列表
|
|
|
- this.gethomeImg(); //活动列表
|
|
|
|
|
|
|
+ this.gethomeImg(); //活动列表
|
|
|
},
|
|
},
|
|
|
onHide() {},
|
|
onHide() {},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -175,44 +175,31 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 轮播图跳转
|
|
// 轮播图跳转
|
|
|
goList(e) {},
|
|
goList(e) {},
|
|
|
- goVipGift(){
|
|
|
|
|
|
|
+ goVipGift() {
|
|
|
this.goto("/pages/product/productRetail", { type: 4, is_vip: 1 });
|
|
this.goto("/pages/product/productRetail", { type: 4, is_vip: 1 });
|
|
|
},
|
|
},
|
|
|
- toSearch(){
|
|
|
|
|
|
|
+ // 搜索
|
|
|
|
|
+ toSearch() {
|
|
|
this.goto("/pagesC/settledMerchant/index", { key: this.searchKey });
|
|
this.goto("/pagesC/settledMerchant/index", { key: this.searchKey });
|
|
|
},
|
|
},
|
|
|
- // 是否激活数智生活
|
|
|
|
|
- isActivation(url) {
|
|
|
|
|
- uni.Location();
|
|
|
|
|
- post("local/isActivation").then(res => {
|
|
|
|
|
- if (res.code === 0) {
|
|
|
|
|
- this.goto(url)
|
|
|
|
|
- // uni.Luserfun()
|
|
|
|
|
- } else if (res.code == -1) {
|
|
|
|
|
- this.$toast("请先登录或注册!");
|
|
|
|
|
- // this.activation();
|
|
|
|
|
|
|
+ // 获取当前城市
|
|
|
|
|
+ async getToCity() {
|
|
|
|
|
+ let { lat, lng } = await uni.Location();
|
|
|
|
|
+ post("local/hotel/city", { longitude: lng, latitude: lat }).then(res => {
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ let da = res.data
|
|
|
|
|
+ this.LocationCity = da.cityName;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- // 打开激活弹窗
|
|
|
|
|
- activation(){
|
|
|
|
|
- this.$refs.activation.open()
|
|
|
|
|
|
|
+ // 选择城市
|
|
|
|
|
+ selectaddress(da) {
|
|
|
|
|
+ this.LocationCity = da.cityName;
|
|
|
|
|
+ this.showAddress = false;
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
watch: {},
|
|
watch: {},
|
|
|
- onShareAppMessage() {
|
|
|
|
|
- let userinfo = uni.getStorageSync("userinfo");
|
|
|
|
|
- var path = "/pages/index/index";
|
|
|
|
|
- if (userinfo.invite) {
|
|
|
|
|
- path = "/pages/index/index?invite=" + userinfo.invite;
|
|
|
|
|
- }
|
|
|
|
|
- var title = `让数字经济赋能美好生活!`;
|
|
|
|
|
- return {
|
|
|
|
|
- title: title,
|
|
|
|
|
- path: path,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang='scss'>
|
|
<style scoped lang='scss'>
|
|
@@ -285,33 +272,41 @@ export default {
|
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
|
box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
|
|
box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
- .search-box{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .search-box {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
padding: 10rpx;
|
|
padding: 10rpx;
|
|
|
margin-bottom: 12rpx;
|
|
margin-bottom: 12rpx;
|
|
|
- .district{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .district {
|
|
|
font-size: 32rpx;
|
|
font-size: 32rpx;
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
color: #333;
|
|
color: #333;
|
|
|
- .iconfont{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .iconfont {
|
|
|
font-size: 20rpx;
|
|
font-size: 20rpx;
|
|
|
margin-left: 12rpx;
|
|
margin-left: 12rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .search{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .search {
|
|
|
border: 1px solid #D78C2E;
|
|
border: 1px solid #D78C2E;
|
|
|
height: 60rpx;
|
|
height: 60rpx;
|
|
|
line-height: 60rpx;
|
|
line-height: 60rpx;
|
|
|
padding-left: 20rpx;
|
|
padding-left: 20rpx;
|
|
|
border-radius: 31rpx;
|
|
border-radius: 31rpx;
|
|
|
- .iconfont{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .iconfont {
|
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
|
}
|
|
}
|
|
|
- .inp{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .inp {
|
|
|
font-size: 25rpx;
|
|
font-size: 25rpx;
|
|
|
padding: 0 8rpx;
|
|
padding: 0 8rpx;
|
|
|
|
|
+ width: 300rpx;
|
|
|
}
|
|
}
|
|
|
- .search_btn{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .search_btn {
|
|
|
background-color: #D78C2E;
|
|
background-color: #D78C2E;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -320,7 +315,8 @@ export default {
|
|
|
padding: 0 28rpx;
|
|
padding: 0 28rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .scan-ico{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .scan-ico {
|
|
|
font-size: 55rpx;
|
|
font-size: 55rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -482,7 +478,8 @@ export default {
|
|
|
margin-right: 6rpx;
|
|
margin-right: 6rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .product-price-msg{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .product-price-msg {
|
|
|
font-size: 20rpx;
|
|
font-size: 20rpx;
|
|
|
color: #ff6d44;
|
|
color: #ff6d44;
|
|
|
}
|
|
}
|