lex 2 years ago
parent
commit
1944e17a4a

+ 1 - 0
src/school/train-planning/component/standard/index.tsx

@@ -296,6 +296,7 @@ export default defineComponent({
           v-model:modelValue={forms.timerStatus}
           position="bottom"
           style={{ background: '#F6F6F6' }}
+          destroy
         >
           <Timer
             timerList={forms.timerList}

+ 17 - 7
src/school/train-planning/modal/timer/index.tsx

@@ -1,6 +1,8 @@
 import OHeader from '@/components/o-header'
 import item from '@/student/coupons/item'
 import dayjs from 'dayjs'
+// import isBetween from 'dayjs/plugin/isBetween'
+// dayjs.extend(isBetween)
 import { Button, Cell, CellGroup, Popup, showToast, Sticky, TimePicker } from 'vant'
 import { defineComponent, onMounted, reactive, watch } from 'vue'
 import styles from './index.module.less'
@@ -99,31 +101,39 @@ export default defineComponent({
 
     // 确认时间
     const onConfirm = (val: any) => {
-      console.log(val, 'val')
+      // console.log(val, 'val')
       const selectedValues = val.selectedValues
       const tempDate = dayjs(state.calendarDate)
         .hour(selectedValues[0])
         .minute(selectedValues[1])
         .second(0)
-      console.log(dayjs(tempDate).format('YYYY-MM-DD HH:mm:ss'), 'first', dayjs(tempDate).minute())
+      // console.log(dayjs(tempDate).format('YYYY-MM-DD HH:mm:ss'), 'first', dayjs(tempDate).minute())
       // 时间加上每节课的时间,
       const lastDate = dayjs(tempDate).minute(props.times + dayjs(tempDate).minute())
       console.log(dayjs(lastDate).format('YYYY-MM-DD HH:mm:ss'), 'second')
       console.log(
         dayjs(tempDate).format('YYYY-MM-DD HH:mm:ss'),
         tempDate.toDate(),
-        'second tempDate'
+        'second tempDate',
+        state.useTimer
       )
 
       let isActive = false
       state.useTimer.forEach((item: any) => {
-        if (dayjs(lastDate).isAfter(item.endTime)) {
+        // if (dayjs(lastDate).isBetween(item.startTime, item.endTime, null, '[]')) {
+        //   isActive = true
+        // }
+        // 判断课程的时间范围在不在可排课时间范围内
+        if (
+          dayjs(tempDate).valueOf() >= dayjs(item.startTime).valueOf() &&
+          dayjs(lastDate).valueOf() <= dayjs(item.endTime).valueOf()
+        ) {
           isActive = true
         }
       })
 
-      console.log(isActive, 'isActive')
-      if (isActive) {
+      // console.log(isActive, 'isActive')
+      if (!isActive) {
         showToast('您选择的时间超过可排课时间范围')
         return
       }
@@ -178,7 +188,7 @@ export default defineComponent({
 
         {/* <div class={styles.selectTimer}>{dayjs(state.calendarDate).format('YYYY年MM月DD日')}</div> */}
 
-        <CellGroup inset class={styles.cellGroup}>
+        <CellGroup inset class={styles.cellGroup} style={{ marginTop: '12px' }}>
           {state.useTimer.map((item: any) => (
             <Cell
               center

+ 6 - 1
src/student/music-group/pre-apply/order-detail.tsx

@@ -21,6 +21,7 @@ export default defineComponent({
       paymentStatus: false,
       showQrcode: false,
       qrCodeUrl: '',
+      pay_channel: '',
       orderNo: route.query.orderNo,
       orderInfo: {} as any, // 订单信息
       goodsInfos: [] as any, // 订单信息列表
@@ -45,6 +46,7 @@ export default defineComponent({
 
     const onConfirm = (val: any) => {
       const config: any = state.config
+      state.pay_channel = val.pay_channel
       if (val.payCode === 'payResult') {
         router.push({
           path: '/payResult',
@@ -200,7 +202,10 @@ export default defineComponent({
             <div class={styles.codeImg}>
               <div class={styles.codeContent}>
                 <h2 class={styles.codeTitle}>乐团报名</h2>
-                <div class={styles.codeName}>请截图下方二维码 登录支付宝扫码支付</div>
+                <div class={styles.codeName}>
+                  请截图下方二维码 登录{state.pay_channel === 'wx_pub' ? '微信' : '支付宝'}
+                  扫码支付
+                </div>
 
                 <div class={styles.codeQr}>
                   <OQrcode text={state.qrCodeUrl} size={'400'} />

+ 16 - 1
src/student/music-group/shop-address/address-operation.tsx

@@ -4,6 +4,7 @@ import { defineComponent, reactive } from 'vue'
 import request from '../request-music'
 import styles from './index.module.less'
 import { areas } from '@/helpers/area'
+import { verifiyNumberInteger } from '@/helpers/toolsValidate'
 
 export default defineComponent({
   name: 'address-operation',
@@ -20,6 +21,14 @@ export default defineComponent({
       detailAddress: null
     })
 
+    const onFormatterInt = (val: any) => {
+      if (val && val >= 1) {
+        return verifiyNumberInteger(val)
+      } else {
+        return ''
+      }
+    }
+
     const onSubmit = async () => {
       try {
         await request.post('/api-student/userReceiveAddress/save', {
@@ -31,7 +40,13 @@ export default defineComponent({
       <div class={styles.operation}>
         <CellGroup inset class={styles.form}>
           <Field label="收货人" placeholder="请输入收货人姓名" v-model={state.name} />
-          <Field label="手机号" placeholder="请输入收货人人手机号" v-model={state.phoneNumber} />
+          <Field
+            label="手机号"
+            placeholder="请输入收货人人手机号"
+            v-model={state.phoneNumber}
+            maxlength={11}
+            formatter={onFormatterInt}
+          />
           <Field
             label="所在地区"
             placeholder="省、市、区、街道"

+ 2 - 2
vite.config.ts

@@ -12,8 +12,8 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://mstutest.dayaedu.com/';
-// const proxyUrl = 'http://47.98.131.38:8989/'
-const proxyUrl = 'http://192.168.3.143:8989/' // 尚科
+const proxyUrl = 'http://47.98.131.38:8989/'
+// const proxyUrl = 'http://192.168.3.143:8989/' // 尚科
 // const proxyUrl = 'http://192.168.3.26:8989/' // 刘俊驰
 export default defineConfig({
   base: './',