|
|
@@ -55,13 +55,30 @@ Component({
|
|
|
|
|
|
this._next()
|
|
|
},
|
|
|
- _start() {
|
|
|
- this.setData({
|
|
|
- [`_next.dialogId`]: '',
|
|
|
- [`_next.questions`]: [],
|
|
|
- _timestamp: Date.now(),
|
|
|
- })
|
|
|
- this._next();
|
|
|
+ async _start() {
|
|
|
+ try {
|
|
|
+ const count = await Post(`/patientInfoManage/rechargeUseDetail`, {}, {
|
|
|
+ transform({ data }: any) {
|
|
|
+ return data?.residuedCou
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (count > 0) {
|
|
|
+ this.setData({
|
|
|
+ [`_next.dialogId`]: '',
|
|
|
+ [`_next.questions`]: [],
|
|
|
+ _timestamp: Date.now(),
|
|
|
+ })
|
|
|
+ this._next();
|
|
|
+ } else {
|
|
|
+ throw {errMsg: `您的健康分析次数已用完,请联系工作人员。`}
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this._createMessage({
|
|
|
+ id: `system-start`, type: 'system',
|
|
|
+ payload: { date: Date.now(), title: error.errMsg ?? `分析错误,请重试!`, }
|
|
|
+ });
|
|
|
+ this._end();
|
|
|
+ }
|
|
|
},
|
|
|
_end() {
|
|
|
this.setData({
|