wifiSuccess.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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/05/29/f3204634-5cd2-4b0d-aae4-7308a276d8d9.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. that.$api.post('/device/bind',{
  25. ...result,
  26. "type": "",
  27. "userId": 0,
  28. "agentId": ""
  29. }).then(res=>{
  30. if(res.data.code!==0) return that.$showToast(res.data.msg)
  31. uni.navigateTo({
  32. url:'/pagesMy/scanResult?deviceId='+res.data.data
  33. })
  34. })
  35. }
  36. }
  37. })
  38. },
  39. goBack(){
  40. uni.reLaunch({
  41. url:'/pages/home'
  42. })
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped lang="less">
  48. .page{
  49. background: #FFFFFF;
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. padding: 0 70rpx;
  54. image{
  55. width: 213rpx;
  56. height: 163rpx;
  57. margin-top: 198rpx;
  58. }
  59. p{
  60. font-family: PingFang-SC, PingFang-SC;
  61. font-weight: bold;
  62. font-size: 40rpx;
  63. color: #111111;
  64. line-height: 40rpx;
  65. text-align: center;
  66. margin-top: 54rpx;
  67. &.tip{
  68. font-weight: 400;
  69. font-size: 28rpx;
  70. color: #7C8592;
  71. line-height: 42rpx;
  72. text-align: center;
  73. margin-top: 40rpx;
  74. }
  75. }
  76. .zt_btn{
  77. margin-top: 193rpx;
  78. }
  79. .qx_btn{
  80. margin-top: 60rpx;
  81. }
  82. }
  83. </style>