|
|
@@ -17,9 +17,19 @@
|
|
|
height: getCollapseHeight(i),
|
|
|
}" @scrolltolower="getDrugInfoNameList(i)">
|
|
|
<view class="cv-item" v-for="(d, di) in products[i]" :key="'drug-' + di">
|
|
|
- <text class="cv-index">{{ di + 1 }}</text>
|
|
|
- <text class="cv-label">药品名称:</text>
|
|
|
- <text class="cv-value">{{ d.physicName || "" }}</text>
|
|
|
+ <view class="cv-index-wrap">
|
|
|
+ <text class="cv-index">{{ di + 1 }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="cv-body">
|
|
|
+ <view class="cv-row">
|
|
|
+ <text class="cv-label">药品名称:</text>
|
|
|
+ <text class="cv-value">{{ d.physicName || "" }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="cv-row">
|
|
|
+ <text class="cv-label">药品规格:</text>
|
|
|
+ <text class="cv-value">{{ d.pkgSpec || "" }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
@@ -60,7 +70,21 @@ export default {
|
|
|
onLoad() {
|
|
|
this.fetchInitial();
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ /** 白名单规范化后的集合,与接口 entName 比对用 */
|
|
|
+ canScanCompanySet() {
|
|
|
+ return new Set(
|
|
|
+ this.canScanCompanyList.map((s) => this.normalizeEntName(s))
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ normalizeEntName(s) {
|
|
|
+ return String(s || "")
|
|
|
+ .trim()
|
|
|
+ .replace(/\(/g, "(")
|
|
|
+ .replace(/\)/g, ")");
|
|
|
+ },
|
|
|
getDrugInfoNameList(i) {
|
|
|
const res = getPaginatedList({
|
|
|
page: this.productPages[i] || 0,
|
|
|
@@ -72,10 +96,11 @@ export default {
|
|
|
this.$set(this.products, i, res.data);
|
|
|
},
|
|
|
getCollapseHeight(i) {
|
|
|
- return this.expanded[i]
|
|
|
- ? Math.min(7.3 * 70, this.companyList[i].drugInfoNameList.length * 70) +
|
|
|
- "rpx"
|
|
|
- : "0";
|
|
|
+ if (!this.expanded[i]) return "0";
|
|
|
+ const n = this.companyList[i]?.drugInfoNameList?.length || 0;
|
|
|
+ const perItemRpx = 132;
|
|
|
+ const maxRpx = 560;
|
|
|
+ return Math.min(maxRpx, n * perItemRpx) + "rpx";
|
|
|
},
|
|
|
getLoading() {
|
|
|
return this.loading;
|
|
|
@@ -97,8 +122,9 @@ export default {
|
|
|
const rawList = Array.isArray(list) ? list : [];
|
|
|
this.fetchedCount = (this.fetchedCount || 0) + rawList.length;
|
|
|
|
|
|
+ const allowed = this.canScanCompanySet;
|
|
|
const filtered = rawList.filter((item) =>
|
|
|
- this.canScanCompanyList.includes(item.entName)
|
|
|
+ allowed.has(this.normalizeEntName(item.entName))
|
|
|
);
|
|
|
|
|
|
this.companyList = [...this.companyList, ...filtered];
|
|
|
@@ -177,35 +203,66 @@ export default {
|
|
|
}
|
|
|
|
|
|
.cv-item {
|
|
|
- padding: 16rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 20rpx 12rpx 20rpx 8rpx;
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
+ align-items: flex-start;
|
|
|
color: #666;
|
|
|
+ border-bottom: 1rpx solid #f0f2f5;
|
|
|
+}
|
|
|
+
|
|
|
+.cv-item:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+}
|
|
|
+
|
|
|
+.cv-index-wrap {
|
|
|
+ flex-shrink: 0;
|
|
|
+ padding-top: 6rpx;
|
|
|
+ margin-right: 16rpx;
|
|
|
}
|
|
|
|
|
|
.cv-index {
|
|
|
- width: 24rpx;
|
|
|
- height: 24rpx;
|
|
|
- line-height: 24rpx;
|
|
|
- font-size: 18rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ min-width: 25rpx;
|
|
|
+ height: 36rpx;
|
|
|
+ padding: 0 6rpx;
|
|
|
+ line-height: 1;
|
|
|
+ font-size: 20rpx;
|
|
|
text-align: center;
|
|
|
border-radius: 50%;
|
|
|
- margin-right: 8rpx;
|
|
|
- border: 1rpx solid #666;
|
|
|
+ border: 1rpx solid #999;
|
|
|
}
|
|
|
|
|
|
-.cv-label {
|
|
|
- width: 140rpx;
|
|
|
+.cv-body {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.cv-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
font-size: 28rpx;
|
|
|
+ line-height: 1.5;
|
|
|
+}
|
|
|
+
|
|
|
+.cv-row+.cv-row {
|
|
|
+ margin-top: 10rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.cv-label {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 150rpx;
|
|
|
+ color: #727a86;
|
|
|
}
|
|
|
|
|
|
.cv-value {
|
|
|
- width: 0;
|
|
|
flex: 1;
|
|
|
- font-size: 28rpx;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
+ min-width: 0;
|
|
|
+ color: #333;
|
|
|
+ word-break: break-all;
|
|
|
+ white-space: normal;
|
|
|
}
|
|
|
|
|
|
.loading-page {
|