Selaa lähdekoodia

更改图片样式

panxingxin 5 vuotta sitten
vanhempi
commit
7a5c72ce63

+ 6 - 1
pages/contract/detail.js

@@ -9,6 +9,7 @@ Page({
     pId: '',
     imageList: [],
     showAllPic: false,
+    showDeleteBtn: true,
     allImgList: []
   },
 
@@ -61,7 +62,11 @@ Page({
     })
     this.getQaLog(this.data.sscId, this.data.pId)
   },
-
+  showDeleteBtn() {
+    this.setData({
+      showDeleteBtn: !this.data.showDeleteBtn
+    })
+  },
   getTempMark(e) {
     this.setData({
       tempMark: e.detail.value

+ 4 - 1
pages/contract/detail.wxml

@@ -17,9 +17,11 @@
 		</view>
 	<view class="detail-item">
 		<label>图片:</label>
+	</view>
+	<view class="detail-item">
 		<view class="imageList">
 			<view class="image-item" wx:for="{{imageList}}" wx:key="index">
-				<icon type="cancel" size="10" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
+				<icon type="cancel" size="25" hidden="{{showDeleteBtn}}" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
 				<image src="{{item}}" mode="scaleToFill" bindtap="openPreview" data-current="{{item}}"></image>
 			</view>
 			<text bindtap="getAllImg" hidden="{{showAllPic||allImgList.length<=2}}">查看更多</text>
@@ -29,6 +31,7 @@
 		<view>
 			<mp-icon icon="camera" color="black" size="{{25}}" bindtap="takePhoto"></mp-icon>
 			<mp-icon icon="album" color="black" size="{{25}}" bindtap="choosePhoto"></mp-icon>
+			<mp-icon icon="close2" color="black" size="{{25}}" bindtap="showDeleteBtn"></mp-icon>
 		</view>
 	</view>
 </view>

+ 3 - 2
pages/contract/detail.wxss

@@ -27,7 +27,8 @@ page{
 .detail-item .imageList image {
   height: 4rem;
   width: 4rem;
-  margin-right: 5px;
+  margin-top: 5px;
+  margin-right: 2px;
 }
 .detail-item .imageList text {
   font-size: 14px;
@@ -42,6 +43,6 @@ page{
 }
 .detail-btns view{
   display: flex;
-  width: 8rem;
+  width: 16rem;
   justify-content: space-between;
 }

+ 6 - 1
pages/qc/detail.js

@@ -9,6 +9,7 @@ Page({
     pId: '',
     imageList: [],
     showAllPic: false,
+    showDeleteBtn: true,
     allImgList: []
   },
 
@@ -61,7 +62,11 @@ Page({
     })
     this.getQaLog(this.data.sscId, this.data.pId)
   },
-
+  showDeleteBtn() {
+    this.setData({
+      showDeleteBtn: !this.data.showDeleteBtn
+    })
+  },
   getTempMark(e) {
     this.setData({
       tempMark: e.detail.value

+ 5 - 2
pages/qc/detail.wxml

@@ -14,12 +14,14 @@
 	<view class="detail-item">
 		<label>Qa日志:</label>
 		<textarea value="{{mark}}" auto-height bindfocus="getTempMark" bindblur="saveQaLog" />
-		</view>
+	</view>
 	<view class="detail-item">
 		<label>图片:</label>
+	</view>
+	<view class="detail-item">
 		<view class="imageList">
 			<view class="image-item" wx:for="{{imageList}}" wx:key="index">
-				<icon type="cancel" size="10" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
+				<icon type="cancel" size="25" hidden="{{showDeleteBtn}}" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
 				<image src="{{item}}" mode="scaleToFill" bindtap="openPreview" data-current="{{item}}"></image>
 			</view>
 			<text bindtap="getAllImg" hidden="{{showAllPic||allImgList.length<=2}}">查看更多</text>
@@ -29,6 +31,7 @@
 		<view>
 			<mp-icon icon="camera" color="black" size="{{25}}" bindtap="takePhoto"></mp-icon>
 			<mp-icon icon="album" color="black" size="{{25}}" bindtap="choosePhoto"></mp-icon>
+		  <mp-icon icon="close2" color="black" size="{{25}}" bindtap="showDeleteBtn"></mp-icon>
 		</view>
 	</view>
 </view>

+ 3 - 2
pages/qc/detail.wxss

@@ -27,7 +27,8 @@ page{
 .detail-item .imageList image {
   height: 4rem;
   width: 4rem;
-  margin-right: 5px;
+  margin-top: 5px;
+  margin-right: 2px;
 }
 .detail-item .imageList text {
   font-size: 14px;
@@ -42,6 +43,6 @@ page{
 }
 .detail-btns view{
   display: flex;
-  width: 8rem;
+  width: 16rem;
   justify-content: space-between;
 }

+ 6 - 1
pages/sample/detail.js

@@ -8,6 +8,7 @@ Page({
     sdpId: '',
     imageList: [],
     showAllPic: false,
+    showDeleteBtn: true,
     allImgList: []
   },
 
@@ -57,7 +58,11 @@ Page({
     })
     this.getQaLog(this.data.sdpId)
   },
-
+  showDeleteBtn() {
+    this.setData({
+      showDeleteBtn: !this.data.showDeleteBtn
+    })
+  },
   getTempMark(e) {
     this.setData({
       tempMark: e.detail.value

+ 4 - 1
pages/sample/detail.wxml

@@ -17,9 +17,11 @@
 		</view>
 	<view class="detail-item">
 		<label>图片:</label>
+	</view>
+	<view class="detail-item">
 		<view class="imageList">
 			<view class="image-item" wx:for="{{imageList}}" wx:key="index">
-				<icon type="cancel" size="10" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
+				<icon type="cancel" size="25" hidden="{{showDeleteBtn}}" bindtap="delImg" data-index="{{index}}" data-url="{{item}}"/>
 				<image src="{{item}}" mode="scaleToFill" bindtap="openPreview" data-current="{{item}}"></image>
 			</view>
 			<text bindtap="getAllImg" hidden="{{showAllPic||allImgList.length<=2}}">查看更多</text>
@@ -29,6 +31,7 @@
 		<view>
 			<mp-icon icon="camera" color="black" size="{{25}}" bindtap="takePhoto"></mp-icon>
 			<mp-icon icon="album" color="black" size="{{25}}" bindtap="choosePhoto"></mp-icon>
+			<mp-icon icon="close2" color="black" size="{{25}}" bindtap="showDeleteBtn"></mp-icon>
 		</view>
 	</view>
 </view>

+ 3 - 2
pages/sample/detail.wxss

@@ -27,7 +27,8 @@ page{
 .detail-item .imageList image {
   height: 4rem;
   width: 4rem;
-  margin-right: 5px;
+  margin-top: 5px;
+  margin-right: 2px;
 }
 .detail-item .imageList text {
   font-size: 14px;
@@ -42,6 +43,6 @@ page{
 }
 .detail-btns view{
   display: flex;
-  width: 8rem;
+  width: 16rem;
   justify-content: space-between;
 }