startFlow.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. },
  29. methods: {
  30. getLocation() {
  31. let that = this
  32. uni.getLocation({
  33. type: 'gcj02',
  34. success: function(res) {
  35. that.longitude = res.longitude
  36. that.latitude = res.latitude
  37. },
  38. fail: function(err) {
  39. console.log('获取位置信息失败', err)
  40. // uni.showToast({
  41. // title: '获取位置信息失败',
  42. // icon: 'none',
  43. // duration: 3000
  44. // });
  45. }
  46. });
  47. },
  48. scanCode() {
  49. let that = this
  50. uni.scanCode({
  51. onlyFromCamera: true,
  52. success: function(res) {
  53. that.scanResult = res.result
  54. }
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss">
  61. </style>