作者 刘晓艳

修改团购部分

@@ -10,7 +10,9 @@ @@ -10,7 +10,9 @@
10 chargenum: "2059788797", 10 chargenum: "2059788797",
11 page: 0, 11 page: 0,
12 groupList: [], 12 groupList: [],
13 - recordList: [] 13 + recordList: [],
  14 + pay_info: [],
  15 + is_agree:false
14 }, 16 },
15 17
16 //tab切换 18 //tab切换
@@ -25,7 +27,12 @@ @@ -25,7 +27,12 @@
25 }) 27 })
26 } 28 }
27 }, 29 },
28 - 30 + //同意协议按钮
  31 + agree() {
  32 + this.setData({
  33 + is_agree: !this.data.is_agree
  34 + })
  35 + },
29 //服务协议 36 //服务协议
30 serviceProtocol() { 37 serviceProtocol() {
31 wx.navigateTo({ 38 wx.navigateTo({
@@ -111,31 +118,52 @@ @@ -111,31 +118,52 @@
111 this.wxPay(res.pay) 118 this.wxPay(res.pay)
112 }) 119 })
113 }, 120 },
114 - 121 + //发起团购
  122 + PayDetail() {
  123 + let url = '/portal/Group/group_option'
  124 + let params = {}
  125 + let header = {
  126 + "XX-Token": wx.getStorageSync('token')
  127 + }
  128 + app.post(url, params, header).then((res) => {
  129 + console.log(res)
  130 + this.setData({
  131 + pay_info: res.info
  132 + })
  133 + })
  134 + },
115 //发起团购支付 135 //发起团购支付
116 wxPay(data) { 136 wxPay(data) {
117 - wx.requestPayment({  
118 - 'timeStamp': data.timeStamp,  
119 - 'nonceStr': data.nonceStr,  
120 - 'package': data.package,  
121 - 'signType': 'MD5',  
122 - 'paySign': data.paySign,  
123 - 'success': function(res) {  
124 - console.log(res)  
125 - wx.showToast({  
126 - title: '支付成功',  
127 - icon: 'success',  
128 - success: function() {  
129 - setTimeout(function() {  
130 - wx.navigateTo({  
131 - url: '/pages/my/shareGroupBuy/shareGroupBuy',  
132 - })  
133 - }, 500)  
134 - }  
135 - });  
136 - },  
137 - 'fail': function(res) {}  
138 - }) 137 + if (this.data.is_agree){
  138 + wx.requestPayment({
  139 + 'timeStamp': data.timeStamp,
  140 + 'nonceStr': data.nonceStr,
  141 + 'package': data.package,
  142 + 'signType': 'MD5',
  143 + 'paySign': data.paySign,
  144 + 'success': function (res) {
  145 + console.log(res)
  146 + wx.showToast({
  147 + title: '支付成功',
  148 + icon: 'success',
  149 + success: function () {
  150 + setTimeout(function () {
  151 + wx.navigateTo({
  152 + url: '/pages/my/shareGroupBuy/shareGroupBuy',
  153 + })
  154 + }, 500)
  155 + }
  156 + });
  157 + },
  158 + 'fail': function (res) { }
  159 + })
  160 + }else{
  161 + wx.showToast({
  162 + title: '请同意服务协议',
  163 + icon:'none'
  164 + })
  165 + }
  166 +
139 167
140 }, 168 },
141 169
@@ -145,6 +173,7 @@ @@ -145,6 +173,7 @@
145 onLoad: function(options) { 173 onLoad: function(options) {
146 this.takeGroup() 174 this.takeGroup()
147 this.record() 175 this.record()
  176 + this.PayDetail()
148 }, 177 },
149 178
150 /** 179 /**
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <view class='content_box'> 14 <view class='content_box'>
15 <view> 15 <view>
16 <view class='item_list' wx:for='{{groupList}}' wx:key=''> 16 <view class='item_list' wx:for='{{groupList}}' wx:key=''>
17 - <view class='list_title_box' data-id='{{item.id}}' bindtap='listDetail'> 17 + <view class='list_title_box' data-id='{{item.id}}' bindtap='listDetail'>
18 <view>查看详情</view> 18 <view>查看详情</view>
19 <view class='iconfont icon-fanhui'></view> 19 <view class='iconfont icon-fanhui'></view>
20 </view> 20 </view>
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <view class='info_box'> 24 <view class='info_box'>
25 <block> 25 <block>
26 <image src='{{sub_item.avatar}}'></image> 26 <image src='{{sub_item.avatar}}'></image>
27 - <view class='info_label' wx:if='{{sub_item.is_start==1}}'>发起人</view> 27 + <view class='info_label' wx:if='{{sub_item.is_start==1}}'>发起人</view>
28 </block> 28 </block>
29 </view> 29 </view>
30 <view class='info_time'> 30 <view class='info_time'>
@@ -113,10 +113,10 @@ @@ -113,10 +113,10 @@
113 <view class='content_box' style='padding:0 20rpx;'> 113 <view class='content_box' style='padding:0 20rpx;'>
114 <view class='list_label_box'> 114 <view class='list_label_box'>
115 <view class='group_num'>团购人数:最低 115 <view class='group_num'>团购人数:最低
116 - <text>3人</text> 116 + <text>{{pay_info.num}}人</text>
117 </view> 117 </view>
118 <view class='group_time'>发布倒计时: 118 <view class='group_time'>发布倒计时:
119 - <text>3小时</text> 119 + <text>{{pay_info.time}}小时</text>
120 </view> 120 </view>
121 </view> 121 </view>
122 <view class='list_title_info'> 122 <view class='list_title_info'>
@@ -127,13 +127,15 @@ @@ -127,13 +127,15 @@
127 </view> 127 </view>
128 </view> 128 </view>
129 <view class='service_box'> 129 <view class='service_box'>
130 - <view class='service_info_box'>  
131 - <text class='iconfont icon-xuanzhong'></text> 130 + <view class='service_info_box' bindtap="agree">
  131 + <!-- <text class='iconfont icon-xuanzhong'></text> -->
  132 + <text class='iconfont icon-xuanze1' wx:if="{{!is_agree}}"></text>
  133 + <text class='iconfont icon-xuanzhong' wx:if="{{is_agree}}"></text>
132 <text>我已阅读并同意畅玩卡</text> 134 <text>我已阅读并同意畅玩卡</text>
133 - <text class='service_info' bindtap='serviceProtocol'>服务协议</text> 135 + <text class='service_info' catchtap='serviceProtocol'>服务协议</text>
134 </view> 136 </view>
135 <view class='service_btn_box'> 137 <view class='service_btn_box'>
136 - <view>单价:¥188.00</view> 138 + <view>单价:¥{{pay_info.price}}</view>
137 <view class='pay_btn' bindtap='goPay'>支付</view> 139 <view class='pay_btn' bindtap='goPay'>支付</view>
138 </view> 140 </view>
139 </view> 141 </view>
@@ -13,6 +13,11 @@ page { @@ -13,6 +13,11 @@ page {
13 justify-content: center; 13 justify-content: center;
14 } 14 }
15 15
  16 +.icon-xuanze1 {
  17 + font-size: 24rpx;
  18 + margin-right: 18rpx;
  19 +}
  20 +
16 .banner_img image { 21 .banner_img image {
17 width: 100%; 22 width: 100%;
18 height: 100%; 23 height: 100%;
@@ -6,7 +6,7 @@ Page({ @@ -6,7 +6,7 @@ Page({
6 * 页面的初始数据 6 * 页面的初始数据
7 */ 7 */
8 data: { 8 data: {
9 - imgsUrl: ['../../../images/banner.jpg', '../../../images/banner.jpg', '../../../images/banner.jpg'], 9 + imgsUrl: ['../../../images/aicon_09@2x.png', '../../../images/aicon_09@2x.png', '../../../images/aicon_09@2x.png'],
10 swipercurrent: 0, 10 swipercurrent: 0,
11 }, 11 },
12 //获取轮播当前页 12 //获取轮播当前页
@@ -3,7 +3,19 @@ @@ -3,7 +3,19 @@
3 <view class='banner_box'> 3 <view class='banner_box'>
4 <swiper class='swiper_box' wx:key='' interval='2000' duration='500' current='{{swipercurrent}}' bindchange='swiperCharge'> 4 <swiper class='swiper_box' wx:key='' interval='2000' duration='500' current='{{swipercurrent}}' bindchange='swiperCharge'>
5 <swiper-item class="banner_img" wx:for='{{imgsUrl}}' wx:key=''> 5 <swiper-item class="banner_img" wx:for='{{imgsUrl}}' wx:key=''>
6 - <image src='{{item}}'></image> 6 + <!-- <image class='swiper_img' src='{{item}}'> -->
  7 + <view class='img_top'>
  8 + <view class='logo_title'>畅玩卡</view>
  9 + <view>20180101-20190102</view>
  10 + </view>
  11 + <view class='img_info'>
  12 + <view class='info_title'>畅玩卡说明:</view>
  13 + <view>1.年卡只限本人使用年卡只限本人使用年卡只限本人使用年卡只限 本人使用年卡只限本人使用年卡只
  14 + </view>
  15 + <view>2.年卡只限本人使用年卡只限本人使用</view>
  16 + <view>3.年卡只限本人使用年卡只限本人使用年卡只限本人使用年本人使 用本人使用仅限</view>
  17 + </view>
  18 + <!-- </image> -->
7 </swiper-item> 19 </swiper-item>
8 </swiper> 20 </swiper>
9 <view class='indicator_dots'> 21 <view class='indicator_dots'>
@@ -20,11 +20,48 @@ page { @@ -20,11 +20,48 @@ page {
20 height: 370rpx; 20 height: 370rpx;
21 border-radius: 20rpx; 21 border-radius: 20rpx;
22 overflow: hidden; 22 overflow: hidden;
  23 + background-image: url('http://science.w.bronet.cn/static/images/background.png');
  24 + position: relative;
23 } 25 }
24 26
25 .banner_img image { 27 .banner_img image {
26 width: 100%; 28 width: 100%;
27 height: 100%; 29 height: 100%;
  30 + position: relative;
  31 +}
  32 +
  33 +.img_top {
  34 + width: 100%;
  35 + position: absolute;
  36 + z-index: 100;
  37 + font-size: 24rpx;
  38 + color: #fff;
  39 + display: flex;
  40 + align-items: center;
  41 + justify-content: space-between;
  42 + border: 1rpx solid rgba(0, 0, 0, 0.1);
  43 + padding: 25rpx 30rpx;
  44 + box-sizing: border-box;
  45 +}
  46 +.logo_title{
  47 + font-size: 45rpx;
  48 +}
  49 +.info_title {
  50 + font-size: 24rpx;
  51 + color: #fff;
  52 + margin-bottom: 15rpx;
  53 +}
  54 +
  55 +.img_info {
  56 + font-size: 18rpx;
  57 + color: #fff;
  58 + width: 100%;
  59 + position: absolute;
  60 + z-index: 100;
  61 + top: 115rpx;
  62 + padding: 30rpx;
  63 + box-sizing: border-box;
  64 + line-height: 30rpx;
28 } 65 }
29 66
30 .indicator_dots { 67 .indicator_dots {
@@ -64,9 +101,11 @@ page { @@ -64,9 +101,11 @@ page {
64 font-size: 32rpx; 101 font-size: 32rpx;
65 color: #464646; 102 color: #464646;
66 } 103 }
67 -.item_list:last-child{ 104 +
  105 +.item_list:last-child {
68 border: 0; 106 border: 0;
69 } 107 }
  108 +
70 .list_title { 109 .list_title {
71 position: relative; 110 position: relative;
72 padding-left: 17rpx; 111 padding-left: 17rpx;
@@ -76,7 +115,7 @@ page { @@ -76,7 +115,7 @@ page {
76 content: ""; 115 content: "";
77 width: 6rpx; 116 width: 6rpx;
78 height: 32rpx; 117 height: 32rpx;
79 - background: #3FA9F5; 118 + background: #3fa9f5;
80 border-radius: 40rpx; 119 border-radius: 40rpx;
81 position: absolute; 120 position: absolute;
82 left: -10rpx; 121 left: -10rpx;
@@ -27,13 +27,23 @@ @@ -27,13 +27,23 @@
27 "current": -1, 27 "current": -1,
28 "list": [] 28 "list": []
29 }, 29 },
  30 + "plugin": {
  31 + "current": -1,
  32 + "list": []
  33 + },
30 "game": { 34 "game": {
31 "currentL": -1, 35 "currentL": -1,
32 "list": [] 36 "list": []
33 }, 37 },
34 "miniprogram": { 38 "miniprogram": {
35 - "current": -1,  
36 - "list": [] 39 + "current": 0,
  40 + "list": [
  41 + {
  42 + "id": -1,
  43 + "name": "card",
  44 + "pathName": "pages/my/myCard/myCard"
  45 + }
  46 + ]
37 } 47 }
38 } 48 }
39 } 49 }