Browse Source

Code merge

贺智强 6 years ago
parent
commit
c020bd3ae1

+ 31 - 0
app/Http/Controllers/Admin/StudentController.php

xqd xqd xqd
@@ -9,6 +9,7 @@ use App\Models\StudentCourseTeacher;
 use App\Models\Teacher;
 use App\Models\TeacherStudent;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Validator;
 
 class StudentController extends Controller
 {
@@ -59,6 +60,17 @@ class StudentController extends Controller
             return $this->showWarning('数据错误');
         }
 
+        $validator = Validator::make($request->input('data'), [
+            'phone' => 'required|unique:students'
+        ], [
+            'phone.required' => '手机必填',
+            'phone.unique' => '手机已存在',
+        ]);
+
+        if($validator->fails()) {
+            return back()->withErrors($validator)->withInput();
+        }
+
         $res = $this->model->create($request->input('data'));
 
         if(!$res) {
@@ -87,6 +99,25 @@ class StudentController extends Controller
             return $this->showWarning('数据错误');
         }
 
+        $validator = Validator::make($request->input('data'), [
+            'phone' => 'required'
+        ], [
+            'phone.required' => '手机必填'
+        ]);
+
+        if($validator->fails()) {
+            return back()->withErrors($validator)->withInput();
+        }
+
+        $tmp = $this->model->where([
+            ['id', '<>', $request->input('id')],
+            ['phone', '=', $request->input('data')['phone']],
+        ])->first();
+        if(!empty($tmp)) {
+            $validator->errors()->add('phone', '手机已存在!');
+            return back()->withErrors($validator)->withInput();
+        }
+
         $res = $this->model->where('id', $request->input('id'))->update($request->input('data'));
 
         if(!$res) {

+ 28 - 5
app/Http/Controllers/WeChat/ApiController.php

xqd xqd xqd
@@ -156,10 +156,14 @@ class ApiController extends Controller
 
     public function getMoreVideosAndArticles(Request $request)
     {
-        $offset = $request->input('offset', 0);
-        $list = Content::whereIn('type', [3, 4])->orderBy('sort')->offset($offset)->limit(15)->get();
-        foreach($list as $item) {
-            if($item->type == 3) {
+        $video_offset = $request->input('video_offset', 0);
+        $article_offset = $request->input('article_offset', 0);
+        if(empty($request->input('type')) || !in_array($request->input('type'), ['both', 'video', 'article'])) {
+            return response()->json(['status' => 'fail', 'info' => '参数错误']);
+        }
+        if($request->input('type') == 'both') {
+            $video_list = Content::where('type', 3)->orderBy('sort')->offset($video_offset)->limit(15)->get();
+            foreach($video_list as $item) {
                 if(empty($item->pic_url)) {
                     $item->pic_url = 'https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/f0/f0734ad93d46497483344846864596a4.jpg';
                 } else {
@@ -167,14 +171,32 @@ class ApiController extends Controller
                 }
                 $item->url = url($item->content);
             }
+            $article_list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
+            return response()->json(['status' => 'success', 'video_list' => $video_list, 'article_list' => $article_list, 'type' => $request->input('type')]);
+        } else if($request->input('type') == 'video') {
+            $list = Content::where('type', 3)->orderBy('sort')->offset($video_offset)->limit(15)->get();
+            foreach($list as $item) {
+                if(empty($item->pic_url)) {
+                    $item->pic_url = 'https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/f0/f0734ad93d46497483344846864596a4.jpg';
+                } else {
+                    $item->pic_url = url($item->pic_url);
+                }
+                $item->url = url($item->content);
+            }
+        } else {
+            $list = Content::where('type', 4)->orderBy('sort')->offset($article_offset)->limit(15)->get();
         }
-        return response()->json(['status' => 'success', 'list' => $list]);
+
+        return response()->json(['status' => 'success', 'list' => $list, 'type' => $request->input('type')]);
     }
 
     public function getAnnounces(Request $request)
     {
         $offset = $request->input('offset', 0);
         $list = Content::whereIn('type', [1])->orderBy('sort')->offset($offset)->limit(15)->get();
+        foreach($list as $item) {
+            $item->publish_date = substr($item->created_at, 0, 10);
+        }
         return response()->json(['status' => 'success', 'list' => $list]);
     }
 
@@ -325,6 +347,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]);
     }
 

+ 30 - 0
database/migrations/2018_08_07_161532_add_phone_to_students.php

xqd
@@ -0,0 +1,30 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddPhoneToStudents extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('students', function (Blueprint $table) {
+            $table->string('phone', 200)->nullable()->after('name')->comment('手机');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+}

+ 14 - 4
resources/views/admin/students/create.blade.php

xqd
@@ -28,14 +28,24 @@
                         <form class="form-horizontal" method="POST" action="{{ $pre_uri . 'store' }}">
                             {{ csrf_field() }}
 
-                            <div class="form-group row">
+                            <div class="form-group row {{ $errors->has('name') ? 'has-error' : '' }}">
                                 <label class="col-sm-2 col-sm-offset-1 control-label">学员姓名</label>
                                 <div class="col-sm-8">
                                     <input type="text" name="data[name]" class="form-control" placeholder="请输入学员姓名" value="{{ isset(old('data')['name']) ? old('data')['name'] : '' }}" required>
+                                    @if($errors->has('name'))
+                                        <span class="help-block">{{ $errors->first('name') }}</span>
+                                    @endif
+                                </div>
+                            </div>
+
+                            <div class="form-group row {{ $errors->has('phone') ? 'has-error' : '' }}">
+                                <label class="col-sm-2 col-sm-offset-1 control-label">手机</label>
+                                <div class="col-sm-8">
+                                    <input type="text" name="data[phone]" class="form-control" placeholder="请输入学员姓名" value="{{ isset(old('data')['phone']) ? old('data')['phone'] : '' }}" required>
+                                    @if($errors->has('phone'))
+                                        <span class="help-block">{{ $errors->first('phone') }}</span>
+                                    @endif
                                 </div>
-                                @if($errors->has('name'))
-                                    <span class="help-block">{{ $errors->first('name') }}</span>
-                                @endif
                             </div>
 
                             <div class="form-group row">

+ 10 - 0
resources/views/admin/students/edit.blade.php

xqd
@@ -39,6 +39,16 @@
                                 @endif
                             </div>
 
+                            <div class="form-group row {{ $errors->has('phone') ? 'has-error' : '' }}">
+                                <label class="col-sm-2 col-sm-offset-1 control-label">手机</label>
+                                <div class="col-sm-8">
+                                    <input type="text" name="data[phone]" class="form-control" placeholder="请输入学员姓名" value="{{ $item->phone }}" required>
+                                    @if($errors->has('phone'))
+                                        <span class="help-block">{{ $errors->first('phone') }}</span>
+                                    @endif
+                                </div>
+                            </div>
+
                             <div class="form-group row">
                                 <label class="col-sm-2 col-sm-offset-1 control-label">年龄</label>
                                 <div class="col-sm-8">

+ 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;

+ 2 - 3
wechat/pages/announce-detail/index.js

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

+ 6 - 7
wechat/pages/announce-detail/index.wxml

xqd
@@ -1,10 +1,9 @@
 <!--pages/announce-detail/index.wxml-->
 <!--pages/article-detail/index.wxml-->
-<import src="/wxParse/wxParse.wxml"/>
-<view class="body">
-  <view class="title">{{item.title}}</view>
-  <view class="flex-row info">
-    <view class="flex-grow-1">{{item.publish_date}}</view>
-  </view>
-<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
+
+<import src="/wxParse/wxParse.wxml" />
+<view class='sg-container'>
+  <view class='sg-title'>{{ back_article.title }}</view>
+  <view class='sg-date'>{{ back_article.publish_date }}</view>
+  <template is="wxParse" data="{{wxParseData:article.nodes}}" />
 </view>

+ 15 - 0
wechat/pages/announce-detail/index.wxss

xqd
@@ -94,4 +94,19 @@
     color: #ff4544;
     border-radius: 5rpx!important;
     padding: 5rpx 10rpx!important;
+}
+.sg-container {
+  background-color: white
+}
+.sg-title {
+  text-align: center;
+  font-size: 1.15rem;
+  font-weight: bold;
+  padding: 7px 0;
+}
+.sg-date {
+  text-align: right;
+  padding: 4px 7px;
+  font-size: 0.8rem;
+  color: grey;
 }

+ 4 - 3
wechat/pages/announce/announce.wxml

xqd
@@ -1,8 +1,9 @@
 <view class='sg-container'>
   <view wx:for='{{ list }}' class='info-content'>
-    <view class='info-bg flex-row' catchtap='redirectToAnnounce' data-id='{{ item.id }}'>
-      <view class="info-label flex-grow-1">{{ item.title||'未命名' }}</view>
-      <view class=" flex-grow-0" style='line-height:100rpx;padding-right:20rpx'>{{item.publish_date}}</view>
+
+    <view class='info-bg' catchtap='redirectToAnnounce' data-id='{{ item.id }}'>
+      <view class="info-label">{{ item.title||'未命名' }}</view>
+      <view class="info-date">{{ item.publish_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;
 }

+ 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;
+}

+ 128 - 73
wechat/pages/article/article.js

xqd xqd xqd
@@ -1,19 +1,47 @@
 //var api = require("../../api.js"), app = getApp(), 
-var is_loading_more = !1, is_no_more = !1;
+var is_loading_more = !1,
+  is_no_more = !1;
 var api = require('../../utils/api.js');
 
 Page({
   data: {
     page: 1,
     video_list: [],
+    article_list: [],
     url: "",
     hide: "hide",
     show: !1,
-    animationData: {}
+    animationData: {},
+    tabList: [{
+      tab: 'video',
+      title: '视频'
+    }, {
+      tab: 'article',
+      title: '文章'
+    }],
+    selectedTab: 'video',
   },
   onLoad: function (a) {
     // app.pageOnLoad(this);
-    this.loadMoreGoodsList();
+    this.loadMoreGoodsList('both');
+  },
+  swiperTab: function (e) {
+    var that = this;
+    // console.log(e);
+    that.setData({
+      selectedTab: e.detail.currentItemId
+    });
+  },
+  clickTab: function (e) {
+    var that = this;
+    // console.log(e)
+    if (this.data.selectedTab === e.target.dataset.current) {
+      return false;
+    } else {
+      that.setData({
+        selectedTab: e.target.dataset.current
+      })
+    }
   },
   onReady: function () { },
   onShow: function () {
@@ -22,83 +50,107 @@ Page({
   onHide: function () { },
   onUnload: function () { },
   onPullDownRefresh: function () { },
-  loadMoreGoodsList: function () {
+  loadMoreGoodsList: function (tab) {
+    var tab = tab || this.data.selectedTab;
     var o = this;
     // if (!is_loading_more) {
     //   o.setData({
     //     show_loading_bar: !0
     //   }), is_loading_more = !0;
-      var i = o.data.page;
-      // var v = [{
-      //           "id":"234",
-      //           "title":"小程序项目整体介绍",
-      //           "url":"http://m1.beiyuesi.com/2.mp4",
-      //           "sort":"9",
-      //           "is_delete":"0",
-      //           "addtime":"1515120216",
-      //           "store_id":"20926",
-      //       "pic_url":"https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/f0/f0734ad93d46497483344846864596a4.jpg",
-      //           "content":"想要自己开发APP,却备受组建开发团队的困扰更别说高昂的开发费用与漫长的开",
-      //           "type":"0",
-      //           "time":"01月05日",
-      //           "show":-1
-      //       },
-      //   {
-      //     "id": "235",
-      //     "title": "小程序模版介绍",
-      //     "url": "http://m1.beiyuesi.com/1.mp4",
-      //     "sort": "99",
-      //     "is_delete": "0",
-      //     "addtime": "1515120395",
-      //     "store_id": "20926",
-      //     "pic_url": "https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/0e/0e739254177172e4b815d75f88da77b4.png",
-      //     "content": "小程序是腾讯旗下继朋友圈、公众号之后推出的又一款战略级的产品。是线下实体店实体零售转型升级、实现新突破的利器。小程序比公众号更容易传播和裂变,比传统电商更容易获客和成交,比朋友圈微商更专业和可信",
-      //     "type": "0",
-      //     "time": "01月05日",
-      //     "show": -1
-      //   },
-      //       ];
-      wx.request({
-        url: api.getMoreVideosAndArticlesUrl,
-        method: 'GET',
-        data: {
-          'offset': o.data.video_list.length
-        },
-        success: res => {
-          if (res.data.list.length > 0) {
-            var t = o.data.video_list.concat(res.data.list);
-            o.setData({
-              video_list: t,
-              page: i + 1
-            });
-          } else {
+    var i = o.data.page;
+    // var v = [{
+    //           "id":"234",
+    //           "title":"小程序项目整体介绍",
+    //           "url":"http://m1.beiyuesi.com/2.mp4",
+    //           "sort":"9",
+    //           "is_delete":"0",
+    //           "addtime":"1515120216",
+    //           "store_id":"20926",
+    //       "pic_url":"https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/f0/f0734ad93d46497483344846864596a4.jpg",
+    //           "content":"想要自己开发APP,却备受组建开发团队的困扰更别说高昂的开发费用与漫长的开",
+    //           "type":"0",
+    //           "time":"01月05日",
+    //           "show":-1
+    //       },
+    //   {
+    //     "id": "235",
+    //     "title": "小程序模版介绍",
+    //     "url": "http://m1.beiyuesi.com/1.mp4",
+    //     "sort": "99",
+    //     "is_delete": "0",
+    //     "addtime": "1515120395",
+    //     "store_id": "20926",
+    //     "pic_url": "https://u5.9026.com/addons/swdz_mall/core/web/uploads/image/0e/0e739254177172e4b815d75f88da77b4.png",
+    //     "content": "小程序是腾讯旗下继朋友圈、公众号之后推出的又一款战略级的产品。是线下实体店实体零售转型升级、实现新突破的利器。小程序比公众号更容易传播和裂变,比传统电商更容易获客和成交,比朋友圈微商更专业和可信",
+    //     "type": "0",
+    //     "time": "01月05日",
+    //     "show": -1
+    //   },
+    //       ];
+    wx.request({
+      url: api.getMoreVideosAndArticlesUrl,
+      method: 'GET',
+      data: {
+        'video_offset': o.data.video_list.length,
+        'article_offset': o.data.article_list.length,
+        'type': tab
+      },
+      success: res => {
+        if (res.data.status == 'success') {
+          if (res.data.type != 'both' && res.data.list.length <= 0) {
             wx.showToast({
               title: '到底了',
               icon: 'none',
               duration: 800
             })
+          } else {
+            if (res.data.type == 'video') {
+              var t = o.data.video_list.concat(res.data.list);
+              o.setData({
+                video_list: t,
+                page: i + 1
+              });
+            } else if (res.data.type == 'article') {
+              var t = o.data.article_list.concat(res.data.list);
+              o.setData({
+                article_list: t,
+                page: i + 1
+              });
+            } else if (res.data.type == 'both') {
+              var t = o.data.video_list.concat(res.data.video_list);
+              o.setData({
+                video_list: t,
+                page: i + 1
+              });
+              var t = o.data.article_list.concat(res.data.article_list);
+              o.setData({
+                article_list: t,
+                page: i + 1
+              });
+            }
           }
         }
-      })
-      // app.request({
-      //   url: api.default.video_list,
-      //   data: {
-      //     page: i
-      //   },
-      //   success: function (a) {
-      //     0 == a.data.list.length && (is_no_more = !0);
-      //     var t = o.data.video_list.concat(a.data.list);
-      //     o.setData({
-      //       video_list: t,
-      //       page: i + 1
-      //     });
-      //   },
-      //   complete: function () {
-      //     is_loading_more = !1, o.setData({
-      //       show_loading_bar: !1
-      //     });
-      //   }
-      // });
+      }
+    })
+    // app.request({
+    //   url: api.default.video_list,
+    //   data: {
+    //     page: i
+    //   },
+    //   success: function (a) {
+    //     0 == a.data.list.length && (is_no_more = !0);
+    //     var t = o.data.video_list.concat(a.data.list);
+    //     o.setData({
+    //       video_list: t,
+    //       page: i + 1
+    //     });
+    //   },
+    //   complete: function () {
+    //     is_loading_more = !1, o.setData({
+    //       show_loading_bar: !1
+    //     });
+    //   }
+    // });
     // }
   },
   play: function (a) {
@@ -113,17 +165,20 @@ Page({
     // is_no_more || this.loadMoreGoodsList();
   },
   more: function (a) {
-    var t = this, o = a.target.dataset.index, i = t.data.video_list, e = wx.createAnimation({
-      duration: 1e3,
-      timingFunction: "ease"
-    });
+    var t = this,
+      o = a.target.dataset.index,
+      i = t.data.video_list,
+      e = wx.createAnimation({
+        duration: 1e3,
+        timingFunction: "ease"
+      });
     this.animation = e, -1 != i[o].show ? (e.rotate(0).step(), i[o].show = -1) : (e.rotate(0).step(),
       i[o].show = 0), t.setData({
         video_list: i,
         animationData: this.animation.export()
       });
   },
-  redirectToArticle: function(e) {
+  redirectToArticle: function (e) {
     let id = e.currentTarget.dataset.id;
     wx.navigateTo({
       url: '/pages/article-detail/index?id=' + id

+ 34 - 17
wechat/pages/article/article.wxml

xqd
@@ -1,27 +1,44 @@
-<view class="after-navber">
-    <view class="info">
+<view class="swiper-tab">
+  <view class="swiper-tab-item {{ item.tab == selectedTab ? 'active' : '' }}" data-current="{{ item.tab }}" bindtap="clickTab" wx:for="{{ tabList }}">{{ item.title }}</view>
+</view>
+<swiper current-item-id="{{ selectedTab }}" duration="300" bindchange="swiperTab">
+  <swiper-item item-id="video">
+    <view class="after-navber">
+      <view class="info">
         <view class="info-list">
-            <view class="info-content" wx:for="{{video_list}}">
-                <view class="info-bg" wx:if="{{ item.type == 3 }}">
-                    <view class="info-video">
-                        <image bindtap="play" class="bg {{show_video==index?hide:''}}" data-index="{{index}}" src="{{item.pic_url}}"></image>
-                        <image bindtap="play" class="play {{show_video==index?hide:''}}" data-index="{{index}}" src="/images/video-play.png"></image>
-                        <video autoplay="true" class="{{show_video==index?'':hide}}" controls="controls" id="video_{{index}}" src="{{item.url}}" wx:if="{{show_video==index}}"></video>
-                    </view>
-                     <view class="info-label">{{item.title||'未命名'}}</view>
-                     <!-- <view class="content {{item.show!=-1?'':'more'}}">{{item.content||'暂无信息'}}</view>   -->
-                    <!-- <view class="flex-y-center flex-x-center" style="position:relative;height:80rpx;font-size:9pt;color:#afafaf">
+          <view class="info-content" wx:for="{{ video_list }}">
+            <view class="info-bg" wx:if="{{ item.type == 3 }}">
+              <view class="info-video">
+                <image bindtap="play" class="bg {{show_video==index?hide:''}}" data-index="{{index}}" src="{{item.pic_url}}"></image>
+                <image bindtap="play" class="play {{show_video==index?hide:''}}" data-index="{{index}}" src="/images/video-play.png"></image>
+                <video autoplay="true" class="{{show_video==index?'':hide}}" controls="controls" id="video_{{index}}" src="{{item.url}}" wx:if="{{show_video==index}}"></video>
+              </view>
+              <view class="info-label">{{item.title||'未命名'}}</view>
+              <!-- <view class="content {{item.show!=-1?'':'more'}}">{{item.content||'暂无信息'}}</view>   -->
+              <!-- <view class="flex-y-center flex-x-center" style="position:relative;height:80rpx;font-size:9pt;color:#afafaf">
                         <text class="flex-y-center left">{{item.time}}</text>
                         <view capture-bind:tap="more" class="right flex-y-center" data-index="{{index}}">
                             <image animation="{{animationData}}" src="{{item.show!=-1?'/images/icon-up.png':'/images/icon-down.png'}}"></image>
                             <text data-index="{{index}}">展开</text>
                         </view>
                     </view> -->
-                </view>
-                <view wx:if="{{ item.type == 4 }}" class='info-bg' catchtap='redirectToArticle' data-id='{{ item.id }}'>
-                  <view class="info-label">{{ item.title||'未命名' }}</view>
-                </view>
             </view>
+          </view>
         </view>
+      </view>
     </view>
-</view>
+  </swiper-item>
+  <swiper-item item-id="article">
+    <view class="after-navber">
+      <view class="info">
+        <view class="info-list">
+          <view class="info-content" wx:for="{{ article_list }}">
+            <view class='info-bg' catchtap='redirectToArticle' data-id='{{ item.id }}'>
+              <view class="info-label">{{ item.title||'未命名' }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </swiper-item>
+</swiper>

+ 91 - 71
wechat/pages/article/article.wxss

xqd
@@ -1,123 +1,143 @@
 .info {
-    overflow-x: hidden;
-    padding-bottom: 20rpx;
+  overflow-x: hidden;
+  padding-bottom: 20rpx;
 }
 
 .info .info-list {
-    margin-right: -10rpx;
-    margin-left: -10rpx;
+  margin-right: -10rpx;
+  margin-left: -10rpx;
 }
 
 .info-content {
-    padding: 0 10rpx;
-    width: 100%;
-    display: inline-block;
-    margin-bottom: 20rpx;
+  padding: 0 10rpx;
+  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-video {
-    width: 100%;
-    height: 422rpx;
-    background-color: #fff;
-    position: relative;
+  width: 100%;
+  height: 422rpx;
+  background-color: #fff;
+  position: relative;
 }
 
 .hide {
-    display: none;
+  display: none;
 }
 
 .info-content .info-video .bg {
-    width: 100%;
-    height: 422rpx;
-    position: absolute;
-    top: 0;
-    left: 0;
+  width: 100%;
+  height: 422rpx;
+  position: absolute;
+  top: 0;
+  left: 0;
 }
 
 .info-content .info-video .play {
-    width: 128rpx;
-    height: 128rpx;
-    position: absolute;
-    top: 137rpx;
-    left: 311rpx;
-    opacity: 0.8;
+  width: 128rpx;
+  height: 128rpx;
+  position: absolute;
+  top: 137rpx;
+  left: 311rpx;
+  opacity: 0.8;
 }
 
 .info-content .info-video video {
-    width: 100%;
-    height: 100%;
-    position: absolute;
-    top: 0;
-    left: 0;
+  width: 100%;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
 }
 
 .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;
+  width: 100%;
+  height: 100rpx;
+  line-height: 100rpx;
+  padding: 0 24rpx;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  font-weight: bold;
 }
 
 .modal {
-    position: fixed;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background-color: rgba(0,0,0,1);
-    z-index: 9999;
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 1);
+  z-index: 9999;
 }
 
 .modal video {
-    width: 100%;
-    height: 430rpx;
+  width: 100%;
+  height: 430rpx;
 }
 
 .no-scroll {
-    height: 100%;
-    overflow-y: hidden;
+  height: 100%;
+  overflow-y: hidden;
 }
 
 .info-content .content {
-    padding: 0 24rpx;
+  padding: 0 24rpx;
 }
 
 .info-content .content.more {
-    overflow: hidden;
-    display: -webkit-box;
-    -webkit-box-orient: vertical;
-    -webkit-line-clamp: 3;
+  overflow: hidden;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 3;
 }
 
 .info-content .left {
-    position: absolute;
-    top: 0;
-    left: 0;
-    bottom: 0;
-    padding: 0 20rpx;
+  position: absolute;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  padding: 0 20rpx;
 }
 
 .info-content .right {
-    position: absolute;
-    right: 0;
-    top: 0;
-    bottom: 0;
-    padding: 0 20rpx;
+  position: absolute;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  padding: 0 20rpx;
 }
 
 .info-content .right image {
-    width: 18rpx;
-    height: 10rpx;
-    margin-right: 16rpx;
-}
+  width: 18rpx;
+  height: 10rpx;
+  margin-right: 16rpx;
+}
+
+.swiper-tab {
+  width: 100%;
+  border-bottom: 2rpx solid #ccc;
+  text-align: center;
+  height: 88rpx;
+  line-height: 88rpx;
+  font-weight: bold;
+}
+
+.swiper-tab-item {
+  display: inline-block;
+  width: 33.33%;
+  color: red;
+}
+
+.active {
+  color: aqua;
+  border-bottom: 4rpx solid red;
+}

+ 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"
   }
 }