chengjie преди 1 година
родител
ревизия
29562ad95f
променени са 4 файла, в които са добавени 61 реда и са изтрити 34 реда
  1. 2 2
      app.js
  2. 31 31
      pages/main/wish.js
  3. 27 0
      pages/main/wishinfo.js
  4. 1 1
      pages/main/wishinfo.wxml

+ 2 - 2
app.js

@@ -2,8 +2,8 @@
2 2
 App({
3 3
   globalData: {
4 4
     Version: "1.0.13",
5
-    IsProduction: true,
6
-    //IsProduction: false,
5
+    //IsProduction: true,
6
+    IsProduction: false,
7 7
     ShareTitle: "上海中考招生信息查询工具",
8 8
     SharePath: "pages/index/index",
9 9
     ShareImage: '../images/fs_a01.png',

+ 31 - 31
pages/main/wish.js

@@ -71,14 +71,14 @@ Page({
71 71
     that.setData({
72 72
       inputName: e.detail.value,
73 73
     });
74
-    that.onCheck(e.detail.value,1);
74
+    that.onCheck(e.detail.value, 1);
75 75
   },
76 76
   bindKeyInputContent: function (e) {
77 77
     var that = this;
78 78
     that.setData({
79 79
       inputContent: e.detail.value,
80 80
     });
81
-    that.onCheck(e.detail.value,2);
81
+    that.onCheck(e.detail.value, 2);
82 82
   },
83 83
   clickCheckbox: function () {
84 84
     var that = this;
@@ -86,32 +86,34 @@ Page({
86 86
       IsOpen: !that.data.IsOpen,
87 87
     });
88 88
   },
89
-  onCheck: function (content,num) {
90
-    if (num==1)
91
-      isViolate1 = false;
92
-    else if (num==2)
93
-      isViolate2 = false;
94
-    main.postData("MsgSecCheck2", {
95
-        Content: content,
96
-        UserID: app.globalData.userInfo.UserID,
97
-      },
98
-      function (data) {
99
-        if (data && data.errcode == 0) {
100
-          
101
-        } else {
102
-          if (data.errmsg) {
103
-            wx.showToast({
104
-              title: data.errmsg,
105
-              duration: 2000,
106
-              image: "../images/universalpic_wrong_white_120x120.png",
107
-            });
108
-            if (num==1)
109
-              isViolate1 = true;
110
-            else if (num==2)
111
-              isViolate2 = true;
89
+  onCheck: function (content, num) {
90
+    if (content) {
91
+      if (num == 1)
92
+        isViolate1 = false;
93
+      else if (num == 2)
94
+        isViolate2 = false;
95
+      main.postData("MsgSecCheck2", {
96
+          Content: content,
97
+          UserID: app.globalData.userInfo.UserID,
98
+        },
99
+        function (data) {
100
+          if (data && data.errcode == 0) {
101
+
102
+          } else {
103
+            if (data.errmsg) {
104
+              wx.showToast({
105
+                title: data.errmsg,
106
+                duration: 2000,
107
+                image: "../images/universalpic_wrong_white_120x120.png",
108
+              });
109
+              if (num == 1)
110
+                isViolate1 = true;
111
+              else if (num == 2)
112
+                isViolate2 = true;
113
+            }
112 114
           }
113
-        }
114
-      });
115
+        });
116
+    }
115 117
   },
116 118
   onSubmit: function () {
117 119
     var that = this;
@@ -122,16 +124,14 @@ Page({
122 124
         showCancel: false,
123 125
         confirmText: '返回',
124 126
       });
125
-    }
126
-    else if (isViolate2) {
127
+    } else if (isViolate2) {
127 128
       wx.showModal({
128 129
         title: '生成失败',
129 130
         content: '抱歉,您填写的祝福语未能通过微信敏感词检查故无法生成福帖。敏感词由微信官方功能判定,建议您调整内容多尝试几次。',
130 131
         showCancel: false,
131 132
         confirmText: '返回',
132 133
       });
133
-    }
134
-    else {
134
+    } else {
135 135
 
136 136
       if (app.globalData.userInfo.NickName == "陌生用户") {
137 137
         wx.navigateTo({

+ 27 - 0
pages/main/wishinfo.js

@@ -73,6 +73,7 @@ Page({
73 73
   },
74 74
   clickLikeNum:function(){
75 75
     var that=this;
76
+    this.animateSmallShow();
76 77
     that.setData({
77 78
       LikeNum:++that.data.LikeNum
78 79
     });
@@ -92,6 +93,32 @@ Page({
92 93
       historyLikeNum=that.data.LikeNum;
93 94
     });
94 95
   },
96
+  //动画缩小淡出
97
+  animateSmallShow: function () {
98
+    var that = this;
99
+    var animation = wx.createAnimation({
100
+      duration: 100,
101
+      timingFunction: 'ease-in',
102
+    });
103
+    
104
+    //this.animation = animation;
105
+    animation.scale(1.3, 1.3).step();
106
+    this.setData({
107
+      animationDataShow: animation.export(),
108
+    });
109
+
110
+    setTimeout(function () {
111
+      var animation2 = wx.createAnimation({
112
+        duration: 100,
113
+        timingFunction: 'ease-in',
114
+      });
115
+      that.animation = animation2;
116
+      animation2.scale(1, 1).step();
117
+      that.setData({
118
+        animationDataShow: animation2.export()
119
+      });
120
+    }, 150);
121
+  },
95 122
   onShareAppMessage: function () {
96 123
     var that=this;
97 124
     var url=app.globalData.uploadImageUrl+"web/fs_a02.png";

+ 1 - 1
pages/main/wishinfo.wxml

@@ -5,7 +5,7 @@
5 5
   <view class="text01 text03">{{MyWish.WishContent}}</view>
6 6
   <view class="panel1 FlexRow" bindtap="clickLikeNum">
7 7
     <view class="panel11 FlexRow">
8
-      <image class="icon_add_02" src="../images/icon_add_02.png"></image>
8
+      <image animation="{{animationDataShow}}" class="icon_add_02" src="../images/icon_add_02.png"></image>
9 9
10 10
     </view>
11 11
     <view class="text04">{{LikeNum}}</view>