Browse Source

zhao:解决冲突

tags/录制修改前
耀 4 years ago
parent
commit
4d79376dea

+ 1
- 0
Common/Common.csproj View File

@@ -137,6 +137,7 @@
137 137
     <Compile Include="Properties\AssemblyInfo.cs" />
138 138
     <Compile Include="system\SplashScreen.cs" />
139 139
     <Compile Include="system\XmlUtilHelper.cs" />
140
+    <Compile Include="system\ZJClippingBorder.cs" />
140 141
   </ItemGroup>
141 142
   <ItemGroup>
142 143
     <Folder Include="dlls\" />

+ 84
- 190
Common/system/BlackboardNew.cs View File

@@ -276,10 +276,6 @@ namespace Common.system
276 276
                         undoOrRedo += 1;
277 277
                         m_canvas.Strokes.Clear();
278 278
                     }
279
-
280
-                   
281
-
282
-
283 279
                     StrokeCollection strokes = new StrokeCollection();
284 280
                     StylusPointCollection stylusPoints = new StylusPointCollection();
285 281
                     System.Windows.Input.StylusPointDescription stylusPointDescription = new StylusPointDescription();
@@ -295,37 +291,6 @@ namespace Common.system
295 291
                     stroke = new Stroke(stylusPoints);
296 292
                     page.lines.Last().lines_curr.Add(stroke);
297 293
                     m_canvas.Strokes.Add(page.lines.Last().lines_curr);
298
-                    //stylusPoint.X = 586;
299
-                    //stylusPoint.Y = 214;
300
-                    //stylusPoints.Add(stylusPoint);
301
-                    //stroke = new Stroke(stylusPoints);
302
-
303
-                    //stylusPoint.X = 599;
304
-                    //stylusPoint.Y = 214;
305
-                    //stylusPoints.Add(stylusPoint);
306
-                    //stroke = new Stroke(stylusPoints);
307
-                    //stylusPoint.X = 623;
308
-                    //stylusPoint.Y = 214;
309
-                    //stylusPoints.Add(stylusPoint);
310
-                    //stroke = new Stroke(stylusPoints);
311
-
312
-                    //stylusPoint.X = 663;
313
-                    //stylusPoint.Y = 214;
314
-                    //stylusPoints.Add(stylusPoint);
315
-                    //stroke = new Stroke(stylusPoints);
316
-                    //stylusPoint.X = 963;
317
-                    //stylusPoint.Y = 214;
318
-                    //stylusPoints.Add(stylusPoint);
319
-                    //stroke = new Stroke(stylusPoints);
320
-                    //DrawingAttributes drawingAttributes = new DrawingAttributes();
321
-                    //m_canvas.DefaultDrawingAttributes = drawingAttributes;
322
-                    //drawingAttributes.Color = Colors.Red;
323
-                    //drawingAttributes.Width = pensize;
324
-                    //drawingAttributes.Height = pensize;
325
-                    //drawingAttributes.FitToCurve = true;
326
-                    //drawingAttributes.IgnorePressure = false;
327
-                    //stroke.DrawingAttributes = drawingAttributes;
328
-                    //m_canvas.Strokes.Add(stroke);
329 294
                 }
330 295
             }
331 296
         }
@@ -333,131 +298,59 @@ namespace Common.system
333 298
         StylusPoint stylusPoint = new StylusPoint();
334 299
         Stroke stroke;
335 300
         bool isFirst = true;
336
-        //public void changepages(double _x, double _y, bool _new, Color _color, int _size, int i)
337
-        //{
338
-        //    if (_new)
339
-        //    {
340
-        //        if (stroke != null && stroke.StylusPoints.Count > 1)
341
-        //        {
342
-        //            drawingAttributes = new DrawingAttributes();
343
-        //            //m_canvas.DefaultDrawingAttributes = drawingAttributes;
344
-        //            drawingAttributes.Color = _color;
345
-        //            drawingAttributes.Width = _size;
346
-        //            drawingAttributes.Height = _size;
347
-        //            drawingAttributes.FitToCurve = true;
348
-        //            drawingAttributes.IgnorePressure = false;
349
-        //            stroke.DrawingAttributes = drawingAttributes;
350
-        //            m_canvas.Strokes.Add(stroke);
351
-        //            isFirst = true;
352
-
353
-        //            strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
354
-        //            //int currCount = strokes_page_all[i].lines.Last().lines_curr.Count;
355
-        //            //if (currCount > 0)
356
-        //            //{
357
-        //            //    strokes_page_all[i].lines.Last().lines_curr[currCount - 1].add = stroke;
358
-        //            //}
359
-
360
-
361
-        //        }
362
-
363
-        //        stylusPoints = new StylusPointCollection();
364
-        //        stylusPoint = new StylusPoint();
365
-        //        //stroke = new Stroke(stylusPoints);
366
-        //        stroke = null;
367
-        //    }
368
-        //    else
369
-        //    {
370
-        //        if (isFirst)
371
-        //        {
372
-        //            stylusPoint.X = _x;
373
-        //            stylusPoint.Y = _y;
374
-        //            stylusPoints.Add(stylusPoint);
375
-        //            if (stylusPoints.Count > 1)
376
-        //            {
377
-        //                stroke = new Stroke(stylusPoints);
378
-        //                m_canvas.Strokes.Add(stroke);
379
-        //                isFirst = false;
380
-        //            }
381
-        //        }
382
-        //        else
383
-        //        {
384
-        //            if (m_canvas.Strokes.Count>0)
385
-        //            {
386
-
387
-
388
-        //                stylusPoint.X = _x;
389
-        //            stylusPoint.Y = _y;
390
-        //            stylusPoints.Add(stylusPoint);
391
-        //            stroke = new Stroke(stylusPoints);
392
-        //            m_canvas.Strokes[m_canvas.Strokes.Count - 1].StylusPoints.Add(stylusPoints);
393
-        //            }
394
-        //        }
395
-        //    }
396
-        //}
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413 301
         public void changepages(double _x, double _y, bool _new, Color _color, int _size, int i)
414 302
         {
415
-            try
303
+            if (_new)
416 304
             {
417
-                if (_new)
305
+                if (stroke != null && stroke.StylusPoints.Count > 1)
418 306
                 {
419
-                    if (stroke != null && stroke.StylusPoints.Count > 1)
307
+                    isFirst = true;
308
+                    strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
309
+                }
310
+                stylusPoints = new StylusPointCollection();
311
+                stylusPoint = new StylusPoint();
312
+                stroke = null;
313
+            }
314
+            else
315
+            {
316
+                if (isFirst)
317
+                {
318
+                    stylusPoint.X = _x;
319
+                    stylusPoint.Y = _y;
320
+                    stylusPoints.Add(stylusPoint);
321
+                    if (stylusPoints.Count > 1)
420 322
                     {
323
+                        stroke = new Stroke(stylusPoints);
421 324
                         drawingAttributes = new DrawingAttributes();
422
-                        //m_canvas.DefaultDrawingAttributes = drawingAttributes;
423 325
                         drawingAttributes.Color = _color;
424
-                        drawingAttributes.Width = _size * 5;
425
-                        drawingAttributes.Height = _size * 5;
326
+                        drawingAttributes.Width = _size*4.5;
327
+                        drawingAttributes.Height = _size * 4.5;
426 328
                         drawingAttributes.FitToCurve = true;
427 329
                         drawingAttributes.IgnorePressure = false;
428
-
429 330
                         stroke.DrawingAttributes = drawingAttributes;
430
-                        //m_canvas.DefaultDrawingAttributes= drawingAttributes;
431
-
432 331
                         m_canvas.Strokes.Add(stroke);
433
-                        strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
434
-
435
-                        //int currCount= strokes_page_all[i].lines.Last().lines_curr.Count;
436
-                        //if (currCount > 0)
437
-                        //{
438
-                        //    strokes_page_all[i].lines.Last().lines_curr[currCount - 1] = stroke;
439
-                        //}
440
-                        stroke = null;
332
+                        isFirst = false;
441 333
                     }
442
-                    stylusPoints = new StylusPointCollection();
443
-                    stylusPoint = new StylusPoint();
444
-                    //stroke = new Stroke(stylusPoints);
445
-                    //stroke = null;
446 334
                 }
447 335
                 else
448 336
                 {
449
-                    //stylusPoints = new StylusPointCollection();
450
-                    //stylusPoint = new StylusPoint();
451
-                    stylusPoint.X = _x;
452
-                    stylusPoint.Y = _y;
453
-                    stylusPoints.Add(stylusPoint);
454
-                    stroke = new Stroke(stylusPoints);
337
+                    if (m_canvas.Strokes.Count > 0)
338
+                    {
339
+                        stylusPoint.X = _x;
340
+                        stylusPoint.Y = _y;
341
+                        stylusPoints.Add(stylusPoint);
342
+                        stroke = new Stroke(stylusPoints);
343
+                        drawingAttributes = new DrawingAttributes();
344
+                        drawingAttributes.Color = _color;
345
+                        drawingAttributes.Width = _size * 4.5;
346
+                        drawingAttributes.Height = _size * 4.5;
347
+                        drawingAttributes.FitToCurve = true;
348
+                        drawingAttributes.IgnorePressure = false;
349
+                        stroke.DrawingAttributes = drawingAttributes;
350
+                        m_canvas.Strokes[m_canvas.Strokes.Count - 1] = stroke;
351
+                    }
455 352
                 }
456 353
             }
457
-            catch (Exception ex)
458
-            {
459
-                LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(changepages)点阵比书写报错:" + ex.Message, ex);
460
-            }
461 354
         }
462 355
 
463 356
 
@@ -465,63 +358,64 @@ namespace Common.system
465 358
 
466 359
 
467 360
 
468
-        ////声明一个 DrawingAttributes 类型的变量  
469
-        //DrawingAttributes drawingAttributes;
470
-        //public void changepaget(double _x, double _y, bool _new,InkCanvas canvas) 
471
-        //{
472
-        //    if (_new)
473
-        //    {
474
-        //        if (stroke != null && stroke.StylusPoints.Count > 1)
475
-        //        {
476
-        //            //m_canvas.Strokes.Add(stroke);
477
-        //            DrawingAttributes drawingAttributes = new DrawingAttributes();
478
-        //            canvas.DefaultDrawingAttributes = drawingAttributes;
479
-        //            drawingAttributes.Width = pensize;
480
-        //            drawingAttributes.Height = pensize;
481
-        //            drawingAttributes.Color = Colors.Red;
482
-        //            drawingAttributes.FitToCurve = true;
483
-        //            drawingAttributes.IgnorePressure = false;
484
-        //            canvas.DefaultDrawingAttributes = drawingAttributes;
485
-        //            canvas.Strokes.Add(stroke);
486
-
487
-        //            ZBBPage page = strokes_page_all[pagenum];
488
-        //            if (page != null)
489
-        //            {
490
-        //                step.lines_curr.Add(m_canvas.Strokes);
491
-        //                page.lines.Add(step);
492
-        //                step = null;
493
-        //            }
494
-        //        }
495 361
 
496
-        //        stylusPoints = new StylusPointCollection();
497
-        //        stylusPoint = new StylusPoint();
498
-        //        //stroke = new Stroke(stylusPoints);
499
-        //        stroke = null;
500
-        //    }
501
-        //    else
502
-        //    {
503
-        //       change_pen(Colors.Red);
504
-        //        //stylusPoints = new StylusPointCollection();
505
-        //        //stylusPoint = new StylusPoint();
506
-        //        stylusPoint.X = _x;
507
-        //        stylusPoint.Y = _y;
508
-        //        stylusPoints.Add(stylusPoint);
509
-        //        stroke = new Stroke(stylusPoints);
510
-        //        //m_canvas.
511 362
 
512
-        //        //page.lines.Last().lines_curr
513 363
 
514
-        //    }
515 364
 
516 365
 
517
-        //    //page.lines.Last().lines_curr.Add();
518
-        //    //if (stroke.StylusPoints.Count > 20)
519
-        //    //{
520 366
 
521 367
 
522 368
 
523 369
 
524 370
 
371
+        //public void changepages(double _x, double _y, bool _new, Color _color, int _size, int i)
372
+        //{
373
+        //    try
374
+        //    {
375
+        //        if (_new)
376
+        //        {
377
+        //            if (stroke != null && stroke.StylusPoints.Count > 1)
378
+        //            {
379
+        //                drawingAttributes = new DrawingAttributes();
380
+        //                //m_canvas.DefaultDrawingAttributes = drawingAttributes;
381
+        //                drawingAttributes.Color = _color;
382
+        //                drawingAttributes.Width = _size * 5;
383
+        //                drawingAttributes.Height = _size * 5;
384
+        //                drawingAttributes.FitToCurve = true;
385
+        //                drawingAttributes.IgnorePressure = false;
386
+
387
+        //                stroke.DrawingAttributes = drawingAttributes;
388
+        //                //m_canvas.DefaultDrawingAttributes= drawingAttributes;
389
+
390
+        //                m_canvas.Strokes.Add(stroke);
391
+        //                strokes_page_all[i].lines.Last().lines_curr.Add(stroke);
392
+
393
+        //                //int currCount= strokes_page_all[i].lines.Last().lines_curr.Count;
394
+        //                //if (currCount > 0)
395
+        //                //{
396
+        //                //    strokes_page_all[i].lines.Last().lines_curr[currCount - 1] = stroke;
397
+        //                //}
398
+        //                stroke = null;
399
+        //            }
400
+        //            stylusPoints = new StylusPointCollection();
401
+        //            stylusPoint = new StylusPoint();
402
+        //            //stroke = new Stroke(stylusPoints);
403
+        //            //stroke = null;
404
+        //        }
405
+        //        else
406
+        //        {
407
+        //            //stylusPoints = new StylusPointCollection();
408
+        //            //stylusPoint = new StylusPoint();
409
+        //            stylusPoint.X = _x;
410
+        //            stylusPoint.Y = _y;
411
+        //            stylusPoints.Add(stylusPoint);
412
+        //            stroke = new Stroke(stylusPoints);
413
+        //        }
414
+        //    }
415
+        //    catch (Exception ex)
416
+        //    {
417
+        //        LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(changepages)点阵比书写报错:" + ex.Message, ex);
418
+        //    }
525 419
         //}
526 420
     }
527 421
 }

+ 49
- 0
Common/system/HttpHelper.cs View File

@@ -545,5 +545,54 @@ namespace Common.system
545 545
                 httpReq = null;
546 546
             }
547 547
         }
548
+        /// <summary>
549
+        /// Post Http请求
550
+        /// </summary>
551
+        /// <param name="url"></param>
552
+        /// <param name="postData"></param>
553
+        /// <param name="timeout"></param>
554
+        /// <param name="contentType"></param>
555
+        /// <param name="encode"></param>
556
+        /// <returns>响应流字符串</returns>
557
+        public static string PostAndRespStr(string url, string postData = "", int timeout = 5000, string contentType = "application/json;", string encode = "UTF-8")
558
+        {
559
+            if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(encode) && !string.IsNullOrEmpty(contentType) && postData != null)
560
+            {
561
+                HttpWebResponse webResponse = null;
562
+                Stream responseStream = null;
563
+                Stream requestStream = null;
564
+                StreamReader streamReader = null;
565
+                try
566
+                {
567
+                    return GetStreamReader(url, responseStream, requestStream, streamReader, webResponse, timeout, encode, postData, contentType);
568
+                }
569
+                catch (Exception)
570
+                {
571
+                }
572
+                finally
573
+                {
574
+                    if (responseStream != null)
575
+                    {
576
+                        responseStream.Dispose();
577
+                    }
578
+
579
+                    if (webResponse != null)
580
+                    {
581
+                        webResponse.Close();
582
+                    }
583
+
584
+                    if (requestStream != null)
585
+                    {
586
+                        requestStream.Dispose();
587
+                    }
588
+
589
+                    if (streamReader != null)
590
+                    {
591
+                        streamReader.Dispose();
592
+                    }
593
+                }
594
+            }
595
+            return null;
596
+        }
548 597
     }
549 598
 }

+ 98
- 0
Common/system/ZJClippingBorder.cs View File

@@ -0,0 +1,98 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using System.Windows;
7
+using System.Windows.Controls;
8
+using System.Windows.Media;
9
+
10
+namespace Common.system
11
+{
12
+    public class ZJClippingBorder : Border
13
+    {
14
+        private object _oldClip;
15
+
16
+        protected override void OnRender(DrawingContext dc)
17
+        {
18
+            OnApplyChildClip();
19
+            base.OnRender(dc);
20
+        }
21
+
22
+        public override UIElement Child
23
+        {
24
+            get => base.Child;
25
+            set
26
+            {
27
+                if (Child != value)
28
+                {
29
+                    if (Child != null)
30
+                    {
31
+                        Child.SetValue(ClipProperty, _oldClip);
32
+                    }
33
+
34
+                    if (value != null)
35
+                    {
36
+                        _oldClip = value.ReadLocalValue(ClipProperty);
37
+                    }
38
+                    else
39
+                    {
40
+                        // If we dont set it to null we could leak a Geometry object
41
+                        _oldClip = null;
42
+                    }
43
+
44
+                    base.Child = value;
45
+                }
46
+            }
47
+        }
48
+
49
+        protected virtual void OnApplyChildClip()
50
+        {
51
+            UIElement child = Child;
52
+            if (child != null)
53
+            {
54
+                double top = Math.Max(CornerRadius.TopLeft, CornerRadius.TopRight);
55
+                double bottom = Math.Max(CornerRadius.BottomLeft, CornerRadius.BottomRight);
56
+                double max = Math.Max(top, bottom);
57
+                Size size = RenderSize;
58
+                double width = size.Width - (BorderThickness.Left + BorderThickness.Right);
59
+                double height = size.Height - (BorderThickness.Top + BorderThickness.Bottom);
60
+                Geometry result = new RectangleGeometry(new Rect(0, 0, width, height), max, max);
61
+                double halfWidth = width / 2;
62
+                double halfHeight = height / 2;
63
+
64
+                if (CornerRadius.TopLeft == 0)
65
+                {
66
+                    result = new CombinedGeometry(
67
+                        GeometryCombineMode.Union,
68
+                        result,
69
+                        new RectangleGeometry(new Rect(0, 0, halfWidth, halfHeight))
70
+                    );
71
+                }
72
+
73
+                if (CornerRadius.TopRight == 0)
74
+                {
75
+                    result = new CombinedGeometry(GeometryCombineMode.Union, result, new RectangleGeometry
76
+                (new Rect(halfWidth, 0, halfWidth, halfHeight)));
77
+                }
78
+
79
+                if (CornerRadius.BottomLeft == 0)
80
+                {
81
+                    result = new CombinedGeometry
82
+                  (GeometryCombineMode.Union, result, new RectangleGeometry
83
+                  (new Rect(0, halfHeight, halfWidth, halfHeight)));
84
+                }
85
+                if (CornerRadius.BottomRight == 0)
86
+                {
87
+                    result = new CombinedGeometry
88
+                  (
89
+                GeometryCombineMode.Union,
90
+                result,
91
+                new RectangleGeometry(new Rect(halfWidth, halfHeight, halfWidth, halfHeight))
92
+                );
93
+                }
94
+                child.Clip = result;
95
+            }
96
+        }
97
+    }
98
+}

+ 38
- 0
XHWK.Model/Model_App.cs View File

@@ -0,0 +1,38 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHWK.Model
8
+{
9
+    public class Model_App
10
+    {
11
+        public int versionid { get; set; }
12
+
13
+
14
+        //构建版
15
+        public int versioncode { get; set; }
16
+
17
+
18
+        //版本名称
19
+        public string versionname { get; set; }
20
+
21
+        //大小字节
22
+        public int appsize { get; set; }
23
+
24
+
25
+        //app路径
26
+        public string versionpath { get; set; }
27
+
28
+        //创建人
29
+        public int createid { get; set; }
30
+
31
+
32
+        //创建时间
33
+        public int createtime { get; set; }
34
+
35
+        //版本描述
36
+        public string versioncomm { get; set; }
37
+    }
38
+}

+ 15
- 0
XHWK.Model/ResultVo.cs View File

@@ -0,0 +1,15 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHWK.Model
8
+{
9
+    public class ResultVo<T>
10
+    {
11
+        public int code { get; set; }
12
+        public string msg { get; set; }
13
+        public T obj { get; set; }
14
+    }
15
+}

+ 2
- 0
XHWK.Model/XHWK.Model.csproj View File

@@ -50,6 +50,7 @@
50 50
     <Reference Include="System.Xml" />
51 51
   </ItemGroup>
52 52
   <ItemGroup>
53
+    <Compile Include="Model_App.cs" />
53 54
     <Compile Include="Model_Canvas.cs" />
54 55
     <Compile Include="Model_DrawData.cs" />
55 56
     <Compile Include="Model_Page.cs" />
@@ -59,6 +60,7 @@
59 60
     <Compile Include="Model_WKData.cs" />
60 61
     <Compile Include="NotifyModel.cs" />
61 62
     <Compile Include="Properties\AssemblyInfo.cs" />
63
+    <Compile Include="ResultVo.cs" />
62 64
     <Compile Include="ViewModel.cs" />
63 65
   </ItemGroup>
64 66
   <ItemGroup>

+ 4
- 4
XHWK.WKTool/App.cs View File

@@ -127,10 +127,10 @@ namespace XHWK.WKTool
127 127
         /// 打印
128 128
         /// </summary>
129 129
         public static PrintWindow W_PrintWindow = null;
130
-        ///// <summary>
131
-        ///// 提示窗口
132
-        ///// </summary>
133
-        //public static PromptWindow W_PromptWindow = null;
130
+        /// <summary>
131
+        /// 提示窗口
132
+        /// </summary>
133
+        public static PromptWindow W_PromptWindow = null;
134 134
         #endregion
135 135
         #endregion
136 136
 

+ 163
- 0
XHWK.WKTool/AppUpdateWin.xaml View File

@@ -0,0 +1,163 @@
1
+<Window x:Class="XHWK.WKTool.AppUpdateWin"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHWK.WKTool" xmlns:Views="clr-namespace:Common.system;assembly=Common"
7
+        mc:Ignorable="d"
8
+        Title="AppUpdateWin"    Width="480"
9
+    Height="330"
10
+    AllowsTransparency="True"
11
+    Background="Transparent"
12
+    MouseLeftButtonDown="Window_MouseLeftButtonDown_1"
13
+    ShowInTaskbar="False"
14
+    Topmost="True"
15
+    WindowStartupLocation="CenterScreen"
16
+    WindowStyle="None"
17
+    >
18
+    <Grid>
19
+        <Views:ZJClippingBorder
20
+            Margin="10"
21
+            Background="#fafafa"
22
+            CornerRadius="10">
23
+            <Border.Effect>
24
+                <DropShadowEffect
25
+                    BlurRadius="10"
26
+                    Opacity="1"
27
+                    ShadowDepth="0"
28
+                    Color="#cccccc" />
29
+            </Border.Effect>
30
+        </Views:ZJClippingBorder>
31
+
32
+        <Views:ZJClippingBorder
33
+            Margin="10"
34
+            Background="#fafafa"
35
+            CornerRadius="10">
36
+
37
+            <Grid>
38
+                <Grid.RowDefinitions>
39
+                    <RowDefinition Height="64" />
40
+                    <RowDefinition Height="*" />
41
+                    <RowDefinition Height="64" />
42
+                </Grid.RowDefinitions>
43
+                <StackPanel Grid.Row="0" Orientation="Horizontal">
44
+                    <Image
45
+                        Width="63"
46
+                        Margin="10,0,0,0"
47
+                        VerticalAlignment="Center"
48
+                        Source="/Images/APP.png" />
49
+
50
+                    <TextBlock
51
+                        Grid.Row="0"
52
+                        Margin="0,0,0,0"
53
+                        VerticalAlignment="Center"
54
+                        FontSize="26"
55
+                        Foreground="#333333"
56
+                        Text="应用更新" />
57
+                </StackPanel>
58
+                <ScrollViewer
59
+                    Name="content_sv"
60
+                    Grid.Row="1"
61
+                    Margin="10,10,10,10"
62
+                    HorizontalScrollBarVisibility="Disabled"
63
+                    VerticalScrollBarVisibility="Auto">
64
+                    <TextBlock
65
+                        x:Name="appmsg_tb"
66
+                        Margin="10,10,10,10"
67
+                        FontSize="14"
68
+                        Foreground="#333333"
69
+                        LineHeight="30"
70
+                        Text="{Binding appModel.versioncomm}" />
71
+                </ScrollViewer>
72
+
73
+                <UniformGrid
74
+                    x:Name="button_bottom"
75
+                    Grid.Row="2"
76
+                    Columns="2"
77
+                    Rows="1">
78
+                    <Button Cursor="Hand"
79
+                        Grid.Row="7"
80
+                        Grid.ColumnSpan="2"
81
+                        Width="190"
82
+                        Height="42"
83
+                        Click="Button_Click"
84
+                        Content="取消"
85
+                        FontSize="20"
86
+                        Foreground="White">
87
+                        <Button.Template>
88
+                            <ControlTemplate TargetType="{x:Type Button}">
89
+                                <Border
90
+                                    BorderBrush="{TemplateBinding Control.BorderBrush}"
91
+                                    BorderThickness="0"
92
+                                    CornerRadius="21">
93
+                                    <Border.Background>#E9E9E9</Border.Background>
94
+                                    <ContentPresenter
95
+                                        HorizontalAlignment="Center"
96
+                                        VerticalAlignment="Center"
97
+                                        Content="{TemplateBinding ContentControl.Content}" />
98
+                                </Border>
99
+                            </ControlTemplate>
100
+                        </Button.Template>
101
+                    </Button>
102
+                    <Button Cursor="Hand"
103
+                        Grid.Row="7"
104
+                        Grid.ColumnSpan="2"
105
+                        Width="190"
106
+                        Height="42"
107
+                        Click="gengxinClick"
108
+                        Content="更新"
109
+                        FontSize="20"
110
+                        Foreground="White">
111
+                        <Button.Template>
112
+                            <ControlTemplate TargetType="{x:Type Button}">
113
+                                <Border
114
+                                    BorderBrush="{TemplateBinding Control.BorderBrush}"
115
+                                    BorderThickness="0"
116
+                                    CornerRadius="21">
117
+                                    <Border.Background>#2D8CF0</Border.Background>
118
+                                    <ContentPresenter
119
+                                        HorizontalAlignment="Center"
120
+                                        VerticalAlignment="Center"
121
+                                        Content="{TemplateBinding ContentControl.Content}" />
122
+                                </Border>
123
+                            </ControlTemplate>
124
+                        </Button.Template>
125
+                    </Button>
126
+                </UniformGrid>
127
+
128
+                <Grid
129
+                    x:Name="progress_sp"
130
+                    Grid.Row="1"
131
+                    Grid.RowSpan="2"
132
+                    Visibility="Collapsed">
133
+                    <StackPanel
134
+                        Height="Auto"
135
+                        VerticalAlignment="Center"
136
+                        Orientation="Vertical">
137
+                        <TextBlock
138
+                            x:Name="parogress_tb"
139
+                            Margin="10,10,10,10"
140
+                            HorizontalAlignment="Center"
141
+                            FontSize="23"
142
+                            Foreground="#333333"
143
+                            LineHeight="30"
144
+                            Text="正在更新,已下载0%" />
145
+
146
+                        <Views:ZJClippingBorder
147
+                            Height="12"
148
+                            Margin="20,20,20,20"
149
+                            CornerRadius="6"
150
+                            SnapsToDevicePixels="True">
151
+                            <ProgressBar
152
+                                x:Name="mprogress"
153
+                                BorderThickness="0"
154
+                                Foreground="#2D8CF0"
155
+                                Maximum="100"
156
+                                Minimum="0" />
157
+                        </Views:ZJClippingBorder>
158
+                    </StackPanel>
159
+                </Grid>
160
+            </Grid>
161
+        </Views:ZJClippingBorder>
162
+    </Grid>
163
+</Window>

+ 114
- 0
XHWK.WKTool/AppUpdateWin.xaml.cs View File

@@ -0,0 +1,114 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Diagnostics;
4
+using System.IO;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+using System.Windows;
9
+using System.Windows.Controls;
10
+using System.Windows.Data;
11
+using System.Windows.Documents;
12
+using System.Windows.Input;
13
+using System.Windows.Media;
14
+using System.Windows.Media.Imaging;
15
+using System.Windows.Shapes;
16
+using XHWK.Model;
17
+using XHWK.WKTool.Config;
18
+using XHWK.WKTool.Helpers;
19
+using static XHWK.WKTool.Helpers.ZJDownloadUtil;
20
+
21
+namespace XHWK.WKTool
22
+{
23
+    /// <summary>
24
+    /// AppUpdateWin.xaml 的交互逻辑
25
+    /// </summary>
26
+    public partial class AppUpdateWin : Window, ZJDownloadCallback
27
+    {
28
+        private readonly AppUpdatePageModel pageData = new AppUpdatePageModel();
29
+
30
+        public AppUpdateWin(Model_App app)
31
+        {
32
+            InitializeComponent();
33
+            pageData.appModel = app;
34
+
35
+            DataContext = pageData;
36
+        }
37
+
38
+        private void btnDown_Click(object sender, RoutedEventArgs e)
39
+        {
40
+            Close();
41
+        }
42
+
43
+        private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
44
+        {
45
+            DragMove();
46
+        }
47
+
48
+        public class AppUpdatePageModel : NotifyModel
49
+        {
50
+            public Model_App appModel { get; set; }
51
+        }
52
+
53
+        private void Button_Click(object sender, RoutedEventArgs e)
54
+        {
55
+            Close();
56
+        }
57
+
58
+        private void gengxinClick(object sender, RoutedEventArgs e)
59
+        {
60
+            string fileUrl = ZConfig.showImageUrl + pageData.appModel.versionpath;
61
+
62
+            string temp = System.Environment.GetEnvironmentVariable("TEMP");
63
+            DirectoryInfo info = new DirectoryInfo(temp);
64
+            if (!info.Exists)
65
+            {
66
+                info.Create();
67
+            }
68
+
69
+            System.Console.WriteLine("fileUrl:" + fileUrl);
70
+            string filename = fileUrl.Substring(fileUrl.LastIndexOf("/") + 1);
71
+            if (filename != null)
72
+            {
73
+                ZJDownloadUtil.downloadFileWithCallback(fileUrl, 999, Dispatcher, this);
74
+            }
75
+        }
76
+
77
+        public void downloadBegin(int position)
78
+        {
79
+            progress_sp.Visibility = Visibility.Visible;
80
+            content_sv.Visibility = Visibility.Collapsed;
81
+            button_bottom.Visibility = Visibility.Collapsed;
82
+        }
83
+
84
+        public void downloadProgress(int position, int progress)
85
+        {
86
+            mprogress.Value = progress;
87
+            parogress_tb.Text = $"正在更新,已下载{progress}%";
88
+        }
89
+
90
+        public void downloadEnd(int position, string filepath)
91
+        {
92
+            System.Console.WriteLine("filepath:" + filepath);
93
+            progress_sp.Visibility = Visibility.Collapsed;
94
+            content_sv.Visibility = Visibility.Visible;
95
+            button_bottom.Visibility = Visibility.Visible;
96
+            ProcessStartInfo psi = new ProcessStartInfo(filepath);
97
+            Process pro = new Process
98
+            {
99
+                StartInfo = psi
100
+            };
101
+            pro.Start();
102
+            Dispatcher.Invoke(new Action(() =>
103
+            {
104
+                System.Environment.Exit(0);
105
+            }));
106
+            Close();
107
+        }
108
+
109
+        public void downloadError(int position, string msg)
110
+        {
111
+            MessageBox.Show(msg);
112
+        }
113
+    }
114
+}

+ 51
- 0
XHWK.WKTool/Config/ZConfig.cs View File

@@ -0,0 +1,51 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHWK.WKTool.Config
8
+{
9
+    internal class ZConfig
10
+    {
11
+        public static bool isDebug = true;
12
+
13
+        /// <summary>
14
+        /// 当前版本号
15
+        /// </summary>
16
+        public static int versionCode = 1;
17
+
18
+        public static string versionName = "1.0.0";
19
+
20
+        //接口地址
21
+        public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";
22
+
23
+        //图片地址
24
+        public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : "http://schoolfile.xhkjedu.com/";
25
+
26
+        public static string showImageUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/static/" : "http://schoolfile.xhkjedu.com/static/";
27
+
28
+        public static string secretKey = "nanhuakaizhangjianwangni";
29
+        public static string fileStorageAddress = "";
30
+
31
+        //认证接口地址
32
+        public static string certapiUrl = isDebug ? "http://certapitest.xhkjedu.com" : "http://certapi.xhkjedu.com";
33
+
34
+        /// <summary>
35
+        /// 数据存放目录
36
+        /// </summary>
37
+        public static string dataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Signature\\";
38
+
39
+        public static string basePath = AppDomain.CurrentDomain.BaseDirectory;
40
+
41
+        //缓存图片地址
42
+        public static string tempPath = basePath + "temp\\";
43
+
44
+        public static string nginxHtml = $"{basePath}nginx\\html\\";
45
+
46
+   
47
+        public static string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
48
+
49
+        public static string tongPingBasePath = $"{nginxHtml}tongping\\";
50
+    }
51
+}

+ 1
- 1
XHWK.WKTool/CreateAMicroLessonWindow.xaml View File

@@ -7,7 +7,7 @@
7 7
         mc:Ignorable="d"
8 8
         Title="星火微课" Height="341" Width="454"   AllowsTransparency="True"
9 9
     WindowStartupLocation="CenterScreen"
10
-    WindowStyle="None">
10
+    WindowStyle="None" Loaded="Window_Loaded">
11 11
     <Viewbox>
12 12
         <Grid Height="341" Width="454" >
13 13
             <!--分4行-->

+ 47
- 0
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

@@ -1,9 +1,12 @@
1 1
 using Common.system;
2 2
 
3 3
 using System;
4
+using System.Threading;
4 5
 using System.Windows;
5 6
 using System.Windows.Forms;
6 7
 using System.Windows.Input;
8
+using XHWK.Model;
9
+using XHWK.WKTool.Config;
7 10
 
8 11
 namespace XHWK.WKTool
9 12
 {
@@ -138,5 +141,49 @@ namespace XHWK.WKTool
138 141
             DragMove();
139 142
         }
140 143
         #endregion
144
+
145
+        /// <summary>
146
+        /// 检测APP更新
147
+        /// </summary>
148
+        private void getNewApp()
149
+        {
150
+            new Thread(o =>
151
+            {
152
+                string url = ZConfig.apiUrl + "/apprecord/get_new";
153
+
154
+                string result = HttpHelper.PostAndRespStr(url, "{}");
155
+                Model.ResultVo<Model_App> resultObj = JsonHelper.JsonToObj<Model.ResultVo<Model_App>>(result);
156
+                if (result != null && resultObj.code == 0)
157
+                {
158
+                    if (resultObj.obj != null)
159
+                    {
160
+                        int versionCode = resultObj.obj.versioncode;
161
+                        int versionThis = ZConfig.versionCode;
162
+                        if (versionThis < versionCode)
163
+                        {
164
+                            Dispatcher.Invoke(new Action(() =>
165
+                            {
166
+                                appUpdateShow(resultObj.obj);
167
+                            }));
168
+                        }
169
+                    }
170
+                }
171
+            }).Start();
172
+        }
173
+        /// <summary>
174
+        /// 应用更新
175
+        /// </summary>
176
+        /// <param name="app"></param>
177
+        private void appUpdateShow(Model_App app)
178
+        {
179
+            AppUpdateWin win = new AppUpdateWin(app);
180
+            win.Topmost = true;
181
+            win.Owner = this;
182
+            win.ShowDialog();
183
+        }
184
+        private void Window_Loaded(object sender, RoutedEventArgs e)
185
+        {
186
+            getNewApp();
187
+        }
141 188
     }
142 189
 }

+ 2
- 1
XHWK.WKTool/DAL/Interface.cs View File

@@ -5,6 +5,7 @@ using System.Linq;
5 5
 using System.Text;
6 6
 using System.Threading.Tasks;
7 7
 using XHWK.Model;
8
+using XHWK.WKTool.Config;
8 9
 
9 10
 namespace XHWK.WKTool.DAL
10 11
 {
@@ -20,7 +21,7 @@ namespace XHWK.WKTool.DAL
20 21
         /// <returns></returns>
21 22
         public int Login(string loginname, string loginpwd)
22 23
         {
23
-            string url = APIRequestAddress + "/user/login";//地址
24
+            string url = ZConfig.apiUrl + "/user/login";//地址 
24 25
             Dictionary<string, object> dic = new Dictionary<string, object>
25 26
             {
26 27
                 { "loginname", loginname},

+ 184
- 0
XHWK.WKTool/Helpers/ZJDownloadUtil.cs View File

@@ -0,0 +1,184 @@
1
+using System;
2
+using System.IO;
3
+using System.Net;
4
+using System.Threading;
5
+using System.Windows.Threading;
6
+
7
+namespace XHWK.WKTool.Helpers
8
+{
9
+    internal class ZJDownloadUtil
10
+    {
11
+        public static void downloadFile(string url, string savepath)
12
+        {
13
+            string path = savepath;
14
+            string filename = url.Substring(url.LastIndexOf("/") + 1);
15
+            if (!url.StartsWith("http") || filename == null || filename == "")
16
+            {
17
+                return;
18
+            }
19
+            path += filename;
20
+            // 设置参数
21
+            HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
22
+            //发送请求并获取相应回应数据
23
+            HttpWebResponse response = request.GetResponse() as HttpWebResponse;
24
+            //直到request.GetResponse()程序才开始向目标网页发送Post请求
25
+            Stream responseStream = response.GetResponseStream();
26
+
27
+            //创建本地文件写入流
28
+            Stream stream = new FileStream(path, FileMode.Create);
29
+
30
+            byte[] bArr = new byte[1024];
31
+            int size = responseStream.Read(bArr, 0, bArr.Length);
32
+            while (size > 0)
33
+            {
34
+                stream.Write(bArr, 0, size);
35
+                size = responseStream.Read(bArr, 0, bArr.Length);
36
+            }
37
+            stream.Close();
38
+            responseStream.Close();
39
+        }
40
+
41
+        /// <summary>
42
+        /// Http下载文件
43
+        /// </summary>
44
+        public static Thread downloadFileWithCallback(
45
+            string url,
46
+            int position,
47
+            string savepath,
48
+            Dispatcher dispatcher,
49
+            ZJDownloadCallback callback
50
+            )
51
+        {
52
+
53
+            string path = savepath;
54
+            string filename = url.Substring(url.LastIndexOf("/") + 1);
55
+            path += filename;
56
+            if (!url.StartsWith("http") || filename == null || filename == "")
57
+            {
58
+                return null;
59
+            }
60
+            Thread thread = new Thread(o =>
61
+            {
62
+                FileInfo fi = new FileInfo(path);
63
+                if (fi.Exists)
64
+                {
65
+                    dispatcher.Invoke(new Action(() =>
66
+                    {
67
+                        callback.downloadEnd(position, path);
68
+                    }));
69
+                }
70
+                else
71
+                {
72
+                    string temppath = path + ".tmp";
73
+                    if (File.Exists(temppath))
74
+                    {
75
+                        //File.Delete(temppath);
76
+                        temppath += "1";
77
+                        while (File.Exists(temppath))
78
+                        {
79
+                            temppath += "1";
80
+                            if (!File.Exists(temppath))
81
+                            {
82
+                                break;
83
+                            }
84
+                        }
85
+
86
+                    }
87
+
88
+                    dispatcher.Invoke(new Action(() =>
89
+                    {
90
+                        callback.downloadBegin(position);
91
+                    }));
92
+
93
+                    try
94
+                    {
95
+                        HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
96
+                        HttpWebResponse response = request.GetResponse() as HttpWebResponse;
97
+                        Stream responseStream = response.GetResponseStream();
98
+
99
+                        //创建本地文件写入流
100
+                        Stream stream = new FileStream(temppath, FileMode.Create);
101
+                        long totalSize = response.ContentLength;
102
+                        byte[] bArr = new byte[1024];
103
+                        int size = responseStream.Read(bArr, 0, bArr.Length);
104
+                        long readsize = 0;
105
+                        while (size > 0)
106
+                        {
107
+                            readsize += size;
108
+                            stream.Write(bArr, 0, size);
109
+                            size = responseStream.Read(bArr, 0, bArr.Length);
110
+
111
+                            dispatcher.Invoke(new Action(() =>
112
+                            {
113
+                                callback.downloadProgress(position, (int)(readsize * 100 / totalSize));
114
+                            }));
115
+                        }
116
+                        stream.Close();
117
+                        responseStream.Close();
118
+                        FileInfo fitemp = new FileInfo(temppath);
119
+                        fitemp.MoveTo(path);
120
+                        dispatcher.Invoke(new Action(() =>
121
+                        {
122
+                            callback.downloadEnd(position, path);
123
+                        }));
124
+                    }
125
+                    catch (Exception ex)
126
+                    {
127
+                        dispatcher.Invoke(new Action(() =>
128
+                        {
129
+                            callback.downloadError(position, ex.Message);
130
+                        }));
131
+
132
+                    }
133
+
134
+                }
135
+            });
136
+            thread.Start();
137
+            return thread;
138
+        }
139
+
140
+
141
+
142
+
143
+        public static void downloadFileWithCallback(
144
+            string url,
145
+            int position,
146
+            Dispatcher dispatcher,
147
+            ZJDownloadCallback callback
148
+            )
149
+        {
150
+            string path = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
151
+            downloadFileWithCallback(url, position, path, dispatcher, callback);
152
+        }
153
+
154
+        public interface ZJDownloadCallback
155
+        {
156
+            /// <summary>
157
+            /// 下载开始
158
+            /// </summary>
159
+            /// <param name="position"></param>
160
+            void downloadBegin(int position);
161
+
162
+            /// <summary>
163
+            /// 下载过程
164
+            /// </summary>
165
+            /// <param name="position"></param>
166
+            /// <param name="progress"></param>
167
+            void downloadProgress(int position, int progress);
168
+
169
+            /// <summary>
170
+            /// 下载结束
171
+            /// </summary>
172
+            /// <param name="position"></param>
173
+            /// <param name="filepath"></param>
174
+            void downloadEnd(int position, string filepath);
175
+            /// <summary>
176
+            /// 下载结束
177
+            /// </summary>
178
+            /// <param name="position"></param>
179
+            /// <param name="filepath"></param>
180
+            void downloadError(int position, string msg);
181
+
182
+        }
183
+    }
184
+}

BIN
XHWK.WKTool/Images/APP.png View File


+ 20
- 20
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

@@ -8,11 +8,12 @@
8 8
         xmlns:local="clr-namespace:XHWK.WKTool"
9 9
         mc:Ignorable="d"
10 10
         Title="星火微课系统" Height="1040" Width="1276" WindowStartupLocation="CenterScreen"
11
-    WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True"
11
+    WindowStyle="None"    AllowsTransparency="True"  Background="#EFF1F8" ShowInTaskbar="True" ResizeMode="CanMinimize"
12 12
    >
13 13
     
14 14
     <Viewbox>
15 15
         <Grid x:Name="GridContent" Height="1040">
16
+
16 17
             <!--分3行-->
17 18
             <Grid.RowDefinitions>
18 19
                 <RowDefinition Height="110"/>
@@ -114,7 +115,6 @@
114 115
                         </StackPanel>
115 116
                     </Button>
116 117
                 </StackPanel>
117
-                <Button Content="Button" HorizontalAlignment="Left" Margin="573,29,0,0" Grid.Row="1" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
118 118
             </Grid>
119 119
             <!--主内容-->
120 120
             <Grid Grid.Row="1" x:Name="GridMain" Width="1276">
@@ -206,41 +206,41 @@
206 206
                 </StackPanel>
207 207
             </Grid>
208 208
             <!--设置-->
209
-            <Grid Grid.Row="1" x:Name="gridSetUp" Margin="20,0,20,0" Background="#FFFFFF" Visibility="Collapsed">
209
+            <Grid Grid.Row="1" x:Name="gridSetUp"  Background="#FFFFFF" Visibility="Collapsed" Width="1276">
210 210
                 <Grid.RowDefinitions>
211 211
                     <RowDefinition Height="90"/>
212 212
                     <RowDefinition Height="70"/>
213
-                    <RowDefinition Height="70"/>
213
+                    <RowDefinition Height="50"/>
214 214
                     <RowDefinition Height="70"/>
215 215
                     <RowDefinition Height="70"/>
216 216
                     <RowDefinition Height="70"/>
217 217
                     <RowDefinition Height="70"/>
218 218
                     <RowDefinition Height="*"/>
219 219
                 </Grid.RowDefinitions>
220
-                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,30,0,0">
221
-                    <TextBlock Text="   点阵笔" FontSize="16" Foreground="#2D8CF0"/>
220
+                <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
221
+                    <TextBlock Text="   点阵笔" FontSize="16" Foreground="#2D8CF0" Width="80"/>
222 222
                     <TextBlock x:Name="txbNotConnecteds"  Text="未连接" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
223 223
                 </StackPanel>
224
-                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">
225
-                    <TextBlock Text="视频格式" FontSize="16" Foreground="#2D8CF0"/>
224
+                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
225
+                    <TextBlock Text="视频格式" FontSize="16" Foreground="#2D8CF0" Width="80"/>
226 226
                     <RadioButton x:Name="rbnMP4" Cursor="Hand" Content="MP4" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
227 227
                     <RadioButton x:Name="rbnFLV" Cursor="Hand" Content="FLV" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
228 228
                     <RadioButton x:Name="rbnAVI" Cursor="Hand" Content="AVI" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
229 229
                 </StackPanel>
230
-                <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">
231
-                    <TextBlock Text="头像位置" FontSize="16" Foreground="#2D8CF0"/>
230
+                <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
231
+                    <TextBlock Text="头像位置" FontSize="16" Foreground="#2D8CF0" Width="80"/>
232 232
                     <RadioButton Cursor="Hand" x:Name="rbnRight" Content="右上" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
233 233
                     <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Content="右下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
234 234
                     <RadioButton Cursor="Hand" x:Name="rbnLeft" Content="左上" FontSize="14" Foreground="#333333" Margin="20,2,0,0" />
235 235
                     <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Content="左下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
236 236
                 </StackPanel>
237
-                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">
238
-                    <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0"/>
237
+                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0" Visibility="Collapsed">
238
+                    <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
239 239
                     <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
240 240
                     <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
241 241
                 </StackPanel>
242
-                <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">
243
-                    <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Foreground="#2D8CF0" Padding="2,36,10,0"/>
242
+                <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
243
+                    <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Width="80"  Foreground="#2D8CF0" Padding="2,26,10,0"/>
244 244
                     <!--输入框-->
245 245
                     <Border Background="#CDD6E0" Width="525" Height="43" CornerRadius="3">
246 246
                         <Label x:Name="txbStoragePath" Content="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
@@ -263,16 +263,16 @@
263 263
                         </Button.Template>
264 264
                     </Button>
265 265
                 </StackPanel>
266
-                <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,30,0,0">
267
-                    <TextBlock Text="    版本号" FontSize="16" Foreground="#2D8CF0"/>
268
-                    <TextBlock Text="V0.0.0" FontSize="16" Foreground="#333333" Padding="10,0,0,0"/>
266
+                <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
267
+                    <TextBlock Text="    版本号" FontSize="16" Width="80" Foreground="#2D8CF0"/>
268
+                    <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333" Padding="10,0,0,0"/>
269 269
                 </StackPanel>
270
-                <StackPanel Grid.Row="6" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,30,0,0">
271
-                    <TextBlock Text="版权所有" FontSize="16" Foreground="#2D8CF0"/>
270
+                <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,30,0,0">
271
+                    <TextBlock Text="版权所有" FontSize="16" Width="80" Foreground="#2D8CF0"/>
272 272
                     <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333" Padding="10,0,0,0"/>
273 273
                 </StackPanel>
274 274
                 <!--第四行 开始按钮-->
275
-                <Button Cursor="Hand" Grid.Row="7" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
275
+                <Button Cursor="Hand" Grid.Row="6" x:Name="btnSave" Content="保存" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="115" Height="45" Margin="10,0,10,0" Click="BtnSave_Click">
276 276
                     <Button.Template>
277 277
                         <ControlTemplate TargetType="{x:Type Button}">
278 278
                             <Border

+ 3
- 2
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -22,6 +22,7 @@ using System.Drawing;
22 22
 using XHWK.WKTool.DAL;
23 23
 using System.Text;
24 24
 using System.Collections.Specialized;
25
+using XHWK.WKTool.Config;
25 26
 
26 27
 namespace XHWK.WKTool
27 28
 {
@@ -69,7 +70,7 @@ namespace XHWK.WKTool
69 70
         {
70 71
             new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
71 72
             InitializeComponent();
72
-
73
+            this.ResizeMode = System.Windows.ResizeMode.CanMinimize;
73 74
             btnPrint.IsEnabled = false;
74 75
 
75 76
             myblackboard = new BlackboardNew(blackboard_canvas);
@@ -82,7 +83,7 @@ namespace XHWK.WKTool
82 83
             Model_DrawData model_DrawData = new Model_DrawData();
83 84
             model_DrawData.PageNum = APP.pageData.currpage;
84 85
             APP.PageDrawList.Add(model_DrawData);
85
-
86
+            txbv.Text = "v"+ZConfig.versionName;
86 87
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoType");
87 88
             if (FileToolsCommon.GetConfigValue("IsSound").Equals("true"))
88 89
             {

+ 12
- 0
XHWK.WKTool/XHWK.WKTool.csproj View File

@@ -102,6 +102,9 @@
102 102
     </Reference>
103 103
   </ItemGroup>
104 104
   <ItemGroup>
105
+    <Compile Include="AppUpdateWin.xaml.cs">
106
+      <DependentUpon>AppUpdateWin.xaml</DependentUpon>
107
+    </Compile>
105 108
     <Compile Include="Controls\ArrowTool.cs" />
106 109
     <Compile Include="Controls\EllipseTool.cs" />
107 110
     <Compile Include="Controls\ImageEditBar.cs" />
@@ -128,6 +131,7 @@
128 131
     </Compile>
129 132
     <Compile Include="Helpers\ScreenHelper.cs" />
130 133
     <Compile Include="Helpers\WpfHelper.cs" />
134
+    <Compile Include="Helpers\ZJDownloadUtil.cs" />
131 135
     <Compile Include="JieTuWindow.xaml.cs">
132 136
       <DependentUpon>JieTuWindow.xaml</DependentUpon>
133 137
     </Compile>
@@ -160,6 +164,11 @@
160 164
       <DependentUpon>CreateAMicroLessonWindow.xaml</DependentUpon>
161 165
       <SubType>Code</SubType>
162 166
     </Compile>
167
+    <Compile Include="ZConfig.cs" />
168
+    <Page Include="AppUpdateWin.xaml">
169
+      <Generator>MSBuild:Compile</Generator>
170
+      <SubType>Designer</SubType>
171
+    </Page>
163 172
     <Page Include="CountdownWindow.xaml">
164 173
       <SubType>Designer</SubType>
165 174
       <Generator>MSBuild:Compile</Generator>
@@ -1503,5 +1512,8 @@
1503 1512
     <Resource Include="Images\countdown3_2.png" />
1504 1513
     <Resource Include="Images\countdown3_3.png" />
1505 1514
   </ItemGroup>
1515
+  <ItemGroup>
1516
+    <Resource Include="Images\APP.png" />
1517
+  </ItemGroup>
1506 1518
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1507 1519
 </Project>

+ 51
- 0
XHWK.WKTool/ZConfig.cs View File

@@ -0,0 +1,51 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHWK.WKTool.Config
8
+{
9
+    internal class ZConfig
10
+    {
11
+        public static bool isDebug = true;
12
+
13
+        /// <summary>
14
+        /// 当前版本号
15
+        /// </summary>
16
+        public static int versionCode = 1;
17
+
18
+        public static string versionName = "1.0.0";
19
+
20
+        //接口地址
21
+        public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";
22
+
23
+        //图片地址
24
+        public static string uploadUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/" : "http://schoolfile.xhkjedu.com/";
25
+
26
+        public static string showImageUrl = isDebug ? "http://schoolfiletest.xhkjedu.com/static/" : "http://schoolfile.xhkjedu.com/static/";
27
+
28
+        public static string secretKey = "nanhuakaizhangjianwangni";
29
+        public static string fileStorageAddress = "";
30
+
31
+        //认证接口地址
32
+        public static string certapiUrl = isDebug ? "http://certapitest.xhkjedu.com" : "http://certapi.xhkjedu.com";
33
+
34
+        /// <summary>
35
+        /// 数据存放目录
36
+        /// </summary>
37
+        public static string dataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Signature\\";
38
+
39
+        public static string basePath = AppDomain.CurrentDomain.BaseDirectory;
40
+
41
+        //缓存图片地址
42
+        public static string tempPath = basePath + "temp\\";
43
+
44
+        public static string nginxHtml = $"{basePath}nginx\\html\\";
45
+
46
+   
47
+        public static string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
48
+
49
+        public static string tongPingBasePath = $"{nginxHtml}tongping\\";
50
+    }
51
+}

Loading…
Cancel
Save