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.
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ import PosterAttr from "./PosterAttr.js";
4
+
3
5
  /**
4
6
  * @description 当表单组件中有联动操作时候,使用方法进行返回
5
7
  */
@@ -8,15 +10,7 @@ export default {
8
10
  content: (data) => {
9
11
  let outSpacing = 20;
10
12
  if(data['outSpacing'] ) outSpacing = Number(data['outSpacing'])
11
- let size = {width:750 - outSpacing*2,height:null};
12
- if(data.poster && data.poster.size && data.poster.size.height) {
13
- size['height'] = data.poster.size.height
14
- }
15
- let poster = {
16
- size: size,
17
- type:'1',
18
- position: Object.assign({},data.poster && data.poster.position)
19
- };
13
+
20
14
  return [
21
15
 
22
16
  {
@@ -112,236 +106,9 @@ export default {
112
106
  });
113
107
  },
114
108
  },
115
- {
116
- ele: 'title',
117
- label: '广告设置',
118
- size: 'small',
119
- groupKey:'content',
120
- },
121
-
122
- {
123
- label: '广告位置配置:',
124
- ele: 'xd-site-poster',
125
- valueKey: 'poster',
126
- className: 'input80',
127
- value: poster,
128
- groupKey:'content',
129
- setting: {
130
- count: 1,
131
- scene: {label: '广告', value: 'normal'},
132
- sizeDisabled: {
133
- wDisabled:true,
134
- hDisabled: false,
135
- },
136
- typeDisabled: true
137
- },
138
- handleCustom({action, data}) {
139
- //设置场景参数
140
- if(data) {
141
- data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
142
- }
143
- console.log(action,data,'hjhjhjhjhj');
144
-
145
- //获取显示内容
146
- if (action === 'screenList') {
147
- XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
148
- .then(res => {
149
- data.cb(res['list'])
150
- })
151
- .catch(error => {
152
- console.error(error);
153
- });
154
- return
155
- }
156
-
157
- //获取返回参数(广告位高度必选项)
158
- if (action === 'getPosterInfo') {
159
- XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
160
- .then(res => {
161
- data.cb({list: res.list, selectId: res.selected})
162
- })
163
- .catch(error => {
164
- console.error(error);
165
- });
166
- return
167
- }
168
-
169
- //使用内容分类
170
- if (action === 'cmsPublishEditxContent') {
171
- XdBus.getParentApi('cmsPublishEditxContent')(data.params)
172
- .then(res => {
173
- data.cb(res)
174
- })
175
- .catch(error => {
176
- console.error(error);
177
- });
178
- return
179
- }
180
-
181
- let loading = XdBus.getParentApi('loading')({});
182
- //位置列表
183
- if (action === 'getListPostion') {
184
- XdBus.getParentApi('getListPosterPosition')(data.params)
185
- .then(res => {
186
- loading.close();
187
- data.cb(res)
188
- })
189
- .catch(error => {
190
- loading.close();
191
- console.error(error);
192
- });
193
- }
194
-
195
- //位置创建
196
- if (action === 'addPostion') {
197
- XdBus.getParentApi('addPosterPosition')(data.params)
198
- .then(res => {
199
- loading.close();
200
- data.cb(true)
201
- })
202
- .catch(error => {
203
- console.error(error);
204
- loading.close();
205
- data.cb(false)
206
- });
207
- }
208
-
209
- //位置编辑
210
- if (action === 'editPostion') {
211
- XdBus.getParentApi('updatePosterPosition')(data.params)
212
- .then(res => {
213
- loading.close();
214
- data.cb(true)
215
- })
216
- .catch(error => {
217
- console.error(error);
218
- loading.close();
219
- data.cb(false)
220
- });
221
- }
222
-
223
- //位置删除
224
- if (action === 'deleltePostion') {
225
- XdBus.getParentApi('deletePosterPosition')(data.params)
226
- .then(res => {
227
- loading.close();
228
- data.cb(true)
229
- })
230
- .catch(error => {
231
- console.error(error);
232
- loading.close();
233
- data.cb(false)
234
- });
235
- }
236
-
237
- //获取广告位内容列表
238
- if (action === 'getListContent') {
239
- XdBus.getParentApi('getListPosterContent')(data.params)
240
- .then(res => {
241
- loading.close();
242
- data.cb(res)
243
- })
244
- .catch(error => {
245
- loading.close();
246
- console.error(error);
247
- });
248
- }
249
-
250
- //广告内容创建
251
- if (action === 'addContent') {
252
- XdBus.getParentApi('addPosterContent')(data.params)
253
- .then(res => {
254
- loading.close();
255
- data.cb(true)
256
- })
257
- .catch(error => {
258
- console.error(error);
259
- loading.close();
260
- data.cb(false)
261
- });
262
- }
263
-
264
- //广告内容编辑
265
- if (action === 'editContent') {
266
- XdBus.getParentApi('updatePosterContent')(data.params)
267
- .then(res => {
268
- loading.close();
269
- data.cb(true)
270
- })
271
- .catch(error => {
272
- console.error(error);
273
- loading.close();
274
- data.cb(false)
275
- });
276
- }
277
-
278
- //广告内容删除
279
- if (action === 'deleteContent') {
280
- XdBus.getParentApi('deletePosterContent')(data.params)
281
- .then(res => {
282
- loading.close();
283
- data.cb(true)
284
- })
285
- .catch(error => {
286
- console.error(error);
287
- loading.close();
288
- data.cb(false)
289
- });
290
- }
291
-
292
- //获取广告内容跳转地址类型
293
- if (action === 'jumpPosterContentType') {
294
- XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
295
- .then(res => {
296
- loading.close();
297
- data.cb(res['redirect_type'])
298
- })
299
- .catch(error => {
300
- loading.close();
301
- console.error(error);
302
- });
303
- }
304
-
305
- //发布
306
- if (action === 'publish') {
307
- console.log('publish', data.params)
308
- XdBus.getParentApi('cmsPublishContent')(data.params)
309
- .then(res => {
310
- loading.close();
311
- data.cb(res)
312
- })
313
- .catch(error => {
314
- loading.close();
315
- console.error(error);
316
- });
317
- }
318
-
319
- //获取站内页面地址
320
- if (action === 'router') {
321
- loading.close()
322
- return XdBus.getParentApi('getPagesTree');
323
-
324
- }
325
-
326
- //通知页面进行刷新
327
- if(action === 'update') {
328
- XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
329
- loading.close()
330
- }
331
- },
332
- },
333
- {
334
- label: '广告位置使用张数:',
335
- ele: 'el-input',
336
- type: 'number',
337
- valueKey: 'posterNum',
338
- groupKey:'content',
339
- value: data.posterNum || 1,
340
- placeholder: '请输入广告位置使用张数',
341
- className: 'input40',
342
- unit: '张',
343
- },
344
109
 
110
+ //广告属性配置
111
+ ...PosterAttr(data,outSpacing),
345
112
 
346
113
  {
347
114
  label: '外边间距:',
@@ -4,51 +4,57 @@
4
4
  class="image"
5
5
  :style="{marginRight: outSpacing + 'rpx',borderRadius:borderRadius+'rpx'}"
6
6
  >
7
- <image :src="item['poster']" :alt="item['show_name']"></image>
7
+ <image v-if="errorStatus" :src="errorImage" :alt="item['show_name']" ></image>
8
+ <image v-if="!errorStatus" :src="item['poster']" :alt="item['show_name']" @error="handleError()" ></image>
8
9
  </view>
9
10
  <view class="middle">
10
- <view class="name">{{item['show_name']}}</view>
11
- <view class="other">类型:{{item['type']}}</view>
12
- <view class="other">导演:{{item['director']}}</view>
13
- <view class="other">主演:{{item['leading_role']}}</view>
14
- </view>
15
- <view class="right">
16
- <view class="score">
17
- <template v-if="item['remark']">
18
- <text>评分:</text><text :style="{color:color}">{{item['remark']}}</text>
19
- </template>
11
+ <view class="top">
12
+ <view class="name">{{item['show_name']}}</view>
13
+ <view class="score">
14
+ <template v-if="item['remark']">
15
+ <text>评分:</text><text :style="{color:color}">{{item['remark']}}</text>
16
+ </template>
17
+ </view>
20
18
  </view>
21
- <view class="btn">
22
- <template v-if="type === 'hot'">
23
- <xd-button
24
- v-if="item['show_button'] === '1'"
25
- type="primary"
26
- style="display:block;"
27
- size="small"
28
- @click.stop="handleBuy(item)">购票</xd-button>
29
- <xd-button
30
- v-else-if="item['show_button'] === '2'"
31
- type="subPrimary"
32
- style="display:block;"
33
- size="small"
34
- @click="handleBuy(item)">预售</xd-button>
35
- </template>
36
- <template v-if="type === 'rightnow'">
37
- <xd-button
38
- v-if="item['show_button'] === '3'"
39
- type="success"
40
- style="display:block;"
41
- size="small"
42
- @click.stop="handleDetail(item)"
43
- >想看</xd-button>
44
- <xd-button
45
- v-else-if="item['show_button'] === '2'"
46
- type="subPrimary"
47
- style="display:block;"
48
- size="small"
49
- @click.stop="handleBuy(item)">预售</xd-button>
50
- </template>
19
+ <view class="bottom">
20
+ <view>
21
+ <view class="other">类型:{{item['type']}}</view>
22
+ <view class="other">导演:{{item['director']}}</view>
23
+ <view class="other">主演:{{item['leading_role']}}</view>
24
+ </view>
25
+ <view class="btn">
26
+ <template v-if="type === 'hot'">
27
+ <xd-button
28
+ v-if="item['show_button'] === '1'"
29
+ type="primary"
30
+ style="display:block;"
31
+ size="small"
32
+ @click.stop="handleBuy(item)">购票</xd-button>
33
+ <xd-button
34
+ v-else-if="item['show_button'] === '2'"
35
+ type="subPrimary"
36
+ style="display:block;"
37
+ size="small"
38
+ @click="handleBuy(item)">预售</xd-button>
39
+ </template>
40
+ <template v-if="type === 'rightnow'">
41
+ <xd-button
42
+ v-if="item['show_button'] === '3'"
43
+ type="success"
44
+ style="display:block;"
45
+ size="small"
46
+ @click.stop="handleDetail(item)"
47
+ >想看</xd-button>
48
+ <xd-button
49
+ v-else-if="item['show_button'] === '2'"
50
+ type="subPrimary"
51
+ style="display:block;"
52
+ size="small"
53
+ @click.stop="handleBuy(item)">预售</xd-button>
54
+ </template>
55
+ </view>
51
56
  </view>
57
+
52
58
  </view>
53
59
  </view>
54
60
  </template>
@@ -80,10 +86,19 @@
80
86
  }
81
87
 
82
88
  },
89
+ data(){
90
+ return {
91
+ errorImage: 'https://img.jufubao.cn/common/error_movie.png?v20',
92
+ errorStatus: false,
93
+ }
94
+ },
83
95
  created() {
84
96
 
85
97
  },
86
98
  methods:{
99
+ handleError(){
100
+ this.errorStatus = true;
101
+ },
87
102
  handleDetail(item){
88
103
  console.log('handleDetail.item',item,item.id);
89
104
  this.$emit('on-film-detail',item.id);
@@ -115,51 +130,89 @@
115
130
  }
116
131
  .middle {
117
132
  flex: 1;
118
- & .name {
119
- font-size: 36rpx;
120
- font-weight: 600;
133
+
134
+ & .top {
135
+ display: flex;
136
+ justify-content: space-between;
137
+ align-items: flex-end;
121
138
  margin-bottom: 20rpx;
122
- .uni-max-cut(2, 90);
123
- line-height: 45rpx;
124
- }
125
139
 
126
- & .other {
127
- font-size: 25rpx;
128
- color: #999;
129
- .uni-max-cut(1,36);
130
- line-height: 36rpx;
131
- margin-bottom: 10rpx;
132
- &:last-child {
133
- margin-bottom: 0!important;
140
+ & > view:first-child{
141
+ flex: 1;
142
+ font-size: 36rpx;
143
+ font-weight: 600;
144
+ .uni-max-cut(2, 90);
145
+ line-height: 45rpx;
146
+ }
147
+ & >view:nth-child(2) {
148
+ flex-shrink: 0;
149
+ height: 45rpx;
150
+ line-height: 45rpx;
151
+ margin-left: 20rpx;
152
+ text-align: right;
153
+ & > text:nth-child(1) {
154
+ font-size: 20rpx;
155
+ }
156
+ & > text:nth-child(2) {
157
+ font-size: 28rpx;
158
+ }
134
159
  }
135
160
  }
136
- }
137
161
 
138
- .right {
139
- flex-shrink: 0;
140
- display: flex;
141
- align-content: space-between;
142
- align-items: flex-end;
143
- justify-content: flex-end;
144
- flex-flow: wrap;
145
- height: 100%;
146
- box-sizing: border-box;
147
- width: 160rpx;
148
- min-height: 200rpx;
162
+ & .bottom {
163
+ display: flex;
164
+ justify-content: space-between;
165
+ align-items: center;
149
166
 
150
- & .score {
151
- height: 40rpx;
152
- width:100%;
153
- text-align: right;
154
- & > text:nth-child(1) {
155
- font-size: 20rpx;
156
- }
157
- & > text:nth-child(2) {
158
- font-size: 28rpx;
167
+ & > view:first-child {
168
+ flex: 1;
169
+ & > view {
170
+ font-size: 25rpx;
171
+ color: #999;
172
+ .uni-max-cut(1,36);
173
+ line-height: 36rpx;
174
+ margin-bottom: 10rpx;
175
+ &:last-child {
176
+ margin-bottom: 0!important;
177
+ }
178
+ }
159
179
  }
160
180
 
181
+ & .btn {
182
+ width: 140rpx;
183
+ flex-shrink: 0;
184
+ margin-left: 20rpx;
185
+ }
161
186
  }
187
+ //& .name {
188
+ // font-size: 36rpx;
189
+ // font-weight: 600;
190
+ // margin-bottom: 20rpx;
191
+ // .uni-max-cut(2, 90);
192
+ // line-height: 45rpx;
193
+ //}
194
+ //
195
+ //& .other {
162
196
 
197
+ //}
163
198
  }
199
+
200
+ //.right {
201
+ // flex-shrink: 0;
202
+ // display: flex;
203
+ // align-content: space-between;
204
+ // align-items: flex-end;
205
+ // justify-content: flex-end;
206
+ // flex-flow: wrap;
207
+ // box-sizing: border-box;
208
+ // width: 160rpx;
209
+ // height: 200rpx;
210
+ //
211
+ // & .score {
212
+
213
+ //
214
+ // }
215
+ //
216
+ //}
164
217
  }
165
218
  </style>