123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <u-popup :show="show" :round="36" mode="bottom" @close="close">
- <view class="bind_device">
- <div class="top adfacjb">
- <div class="pre adffcacjc" @tap="scanBind">
- <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/7d603c9a-6b47-40b3-9a49-46638ed677ee.png"></image>
- <text>扫码绑定设备</text>
- </div>
- <div class="pre adffcacjc" @tap="wifiBind">
- <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/58afeb20-9bea-46e3-b31c-7be2b9b7014d.png"></image>
- <text>配网并绑定设备</text>
- </div>
- </div>
- <div class="close">
- <u-icon name="close" color="#5C5C5C" size="50" @tap="close"></u-icon>
- </div>
- </view>
- </u-popup>
- </template>
- <script>
- export default {
- data(){
- return {
- show:false
- }
- },
- methods:{
- close(){
- this.show = false;
- },
- scanBind(){
- this.show = false;
- let that = this;
- uni.scanCode({
- success: (res) => {
- let result = JSON.parse(res.result);
- if(res.errMsg==='scanCode:ok'){
- uni.navigateTo({
- url:'/pagesMy/scanResult?scanParams='+JSON.stringify(result)
- })
-
- // that.$api.post('/device/bind',{
- // ...result,
- // "type": "",
- // "userId": 0,
- // "agentId": ""
- // }).then(res=>{
- // if(res.data.code!==0) return that.$showToast(res.data.msg)
- // uni.navigateTo({
- // url:'/pagesMy/scanResult?deviceId='+res.data.data
- // })
- // })
- }
- }
- })
- },
- wifiBind(){
- this.show = false;
- uni.navigateTo({
- url:'/pagesMy/deviceAdd'
- })
- },
- }
- }
- </script>
- <style scoped lang="less">
- .bind_device{
- width: 100%;
- padding: 74rpx 74rpx 20rpx;
- box-sizing: border-box;
- .top{
- .pre{
- width: calc(50% - 51rpx);
- image{
- width: 110rpx;
- height: 110rpx;
- }
- text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #111111;
- line-height: 32rpx;
- text-align: center;
- margin-top: 24rpx;
- }
- }
- }
- .close{
- width: 100%;
- margin-top: 113rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- </style>
|