瀏覽代碼

fix(front): 修复样式

Go 4 年之前
父節點
當前提交
e206aa7685

+ 2 - 0
front/project/Constant.js

@@ -150,6 +150,8 @@ export const MessageType = [
 
 export const FaqChannel = [
   { label: 'GetReady', value: 'getready' },
+  { label: '练习', value: 'exercise' },
+  { label: '预习作业', value: 'preview', parent: 'exercise' },
   { label: '模考', value: 'examination' },
   { label: 'CAT难度适应性', value: 'cat', parent: 'examination' },
   { label: '非CAT', value: 'base', parent: 'examination' },

+ 1 - 1
front/project/admin/routes/show/comment/page.js

@@ -179,7 +179,7 @@ export default class extends Page {
 
   initData() {
     if (!this.state.search.order) {
-      this.state.search.order = 'order';
+      this.state.search.order = 'sort';
       this.state.search.direction = 'desc';
     }
     System.listComment(Object.assign({ isSpecial: true }, this.state.search)).then(result => {

+ 1 - 1
front/project/admin/routes/show/faq/page.js

@@ -165,7 +165,7 @@ export default class extends Page {
 
   initData() {
     if (!this.state.search.order) {
-      this.state.search.order = 'order';
+      this.state.search.order = 'sort';
       this.state.search.direction = 'desc';
     }
     System.listFAQ(Object.assign({ isSpecial: true }, this.state.search)).then(result => {

+ 1 - 0
front/project/www/components/QAList/index.js

@@ -14,6 +14,7 @@ class QAItem extends Component {
 
   checkHeight() {
     if (this.Text != null) {
+      console.log(this.Text.offsetHeight);
       if (this.Text.offsetHeight > 80) {
         this.setState({ more: true });
       }

+ 3 - 2
front/project/www/components/QAList/index.less

@@ -10,6 +10,7 @@
   .qa-item {
     border-bottom: 1px solid rgba(239, 243, 247, 1);
     position: relative;
+    padding-top: 10px;
 
     .title {
       color: #303036;
@@ -43,7 +44,7 @@
     }
   }
 
-  .other-answer.more.hide {
+  .qa-item.more.hide {
     .desc {
       height: 80px;
       background: linear-gradient(360deg, rgba(161, 161, 171, 0) 0%, rgba(104, 104, 114, 1) 100%);
@@ -52,7 +53,7 @@
     }
   }
 
-  .other-answer.more:hover {
+  .qa-item.more:hover {
     .icon {
       display: block;
     }

+ 15 - 3
front/project/www/routes/course/experience/page.js

@@ -200,7 +200,13 @@ class Article extends Component {
   onCollect() {
     const { data } = this.props;
     const { collect } = this.state;
-    if (collect === false || !data.collect) {
+    let collectStatus = false;
+    if (collect !== undefined) {
+      collectStatus = collect;
+    } else {
+      collectStatus = data.collect;
+    }
+    if (!collectStatus) {
       My.addExperienceCollect(data.id)
         .then(() => {
           this.setState({ collect: true });
@@ -216,6 +222,12 @@ class Article extends Component {
   render() {
     const { data } = this.props;
     const { collect } = this.state;
+    let collectStatus = false;
+    if (collect !== undefined) {
+      collectStatus = collect;
+    } else {
+      collectStatus = data.collect;
+    }
     return (
       <div className="article-item p-t-2 b-b" onClick={() => linkTo(`/course/experience/detail/${data.id}`)}>
         <div className="t-1 t-s-14 f-w-b">
@@ -223,11 +235,11 @@ class Article extends Component {
           <div className="f-r t-3 t-s-12 f-w-d">
             <span>{data.updateTime && formatDate(data.updateTime, 'YYYY-MM-DD HH:mm:ss')}</span>
             <span className="m-l-2">阅读 {data.viewNumber}</span>
-            <span className="m-l-2" onClick={(e) => {
+            <span className="m-l-2 link" onClick={(e) => {
               e.stopPropagation();
               this.onCollect();
             }}>
-              {(collect === false || !data.collect) ? '收藏' : '取消收藏'}
+              {collectStatus ? '收藏' : '取消收藏'}
             </span>
           </div>
         </div>

+ 14 - 2
front/project/www/routes/course/experienceDetail/page.js

@@ -28,7 +28,13 @@ export default class extends Page {
   onCollect() {
     const { data } = this.state;
     const { collect } = this.state;
-    if (collect === false || !data.collect) {
+    let collectStatus = false;
+    if (collect !== undefined) {
+      collectStatus = collect;
+    } else {
+      collectStatus = data.collect;
+    }
+    if (!collectStatus) {
       My.addExperienceCollect(data.id)
         .then(() => {
           this.setState({ collect: true });
@@ -43,6 +49,12 @@ export default class extends Page {
 
   renderView() {
     const { data = {}, collect } = this.state;
+    let collectStatus = false;
+    if (collect !== undefined) {
+      collectStatus = collect;
+    } else {
+      collectStatus = data.collect;
+    }
     return (
       <div>
         <div className="center">
@@ -52,7 +64,7 @@ export default class extends Page {
               <span className="m-r-2">{data.updateTime && formatDate(data.updateTime, 'YYYY-MM-DD HH:mm:ss')}</span>
               <span className="m-r-2 m-l-1">阅读 {data.viewNumber || 0}</span>
               <span className="m-l-1" onClick={() => this.onCollect()}>
-                {(collect === false || !data.collect) ? '收藏' : '取消收藏'}
+                {!collectStatus ? '收藏' : '取消收藏'}
               </span>
             </div>
             <div className="t-1">

+ 4 - 0
front/project/www/routes/course/main/index.less

@@ -125,4 +125,8 @@
   .block-5 {}
 
   .block-6 {}
+
+  .other-answer-carousel {
+    padding-top: 40px;
+  }
 }

+ 1 - 1
front/project/www/routes/course/main/page.js

@@ -130,7 +130,7 @@ export default class extends Page {
               </div>
               <div className="t-8">从业8年,考取700+成绩10次。</div>
               <div className="t-4 ">
-                <div className="link d-i-b">查看成绩单 ></div>
+                <a className="link d-i-b" href="/course/experience" target="_blank">查看成绩单 ></a>
               </div>
             </div>
             <div className="item">

+ 1 - 1
front/project/www/routes/examination/list/page.js

@@ -666,7 +666,7 @@ export default class extends Page {
                 },
               },
             ]}
-            data={[{}, {}, {}] || list}
+            data={list}
             columns={this.qxCatColumns}
           />
         </div>

+ 1 - 4
front/project/www/routes/exercise/main/page.js

@@ -466,7 +466,7 @@ export default class extends Page {
       this.setState({ courseMap });
     });
 
-    Main.listFaq({ page: 1, size: 100, channel: 'preview' }).then(result => {
+    Main.listFaq({ page: 1, size: 100, channel: 'exercise-preview' }).then(result => {
       this.setState({ faqs: result.list });
     });
   }
@@ -536,9 +536,6 @@ export default class extends Page {
       });
       this.setState({ exerciseProgress: result });
     });
-    Main.listFaq({ page: 1, size: 100, channel: 'exercise' }).then(result => {
-      this.setState({ faqs: result.list });
-    });
   }
 
   onChangeTab(level, tab) {

+ 5 - 0
front/project/www/routes/textbook/main/index.less

@@ -183,5 +183,10 @@
 
   .other-answer-carousel {
     padding-top: 40px;
+    padding-bottom: 40px;
+
+    .tabs {
+      margin-bottom: 0px;
+    }
   }
 }

+ 20 - 14
front/project/www/routes/textbook/main/page.js

@@ -17,7 +17,7 @@ import { Main } from '../../../stores/main';
 import { Textbook } from '../../../stores/textbook';
 import { Order } from '../../../stores/order';
 import { User } from '../../../stores/user';
-import { TextbookFeedbackTarget } from '../../../../Constant';
+import { TextbookFeedbackTarget, TextbookSubject } from '../../../../Constant';
 
 const textbookHistoryColumns = [
   {
@@ -42,6 +42,13 @@ export default class extends Page {
       list: [],
       enroll: {},
       load: 0,
+      subject: TextbookSubject[0].value,
+      textbookSubject: TextbookSubject.map(row => {
+        return {
+          title: row.label,
+          key: row.value,
+        };
+      }),
     };
   }
 
@@ -66,6 +73,10 @@ export default class extends Page {
       list.push({ subject: 'rc', number: latest.rcNumber, time: latest.rcTime, version: latest.rcVersion });
       list.push({ subject: 'ir', number: latest.irNumber, time: latest.irTime, version: latest.irVersion });
       this.setState({ data: result, list });
+
+      if (!result.hasService && result.unUseRecord) {
+        this.textbookHistory({ subject: this.state.subject, showUpdate: false });
+      }
     });
   }
 
@@ -142,11 +153,11 @@ export default class extends Page {
       });
   }
 
-  textbookHistory({ page, size, subject }) {
+  textbookHistory({ page, size, subject, showUpdate = true }) {
     this.setState({ subject });
     Textbook.allHistory(subject).then(result => {
       this.setState({
-        showUpdate: true,
+        showUpdate,
         updateList: result.map(row => {
           row.version = row[`${subject}Version`];
           row.content = row[`${subject}Content`];
@@ -238,13 +249,12 @@ export default class extends Page {
           onTabChange={(key) => this.onTabChange(key)}
         />
         <CommentFalls list={comments} />
-        <Consultation />
+        <Consultation data={base.contact} />
         <Contact data={base.contact} />
         <Footer />
-
         <Modal show={showWarn} title={warn.title} confirmText="好的,知道了" btnAlign="center" onConfirm={() => this.setState({ showWarn: false })}>
           <div className="t-2 t-s-18">{warn.content}</div>
-        </Modal>,
+        </Modal>
         <Modal
           show={showUpdate}
           maskClosable
@@ -394,7 +404,7 @@ export default class extends Page {
   }
 
   renderLog() {
-    const { data, subject, updateList } = this.state;
+    const { data, subject, updateList, textbookSubject } = this.state;
     return (
       <div className="table-layout">
         <div className="content">
@@ -402,18 +412,14 @@ export default class extends Page {
             <span className="d-i-b t-1 t-s-18">更新日志</span>
             <Tabs
               type="text"
-              tabs={[{ title: '数学', key: 'quant' }, { title: '阅读RC', key: 'rc' }, { title: '逻辑IR', key: 'ir' }]}
+              tabs={textbookSubject}
               active={subject}
-              onTabChange={(key) => this.textbookHistory({ subject: key })}
+              onChange={(key) => this.textbookHistory({ subject: key, showUpdate: false })}
             />
           </div>
           <UserTable
             size="small"
-            columns={[
-              { title: '更新时间', key: 'date' },
-              { title: '版本', key: 'version' },
-              { title: '更新内容', key: 'content' },
-            ]}
+            columns={textbookHistoryColumns}
             data={updateList}
           />
           <Assets name="textbook_banner" onClick={() => this.open(data.unUseRecord.id)} />

+ 2 - 2
server/gateway-api/src/main/java/com/qxgmat/controller/api/MyController.java

@@ -1489,7 +1489,6 @@ public class MyController {
         UserFeedbackError entity = Transform.dtoToEntity(dto);
         User user = (User) shiroHelp.getLoginUser();
         entity.setUserId(user.getId());
-        entity.setModule(FeedbackModule.QUESTION.key);
         entity.setStatus(0);
 
         QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
@@ -1497,6 +1496,7 @@ public class MyController {
         QuestionModule questionModule = QuestionModule.WithQuestionNo(questionNoModule);
         entity.setQuestionModule(questionModule.key);
         entity.setQuestionNoId(questionNo.getId());
+        entity.setModuleId(questionNo.getQuestionId());
 
         Question question = questionService.get(questionNo.getQuestionId());
 
@@ -2141,7 +2141,7 @@ public class MyController {
 
         Date now = Tools.today();
         int day = Tools.getDayOfWeek(now);
-        Date start = Tools.addDate(now, -1 * (day + week * 7));
+        Date start = Tools.addDate(now, -6);
         Date end = Tools.addDate(start, 7);
 
         List<UserSearchHistory> p = userSearchHistoryService.listByUser(user.getId(), start, end);

+ 0 - 3
server/gateway-api/src/main/java/com/qxgmat/controller/api/TextbookController.java

@@ -261,9 +261,6 @@ public class TextbookController
         if (user == null){
             throw new AuthException("请先登录");
         }
-        if (!userServiceService.hasService(user.getId(), ServiceKey.TEXTBOOK)){
-            throw new ParameterException("没有机经查看权限");
-        }
         if (TextbookSubject.ValueOf(subject) == null){
             throw new ParameterException("科目错误");
         }

+ 11 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/admin/request/CommentDto.java

@@ -2,6 +2,7 @@ package com.qxgmat.dto.admin.request;
 
 import com.nuliji.tools.annotation.Dto;
 import com.qxgmat.data.dao.entity.Comment;
+import com.qxgmat.dto.extend.UserExtendDto;
 
 import java.util.Date;
 
@@ -15,6 +16,8 @@ public class CommentDto {
 
     private Integer userId;
 
+    private UserExtendDto user;
+
     private String nickname;
 
     private String avatar;
@@ -116,4 +119,12 @@ public class CommentDto {
     public void setIsSystem(Integer isSystem) {
         this.isSystem = isSystem;
     }
+
+    public UserExtendDto getUser() {
+        return user;
+    }
+
+    public void setUser(UserExtendDto user) {
+        this.user = user;
+    }
 }

+ 2 - 0
server/gateway-api/src/main/java/com/qxgmat/service/UserCollectExperienceService.java

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
@@ -51,6 +52,7 @@ public class UserCollectExperienceService extends AbstractService {
      * @return
      */
     public List<UserCollectExperience> listByUserAndExperiences(Integer userId, Collection ids){
+        if (ids == null || ids.size() == 0) return new ArrayList<>();
         Example example = new Example(UserCollectExperience.class);
         example.and(
                 example.createCriteria()

+ 5 - 3
server/gateway-api/src/main/java/com/qxgmat/service/extend/OrderFlowService.java

@@ -709,7 +709,7 @@ public class OrderFlowService {
             }
 
             record.setUseStartTime(startTime);
-            if (endTime!=null )record.setUseEndTime(endTime);
+            if (endTime!=null) record.setUseEndTime(endTime);
             return record;
         }));
 
@@ -1069,7 +1069,8 @@ public class OrderFlowService {
         }
 
         UseRecord callback = useRecordCallback.get(ProductType.ValueOf(in.getProductType()));
-        callback.callback(in);
+        in = callback.callback(in);
+        userOrderRecordService.edit(in);
         return in;
     }
 
@@ -1083,7 +1084,8 @@ public class OrderFlowService {
         }
 
         UseRecord callback = useRecordCallback.get(ProductType.ValueOf(in.getProductType()));
-        callback.callback(in);
+        in = callback.callback(in);
+        userOrderRecordService.edit(in);
     }
 
     /**