lex 11 月之前
父節點
當前提交
9e480a1d19
共有 2 個文件被更改,包括 39 次插入13 次删除
  1. 33 11
      src/views/activation-code/index.tsx
  2. 6 2
      src/views/activation-code/modal/code-dialog/index.tsx

+ 33 - 11
src/views/activation-code/index.tsx

@@ -50,7 +50,32 @@ export default defineComponent({
           }
         );
         if (res.code !== 200) {
-          if (res.code === 5442 || res.code === 5443) {
+          if (res.code === 980) {
+            // 980:激活码不存在
+            state.showPopup = true;
+            state.reslutPopupType = 'INVALID';
+            state.resultPopupContent = res.message;
+          } else if (res.code === 981) {
+            // 981:激活码被同一人重复使用
+            state.showPopup = true;
+            state.reslutPopupType = 'ACTIVATED-TWO';
+            state.resultPopupContent = res.message;
+          } else if (res.code === 982) {
+            // 982:激活码已激活
+            state.showPopup = true;
+            state.reslutPopupType = 'EXPIRED';
+            state.resultPopupContent = res.message;
+          } else if (res.code === 983) {
+            // 983:激活码已作废
+            state.showPopup = true;
+            state.reslutPopupType = 'OVERDUE';
+            state.resultPopupContent = res.message;
+          } else if (res.code === 984) {
+            // 984:激活码已过期
+            state.showPopup = true;
+            state.reslutPopupType = 'CANCELLED';
+            state.resultPopupContent = res.message;
+          } else  if (res.code === 5442 || res.code === 5443) {
             state.showPopup = true;
             state.reslutPopupType = 'EXPIRED';
             state.resultPopupContent = res.message;
@@ -138,22 +163,18 @@ export default defineComponent({
                 <h2>互通码使用须知:</h2>
                 <div class={styles.tips}>
                   <p>
-                    {/* <i class={[styles.num, styles.num1]}></i> */}
                     <img src={num1} class={styles.num} />
                     互通码只可使用一次,不能重复使用;
                   </p>
                   <p>
-                    {/* <i class={[styles.num, styles.num2]}></i> */}
                     <img src={num2} class={styles.num} />
                     为确保安全,请勿将互通码泄露,以免造成不必要的损失;
                   </p>
                   <p>
-                    {/* <i class={[styles.num, styles.num3]}></i> */}
                     <img src={num3} class={styles.num} />
                     互通码请尽快激活使用,避免互通码过期;
                   </p>
                   <p>
-                    {/* <i class={[styles.num, styles.num4]}></i> */}
                     <img src={num4} class={styles.num} />
                     互通码内容以实际购买页面内容为准。
                   </p>
@@ -187,12 +208,13 @@ export default defineComponent({
               </p>
             )}
 
-            {state.reslutPopupType === 'CANCELLED' && (
-              <p style={{ textAlign: 'center', paddingTop: '5px' }}>
-                {state.resultPopupContent}
-              </p>
-            )}
-            {state.reslutPopupType === 'EXPIRED' && (
+            {[
+              'INVALID',
+              'EXPIRED',
+              'CANCELLED',
+              'OVERDUE',
+              'ACTIVATED-TWO'
+            ].includes(state.reslutPopupType) && (
               <p style={{ textAlign: 'center', paddingTop: '5px' }}>
                 {state.resultPopupContent}
               </p>

+ 6 - 2
src/views/activation-code/modal/code-dialog/index.tsx

@@ -30,6 +30,7 @@ export default defineComponent({
       // INVALID 错误
       type: String as PropType<
         | 'ACTIVATED'
+        | 'ACTIVATED-TWO'
         | 'EXPIRED'
         | 'CANCELLED'
         | 'INFO'
@@ -46,10 +47,13 @@ export default defineComponent({
     const headerImgs = computed(() => {
       let title = getAssetsHomeFile('title1.png');
       let icon = getAssetsHomeFile('brid1.png');
-      if (props.type === 'ACTIVATED') {
+      if (props.type === 'ACTIVATED' || props.type === 'ACTIVATED-TWO') {
         title = getAssetsHomeFile('title4.png');
         icon = getAssetsHomeFile('brid1.png');
-      } else if (props.type === 'ACTIVATING' || props.type === 'ACTIVATING-TWO') {
+      } else if (
+        props.type === 'ACTIVATING' ||
+        props.type === 'ACTIVATING-TWO'
+      ) {
         title = getAssetsHomeFile('title2.png');
         icon = getAssetsHomeFile('brid1.png');
       } else if (props.type === 'EXPIRED') {