1. 特色方功能迭代
This commit is contained in:
9
.cursor/rules/Code-Standards.mdc
Normal file
9
.cursor/rules/Code-Standards.mdc
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description:
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
1. 写代码的时候要补充详细的中文注释(每个方法是干嘛的,为什么要这样写),如果是工作区,则所有项目都适用该规则
|
||||
2. 注意不要生成太多的空行,上一部分代码和下一部分代码中间的空行不要大于2行
|
||||
3. 有封装好的方法、组件需要复用,不要重复造轮子
|
||||
4. 小程序端的抽屉全部需要用page-container来防止用户意外退出页面
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -117,4 +117,5 @@ dist
|
||||
/.hbuilderx/
|
||||
/.idea/
|
||||
/database/
|
||||
/utils/utils.js
|
||||
/utils/utils.js
|
||||
/.cursor/skills/
|
||||
|
||||
3
.idea/inspectionProfiles/Project_Default.xml
generated
3
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -14,7 +14,7 @@
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="16">
|
||||
<list size="17">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
@@ -31,6 +31,7 @@
|
||||
<item index="13" class="java.lang.String" itemvalue="u-form-item" />
|
||||
<item index="14" class="java.lang.String" itemvalue="u-checkbox-group" />
|
||||
<item index="15" class="java.lang.String" itemvalue="u-checkbox" />
|
||||
<item index="16" class="java.lang.String" itemvalue="u-parse" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
|
||||
@@ -49,13 +49,25 @@ export async function createSpecialPrescriptionPatientRecordApi(params) {
|
||||
return await post('/special-prescription/create-patient-record', params, 3)
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存特色方挂号上下文(merge 已有值,避免后续页面未传 sku_id 时覆盖为 0)
|
||||
* @param ctx {{ special_prescription_id, dose_count?, sku_id?, doctor_id? }}
|
||||
*/
|
||||
export function saveSpecialPrescriptionRegisterContext(ctx) {
|
||||
if (!ctx || !ctx.special_prescription_id) return
|
||||
uni.setStorageSync(SPECIAL_PRESCRIPTION_STORAGE_KEY, {
|
||||
const prev = getSpecialPrescriptionRegisterContext() || {}
|
||||
const merged = {
|
||||
special_prescription_id: ctx.special_prescription_id,
|
||||
dose_count: ctx.dose_count || 1,
|
||||
doctor_id: ctx.doctor_id || '',
|
||||
})
|
||||
dose_count: ctx.dose_count != null ? ctx.dose_count : (prev.dose_count || 1),
|
||||
doctor_id: ctx.doctor_id != null ? ctx.doctor_id : (prev.doctor_id || ''),
|
||||
}
|
||||
// 未传 sku_id 字段时保留 storage 已有值,防止中间页覆盖为 0
|
||||
if (Object.prototype.hasOwnProperty.call(ctx, 'sku_id')) {
|
||||
merged.sku_id = Number(ctx.sku_id) || 0
|
||||
} else {
|
||||
merged.sku_id = Number(prev.sku_id) || 0
|
||||
}
|
||||
uni.setStorageSync(SPECIAL_PRESCRIPTION_STORAGE_KEY, merged)
|
||||
}
|
||||
|
||||
export function getSpecialPrescriptionRegisterContext() {
|
||||
@@ -80,6 +92,7 @@ export async function tryCreateSpecialPrescriptionPatientRecord(registerId) {
|
||||
register_id: registerId,
|
||||
special_prescription_id: ctx.special_prescription_id,
|
||||
dose_count: ctx.dose_count || 1,
|
||||
sku_id: ctx.sku_id || 0,
|
||||
store_id: uni.getStorageSync('store_id') || '11001',
|
||||
doctor_id: ctx.doctor_id,
|
||||
})
|
||||
|
||||
@@ -191,11 +191,16 @@ export default {
|
||||
}
|
||||
this.delegateStoreId = e.delegate_store_id || '';
|
||||
if (e.special_prescription_id) {
|
||||
saveSpecialPrescriptionRegisterContext({
|
||||
const spCtx = {
|
||||
special_prescription_id: e.special_prescription_id,
|
||||
dose_count: e.special_prescription_dose_count || 1,
|
||||
doctor_id: e.id || '',
|
||||
});
|
||||
};
|
||||
// 仅 URL 带参时才写入 sku_id,避免 0 覆盖 detail 页已保存的 SKU
|
||||
if (e.special_prescription_sku_id != null && e.special_prescription_sku_id !== '') {
|
||||
spCtx.sku_id = Number(e.special_prescription_sku_id);
|
||||
}
|
||||
saveSpecialPrescriptionRegisterContext(spCtx);
|
||||
}
|
||||
this.setNavTitle(STEP1_TITLE);
|
||||
},
|
||||
|
||||
@@ -32,11 +32,15 @@
|
||||
onLoad(e) {
|
||||
this.register_id = e.id
|
||||
if (e.special_prescription_id) {
|
||||
saveSpecialPrescriptionRegisterContext({
|
||||
const spCtx = {
|
||||
special_prescription_id: e.special_prescription_id,
|
||||
dose_count: e.special_prescription_dose_count || 1,
|
||||
doctor_id: e.doctor_id || '',
|
||||
})
|
||||
}
|
||||
if (e.special_prescription_sku_id != null && e.special_prescription_sku_id !== '') {
|
||||
spCtx.sku_id = Number(e.special_prescription_sku_id)
|
||||
}
|
||||
saveSpecialPrescriptionRegisterContext(spCtx)
|
||||
}
|
||||
this.bindSpecialPrescriptionRecord()
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user