chengjie 7 年之前
父節點
當前提交
4f37f5201b

+ 1 - 1
app.js

@@ -14,7 +14,7 @@ App({
14
     this.globalData.systemInfo = wx.getSystemInfoSync();
14
     this.globalData.systemInfo = wx.getSystemInfoSync();
15
   },
15
   },
16
   globalData: {
16
   globalData: {
17
-    version: "1.0.6",
17
+    version: "1.0.7",
18
     IsProduction: true,
18
     IsProduction: true,
19
     ProgramID: 105,
19
     ProgramID: 105,
20
     AppID: "wx1fef080f74481cbd",
20
     AppID: "wx1fef080f74481cbd",

+ 1 - 0
app.json

@@ -7,6 +7,7 @@
7
     "pages/main/detail",
7
     "pages/main/detail",
8
     "pages/main/list",
8
     "pages/main/list",
9
     "pages/main/errorlist",
9
     "pages/main/errorlist",
10
+    "pages/about/share",
10
     "pages/about/payfinished",
11
     "pages/about/payfinished",
11
     "pages/main/default"
12
     "pages/main/default"
12
   ],
13
   ],

二進制
images/universalpic_mask_face_size01.png


+ 76 - 0
pages/about/share.js

@@ -0,0 +1,76 @@
1
+import common from '../../utils/util';
2
+import server from '../../utils/main';
3
+
4
+const app = getApp();
5
+var imageIndex = 0;
6
+var arrBuildImageSource = [];
7
+var arrBuildImageTarget = [];
8
+
9
+Page({
10
+  data: {
11
+  },
12
+  onLoad: function (options) {
13
+    this.setData({
14
+      Height: common.getSystemHeight(),
15
+    });
16
+  },
17
+  onUnload: function () {
18
+    wx.setStorageSync("IsShare", true);
19
+  },
20
+  buildShareImage: function () {
21
+    imageIndex = 0;
22
+    arrBuildImageSource = [];
23
+    for (var i = 2; i < 6; i++)
24
+      arrBuildImageSource.push("../../images/programsystem_screenshot_pic0" + i + ".png");
25
+    arrBuildImageTarget = [];
26
+
27
+    this.buildImage();
28
+  },
29
+  buildImage: function () {
30
+    var that = this;
31
+    var ctx = wx.createCanvasContext("MyCanvas", this);
32
+    ctx.drawImage(arrBuildImageSource[imageIndex], 0, 0, 400, 300);
33
+    var avatar = wx.getStorageSync("Avatar");
34
+    if (avatar) {
35
+      ctx.drawImage(avatar, 15, 250, 40, 40);
36
+      ctx.drawImage("../../images/universalpic_mask_face_size01.png", 13, 248, 44, 44);
37
+
38
+      ctx.fillStyle = "#ffffff";
39
+      ctx.setFontSize(14);
40
+      ctx.fillText(app.globalData.userInfo.NickName, 65, 264);
41
+    }
42
+    ctx.draw(true, function (n) {
43
+      wx.canvasToTempFilePath({
44
+        x: 0,
45
+        y: 0,
46
+        width: 400,
47
+        height: 300,
48
+        canvasId: 'MyCanvas',
49
+        success: function (res2) {
50
+          console.log(res2.tempFilePath);
51
+
52
+          arrBuildImageTarget.push(res2.tempFilePath);
53
+
54
+          if (arrBuildImageTarget.length < arrBuildImageSource.length) {
55
+            imageIndex++;
56
+            that.buildImage();
57
+          }
58
+          else {
59
+            wx.previewImage({
60
+              current: arrBuildImageTarget[0], // 当前显示图片的http链接
61
+              urls: arrBuildImageTarget // 需要预览的图片http链接列表
62
+            });
63
+          }
64
+        }
65
+      })
66
+    });
67
+
68
+  },
69
+  onShareAppMessage: function () {
70
+    return {
71
+      title: app.globalData.ShareTitle,
72
+      path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
73
+      imageUrl: app.globalData.ShareImageUrl,
74
+    }
75
+  },
76
+});

+ 6 - 0
pages/about/share.json

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarBackgroundColor": "#99607C",
3
+  "navigationBarTextStyle": "white",
4
+  "navigationBarTitleText": "分享",
5
+  "backgroundColor": "#99607C"
6
+}

+ 36 - 0
pages/about/share.wxml

@@ -0,0 +1,36 @@
1
+<view class="container FlexColumn" style='height:{{Height}}rpx;'>
2
+  <view class="btn">
3
+    <view class="btn1 FlexColumn">
4
+      <view class="panel1 FlexRow">
5
+        <view class="line"></view>
6
+        <view class="panel11 FlexColumn">
7
+          <view class="panel111 FlexColumn">
8
+            把我
9
+          </view>
10
+          <view class="panel112 FlexColumn">
11
+            分享给您的朋友吧
12
+          </view>
13
+        </view>
14
+      </view>
15
+      <view class="panel2 FlexRow">
16
+        <button class="panel2_1 FlexColumn" open-type="share">
17
+          <view class="textTitle">
18
+            <view class="textTitle1">转发给朋友</view>
19
+            <view class="textTitle2">转发给朋友</view>
20
+          </view>
21
+          <view class="panel212">直接转发</view>
22
+        </button>
23
+        <view class="line2"></view>
24
+        <view class="panel2_2 FlexColumn" bindtap='buildShareImage'>
25
+          <view class="textTitle textTitle3">
26
+            <view class="textTitle1">存图发朋友圈</view>
27
+            <view class="textTitle2">存图发朋友圈</view>
28
+          </view>
29
+          <view class="panel2121 panel212">生成图片 长按存图</view>
30
+        </view>
31
+      </view>
32
+    </view>
33
+  </view>
34
+  <image src="../../images/universalpic_share_guide_bg.png" class="universalpic_share_guide_bg" />
35
+</view>
36
+<canvas class='Canvas' canvas-id="MyCanvas"></canvas>

+ 132 - 0
pages/about/share.wxss

@@ -0,0 +1,132 @@
1
+.container {
2
+  background-color: #99607c;
3
+  justify-content: flex-start;
4
+}
5
+
6
+.btn {
7
+  width: 610rpx;
8
+  height: 422rpx;
9
+  background-color: #67453c;
10
+  margin-top: 212rpx;
11
+  border-radius: 14rpx;
12
+  z-index: 10;
13
+}
14
+
15
+.btn1 {
16
+  width: 100%;
17
+  height: 402rpx;
18
+  background-color: #ffd48b;
19
+  position: relative;
20
+  border-radius: 14rpx;
21
+  top: 0;
22
+}
23
+
24
+.panel1 {
25
+  width: 100%;
26
+  height: 260rpx;
27
+  border-bottom: 2rpx solid #e4b06c;
28
+  justify-content: flex-start;
29
+}
30
+
31
+.line {
32
+  width: 16rpx;
33
+  height:140rpx;
34
+  background-color: #EC4C56;
35
+  margin-left: 50rpx;
36
+}
37
+
38
+.panel11{
39
+  align-items: flex-start;
40
+  margin-left: 30rpx;
41
+}
42
+.panel111{
43
+  font-size:64rpx;
44
+  font-weight: 500;
45
+}
46
+.panel112{
47
+  font-size:48rpx;
48
+  font-weight: 500;
49
+}
50
+
51
+.panel2 {
52
+  width: 100%;
53
+  height: 140rpx;
54
+  background-color: #fec579;
55
+  border-bottom-left-radius: 14rpx;
56
+  border-bottom-right-radius: 14rpx;
57
+}
58
+
59
+.line2 {
60
+  width: 2rpx;
61
+  height: 90rpx;
62
+  background-color: #e4b06c;
63
+}
64
+
65
+.panel2_1 {
66
+  width: 305rpx;
67
+  height: 140rpx;
68
+  background-color: #fec579;
69
+  border-bottom-left-radius: 14rpx;
70
+  justify-content: flex-start;
71
+  padding-left: 0;
72
+  padding-right: 0;
73
+}
74
+
75
+.panel2_1::after {
76
+  border: 0px;
77
+}
78
+
79
+.panel2_2 {
80
+  width: 305rpx;
81
+  height: 140rpx;
82
+  background-color: #fec579;
83
+  border-bottom-right-radius: 14rpx;
84
+  justify-content: flex-start;
85
+}
86
+
87
+.textTitle {
88
+  font-size: 36rpx;
89
+  font-weight: 500;
90
+  width: 180rpx;
91
+  height:50rpx;
92
+  margin-top: 30rpx;
93
+}
94
+.textTitle3 {
95
+  width: 216rpx;
96
+}
97
+.textTitle1 {
98
+  -webkit-text-stroke:8rpx #8B4C28;
99
+  position: absolute;
100
+  text-align: center;
101
+  line-height: 50rpx;
102
+}
103
+.textTitle2 {
104
+  color: #FFFFFF;
105
+  position: absolute;
106
+  text-align: center;
107
+  line-height: 50rpx;
108
+}
109
+.panel212{
110
+  font-size: 22rpx;
111
+  font-weight: 500;
112
+  color:#8B4C28;
113
+  margin-top: -2rpx;
114
+}
115
+.panel2121{
116
+  margin-top: 8rpx;
117
+}
118
+
119
+.universalpic_share_guide_bg {
120
+  width: 100%;
121
+  height: 440rpx;
122
+  position: fixed;
123
+  bottom: 0;
124
+}
125
+
126
+.Canvas{
127
+  width: 400px; 
128
+  height: 300px;
129
+  position: fixed;
130
+  left:760rpx;
131
+  top:0rpx;
132
+}

+ 0 - 1
pages/index/guide.wxml

@@ -1,5 +1,4 @@
1
 <view class="container FlexColumn" style="height:{{Containnerheight}}rpx;">
1
 <view class="container FlexColumn" style="height:{{Containnerheight}}rpx;">
2
-  <image class="welcomeguide_bg" src="../../images/welcomeguide_bg.png" />
3
   <view class="panel FlexColumn">
2
   <view class="panel FlexColumn">
4
     <image class="welcomeguide_info" src="../../images/welcomeguide_info.png" />
3
     <image class="welcomeguide_info" src="../../images/welcomeguide_info.png" />
5
     <image class="welcomeguide_dialogue" src="../../images/welcomeguide_dialogue.png" />
4
     <image class="welcomeguide_dialogue" src="../../images/welcomeguide_dialogue.png" />

+ 0 - 7
pages/index/guide.wxss

@@ -3,13 +3,6 @@
3
   justify-content: flex-start;
3
   justify-content: flex-start;
4
 }
4
 }
5
 
5
 
6
-.welcomeguide_bg {
7
-  width: 100%;
8
-  height: 1206rpx;
9
-  position: fixed;
10
-  top:0;
11
-}
12
-
13
 .panel{
6
 .panel{
14
   width:100%;
7
   width:100%;
15
   position: fixed;
8
   position: fixed;

+ 3 - 0
pages/main/answer.js

@@ -20,6 +20,9 @@ Page({
20
     });
20
     });
21
 
21
 
22
   },
22
   },
23
+  onUnload: function () {
24
+    this.closeHelp();
25
+  },
23
   getList: function () {
26
   getList: function () {
24
     //console.log(new Date().getTime());
27
     //console.log(new Date().getTime());
25
     var that = this;
28
     var that = this;

+ 1 - 1
pages/main/answer.wxml

@@ -37,7 +37,7 @@
37
 
37
 
38
     <view class="textFooter FlexRow">
38
     <view class="textFooter FlexRow">
39
       <image class="universalpic_attention_blue_size01" src="../../images/universalpic_attention_blue_size01.png" />
39
       <image class="universalpic_attention_blue_size01" src="../../images/universalpic_attention_blue_size01.png" />
40
-      <view class="textFooter1">删除小程序时,答案也会被删除。</view>
40
+      <view class="textFooter1">小程序被删除后,出题记录和答案也会被删除。</view>
41
     </view>
41
     </view>
42
 
42
 
43
     <view class="panel01 panel00 FlexRow" bindtap='selectItem'>
43
     <view class="panel01 panel00 FlexRow" bindtap='selectItem'>

+ 122 - 26
pages/main/default.js

@@ -3,6 +3,9 @@ import server from '../../utils/main';
3
 
3
 
4
 const app = getApp();
4
 const app = getApp();
5
 var code;
5
 var code;
6
+var imageIndex = 0;
7
+var arrBuildImageSource = [];
8
+var arrBuildImageTarget = [];
6
 
9
 
7
 Page({
10
 Page({
8
   data: {
11
   data: {
@@ -13,41 +16,41 @@ Page({
13
     AvatarUrl: "",
16
     AvatarUrl: "",
14
     IsAccredit: false,
17
     IsAccredit: false,
15
   },
18
   },
16
-  onLoad: function() {
17
-    var that=this;
19
+  onLoad: function () {
20
+    var that = this;
18
     this.setData({
21
     this.setData({
19
       Containnerheight: server.getWindowHeight(),
22
       Containnerheight: server.getWindowHeight(),
20
       ProgramList: server.getProgramList(),
23
       ProgramList: server.getProgramList(),
21
       NickName: app.globalData.userInfo.NickName,
24
       NickName: app.globalData.userInfo.NickName,
22
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
25
       AvatarUrl: app.globalData.userInfo.AvatarUrl,
23
     });
26
     });
24
-    common.getStorageValue(this, "HelpHidden1", false, function () { 
27
+    common.getStorageValue(this, "HelpHidden1", false, function () {
25
       that.showHelp();
28
       that.showHelp();
26
     });
29
     });
27
-
28
     wx.login({
30
     wx.login({
29
       success: function (res0) {
31
       success: function (res0) {
30
         code = res0.code;
32
         code = res0.code;
31
       }
33
       }
32
     });
34
     });
33
-    
35
+    this.downloadUserAvatar();
34
     this.updateProgram();
36
     this.updateProgram();
35
-
36
-    
37
   },
37
   },
38
-  onShow:function(){
38
+  onUnload:function(){
39
+    this.closeHelp();
40
+  },
41
+  onShow: function () {
39
     var list = wx.getStorageSync("AnswerList");
42
     var list = wx.getStorageSync("AnswerList");
40
     var answerLength = 0;
43
     var answerLength = 0;
41
     if (list && list.length > 0) {
44
     if (list && list.length > 0) {
42
       answerLength = list.length;
45
       answerLength = list.length;
43
     }
46
     }
44
-    
47
+
45
     var errorCount = 0;
48
     var errorCount = 0;
46
     var listError = wx.getStorageSync("ErrorList");
49
     var listError = wx.getStorageSync("ErrorList");
47
     if (listError && listError.length > 0) {
50
     if (listError && listError.length > 0) {
48
       errorCount = listError.length;
51
       errorCount = listError.length;
49
     }
52
     }
50
-    
53
+
51
     this.setData({
54
     this.setData({
52
       AnswerLength: answerLength,
55
       AnswerLength: answerLength,
53
       ErrorCount: errorCount,
56
       ErrorCount: errorCount,
@@ -73,12 +76,36 @@ Page({
73
         }
76
         }
74
       }
77
       }
75
     });
78
     });
79
+
80
+    if (list && list.length >= 2) {
81
+      common.getStorageValue(that, "IsShare", false, function () {
82
+        if (!that.data.IsShare) {
83
+          wx.navigateTo({
84
+            url: '../about/share',
85
+          });
86
+        }
87
+      });
88
+    }
89
+  },
90
+  downloadUserAvatar: function () {
91
+    var avatar = wx.getStorageSync("Avatar");
92
+    if (!avatar) {
93
+      var that = this;
94
+      wx.downloadFile({
95
+        url: app.globalData.userInfo.AvatarUrl,
96
+        success(res) {
97
+          if (res.statusCode === 200) {
98
+            wx.setStorageSync("Avatar", res.tempFilePath);
99
+          }
100
+        }
101
+      });
102
+    }
76
   },
103
   },
77
-  gotoList:function(e){
104
+  gotoList: function (e) {
78
     server.playSound("/sounds/click.mp3");
105
     server.playSound("/sounds/click.mp3");
79
 
106
 
80
-    var id=e.currentTarget.dataset.id;
81
-    var categoryArray = [{}, { Num: 1, Name: "一年级", Array: [1, 2] }, { Num: 2, Name: "二年级", Array: [3, 4] }, { Num: 3, Name: "三年级", Array: [5, 6] }, { Num: 4,Name: "四年级及以上", Array: [7] }];
107
+    var id = e.currentTarget.dataset.id;
108
+    var categoryArray = [{}, { Num: 1, Name: "一年级", Array: [1, 2] }, { Num: 2, Name: "二年级", Array: [3, 4] }, { Num: 3, Name: "三年级", Array: [5, 6] }, { Num: 4, Name: "四年级及以上", Array: [7] }];
82
 
109
 
83
     wx.navigateTo({
110
     wx.navigateTo({
84
       url: '../main/list?id=' + categoryArray[id].Array.join(",") + "&name=" + categoryArray[id].Name + "&num=" + categoryArray[id].Num,
111
       url: '../main/list?id=' + categoryArray[id].Array.join(",") + "&name=" + categoryArray[id].Name + "&num=" + categoryArray[id].Num,
@@ -86,7 +113,24 @@ Page({
86
 
113
 
87
     this.closeHelp();
114
     this.closeHelp();
88
   },
115
   },
89
-  gotoAnswer:function(){
116
+  closeMenu: function () {
117
+    this.setData({
118
+      IsShowMenu: false,
119
+    });
120
+  },
121
+  openMenu: function () {
122
+    this.setData({
123
+      IsShowMenu: true,
124
+    });
125
+  },
126
+  gotoHelp: function () {
127
+    for (var i = 0; i < 9; i++)
128
+      wx.removeStorageSync("HelpHidden" + i);
129
+    wx.redirectTo({
130
+      url: '../index/guide',
131
+    });
132
+  },
133
+  gotoAnswer: function () {
90
     wx.navigateTo({
134
     wx.navigateTo({
91
       url: '../main/answer',
135
       url: '../main/answer',
92
     });
136
     });
@@ -101,7 +145,7 @@ Page({
101
       url: '../main/detail?id=-1',
145
       url: '../main/detail?id=-1',
102
     });
146
     });
103
   },
147
   },
104
-  switchProgram: function(e) {
148
+  switchProgram: function (e) {
105
     wx.navigateToMiniProgram({
149
     wx.navigateToMiniProgram({
106
       appId: e.currentTarget.dataset.appid,
150
       appId: e.currentTarget.dataset.appid,
107
       path: e.currentTarget.dataset.path,
151
       path: e.currentTarget.dataset.path,
@@ -111,37 +155,89 @@ Page({
111
       }
155
       }
112
     });
156
     });
113
   },
157
   },
114
-  gotoFeedback: function() {
158
+  gotoFeedback: function () {
115
     server.gotoFeedback();
159
     server.gotoFeedback();
116
   },
160
   },
117
-  showHelp:function(){
118
-    if (!this.data.HelpHidden1){
161
+  showHelp: function () {
162
+    if (!this.data.HelpHidden1) {
119
       this.audioCtx = wx.createAudioContext('myAudio');
163
       this.audioCtx = wx.createAudioContext('myAudio');
120
-      var str ="那么,就从选题目开始吧。在计算题工厂里包括了小学数学全年级最重要的知识点。其中“四年级及以上”,这个栏目囊括了四到六年级的题型。请选一个年级继续。";
164
+      var str = "那么,就从选题目开始吧。在计算题工厂里包括了小学数学全年级最重要的知识点。其中“四年级及以上”,这个栏目囊括了四到六年级的题型。请选一个年级继续。";
121
       server.playAudio(this.audioCtx, str);
165
       server.playAudio(this.audioCtx, str);
122
     }
166
     }
123
   },
167
   },
124
-  closeHelp:function(){
168
+  closeHelp: function () {
125
     this.setData({
169
     this.setData({
126
-      HelpHidden1:true,
170
+      HelpHidden1: true,
127
     });
171
     });
128
     wx.setStorageSync("HelpHidden1", true);
172
     wx.setStorageSync("HelpHidden1", true);
129
     this.audioCtx = wx.createAudioContext('myAudio');
173
     this.audioCtx = wx.createAudioContext('myAudio');
130
     this.audioCtx.pause();
174
     this.audioCtx.pause();
131
   },
175
   },
132
-  updateProgram: function() {
176
+  buildShareImage: function () {
177
+    this.closeMenu();
178
+    imageIndex = 0;
179
+    arrBuildImageSource = [];
180
+    for (var i = 2; i < 6; i++)
181
+      arrBuildImageSource.push("../../images/programsystem_screenshot_pic0" + i + ".png");
182
+    arrBuildImageTarget = [];
183
+
184
+    this.buildImage();
185
+  },
186
+  buildImage: function () {
187
+    var that = this;
188
+    var ctx = wx.createCanvasContext("MyCanvas", this);
189
+    ctx.drawImage(arrBuildImageSource[imageIndex], 0, 0, 400, 300);
190
+
191
+    var avatar = wx.getStorageSync("Avatar");
192
+    if (avatar) {
193
+      ctx.drawImage(avatar, 15, 250, 40, 40);
194
+      ctx.drawImage("../../images/universalpic_mask_face_size01.png", 13, 248, 44, 44);
195
+
196
+      ctx.fillStyle = "#ffffff";
197
+      ctx.setFontSize(14);
198
+      ctx.fillText(app.globalData.userInfo.NickName, 65, 264);
199
+    }
200
+
201
+    ctx.draw(true, function (n) {
202
+      wx.canvasToTempFilePath({
203
+        x: 0,
204
+        y: 0,
205
+        width: 400,
206
+        height: 300,
207
+        canvasId: 'MyCanvas',
208
+        success: function (res2) {
209
+          console.log(res2.tempFilePath);
210
+
211
+          arrBuildImageTarget.push(res2.tempFilePath);
212
+
213
+          if (arrBuildImageTarget.length < arrBuildImageSource.length) {
214
+            imageIndex++;
215
+            that.buildImage();
216
+          }
217
+          else {
218
+            wx.previewImage({
219
+              current: arrBuildImageTarget[0], // 当前显示图片的http链接
220
+              urls: arrBuildImageTarget // 需要预览的图片http链接列表
221
+            });
222
+          }
223
+        }
224
+      })
225
+    });
226
+
227
+  },
228
+  updateProgram: function () {
133
     const updateManager = wx.getUpdateManager();
229
     const updateManager = wx.getUpdateManager();
134
 
230
 
135
-    updateManager.onCheckForUpdate(function(res) {
231
+    updateManager.onCheckForUpdate(function (res) {
136
       // 请求完新版本信息的回调
232
       // 请求完新版本信息的回调
137
       //console.log(res.hasUpdate)
233
       //console.log(res.hasUpdate)
138
     });
234
     });
139
 
235
 
140
-    updateManager.onUpdateReady(function() {
236
+    updateManager.onUpdateReady(function () {
141
       wx.showModal({
237
       wx.showModal({
142
         title: '更新提示',
238
         title: '更新提示',
143
         content: '新版本已经准备好,是否重启应用?',
239
         content: '新版本已经准备好,是否重启应用?',
144
-        success: function(res) {
240
+        success: function (res) {
145
           if (res.confirm) {
241
           if (res.confirm) {
146
             // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
242
             // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
147
             updateManager.applyUpdate()
243
             updateManager.applyUpdate()
@@ -151,7 +247,7 @@ Page({
151
 
247
 
152
     });
248
     });
153
   },
249
   },
154
-  onShareAppMessage: function() {
250
+  onShareAppMessage: function () {
155
     return {
251
     return {
156
       title: app.globalData.ShareTitle,
252
       title: app.globalData.ShareTitle,
157
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
253
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,

+ 32 - 9
pages/main/default.wxml

@@ -44,12 +44,12 @@
44
                 <view class="text">{{ErrorCount}}</view>
44
                 <view class="text">{{ErrorCount}}</view>
45
               </view>
45
               </view>
46
               <view class="line4 line3"></view>
46
               <view class="line4 line3"></view>
47
-              <view class="panel002000 FlexRow" bindtap='gotoErrorList'>
48
-                <button class="btn">
47
+              <view class="panel002000 FlexRow" >
48
+                <view class="btn" bindtap='gotoErrorList'>
49
                   <view class="btn1">
49
                   <view class="btn1">
50
                     错题集
50
                     错题集
51
                   </view>
51
                   </view>
52
-                </button>
52
+                </view>
53
 
53
 
54
                 <view class="btn2 btn" bindtap='gotoAnswer'>
54
                 <view class="btn2 btn" bindtap='gotoAnswer'>
55
                   <view class="btn3 btn1">
55
                   <view class="btn3 btn1">
@@ -74,19 +74,19 @@
74
             <view class="panel00300 FlexColumn">
74
             <view class="panel00300 FlexColumn">
75
               <text class="text">©2018 唱意教育 - 数学计算题\n微信小程序 版本 {{version}}</text>
75
               <text class="text">©2018 唱意教育 - 数学计算题\n微信小程序 版本 {{version}}</text>
76
               <view class="panel003000 FlexRow">
76
               <view class="panel003000 FlexRow">
77
-                <view>帮助</view>
77
+                <view bindtap='gotoHelp'>帮助</view>
78
                 <view class="line"></view>
78
                 <view class="line"></view>
79
                 <view bindtap='gotoFeedback'>反馈</view>
79
                 <view bindtap='gotoFeedback'>反馈</view>
80
                 <view class="line"></view>
80
                 <view class="line"></view>
81
-                <view>合作</view>
81
+                <view bindtap='gotoFeedback'>合作</view>
82
               </view>
82
               </view>
83
             </view>
83
             </view>
84
-            <button class="btn4 btn" open-type="share">
84
+            <view class="btn4 btn" bindtap='openMenu'>
85
               <view class="btn5 btn1 FlexColumn">
85
               <view class="btn5 btn1 FlexColumn">
86
                 <image class="universalpic_share_size01" src="../../images/universalpic_share_size01.png" />
86
                 <image class="universalpic_share_size01" src="../../images/universalpic_share_size01.png" />
87
-                <view>转发分享</view>
87
+                <view>分享朋友</view>
88
               </view>
88
               </view>
89
-            </button>
89
+            </view>
90
 
90
 
91
           </view>
91
           </view>
92
 
92
 
@@ -110,6 +110,29 @@
110
       </view>
110
       </view>
111
     </view>
111
     </view>
112
   </view>
112
   </view>
113
+
114
+  <view class="menuPanel" style="min-height:{{Containnerheight}}rpx;" wx:if="{{IsShowMenu}}">
115
+    <view class="menu FlexColumn">
116
+      <view class="text1">选择分享方式</view>
117
+      <button class="panel FlexRow" open-type="share">
118
+        <view>转发给朋友</view>
119
+      </button>
120
+      <view class="line"></view>
121
+      <view class="panel2 panel FlexColumn" bindtap='buildShareImage' >
122
+        <view>存图发到朋友圈</view>
123
+        <view class="text3">点击后生成图片,长按图片选择保存到相册</view>
124
+      </view>
125
+      <view class="line"></view>
126
+      <view class="line2"></view>
127
+      <view class="line"></view>
128
+      <view class="panel FlexRow" bindtap='closeMenu'>
129
+        <view>取消</view>
130
+      </view>
131
+
132
+    </view>
133
+  </view>
113
 </view>
134
 </view>
114
 <image hidden="{{HelpHidden1}}" bindtap='closeHelp' class="Help_aside_homepage" src="../../images/Help_aside_homepage.png" />
135
 <image hidden="{{HelpHidden1}}" bindtap='closeHelp' class="Help_aside_homepage" src="../../images/Help_aside_homepage.png" />
115
-<audio hidden='true' id="myAudio"></audio>
136
+
137
+<audio hidden='true' id="myAudio"></audio>
138
+<canvas class='Canvas' canvas-id="MyCanvas"></canvas>

+ 62 - 0
pages/main/default.wxss

@@ -371,4 +371,66 @@
371
   position: fixed;
371
   position: fixed;
372
   bottom: 0rpx;
372
   bottom: 0rpx;
373
   z-index: 100;
373
   z-index: 100;
374
+}
375
+
376
+
377
+.menuPanel{
378
+  position: fixed;
379
+  top: 0;
380
+  width: 100%;
381
+  background-color:rgba(185, 220, 93, 0.9);
382
+  z-index: 30;
383
+}
384
+
385
+.menu {
386
+  position: fixed;
387
+  bottom: 0;
388
+  width: 100%;
389
+  background-color: #d2d2d2;
390
+  z-index: 30;
391
+  font-weight: 400;
392
+}
393
+
394
+.menu .text1 {
395
+  font-size: 24rpx;
396
+  margin: 30rpx;
397
+}
398
+
399
+.menu .panel {
400
+  font-size: 36rpx;
401
+  height: 111rpx;
402
+  width: 100%;
403
+  background-color: #fff;
404
+  position: relative;
405
+  justify-content: center;
406
+}
407
+
408
+.menu .panel2 {
409
+  height: 143rpx;
410
+}
411
+
412
+.menu .text3 {
413
+  font-size:24rpx;
414
+  font-weight: 400;
415
+}
416
+
417
+.menu .line {
418
+  height: 2rpx;
419
+  width: 100%;
420
+  background-color: #e3e3e3;
421
+}
422
+
423
+.menu .line2 {
424
+  height: 20rpx;
425
+  width: 100%;
426
+  background-color: #d2d2d2;
427
+}
428
+
429
+
430
+.Canvas{
431
+  width: 400px; 
432
+  height: 300px;
433
+  position: fixed;
434
+  left:760rpx;
435
+  top:0rpx;
374
 }
436
 }

+ 221 - 190
pages/main/detail.js

@@ -31,7 +31,7 @@ Page({
31
 
31
 
32
     ShowAndroidNotice: false,
32
     ShowAndroidNotice: false,
33
   },
33
   },
34
-  onLoad: function (options) {
34
+  onLoad: function(options) {
35
     var that = this;
35
     var that = this;
36
     var id = options.id;
36
     var id = options.id;
37
 
37
 
@@ -52,25 +52,25 @@ Page({
52
 
52
 
53
 
53
 
54
     if (id > 0) {
54
     if (id > 0) {
55
-      common.getStorageValue(this, "HelpHidden3", false, function () {
55
+      common.getStorageValue(this, "HelpHidden3", false, function() {
56
         that.showHelp();
56
         that.showHelp();
57
       });
57
       });
58
-    }
59
-    else {
60
-      common.getStorageValue(this, "HelpHidden8", false, function () {
58
+    } else {
59
+      common.getStorageValue(this, "HelpHidden8", false, function() {
61
         that.showHelp8();
60
         that.showHelp8();
62
       });
61
       });
63
     }
62
     }
64
 
63
 
65
   },
64
   },
66
-  onShow:function(){
67
-    if (this.data.ID==-1)
65
+  onShow: function() {
66
+    if (this.data.ID == -1)
68
       this.getDetail(this.data.ID);
67
       this.getDetail(this.data.ID);
69
   },
68
   },
70
-  onUnload: function () {
69
+  onUnload: function() {
71
     wx.hideLoading();
70
     wx.hideLoading();
71
+    this.closeHelp();
72
   },
72
   },
73
-  getDetail: function (id) {
73
+  getDetail: function(id) {
74
     var item = {};
74
     var item = {};
75
     if (id > 0) {
75
     if (id > 0) {
76
       var data = wx.getStorageSync('QuestionTypeList');
76
       var data = wx.getStorageSync('QuestionTypeList');
@@ -87,8 +87,7 @@ Page({
87
           }
87
           }
88
         }
88
         }
89
       }
89
       }
90
-    }
91
-    else {
90
+    } else {
92
       item.Name = "我的错题集";
91
       item.Name = "我的错题集";
93
       var list = wx.getStorageSync('ErrorList');
92
       var list = wx.getStorageSync('ErrorList');
94
       item.ErrorList = list;
93
       item.ErrorList = list;
@@ -100,21 +99,27 @@ Page({
100
 
99
 
101
     //有竖式则缺省竖式
100
     //有竖式则缺省竖式
102
     if (item.QuestionNumber3 > 0) {
101
     if (item.QuestionNumber3 > 0) {
103
-      this.menuClick({ currentTarget: { dataset: { id: "vertical" } } })
102
+      this.menuClick({
103
+        currentTarget: {
104
+          dataset: {
105
+            id: "vertical"
106
+          }
107
+        }
108
+      })
104
     }
109
     }
105
   },
110
   },
106
-  gotoError: function (e) {
111
+  gotoError: function(e) {
107
     wx.navigateTo({
112
     wx.navigateTo({
108
       url: '../main/errorlist',
113
       url: '../main/errorlist',
109
     });
114
     });
110
   },
115
   },
111
-  gotoAnswer: function (e) {
116
+  gotoAnswer: function(e) {
112
     wx.navigateTo({
117
     wx.navigateTo({
113
       url: '../main/answer',
118
       url: '../main/answer',
114
     });
119
     });
115
     this.closeHelp2();
120
     this.closeHelp2();
116
   },
121
   },
117
-  getFinish: function () {
122
+  getFinish: function() {
118
     server.playSound("/sounds/click.mp3");
123
     server.playSound("/sounds/click.mp3");
119
 
124
 
120
     this.setData({
125
     this.setData({
@@ -127,19 +132,18 @@ Page({
127
     this.getAnswerID();
132
     this.getAnswerID();
128
     if (this.data.ID > 0) {
133
     if (this.data.ID > 0) {
129
       this.getList(this.data.ID);
134
       this.getList(this.data.ID);
130
-    }
131
-    else{
135
+    } else {
132
       this.getErrorList();
136
       this.getErrorList();
133
     }
137
     }
134
 
138
 
135
     this.closeHelp();
139
     this.closeHelp();
136
   },
140
   },
137
   //重新生成试卷
141
   //重新生成试卷
138
-  ResetFinish: function () {
142
+  ResetFinish: function() {
139
     var that = this;
143
     var that = this;
140
     wx.showLoading({
144
     wx.showLoading({
141
       title: "正在重置",
145
       title: "正在重置",
142
-      complete: function () {
146
+      complete: function() {
143
         var list = that.data.arrPage;
147
         var list = that.data.arrPage;
144
         for (var i = 0; i < list.length; i++) {
148
         for (var i = 0; i < list.length; i++) {
145
           wx.removeSavedFile({
149
           wx.removeSavedFile({
@@ -160,7 +164,8 @@ Page({
160
       }
164
       }
161
     });
165
     });
162
   },
166
   },
163
-  getList: function (id) {
167
+  //题卡数据列表
168
+  getList: function(id) {
164
     var that = this;
169
     var that = this;
165
     var pageNum = that.data.PageNumber;
170
     var pageNum = that.data.PageNumber;
166
     var QuestionTypeCategory = 3;
171
     var QuestionTypeCategory = 3;
@@ -168,7 +173,7 @@ Page({
168
       QuestionTypeCategory = 2;
173
       QuestionTypeCategory = 2;
169
     pageIndex = 0;
174
     pageIndex = 0;
170
 
175
 
171
-    server.getData('GetQuestionTypesPrint?ID=' + id + '&QuestionTypeCategory=' + QuestionTypeCategory + '&PageNum=' + pageNum, function (data) {
176
+    server.getData('GetQuestionTypesPrint?ID=' + id + '&QuestionTypeCategory=' + QuestionTypeCategory + '&PageNum=' + pageNum, function(data) {
172
       //console.log("UserInfo:" + data);
177
       //console.log("UserInfo:" + data);
173
       if (data) {
178
       if (data) {
174
         that.setData({
179
         that.setData({
@@ -185,66 +190,88 @@ Page({
185
           console.log("android");
190
           console.log("android");
186
           var ctx = wx.createCanvasContext("Canvas", that);
191
           var ctx = wx.createCanvasContext("Canvas", that);
187
           ctx.fillRect(0, 0, 1050, 1485);
192
           ctx.fillRect(0, 0, 1050, 1485);
188
-          ctx.draw(true, function (n) {
193
+          ctx.draw(true, function(n) {
189
             wx.canvasToTempFilePath({
194
             wx.canvasToTempFilePath({
190
               x: 0,
195
               x: 0,
191
               y: 0,
196
               y: 0,
192
               width: 2100,
197
               width: 2100,
193
               height: 2970,
198
               height: 2970,
194
               canvasId: 'Canvas',
199
               canvasId: 'Canvas',
195
-              success: function (res2) {
200
+              success: function(res2) {
196
                 that.saveImage();
201
                 that.saveImage();
197
               }
202
               }
198
             })
203
             })
199
           });
204
           });
200
-        }
201
-        else {
205
+        } else {
202
           that.saveImage();
206
           that.saveImage();
203
         }
207
         }
204
       }
208
       }
205
     });
209
     });
206
 
210
 
207
   },
211
   },
208
-  getErrorList: function () {
212
+  //错题列表
213
+  getErrorList: function() {
209
     var that = this;
214
     var that = this;
215
+
210
     QuestionItem = that.data.QuestionTypeItem;
216
     QuestionItem = that.data.QuestionTypeItem;
211
-    var pageNum = QuestionItem.ErrorList.length > 60 ? 60 : QuestionItem.ErrorList.length;
212
-    var QuestionTypeCategory = 2;
213
-    pageIndex = 0;
214
-    that.setData({
215
-      IsFinished: true,
216
-      arrPage: [],
217
-      IsDistabled: "",
218
-      WaitTime: waitTime[that.data.PageNumber],
219
-    });
220
-    
221
-    if (isAndroid) {
222
-      console.log("android");
223
-      var ctx = wx.createCanvasContext("Canvas", that);
224
-      ctx.fillRect(0, 0, 1050, 1485);
225
-      ctx.draw(true, function (n) {
226
-        wx.canvasToTempFilePath({
227
-          x: 0,
228
-          y: 0,
229
-          width: 2100,
230
-          height: 2970,
231
-          canvasId: 'Canvas',
232
-          success: function (res2) {
233
-            that.saveImage();
234
-          }
235
-        })
217
+    if (QuestionItem.ErrorList.length > 0) {
218
+      QuestionItem.Category = -1; //错题集类别
219
+      QuestionItem.QuestionTypeCategory = 2;
220
+      QuestionItem.CategoryName = "";
221
+      QuestionItem.Name = "我的错题集";
222
+      QuestionItem.QuestionTypeLevel = "";
223
+      QuestionItem.PageCount = QuestionItem.ErrorList.length > 60 ? 60 : QuestionItem.ErrorList.length;
224
+      QuestionItem.QuestionList = QuestionItem.ErrorList;
225
+      QuestionItem.CreateTime = common.formatDateCHS(new Date());
226
+      QuestionItem.IconName = app.globalData.fileUrl + "questioncard_icon_grade0102_size01.png";
227
+
228
+      QuestionItem.QuestionList = common.randomArray(QuestionItem.QuestionList);
229
+
230
+      delete QuestionItem.ErrorList;
231
+      pageIndex = 0;
232
+
233
+      that.setData({
234
+        IsFinished: true,
235
+        arrPage: [],
236
+        IsDistabled: "",
237
+        WaitTime: waitTime[that.data.PageNumber],
236
       });
238
       });
237
-    }
238
-    else {
239
-      that.saveImage();
240
-    }
241
 
239
 
240
+      if (isAndroid) {
241
+        console.log("android");
242
+        var ctx = wx.createCanvasContext("Canvas", that);
243
+        ctx.fillRect(0, 0, 1050, 1485);
244
+        ctx.draw(true, function(n) {
245
+          wx.canvasToTempFilePath({
246
+            x: 0,
247
+            y: 0,
248
+            width: 2100,
249
+            height: 2970,
250
+            canvasId: 'Canvas',
251
+            success: function(res2) {
252
+              that.saveImage();
253
+            }
254
+          })
255
+        });
256
+      } else {
257
+        that.saveImage();
258
+      }
259
+    } else {
260
+      this.setData({
261
+        ShowLoading: false,
262
+      });
263
+      wx.showModal({
264
+        title: "没有错题",
265
+        showCancel: false,
266
+        content: "先到“对答案”中给做错的题目打记号(点击题目序号)",
267
+      });
268
+    }
242
   },
269
   },
243
-  getAnswerID: function () {
270
+  getAnswerID: function() {
244
     var list = wx.getStorageSync("AnswerList");
271
     var list = wx.getStorageSync("AnswerList");
245
     var id = 1;
272
     var id = 1;
246
     if (list && list.length > 0) {
273
     if (list && list.length > 0) {
247
-      list.sort(function (a, b) {
274
+      list.sort(function(a, b) {
248
         return b.AnswerID - a.AnswerID;
275
         return b.AnswerID - a.AnswerID;
249
       });
276
       });
250
       id = list[0].AnswerID + 1;
277
       id = list[0].AnswerID + 1;
@@ -252,7 +279,7 @@ Page({
252
     for (var i = 0; i < this.data.PageNumber; i++)
279
     for (var i = 0; i < this.data.PageNumber; i++)
253
       arrAnswerID.push(id + i);
280
       arrAnswerID.push(id + i);
254
   },
281
   },
255
-  saveImage: function () {
282
+  saveImage: function() {
256
     var that = this;
283
     var that = this;
257
     var item = QuestionItem;
284
     var item = QuestionItem;
258
     item.AnswerID = arrAnswerID.shift();
285
     item.AnswerID = arrAnswerID.shift();
@@ -272,18 +299,22 @@ Page({
272
     var height = 150;
299
     var height = 150;
273
     if (item.QuestionTypeCategory == 2)
300
     if (item.QuestionTypeCategory == 2)
274
       height = 59;
301
       height = 59;
275
-    if (item.PageCount == 18)
276
-      height = 210;
277
-    else if (item.PageCount == 15)
278
-      height = 250;
302
+    if (item.Category > 0) {
303
+      if (item.PageCount == 18)
304
+        height = 210;
305
+      else if (item.PageCount == 15)
306
+        height = 250;
307
+    }
279
     //括号
308
     //括号
280
     var index = 0;
309
     var index = 0;
281
 
310
 
282
     for (var i = 0; i < 3; i++) {
311
     for (var i = 0; i < 3; i++) {
283
       for (var j = 0; j < item.PageCount / 3; j++) {
312
       for (var j = 0; j < item.PageCount / 3; j++) {
284
         index++;
313
         index++;
285
-        ctx.fillText("(", xStart + i * 310, yStart + j * height);
286
-        ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
314
+        if (index <= item.QuestionList.length) {
315
+          ctx.fillText("(", xStart + i * 310, yStart + j * height);
316
+          ctx.fillText(")", xStart + i * 310 + 22, yStart + j * height);
317
+        }
287
       }
318
       }
288
     }
319
     }
289
 
320
 
@@ -296,7 +327,9 @@ Page({
296
     for (var i = 0; i < 3; i++) {
327
     for (var i = 0; i < 3; i++) {
297
       for (var j = 0; j < item.PageCount / 3; j++) {
328
       for (var j = 0; j < item.PageCount / 3; j++) {
298
         index++;
329
         index++;
299
-        ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
330
+        if (index <= item.QuestionList.length) {
331
+          ctx.fillText(index, xStart + i * 310 + numberLeft, yStart + j * height);
332
+        }
300
       }
333
       }
301
     }
334
     }
302
 
335
 
@@ -307,114 +340,111 @@ Page({
307
       for (var j = 0; j < item.PageCount / 3; j++) {
340
       for (var j = 0; j < item.PageCount / 3; j++) {
308
         index++;
341
         index++;
309
 
342
 
310
-        //横式
311
-        if (item.QuestionTypeCategory == 2) {
312
-
313
-          var A = item.QuestionList[index - 1].A.toString();
314
-          if (item.QuestionList[index - 1].HiddenColumn == "A")
315
-            A = "____";
316
-          var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
317
-          //console.log(OperateAB);
318
-          var B = item.QuestionList[index - 1].B.toString();
319
-          if (item.QuestionList[index - 1].HiddenColumn == "B")
320
-            B = "____";
321
-          var equation = A + " " + OperateAB + " " + B;
322
-          if (item.QuestionList[index - 1].C) {
323
-            var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
324
-            var C = item.QuestionList[index - 1].C.toString();
325
-            equation += " " + OperateBC + " " + C;
326
-            if (item.QuestionList[index - 1].D) {
327
-              var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
328
-              var D = item.QuestionList[index - 1].D.toString();
329
-              equation += " " + OperateCD + " " + D;
343
+        if (index <= item.QuestionList.length) {
344
+          //横式
345
+          if (item.QuestionTypeCategory == 2) {
346
+
347
+            var A = item.QuestionList[index - 1].A.toString();
348
+            if (item.QuestionList[index - 1].HiddenColumn == "A")
349
+              A = "____";
350
+            var OperateAB = item.QuestionList[index - 1].OperateAB.toString();
351
+            //console.log(OperateAB);
352
+            var B = item.QuestionList[index - 1].B.toString();
353
+            if (item.QuestionList[index - 1].HiddenColumn == "B")
354
+              B = "____";
355
+            var equation = A + " " + OperateAB + " " + B;
356
+            if (item.QuestionList[index - 1].C) {
357
+              var OperateBC = item.QuestionList[index - 1].OperateBC.toString();
358
+              var C = item.QuestionList[index - 1].C.toString();
359
+              equation += " " + OperateBC + " " + C;
360
+              if (item.QuestionList[index - 1].D) {
361
+                var OperateCD = item.QuestionList[index - 1].OperateCD.toString();
362
+                var D = item.QuestionList[index - 1].D.toString();
363
+                equation += " " + OperateCD + " " + D;
364
+              }
330
             }
365
             }
331
-          }
332
-          equation += " = ";
333
-          var R = item.QuestionList[index - 1].R.toString();
334
-          if (item.QuestionList[index - 1].HiddenColumn == "R")
335
-            R = "";
336
-          equation += R;
337
-
338
-          var num = xStart + i * 310 + 31;
339
-
340
-          for (var n = 0; n < equation.length; n++) {
341
-            var len = getLength(equation[n]);
342
-            num += len;
343
-            if (equation[n] == ".") {
344
-              ctx.fillText(equation[n], num + 3, yStart + j * 59 - 5);
345
-            } else {
346
-              var h = -8;
347
-              if (equation[n] == "_")
348
-                h = 0;
349
-              ctx.fillText(equation[n], num, yStart + j * 59 + h);
366
+            equation += " = ";
367
+            var R = item.QuestionList[index - 1].R.toString();
368
+            if (item.QuestionList[index - 1].HiddenColumn == "R")
369
+              R = "";
370
+            equation += R;
371
+
372
+            var num = xStart + i * 310 + 31;
373
+
374
+            for (var n = 0; n < equation.length; n++) {
375
+              var len = getLength(equation[n]);
376
+              num += len;
377
+              if (equation[n] == ".") {
378
+                ctx.fillText(equation[n], num + 3, yStart + j * 59 - 5);
379
+              } else {
380
+                var h = -8;
381
+                if (equation[n] == "_")
382
+                  h = 0;
383
+                ctx.fillText(equation[n], num, yStart + j * 59 + h);
384
+              }
350
             }
385
             }
351
           }
386
           }
352
-        }
353
-        //竖式
354
-        else if (item.QuestionTypeCategory == 3) {
355
-
356
-          var num1 = item.QuestionList[index - 1];
357
-          var isAnswer = false;
358
-
359
-          var width = 250;
360
-          if (num1.OperateAB == "÷")
361
-            width = 240;
362
-
363
-          for (var n = 0; n < num1.Vertical.length; n++) {
364
-            var num = xStart + i * 310 + width;
365
-            var num2 = 0;
366
-            for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
367
-              var str = "";
368
-              if (num1.Vertical[n].Type == "line") {
369
-                if (num1.OperateAB != "÷") {
370
-                  //var lineLength = num1.Vertical[n].Array.length * 30 + 20;
371
-                  var lineLength = 6 * 30 + 20;
372
-                  var lineTop = 4;
373
-
374
-                  //console.log(yStart + j * height + n * 30 + lineTop);
375
-                  ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
376
-                  ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
377
-                  ctx.stroke();
378
-
379
-                  isAnswer = true;
380
-                  break;
381
-                }
382
-              }
383
-              else {
384
-                str = num1.Vertical[n].Array[m];
385
-
386
-                if (num1.OperateAB == "÷" && str == "√") {
387
-                  isAnswer = true;
388
-                  var lineLength = num1.A.toString().length;
389
-                  var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
390
-
391
-                  ctx.drawImage("../../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 10, lineWidth, 39);
392
-                  //break;
393
-                }
394
-                else if (num1.OperateAB == "÷" && n == 0) {
395
-                }
396
-                else if (num1.OperateAB == "÷" && n == 1) {
397
-                  ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
398
-                }
399
-                else {
400
-                  if (str == ".") {
401
-                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + 15, yStart + j * height + n * 30);
402
-                    num2 = 30;
387
+          //竖式
388
+          else if (item.QuestionTypeCategory == 3) {
389
+
390
+            var num1 = item.QuestionList[index - 1];
391
+            var isAnswer = false;
392
+
393
+            var width = 250;
394
+            if (num1.OperateAB == "÷")
395
+              width = 240;
396
+
397
+            for (var n = 0; n < num1.Vertical.length; n++) {
398
+              var num = xStart + i * 310 + width;
399
+              var num2 = 0;
400
+              for (var m = num1.Vertical[n].Array.length - 1; m >= 0; m--) {
401
+                var str = "";
402
+                if (num1.Vertical[n].Type == "line") {
403
+                  if (num1.OperateAB != "÷") {
404
+                    //var lineLength = num1.Vertical[n].Array.length * 30 + 20;
405
+                    var lineLength = 6 * 30 + 20;
406
+                    var lineTop = 4;
407
+
408
+                    //console.log(yStart + j * height + n * 30 + lineTop);
409
+                    ctx.moveTo(num, yStart + j * height + n * 30 + lineTop);
410
+                    ctx.lineTo(num - lineLength, yStart + j * height + n * 30 + lineTop);
411
+                    ctx.stroke();
412
+
413
+                    isAnswer = true;
414
+                    break;
403
                   }
415
                   }
404
-                  else if (str == "+" || str == "-" || str == "−" || str == "×" || str == "÷") {
405
-                    var lineLength = 6 * 30;
406
-                    ctx.fillText(str, num - lineLength, yStart + j * height + n * 30);
407
-                    num2 = 30;
416
+                } else {
417
+                  str = num1.Vertical[n].Array[m];
418
+
419
+                  if (num1.OperateAB == "÷" && str == "√") {
420
+                    isAnswer = true;
421
+                    var lineLength = num1.A.toString().length;
422
+                    var lineWidth = Math.floor(57 * (1 + num1.A.toString().length) / 2);
423
+
424
+                    ctx.drawImage("../../images/formula_division_size0" + lineLength + ".png", num - (num1.Vertical[n].Array.length - m) * 30 - 8, yStart + j * height + n * 30 - 10, lineWidth, 39);
425
+                    //break;
426
+                  } else if (num1.OperateAB == "÷" && n == 0) {} else if (num1.OperateAB == "÷" && n == 1) {
427
+                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 10, yStart + j * height + n * 30);
428
+                  } else {
429
+                    if (str == ".") {
430
+                      ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + 15, yStart + j * height + n * 30);
431
+                      num2 = 30;
432
+                    } 
433
+                    else if (str == "+" || str == "-" || str == "−" || str == "×" || str == "÷") {
434
+                      var lineLength = 6 * 30;
435
+                      ctx.fillText(str, num - lineLength, yStart + j * height + n * 30);
436
+                      num2 = 30;
437
+                    } 
438
+                    else
439
+                      ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + num2, yStart + j * height + n * 30);
408
                   }
440
                   }
409
-                  else
410
-                    ctx.fillText(str, num - (num1.Vertical[n].Array.length - m) * 30 + num2, yStart + j * height + n * 30);
411
                 }
441
                 }
412
               }
442
               }
443
+              if (isAnswer)
444
+                break;
413
             }
445
             }
414
-            if (isAnswer)
415
-              break;
416
-          }
417
 
446
 
447
+          }
418
         }
448
         }
419
       }
449
       }
420
     }
450
     }
@@ -425,7 +455,7 @@ Page({
425
 
455
 
426
 
456
 
427
     ctx.setFontSize(12);
457
     ctx.setFontSize(12);
428
-    ctx.fillText(item.CagegoryName, 60, 90);
458
+    ctx.fillText(item.CategoryName, 60, 90);
429
     ctx.fillText("共" + item.PageCount + "道题", 60, 125);
459
     ctx.fillText("共" + item.PageCount + "道题", 60, 125);
430
     ctx.fillText("第 1 / 1 页", 60, 147);
460
     ctx.fillText("第 1 / 1 页", 60, 147);
431
     ctx.fillText("答案检索号", 768, 60);
461
     ctx.fillText("答案检索号", 768, 60);
@@ -439,7 +469,7 @@ Page({
439
 
469
 
440
     ctx.drawImage("../../images/answer.png", 890, 54, 100, 100);
470
     ctx.drawImage("../../images/answer.png", 890, 54, 100, 100);
441
 
471
 
442
-    ctx.draw(true, function (n) {
472
+    ctx.draw(true, function(n) {
443
       var w = 1050,
473
       var w = 1050,
444
         h = 1485;
474
         h = 1485;
445
       wx.canvasToTempFilePath({
475
       wx.canvasToTempFilePath({
@@ -450,8 +480,8 @@ Page({
450
         destWidth: w * times,
480
         destWidth: w * times,
451
         destHeight: h * times,
481
         destHeight: h * times,
452
         canvasId: 'Canvas',
482
         canvasId: 'Canvas',
453
-        success: function (res2) {
454
-          console.log(res2.tempFilePath);
483
+        success: function(res2) {
484
+          //console.log(res2.tempFilePath);
455
           that.data.arrPage.push(res2.tempFilePath);
485
           that.data.arrPage.push(res2.tempFilePath);
456
           item.TempImagePath = res2.tempFilePath;
486
           item.TempImagePath = res2.tempFilePath;
457
           tempAnswerList.push(JSON.parse(JSON.stringify(item)));
487
           tempAnswerList.push(JSON.parse(JSON.stringify(item)));
@@ -463,10 +493,9 @@ Page({
463
           if (that.data.arrPage.length < that.data.PageNumber) {
493
           if (that.data.arrPage.length < that.data.PageNumber) {
464
             pageIndex++;
494
             pageIndex++;
465
             that.saveImage();
495
             that.saveImage();
466
-          }
467
-          else {
496
+          } else {
468
             //生成图片完成
497
             //生成图片完成
469
-            setTimeout(function () {
498
+            setTimeout(function() {
470
               that.setData({
499
               that.setData({
471
                 ShowLoading: false,
500
                 ShowLoading: false,
472
               });
501
               });
@@ -501,7 +530,7 @@ Page({
501
               }
530
               }
502
               wx.setStorageSync("AnswerList", tempList);
531
               wx.setStorageSync("AnswerList", tempList);
503
 
532
 
504
-              common.getStorageValue(that, "HelpHidden7", false, function () {
533
+              common.getStorageValue(that, "HelpHidden7", false, function() {
505
                 that.showHelp2();
534
                 that.showHelp2();
506
               });
535
               });
507
 
536
 
@@ -536,9 +565,11 @@ Page({
536
 
565
 
537
   },
566
   },
538
   //保存图片文件
567
   //保存图片文件
539
-  saveImageFile: function () {
568
+  saveImageFile: function() {
540
     if (this.data.IsDistabled == "") {
569
     if (this.data.IsDistabled == "") {
541
-      wx.showLoading({ title: "保存中..." });
570
+      wx.showLoading({
571
+        title: "保存中..."
572
+      });
542
       var that = this;
573
       var that = this;
543
       var count = 0;
574
       var count = 0;
544
       for (var i = 0; i < that.data.arrPage.length; i++) {
575
       for (var i = 0; i < that.data.arrPage.length; i++) {
@@ -576,15 +607,15 @@ Page({
576
       }
607
       }
577
     }
608
     }
578
   },
609
   },
579
-  changePageNumber: function (e) {
610
+  changePageNumber: function(e) {
580
     var id = Number(e.currentTarget.dataset.id);
611
     var id = Number(e.currentTarget.dataset.id);
581
     this.data.PageNumber += id;
612
     this.data.PageNumber += id;
582
-    var addDisabled = "", subDisabled = "";
613
+    var addDisabled = "",
614
+      subDisabled = "";
583
     if (this.data.PageNumber <= 1) {
615
     if (this.data.PageNumber <= 1) {
584
       this.data.PageNumber = 1;
616
       this.data.PageNumber = 1;
585
       subDisabled = "btnAddSubDisabled";
617
       subDisabled = "btnAddSubDisabled";
586
-    }
587
-    else if (this.data.PageNumber >= 4) {
618
+    } else if (this.data.PageNumber >= 4) {
588
       this.data.PageNumber = 4;
619
       this.data.PageNumber = 4;
589
       addDisabled = "btnAddSubDisabled";
620
       addDisabled = "btnAddSubDisabled";
590
     }
621
     }
@@ -595,7 +626,7 @@ Page({
595
       SubDisabled: subDisabled,
626
       SubDisabled: subDisabled,
596
     });
627
     });
597
   },
628
   },
598
-  showImage: function (e) {
629
+  showImage: function(e) {
599
     var that = this;
630
     var that = this;
600
     var id = e.currentTarget.dataset.id;
631
     var id = e.currentTarget.dataset.id;
601
     wx.previewImage({
632
     wx.previewImage({
@@ -603,14 +634,14 @@ Page({
603
       urls: that.data.arrPage // 需要预览的图片http链接列表
634
       urls: that.data.arrPage // 需要预览的图片http链接列表
604
     });
635
     });
605
   },
636
   },
606
-  closeLoading: function () {
637
+  closeLoading: function() {
607
     var that = this;
638
     var that = this;
608
     that.setData({
639
     that.setData({
609
       ShowLoading: false,
640
       ShowLoading: false,
610
       IsFinished: false,
641
       IsFinished: false,
611
     });
642
     });
612
   },
643
   },
613
-  menuClick: function (e) {
644
+  menuClick: function(e) {
614
     this.data.filter = e.currentTarget.dataset.id;
645
     this.data.filter = e.currentTarget.dataset.id;
615
     if (this.data.filter == "horizontal") {
646
     if (this.data.filter == "horizontal") {
616
       this.data.PageCount = this.data.QuestionTypeItem.QuestionNumber2;
647
       this.data.PageCount = this.data.QuestionTypeItem.QuestionNumber2;
@@ -624,24 +655,24 @@ Page({
624
       PageCount: this.data.PageCount,
655
       PageCount: this.data.PageCount,
625
     });
656
     });
626
   },
657
   },
627
-  closeMenu: function () {
658
+  closeMenu: function() {
628
     this.setData({
659
     this.setData({
629
       IsShowMenu: false,
660
       IsShowMenu: false,
630
     });
661
     });
631
   },
662
   },
632
-  openMenu: function () {
663
+  openMenu: function() {
633
     this.setData({
664
     this.setData({
634
       IsShowMenu: true,
665
       IsShowMenu: true,
635
     });
666
     });
636
   },
667
   },
637
-  showHelp: function () {
668
+  showHelp: function() {
638
     if (!this.data.HelpHidden3) {
669
     if (!this.data.HelpHidden3) {
639
       this.audioCtx = wx.createAudioContext('myAudio');
670
       this.audioCtx = wx.createAudioContext('myAudio');
640
       var str = "嘿嘿,找到我了吗?我在车间的窗户里制作例题呢。如果这是你要的题型,去点“出题”按钮就对了。还要告诉你,一张卷子就是一张图片,题目数量请看提示。";
671
       var str = "嘿嘿,找到我了吗?我在车间的窗户里制作例题呢。如果这是你要的题型,去点“出题”按钮就对了。还要告诉你,一张卷子就是一张图片,题目数量请看提示。";
641
       server.playAudio(this.audioCtx, str);
672
       server.playAudio(this.audioCtx, str);
642
     }
673
     }
643
   },
674
   },
644
-  closeHelp: function () {
675
+  closeHelp: function() {
645
     this.setData({
676
     this.setData({
646
       HelpHidden3: true,
677
       HelpHidden3: true,
647
     });
678
     });
@@ -649,14 +680,14 @@ Page({
649
     this.audioCtx = wx.createAudioContext('myAudio');
680
     this.audioCtx = wx.createAudioContext('myAudio');
650
     this.audioCtx.pause();
681
     this.audioCtx.pause();
651
   },
682
   },
652
-  showHelp2: function () {
683
+  showHelp2: function() {
653
     if (!this.data.HelpHidden7) {
684
     if (!this.data.HelpHidden7) {
654
       this.audioCtx = wx.createAudioContext('myAudio');
685
       this.audioCtx = wx.createAudioContext('myAudio');
655
       var str = "卷子出炉咯,棒棒哒!快去手机相册打印吧。我会等在首页上的答案资料室为你继续带路的。";
686
       var str = "卷子出炉咯,棒棒哒!快去手机相册打印吧。我会等在首页上的答案资料室为你继续带路的。";
656
       server.playAudio(this.audioCtx, str);
687
       server.playAudio(this.audioCtx, str);
657
     }
688
     }
658
   },
689
   },
659
-  closeHelp2: function () {
690
+  closeHelp2: function() {
660
     this.setData({
691
     this.setData({
661
       HelpHidden7: true,
692
       HelpHidden7: true,
662
     });
693
     });
@@ -665,14 +696,14 @@ Page({
665
     this.audioCtx.pause();
696
     this.audioCtx.pause();
666
   },
697
   },
667
 
698
 
668
-  showHelp8: function () {
699
+  showHelp8: function() {
669
     if (!this.data.HelpHidden8) {
700
     if (!this.data.HelpHidden8) {
670
       this.audioCtx = wx.createAudioContext('myAudio');
701
       this.audioCtx = wx.createAudioContext('myAudio');
671
       var str = "发现错误是提高成绩的第一步。点一下题目数量右侧的图标,当有错题后,能查看和整理错题清单。";
702
       var str = "发现错误是提高成绩的第一步。点一下题目数量右侧的图标,当有错题后,能查看和整理错题清单。";
672
       server.playAudio(this.audioCtx, str);
703
       server.playAudio(this.audioCtx, str);
673
     }
704
     }
674
   },
705
   },
675
-  closeHelp8: function () {
706
+  closeHelp8: function() {
676
     this.setData({
707
     this.setData({
677
       HelpHidden8: true,
708
       HelpHidden8: true,
678
     });
709
     });
@@ -681,7 +712,7 @@ Page({
681
     this.audioCtx.pause();
712
     this.audioCtx.pause();
682
   },
713
   },
683
 
714
 
684
-  onShareAppMessage: function () {
715
+  onShareAppMessage: function() {
685
     return {
716
     return {
686
       title: app.globalData.ShareTitle,
717
       title: app.globalData.ShareTitle,
687
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,
718
       path: 'pages/index/index?UserID=' + app.globalData.userInfo.UserID,

+ 35 - 24
pages/main/item.js

@@ -5,7 +5,7 @@ const app = getApp();
5
 
5
 
6
 var currentIndex = 0, tempCurrentIndex = -1;
6
 var currentIndex = 0, tempCurrentIndex = -1;
7
 var audioArray = [];
7
 var audioArray = [];
8
-var AnswerID=0;
8
+var AnswerID = 0;
9
 
9
 
10
 Page({
10
 Page({
11
   data: {
11
   data: {
@@ -98,10 +98,11 @@ Page({
98
 
98
 
99
       var list = item.QuestionList;
99
       var list = item.QuestionList;
100
       for (var i = 0; i < list.length; i++) {
100
       for (var i = 0; i < list.length; i++) {
101
-        if (i == 0 && list[i].Vertical) {
101
+        if (i == 0 && list[i].Vertical && item.Category > 0) {
102
           list[i].IsShowVertical = true;
102
           list[i].IsShowVertical = true;
103
         }
103
         }
104
-        //list[i].ErrorClass = "";
104
+        if (item.Category == -1)
105
+          list[i].ErrorClass = "";
105
       }
106
       }
106
 
107
 
107
       var list = item.QuestionList;
108
       var list = item.QuestionList;
@@ -112,7 +113,7 @@ Page({
112
             list[i].Vertical[1].Array[k] = "";
113
             list[i].Vertical[1].Array[k] = "";
113
           }
114
           }
114
           for (var k = 0; k < list[i].Vertical[2].Array.length; k++) {
115
           for (var k = 0; k < list[i].Vertical[2].Array.length; k++) {
115
-            if (list[i].Vertical[2].Array[k] == "√") {
116
+            if (list[i].Vertical[2].Array[k] == "√" && list[i].Vertical[2].Array[list[i].Vertical[2].Array.length - 1] != "√") {
116
               list[i].Vertical[2].Array[k] = "";
117
               list[i].Vertical[2].Array[k] = "";
117
               list[i].Vertical[2].Array.push("√");
118
               list[i].Vertical[2].Array.push("√");
118
               break;
119
               break;
@@ -121,8 +122,17 @@ Page({
121
         }
122
         }
122
       }
123
       }
123
 
124
 
125
+      var pageNum = 0;
126
+      if (item.QuestionList.length % 3 == 0)
127
+        pageNum = item.QuestionList.length / 3;
128
+      else if (item.QuestionList.length % 3 == 1)
129
+        pageNum = (item.QuestionList.length + 2) / 3;
130
+      else if (item.QuestionList.length % 3 == 2)
131
+        pageNum = (item.QuestionList.length + 1) / 3;
132
+
124
       that.setData({
133
       that.setData({
125
         AnswerItem: item,
134
         AnswerItem: item,
135
+        PageColumnNum: pageNum,
126
       });
136
       });
127
     }
137
     }
128
   },
138
   },
@@ -143,6 +153,7 @@ Page({
143
 
153
 
144
   },
154
   },
145
   setErrorItem: function (e) {
155
   setErrorItem: function (e) {
156
+
146
     var id = e.currentTarget.dataset.id;
157
     var id = e.currentTarget.dataset.id;
147
     var list = this.data.AnswerItem.QuestionList;
158
     var list = this.data.AnswerItem.QuestionList;
148
     for (var i = 0; i < list.length; i++) {
159
     for (var i = 0; i < list.length; i++) {
@@ -150,7 +161,7 @@ Page({
150
         if (!list[i].ErrorClass || list[i].ErrorClass == "") {
161
         if (!list[i].ErrorClass || list[i].ErrorClass == "") {
151
           list[i].ErrorClass = "ErrorClass";
162
           list[i].ErrorClass = "ErrorClass";
152
           wx.showToast({ title: "记号已保存", duration: 1000 });
163
           wx.showToast({ title: "记号已保存", duration: 1000 });
153
-          this.saveErrorList(list[i],"add");
164
+          this.saveErrorList(list[i], "add");
154
         }
165
         }
155
         else {
166
         else {
156
           list[i].ErrorClass = "";
167
           list[i].ErrorClass = "";
@@ -164,36 +175,36 @@ Page({
164
     this.setData({
175
     this.setData({
165
       AnswerItem: this.data.AnswerItem,
176
       AnswerItem: this.data.AnswerItem,
166
     });
177
     });
167
-    
178
+
168
   },
179
   },
169
-  saveErrorList:function(item,action){
180
+  saveErrorList: function (item, action) {
170
     var list = wx.getStorageSync("ErrorList");
181
     var list = wx.getStorageSync("ErrorList");
171
     if (!list)
182
     if (!list)
172
-      list=[];
173
-    var b=false;
174
-    for(var i=0;i<list.length;i++){
175
-      if (item.A == list[i].A && item.B == list[i].B && item.R == list[i].R && item.OperateAB == list[i].OperateAB){
176
-        if (item.C){
177
-          if (item.C == list[i].C && item.OperateBC == list[i].OperateBC){
178
-            if (item.D){
179
-              if (item.D == list[i].D && item.OperateCD == list[i].OperateCD){
180
-                b=true;
183
+      list = [];
184
+    var b = false;
185
+    for (var i = 0; i < list.length; i++) {
186
+      if (item.A == list[i].A && item.B == list[i].B && item.R == list[i].R && item.OperateAB == list[i].OperateAB) {
187
+        if (item.C) {
188
+          if (item.C == list[i].C && item.OperateBC == list[i].OperateBC) {
189
+            if (item.D) {
190
+              if (item.D == list[i].D && item.OperateCD == list[i].OperateCD) {
191
+                b = true;
181
               }
192
               }
182
             }
193
             }
183
             else
194
             else
184
-              b=true;
195
+              b = true;
185
           }
196
           }
186
         }
197
         }
187
         else
198
         else
188
-          b=true;
189
-      } 
190
-      if (b){
199
+          b = true;
200
+      }
201
+      if (b) {
191
         list.splice(i, 1);
202
         list.splice(i, 1);
192
         break;
203
         break;
193
       }
204
       }
194
     }
205
     }
195
-    if (action=="add"){
196
-      item.ID=new Date().getTime();
206
+    if (action == "add") {
207
+      item.ID = new Date().getTime();
197
       list.unshift(item);
208
       list.unshift(item);
198
     }
209
     }
199
     wx.setStorageSync("ErrorList", list);
210
     wx.setStorageSync("ErrorList", list);
@@ -219,13 +230,13 @@ Page({
219
       var item = this.data.AnswerItem;
230
       var item = this.data.AnswerItem;
220
       var list = item.QuestionList;
231
       var list = item.QuestionList;
221
       for (var i = 0; i < list.length; i++) {
232
       for (var i = 0; i < list.length; i++) {
222
-        if ((i % (list.length / 3)) == 0) {
233
+        if (i % this.data.PageColumnNum == 0) {
223
           if (i > 0) {
234
           if (i > 0) {
224
             arr.push("");
235
             arr.push("");
225
             audioArray.push(arr);
236
             audioArray.push(arr);
226
             arr = [];
237
             arr = [];
227
           }
238
           }
228
-          arr.push("第" + (1 + i / (list.length / 3)) + "列");
239
+          arr.push("第" + (1 + Math.floor(i / this.data.PageColumnNum)) + "列");
229
 
240
 
230
         }
241
         }
231
         var str = list[i].Result;
242
         var str = list[i].Result;

+ 7 - 7
pages/main/item.wxml

@@ -40,18 +40,18 @@
40
     <view class="panelLeft">题号快翻</view>
40
     <view class="panelLeft">题号快翻</view>
41
     <view class="panelRight FlexRow">
41
     <view class="panelRight FlexRow">
42
       <view class="{{selectTab0}} btn" bindtap="scrollTop" data-id="0">1</view>
42
       <view class="{{selectTab0}} btn" bindtap="scrollTop" data-id="0">1</view>
43
-      <view class="{{selectTab1}} btn" bindtap="scrollTop" data-id="1">{{AnswerItem.QuestionList.length/3+1}}</view>
44
-      <view class="{{selectTab2}} btn" bindtap="scrollTop" data-id="2">{{AnswerItem.QuestionList.length*2/3+1}}</view>
43
+      <view class="{{selectTab1}} btn" bindtap="scrollTop" data-id="1">{{PageColumnNum+1}}</view>
44
+      <view class="{{selectTab2}} btn" bindtap="scrollTop" data-id="2">{{PageColumnNum*2+1}}</view>
45
     </view>
45
     </view>
46
   </view>
46
   </view>
47
 
47
 
48
   <block wx:for="{{AnswerItem.QuestionList}}" wx:key="index">
48
   <block wx:for="{{AnswerItem.QuestionList}}" wx:key="index">
49
-    <block wx:if="{{(index % (AnswerItem.QuestionList.length/3))==0 }}">
50
-      <view id="panelRowTop{{index / (AnswerItem.QuestionList.length/3)}}" class="panelRowTop FlexRow">
49
+    <block wx:if="{{(index % (PageColumnNum))==0 }}">
50
+      <view id="panelRowTop{{index / (PageColumnNum)}}" class="panelRowTop FlexRow">
51
         <view class="panelLeft1 panelLeft">第
51
         <view class="panelLeft1 panelLeft">第
52
-          <block wx:if="{{index / (AnswerItem.QuestionList.length/3)==0}}">一</block>
53
-          <block wx:if="{{index / (AnswerItem.QuestionList.length/3)==1}}">二</block>
54
-          <block wx:if="{{index / (AnswerItem.QuestionList.length/3)==2}}">三</block>
52
+          <block wx:if="{{index==0}}">一</block>
53
+          <block wx:if="{{index==PageColumnNum}}">二</block>
54
+          <block wx:if="{{index==PageColumnNum*2}}">三</block>
55
           列</view>
55
           列</view>
56
         <view>
56
         <view>
57
         </view>
57
         </view>

+ 0 - 3
pages/main/item.wxss

@@ -195,9 +195,6 @@
195
 .formula_division_size04{
195
 .formula_division_size04{
196
   width:285rpx;
196
   width:285rpx;
197
 }
197
 }
198
-.formula_division_size04{
199
-  width:285rpx;
200
-}
201
 .formula_division_size05{
198
 .formula_division_size05{
202
   width:342rpx;
199
   width:342rpx;
203
 }
200
 }

+ 3 - 0
pages/main/list.js

@@ -32,6 +32,9 @@ Page({
32
     this.getList();
32
     this.getList();
33
     
33
     
34
   },
34
   },
35
+  onUnload: function () {
36
+    this.closeHelp();
37
+  },
35
   getList: function () {
38
   getList: function () {
36
     this.buildList();
39
     this.buildList();
37
   },
40
   },

+ 10 - 3
project.config.json

@@ -30,7 +30,7 @@
30
 			"list": []
30
 			"list": []
31
 		},
31
 		},
32
 		"miniprogram": {
32
 		"miniprogram": {
33
-			"current": 7,
33
+			"current": 1,
34
 			"list": [
34
 			"list": [
35
 				{
35
 				{
36
 					"id": 0,
36
 					"id": 0,
@@ -42,7 +42,7 @@
42
 					"id": 1,
42
 					"id": 1,
43
 					"name": "detail",
43
 					"name": "detail",
44
 					"pathName": "pages/main/detail",
44
 					"pathName": "pages/main/detail",
45
-					"query": "id=24"
45
+					"query": "id=187"
46
 				},
46
 				},
47
 				{
47
 				{
48
 					"id": 2,
48
 					"id": 2,
@@ -77,7 +77,14 @@
77
 				{
77
 				{
78
 					"id": -1,
78
 					"id": -1,
79
 					"name": "errorlist",
79
 					"name": "errorlist",
80
-					"pathName": "pages/main/errorlist"
80
+					"pathName": "pages/main/errorlist",
81
+					"query": ""
82
+				},
83
+				{
84
+					"id": -1,
85
+					"name": "share",
86
+					"pathName": "pages/about/share",
87
+					"query": ""
81
 				}
88
 				}
82
 			]
89
 			]
83
 		}
90
 		}

+ 1 - 1
utils/main.js

@@ -297,7 +297,7 @@ function playSound(file){
297
   innerAudioContext.autoplay = true
297
   innerAudioContext.autoplay = true
298
   innerAudioContext.src = file
298
   innerAudioContext.src = file
299
   innerAudioContext.onPlay(() => {
299
   innerAudioContext.onPlay(() => {
300
-    console.log('开始播放')
300
+    //console.log('开始播放')
301
   })
301
   })
302
 }
302
 }
303
 
303