zhaoxiaohai 3 yıl önce
ebeveyn
işleme
80a7c64b31

+ 2 - 18
pages/threadedTree/index.js

@@ -31,26 +31,17 @@ Page({
     },
     /* 结束新建 */
     endInsert() {
-        this.sheetClose();
         this.setData({
-            initInsert: false
+            initInsert: false,
+            sheetTitle: ""
         })
         setTimeout(() => {
             this.setData({
                 initInsert: true
             })
         }, 10);
-        wx.showToast({
-            title: '保存成功!'
-        });
         this.getList(true);
     },
-    /* 关闭弹窗 */
-    sheetClose() {
-        this.setData({
-            sheetTitle: ""
-        })
-    },
     /* 查询列表 */
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
@@ -135,12 +126,5 @@ Page({
                 scrollHeight: res
             })
         })
-        const that = this;
-        wx.getSystemInfo({
-            success: (res => that.setData({
-                scrollHeight: res.windowHeight
-            }))
-        });
-
     },
 })

+ 2 - 1
pages/threadedTree/index.json

@@ -4,6 +4,7 @@
         "Search": "./modules/search/search",
         "List": "./modules/list/list",
         "FloatingButton": "./modules/FloatingButton/index",
-        "Insert": "./modules/insert/insert"
+        "Insert": "./modules/insert/insert",
+        "Popup": "./modules/popup/index"
     }
 }

+ 0 - 14
pages/threadedTree/index.scss

@@ -11,17 +11,3 @@ page {
     color: #999999;
 }
 
-/* 弹窗 */
-.popup {
-    .header {
-        width: 100%;
-        height: 90rpx;
-        line-height: 90rpx;
-        text-align: center;
-        border-bottom: 1px solid #EEEEEE;
-        font-size: 28rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #333333;
-    }
-
-}

+ 3 - 6
pages/threadedTree/index.wxml

@@ -21,9 +21,6 @@
 </My_listBox>
 
 <!-- 抽屉 -->
-<van-popup class="popup" show="{{ sheetTitle }}" custom-style="height: 100vh;" position="bottom" round closeable bind:close='sheetClose'>
-    <view class="header">{{sheetTitle}}</view>
-    <scroll-view scroll-y style="height:{{scrollHeight}}rpx;">
-        <Insert wx:if="{{initInsert}}" bind:endInsert='endInsert' />
-    </scroll-view>
-</van-popup>
+<Popup sheetTitle='{{sheetTitle}}'>
+    <Insert wx:if="{{initInsert}}" type="{{sheetTitle}}" bind:endInsert='endInsert' />
+</Popup>