Commit 7f1750ce by ArronYR

modify enroll

parent af1ec565
......@@ -14,7 +14,7 @@
"pages/guide/index",
"pages/detail/index",
"pages/detail/enroll/index",
"pages/detail/appointment/index",
"pages/detail/appoint/index",
"components/navs/index",
"pages/search/search/search",
"pages/search/list/list"
......
......@@ -35,7 +35,15 @@ page {
}
.margin-top-10 {
motion-path: 20px;
margin-top: 10px;
}
.margin-top-20 {
margin-top: 20px;
}
.margin-left-10 {
margin-left: 10px;
}
.margin-left-20 {
......
.i-cell{position:relative;padding:12px 15px;display:flex;background:#fff;align-items:center;line-height:1.4;font-size:14px;overflow:hidden}.i-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e9eaec;border-bottom-width:1px;left:15px;right:0}.i-cell-last::after{display:none}.i-cell-icon{margin-right:5px}.i-cell-icon:empty{display:none}.i-cell-bd{flex:1}.i-cell-text{line-height:24px;font-size:14px}.i-cell-desc{line-height:1.2;font-size:12px;color:#80848f}.i-cell-ft{position:relative;text-align:right;color:#495060}.i-cell-access .i-cell-ft{padding-right:13px}.i-cell-access .i-cell-ft::after{content:" ";display:inline-block;width:6px;height:6px;position:absolute;top:50%;right:2px;border-width:2px 2px 0 0;border-color:#dddee1;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}
\ No newline at end of file
.i-cell {
position: relative;
padding: 12px 15px;
display: flex;
background: #fff;
align-items: center;
line-height: 1.4;
font-size: 14px;
overflow: hidden;
white-space: nowrap;
}
.i-cell::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 200%;
height: 200%;
transform: scale(0.5);
transform-origin: 0 0;
pointer-events: none;
box-sizing: border-box;
border: 0 solid #e9eaec;
border-bottom-width: 1px;
left: 15px;
right: 0;
}
.i-cell-last::after {
display: none;
}
.i-cell-icon {
margin-right: 5px;
}
.i-cell-icon:empty {
display: none;
}
.i-cell-bd {
flex: 1;
}
.i-cell-text {
line-height: 24px;
font-size: 14px;
}
.i-cell-desc {
line-height: 1.2;
font-size: 12px;
color: #80848f;
}
.i-cell-ft {
position: relative;
text-align: right;
color: #495060;
}
.i-cell-access .i-cell-ft {
padding-right: 13px;
}
.i-cell-access .i-cell-ft::after {
content: " ";
display: inline-block;
width: 6px;
height: 6px;
position: absolute;
top: 50%;
right: 2px;
border-width: 2px 2px 0 0;
border-color: #dddee1;
border-style: solid;
transform: translateY(-50%) matrix(0.71, 0.71, -.71, 0.71, 0, 0);
}
......@@ -18,7 +18,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
......@@ -79,7 +79,7 @@ Page({
},
/**
* 解密用户数据
* 解密手机号数据
*/
decodePhoneData: function(code, encryptedData, iv) {
let that = this
......
// pages/me/collection/index.js
import api from '../../../utils/Api.js'
import Schedule from '../../../utils/Schedule.js'
import Wx from '../../../utils/Wx.js'
const {
$Toast
} = require('../../../iview/base/index');
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
detail: {},
user: {},
loading: false,
familyNum: 0,
phone: '',
nickname: '',
adultNum: 0,
childrenNum: 0,
childrenAge: 0,
remark: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
if (options.id) {
this.setData({
id: options.id
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
let that = this
wx.showNavigationBarLoading()
wx.showLoading({
title: '加载中...',
})
new Schedule().task(this.getDetailData).delay(1200).task(() => {
wx.hideNavigationBarLoading()
wx.hideLoading()
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
user: app.globalData.userInfo
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
getDetailData: function() {
api.project.detail({
id: this.data.id
}).then(res => {
if (!res.code) {
this.setData({
detail: res.data
})
}
})
},
handlePhoneAuth: function(event) {
Wx.login().then(res => {
let encryptedData = event.detail.encryptedData
let iv = event.detail.iv
this.decodePhoneData(res.code, encryptedData, iv)
})
},
/**
* 生命周期函数--监听页面卸载
* 解密手机号数据
*/
onUnload: function() {
decodePhoneData: function(code, encryptedData, iv) {
let that = this
api.getPhoneNumber({
code: code,
encryptedData: encryptedData,
iv: iv
}).then(res => {
if (!res.code) {
$Toast({
content: '手机号授权成功',
type: 'success'
});
this.setData({
phone: res.data.phone
})
} else {
$Toast({
content: '手机号授权失败',
type: 'error'
});
}
})
},
handleFamilyNum: function(event) {
this.setData({
familyNum: event.detail.value
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
handleNickname: function(event) {
this.setData({
nickname: event.detail.value
})
},
handleAdultNum: function(event) {
this.setData({
adultNum: event.detail.value
})
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
handleChildrenNum: function(event) {
this.setData({
childrenNum: event.detail.value
})
},
handleChildrenAge: function(event) {
this.setData({
childrenAge: event.detail.value
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
handleRemark: function(event) {
this.setData({
remark: event.detail.value
})
},
handleSubmit: function() {
if (!this.data.familyNum || !this.data.nickname || !this.data.phone) {
$Toast({
content: '请完善必要信息',
type: 'error'
});
return
}
if (this.data.phone.length == 0) {
$Toast({
content: '请授权手机号',
type: 'error'
});
return
}
api.project.order({
pid: this.data.id,
sign_limits: this.data.familyNum,
nickname: this.data.nickname,
phone: this.data.phone,
adult_number: this.data.adultNum,
children_number: this.data.childrenNum,
children_age: this.data.childrenAge,
remark: this.data.remark
}).then(res => {
console.log(res)
})
}
})
\ No newline at end of file
......@@ -4,6 +4,9 @@
"i-input-number": "/iview/input-number/index",
"i-row": "/iview/row/index",
"i-col": "/iview/col/index",
"i-button": "/iview/button/index"
"i-button": "/iview/button/index",
"i-cell-group": "/iview/cell-group/index",
"i-cell": "/iview/cell/index",
"i-toast": "/iview/toast/index"
}
}
\ No newline at end of file
......@@ -7,19 +7,17 @@
<!-- 报名详情 -->
<view class='project_info-box'>
<view class='project_info'>
<image class='project_info_image' src='/images/personal_center/info_background.png'></image>
<view class='info-box'>
<text>亲子体验游泳</text>
<text>{{detail.title}}</text>
<view>
<text class='text-price'>¥980.00</text>
<text class='text-vip-price'>¥968.00</text>
<text class='text-price'>¥{{detail.price}}</text>
<text class='text-vip-price'>¥{{detail.vip_price}}</text>
<image class='vip-img' src='/images/icon_vip_price.png'></image>
</view>
</view>
</view>
</view>
<view class='project-title'>
......@@ -28,85 +26,49 @@
<!-- 报名信息 -->
<view class='project-input margin-bottom'>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>家庭组数</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='number' value='1'></input>
</i-col>
<i-col span="1" offset='1' i-class="col-class">
<view class='input-image-box'>
<image src='/images/icon_right.png'></image>
</view>
</i-col>
</i-row>
<i-cell-group>
<i-cell title="家庭组数" is-link i-class="cell-class">
<input slot="footer" class='input' type='number' placeholder='请输入家庭组数' bindinput='handleFamilyNum'></input>
</i-cell>
</i-cell-group>
</view>
<view class='project-input'>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>姓名</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='text' value='张三' placeholder='请输入您的姓名'></input>
</i-col>
</i-row>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>手机号</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='number' value='18685850590'></input>
</i-col>
</i-row>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>成人人数</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='number' value='1'></input>
</i-col>
<i-col span="1" offset='1' i-class="col-class">
<view class='input-image-box'>
<image src='/images/icon_right.png'></image>
</view>
</i-col>
</i-row>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>孩子人数</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='number' value='1'></input>
</i-col>
<i-col span="1" offset='1' i-class="col-class">
<view class='input-image-box'>
<image src='/images/icon_right.png'></image>
</view>
</i-col>
</i-row>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>孩子年龄</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='text' value='' placeholder='如5岁、八岁'></input>
</i-col>
</i-row>
<i-row i-class='border-bottom'>
<i-col span="6" i-class="col-class">
<text class='input-label'>备注</text>
</i-col>
<i-col span="15" i-class="col-class">
<input class='input' type='text' value='' placeholder='备注(可选)'></input>
</i-col>
</i-row>
<i-cell-group>
<i-cell title="姓名" is-link i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='请输入您的姓名' bindinput='handleNickname'></input>
</i-cell>
<i-cell title="手机号" i-class="cell-class">
<block wx:if="{{phone.length == 0}}">
<button slot="footer" bindgetphonenumber="handlePhoneAuth" type="info" open-type="getPhoneNumber" class="btn-auth-phone">授权手机号</button>
</block>
<block wx:else>
<text slot="footer">{{phone}}</text>
</block>
</i-cell>
<i-cell title="成人人数" is-link i-class="cell-class">
<input slot="footer" class='input' type='number' placeholder='请输入成人人数' bindinput='handleAdultNum'></input>
</i-cell>
<i-cell title="孩子人数" is-link i-class="cell-class">
<input slot="footer" class='input' type='number' placeholder='请输入孩子人数' bindinput='handleChildrenNum'></input>
</i-cell>
<i-cell title="孩子年龄" is-link i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='如5岁、八岁' bindinput='handleChildrenAge'></input>
</i-cell>
<i-cell title="备注" is-link i-class="cell-class">
<input slot="footer" class='input' type='text' placeholder='备注(可选)' bindinput='handleRemark'></input>
</i-cell>
</i-cell-group>
</view>
<i-row>
<i-row i-class="margin-top-20">
<i-col span="20" offset='2' i-class="col-class">
<i-button bind:click="handleClick" type="primary" shape="circle">支付</i-button>
<i-button bind:click="handleSubmit" type="info" shape="circle" loading="{{loading}}">
立即支付
<text class='margin-left-10'>¥ {{user.is_vip != 0 ? detail.vip_price : detail.price}}</text>
</i-button>
</i-col>
</i-row>
</view>
\ No newline at end of file
</view>
<i-toast id="toast" />
\ No newline at end of file
......@@ -4,6 +4,10 @@ page {
background-color: #f7f7f7;
}
.page-wrapper {
margin-bottom: 20px;
}
/* 报名详情 */
.project-title {
......@@ -12,7 +16,7 @@ page {
}
.project-title > text {
margin-left: 30px;
margin-left: 15px;
font-size: 26rpx;
color: #9c9c9c;
}
......@@ -69,32 +73,34 @@ page {
background-color: #fff;
}
.input-label {
height: 90rpx;
line-height: 90rpx;
color: #7c7c7c;
font-size: 25rpx;
.cell-class {
position: relative;
}
.input {
height: 90rpx;
line-height: 90rpx;
text-align: right;
float: right;
color: #b2b2b2;
font-size: 25rpx;
.cell-class .title {
white-space: nowrap;
width: 200px;
}
.input-image-box {
height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
.btn-auth-phone {
display: inline-block;
border: 1px solid #eee;
background-color: transparent;
font-size: 14px;
line-height: 22px;
color: #767676;
}
.input-image-box>image {
width: 11rpx;
height: 18rpx;
.btn-auth-phone::after {
display: none;
}
.input {
text-align: right;
}
.input::-webkit-input-placeholder {
color: rgb(153, 153, 153);
}
.margin-bottom {
......
// pages/detail/index.js
import api from '../../utils/Api.js'
import Schedule from '../../utils/Schedule.js'
import Wx from '../../utils/Wx.js'
const {
$Toast
} = require('../../iview/base/index');
......@@ -162,17 +163,34 @@ Page({
})
},
handleHome: function() {
handleVip: function() {
wx.navigateTo({
url: '/pages/me/vip/index',
})
},
handleHome: function() {
wx.reLaunch({
url: '/pages/index/index',
})
},
handleCollect: function() {
api.project.collect({
pid: this.data.id
}).then(res => {
$Toast({
content: res.msg,
type: !res.code ? 'success' : 'error'
});
})
},
handleShare: function() {
wx.showShareMenu({
Wx.showShareMenu({
withShareTicket: true,
}).then(res => {
console.log(res)
})
}
})
\ No newline at end of file
......@@ -32,7 +32,7 @@
<text class='margin-left-20'>会员价: ¥ {{detail.vip_price}}</text>
</view>
<view slot="footer">
<button class='btn-pay-vip'>购买会员卡</button>
<button class='btn-pay-vip' catchtap='handleVip'>购买会员卡</button>
</view>
</i-cell>
</i-cell-group>
......@@ -65,10 +65,10 @@
<image src='/images/icon_star.png' class='icon'></image>
<text class='title'>收藏</text>
</view>
<view class='op-wrapper' catchtap='handleShare'>
<button open-type='share' class='form-button op-wrapper' catchtap='handleShare'>
<image src='/images/icon_share.png' class='icon'></image>
<text class='title'>分享</text>
</view>
</button>
</view>
<view class='actions-section btn-wrapper'>立即报名</view>
</view>
......
/* pages/detail/index.wxss */
@import "/wxParse/wxParse.wxss";
@import '/styles/form.wxss';
.v-page {
position: relative;
padding-bottom: 60px;
......
......@@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 14,
"current": 15,
"list": [
{
"id": 0,
......@@ -126,7 +126,14 @@
{
"id": -1,
"name": "预约下次",
"pathName": "pages/detail/appointment/index"
"pathName": "pages/detail/appointment/index",
"query": ""
},
{
"id": -1,
"name": "立即报名",
"pathName": "pages/detail/enroll/index",
"query": "id=1"
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment