|
@@ -156,37 +156,37 @@ export default {
|
156
|
156
|
link: `${window.location.origin}${window.location.pathname}#/mainPage/indexPage`,
|
157
|
157
|
thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
|
158
|
158
|
}).then(() => {
|
159
|
|
- wx.getLocation({
|
160
|
|
- type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
161
|
|
- success: function (res) {
|
162
|
|
- let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
163
|
|
- let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
164
|
|
- for (let i = 0; i < that.CaseList.length; i++) {
|
165
|
|
- let result = that.CaseList[i].Coordinate.split(",")
|
166
|
|
- let latitude2 = parseFloat(result[0])
|
167
|
|
- let longitude2 = parseFloat(result[1])
|
168
|
|
- if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
169
|
|
- that.currentCaseId = that.CaseList[i].CaseId
|
170
|
|
- that.currentCaseName = that.CaseList[i].CaseName
|
171
|
|
- }
|
172
|
|
- }
|
173
|
|
- if (!that.currentCaseId || !that.currentCaseName) {
|
174
|
|
- that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
175
|
|
- that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
159
|
+ })
|
|
160
|
+ wx.getLocation({
|
|
161
|
+ type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
162
|
+ success: function (res) {
|
|
163
|
+ let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
|
164
|
+ let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
|
165
|
+ for (let i = 0; i < that.CaseList.length; i++) {
|
|
166
|
+ let result = that.CaseList[i].Coordinate.split(",")
|
|
167
|
+ let latitude2 = parseFloat(result[0])
|
|
168
|
+ let longitude2 = parseFloat(result[1])
|
|
169
|
+ if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
|
170
|
+ that.currentCaseId = that.CaseList[i].CaseId
|
|
171
|
+ that.currentCaseName = that.CaseList[i].CaseName
|
176
|
172
|
}
|
177
|
|
- that.init()
|
178
|
|
- },
|
179
|
|
- cancel: function () {
|
180
|
|
- that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
181
|
|
- that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
182
|
|
- that.init()
|
183
|
|
- },
|
184
|
|
- fail: function () {
|
|
173
|
+ }
|
|
174
|
+ if (!that.currentCaseId || !that.currentCaseName) {
|
185
|
175
|
that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
186
|
176
|
that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
187
|
|
- that.init()
|
188
|
177
|
}
|
189
|
|
- })
|
|
178
|
+ that.init()
|
|
179
|
+ },
|
|
180
|
+ cancel: function () {
|
|
181
|
+ that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
|
182
|
+ that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
183
|
+ that.init()
|
|
184
|
+ },
|
|
185
|
+ fail: function () {
|
|
186
|
+ that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
|
187
|
+ that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
188
|
+ that.init()
|
|
189
|
+ }
|
190
|
190
|
})
|
191
|
191
|
},
|
192
|
192
|
selectCaseId () { // 选择案场
|