公司小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

410 lines
9.5 KiB

<template>
<view class="main">
<u-navbar
title="合作申请"
:safeAreaInsetTop="true"
:fixed="true"
bgColor="#FFFFFF00"
@leftClick="onTouchBack"
>
</u-navbar>
<image class="top_banner_global" src="../../static/images/kehu/bg_2.png"></image>
<view style="width: 750rpx;height: 1300rpx;position: relative;">
<view class="body">
<view style="width:100%;height:50rpx;position: relative;top: 0;left: 0;right: 0;display: flex;flex-direction: row;align-items: center;justify-content: flex-start;">
<view style="width: 8rpx;height: 22rpx;background: #D49B4B;opacity: 1;border-radius: 1px 5px 5px 1px;margin-left: 20rpx;"/>
<text class="title_text">个人资料</text>
</view>
<view class="u-form-body">
<u-form
labelPosition="left"
ref="form1"
:model="person"
:rules="rules"
:labelStyle="form_tile_title"
customStyle="position: relative;"
>
<u-form-item
prop="person.name"
borderBottom
ref="name"
label="姓名*"
>
<input
:placeholder="rules['person.name'].message"
class="form_input"
:value="person.name"
placeholder-class="form_holder"
@blur="rules['person.name'].validator"
/>
</u-form-item>
<u-form-item
label="电话*"
prop="person.phone"
borderBottom
ref="phone"
>
<input
:placeholder="rules['person.phone'].message"
class="form_input"
placeholder-class="form_holder"
:value="person.phone"
@blur="rules['person.phone'].validator"
/>
</u-form-item>
<u-form-item
label="所在地址"
prop="person.address"
borderBottom
ref="city"
@click="onClickToSelectCity"
>
<pick-regions :defaultRegion="defaultRegion" @getRegion="handleGetRegion">
<input
:placeholder="rules['person.address'].message"
class="form_input"
:disabled="true"
:value="person.address"
placeholder-class="form_holder"
/>
</pick-regions>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item>
<u-form-item
label="推荐人电话"
prop="person.referrer"
borderBottom
ref="referrer"
>
<input
:placeholder="rules['person.referrer'].message"
class="form_input"
placeholder-class="form_holder"
:value="person.referrer"
@blur="rules['person.referrer'].validator"
/>
</u-form-item>
</u-form>
<view class="checkboxgroup">
<checkbox :checked="isAgree" value="1" @click="onChechBoxChange"/>
<text class="label" @click="onClickAreement">
我已阅读并同意 [协议条款]
</text>
</view>
<view style="width: 702rpx;height: 120rpx;position: relative;top: 24rpx;">
<text class="attentionText">注意事项</text>
<text class="attentionInfo">
v-bind:style 的对象语法十分直观看着非常像 CSS但其实是一个 JavaScript 对象CSS property 名可以用驼峰式 (camelCase) 或短横线分隔 (kebab-case记得用引号括起来) 来命名
</text>
</view>
</view>
</view>
<button class="button" @click="onTouchConfirm">提交</button>
<u-toast ref='uToast'/>
<u-popup
:show="isShowUpload"
:closeOnClickOverlay="false"
mode="center"
bgColor="transparent"
>
<UploadSuccess @confirm="onTouchBack" />
</u-popup>
</view>
</view>
</template>
<script>
import {post} from '@/common/api.js'
import UploadSuccess from "@/components/UploadSuccess/UploadSuccess.vue";
var Player = getApp().globalData.Player;
var pageData = {};
export default {
components:{
UploadSuccess,
},
onLoad() {
var agreementData = getApp().globalData.agreementData;
if(agreementData.textmsg == ''){
this.$utils.getAgreementData();
}
post('pages/getbecpartner',{}).then(
);
},
data() {
return {
pageData,
///是否同意协议条款
isAgree : false,
///是否显示提交成功的界面
isShowUpload : false,
person : {
///名字
name : '',
///电话号码
phone : Player.phone,
///所在地址
address : '',
///推荐人电话
referrer : '',
},
rules : {
"person.name" : {
type: 'string',
required: true,
message : '请输入您的姓名',
validator : (object)=>{
this.person.name = object.detail.value;
}
},
'person.phone' : {
type: 'string',
required: true,
message : '请输入您的联系电话',
///校验用户是否输入了正确的手机号码
validator : (object)=>{
var suc = uni.$u.test.mobile(object.detail.value);
if(!suc){
uni.$u.toast("请输入正确的电话号码!");
}else{
this.person.phone = object.detail.value;
}
return suc;
}
},
'person.address' : {
type : 'string',
required : false,
message: '请选择您的地址',
},
'person.referrer' : {
type : 'string',
required : false,
message : '请输入推荐人电话号码',
///校验用户是否输入了正确的手机号码
validator : (object)=>{
var suc = uni.$u.test.mobile(object.detail.value);
if(!suc){
uni.$u.toast("请输入正确的电话号码!");
}else{
this.person.referrer = object.detail.value;
}
return suc;
},
},
},
form_tile_title : {
width: '170rpx',
height: '37rpx',
fontSize: 26,
fontWeight: 500,
color: 'black',
},
defaultRegion:['四川省','成都市','武侯区'],
region:[],
};
},
methods:{
onTouchBack(){
uni.navigateBack({
});
},
///点击并选择城市
onClickToSelectCity(){
uni.hideKeyboard();
},
// 获取选择的地区
handleGetRegion(region){
this.region = region;
this.person.address = this.regionName();
this.$refs.form1.validateField('person.address');
},
regionName(){
return this.region.map(item=>item.name).join(' ');
},
onChechBoxChange(value){
console.log(value);
this.isAgree = !this.isAgree;
getApp().globalData.agreementData.isAgreed = this.isAgree;
},
/**
* 点击了协议字体,要去看看协议内容
*/
onClickAreement(){
uni.navigateTo({
url:'/pages/Agreement/Agreement',
})
},
showToast(content){
this.$refs.uToast.show(
{
message : content,
type : 'default',
}
);
},
/**
* 点击了提交按钮
*/
async onTouchConfirm(){
if(!this.isAgree){
this.showToast('请阅读并同意协议条款');
return;
}
var name = this.person.name;
if(name == ''){
this.showToast('请输入您的名字');
return;
}
var phone = this.person.phone;
if(phone == ''){
this.showToast('请输入您的电话号码');
return;
}
var data = {
name : name,
phone : phone,
status : 0,
provincecode : 0,
citycode : 0,
areacode : 0,
province : '',
city : '',
area : '',
recommender : this.person.referrer,
};
if(this.region.length > 0){
//如果当前有地址
var p = this.region[0].name ?? '';
var c = this.region[1].name ?? '';
var a = this.region[2].name ?? '';
data['province'] = p;
data['city'] = c;
data['area'] = a;
}
console.log(data);
uni.showLoading();
var res = await post("pages/becpartner",data);
uni.hideLoading();
var out = getApp().globalData.Define.onNetMessage(res);
if(!out){
return;
}
console.log("申请结果:",out);
getApp().globalData.mainPageData.partnerstatus = 1;
this.isShowUpload = true;
}
}
}
</script>
<style lang="scss" scoped>
.body{
width: 702rpx;
height: 900rpx;
position: relative;
left: 24rpx;
right: 24rpx;
top: 295rpx;
background: #FFFFFF;
opacity: 1;
border-radius: 20rpx;
}
.title_text{
width: 192rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
opacity: 1;
margin-left: 10rpx;
}
.u-form-body{
position: relative;
width: 662rpx;
left: 20rpx;
right: 20rpx;
height: 840rpx;
//background-color: #1CBBB4;
border-radius: 20rpx;
}
.form_input{
//background-color: #0081FF;
width: 100%;
height: 90rpx;
text-align: right;
font-size: 28rpx;
font-weight: 400;
color: #333333;
}
.form_holder{
width: 100%;
height: 90rpx;
text-align: right;
font-size: 24rpx;
font-weight: 400;
color: #999999;
margin-right: 10rpx;
}
.form_label_style{
height: 37rpx;
font-size: 26rpx;
font-weight: 400;
color: #666666;
opacity: 1;
}r
///注意事项
.attentionText{
width: 104rpx;
height: 37rpx;
font-size: 26rpx;
font-weight: 400;
color: #666666;
opacity: 1;
}
.attentionInfo{
width: 648rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
opacity: 1;
max-height: 120rpx;
}
.label{
text-decoration: underline;
color: #39B54A;
font-size: 26rpx;
font-weight: 400;
}
.checkboxgroup{
width: 662rpx;
height: 100rpx;
//background-color: #9000FF;
position: relative;
top: 10rpx;
display: flex;
align-items: center;
flex-direction: row;
justify-content: flex-start
}
.button{
width: 702rpx;
height: 90rpx;
background: #D49B4B;
opacity: 1;
border-radius: 93rpx;
position: absolute;
left: 24rpx;
bottom: -10rpx;
font-size: 36rpx;
font-weight: 400;
color: #FFFFFF;
}
</style>