横板营业执照提取生成
<template>
<view>
<template>
<view>
<view class="b-pt-32 b-pr-32 b-pl-32 b-pb-24 b-text-black-dd">公司类型营业执照生成2.0(不适用于组织形式)</view>
<form class="b-form b-bg-white">
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">统一社会信任代码</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入统一社会信任代码" v-model="code">
</view>
<view class="b-ml-16">
<button class="b-btn b-btn-blue b-btn-sm" @tap="query()">查询</button>
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">成立日期</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入成立日期,注意格式 例如:2024-10-14" v-model="clrq">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">公司名称</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入公司名称" v-model="gsmc">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">公司类型</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入公司类型" v-model="gslx">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">登记机关</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入登记机关" v-model="djjg">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">法定代表人</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入法定代表人" v-model="fddbr">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">经营范围</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入经营范围" v-model="jyfw">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">注册资本</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入注册资本" v-model="zczb">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">地址</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入地址" v-model="dz">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">印章图像的大小(缩放比例)</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="印章图像的缩放比例" v-model="yztxdx" >
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">印章图像的坐标x</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="印章图像的坐标x" v-model="yztxzbx">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">印章图像的坐标y</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="印章图像的坐标y" v-model="yztxzby">
</view>
</view>
</view>
<view class="b-form-item">
<view class="b-font-32 b-mb-16 b-form-required b-flex-x">经营范围字体大小</view>
<view class="b-flex-x">
<view class="b-flex-item">
<input type="text" class="b-form-input" placeholder="请输入经营范围字体大小" v-model="jyfwdx" >
</view>
</view>
</view>
<view class="b-p-32" style="background-color: #f6f6f6;">
<button class="b-btn b-btn-block b-btn-round b-btn-blue" @click="yulan()">预览(免费)</button>
</view>
<view class="b-p-32" style="background-color: #f6f6f6;">
<button class="b-btn b-btn-block b-btn-round b-btn-blue" @click="tiqu()">生成(10C币)</button>
</view>
</form>
</view>
</template>
<view class="b-bg-white b-p-32" style="display: flex;flex-direction: column;align-items: center;justify-content: center;margin-top: 20rpx;">
<text @click="copyText()" style="text-align: center;">下载链接(点我下载):{{unlink}}</text>
<image :src="unlink" mode="widthFix" style="text-align: center;margin: auto;"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code:"",
clrq:'',
gsmc:'',
gslx:'',
djjg:'',
fddbr:'',
jyfw:'',
zczb:'',
dz:'',
yztxdx:'0.7',
yztxzbx:'2000',
yztxzby:'1350',
jyfwdx:'35',
unlink:''
}
},
onLoad() {
},
methods: {
// 坚挺表单提交
query(){
let that=this;
uni.showLoading({
title:'查询中..'
})
uni.request({
url: 'https://*******/api/BusinessLicense/search.php',
data: {
code:that.code
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded;' //自定义请求头信息
},
success: (res) => {
console.log(res.data.data)
if (res.data.code==200) {
uni.hideLoading()
let timestamp = res.data.data['estiblishTime'];
// 创建 Date 对象
let date = new Date(timestamp);
// 获取年份、月份和日期
let year = date.getFullYear();
let month = date.getMonth() + 1; // 月份从 0 开始,所以要加 1
let day = date.getDate();
// 格式化为“YYYY-MM-DD”形式
let formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
// 将格式化后的日期赋值给 that.clrq
that.clrq = formattedDate;
that.gsmc=res.data.data['name'];
that.gslx=res.data.data['companyShowBizTypeName'];
that.djjg=res.data.data['regInstitute'];
that.fddbr=res.data.data['legalPersonName'];
that.jyfw=res.data.data['businessScope'];
that.zczb=res.data.data['regCapital'];
that.dz=res.data.data['addressList'][0]['address'];
} else{
uni.showToast({
title:res.data.msg,
icon:'none'
})
}
}
})
},
yulan(){
uni.showLoading({
title:'提取中...'
})
let that=this;
uni.request({
url: 'https://*******/api/BusinessLicense/index.php',
data: {
type:'1',//1预览2正式
code: that.code,
clrq:that.clrq,
gsmc:that.gsmc,
gslx:that.gslx,
djjg:that.djjg,
fddbr:that.fddbr,
jyfw:that.jyfw,
zczb:that.zczb,
dz:that.dz,
yztxdx:that.yztxdx,
yztxzbx:that.yztxzbx,
yztxzby:that.yztxzby,
jyfwdx:that.jyfwdx
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded;' //自定义请求头信息
},
success: (res) => {
console.log(res.data)
if (res.data.code === 200) {
setTimeout(function () {
uni.hideLoading()
}, 3000);
that.unlink='https://*******/static/tmp/'+res.data.data['data']
} else {
uni.showToast({
title:res.data.msg,
icon:'error'
})
}
}
})
},
copyText() {
uni.setClipboardData({
data: this.unlink,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
tiqu(){
let that=this;
const openid = uni.getStorageSync('openid');
if (openid=='') {
uni.showLoading({
title:'请先登录',
icon:'none'
})
setTimeout(()=>{
uni.navigateTo({
url:'/pages/login/login'
})
},2000);
} else{
uni.request({
url: 'https://*******/api/subcash.php',
data: {
openid: uni.getStorageSync('openid')
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
},
success: (res) => {
setTimeout(function () {
uni.showLoading({
title:'提取中...'
})
}, 3000);
uni.request({
url: 'https://*******/api/BusinessLicense/index.php',
data: {
type:'2',//1预览2正式
code: that.code,
clrq:that.clrq,
gsmc:that.gsmc,
gslx:that.gslx,
djjg:that.djjg,
fddbr:that.fddbr,
jyfw:that.jyfw,
zczb:that.zczb,
dz:that.dz,
yztxdx:that.yztxdx,
yztxzbx:that.yztxzbx,
yztxzby:that.yztxzby,
jyfwdx:that.jyfwdx
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded;' //自定义请求头信息
},
success: (res) => {
console.log(res.data)
if (res.data.code === 200) {
setTimeout(function () {
uni.hideLoading()
}, 3000);
that.unlink='https://*******/static/tmp/'+res.data.data['data']
} else {
uni.showToast({
title:res.data.msg,
icon:'error'
})
}
}
})
}
})
}
}
}
}
</script>
<style lang