Kaynağa Gözat

可持续发展观念的更新

Rorschach 5 yıl önce
ebeveyn
işleme
3fd99b0f1f

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

@@ -70,12 +70,17 @@ Page({
       })
     }
   },
+  onShow: function(){
+    this.setData({
+      haveTapMoney : false
+    })
+  },
   //获取团购信息并掉起支付
   pay: function (e) {
     console.log(e)
-    if(this.data.haveTapMoney){
-      return false
-    }
+      if(this.data.haveTapMoney){
+        return false
+      }
     this.setData({
       haveTapMoney : true
     })
@@ -267,7 +272,12 @@ Page({
     }
     // const productId = options.productId;
     this.getBookInfo(options.productId);
-    this.areYouBookSuper(options.productId)
+    if(this.data.isIOS){
+      this.areYouBookSuper('IOS',options.productId)
+    } else {
+      this.areYouBookSuper('ANDROID',options.productId)
+    }
+    
     this.getGroupInfo(options.productId)
     // if (productId) {
     this.setData({
@@ -277,10 +287,10 @@ Page({
 
   },
   // 课本鉴权
-  areYouBookSuper: function (productId) {
+  areYouBookSuper: function (os,productId) {
     // const productArr = [];
     // productArr.push(productId);
-    httpRequestApi.areYouSuperSecond(productId).success(res => {
+    httpRequestApi.areYouSuperSecond(os,productId).success(res => {
       console.log(res)
       this.setData({
         imSuper: res.data.data.auth ? true : false,
@@ -290,7 +300,7 @@ Page({
         haveCreatedHelp: res.data.data.createdShare, // 创建过助力团
         haveJoinHelp: res.data.data.joinShare, // 参加过助力团
         haveJoinNormal: res.data.data.joinOrder, // 参加过支付团
-        tasteDay: res.data.data.auth ? util.formatDate(res.data.data.auth.endTime - res.data.data.currentTime,5) : ''
+        tasteDay: res.data.data.auth ? ((res.data.data.auth.endTime - res.data.data.currentTime) / 86400000).toFixed(0) : ''
 
       })
       console.log(this.data.imSuper)

+ 11 - 2
pages/groupPage/grade-details/grade-details.wxml

@@ -59,14 +59,23 @@
                 <button class="formBtn" form-type="submit"></button>
             </form>
         </block>
-        <!-- 已有权限的界面 并且是ios-->
-        <block wx:for="{{payList}}" wx:key="{{index}}"  wx:if="{{imSuper}}">
+        <!-- ios 七天权限的界面-->
+        <block wx:for="{{payList}}" wx:key="{{index}}"  wx:if="{{imSuper && haveJoinHelp}}">
             <form class="Price" bindsubmit="pay" report-submit="{{formIsANAsshole}}" data-id="{{item.id}}" wx:if="{{item.headcount == 1 || item.headcount == 5 ? false : true }}">
                  <text class="formFit two-line-2">试用期还有{{tasteDay}}天</text>
                 <text class="formFit two-line-1">邀请好友助力获得本课使用权</text>
                 <button class="formBtn" form-type="submit"></button>
             </form>
         </block>
+        <!-- ios 三年权限的界面 支持继续开团 -->
+        <block wx:for="{{payList}}" wx:key="{{index}}" wx:if="{{imSuper && !haveJoinHelp}}">
+            <form class="Price" bindsubmit="pay" report-submit="{{formIsANAsshole}}" data-id="{{item.id}}" wx:if="{{index != 0 && index != 2 }}">
+                <!-- <text class="formFit">{{item.price / 100}}元/{{item.headcount - 1}}人帮忙</text> -->
+                <!-- <text class="formFit">两个小伙伴助力</text> -->
+                <text class="formFit one-line-text">好东西要分享给好朋友</text>
+                <button class="formBtn" form-type="submit"></button>
+            </form>
+        </block>
     </view>
     <!-- 已有权限的界面 安卓 -->
     <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!isIOS ? haveJoinNormal ? true : haveCreatedHelp ? true : false : false}}">

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

@@ -87,6 +87,7 @@ Page({
     //登录页信息
     this.onLoad(this.data.onLoadOption);
   },
+  // 审核一定要通过啊
   //发起团购
   sendGroup: function () {
     this.setData({

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

@@ -24,7 +24,7 @@
             </view>
         <view class="shengyu" wx:if="{{!dataLoading}}">
             
-            <view class="shengyu-num" wx:if="{{colonelName}}">团长{{colonelName}}发起团购</view>
+            <view class="shengyu-num" wx:if="{{colonelName}}">团长{{colonelName}}发起{{groupOSType === 'IOS' ? '助力' : '拼团'}}</view>
             <view class="shengyu-num"  hidden="{{surplusNum == '0' || !stillGoing || groupStatus}}">仅剩<text>{{surplusNum}}</text>个名额就{{groupOSType === 'IOS' ? '助力' : '拼团'}}成功了</view>
             <view class="shengyu-num" hidden="{{stillGoing}}">团购已超过时限</view>
             <view class="shengyu-num" hidden="{{surplusNum != '0'}}">{{groupOSType === 'IOS' ? '助力' : '拼团'}}成功!</view>

+ 10 - 4
pages/groupPage/my-group/my-group.js

@@ -81,21 +81,27 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (option) {
+  onLoad: function (options) {
+    console.log(options)
     // if (app.globalData.isIOS) {
     //   wx.redirectTo({
     //     url: '../../index/index'
     //   })
     //   return 
     // }
-    if (option && option.title) {
+    if (options && options.title) {
       wx.setNavigationBarTitle({
-        title: option.title //页面标题为路由参数
+        title: options.title //页面标题为路由参数
       });
       this.setData({
-        title: option.title
+        title: options.title
       });
     }
+    if(options.share){
+      this.setData({
+        goBackHome: true
+      })
+    }
     this.getMyGroup();
   },
   // 获取我的拼团

+ 2 - 1
pages/groupPage/my-group/my-group.json

@@ -2,6 +2,7 @@
     "component": true,
     "usingComponents": {
         "popup": "/component/popup/popup",
-        "myPlacerholder": "/component/myPlacerholder/myPlacerholder"
+        "myPlacerholder": "/component/myPlacerholder/myPlacerholder",
+        "goBackHome": "/component/goBackHome/goBackHome"
     }  
 }

+ 2 - 1
pages/groupPage/my-group/my-group.wxml

@@ -43,4 +43,5 @@
     btnContent="{{btnContent}}"
     bindGroup="group"
     bindClose="close"
-></popup>
+></popup>
+<goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />

+ 8 - 1
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 1,
+			"current": 2,
 			"list": [
 				{
 					"id": -1,
@@ -50,6 +50,13 @@
 					"pathName": "pages/groupPage/group-details/group-details",
 					"query": "share=true&shareId=1545234853489961",
 					"scene": "1012"
+				},
+				{
+					"id": -1,
+					"name": "分享团111",
+					"pathName": "pages/groupPage/my-group/my-group",
+					"query": "share=true",
+					"scene": "1012"
 				}
 			]
 		}

+ 2 - 1
utils/APIClient.js

@@ -343,11 +343,12 @@ module.exports = {
     }).send();
   },
   // 课程鉴权 包括助力团
-  areYouSuperSecond(productId) {
+  areYouSuperSecond(os,productId) {
     let url = getBaseUrl(`wx/groupPurchase/authAll`);
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).data({
+      osType:os,
       productId
     }).send();
   },