123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726 |
- <template>
- <view class="content">
- <view v-if="state == 0">
- <view class="box">
- <view class="title">船厂信息</view>
- <view class="cell vflex">
- <view class="img_title left">船厂头像</view>
- <view style="width: 220rpx;height: 220rpx;padding-top: 28rpx;">
- <u-upload :fileList="info.fileList1" @afterRead="afterRead" @delete="deletePic" :maxCount="1" name="1" multiple :previewFullImage="true" width="220rpx" height="220rpx">
- <view class="vflex acenter jcenter upload_bg">
- <u-icon name="plus" color="#929292" size="20"></u-icon>
- <view class="upload_text">上传图片</view>
- </view>
- </u-upload>
- </view>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">船厂名称</view>
- <u-input v-model="info.name" border="none" placeholder="请输入船厂名称" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell" @click="selectmap">
- <view class="left">船厂地址</view>
- <u-input v-model="addressObj.address" border="none" disabled disabledColor="#fff" placeholder="请选择" inputAlign="right" suffixIcon="map-fill" suffixIconStyle="color: #B7B7B7"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">联系人</view>
- <u-input v-model="info.contacts" border="none" placeholder="请输入联系人姓名" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">联系电话</view>
- <u-input v-model="info.phone" border="none" placeholder="请输入联系电话" inputAlign="right"></u-input>
- </view>
- <view class="hflex acenter jbetween cell">
- <view class="left">船厂人数</view>
- <u-input v-model="info.num_staff" border="none" placeholder="请输入范围值,例如10-50" inputAlign="right"></u-input>
- </view>
- <view class="vflex cell" style="border: none;">
- <view class="left">船厂简介</view>
- <u--textarea v-model="info.introduction" placeholder="在此输入船厂简介内容" ></u--textarea>
- </view>
- <view class="vflex">
- <view class="img_title">船厂环境</view>
- <view class="hflex fwrap" style="padding-top: 28rpx;">
- <u-upload :fileList="info.fileList2" @afterRead="afterRead" @delete="deletePic" :maxCount="9" name="2" multiple :previewFullImage="true" width="200rpx" height="200rpx">
- <view class="vflex acenter jcenter upload_bg">
- <u-icon name="plus" color="#929292" size="20"></u-icon>
- <view class="upload_text">上传图片</view>
- </view>
- </u-upload>
- </view>
- </view>
- <view class="vflex cell" style="border: none;">
- <view class="left">产品简介</view>
- <u--textarea v-model="info.product_intro" placeholder="在此输入产品简介内容" ></u--textarea>
- </view>
- </view>
- <view class="box">
- <view class="cell" style="border: none;padding: none;">
- <view class="img_title">上传营业执照</view>
- <view class="upload_img vflex acenter jcenter">
- <u-upload :fileList="info.fileList3" @afterRead="afterRead" @delete="deletePic" :maxCount="1" name="3" multiple :previewFullImage="true" width="550rpx" height="324rpx">
- <view class="" style="position: relative;">
- <image src="https://ship.shipcc.cn/common/upload-business.png" style="width: 550rpx;height: 324rpx;"></image>
- <image src="@/static/images/mine/upload_center.png" style="position: absolute;top:102rpx;left: 216rpx; width: 120rpx;height: 120rpx;"></image>
- </view>
- <!-- <image src="https://ship.shipcc.cn/common/upload-business.png" style="width: 550rpx;height: 324rpx;"></image> -->
- </u-upload>
- <view class="hflex acenter ">
- <u-icon name="camera" color="#999999" size="16"></u-icon>
- <view class="">点击上传营业执照</view>
- </view>
- </view>
- </view>
- </view>
- <view class="hflex acenter">
- <u-checkbox-group @change="checkboxChange">
- <u-checkbox v-model="agree" shape="circle"></u-checkbox>
- </u-checkbox-group>
- <view class="text">阅读并同意<span class="read" @click="open">《船厂入驻规则》</span></view>
- </view>
- <view class="button hflex acenter jcenter" @click="settled">
- <view>立即入驻</view>
- </view>
- </view>
- <view v-if="state == 1">
- <view class="box1 vflex acenter jcenter">
- <image src="https://ship.shipcc.cn/common/wait.png" class="box1_img"></image>
- <view class="box1_title">审核中</view>
- <view class="box1_subTitle">预计审核时间3个工作日</view>
- <view class="box1_subTitle">请留意当前页面变动</view>
- <view class="btn" @click="result">返回</view>
- </view>
- </view>
- <view v-if="state == 2">
- <view class="box1 vflex acenter jcenter">
- <u-icon name="checkmark-circle-fill" color="#65B85D" size="62"></u-icon>
- <view class="box1_title">您已入驻成功</view>
- <view class="box1_text">请访问以下pc端地址进行船厂信息维护以及</view>
- <view class="box1_text">招聘信息的发布</view>
- <view class="hflex acenter jbetween lianjie">
- <view class="lj_text text_hide">{{login_url}}</view>
- <view class="text_blue"@click="copy(login_url)">复制链接</view>
- </view>
- <view class="hflex acenter" style="width: 570rpx;padding-top: 36rpx;">
- <view class="label">
- 账号:
- </view>
- <view class="text_blue">{{phone}}</view>
- </view>
- <view class="hflex acenter" style="width: 570rpx;padding-top: 36rpx;">
- <view class="label">
- 密码:
- </view>
- <view class="text_blue">123456</view>
- </view>
- <view class="card hflex">
- <image src="@/static/images/info_img.png" mode="aspectFill" class="icon"></image>
- <!-- <u-icon name="checkmark-circle-fill" color="#FE5201" size="12"></u-icon> -->
- <view class="card_text">
- 该密码为系统默认密码,登录后<span style="color: #FE5201;">请及时修改密码</span>,以防账号内<span style="color: #FE5201;">数据丢失</span>。
- </view>
- </view>
-
- <view class="btn" @click="result">返回</view>
- </view>
- </view>
- <view v-if="state == 3">
- <view class="box1 vflex acenter jcenter">
- <image src="https://ship.shipcc.cn/common/error.png" class="box1_img"></image>
- <view class="box1_title">审核失败</view>
- <view class="box1_subTitle">驳回原因</view>
- <view class="box1_subTitle">{{reason}}<span style="color: #506dff;margin-left: 8rpx;" @click="edit">立即修改></span></view>
- <view class="btn" @click="result">返回</view>
- </view>
- </view>
- <u-modal :show="showProtocol" :title="protocolTitle" confirmColor="#2988FE" @confirm="isRead" confirmText="我已阅读">
- <view class="slot-content">
- <rich-text :nodes="protocolContent"></rich-text>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- import $api from '@/static/js/api.js'
- var that = ''
- export default {
- data() {
- return {
- info: {
- id: '',
- name: '',
- address: '',
- contacts: '',
- phone: '',
- introduction: '',
- fileList1: [],
- fileList2: [],
- fileList3: [],
- product_intro:''
- },
- addressObj: {},
- agree: false,
- showProtocol: false,
- protocolTitle: '',
- protocolContent: '',
- state: 0,
- reason:'',
- fileList1: '',
- fileList2: '',
- fileList3: '',
- login_url: '',
- phone: '',
- }
- },
- onLoad() {
- that = this
- that.getPreData()
- },
- methods: {
- getPreData() {
- var pages = getCurrentPages()
- var prePage = pages[pages.length - 2]
- var shipyard = prePage.$vm.user.shipyard
- that.phone = prePage.$vm.user.phone
- if (shipyard) {
- that.info = {
- name: shipyard.name,
- contacts: shipyard.contact_name,
- phone: shipyard.contact_phone,
- introduction: shipyard.intro,
- num_staff: shipyard.num_staff,
- fileList1: [],
- fileList2: [],
- fileList3: [],
- product_intro: shipyard.product_intro,
- // fileList1: shipyard.business_img.split(','),
- id: shipyard.id
- }
- if(shipyard.head_img !== null) {
- that.info.fileList1.push({
- url: shipyard.head_img
- })
- that.fileList1 = shipyard.head_img
- }
-
- var imgs = shipyard.environment_imgs
- for(var i=0;i<imgs.length;i++) {
- that.info.fileList2.push({
- url: imgs[i]
- })
- }
- that.fileList2 = shipyard.environment_imgs
- that.info.fileList3.push({
- url: shipyard.business_img
- })
- that.fileList3 = shipyard.business_img
- console.log(that.info);
- that.addressObj = {
- address: shipyard.address,
- province: shipyard.province,
- city:shipyard.city,
- area:shipyard.area,
- longitude: shipyard.longitude,
- latitude: shipyard.latitude,
- }
- that.state = shipyard.audit
- that.reason = shipyard.why
- that.login_url = shipyard.login_url
- }
- },
- selectmap() {
- console.log('选择地址');
- uni.getLocation({
- type: 'wgs84',
- success: (res)=>{
- console.log(res);
- if(res.longitude && res.latitude){
- $api.jump('/pages/user/map?lng='+res.longitude+'&lat='+res.latitude)
- }
- },
- fail:()=>{
- uni.getSetting({
- success: (res) => {
- console.log(res);
- var status = res.authSetting;
- if(!status['scope.userLocation']){
- uni.showModal({
- title:"是否授权当前位置",
- content:"需要获取您的地理位置,请确认授权,否则地图功能将无法使用",
- success:(tip)=>{
- if(tip.confirm){
- uni.openSetting({
- success:(data)=>{
- if(data.authSetting['scope.userLocation']===true){
- uni.showToast({
- title:"授权成功",
- icon:"success",
- duration:1000
- })
- uni.getLocation({
- type: 'wgs84',
- success: (res)=>{
- console.log('当前位置的经度:' + res.longitude);
- console.log('当前位置的纬度:' + res.latitude);
- $api.jump('/pages/user/map?lng='+res.longitude+'&lat='+res.latitude)
- }
- })
- }else{
- uni.showToast({
- title:"授权失败",
- icon:"none",
- duration:1000
- })
- }
- }
- })
- }
- }
- })
- }else{
- uni.getLocation({
- type: 'wgs84',
- success: (res)=>{
- console.log('当前位置的经度:' + res.longitude);
- console.log('当前位置的纬度:' + res.latitude);
- $api.jump('/pages/user/map?lng='+res.longitude+'&lat='+res.latitude)
- }
- })
- }
- },
- fail: (res) => {
- uni.showToast({
- title:"调用授权窗口失败",
- icon:"none",
- duration:1000
- })
- }
- })
- }
- })
- },
- // 删除图片
- deletePic(event) {
- // that.userInfo.imgList.splice(event.index, 1)
- console.log(event)
- if(event.name !== '2') {
- that.info[`fileList${event.name}`] = []
- that[`fileList${event.name}`] = ''
- } else {
- that[`fileList${event.name}`] = ''
- that.info[`fileList${event.name}`].splice(event.index, 1)
- if(that.info[`fileList${event.name}`].length > 0) {
- for(var i=0;i<that.info[`fileList${event.name}`].length;i++) {
- if(i == that.info[`fileList${event.name}`].length -1) {
- that[`fileList${event.name}`] += that.info[`fileList${event.name}`][i].url
- } else {
- that[`fileList${event.name}`] += that.info[`fileList${event.name}`][i].url + ','
- }
- }
- }
- }
- },
- // 新增图片
- async afterRead(event) {
- uni.showLoading({
- title: '上传中',
- mask: true
- })
- console.log(`fileList${event.name}`);
- console.log(this.info[`fileList${event.name}`]);
- let lists = [].concat(event.file)
- let fileListLen = this.info[`fileList${event.name}`].length
- lists.map((item) => {
- this.info[`fileList${event.name}`].push({
- ...item,
- status: 'uploading',
- message: '上传中'
- })
- })
- for (let i = 0; i < lists.length; i++) {
- const result = await this.uploadFilePromise(lists[i].url)
- let item = this.info[`fileList${event.name}`][fileListLen]
- this.info[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
- status: 'success',
- message: '',
- url: result.url
- }))
- fileListLen++
- if(lists.length - 1 == i) {
- uni.hideLoading()
- }
- }
- that[`fileList${event.name}`] = ""
- if(that.info[`fileList${event.name}`].length > 0) {
- for(var i=0;i<that.info[`fileList${event.name}`].length;i++) {
- if(i == that.info[`fileList${event.name}`].length -1) {
- that[`fileList${event.name}`] += that.info[`fileList${event.name}`][i].url
- } else {
- that[`fileList${event.name}`] += that.info[`fileList${event.name}`][i].url + ','
- }
- }
- }
- },
- // 上传图片
- uploadFilePromise(url) {
- return new Promise((resolve, reject) => {
- let a = uni.uploadFile({
- url: $api.config.baseUrl + '/data/api.auth.Center/upload',
- filePath: url,
- name: 'file',
- header: {
- 'content-type': 'application/x-www-form-urlencoded',
- 'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
- 'api-name': 'wxapp'
- },
- formData: {
- user: 'test'
- },
- success: (res) => {
- setTimeout(() => {
- var data = JSON.parse(res.data)
- resolve(data.data)
- }, 1000)
- }
- });
- })
- },
- // 阅读并同意
- checkboxChange(n) {
- that.agree = !that.agree
- },
- settled() {
- uni.showLoading({
- title: '提交中',
- mask: true
- })
- if(!that.info.name) {
- $api.info('请输入船厂名称')
- return
- }
- if(!that.fileList1) {
- $api.info('请上传船厂头像')
- return
- }
- if(!that.addressObj.address) {
- $api.info('请输入船厂地址')
- return
- }
- if(!that.info.contacts) {
- $api.info('请输入联系人')
- return
- }
- if(!that.info.phone) {
- $api.info('请输入联系电话')
- return
- }
- if(!that.info.num_staff) {
- $api.info('请输入船厂人数')
- return
- }
- if(!that.info.introduction) {
- $api.info('请输入船厂简介')
- return
- }
-
- if(!that.fileList2) {
- $api.info('请上传船厂环境')
- return
- }
- if(!that.fileList3) {
- $api.info('请上传营业执照')
- return
- }
- if(!that.info.product_intro) {
- $api.info('请输入产品简介')
- return
- }
- var business_img = ""
-
- if(that.agree) {
- $api.req({
- url: '/data/api.auth.Center/addupshipyard',
- method: 'POST',
- data: {
- name: that.info.name,
- province: that.addressObj.province,
- city: that.addressObj.city,
- area: that.addressObj.area,
- address: that.addressObj.address,
- contact_name: that.info.contacts,
- contact_phone: that.info.phone,
- intro: that.info.introduction,
- longitude: that.addressObj.longitude,
- latitude: that.addressObj.latitude,
- head_img: that.fileList1,
- environment_imgs: that.fileList2,
- business_img: that.fileList3,
- product_intro: that.info.product_intro,
- num_staff: that.info.num_staff,
- id: that.info.id?that.info.id: ''
- }
- }, function(res) {
- uni.hideLoading()
- // $api.info(res.info)
- if(res.code == 1) {
- that.state = 1
- }
- })
- }else {
- uni.hideLoading()
- $api.info('请先阅读并同意《船厂入驻规则》')
-
- }
- },
- edit() {
- that.state = 0
- },
- result() {
- $api.jump('/pages/tabbar/mine/mine',3)
- },
- open() {
- $api.req({
- url: '/data/api.auth.Center/getrule'
- }, function(res) {
- if (res.code == 1) {
- console.log(res);
- uni.setStorageSync('xieyi',res.data.shipyard_join_rule)
- $api.jump('/pages/user/agreement?title=船厂入驻规则')
- }
- })
- },
- isRead() {
- that.showProtocol = false
- that.agree = true
- },
- copy(val) {
- uni.setClipboardData({
- data: val,
- success: function () {
- $api.info('复制成功')
- }
- });
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .content::v-deep {
- background: #F4F4F4;
- padding: 20rpx 30rpx;
- .box {
- width: 100%;
- background: #FFFFFF;
- border-radius: 28rpx;
- padding: 28rpx 20rpx;
- box-sizing: border-box;
- margin-bottom: 16rpx;
- .title {
- font-size: 32rpx;
- color: #222222;
- font-weight: 600;
- line-height: 44px;
- }
- .upload_bg {
- width: 200rpx;
- height: 200rpx;
- background: #F4F4F4;
- border-radius: 20rpx;
- }
- .upload_text {
- font-size: 26rpx;
- font-weight: 400;
- color: #777777;
- line-height: 36rpx;
- padding-top: 20rpx;
- }
- .cell {
- width: 100%;
- padding: 20rpx 0 28rpx;
- border-bottom: 1rpx solid #f4f4f4;
- .left {
- width: 20%;
- font-size: 28rpx;
- color: #222;
- position: relative;
- padding-left: 10rpx;
- }
- .left::before {
- content: "*";
- position: absolute;
- top: 0rpx;
- left: -5rpx;
- color: #FF0D0D;
- font-size: 20rpx;
- }
- .u-input {
- font-size: 28rpx;
- color: #222;
- }
- .img_title {
- font-size: 28rpx;
- color: #444;
- }
- .img_title::before {
- content: "*";
- position: absolute;
- top: 0rpx;
- left: -5rpx;
- color: #FF0D0D;
- font-size: 20rpx;
- }
- .upload_img {
- width: 670rpx;
- height: 404rpx;
- background-color: #fff;
- border-radius: 20rpx;
- margin: 28rpx 0 0;
- padding: 20rpx 0;
- border: 1rpx dashed #e0e0e0;
- }
- .u-upload__wrap {
- display: flex;
- align-items: center !important;
- justify-content: center !important;
- }
- .u-textarea {
- margin: 28rpx auto 0;
- background-color: #f4f4f4;
- border-radius: 28rpx;
- box-sizing: border-box;
- padding: 24rpx;
- width: 610rpx;
- }
- }
- .img_title {
- font-size: 28rpx;
- color: #444;
- padding-left: 10rpx;
- position: relative;
- }
- .img_title::before {
- content: "*";
- position: absolute;
- top: 0rpx;
- left: -5rpx;
- color: #FF0D0D;
- font-size: 20rpx;
- }
- }
- .text {
- font-size: 24rpx;
- color: #9c9c9c;
- }
- .read {
- color: #2a63f3;
- }
- .button {
- width: 100%;
- height: 88rpx;
- background-color: #506dff;
- border-radius: 50rpx;
- box-shadow: 0 4rpx 28rpx 0 rgba(132,123,255,0.4);
- font-size: 40rpx;
- color: #fff;
- margin: 40rpx 0 36rpx;
- }
- .box1 {
- width: 100%;
- // height: 100vh;
- background-color: #fff;
- padding-bottom: 80rpx;
- .u-icon {
- margin-top: 120rpx;
- }
- .box1_img {
- width: 124rpx;
- height: 124rpx;
- margin: 108rpx 0 40rpx;
- }
- .box1_title {
- font-size: 32rpx;
- color: #222;
- margin-bottom: 24rpx;
- padding-top: 40rpx;
- }
- .box1_text {
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 40rpx;
- text-align: center;
- }
- .lianjie {
- width: 570rpx;
- height: 68rpx;
- margin: 46rpx 0 0;
- background: #F7F7F7;
- border-radius: 6rpx;
- border: 1rpx solid #C3C3C3;
- box-sizing: border-box;
- padding: 18rpx 22rpx;
- .lj_text {
- width: 418rpx;
- font-size: 28rpx;
- font-family: SFPro-Regular, SFPro;
- font-weight: 400;
- color: #333333;
- line-height: 32rpx;
- }
-
- }
- .text_blue {
- font-size: 26rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #506DFF;
- line-height: 36rpx;
- }
- .card {
- width: 570rpx;
- margin: 24rpx 0 60rpx;
- background: linear-gradient(270deg, rgba(255,248,245,0) 0%, #FFEFE7 100%);
- box-sizing: border-box;
- padding: 20rpx;
- .icon {
- width: 30rpx;
- height: 24rpx;
- margin-right: 14rpx;
- }
- .card_text {
- font-size: 22rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #444444;
- line-height: 32rpx;
- }
- }
- .label {
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 40rpx;
- }
- .box1_subTitle {
- margin: 12rpx 0;
- font-size: 26rpx;
- color: #999999;
- }
- .btn {
- width: 530rpx;
- height: 88rpx;
- background-color: #506dff;
- color: #fff;
- text-align: center;
- line-height: 88rpx;
- border-radius: 44rpx;
- font-size: 36rpx;
- margin-top: 122rpx;
- }
- }
- }
- </style>
|