search.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. new Vue({
  2. el: '#service-search',
  3. components: {
  4. providerItem,
  5. comFooter
  6. },
  7. mixins: [wxJssdkMixin],
  8. data: {
  9. form: {
  10. providersName: ''
  11. },
  12. providerList: []
  13. },
  14. mounted() {
  15. this.getParams()
  16. this.toSearchProvider()
  17. this.setWxConfig((wx) => this.setWxReady(wx))
  18. },
  19. methods: {
  20. getParams() {
  21. this.form.providersName = window.location.search.split('?')[1].split('=')[1]
  22. },
  23. toSearchProvider() {
  24. if (this.form.providersName) {
  25. SettlementService.getProvidersAndInfo(this.form, (res) => {
  26. if (res.data) {
  27. this.providerList = [res.data]
  28. } else {
  29. this.providerList = []
  30. }
  31. })
  32. }
  33. },
  34. onSearch() {
  35. this.toSearchProvider()
  36. },
  37. onCancel() {
  38. this.form.providersName = ''
  39. }
  40. }
  41. })