wifiSuccess.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='配置网络'></cus-header>
  4. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/e6540154-b4da-4ddd-ab9b-8f219d5c18a6.png"></image>
  5. <p>网络配置成功</p>
  6. <p class="tip">请扫描设备或说明书上的二维码<br>点击下方扫码绑定设备,<br>如您已添加过设备,可返回首页开始使用</p>
  7. <div class="zt_btn" @tap="scanDevice">扫码绑定设备</div>
  8. <div class="qx_btn" @tap="goBack">返回首页</div>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data(){
  14. return {
  15. }
  16. },
  17. methods:{
  18. scanDevice(){
  19. let that = this;
  20. uni.scanCode({
  21. success: (res) => {
  22. let result = JSON.parse(res.result);
  23. if(res.errMsg==='scanCode:ok'){
  24. uni.navigateTo({
  25. url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
  26. })
  27. // that.$api.post('/device/bind',{
  28. // ...result,
  29. // "type": "",
  30. // "userId": 0,
  31. // "agentId": ""
  32. // }).then(res=>{
  33. // if(res.data.code!==0) return that.$showToast(res.data.msg)
  34. // uni.navigateTo({
  35. // url:'/pagesMy/scanResult?deviceId='+res.data.data
  36. // })
  37. // })
  38. }
  39. }
  40. })
  41. },
  42. goBack(){
  43. uni.reLaunch({
  44. url:'/pages/home'
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped lang="less">
  51. .page{
  52. background: #FFFFFF;
  53. display: flex;
  54. flex-direction: column;
  55. align-items: center;
  56. padding: 0 70rpx;
  57. image{
  58. width: 213rpx;
  59. height: 163rpx;
  60. margin-top: 198rpx;
  61. }
  62. p{
  63. font-family: PingFang-SC, PingFang-SC;
  64. font-weight: bold;
  65. font-size: 40rpx;
  66. color: #111111;
  67. line-height: 40rpx;
  68. text-align: center;
  69. margin-top: 54rpx;
  70. &.tip{
  71. font-weight: 400;
  72. font-size: 28rpx;
  73. color: #7C8592;
  74. line-height: 42rpx;
  75. text-align: center;
  76. margin-top: 40rpx;
  77. }
  78. }
  79. .zt_btn{
  80. margin-top: 193rpx;
  81. }
  82. .qx_btn{
  83. margin-top: 60rpx;
  84. }
  85. }
  86. </style>