card.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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号县红十字会</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. // uni.openLocation({
  86. // latitude:+latitude,
  87. // longitude:+longitude,
  88. // address:address,
  89. // fail(e){
  90. // console.log(e);
  91. // }
  92. // })
  93. },
  94. toGaodeMap() {
  95. let latitude = this.latitude
  96. let longitude = this.longitude
  97. let address = this.addr
  98. console.log(latitude,longitude,address);
  99. window.location.href = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=${address}`
  100. },
  101. toTengxunMap() {
  102. let latitude = this.latitude
  103. let longitude = this.longitude
  104. let address = this.addr
  105. window.location.href = `http://apis.map.qq.com/uri/v1/marker?marker=coord:${latitude},${longitude};addr:${address}`;
  106. },
  107. toBaiduMap() {
  108. window.location.href=
  109. `http://api.map.baidu.com/marker?location=30.04796,112.426626&title=江陵县红十字会&content=江陵县红十字会&output=html&src=webapp.baidu.openAPIdemo`
  110. },
  111. //分享
  112. IndexShare() {
  113. let obj = this;
  114. let item = {
  115. link: 'http://jz.red.igxys.com/index/#/pages/share/card',// 分享链接
  116. imgUrl: 'http://jz.red.igxys.com/static/img/002.png',
  117. desc: '电子名片分享',
  118. title: '江陵县红十字会',
  119. };
  120. console.log('分享加',item)
  121. weixindata(item);
  122. },
  123. }
  124. };
  125. </script>
  126. <style lang="scss">
  127. .center {
  128. border: 20rpx solid #e01a1c;
  129. height: 100vh;
  130. // min-height: 600px;
  131. }
  132. .flex {
  133. display: flex;
  134. justify-content: space-between;
  135. align-items: center;
  136. }
  137. page {
  138. width: 100%;
  139. height: 100%;
  140. margin: 0;
  141. padding: 0;
  142. }
  143. .bg {
  144. width: 100%;
  145. height: 100%;
  146. position: absolute;
  147. left: 0;
  148. top: 0;
  149. padding: 20rpx;
  150. .imgBox {
  151. width: 100%;
  152. }
  153. }
  154. .top {
  155. flex-direction: column;
  156. width: 100%;
  157. image {
  158. width: 312rpx;
  159. height: 312rpx;
  160. border-color: linear-gradient(0deg, #e01a1c, #e01a1c);
  161. border-radius: 50%;
  162. margin-top: 85rpx;
  163. }
  164. .china-font {
  165. z-index: 0;
  166. width: 100%;
  167. font-size: 62rpx;
  168. padding-left: 20rpx;
  169. letter-spacing: 20rpx;
  170. font-family: Swei Fist Leg CJK SC;
  171. font-weight: bold;
  172. color: #e01a1c;
  173. line-height: 1;
  174. margin-top: 19rpx;
  175. text-align: center;
  176. }
  177. .english-font {
  178. margin-top: 14rpx;
  179. z-index: 0;
  180. letter-spacing: -1.9rpx;
  181. width: 100%;
  182. font-size: 20rpx;
  183. font-weight: bold;
  184. color: #e01a1c;
  185. text-align: center;
  186. }
  187. .fgx {
  188. margin-top: 25rpx;
  189. z-index: 0;
  190. width: 625rpx;
  191. border-bottom: 1rpx dashed #e01a1c;
  192. }
  193. }
  194. .buttom {
  195. flex-direction: column;
  196. .item {
  197. z-index: 0;
  198. margin: 0 auto;
  199. margin-top: 20rpx;
  200. width: 532rpx;
  201. border: 1rpx solid #e01a1c;
  202. border-radius: 38rpx;
  203. justify-content: flex-start;
  204. .home_img {
  205. height: 58rpx;
  206. width: 58rpx;
  207. margin: 8rpx 13rpx;
  208. }
  209. .text {
  210. display: inline-block;
  211. padding-left: 75rpx;
  212. letter-spacing: 1.2rpx;
  213. font-size: 25rpx;
  214. font-weight: bold;
  215. text-align: center;
  216. .text1 {
  217. padding-left: 60rpx;
  218. }
  219. }
  220. }
  221. .map {
  222. margin-bottom: 25rpx;
  223. margin-top: 25rpx;
  224. background-color: #ffffff;
  225. z-index: 0;
  226. width: 517rpx;
  227. border: 2rpx solid #ea3638;
  228. line-height: 0;
  229. .map-box {
  230. width: 513rpx;
  231. height: 513rpx;
  232. background: #ffffff;
  233. }
  234. .map-font {
  235. height: 90rpx;
  236. padding: 0 20rpx;
  237. justify-content: space-between;
  238. .font-left {
  239. font-family: PingFang SC;
  240. font-weight: bold;
  241. font-size: 29rpx;
  242. color: #333333;
  243. line-height: 1;
  244. }
  245. .font-right {
  246. border-radius: 10rpx;
  247. overflow: hidden;
  248. background-color: #1593ff;
  249. image {
  250. width: 120rpx;
  251. height: 45rpx;
  252. }
  253. }
  254. }
  255. }
  256. .qrcode {
  257. width: 517rpx;
  258. image {
  259. width: 517rpx;
  260. margin: 20rpx 0 36rpx;
  261. }
  262. }
  263. }
  264. .popup_row {
  265. width: 100%;
  266. height: 500rpx;
  267. background-color: #FFFFFF;
  268. border-radius: 20rpx 20rpx 0 0;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. .rows {
  273. width: 100%;
  274. padding: 0 24rpx;
  275. .rows-item {
  276. height: 80rpx;
  277. line-height: 80rpx;
  278. text-align: center;
  279. width: 100%;
  280. font-size: 32rpx;
  281. color: #303133;
  282. }
  283. }
  284. }
  285. </style>