|
|
|
@ -1,174 +1,190 @@ |
|
|
|
|
<template> |
|
|
|
|
<view> |
|
|
|
|
<!-- 状态栏 --> |
|
|
|
|
<view v-if="showHeader && !isdisplay" class="status" |
|
|
|
|
:style="{ position: headerPosition,top:statusTop,opacity: afterHeaderOpacity}"></view> |
|
|
|
|
<!-- 顶部导航栏 --> |
|
|
|
|
<view v-if="showHeader && !isdisplay" class="header" |
|
|
|
|
:style="{ position: headerPosition,top:headerTop,opacity: afterHeaderOpacity }"> |
|
|
|
|
<!-- 定位城市 --> |
|
|
|
|
<view class="addr" @click="goPostion"> |
|
|
|
|
<!-- <view class="icon location"></view> --> |
|
|
|
|
{{ city }} |
|
|
|
|
<image mode="widthFix" style="width: 15px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
|
</view> |
|
|
|
|
<!-- 搜索框 --> |
|
|
|
|
<view class="input-box"> |
|
|
|
|
<input placeholder="搜索门店" placeholder-style="color:#c0c0c0;" @tap="toSearch()" /> |
|
|
|
|
<view class="icon search"></view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 右侧图标按钮 --> |
|
|
|
|
<view class="icon-btn"> |
|
|
|
|
<!-- #ifdef MP--> |
|
|
|
|
<button open-type="contact" style="background-color: transparent;padding: 0px;"> |
|
|
|
|
<image src="../../../static/img/home/cusser.png" mode="widthFix" class="icon30"></image> |
|
|
|
|
</button> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
<!-- #ifdef H5--> |
|
|
|
|
<image :src="imagewxUrl+imgadres4" mode="widthFix" style="background-color: transparent;padding: 0px;" |
|
|
|
|
class="h5xfimg" @click="playPhone"></image> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view v-if="isdisplay"> |
|
|
|
|
<image :src="imagewxUrl+imgadres5" class="widthw30 mart110" mode="widthFix"></image> |
|
|
|
|
<view v-if="!isdisplay" :style="{height:StatusBar,backgroundColor: bgColor}" class="status"> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 顶部菜单 --> |
|
|
|
|
<view v-for="(item,index) in homeCateList" :key="index" style="margin-top: -2px;"> |
|
|
|
|
<view class="height90 backcorltop mart50" v-if="item.type == 1"> |
|
|
|
|
<view class="category-list"> |
|
|
|
|
<view class="category" style="width: 25%;" v-for="(row, indexs) in item.childCategory" :key="indexs" |
|
|
|
|
@click="toCategory(row)"> |
|
|
|
|
<view class="img"> |
|
|
|
|
<image :src="imageUrl+row.imgData"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="text fcorfff">{{ row.title }}</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="" :style="{paddingTop:StatusBar,position:'relative',}"> |
|
|
|
|
|
|
|
|
|
<!-- 定位城市 position:'relative' ,top:StatusBar,--> |
|
|
|
|
<view v-if="!isdisplay" class="city-con dis-flex padleft15" :style="{ height:CustomBar+'px', }"> |
|
|
|
|
<view class="addr" @click="goPostion"> |
|
|
|
|
{{ city }} |
|
|
|
|
<image mode="aspectFit" style="width: 15px;height: 15px;" :src="imagewxUrl+imgadres2"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 顶部活动图片 --> |
|
|
|
|
<image class="width100" mode="widthFix" :src="imagewxUrl+imgadres" v-if="item.type == 8"></image> |
|
|
|
|
|
|
|
|
|
<!-- 顶部菜单 --> |
|
|
|
|
<view class="category-list backcorfff" style="margin-top: -7px;" v-if="item.type == 7"> |
|
|
|
|
<view class="category" style="width: 20%;" v-for="(row, indexc) in item.childCategory" :key="indexc" |
|
|
|
|
@click="toCategory(row)"> |
|
|
|
|
<view class="img"> |
|
|
|
|
<image :src="imageUrl+row.imgData"></image> |
|
|
|
|
|
|
|
|
|
<!-- 顶部导航栏 --> |
|
|
|
|
<view v-if="!isdisplay" class="header" |
|
|
|
|
:style="{ position: 'sticky',top:StatusBar,height:Number(CustomBar + 5) +'px',backgroundColor: bgColor,}"> |
|
|
|
|
|
|
|
|
|
<view :style="{width:width}" class="header-chid"> |
|
|
|
|
<view class="input-box"> |
|
|
|
|
<input placeholder="搜索门店" placeholder-style="color:#c0c0c0;" @tap="toSearch()" /> |
|
|
|
|
<view class="icon search"></view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="icon-btn"> |
|
|
|
|
<!-- #ifdef MP--> |
|
|
|
|
<button open-type="contact" style="background-color: transparent;padding: 0px;"> |
|
|
|
|
<image src="../../../static/img/home/cusser.png" mode="aspectFit" class="icon30" |
|
|
|
|
style="height: 30px;"></image> |
|
|
|
|
</button> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
<!-- #ifdef H5--> |
|
|
|
|
<image :src="imagewxUrl+imgadres4" mode="widthFix" |
|
|
|
|
style="background-color: transparent;padding: 0px;" class="h5xfimg" @click="playPhone"> |
|
|
|
|
</image> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
</view> |
|
|
|
|
<view class="text fcor333">{{ row.title }}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 消息 --> |
|
|
|
|
<view class="height120 backcorfff" v-if="item.type == 3"> |
|
|
|
|
<view class="height20 width100"></view> |
|
|
|
|
<view class="width92 message alijus"> |
|
|
|
|
<view class="width100 alijus" style="margin-top: -20px;" @click="test(0)" |
|
|
|
|
v-if="item.childDate.length == 1"> |
|
|
|
|
<view class="width80p paddleft10 alijusstart"> |
|
|
|
|
<view class="stus"></view> |
|
|
|
|
<view class="paddleft10 font14 fcor666 text1 width70"> |
|
|
|
|
{{item.childDate[0].title}} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view v-if="isdisplay"> |
|
|
|
|
<image :src="imagewxUrl+imgadres5" class="widthw30 mart110" mode="widthFix"></image> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view v-for="(item,index) in homeCateList" :key="index" style=""> |
|
|
|
|
<!-- 顶部菜单 --> |
|
|
|
|
<view class=" backcorltop " v-if="item.type == 1"> |
|
|
|
|
<view class="category-list "> |
|
|
|
|
<view class="category margb40upx" style="width: 25%;" v-for="(row, indexs) in item.childCategory" |
|
|
|
|
:key="indexs" @click="toCategory(row)"> |
|
|
|
|
<view class="img"> |
|
|
|
|
<image class="verc" :src="imageUrl+row.imgData"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="width25 font13 fcor999">{{item.childDate[0].timeData}}</view> |
|
|
|
|
<view class="text fcorfff">{{ row.title }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 alijus"> |
|
|
|
|
<image class="icon15" mode="widthFix" src="../../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 顶部活动图片 --> |
|
|
|
|
<image class="width100 verc backcolorfff" style="min-height: 90px;" mode="widthFix" :src="imagewxUrl+imgadres" v-if="item.type == 8"></image> |
|
|
|
|
|
|
|
|
|
<!-- 中间菜单 --> |
|
|
|
|
<view class="category-list pdb40upx backcorfff" style="" v-if="item.type == 7"> |
|
|
|
|
<view class="category" style="width: 20%;" v-for="(row, indexc) in item.childCategory" :key="indexc" |
|
|
|
|
@click="toCategory(row)"> |
|
|
|
|
<view class="img"> |
|
|
|
|
<image class="verc" mode="aspectFit" :src="imageUrl+row.imgData"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="text fcor333">{{ row.title }}</view> |
|
|
|
|
</view> |
|
|
|
|
<swiper v-else circular="true" autoplay="true" display-multiple-items="2" :vertical="true"> |
|
|
|
|
<swiper-item class="alijus" v-for="(swipers,index) in item.childDate" :key="swipers.id" |
|
|
|
|
@click="test(index)"> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 消息 --> |
|
|
|
|
<view class="height120 backcorfff" v-if="item.type == 3"> |
|
|
|
|
<view class="height20 width100"></view> |
|
|
|
|
<view class="width92 message alijus"> |
|
|
|
|
<view class="width100 alijus" style="margin-top: -20px;" @click="test(0)" |
|
|
|
|
v-if="item.childDate.length == 1"> |
|
|
|
|
<view class="width80p paddleft10 alijusstart"> |
|
|
|
|
<view class="stus"></view> |
|
|
|
|
<view class="paddleft10 font14 fcor666 text1 width70"> |
|
|
|
|
{{swipers.title}} |
|
|
|
|
{{item.childDate[0].title}} |
|
|
|
|
</view> |
|
|
|
|
<view class="width25 font13 fcor999">{{swipers.timeData}}</view> |
|
|
|
|
<view class="width25 font13 fcor999">{{item.childDate[0].timeData}}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 alijus"> |
|
|
|
|
<image class="icon15" mode="widthFix" src="../../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
</view> |
|
|
|
|
<swiper v-else circular="true" autoplay="true" display-multiple-items="2" :vertical="true"> |
|
|
|
|
<swiper-item class="alijus" v-for="(swipers,index) in item.childDate" :key="swipers.id" |
|
|
|
|
@click="test(index)"> |
|
|
|
|
<view class="width80p paddleft10 alijusstart"> |
|
|
|
|
<view class="stus"></view> |
|
|
|
|
<view class="paddleft10 font14 fcor666 text1 width70"> |
|
|
|
|
{{swipers.title}} |
|
|
|
|
</view> |
|
|
|
|
<view class="width25 font13 fcor999">{{swipers.timeData}}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width20 alijus"> |
|
|
|
|
<image class="icon15" mode="widthFix" src="../../../static/img/jt.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 轮播图 --> |
|
|
|
|
<view class="swiper mart20" v-if="item.type == 2"> |
|
|
|
|
<view class="swiper-box"> |
|
|
|
|
<swiper circular="true" autoplay="true" @change="swiperChange"> |
|
|
|
|
<swiper-item v-for="swiper in item.childCategory" :key="swiper.id"> |
|
|
|
|
<image :src="imageUrl+swiper.imgData" @click="jumplottery(swiper)"></image> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
<!-- 轮播图 --> |
|
|
|
|
<view class="swiper mart20" v-if="item.type == 2"> |
|
|
|
|
<view class="swiper-box"> |
|
|
|
|
<swiper circular="true" autoplay="true" @change="swiperChange"> |
|
|
|
|
<swiper-item v-for="swiper in item.childCategory" :key="swiper.id"> |
|
|
|
|
<image :src="imageUrl+swiper.imgData" @click="jumplottery(swiper)"></image> |
|
|
|
|
</swiper-item> |
|
|
|
|
</swiper> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 加油专区 ,天天好券--> |
|
|
|
|
<view class="width90 mart20 alijusstart" v-if="item.type == 6 || item.type == 9" |
|
|
|
|
@click="goGoodsList(item.jumpUrl)"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
{{item.name}} |
|
|
|
|
<!-- 加油专区 ,天天好券--> |
|
|
|
|
<view class="width90 mart20 alijusstart" v-if="item.type == 6 || item.type == 9" |
|
|
|
|
@click="goGoodsList(item.jumpUrl)"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
{{item.name}} |
|
|
|
|
</view> |
|
|
|
|
<view class="width30 font14 fotrt fcor666">更多<text class="icon-ymt to-right fcor666 font14"></text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width30 font14 fotrt fcor666">更多<text class="icon-ymt to-right fcor666 font14"></text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 alijusnostart mart20" v-if="item.type == 6 "> |
|
|
|
|
<view class="backcorfff spcarea border-r" v-for="(goods,index1) in item.childDate" :key="index1" |
|
|
|
|
@click="toGoods(item.detailJumpUrl,goods.id)"> |
|
|
|
|
<image mode="widthFix" class="width100" style="border-radius: 5px; 5px 0 0" |
|
|
|
|
:src="imageUrl+goods.couponImg"></image> |
|
|
|
|
<view class="width96 fcor333 font15 fontwig6">{{goods.couponName}}</view> |
|
|
|
|
<!-- <view class="width96 fcor999 font11">{{goods.salesEndTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} |
|
|
|
|
</view> --> |
|
|
|
|
<view class="width94 fcoreb5 font15 fontwig6">¥{{goods.salesPrice}}</view> |
|
|
|
|
<view class="width94 alijusnostart mart20" v-if="item.type == 6 "> |
|
|
|
|
<view class="backcorfff spcarea border-r" v-for="(goods,index1) in item.childDate" :key="index1" |
|
|
|
|
@click="toGoods(item.detailJumpUrl,goods.id)"> |
|
|
|
|
<image mode="aspectFill" class="width100" style="border-radius: 5px 5px 0 0;height: 100px;" |
|
|
|
|
:src="imageUrl+goods.couponImg"></image> |
|
|
|
|
<view class="width96 fcor333 font15 fontwig6">{{goods.couponName}}</view> |
|
|
|
|
<view class="width94 fcoreb5 font15 fontwig6">¥{{goods.salesPrice}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="width94 alijusnostart mart20" v-if="item.type == 9 "> |
|
|
|
|
<view class="backcorfff spcarea border-r" v-for="(goods,index2) in item.childDate" :key="index2" |
|
|
|
|
@click="toGoods(item.detailJumpUrl,goods.id)"> |
|
|
|
|
<image mode="widthFix" class="width100" style="border-radius: 5px; 5px 0 0" |
|
|
|
|
:src="imageUrl+goods.listImg"></image> |
|
|
|
|
<view class="width96 fcor333 font15 fontwig6">{{goods.title}}</view> |
|
|
|
|
<!-- <view class="width96 fcor999 font11" v-if="goods.effectiveTiem"> |
|
|
|
|
{{goods.effectiveTiem | timeFormat('yyyy-mm-dd hh:mm:ss')}} |
|
|
|
|
</view> --> |
|
|
|
|
<view class="width94 fcoreb5 font15 fontwig6">¥{{goods.price}}</view> |
|
|
|
|
<view class="width94 alijusnostart mart20" v-if="item.type == 9 "> |
|
|
|
|
<view class="backcorfff spcarea border-r" v-for="(goods,index2) in item.childDate" :key="index2" |
|
|
|
|
@click="toGoods(item.detailJumpUrl,goods.id)"> |
|
|
|
|
<image mode="widthFix" class="width100" style="border-radius: 5px; 5px 0 0" |
|
|
|
|
:src="imageUrl+goods.listImg"></image> |
|
|
|
|
<view class="width96 fcor333 font15 fontwig6">{{goods.title}}</view> |
|
|
|
|
<view class="width94 fcoreb5 font15 fontwig6">¥{{goods.price}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 大图 --> |
|
|
|
|
<view class="width90 mart20 alijusstart" v-if="item.type == 4" @click="goGoodsList(item.jumpUrl)"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
{{item.name}} |
|
|
|
|
<!-- 大图 --> |
|
|
|
|
<view class="width90 mart10 alijusstart" v-if="item.type == 4" @click="goGoodsList(item.jumpUrl)"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
{{item.name || ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<image class="width90 mart10" mode="widthFix" v-if="item.type == 4" |
|
|
|
|
:src="imageUrl+item.childCategory[0].imgData" @click="goGoodsList(item.childCategory[0].jumpUrl)"> |
|
|
|
|
</image> |
|
|
|
|
<!-- 惠享生活 --> |
|
|
|
|
<view class="width90 mart20 alijusstart" v-if="item.type == 5"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
惠享生活 |
|
|
|
|
<image class="width90 mart10" mode="widthFix" style="min-height: 123px;border-radius: 15rpx;" v-if="item.type == 4" |
|
|
|
|
:src="imageUrl+item.childCategory[0].imgData" @click="goGoodsList(item.childCategory[0].jumpUrl)"> |
|
|
|
|
</image> |
|
|
|
|
<!-- 惠享生活 --> |
|
|
|
|
<view class="width90 mart20 alijusstart" v-if="item.type == 5"> |
|
|
|
|
<view class="width70 font18 fcor333"> |
|
|
|
|
惠享生活 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<image class="width90 mart10" mode="widthFix" v-if="item.type == 5" |
|
|
|
|
:src="imageUrl+item.childCategory[0].imgData" @click="goGoodsList(item.childCategory[0].jumpUrl)"> |
|
|
|
|
</image> |
|
|
|
|
<view class="width90 alijusstart mart10" v-if="item.type == 5"> |
|
|
|
|
<image :src="imageUrl+item.childCategory[1].imgData" mode="widthFix" style="min-height: 100px;" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[1].jumpUrl)"></image> |
|
|
|
|
<image :src="imageUrl+item.childCategory[2].imgData" mode="widthFix" style="min-height: 100px;" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[2].jumpUrl)"></image> |
|
|
|
|
<image :src="imageUrl+item.childCategory[3].imgData" mode="widthFix" style="min-height: 100px;" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[3].jumpUrl)"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<image class="width90 mart10" mode="widthFix" v-if="item.type == 5" |
|
|
|
|
:src="imageUrl+item.childCategory[0].imgData" @click="goGoodsList(item.childCategory[0].jumpUrl)"> |
|
|
|
|
</image> |
|
|
|
|
<view class="width90 alijusstart mart10" v-if="item.type == 5"> |
|
|
|
|
<image :src="imageUrl+item.childCategory[1].imgData" mode="widthFix" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[1].jumpUrl)"></image> |
|
|
|
|
<image :src="imageUrl+item.childCategory[2].imgData" mode="widthFix" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[2].jumpUrl)"></image> |
|
|
|
|
<image :src="imageUrl+item.childCategory[3].imgData" mode="widthFix" class="width31" |
|
|
|
|
@click="goGoodsList(item.childCategory[3].jumpUrl)"></image> |
|
|
|
|
</view> |
|
|
|
|
<!-- 弹窗 --> |
|
|
|
|
<wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true"> |
|
|
|
|
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image> |
|
|
|
|
</wybPopup> |
|
|
|
|
<view class="height40"></view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<!-- 弹窗 --> |
|
|
|
|
<wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6" :showCloseIcon="true"> |
|
|
|
|
<image class="popImg" :src="imageUrl+imgadres3" @click="jumpWeb"></image> |
|
|
|
|
</wybPopup> |
|
|
|
|
<view class="height40"></view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -188,11 +204,11 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
showHeader: true, |
|
|
|
|
// showHeader: true, |
|
|
|
|
isShowAuth: false, |
|
|
|
|
afterHeaderOpacity: 1, //不透明度 |
|
|
|
|
headerPosition: 'fixed', |
|
|
|
|
headerTop: null, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
statusTop: null, |
|
|
|
|
nVueTitle: null, |
|
|
|
|
city: '', |
|
|
|
@ -215,7 +231,16 @@ |
|
|
|
|
//切换状态 |
|
|
|
|
jumpType: '', |
|
|
|
|
locationRef: null, // 用于接收定位对象 |
|
|
|
|
isdisplay: true //是否展示 |
|
|
|
|
isdisplay: true, //是否展示 |
|
|
|
|
|
|
|
|
|
StatusBar: this.StatusBar + 'px', |
|
|
|
|
Custom: this.Custom, |
|
|
|
|
width: '100%', |
|
|
|
|
CustomBar: this.CustomBar, |
|
|
|
|
bgColor: '#3da7e7', |
|
|
|
|
// dhTop:Number(this.StatusBar+this.CustomBar)+'px' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -228,6 +253,16 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onPageScroll(obj) { |
|
|
|
|
// console.log(obj,"obj") |
|
|
|
|
if (obj.scrollTop >= this.CustomBar) { |
|
|
|
|
this.width = this.Custom.left + 'px'; |
|
|
|
|
this.bgColor = "#089bf5"; |
|
|
|
|
} else { |
|
|
|
|
this.width = "100%"; |
|
|
|
|
this.bgColor = "#3da7e7"; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
let that = this; |
|
|
|
|
// #ifdef MP |
|
|
|
@ -247,63 +282,10 @@ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
//定位 |
|
|
|
|
that.postionIng(); |
|
|
|
|
// #endif |
|
|
|
|
// #ifdef H5 |
|
|
|
|
//定位 |
|
|
|
|
that.postionIng(); |
|
|
|
|
// if (app.globalData.h5code) { |
|
|
|
|
// that.getH5AccessToken(); |
|
|
|
|
// } |
|
|
|
|
// uni.showLoading({ |
|
|
|
|
// title: '加载中' |
|
|
|
|
// }) |
|
|
|
|
// var geolocation = new qq.maps.Geolocation('7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', "嗨森逛"); |
|
|
|
|
// 回调的第一次参数为成功后具体的位置信息 |
|
|
|
|
// geolocation.getLocation( |
|
|
|
|
// res => { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// app.globalData.latitude = res.lat; |
|
|
|
|
// app.globalData.longitude = res.lng; |
|
|
|
|
|
|
|
|
|
// uni.setStorage({ |
|
|
|
|
// key: "latitude", |
|
|
|
|
// data: res.lat |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
// uni.setStorage({ |
|
|
|
|
// key: "longitude", |
|
|
|
|
// data: res.lng |
|
|
|
|
// }) |
|
|
|
|
// that.findByLatAndLng(res.lng, res.lat); |
|
|
|
|
// }, |
|
|
|
|
// err => { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// uni.showModal({ |
|
|
|
|
// title: '获取定位权限失败,默认城市重庆市', |
|
|
|
|
// content: '请确定手机定位已打开,并且当前浏览器允许获取定位,都开启后请刷新页面。' |
|
|
|
|
// }) |
|
|
|
|
// that.city = '重庆市'; |
|
|
|
|
// app.globalData.cityName = '重庆市'; |
|
|
|
|
// app.globalData.cityId = '500000'; |
|
|
|
|
// that.getCmsContentcmsContent(); |
|
|
|
|
// that.getCmsAactibity(); |
|
|
|
|
// } |
|
|
|
|
// ); |
|
|
|
|
// #endif |
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
success(e) { |
|
|
|
|
app.globalData.userInfo = e.data //这就是你想要取的token |
|
|
|
|
uni.getStorage({ |
|
|
|
|
key: 'token', |
|
|
|
|
success(e) { |
|
|
|
|
app.globalData.token = e.data; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
fail: res => {} |
|
|
|
|
}) |
|
|
|
|
if (JSON.stringify(options.id)) { |
|
|
|
|
app.globalData.identificationCode = options.id; |
|
|
|
|
return; |
|
|
|
@ -318,10 +300,10 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
jumpcdx() { |
|
|
|
|
location.href = |
|
|
|
|
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; |
|
|
|
|
}, |
|
|
|
|
// jumpcdx() { |
|
|
|
|
// location.href = |
|
|
|
|
// 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; |
|
|
|
|
// }, |
|
|
|
|
//获取首页功能 |
|
|
|
|
getCmsContentcmsContent() { |
|
|
|
|
let code; |
|
|
|
@ -432,20 +414,20 @@ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 获取精准定位 |
|
|
|
|
getLocation() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
let that = this; |
|
|
|
|
that.locationRef.getLocation() // 调用 getLocation 方法获取精准定位 |
|
|
|
|
.then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
// res 就是返回的数据 |
|
|
|
|
app.globalData.latitude = res.lat; |
|
|
|
|
app.globalData.longitude = res.lng; |
|
|
|
|
that.findByLatAndLng(res.lng, res.lat); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// getLocation() { |
|
|
|
|
// uni.showLoading({ |
|
|
|
|
// title: '加载中' |
|
|
|
|
// }) |
|
|
|
|
// let that = this; |
|
|
|
|
// that.locationRef.getLocation() // 调用 getLocation 方法获取精准定位 |
|
|
|
|
// .then(res => { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// // res 就是返回的数据 |
|
|
|
|
// app.globalData.latitude = res.lat; |
|
|
|
|
// app.globalData.longitude = res.lng; |
|
|
|
|
// that.findByLatAndLng(res.lng, res.lat); |
|
|
|
|
// }) |
|
|
|
|
// }, |
|
|
|
|
//经纬度转换 |
|
|
|
|
findByLatAndLng(item, item1) { |
|
|
|
|
let that = this; |
|
|
|
@ -587,22 +569,22 @@ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//H5 获取openId |
|
|
|
|
getH5AccessToken() { |
|
|
|
|
let params = { |
|
|
|
|
code: app.globalData.h5code |
|
|
|
|
} |
|
|
|
|
getH5AccessToken(params).then(res => { |
|
|
|
|
if (res.return_code == '000000' && res.return_data.openid) { |
|
|
|
|
app.globalData.openId = res.return_data.openid; |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "openId", |
|
|
|
|
data: res.return_data.openid |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.jumpcdx(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// getH5AccessToken() { |
|
|
|
|
// let params = { |
|
|
|
|
// code: app.globalData.h5code |
|
|
|
|
// } |
|
|
|
|
// getH5AccessToken(params).then(res => { |
|
|
|
|
// if (res.return_code == '000000' && res.return_data.openid) { |
|
|
|
|
// app.globalData.openId = res.return_data.openid; |
|
|
|
|
// uni.setStorage({ |
|
|
|
|
// key: "openId", |
|
|
|
|
// data: res.return_data.openid |
|
|
|
|
// }) |
|
|
|
|
// } else { |
|
|
|
|
// this.jumpcdx(); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// }, |
|
|
|
|
//搜索跳转 |
|
|
|
|
toSearch() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
@ -639,65 +621,65 @@ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
eheckStu(item) { |
|
|
|
|
this.cpStuats = item; |
|
|
|
|
}, |
|
|
|
|
// eheckStu(item) { |
|
|
|
|
// this.cpStuats = item; |
|
|
|
|
// }, |
|
|
|
|
//获取登陆信息 |
|
|
|
|
getuserinfos() { |
|
|
|
|
let that = this; |
|
|
|
|
// 获取微信用户信息 |
|
|
|
|
uni.getUserProfile({ |
|
|
|
|
desc: '登录中...', |
|
|
|
|
success: function(res) { |
|
|
|
|
let params = { |
|
|
|
|
openId: app.globalData.openId, |
|
|
|
|
iv: res.iv, |
|
|
|
|
encryptedData: res.encryptedData |
|
|
|
|
} |
|
|
|
|
getUserInfo(params).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '获取信息成功', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
app.globalData.userInfo = res |
|
|
|
|
.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
app.globalData.token = res |
|
|
|
|
.return_data.uniqueCode; |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser |
|
|
|
|
}) |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "token", |
|
|
|
|
data: res.return_data |
|
|
|
|
.uniqueCode |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "微信登录授权失败", |
|
|
|
|
icon: "none" |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// getuserinfos() { |
|
|
|
|
// let that = this; |
|
|
|
|
// // 获取微信用户信息 |
|
|
|
|
// uni.getUserProfile({ |
|
|
|
|
// desc: '登录中...', |
|
|
|
|
// success: function(res) { |
|
|
|
|
// let params = { |
|
|
|
|
// openId: app.globalData.openId, |
|
|
|
|
// iv: res.iv, |
|
|
|
|
// encryptedData: res.encryptedData |
|
|
|
|
// } |
|
|
|
|
// getUserInfo(params).then(res => { |
|
|
|
|
// if (res.return_code == '000000') { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: '获取信息成功', |
|
|
|
|
// icon: 'none', |
|
|
|
|
// duration: 2000 |
|
|
|
|
// }) |
|
|
|
|
// app.globalData.userInfo = res |
|
|
|
|
// .return_data |
|
|
|
|
// .object |
|
|
|
|
// .highUser; |
|
|
|
|
// app.globalData.token = res |
|
|
|
|
// .return_data.uniqueCode; |
|
|
|
|
// uni.setStorage({ |
|
|
|
|
// key: "user", |
|
|
|
|
// data: res.return_data |
|
|
|
|
// .object |
|
|
|
|
// .highUser |
|
|
|
|
// }) |
|
|
|
|
// uni.setStorage({ |
|
|
|
|
// key: "token", |
|
|
|
|
// data: res.return_data |
|
|
|
|
// .uniqueCode |
|
|
|
|
// }) |
|
|
|
|
// } else { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: res.return_msg, |
|
|
|
|
// icon: 'none', |
|
|
|
|
// duration: 2000 |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// }, |
|
|
|
|
// fail: res => { |
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: "微信登录授权失败", |
|
|
|
|
// icon: "none" |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// }, |
|
|
|
|
//跳转菜单 |
|
|
|
|
toCategory(item) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
@ -778,7 +760,11 @@ |
|
|
|
|
button::after { |
|
|
|
|
border: none |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.bgLinear{ |
|
|
|
|
background: linear-gradient(to bottom, #ffffff, #F5F5F5) no-repeat; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.pullDown-effects { |
|
|
|
|
position: fixed; |
|
|
|
|
//top: calc(100upx - 36vw); |
|
|
|
@ -798,60 +784,63 @@ |
|
|
|
|
|
|
|
|
|
.status { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 0; |
|
|
|
|
position: fixed; |
|
|
|
|
z-index: 10; |
|
|
|
|
background-color: #fff; |
|
|
|
|
transition: 0.2s all linear; |
|
|
|
|
top: 0; |
|
|
|
|
/* #ifdef APP-PLUS */ |
|
|
|
|
height: var(--status-bar-height); //覆盖样式 |
|
|
|
|
/* #endif */ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.header { |
|
|
|
|
width: 92%; |
|
|
|
|
padding: 0 4%; |
|
|
|
|
height: 100upx; |
|
|
|
|
|
|
|
|
|
.addr { |
|
|
|
|
// width: 120upx; |
|
|
|
|
height: inherit; |
|
|
|
|
flex-shrink: 0; |
|
|
|
|
display: flex; |
|
|
|
|
// overflow: hidden; |
|
|
|
|
// -webkit-line-clamp: 1; |
|
|
|
|
// -webkit-box-orient: vertical; |
|
|
|
|
// text-overflow: ellipsis; |
|
|
|
|
align-items: center; |
|
|
|
|
position: fixed; |
|
|
|
|
font-size: 28upx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
|
|
|
|
|
.icon { |
|
|
|
|
height: 60upx; |
|
|
|
|
margin-right: 5upx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
font-size: 42upx; |
|
|
|
|
color: #ffc50a; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.city-con { |
|
|
|
|
background-color: #3da7e7; |
|
|
|
|
top: 0; |
|
|
|
|
z-index: 10; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* #ifdef APP-PLUS */ |
|
|
|
|
top: var(--status-bar-height); |
|
|
|
|
/* #endif */ |
|
|
|
|
.header { |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
z-index: 999; |
|
|
|
|
transition: 0.2s all linear; |
|
|
|
|
|
|
|
|
|
.addr { |
|
|
|
|
width: 120upx; |
|
|
|
|
height: 45rpx; |
|
|
|
|
flex-shrink: 0; |
|
|
|
|
.header-chid { |
|
|
|
|
display: flex; |
|
|
|
|
overflow: hidden; |
|
|
|
|
display: -webkit-box; |
|
|
|
|
-webkit-line-clamp: 1; |
|
|
|
|
-webkit-box-orient: vertical; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
align-items: center; |
|
|
|
|
font-size: 28upx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
|
|
|
|
|
.icon { |
|
|
|
|
height: 60upx; |
|
|
|
|
margin-right: 5upx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
font-size: 42upx; |
|
|
|
|
color: #ffc50a; |
|
|
|
|
} |
|
|
|
|
height: 100%; |
|
|
|
|
padding: 4px 10px 4px 10px; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
transition: 0.2s all linear; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.input-box { |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 70rpx; |
|
|
|
|
height: inherit; |
|
|
|
|
background-color: #f5f5f5; |
|
|
|
|
border-radius: 10rpx; |
|
|
|
|
border-radius: 36rpx; |
|
|
|
|
position: relative; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
@ -860,7 +849,6 @@ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
position: absolute; |
|
|
|
|
top: 0; |
|
|
|
|
right: 0; |
|
|
|
|
width: 60upx; |
|
|
|
|
height: 60upx; |
|
|
|
@ -900,14 +888,22 @@ |
|
|
|
|
border: none |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.margb40upx{ |
|
|
|
|
margin-bottom:40upx; |
|
|
|
|
} |
|
|
|
|
.pdb40upx{ |
|
|
|
|
padding-bottom: 40upx; |
|
|
|
|
} |
|
|
|
|
.category-list { |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: flex-start; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.category { |
|
|
|
|
margin-top: 40upx; |
|
|
|
|
// margin-bottom:40upx; |
|
|
|
|
display: flex; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|