chengjie преди 6 години
родител
ревизия
d2b5fa79b3

+ 1 - 1
app.js

@@ -27,7 +27,7 @@ App({
27 27
   },
28 28
   globalData: {
29 29
     Version: "1.1.34",
30
-    IsProduction: true,
30
+    IsProduction: false,
31 31
     ShareTitle: "刻意学习,高效成长",
32 32
     SharePath: "pages/index/index",
33 33
     ShareImage: '../images/program_screenshot_main.png',

+ 4 - 17
app.json

@@ -1,6 +1,9 @@
1 1
 {
2 2
   "pages": [
3 3
     "pages/index/index",
4
+    "marketing/main/extenduser",
5
+    "marketing/main/shareuser",
6
+    "marketing/main/index",
4 7
     "pages/index/accredit",
5 8
     "pages/main/recommend",
6 9
     "pages/main/clicktype",
@@ -49,21 +52,5 @@
49 52
     "wxaa1a8b48d9853872",
50 53
     "wx80059777521b897c"
51 54
   ],
52
-  "sitemapLocation": "sitemap.json",
53
-  "subPackages": [
54
-    {
55
-      "root": "marketing",
56
-      "pages": [
57
-        "main/index"
58
-      ]
59
-    }
60
-  ],
61
-  "preloadRule": {
62
-    "marketing/main/index": {
63
-      "network": "all",
64
-      "packages": [
65
-        "marketing"
66
-      ]
67
-    }
68
-  }
55
+  "sitemapLocation": "sitemap.json"
69 56
 }

BIN
marketing/images/universalpic_add_gray_114x114.png


BIN
marketing/images/universalpic_face_default_gray_114x114.png


+ 121 - 0
marketing/main/extenduser.js

@@ -0,0 +1,121 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+const ArrFilter1 = ["全部", "仅看未报名"];
6
+const ArrFilter2 = ["全部", "仅看未续费"];
7
+var AllList = [];
8
+
9
+Page({
10
+  data: {
11
+  },
12
+  onLoad: function (options) {
13
+    this.setData({
14
+      Containnerheight: main.getWindowHeight(),
15
+      ArrMenu: [
16
+        { Name: "打开过", Selected: 1 },
17
+        { Name: "报过名", Selected: 0 },
18
+        { Name: "已续费", Selected: 0 }
19
+      ],
20
+      Filter1: ArrFilter1[0],
21
+      Filter2: ArrFilter2[0],
22
+    });
23
+    this.init();
24
+  },
25
+  init: function () {
26
+    var that = this;
27
+    main.getData('GetIntroducerUserList?UserID=' + app.globalData.userInfo.UserID, function (data) {
28
+      wx.hideLoading();
29
+      if (data) {
30
+        AllList = data;
31
+        that.setData({
32
+          List: data,
33
+        });
34
+      }
35
+    });
36
+  },
37
+  changeMenu: function (e) {
38
+    var that = this;
39
+    var id = e.currentTarget.dataset.id;
40
+    for (var i = 0; i < 3; i++) {
41
+      if (id == i)
42
+        that.data.ArrMenu[i].Selected = 1;
43
+      else
44
+        that.data.ArrMenu[i].Selected = 0;
45
+    }
46
+
47
+    var list = [];
48
+
49
+    for (var i = 0; i < AllList.length; i++) {
50
+      if (id == 1) {
51
+        if (AllList[i].IsMember == 1)
52
+          list.push(AllList[i]);
53
+      }
54
+      else if (id == 2) {
55
+        if (AllList[i].IsPay == 1)
56
+          list.push(AllList[i]);
57
+      }
58
+      else
59
+        list.push(AllList[i]);
60
+    }
61
+
62
+    that.setData({
63
+      ArrMenu: that.data.ArrMenu,
64
+      List: list,
65
+      Filter1: ArrFilter1[0],
66
+      Filter2: ArrFilter2[0],
67
+    });
68
+  },
69
+  filterData1: function (e) {
70
+    var that = this;
71
+    wx.showActionSheet({
72
+      itemList: ArrFilter1,
73
+      success(res) {
74
+        var list = [];
75
+        for (var i = 0; i < AllList.length; i++) {
76
+          if (res.tapIndex == 1) {
77
+            if (AllList[i].IsMember == 0)
78
+              list.push(AllList[i]);
79
+          }
80
+          else
81
+            list.push(AllList[i]);
82
+        }
83
+
84
+        that.setData({
85
+          Filter1: ArrFilter1[res.tapIndex],
86
+          List: list,
87
+        });
88
+      },
89
+    })
90
+  },
91
+  filterData2: function (e) {
92
+    var that = this;
93
+    wx.showActionSheet({
94
+      itemList: ArrFilter2,
95
+      success(res) {
96
+        var list = [];
97
+        for (var i = 0; i < AllList.length; i++) {
98
+          if (res.tapIndex == 1) {
99
+            if (AllList[i].IsPay == 0)
100
+              list.push(AllList[i]);
101
+          }
102
+          else
103
+            list.push(AllList[i]);
104
+        }
105
+
106
+        that.setData({
107
+          Filter2: ArrFilter2[res.tapIndex],
108
+          List: list,
109
+        });
110
+      },
111
+    })
112
+  },
113
+
114
+  onShareAppMessage: function () {
115
+    return {
116
+      title: app.globalData.ShareTitle,
117
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
118
+      imageUrl: app.globalData.ShareImage,
119
+    }
120
+  },
121
+});

+ 3 - 0
marketing/main/extenduser.json

@@ -0,0 +1,3 @@
1
+{
2
+  "navigationBarTitleText": "推广名单"
3
+}

+ 44 - 0
marketing/main/extenduser.wxml

@@ -0,0 +1,44 @@
1
+<view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
+  <view class="panelTop FlexRow">
3
+    <view class="panelTop1 FlexColumn" wx:for="{{ArrMenu}}" wx:key="*this" bindtap="changeMenu" data-id="{{index}}">
4
+      <view class="panelTop11{{item.Selected}}">{{item.Name}}</view>
5
+      <view class="line1{{item.Selected}}"></view>
6
+    </view>
7
+  </view>
8
+  <view class="panel FlexColumn">
9
+    <view class="panel1 FlexRow" bindtap="filterData1" wx:if="{{ArrMenu[0].Selected==1}}">
10
+      <view class="left">筛选</view>
11
+      <view class="right FlexRow">
12
+        <view class="panel11">{{Filter1}}</view>
13
+        <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
14
+      </view>
15
+    </view>
16
+    <view class="panel1 FlexRow" bindtap="filterData2" wx:if="{{ArrMenu[1].Selected==1}}">
17
+      <view class="left">筛选</view>
18
+      <view class="right FlexRow">
19
+        <view class="panel11">{{Filter2}}</view>
20
+        <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
21
+      </view>
22
+    </view>
23
+    <view class="lineWidthAll FlexRow">
24
+      <view class="lineWidth720"></view>
25
+    </view>
26
+    <view class="panel2 FlexRow">
27
+      <view class="left">共{{List.length}}人</view>
28
+    </view>
29
+    <view class="panel3 FlexColumn">
30
+      <view class="panel31 FlexRow">
31
+        <view class="panelUser FlexColumn" wx:if="{{ArrMenu[0].Selected==1}}">
32
+            <image src='../images/universalpic_add_gray_114x114.png' class="Avatar" />
33
+            <view class="NickName">去推荐</view>
34
+        </view>
35
+        <view class="panelUser FlexColumn" wx:for="{{List}}" wx:key="*this">
36
+            <image src='{{item.AvatarUrl}}' lazy-load="true" class="Avatar" />
37
+            <view class="NickName">{{item.NickName}}</view>
38
+        </view>
39
+      </view>
40
+    </view>
41
+    <view class="footer"></view>
42
+  </view>
43
+  
44
+</view>

+ 103 - 0
marketing/main/extenduser.wxss

@@ -0,0 +1,103 @@
1
+.panelTop{
2
+  width:100%;
3
+}
4
+
5
+.panelTop1{
6
+  width:250rpx;
7
+  height: 90rpx;
8
+  justify-content: flex-end;
9
+  background-color: #fff;
10
+}
11
+
12
+.panelTop110{
13
+  font-size:28rpx;
14
+  color:#0071EF;
15
+  font-weight: 500;
16
+  margin-bottom: 20rpx;
17
+}
18
+.panelTop111{
19
+  font-size:28rpx;
20
+  color:#1e1e1e;
21
+  font-weight: 400;
22
+  margin-bottom: 20rpx;
23
+}
24
+
25
+.line10{
26
+  width:84rpx;
27
+  height:10rpx;
28
+  background-color: #fff;
29
+}
30
+.line11{
31
+  width:84rpx;
32
+  height:10rpx;
33
+  background-color: #1e1e1e;
34
+}
35
+
36
+.panel{
37
+  width:100%;
38
+  margin-top: 20rpx;
39
+  background-color: #fff;
40
+  justify-content: flex-start;
41
+}
42
+.panel1{
43
+  width:100%;
44
+  height:100rpx;
45
+  justify-content: space-between;
46
+  font-weight: 400;
47
+  font-size:28rpx;
48
+}
49
+
50
+
51
+.left{
52
+  margin-left: 30rpx;
53
+}
54
+.right{
55
+  margin-right: 30rpx;
56
+}
57
+.panel11{
58
+  font-size:28rpx;
59
+  color:#787878;
60
+}
61
+
62
+.Arrow{
63
+  width:16rpx;
64
+  height:26rpx;
65
+  margin-left: 30rpx;
66
+}
67
+
68
+.panel2{
69
+  width:100%;
70
+  justify-content: flex-start;
71
+  font-weight: 400;
72
+  font-size:24rpx;
73
+  margin-top: 30rpx;
74
+}
75
+.panel3{
76
+  width:100%;
77
+  justify-content: flex-start;
78
+  margin-top: 30rpx;
79
+}
80
+.panel31{
81
+  width:690rpx;
82
+  justify-content: flex-start;
83
+  align-items: flex-start;
84
+  flex-wrap: wrap;
85
+}
86
+.panelUser{
87
+  margin: 0 24rpx 30rpx 0;
88
+}
89
+.Avatar{
90
+  width: 114rpx;
91
+  height:114rpx;
92
+  border-radius: 10rpx;
93
+}
94
+.NickName{
95
+  font-weight: 400;
96
+  font-size:18rpx;
97
+  margin-top: 10rpx;
98
+}
99
+
100
+.footer{
101
+  width:100%;
102
+  height:100rpx;
103
+}

+ 23 - 58
marketing/main/index.js

@@ -1,66 +1,31 @@
1
-// marketing/main/index.js
2
-Page({
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3 3
 
4
-  /**
5
-   * 页面的初始数据
6
-   */
7
-  data: {
4
+const app = getApp();
8 5
 
6
+Page({
7
+  data: {
9 8
   },
10
-
11
-  /**
12
-   * 生命周期函数--监听页面加载
13
-   */
14 9
   onLoad: function (options) {
15
-
10
+    this.setData({
11
+      Containnerheight: main.getWindowHeight(),
12
+    });
16 13
   },
17
-
18
-  /**
19
-   * 生命周期函数--监听页面初次渲染完成
20
-   */
21
-  onReady: function () {
22
-
23
-  },
24
-
25
-  /**
26
-   * 生命周期函数--监听页面显示
27
-   */
28
-  onShow: function () {
29
-
14
+  gogoExtendUser: function(){
15
+    wx.navigateTo({
16
+      url: './extenduser',
17
+    });
30 18
   },
31
-
32
-  /**
33
-   * 生命周期函数--监听页面隐藏
34
-   */
35
-  onHide: function () {
36
-
19
+  gogoShareUser: function () {
20
+    wx.navigateTo({
21
+      url: './shareuser',
22
+    });
37 23
   },
38
-
39
-  /**
40
-   * 生命周期函数--监听页面卸载
41
-   */
42
-  onUnload: function () {
43
-
44
-  },
45
-
46
-  /**
47
-   * 页面相关事件处理函数--监听用户下拉动作
48
-   */
49
-  onPullDownRefresh: function () {
50
-
51
-  },
52
-
53
-  /**
54
-   * 页面上拉触底事件的处理函数
55
-   */
56
-  onReachBottom: function () {
57
-
58
-  },
59
-
60
-  /**
61
-   * 用户点击右上角分享
62
-   */
63 24
   onShareAppMessage: function () {
64
-
65
-  }
66
-})
25
+    return {
26
+      title: app.globalData.ShareTitle,
27
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
28
+      imageUrl: app.globalData.ShareImage,
29
+    }
30
+  },
31
+});

+ 1 - 1
marketing/main/index.json

@@ -1,3 +1,3 @@
1 1
 {
2
-  "usingComponents": {}
2
+  "navigationBarTitleText": "推广计划"
3 3
 }

+ 74 - 2
marketing/main/index.wxml

@@ -1,2 +1,74 @@
1
-<!--marketing/main/index.wxml-->
2
-<text>marketing/main/index.wxml</text>
1
+<view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
+  <view class="panelTitle FlexRow">
3
+    <view class="panelTitle1">推广</view>
4
+    <view class="panelTitle2"></view>
5
+  </view>
6
+  <view class="panelItem FlexRow">
7
+    <view class="panelItem1">规则说明</view>
8
+    <view class="panelItem2 FlexRow">
9
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
10
+    </view>
11
+  </view>
12
+  <view class="lineWidthAll FlexRow">
13
+    <view class="lineWidth720"></view>
14
+  </view>
15
+  <view class="panelItem FlexRow"  bindtap="gogoShareUser">
16
+    <view class="panelItem1">我的宣传品</view>
17
+    <view class="panelItem2 FlexRow">
18
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
19
+    </view>
20
+  </view>
21
+  <view class="lineWidthAll FlexRow">
22
+    <view class="lineWidth720"></view>
23
+  </view>
24
+  <view class="panelItem FlexRow" bindtap="gogoExtendUser">
25
+    <view class="panelItem1">推广名单</view>
26
+    <view class="panelItem2 FlexRow">
27
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
28
+    </view>
29
+  </view>
30
+  <view class='lineFooter'></view>
31
+
32
+  <view class="panelTitle FlexRow">
33
+    <view class="panelTitle1">奖励</view>
34
+    <view class="panelTitle2"></view>
35
+  </view>
36
+  <view class="panelItem FlexRow">
37
+    <view class="panelItem1">奖励名单</view>
38
+    <view class="panelItem2 FlexRow">
39
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
40
+    </view>
41
+  </view>
42
+  <view class="lineWidthAll FlexRow">
43
+    <view class="lineWidth720"></view>
44
+  </view>
45
+  <view class="panelItem FlexRow">
46
+    <view class="panelItem1">对账结算</view>
47
+    <view class="panelItem2 FlexRow">
48
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
49
+    </view>
50
+  </view>
51
+  <view class="lineWidthAll FlexRow">
52
+    <view class="lineWidth720"></view>
53
+  </view>
54
+  <view class="panelItem FlexRow">
55
+    <view class="panelItem1">结算记录</view>
56
+    <view class="panelItem2 FlexRow">
57
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
58
+    </view>
59
+  </view>
60
+  <view class='lineFooter'></view>
61
+
62
+  <view class="panelTitle FlexRow">
63
+    <view class="panelTitle1">辅助</view>
64
+    <view class="panelTitle2"></view>
65
+  </view>
66
+  <view class="panelItem FlexRow">
67
+    <view class="panelItem1">过程提醒</view>
68
+    <view class="panelItem2 FlexRow">
69
+      <image src='../../pages/images/universalpic_indicator_right_gray.png' class="Arrow" />
70
+    </view>
71
+  </view>
72
+  <view class='lineFooter'></view>
73
+
74
+</view>

+ 55 - 1
marketing/main/index.wxss

@@ -1 +1,55 @@
1
-/* marketing/main/index.wxss */
1
+.panelTitle{
2
+  width:100%;
3
+  margin-top: 50rpx;
4
+  justify-content: space-between;
5
+}
6
+.panelTitle .panelTitle1{
7
+  font-size:32rpx;
8
+  margin-left: 30rpx;
9
+  margin-bottom: 30rpx;
10
+}
11
+.panelTitle .panelTitle2{
12
+  font-size:28rpx;
13
+  margin-right: 30rpx;
14
+  background-color: #1e1e1e;
15
+  color:#fff;
16
+  border-radius: 22rpx;
17
+  text-align: center;
18
+  padding: 0 20rpx;
19
+  margin-bottom: 32rpx;
20
+}
21
+
22
+.panelItem{
23
+  width:100%;
24
+  justify-content: space-between;
25
+  font-size:28rpx;
26
+  height:100rpx;
27
+  background-color: #fff;
28
+}
29
+
30
+.panelItem0{
31
+  height:133rpx;
32
+}
33
+.panelItem00{
34
+  margin-top: 10rpx;
35
+  line-height: 100rpx;
36
+  font-size:28rpx;
37
+  font-weight: 400;
38
+  justify-content: center;
39
+}
40
+
41
+.panelItem .panelItem1{
42
+  margin-left: 30rpx;
43
+  font-weight: 400;
44
+}
45
+.panelItem .panelItem2{
46
+  margin-right: 30rpx;
47
+  color:#787878;
48
+  font-weight: 400;
49
+}
50
+
51
+.Arrow{
52
+  width:16rpx;
53
+  height:26rpx;
54
+  margin-left: 30rpx;
55
+}

+ 33 - 0
marketing/main/shareuser.js

@@ -0,0 +1,33 @@
1
+import common from '../../utils/util';
2
+import main from '../../utils/main';
3
+
4
+const app = getApp();
5
+
6
+Page({
7
+  data: {
8
+  },
9
+  onLoad: function (options) {
10
+    this.setData({
11
+      Containnerheight: main.getWindowHeight(),
12
+    });
13
+    this.init();
14
+  },
15
+  init:function(){
16
+    var that = this;
17
+    main.getData('GetMiaoguoShareInfo?Version=' + app.globalData.Version, function (data) {
18
+      wx.hideLoading();
19
+      if (data) {
20
+         that.setData({
21
+          List: data,
22
+        });
23
+      }
24
+    });
25
+  }, 
26
+  onShareAppMessage: function () {
27
+    return {
28
+      title: app.globalData.ShareTitle,
29
+      path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
30
+      imageUrl: "../../pages/images/program_screenshot_main.png",
31
+    }
32
+  },
33
+});

+ 4 - 0
marketing/main/shareuser.json

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "我的宣传品",
3
+  "backgroundColor": "#ffffff"
4
+}

+ 11 - 0
marketing/main/shareuser.wxml

@@ -0,0 +1,11 @@
1
+<view class="container FlexColumn" style='height:{{Containnerheight}}rpx;'>
2
+  <view style="height:100rpx;"></view>
3
+  <view class="panel FlexColumn" wx:for="{{List}}" wx:key="*this">
4
+    <text class="text1">{{item.Text1}}</text>
5
+    <text class="text2">{{item.Text2}}</text>
6
+    <text class="text3">{{item.Text3}}</text>
7
+    <text class="text4" wx:if="{{item.Text4}}">{{item.Text4}}</text>
8
+    <text class="text5" wx:if="{{item.Text5}}">{{item.Text5}}</text>
9
+    <button class="btn" open-type="{{item.OpenType}}" bindtap="{{item.BindTap}}">{{item.BtnStr}}</button>
10
+  </view>
11
+</view>

+ 43 - 0
marketing/main/shareuser.wxss

@@ -0,0 +1,43 @@
1
+.container {
2
+  background-color: #fff;
3
+} 
4
+
5
+.panel{
6
+  margin-bottom: 119rpx;
7
+}
8
+
9
+.panel .text1{
10
+  font-size:28rpx;
11
+}
12
+.panel .text2{
13
+  font-size:68rpx;
14
+  color:#169DED;
15
+}
16
+.panel .text3{
17
+  font-size:28rpx;
18
+  font-weight: 400;
19
+}
20
+
21
+.panel .text4{
22
+  font-size:28rpx;
23
+  margin-top: 40rpx;
24
+}
25
+.panel .text5{
26
+  font-size:24rpx;
27
+  margin-top: 20rpx;
28
+  text-align: center;
29
+  font-weight: 400;
30
+}
31
+
32
+.panel .btn{
33
+  width:520rpx;
34
+  height:90rpx;
35
+  line-height: 90rpx;
36
+  font-size:36rpx;
37
+  margin-top: 40rpx;
38
+  text-align: center;
39
+  font-weight: 400;
40
+  color:#fff;
41
+  background-color: #0071EF;
42
+  border-radius: 10rpx;
43
+}

+ 5 - 4
pages/index/index.js

@@ -214,10 +214,11 @@ Page({
214 214
           //测试
215 215
           //var url = '../../package4/main/giftcard?GiftID=89542&UserID=1';
216 216
           //var url = '../main/share';
217
-          // var url = '../../package4/main/share';
218
-          // wx.redirectTo({
219
-          //   url: url,
220
-          // });
217
+          var url = '../../marketing/main/index';
218
+          wx.redirectTo({
219
+            url: url,
220
+          });
221
+          return;
221 222
 
222 223
 
223 224
           if (that.data.MiaoguoCardID) {

+ 1 - 2
pages/main/add.js

@@ -948,7 +948,7 @@ Page({
948 948
       that.showRecorder();
949 949
     else if (app.globalData.IsRecorderAccredit == 0) {
950 950
       recorderManager.stop();
951
-      app.globalData.IsRecorderAccredit=-1;
951
+      app.globalData.IsRecorderAccredit = 1;
952 952
       that.showRecorder();
953 953
     }
954 954
     else if (app.globalData.IsRecorderAccredit == -1) {
@@ -965,7 +965,6 @@ Page({
965 965
           }
966 966
         }
967 967
       });
968
-      
969 968
     }
970 969
   },
971 970
   showRecorder: function () {

+ 30 - 2
pages/main/detail.js

@@ -39,6 +39,7 @@ var isPlaying = false;
39 39
 
40 40
 var timeoutPlayAudio;
41 41
 var tempPlayUrl = "";
42
+var tempPlayUrlLocal = "";
42 43
 var timeoutEveryCard=0;
43 44
 
44 45
 Page({
@@ -54,6 +55,19 @@ Page({
54 55
     TaskInfo: {},
55 56
     Color: { ID: 1 },
56 57
   },
58
+  onReady: function () {
59
+    var that = this;
60
+    innerAudioContext1 = wx.createInnerAudioContext();
61
+    innerAudioContext1.onPlay(() => {
62
+      console.log('开始播放')
63
+    });
64
+    innerAudioContext1.onError((res) => {
65
+      console.log("innerAudioContext1.errMsg:" + res.errMsg);
66
+      console.log("innerAudioContext1.errCode:" +res.errCode);
67
+      that.audioCtx.setSrc(tempPlayUrl);
68
+      that.audioCtx.play();
69
+    });
70
+  },
57 71
   onLoad: function () {
58 72
     var that = this;
59 73
     var height = app.globalData.systemInfo.screenHeight * 2 - 90;
@@ -74,7 +88,7 @@ Page({
74 88
     });
75 89
 
76 90
     this.audioCtx = wx.createAudioContext('myAudio'); 
77
-    innerAudioContext1 = wx.createInnerAudioContext();
91
+    
78 92
 
79 93
     this.getList();
80 94
 
@@ -130,6 +144,11 @@ Page({
130 144
     clearInterval(intervalSound);
131 145
     clearTimeout(timeoutEveryCard);
132 146
     listTaskFinished = [];
147
+
148
+    isPlaying = false;
149
+    if (innerAudioContext1){
150
+      innerAudioContext1.stop();
151
+    }
133 152
   },
134 153
   onPullDownRefresh: function () {
135 154
     this.onShowAnswer({
@@ -685,6 +704,7 @@ Page({
685 704
       url = url.substr(url.indexOf("http"));
686 705
     url = url.replace("http://", "https://");
687 706
 
707
+    url = encodeURI(url);
688 708
     if (!isPlaying || tempPlayUrl == "" || url != tempPlayUrl) {
689 709
       isPlaying = true;
690 710
       timeoutPlayAudio = setTimeout(function () {
@@ -700,10 +720,11 @@ Page({
700 720
       }, 30000);
701 721
 
702 722
       wx.downloadFile({
703
-        url: encodeURI(url),
723
+        url: url,
704 724
         success(res) {
705 725
           wx.hideLoading();
706 726
           if (res.statusCode === 200) {
727
+            tempPlayUrlLocal=res.tempFilePath;
707 728
             that.audioCtx.setSrc(res.tempFilePath);
708 729
             that.audioCtx.play();
709 730
             tempPlayUrl = url;
@@ -716,12 +737,19 @@ Page({
716 737
     }
717 738
     else {
718 739
       this.audioCtx.pause();
740
+      if (innerAudioContext1)
741
+        innerAudioContext1.stop();
719 742
       isPlaying = false;
720 743
     }
721 744
   },
722 745
   audioBindEnded: function () {
723 746
     isPlaying = false;
724 747
   },
748
+  audioBindError:function(err){
749
+    console.log(err);
750
+    innerAudioContext1.src = tempPlayUrlLocal;
751
+    innerAudioContext1.play();
752
+  },
725 753
   getTaskTime: function () {
726 754
     var that = this;
727 755
     var url = "GetMiaoguoTaskTime?";

+ 1 - 1
pages/main/detail.wxml

@@ -213,4 +213,4 @@
213 213
 
214 214
 <canvas class='Canvas' canvas-id="shareCanvas"></canvas>
215 215
 
216
-<audio hidden='true' src="{{AudioSrc}}" id="myAudio" bindended="audioBindEnded"></audio>
216
+<audio hidden='true' src="{{AudioSrc}}" id="myAudio" bindended="audioBindEnded" binderror="audioBindError"></audio>

+ 30 - 3
pages/main/preview.js

@@ -8,14 +8,28 @@ var isCopying = false;
8 8
 var isPlaying = false;
9 9
 var isCollecting = false;
10 10
 var playList = [];
11
-var innerAudioContext;
11
+var innerAudioContext1;
12 12
 var timeoutPlayAudio;
13 13
 var tempPlayUrl = "";
14
+var tempPlayUrlLocal = "";
14 15
 
15 16
 Page({
16 17
   data: {
17 18
     IsExistCard: false,
18 19
   },
20
+  onReady: function () {
21
+    var that=this;
22
+    innerAudioContext1 = wx.createInnerAudioContext();
23
+    innerAudioContext1.onPlay(() => {
24
+      console.log('开始播放')
25
+    });
26
+    innerAudioContext1.onError((res) => {
27
+      console.log("innerAudioContext1.errMsg:" + res.errMsg);
28
+      console.log("innerAudioContext1.errCode:" + res.errCode);
29
+      that.audioCtx.setSrc(tempPlayUrl);
30
+      that.audioCtx.play();
31
+    });
32
+  },
19 33
   onLoad: function (options) {
20 34
 
21 35
     var that = this;
@@ -122,6 +136,9 @@ Page({
122 136
   },
123 137
   onUnload: function () {
124 138
     isPlaying = false;
139
+    if (innerAudioContext1) {
140
+      innerAudioContext1.stop();
141
+    }
125 142
   },
126 143
   onPullDownRefresh: function () {
127 144
     var that = this;
@@ -404,6 +421,8 @@ Page({
404 421
       url = url.substr(url.indexOf("http"));
405 422
     url = url.replace("http://", "https://");
406 423
 
424
+    url = encodeURI(url);
425
+
407 426
     if (!isPlaying || tempPlayUrl=="" || url!=tempPlayUrl) {
408 427
       isPlaying = true;
409 428
       timeoutPlayAudio = setTimeout(function () {
@@ -418,13 +437,14 @@ Page({
418 437
       }, 30000);
419 438
 
420 439
       wx.downloadFile({
421
-        url: encodeURI(url),
440
+        url: url,
422 441
         success(res) {
423 442
           wx.hideLoading();
424 443
           if (res.statusCode === 200) {
444
+            tempPlayUrlLocal = res.tempFilePath;
425 445
             that.audioCtx.setSrc(res.tempFilePath);
426 446
             that.audioCtx.play();
427
-            tempPlayUrl=url;
447
+            tempPlayUrl = url;
428 448
           }
429 449
         },
430 450
         fail(err) {
@@ -434,12 +454,19 @@ Page({
434 454
     }
435 455
     else {
436 456
       this.audioCtx.pause();
457
+      if (innerAudioContext1)
458
+        innerAudioContext1.stop();
437 459
       isPlaying = false;
438 460
     }
439 461
   },
440 462
   audioBindEnded:function(){
441 463
     isPlaying = false;
442 464
   },
465
+  audioBindError: function (err) {
466
+    //console.log(err);
467
+    innerAudioContext1.src = tempPlayUrlLocal;
468
+    innerAudioContext1.play();
469
+  },
443 470
   getDetailInfo: function () {
444 471
     wx.navigateTo({
445 472
       url: './cardInfo?id=' + this.data.MiaoguoCardID,

+ 1 - 1
pages/main/preview.wxml

@@ -103,4 +103,4 @@
103 103
   
104 104
 </view>
105 105
 
106
-<audio hidden='true' src="{{AudioSrc}}" id="myAudio" bindended="audioBindEnded"></audio>
106
+<audio hidden='true' src="{{AudioSrc}}" id="myAudio" bindended="audioBindEnded" binderror="audioBindError"></audio>

+ 4 - 4
project.config.json

@@ -41,7 +41,7 @@
41 41
 			"list": []
42 42
 		},
43 43
 		"miniprogram": {
44
-			"current": 0,
44
+			"current": 2,
45 45
 			"list": [
46 46
 				{
47 47
 					"id": 0,
@@ -59,9 +59,9 @@
59 59
 				},
60 60
 				{
61 61
 					"id": 2,
62
-					"name": "临时",
63
-					"pathName": "pages/index/index",
64
-					"query": "Homework=1",
62
+					"name": "推广计划",
63
+					"pathName": "marketing/main/extenduser",
64
+					"query": "",
65 65
 					"scene": null
66 66
 				},
67 67
 				{