Commit 781042c4 authored by sixiaofeng's avatar sixiaofeng

1

parent b56807a9
File deleted
...@@ -1383,6 +1383,12 @@ ...@@ -1383,6 +1383,12 @@
} }
} }
}, },
"@types/downloadjs": {
"version": "1.4.2",
"resolved": "https://registry.nlark.com/@types/downloadjs/download/@types/downloadjs-1.4.2.tgz?cache=0&sync_timestamp=1629708214856&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fdownloadjs%2Fdownload%2F%40types%2Fdownloadjs-1.4.2.tgz",
"integrity": "sha1-ZzTmCEDNjfPw+JN8gOZ+/n3m+IY=",
"dev": true
},
"@types/glob": { "@types/glob": {
"version": "7.1.3", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz",
...@@ -7239,6 +7245,11 @@ ...@@ -7239,6 +7245,11 @@
"integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
"dev": true "dev": true
}, },
"downloadjs": {
"version": "1.4.7",
"resolved": "https://registry.npm.taobao.org/downloadjs/download/downloadjs-1.4.7.tgz",
"integrity": "sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw="
},
"dsbridge": { "dsbridge": {
"version": "3.1.4", "version": "3.1.4",
"resolved": "https://registry.npmjs.org/dsbridge/-/dsbridge-3.1.4.tgz", "resolved": "https://registry.npmjs.org/dsbridge/-/dsbridge-3.1.4.tgz",
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"bitcoinjs-lib": "^5.2.0", "bitcoinjs-lib": "^5.2.0",
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"downloadjs": "^1.4.7",
"dsbridge": "^3.1.4", "dsbridge": "^3.1.4",
"enc-utils": "^3.0.0", "enc-utils": "^3.0.0",
"html2canvas": "^1.3.2", "html2canvas": "^1.3.2",
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
"vuex": "^3.4.0" "vuex": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
"@types/downloadjs": "^1.4.2",
"@types/mockjs": "^1.0.4", "@types/mockjs": "^1.0.4",
"@types/secp256k1": "^4.0.3", "@types/secp256k1": "^4.0.3",
"@types/validator": "^13.6.3", "@types/validator": "^13.6.3",
......
...@@ -6,7 +6,8 @@ export enum PostMsg { ...@@ -6,7 +6,8 @@ export enum PostMsg {
GET_PUB_KEY = 'getPubKey', GET_PUB_KEY = 'getPubKey',
GET_SIGN = 'getSign', GET_SIGN = 'getSign',
GET_USER_INFO = 'getUserInfo', GET_USER_INFO = 'getUserInfo',
FOCUS_USER = 'focusUser' FOCUS_USER = 'focusUser', // 点击成员
GET_OA_SERVER= 'getOaServer' // oaServer
} }
// 员工信息 // 员工信息
......
...@@ -37,7 +37,8 @@ enum BridgeMethods { ...@@ -37,7 +37,8 @@ enum BridgeMethods {
SIGN = 'sign', SIGN = 'sign',
GET_PUBLIC_KEY = 'getPublicKey', GET_PUBLIC_KEY = 'getPublicKey',
REFRESH_COMPANY_STATE = 'refreshCompanyState', REFRESH_COMPANY_STATE = 'refreshCompanyState',
Close = 'close' Close = 'close',
GetOAServer = 'getOAServer'
} }
export function isAppEnv() { export function isAppEnv() {
...@@ -115,6 +116,17 @@ export function close() { ...@@ -115,6 +116,17 @@ export function close() {
} }
/** /**
* 获取oaserver
* @returns
*/
export function getOAServer() {
const data = dsbridge.call(BridgeMethods.GetOAServer, {}, (res) => {
return res
})
return data
}
/**
* 企业联系人详情页面 * 企业联系人详情页面
* @returns * @returns
*/ */
...@@ -170,5 +182,6 @@ export default { ...@@ -170,5 +182,6 @@ export default {
scanCode, scanCode,
openCompanyUserInfo, openCompanyUserInfo,
goBack, goBack,
close close,
getOAServer
} }
...@@ -273,8 +273,8 @@ export default Vue.extend({ ...@@ -273,8 +273,8 @@ export default Vue.extend({
// width: 100% !important; // width: 100% !important;
// } // }
.default-avator { .default-avator {
min-width: 60vw; width: 80vw;
min-height: 60vw; height: 80vw;
// border: 1px solid red; // border: 1px solid red;
} }
.cropper-wrapper { .cropper-wrapper {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from 'vue'
// import { Dialog } from 'vant' // import { Dialog } from 'vant'
import { getUserInfo, goBack, isAppEnv, refreshCompanyState } from '@/util/Bridge' import { getOAServer, getUserInfo, goBack, isAppEnv, refreshCompanyState } from '@/util/Bridge'
import { trim } from '@/util/Common' import { trim } from '@/util/Common'
import { postMessage } from '@/util/PostMessage' import { postMessage } from '@/util/PostMessage'
import { PostMsg } from '@/Interface' import { PostMsg } from '@/Interface'
...@@ -95,7 +95,7 @@ export default Vue.extend({ ...@@ -95,7 +95,7 @@ export default Vue.extend({
name: '', name: '',
IMServer: '', IMServer: '',
nodeServer: '', nodeServer: '',
oaServer: 'http://172.16.101.107:20000', oaServer: '',
// oaServer: '', // oaServer: '',
showServerList: false, showServerList: false,
entId: '' entId: ''
...@@ -111,16 +111,16 @@ export default Vue.extend({ ...@@ -111,16 +111,16 @@ export default Vue.extend({
} }
}, },
async created() { async created() {
// if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
// if (!isAppEnv()) { if (!isAppEnv()) {
// const usrData = await postMessage(PostMsg.GET_USER_INFO) const oa = await postMessage(PostMsg.GET_OA_SERVER)
// this.entId = usrData.data.entId this.oaServer = oa.data
// } else { } else {
// this.entId = JSON.parse(getUserInfo() as string).entId this.oaServer = getOAServer()
// } }
// } else { } else {
// this.entId = '168398222891421696' this.oaServer = 'http://172.16.101.107:20000'
// } }
// console.log(JSON.parse(getUserInfo() as string), this.entId, 'entId') // console.log(JSON.parse(getUserInfo() as string), this.entId, 'entId')
// this.getEntInfo() // this.getEntInfo()
this.$service.common.getServer().then((res: any) => { this.$service.common.getServer().then((res: any) => {
...@@ -176,7 +176,6 @@ export default Vue.extend({ ...@@ -176,7 +176,6 @@ export default Vue.extend({
this.leaderName = '' this.leaderName = ''
// this.$router.push('/team/team-frame') // this.$router.push('/team/team-frame')
await refreshCompanyState() await refreshCompanyState()
goBack()
} else { } else {
this.$toast(data.msg) this.$toast(data.msg)
} }
...@@ -207,3 +206,7 @@ export default Vue.extend({ ...@@ -207,3 +206,7 @@ export default Vue.extend({
<style> <style>
</style> </style>
function getOAServer(): string {
throw new Error('Function not implemented.')
}
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
:loading="loading" :loading="loading"
> >
<!-- 顶部左侧插槽 --> <!-- 顶部左侧插槽 -->
<!-- <div v-if="!fromPc" slot="left"> <div v-if="!fromPc" slot="left">
<app-icon <app-icon
class-name="w-6.5 w-6.5" class-name="w-6.5 w-6.5"
icon-name="left-arrow-white" icon-name="left-arrow-white"
@click="appNavBack()" @click="close"
/> />
</div> --> </div>
<div class="relative w-full h-40 bg-color-primary"> <div class="relative w-full h-40 bg-color-primary">
<!-- 背景图 --> <!-- 背景图 -->
<!-- <img class="w-82 absolute top-0 right-0" src="@/assets/images/header-bg.png" alt=""> --> <!-- <img class="w-82 absolute top-0 right-0" src="@/assets/images/header-bg.png" alt=""> -->
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
import Vue from 'vue' import Vue from 'vue'
import {formatDate} from '@/util/FormatDate' import {formatDate} from '@/util/FormatDate'
import {AcceptJoinDTO} from '@/service/moudles/service.dto' import {AcceptJoinDTO} from '@/service/moudles/service.dto'
import { appNavBack, getSign, close, refreshCompanyState, isAppEnv } from '@/util/Bridge' import { close, refreshCompanyState, isAppEnv } from '@/util/Bridge'
interface QueryInfo extends AcceptJoinDTO { interface QueryInfo extends AcceptJoinDTO {
sig?: string sig?: string
...@@ -129,7 +129,7 @@ export default Vue.extend({ ...@@ -129,7 +129,7 @@ export default Vue.extend({
this.getEntInfo(this.info) this.getEntInfo(this.info)
}, },
methods: { methods: {
appNavBack, close,
async submit() { async submit() {
this.loading = true this.loading = true
const {depId,entId,expiration,hash,inviterId,joinTime,name,oaServer,phone,position,shortPhone} = this.info as AcceptJoinDTO const {depId,entId,expiration,hash,inviterId,joinTime,name,oaServer,phone,position,shortPhone} = this.info as AcceptJoinDTO
...@@ -153,7 +153,6 @@ export default Vue.extend({ ...@@ -153,7 +153,6 @@ export default Vue.extend({
this.$store.commit('acceptJoin', {}) this.$store.commit('acceptJoin', {})
// this.$router.replace('/team/team-frame') // this.$router.replace('/team/team-frame')
await refreshCompanyState() await refreshCompanyState()
close()
}else { }else {
this.$toast(data.msg) this.$toast(data.msg)
} }
......
...@@ -132,12 +132,15 @@ export default Vue.extend({ ...@@ -132,12 +132,15 @@ export default Vue.extend({
} }
let usrId = '' let usrId = ''
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
let usrData = {} as Staff
if (!isAppEnv()) { if (!isAppEnv()) {
const userData = await postMessage(PostMsg.GET_USER_INFO) const result = await postMessage(PostMsg.GET_USER_INFO)
usrId = userData.data.id usrData = result.data
} else { } else {
usrId = JSON.parse(getUserInfo() as string).id usrData = JSON.parse(getUserInfo() as string)
} }
localStorage.setItem('USR_INFO', JSON.stringify(usrData))
usrId = usrData.id
} else { } else {
usrId = userInfoDev.id usrId = userInfoDev.id
} }
......
...@@ -126,20 +126,22 @@ export default Vue.extend({ ...@@ -126,20 +126,22 @@ export default Vue.extend({
} }
let usrId = '' let usrId = ''
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
let usrData = {} as Staff
if (!isAppEnv()) { if (!isAppEnv()) {
const usrData = await postMessage(PostMsg.GET_USER_INFO) const result = await postMessage(PostMsg.GET_USER_INFO)
usrId = usrData.data.id usrData = result.data
this.entId = usrData.data.entId
} else { } else {
usrId = JSON.parse(getUserInfo() as string).id usrData = JSON.parse(getUserInfo() as string)
this.entId = JSON.parse(getUserInfo() as string).entId
} }
localStorage.setItem('USR_INFO', JSON.stringify(usrData))
usrId = usrData.id
this.entId = usrData.entId
} else { } else {
usrId = userInfoDev.id usrId = userInfoDev.id
this.entId = userInfoDev.entId this.entId = userInfoDev.entId
} }
this.getEntInfo() this.getEntInfo()
this.getStaff(usrId) await this.getStaff(usrId)
}, },
computed: { computed: {
isLeader(): boolean { isLeader(): boolean {
...@@ -149,7 +151,7 @@ export default Vue.extend({ ...@@ -149,7 +151,7 @@ export default Vue.extend({
methods: { methods: {
getStaff(id: string) { getStaff(id: string) {
this.loading = true this.loading = true
this.$service.staff.getInfo({ return this.$service.staff.getInfo({
id id
}).then((res: any) => { }).then((res: any) => {
const {data} = res const {data} = res
......
...@@ -70,7 +70,9 @@ import { formatDate } from '@/util/FormatDate' ...@@ -70,7 +70,9 @@ import { formatDate } from '@/util/FormatDate'
import VueQr from 'vue-qr' import VueQr from 'vue-qr'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import { Department } from '@/Interface' import { Department } from '@/Interface'
import { transferFile } from '@/util/TransferFile' // import { transferFile } from '@/util/TransferFile'
// import download from 'downloadjs'
interface JoinInfoType{ interface JoinInfoType{
depId: string depId: string
entId:string entId:string
...@@ -103,17 +105,13 @@ export default Vue.extend({ ...@@ -103,17 +105,13 @@ export default Vue.extend({
'c-button': () => import('@/components/common/c-button.vue'), 'c-button': () => import('@/components/common/c-button.vue'),
VueQr, VueQr,
}, },
async created() { created() {
// console.log(Mock, 'mock') // console.log(Mock, 'mock')
this.joinInfo = this.$store.state.acceptJoin this.joinInfo = this.$store.state.acceptJoin
console.log(this.joinInfo); const urloutput = this.outputUrl(this.joinInfo)
const urloutput = await this.outputUrl(this.joinInfo)
this.qrCodeText = JSON.stringify(this.joinInfo) this.qrCodeText = JSON.stringify(this.joinInfo)
let url = window.location.origin + '/team/confirm-join' let url = window.location.origin + '/team/confirm-join'
this.qrCodeText = `${url}?${urloutput}` this.qrCodeText = `${url}?${urloutput}`
this.dpr()
// this.drawCanvas() // this.drawCanvas()
this.entName = JSON.parse(localStorage.getItem('ENT_INFO') as string).name this.entName = JSON.parse(localStorage.getItem('ENT_INFO') as string).name
console.log(this.joinInfo, 'joinInfo') console.log(this.joinInfo, 'joinInfo')
...@@ -121,7 +119,7 @@ export default Vue.extend({ ...@@ -121,7 +119,7 @@ export default Vue.extend({
}, },
computed: { computed: {
copyText(): string { copyText(): string {
return `我和${this.entName}的小伙伴都在警书等你,用这个专属链接加入我们吧! ${this.qrCodeText}` return `我和${this.entName}的小伙伴都在警书等你,用这个专属链接加入我们吧!\n${this.qrCodeText}`
} }
}, },
methods: { methods: {
...@@ -168,6 +166,7 @@ export default Vue.extend({ ...@@ -168,6 +166,7 @@ export default Vue.extend({
const url = canvas.toDataURL('image/png') const url = canvas.toDataURL('image/png')
// const file = transferFile(url, 'file') // const file = transferFile(url, 'file')
// const imgUrl = URL.createObjectURL(file) // const imgUrl = URL.createObjectURL(file)
// download(file, '邀请码')
this.imgUrl = url this.imgUrl = url
const a =document.createElement('a') const a =document.createElement('a')
const event = new MouseEvent('click') const event = new MouseEvent('click')
......
declare module 'vue-qr' declare module 'vue-qr'
declare module 'downloadjs'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment