From 69a74309ed12cc13f0fa9fb90c5bffad17ade360 Mon Sep 17 00:00:00 2001 From: wjt <1797368093@qq.com> Date: 星期四, 27 六月 2024 13:34:56 +0800 Subject: [PATCH] 问题修改 --- qiye/qiyeIndex/qiyeIndex.vue | 257 +++++++++++++++++--- common/http.interceptor.js | 2 static/qiye/qiehuan.png | 0 pages.json | 7 api/qiye.js | 7 policy/changePhone/changePhone.vue | 32 ++ components/select.vue | 68 +++++ policy/policyApply/perPicker.vue | 2 qiye/switchPhone/switchPhone.vue | 91 +++++++ api/auth.js | 6 policy/policyApply/policyApply.vue | 15 - pages/companyLogin/companyLogin.vue | 72 ++++- qiye/my/my.vue | 28 ++ policy/policyApply/perPage.vue | 88 +++++- 14 files changed, 564 insertions(+), 111 deletions(-) diff --git a/api/auth.js b/api/auth.js index bda0af4..1cd8e49 100644 --- a/api/auth.js +++ b/api/auth.js @@ -35,5 +35,9 @@ } // 鏇存崲鎵嬫満鍙风爜 updatePhone export function updatePhone(data) { - return http.post(`/system/user/profile/updatePhone/${data.phone}`, data); + return http.post(`/system/user/profile/updatePhone/${data.phone}/${data.companyId}`, data); +} +// /system/company/list +export function getCompanyList(data){ + return http.get('/system/company/list',{params: data}, { custom: { loading: true }}); } \ No newline at end of file diff --git a/api/qiye.js b/api/qiye.js index d61ba87..93dd7aa 100644 --- a/api/qiye.js +++ b/api/qiye.js @@ -45,4 +45,9 @@ // 鏃爋rderid export function orderNodeList(data){ return http.get('/enforce/complaint/log/orderNodeList',{params: data}, { custom: { loading: true }}); -} \ No newline at end of file +} + +// /system/company/list +// export function getCompanyList(data){ +// return http.get('/system/company/list',{params: data}, { custom: { loading: true }}); +// } \ No newline at end of file diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 9099a99..70954ca 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -67,7 +67,7 @@ mask: true }) setTimeout(() => { - uni.navigateTo({ + uni.reLaunch({ url: '/pages/index/index' }) }, 900) diff --git a/components/select.vue b/components/select.vue new file mode 100644 index 0000000..6274a88 --- /dev/null +++ b/components/select.vue @@ -0,0 +1,68 @@ +<template> + <u-popup mode="center" :show="show" @close="close" bgColor="white" round="10"> + <view style=" width: 80vw;padding: 32rpx;"> + <view class="title">閫夋嫨鐧诲綍浼佷笟</view> + <u-radio-group iconPlacement="right" v-model="value" placement="column"> + <u-radio v-for="(item,index) in list" :key="index" :label="item.companyName" :name="item.companyId"></u-radio> + </u-radio-group> + <view class="down-button"> + <view> + <u-button shape="circle" @click="close">鍙栨秷</u-button> + </view> + <view> + <u-button shape="circle" color="#1171E0" @click="entery">纭畾</u-button> + </view> + </view> + </view> + </u-popup> +</template> + +<script> + export default { + data() { + return { + value: "", + show: false, + list: [{},{}] + } + }, + methods: { + open(list) { + this.list = list + this.show = true + }, + close() { + uni.removeStorageSync('sessionToken') + this.show = false + }, + entery() { + if(!this.value) { + uni.showToast({ + title: '璇烽�夋嫨浼佷笟', + icon: 'none' + }) + return + } + this.$emit('select', this.value) + } + } + } +</script> + +<style lang="scss" scoped> + .title{ + font-size: 36rpx; + font-weight: 700; + text-align: center; + margin-bottom: 20rpx; + } + .down-button{ + margin-top: 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + &>view{ + width: 45%; + } + } +</style> \ No newline at end of file diff --git a/pages.json b/pages.json index 2894a5e..a625c7a 100644 --- a/pages.json +++ b/pages.json @@ -228,6 +228,13 @@ "navigationBarTitleText" : "", "navigationStyle": "custom" } + }, + { + "path" : "switchPhone/switchPhone", + "style" : + { + "navigationBarTitleText" : "鍒囨崲浼佷笟" + } } ] diff --git a/pages/companyLogin/companyLogin.vue b/pages/companyLogin/companyLogin.vue index b6f8889..24143b6 100644 --- a/pages/companyLogin/companyLogin.vue +++ b/pages/companyLogin/companyLogin.vue @@ -1,7 +1,7 @@ <!-- 浼佷笟鐧诲綍 --> <template> <view class="companylogin"> - <u-navbar title="" :autoBack="true" bgColor="transparent"> + <u-navbar :autoBack="true" bgColor="transparent"> <template slot="center"> </template> @@ -53,13 +53,18 @@ </view> <!-- <u--text text="浼佷笟娉ㄥ唽" type="primary" @click="goRegister"></u--text> --> </view> + <selectVue ref="selectVue" @select="select"></selectVue> </view> </template> <script> // 00钀ュ晢鍔�,01鎵ф硶,02浼佷笟 鍖哄垎涓嶅悓鐨勭櫥闄嗛〉闈� - import { getCode, codeLogin, getInfo } from '@/api/auth.js' + import { getCode, codeLogin, getInfo, getCompanyList } from '@/api/auth.js' + import selectVue from '@/components/select.vue' export default { + components: { + selectVue + }, data() { return { tips: '鑾峰彇楠岃瘉鐮�', @@ -71,7 +76,9 @@ loginToken: '', isSendCode: false, countdownTime: 20, - timer: '' + timer: '', + sessionToken: "", + userInfo: {} } }, onLoad(options) { @@ -162,25 +169,59 @@ }, getInfo() { getInfo().then(val => { - uni.setStorageSync('userInfo', val.data.data) - if(this.form.userType == '02') { - uni.reLaunch({ - url:`/qiye/qiyeIndex/qiyeIndex?id=${val.data.data.deptId}` - }) - } else if(this.form.userType == '01'){ - uni.reLaunch({ - url:`/policy/policyIndex/policyIndex` - }) + // uni.setStorageSync('userInfo', val.data.data) + if(val.data.code === 200) { + this.userInfo = val.data.data + if(this.form.userType == '02') { + // 鑾峰彇浼佷笟 + + this.getCompanyList(val.data.data.phonenumber) + } else if(this.form.userType == '01'){ + uni.setStorageSync('userInfo', val.data.data) + // uni.setStorageSync('sessionToken', this.loginToken) + uni.reLaunch({ + url:`/policy/policyIndex/policyIndex` + }) + } else { + uni.setStorageSync('userInfo', val.data.data) + // uni.setStorageSync('sessionToken', this.loginToken) + uni.reLaunch({ + url:`/policy/policyIndex/policyIndex` + }) + } } else { - uni.reLaunch({ - url:`/policy/policyIndex/policyIndex` + uni.removeStorageSync('sessionToken') + uni.showToast({ + title: val.data.msg, + icon: 'none' }) } + + }).catch(err => { + uni.removeStorageSync('sessionToken') }) }, goRegister() { uni.navigateTo({ url: `/pages/registerCompany/registerCompany` + }) + }, + getCompanyList(companyPhone) { + getCompanyList({companyPhone, companyStatus: 0, checkStatus: 2}).then(val => { + if(val.data.rows.length > 1){ + this.$refs.selectVue.open(val.data.rows) + } else { + uni.setStorageSync('userInfo', this.userInfo) + uni.reLaunch({ + url:`/qiye/qiyeIndex/qiyeIndex?id=${this.userInfo.deptId}` + }) + } + }) + }, + select(event){ + uni.setStorageSync('userInfo', this.userInfo) + uni.reLaunch({ + url:`/qiye/qiyeIndex/qiyeIndex?id=${event}` }) } } @@ -249,4 +290,7 @@ background: #F0F8FF; } } + /deep/ .u-radio { + margin-bottom: 20rpx; + } </style> \ No newline at end of file diff --git a/policy/changePhone/changePhone.vue b/policy/changePhone/changePhone.vue index 88d9645..592dccd 100644 --- a/policy/changePhone/changePhone.vue +++ b/policy/changePhone/changePhone.vue @@ -49,9 +49,11 @@ } }, onLoad(options) { - console.log(options) if(options.code) { this.form.userType = options.code + } + if(options.companyId) { + this.form.companyId = options.companyId } }, onUnload() { @@ -149,13 +151,27 @@ } updatePhone(this.form).then(val => { if(val.data.code == 200) { - uni.showToast({ - title: '淇敼鎴愬姛', - icon: 'none' - }) - setTimeout(() => { - uni.navigateBack() - }, 500) + + if(val.data.data == 1) { + uni.showToast({ + title: '淇敼鎴愬姛锛岃閲嶆柊鐧诲綍', + icon: 'none' + }) + uni.clearStorage() + setTimeout(() => { + uni.reLaunch({ + url: '/pages/companyLogin/companyLogin?code=02' + }) + }, 500) + } else { + uni.showToast({ + title: '淇敼鎴愬姛', + icon: 'none' + }) + setTimeout(() => { + uni.navigateBack() + }, 500) + } } }) diff --git a/policy/policyApply/perPage.vue b/policy/policyApply/perPage.vue index e9f7cca..4f3479b 100644 --- a/policy/policyApply/perPage.vue +++ b/policy/policyApply/perPage.vue @@ -2,12 +2,21 @@ <u-popup mode="button" :safeAreaInsetBottom="false" :show="show" @close="close" @open="open" z-index="8000" bgColor="#fff"> <view class="bg-box"> <view class="title">閫夋嫨闅忚浜哄憳</view> - <scroll-view scroll-y="true" style="height: 600rpx;"> - <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange"> - <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index" - :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`"> - </u-checkbox> - </u-checkbox-group> + <u-search v-model="nickName" @search="enforceList" @clear="clearContent" @confirm="enforceList" @custom="enforceList()"></u-search> + <scroll-view scroll-y="true" style="height: 600rpx;margin-top: 20rpx;"> + <view v-if="checkboxList1.length"> + <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange"> + <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index" + :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`"> + </u-checkbox> + </u-checkbox-group> + </view> + <view class="set-color" v-else> + <view class="set-center"> + <u-icon name="file-text" size="30" color="gray"></u-icon> + <view style="width: 100%;margin-top: 20rpx;">鏆傛棤鏁版嵁</view> + </view> + </view> </scroll-view> <view class="set-flex set-flex-content-between down-options"> <view class="button-per"> @@ -22,13 +31,14 @@ </template> <script> + import { enforceList } from '@/api/policy.js' export default { - props: { - list: { - type: Array, - default: () => [] - } - }, + // props: { + // list: { + // type: Array, + // default: () => [] + // } + // }, data() { return { show: false, @@ -36,18 +46,23 @@ // 鍩烘湰妗堝垪鏁版嵁 checkboxList1: [ ], + nickName: "" } }, watch: { - list: { - handler(n) { - this.checkboxList1 = n - }, - immediate: true - } + // list: { + // handler(n) { + // this.checkboxList1 = n + // }, + // immediate: true + // } }, methods: { + clearContent() { + this.companyName = "" + this.enforceList() + }, checkboxChange(n) { // console.log('change', n); }, @@ -55,13 +70,30 @@ this.show = false }, open(list) { - this.show = true + this.enforceList() }, enteryResult() { - this.$emit('selectValue', this.checkboxValue1) + let list = [] + this.checkboxList1.forEach(item => { + if(this.checkboxValue1.includes(item.userId)) { + list.push({ + peerDeptId: item.dept.deptId, + peerDeptName: item.dept.deptName, + peerId: item.userId, + peerPhone: item.phonenumber, + peerType: 2, + peerUser: item.nickName + }) + } + }) + this.$emit('selectValue', list) this.close() - console.log(44) + }, + enforceList() { + enforceList({nickName: this.nickName}).then(val => { + this.checkboxList1 = val.data.data + }) } } } @@ -96,4 +128,18 @@ padding: 0 32rpx; left: 0; } + .set-color{ + color: gray; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + height: 300rpx; + } + .set-center{ + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + } </style> \ No newline at end of file diff --git a/policy/policyApply/perPicker.vue b/policy/policyApply/perPicker.vue index 1aea242..c84fd10 100644 --- a/policy/policyApply/perPicker.vue +++ b/policy/policyApply/perPicker.vue @@ -53,7 +53,7 @@ this.index = e.detail.value[0] }, companyList() { - companyList({companyName: this.companyName}).then(val => { + companyList({companyName: this.companyName, companyStatus: 0, checkStatus: 2}).then(val => { if(val.data.code == 200){ if(!val.data.rows.length || !val.data.rows){ uni.showToast({ diff --git a/policy/policyApply/policyApply.vue b/policy/policyApply/policyApply.vue index 6a64c28..0561e4d 100644 --- a/policy/policyApply/policyApply.vue +++ b/policy/policyApply/policyApply.vue @@ -339,19 +339,8 @@ this.$refs.perpage.open(this.list) }, selectValue(value) { - this.form.peers = [] - this.list.forEach(item => { - if(value.includes(item.userId)) { - this.form.peers.push({ - peerDeptId: item.dept.deptId, - peerDeptName: item.dept.deptName, - peerId: item.userId, - peerPhone: item.phonenumber, - peerType: 2, - peerUser: item.nickName - }) - } - }) + this.form.peers = value + } } } diff --git a/qiye/my/my.vue b/qiye/my/my.vue index deb344a..eeb3b1e 100644 --- a/qiye/my/my.vue +++ b/qiye/my/my.vue @@ -26,6 +26,13 @@ <text class="change">鎶曡瘔璁板綍</text> </view> <u-icon name="arrow-right"></u-icon> + </view> + <view class="item" @click="switchPhone()" v-if="isShowChange"> + <view class="set-flex"> + <image src="/static/qiye/qiehuan.png" mode="widthFix"></image> + <text class="change">鍒囨崲璐﹀彿</text> + </view> + <u-icon name="arrow-right"></u-icon> </view> <view class="item" @click="goChangePhone()"> <view class="set-flex"> @@ -60,7 +67,7 @@ <script> import tabsCom from '@/qiye/components/bottom.vue' - import { getInfo } from '@/api/auth.js' + import { getInfo, getCompanyList } from '@/api/auth.js' import { company } from '@/api/qiye.js' export default { components: { @@ -71,7 +78,9 @@ activeNumber: 2, msg: {}, src: '/static/policy/header.png', - userPhone: "" + userPhone: "", + companyId: "", + isShowChange: false } }, onShow() { @@ -81,20 +90,31 @@ httoInfo() { getInfo().then(val => { this.userPhone = val.data.data.phonenumber - company(val.data.data.deptId).then(val => { + this.companyId = uni.getStorageSync('companyId') + getCompanyList({companyPhone:val.data.data.phonenumber, companyStatus: 0, checkStatus: 2}).then(val => { + if(val.data.rows.length > 1) { + this.isShowChange = true + } + }) + company(this.companyId).then(val => { this.msg = val.data.data }) }) }, goChangePhone() { uni.navigateTo({ - url: '/policy/changePhone/changePhone?code=02' + url: `/policy/changePhone/changePhone?code=02&companyId=${this.companyId}` }) }, tousu(){ uni.navigateTo({ url: '/qiye/complaint/complaint' }) + }, + switchPhone(){ + uni.navigateTo({ + url: "/qiye/switchPhone/switchPhone" + }) }, logout(){ uni.showModal({ diff --git a/qiye/qiyeIndex/qiyeIndex.vue b/qiye/qiyeIndex/qiyeIndex.vue index 56ea366..8c89017 100644 --- a/qiye/qiyeIndex/qiyeIndex.vue +++ b/qiye/qiyeIndex/qiyeIndex.vue @@ -7,36 +7,48 @@ <view class="font"> <p v-for="(item,index) in list1" class="u-line-1" :key="index">{{item.docTitle}}</p> </view> - <img src="/static/i06.png" class="more" alt="" style="width: 46rpx;height: 46rpx;"/> + <img src="/static/i06.png" class="more" alt="" style="width: 46rpx;height: 46rpx;" /> </view> <view class="wbox"> <view class="name"> {{msg.companyName}} </view> <view class="imgbox"> - <image :src="uqrcodeImage" mode="widthFix" class="qrcode-1"></image> + <image :src="uqrcodeImage" @longpress="saveImage" mode="widthFix" class="qrcode-1"></image> + <view style="color: gray;font-size: 24rpx;text-align: center;">闀挎寜淇濆瓨浜岀淮鐮�</view> </view> - + <img src="/static/qiye/q05.png" style="width: 100%;height: 201rpx;" alt="" /> - + </view> <view style="height: 50rpx;"></view> - <uqrcode :errorCorrectLevel="1" class="hide-canvas" :size="470" sizeUnit="rpx" v-if="companyCode" ref="uqrcode" canvas-id="qrcode" :value="companyCode" :options="{ backgroundColor: '#000000',useDynamicSize: true, areaColor: '#ffffff', foregroundColor: '#ffffff' }"></uqrcode> + <uqrcode :errorCorrectLevel="1" class="hide-canvas" :size="470" sizeUnit="rpx" v-if="companyCode" ref="uqrcode" + canvas-id="qrcode" :value="companyCode" + :options="{ backgroundColor: '#000000',useDynamicSize: true, areaColor: '#ffffff', foregroundColor: '#ffffff' }"> + </uqrcode> <tabsCom :activeNumber.sync="activeNumber"></tabsCom> - + <!-- 缁樺埗鍥剧墖canvas --> + <canvas class="hide-canvas1" canvas-id="canvas" ref="canvas-image"></canvas> </view> </template> <script> import tabsCom from '@/qiye/components/bottom.vue' - import { docList } from '@/api/index.js' - import { company } from '@/api/qiye.js' - import { getInfo as httoInfo} from '@/api/auth.js' + import { + docList + } from '@/api/index.js' + import { + company + } from '@/api/qiye.js' + import { + getInfo as httoInfo + } from '@/api/auth.js' export default { components: { tabsCom }, onShow() { + this.companyId = uni.getStorageSync('companyId') this.httoInfo() }, data() { @@ -44,41 +56,175 @@ activeNumber: 0, companyCode: 'code===', uqrcodeImage: '', - list1:[], - companyId:'', - msg:{} + list1: [], + companyId: '', + msg: {} } }, onReady() { - + }, onLoad(options) { - // if(options.id) { - // this.companyId = options.id||33 - // } - // else { - // this.companyId = uni.getStorageSync('qiyedata').companyId - // } - + + if (options.id && options.id != 'undefined') { + uni.setStorageSync('companyId', options.id) + this.companyId = options.id + } }, methods: { - httoInfo() { - httoInfo().then(val => { - console.log(val.data.data.deptId) - this.companyId = val.data.data.deptId - this.getInfo() + // 灏哹ase64 杞崲涓烘湰鍦板浘鐗� + base64ToImage() { + return new Promise((resolve, reject) => { + try { + var save = wx.getFileSystemManager(); + + var number = Math.random(); + + //淇濆瓨鏈湴鍥剧墖鏂囦欢璺緞锛屼篃鏄粯鍥捐矾寰� + + let filePath = wx.env.USER_DATA_PATH + '/pic' + number + '.png' + save.writeFile({ // 鍐欐枃浠� + filePath, + data: this.uqrcodeImage.slice(22), + encoding: 'base64', + success: (res) => { + wx.getImageInfo({ // 璇诲彇鍥剧墖 + src: filePath, + success: (res) => { + // console.log(res) + if (res?.path) { + resolve(res.path) + } else { + reject(res) + } + }, + error: (res) => { + reject(res) + } + }) + } + }) + } catch (err) { + uni.showToast({ + title: '鑾峰彇澶辫触锛岃绋嶅悗閲嶈瘯', + icon: 'none' + }) + reject(err) + } + }) }, - more1(){ + // 鏂囧瓧鎹㈣ + wrapText(context, text, x, y, maxWidth, lineHeight) { + try{ + var words = text.split(''); + var line = ''; + for (var n = 0; n < words.length; n++) { + var testLine = line + words[n] + ' '; + var metrics = context.measureText(testLine); + var testWidth = metrics.width; + if (testWidth > maxWidth && n > 0) { + console.log(x,y) + context.fillText(line, x, y); + line = words[n] + ' '; + y += lineHeight; + } else { + line = testLine; + } + + if (n === words.length - 1) { + const textWidth = context.measureText(line).width; + // 璁剧疆鏂囨湰鐨剎鍧愭爣浣嶇疆锛屼娇鍏跺眳涓� + const xPosition = (300 - textWidth) / 2 + context.fillText(line, xPosition, y); + } + } + }catch(err) { + uni.showToast({ + title: '杞崲澶辫触锛岃绋嶅悗閲嶈瘯', + icon: 'none' + }) + } + }, + async saveImage() { + try { + const context = uni.createCanvasContext('canvas', this) + const value = await this.base64ToImage() + context.setFillStyle('white'); + context.fillRect(0, 0, 300, 400); + context.drawImage(value, 0, 0, 300, 300) + // 璁$畻鏂囨湰鐨勫搴� + context.setFontSize(20); + const textWidth = context.measureText(this.msg.companyName).width; + // 璁剧疆鏂囨湰鐨剎鍧愭爣浣嶇疆锛屼娇鍏跺眳涓� + const xPosition = (300 - textWidth) / 2 + let position = 0 + if(xPosition > 0) { + position = xPosition + } + context.setFillStyle('#111111'); // 璁剧疆鏂囧瓧棰滆壊涓虹孩鑹� + this.wrapText(context, this.msg.companyName, position, 330, 300, 30) + context.draw(true, () => { + setTimeout(() => { + uni.canvasToTempFilePath({ + canvasId: "canvas", + success: val => { + console.log(val) + const tempFilePath = val.tempFilePath; + uni.saveImageToPhotosAlbum({ + filePath: tempFilePath, + success: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨鎴愬姛', + icon: 'success', + duration: 2000 + }); + }, + fail: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨澶辫触', + icon: 'none' + }); + } + }); + }, + fail: err => { + uni.showToast({ + title: '杞崲鍥剧墖璺緞澶辫触', + icon: 'none' + }); + } + }, this) + }, 1500) + + }) + } catch (err) { + uni.showToast({ + title: '淇濆瓨澶辫触锛岃绋嶅悗閲嶈瘯', + icon: 'none' + }); + } + }, + httoInfo() { + // httoInfo().then(val => { + // // console.log(val.data.data.deptId) + // this.getInfo() + // }) + this.getInfo() + }, + more1() { uni.navigateTo({ url: `/pages/hqzc/list` }) }, getInfo() { - docList({pageNum:1,pageSize:2}).then(val =>{ + docList({ + pageNum: 1, + pageSize: 2 + }).then(val => { let data = val.data.rows - for(let i = 0;i<data.length;i++){ - if(data[i].docTitle.length>17){ + for (let i = 0; i < data.length; i++) { + if (data[i].docTitle.length > 17) { data[i].docTitle = data[i].docTitle.slice(0, 17) + '...' } } @@ -86,15 +232,14 @@ }) company(this.companyId).then(val => { this.msg = val.data.data - this.companyCode = this.msg.companyCode uni.setStorageSync('qiyedata', this.msg) setTimeout(() => { this.$nextTick(() => { this.$refs.uqrcode.toTempFilePath({ - success: res => { - this.uqrcodeImage = res.tempFilePath - } + success: res => { + this.uqrcodeImage = res.tempFilePath + } }); }) }, 500) @@ -103,7 +248,7 @@ // console.log(this.msg.docContent) // getDicts('doc_type').then(val => { // console.log(this.msg.docType) - + // const value = val.data.data.find(item => item.dictValue == this.msg.docType) // this.type = value.dictLabel // }) @@ -114,16 +259,17 @@ </script> <style> - page{ + page { background: #F7F7F7; } </style> <style lang="scss" scoped> - .head{ + .head { width: 100%; height: 518rpx; } - .hqzc{ + + .hqzc { position: absolute; border-radius: 5px; background: #fff; @@ -134,22 +280,26 @@ top: 500rpx; padding: 24rpx; box-sizing: border-box; - .line{ + + .line { width: 2rpx; height: 50rpx; background: #f1f1f1; margin-right: 18rpx; } - .img{ + + .img { width: 76rpx; height: 76rpx; margin-right: 18rpx; } - .more{ + + .more { width: 28rpx; height: 28rpx; } - .font{ + + .font { font-size: 26rpx; color: #4A4E60; margin-right: 50rpx; @@ -157,16 +307,27 @@ // text-align: center; } } - .hide-canvas{ + + .hide-canvas { display: none; } - .wbox{ + + .hide-canvas1 { + position: fixed; + bottom: 12000rpx; + width: 600rpx; + height: 800rpx; + // border: 2rpx solid; + } + + .wbox { background: #fff; border-radius: 5px; padding: 24rpx; box-sizing: border-box; margin: 120rpx 32rpx; - .name{ + + .name { text-align: center; color: #202d44; font-size: 36rpx; @@ -176,16 +337,18 @@ padding-bottom: 20rpx; margin-bottom: 20rpx; } - .imgbox{ + + .imgbox { text-align: center; border-radius: 5rpx; border: 4rpx solid #CCDEFE; padding: 20rpx; width: 420rpx; margin: 0 auto; - + } - .qrcode-1{ + + .qrcode-1 { width: 400rpx; height: 400rpx; } diff --git a/qiye/switchPhone/switchPhone.vue b/qiye/switchPhone/switchPhone.vue new file mode 100644 index 0000000..87c226a --- /dev/null +++ b/qiye/switchPhone/switchPhone.vue @@ -0,0 +1,91 @@ +<template> + <view> + <view style="padding: 32rpx;"> + <u-radio-group iconPlacement="right" v-model="value" placement="column"> + <u-radio v-for="(item,index) in list" :key="index" :label="item.companyName" :name="item.companyId"></u-radio> + </u-radio-group> + <view class="down-button"> + <u-button shape="circle" color="#1171E0" @click="entery">纭畾</u-button> + </view> + </view> + </view> +</template> + +<script> + import { getInfo,getCompanyList } from '@/api/auth.js' + import { company } from '@/api/qiye.js' + export default { + + data() { + return { + list: [], + value: "" + } + }, + onLoad() { + this.getInfo() + }, + methods: { + getInfo(){ + getInfo().then(val => { + if(val.data.code === 200) { + this.value = Number(uni.getStorageSync("companyId")) + this.getCompanyList(val.data.data.phonenumber) + } + }) + + }, + getCompanyList(companyPhone) { + getCompanyList({companyPhone, companyStatus: 0, checkStatus: 2}).then(val => { + this.list = val.data.rows + }) + }, + entery() { + uni.setStorageSync("companyId", this.value) + company(this.value).then(val => { + if(val.data.code == 200) { + uni.setStorageSync('qiyedata', val.data.data) + uni.showToast({ + title: "鍒囨崲鎴愬姛", + icon: 'none' + }) + setTimeout(() => { + uni.navigateBack() + }, 500) + } else { + uni.showToast({ + title: val.data.msg, + icon: 'none' + }) + } + + + }) + } + } + } +</script> + +<style lang="scss" scoped> + .title{ + font-size: 36rpx; + font-weight: 700; + text-align: center; + margin-bottom: 20rpx; + } + .down-button{ + margin-top: 30rpx; + display: flex; + justify-content: space-between; + align-items: center; + position: fixed; + bottom: 0; + width: 100%; + padding: 32rpx; + box-sizing: border-box; + left: 0; + } + /deep/ .u-radio{ + margin-bottom: 40rpx; + } +</style> diff --git a/static/qiye/qiehuan.png b/static/qiye/qiehuan.png new file mode 100644 index 0000000..19d289f --- /dev/null +++ b/static/qiye/qiehuan.png Binary files differ -- Gitblit v1.9.1