Browse Source

修改党员报道逻辑,修改其他已知问题;

shibei
luyan 1 year ago
parent
commit
9184d01d10
  1. 3
      miniprogram/app.json
  2. 8
      miniprogram/pages/formid/formid.js
  3. 107
      miniprogram/pages/home/home.js
  4. 39
      miniprogram/pages/my/my.js
  5. 6
      miniprogram/pages/my/my.wxml
  6. 5
      miniprogram/pages/register/register.js
  7. 38
      miniprogram/subpages/checkIn/pages/checkIn/register/register.js
  8. 4
      miniprogram/utils/config.js
  9. 2
      project.private.config.json

3
miniprogram/app.json

@ -316,9 +316,6 @@
"getLocation", "getLocation",
"chooseLocation" "chooseLocation"
], ],
"navigateToMiniProgramAppIdList": [
"wx50ebeb95943868cd"
],
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"serviceProviderTicket": "BhBC8k6Lkgi+6uDaV2haUUUH7ZC81tEpXdNMtSxiPnrYRxkRxMu5f6gprJ5i+leAKUxHM1E5YWc3P9vtgTtu2BULafIVikYURVk=" "serviceProviderTicket": "BhBC8k6Lkgi+6uDaV2haUUUH7ZC81tEpXdNMtSxiPnrYRxkRxMu5f6gprJ5i+leAKUxHM1E5YWc3P9vtgTtu2BULafIVikYURVk="
} }

8
miniprogram/pages/formid/formid.js

@ -180,6 +180,7 @@ Page({
height: '', //屏幕高度 height: '', //屏幕高度
}, },
onLoad(options) { onLoad(options) {
this.getDeptTree()
if (options.title) { if (options.title) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: options.title, title: options.title,
@ -219,7 +220,7 @@ Page({
title: '注册' title: '注册'
}) })
} }
this.getDeptTree()
}, },
//获取街道树 //获取街道树
getDeptTree() { getDeptTree() {
@ -662,10 +663,6 @@ Page({
this.showToast('请填写居住小区名称') this.showToast('请填写居住小区名称')
return false return false
} }
// if(this.data.form.couplingCommunity.length == 0){
// this.showToast('请选择包联单位名称')
// return false
// }
} else if (this.data.form.shibei == '0') { } else if (this.data.form.shibei == '0') {
if(this.data.form.region != '' && this.data.form.villageName != ''){ if(this.data.form.region != '' && this.data.form.villageName != ''){
let temp = this.data.form.region + '-' + this.data.form.villageName; let temp = this.data.form.region + '-' + this.data.form.villageName;
@ -711,7 +708,6 @@ Page({
wx.login({ wx.login({
success(res) { success(res) {
if (res.code) { if (res.code) {
console.log('微信CODE: ' + res.code)
const para = { const para = {
...than.data.form, ...than.data.form,
wxCode: res.code wxCode: res.code

107
miniprogram/pages/home/home.js

@ -3,7 +3,6 @@ const api = require("../../utils/api")
const homeApi = require("../../utils/home") const homeApi = require("../../utils/home")
const global = require("../../utils/config") const global = require("../../utils/config")
import checkoutVersion from "../../utils/checkVersion" import checkoutVersion from "../../utils/checkVersion"
// import regeneratorRuntime from "../../utils/runtime.js"
Page({ Page({
data: { data: {
statusHeight: 0, // 自定义头部状态栏高度 statusHeight: 0, // 自定义头部状态栏高度
@ -30,7 +29,6 @@ Page({
street: "", //所在街道 street: "", //所在街道
isCarryLoad: false, isCarryLoad: false,
userId: "", userId: "",
// userInfo: { // userInfo: {
// nickname: "", // nickname: "",
// mobile: "", // mobile: "",
@ -43,32 +41,20 @@ Page({
communityId: "", // 社区id communityId: "", // 社区id
}, },
async onLoad(options) { onLoad() {
// wx.showLoading({ this.initLoad();
// title: "加载中,请稍后",
// mask: true
// })
this.initLoad()
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
}) });
await this.getUserState()
this.data.isCarryLoad = true
},
onTabItemTap() {
this.getUserState()
},
onShow() {
// 检查版本更新 // 检查版本更新
checkoutVersion() checkoutVersion();
// this.getFirstInfo() this.data.isCarryLoad = true;
}, },
onHide(){ onShow() {},
onHide() {
let token = wx.getStorageSync("token") let token = wx.getStorageSync("token")
if(!token){ if (!token) {
wx.reLaunch({ wx.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) })
@ -77,74 +63,11 @@ Page({
onReachBottom() { onReachBottom() {
this.setData({ this.setData({
loadMoreVisible: true loadMoreVisible: true
}) });
if (this.data.loadMoreType === "loading") { if (this.data.loadMoreType === "loading") {
this.data.pageNo += 1 this.data.pageNo += 1
// this.getNewsList()
} }
}, },
// 根据微信code查询用户当前状态
getUserState() {
// let that = this
// wx.showLoading({
// title: '登录中',
// mask:true
// })
// wx.login({
// success(res) {
// if (res.code) {
// let code = res.code
// api.getToken(code).then(res => {
// wx.hideLoading()
// const state = res.data.userState
// app.globalData.infoCompleted = state
// wx.setStorageSync("topGridName", res.data.grid)
// wx.setStorageSync("gridId", res.data.gridId) //当前网格id,新闻、议题、项目分享时用
// wx.setStorageSync("token", res.data.token)
// wx.setStorageSync("userId", res.data.userId)
// that.setData({
// departmentName: res.data.grid,
// departmentId: res.data.gridId,
// userId: res.data.userId
// })
// // that.getComplete()
// // that.getUserLoginlog()
// if (state == "4") {
// // 非扫码进入,通过搜索小程序直接进入的情况
// if (wx.getStorageSync("shareObj")) {
// const para = JSON.parse(wx.getStorageSync("shareObj"))
// app.globalData.tempGridId = "1222489495054602241"
// wx.redirectTo({
// url: "/pages/formid/formid?gid=1222489495054602241"
// })
// } else {
// wx.redirectTo({
// url: "/pages/formid/formid?gid=1222489495054602241"
// })
// }
// } else {
// if (wx.getStorageSync("shareObj")) {
// const para = JSON.parse(wx.getStorageSync("shareObj"))
// if (para.shareType === "newsDetail") {
// wx.navigateTo({
// url: `/subpages/home/pages/newsDetail/newsDetail?id=${para.detailId}`
// })
// } else if (para.shareType === "discussionDetail") {
// wx.navigateTo({
// url: `/subpages/discussion/pages/discussionDetail/discussionDetail?detailId=${para.detailId}&type=${para.type}&showClassify=${para.showClassify}`
// })
// }
// wx.removeStorageSync("shareObj")
// }
// that.initLoad()
// }
// })
// } else {
// console.log("登录失败" + res.errMsg)
// }
// }
// })
},
handleXinxin() { handleXinxin() {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: 'wxf09c0e08ffee7711', appId: 'wxf09c0e08ffee7711',
@ -220,7 +143,6 @@ Page({
}, },
// 初始化加载 // 初始化加载
initLoad() { initLoad() {
// timestamp: getTimestamp(),
this.setData({ this.setData({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -228,19 +150,8 @@ Page({
loadMoreType: "loading", loadMoreType: "loading",
loadMoreVisible: false loadMoreVisible: false
}) })
// this.getBannerList()
// this.getIndexSudokuState()
// this.getProjectList()
// this.getInfoList()
// this.getUnreadNum()
// this.getNewsList()
this.getUserInfo() this.getUserInfo()
// this.getAppMenu()
}, },
// onShow() {
// this.getUnreadNum()
// },
// 切换网格,跳转到网格列表
changeGrid() { changeGrid() {
wx.navigateTo({ wx.navigateTo({
url: "/subpages/changegrid/pages/changeGrid/changeGrid" url: "/subpages/changegrid/pages/changeGrid/changeGrid"

39
miniprogram/pages/my/my.js

@ -20,29 +20,17 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getUserInfo()
this.getUserProfile() this.getUserProfile()
}, },
getUserProfile(e) { getUserProfile(e) {
// let than = this
// wx.getUserInfo({
// success: function (res) {
// console.log(res);
// var userInfo = res.userInfo;
// var avatarUrl = userInfo.avatarUrl; // 用户头像链接
// // 其他操作...
// than.setData({
// faceImg: avatarUrl
// })
// },
// fail: function (res) {
// // 用户拒绝授权,处理授权失败的情况
// }
// });
let obj = JSON.parse(wx.getStorageSync('userInfo')) let obj = JSON.parse(wx.getStorageSync('userInfo'))
this.setData({ if (null != obj.id) {
userId: obj.id, this.setData({
faceImg: obj.faceImg userId: obj.id,
}) faceImg: obj.faceImg
})
}
this.getCentralhousehold(); this.getCentralhousehold();
}, },
/** /**
@ -111,7 +99,7 @@ Page({
delta: 1 delta: 1
}) })
}, },
logoout() { logout() {
let than = this let than = this
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
@ -126,6 +114,9 @@ Page({
wx.removeStorage({ wx.removeStorage({
key: 'token', key: 'token',
}) })
wx.removeStorage({
key: 'userInfo',
})
wx.reLaunch({ wx.reLaunch({
url: '/pages/login/login' url: '/pages/login/login'
}) })
@ -181,7 +172,6 @@ Page({
api.userInfoUpdate(para).then(res => { api.userInfoUpdate(para).then(res => {
if (res.code == 0) { if (res.code == 0) {
wx.setStorageSync(para, 'userInfo') wx.setStorageSync(para, 'userInfo')
_this.getUserInfo() _this.getUserInfo()
} }
}).catch(err => { }).catch(err => {
@ -209,9 +199,9 @@ Page({
getCentralhousehold() { getCentralhousehold() {
let para = this.data.userId let para = this.data.userId
partyApi.getCentralhousehold(para).then(res => { partyApi.getCentralhousehold(para).then(res => {
if (res.data.pass === 1) { if (null == res.data) {
this.setData({ this.setData({
pass: res.data.pass // 审核状态 pass: 0 // 审核状态
}) })
} else { } else {
this.setData({ this.setData({
@ -220,7 +210,4 @@ Page({
} }
}) })
}, },
handelClickEditPassword(){
},
}) })

6
miniprogram/pages/my/my.wxml

@ -1,6 +1,6 @@
<view class="header"> <view class="header">
<image src="../../images/back.png" class="back" style=" top: {{statusHeight}}px;" bindtap="back"></image> <image class="back" style=" top: {{statusHeight}}px;" bindtap="back"></image>
<image class="header-bg" src="../../images/bg.png" mode="widthFix" /> <image class="header-bg" mode="widthFix" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;"> <view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
我的 我的
</view> </view>
@ -25,7 +25,7 @@
<image src="../../images/my/my01.png" /> <image src="../../images/my/my01.png" />
</navigator> </navigator>
<view class="w40"></view> <view class="w40"></view>
<navigator url="" class="grid2 red" bind:tap="logoout"> <navigator url="" class="grid2 red" bind:tap="logout">
<view> <view>
<view class="h1">退出登录</view> <view class="h1">退出登录</view>
<view class="h2">点击退出页面</view> <view class="h2">点击退出页面</view>

5
miniprogram/pages/register/register.js

@ -8,8 +8,6 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
//上级页面传递过来的gid //上级页面传递过来的gid
console.log(options)
console.log(options.gid)
if(options.gid){ if(options.gid){
this.setData({ this.setData({
gid: options.gid gid: options.gid
@ -23,12 +21,9 @@ Page({
wx.login({ wx.login({
success(res) { success(res) {
if (res.code) { if (res.code) {
console.log('微信CODE: ' + res.code)
console.log('res', res)
let code = res.code let code = res.code
let date = Date.parse(new Date()) let date = Date.parse(new Date())
api.getToken(code).then(function(res){ api.getToken(code).then(function(res){
console.log(res.data)
let state = res.data.userState let state = res.data.userState
wx.login({ wx.login({
success(res2) { success(res2) {

38
miniprogram/subpages/checkIn/pages/checkIn/register/register.js

@ -1,5 +1,4 @@
const api = require('../../../../../utils/partApi') const api = require('../../../../../utils/partApi')
const app = getApp()
Page({ Page({
/** /**
@ -7,7 +6,7 @@ Page({
*/ */
data: { data: {
look: true, look: true,
status:0, //审核状态 status: 0, //审核状态
informFlag: false, informFlag: false,
selectOption: [{ selectOption: [{
label: '机关企事业单位', label: '机关企事业单位',
@ -55,7 +54,7 @@ Page({
workType: '', //单位性质 workType: '', //单位性质
workIndustry: '', //所属行业 workIndustry: '', //所属行业
party: 1, //是否为党员 party: 1, //是否为党员
volunteer: 1, //是否加入志愿者 volunteer: '1', //是否加入志愿者
gridStaff: 1, //是否红色网格 gridStaff: 1, //是否红色网格
owners: 1, //是否参加业主委员会 owners: 1, //是否参加业主委员会
allDeptIds: [], //社区id allDeptIds: [], //社区id
@ -350,9 +349,17 @@ Page({
'form.gridStaff': res.data.gridStaff, 'form.gridStaff': res.data.gridStaff,
'form.volunteer': res.data.volunteer, 'form.volunteer': res.data.volunteer,
}) })
if(res.data.status === 0 && res.data.couplingCommunity.length > 0){ if(res.data.couplingCommunity.length === 0){
this.setData({ this.setData({
look:false 'form.party': 1,
'form.volunteer': 1,
'form.owners': 1,
'form.gridStaff': 1
})
}
if (res.data.status === 0 && res.data.couplingCommunity.length > 0) {
this.setData({
look: false
}) })
this.handleNext(); this.handleNext();
this.submit(); this.submit();
@ -572,6 +579,7 @@ Page({
return return
} }
let than = this let than = this
console.log(para);
api.submitReportparty(para).then(res => { api.submitReportparty(para).then(res => {
if (res.code == '0') { if (res.code == '0') {
this.tipData = res.data; this.tipData = res.data;
@ -584,16 +592,14 @@ Page({
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}); });
}else{ } else {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: res.msg, content: res.msg,
complete: (res) => { complete: (res) => {
if (res.cancel) { if (res.cancel) {}
if (res.confirm) {}
} }
if (res.confirm) {
}
}
}) })
} }
}).catch(err => { }).catch(err => {
@ -616,18 +622,18 @@ Page({
delta: 1 delta: 1
}) })
}, },
handleEdit(){ handleEdit() {
this.setData({ this.setData({
submitStatus: false, submitStatus: false,
look: false look: false
}) })
}, },
handleNext() { handleNext() {
if(this.data.informFlag){ if (this.data.informFlag) {
this.setData({ this.setData({
informFlag: false informFlag: false
}) })
}else{ } else {
this.setData({ this.setData({
informFlag: true informFlag: true
}) })

4
miniprogram/utils/config.js

@ -8,8 +8,8 @@ module.exports = {
// 现在小程序的功能 主要走咱这边自己的接口,另外 党群服务中心、需求清单、问卷调查走产品的接口,所以导致接口半路径不同 // 现在小程序的功能 主要走咱这边自己的接口,另外 党群服务中心、需求清单、问卷调查走产品的接口,所以导致接口半路径不同
function BASEURL() { function BASEURL() {
return "https://epdc-shibei.elinkservice.cn/epdc-api/api/" // 正式环境 // return "https://epdc-shibei.elinkservice.cn/epdc-api/api/" // 正式环境
// return "http://localhost:10994/epdc-api/api/" return "http://localhost:10994/epdc-api/api/"
} }
// 获取 党群服务中心、需求清单、问卷调查 等模块的半路径 // 获取 党群服务中心、需求清单、问卷调查 等模块的半路径
function getProductionBaseUrl () { function getProductionBaseUrl () {

2
project.private.config.json

@ -1,6 +1,6 @@
{ {
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "%252525E5%25252585%2525259A%252525E7%252525BE%252525A4e%252525E5%252525AE%252525B6-%252525E7%252525BA%252525BF%252525E4%252525B8%2525258A%252525E7%25252589%25252588", "projectname": "%25252525E5%2525252585%252525259A%25252525E7%25252525BE%25252525A4e%25252525E5%25252525AE%25252525B6-%25252525E7%25252525BA%25252525BF%25252525E4%25252525B8%252525258A%25252525E7%2525252589%2525252588",
"libVersion": "2.31.1", "libVersion": "2.31.1",
"condition": { "condition": {
"miniprogram": { "miniprogram": {

Loading…
Cancel
Save