card.vue 6.9 KB

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