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

This commit is contained in:
aixianling
2022-11-03 18:10:14 +08:00
9 changed files with 147 additions and 65 deletions

View File

@@ -17,6 +17,7 @@
"scope.userLocation": {
"desc": "你的位置信息将用于当前事件发生地点"
}
}
},
"requiredPrivateInfos" : ["getLocation"]
}
}

View File

@@ -17,11 +17,30 @@
</div>
<div class="info-item">
<h2>进场打卡</h2>
<span>{{ info.intoBegintime }} {{ info.intoEndtime }}</span>
<div class="right-time">
<p>{{ info.intoBegintime }} </p>
<p>{{ info.intoEndtime }}</p>
</div>
</div>
<div class="info-item">
<h2>离场打卡</h2>
<span>{{ info.exitBegintime }} {{ info.exitEndtime }}</span>
<div class="right-time">
<p>{{ info.exitBegintime }} </p>
<p>{{ info.exitEndtime }}</p>
</div>
</div>
</div>
</div>
<div class="section" v-if="info.intoClock || info.exitClock">
<h2>打卡信息</h2>
<div class="info-wrapper">
<div class="info-item">
<h2>进场打卡时间</h2>
<span class="omit">{{ info.intoClock.clockTime || '-' }}</span>
</div>
<div class="info-item">
<h2>离场打卡时间</h2>
<span>{{ info.exitClock.clockTime || '-' }}</span>
</div>
</div>
</div>
@@ -37,6 +56,7 @@
</template>
<script>
import { mapActions, mapState } from 'vuex'
var QQMapWX = require('./libs/qqmap-wx-jssdk.js')
export default {
name: 'AppActivity',
@@ -56,6 +76,7 @@
},
computed: {
...mapState(['token']),
isClock () {
if (!this.info.id) {
return false
@@ -67,7 +88,7 @@
const outSTimes = new Date(this.info.exitBegintime.replaceAll('-', '/')).getTime()
const outETimes = new Date(this.info.exitEndtime.replaceAll('-', '/')).getTime()
if (this.info.clockRange > this.distance && (!this.info.intoClock && (times > inSTimes && times < inETimes)) || this.info.exitClock && (times > outSTimes && times < outETimes)) {
if (this.info.clockRange > this.distance && (!this.info.intoClock && (times > inSTimes && times < inETimes)) || !this.info.exitClock && (times > outSTimes && times < outETimes)) {
return true
}
@@ -102,17 +123,31 @@
},
onLoad (query) {
this.id = query.id
if (decodeURIComponent(query.scene)) {
this.id = decodeURIComponent(query.scene)
}
if (query.id) {
this.id = query.id
}
if (this.token) {
this.getInfo()
} else {
this.autoLogin()
}
this.qqmapsdk = new QQMapWX({
key: process.env.NODE_ENV == 'production' ? 'RWWBZ-64BEJ-MVLFJ-FTHLQ-JTR6J-SAB2S' : '3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY'
})
this.$loading()
},
methods: {
...mapActions(['autoLogin']),
getInfo () {
this.$instance.post(`/appactivityinfo/queryDetailById?id=${this.id}`).then(res => {
this.$loading()
this.$instance.post(`/api/appactivityinfo/queryDetailById?id=${this.id}`).then(res => {
if (res.code === 0) {
this.info = res.data
@@ -163,7 +198,7 @@
if (!this.info.exitClock && (times > outSTimes && times < outETimes)) {
type = 1
}
this.$instance.post(`/appactivityinfo/clock`, {
this.$instance.post(`/api/appactivityinfo/clock`, {
address: this.address,
activityId: this.id,
clockTime: this.$dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
@@ -222,7 +257,8 @@
}
})
},
fail: () => {
fail: e => {
console.log(e)
}
})
},
@@ -260,6 +296,7 @@
<style lang="scss" scoped>
.Activity {
padding-top: 16px;
padding-bottom: 80px;
div {
box-sizing: border-box;
@@ -303,13 +340,15 @@
font-size: 28px;
}
span {
span, p {
flex: 1;
color: #333333;
font-size: 28px;
text-align: justify;
}
p {}
.omit {
overflow: hidden;
text-overflow: ellipsis;
@@ -337,7 +376,7 @@
}
.signin {
margin-top: 120rpx;
margin-top: 60px;
text-align: center;
p {

View File

@@ -1,13 +1,13 @@
<template>
<div class="home">
<div class="header" :class="[isFixed ? 'header-active' : '']">
<!-- <div class="header" :class="[isFixed ? 'header-active' : '']">
<div class="status-bar" :style="{height: statusBarHeight + 'px'}"></div>
<div class="nav-bar">
<h2>天府星小程序</h2>
</div>
</div>
<div></div>
<image class="bg-img" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
<image class="bg-img" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" /> -->
<div class="wrapper">
<image class="banner" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png" />
<div class="nav">
@@ -29,11 +29,17 @@
<div class="bottom">
<div class="item">
<h3>进场时间</h3>
<span>{{ item.intoBegintime }} {{ item.intoEndtime }}</span>
<div class="right">
<p>{{ item.intoBegintime }} </p>
<p>{{ item.intoEndtime }}</p>
</div>
</div>
<div class="item">
<h3>场时间</h3>
<span>{{ item.exitBegintime }} {{ item.exitEndtime }}</span>
<h3>场时间</h3>
<div class="right">
<p>{{ item.exitBegintime }} </p>
<p>{{ item.exitEndtime }}</p>
</div>
</div>
</div>
</div>
@@ -49,7 +55,6 @@
export default {
appName: '首页',
customNavigation: true,
navigationBarTitleText: '天府星小程序',
name: 'AppHome',
@@ -68,10 +73,6 @@
},
onLoad () {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
uni.setNavigationBarColor({
frontColor: '#000000'
})
this.getList()
if (!this.token) {
@@ -88,7 +89,7 @@
if (this.isMore) return
this.$loading()
this.$instance.post(`/appactivityinfo/list`, null, {
this.$instance.post(`/api/appactivityinfo/list`, null, {
withoutToken: true,
params: {
current: this.current,
@@ -121,10 +122,6 @@
onReachBottom () {
this.getList()
},
onPageScroll (params) {
this.isFixed = params.scrollTop > 60
}
}
</script>
@@ -146,7 +143,7 @@
.wrapper {
position: relative;
z-index: 11;
padding-top: 208px;
padding-top: 30px;
}
.back-wrapper {
@@ -260,11 +257,13 @@
color: #999999;
}
span {
div {
flex: 1;
text-align: justify;
font-size: 28px;
color: #333333;
p {
font-size: 28px;
color: #333333;
}
}
}
}

View File

@@ -120,7 +120,7 @@ export default {
uploadFile (img, total, type) {
uni.uploadFile({
url: this.$instance.defaults.baseURL + '/api/file/add',
url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add',
filePath: img,
name: 'file',
header: {
@@ -139,7 +139,7 @@ export default {
complete: () => {
this.$nextTick(() => {
if (this.imgList.length === total && this.hideStatus) {
this.$instance.post(`/appwechatescalation/addOrUpdate`, {
this.$instance.post(`/api/appwechatescalation/addOrUpdate`, {
type: type,
openId: this.user.openId,
accessUrl: this.imgList[0]
@@ -162,7 +162,7 @@ export default {
getList () {
if (this.isMore) return
this.$instance.post(`/appwechatescalation/list`, null, {
this.$instance.post(`/api/appwechatescalation/list`, null, {
params: {
current: this.current,
size: 10,

View File

@@ -118,7 +118,7 @@
uploadFile (img, total) {
uni.uploadFile({
url: this.$instance.defaults.baseURL + '/api/file/add',
url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add',
filePath: img,
name: 'file',
header: {
@@ -137,7 +137,7 @@
complete: () => {
this.$nextTick(() => {
if (this.imgList.length === total && this.hideStatus) {
this.$instance.post(`/appwechatescalation/addOrUpdate`, {
this.$instance.post(`/api/appwechatescalation/addOrUpdate`, {
type: 0,
listType: 0,
openId: this.user.openId,
@@ -166,7 +166,7 @@
getList () {
if (this.isMore) return
this.$instance.post(`/appwechatescalation/list`, null, {
this.$instance.post(`/api/appwechatescalation/list`, null, {
params: {
current: this.current,
size: 10,

View File

@@ -14,12 +14,12 @@
<div class="info">
<div class="info-item">
<h3>积分总额</h3>
<span>{{ user.integral }}</span>
<span>{{ user.integral || 0 }}</span>
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/nav2.png" />
</div>
<div class="info-item">
<h3>积分排名</h3>
<span>{{ user.integralOrder }}</span>
<span>{{ user.integralOrder || 0 }}</span>
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/nav1.png" />
</div>
</div>
@@ -69,7 +69,22 @@
if (this.token) {
this.getUserInfo()
this.getList()
} else {
this.autoLogin()
}
uni.$on('updateUserInfo', () => {
this.getUserInfo()
})
},
onShow () {
this.isMore = false
this.current = 1
this.$nextTick(() => {
this.getList()
})
},
methods: {
@@ -85,7 +100,10 @@
toLogin () {
if (!this.token) {
this.autoLogin()
this.autoLogin().then(() => {
this.getList()
this.getUserInfo()
})
} else {
this.getUserInfo()
}
@@ -94,10 +112,11 @@
getList () {
if (this.isMore) return
this.$instance.post(`/appwechatintegraldetail/list`, null, {
this.$instance.post(`/api/appwechatintegraldetail/list`, null, {
params: {
current: this.current,
size: 10
size: 10,
openId: this.user.openId
}
}).then(res => {
if (res.code === 0) {
@@ -124,9 +143,9 @@
}
},
onReachBottom () {
this.getList()
}
onReachBottom () {
this.getList()
}
}
</script>
@@ -158,12 +177,12 @@
}
p {
margin-top: 18px;
color: #8891A1;
font-size: 26px;
}
h2 {
margin-bottom: 18px;
font-weight: 600;
font-size: 34px;
color: #1D2229;

View File

@@ -16,10 +16,16 @@
<input placeholder="请输入昵称" type="nickname" v-model="userInfo.nickName" />
</div>
</div>
<div class="form-item">
<h2>手机号</h2>
<div class="form-item__right">
<input placeholder="请输入手机号" type="number" maxlength="11" v-model="userInfo.phone" />
</div>
</div>
</div>
</div>
<div class="btn-wrapper">
<div class="btn" hover-class="text-hover">保存</div>
<div class="btn" hover-class="text-hover" @click="save">保存</div>
</div>
</div>
</template>
@@ -57,10 +63,41 @@
})
},
save () {
if (!this.userInfo.avatarUrl) {
return this.$toast('请上传头像')
}
if (!this.userInfo.nickName) {
return this.$toast('请输入昵称')
}
if (!this.userInfo.phone) {
return this.$toast('请输入手机号')
}
this.$loading()
this.$instance.post('/api/appwechatuser/update-nickName', null, {
params: {
...this.userInfo
}
}).then(res => {
if (res.code === 0) {
this.$toast('保存成功')
uni.$emit('updateUserInfo')
setTimeout(() => {
wx.navigateBack()
}, 600)
}
})
},
onChooseAvatar (e) {
this.$loading()
uni.uploadFile({
url: this.$instance.defaults.baseURL + '/api/file/add',
url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add',
filePath: e.detail.avatarUrl,
name: 'file',
header: {
@@ -92,19 +129,6 @@
success: res => {
}
})
},
save () {
this.$loading()
this.$http.post('/app/editUserInfo', null, {
params: {
...this.userInfo
}
}).then(res => {
if (res.code === 0) {
this.$toast('保存成功')
}
})
}
}
}

View File

@@ -6,8 +6,8 @@ import instance from "dvcp-wui/utils/http";
instance.defaults.baseURL = setting.baseUrl
instance.interceptors.request.use(config => {
if (config.baseURL === 'http://192.168.1.87:12421') {
config.url = '/api' + config.url.replace(/(app|auth|admin)\//, "")
if (config.baseURL === 'http://192.168.1.87:59998') {
config.url = config.url.replace(/(app|auth|admin|api)\//, "")
}
return config

View File

@@ -16,7 +16,7 @@ const configs = {
dev: {
areaId: '341021104000',
areaName: '郑村镇',
baseUrl: 'http://192.168.1.87:12421'
baseUrl: 'http://192.168.1.87:59998'
}
}
// 当前选中配置