jufubao-base 1.0.169-beta17 → 1.0.169-beta18

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.169-beta17",
3
+ "version": "1.0.169-beta18",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -14,7 +14,7 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-notice__body">
17
- <view class="jfb-base-notice__body-line"></view>
17
+ <view class="jfb-base-notice__body-line" v-if="contentList.length > 0"></view>
18
18
  <view>
19
19
  <template v-if="style === '3' && isPreview">
20
20
  <view class="jfb-base-notice__body-pop" :style="{backgroundColor:backgroundColor, color:warningColor}">弹窗模式方便编辑(占位),在线上此模块不显</view>
@@ -23,7 +23,7 @@
23
23
  <template v-if="contentList.length === 0 && isPreview">
24
24
  <view class="jfb-base-notice__body-pop" :style="{backgroundColor:backgroundColor, color:warningColor}">接口无数返回,请检查是否配置成功!</view>
25
25
  </template>
26
- <view v-else class="jfb-base-notice__body-scroll">
26
+ <view v-if="contentList.length > 0" class="jfb-base-notice__body-scroll">
27
27
  <view
28
28
  class="upAndDown"
29
29
  :style="{
@@ -13,10 +13,10 @@
13
13
  style="width: 100%; height: 100%"
14
14
  :keyword="keyword"
15
15
  :item="item"
16
- :out-spacing="$parentVm.outSpacing"
17
- :color="{SEAT:$parentVm.mainColor,CODE:$parentVm.subMainColor,SELL:$parentVm.successColor}"
18
- :border-radius="$parentVm.imgRradius"
19
- :brand-color="$parentVm.brandColor"
16
+ :out-spacing="listItemStyle.outSpacing"
17
+ :color="{SEAT:listItemStyle.mainColor,CODE:listItemStyle.subMainColor,SELL:listItemStyle.successColor}"
18
+ :border-radius="listItemStyle.imgRradius"
19
+ :brand-color="listItemStyle.brandColor"
20
20
  @on-schedule="handleFilmDetail"
21
21
  @on-cashier-detail="handleCashierDetail"
22
22
  @on-code-detail="handleCodeDetail"
@@ -26,10 +26,10 @@
26
26
  style="width: 100%; height: 100%"
27
27
  :keyword="keyword"
28
28
  :item="item"
29
- :out-spacing="$parentVm.outSpacing"
30
- :color="$parentVm.mainColor"
31
- :border-radius="$parentVm.imgRradius"
32
- :brand-color="$parentVm.brandColor"
29
+ :out-spacing="listItemStyle.outSpacing"
30
+ :color="listItemStyle.mainColor"
31
+ :border-radius="listItemStyle.imgRradius"
32
+ :brand-color="listItemStyle.brandColor"
33
33
  @on-film-detail="handleFilmDetail"
34
34
  @on-buy="handleBuy"
35
35
  ></content-film>
@@ -37,11 +37,11 @@
37
37
  style="width: 100%; height: 100%"
38
38
  :keyword="keyword"
39
39
  :item="item"
40
- :out-spacing="$parentVm.outSpacing"
41
- :color="$parentVm.mainColor"
42
- :border-radius="$parentVm.imgRradius"
43
- :brand-color="$parentVm.brandColor"
44
- :is-echange="'Y' || $parentVm.isShowExchange"
40
+ :out-spacing="listItemStyle.outSpacing"
41
+ :color="listItemStyle.mainColor"
42
+ :border-radius="listItemStyle.imgRradius"
43
+ :brand-color="listItemStyle.brandColor"
44
+ :is-echange="'Y' || listItemStyle.isShowExchange"
45
45
  @on-shop-jhd="handleShopJhd"
46
46
  @on-shop-detail="handleShopDetail"
47
47
  ></content-shop>
@@ -51,7 +51,7 @@
51
51
  <view v-for="(item, i) in parent.items" :key="item.key"
52
52
  class="module_cont_inner"
53
53
  :style="[moduleItemContStyle, {
54
- width: getProductCell(parent.tab) == 2 ? `calc(50% - ${$parentVm.allModuleItemContMargin/2}rpx)`: '100%',
54
+ width: getProductCell(parent.tab) == 2 ? `calc(50% - ${allStyle.allModuleItemContMargin/2}rpx)`: '100%',
55
55
  }]"
56
56
  >
57
57
  <content-product v-if="parent.type === 'product'"
@@ -59,11 +59,11 @@
59
59
  :keyword="keyword"
60
60
  :item="item"
61
61
  :height="outItemProduct"
62
- :product-config="$parentVm.productConfig"
63
- :out-spacing="$parentVm.outSpacing"
64
- :color="$parentVm.mainColor"
65
- :brand-color="$parentVm.brandColor"
66
- :border-radius="$parentVm.imgRradius"
62
+ :product-config="productConfig"
63
+ :out-spacing="listItemStyle.outSpacing"
64
+ :color="listItemStyle.mainColor"
65
+ :brand-color="listItemStyle.brandColor"
66
+ :border-radius="listItemStyle.imgRradius"
67
67
  :cell="getProductCell(parent.tab)"
68
68
  @on-product-detail="handleProductDetail"
69
69
  ></content-product>
@@ -95,6 +95,17 @@
95
95
  type:String,
96
96
  default:'',
97
97
  },
98
+ allStyle: {
99
+ type:Object,
100
+ },
101
+ listItemStyle:{
102
+ type:Object|null,
103
+ default:null,
104
+ },
105
+ productConfig:{
106
+ type:Object|null,
107
+ default:null,
108
+ },
98
109
  },
99
110
  computed: {
100
111
  ...mapState({
@@ -102,38 +113,39 @@
102
113
  stateLocation: (state) => state.cityLocation.location || {},
103
114
  }),
104
115
  contMarginComp(){
105
- let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
106
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
107
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
108
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20)}rpx`;
116
+ if(this.getParent === null) return 0
117
+ let str = `${this.getParent().checkValue(this.listItemStyle.contMargin.top, 20)}rpx`;
118
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.right, 20)}rpx`;
119
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.bottom, 20)}rpx`;
120
+ str = `${str} ${this.getParent().checkValue(this.listItemStyle.contMargin.left, 20)}rpx`;
109
121
  return str
110
122
  },
111
123
  moduleItemStyle(){
112
- const { allModuleRadius } = this.$parentVm;
113
- let padding = `${this.$parentVm.checkValue(this.$parentVm.allModulePadding.top, 20)}rpx`;
114
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModulePadding.right, 20)}rpx`;
115
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModulePadding.bottom, 20)}rpx`;
116
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModulePadding.left, 20)}rpx`;
124
+ const { allModuleRadius, allModulePadding, allListBgColor, allModuleMargin } = this.allStyle;
125
+ let padding = `${this.checkValue(allModulePadding.top, 20)}rpx`;
126
+ padding = `${padding} ${this.checkValue(allModulePadding.right, 20)}rpx`;
127
+ padding = `${padding} ${this.checkValue(allModulePadding.bottom, 20)}rpx`;
128
+ padding = `${padding} ${this.checkValue(allModulePadding.left, 20)}rpx`;
117
129
 
118
130
  return this.styleObjectToString({
119
- background: this.$parentVm.allListBgColor,
131
+ background: allListBgColor,
120
132
  padding: padding,
121
- marginBottom: this.$parentVm.allModuleMargin + 'rpx',
133
+ marginBottom: allModuleMargin + 'rpx',
122
134
  borderRadius: allModuleRadius + 'rpx',
123
135
  })
124
136
  },
125
137
  moduleItemTitleStyle(){
126
- let padding = `${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.top, 20)}rpx`;
127
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.right, 20)}rpx`;
128
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.bottom, 20)}rpx`;
129
- padding = `${padding} ${this.$parentVm.checkValue(this.$parentVm.allModuleTitlePadding.left, 20)}rpx`;
138
+ const { allModuleTitlePadding, allModuleTitleStyle, allModuleTitleBgColor } = this.allStyle;
139
+ let padding = `${this.checkValue(allModuleTitlePadding.top, 20)}rpx`;
140
+ padding = `${padding} ${this.checkValue(allModuleTitlePadding.right, 20)}rpx`;
141
+ padding = `${padding} ${this.checkValue(allModuleTitlePadding.bottom, 20)}rpx`;
142
+ padding = `${padding} ${this.checkValue(allModuleTitlePadding.left, 20)}rpx`;
130
143
 
131
- let allModuleTitleStyle = this.$parentVm.allModuleTitleStyle;
132
144
  let style = {padding: padding};
133
145
  if(allModuleTitleStyle === 'underline'){
134
146
  style['borderBottom'] = '1px solid #EEEEEE';
135
147
  }else{
136
- style['background'] = this.$parentVm.allModuleTitleBgColor;
148
+ style['background'] = allModuleTitleBgColor;
137
149
  }
138
150
 
139
151
  return this.styleObjectToString(style);
@@ -142,7 +154,7 @@
142
154
  let {
143
155
  allModuleItemContBorder, allModuleItemContShadow, allModuleItemContPadding, allModuleItemContMargin,
144
156
  allModuleItemContRadius, allModuleItemContBgColor
145
- } = this.$parentVm;
157
+ } = this.allStyle;
146
158
  let border = "none";
147
159
  let boxShadow = "none";
148
160
  if(allModuleItemContBorder && allModuleItemContBorder.type === 'Y'){
@@ -153,10 +165,10 @@
153
165
  let { width, color } = allModuleItemContShadow.value;
154
166
  boxShadow = `0 0 ${width}rpx ${color}`;
155
167
  }
156
- let padding = `${this.$parentVm.checkValue(allModuleItemContPadding.top, 20)}rpx`;
157
- padding = `${padding} ${this.$parentVm.checkValue(allModuleItemContPadding.right, 20)}rpx`;
158
- padding = `${padding} ${this.$parentVm.checkValue(allModuleItemContPadding.bottom, 20)}rpx`;
159
- padding = `${padding} ${this.$parentVm.checkValue(allModuleItemContPadding.left, 20)}rpx`;
168
+ let padding = `${this.checkValue(allModuleItemContPadding.top, 20)}rpx`;
169
+ padding = `${padding} ${this.checkValue(allModuleItemContPadding.right, 20)}rpx`;
170
+ padding = `${padding} ${this.checkValue(allModuleItemContPadding.bottom, 20)}rpx`;
171
+ padding = `${padding} ${this.checkValue(allModuleItemContPadding.left, 20)}rpx`;
160
172
  console.log("allModuleItemContShadow", allModuleItemContShadow)
161
173
  return this.styleObjectToString({
162
174
  padding: padding,
@@ -168,7 +180,7 @@
168
180
  })
169
181
  },
170
182
  moduleMoreStyle(){
171
- let allModuleMoreStyle = this.$parentVm.allModuleMoreStyle;
183
+ const { allModuleMoreStyle } = this.allStyle;
172
184
  let style = {};
173
185
  if(allModuleMoreStyle === 'text'){
174
186
 
@@ -180,11 +192,11 @@
180
192
  return this.styleObjectToString(style);
181
193
  },
182
194
  outItemProduct(){
195
+ if(this.getParent === null) return 0
183
196
  //获取每列元素最大宽度
184
- // return 300;
185
- let num = (750 - 3 * Number(this.$parentVm.outSpacing))/2;
186
- num = num - this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20) - this.$parentVm.checkValue(this.$parentVm.contMargin.left, 20);
187
- return num - this.$parentVm.contBorderWidth * 2
197
+ let num = (750 - 3 * Number(this.listItemStyle.outSpacing))/2;
198
+ num = num - this.getParent().checkValue(this.listItemStyle.contMargin.right, 20) - this.getParent().checkValue(this.listItemStyle.contMargin.left, 20);
199
+ return num - this.listItemStyle.contBorderWidth * 2
188
200
  },
189
201
  },
190
202
  watch: {
@@ -199,6 +211,8 @@
199
211
  },
200
212
  data(){
201
213
  return {
214
+ /**@type Function|null**/
215
+ getParent:null,
202
216
  $parentVm:null,
203
217
  parentStatus: false,
204
218
 
@@ -210,13 +224,16 @@
210
224
  this.getList();
211
225
  },
212
226
  methods: {
227
+ checkValue(value, defaultValue){
228
+ return this.getParent().checkValue(value, defaultValue);
229
+ },
213
230
  getProductCell(str = ''){
214
231
  let cellNum = str.split("@")[3] || 1;
215
232
  return Number(cellNum);
216
233
  },
217
234
  getParentMV(){
218
- this.$emit('on-parent-vm', ($vm)=>{
219
- this.$parentVm = $vm;
235
+ this.$emit('on-parent-vm', (getParent)=>{
236
+ this.getParent = getParent;
220
237
  this.parentStatus = true;
221
238
  })
222
239
  },
@@ -257,34 +274,34 @@
257
274
 
258
275
  //影片
259
276
  handleFilmDetail(film){
260
- this.$parentVm.handleFilmDetail(film, this.dataConfig)
277
+ this.getParent().handleFilmDetail(film, this.dataConfig)
261
278
  },
262
279
  handleBuy(film){
263
- this.$parentVm.handleBuy(film, this.dataConfig)
280
+ this.getParent().handleBuy(film, this.dataConfig)
264
281
  },
265
282
 
266
283
  //影院
267
284
  handleSchedule(cinema){
268
- this.$parentVm.handleSchedule(cinema, this.dataConfig)
285
+ this.getParent().handleSchedule(cinema, this.dataConfig)
269
286
  },
270
287
  handleCashierDetail(cinema){
271
- this.$parentVm.handleCashierDetail(cinema, this.dataConfig)
288
+ this.getParent().handleCashierDetail(cinema, this.dataConfig)
272
289
  },
273
290
  handleCodeDetail(cinema){
274
- this.$parentVm.handleCodeDetail(cinema, this.dataConfig)
291
+ this.getParent().handleCodeDetail(cinema, this.dataConfig)
275
292
  },
276
293
 
277
294
  //门店
278
295
  handleShopJhd(shop){
279
- this.$parentVm.handleShopJhd(shop, this.dataConfig)
296
+ this.getParent().handleShopJhd(shop, this.dataConfig)
280
297
  },
281
298
  handleShopDetail(shop){
282
- this.$parentVm.handleShopDetail(shop, this.dataConfig)
299
+ this.getParent().handleShopDetail(shop, this.dataConfig)
283
300
  },
284
301
 
285
302
  //商品
286
303
  handleProductDetail(product){
287
- this.$parentVm.handleProductDetail(product, this.dataConfig)
304
+ this.getParent().handleProductDetail(product, this.dataConfig)
288
305
  },
289
306
  }
290
307
  }
@@ -40,14 +40,17 @@
40
40
  </view>
41
41
  </view>
42
42
  </view>
43
- <view v-if="!isPreview" style="height: 100rpx;"></view>
43
+ <view v-if="!isPreview" :style="{height: menuHeight}"></view>
44
44
  <view class="tfk-search" :style="{padding: outSpacing + 'rpx'}">
45
- <!-- <all-list v-if="tabId === 'all'"-->
46
- <!-- :keyword="keyword"-->
47
- <!-- @on-parent-vm="handleParentVm"-->
48
- <!-- @on-list="handleList"-->
49
- <!-- @on-switch="handleSwitchMenu"-->
50
- <!-- ></all-list>-->
45
+ <all-list v-if="tabId === 'all'"
46
+ :keyword="keyword"
47
+ :list-item-style="listItemStyle"
48
+ :product-config="productConfig"
49
+ :all-style="allStyle"
50
+ @on-parent-vm="handleParentVm"
51
+ @on-list="handleList"
52
+ @on-switch="handleSwitchMenu"
53
+ ></all-list>
51
54
  <custom-list
52
55
  :tab-id="tabId"
53
56
  :keyword="keyword"
@@ -73,7 +76,7 @@
73
76
  import extsMixins from "@/mixins/extsMixins";
74
77
  import listMixins from "./listMixins";
75
78
  import CustomList from "./CustomList.vue";
76
- //import AllList from "./AllList.vue";
79
+ import AllList from "./AllList.vue";
77
80
 
78
81
  class EmitParent {
79
82
  constructor(options) {
@@ -86,7 +89,7 @@
86
89
  components: {
87
90
  CustomList,
88
91
  XdFontIcon,
89
- //AllList,
92
+ AllList,
90
93
  XdSearchHistory
91
94
  },
92
95
  mixins: [
@@ -176,6 +179,13 @@
176
179
 
177
180
  return this.styleObjectToString(styleObj)
178
181
  },
182
+ menuHeight(){
183
+ const { menuItemPadding, menuPadding, menuMargin } = this;
184
+ let height = this.checkValue(menuMargin.top, 20) + this.checkValue(menuMargin.bottom, 20) +
185
+ this.checkValue(menuPadding.top, 20) + this.checkValue(menuPadding.bottom, 20) +
186
+ this.checkValue(menuItemPadding.top, 20) + this.checkValue(menuItemPadding.bottom, 20);
187
+ return (height + 40) + 'rpx';
188
+ },
179
189
  menuItemActiveStyle(){
180
190
  let defaultTextColor = this.mainColor;
181
191
  let styleActiveObj = {
@@ -187,6 +197,24 @@
187
197
  }
188
198
  return this.styleObjectToString(styleActiveObj)
189
199
  },
200
+ allStyle(){
201
+ return {
202
+ allListBgColor: this.allListBgColor,
203
+ allModulePadding: this.allModulePadding,
204
+ allModuleRadius: this.allModuleRadius,
205
+ allModuleTitleBgColor: this.allModuleTitleBgColor,
206
+ allModuleTitlePadding: this.allModuleTitlePadding,
207
+ allModuleMoreStyle: this.allModuleMoreStyle,
208
+ allModuleMargin: this.allModuleMargin,
209
+ allModuleTitleStyle: this.allModuleTitleStyle,
210
+ allModuleItemContBorder: this.allModuleItemContBorder,
211
+ allModuleItemContMargin: this.allModuleItemContMargin,
212
+ allModuleItemContShadow: this.allModuleItemContShadow,
213
+ allModuleItemContPadding: this.allModuleItemContPadding,
214
+ allModuleItemContRadius: this.allModuleItemContRadius,
215
+ allModuleItemContBgColor: this.allModuleItemContBgColor
216
+ }
217
+ }
190
218
  },
191
219
  watch: {
192
220
  container(value, oldValue) {
@@ -103,7 +103,7 @@ module.exports = {
103
103
  consume_mode: ["STOD", "CODE", "SELL", "SELF"],
104
104
  consume_mode_name: "",
105
105
  distance: "21km",
106
- is_support_jhd: false,
106
+ is_support_jhd: true,
107
107
  address: "河北廊坊市三河市燕郊镇河北廊坊燕郊润旭",
108
108
  province_name: "",
109
109
  city_name: "",