location.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="container">
  3. <!-- 地图区域 -->
  4. <view class="map">
  5. <map style="width: 100%; height: 100%;" :latitude="latitude" :longitude="longitude" :scale="18"
  6. :markers="covers">
  7. </map>
  8. </view>
  9. <!-- 盒子区域 -->
  10. <view class="box">
  11. <!-- 定位区域 -->
  12. <view class="top">
  13. <view class="left">
  14. <view class="left_title">
  15. 我的位置
  16. </view>
  17. <view class="left_place">
  18. 南昌交通学院食堂
  19. </view>
  20. </view>
  21. <view class="right">
  22. <img src="./imgs/refresh.png">
  23. </view>
  24. </view>
  25. <!-- 拍照区域 -->
  26. <view class="center">
  27. <view class="center_left">
  28. 身份认证(必填)
  29. </view>
  30. <view class="center_right" @click="handlePhoto">
  31. <img src="./imgs/photo.png">
  32. </view>
  33. </view>
  34. <!-- 提示倒计时区域 -->
  35. <view class="bottom">
  36. <view class="button">
  37. 15:05:05 打卡(15分钟内提交打卡)
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. latitude: 39.909,
  48. longitude: 116.39742,
  49. covers: [{
  50. id: 1,
  51. latitude: 39.909,
  52. longitude: 116.39742,
  53. iconPath: '../../static/location.png',
  54. width: 20,
  55. height: 20
  56. }],
  57. imgUrl: ""
  58. };
  59. },
  60. methods: {
  61. // 点击拍照图标回调
  62. handlePhoto() {
  63. uni.chooseImage({
  64. count: 1,
  65. sourceType: ['camera'],
  66. success: (res) => {
  67. console.log(res);
  68. console.log(res.tempFilePaths[0]);
  69. console.log(JSON.stringify(res.tempFilePaths));
  70. // this.imgUrl = JSON.stringify(res.tempFilePaths)
  71. // console.log(this.imgUrl);
  72. uni.navigateTo({
  73. url: "/pages/authentication/authentication"
  74. })
  75. }
  76. });
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .container {
  83. .map {
  84. position: relative;
  85. width: 100vw;
  86. height: 100vh;
  87. }
  88. .box {
  89. position: absolute;
  90. left: 30rpx;
  91. bottom: 30rpx;
  92. width: 690rpx;
  93. height: 387rpx;
  94. .top {
  95. display: flex;
  96. box-sizing: border-box;
  97. padding: 0 30rpx;
  98. width: 690rpx;
  99. height: 123rpx;
  100. border-radius: 14rpx 14rpx 0 0;
  101. background-color: #fff;
  102. .left {
  103. display: flex;
  104. flex-direction: column;
  105. justify-content: space-evenly;
  106. flex: 6;
  107. .left_title {
  108. font-size: 32rpx;
  109. }
  110. .left_place {
  111. font-size: 24rpx;
  112. font-weight: 200;
  113. color: #808080;
  114. }
  115. }
  116. .right {
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. flex: 1;
  121. img {
  122. width: 42rpx;
  123. height: 42rpx;
  124. }
  125. }
  126. }
  127. .center {
  128. display: flex;
  129. box-sizing: border-box;
  130. padding: 0 30rpx;
  131. width: 690rpx;
  132. height: 122rpx;
  133. line-height: 122rpx;
  134. background-color: #fff;
  135. .center_left {
  136. flex: 6;
  137. font-size: 32rpx;
  138. }
  139. .center_right {
  140. flex: 1;
  141. display: flex;
  142. justify-content: center;
  143. align-items: center;
  144. img {
  145. width: 49rpx;
  146. height: 39rpx;
  147. }
  148. }
  149. }
  150. .bottom {
  151. display: flex;
  152. justify-content: center;
  153. align-items: center;
  154. box-sizing: border-box;
  155. padding: 0 30rpx;
  156. width: 690rpx;
  157. height: 140rpx;
  158. border-radius: 0 0 14rpx 14rpx;
  159. background-color: #fff;
  160. .button {
  161. width: 630rpx;
  162. height: 80rpx;
  163. line-height: 80rpx;
  164. border-radius: 16rpx;
  165. text-align: center;
  166. font-size: 32rpx;
  167. color: #fff;
  168. background: linear-gradient(180deg, #00ACFC 0%, #0082FC 100%);
  169. }
  170. }
  171. }
  172. }
  173. </style>