1
|
<!DOCTYPE html>
|
1
|
<!DOCTYPE html>
|
2
|
<html lang="en">
|
2
|
<html lang="en">
|
|
|
3
|
+
|
3
|
<head>
|
4
|
<head>
|
4
|
- <meta charset="UTF-8">
|
|
|
5
|
- <meta name="viewport"
|
|
|
6
|
- content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
|
|
|
7
|
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
|
|
8
|
- <title>慈界医养</title>
|
|
|
9
|
- <script src="../../assets/js/fontsize.js"></script>
|
|
|
10
|
- <link rel="stylesheet" href="../../assets/css/weui.min.css">
|
|
|
11
|
- <link rel="stylesheet" href="../../assets/css/api.css"/>
|
|
|
12
|
- <link rel="stylesheet" href="../../assets/css/swiper-3.4.2.min.css">
|
|
|
13
|
- <!--<link rel="stylesheet" href="http://at.alicdn.com/t/font_641470_jg64l6ijsg4lsor.css">-->
|
|
|
14
|
- <link rel="stylesheet" href="../../assets/css/my_f.css"/>
|
|
|
15
|
- <link rel="stylesheet" href="../../assets/css/index.css">
|
|
|
16
|
- <link rel="stylesheet" href="../../assets/icon/iconfont.css">
|
|
|
17
|
- <style>
|
|
|
18
|
- header {
|
5
|
+ <meta charset="UTF-8">
|
|
|
6
|
+ <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
|
|
|
7
|
+ <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
|
|
8
|
+ <title>慈界医养</title>
|
|
|
9
|
+ <script src="../../assets/js/fontsize.js"></script>
|
|
|
10
|
+ <link rel="stylesheet" href="../../assets/css/weui.min.css">
|
|
|
11
|
+ <link rel="stylesheet" href="../../assets/css/api.css" />
|
|
|
12
|
+ <link rel="stylesheet" href="../../assets/css/swiper-3.4.2.min.css">
|
|
|
13
|
+ <!--<link rel="stylesheet" href="http://at.alicdn.com/t/font_641470_jg64l6ijsg4lsor.css">-->
|
|
|
14
|
+ <link rel="stylesheet" href="../../assets/css/my_f.css" />
|
|
|
15
|
+ <link rel="stylesheet" href="../../assets/css/index.css">
|
|
|
16
|
+ <link rel="stylesheet" href="../../assets/icon/iconfont.css">
|
|
|
17
|
+ <style>
|
|
|
18
|
+ header {
|
19
|
width: 100%;
|
19
|
width: 100%;
|
20
|
height: auto;
|
20
|
height: auto;
|
21
|
font-size: 20px;
|
21
|
font-size: 20px;
|
|
@@ -82,43 +82,44 @@ |
|
@@ -82,43 +82,44 @@ |
82
|
}
|
82
|
}
|
83
|
</style>
|
83
|
</style>
|
84
|
</head>
|
84
|
</head>
|
|
|
85
|
+
|
85
|
<body>
|
86
|
<body>
|
86
|
-<div id="app" v-cloak>
|
|
|
87
|
- <div id="container"></div>
|
|
|
88
|
- <header :class="index===0?'headers':''">
|
|
|
89
|
- <div class="index_header" v-if="index==0">
|
|
|
90
|
- <div class="index_left" >
|
|
|
91
|
- <div class="index_left_img">
|
|
|
92
|
- <div class="iconfont icon-dizhi"></div>
|
|
|
93
|
- </div>
|
|
|
94
|
- <span @click.stop="goToCity">{{cityname?cityname:'定位中...'}}</span>
|
|
|
95
|
- </div>
|
|
|
96
|
- <span class="app_name">慈界医养</span>
|
|
|
97
|
- <div class="index_right" @click="show_menu">
|
|
|
98
|
- <img src="../../assets/image/plus.png" alt="" :class="[img_active?'img_transform':'img_transform1']">
|
|
|
99
|
- </div>
|
|
|
100
|
- </div>
|
|
|
101
|
- <div class="index1" v-else-if="index==1">
|
|
|
102
|
- <div class="index1_item index_on">
|
|
|
103
|
- <!--<div class="index1_item index_on">-->
|
|
|
104
|
- <div></div>
|
|
|
105
|
- <div class="iconfont icon-fenxiang-tianchong"></div>
|
|
|
106
|
- </div>
|
|
|
107
|
- </div>
|
|
|
108
|
- <div class="my_top_icon_box" v-else>
|
|
|
109
|
- <span class="iconfont icon-xiaoxi" @click="my_news"></span>
|
|
|
110
|
- <span class="dot" v-show="newList.length!=0"></span>
|
|
|
111
|
- </div>
|
|
|
112
|
- <div class="triangle_border_up" v-show="img_active">
|
|
|
113
|
- <span></span>
|
|
|
114
|
- </div>
|
|
|
115
|
- </header>
|
|
|
116
|
- <div class="warp">
|
|
|
117
|
- <div class="index_list" id="top">
|
87
|
+ <div id="app" v-cloak>
|
|
|
88
|
+ <div id="container"></div>
|
|
|
89
|
+ <header :class="index===0?'headers':''">
|
|
|
90
|
+ <div class="index_header" v-if="index==0">
|
|
|
91
|
+ <div class="index_left">
|
|
|
92
|
+ <div class="index_left_img">
|
|
|
93
|
+ <div class="iconfont icon-dizhi"></div>
|
|
|
94
|
+ </div>
|
|
|
95
|
+ <span @click.stop="goToCity">{{cityname?cityname:'定位中...'}}</span>
|
|
|
96
|
+ </div>
|
|
|
97
|
+ <span class="app_name">慈界医养</span>
|
|
|
98
|
+ <div class="index_right" @click="show_menu">
|
|
|
99
|
+ <img src="../../assets/image/plus.png" alt="" :class="[img_active?'img_transform':'img_transform1']">
|
|
|
100
|
+ </div>
|
|
|
101
|
+ </div>
|
|
|
102
|
+ <div class="index1" v-else-if="index==1">
|
|
|
103
|
+ <div class="index1_item index_on">
|
|
|
104
|
+ <!--<div class="index1_item index_on">-->
|
|
|
105
|
+ <div></div>
|
|
|
106
|
+ <div class="iconfont icon-fenxiang-tianchong"></div>
|
|
|
107
|
+ </div>
|
|
|
108
|
+ </div>
|
|
|
109
|
+ <div class="my_top_icon_box" v-else>
|
|
|
110
|
+ <span class="iconfont icon-xiaoxi" @click="my_news"></span>
|
|
|
111
|
+ <span class="dot" v-show="newList.length!=0"></span>
|
|
|
112
|
+ </div>
|
|
|
113
|
+ <div class="triangle_border_up" v-show="img_active">
|
|
|
114
|
+ <span></span>
|
|
|
115
|
+ </div>
|
|
|
116
|
+ </header>
|
|
|
117
|
+ <div class="warp">
|
|
|
118
|
+ <div class="index_list" id="top">
|
118
|
<div class="index_item" v-cloak v-for="(item,index) in cat_data" @click="openItem(item.id,item.name)">
|
119
|
<div class="index_item" v-cloak v-for="(item,index) in cat_data" @click="openItem(item.id,item.name)">
|
119
|
<div class="index_img"><img :src="item.img?item.img:img_default" alt=""></div>
|
120
|
<div class="index_img"><img :src="item.img?item.img:img_default" alt=""></div>
|
120
|
<div>{{item.name}}</div>
|
121
|
<div>{{item.name}}</div>
|
121
|
- </div>
|
122
|
+ </div>
|
122
|
<div class="menus" v-show="img_active">
|
123
|
<div class="menus" v-show="img_active">
|
123
|
<div class="menus_item" @click="openOrder"><span class="iconfont icon-dingdan"></span><span>我的订单</span>
|
124
|
<div class="menus_item" @click="openOrder"><span class="iconfont icon-dingdan"></span><span>我的订单</span>
|
124
|
</div>
|
125
|
</div>
|
|
@@ -129,82 +130,85 @@ |
|
@@ -129,82 +130,85 @@ |
129
|
<!--<div class="menus_item" @click="openQrc"><span class="iconfont icon-saoyisao"></span><span>扫一扫</span></div>-->
|
130
|
<!--<div class="menus_item" @click="openQrc"><span class="iconfont icon-saoyisao"></span><span>扫一扫</span></div>-->
|
130
|
</div>
|
131
|
</div>
|
131
|
|
132
|
|
132
|
- <div class="banner_box" @click="openStrict"><img src="../../assets/image/banner.png" alt=""></div>
|
|
|
133
|
- <div class="banner_nav_box">
|
|
|
134
|
- <div class="banner_item" v-cloak @click="care(item.goods_id,item.title)" v-for="(item,index) in index_data">
|
|
|
135
|
- <div class="banner_item_left" >
|
|
|
136
|
- <span class="banner_item_title">{{item.title}}</span>
|
|
|
137
|
- <span class="banner_item_content">{{item.describe}}</span>
|
|
|
138
|
- </div>
|
|
|
139
|
- <div class="banner_item_img">
|
|
|
140
|
- <img :src="item.img?item.img:img_default" alt="">
|
133
|
+ <div class="banner_box" @click="openStrict"><img src="../../assets/image/banner.png" alt=""></div>
|
|
|
134
|
+ <div class="banner_nav_box">
|
|
|
135
|
+ <div class="banner_item" v-cloak @click="care(item.goods_id,item.title)" v-for="(item,index) in index_data">
|
|
|
136
|
+ <div class="banner_item_left">
|
|
|
137
|
+ <span class="banner_item_title">{{item.title}}</span>
|
|
|
138
|
+ <span class="banner_item_content">{{item.describe}}</span>
|
|
|
139
|
+ </div>
|
|
|
140
|
+ <div class="banner_item_img">
|
|
|
141
|
+ <img :src="item.img?item.img:img_default" alt="">
|
|
|
142
|
+ </div>
|
141
|
</div>
|
143
|
</div>
|
142
|
</div>
|
144
|
</div>
|
143
|
- </div>
|
|
|
144
|
- <div class="swiper_title fixed_top" v-show="top_show">
|
|
|
145
|
- <span></span>
|
|
|
146
|
- <span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img src="../../assets/image/part4_05.jpg" alt=""></span>
|
|
|
147
|
- <span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
|
|
|
148
|
- </div>
|
|
|
149
|
- <div class="swiper_box">
|
|
|
150
|
- <div class="swiper_title" :class="{fixed_top:top_show}" id="main" v-show="!top_show">
|
145
|
+ <div class="swiper_title fixed_top" v-show="top_show">
|
151
|
<span></span>
|
146
|
<span></span>
|
152
|
- <span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img src="../../assets/image/part4_05.jpg" alt=""></span>
|
147
|
+ <span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img src="../../assets/image/part4_05.jpg"
|
|
|
148
|
+ alt=""></span>
|
153
|
<span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
|
149
|
<span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
|
154
|
</div>
|
150
|
</div>
|
155
|
- <div class="swiper-container">
|
|
|
156
|
- <div class="swiper-wrapper">
|
|
|
157
|
- <div class="swiper-slide" v-for="(item,index) in show_data">
|
|
|
158
|
- <div class="swiper_item" @click="care(i.goods_id,i.title)" v-for="(i,item_index) in item">
|
|
|
159
|
- <div class="swiper_item_img"><img :src="i.img" alt=""></div>
|
|
|
160
|
- <!--<!–<img src="../../assets/image/logo200.png" alt="">–>-->
|
|
|
161
|
- <div class="swiper_item_right">
|
|
|
162
|
- <div class="swiper_item_title">{{i.title}}</div>
|
|
|
163
|
- <div class="swiper_item_content">{{i.describe}}</div>
|
|
|
164
|
- <div class="swiper_item_type">
|
|
|
165
|
- <div class="swiper_item_type1" v-for="(j,item2_index) in i.icon">
|
|
|
166
|
- <div class="icon_img"><img :src="j.url" alt=""></div>
|
|
|
167
|
- <span>{{j.text}}</span>
|
151
|
+ <div class="swiper_box">
|
|
|
152
|
+ <div class="swiper_title" :class="{fixed_top:top_show}" id="main" v-show="!top_show">
|
|
|
153
|
+ <span></span>
|
|
|
154
|
+ <span class="swiper_title_content"> <img src="../../assets/image/part4_03.jpg" alt=""><span>严选推介</span><img src="../../assets/image/part4_05.jpg"
|
|
|
155
|
+ alt=""></span>
|
|
|
156
|
+ <span class="change_slide">换一批<span class="iconfont icon-xunhuan101"></span></span>
|
|
|
157
|
+ </div>
|
|
|
158
|
+ <div class="swiper-container">
|
|
|
159
|
+ <div class="swiper-wrapper">
|
|
|
160
|
+ <div class="swiper-slide" v-for="(item,index) in show_data">
|
|
|
161
|
+ <div class="swiper_item" @click="care(i.goods_id,i.title)" v-for="(i,item_index) in item">
|
|
|
162
|
+ <div class="swiper_item_img"><img :src="i.img" alt=""></div>
|
|
|
163
|
+ <!--<!–<img src="../../assets/image/logo200.png" alt="">–>-->
|
|
|
164
|
+ <div class="swiper_item_right">
|
|
|
165
|
+ <div class="swiper_item_title">{{i.title}}</div>
|
|
|
166
|
+ <div class="swiper_item_content">{{i.describe}}</div>
|
|
|
167
|
+ <div class="swiper_item_type">
|
|
|
168
|
+ <div class="swiper_item_type1" v-for="(j,item2_index) in i.icon">
|
|
|
169
|
+ <div class="icon_img"><img :src="j.url" alt=""></div>
|
|
|
170
|
+ <span>{{j.text}}</span>
|
|
|
171
|
+ </div>
|
168
|
</div>
|
172
|
</div>
|
|
|
173
|
+ <div class="swiper_item_money">¥{{i.price}}</div>
|
169
|
</div>
|
174
|
</div>
|
170
|
- <div class="swiper_item_money">¥{{i.price}}</div>
|
|
|
171
|
</div>
|
175
|
</div>
|
172
|
</div>
|
176
|
</div>
|
173
|
</div>
|
177
|
</div>
|
174
|
</div>
|
178
|
</div>
|
|
|
179
|
+ <div class="mold_index" v-show="img_active" @touchstart="hideMenu"></div>
|
175
|
</div>
|
180
|
</div>
|
176
|
- <div class="mold_index" v-show="img_active" @touchstart="hideMenu"></div>
|
|
|
177
|
</div>
|
181
|
</div>
|
178
|
- </div>
|
|
|
179
|
- </div>
|
|
|
180
|
-
|
|
|
181
|
- <footer>
|
|
|
182
|
- <div class="footer_item" :class="{footer_item_active:index==0}" @click="changeTab(0)">
|
|
|
183
|
- <i class="iconfont icon-yuanjiaojuxingkaobei"></i>
|
|
|
184
|
- <span>严选</span>
|
|
|
185
|
- </div>
|
|
|
186
|
- <div class="footer_item" :class="{footer_item_active:index==1}" @click="changeTab(1)">
|
|
|
187
|
- <i class="iconfont icon-xingzhuang"></i>
|
|
|
188
|
- <span>投资</span>
|
|
|
189
|
- </div>
|
|
|
190
|
- <div class="footer_item" :class="{footer_item_active:index==2}" @click="changeTab(2)">
|
|
|
191
|
- <i class="iconfont icon-wo"></i>
|
|
|
192
|
- <span>我的</span>
|
|
|
193
|
- </div>
|
|
|
194
|
- <div class="mold_index" v-show="img_active" @click="hideMenu"></div>
|
|
|
195
|
- </footer>
|
|
|
196
|
-</div>
|
182
|
+ </div>
|
|
|
183
|
+
|
|
|
184
|
+ <footer>
|
|
|
185
|
+ <div class="footer_item" :class="{footer_item_active:index==0}" @click="changeTab(0)">
|
|
|
186
|
+ <i class="iconfont icon-yuanjiaojuxingkaobei"></i>
|
|
|
187
|
+ <span>严选</span>
|
|
|
188
|
+ </div>
|
|
|
189
|
+ <div class="footer_item" :class="{footer_item_active:index==1}" @click="changeTab(1)">
|
|
|
190
|
+ <i class="iconfont icon-xingzhuang"></i>
|
|
|
191
|
+ <span>投资</span>
|
|
|
192
|
+ </div>
|
|
|
193
|
+ <div class="footer_item" :class="{footer_item_active:index==2}" @click="changeTab(2)">
|
|
|
194
|
+ <i class="iconfont icon-wo"></i>
|
|
|
195
|
+ <span>我的</span>
|
|
|
196
|
+ </div>
|
|
|
197
|
+ <div class="mold_index" v-show="img_active" @click="hideMenu"></div>
|
|
|
198
|
+ </footer>
|
|
|
199
|
+ </div>
|
197
|
</body>
|
200
|
</body>
|
|
|
201
|
+
|
198
|
</html>
|
202
|
</html>
|
199
|
<script>
|
203
|
<script>
|
200
|
- window.onLoad = function () {
|
|
|
201
|
- var map = new AMap.Map('container');
|
|
|
202
|
- }
|
|
|
203
|
- var url = 'https://webapi.amap.com/maps?v=1.4.8&key=ef53760bd959a4df08b7d4587280e642&callback=onLoad';
|
|
|
204
|
- var jsapi = document.createElement('script');
|
|
|
205
|
- jsapi.charset = 'utf-8';
|
|
|
206
|
- jsapi.src = url;
|
|
|
207
|
- document.head.appendChild(jsapi);
|
204
|
+ window.onLoad = function () {
|
|
|
205
|
+ var map = new AMap.Map('container');
|
|
|
206
|
+ }
|
|
|
207
|
+ var url = 'https://webapi.amap.com/maps?v=1.4.8&key=ef53760bd959a4df08b7d4587280e642&callback=onLoad';
|
|
|
208
|
+ var jsapi = document.createElement('script');
|
|
|
209
|
+ jsapi.charset = 'utf-8';
|
|
|
210
|
+ jsapi.src = url;
|
|
|
211
|
+ document.head.appendChild(jsapi);
|
208
|
</script>
|
212
|
</script>
|
209
|
<script type="text/javascript" src="../../assets/js/api.js"></script>
|
213
|
<script type="text/javascript" src="../../assets/js/api.js"></script>
|
210
|
<script type="text/javascript" src="../../assets/js/swiper-3.4.2.min.js"></script>
|
214
|
<script type="text/javascript" src="../../assets/js/swiper-3.4.2.min.js"></script>
|
|
@@ -212,7 +216,7 @@ |
|
@@ -212,7 +216,7 @@ |
212
|
<script type="text/javascript" src="../../assets/js/public.js"></script>
|
216
|
<script type="text/javascript" src="../../assets/js/public.js"></script>
|
213
|
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
|
217
|
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
|
214
|
<script>
|
218
|
<script>
|
215
|
- new FastClick(document.body);
|
219
|
+ new FastClick(document.body);
|
216
|
</script>
|
220
|
</script>
|
217
|
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
|
221
|
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
|
218
|
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
|
222
|
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
|
|
@@ -230,20 +234,20 @@ |
|
@@ -230,20 +234,20 @@ |
230
|
autoHeight: false,
|
234
|
autoHeight: false,
|
231
|
speed: 1500,
|
235
|
speed: 1500,
|
232
|
});
|
236
|
});
|
233
|
- var app = new Vue({
|
|
|
234
|
- el: "#app",
|
|
|
235
|
- data: {
|
|
|
236
|
- index: 0,
|
|
|
237
|
- headerH: '',
|
|
|
238
|
- footerH: '',
|
|
|
239
|
- getlng: '',
|
|
|
240
|
- getlat: '',
|
|
|
241
|
- cityindex: '',
|
|
|
242
|
- cityname: '',
|
|
|
243
|
- img_active: false,
|
|
|
244
|
- map: {},
|
|
|
245
|
- newList: [],
|
|
|
246
|
- img_active: false,
|
237
|
+ var app = new Vue({
|
|
|
238
|
+ el: "#app",
|
|
|
239
|
+ data: {
|
|
|
240
|
+ index: 0,
|
|
|
241
|
+ headerH: '',
|
|
|
242
|
+ footerH: '',
|
|
|
243
|
+ getlng: '',
|
|
|
244
|
+ getlat: '',
|
|
|
245
|
+ cityindex: '',
|
|
|
246
|
+ cityname: '',
|
|
|
247
|
+ img_active: false,
|
|
|
248
|
+ map: {},
|
|
|
249
|
+ newList: [],
|
|
|
250
|
+ img_active: false,
|
247
|
mySwiper: {},
|
251
|
mySwiper: {},
|
248
|
scroll_top: '',
|
252
|
scroll_top: '',
|
249
|
top_show: false,
|
253
|
top_show: false,
|
|
@@ -251,104 +255,108 @@ |
|
@@ -251,104 +255,108 @@ |
251
|
index_data: [],
|
255
|
index_data: [],
|
252
|
show_data: [],
|
256
|
show_data: [],
|
253
|
img_default: '../../assets/image/logo200.png',
|
257
|
img_default: '../../assets/image/logo200.png',
|
254
|
- cityname: '',
|
258
|
+ cityname: '天津',
|
255
|
rongYunToken: '',
|
259
|
rongYunToken: '',
|
256
|
- userId: '',
|
260
|
+ userId: '',
|
257
|
user_info: []
|
261
|
user_info: []
|
258
|
- },
|
|
|
259
|
- created: function () {
|
|
|
260
|
- this.cat(); //首页导航
|
262
|
+ },
|
|
|
263
|
+ created: function () {
|
|
|
264
|
+ this.cat(); //首页导航
|
261
|
this.indexList(); //第三栏
|
265
|
this.indexList(); //第三栏
|
262
|
this.show(); //严选推荐
|
266
|
this.show(); //严选推荐
|
263
|
// 底部轮播图
|
267
|
// 底部轮播图
|
264
|
- },
|
|
|
265
|
- mounted: function() {
|
268
|
+ },
|
|
|
269
|
+ mounted: function () {
|
266
|
window.addEventListener('scroll', this.handleScroll)
|
270
|
window.addEventListener('scroll', this.handleScroll)
|
267
|
},
|
271
|
},
|
268
|
- methods: {
|
|
|
269
|
- // 我的消息
|
|
|
270
|
- my_news: function () {
|
|
|
271
|
- openView('my_news', 'my/my_news', '消息通知', 'my_news', false, {new_type: 0})
|
|
|
272
|
- },
|
|
|
273
|
- // 有无消息判断
|
|
|
274
|
- getNews: function () {
|
|
|
275
|
- var header = {
|
|
|
276
|
- "XX-Device-Type": getDevice(),
|
|
|
277
|
- 'XX-Token': getToken()
|
|
|
278
|
- };
|
|
|
279
|
- getRequest('post', 'user/index/getUserMessageList', null, header).then(function (res) {
|
|
|
280
|
- if (res.data.code == 1) {
|
|
|
281
|
- app.newList = res.data.data.unread;
|
|
|
282
|
- } else {
|
|
|
283
|
- toastMsg(res.data.msg)
|
|
|
284
|
- }
|
|
|
285
|
- loadEnd();
|
|
|
286
|
- })
|
|
|
287
|
- },
|
|
|
288
|
- // 定位当前城市
|
|
|
289
|
- get_city: function () {
|
|
|
290
|
- app.map = new AMap.Map('container', {});
|
|
|
291
|
- app.map.plugin('AMap.Geolocation', function () {
|
|
|
292
|
- var geolocation = new AMap.Geolocation({
|
|
|
293
|
- // 是否使用高精度定位,默认:
|
|
|
294
|
- enableHighAccuracy: true,
|
|
|
295
|
- // 设置定位超时时间,默认:无穷大
|
|
|
296
|
- timeout: 10000,
|
|
|
297
|
- });
|
|
|
298
|
- geolocation.getCurrentPosition();
|
|
|
299
|
- AMap.event.addListener(geolocation, 'complete', onComplete)
|
|
|
300
|
- AMap.event.addListener(geolocation, 'error', onError)
|
|
|
301
|
- function onComplete(data) {
|
|
|
302
|
- console.log(JSON.stringify(data))
|
|
|
303
|
- app.cityname = data.addressComponent.province
|
|
|
304
|
- // data是具体的定位信息
|
|
|
305
|
- }
|
|
|
306
|
- function onError(erro) {
|
|
|
307
|
- // 定位出错
|
|
|
308
|
- toastMsg('请开启定位功能')
|
|
|
309
|
- }
|
|
|
310
|
- })
|
|
|
311
|
- },
|
|
|
312
|
- // 切换底部导航
|
|
|
313
|
- changeTab: function (res) {
|
|
|
314
|
- //跳转页面
|
|
|
315
|
- },
|
|
|
316
|
- // 切换当前城市
|
|
|
317
|
- goToCity: function () {
|
|
|
318
|
- if (app.cityname == '') {
|
|
|
319
|
- toastMsg('定位中')
|
|
|
320
|
- } else {
|
|
|
321
|
- api.openWin({
|
|
|
322
|
- name: 'city_win',
|
|
|
323
|
- url: '../index/city_win.html',
|
|
|
324
|
- pageParam: {
|
|
|
325
|
- cityname: app.cityname
|
|
|
326
|
- }
|
|
|
327
|
- });
|
|
|
328
|
- }
|
|
|
329
|
- },
|
|
|
330
|
- // 显示快捷菜单
|
|
|
331
|
- show_menu: function () {
|
|
|
332
|
- if (app.img_active == false) {
|
|
|
333
|
- app.img_active = true
|
|
|
334
|
- } else {
|
|
|
335
|
- app.img_active = false
|
|
|
336
|
- }
|
|
|
337
|
- },
|
|
|
338
|
- // 隐藏快捷菜单
|
|
|
339
|
- hideMenu: function () {
|
|
|
340
|
- app.img_active = !app.img_active;
|
|
|
341
|
- api.sendEvent({
|
|
|
342
|
- name: 'show_menu',
|
|
|
343
|
- extra: {
|
|
|
344
|
- img_active: app.img_active
|
|
|
345
|
- }
|
|
|
346
|
- });
|
|
|
347
|
- },
|
|
|
348
|
-
|
|
|
349
|
- //首页的数据
|
|
|
350
|
- // 隐藏菜单
|
|
|
351
|
- hideMenu: function() {
|
272
|
+ methods: {
|
|
|
273
|
+ // 我的消息
|
|
|
274
|
+ my_news: function () {
|
|
|
275
|
+ openView('my_news', 'my/my_news', '消息通知', 'my_news', false, {
|
|
|
276
|
+ new_type: 0
|
|
|
277
|
+ })
|
|
|
278
|
+ },
|
|
|
279
|
+ // 有无消息判断
|
|
|
280
|
+ getNews: function () {
|
|
|
281
|
+ var header = {
|
|
|
282
|
+ "XX-Device-Type": getDevice(),
|
|
|
283
|
+ 'XX-Token': getToken()
|
|
|
284
|
+ };
|
|
|
285
|
+ getRequest('post', 'user/index/getUserMessageList', null, header).then(function (res) {
|
|
|
286
|
+ if (res.data.code == 1) {
|
|
|
287
|
+ app.newList = res.data.data.unread;
|
|
|
288
|
+ } else {
|
|
|
289
|
+ toastMsg(res.data.msg)
|
|
|
290
|
+ }
|
|
|
291
|
+ loadEnd();
|
|
|
292
|
+ })
|
|
|
293
|
+ },
|
|
|
294
|
+ // 定位当前城市
|
|
|
295
|
+ get_city: function () {
|
|
|
296
|
+ app.map = new AMap.Map('container', {});
|
|
|
297
|
+ app.map.plugin('AMap.Geolocation', function () {
|
|
|
298
|
+ var geolocation = new AMap.Geolocation({
|
|
|
299
|
+ // 是否使用高精度定位,默认:
|
|
|
300
|
+ enableHighAccuracy: true,
|
|
|
301
|
+ // 设置定位超时时间,默认:无穷大
|
|
|
302
|
+ timeout: 10000,
|
|
|
303
|
+ });
|
|
|
304
|
+ geolocation.getCurrentPosition();
|
|
|
305
|
+ AMap.event.addListener(geolocation, 'complete', onComplete)
|
|
|
306
|
+ AMap.event.addListener(geolocation, 'error', onError)
|
|
|
307
|
+
|
|
|
308
|
+ function onComplete(data) {
|
|
|
309
|
+ console.log(JSON.stringify(data))
|
|
|
310
|
+ app.cityname = data.addressComponent.province
|
|
|
311
|
+ // data是具体的定位信息
|
|
|
312
|
+ }
|
|
|
313
|
+
|
|
|
314
|
+ function onError(erro) {
|
|
|
315
|
+ // 定位出错
|
|
|
316
|
+ toastMsg('请开启定位功能')
|
|
|
317
|
+ }
|
|
|
318
|
+ })
|
|
|
319
|
+ },
|
|
|
320
|
+ // 切换底部导航
|
|
|
321
|
+ changeTab: function (res) {
|
|
|
322
|
+ //跳转页面
|
|
|
323
|
+ },
|
|
|
324
|
+ // 切换当前城市
|
|
|
325
|
+ goToCity: function () {
|
|
|
326
|
+ if (app.cityname == '') {
|
|
|
327
|
+ toastMsg('定位中')
|
|
|
328
|
+ } else {
|
|
|
329
|
+ api.openWin({
|
|
|
330
|
+ name: 'city_win',
|
|
|
331
|
+ url: '../index/city_win.html',
|
|
|
332
|
+ pageParam: {
|
|
|
333
|
+ cityname: app.cityname
|
|
|
334
|
+ }
|
|
|
335
|
+ });
|
|
|
336
|
+ }
|
|
|
337
|
+ },
|
|
|
338
|
+ // 显示快捷菜单
|
|
|
339
|
+ show_menu: function () {
|
|
|
340
|
+ if (app.img_active == false) {
|
|
|
341
|
+ app.img_active = true
|
|
|
342
|
+ } else {
|
|
|
343
|
+ app.img_active = false
|
|
|
344
|
+ }
|
|
|
345
|
+ },
|
|
|
346
|
+ // 隐藏快捷菜单
|
|
|
347
|
+ hideMenu: function () {
|
|
|
348
|
+ app.img_active = !app.img_active;
|
|
|
349
|
+ api.sendEvent({
|
|
|
350
|
+ name: 'show_menu',
|
|
|
351
|
+ extra: {
|
|
|
352
|
+ img_active: app.img_active
|
|
|
353
|
+ }
|
|
|
354
|
+ });
|
|
|
355
|
+ },
|
|
|
356
|
+
|
|
|
357
|
+ //首页的数据
|
|
|
358
|
+ // 隐藏菜单
|
|
|
359
|
+ hideMenu: function () {
|
352
|
app.img_active = !app.img_active;
|
360
|
app.img_active = !app.img_active;
|
353
|
api.sendEvent({
|
361
|
api.sendEvent({
|
354
|
name: 'hide_menu',
|
362
|
name: 'hide_menu',
|
|
@@ -358,22 +366,22 @@ |
|
@@ -358,22 +366,22 @@ |
358
|
});
|
366
|
});
|
359
|
},
|
367
|
},
|
360
|
// 严选推荐定位
|
368
|
// 严选推荐定位
|
361
|
- handleScroll: function() {
|
369
|
+ handleScroll: function () {
|
362
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
370
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
363
|
var offsetTop = document.querySelector('#main').offsetTop;
|
371
|
var offsetTop = document.querySelector('#main').offsetTop;
|
364
|
- console.log(scrollTop,offsetTop)
|
|
|
365
|
- if(scrollTop > offsetTop) {
|
372
|
+ console.log(scrollTop, offsetTop)
|
|
|
373
|
+ if (scrollTop > offsetTop) {
|
366
|
app.top_show = true
|
374
|
app.top_show = true
|
367
|
} else {
|
375
|
} else {
|
368
|
app.top_show = false
|
376
|
app.top_show = false
|
369
|
}
|
377
|
}
|
370
|
},
|
378
|
},
|
371
|
// 严选推荐定位
|
379
|
// 严选推荐定位
|
372
|
- destroyed: function() {
|
380
|
+ destroyed: function () {
|
373
|
window.removeEventListener('scroll', this.handleScroll)
|
381
|
window.removeEventListener('scroll', this.handleScroll)
|
374
|
},
|
382
|
},
|
375
|
// 打开投资
|
383
|
// 打开投资
|
376
|
- openStrict: function() {
|
384
|
+ openStrict: function () {
|
377
|
app.img_active = false;
|
385
|
app.img_active = false;
|
378
|
|
386
|
|
379
|
api.setFrameGroupIndex({
|
387
|
api.setFrameGroupIndex({
|
|
@@ -382,7 +390,7 @@ |
|
@@ -382,7 +390,7 @@ |
382
|
})
|
390
|
})
|
383
|
},
|
391
|
},
|
384
|
// 打开订单
|
392
|
// 打开订单
|
385
|
- openOrder: function() {
|
393
|
+ openOrder: function () {
|
386
|
app.img_active = false;
|
394
|
app.img_active = false;
|
387
|
openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
|
395
|
openView('my_orderlist', 'my/my_orderlist', '我的订单', 'my_orderlist', false, false, false);
|
388
|
api.sendEvent({
|
396
|
api.sendEvent({
|
|
@@ -393,7 +401,7 @@ |
|
@@ -393,7 +401,7 @@ |
393
|
});
|
401
|
});
|
394
|
},
|
402
|
},
|
395
|
// 打开健康档案
|
403
|
// 打开健康档案
|
396
|
- openHealth: function() {
|
404
|
+ openHealth: function () {
|
397
|
app.img_active = false;
|
405
|
app.img_active = false;
|
398
|
api.openWin({
|
406
|
api.openWin({
|
399
|
name: 'my_health_w',
|
407
|
name: 'my_health_w',
|
|
@@ -410,19 +418,19 @@ |
|
@@ -410,19 +418,19 @@ |
410
|
});
|
418
|
});
|
411
|
},
|
419
|
},
|
412
|
// 打开客服
|
420
|
// 打开客服
|
413
|
- openSever: function() {
|
421
|
+ openSever: function () {
|
414
|
app.img_active = false;
|
422
|
app.img_active = false;
|
415
|
app.getRongYunToken();
|
423
|
app.getRongYunToken();
|
416
|
|
424
|
|
417
|
},
|
425
|
},
|
418
|
// 获取客服token
|
426
|
// 获取客服token
|
419
|
- getRongYunToken: function() {
|
427
|
+ getRongYunToken: function () {
|
420
|
var header = {
|
428
|
var header = {
|
421
|
"XX-Device-Type": getDevice(),
|
429
|
"XX-Device-Type": getDevice(),
|
422
|
'XX-Token': getToken()
|
430
|
'XX-Token': getToken()
|
423
|
};
|
431
|
};
|
424
|
- getRequest('post', 'portal/RongYun/index', null, header).then(function(res) {
|
|
|
425
|
- if(res.data.code == 1) {
|
432
|
+ getRequest('post', 'portal/RongYun/index', null, header).then(function (res) {
|
|
|
433
|
+ if (res.data.code == 1) {
|
426
|
app.rongYunToken = res.data.data.token;
|
434
|
app.rongYunToken = res.data.data.token;
|
427
|
app.userId = res.data.data.userId;
|
435
|
app.userId = res.data.data.userId;
|
428
|
// app.rongyunInit();
|
436
|
// app.rongyunInit();
|
|
@@ -430,7 +438,7 @@ |
|
@@ -430,7 +438,7 @@ |
430
|
})
|
438
|
})
|
431
|
},
|
439
|
},
|
432
|
// 轮播图跳转详情
|
440
|
// 轮播图跳转详情
|
433
|
- care: function(id, care_name) {
|
441
|
+ care: function (id, care_name) {
|
434
|
api.openWin({
|
442
|
api.openWin({
|
435
|
name: 'care_w',
|
443
|
name: 'care_w',
|
436
|
url: './care_w.html',
|
444
|
url: './care_w.html',
|
|
@@ -440,141 +448,137 @@ |
|
@@ -440,141 +448,137 @@ |
440
|
}
|
448
|
}
|
441
|
})
|
449
|
})
|
442
|
},
|
450
|
},
|
443
|
- getUserIndexInfo: function() {
|
451
|
+ getUserIndexInfo: function () {
|
444
|
var header = {
|
452
|
var header = {
|
445
|
"XX-Device-Type": getDevice(),
|
453
|
"XX-Device-Type": getDevice(),
|
446
|
'XX-Token': getToken()
|
454
|
'XX-Token': getToken()
|
447
|
};
|
455
|
};
|
448
|
- getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function(res) {
|
456
|
+ getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
|
449
|
// alert(JSON.stringify(res))
|
457
|
// alert(JSON.stringify(res))
|
450
|
- if(res.data.code == 1) {
|
458
|
+ if (res.data.code == 1) {
|
451
|
app.user_info = res.data.data;
|
459
|
app.user_info = res.data.data;
|
452
|
} else {}
|
460
|
} else {}
|
453
|
})
|
461
|
})
|
454
|
},
|
462
|
},
|
455
|
// 获取分类图标
|
463
|
// 获取分类图标
|
456
|
- cat: function() {
|
|
|
457
|
- getRequest('post', 'portal/index/cat', null, null).then(function(res) {
|
|
|
458
|
- if(res.data.code == 1) {
|
464
|
+ cat: function () {
|
|
|
465
|
+ getRequest('post', 'portal/index/cat', null, null).then(function (res) {
|
|
|
466
|
+ if (res.data.code == 1) {
|
459
|
app.cat_data = res.data.data;
|
467
|
app.cat_data = res.data.data;
|
460
|
// loadEnd();
|
468
|
// loadEnd();
|
461
|
} else {}
|
469
|
} else {}
|
462
|
})
|
470
|
})
|
463
|
},
|
471
|
},
|
464
|
// 跳转分类列表
|
472
|
// 跳转分类列表
|
465
|
- openItem: function(id, name) {
|
|
|
466
|
- var url = id=='1'?'nursing_f':(id=='2'||id=='3'||id=='6')?'disease_f':(id=='4')
|
|
|
467
|
- switch(id) {
|
473
|
+ openItem: function (id, name) {
|
|
|
474
|
+ switch (id) {
|
468
|
case 1:
|
475
|
case 1:
|
469
|
url = 'nursing_f'
|
476
|
url = 'nursing_f'
|
470
|
- openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {
|
|
|
471
|
- cid: id,
|
|
|
472
|
- cityname: app.cityname
|
|
|
473
|
- });
|
477
|
+ // openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {
|
|
|
478
|
+ // cid: id,
|
|
|
479
|
+ // cityname: app.cityname
|
|
|
480
|
+ // });
|
474
|
break;
|
481
|
break;
|
475
|
case 2:
|
482
|
case 2:
|
476
|
url = 'disease_f'
|
483
|
url = 'disease_f'
|
477
|
- openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
478
|
- cid: id,
|
|
|
479
|
- cityname: app.cityname
|
|
|
480
|
- });
|
484
|
+ // openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
485
|
+ // cid: id,
|
|
|
486
|
+ // cityname: app.cityname
|
|
|
487
|
+ // });
|
481
|
break;
|
488
|
break;
|
482
|
case 3:
|
489
|
case 3:
|
483
|
url = 'disease_f'
|
490
|
url = 'disease_f'
|
484
|
- openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
485
|
- cid: id,
|
|
|
486
|
- cityname: app.cityname
|
|
|
487
|
- });
|
491
|
+ // openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
492
|
+ // cid: id,
|
|
|
493
|
+ // cityname: app.cityname
|
|
|
494
|
+ // });
|
488
|
break;
|
495
|
break;
|
489
|
case 4:
|
496
|
case 4:
|
490
|
url = 'examination_f'
|
497
|
url = 'examination_f'
|
491
|
- openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
492
|
- cid: id,
|
|
|
493
|
- cityname: app.cityname
|
|
|
494
|
- });
|
498
|
+ // openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
499
|
+ // cid: id,
|
|
|
500
|
+ // cityname: app.cityname
|
|
|
501
|
+ // });
|
495
|
break;
|
502
|
break;
|
496
|
case 5:
|
503
|
case 5:
|
497
|
url = 'doc_home_w'
|
504
|
url = 'doc_home_w'
|
498
|
- api.openWin({
|
|
|
499
|
- name: 'doc_home_w',
|
|
|
500
|
- url: './doc_home_w.html',
|
|
|
501
|
- pageParam: {
|
|
|
502
|
- cid: id,
|
|
|
503
|
- cityname: app.cityname
|
|
|
504
|
- }
|
|
|
505
|
- });
|
|
|
506
|
break;
|
505
|
break;
|
507
|
case 6:
|
506
|
case 6:
|
508
|
url = 'disease_f'
|
507
|
url = 'disease_f'
|
509
|
- openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
510
|
- cid: id,
|
|
|
511
|
- cityname: app.cityname
|
|
|
512
|
- });
|
508
|
+ // openView('disease_f', 'index/disease_f', name, 'disease_f', false, {
|
|
|
509
|
+ // cid: id,
|
|
|
510
|
+ // cityname: app.cityname
|
|
|
511
|
+ // });
|
513
|
break;
|
512
|
break;
|
514
|
case 7:
|
513
|
case 7:
|
515
|
url = 'examination_f'
|
514
|
url = 'examination_f'
|
516
|
- openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
517
|
- cid: id,
|
|
|
518
|
- cityname: app.cityname
|
|
|
519
|
- });
|
515
|
+ // openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
516
|
+ // cid: id,
|
|
|
517
|
+ // cityname: app.cityname
|
|
|
518
|
+ // });
|
520
|
break;
|
519
|
break;
|
521
|
case 8:
|
520
|
case 8:
|
522
|
url = 'examination_f'
|
521
|
url = 'examination_f'
|
523
|
- openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
524
|
- cid: id,
|
|
|
525
|
- cityname: app.cityname
|
|
|
526
|
- });
|
522
|
+ // openView('examination_f', 'index/examination_f', name, 'examination_f', false, {
|
|
|
523
|
+ // cid: id,
|
|
|
524
|
+ // cityname: app.cityname
|
|
|
525
|
+ // });
|
527
|
break;
|
526
|
break;
|
528
|
case 9:
|
527
|
case 9:
|
529
|
url = 'examination_f'
|
528
|
url = 'examination_f'
|
530
|
- api.openWin({
|
|
|
531
|
- name: 'Insurance_w',
|
|
|
532
|
- url: './Insurance_w.html',
|
|
|
533
|
- pageParam: {
|
|
|
534
|
- cid: id,
|
|
|
535
|
- cityname: app.cityname
|
|
|
536
|
- }
|
|
|
537
|
- });
|
529
|
+ // api.openWin({
|
|
|
530
|
+ // name: 'Insurance_w',
|
|
|
531
|
+ // url: './Insurance_w.html',
|
|
|
532
|
+ // pageParam: {
|
|
|
533
|
+ // cid: id,
|
|
|
534
|
+ // cityname: app.cityname
|
|
|
535
|
+ // }
|
|
|
536
|
+ // });
|
538
|
break;
|
537
|
break;
|
539
|
case 10:
|
538
|
case 10:
|
540
|
- api.openWin({
|
|
|
541
|
- name: 'tral_w',
|
|
|
542
|
- url: './tral_w.html',
|
|
|
543
|
- pageParam: {
|
|
|
544
|
- cid: id,
|
|
|
545
|
- cityname: app.cityname
|
|
|
546
|
- }
|
|
|
547
|
- });
|
539
|
+ url = 'tral_w'
|
|
|
540
|
+ // api.openWin({
|
|
|
541
|
+ // name: 'tral_w',
|
|
|
542
|
+ // url: './tral_w.html',
|
|
|
543
|
+ // pageParam: {
|
|
|
544
|
+ // cid: id,
|
|
|
545
|
+ // cityname: app.cityname
|
|
|
546
|
+ // }
|
|
|
547
|
+ // });
|
548
|
break;
|
548
|
break;
|
549
|
// default:
|
549
|
// default:
|
550
|
// openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {cid: id});
|
550
|
// openView('nursing_f', 'index/nursing_f', name, 'nursing_f', false, {cid: id});
|
551
|
// return;
|
551
|
// return;
|
552
|
}
|
552
|
}
|
|
|
553
|
+ localStorage.setItem('cid', id)
|
|
|
554
|
+ localStorage.setItem('cityName', app.cityname)
|
|
|
555
|
+ localStorage.setItem('winTitle', name)
|
|
|
556
|
+ window.location.href = url + '.html'
|
553
|
},
|
557
|
},
|
554
|
// 获取第三栏列表
|
558
|
// 获取第三栏列表
|
555
|
- indexList: function() {
|
|
|
556
|
- getRequest('post', 'portal/index/index', null, null).then(function(res) {
|
|
|
557
|
- if(res.data.code == 1) {
|
559
|
+ indexList: function () {
|
|
|
560
|
+ getRequest('post', 'portal/index/index', null, null).then(function (res) {
|
|
|
561
|
+ if (res.data.code == 1) {
|
558
|
app.index_data = res.data.data;
|
562
|
app.index_data = res.data.data;
|
559
|
} else {}
|
563
|
} else {}
|
560
|
-
|
564
|
+
|
561
|
})
|
565
|
})
|
562
|
},
|
566
|
},
|
563
|
// 获取严选推荐列表
|
567
|
// 获取严选推荐列表
|
564
|
- show: function() {
|
|
|
565
|
- getRequest('POST', 'portal/index/show', null, null).then(function(res) {
|
568
|
+ show: function () {
|
|
|
569
|
+ getRequest('POST', 'portal/index/show', null, null).then(function (res) {
|
566
|
// alert(JSON.stringify(res));
|
570
|
// alert(JSON.stringify(res));
|
567
|
- if(res.data.code == 1) {
|
571
|
+ if (res.data.code == 1) {
|
568
|
app.show_data = res.data.data
|
572
|
app.show_data = res.data.data
|
569
|
} else {}
|
573
|
} else {}
|
570
|
})
|
574
|
})
|
571
|
},
|
575
|
},
|
572
|
//底部菜单跳转
|
576
|
//底部菜单跳转
|
573
|
- changeTab(index){
|
|
|
574
|
- var url = index==0?'index_f.html':index == 1?'../strict/strict_f.html':'../my/my_f.html'
|
577
|
+ changeTab(index) {
|
|
|
578
|
+ var url = index == 0 ? 'index_f.html' : index == 1 ? '../strict/strict_f.html' : '../my/my_f.html'
|
575
|
window.location.href = url
|
579
|
window.location.href = url
|
576
|
}
|
580
|
}
|
577
|
|
581
|
|
578
|
- }
|
|
|
579
|
- })
|
582
|
+ }
|
|
|
583
|
+ })
|
580
|
</script> |
584
|
</script> |