<template>
|
<view class="apply-team">
|
<!--申请成功-->
|
<template v-if="!is_applying && is_pass">
|
<view class="form-wrap p30 f30">
|
<view class="pb30 d-c-c gray3 f40 fb">
|
供应方入驻申请
|
</view>
|
<form @submit="formCheck" @reset="formReset">
|
<view class="form-item border-b">
|
<view class="field-name">姓名:</view>
|
<input class="flex-1 ml10" name="name" type="text" value="" placeholder-class="grary" placeholder="请输入姓名" />
|
</view>
|
<view class="form-item border-b">
|
<view class="field-name">手机号:</view>
|
<input class="flex-1 ml10" name="mobile" type="number" value="" placeholder-class="grary" placeholder="请输入手机" />
|
</view>
|
<!-- <view class="form-item border-b">
|
<text class="field-name">地址:</text>
|
<input class="flex-1 ml10" name="location_address" type="text" placeholder-class="grary9" placeholder="请选择地址" v-model="short_address"
|
disabled @click="chooseLocation" />
|
</view> -->
|
<view class="d-c-c mt30">
|
<button class="btn-red" form-type="submit">立即申请</button>
|
</view>
|
</form>
|
<view class="form-wrap p30 f30" v-if="reason">
|
<view class="d-c-c pt30">
|
<text style=" font-size: 100rpx;" class="icon iconfont icon-icon_xianshi-xian"></text>
|
</view>
|
<view class="p-30-0 d-c-c gray6 f30">
|
上次的申请已被驳回,原因:{{reason}}!
|
</view>
|
</view>
|
</view>
|
</template>
|
<!--审核中-->
|
<template v-if="is_applying">
|
<view class="form-wrap p30 f30">
|
<view class="d-c-c pt30">
|
<text style=" font-size: 100rpx;" class="icon iconfont icon-icon_xianshi-xian"></text>
|
</view>
|
<view class="p-30-0 d-c-c gray6 f30">
|
您的申请正在审核,请耐心等待!
|
</view>
|
</view>
|
</template>
|
<shopTabBar></shopTabBar>
|
</view>
|
</template>
|
|
<script>
|
import Popup from '@/components/uni-popup.vue'
|
export default {
|
components: {
|
Popup,
|
},
|
data() {
|
return {
|
/*弹窗是否打开*/
|
isPopup: false,
|
is_applying: false,
|
is_release:'',
|
/*小程序订阅消息*/
|
temlIds: [],
|
iphone_x: false,
|
is_pass: true,
|
reason:'',
|
releaseData:[],
|
province_id: 0,
|
city_id: 0,
|
region_id: 0,
|
address: {},
|
location_address: '',
|
short_address:'',
|
}
|
},
|
mounted() {
|
/*数据*/
|
this.getData();
|
},
|
created() {
|
let self = this;
|
uni.getSystemInfo({
|
success: function (res) {
|
let model = ['X', 'XR', 'XS', '11', '12', '13', '14', '15'];
|
model.forEach(item => {
|
//适配iphoneX以上的底部,给tabbar一定高度的padding-bottom
|
if(res.model.indexOf(item) != -1 && res.model.indexOf('iPhone') != -1) {
|
self.iphone_x = true;
|
}
|
})
|
}
|
});
|
},
|
methods: {
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
})
|
|
self._get('plus.release.supplyIndex/apply', {
|
platform: self.getPlatform()
|
}, function(res) {
|
uni.hideLoading();
|
self.is_applying = res.data.is_applying;
|
self.is_release=res.data.is_release;
|
self.temlIds = res.data.template_arr;
|
self.releaseData = res.data.releaseData;
|
|
if(self.is_release){
|
uni.navigateBack({});
|
}
|
if(res.data.reason){
|
self.reason = res.data.reason;
|
}
|
});
|
},
|
|
chooseLocation(n) {
|
let self=this;
|
uni.authorize({
|
scope: 'scope.userLocation',
|
success: () => {
|
uni.chooseLocation({
|
success: function (res) {
|
console.log(res)
|
self.address.longitude=res.longitude;
|
self.address.latitude=res.latitude;
|
self.location_address=res.address;
|
// 获取省市区
|
setTimeout(function(){
|
self.setLocationAddress();
|
},500)
|
},fail: function (err) {
|
//console.log(err)
|
}
|
});
|
},
|
})
|
},
|
// 获取省市区 by yj
|
setLocationAddress() {
|
let self = this;
|
self._get('user.address/setLocationAddress', {
|
address: self.location_address
|
}, function(res) {
|
self.short_address = res.data.short_address;
|
self.address.location_address = res.data.short_address;
|
self.province_id = res.data.cityCode[0];
|
self.city_id = res.data.cityCode[1];
|
self.region_id = res.data.cityCode[2];
|
});
|
},
|
|
/*申请*/
|
formCheck: function(e) {
|
let self = this;
|
let formdata = e.detail.value;
|
|
// formdata.province_id = self.province_id;
|
// formdata.city_id = self.city_id;
|
// formdata.region_id = self.region_id;
|
// formdata.longitude = self.address.longitude;
|
// formdata.latitude = self.address.latitude;
|
// formdata.location_address = self.address.location_address;
|
// formdata.detail= self.location_address;
|
|
if(formdata.name==''){
|
uni.showToast({
|
title: '请输入姓名!',
|
icon:'none'
|
});
|
return;
|
}
|
if(formdata.mobile.length==''){
|
uni.showToast({
|
title: '请输入手机号!',
|
icon: 'none'
|
});
|
return;
|
}
|
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(formdata.mobile)) {
|
uni.showToast({
|
title: '手机有误,请重填!',
|
icon: 'none'
|
});
|
return;
|
}
|
|
// if (formdata.province_id == 0 || formdata.city_id == 0 || formdata.region_id == 0 || formdata.location_address == '') {
|
// uni.showToast({
|
// title: '请选择完整省市区',
|
// duration: 1000,
|
// icon: 'none'
|
// });
|
// return false;
|
// }
|
|
uni.showLoading({
|
title: '正在提交',
|
mask: true
|
})
|
self.formSubmit(formdata);
|
},
|
|
formSubmit(e) {
|
let self = this;
|
let callback = function(){
|
self._post('plus.release.supplyIndex/submit', e, function(res) {
|
uni.hideLoading();
|
uni.showToast({
|
title: '申请成功'
|
});
|
self.getData();
|
});
|
};
|
self.subMessage(self.temlIds, callback);
|
},
|
goback() {
|
uni.navigateBack();
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.form-wrap {
|
background: #FFFFFF;
|
position: relative;
|
}
|
|
.form-item {
|
padding: 20rpx 0;
|
margin-bottom: 20rpx;
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
font-size: 28rpx;
|
}
|
|
.form-item .field-name {
|
width: 100rpx;
|
}
|
|
.form-item input {
|
font-size: 28rpx;
|
}
|
.apply-team .btn-red {
|
width: 600rpx;
|
height: 88rpx;
|
line-height: 88rpx;
|
border-radius: 44rpx;
|
box-shadow: 0 8rpx 16rpx 0 rgba(226,35,26,.6);
|
}
|
</style>
|