【PT.SCC实名制管理系统】24.10.01 -30天,考勤打卡小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

224 lines
4.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="home">
  3. <!-- 顶部背景 -->
  4. <view class="home-top">
  5. <image class="home-top-bg" src="@/static/image/home/top-bg.png" mode="widthFix"></image>
  6. </view>
  7. <!-- 卡片(地图) -->
  8. <view class="card">
  9. <view @click="openBroadside" class="team">
  10. <view class="change-icon">
  11. <image src="@/static/image/home/change.png" mode="widthFix"></image>
  12. </view>
  13. <view class="project">
  14. 高新区项目一队项目1
  15. </view>
  16. </view>
  17. <view class="map">
  18. <map style="width: 100%; height: 100%" :latitude="latitude" :longitude="longitude" :markers="covers">
  19. </map>
  20. </view>
  21. </view>
  22. <!-- 打卡按钮 -->
  23. <view class="punch-card">
  24. <view class="circle">
  25. <view class="title">拍照打卡</view>
  26. <view class="time">2021-10-10 10:00:00</view>
  27. </view>
  28. </view>
  29. <!-- 签到记录 -->
  30. <div @click="toRecord" class="sign">
  31. <div class="sign-title">
  32. <image class="sign-title-img" src="@/static/image/home/sign.png" mode="widthFix"></image>
  33. <div class="title">打卡记录</div>
  34. </div>
  35. <div class="project">
  36. <text class="project-name">高新区项目一队项目1</text>
  37. <uv-icon name="arrow-right" color="#000"></uv-icon>
  38. </div>
  39. </div>
  40. <!-- tab栏 -->
  41. <tabbar v-if="!broadsideShow" :select="0"></tabbar>
  42. <!-- 侧边栏 -->
  43. <broadside ref="broadside"></broadside>
  44. </view>
  45. </template>
  46. <script>
  47. import tabbar from '../../components/base/tabbar.vue'
  48. import broadside from '../../components/broadside/broadside.vue'
  49. export default {
  50. name: "Home",
  51. components: {
  52. tabbar,
  53. broadside
  54. },
  55. data() {
  56. return {
  57. broadsideShow: false, //是否显示遮罩层
  58. latitude: 39.909,
  59. longitude: 116.39742,
  60. covers: []
  61. }
  62. },
  63. onShow() {
  64. this.getLocation()
  65. },
  66. methods: {
  67. // 跳转签到记录
  68. toRecord() {
  69. uni.navigateTo({
  70. url: "/pages/record/record"
  71. })
  72. },
  73. //打开侧边栏
  74. openBroadside() {
  75. this.$refs.broadside.open()
  76. this.broadsideShow = true;
  77. },
  78. //获取用户位置
  79. getLocation() {
  80. let self = this;
  81. uni.getLocation({
  82. type: 'gcj02',
  83. success: function(res) {
  84. self.longitude = res.longitude;
  85. self.latitude = res.latitude;
  86. self.covers.push({
  87. id : 1,
  88. latitude: res.latitude,
  89. longitude: res.longitude,
  90. iconPath: '/static/image/home/location.png',
  91. width : 30,
  92. height : 30
  93. })
  94. console.log('当前位置的经度:' + res.longitude);
  95. console.log('当前位置的纬度:' + res.latitude);
  96. }
  97. });
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .home {
  104. background: $bg-color;
  105. min-height: 100vh;
  106. // 顶部背景
  107. .home-top {
  108. height: 490rpx;
  109. overflow: hidden;
  110. .home-top-bg {
  111. width: 750rpx;
  112. }
  113. }
  114. // 卡片(地图)
  115. .card {
  116. width: 95%;
  117. margin: -340rpx auto 0rpx auto;
  118. position: relative;
  119. .team {
  120. display: flex;
  121. margin: 15rpx 0rpx;
  122. color: white;
  123. font-size: 34rpx;
  124. .change-icon {
  125. display: flex;
  126. align-items: center;
  127. width: 40rpx;
  128. margin-right: 10rpx;
  129. image {
  130. width: 100%;
  131. }
  132. }
  133. }
  134. .map {
  135. height: 350rpx;
  136. background: $main-color;
  137. border-radius: 20rpx;
  138. overflow: hidden;
  139. }
  140. }
  141. //打卡按钮
  142. .punch-card {
  143. display: flex;
  144. justify-content: center;
  145. margin: 60rpx 0rpx;
  146. .circle {
  147. display: flex;
  148. flex-direction: column;
  149. justify-content: center;
  150. align-items: center;
  151. width: 370rpx;
  152. height: 370rpx;
  153. border-radius: 50%;
  154. background: $main-color;
  155. color: white;
  156. .title {
  157. font-size: 36rpx;
  158. }
  159. .time {
  160. font-size: 30rpx;
  161. margin-top: 20rpx;
  162. }
  163. }
  164. }
  165. // 签到记录
  166. .sign {
  167. display: flex;
  168. flex-wrap: wrap;
  169. width: 90%;
  170. margin: 0rpx auto;
  171. background: white;
  172. border-radius: 15rpx;
  173. box-sizing: border-box;
  174. padding: 30rpx 30rpx 30rpx 20rpx;
  175. box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, .1);
  176. .sign-title {
  177. display: flex;
  178. width: 30%;
  179. .sign-title-img {
  180. width: 40rpx;
  181. margin-right: 15rpx;
  182. }
  183. .title {}
  184. }
  185. .project {
  186. display: flex;
  187. width: 70%;
  188. justify-content: space-between;
  189. .project-name {
  190. color: $main-color;
  191. }
  192. }
  193. }
  194. }
  195. </style>