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

feat(KIP-13387): 停车规则支持富文本输入

john 1 год назад
Родитель
Сommit
fc4a1f828b

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
src/common/css/quill.snow.css


+ 1 - 1
src/main.js

@@ -1,7 +1,7 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
 import VConsole from 'vconsole';
-
+import '@/common/css/quill.snow.css'; // 引入对富文本的支持
 
 // 或者使用配置参数来初始化,详情见文档
 // 开发环境和qa环境 打开debug

+ 5 - 1
src/pages/parkingFee/mixins/parkingFee.js

@@ -304,7 +304,11 @@ export default {
         const res = await parkingLots(this.$store.state.lbsId); // TODO: 临时写死
         console.log(res);
         let reg = /[;;]/g;
-        this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
+        if(res?.ruleDescription) {
+          this.description = res.ruleDescription;
+        } else {
+          this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
+        }
         this.supportUnlicensed = res.supportUnlicensed || false
         const carList = uni.getStorageSync('carList');
         if (carList) {

+ 3 - 9
src/pages/parkingFee/parkingFee.vue

@@ -159,18 +159,12 @@
           </div>
           <div class="parkingFee-top">
             
-            <div class="top_content">
+            <div class="top_content ql-snow">
               <div class="title_box">
                 <span class="btn">缴费说明</span>
               </div>
-              <!--            <div class="sub_title_box">-->
-              <!--              <span class="btn">基础计费规则:</span>-->
-              <!--            </div>-->
-
-              <div class="info" :class="!init_ch ? 'info_show' : ''">
-                <!-- <p></p> -->
-                <!-- <p>{{ description }}</p> -->
-                <div v-html="description"></div>
+              <div class="info" :class="[!init_ch ? 'info_show' : '', 'ql-editor']">
+                  <div v-html="description"></div>  
               </div>
             </div>
             <div class="top_down" @click="top_display" v-if="!init_ch && description && description.length > 60"><van-icon name="arrow-down" /></div>

+ 5 - 1
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -220,7 +220,11 @@ export default {
         const res = await parkingLots(this.$store.state.lbsId);
         // console.log(res);
         let reg = /[;;]/g;
-        this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
+        if(res?.ruleDescription) {
+          this.description = res.ruleDescription;
+        } else {
+          this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');  
+        }
         this.supportUnlicensed = res.supportUnlicensed || false
         const carList = uni.getStorageSync('carList');
         if (carList) {

+ 3 - 9
src/pages/parkingFeeV2/parkingFee.vue

@@ -152,18 +152,12 @@
           </div>
           <div class="parkingFee-top">
             
-            <div class="top_content">
+            <div class="top_content ql-snow">
               <div class="title_box">
                 <span class="btn">缴费说明</span>
               </div>
-              <!--            <div class="sub_title_box">-->
-              <!--              <span class="btn">基础计费规则:</span>-->
-              <!--            </div>-->
-
-              <div class="info" :class="!init_ch ? 'info_show' : ''">
-                <!-- <p></p> -->
-                <!-- <p>{{ description }}</p> -->
-                <div v-html="description"></div>
+              <div class="info" :class="[!init_ch ? 'info_show' : '', 'ql-editor']">
+                  <div v-html="description"></div>
               </div>
             </div>
             <div class="top_down" @click="top_display" v-if="!init_ch && description && description.length > 60"><van-icon name="arrow-down" /></div>

Некоторые файлы не были показаны из-за большого количества измененных файлов