为什么modal放在block里面,背景就变成黑色了
发布于 5 年前 作者 zjin 18909 次浏览 来自 问答

<!-- 内容 -->

<view class=“fgx”></view>

<block wx:for="{{testData.data}}" wx:key="{{testData.data}}">

 <view id="{{item.id}}" style=‘display:flex;height:150px; margin-bottom:6px;’>

   <!-- 左边图片 -->

   <view style=‘width:120px;height:120px;margin:4px;’>

     <image wx:if="{{item.imgSrc ==’’}}" class=“index-logo” style=‘width:110px;height:120px;’ src="…/images/a9.png"></image>

     <image wx:else="{{item.imgSrc}}" class=“index-logo” style=‘width:110px;height:120px;’ src="{{item.imgSrc}}"></image>

   </view>

   <!-- 右边内容 -->

   <view style="">

     <!-- 标题 -->

     <label class=“item_title”>{{item.title}}</label>

     <!-- 中间部分 -->

     <view class=“item_content”>

       <label class=“item_tm”>{{item.tm}}</label>

       <label class=“item_ckg”>{{item.ckg}}</label>

     </view>

     <view class=“item_content”>

       <label class=“item_spgg”>{{item.spgg}}</label>

       <label class=“item_zbz”>{{item.zbz}}</label>

       <label class=“item_dbz”>{{item.dbz}}</label>

     </view>

     <view class=“item_content”>

       <label class=“item_dw”>{{item.dw}}</label>

       <label class=“item_cj”>{{item.cj}}</label>

     </view>

     <!-- 底部部分 -->

     <view class=“item_db” style=“height:20px;;”>

       <label class=“item_hw”>{{item.hw}}</label>

       <label class=“item_ph”>{{item.ph}}</label>

       <view>

         <label class=“item_jlgg”>{{item.jlgg}}</label>

         <label class=“item_sl”>{{item.sl}}</label>

       </view>

     </view>

   </view>

 </view>

 <!-- 架位号及修改 -->

 <view class=“container” class=“zn-uploadimg”>

   <button class=“rqh” plain=‘true’ type=“default” bindtap=“modalinput” style=‘margin-bottom:5px;border:none’>{{item.rqh}}</button>

 </view>

 <modal hidden="{{hiddenmodalput}}" title=“请输入批号”  bindcancel=“cancel” bindconfirm=“confirm”>

   <input type=‘text’ placeholder="{{item.rqh}}" auto-focus/>

 </modal>

 <view class=“fgx”></view>

 

</block>

2 回复

文档没有modal组件的~而是提供了api调用wx.showModal~现在用了 小心以后给取消了  <modal>标签

把modal扔到block外面之后就不会发生这种情况

回到顶部