zhaoxiaohai vor 3 Jahren
Ursprung
Commit
2ed9be2b64

+ 0 - 48
components/My_richText/content.js

@@ -1,48 +0,0 @@
-module.exports = `<title>富文本示例</title>
-<div>
-  <section style="text-align: center; margin: 0px auto;">
-    <section style="border-radius: 4px; border: 1px solid #757576; display: inline-block; padding: 5px 20px;">
-      <span style="font-size: 18px; color: #595959;">表格</span>
-    </section>
-  </section>
-  <section style="margin-top: 1.5em;">
-    <table width="100%" border="1" cellspacing="0" cellpadding="5" style="border-collapse: collapse;">
-      <thead>
-        <tr>
-          <th>标题 1</th>
-          <th>标题 2</th>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td align="center"></td>
-          <td align="center">内容 2</td>
-        </tr>
-        <tr>
-          <td align="center">内容 3</td>
-          <td align="center">内容 4</td>    
-        </tr>
-        <tr>
-          <td align="center">内容 5</td>
-          <td align="center">内容 6</td>
-        </tr>
-      </tbody>
-    </table>
-  </section>
-  <section style="text-align: center; margin: 0px auto; margin-top: 2em">
-    <section style="border-radius: 4px; border: 1px solid #757576; display: inline-block; padding: 5px 20px;">
-      <span style="font-size: 18px; color: #595959;">文本</span>
-    </section>
-  </section>
-  <section style="margin-top: 1.5em;">
-    &ldquo;富文本编辑器&rdquo;不同于文本编辑器,程序员可到网上下载免费的富文本编辑器内嵌于自己的网站或程序里(当然付费的功能会更强大些),方便用户编辑文章或信息。这是一条<a href="https://github.com/jin-yufeng/mp-html">链接</a>
-  </section>
-  <section style="text-align: center; margin: 0px auto; margin-top: 2em">
-    <section style="border-radius: 4px; border: 1px solid #757576; display: inline-block; padding: 5px 20px;">
-      <span style="font-size: 18px; color: #595959;">图片</span>
-    </section>
-  </section>
-  <section style="margin-top: 1.5em; text-align: center;">
-    <img src="/demo-thumb.jpg?sign=91b3e495d16f96a0df3d263c9ff95821&t=1609059235" original-src="/demo.jpg?sign=af7082bed28711177bd952dbab67373e&t=1609059255">
-  </section>
-</div>`

+ 20 - 17
components/My_richText/index.scss

@@ -1,18 +1,3 @@
-.editor_toolbox {
-    position: absolute;
-    top: 0;
-    width: 100%;
-    height: 80rpx;
-    z-index: 999;
-    background-color: #EDEDED;
-    display: flex;
-    justify-content:space-around;
-    align-items: center;
-    padding: 5px;
-    box-sizing: border-box;
-    line-height: 1.6;
-}
-
 /* 模态框 */
 .modal {
     position: fixed;
@@ -66,8 +51,26 @@
 .back {
     width: 150rpx;
 }
+/* 富文本功能编辑 */
+.editor_toolbox {
+    position: absolute;
+    top: 0;
+    width: 100%;
+    height: 90rpx;
+    z-index: 999;
+    background-color: #EDEDED;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    padding: 5px;
+    box-sizing: border-box;
+    line-height: 1.6;
+}
 
 .image {
-    width: 30rpx;
-    height: 30rpx;
+    height: 35rpx !important;
+}
+
+.up {
+    margin-top: 8rpx;
 }

+ 8 - 8
components/My_richText/index.wxml

@@ -1,18 +1,18 @@
 <van-popup show="{{ show }}" position="bottom" round custom-style="height: 100%;" bind:close="onClose">
     <view class="editor_toolbox">
         <block wx:if="{{editable}}">
-            <image class="image" mode="aspectFill" src="../../static/image/richfile/icon-save.png" bindtap="save" />
-            <image class="image" mode="aspectFill" src="../../static/image/richfile/icon-undo.png" data-method="undo" bindtap="edit" />
-            <image class="image" mode="aspectFill" src="../../static/image/richfile/icon-redo.png" data-method="redo" bindtap="edit" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/icon-save.png" bindtap="save" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/icon-undo.png" data-method="undo" bindtap="edit" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/icon-redo.png" data-method="redo" bindtap="edit" />
             <My_upload accept='image' binduploadCallback="insertImgEdit">
-                <image class="image" mode="widthFix"  src="../../static/image/richfile/icon-img.png" />
+                <image class="image up" mode="heightFix" src="../../static/image/richfile/icon-img.png" />
             </My_upload>
             <My_upload accept='video' binduploadCallback="insertVideoEdit">
-                <image class="image" mode="widthFix" src="../../static/image/richfile/icon-video.png" />
+                <image class="image up" mode="heightFix" src="../../static/image/richfile/icon-video.png" />
             </My_upload>
-            <image class="image" mode="aspectFill" src="../../static/image/richfile/icon-text.png" data-method="insertText" bindtap="edit" />
-            <image class="image" mode="aspectFill" src="../../static/image/richfile/icon-clear.png" bindtap="clear" />
-            <van-icon name="close" size='36rpx' bindtap="closeShow" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/icon-text.png" data-method="insertText" bindtap="edit" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/icon-clear.png" bindtap="clear" />
+            <image class="image" mode="heightFix" src="../../static/image/richfile/close.png" bindtap="closeShow" />
         </block>
         <view class="back" wx:else bindtap="closeShow">
             <van-icon name="arrow-left" /> 返回

BIN
static/image/richfile/close.png


BIN
static/image/richfile/icon-clear.png


BIN
static/image/richfile/icon-img.png


BIN
static/image/richfile/icon-redo.png


BIN
static/image/richfile/icon-save.png


BIN
static/image/richfile/icon-text.png


BIN
static/image/richfile/icon-undo.png


BIN
static/image/richfile/icon-video.png