瀏覽代碼

修改样式

lex 2 年之前
父節點
當前提交
1d5a237dfc

+ 23 - 0
src/school/orchestra/compontent/photo.module.less

@@ -6,8 +6,31 @@
     margin-top: 12px;
     border-radius: 10px;
     overflow: hidden;
+    height: 45px;
+    .icon {
+      width: 17px;
+      height: 17px;
+      margin-right: 4px;
+      flex-shrink: 0;
+    }
+    :global {
+      .van-cell__title {
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+      .van-cell__right-icon {
+        color: #333;
+        transform: rotate(90deg);
+        margin: 0 0 0 4px;
+      }
+    }
   }
 }
+.addPhotoTop {
+  color: var(--van-primary-text);
+  font-size: 14px;
+}
 .addPhone {
   margin-top: 12px;
   color: var(--van-primary-text);

+ 48 - 46
src/school/orchestra/compontent/photo.tsx

@@ -20,6 +20,9 @@ import { defineComponent, onMounted, reactive } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import styles from './photo.module.less'
 import iconPhoneDefaut from '../images/icon-photo-default.png'
+import iconOrchestra from '@/views/mine-orchestra/images/icon-or.png'
+import OSticky from '@/components/o-sticky'
+import OHeader from '@/components/o-header'
 
 export default defineComponent({
   name: 'phone',
@@ -139,28 +142,28 @@ export default defineComponent({
       }
     }
 
-    const getSchoolList = async () => {
-      try {
-        const res = await request.post('/api-school/school/page', {
-          data: {
-            page: 1,
-            rows: 999
-          }
-        })
-        if (Array.isArray(res.data?.rows)) {
-          state.schoolList = res.data.rows.map((n: any) => {
-            return {
-              name: n.name || '',
-              id: n.id || ''
-            }
-          })
-          const tmpSchool = sessionStorage.getItem('school-photo')
-          state.school = tmpSchool ? JSON.parse(tmpSchool) : state.schoolList[0] || {}
-        }
-      } catch {
-        //
-      }
-    }
+    // const getSchoolList = async () => {
+    //   try {
+    //     const res = await request.post('/api-school/school/page', {
+    //       data: {
+    //         page: 1,
+    //         rows: 999
+    //       }
+    //     })
+    //     if (Array.isArray(res.data?.rows)) {
+    //       state.schoolList = res.data.rows.map((n: any) => {
+    //         return {
+    //           name: n.name || '',
+    //           id: n.id || ''
+    //         }
+    //       })
+    //       const tmpSchool = sessionStorage.getItem('school-photo')
+    //       state.school = tmpSchool ? JSON.parse(tmpSchool) : state.schoolList[0] || {}
+    //     }
+    //   } catch {
+    //     //
+    //   }
+    // }
 
     const onDetail = (item: any) => {
       sessionStorage.setItem('orchestra-detail-tab', 'photo')
@@ -198,13 +201,6 @@ export default defineComponent({
             }
           })
           onSearch()
-          // setTimeout(() => {
-          //   showToast('删除成功')
-          // }, 100)
-
-          // setTimeout(() => {
-          //   onSearch()
-          // }, 1100)
         } catch {
           //
         }
@@ -212,7 +208,7 @@ export default defineComponent({
     }
 
     onMounted(async () => {
-      await getSchoolList()
+      // await getSchoolList()
       await getList()
     })
     return () => (
@@ -220,25 +216,31 @@ export default defineComponent({
         class={[styles.phone, !state.listState.dataShow && 'emptyRootContainer']}
         style={{ minHeight: `calc(100vh - ${props.height}px)` }}
       >
-        <Sticky position="top" offsetTop={props.height} style={{ width: '100%' }}>
+        <OSticky position="top">
+          <OHeader>
+            {{
+              right: () => (
+                <span
+                  class={styles.addPhotoTop}
+                  onClick={() => {
+                    state.status = true
+                    state.selectType = 'add'
+                  }}
+                >
+                  添加相册
+                </span>
+              )
+            }}
+          </OHeader>
+        </OSticky>
+        {/* <Sticky position="top" offsetTop={props.height} style={{ width: '100%' }}>
           <Cell class={styles.select} center isLink onClick={() => (state.schoolStatus = true)}>
             {{
-              // icon: () => <img class={styles.icon} src={iconOrchestra} />,
+              icon: () => <img class={styles.icon} src={iconOrchestra} />,
               title: () => <div class="van-ellipsis">{state.school.name}</div>
             }}
           </Cell>
-          <Button
-            icon="plus"
-            block
-            class={styles.addPhone}
-            onClick={() => {
-              state.status = true
-              state.selectType = 'add'
-            }}
-          >
-            新建相册
-          </Button>
-        </Sticky>
+        </Sticky> */}
 
         {state.listState.dataShow ? (
           <List
@@ -324,7 +326,7 @@ export default defineComponent({
           ]}
         />
 
-        <Popup v-model:show={state.schoolStatus} position="bottom" round>
+        {/* <Popup v-model:show={state.schoolStatus} position="bottom" round>
           <Picker
             columns={state.schoolList}
             columnsFieldNames={{ text: 'name', value: 'id' }}
@@ -341,7 +343,7 @@ export default defineComponent({
               onSearch()
             }}
           />
-        </Popup>
+        </Popup> */}
       </div>
     )
   }

+ 3 - 0
src/school/orchestra/modal/add-information.tsx

@@ -1,3 +1,5 @@
+import OHeader from '@/components/o-header'
+import OSticky from '@/components/o-sticky'
 import OUpload from '@/components/o-upload'
 import request from '@/helpers/request'
 import { verifyUrl } from '@/helpers/toolsValidate'
@@ -82,6 +84,7 @@ export default defineComponent({
 
     return () => (
       <div class={styles.addInformation}>
+        <OHeader title="添加资讯" desotry={false} />
         <div class={styles.title}>
           <i class={[styles.icon, styles.icon1]}></i>请上传封面图片
         </div>

+ 1 - 5
src/school/orchestra/orchestra-information.module.less

@@ -2,11 +2,7 @@
   overflow: hidden;
   .addPhone {
     color: var(--van-primary-text);
-    border-color: #fff;
-    border-radius: 10px;
-    font-size: 16px;
-    margin: 13px;
-    width: calc(100% - 26px);
+    font-size: 14px;
   }
 
   .img {

+ 18 - 2
src/school/orchestra/orchestra-information.tsx

@@ -1,6 +1,7 @@
 import ODialog from '@/components/o-dialog'
 import OEmpty from '@/components/o-empty'
 import OFullRefresh from '@/components/o-full-refresh'
+import OHeader from '@/components/o-header'
 import OPopup from '@/components/o-popup'
 import OSticky from '@/components/o-sticky'
 import request from '@/helpers/request'
@@ -138,7 +139,22 @@ export default defineComponent({
             state.listState.height = height
           }}
         >
-          <div style="background: #f6f8f9; overflow: hidden;">
+          <OHeader>
+            {{
+              right: () => (
+                <span
+                  class={styles.addPhone}
+                  onClick={() => {
+                    state.selectType = 'add'
+                    state.addStatus = true
+                  }}
+                >
+                  添加资讯
+                </span>
+              )
+            }}
+          </OHeader>
+          {/* <div style="background: #f6f8f9; overflow: hidden;">
             <Button
               icon="plus"
               block
@@ -150,7 +166,7 @@ export default defineComponent({
             >
               添加资讯
             </Button>
-          </div>
+          </div> */}
         </OSticky>
 
         {state.listState.dataShow ? (

+ 22 - 0
src/views/mine-orchestra/my-photo/index.module.less

@@ -47,3 +47,25 @@
   width: calc(100% - 26px);
   margin: 12px 13px 0;
 }
+
+.select {
+  height: 45px;
+  .icon {
+    width: 17px;
+    height: 17px;
+    margin-right: 4px;
+    flex-shrink: 0;
+  }
+  :global {
+    .van-cell__title {
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    .van-cell__right-icon {
+      color: #333;
+      transform: rotate(90deg);
+      margin: 0 0 0 4px;
+    }
+  }
+}

+ 2 - 1
src/views/mine-orchestra/my-photo/index.tsx

@@ -18,6 +18,7 @@ import { defineComponent, onMounted, reactive, watch } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import styles from './index.module.less'
 import iconImage from '../images/icon-photo-default.png'
+import iconOrchestra from '../images/icon-or.png'
 export default defineComponent({
   name: 'photo-detail',
   props: {
@@ -112,7 +113,7 @@ export default defineComponent({
         <CellGroup inset class={styles.cellGroup}>
           <Cell class={styles.select} center isLink onClick={() => (data.schoolStatus = true)}>
             {{
-              // icon: () => <img class={styles.icon} src={iconOrchestra} />,
+              icon: () => <img class={styles.icon} src={iconOrchestra} />,
               title: () => <div class="van-ellipsis">{data.school.name}</div>
             }}
           </Cell>

+ 22 - 1
src/views/unit-test/index.tsx

@@ -12,6 +12,8 @@ import { unitTestStatus } from '@/constant'
 import dayjs from 'dayjs'
 import NoticeStart from './model/notice-start'
 import OFullRefresh from '@/components/o-full-refresh'
+import ODialog from '@/components/o-dialog'
+import { state } from '@/state'
 
 export default defineComponent({
   name: 'unit-test',
@@ -39,7 +41,9 @@ export default defineComponent({
       isClick: false,
       visiableNotice: false,
       unitExam: {} as any, // 测验详情
-      selectUnitExam: {} as any
+      selectUnitExam: {} as any,
+      dialogMessage: '',
+      dialogStatus: false
     })
 
     const getList = async (status = false) => {
@@ -84,6 +88,12 @@ export default defineComponent({
     // 开始测验
     const onUnitTestStart = async (item: any) => {
       try {
+        // 判断是否是会员
+        if (!state.user.data.vipMember) {
+          form.dialogStatus = true
+          form.dialogMessage = '您暂未开通团练宝,请开通后使用'
+          return
+        }
         // 判断是否是继续测验
         form.selectUnitExam = item || {}
         if (item.status === 'C_ING') {
@@ -336,6 +346,17 @@ export default defineComponent({
             onConfirm={onExamStart}
           />
         </Popup>
+
+        <ODialog
+          message={form.dialogMessage}
+          v-model:show={form.dialogStatus}
+          showCancelButton
+          cancelButtonText="取消"
+          confirmButtonText="立即开通"
+          onConfirm={() => {
+            router.push('/memberCenter')
+          }}
+        />
       </div>
     )
   }

+ 20 - 2
src/views/unit-test/practice-mode/index.tsx

@@ -17,7 +17,7 @@ import { computed, defineComponent, nextTick, onMounted, onUnmounted, reactive,
 import { useRoute, useRouter } from 'vue-router'
 import styles from './index.module.less'
 import iconButtonList from '../images/icon-button-list.png'
-
+import { state as baseState } from '@/state'
 import OSticky from '@/components/o-sticky'
 import ChoiceQuestion from '../model/choice-question'
 import AnswerList from '../model/answer-list'
@@ -65,7 +65,9 @@ export default defineComponent({
         rate: 0 // 正确率
       },
       knowledgelist: [] as any, // 知识点列表
-      quitStatus: false
+      quitStatus: false,
+      dialogMessage: '',
+      dialogStatus: false
     })
 
     // 计时
@@ -324,6 +326,13 @@ export default defineComponent({
 
       resizeSwipeItemHeight()
 
+      if (!baseState.user.data.vipMember) {
+        pause()
+        state.dialogStatus = true
+        state.dialogMessage = '您暂未开通团练宝,请开通后使用'
+        return
+      }
+
       window.history.pushState(null, '', document.URL)
       window.addEventListener('popstate', onBack, false)
     })
@@ -587,6 +596,15 @@ export default defineComponent({
           confirmButtonText="确认退出"
           onConfirm={onAfter}
         />
+
+        <ODialog
+          message={state.dialogMessage}
+          v-model:show={state.dialogStatus}
+          confirmButtonText="立即开通"
+          onConfirm={() => {
+            router.push('/memberCenter')
+          }}
+        />
       </div>
     )
   }