2024-06-05 19:16:02 +08:00
|
|
|
<template>
|
2024-07-30 09:57:25 +08:00
|
|
|
<view class="content hehuo_view">
|
|
|
|
<view class="advantage-title">城市合伙人</view>
|
|
|
|
<view class="advantage-bor"></view>
|
2024-06-05 19:16:02 +08:00
|
|
|
<view class="info">
|
|
|
|
<view class="info-box">
|
|
|
|
<view class="info-box-item">
|
|
|
|
<view class="info-box-item-name">联系人姓名</view>
|
2024-08-08 13:49:29 +08:00
|
|
|
<u-input placeholder="请输入联系人姓名" v-model="applyName" :clearable="true"></u-input>
|
2024-06-05 19:16:02 +08:00
|
|
|
</view>
|
|
|
|
<view class="line"></view>
|
|
|
|
<view class="info-box-item">
|
|
|
|
<view class="info-box-item-name">联系人手机号</view>
|
2024-08-08 13:49:29 +08:00
|
|
|
<u-input placeholder="请输入联系人手机号" v-model="applyPhone" :clearable="true"></u-input>
|
2024-06-05 19:16:02 +08:00
|
|
|
</view>
|
|
|
|
<view class="line"></view>
|
2024-08-14 15:48:32 +08:00
|
|
|
<!-- <view class="info-box-item">
|
2024-08-14 09:36:25 +08:00
|
|
|
<view class="info-box-item-name" @click="getcity()">选择城市</view>
|
2024-08-08 13:49:29 +08:00
|
|
|
<u-input placeholder="请选择所在区域地址" v-model="applyContent" :disabled="false"
|
|
|
|
:clearable="true">
|
2024-06-05 19:16:02 +08:00
|
|
|
</u-input>
|
2024-08-14 15:48:32 +08:00
|
|
|
</view> -->
|
|
|
|
<view class="info-box-item" v-if="applyContent">
|
|
|
|
<uni-forms ref="baseForm" :disabled="true">
|
|
|
|
<uni-forms-item label="选择城市" required :disabled="true">
|
|
|
|
<picker class="addRess" :disabled="true" range-key="AreaName" mode="multiSelector">
|
|
|
|
<view class="uni-input">
|
|
|
|
<text>{{applyContent}}</text>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms>
|
|
|
|
</view>
|
|
|
|
<view class="info-box-item" v-else>
|
|
|
|
<uni-forms ref="baseForm" >
|
|
|
|
<uni-forms-item label="选择城市" required>
|
|
|
|
<picker class="addRess" @change="bindPickerChange" @columnchange="pluginclass" :value="pickVal" :range="cityArr"
|
|
|
|
range-key="AreaName" mode="multiSelector">
|
|
|
|
<view class="qing" v-if="pickVal2.length==0">请选择城市</view>
|
|
|
|
<view v-else class="uni-input">
|
|
|
|
<text>{{cityData}}</text>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms>
|
2024-06-05 19:16:02 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="sub">
|
|
|
|
<view class="sub-box">
|
|
|
|
<view class="sub-box-l" @click="submit()" v-if="!applyId">确认提交</view>
|
|
|
|
<view class="sub-box-r" @click="goChat()" v-if="!applyId">直接联系 </view>
|
|
|
|
<view class="sub-box-rs" @click="goChat()" v-else>直接联系 </view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-08-14 15:48:32 +08:00
|
|
|
import xlhPicker from '@/components/xlh-picker/xlh-picker.vue'
|
2024-06-05 19:16:02 +08:00
|
|
|
export default {
|
2024-08-14 15:48:32 +08:00
|
|
|
components:{xlhPicker},
|
2024-06-05 19:16:02 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2024-08-14 15:48:32 +08:00
|
|
|
pickVal: [0, 0, 0], // 选择器默认值
|
|
|
|
pickVal2:[], // 辅助城市名字线索
|
|
|
|
cityArr: [], // 所有城市
|
2024-06-05 19:16:02 +08:00
|
|
|
applyName: '',
|
|
|
|
applyPhone: '',
|
|
|
|
applyContent: '',
|
2024-07-10 15:32:28 +08:00
|
|
|
applyId: '',
|
|
|
|
latitude:'',
|
2024-08-14 15:48:32 +08:00
|
|
|
longitude:'',
|
|
|
|
cityData:''
|
2024-06-05 19:16:02 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
onLoad() {
|
2024-08-14 15:48:32 +08:00
|
|
|
this.getDetail();
|
|
|
|
this.loadProvinces()
|
2024-06-05 19:16:02 +08:00
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
|
2024-08-14 15:48:32 +08:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
// 页面初始化
|
|
|
|
|
2024-06-05 19:16:02 +08:00
|
|
|
},
|
|
|
|
methods: {
|
2024-08-14 15:48:32 +08:00
|
|
|
loadProvinces() { // 加载省份
|
|
|
|
uni.request({
|
|
|
|
url: 'http://test-api.tiananhub.com/api/province/GetListProvince',
|
|
|
|
method: 'get',
|
|
|
|
success: async (res) => {
|
|
|
|
let {
|
|
|
|
data
|
|
|
|
} = res.data
|
|
|
|
console.log(data)
|
|
|
|
this.cityArr[0] = data
|
|
|
|
this.loadCities(data[0].AreaId)
|
|
|
|
this.$forceUpdate()
|
|
|
|
},
|
|
|
|
fail: async (res) => {}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 请求地级市
|
|
|
|
loadCities(AreaId) {
|
|
|
|
uni.request({
|
|
|
|
url: 'http://test-api.tiananhub.com/api/province/GetListCity',
|
|
|
|
data: {
|
|
|
|
AreaId
|
|
|
|
},
|
|
|
|
method: 'get',
|
|
|
|
success: async (res) => {
|
|
|
|
let {
|
|
|
|
data
|
|
|
|
} = res.data
|
|
|
|
this.cityArr[1] = data
|
|
|
|
this.loadAreas(data[0].AreaId)
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
},
|
|
|
|
fail: async (res) => {}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 请求县区市
|
|
|
|
loadAreas(AreaId) {
|
|
|
|
uni.request({
|
|
|
|
url: 'http://test-api.tiananhub.com/api/province/GetListCity',
|
|
|
|
data: {
|
|
|
|
AreaId
|
|
|
|
},
|
|
|
|
method: 'get',
|
|
|
|
success: async (res) => {
|
|
|
|
let {
|
|
|
|
data
|
|
|
|
} = res.data
|
|
|
|
this.cityArr[2] = data
|
|
|
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
},
|
|
|
|
fail: async (res) => {}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 确定其他选择的值
|
|
|
|
bindPickerChange(data) {
|
|
|
|
this.pickVal=data.target.value;
|
|
|
|
this.pickVal2=data.target.value;
|
|
|
|
this.cityData=this.cityArr[0][this.pickVal2[0]].AreaName+'-'+this.cityArr[1][this.pickVal2[1]].AreaName+'-'+this.cityArr[2][this.pickVal2[2]].AreaName
|
|
|
|
|
|
|
|
},
|
|
|
|
// 选择时且未点击确定是的值
|
|
|
|
pluginclass(e) {
|
|
|
|
if (e.detail.column == 0) {
|
|
|
|
this.loadCities(this.cityArr[0][e.detail.value].AreaId);
|
|
|
|
}
|
|
|
|
if (e.detail.column == 1) {
|
|
|
|
this.loadAreas(this.cityArr[1][e.detail.value].AreaId);
|
|
|
|
}
|
|
|
|
},
|
2024-06-05 19:16:02 +08:00
|
|
|
getDetail() {
|
|
|
|
let data = {
|
|
|
|
classify: 1
|
|
|
|
}
|
|
|
|
this.$Request.get("/app/apply/selectApplyByUserIdAndClassify", data).then(res => {
|
|
|
|
if (res.code == 0 && res.data) {
|
|
|
|
this.applyName = res.data.applyName
|
|
|
|
this.applyPhone = res.data.applyPhone
|
|
|
|
this.applyContent = res.data.applyContent
|
|
|
|
this.applyId = res.data.status
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getcity() {
|
|
|
|
let that = this
|
|
|
|
uni.chooseLocation({
|
|
|
|
success: function(res) {
|
|
|
|
console.log('位置名称:' + res.name);
|
|
|
|
console.log('详细地址:' + res.address);
|
|
|
|
console.log('纬度:' + res.latitude);
|
|
|
|
console.log('经度:' + res.longitude);
|
2024-07-10 15:32:28 +08:00
|
|
|
that.latitude = res.latitude
|
|
|
|
that.longitude = res.longitude
|
|
|
|
uni.setStorageSync('latitude', res.latitude)
|
|
|
|
uni.setStorageSync('longitude', res.longitude)
|
2024-06-05 19:16:02 +08:00
|
|
|
that.applyContent = res.address + res.name
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
goChat() {
|
|
|
|
let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
|
|
|
|
let kefuPhone = this.$queue.getData('kefuPhone');
|
|
|
|
if (kefu == 1) {
|
|
|
|
uni.makePhoneCall({
|
|
|
|
phoneNumber: kefuPhone //仅为示例
|
|
|
|
});
|
|
|
|
} else if (kefu == 3) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/my/setting/customer'
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
let that = this
|
|
|
|
try {
|
|
|
|
wx.openCustomerServiceChat({
|
|
|
|
extInfo: {
|
|
|
|
url: that.$queue.getData('kefuUrl')
|
|
|
|
},
|
|
|
|
corpId: that.$queue.getData('kefuAppId'),
|
|
|
|
success(res) {},
|
|
|
|
fail(res) {
|
|
|
|
console.error(res)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} catch (error) {
|
|
|
|
console.error("catchcatch" + error)
|
|
|
|
uni.showToast({
|
|
|
|
title: '请更新至微信最新版本'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// #endif
|
|
|
|
// #ifndef MP-WEIXIN
|
|
|
|
let url = this.$queue.getData('kefuUrl');
|
|
|
|
if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
//#ifndef H5
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/index/webView?url=' + url
|
|
|
|
});
|
|
|
|
//#endif
|
|
|
|
//#ifdef H5
|
|
|
|
window.location.href = url;
|
|
|
|
//#endif
|
|
|
|
}
|
|
|
|
// #endif
|
|
|
|
}
|
|
|
|
},
|
|
|
|
submit() {
|
|
|
|
if (!this.applyName) {
|
|
|
|
uni.showToast({
|
2024-08-14 15:48:32 +08:00
|
|
|
title: '请输入联系人姓名!',
|
2024-06-05 19:16:02 +08:00
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (!this.applyPhone) {
|
|
|
|
uni.showToast({
|
2024-08-14 15:48:32 +08:00
|
|
|
title: '请输入联系人手机号码!',
|
2024-06-05 19:16:02 +08:00
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
2024-08-14 15:48:32 +08:00
|
|
|
if (!this.cityData) {
|
2024-06-05 19:16:02 +08:00
|
|
|
uni.showToast({
|
2024-08-14 15:48:32 +08:00
|
|
|
title: '请选择城市!',
|
2024-06-05 19:16:02 +08:00
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
let data = {
|
|
|
|
applyName: this.applyName,
|
|
|
|
applyPhone: this.applyPhone,
|
2024-08-14 15:48:32 +08:00
|
|
|
applyContent: this.cityData,
|
2024-06-05 19:16:02 +08:00
|
|
|
classify: 1
|
|
|
|
}
|
|
|
|
this.$Request.postJson("/app/apply/insertApply", data).then(res => {
|
|
|
|
if (res.code == 0) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '提交成功!',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
setTimeout(function() {
|
|
|
|
uni.navigateBack()
|
|
|
|
}, 1000)
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
title: res.msg,
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
2024-08-14 15:48:32 +08:00
|
|
|
/deep/.is-required{
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
/deep/.uni-forms-item__label{
|
|
|
|
width:100% !important;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #333333;
|
|
|
|
font-weight: 800;
|
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
|
|
|
/deep/.uni-forms-item{
|
|
|
|
flex-direction: column !important;
|
|
|
|
}
|
|
|
|
.qing{
|
|
|
|
color: rgb(192, 196, 204);
|
|
|
|
}
|
2024-07-30 09:57:25 +08:00
|
|
|
.hehuo_view {
|
|
|
|
width: 100%;
|
|
|
|
padding-top: 10px;
|
|
|
|
background-image: url('../../static/cooperate/cooperate4.png');
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: 100% 550rpx;
|
|
|
|
}
|
|
|
|
.advantage-title{
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-top: 60rpx;
|
|
|
|
margin-left: 30rpx;
|
|
|
|
}
|
|
|
|
.advantage-bor{
|
|
|
|
width: 64px;
|
|
|
|
height: 6px;
|
|
|
|
border-radius: 3px;
|
|
|
|
bottom: 0;
|
|
|
|
background: linear-gradient(90deg, rgba(234, 248, 245, 0.7), rgba(132, 211, 196, 0.7));
|
|
|
|
margin-bottom: 80rpx;
|
|
|
|
}
|
2024-06-15 09:08:10 +08:00
|
|
|
.content {
|
|
|
|
background-color: #f7f7f7;
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
position: relative;
|
2024-06-05 19:16:02 +08:00
|
|
|
}
|
|
|
|
.bgimg {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.info {
|
2024-06-15 09:08:10 +08:00
|
|
|
width: 95%;
|
2024-06-05 19:16:02 +08:00
|
|
|
height: auto;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2024-06-15 09:08:10 +08:00
|
|
|
margin: 0px auto;
|
2024-06-27 21:53:03 +08:00
|
|
|
padding:20rpx 40rpx;
|
2024-06-15 09:08:10 +08:00
|
|
|
background-color: #fff;
|
|
|
|
border-radius: 10px;
|
2024-06-05 19:16:02 +08:00
|
|
|
.info-box {
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
.info-box-title {
|
|
|
|
color: #333333;
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: 800;
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.info-box-item {
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
|
|
|
.info-box-item-name {
|
2024-06-27 21:53:03 +08:00
|
|
|
font-size: 30rpx;
|
2024-06-05 19:16:02 +08:00
|
|
|
color: #333333;
|
|
|
|
font-weight: 800;
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.line {
|
|
|
|
width: 100%;
|
|
|
|
border-bottom: 1rpx solid #f7f7f7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.sub {
|
|
|
|
width: 100%;
|
|
|
|
height: 88rpx;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
2024-06-15 09:08:10 +08:00
|
|
|
position: fixed;
|
|
|
|
bottom: 0px;
|
2024-07-17 10:43:18 +08:00
|
|
|
margin-bottom: 8px;
|
2024-06-05 19:16:02 +08:00
|
|
|
.sub-box {
|
|
|
|
width: 613rpx;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.sub-box-l {
|
|
|
|
width: 290rpx;
|
2024-06-27 21:53:03 +08:00
|
|
|
height: 82rpx;
|
|
|
|
line-height: 82rpx;
|
2024-06-15 09:08:10 +08:00
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
|
|
|
border-radius: 46rpx;
|
2024-06-05 19:16:02 +08:00
|
|
|
color: #ffffff;
|
|
|
|
font-size: 30rpx;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sub-box-rs {
|
2024-06-15 09:08:10 +08:00
|
|
|
width: 290rpx;
|
2024-06-27 21:53:03 +08:00
|
|
|
height: 82rpx;
|
|
|
|
line-height: 82rpx;
|
2024-06-15 09:08:10 +08:00
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
|
|
|
border-radius: 46rpx;
|
2024-06-05 19:16:02 +08:00
|
|
|
color: #ffffff;
|
|
|
|
font-size: 30rpx;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sub-box-r {
|
|
|
|
width: 290rpx;
|
2024-06-27 21:53:03 +08:00
|
|
|
height: 82rpx;
|
|
|
|
line-height: 82rpx;
|
2024-06-15 09:08:10 +08:00
|
|
|
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
|
|
|
|
border-radius: 46rpx;
|
2024-06-05 19:16:02 +08:00
|
|
|
color: #ffffff;
|
|
|
|
font-size: 30rpx;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|