chengjie 3 月之前
父节点
当前提交
33dce8f177
共有 4 个文件被更改,包括 16 次插入4 次删除
  1. 7 2
      packageProduct/main/product.js
  2. 1 1
      packageProduct/main/product.wxml
  3. 7 0
      pages/main/default.js
  4. 1 1
      pages/main/default.wxml

+ 7 - 2
packageProduct/main/product.js

@@ -15,7 +15,9 @@ Page({
15
       Containnerheight: main.getWindowHeight(),
15
       Containnerheight: main.getWindowHeight(),
16
     });
16
     });
17
 
17
 
18
-    let bgcolor="",fcolor="";
18
+  },
19
+  onReady:function(){
20
+    let that = this;
19
     main.getData('GetProgramList', function (data) {
21
     main.getData('GetProgramList', function (data) {
20
       if (data) {
22
       if (data) {
21
         for(let i=0;i<data.length;i++){
23
         for(let i=0;i<data.length;i++){
@@ -24,6 +26,10 @@ Page({
24
               frontColor: data[i].FColor,
26
               frontColor: data[i].FColor,
25
               backgroundColor: data[i].BGColor,
27
               backgroundColor: data[i].BGColor,
26
             });
28
             });
29
+            wx.setBackgroundColor({
30
+              backgroundColorTop: data[i].BGColor,
31
+              backgroundColorBottom: data[i].BGColor,
32
+            })
27
             that.setData({
33
             that.setData({
28
               BGColor:data[i].BGColor,
34
               BGColor:data[i].BGColor,
29
               FColor:data[i].FColor,
35
               FColor:data[i].FColor,
@@ -34,7 +40,6 @@ Page({
34
         }
40
         }
35
       }
41
       }
36
     });
42
     });
37
-    
38
   },
43
   },
39
   goto: function (e) {
44
   goto: function (e) {
40
     let that=this;
45
     let that=this;

+ 1 - 1
packageProduct/main/product.wxml

@@ -98,7 +98,7 @@
98
 
98
 
99
   <view class="panelFooterNav FlexColumn">
99
   <view class="panelFooterNav FlexColumn">
100
     <view class="panelFooterNav2 FlexRow">
100
     <view class="panelFooterNav2 FlexRow">
101
-      <view class="panelFooterNavBtn FlexColumn" bind:tap="goto" data-url="../../pages/main/default">
101
+      <view class="panelFooterNavBtn FlexColumn" bind:tap="gotoRedirectTo" data-url="../../pages/main/default">
102
         <view>分数线</view>
102
         <view>分数线</view>
103
         <view class="panelFooterNavLine"></view>
103
         <view class="panelFooterNavLine"></view>
104
       </view>
104
       </view>

+ 7 - 0
pages/main/default.js

@@ -156,6 +156,13 @@ Page({
156
       }
156
       }
157
     });   
157
     });   
158
   },
158
   },
159
+  gotoRedirectTo: function (e) {
160
+    let that=this;
161
+    var url=e.currentTarget.dataset.url;
162
+    wx.redirectTo({
163
+      url: url,
164
+    });
165
+  },
159
   onShareAppMessage: function () {
166
   onShareAppMessage: function () {
160
     return {
167
     return {
161
       title: "上海中考招生信息查询工具",
168
       title: "上海中考招生信息查询工具",

+ 1 - 1
pages/main/default.wxml

@@ -206,7 +206,7 @@
206
         <view>分数线</view>
206
         <view>分数线</view>
207
         <view class="panelFooterNavLine1"></view>
207
         <view class="panelFooterNavLine1"></view>
208
       </view>
208
       </view>
209
-      <view class="panelFooterNavBtn FlexColumn" bind:tap="goto" data-url="../../packageProduct/main/product">
209
+      <view class="panelFooterNavBtn FlexColumn" bind:tap="gotoRedirectTo" data-url="../../packageProduct/main/product">
210
         <view>秒过</view>
210
         <view>秒过</view>
211
         <view class="panelFooterNavLine"></view>
211
         <view class="panelFooterNavLine"></view>
212
       </view>
212
       </view>