zhaoxiaohai 3 rokov pred
rodič
commit
febb5e5dea

+ 5 - 0
pages/promotional/index.scss

@@ -1,5 +1,10 @@
 @import '/static/unread.wxss';
 @import '/static/dropdown-switch.wxss';
+page{
+    height: 100vh !important;
+    padding: 0 !important;
+    overflow: hidden;
+}
 
 /* 搜索和上传按钮 */
 .search-and-upload {

+ 1 - 0
pages/promotional/index.wxml

@@ -28,4 +28,5 @@
 <!-- 列表 -->
 <My_listBox id='ListBox' bindgetlist="getList" height='{{scrollHeight}}'>
     <ProductList total="{{total}}" list="{{list}}" />
+    <view style="height: 50px;" />
 </My_listBox>

+ 18 - 2
pages/promotional/upload.js

@@ -14,7 +14,9 @@ Page({
             "content": "",
             "sat_sharematerialid": 0
         },
-        detailsData: {}
+        detailsData: {},
+        editRichText: false, //编辑富文本
+        richTextFile: [],
     },
 
     /**
@@ -48,7 +50,21 @@ Page({
             "content.notes": detail.value.trim()
         })
     },
-
+    /* 打开编辑富文本 */
+    openEditRichText() {
+        this.setData({
+            editRichText: !this.data.editRichText
+        })
+    },
+    /* 得到编辑好的富文本内容 */
+    getRichText({
+        detail
+    }) {
+        console.log("富文本", detail)
+        this.setData({
+            "content.content": detail
+        })
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 2 - 1
pages/promotional/upload.json

@@ -1,6 +1,7 @@
 {
     "navigationBarTitleText": "发布素材",
     "usingComponents": {
-        "My_upload": "/components/My_upload/index"
+        "My_upload": "/components/My_upload/index",
+        "My_richText": "/components/My_richText/index"
     }
 }

+ 6 - 3
pages/promotional/upload.wxml

@@ -7,9 +7,13 @@
 
     <view class="label">素材内容</view>
     <view class="input base" style="display: flex; justify-content: space-between; color: #999;">
-        请输入内容 <text style="color: #3874F6;">编辑/预览</text>
+        请输入内容 <text style="color: #3874F6;" catchtap="openEditRichText">编辑/预览</text>
     </view>
-    
+
+    <!-- 富文本 -->
+    <My_richText show="{{editRichText}}" bindcallback='getRichText' />
+
+
     <view class="label">素材分类</view>
     <navigator class="category base" url="#">
         <view>请选择素材分类</view>
@@ -23,7 +27,6 @@
             <view class="file-box"></view>
         </My_upload>
     </view>
-
 </My_card>
 
 <view style="width: 100%; text-align: center;">