jufubao-base 1.0.290-beta3 → 1.0.290
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/CusCouponChose/CusCouponChose.vue +1027 -0
- package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
- package/src/components/CusEnter/CusEnter.vue +360 -0
- package/src/components/CusPoster/CusPoster.vue +212 -0
- package/src/components/CusPoster/CusSwiperDot.vue +234 -0
- package/src/components/CusProduct/CusProduct.vue +372 -0
- package/src/components/CusShops/CusShops.vue +518 -0
- package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
- package/src/components/CusTab/CusTab.vue +411 -0
- package/src/components/CusVideo/CusVideo.vue +170 -0
- package/src/components/JfbBaseFooter/Attr.js +10 -155
- package/src/components/JfbBaseFooter/JfbBaseFooter.vue +98 -44
- package/src/components/JfbBaseFooter/XdFooterBar.vue +324 -0
- package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
- package/src/components/JfbBaseFooter/cusAttr/content.js +475 -0
- package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
- package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
- package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +3 -15
- package/src/components/JfbBaseTfkSearch/Api.js +15 -0
- package/src/components/JfbBaseTfkSearch/CustomList.vue +10 -0
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +255 -7
- package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +347 -0
- package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +192 -0
- package/src/components/JfbBaseTfkSearch/listMixins.js +8 -6
- package/src/components/JfbBaseUserInfo/Attr.js +12 -0
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +8 -2
- package/src/mixins/componentsMixins.js +363 -55
- package/src/mixins/posterMixins.js +27 -199
- package/src/mixins/productCompMixins.js +252 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import {mapActions} from "vuex";
|
|
3
2
|
|
|
4
3
|
export default {
|
|
5
|
-
|
|
6
|
-
...mapActions(['wxCodeForGetAppId']),
|
|
4
|
+
data(){
|
|
7
5
|
|
|
6
|
+
},
|
|
7
|
+
methods:{
|
|
8
8
|
/**
|
|
9
9
|
* @description 过滤不可以用
|
|
10
10
|
* 当前项目未H5时,过滤所有小程序应用
|
|
@@ -14,225 +14,53 @@ export default {
|
|
|
14
14
|
* 预览模式全过
|
|
15
15
|
*/
|
|
16
16
|
posterFilterNoUseData(list = []){
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
//====== h5 to wxmp(外部链接) 或者 wxmp to wxmp(外部链接) =========
|
|
21
|
-
filterPosterItem(list){
|
|
22
|
-
let content = list.filter(item=>{
|
|
17
|
+
let content = this.$xdUniHelper.cloneDeep(list).filter(item=>{
|
|
23
18
|
//预览模式
|
|
24
19
|
if( this.$configProject.isPreview) return true;
|
|
25
20
|
|
|
26
|
-
//非内部应用
|
|
21
|
+
//非内部应用
|
|
27
22
|
if(item.redirect_type !== 'INN') return true
|
|
28
23
|
|
|
29
24
|
//没有配置链接
|
|
30
25
|
if(!item.redirect_data) return true;
|
|
31
26
|
|
|
32
27
|
//内部应用
|
|
33
|
-
return true;
|
|
34
|
-
});
|
|
35
|
-
console.warn(`filterPosterItem.posterMixins:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
36
|
-
return content;
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
getSchemeUrl(app_id, url, params){
|
|
40
|
-
let env_version = 'release';
|
|
41
|
-
let query = '';
|
|
42
|
-
if(params) query = `&query=${encodeURIComponent(params)}`;
|
|
43
|
-
return `weixin://dl/business/?appid=${app_id}&path=${url}${query}&env_version=${env_version}`;;
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
//#ifdef H5
|
|
47
|
-
handleH5ToMP(app_id , url, params){
|
|
48
|
-
let newUrl = '/' + url.split('/').splice(-3).join('/');
|
|
49
|
-
let entry = '/pages/loading/loading';
|
|
50
|
-
let query = `callback_local=${newUrl}`;
|
|
51
|
-
if(params) query = `${query}&${params}`;
|
|
52
|
-
window.location.href = this.getSchemeUrl(app_id, entry, query);
|
|
53
|
-
},
|
|
54
|
-
//#endif
|
|
55
|
-
|
|
56
|
-
//#ifdef MP-WEIXIN
|
|
57
|
-
handleToMp(app_id,entry){
|
|
58
|
-
let envVersion = 'release';
|
|
59
|
-
wx.navigateToMiniProgram({
|
|
60
|
-
appId: app_id,
|
|
61
|
-
path: entry,
|
|
62
|
-
envVersion,
|
|
63
|
-
success(res) {
|
|
64
|
-
console.log(res);
|
|
65
|
-
},
|
|
66
|
-
fail:(err)=>{
|
|
67
|
-
console.error(err);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
handleMpToMP(app_id , url, params){
|
|
73
|
-
let newUrl = '/' + url.split('/').splice(-3).join('/');
|
|
74
|
-
let entry = '/pages/loading/loading';
|
|
75
|
-
let query = `callback_local=${newUrl}`;
|
|
76
|
-
if(params) query = `${query}&${params}`;
|
|
77
|
-
entry = `${entry}?${query}`;
|
|
78
|
-
this.handleToMp(app_id,entry)
|
|
79
|
-
},
|
|
80
|
-
//#endif
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @description 处理站点应用内部跳转微信小程序处理
|
|
84
|
-
* @param code {string} 站点内部微信小程序aopen_app_code
|
|
85
|
-
* @param type {string} h5|wxmp
|
|
86
|
-
* @param url {string} 内部链接地址
|
|
87
|
-
* @param params {string} 自定义参数 例如:id=1&cid=1234
|
|
88
|
-
*/
|
|
89
|
-
codeForGetAppId(code, type, url,params){
|
|
90
|
-
this.wxCodeForGetAppId({app_code: code})
|
|
91
|
-
.then(app_id=>{
|
|
92
|
-
//#ifdef H5
|
|
93
|
-
if(type === 'h5') this.handleH5ToMP(app_id,url, params || '');
|
|
94
|
-
//#endif
|
|
95
|
-
|
|
96
|
-
//#ifdef MP-WEIXIN
|
|
97
|
-
let obj = parsePath(url);
|
|
98
|
-
//跳转路径所在应用为微信小程序并且不属于当前应用
|
|
99
|
-
if(!obj.isSameApp && type === 'wxmp'){
|
|
100
|
-
this.handleMpToMP( app_id, url, params || '')
|
|
101
|
-
}
|
|
102
|
-
//#endif
|
|
103
|
-
})
|
|
104
|
-
.catch(err=>{
|
|
105
|
-
console.error(err)
|
|
106
|
-
})
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @description 跳转到第三方维修小程序
|
|
111
|
-
* @param item
|
|
112
|
-
*/
|
|
113
|
-
toOtherWxMp(item){
|
|
114
|
-
try {
|
|
115
|
-
let url = JSON.parse(item.redirect_data);
|
|
116
|
-
|
|
117
|
-
//url = {data: `/pages/loading/loading?callback=${encodeURIComponent('/pages/loading/loading')}&version=1.0.0`, app_id: '11212121212'}
|
|
118
|
-
//url = {data: `weixin://dl/business/?appid=11212121212&path=/pages/loading/loading&query=callback%3D%252Fpages%252Floading%252Floading%26version%3D1.0.0&env_version=release`, app_id: '11212121212'}
|
|
119
|
-
|
|
120
|
-
//#ifdef H5
|
|
121
|
-
let businessUrl = '';
|
|
122
|
-
if(url.data.indexOf('weixin://dl/business/?appid=') === 0) businessUrl = url.data;
|
|
123
28
|
else {
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
else console.error(`未设置APP_ID: ${url.app_id}`);
|
|
129
|
-
}
|
|
130
|
-
if(businessUrl) window.location.href = businessUrl;
|
|
131
|
-
//#endif
|
|
132
|
-
|
|
133
|
-
//#ifdef MP-WEIXIN
|
|
134
|
-
this.handleToMp(url.app_id, url.data)
|
|
135
|
-
//#endif
|
|
136
|
-
}catch (e) {
|
|
137
|
-
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
handlePosterClick(item){
|
|
143
|
-
console.warn(`handlePosterClick.posterMixins`);
|
|
144
|
-
|
|
145
|
-
//预览模式
|
|
146
|
-
if( this.$configProject.isPreview) return;
|
|
147
|
-
|
|
148
|
-
//未配置链接地址
|
|
149
|
-
if(!item.redirect_data) {
|
|
150
|
-
console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
151
|
-
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
152
|
-
return
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
//内部链接跳转地址
|
|
156
|
-
if (item.redirect_type === 'INN') {
|
|
157
|
-
try {
|
|
158
|
-
let url = JSON.parse(item.redirect_data);
|
|
159
|
-
|
|
160
|
-
let params = '';
|
|
161
|
-
if(url.page) {
|
|
29
|
+
let redirect_data;
|
|
30
|
+
try {
|
|
31
|
+
redirect_data = JSON.parse(item.redirect_data);
|
|
32
|
+
if(!item['app_type']) item['app_type']= 'h5';
|
|
162
33
|
|
|
163
34
|
//#ifdef H5
|
|
164
|
-
|
|
165
|
-
if(item.app_type === 'wxmp') {
|
|
166
|
-
if(url.app_code) this.codeForGetAppId(url.app_code, 'h5', url.page,item['redirect_params']);
|
|
167
|
-
else console.error(`应用外部链接为设置Code: ${url.app_code}`)
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
35
|
+
return item['app_type'] !== 'wxmp';
|
|
170
36
|
//#endif
|
|
171
37
|
|
|
172
38
|
//#ifdef MP-WEIXIN
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return;
|
|
39
|
+
let actDir = this.$parent['projectAttr']['deploy_dir'];
|
|
40
|
+
let dir = this.getPosterPathDir(redirect_data.page);
|
|
41
|
+
if(item['app_type'] === 'wxmp'){
|
|
42
|
+
return actDir === dir;
|
|
178
43
|
}
|
|
44
|
+
else if(item['app_type'] === 'h5') return true;
|
|
45
|
+
else return true
|
|
179
46
|
//#endif
|
|
180
|
-
|
|
181
|
-
//属于站点应用内部链接:h5 to h5 或者 wxmp to wxmp
|
|
182
|
-
//属于站点应用外部链接:h5 to h5(外部链接)
|
|
183
|
-
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
184
|
-
debugger
|
|
185
|
-
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
186
47
|
}
|
|
187
|
-
|
|
188
|
-
|
|
48
|
+
catch (e) {
|
|
49
|
+
return true
|
|
189
50
|
}
|
|
190
|
-
} catch (e) {
|
|
191
|
-
console.error(e)
|
|
192
|
-
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
193
51
|
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (item.redirect_type === 'URL') {
|
|
198
|
-
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
199
|
-
let spReg = /(-apiuri\/v)/;
|
|
200
|
-
//#ifdef MP-WEIXIN
|
|
201
|
-
try {
|
|
202
|
-
let url = JSON.parse(item.redirect_data);
|
|
203
|
-
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
204
|
-
console.warn(`广告跳转外站: ${url.url}`)
|
|
205
|
-
this.$xdUniHelper.navigateTo(url);
|
|
206
|
-
} else {
|
|
207
|
-
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
208
|
-
}
|
|
209
|
-
} catch (e) {
|
|
210
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
211
|
-
}
|
|
212
|
-
//#endif
|
|
213
|
-
//#ifdef H5
|
|
214
|
-
try {
|
|
215
|
-
let url = JSON.parse(item.redirect_data);
|
|
216
|
-
console.warn(`广告跳转外站: ${url.url}`);
|
|
217
|
-
this.$xdUniHelper.redirectTo(url, false)
|
|
218
|
-
} catch (e) {
|
|
219
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
220
|
-
}
|
|
221
|
-
//#endif
|
|
222
|
-
|
|
223
|
-
}
|
|
52
|
+
});
|
|
53
|
+
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
54
|
+
return content;
|
|
224
55
|
|
|
225
|
-
|
|
226
|
-
if(item.redirect_type === 'WMP') {
|
|
227
|
-
this.toOtherWxMp(item);
|
|
228
|
-
}
|
|
56
|
+
},
|
|
229
57
|
|
|
230
|
-
|
|
231
|
-
if(
|
|
232
|
-
|
|
58
|
+
getPosterPathDir(pathDir){
|
|
59
|
+
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
60
|
+
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
233
61
|
}
|
|
234
|
-
|
|
235
|
-
|
|
62
|
+
return ''
|
|
63
|
+
},
|
|
236
64
|
},
|
|
237
65
|
}
|
|
238
66
|
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
3
|
+
import getServiceUrl from "@/common/getServiceUrl"
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
data(){
|
|
7
|
+
return {
|
|
8
|
+
|
|
9
|
+
//品牌样式
|
|
10
|
+
brandColor:'#999',
|
|
11
|
+
brandBgColor:'',
|
|
12
|
+
brandBorColor:'',
|
|
13
|
+
|
|
14
|
+
//广告
|
|
15
|
+
poster:{}, //广告位置信息
|
|
16
|
+
posterList:null,
|
|
17
|
+
posterNum:1, //使用张数
|
|
18
|
+
mode:'round',//直接写死
|
|
19
|
+
carouselTime: 0,//轮播图轮播周期
|
|
20
|
+
posterKey:'posterKey',
|
|
21
|
+
posterIndex:'',
|
|
22
|
+
isPoster:'N',
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
computed:{
|
|
28
|
+
isOpenPoster(){
|
|
29
|
+
//三列与一列垂直不显示广告
|
|
30
|
+
return !(this.column_num === 3 || this.columnOneLayout === 'V');
|
|
31
|
+
},
|
|
32
|
+
//广告位置样式设置
|
|
33
|
+
posterSizeComp(){
|
|
34
|
+
return {
|
|
35
|
+
width: this.posterSize.width + 'rpx',
|
|
36
|
+
height: this.posterSize.height + 'rpx',
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
//广告位置尺寸设置
|
|
41
|
+
posterSize(){
|
|
42
|
+
let pw = 0 , ph= 0;
|
|
43
|
+
if(this.column_num ===1) {
|
|
44
|
+
if(this.columnOneLayout === 'H') ph = 300
|
|
45
|
+
else ph = 900
|
|
46
|
+
}
|
|
47
|
+
if(this.column_num === 2) ph = 540
|
|
48
|
+
if(this.column_num === 3) ph = 200;
|
|
49
|
+
|
|
50
|
+
if(this.poster && this.poster.size) {
|
|
51
|
+
let {width, height} = this.poster.size;
|
|
52
|
+
if(width !== undefined) pw = Number(width);
|
|
53
|
+
if(height !== undefined) ph = Number(height);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let itemWidth = parseInt(this.posterProductStyles.width);
|
|
57
|
+
let itemHeight = ph * itemWidth / pw;
|
|
58
|
+
return {
|
|
59
|
+
width: itemWidth,
|
|
60
|
+
height: itemHeight,
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
//骨架宽度设置
|
|
65
|
+
skeletonImageHeight(){
|
|
66
|
+
return parseInt(this.skeletonStyle.width);
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
//骨架样式设置
|
|
70
|
+
skeletonStyle(){
|
|
71
|
+
return this.getContentStyle('ske')
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
//商品宽度设置
|
|
75
|
+
contProductImageHeight(){
|
|
76
|
+
return parseInt(this.contProductStyles.width);
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
//商品样式设置
|
|
80
|
+
contProductStyles(){
|
|
81
|
+
// let boxShadow = this.getShadowCompatibleOldStyle(this.contShadow,{
|
|
82
|
+
// type: this.is_shadow,
|
|
83
|
+
// width: this.is_shadow_w,
|
|
84
|
+
// color: this.is_shadow_bg
|
|
85
|
+
// }, ['none',this.gStyleValue.shadow]);
|
|
86
|
+
// debugger
|
|
87
|
+
return {
|
|
88
|
+
...this.getContentStyle(),
|
|
89
|
+
boxShadow: this.contShadow,
|
|
90
|
+
border: this.contBorder,
|
|
91
|
+
backgroundColor: this.itemBgcColor,
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
//商品样式设置
|
|
97
|
+
posterProductStyles(){
|
|
98
|
+
// let boxShadow = this.getShadowCompatibleOldStyle(this.contShadow,{
|
|
99
|
+
// type: this.is_shadow,
|
|
100
|
+
// width: this.is_shadow_w,
|
|
101
|
+
// color: this.is_shadow_bg
|
|
102
|
+
// }, ['none',this.gStyleValue.shadow]);
|
|
103
|
+
return {
|
|
104
|
+
...this.getContentStyle('poster'),
|
|
105
|
+
boxShadow: this.contShadow,
|
|
106
|
+
border: this.contBorder,
|
|
107
|
+
backgroundColor: this.itemBgcColor,
|
|
108
|
+
overflow:'hidden'
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
//品牌样式
|
|
113
|
+
brandStyleComp(){
|
|
114
|
+
return {
|
|
115
|
+
color: this.brandColor,
|
|
116
|
+
bgColor: this.brandBgColor,
|
|
117
|
+
borderColor: this.brandBorColor,
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
watch:{
|
|
123
|
+
isPoster(n, o){
|
|
124
|
+
if(this.$configProject.isPreview) {
|
|
125
|
+
if(this.isOnloaded === false) return;
|
|
126
|
+
this.prodList = null;
|
|
127
|
+
this.page_token = '1';
|
|
128
|
+
this.getList();
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
posterIndex(){
|
|
132
|
+
if(this.$configProject.isPreview) {
|
|
133
|
+
if(this.isOnloaded === false) return;
|
|
134
|
+
this.prodList = null;
|
|
135
|
+
this.page_token = '1';
|
|
136
|
+
this.getList();
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
carouselTime(){
|
|
140
|
+
if(this.isPreview) {
|
|
141
|
+
this.posterKey = Date.now()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
},
|
|
145
|
+
mode(){
|
|
146
|
+
if(this.isPreview) {
|
|
147
|
+
this.posterKey = Date.now()
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
posterNum(){
|
|
151
|
+
this.onJfbUpdate()
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
methods:{
|
|
155
|
+
//重新加载广告位置
|
|
156
|
+
reHandlePoster(){
|
|
157
|
+
if(this.$configProject.isPreview) {
|
|
158
|
+
if(this.isOnloaded === false) return;
|
|
159
|
+
if(this.isOpenPoster){
|
|
160
|
+
uni.showModal({
|
|
161
|
+
title: '温馨提示',
|
|
162
|
+
content: '已设置显示广告内容并切换商品显示列数时,别忘记切换对应的广告位置哦!',
|
|
163
|
+
showCancel:false,
|
|
164
|
+
confirmText:'我知道了',
|
|
165
|
+
success: function (res) {
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
this.prodList = null;
|
|
171
|
+
this.page_token = '1';
|
|
172
|
+
this.posterList = null;
|
|
173
|
+
this.getList();
|
|
174
|
+
this.getPosterList()
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
//获取广告位置设置
|
|
179
|
+
getPosterList(){
|
|
180
|
+
jfbRootExec('getMallHomeProductPoster', {
|
|
181
|
+
vm: this,
|
|
182
|
+
data: {
|
|
183
|
+
page_id: this.pageAttr['page_id'], //页面ID
|
|
184
|
+
container_id: this.containerId, //组件ID
|
|
185
|
+
page_size: this.posterNum //可以不传
|
|
186
|
+
},
|
|
187
|
+
})
|
|
188
|
+
.then(res => {
|
|
189
|
+
let posterList = res.list.map((item,index) => {
|
|
190
|
+
return {
|
|
191
|
+
...item,
|
|
192
|
+
image_background_url: item.image_background_url?getServiceUrl(item.image_background_url):'',
|
|
193
|
+
image_url: item.image_url?getServiceUrl(item.image_url):''
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
this.posterList = this.posterFilterNoUseData(posterList);
|
|
197
|
+
})
|
|
198
|
+
.catch(err=>{
|
|
199
|
+
console.error(err);
|
|
200
|
+
})
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @description 获取内容区域样式
|
|
205
|
+
* @param type {string} ske=>骨架样式 cont=>内容框样式 poster => 广告位置样式
|
|
206
|
+
* @return {Object}
|
|
207
|
+
*/
|
|
208
|
+
getContentStyle(type='cont'){
|
|
209
|
+
//总宽度
|
|
210
|
+
let outWidth = uni.getSystemInfoSync().safeArea.width * this.$pxNum;
|
|
211
|
+
|
|
212
|
+
//外边距
|
|
213
|
+
let outMarginRL = this.getPMValue(this.bodyPadding, 'RL',0)
|
|
214
|
+
|
|
215
|
+
//列表填充
|
|
216
|
+
let outPaddingRL = this.getPMValue(this.listPadding,'RL', 20);
|
|
217
|
+
|
|
218
|
+
//间距设置
|
|
219
|
+
if(this.$xdUniHelper.checkVarType(this.columnSpacing) === 'string') this.columnSpacing = Number(this.columnSpacing);
|
|
220
|
+
let columnSpacing = this.columnSpacing * (this.column_num-1); //公式:列数量 * 边距 + 边距
|
|
221
|
+
|
|
222
|
+
//item内容填充
|
|
223
|
+
let paddingRL = this.getPMValue(this.itemPadding,'RL', 20)* this.column_num;
|
|
224
|
+
if(type === 'poster') paddingRL = 0; //广告模式
|
|
225
|
+
|
|
226
|
+
//预览模式有两个像素边距
|
|
227
|
+
let isPreview = 0;
|
|
228
|
+
|
|
229
|
+
//边框
|
|
230
|
+
let borderRL = this.contStyleBorder * 2;
|
|
231
|
+
|
|
232
|
+
if(type === 'ske') borderRL = 0;
|
|
233
|
+
borderRL = borderRL * this.column_num;
|
|
234
|
+
|
|
235
|
+
//商品内边距设置
|
|
236
|
+
let str = this.getMarginAndPadding(this.itemPadding,20);
|
|
237
|
+
if(type === 'poster') str = 0;//广告模式
|
|
238
|
+
|
|
239
|
+
let otherWidth = (outMarginRL + outPaddingRL + columnSpacing + isPreview + borderRL + paddingRL);
|
|
240
|
+
|
|
241
|
+
return {
|
|
242
|
+
marginBottom: this.rowSpacing + 'rpx',
|
|
243
|
+
width: (outWidth - otherWidth)/this.column_num + 'rpx',
|
|
244
|
+
borderRadius: this.radius + 'rpx',
|
|
245
|
+
boxShadow: '0 0 10rpx rgba(0,0,0,.08)',
|
|
246
|
+
padding: str,
|
|
247
|
+
backgroundColor: 'rgba(255,255,255,.8)'
|
|
248
|
+
};
|
|
249
|
+
},
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
}
|