Commit 27040a15 authored by 张伯涛's avatar 张伯涛

修改

parent 2d4bc7ae
import store from '@/store' import store from '@/store'
const { body } = document const { body } = document
const WIDTH = 992 // refer to Bootstrap's responsive design const WIDTH = 92 // refer to Bootstrap's responsive design
export default { export default {
watch: { watch: {
......
...@@ -8,6 +8,14 @@ export const openCamera = (params) => { ...@@ -8,6 +8,14 @@ export const openCamera = (params) => {
}) })
}) })
} }
// 拍照取相册
export const openCameraStorage = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openCameraStorage', params, res => {
resolve(res)
})
})
}
// 扫码 // 扫码
export const openScan = (params) => { export const openScan = (params) => {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -19,5 +27,6 @@ export const openScan = (params) => { ...@@ -19,5 +27,6 @@ export const openScan = (params) => {
export const WebView = { export const WebView = {
openCamera, openCamera,
openCameraStorage,
openScan openScan
} }
...@@ -3,22 +3,28 @@ ...@@ -3,22 +3,28 @@
<div class="button_row"> <div class="button_row">
<el-button type="primary" @click="handleOpenScan">扫码</el-button> <el-button type="primary" @click="handleOpenScan">扫码</el-button>
<el-button type="primary" @click="handleTakePhotos">拍照</el-button> <el-button type="primary" @click="handleTakePhotos">拍照</el-button>
<el-button type="primary" @click="handleTakePhotosAlbum">拍照取相册</el-button>
</div> </div>
<div class="button_row"> <div class="button_row">
<el-button type="primary" @click="handleOutbound">出库</el-button> <el-button type="primary" @click="handleOutbound">出库</el-button>
<el-button type="primary">入库</el-button> <el-button type="primary">入库</el-button>
</div> </div>
<div>扫码获取:<span>{{scanCode}}</span></div> <div>扫码获取:<span>{{ scanCode }}</span></div>
<div style="margin-top: 50px">拍照获取: <img :src="imgUrlForm.url" class="sidebar-logo"></div>
</div> </div>
</template> </template>
<script> <script>
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import {openCameraStorage} from "@/utils/WebViewContact";
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
return { return {
scanCode: '', scanCode: '',
imgUrlForm: {
}
} }
}, },
created() { created() {
...@@ -35,13 +41,22 @@ export default { ...@@ -35,13 +41,22 @@ export default {
}, },
/** 拍照按钮*/ /** 拍照按钮*/
handleTakePhotos() { handleTakePhotos() {
console.log('调用前',getToken()) console.log('调用前', getToken())
const params = { const params = {
flag: 'openCamera', flag: 'openCamera',
tokenMsg: getToken() tokenMsg: getToken()
} }
this.$WebView.openCamera(params).then(res => { this.$WebView.openCamera(params).then(res => {
console.log('拍照', res) this.imgUrlForm = JSON.parse(res)
})
},
/** 拍照取相册按钮*/
handleTakePhotosAlbum() {
const params = {
tokenMsg: getToken()
}
this.$WebView.openCameraStorage(params).then(res => {
this.imgUrlForm = JSON.parse(res)
}) })
}, },
handleOutbound() { handleOutbound() {
......
...@@ -85,7 +85,7 @@ module.exports = { ...@@ -85,7 +85,7 @@ module.exports = {
// target: `http://117.122.212.91:32012/`, // target: `http://117.122.212.91:32012/`,
// target: `http://192.168.1.31:8082/`, // target: `http://192.168.1.31:8082/`,
// target: `http://192.168.1.12:8082/`, // 孙浩 // target: `http://192.168.1.12:8082/`, // 孙浩
// target: `http://192.168.1.14:8082/`, // target: `http://192.168.1.41:8082/`,
target: `http://49.232.167.247:20014/`, // 线上 target: `http://49.232.167.247:20014/`, // 线上
// target: `http://192.168.1.30:8082/`, // target: `http://192.168.1.30:8082/`,
// changeOrigin: true, // changeOrigin: true,
......
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