index.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. 地图
  6. </view>
  7. <view class="two">
  8. 代付
  9. </view>
  10. </view>
  11. </mobile-frame>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. id: '',
  18. user: {},
  19. info: {}
  20. };
  21. },
  22. onLoad: function(e) {
  23. const that = this;
  24. that.$set(that, `id`, e.id || '6343b53f21b24c75ad8dbf7a');
  25. that.watchLogin()
  26. },
  27. onShow: function() {},
  28. methods: {
  29. watchLogin() {
  30. const that = this;
  31. uni.getStorage({
  32. key: 'token',
  33. success: function(res) {
  34. let user = that.$jwt(res.data);
  35. if (user) that.$set(that, `user`, user);
  36. that.searchInfo();
  37. }
  38. })
  39. },
  40. async searchInfo() {
  41. const that = this;
  42. if (that.id) {
  43. let res = await that.$api(`/orderDetail/${that.id}`, 'GET')
  44. if (res.errcode == '0') {
  45. that.$set(that, `info`, res.data);
  46. } else {
  47. uni.showToast({
  48. title: res.errmsg,
  49. icon: 'none'
  50. })
  51. }
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. </style>