Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-05-30 15:32:09 +08:00
13 changed files with 77 additions and 80 deletions

View File

@@ -32,30 +32,30 @@ instance.interceptors.request.use(config => {
instance.interceptors.response.use(res => { instance.interceptors.response.use(res => {
if (res.data) { if (res.data) {
if (res.data.code) { uni.hideLoading()
if (res.data.code == 0) { if (res.data.access_token) {
return res.data
} else if (res.data.code === 1) {
uni.showToast({
title: res.data.msg,
duration: 2000,
icon: 'none'
})
return res.data
} else if (res.data.code == 401) {
store.commit("logout");
uni.navigateTo({url: "/pages/login"})
} else {
console.error(res.data.msg || "请求失败!")
return Promise.reject(res.data.msg)
}
} else {
return res.data return res.data
} }
if (res.data.code == 0) {
return res.data
} else if (res.data.code === 1) {
uni.showToast({
title: res.data.msg,
duration: 2000,
icon: 'none'
})
return res.data
} else if (res.data.code == 401) {
store.commit("logout");
uni.navigateTo({url: "/pages/login"})
} else {
console.error(res.data.msg || "请求失败!")
return Promise.reject(res.data.msg)
}
} else { } else {
console.error("服务器异常,请联系管理员!") console.error("服务器异常,请联系管理员!")
return Promise.reject(res.data) return res.data
} }
}, err => { }, err => {
uni.hideLoading() uni.hideLoading()

View File

@@ -26,7 +26,7 @@
<span>照片来源</span> <span>照片来源</span>
</div> </div>
<div class="right"> <div class="right">
<span>{{ photoSource == 1 ? '仅限乡村相册拍摄' : '不限' }}</span> <span>{{ photoSource == 1 ? '仅限工作相册拍摄' : '不限' }}</span>
<image src="./images/right.png" v-if="!id || isAdmin" /> <image src="./images/right.png" v-if="!id || isAdmin" />
</div> </div>
</div> </div>

View File

@@ -65,7 +65,7 @@
export default { export default {
name: 'AlbumDetail', name: 'AlbumDetail',
appName: '乡村相册', appName: '工作相册',
data () { data () {
return { return {
@@ -139,6 +139,8 @@
uni.hideLoading() uni.hideLoading()
if (res.userList && res.userList) { if (res.userList && res.userList) {
this.userId = res.userList[0].openUserId this.userId = res.userList[0].openUserId
} else {
this.$u.toast('该用户未授权')
} }
this.isMore = false this.isMore = false

View File

@@ -10,7 +10,7 @@ import { mapActions } from "vuex"
export default { export default {
name: 'AppCountryAlbum', name: 'AppCountryAlbum',
appName: '乡村相册', appName: '工作相册',
data() { data() {
return { return {

View File

@@ -61,32 +61,26 @@
all: '1', all: '1',
hasIn: '', hasIn: '',
hasOut: '', hasOut: '',
yyyyMM: '',
DD: '',
isShow: false, isShow: false,
isAdmin: false isAdmin: false
} }
}, },
computed: { onLoad (query) {
yyyyMM () {
if (this.date) {
return this.date.substr(0, 8)
}
return ''
},
DD () {
if (this.date) {
return this.date.substr(8)
}
return ''
}
},
created () {
this.isAdmin = !!this.$store.state.user.adminAuthType this.isAdmin = !!this.$store.state.user.adminAuthType
this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
if (query.date) {
this.date = this.$dayjs(query.date).format('YYYY年MM月DD')
this.yyyyMM = this.$dayjs(query.date).format('YYYY年MM月')
this.DD = this.$dayjs(query.date).format('DD')
} else {
this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM月')
this.DD = this.$dayjs(new Date).format('DD')
}
this.getList() this.getList()
this.getTotal() this.getTotal()
}, },
@@ -119,7 +113,10 @@
}, },
onDateChange (e) { onDateChange (e) {
this.date = `${e.year}${e.month}${e.day}` this.date = `${e.year}${e.month > 9 ? e.month : '0' + e.month}${e.day > 9 ? e.day : '0' + e.day}`
this.yyyyMM = `${e.year}${e.month > 9 ? e.month : '0' + e.month}`
this.DD = e.day > 9 ? e.day : '0' + e.day
this.$nextTick(() => { this.$nextTick(() => {
this.getList() this.getList()

View File

@@ -10,7 +10,7 @@
<script> <script>
export default { export default {
name: 'Message', name: 'Message',
appName: '乡村相册', appName: '工作相册',
data () { data () {
return { return {

View File

@@ -10,7 +10,7 @@
</div> </div>
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 1"> <div class="cell-item" hover-class="bg-hover" @click="currIndex = 1">
<div class="cell-item__left"> <div class="cell-item__left">
<h2>仅限乡村相册拍摄</h2> <h2>仅限工作相册拍摄</h2>
</div> </div>
<div class="cell-item__check" :class="[currIndex === 1 ? 'active' : '']"></div> <div class="cell-item__check" :class="[currIndex === 1 ? 'active' : '']"></div>
</div> </div>
@@ -18,7 +18,7 @@
<div class="tips"> <div class="tips">
选择不限后 选择不限后
1. 成员可以同步手机原相机数码相机等拍摄的照片和视频 1. 成员可以同步手机原相机数码相机等拍摄的照片和视频
2. 乡村相册拍摄的照片或者视频会计入考勤保证考勤统计真实性 2. 工作相册拍摄的照片或者视频会计入考勤保证考勤统计真实性
</div> </div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div> <div class="form-btn" hover-class="text-hover" @click="save">保存</div>
</div> </div>

View File

@@ -69,11 +69,11 @@
<scroll-view scroll-y class="album-list__wrapper"> <scroll-view scroll-y class="album-list__wrapper">
<div <div
class="item" class="item"
@click="currIndex = index" @click="albumIndex = index"
v-for="(item, index) in albumList" v-for="(item, index) in albumList"
:key="index" :key="index"
:class="[currIndex === index ? 'active' : '']"> :class="[albumIndex === index ? 'active' : '']">
<image class="checked" v-if="currIndex === index" src="./images/xuanzhong.png" /> <image class="checked" v-if="albumIndex === index" src="./images/xuanzhong.png" />
<image class="icon" v-if="!item.lastPhotoUrl" src="./images/icon.png" /> <image class="icon" v-if="!item.lastPhotoUrl" src="./images/icon.png" />
<image class="img" v-if="item.lastPhotoUrl" :src="item.lastPhotoUrl" mode="aspectFill" /> <image class="img" v-if="item.lastPhotoUrl" :src="item.lastPhotoUrl" mode="aspectFill" />
<div class="item-bottom"> <div class="item-bottom">
@@ -134,6 +134,7 @@
waterSrc: '', waterSrc: '',
albumId: '1', albumId: '1',
albumName: '', albumName: '',
albumIndex: 0,
watermarkList: [], watermarkList: [],
isShowAlbum: false, isShowAlbum: false,
albumList: [], albumList: [],
@@ -314,8 +315,8 @@
}, },
onConfirm () { onConfirm () {
this.albumId = this.albumList[this.currIndex].value this.albumId = this.albumList[this.albumIndex].value
this.albumName = this.albumList[this.currIndex].label this.albumName = this.albumList[this.albumIndex].label
this.isShowAlbum = false this.isShowAlbum = false
}, },
@@ -341,7 +342,12 @@
} }
}) })
this.albumName = this.albumList.filter(v => v.value === this.albumId)[0].label this.albumName = this.albumList.filter((v, index) => {
if (v.value === this.albumId) {
this.albumIndex = index
}
return v.value === this.albumId
})[0].label
} }
}) })
}, },

View File

@@ -4,7 +4,7 @@
<image src="https://pica.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_is.jpg?source=32738c0c" /> <image src="https://pica.zhimg.com/v2-abed1a8c04700ba7d72b45195223e0ff_is.jpg?source=32738c0c" />
<div class="right"> <div class="right">
<h2><AiOpenData v-if="user.wxOpenUserId" type="userName" :openid="user.wxOpenUserId"></AiOpenData></h2> <h2><AiOpenData v-if="user.wxOpenUserId" type="userName" :openid="user.wxOpenUserId"></AiOpenData></h2>
<p>欢迎使用乡村相册</p> <p>欢迎使用工作相册</p>
</div> </div>
</div> </div>
<div class="album-total"> <div class="album-total">

View File

@@ -47,7 +47,7 @@
<div class="info-item info-work"> <div class="info-item info-work">
<div class="info-item__title"> <div class="info-item__title">
<h2>考勤统计</h2> <h2>考勤统计</h2>
<image src="../images/right.png" @click="linkTo('./Attendance')" /> <image src="../images/right.png" @click="linkTo('./Attendance?date=' + date.replace(/年|月/g, '-'))" />
</div> </div>
<div class="info-work__wrapper"> <div class="info-work__wrapper">
<div class="top"> <div class="top">
@@ -102,27 +102,13 @@
list: [], list: [],
isMore: false, isMore: false,
isShow: false, isShow: false,
yyyyMM: '',
DD: '',
attendanceCount: {} attendanceCount: {}
} }
}, },
computed: { computed: {
yyyyMM () {
if (this.date) {
return this.date.substr(0, 8)
}
return ''
},
DD () {
if (this.date) {
return this.date.substr(8)
}
return ''
},
rate () { rate () {
if (!this.attendanceCount.all) { if (!this.attendanceCount.all) {
return '0' return '0'
@@ -134,6 +120,8 @@
mounted () { mounted () {
this.date = this.$dayjs(new Date).format('YYYY年MM月DD') this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
this.yyyyMM = this.$dayjs(new Date).format('YYYY年MM月')
this.DD = this.$dayjs(new Date).format('DD')
this.getPhotoTotal() this.getPhotoTotal()
}, },
@@ -166,7 +154,10 @@
}, },
onDateChange (e) { onDateChange (e) {
this.date = `${e.year}${e.month}${e.day}` this.date = `${e.year}${e.month > 9 ? e.month : '0' + e.month}${e.day > 9 ? e.day : '0' + e.day}`
this.yyyyMM = `${e.year}${e.month > 9 ? e.month : '0' + e.month}`
this.DD = e.day > 9 ? e.day : '0' + e.day
this.$nextTick(() => { this.$nextTick(() => {
this.getPhotoTotal() this.getPhotoTotal()

View File

@@ -14,7 +14,7 @@
export default { export default {
name: 'Tabbar', name: 'Tabbar',
appName: '乡村相册', appName: '工作相册',
data() { data() {
return { return {

View File

@@ -1,22 +1,22 @@
<template> <template>
<div class="Daily" ref="report"> <div class="Daily" ref="report">
<div class="top" @click="linkTo"> <div class="top" @click="linkTo" v-if="isShowUnit">
<span>{{ unit }}</span> <span>{{ unit }}</span>
</div> </div>
<div class="body" @click="linkTo"> <div class="body" @click="linkTo">
<h2>{{ title }}</h2> <h2 v-if="isShowTitle">{{ title }}</h2>
<div class="subtitle">{{ subTitle }}</div> <div class="subtitle" v-if="subTitle">{{ subTitle }}</div>
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="bottom-item__wrapper"> <div class="bottom-item__wrapper">
<div class="bottom-item" @click="linkTo"> <div class="bottom-item" @click="linkTo">
<div class="left"> <div class="left" v-if="isShowReporter">
<label>汇报人</label> <label>汇报人</label>
<span>{{ reporter }}</span> <span>{{ reporter }}</span>
</div> </div>
<i>{{ date }}</i> <i v-if="isShowDate">{{ date }}</i>
</div> </div>
<div class="bottom-item bottom-item__remark" @click="linkTo"> <div class="bottom-item bottom-item__remark" @click="linkTo" v-if="isShowRemark">
<label>总结</label> <label>总结</label>
<span class="">{{ remark }}</span> <span class="">{{ remark }}</span>
</div> </div>

View File

@@ -148,6 +148,7 @@
let formData = new FormData() let formData = new FormData()
formData.append('file', res.tempFiles[0]) formData.append('file', res.tempFiles[0])
this.$http.post('/admin/file/add2?type=image', formData).then(res => { this.$http.post('/admin/file/add2?type=image', formData).then(res => {
console.log(res)
if (res.code === 0) { if (res.code === 0) {
this.richList.push({ this.richList.push({
type: 'img', type: 'img',