jufubao-third 1.0.22-beta4 → 1.0.22-beta6

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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(node -e ' *)",
5
+ "Bash(npx esbuild *)",
6
+ "Bash(npx vue-template-compiler *)",
7
+ "Bash(node -e \"const fs=require\\('fs'\\);const compiler=require\\('/Users/zxd/Workspaces/jufubao-third/node_modules/@vue/compiler-sfc'\\);const {parse,compileTemplate}=compiler;const r=parse\\(fs.readFileSync\\('/Users/zxd/Workspaces/jufubao-third/src/components/JfbThirdRideLand/JfbThirdRideLand.vue','utf8'\\)\\);const t=compileTemplate\\({source:r.descriptor.template.content,filename:'x.vue'}\\);console.log\\(t.errors.length===0?'Vue template OK':'ERR '+JSON.stringify\\(t.errors\\)\\)\")",
8
+ "Bash(node *)",
9
+ "Bash(grep -i \"^vue$\")"
10
+ ]
11
+ }
12
+ }
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-beta6",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Ride
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ //设置方法名字当别忘记加上【模块名字】:Ride
10
+ mapFnName: 'getRideByIdFilmSquate',
11
+ title: '获取电影广场列表',
12
+ path: '/api/account/film/list-film-square',
13
+ isRule: false,
14
+ params: {
15
+ last_key: ['当前页', 'Number', '必选'],
16
+ page_size: ['每页数量', 'Number', '必选'],
17
+ },
18
+ isConsole: true,
19
+ disabled: true,
20
+ },
21
+ {
22
+ //设置方法名字当别忘记加上【模块名字】:Ride
23
+ mapFnName: 'updateRideFilmPaiqiDate',
24
+ title: '更新排期',
25
+ path: '/api/account/film/paiqi-date',
26
+ isRule: false,
27
+ params: {
28
+ film_id: ['电影id', 'Number', '必选'],
29
+ cinema_id: ['影院id', 'Number', '必选'],
30
+ },
31
+ isConsole: true,
32
+ disabled: true,
33
+ },
34
+ {
35
+ //设置方法名字当别忘记加上【模块名字】:Ride
36
+ mapFnName: 'removeRideFilmAddress',
37
+ title: '删除我的配送地址',
38
+ path: '/api/account/film/paiqi-date',
39
+ isRule: false,
40
+ params: {
41
+ film_id: ['电影id', 'Number', '必选'],
42
+ },
43
+ isConsole: true,
44
+ disabled: true,
45
+ },
46
+ {
47
+ //设置方法名字当别忘记加上【模块名字】:Ride
48
+ mapFnName: 'addRideFilmcart',
49
+ title: '添加购物车',
50
+ path: '/api/account/film/paiqi-date',
51
+ isRule: false,
52
+ params: {
53
+ film_id: ['电影id', 'Number', '必选'],
54
+ },
55
+ isConsole: true,
56
+ disabled: true,
57
+ },
58
+ ];
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ import style from "./cusAttr/style";
4
+ import advanced from "./cusAttr/advanced";
5
+ import content from "./cusAttr/content";
6
+
7
+ export default {
8
+ style: [],
9
+ advanced: [],
10
+ content: (data, gValue, gColor, oldData = {}) => {
11
+ return [
12
+ ...content(data, gValue, gColor, oldData),
13
+ ...style(data, gValue, gColor, oldData),
14
+ ...advanced(data, gValue, gColor, oldData),
15
+ ].filter(i => i)
16
+ },
17
+ }
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <view
3
+ class="jfb-third-ride-land"
4
+ :style="bgStyle"
5
+ @click="handleEditxSelect"
6
+ :class="{ editx : isEditx && active }"
7
+ >
8
+ <!--#ifdef H5-->
9
+ <view
10
+ class="jfb-third-ride-land__edit"
11
+ :class="{ editx : isEditx && active }"
12
+ v-if="isEditx && active"
13
+ >
14
+ <view class="jfb-third-ride-land__edit-icon" @click.stop="delEdit">
15
+ <xd-font-icon icon="iconshanchu-01" color="#fff" size="30"></xd-font-icon>
16
+ </view>
17
+ </view>
18
+ <!-- #endif -->
19
+ <view class="jfb-third-ride-land__body" :style="bodyStyle">
20
+ <!-- 内容卡片 -->
21
+ <view class="jfb-third-ride-land__card" :style="cardStyle">
22
+ <xd-content-xss
23
+ v-if="contentHtml"
24
+ :html="contentHtml"
25
+ ></xd-content-xss>
26
+ <!-- 编辑预览态的占位提示 -->
27
+ <view v-else-if="isEditx && active" class="jfb-third-ride-land__card-placeholder">
28
+ 服务须知内容为空,请在右侧属性面板编辑富文本内容
29
+ </view>
30
+ </view>
31
+
32
+ <!-- 底部按钮 -->
33
+ <view
34
+ class="jfb-third-ride-land__btn"
35
+ :class="{ 'jfb-third-ride-land__btn--disabled': btnDisabled }"
36
+ @click="handleBtnClick"
37
+ >
38
+ <text class="jfb-third-ride-land__btn-text">{{ btnText }}{{ countdownText }}</text>
39
+ </view>
40
+ </view>
41
+ </view>
42
+ </template>
43
+
44
+ <script>
45
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
46
+ import XdContentXss from "@/components/XdContentXss/XdContentXss";
47
+ import { gCPVal } from "@/utils/xd.base";
48
+ import componentsMixins from "@/mixins/componentsMixins";
49
+ import extsMixins from "@/mixins/extsMixins";
50
+ import getServiceUrl from "@/common/getServiceUrl";
51
+ export default {
52
+ name: "JfbThirdRideLand",
53
+ components: {
54
+ XdFontIcon,
55
+ XdContentXss
56
+ },
57
+ mixins: [
58
+ componentsMixins, extsMixins
59
+ ],
60
+ data() {
61
+ return {
62
+ xnamespace: '',
63
+ //内容
64
+ contentHtml: '',
65
+ btnText: '我已知晓',
66
+ btnLink: null,
67
+ countdown: 0,
68
+ countdownLeft: 0,
69
+ countdownTimer: null,
70
+ //样式
71
+ bgColor: '',
72
+ bgImage: '',
73
+ margin: {},
74
+ padding: {},
75
+ radius: 24,
76
+ }
77
+ },
78
+ computed: {
79
+ //页面背景(背景图 + 背景色)
80
+ bgStyle(){
81
+ let style = {};
82
+ if(this.bgColor) style.backgroundColor = this.bgColor;
83
+ if(this.bgImage) {
84
+ style.backgroundImage = `url(${getServiceUrl(this.bgImage)})`;
85
+ style.backgroundSize = '100% 100%';
86
+ style.backgroundPosition = 'center';
87
+ style.backgroundRepeat = 'no-repeat';
88
+ }
89
+ return style;
90
+ },
91
+ //外边距
92
+ bodyStyle(){
93
+ return {
94
+ padding: this.getMarginAndPadding(this.margin, 32)
95
+ }
96
+ },
97
+ //内容卡片
98
+ cardStyle(){
99
+ return {
100
+ padding: this.getMarginAndPadding(this.padding, 32),
101
+ borderRadius: this.radius + 'rpx'
102
+ }
103
+ },
104
+ //按钮是否处于倒计时禁用状态
105
+ btnDisabled(){
106
+ return this.countdownLeft > 0;
107
+ },
108
+ //倒计时文案
109
+ countdownText(){
110
+ return this.btnDisabled ? ` (${this.countdownLeft}s)` : '';
111
+ }
112
+ },
113
+ watch: {
114
+ container(value, oldValue) {
115
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
116
+ if (this.$configProject['isPreview']) this.init(value)
117
+ },
118
+ },
119
+ created() {
120
+ this.init(this.container);
121
+ },
122
+ beforeDestroy() {
123
+ this.clearCountdown();
124
+ },
125
+ methods: {
126
+ /**
127
+ * @description 监听事件变化
128
+ * @param container {object} 业务组件对象自己
129
+ */
130
+ init(container) {
131
+ //内容
132
+ this.xnamespace = gCPVal(container, 'xnamespace', '');
133
+ this.contentHtml = gCPVal(container, 'contentHtml', '');
134
+ this.btnText = gCPVal(container, 'btnText', '我已知晓');
135
+ this.btnLink = gCPVal(container, 'btnLink', {value: ''});
136
+ this.countdown = gCPVal(container, 'countdown', 0);
137
+ //样式
138
+ this.bgColor = gCPVal(container, 'bgColor', '');
139
+ let bgImageVal = gCPVal(container, 'bgImage', {});
140
+ this.bgImage = bgImageVal && bgImageVal.url ? bgImageVal.url : '';
141
+ this.margin = gCPVal(container, 'margin', 32, {sKey: 'marginStatus', fields: ['margin'], isPM: true});
142
+ this.padding = gCPVal(container, 'padding', 32, {sKey: 'paddingStatus', fields: ['padding'], isPM: true});
143
+ this.radius = gCPVal(container, 'radius', 24, {sKey: 'radiusStatus', fields: ['radius']});
144
+ //启动倒计时
145
+ this.startCountdown();
146
+ },
147
+ /**
148
+ * @description 开始倒计时
149
+ */
150
+ startCountdown(){
151
+ this.clearCountdown();
152
+ let count = Number(this.countdown) || 0;
153
+ if(count <= 0) return;
154
+ this.countdownLeft = count;
155
+ this.countdownTimer = setInterval(() => {
156
+ this.countdownLeft--;
157
+ if(this.countdownLeft <= 0) this.clearCountdown();
158
+ }, 1000);
159
+ },
160
+ /**
161
+ * @description 清除倒计时
162
+ */
163
+ clearCountdown(){
164
+ if(this.countdownTimer) {
165
+ clearInterval(this.countdownTimer);
166
+ this.countdownTimer = null;
167
+ }
168
+ this.countdownLeft = 0;
169
+ },
170
+ /**
171
+ * @description 点击按钮,倒计时结束后跳转配置的链接
172
+ */
173
+ handleBtnClick(){
174
+ if (this.$configProject['isPreview']) return;
175
+ if(this.btnDisabled) return;
176
+ let url = this.btnLink && this.btnLink.value ? this.btnLink.value : '';
177
+ if(!url) return;
178
+ this.$xdUniHelper.navigateTo({ url });
179
+ },
180
+ onJfbLoad() {
181
+ // 倒计时依赖配置属性,已在 init 中启动
182
+ },
183
+ onJfbScroll(options) {
184
+ console.log('event.onJfbScroll', options)
185
+ },
186
+ onJfbReachBottom(options) {
187
+ console.log('event.onJfbReachBottom', options)
188
+ },
189
+ onJfbShow(options) {
190
+ console.log('event.onJfbShow', options)
191
+ },
192
+ onJfbHide(options) {
193
+ console.log('event.onJfbHide', options)
194
+ },
195
+ onJfbBack(options) {
196
+ console.log('event.onJfbBack', options)
197
+ },
198
+ onJfbUpdate(...data) {
199
+ console.log('event.onJfbUpdate', data)
200
+ },
201
+ onJfbCustomEvent(options) {
202
+ console.log('event.onJfbReachBottom', options)
203
+ },
204
+ }
205
+ }
206
+ </script>
207
+
208
+ <style scoped lang="less">
209
+ @import "./JfbThirdRideLandLess.less";
210
+
211
+ .jfb-third-ride-land {
212
+ min-height: 100vh;
213
+
214
+ &__body {
215
+ box-sizing: border-box;
216
+ }
217
+
218
+ //内容卡片
219
+ &__card {
220
+ position: relative;
221
+ box-sizing: border-box;
222
+ background: #FFFFFF;
223
+ border-radius: 24rpx;
224
+
225
+ &-placeholder {
226
+ font-size: 26rpx;
227
+ color: #CCCCCC;
228
+ }
229
+ }
230
+
231
+ //底部按钮
232
+ &__btn {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ width: 448rpx;
237
+ margin: 48rpx auto 0;
238
+ padding: 26rpx 0;
239
+ background: #3A7BFB;
240
+ border-radius: 60rpx;
241
+
242
+ &--disabled {
243
+ background: #E6E6E9;
244
+
245
+ .jfb-third-ride-land__btn-text {
246
+ color: #999999;
247
+ }
248
+ }
249
+ }
250
+
251
+ &__btn-text {
252
+ color: #FFFFFF;
253
+ font-size: 28rpx;
254
+ letter-spacing: 2rpx;
255
+ }
256
+ }
257
+ </style>
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @desc 获取绝对路径完整地址
3
+ * @param @path
4
+ **/
5
+ //例如:https://image.jufubao.cn/20220501010108/image/bg/default_gonghui_bg.png
6
+ @basePath: 'business/';
7
+ @doMain: '//sandbox-img.jufubao.cn/';
8
+
9
+ .getBusinessImageUrl(@path, @size: 'size8') {
10
+ @url: "@{doMain}@{basePath}@{path}?x-oss-process=style/@{size}";
11
+ background-image: url(@url);
12
+ }
13
+
14
+ //start
15
+ .jfb-third-ride-land {
16
+ box-sizing: border-box;
17
+
18
+ &__body{
19
+ position: relative;
20
+ overflow: hidden;
21
+ z-index: 2
22
+ }
23
+
24
+ &.editx,&.editx:hover {
25
+ position: relative;
26
+ min-height: unit(100, rpx);
27
+ z-index: 3;
28
+ &::after {
29
+ border: 2rpx dashed blue;
30
+ content: " ";
31
+ position: absolute;
32
+ top:0;
33
+ left:0;
34
+ bottom:0;
35
+ right:0;
36
+ z-index: var(--preview-z-index);
37
+ cursor: pointer;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ &__edit {
44
+ cursor: pointer;
45
+ position: absolute;
46
+ right: unit(0, rpx);
47
+ top: unit(0, rpx);
48
+ height: unit(50, rpx);
49
+ z-index: 100;
50
+ display: flex;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background: rgba(0, 0, 0, .4);
54
+ border-radius: 0 0 0 20rpx;
55
+ box-shadow: 0 0 10px rbga(0, 0, 0, 0.3);
56
+ color: #fff;
57
+ font-size: unit(22, rpx);
58
+ padding: 0 6rpx 0 6px;
59
+
60
+ &-icon{
61
+ padding: 0 unit(20, rpx);
62
+ }
63
+
64
+ &.editx {
65
+ box-sizing: border-box;
66
+
67
+ }
68
+ }
69
+ }
70
+ //end
71
+
72
+
73
+ /**notPreview**/
74
+ .jfb-third-ride-land {
75
+ //&:before {
76
+ //content: " ";
77
+ //display: table;
78
+ //}
79
+ }
80
+ /**endNotPreview**/
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+
4
+ //@AttrImport
5
+ import Attr from "./Attr";
6
+ //@EndAttrImport
7
+
8
+
9
+ export default {
10
+ data() {
11
+ return {
12
+ //#ifdef H5
13
+
14
+ //@AttrData
15
+ Attr:{}, //对外开发编辑属性
16
+ //@EndAttrData
17
+
18
+ // #endif
19
+ cssRoot: 'jfb-third-ride-land'
20
+ }
21
+ },
22
+ created() {
23
+
24
+ //@AttrDataCreated
25
+ this.Attr = this.$xdUniHelper.customClone(Attr);
26
+ //@EndAttrDataCreated
27
+
28
+
29
+ },
30
+ }
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+
5
+ getRideByIdFilmSquate:{},
6
+
7
+ updateRideFilmPaiqiDate:{},
8
+
9
+ removeRideFilmAddress:{},
10
+
11
+ addRideFilmcart:{},
12
+
13
+ }
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ export default (data, gValue, gColor, oldData) => {
4
+ return [
5
+ //高级
6
+ {
7
+ label: '按钮跳转链接',
8
+ groupKey:'advanced',
9
+ className: 'input100',
10
+ ele: 'xd-select-pages-path',
11
+ valueKey: 'btnLink',
12
+ placeholder: '请选择按钮跳转页面路径',
13
+ labelInline: true,
14
+ inline: false,
15
+ value: data['btnLink'] || null,
16
+ setting: {
17
+ mode:'new',
18
+ router: XdBus.getParentApi('getPagesTree')
19
+ },
20
+ },
21
+ ].filter(i=>i)
22
+ }
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+ import { dataVal } from "@/utils/AttrTools";
3
+
4
+ export default (data, gValue, gColor, oldData) => {
5
+ let imageConfig = {
6
+ sort: true,
7
+ maxlen: 100,
8
+ action: "aliyun",
9
+ qiniuCdn: "aliyun",
10
+ size: 2,
11
+ tipsformet: "上传文件格式:@imageType@,不超过@size@MB。该上传图会在用户端显示,不建议上传超过1920*1080图片。",
12
+ uploadType: "aliyun",
13
+ type: ["jpg", "png", "jpeg", "gif"],
14
+ };
15
+ return [
16
+ //内容
17
+ {
18
+ label: "业务线",
19
+ ele: "xd-choose-namespace",
20
+ valueKey: "xnamespace",
21
+ value: dataVal({data, key:'xnamespace', dValue:"", gValue}),
22
+ groupKey:'content',
23
+ className: 'input80',
24
+ labelInline:true,
25
+ placeholder: '请选择业务线',
26
+ notice: '空继承上级业务线',
27
+ inline: false,
28
+ handleCustom: (cb) => {
29
+ XdBus.getParentApi('getOptionsNamespaces')()
30
+ .then(res => {
31
+ cb(res.list)
32
+ })
33
+ .catch();
34
+ }
35
+ },
36
+ //富文本内容
37
+ {
38
+ label: "须知内容:",
39
+ ele: "xd-tinymce",
40
+ valueKey: "contentHtml",
41
+ value: data.contentHtml || "",
42
+ imageConfig,
43
+ inline: false,
44
+ groupKey: "content",
45
+ },
46
+ //按钮文案
47
+ {
48
+ label: '按钮文案',
49
+ ele: 'el-input',
50
+ groupKey: 'content',
51
+ valueKey: 'btnText',
52
+ value: dataVal({data, key: 'btnText', dValue: '我已知晓', gValue}),
53
+ placeholder: '请输入按钮文案',
54
+ labelInline: true,
55
+ className: 'input100',
56
+ },
57
+ //倒计时秒数
58
+ {
59
+ label: '倒计时秒数:',
60
+ ele: 'el-input',
61
+ groupKey: 'content',
62
+ valueKey: 'countdown',
63
+ type: 'number',
64
+ value: dataVal({data, key: 'countdown', dValue: 5, gValue}),
65
+ placeholder: '请输入倒计时秒数,0为不显示倒计时',
66
+ className: 'input60',
67
+ labelInline: true,
68
+ },
69
+ ].filter(i=>i)
70
+ }
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+ import {dataVal, statusShow, statusDataVal} from "@/utils/AttrTools";
3
+
4
+ export default (data, gValue, gColor, oldData) => {
5
+ return [
6
+ //风格
7
+ //背景图(含头部banner背景)
8
+ {
9
+ label: '背景图',
10
+ ele: 'xd-upload',
11
+ groupKey: 'style',
12
+ valueKey: 'bgImage',
13
+ value: data.bgImage || {},
14
+ defaultValue: data.bgImage || null,
15
+ slot: true,
16
+ oneWidth: 355,
17
+ oneHeight: 355,
18
+ elinputClassName: 'input40',
19
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.建议宽度为<span style="color:red">750px</span>',
20
+ type: ['jpg', 'png', 'jpeg'],
21
+ styleType: 'one',
22
+ uploadType: 'aliyun',
23
+ size: 2,
24
+ action: 'action',
25
+ sort: true,
26
+ maxlen: 1,
27
+ labelInline: true,
28
+ },
29
+ //背景色
30
+ {
31
+ label: '背景色:',
32
+ ele: 'xd-color',
33
+ groupKey: 'style',
34
+ valueKey: 'bgColor',
35
+ value: dataVal({data, key:'bgColor', dValue:'#E4F3FF', gValue}),
36
+ placeholder: '请选择页面背景色',
37
+ className: 'input80',
38
+ labelInline: true,
39
+ setting: {
40
+ showAlpha: true
41
+ },
42
+ },
43
+ //外边距
44
+ {
45
+ label: '外边距',
46
+ ele: 'xd-radio',
47
+ groupKey: 'style',
48
+ valueKey: 'marginStatus',
49
+ value: statusDataVal({data, key:'marginStatus', fields:['margin'], gValue}),
50
+ labelInline: true,
51
+ list: [
52
+ {label: '默认', value: 'D'},
53
+ {label: '自定义', value: 'C'},
54
+ ]
55
+ },
56
+ {ele: 'group_start'},
57
+ {
58
+ label: '',
59
+ ele: 'xd-margin-padding',
60
+ groupKey: 'style',
61
+ valueKey: 'margin',
62
+ value: dataVal({data, key:'margin', dValue: 32, gValue, isPM: true}),
63
+ hidden: !statusShow({data, key:'marginStatus', fields:['margin'], gValue}),
64
+ setting: {
65
+ type: 'margin',
66
+ },
67
+ },
68
+ {ele: 'group_end'},
69
+ //卡片内边距
70
+ {
71
+ label: '卡片内边距',
72
+ ele: 'xd-radio',
73
+ groupKey: 'style',
74
+ valueKey: 'paddingStatus',
75
+ value: statusDataVal({data, key:'paddingStatus', fields:['padding'], gValue}),
76
+ labelInline: true,
77
+ list: [
78
+ {label: '默认', value: 'D'},
79
+ {label: '自定义', value: 'C'},
80
+ ]
81
+ },
82
+ {ele: 'group_start'},
83
+ {
84
+ label: '',
85
+ ele: 'xd-margin-padding',
86
+ groupKey: 'style',
87
+ valueKey: 'padding',
88
+ value: dataVal({data, key:'padding', dValue: 32, gValue, isPM: true}),
89
+ hidden: !statusShow({data, key:'paddingStatus', fields:['padding'], gValue}),
90
+ setting: {
91
+ type: 'margin',
92
+ },
93
+ },
94
+ {ele: 'group_end'},
95
+ //卡片圆角
96
+ {
97
+ label: '卡片圆角',
98
+ ele: 'xd-radio',
99
+ groupKey: 'style',
100
+ valueKey: 'radiusStatus',
101
+ value: statusDataVal({data, key:'radiusStatus', fields:['radius'], gValue}),
102
+ labelInline: true,
103
+ list: [
104
+ {label: '默认', value: 'D'},
105
+ {label: '自定义', value: 'C'},
106
+ ]
107
+ },
108
+ {ele: 'group_start'},
109
+ {
110
+ label: '',
111
+ ele: 'el-input',
112
+ type: 'number',
113
+ groupKey: 'style',
114
+ valueKey: 'radius',
115
+ value: dataVal({data, key:'radius', dValue: 24, gValue}),
116
+ placeholder: '请输入卡片圆角,单位rpx',
117
+ className: 'input60',
118
+ labelInline: true,
119
+ hidden: !statusShow({data, key:'radiusStatus', fields:['radius'], gValue}),
120
+ },
121
+ {ele: 'group_end'},
122
+ ].filter(i=>i)
123
+ }
@@ -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
  });