Silent 7 jaren geleden
bovenliggende
commit
f63912599b

+ 3 - 0
app/Http/Controllers/WeChat/ApiController.php

xqd
@@ -175,6 +175,9 @@ 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);
+        }
         return response()->json(['status' => 'success', 'list' => $list]);
     }
 

+ 2 - 1
wechat/app.js

xqd xqd
@@ -31,6 +31,7 @@ App({
   login: function (info) {
     wx.login({
       success: res => {
+        console.log(info, res)
         wx.request({
           url: api.loginUrl,
           method: 'POST',
@@ -40,7 +41,7 @@ App({
             encryptedData: info.encryptedData
           },
           success: info => {
-            // console.log(info);
+            console.log(info);
             if (info.data.status == 'success') {
               wx.setStorageSync('pt_student', info.data.data);
               getApp().globalData.ptStudent = info.data.data;

+ 4 - 1
wechat/pages/announce-detail/index.js

xqd xqd
@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    back_article: ''
   },
 
   /**
@@ -21,6 +21,9 @@ Page({
       success: res => {
         if (res.data.status == 'success') {
           console.log(res.data.article)
+          that.setData({
+            back_article: res.data.article
+          });
           WxParse.wxParse('article', 'html', res.data.article.content, that, 5);
         }
       }

+ 5 - 2
wechat/pages/announce-detail/index.wxml

xqd
@@ -1,4 +1,7 @@
 <!--pages/announce-detail/index.wxml-->
 <!--pages/article-detail/index.wxml-->
-<import src="/wxParse/wxParse.wxml"/>
-<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
+<import src="/wxParse/wxParse.wxml" />
+<view class='sg-container'>
+  <view class='sg-title'>{{ back_article.title }}</view>
+  <template is="wxParse" data="{{wxParseData:article.nodes}}" />
+</view>

+ 10 - 1
wechat/pages/announce-detail/index.wxss

xqd
@@ -1,2 +1,11 @@
 /* pages/announce-detail/index.wxss */
-@import "/wxParse/wxParse.wxss";
+@import "/wxParse/wxParse.wxss";
+.sg-container {
+  background-color: white
+}
+.sg-title {
+  text-align: center;
+  font-size: 1.15rem;
+  font-weight: bold;
+  padding: 7px 0;
+}

+ 4 - 1
wechat/pages/article-detail/index.js

xqd xqd
@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    
+    back_article: ''
   },
 
   /**
@@ -21,6 +21,9 @@ Page({
       success: res => {
         if(res.data.status == 'success') {
           console.log(res.data.article)
+          that.setData({
+            back_article: res.data.article
+          });
           WxParse.wxParse('article', 'html', res.data.article.content, that, 5);
         }
       }

+ 4 - 1
wechat/pages/article-detail/index.wxml

xqd
@@ -1,3 +1,6 @@
 <!--pages/article-detail/index.wxml-->
 <import src="/wxParse/wxParse.wxml"/>
-<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
+<view class='sg-container'>
+  <view class='sg-title'>{{ back_article.title }}</view>
+  <template is="wxParse" data="{{wxParseData:article.nodes}}" />
+</view>

+ 11 - 1
wechat/pages/article-detail/index.wxss

xqd
@@ -1,2 +1,12 @@
 /* pages/article-detail/index.wxss */
-@import "/wxParse/wxParse.wxss";
+@import "/wxParse/wxParse.wxss";
+
+.sg-container {
+  background-color: white
+}
+.sg-title {
+  text-align: center;
+  font-size: 1.15rem;
+  font-weight: bold;
+  padding: 7px 0;
+}

+ 5 - 1
wechat/pages/login/index.json

xqd
@@ -1,8 +1,12 @@
 {
+  "navigationBarBackgroundColor": "#000",
+  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "钢琴时间",
   "usingComponents": {
     "zan-button": "/bower_components/zanui-weapp/dist/btn/index",
     "zan-button-group": "/bower_components/zanui-weapp/dist/btn-group/index",
     "zan-row": "/bower_components/zanui-weapp/dist/row/index",
-    "zan-col": "/bower_components/zanui-weapp/dist/col/index"
+    "zan-col": "/bower_components/zanui-weapp/dist/col/index",
+    "zan-popup": "../../bower_components/zanui-weapp/dist/popup/index"
   }
 }