Initial commit
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
|
||||
// pages/developer/join/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
languageLabels: [],
|
||||
frontLabels: [],
|
||||
backendLabels: [],
|
||||
languageSelected: [],
|
||||
frontSelected: [],
|
||||
backendSelected: [],
|
||||
desc: '',
|
||||
job: '',
|
||||
workYears: 0,
|
||||
contact: '',
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取基础配置
|
||||
*/
|
||||
getConfig() {
|
||||
wx.$util.request(wx.$api.CommonGetMiniConfig, {}, 'GET').then(res => {
|
||||
if (res.code === 1) {
|
||||
this.setData({
|
||||
languageLabels: res.data.languageLabels,
|
||||
frontLabels: res.data.frontLabels,
|
||||
backendLabels: res.data.backendLabels,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleGroupChange(event) {
|
||||
console.log('group', event.detail.value);
|
||||
const { field } = event.currentTarget.dataset; // 获取 data-field 的值
|
||||
console.log(field);
|
||||
this.setData({
|
||||
[field + 'Selected']: event.detail.value, // 动态设置对应的Selected数组
|
||||
});
|
||||
},
|
||||
|
||||
onInputChange(e) {
|
||||
console.log(e)
|
||||
const value = e.detail.value;
|
||||
const { field } = e.currentTarget.dataset; // 获取 data-field 的值
|
||||
console.log(value)
|
||||
console.log(field)
|
||||
this.setData({
|
||||
[field]: value // 使用动态属性名设置值
|
||||
});
|
||||
},
|
||||
onSubmit() {
|
||||
const { backendSelected, frontSelected, languageSelected, contact, job, workYears, desc } = this.data;
|
||||
|
||||
const validations = [
|
||||
{
|
||||
condition: !backendSelected.length && !frontSelected.length && !languageSelected.length,
|
||||
message: '技能不能为空'
|
||||
},
|
||||
{
|
||||
condition: !job.trim(),
|
||||
message: '职称不能为空'
|
||||
},
|
||||
{
|
||||
condition: workYears == 0,
|
||||
message: '年限不能为空'
|
||||
},
|
||||
{
|
||||
condition: !contact.trim(),
|
||||
message: '请填写联系方式'
|
||||
},
|
||||
{
|
||||
condition: !desc.trim(),
|
||||
message: '简介不能为空'
|
||||
}
|
||||
];
|
||||
|
||||
for (const validation of validations) {
|
||||
if (validation.condition) {
|
||||
wx.showToast({
|
||||
title: validation.message,
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['ctqgNLWaHJ7RRnu9LwWTxu_g21lKil5v5Gv-Pg7XOE8'],
|
||||
complete: (re) => {
|
||||
wx.$util.request(wx.$api.DeveloperSubmit, {
|
||||
backendSelected: backendSelected,
|
||||
frontSelected: frontSelected,
|
||||
languageSelected: languageSelected,
|
||||
job: job,
|
||||
contact: contact,
|
||||
work_years: workYears,
|
||||
desc: desc,
|
||||
}, 'POST').then(res => {
|
||||
if (res.code === 1) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
showCancel: false,
|
||||
content: res.msg || '提交成功',
|
||||
success: (res2) => {
|
||||
if (res2.confirm) {
|
||||
wx.navigateBack({ delta: 1 });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.msg || '提交失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getConfig();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"navigationBarTitleText": "人才入驻",
|
||||
"usingComponents": {
|
||||
"t-tag": "tdesign-miniprogram/tag/tag",
|
||||
"t-check-tag": "tdesign-miniprogram/check-tag/check-tag",
|
||||
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
|
||||
"t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
|
||||
"t-textarea": "tdesign-miniprogram/textarea/textarea",
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-divider": "tdesign-miniprogram/divider/divider",
|
||||
"t-collapse": "tdesign-miniprogram/collapse/collapse",
|
||||
"t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<!--pages/developer/join/index.wxml-->
|
||||
<view class="result-container">
|
||||
<view class="skill-label">1.请选择你掌握的技术栈</view>
|
||||
<t-collapse theme="card" defaultValue="{{[0]}}" expandIcon>
|
||||
<t-collapse-panel header="编程语言" value="{{0}}">
|
||||
<t-checkbox-group t-class="box" borderless data-field="language" bind:change="handleGroupChange" defaultValue="{{frontCurrent}}">
|
||||
<block wx:for="{{languageLabels}}" wx:key="index">
|
||||
<t-checkbox t-class="t-class-text" icon="rectangle" block="{{false}}" value="{{item}}" label="{{item}}" />
|
||||
</block>
|
||||
</t-checkbox-group>
|
||||
</t-collapse-panel>
|
||||
<t-collapse-panel header="前端技术" value="{{1}}">
|
||||
<t-checkbox-group t-class="box" borderless data-field="front" bind:change="handleGroupChange" defaultValue="{{frontCurrent}}">
|
||||
<block wx:for="{{frontLabels}}" wx:key="index">
|
||||
<t-checkbox t-class="t-class-text" icon="rectangle" block="{{false}}" value="{{item}}" label="{{item}}" />
|
||||
</block>
|
||||
</t-checkbox-group>
|
||||
</t-collapse-panel>
|
||||
<t-collapse-panel header="后端技术" value="{{2}}">
|
||||
<t-checkbox-group t-class="box" borderless data-field="backend" bind:change="handleGroupChange" defaultValue="{{backendCurrent}}">
|
||||
<block wx:for="{{backendLabels}}" wx:key="index">
|
||||
<t-checkbox t-class="t-class-text" icon="rectangle" block="{{false}}" value="{{item}}" label="{{item}}" />
|
||||
</block>
|
||||
</t-checkbox-group>
|
||||
</t-collapse-panel>
|
||||
</t-collapse>
|
||||
|
||||
<t-divider />
|
||||
<t-input label="2.职称" placeholder="请输入职称,如:xxx开发工程师" data-field="job" bindchange="onInputChange" />
|
||||
<t-input label="3.经验年限" placeholder="请输入年限" type="number" suffix="年" align="right" data-field="workYears" bindchange="onInputChange" />
|
||||
<t-input label="4.联系方式" placeholder="请输入微信或电话" data-field="contact" bindchange="onInputChange" />
|
||||
<t-textarea t-class="external-class" label="5.简介" placeholder="请输入简单介绍自己掌握的技能经验及优势..." disableDefaultPadding="{{true}}" data-field="desc" bindchange="onInputChange" />
|
||||
</view>
|
||||
<t-toast id="t-toast" />
|
||||
<view class="wx-pay-cover">
|
||||
<view class="wx-pay">
|
||||
<view class="submit-btn {{ job ? '':'btn-gray'}}" bindtap="onSubmit">
|
||||
确认提交
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,179 @@
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
page view {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.result-container {
|
||||
display: block;
|
||||
padding: 0 0rpx;
|
||||
}
|
||||
|
||||
.skill-wrapper {
|
||||
padding: 35rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.result-container .t-search {
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.result-container .t-class__input-container {
|
||||
height: 64rpx !important;
|
||||
border-radius: 32rpx !important;
|
||||
}
|
||||
|
||||
.result-container .t-search__left-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.result-container .t-search__input {
|
||||
font-size: 28rpx !important;
|
||||
color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
.result-container .category-goods-list {
|
||||
background-color: var(--bg-page);
|
||||
overflow-y: scroll;
|
||||
padding: 20rpx 24rpx;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.result-container .wr-goods-list {
|
||||
background: var(--bg-page) !important;
|
||||
}
|
||||
|
||||
.result-container .t-image__mask {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
.result-container .empty-wrap {
|
||||
margin-top: 184rpx;
|
||||
margin-bottom: 120rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.result-container .empty-wrap .empty-tips .empty-content .content-text {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.result-container .price-container {
|
||||
padding: 32rpx;
|
||||
height: 100vh;
|
||||
max-width: 632rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
|
||||
.result-container .price-between {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
}
|
||||
|
||||
.result-container .price-ipts-wrap {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.result-container .price-ipts-wrap .price-divided {
|
||||
position: relative;
|
||||
width: 22rpx;
|
||||
margin: 0 20rpx;
|
||||
color: #222427;
|
||||
}
|
||||
|
||||
.result-container .price-ipts-wrap .price-ipt {
|
||||
box-sizing: border-box;
|
||||
width: 246rpx;
|
||||
font-size: 24rpx;
|
||||
height: 56rpx;
|
||||
padding: 0 24rpx;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
color: var(--text-primary);
|
||||
background: rgba(245, 245, 245, 1);
|
||||
}
|
||||
|
||||
.t-class-input {
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
|
||||
.t-search__clear {
|
||||
font-size: 40rpx !important;
|
||||
}
|
||||
|
||||
.result-container .price-ipts-wrap .price-ipt::after {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.result-container .t-input__control {
|
||||
font-size: 24rpx !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wx-pay-cover {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
background: #fff;
|
||||
height: 112rpx;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.wx-pay-cover .wx-pay {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 0rpx 32rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wx-pay-cover .wx-pay .price {
|
||||
color: var(--brand);
|
||||
font-weight: bold;
|
||||
font-size: 63rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
|
||||
.wx-pay-cover .wx-pay .submit-btn {
|
||||
height: 80rpx;
|
||||
width: 50%;
|
||||
border-radius: 40rpx;
|
||||
background-color: var(--brand);
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wx-pay-cover .wx-pay .btn-gray {
|
||||
background: #cccccc;
|
||||
}
|
||||
|
||||
.skill-label {
|
||||
font-size: var(--td-font-size-m, 32rpx);
|
||||
line-height: 48rpx;
|
||||
padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.t-class-text {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.t-checkbox__icon--left {
|
||||
margin-right: 3rpx !important;
|
||||
}
|
||||
Reference in New Issue
Block a user