|
@@ -59,12 +59,19 @@ VueLikePage([], {
|
|
|
type: "",
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
swiperChange: function (e) {
|
|
|
this.setData({
|
|
|
current: e.detail.current,
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ onShow(){
|
|
|
+ this.setData({
|
|
|
+ rndWord: randomWord(false, 8)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
gotoWork() {
|
|
|
timer && clearTimeout(timer);
|
|
|
timer = null;
|
|
@@ -101,14 +108,18 @@ VueLikePage([], {
|
|
|
},
|
|
|
|
|
|
closeServer(cb=null) {
|
|
|
+ app.closeByVideoHandle = true
|
|
|
if (app.websocket) {
|
|
|
app.send("close");
|
|
|
app.websocket.close();
|
|
|
app.websocket = null;
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- cb && cb()
|
|
|
- },100);
|
|
|
+
|
|
|
+ if (app.longtime) {
|
|
|
+ setTimeout(() => {
|
|
|
+ cb && cb()
|
|
|
+ },100);
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
handleWebSocket: function () {
|
|
@@ -130,6 +141,7 @@ VueLikePage([], {
|
|
|
|
|
|
app.websocket.onMessage((msg) => {
|
|
|
console.log(msg);
|
|
|
+ app.hideLoading();
|
|
|
if (typeof msg.data == "string") {
|
|
|
switch (msg.data) {
|
|
|
case "error 101":
|
|
@@ -147,16 +159,16 @@ VueLikePage([], {
|
|
|
app.is_other_used = true;
|
|
|
|
|
|
if (app.is_send_msg) {
|
|
|
- app.hideLoading();
|
|
|
app.showAlert("服务器连接失败,请重新连接", () => {
|
|
|
wx.reLaunch({
|
|
|
url: "index",
|
|
|
});
|
|
|
- });
|
|
|
+ },'重新连接');
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case "error 808":
|
|
|
+ app.is_connect_ok = true;
|
|
|
app.is_other_used = true;
|
|
|
if (app.is_send_msg) {
|
|
|
app.showAlert("当前画屏正在被使用,请稍后");
|
|
@@ -206,13 +218,14 @@ VueLikePage([], {
|
|
|
success: (res) => {
|
|
|
//判断是否为数组
|
|
|
let typeType =
|
|
|
- Object.prototype.toString.call(res.header["Content-Type"]) == "[object String]"?
|
|
|
+ (Object.prototype.toString.call(res.header["Content-Type"]) == "[object String]")?
|
|
|
res.header["Content-Type"] : res.header["Content-Type"][0]
|
|
|
|
|
|
- console.log(Object.prototype.toString.call(res.header["Content-Type"][0]),8888);
|
|
|
+ console.log(typeType,8888);
|
|
|
|
|
|
//判断不是xml文件
|
|
|
if (typeType.indexOf(m_type) > -1) {
|
|
|
+ this.clearLongTime();
|
|
|
g_app.globalData.m_file = res.tempFilePath;
|
|
|
this.gotoWork();
|
|
|
}
|
|
@@ -238,7 +251,6 @@ VueLikePage([], {
|
|
|
|
|
|
default:
|
|
|
try {
|
|
|
- app.hideLoading()
|
|
|
// var json = JSON.parse(msg.data);
|
|
|
// if (json.url) {
|
|
|
// if (json.url.indexOf(this.data.rndWord) > -1) {
|
|
@@ -265,12 +277,14 @@ VueLikePage([], {
|
|
|
app.checkOperationTimeout(true);
|
|
|
app.hideLoading();
|
|
|
app.websocket = null;
|
|
|
- if (!app.longtime) {
|
|
|
+
|
|
|
+ if (!app.longtime&&!app.closeByVideoHandle) {
|
|
|
app.showAlert("服务器连接已关闭,请重新连接", () => {
|
|
|
wx.reLaunch({
|
|
|
url: "index",
|
|
|
});
|
|
|
- });
|
|
|
+ },'重新连接');
|
|
|
+ app.closeByVideoHandle = false
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -311,6 +325,7 @@ VueLikePage([], {
|
|
|
|
|
|
this.setData({
|
|
|
type: id,
|
|
|
+ rndWord: randomWord(false, 8),
|
|
|
});
|
|
|
|
|
|
if (!app.sendCheck()) {
|
|
@@ -336,24 +351,32 @@ VueLikePage([], {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
app.send("photo " + "0#" + this.data.rndWord);
|
|
|
- }, 1000);
|
|
|
-
|
|
|
- this.daojishiFn("daojishi", this.data.daojishi, () => {
|
|
|
- this.setData({
|
|
|
- isRecord: true,
|
|
|
- });
|
|
|
-
|
|
|
- this.daojishiFn("recordjishi", this.data.recordjishi, () => {
|
|
|
- wx.showLoading({
|
|
|
- title: "生成视频中...",
|
|
|
- });
|
|
|
- this.closeServer(()=>{
|
|
|
- wx.showLoading({
|
|
|
- title: "生成视频中...",
|
|
|
+
|
|
|
+ // 为了同步机器的倒计时
|
|
|
+ setTimeout(() => {
|
|
|
+ this.daojishiFn("daojishi", this.data.daojishi, () => {
|
|
|
+ this.setData({
|
|
|
+ isRecord: true,
|
|
|
+ });
|
|
|
+
|
|
|
+ this.daojishiFn("recordjishi", this.data.recordjishi, () => {
|
|
|
+ wx.showLoading({
|
|
|
+ title: "生成视频中...",
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.closeServer(()=>{
|
|
|
+ wx.showLoading({
|
|
|
+ title: "生成视频中...",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }, 20 * 1000);
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
- });
|
|
|
+ }, 500);
|
|
|
+
|
|
|
+ }, 1000);
|
|
|
+
|
|
|
+
|
|
|
}, 500);
|
|
|
}
|
|
|
|
|
@@ -375,18 +398,22 @@ VueLikePage([], {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
app.send("photo " + "1#" + this.data.rndWord);
|
|
|
+
|
|
|
+ // 为了同步机器的倒计时
|
|
|
+ setTimeout(() => {
|
|
|
+ this.daojishiFn("daojishi", this.data.daojishi, () => {
|
|
|
+ this.closeServer(()=>{
|
|
|
+ wx.showLoading({
|
|
|
+ title: "生成图片中...",
|
|
|
+ // mask: true,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }, 500);
|
|
|
+
|
|
|
}, 1000);
|
|
|
|
|
|
- this.daojishiFn("daojishi", this.data.daojishi, () => {
|
|
|
- console.log(11111,'sss');
|
|
|
-
|
|
|
- this.closeServer(()=>{
|
|
|
- wx.showLoading({
|
|
|
- title: "生成图片中...",
|
|
|
- // mask: true,
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
+
|
|
|
}, 500);
|
|
|
}
|
|
|
|
|
@@ -432,8 +459,7 @@ VueLikePage([], {
|
|
|
mask: true,
|
|
|
});
|
|
|
this.setData({
|
|
|
- currentScene: id,
|
|
|
- rndWord: randomWord(false, 8),
|
|
|
+ currentScene: id
|
|
|
});
|
|
|
app.send("switch " + id);
|
|
|
}
|