Browse Source

修改样式

lex-xin 2 months ago
parent
commit
aeddce7ae1

BIN
src/views/courseList/image/list-top-bg.png


+ 11 - 3
src/views/courseList/index.module.less

@@ -1,11 +1,19 @@
 .courseList {
   min-height: 100vh;
   background-color: #F8F8F8;;
-  background-image: linear-gradient(180deg, #7DEFE6 0%, rgba(248, 248, 248, 0) 315px);
-  padding: 10px 0;
+  background-image: url('./image/list-top-bg.png'); // linear-gradient(180deg, #7DEFE6 0%, rgba(248, 248, 248, 0) 315px);
+  background-repeat: no-repeat;
+  background-size: contain;
+  // padding: 0 0 10px;
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
+
+  :global {
+    .o-result-container {
+      height: calc(100% - 60px);
+    }
+  }
 }
 
 .periodContent {
@@ -77,7 +85,7 @@
   flex: 1;
   background: #FFFFFF;
   border-radius: 20px 20px 0px 0px;
-  min-height: 40vh;
+  // min-height: 40vh;
 }
 
 .periodHeader {

+ 136 - 132
src/views/courseList/index.tsx

@@ -34,7 +34,7 @@ import { browser } from '@/helpers/utils';
 import OEmpty from '@/components/o-empty';
 import iconList from './image/icon-list.png';
 import OHeader from '@/components/o-header';
-import { useEventListener, usePageVisibility } from '@vant/use';
+import { usePageVisibility } from '@vant/use';
 import OLoading from '@/components/o-loading';
 import OSticky from '@/components/o-sticky';
 export default defineComponent({
@@ -295,149 +295,153 @@ export default defineComponent({
         }
       }
     };
-    useEventListener('scroll', () => {
-      const height =
-        window.scrollY ||
-        window.pageYOffset ||
-        document.documentElement.scrollTop;
-      data.titleOpacity = height > 100 ? 1 : height / 100;
-    });
+    // useEventListener('scroll', () => {
+    //   const height =
+    //     window.scrollY ||
+    //     window.pageYOffset ||
+    //     document.documentElement.scrollTop;
+    //   data.titleOpacity = height > 50 ? 1 : 0;
+    // });
     return () => (
       <div class={styles.courseList}>
-        <OHeader
-          border={false}
-          background={`rgba(255,255,255, ${data.titleOpacity})`}
-          title="教材详情"
-        />
-        <div class={styles.periodContent}>
-          <div class={styles.cover}>
-            <img
-              src={data.detail.cover}
-              onLoad={(e: Event) => {
-                if (e.target) {
-                  (e.target as any).style.opacity = 1;
-                }
-              }}
-            />
-          </div>
-          <div>
-            <div class={styles.contentTitle}>{data.detail.name}</div>
-            <div class={styles.contentLabel}>教学目标:{data.detail.des}</div>
+        <OSticky position='top'>
+          <OHeader
+            border={false}
+            background={`rgba(255,255,255, ${data.titleOpacity})`}
+            title="教材详情"
+          />
+        </OSticky>
+        <div style="height: calc(100vh - var(--header-height, 0px) - var(--bottom-height, 0px)); overflow-x: hidden; overflow-y: auto;display:flex; flex-direction: column;">
+          <div class={styles.periodContent}>
+            <div class={styles.cover}>
+              <img
+                src={data.detail.cover}
+                onLoad={(e: Event) => {
+                  if (e.target) {
+                    (e.target as any).style.opacity = 1;
+                  }
+                }}
+              />
+            </div>
+            <div>
+              <div class={styles.contentTitle}>{data.detail.name}</div>
+              <div class={styles.contentLabel}>教学目标:{data.detail.des}</div>
+            </div>
           </div>
-        </div>
 
-        <div class={styles.periodSection}>
-          <TransitionGroup name="van-fade">
-            {!data.loading && (
-              <>
-                <div class={styles.periodHeader}>
-                  <div key="periodTitle" class={styles.periodTitle}>
-                    <img class={styles.pIcon} src={iconList} />
-                    <div class={styles.pTitle}>课程列表</div>
-                    <div class={styles.pNum}>共{data.list.length}课</div>
-                  </div>
-                  <div class={styles.searchGroup} onClick={() => {
-                    router.push({
-                      path: '/courseListSearch',
-                      query: {
-                        id: route.query.id
-                      }
-                    })
-                  }}>
-                    <img src={iconSearch} class={styles.iconSearch} />
-                    <span class={styles.searchContent}>搜索素材</span>
+          <div class={styles.periodSection}>
+            <TransitionGroup name="van-fade">
+              {!data.loading && (
+                <>
+                  <div class={styles.periodHeader}>
+                    <div key="periodTitle" class={styles.periodTitle}>
+                      <img class={styles.pIcon} src={iconList} />
+                      <div class={styles.pTitle}>课程列表</div>
+                      <div class={styles.pNum}>共{data.list.length}课</div>
+                    </div>
+                    <div class={styles.searchGroup} onClick={() => {
+                      router.push({
+                        path: '/courseListSearch',
+                        query: {
+                          id: route.query.id
+                        }
+                      })
+                    }}>
+                      <img src={iconSearch} class={styles.iconSearch} />
+                      <span class={styles.searchContent}>搜索素材</span>
+                    </div>
                   </div>
-                </div>
 
-                <div key="list" class={styles.periodList}>
-                  <CellGroup inset>
-                    {data.list.map((item: any) => {
-                      return (
-                        <Cell
-                          border
-                          center
-                          title={item.coursewareDetailName}
-                          // label={
-                          //   !browserInfo.isStudent
-                          //     ? `已使用${item.useNum || 0}次`
-                          //     : ''
-                          // }
-                          onClick={() => handleClick(item)}>
-                          {{
-                            icon: () => (
-                              <div class={styles.periodItem}>
-                                <div class={styles.periodItemModel}>
-                                  <img src={isLock.value ? iconCourseLock : iconCourse} />
-                                  {item.hasCache ? (
-                                    <img
-                                      class={styles.iconCachePoint}
-                                      src={iconCachePoint}
-                                    />
+                  <div key="list" class={styles.periodList}>
+                    <CellGroup inset>
+                      {data.list.map((item: any) => {
+                        return (
+                          <Cell
+                            border
+                            center
+                            title={item.coursewareDetailName}
+                            // label={
+                            //   !browserInfo.isStudent
+                            //     ? `已使用${item.useNum || 0}次`
+                            //     : ''
+                            // }
+                            onClick={() => handleClick(item)}>
+                            {{
+                              icon: () => (
+                                <div class={styles.periodItem}>
+                                  <div class={styles.periodItemModel}>
+                                    <img src={isLock.value ? iconCourseLock : iconCourse} />
+                                    {item.hasCache ? (
+                                      <img
+                                        class={styles.iconCachePoint}
+                                        src={iconCachePoint}
+                                      />
+                                    ) : (
+                                      ''
+                                    )}
+                                    {item.downloadStatus === 1 && (
+                                      <div class={styles.downloading}>{`${
+                                        item.progress || 0
+                                      }%`}</div>
+                                    )}
+                                  </div>
+                                </div>
+                              ),
+                              value: () => (
+                                <>
+                                  {item.knowledgePointList ? (
+                                    <>
+                                      { isLock.value ? <Button
+                                          class={[
+                                            styles.baseBtn,
+                                            styles.look,
+                                            styles.disable
+                                          ]}>
+                                          未解锁
+                                        </Button> : item.hasCache ? (
+                                        <Button
+                                          class={[
+                                            styles.baseBtn,
+                                            styles.look
+                                          ]}>
+                                          查看
+                                        </Button>
+                                      ) : (
+                                        <Button
+                                          class={[
+                                            styles.baseBtn,
+                                            styles.down,
+                                            item.downloadStatus == 1
+                                              ? styles.downing
+                                              : ''
+                                          ]}>
+                                          {item.downloadStatus === 1
+                                            ? `取消下载`
+                                            : '查看'}
+                                        </Button>
+                                      )}
+                                    </>
                                   ) : (
                                     ''
                                   )}
-                                  {item.downloadStatus === 1 && (
-                                    <div class={styles.downloading}>{`${
-                                      item.progress || 0
-                                    }%`}</div>
-                                  )}
-                                </div>
-                              </div>
-                            ),
-                            value: () => (
-                              <>
-                                {item.knowledgePointList ? (
-                                  <>
-                                    { isLock.value ? <Button
-                                        class={[
-                                          styles.baseBtn,
-                                          styles.look,
-                                          styles.disable
-                                        ]}>
-                                        未解锁
-                                      </Button> : item.hasCache ? (
-                                      <Button
-                                        class={[
-                                          styles.baseBtn,
-                                          styles.look
-                                        ]}>
-                                        查看
-                                      </Button>
-                                    ) : (
-                                      <Button
-                                        class={[
-                                          styles.baseBtn,
-                                          styles.down,
-                                          item.downloadStatus == 1
-                                            ? styles.downing
-                                            : ''
-                                        ]}>
-                                        {item.downloadStatus === 1
-                                          ? `取消下载`
-                                          : '查看'}
-                                      </Button>
-                                    )}
-                                  </>
-                                ) : (
-                                  ''
-                                )}
-                              </>
-                            )
-                          }}
-                        </Cell>
-                      );
-                    })}
-                  </CellGroup>
-                </div>
-              </>
-            )}
-          </TransitionGroup>
-          {data.loading && <OLoading />}
-          {!data.loading && !data.list.length && <OEmpty tips="暂无内容" />}
+                                </>
+                              )
+                            }}
+                          </Cell>
+                        );
+                      })}
+                    </CellGroup>
+                  </div>
+                </>
+              )}
+            </TransitionGroup>
+            {data.loading && <OLoading />}
+            {!data.loading && !data.list.length && <OEmpty tips="暂无内容" />}
+          </div>
         </div>
 
         {isLock.value && (
-          <OSticky position="bottom">
+          <OSticky position="bottom" varName='--bottom-height'>
             <div class={styles.btnGroup}>
               <Button round block type="primary" onClick={() => {
                 handleShowVip(route.query.id as string, "LESSON")

+ 1 - 1
src/views/courseListSearch/index.module.less

@@ -1,6 +1,6 @@
 .courseListSearch {
   min-height: 100vh;
-  background-color: #fff;
+  background-color: #F8F8F8;
   background: linear-gradient(180deg, #7defe6 0%, rgba(255, 255, 255, 0) 170px);
   box-sizing: border-box;
 

+ 180 - 159
src/views/courseListSearch/index.tsx

@@ -1,4 +1,10 @@
-import { computed, defineComponent, reactive, TransitionGroup, watch } from 'vue';
+import {
+  computed,
+  defineComponent,
+  reactive,
+  TransitionGroup,
+  watch
+} from 'vue';
 import styles from './index.module.less';
 import OHeader from '@/components/o-header';
 import OSearch from '@/components/o-search';
@@ -9,8 +15,9 @@ import OLoading from '@/components/o-loading';
 import OEmpty from '@/components/o-empty';
 import { Cell, Collapse, CollapseItem } from 'vant';
 import ChildNode, { getImage } from './child-node';
-import { useEventListener, usePageVisibility } from '@vant/use';
+import { usePageVisibility } from '@vant/use';
 import iconMenu from './image/icon-menu.png';
+import OSticky from '@/components/o-sticky';
 
 export default defineComponent({
   name: 'course-list-search',
@@ -24,7 +31,7 @@ export default defineComponent({
         // cover: '',
         // name: '',
         // des: '',
-        useStatus: '',
+        useStatus: ''
       },
       list: [] as any,
       search: '' as string | undefined,
@@ -34,8 +41,11 @@ export default defineComponent({
     const pageVisibility = usePageVisibility();
     /** 是否锁定 */
     const isLock = computed(() => {
-      return  (data.detail.useStatus === 'LOCK' && state.platformType === 'STUDENT') ? true : false;
-    })
+      return data.detail.useStatus === 'LOCK' &&
+        state.platformType === 'STUDENT'
+        ? true
+        : false;
+    });
     const formatDataList = (list: any = []) => {
       const tempList: any = [];
       list.forEach((item: any) => {
@@ -53,62 +63,69 @@ export default defineComponent({
     };
 
     const formatSelectFirstChild = (list: any = []): any => {
-      for(let i = 0; i < list.length; i++) {
-        if(Array.isArray(list[i].materialList) && list[i].materialList.length > 0) {
-          const materialItem = list[i].materialList[0] || {}
-          if(materialItem) {
-            return materialItem
+      for (let i = 0; i < list.length; i++) {
+        if (
+          Array.isArray(list[i].materialList) &&
+          list[i].materialList.length > 0
+        ) {
+          const materialItem = list[i].materialList[0] || {};
+          if (materialItem) {
+            return materialItem;
           }
         } else {
-          return formatSelectFirstChild(list[i].children || [])
+          return formatSelectFirstChild(list[i].children || []);
         }
       }
-    }
+    };
 
-    // 
+    //
     function selectFirstChild(pointList: any[], ids: any[]): any[] {
       return pointList.map(point => {
         if (point.children) {
-            
-            let id = ''
-            point.children.map((item: any) => {
-              if(!id) {
-                id = ids.includes(item.id) ? item.id : ''
-              }
-              
-            })
-              point.collapse = id
-           return Object.assign(point, {
-              children: selectFirstChild(point.children, ids)
-           })
+          let id = '';
+          point.children.map((item: any) => {
+            if (!id) {
+              id = ids.includes(item.id) ? item.id : '';
+            }
+          });
+          point.collapse = id;
+          return Object.assign(point, {
+            children: selectFirstChild(point.children, ids)
+          });
         } else {
-           return Object.assign(point, {
-              materialList: point.materialList
-           })
+          return Object.assign(point, {
+            materialList: point.materialList
+          });
         }
-     })
+      });
     }
 
-    function filterPointList(pointList: any[], parentData?: { ids: string[]; name: string }): any[] {
+    function filterPointList(
+      pointList: any[],
+      parentData?: { ids: string[]; name: string }
+    ): any[] {
       // 设置父级及以上id数组和父级name
       return pointList.map(point => {
-         if (point.children) {
-            return Object.assign(point, {
-               children: filterPointList(point.children, { ids: [...(parentData?.ids || []), point.id], name: point.name })
+        if (point.children) {
+          return Object.assign(point, {
+            children: filterPointList(point.children, {
+              ids: [...(parentData?.ids || []), point.id],
+              name: point.name
             })
-         } else {
-            return Object.assign(point, {
-               materialList: point.materialList.map((item: any) => {
-                  item.parentData = {
-                     ids: [...(parentData?.ids || []), point.id],
-                     name: point.name
-                  }
-                  return item
-               })
+          });
+        } else {
+          return Object.assign(point, {
+            materialList: point.materialList.map((item: any) => {
+              item.parentData = {
+                ids: [...(parentData?.ids || []), point.id],
+                name: point.name
+              };
+              return item;
             })
-         }
-      })
-   }
+          });
+        }
+      });
+    }
 
     /** 获取课件详情 */
     const getDetail = async () => {
@@ -129,32 +146,32 @@ export default defineComponent({
         const res: any = await request.get(
           state.platformApi +
             '/lessonCourseware/getLessonCoursewareCourseList/' +
-            route.query.id, {
-              requestType: 'form',
-              params: {
-                search
-              }
+            route.query.id,
+          {
+            requestType: 'form',
+            params: {
+              search
             }
+          }
         );
         if (Array.isArray(res?.data)) {
-          data.search = search
+          data.search = search;
           res.data.forEach((item: any) => {
             item.children = item.knowledgePointList || [];
             item.id = item.coursewareDetailId;
             item.name = item.coursewareDetailName;
             formatDataList(item.children);
           });
-          const firstItem = formatSelectFirstChild(res.data)
-          let list = filterPointList(res.data)
-          list = selectFirstChild(list, firstItem?.parentData?.ids || [])
+          const firstItem = formatSelectFirstChild(res.data);
+          let list = filterPointList(res.data);
+          list = selectFirstChild(list, firstItem?.parentData?.ids || []);
           data.list = list;
-          
+
           list.forEach((item: any) => {
-            if(item.id === firstItem.parentData?.ids[0]) {
-              data.parentCollapse = item.id
+            if (item.id === firstItem.parentData?.ids[0]) {
+              data.parentCollapse = item.id;
             }
-          })
-
+          });
         }
       } catch (error) {
         //
@@ -169,114 +186,118 @@ export default defineComponent({
     watch(
       () => pageVisibility.value,
       value => {
-        if(value === "visible") {
-          getDetail()
+        if (value === 'visible') {
+          getDetail();
         }
       }
     );
 
-    useEventListener('scroll', () => {
-      const height =
-        window.scrollY ||
-        window.pageYOffset ||
-        document.documentElement.scrollTop;
-      data.titleOpacity = height > 100 ? 1 : height / 100;
-    });
+    // useEventListener('scroll', () => {
+    //   const height =
+    //     window.scrollY ||
+    //     window.pageYOffset ||
+    //     document.documentElement.scrollTop;
+    //   data.titleOpacity = height > 30 ? 1 : 0;
+    // });
     return () => (
       <div class={styles.courseListSearch}>
-        <OHeader
-          background={`rgba(255,255,255, ${data.titleOpacity})`}
-          border={false}>
-          {{
-            title: () => (
-              <div class={styles.title}>
-                <OSearch
-                  background="transparent"
-                  placeholder="请输入素材关键词"
-                  onSearch={(val: string) => {
-                    getList(val)
-                  }}
-                />
-              </div>
-            )
-          }}
-        </OHeader>
+        <OSticky position="top">
+          <OHeader
+            background={`rgba(255,255,255, ${data.titleOpacity})`}
+            border={false}>
+            {{
+              title: () => (
+                <div class={styles.title}>
+                  <OSearch
+                    background="transparent"
+                    placeholder="请输入素材关键词"
+                    onSearch={(val: string) => {
+                      getList(val);
+                    }}
+                  />
+                </div>
+              )
+            }}
+          </OHeader>
+        </OSticky>
 
-        <TransitionGroup name="van-fade">
-          {!data.loading && (
-            <Collapse
-              key="courseListSearch"
-              modelValue={data.parentCollapse}
-              onUpdate:modelValue={(val: any) => {
-                data.parentCollapse = val;
-                // data.childrenCollapse = ''; // 重置子项选择
-              }}
-              class={styles.collapseParent}
-              border={false}
-              accordion>
-              {data.list.map((item: any) => (
-                <CollapseItem
-                  center
-                  border={true}
-                  name={item.coursewareDetailId}
-                  clickable={false}
-                  class={['parentCollapse__item']}>
-                  {{
-                    title: () => (
-                      <div class={[styles.itemTitle]}>
-                        <img src={iconMenu} class={styles.iconMenu} />
-                        {item.coursewareDetailName}
-                      </div>
-                    ),
-                    default: () => (
-                      <>
-                        {Array.isArray(item?.materialList) &&
-                          item.materialList.map((n: any) => (
-                            <Cell center isLink clickable={false}>
-                              {{
-                                title: () => (
-                                  <div class={styles.materialSection}>
-                                    <img
-                                      src={getImage(n)}
-                                      class={styles.iconMaterial}
-                                    />
-                                    {n.name}
-                                  </div>
-                                )
+        <div style="height: calc(100vh - var(--header-height)); overflow-x: hidden; overflow-y: auto;">
+          <TransitionGroup name="van-fade">
+            {!data.loading && (
+              <Collapse
+                key="courseListSearch"
+                modelValue={data.parentCollapse}
+                onUpdate:modelValue={(val: any) => {
+                  data.parentCollapse = val;
+                  // data.childrenCollapse = ''; // 重置子项选择
+                }}
+                class={styles.collapseParent}
+                border={false}
+                accordion>
+                {data.list.map((item: any) => (
+                  <CollapseItem
+                    center
+                    border={true}
+                    name={item.coursewareDetailId}
+                    clickable={false}
+                    class={['parentCollapse__item']}>
+                    {{
+                      title: () => (
+                        <div class={[styles.itemTitle]}>
+                          <img src={iconMenu} class={styles.iconMenu} />
+                          {item.coursewareDetailName}
+                        </div>
+                      ),
+                      default: () => (
+                        <>
+                          {Array.isArray(item?.materialList) &&
+                            item.materialList.map((n: any) => (
+                              <Cell center isLink clickable={false}>
+                                {{
+                                  title: () => (
+                                    <div class={styles.materialSection}>
+                                      <img
+                                        src={getImage(n)}
+                                        class={styles.iconMaterial}
+                                      />
+                                      {n.name}
+                                    </div>
+                                  )
+                                }}
+                              </Cell>
+                            ))}
+                          {Array.isArray(item?.children) && (
+                            <ChildNode
+                              id={route.query.id as any}
+                              search={data.search}
+                              isLock={isLock.value}
+                              list={item.children}
+                              collapse={item.collapse}
+                              onUpdate:collapse={(val: any) => {
+                                item.collapse = val;
                               }}
-                            </Cell>
-                          ))}
-                        {Array.isArray(item?.children) && (
-                          <ChildNode
-                            id={route.query.id as any}
-                            search={data.search}
-                            isLock={isLock.value}
-                            list={item.children}
-                            collapse={item.collapse}
-                            onUpdate:collapse={(val: any) => {
-                              item.collapse = val;
-                            }}
-                          />
-                        )}
-                      </>
-                    ),
-                    'right-icon': () => (
-                      <i
-                        class={[
-                          styles.arrow,
-                          data.parentCollapse === item.coursewareDetailId
-                            ? styles.arrowActive
-                            : ''
-                        ]}></i>
-                    )
-                  }}
-                </CollapseItem>
-              ))}
-            </Collapse>
-          )}
-        </TransitionGroup>
-        {data.loading && <OLoading />}
-        {!data.loading && !data.list.length && <OEmpty tips="暂无搜索结果" />}
+                            />
+                          )}
+                        </>
+                      ),
+                      'right-icon': () => (
+                        <i
+                          class={[
+                            styles.arrow,
+                            data.parentCollapse === item.coursewareDetailId
+                              ? styles.arrowActive
+                              : ''
+                          ]}></i>
+                      )
+                    }}
+                  </CollapseItem>
+                ))}
+              </Collapse>
+            )}
+          </TransitionGroup>
+          {data.loading && <OLoading />}
+          {!data.loading && !data.list.length && <OEmpty tips="暂无搜索结果" />}
+        </div>
       </div>
     );
   }

+ 12 - 6
src/views/coursewarePlay/component/points-search.tsx

@@ -76,6 +76,12 @@ export default defineComponent({
         return props.itemActive == item.id ? iconVideoActive : iconVideo;
       }
     };
+
+    function formatName(name: string) {
+      if (!name || !pointData.search) return name
+      const search: any = pointData.search
+      return name.replace(search, `<span style="color: #01C1B5;">${search}</span>`)
+   }
     return () => (
       <div class={styles.container}>
         <div class={styles.pointHeadSearch}>
@@ -96,7 +102,7 @@ export default defineComponent({
           
           {/* {props.loading && <OLoading />} */}
           {!props.loading && !props.data.length && <OEmpty tips="暂无搜索结果" />}
-          <Collapse
+          {props.data.length > 0 ? <Collapse
             class={styles.collapse}
             modelValue={pointData.active}
             onUpdate:modelValue={(val: any) => {
@@ -201,8 +207,8 @@ export default defineComponent({
                                                 />
                                                 <span
                                                   style={{ width: '73%' }}
-                                                  class="van-ellipsis">
-                                                  {n.name}
+                                                  class="van-ellipsis" v-html={formatName(n.name)}>
+                                                  {/* {n.name} */}
                                                 </span>
                                                 {/* <Icon name={iconZhibo} /> */}
                                                 <div class={styles.playLoading}>
@@ -262,8 +268,8 @@ export default defineComponent({
                                                                   />
                                                                   <span
                                                                     style={{ width: '73%' }}
-                                                                    class="van-ellipsis">
-                                                                    {n.name}
+                                                                    class="van-ellipsis" v-html={formatName(n.name)}>
+                                                                    {/* {n.name} */}
                                                                   </span>
                                                                   {/* <Icon name={iconZhibo} /> */}
                                                                   <div class={styles.playLoading}>
@@ -307,7 +313,7 @@ export default defineComponent({
                 </CollapseItem>
               );
             })}
-          </Collapse>
+          </Collapse>: ""}
         </div>
       </div>
     );

+ 21 - 10
src/views/coursewarePlay/index.tsx

@@ -1,4 +1,4 @@
-import { closeToast, Icon, Popup, showDialog, showToast } from 'vant';
+import { closeToast, Icon, Popup, showDialog, showToast, Tab } from 'vant';
 import {
   defineComponent,
   onMounted,
@@ -518,6 +518,11 @@ export default defineComponent({
         }
         if(params.type === 'pointSearch') {
           detailTempSearchList.value = result
+
+          // 初始化选中的数据 临时
+          popupData.tempTabActive = allList.length > 0 ? allList[0].knowledgePointId : []
+          popupData.tempItemActive = "-1"
+          data.searchTemp = params.search
           return
         }
         detailList.value = result
@@ -726,14 +731,15 @@ export default defineComponent({
       }
     });
 
-    const playRef = ref();
+    // const playRef = ref();
     // 返回
     const goBack = () => {
-      try {
-        playRef.value?.handleOut();
-      } catch (error) {
-        console.log(error);
-      }
+      // console.log('back -----');
+      // try {
+      //   playRef.value?.handleOut();
+      // } catch (error) {
+      //   console.log(error);
+      // }
       postMessage({ api: 'back' });
     };
 
@@ -746,6 +752,8 @@ export default defineComponent({
       activeIndex: 0,
       playIndex: 0,
       tabActive: '',
+      tempTabActive: '', // 临时选中
+      tempItemActive: "", // 临时编号
       tabName: '',
       itemActive: '',
       itemName: '',
@@ -1313,6 +1321,9 @@ export default defineComponent({
                     <div class={styles.fullBtn} onClick={() => {
                       handleStop()
                       detailTempSearchList.value = detailList.value
+                      popupData.tempItemActive = ""
+                      popupData.tempTabActive = ""
+                      data.searchTemp = ""
                       // data.searchTemp = JSON.parse(JSON.stringify(data.search))
                       popupData.open = true
                     }}>
@@ -1402,10 +1413,10 @@ export default defineComponent({
             {data.source === 'search' ? 
               <PointsSearch
                 data={detailTempSearchList.value}
-                search={data.search}
+                search={data.searchTemp || data.search}
                 loading={data.searchLoading}
-                tabActive={popupData.tabActive}
-                itemActive={popupData.itemActive}
+                tabActive={popupData.tempTabActive || popupData.tabActive}
+                itemActive={popupData.tempItemActive || popupData.itemActive}
                 open={popupData.open}
                 onHandleSelect={(res: any) => {
                   popupData.open = false;

+ 1 - 1
vite.config.ts

@@ -14,7 +14,7 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-const proxyUrl = 'https://dev.gym.lexiaoya.cn';
+const proxyUrl = 'https://test.gym.lexiaoya.cn';
 export default defineConfig({
   base: './',
   plugins: [