index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="消息列表" :shadow="0" :showback="true"></tm-menubars>
  4. <div class="dizhi">
  5. <view class="contdz pt-20" v-for="item in addList" :key="item.id">
  6. <view>
  7. <text> {{item.name}}</text>
  8. <text class="ml-40 text-gray text-size-m">{{item.mobile}}</text>
  9. <tm-button class="ml-50" :round="10" theme="gray" size="s">{{item.label}}</tm-button>
  10. </view>
  11. <view class="text-gray text-size-s mt-15">
  12. <text>{{item.region}} {{item.address}}</text>
  13. <image class="fr xiugai" src="/static/img/109.png" mode="widthFix" @click="goRedact(item)"></image>
  14. </view>
  15. </view>
  16. <!-- <view class="contdz pt-20">
  17. <view>
  18. <text>薛定谔</text>
  19. <text class="ml-40 text-gray text-size-m">178****5566</text>
  20. <tm-button class="ml-50" :round="10" theme="gray" size="s">学校</tm-button>
  21. </view>
  22. <view class="text-gray text-size-s mt-15">
  23. <text>江苏省南京市江宁区 淳化街道弘景大道3666号</text>
  24. <image class="fr xiugai" src="/static/img/109.png" mode="widthFix"></image>
  25. </view>
  26. </view>-->
  27. </div>
  28. <tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
  29. <!-- 弹出层消息 -->
  30. <tm-message ref="toast"></tm-message>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. myRequest
  36. } from '@/api/request.js'
  37. export default {
  38. data() {
  39. return {
  40. checked1: false,
  41. checked2: false,
  42. checked3: false,
  43. beizu: '',
  44. addList: []
  45. };
  46. },
  47. onLoad() {
  48. },
  49. created() {
  50. var that = this;
  51. setTimeout(function() {
  52. if (uni.getStorageSync("token") == "") {
  53. uni.redirectTo({
  54. url: "/pages/login/index"
  55. })
  56. }
  57. }, 1000)
  58. this.sys = uni.getSystemInfoSync();
  59. this.getAddList();
  60. },
  61. methods: {
  62. xinjian() {
  63. uni.navigateTo({
  64. url: "/pages/shouhuodi/index",
  65. })
  66. },
  67. // 获取地址列表
  68. getAddList() {
  69. let that = this;
  70. myRequest({
  71. url: '/api/Address/addressList',
  72. method: 'get',
  73. data: that.reqData
  74. }).then(res => {
  75. console.log(res.data);
  76. if (res.data.code == 200) {
  77. that.addList = res.data.data;
  78. } else {
  79. that.$refs.toast.show({
  80. model: 'error',
  81. label: res.data.msg
  82. })
  83. }
  84. })
  85. },
  86. // 编辑地址
  87. goRedact(item) {
  88. uni.navigateTo({
  89. // url: '/pages/shouhuodi/index?data='+data
  90. url: '/pages/shouhuodi/index?id='+item.id
  91. })
  92. }
  93. },
  94. }
  95. </script>
  96. <style lang="scss">
  97. /deep/ .tm-menubars .body {
  98. background-color: #1b1b1b !important;
  99. }
  100. /deep/ .zhuti {
  101. padding: 10px 10px;
  102. }
  103. /deep/ .kuang {
  104. margin: 0 !important;
  105. padding: 0px !important;
  106. }
  107. .sao {
  108. width: 88%;
  109. margin: 0 auto;
  110. margin-top: 30px;
  111. }
  112. .dizhi {
  113. background: #1B1B1B;
  114. }
  115. .xiugai {
  116. width: 18px;
  117. height: 18px;
  118. }
  119. .contdz {
  120. width: 90%;
  121. margin: 0 auto;
  122. border-bottom: 1px solid #303030;
  123. padding-bottom: 15px;
  124. }
  125. </style>