第一版
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
const app = getApp();
|
||||
import $ from "../../utils/request";
|
||||
|
||||
Page({
|
||||
onLoad(options) {
|
||||
let ssid = options.ssid;
|
||||
let password = options.password;
|
||||
app.globalData.ppScale.activeProtocol.dataConfigNetWork({
|
||||
domain: app.globalData.ppScale.domain,
|
||||
ssid: options.ssid,
|
||||
password: options.password
|
||||
}, (res) => {
|
||||
app.globalData.ppScale.wifi.ssid = ssid;
|
||||
app.globalData.ppScale.wifi.password = password;
|
||||
|
||||
let scaleDeviceId = app.globalData.ppScale.device.mac.replace(/:/g, '');
|
||||
let params = {
|
||||
equipmentName: app.globalData.ppScale.device.name,
|
||||
scaleDeviceId: scaleDeviceId,
|
||||
};
|
||||
$.ajax("weighingScale/binding/device", params, "POST").then(res => {
|
||||
app.globalData.ppScale.activeProtocol.codeSetBindingState((res) => {
|
||||
console.log("setNetwork.js codeSetBindingState", res);
|
||||
|
||||
wx.navigateTo({
|
||||
url: "/pages/setNetworkSuccessful/setNetworkSuccessful"
|
||||
})
|
||||
})
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: err.message
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.switchTab({
|
||||
url: "/pages/home/home"
|
||||
})
|
||||
}, 1500)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "正在配网",
|
||||
"disableScroll": true
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<view class="icon">
|
||||
<view>
|
||||
<image src="/images/setNetwork/icon.png" />
|
||||
</view>
|
||||
<view>已链接,配网中...</view>
|
||||
<view>请持续站在秤上,耐心等待</view>
|
||||
</view>
|
||||
|
||||
<view class="describe">
|
||||
<view>手机尽量靠近设备(2米以内)</view>
|
||||
<view>Wi-Fi指示灯闪烁,处于配网状态</view>
|
||||
<view>Wi-Fi指示灯长亮为已连接状态</view>
|
||||
</view>
|
||||
@@ -0,0 +1,54 @@
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 90rpx 60rpx 120rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.icon>view:nth-of-type(1) {
|
||||
width: 565rpx;
|
||||
height: 500rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.icon>view:nth-of-type(2) {
|
||||
color: #1385FA;
|
||||
width: 100%;
|
||||
height: 36rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.icon>view:nth-of-type(3) {
|
||||
color: #808080;
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.describe {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.describe>view {
|
||||
color: #808080;
|
||||
width: 100%;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
line-height: 26rpx;
|
||||
margin-bottom: 26rpx;
|
||||
}
|
||||
|
||||
.describe>view:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user