card.vue 7.3 KB

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