Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:完成【订单确认】 #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"pages": [
"pages/index/index",
"pages/explore/index",
"pages/my/index"
"pages/my/index",
"pages/OrderConfirmation/index"
],
"window": {
"backgroundTextStyle": "light",
Expand Down
2 changes: 1 addition & 1 deletion custom-tab-bar/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"component": true,
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
"t-tab-bar-item": "tdesign-miniprogram/tab-bar/tab-bar-item"
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item"
}
}
21 changes: 13 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"description": "a start-kit for wechat miniprogram powerby TDesign miniprogram",
"dependencies": {
"tdesign-miniprogram": "^0.12.1"
"tdesign-miniprogram": "^1.1.15"
},
"devDependencies": {}
}
68 changes: 68 additions & 0 deletions pages/OrderConfirmation/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// pages/OrderConfirmation/index.js
Page({
/**
* 页面的初始数据
*/
data: {
value:[0,1],
title:'2021 SICC服务设计创新大会',
date:'2021年3月6日',
address:'深圳市腾讯滨海大厦',
current_name:[],
current_time:[],
current_ticket:[],
all_price:0,
member_message:[{
id:0,
name:'蔡宣轩',
},{
id:1,
name:'蔡晓萱'
}],
ticket_time:[{
time:'2021年3月16日',
}
],
ticket_price:[{
project:'早鸟价-单人票',
now_price:88,
before_price:'128'
},
{
project:'早鸟价-双人票',
now_price:168,
before_price:228
},
{
project:'正价-单人票',
now_price:128,
before_price:''
},
{
project:'正价-双人票',
now_price:228,
before_price:''
}
]
},

computed:{
},
memberChange(e){
this.setData({ current_name: e.detail.value });
},
timeChange(e){
this.setData({current_time:e.detail.value});
},
ticketChange(e) {
this.setData({ current_ticket: e.detail.value });
this.getPrice();
},
getPrice(){
console.log()
let price = this.data.ticket_price.find((item,index)=>{
return index === this.data.current_ticket[0];
})
this.setData({all_price:price.now_price})
}
})
10 changes: 10 additions & 0 deletions pages/OrderConfirmation/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "购买确认",
"usingComponents": {
"t-icon": "tdesign-miniprogram/icon/icon",
"t-divider": "tdesign-miniprogram/divider/divider",
"t-button": "tdesign-miniprogram/button/button",
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
"t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group"
}
}
148 changes: 148 additions & 0 deletions pages/OrderConfirmation/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.order-sure {
box-sizing: border-box;
background: #ffffff;
padding: 24rpx 32rpx calc(env(safe-area-inset-bottom) + 136rpx);
min-height: 100vh;
font-family: "PingFang SC";

.top-message-card{
height: 144rpx;
display: flex;
flex-direction: column;
justify-content: space-between;

.top-title text{
font-size: 40rpx;
font-weight: 600;
}
.date-address{
font-size: 28rpx;
display: flex;

view{
display: flex;
justify-content: center;
align-items: center;
}
}
}
.order-wrapper{
padding-top: 32rpx;

.content-detail{
margin-bottom: 48rpx;

.title-bar{
font-size: 32rpx;
line-height: 56rpx;
font-weight: 600;
display: flex;
justify-content: space-between;

.addMember{
width: 188rpx;
margin:0;
}
}
}
}
// 下方悬浮
.wx-pay-cover {
position: fixed;
left: 0;
bottom: 0;
right: 0;
background: #fff;
padding-bottom: env(safe-area-inset-bottom);
border-top: 0.5px solid #e7e7e7;

.wx-pay {
height: 160rpx;
box-sizing: border-box;
padding: 0rpx 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
.all-money{
font-size:40rpx;
color:#0052D9;
font-weight: 600;
}
.pay-button{
width: 400rpx;
height: 96rpx;
margin-right:0;
}
}
}


}
/* 组件样式 */
.card {
position: relative;
margin: 24rpx 0 24rpx 0;
border-radius: 12rpx;
overflow: hidden;
box-sizing: border-box;
border: 3rpx solid #DCDCDC;
}

.card--active {
border-color: #0052d9;
}

.card--active::after {
content: '';
display: block;
position: absolute;
left: 0;
top: 0;
width: 0;
border: 14px solid #0052d9;
border-bottom-color: transparent;
border-right-color: transparent;
}

.card__icon {
color: #fff;
position: absolute;
left: 1.5px;
top: 1.5px;
z-index: 1;
}

/* 横向布局 */
.horizontal-box {
display: flex;
align-items: center;
margin: 32rpx 0 24rpx 0;
}

.horizontal-box .card {
width: 214rpx;
margin: 0;
}

.horizontal-box .card + .card {
margin-left: 24rpx;
}

.horizontal-box .card::after {
border-width: 12px;
}

.horizontal-box .card__icon {
font-size: 12px;
}
.money-show{
text-decoration:line-through;
margin-left: 8rpx;
color:rgba(0, 0, 0, 0.6)
}





72 changes: 72 additions & 0 deletions pages/OrderConfirmation/index.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--pages/OrderConfirmation/index.wxml-->
<wxs module="_">
module.exports = {
contain: function (arr, key) { return arr.indexOf(key) > -1 }
}
</wxs>
<view class="order-sure">
<view class="top-message-card">
<view class="top-title">
<text>{{title}}</text>
</view>
<view class="date-address">
<view>
<t-icon name="time" size="28rpx" color="#0052d9" style="margin-right: 10rpx;" />
<text>{{date}}</text>
</view>
<view>
<t-icon name="location" size="28rpx" color="#0052d9" style="margin:0 10rpx 0 38rpx" />
<text>{{address}}</text>
</view>
</view>
<t-divider style="margin-bottom: 0px;" />
</view>
<view class="order-wrapper">
<view class="content-detail">
<view class="title-bar">
<text>人员信息</text>
<t-button size="extra-small" shape="round" class="addMember">+ 增加人员</t-button>
</view>
<t-checkbox-group t-class="horizontal-box" value="{{member_message}}" bind:change="memberChange">
<view wx:for="{{member_message}}" wx:key="index" wx:for-item="tag" class="card {{_.contain(current_name, index) ? 'card--active' :current_name.indexOf(index)}}">
<t-icon wx:if="{{_.contain(current_name, index)}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
<t-checkbox value="{{index}}" label="{{tag.name}}" icon="none" />
</view>
</t-checkbox-group>
</view>
<view class="content-detail">
<view class="title-bar">
<text>票类场次</text>
</view>
<t-checkbox-group value="{{ticket_time}}" bind:change="timeChange">
<view wx:for="{{ticket_time}}" wx:key="index" wx:for-item="tag" class="card {{_.contain(current_time, index) ? 'card--active' : current_time.indexOf(index)}}">
<t-icon wx:if="{{_.contain(current_time, index)}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
<t-checkbox value="{{index}}" label="{{tag.time}}" icon="none"/>
</view>
</t-checkbox-group>
</view>
<view class="content-detail">
<view class="title-bar">
<text>票类价格</text>
</view>
<t-checkbox-group value="{{ticket_price}}" bind:change="ticketChange">
<view wx:for="{{ticket_price}}" wx:key="index" wx:for-item="tag" class="card {{_.contain(current_ticket, index) ? 'card--active' : current_ticket.indexOf(index)}}">
<t-icon wx:if="{{_.contain(current_ticket, index)}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
<t-checkbox value="{{index}}" label="{{tag.project}}" icon="none">
<view style="float:right;display:flex">
<view style="font-weight:600">{{tag.now_price}}元</view>
<view wx:if="{{tag.before_price!==''}}" class="money-show">{{tag.before_price}}元</view>
</view>
</t-checkbox>
</view>
</t-checkbox-group>
</view>
</view>
<view class="wx-pay-cover">
<view class="wx-pay">
<view>待支付:</view>
<view class="all-money">¥{{all_price}}</view>
<t-button theme="primary" t-class="pay-button">确认购买</t-button>
</view>
</view>
</view>
3 changes: 2 additions & 1 deletion project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"disableUseStrict": false,
"useCompilerPlugins": [
"less"
]
],
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.19.4",
Expand Down