Browse Source

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

shibei
luyan 1 year ago
parent
commit
9184d01d10
  1. 3
      miniprogram/app.json
  2. 8
      miniprogram/pages/formid/formid.js
  3. 103
      miniprogram/pages/home/home.js
  4. 31
      miniprogram/pages/my/my.js
  5. 6
      miniprogram/pages/my/my.wxml
  6. 5
      miniprogram/pages/register/register.js
  7. 18
      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",
"chooseLocation"
],
"navigateToMiniProgramAppIdList": [
"wx50ebeb95943868cd"
],
"sitemapLocation": "sitemap.json",
"serviceProviderTicket": "BhBC8k6Lkgi+6uDaV2haUUUH7ZC81tEpXdNMtSxiPnrYRxkRxMu5f6gprJ5i+leAKUxHM1E5YWc3P9vtgTtu2BULafIVikYURVk="
}

8
miniprogram/pages/formid/formid.js

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

103
miniprogram/pages/home/home.js

@ -3,7 +3,6 @@ const api = require("../../utils/api")
const homeApi = require("../../utils/home")
const global = require("../../utils/config")
import checkoutVersion from "../../utils/checkVersion"
// import regeneratorRuntime from "../../utils/runtime.js"
Page({
data: {
statusHeight: 0, // 自定义头部状态栏高度
@ -30,7 +29,6 @@ Page({
street: "", //所在街道
isCarryLoad: false,
userId: "",
// userInfo: {
// nickname: "",
// mobile: "",
@ -43,29 +41,17 @@ Page({
communityId: "", // 社区id
},
async onLoad(options) {
// wx.showLoading({
// title: "加载中,请稍后",
// mask: true
// })
this.initLoad()
onLoad() {
this.initLoad();
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
})
await this.getUserState()
this.data.isCarryLoad = true
},
onTabItemTap() {
this.getUserState()
},
onShow() {
});
// 检查版本更新
checkoutVersion()
// this.getFirstInfo()
checkoutVersion();
this.data.isCarryLoad = true;
},
onShow() {},
onHide() {
let token = wx.getStorageSync("token")
if (!token) {
@ -77,74 +63,11 @@ Page({
onReachBottom() {
this.setData({
loadMoreVisible: true
})
});
if (this.data.loadMoreType === "loading") {
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() {
wx.navigateToMiniProgram({
appId: 'wxf09c0e08ffee7711',
@ -220,7 +143,6 @@ Page({
},
// 初始化加载
initLoad() {
// timestamp: getTimestamp(),
this.setData({
pageNo: 1,
pageSize: 10,
@ -228,19 +150,8 @@ Page({
loadMoreType: "loading",
loadMoreVisible: false
})
// this.getBannerList()
// this.getIndexSudokuState()
// this.getProjectList()
// this.getInfoList()
// this.getUnreadNum()
// this.getNewsList()
this.getUserInfo()
// this.getAppMenu()
},
// onShow() {
// this.getUnreadNum()
// },
// 切换网格,跳转到网格列表
changeGrid() {
wx.navigateTo({
url: "/subpages/changegrid/pages/changeGrid/changeGrid"

31
miniprogram/pages/my/my.js

@ -20,29 +20,17 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getUserInfo()
this.getUserProfile()
},
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'))
if (null != obj.id) {
this.setData({
userId: obj.id,
faceImg: obj.faceImg
})
}
this.getCentralhousehold();
},
/**
@ -111,7 +99,7 @@ Page({
delta: 1
})
},
logoout() {
logout() {
let than = this
wx.showModal({
title: '提示',
@ -126,6 +114,9 @@ Page({
wx.removeStorage({
key: 'token',
})
wx.removeStorage({
key: 'userInfo',
})
wx.reLaunch({
url: '/pages/login/login'
})
@ -181,7 +172,6 @@ Page({
api.userInfoUpdate(para).then(res => {
if (res.code == 0) {
wx.setStorageSync(para, 'userInfo')
_this.getUserInfo()
}
}).catch(err => {
@ -209,9 +199,9 @@ Page({
getCentralhousehold() {
let para = this.data.userId
partyApi.getCentralhousehold(para).then(res => {
if (res.data.pass === 1) {
if (null == res.data) {
this.setData({
pass: res.data.pass // 审核状态
pass: 0 // 审核状态
})
} else {
this.setData({
@ -220,7 +210,4 @@ Page({
}
})
},
handelClickEditPassword(){
},
})

6
miniprogram/pages/my/my.wxml

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

5
miniprogram/pages/register/register.js

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

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

@ -1,5 +1,4 @@
const api = require('../../../../../utils/partApi')
const app = getApp()
Page({
/**
@ -55,7 +54,7 @@ Page({
workType: '', //单位性质
workIndustry: '', //所属行业
party: 1, //是否为党员
volunteer: 1, //是否加入志愿者
volunteer: '1', //是否加入志愿者
gridStaff: 1, //是否红色网格
owners: 1, //是否参加业主委员会
allDeptIds: [], //社区id
@ -350,6 +349,14 @@ Page({
'form.gridStaff': res.data.gridStaff,
'form.volunteer': res.data.volunteer,
})
if(res.data.couplingCommunity.length === 0){
this.setData({
'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
@ -572,6 +579,7 @@ Page({
return
}
let than = this
console.log(para);
api.submitReportparty(para).then(res => {
if (res.code == '0') {
this.tipData = res.data;
@ -589,10 +597,8 @@ Page({
title: '提示',
content: res.msg,
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
if (res.cancel) {}
if (res.confirm) {}
}
})
}

4
miniprogram/utils/config.js

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

Loading…
Cancel
Save