浏览代码

修改EMDR

[plg137200.] 1 年之前
父节点
当前提交
2d56764697
共有 4 个文件被更改,包括 41 次插入4 次删除
  1. 二进制
      src/renderer/assets/EMDR.mp4
  2. 3 1
      src/renderer/components/AnimationDes.vue
  3. 37 3
      src/renderer/components/treatDepression.vue
  4. 1 0
      src/utils/http.js

二进制
src/renderer/assets/EMDR.mp4


+ 3 - 1
src/renderer/components/AnimationDes.vue

@@ -594,7 +594,8 @@ export default {
 
 
     //初始化websocket
     //初始化websocket
     initWebsocket() {
     initWebsocket() {
-      const wsuri = "ws://127.0.0.1:8000/ws?uid=client&to_uid=server";
+      // const wsuri = "ws://192.168.2.101:8000/ws?uid=client&to_uid=server";
+      const wsuri = "ws://localhost:8000/ws?uid=client&to_uid=server";
       this.websock = new WebSocket(wsuri);
       this.websock = new WebSocket(wsuri);
       this.websock.onmessage = this.websocketonmessage;
       this.websock.onmessage = this.websocketonmessage;
       this.websock.onopen = this.websocketonopen;
       this.websock.onopen = this.websocketonopen;
@@ -617,6 +618,7 @@ export default {
     websocketonmessage(e) {
     websocketonmessage(e) {
       //数据接收
       //数据接收
       const redata = JSON.parse(e.data);
       const redata = JSON.parse(e.data);
+      console.log(redata)
       // console.log(redata);
       // console.log(redata);
       if (redata.content != "Successful connection to socket service") {
       if (redata.content != "Successful connection to socket service") {
         //判断设备类型是device还是data
         //判断设备类型是device还是data

+ 37 - 3
src/renderer/components/treatDepression.vue

@@ -41,7 +41,7 @@
                       @input="nextHandle(content.index)"
                       @input="nextHandle(content.index)"
                     >
                     >
                       <el-radio
                       <el-radio
-                       style='width:100%'
+                        style="width: 100%"
                         v-for="(item, index) in content.question"
                         v-for="(item, index) in content.question"
                         :key="index"
                         :key="index"
                         size="small"
                         size="small"
@@ -83,7 +83,7 @@
                         @input="chooseAnswer"
                         @input="chooseAnswer"
                       >
                       >
                         <el-radio
                         <el-radio
-                         style='width:100%'
+                          style="width: 100%"
                           v-for="item in content.question"
                           v-for="item in content.question"
                           :key="item.id"
                           :key="item.id"
                           size="small"
                           size="small"
@@ -100,9 +100,13 @@
                         /><i
                         /><i
                           style="width: 20px; height: 20px; color: #57c02c"
                           style="width: 20px; height: 20px; color: #57c02c"
                           v-if="content.isType == 1"
                           v-if="content.isType == 1"
-                          @click="sendMessageFun(content.nextQuestionNo)"
+                          @click="
+                            sendMessageFun(content.question[0].nextQuestionNo)
+                          "
                           class="el-icon-s-promotion"
                           class="el-icon-s-promotion"
                         ></i>
                         ></i>
+
+                        <!-- {{content}} -->
                       </div>
                       </div>
                       <div
                       <div
                         class=""
                         class=""
@@ -180,15 +184,40 @@
         <el-col :span="1"> &nbsp; </el-col>
         <el-col :span="1"> &nbsp; </el-col>
       </el-row>
       </el-row>
     </div>
     </div>
+
+    <!-- 弹出框显示视频视频从头开始播放,下方有按钮--按钮点击进行访问下一题 -->
+    <el-dialog
+      :close-on-click-modal="false"
+      title="刺激呈现"
+      :visible.sync="centerDialogVisible"
+      width="80%"
+      center
+    >
+      <span>
+        <video width="100%" height="100%" controls>
+          <source src="../assets/EMDR.mp4" type="video/mp4" />
+        </video>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <!-- <el-button @click="centerDialogVisible = false">取 消</el-button> -->
+        <el-button type="primary" @click="centerDialogVisible = false"
+          >我已看完</el-button
+        >
+      </span>
+    </el-dialog>
+    <!-- <el-button @click="centerDialogVisible = true">打开窗口</el-button> -->
   </div>
   </div>
 </template>
 </template>
   <script>
   <script>
 import HeadImg from "@/assets/lion.png";
 import HeadImg from "@/assets/lion.png";
 import HeadImg1 from "@/assets/newImage/peopleUser.png";
 import HeadImg1 from "@/assets/newImage/peopleUser.png";
 import axios from "axios";
 import axios from "axios";
+import Video from "./Video.vue";
 export default {
 export default {
+  components: { Video },
   data() {
   data() {
     return {
     return {
+      centerDialogVisible: false,
       tmpRadio: "",
       tmpRadio: "",
       radio: "",
       radio: "",
       inputFlag: 1,
       inputFlag: 1,
@@ -335,6 +364,7 @@ export default {
     },
     },
     sendMessageFun(id) {
     sendMessageFun(id) {
       //发送填空题
       //发送填空题
+      debugger;
       if (!id == "") {
       if (!id == "") {
         this.getQuestion(id);
         this.getQuestion(id);
       } else {
       } else {
@@ -361,6 +391,10 @@ export default {
     },
     },
     // 获取问题
     // 获取问题
     getQuestion(id) {
     getQuestion(id) {
+      if (id == "109" || id == "117" || id == "119") {
+        this.centerDialogVisible = true;
+      }
+
       this.$http.get(
       this.$http.get(
         `chat/getQuestion/${this.interveneId}`,
         `chat/getQuestion/${this.interveneId}`,
         {
         {

+ 1 - 0
src/utils/http.js

@@ -14,6 +14,7 @@ axios.defaults.baseURL = global.dev;
 // 创建一个 Axios 实例并设置 baseURL 适应不同服务器的baseUrl
 // 创建一个 Axios 实例并设置 baseURL 适应不同服务器的baseUrl
 const apiInstance = axios.create({
 const apiInstance = axios.create({
   baseURL: 'http://localhost:8000/'
   baseURL: 'http://localhost:8000/'
+  // baseURL: 'http://192.168.2.101:8000/'
 });
 });
 
 
 // axios.defaults.baseURL = "/api";
 // axios.defaults.baseURL = "/api";