jufubao-base 1.0.169-beta4 → 1.0.169-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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
  3. package/src/components/JfbBaseOrderDetail/Api.js +12 -7
  4. package/src/components/JfbBaseOrderDetail/Attr.js +28 -14
  5. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +66 -18
  6. package/src/components/JfbBaseOrderDetail/Mock.js +3 -1
  7. package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
  8. package/src/components/JfbBaseTfkCardBind/Attr.js +25 -1
  9. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +139 -7
  10. package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
  11. package/src/components/JfbBaseTfkCardDetail/Api.js +11 -0
  12. package/src/components/JfbBaseTfkCardDetail/Attr.js +74 -0
  13. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +133 -8
  14. package/src/components/JfbBaseTfkCardLogin/Attr.js +160 -0
  15. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +215 -27
  16. package/src/components/JfbBaseTfkCardLogin/Mock.js +1 -1
  17. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +68 -16
  18. package/src/components/JfbBaseTfkSearch/Attr.js +24 -37
  19. package/src/components/JfbBaseTfkSearch/ContentCinema.vue +147 -0
  20. package/src/components/JfbBaseTfkSearch/ContentItem.vue +165 -0
  21. package/src/components/JfbBaseTfkSearch/CusAttr.js +201 -0
  22. package/src/components/JfbBaseTfkSearch/CustomList.vue +221 -0
  23. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +46 -14
  24. package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +46 -0
  25. package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +109 -0
  26. package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +166 -0
  27. package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +81 -0
  28. package/src/components/JfbBaseTfkSearch/listMixins.js +76 -0
  29. package/src/components/JfbBaseTfkSearch/search.js +175 -0
@@ -0,0 +1,221 @@
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="$parentVm.productConfig !== null && type_code === 'product'"
23
+ :product-config="$parentVm.productConfig"
24
+ :out-spacing="$parentVm.outSpacing"
25
+ ></skeleton-product>
26
+ <skeleton-shop v-if="type_code === 'show'" :out-spacing="$parentVm.outSpacing"></skeleton-shop>
27
+ <skeleton-film v-if="type_code === 'film'" :out-spacing="$parentVm.outSpacing"></skeleton-film>
28
+ <skeleton-cinema v-if="type_code === 'cinema'"></skeleton-cinema>
29
+ </view>
30
+ </view>
31
+ </view>
32
+ <view class="custom-list-data" v-else></view>
33
+ </view>
34
+ </template>
35
+
36
+ <script>
37
+ import {mapState} from "vuex";
38
+ import SkeletonFilm from "./SkeletonFilm.vue";
39
+ import SkeletonCinema from "./SkeletonCinema.vue";
40
+ import SkeletonShop from "./SkeletonShop.vue";
41
+ import SkeletonProduct from "./SkeletonProduct.vue";
42
+
43
+ export default {
44
+ name: "CustomList",
45
+ components: {
46
+ SkeletonProduct,
47
+ SkeletonCinema,
48
+ SkeletonFilm,
49
+ SkeletonShop
50
+ },
51
+ props:{
52
+ keyword:{
53
+ type:String,
54
+ default:'',
55
+ },
56
+ tabId:{
57
+ type:String,
58
+ required:true
59
+ }
60
+ },
61
+
62
+ computed:{
63
+ ...mapState({
64
+ stateCity: state => state.cityLocation.city,
65
+ stateLocation: (state) => state.cityLocation.location || {},
66
+ }),
67
+ getParams(){
68
+ let params = {
69
+ search_range: this.search_range,
70
+ page_token: this.page_token,
71
+ page_size: this.page_size,
72
+ };
73
+
74
+ //关键字
75
+ if(this.keyword) params['keyword'] = this.keyword;
76
+
77
+ //设置城市
78
+ if(this.is_open_city ==='Y' && this.stateCity && this.stateCity.city_code) {
79
+ params['city_code'] = this.stateCity.city_code;
80
+ }
81
+
82
+ //设置经纬度
83
+ if(this.type_code === 'shop' || this.type_code === 'cinema') {
84
+ if(this.stateLocation &&
85
+ (this.stateLocation.latitude && this.stateLocation.longitude)
86
+ ){
87
+ params['latitude'] = this.stateLocation.latitude;
88
+ params['longitude'] = this.stateLocation.longitude;
89
+ }
90
+ }
91
+
92
+ return params
93
+ },
94
+ contMarginComp(){
95
+ let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
96
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
97
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
98
+ str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20)}rpx`;
99
+ return str
100
+ },
101
+ outItemProduct(){
102
+ //获取每列元素最大宽度
103
+ let num = (750 - 3 * Number(this.$parentVm.outSpacing))/2;
104
+ num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
105
+ return num - this.$parentVm.contBorderWidth * 2
106
+ },
107
+ },
108
+ data(){
109
+ return {
110
+ $parentVm:null,
111
+ parentStatus: false,
112
+ skeletonCount: 10,
113
+
114
+ page_token:'1',
115
+ page_size: 20,
116
+
117
+ //参数
118
+ type_code:'',
119
+ search_range:'',
120
+ type_other:null,
121
+ is_open_city:'N',
122
+
123
+
124
+ //列表数据
125
+ dataList: null,
126
+ timer:null,
127
+ config: {},
128
+ }
129
+ },
130
+
131
+ watch:{
132
+ keyword(){
133
+ if(this.timer) {
134
+ clearTimeout(this.timer);
135
+ this.timer = null;
136
+ }
137
+ this.timer = setTimeout(()=>{
138
+ this.onCusReloadList();
139
+ },500)
140
+ },
141
+ tabId(){
142
+ this.parseTab()
143
+ this.onCusReloadList();
144
+ },
145
+
146
+ stateCity(n, o){
147
+ if(n && JSON.stringify(n) !== JSON.stringify(o)){
148
+ this.onCusReloadList()
149
+ }
150
+ },
151
+ },
152
+
153
+ created() {
154
+ this.getParentMV();
155
+ this.parseTab();
156
+ this.onCusReloadList();
157
+ },
158
+
159
+ methods:{
160
+ parseTab(){
161
+ let tabs = this.tabId.split('@');
162
+ this.type_code = tabs[1];
163
+ this.search_range = tabs[0]
164
+ this.is_open_city = tabs[2];
165
+ if(this.type_code === 'product'){
166
+ this.type_other = Number(tabs[3]);
167
+ if(this.type_other === 2) this.skeletonCount = 20
168
+ }
169
+ else this.type_other = null
170
+ },
171
+
172
+ handleClear(){
173
+ this.page_token = '1';
174
+ this.dataList = null;
175
+ },
176
+
177
+ getParentMV(){
178
+ this.$emit('on-parent-vm', ($vm)=>{
179
+ this.$parentVm = $vm;
180
+ this.parentStatus = true;
181
+ })
182
+ },
183
+
184
+ onCusReachBottom(){
185
+ if(!this.page_token) return false;
186
+ this.getList();
187
+ },
188
+
189
+ //重新加载数据
190
+ onCusReloadList(params ={}){
191
+ this.handleClear();
192
+ this.getList();
193
+ },
194
+
195
+
196
+ getList(){
197
+ this.$xdShowLoading({});
198
+ this.$emit('on-list', {
199
+ params:this.getParams,
200
+ cb:(res)=>{
201
+ this.$xdHideLoading();
202
+ }
203
+ })
204
+ }
205
+ }
206
+ }
207
+ </script>
208
+
209
+
210
+
211
+ <style scoped lang="less">
212
+ .productBoxCell2 {
213
+ display: flex;
214
+ justify-content: space-between;
215
+ align-items: center;
216
+ flex-flow: wrap;
217
+ }
218
+ .productItemCell2 {
219
+
220
+ }
221
+ </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>
@@ -0,0 +1,166 @@
1
+ <template>
2
+ <view class="skeleton-wrap-item" :class="{display: cell===1}">
3
+ <template v-if="cell===1">
4
+ <view class="image skeleton-item" :style="{marginRight:outSpacing + 'rpx'}"></view>
5
+ <view class="content">
6
+ <view class="top">
7
+ <view class="title skeleton-item"></view>
8
+ <view class="brand skeleton-item"></view>
9
+ <view class="tags skeleton-item"></view>
10
+ </view>
11
+ <view class="bottom">
12
+ <view class="price skeleton-item"></view>
13
+ <view class="orgPrice skeleton-item"></view>
14
+ <view class="cart skeleton-item"></view>
15
+ </view>
16
+ </view>
17
+ </template>
18
+ <template v-if="cell===2">
19
+
20
+ </template>
21
+ </view>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ name: "SkeletonProduct",
27
+ props:{
28
+ outSpacing:{
29
+ type: Number|String,
30
+ default:20
31
+ },
32
+ cell:{
33
+ type: Number|String,
34
+ required: true
35
+ },
36
+ productConfig:{
37
+ type:Object|null,
38
+ default: null
39
+ },
40
+ }
41
+ }
42
+ </script>
43
+
44
+
45
+
46
+ <style scoped lang="less">
47
+ .skeleton-wrap-item {
48
+ min-height: 200rpx;
49
+
50
+ &.display {
51
+ display: flex;
52
+ justify-content: space-between;
53
+ align-items: center;
54
+ align-content: space-between;
55
+
56
+ & .image {
57
+ .skeleton-item(200rpx, 200rpx);
58
+ }
59
+
60
+ & .content {
61
+ flex: 1;
62
+ min-height: 200rpx;
63
+
64
+ .top {
65
+ height: 140rpx;
66
+
67
+ & .title {
68
+ .skeleton-item(100%, 60rpx);
69
+ }
70
+ }
71
+ .bottom {
72
+ display: flex;
73
+ justify-content: flex-start;
74
+ align-content: center;
75
+ align-items: center;
76
+ width: 100%;
77
+ height: 60rpx;
78
+
79
+ & .price {
80
+ flex-shrink: 0;
81
+ .skeleton-item(100rpx, 35rpx);
82
+ }
83
+
84
+ & .orgPrice {
85
+ flex-shrink: 0;
86
+ margin-left: 20rpx;
87
+ .skeleton-item(130rpx, 20rpx);
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+
94
+
95
+ //影片列表骨架
96
+ &-image {
97
+ .skeleton-item(160rpx, 240rpx);
98
+ flex-shrink: 0;
99
+ margin-right: 20rpx;
100
+ }
101
+
102
+ &-title {
103
+ flex: 1;
104
+
105
+ .title {
106
+ .skeleton-item(100%, 50rpx);
107
+ margin-bottom: 20rpx;
108
+ }
109
+
110
+ .director,.star,.type {
111
+ .skeleton-item(100%, 40rpx);
112
+ margin-bottom: 10rpx;
113
+ }
114
+ }
115
+
116
+ &-btn {
117
+ display: flex;
118
+ align-content: space-between;
119
+ align-items: flex-end;
120
+ justify-content: flex-end;
121
+ flex-flow: wrap;
122
+ height: 100%;
123
+ box-sizing: border-box;
124
+ padding: 10rpx 0;
125
+ width: 130rpx;
126
+ flex-shrink: 0;
127
+
128
+ & > .score {
129
+ .skeleton-item(100rpx, 40rpx);
130
+ }
131
+ & > .btn {
132
+ .skeleton-item(130rpx, 60rpx);
133
+ }
134
+ }
135
+
136
+ &:last-child {
137
+ margin-bottom: 0!important;
138
+ }
139
+
140
+ //影院列表骨架
141
+ &.list {
142
+ display: block;
143
+ }
144
+ & > .title {
145
+ .skeleton-item(100%, 60rpx);
146
+ margin-bottom: 20rpx;
147
+ }
148
+ & > .address {
149
+ .skeleton-item(100%, 40rpx);
150
+ margin-bottom: 20rpx;
151
+ }
152
+ & > .bottom {
153
+ display: flex;
154
+ justify-content: space-between;
155
+ align-items: center;
156
+ padding-top: 30rpx;
157
+
158
+ & > .local {
159
+ .skeleton-item(120rpx, 30rpx);
160
+ }
161
+ & > .btn {
162
+ .skeleton-item(150rpx, 70rpx);
163
+ }
164
+ }
165
+ }
166
+ </style>