wifiSuccess.vue 1.8 KB

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