mulioid 4 سال پیش
والد
کامیت
4f81be47c0

+ 64 - 62
miniprogram/app.json

@@ -1,63 +1,65 @@
-{
-  "pages": [
-    "pages/main/main",
-    "pages/publisher/publisher",
-    "pages/publisherPage/publisherPage",
-    "pages/user/user",
-    "pages/message/message",
-    "pages/search/search",
-    "pages/setting/setting",
-    "pages/activity/activity",
-    "pages/myFollow/myFollow",
-    "pages/publisherLogin/publisherLogin",
-    "pages/activityPublish/activityPublish",
-    "pages/myQuestion/myQuestion",
-    "pages/receivedQuestion/receivedQuestion",
-    "pages/publisherInfoChange/publisherInfoChange",
-    "pages/aboutUs/aboutUs",
-    "pages/opinion/opinion",
-    "pages/myPublish/myPublish",
-    "pages/administratorSetting/administratorSetting",
-    "pages/myColor/myColor",
-    "pages/myFavor/myFavor"
-  ],
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#009195",
-    "navigationBarTitleText": "汇听",
-    "navigationBarTextStyle": "white"
-  },
-  "style": "v2",
-  "sitemapLocation": "sitemap.json",
-  "tabBar": {
-    "selectedColor": "#009195",
-    "backgroundColor": "#ffffff",
-    "color": "#9E9E9E",
-    "borderStyle": "white",
-    "list": [{
-        "pagePath": "pages/main/main",
-        "text": "首页",
-        "iconPath": "images/tabbar/1.1.png",
-        "selectedIconPath": "images/tabbar/1.2.png"
-      },
-      {
-        "pagePath": "pages/search/search",
-        "text": "搜索",
-        "iconPath": "images/tabbar/2.1.png",
-        "selectedIconPath": "images/tabbar/2.2.png"
-      },
-      {
-        "pagePath": "pages/message/message",
-        "text": "消息",
-        "iconPath": "images/tabbar/3.1.png",
-        "selectedIconPath": "images/tabbar/3.2.png"
-      },
-      {
-        "pagePath": "pages/user/user",
-        "text": "我的",
-        "iconPath": "images/tabbar/4.1.png",
-        "selectedIconPath": "images/tabbar/4.2.png"
-      }
-    ]
-  }
+{
+  "pages": [
+    "pages/main/main",
+    "pages/publisher/publisher",
+    "pages/publisherPage/publisherPage",
+    "pages/user/user",
+    "pages/message/message",
+    "pages/search/search",
+    "pages/setting/setting",
+    "pages/activity/activity",
+    "pages/myFollow/myFollow",
+    "pages/publisherLogin/publisherLogin",
+    "pages/activityPublish/activityPublish",
+    "pages/myQuestion/myQuestion",
+    "pages/receivedQuestion/receivedQuestion",
+    "pages/publisherInfoChange/publisherInfoChange",
+    "pages/aboutUs/aboutUs",
+    "pages/opinion/opinion",
+    "pages/myPublish/myPublish",
+    "pages/administratorSetting/administratorSetting",
+    "pages/myColor/myColor",
+    "pages/myFavor/myFavor",
+    "pages/publisherDetail/publisherDetail"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#009195",
+    "navigationBarTitleText": "汇听",
+    "navigationBarTextStyle": "white"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "tabBar": {
+    "selectedColor": "#009195",
+    "backgroundColor": "#ffffff",
+    "color": "#9E9E9E",
+    "borderStyle": "white",
+    "list": [
+      {
+        "pagePath": "pages/main/main",
+        "text": "首页",
+        "iconPath": "images/tabbar/1.1.png",
+        "selectedIconPath": "images/tabbar/1.2.png"
+      },
+      {
+        "pagePath": "pages/search/search",
+        "text": "搜索",
+        "iconPath": "images/tabbar/2.1.png",
+        "selectedIconPath": "images/tabbar/2.2.png"
+      },
+      {
+        "pagePath": "pages/message/message",
+        "text": "消息",
+        "iconPath": "images/tabbar/3.1.png",
+        "selectedIconPath": "images/tabbar/3.2.png"
+      },
+      {
+        "pagePath": "pages/user/user",
+        "text": "我的",
+        "iconPath": "images/tabbar/4.1.png",
+        "selectedIconPath": "images/tabbar/4.2.png"
+      }
+    ]
+  }
 }

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

@@ -46,10 +46,10 @@
   <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>
+      <input class="comment-input" 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'}}"
+    <view class="comment-button {{commentText.length < 5 ? 'secondary-text-color' : 'primary-text-color'}}"
       bindtap="comment">发送</view>
   </view>
 </view>

+ 2 - 2
miniprogram/pages/myQuestion/myQuestion.wxss

@@ -1,7 +1,7 @@
 /* miniprogram/pages/receivedQuestion/receivedQuestion.wxss */
 .checkbox {
-  transform:scale(0.8);
-  margin-left:10rpx;
+  transform: scale(0.8);
+  margin-left: 10rpx;
 }
 
 .checkbox-group {

+ 6 - 0
miniprogram/pages/publisher/publisher.js

@@ -12,6 +12,12 @@ Page({
     likeEnable: true
   },
 
+  detail: function () {
+    wx.navigateTo({
+      url: '/pages/publisherDetail/publisherDetail',
+    })
+  },
+
   processData: function (start, arr) {
     for (let i = start; i < arr.length; i++) {
       arr[i].time = util.handleDate(arr[i].time)

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

@@ -14,7 +14,7 @@
     <view class="publisher-intro secondary-text-color"><text
         class="primary-text-color">简介:</text>{{publisherInfo.publisherIntro}}</view>
     <view class="check">
-      <text class="check-text primary-text-color">查看详情</text>
+      <text class="check-text primary-text-color" bindtap="detail">查看详情</text>
       <image class="arrow" src="/images/hollow_arrow.png" mode="aspectFill"></image>
     </view>
   </view>
@@ -26,4 +26,4 @@
 
 <view class="card" wx:for="{{mainDatas}}" wx:for-item="item" wx:for-index="index" wx:key="_id">
   <itemCard item="{{item}}" />
-</view>
+</view>

+ 51 - 0
miniprogram/pages/publisherDetail/publisherDetail.js

@@ -0,0 +1,51 @@
+const util = require('../../utils/util.js')
+
+Page({
+
+  data: {
+    publisherInfo: [],
+    mainDatas: [],
+  },
+
+  processData: function (start, arr) {
+    for (let i = start; i < arr.length; i++) {
+      arr[i].time = util.handleDate(arr[i].time)
+    }
+    this.setData({
+      mainDatas: arr
+    })
+    wx.hideLoading()
+  },
+
+  onLoad: function (options) {
+    wx.showLoading({
+      title: "加载中"
+    })
+    const db = wx.cloud.database()
+    db.collection("publisherInfoData").doc(options.id).get({
+      success: function (res) {
+        this.setData({
+          publisherInfo: res.data
+        })
+        db.collection("mainData").where({
+          publisherName: this.data.publisherInfo.publisherName
+        }).orderBy("time", "desc").limit(20).get({
+          success: function (res) {
+            this.processData(0, res.data)
+          }.bind(this)
+        })
+      }.bind(this)
+    })
+    db.collection("likeData").where({
+      type: "publisher",
+      id: options.id
+    }).get({
+      success: function (res) {
+        this.setData({
+          like: res.data.length
+        })
+      }.bind(this)
+    })
+  },
+
+})

+ 3 - 0
miniprogram/pages/publisherDetail/publisherDetail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 18 - 0
miniprogram/pages/publisherDetail/publisherDetail.wxml

@@ -0,0 +1,18 @@
+<view class="top">
+  <view class="brief-info">
+    <view class="brief-info-left">
+      <image class="publisher-avatar" src="{{publisherInfo.publisherAvatar}}" mode="aspectFill" />
+      <text class="publisher-name">{{publisherInfo.publisherName}}</text>
+    </view>
+  </view>
+
+
+  <view class="detailed-info">
+    <view class="publisher-intro secondary-text-color"><text
+        class="primary-text-color">简介:</text>{{publisherInfo.publisherIntro}}</view>
+    <view class="check">
+      <text class="check-text primary-text-color">查看详情</text>
+      <image class="arrow" src="/images/hollow_arrow.png" mode="aspectFill"></image>
+    </view>
+  </view>
+</view>

+ 78 - 0
miniprogram/pages/publisherDetail/publisherDetail.wxss

@@ -0,0 +1,78 @@
+.top {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-top: 40rpx;
+}
+
+
+.brief-info {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  z-index: 1;
+  width: 100%;
+}
+
+.brief-info-left {
+  display: flex;
+  align-items: center;
+  margin: 0rpx 0rpx 0rpx 40rpx;
+}
+
+.publisher-avatar {
+  height: 120rpx;
+  width: 120rpx;
+  border-radius: 100rpx;
+  z-index: 20;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+}
+
+.publisher-name {
+  font-size: 40rpx;
+  background-color: #ffffff;
+  border-radius: 20rpx;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+  padding: 10rpx 40rpx 10rpx 40rpx;
+  margin-left: -30rpx;
+}
+
+.detailed-info {
+  margin-left: 40rpx;
+  margin-top: 20rpx;
+  margin-right: 40rpx;
+  margin-bottom: 25rpx;
+  padding: 10rpx;
+}
+
+.publisher-intro {
+  font-size: 24rpx;
+}
+
+.like {
+  margin-right: 50rpx;
+  height: 50rpx;
+  width: 50rpx;
+}
+
+.check {
+  display: flex;
+  align-items: center;
+  position: absolute;
+  right: 50rpx;
+}
+
+.check-text {
+  font-size: 24rpx;
+  margin-right: 10rpx;
+}
+
+.arrow {
+  height: 20rpx;
+  width: 20rpx;
+}
+
+.card {
+  margin-left: 20rpx;
+  margin-right: 20rpx;
+}