Browse Source

feat:新增比价需求

dingyantao 5 months ago
parent
commit
33e46aef2c

+ 716
- 0
components/index/Sale.vue View File

@@ -0,0 +1,716 @@
1
+<template>
2
+	<view class="comm-sale">{{isDetails}}--{{isSale}}
3
+			<view class="list-item" v-if="!isSale">
4
+				<view class="item-title">
5
+					<view class="title-name">
6
+						<view class="">
7
+							开塞露
8
+						</view>
9
+						<view class="">
10
+								甲类
11
+						</view>
12
+					</view>
13
+					<view class="other-price">
14
+						最低售价
15
+					</view>
16
+				</view>
17
+				<view class="item-info">
18
+					<view class="info-item">
19
+						<view class="left">
20
+							<view>生产企业:</view>
21
+							福元药业有限公司
22
+						</view>
23
+						<view class="right price">
24
+							¥0.50
25
+						</view>
26
+					</view>
27
+					<view class="info-item">
28
+						<view class="left">
29
+							<view>类别:</view>
30
+							西药中成药
31
+							</view>
32
+					</view>
33
+					<view class="info-item">
34
+						<view class="left">
35
+							<view>规格:</view>
36
+							1支/支
37
+							</view>
38
+					</view>
39
+					<view class="info-item">
40
+						<view class="left">
41
+							<view>剂型:</view>
42
+							外用溶液剂
43
+						</view>
44
+					</view>
45
+					<view class="info-item">
46
+						<view class="left">
47
+							<view>在售药店:</view>
48
+							<view style="color: #4D85F4;">
49
+								651家
50
+							</view>
51
+						</view>
52
+						<view v-if="!isDetails" class="right btn" @click.stop="viewSale">
53
+							查看在告药店
54
+						</view>
55
+					</view>
56
+				</view>
57
+			</view>
58
+			<slot v-else></slot>
59
+		<LoadModal v-if="loading"></LoadModal>
60
+	</view>
61
+</template>
62
+
63
+<script>
64
+	import {
65
+		mapGetters
66
+	} from "vuex"
67
+	import {
68
+		getMechanismInfoById,
69
+		getCateById,
70
+		GetServeCateListForMid,
71
+		getHospJyzb
72
+	} from "../../assets/api/mechanism.js"
73
+	import {
74
+		GetTreeData
75
+	} from "../../assets/api/common.js"
76
+	import Mechanism from "../../components/index/mechanism.vue"
77
+	// import levelLinkage from "@/components/three-level-linkage/linkage.nvue"
78
+	import LoadModal from "../../components/index/LoadModal.vue"
79
+	export default {
80
+		props: {
81
+			isDetails: {
82
+				type: Boolean,
83
+				default: false
84
+			},
85
+			isSale: {
86
+				type: Boolean,
87
+				default: false
88
+			}
89
+		},
90
+		data() {
91
+			return {
92
+				posData: [{
93
+						label: "简介",
94
+						value: 0
95
+					},
96
+					{
97
+						label: "办理事项",
98
+						value: 1
99
+					},
100
+					{
101
+						label: "就医指标概况",
102
+						value: 2
103
+					},
104
+				],
105
+				id: null,
106
+				info: {},
107
+				collList: [],
108
+				collItemList: [],
109
+				pickerValueDefault: [0],
110
+				treeData: [],
111
+				cateList: [],
112
+				sonIndex: "",
113
+				cateInfo: {},
114
+				opend: true,
115
+				loading: false,
116
+
117
+				tabList: ["简介", "参保登记类"],
118
+				TabCur: 0,
119
+				meCode : "",
120
+				hospJyzb: {}
121
+			}
122
+		},
123
+		components: {
124
+			Mechanism,
125
+			// levelLinkage,
126
+			LoadModal,
127
+		},
128
+		onLoad(e) {
129
+			Object.assign(this, e)
130
+			console.log("this", this)
131
+			let {
132
+				id
133
+			} = this
134
+			if (id) {
135
+				this.getInfo()
136
+			}
137
+
138
+
139
+		},
140
+		computed: {
141
+			...mapGetters([]),
142
+			cateId() {
143
+				return this.info.cate_id
144
+			},
145
+			isShowCate() {
146
+				return this.cateId == 2 || this.cateId == 4 || this.cateId == 6
147
+			},
148
+
149
+			filterPosData() {
150
+				let arr = JSON.parse(JSON.stringify(this.posData));
151
+				// 办理事项是空也显示
152
+				// if (!this.collList) {
153
+				// 	arr = arr.filter(item => item.value != 1)
154
+				// }
155
+				if (!this.hosFit) {
156
+					arr = arr.filter(item => item.value != 2)
157
+				}
158
+				console.log("arr", arr)
159
+				return arr;
160
+			},
161
+
162
+			hosFit0() {
163
+				if (this.info && this.info.hosInfo) {
164
+					const obj = JSON.parse(this.info.hosInfo);
165
+					console.log("obj", obj)
166
+					let newArr = [{
167
+							label: "人次:",
168
+							value: obj.person
169
+						},
170
+						{
171
+							label: "次均费用:",
172
+							value: obj.money
173
+						},
174
+						{
175
+							label: "报销率:",
176
+							value: obj.rate ? obj.rate + '%' : ''
177
+						},
178
+						{
179
+							label: "平均住院天数:",
180
+							value: obj.count ? obj.count + '天' : ''
181
+						}
182
+					];
183
+					console.log("newArr", newArr)
184
+					return newArr;
185
+				} else {
186
+					return null;
187
+				}
188
+
189
+			},
190
+
191
+			hosFit() {
192
+				if (this.hospJyzb && this.hospJyzb.rc) {
193
+					let newArr = [{
194
+							label: "人次:",
195
+							value: this.hospJyzb.rc
196
+						},
197
+						{
198
+							label: "次均费用:",
199
+							value: this.hospJyzb.cjfy
200
+						},
201
+						{
202
+							label: "报销率:",
203
+							value: this.hospJyzb.bxbl ? this.hospJyzb.bxbl*100 + '%' : ''
204
+						},
205
+						{
206
+							label: "平均住院天数:",
207
+							value: this.hospJyzb.pjzyts ? this.hospJyzb.pjzyts + '天' : ''
208
+						}
209
+					];
210
+					console.log("newArr", newArr)
211
+					return newArr;
212
+				} else {
213
+					return null;
214
+				}
215
+
216
+			}
217
+		},
218
+
219
+		watch: {
220
+			treeData() {
221
+
222
+				if (!this.opend && this.treeData && this.treeData.length && this.isShowCate) {
223
+					setTimeout(() => {
224
+						this.loading = false
225
+						this.GetServeCateListHandle()
226
+					}, 200)
227
+				}
228
+			},
229
+			loading() {
230
+				console.log(this.loading);
231
+			},
232
+
233
+		},
234
+		onPullDownRefresh() {
235
+			this.getInfo()
236
+			setTimeout(() => {
237
+				uni.stopPullDownRefresh()
238
+			}, 500)
239
+		},
240
+		methods: {
241
+			
242
+			// 查看在售
243
+			viewSale () {
244
+				uni.navigateTo({
245
+					url: `/pages/index/sale?id=111`
246
+				})
247
+			},
248
+			
249
+			/**
250
+			 * @name input获取焦点
251
+			 */
252
+			focus() {
253
+				let {
254
+					latitude,
255
+					longitude
256
+				} = this.position
257
+				if (!this.isSearchPage && latitude && longitude) {
258
+					alert('查询')
259
+					// this.$emit("searchHandle", this.keyword)
260
+					// uni.navigateTo({
261
+					// 	url:"/pages/index/search"
262
+					// })
263
+				}
264
+			},
265
+			async goInformation(item) {
266
+				console.log("item", item)
267
+				console.log("this.info", this.info.name)
268
+				let name = JSON.stringify(this.info.name);
269
+				let subName = JSON.stringify(item.label);
270
+				let info = JSON.stringify(this.info);
271
+				uni.navigateTo({
272
+					url: `/pages/index/Make?mid=${this.id}&id=${item.value}&name=${encodeURIComponent(name)}&subName=${encodeURIComponent(subName)}&info=${encodeURIComponent(info)}`
273
+				})
274
+			},
275
+			// 查看机构提供服务事项列表
276
+			async GetServeCateListHandle() {
277
+				let res = await GetServeCateListForMid({
278
+					id: this.info.id
279
+				})
280
+				console.log('res--2222222222--', res);
281
+				if (res.data.code == 1) {
282
+					this.collList = res.data.data[0]?.children;
283
+					console.log('this.collList----', this.collList)
284
+				}
285
+			},
286
+
287
+			tabSelect(index) {
288
+				console.log(index);
289
+				this.TabCur = index
290
+			},
291
+
292
+			/**
293
+			 * @name 获取数据
294
+			 */
295
+			async getList() {
296
+				this.loading = true
297
+				this.treeData = []
298
+				let res = await GetTreeData({})
299
+				console.log('res----', res);
300
+				if (res.data.code == 1) {
301
+					this.cateList = res.data.data
302
+					this.treeData = this.filterTreeData(0)
303
+					this.loading = false
304
+					this.opend = false
305
+
306
+				}
307
+
308
+			},
309
+
310
+			/**
311
+			 * @param {Object} 获取分类信息
312
+			 */
313
+			async getCate(id) {
314
+				this.cateInfo = {}
315
+				let res = await getCateById({
316
+					id
317
+				})
318
+				if (res.data.code == 1) {
319
+					this.cateInfo = res.data.data
320
+					console.log(this.cateInfo);
321
+					this.getList()
322
+				}
323
+			},
324
+						
325
+			/**
326
+			 * @param {Object} 获取定点医院就医指标数据
327
+			 */
328
+			async getHospJyzb(code) {
329
+				if(code == '' || code == this.meCode) {
330
+					return;
331
+				}
332
+				this.meCode = code;
333
+				this.hospJyzb = {};
334
+				let res = await getHospJyzb({
335
+					query_id: "41072",
336
+					stt_f: code
337
+				})
338
+				if (res.data.success && res.data.data.length > 0) {
339
+					this.hospJyzb = res.data.data[0];
340
+					console.log(this.hospJyzb);
341
+				}
342
+			},
343
+
344
+			// 处理children为null
345
+			handleChilren(arr) {
346
+				// console.log("start");
347
+				let Tag = this.cateInfo.tag_code
348
+				// console.log(Tag);
349
+				let list = []
350
+				if (arr && arr.length) {
351
+					for (var i = 0; i < arr.length; i++) {
352
+						let el = arr[i]
353
+						let reg = new RegExp(`${Tag}`)
354
+						let HasCode = true
355
+						// console.log(!HasCode);
356
+						if (el.org) {
357
+							HasCode = reg.test(el.org)
358
+						}
359
+						let obj = {
360
+							id: el.ID,
361
+							name: el.name,
362
+							children: el.children ?? [],
363
+							onsite: el.onsite,
364
+							online: el.online,
365
+							dis: !HasCode
366
+						}
367
+						list.push(obj)
368
+					}
369
+				}
370
+				// console.log( list );
371
+				return list
372
+			},
373
+
374
+			// 过滤数据
375
+			filterTreeData(fid) {
376
+				let {
377
+					cateList
378
+				} = this
379
+				let data = []
380
+				if (cateList && cateList.length && fid >= 0) {
381
+					cateList.forEach(el => {
382
+						if (el.fid == fid) {
383
+
384
+							data.push(el)
385
+						}
386
+					})
387
+				}
388
+				// console.log(data);
389
+				return this.handleChilren(data)
390
+			},
391
+
392
+			open() {
393
+				// this.$refs.levelLinkage.open();
394
+				this.opend = true
395
+			},
396
+			onConfirm(e) {
397
+				this.collList = []
398
+				this.collItemList = []
399
+				let {
400
+					value
401
+				} = e
402
+				let index = value[0]
403
+				let fd = this.treeData[index]
404
+
405
+				this.collList = this.filterTreeData(fd.id)
406
+			},
407
+
408
+			/**
409
+			 * @name 折叠面板变化
410
+			 */
411
+			collChange(index) {
412
+				let self = this
413
+				try {
414
+					// console.log( index );
415
+					let {
416
+						id
417
+					} = self.collList[index]
418
+					self.collItemList = self.filterTreeData(id)
419
+					// console.log(self.collItemList);
420
+				} catch (e) {
421
+					// throw(e)
422
+				}
423
+			},
424
+
425
+			collSunChange() {
426
+
427
+			},
428
+
429
+			/**
430
+			 * @name 点击取消
431
+			 */
432
+			back() {
433
+				uni.navigateBack({
434
+
435
+				})
436
+			},
437
+
438
+
439
+
440
+			/**
441
+			 * @name 获取机构详情
442
+			 */
443
+			async getInfo() {
444
+				let {
445
+					id
446
+				} = this
447
+				let res = await getMechanismInfoById({
448
+					id: Number(id)
449
+				})
450
+				if (res.data.code == 1) {
451
+					console.log('000---000', res)
452
+					this.info = res.data.data
453
+					if (this.info) {
454
+						this.info.start_time = this.info.start_time ? this.info.start_time : "9:00"
455
+						this.info.end_time = this.info.end_time ? this.info.end_time : "17:00"
456
+						// console.log( this.info.cate_id );
457
+						this.getCate(this.info.cate_id)
458
+						if(this.info.cate_id == 2 && this.info.me_code) {
459
+							this.getHospJyzb(this.info.me_code)
460
+						}
461
+					}
462
+				}
463
+			},
464
+
465
+
466
+
467
+		},
468
+	}
469
+</script>
470
+
471
+<style>
472
+	page {
473
+		background-color: #fff;
474
+	}
475
+	.uni-collapse-item {
476
+		border-bottom: 1rpx solid #F1F1F1;
477
+	}
478
+	.item_content {
479
+		border-top: 1rpx solid #F1F1F1;
480
+	}
481
+	.child_item_title_2 {
482
+		font-size: 26rpx;
483
+		/* font-weight: bold; */
484
+		padding: 50rpx 0;
485
+		display: flex;
486
+		align-items: center;
487
+		border-bottom: 1rpx solid #F1F1F1;
488
+	}
489
+	.son_item .coll_item:last-child .child_item_title_2 {
490
+		border-bottom: none;
491
+	}
492
+</style>
493
+
494
+<style lang="scss" scoped>
495
+	.comm-sale {
496
+		margin: 30rpx 0;
497
+			.list-item {
498
+				padding: 25rpx;
499
+				background-color: #fff;
500
+				border-radius: 5rpx;
501
+				// 卡片标题
502
+				.item-title {
503
+					display: flex;
504
+					align-items: center;
505
+					justify-content: space-between;
506
+					padding-bottom: 10rpx;
507
+					border-bottom: 1rpx solid #F1F1F1;
508
+					.title-name {
509
+						display: flex;
510
+						align-items: center;
511
+						& > view:first-child {
512
+							margin-right: 18rpx;
513
+							color: #000;
514
+							font-weight: bold;
515
+							font-size: 32rpx;
516
+						}
517
+						
518
+						& > view:last-child {
519
+							color: #4186E2;
520
+							border: 1rpx solid #4186E2;
521
+							border-radius: 5rpx;
522
+							padding: 2rpx 15rpx;
523
+							font-size: 20rpx;
524
+						}
525
+					}
526
+					.other-price {
527
+						font-size: 22rpx;
528
+					}
529
+				}
530
+				// 卡片内容
531
+				.item-info {
532
+					.info-item {
533
+						display: flex;
534
+						align-items: center;
535
+						justify-content: space-between;
536
+						margin: 25rpx 0;
537
+						font-size: 25rpx;
538
+						.left {
539
+							display: flex;
540
+							align-items: center;
541
+							& > view:first-child {
542
+								min-width: 120rpx;
543
+								text-align: right;
544
+								margin-right: 30rpx;
545
+							}
546
+						}
547
+						.right.price {
548
+							color: #D91F1E;
549
+							font-weight: bold;
550
+						}
551
+						.right.btn {
552
+							background: #4D85F4;
553
+							color: #fff;
554
+							padding: 6rpx 17rpx;
555
+							border-radius: 12rpx;
556
+							font-size: 20rpx;
557
+							white-space: nowrap;
558
+						}
559
+					}
560
+				}
561
+			}
562
+
563
+		.dian {
564
+			width: 18rpx;
565
+			height: 18rpx;
566
+			border-radius: 100%;
567
+			background-color: #248df9;
568
+			display: inline-block;
569
+			vertical-align: middle;
570
+			margin-right: 10px;
571
+		}
572
+
573
+		.cate {
574
+			margin: 20rpx;
575
+
576
+			.cate_class {
577
+				width: 100%;
578
+				height: 80rpx;
579
+				line-height: 80rpx;
580
+				font-size: 30rpx;
581
+				color: #3A3C3D;
582
+				border-top-left-radius: 30rpx;
583
+				border-top-right-radius: 30rpx;
584
+				background-color: #fff;
585
+				border-bottom: 1rpx solid #F1F1F1;
586
+				padding-left: 15rpx;
587
+				font-weight: bold;
588
+			}
589
+		}
590
+
591
+		.tab_box {
592
+			margin-bottom: 40rpx;
593
+		}
594
+
595
+		.desc {
596
+			font-size: 28rpx;
597
+			@include ComponWidth;
598
+			padding: 20rpx 40rpx;
599
+
600
+			.d_title {
601
+				margin-bottom: 20rpx;
602
+				color: #3A3C3D;
603
+				font-size: 32rpx;
604
+				font-weight: 400;
605
+			}
606
+
607
+			.desc_info {
608
+				line-height: 40rpx;
609
+				color: #8E9499;
610
+
611
+				.txt {
612
+					@include multipleRows(7);
613
+				}
614
+
615
+				.notxt {
616
+					text-align: center;
617
+
618
+					.img_txt {
619
+						width: 318rpx;
620
+						height: 124rpx;
621
+						margin: 40rpx auto;
622
+
623
+						image {
624
+							width: 318rpx;
625
+							height: 124rpx;
626
+						}
627
+					}
628
+
629
+					.nomore_txt {}
630
+				}
631
+			}
632
+		}
633
+
634
+		.fix_btm_btn {
635
+			@include ComponWidth;
636
+			background-color: #fff;
637
+			font-size: 28rpx;
638
+			height: 140rpx;
639
+			line-height: 140rpx;
640
+			text-align: center;
641
+			color: #4D85F4;
642
+			position: fixed;
643
+			left: 0;
644
+			bottom: 0;
645
+		}
646
+
647
+		.list_box {
648
+			@include ComponWidth;
649
+			padding-bottom: 140rpx;
650
+			// height: calc(100vh - 360rpx );
651
+			overflow: auto;
652
+
653
+			.l_title {
654
+				font-size: 28rpx;
655
+				color: #3A3C3D;
656
+				font-weight: bold;
657
+				padding: 20rpx;
658
+				max-width: 600rpx;
659
+				@include multipleRows(3);
660
+
661
+			}
662
+
663
+			.del {
664
+				font-size: 28rpx;
665
+				color: #CACBCC;
666
+				font-weight: bold;
667
+				padding: 20rpx;
668
+				max-width: 600rpx;
669
+				@include multipleRows(3);
670
+				text-decoration: line-through;
671
+			}
672
+
673
+			.item_content {
674
+				width: 100%;
675
+				height: 100%;
676
+				padding: 10rpx 40rpx;
677
+
678
+				.ql {
679
+					width: 100%;
680
+					height: 100%;
681
+
682
+					.son_item {
683
+						width: 100%;
684
+						height: 100%;
685
+
686
+						.coll_item {
687
+							// border-top: 1rpx solid #eee;
688
+						}
689
+
690
+						.onsite {
691
+							text-indent: 2em;
692
+							padding: 10rpx;
693
+							font-size: 24rpx;
694
+							color: #3A3C3D;
695
+							height: auto;
696
+						}
697
+					}
698
+				}
699
+			}
700
+		}
701
+	}
702
+
703
+.item_child_box {
704
+		.item_title {
705
+			font-weight: bold;
706
+			font-size: 28rpx;
707
+			padding: 20rpx 0
708
+		}
709
+
710
+		.child_item_title {
711
+			font-size: 25rpx;
712
+			padding: 20rpx 0;
713
+			color: #000;
714
+		}
715
+	}
716
+</style>

+ 14
- 1
components/index/mechanism.vue View File

@@ -69,7 +69,12 @@
69 69
 								<u-icon name="clock" color="#909399" size="14"></u-icon>
70 70
 								<text>周一至周五 {{ item.start_time }}-{{ item.end_time }}</text>
71 71
 							</view>
72
-							<view v-if="!isDetails" class="details_btn" @click="showDesc( item )">
72
+							<!-- 定点药店 -->
73
+							<view v-if="item.cate_id === 3 && !isDetails" class="details_btn" @click.stop="queryMedicine( item )">
74
+								药品查询
75
+							</view>
76
+							
77
+							<view v-if="!isDetails" class="details_btn" @click.stop="showDesc( item )">
73 78
 								查看详情
74 79
 							</view>
75 80
 						</view>
@@ -248,6 +253,14 @@
248 253
 					})
249 254
 				}
250 255
 			},
256
+			
257
+			// 药品查询
258
+			queryMedicine (item) {
259
+				console.log("item---", item);
260
+				uni.navigateTo({
261
+					url: `/pages/index/queryMedicine?id=${ item.id }`
262
+				})
263
+			},
251 264
 
252 265
 			// 点击出现弹窗
253 266
 			showDesc(item) {

+ 18
- 0
pages.json View File

@@ -29,6 +29,24 @@
29 29
                 "navigationBarTextStyle": "white"
30 30
             }
31 31
         },
32
+		{
33
+		    "path": "pages/index/queryMedicine",
34
+		    "style": {
35
+		        "navigationBarTitleText": "药品比价",
36
+		        "enablePullDownRefresh": true,
37
+		        "navigationBarBackgroundColor": "#ffffff",
38
+		        "navigationBarTextStyle": "black"
39
+		    }
40
+		},
41
+		{
42
+		    "path": "pages/index/sale",
43
+		    "style": {
44
+		        "navigationBarTitleText": "药品比价",
45
+		        "enablePullDownRefresh": true,
46
+		        "navigationBarBackgroundColor": "#ffffff",
47
+		        "navigationBarTextStyle": "black"
48
+		    }
49
+		},
32 50
         {
33 51
             "path": "pages/index/Make",
34 52
             "style": {

+ 6
- 0
pages/index/MeCate.vue View File

@@ -96,6 +96,10 @@
96 96
 			</view>
97 97
 		</view>
98 98
 
99
+		<!-- 定点药店 -->
100
+		<view class="cate" v-else-if="info.cate_id == 3">
101
+			<Sale></Sale>
102
+		</view>
99 103
 		<view class="desc" v-else>
100 104
 			<view class="desc_info">
101 105
 				<view class="txt" v-if="info.desc">
@@ -130,6 +134,7 @@
130 134
 	} from "../../assets/api/common.js"
131 135
 	import Mechanism from "../../components/index/mechanism.vue"
132 136
 	// import levelLinkage from "@/components/three-level-linkage/linkage.nvue"
137
+	import Sale from "@/components/index/Sale.vue"
133 138
 	import LoadModal from "../../components/index/LoadModal.vue"
134 139
 	export default {
135 140
 		data() {
@@ -168,6 +173,7 @@
168 173
 		components: {
169 174
 			Mechanism,
170 175
 			// levelLinkage,
176
+			Sale,
171 177
 			LoadModal,
172 178
 		},
173 179
 		onLoad(e) {

+ 628
- 0
pages/index/queryMedicine.vue View File

@@ -0,0 +1,628 @@
1
+<template>
2
+	<view class="query-medicine">
3
+		<!-- <view class="info" v-if="info && info.id">
4
+			<Mechanism :item="info" :showBtns="false" :isDetails="true" :showY="false" :canClick="false"></Mechanism>
5
+		</view> -->
6
+		<view class="query-header">
7
+			<view class="position">
8
+				郑州
9
+			</view>
10
+			<view class="medicine-search">
11
+				<u-icon class="search_icon" @click="focus" size="25" name="search"></u-icon>
12
+				<input type="search" @confirm="focus" confirm-type="search" v-model="keyword" class="search" placeholder="输入药品名称查询">
13
+				</input>
14
+			</view>
15
+		</view>
16
+		<Sale></Sale>
17
+		<LoadModal v-if="loading"></LoadModal>
18
+	</view>
19
+</template>
20
+
21
+<script>
22
+	import {
23
+		mapGetters
24
+	} from "vuex"
25
+	import {
26
+		getMechanismInfoById,
27
+		getCateById,
28
+		GetServeCateListForMid,
29
+		getHospJyzb
30
+	} from "../../assets/api/mechanism.js"
31
+	import {
32
+		GetTreeData
33
+	} from "../../assets/api/common.js"
34
+	import Mechanism from "../../components/index/mechanism.vue"
35
+	// import levelLinkage from "@/components/three-level-linkage/linkage.nvue"
36
+	import Sale from "@/components/index/Sale.vue"
37
+	import LoadModal from "../../components/index/LoadModal.vue"
38
+	export default {
39
+		data() {
40
+			return {
41
+				posData: [{
42
+						label: "简介",
43
+						value: 0
44
+					},
45
+					{
46
+						label: "办理事项",
47
+						value: 1
48
+					},
49
+					{
50
+						label: "就医指标概况",
51
+						value: 2
52
+					},
53
+				],
54
+				id: null,
55
+				info: {},
56
+				collList: [],
57
+				collItemList: [],
58
+				pickerValueDefault: [0],
59
+				treeData: [],
60
+				cateList: [],
61
+				sonIndex: "",
62
+				cateInfo: {},
63
+				opend: true,
64
+				loading: false,
65
+
66
+				tabList: ["简介", "参保登记类"],
67
+				TabCur: 0,
68
+				meCode : "",
69
+				hospJyzb: {}
70
+			}
71
+		},
72
+		components: {
73
+			Mechanism,
74
+			// levelLinkage,
75
+			Sale,
76
+			LoadModal,
77
+		},
78
+		onLoad(e) {
79
+			Object.assign(this, e)
80
+			console.log("this", this)
81
+			let {
82
+				id
83
+			} = this
84
+			if (id) {
85
+				this.getInfo()
86
+			}
87
+
88
+
89
+		},
90
+		computed: {
91
+			...mapGetters([]),
92
+			cateId() {
93
+				return this.info.cate_id
94
+			},
95
+			isShowCate() {
96
+				return this.cateId == 2 || this.cateId == 4 || this.cateId == 6
97
+			},
98
+
99
+			filterPosData() {
100
+				let arr = JSON.parse(JSON.stringify(this.posData));
101
+				// 办理事项是空也显示
102
+				// if (!this.collList) {
103
+				// 	arr = arr.filter(item => item.value != 1)
104
+				// }
105
+				if (!this.hosFit) {
106
+					arr = arr.filter(item => item.value != 2)
107
+				}
108
+				console.log("arr", arr)
109
+				return arr;
110
+			},
111
+
112
+			hosFit0() {
113
+				if (this.info && this.info.hosInfo) {
114
+					const obj = JSON.parse(this.info.hosInfo);
115
+					console.log("obj", obj)
116
+					let newArr = [{
117
+							label: "人次:",
118
+							value: obj.person
119
+						},
120
+						{
121
+							label: "次均费用:",
122
+							value: obj.money
123
+						},
124
+						{
125
+							label: "报销率:",
126
+							value: obj.rate ? obj.rate + '%' : ''
127
+						},
128
+						{
129
+							label: "平均住院天数:",
130
+							value: obj.count ? obj.count + '天' : ''
131
+						}
132
+					];
133
+					console.log("newArr", newArr)
134
+					return newArr;
135
+				} else {
136
+					return null;
137
+				}
138
+
139
+			},
140
+
141
+			hosFit() {
142
+				if (this.hospJyzb && this.hospJyzb.rc) {
143
+					let newArr = [{
144
+							label: "人次:",
145
+							value: this.hospJyzb.rc
146
+						},
147
+						{
148
+							label: "次均费用:",
149
+							value: this.hospJyzb.cjfy
150
+						},
151
+						{
152
+							label: "报销率:",
153
+							value: this.hospJyzb.bxbl ? this.hospJyzb.bxbl*100 + '%' : ''
154
+						},
155
+						{
156
+							label: "平均住院天数:",
157
+							value: this.hospJyzb.pjzyts ? this.hospJyzb.pjzyts + '天' : ''
158
+						}
159
+					];
160
+					console.log("newArr", newArr)
161
+					return newArr;
162
+				} else {
163
+					return null;
164
+				}
165
+
166
+			}
167
+		},
168
+
169
+		watch: {
170
+			treeData() {
171
+
172
+				if (!this.opend && this.treeData && this.treeData.length && this.isShowCate) {
173
+					setTimeout(() => {
174
+						this.loading = false
175
+						this.GetServeCateListHandle()
176
+					}, 200)
177
+				}
178
+			},
179
+			loading() {
180
+				console.log(this.loading);
181
+			},
182
+
183
+		},
184
+		onPullDownRefresh() {
185
+			this.getInfo()
186
+			setTimeout(() => {
187
+				uni.stopPullDownRefresh()
188
+			}, 500)
189
+		},
190
+		methods: {
191
+			
192
+			// 查看在售
193
+			viewSale () {
194
+				uni.navigateTo({
195
+					url: `/pages/index/sale?id=111`
196
+				})
197
+			},
198
+			
199
+			/**
200
+			 * @name input获取焦点
201
+			 */
202
+			focus() {
203
+				let {
204
+					latitude,
205
+					longitude
206
+				} = this.position
207
+				if (!this.isSearchPage && latitude && longitude) {
208
+					alert('查询')
209
+					// this.$emit("searchHandle", this.keyword)
210
+					// uni.navigateTo({
211
+					// 	url:"/pages/index/search"
212
+					// })
213
+				}
214
+			},
215
+			async goInformation(item) {
216
+				console.log("item", item)
217
+				console.log("this.info", this.info.name)
218
+				let name = JSON.stringify(this.info.name);
219
+				let subName = JSON.stringify(item.label);
220
+				let info = JSON.stringify(this.info);
221
+				uni.navigateTo({
222
+					url: `/pages/index/Make?mid=${this.id}&id=${item.value}&name=${encodeURIComponent(name)}&subName=${encodeURIComponent(subName)}&info=${encodeURIComponent(info)}`
223
+				})
224
+			},
225
+			// 查看机构提供服务事项列表
226
+			async GetServeCateListHandle() {
227
+				let res = await GetServeCateListForMid({
228
+					id: this.info.id
229
+				})
230
+				console.log('res--2222222222--', res);
231
+				if (res.data.code == 1) {
232
+					this.collList = res.data.data[0]?.children;
233
+					console.log('this.collList----', this.collList)
234
+				}
235
+			},
236
+
237
+			tabSelect(index) {
238
+				console.log(index);
239
+				this.TabCur = index
240
+			},
241
+
242
+			/**
243
+			 * @name 获取数据
244
+			 */
245
+			async getList() {
246
+				this.loading = true
247
+				this.treeData = []
248
+				let res = await GetTreeData({})
249
+				console.log('res----', res);
250
+				if (res.data.code == 1) {
251
+					this.cateList = res.data.data
252
+					this.treeData = this.filterTreeData(0)
253
+					this.loading = false
254
+					this.opend = false
255
+
256
+				}
257
+
258
+			},
259
+
260
+			/**
261
+			 * @param {Object} 获取分类信息
262
+			 */
263
+			async getCate(id) {
264
+				this.cateInfo = {}
265
+				let res = await getCateById({
266
+					id
267
+				})
268
+				if (res.data.code == 1) {
269
+					this.cateInfo = res.data.data
270
+					console.log(this.cateInfo);
271
+					this.getList()
272
+				}
273
+			},
274
+						
275
+			/**
276
+			 * @param {Object} 获取定点医院就医指标数据
277
+			 */
278
+			async getHospJyzb(code) {
279
+				if(code == '' || code == this.meCode) {
280
+					return;
281
+				}
282
+				this.meCode = code;
283
+				this.hospJyzb = {};
284
+				let res = await getHospJyzb({
285
+					query_id: "41072",
286
+					stt_f: code
287
+				})
288
+				if (res.data.success && res.data.data.length > 0) {
289
+					this.hospJyzb = res.data.data[0];
290
+					console.log(this.hospJyzb);
291
+				}
292
+			},
293
+
294
+			// 处理children为null
295
+			handleChilren(arr) {
296
+				// console.log("start");
297
+				let Tag = this.cateInfo.tag_code
298
+				// console.log(Tag);
299
+				let list = []
300
+				if (arr && arr.length) {
301
+					for (var i = 0; i < arr.length; i++) {
302
+						let el = arr[i]
303
+						let reg = new RegExp(`${Tag}`)
304
+						let HasCode = true
305
+						// console.log(!HasCode);
306
+						if (el.org) {
307
+							HasCode = reg.test(el.org)
308
+						}
309
+						let obj = {
310
+							id: el.ID,
311
+							name: el.name,
312
+							children: el.children ?? [],
313
+							onsite: el.onsite,
314
+							online: el.online,
315
+							dis: !HasCode
316
+						}
317
+						list.push(obj)
318
+					}
319
+				}
320
+				// console.log( list );
321
+				return list
322
+			},
323
+
324
+			// 过滤数据
325
+			filterTreeData(fid) {
326
+				let {
327
+					cateList
328
+				} = this
329
+				let data = []
330
+				if (cateList && cateList.length && fid >= 0) {
331
+					cateList.forEach(el => {
332
+						if (el.fid == fid) {
333
+
334
+							data.push(el)
335
+						}
336
+					})
337
+				}
338
+				// console.log(data);
339
+				return this.handleChilren(data)
340
+			},
341
+
342
+			open() {
343
+				// this.$refs.levelLinkage.open();
344
+				this.opend = true
345
+			},
346
+			onConfirm(e) {
347
+				this.collList = []
348
+				this.collItemList = []
349
+				let {
350
+					value
351
+				} = e
352
+				let index = value[0]
353
+				let fd = this.treeData[index]
354
+
355
+				this.collList = this.filterTreeData(fd.id)
356
+			},
357
+
358
+			/**
359
+			 * @name 折叠面板变化
360
+			 */
361
+			collChange(index) {
362
+				let self = this
363
+				try {
364
+					// console.log( index );
365
+					let {
366
+						id
367
+					} = self.collList[index]
368
+					self.collItemList = self.filterTreeData(id)
369
+					// console.log(self.collItemList);
370
+				} catch (e) {
371
+					// throw(e)
372
+				}
373
+			},
374
+
375
+			collSunChange() {
376
+
377
+			},
378
+
379
+			/**
380
+			 * @name 点击取消
381
+			 */
382
+			back() {
383
+				uni.navigateBack({
384
+
385
+				})
386
+			},
387
+
388
+
389
+
390
+			/**
391
+			 * @name 获取机构详情
392
+			 */
393
+			async getInfo() {
394
+				let {
395
+					id
396
+				} = this
397
+				let res = await getMechanismInfoById({
398
+					id: Number(id)
399
+				})
400
+				if (res.data.code == 1) {
401
+					console.log('000---000', res)
402
+					this.info = res.data.data
403
+					if (this.info) {
404
+						this.info.start_time = this.info.start_time ? this.info.start_time : "9:00"
405
+						this.info.end_time = this.info.end_time ? this.info.end_time : "17:00"
406
+						// console.log( this.info.cate_id );
407
+						this.getCate(this.info.cate_id)
408
+						if(this.info.cate_id == 2 && this.info.me_code) {
409
+							this.getHospJyzb(this.info.me_code)
410
+						}
411
+					}
412
+				}
413
+			},
414
+
415
+
416
+
417
+		},
418
+	}
419
+</script>
420
+
421
+<style>
422
+	page {
423
+		background-color: #fff;
424
+	}
425
+	.uni-collapse-item {
426
+		border-bottom: 1rpx solid #F1F1F1;
427
+	}
428
+	.item_content {
429
+		border-top: 1rpx solid #F1F1F1;
430
+	}
431
+	.child_item_title_2 {
432
+		font-size: 26rpx;
433
+		/* font-weight: bold; */
434
+		padding: 50rpx 0;
435
+		display: flex;
436
+		align-items: center;
437
+		border-bottom: 1rpx solid #F1F1F1;
438
+	}
439
+	.son_item .coll_item:last-child .child_item_title_2 {
440
+		border-bottom: none;
441
+	}
442
+</style>
443
+
444
+<style lang="scss" scoped>
445
+	.query-medicine {
446
+		@include ComponWidth;
447
+		background: #eee;
448
+		height: 100vh;
449
+		padding: 30rpx;
450
+		.query-header {
451
+			display: flex;
452
+			align-items: center;
453
+			justify-content: space-between;
454
+			.position {
455
+				flex: 1;
456
+				margin-right: 20px;
457
+			}
458
+			.medicine-search {
459
+				flex: 8;
460
+				background-color: #fff;
461
+				border-radius: 50rpx;
462
+				display: flex;
463
+				align-items: center;
464
+				overflow: hidden;
465
+				padding-right: 20rpx;
466
+				padding: 0 30rpx;
467
+				input {
468
+					font-size: 15px;
469
+					height: 60rpx;
470
+					border-radius: 50rpx;
471
+					// padding-left: 30rpx;
472
+				}
473
+			}
474
+		}
475
+		.dian {
476
+			width: 18rpx;
477
+			height: 18rpx;
478
+			border-radius: 100%;
479
+			background-color: #248df9;
480
+			display: inline-block;
481
+			vertical-align: middle;
482
+			margin-right: 10px;
483
+		}
484
+
485
+		.cate {
486
+			margin: 20rpx;
487
+
488
+			.cate_class {
489
+				width: 100%;
490
+				height: 80rpx;
491
+				line-height: 80rpx;
492
+				font-size: 30rpx;
493
+				color: #3A3C3D;
494
+				border-top-left-radius: 30rpx;
495
+				border-top-right-radius: 30rpx;
496
+				background-color: #fff;
497
+				border-bottom: 1rpx solid #F1F1F1;
498
+				padding-left: 15rpx;
499
+				font-weight: bold;
500
+			}
501
+		}
502
+
503
+		.tab_box {
504
+			margin-bottom: 40rpx;
505
+		}
506
+
507
+		.desc {
508
+			font-size: 28rpx;
509
+			@include ComponWidth;
510
+			padding: 20rpx 40rpx;
511
+
512
+			.d_title {
513
+				margin-bottom: 20rpx;
514
+				color: #3A3C3D;
515
+				font-size: 32rpx;
516
+				font-weight: 400;
517
+			}
518
+
519
+			.desc_info {
520
+				line-height: 40rpx;
521
+				color: #8E9499;
522
+
523
+				.txt {
524
+					@include multipleRows(7);
525
+				}
526
+
527
+				.notxt {
528
+					text-align: center;
529
+
530
+					.img_txt {
531
+						width: 318rpx;
532
+						height: 124rpx;
533
+						margin: 40rpx auto;
534
+
535
+						image {
536
+							width: 318rpx;
537
+							height: 124rpx;
538
+						}
539
+					}
540
+
541
+					.nomore_txt {}
542
+				}
543
+			}
544
+		}
545
+
546
+		.fix_btm_btn {
547
+			@include ComponWidth;
548
+			background-color: #fff;
549
+			font-size: 28rpx;
550
+			height: 140rpx;
551
+			line-height: 140rpx;
552
+			text-align: center;
553
+			color: #4D85F4;
554
+			position: fixed;
555
+			left: 0;
556
+			bottom: 0;
557
+		}
558
+
559
+		.list_box {
560
+			@include ComponWidth;
561
+			padding-bottom: 140rpx;
562
+			// height: calc(100vh - 360rpx );
563
+			overflow: auto;
564
+
565
+			.l_title {
566
+				font-size: 28rpx;
567
+				color: #3A3C3D;
568
+				font-weight: bold;
569
+				padding: 20rpx;
570
+				max-width: 600rpx;
571
+				@include multipleRows(3);
572
+
573
+			}
574
+
575
+			.del {
576
+				font-size: 28rpx;
577
+				color: #CACBCC;
578
+				font-weight: bold;
579
+				padding: 20rpx;
580
+				max-width: 600rpx;
581
+				@include multipleRows(3);
582
+				text-decoration: line-through;
583
+			}
584
+
585
+			.item_content {
586
+				width: 100%;
587
+				height: 100%;
588
+				padding: 10rpx 40rpx;
589
+
590
+				.ql {
591
+					width: 100%;
592
+					height: 100%;
593
+
594
+					.son_item {
595
+						width: 100%;
596
+						height: 100%;
597
+
598
+						.coll_item {
599
+							// border-top: 1rpx solid #eee;
600
+						}
601
+
602
+						.onsite {
603
+							text-indent: 2em;
604
+							padding: 10rpx;
605
+							font-size: 24rpx;
606
+							color: #3A3C3D;
607
+							height: auto;
608
+						}
609
+					}
610
+				}
611
+			}
612
+		}
613
+	}
614
+
615
+.item_child_box {
616
+		.item_title {
617
+			font-weight: bold;
618
+			font-size: 28rpx;
619
+			padding: 20rpx 0
620
+		}
621
+
622
+		.child_item_title {
623
+			font-size: 25rpx;
624
+			padding: 20rpx 0;
625
+			color: #000;
626
+		}
627
+	}
628
+</style>

+ 846
- 0
pages/index/sale.vue View File

@@ -0,0 +1,846 @@
1
+<template>
2
+	<view class="query-medicine">
3
+		<!-- <view class="info" v-if="info && info.id">
4
+			<Mechanism :item="info" :showBtns="false" :isDetails="true" :showY="false" :canClick="false"></Mechanism>
5
+		</view> -->
6
+	
7
+		<Sale isDetails></Sale>
8
+		<view class="query-header">
9
+			<view class="position">
10
+				郑州
11
+			</view>
12
+			<view class="medicine-search">
13
+				<u-icon class="search_icon" @click="focus" size="25" name="search"></u-icon>
14
+				<input type="search" @confirm="focus" confirm-type="search" v-model="keyword" class="search" placeholder="输入药品名称查询">
15
+				</input>
16
+			</view>
17
+		</view>
18
+		
19
+		<view class="filter-element-box">
20
+			<view class="filter-element">
21
+				<view class="filter-type" :class="item.type === filterActive ? 'active' : ''" v-for="(item, index) of filterOptions" :key="index" @click.stop="fiterHandle(item, index)">
22
+					{{ item.name }}
23
+				</view>
24
+			</view>
25
+			<view class="select-element">
26
+				<uni-data-select
27
+				placeholder="距离筛选"
28
+				        v-model="value"
29
+				        :localdata="range"
30
+				        @change="change"
31
+				      ></uni-data-select>
32
+			</view>
33
+		</view>
34
+		
35
+		<Sale isDetails isSale>
36
+			<view class="query-list">
37
+				<view class="list-item">
38
+					<view class="item-title">
39
+						<view class="title-name">
40
+							<view class="">
41
+								河南张仲景大药房股份有限公司郑州石门路店
42
+							</view>
43
+							<view v-show="false" class=""></view>
44
+						</view>
45
+						<view class="other-price details">
46
+							¥16.90
47
+						</view>
48
+					</view>
49
+					<view class="item-info">
50
+						
51
+						
52
+						<view class="info-item">
53
+							<view class="left">
54
+								<view>地址:</view>
55
+								郑州市二七区丹心路7号1层附4号房
56
+								</view>
57
+						</view>
58
+						<view class="info-item">
59
+							<view class="left">
60
+								<view>距离:</view>
61
+								<view style="color: #4D85F4;">
62
+									312米
63
+								</view>
64
+							</view>
65
+						</view>
66
+						
67
+						<view class="info-item">
68
+							<view class="left">
69
+								<view>比价:</view>
70
+								<view style="color: #D91F1E;font-weight: bold;">
71
+									<text style="">高于最低价</text>
72
+									8.00元
73
+								</view>
74
+							</view>
75
+						</view>
76
+						
77
+						<view class="info-item">
78
+							<view class="tags">
79
+								<view class="tag">定点药店购药</view>
80
+								<view class="tag">异地门诊</view>
81
+							</view>
82
+						</view>
83
+						<view class="info-item">
84
+							<view class="left">
85
+								<view>联系电话</view>
86
+							</view>
87
+							<view class="right">
88
+								一键导航
89
+							</view>
90
+						</view>
91
+					</view>
92
+				</view>
93
+			</view>
94
+		</Sale>
95
+		<LoadModal v-if="loading"></LoadModal>
96
+	</view>
97
+</template>
98
+
99
+<script>
100
+	import {
101
+		mapGetters
102
+	} from "vuex"
103
+	import {
104
+		getMechanismInfoById,
105
+		getCateById,
106
+		GetServeCateListForMid,
107
+		getHospJyzb
108
+	} from "../../assets/api/mechanism.js"
109
+	import {
110
+		GetTreeData
111
+	} from "../../assets/api/common.js"
112
+	import Mechanism from "../../components/index/mechanism.vue"
113
+	import Sale from "@/components/index/Sale.vue"
114
+	import LoadModal from "../../components/index/LoadModal.vue"
115
+	export default {
116
+		data() {
117
+			return {
118
+				value: undefined,
119
+				        range: [
120
+				          { value: 0, text: "1" },
121
+				          { value: 1, text: "2" },
122
+				          { value: 2, text: "3" },
123
+				        ],
124
+				filterActive: 1,
125
+				filterOptions: [
126
+					{
127
+						type: 1,
128
+						name: "价格优先"
129
+					},
130
+					{
131
+						type: 2,
132
+						name: "距离优先"
133
+					}
134
+				],
135
+				posData: [{
136
+						label: "简介",
137
+						value: 0
138
+					},
139
+					{
140
+						label: "办理事项",
141
+						value: 1
142
+					},
143
+					{
144
+						label: "就医指标概况",
145
+						value: 2
146
+					},
147
+				],
148
+				id: null,
149
+				info: {},
150
+				collList: [],
151
+				collItemList: [],
152
+				pickerValueDefault: [0],
153
+				treeData: [],
154
+				cateList: [],
155
+				sonIndex: "",
156
+				cateInfo: {},
157
+				opend: true,
158
+				loading: false,
159
+
160
+				tabList: ["简介", "参保登记类"],
161
+				TabCur: 0,
162
+				meCode : "",
163
+				hospJyzb: {}
164
+			}
165
+		},
166
+		components: {
167
+			Mechanism,
168
+			Sale,
169
+			LoadModal,
170
+		},
171
+		onLoad(e) {
172
+			Object.assign(this, e)
173
+			console.log("this", this)
174
+			let {
175
+				id
176
+			} = this
177
+			if (id) {
178
+				this.getInfo()
179
+			}
180
+
181
+
182
+		},
183
+		computed: {
184
+			...mapGetters([]),
185
+			cateId() {
186
+				return this.info.cate_id
187
+			},
188
+			isShowCate() {
189
+				return this.cateId == 2 || this.cateId == 4 || this.cateId == 6
190
+			},
191
+
192
+			filterPosData() {
193
+				let arr = JSON.parse(JSON.stringify(this.posData));
194
+				// 办理事项是空也显示
195
+				// if (!this.collList) {
196
+				// 	arr = arr.filter(item => item.value != 1)
197
+				// }
198
+				if (!this.hosFit) {
199
+					arr = arr.filter(item => item.value != 2)
200
+				}
201
+				console.log("arr", arr)
202
+				return arr;
203
+			},
204
+
205
+			hosFit0() {
206
+				if (this.info && this.info.hosInfo) {
207
+					const obj = JSON.parse(this.info.hosInfo);
208
+					console.log("obj", obj)
209
+					let newArr = [{
210
+							label: "人次:",
211
+							value: obj.person
212
+						},
213
+						{
214
+							label: "次均费用:",
215
+							value: obj.money
216
+						},
217
+						{
218
+							label: "报销率:",
219
+							value: obj.rate ? obj.rate + '%' : ''
220
+						},
221
+						{
222
+							label: "平均住院天数:",
223
+							value: obj.count ? obj.count + '天' : ''
224
+						}
225
+					];
226
+					console.log("newArr", newArr)
227
+					return newArr;
228
+				} else {
229
+					return null;
230
+				}
231
+
232
+			},
233
+
234
+			hosFit() {
235
+				if (this.hospJyzb && this.hospJyzb.rc) {
236
+					let newArr = [{
237
+							label: "人次:",
238
+							value: this.hospJyzb.rc
239
+						},
240
+						{
241
+							label: "次均费用:",
242
+							value: this.hospJyzb.cjfy
243
+						},
244
+						{
245
+							label: "报销率:",
246
+							value: this.hospJyzb.bxbl ? this.hospJyzb.bxbl*100 + '%' : ''
247
+						},
248
+						{
249
+							label: "平均住院天数:",
250
+							value: this.hospJyzb.pjzyts ? this.hospJyzb.pjzyts + '天' : ''
251
+						}
252
+					];
253
+					console.log("newArr", newArr)
254
+					return newArr;
255
+				} else {
256
+					return null;
257
+				}
258
+
259
+			}
260
+		},
261
+
262
+		watch: {
263
+			treeData() {
264
+
265
+				if (!this.opend && this.treeData && this.treeData.length && this.isShowCate) {
266
+					setTimeout(() => {
267
+						this.loading = false
268
+						this.GetServeCateListHandle()
269
+					}, 200)
270
+				}
271
+			},
272
+			loading() {
273
+				console.log(this.loading);
274
+			},
275
+
276
+		},
277
+		onPullDownRefresh() {
278
+			this.getInfo()
279
+			setTimeout(() => {
280
+				uni.stopPullDownRefresh()
281
+			}, 500)
282
+		},
283
+		methods: {
284
+			
285
+			change(e) {
286
+			        console.log("e:", e);
287
+			      },
288
+			
289
+			fiterHandle (item, index) {
290
+				this.filterActive = item.type
291
+			},
292
+			
293
+			// 查看在售
294
+			viewSale () {
295
+				
296
+			},
297
+			
298
+			/**
299
+			 * @name input获取焦点
300
+			 */
301
+			focus() {
302
+				let {
303
+					latitude,
304
+					longitude
305
+				} = this.position
306
+				if (!this.isSearchPage && latitude && longitude) {
307
+					alert('查询')
308
+					// this.$emit("searchHandle", this.keyword)
309
+					// uni.navigateTo({
310
+					// 	url:"/pages/index/search"
311
+					// })
312
+				}
313
+			},
314
+			async goInformation(item) {
315
+				console.log("item", item)
316
+				console.log("this.info", this.info.name)
317
+				let name = JSON.stringify(this.info.name);
318
+				let subName = JSON.stringify(item.label);
319
+				let info = JSON.stringify(this.info);
320
+				uni.navigateTo({
321
+					url: `/pages/index/Make?mid=${this.id}&id=${item.value}&name=${encodeURIComponent(name)}&subName=${encodeURIComponent(subName)}&info=${encodeURIComponent(info)}`
322
+				})
323
+			},
324
+			// 查看机构提供服务事项列表
325
+			async GetServeCateListHandle() {
326
+				let res = await GetServeCateListForMid({
327
+					id: this.info.id
328
+				})
329
+				console.log('res--2222222222--', res);
330
+				if (res.data.code == 1) {
331
+					this.collList = res.data.data[0]?.children;
332
+					console.log('this.collList----', this.collList)
333
+				}
334
+			},
335
+
336
+			tabSelect(index) {
337
+				console.log(index);
338
+				this.TabCur = index
339
+			},
340
+
341
+			/**
342
+			 * @name 获取数据
343
+			 */
344
+			async getList() {
345
+				this.loading = true
346
+				this.treeData = []
347
+				let res = await GetTreeData({})
348
+				console.log('res----', res);
349
+				if (res.data.code == 1) {
350
+					this.cateList = res.data.data
351
+					this.treeData = this.filterTreeData(0)
352
+					this.loading = false
353
+					this.opend = false
354
+
355
+				}
356
+
357
+			},
358
+
359
+			/**
360
+			 * @param {Object} 获取分类信息
361
+			 */
362
+			async getCate(id) {
363
+				this.cateInfo = {}
364
+				let res = await getCateById({
365
+					id
366
+				})
367
+				if (res.data.code == 1) {
368
+					this.cateInfo = res.data.data
369
+					console.log(this.cateInfo);
370
+					this.getList()
371
+				}
372
+			},
373
+						
374
+			/**
375
+			 * @param {Object} 获取定点医院就医指标数据
376
+			 */
377
+			async getHospJyzb(code) {
378
+				if(code == '' || code == this.meCode) {
379
+					return;
380
+				}
381
+				this.meCode = code;
382
+				this.hospJyzb = {};
383
+				let res = await getHospJyzb({
384
+					query_id: "41072",
385
+					stt_f: code
386
+				})
387
+				if (res.data.success && res.data.data.length > 0) {
388
+					this.hospJyzb = res.data.data[0];
389
+					console.log(this.hospJyzb);
390
+				}
391
+			},
392
+
393
+			// 处理children为null
394
+			handleChilren(arr) {
395
+				// console.log("start");
396
+				let Tag = this.cateInfo.tag_code
397
+				// console.log(Tag);
398
+				let list = []
399
+				if (arr && arr.length) {
400
+					for (var i = 0; i < arr.length; i++) {
401
+						let el = arr[i]
402
+						let reg = new RegExp(`${Tag}`)
403
+						let HasCode = true
404
+						// console.log(!HasCode);
405
+						if (el.org) {
406
+							HasCode = reg.test(el.org)
407
+						}
408
+						let obj = {
409
+							id: el.ID,
410
+							name: el.name,
411
+							children: el.children ?? [],
412
+							onsite: el.onsite,
413
+							online: el.online,
414
+							dis: !HasCode
415
+						}
416
+						list.push(obj)
417
+					}
418
+				}
419
+				// console.log( list );
420
+				return list
421
+			},
422
+
423
+			// 过滤数据
424
+			filterTreeData(fid) {
425
+				let {
426
+					cateList
427
+				} = this
428
+				let data = []
429
+				if (cateList && cateList.length && fid >= 0) {
430
+					cateList.forEach(el => {
431
+						if (el.fid == fid) {
432
+
433
+							data.push(el)
434
+						}
435
+					})
436
+				}
437
+				// console.log(data);
438
+				return this.handleChilren(data)
439
+			},
440
+
441
+			open() {
442
+				// this.$refs.levelLinkage.open();
443
+				this.opend = true
444
+			},
445
+			onConfirm(e) {
446
+				this.collList = []
447
+				this.collItemList = []
448
+				let {
449
+					value
450
+				} = e
451
+				let index = value[0]
452
+				let fd = this.treeData[index]
453
+
454
+				this.collList = this.filterTreeData(fd.id)
455
+			},
456
+
457
+			/**
458
+			 * @name 折叠面板变化
459
+			 */
460
+			collChange(index) {
461
+				let self = this
462
+				try {
463
+					// console.log( index );
464
+					let {
465
+						id
466
+					} = self.collList[index]
467
+					self.collItemList = self.filterTreeData(id)
468
+					// console.log(self.collItemList);
469
+				} catch (e) {
470
+					// throw(e)
471
+				}
472
+			},
473
+
474
+			collSunChange() {
475
+
476
+			},
477
+
478
+			/**
479
+			 * @name 点击取消
480
+			 */
481
+			back() {
482
+				uni.navigateBack({
483
+
484
+				})
485
+			},
486
+
487
+
488
+
489
+			/**
490
+			 * @name 获取机构详情
491
+			 */
492
+			async getInfo() {
493
+				let {
494
+					id
495
+				} = this
496
+				let res = await getMechanismInfoById({
497
+					id: Number(id)
498
+				})
499
+				if (res.data.code == 1) {
500
+					console.log('000---000', res)
501
+					this.info = res.data.data
502
+					if (this.info) {
503
+						this.info.start_time = this.info.start_time ? this.info.start_time : "9:00"
504
+						this.info.end_time = this.info.end_time ? this.info.end_time : "17:00"
505
+						// console.log( this.info.cate_id );
506
+						this.getCate(this.info.cate_id)
507
+						if(this.info.cate_id == 2 && this.info.me_code) {
508
+							this.getHospJyzb(this.info.me_code)
509
+						}
510
+					}
511
+				}
512
+			},
513
+
514
+
515
+
516
+		},
517
+	}
518
+</script>
519
+
520
+<style>
521
+	page {
522
+		background-color: #fff;
523
+	}
524
+	.uni-collapse-item {
525
+		border-bottom: 1rpx solid #F1F1F1;
526
+	}
527
+	.item_content {
528
+		border-top: 1rpx solid #F1F1F1;
529
+	}
530
+	.child_item_title_2 {
531
+		font-size: 26rpx;
532
+		/* font-weight: bold; */
533
+		padding: 50rpx 0;
534
+		display: flex;
535
+		align-items: center;
536
+		border-bottom: 1rpx solid #F1F1F1;
537
+	}
538
+	.son_item .coll_item:last-child .child_item_title_2 {
539
+		border-bottom: none;
540
+	}
541
+</style>
542
+
543
+<style lang="scss" scoped>
544
+	.query-medicine {
545
+		@include ComponWidth;
546
+		background: #eee;
547
+		height: 100vh;
548
+		padding: 30rpx;
549
+		.query-header {
550
+			display: flex;
551
+			align-items: center;
552
+			justify-content: space-between;
553
+			.position {
554
+				flex: 1;
555
+				margin-right: 20px;
556
+			}
557
+			.medicine-search {
558
+				flex: 8;
559
+				background-color: #fff;
560
+				border-radius: 50rpx;
561
+				display: flex;
562
+				align-items: center;
563
+				overflow: hidden;
564
+				padding-right: 20rpx;
565
+				padding: 0 30rpx;
566
+				input {
567
+					font-size: 15px;
568
+					height: 60rpx;
569
+					border-radius: 50rpx;
570
+					// padding-left: 30rpx;
571
+				}
572
+			}
573
+		}
574
+		.filter-element-box {
575
+			margin-top: 20rpx;
576
+			display: flex;
577
+			align-items: center;
578
+			justify-content: space-between;
579
+			.filter-element {
580
+				flex: 2;
581
+				display: flex;
582
+				border-radius: 5rpx;
583
+				.filter-type {
584
+				background-color: #fff;
585
+					display: flex;
586
+					padding: 0 40rpx;
587
+					white-space: nowrap;
588
+					&:first-child {
589
+						border-right: 1rpx solid #CACBCC;
590
+					}
591
+				}
592
+				.filter-type.active {
593
+					color: #4D85F4;
594
+				}
595
+				
596
+			}
597
+			.select-element {
598
+				flex: 1;
599
+				::v-deep .uni-select {
600
+					background-color: #fff;
601
+				}
602
+			}
603
+		}
604
+		
605
+		
606
+		.query-list {
607
+			margin: 30rpx 0;
608
+			.list-item {
609
+				padding: 25rpx;
610
+				background-color: #fff;
611
+				border-radius: 5rpx;
612
+				// 卡片标题
613
+				.item-title {
614
+					display: flex;
615
+					align-items: center;
616
+					justify-content: space-between;
617
+					padding-bottom: 10rpx;
618
+					border-bottom: 1rpx solid #F1F1F1;
619
+					.title-name {
620
+						display: flex;
621
+						align-items: center;
622
+						& > view:first-child {
623
+							margin-right: 18rpx;
624
+							color: #000;
625
+							font-weight: bold;
626
+							font-size: 32rpx;
627
+						}
628
+						
629
+						& > view:last-child {
630
+							color: #4186E2;
631
+							border: 1rpx solid #4186E2;
632
+							border-radius: 5rpx;
633
+							padding: 2rpx 15rpx;
634
+							font-size: 20rpx;
635
+						}
636
+					}
637
+					.other-price {
638
+						font-size: 22rpx;
639
+						&.details {
640
+							color: #D91F1E;
641
+							font-weight: bold;
642
+							font-size: 32rpx;
643
+						}
644
+					}
645
+				}
646
+				// 卡片内容
647
+				.item-info {
648
+					.info-item {
649
+						display: flex;
650
+						align-items: center;
651
+						justify-content: space-between;
652
+						margin: 25rpx 0;
653
+						font-size: 25rpx;
654
+						.tags {
655
+							display: flex;
656
+							align-items: center;
657
+							.tag {
658
+								padding: 5rpx 20rpx;
659
+								border: 1rpx solid #248df9;
660
+								color: #248df9;
661
+								border-radius: 20rpx;
662
+								margin-right: 15rpx;
663
+								font-size: 20rpx;
664
+							}
665
+						}
666
+						.left {
667
+							display: flex;
668
+							align-items: center;
669
+							& > view:first-child {
670
+								min-width: 120rpx;
671
+								text-align: right;
672
+								margin-right: 30rpx;
673
+							}
674
+						}
675
+						.right.price {
676
+							color: #D91F1E;
677
+							font-weight: bold;
678
+						}
679
+						.right.btn {
680
+							background: #4D85F4;
681
+							color: #fff;
682
+							padding: 6rpx 17rpx;
683
+							border-radius: 12rpx;
684
+							font-size: 20rpx;
685
+							white-space: nowrap;
686
+						}
687
+					}
688
+				}
689
+			}
690
+			
691
+		}
692
+
693
+		.dian {
694
+			width: 18rpx;
695
+			height: 18rpx;
696
+			border-radius: 100%;
697
+			background-color: #248df9;
698
+			display: inline-block;
699
+			vertical-align: middle;
700
+			margin-right: 10px;
701
+		}
702
+
703
+		.cate {
704
+			margin: 20rpx;
705
+
706
+			.cate_class {
707
+				width: 100%;
708
+				height: 80rpx;
709
+				line-height: 80rpx;
710
+				font-size: 30rpx;
711
+				color: #3A3C3D;
712
+				border-top-left-radius: 30rpx;
713
+				border-top-right-radius: 30rpx;
714
+				background-color: #fff;
715
+				border-bottom: 1rpx solid #F1F1F1;
716
+				padding-left: 15rpx;
717
+				font-weight: bold;
718
+			}
719
+		}
720
+
721
+		.tab_box {
722
+			margin-bottom: 40rpx;
723
+		}
724
+
725
+		.desc {
726
+			font-size: 28rpx;
727
+			@include ComponWidth;
728
+			padding: 20rpx 40rpx;
729
+
730
+			.d_title {
731
+				margin-bottom: 20rpx;
732
+				color: #3A3C3D;
733
+				font-size: 32rpx;
734
+				font-weight: 400;
735
+			}
736
+
737
+			.desc_info {
738
+				line-height: 40rpx;
739
+				color: #8E9499;
740
+
741
+				.txt {
742
+					@include multipleRows(7);
743
+				}
744
+
745
+				.notxt {
746
+					text-align: center;
747
+
748
+					.img_txt {
749
+						width: 318rpx;
750
+						height: 124rpx;
751
+						margin: 40rpx auto;
752
+
753
+						image {
754
+							width: 318rpx;
755
+							height: 124rpx;
756
+						}
757
+					}
758
+
759
+					.nomore_txt {}
760
+				}
761
+			}
762
+		}
763
+
764
+		.fix_btm_btn {
765
+			@include ComponWidth;
766
+			background-color: #fff;
767
+			font-size: 28rpx;
768
+			height: 140rpx;
769
+			line-height: 140rpx;
770
+			text-align: center;
771
+			color: #4D85F4;
772
+			position: fixed;
773
+			left: 0;
774
+			bottom: 0;
775
+		}
776
+
777
+		.list_box {
778
+			@include ComponWidth;
779
+			padding-bottom: 140rpx;
780
+			// height: calc(100vh - 360rpx );
781
+			overflow: auto;
782
+
783
+			.l_title {
784
+				font-size: 28rpx;
785
+				color: #3A3C3D;
786
+				font-weight: bold;
787
+				padding: 20rpx;
788
+				max-width: 600rpx;
789
+				@include multipleRows(3);
790
+
791
+			}
792
+
793
+			.del {
794
+				font-size: 28rpx;
795
+				color: #CACBCC;
796
+				font-weight: bold;
797
+				padding: 20rpx;
798
+				max-width: 600rpx;
799
+				@include multipleRows(3);
800
+				text-decoration: line-through;
801
+			}
802
+
803
+			.item_content {
804
+				width: 100%;
805
+				height: 100%;
806
+				padding: 10rpx 40rpx;
807
+
808
+				.ql {
809
+					width: 100%;
810
+					height: 100%;
811
+
812
+					.son_item {
813
+						width: 100%;
814
+						height: 100%;
815
+
816
+						.coll_item {
817
+							// border-top: 1rpx solid #eee;
818
+						}
819
+
820
+						.onsite {
821
+							text-indent: 2em;
822
+							padding: 10rpx;
823
+							font-size: 24rpx;
824
+							color: #3A3C3D;
825
+							height: auto;
826
+						}
827
+					}
828
+				}
829
+			}
830
+		}
831
+	}
832
+
833
+.item_child_box {
834
+		.item_title {
835
+			font-weight: bold;
836
+			font-size: 28rpx;
837
+			padding: 20rpx 0
838
+		}
839
+
840
+		.child_item_title {
841
+			font-size: 25rpx;
842
+			padding: 20rpx 0;
843
+			color: #000;
844
+		}
845
+	}
846
+</style>

+ 39
- 0
uni_modules/uni-data-select/changelog.md View File

@@ -0,0 +1,39 @@
1
+## 1.0.8(2024-03-28)
2
+- 修复 在vue2下:style动态绑定导致编译失败的bug
3
+## 1.0.7(2024-01-20)
4
+- 修复 长文本回显超过容器的bug,超过容器部分显示省略号
5
+## 1.0.6(2023-04-12)
6
+- 修复 微信小程序点击时会改变背景颜色的 bug
7
+## 1.0.5(2023-02-03)
8
+- 修复 禁用时会显示清空按钮
9
+## 1.0.4(2023-02-02)
10
+- 优化 查询条件短期内多次变更只查询最后一次变更后的结果
11
+- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue
12
+## 1.0.3(2023-01-16)
13
+- 修复 不关联服务空间报错的问题
14
+## 1.0.2(2023-01-14)
15
+- 新增  属性 `format` 可用于格式化显示选项内容
16
+## 1.0.1(2022-12-06)
17
+- 修复  当where变化时,数据不会自动更新的问题
18
+## 0.1.9(2022-09-05)
19
+- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
20
+## 0.1.8(2022-08-29)
21
+- 修复 点击的位置不准确
22
+## 0.1.7(2022-08-12)
23
+- 新增 支持 disabled 属性
24
+## 0.1.6(2022-07-06)
25
+- 修复 pc端宽度异常的bug
26
+## 0.1.5
27
+- 修复 pc端宽度异常的bug
28
+## 0.1.4(2022-07-05)
29
+- 优化 显示样式
30
+## 0.1.3(2022-06-02)
31
+- 修复 localdata 赋值不生效的 bug
32
+- 新增 支持  uni.scss 修改颜色
33
+- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
34
+## 0.1.2(2022-05-08)
35
+- 修复 当 value 为 0 时选择不生效的 bug
36
+## 0.1.1(2022-05-07)
37
+- 新增 记住上次的选项(仅 collection 存在时有效)
38
+## 0.1.0(2022-04-22)
39
+- 初始化

+ 562
- 0
uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue View File

@@ -0,0 +1,562 @@
1
+<template>
2
+	<view class="uni-stat__select">
3
+		<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
4
+		<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
5
+			<view class="uni-select" :class="{'uni-select--disabled':disabled}">
6
+				<view class="uni-select__input-box" @click="toggleSelector">
7
+					<view v-if="current" class="uni-select__input-text">{{textShow}}</view>
8
+					<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
9
+					<view v-if="current && clear && !disabled" @click.stop="clearVal">
10
+						<uni-icons type="clear" color="#c0c4cc" size="24" />
11
+					</view>
12
+					<view v-else>
13
+						<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
14
+					</view>
15
+				</view>
16
+				<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
17
+				<view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
18
+					<view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
19
+					<scroll-view scroll-y="true" class="uni-select__selector-scroll">
20
+						<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
21
+							<text>{{emptyTips}}</text>
22
+						</view>
23
+						<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
24
+							@click="change(item)">
25
+							<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
26
+						</view>
27
+					</scroll-view>
28
+				</view>
29
+			</view>
30
+		</view>
31
+	</view>
32
+</template>
33
+
34
+<script>
35
+	/**
36
+	 * DataChecklist 数据选择器
37
+	 * @description 通过数据渲染的下拉框组件
38
+	 * @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
39
+	 * @property {String} value 默认值
40
+	 * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
41
+	 * @property {Boolean} clear 是否可以清空已选项
42
+	 * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
43
+	 * @property {String} label 左侧标题
44
+	 * @property {String} placeholder 输入框的提示文字
45
+	 * @property {Boolean} disabled 是否禁用
46
+	 * @property {String} placement 弹出位置
47
+	 * 	@value top   		顶部弹出
48
+	 * 	@value bottom		底部弹出(default)
49
+	 * @event {Function} change  选中发生变化触发
50
+	 */
51
+
52
+	export default {
53
+		name: "uni-data-select",
54
+		mixins: [uniCloud.mixinDatacom || {}],
55
+		props: {
56
+			localdata: {
57
+				type: Array,
58
+				default () {
59
+					return []
60
+				}
61
+			},
62
+			value: {
63
+				type: [String, Number],
64
+				default: ''
65
+			},
66
+			modelValue: {
67
+				type: [String, Number],
68
+				default: ''
69
+			},
70
+			label: {
71
+				type: String,
72
+				default: ''
73
+			},
74
+			placeholder: {
75
+				type: String,
76
+				default: '请选择'
77
+			},
78
+			emptyTips: {
79
+				type: String,
80
+				default: '无选项'
81
+			},
82
+			clear: {
83
+				type: Boolean,
84
+				default: true
85
+			},
86
+			defItem: {
87
+				type: Number,
88
+				default: 0
89
+			},
90
+			disabled: {
91
+				type: Boolean,
92
+				default: false
93
+			},
94
+			// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
95
+			format: {
96
+				type: String,
97
+				default: ''
98
+			},
99
+			placement: {
100
+				type: String,
101
+				default: 'bottom'
102
+			}
103
+		},
104
+		data() {
105
+			return {
106
+				showSelector: false,
107
+				current: '',
108
+				mixinDatacomResData: [],
109
+				apps: [],
110
+				channels: [],
111
+				cacheKey: "uni-data-select-lastSelectedValue",
112
+			};
113
+		},
114
+		created() {
115
+			this.debounceGet = this.debounce(() => {
116
+				this.query();
117
+			}, 300);
118
+			if (this.collection && !this.localdata.length) {
119
+				this.debounceGet();
120
+			}
121
+		},
122
+		computed: {
123
+			typePlaceholder() {
124
+				const text = {
125
+					'opendb-stat-app-versions': '版本',
126
+					'opendb-app-channels': '渠道',
127
+					'opendb-app-list': '应用'
128
+				}
129
+				const common = this.placeholder
130
+				const placeholder = text[this.collection]
131
+				return placeholder ?
132
+					common + placeholder :
133
+					common
134
+			},
135
+			valueCom() {
136
+				// #ifdef VUE3
137
+				return this.modelValue;
138
+				// #endif
139
+				// #ifndef VUE3
140
+				return this.value;
141
+				// #endif
142
+			},
143
+			textShow() {
144
+				// 长文本显示
145
+				let text = this.current;
146
+				if (text.length > 10) {
147
+					return text.slice(0, 25) + '...';
148
+				}
149
+				return text;
150
+			},
151
+			getOffsetByPlacement() {
152
+				switch (this.placement) {
153
+					case 'top':
154
+						return "bottom:calc(100% + 12px);";
155
+					case 'bottom':
156
+						return "top:calc(100% + 12px);";
157
+				}
158
+			}
159
+		},
160
+
161
+		watch: {
162
+			localdata: {
163
+				immediate: true,
164
+				handler(val, old) {
165
+					if (Array.isArray(val) && old !== val) {
166
+						this.mixinDatacomResData = val
167
+					}
168
+				}
169
+			},
170
+			valueCom(val, old) {
171
+				this.initDefVal()
172
+			},
173
+			mixinDatacomResData: {
174
+				immediate: true,
175
+				handler(val) {
176
+					if (val.length) {
177
+						this.initDefVal()
178
+					}
179
+				}
180
+			},
181
+
182
+		},
183
+		methods: {
184
+			debounce(fn, time = 100) {
185
+				let timer = null
186
+				return function(...args) {
187
+					if (timer) clearTimeout(timer)
188
+					timer = setTimeout(() => {
189
+						fn.apply(this, args)
190
+					}, time)
191
+				}
192
+			},
193
+			// 执行数据库查询
194
+			query() {
195
+				this.mixinDatacomEasyGet();
196
+			},
197
+			// 监听查询条件变更事件
198
+			onMixinDatacomPropsChange() {
199
+				if (this.collection) {
200
+					this.debounceGet();
201
+				}
202
+			},
203
+			initDefVal() {
204
+				let defValue = ''
205
+				if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
206
+					defValue = this.valueCom
207
+				} else {
208
+					let strogeValue
209
+					if (this.collection) {
210
+						strogeValue = this.getCache()
211
+					}
212
+					if (strogeValue || strogeValue === 0) {
213
+						defValue = strogeValue
214
+					} else {
215
+						let defItem = ''
216
+						if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
217
+							defItem = this.mixinDatacomResData[this.defItem - 1].value
218
+						}
219
+						defValue = defItem
220
+					}
221
+					if (defValue || defValue === 0) {
222
+						this.emit(defValue)
223
+					}
224
+				}
225
+				const def = this.mixinDatacomResData.find(item => item.value === defValue)
226
+				this.current = def ? this.formatItemName(def) : ''
227
+			},
228
+
229
+			/**
230
+			 * @param {[String, Number]} value
231
+			 * 判断用户给的 value 是否同时为禁用状态
232
+			 */
233
+			isDisabled(value) {
234
+				let isDisabled = false;
235
+
236
+				this.mixinDatacomResData.forEach(item => {
237
+					if (item.value === value) {
238
+						isDisabled = item.disable
239
+					}
240
+				})
241
+
242
+				return isDisabled;
243
+			},
244
+
245
+			clearVal() {
246
+				this.emit('')
247
+				if (this.collection) {
248
+					this.removeCache()
249
+				}
250
+			},
251
+			change(item) {
252
+				if (!item.disable) {
253
+					this.showSelector = false
254
+					this.current = this.formatItemName(item)
255
+					this.emit(item.value)
256
+				}
257
+			},
258
+			emit(val) {
259
+				this.$emit('input', val)
260
+				this.$emit('update:modelValue', val)
261
+				this.$emit('change', val)
262
+				if (this.collection) {
263
+					this.setCache(val);
264
+				}
265
+			},
266
+			toggleSelector() {
267
+				if (this.disabled) {
268
+					return
269
+				}
270
+
271
+				this.showSelector = !this.showSelector
272
+			},
273
+			formatItemName(item) {
274
+				let {
275
+					text,
276
+					value,
277
+					channel_code
278
+				} = item
279
+				channel_code = channel_code ? `(${channel_code})` : ''
280
+
281
+				if (this.format) {
282
+					// 格式化输出
283
+					let str = "";
284
+					str = this.format;
285
+					for (let key in item) {
286
+						str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
287
+					}
288
+					return str;
289
+				} else {
290
+					return this.collection.indexOf('app-list') > 0 ?
291
+						`${text}(${value})` :
292
+						(
293
+							text ?
294
+							text :
295
+							`未命名${channel_code}`
296
+						)
297
+				}
298
+			},
299
+			// 获取当前加载的数据
300
+			getLoadData() {
301
+				return this.mixinDatacomResData;
302
+			},
303
+			// 获取当前缓存key
304
+			getCurrentCacheKey() {
305
+				return this.collection;
306
+			},
307
+			// 获取缓存
308
+			getCache(name = this.getCurrentCacheKey()) {
309
+				let cacheData = uni.getStorageSync(this.cacheKey) || {};
310
+				return cacheData[name];
311
+			},
312
+			// 设置缓存
313
+			setCache(value, name = this.getCurrentCacheKey()) {
314
+				let cacheData = uni.getStorageSync(this.cacheKey) || {};
315
+				cacheData[name] = value;
316
+				uni.setStorageSync(this.cacheKey, cacheData);
317
+			},
318
+			// 删除缓存
319
+			removeCache(name = this.getCurrentCacheKey()) {
320
+				let cacheData = uni.getStorageSync(this.cacheKey) || {};
321
+				delete cacheData[name];
322
+				uni.setStorageSync(this.cacheKey, cacheData);
323
+			},
324
+		}
325
+	}
326
+</script>
327
+
328
+<style lang="scss">
329
+	$uni-base-color: #6a6a6a !default;
330
+	$uni-main-color: #333 !default;
331
+	$uni-secondary-color: #909399 !default;
332
+	$uni-border-3: #e5e5e5;
333
+
334
+	/* #ifndef APP-NVUE */
335
+	@media screen and (max-width: 500px) {
336
+		.hide-on-phone {
337
+			display: none;
338
+		}
339
+	}
340
+
341
+	/* #endif */
342
+	.uni-stat__select {
343
+		display: flex;
344
+		align-items: center;
345
+		// padding: 15px;
346
+		/* #ifdef H5 */
347
+		cursor: pointer;
348
+		/* #endif */
349
+		width: 100%;
350
+		flex: 1;
351
+		box-sizing: border-box;
352
+	}
353
+
354
+	.uni-stat-box {
355
+		width: 100%;
356
+		flex: 1;
357
+	}
358
+
359
+	.uni-stat__actived {
360
+		width: 100%;
361
+		flex: 1;
362
+		// outline: 1px solid #2979ff;
363
+	}
364
+
365
+	.uni-label-text {
366
+		font-size: 14px;
367
+		font-weight: bold;
368
+		color: $uni-base-color;
369
+		margin: auto 0;
370
+		margin-right: 5px;
371
+	}
372
+
373
+	.uni-select {
374
+		font-size: 14px;
375
+		border: 1px solid $uni-border-3;
376
+		box-sizing: border-box;
377
+		border-radius: 4px;
378
+		padding: 0 5px;
379
+		padding-left: 10px;
380
+		position: relative;
381
+		/* #ifndef APP-NVUE */
382
+		display: flex;
383
+		user-select: none;
384
+		/* #endif */
385
+		flex-direction: row;
386
+		align-items: center;
387
+		border-bottom: solid 1px $uni-border-3;
388
+		width: 100%;
389
+		flex: 1;
390
+		height: 35px;
391
+
392
+		&--disabled {
393
+			background-color: #f5f7fa;
394
+			cursor: not-allowed;
395
+		}
396
+	}
397
+
398
+	.uni-select__label {
399
+		font-size: 16px;
400
+		// line-height: 22px;
401
+		height: 35px;
402
+		padding-right: 10px;
403
+		color: $uni-secondary-color;
404
+	}
405
+
406
+	.uni-select__input-box {
407
+		height: 35px;
408
+		position: relative;
409
+		/* #ifndef APP-NVUE */
410
+		display: flex;
411
+		/* #endif */
412
+		flex: 1;
413
+		flex-direction: row;
414
+		align-items: center;
415
+	}
416
+
417
+	.uni-select__input {
418
+		flex: 1;
419
+		font-size: 14px;
420
+		height: 22px;
421
+		line-height: 22px;
422
+	}
423
+
424
+	.uni-select__input-plac {
425
+		font-size: 14px;
426
+		color: $uni-secondary-color;
427
+	}
428
+
429
+	.uni-select__selector {
430
+		/* #ifndef APP-NVUE */
431
+		box-sizing: border-box;
432
+		/* #endif */
433
+		position: absolute;
434
+		left: 0;
435
+		width: 100%;
436
+		background-color: #FFFFFF;
437
+		border: 1px solid #EBEEF5;
438
+		border-radius: 6px;
439
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
440
+		z-index: 3;
441
+		padding: 4px 0;
442
+	}
443
+
444
+	.uni-select__selector-scroll {
445
+		/* #ifndef APP-NVUE */
446
+		max-height: 200px;
447
+		box-sizing: border-box;
448
+		/* #endif */
449
+	}
450
+
451
+	/* #ifdef H5 */
452
+	@media (min-width: 768px) {
453
+		.uni-select__selector-scroll {
454
+			max-height: 600px;
455
+		}
456
+	}
457
+
458
+	/* #endif */
459
+
460
+	.uni-select__selector-empty,
461
+	.uni-select__selector-item {
462
+		/* #ifndef APP-NVUE */
463
+		display: flex;
464
+		cursor: pointer;
465
+		/* #endif */
466
+		line-height: 35px;
467
+		font-size: 14px;
468
+		text-align: center;
469
+		/* border-bottom: solid 1px $uni-border-3; */
470
+		padding: 0px 10px;
471
+	}
472
+
473
+	.uni-select__selector-item:hover {
474
+		background-color: #f9f9f9;
475
+	}
476
+
477
+	.uni-select__selector-empty:last-child,
478
+	.uni-select__selector-item:last-child {
479
+		/* #ifndef APP-NVUE */
480
+		border-bottom: none;
481
+		/* #endif */
482
+	}
483
+
484
+	.uni-select__selector__disabled {
485
+		opacity: 0.4;
486
+		cursor: default;
487
+	}
488
+
489
+	/* picker 弹出层通用的指示小三角 */
490
+	.uni-popper__arrow_bottom,
491
+	.uni-popper__arrow_bottom::after,
492
+	.uni-popper__arrow_top,
493
+	.uni-popper__arrow_top::after,
494
+	{
495
+	position: absolute;
496
+	display: block;
497
+	width: 0;
498
+	height: 0;
499
+	border-color: transparent;
500
+	border-style: solid;
501
+	border-width: 6px;
502
+	}
503
+
504
+	.uni-popper__arrow_bottom {
505
+		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
506
+		top: -6px;
507
+		left: 10%;
508
+		margin-right: 3px;
509
+		border-top-width: 0;
510
+		border-bottom-color: #EBEEF5;
511
+	}
512
+
513
+	.uni-popper__arrow_bottom::after {
514
+		content: " ";
515
+		top: 1px;
516
+		margin-left: -6px;
517
+		border-top-width: 0;
518
+		border-bottom-color: #fff;
519
+	}
520
+
521
+	.uni-popper__arrow_top {
522
+		filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
523
+		bottom: -6px;
524
+		left: 10%;
525
+		margin-right: 3px;
526
+		border-bottom-width: 0;
527
+		border-top-color: #EBEEF5;
528
+	}
529
+
530
+	.uni-popper__arrow_top::after {
531
+		content: " ";
532
+		bottom: 1px;
533
+		margin-left: -6px;
534
+		border-bottom-width: 0;
535
+		border-top-color: #fff;
536
+	}
537
+
538
+
539
+	.uni-select__input-text {
540
+		// width: 280px;
541
+		width: 100%;
542
+		color: $uni-main-color;
543
+		white-space: nowrap;
544
+		text-overflow: ellipsis;
545
+		-o-text-overflow: ellipsis;
546
+		overflow: hidden;
547
+	}
548
+
549
+	.uni-select__input-placeholder {
550
+		color: $uni-base-color;
551
+		font-size: 12px;
552
+	}
553
+
554
+	.uni-select--mask {
555
+		position: fixed;
556
+		top: 0;
557
+		bottom: 0;
558
+		right: 0;
559
+		left: 0;
560
+		z-index: 2;
561
+	}
562
+</style>

+ 86
- 0
uni_modules/uni-data-select/package.json View File

@@ -0,0 +1,86 @@
1
+{
2
+  "id": "uni-data-select",
3
+  "displayName": "uni-data-select 下拉框选择器",
4
+  "version": "1.0.8",
5
+  "description": "通过数据驱动的下拉框选择器",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "select",
9
+    "uni-data-select",
10
+    "下拉框",
11
+    "下拉选"
12
+],
13
+  "repository": "https://github.com/dcloudio/uni-ui",
14
+  "engines": {
15
+    "HBuilderX": "^3.1.1"
16
+  },
17
+  "directories": {
18
+    "example": "../../temps/example_temps"
19
+  },
20
+"dcloudext": {
21
+    "sale": {
22
+      "regular": {
23
+        "price": "0.00"
24
+      },
25
+      "sourcecode": {
26
+        "price": "0.00"
27
+      }
28
+    },
29
+    "contact": {
30
+      "qq": ""
31
+    },
32
+    "declaration": {
33
+      "ads": "无",
34
+      "data": "无",
35
+      "permissions": "无"
36
+    },
37
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
38
+    "type": "component-vue"
39
+  },
40
+  "uni_modules": {
41
+    "dependencies": ["uni-load-more"],
42
+    "encrypt": [],
43
+    "platforms": {
44
+      "cloud": {
45
+        "tcb": "y",
46
+        "aliyun": "y",
47
+        "alipay": "n"
48
+      },
49
+      "client": {
50
+        "App": {
51
+          "app-vue": "u",
52
+          "app-nvue": "n"
53
+        },
54
+        "H5-mobile": {
55
+          "Safari": "y",
56
+          "Android Browser": "y",
57
+          "微信浏览器(Android)": "y",
58
+          "QQ浏览器(Android)": "y"
59
+        },
60
+        "H5-pc": {
61
+          "Chrome": "y",
62
+          "IE": "y",
63
+          "Edge": "y",
64
+          "Firefox": "y",
65
+          "Safari": "y"
66
+        },
67
+        "小程序": {
68
+          "微信": "y",
69
+          "阿里": "u",
70
+          "百度": "u",
71
+          "字节跳动": "u",
72
+        "QQ": "u",
73
+        "京东": "u"
74
+        },
75
+        "快应用": {
76
+          "华为": "u",
77
+          "联盟": "u"
78
+        },
79
+        "Vue": {
80
+            "vue2": "y",
81
+            "vue3": "y"
82
+        }
83
+      }
84
+    }
85
+  }
86
+}

+ 8
- 0
uni_modules/uni-data-select/readme.md View File

@@ -0,0 +1,8 @@
1
+## DataSelect 下拉框选择器
2
+> **组件名:uni-data-select**
3
+> 代码块: `uDataSelect`
4
+
5
+当选项过多时,使用下拉菜单展示并选择内容
6
+
7
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
8
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 25
- 0
uni_modules/uni-load-more/changelog.md View File

@@ -0,0 +1,25 @@
1
+## 1.3.6(2024-10-15)
2
+- 修复 微信小程序中的getSystemInfo警告
3
+## 1.3.5(2024-10-12)
4
+- 修复 微信小程序中的getSystemInfo警告
5
+## 1.3.4(2024-10-12)
6
+- 修复 微信小程序中的getSystemInfo警告
7
+## 1.3.3(2022-01-20)
8
+- 新增 showText属性 ,是否显示文本
9
+## 1.3.2(2022-01-19)
10
+- 修复 nvue 平台下不显示文本的bug
11
+## 1.3.1(2022-01-19)
12
+- 修复 微信小程序平台样式选择器报警告的问题
13
+## 1.3.0(2021-11-19)
14
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
15
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more)
16
+## 1.2.1(2021-08-24)
17
+- 新增 支持国际化
18
+## 1.2.0(2021-07-30)
19
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
20
+## 1.1.8(2021-05-12)
21
+- 新增 组件示例地址
22
+## 1.1.7(2021-03-30)
23
+- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug
24
+## 1.1.6(2021-02-05)
25
+- 调整为uni_modules目录规范

+ 5
- 0
uni_modules/uni-load-more/components/uni-load-more/i18n/en.json View File

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "Pull up to show more",
3
+	"uni-load-more.contentrefresh": "loading...",
4
+	"uni-load-more.contentnomore": "No more data"
5
+}

+ 8
- 0
uni_modules/uni-load-more/components/uni-load-more/i18n/index.js View File

@@ -0,0 +1,8 @@
1
+import en from './en.json'
2
+import zhHans from './zh-Hans.json'
3
+import zhHant from './zh-Hant.json'
4
+export default {
5
+	en,
6
+	'zh-Hans': zhHans,
7
+	'zh-Hant': zhHant
8
+}

+ 5
- 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json View File

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "上拉显示更多",
3
+	"uni-load-more.contentrefresh": "正在加载...",
4
+	"uni-load-more.contentnomore": "没有更多数据了"
5
+}

+ 5
- 0
uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json View File

@@ -0,0 +1,5 @@
1
+{
2
+	"uni-load-more.contentdown": "上拉顯示更多",
3
+	"uni-load-more.contentrefresh": "正在加載...",
4
+	"uni-load-more.contentnomore": "沒有更多數據了"
5
+}

+ 404
- 0
uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue
File diff suppressed because it is too large
View File


+ 84
- 0
uni_modules/uni-load-more/package.json View File

@@ -0,0 +1,84 @@
1
+{
2
+  "id": "uni-load-more",
3
+  "displayName": "uni-load-more 加载更多",
4
+  "version": "1.3.6",
5
+  "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
6
+  "keywords": [
7
+    "uni-ui",
8
+    "uniui",
9
+    "加载更多",
10
+    "load-more"
11
+],
12
+  "repository": "https://github.com/dcloudio/uni-ui",
13
+  "engines": {
14
+    "HBuilderX": ""
15
+  },
16
+  "directories": {
17
+    "example": "../../temps/example_temps"
18
+  },
19
+"dcloudext": {
20
+    "sale": {
21
+      "regular": {
22
+        "price": "0.00"
23
+      },
24
+      "sourcecode": {
25
+        "price": "0.00"
26
+      }
27
+    },
28
+    "contact": {
29
+      "qq": ""
30
+    },
31
+    "declaration": {
32
+      "ads": "无",
33
+      "data": "无",
34
+      "permissions": "无"
35
+    },
36
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
37
+    "type": "component-vue"
38
+  },
39
+  "uni_modules": {
40
+    "dependencies": ["uni-scss"],
41
+    "encrypt": [],
42
+    "platforms": {
43
+      "cloud": {
44
+        "tcb": "y",
45
+        "aliyun": "y",
46
+        "alipay": "n"
47
+      },
48
+      "client": {
49
+        "App": {
50
+          "app-vue": "y",
51
+          "app-nvue": "y"
52
+        },
53
+        "H5-mobile": {
54
+          "Safari": "y",
55
+          "Android Browser": "y",
56
+          "微信浏览器(Android)": "y",
57
+          "QQ浏览器(Android)": "y"
58
+        },
59
+        "H5-pc": {
60
+          "Chrome": "y",
61
+          "IE": "y",
62
+          "Edge": "y",
63
+          "Firefox": "y",
64
+          "Safari": "y"
65
+        },
66
+        "小程序": {
67
+          "微信": "y",
68
+          "阿里": "y",
69
+          "百度": "y",
70
+          "字节跳动": "y",
71
+          "QQ": "y"
72
+        },
73
+        "快应用": {
74
+          "华为": "u",
75
+          "联盟": "u"
76
+        },
77
+        "Vue": {
78
+            "vue2": "y",
79
+            "vue3": "y"
80
+        }
81
+      }
82
+    }
83
+  }
84
+}

+ 14
- 0
uni_modules/uni-load-more/readme.md View File

@@ -0,0 +1,14 @@
1
+
2
+
3
+### LoadMore 加载更多
4
+> **组件名:uni-load-more**
5
+> 代码块: `uLoadMore`
6
+
7
+
8
+用于列表中,做滚动加载使用,展示 loading 的各种状态。
9
+
10
+
11
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more)
12
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 
13
+
14
+

Loading…
Cancel
Save