hh-doctor-sdk 0.6.7 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ module.exports = Behavior({
39
39
  loadList() {
40
40
  wx.showNavigationBarLoading()
41
41
  this.setData({
42
- showEmpty: false
42
+ isLoading: true
43
43
  })
44
44
  api.orderList().then((res) => {
45
45
  wx.hideNavigationBarLoading()
@@ -58,10 +58,11 @@ module.exports = Behavior({
58
58
  if (orderModel.responseOrderList && orderModel.responseOrderList.length > 0) {
59
59
  orderGroups.push(this._buildGroup(false, '我的回复', orderModel.responseOrderList))
60
60
  }
61
- let showEmpty = orderGroups.length == 0
61
+ let showEmpty = orderGroups.length === 0
62
62
  this.setData({
63
63
  orderGroup: orderGroups,
64
- showEmpty: showEmpty
64
+ showEmpty: showEmpty,
65
+ isLoading: false
65
66
  })
66
67
  }
67
68
  },
@@ -11,7 +11,8 @@ Page({
11
11
  */
12
12
  data: {
13
13
  init: false,
14
- isLogin: false
14
+ isLogin: false,
15
+ isLoading: true,
15
16
  },
16
17
 
17
18
  /**
@@ -30,12 +31,22 @@ Page({
30
31
  * 生命周期函数--监听页面显示
31
32
  */
32
33
  onShow() {
34
+ // 初始显示loading状态
35
+ this.setData({
36
+ isLoading: true,
37
+ isLogin: false
38
+ })
39
+
33
40
  if (!wx.loginConfig || !wx.loginConfig.judgeLogin) {
34
41
  wx.showToast({
35
42
  title: '未配置登录检测',
36
43
  })
44
+ this.setData({
45
+ isLoading: false
46
+ })
37
47
  return
38
48
  }
49
+
39
50
  const judgeLogin = wx.loginConfig.judgeLogin()
40
51
  if (judgeLogin) {
41
52
  wx.statLog.sendStatLog(null, '打开咨询单列表界面')
@@ -47,6 +58,9 @@ Page({
47
58
  doctorId: doctorId
48
59
  })
49
60
  if (!doctorId) {
61
+ this.setData({
62
+ isLoading: false
63
+ })
50
64
  wx.showModal({
51
65
  title: "提示",
52
66
  showCancel: false,
@@ -60,6 +74,9 @@ Page({
60
74
  }
61
75
  })
62
76
  } else {
77
+ this.setData({
78
+ isLogin: true
79
+ })
63
80
  doctorLoader.loadDoctor({
64
81
  doctorId: doctorId,
65
82
  isTest: isTest,
@@ -78,7 +95,8 @@ Page({
78
95
  }
79
96
  } else {
80
97
  this.setData({
81
- isLogin: true
98
+ isLogin: false,
99
+ isLoading: false
82
100
  })
83
101
  // wx.showModal({
84
102
  // showCancel: true,
@@ -1,5 +1,12 @@
1
1
  <view class="match-parent">
2
- <view wx:if="{{!showEmpty}}" class="order-list-body">
2
+ <!-- Loading状态 -->
3
+ <view wx:if="{{isLoading}}" class="loading-body">
4
+ <view class="loading-spinner"></view>
5
+ <view class="loading-text">加载中...</view>
6
+ </view>
7
+
8
+ <!-- 已登录且有数据时显示列表 -->
9
+ <view wx:elif="{{isLogin && !showEmpty}}" class="order-list-body">
3
10
  <block wx:for="{{orderGroup}}" wx:key="orderGroup" wx:for-item="group">
4
11
  <view
5
12
  id="{{group.sectionId}}"
@@ -48,7 +55,9 @@
48
55
  </view>
49
56
  </block>
50
57
  </view>
51
- <view wx:elif="{{showEmpty || !isLogin}}" class="empty-body">
58
+
59
+ <!-- 空数据状态 -->
60
+ <view wx:else class="empty-body">
52
61
  <image class="empty-body-image"
53
62
  src="https://image.hh-medic.com/icon/pacs/hh_icon_no_order_data.png"
54
63
  />
@@ -141,4 +141,33 @@ page {
141
141
  .empty-body-text {
142
142
  color: #999999;
143
143
  font-size: 30rpx;
144
+ }
145
+
146
+ .loading-body {
147
+ width: 100%;
148
+ height: 100%;
149
+ display: flex;
150
+ flex-direction: column;
151
+ align-items: center;
152
+ justify-content: center;
153
+ }
154
+
155
+ .loading-spinner {
156
+ width: 60rpx;
157
+ height: 60rpx;
158
+ border: 4rpx solid #f3f3f3;
159
+ border-top: 4rpx solid #0c92f0;
160
+ border-radius: 50%;
161
+ animation: spin 1s linear infinite;
162
+ margin-bottom: 20rpx;
163
+ }
164
+
165
+ @keyframes spin {
166
+ 0% { transform: rotate(0deg); }
167
+ 100% { transform: rotate(360deg); }
168
+ }
169
+
170
+ .loading-text {
171
+ color: #666666;
172
+ font-size: 28rpx;
144
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hh-doctor-sdk",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "和缓名医小程序SDK",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"