ソースを参照

双十一特别版

Rorschach 6 年 前
コミット
dafbbceda4

+ 1 - 1
component/hot/hot.js

@@ -15,7 +15,7 @@ export const hotInit = (that) => {
         circular: true,
         hotWareCardFirst: 'hotWareCardFirst',
         hotWareCard: 'hotWareCard',
-        hotSearch: '鹅鹅鹅',
+        hotSearch: '',
         banner: [],
         recommend: [],
         hotWorks: [],

+ 1 - 2
component/hot/hot.wxss

@@ -165,11 +165,10 @@ swiper {
 }
 
 .hotWareCard .wareCardTip {
-
     width: 178rpx;
     height: 40rpx;
     display: block;
-    text-align: center;
+    text-align: left;
     color: #414141;
     font-size: 24rpx;
 }

+ 0 - 2
component/my/my.js

@@ -60,9 +60,7 @@ export const myInit = (that) => {
       wx.navigateTo({
         url: `../../pages/groupPage/my-group/my-group?title=${title}`
       });
-      debugger
       APIClient.myWallet().success(res => {
-        debugger
         console.log(res.data.data.data);
       });
     }

+ 0 - 3
component/share/share.js

@@ -61,7 +61,6 @@ Component({
           }
         })
         .then(() => {
-          debugger;
           wx.getImageInfo({
             src: this.data.QRCodeImagePath,//服务器返回的图片地址
             success: function (res) {
@@ -114,7 +113,6 @@ Component({
 
     },
     share: function (data) {
-      debugger;
       if (this.data.shareType === 'works') {
 
         this.setData({
@@ -162,7 +160,6 @@ Component({
       let download = new Promise((resolve, reject) => {
         let QRCode = () => {
           // 生成二维码并下载
-          debugger;
           httpRequestApi.createQRCode(this.data.QRData).success(res => {
             // let base64 = wx.arrayBufferToBase64(res.data);
             // console.log(a)

+ 0 - 1
pages/groupPage/collage-details/collage-details.js

@@ -58,7 +58,6 @@ Page({
    */
   onLoad: function (options) {
     options.scene = 'QR1541862338777268';
-    debugger;
     wx.setNavigationBarTitle({
       title: '拼团详情'
     })

+ 7 - 3
pages/groupPage/grade-details/grade-details.js

@@ -135,9 +135,10 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    wx.setNavigationBarTitle({
-      title: options.title
-    })
+    console.log(options)
+    // wx.setNavigationBarTitle({
+    //   title: options.title
+    // })
     const productId = options.productId;
     if (productId) {
       this.setData({
@@ -149,6 +150,9 @@ Page({
       console.log('课本详情', res.data.data);
       const bookInfo = res.data.data.product;
       const lessonList = res.data.data.lessonList;
+      wx.setNavigationBarTitle({
+        title: bookInfo.title
+      })
       this.setData({
         titleIcon: bookInfo.bgImg,
         title: bookInfo.title,

+ 0 - 1
pages/groupPage/group-details/group-details.js

@@ -143,7 +143,6 @@ Page({
   },
   //拼团详情
   jionSuccess: function (orderId, type) {
-    debugger;
     httpRequestApi.getMygroupInfo(orderId).success(res => {
       console.log('拼团详情', res.data.data);
       const surplusNum = res.data.data.groupPurchaseOrder.headcount - res.data.data.groupPurchaseOrder.joinCount;

+ 1 - 1
pages/groupPage/group-details/group-details.wxss

@@ -68,7 +68,7 @@
 
 .shengyu-time .time  text{
     position: absolute;
-    left: 2rpx;
+    left: 4rpx;
     top: 0;
     z-index: 2;
     color: #fff;

+ 29 - 6
pages/main/class/class.js

@@ -54,11 +54,34 @@ Page({
     })
   },
   goToReading: function () {
-    let id = this.data.id;
-    let title = this.data.title;
-    wx.navigateTo({
-      url: `../../main/reading/reading?id=${id}`
-    })
+    
+    let classId = this.data.id;
+    httpRequestApi.checkLesson(classId).success(res=>{
+      const productId = res.data.data[0];
+      httpRequestApi.areYouSuper(res.data.data).success(res => {
+        if(res.data.success){
+          wx.navigateTo({
+            url: `../../main/reading/reading?id=${classId}`
+          })
+        } else {
+          wx.showModal({
+            title: '您未购买过本书,不能朗读',
+            content: '超值团购进行中,快去看看',
+            success (res) {
+              if (res.confirm) {
+                console.log('用户点击确定')
+                wx.navigateTo({
+                  url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+                })
+              } else if (res.cancel) {
+                console.log('用户点击取消')
+              }
+            }
+          })
+        }
+      })
+    });
+    
   },
   openShare: function (e) {
     // this.setData({
@@ -114,7 +137,7 @@ Page({
     const data = {
       lessonId: this.data.id,
       pageNo: this.data.pageNo,
-      pageSize: 1
+      pageSize: 10
     };
     httpRequestApi.getClassRead(this.uid, data).success(res => {
       const readInfo = res.data.data.list;

+ 4 - 2
pages/main/class/class.wxss

@@ -73,6 +73,8 @@
     height: 100%;
     background: #e8e8e8;
     margin-bottom: 150rpx;
+    min-height:710rpx;
+
 }
 
 .readWorksSection  .peopleNum{
@@ -95,8 +97,8 @@
 
 .readWorksSection .workCard {
     width: 716rpx;
-    /* height: 132rpx; */
-    height: 700rpx;
+    height: 132rpx;
+    /* height: 700rpx; */
     display: flex;
     align-items: center;
     flex-direction: row;

+ 1 - 1
pages/main/week/week.wxml

@@ -1,6 +1,6 @@
 <view class="hotSection">
         <view class="hotWares" style="flex-direction:row;">
-            <view wx:for="{{recommend}}" wx:key="{{index}}" class="hotWareCard" data-classId="{{item.classId}}" data-title="{{item.title}}">
+            <view wx:for="{{recommend}}" bindtap="openClass" wx:key="{{index}}" class="hotWareCard" data-classId="{{item.classId}}" data-title="{{item.title}}">
                 <image class="wareCardImg" src="{{item.img}}" />
                 <text class="wareCardTitle">{{item.title}}</text>
                 <view class="bottomData">

+ 8 - 0
pages/main/week/week.wxss

@@ -51,3 +51,11 @@
     justify-content: space-between;
     align-items: center;
 }
+.hotWareCard .wareCardTip {
+    width: 178rpx;
+    height: 40rpx;
+    display: block;
+    text-align: left;
+    color: #414141;
+    font-size: 24rpx;
+}

+ 0 - 1
pages/social/replyDetail/replyDetail.js

@@ -25,7 +25,6 @@ Page({
     getReplyDetail: function () {
         // let uid = wx.getStorageSync('uid');
         httpRequestApi.getReplyComment(this.uid, this.data.postId).success((res) => {
-            debugger;
             console.log(res);
             const replyList = res.data.data.replyVOList;
             const replied = res.data.data;

+ 38 - 13
pages/social/works/works.js

@@ -27,7 +27,6 @@ Page({
     },
     onLoad: function (option) {
         console.log(option)
-        debugger;
         let id = option.id ? option.id : option.scene.replace('QR', '')
 
         wx.setNavigationBarTitle({
@@ -41,13 +40,13 @@ Page({
         this.uid = wx.getStorageSync('uid');
         this.getWorks(this.uid, id);
     },
-    onHide: function(){
-        if(this.innerAudioContext){
+    onHide: function () {
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
     },
-    onUnload: function(){
-        if(this.innerAudioContext){
+    onUnload: function () {
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
     },
@@ -60,7 +59,7 @@ Page({
             const works = res.data.data.userRead;
             const othersTemp = [];
             others.forEach((item) => {
-              const temp = {};
+                const temp = {};
                 temp.uid = item.userRead.id;
                 temp.title = item.userRead.title;
                 temp.image = item.user.avatar;
@@ -68,7 +67,7 @@ Page({
                 othersTemp.push(temp);
             });
             this.setData({
-                user: othersTemp, 
+                user: othersTemp,
                 totalRead: res.data.data.totalRead,
                 author: author.wechatName,
                 authorAvatar: author.avatar,
@@ -141,11 +140,37 @@ Page({
         this.innerAudioContext.pause();
     },
     goToReading: function () {
-        let id = this.data.id;
-        let title = this.data.title;
-        wx.navigateTo({
-            url: `../../main/reading/reading?id=${this.data.classId}`
-        })
+
+        // wx.navigateTo({
+        //     url: `../../main/reading/reading?id=${this.data.classId}`
+        // })
+
+        const classId = this.data.classId;
+        httpRequestApi.checkLesson(classId).success(res => {
+            const productId = res.data.data[0];
+            httpRequestApi.areYouSuper(res.data.data).success(res => {
+                if (res.data.success) {
+                    wx.navigateTo({
+                        url: `../../main/reading/reading?id=${classId}`
+                    })
+                } else {
+                    wx.showModal({
+                        title: '您未购买过本书,不能朗读',
+                        content: '超值团购进行中,快去看看',
+                        success(res) {
+                            if (res.confirm) {
+                                console.log('用户点击确定')
+                                wx.navigateTo({
+                                    url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+                                })
+                            } else if (res.cancel) {
+                                console.log('用户点击取消')
+                            }
+                        }
+                    })
+                }
+            })
+        });
     },
     onShareAppMessage: function (res) {
         if (res.from === 'button') {
@@ -204,7 +229,7 @@ Page({
     // 去其他用户的作品页
     goToOthers: function (e) {
         wx.navigateTo({
-          url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
+            url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
         })
     },
     // 查询回复

+ 0 - 1
pages/user/mycourse/mycourse.js

@@ -37,7 +37,6 @@ Page({
   toCourse: function(e) {
     let productId = e.currentTarget.dataset.productid;
     let productTitle = e.currentTarget.dataset.producttitle;
-    debugger
     wx.navigateTo({
       url: `../../groupPage/grade-details/grade-details?productId=${productId}&title=${productTitle}`
     });

+ 0 - 1
pages/user/myread/myread.js

@@ -104,7 +104,6 @@ Page({
     }
     APIClient.myRead().success(res => {
       console.log(res.data.data.list);
-      debugger;
       this.setData({
         wareCards: res.data.data.list
       });

+ 14 - 0
utils/APIClient.js

@@ -322,4 +322,18 @@ module.exports = {
       uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
+  // 产品鉴权
+  areYouSuper(productArr){
+    let url = getBaseUrl(`wx/groupPurchase/auth`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data(productArr).method('POST').send();
+  },
+  // 找到课程对应的课本
+ checkLesson(lessonId){
+    let url = getProductUrl(`wx/lesson/product/${lessonId}`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  }
 }