storeaddr.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="tui-safe-area">
  3. <view class="tui-address">
  4. <block v-for="(item,index) in dataList" :key="index">
  5. <tui-list-cell padding="0">
  6. <view class="tui-address-flex">
  7. <view @tap="selectTap" :data-id="item.id" class="tui-address-left">
  8. <view class="tui-address-main">
  9. <view class="tui-address-name">{{item.title}}</view>
  10. </view>
  11. <view class="tui-address-detail">
  12. <text>{{item.province_name}}{{item.city_name}}{{item.district_name}}{{item.region_name}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </tui-list-cell>
  17. </block>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. dataList: [],
  26. where: {
  27. cid: 0,
  28. keyword: '',
  29. priceOrder: '',
  30. salesOrder: '',
  31. news: 0,
  32. page: 1,
  33. limit: 10,
  34. latitude: "",
  35. longitude: ""
  36. },
  37. }
  38. },
  39. onLoad: function(options) {
  40. this.initdataList();
  41. },
  42. onShow: function() {
  43. },
  44. methods: {
  45. selectTap: function(e) {
  46. var id = e.currentTarget.dataset.id;
  47. uni.setStorageSync('order_sid', id);
  48. uni.navigateBack({});
  49. },
  50. initdataList: function() {
  51. var _this = this;
  52. _this.$request.post('store.list', {
  53. samkey: (new Date()).valueOf()
  54. }).then(res => {
  55. if (res.errno == 0) {
  56. _this.dataList = res.data;
  57. } else if (res.errno == 700) {
  58. _this.dataList = null;
  59. }
  60. })
  61. }
  62. },
  63. /**
  64. * 页面相关事件处理函数--监听用户下拉动作
  65. */
  66. onPullDownRefresh: function() {
  67. setTimeout(() => {
  68. uni.stopPullDownRefresh()
  69. }, 200);
  70. },
  71. }
  72. </script>
  73. <style>
  74. .tui-address {
  75. width: 100%;
  76. padding-top: 20rpx;
  77. padding-bottom: 160rpx;
  78. }
  79. .tui-address-flex {
  80. display: flex;
  81. justify-content: space-between;
  82. align-items: center;
  83. }
  84. .tui-address-main {
  85. width: 600rpx;
  86. height: 70rpx;
  87. display: flex;
  88. font-size: 30rpx;
  89. line-height: 86rpx;
  90. padding-left: 30rpx;
  91. }
  92. .tui-address-name {
  93. height: 60rpx;
  94. font-weight: bold;
  95. }
  96. .tui-address-tel {
  97. margin-left: 12rpx;
  98. }
  99. .tui-address-detail {
  100. font-size: 24rpx;
  101. word-break: break-all;
  102. padding-bottom: 25rpx;
  103. padding-left: 25rpx;
  104. padding-right: 120rpx;
  105. }
  106. .tui-address-label {
  107. padding: 5rpx 8rpx;
  108. flex-shrink: 0;
  109. background: #e41f19;
  110. border-radius: 6rpx;
  111. color: #fff;
  112. display: inline-flex;
  113. align-items: center;
  114. justify-content: center;
  115. font-size: 25rpx;
  116. line-height: 25rpx;
  117. transform: scale(0.8);
  118. transform-origin: center center;
  119. margin-right: 6rpx;
  120. }
  121. .tui-address-imgbox {
  122. width: 80rpx;
  123. height: 100rpx;
  124. position: absolute;
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. right: 10rpx;
  129. }
  130. .tui-address-img {
  131. width: 36rpx;
  132. height: 36rpx;
  133. }
  134. .tui-address-new {
  135. width: 100%;
  136. position: fixed;
  137. left: 0;
  138. bottom: 0;
  139. z-index: 999;
  140. padding: 20rpx 25rpx 30rpx;
  141. box-sizing: border-box;
  142. background: #fafafa;
  143. }
  144. .tui-safe-area {
  145. padding-bottom: env(safe-area-inset-bottom);
  146. }
  147. </style>