添加达人申请

This commit is contained in:
ghusermoon 2020-09-03 11:12:58 +08:00
parent 2da546f193
commit cfda1f7aae
5 changed files with 305 additions and 23 deletions

View File

@ -467,6 +467,18 @@ export default {
return vm.$u.post("auth/memberUnbindThird", {
third_type: type,
})
},
getIndustryList() {
return vm.$u.post("Expertapply/industryList")
},
getHobbyList() {
return vm.$u.post("Expertapply/hobbyList")
},
// 达人申请
applyExpert({ name, mobile, address, industry, hobby }) {
return vm.$u.post("Expertapply/expertApply", {
name, mobile, address, industry, hobby
})
}
}

254
pageE/more/ApplyLive.vue Normal file
View File

@ -0,0 +1,254 @@
<template>
<view class="apply-live">
<view class="basic-info">
<view>
<label for="name">姓名:</label>
<input type="text" id="name" v-model="name" placeholder="请输入姓名" />
</view>
<view>
<label for="phone">手机号:</label>
<input type="number" id="phone" v-model="phone" maxlength="11" placeholder="请输入手机号" />
</view>
<view @click="show=true">
<label for="address">居住地址:</label>
<input type="text" id="address" v-model="address" disabled placeholder="请选择居住地址" />
<u-icon name="arrow-down" color="#343434" size="26" class="arrow-icon"></u-icon>
</view>
<view>
<label for="details">详细地址:</label>
<input type="text" id="details" v-model="details" placeholder="请填写详细地址" />
</view>
</view>
<view class="other-info">
<view class="item-box specialty">
<view class="title">特长领域<text class="brief">(多选</text></view>
<view class="check-box-container">
<u-checkbox-group @change="specialtyGroupChange" active-color="#fff">
<u-checkbox
v-model="item.checked"
v-for="(item, index) in industryList" :key="index"
:name="item.name"
>{{item.name}}</u-checkbox>
</u-checkbox-group>
</view>
</view>
<view class="item-box hobby">
<view class="title">兴趣爱好<text class="brief">(多选</text></view>
<view class="check-box-container">
<u-checkbox-group @change="hobbyGroupChange" active-color="#fff">
<u-checkbox
v-model="item.checked"
v-for="(item, index) in hobbyList" :key="index"
:name="item.name"
>{{item.name}}</u-checkbox>
</u-checkbox-group>
</view>
</view>
</view>
<view class="submit-btn" @click="applyExpert">提交申请</view>
<u-select v-model="show"
mode="mutil-column-auto"
:list="areaList"
value-name="area_id"
label-name="area_name"
child-name="_child"
@confirm="setArea">
</u-select>
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
show: false,
areaList: [],
name: '',
phone: '',
address: '',
details: '',
industryList: [],
hobbyList: [],
checkedIndustryList: [],
checkedHobbyList: [],
isSubmit: true, //
}
},
onLoad() {
this.getAreaData();
this.getIndustryList();
this.getHobbyList();
},
methods: {
getAreaData() {
this.$u.api.getArea().then((res)=>{
if (res.errCode == 0) {
this.areaList = res.data;
}
})
},
getIndustryList() {
this.$u.api.getIndustryList().then(res => {
res.data.forEach(element => {
this.industryList.push({
checked: false,
name: element,
});
});
})
},
getHobbyList() {
this.$u.api.getHobbyList().then(res => {
res.data.forEach(element => {
this.hobbyList.push({
checked: false,
name: element,
});
});
})
},
specialtyGroupChange(e) {
// console.log(e);
this.checkedIndustryList = e;
},
hobbyGroupChange(e) {
// console.log(e);
this.checkedHobbyList = e;
},
//
validateData() {
if(this.$u.test.isEmpty(this.name)) {
this.$u.toast('姓名不能为空');
return false;
}
if(this.$u.test.isEmpty(this.phone)) {
this.$u.toast('手机号不能为空');
return false;
}
if(!this.$u.test.mobile(this.phone)) {
this.$u.toast('手机号错误');
return false;
}
if(this.$u.test.isEmpty(this.address)) {
this.$u.toast('地址不能为空');
return false;
}
if(this.$u.test.isEmpty(this.details)) {
this.$u.toast('详细地址不能为空');
return false;
}
if(!this.checkedIndustryList.length) {
this.$u.toast('行业领域不能为空');
return false;
}
if(!this.checkedHobbyList.length) {
this.$u.toast('兴趣爱好不能为空');
return false;
}
return true;
},
applyExpert() {
if(!this.isSubmit) return false;
if(!this.validateData()) return false;
this.isSubmit = false;
this.$u.api.applyExpert({
name: this.name,
mobile: this.phone,
address: this.address + this.details,
industry: this.checkedIndustryList,
hobby: this.checkedHobbyList,
}).then(res => {
if(res.errCode == 0) {
this.$refs.uToast.show({
title: res.message,
back: true,
})
} else {
this.isSubmit = true;
this.$u.toast(res.message);
}
})
},
setArea(area) {
// console.log(area);
this.area_id = area[0].value;
this.city_id = area[1].value;
let temp = '';
area.forEach(e => {
temp += e.label;
});
this.address = temp;
},
}
};
</script>
<style lang="scss" scoped>
.apply-live {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
padding-bottom: 60rpx;
.basic-info {
> view {
background-color: #FFFFFF;
padding: 34rpx 30rpx;
display: flex;
align-items: center;
margin-bottom: 2rpx;
> label {
width: 134rpx;
margin-right: 56rpx;
font-size: 30rpx;
color: #343434;
}
> input {
flex: 1;
font-size: 28rpx;
}
.arrow-icon {
margin-left: 20rpx;
}
}
}
.other-info {
margin-bottom: 80rpx;
.item-box {
background-color: #FFFFFF;
padding: 35rpx 30rpx;
margin-bottom: 1rpx;
.title {
font-size: 30rpx;
color: #343434;
margin-bottom: 30rpx;
.brief {
color: #9A9A9A;
}
}
.check-box-container {
/deep/ .u-checkbox {
margin-bottom: 24rpx;
.u-checkbox__icon-wrap {
border-color: #C0C0C0 !important;
}
.u-checkbox__icon-wrap--checked {
.u-icon__icon {
color: #FF780F !important;
}
}
}
}
}
}
.submit-btn {
width: 690rpx;
height: 98rpx;
background: #FF7810;
border-radius: 49rpx;
font-size: 36rpx;
color: #FFFFFF;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>

View File

@ -622,6 +622,19 @@
}
}
},
{
"path": "more/ApplyLive",
"style": {
"navigationBarTitleText": "达人申请",
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF"
}
}
}
},
{
"path": "mine/ArticleDetails",
"style": {

View File

@ -103,9 +103,12 @@
<view class="badge-box" @click="toOtherPage('/more/Complaints')">
<image src="/static/image/mine/15.png"></image>
<view>投诉意见</view>
<u-badge size="mini" :count="userInfo.feedback_show" :offset="offset" type="error"></u-badge>
<u-badge size="mini" :count="userInfo.feedback_show" :offset="offset" type="error"></u-badge>
</view>
<view @click="toOtherPage('/more/ApplyLive')">
<image src="/static/image/mine/45.png"></image>
<view>达人申请</view>
</view>
<!-- <view></view> -->
</view>
</view>
</view>
@ -118,8 +121,8 @@ export default {
computed: {
...mapState(['hasLogin', 'token'])
},
data() {
return {
data() {
return {
userInfo: {},
orderList: [
{
@ -165,8 +168,8 @@ export default {
number: '',
},
],
offset: [-10,6]
};
offset: [-10,6]
};
},
filters: {
phoneFormat(value) {
@ -180,9 +183,9 @@ export default {
url: "../../pageA/login/login"
})
} else {
this.getOrderNumber();
this.getOrderNumber();
this.getUserInfo();
}
}
},
onNavigationBarButtonTap(e) {
// console.log(e);
@ -300,12 +303,12 @@ export default {
.bottom {
display: flex;
justify-content: space-around;
padding: 0 10rpx;
padding: 0 10rpx;
box-sizing: border-box;
> view {
text-align: center;
font-size: 26rpx;
font-weight: 500;
font-weight: 500;
color: #333;
> view:first-child {
margin-bottom: 10rpx;
@ -330,15 +333,15 @@ export default {
display: flex;
align-items: center;
height: 76rpx;
padding: 0 20rpx;
padding: 0 20rpx;
font-size: 28rpx;
color: #666;
border-bottom: 1px solid #ececec;
border-bottom: 1px solid #ececec;
}
.title-text-more {
font-size: 24rpx;
color: #999;
}
.title-text-more {
font-size: 24rpx;
color: #999;
}
.content {
padding: $content-padding-top $content-padding-row $content-padding-bottom;
display: flex;
@ -379,7 +382,7 @@ export default {
}
}
.content {
align-items: center;
align-items: center;
justify-content: space-between;
> view {
display: flex;
@ -448,11 +451,11 @@ export default {
width: 100rpx;
}
> view:not(:last-child) {
margin-right: 36rpx;
margin-right: 32rpx;
}
}
}
.more-tool {
.more-tool {
@include common-mine(
$content-padding-top: 24rpx,
$content-padding-row: 20rpx,
@ -465,12 +468,12 @@ export default {
width: 100rpx;
}
> view:not(:last-child) {
margin-right: 36rpx;
margin-right: 32rpx;
}
}
.badge-box {
position: relative;
}
.badge-box {
position: relative;
}
}
}
}

BIN
static/image/mine/45.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB