index - 副本.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="container">
  3. <uni-navbar title="新增路线"></uni-navbar>
  4. <view class="box">
  5. <view class="map">
  6. <mapNew></mapNew>
  7. <!-- <map id="map" ref="map" style="height: 713rpx;width: 100%;" @tap="tapMap">
  8. </map> -->
  9. </view>
  10. <view class="reject-box commonBj commonMt">
  11. <view class="reject-box-top">
  12. <view class="top-left">
  13. <image src="../../static/images/path/location.png" mode="widthFix"></image>
  14. <text class="state-text">附近地址</text>
  15. </view>
  16. <view class="top-right">
  17. <u-button class="buttonDd" @click="dot">
  18. 打点</u-button>
  19. </view>
  20. </view>
  21. <view class="reject-box-bottom">
  22. <view class="boxMr">
  23. <view :class="'adrBox ' +(activeIndex===index?'active':'')" v-for="(item,index) in addresData"
  24. @click="changeAddres(index)">
  25. <view class="ml">{{item.name}}</view>
  26. <view class="activeImg" v-if="activeIndex===index"></view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-button @click="submit" class="buttonLang commonMb">确认选择</u-button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. activeIndex: null,
  40. addresData: [{
  41. name: '君子大厦'
  42. },
  43. {
  44. name: '君悦豪庭'
  45. },
  46. {
  47. name: '朝阳区永昌街道惠民社区'
  48. }
  49. ],
  50. }
  51. },
  52. methods: {
  53. changeAddres(index) {
  54. this.activeIndex = index;
  55. },
  56. submit() {
  57. },
  58. dot() {
  59. },
  60. tapMap(e) {
  61. var that = this;
  62. var id = e.currentTarget.id;
  63. var maps = uni.createMapContext(id, this).$getAppMap();
  64. maps.onclick = function(point) {
  65. console.log(point);
  66. // point.iconPath = '/static/btn_loc0.png';
  67. // that.markers = that.markers.concat(point); uni.showToast({
  68. // title: '添加成功',
  69. // icon: 'none'
  70. // });
  71. };
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .reject-box {
  78. margin-bottom: 28rpx;
  79. .reject-box-top {
  80. width: 100%;
  81. height: 69rpx;
  82. background: #7FB5FF;
  83. border-radius: 26rpx 26rpx 0px 0px;
  84. display: flex;
  85. justify-content: space-between;
  86. .top-right {
  87. display: flex;
  88. justify-content: start;
  89. align-items: center;
  90. margin-right: 36rpx;
  91. }
  92. uni-image {
  93. width: 50rpx;
  94. margin-left: 32rpx;
  95. vertical-align: middle;
  96. }
  97. .state-text {
  98. font-size: 26rpx;
  99. font-weight: bold;
  100. color: #FFFFFF;
  101. margin-left: 23rpx;
  102. line-height: 69rpx;
  103. }
  104. }
  105. }
  106. .buttonDd {
  107. width: 134rpx;
  108. height: 45rpx;
  109. background: linear-gradient(0deg, #FFD334 0%, #F59A02 100%);
  110. box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25);
  111. border-radius: 23rpx;
  112. border: 0;
  113. font-size: 26rpx;
  114. font-weight: bold;
  115. color: #FFFFFF;
  116. padding: 0;
  117. text-align: center;
  118. }
  119. .map {
  120. height: 713rpx;
  121. background: #FFFFFF;
  122. border: 2rpx solid #77A8FF;
  123. box-shadow: 0px 2rpx 13rpx 0px rgba(27, 43, 95, 0.25), 0px 0px 24rpx 6rpx rgba(109, 160, 251, 0.6);
  124. border-radius: 28rpx;
  125. }
  126. .reject-box-bottom {
  127. height: 336rpx;
  128. overflow-y: auto;
  129. }
  130. .boxMr {
  131. margin-left: 32rpx;
  132. margin-right: 36rpx;
  133. padding-top: 39rpx;
  134. padding-bottom: 39rpx;
  135. }
  136. .adrBox {
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. height: 86rpx;
  141. font-size: 28rpx;
  142. font-weight: 400;
  143. color: #666666;
  144. }
  145. .active {
  146. background: rgba(73, 91, 147, 0.3);
  147. border-radius: 28rpx;
  148. font-size: 30rpx;
  149. font-weight: bold;
  150. color: #333333;
  151. }
  152. .activeImg {
  153. background: url(../../static/images/path/active.png);
  154. background-size: 100% 100%;
  155. width: 44rpx;
  156. height: 44rpx;
  157. margin-right: 21rpx;
  158. }
  159. .ml {
  160. margin-left: 29rpx;
  161. }
  162. </style>