jufubao-base 1.0.169-beta9 → 1.0.170

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/JfbBaseHeader/JfbBaseHeader.vue +2 -2
  3. package/src/components/JfbBaseLogin/Attr.js +10 -0
  4. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +6 -1
  5. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +2 -2
  6. package/src/components/JfbBaseTfkCardBind/Attr.js +80 -7
  7. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +112 -13
  8. package/src/components/JfbBaseTfkCardDetail/Attr.js +49 -1
  9. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +18 -9
  10. package/src/components/JfbBaseTfkCardLogin/Attr.js +223 -13
  11. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +118 -73
  12. package/src/components/JfbBaseTfkCardLogin/Mock.js +5 -535
  13. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +10 -6
  14. package/src/components/JfbBaseTfkCardLogin/XdNotice.vue +550 -0
  15. package/src/components/JfbBaseTfkSearch/AllList.vue +241 -135
  16. package/src/components/JfbBaseTfkSearch/Api.js +1 -1
  17. package/src/components/JfbBaseTfkSearch/Attr.js +203 -1
  18. package/src/components/JfbBaseTfkSearch/ContentFilm.vue +127 -88
  19. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +14 -5
  20. package/src/components/JfbBaseTfkSearch/ContentShop.vue +2 -0
  21. package/src/components/JfbBaseTfkSearch/CusAttr.js +10 -0
  22. package/src/components/JfbBaseTfkSearch/CustomList.vue +130 -78
  23. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +164 -62
  24. package/src/components/JfbBaseTfkSearch/Mock.js +184 -32
  25. package/src/components/JfbBaseTfkSearch/listMixins.js +111 -75
  26. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -1
  27. package/src/mixins/componentsMixins.js +33 -3
  28. package/src/mixins/posterMixins.js +122 -0
  29. package/src/components/JfbBaseTfkSearch/search.js +0 -293
@@ -1,59 +1,76 @@
1
1
  <template>
2
2
  <view class="search_all_list" >
3
3
  <view class="module_item" v-for="parent in list" :key="parent.setting_id"
4
- :style="{
5
- padding:contMarginComp,
6
- }"
4
+ :style="moduleItemStyle"
7
5
  >
8
- <view class="module_title">{{ parent.name }}</view>
9
- <view class="module_cont">
10
- <view v-for="(item, i) in parent.items" :key="i">
6
+ <view class="module_title" :style="moduleItemTitleStyle">{{ parent.name }}</view>
7
+ <view v-if="parent.type !== 'product'" class="module_cont">
8
+ <view v-for="(item, i) in parent.items" :key="item.key"
9
+ class="module_cont_inner"
10
+ :style="moduleItemContStyle"
11
+ >
11
12
  <content-cinema v-if="parent.type === 'cinema'"
12
13
  style="width: 100%; height: 100%"
14
+ :keyword="keyword"
13
15
  :item="item"
14
- :out-spacing="$parentVm.outSpacing"
15
- :color="{SEAT:$parentVm.mainColor,CODE:$parentVm.subMainColor,SELL:$parentVm.successColor}"
16
- :border-radius="$parentVm.imgRradius"
17
- @on-schedule="(cinema)=>{$parentVm.handleSchedule(cinema,parent)}"
18
- @on-cashier-detail="(cinema)=>{$parentVm.handleCashierDetail(cinema,parent)}"
19
- @on-code-detail="(cinema)=>{$parentVm.handleCodeDetail(cinema,parent)}"
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
+ @on-schedule="handleFilmDetail"
21
+ @on-cashier-detail="handleCashierDetail"
22
+ @on-code-detail="handleCodeDetail"
20
23
  ></content-cinema>
21
-
22
24
  <content-film v-if="parent.type === 'film'"
25
+ type="hot"
23
26
  style="width: 100%; height: 100%"
27
+ :keyword="keyword"
24
28
  :item="item"
25
- :out-spacing="$parentVm.outSpacing"
26
- :color="$parentVm.mainColor"
27
- :border-radius="$parentVm.imgRradius"
28
- @on-film-detail="(film_id)=>{$parentVm.handleFilmDetail(film_id, parent)}"
29
- @on-buy="(film_id)=>{$parentVm.handleBuy(film_id, parent)}"
29
+ :out-spacing="listItemStyle.outSpacing"
30
+ :color="listItemStyle.mainColor"
31
+ :border-radius="listItemStyle.imgRradius"
32
+ :brand-color="listItemStyle.brandColor"
33
+ @on-film-detail="handleFilmDetail"
34
+ @on-buy="handleBuy"
30
35
  ></content-film>
31
-
32
36
  <content-shop v-if="parent.type === 'shop'"
33
37
  style="width: 100%; height: 100%"
38
+ :keyword="keyword"
34
39
  :item="item"
35
- :out-spacing="$parentVm.outSpacing"
36
- :color="$parentVm.mainColor"
37
- :border-radius="$parentVm.imgRradius"
38
- :is-echange="'Y' || $parentVm.isShowExchange"
39
- @on-shop-jhd="(shop)=>{$parentVm.handleShopJhd(shop,parent)}"
40
- @on-shop-detail="(shop)=>{$parentVm.handleShopDetail(shop,parent)}"
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
+ @on-shop-jhd="handleShopJhd"
46
+ @on-shop-detail="handleShopDetail"
41
47
  ></content-shop>
42
-
48
+ </view>
49
+ </view>
50
+ <view v-else class="module_cont product_wrap">
51
+ <view v-for="(item, i) in parent.items" :key="item.key"
52
+ class="module_cont_inner"
53
+ :style="[moduleItemContStyle, {
54
+ width: getProductCell(parent.tab) == 2 ? `calc(50% - ${listItemStyle.outSpacing/2}rpx)`: '100%',
55
+ }]"
56
+ >
43
57
  <content-product v-if="parent.type === 'product'"
44
58
  style="width: 100%; height: 100%"
59
+ :keyword="keyword"
45
60
  :item="item"
46
- :product-config="$parentVm.productConfig"
47
- :out-spacing="$parentVm.outSpacing"
48
- :color="$parentVm.mainColor"
49
- :border-radius="$parentVm.imgRradius"
50
- :cell="1"
51
- @on-product-detail="(product)=>{$parentVm.handleProductDetail(product,parent)}"
61
+ :height="outItemProduct"
62
+ :product-config="productConfig"
63
+ :out-spacing="listItemStyle.outSpacing"
64
+ :color="listItemStyle.mainColor"
65
+ :brand-color="listItemStyle.brandColor"
66
+ :border-radius="listItemStyle.imgRradius"
67
+ :cell="getProductCell(parent.tab)"
68
+ @on-product-detail="handleProductDetail"
52
69
  ></content-product>
53
70
  </view>
54
71
  </view>
55
72
  <view class="module_more">
56
- <view>查看全部{{ parent.name }} >></view>
73
+ <view class="more_inner" :style="moduleMoreStyle" @click="switchMenu(parent)">查看全部</view>
57
74
  </view>
58
75
  </view>
59
76
  </view>
@@ -64,6 +81,7 @@
64
81
  import ContentFilm from "./ContentFilm.vue"
65
82
  import ContentShop from "./ContentShop.vue"
66
83
  import ContentProduct from "./ContentProduct.vue"
84
+ import {mapState} from "vuex";
67
85
  export default{
68
86
  name: "SearchAllList",
69
87
  components: {
@@ -73,109 +91,119 @@
73
91
  ContentProduct
74
92
  },
75
93
  props: {
76
-
94
+ keyword:{
95
+ type:String,
96
+ default:'',
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
+ },
77
109
  },
78
110
  computed: {
111
+ ...mapState({
112
+ stateCity: state => state.cityLocation.city,
113
+ stateLocation: (state) => state.cityLocation.location || {},
114
+ }),
79
115
  contMarginComp(){
80
- let str = `${this.$parentVm.checkValue(this.$parentVm.contMargin.top, 20)}rpx`;
81
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.right, 20)}rpx`;
82
- str = `${str} ${this.$parentVm.checkValue(this.$parentVm.contMargin.bottom, 20)}rpx`;
83
- 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`;
84
121
  return str
85
122
  },
123
+ moduleItemStyle(){
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`;
129
+
130
+ return this.styleObjectToString({
131
+ background: allListBgColor,
132
+ padding: padding,
133
+ marginBottom: allModuleMargin + 'rpx',
134
+ borderRadius: allModuleRadius + 'rpx',
135
+ })
136
+ },
137
+ moduleItemTitleStyle(){
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`;
143
+
144
+ let style = {padding: padding};
145
+ if(allModuleTitleStyle === 'underline'){
146
+ style['borderBottom'] = '1px solid #EEEEEE';
147
+ }else{
148
+ style['background'] = allModuleTitleBgColor;
149
+ }
150
+
151
+ return this.styleObjectToString(style);
152
+ },
153
+ moduleItemContStyle(){
154
+ const { contBgColor, contShadow, contBorder, contMargin, contRradius, outSpacing } = this.listItemStyle;
155
+
156
+ let padding = `${this.checkValue(contMargin.top, 20)}rpx`;
157
+ padding = `${padding} ${this.checkValue(contMargin.right, 20)}rpx`;
158
+ padding = `${padding} ${this.checkValue(contMargin.bottom, 20)}rpx`;
159
+ padding = `${padding} ${this.checkValue(contMargin.left, 20)}rpx`;
160
+ return this.styleObjectToString({
161
+ padding: padding,
162
+ border: contBorder,
163
+ borderRadius: contRradius + 'rpx',
164
+ boxShadow: contShadow,
165
+ marginBottom: outSpacing + 'rpx',
166
+ background: contBgColor,
167
+ })
168
+ },
169
+ moduleMoreStyle(){
170
+ const { allModuleMoreStyle } = this.allStyle;
171
+ let style = {};
172
+ if(allModuleMoreStyle === 'text'){
173
+
174
+ }else{
175
+ style['border'] = '1px solid #EEEEEE';
176
+ style['background'] = '#EEEEEE';
177
+ style['color'] = '#999999';
178
+ }
179
+ return this.styleObjectToString(style);
180
+ },
181
+ outItemProduct(){
182
+ if(this.getParent === null) return 0
183
+ //获取每列元素最大宽度
184
+ let num = (750 - 3 * Number(this.listItemStyle.outSpacing))/2;
185
+ num = num - this.getParent().checkValue(this.listItemStyle.contMargin.right, 20) - this.getParent().checkValue(this.listItemStyle.contMargin.left, 20);
186
+ return num - this.listItemStyle.contBorderWidth * 2
187
+ },
188
+ },
189
+ watch: {
190
+ keyword(){
191
+ this.getList()
192
+ },
193
+ stateCity(n, o){
194
+ if(n && JSON.stringify(n) !== JSON.stringify(o)){
195
+ this.getList()
196
+ }
197
+ },
86
198
  },
87
199
  data(){
88
200
  return {
201
+ /**@type Function|null**/
202
+ getParent:null,
89
203
  $parentVm:null,
90
204
  parentStatus: false,
91
205
 
92
- list: [
93
- {
94
- "type": "product",
95
- "name": "蛋糕",
96
- "detail_redirect_data": "{\"dir\":\"wtxsaas\",\"host\":\"sandbox-website-05.jufubao.cn\",\"path\":\"\\/main\\/order\\/detail\",\"appType\":\"h5\",\"site_id\":\"17928cc37788be02\",\"site_url\":\"https:\\/\\/sandbox-website-05.jufubao.cn\\/wtxsaas\\/main\\/order\\/detail\",\"frontPath\":\"\\/wtxsaas\\/main\\/order\\/detail\",\"fixed_business_code\":\"\"}",
97
- "detail1_redirect_data": "",
98
- "more_redirect_data": "",
99
- "sort": 0,
100
- "setting_id": 1,
101
- "next_page_token": "a:2:{i:0;d:1705.0785;i:1;s:8:\"60030143\";}",
102
- "items": [
103
- {
104
- "brand_id": 100003,
105
- "brand_name": "品牌jls0519",
106
- "list_title": "3",
107
- "market_price": 2000,
108
- "market_tags": [],
109
- "product_id": 60030143,
110
- "product_name": "仅快递实物商品(北京廊坊支持配送)",
111
- "product_type": "good",
112
- "promo_price": 0,
113
- "sale_num": 8,
114
- "sale_price": 3000,
115
- "status": "ok",
116
- "thumb": "/uploads/20231215/b2ce0235129aa592044f96343f25c338.jpeg"
117
- }
118
- ]
119
- },
120
- {
121
- "type": "shop",
122
- "name": "蛋糕",
123
- "detail_redirect_data": "",
124
- "detail1_redirect_data": "",
125
- "more_redirect_data": "",
126
- "sort": 1,
127
- "setting_id": 5,
128
- "next_page_token": "a:1:{i:0;d:4.4;}",
129
- "items": [
130
- {
131
- "brand_id": 0,
132
- "brand_name": "",
133
- "shop_icon": "https://dimg04.uat.qa.nt.ctripcorp.com/images/1lo4a12000007fyeg8D96.gif",
134
- "distance": 4,
135
- "business_status": "5",
136
- "full_address": "北京北京北京市东城区景山前街4号",
137
- "phone": "",
138
- "consume_mode": [
139
- "TRAVEL"
140
- ],
141
- "consume_mode_name": "",
142
- "shop_id": 1052782,
143
- "resource_shop_id": 8000302,
144
- "resource_shop_name": "故宫-测试1-攻略修改",
145
- "shop_tags": {},
146
- "stars": 2
147
- }
148
- ]
149
- },
150
- {
151
- "type": "cinema",
152
- "name": "影院",
153
- "detail_redirect_data": "{\"dir\":\"apply06\",\"host\":\"sandbox-website-05.jufubao.cn\",\"path\":\"\\/main\\/movie\\/suhedule\",\"appType\":\"h5\",\"site_id\":\"17928cc37788be02\",\"site_url\":\"https:\\/\\/sandbox-website-05.jufubao.cn\\/apply06\\/main\\/movie\\/suhedule\",\"frontPath\":\"\\/apply06\\/main\\/movie\\/suhedule\",\"fixed_business_code\":\"\"}",
154
- "detail1_redirect_data": "{\"dir\":\"apply06\",\"host\":\"sandbox-website-05.jufubao.cn\",\"path\":\"\\/main\\/movie\\/cdetailnew\",\"appType\":\"h5\",\"site_id\":\"17928cc37788be02\",\"site_url\":\"https:\\/\\/sandbox-website-05.jufubao.cn\\/apply06\\/main\\/movie\\/cdetailnew\",\"frontPath\":\"\\/apply06\\/main\\/movie\\/cdetailnew\",\"fixed_business_code\":\"\"}",
155
- "more_redirect_data": "",
156
- "sort": 3,
157
- "setting_id": 10,
158
- "next_page_token": 1,
159
- "items": [
160
- {
161
- "address": "朝阳区安慧里三区10号 (北辰购物中心对面)",
162
- "brand_id": 0,
163
- "brand_name": "",
164
- "cinema_id": 6771413,
165
- "cinema_name": "北京剧院",
166
- "cinema_type": [
167
- "SEAT"
168
- ],
169
- "cinema_type_name": [
170
- "在线选座"
171
- ],
172
- "distance": "",
173
- "is_open": "Y",
174
- "shop_icon": ""
175
- }
176
- ]
177
- }
178
- ],
206
+ list: [],
179
207
  }
180
208
  },
181
209
  created(){
@@ -183,22 +211,85 @@
183
211
  this.getList();
184
212
  },
185
213
  methods: {
214
+ checkValue(value, defaultValue){
215
+ return this.getParent().checkValue(value, defaultValue);
216
+ },
217
+ getProductCell(str = ''){
218
+ let cellNum = str.split("@")[3] || 1;
219
+ return Number(cellNum);
220
+ },
186
221
  getParentMV(){
187
- this.$emit('on-parent-vm', ($vm)=>{
188
- this.$parentVm = $vm;
222
+ this.$emit('on-parent-vm', (getParent)=>{
223
+ this.getParent = getParent;
189
224
  this.parentStatus = true;
190
225
  })
191
226
  },
192
227
  getList(){
228
+ let params = {keyword: this.keyword};
229
+ //设置城市
230
+ if(this.stateCity && this.stateCity.city_code) {
231
+ params['city_code'] = this.stateCity.city_code;
232
+ }
233
+
234
+ //设置经纬度
235
+ if(this.stateLocation &&
236
+ (this.stateLocation.latitude && this.stateLocation.longitude)
237
+ ){
238
+ params['latitude'] = this.stateLocation.latitude;
239
+ params['longitude'] = this.stateLocation.longitude;
240
+ }
241
+
193
242
  this.$xdShowLoading({});
194
243
  this.$emit('on-list', {
195
- params: {},
244
+ params: params,
196
245
  cb:(list)=>{
197
- this.list = list;
246
+ this.list = (list || []).map(parent => {
247
+ parent.items = parent.items.map(item => {
248
+ item['key'] = item.product_id || item.resource_shop_id || item.cinema_id || item.film_id;
249
+ return item;
250
+ })
251
+ return parent;
252
+ });
198
253
  this.$xdHideLoading();
199
254
  }
200
255
  })
201
- }
256
+ },
257
+ switchMenu(item){
258
+ this.$emit('on-switch', {...item, value: item.tab});
259
+ },
260
+
261
+
262
+ //影片
263
+ handleFilmDetail(film){
264
+ this.getParent().handleFilmDetail(film, this.dataConfig)
265
+ },
266
+ handleBuy(film){
267
+ this.getParent().handleBuy(film, this.dataConfig)
268
+ },
269
+
270
+ //影院
271
+ handleSchedule(cinema){
272
+ this.getParent().handleSchedule(cinema, this.dataConfig)
273
+ },
274
+ handleCashierDetail(cinema){
275
+ this.getParent().handleCashierDetail(cinema, this.dataConfig)
276
+ },
277
+ handleCodeDetail(cinema){
278
+ this.getParent().handleCodeDetail(cinema, this.dataConfig)
279
+ },
280
+
281
+ //门店
282
+ handleShopJhd(shop){
283
+ this.getParent().handleShopJhd(shop, this.dataConfig)
284
+ },
285
+ handleShopDetail(shop){
286
+ this.getParent().handleShopDetail(shop, this.dataConfig)
287
+ },
288
+
289
+ //商品
290
+ handleProductDetail(product){
291
+ this.getParent().handleProductDetail(product, this.dataConfig)
292
+ },
202
293
  }
203
294
  }
204
295
  </script>
@@ -210,22 +301,37 @@
210
301
  margin-bottom: 20rpx;
211
302
  }
212
303
  .module_title{
213
- height: 88rpx;
214
- line-height: 88rpx;
215
- border-bottom: 1px solid #EEEEEE;
216
304
  font-size: 28rpx;
217
305
  color: #333333;
218
306
  }
219
307
  .module_cont{
220
308
  padding: 20rpx 0;
309
+
310
+ &.product_wrap{
311
+ display: flex;
312
+ justify-content: space-between;
313
+ flex-wrap: wrap;
314
+ }
315
+
316
+ .module_cont_inner{
317
+ box-sizing: border-box;
318
+ }
221
319
  }
222
320
  .module_more{
223
321
  display: flex;
224
322
  justify-content: center;
225
323
  align-items: center;
226
- height: 80rpx;
227
324
  font-size: 26rpx;
228
325
  color: #999999;
326
+ margin-top: 32rpx;
327
+ .more_inner{
328
+ display: flex;
329
+ justify-content: center;
330
+ align-items: center;
331
+ height: 70rpx;
332
+ width: 200rpx;
333
+ border-radius: 80rpx;
334
+ }
229
335
  }
230
336
  }
231
- </style>
337
+ </style>
@@ -9,7 +9,7 @@ module.exports = [
9
9
  //设置方法名字当别忘记加上【模块名字】:Tfk
10
10
  mapFnName: 'getTfkSearchList',
11
11
  title: '获取s搜索列表',
12
- path: '/mall/v1/search',
12
+ path: '/mall/v1/msearch',
13
13
  isRule: false,
14
14
  params: {
15
15
  keyword: ['模糊搜索关键字', 'Number', '必选'],