Browse Source

fix(update): 修复统一bug

Go 4 years ago
parent
commit
39a38f10bb

+ 4 - 4
front/project/h5/routes/page/invitation/page.js

@@ -23,8 +23,8 @@ export default class extends Page {
       .then((wx) => {
         const { info } = this.props.user;
         wx.onMenuShareAppMessage({
-          title: '千行GMAT', // Share title
-          desc: '', // Share description
+          title: '千行GMAT 好友邀请连接', // Share title
+          desc: '点击邀请连接', // Share description
           link: `${H5Url}/id/${info.inviteCode}`, // Share Link,this link domain name and path must be the same as the current page which corresponding to JS secured domain name as Official account
           imgUrl: '', // Share Icon
           type: 'link', // Share type, music, video link, not filled default link
@@ -87,9 +87,9 @@ export default class extends Page {
             <div>2.发送给朋友</div>
           </div>
         </div>
-        <Button className="go" block width={110} radius>
+        {/* <Button className="go" block width={110} radius>
           去邀请
-        </Button>
+        </Button> */}
         <div className="title">邮件邀请</div>
         <Input placeholder="添加多个邮箱,请用「;」间隔" value={this.state.email || ''} onChange={(e) => {
           const { value } = e.target;

+ 1 - 1
front/project/h5/routes/page/study/page.js

@@ -25,7 +25,7 @@ export default class extends Page {
   }
 
   renderView() {
-    const { total, latest = {}, diff = 0, diffPercent = 0, diffLast = 0, diffLastPercent = 0 } = this.state;
+    const { total = {}, latest = {}, diff = 0, diffPercent = 0, diffLast = 0, diffLastPercent = 0 } = this.state;
     return (
       <div>
         <div className="block">

+ 3 - 0
front/project/www/components/Other/index.less

@@ -76,6 +76,9 @@
     display: inline-block;
     box-sizing: border-box;
     vertical-align: top;
+    background: none;
+    height: auto;
+    line-height: inherit;
 
     .title {
       font-size: 16px;

+ 11 - 1
front/project/www/routes/page/export/index.less

@@ -14,6 +14,10 @@
     background: #F7F8FCFF;
   }
 
+  .water {
+    display: none;
+  }
+
   .detail-layout {
     background: #fff;
     padding-top: 20px;
@@ -121,7 +125,13 @@
 
 @media print {
   #export .content {
-    width: 600px !important;
+    width: 595px !important;
+  }
+
+  #export .water {
+    display: block;
+    position: absolute;
+    color: rgba(0, 0, 0, 0.2);
   }
 
   body {

+ 36 - 3
front/project/www/routes/page/export/page.js

@@ -19,7 +19,11 @@ const ExportType = [
 ];
 const ExportTypeMap = getMap(ExportType, 'value', 'label');
 const AnswerIndex = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'];
-
+const width = 595;
+const height = 1050;
+const top = 72;
+const left = 93;
+const size = 10;
 export default class extends Page {
   initState() {
     const { info } = this.props.user;
@@ -34,6 +38,30 @@ export default class extends Page {
     My.exportDetail(id)
       .then(result => {
         this.setState({ data: result });
+        setTimeout(() => {
+          const { waters } = result;
+          const waterList = [];
+          const pageSize = Math.ceil(this.view.offsetHeight / height);
+          console.log(pageSize, this.view.offsetHeight);
+          for (let i = 0; i < pageSize; i += 1) {
+            const a = [top, (height / 2 - top) / 2 - size / 2 + top, height / 2 - size / 2, (height / 2 + (height - top - height / 2) / 2) - size / 2, height - top - size];
+            for (let j = 0; j < 5; j += 1) {
+              waterList.push({
+                style: { left, top: a[j] + height * i, textAlign: 'left' },
+                text: waters[0],
+              });
+              waterList.push({
+                style: { left: width / 2, top: a[j] + height * i, textAlign: 'center' },
+                text: waters[1],
+              });
+              waterList.push({
+                style: { left: width - left, top: a[j] + height * i, textAlign: 'right' },
+                text: waters[0],
+              });
+            }
+          }
+          this.setState({ waterList });
+        }, 1000);
       });
   }
 
@@ -50,9 +78,14 @@ export default class extends Page {
   }
 
   renderView() {
-    const { data = {}, showTip, nextTips } = this.state;
+    const { data = {}, showTip, nextTips, waterList = [] } = this.state;
     return (
-      <div>
+      <div ref={(ref) => {
+        if (ref) this.view = ref;
+      }}>
+        {waterList.map(row => {
+          return <div className="water" style={row.style}>{row.text}</div>;
+        })}
         {this.renderHead()}
         {data.type !== 'note_course' && this.renderQuestion()}
         {data.type === 'note_course' && this.renderNote()}

+ 25 - 14
front/project/www/routes/paper/process/base/index.js

@@ -304,7 +304,7 @@ export default class extends Component {
           </div>
         </div>
         <div className="layout-footer">
-          <div className="help">
+          <div className="help" onClick={() => this.showHelp()}>
             <Assets name="help_icon" />
             Help
           </div>
@@ -353,7 +353,7 @@ export default class extends Component {
         </div>
         <div className={'layout-body'}>{paper.isAdapt > 1 ? this.renderExaminationStartCAT() : this.renderExaminationStartDefault()}</div>
         <div className="layout-footer">
-          <div className="help">
+          <div className="help" onClick={() => this.showHelp()}>
             <Assets name="help_icon" />
             Help
           </div>
@@ -544,8 +544,8 @@ export default class extends Component {
           </div>
         </div>
         <div className="layout-footer">
-          <div className="help">
-            <Assets name="help_icon" onClick={() => this.showHelp()} />
+          <div className="help" onClick={() => this.showHelp()}>
+            <Assets name="help_icon" />
             Help
           </div>
           <div className="full">
@@ -589,16 +589,27 @@ export default class extends Component {
   }
 
   renderHelp() {
-    // const { helpInfo } = this.state;
+    return (
+      <div className="modal show-help">
+        <div className="mask" />
+        <div style={{ width: 540 }} className="body">
+          <div className="title">
+            <div className="help">
+              <Assets name="help_icon" />Help
+            </div>
+            <div className="close"><Assets name="close" onClick={() => this.setState({ showHelp: false })} /></div>
+          </div>
+          <div className="desc">
+            <ul>
+              <li>点击右上角的时钟图标<div className="icon"><Assets name="timeleft_icon" /></div>可以打开和关闭计时器(与实战一致);</li>
+              <li>点击右上角的进度条<div className="icon"><Assets name="subjectnumber_icon" /></div>可以打开和关闭当前进度(与实战一致);</li>
+              <li>点击右下角<div className="next">Next<Assets name="next_icon" /></div>进入下一题(与实战一致);</li>
+              <li>点击右上角的<div className="icon"><Icon name="star" /></div>可以收藏本题,可至“个人中心-收藏” 查看。</li>
+            </ul>
 
-    // return (
-    //   <div className="modal">
-    //     <div className="mask" />
-    //     <div style={{ width: modal.width }} className="body">
-    //       <div className="title">{modal.title}</div>
-    //       <div className="desc">{modal.desc}</div>
-    //     </div>
-    //   </div>
-    // );
+          </div>
+        </div>
+      </div>
+    );
   }
 }

+ 46 - 0
front/project/www/routes/paper/process/base/index.less

@@ -493,4 +493,50 @@
       }
     }
   }
+
+  .show-help {
+    .help {
+      padding: 0 10px;
+      display: inline-block;
+      cursor: pointer;
+
+      .assets {
+        margin-right: 10px;
+      }
+    }
+
+    .close {
+      position: absolute;
+      right: 10px;
+      top: -3px;
+    }
+
+    .next {
+      padding: 0 10px;
+      cursor: pointer;
+      box-sizing: border-box;
+      height: 35px;
+      display: inline-block;
+    }
+
+    .icon {
+      padding: 0 10px;
+      cursor: pointer;
+      box-sizing: border-box;
+      height: 35px;
+      display: inline-block;
+    }
+
+    .body {
+      .title {
+        padding-left: 10px;
+      }
+
+      .desc {
+        text-align: left;
+        padding: 0 10px;
+      }
+    }
+  }
+
 }

+ 1 - 0
front/project/www/routes/paper/process/page.js

@@ -101,6 +101,7 @@ export default class extends Page {
       if (report.isFinish) {
         return this.finish();
       }
+      this.changeQuery({ r: report.id });
       this.setState({ report, scene: 'question' });
       // 开始统计做题进度
       if (report.paperModule === 'examination') {

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

@@ -2111,7 +2111,7 @@ public class MyController {
 
     @RequestMapping(value = "/export/detail", method = RequestMethod.GET)
     @ApiOperation(value = "导出详情", notes = "导出详情", httpMethod = "GET")
-    public Response<UserExport> exportDetail(int id)  {
+    public Response<UserExportDto> exportDetail(int id)  {
         User user = (User) shiroHelp.getLoginUser();
         UserExport entity = userExportService.get(id);
         if (!user.getId().equals(entity.getUserId())){
@@ -2120,7 +2120,7 @@ public class MyController {
         UserExportDto dto = Transform.convert(entity, UserExportDto.class);
         // 签名信息:同pdfHelp
         dto.setWaters(pdfHelp.getUserWater(user));
-        return ResponseHelp.success(entity);
+        return ResponseHelp.success(dto);
     }
 
     @RequestMapping(value = "/export/tips", method = RequestMethod.POST)

+ 3 - 3
server/gateway-api/src/main/java/com/qxgmat/dto/response/UserExportDto.java

@@ -15,7 +15,7 @@ public class UserExportDto {
 
     private Integer no;
 
-    private Integer type;
+    private String type;
 
     private JSONObject setting;
 
@@ -65,11 +65,11 @@ public class UserExportDto {
         this.content = content;
     }
 
-    public Integer getType() {
+    public String getType() {
         return type;
     }
 
-    public void setType(Integer type) {
+    public void setType(String type) {
         this.type = type;
     }
 

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

@@ -238,7 +238,7 @@ public class ExportService {
 
     private List<UserQuestionRelation> listByQuestionNoIds(Integer userId, Collection questionNoIds, boolean needAnswer){
         List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
-        Collection questionIds = Transform.getIds(questionNoList, QuestionNo.class, "id");
+        Collection questionIds = Transform.getIds(questionNoList, QuestionNo.class, "questionId");
 
         List<UserQuestion> userQuestionList = null;
         if (needAnswer){
@@ -270,11 +270,11 @@ public class ExportService {
             questionIdsMap.put(q.getId(), q.getAssociationContent());
         }
         Map questionMap = questionService.groupByMap(questionIdsMap);
-        Transform.combine(relationList, questionMap, UserQuestionRelation.class, "id", "associations");
+        Transform.combine(relationList, questionMap, UserQuestionRelation.class, "questionId", "associations");
 
         // 相关问答
         Map<Object, Collection<UserAskQuestion>> userAskMap = userAskQuestionService.groupByQuestionNo(questionIds);
-        Transform.combine(relationList, userAskMap, UserQuestionRelation.class, "id", "asks");
+        Transform.combine(relationList, userAskMap, UserQuestionRelation.class, "questionId", "asks");
 
         // 笔记
         List<UserNoteQuestion> userNoteQuestionList = userNoteQuestionService.listByUserAndQuestions(userId, questionIds);