wifiSet.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='WiFi配置' bgColor="transparent"></cus-header>
  4. <div class="box">
  5. <div class="b_top adffcacjc">
  6. <image src="@/static/wifi.png"></image>
  7. <text>WiFi配置</text>
  8. </div>
  9. <div class="b_pre">
  10. <div class="bp_text">SSID:</div>
  11. <div class="bp_inp">
  12. <input type="text">
  13. </div>
  14. </div>
  15. <div class="b_pre">
  16. <div class="bp_text">密码:</div>
  17. <div class="bp_inp">
  18. <input type="password">
  19. </div>
  20. </div>
  21. <div class="zt_btn" @tap="toConnectWiFi">连接</div>
  22. </div>
  23. <div class="box">
  24. <div class="b_title">从下面列表选择2.4GWiFi:</div>
  25. <div class="b_wifi adfac" v-for="(item,index) in wifi2gList" :key="index" @tap="toCode">
  26. <text>{{'REITH SPAEC(-40 dBm)'}}</text>
  27. <image src="@/static/lock.png"></image>
  28. </div>
  29. </div>
  30. <u-popup :show="show" mode="center" @close="close">
  31. <div class="fail_box adffcacjc">
  32. <image src="@/static/connect_off.png"></image>
  33. <text>网络连接失败</text>
  34. <p>请检查你的网络设置后刷新</p>
  35. <div class="zt_btn" @tap="toTryAgain">重试</div>
  36. </div>
  37. </u-popup>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data(){
  43. return {
  44. wifi2gList:[1,1,1],
  45. show:false
  46. }
  47. },
  48. methods:{
  49. toConnectWiFi(){
  50. this.show = true;
  51. },
  52. toTryAgain(){
  53. this.show = false;
  54. uni.showToast({
  55. icon:'success',
  56. title:'网络连接成功'
  57. })
  58. },
  59. close(){
  60. this.show = false;
  61. },
  62. toCode(){
  63. uni.scanCode({
  64. success: (res) => {
  65. console.log(res,'res');
  66. uni.navigateTo({
  67. url:'/pages/code'
  68. })
  69. },
  70. fail: (err) => {
  71. console.log(err,'err');
  72. }
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="less">
  79. .page{
  80. background: #F7F7F7;
  81. padding: 0 30rpx 30rpx;
  82. box-sizing: border-box;
  83. .box{
  84. background: #FFFFFF;
  85. border-radius: 16rpx;
  86. padding: 40rpx 30rpx;
  87. margin-top: 20rpx;
  88. .b_top{
  89. image{
  90. width: 114rpx;
  91. height: 114rpx;
  92. }
  93. text{
  94. font-family: PingFang-SC, PingFang-SC;
  95. font-weight: bold;
  96. font-size: 40rpx;
  97. color: #111111;
  98. line-height: 40rpx;
  99. text-align: center;
  100. margin-top: 30rpx;
  101. }
  102. }
  103. .b_pre{
  104. margin-top: 40rpx;
  105. .bp_text{
  106. font-family: PingFang-SC, PingFang-SC;
  107. font-weight: bold;
  108. font-size: 30rpx;
  109. color: #111111;
  110. line-height: 32rpx;
  111. }
  112. .bp_inp{
  113. width: 100%;
  114. height: 90rpx;
  115. border-radius: 16rpx;
  116. border: 1rpx solid #E2E2E2;
  117. margin-top: 24rpx;
  118. padding: 24rpx 40rpx;
  119. box-sizing: border-box;
  120. input{
  121. border: none;
  122. }
  123. }
  124. }
  125. .zt_btn{
  126. margin-top: 40rpx;
  127. }
  128. .b_title{
  129. font-family: PingFang-SC, PingFang-SC;
  130. font-weight: bold;
  131. font-size: 32rpx;
  132. color: #111111;
  133. line-height: 45rpx;
  134. }
  135. .b_wifi{
  136. margin-top: 48rpx;
  137. text{
  138. font-family: PingFangSC, PingFang SC;
  139. font-weight: 400;
  140. font-size: 30rpx;
  141. color: #0066FE;
  142. line-height: 30rpx;
  143. }
  144. image{
  145. width: 36rpx;
  146. height: 36rpx;
  147. margin-left: 10rpx;
  148. }
  149. }
  150. }
  151. .fail_box{
  152. width: 570rpx;
  153. background: #FFFFFF;
  154. border-radius: 28rpx;
  155. padding: 34rpx 125rpx 54rpx;
  156. box-sizing: border-box;
  157. image{
  158. width: 232rpx;
  159. height: 232rpx;
  160. }
  161. text{
  162. font-family: PingFangSC, PingFang SC;
  163. font-weight: 400;
  164. font-size: 30rpx;
  165. color: #333333;
  166. line-height: 42rpx;
  167. margin-top: 10rpx;
  168. }
  169. p{
  170. font-family: PingFangSC, PingFang SC;
  171. font-weight: 400;
  172. font-size: 24rpx;
  173. color: #A6A6A6;
  174. line-height: 24rpx;
  175. margin-top: 24rpx;
  176. }
  177. .zt_btn{
  178. margin-top: 40rpx;
  179. }
  180. }
  181. }
  182. </style>