Bladeren bron

FIX

修改部分样式
RegMs If 4 jaren geleden
bovenliggende
commit
98098d2609

+ 3 - 3
miniprogram/components/itemActivityComment/itemActivityComment.wxml

@@ -1,3 +1,3 @@
-<view class="text primary-text-color">{{comment.a_time}}</view>
-<view class="text">Q: {{comment.question}}</view>
-<view class="text">A: {{comment.answer}}</view>
+<view class="qa-text primary-text-color">{{comment.a_time}}</view>
+<view class="qa-text">Q: {{comment.question}}</view>
+<view class="qa-text">A: {{comment.answer}}</view>

+ 2 - 2
miniprogram/components/itemActivityComment/itemActivityComment.wxss

@@ -1,4 +1,4 @@
-.text {
-  margin-top: 10rpx;
+.qa-text {
+  margin: 10rpx 0rpx;
   font-size: 25rpx;
 }

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

@@ -22,7 +22,7 @@ Page({
       url: '/pages/publisher/publisher',
     }).then(res => {
       res.eventChannel.emit('loadCommonData', {
-        data: this.data.item.publisher
+        data: this.data.activityInfo.publisher
       })
     })
   },

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

@@ -1,62 +1,62 @@
 <!--为首页-信息详情页面-->
 <view class="page">
-  <scroll-view class="message-detail" scroll-y>
-    <view class="card">
-      <image wx:if="{{activityInfo.poster.length}}" class="activity-poster" src="{{activityInfo.poster[0]}}"
-        mode="aspectFill" />
-      <view style="width: 100%;">
-        <view class="profile">
-          <view class="avatar-name" bindtap="getPublisherInfo">
-            <image class="publisher-avatar" src="{{activityInfo.publisher.avatar}}"></image>
-            <view class="publisher-name">{{activityInfo.publisher.name}}</view>
-          </view>
-          <view class="activity-attribute primary-background-color white-text-color">
-            {{activityInfo.type[0]}}
-          </view>
+  <view class="card">
+    <image wx:if="{{activityInfo.poster.length}}" class="activity-poster" src="{{activityInfo.poster[0]}}"
+      mode="aspectFill" />
+    <view style="width: 100%;">
+      <view class="profile">
+        <view class="avatar-name" bindtap="getPublisherInfo">
+          <image class="publisher-avatar" src="{{activityInfo.publisher.avatar}}"></image>
+          <view class="publisher-name">{{activityInfo.publisher.name}}</view>
         </view>
-
-        <view class="title-time">
-          <view class="title">{{activityInfo.name}}</view>
-          <view class="time primary-text-color">{{activityInfo.publish_time}}</view>
-        </view>
-        <view wx:if="{{activityInfo.detail}}" class="text">
-          <text>{{activityInfo.detail}}</text>
+        <view class="activity-attribute primary-background-color white-text-color">
+          {{activityInfo.type[0]}}
         </view>
+      </view>
 
-        <view class="line primary-background-color"></view>
+      <view class="title-time">
+        <view class="title">{{activityInfo.name}}</view>
+        <view class="time primary-text-color">{{activityInfo.publish_time}}</view>
+      </view>
+      <view wx:if="{{activityInfo.detail}}" class="text">
+        <text>{{activityInfo.detail}}</text>
+      </view>
 
-        <view wx:if="{{activityInfo.time}}" class="text">时间:{{activityInfo.time}}</view>
-        <view wx:if="{{activityInfo.place}}" class="text">地点:{{activityInfo.place}}</view>
-        <view wx:if="{{activityInfo.tag.length}}" class="text">活动提供:<text wx:for="{{activityInfo.tag}}"
-            wx:for-item="tag" wx:key="*this">{{tag}} </text></view>
-        <view wx:if="{{activityInfo.orient}}" class="text">面向对象:{{activityInfo.orient}}</view>
-        <view wx:if="{{activityInfo.contact}}" class="text">联系方式:{{activityInfo.contact}}</view>
-        <view wx:if="{{activityInfo.link}}" class="text">链接:{{activityInfo.link}}</view>
+      <view class="line primary-background-color"></view>
 
-        <imagePicker wx:if="{{activityInfo.photo.length}}" value="{{activityInfo.photo}}" max="1"
-          image-width="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
-          image-height="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
-          readonly />
-      </view>
+      <view wx:if="{{activityInfo.time}}" class="text">时间:{{activityInfo.time}}</view>
+      <view wx:if="{{activityInfo.place}}" class="text">地点:{{activityInfo.place}}</view>
+      <view wx:if="{{activityInfo.tag.length}}" class="text">活动提供:<text wx:for="{{activityInfo.tag}}" wx:for-item="tag"
+          wx:key="*this">{{tag}} </text></view>
+      <view wx:if="{{activityInfo.orient}}" class="text">面向对象:{{activityInfo.orient}}</view>
+      <view wx:if="{{activityInfo.contact}}" class="text">联系方式:{{activityInfo.contact}}</view>
+      <view wx:if="{{activityInfo.link}}" class="text">链接:{{activityInfo.link}}</view>
 
-      <view class="bottom" wx:if="{{showEdit}}">
-        <view class="btn accent-background-color white-text-color" bindtap="deleteActivity">删除</view>
-        <view class="btn primary-background-color" bindtap="editActivity">
-          <image class="btn-icon primary-background-color" mode="aspectFit" src="/images/publisher/publish2.png">
-          </image>
-          <view class="white-text-color">修改内容</view>
-        </view>
+      <imagePicker wx:if="{{activityInfo.photo.length}}" value="{{activityInfo.photo}}" max="1"
+        image-width="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
+        image-height="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
+        readonly />
+    </view>
+
+    <view class="bottom" wx:if="{{showEdit}}">
+      <view class="btn accent-background-color white-text-color" bindtap="deleteActivity">删除</view>
+      <view class="btn primary-background-color" bindtap="editActivity">
+        <image class="btn-icon primary-background-color" mode="aspectFit" src="/images/publisher/publish2.png">
+        </image>
+        <view class="white-text-color">修改内容</view>
       </view>
     </view>
+  </view>
 
-    <view class="message-block">
-      <view class="title2">{{activityComment.length == 0 ? "暂无问答" : "答疑区:"}}</view>
+  <view class="message-block">
+    <view style="display: flex; justify-content: space-between;">
+      <view class="title2">{{activityComment.length === 0 ? "暂无问答" : "答疑区:"}}</view>
       <image class="like" src="/images/like/{{like ? 'heart' : 'hollowheart'}}.png" catchtap="toggleLike" />
-      <view class="card1" wx:for="{{activityComment}}" wx:for-item="comm" wx:key="_id">
-        <itemActivityComment comment="{{comm}}" />
-      </view>
     </view>
-  </scroll-view>
+    <view class="card1" wx:for="{{activityComment}}" wx:for-item="comm" wx:key="_id">
+      <itemActivityComment comment="{{comm}}" />
+    </view>
+  </view>
 
   <view class="comment secondary-background-color">
     <view class="comment-inside" style="display: flex; align-items: center;">

+ 43 - 64
miniprogram/pages/activity/activity.wxss

@@ -1,63 +1,17 @@
-.message-detail {
-  position: fixed;
-  top: 0rpx;
-  bottom: 80rpx;
-  left: 0rpx;
-  right: 0rpx;
-}
-
-.like {
-  height: 40rpx;
-  width: 40rpx;
-  position: relative;
-  float: right;
-  right: 40rpx;
-}
-
-.comment {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  height: 80rpx;
-  padding-left: 20rpx;
-  padding-right: 20rpx;
-  position: fixed;
-  bottom: 0rpx;
-  left: 0rpx;
-  right: 0rpx;
-}
-
-.comment-inside {
-  border-radius: 20rpx;
-  background: #dadada;
-}
-
-.comment-input {
-  font-size: 35rpx;
-}
-
-.comment-button {
-  height: 80rpx;
-  width: 100rpx;
-  line-height: 80rpx;
-  font-size: 30rpx;
-  text-align: center;
-}
-
 .page {
   display: flex;
   flex-direction: column;
   justify-content: flex-start;
+  align-items: center;
   width: 100%;
 }
 
 .card {
   display: flex;
   flex-direction: column;
-  align-self: center;
   align-items: center;
   width: 700rpx;
-  margin: 50rpx 20rpx;
+  margin: 50rpx 0rpx;
   padding-bottom: 20rpx;
   background-color: #ffffff;
   border-radius: 28rpx;
@@ -65,11 +19,7 @@
 }
 
 .card1 {
-  display: flex;
-  flex-direction: column;
-  align-self: center;
-  width: 700rpx;
-  margin: 10rpx 30rpx;
+  margin-top: 20rpx;
 }
 
 .avatar-name {
@@ -128,10 +78,7 @@
 }
 
 .title2 {
-  font-size: 34rpx;
-  position: relative;
-  float: left;
-  left: 30rpx;
+  font-size: 32rpx;
 }
 
 .title-time {
@@ -156,6 +103,45 @@
   border-radius: 20rpx 20rpx 0rpx 0rpx;
 }
 
+.message-block {
+  width: 650rpx;
+  padding-bottom: 100rpx;
+}
+
+.like {
+  height: 50rpx;
+  width: 50rpx;
+}
+
+.comment {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 80rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+  position: fixed;
+  bottom: 0rpx;
+  width: 100%;
+}
+
+.comment-inside {
+  border-radius: 20rpx;
+  background: #dadada;
+}
+
+.comment-input {
+  font-size: 35rpx;
+}
+
+.comment-button {
+  height: 80rpx;
+  width: 100rpx;
+  line-height: 80rpx;
+  font-size: 30rpx;
+  text-align: center;
+}
+
 .text {
   font-size: 24rpx;
   margin-left: 50rpx;
@@ -168,13 +154,6 @@
   margin: 10rpx 20rpx 20rpx 20rpx;
 }
 
-.text {
-  font-size: 24rpx;
-  margin-left: 50rpx;
-  margin-bottom: 20rpx;
-  margin-right: 20rpx;
-}
-
 .btn-icon {
   height: 30rpx;
   width: 30rpx;

+ 0 - 1
miniprogram/pages/main/main.js

@@ -237,7 +237,6 @@ Page({
    */
   onPullDownRefresh: function () {
     this.setData({
-      mainDatas: [],
       pageToken: 0
     })
     this.loadMessageData()

+ 1 - 1
miniprogram/pages/main/main.wxss

@@ -3,7 +3,7 @@
   flex-direction: column;
   justify-content: flex-start;
   align-items: center;
-  margin: 0%;
+  width: 100%;
 }
 
 .filter {

+ 5 - 1
miniprogram/pages/publisher/publisher.js

@@ -16,7 +16,11 @@ Page({
 
   detail: function () {
     wx.navigateTo({
-      url: '/pages/publisherDetail/publisherDetail?id=' + this.data.publisherId,
+      url: '/pages/publisherDetail/publisherDetail',
+    }).then(res => {
+      res.eventChannel.emit('loadCommonData', {
+        data: this.data.publisherInfo
+      })
     })
   },
 

+ 1 - 1
miniprogram/pages/publisher/publisher.wxml

@@ -18,6 +18,6 @@
   </view>
 </view>
 
-<view class="card" wx:for="{{mainDatas}}" wx:for-item="msg" wx:key="_id">
+<view class="card-list" wx:for="{{mainDatas}}" wx:for-item="msg" wx:key="_id">
   <itemCard item="{{msg}}" />
 </view>

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

@@ -71,7 +71,9 @@
   width: 20rpx;
 }
 
-.card {
-  margin-left: 20rpx;
-  margin-right: 20rpx;
+.card-list {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
 }

+ 33 - 19
miniprogram/pages/publisherDetail/publisherDetail.js

@@ -3,6 +3,7 @@ const util = require('../../utils/util.js')
 Page({
 
   data: {
+    publisherId: '',
     publisherInfo: {},
   },
 
@@ -10,26 +11,39 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    wx.showLoading({
-      title: "加载中"
-    })
-    wx.cloud.callFunction({
-      name: 'getPublisher',
-      data: {
-        pub_id: options.id
-      }
-    }).then(res => {
-      wx.hideLoading()
-      if (res.result.status !== 'OK') {
-        wx.showToast({
-          title: res.result.errMsg,
-          icon: 'none'
-        })
-        return
-      }
+    if (options.id) {
       this.setData({
-        publisherInfo: res.result.data
+        publisherId: options.id
+      })
+      wx.showLoading({
+        title: "加载中"
+      })
+      wx.cloud.callFunction({
+        name: 'getPublisher',
+        data: {
+          pub_id: this.data.publisherId
+        }
+      }).then(res => {
+        wx.hideLoading()
+        if (res.result.status !== 'OK') {
+          wx.showToast({
+            title: res.result.errMsg,
+            icon: 'none'
+          })
+          return
+        }
+        this.setData({
+          publisherInfo: res.result.data
+        })
+      })
+    } else {
+      const eventChannel = this.getOpenerEventChannel()
+      eventChannel.on('loadCommonData', res => {
+        this.setData({
+          publisherId: res.data._id,
+          publisherInfo: res.data
+        })
       })
-    })
+    }
   }
 })

+ 6 - 6
miniprogram/pages/publisherDetail/publisherDetail.wxml

@@ -2,25 +2,25 @@
 <view class="sub-text secondary-text-color">组织详情</view>
 <view class="block">
   <view class="cate">组织类型</view>
-  <view class="input">{{publisherInfo.type}}</view>
+  <view class="input secondary-text-color">{{publisherInfo.type}}</view>
 </view>
 <view class="block2">
   <view class="cate">组织简介</view>
-  <text class="input">{{publisherInfo.intro}}</text>
+  <text class="input secondary-text-color">{{publisherInfo.intro}}</text>
 </view>
 <view class="block">
   <view class="cate">联系电话</view>
-  <view class="input">{{publisherInfo.phone}}</view>
+  <view class="input secondary-text-color">{{publisherInfo.phone}}</view>
 </view>
 <view class="block">
   <view class="cate">邮箱地址</view>
-  <view class="input">{{publisherInfo.email}}</view>
+  <view class="input secondary-text-color">{{publisherInfo.email}}</view>
 </view>
 <view class="block">
   <view class="cate">官方QQ</view>
-  <view class="input">{{publisherInfo.qq}}</view>
+  <view class="input secondary-text-color">{{publisherInfo.qq}}</view>
 </view>
 <view class="block">
   <view class="cate">公众号</view>
-  <view class="input">{{publisherInfo.wechat}}</view>
+  <view class="input secondary-text-color">{{publisherInfo.wechat}}</view>
 </view>