Browse Source

样式更新

图片边框和间距更新,信息时间修复
RegMs If 4 years ago
parent
commit
59d0183956

+ 8 - 0
miniprogram/components/imagePicker/imagePicker.js

@@ -15,7 +15,15 @@ Component({
    * 组件的初始数据
    */
   data: {
+    imageMargin: 0
+  },
 
+  observers: {
+    'images, max, readonly': function (images, max, readonly) {
+      this.setData({
+        imageMargin: images.length + (images.length < max && !readonly) > 1 ? 5 : 0
+      })
+    }
   },
 
   /**

+ 6 - 4
miniprogram/components/imagePicker/imagePicker.wxml

@@ -1,12 +1,14 @@
 <!--components/imagePicker/imagePicker.wxml-->
-<view style="text-align: center;">
+<view class="image-list">
   <label wx:for="{{images}}" wx:for-item="item" wx:key="*this">
-    <image class="image" style="position: relative; width: {{imageWidth}}rpx; height: {{imageHeight}}rpx;"
+    <image class="image"
+      style="position: relative; margin: {{imageMargin}}rpx; width: {{imageWidth}}rpx; height: {{imageHeight}}rpx;"
       src="{{item}}" mode="aspectFill" data-url="{{item}}" catchtap="previewImage">
       <icon wx:if="{{!readonly}}" style="position: absolute; top: 0; left: 0;" type="cancel" size="20"
         data-url="{{item}}" catchtap="removeImage"></icon>
     </image>
   </label>
-  <image wx:if="{{images.length < max && !readonly}}" class="image" style="width: 150rpx; height: 150rpx;"
-    src="/images/add.png" mode="aspectFill" catchtap="addImage"></image>
+  <image wx:if="{{images.length < max && !readonly}}" class="image"
+    style="margin: {{imageMargin}}rpx; width: 150rpx; height: 150rpx;" src="/images/add.png" mode="aspectFill"
+    catchtap="addImage"></image>
 </view>

+ 7 - 4
miniprogram/components/imagePicker/imagePicker.wxss

@@ -1,7 +1,10 @@
 /* components/imagePicker/imagePicker.wxss */
-/* .image {
-  margin: 5rpx;
+.image-list {
+  text-align: center;
+}
+
+.image {
   border-style: solid;
   border-width: 1rpx;
-  border-color: #D0D0D0;
-} */
+  border-color: #DDDDDD;
+}

+ 2 - 2
miniprogram/components/itemCard/itemCard.wxml

@@ -17,8 +17,8 @@
   <imagePicker wx:if="{{item.poster != ''}}" images="{{[item.poster]}}" max="1" image-width="700" image-height="350"
     readonly />
   <imagePicker wx:if="{{item.poster == '' && item.photo.length != 0}}" images="{{item.photo}}" max="1"
-    image-width="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}"
-    image-height="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}" readonly />
+    image-width="{{item.photo.length == 1 ? 696 : item.photo.length <= 4 ? 330 : 220}}"
+    image-height="{{item.photo.length == 1 ? 696 : item.photo.length <= 4 ? 330 : 220}}" readonly />
   <view class="bottom-line">
     <view class="tags primary-text-color">
       <text style="font-size: 25rpx; margin: 0rpx 30rpx;" wx:for="{{item.tag}}" wx:for-item="tag"

+ 0 - 6
miniprogram/components/itemCard/itemCard.wxss

@@ -10,7 +10,6 @@
 
 .avatar-name {
   display: flex;
-  flex-direction: row;
 }
 
 .publisher-avatar {
@@ -27,7 +26,6 @@
 
 .profile {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   position: relative;
   top: -20rpx;
@@ -69,7 +67,6 @@
   margin-right: 30rpx;
   margin-bottom: 20rpx;
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: flex-end;
 }
@@ -83,7 +80,6 @@
 
 .bottom-line {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: center;
   margin: 10rpx 10rpx 30rpx 10rpx;
@@ -91,13 +87,11 @@
 
 .tags {
   display: flex;
-  flex-direction: row;
   align-items: center;
 }
 
 .to-detail {
   display: flex;
-  flex-direction: row;
   align-items: center;
 }
 

+ 0 - 1
miniprogram/components/itemPublisher/itemPublisher.wxss

@@ -15,7 +15,6 @@
 
 .profile{
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   padding-right: 30rpx;
 }

+ 0 - 3
miniprogram/components/itemmyNews/itemmyNews.wxss

@@ -18,7 +18,6 @@
 
 .top {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: flex-end;
   margin: 0rpx 30rpx 0rpx 30rpx;
@@ -26,7 +25,6 @@
 
 .bottom {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: center;
   margin: 20rpx 30rpx 0rpx 30rpx;
@@ -35,7 +33,6 @@
 
 /* .profile {
   display: flex;
-  flex-direction: row;
   align-items: center;
 } */
 

+ 0 - 3
miniprogram/pages/aboutUs/aboutUs.wxss

@@ -56,7 +56,6 @@
 
 .block {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
   align-items: center;
@@ -64,14 +63,12 @@
 
 .block2 {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
 }
 
 .block22 {
   display: flex;
-  flex-direction: row;
 }
 
 .input {

+ 2 - 1
miniprogram/pages/activity/activity.js

@@ -148,6 +148,7 @@ Page({
     const _ = db.command
     db.collection("mainData").doc(options.id).get({
       success: function (res) {
+        res.data.time = util.handleDate(res.data.time)
         this.setData({
           activityInfo: res.data
         })
@@ -160,7 +161,7 @@ Page({
     }).get({
       success: function (res) {
         for (let i = 0; i < res.data.length; i++) {
-          if (res.data[i].answerTime != "") {
+          if (res.data[i].answerTime !== "") {
             res.data[i].time = util.handleDate(res.data[i].answerTime)
           } else {
             res.data[i].time = ""

+ 43 - 43
miniprogram/pages/activity/activity.wxml

@@ -1,54 +1,54 @@
 <!--为首页-信息详情页面-->
-<view class="card">
-  <image wx:if="{{activityInfo.poster != ''}}" class="activity-poster" src="{{activityInfo.poster}}"
-    mode="aspectFill" />
-  <view class="activity-info">
-    <view class="profile">
-      <view class="avatar-name" catchtap="getPublisherInfo">
-        <image class="publisher-avatar" src="{{activityInfo.publisherAvatar}}"></image>
-        <view class="publisher-name">{{activityInfo.publisherName}}</view>
+<view class="page">
+  <view class="card">
+    <image wx:if="{{activityInfo.poster != ''}}" class="activity-poster" src="{{activityInfo.poster}}"
+      mode="aspectFill" />
+    <view class="activity-info">
+      <view class="profile">
+        <view class="avatar-name" catchtap="getPublisherInfo">
+          <image class="publisher-avatar" src="{{activityInfo.publisherAvatar}}"></image>
+          <view class="publisher-name">{{activityInfo.publisherName}}</view>
+        </view>
+        <view class="activity-attribute primary-background-color white-text-color" catchtap="filterMsgType">
+          {{activityInfo.attribute[0]}}
+        </view>
       </view>
-      <view class="activity-attribute primary-background-color white-text-color" catchtap="filterMsgType">
-        {{activityInfo.attribute[0]}}
+      <view class="title-time">
+        <view class="title">{{activityInfo.title}}</view>
+        <view class="time primary-text-color">{{activityInfo.time}}</view>
       </view>
+      <view wx:if="{{activityInfo.activityTime != ''}}" class="line light-primary-color"></view>
+      <view wx:if="{{activityInfo.activityTime != ''}}" class="activity-time">{{activityInfo.activityTime}}</view>
+      <view wx:if="{{activityInfo.place != ''}}" class="line light-primary-color"></view>
+      <view wx:if="{{activityInfo.place != ''}}" class="activity-place">{{activityInfo.place}}</view>
+      <view wx:if="{{activityInfo.details != ''}}" class="line light-primary-color"></view>
+      <view wx:if="{{activityInfo.details != ''}}" class="activity-detail">
+        <rich-text class="sub-title">{{activityInfo.details}}</rich-text>
+      </view>
+      <imagePicker wx:if="{{activityInfo.photo.length != 0}}" images="{{activityInfo.photo}}" max="1"
+        image-width="{{activityInfo.photo.length == 1 ? 696 : activityInfo.photo.length <= 4 ? 330 : 220}}"
+        image-height="{{activityInfo.photo.length == 1 ? 696 : activityInfo.photo.length <= 4 ? 330 : 220}}" readonly />
+      <view class="line light-primary-color"></view>
     </view>
-    <view class="title-time">
-      <view class="title">{{activityInfo.title}}</view>
-      <view class="time primary-text-color">{{activityInfo.time}}</view>
-    </view>
-    <view wx:if="{{activityInfo.activityTime != ''}}" class="line light-primary-color"></view>
-    <view wx:if="{{activityInfo.activityTime != ''}}" class="activity-time">{{activityInfo.activityTime}}</view>
-    <view wx:if="{{activityInfo.place != ''}}" class="line light-primary-color"></view>
-    <view wx:if="{{activityInfo.place != ''}}" class="activity-place">{{activityInfo.place}}</view>
-    <view wx:if="{{activityInfo.details != ''}}" class="line light-primary-color"></view>
-    <view wx:if="{{activityInfo.details != ''}}" class="activity-detail">
-      <rich-text class="sub-title">{{activityInfo.details}}</rich-text>
-    </view>
-    <imagePicker wx:if="{{activityInfo.photo.length != 0}}" images="{{activityInfo.photo}}" max="1"
-      image-width="{{activityInfo.photo.length == 1 ? 700 : activityInfo.photo.length <= 4 ? 330 : 220}}"
-      image-height="{{activityInfo.photo.length == 1 ? 700 : activityInfo.photo.length <= 4 ? 330 : 220}}" readonly />
-    <view class="line light-primary-color"></view>
   </view>
 
-</view>
-
+  <image wx:if="{{like != -1}}" class="like" src="/images/like/{{like ? 'heart' : 'hollowheart'}}.png"
+    catchtap="toggleLike" />
 
-<image wx:if="{{like != -1}}" class="like" src="/images/like/{{like ? 'heart' : 'hollowheart'}}.png"
-  catchtap="toggleLike" />
-
-<view class="message-block">
-  <view class="dark-primary-color-font">{{activityComment.length == 0 ? "暂无问答" : "答疑区:"}}</view>
-  <view class="card" wx:for="{{activityComment}}" wx:for-item="item" wx:key="_id">
-    <itemActivityComment comment="{{item}}" time="{{item.time}}" />
+  <view class="message-block">
+    <view class="dark-primary-color-font">{{activityComment.length == 0 ? "暂无问答" : "答疑区:"}}</view>
+    <view class="card" wx:for="{{activityComment}}" wx:for-item="item" wx:key="_id">
+      <itemActivityComment comment="{{item}}" time="{{item.time}}" />
+    </view>
   </view>
-</view>
 
-<view class="comment block-background-color">
-  <view class="comment-inside" style="display: flex; align-items: center;">
-    <icon type="info" size="20" color="#B0B0B0"></icon>
-    <input class="comment-input primary-text-color" style="width: 550rpx;" model:value="{{commentText}}"
-      placeholder="提问" confirm-type="send" bindconfirm="comment"></input>
+  <view class="comment block-background-color">
+    <view class="comment-inside" style="display: flex; align-items: center;">
+      <icon type="info" size="20" color="#B0B0B0"></icon>
+      <input class="comment-input primary-text-color" style="width: 550rpx;" model:value="{{commentText}}"
+        placeholder="提问" confirm-type="send" bindconfirm="comment"></input>
+    </view>
+    <view class="comment-button {{commentText.length < 5 ? 'secondary-text-color' : 'dark-primary-color-font'}}"
+      bindtap="comment">发送</view>
   </view>
-  <view class="comment-button {{commentText.length < 5 ? 'secondary-text-color' : 'dark-primary-color-font'}}"
-    bindtap="comment">发送</view>
 </view>

+ 7 - 9
miniprogram/pages/activity/activity.wxss

@@ -22,14 +22,12 @@
 
 .brief-info{
   display: flex;
-  flex-direction: row;
   align-items: center;
   justify-content: space-between;
 }
 
 .brief-info-left{
   display: flex;
-  flex-direction: row;
   align-items: center;
 }
 
@@ -118,11 +116,17 @@
   text-align: center;
 }
 
-
+.page {
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-start;
+  width: 100%;
+}
 
 .card {
   display: flex;
   flex-direction: column;
+  align-self: center;
   width: 700rpx;
   margin: 50rpx 20rpx;
   padding-bottom: 20rpx;
@@ -133,7 +137,6 @@
 
 .avatar-name {
   display: flex;
-  flex-direction: row;
 }
 
 .publisher-avatar {
@@ -150,7 +153,6 @@
 
 .profile {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   position: relative;
   top: -20rpx;
@@ -192,7 +194,6 @@
   margin-right: 30rpx;
   margin-bottom: 20rpx;
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: flex-end;
 }
@@ -206,7 +207,6 @@
 
 .bottom-line {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: center;
   margin: 10rpx 10rpx 30rpx 10rpx;
@@ -214,13 +214,11 @@
 
 .tags {
   display: flex;
-  flex-direction: row;
   align-items: center;
 }
 
 .to-detail {
   display: flex;
-  flex-direction: row;
   align-items: center;
 }
 

+ 0 - 3
miniprogram/pages/activityPublish/activityPublish.wxss

@@ -57,7 +57,6 @@
 
 .block {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
   align-items: center;
@@ -65,14 +64,12 @@
 
 .block2 {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
 }
 
 .block22 {
   display: flex;
-  flex-direction: row;
 }
 
 .input {

+ 0 - 3
miniprogram/pages/opinion/opinion.wxss

@@ -58,7 +58,6 @@
 
 .block {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
   align-items: center;
@@ -66,14 +65,12 @@
 
 .block2 {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
 }
 
 .block22 {
   display: flex;
-  flex-direction: row;
 }
 
 .input {

+ 0 - 3
miniprogram/pages/publisher/publisher.wxss

@@ -8,7 +8,6 @@
 
 .brief-info {
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
   align-items: center;
   z-index: 1;
@@ -17,7 +16,6 @@
 
 .brief-info-left {
   display: flex;
-  flex-direction: row;
   align-items: center;
   margin: 0rpx 0rpx 0rpx 40rpx;
 }
@@ -59,7 +57,6 @@
 
 .check {
   display: flex;
-  flex-direction: row;
   align-items: center;
   position: absolute;
   right: 50rpx;

+ 0 - 3
miniprogram/pages/publisherLogin/publisherLogin.wxss

@@ -57,7 +57,6 @@
 
 .block {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
   align-items: center;
@@ -65,14 +64,12 @@
 
 .block2 {
   display: flex;
-  flex-direction: row;
   margin: 20rpx 40rpx;
   font-size: 35rpx;
 }
 
 .block22 {
   display: flex;
-  flex-direction: row;
 }
 
 .input {

+ 0 - 1
miniprogram/pages/search/search.wxss

@@ -75,7 +75,6 @@
   margin: 10rpx 40rpx;
   font-size: 24rpx;
   display: flex;
-  flex-direction: row;
   justify-content: space-between;
 }
 

+ 0 - 1
miniprogram/pages/user/user.wxss

@@ -31,7 +31,6 @@
 
 .btn {
   display: flex;
-  flex-direction: row;
   margin-top: 20rpx;
   align-items: center;
 }