xcx пре 4 година
родитељ
комит
47676a9cdd

+ 1
- 0
index.html Прегледај датотеку

@@ -6,6 +6,7 @@
6 6
   <meta content='width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0' name='viewport'>
7 7
   <meta name="referrer" content="no-referrer">
8 8
   <link rel="stylesheet" href="//at.alicdn.com/t/font_2022160_f7cp731cw5p.css">
9
+  <script src="//api.map.baidu.com/api?v=2.0&ak=NH4DjAzwLcPkHgwBLWcfeZfr3uUnTlwk"></script>
9 10
   <title>牛彩</title>
10 11
   <script>
11 12
     let Width = document.documentElement.clientWidth / 375 * 100

+ 35
- 19
src/pages/index/DaLeTouDingDan/index.vue Прегледај датотеку

@@ -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

+ 15
- 3
src/pages/index/LanQiuDingDan/index.vue Прегледај датотеку

@@ -134,6 +134,8 @@ export default {
134 134
   name: '',
135 135
   data () {
136 136
     return {
137
+      Lat: '',
138
+      Lng: '',
137 139
       MyStoreList: [],
138 140
       PriceArr: [0, 0], // 奖金区间
139 141
       AllParts: [], // 投注生成结果
@@ -188,7 +190,17 @@ export default {
188 190
     ]),
189 191
     Init () { // 初始化
190 192
       this.PageList = [...this.LanQiuCart] // 赋值页面数据
191
-      this.ToGetStoreList() // 获取店铺列表
193
+      let map = new window.BMap.Geolocation()
194
+      let _that = this
195
+      map.getCurrentPosition(function (res) {
196
+        if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
197
+          _that.Lat = res.point.lat
198
+          _that.Lng = res.point.lng
199
+          _that.ToGetStoreList()
200
+        } else {
201
+          console.log('failed' + this.getStatus())
202
+        }
203
+      }, { enableHighAccuracy: true })
192 204
       if (this.$route.query.type === 'single') { // 单关
193 205
         this.CurrentPassCode = '1*1'
194 206
         this.ToGetAllParts() // 枚举投注
@@ -257,8 +269,8 @@ export default {
257 269
     ToGetStoreList () { // 获取店铺列表
258 270
       this.GetStoreList({
259 271
         queryData: {
260
-          location: '114.16936109999999,22.3193039',
261
-          lotteryId: 'lottery'
272
+          location: `${this.Lng},${this.Lat}`,
273
+          lotteryId: 'basketball'
262 274
         }
263 275
       }).then((res) => {
264 276
         let StoreList = res.data.data.nearest || []

+ 16
- 1
src/pages/index/PaiLie3DingDan/index.vue Прегледај датотеку

@@ -159,6 +159,8 @@ export default {
159 159
   name: '',
160 160
   data () {
161 161
     return {
162
+      Lat: '',
163
+      Lng: '',
162 164
       MyStoreList: [],
163 165
       CurrentStoreName: null, // 当前选择店铺名称
164 166
       CurrentStoreId: null, // 当前选择店铺id
@@ -200,9 +202,22 @@ export default {
200 202
     Init () {
201 203
       this.PageList = [...this.PaiLie3Cart]
202 204
       this.CalcTotalCount()
205
+      let map = new window.BMap.Geolocation()
206
+      let _that = this
207
+      map.getCurrentPosition(function (res) {
208
+        if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
209
+          _that.Lat = res.point.lat
210
+          _that.Lng = res.point.lng
211
+          _that.ToGetStoreList()
212
+        } else {
213
+          console.log('failed' + this.getStatus())
214
+        }
215
+      }, { enableHighAccuracy: true })
216
+    },
217
+    ToGetStoreList () {
203 218
       this.GetStoreList({
204 219
         queryData: {
205
-          location: '114.16936109999999,22.3193039',
220
+          location: `${this.Lng},${this.Lat}`,
206 221
           lotteryId: 'p3'
207 222
         }
208 223
       }).then((res) => {

+ 16
- 2
src/pages/index/PaiLie5DingDan/index.vue Прегледај датотеку

@@ -150,6 +150,8 @@ export default {
150 150
   name: '',
151 151
   data () {
152 152
     return {
153
+      Lat: '',
154
+      Lng: '',
153 155
       MyStoreList: [],
154 156
       CurrentStoreName: null, // 当前选择店铺名称
155 157
       CurrentStoreId: null, // 当前选择店铺id
@@ -197,12 +199,24 @@ export default {
197 199
     ]),
198 200
     Init () { // 初始化
199 201
       this.PageList = [...this.PaiLie5Cart]
200
-      console.log(this.PageList)
202
+      let map = new window.BMap.Geolocation()
203
+      let _that = this
204
+      map.getCurrentPosition(function (res) {
205
+        if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
206
+          _that.Lat = res.point.lat
207
+          _that.Lng = res.point.lng
208
+          _that.ToGetStoreList()
209
+        } else {
210
+          console.log('failed' + this.getStatus())
211
+        }
212
+      }, { enableHighAccuracy: true })
201 213
       this.CalcTotalCount()
202 214
       this.CreateData()
215
+    },
216
+    ToGetStoreList () {
203 217
       this.GetStoreList({
204 218
         queryData: {
205
-          location: '114.16936109999999,22.3193039',
219
+          location: `${this.Lng},${this.Lat}`,
206 220
           lotteryId: 'p5'
207 221
         }
208 222
       }).then((res) => {

+ 34
- 19
src/pages/index/ShuangSeQiuDingDan/index.vue Прегледај датотеку

@@ -113,6 +113,8 @@ export default {
113 113
   name: '',
114 114
   data () {
115 115
     return {
116
+      Lat: '',
117
+      Lng: '',
116 118
       MyStoreList: [],
117 119
       CurrentStoreName: null, // 当前选择店铺名称
118 120
       CurrentStoreId: null, // 当前选择店铺id
@@ -139,26 +141,17 @@ export default {
139 141
   created () {
140 142
     this.PageList = [...this.ShuangSeQiuCart]
141 143
     this.CheckOrderCount() // 计算订单倍数、金额
142
-    this.GetStoreList({
143
-      queryData: {
144
-        location: '114.16936109999999,22.3193039',
145
-        lotteryId: 'double-color'
146
-      }
147
-    }).then((res) => {
148
-      this.StoreList = res.data.data.nearest || []
149
-      this.RecommendStoreList = res.data.data.recommend || []
150
-      this.MyStoreList = res.data.data.mine || []
151
-      if (this.MyStoreList.length) {
152
-        this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
153
-        this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
154
-      } else if (this.RecommendStoreList.length) {
155
-        this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
156
-        this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
157
-      } else if (this.StoreList.length) {
158
-        this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
159
-        this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
144
+    let map = new window.BMap.Geolocation()
145
+    let _that = this
146
+    map.getCurrentPosition(function (res) {
147
+      if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
148
+        _that.Lat = res.point.lat
149
+        _that.Lng = res.point.lng
150
+        _that.ToGetStoreList()
151
+      } else {
152
+        console.log('failed' + this.getStatus())
160 153
       }
161
-    })
154
+    }, { enableHighAccuracy: true })
162 155
   },
163 156
   mounted () {
164 157
     this.$nextTick(() => {
@@ -174,6 +167,28 @@ export default {
174 167
       'GetStoreList',
175 168
       'GetCurrentUserInfo'
176 169
     ]),
170
+    ToGetStoreList () {
171
+      this.GetStoreList({
172
+        queryData: {
173
+          location: `${this.Lng},${this.Lat}`,
174
+          lotteryId: 'double-color'
175
+        }
176
+      }).then((res) => {
177
+        this.StoreList = res.data.data.nearest || []
178
+        this.RecommendStoreList = res.data.data.recommend || []
179
+        this.MyStoreList = res.data.data.mine || []
180
+        if (this.MyStoreList.length) {
181
+          this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
182
+          this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
183
+        } else if (this.RecommendStoreList.length) {
184
+          this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
185
+          this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
186
+        } else if (this.StoreList.length) {
187
+          this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
188
+          this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
189
+        }
190
+      })
191
+    },
177 192
     ResToString (target) {
178 193
       let arr = []
179 194
       target.map((item) => {

+ 15
- 4
src/pages/index/ZuQiuDingDan/index.vue Прегледај датотеку

@@ -134,6 +134,8 @@ export default {
134 134
   name: '',
135 135
   data () {
136 136
     return {
137
+      Lat: '',
138
+      Lng: '',
137 139
       MyStoreList: [],
138 140
       PriceArr: [0, 0], // 奖金区间
139 141
       AllParts: [], // 投注生成结果
@@ -188,8 +190,17 @@ export default {
188 190
     ]),
189 191
     Init () { // 初始化
190 192
       this.PageList = [...this.ZuQiuCart] // 赋值页面数据
191
-      console.log(this.FootballKeys)
192
-      this.ToGetStoreList() // 获取店铺列表
193
+      let map = new window.BMap.Geolocation()
194
+      let _that = this
195
+      map.getCurrentPosition(function (res) {
196
+        if (this.getStatus() === window.BMAP_STATUS_SUCCESS) {
197
+          _that.Lat = res.point.lat
198
+          _that.Lng = res.point.lng
199
+          _that.ToGetStoreList()
200
+        } else {
201
+          console.log('failed' + this.getStatus())
202
+        }
203
+      }, { enableHighAccuracy: true })
193 204
       if (this.$route.query.type === 'single') { // 单关
194 205
         this.CurrentPassCode = '1*1'
195 206
         this.ToGetAllParts() // 枚举投注
@@ -258,8 +269,8 @@ export default {
258 269
     ToGetStoreList () { // 获取店铺列表
259 270
       this.GetStoreList({
260 271
         queryData: {
261
-          location: '114.16936109999999,22.3193039',
262
-          lotteryId: 'lottery'
272
+          location: `${this.Lng},${this.Lat}`,
273
+          lotteryId: 'football'
263 274
         }
264 275
       }).then((res) => {
265 276
         let StoreList = res.data.data.nearest || []