Browse Source

对接接口

master
前端-胡立永 4 months ago
parent
commit
899c7a88b9
8 changed files with 111 additions and 29 deletions
  1. +1
    -1
      api/api.js
  2. +2
    -1
      components/broadside/broadside.vue
  3. +2
    -2
      mixins/list.js
  4. +2
    -1
      pages/index/center.vue
  5. +6
    -2
      pages/index/index.vue
  6. +20
    -4
      pages/subPack/autonym/autonym.vue
  7. +61
    -10
      pages/subPack/human/human.vue
  8. +17
    -8
      pages/subPack/record/record.vue

+ 1
- 1
api/api.js View File

@ -80,7 +80,7 @@ const config = {
}, },
// 打卡详情列表 // 打卡详情列表
clockList: { clockList: {
url: 'clock/in/log',
url: '/clock/in/log',
method: 'GET', method: 'GET',
}, },
} }


+ 2
- 1
components/broadside/broadside.vue View File

@ -7,7 +7,8 @@
<view class="user-info"> <view class="user-info">
<image :src="userInfo.headImage" mode="widthFix"></image> <image :src="userInfo.headImage" mode="widthFix"></image>
<view class="base"> <view class="base">
<view class="name">{{ userInfo.nickName }}</view>
<view class="name"
v-if="userInfo.auth">{{ userInfo.auth.name }}</view>
<view class="project" <view class="project"
v-if="userInfo.team">{{ userInfo.team.name }}</view> v-if="userInfo.team">{{ userInfo.team.name }}</view>
</view> </view>


+ 2
- 2
mixins/list.js View File

@ -52,9 +52,9 @@ export default {
success(res.result) success(res.result)
this[this.mixinsListKey || 'list'] = res.result.records
this[this.mixinsListKey || 'list'] = res.result.records || res.result
this.total = res.result.total
this.total = res.result.total || res.result.length
} }
}) })
}) })


+ 2
- 1
pages/index/center.vue View File

@ -7,7 +7,8 @@
<image :src="userInfo.headImage" mode="widthFix"></image> <image :src="userInfo.headImage" mode="widthFix"></image>
</div> </div>
<div class="base"> <div class="base">
<div class="user-name">{{ userInfo.nickName }}</div>
<div class="user-name"
v-if="userInfo.auth">{{ userInfo.auth.name }}</div>
<!-- <div class="user-project">高新区项目一队项目1</div> --> <!-- <div class="user-project">高新区项目一队项目1</div> -->
<view class="user-project" <view class="user-project"
v-if="userInfo.team">{{ userInfo.team.name }}</view> v-if="userInfo.team">{{ userInfo.team.name }}</view>


+ 6
- 2
pages/index/index.vue View File

@ -36,7 +36,8 @@
<div class="title">打卡记录</div> <div class="title">打卡记录</div>
</div> </div>
<div class="project"> <div class="project">
<text class="project-name">高新区项目一队项目1</text>
<text class="project-name"
v-if="userInfo.team">{{ userInfo.team.name }}</text>
<uv-icon name="arrow-right" color="#000"></uv-icon> <uv-icon name="arrow-right" color="#000"></uv-icon>
</div> </div>
</div> </div>
@ -52,7 +53,7 @@
<script> <script>
import tabbar from '../../components/base/tabbar.vue' import tabbar from '../../components/base/tabbar.vue'
import broadside from '../../components/broadside/broadside.vue' import broadside from '../../components/broadside/broadside.vue'
import { mapState } from 'vuex'
export default { export default {
name: "Home", name: "Home",
components: { components: {
@ -68,6 +69,9 @@
date : this.$dayjs() date : this.$dayjs()
} }
}, },
computed : {
...mapState(['teamList', 'userInfo']),
},
onLoad() { onLoad() {
this.inter = setInterval(() => { this.inter = setInterval(() => {
this.date = this.$dayjs() this.date = this.$dayjs()


+ 20
- 4
pages/subPack/autonym/autonym.vue View File

@ -15,9 +15,9 @@
</view> </view>
<view class="autonum-form-item"> <view class="autonum-form-item">
<view class="title">证件号码</view> <view class="title">证件号码</view>
<input class="text" v-model="form.card" type="text" />
<input class="text" v-model="form.cardNo" type="text" />
</view> </view>
<div @click="photo" class="btn">
<div @click="submit" class="btn">
立即认证 立即认证
</div> </div>
</view> </view>
@ -38,7 +38,7 @@
return { return {
form: { form: {
name: '', name: '',
card: ''
cardNo: ''
} }
} }
}, },
@ -47,7 +47,23 @@
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/center" url: "/pages/index/center"
}) })
}
},
submit(){
if (this.$utils.verificationAll(this.form, {
name : '请输入姓名',
cardNo : '请输入身份证号',
})) {
return
}
this.$api('authApply', this.form, res => {
if(res.code == 200){
uni.reLaunch({
url: '/pages/index/index'
})
}
})
},
} }
} }
</script> </script>


+ 61
- 10
pages/subPack/human/human.vue View File

@ -10,26 +10,31 @@
<!-- 人脸识别图片 --> <!-- 人脸识别图片 -->
<view class="human-face-img"> <view class="human-face-img">
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/508376c5-64b2-472f-8e25-a2469b632a39.png" mode="widthFix"></image>
<image v-if="!isPhoto"
src="https://tennis-oss.xzaiyp.top/2024-10-22/508376c5-64b2-472f-8e25-a2469b632a39.png" mode="widthFix">
</image>
</view> </view>
<!-- 人脸识别说明 --> <!-- 人脸识别说明 -->
<view class="human-face-desc"> <view class="human-face-desc">
人脸认证仅能由<text class="name">*</text>本人完成验证时请将镜头对准您的脸部
人脸认证仅能由<text class="name">{{ userInfo.auth.name }}</text>本人完成验证时请将镜头对准您的脸部
</view> </view>
<!-- 说明 --> <!-- 说明 -->
<view class="desc"> <view class="desc">
<view class="desc-item"> <view class="desc-item">
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/a0bf2da9-c25a-4d5c-8c77-7318bd86227d.png" mode="widthFix"></image>
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/a0bf2da9-c25a-4d5c-8c77-7318bd86227d.png"
mode="widthFix"></image>
<view class="text">避免遮挡</view> <view class="text">避免遮挡</view>
</view> </view>
<view class="desc-item"> <view class="desc-item">
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/feb72bfb-8271-4e48-8081-d72811543918.png" mode="widthFix"></image>
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/feb72bfb-8271-4e48-8081-d72811543918.png"
mode="widthFix"></image>
<view class="text">光线充足</view> <view class="text">光线充足</view>
</view> </view>
<view class="desc-item"> <view class="desc-item">
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/5fd8a6a7-a13e-44d6-acf1-a7ada94c699d.png" mode="widthFix"></image>
<image src="https://tennis-oss.xzaiyp.top/2024-10-22/5fd8a6a7-a13e-44d6-acf1-a7ada94c699d.png"
mode="widthFix"></image>
<view class="text">正对充足</view> <view class="text">正对充足</view>
</view> </view>
</view> </view>
@ -42,13 +47,33 @@
</template> </template>
<script> <script>
import position from '@/utils/position.js'
import {
mapState
} from 'vuex'
export default { export default {
name: "HumanFace", name: "HumanFace",
data() { data() {
return { return {
isPhoto: false,
form : {
pic : '',
},
} }
}, },
computed: {
...mapState(['teamList', 'userInfo']),
},
onShow() {
let self = this
position.getLocationDetail()
.then(res => {
console.log(res);
self.form.lat = res.position.latitude
self.form.lon = res.position.longitude
self.form.address = res.addressDetail.name
})
},
methods: { methods: {
// //
toHome() { toHome() {
@ -58,19 +83,45 @@
}, },
// //
photo() { photo() {
let self = this
uni.chooseImage({ uni.chooseImage({
count: 1, //9 count: 1, //9
sizeType: ['original', 'compressed'], // sizeType: ['original', 'compressed'], //
sourceType: ['camera '], //
sourceType: ['camera '], //cameraalbum
success: function(res) { success: function(res) {
console.log(JSON.stringify(res.tempFilePaths)); console.log(JSON.stringify(res.tempFilePaths));
// //
uni.navigateTo({
url: "/pages/subPack/punchCard/punchCard"
self.$Oss.ossUpload(res.tempFilePaths[0]).then(url => {
self.form.pic = url
self.submit()
}) })
// uni.navigateTo({
// url: "/pages/subPack/punchCard/punchCard"
// })
} }
}); });
}
},
submit(){
if (this.$utils.verificationAll(this.form, {
lat : '经纬度缺失,请打开GPS',
lon : '经纬度缺失,请打开GPS',
address : '获取地址失败',
pic : '请拍照',
})) {
return
}
this.$api('clock', this.form, res => {
if(res.code == 200){
uni.reLaunch({
url: '/pages/index/index'
})
}
})
},
} }
} }
</script> </script>


+ 17
- 8
pages/subPack/record/record.vue View File

@ -8,10 +8,12 @@
<!-- 签到日历 --> <!-- 签到日历 -->
<view class="sign-calendar main"> <view class="sign-calendar main">
<view class="sign-user-info"> <view class="sign-user-info">
<image class="user-img" src="@/static/logo.png" mode="widthFix"></image>
<image class="user-img" :src="userInfo.headImage" mode="widthFix"></image>
<view class="base"> <view class="base">
<view class="name">李知意</view>
<view class="project">高新区项目一队项目1</view>
<view class="name"
v-if="userInfo.auth">{{ userInfo.auth.name }}</view>
<view class="project"
v-if="userInfo.team">{{ userInfo.team.name }}</view>
</view> </view>
</view> </view>
@ -44,13 +46,13 @@
<view class="today-detail main"> <view class="today-detail main">
<view class="today-detail-title">今日打卡详情</view> <view class="today-detail-title">今日打卡详情</view>
<uv-steps current="8" direction="column" dot> <uv-steps current="8" direction="column" dot>
<uv-steps-item v-for="item in 10" :key="item">
<uv-steps-item v-for="item in list" :key="item.id">
<template #title> <template #title>
<view class="today-detail-main"> <view class="today-detail-main">
<image src="https://pic.vjshi.com/2020-07-21/08385db3a62ba40aaf97bf319b5cae72/00001.jpg?x-oss-process=style/watermark" mode="widthFix"></image>
<image :src="item.pic" mode="widthFix"></image>
<view class="sign-detail"> <view class="sign-detail">
<view class="time">2024-10-09 8:30</view>
<view class="address">长沙市雨花区德思勤城市广场</view>
<view class="time">{{ item.createTime }}</view>
<view class="address">{{ item.address }}</view>
</view> </view>
</view> </view>
</template> </template>
@ -61,6 +63,8 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
import mixinList from '@/mixins/list.js'
/** /**
* 获取任意时间 * 获取任意时间
*/ */
@ -86,6 +90,7 @@
} }
} }
export default { export default {
mixins : [mixinList],
name: "Record", name: "Record",
data() { data() {
return { return {
@ -103,9 +108,13 @@
date: getDate(new Date(), -1).fullDate, date: getDate(new Date(), -1).fullDate,
info: 1 info: 1
} }
]
],
mixinsListApi : 'clockList',
} }
}, },
computed : {
...mapState(['teamList', 'userInfo']),
},
onShow() { onShow() {
this.getCurrentTime() this.getCurrentTime()
}, },


Loading…
Cancel
Save