card.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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">武汉市江夏区<br>红十字会</view>
  7. <view class="english-font">RED CROSS SOCIETY OF JIANGXIA DISTRICT, WUHAN</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>江夏区卫生健康局5楼<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" @click="uni.makePhoneCall({phoneNumber: '027-87012677'})">027-87012677</view>
  19. <!-- #endif -->
  20. <!-- #ifndef H5 -->
  21. <view class="text" @click="uni.makePhoneCall({phoneNumber: '027-87012677'})"><text>87012677</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>jz_hszh@sina.com</text></view>
  27. </view> -->
  28. <view class="map">
  29. <image class="map-box" src="../../static/img/baseaddr.jpg"></image>
  30. <view class="map-font flex">
  31. <view class="font-left">武汉市江夏区红十字会</view>
  32. <view @click="navigation()" class="font-right"><image src="../../static/img/btn.png" mode="aspectFill"></image></view>
  33. </view>
  34. </view>
  35. <view class="qrcode">
  36. <image src="../../static/images/sharecard.jpg" mode="aspectFill"></image>
  37. </view>
  38. </view>
  39. <uni-popup ref="popup2" type="bottom" @click="close">
  40. <view class="popup_row">
  41. <view class="rows">
  42. <view class="rows-item" @click="toGaodeMap()">高德地图</view>
  43. <view class="rows-item" @click="toBaiduMap()">百度地图</view>
  44. <view class="rows-item" @click="toTengxunMap()">腾讯地图</view>
  45. </view>
  46. </view>
  47. </uni-popup>
  48. </view>
  49. </template>
  50. <script>
  51. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  52. import {
  53. weixindata,
  54. weixinlocation
  55. } from '@/utils/wxAuthorized.js';
  56. export default {
  57. components: {
  58. uniPopup
  59. },
  60. data() {
  61. return {
  62. longitude: '114.316738', //江夏市经度
  63. latitude: '30.353495', //江夏市纬度
  64. longitudeNew: '', //当前经度
  65. latitudeNew: '', //当前纬度
  66. addr: '江夏区红十字会'
  67. };
  68. },
  69. onLoad() {
  70. let obj = this;
  71. this.IndexShare();
  72. uni.getLocation({
  73. type: 'wgs84',
  74. success: res => {
  75. console.log('当前位置的经度:' + res.longitude);
  76. console.log('当前位置的纬度:' + res.latitude);
  77. obj.longitudeNew = res.longitude;
  78. obj.latitudeNew = res.latitude;
  79. },
  80. fail(e) {
  81. console.log('获取位置失败', e);
  82. }
  83. });
  84. },
  85. methods: {
  86. navigation() {
  87. this.$refs.popup2.open();
  88. // uni.openLocation({
  89. // latitude:+latitude,
  90. // longitude:+longitude,
  91. // address:address,
  92. // fail(e){
  93. // console.log(e);
  94. // }
  95. // })
  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.35924,114.323157&title=江夏区红十字会&content=江夏区红十字会&output=html&src=webapp.baidu.openAPIdemo `
  113. },
  114. //分享
  115. IndexShare() {
  116. let obj = this;
  117. let item = {
  118. link: 'http://jxred.igxys.com/index/#/pages/share/card',// 分享链接
  119. imgUrl: '/index/static/img/002.png',
  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. // height: 100vh;
  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. z-index: 0;
  193. width: 625rpx;
  194. border-bottom: 1rpx dashed #e01a1c;
  195. }
  196. }
  197. .buttom {
  198. flex-direction: column;
  199. .item {
  200. z-index: 0;
  201. margin: 0 auto;
  202. margin-top: 20rpx;
  203. width: 532rpx;
  204. border: 1rpx solid #e01a1c;
  205. border-radius: 38rpx;
  206. justify-content: flex-start;
  207. .home_img {
  208. height: 58rpx;
  209. width: 58rpx;
  210. margin: 8rpx 13rpx;
  211. flex-shrink: 0;
  212. }
  213. .text {
  214. display: inline-block;
  215. // padding-left: 75rpx;
  216. padding-right: 38rpx;
  217. letter-spacing: 1.2rpx;
  218. font-size: 25rpx;
  219. font-weight: bold;
  220. text-align: center;
  221. text-align: center;
  222. flex-grow: 1;
  223. .text1 {
  224. padding-left: 60rpx;
  225. }
  226. }
  227. }
  228. .map {
  229. margin-top: 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: 286rpx;
  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>