card.vue 6.8 KB

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