lex 2 年之前
父節點
當前提交
ccb629fe30

+ 57 - 2
src/school/companion-teacher/index.tsx

@@ -17,6 +17,7 @@ import {
   showFailToast,
   showLoadingToast,
   showSuccessToast,
+  showToast,
   Tag
 } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
@@ -163,7 +164,8 @@ export default defineComponent({
 
     const imgs = reactive({
       saveLoading: false,
-      image: null as any
+      image: null as any,
+      shareLoading: false
     })
     const onSaveImg = async () => {
       // 判断是否在保存中...
@@ -192,6 +194,59 @@ export default defineComponent({
           })
       }
     }
+    const onShare = () => {
+      if (imgs.shareLoading) {
+        return
+      }
+      imgs.shareLoading = true
+      if (imgs.image) {
+        openShare()
+      } else {
+        const container: any = document.getElementById(`share-preview-container`)
+        html2canvas(container, {
+          allowTaint: true,
+          useCORS: true,
+          backgroundColor: null
+        })
+          .then(async (canvas) => {
+            const url = canvas.toDataURL('image/png')
+            imgs.image = url
+
+            openShare()
+          })
+          .catch(() => {
+            closeToast()
+            imgs.shareLoading = false
+          })
+      }
+    }
+    const openShare = () => {
+      const image = imgs.image
+      setTimeout(() => {
+        imgs.shareLoading = false
+      }, 100)
+      if (image) {
+        postMessage(
+          {
+            api: 'shareTripartite',
+            content: {
+              title: '',
+              desc: '',
+              image,
+              video: '',
+              type: 'image',
+              // button: ['copy']
+              shareType: 'wechat'
+            }
+          },
+          (res: any) => {
+            if (res && res.content) {
+              showToast(res.content.message || (res.content.status ? '分享成功' : '分享失败'))
+            }
+          }
+        )
+      }
+    }
     const saveImg = async () => {
       showLoadingToast({ message: '图片生成中...', forbidClick: true })
       setTimeout(() => {
@@ -360,7 +415,7 @@ export default defineComponent({
                     text: () => <div class={styles.shareText}>保存图片</div>
                   }}
                 </GridItem>
-                <GridItem>
+                <GridItem onClick={onShare}>
                   {{
                     icon: () => <Image class={styles.shareImg} src={iconWechat} />,
                     text: () => <div class={styles.shareText}>微信</div>

+ 2 - 2
src/school/main.ts

@@ -30,8 +30,8 @@ postMessage(
     console.log(res, 'version')
   }
 )
-import Vconsole from 'vconsole'
-const vconsole = new Vconsole()
+// import Vconsole from 'vconsole'
+// const vconsole = new Vconsole()
 const paymentType = (window as any).paymentType // 浏览器设置
 if (browser().isTeacher || paymentType === 'TEACHER') {
   state.platformType = 'TEACHER'

+ 2 - 0
src/school/train-planning/component/practice-detail/index.tsx

@@ -200,6 +200,7 @@ export default defineComponent({
                 v-model={item.trainTimer}
                 formatter={onFormatterInt}
                 maxlength={3}
+                type="tel"
               >
                 {{ extra: () => '分钟' }}
               </Field>
@@ -226,6 +227,7 @@ export default defineComponent({
                 v-model={item.times}
                 formatter={onFormatterInt}
                 maxlength={2}
+                type="tel"
               >
                 {{ extra: () => '课时' }}
               </Field>

+ 1 - 1
src/student/music-group/pre-apply/component/apply.tsx

@@ -304,7 +304,7 @@ export default defineComponent({
           position="bottom"
           round
           safeAreaInsetBottom
-          // duration={0}
+          duration={0}
           lazyRender={false}
         >
           <Picker

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

@@ -121,7 +121,7 @@ export default defineComponent({
         const refundReason = form.resionList.find((item: any) => item.value === form.checked)
         console.log({
           merOrderNo: form.refundSelect.orderNo,
-          refundReason: refundReason.text
+          refundReason: form.checked === 999 ? form.resion : refundReason.text
         })
         // return
         await request.post('/api-student/userPaymentOrder/refundPayment', {

+ 2 - 3
src/student/trade-record/component/paid-list.tsx

@@ -161,7 +161,7 @@ export default defineComponent({
         await request.post('/api-student/userPaymentOrder/refundPayment', {
           data: {
             merOrderNo: form.refundSelect.orderNo,
-            refundReason: refundReason.text
+            refundReason: form.checked === 999 ? form.resion : refundReason.text
           }
         })
 
@@ -242,8 +242,7 @@ export default defineComponent({
                 <Cell style={'padding: 0'}>
                   {{
                     title: () =>
-                      item.status === 'PAID' &&
-                      item.orderType === 'ORCHESTRA' && (
+                      item.refundable && (
                         <Button
                           block
                           class={styles.refundBtn}