Silent 7 jaren geleden
bovenliggende
commit
621b1ba5c5

+ 2 - 1
app/Http/Controllers/WeChat/ApiController.php

xqd xqd
@@ -176,7 +176,7 @@ class ApiController extends Controller
         $offset = $request->input('offset', 0);
         $list = Content::whereIn('type', [1])->orderBy('sort')->offset($offset)->limit(15)->get();
         foreach($list as $item) {
-            $item->start_date = substr($item->created_at, 0, 10);
+            $item->publish_date = substr($item->created_at, 0, 10);
         }
         return response()->json(['status' => 'success', 'list' => $list]);
     }
@@ -328,6 +328,7 @@ class ApiController extends Controller
             return response()->json(['status' => 'fail', 'info' => '找不到文章']);
         }
         $item->content = $this->replaceImageSrc($item->content);
+        $item->publish_date = substr($item->created_at, 0, 10);
         return response()->json(['status' => 'success', 'article' => $item]);
     }
 

+ 1 - 0
wechat/pages/announce-detail/index.wxml

xqd
@@ -3,5 +3,6 @@
 <import src="/wxParse/wxParse.wxml" />
 <view class='sg-container'>
   <view class='sg-title'>{{ back_article.title }}</view>
+  <view class='sg-date'>{{ back_article.created_at.substring(0, 10) }}</view>
   <template is="wxParse" data="{{wxParseData:article.nodes}}" />
 </view>

+ 1 - 0
wechat/pages/announce/announce.wxml

xqd
@@ -2,6 +2,7 @@
   <view wx:for='{{ list }}' class='info-content'>
     <view class='info-bg' catchtap='redirectToAnnounce' data-id='{{ item.id }}'>
       <view class="info-label">{{ item.title||'未命名' }}</view>
+      <view class="info-date">{{ item.start_date }}</view>
     </view>
   </view>
 </view>

+ 19 - 16
wechat/pages/announce/announce.wxss

xqd
@@ -1,23 +1,26 @@
 .info-content {
-    width: 100%;
-    display: inline-block;
-    margin-bottom: 20rpx;
+  width: 100%;
+  display: inline-block;
+  margin-bottom: 20rpx;
 }
 
 .info-content .info-bg {
-    background-color: #fff;
-    position: relative;
-    width: 100%;
-    height: 100%;
+  background-color: #fff;
+  position: relative;
+  width: 100%;
+  height: 100%;
 }
 
-.info-content .info-label {
-    width: 100%;
-    height: 100rpx;
-    line-height: 100rpx;
-    padding: 0 24rpx;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    overflow: hidden;
-    font-weight: bold;
+.info-content .info-label,
+.info-content .info-date {
+  display: inline;
+  line-height: 100rpx;
+  padding: 0 24rpx;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  font-weight: bold;
+}
+.info-content .info-date {
+  float: right;
 }