password-lli.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view style="visibility: hidden;">
  3. <view class="phone-password-lli" :myflag="myflag" :change:myflag="PSLLI.doPasswordlli(password)"></view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: "password-lli",
  9. props: {
  10. password: {
  11. type: [String,Number],
  12. default: ''
  13. }
  14. },
  15. data() {
  16. return {
  17. myflag: 0
  18. };
  19. },
  20. methods: {
  21. lliPassword() {
  22. this.myflag++
  23. },
  24. getPassword(data) {
  25. this.$emit('lli-password',data);
  26. }
  27. }
  28. }
  29. </script>
  30. <script module="PSLLI" lang="renderjs">
  31. export default {
  32. methods: {
  33. doPasswordlli(password) {
  34. if (window.lli) {
  35. this.$ownerInstance.callMethod('getPassword', window.lli.encode(password))
  36. }
  37. }
  38. },
  39. mounted() {
  40. if (window.lli && typeof window.lli.encode === 'function') {
  41. } else {
  42. const script = document.createElement('script')
  43. // #ifdef H5
  44. script.src = '/mdist/static/encode.js'
  45. // #endif
  46. // #ifdef APP-PLUS
  47. script.src = 'static/encode.js'
  48. // #endif
  49. document.head.appendChild(script)
  50. }
  51. },
  52. }
  53. </script>