index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="page flex-col" style="padding: 20px;text-align: center;">
  3. <view class="group_7 flex-col">
  4. <image class="image_13" referrerpolicy="no-referrer"
  5. src="/static/index/psxhll1soar5dp5wn2jlvvrqvf7b47fqmkea3a0403-f365-4753-82b1-86b4727a2b1e.png" />
  6. <text class="text_11">爱享城</text>
  7. <text class="text_12">ENJOY&nbsp;PATTING</text>
  8. <view class="image-text_6 flex-row justify-between">
  9. <image class="label_1" referrerpolicy="no-referrer"
  10. src="/static/index/psadrazbttmrtxhnxze76fefzf3t4bnn6j65a90f56-ee02-44e1-b656-03bb113cf40b.png" />
  11. <text class="text-group_7">热点资讯资讯 敬请期待!</text>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. userinfo: null,
  21. data: {
  22. _token: "",
  23. uid: 0,
  24. }
  25. }
  26. },
  27. onLoad() {
  28. },
  29. onShow() {
  30. var user = this.$api.getUserinfo();
  31. if (user) {
  32. this.userinfo = user;
  33. this.data.id = user.id;
  34. this.getMhUserinfo();
  35. } else {
  36. this.userinfo = null;
  37. uni.showToast({
  38. title: "请先登录",
  39. icon: "none"
  40. })
  41. setTimeout(function() {
  42. uni.navigateTo({
  43. url: "/pages/lanhu_login/index"
  44. })
  45. }, 1000)
  46. }
  47. },
  48. methods: {
  49. getMhUserinfo() {
  50. var data = new Object();
  51. data.uid = this.data.id;
  52. this.$api
  53. .MhPostModel(data, 'user/info')
  54. .then(res => {
  55. //// console.log('user/info信息', JSON.stringify(res));
  56. if (res.data.code != 1) {
  57. } else {
  58. this.userinfo = res.data.data;
  59. if (this.userinfo.duihuan == 1) {
  60. uni.showModal({
  61. title: '提示',
  62. content: '请进入兑换区复购,恢复预约功能!',
  63. showCancel: false,
  64. success: function(res) {
  65. if (res.confirm) {
  66. uni.navigateTo({
  67. url: '/pages/shop/duihuan'
  68. });
  69. } else if (res.cancel) {
  70. console.log('用户点击取消');
  71. }
  72. }
  73. });
  74. }
  75. this.$api.setUserinfo(res.data.data);
  76. }
  77. })
  78. .catch(err => {
  79. // console.log('request fail', JSON.stringify(err));
  80. });
  81. },
  82. }
  83. }
  84. </script>
  85. <style lang='css'>
  86. @import '../common/common.css';
  87. @import './assets/style/index.rpx.css';
  88. </style>