Sfoglia il codice sorgente

Signed-off-by: Changpeng Duan <838560574@qq.com>

Changpeng Duan 5 anni fa
parent
commit
b674fd2aeb

+ 6 - 0
app/src/api/getApiRes.js

@@ -71,5 +71,11 @@ export function PhoneSignIn(postdata) {
     return getApiBasic(url,postdata);
 }
 
+// 用户微信绑定
+export function WXBind(postdata) {
+    let url = headapi + '/v1/Auth/WXBind';
+    return getApiBasic(url,postdata);
+}
+
 
 

+ 22 - 6
app/src/page/login.vue

@@ -43,6 +43,7 @@
         GenVerifyPic,
         GetPhoneVFCode,
         PhoneSignIn,
+        WXBind,
         testSelect
     } from '../api/getApiRes.js'
 
@@ -121,7 +122,7 @@
             // alert(document.body.clientWidth);
             this.getValImgSrc();
             this.overtime = new Date();
-            // this.checkcode();
+            this.checkcode();
         },
         methods: {
             // 获取CODE
@@ -146,7 +147,7 @@
                 let appid = 'wx685402342cfa5650';//测试
                 let state = '123';
                 let url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + urlNow + '&response_type=code&scope=' + scope + '&state=' + state + '#wechat_redirect';
-                self.location = url
+                self.location = url;
             },
             getUrlKey(name) {
                 return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
@@ -287,20 +288,35 @@
                 PhoneSignIn(postdata).then(res => {
                     if (res.Code == 0) {
                         that.res = res.Rs;
-                        localStorage.userName = username;
                         localStorage.token = res.Rs.token;
-                        that.$router.push({path: '/'});
+                        that.bindWx();
                     } else {
                         if (res.Code == 10005) {
                             that.$refs.userpwd.value = '';
-                            that.Toast( '密码错误,请重新输入');
+                            that.Toast('密码错误,请重新输入');
                         } else {
-                            that.Toast( res.Memo + ',错误代码:' + res.Code);
+                            that.Toast(res.Memo + ',错误代码:' + res.Code);
                             that.form.valid = '';
                         }
                     }
                 })
             },
+            bindWx() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    code: localStorage.code,
+                };
+                let postdata = qs.stringify(param);
+                WXBind(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$router.push({path: '/'});
+                    } else {
+                        that.Toast(res.Memo + ',错误代码:' + res.Code);
+                    }
+                })
+            },
             getUserInfo(token) {
                 let that = this;
                 let param = {

+ 6 - 2
pc/README.md

@@ -98,6 +98,10 @@ e.运行
   1.首页
     全部todo
     
-  2.    
-        
+    
+  2. 会员类都是贾的 
+     会员首页统计,消费记录,
+     
+  3.操作日志
+   全部todo 放在最后      
       

+ 11 - 3
pc/src/views/EditLessonTable.vue

@@ -336,7 +336,11 @@
                     for (let j = 0; j < this.tabs[i].tableData.length; j++) {
                         thisRow = this.tabs[i].tableData[j];
                         thisRow.lessonIndex = parseInt(j);
-                        thisRow.PlanId = parseInt(this.$route.query.id);
+                        if(planId){
+                            thisRow.PlanId = parseInt(planId);
+                        }else{
+                            thisRow.PlanId = parseInt(this.$route.query.id);
+                        }
                         thisRow.WeekDay = parseInt(i + 1);
                         thisRow.BeginStr = getHoursAndMin(thisRow.timeLong[0]);
                         thisRow.EndStr = getHoursAndMin(thisRow.timeLong[1]);
@@ -346,6 +350,7 @@
                         planRs.push(thisRow)
                     }
                 }
+
                 let res = JSON.stringify(planRs);
                 // 如果传入0就用url里的,如果非0就用传入的
                 // let uploadPlanId = planId == 0 ? this.$route.query.id : planId;
@@ -444,11 +449,14 @@
                             // 遍历分配
                             Rs.map(function (item) {
                                 for (let i = 0; i < 7; i++) {
-                                    if (item.WeekDay == i) {
+                                    if (item.WeekDay == i+1) {
                                         bt = new Date(2016, 9, 10, item.BeginStr.substr(0, 2), item.BeginStr.substr(3, 2));
                                         et = new Date(2016, 9, 10, item.EndStr.substr(0, 2), item.EndStr.substr(3, 2));
                                         item.timeLong = [bt, et];
-                                        that.tabs[i - 1].tableData.push(item);
+                                        // that.tabs[i - 1].tableData.push(item);
+                                        // tabs[0]是周一
+                                        that.tabs[i].tableData.push(item);
+
                                     }
                                 }
                             })

+ 40 - 15
pc/src/views/lessonManage.vue

@@ -36,16 +36,16 @@
                         <div class="rowHeight">
 <!--                            未上线-->
                         <span class="readyTime" v-if="scope.row.Online == 0">
-                               {{scope.row.Name}}
+                               {{scope.row.BeginDate}} - {{scope.row.EndDate}}
                         </span>
 <!--                            已上线-->
                         <span class="CurTime" v-if="scope.row.Online == 1">
-                           {{scope.row.Name}}
+                             {{scope.row.BeginDate}} - {{scope.row.EndDate}}
                         </span>
 <!--                            当前进行-->
                             <i class="curIcon" v-if="scope.row.Status == 1 && scope.row.Online == 1"></i>
                             <span class="runTime" v-if="scope.row.Status == 2 && scope.row.Online == 1">
-                            {{scope.row.Name}}
+                              {{scope.row.BeginDate}} - {{scope.row.EndDate}}
                         </span>
                         </div>
                     </template>
@@ -62,6 +62,23 @@
                         sortable
                 >
                 </el-table-column>
+                <el-table-column
+                        prop="Online"
+                        label="是否上线"
+                >
+<!--                    上线状态	0:不上线 1:下线-->
+                    <template slot-scope="scope">
+                        <el-switch
+                                v-model="scope.row.Online"
+                                :active-value="0"
+                                :inactive-value="1"
+                                active-color="#409EFF"
+                                inactive-color="#D9D9D9"
+                                @change=changeWechat($event,scope.row)
+                        >
+                        </el-switch>
+                    </template>
+                </el-table-column>
                 <el-table-column
                         prop="Status"
                         label="操作"
@@ -132,6 +149,8 @@
     import Global from '../Global.js'
     import {
         STTBasicListQuery,
+        STTBasicOfflineEdit,
+        STTBasicStatusEdit,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -193,11 +212,11 @@
                     return false
                 }
 
-                let detectorid = that.multipleSelection[0].Id;
+                let row = that.multipleSelection[0];
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
+                    stbId : row.StbId ,
                     status: 9,//0禁用1启用9删除
                 };
                 let postdata = qs.stringify(param);
@@ -207,12 +226,12 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    testSelect(postdata).then(res => {
+                    STTBasicStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
                                 showClose: true,
-                                message: '选中的会员已删除!',
+                                message: '选中的课程表已删除!',
                                 type: 'success'
                             });
                             // 重载列表
@@ -451,21 +470,21 @@
                 let that = this;
                 return parseFloat(column).toFixed(2);
             },
-            // 微信可见与否
+            // 课程表上下线状态修改
             changeWechat(e, row) {
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    id: row.id,//
-                    wxVisible: e,//
+                    stbId : row.StbId,//
+                    online : e,//
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                STTBasicOfflineEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.$message({
                             showClose: true,
-                            message: '当前用户微信已' + json.Memo,
+                            message: '当前课程表已' + json.Memo,
                             type: 'success'
                         });
                         // 重载列表
@@ -569,6 +588,8 @@
 
     .readyTime {
         width: 90%;
+        height: 30px;
+        line-height: 30px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
@@ -580,6 +601,8 @@
 
     .CurTime {
         width: 90%;
+        height: 27px;
+        line-height: 30px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
@@ -592,6 +615,8 @@
 
     .runTime {
         width: 90%;
+        height: 30px;
+        line-height: 30px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
@@ -604,8 +629,8 @@
 
     .curIcon {
         position: relative;
-        left: 3px;
-        top: -30px;
+        left: 4px;
+        top: -34px;
         width: 24px;
         height: 24px;
         float: left;
@@ -613,7 +638,7 @@
         background-size: 100% 100%;
     }
     .rowHeight {
-        width: 180px;
+        width: 220px;
         overflow: hidden;
         display: block;
         height: 35px;