Преглед изворни кода

修改样式、功能、bug

cc12458 пре 1 година
родитељ
комит
6a08559069
30 измењених фајлова са 339 додато и 96 уклоњено
  1. 2 1
      miniprogram/app.json
  2. 4 4
      miniprogram/components/form-ruler/form-ruler.ts
  3. 6 2
      miniprogram/lib/request/create.ts
  4. 28 0
      miniprogram/lib/wx/page.ts
  5. 26 5
      miniprogram/module/chats/components/message-select/message-select.ts
  6. 4 4
      miniprogram/module/chats/components/message-select/message-select.wxml
  7. 2 2
      miniprogram/module/chats/pages/analysis/analysis.ts
  8. 9 8
      miniprogram/module/chats/pages/analysis/analysis.wxml
  9. 7 6
      miniprogram/module/health/components/report-health-patient/report-health-patient.ts
  10. 5 9
      miniprogram/module/health/components/report-health-patient/report-health-patient.wxml
  11. 3 0
      miniprogram/module/health/components/report-health-status/report-health-status.ts
  12. 1 1
      miniprogram/module/health/components/report-health-status/report-health-status.wxml
  13. 2 1
      miniprogram/module/health/pages/home/home.ts
  14. 8 4
      miniprogram/module/health/pages/home/home.wxml
  15. 5 1
      miniprogram/module/health/pages/status/status.ts
  16. 6 2
      miniprogram/module/health/router.ts
  17. 4 30
      miniprogram/module/health/tools/health-index.ts
  18. 2 2
      miniprogram/module/user/components/user-data-edit/user-data-edit.wxml
  19. 14 6
      miniprogram/module/user/pages/user-certification/user-certification.ts
  20. 3 3
      miniprogram/module/user/pages/user-certification/user-certification.wxml
  21. 5 0
      miniprogram/module/user/pages/user-record/user-record.json
  22. 49 0
      miniprogram/module/user/pages/user-record/user-record.scss
  23. 70 0
      miniprogram/module/user/pages/user-record/user-record.ts
  24. 25 0
      miniprogram/module/user/pages/user-record/user-record.wxml
  25. 39 0
      miniprogram/module/user/request.ts
  26. 1 1
      miniprogram/pages/home/body-model/body-model.wxml
  27. 4 1
      miniprogram/pages/home/home.ts
  28. 1 1
      miniprogram/themes/t.cell.scss
  29. 2 2
      typings/app/health.d.ts
  30. 2 0
      typings/app/request.d.ts

+ 2 - 1
miniprogram/app.json

@@ -26,7 +26,8 @@
       "root": "module/user",
       "pages": [
         "pages/user-certification/user-certification",
-        "pages/user-edit/user-edit"
+        "pages/user-edit/user-edit",
+        "pages/user-record/user-record"
       ]
     },
     {

+ 4 - 4
miniprogram/components/form-ruler/form-ruler.ts

@@ -39,12 +39,12 @@ Component({
     'min, max, precision'(...args: [number, number, number]) {
       this._updateAxis(args);
     },
-    'defaultValue,min, max'(value, min, max) {
+    'defaultValue, min, max, precision'(value, min, max, precision) {
+      const offset = precision >= 1 ? precision : 0
       if (!value || Number.isNaN(value)) {
-        value = Math.floor((max - min) / 2 + min)
-        // this.setData({ value });
+        value = Math.floor((max - min - offset) / 2 + min)
       }
-      this._scrollValue(value);
+      this._scrollValue(value + offset);
     }
   },
   lifetimes: {

+ 6 - 2
miniprogram/lib/request/create.ts

@@ -30,8 +30,12 @@ export function createRequest(option: IRequestCreateConfig) {
       header, data, ..._config,
     }).then(response => {
       if (response.statusCode === 200) {
-        if (response.data.code === 200 && response.data.success !== false)
-          return transform({ data: response.data.data, header: response.header });
+        if (response.data.code === 200 && response.data.success !== false) {
+          const data = Array.isArray(response.data.rows) && response.data.total != null
+            ? { data: response.data.rows, total: response.data.total }
+            : response.data.data
+          return transform({ data: data as any, header: response.header });
+        }
         throw { errMsg: response.data.msg || `app:${response.data.code}`, errno: `060202${response.data.code}` }
       }
       throw { errMsg: `${response.errMsg}:${response.statusCode}`, errno: `060201${response.statusCode}` }

+ 28 - 0
miniprogram/lib/wx/page.ts

@@ -0,0 +1,28 @@
+import { withResolvers } from "../promise";
+
+export function setPageOrientation(orientation: 'portrait' | 'landscape') {
+  const { promise, resolve, reject } = withResolvers();
+  (<any>wx).setPageOrientation({ orientation, success: resolve, fail: reject });
+  return promise;
+}
+
+export function getPageOrientation() {
+  const { windowWidth, windowHeight, safeArea } = wx.getWindowInfo();
+  const { bottom } = wx.getMenuButtonBoundingClientRect();
+
+  if (windowWidth > windowHeight) {
+    return {
+      orientation: 'landscape',
+      left: safeArea?.left ?? 0,
+      right: 0,
+      width: windowWidth - (safeArea.left ?? 0),
+      height: (safeArea?.height ?? windowHeight) - bottom
+    } as const;
+  } else {
+    return {
+      orientation: 'portrait',
+      width: windowWidth,
+      height: (safeArea?.bottom ?? windowHeight) - bottom
+    } as const;
+  }
+}

+ 26 - 5
miniprogram/module/chats/components/message-select/message-select.ts

@@ -21,7 +21,7 @@ Component({
   data: {
     options: [] as Option[],
     subOptions: [] as Option[],
-    multiple: false,
+    subMultiple: false,
     itemHeight: 48,
 
     result: '',
@@ -32,9 +32,26 @@ Component({
     }
   },
   methods: {
-    async handle(event: HandleEvent) {
-      console.log(this.data.active);
+    handleTop(event: HandleEvent) {
+      const { mark: { item, index } } = event;
+      if (!item || !this.data.active) return;
+      const multiple = this.data.payload.multiple;
+      const checked = !item.checked;
+      const options = this._handle(this.data.options, item, index, multiple);
+      this.setData({ options });
+      if (checked && !multiple) { this.onSubmit(); }
+    },
+    handleSub(event: HandleEvent) {
+      const { mark: { item, index } } = event;
+      if (!item || !this.data.active) return;
+      const multiple = this.data.subMultiple;
+      const checked = !item.checked;
+      const subOptions = this._handle(this.data.subOptions, item, index, multiple);
+      this.setData({ subOptions });
 
+      if (checked && !multiple) { this.onConfirm(); }
+    },
+    async handle(event: HandleEvent) {
       const { mark: { type, item, index } } = event;
       if (!item || !this.data.active) return;
 
@@ -67,7 +84,7 @@ Component({
           this.setData({
             subTitle: item.name,
             subOptions: item.options,
-            multiple: (<any>item).css === 'checkbox'
+            subMultiple: (<any>item).css === 'checkbox'
           })
           this.onCancel = () => {
             this.setData({ subOptions: [] })
@@ -79,13 +96,17 @@ Component({
               const options = fn();
               options[index].options = this.data.subOptions;
               this.setData({ subOptions: [], options })
-            } 
+            }
           }
         } else {
           return fn();
         }
       } else {
         options[index].checked = !item.checked;
+        if (item.options) options[index].options = item.options.map(option => {
+          if (!(<any>option)?.hide) option.checked = !item.checked;
+          return option;
+        })
       }
       return options;
     },

+ 4 - 4
miniprogram/module/chats/components/message-select/message-select.wxml

@@ -24,7 +24,7 @@
   </view>
   <view class="chat-card__content">
     <t-cell t-class="cell-border-gradient" title="{{payload.title}}"></t-cell>
-    <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(options, itemHeight)}}px;" mark:type="options" bind:tap="handle">
+    <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(options, itemHeight)}}px;" mark:type="options" bind:tap="handleTop">
       <grid-builder list="{{options}}" cross-axis-count="3" cross-axis-gap="8" main-axis-gap="8" padding="{{[4,4,4,4]}}">
         <view slot:item slot:index class="card {{_.getClassName(item)}}" style="height: {{itemHeight}}px;" mark:item="{{item}}" mark:index="{{index}}">
           <t-icon wx:if="{{item.checked}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
@@ -32,7 +32,7 @@
         </view>
       </grid-builder>
     </scroll-view>
-    <view class="chat-card__handle {{active ? '' : 'disabled'}}">
+    <view wx:if="{{payload.multiple}}" class="chat-card__handle {{active ? '' : 'disabled'}}">
       <view class="item" bind:tap="onSubmit">
         <image src="../../assets/button-1.bg.png" mode="aspectFit" />
         <view>提交</view>
@@ -55,10 +55,10 @@
   <view class="form-picker__header">
     <view class="btn btn--cancel" aria-role="button" bind:tap="onCancel">取消</view>
     <view class="title">{{subTitle}}</view>
-    <view class="btn btn--confirm" aria-role="button" bind:tap="onConfirm">确定</view>
+    <view wx:if="{{subMultiple}}" class="btn btn--confirm" aria-role="button" bind:tap="onConfirm">确定</view>
   </view>
   <view class="form-picker__content">
-    <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(subOptions, itemHeight)}}px;" mark:type="sub" bind:tap="handle">
+    <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(subOptions, itemHeight)}}px;" mark:type="sub" bind:tap="handleSub">
       <grid-builder list="{{subOptions}}" cross-axis-count="3" cross-axis-gap="8" main-axis-gap="8" padding="{{[4,4,4,4]}}">
         <view slot:item slot:index class="card {{_.getClassName(item)}}" style="height: {{itemHeight}}px;" mark:item="{{item}}" mark:index="{{index}}">
           <t-icon wx:if="{{item.checked}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />

+ 2 - 2
miniprogram/module/chats/pages/analysis/analysis.ts

@@ -10,7 +10,7 @@ Component({
   data: {
     uploadList: [
       { target: 'tongueImgUrl', required: true, label: '舌面图', src: '../../assets/tongue-1.png' },
-      { target: 'tongueBackImgUrl', required: true, label: '舌下图', src: '../../assets/tongue-2.png' },
+      { target: 'tongueBackImgUrl', required: false, label: '舌下图', src: '../../assets/tongue-2.png' },
       { target: 'faceImgUrl', required: false, label: '面部图', src: '../../assets/face-1.png' },
     ],
     thumbnail: [] as string[],
@@ -38,7 +38,7 @@ Component({
       }
     },
     _chooseMedia(index: number) {
-      return wx.chooseMedia({ count: 1, mediaType: ['image'], camera: 'front' })
+      return wx.chooseMedia({ count: 1, mediaType: ['image'], sourceType: ['album', 'camera'], camera: 'front' })
         .then(res => {
           const src = res.tempFiles[0].tempFilePath;
           this.setData({ [`thumbnail.${index}`]: src });

+ 9 - 8
miniprogram/module/chats/pages/analysis/analysis.wxml

@@ -1,6 +1,15 @@
 <!--module/chats/pages/analysis/analysis.wxml-->
 <t-navbar title="舌面象上传" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
+  <t-cell title="拍摄注意事项" required bordered="{{false}}">
+    <view slot="description">
+      <view style="margin-top: 8px;">光线:</view>
+      <view>白天充足、柔和的自然光线下效果最佳,避免背光、偏暗、曝光。</view>
+      <view style="margin-top: 8px;">禁忌:</view>
+      <view>不要在食用有色饮食或药物后、有色光源下、早晨起床时、饭后半小时内拍摄舌象。</view>
+      <view>不要带妆拍摄面部图片。</view>
+    </view>
+  </t-cell>
   <view class="upload-card" wx:for="{{uploadList}}" wx:key="{{item.target}}" mark:index="{{index}}" mark:target="{{item.target}}" bind:tap="handle">
     <view class="upload-card__header">
       <text>{{item.label}}上传</text>
@@ -26,14 +35,6 @@
     </view>
   </view>
 
-  <t-cell title="拍摄注意事项" required bordered="{{false}}">
-    <view slot="description">
-      <view style="margin-top: 8px;">光线:</view>
-      <view>白天充足、柔和的自然光线下效果最佳,避免背光、偏暗、曝光。</view>
-      <view style="margin-top: 8px;">禁忌:</view>
-      <view>不要在食用有色饮食或药物后、有色光源下、早晨起床时、饭后半小时内拍摄舌象。</view>
-    </view>
-  </t-cell>
 
   <form bind:submit="onSubmit">
     <form-button block index="2"></form-button>

+ 7 - 6
miniprogram/module/health/components/report-health-patient/report-health-patient.ts

@@ -18,14 +18,15 @@ Component({
     job: [] as string[],
 
     phone: '',
+    cardno: '',
   },
   observers: {
-    'dataset.phone'(value: string) {
-      this.setData({ phone: value?.slice(0, 3).padEnd(12, '*') ?? '' })
-    },
-    'dataset.cardno'(value: string) {
-      this.setData({ cardno: value?.slice(0, 3).padEnd(18, '*') ?? '' })
-    },
+    // 'dataset.phone'(value: string) {
+    //   this.setData({ phone: value?.slice(0, 3).padEnd(12, '*') ?? '' })
+    // },
+    // 'dataset.cardno'(value: string) {
+    //   this.setData({ cardno: value?.slice(0, 3).padEnd(18, '*') ?? '' })
+    // },
     'dataset.womenSpecialPeriod'(value: string) {
       const values = value?.split(',') ?? []
       this.setData({ specialPeriod: values.filter(Boolean) })

+ 5 - 9
miniprogram/module/health/components/report-health-patient/report-health-patient.wxml

@@ -12,14 +12,10 @@
             <text>个人简介:</text>
             <text class="text-item">{{dictionary.label($dictionaries, 'sys_user_sex', dataset.sex)}}</text>
             <text class="text-item">{{dataset.age}}岁</text>
-            <text class="text-item" wx:for="{{specialPeriod}}" wx:key="*this">
-              {{dictionary.label($dictionaries, 'women_special_period', item)}}
-            </text>
-            <text class="text-item" wx:for="{{job}}" wx:key="*this">
-              {{dictionary.label($dictionaries, 'job', item)}}
-            </text>
-            <text class="text-item">手机号:{{phone}}</text>
-            <text class="text-item">身份证号:{{cardno}}</text>
+            <text class="text-item" wx:for="{{specialPeriod && dictionary.label($dictionaries,'women_special_period', item) !== '无'}}" wx:key="*this">{{dictionary.label($dictionaries,'women_special_period', item)}}</text>
+            <text class="text-item" wx:for="{{job}}" wx:key="*this">{{dictionary.label($dictionaries, 'job', item)}}</text>
+            <text class="text-item">手机号:{{dataset.phone}}</text>
+            <text class="text-item">身份证号:{{dataset.cardno}}</text>
           </span>
         </view>
       </view>
@@ -54,7 +50,7 @@
         </span>
         <span class="col">
           <text>体重:</text>
-          <text>{{dataset.height}}kg</text>
+          <text>{{dataset.weight}}kg</text>
         </span>
       </view>
       <view class="row">

+ 3 - 0
miniprogram/module/health/components/report-health-status/report-health-status.ts

@@ -38,6 +38,9 @@ Component({
         duration: 300,
         easingFunction: 'ease'
       })
+    },
+    toInfoPage() {
+      this.triggerEvent('info')
     }
   }
 })

+ 1 - 1
miniprogram/module/health/components/report-health-status/report-health-status.wxml

@@ -23,7 +23,7 @@
   <t-empty wx:if="{{message}}" t-class="empty-wrapper error" icon="info-circle" description="{{message}}" />
 </view>
 
-<view class="card-wrapper report-data-wrapper">
+<view class="card-wrapper report-data-wrapper" catch:tap="toInfoPage">
   <t-cell t-class="card-header cell-border-gradient" t-class-title="card-header__title">
     <block slot="title">
       <text>健康分析报告</text>

+ 2 - 1
miniprogram/module/health/pages/home/home.ts

@@ -2,7 +2,7 @@ import PageContainerBehavior from "../../../../core/behavior/page-container.beha
 import { DraggableSheetBehavior, getDraggableSheetContext } from "../../../../core/behavior/draggableSheet.behavior";
 
 // module/health/pages/home/home.ts
-import { toReportPage, toSchemePage } from "../../router";
+import { toPatientPage, toReportPage, toSchemePage } from "../../router";
 import { healthIndexMethod, healthPatientMethod, healthReportListMethod, healthReportMethod } from "../../request";
 import { healthIndex2Progress } from "../../tools/health-index";
 import { getTickleContext } from "../../../../core/behavior/tickle.behavior";
@@ -111,6 +111,7 @@ Component({
 
     toSchemePage(event: WechatMiniprogram.TouchEvent) { toSchemePage(event.mark?.id); },
     toReportPage(event: WechatMiniprogram.TouchEvent) { toReportPage(event.mark?.id); },
+    toPatientPage: toPatientPage,
     toHealthIndexListPage() {
       wx.navigateTo({ url: `/module/health/pages/record-index/record-index` })
     },

+ 8 - 4
miniprogram/module/health/pages/home/home.wxml

@@ -1,12 +1,17 @@
 <!--module/health/pages/home/home.wxml-->
 <t-navbar title="健康档案" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
-  <report-health-patient dataset="{{healthPatient.data}}" loading="{{healthPatient.loading}}" message="{{healthPatient.message}}"></report-health-patient>
-  <report-health-status dataset="{{healthReport.data}}" loading="{{healthReport.loading}}" message="{{healthReport.message}}" mark:id="{{healthId}}" bind:tap="toReportPage">
-    <view class="extra-warapper" slot="extra-status" catch:tap="">
+  <report-health-patient dataset="{{healthPatient.data}}" loading="{{healthPatient.loading}}" message="{{healthPatient.message}}">
+    <view class="extra-warapper" slot="extra" catch:tap="toPatientPage">
       <text>更新记录</text>
       <t-icon t-class="icon" name="chevron-right-double-s" size="24px" />
     </view>
+  </report-health-patient>
+  <report-health-status dataset="{{healthReport.data}}" loading="{{healthReport.loading}}" message="{{healthReport.message}}" mark:id="{{healthId}}" bind:info="toReportPage">
+    <!-- <view class="extra-warapper" slot="extra-status" catch:tap="">
+      <text>更新记录</text>
+      <t-icon t-class="icon" name="chevron-right-double-s" size="24px" />
+    </view> -->
     <view class="extra-warapper" slot="extra-report" catch:tap="showReportList">
       <text>更新记录</text>
       <t-icon t-class="icon" name="chevron-right-double-s" size="24px" />
@@ -18,7 +23,6 @@
       <text>更新记录</text>
       <t-icon t-class="icon" name="chevron-right-double-s" size="24px" />
     </view>
-
   </report-health-index>
 </scroll-view>
 

+ 5 - 1
miniprogram/module/health/pages/status/status.ts

@@ -23,10 +23,14 @@ Component({
       wx.showLoading({ title: '加载中' });
       try {
         const health = await Post<ResponseData, App.Health.Index.Data[]>(`/patientQuota/getCurQuoval`, {}, {
-          transform({ data }) { return transformHealthIndex2Ruler(data) }
+          transform({ data }) { console.log(data,'12300-->');
+           return transformHealthIndex2Ruler(data) }
         });
         this.setData({ health })
       } catch (error) {
+      console.log(error, '123-->');
+      
+        
         getTickleContext.call(this).showErrorMessage(error.errMsg, 0)
       }
       wx.hideLoading()

+ 6 - 2
miniprogram/module/health/router.ts

@@ -9,7 +9,7 @@ export function toSchemePage(id?: string) {
   const pages = getCurrentPages();
   const historyIndex = pages.reverse().findIndex(page => page.route === route);
   if (historyIndex !== -1 && pages[historyIndex].options?.id === id) {
-    wx.navigateBack({ delta: historyIndex + 1 });
+    wx.navigateBack({ delta: historyIndex });
   } else {
     wx.navigateTo({ url: `/${route}?id=${id}` });
   }
@@ -26,8 +26,12 @@ export function toReportPage(id?: string) {
   const pages = getCurrentPages();
   const historyIndex = pages.reverse().findIndex(page => page.route === route);
   if (historyIndex !== -1 && pages[historyIndex].options?.id === id) {
-    wx.navigateBack({ delta: historyIndex + 1 });
+    wx.navigateBack({ delta: historyIndex });
   } else {
     wx.navigateTo({ url: `/${route}?id=${id}` });
   }
+}
+
+export function toPatientPage() {
+  return wx.navigateTo({ url: `/module/user/pages/user-record/user-record` });
 }

+ 4 - 30
miniprogram/module/health/tools/health-index.ts

@@ -2,7 +2,7 @@ function gather(
   data: App.Health.Index.Data[],
   transform: (model: App.Health.Index.Model) => any,
   skip = false,
-  link = { 血压: [1, 2], }
+  link = { 血压: ['收缩压', '舒张压'], }
 ) {
   const ref = ((link) => {
     const ref: Record<string, { id: string; name: string; }> = {};
@@ -15,9 +15,9 @@ function gather(
 
   const cache = new Map<{ id: string; name: string; }, App.Health.Index.Ruler[]>();
   for (const item of data) {
-    if (skip && item.isAuto) continue;
+    if (skip && item.isAuto === 'Y') continue;
     const model = createHealthIndex(item);
-    const _ = ref[model.id] ?? { id: model.id, name: model.name };
+    const _ = ref[model.name] ?? { id: model.id, name: model.name };
     if (ref[model.id]) model.name = model.name.replace(_.name, '');
     if (cache.has(_)) {
       cache.get(_)?.push(transform(model))
@@ -32,11 +32,6 @@ export function healthIndex2Ruler(model: App.Health.Index.Model): App.Health.Ind
   let { scope, range, precision, values, ...ruler } = model;
   const min = range?.[0] ?? Math.floor(scope[0] * 0.5);
   const max = range?.[1] ?? Math.floor(scope[1] * 1.5);
-  precision = ((diff) => {
-    if (diff < 5) return 0.01;
-    if (diff < 10) return 0.1;
-    else return 1;
-  })(max - min)
   return {
     ...ruler, min, max, precision,
     markLine: [
@@ -97,7 +92,7 @@ export function createHealthIndex(data: App.Health.Index.Data): App.Health.Index
   ]
   return {
     ...model, id,
-    precision: (+inputPrecision!) || 1,
+    precision: ({ 0: 0.01, 1: 0.1, 2: 2, 3: 1 } as any)[inputPrecision ?? 3],
     range, scope,
     values: patientQuotaRecordDTOS?.map(item => {
       return { value: +item.quotaVal, abnormal: item.abnormal, description: item.abnormalDesc, date: item.time2 }
@@ -107,27 +102,6 @@ export function createHealthIndex(data: App.Health.Index.Data): App.Health.Index
 
 
 export function transformHealthIndex2Ruler(data: App.Health.Index.Data[]): { id: string, name: string, options: App.Health.Index.Ruler[] }[] {
-  // const ref = ((link) => {
-  //   const ref: Record<string, { id: string; name: string; }> = {};
-  //   Object.entries(link).forEach(([name, keys]) => {
-  //     const _ = { id: name, name };
-  //     keys.forEach(key => { ref[key] = _; })
-  //   })
-  //   return ref;
-  // })({ 血压: [1, 2], })
-  // const cache = new Map<{ id: string; name: string; }, App.Health.Index.Ruler[]>();
-  // for (const item of data) {
-  //   if (item.isAuto) continue;
-  //   const model = createHealthIndex(item);
-  //   const _ = ref[model.id] ?? { id: model.id, name: model.name };
-  //   if (ref[model.id]) model.name = model.name.replace(_.name, '');
-  //   if (cache.has(_)) {
-  //     cache.get(_)?.push(healthIndex2Ruler(model))
-  //   } else {
-  //     cache.set(_, [healthIndex2Ruler(model)])
-  //   }
-  // }
-  // return [...cache].map(gather => ({ ...gather[0], options: gather[1] }))
   return gather(data, healthIndex2Ruler, true);
 }
 

+ 2 - 2
miniprogram/module/user/components/user-data-edit/user-data-edit.wxml

@@ -7,7 +7,7 @@
 
 <block wx:if="{{showSpecialPeriodPicker}}">
   <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper {{field.className(dirty, model, 'womenSpecialPeriod')}}" title="女性特殊期" required bind:tap="onPicker">
-    <field-picker class="cell-field__inner full" slot="note" title="女性特殊期" name="womenSpecialPeriod" value="{{model['womenSpecialPeriod']}}" options="{{dictionary.options($dictionaries, 'women_special_period')}}"></field-picker>
+    <field-picker class="cell-field__inner full" slot="note" title="女性特殊期" name="womenSpecialPeriod" value="{{model['womenSpecialPeriod']}}" options="{{dictionary.options($dictionaries, 'women_special_period')}}" multiple="{{false}}"></field-picker>
   </t-cell>
 </block>
 
@@ -46,7 +46,7 @@
   </t-cell>
 
   <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" title="职业" bind:tap="onPicker">
-    <field-picker class="cell-field__inner full" slot="note" title="职业" name="job" value="{{model['job']}}" options="{{dictionary.options($dictionaries, 'job')}}"></field-picker>
+    <field-picker class="cell-field__inner full" slot="note" title="职业" name="job" value="{{model['job']}}" options="{{dictionary.options($dictionaries, 'job')}}" multiple="{{false}}"></field-picker>
   </t-cell>
 </block>
 <view class="more-button" wx:else bind:tap="onExpand">查看更多</view>

+ 14 - 6
miniprogram/module/user/pages/user-certification/user-certification.ts

@@ -31,6 +31,7 @@ Component({
     loading: false,
     verifying: false,
     model: {} as AnyObject,
+    cardno: '',
     privacyContract: { agree: false, name: '《隐私政策》', show: false },
   },
 
@@ -43,15 +44,19 @@ Component({
     onPrivacySetting({ detail }: { detail: WechatMiniprogram.GetPrivacySettingSuccessCallbackResult }) {
       this.setData({
         'privacyContract.name': detail.privacyContractName,
-        'privacyContract.agree': !detail.needAuthorization,
+        // 'privacyContract.agree': !detail.needAuthorization,
       })
     },
     onAgreeChange(event: any) {
+      console.log(event);
+
       const agree = event?.detail?.checked;
       if (agree) this.setData({ 'privacyContract.show': true });
       else this.setData({ 'privacyContract.agree': agree });
     },
     onAgree() {
+      console.log('onAgree-->');
+
       this.setData({ 'privacyContract.agree': true });
     },
     async verifyCardno(event: WechatMiniprogram.InputConfirm) {
@@ -63,23 +68,26 @@ Component({
           const data = await verifyCardnoMethod(value);
           this.setData({ 'model.age': data.age, 'model.sex': data.sex });
         } catch (error) {
-          this.setData({ 'model.cardno': '', 'model.age': '', 'model.sex': '' });
+          this.setData({ 'cardno': '', 'model.age': '', 'model.sex': '' });
           wx.showToast({ title: error.errMsg, icon: 'error' });
         }
         this.setData({ verifying: false });
       }
     },
     async onSubmit(event: WechatMiniprogram.FormSubmit) {
-      const data = { ...this.data.model, ...event.detail.value };
-      // if (!data.phone) return getTickleContext.call(this).showWarnMessage('请获取手机号码');
-      data.phone = '13012344322'
+      const data = { ...this.data.model, ...event.detail.value, };
+      if (!data.cardno) data.cardno = this.data.cardno;
+      if (!data.phone) return getTickleContext.call(this).showWarnMessage('请获取手机号码');
       if (!data.name) return getTickleContext.call(this).showWarnMessage('请输入姓名');
       if (data.cardno?.length !== 18) return getTickleContext.call(this).showWarnMessage('请输入正确的身份证号');
       if (data.sex === '1' && !data.womenSpecialPeriod) return getTickleContext.call(this).showWarnMessage('请至少选择一项女性特殊期');
       if (!data.height) return getTickleContext.call(this).showWarnMessage('请输入身高');
       if (!data.weight) return getTickleContext.call(this).showWarnMessage('请输入体重');
       console.log(data);
-      if (!this.data.privacyContract.agree) { wx.showToast({ title: `请阅读并同意${this.data.privacyContract.name}`, icon: 'none' }) }
+      if (!this.data.privacyContract.agree) {
+        this.setData({ 'privacyContract.show': true })
+        return wx.showToast({ title: `请阅读并同意${this.data.privacyContract.name}`, icon: 'none' })
+      }
 
       wx.showLoading({ title: '保存中' });
       try {

+ 3 - 3
miniprogram/module/user/pages/user-certification/user-certification.wxml

@@ -13,11 +13,11 @@
       <input class="cell-field__inner" slot="note" name="name" value="{{model['name']}}" type="text" placeholder="请输入姓名" confirm-type="next" />
     </t-cell>
     <t-cell t-class="cell-border-gradient cell-field" t-class-note="cell-field__wrapper" required title="身份证号">
-      <input class="cell-field__inner" slot="note" name="cardno" model:value="{{model['cardno']}}" type="idcard" placeholder="请输入身份证号" maxlength="18" confirm-type="next" bind:blur="verifyCardno" />
+      <input class="cell-field__inner" slot="note" name="cardno" model:value="{{cardno}}" type="idcard" placeholder="请输入身份证号" maxlength="18" confirm-type="next" bind:blur="verifyCardno" />
       <t-loading wx:if="{{verifying}}" slot="note" theme="spinner" size="24rpx" slot="note" />
     </t-cell>
-    <t-cell t-class="cell-border-gradient" required title="年龄" note="{{model['age']}}岁" />
-    <t-cell t-class="cell-border-gradient" required title="性别" note="{{dictionary.label($dictionaries, 'sys_user_sex', model['sex'])}}" />
+    <!-- <t-cell t-class="cell-border-gradient" required title="年龄" note="{{model['age']}}岁" />
+    <t-cell t-class="cell-border-gradient" required title="性别" note="{{dictionary.label($dictionaries, 'sys_user_sex', model['sex'])}}" /> -->
     <user-data-edit model="{{model}}" retractable="{{true}}" dirty="{{dirty}}"></user-data-edit>
 
     <view class="privacy-contract-wrapper">

+ 5 - 0
miniprogram/module/user/pages/user-record/user-record.json

@@ -0,0 +1,5 @@
+{
+  "renderer": "skyline",
+  "component": true,
+  "usingComponents": {}
+}

+ 49 - 0
miniprogram/module/user/pages/user-record/user-record.scss

@@ -0,0 +1,49 @@
+@import '../../../../themes/page.scss';
+/* module/user/pages/user-record/user-record.wxss */
+
+.wrapper {
+  display: flex;
+  $border: 1px solid #34FFC6;
+
+
+  &.portrait {
+    flex-direction: row;
+    flex-wrap: nowrap;
+    border-top: $border;
+    border-bottom: $border;
+
+    .header {
+      flex: none;
+      border-right: $border;
+
+      .row {
+        width: 90px;
+      }
+    }
+
+    .scrollable {
+      flex: auto;
+    }
+
+    .row {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 120px;
+      padding: 4px;
+      box-sizing: border-box;
+
+      &.odd {
+        background-color: #113B38;
+      }
+    }
+
+    .col+.col {
+      border-left: $border;
+    }
+  }
+}
+
+.highlight {
+  color: #FD3F3F;
+}

+ 70 - 0
miniprogram/module/user/pages/user-record/user-record.ts

@@ -0,0 +1,70 @@
+import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
+// module/user/pages/user-record/user-record.ts
+import { getUserInfoMethod, getUserRecordMethod } from "../../request";
+import { getPageOrientation } from "../../../../lib/wx/page";
+
+interface Column {
+  label: string;
+  value: string;
+  width?: number;
+  height?: number;
+}
+const defaultColumns: Column[] = [
+  { label: '', value: 'reportTime' },
+  { label: '女性特殊期', value: 'womenSpecialPeriod' },
+  { label: '身高', value: 'height' },
+  { label: '体重', value: 'weight' },
+  { label: '饮酒情况', value: 'drinkState' },
+  { label: '吸烟情况', value: 'smokeState' },
+  { label: '食物过敏', value: 'foodAllergy' },
+  { label: '喜好口味', value: 'hobbyFlavor' },
+  { label: '职业', value: 'job' },
+]
+
+Component({
+  behaviors: [
+    tickleBehavior,
+  ],
+  lifetimes: {
+    attached() { this.load(); }
+  },
+  properties: {},
+  data: {
+    orientation: '' as 'portrait' | 'landscape',
+    containerStyle: '',
+    columns: [] as Column[],
+  },
+  methods: {
+    async getColumns() {
+      const { orientation, width, height, left = 0, right = 0, } = getPageOrientation();
+
+      const { sex } = await getUserInfoMethod();
+      const columns = sex === '1'
+        ? [...defaultColumns]
+        : defaultColumns.filter(item => item.value !== 'womenSpecialPeriod');
+
+      if (orientation === 'portrait') {
+        columns[0].height = 50;
+        const length = columns.length;
+        const rowHeight = Math.floor((height - columns[0].height) / (length - 1));
+        for (let index = 1; index < length; index++) { columns[index].height = rowHeight; }
+      }
+      this.setData({
+        columns,
+        orientation,
+        containerStyle: `width: ${width}px;height: ${height}px;margin-left: ${left}px;margin-right: ${right}px;`
+      })
+    },
+    async load() {
+      wx.showLoading({ title: '加载中' });
+      try {
+        await this.getColumns();
+        const { data } = await getUserRecordMethod();
+        this.setData({ dataset: data });
+      } catch (error) {
+        getTickleContext.call(this).showErrorMessage(error.errMsg)
+      }
+      wx.hideLoading();
+    }
+  }
+})

+ 25 - 0
miniprogram/module/user/pages/user-record/user-record.wxml

@@ -0,0 +1,25 @@
+<wxs module="_">
+  module.exports.getClassName = function (value, prev, key) {
+    return key !== 'reportTime' &&  prev && value[key] !== prev[key] ? 'highlight' : ''
+  }
+</wxs>
+<!--module/user/pages/user-record/user-record.wxml-->
+<t-navbar title="基础信息更新记录" left-arrow />
+<view class="wrapper {{orientation}}" style="{{containerStyle}}">
+  <view class="header">
+    <block wx:for="{{columns}}" wx:key="value" wx:for-index="i" wx:for-item="r">
+      <view class="row {{i === 0 ? 'title' : i % 2 ? 'odd' : 'even'}}" style="height: {{r.height}}px;">{{r.label}}</view>
+    </block>
+  </view>
+  <scroll-view class="scrollable" type="list" scroll-x enable-flex style="flex-direction: row;">
+    <view class="col" wx:for="{{dataset}}" wx:key="index">
+      <block wx:for="{{columns}}" wx:key="value" wx:for-index="i" wx:for-item="r">
+        <view class="row {{i === 0 ? 'title' : i % 2 ? 'odd' : 'even'}} {{_.getClassName(item, dataset[index-1], r.value)}}" style="height: {{r.height}}px;">
+          <text max-lines="3" overflow="ellipsis">{{item[r.value]}}</text>
+        </view>
+      </block>
+    </view>
+  </scroll-view>
+</view>
+
+<t-message id="{{$messageId}}" />

+ 39 - 0
miniprogram/module/user/request.ts

@@ -1,4 +1,5 @@
 import { Get, Post } from "../../lib/request/method";
+import dayjs from "dayjs";
 
 const ref = ['province', 'city', 'area'] as const;
 const ref2 = ['womenSpecialPeriod', 'foodAllergy', 'hobbyFlavor', 'job'] as const;
@@ -64,4 +65,42 @@ export async function updateUserInfoMethod(data: App.Patient.Model) {
 
 export function verifyCardnoMethod(value: string) {
   return Get(`/patientInfoManage/isExistCardno`, { params: { cardno: value }, transform({ data }) { return data } })
+}
+
+export async function getUserRecordMethod() {
+  const { data: $dictionaries } = await Get(`/dict/getDicts`);
+  const $is: AnyArray = $dictionaries.find((item: AnyObject) => item.dictType === 'sys_yes_no')?.items ?? [];
+  const $w: AnyArray = $dictionaries.find((item: AnyObject) => item.dictType === 'women_special_period')?.items ?? [];
+  const $f: AnyArray = $dictionaries.find((item: AnyObject) => item.dictType === 'food_allergy')?.items ?? [];
+  const $h: AnyArray = $dictionaries.find((item: AnyObject) => item.dictType === 'hobby_flavor')?.items ?? [];
+  const $j: AnyArray = $dictionaries.find((item: AnyObject) => item.dictType === 'job')?.items ?? [];
+
+  const get = (value: string, $dictionaries: AnyArray) => {
+    return value?.split(',')
+      .map(value => $dictionaries.find(item => item.dictValue === value)?.dictLabel)
+      .filter(Boolean)
+      .join(', ')
+  }
+
+
+  return Post(`/patientInfoManage/pageChangeRecord`, {}, {
+    transform({ data }: AnyObject) {
+      return {
+        total: data.total,
+        data: data.data?.map((item: AnyObject) => {
+          return {
+            reportTime: dayjs(item.createTime).format('YY/MM/DD'),
+            height: item.height ? `${item.height}cm` : '',
+            weight: item.weight ? `${item.weight}kg` : '',
+            smokeState: get(item.smokeState, $is),
+            drinkState: get(item.drinkState, $is),
+            foodAllergy: get(item.foodAllergy, $f),
+            hobbyFlavor: get(item.hobbyFlavor, $h),
+            job: get(item.job, $j),
+            womenSpecialPeriod: get(item.womenSpecialPeriod, $w),
+          }
+        })
+      };
+    }
+  })
 }

+ 1 - 1
miniprogram/pages/home/body-model/body-model.wxml

@@ -31,7 +31,7 @@
       <view class="frame-wrapper">
         <image src="../../../assets/bg/body-model-frame.bg.png" mode="aspectFit" />
         <view class="content">
-          <view>中医型</view>
+          <view>中医型</view>
           <form-button index="2">{{dataset.diagnoseSyndromeSummary}}</form-button>
         </view>
       </view>

+ 4 - 1
miniprogram/pages/home/home.ts

@@ -48,8 +48,9 @@ Component({
       await login();
       wx.showLoading({ title: '加载中' });
       const { patient } = await getPatients(this.data.patientId);
-      if (!patient) toCertificationPage();
+      if (!patient) await toCertificationPage();
       else this.setData({ patient });
+      wx.hideLoading();
     },
 
     async _getHealthReport() {
@@ -60,12 +61,14 @@ Component({
         this.setData({
           'healthReport.data': data,
           'healthReport.loading': false,
+          healthId: data?.healthAnalysisReportId,
         });
       } catch (error) {
         this.setData({
           'healthReport.data': [],
           'healthReport.loading': false,
           'healthReport.message': error.errMsg,
+          healthId: '',
         });
       }
       wx.hideLoading();

+ 1 - 1
miniprogram/themes/t.cell.scss

@@ -45,7 +45,7 @@
 
   &__suffix {
     position: absolute;
-    color: var(--td-text-color-secondary, #939393);
+    // color: var(--td-text-color-secondary, #939393);
     transform: translateY(-1rpx);
   }
 }

+ 2 - 2
typings/app/health.d.ts

@@ -5,7 +5,7 @@ declare namespace App.Health.Index {
     name: string;
     /** 单位 */
     unit: string;
-    precision?: number;
+    precision: number;
     /** 值 */
     values?: { value: number; abnormal: boolean; description?: string; date?: string }[];
     /** 值范围 */
@@ -25,7 +25,7 @@ declare namespace App.Health.Index {
     inputMax?: number;
     inputPrecision?: number;
 
-    isAuto?: boolean;
+    isAuto?: 'Y' | 'N';
     patientQuotaRecordDTOS?: { quotaVal: string; abnormal: boolean; abnormalDesc?: string, time2?: string; }[]
   }
 

+ 2 - 0
typings/app/request.d.ts

@@ -18,6 +18,8 @@ interface IRequestConfig<R, T> {
 type IRequestData<T> = {
   code: number;
   msg: string;
+  total?: number;
+  rows?: any[];
   data: T;
   success?: boolean;
   warn?: boolean;