jufubao-base 1.0.169-beta4 → 1.0.169-beta5

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,201 @@
1
+ 'use strict';
2
+ export default (data)=>{
3
+ return [
4
+ {
5
+ ele: 'title',
6
+ label: '商品搜索相关设置',
7
+ size: 'small',
8
+ groupKey:'content',
9
+ },
10
+ {
11
+ label: '是否展示品牌:',
12
+ ele: 'xd-radio',
13
+ valueKey: 'is_show_brand',
14
+ value: data['is_show_brand'] || 'N',
15
+ placeholder: '请选择是否展示品牌',
16
+ multiple: false,
17
+ className: 'input80',
18
+ groupKey:'content',
19
+ list: [
20
+ {label: '是', value: 'Y'},
21
+ {label: '否', value: 'N'},
22
+ ]
23
+ },
24
+ {
25
+ label: "可否直接加入购物车",
26
+ ele: "xd-radio",
27
+ valueKey: "isAddCart",
28
+ groupKey:'content',
29
+ value: data['isAddCart'] || 'Y',
30
+ list: [
31
+ {label: "是", value: 'Y'},
32
+ {label: "否", value: 'N'}
33
+ ]
34
+ },
35
+ {
36
+ label: '是否显示价格:',
37
+ ele: 'xd-radio',
38
+ groupKey:'content',
39
+ valueKey: 'isPrice',
40
+ value: data['isPrice'] || 'Y',
41
+ placeholder: '请选择是否显示价格',
42
+ multiple: false,
43
+ className: 'input80',
44
+ list: [
45
+ {label: '是', value: 'Y'},
46
+ {label: '否', value: 'N'},
47
+ ]
48
+ },
49
+ data['isPrice']==='Y'&&{
50
+ label: '是否展示原价:',
51
+ ele: 'xd-radio',
52
+ groupKey:'content',
53
+ valueKey: 'isShowDiscount',
54
+ value: data['isShowDiscount'] || "Y",
55
+ rules: [
56
+ {required: true, message: '请选择', trigger: ['blur', 'change']}
57
+ ],
58
+ list: [
59
+ {"label": "显示", "value": "Y"},
60
+ {"label": "隐藏", "value": "N"},
61
+ ]
62
+ },
63
+ data['isShowDiscount']==='Y'&&{
64
+ label: '市场价减去售价大于多少展示:',
65
+ ele: 'el-input',
66
+ type: 'number',
67
+ valueKey: 'differ',
68
+ value: data['differ'] || '',
69
+ groupKey:'content',
70
+ placeholder: '价差',
71
+ className: 'input80',
72
+ },
73
+ data['isPrice']==='Y'&&{
74
+ label: '是否标明活动价:',
75
+ ele: 'xd-radio',
76
+ valueKey: 'showActivityPrice',
77
+ value: data['showActivityPrice'] || 'N',
78
+ placeholder: '请选择是否标明活动价',
79
+ groupKey:'content',
80
+ multiple: false,
81
+ className: 'input80',
82
+ list: [
83
+ {label: '是', value: 'Y'},
84
+ {label: '否', value: 'N'},
85
+ ]
86
+ },
87
+ {
88
+ label: '是否显示标签:',
89
+ ele: 'xd-radio',
90
+ valueKey: "isShowTag",
91
+ value: data['isShowTag'] || 'N',
92
+ groupKey:'content',
93
+ list: [
94
+ {label: '是', value: 'Y'},
95
+ {label: '否', value: 'N'},
96
+ ]
97
+ },
98
+
99
+ {
100
+ ele: 'title',
101
+ label: '列表样式设置',
102
+ size: 'small',
103
+ groupKey:'style',
104
+ },
105
+ {
106
+ label: '填充设置:',
107
+ ele: 'xd-margin-padding',
108
+ groupKey:'style',
109
+ valueKey: 'contMargin',
110
+ value: data['contMargin'] || null,
111
+ setting: {
112
+ type: 'margin',
113
+ },
114
+ inline: false,
115
+ notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
116
+ },
117
+ {
118
+ label: '背景颜色:',
119
+ ele: 'xd-color',
120
+ valueKey: 'contBgColor',
121
+ value: data['contBgColor'] || '',
122
+ placeholder: '请选择背景颜色',
123
+ classNmae: 'input80',
124
+ groupKey:'style',
125
+ },
126
+ {
127
+ label: '当前投影设置:',
128
+ ele: 'xd-shadow',
129
+ groupKey:'style',
130
+ valueKey: 'contShadow',
131
+ value: data['contShadow'] || '',
132
+ setting: {
133
+ selected: 'N',
134
+ },
135
+ handleCustom({action, data}) {
136
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
137
+ .then(res => {
138
+ data.cb(res.list)
139
+ })
140
+ .catch(error => {
141
+ console.error(error);
142
+ data.cb([])
143
+ });
144
+ },
145
+ },
146
+ {
147
+ label: '当前边框设置:',
148
+ ele: 'xd-border',
149
+ groupKey:'style',
150
+ valueKey: 'contBorder',
151
+ value: data['contBorder'] || '',
152
+ setting: {
153
+ selected:'N'
154
+ },
155
+ },
156
+ {
157
+ label: '圆角设置:',
158
+ ele: 'xd-site-select-list',
159
+ valueKey: 'contRradius',
160
+ value: data['contRradius'] || '10',
161
+ groupKey:'style',
162
+ placeholder: '请选择内容圆角设置',
163
+ multiple: false,
164
+ className: 'input80',
165
+ handleCustom({action, data}) {
166
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
167
+ .then(res => {
168
+ data.cb(res.list)
169
+ })
170
+ .catch(error => {
171
+ console.error(error);
172
+ });
173
+ },
174
+ },
175
+ {
176
+ ele: 'title',
177
+ label: '图片样式设置',
178
+ size: 'small',
179
+ groupKey:'style',
180
+ },
181
+ {
182
+ label: '圆角设置:',
183
+ ele: 'xd-site-select-list',
184
+ valueKey: 'imgRradius',
185
+ value: data['imgRradius'] || '10',
186
+ groupKey:'style',
187
+ placeholder: '请选择内容圆角设置',
188
+ multiple: false,
189
+ className: 'input80',
190
+ handleCustom({action, data}) {
191
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
192
+ .then(res => {
193
+ data.cb(res.list)
194
+ })
195
+ .catch(error => {
196
+ console.error(error);
197
+ });
198
+ },
199
+ },
200
+ ]
201
+ }
@@ -0,0 +1,229 @@
1
+ <template>
2
+ <view class="custom-list">
3
+ <view v-if="dataList === null">
4
+ <view :class="{productBoxCell2: type_other === 2 }">
5
+ <view
6
+ v-for="item in skeletonCount"
7
+ class="skeleton-wrap"
8
+ :class="{productItemCell2: type_other === 2 }"
9
+ :key="item"
10
+ :style="{
11
+ marginBottom:$parentVm.outSpacing + 'rpx',
12
+ padding:contMarginComp,
13
+ borderRadius:$parentVm.contRradius+ 'rpx',
14
+ border:$parentVm.contBorder,
15
+ boxShadow:$parentVm.contShadow,
16
+ backgroundColor:$parentVm.contBgColor,
17
+ width: (type_code === 'product' && type_other === 2) ? (outItemProduct + 'rpx'): 'auto',
18
+ }"
19
+ >
20
+ <skeleton-product
21
+ :cell="type_other"
22
+ v-if="type_code === 'product'"
23
+ :product-config="productConfig"
24
+ ></skeleton-product>
25
+ <skeleton-shop v-if="type_code === 'show'" :out-spacing="$parentVm.outSpacing"></skeleton-shop>
26
+ <skeleton-film v-if="type_code === 'film'" :out-spacing="$parentVm.outSpacing"></skeleton-film>
27
+ <skeleton-cinema v-if="type_code === 'cinema'"></skeleton-cinema>
28
+ </view>
29
+ </view>
30
+ </view>
31
+ <view class="custom-list-data" v-else></view>
32
+ </view>
33
+ </template>
34
+
35
+ <script>
36
+ import {mapState} from "vuex";
37
+ import SkeletonFilm from "./SkeletonFilm.vue";
38
+ import SkeletonCinema from "./SkeletonCinema.vue";
39
+ import SkeletonShop from "./SkeletonShop.vue";
40
+ import SkeletonProduct from "./SkeletonProduct.vue";
41
+
42
+ export default {
43
+ name: "CustomList",
44
+ components: {
45
+ SkeletonProduct,
46
+ SkeletonCinema,
47
+ SkeletonFilm,
48
+ SkeletonShop
49
+ },
50
+ props:{
51
+ keyword:{
52
+ type:String,
53
+ default:'',
54
+ },
55
+ tabId:{
56
+ type:String,
57
+ required:true
58
+ }
59
+ },
60
+
61
+ computed:{
62
+ ...mapState({
63
+ stateCity: state => state.cityLocation.city,
64
+ stateLocation: (state) => state.cityLocation.location || {},
65
+ }),
66
+ getParams(){
67
+ let params = {
68
+ search_range: this.search_range,
69
+ page_token: this.page_token,
70
+ page_size: this.page_size,
71
+ };
72
+
73
+ //关键字
74
+ if(this.keyword) params['keyword'] = this.keyword;
75
+
76
+ //设置城市
77
+ if(this.is_open_city ==='Y' && this.stateCity && this.stateCity.city_code) {
78
+ params['city_code'] = this.stateCity.city_code;
79
+ }
80
+
81
+ //设置经纬度
82
+ if(this.type_code === 'shop' || this.type_code === 'cinema') {
83
+ if(this.stateLocation &&
84
+ (this.stateLocation.latitude && this.stateLocation.longitude)
85
+ ){
86
+ params['latitude'] = this.stateLocation.latitude;
87
+ params['longitude'] = this.stateLocation.longitude;
88
+ }
89
+ }
90
+
91
+ return params
92
+ },
93
+ contMarginComp(){
94
+ let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
95
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
96
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
97
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20)}rpx`;
98
+ return str
99
+ },
100
+ outItemProduct(){
101
+ //获取每列元素最大宽度
102
+ let num = (750 - 3 * Number(this.$parentVm.outSpacing))/2;
103
+ num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
104
+ return num - this.$parentVm.contBorderWidth * 2
105
+ },
106
+ productConfig(){
107
+ if(this.$parentVm === null) {
108
+ return null
109
+ }
110
+ return {
111
+ is_show_brand: this.$parentVm.is_show_brand,
112
+
113
+ }
114
+ }
115
+ },
116
+ data(){
117
+ return {
118
+ $parentVm:null,
119
+ parentStatus: false,
120
+ skeletonCount: 10,
121
+
122
+ page_token:'1',
123
+ page_size: 20,
124
+
125
+ //参数
126
+ type_code:'',
127
+ search_range:'',
128
+ type_other:null,
129
+ is_open_city:'N',
130
+
131
+
132
+ //列表数据
133
+ dataList: null,
134
+ timer:null,
135
+ config: {},
136
+ }
137
+ },
138
+
139
+ watch:{
140
+ keyword(){
141
+ if(this.timer) {
142
+ clearTimeout(this.timer);
143
+ this.timer = null;
144
+ }
145
+ this.timer = setTimeout(()=>{
146
+ this.onCusReloadList();
147
+ },500)
148
+ },
149
+ tabId(){
150
+ this.parseTab()
151
+ this.onCusReloadList();
152
+ },
153
+
154
+ stateCity(n, o){
155
+ if(n && JSON.stringify(n) !== JSON.stringify(o)){
156
+ this.onCusReloadList()
157
+ }
158
+ },
159
+ },
160
+
161
+ created() {
162
+ this.getParentMV();
163
+ this.parseTab();
164
+ this.onCusReloadList();
165
+ },
166
+
167
+ methods:{
168
+ parseTab(){
169
+ let tabs = this.tabId.split('@');
170
+ this.type_code = tabs[1];
171
+ this.search_range = tabs[0]
172
+ this.is_open_city = tabs[2];
173
+ if(this.type_code === 'product'){
174
+ this.type_other = Number(tabs[3]);
175
+ if(this.type_other === 2) this.skeletonCount = 20
176
+ }
177
+ else this.type_other = null
178
+ },
179
+
180
+ handleClear(){
181
+ this.page_token = '1';
182
+ this.dataList = null;
183
+ },
184
+
185
+ getParentMV(){
186
+ this.$emit('on-parent-vm', ($vm)=>{
187
+ this.$parentVm = $vm;
188
+ this.parentStatus = true;
189
+ })
190
+ },
191
+
192
+ onCusReachBottom(){
193
+ if(!this.page_token) return false;
194
+ this.getList();
195
+ },
196
+
197
+ //重新加载数据
198
+ onCusReloadList(params ={}){
199
+ this.handleClear();
200
+ this.getList();
201
+ },
202
+
203
+
204
+ getList(){
205
+ this.$xdShowLoading({});
206
+ this.$emit('on-list', {
207
+ params:this.getParams,
208
+ cb:(res)=>{
209
+ this.$xdHideLoading();
210
+ }
211
+ })
212
+ }
213
+ }
214
+ }
215
+ </script>
216
+
217
+
218
+
219
+ <style scoped lang="less">
220
+ .productBoxCell2 {
221
+ display: flex;
222
+ justify-content: space-between;
223
+ align-items: center;
224
+ flex-flow: wrap;
225
+ }
226
+ .productItemCell2 {
227
+
228
+ }
229
+ </style>
@@ -14,7 +14,17 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-tfk-search__body">
17
- <view>测试插件( {{containerId}} )</view>
17
+ <view class="x-line"></view>
18
+ <view class="tfk-search" :style="{padding: outSpacing + 'rpx'}">
19
+ <view>测试插件( {{containerId}} )</view>
20
+ <custom-list
21
+ :tab-id="tabId"
22
+ :keyword="keyword"
23
+ ref="customList"
24
+ @on-parent-vm="handleParentVm"
25
+ @on-list="handleList"
26
+ ></custom-list>
27
+ </view>
18
28
  </view>
19
29
  </view>
20
30
  </template>
@@ -26,34 +36,60 @@
26
36
  import { getContainerPropsValue } from "@/utils/xd.base";
27
37
  import componentsMixins from "@/mixins/componentsMixins";
28
38
  import extsMixins from "@/mixins/extsMixins";
39
+ import listMixins from "./listMixins";
40
+ import CustomList from "./CustomList.vue";
41
+ import search from './search';
42
+
29
43
  export default {
30
44
  name: "JfbBaseTfkSearch",
31
45
  components: {
46
+ CustomList,
32
47
  XdFontIcon
33
48
  },
34
49
  mixins: [
35
- componentsMixins, extsMixins, JfbBaseTfkSearchMixin
50
+ componentsMixins, extsMixins, JfbBaseTfkSearchMixin,listMixins
36
51
  ],
37
52
  data() {
38
53
  return {
54
+ hideMask: true,
55
+ tabId: '1@product@Y@1',
56
+ keyword: '',
57
+ options:{},
58
+
39
59
 
40
- //todo
60
+ //公共样式
61
+ outSpacing:20,
41
62
  }
42
63
  },
43
64
  watch: {
44
65
  container(value, oldValue) {
45
66
  if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
46
- if (this.$configProject['isPreview']) this.init(value)
67
+ if (this.$configProject['isPreview']){
68
+ this.cusInit(value)
69
+ this.init(value);
70
+ }
47
71
  },
48
72
  },
49
73
  created() {
74
+ this.cusInit(this.container);
50
75
  this.init(this.container);
51
-
52
- //todo
53
76
  },
77
+
54
78
  methods: {
55
- onJfbLoad(options) {
79
+ /**
80
+ * @description 获取数据列表
81
+ * @param params
82
+ * @param cb {Function}
83
+ */
84
+ handleList({params, cb}){
85
+ let time = this.$xdUniHelper.random(8,20) * 100;
86
+ setTimeout(()=>{
87
+ cb(search)
88
+ }, time)
89
+ },
56
90
 
91
+ onJfbLoad(options) {
92
+ this.options = options;
57
93
  // jfbRootExec('baiduUserLogin', {
58
94
 
59
95
  // vm: this,// data: {
@@ -69,17 +105,13 @@
69
105
  * @param container {object} 业务组件对象自己
70
106
  */
71
107
  init(container) {
72
-
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
74
-
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
108
+ this.outSpacing = getContainerPropsValue(container, 'content.outSpacing', '20');
76
109
  },
110
+
77
111
  onJfbScroll(options) {
78
112
  console.log('event.onJfbScroll', options)
79
113
  },
80
- onJfbReachBottom(options) {
81
- console.log('event.onJfbReachBottom', options)
82
- },
114
+
83
115
  onJfbShow(options) {
84
116
  console.log('event.onJfbShow', options)
85
117
  },
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <view class="skeleton-wrap-item">
3
+ <view class="title skeleton-item"></view>
4
+ <view class="address skeleton-item"></view>
5
+ <view class="bottom">
6
+ <view class="local skeleton-item"></view>
7
+ <view class="btn skeleton-item"></view>
8
+ </view>
9
+ </view>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: "SkeletonCinema"
15
+ }
16
+ </script>
17
+
18
+ <style scoped lang="less">
19
+ .skeleton-wrap-item {
20
+ height: 220rpx;
21
+ display: block;
22
+
23
+ & > .title {
24
+ .skeleton-item(100%, 60rpx);
25
+ margin-bottom: 20rpx;
26
+ }
27
+ & > .address {
28
+ .skeleton-item(100%, 40rpx);
29
+ margin-bottom: 20rpx;
30
+ }
31
+ & > .bottom {
32
+ display: flex;
33
+ justify-content: space-between;
34
+ align-items: center;
35
+ padding-top: 30rpx;
36
+
37
+ & > .local {
38
+ .skeleton-item(120rpx, 30rpx);
39
+ }
40
+ & > .btn {
41
+ .skeleton-item(150rpx, 60rpx);
42
+ }
43
+ }
44
+ }
45
+ </style>
46
+
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <view class="skeleton-wrap-item">
3
+ <view class="skeleton-wrap-item-image skeleton-item" :style="{marginRight:outSpacing + 'rpx'}"></view>
4
+ <view class="skeleton-wrap-item-title">
5
+ <view class="title skeleton-item"></view>
6
+ <view class="type skeleton-item"></view>
7
+ <view class="director skeleton-item"></view>
8
+ <view class="star skeleton-item"></view>
9
+ </view>
10
+ <view class="skeleton-wrap-item-btn skeleton-item" :style="{marginLeft:outSpacing + 'rpx'}">
11
+ <view class="score skeleton-item"></view>
12
+ <view class="btn skeleton-item"></view>
13
+ </view>
14
+ </view>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: "SkeletonFilm",
20
+ props:{
21
+ outSpacing:{
22
+ type: Number|String,
23
+ default:20
24
+ }
25
+ }
26
+ }
27
+ </script>
28
+
29
+
30
+
31
+ <style scoped lang="less">
32
+ .skeleton-wrap-item {
33
+ height: 240rpx;
34
+ display: flex;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+
38
+ //影片列表骨架
39
+ &-image {
40
+ .skeleton-item(160rpx, 240rpx);
41
+ flex-shrink: 0;
42
+ margin-right: 20rpx;
43
+ }
44
+
45
+ &-title {
46
+ flex: 1;
47
+
48
+ .title {
49
+ .skeleton-item(100%, 50rpx);
50
+ margin-bottom: 20rpx;
51
+ }
52
+
53
+ .director,.star,.type {
54
+ .skeleton-item(100%, 40rpx);
55
+ margin-bottom: 10rpx;
56
+ }
57
+ }
58
+
59
+ &-btn {
60
+ display: flex;
61
+ align-content: space-between;
62
+ align-items: flex-end;
63
+ justify-content: flex-end;
64
+ flex-flow: wrap;
65
+ height: 100%;
66
+ box-sizing: border-box;
67
+ padding: 10rpx 0;
68
+ width: 130rpx;
69
+ flex-shrink: 0;
70
+
71
+ & > .score {
72
+ .skeleton-item(100rpx, 40rpx);
73
+ }
74
+ & > .btn {
75
+ .skeleton-item(130rpx, 60rpx);
76
+ }
77
+ }
78
+
79
+ &:last-child {
80
+ margin-bottom: 0!important;
81
+ }
82
+
83
+ //影院列表骨架
84
+ &.list {
85
+ display: block;
86
+ }
87
+ & > .title {
88
+ .skeleton-item(100%, 60rpx);
89
+ margin-bottom: 20rpx;
90
+ }
91
+ & > .address {
92
+ .skeleton-item(100%, 40rpx);
93
+ margin-bottom: 20rpx;
94
+ }
95
+ & > .bottom {
96
+ display: flex;
97
+ justify-content: space-between;
98
+ align-items: center;
99
+ padding-top: 30rpx;
100
+
101
+ & > .local {
102
+ .skeleton-item(120rpx, 30rpx);
103
+ }
104
+ & > .btn {
105
+ .skeleton-item(150rpx, 70rpx);
106
+ }
107
+ }
108
+ }
109
+ </style>