Browse Source

屏蔽网课

Changpeng Duan 4 years ago
parent
commit
58299693a2
4 changed files with 51 additions and 122 deletions
  1. 4 4
      online/src/Mock/index.js
  2. 1 99
      online/src/api/getApiRes.js
  3. 34 6
      online/src/page/login.vue
  4. 12 13
      pc/src/views/courseEdit.vue

+ 4 - 4
online/src/Mock/index.js

@@ -25,7 +25,7 @@ let worldDetail = function () {
 
 let testPic = function () {
     let res = {
-        pic:  Random.image('200x100', '#894FC4', '#FFF', '@natural(1111, 9999)'),
+        pic: Random.image('200x100', '#894FC4', '#FFF', '@natural(1111, 9999)'),
         id: "@guid",
         Code: 0,
         Memo: ''
@@ -66,7 +66,7 @@ let testTable = function () {
             "members": members,
             "wxVisible": "@integer(0, 1)",
             "timeLong": "14:00-16:00",
-            "timeScope":  [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
+            "timeScope": [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
         })
     }
 
@@ -96,7 +96,7 @@ let testSelect = function () {
     return res;
 };
 
-let SignIn = function () {
+let PhoneSignIn = function () {
 
     let Rs = {
         token: "@guid"
@@ -137,7 +137,7 @@ Mock.mock('/api/testPic', 'post', testPic());
 Mock.mock('/api/testSelect', 'post', testSelect());
 Mock.mock('/api/testTable', 'post', testTable());
 Mock.mock('/api/worldDetail', 'post', worldDetail());
-Mock.mock('/api/SignIn', 'post', SignIn());//用户登录
+Mock.mock(headapi + 'v1/Auth/PhoneSignIn', 'post', PhoneSignIn());//用户登录
 Mock.mock('/api/editbasicinfo', 'post', editbasicinfo());//用户设置修改
 Mock.mock('/api/modPwd', 'post', modPwd());//密码修改
 Mock.mock('/api/logout', 'post', logout());//退出登陆

+ 1 - 99
online/src/api/getApiRes.js

@@ -61,11 +61,7 @@ export function GetPhoneVFCode(postdata) {
     return getApiBasic(url, postdata);
 }
 
-export function SignIn(postdata) {
-    let url = headapi + 'v1/Auth/SignIn';
-    return getApiBasic(url,postdata);
-}
-// 手机登录
+// 用户手机验证码登陆
 export function PhoneSignIn(postdata) {
     let url = headapi + 'v1/Auth/PhoneSignIn';
     return getApiBasic(url,postdata);
@@ -77,97 +73,3 @@ export function UserSelfQuery(postdata) {
     return getApiBasic(url,postdata);
 }
 
-// // 用户微信绑定
-// export function WXBind(postdata) {
-//     let url = headapi + 'v1/Auth/WXBind';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 用户微信登录
-// export function WXSignIn(postdata) {
-//     let url = headapi + 'v1/Auth/WXSignIn';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 用户微信解除绑定
-// export function WXUnbind(postdata) {
-//     let url = headapi + 'v1/Auth/WXUnbind';
-//     return getApiBasic(url,postdata);
-// }
-//
-//
-// // Weixin
-//
-// // 预约课程
-// export function OderAddByVipUser(postdata) {
-//     let url = headapi + 'v1/Weixin/OderAddByVipUser';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 取消预约
-// export function OderCancelByVipUser(postdata) {
-//     let url = headapi + 'v1/Weixin/OderCancelByVipUser';
-//     return getApiBasic(url,postdata);
-// }
-// // 预约记录查询
-// export function OrderListQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/OrderListQuery';
-//     return getApiBasic(url,postdata);
-// }
-// // 可预约店铺信息查询
-// export function OrderShopQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/OrderShopQuery';
-//     return getApiBasic(url,postdata);
-// }
-// // 可预约课程列表查询(未完成)
-// export function CanOrderSchoolTimeTableListQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/CanOrderSchoolTimeTableListQuery';
-//     return getApiBasic(url,postdata);
-// }
-// // 消费记录查询
-// export function VipUserConsumeListQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/VipUserConsumeListQuery';
-//     return getApiBasic(url,postdata);
-// }
-// // 用户自身信息查询
-// export function VipUserSelfQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/VipUserSelfQuery';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 某日课程表查询
-// export function SchoolTimeQueryByDate(postdata) {
-//     let url = headapi + 'v1/Weixin/SchoolTimeQueryByDate';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 通过session查询用户自身信息
-// export function ManagerSelfQuery(postdata) {
-//     let url = headapi + 'v1/User/ManagerSelfQuery';
-//     return getApiBasic(url,postdata);
-// }
-//
-// // 课程表预览
-// export function SchoolTimetablePreview(postdata) {
-//     let url = headapi + 'v1/SchoolTimeTable/SchoolTimetablePreview';
-//     return getApiBasic(url, postdata);
-// }
-// // CleCk查询
-// export function VipUserCleCkSum(postdata) {
-//     let url = headapi + 'v1/Weixin/VipUserCleCkSum';
-//     return getApiBasic(url, postdata);
-// }
-// // 查询下周是否有课
-// export function QueryNextWeek(postdata) {
-//     let url = headapi + 'v1/Weixin/QueryNextWeek';
-//     return getApiBasic(url, postdata);
-// }
-//
-//
-// // 用户店铺信息查询
-// export function MyShopQuery(postdata) {
-//     let url = headapi + 'v1/Weixin/MyShopQuery';
-//     return getApiBasic(url, postdata);
-// }
-//
-//

+ 34 - 6
online/src/page/login.vue

@@ -4,7 +4,7 @@
             <img src="../static/images/login/head.png"/>
         </div>
         <div class="control" v-if="controlShow">
-            <mu-text-field v-model="input" placeholder="|请输入手机号"></mu-text-field>
+            <mu-text-field v-model="input" placeholder="|请输入手机号" @keyup.enter.native="CheckPhone()"></mu-text-field>
             <mu-button color="info" small round v-if="btnShow" @click="errorToast">继续</mu-button>
             <mu-button color="primary" small round v-else @click="stepVertify">继续</mu-button>
         </div>
@@ -35,7 +35,7 @@
     import '../Global'
     import {
         GetPhoneVFCode,
-        SignIn,
+        PhoneSignIn	,
     } from '../api/getApiRes.js'
 
     let qs = require('qs');
@@ -83,6 +83,18 @@
             },
         },
         methods: {
+            CheckPhone() {
+                let that = this;
+                let newName = that.input;
+                // 校验手机号格式
+                if (globalCheckPhone(newName)) {
+                    that.btnShow = false;
+                    that.stepVertify();
+                } else {
+                    that.btnShow = true;
+                    that.errorToast();
+                }
+            },
             errorToast() {
                 this.Toast('手机号格式不正确');
             },
@@ -90,9 +102,24 @@
                 this.Toast('验证码不正确');
             },
             success() {
+                let that = this;
                 this.vertifyShow = false;
                 this.codeShow = true;
-                // todo 发送验证码
+                // 发送验证码
+                let param = {
+                    token: localStorage.token,
+                    phone: that.input,
+                    codeType: 1// 短信类型 1:登录
+                };
+                let postdata = qs.stringify(param);
+                GetPhoneVFCode(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        this.Toast('短信已发送', 'success');
+                    } else {
+                        this.Toast(json.Memo);
+                    }
+                })
             },
             stepVertify() {
                 this.btnShow = false;
@@ -103,17 +130,18 @@
                 // login ajax todo
                 let that = this;
                 let param = {
-                    token: localStorage.token,
+                    phone: that.input,
+                    smsCode: that.vcode,
                 };
                 let postdata = qs.stringify(param);
-                SignIn(postdata).then(res => {
+                PhoneSignIn(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         this.tipsState = true;
                         this.$router.push({path: '/'});
                     } else {
                         this.tipsState = true;
-                        that.$message.error(json.Memo);
+                        this.Toast(json.Memo);
                     }
                 })
             },

+ 12 - 13
pc/src/views/courseEdit.vue

@@ -207,7 +207,6 @@
                                         :value="item.HrId">
                                 </el-option>
                             </el-select>
-
                             <el-button @click="takeTempBack(scope.row)" type="danger" v-if="scope.row.Sn"
                                        :disabled="scope.row.isOnline == 1"
                                        icon="el-icon-cpu">
@@ -217,18 +216,18 @@
                         </div>
                     </template>
                 </el-table-column>
-                <el-table-column
-                        prop="isOnline"
-                        label="是否网课"
-                        type="selection"
-                        width="120"
-                        sortable
-                >
-                    <!--<template slot-scope="scope">-->
-                    <!--<el-checkbox label="网课" v-model="scope.row.isOnline" name="type"-->
-                    <!--@change="showOrDiss(scope.row)"></el-checkbox>-->
-                    <!--</template>-->
-                </el-table-column>
+                <!--<el-table-column-->
+                        <!--prop="isOnline"-->
+                        <!--label="是否网课"-->
+                        <!--type="selection"-->
+                        <!--width="120"-->
+                        <!--sortable-->
+                <!--&gt;-->
+                    <!--&lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
+                    <!--&lt;!&ndash;<el-checkbox label="网课" v-model="scope.row.isOnline" name="type"&ndash;&gt;-->
+                    <!--&lt;!&ndash;@change="showOrDiss(scope.row)"></el-checkbox>&ndash;&gt;-->
+                    <!--&lt;!&ndash;</template>&ndash;&gt;-->
+                <!--</el-table-column>-->
                 <el-table-column
                         prop="Status"
                         label="状态"