|
@@ -1,6 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="Page">
|
3
|
3
|
<MainPageContainer :ShowMainHeader="true" :ShowMainHeaderBack="true" MainHeaderTitle="大乐透">
|
|
4
|
+ <div id="BaiDuMap" style="display: none;"></div>
|
4
|
5
|
<div class="PageContainer flex-v">
|
5
|
6
|
<div class="flex-item">
|
6
|
7
|
<div>
|
|
@@ -114,6 +115,8 @@ export default {
|
114
|
115
|
name: '',
|
115
|
116
|
data () {
|
116
|
117
|
return {
|
|
118
|
+ Lat: '',
|
|
119
|
+ Lng: '',
|
117
|
120
|
MyStoreList: [], // 我的店铺
|
118
|
121
|
CurrentStoreName: null, // 当前选择店铺名称
|
119
|
122
|
CurrentStoreId: null, // 当前选择店铺id
|
|
@@ -141,26 +144,17 @@ export default {
|
141
|
144
|
created () {
|
142
|
145
|
this.PageList = [...this.DaLeTouCart]
|
143
|
146
|
this.CheckOrderCount() // 计算订单倍数、金额
|
144
|
|
- this.GetStoreList({
|
145
|
|
- queryData: {
|
146
|
|
- location: '114.16936109999999,22.3193039',
|
147
|
|
- lotteryId: 'lottery'
|
148
|
|
- }
|
149
|
|
- }).then((res) => {
|
150
|
|
- this.StoreList = res.data.data.nearest || []
|
151
|
|
- this.RecommendStoreList = res.data.data.recommend || []
|
152
|
|
- this.MyStoreList = res.data.data.mine || []
|
153
|
|
- if (this.MyStoreList.length) {
|
154
|
|
- this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
|
155
|
|
- this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
|
156
|
|
- } else if (this.RecommendStoreList.length) {
|
157
|
|
- this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
|
158
|
|
- this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
|
159
|
|
- } else if (this.StoreList.length) {
|
160
|
|
- this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
|
161
|
|
- this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
|
|
147
|
+ let map = new window.BMap.Geolocation()
|
|
148
|
+ let _that = this
|
|
149
|
+ map.getCurrentPosition(function (res) {
|
|
150
|
+ if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
|
|
151
|
+ _that.Lat = res.point.lat
|
|
152
|
+ _that.Lng = res.point.lng
|
|
153
|
+ _that.ToGetStoreList()
|
|
154
|
+ } else {
|
|
155
|
+ console.log('failed' + this.getStatus())
|
162
|
156
|
}
|
163
|
|
- })
|
|
157
|
+ }, { enableHighAccuracy: true })
|
164
|
158
|
},
|
165
|
159
|
mounted () {
|
166
|
160
|
this.$nextTick(() => {
|
|
@@ -177,6 +171,28 @@ export default {
|
177
|
171
|
'CreateAliPayOrder',
|
178
|
172
|
'GetCurrentUserInfo'
|
179
|
173
|
]),
|
|
174
|
+ ToGetStoreList () {
|
|
175
|
+ this.GetStoreList({
|
|
176
|
+ queryData: {
|
|
177
|
+ location: `${this.Lng},${this.Lat}`,
|
|
178
|
+ lotteryId: 'lottery'
|
|
179
|
+ }
|
|
180
|
+ }).then((res) => {
|
|
181
|
+ this.StoreList = res.data.data.nearest || []
|
|
182
|
+ this.RecommendStoreList = res.data.data.recommend || []
|
|
183
|
+ this.MyStoreList = res.data.data.mine || []
|
|
184
|
+ if (this.MyStoreList.length) {
|
|
185
|
+ this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
|
|
186
|
+ this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
|
|
187
|
+ } else if (this.RecommendStoreList.length) {
|
|
188
|
+ this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
|
|
189
|
+ this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
|
|
190
|
+ } else if (this.StoreList.length) {
|
|
191
|
+ this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
|
|
192
|
+ this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
|
|
193
|
+ }
|
|
194
|
+ })
|
|
195
|
+ },
|
180
|
196
|
SelectStore (item) { // 选择店铺
|
181
|
197
|
if (this.DataLock) return
|
182
|
198
|
this.DataLock = true
|