index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. </div>
  17. <tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
  18. <!-- 弹出层消息 -->
  19. <tm-message ref="toast"></tm-message>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. myRequest
  25. } from '@/api/request.js'
  26. export default {
  27. data() {
  28. return {
  29. checked1: false,
  30. checked2: false,
  31. checked3: false,
  32. beizu: '',
  33. addList: []
  34. };
  35. },
  36. onLoad() {
  37. },
  38. created() {
  39. var that = this;
  40. setTimeout(function() {
  41. if (uni.getStorageSync("token") == "") {
  42. uni.redirectTo({
  43. url: "/pages/login/index"
  44. })
  45. }
  46. }, 1000)
  47. this.sys = uni.getSystemInfoSync();
  48. this.getAddList();
  49. },
  50. methods: {
  51. xinjian() {
  52. uni.navigateTo({
  53. url: "/pages/shouhuodi/index",
  54. })
  55. },
  56. // 获取地址列表
  57. getAddList() {
  58. let that = this;
  59. myRequest({
  60. url: '/api/Address/addressList',
  61. method: 'get',
  62. data: that.reqData
  63. }).then(res => {
  64. console.log(res.data);
  65. if (res.data.code == 200) {
  66. that.addList = res.data.data;
  67. } else {
  68. that.$refs.toast.show({
  69. model: 'error',
  70. label: res.data.msg
  71. })
  72. }
  73. })
  74. },
  75. // 编辑地址
  76. goRedact(item) {
  77. uni.navigateTo({
  78. // url: '/pages/shouhuodi/index?data='+data
  79. url: '/pages/shouhuodi/index?id='+item.id
  80. })
  81. }
  82. },
  83. }
  84. </script>
  85. <style lang="scss">
  86. /deep/ .tm-menubars .body {
  87. background-color: #1b1b1b !important;
  88. }
  89. /deep/ .zhuti {
  90. padding: 10px 10px;
  91. }
  92. /deep/ .kuang {
  93. margin: 0 !important;
  94. padding: 0px !important;
  95. }
  96. .sao {
  97. width: 88%;
  98. margin: 0 auto;
  99. margin-top: 30px;
  100. }
  101. .dizhi {
  102. background: #1B1B1B;
  103. }
  104. .xiugai {
  105. width: 18px;
  106. height: 18px;
  107. }
  108. .contdz {
  109. width: 90%;
  110. margin: 0 auto;
  111. border-bottom: 1px solid #303030;
  112. padding-bottom: 15px;
  113. }
  114. </style>