Kaynağa Gözat

阳光村务投票

wulanhaote
庞东旭 2 yıl önce
ebeveyn
işleme
67502c41f0
27 değiştirilmiş dosya ile 1966 ekleme ve 2 silme
  1. +69
    -0
      src/api/sunVillage_info/fixedAssets.js
  2. BIN
      src/assets/images/sunVillage_info/icon_cj.png
  3. BIN
      src/assets/images/sunVillage_info/icon_sm.png
  4. BIN
      src/assets/images/sunVillage_info/icon_vote.png
  5. BIN
      src/assets/images/sunVillage_info/index_block_1_rights.png
  6. BIN
      src/assets/images/sunVillage_info/index_block_2_rights.png
  7. BIN
      src/assets/images/sunVillage_info/index_block_3_rights.png
  8. BIN
      src/assets/images/sunVillage_info/index_block_4_rights.png
  9. BIN
      src/assets/images/sunVillage_info/index_block_8.png
  10. BIN
      src/assets/images/sunVillage_info/index_btn.png
  11. BIN
      src/assets/images/sunVillage_info/index_title2_rights.png
  12. BIN
      src/assets/images/sunVillage_info/login_head_code.png
  13. BIN
      src/assets/images/sunVillage_info/login_head_h_rights.png
  14. BIN
      src/assets/images/sunVillage_info/login_head_nr_code.png
  15. BIN
      src/assets/images/sunVillage_info/login_icon_2_code.png
  16. +1
    -1
      src/components/form/SubjectTreeChooser.vue
  17. +5
    -0
      src/permission.js
  18. +63
    -0
      src/router/index.js
  19. +5
    -0
      src/views/sunVillage_info/index.vue
  20. +17
    -1
      src/views/sunVillage_info/index_code.vue
  21. +220
    -0
      src/views/sunVillage_info/index_code_rights.vue
  22. +211
    -0
      src/views/sunVillage_info/list_vote.vue
  23. +294
    -0
      src/views/sunVillage_info/list_vote_add.vue
  24. +238
    -0
      src/views/sunVillage_info/list_vote_detail.vue
  25. +302
    -0
      src/views/sunVillage_info/list_vote_edit.vue
  26. +269
    -0
      src/views/sunVillage_info/list_vote_form.vue
  27. +272
    -0
      src/views/sunVillage_info/login_code.vue

+ 69
- 0
src/api/sunVillage_info/fixedAssets.js Dosyayı Görüntüle

@@ -368,3 +368,72 @@ export function getLoginBook() {
method: 'get'
})
}

// 查询投票主题列表
export function listPoll(deptId , query) {
return request({
url: `/villageAffairs/public/poll/list/${deptId}`,
method: 'get',
params: query
})
}

// 姓名, 账套ID, 身份证, 返回里会有个id字段
export function checkFarmer(data) {
return request({
url: '/register/checkFarmer',
method: 'post',
data: data,
})
}

// 查询投票主题详细
export function getPoll(id) {
return request({
url: `/villageAffairs/public/poll/detail/${id}`,
method: 'get'
})
}

// 投票 id为主题ID, option为投票选项ID, 多个用,分隔, userId为认证后的农户ID
export function votePoll(id, data) {
return request({
url: `/villageAffairs/public/poll/vote/${id}`,
method: 'post',
params: data,
})
}

// 新增投票主题
export function addPoll(data) {
return request({
url: '/poll/poll/add',
method: 'post',
data: data
})
}

// 修改投票主题
export function updatePoll(data) {
return request({
url: '/poll/poll/edit',
method: 'post',
data: data
})
}

// 删除投票主题
export function delPoll(id) {
return request({
url: '/poll/poll/remove/' + id,
method: 'get'
})
}

// 发布投票主题
export function publicPoll(id) {
return request({
url: '/poll/poll/publicPoll/'+ id,
method: 'get'
})
}

BIN
src/assets/images/sunVillage_info/icon_cj.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 12  |  Yükseklik: 12  |  Boyut: 207 B

BIN
src/assets/images/sunVillage_info/icon_sm.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 12  |  Yükseklik: 12  |  Boyut: 227 B

BIN
src/assets/images/sunVillage_info/icon_vote.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 76  |  Yükseklik: 76  |  Boyut: 2.8 KiB

BIN
src/assets/images/sunVillage_info/index_block_1_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 69  |  Yükseklik: 58  |  Boyut: 2.8 KiB

BIN
src/assets/images/sunVillage_info/index_block_2_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 69  |  Yükseklik: 58  |  Boyut: 2.8 KiB

BIN
src/assets/images/sunVillage_info/index_block_3_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 69  |  Yükseklik: 58  |  Boyut: 3.5 KiB

BIN
src/assets/images/sunVillage_info/index_block_4_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 69  |  Yükseklik: 65  |  Boyut: 3.4 KiB

BIN
src/assets/images/sunVillage_info/index_block_8.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 200  |  Yükseklik: 217  |  Boyut: 5.7 KiB

BIN
src/assets/images/sunVillage_info/index_btn.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 222  |  Yükseklik: 81  |  Boyut: 8.7 KiB

BIN
src/assets/images/sunVillage_info/index_title2_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 520  |  Yükseklik: 52  |  Boyut: 5.5 KiB

BIN
src/assets/images/sunVillage_info/login_head_code.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 750  |  Yükseklik: 484  |  Boyut: 96 KiB

BIN
src/assets/images/sunVillage_info/login_head_h_rights.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 61  |  Yükseklik: 61  |  Boyut: 2.7 KiB

BIN
src/assets/images/sunVillage_info/login_head_nr_code.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 342  |  Yükseklik: 51  |  Boyut: 3.9 KiB

BIN
src/assets/images/sunVillage_info/login_icon_2_code.png Dosyayı Görüntüle

Önce Sonra
Genişlik: 34  |  Yükseklik: 24  |  Boyut: 1.3 KiB

+ 1
- 1
src/components/form/SubjectTreeChooser.vue Dosyayı Görüntüle

@@ -8,7 +8,7 @@
/>

<van-tabs v-model="active" @change="onTabChanged">
<van-tab :title="item.subjectName" :name="item.subjectId" v-for="(item, index) in subjects">
<van-tab :title="item.subjectName" :name="item.subjectId" v-for="(item, index) in subjects" :key="index">
<SubjectTreeChooserNodeItem :ref="'tree' + index" :subjects="item.children" @clicked="onItemClicked" :can-select-non-leaf="canSelectNonLeaf"></SubjectTreeChooserNodeItem>
</van-tab>
</van-tabs>


+ 5
- 0
src/permission.js Dosyayı Görüntüle

@@ -122,6 +122,11 @@ const whiteList = [
'/sunVillage_info/list_finance_detail', //详情页
'/sunVillage_info/list_finance_ranking', //详情页
'/sunVillage_info/list_tourists_ranking', //详情页
'/sunVillage_info/login_code', //详情页
'/sunVillage_info/index_code_rights', //详情页
'/sunVillage_info/list_vote', //详情页
'/sunVillage_info/list_vote_detail', //详情页
'/sunVillage_info/list_vote_form', //详情页
]

router.beforeEach((to, from, next) => {


+ 63
- 0
src/router/index.js Dosyayı Görüntüle

@@ -3151,6 +3151,69 @@ export const constantRoutes = [
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_balance_ranking'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/list_vote',
name: 'sunVillageInfoListVote',
meta: {
title: '投票',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_vote'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/list_vote_detail',
name: 'sunVillageInfoListVoteDetail',
meta: {
title: '投票',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_vote_detail'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/list_vote_form',
name: 'sunVillageInfoListVoteForm',
meta: {
title: '投票',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_vote_form'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/list_vote_add',
name: 'sunVillageInfoListVoteAdd',
meta: {
title: '新增投票',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_vote_add'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/list_vote_edit',
name: 'sunVillageInfoListVoteEdit',
meta: {
title: '修改投票',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/list_vote_edit'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/login_code',
name: 'sunVillageInfoLoginCode',
meta: {
title: '村民身份验证',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/login_code'], resolve)
},
{ ////阳光村务(新)-- 合同信息
path: '/sunVillage_info/index_code_rights',
name: 'sunVillageInfoIndexCodeRights',
meta: {
title: '我的权利',
hidden: true,
},
component: (resolve) => require(['@/views/sunVillage_info/index_code_rights'], resolve)
}
];



+ 5
- 0
src/views/sunVillage_info/index.vue Dosyayı Görüntüle

@@ -53,6 +53,7 @@
<router-link :to="{name:'sunVillageInfoFixedAssets'}" class="nav_item n_4">资产登记</router-link>
<router-link :to="{name:'sunVillageInfoInformation'}" class="nav_item n_5">合同登记</router-link>
<router-link :to="{name:'sunVillageInfoListBalanceRanking'}" class="nav_item n_7">科目余额表</router-link>
<router-link :to="{name:'sunVillageInfoListVote'}" class="nav_item n_8">发布投票</router-link>
</div>
</div>
<div class="footer">
@@ -305,6 +306,10 @@
background: url('../../assets/images/sunVillage_info/index_block_7.png') no-repeat;
background-size: 100% 100%;
}
&.n_8 {
background: url('../../assets/images/sunVillage_info/index_block_8.png') no-repeat;
background-size: 100% 100%;
}
}
}
}


+ 17
- 1
src/views/sunVillage_info/index_code.vue Dosyayı Görüntüle

@@ -25,6 +25,7 @@
<div class="footer">
技术支持:北京农燊高科信息技术有限公司
</div>
<img src="../../assets/images/sunVillage_info/index_btn.png" class="fixed_btn" @click="goCode">
</div>
</template>
<script>
@@ -82,11 +83,26 @@
});
},
methods: {

goCode(){
if (Cookies.get('memberName')){
this.$router.push({path:'/sunVillage_info/index_code_rights'})
}else{
this.$router.push({path:'/sunVillage_info/login_code'})
}
}
},
}
</script>
<style scoped lang="scss">
.fixed_btn{
position: fixed;
right: 0;
width: 115PX;
bottom: 15%;
border-top-left-radius: 115PX;
border-bottom-left-radius: 115PX;
box-shadow: 0px 2px 5px #ccc;
}
.home_wrapper{
background: #f1f2f2;
width: 100vw;


+ 220
- 0
src/views/sunVillage_info/index_code_rights.vue Dosyayı Görüntüle

@@ -0,0 +1,220 @@
<template>
<div class="home_wrapper">
<div class="head_main">
<div class="location">

<div class="address"><i class="icon"></i>{{deptName}}</div>

<div class="address">{{bookName}}</div>

</div>
<div class="exit_btn" @click="$router.push({name:'sunVillageInfoIndexCode',query:{deptId:deptId,bookId:bookId}})">
<i class="icon"></i>
</div>
</div>
<div class="index_info">
<div class="title"></div>
<div class="nav_box">
<p class="nav_tit">公开公示</p>
<div class="nav_list">
<router-link :to="{name:'sunVillageInfoListFinance',query:{type:'code'}}" class="nav_item n_1">财务公开榜</router-link>
<router-link :to="{name:'sunVillageInfoListTourists',query:{type:'code'}}" class="nav_item n_2">零工公开榜</router-link>
<router-link :to="{name:'sunVillageInfoListIssues',query:{type:'code'}}" class="nav_item n_3">重大事项</router-link>
</div>
</div>
<div class="nav_box">
<p class="nav_tit">我的权利</p>
<div class="nav_list">
<router-link :to="{name:'sunVillageInfoListVote',query:{type:'code'}}" class="nav_item n_4">投票表决</router-link>
</div>
</div>
</div>
<div class="footer">
技术支持:北京农燊高科信息技术有限公司
</div>
</div>
</template>
<script>
import { bookInfo } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
export default {
name: "certificateList",
data() {
return {
deptIdOptions:[],
villageVisbile:false,
showBookList:false,
deptName:'',
//选中的值
villageValue: "",
//省市区区级list
hcAreaInfoOption: [],
hcAreaInfoFieldName: {
text: "label",
value: "value",
children: "children",
},
bookName:'',
queryParams: {
pageNum: 1,
pageSize: 100,
},
//账套列表
bookVisbile:false,
bookList:[],
bookId:"",
deptId:"",
book:"",
};
},
created() {
this.deptId = Cookies.get('deptId')
this.bookId = Cookies.get('bookId')
bookInfo(this.bookId).then((res) => {
if (res.code == 200) {
this.deptName = res.data.deptName;
this.bookName = res.data.bookName;
}
});
},
methods: {
goCode(){
this.$router.push({path:'/sunVillage_info/login_code'})
}
},
}
</script>
<style scoped lang="scss">
.fixed_btn{
position: fixed;
right: 0;
width: 115PX;
bottom: 15%;
border-top-left-radius: 115PX;
border-bottom-left-radius: 115PX;
box-shadow: 0px 2px 5px #ccc;
}
.home_wrapper{
background: #f1f2f2;
width: 100vw;
min-height: 100vh;
.head_main{
height: 340px;
background: url('../../assets/images/sunVillage_info/index_head.png') no-repeat;
background-size: 100% 100%;
position: relative;
.location{
height: 42px;
line-height: 42px;
position: absolute;
left: 38px;
top: 72px;
display: flex;
.address{
padding:0 18px;
background:rgba(255,255,255,0.75);
border-radius: 42px;
font-size: 28px;
color: #3f3d56;
margin-right: 12px;
display: flex;
align-items:center;
.icon{
display: block;
width: 20px;
height: 26px;
background: url('../../assets/images/sunVillage_info/index_icon_1.png') no-repeat;
background-size: 100% 100%;
margin-right: 10px;
}
}
}
.exit_btn{
width: 61px;
height: 61px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 64px;
right: 36px;
.icon{
width: 100%;
height: 100%;
background: url('../../assets/images/sunVillage_info/login_head_h_rights.png') no-repeat;
background-size: 100% 100%;
}
}
}
.index_info{
padding-top: 4.1vh;
.title{
width: 521px;
height: 52px;
background: url('../../assets/images/sunVillage_info/index_title2_rights.png') no-repeat;
background-size: 100% 100%;
margin:0 auto;
}
.nav_box{
margin: 0 auto;
width: calc(100% - 60px);
background: #ffffff;
margin-top: 6vh;
padding: 30px 30px 40px;
border-radius: 15PX;
box-shadow: 0px 2px 10px #cccccc;
.nav_tit{
font-size: 35px;
margin-bottom: 15PX;
font-weight: bold;
}
.nav_list{
display: flex;
flex-flow: wrap;
justify-content: space-between;
.nav_item{
font-size: 30px;
color: #333333;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
padding-top: 40PX;
&:nth-child(3){
margin-right: 0;
}
&.n_1{
background: url('../../assets/images/sunVillage_info/index_block_1_rights.png') no-repeat center top;
background-size: 34.5PX;
}
&.n_2{
background: url('../../assets/images/sunVillage_info/index_block_2_rights.png') no-repeat center top;
background-size: 34.5PX;
}
&.n_3 {
background: url('../../assets/images/sunVillage_info/index_block_3_rights.png') no-repeat center top;
background-size: 34.5PX;
}
&.n_4 {
background: url('../../assets/images/sunVillage_info/index_block_4_rights.png') no-repeat center top;
background-size: 34.5PX;
}
&.n_5 {
background: url('../../assets/images/sunVillage_info/index_block_5.png') no-repeat;
background-size: 100% 100%;
}
}
}
}
}
.footer{
position: absolute;
bottom: 5.5vh;
width: 100%;
font-size: 22px;
color: #3f3d56;
text-align: center;
}
}
</style>

+ 211
- 0
src/views/sunVillage_info/list_vote.vue Dosyayı Görüntüle

@@ -0,0 +1,211 @@
<template>
<div class="home_wrapper">
<div class="header_main">
投票
<div class="return_btn" @click="onClickLeft"></div>
<div class="add_btn" @click="goAdd" v-show="showBtn"></div>
</div>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="getList"
>
<van-swipe-cell v-for="(item,index) in applicationList" :key="index" >
<van-cell
:border="false"
:title="item.subjectName"
:label="'时间:'+item.startTime.substr(0,10)+' - '+item.endTime.substr(0,10)"
center
:to="{name: item.isVote || showBtn ? 'sunVillageInfoListVoteDetail':'sunVillageInfoListVoteForm',query:{id:item.id}}"
>
<template #right-icon>
<p style="color: #1D6FE9">投票</p>
</template>
<template #icon>
<img src="../../assets/images/sunVillage_info/icon_vote.png" style="width: .5rem;margin-right: 2%;">
</template>
</van-cell>
<template #right v-if="showBtn">
<div style="background-color: #ee0a24;height: 100%" @click="goRemove(item.id)">删除</div>
<div style="background-color: #07c160" @click="goEdit(item.id)">修改</div>
<div style="background-color: rgb(255, 166, 62);" v-if="item.status != '3'" @click="goRanking(item.id)">发布</div>
</template>
</van-swipe-cell>
</van-list>
</div>
</template>

<script>
import { listPoll , delPoll , publicPoll } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import request from '@/utils/request'
export default {
name: "certificateList",
data() {
return {
applicationList:[],
applicationListSecond:[],
assetStatusOptions:[],
auditStatus:[],
loading: false,
finished: false,
show: false,
showTab: false,
fileList:[],
listLength:'0',
searchInput:'',
queryParams:{
pageNum:1,
pageSize:10,
orderByColumn:'createTime',
isAsc:'desc',
},
uploadFiles1:[],
projectId:'',
projectIndex:'',
showBtn:true,
};
},
created() {
this.queryParams.bookId = Cookies.get('bookId');
this.queryParams.deptId = Cookies.get('deptId');
if (Cookies.get('user')){
this.queryParams.userId = JSON.parse(Cookies.get('user')).id
}
if (this.$route.query.type == 'code'){
this.queryParams.status = '3'
this.showBtn = false;
}
},
methods: {
getList(){
var _this = this;
listPoll(_this.queryParams.deptId,_this.queryParams).then(response => {
_this.listLength = response.total;
response.rows.map(res=>{
_this.applicationList.push(res);
})

if(_this.applicationList.length >= response.total){
_this.finished = true;
return;
}else{
_this.loading = false;
_this.queryParams.pageNum += 1 ;
}
});
},
goAdd(){
this.$router.push('/sunVillage_info/list_vote_add')
},
goDetail(id){
this.$router.push({path:'/sunVillage_info/list_vote_detail',query: {id:id}})
},
goEdit(id){
this.$router.push({path:'/sunVillage_info/list_vote_edit',query: {id:id}})
},
goRanking(id){
this.$dialog.alert({
title: '提示',
message: '确认发布?',
showCancelButton:true,
})
.then(() => {
publicPoll(id).then(response => {
this.$notify({ type: 'success', message: '发布成功' });
this.applicationList = [];
this.getList()
});
})
.catch(() => {
// on cancel
});
},
goRemove(id){
this.$dialog.alert({
title: '提示',
message: '确认删除?',
showCancelButton:true,
})
.then(() => {
delPoll(id).then(response => {
this.$notify({ type: 'success', message: '删除成功' });
this.applicationList = [];
this.getList()
});
})
.catch(() => {
// on cancel
});

}
},
}
</script>

<style scoped lang="scss">
.home_wrapper{
background: #e9e9e9;
min-height: 100vh;
width: 100vw;
.header_main{
height: 116px;
background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
background-size: 100% 100%;
position: fixed;
top: 0;
left: 0;
width: 100%;
font-size: 36px;
line-height: 116px;
text-align: center;
color: #fff;
position: relative;
.return_btn{
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
.add_btn{
width: 56.4px;
height: 40.8px;
background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
background-size: 47px 34px;
position: absolute;
right: 38px;
top: 36px;
}
}
.van-swipe-cell {
position: relative;
overflow: hidden;
cursor: grab;
width: 96%;
margin: 0 auto;
margin-top: 15PX;
box-shadow: 5PX 5PX 2PX #ccc;
border-radius: 10PX;
}
/deep/ .van-swipe-cell__right{
display: flex;
align-items: center;
width: 150PX;
margin-left: 5PX;
a,div{
margin: 0;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 14PX;
height: 100%;
flex: 1;
}
}
}
</style>

+ 294
- 0
src/views/sunVillage_info/list_vote_add.vue Dosyayı Görüntüle

@@ -0,0 +1,294 @@
<template>
<div class="home_wrapper">
<div class="header_main">
新增投票
<div class="return_btn" @click="onClickLeft"></div>
<div class="add_btn"></div>
</div>
<van-form @submit="onSubmit">
<div class="list_main">

<van-field required label="主题" v-model="form.subjectName" placeholder="请输入主题" :rules="[{ required: true , message:'请输入主题' }]" input-align="right" :border="false" />

<van-field label="描述" v-model="form.description" placeholder="请输入描述" input-align="right" :border="false" />

<van-field label="规则" v-model="form.rules" placeholder="请输入规则" input-align="right" :border="false" />

<van-field name="radio" label="投票类型" input-align="right" :border="false">
<template #input>
<van-radio-group v-model="form.type" direction="horizontal">
<van-radio name="1">单选</van-radio>
<van-radio name="2">多选</van-radio>
</van-radio-group>
</template>
</van-field>

<van-field
readonly
clickable
label="开始时间"
placeholder="请选择"
v-model="form.startTime"
@click="showStartTime = true"
input-align="right"
right-icon="arrow-down"
label-width="auto"
required
:border="false"
:rules="[{ required: true , message:'请选择开始时间' }]"
/>
<van-popup v-model="showStartTime" position="bottom">
<van-datetime-picker
v-model="startTime"
type="datetime"
title="选择开始时间"
@confirm="onConfirmOpenNy"
@cancel="showStartTime = false"
/>
</van-popup>

<van-field
readonly
clickable
label="结束时间"
placeholder="请选择"
v-model="form.endTime"
@click="showEndTime = true"
input-align="right"
right-icon="arrow-down"
label-width="auto"
required
:border="false"
:rules="[{ required: true , message:'请选择结束时间' }]"
/>
<van-popup v-model="showEndTime" position="bottom">
<van-datetime-picker
v-model="endTime"
type="datetime"
title="选择结束时间"
@confirm="onConfirmOpenEndTime"
@cancel="showEndTime = false"
/>
</van-popup>

<van-field label="发起人/单位" v-model="form.promoters" placeholder="请输入发起人/单位" input-align="right" :border="false" />

<van-field name="radio" label="是否匿名" input-align="right" :border="false">
<template #input>
<van-radio-group v-model="form.anonymous" direction="horizontal">
<van-radio name="Y">是</van-radio>
<van-radio name="N">否</van-radio>
</van-radio-group>
</template>
</van-field>
<p class="tit">投票选项</p>

<div style="margin-bottom: 10PX;">
<van-field v-for="(item,index) in form.options" :key="index" required :rules="[{ required: true , message:'请输入选项名称' }]" :label="'选项'+(index+1)" v-model="item.name" placeholder="请输入选项" input-align="right" :border="false" />
</div>
<van-button plain hairline block icon="plus" type="info" native-type="button" @click="addOptions">增加投票选项</van-button>

</div>

<div style="margin: 16px auto;width: 50%;">
<van-button round block type="primary" native-type="submit">
保存
</van-button>
</div>
</van-form>
</div>
</template>

<script>
import { commonUpload , addPoll } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import request from '@/utils/request'
export default {
name: "certificateList",
data() {
return {
showStartTime:false,
showEndTime:false,
form:{
startTime:this.format(new Date(),'yyyy-MM-dd HH:mm:ss'),
endTime:this.format(new Date(),'yyyy-MM-dd HH:mm:ss'),
type:'1',
anonymous:'Y',
status:'2',
options:[{name:''}]
},
openPic:[],
fileList:[],
fileList1:[],
startTime:new Date(),
endTime:new Date(),
type:'',
openFile:[],
openFileList:[],
queryParams:{
bookId:'',
deptId:'',
},
openFile2:[],
openPic2:[],
};
},
created() {
this.queryParams.bookId = Cookies.get('bookId');
this.queryParams.deptId = Cookies.get('deptId');
},
methods: {
addOptions(){
var that = this;
let array = that.form.options.filter(function (e) { return e.name == ""; });
console.log(array);
if (array.length>0){
that.$toast('请勿添加多个空选项!');
}else{
that.form.options.push({name:''})
}
},
onSubmit(){
var that = this;
addPoll(that.form).then((r1) => {
if (r1.code == 200){
that.$notify({ type: 'success', message: '新增成功' });
setTimeout(function(){
history.back(-1);
},2000)
}
})
},
onConfirmOpenNy(data){
this.form.startTime = this.format(data,'yyyy-MM-dd HH:mm:ss');
this.startTime = data;
this.showStartTime = false;
},
onConfirmOpenEndTime(data){
this.form.endTime = this.format(data,'yyyy-MM-dd HH:mm:ss');
this.endTime = data;
this.showEndTime = false;
},
},
}
</script>

<style scoped lang="scss">
/deep/ .van-button--primary{
background: url("../../assets/images/sunVillage_info/btn_bg.png") no-repeat;
background-size: 100% 100%;
border: none;
}
.van-radio:last-child{
margin-right: 0;
}
.home_wrapper{
background: #e9e9e9;
min-height: 100vh;
width: 100vw;
.header_main {
height: 116px;
background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
background-size: 100% 100%;
position: fixed;
top: 0;
left: 0;
width: 100%;
font-size: 36px;
line-height: 116px;
text-align: center;
color: #fff;
position: relative;

.return_btn {
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
}
.release_head{
height: 90px;
padding:0 23px;
display: flex;
align-items: center;
font-size: 26px;
color: #929292;
.people{
flex: 1;
display: flex;
align-items: center;
.icon{
width: 24px;
height: 21px;
background: url('../../assets/images/sunVillage_info/details_icon_1.png') no-repeat;
background-size: 100% 100%;
display: block;
margin-right: 8px;
}
}
.time{
flex: 1;
display: flex;
align-items: center;
justify-content:flex-end;
.icon{
width: 25px;
height: 25px;
background: url('../../assets/images/sunVillage_info/details_icon_2.png') no-repeat;
background-size: 100% 100%;
display: block;
margin-right: 8px;
}
}
}
.release_conetnt{
padding:0 22px;
font-size: 32px;
color: #252525;
line-height: 44px;
img{
max-width: 100%;
margin-bottom: 16px;
}
p{
margin-bottom: 16px;
}
}
.list_main{
padding:25px;
background: #ffffff;
width: 94%;
margin: 25px auto 0;
border-radius: 15PX;
box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
}
.tit{
font-size: 16PX;
padding: 15PX 10PX;
}
/deep/ .van-cell{
padding-left: 0!important;
padding-right: 0!important;
padding-bottom: 0!important;
&:nth-child(1){
padding-top: 0;
}
}
/deep/ .van-field__label{
padding-left: 10PX;
width: auto;
display: flex;
align-items: center;
}
/deep/ .van-cell--required::before{
left: 0PX;
}
/deep/ .van-field__error-message{
display: none;
}
}
</style>

+ 238
- 0
src/views/sunVillage_info/list_vote_detail.vue Dosyayı Görüntüle

@@ -0,0 +1,238 @@
<template>
<div class="home_wrapper">
<div class="header_main">
投票
<div class="return_btn" @click="onClickLeft"></div>
</div>

<div class="top_box">
<p class="title">{{form.subjectName}}</p>
<p class="label">{{form.description}}</p>
<div>
<p><i></i>{{form.anonymous == '1' ? '匿名':'实名'}}</p>
<p><i></i>{{form.type == '1' ? '单选':'多选'}}</p>
<p><i></i>{{form.nums}}人已参加</p>
</div>
</div>

<van-cell
:border="false"
center
v-for="(item,index) in form.options"
:key="index"
>
<template #title>
<div class="cell_title">
<img src="../../assets/images/sunVillage_info/icon_vote.png" style="width: .5rem;margin-right: 2%;">
<p>{{item.name}}</p>
</div>
</template>
<template #label>
<div class="cell_label">
<van-progress :percentage="50" stroke-width="7" :show-pivot="false" />
<p>{{item.num}}票</p>
<p>87%</p>
</div>
</template>
</van-cell>

<div class="creatName">
<p>截止时间:{{form.endTime}}</p>
<p>发起人:{{form.promoters}}</p>
</div>

</div>
</template>

<script>
import { getPoll , votePoll } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import request from '@/utils/request'
export default {
name: "certificateList",
data() {
return {
applicationList:[],
applicationListSecond:[],
assetStatusOptions:[],
auditStatus:[],
loading: false,
finished: false,
show: false,
showTab: false,
fileList:[],
listLength:'0',
searchInput:'',
queryParams:{
pageNum:1,
pageSize:10,
orderByColumn:'createTime',
isAsc:'desc',
year:'2022',
},
uploadFiles1:[],
projectId:'',
projectIndex:'',
showBtn:true,
form:{},
radio:''
};
},
created() {
this.queryParams.bookId = Cookies.get('bookId');
this.queryParams.deptId = Cookies.get('deptId');
if (this.$route.query.type == 'code'){
this.showBtn = false;
}
this.getDetail(this.$route.query.id);
},
methods: {
getDetail(id){
var _this = this;
getPoll(id).then(response => {
_this.form = response.data;
});
},
goSubmit(){
var _this = this;
var data = {
userId:JSON.parse(Cookies.get('user')).id,
option:_this.radio
}
votePoll(_this.form.id,data).then(response => {
_this.$notify({ type: 'success', message: '投票成功' });
setTimeout(function(){
history.back(-1);
},2000)
});
},
},
}
</script>

<style scoped lang="scss">
.home_wrapper{
background: #e9e9e9;
min-height: 100vh;
width: 100vw;
.header_main{
height: 116px;
background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
background-size: 100% 100%;
position: fixed;
top: 0;
left: 0;
width: 100%;
font-size: 36px;
line-height: 116px;
text-align: center;
color: #fff;
position: relative;
.return_btn{
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
.add_btn{
width: 56.4px;
height: 40.8px;
background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
background-size: 47px 34px;
position: absolute;
right: 38px;
top: 36px;
}
}
.top_box{
padding: 22PX 7% 0PX;
.title{font-size: .4rem;margin-bottom: 10PX;}
.label{color: #878787;margin-bottom: 10PX;}
div{
display: flex;
p{
color: #1D6FE9;
font-size: 14PX;
&:nth-child(1){
margin-right: 10PX;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_sm.png') no-repeat;
background-size: 100% 100%;
}
}
&:nth-child(2){
margin-right: 10PX;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_sm.png') no-repeat;
background-size: 100% 100%;
}
}
&:nth-child(3){
color: #878787;
margin-left: auto;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_cj.png') no-repeat;
background-size: 100% 100%;
}
}
}
}
}
.van-cell{
width: 96%;
margin: 0 auto;
margin-top: 15PX;
box-shadow: 5PX 5PX 2PX #ccc;
border-radius: 10PX;
}
.cell_title{
display: flex;
align-items: center;
.van-radio{
margin-left: auto;
}
}
.cell_label{
display: flex;
align-items: center;
margin-top: 15PX;
.van-progress{
width: 70%;
}
p{
margin-left: auto;
&:nth-child(3){
margin-left: 10PX;
}
}
}
.creatName{
color: #878787;
font-size: 14PX;
display: flex;
justify-content: space-between;
width: 88%;
margin: 15PX auto 30PX;
}
.van-button{
width: 95%;
margin: 0 auto;
border-radius: 5PX;
}
}
</style>

+ 302
- 0
src/views/sunVillage_info/list_vote_edit.vue Dosyayı Görüntüle

@@ -0,0 +1,302 @@
<template>
<div class="home_wrapper">
<div class="header_main">
修改投票
<div class="return_btn" @click="onClickLeft"></div>
<div class="add_btn"></div>
</div>
<van-form @submit="onSubmit">
<div class="list_main">

<van-field required label="主题" v-model="form.subjectName" placeholder="请输入主题" :rules="[{ required: true , message:'请输入主题' }]" input-align="right" :border="false" />

<van-field label="描述" v-model="form.description" placeholder="请输入描述" input-align="right" :border="false" />

<van-field label="规则" v-model="form.rules" placeholder="请输入规则" input-align="right" :border="false" />

<van-field name="radio" label="投票类型" input-align="right" :border="false">
<template #input>
<van-radio-group v-model="form.type" direction="horizontal">
<van-radio name="1">单选</van-radio>
<van-radio name="2">多选</van-radio>
</van-radio-group>
</template>
</van-field>

<van-field
readonly
clickable
label="开始时间"
placeholder="请选择"
v-model="form.startTime"
@click="showStartTime = true"
input-align="right"
right-icon="arrow-down"
label-width="auto"
required
:border="false"
:rules="[{ required: true , message:'请选择开始时间' }]"
/>
<van-popup v-model="showStartTime" position="bottom">
<van-datetime-picker
v-model="startTime"
type="datetime"
title="选择开始时间"
@confirm="onConfirmOpenNy"
@cancel="showStartTime = false"
/>
</van-popup>

<van-field
readonly
clickable
label="结束时间"
placeholder="请选择"
v-model="form.endTime"
@click="showEndTime = true"
input-align="right"
right-icon="arrow-down"
label-width="auto"
required
:border="false"
:rules="[{ required: true , message:'请选择结束时间' }]"
/>
<van-popup v-model="showEndTime" position="bottom">
<van-datetime-picker
v-model="endTime"
type="datetime"
title="选择结束时间"
@confirm="onConfirmOpenEndTime"
@cancel="showEndTime = false"
/>
</van-popup>

<van-field label="发起人/单位" v-model="form.promoters" placeholder="请输入发起人/单位" input-align="right" :border="false" />

<van-field name="radio" label="是否匿名" input-align="right" :border="false">
<template #input>
<van-radio-group v-model="form.anonymous" direction="horizontal">
<van-radio name="Y">是</van-radio>
<van-radio name="N">否</van-radio>
</van-radio-group>
</template>
</van-field>
<p class="tit">投票选项</p>

<div style="margin-bottom: 10PX;">
<van-field v-for="(item,index) in form.options" :key="index" required :rules="[{ required: true , message:'请输入选项名称' }]" :label="'选项'+(index+1)" v-model="item.name" placeholder="请输入选项" input-align="right" :border="false" />
</div>
<van-button plain hairline block icon="plus" type="info" native-type="button" @click="addOptions">增加投票选项</van-button>

</div>

<div style="margin: 16px auto;width: 50%;">
<van-button round block type="primary" native-type="submit">
保存
</van-button>
</div>
</van-form>
</div>
</template>

<script>
import { commonUpload , updatePoll , getPoll } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import request from '@/utils/request'
export default {
name: "certificateList",
data() {
return {
showStartTime:false,
showEndTime:false,
form:{
startTime:this.format(new Date(),'yyyy-MM-dd HH:mm:ss'),
endTime:this.format(new Date(),'yyyy-MM-dd HH:mm:ss'),
type:'1',
anonymous:'Y',
status:'2',
options:[{name:''}]
},
openPic:[],
fileList:[],
fileList1:[],
startTime:new Date(),
endTime:new Date(),
type:'',
openFile:[],
openFileList:[],
queryParams:{
bookId:'',
deptId:''
},
openFile2:[],
openPic2:[],
};
},
created() {
this.queryParams.bookId = Cookies.get('bookId');
this.queryParams.deptId = Cookies.get('deptId');
this.getDetail(this.$route.query.id);
},
methods: {
getDetail(id){
var _this = this;
getPoll(id).then(response => {
_this.form = response.data;
});
},
addOptions(){
var that = this;
let array = that.form.options.filter(function (e) { return e.name == ""; });
console.log(array);
if (array.length>0){
that.$toast('请勿添加多个空选项!');
}else{
that.form.options.push({name:''})
}
},
onSubmit(){
var that = this;
updatePoll(that.form).then((r1) => {
if (r1.code == 200){
that.$notify({ type: 'success', message: '新增成功' });
setTimeout(function(){
history.back(-1);
},2000)
}
})
},
onConfirmOpenNy(data){
this.form.startTime = this.format(data,'yyyy-MM-dd HH:mm:ss');
this.startTime = data;
this.showStartTime = false;
},
onConfirmOpenEndTime(data){
this.form.endTime = this.format(data,'yyyy-MM-dd HH:mm:ss');
this.endTime = data;
this.showEndTime = false;
},

},
}
</script>

<style scoped lang="scss">
/deep/ .van-button--primary{
background: url("../../assets/images/sunVillage_info/btn_bg.png") no-repeat;
background-size: 100% 100%;
border: none;
}
.van-radio:last-child{
margin-right: 0;
}
.home_wrapper{
background: #e9e9e9;
min-height: 100vh;
width: 100vw;
.header_main {
height: 116px;
background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
background-size: 100% 100%;
position: fixed;
top: 0;
left: 0;
width: 100%;
font-size: 36px;
line-height: 116px;
text-align: center;
color: #fff;
position: relative;

.return_btn {
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
}
.release_head{
height: 90px;
padding:0 23px;
display: flex;
align-items: center;
font-size: 26px;
color: #929292;
.people{
flex: 1;
display: flex;
align-items: center;
.icon{
width: 24px;
height: 21px;
background: url('../../assets/images/sunVillage_info/details_icon_1.png') no-repeat;
background-size: 100% 100%;
display: block;
margin-right: 8px;
}
}
.time{
flex: 1;
display: flex;
align-items: center;
justify-content:flex-end;
.icon{
width: 25px;
height: 25px;
background: url('../../assets/images/sunVillage_info/details_icon_2.png') no-repeat;
background-size: 100% 100%;
display: block;
margin-right: 8px;
}
}
}
.release_conetnt{
padding:0 22px;
font-size: 32px;
color: #252525;
line-height: 44px;
img{
max-width: 100%;
margin-bottom: 16px;
}
p{
margin-bottom: 16px;
}
}
.list_main{
padding:25px;
background: #ffffff;
width: 94%;
margin: 25px auto 0;
border-radius: 15PX;
box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
}
.tit{
font-size: 16PX;
padding: 15PX 10PX;
}
/deep/ .van-cell{
padding-left: 0!important;
padding-right: 0!important;
padding-bottom: 0!important;
&:nth-child(1){
padding-top: 0;
}
}
/deep/ .van-field__label{
padding-left: 10PX;
width: auto;
display: flex;
align-items: center;
}
/deep/ .van-cell--required::before{
left: 0PX;
}
/deep/ .van-field__error-message{
display: none;
}
}
</style>

+ 269
- 0
src/views/sunVillage_info/list_vote_form.vue Dosyayı Görüntüle

@@ -0,0 +1,269 @@
<template>
<div class="home_wrapper">
<div class="header_main">
投票
<div class="return_btn" @click="onClickLeft"></div>
</div>

<div class="top_box">
<p class="title">{{form.subjectName}}</p>
<p class="label">{{form.description}}</p>
<div>
<p><i></i>{{form.anonymous == '1' ? '匿名':'实名'}}</p>
<p><i></i>{{form.type == '1' ? '单选':'多选'}}</p>
<p><i></i>{{form.nums}}人已参加</p>
</div>
</div>

<van-radio-group v-model="radio" v-if="form.type == '1'">
<van-cell
:border="false"
center
v-for="(item,index) in form.options"
:key="index"
>
<template #title>
<div class="cell_title">
<img src="../../assets/images/sunVillage_info/icon_vote.png" style="width: .5rem;margin-right: 2%;">
<p>{{item.name}}</p>
<van-radio :name="item.id" />
</div>
</template>
<template #label>
<div class="cell_label">
<van-progress :percentage="50" stroke-width="7" :show-pivot="false" />
<p>{{item.num}}票</p>
<p>87%</p>
</div>
</template>
</van-cell>
</van-radio-group>

<van-checkbox-group v-model="radio" v-if="form.type != '1'">
<van-cell
:border="false"
center
v-for="(item,index) in form.options"
:key="index"
>
<template #title>
<div class="cell_title">
<img src="../../assets/images/sunVillage_info/icon_vote.png" style="width: .5rem;margin-right: 2%;">
<p>{{item.name}}</p>
<van-checkbox :name="item.id" />
</div>
</template>
<template #label>
<div class="cell_label">
<van-progress :percentage="50" stroke-width="7" :show-pivot="false" />
<p>{{item.num}}票</p>
<p>87%</p>
</div>
</template>
</van-cell>
</van-checkbox-group>

<div class="creatName">
<p>截止时间:{{form.endTime}}</p>
<p>发起人:{{form.promoters}}</p>
</div>

<van-button type="info" block @click="goSubmit">确认投票</van-button>
</div>
</template>

<script>
import { getPoll , votePoll } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import request from '@/utils/request'
export default {
name: "certificateList",
data() {
return {
applicationList:[],
applicationListSecond:[],
assetStatusOptions:[],
auditStatus:[],
loading: false,
finished: false,
show: false,
showTab: false,
fileList:[],
listLength:'0',
searchInput:'',
queryParams:{
pageNum:1,
pageSize:10,
orderByColumn:'createTime',
isAsc:'desc',
year:'2022',
},
uploadFiles1:[],
projectId:'',
projectIndex:'',
showBtn:true,
form:{},
radio:[]
};
},
created() {
this.queryParams.bookId = Cookies.get('bookId');
this.queryParams.deptId = Cookies.get('deptId');
if (this.$route.query.type == 'code'){
this.showBtn = false;
}
this.getDetail(this.$route.query.id);
},
methods: {
getDetail(id){
var _this = this;
getPoll(id).then(response => {
_this.form = response.data;
});
},
goSubmit(){
var _this = this;
var data = {
userId:JSON.parse(Cookies.get('user')).id,
option:_this.radio
}
votePoll(_this.form.id,data).then(response => {
_this.$notify({ type: 'success', message: '投票成功' });
setTimeout(function(){
history.back(-1);
},2000)
});
},
},
}
</script>

<style scoped lang="scss">
.home_wrapper{
background: #e9e9e9;
min-height: 100vh;
width: 100vw;
.header_main{
height: 116px;
background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
background-size: 100% 100%;
position: fixed;
top: 0;
left: 0;
width: 100%;
font-size: 36px;
line-height: 116px;
text-align: center;
color: #fff;
position: relative;
.return_btn{
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
.add_btn{
width: 56.4px;
height: 40.8px;
background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
background-size: 47px 34px;
position: absolute;
right: 38px;
top: 36px;
}
}
.top_box{
padding: 22PX 7% 0PX;
.title{font-size: .4rem;margin-bottom: 10PX;}
.label{color: #878787;margin-bottom: 10PX;}
div{
display: flex;
p{
color: #1D6FE9;
font-size: 14PX;
&:nth-child(1){
margin-right: 10PX;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_sm.png') no-repeat;
background-size: 100% 100%;
}
}
&:nth-child(2){
margin-right: 10PX;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_sm.png') no-repeat;
background-size: 100% 100%;
}
}
&:nth-child(3){
color: #878787;
margin-left: auto;
i{
width: 10PX;
height: 10PX;
display: inline-block;
margin-right: 5PX;
background: url('../../assets/images/sunVillage_info/icon_cj.png') no-repeat;
background-size: 100% 100%;
}
}
}
}
}
.van-cell{
width: 96%;
margin: 0 auto;
margin-top: 15PX;
box-shadow: 5PX 5PX 2PX #ccc;
border-radius: 10PX;
}
.cell_title{
display: flex;
align-items: center;
.van-checkbox{
margin-left: auto;
}
.van-radio{
margin-left: auto;
}
}
.cell_label{
display: flex;
align-items: center;
margin-top: 15PX;
.van-progress{
width: 70%;
}
p{
margin-left: auto;
&:nth-child(3){
margin-left: 10PX;
}
}
}
.creatName{
color: #878787;
font-size: 14PX;
display: flex;
justify-content: space-between;
width: 88%;
margin: 15PX auto 30PX;
}
.van-button{
width: 95%;
margin: 0 auto;
border-radius: 5PX;
}
}
</style>

+ 272
- 0
src/views/sunVillage_info/login_code.vue Dosyayı Görüntüle

@@ -0,0 +1,272 @@
<template>
<div class="home_wrapper">
<div class="return_btn" @click="onClickLeft"></div>
<div class="focus_head">
</div>
<div class="focus_info">
<div class="icon"></div>
<div class="title"></div>
</div>
<van-form @submit="handleLogin">
<div class="login_from">
<div class="flex_block">
<div class="flex_input_main">
<div class="icon_wrap user"></div>
<div class="input_wrap">
<input type="text" v-model="formData.memberName" class="ipt" placeholder="姓名"/>
</div>
</div>
</div>
<div class="flex_block">
<div class="flex_input_main">
<div class="icon_wrap password"></div>
<div class="input_wrap">
<input type="text" v-model="formData.idcard" class="ipt" placeholder="身份证号码"/>
</div>
</div>
</div>
<!-- <div class="flex_block">-->
<!-- <div class="flex_input_main valid">-->
<!-- <div class="icon_wrap valid"></div>-->
<!-- <div class="input_wrap">-->
<!-- <input type="text" v-model="formData.code" class="ipt" maxlength="4" placeholder="请输入验证码"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="valid_main">-->
<!-- <img :src="codeUrl" @click="getCode" />-->
<!-- </div>-->
<!-- </div>-->
<van-checkbox v-model="formData.rememberMe">记住我的信息</van-checkbox>
</div>
<div class="login_btn">
<!-- <div class="btn" :loading="loading">登录</div>-->
<van-button
class="btn"
round
block
type="info"
native-type="submit"
:loading="loading"
>验证</van-button>
</div>

</van-form>
</div>
</template>

<script>
import { getCodeImg, getSmsCode } from "@/api/login";
import { checkFarmer } from "@/api/sunVillage_info/fixedAssets";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "../../utils/jsencrypt";
//引用wx sdk
import wx from "weixin-js-sdk";
export default {
name: "login",
data() {
return {
formData: {
memberName:'',
idcard:'',
bookId:'',
rememberMe:false
},
loading: false,
codeUrl: "", //验证码
isSmsLogin: false, //是否手机验证码
computeTime: 0,
height:0,
show:true
};
},
created() {
this.height = document.body.clientHeight
this.getCookie();
this.formData.bookId = Cookies.get('bookId');
},
methods: {
getCookie() {
const memberName = Cookies.get("memberName");
const idcard = Cookies.get("idcard");
const rememberMe = Cookies.get("rememberInformation");
this.formData = {
memberName: memberName === undefined ? this.formData.memberName : memberName,
idcard: idcard === undefined ? this.formData.idcard : idcard,
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin(values) {
if (this.formData.rememberMe) {
Cookies.set("memberName", this.formData.memberName, { expires: 30 });
Cookies.set("idcard", this.formData.idcard, { expires: 30 });
Cookies.set("rememberInformation", this.formData.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberInformation");
}
//账号密码登录
if (this.formData.memberName == "") {
this.$dialog.alert({
message: '姓名不能为空',
});
return false;
} else if (this.formData.idcard == "") {
this.$dialog.alert({
message: '身份证不能为空',
});
return false;
}
checkFarmer(this.formData).then(response => {
console.log(response.data)
if (response.code == 200){
Cookies.set("user", response.data, { expires: 30 });
this.$router.push({path:'/sunVillage_info/index_code_rights'})
}
});
},
},
};
</script>

<style scoped lang="scss">
/deep/ .van-checkbox__label{
color: #ffffff;
}
/deep/ .van-checkbox{
justify-content: right;
}
.home_wrapper{
background: #f1f2f2;
width: 100vw;
min-height: 100vh;
.return_btn {
width: 24px;
height: 43.2px;
background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
background-size: 20px 36px;
position: absolute;
left: 38px;
top: 36px;
}
.focus_head{
height: 450px;
background: url('../../assets/images/sunVillage_info/login_head_code.png') no-repeat;
background-size: 100% 100%;

}
.focus_info{
margin-top: -74px;
.icon{
background: url('../../assets/images/sunVillage_info/login_head_t.png') no-repeat;
background-size: 100% 100%;
width: 145px;
height: 148px;
margin:0 auto;
}
.title{
width: 180PX;
height: 52px;
background: url('../../assets/images/sunVillage_info/login_head_nr_code.png') no-repeat;
background-size: 100% 100%;
margin:30px auto 0;
}
}
.login_from{
width: 676px;
height: 350px;
background: url('../../assets/images/sunVillage_info/login_main.png') no-repeat;
background-size: 100% 100%;
margin: 50px auto 0;
padding:60px 50px 0;
.flex_block{
margin-bottom: 40px;
display: flex;
justify-content:space-between;
.flex_input_main{
position: relative;
display: flex;
flex: 1;
align-items:center;
background: rgba(255,255,255,0.7);
border-radius: 62px;
height: 62px;
.icon_wrap{
width: 35px;
height: 35px;
&.user{
background: url('../../assets/images/sunVillage_info/login_icon_1.png') no-repeat;
background-size: 100% 100%;
margin-left: 30px;
}
&.password{
background: url('../../assets/images/sunVillage_info/login_icon_2_code.png') no-repeat;
height: 25px;
background-size: 100% 100%;
margin-left: 30px;
}
&.valid{
background: url('../../assets/images/sunVillage_info/login_icon_3.png') no-repeat;
background-size: 100% 100%;
margin-left: 30px;
}
}
.input_wrap{
flex: 1;
margin-left: 16px;
padding-right: 30px;
.ipt{
width: 100%;
height: 48px;
background:transparent;
font-size: 30px;
color: #3f3d56;
}
}
.showHidden{
width: 32px;
height: 32px;
background: url('../../assets/images/sunVillage_info/login_icon_4.png') no-repeat;
background-size: 100% 100%;
position: absolute;
right: 38px;
cursor: pointer;
&.ico_hide{
background: url('../../assets/images/sunVillage_info/login_icon_5.png') no-repeat;
background-size: 100% 100%;
}
}
&.valid{
flex:0 0 380px;
}
}
.valid_main{
width: 165px;
height: 62px;
border-radius: 30px;
img{
width: 100%;
height: 100%;
border-radius: 30px;
}
}
}
}
.login_btn{
padding-top: 80px;
.btn{
width: 315px;
height: 70px;
background:url('../../assets/images/sunVillage_info/login_btn.png') no-repeat;
background-size: 100% 100%;
margin:0 auto;
font-size: 32px;
color: #fff;
line-height: 70px;
text-align: center;
border: none;
}
}
}

</style>

Yükleniyor…
İptal
Kaydet