作者 刘晓艳

修改团购部分

... ... @@ -10,7 +10,9 @@
chargenum: "2059788797",
page: 0,
groupList: [],
recordList: []
recordList: [],
pay_info: [],
is_agree:false
},
//tab切换
... ... @@ -25,7 +27,12 @@
})
}
},
//同意协议按钮
agree() {
this.setData({
is_agree: !this.data.is_agree
})
},
//服务协议
serviceProtocol() {
wx.navigateTo({
... ... @@ -111,31 +118,52 @@
this.wxPay(res.pay)
})
},
//发起团购
PayDetail() {
let url = '/portal/Group/group_option'
let params = {}
let header = {
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res)
this.setData({
pay_info: res.info
})
})
},
//发起团购支付
wxPay(data) {
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': 'MD5',
'paySign': data.paySign,
'success': function(res) {
console.log(res)
wx.showToast({
title: '支付成功',
icon: 'success',
success: function() {
setTimeout(function() {
wx.navigateTo({
url: '/pages/my/shareGroupBuy/shareGroupBuy',
})
}, 500)
}
});
},
'fail': function(res) {}
})
if (this.data.is_agree){
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': 'MD5',
'paySign': data.paySign,
'success': function (res) {
console.log(res)
wx.showToast({
title: '支付成功',
icon: 'success',
success: function () {
setTimeout(function () {
wx.navigateTo({
url: '/pages/my/shareGroupBuy/shareGroupBuy',
})
}, 500)
}
});
},
'fail': function (res) { }
})
}else{
wx.showToast({
title: '请同意服务协议',
icon:'none'
})
}
},
... ... @@ -145,6 +173,7 @@
onLoad: function(options) {
this.takeGroup()
this.record()
this.PayDetail()
},
/**
... ...
... ... @@ -14,7 +14,7 @@
<view class='content_box'>
<view>
<view class='item_list' wx:for='{{groupList}}' wx:key=''>
<view class='list_title_box' data-id='{{item.id}}' bindtap='listDetail'>
<view class='list_title_box' data-id='{{item.id}}' bindtap='listDetail'>
<view>查看详情</view>
<view class='iconfont icon-fanhui'></view>
</view>
... ... @@ -24,7 +24,7 @@
<view class='info_box'>
<block>
<image src='{{sub_item.avatar}}'></image>
<view class='info_label' wx:if='{{sub_item.is_start==1}}'>发起人</view>
<view class='info_label' wx:if='{{sub_item.is_start==1}}'>发起人</view>
</block>
</view>
<view class='info_time'>
... ... @@ -113,10 +113,10 @@
<view class='content_box' style='padding:0 20rpx;'>
<view class='list_label_box'>
<view class='group_num'>团购人数:最低
<text>3人</text>
<text>{{pay_info.num}}人</text>
</view>
<view class='group_time'>发布倒计时:
<text>3小时</text>
<text>{{pay_info.time}}小时</text>
</view>
</view>
<view class='list_title_info'>
... ... @@ -127,13 +127,15 @@
</view>
</view>
<view class='service_box'>
<view class='service_info_box'>
<text class='iconfont icon-xuanzhong'></text>
<view class='service_info_box' bindtap="agree">
<!-- <text class='iconfont icon-xuanzhong'></text> -->
<text class='iconfont icon-xuanze1' wx:if="{{!is_agree}}"></text>
<text class='iconfont icon-xuanzhong' wx:if="{{is_agree}}"></text>
<text>我已阅读并同意畅玩卡</text>
<text class='service_info' bindtap='serviceProtocol'>服务协议</text>
<text class='service_info' catchtap='serviceProtocol'>服务协议</text>
</view>
<view class='service_btn_box'>
<view>单价:¥188.00</view>
<view>单价:¥{{pay_info.price}}</view>
<view class='pay_btn' bindtap='goPay'>支付</view>
</view>
</view>
... ...
... ... @@ -13,6 +13,11 @@ page {
justify-content: center;
}
.icon-xuanze1 {
font-size: 24rpx;
margin-right: 18rpx;
}
.banner_img image {
width: 100%;
height: 100%;
... ...
... ... @@ -6,7 +6,7 @@ Page({
* 页面的初始数据
*/
data: {
imgsUrl: ['../../../images/banner.jpg', '../../../images/banner.jpg', '../../../images/banner.jpg'],
imgsUrl: ['../../../images/aicon_09@2x.png', '../../../images/aicon_09@2x.png', '../../../images/aicon_09@2x.png'],
swipercurrent: 0,
},
//获取轮播当前页
... ...
... ... @@ -3,7 +3,19 @@
<view class='banner_box'>
<swiper class='swiper_box' wx:key='' interval='2000' duration='500' current='{{swipercurrent}}' bindchange='swiperCharge'>
<swiper-item class="banner_img" wx:for='{{imgsUrl}}' wx:key=''>
<image src='{{item}}'></image>
<!-- <image class='swiper_img' src='{{item}}'> -->
<view class='img_top'>
<view class='logo_title'>畅玩卡</view>
<view>20180101-20190102</view>
</view>
<view class='img_info'>
<view class='info_title'>畅玩卡说明:</view>
<view>1.年卡只限本人使用年卡只限本人使用年卡只限本人使用年卡只限 本人使用年卡只限本人使用年卡只
</view>
<view>2.年卡只限本人使用年卡只限本人使用</view>
<view>3.年卡只限本人使用年卡只限本人使用年卡只限本人使用年本人使 用本人使用仅限</view>
</view>
<!-- </image> -->
</swiper-item>
</swiper>
<view class='indicator_dots'>
... ...
... ... @@ -20,11 +20,48 @@ page {
height: 370rpx;
border-radius: 20rpx;
overflow: hidden;
background-image: url('http://science.w.bronet.cn/static/images/background.png');
position: relative;
}
.banner_img image {
width: 100%;
height: 100%;
position: relative;
}
.img_top {
width: 100%;
position: absolute;
z-index: 100;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
border: 1rpx solid rgba(0, 0, 0, 0.1);
padding: 25rpx 30rpx;
box-sizing: border-box;
}
.logo_title{
font-size: 45rpx;
}
.info_title {
font-size: 24rpx;
color: #fff;
margin-bottom: 15rpx;
}
.img_info {
font-size: 18rpx;
color: #fff;
width: 100%;
position: absolute;
z-index: 100;
top: 115rpx;
padding: 30rpx;
box-sizing: border-box;
line-height: 30rpx;
}
.indicator_dots {
... ... @@ -64,9 +101,11 @@ page {
font-size: 32rpx;
color: #464646;
}
.item_list:last-child{
.item_list:last-child {
border: 0;
}
.list_title {
position: relative;
padding-left: 17rpx;
... ... @@ -76,7 +115,7 @@ page {
content: "";
width: 6rpx;
height: 32rpx;
background: #3FA9F5;
background: #3fa9f5;
border-radius: 40rpx;
position: absolute;
left: -10rpx;
... ...
... ... @@ -27,13 +27,23 @@
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
"current": 0,
"list": [
{
"id": -1,
"name": "card",
"pathName": "pages/my/myCard/myCard"
}
]
}
}
}
\ No newline at end of file
... ...