慧治理首页
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
<div class="news">
|
||||
<h2>最新动态</h2>
|
||||
<div class="news-list">
|
||||
<div class="news-item" v-for="(item, index) in list" :key="index"
|
||||
@click="linkTo(`./NewsDetail?id=${item.id}`)">
|
||||
<div class="news-item" v-for="(item, index) in list" :key="index" @click="linkTo(`./NewsDetail?id=${item.id}`)">
|
||||
<div class="left">
|
||||
<h2>{{ item.title }}</h2>
|
||||
<div class="item-bottom">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import Home from './components/Home'
|
||||
import Grid from './components/Grid'
|
||||
import App from './components/App'
|
||||
import My from './components/My'
|
||||
import My from './components/AppMyGrid'
|
||||
export default {
|
||||
name: "AppHome",
|
||||
appName: "首页",
|
||||
@@ -27,12 +27,12 @@ export default {
|
||||
activeImg: require('./img/tab/home-icon-active.png'),
|
||||
component: Home
|
||||
},
|
||||
{
|
||||
text: '网格',
|
||||
img: require('./img/tab/grid-icon.png'),
|
||||
activeImg: require('./img/tab/grid-icon-active.png'),
|
||||
component: Grid
|
||||
},
|
||||
// {
|
||||
// text: '网格',
|
||||
// img: require('./img/tab/grid-icon.png'),
|
||||
// activeImg: require('./img/tab/grid-icon-active.png'),
|
||||
// component: Grid
|
||||
// },
|
||||
{
|
||||
text: '应用',
|
||||
img: require('./img/tab/app-icon.png'),
|
||||
|
||||
212
src/project/huizhili/AppHome/components/AppMyGrid.vue
Normal file
212
src/project/huizhili/AppHome/components/AppMyGrid.vue
Normal file
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<section class="AppMyGrid">
|
||||
<div class="content" v-if="isGridMember">
|
||||
<div class="user-info">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/AppMyGrid//my-bg-user.png" alt="" class="bg-img">
|
||||
<div class="top">
|
||||
<div v-text="user.name"/>
|
||||
<img :src="user.avatar" alt="" v-if="user.avatar">
|
||||
<img src="https://cdn.cunwuyun.cn/dvcp/user-icon.png" alt="" v-else>
|
||||
</div>
|
||||
<div class="bottom" flex>
|
||||
<div class="fill" v-text="user.girdName"/>
|
||||
<div class="signBtn" :class="{signIn}" @click="handleSignClick" v-text="signBtn"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="link" v-for="(item, index) in linkList" :key="index" @click="linkTo(item.linkUrl)">
|
||||
<div class="left" flex>
|
||||
<img :src="item.img" alt="">
|
||||
<div v-text="item.title"/>
|
||||
</div>
|
||||
<u-icon name="arrow-right" color="#ddd" size="40"/>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty class="mar-t32 t-center" v-else no-permit :description="`<p>您不是网格员<br/>无法使用网格员相关功能哦~</p>`"/>
|
||||
<AiConsole/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState, mapActions} from "vuex"
|
||||
import qs from "query-string"
|
||||
|
||||
export default {
|
||||
name: "AppMyGrid",
|
||||
appName: "网格员主页",
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isGridMember: v => v.user.girdCheckType > 0,
|
||||
signIn: v => v.user.gridExtra?.isSign == 1,
|
||||
signBtn: v => v.signIn ? '已签到' : '签到'
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
linkList: [
|
||||
{title: '我的积分', img: require('./assets/wdjf.png'), linkUrl: '/apps/AppCreditPoints/AppGridIntegral'},
|
||||
{title: '积分兑换', img: require('./assets/jfdh.png'), linkUrl: '/apps/AppCreditPoints/AppGridIntegral'},
|
||||
{title: '我收到的评价', img: require('./assets/wsddpj.png'), linkUrl: '/apps/AppCreditPoints/AppGridIntegral'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getGridInfo']),
|
||||
linkTo(url) {
|
||||
uni.navigateTo({url})
|
||||
},
|
||||
handleSignClick() {
|
||||
this.$u.debounce(this.handleSignIn, 500)
|
||||
},
|
||||
handleSignIn() {
|
||||
!this.signIn ? uni.getLocation({
|
||||
success: res => {
|
||||
const {latitude: lat, longitude: lng} = res
|
||||
if (!!lat && !!lng) {
|
||||
this.$http.post('/app/appdvcpconfig/apiForward', null, {
|
||||
params: {
|
||||
url: qs.stringifyUrl({
|
||||
url: "https://apis.map.qq.com/ws/geocoder/v1/?get_poi=1",
|
||||
query: {
|
||||
location: [lat, lng].toString(),
|
||||
key: "3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY",
|
||||
}
|
||||
})
|
||||
},
|
||||
withoutToken: true
|
||||
})
|
||||
.then(({data: {result: {address}}}) => this.$http.post("/app/appwxsigninfo/sign", {lat, lng, address}))
|
||||
.then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.linkTo("./signResult?id=" + res?.data.id)
|
||||
}
|
||||
}).catch(err => this.$u.toast(err))
|
||||
} else this.$u.toast("无法获取到定位!")
|
||||
},
|
||||
fail: () => this.$u.toast("获取定位失败,请重新尝试!")
|
||||
}) : this.$u.toast("已签到,请勿重复签到!")
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getGridInfo()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppMyGrid {
|
||||
.content {
|
||||
padding: 32px 32px 0;
|
||||
|
||||
.user-info {
|
||||
width: 100%;
|
||||
height: 248px;
|
||||
border-radius: 8px;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 28px 32px 36px;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
div {
|
||||
font-size: 40px;
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
line-height: 96px;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
padding: 16px 32px;
|
||||
font-size: 28px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
height: 88px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.link {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 32px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
.left {
|
||||
font-size: 30px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
color: #333;
|
||||
line-height: 42px;
|
||||
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.right-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.signBtn {
|
||||
min-width: 144px;
|
||||
border: 1px solid #1365DD;
|
||||
color: #1365DD;
|
||||
height: 52px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
&.signIn {
|
||||
border-color: #ccc;
|
||||
color: #666;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
background: #1365DD;
|
||||
opacity: 0;
|
||||
transition: .3s;
|
||||
}
|
||||
|
||||
&:active:after {
|
||||
background: transparent;
|
||||
opacity: 0.4;
|
||||
transition: 0s; /*取消过渡*/
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/huizhili/AppHome/components/assets/jfdh.png
Normal file
BIN
src/project/huizhili/AppHome/components/assets/jfdh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 697 B |
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
src/project/huizhili/AppHome/components/assets/score.png
Normal file
BIN
src/project/huizhili/AppHome/components/assets/score.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 754 B |
BIN
src/project/huizhili/AppHome/components/assets/wdjf.png
Normal file
BIN
src/project/huizhili/AppHome/components/assets/wdjf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 637 B |
BIN
src/project/huizhili/AppHome/components/assets/wsddpj.png
Normal file
BIN
src/project/huizhili/AppHome/components/assets/wsddpj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 581 B |
83
src/project/huizhili/AppHome/components/signResult.vue
Normal file
83
src/project/huizhili/AppHome/components/signResult.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<section class="signResult">
|
||||
<div class="successImg"/>
|
||||
<b class="mar-t32">今日已完成签到</b>
|
||||
<div v-if="result.changeIntegral>0" class="mar-t32 score mar-b112">积分{{ result.changeIntegral }}</div>
|
||||
<div v-else class="score gap mar-t32 mar-b112"/>
|
||||
<AiItem label="时间" :border="false">{{ result.createTime }}</AiItem>
|
||||
<AiItem label="位置" :border="false">{{ result.address }}</AiItem>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "signResult",
|
||||
appName: "签到结果",
|
||||
data() {
|
||||
return {
|
||||
result: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getResult() {
|
||||
const {id} = this.$route.query
|
||||
id && this.$http.post("/app/appwxsigninfo/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.result = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getResult()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.signResult {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 160px 70px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-size: 32px;
|
||||
|
||||
.successImg {
|
||||
background-image: url("./assets/qiandaochenggong.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: 192px 192px;
|
||||
width: 192px;
|
||||
height: 192px;
|
||||
}
|
||||
|
||||
& > b {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.score {
|
||||
color: #3975C6;
|
||||
height: 32px;
|
||||
padding-left: 48px;
|
||||
background-image: url("./assets/score.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
|
||||
&.gap {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.mar-b112 {
|
||||
margin-bottom: 112px;
|
||||
}
|
||||
|
||||
::v-deep.normal {
|
||||
height: 56px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user