Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/chenzimin2/ZGZQBWG

aamin 1 год назад
Родитель
Сommit
0072ee8796

+ 2 - 1
game/src/api.js

@@ -272,7 +272,7 @@ export async function getBonusPointRecord() {
     return res.data.data
   }
 }
-export async function redeem(description, name, phone, prizeId, score) {
+export async function redeem(description, name, phone, prizeId, score, prizeName) {
   const res = await axios({
     method: 'post',
     url: `${process.env.VUE_APP_DEPLOY_ORIGIN}/api/cms/game/prize/redeem`,
@@ -285,6 +285,7 @@ export async function redeem(description, name, phone, prizeId, score) {
       phone,
       prizeId,
       score: -1 * score,
+      prizeName,
     }
   })
   if (res.data.code !== 0) {

+ 3 - 0
game/src/main.js

@@ -2,6 +2,7 @@ import { createApp } from 'vue'
 import App from './App.vue'
 import router from './router'
 import store from './store'
+import { userAgentInfo } from '@/store/non-reactive.js'
 import "@/assets/style/reset.css"
 import "@/assets/style/my-reset.css"
 import UAParser from "@/libs/ua-parser.min.js"
@@ -39,6 +40,8 @@ if (uaInfo.browser && uaInfo.browser.name === 'Safari') {
 if (uaInfo.device.type === 'mobile') {
   app.provide('$isMobile', true)
 }
+// eslint-disable-next-line
+userAgentInfo = uaInfo
 
 // 处理resize事件
 let windowWidthLast = window.innerWidth

+ 1 - 0
game/src/store/non-reactive.js

@@ -0,0 +1 @@
+let userAgentInfo = null

+ 7 - 4
game/src/useFunctions/useSizeAdapt.js

@@ -2,6 +2,7 @@
 // width: calc(950 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
 
 import { onBeforeUnmount, ref } from 'vue'
+import { userAgentInfo } from '@/store/non-reactive.js'
 
 export default function useSizeAdapt(windowWidthWhenDesign = 1920, windowHeightWhenDesign = 1080) {
   const windowSizeInCssForRef = ref('')
@@ -18,10 +19,12 @@ export default function useSizeAdapt(windowWidthWhenDesign = 1920, windowHeightW
   }
 
   compute()
-  window.addEventListener('resize', compute)
-  onBeforeUnmount(() => {
-    window.removeEventListener('resize', compute)
-  })
+  if (userAgentInfo.device.type !== 'mobile' || userAgentInfo.os.name === 'iOS') {
+    window.addEventListener('resize', compute)
+    onBeforeUnmount(() => {
+      window.removeEventListener('resize', compute)
+    })
+  }
 
   return {
     windowSizeInCssForRef,

+ 30 - 4
game/src/views/ExamPaper2.vue

@@ -40,8 +40,16 @@
         }"
         @click="onClickOption(index)"
       >
+        <div class="code" />
         <div class="option-text">
-          {{ option }}
+          <div
+            class="option-text-inner"
+            :class="{
+              marquee: option.length > 12
+            }"
+          >
+            {{ option }}
+          </div>
         </div>
         <div
           v-show="isSubmitted && selectedIdx === index && questionList[currentQuestionIdx].rightOptionIdx === index"
@@ -361,7 +369,6 @@ if (store.state.ifScoreLimitReached) {
       padding-right: calc(17 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
       width: 100%;
       display: flex;
-      justify-content: space-between;
       align-items: center;
       font-size: calc(16 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
       font-family: Source Han Sans SC, Source Han Sans SC;
@@ -381,13 +388,31 @@ if (store.state.ifScoreLimitReached) {
         color: #FF6A6A;
         border: 1px solid #FF6A6A;
       }
-      > .option-text {
+      > .code{
+        flex: 0 0 auto;
+        margin-right: 0.5em;
         &::before {
           content: counter(count, upper-alpha);
-          margin-right: 0.5em;
+        }
+      }
+      > .option-text {
+        flex: 0 0 auto;
+        width: 80%;
+        overflow: hidden;
+        >.option-text-inner{
+          text-align: initial;
+          white-space: nowrap;
+        }
+        >.option-text-inner.marquee{
+          animation: marquee 8s linear infinite;
+          @keyframes marquee {
+            0% { transform: translateX(100%); }
+            100% { transform: translateX(-100%); }
+          }
         }
       }
       > .result-tip {
+        flex: 0 0 auto;
         > img.correct-icon {
           width: calc(42 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
           height: calc(42 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
@@ -469,4 +494,5 @@ if (store.state.ifScoreLimitReached) {
     padding-bottom: calc(6 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
   }
 }
+
 </style>

+ 2 - 1
game/src/views/PairUp.vue

@@ -193,7 +193,8 @@ function replay() {
       isOver.value = true
     }
   }, 1000)
-  recognizedCorpList.value = 0
+  recognizedCorpList.value = []
+  setCardList()
 }
 
 watch(isOver, (vNew) => {

+ 2 - 2
game/src/views/RedeemForm.vue

@@ -121,7 +121,7 @@ const ifShowNotify = ref(false)
 const haveSubmitted = ref(false)
 
 function submit() {
-  redeem(detail.value, name.value, contact.value, prizeInfo.id, prizeInfo.score).then((res) => {
+  redeem(detail.value, name.value, contact.value, prizeInfo.id, prizeInfo.score, prizeInfo.name).then((res) => {
     ifShowNotify.value = true
     haveSubmitted.value = true
     getScore().then((res) => {
@@ -260,7 +260,7 @@ function submit() {
     position: absolute;
     width: calc(348 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
     height: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
-    bottom: calc(59 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
+    top: calc(630 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
     left: 50%;
     transform: translate(-50%, 0);
     background-color: #FFE6A5;

+ 1 - 1
game/src/views/ShopView.vue

@@ -126,7 +126,7 @@
               {{ recordItem.type }}
             </div>
             <div class="time">
-              {{ recordItem.updateTime }} {{ recordItem.description }}
+              {{ recordItem.updateTime }} {{ recordItem.description || recordItem.prizeName }}
             </div>
           </div>
           <div