wifiSuccess.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='配置网络'></cus-header>
  4. <image src="http://106.54.209.120:8188/static/wifi_success.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. uni.navigateTo({
  20. url:'/pagesMy/scanResult'
  21. })
  22. return
  23. uni.scanCode({
  24. success: (res) => {
  25. let result = JSON.parse(res.result);
  26. if(res.errMsg==='scanCode:ok'){
  27. this.$api.post('/device/bindAdd',{
  28. ...result,
  29. "type": "",
  30. "userId": 0,
  31. "agentId": ""
  32. }).then(res=>{
  33. if(res.data.code!==0) return this.$showToast(res.data.msg)
  34. uni.navigateTo({
  35. url:'/pagesMy/scanResult'
  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>