From 14cae43bb6398c763d64178a29f8c19ac13b32a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=83=E8=82=89=E7=9A=84=E9=A5=BA=E5=AD=90?=
<2659004835@qq.com>
Date: Sun, 31 Jul 2022 12:01:43 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
manifest.json | 4 +-
pages/welcome-page/welcome-page.vue | 34 +++++++---
pagesA/my-opinion-list/my-opinion-list.vue | 2 +-
pagesA/opinion-submit/opinion-submit.vue | 79 +++++++++++++++++-----
4 files changed, 91 insertions(+), 28 deletions(-)
diff --git a/manifest.json b/manifest.json
index 45031e2..baa5d38 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
- "name" : "app适配微信小程序",
+ "name" : "洛河民意通调查系统",
"appid" : "__UNI__768F35C",
- "description" : "这是一款基于uniapp开发的app和微信小程序的模板框架",
+ "description" : "洛河民意通调查系统",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
diff --git a/pages/welcome-page/welcome-page.vue b/pages/welcome-page/welcome-page.vue
index 97b0768..824a883 100644
--- a/pages/welcome-page/welcome-page.vue
+++ b/pages/welcome-page/welcome-page.vue
@@ -22,19 +22,35 @@
data() {
return {
userInfo:'',
- ifFlag:false
+ ifFlag:true
}
},
methods: {
// 前往登录页
goLogin(){
- this.$toolAll.tools.showToast('正在登录...','none',10000)
- uni.login({
- provider: 'weixin',
- success: (rescode)=> {
- this.updateUserInfo(rescode.code);
- },
- });
+ // 前往群众对应的列表页
+ // uni.reLaunch({
+ // url:'/pagesA/my-opinion-list/my-opinion-list'
+ // })
+ // 前往社区对应的列表页
+ // uni.reLaunch({
+ // url:'/pagesA/community/opinion-handle/opinion-handle'
+ // })
+ // 前往管理员对应的列表页
+ // uni.reLaunch({
+ // url:'/pagesA/manager/examine-list/examine-list'
+ // })
+ if(this.ifFlag){
+ this.ifFlag = false;
+ uni.login({
+ provider: 'weixin',
+ success: (rescode)=> {
+ this.updateUserInfo(rescode.code);
+ },
+ });
+ } else {
+ this.$toolAll.tools.showToast('正在检查是否已授权','none',10000);
+ }
},
//调用登录接口
updateUserInfo(code) {
@@ -44,8 +60,10 @@
this.$requst.post('user/login',params).then(res => {
uni.hideToast();
if(res.data.token!=''){
+ this.$toolAll.tools.showToast('已授权');
let dataObj = res.data;
uni.setStorageSync('token',dataObj.token);
+
this.$toolAll.tools.showToast('登录成功');
setTimeout(()=>{
if(dataObj.utype=='def'){
diff --git a/pagesA/my-opinion-list/my-opinion-list.vue b/pagesA/my-opinion-list/my-opinion-list.vue
index c647e37..abc1e74 100644
--- a/pagesA/my-opinion-list/my-opinion-list.vue
+++ b/pagesA/my-opinion-list/my-opinion-list.vue
@@ -57,7 +57,7 @@
// 前往提交页面
goOpinionSubmit(){
uni.navigateTo({
- url:'/pagesA/opinion-submit/opinion-submit'
+ url:'/pagesA/passageway/passageway'
})
},
// 前往详情页
diff --git a/pagesA/opinion-submit/opinion-submit.vue b/pagesA/opinion-submit/opinion-submit.vue
index 08eb484..024f860 100644
--- a/pagesA/opinion-submit/opinion-submit.vue
+++ b/pagesA/opinion-submit/opinion-submit.vue
@@ -4,11 +4,11 @@
真实姓名
-
+
联系方式
-
+
@@ -59,9 +59,10 @@
-
+
描述文案
-
+
+
语音上传
@@ -78,13 +79,15 @@
-
- 类别
-
- 请选择类别
-
+
+
+ 类别
+
+ {{typeText}}
+
+
-
+
立即提交
@@ -100,9 +103,14 @@
export default {
data() {
return {
- imgArr:[],
- vedioArr:[],
- audioText:'',
+ form:{
+ name:'',//真实姓名
+ phone:'',//联系方式
+ content:''//描述方案
+ },
+ imgArr:[],//图片
+ vedioArr:[],//视频
+ audioText:'',//音频
communityList:[],//社区列表
communityIndex:0,//当前选中的社区
communityId:'',//社区id
@@ -111,11 +119,21 @@
villageIndex:0,//当前选中的村
villageText:'请选择村',
villageId:'',//村id
+ typeList:[],//类别列表
+ typeIndex:0,//当前选中的类别
+ typeText:'请选择类别',
+ typeId:''//类别id
}
},
onLoad() {
// 调用查询社区列表事件
this.getCommunityList();
+ // 调用类别查询事件
+
+ this.$requst.get('administrator/reviewedList').then(res=>{
+ if(res.code==0){
+ }
+ })
},
computed: {
...mapState({
@@ -123,6 +141,25 @@
})
},
methods: {
+ // 提交事件
+ submitEv(){
+ let params = {
+ ...this.form,
+ a:this.communityId,//社区id
+ b:this.villageId,//村ID
+ c:this.imgArr.join(','),//图片
+ d:this.vedioArr.join(','),//视频
+ e:this.audioText,//语音
+ f:this.typeId,//类别
+ }
+ console.log(params,77777);
+ // this.$requst.post('',params).then(res=>{
+
+ // })
+ // uni.reLaunch({
+ // url:'/pagesA/my-opinion-list/my-opinion-list'
+ // })
+ },
// 选择社区
changeCommunity(e){
this.communityIndex = e.detail.value;
@@ -157,10 +194,18 @@
}
})
},
- // 提交事件
- submitEv(){
- uni.reLaunch({
- url:'/pagesA/passageway/passageway'
+ // 选择类别
+ changeType(e){
+ this.typeIndex = e.detail.value;
+ this.typeId = this.typeList[this.typeIndex].id;
+ this.typeText = this.typeList[this.typeIndex].name;
+ },
+ // 类别查询
+ getTypeList(){
+ this.$requst.get('common/villageList').then(res=>{
+ if(res.code==0){
+ this.typeList = res.data.list;
+ }
})
},
// 图片选择