Browse Source

Merge branch '0906result' into iteration-0906

mo 1 year ago
parent
commit
b7226afd6f

+ 1 - 1
postcss.config.js

@@ -10,7 +10,7 @@ module.exports = {
       fontViewportUnit: 'rem', // 字体使用的视口单位
       selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
       minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
-      mediaQuery: false, // 媒体查询里的单位是否需要转换单位
+      mediaQuery: true, // 媒体查询里的单位是否需要转换单位
       replace: true, //  是否直接更换属性值,而不添加备用属性
       exclude: undefined, // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
       include: undefined, // 如果设置了include,那将只有匹配到的文件才会被转换

BIN
src/components/layout/images/bg-line.png


BIN
src/components/layout/images/boxBg.png


BIN
src/components/layout/images/chioseAdd.png


BIN
src/components/layout/images/inBack.png


BIN
src/components/layout/images/inBack2.png


BIN
src/components/layout/images/inBack3.png


BIN
src/components/layout/images/inBack4.png


BIN
src/components/layout/images/inBack5.png


BIN
src/components/layout/images/inFront.png


BIN
src/components/layout/images/sealing.png


BIN
src/components/layout/images/submitBtn.png


BIN
src/components/layout/images/suggestClose.png


BIN
src/components/layout/images/textLIne.png


+ 50 - 0
src/components/layout/index.module.less

@@ -513,4 +513,54 @@
     }
   }
 
+}
+
+.suggestWrap {
+  // :global {
+  //   .n-card-header {
+  //     display: none;
+  //   }
+
+  //   .n-card__content {
+  //     background-color: transparent;
+  //   }
+  // }
+
+  width: 754px;
+  background-color: transparent !important;
+  box-shadow: none !important;
+
+
+
+  :global {
+    .n-card-header {
+      display: none;
+    }
+
+    .n-card__content {
+      background-color: transparent;
+    }
+
+    .n-input__border {
+      display: none;
+    }
+
+    .n-input__state-border {
+      display: none;
+    }
+
+    // .n-card.n-modal {
+    //   background-color: transparent !important;
+    //   box-shadow: none !important;
+
+    //   .n-input__border {
+    //     display: none;
+    //   }
+
+    //   .n-input__state-border {
+    //     display: none;
+    //   }
+    // }
+  }
+
 }

+ 2 - 4
src/components/layout/layoutTop.tsx

@@ -245,12 +245,10 @@ export default defineComponent({
           </NModal>
 
           <NModal
-            class={['modalTitle', 'background']}
-            style={{ width: '910px' }}
+            class={['modalTitle', 'background', styles.suggestWrap]}
             v-model:show={showSuggestionViseble.value}
             preset="card"
-            showIcon={false}
-            title="意见反馈">
+            showIcon={false}>
             <SuggestionOption
               onClose={() =>
                 (showSuggestionViseble.value = false)

+ 330 - 55
src/components/layout/modals/suggestion-option.module.less

@@ -1,77 +1,352 @@
-.updateBtnGroup {
-  padding: 0;
-  justify-content: center !important;
+.pxToVW (@px, @attr: width) {
+  @vw: (@px / 1920) * 100;
+  @{attr}:~"@{vw}vw";
+}
 
-  :global {
-    .n-button {
-      height: 48px !important;
-      min-width: 156px;
+
+
+.suggestOption {
+  .updateBtnGroup {
+    padding: 0;
+    justify-content: center !important;
+    position: relative;
+
+    :global {
+      .n-button {
+        height: 48px !important;
+        min-width: 156px;
+      }
     }
   }
-}
 
-.updatePassword {
-  background-color: transparent;
-  padding: 40px;
-}
+  .suggestSelect {
+    :global {
+      .n-base-selection__border {
+        border: 1px solid #AADCFF;
+      }
+
+
+    }
+  }
 
-.countInput {
-  border-radius: 8px;
-  min-height: 265px;
-}
 
-.addInput {
-  font-size: 16px;
-  font-weight: 400;
-  color: #777777;
-  line-height: 22px;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
+  @keyframes forDown {
+    0% {
+      top: 0
+    }
 
-  img {
-    width: 36px;
-    height: 36px;
-    margin-bottom: 20px;
+    100% {
+      top: 450px
+    }
   }
-}
 
-:global {
-  .n-upload-trigger.n-upload-trigger--image-card {
-    width: 150px;
-    height: 150px;
-    background: #FDFDFD;
-    border-radius: 8px;
+
+  @keyframes forUp {
+    0% {
+      top: 0
+    }
+
+    100% {
+      top: -120px
+    }
   }
 
-  .n-upload-file-list .n-upload-file.n-upload-file--image-card-type {
-    width: 150px;
-    height: 150px;
-    background: #FDFDFD;
-    border-radius: 8px;
+  @keyframes endRoute {
+    0% {
+      // top: -150px;
+      // left: 200px;
+      // transform-origin: 291px 438px; rotate(180deg)
+      // transform: scale(1);
+      opacity: 1;
+    }
+
+    // 25% {
+    //   top: -180px;
+    //   left: 300px;
+    //   transform-origin: 291px 438px;
+    //   transform: rotate(-360deg) scale(.8);
+    // }
 
+    // 50% {
+    //   top: -210px;
+    //   left: 400px;
+    //   transform-origin: 291px 438px;
+    //   transform: rotate(-450deg) scale(.6);
+    // }
+
+    100% {
+      // top: -240px;
+      // left: 500px;
+      // transform-origin: 291px 438px;  rotate(360deg)
+      opacity: 0;
+      transform: scale(.4);
+    }
   }
 
+  @keyframes reversal {
+    25% {
+      background: url(../images/inBack2.png) no-repeat;
+      background-size: 754px 672px;
+
+    }
+
+    50% {
+      background: url(../images/inBack3.png) no-repeat;
+      background-size: 754px 672px;
+      z-index: 0;
+    }
+
+    75% {
+      background: url(../images/inBack4.png) no-repeat;
+      background-size: 754px 672px;
+      // background-color: #005FA0;
+      z-index: 300;
+    }
+
+    100% {
+      background: url(../images/inBack5.png) no-repeat;
+      background-size: 754px 672px;
+      z-index: 300;
+    }
 
-  .n-upload-file-list.n-upload-file-list--grid {
-    display: grid;
-    grid-template-columns: repeat(auto-fill, 150px);
-    grid-gap: 20px;
-    margin-top: 0;
   }
-}
 
-.messageWrap {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
+  @keyframes stamp {
+    0% {
+      opacity: 1;
+      transform: scale(1.5);
+    }
+
+    100% {
+      transform: scale(1);
+      opacity: 1;
+    }
+  }
+
+  .inBack {
+    width: 754px;
+    height: 672px;
+    position: absolute;
+    bottom: 0;
+    background: url(../images/inBack.png) no-repeat;
+    background-size: 754px 672px;
+    z-index: 1;
+
+  }
+
+  .inBack.isAni {
+    animation: reversal .3s 1s forwards;
+  }
+
+  .inBackBottom {
+
+    width: 754px;
+    left: 12px;
+    width: 730px;
+    height: 393px;
+    // background: url(../images/boxBg.png) 754px 380px;
+    position: absolute;
+    bottom: 0;
+    border-radius: 35px 25px;
+  }
+
+  .inFront {
+    width: 754px;
+    height: 262px;
+    position: absolute;
+    bottom: -1px;
+    // left: 12px;
+    z-index: 200;
+
+  }
+
+  .submitBtn {
+    width: 272px;
+    height: 54px;
+    position: absolute;
+    z-index: 201;
+    bottom: 111px;
+    left: 50%;
+    margin-left: -136px;
+    cursor: pointer;
+    z-index: 400;
+  }
 
-  p {
-    height: 25px;
-    font-size: 18px;
+
+  .updatePassword.isAni {
+    animation: forUp linear .3s forwards, endRoute linear .3s 2.3s forwards;
+  }
+
+  .updatePassword {
+    // padding: 0 12px;
+
+    background-color: transparent;
+    margin: 0 auto 0;
+    position: relative;
+    overflow: hidden;
+    top: 0;
+
+
+    .formWrap.isAni {
+      animation: forDown linear 1s forwards;
+    }
+
+    .sealing {
+      position: absolute;
+      bottom: 58px;
+      z-index: 300;
+      width: 173px;
+      height: 175px;
+      left: 50%;
+      margin-left: -87px;
+      opacity: 0;
+    }
+
+    .sealing.isAni {
+      animation: stamp linear .3s 1.5s forwards;
+    }
+
+    // padding: 40px;
+    .formWrap {
+      top: 0;
+      background-color: #fff;
+      margin: 0 27px 0;
+      width: 700px;
+      height: 836px;
+      border-radius: 20px;
+      padding: 15px 15px 5px;
+      position: relative;
+      z-index: 100;
+
+
+      .formTitle {
+        text-align: center;
+        margin-top: 31px;
+      }
+
+      .bgLine {
+        position: absolute;
+        width: 670px;
+        height: 779px;
+        left: 15px;
+        top: 15px;
+      }
+
+      h2 {
+        font-size: 28px;
+      }
+
+      .formWrapInfo {
+        padding: 24px 19px 0;
+      }
+
+      .closeBtn {
+        width: 60px;
+        height: 60px;
+        position: absolute;
+        right: -1px;
+        top: 0;
+        z-index: 100;
+        cursor: pointer;
+      }
+    }
+  }
+
+
+
+  .countInput {
+    border-radius: 8px;
+    min-height: 265px;
+
+    :global {
+      .n-input__textarea-el {
+        line-height: 51px !important;
+        font-size: 16px;
+        font-weight: 400;
+        color: #131415;
+        background: url('../images/textLIne.png') repeat;
+        background-size: 632px 51px;
+      }
+
+      .n-input__placeholder {
+        margin-top: 13px !important;
+      }
+
+      .n-input-wrapper {
+        padding: 0 !important;
+      }
+
+      .n-input-word-count {
+        bottom: -12px !important;
+        font-size: 14px;
+        font-weight: 400;
+        color: #AAAAAA;
+        line-height: 20px;
+      }
+    }
+
+
+
+  }
+
+  .addInput {
+    font-size: 16px;
     font-weight: 400;
     color: #777777;
-    line-height: 25px;
-    margin-right: 40px;
+    line-height: 22px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+
+    img {
+      width: 35px;
+      height: 35px;
+      margin-bottom: 5px;
+    }
+  }
+
+  :global {
+    .n-upload-trigger.n-upload-trigger--image-card {
+      width: 110px;
+      height: 110px;
+      background: #FDFDFD;
+      border-radius: 8px;
+    }
+
+    .n-upload-file-list .n-upload-file.n-upload-file--image-card-type {
+      width: 110px;
+      height: 110px;
+      background: #FDFDFD;
+      border-radius: 8px;
+
+    }
+
+
+    .n-upload-file-list.n-upload-file-list--grid {
+      display: grid;
+      grid-template-columns: repeat(auto-fill, 110px);
+      grid-gap: 20px;
+      margin-top: 0;
+    }
+  }
+
+  .messageWrap {
+    // display: flex;
+    // flex-direction: row;
+    align-items: center;
+    position: absolute;
+    bottom: 35px;
+    z-index: 202;
+    width: 100%;
+    text-align: center;
+
+    p {
+      height: 25px;
+      font-size: 18px;
+      font-weight: 400;
+      color: #005FA0;
+      line-height: 25px;
+      // margin-right: 40px;
+    }
   }
 }

+ 178 - 128
src/components/layout/modals/suggestion-option.tsx

@@ -14,10 +14,21 @@ import {
 } from 'naive-ui';
 
 import { useUserStore } from '/src/store/modules/users';
+import bgLine from '../images/bg-line.png';
 import chioseAdd from '../images/chioseAdd.png';
 import CSelect from '../../CSelect';
 import { policy } from '../../upload-file/api';
-import { addSuggestion, getSuggestionList,sysParamConfigPage } from '../modals/api';
+import suggestClose from '../images/suggestClose.png';
+import inFront from '../images/inFront.png';
+import inBack from '../images/inBack.png';
+import submitBtn from '../images/submitBtn.png';
+import sealing from '../images/sealing.png'
+import boxBg from '../images/boxBg.png'
+import {
+  addSuggestion,
+  getSuggestionList,
+  sysParamConfigPage
+} from '../modals/api';
 export default defineComponent({
   name: 'train-update',
   emits: ['close', 'submit'],
@@ -29,20 +40,20 @@ export default defineComponent({
       clientType: 'TEACHER',
       content: '',
       attachmentUrls: '',
-      type: "APP",
-      mobileNo:userStore.getUserInfo.phone
+      type: 'APP',
+      mobileNo: userStore.getUserInfo.phone
     });
     const state = reactive([]) as any;
-
-    const suggestionTypeList = ref([]as any)
+    const isubmit = ref(false)
+    const suggestionTypeList = ref([] as any);
     const ossUploadUrl = `https://gyt.ks3-cn-beijing.ksyuncs.com/`;
     const uploadRef = ref();
     const fileListRef = ref<UploadFileInfo[]>([]);
     const formsRef = ref();
     const btnLoading = ref(false);
     const tempFiileBuffer = ref();
-    const email = ref('')
-    const phone = ref('')
+    const email = ref('');
+    const phone = ref('');
     const onSubmit = async () => {
       if (!forms.suggestionTypeId) {
         message.error('请选择反馈类型');
@@ -52,22 +63,25 @@ export default defineComponent({
         message.error('请填写反馈信息');
         return;
       }
-      const attachmentUrlsList = fileListRef.value.map((item:any)=>{
-        console.log(item,'item')
+      const attachmentUrlsList = fileListRef.value.map((item: any) => {
+        console.log(item, 'item');
         const name = item.name;
         // const suffix = name.slice(name.lastIndexOf('.'));
         const fileName = `${item.id + name}`;
         const url = ossUploadUrl + fileName;
-        return url
-      })
-      const attachmentUrls = attachmentUrlsList.join(',')
-      try{
+        return url;
+      });
+      const attachmentUrls = attachmentUrlsList.join(',');
+      try {
+        const res = await addSuggestion({ ...forms, attachmentUrls });
+        isubmit.value = true;
+        // message.success('提交成功');
+        setTimeout(()=>{
+          emit('close');
+        },3000)
 
-        const res = await addSuggestion({...forms,attachmentUrls})
-        message.success('提交成功')
-        emit('close')
-      }catch(e){
-        console.log(e)
+      } catch (e) {
+        console.log(e);
       }
       console.log('onSubmit');
     };
@@ -114,7 +128,7 @@ export default defineComponent({
           key: fileName,
           KSSAccessKeyId: data.kssAccessKeyId,
           name: fileName
-        })
+        });
       } catch {
         //
         // message.error('上传失败')
@@ -132,142 +146,178 @@ export default defineComponent({
       // urlList.value.push(url);
       // onFinishAfter(options);
     };
-    const onRemove = async (event:any) => {
-      console.log(event)
+    const onRemove = async (event: any) => {
+      console.log(event);
       btnLoading.value = false;
     };
 
     const getTypeList = async () => {
       try {
         const res = await getSuggestionList({ rows: 9999, page: 1 });
-      suggestionTypeList.value = res.data.rows;
+        suggestionTypeList.value = res.data.rows;
       } catch (e) {
-        console.log('请求报错')
         console.log(e);
       }
     };
 
 
-    const getPhoneInfo = async ()=>{
-
 
+    const getPhoneInfo = async () => {
       try {
-        const {data} = await sysParamConfigPage({ page: 1, rows: 999, group: 'OTHER' });
-        const rows = data.rows || []
-        email.value = rows.find((item:any)=>{
-          return item.paramName == 'customer_service_email'
-        }).paramValue
-        phone.value = rows.find((item:any)=>{
-          return item.paramName == 'customer_service_phone'
-        }).paramValue
+        const { data } = await sysParamConfigPage({
+          page: 1,
+          rows: 999,
+          group: 'OTHER'
+        });
+        const rows = data.rows || [];
+        email.value = rows.find((item: any) => {
+          return item.paramName == 'customer_service_email';
+        }).paramValue;
+        phone.value = rows.find((item: any) => {
+          return item.paramName == 'customer_service_phone';
+        }).paramValue;
 
-        console.log( email.value , phone.value)
+        console.log(email.value, phone.value);
       } catch (e) {
-        console.log('请求报错')
+        console.log('请求报错');
         console.log(e);
       }
-
-    }
-    onMounted(()=>{
-      getTypeList()
-      getPhoneInfo()
-    })
+    };
+    onMounted(() => {
+      getTypeList();
+      getPhoneInfo();
+    });
     return () => (
-      <div class={styles.updatePassword}>
-        <NForm
-          labelAlign="right"
-          labelPlacement="left"
-          labelWidth={'auto'}
-          ref={formsRef}
-          model={forms}
-          requireMarkPlacement="left">
-          {/* <NFormItem
+      <div class={styles.suggestOption}>
+      <div class={[styles.updatePassword,isubmit.value?styles.isAni:'']}>
+        <div class={[styles.formWrap,isubmit.value?styles.isAni:'']}>
+          <NImage
+            class={styles.closeBtn}
+            src={suggestClose}
+            previewDisabled   onClick={() => emit('close')}></NImage>
+          <NImage class={styles.bgLine} src={bgLine} previewDisabled></NImage>
+          <h2 class={styles.formTitle}>意见反馈</h2>
+          <div class={styles.formWrapInfo}>
+            <NForm
+              labelAlign="right"
+              labelPlacement="left"
+              labelWidth={'auto'}
+              ref={formsRef}
+              model={forms}
+              requireMarkPlacement="left">
+              {/* <NFormItem
             path="currentClass"
             label=""
             class={styles.phoneContainer}>
             <p class={styles.phone}>{forms.mobile}</p>
           </NFormItem> */}
 
-          <NFormItem
-            rule={[
-              {
-                required: true,
-                message: '请选择反馈类型'
-              }
-            ]}
-            path="suggestionTypeId">
-            <CSelect
-              value-field="id"
-              label-field="name"
-              style={{ width: '357px!important' }}
-              {...({
-                options: suggestionTypeList.value,
-                placeholder: '反馈类型(必选)',
-                clearable: true,
-                inline: true
-              } as any)}
-              v-model:value={forms.suggestionTypeId}></CSelect>
-          </NFormItem>
-          <NFormItem path='content'         rule={[
-              {
-                required: true,
-                message: '请输入反馈内容'
-              }
-            ]}>
-            <NInput
-              class={styles.countInput}
-              type="textarea"
-              rows={5}
-              placeholder={'请输入反馈内容'}
-              maxlength={500}
-              showCount
-              v-model:value={forms.content}></NInput>
-          </NFormItem>
-          <NFormItem>
-            <NUpload
-              list-type="image-card"
-              accept=".jpg,jpeg,.png"
-              v-model:fileList={fileListRef.value}
-              ref={uploadRef}
-              multiple={true}
-              max={5}
-              data={(file: any) => {
-                const item = state.find((c: any) => {
-                  return c.id == file.file.id;
-                });
-                const { id, tempFiileBuffer, ...more } = item;
-                return { ...more };
-              }}
-              showPreviewButton
-              action={ossUploadUrl}
-              onBeforeUpload={(options: any) => onBeforeUpload(options)}
-              onRemove={(options: any) => onRemove(options)}
-              onFinish={(options: any) => onFinish(options)}>
-              <div class={styles.addInput}>
-                <NImage previewDisabled src={chioseAdd}></NImage>
-                点击上传
-              </div>
-            </NUpload>
-          </NFormItem>
-          {
-            (phone.value || email.value)?  <NFormItem>
-            <div class={styles.messageWrap}>
-             {phone.value? <p>客服电话:{phone.value}</p>:null}
-             {email.value?  <p>邮箱:{email.value}</p>:null}
+              <NFormItem
+                rule={[
+                  {
+                    required: true,
+                    message: '请选择反馈类型'
+                  }
+                ]}
+                path="suggestionTypeId">
+                <CSelect
+                  class={styles.suggestSelect}
+                  value-field="id"
+                  label-field="name"
+                  style={{ width: '227px!important' }}
+                  {...({
+                    options: suggestionTypeList.value,
+                    placeholder: '反馈类型(必选)',
+                    clearable: true,
+                    inline: true
+                  } as any)}
+                  v-model:value={forms.suggestionTypeId}></CSelect>
+              </NFormItem>
+              <NFormItem
+                path="content"
+                rule={[
+                  {
+                    required: true,
+                    message: '请输入反馈内容'
+                  }
+                ]}>
+                <NInput
+                  class={styles.countInput}
+                  type="textarea"
+                  rows={5}
+                  placeholder={'请输入反馈内容'}
+                  maxlength={200}
+                  resizable={false}
+                  showCount
+                  v-model:value={forms.content}></NInput>
+              </NFormItem>
+              <NFormItem>
+                <NUpload
+                  list-type="image-card"
+                  accept=".jpg,jpeg,.png"
+                  v-model:fileList={fileListRef.value}
+                  ref={uploadRef}
+                  multiple={true}
+                  max={5}
+                  data={(file: any) => {
+                    const item = state.find((c: any) => {
+                      return c.id == file.file.id;
+                    });
+                    const { id, tempFiileBuffer, ...more } = item;
+                    return { ...more };
+                  }}
+                  showPreviewButton
+                  action={ossUploadUrl}
+                  onBeforeUpload={(options: any) => onBeforeUpload(options)}
+                  onRemove={(options: any) => onRemove(options)}
+                  onFinish={(options: any) => onFinish(options)}>
+                  <div class={styles.addInput}>
+                    <NImage previewDisabled src={chioseAdd}></NImage>
+                    <p> 点击上传图片</p>
+                    <p>(最多五张)</p>
+                  </div>
+                </NUpload>
+              </NFormItem>
+              {/* {phone.value || email.value ? (
+                <NFormItem>
+                  <div class={styles.messageWrap}>
+                    {phone.value ? <p>客服电话:{phone.value}</p> : null}
+                    {email.value ? <p>邮箱:{email.value}</p> : null}
+                  </div>
+                </NFormItem>
+              ) : null} */}
 
-            </div>
-           </NFormItem>:null
-          }
+              {/* <NSpace class={styles.updateBtnGroup}>
+                <NButton
+                  strong
+                  type="default"
+                  round
+                  onClick={() => emit('close')}>
+                  取消
+                </NButton>
+                <NButton strong type="primary" round onClick={() => onSubmit()}>
+                  确认
+                </NButton>
+              </NSpace> */}
+            </NForm>
+          </div>
+        </div>
+        <div class={[styles.inBack,isubmit.value?styles.isAni:'']}>
+
+        </div>
+        {/* <div class={styles.inBackBottom}></div>  boxBg */}
+        <NImage src={boxBg} class={styles.inBackBottom} previewDisabled></NImage>
+        <NImage src={inFront} class={styles.inFront} previewDisabled></NImage>
+        <NImage src={sealing} class={[styles.sealing,isubmit.value?styles.isAni:'']} previewDisabled></NImage>
+        {!isubmit.value?<>
+          <NImage src={submitBtn}  onClick={()=>{onSubmit()}} class={styles.submitBtn} previewDisabled></NImage>
+          <div class={styles.messageWrap}>
+          {phone.value ? <p>客服电话:{phone.value}</p> : null}
+          {email.value ? <p>邮箱:{email.value}</p> : null}
+        </div>
+        </>:null}
 
-          <NSpace class={styles.updateBtnGroup}>
-            <NButton strong type="default" round onClick={() => emit('close')}>
-              取消
-            </NButton>
-            <NButton strong type="primary" round onClick={() => onSubmit()}>
-              确认
-            </NButton>
-          </NSpace>
-        </NForm>
+      </div>
       </div>
     );
   }