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

+ 31 - 31
pages/main/wish.js

@@ -71,14 +71,14 @@ Page({
71
     that.setData({
71
     that.setData({
72
       inputName: e.detail.value,
72
       inputName: e.detail.value,
73
     });
73
     });
74
-    that.onCheck(e.detail.value,1);
74
+    that.onCheck(e.detail.value, 1);
75
   },
75
   },
76
   bindKeyInputContent: function (e) {
76
   bindKeyInputContent: function (e) {
77
     var that = this;
77
     var that = this;
78
     that.setData({
78
     that.setData({
79
       inputContent: e.detail.value,
79
       inputContent: e.detail.value,
80
     });
80
     });
81
-    that.onCheck(e.detail.value,2);
81
+    that.onCheck(e.detail.value, 2);
82
   },
82
   },
83
   clickCheckbox: function () {
83
   clickCheckbox: function () {
84
     var that = this;
84
     var that = this;
@@ -86,32 +86,34 @@ Page({
86
       IsOpen: !that.data.IsOpen,
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
   onSubmit: function () {
118
   onSubmit: function () {
117
     var that = this;
119
     var that = this;
@@ -122,16 +124,14 @@ Page({
122
         showCancel: false,
124
         showCancel: false,
123
         confirmText: '返回',
125
         confirmText: '返回',
124
       });
126
       });
125
-    }
126
-    else if (isViolate2) {
127
+    } else if (isViolate2) {
127
       wx.showModal({
128
       wx.showModal({
128
         title: '生成失败',
129
         title: '生成失败',
129
         content: '抱歉,您填写的祝福语未能通过微信敏感词检查故无法生成福帖。敏感词由微信官方功能判定,建议您调整内容多尝试几次。',
130
         content: '抱歉,您填写的祝福语未能通过微信敏感词检查故无法生成福帖。敏感词由微信官方功能判定,建议您调整内容多尝试几次。',
130
         showCancel: false,
131
         showCancel: false,
131
         confirmText: '返回',
132
         confirmText: '返回',
132
       });
133
       });
133
-    }
134
-    else {
134
+    } else {
135
 
135
 
136
       if (app.globalData.userInfo.NickName == "陌生用户") {
136
       if (app.globalData.userInfo.NickName == "陌生用户") {
137
         wx.navigateTo({
137
         wx.navigateTo({

+ 27 - 0
pages/main/wishinfo.js

@@ -73,6 +73,7 @@ Page({
73
   },
73
   },
74
   clickLikeNum:function(){
74
   clickLikeNum:function(){
75
     var that=this;
75
     var that=this;
76
+    this.animateSmallShow();
76
     that.setData({
77
     that.setData({
77
       LikeNum:++that.data.LikeNum
78
       LikeNum:++that.data.LikeNum
78
     });
79
     });
@@ -92,6 +93,32 @@ Page({
92
       historyLikeNum=that.data.LikeNum;
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
   onShareAppMessage: function () {
122
   onShareAppMessage: function () {
96
     var that=this;
123
     var that=this;
97
     var url=app.globalData.uploadImageUrl+"web/fs_a02.png";
124
     var url=app.globalData.uploadImageUrl+"web/fs_a02.png";

+ 1 - 1
pages/main/wishinfo.wxml

@@ -5,7 +5,7 @@
5
   <view class="text01 text03">{{MyWish.WishContent}}</view>
5
   <view class="text01 text03">{{MyWish.WishContent}}</view>
6
   <view class="panel1 FlexRow" bindtap="clickLikeNum">
6
   <view class="panel1 FlexRow" bindtap="clickLikeNum">
7
     <view class="panel11 FlexRow">
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
     </view>
10
     </view>
11
     <view class="text04">{{LikeNum}}</view>
11
     <view class="text04">{{LikeNum}}</view>