Browse Source

fix(WiFi修复): WiFi修复

tall
song 4 years ago
parent
commit
63b253e0cf
  1. 1
      CHANGELOG.md
  2. 7
      src/components/Wifi/Wifi.vue
  3. 62
      src/pagesProject/project/components/Evaluated/components/ProcessRestore.vue
  4. 4
      src/pagesYanyuan/wifi-binding/wifi-binding.vue

1
CHANGELOG.md

@ -43,6 +43,7 @@
- | 日历定位;合并 | [ea3f937](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/ea3f937)
- | 删除项目 | [00b886c](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/00b886c)
- | 上传逻辑变化 | [3ff1dc2](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/3ff1dc2)
- | 上传正式版本 | [5539485](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/5539485)
- | 设置界面基本信息板块开发 | [bbaded0](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/bbaded0)
- | 设置小红点 | [9316bcb](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/9316bcb)
- | 升级版本v3.1.0;tailwindcss添加class | [9ef05e1](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/9ef05e1)

7
src/components/Wifi/Wifi.vue

@ -23,6 +23,7 @@ export default {
onLoad() {},
methods: {
sendTCP() {
// this.$t.ui.showLoading('...');
console.log('发送');
if (!this.tcp) {
this.tcp = wx.createTCPSocket();
@ -34,8 +35,11 @@ export default {
});
console.log('链接this.tcp', this.tcp);
this.tcp.write(`#${this.name}:${this.password}$`);
this.tcp.write(`#${this.name}:${this.password}$`);
console.log('write-this.tcp', this.tcp);
this.tcp.onMessage((message, remoteInfo, localInfo) => {
// this.$t.ui.hideLoading();
console.log(message, remoteInfo, localInfo);
// tcp
// this.tcp = null;
@ -45,6 +49,9 @@ export default {
this.$t.page.openPage('/pagesYanyuan/hold-all/hold-all');
}
});
// setTimeout(() => {
// this.$t.ui.hideLoading();
// }, 10000);
},
},
};

62
src/pagesProject/project/components/Evaluated/components/ProcessRestore.vue

@ -64,11 +64,10 @@ export default {
context.drawImage(res.tempFilePath, 0, 0, width, 450);
context.draw(true);
//
// points.forEach(item => {
// that.drawPath(item, width);
// });
console.log('points: ', points);
that.drawPath(points, width);
const arr = that.setPoints(points);
arr.forEach(item => {
that.drawPath(item, width);
});
},
fail(error) {
console.error('图片加载失败:', error);
@ -84,24 +83,26 @@ export default {
const data = this.generatePathData(str);
const ctx = this.context;
this.timers.push(
setTimeout(() => {
if (!this.trainResult.points || this.trainResult.points.length === 0) {
return;
}
ctx.beginPath();
ctx.setLineWidth(3);
ctx.setStrokeStyle('#1890ff');
const x = (+data[0][0] * width) / 155;
const y = (+data[0][1] * 450) / 194;
ctx.moveTo(x, y);
if (data.length === 1) {
// 1
ctx.arc(x, y, 2, 0, Math.PI * 2, false);
ctx.fill();
}
}, +data[0][2]),
);
if (data[0][3] === 1) {
this.timers.push(
setTimeout(() => {
if (!this.trainResult.points || this.trainResult.points.length === 0) {
return;
}
ctx.beginPath();
ctx.setLineWidth(3);
ctx.setStrokeStyle('#1890ff');
const x = (+data[0][0] * width) / 155;
const y = (+data[0][1] * 450) / 194;
ctx.moveTo(x, y);
if (data.length === 1) {
// 1
ctx.arc(x, y, 2, 0, Math.PI * 2, false);
ctx.fill();
}
}, +data[0][2]),
);
}
for (let i = 1, len = data.length; i < len; i++) {
if (!this.trainResult.points || this.trainResult.points.length === 0) return;
@ -120,7 +121,6 @@ export default {
ctx.stroke();
ctx.draw(true);
}
ctx.closePath();
// }, +data[i][2]),
}, this.getIntervalTime(+data[i][2], +str.operateTime, +data[0][2])),
@ -158,6 +158,20 @@ export default {
return time;
},
// points
setPoints(points) {
if (!points || !points.length) return;
let result = [];
points.forEach(point => {
if (point.sign === 1) {
result.push([point]);
} else {
result[result.length - 1].push(point);
}
});
return result;
},
/**
* 生成绘制每段路径的数据
* @param {string} str 每条路径的数据"x,y,time;x,y,time"

4
src/pagesYanyuan/wifi-binding/wifi-binding.vue

@ -18,8 +18,8 @@
<view class="flex flex-col u-font-14 w-full px-3 pt-6 text-gray-400">
<text class="font-bold">联网说明:</text>
<text class="mt-2">1.长按点读笔进入配网模式</text>
<text class="mt-2">2.切换手机wifi,连接ccsens_pen</text>
<text class="mt-2">3.输入wifi名和密码点击配置</text>
<text class="mt-2">2.切换手机wifi,连接ccsens_pen,输入密码ccsens123</text>
<text class="mt-2">3.输入wifi名和密码点击确定</text>
<text class="mt-2">4.配网成功后点读笔有灯闪烁</text>
</view>
</view>

Loading…
Cancel
Save