Procházet zdrojové kódy

fix(SCRM-5575): 电子券内的提示框宽度调整

john před 1 rokem
rodič
revize
a5f2ace81a

+ 4 - 1
src/main.js

@@ -7,7 +7,7 @@ import '@/common/css/quill.snow.css'; // 引入对富文本的支持
 // 开发环境和qa环境 打开debug
 // const debug = /dev-t?-?|qa-t?-?|sl-t?-?|2486/.test(window.location.origin);
 let debug = false;
-const keys = ['https://dev-','https://qa-','https://lt-','https://sl-','http://127.0.0.1'];
+const keys = ['https://dev-','https://qa-','https://lt-','https://sl-','http://127.0.0.1', 'http://localhost:8080'];
 keys.forEach(key => {
   if(!debug && window.location.origin.indexOf(key) > -1) {
     debug = true
@@ -17,6 +17,9 @@ if (debug) {
   window.vConsole = new VConsole(
     // { theme: 'dark' }
   );
+  setTimeout(() => {
+    window.vConsole?.setSwitchPosition(20, 200);
+  }, 200)
 }
 import './plugins/install';
 import App from './App.vue';

+ 5 - 0
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -282,6 +282,7 @@ export default {
         return Toast({
           className: 'top300',
           message: `当前电子券暂未生效,不可用`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -291,6 +292,7 @@ export default {
         return Toast({
           className: 'top300',
           message: `电子券每天最多可使用${ this.maxOneDayCoupons }张`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -338,6 +340,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -347,6 +350,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -356,6 +360,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
+          className: "white-space",
           icon: 'none',
         });
       }

+ 5 - 0
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -283,6 +283,7 @@ export default {
         return Toast({
           className: 'top300',
           message: `当前电子券暂未生效,不可用`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -292,6 +293,7 @@ export default {
         return Toast({
           className: 'top300',
           message: `电子券每天最多可使用${ this.maxOneDayCoupons }张`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -339,6 +341,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -348,6 +351,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,
+          className: "white-space",
           icon: 'none',
         });
       }
@@ -357,6 +361,7 @@ export default {
         if ( showMsg ) return true
         return Toast({
           message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
+          className: "white-space",
           icon: 'none',
         });
       }

+ 8 - 1
src/styles/common.less

@@ -114,6 +114,13 @@ button {
   padding: 25px 42px;
   min-height: inherit;
   background-color: @toast-background-color;
+  width: auto;
+  &.white-space  {
+    .van-toast__text{
+      white-space: nowrap;
+    }  
+  }
+  // max-width: 90%;
   .van-toast__text {
     font-family: 'PingFang SC';
     font-style: normal;
@@ -121,7 +128,7 @@ button {
     font-size: 28px;
     margin-top: 0;
     color: #FFFFFF;
-  }
+      }
   top: 300PX;
   &.width65{
     width: 65%;

+ 2 - 2
src/utils/uniHooks.js

@@ -48,8 +48,8 @@ function hideLoading() {
   ToastObj.clear();
 }
 
-function showToast({ title, duration, icon }) {
-  const params = {};
+function showToast({ title, duration, icon, ...obj }) {
+  const params = {...obj};
   if (title) {
     params.message = title;
   }