Browse Source

更改置顶图片

Limengbo 6 years ago
parent
commit
b69b2bfa1a

+ 5 - 4
compontents/chat/chat.js

@@ -165,19 +165,20 @@ Component({
     setMessage: function ({currentTarget}) {
       const id = currentTarget.dataset.id;
       const type = currentTarget.dataset.type;
-      const ind = currentTarget.dataset.ind;
+      const ind = currentTarget.dataset.ind; 
+      const top = currentTarget.dataset.top == 1 ? '0' : '1';
       if(type == 'isTop') {
         //置顶
         wx.showModal({
           title: '提示',
-          content: '确定置顶吗',
+          content: '确定这样操作吗',
           success: (res) => {
             if (res.confirm) {
               APIClient.setMessage({
                 id,
-                isTop: 1,
+                isTop: top,
               }).success(res => {
-                this.data.productionData.list[ind].isTop = 1;
+                this.data.productionData.list[ind].isTop = top;
                 this.setData({
                   productionData: this.data.productionData
                 })

+ 3 - 9
compontents/chat/chat.wxml

@@ -15,20 +15,14 @@
                     </view>   
                     <view class="lesson-name">
                         <text style="width: 40%; overflow: hidden; diaplay: inline-block; height: 50rpx; text-overflow: ellipsis;  white-space:nowrap;">{{item.featureMap.wechatName}}</text>
-                        <text class="content-data" style="height: 100%">{{item.title}}</text>
-                        <text>{{timeList[index]}}</text>
+                        <text class="content-data" style="display: block;">{{item.title}}</text>
+                        <text style="height: 30rpx; display: block;">{{timeList[index]}}</text>
                     </view>
                     <view wx:if="{{type == 1 && (item.currentReplyCount > 0)}}" class="message"></view>
-                    <view wx:if="{{item.isTop > 0}}" class="Stick">
-                        <image style="width: 56rpx; height: 56rpx;" src="../../pages/image/zhiding1.png"></image>
-                    </view>
-                    <view wx:else class="Stick">
-                        <image style="width: 56rpx; height: 56rpx;" src="../../pages/image/zhiding2.png"></image>
-                    </view>
                 </view>
                 <view class="operation" wx:if="{{teacher == 1}}">
                     <image src="../../pages/image/del.png" catchtap="setMessage" data-id="{{item.id}}" data-type="status" data-ind="{{index}}"></image>
-                    <image src="../../pages/image/top.png" catchtap="setMessage" data-id="{{item.id}}" data-type="isTop" data-ind="{{index}}"></image>
+                    <image src="../../pages/image/{{item.isTop > 0 ? 'top1' : 'top2'}}.png" catchtap="setMessage" data-top="{{item.isTop}}" data-id="{{item.id}}" data-type="isTop" data-ind="{{index}}"></image>
                 </view>
                 <view class="picture" wx:if="{{type == 2}}">
                     <block wx:for="{{item.imagesList}}" wx:for-item="items" wx:key="{{items}}">

+ 4 - 5
compontents/chat/chat.wxss

@@ -88,7 +88,6 @@
 
 .lesson-name text:nth-child(2),
 .lesson-name text:nth-child(3) {
-    height: 30rpx;
     margin-top: 10rpx;
     font-size: 28rpx;
     color: #C3C3C3;
@@ -122,8 +121,8 @@
     position: absolute;
     right: 30rpx;
     top: 50rpx;
-    height: 38rpx;
-    width: 42rpx;
+    height: 56rpx;
+    width: 56rpx;
 }
 
 .message {
@@ -268,7 +267,7 @@
 }
 
 .operation image {
-    height:38rpx;
-    width:42rpx;
+    height: 56rpx;
+    width: 56rpx;
     margin: 0 20rpx;    
 }

BIN
pages/image/del.png


BIN
pages/image/share_up.png


BIN
pages/image/top.png


BIN
pages/image/top1.png


BIN
pages/image/top2.png


+ 1 - 1
pages/mistakes/mistakes.wxml

@@ -28,7 +28,7 @@
             </view>
             <view class="course-content">
                 <view class="error answer-content" wx:for="{{mistakesData}}" wx:key="index" >
-                    <image class="questions" src="{{item.questions.img}}"></image>
+                    <image class="questions" mode="widthFix" src="{{item.questions.img}}"></image>
                     <view class="answer" >
                         <image class="analysis-box" src="{{item.wrongQuestionsAnalysis.analysis}}" mode="widthFix" style="width: 660rpx; " hidden="{{!course[courseIndex].flag[index]}}"></image>
                         <view class="answer-txt">