123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <template>
- <view>
- <!-- <view class="text-center text-red bg-white">{{form.remek}}</view> -->
- <view class=" padding">
- <view class=" padding bg">
- <u-form :model="forms" ref="uForm" label-position="top" :label-style='lableStyle'>
- <u-form-item label="本人手机号" :border-bottom='false'>
- <u-input :disabled="true" placeholder="请填写本人手机号" v-model="forms.phone" inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="短信验证码" :border-bottom='false'>
- <view class="flex align-center justify-between" style="width: 100%;">
- <u-input placeholder="请填写(必填)" v-model="forms.code" inputAlign="text-alight:left" />
- <view class="buttons" @tap="getCode">
- {{tips}}
- <!-- <u-button class="buttons" @tap="getCode">{{tips}}</u-button> -->
- </view>
- <u-toast ref="uToast"></u-toast>
- <u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode"
- @change="codeChange"></u-verification-code>
- </view>
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="转让人手机号" :border-bottom='false'>
- <u-input placeholder="请填写(必填) " v-model="forms.phone2" inputAlign="text-alight:left" />
- </u-form-item>
- </u-form>
- </view>
- <view class="margin-top padding bg">
- <u-form :model="forms" ref="uForm" label-position="top" :label-style='lableStyle'>
- <u-form-item label="企业名称" :border-bottom='false'>
- <u-input placeholder="请输入企业名称" :disabled="true" v-model="qiyeInfo.companyName"
- inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="营业地址" :border-bottom='false'>
- <u-input placeholder="请输入营业地址" :disabled="true" v-model="qiyeInfo.companyAddress"
- inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="经营范围" :border-bottom='false'>
- <u-input placeholder="请输入经营范围" :disabled="true" v-model="qiyeInfo.companyScope"
- inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="注册资金(万)" :border-bottom='false'>
- <u-input placeholder="请输入注册资金(万)" :disabled="true" v-model="qiyeInfo.companyRegisteredFund"
- inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="注册时间" :border-bottom='false'>
- <u-input placeholder="请输入注册时间" :disabled="true" v-model="qiyeInfo.createTime"
- inputAlign="text-alight:left" />
- </u-form-item>
- <view class="margin-bottom" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
- <u-form-item label="资质简介" :border-bottom='false'>
- <u-input placeholder="请输入资质简介" :disabled="true" v-model="qiyeInfo.companyDetails"
- inputAlign="text-alight:left" />
- </u-form-item>
- </u-form>
- </view>
- <u-button @click="submit()" class="margin-top" :custom-style="customStyle" shape="square" :hair-line="false">
- 转让
- </u-button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- forms: {
- phone: '',
- phone2: '',
- code: '',
- },
- // disabled: false,
- lableStyle: {
- color: '#000000',
- fontSize: '30upx',
- fontWeight: 'bold'
- },
- customStyle: {
- backgroundColor: '#00B88F',
- color: '#FFFFFF',
- border: 0
- },
- tips: '',
- // refCode: null,
- seconds: 60,
- qiyeInfo: {},
- }
- },
- onLoad(e) {
- this.getQiyeInfo();
- this.forms.phone = uni.getStorageSync('phone')
- },
- onShow() {
- },
- methods: {
- //查询用户企业
- getQiyeInfo() {
- this.$Request.getT('/app/company/selectCompanyByUserId', {
- userId: uni.getStorageSync('userId')
- }).then(res => {
- if (res.code === 0) {
- this.qiyeInfo = res.data
- } else {
- uni.showModal({
- showCancel: false,
- title: '查询失败',
- content: res.msg
- });
- }
- });
- },
- //提交转让
- submit() {
- if (this.forms.phone == '') {
- uni.showToast({
- title: '请输入本人手机号',
- icon: 'none'
- })
- return
- }
- if (this.forms.code == '') {
- uni.showToast({
- title: '请输入验证码',
- icon: 'none'
- })
- return
- }
- if (this.forms.phone2 == '') {
- uni.showToast({
- title: '请输入转让人手机号',
- icon: 'none'
- })
- return
- }
- if (this.forms.phone == this.forms.phone2) {
- uni.showToast({
- title: '请勿转让企业给自己',
- icon: 'none'
- })
- return
- }
- let data = {
- phone: this.forms.phone,
- msg: this.forms.code,
- givePhone: this.forms.phone2
- }
- this.$Request.post('/app/company/giveCompany', data).then(res => {
- if (res.code === 0) {
- // uni.showToast({
- // title: '转让成功'
- // })
- this.forms = {
- phone: '',
- code: '',
- phone2: ''
- }
- this.goOut()
- // this.getQiyeInfo();
- } else {
- uni.showModal({
- showCancel: false,
- title: '提示',
- content: res.msg,
- confirmColor:'#00B88F',
- });
- }
- });
- },
- goOut() {
- let that = this
- uni.removeStorageSync('userName')
- uni.removeStorageSync('avatar')
- uni.removeStorageSync('userId')
- uni.removeStorageSync('token')
- uni.removeStorageSync('phone')
- // uni.removeStorageSync('userType')
- uni.removeStorageSync('zhiFuBaoName')
- uni.removeStorageSync('zhiFuBao')
- uni.removeStorageSync('invitationCode')
- uni.removeStorageSync('unionId')
- uni.removeStorageSync('openId')
- uni.removeStorageSync('isVIP')
- // uni.removeStorageSync('userType')
- uni.setStorageSync('userType',1)
- uni.showToast({
- title: '转让成功,请重新登录!',
- icon: 'none'
- })
- setTimeout(()=>{
- // uni.reLaunch({
- // url:'/pages/public/selectIdentity/selectIdentity'
- // })
- // uni.switchTab({
- // url:'/pages/my/index?out=yes'
- // })
- uni.reLaunch({
- url:'/pages/my/index'
- })
- },1000)
-
- },
- codeChange(text) {
- this.tips = text;
- },
- getCode() {
- if (this.$refs.uCode.canGetCode) {
- // 模拟向后端请求验证码
- uni.showLoading({
- title: '正在获取验证码'
- })
- let str = /^[1][3,5,7,8,9][0-9]{9}$/
- let mobile = this.forms.phone
- if (str.test(mobile) == false) {
- uni.showToast({
- title: '请输入正确的手机号',
- icon: 'none'
- })
- return
- }
- this.$Request.getT('/app/Login/sendMsg/' + mobile + '/forget').then(res => {
- if (res.code === 0) {
- uni.hideLoading();
- // 这里此提示会被this.start()方法中的提示覆盖
- this.$u.toast('验证码已发送');
- // 通知验证码组件内部开始倒计时
- this.$refs.uCode.start();
- } else {
- uni.hideLoading();
- uni.showModal({
- showCancel: false,
- title: '短信发送失败',
- content: res.msg ? res.msg : '请一分钟后再获取验证码'
- });
- }
- });
- } else {
- this.$u.toast('倒计时结束后再发送');
- }
- },
- end() {
- this.$u.toast('倒计时结束');
- },
- start() {
- this.$u.toast('倒计时开始');
- },
- }
- }
- </script>
- <style lang="less" scoped>
- page {
- background-color: #F7F7F7;
- }
- .bg {
- background-color: #FFFFFF;
- border-radius: 24upx;
- }
- .u-input__input {
- color: balck !important;
- }
- .title_btn {
- height: 78upx;
- line-height: 78upx;
- /* background: #f7f7f7; */
- }
- .buttons {
- border: 2upx solid #1A1A1A;
- border-radius: 45upx;
- // padding: 10upx 25upx;
- width: 200rpx;
- height: 60rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|