jufubao-mall 2.0.35-beta9 → 2.0.35-beta91
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 +1 -1
- package/src/components/JfbMallCart/JfbMallCart.vue +21 -4
- package/src/components/JfbMallConfirm/JfbMallConfirm.vue +33 -10
- package/src/components/JfbMallConfirm/cusAttr/style.js +41 -1
- package/src/components/JfbMallResourceShop/XdBaiduMap.vue +3 -3
- package/src/components/JfbMallShop/XdBaiduMap.vue +3 -3
- package/src/components/JfbMallShopVip/Api.js +3 -11
- package/src/components/JfbMallShopVip/CusShops.vue +591 -0
- package/src/components/JfbMallShopVip/JfbMallShopVip.vue +458 -655
- package/src/components/JfbMallShopVip/Mock.js +448 -221
- package/src/components/JfbMallShopVip/XdBaiduMap.vue +48 -336
- package/src/components/JfbMallShopVip/cusAttr/advanced.js +69 -11
- package/src/components/JfbMallShopVip/cusAttr/content.js +35 -32
- package/src/components/JfbMallShopVip/cusAttr/shops.js +65 -5
- package/src/components/JfbMallShopVip/cusAttr/style.js +3 -1
|
@@ -9,65 +9,60 @@
|
|
|
9
9
|
<!-- #endif -->
|
|
10
10
|
<view class="jfb-mall-shop-vip__body">
|
|
11
11
|
<view class="outer-box" :style="[bodyStyleComp]">
|
|
12
|
-
<!--
|
|
12
|
+
<!--tab-->
|
|
13
13
|
<view
|
|
14
|
-
class="
|
|
15
|
-
|
|
14
|
+
class="shop_tabs"
|
|
15
|
+
:style="[tabsStyleComp]"
|
|
16
|
+
v-if="titleList.length > 1"
|
|
16
17
|
>
|
|
17
18
|
<view
|
|
18
|
-
class="
|
|
19
|
-
|
|
19
|
+
class="tab_item"
|
|
20
|
+
v-for="(item,index) in titleList"
|
|
21
|
+
:key="index"
|
|
22
|
+
:class="{short: tabLayout === 'v2'}"
|
|
23
|
+
@click="tab=item.value"
|
|
24
|
+
:style="[tab === item.value?tabActItemStyleComp:tabItemStyleComp]"
|
|
20
25
|
>
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
<text>{{item.label}}</text>
|
|
27
|
+
<text v-if="titleList.length > 1 && tab === item.value && ['v1', 'v2'].includes(tabLayout)" class="lineX"></text>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
<!--tab-->
|
|
31
|
+
<!--map-->
|
|
32
|
+
<view class="shop_map" v-if="initBaidu">
|
|
33
|
+
<view class="mpa_wrap" :class="{close: !mapIsExtend}">
|
|
26
34
|
<!--#ifdef H5-->
|
|
27
35
|
<xd-baidu-map
|
|
28
|
-
v-if="
|
|
36
|
+
v-if="initBaidu"
|
|
37
|
+
:myPosition="myPosition"
|
|
29
38
|
:markets="marketList"
|
|
30
39
|
:ak="uiBaiduAk"
|
|
31
40
|
:center="mapCenter"
|
|
32
|
-
@
|
|
33
|
-
@on-close-marker="(item)=>{handleShowMarker(item,false)}"
|
|
34
|
-
@regionchange="handleRegionChange"
|
|
35
|
-
@init="handleH5Init"
|
|
36
|
-
@on-detail="handleBaiduToEvent"
|
|
41
|
+
@onChose="handleChoseShop"
|
|
37
42
|
></xd-baidu-map>
|
|
38
43
|
<!--#endif-->
|
|
39
44
|
<!-- #ifdef MP-WEIXIN -->
|
|
40
45
|
<map
|
|
41
|
-
v-if="mapCenter !== null"
|
|
42
|
-
id="WeiXinMap"
|
|
43
|
-
:show-location="showLocation"
|
|
44
46
|
style="width:100%;height: 100%;"
|
|
47
|
+
show-location
|
|
45
48
|
:longitude="mapCenter.longitude"
|
|
46
49
|
:latitude="mapCenter.latitude"
|
|
47
50
|
:markers="marketList"
|
|
48
51
|
@markertap="handleMarketTap"
|
|
49
|
-
@callouttap="handleWxToEvent"
|
|
50
|
-
@regionchange="handleRegionChange"
|
|
51
52
|
>
|
|
52
53
|
<cover-view
|
|
53
54
|
class="cover_view"
|
|
54
55
|
slot="callout"
|
|
55
56
|
>
|
|
56
57
|
<cover-view
|
|
57
|
-
v-for="(item) in marketList"
|
|
58
|
-
:key="
|
|
58
|
+
v-for="(item,index) in marketList"
|
|
59
|
+
:key="index"
|
|
59
60
|
:marker-id="item.id"
|
|
60
61
|
style="background: rgba(0,0,0,.8);border-radius: 6px;padding: 8px 12px;color: #fff;"
|
|
61
62
|
:style="{display: item.id === showMarkerId ? 'block' : 'none'}"
|
|
62
|
-
>
|
|
63
|
-
<view class="callout-text">
|
|
64
|
-
<text>{{ item.title }}</text>
|
|
65
|
-
<xd-font-icon icon="iconxiangyou_xian" color="#fff" size="28"></xd-font-icon>
|
|
66
|
-
</view>
|
|
67
|
-
</cover-view>
|
|
63
|
+
>{{ item.title }}</cover-view>
|
|
68
64
|
</cover-view>
|
|
69
65
|
</map>
|
|
70
|
-
<view class="weiXinLocation" v-if="mpLocationFn === 'getLocation'" @click="handleWXLocation">定位</view>
|
|
71
66
|
<!-- #endif -->
|
|
72
67
|
</view>
|
|
73
68
|
<view
|
|
@@ -89,66 +84,29 @@
|
|
|
89
84
|
</view>
|
|
90
85
|
<!--map-->
|
|
91
86
|
<!--shop-->
|
|
92
|
-
<view class="shop_list" :style="[contStyleComp]">
|
|
93
|
-
<template v-if="
|
|
87
|
+
<view v-if="showShopList" class="shop_list" :style="[contStyleComp]">
|
|
88
|
+
<template v-if="showShopList.length">
|
|
94
89
|
<scroll-view
|
|
95
90
|
scroll-y
|
|
91
|
+
:scroll-top="scrollTop"
|
|
96
92
|
class="scroll_y"
|
|
97
|
-
:scroll-into-view="intoViewResourceShopId"
|
|
98
|
-
scroll-with-animation
|
|
99
93
|
>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<template v-else-if="nearbyShopList.length >0">
|
|
114
|
-
<template v-for="(item,index) in nearbyShopList">
|
|
115
|
-
<view
|
|
116
|
-
:style="[
|
|
117
|
-
cusStyle.item,
|
|
118
|
-
(index === 0?{marginTop: itemTop + 'rpx'}:{}),
|
|
119
|
-
(index === nearbyShopList.length -1?{marginBottom: 0}:{})
|
|
120
|
-
]"
|
|
121
|
-
class="shop_list-item"
|
|
122
|
-
:class='[{"shop_list-item-act":resource_shop_id === item.resource_shop_id}]'
|
|
123
|
-
:key="item.key"
|
|
124
|
-
:id="`scroll-${item.resource_shop_id}`"
|
|
125
|
-
@click="handleToEvent(item, 'shop')"
|
|
126
|
-
>
|
|
127
|
-
<view class="shop_list-item-title">
|
|
128
|
-
<view class="title">
|
|
129
|
-
<view>{{item.resource_shop_name}}</view>
|
|
130
|
-
<view class="active" v-if="resource_shop_id === item.resource_shop_id">正在预览</view>
|
|
131
|
-
</view>
|
|
132
|
-
<view @click.stop="handleToEvent(item, 'detail')">
|
|
133
|
-
<text>详情</text>
|
|
134
|
-
<xd-font-icon icon="iconxiangyou_xian" color="#999" size="30" width="26" height="26"></xd-font-icon>
|
|
135
|
-
</view>
|
|
136
|
-
</view>
|
|
137
|
-
<view class="address" :style="{marginBottom:item['business_time_name']?'16rpx':0}">
|
|
138
|
-
<view>{{item.address}}</view>
|
|
139
|
-
<view
|
|
140
|
-
v-if="item.distance_conversion || item.distance"
|
|
141
|
-
:style="[cusStyle.distance]"
|
|
142
|
-
>{{item.distance_conversion || item.distance}}</view>
|
|
143
|
-
</view>
|
|
144
|
-
<view class="openTime" v-if="item['business_time_name']">营业时间:{{item['business_time_name']}}</view>
|
|
145
|
-
</view>
|
|
146
|
-
<view v-if="index === nearbyShopList.length -1" :style="{height: itemBottom + 'rpx'}"></view>
|
|
147
|
-
</template>
|
|
148
|
-
</template>
|
|
94
|
+
<cus-shops
|
|
95
|
+
layout="v1"
|
|
96
|
+
:select-id="selectIds"
|
|
97
|
+
:is-show-btn="fastEntryStatus"
|
|
98
|
+
:content="cusContent"
|
|
99
|
+
:cus-style="cusStyle"
|
|
100
|
+
:list="showShopList"
|
|
101
|
+
:main-color="mainColor"
|
|
102
|
+
:sub-main-color="subMainColor"
|
|
103
|
+
:names="cusNames"
|
|
104
|
+
:entry="cusEntry"
|
|
105
|
+
@on-event="handleToEvent"
|
|
106
|
+
></cus-shops>
|
|
149
107
|
</scroll-view>
|
|
150
108
|
</template>
|
|
151
|
-
<xd-no-data icon-type="shop" :scale-size="2" v-if="
|
|
109
|
+
<xd-no-data icon-type="shop" :scale-size="2" v-if="showShopList.length === 0">暂无门店信息</xd-no-data>
|
|
152
110
|
</view>
|
|
153
111
|
<!--shop-->
|
|
154
112
|
</view>
|
|
@@ -161,14 +119,16 @@
|
|
|
161
119
|
import XdNoData from "@/components/XdNoData/XdNoData";
|
|
162
120
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
163
121
|
import JfbMallShopVipMixin from "./JfbMallShopVipMixin";
|
|
164
|
-
import { gCPVal } from "@/utils/xd.base";
|
|
122
|
+
import { getContainerPropsValue,gCPVal } from "@/utils/xd.base";
|
|
165
123
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
166
124
|
import getServiceUrl from "@/common/getServiceUrl";
|
|
125
|
+
import CusShops from "./CusShops.vue"
|
|
167
126
|
// #ifdef H5
|
|
168
127
|
import XdBaiduMap from "./XdBaiduMap"
|
|
169
128
|
// #endif
|
|
170
129
|
import { mapState } from 'vuex';
|
|
171
130
|
import extsMixins from "@/mixins/extsMixins";
|
|
131
|
+
import Color from "color"
|
|
172
132
|
|
|
173
133
|
|
|
174
134
|
export default {
|
|
@@ -176,6 +136,7 @@
|
|
|
176
136
|
components: {
|
|
177
137
|
XdNoData,
|
|
178
138
|
XdFontIcon,
|
|
139
|
+
CusShops,
|
|
179
140
|
// #ifdef H5
|
|
180
141
|
XdBaiduMap,
|
|
181
142
|
// #endif
|
|
@@ -192,24 +153,21 @@
|
|
|
192
153
|
next_page_token: "",
|
|
193
154
|
brand_id: '',
|
|
194
155
|
shop_id: '',
|
|
195
|
-
resource_shop_id:
|
|
196
|
-
intoViewResourceShopId:'',
|
|
156
|
+
resource_shop_id: '',
|
|
197
157
|
|
|
198
158
|
//地图
|
|
199
|
-
|
|
159
|
+
initBaidu: false,
|
|
200
160
|
uiBaiduAk: '',
|
|
201
|
-
mapCenter:
|
|
202
|
-
changStatus: true,
|
|
203
|
-
changeLocation:null,
|
|
161
|
+
mapCenter: [],
|
|
204
162
|
mapIsExtend: true,
|
|
205
163
|
marketList: [],
|
|
206
164
|
myPosition: null,
|
|
207
165
|
showMarkerId: "",
|
|
208
|
-
localImage: '',
|
|
209
166
|
|
|
210
167
|
//tab
|
|
211
168
|
titleList: [],
|
|
212
169
|
tab: "nearby", //nearby,often
|
|
170
|
+
oftenShopList: null,
|
|
213
171
|
nearbyShopList: null,
|
|
214
172
|
curShopId: '',
|
|
215
173
|
toView: '',
|
|
@@ -229,9 +187,6 @@
|
|
|
229
187
|
//style
|
|
230
188
|
bodyPadding: {},
|
|
231
189
|
cusStyle: {},
|
|
232
|
-
cardItemShadowWidth:0,
|
|
233
|
-
itemTop:0,
|
|
234
|
-
itemBottom:0,
|
|
235
190
|
contentBgColor: 'rgba(0,0,0,0)',
|
|
236
191
|
|
|
237
192
|
//选项卡
|
|
@@ -242,18 +197,11 @@
|
|
|
242
197
|
|
|
243
198
|
//高级
|
|
244
199
|
codePath: '', //门店跳转
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
onLoadStatus: false, //小程序onload是否执行
|
|
251
|
-
onLocationStatus: false, //小程序首次定位成功状态
|
|
252
|
-
mpLocationFn:'getFuzzyLocation',
|
|
253
|
-
// #endif
|
|
254
|
-
|
|
255
|
-
isMoved: false, //是否已经移动过
|
|
256
|
-
|
|
200
|
+
cashierPath: '',//支持核销
|
|
201
|
+
buyTicketPath: '',//在线选择
|
|
202
|
+
codeAfterPath: '',//电子码
|
|
203
|
+
hdSelfPath: '',//小时达
|
|
204
|
+
travelfPath: '', //旅游购票
|
|
257
205
|
}
|
|
258
206
|
},
|
|
259
207
|
computed: {
|
|
@@ -261,34 +209,90 @@
|
|
|
261
209
|
stateCity: state => state.cityLocation.city,
|
|
262
210
|
stateLocation: state => state.cityLocation.location || {}
|
|
263
211
|
}),
|
|
264
|
-
|
|
212
|
+
selectIds(){
|
|
213
|
+
let id = '';
|
|
214
|
+
if(!id && this.resource_shop_id) id = this.resource_shop_id;
|
|
215
|
+
if(!id&& this.brand_id) id = this.brand_id;
|
|
216
|
+
if(!id && this.shop_id) id = this.shop_id;
|
|
217
|
+
return id;
|
|
218
|
+
},
|
|
219
|
+
tabActItemStyleComp(){
|
|
220
|
+
if(this.titleList.length === 1) return {
|
|
221
|
+
color: this.tabStyle.color,
|
|
222
|
+
fontSize: this.tabStyle.fontSize + 'rpx',
|
|
223
|
+
fontWeight: this.tabStyle.fontWeight,
|
|
224
|
+
};
|
|
225
|
+
let backgroundColor = '';
|
|
226
|
+
let color = this.mainColor;
|
|
227
|
+
let marginRight = 0;
|
|
228
|
+
if(this.tabLayout === 'v3') {
|
|
229
|
+
if( this.tabStyle.actBgColor) backgroundColor = this.tabStyle.actBgColor;
|
|
230
|
+
else backgroundColor = this.mainColor;
|
|
231
|
+
if( this.tabStyle.actColor) color = this.tabStyle.actColor;
|
|
232
|
+
else color = '#fff';
|
|
233
|
+
marginRight = '20rpx';
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
marginRight,
|
|
237
|
+
color: this.tabStyle.actColor,
|
|
238
|
+
fontSize: this.tabStyle.actFontSize + 'rpx',
|
|
239
|
+
fontWeight: this.tabStyle.actFontWeight,
|
|
240
|
+
backgroundColor: backgroundColor,
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
tabItemStyleComp(){
|
|
244
|
+
if(this.titleList.length === 1) return {
|
|
245
|
+
color: this.tabStyle.color,
|
|
246
|
+
fontSize: this.tabStyle.fontSize + 'rpx',
|
|
247
|
+
fontWeight: this.tabStyle.fontWeight,
|
|
248
|
+
};
|
|
249
|
+
let backgroundColor = '';
|
|
250
|
+
let marginRight = 0;
|
|
251
|
+
if(this.tabLayout === 'v3') {
|
|
252
|
+
backgroundColor = this.tabStyle.bgColor;
|
|
253
|
+
marginRight = '20rpx';
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
marginRight,
|
|
257
|
+
color: this.tabStyle.color,
|
|
258
|
+
fontSize: this.tabStyle.fontSize + 'rpx',
|
|
259
|
+
fontWeight: this.tabStyle.fontWeight,
|
|
260
|
+
backgroundColor: backgroundColor,
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
tabsStyleComp() {
|
|
264
|
+
let padding = '0 24rpx', height = '100rpx';
|
|
265
|
+
if(this.tabLayout === 'v3') {
|
|
266
|
+
padding = '20rpx 24rpx'
|
|
267
|
+
if(this.titleList.length === 1) padding = '16rpx 0'
|
|
268
|
+
height = '60rpx';
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
padding,
|
|
272
|
+
height,
|
|
273
|
+
lineHeight: height,
|
|
274
|
+
backgroundColor: this.tabBgColor,
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
showShopList(){
|
|
278
|
+
return this.tab === 'nearby' ? this.nearbyShopList : this.oftenShopList
|
|
279
|
+
},
|
|
265
280
|
bodyStyleComp(){
|
|
266
281
|
return {
|
|
267
282
|
height: this.layoutInfo.bodyMinHeightRpx + 'rpx',
|
|
268
283
|
'--main-color': this.tabStyle.actColor,
|
|
269
|
-
'--main-alpha-color': this.$colorChange(this.mainColor).alpha(0.
|
|
270
|
-
'--main-alpha5-color': this.$colorChange(this.mainColor).alpha(0.2).toString()
|
|
284
|
+
'--main-alpha-color': this.$colorChange(this.mainColor).alpha(0.1).toString()
|
|
271
285
|
}
|
|
272
286
|
},
|
|
273
287
|
contStyleComp(){
|
|
274
288
|
let height = this.layoutInfo.bodyMinHeightRpx - 72;
|
|
275
|
-
let padding = this.getMarginAndPadding(this.bodyPadding, 0);
|
|
276
289
|
//大于一个标签显示标签
|
|
277
290
|
if(this.titleList.length > 1) height = height - 100;
|
|
278
|
-
if(this.mapIsExtend) height = height -
|
|
279
|
-
|
|
280
|
-
//有投影信息
|
|
281
|
-
if(this.cardItemShadowWidth > 0) {
|
|
282
|
-
padding = 0;
|
|
283
|
-
}
|
|
284
|
-
//无投影信息
|
|
285
|
-
else {
|
|
286
|
-
height = height - this.getPMValue(this.bodyPadding, 'TB', 0);
|
|
287
|
-
}
|
|
288
|
-
|
|
291
|
+
if(this.mapIsExtend) height = height - 400;
|
|
292
|
+
height = height - this.getPMValue(this.bodyPadding, 'TB', 0);
|
|
289
293
|
return {
|
|
290
294
|
height: height + 'rpx',
|
|
291
|
-
padding:
|
|
295
|
+
padding: this.getMarginAndPadding(this.bodyPadding, 0),
|
|
292
296
|
backgroundColor: this.contentBgColor
|
|
293
297
|
}
|
|
294
298
|
},
|
|
@@ -298,42 +302,252 @@
|
|
|
298
302
|
if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
|
|
299
303
|
if (this.$configProject['isPreview']) this.init(value)
|
|
300
304
|
},
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
+
tab(value) {
|
|
306
|
+
this.hasNext = true;
|
|
307
|
+
this.page_token = '1';
|
|
308
|
+
this.next_page_token = ''
|
|
309
|
+
this.marketList = []
|
|
310
|
+
if (value === 'nearby') {
|
|
305
311
|
this.getNearbyShop();
|
|
312
|
+
} else {
|
|
313
|
+
this.getOftenShop();
|
|
306
314
|
}
|
|
307
315
|
},
|
|
308
|
-
|
|
309
|
-
if(
|
|
316
|
+
stateCity(n, o) {
|
|
317
|
+
if (n && JSON.stringify(n) !== JSON.stringify(o)) {
|
|
318
|
+
console.warn('stateCity');
|
|
319
|
+
if (this.tab === 'nearby') {
|
|
320
|
+
this.getNearbyShop();
|
|
321
|
+
} else {
|
|
322
|
+
this.getOftenShop();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
310
325
|
},
|
|
311
|
-
onLocationStatus(){
|
|
312
|
-
if(this.onLoadStatus && this.onLocationStatus) this.getNearbyShop()
|
|
313
|
-
}
|
|
314
326
|
},
|
|
315
327
|
created() {
|
|
316
328
|
this.init(this.container);
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
mounted() {
|
|
320
|
-
this.$nextTick(()=>{
|
|
321
|
-
this.isEmptySetMapCenter();
|
|
322
|
-
})
|
|
323
329
|
},
|
|
324
|
-
|
|
325
330
|
methods: {
|
|
326
331
|
onJfbLoad(options) {
|
|
327
332
|
this.setNameSpace(options, false);
|
|
328
333
|
this.uiBaiduAk = this.baiduAk || this.$settings.baiduAk;
|
|
334
|
+
this.myPosition = {
|
|
335
|
+
lng: this.stateLocation.longitude,
|
|
336
|
+
lat: this.stateLocation.latitude,
|
|
337
|
+
}
|
|
329
338
|
if(options.shop_id) this.shop_id = options.shop_id;
|
|
330
339
|
if(options.brand_id) this.brand_id = options.brand_id;
|
|
331
|
-
if(options.resource_shop_id) this.resource_shop_id =
|
|
332
|
-
if(
|
|
333
|
-
|
|
340
|
+
if(options.resource_shop_id) this.resource_shop_id = options.resource_shop_id;
|
|
341
|
+
if(options.callback) {
|
|
342
|
+
try{
|
|
343
|
+
let callback = Base64.decode(options.callback);
|
|
344
|
+
let page = this.$xdUniHelper.parseURL(callback);
|
|
345
|
+
if(page.params && page.params.resource_shop_id) delete page.params.resource_shop_id;
|
|
346
|
+
|
|
347
|
+
//相同应用
|
|
348
|
+
if(page.path.indexOf(`/${this.projectAttr['deploy_dir']}/`) === 0) {
|
|
349
|
+
callback = page.path.replace(`/${this.projectAttr['deploy_dir']}/`,'/');
|
|
350
|
+
}
|
|
351
|
+
//不同应用
|
|
352
|
+
else {
|
|
353
|
+
// #ifdef H5
|
|
354
|
+
callback = `//${this.projectAttr['host']}${page.path}`;
|
|
355
|
+
// #endif
|
|
356
|
+
|
|
357
|
+
//#ifdef MP-WEIXIN
|
|
358
|
+
//todo
|
|
359
|
+
// #endif
|
|
360
|
+
}
|
|
361
|
+
//设置参数
|
|
362
|
+
if(page.params) this.callbackParams = page.params
|
|
363
|
+
this.isCallback = callback;
|
|
364
|
+
}
|
|
365
|
+
catch (e){
|
|
366
|
+
console.error(e);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (this.tab === 'nearby') {
|
|
371
|
+
this.getNearbyShop();
|
|
372
|
+
} else {
|
|
373
|
+
this.getOftenShop();
|
|
374
|
+
}
|
|
334
375
|
},
|
|
376
|
+
getParams(){
|
|
377
|
+
let params = {
|
|
378
|
+
latitude: this.stateLocation.latitude + '',
|
|
379
|
+
longitude: this.stateLocation.longitude + '',
|
|
380
|
+
page_size: 20,
|
|
381
|
+
page_token: this.page_token + '',
|
|
382
|
+
keyword: this.keyword,
|
|
383
|
+
xnamespace: this.xnamespace,
|
|
384
|
+
consume_mode: this.serverType.join(','),
|
|
385
|
+
}
|
|
386
|
+
if(this.brand_id) params['brand_id'] = this.brand_id;
|
|
387
|
+
if(this.keyword) params['keyword'] = this.keyword
|
|
388
|
+
return params
|
|
389
|
+
},
|
|
390
|
+
isEmptySetMapCenter(){
|
|
391
|
+
if(this.stateLocation.latitude && this.stateLocation.longitude) {
|
|
392
|
+
// #ifdef H5
|
|
393
|
+
this.mapCenter = {
|
|
394
|
+
lng: this.stateLocation.longitude,
|
|
395
|
+
lat: this.stateLocation.latitude
|
|
396
|
+
}
|
|
397
|
+
// #endif
|
|
398
|
+
// #ifdef MP-WEIXIN
|
|
399
|
+
this.mapCenter = this.stateLocation;
|
|
400
|
+
// #endif
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
getOftenShop() {
|
|
404
|
+
jfbRootExec("getOftenVipShopList", {
|
|
405
|
+
vm: this,
|
|
406
|
+
data: this.getParams(),
|
|
407
|
+
}).then(res => {
|
|
408
|
+
let list = res.list.map(item => {
|
|
409
|
+
item.shop_icon = getServiceUrl(item['shop_pic'] || item['shop_icon'])
|
|
410
|
+
return item
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
//todo 目前返回第一屏数据(如果下拉数据需要改造)
|
|
414
|
+
if(res.list.length > 0) {
|
|
415
|
+
this.setMarketList(list);
|
|
416
|
+
this.mapCenter = this.marketList[0];
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (this.page_token === '1') this.oftenShopList = list
|
|
420
|
+
else this.oftenShopList = this.oftenShopList.concat(list);
|
|
421
|
+
|
|
422
|
+
//数据为空处理
|
|
423
|
+
if(this.oftenShopList.length === 0) {
|
|
424
|
+
this.isEmptySetMapCenter();
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
this.next_page_token = res.next_page_token
|
|
428
|
+
this.hasNext = res.next_page_token !== "";
|
|
429
|
+
}).catch(err=>{
|
|
430
|
+
console.error(err)
|
|
431
|
+
this.oftenShopList = []
|
|
432
|
+
})
|
|
433
|
+
},
|
|
434
|
+
getNearbyShop(centerPosition) {
|
|
435
|
+
let data = {
|
|
436
|
+
city_code: this.stateCity.city_code,
|
|
437
|
+
...this.getParams()
|
|
438
|
+
}
|
|
439
|
+
if(centerPosition) data = Object.assign(data, centerPosition)
|
|
440
|
+
jfbRootExec("getNearbyVipShopList", {
|
|
441
|
+
vm: this,
|
|
442
|
+
data: data
|
|
443
|
+
}).then(res => {
|
|
335
444
|
|
|
445
|
+
let list = res.list.map(item => {
|
|
446
|
+
item.shop_icon = getServiceUrl(item.shop_icon)
|
|
447
|
+
return item
|
|
448
|
+
})
|
|
336
449
|
|
|
450
|
+
//todo 目前返回第一屏数据(如果下拉数据需要改造)
|
|
451
|
+
if(res.list.length > 0) {
|
|
452
|
+
//设置地图mark标签
|
|
453
|
+
this.setMarketList(list);
|
|
454
|
+
|
|
455
|
+
//设置原点
|
|
456
|
+
if(!centerPosition)this.mapCenter = this.marketList[0];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
//设置数据
|
|
460
|
+
if (this.page_token === '1') this.nearbyShopList = list
|
|
461
|
+
else this.nearbyShopList = this.nearbyShopList.concat(list);
|
|
462
|
+
|
|
463
|
+
//数据为空
|
|
464
|
+
if(this.nearbyShopList.length === 0) {
|
|
465
|
+
this.isEmptySetMapCenter()
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
this.hasNext = res.next_page_token !== "";
|
|
469
|
+
this.next_page_token = res.next_page_token;
|
|
470
|
+
this.initBaidu = true;
|
|
471
|
+
}).catch(err=>{
|
|
472
|
+
console.error(err)
|
|
473
|
+
this.nearbyShopList = []
|
|
474
|
+
})
|
|
475
|
+
},
|
|
476
|
+
setMarketList(list){
|
|
477
|
+
// #ifdef H5
|
|
478
|
+
this.marketList = list.map(item => {
|
|
479
|
+
return {
|
|
480
|
+
platform: "H5",
|
|
481
|
+
lng: item.longitude,
|
|
482
|
+
lat: item.latitude,
|
|
483
|
+
icon: {
|
|
484
|
+
url: item.shop_icon,
|
|
485
|
+
size: {width: 30, height: 30},
|
|
486
|
+
opts: {imageSize: {width: 30, height: 30}}
|
|
487
|
+
},
|
|
488
|
+
title: item.resource_shop_name,
|
|
489
|
+
id: item.resource_shop_id,
|
|
490
|
+
}
|
|
491
|
+
})
|
|
492
|
+
// #endif
|
|
493
|
+
// #ifdef MP-WEIXIN
|
|
494
|
+
this.marketList = list.map(item => {
|
|
495
|
+
let point = this.baiduTogcj(item.longitude, item.latitude);
|
|
496
|
+
return {
|
|
497
|
+
platform: "MP",
|
|
498
|
+
longitude: point[0],
|
|
499
|
+
latitude: point[1],
|
|
500
|
+
lng: item.longitude,
|
|
501
|
+
lat: item.latitude,
|
|
502
|
+
id: item.resource_shop_id,
|
|
503
|
+
title: item.resource_shop_name,
|
|
504
|
+
width: 30,
|
|
505
|
+
height: 30,
|
|
506
|
+
iconPath: item.shop_icon,
|
|
507
|
+
customCallout: {
|
|
508
|
+
anchorX: 0.5,
|
|
509
|
+
anchorY: 0.5,
|
|
510
|
+
display: 'ALWAYS',
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
})
|
|
514
|
+
// #endif
|
|
515
|
+
},
|
|
516
|
+
switchMapExtend(isExtend){
|
|
517
|
+
this.mapIsExtend = isExtend;
|
|
518
|
+
},
|
|
519
|
+
handleMarketTap(e){
|
|
520
|
+
this.showMarkerId = e.markerId;
|
|
521
|
+
let curShop = this.marketList.find(item => item.id === e.markerId);
|
|
522
|
+
this.handleChoseShop(curShop);
|
|
523
|
+
},
|
|
524
|
+
handleChoseShop(shop){
|
|
525
|
+
this.toView = 'shop_item_' + shop.id;
|
|
526
|
+
this.curShopId = shop.id;
|
|
527
|
+
if(shop.platform === 'H5'){
|
|
528
|
+
this.mapCenter = {
|
|
529
|
+
lng: shop.lng,
|
|
530
|
+
lat: shop.lat
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
else{
|
|
534
|
+
this.mapCenter = {
|
|
535
|
+
longitude: shop.longitude,
|
|
536
|
+
latitude: shop.latitude
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
this.page_token = '1';
|
|
540
|
+
let data = {
|
|
541
|
+
center_latitude: shop.lat || shop.latitude,
|
|
542
|
+
center_longitude: shop.lng || shop.longitude
|
|
543
|
+
}
|
|
544
|
+
if (this.tab === 'nearby') {
|
|
545
|
+
this.getNearbyShop(data)
|
|
546
|
+
} else {
|
|
547
|
+
this.getOftenShop(data)
|
|
548
|
+
}
|
|
549
|
+
this.scrollTop = 0;
|
|
550
|
+
},
|
|
337
551
|
/**
|
|
338
552
|
* @description 监听事件变化
|
|
339
553
|
* @param container {object} 业务组件对象自己
|
|
@@ -341,19 +555,19 @@
|
|
|
341
555
|
init(container) {
|
|
342
556
|
this.xnamespace = gCPVal(container, 'xnamespace', this.projectAttr.business_code||this.xnamespace);
|
|
343
557
|
this.serverType = gCPVal(container, 'serverType', [['SELL']]);
|
|
344
|
-
this.showOftenTab =
|
|
558
|
+
this.showOftenTab = gCPVal(container, 'showOftenTab', 'N');
|
|
345
559
|
if(this.showOftenTab === 'N') this.titleList = [{label: '附近门店', value: 'nearby'}];
|
|
346
560
|
if(this.showOftenTab === 'Y') this.titleList = [{label: '附近门店', value: 'nearby'},{label: '常用门店', value: 'often'}];
|
|
347
561
|
this.shopListStyle = gCPVal(container, 'shopListStyle', 'v1');
|
|
348
562
|
this.fastEntryStatus = gCPVal(container, 'fastEntryStatus', 'N') === 'Y';
|
|
349
563
|
let fastEntry = gCPVal(container, 'fastEntry', []).filter(item=>{
|
|
350
|
-
return
|
|
564
|
+
return item.check === true
|
|
351
565
|
});
|
|
352
566
|
let cusNames = {};
|
|
353
567
|
let cusEntry = {};
|
|
354
568
|
if(this.fastEntryStatus) {
|
|
355
569
|
for(let i = 0; i< fastEntry.length ;i++) {
|
|
356
|
-
if(fastEntry[i].input)
|
|
570
|
+
if(fastEntry[i].input) cusNames[fastEntry[i].value] = fastEntry[i].input
|
|
357
571
|
cusEntry[fastEntry[i].value] = fastEntry[i].check;
|
|
358
572
|
}
|
|
359
573
|
}
|
|
@@ -384,8 +598,8 @@
|
|
|
384
598
|
|
|
385
599
|
//style
|
|
386
600
|
let sValue = `{"cardItemSpace":16,"margin":{"bottom":16,"left":0,"right":0,"top":16},"backgroundColor":"rgba(245, 245, 245, 1)"}`
|
|
387
|
-
let shopStyle =
|
|
388
|
-
this.bodyPadding = gCPVal(container,'bodyPadding', [{ bottom:0,left:16, right:16,top:16}, 20], {sKey:'bodyPaddingStatus',fields:['bodyPadding'],cusFields: ['shopStyle','margin',
|
|
601
|
+
let shopStyle = this.getRelationStatus(container,'shopStyle', { cardItemSpaceStatus:['cardItemSpace'],bodyPaddingStatus:['bodyPadding']}, sValue);
|
|
602
|
+
this.bodyPadding = gCPVal(container,'bodyPadding', [{ bottom:0,left:16, right:16,top:16}, 20], {sKey:'bodyPaddingStatus',fields:['bodyPadding'],cusFields: ['shopStyle','margin',shopStyle],isPMR: true, });
|
|
389
603
|
this.contentBgColor = gCPVal(container,'contentBgColor', '#f8f8f8', {sKey:'contentBgColorStatus',fields:['contentBgColor']});
|
|
390
604
|
this.tabLayout = gCPVal(container,'tabLayout', 'v1')
|
|
391
605
|
|
|
@@ -412,24 +626,13 @@
|
|
|
412
626
|
//门店列表
|
|
413
627
|
let cardItemSpace = gCPVal(container,'cardItemSpace', [16,20], {sKey:'cardItemSpaceStatus',fields:['cardItemSpace'],cusFields: ['shopStyle','cardItemSpace',shopStyle]});
|
|
414
628
|
let cardItemRadius = gCPVal(container,'cardItemRadius', [sValue===shopStyle?0:this.gStyleValue.radius, 0], {sKey:'cardItemRadiusStatus',fields:['listItemRadius']})|| 0;
|
|
415
|
-
let cardItemShadow = gCPVal(container, 'cardItemShadow', [this.gStyleValue.shadow, {color:'',width:'0'}],{isShadow: true});
|
|
629
|
+
let cardItemShadow = gCPVal(container, 'cardItemShadow', [this.gStyleValue.shadow, {color:'',width:'0',}],{isShadow: true});
|
|
416
630
|
let cardItemBorder = gCPVal(container, 'cardItemBorder', [{color: '#f8f8f8',width: 0,style: 'solid'},{color: '#f8f8f8',width: 0,style: 'solid'}],{isBorder: true});
|
|
417
631
|
let distanceColor = gCPVal(container,'distanceColor', '#999999', {sKey:'distanceColorStatus',fields:['distanceColor']});
|
|
418
|
-
let cardItemBgColor = gCPVal(container,'cardItemBgColor', '
|
|
419
|
-
let itemPadding = gCPVal(container,'itemPadding', [{top:
|
|
632
|
+
let cardItemBgColor = gCPVal(container,'cardItemBgColor', '', {sKey:'cardItemBgColorStatus',fields:['cardItemBgColor']});
|
|
633
|
+
let itemPadding = gCPVal(container,'itemPadding', [{top:16,left:16, right:16, bottom:16},20], {sKey:'itemPaddingStatus',fields:['itemPadding'],isPMR: true});
|
|
420
634
|
let cardImageBorder = gCPVal(container, 'cardImageBorder', [{color: '#f8f8f8',width: 0,style: 'solid'},{color: '#f8f8f8',width: '2rpx',style: 'solid'}],{isBorder: true});
|
|
421
635
|
let itemImageRadius = gCPVal(container,'itemImageRadius', [this.gStyleValue.radius/2, 0], {sKey:'itemImageRadiusStatus',fields:['itemImageRadius']})||0;
|
|
422
|
-
this.cardItemShadowWidth = gCPVal(container, 'cardItemShadow', [this.gStyleValue.shadow, {color:'',width:'0'}], {isShadow:true, isBsWidth: true});
|
|
423
|
-
let right = Math.max(this.cardItemShadowWidth,this.bodyPadding.right);
|
|
424
|
-
let left = Math.max(this.cardItemShadowWidth,this.bodyPadding.left);
|
|
425
|
-
this.itemTop = Math.max(this.cardItemShadowWidth,this.bodyPadding.top);
|
|
426
|
-
this.itemBottom = Math.max(this.cardItemShadowWidth,this.bodyPadding.bottom);
|
|
427
|
-
if(this.cardItemShadowWidth === 0) {
|
|
428
|
-
right = 0; left = 0;
|
|
429
|
-
this.itemTop = 0;
|
|
430
|
-
this.itemBottom = 0;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
636
|
this.cusStyle = {
|
|
434
637
|
'item':{
|
|
435
638
|
'margin-bottom': `${cardItemSpace}rpx`,
|
|
@@ -438,8 +641,6 @@
|
|
|
438
641
|
'border': cardItemBorder,
|
|
439
642
|
'backgroundColor': cardItemBgColor,
|
|
440
643
|
'padding': this.getMarginAndPadding(itemPadding, 0),
|
|
441
|
-
'margin-right': `${right}rpx`,
|
|
442
|
-
'margin-left': `${left}rpx`
|
|
443
644
|
},
|
|
444
645
|
'image':{
|
|
445
646
|
'border-radius': itemImageRadius + 'rpx',
|
|
@@ -453,341 +654,69 @@
|
|
|
453
654
|
|
|
454
655
|
//高级
|
|
455
656
|
this.codePath = gCPVal(container, 'codePath', { value: "" }).value;
|
|
456
|
-
this.
|
|
657
|
+
this.cashierPath = gCPVal(container, 'cashierPath', { value: "" }).value;
|
|
658
|
+
this.buyTicketPath = gCPVal(container, 'buyTicketPath', { value: "" }).value;
|
|
659
|
+
this.codeAfterPath = gCPVal(container, 'codeAfterPath', { value: "" }).value;
|
|
660
|
+
this.hdSelfPath = gCPVal(container, 'hdSelfPath', { value: "" }).value;
|
|
661
|
+
this.travelfPath = gCPVal(container, 'travelfPath', { value: "" }).value;
|
|
457
662
|
|
|
458
663
|
//关闭显示附近门店
|
|
459
664
|
if(this.showOftenTab === 'N') this.tab = 'nearby';
|
|
460
|
-
this.initMapStatus = true;
|
|
461
|
-
|
|
462
|
-
},
|
|
463
665
|
|
|
464
|
-
|
|
465
|
-
//==map===========
|
|
466
|
-
// #ifdef MP-WEIXIN
|
|
467
|
-
/**
|
|
468
|
-
* @description 火星转百度坐标
|
|
469
|
-
* @param lng
|
|
470
|
-
* @param lat
|
|
471
|
-
* @returns {{latitude: *, longitude: *}}
|
|
472
|
-
*/
|
|
473
|
-
gcj02toBaidu({longitude, latitude}) {
|
|
474
|
-
let x_PI = 3.14159265358979324 * 3000.0 / 180.0;
|
|
475
|
-
let PI = 3.1415926535897932384626;
|
|
476
|
-
let a = 6378245.0;
|
|
477
|
-
let ee = 0.00669342162296594323;
|
|
478
|
-
latitude = +latitude;
|
|
479
|
-
longitude = +longitude;
|
|
480
|
-
let z = Math.sqrt(longitude * longitude + latitude * latitude) + 0.00002 * Math.sin(latitude * x_PI);
|
|
481
|
-
let theta = Math.atan2(latitude, longitude) + 0.000003 * Math.cos(longitude * x_PI);
|
|
482
|
-
let bd_lng = z * Math.cos(theta) + 0.0065;
|
|
483
|
-
let bd_lat = z * Math.sin(theta) + 0.006;
|
|
484
|
-
return {longitude: bd_lng, latitude:bd_lat}
|
|
485
666
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
getMYWeiXinPoint(){
|
|
500
|
-
const myPoint = this.$xdUniHelper.cloneDeep(this.mapCenter);
|
|
501
|
-
return {
|
|
502
|
-
platform: "MP",
|
|
503
|
-
longitude: myPoint.longitude,
|
|
504
|
-
latitude: myPoint.latitude,
|
|
505
|
-
lng: myPoint.longitude,
|
|
506
|
-
lat: myPoint.latitude,
|
|
507
|
-
id: 1999999999,
|
|
508
|
-
width: 30,
|
|
509
|
-
height: 30,
|
|
510
|
-
iconPath:'https://img.jufubao.cn/common/local.png?x-oss-process=style/size3',
|
|
511
|
-
mpaKey: this.$xdUniHelper.randomChar(20)
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
setWeiXinMarkerList(list){
|
|
516
|
-
let location = [this.getMYWeiXinPoint()];
|
|
517
|
-
if(this.isMoved) location = []
|
|
518
|
-
this.marketList = location.concat(list.map(item => {
|
|
519
|
-
let point = this.baiduTogcj(item.longitude, item.latitude);
|
|
520
|
-
return {
|
|
521
|
-
platform: "MP",
|
|
522
|
-
longitude: point[0],
|
|
523
|
-
latitude: point[1],
|
|
524
|
-
lng: item.longitude,
|
|
525
|
-
lat: item.latitude,
|
|
526
|
-
id: item.resource_shop_id,
|
|
527
|
-
title: item.resource_shop_name,
|
|
528
|
-
width: 30,
|
|
529
|
-
height: 30,
|
|
530
|
-
iconPath: item.shop_icon,
|
|
531
|
-
mpaKey: this.$xdUniHelper.randomChar(20),
|
|
532
|
-
customCallout: {
|
|
533
|
-
anchorX: 0.5,
|
|
534
|
-
anchorY: 0.5,
|
|
535
|
-
display: 'ALWAYS',
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}))
|
|
539
|
-
},
|
|
540
|
-
|
|
541
|
-
handleMarketTap(e){
|
|
542
|
-
this.showMarkerId = e.markerId;
|
|
543
|
-
this.resource_shop_id = e.markerId;
|
|
544
|
-
setTimeout(()=>{
|
|
545
|
-
this.intoViewResourceShopId = `scroll-${e.markerId}`;
|
|
546
|
-
},50)
|
|
547
|
-
},
|
|
548
|
-
|
|
549
|
-
// #endif
|
|
550
|
-
|
|
551
|
-
// #ifdef H5
|
|
552
|
-
handleH5Init(){
|
|
553
|
-
this.getNearbyShop();
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
handleShowMarker(item,status){
|
|
557
|
-
if(status) {
|
|
558
|
-
this.localImage = '';
|
|
559
|
-
this.resource_shop_id = item.id;
|
|
560
|
-
setTimeout(()=>{
|
|
561
|
-
this.intoViewResourceShopId = `scroll-${item.id}`;
|
|
562
|
-
},50)
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
else this.localImage = getServiceUrl('/common/localdone.png');
|
|
566
|
-
},
|
|
567
|
-
// #endif
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
handleRegionChange(e){
|
|
571
|
-
//重新定位
|
|
572
|
-
if(['location','update'].includes(e.causedBy)){
|
|
573
|
-
this.localImage = '';
|
|
574
|
-
if(e.type === 'end') {
|
|
575
|
-
// #ifdef H5
|
|
576
|
-
this.changeLocation = this.$xdUniHelper.cloneDeep(e.detail.point);
|
|
577
|
-
// #endif
|
|
578
|
-
// #ifdef MP-WEIXIN
|
|
579
|
-
this.WeiXinMap.addMarkers({markers:[this.getMYWeiXinPoint()]});
|
|
580
|
-
if(!this.onLocationStatus) {
|
|
581
|
-
this.onLocationStatus = true;
|
|
582
|
-
}
|
|
583
|
-
this.changeLocation = this.gcj02toBaidu(e.detail.centerLocation ||e.detail.point);
|
|
584
|
-
// #endif
|
|
585
|
-
|
|
586
|
-
this.clearList();
|
|
587
|
-
this.getNearbyShop();
|
|
588
|
-
}
|
|
589
|
-
return
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
//拖拽与缩放操作开始
|
|
593
|
-
// #ifdef MP-WEIXIN
|
|
594
|
-
this.WeiXinMap.removeMarkers({markerIds:[1999999999]})
|
|
595
|
-
// #endif
|
|
596
|
-
if(e.type === 'begin') this.localImage = getServiceUrl('/common/localmove.png?v=1');
|
|
597
|
-
|
|
598
|
-
//拖拽与缩放操作结束
|
|
599
|
-
else if(e.type === 'end') {
|
|
600
|
-
this.isMoved = true;
|
|
601
|
-
this.localImage = getServiceUrl('/common/localdone.png');
|
|
602
|
-
// #ifdef H5
|
|
603
|
-
this.changeLocation = this.$xdUniHelper.cloneDeep(e.detail.point);
|
|
604
|
-
// #endif
|
|
605
|
-
// #ifdef MP-WEIXIN
|
|
606
|
-
this.changeLocation = this.gcj02toBaidu(e.detail.centerLocation ||e.detail.point);
|
|
607
|
-
// #endif
|
|
608
|
-
|
|
609
|
-
this.clearList();
|
|
610
|
-
this.getNearbyShop();
|
|
667
|
+
//==点击事件===========
|
|
668
|
+
handleToEvent({item,type}) {
|
|
669
|
+
let parmas = [];
|
|
670
|
+
let url = ''
|
|
671
|
+
if(item.resource_shop_id) parmas.push(`resource_shop_id=${item.resource_shop_id}`);
|
|
672
|
+
if(item.brand_id) parmas.push(`brand_id=${item.brand_id}`);
|
|
673
|
+
if(item.consume_mode) parmas.push(`consume_mode=${item.consume_mode.join(',')}`);
|
|
674
|
+
if(item.shop_id) parmas.push(`shop_id=${item.shop_id}`);
|
|
675
|
+
|
|
676
|
+
//详情增加扩张参数
|
|
677
|
+
if(item.exts_params && type === 'DL'){
|
|
678
|
+
parmas.push(`exts_params=${item.exts_params}`);
|
|
679
|
+
parmas.push(`resource_shop=${Base64.encodeURI(JSON.stringify({shop_id: item.shop_id,resource_shop_id: item.resource_shop_id }))}`);
|
|
611
680
|
}
|
|
612
|
-
},
|
|
613
681
|
|
|
614
|
-
|
|
615
|
-
if(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
})
|
|
628
|
-
// #endif
|
|
629
|
-
this.onLocationStatus = true;
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
this.mpLocationFn = 'getFuzzyLocation';
|
|
633
|
-
if(this.$configProject['privacy_interface_list']) {
|
|
634
|
-
this.$configProject['privacy_interface_list'].map(item=>{
|
|
635
|
-
if(item['api_name'] === 'wx.getLocation') {
|
|
636
|
-
this.mpLocationFn = 'getLocation';
|
|
637
|
-
}
|
|
638
|
-
})
|
|
639
|
-
}
|
|
640
|
-
// #ifdef MP-WEIXIN
|
|
641
|
-
wx[this.mpLocationFn]({
|
|
642
|
-
type:'wgs84',
|
|
643
|
-
success:({latitude,longitude})=>{
|
|
644
|
-
this.mapCenter = {latitude,longitude};
|
|
645
|
-
this.$nextTick(()=>{
|
|
646
|
-
this.WeiXinMap = uni.createMapContext('WeiXinMap', this);
|
|
682
|
+
//在线选择,电子码传惨处理
|
|
683
|
+
if(['SEAT','CODE'].includes(type)) parmas = [`cinema_id=${item.resource_shop_id}`]
|
|
684
|
+
if(['TRAVEL'].includes(type)) parmas = [`shop_id=${item.resource_shop_id}`]
|
|
685
|
+
|
|
686
|
+
//点击详情地址
|
|
687
|
+
if(type === 'DL') {
|
|
688
|
+
//有回调地址处理
|
|
689
|
+
if(this.isCallback) {
|
|
690
|
+
parmas = []
|
|
691
|
+
if(item.resource_shop_id) parmas.push(`resource_shop_id=${item.resource_shop_id}`);
|
|
692
|
+
if(!this.$xdUniHelper.isEmpty(this.callbackParams)) {
|
|
693
|
+
Object.keys(this.callbackParams).map(it=>{
|
|
694
|
+
parmas.push(`${it}=${this.callbackParams[it]}`);
|
|
647
695
|
})
|
|
648
|
-
this.onLocationStatus = true;
|
|
649
696
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
clearList(){
|
|
656
|
-
// #ifdef MP-WEIXIN
|
|
657
|
-
if(this.nearbyShopList && this.nearbyShopList.length > 0) {
|
|
658
|
-
this.WeiXinMap.removeMarkers({markerIds:[this.nearbyShopList.map(item => item.resource_shop_id)]});
|
|
659
|
-
}
|
|
660
|
-
// #endif
|
|
661
|
-
this.page_token = '1';
|
|
662
|
-
this.nearbyShopList = null;
|
|
663
|
-
this.intoViewResourceShopId = '';
|
|
664
|
-
this.marketList = [];
|
|
665
|
-
},
|
|
666
|
-
//==map===========
|
|
667
|
-
|
|
668
|
-
getParams(){
|
|
669
|
-
let latitude = '', longitude = '';
|
|
670
|
-
console.log('handleRegionChange',this.stateLocation, this.changeLocation);
|
|
671
|
-
if(this.stateLocation && !this.$xdUniHelper.isEmpty(this.stateLocation)) {
|
|
672
|
-
if(this.stateLocation.longitude) longitude = this.stateLocation.longitude + '';
|
|
673
|
-
if(this.stateLocation.latitude) latitude = this.stateLocation.latitude + '';
|
|
674
|
-
}
|
|
675
|
-
if(this.changeLocation && !this.$xdUniHelper.isEmpty(this.changeLocation)) {
|
|
676
|
-
if(this.changeLocation.longitude) longitude = this.changeLocation.longitude + '';
|
|
677
|
-
if(this.changeLocation.latitude) latitude = this.changeLocation.latitude + '';
|
|
678
|
-
}
|
|
679
|
-
let params = {
|
|
680
|
-
latitude,
|
|
681
|
-
longitude,
|
|
682
|
-
page_size: 20,
|
|
683
|
-
page_token: this.page_token + '',
|
|
684
|
-
keyword: this.keyword,
|
|
685
|
-
xnamespace: this.xnamespace,
|
|
686
|
-
consume_mode: this.serverType.join(','),
|
|
687
|
-
}
|
|
688
|
-
if(this.brand_id) params['brand_ids'] = this.brand_id;
|
|
689
|
-
if(this.keyword) params['keyword'] = this.keyword
|
|
690
|
-
return params
|
|
691
|
-
},
|
|
692
|
-
|
|
693
|
-
getNearbyShop() {
|
|
694
|
-
let data = {
|
|
695
|
-
city_code: this.stateCity.city_code,
|
|
696
|
-
...this.getParams()
|
|
697
|
-
}
|
|
698
|
-
this.$xdShowLoading({});
|
|
699
|
-
|
|
700
|
-
jfbRootExec("getNearbyVipShopList", {
|
|
701
|
-
vm: this,
|
|
702
|
-
data: data
|
|
703
|
-
}).then(res => {
|
|
704
|
-
|
|
705
|
-
let list = res.list.map(item => {
|
|
706
|
-
item.shop_icon = getServiceUrl(item.shop_icon);
|
|
707
|
-
item['key'] = this.$xdUniHelper.randomChar(20);
|
|
708
|
-
return item
|
|
709
|
-
});
|
|
710
|
-
|
|
711
|
-
let nearbyShopList = [];
|
|
712
|
-
if(this.page_token === '1') nearbyShopList = this.$xdUniHelper.cloneDeep(list);
|
|
713
|
-
else nearbyShopList = this.$xdUniHelper.cloneDeep(this.nearbyShopList).concat(list);
|
|
714
|
-
|
|
715
|
-
//设置标签
|
|
716
|
-
this.setMarketList(nearbyShopList);
|
|
717
|
-
|
|
718
|
-
this.nearbyShopList = this.$xdUniHelper.cloneDeep(nearbyShopList);
|
|
719
|
-
|
|
720
|
-
this.hasNext = res.next_page_token !== "";
|
|
721
|
-
this.next_page_token = res.next_page_token;
|
|
722
|
-
|
|
723
|
-
setTimeout(()=>{
|
|
724
|
-
console.log('setMarketList.setTimeout',nearbyShopList);
|
|
725
|
-
this.intoViewResourceShopId = `scroll-${this.resource_shop_id}`
|
|
726
|
-
},200);
|
|
727
|
-
|
|
728
|
-
console.log('setMarketList.getNearbyVipShopList',nearbyShopList);
|
|
729
|
-
|
|
730
|
-
this.$xdHideLoading();
|
|
731
|
-
}).catch(err=>{
|
|
732
|
-
this.$xdHideLoading();
|
|
733
|
-
console.log(err)
|
|
734
|
-
//this.nearbyShopList = this.$xdUniHelper.cloneDeep(this.nearbyShopList).concat([]);
|
|
735
|
-
//this.setMarketList(this.nearbyShopList);
|
|
736
|
-
})
|
|
737
|
-
},
|
|
738
|
-
setMarketList(list){
|
|
739
|
-
console.log('setMarketList',list);
|
|
740
|
-
// #ifdef H5
|
|
741
|
-
this.marketList = list.map(item => {
|
|
742
|
-
return {
|
|
743
|
-
platform: "H5",
|
|
744
|
-
lng: item.longitude,
|
|
745
|
-
lat: item.latitude,
|
|
746
|
-
address: item.address,
|
|
747
|
-
icon: {
|
|
748
|
-
url: item.shop_icon,
|
|
749
|
-
size: {width: 30, height: 30},
|
|
750
|
-
opts: {imageSize: {width: 30, height: 30}}
|
|
751
|
-
},
|
|
752
|
-
title: item.resource_shop_name,
|
|
753
|
-
id: item.resource_shop_id,
|
|
697
|
+
this.$xdUniHelper.redirectTo({
|
|
698
|
+
url: this.isCallback + `?${parmas.join('&')}`
|
|
699
|
+
},false,true)
|
|
700
|
+
return
|
|
754
701
|
}
|
|
755
|
-
})
|
|
756
|
-
// #endif
|
|
757
|
-
// #ifdef MP-WEIXIN
|
|
758
|
-
this.setWeiXinMarkerList(list);
|
|
759
|
-
// #endif
|
|
760
|
-
},
|
|
761
|
-
switchMapExtend(isExtend){
|
|
762
|
-
this.mapIsExtend = isExtend;
|
|
763
|
-
},
|
|
764
|
-
|
|
765
702
|
|
|
703
|
+
//其他情况
|
|
704
|
+
url = this.codePath;
|
|
705
|
+
}
|
|
766
706
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
* @param type detail|shop
|
|
778
|
-
*/
|
|
779
|
-
handleToEvent(item,type) {
|
|
780
|
-
let parmas = [];
|
|
781
|
-
let url = ''
|
|
782
|
-
if(item['resource_shop_id']) parmas.push(`resource_shop_id=${item['resource_shop_id']}`)
|
|
783
|
-
|
|
784
|
-
//去门店
|
|
785
|
-
if(type === 'shop') url = this.codePath;
|
|
707
|
+
//支持核销
|
|
708
|
+
if(type === 'SELL') url = this.cashierPath;
|
|
709
|
+
//在线选择
|
|
710
|
+
if(type === 'SEAT') url = this.buyTicketPath;
|
|
711
|
+
//电子码
|
|
712
|
+
if(type === 'CODE') url = this.codeAfterPath;
|
|
713
|
+
//小时达
|
|
714
|
+
if(type === 'HDSELF') url = this.hdSelfPath;
|
|
715
|
+
//旅游购票
|
|
716
|
+
if(type === 'TRAVEL') url = this.travelfPath;
|
|
786
717
|
|
|
787
|
-
|
|
788
|
-
if(type === 'detail') url = this.detailPath;
|
|
718
|
+
if(!url) throw new Error(`${type} => 未设置访问地址`);
|
|
789
719
|
|
|
790
|
-
if(!url) throw new Error(`${type} => 未设置访问地址,参数:${parmas.join('&')}`);
|
|
791
720
|
|
|
792
721
|
//预览模式
|
|
793
722
|
if(this.$configProject['isPreview']) {
|
|
@@ -800,21 +729,31 @@
|
|
|
800
729
|
url: `${url}?${parmas.join('&')}`
|
|
801
730
|
})
|
|
802
731
|
},
|
|
803
|
-
//==点击事件===========
|
|
804
732
|
|
|
733
|
+
//==点击事件===========
|
|
805
734
|
|
|
806
735
|
onJfbScroll(options) {
|
|
807
736
|
|
|
808
737
|
},
|
|
809
|
-
|
|
738
|
+
onJfbReachBottom(options) {
|
|
739
|
+
// if (this.hasNext) {
|
|
740
|
+
// this.page_token = this.next_page_token;
|
|
741
|
+
// if (this.tab === 'nearby') {
|
|
742
|
+
// this.getNearbyShop()
|
|
743
|
+
// } else {
|
|
744
|
+
// this.getOftenShop()
|
|
745
|
+
// }
|
|
746
|
+
// }
|
|
747
|
+
},
|
|
810
748
|
onJfbCustomEvent({ action, data }) {
|
|
811
749
|
if (action === 'baseHeader@search') {
|
|
812
750
|
this.keyword = data;
|
|
813
|
-
this.
|
|
814
|
-
this.
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
751
|
+
this.page_token = '1';
|
|
752
|
+
if (this.tab === 'nearby') {
|
|
753
|
+
this.getNearbyShop()
|
|
754
|
+
} else {
|
|
755
|
+
this.getOftenShop()
|
|
756
|
+
}
|
|
818
757
|
}
|
|
819
758
|
},
|
|
820
759
|
}
|
|
@@ -832,11 +771,11 @@
|
|
|
832
771
|
.shop_map {
|
|
833
772
|
background: #fff;
|
|
834
773
|
font-size: unit(28, rpx);
|
|
774
|
+
|
|
835
775
|
.mpa_wrap {
|
|
836
|
-
height:
|
|
776
|
+
height: 400rpx;
|
|
837
777
|
background: #fff;
|
|
838
778
|
transition: all .3s ease-in-out;
|
|
839
|
-
position: relative;
|
|
840
779
|
|
|
841
780
|
/deep/ .xd-baidu__content {
|
|
842
781
|
position: relative;
|
|
@@ -845,25 +784,6 @@
|
|
|
845
784
|
}
|
|
846
785
|
&.close{
|
|
847
786
|
height: 0;
|
|
848
|
-
position: relative;
|
|
849
|
-
z-index: 0;
|
|
850
|
-
padding: 0;
|
|
851
|
-
overflow: hidden;
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
.map-center {
|
|
856
|
-
position: absolute;
|
|
857
|
-
width: 90rpx;
|
|
858
|
-
height: 90rpx;
|
|
859
|
-
top: 49%;
|
|
860
|
-
left: 50%;
|
|
861
|
-
transform: translate(-50%,-50%);
|
|
862
|
-
z-index: 3500;
|
|
863
|
-
|
|
864
|
-
& image {
|
|
865
|
-
width: 100%;
|
|
866
|
-
height: 100%;
|
|
867
787
|
}
|
|
868
788
|
}
|
|
869
789
|
|
|
@@ -872,10 +792,7 @@
|
|
|
872
792
|
line-height: unit(30, rpx);
|
|
873
793
|
padding-bottom: unit(10, rpx);
|
|
874
794
|
}
|
|
875
|
-
|
|
876
795
|
.map_expend{
|
|
877
|
-
position: relative;
|
|
878
|
-
z-index: 1;
|
|
879
796
|
display: flex;
|
|
880
797
|
justify-content: center;
|
|
881
798
|
align-items: center;
|
|
@@ -884,154 +801,40 @@
|
|
|
884
801
|
}
|
|
885
802
|
}
|
|
886
803
|
|
|
887
|
-
.
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
&-ske {
|
|
894
|
-
&-title {
|
|
895
|
-
display: flex;
|
|
896
|
-
justify-content: space-between;
|
|
897
|
-
align-content: center;
|
|
898
|
-
margin-bottom: 16rpx;
|
|
899
|
-
|
|
900
|
-
& > view:first-child {
|
|
901
|
-
.skeleton-item(100%, 46rpx);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
& > view:last-child {
|
|
905
|
-
flex-shrink: 0;
|
|
906
|
-
.skeleton-item(120rpx, 30rpx);
|
|
907
|
-
margin-left: 32rpx;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
&-address {
|
|
911
|
-
display: flex;
|
|
912
|
-
justify-content: space-between;
|
|
913
|
-
align-content: center;
|
|
914
|
-
margin-bottom: 16rpx;
|
|
915
|
-
|
|
916
|
-
& > view:first-child {
|
|
917
|
-
.skeleton-item(70%, 36rpx);
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
& > view:last-child {
|
|
921
|
-
flex-shrink: 0;
|
|
922
|
-
.skeleton-item(100rpx, 28rpx);
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
&-time {
|
|
926
|
-
.skeleton-item(30%, 28rpx);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
&-item {
|
|
931
|
-
box-sizing: border-box;
|
|
932
|
-
&:last-child {
|
|
933
|
-
margin-bottom: 0!important;
|
|
934
|
-
}
|
|
935
|
-
&-act {
|
|
936
|
-
background-color: var(--main-alpha-color)!important;
|
|
937
|
-
border:1px solid var(--main-alpha5-color)!important;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
&-title {
|
|
941
|
-
display: flex;
|
|
942
|
-
justify-content: space-between;
|
|
943
|
-
align-items: center;
|
|
944
|
-
margin-bottom: 16rpx;
|
|
945
|
-
& > .title {
|
|
946
|
-
width: calc(100% - 140rpx);
|
|
947
|
-
flex-shrink: 0;
|
|
948
|
-
display: flex;
|
|
949
|
-
justify-content: flex-start;
|
|
950
|
-
align-items: center;
|
|
951
|
-
font-size: 32rpx;
|
|
952
|
-
line-height: 44rpx;
|
|
953
|
-
color: #333;
|
|
954
|
-
font-weight: 400;
|
|
955
|
-
|
|
956
|
-
& > view:first-child {
|
|
957
|
-
.uni-one-cut(44);
|
|
958
|
-
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
& > view:nth-child(2) {
|
|
962
|
-
flex-shrink: 0;
|
|
963
|
-
line-height: 44rpx;
|
|
964
|
-
font-size: 24rpx;
|
|
965
|
-
border-radius: 8rpx;
|
|
966
|
-
border:1px solid var(--main-alpha5-color)!important;
|
|
967
|
-
padding: 0 16rpx;
|
|
968
|
-
margin-left: 16rpx;
|
|
969
|
-
color: var(--main-color);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
& > view:last-child {
|
|
974
|
-
flex-shrink: 0;
|
|
975
|
-
margin-left: 48rpx;
|
|
976
|
-
font-size: 24rpx;
|
|
977
|
-
color: #999;
|
|
978
|
-
display: flex;
|
|
979
|
-
align-items: center;
|
|
980
|
-
justify-content: flex-end;
|
|
981
|
-
& > text {
|
|
982
|
-
margin-right: 10rpx;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
& > .address {
|
|
988
|
-
color: #999;
|
|
989
|
-
font-size: 24rpx;
|
|
990
|
-
line-height: 36rpx;
|
|
991
|
-
margin-bottom: 16rpx;
|
|
992
|
-
display: flex;
|
|
993
|
-
justify-content: flex-start;
|
|
994
|
-
align-content: center;
|
|
995
|
-
|
|
996
|
-
& > view:first-child {
|
|
997
|
-
.uni-one-cut(36);
|
|
998
|
-
flex: 1;
|
|
804
|
+
.shop_tabs {
|
|
805
|
+
display: flex;
|
|
806
|
+
background: #fff;
|
|
807
|
+
border-bottom: 1px solid #f8f8f8;
|
|
999
808
|
|
|
1000
|
-
}
|
|
1001
|
-
& > view:nth-child(2) {
|
|
1002
|
-
flex-shrink: 0;
|
|
1003
|
-
margin-left: 32rpx;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
809
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
810
|
+
.tab_item {
|
|
811
|
+
font-size: 32rpx;
|
|
812
|
+
color: #333;
|
|
813
|
+
font-weight: 400;
|
|
814
|
+
padding: 0 24rpx;
|
|
815
|
+
position: relative;
|
|
816
|
+
border-radius: 60rpx;
|
|
817
|
+
|
|
818
|
+
& .lineX {
|
|
819
|
+
position: absolute;
|
|
820
|
+
bottom: 14rpx;
|
|
821
|
+
height: 6rpx;
|
|
822
|
+
background-color: var(--main-color);
|
|
823
|
+
border-radius: 6rpx;
|
|
824
|
+
width: 64rpx;
|
|
825
|
+
left: 50%;
|
|
826
|
+
transform: translateX(-50%);
|
|
1011
827
|
}
|
|
1012
828
|
}
|
|
1013
829
|
}
|
|
1014
830
|
|
|
1015
|
-
.
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
line-height: 36rpx;
|
|
831
|
+
.shop_list {
|
|
832
|
+
flex: 1;
|
|
833
|
+
.scroll_y{
|
|
834
|
+
height: 100%;
|
|
835
|
+
}
|
|
1021
836
|
}
|
|
1022
837
|
|
|
1023
838
|
}
|
|
1024
|
-
|
|
1025
|
-
.weiXinLocation {
|
|
1026
|
-
right: 20rpx;
|
|
1027
|
-
bottom: 20rpx;
|
|
1028
|
-
font-size: 20rpx;
|
|
1029
|
-
position: absolute;
|
|
1030
|
-
width: 60rpx;
|
|
1031
|
-
height: 60rpx;
|
|
1032
|
-
background-color: #fff;
|
|
1033
|
-
border: 1px solid #ccc;
|
|
1034
|
-
border-radius: 8rpx;
|
|
1035
|
-
}
|
|
1036
839
|
}
|
|
1037
840
|
</style>
|