hookehuyr

✨ feat: 新增活动报名页面

......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-27 15:57:59
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-27 09:41:31
* @LastEditTime: 2022-09-27 17:13:29
* @FilePath: /swx/src/app.config.js
* @Description:
*/
......@@ -25,6 +25,7 @@ export default {
'pages/createActivity/index',
'pages/activityDetail/index',
'pages/post/index',
'pages/joinActivity/index',
],
subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去
{
......
/*
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-27 17:23:30
* @FilePath: /swx/src/pages/joinActivity/index.config.js
* @Description: 文件描述
*/
export default {
navigationBarTitleText: '活动报名',
usingComponents: {
},
}
.bg-gradient {
background: linear-gradient(#B3DDC9, #B3DDC9) no-repeat;
/*调整下划线的宽度占百分之百 高度是3px */
background-size: 100% 1vw;
/* 调整下划线的起始位置 左侧是0 上边是1.15em */
background-position: 0 1.25rem;
}
.join-activity-page {
background-color: #FFFFFF;
.activity-title {
background-color: #FFFFFF;
.box {
padding: 1rem 1rem 0.5rem 1rem;
text-align: center;
}
}
}
.form-item {
padding: 0.5rem 1rem;
background-color: #FFFFFF;
.form-item-title {
font-size: 1rem;
&.border {
padding-bottom: 0.5rem;
border-bottom: 1px solid #F2F2F2;
}
&.required::before {
color: red;
content: "*";
font-size: 0.9rem;
left: 0.5rem;
position: absolute;
}
.sub {
color: #999;
}
}
}
.limit-wrapper {
.border {
overflow: auto;
border-bottom: 1px solid #F2F2F2;
.fix {
float: left;
padding-top: 0.6rem;
}
}
}
.limit-button-wrapper {
padding: 1rem 0;
margin: 1rem;
text-align: center;
.button {
padding: 0.5rem 1rem; border-radius: 1rem;
}
.cancel {
color: #199A74;
border: 1px solid #199A74;
}
.confirm {
color: #FFFFFF;
background-color: #199A74;
}
}
<!--
* @Date: 2022-09-27 17:13:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-28 11:09:48
* @FilePath: /swx/src/pages/joinActivity/index.vue
* @Description: 活动报名
-->
<template>
<view class="join-activity-page">
<view class="activity-title">
<view class="box">
<text class="bg-gradient" style="font-size: 1.25rem;">请填写报名信息</text>
</view>
</view>
<AtInput required :border="true" title="姓名" type='text' placeholder='请输入姓名' v-model:value="username" />
<AtInput required :border="true" title="手机号" type='phone' placeholder='请输入手机号' v-model:value="phone" />
<view class="at-input">
<view class="at-input__container">
<label class="h5-label at-input__title at-input__title--required">年龄段</label>
<input @tap="show_popup=true" class="h5-input at-input__input" placeholder-class="placeholder" :value="age_range" placeholder="请选择年龄范围" :disabled="true"/>
<view style="margin-right: 1rem; margin-top: 0.5rem;"><van-icon :name="icon_sel" color="" /></view>
</view>
</view>
<view class="at-input">
<view class="at-input__container">
<label class="h5-label at-input__title at-input__title--required">性别</label>
<van-radio-group
:value="user_sex"
@change="onSexChange"
direction="horizontal"
>
<van-radio name="female" checked-color="#199A74">男士</van-radio>
<van-radio name="male" checked-color="#199A74">女士</van-radio>
</van-radio-group>
</view>
</view>
<view v-for="(item, index) in arr" :key="index">
<AtInput
:required="item.required"
:border="true"
:title="item.title"
type='text'
:placeholder="'请输入' + item.title"
v-model:value="item.value" />
</view>
</view>
<bottom-button @on-submit="onSubmit">确认报名</bottom-button>
<!-- 年龄段弹出框 -->
<van-popup :show="show_popup" position="bottom" custom-style="height: 30%;" :lock-scroll="true">
<view class="limit-wrapper">
<view class="form-item border">
<view class="form-item-title fix">年龄最小值</view>
<view style="float: right;">
<van-field :value="min_number" type="number" label="" placeholder="请输入年龄最小值"
placeholder-style="color: #999; font-size: 1rem;" input-align="right" customStyle="" rightIcon=""
maxlength="" :border="false" />
</view>
</view>
<view class="form-item border">
<view class="form-item-title fix">年龄最大值</view>
<view style="float: right;">
<van-field :value="max_number" type="number" label="" placeholder="请输入年龄最大值"
placeholder-style="color: #999; font-size: 1rem;" input-align="right" customStyle="" rightIcon=""
maxlength="" :border="false" />
</view>
</view>
</view>
<van-row>
<van-col span="12">
<view class="limit-button-wrapper">
<view class="button cancel" @tap="closeEditLimit">取消</view>
</view>
</van-col>
<van-col span="12">
<view class="limit-button-wrapper">
<view class="button confirm" @tap="confirmEditLimit">确定</view>
</view>
</van-col>
</van-row>
</van-popup>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { AtInput } from 'taro-ui-vue3'
import "taro-ui-vue3/dist/style/components/input.scss";
import icon_sel from '@/images/icon/sel@2x.png'
import bottomButton from "@/components/bottom-button";
const username = ref('');
const phone = ref('');
const age_range = ref('');
const user_sex = ref('');
const arr = ref([]);
onMounted(() => {
arr.value = [{
title: '推荐人' ,
key: 'recommender',
value: '',
required: false,
}]
})
// const handleInput = (value) => {
// console.warn(arr.value);
// }
const onSexChange = ({ detail }) => {
user_sex.value = detail;
}
const show_popup = ref(false);
const closeEditLimit = () => {
show_popup.value = false;
}
const confirmEditLimit = () => {
show_popup.value = false;
}
const onSubmit = (val) => {
console.warn(val);
}
</script>
<script>
import "./index.less";
export default {
name: "demoPage",
};
</script>
/*
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-22 14:02:05
* @LastEditTime: 2022-09-28 09:56:33
* @FilePath: /swx/vantComponentConf.js
* @Description: 文件描述
*/
......@@ -33,6 +33,8 @@ const vantComponentNames = [
"transition",
"uploader",
"switch",
"radio",
"radio-group",
];
module.exports = vantComponentNames;
......