card.vue 6.8 KB

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