popup.nvue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="container">
  3. <text>12123321321213312132123132</text>
  4. <!-- <view class="header">
  5. <view class="now-location">
  6. <u-icon name="map" size="36" class="icon"></u-icon>
  7. <view class="text Medium">{{address}}</view>
  8. </view>
  9. <view class="selectType">
  10. <view @click="selectType" class="header-type Regular">{{typeStr}}</view>
  11. <u-icon :style="{transform:(showType?'rotate(180deg)':'')}" name="arrow-down-fill" size="8"
  12. color="#AFB3BF" class="icon"></u-icon>
  13. </view>
  14. <u-picker mode="selector" v-model="showType" @confirm='typeConfirm' confirm-color='#22C572'
  15. :range="typeList" range-key="name" :default-selector="[0]"></u-picker>
  16. </view>
  17. <view class="content2">
  18. <view class="no-enterprise Regular" v-if="enterpriseList.length!=0">
  19. 附近暂无相关企业
  20. </view>
  21. <view class="warp">
  22. <view class="top-line"></view>
  23. <view class="bottom-list-item">
  24. <view class="left"><img src="../../../static/img/location.png" alt=""></view>
  25. <view class="middle">
  26. <view class="title Medium">中天昊元粮库中天昊元粮库</view>
  27. <view class="location Regular">辽宁省营口市鲅鱼圈区xx路108号</view>
  28. </view>
  29. <view class="line"></view>
  30. <view class="right">
  31. <view class="top">
  32. <img src="../../../static/img/location.png" alt="">
  33. </view>
  34. <view class="bottom Regular">500m</view>
  35. </view>
  36. </view>
  37. <view class="bottom-list-item">
  38. <view class="left"><img src="../../../static/img/location.png" alt=""></view>
  39. <view class="middle">
  40. <view class="title Medium">中天昊元粮库中天昊元粮库</view>
  41. <view class="location Regular">辽宁省营口市鲅鱼圈区xx路108号</view>
  42. </view>
  43. <view class="line"></view>
  44. <view class="right">
  45. <view class="top">
  46. <img src="../../../static/img/location.png" alt="">
  47. </view>
  48. <view class="bottom Regular">500m</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view> -->
  53. </view>
  54. </template>
  55. <script>
  56. import amap from '@/js_sdk/js-amap/amap-wx.130.js'
  57. export default {
  58. data() {
  59. return {
  60. address: "黑龙江中天...",
  61. nowLocation: {
  62. longitude: '',
  63. latitude: ''
  64. },
  65. showType: false,
  66. enterpriseList: [],
  67. typeStr: '全部类型',
  68. typeList: [{
  69. name: "全部"
  70. },
  71. {
  72. name: "粮库"
  73. },
  74. {
  75. name: "加工厂"
  76. }
  77. ],
  78. title: 'map',
  79. latitude: 39.909,
  80. longitude: 116.39742,
  81. covers: [{
  82. id: 0,
  83. latitude: 39.9085,
  84. longitude: 116.39747,
  85. iconPath: '../../../static/img/location.png',
  86. }]
  87. }
  88. },
  89. onLoad() {
  90. //获取当前位置
  91. // this.getLocation()
  92. },
  93. methods: {
  94. selectType() {
  95. this.showType = true
  96. },
  97. typeConfirm(e) {
  98. console.log(e)
  99. this.typeStr = this.typeList[e[0]].name
  100. },
  101. getLocation() {
  102. let that = this;
  103. uni.getLocation({
  104. type: 'gcj02',
  105. geocode: true,
  106. success: function(res) {
  107. that.nowLocation.longitude = res.longitude
  108. that.nowLocation.latitude = res.latitude
  109. that.covers[0].longitude = res.longitude
  110. that.covers[0].latitude = res.latitude
  111. let _coverrsData = []
  112. for (let i = 0; i < 50; i++) {
  113. let _obj = {
  114. id: i,
  115. latitude: res.latitude += 0.00150,
  116. longitude: res.longitude + 0.00150,
  117. iconPath: '../../../static/img/location.png',
  118. callout: {
  119. content: '中天昊元粮库',
  120. color: '#333333',
  121. fontSize: 12,
  122. borderRadius: 20,
  123. bgColor: 'white',
  124. display: 'ALWAYS',
  125. },
  126. }
  127. _coverrsData.push(_obj)
  128. }
  129. that.covers = _coverrsData
  130. console.log('获取位置数据:', res);
  131. console.log('当前位置的经度:' + res.longitude);
  132. console.log('当前位置的纬度:' + res.latitude);
  133. //拼接当前定位回显地址
  134. // let _address = res.address
  135. // this.address = _address
  136. }
  137. });
  138. },
  139. markertap(e) {
  140. console.log(e)
  141. uni.showToast({
  142. title: "点击id为" + e.detail.markerId + "的坐标",
  143. icon: 'none',
  144. duration: 2000
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. // .header {
  152. // display: flex;
  153. // padding: 20rpx 35rpx;
  154. // background: white;
  155. // justify-content: space-between;
  156. // align-items: center;
  157. // .selectType {
  158. // display: flex;
  159. // justify-content: center;
  160. // align-items: flex-end;
  161. // .icon {
  162. // position: relative;
  163. // top: -4rpx
  164. // }
  165. // }
  166. // .header-type {
  167. // font-size: 26rpx;
  168. // color: #333333;
  169. // margin-right: 10rpx;
  170. // }
  171. // .now-location {
  172. // display: flex;
  173. // align-items: center;
  174. // .icon {
  175. // margin-right: 10rpx;
  176. // }
  177. // .text {
  178. // font-size: 32rpx;
  179. // color: #333333;
  180. // }
  181. // }
  182. // }
  183. // .content {
  184. // height: calc(100vh - 100px);
  185. // .map {
  186. // width: 100%;
  187. // height: 100%;
  188. // }
  189. // }
  190. // .no-enterprise {
  191. // position: fixed;
  192. // bottom: 20px;
  193. // height: 84rpx;
  194. // width: 94%;
  195. // left: 0;
  196. // right: 0;
  197. // margin: auto;
  198. // background: #FFFFFF;
  199. // font-size: 26rpx;
  200. // color: #333333;
  201. // display: flex;
  202. // justify-content: center;
  203. // align-items: center;
  204. // border-radius: 20rpx;
  205. // }
  206. // .content2 {
  207. // position: fixed;
  208. // bottom: 0;
  209. // width: 100%;
  210. // background: white;
  211. // border-radius: 20px 20px 0 0;
  212. // padding: 37rpx 35rpx 20rpx 35rpx;
  213. // .warp {
  214. // .top-line {
  215. // width: 68rpx;
  216. // height: 8rpx;
  217. // background: #B4B7C3;
  218. // border-radius: 4px;
  219. // content: '';
  220. // display: block;
  221. // position: absolute;
  222. // top: 16rpx;
  223. // left: 0;
  224. // right: 0;
  225. // margin: auto;
  226. // }
  227. // .bottom-list-item {
  228. // display: flex;
  229. // justify-content: space-between;
  230. // align-items: flex-start;
  231. // border-bottom: 1px solid #EEEEEE;
  232. // padding: 20rpx 0;
  233. // .left {
  234. // img {
  235. // width: 102rpx;
  236. // border-radius: 10px;
  237. // background: red;
  238. // }
  239. // }
  240. // .middle {
  241. // position: relative;
  242. // left: -10rpx;
  243. // .title {
  244. // font-size: 32rpx;
  245. // color: #333333;
  246. // margin-bottom: 6rpx;
  247. // }
  248. // .location {
  249. // font-size: 24rpx;
  250. // color: #AFB3BF;
  251. // }
  252. // }
  253. // .line {
  254. // width: 1px;
  255. // height: 80rpx;
  256. // border: 1px solid #EEEEEE;
  257. // }
  258. // .right {
  259. // display: flex;
  260. // flex-direction: column;
  261. // justify-content: center;
  262. // align-items: center;
  263. // img {
  264. // width: 21px;
  265. // }
  266. // .bottom {
  267. // font-size: 24rpx;
  268. // color: #AFB3BF;
  269. // }
  270. // }
  271. // }
  272. // }
  273. // }
  274. </style>