12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <web-view
- v-if="authtoken"
- :src="dibootUrl">
- </web-view>
- <!-- 测试地址 http://localhost:8080/mobile/pages/flow/flow?redirect=/pages/workflowTask/webviewPages/dealTask&id=cb864164-d638-11ee-b785-00ff0b7e144b&definitionId=system_flow_veh%3A46%3A40240578-d634-11ee-8076-00ff0b7e144b&instId=a7551e2f-d638-11ee-b785-00ff0b7e144b&category=todo&allowDeal=true-->
- </template>
- <script>
- import webview from './webview'
- export default {
- mixins: [webview],
- data() {
- return {
- dibootUrl: '',
- query: {},
- };
- },
- onLoad(query) {
- this.query = query
- this.initData(query)
- },
- watch: {
- authtoken: {
- immediate: false,
- deep: true,
- handler(newVal) {
- this.initData(this.query)
- }
- }
- },
- methods: {
- initData(query) {
- console.log('query', query)
- let urlParams = ''
- for (let key in query) {
- if (key != 'authtoken') {
- urlParams += `&${key}=${query[key]}`
- }
- }
- urlParams = urlParams.replace('&', '?')
- this.dibootUrl = `${this.webviewServer}${urlParams}&authtoken=${this.authtoken}`
- console.log('工作流地址', this.dibootUrl)
-
- window.addEventListener("message", receiveMessage, false);
-
- function receiveMessage(event) {
- console.log('收到消息',event)
- uni.switchTab({
- url: event.data
- })
- }
- },
- getLocation() {
- },
- scanCode() {
- }
- }
- }
- </script>
- <style lang="scss"></style>
|