card.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="center">
  3. <view class="bg"><image class="imgBox" src="../../static/img/test_bg.png" mode="scaleToFill"></image></view>
  4. <view class="top flex">
  5. <image src="../../static/img/top_bg.png" mode="aspectFill"></image>
  6. <view class="china-font">东宝区红十字会</view>
  7. <view class="english-font">Red Cross Society of Dongbao District Branch</view>
  8. <view class="fgx"></view>
  9. </view>
  10. <view class="buttom flex">
  11. <view class="item flex">
  12. <image class="home_img" src="../../static/img/test_home.png" mode="aspectFill"></image>
  13. <view class="text"><text>荆门市东宝区工业园<br/>新台西路10号</text></view>
  14. </view>
  15. <view class="item flex">
  16. <image class="home_img" src="../../static/img/test_phone.png" mode="aspectFill"></image>
  17. <!-- #ifdef H5 -->
  18. <view class="text"><text class="text1">0724-2382815</text></view>
  19. <!-- #endif -->
  20. <!-- #ifndef H5 -->
  21. <view class="text" @click="uni.makePhoneCall({phoneNumber: '0724-2382815'})"><text>0724-2382815</text></view>
  22. <!-- #endif -->
  23. </view>
  24. <!-- <view class="item flex">
  25. <image class="home_img" src="../../static/img/test_mail.png" mode="aspectFill"></image>
  26. <view class="text"><text>hhshszh20210909@126.com</text></view>
  27. </view> -->
  28. <view class="map">
  29. <!-- <image class="map-box" src="../../static/icon/erweima.jpg"></image> -->
  30. <map class="map-box" id="map" :markers="markers" :scale="scale" :latitude="latitude"
  31. :longitude="longitude" ref="map" :show-location="false"></map>
  32. <view class="map-font flex">
  33. <view class="font-left">东宝区红十字会</view>
  34. <view @click="navigation()" class="font-right"><image src="../../static/img/btn.png" mode="aspectFill"></image></view>
  35. </view>
  36. </view>
  37. <!-- <view class="qrcode">
  38. <image src="../../static/images/qrcode.jpg" mode="aspectFill"></image>
  39. </view> -->
  40. </view>
  41. <uni-popup ref="popup2" type="bottom" @click="close">
  42. <view class="popup_row">
  43. <view class="rows">
  44. <view class="rows-item" @click="toGaodeMap()">高德地图</view>
  45. <view class="rows-item" @click="toBaiduMap()">百度地图</view>
  46. <view class="rows-item" @click="toTengxunMap()">腾讯地图</view>
  47. </view>
  48. </view>
  49. </uni-popup>
  50. </view>
  51. </template>
  52. <script>
  53. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  54. import {
  55. weixindata,
  56. weixinlocation
  57. } from '@/utils/wxAuthorized.js';
  58. export default {
  59. components: {
  60. uniPopup
  61. },
  62. data() {
  63. return {
  64. scale: '12',
  65. longitude: '112.22416', //神农架林区经度,,
  66. latitude: '31.068016', //神农架林区纬度
  67. longitudeNew: '', //当前经度
  68. latitudeNew: '', //当前纬度
  69. addr: '东宝区红十字会',
  70. markers: [{
  71. id: '226',
  72. title: '东宝区红十字会',
  73. iconPath: '/static/img/img10.png',
  74. width: '28',
  75. height: '28',
  76. longitude: '112.22416', //神农架林区经度,
  77. latitude: '31.068016', //神农架林区纬度
  78. }]
  79. };
  80. },
  81. onLoad() {
  82. let obj = this;
  83. this.IndexShare();
  84. uni.getLocation({
  85. type: 'wgs84',
  86. success: res => {
  87. console.log('当前位置的经度:' + res.longitude);
  88. console.log('当前位置的纬度:' + res.latitude);
  89. obj.longitudeNew = res.longitude;
  90. obj.latitudeNew = res.latitude;
  91. },
  92. fail(e) {
  93. console.log('获取位置失败', e);
  94. }
  95. });
  96. },
  97. methods: {
  98. navigation() {
  99. this.$refs.popup2.open();
  100. // uni.openLocation({
  101. // latitude:+latitude,
  102. // longitude:+longitude,
  103. // address:address,
  104. // fail(e){
  105. // console.log(e);
  106. // }
  107. // })
  108. },
  109. toGaodeMap() {
  110. let latitude = this.latitude
  111. let longitude = this.longitude
  112. let address = this.addr
  113. console.log(latitude,longitude,address);
  114. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  115. },
  116. toTengxunMap() {
  117. let latitude = this.latitude
  118. let longitude = this.longitude
  119. let address = this.addr
  120. window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  121. },
  122. toBaiduMap() {
  123. window.location.href=
  124. `http://api.map.baidu.com/marker?location=30.357764,112.218665&title=东宝区红十字会&content=东宝区红十字会&output=html&src=webapp.baidu.openAPIdemo `
  125. },
  126. //分享
  127. IndexShare() {
  128. let obj = this;
  129. let item = {
  130. link: obj.$store.state.baseURL + '/index/#/pages/share/card',// 分享链接
  131. imgUrl: obj.$store.state.baseURL + '/index/static/img/002.png',
  132. desc: '电子名片分享',
  133. title: '东宝区红十字会',
  134. };
  135. console.log('分享加',item)
  136. weixindata(item);
  137. },
  138. }
  139. };
  140. </script>
  141. <style lang="scss">
  142. .center {
  143. border: 20rpx solid #e01a1c;
  144. min-height: 100%;
  145. // min-height: 600px;
  146. }
  147. .flex {
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. }
  152. page {
  153. width: 100%;
  154. height: 100%;
  155. margin: 0;
  156. padding: 0;
  157. }
  158. .bg {
  159. width: 100%;
  160. height: 100%;
  161. position: absolute;
  162. left: 0;
  163. top: 0;
  164. padding: 20rpx;
  165. .imgBox {
  166. width: 100%;
  167. }
  168. }
  169. .top {
  170. flex-direction: column;
  171. width: 100%;
  172. image {
  173. width: 312rpx;
  174. height: 312rpx;
  175. border-color: linear-gradient(0deg, #e01a1c, #e01a1c);
  176. border-radius: 50%;
  177. margin-top: 85rpx;
  178. }
  179. .china-font {
  180. z-index: 0;
  181. width: 100%;
  182. font-size: 62rpx;
  183. padding-left: 20rpx;
  184. letter-spacing: 20rpx;
  185. font-family: Swei Fist Leg CJK SC;
  186. font-weight: bold;
  187. color: #e01a1c;
  188. line-height: 1;
  189. margin-top: 19rpx;
  190. text-align: center;
  191. }
  192. .english-font {
  193. margin-top: 14rpx;
  194. z-index: 0;
  195. letter-spacing: -1.9rpx;
  196. width: 100%;
  197. font-size: 20rpx;
  198. font-weight: bold;
  199. color: #e01a1c;
  200. text-align: center;
  201. }
  202. .fgx {
  203. margin-top: 25rpx;
  204. margin-bottom: 25rpx;
  205. z-index: 0;
  206. width: 625rpx;
  207. border-bottom: 1rpx dashed #e01a1c;
  208. }
  209. }
  210. .buttom {
  211. flex-direction: column;
  212. .item {
  213. z-index: 0;
  214. margin: 0 auto;
  215. margin-top: 20rpx;
  216. width: 532rpx;
  217. border: 1rpx solid #e01a1c;
  218. border-radius: 38rpx;
  219. justify-content: flex-start;
  220. .home_img {
  221. height: 58rpx;
  222. width: 58rpx;
  223. margin: 8rpx 13rpx;
  224. }
  225. .text {
  226. width: 405rpx;
  227. // display: inline-block;
  228. // padding-left: 75rpx;
  229. letter-spacing: 1.2rpx;
  230. font-size: 25rpx;
  231. font-weight: bold;
  232. text-align: center;
  233. // background-color: red;
  234. // .text1 {
  235. // padding-left: 60rpx;
  236. // }
  237. }
  238. }
  239. .map {
  240. margin-top: 25rpx;
  241. margin-bottom: 25rpx;
  242. background-color: #ffffff;
  243. z-index: 0;
  244. width: 517rpx;
  245. border: 2rpx solid #ea3638;
  246. line-height: 0;
  247. .map-box {
  248. width: 513rpx;
  249. height: 513rpx;
  250. background: #ffffff;
  251. }
  252. .map-font {
  253. height: 90rpx;
  254. padding: 0 20rpx;
  255. justify-content: space-between;
  256. .font-left {
  257. font-family: PingFang SC;
  258. font-weight: bold;
  259. font-size: 29rpx;
  260. color: #333333;
  261. line-height: 1;
  262. }
  263. .font-right {
  264. border-radius: 10rpx;
  265. overflow: hidden;
  266. background-color: #1593ff;
  267. image {
  268. width: 120rpx;
  269. height: 45rpx;
  270. }
  271. }
  272. }
  273. }
  274. .qrcode {
  275. width: 517rpx;
  276. image {
  277. width: 517rpx;
  278. margin: 20rpx 0 36rpx;
  279. }
  280. }
  281. }
  282. .popup_row {
  283. width: 100%;
  284. height: 500rpx;
  285. background-color: #FFFFFF;
  286. border-radius: 20rpx 20rpx 0 0;
  287. display: flex;
  288. justify-content: center;
  289. align-items: center;
  290. .rows {
  291. width: 100%;
  292. padding: 0 24rpx;
  293. .rows-item {
  294. height: 80rpx;
  295. line-height: 80rpx;
  296. text-align: center;
  297. width: 100%;
  298. font-size: 32rpx;
  299. color: #303133;
  300. }
  301. }
  302. }
  303. </style>