Silent 6 năm trước cách đây
mục cha
commit
77a78b3e2a

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

xqd xqd
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\WeChat;
 use App\Models\CheckCard;
 use App\Models\Content;
 use App\Models\Leave;
+use App\Models\RemarkTitle;
 use App\Models\Setting;
 use App\Models\Student;
 use App\Models\StudentCourse;
@@ -264,4 +265,10 @@ class ApiController extends Controller
         }
         return response()->json(['status' => 'success', 'info' => '请假成功']);
     }
+
+    public function getRemarkTitles(Request $request)
+    {
+        $titles = RemarkTitle::where('status', 2)->get();
+        return response()->json(['status' => 'success', 'titles' => $titles]);
+    }
 }

+ 2 - 1
routes/wechat.php

xqd
@@ -9,4 +9,5 @@ Route::get('getShareInfo', 'ApiController@getShareInfo');
 Route::get('getMoreVideos', 'ApiController@getMoreVideos');
 Route::get('getCourseInfo', 'ApiController@getCourseInfo');
 Route::get('getMyLearnInfo', 'ApiController@getMyLearnInfo');
-Route::get('applyLeave', 'ApiController@applyLeave');
+Route::get('applyLeave', 'ApiController@applyLeave');
+Route::get('getRemarkTitles', 'ApiController@getRemarkTitles');

+ 21 - 12
wechat/pages/article/article.js

xqd xqd xqd xqd
@@ -24,10 +24,10 @@ Page({
   onPullDownRefresh: function () { },
   loadMoreGoodsList: function () {
     var o = this;
-    if (!is_loading_more) {
-      o.setData({
-        show_loading_bar: !0
-      }), is_loading_more = !0;
+    // if (!is_loading_more) {
+    //   o.setData({
+    //     show_loading_bar: !0
+    //   }), is_loading_more = !0;
       var i = o.data.page;
       // var v = [{
       //           "id":"234",
@@ -65,12 +65,19 @@ Page({
           'offset': o.data.video_list.length
         },
         success: res => {
-          console.log(res)
-          var t = o.data.video_list.concat(res.data.list);
-          o.setData({
-            video_list: t,
-            page: i + 1
-          });
+          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 {
+            wx.showToast({
+              title: '到底了',
+              icon: 'none',
+              duration: 800
+            })
+          }
         }
       })
       // app.request({
@@ -92,7 +99,7 @@ Page({
       //     });
       //   }
       // });
-    }
+    // }
   },
   play: function (a) {
     var t = a.currentTarget.dataset.index;
@@ -102,7 +109,9 @@ Page({
     });
   },
   onReachBottom: function () {
-    is_no_more || this.loadMoreGoodsList();
+    console.log('bottom')
+    this.loadMoreGoodsList();
+    // is_no_more || this.loadMoreGoodsList();
   },
   more: function (a) {
     var t = this, o = a.target.dataset.index, i = t.data.video_list, e = wx.createAnimation({

+ 18 - 3
wechat/pages/index/index.js

xqd
@@ -73,12 +73,27 @@ Page({
     }
     wx.getLocation({
       success: (res) => {
-        let validLocation = this.validLocation(res.latitude, res.longitude)
+        // let validLocation = this.validLocation(res.latitude, res.longitude)
+        wx.request({
+          url: api.checkPositionUrl,
+          method: 'GET',
+          data: {
+            latitude: res.latitude,
+            longitude: res.longitude
+          },
+          success: res => {
+            if (res.data.status == 'success' && res.data.result == 'ok') {
+              let validLocation = api.isTest ? true : false;
+              this.setData({
+                is_btn_disabled: validLocation
+              })
+            }
+          },
+        });
         this.setData({
           currentLatitude: res.latitude,
           currentLongitude: res.longitude,
-          accuracy: res.accuracy,
-          is_btn_disabled: !validLocation
+          accuracy: res.accuracy
         })
 
       }

+ 1 - 1
wechat/pages/mycourse/mycourse.wxml

xqd
@@ -8,7 +8,7 @@
 
     </view> 
     </zan-cell>
-    <zan-cell title="评价讲师" is-link url="/pages/rate/rate">
+    <zan-cell title="评价讲师" is-link url="/pages/rate/rate?course_name={{ courseInfo.course_name }}&teacher={{ courseInfo.teacher_names }}">
     <view slot="footer">
       <text class="text-new">NEW</text>
 

+ 22 - 3
wechat/pages/rate/rate.js

xqd
@@ -1,9 +1,28 @@
 
 var app = getApp()
+var api = require('../../utils/api.js');
+
 Page({
-  
-  onLoad: function () {
-    console.log('onLoad')
+  data: {
+    titles: []
+  },
+  onLoad: function (options) {
+    let that = this;
+    console.log(options)
+    wx.request({
+      url: api.getRemarkTitlesUrl,
+      method: 'GET',
+      success: res => {
+        if (res.data.status == 'success') {
+          that.setData({
+            titles: res.data.titles
+          })
+        }
+      }
+    })
+  },
+  formSubmit: function (e) {
+
   },
   onSubmit: function() {
     wx.navigateTo({url: '/pages/rate-review/rate-review'})

+ 26 - 35
wechat/pages/rate/rate.wxml

xqd
@@ -1,39 +1,30 @@
 <zan-panel title='课程名称:成人钢琴培训初级\n讲师姓名:余军'>
-  <view>
+  <form bindsubmit="formSubmit">
     <view>
-      <zan-cell title="Q1:礼貌礼仪/精神面貌">
-        <zan-field
-          placeholder="(满分10.0)"
-          value="{{ field.value }}"
-          type="digit"
-        >
-        </zan-field>
-      </zan-cell>
+      <view>
+        <zan-cell title="Q1:礼貌礼仪/精神面貌">
+          <zan-field placeholder="(满分10.0)" value="{{ field.value }}" type="digit">
+          </zan-field>
+        </zan-cell>
+      </view>
+      <view>
+        <zan-cell title="Q2:准备充分,技巧成熟">
+          <zan-field placeholder="(满分10.0)" value="{{ field.value }}" type="digit">
+          </zan-field>
+        </zan-cell>
+      </view>
+      <view>
+        <zan-cell title="Q3:使用清楚、容易理解的语言讲解">
+          <zan-field placeholder="(满分10.0)" value="{{ field.value }}" type="digit">
+          </zan-field>
+        </zan-cell>
+      </view>
+      <zan-cell></zan-cell>
+      <zan-cell></zan-cell>
+      <zan-button-group>
+        <!-- <zan-button type="primary" bindtap="onSubmit">提交</zan-button> -->
+        <button formType="submit" type='primary' class='submit-btn'>提交</button>
+      </zan-button-group>
     </view>
-    <view>
-      <zan-cell title="Q2:准备充分,技巧成熟">
-        <zan-field
-          placeholder="(满分10.0)"
-          value="{{ field.value }}"
-          type="digit"
-        >
-        </zan-field>
-      </zan-cell>
-    </view>
-    <view>
-      <zan-cell title="Q3:使用清楚、容易理解的语言讲解">
-        <zan-field
-          placeholder="(满分10.0)"
-          value="{{ field.value }}"
-          type="digit"
-        >
-        </zan-field>
-      </zan-cell>
-    </view>
-    <zan-cell></zan-cell>
-    <zan-cell></zan-cell>
-    <zan-button-group>
-      <zan-button type="primary" bindtap="onSubmit">提交</zan-button>
-    </zan-button-group>
-  </view>
+  </form>
 </zan-panel>

+ 1 - 1
wechat/utils/api.js

xqd
@@ -11,5 +11,5 @@ module.exports = {
   getMoreVideosUrl: headUrl + 'getMoreVideos',
   getCourseInfoUrl: headUrl + 'getCourseInfo',
   getMyLearnInfoUrl: headUrl + 'getMyLearnInfo',
-  applyLeaveUrl: headUrl + 'applyLeave',
+  getRemarkTitlesUrl: headUrl + 'getRemarkTitles',
 }