this.udp = wx.createUDPSocket()
this.udp.bind(UDP_PORT)
let _this = this
this.udpSend({
"e": "req_mac"
})
this.udp.onMessage(res => {
let udpRes = JSON.parse(_this.newAb2Str(res.message))
if (udpRes.e == 'resp_mac') {
_this.mac = udpRes.m
_this.manaul()
} else if (udpRes.e == 'resp_netset_ok') {
_this.udp.close()
_this.weToast.hide()
wx.showToast({
icon: 'none',
title: '保存成功'
})
wxNav.navigateBack()
}
})
this.udp.onError(e => {
_this.weToast.hide()
util.showError(e)
})
请具体描述问题出现的流程,并提供能复现问题的简单代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html