Limengbo 6 лет назад
Родитель
Сommit
c6ca80e0a0

+ 8 - 1
pages/groupPage/grade-details/grade-details.js

@@ -26,7 +26,14 @@ Page({
       }
     ],
     share: false,
-    isIPX: app.globalData.isIPX
+    isIPX: app.globalData.isIPX,
+    flag: true
+  },
+  //tab切换
+  tabSwitch: function () {
+    this.setData({
+      flag: !this.data.flag
+    })
   },
   //获取团购信息并掉起支付
   pay: function ({

+ 7 - 6
pages/groupPage/grade-details/grade-details.wxml

@@ -3,19 +3,20 @@
     <scroll-view scroll-y="{{true}}">
         <view class="grade-details">
             <image src="{{titleIcon}}"></image>
-            <text>{{title}}</text>
-            <text>{{bookInfo}}</text>
         </view>
         <view class="catalog">
-            <image src="../../../static/groupImg/Rectangle34@2x.png"></image>
-            <text>课文目录</text>
+            <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image> 
+            <text class="{{flag ? '' : 'select'}}" bindtap="tabSwitch">您需要知道</text>    
+            <text class="{{flag ? 'select' : ''}}" bindtap="tabSwitch">课文目录</text>
         </view>
-        <view class="catalog-list">
+        <view class="catalog-list" hidden="{{!flag}}">
             <view class="catalog-item" wx:for="{{lessonList}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToClass">
                 <text class="left">{{item.title}}</text>
                 <text class="right">{{item.readingNum}}朗读 ></text>
             </view>
         </view>
+        <view class="know" hidden="{{flag}}">
+        </view>       
     </scroll-view>
     <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!share}}">
         <image class="bg1" src="../../../static/groupImg/Rectangle_9.png"></image>
@@ -23,7 +24,7 @@
         <block wx:for="{{payList}}" wx:key="{{index}}">
             <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
                 <text>¥{{item.price / 100}}</text>
-                <text>{{item.headcount}}人团</text>
+                <text>{{item.headcount == '1' ? '单' : item.headcount}}人团</text>
             </view>
         </block>
     </view>

+ 17 - 19
pages/groupPage/grade-details/grade-details.wxss

@@ -12,7 +12,6 @@ scroll-view {
 }
 
 .grade-details {
-    margin: 12rpx 0;
     background: #fff;
     display: flex;
     flex-direction: column;
@@ -25,36 +24,35 @@ scroll-view {
     border-radius: 20rpx;
 }
 
-.grade-details text {
-    font-size: 32rpx;
-}
-
-.grade-details text:nth-child(2) {
-    margin: 12rpx 0;
-}
-
 .catalog {
+    display: flex;
+    align-items: center;
     width: 100%;
-    height: 62rpx;
+    height: 136rpx;
     background: #fff;
     position: relative;
 }
 
 .catalog image {
     position: absolute;
-    left: 24rpx;
-    top: 10rpx;
-    width: 208rpx;
-    height: 42rpx;
+    left: 374rpx;
+    top: 36rpx;
+    width: 2rpx;
+    height: 66rpx;
 }
 
 .catalog text {
-    position: absolute;
-    left: 34rpx;
-    top: 7rpx;
-    z-index: 2;
-    color: #fff;
+    flex: 1;
+    height: 60rpx;
+    text-align: center;
     font-size: 36rpx;
+    margin: 0 100rpx;
+    box-sizing: border-box;
+}
+
+.catalog .select {
+    border-bottom: 2rpx solid #61CA54;
+    color: #61CA54;
 }
 
 .catalog-list {

+ 12 - 4
pages/groupPage/group-details/group-details.js

@@ -32,7 +32,14 @@ Page({
     isIPX: app.globalData.isIPX,
     bookList: [],
     sendGroupFlag: true,
-    selectFlag: []
+    selectFlag: [],
+    flag: true
+  },
+  //tab切换
+  tabSwitch: function () {
+    this.setData({
+      flag: !this.data.flag
+    })
   },
   jurisdiction: function () {
     //隐藏弹框
@@ -102,6 +109,7 @@ Page({
       }
       
       if (res.data.data.groupPurchaseOrder.groupType === 'BASE') {
+        debugger;
         //掉起支付
         this.prePayMap(res.data.data.prePayMap, 'create');
       }else {
@@ -182,6 +190,7 @@ Page({
   },
   //拼团详情
   jionSuccess: function (orderId, type) {
+    debugger;
     httpRequestApi.getMygroupInfo(orderId).success(res => {
       console.log('拼团详情', res.data.data);
       const groupOrder = res.data.data.groupPurchaseOrder;
@@ -189,16 +198,15 @@ Page({
       this.setData({
         organizer: groupOrder.organizer,
       })
+      debugger
       if (type === 'join') {
         this.data.surplusList.pop();
-        debugger;
         if (groupOrder.status === 'SUCCESSED') {
           this.showSuccess(groupOrder.organizer, groupOrder.organizerPrice)
         } else {
           this.goToDetail(groupOrder.id)
         }
-      } if (type = 'create') {
-        debugger;
+      } else if (type === 'create') {
         this.showSuccess(groupOrder.organizer, groupOrder.organizerPrice)
       } else {
         for (var i = 0; i < surplusNum; i++) {

+ 6 - 5
pages/groupPage/group-details/group-details.wxml

@@ -44,19 +44,20 @@
     <scroll-view scroll-y="{{true}}">
         <view class="grade-details" bindtap="gradeDetails">
             <image src="{{titleIcon}}" ></image>
-            <text>{{title}}</text>
-            <text>{{bookInfo}}</text>
         </view>
         <view class="catalog">
-            <image src="../../../static/groupImg/Rectangle34@2x.png"></image>
-            <text>课文目录</text>
+            <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image> 
+            <text class="{{flag ? '' : 'select'}}" bindtap="tabSwitch">您需要知道</text>    
+            <text class="{{flag ? 'select' : ''}}" bindtap="tabSwitch">课文目录</text>
         </view>
-        <view class="catalog-list">
+        <view class="catalog-list" hidden="{{!flag}}">
             <view class="catalog-item" wx:for="{{lessonList}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToClass">
                 <text class="left">{{item.title}}</text>
                 <text class="right">{{item.readingNum}}朗读 ></text>
             </view>           
         </view>
+        <view class="know" hidden="{{flag}}">
+        </view>
     </scroll-view>
     <view class="group-details-btn {{isIPX ? 'bottomx' :''}}" hidden="{{surplusNum == '0'}}">
         <!--

+ 17 - 19
pages/groupPage/group-details/group-details.wxss

@@ -95,7 +95,6 @@ scroll-view {
 }
 
 .grade-details {
-    margin: 12rpx 0;
     background: #fff;
     display: flex;
     flex-direction: column;
@@ -108,36 +107,35 @@ scroll-view {
     border-radius: 20rpx;
 }
 
-.grade-details text {
-    font-size: 32rpx;
-}
-
-.grade-details text:nth-child(2) {
-    margin: 12rpx 0;
-}
-
 .catalog {
+    display: flex;
+    align-items: center;
     width: 100%;
-    height: 62rpx;
+    height: 136rpx;
     background: #fff;
     position: relative;
 }
 
 .catalog image {
     position: absolute;
-    left: 24rpx;
-    top: 10rpx;
-    width: 208rpx;
-    height: 42rpx;
+    left: 374rpx;
+    top: 36rpx;
+    width: 2rpx;
+    height: 66rpx;
 }
 
 .catalog text {
-    position: absolute;
-    left: 34rpx;
-    top: 7rpx;
-    z-index: 2;
-    color: #fff;
+    flex: 1;
+    height: 60rpx;
+    text-align: center;
     font-size: 36rpx;
+    margin: 0 100rpx;
+    box-sizing: border-box;
+}
+
+.catalog .select {
+    border-bottom: 2rpx solid #61CA54;
+    color: #61CA54;
 }
 
 .catalog-list {