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.
 
 
 
 
 

1134 lines
35 KiB

<template>
<view class="enterForm">
<view class="bgimgbox">
<image class="bgimg" :src="imageRoot + 'demoBackImg.png'" mode=""></image>
</view>
<view class="formbox" v-if="loadlogo">
<view class="formdatabox">
<view class="dis-flex f-26" style="padding-bottom: 20upx;">
<view class="sign">
</view>
<view style="padding-left: 20upx;flex: 0.45;">
请填写店铺信息
</view>
<view class="t-r" style="flex: 0.6;">
<!-- 直接联系客服<text class="iconfont icon-right" style="font-size: 20upx;color: #999999;padding-left: 10upx;"></text> -->
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
商家名称
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入店铺名称" v-model="userInfo.name" />
</view>
</view>
<!-- <view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
姓名
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入姓名" />
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
电话
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入联系电话" />
</view>
</view> -->
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
所在城市
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<w-picker :visible.sync="visiblec" mode="region" :value="[userInfo.provinceid,userInfo.areaid,userInfo.distid]"
default-type="value" :hide-area="false" @confirm="onConfirm($event,'region')" @cancel="onCancel" ref="region"></w-picker>
<view class="uni-input" @tap="visble">{{ provinceidName }} {{ areaidName }} {{ distidName }}<text class="iconfont icon-right"
style="float: right;font-size: 20upx;color: #999999;">
</text></view>
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
详细地址
</view>
<view class="dis-flex" style="flex: 0.8;padding-left: 40upx;" @click="getLocation">
<input class="f-24" disabled style="flex: 0.8;" placeholder="点击定位详细地址" v-model="userInfo.address" />
<view class="dis-il-block" style="flex: 0.2;">
<image style="width: 20upx;height: 20upx;padding-left: 10upx;" :src="imgfixUrls + 'merchant/where.svg'" />
<span>定位</span>
</view>
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
所属行业
</view>
<view class="dis-flex" style="flex: 0.8;padding-left: 40upx;">
<view class="timePickerView" @click="showThePic">
<!-- <picker mode="multiSelector" class="dataPicker" :range="typelist" @change="checkType" @columnchange="changeKey"
range-key="name" :value="typeIndex"> -->
<view v-if="industryclass == ''" class="uni-input twoLevelList">请选择行业分类<text class="iconfont icon-right" style="font-size: 20upx;color: #999999;float: right;"></text></view>
<view v-else class="uni-input twoLevelList">
<view class="dis-il-block" style="width: 90%;">
{{industryclass}}
</view>
<text class="iconfont icon-right" style="font-size: 20upx;color: #999999;float: right;"></text>
</view>
<!-- </picker> -->
<span></span>
</view>
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
商家简介
</view>
<view class="dis-flex" style="flex: 0.8;padding-left: 40upx;">
<textarea style="width: 100%;font-size: 24upx;" v-if="!hangyeshow" auto-height placeholder="请输入商户简介" placeholder-style="font-size:24upx"
v-model="userInfo.desc" />
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<!-- <view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view> -->
富文本
</view>
<view class="dis-flex" style="flex: 0.8;padding-left: 40upx;">
<view class="timePickerView" @click="richText = true">
<!-- <picker mode="multiSelector" class="dataPicker" :range="typelist" @change="checkType" @columnchange="changeKey"
range-key="name" :value="typeIndex"> -->
<view class="uni-input twoLevelList">富文本编辑<text class="iconfont icon-right" style="font-size: 20upx;color: #999999;float: right;"></text></view>
<!-- </picker> -->
<span></span>
</view>
</view>
</view>
</view>
<view class="formdatabox" style="margin-top: 20upx;">
<view class="dis-flex f-26" style="padding-bottom: 20upx;">
<view class="sign">
</view>
<view style="padding-left: 20upx;flex: 0.8;">
请填写联系方式<text class="f-20 col-9">(至少填写一项)</text>
</view>
</view>
<!-- <view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view>
微信号
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入微信号" v-model="userInfo.wx" />
</view>
</view> -->
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<!-- <view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view> -->
联系方式
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入联系电话" v-model="userInfo.mobile" />
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<!-- <view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;">*</view> -->
微信号
</view>
<view style="flex: 0.8;padding-left: 40upx;">
<input class="uni-input f-24" placeholder="请输入微信号" v-model="userInfo.wechat_number" />
</view>
</view>
<view class="logobox" style="padding-top: 20upx;">
<!-- <view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;line-height: 70upx;padding-right: 10upx;">*</view> -->
<span>微信二维码</span>
<view style="padding-left: 0upx;">
<!-- 图片预览循环模板 -->
<view class="userImgUpdataon" v-if="userInfo.wechat_qrcodes">
<image :src="userInfo.wechat_qrcodes" class="imgs" @click="lookimg(1,userInfo.wechat_qrcodes)" />
<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closeLogo(true)" />
</view>
<!-- 图片预览循环模板 -->
<view class="userImgUpdata" @click="uploadFiles(3, 1)" style="margin: 10upx;width: 180upx;min-width: 180upx;max-width: 180upx;" v-if="!userInfo.wechat_qrcode">
<image :src="imgfixUrls + 'merchant/addImg.svg'" class="img" />
</view>
</view>
</view>
</view>
<view class="formdatabox" style="margin-top: 20upx;">
<view class="dis-flex f-26" style="padding-bottom: 20upx;">
<view class="sign">
</view>
<view style="padding-left: 20upx;flex: 0.45;">
商家展示
</view>
<view class="t-r" style="flex: 0.6;">
<!-- 直接联系客服<text class="iconfont icon-right" style="font-size: 20upx;color: #999999;padding-left: 10upx;"></text> -->
</view>
</view>
<view class="logobox">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;line-height: 70upx;padding-right: 10upx;">*</view>
<span>店铺LOGO(200X200)</span>
<view style="padding-left: 20upx;">
<!-- 图片预览循环模板 -->
<view class="userImgUpdataon" style="margin: 10upx;" v-if="userInfo.logos">
<image :src="userInfo.logos" class="imgs" @click="lookimg(1,userInfo.logos)" />
<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closeLogo(false)" />
</view>
<!-- 图片预览循环模板 -->
<view class="userImgUpdata" @click="uploadFiles(1, 1)" style="margin: 10upx;width: 180upx;min-width: 180upx;max-width: 180upx;" v-if="!userInfo.logo">
<image :src="imgfixUrls + 'merchant/addImg.svg'" class="img" />
</view>
</view>
</view>
<view class="logobox">
<view class="dis-il-block" style="font-size: 20upx;color: #FF4444;float: left;line-height: 70upx;padding-right: 10upx;">*</view>
<span>店铺相册(750X750)</span>
<view class="dis-flex" style="flex-wrap: wrap;align-content: flex-center;align-items: center;justify-content: left;">
<!-- 图片预览循环模板 -->
<view class="userImgUpdataon" style="flex: auto;margin: 10upx;width: 180upx;min-width: 180upx;max-width: 180upx;" v-for="(item, index) in userInfo.thumbs">
<image :src="item" class="imgs" style="width: 100%;" @click="lookimg(2,userInfo.thumbs,index)" />
<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closePreview(2, item)" />
</view>
<!-- 图片预览循环模板 -->
<view class="userImgUpdata" style="flex: auto;margin: 10upx;width: 180upx;min-width: 180upx;max-width: 180upx;" v-if="userInfo.thumbs.length !== 6" @click="uploadFiles(2, 6)">
<image :src="imgfixUrls + 'merchant/addImg.svg'" class="img" /></view>
</view>
</view>
</view>
<view class="formdatabox" style="margin-top: 20upx;" >
<view class="dis-flex f-26" style="padding-bottom: 20upx;">
<view class="sign">
</view>
<view style="padding-left: 20upx;flex: 0.45;">
请选择入驻类型
</view>
</view>
<view class="dis-flex f-24 formtitle">
<view class="t-r" style="flex: 0.2;">
<view class="dis-il-block" style="font-size: 20upx;color: #FFFFFF;float: left;">*</view>
入驻类型
</view>
<view style="flex: 0.8;padding-left: 40upx;" v-if="pickerarray.length > 0" >
<picker @change="bindPickerChange" :value="pickerindex" range-key="name" :range="pickerarray">
<view class="uni-input">{{pickerarray[pickerindex].name}}
<view class="dis-il-block iconfont icon-right" style="float: right;font-size: 24upx;color: #6f6f6f;">
</view>
</view>
</picker>
</view>
</view>
</view>
<view >
<view class="t-c" style="width: 90vw;height: 80upx;line-height: 80upx;background-color: #FF4444;color: #FFFFFF;border-radius: 60upx;" @click="submit">
</view>
</view>
</view>
<!-- #ifdef H5 -->
<PopManager :show="isOpenLaction" :type="'bottom'" :overlay="'false'" :showOverlay="'false'">
<view class="iframe-wid-hgt" :style="{ height: phoneHeight }" v-if="latlngs">
<iframe
id="mapPage"
width="100%"
height="100%"
frameborder="0"
:src="`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=KIQBZ-6OT3G-AOMQD-IHW6J-PEUDV-VCFAF&referer=myapp&coord=${latlngs.latitude},${latlngs.longitude}`"
></iframe>
</view>
<view class="iframe-wid-hgt" :style="{ height: phoneHeight }" v-if="!latlngs">
<iframe
id="mapPage"
width="100%"
height="100%"
frameborder="0"
:src="`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=KIQBZ-6OT3G-AOMQD-IHW6J-PEUDV-VCFAF&referer=myapp`"
></iframe>
</view>
</PopManager>
<!-- #endif -->
<PopManager :show="hangyeshow" :type="'bottom'" :overlay="'false'" :showOverlay="'false'" @clickmask="closeShareBottom">
<view class="hangye dis-flex" v-if="industry.length == 0 && Array.isArray(industrysubdivide)">
<view class="f-30 t-c" style="width: 100%;">
当前地区暂无相关行业分类
</view>
</view>
<view class="hangye dis-flex" v-else>
<view style="flex: 0.499;overflow: auto;height: 360upx;">
<view :class="item.checked?'industryclass-item classcheck f-28' :'industryclass-item f-28'" v-for="(item,key,index) in industry" @click="clickindustry(item.id)">
{{item.name}}
</view>
</view>
<view style="flex: 0.499;overflow: auto;height: 360upx;">
<view :class="item.checked?'industryclass-item isclasschecked f-28' :'industryclass-item f-28'" v-for="(item,index) in industrysubdivide" @click="clickclass(item)">
{{item.name}}
</view>
</view>
</view>
<!-- <view class="b-f dis-flex">
<view class="flex-box">
<button @click="confirm" style="width: 80%;height: 80%;font-size: 34upx;line-height: 70upx;height: 70upx;margin-bottom: 20upx;" type="warn">确定</button>
</view>
</view> -->
</PopManager>
<!-- 商品详情富文本弹窗 -->
<PopManager :show="richText" type="center" @clickmask="richText = false">
<view class="b-f" style="width: 80vw;height: 80vh;border-radius: 10upx;overflow: auto;" v-if="userInfo.detail || userInfo.detail == ''">
<jinEdit placeholder="请输入内容" @editOk="editOk" uploadFileUrl="/#" :html="userInfo.detail"></jinEdit>
</view>
</PopManager>
<!-- <phoneNavBar :checked="'入驻'"></phoneNavBar> -->
<TabBars :tabBarAct="0" :pageType="'19'"></TabBars>
<far-bottom></far-bottom>
</view>
</template>
<script>
import App from '@/common/js/app.js';
import wPicker from '@/components/w-picker/w-picker.vue';
import PopManager from '@/components/template/PopManager';
import phoneNavBar from '@/components/template/phoneNavBar';
import jinEdit from '@/components/jin-edit/jin-edit.vue';
import TabBars from '@/components/template/tabBar.vue';
// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif
export default{
data(){
return{
provinceidName:'',
areaidName:'',
distidName:'',
visiblec:false,
address:'',
lblis:{},
klis:false,
isOpenLaction:false,
richText:false,
userInfo:{
pageid:'',
detail:'',
storeid:0,
meralid:0,
thumbs:[],
name:'',
logo:'',
mobile:'',
desc:'',
address:'',
one_class:'',
two_class:'',
provinceid:'',
areaid:'',
distid:'',
lng:'',
lat:''
},
phoneHeight:null,
latlngs:null,
owenscitylist:[],
hangyeshow:false,
hangYe:true,
industryclass:'',
industry:[],
industrysubdivide:[],
industryAll:{},
loadlogo:true,
pickerarray:['全部','1','2','3'],
pickerindex:0,
goodsinfo:{},
sid:'',
oldDistid:'',
uploadlength:0,
localIds:[],
upimg:false
}
},
components:{
wPicker,
PopManager,
phoneNavBar,
jinEdit,
TabBars
},
onHide() {
},
onLoad(e) {
let _this = this;
_this.id = e.id;
_this.sid = e.sid;
_this.userInfo.storeid = e.sid;
uni.getSystemInfo({
success(res) {
_this.phoneHeight = res.windowHeight + 'px';
}
});
_this.owenscitylist = uni.getStorageSync('cityList')
_this.latlngs = uni.getStorageSync('curLoction');
_this.userInfo.lat = _this.latlngs.latitude;
_this.userInfo.lng = _this.latlngs.longitude;
_this.userInfo.meralid = _this.pickerarray[0].id;
//#ifdef H5
_this.getenter(_this.id);
//#endif
},
onShow() {
let _this = this;
// #ifdef H5
window.addEventListener(
'message',
function(event) {
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
let loc = event.data;
if(_this.klis){
return
}
if (loc && loc.module == 'locationPicker') {
//防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
console.log('location', loc);
// _this.thelat = loc.latlng.lat;
_this.userInfo.address = loc.poiaddress;
_this.userInfo.lat = loc.latlng.lat;
_this.userInfo.lng = loc.latlng.lng;
_this.isOpenLaction = false;
_this.lblis = {
lat:loc.latlng.lat,
lng:loc.latlng.lng,
detailed_address:loc.poiaddress
}
_this.getloctions(_this.lblis)
}
_this.klis = true;
setTimeout(()=>{
_this.klis = false;
},1000)
},
false
);
// #endif
//#ifdef APP-PLUS
if(_this.userInfo.address){
_this.lblis.address = _this.userInfo.address
_this.getloctions(_this.lblis);
}
//#endif
//#ifdef MP-WEIXIN
if(_this.upimg){
_this.upimg = false;
return
}else{
_this.getenter(_this.id);
}
//#endif
},
methods:{
editOk(res) {
console.log('shabi', res.html);
this.userInfo.detail = res.html;
this.richText = false;
},
submit(){
let _this = this;
let data = _this.userInfo;
if(!data.provinceid){
data.provinceid = _this.userInfo.pro_code;
data.areaid = _this.userInfo.city_code;
data.distid = _this.userInfo.area_code;
}
console.log(data);
for(let key in data){
// debugger
if(key != 'wechat_number' && key != 'wechat_qrcode' && key != 'detail' && key != 'mobile' && key !='wechat_qrcodes' && key !='storeid' && key !='pageid' && key != 'wechat_qrcodes'){
if(!data[key] && data[key] !== 0){
uni.showToast({
icon:'none',
title:'请完善资料'
});
return
}else if(Array.isArray(data[key])){
if(data[key].length == 0){
uni.showToast({
icon:'none',
title:'请完善资料'
});
return
}
}
}
};
if(!data.wechat_number && !data.wechat_qrcode && !data.mobile){
uni.showToast({
icon:'none',
title:'请至少完善一项联系方式'
});
return
}
data.wechat_qrcodes = data.wechat_qrcodes || ''
data.storeid = data.storeid || ''
data.pageid = data.pageid || ''
App._post_form(
`&p=yellowpage&do=pageSettlement`,
data,
res => {
console.log(res,'提交结果');
if(res.data.status == 0){
uni.showToast({
title:res.message
});
setTimeout(()=>{
App.navigationTo({
url: 'pages/subPages2/phoneBook/myGoods/myGoods'
});
},1000)
}else{
App.navigationTo({
url: 'pages/mainPages/payment/payment?orderid=' + res.data.orderid +'&plugin=yellowpage'
});
}
},
false,
() => {
}
);
},
bindPickerChange(e){
this.pickerindex = e.detail.value;
this.userInfo.meralid = this.pickerarray[this.pickerindex].id;
},
clickclass(item){
// console.log(item);
for(let key in this.industryAll){
this.industryAll[key].map(items=>{
items.checked = false;
if(items.id == item.id){
items.checked = true;
this.industryclass = items.name
this.userInfo.two_class = items.id;
this.industrysubdivide = this.industryAll[key];
this.confirm();
}
})
};
// this.industryAll.map((items,indexs)=>{
// items.twotype.map((itemss,indexss)=>{
// itemss.checked = false;
// if(item.id == itemss.id){
// itemss.checked = true;
// this.industryclass = item.name
// }
// })
// })
this.loadlogo = false;
this.loadlogo = true;
},
clickindustry(keys){
this.industry.map((item,index)=>{
item.checked = false;
if(keys == item.id){
item.checked = true;
this.userInfo.one_class = item.id;
}
// this.userInfo.one_class = this.industry[keys].id;
})
// for(let key in this.industry){
// this.industry[key].checked = false;
// if(keys == key){
// this.industry[keys].checked = true;
// this.userInfo.one_class = this.industry[keys].id;
// }
// };
for(let key in this.industryAll){
if(keys == key){
this.industrysubdivide = this.industryAll[keys];
}
};
// console.log(item);
this.loadlogo = false;
this.loadlogo = true;
},
getenter(id){
let _this = this;
App._post_form(
`&p=yellowpage&do=getPageInfo&id=${id || ''}&sid=${_this.sid|| ''}`,
{},
res => {
console.log(res,'入驻初始化');
_this.pickerarray = res.data.meallist;
// debugger
if(res.data.pageinfo){
_this.userInfo = res.data.pageinfo;
}
if(_this.upimg){
_this.upimg = false;
return
}else{
_this.userInfo.logos = _this.userInfo.logo;
_this.userInfo.wechat_qrcodes = _this.userInfo.wechat_qrcode
}
if(_this.userInfo.name){
_this.userInfo.pageid = _this.id;
}else{
delete _this.userInfo.pageid
}
if(_this.userInfo.thumbs == false){
_this.userInfo.thumbs = [];
}
// _this.userInfo.thumbs = _this.userInfo.thumbs;
if(res.data.meallist.length > 0){
_this.userInfo.meralid = _this.pickerarray[0].id;
}
_this.oldDistid = _this.userInfo.area_code || res.data.distid;
_this.userInfo.provinceid = _this.userInfo.pro_code || res.data.provinceid;
_this.userInfo.areaid = _this.userInfo.city_code || res.data.areaid;
_this.userInfo.distid = _this.userInfo.area_code || res.data.distid;
_this.owenscitylist.map((item,index)=>{
if(item.id == _this.userInfo.provinceid){
_this.provinceidName = item.name;
item.area.map(items=>{
if(items.id == _this.userInfo.areaid){
_this.areaidName = items.name;
items.dist.map(itemss=>{
if(itemss.id == _this.userInfo.distid){
_this.distidName = itemss.name;
}
})
}
})
}
})
_this.industry = res.data.catelist.parents;
for(let key in _this.industry){
_this.industry[key].checked = false;
if(_this.industry[key].id == _this.userInfo.one_class){
_this.industry[key].checked = true;
}
};
console.log(_this.industry,'测试自动')
_this.industryAll = res.data.catelist.childrens;
for(let key in _this.industryAll){
_this.industryAll[key].map(item=>{
item.checked = false;
if(item.id == _this.userInfo.two_class){
item.checked = true;
_this.industryclass = item.name;
_this.industrysubdivide = _this.industryAll[key];
}
})
};
},
false,
() => {
// console.log('行业加载完')
}
);
},
lookimg(type,url,index){
if(type == 1 || type == 3){
let img = [];
img.push(url);
uni.previewImage({
urls:img,
current:0
})
}else{
uni.previewImage({
urls:url,
current:index
})
}
},
closePreview(type, url) {
let _this = this;
for (let i = 0; i < _this.userInfo.thumbs.length; i++) {
if (url == _this.userInfo.thumbs[i]) {
_this.userInfo.thumbs.splice(i, 1);
// _this.userInfo.thumbs.splice(i, 1);
}
}
},
closeLogo(flag){
if(flag){
this.userInfo.wechat_qrcode = '';
this.userInfo.wechat_qrcodes = '';
}else{
this.userInfo.logo = '';
this.userInfo.logos = '';
}
this.loadlogo = !this.loadlogo;
this.loadlogo = !this.loadlogo;
},
uplodephone(length,localIds){
let _this = this;
_this.upimg = true;
wxApi.uoloadIg(localIds[length], data => {
if (data.errMsg === 'uploadImage:ok') {
uni.showLoading({});
let requestData = {
upload_type: 2,
id: data.serverId
};
App._post_form(
'&do=uploadFiles',
requestData,
res => {
if (res.errno === 0) {
let num = length + 1;
// uni.setTimeout(_this.uoloadIgs(length, ids, resImg, type), 500);
// setTimeout(()=>{
// _this.uplodephone(_this.uploadlength,_this.localIds);
// },100)
// uni.showToast({
// title:'chengg',
// icon:'none'
// })
_this.userInfo.thumbs.push(res.data.img);
if(num < _this.uploadlength){
uni.setTimeout(_this.uplodephone(num,_this.localIds),500);
}
// _this.userInfo.thumbs.push(res.data.image);
}
},
false,
() => {
uni.hideLoading();
}
);
} else {
uni.hideLoading();
App.showError('上传失败');
}
});
},
// 文件上传接口
async uploadFiles(type, num) {
let _this = this;
_this.upimg = true;
// #ifdef H5
if(App.getClientType() == 2){
let res = await App.browser_upload(num);
for (let i = 0; i < res.tempFilePaths.length; i++) {
let aa = await App._upLoad(res.tempFilePaths[i]);
if (type == 1) {
_this.userInfo.logos = aa.data.img;
_this.userInfo.logo = aa.data.image;
return
}
if (type == 3) {
_this.userInfo.wechat_qrcodes = aa.data.img;
_this.userInfo.wechat_qrcode = aa.data.image;
_this.loadlogo = !_this.loadlogo;
_this.loadlogo = !_this.loadlogo;
return
}
if (type == 2) {
_this.userInfo.thumbs.push(aa.data.img);
// _this.userInfo.thumbs.push(aa.data.image);
console.log(_this.userInfo,aa.data.img);
}
}
return
}
if(type == 2){
wxApi.choseImage(res => {
_this.localIds = res.localIds;
_this.uploadlength = res.localIds.length;
_this.uplodephone(0,_this.localIds);
},6);
}else{
wxApi.choseImage(res => {
let length = res.localIds.length;
res.localIds.map(item=>{
wxApi.uoloadIg(item, data => {
if (data.errMsg === 'uploadImage:ok') {
uni.showLoading({});
let requestData = {
upload_type: 2,
id: data.serverId
};
App._post_form(
'&do=uploadFiles',
requestData,
res => {
if (res.errno === 0) {
if (type == 1) {
_this.userInfo.logos = res.data.img;
_this.userInfo.logo = res.data.image;
_this.loadlogo = !_this.loadlogo;
_this.loadlogo = !_this.loadlogo;
return
}
if (type == 3) {
_this.userInfo.wechat_qrcodes = res.data.img;
_this.userInfo.wechat_qrcode = res.data.image;
_this.loadlogo = !_this.loadlogo;
_this.loadlogo = !_this.loadlogo;
return
}
}
},
false,
() => {
uni.hideLoading();
}
);
} else {
uni.hideLoading();
App.showError('上传失败');
}
});
})
});
}
// #endif
// #ifndef H5
if(type == 1 || type == 3){
wx.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: async function(res) {
// console.log(_this.userInfo.havestore, _this.page, '-------');
for (let i = 0; i < res.tempFilePaths.length; i++) {
let aa = await App._upLoad(res.tempFilePaths[i]);
if (type == 1) {
_this.userInfo.logos = aa.data.img;
_this.userInfo.logo = aa.data.image;
return
}
if (type == 3) {
_this.userInfo.wechat_qrcodes = aa.data.img;
_this.userInfo.wechat_qrcode = aa.data.image;
_this.loadlogo = !_this.loadlogo;
_this.loadlogo = !_this.loadlogo;
return
}
}
}
});
}else{
wx.chooseImage({
count: 6,
sourceType: ['album', 'camera'],
success: async function(res) {
// console.log(_this.userInfo.havestore, _this.page, '-------');
for (let i = 0; i < res.tempFilePaths.length; i++) {
let aa = await App._upLoad(res.tempFilePaths[i]);
if (type == 1) {
_this.userInfo.logos = aa.data.img;
_this.userInfo.logo = aa.data.image;
}
if (type == 2) {
_this.userInfo.thumbs.push(aa.data.img);
// _this.userInfo.thumbs.push(aa.data.image);
console.log(_this.userInfo,aa.data.img);
}
}
}
});
}
// #endif
},
showThePic(){
this.hangYe = !this.hangYe;
this.hangyeshow = !this.hangyeshow;
},
closeShareBottom(){
this.hangyeshow = !this.hangyeshow;
this.hangYe = !this.hangYe;
},
onCancel(){
},
cancel(){
this.hangyeshow = false;
},
confirm(){
this.hangyeshow = false;
},
getcityclass(){
let _this = this;
let data = {
provinceid:this.userInfo.provinceid,
areaid:this.userInfo.areaid,
distid:this.userInfo.distid
}
App._post_form(
`&p=yellowpage&do=area2cate`,
data,
res => {
console.log(res,'更换地区结果');
_this.industry = res.data.parents;
for(let key in _this.industry){
_this.industry[key].checked = false;
};
console.log(_this.industry,'测试自动');
_this.industryAll = res.data.childrens;
for(let key in _this.industryAll){
_this.industryAll[key].map(item=>{
item.checked = false;
if(item.id == _this.userInfo.two_class){
_this.industrysubdivide = [];
_this.loadlogo = false;
_this.loadlogo = true;
}
})
console.log(_this.industryAll,'还地区')
};
_this.userInfo.one_class = '';
_this.userInfo.two_class = '';
_this.industryclass = '';
if(Array.isArray(res.data.childrens) || res.data.parents.length == 0){
_this.industrysubdivide = res.data.childrens;
_this.industryclass = '当前地区暂无行业分类';
if(_this.oldDistid !== _this.userInfo.distid){
uni.showToast({
title:'当前地区暂无行业分类',
icon:'none'
});
}
}else{
console.log(_this.oldDistid,_this.userInfo.distid,777777)
if(_this.oldDistid !== _this.userInfo.distid){
uni.showToast({
title:'更换地区请重新选择当前地区行业',
icon:'none'
});
}
}
_this.loadlogo = false;
_this.loadlogo = true;
// App.navigationTo({
// url: 'pages/mainPages/payment/payment?orderid=' + res.data.orderid
// });
},
false,
() => {
}
);
},
onConfirm(e){
console.log(e);
let _this = this;
this.provinceidName = e.obj.province.label;
this.areaidName = e.obj.city.label;
this.distidName = e.obj.area.label;
this.oldDistid = this.userInfo.distid;
this.userInfo.provinceid = e.value[0];
this.userInfo.areaid = e.value[1];
this.userInfo.distid = e.value[2];
this.getcityclass();
},
visble(){
this.visiblec = true;
},
getLocation() {
let _this = this;
// #ifndef H5
uni.chooseLocation({
keyword: '',
success: function(e) {
_this.userInfo.address = e.address;
_this.userInfo.lat = e.latitude;
_this.userInfo.lng = e.longitude;
_this.lblis.lat = e.latitude;
_this.lblis.lng = e.longitude;
_this.lblis.address = e.address
// console.log(e);
// _this.onkoc = 0;
_this.getloctions(_this.lblis)
}
});
// #endif
// #ifdef H5
_this.isOpenLaction = true;
// #endif
//#ifdef APP-PLUS
App.navigationTo({
url: 'pages/subPages2/map/index'
});
//#endif
},
getloctions(lblis){
let _this = this;
// console.log(_this.owenscitylist);
App._post_form(`&p=member&do=lng2areaid&lng=${lblis.lng}&lat=${lblis.lat}`, {}, res => {
// _this.userInfo.address = lblis.address;
console.log(_this.userInfo.distid,res.data.countyid,'666666');
_this.oldDistid = _this.userInfo.distid;
_this.userInfo.provinceid = res.data.provinceid;
_this.userInfo.distid = res.data.countyid;
_this.userInfo.areaid = res.data.cityid;
_this.owenscitylist.map((item,index)=>{
if(item.id == _this.userInfo.provinceid){
_this.provinceidName = item.name;
item.area.map(items=>{
if(items.id == _this.userInfo.areaid){
_this.areaidName = items.name;
items.dist.map(itemss=>{
if(itemss.id == _this.userInfo.distid){
_this.distidName = itemss.name;
this.getcityclass();
}
})
}
})
}
})
});
},
}
}
</script>
<style>
page{
background-color: #F7F7F7;
}
</style>
<style lang="scss" scoped>
.enterForm{
// padding: 30upx;
.bgimgbox{
.bgimg{
width: 100vw;
height: 25vh;
}
}
.formbox{
padding: 30upx;
padding-bottom: 130upx;
// height: 50vh;
position: relative;
.formdatabox{
padding: 30upx;
width: 84vw;
background-color: #FFFFFF;
border-radius: 15upx;
position: relative;
top: -100upx;
.sign{
height: 28upx;
margin-top: 5upx;
width: 8upx;
background-color: #FF4444;
border-radius: 30%;
flex: 0.014;
}
}
.logobox{
span{
font-size: 24upx;
}
.userImgUpdataon{
width: 180upx;
margin: 20upx 0;
height: 180upx;
border-radius: 10upx;
border: 1upx solid #CCCCCC;
position: relative;
overflow: hidden;
.imgs{
width: 180upx;
height: 180upx;
}
.close{
position: absolute;
width: 30upx;
height: 30upx;
right: 10upx;
top: 10upx;
}
}
.userImgUpdata{
width: 180upx;
margin: 20upx 0;
height: 180upx;
border-radius: 10upx;
border: 1upx solid #CCCCCC;
position: relative;
.img{
width: 80upx;
height: 80upx;
position: absolute;
left: 50%;
top: 30%;
transform: translate(-50%);
}
}
}
.formtitle{
padding: 25upx 10upx;
background-color: #fafafa;
margin-top: 20upx;
border-radius: 10upx;
}
}
.iframe-wid-hgt{
width: 100vw;
}
.hangye{
height: 560upx;
width: 100vw;
box-sizing: border-box;
padding: 30upx;
background-color: #FFFFFF;
border-radius: 15upx 15upx 0 0;
.industryclass-item{
padding: 20upx;
margin: 15upx;
text-align: center;
border-radius: 15upx;
}
.classcheck{
background-color: #F7F7F7;
}
.isclasschecked{
background-color: #ff4444;
color: #ffffff;
}
}
.timePickerView{
width: 100%;
}
}
</style>