1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <view>
- <web-view :src="href"></web-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- href: ""
- };
- },
- onLoad(option) {
- // 获取位置
- uni.getLocation({
- type: 'gcj02',
- geocode: true,
- success: (res) => {
- console.log(res.address)
- // console.log('当前位置的经度:' + res.longitude);
- // console.log('当前位置的纬度:' + res.latitude);
- this.$api.workflow_save_location({
- staff_num: uni.getStorageSync('user').staff_num,
- location: JSON.stringify(res)
- }).then((res) => {
- console.log(res.data)
- })
- }
- });
- // #ifndef APP-NVUE
- const eventChannel = this.getOpenerEventChannel();
- // #endif
- // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
- eventChannel.on('acceptDataFromOpenerPage', (data) => {
- // console.log(data)
- uni.setNavigationBarTitle({
- title: data.title
- })
- let mine_code = uni.getStorageSync('mine_code')
- let title = escape(data.title)
- if (mine_code.indexOf('_neiwang') != -1) {
- // 内网
- let link_neiwang = data.url.replace('oa_system.nxmy.com:8011',
- 'oa_system.nxmy.com:8011')
- let url = escape(link_neiwang)
- this.href = "http://oa_system.nxmy.com:8011/oa_login/index_neiwang.html?staff_num=" + uni
- .getStorageSync('user')
- .staff_num + "&url=" + url + "&title=" + title
- } else if (mine_code == "zaoquan") {
- let url = escape(data.url)
-
- this.href = "http://zq.oa.nxmy.com:8011/zq_oa_login?staff_num=" + uni.getStorageSync('user').staff_num + "&url=" + url + "&title=" + title
- } else {
- let url = escape(data.url)
- this.href = "http://oa_system.nxmy.com:8011/oa_login?staff_num=" + uni.getStorageSync(
- 'user')
- .staff_num + "&url=" + url + "&title=" + title
- }
- })
- }
- }
- </script>
- <style lang="scss">
- </style>
|