@atomicservice/ascf-base 1.0.15 → 1.0.16

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.
Files changed (31) hide show
  1. package/dist/index.d.mts +7 -1
  2. package/dist/index.d.ts +7 -1
  3. package/dist/index.js +76 -76
  4. package/dist/index.mjs +76 -76
  5. package/dist/templates/ascfDemos/page/API/pages/appEvent/appEvent.js +4 -3
  6. package/dist/templates/ascfDemos/page/API/pages/camera/camera.js +1 -1
  7. package/dist/templates/ascfDemos/page/API/pages/choose-location/choose-location.js +1 -1
  8. package/dist/templates/ascfDemos/page/API/pages/compass/compass.js +2 -2
  9. package/dist/templates/ascfDemos/page/API/pages/contact/contact.js +1 -1
  10. package/dist/templates/ascfDemos/page/API/pages/deviceMotionListening/deviceMotionListening.js +3 -3
  11. package/dist/templates/ascfDemos/page/API/pages/download-file/download-file.js +0 -1
  12. package/dist/templates/ascfDemos/page/API/pages/file/file.js +3 -0
  13. package/dist/templates/ascfDemos/page/API/pages/get-hxml-info/get-hxml-info.js +6 -6
  14. package/dist/templates/ascfDemos/page/API/pages/get-system-info/get-system-info.js +10 -10
  15. package/dist/templates/ascfDemos/page/API/pages/getNetworkType/getNetworkType.js +1 -6
  16. package/dist/templates/ascfDemos/page/API/pages/gyroscope/gyroscope.js +1 -0
  17. package/dist/templates/ascfDemos/page/API/pages/image/image.js +1 -1
  18. package/dist/templates/ascfDemos/page/API/pages/make-phone-call/make-phone-call.js +1 -1
  19. package/dist/templates/ascfDemos/page/API/pages/scan-code/scan-code.js +1 -1
  20. package/dist/templates/ascfDemos/page/API/pages/set-tab-bar/set-tab-bar.js +22 -2
  21. package/dist/templates/ascfDemos/page/API/pages/video/video.js +1 -0
  22. package/dist/templates/ascfDemos/page/API/pages/webSocket/webSocket.js +1 -0
  23. package/dist/templates/ascfDemos/page/API/pages/wifi/wifi.js +1 -0
  24. package/dist/templates/ascfDemos/page/component/pages/icon/icon.js +1 -1
  25. package/dist/templates/ascfDemos/page/component/pages/picker/picker.js +0 -1
  26. package/dist/templates/ascfDemos/page/component/pages/radio/radio.js +2 -2
  27. package/dist/templates/ascfDemos/page/component/pages/swiper/swiper.js +2 -1
  28. package/dist/templates/ascfDemos/page/open/pages/choose-address/choose-address.js +1 -0
  29. package/dist/templates/ascfDemos/page/open/pages/choose-invoice-title/choose-invoice-title.js +1 -1
  30. package/dist/templates/ascfDemos/page/open/pages/message/message.js +1 -1
  31. package/package.json +1 -1
@@ -14,9 +14,10 @@ Page({
14
14
  isappHide: 'false',
15
15
  isonPageNotFound: 'false',
16
16
  isonError: 'false',
17
- onAppShowListener: '',
18
- onAppHideListener: '',
19
- onPageNotFoundListener: '',
17
+ onAppShowListener: ()=>{},
18
+ onAppHideListener: ()=>{},
19
+ onPageNotFoundListener: ()=>{},
20
+ onErrorListener: ()=>{}
20
21
  },
21
22
 
22
23
  openone() {
@@ -117,7 +117,7 @@ Page({
117
117
  toggleFlash() {
118
118
  const that = this
119
119
  that.setData({
120
- enableflash: !that.data.enableflash
120
+ enableflash: that.data.enableflash
121
121
  })
122
122
  },
123
123
  toggleFlash1() {
@@ -1,7 +1,7 @@
1
1
  Page({
2
2
  data: {
3
3
  hasLocation: false,
4
- location: null,
4
+ location: {},
5
5
  },
6
6
  chooseLocation() {
7
7
  let that = this;
@@ -8,7 +8,7 @@ Page({
8
8
  const that = this
9
9
  has.onCompassChange(res => {
10
10
  that.setData({
11
- direction: parseInt(res.direction, 10),
11
+ direction: res.direction,
12
12
  resData: JSON.stringify(res),
13
13
  enabled: true
14
14
  })
@@ -69,7 +69,7 @@ Page({
69
69
  const that = this
70
70
  has.onCompassChange(res => {
71
71
  that.setData({
72
- direction: parseInt(res.direction, 10),
72
+ direction: res.direction,
73
73
  resData: JSON.stringify(res),
74
74
  enabled: true
75
75
  })
@@ -37,7 +37,7 @@ Page({
37
37
  success(res) {
38
38
  that.setData({
39
39
  name: res.displayName,
40
- phoneNumber: res.phoneNumber || res.phoneNumberList,
40
+ phoneNumber: res.phoneNumber,
41
41
  Avatar:that.getAvatar(res.displayName)
42
42
  });
43
43
  console.log('chooseContact success', res);
@@ -1,9 +1,9 @@
1
1
  Page({
2
2
  data: {
3
3
  isListening: false,
4
- alpha: '',
5
- beta: '',
6
- gamma: '',
4
+ alpha: 0,
5
+ beta: 0,
6
+ gamma: 0,
7
7
  },
8
8
  onLoad(options) {
9
9
  has.startDeviceMotionListening({ interval: 'ui' });
@@ -23,7 +23,6 @@ Page({
23
23
  has.downloadFile({
24
24
  // 此地址为测试用资源,请开发者根据自身需求进行替换。
25
25
  url: downloadExampleUrl,
26
- timeout: 5000,
27
26
  success(res) {
28
27
  has.showToast({
29
28
  title: '下载成功'
@@ -31,6 +31,9 @@ Page({
31
31
  encoding: 'utf-8',
32
32
  position: 0,
33
33
  success(e) {
34
+ if (typeof(e.data) !== "string") {
35
+ return;
36
+ }
34
37
  has.showModal({
35
38
  title: '读取成功',
36
39
  content: e.data,
@@ -1,11 +1,11 @@
1
1
  Page({
2
2
  data: {
3
- left: '',
4
- right: '',
5
- top: '',
6
- bottom: '',
7
- width: '',
8
- height: '',
3
+ left: 0,
4
+ right: 0,
5
+ top: 0,
6
+ bottom: 0,
7
+ width: 0,
8
+ height: 0,
9
9
  },
10
10
  onLoad(){
11
11
  this.select()
@@ -3,19 +3,19 @@ Page({
3
3
  systemInfo: {},
4
4
  brand:'',
5
5
  model:'',
6
- screenWidth:'',
7
- screenHeight:'',
8
- windowWidth:'',
9
- windowHeight:'',
10
- statusBarHeight:'',
11
- indicatorHeight:'',
6
+ screenWidth:0,
7
+ screenHeight:0,
8
+ windowWidth:0,
9
+ windowHeight:0,
10
+ statusBarHeight:0,
11
+ indicatorHeight:0,
12
12
  language:'',
13
13
  SDKVersion:'',
14
14
  OSApiVersion:'',
15
- fontSizeSetting:'',
16
- bluetoothEnabled:'',
17
- locationEnabled:'',
18
- wifiEnabled:'',
15
+ fontSizeSetting:0,
16
+ bluetoothEnabled:false,
17
+ locationEnabled:false,
18
+ wifiEnabled:false,
19
19
  deviceOrientation:'',
20
20
  theme:''
21
21
  },
@@ -9,12 +9,7 @@ Page({
9
9
  that.setData({
10
10
  networkType: res.networkType,
11
11
  });
12
- },
13
- fail: function success(res) {
14
- that.setData({
15
- networkType: res.networkType,
16
- });
17
- },
12
+ }
18
13
  });
19
14
  },
20
15
  });
@@ -44,6 +44,7 @@ Page({
44
44
  }
45
45
  const that = this
46
46
  has.startGyroscope({
47
+ // @ts-ignore
47
48
  interval: this.data.setInterval,
48
49
  success() {
49
50
  that.setData({
@@ -2,7 +2,7 @@ const { downloadExampleUrl } = require('../../../../config/global.config')
2
2
  Page({
3
3
  data: {
4
4
  imageSrc: downloadExampleUrl,
5
- imageInfo: '',
5
+ imageInfo: {},
6
6
  },
7
7
  chooseImage() {
8
8
  const that = this;
@@ -1,6 +1,6 @@
1
1
  Page({
2
2
  data: {
3
- number: 0,
3
+ number: '',
4
4
  },
5
5
  numberChange(e) {
6
6
  this.setData({
@@ -9,7 +9,7 @@ Page({
9
9
  that.setData({
10
10
  res:res.result
11
11
  })
12
- console.log('scanCode success',e);
12
+ console.log('scanCode success',res);
13
13
  },
14
14
  });
15
15
  },
@@ -13,10 +13,30 @@ Component({
13
13
  let isShowTab = this.data.isShowTab;
14
14
  if (isShowTab) {
15
15
  isShowTab = false;
16
- has.hideTabBar();
16
+ has.hideTabBar({
17
+ success: function (res) {
18
+ console.log('hideTabBar 回调成功:' + JSON.stringify(res));
19
+ },
20
+ fail: function (res) {
21
+ console.log('hideTabBar 回调失败:' + JSON.stringify(res));
22
+ },
23
+ complete: function (res) {
24
+ console.log('hideTabBar 回调完成:' + JSON.stringify(res));
25
+ }
26
+ });
17
27
  } else {
18
28
  isShowTab = true;
19
- has.showTabBar();
29
+ has.showTabBar({
30
+ success: function (res) {
31
+ console.log('showTabBar 回调成功:' + JSON.stringify(res));
32
+ },
33
+ fail: function (res) {
34
+ console.log('showTabBar 回调失败:' + JSON.stringify(res));
35
+ },
36
+ complete: function (res) {
37
+ console.log('showTabBar 回调完成:' + JSON.stringify(res));
38
+ }
39
+ });
20
40
  }
21
41
  this.setData({
22
42
  isShowTab,
@@ -2,6 +2,7 @@ Page({
2
2
  data: {
3
3
  src: '/video/tempVideo.mp4',
4
4
  isPlay: false,
5
+ /** @type {any} */
5
6
  videoContext: '',
6
7
  },
7
8
  onReady: function (res) {
@@ -77,6 +77,7 @@ Page({
77
77
  sendMessage() {
78
78
  const that = this;
79
79
  has.onSocketMessage(res => {
80
+ if (typeof(res.data) !== "string") return;
80
81
  has.showModal({
81
82
  title: '发送成功',
82
83
  content: res.data,
@@ -1,5 +1,6 @@
1
1
  Page({
2
2
  data: {
3
+ /** @type any */
3
4
  wifiList: [],
4
5
  showPopup: false,
5
6
  password: '',
@@ -2,7 +2,7 @@ Page({
2
2
  data: {
3
3
  items: [
4
4
  { value: '40', name: '40' },
5
- { value: '60', name: '60', checked: 'true' },
5
+ { value: '60', name: '60', checked: true },
6
6
  { value: '80', name: '80' }
7
7
  ],
8
8
  eventData: '60'
@@ -5,7 +5,6 @@ Page({
5
5
  array: ['苹果', '橙子', '草莓', '樱桃', '火龙果'],
6
6
  multiArray: [['短袖', '裤子', '长裙', '短裙', '连衣裙'], ['白色', '蓝色', '黄色', '红色'], ['XS', 'S', 'M', 'L']],
7
7
  multiIndex: [0, 0, 0],
8
- index: 0,
9
8
  startDay: '2015-01-01',
10
9
  endDay: '2030-01-01',
11
10
  date: '2025-01-01',
@@ -1,10 +1,10 @@
1
1
  Page({
2
2
  data: {
3
3
  items: [
4
- {value: 'A', name: 'A', checked: 'true'},
4
+ {value: 'A', name: 'A', checked: true},
5
5
  {value: 'B', name: 'B'},
6
6
  {value: 'C', name: 'C'},
7
- {value: 'D', name: 'D', isdisabled:'true'}
7
+ {value: 'D', name: 'D', isdisabled:true}
8
8
  ],
9
9
  ischecked:true,
10
10
  isdisabled:false,
@@ -5,7 +5,8 @@ Page({
5
5
  autoplay: false,
6
6
  interval: 1000,
7
7
  duration: 500,
8
- current: 0
8
+ current: 0,
9
+ vertical: false
9
10
  },
10
11
 
11
12
  changeIndicatorDots() {
@@ -1,5 +1,6 @@
1
1
  Page({
2
2
  data: {
3
+ /** @type {any} */
3
4
  addressInfo: null,
4
5
  },
5
6
  chooseAddress() {
@@ -1,6 +1,6 @@
1
1
  Page({
2
2
  data: {
3
- type: '',
3
+ type: 0,
4
4
  title: '',
5
5
  taxNumber: '',
6
6
  bankAccount: '',
@@ -47,7 +47,7 @@ Page({
47
47
  has.request({
48
48
  // 此地址为测试用资源,请开发者根据自身需求进行替换。
49
49
  url: echoNotification,
50
- method: 'post',
50
+ method: 'GET',
51
51
  header: {
52
52
  'content-type': 'application/json',
53
53
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomicservice/ascf-base",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "author": "atomicservice",
5
5
  "description": "ascf base",
6
6
  "files": [