Browse Source

Merge branch 'master' of http://git.dayaedu.com/lex/h5-colexiu

lex 2 years ago
parent
commit
af4077ba06

+ 49 - 42
src/teacher/piano-room/class-arrangement/course-schedule/index.tsx

@@ -20,11 +20,11 @@ export default defineComponent({
     },
     onClose: {
       type: Function,
-      default: () => {}
+      default: (n: any) => {}
     },
     onComfirm: {
       type: Function,
-      default: () => {}
+      default: (n: any) => {}
     }
   },
   setup(props) {
@@ -32,51 +32,58 @@ export default defineComponent({
       let list = props.students.map((n: IStudent) => n.realName)
       return list.join('、')
     })
-    return () => (
-      <div class={styles.box}>
-        <div class={styles.title}>
-          <div class={styles.leftIcon}></div>
-          课程预览
-        </div>
-        <div class={styles.wrap}>
-          <div class={styles.stu}>
-            <div>
-              您将为学员:
-              <span style={{ color: 'var(--van-primary)' }}>{students.value}</span>
+    return () => {
+      const n = props.students.length + 1
+      return (
+        <div class={styles.box}>
+          <div class={styles.title}>
+            <div class={styles.leftIcon}></div>
+            课程预览
+          </div>
+          <div class={styles.wrap}>
+            <div class={styles.stu}>
+              <div>
+                您将为学员:
+                <span style={{ color: 'var(--van-primary)' }}>
+                  {students.value}
+                </span>
+              </div>
+              <div>
+                排
+                <span style={{ color: '#FF4E19', margin: '0 10px' }}>
+                  {props.item.classNum}节 {props.item.singleClssTime}分钟
+                </span>
+                课程
+              </div>
             </div>
-            <div>
-              排
-              <span style={{ color: '#FF4E19', margin: '0 10px' }}>
-                {props.item.classNum}节 {props.item.singleClssTime}分钟
-              </span>
-              课程
+            <div class={styles.timeBox}>
+              <div class={styles.timeTitle}>上课时间:</div>
+              {props.curriculum.map((item: string) => (
+                <div class={styles.timeItem}>{item}</div>
+              ))}
             </div>
-          </div>
-          <div class={styles.timeBox}>
-            <div class={styles.timeTitle}>上课时间:</div>
-            {props.curriculum.map((item: string) => (
-              <div class={styles.timeItem}>{item}</div>
-            ))}
-          </div>
 
-          <div style={{ color: '#999999' }}>
-            以上课程预计将消耗琴房时长{' '}
-            {Math.ceil(props.students.length * props.item.classNum * props.item.singleClssTime)} 分钟{' '}
-            <br />
-            确认排课后时长冻结 <br />
-            实际消耗时长以扣减结果为准 <br />
+            <div style={{ color: '#999999' }}>
+              以上课程预计将消耗琴房时长{' '}
+              {Math.ceil(
+                n * (n - 1) * props.item.classNum * props.item.singleClssTime
+              )}{' '}
+              分钟 <br />
+              确认排课后时长冻结 <br />
+              实际消耗时长以扣减结果为准 <br />
+            </div>
           </div>
-        </div>
 
-        <div class={styles.footer}>
-          <Button block round onClick={() => props.onClose()}>
-            重新选择
-          </Button>
-          <Button block round type="primary" onClick={() => props.onComfirm()}>
-            确认排课
-          </Button>
+          <div class={styles.footer}>
+            <Button block round onClick={props.onClose}>
+              重新选择
+            </Button>
+            <Button block round type="primary" onClick={props.onComfirm}>
+              确认排课
+            </Button>
+          </div>
         </div>
-      </div>
-    )
+      )
+    }
   }
 })

+ 17 - 4
src/views/shop-mall/goods-list/index.tsx

@@ -8,7 +8,6 @@ import ColSearch from '@/components/col-search'
 export default defineComponent({
   name: 'goods-list',
   data() {
-    console.log(this.$route)
     const query = this.$route.query
     return {
       typeId: 0,
@@ -26,9 +25,20 @@ export default defineComponent({
         name: '',
         id: 0
       },
-      keyword: '' as any
+      keyword: '' as any,
+      autofocus: false
     }
   },
+  mounted() {
+    this.$nextTick(() => {
+      if (this.$route.query.input === 'focus') {
+        let input: HTMLInputElement = document.querySelector(
+          '.van-field__control'
+        ) as HTMLInputElement
+        input.focus()
+      }
+    })
+  },
   methods: {
     onFilter(n: number) {
       if (this.filterActive === 3 && n === 3) n = 4
@@ -112,8 +122,11 @@ export default defineComponent({
                   size={12}
                 />
                 <Icon
-                  class={[styles.iconSort, this.filterActive === 4 ? [styles['icon-active']] : '']}
-                  style={{ transform: 'rotate(90deg)'}}
+                  class={[
+                    styles.iconSort,
+                    this.filterActive === 4 ? [styles['icon-active']] : ''
+                  ]}
+                  style={{ transform: 'rotate(90deg)' }}
                   name="play"
                   size={12}
                 />

+ 7 - 1
src/views/shop-mall/index.module.less

@@ -12,7 +12,13 @@
     margin-right: 5px;
   }
 }
-
+.searchBox {
+  :global {
+    .van-search .van-search__content {
+      background-color: #fff !important;
+    }
+  }
+}
 .swipe {
   margin: 14px;
   border-radius: 10px;

+ 12 - 2
src/views/shop-mall/index.tsx

@@ -19,6 +19,7 @@ import iconShopCart from './images/icon-shop-cart.png'
 import request from '@/helpers/request'
 import { useRect } from '@vant/use'
 import { postMessage } from '@/helpers/native-message'
+import ColSearch from '@/components/col-search'
 
 export default defineComponent({
   name: 'shop-mall',
@@ -57,12 +58,12 @@ export default defineComponent({
       let dev = false
       let origin = location.origin + location.pathname + '#'
       if (!url) return
-      
+
       if (url.indexOf('http') < 0) {
         url = origin + url
       }
       console.log('跳转url:', url)
-      let ua = navigator.userAgent.toLowerCase();
+      let ua = navigator.userAgent.toLowerCase()
       if (!ua.includes('colexiuapp')) {
         location.href = url
         return
@@ -103,6 +104,15 @@ export default defineComponent({
             }}
           />
         </div>
+        <div onClick={() => {
+          this.$router.push('/goodsList?input=focus')
+        }}>
+          <ColSearch
+            disabled
+            class={styles.searchBox}
+            background="transparent"
+          />
+        </div>
         <Swipe
           class={styles.swipe}
           autoplay={3000}