Browse Source

FIX

修复没有封图时图片不显示的问题
RegMs If 4 years ago
parent
commit
a54135bce5

+ 1 - 0
cloudfunctions/createMessage/index.js

@@ -49,6 +49,7 @@ exports.main = async (event, context) => {
         place: event.place || '',
         place: event.place || '',
         contact: event.contact || '',
         contact: event.contact || '',
         detail: event.detail || '',
         detail: event.detail || '',
+        link: event.link || '',
         publish_time: new Date()
         publish_time: new Date()
       }
       }
     })
     })

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

@@ -14,11 +14,11 @@
     <view class="time primary-text-color">{{item.publish_time}}</view>
     <view class="time primary-text-color">{{item.publish_time}}</view>
   </view>
   </view>
   <view class="sub-title">{{item.brief}}</view>
   <view class="sub-title">{{item.brief}}</view>
-  <imagePicker wx:if="{{item.poster !== ''}}" value="{{[item.poster]}}" max="1" image-width="696" image-height="330"
+  <imagePicker wx:if="{{item.poster !== ''}}" value="{{[item.poster]}}" max="1" image-width="698" image-height="330"
     readonly />
     readonly />
   <imagePicker wx:if="{{item.poster === '' && item.photo.length !== 0}}" value="{{item.photo}}" max="1"
   <imagePicker wx:if="{{item.poster === '' && item.photo.length !== 0}}" value="{{item.photo}}" max="1"
-    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 />
+    image-width="{{item.photo.length == 1 ? 698 : item.photo.length <= 4 ? 330 : 220}}"
+    image-height="{{item.photo.length == 1 ? 698 : item.photo.length <= 4 ? 330 : 220}}" readonly />
   <view class="bottom-line">
   <view class="bottom-line">
     <view class="tags primary-text-color">
     <view class="tags primary-text-color">
       <text style="font-size: 25rpx; margin: 0rpx 30rpx;" wx:for="{{item.tag}}" wx:for-item="tag" wx:key="_id"
       <text style="font-size: 25rpx; margin: 0rpx 30rpx;" wx:for="{{item.tag}}" wx:for-item="tag" wx:key="_id"

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

@@ -37,8 +37,8 @@
       <view wx:if="{{activityInfo.orient}}" class="text">链接:{{activityInfo.link}}</view>
       <view wx:if="{{activityInfo.orient}}" class="text">链接:{{activityInfo.link}}</view>
 
 
       <imagePicker wx:if="{{activityInfo.photo.length != 0}}" value="{{activityInfo.photo}}" max="1"
       <imagePicker wx:if="{{activityInfo.photo.length != 0}}" value="{{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 />
+        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 class="line light-primary-color"></view>
       <view class="line light-primary-color"></view>
     </view>
     </view>
   </view>
   </view>

+ 2 - 0
miniprogram/pages/activityPublish/activityPublish.js

@@ -104,6 +104,8 @@ Page({
       if (value.poster.length !== 0) {
       if (value.poster.length !== 0) {
         value.poster = res[0].fileID
         value.poster = res[0].fileID
         res.splice(0, 1)
         res.splice(0, 1)
+      } else {
+        value.poster = ''
       }
       }
       for (let i = 0; i < value.photo.length; i++) {
       for (let i = 0; i < value.photo.length; i++) {
         value.photo[i] = res[i].fileID
         value.photo[i] = res[i].fileID

+ 17 - 19
miniprogram/pages/publisherPage/publisherPage.js

@@ -13,21 +13,27 @@ Page({
     pubIndex: 0
     pubIndex: 0
   },
   },
 
 
-  publishInfo: function () {
+  publisherHome: function () {
+    wx.navigateTo({
+      url: "/pages/publisher/publisher?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
+    })
+  },
+
+  activityPublish: function () {
     wx.navigateTo({
     wx.navigateTo({
       url: "/pages/activityPublish/activityPublish?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
       url: "/pages/activityPublish/activityPublish?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
     })
     })
   },
   },
 
 
-  publisherQuestion: function () {
+  activityChange: function () {
     wx.navigateTo({
     wx.navigateTo({
-      url: "/pages/publisherQuestion/publisherQuestion?id=" + this.data.pubInfo[this.data.pubIndex].pub_id
+      url: "/pages/activityChange/activityChange?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
     })
     })
   },
   },
 
 
-  publisherInfoChange: function () {
+  publisherQuestion: function () {
     wx.navigateTo({
     wx.navigateTo({
-      url: "/pages/publisherInfoChange/publisherInfoChange?id=" + this.data.pubInfo[this.data.pubIndex].pub_id
+      url: "/pages/publisherQuestion/publisherQuestion?id=" + this.data.pubInfo[this.data.pubIndex].pub_id
     })
     })
   },
   },
 
 
@@ -37,6 +43,12 @@ Page({
     })
     })
   },
   },
 
 
+  publisherInfoChange: function () {
+    wx.navigateTo({
+      url: "/pages/publisherInfoChange/publisherInfoChange?id=" + this.data.pubInfo[this.data.pubIndex].pub_id
+    })
+  },
+
   publisherLogin: function () {
   publisherLogin: function () {
     wx.navigateTo({
     wx.navigateTo({
       url: "/pages/publisherLogin/publisherLogin",
       url: "/pages/publisherLogin/publisherLogin",
@@ -47,20 +59,6 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   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,
-    //       hasPublisherInfo: true
-    //     })
-    //     wx.hideLoading()
-    //   }.bind(this)
-    // })
-
     if (app.globalData.hasUserInfo) {
     if (app.globalData.hasUserInfo) {
       const pubName = []
       const pubName = []
       for (let i = 0; i < app.globalData.pubInfo.length; i++) {
       for (let i = 0; i < app.globalData.pubInfo.length; i++) {

+ 4 - 4
miniprogram/pages/publisherPage/publisherPage.wxml

@@ -5,7 +5,7 @@
   <view wx:if="{{hasPubInfo}}" class="publisher-name">{{pubInfo[pubIndex].publisher[0].name}}</view>
   <view wx:if="{{hasPubInfo}}" class="publisher-name">{{pubInfo[pubIndex].publisher[0].name}}</view>
 </view>
 </view>
 
 
-<view class="block2" hover-class="btn-hover">
+<view class="block2" hover-class="btn-hover" bindtap="publisherHome">
   <view class="left">
   <view class="left">
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/home.png"></image>
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/home.png"></image>
     <view>主页</view>
     <view>主页</view>
@@ -13,7 +13,7 @@
   <view>></view>
   <view>></view>
 </view>
 </view>
 
 
-<view class="block" hover-class="btn-hover" bindtap="publishInfo">
+<view class="block" hover-class="btn-hover" bindtap="activityPublish">
   <view class="left">
   <view class="left">
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish1.png"></image>
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish1.png"></image>
     <view>发布信息</view>
     <view>发布信息</view>
@@ -22,7 +22,7 @@
 </view>
 </view>
 
 
 
 
-<view class="block" hover-class="btn-hover" bindtap="myPublish">
+<view class="block" hover-class="btn-hover" bindtap="activityChange">
   <view class="left">
   <view class="left">
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish2.png"></image>
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish2.png"></image>
     <view class="btn-text primary-text">修改发布消息</view>
     <view class="btn-text primary-text">修改发布消息</view>
@@ -33,7 +33,7 @@
 <view class="block2" hover-class="btn-hover" bindtap="publisherQuestion">
 <view class="block2" hover-class="btn-hover" bindtap="publisherQuestion">
   <view class="left">
   <view class="left">
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/question.png"></image>
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/question.png"></image>
-    <view class="btn-text primary-text">收到的问题</view>
+    <view class="btn-text primary-text">收到的问题</view>
   </view>
   </view>
   <view class="btn-arrow secondary-text">></view>
   <view class="btn-arrow secondary-text">></view>
 </view>
 </view>