startFlow.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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&restart=${restart}`">
  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. restart:false
  20. };
  21. },
  22. onLoad(options) {
  23. this.processInstanceId = options.processInstanceId
  24. this.defaultTitle = options.defaultTitle
  25. this.id = options.id
  26. this.name = options.name
  27. this.restart = options.restart
  28. this.getLocation()
  29. if (options.scanCode) this.scanCode()
  30. // console.log('diboot带入的token是',this.authtoken)
  31. },
  32. methods: {
  33. getLocation() {
  34. let that = this
  35. uni.getLocation({
  36. type: 'gcj02',
  37. success: function(res) {
  38. that.longitude = res.longitude
  39. that.latitude = res.latitude
  40. },
  41. fail: function(err) {
  42. console.log('获取位置信息失败', err)
  43. // uni.showToast({
  44. // title: '获取位置信息失败',
  45. // icon: 'none',
  46. // duration: 3000
  47. // });
  48. }
  49. });
  50. },
  51. scanCode() {
  52. let that = this
  53. uni.scanCode({
  54. onlyFromCamera: true,
  55. success: function(res) {
  56. that.scanResult = res.result
  57. }
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. </style>