jufubao-movie 1.0.39-beta1 → 1.0.39-beta11

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,257 @@
1
+ 'use strict';
2
+
3
+ export default (data,outSpacing)=>{
4
+ let size = {width:750 - outSpacing*2,height:null};
5
+ if(data.poster && data.poster.size && data.poster.size.height) {
6
+ size['height'] = data.poster.size.height
7
+ }
8
+ let poster = {
9
+ size: size,
10
+ type:'1',
11
+ position: Object.assign({},data.poster && data.poster.position)
12
+ };
13
+
14
+ return [
15
+ {
16
+ ele: 'title',
17
+ label: '广告设置',
18
+ size: 'small',
19
+ groupKey:'content',
20
+ },
21
+
22
+ {
23
+ label: '广告位置配置:',
24
+ ele: 'xd-site-poster',
25
+ valueKey: 'poster',
26
+ className: 'input80',
27
+ value: poster,
28
+ groupKey:'content',
29
+ setting: {
30
+ count: 1,
31
+ scene: {label: '广告', value: 'normal'},
32
+ sizeDisabled: {
33
+ wDisabled:true,
34
+ hDisabled: false,
35
+ },
36
+ typeDisabled: true
37
+ },
38
+ handleCustom({action, data}) {
39
+ //设置场景参数
40
+ if(data) {
41
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
42
+ }
43
+ console.log(action,data,'hjhjhjhjhj');
44
+
45
+ //获取显示内容
46
+ if (action === 'screenList') {
47
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
48
+ .then(res => {
49
+ data.cb(res['list'])
50
+ })
51
+ .catch(error => {
52
+ console.error(error);
53
+ });
54
+ return
55
+ }
56
+
57
+ //获取返回参数(广告位高度必选项)
58
+ if (action === 'getPosterInfo') {
59
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
60
+ .then(res => {
61
+ data.cb({list: res.list, selectId: res.selected})
62
+ })
63
+ .catch(error => {
64
+ console.error(error);
65
+ });
66
+ return
67
+ }
68
+
69
+ //使用内容分类
70
+ if (action === 'cmsPublishEditxContent') {
71
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
72
+ .then(res => {
73
+ data.cb(res)
74
+ })
75
+ .catch(error => {
76
+ console.error(error);
77
+ });
78
+ return
79
+ }
80
+
81
+ let loading = XdBus.getParentApi('loading')({});
82
+ //位置列表
83
+ if (action === 'getListPostion') {
84
+ XdBus.getParentApi('getListPosterPosition')(data.params)
85
+ .then(res => {
86
+ loading.close();
87
+ data.cb(res)
88
+ })
89
+ .catch(error => {
90
+ loading.close();
91
+ console.error(error);
92
+ });
93
+ }
94
+
95
+ //位置创建
96
+ if (action === 'addPostion') {
97
+ XdBus.getParentApi('addPosterPosition')(data.params)
98
+ .then(res => {
99
+ loading.close();
100
+ data.cb(true)
101
+ })
102
+ .catch(error => {
103
+ console.error(error);
104
+ loading.close();
105
+ data.cb(false)
106
+ });
107
+ }
108
+
109
+ //位置编辑
110
+ if (action === 'editPostion') {
111
+ XdBus.getParentApi('updatePosterPosition')(data.params)
112
+ .then(res => {
113
+ loading.close();
114
+ data.cb(true)
115
+ })
116
+ .catch(error => {
117
+ console.error(error);
118
+ loading.close();
119
+ data.cb(false)
120
+ });
121
+ }
122
+
123
+ //位置删除
124
+ if (action === 'deleltePostion') {
125
+ XdBus.getParentApi('deletePosterPosition')(data.params)
126
+ .then(res => {
127
+ loading.close();
128
+ data.cb(true)
129
+ })
130
+ .catch(error => {
131
+ console.error(error);
132
+ loading.close();
133
+ data.cb(false)
134
+ });
135
+ }
136
+
137
+ //获取广告位内容列表
138
+ if (action === 'getListContent') {
139
+ XdBus.getParentApi('getListPosterContent')(data.params)
140
+ .then(res => {
141
+ loading.close();
142
+ data.cb(res)
143
+ })
144
+ .catch(error => {
145
+ loading.close();
146
+ console.error(error);
147
+ });
148
+ }
149
+
150
+ //广告内容创建
151
+ if (action === 'addContent') {
152
+ XdBus.getParentApi('addPosterContent')(data.params)
153
+ .then(res => {
154
+ loading.close();
155
+ data.cb(true)
156
+ })
157
+ .catch(error => {
158
+ console.error(error);
159
+ loading.close();
160
+ data.cb(false)
161
+ });
162
+ }
163
+
164
+ //广告内容编辑
165
+ if (action === 'editContent') {
166
+ XdBus.getParentApi('updatePosterContent')(data.params)
167
+ .then(res => {
168
+ loading.close();
169
+ data.cb(true)
170
+ })
171
+ .catch(error => {
172
+ console.error(error);
173
+ loading.close();
174
+ data.cb(false)
175
+ });
176
+ }
177
+
178
+ //广告内容删除
179
+ if (action === 'deleteContent') {
180
+ XdBus.getParentApi('deletePosterContent')(data.params)
181
+ .then(res => {
182
+ loading.close();
183
+ data.cb(true)
184
+ })
185
+ .catch(error => {
186
+ console.error(error);
187
+ loading.close();
188
+ data.cb(false)
189
+ });
190
+ }
191
+
192
+ //获取广告内容跳转地址类型
193
+ if (action === 'jumpPosterContentType') {
194
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
195
+ .then(res => {
196
+ loading.close();
197
+ data.cb(res['redirect_type'])
198
+ })
199
+ .catch(error => {
200
+ loading.close();
201
+ console.error(error);
202
+ });
203
+ }
204
+
205
+ //发布
206
+ if (action === 'publish') {
207
+ console.log('publish', data.params)
208
+ XdBus.getParentApi('cmsPublishContent')(data.params)
209
+ .then(res => {
210
+ loading.close();
211
+ data.cb(res)
212
+ })
213
+ .catch(error => {
214
+ loading.close();
215
+ console.error(error);
216
+ });
217
+ }
218
+
219
+ //获取站内页面地址
220
+ if (action === 'router') {
221
+ loading.close()
222
+ return XdBus.getParentApi('getPagesTree');
223
+
224
+ }
225
+
226
+ //通知页面进行刷新
227
+ if(action === 'update') {
228
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
229
+ loading.close()
230
+ }
231
+ },
232
+ },
233
+ {
234
+ label: '广告位置使用张数:',
235
+ ele: 'el-input',
236
+ type: 'number',
237
+ valueKey: 'posterNum',
238
+ groupKey:'content',
239
+ value: data.posterNum || 1,
240
+ placeholder: '请输入广告位置使用张数',
241
+ className: 'input40',
242
+ unit: '张',
243
+ },
244
+ {
245
+ label: '广告轮播周期:',
246
+ ele: 'el-input',
247
+ type: 'number',
248
+ valueKey: 'carouselTime',
249
+ groupKey:'content',
250
+ value: data.carouselTime || 5,
251
+ placeholder: '广告轮播周期,默认5秒',
252
+ className: 'input40',
253
+ unit: '秒',
254
+ },
255
+ ]
256
+ }
257
+
@@ -0,0 +1,160 @@
1
+ <template>
2
+ <view
3
+ class="list-poster a"
4
+ v-if="posterList !== null && posterList.length > 0"
5
+ :style="{marginTop:styleObj.outSpacing + 'rpx'}"
6
+ >
7
+ <view
8
+ :style="{width: styleObj.posterSize.width + 'rpx', height: styleObj.posterSize.height + 'rpx' }"
9
+ class="list-poster-one"
10
+ v-if="posterList.length === 1"
11
+ >
12
+ <image
13
+ @click.stop="handlePosterClick(posterList[0],0)"
14
+ :style="{width: styleObj.posterSize.width + 'rpx', height: styleObj.posterSize.height + 'rpx' }"
15
+ :src="posterList[0].image_url"
16
+ :alt="posterList[0].content_name"
17
+ mode="aspectFill"
18
+ ></image>
19
+ </view>
20
+ <view class="list-poster-more" v-else>
21
+ <xd-swiper-dot
22
+ :style="{width: styleObj.posterSize.width + 'rpx', height: styleObj.posterSize.height + 'rpx' }"
23
+ :current="current"
24
+ :info="posterList"
25
+ field="content_name"
26
+ :mode="mode"
27
+ :dots-styles="dotStyleData"
28
+ >
29
+ <swiper
30
+ class="swiper xd-swiper-content"
31
+ :style="{width: styleObj.posterSize.width + 'rpx', height: styleObj.posterSize.height + 'rpx' }"
32
+ :indicator-dots="false"
33
+ :autoplay="styleObj.carouselTime >0"
34
+ :interval="styleObj.carouselTime"
35
+ :duration="500"
36
+ :current="current"
37
+ circular
38
+ @animationfinish="handleAnimationfinish"
39
+ >
40
+ <swiper-item v-for="(item,index) in posterList" :key="index" @click.stop="handlePosterClick(item,index)">
41
+ <image
42
+ :style="{width: styleObj.posterSize.width + 'rpx', height: styleObj.posterSize.height + 'rpx' }"
43
+ :src="item['image_url']"
44
+ mode="aspectFill"
45
+ ></image>
46
+ </swiper-item>
47
+ </swiper>
48
+ </xd-swiper-dot>
49
+ </view>
50
+ </view>
51
+ </template>
52
+
53
+ <script>
54
+
55
+ import XdSwiperDot from "./XdSwiperDot.vue";
56
+
57
+ export default {
58
+ name: "XdPoster",
59
+ props:{
60
+ styleObj:{
61
+ type: Object,
62
+ default(){
63
+ return {}
64
+ }
65
+ },
66
+ posterList:{
67
+ type: Array|null,
68
+ default: null
69
+ },
70
+ dotStyleData:{
71
+ type: Object,
72
+ default(){
73
+ return {}
74
+ }
75
+ },
76
+ mode:{
77
+ type: String,
78
+ default:''
79
+ }
80
+ },
81
+ components: {
82
+ XdSwiperDot
83
+ },
84
+ data(){
85
+ return {
86
+ current:0
87
+ }
88
+ },
89
+ methods:{
90
+ handlePosterClick(item,index){
91
+ if(!item.redirect_data) {
92
+ console.warn(`未配置链接地址: ${item.redirect_data}`);
93
+ console.error(`未配置链接地址: ${item.redirect_data}`);
94
+ return
95
+ }
96
+
97
+ //内部链接跳转地址
98
+ if (item.redirect_type === 'INN') {
99
+ try {
100
+ let url = JSON.parse(item.redirect_data);
101
+ let params = '';
102
+ if(url.page) {
103
+ if (item['redirect_params']) params = `?${item['redirect_params']}`;
104
+ this.$xdUniHelper.navigateTo({url: url.page + params})
105
+ }
106
+ else {
107
+ console.error(`应用链接配置错误: ${url.page}`)
108
+ }
109
+ } catch (e) {
110
+ console.error(`应用链接配置错误: ${item.redirect_data}`)
111
+ }
112
+ }
113
+
114
+ //外部链接
115
+ if (item.redirect_type === 'URL') {
116
+ let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
117
+ let spReg = /(-apiuri\/v)/;
118
+ //#ifdef MP-WEIXIN
119
+ try {
120
+ let url = JSON.parse(item.redirect_data);
121
+ if (reg.test(url.url) || spReg.test(url.url)) {
122
+ console.warn(`广告跳转外站: ${url.url}`)
123
+ this.$xdUniHelper.navigateTo(url);
124
+ } else {
125
+ console.error(`广告跳转外站配置错误: ${url.url}`)
126
+ }
127
+ } catch (e) {
128
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
129
+ }
130
+ //#endif
131
+ //#ifdef H5
132
+ try {
133
+ let url = JSON.parse(item.redirect_data);
134
+ console.warn(`广告跳转外站: ${url.url}`);
135
+ this.$xdUniHelper.redirectTo(url, false)
136
+ } catch (e) {
137
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
138
+ }
139
+ //#endif
140
+
141
+ }
142
+
143
+ //无跳转地址
144
+ if(item.redirect_type === 'EMP') {
145
+ console.warn(`无跳转地址`);
146
+ }
147
+ },
148
+
149
+ handleAnimationfinish(e){
150
+ this.current = e.detail.current;
151
+ },
152
+ }
153
+ }
154
+
155
+ </script>
156
+
157
+
158
+ <style scoped lang="less">
159
+
160
+ </style>
@@ -54,6 +54,7 @@ export default {
54
54
  min-height: 500rpx;
55
55
  max-height: 600rpx;
56
56
  overflow-y: auto;
57
+ padding: 0 20rpx;
57
58
 
58
59
  .filter_item {
59
60
  border-top: 6rpx dotted #F7F7F7;
@@ -261,21 +261,49 @@ export default {
261
261
  groupKey:'style',
262
262
  },
263
263
  {
264
- label: '数量文字颜色:',
264
+ label: '总数量文字颜色:',
265
265
  ele: 'xd-color',
266
266
  valueKey: 'totalColor',
267
267
  value: data['totalColor'] || '',
268
268
  groupKey:'style',
269
- placeholder: '请输入背景颜色',
269
+ placeholder: '请输入总数量文字颜色',
270
+ classNmae: 'input60',
271
+ },
272
+
273
+
274
+ {
275
+ ele: 'title',
276
+ label: '标题显示样式:<span style="color:red">“下划线样式”</span> 设置',
277
+ size: 'small',
278
+ groupKey:'style',
279
+ },
280
+ {
281
+ label: '标题文字颜色:',
282
+ ele: 'xd-color',
283
+ valueKey: 'titleLineTextColor',
284
+ value: data['titleLineTextColor'] || '',
285
+ groupKey:'style',
286
+ placeholder: '请输入标题文字颜色',
287
+ classNmae: 'input60',
288
+ },
289
+ {
290
+ label: '标题选中文字颜色:',
291
+ ele: 'xd-color',
292
+ valueKey: 'titleLineActTextColor',
293
+ value: data['titleLineActTextColor'] || '',
294
+ groupKey:'style',
295
+ placeholder: '请输入选中文字颜色',
270
296
  classNmae: 'input60',
271
297
  },
272
298
 
273
299
  {
274
300
  ele: 'title',
275
- label: '标题切换标签设置<span style="color:red">按钮样式</span>生效',
301
+ label: '标题显示样式:<span style="color:red">“按钮样式”</span> 设置',
276
302
  size: 'small',
277
303
  groupKey:'style',
278
304
  },
305
+
306
+
279
307
  {
280
308
  label: '标题背景颜色:',
281
309
  ele: 'xd-color',
@@ -20,7 +20,8 @@
20
20
  v-if="showTypeListData.length > 0"
21
21
  :style="{
22
22
  padding: outSpacing + 'rpx',
23
- backgroundImage:bgImageComp
23
+ backgroundImage:bgImageComp,
24
+ backgroundColor: bgColor
24
25
  }">
25
26
  <view
26
27
  class="tfk-recommend__tab"
@@ -43,6 +44,7 @@
43
44
  :class="{active: type === item.value}"
44
45
  v-for="(item,index) in showTypeListData"
45
46
  :key="index"
47
+ :style="{color: (type === item.value? titleLineActTextColor: titleLineTextColor)}"
46
48
  >{{item.label}}<text v-if="type === item.value" :style="{backgroundColor:mainColor}"></text></view>
47
49
  </view>
48
50
  <view
@@ -58,7 +60,8 @@
58
60
  :style="{
59
61
  backgroundColor: type === item.value? titleTextActBgColor: titleTextBgColor,
60
62
  color: type === item.value ? titleTextActColor: titleTextColor,
61
- borderRadius:titleTextRradius+'rpx'
63
+ borderRadius:titleTextRradius+'rpx',
64
+ marginRight:outSpacing + 'rpx',
62
65
  }"
63
66
  >{{item.label}}</view>
64
67
  </view>
@@ -88,7 +91,7 @@
88
91
  backgroundColor:contBgColor,
89
92
  borderRadius: contRradius + 'rpx',
90
93
  border:contBorder,
91
- boxShadow:contShadow,
94
+ boxShadow:contShadow
92
95
  }"
93
96
  >
94
97
  <view class="skeleton-wrap" v-if="dataList === null">
@@ -100,13 +103,14 @@
100
103
  </view>
101
104
  <scroll-view class="tfk-scroll" scroll-x enable-flex v-else>
102
105
  <view
106
+ v-if="dataList.length > 0"
103
107
  class="tfk-scroll-item"
104
108
  v-for="item in dataList"
105
109
  :key="item.id"
106
110
  @click="toFilmInfo(item.id)"
107
111
  >
108
112
  <view class="tfk-scroll-item-image" :style="{borderRadius:contItemRradius + 'rpx'}">
109
- <image :src="item.poster" :alt="item.show_name" mode="scaleToFill"></image>
113
+ <image :src="item.poster" :alt="item.show_name" mode="scaleToFill" @error="handleError(item)"></image>
110
114
  </view>
111
115
  <view class="tfk-scroll-item-title">{{item.show_name}}</view>
112
116
  <view class="tfk-scroll-item-btn">
@@ -141,6 +145,7 @@
141
145
  </template>
142
146
  </view>
143
147
  </view>
148
+ <xd-no-data v-if="dataList && dataList.length ===0" height="100%" icon-type="film">暂无影片数据</xd-no-data>
144
149
  </scroll-view>
145
150
  </view>
146
151
  </view>
@@ -158,6 +163,7 @@
158
163
  <script>
159
164
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
160
165
  import XdButton from "@/components/XdButton/XdButton.vue";
166
+ import XdNoData from "@/components/XdNoData/XdNoData.vue";
161
167
  import { jfbRootExec } from "@/utils/xd.event";
162
168
  import JfbMovieTfkFilmRecommendMixin from "./JfbMovieTfkFilmRecommendMixin";
163
169
  import { getContainerPropsValue } from "@/utils/xd.base";
@@ -172,7 +178,8 @@
172
178
  name: "JfbMovieTfkFilmRecommend",
173
179
  components: {
174
180
  XdFontIcon,
175
- XdButton
181
+ XdButton,
182
+ XdNoData
176
183
  },
177
184
  mixins: [
178
185
  componentsMixins, extsMixins, JfbMovieTfkFilmRecommendMixin
@@ -192,6 +199,7 @@
192
199
  showTypeListData:[],
193
200
 
194
201
  //基础配置
202
+ bgColor:'',
195
203
  outSpacing:'',
196
204
  showMoreBtn: 'Y',
197
205
  showTotal:'Y',
@@ -223,6 +231,10 @@
223
231
  moreRradius: '40',
224
232
  totalColor: '#999',
225
233
 
234
+ //line
235
+ titleLineTextColor:'',
236
+ titleLineActTextColor:'',
237
+
226
238
  //内容
227
239
  contMargin: {},
228
240
  contBgColor:'#fff',
@@ -310,6 +322,9 @@
310
322
  this.init(this.container);
311
323
  },
312
324
  methods: {
325
+ handleError(item){
326
+ item['poster'] = 'https://img.jufubao.cn/common/error_movie.png?v20'
327
+ },
313
328
  toFilmInfo(film_id){
314
329
  console.warn(`toFilmInfo(影片详情).${film_id}`)
315
330
  if(!this.fimeDetailPath) {
@@ -347,7 +362,7 @@
347
362
  }
348
363
  if( this.isPreview) return;
349
364
  this.$xdUniHelper.navigateTo({
350
- url: this.fimeListPath
365
+ url: this.fimeListPath+'?tab_id=' + this.type
351
366
  })
352
367
  },
353
368
  onJfbLoad(options) {
@@ -385,6 +400,7 @@
385
400
  * @param container {object} 业务组件对象自己
386
401
  */
387
402
  init(container) {
403
+ this.bgColor = getContainerPropsValue(container, 'content.bgColor', '');
388
404
  this.outSpacing = getContainerPropsValue(container, 'content.outSpacing', '20');
389
405
  this.titleMargin = getContainerPropsValue(container, 'content.titleMargin', {});
390
406
  this.titleBgColor = getContainerPropsValue(container, 'content.titleBgColor', '#fff');
@@ -406,6 +422,10 @@
406
422
  this.showHotName = getContainerPropsValue(container, 'content.showHotName', '');
407
423
  this.showRightnowName = getContainerPropsValue(container, 'content.showRightnowName', '');
408
424
 
425
+ //line
426
+ this.titleLineTextColor = getContainerPropsValue(container, 'content.titleLineTextColor', '#333');
427
+ this.titleLineActTextColor= getContainerPropsValue(container, 'content.titleLineActTextColor', '#333');
428
+
409
429
  this.isTitleBorder = getContainerPropsValue(container, 'content.isTitleBorder', 'N');
410
430
  this.isTitleBorderColor = getContainerPropsValue(container, 'content.isTitleBorderColor', '#eee');
411
431
  this.isTitleShadow = getContainerPropsValue(container, 'content.isTitleShadow', 'N');
@@ -490,6 +510,10 @@
490
510
  }
491
511
  &.button > view {
492
512
  padding: 0 30rpx;
513
+ &:last-child {
514
+ margin-right: 0!important;
515
+ }
516
+
493
517
  }
494
518
 
495
519
  & > view {