Authored by hongyong.zhao

添加买家协议 -- reviewed by jinyou

... ... @@ -40,6 +40,7 @@ class App extends Component {
'pages/userCenter/addressManager/addressEditer/addressPicker',
'pages/order/orderConfirm/orderConfirm',
'pages/order/orderSuccess/orderSuccess',
'pages/order/orderProtocol/orderProtocol',
],
window: {
backgroundTextStyle: 'light',
... ...
... ... @@ -13,6 +13,11 @@ Page({
data: {
payLabel: '待支付:',
payButton: '去支付',
protocolLabel: '我已阅读并同意',
protocolText: '买家协议',
agreeProtocol: false,
checkImage: '../../../assets/images/select@2x.png',
unCheckImage: '../../../assets/images/unselect@2x.png',
},
onLoad: function (option) {
console.log(option)
... ... @@ -90,6 +95,8 @@ Page({
},
submit() {
if (this.data.agreeProtocol) return
if (!this.data.hasAddress) {
wx.showToast({
title:'请选择地址'
... ... @@ -185,13 +192,28 @@ Page({
// var pages = getCurrentPages();
// var prevPage = pages[pages.length - 2]; //上一个页面
// prevPage.setData({
// address: {
//
// }
// })
//
// wx.navigateBack();
wx.navigateTo({
url: '../../userCenter/addressManager/addressManager'
})
}
},
checkProtocol: function () {
this.setData({
agreeProtocol: !this.data.agreeProtocol
})
},
goProtocol: function () {
wx.navigateTo({
url: '../orderProtocol/orderProtocol'
})
},
})
... ...
<view>
<view class="orderContainer">
<scroll-view scroll-x="false">
<addressCell hasAddress="{{hasAddress}}" address="{{address}}" bindaddressevent="chooseAddress"></addressCell>
... ... @@ -7,6 +8,18 @@
</scroll-view>
</view>
<view class="payProtocolContainer">
<view class="payProtocol">
<view class="payProtocolCheckImageContainer" bindtap="checkProtocol">
<image class="payProtocolCheckImage" src="{{agreeProtocol ? checkImage : unCheckImage}}"></image>
</view>
<text class="payProtocolLabel">{{protocolLabel}}</text>
<view class="protocolTextContainer" bindtap="goProtocol">
<text class="payProtocolText">{{protocolText}}</text>
</view>
</view>
</view>
<view class="payBottomContainer">
<view class="payBottomLeft">
<view class="payBottomLeftItem">
... ... @@ -14,8 +27,9 @@
<text class="payAmount">¥{{amount}}</text>
</view>
</view>
<view class="payBottomRight" bindtap="submit">
<view class="{{agreeProtocol ? 'payBottomRight' : 'payBottomRightUnCheck'}}" bindtap="submit">
<text class="payButton">{{payButton}}</text>
</view>
</view>
</view>
... ...
... ... @@ -4,6 +4,53 @@
}
.payProtocolContainer {
position: absolute;
bottom: 120rpx;
width: 100%;
height: 80rpx;
border-top: 1px solid #EEEEEE;
}
.payProtocol {
margin-left: 40rpx;
margin-top: 10rpx;
margin-bottom: 10rpx;
display: block;
}
.payProtocolCheckImageContainer {
display: inline-block;
}
.payProtocolCheckImage {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
vertical-align: middle;
}
.payProtocolLabel {
font-family: 'PingFang-SC-Regular';
font-size: 24rpx;
color: #999999;
letterSpacing: 0;
}
.protocolTextContainer {
display: inline-block;
}
.payProtocolText {
font-family: 'PingFang-SC-Regular';
font-size: 24rpx;
color: #65AB85;
letter-spacing: 0;
margin-left: 20rpx;
text-decoration-line: underline;
}
.payBottomContainer {
position: absolute;
bottom: 0;
... ... @@ -51,6 +98,14 @@
width: 300rpx;
}
.payBottomRightUnCheck {
background: #CCCCCC;
display: flex;
justify-content: center;
align-items: center;
width: 300rpx;
}
.payButton {
font-family: PingFang-SC-Semibold;
font-size: 35rpx;
... ...
/**
* orderProtocol.js
*@author dennis
*@createtime 2018/10/31
*@description 买家协议
*/
Page({
data: {
protocolLink: 'https://activity.yoho.cn/feature/3189.html?title=买家协议'
},
onLoad: function (option) {
}
})
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "买家协议"
}
... ...
<web-view src="{{protocolLink}}">
</web-view>
... ...