jufubao-third 1.0.22-beta4 → 1.0.22-beta5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-third",
3
- "version": "1.0.22-beta4",
3
+ "version": "1.0.22-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -158,34 +158,20 @@
158
158
  * @description 根据关键词搜索地点(预览模式下底层自动使用Mock.js数据,无需keyword与定位)
159
159
  */
160
160
  getList(){
161
- //预览模式:加载默认mock数据,不校验keyword、不校验定位
162
- if (this.$configProject['isPreview']) {
163
- jfbRootExec("searchRidePlaces", {
164
- vm: this,
165
- data: {
166
- channel_code: "amapcar",
167
- keyword: '',
168
- lng: '',
169
- lat: '',
170
- }
171
- }).then(res => {
172
- this.placeList = (res && res.list) || [];
173
- this.locateFailed = false;
174
- }).catch(err => {
175
- console.warn('searchRidePlaces error', err);
176
- });
177
- return;
178
- }
179
- if (!this.keyword) return;
180
- //定位失败时禁止请求搜索接口
181
- if (this.locateFailed) {
182
- console.warn('定位失败,禁止搜索');
183
- return;
161
+ const isPreview = this.$configProject['isPreview'];
162
+ //预览模式无需keyword;非预览模式必须有关键词,且定位失败时禁止搜索
163
+ if (!isPreview) {
164
+ if (!this.keyword) return;
165
+ if (this.locateFailed) {
166
+ console.warn('定位失败,禁止搜索');
167
+ return;
168
+ }
184
169
  }
185
170
  //坐标兼容:mixin返回longitude/latitude,此处映射为接口所需的lng/lat
186
171
  const coords = this.currentCoords || {};
187
172
  const lng = coords.lng !== undefined ? coords.lng : coords.longitude;
188
173
  const lat = coords.lat !== undefined ? coords.lat : coords.latitude;
174
+ //统一调用jfbRootExec:预览模式底层自动命中Mock.js数据
189
175
  jfbRootExec("searchRidePlaces", {
190
176
  vm: this,
191
177
  data: {
@@ -196,6 +182,7 @@
196
182
  }
197
183
  }).then(res => {
198
184
  this.placeList = (res && res.list) || [];
185
+ this.locateFailed = false;
199
186
  }).catch(err => {
200
187
  console.warn('searchRidePlaces error', err);
201
188
  });