scanResult.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header :title='htitle'></cus-header>
  4. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/ea285d8f-ad96-447e-8f4a-77d495f2fac6.png"></image>
  5. <p>{{title}}</p>
  6. <template v-if="type=='jpw'">
  7. <p class="tip">设备配网成功<br>快去首页使用吧~</p>
  8. <div class="zt_btn" @tap="goBack">返回首页</div>
  9. </template>
  10. <template v-else>
  11. <p class="tip">设备已就绪,需添加角色才能使用<br>快去创建角色吧~</p>
  12. <div class="zt_btn" @tap="addRole">为设备添加角色</div>
  13. </template>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data(){
  19. return {
  20. scanParams:'',
  21. htitle:'扫码结果',
  22. title:'扫码成功',
  23. type:''
  24. }
  25. },
  26. onLoad(option) {
  27. this.type = option.pwtype||'';
  28. if(option.scanParams) this.scanParams = JSON.parse(option.scanParams);
  29. if(option.type&&option.type=='lanya'){
  30. this.htitle = '配网结果';
  31. this.title = '配网成功';
  32. }
  33. },
  34. methods:{
  35. addRole(){
  36. uni.navigateTo({
  37. url:'/pagesRole/addRole?type=1&scanParams='+JSON.stringify(this.scanParams)
  38. })
  39. },
  40. goBack(){
  41. uni.reLaunch({
  42. url:'/pages/home'
  43. })
  44. },
  45. }
  46. }
  47. </script>
  48. <style scoped lang="less">
  49. .page{
  50. background: #FFFFFF;
  51. display: flex;
  52. flex-direction: column;
  53. align-items: center;
  54. padding: 0 60rpx;
  55. image{
  56. width: 400rpx;
  57. height: 430rpx;
  58. margin-top: 92rpx;
  59. }
  60. p{
  61. font-family: PingFang-SC, PingFang-SC;
  62. font-weight: bold;
  63. font-size: 40rpx;
  64. color: #111111;
  65. line-height: 40rpx;
  66. text-align: center;
  67. margin-top: 35rpx;
  68. &.tip{
  69. font-weight: 400;
  70. font-size: 26rpx;
  71. color: #7C8592;
  72. line-height: 41rpx;
  73. text-align: center;
  74. margin-top: 29rpx;
  75. }
  76. }
  77. .zt_btn{
  78. margin-top: 232rpx;
  79. }
  80. .qx_btn{
  81. margin-top: 60rpx;
  82. }
  83. }
  84. </style>