Browse Source

更改细节

Limengbo 5 years ago
parent
commit
9f153ed037

+ 13 - 46
app.js

@@ -2,54 +2,21 @@
 import {GetQueryString} from 'utils/util'
 App({
   onLaunch: function (options) {
-   
-
-    // 展示本地存储能力
-    var logs = wx.getStorageSync('logs') || []
-    logs.unshift(Date.now())
-    wx.setStorageSync('logs', logs)
-
-    // 登录
-    wx.login({
-      success: res => {
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-      }
-    })
-    // 获取用户信息
-    wx.getSetting({
-      success: res => {
-        if (res.authSetting['scope.userInfo']) {
-          // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
-          wx.getUserInfo({
-            success: res => {
-              // 可以将 res 发送给后台解码出 unionId
-              this.globalData.userInfo = res.userInfo
-
-              // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
-              // 所以此处加入 callback 以防止这种情况
-              if (this.userInfoReadyCallback) {
-                this.userInfoReadyCallback(res)
-              }
-            }
-          })
+   // 判断设备是否为 iPhone X
+   this.checkIsIPhoneX()
+  },
+  globalData: {
+    isIPX: false, // 当前设备是否为 iPhone X
+  },
+  checkIsIPhoneX: function() {
+    const self = this
+    wx.getSystemInfo({
+      success: function (res) {
+        // 根据 model 进行判断
+        if (res.model.search('iPhone X') != -1) {
+          self.globalData.isIPX = true
         }
       }
     })
-  },
-  // onShow: function(options){
-  //   console.log(options)
-  //   const type = GetQueryString(decodeURIComponent(options.query.scene), "type");
-  //   const sceneId = GetQueryString(decodeURIComponent(options.query.scene), "id");
-  //   console.log(type, sceneId)
-  //   switch (type) {
-  //     case "works":
-  //       wx.navigateTo({
-  //         url: `../social/works/works?id=${sceneId}&title="测试"`
-  //       })
-  //       break
-  //   };
-  // },
-  globalData: {
-    userInfo: null
   }
 })

+ 3 - 1
component/group/group.js

@@ -1,11 +1,13 @@
 import httpRequestApi from '../../utils/APIClient';
+const app = getApp();
 export const groupInit = (that) => {
   that.setData({
     groupData: {
       recommendList: [],
       bookList: [],
       sendGroupFlag: true,
-      selectFlag: []
+      selectFlag: [],
+      isIPX: app.globalData.isIPX
     }
   })
   //请求数据封装

+ 1 - 1
component/group/group.wxml

@@ -39,7 +39,7 @@
           </view>
         </view>
     </scroll-view>
-    <view class="Collage-bottom">
+    <view class="Collage-bottom {{groupData.isIPX ? 'Collage-bottomx' :''}}">
       <image class="bg" src="../../static/groupImg/Rectangle_9.png"></image>
       <view bindtap="sendGroup">
         <image src="../../static/groupImg/Shape1@2x.png"></image>

+ 4 - 0
component/group/group.wxss

@@ -138,6 +138,10 @@ scroll-view {
  position: relative;
 }
 
+.Collage-bottomx {
+    height: 82rpx;
+}
+
 .Collage-bottom view image {
     width: 42rpx;
     height: 50rpx;

+ 2 - 1
pages/groupPage/collage-details/collage-details.wxml

@@ -23,7 +23,8 @@
             </block>                   
         </view>
         <view class="shengyu">
-            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
+            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">还需邀请<text>{{surplusNum}}</text>名好友</view>
+            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">即可获得一年级语文同步辅导(上学期)</view>
             <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功!快去朗读吧</view>
             <view class="shengyu-time" >
                 剩余时间:

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

@@ -67,7 +67,7 @@
 }
 
 .bg-boder {
-    border: 2px solid #000;
+    border: 2px solid #61CA54;
 }
 
 .shengyu {

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

@@ -1,5 +1,6 @@
 // pages/grade-details/grade-details.js
 import httpRequestApi from '../../../utils/APIClient';
+const app = getApp();
 Page({
   /**
    * 页面的初始数据
@@ -24,7 +25,8 @@ Page({
         color: "#FF4600"
       }
     ],
-    share: false
+    share: false,
+    isIPX: app.globalData.isIPX
   },
   //获取团购信息并掉起支付
   pay: function ({

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

@@ -17,13 +17,9 @@
             </view>
         </view>
     </scroll-view>
-    <view class="group-btn">
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!share}}">
         <image class="bg1" src="../../../static/groupImg/Rectangle_9.png"></image>
-        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>
-        <view class="Price" bindtap="pay" data-id="{{payList[0].id}}" wx:if="{{share}}">
-            <text>去分享</text>
-            <text>好友</text>
-        </view>        
+        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>      
         <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>
@@ -31,5 +27,17 @@
             </view>
         </block>
     </view>
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{share}}">
+        <image class="bg1" src="../../../static/groupImg/Rectangle_9.png" style="left: 50%"></image>   
+        <block wx:for="{{payList}}" wx:key="{{index}}">
+            <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
+                <view>继续开团</view>
+                <view>
+                    <text>¥{{item.price / 100}}</text>
+                    <text>{{item.headcount}}人团</text>
+                </view>
+            </view> 
+        </block>
+    </view>
 </view>
 <popup id="popup" typeOf="sendSuccess" title="报告团长" headTextOne="您发起的团购已经成立" content="{{content}}"></popup>

+ 5 - 1
pages/groupPage/grade-details/grade-details.wxss

@@ -7,7 +7,7 @@
 
 
 scroll-view {
-    height: 100%;
+    height: 98%;
     width: 100%;
 }
 
@@ -96,6 +96,10 @@ scroll-view {
     bottom: 0;
 }
 
+.bottomx {
+    bottom: 20rpx;
+}
+
 .group-btn .Price {
     flex: 1;
     display: flex;

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

@@ -4,6 +4,7 @@ import {
 } from '../../../utils/httpUtil';
 import httpRequestApi from '../../../utils/APIClient';
 import util from '../../../utils/util';
+const app = getApp();
 Page({
 
   /**
@@ -27,7 +28,8 @@ Page({
     headTextTwo: '',
     content: [],
     organizer: '',
-    hide: true
+    hide: true,
+    isIPX: app.globalData.isIPX
   },
   jurisdiction: function () {
     //隐藏弹框

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

@@ -58,7 +58,7 @@
             </view>           
         </view>
     </scroll-view>
-    <view class="group-details-btn" hidden="{{surplusNum == '0'}}">
+    <view class="group-details-btn {{isIPX ? 'bottomx' :''}}" hidden="{{surplusNum == '0'}}">
         <view class="left-btn" bindtap="openGroup">
             开团
         </view>

+ 6 - 2
pages/groupPage/group-details/group-details.wxss

@@ -40,7 +40,7 @@
 }
 
 .bg-boder {
-    border: 2px solid #000;
+    border: 2px solid #61CA54;
 }
 
 .shengyu {
@@ -90,7 +90,7 @@
 }
 
 scroll-view {
-    height: 80%;
+    height: 68%;
     width: 100%;
 }
 
@@ -179,6 +179,10 @@ scroll-view {
     z-index: 99;
 }
 
+.bottomx {
+    bottom: 20rpx;
+}
+
 .left-btn {
     width: 35%;
     height: 100%;

+ 3 - 10
pages/groupPage/make-money/make-money.js

@@ -15,7 +15,8 @@ Page({
     productId: '',
     orderId: '',
     groupId: '',
-    organizerUid: ''
+    organizerUid: '',
+    orderList: {}
   },
   //显示分享页 
   share: function () {
@@ -57,6 +58,7 @@ Page({
       const surplusNum = groupOrder.headcount - groupOrder.joinCount;
       this.setData({
         organizerUid: groupOrder.organizer,
+        orderList: res.data.data
       })
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
@@ -73,15 +75,6 @@ Page({
         productId: res.data.data.groupPurchaseOrder.productId,
         groupId: res.data.data.groupPurchaseOrder.groupId
       })
-      if(groupOrder.groupType === 'PROMOTION'){
-        this.data.joinUserList.unshift(res.data.data.organizer);
-        //this.data.surplusList.pop();
-        this.setData({
-          joinUserList: this.data.joinUserList,
-          //surplusList: this.data.surplusList,
-          //surplusNum: this.data.surplusNum
-        })
-      }
     }).fail( error => {
       console.log('错误', error)
     })

+ 5 - 2
pages/groupPage/make-money/make-money.wxml

@@ -1,9 +1,12 @@
 <!--pages/groupPage/make-money/make-money.wxml-->
 <view class="details-head">
+    <view class="headImg-item-faqiren" wx:if="{{orderList.groupPurchaseOrder.groupType === 'PROMOTION'}}">
+            <image class="faqiren" src="../../../static/groupImg/faqiren.png"></image>
+            <image src="{{orderList.organizer.avatar}}"></image>
+    </view>
     <view class="headImg">
         <block wx:for="{{joinUserList}}" wx:key="{{index}}">
-            <view class="headImg-item {{organizerUid == item.uid ? 'bg-boder' : ''}}">
-                <image wx:if="{{organizerUid == item.uid}}" class="tuanzhangIcon" src="../../../static/groupImg/tuanzhangIcon.png"></image>
+            <view class="headImg-item">
                 <image src="{{item.avatar}}"></image>
             </view>
         </block>

+ 20 - 10
pages/groupPage/make-money/make-money.wxss

@@ -9,8 +9,21 @@
 .headImg {
     display: flex;
     flex-wrap: wrap;
+    justify-content: center;
     padding: 40rpx 0;
     box-sizing: border-box;
+    margin-top:180rpx;    
+}
+
+.headImg-item-faqiren {
+    position: absolute;
+    left: 300rpx;
+    top: 30rpx;
+    width: 106rpx;
+    height: 106rpx;
+    border-radius: 50%;
+    margin: 20rpx 22rpx;
+    border: 2px solid #61CA54;
 }
 
 .headImg-item {
@@ -19,25 +32,22 @@
     height: 106rpx;
     border-radius: 50%;
     margin: 20rpx 22rpx;
-    position: relative;
 }
 
+.headImg-item-faqiren image,
 .headImg-item image {
     width: 100%;
     height: 100%;
     border-radius: 50%;
 }
 
-.headImg-item .tuanzhangIcon {
+.headImg-item-faqiren .faqiren {
     position: absolute;
-    right: -20rpx;
-    top: -10rpx;
-    width: 80rpx;
-    height: 30rpx;
-}
-
-.bg-boder {
-    border: 2px solid #000;
+    right: -15rpx;
+    bottom: -40rpx;
+    width: 144rpx;
+    height: 48rpx;
+    border-radius: 0;
 }
 
 .shengyu {

+ 13 - 1
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 7,
+			"current": 9,
 			"list": [
 				{
 					"id": 0,
@@ -86,6 +86,18 @@
 					"name": "replydetails",
 					"pathName": "pages/social/replyDetail/replyDetail",
 					"query": ""
+				},
+				{
+					"id": 8,
+					"name": "faqiren",
+					"pathName": "pages/groupPage/make-money/make-money",
+					"query": "id=1542264513955412"
+				},
+				{
+					"id": -1,
+					"name": "团购",
+					"pathName": "pages/groupPage/grade-details/grade-details",
+					"query": "id=1542264513955412"
 				}
 			]
 		}

BIN
static/groupImg/faqiren.png