123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <script>
-
- var alog = uni.requireNativePlugin("AndroidLog")
-
- import update from '@/utils/update.js';
- import deviceUt from '@/utils/deviceUtils.js';
- import pushreg from '@/utils/pushUtils.js';
-
- export default {
- onLaunch: function() {
-
- update(this);
- deviceUt.devicereg(this);
- pushreg();
-
-
- this.$u.api.deviceReg({
- deviceNo: '123456789',
- pushCid: '123456789'
- })
- .then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: '设备注册成功',
- duration: 2000
- });
- } else {
- uni.showToast({
- title: '设备注册失败',
- duration: 2000
- });
- }
- }).catch(err => {
- uni.showToast({
- title: '设备注册失败',
- duration: 2000
- });
- });
-
- },
- onShow: function() {
-
- },
- onHide: function() {
-
- }
- }
- </script>
- <style lang="scss">
- @import "uview-ui/index.scss";
-
- </style>
|