Commit 7f1750ce by ArronYR

modify enroll

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