startFlow.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <web-view
  3. :src="`${webviewServer}/mobile/startFlow?id=${id}&name=${name}&processInstanceId=${processInstanceId}&defaultTitle=${defaultTitle}&authtoken=${authtoken}&longitude=${longitude}&latitude=${latitude}&scanResult=${scanResult}&fromMobile=true`">
  4. </web-view>
  5. </template>
  6. <script>
  7. import webview from './webview'
  8. export default {
  9. mixins: [webview],
  10. data() {
  11. return {
  12. defaultTitle: '',
  13. processInstanceId: '',
  14. id: '',
  15. name: '',
  16. longitude: '',
  17. latitude: '',
  18. scanResult: ''
  19. };
  20. },
  21. onLoad(options) {
  22. this.processInstanceId = options.processInstanceId
  23. this.defaultTitle = options.defaultTitle
  24. this.id = options.id
  25. this.name = options.name
  26. this.getLocation()
  27. if (options.scanCode) this.scanCode()
  28. // console.log('diboot带入的token是',this.authtoken)
  29. },
  30. methods: {
  31. getLocation() {
  32. let that = this
  33. uni.getLocation({
  34. type: 'gcj02',
  35. success: function(res) {
  36. that.longitude = res.longitude
  37. that.latitude = res.latitude
  38. },
  39. fail: function(err) {
  40. console.log('获取位置信息失败', err)
  41. // uni.showToast({
  42. // title: '获取位置信息失败',
  43. // icon: 'none',
  44. // duration: 3000
  45. // });
  46. }
  47. });
  48. },
  49. scanCode() {
  50. let that = this
  51. uni.scanCode({
  52. onlyFromCamera: true,
  53. success: function(res) {
  54. that.scanResult = res.result
  55. }
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. </style>