sunlupeng hace 1 año
padre
commit
3f6b8b65ba
Se han modificado 2 ficheros con 14 adiciones y 7 borrados
  1. 4 4
      public/monthlyDrawCarousel.html
  2. 10 3
      src/views/HomeView/RedeemView.vue

+ 4 - 4
public/monthlyDrawCarousel.html

@@ -227,10 +227,10 @@
   </div>
   
 </body>
-<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.3.4/vue.global.js"></script>
-<link href="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.12/index.css" rel="stylesheet">
-<script src="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.12/index.full.js"></script>
-<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.0/jquery.js"></script>
+<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.4.38/vue.global.js"></script>
+<link href="https://cdn.bootcdn.net/ajax/libs/element-plus/2.8.0/index.css" rel="stylesheet">
+<script src="https://cdn.bootcdn.net/ajax/libs/element-plus/2.8.0/index.full.min.js"></script>
+<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
 <script>
   const {
     createApp,

+ 10 - 3
src/views/HomeView/RedeemView.vue

@@ -142,7 +142,7 @@
                                 </el-select>
                             </td>
                             <td style="text-align: center" class="finlly-price">
-                                {{ total }} 积分
+                                {{ money?userInfo.surplusIntegral:total }} 积分
                                 <span style="color: red;" v-if="money">+{{ money }}元</span>
                             </td>
                         </tr>
@@ -282,7 +282,7 @@
                 <div class="listItem">
                     <div class="itemName">合计</div>
                     <div class="itemValue">
-                        {{ total }}
+                        {{ money?userInfo.surplusIntegral:total }}
                         <span style="color: red;" v-if="money">+{{ money }}元</span>
                     </div>
                 </div>
@@ -386,7 +386,7 @@
                 </div>
                 <div v-if="activeName == 'goodsNotice'" class="listItem">
                     <div class="itemName">合计</div>
-                    <div class="itemValue">{{ total }}<span style="color: red;" v-if="money">+{{ money }}元</span></div>
+                    <div class="itemValue">{{ money?userInfo.surplusIntegral:total }}<span style="color: red;" v-if="money">+{{ money }}元</span></div>
                 </div>
             </div>
             <span slot="footer" class="dialog-footer">
@@ -423,6 +423,7 @@
     </div>
 </template>
 <script>
+import { mapGetters } from 'vuex'
 import QRCode from 'qrcodejs2';
 import { getWxPayCode, queryWxPayStatus } from "@/api/pay";
 import { integralInfo, start, kill, couponList } from "@/api/allApi";
@@ -540,12 +541,18 @@ export default {
             formLabelWidth: "80px",
         };
     },
+    computed: {
+        // 将 getter 映射到当前组件的计算属性
+        ...mapGetters(['userInfo'])
+    },
     watch: {
         total(val) {
             let surplusIntegral = this.$store.getters.userInfo.surplusIntegral;
             let money = (val - surplusIntegral) / 10;
             if (money >= 0) {
                 this.money = money
+            }else{
+                this.money = 0
             }
             console.log(this.money);
         }