Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_wxcp_app into dev
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form" v-show="current == 0 || isEdit">
|
<div class="form" v-show="current == 0 || isEdit">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-item">
|
<!-- <div class="form-item">
|
||||||
<div class="form-item__wrapper">
|
<div class="form-item__wrapper">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<i>*</i>
|
<i>*</i>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<AiSelect dict="fpHouseType" v-model="form.houseType"></AiSelect>
|
<AiSelect dict="fpHouseType" v-model="form.houseType"></AiSelect>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-item" v-if="!isEdit">
|
<div class="form-item" v-if="!isEdit">
|
||||||
<div class="form-item__wrapper">
|
<div class="form-item__wrapper">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
@@ -588,7 +588,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
rules() {
|
rules() {
|
||||||
return {
|
return {
|
||||||
houseType: '请选择户类型',
|
// houseType: '请选择户类型',
|
||||||
objectType: '请选择监测对象类型',
|
objectType: '请选择监测对象类型',
|
||||||
name: '请输入户主姓名',
|
name: '请输入户主姓名',
|
||||||
idNumber: '请输入身份证号',
|
idNumber: '请输入身份证号',
|
||||||
@@ -630,8 +630,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!this.form.idNumber) {
|
if (!this.form.idNumber) {
|
||||||
return this.$u.toast('请输入身份证号')
|
return this.$u.toast('请输入身份证号')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,19 +63,21 @@ export default {
|
|||||||
riskType: this.riskType,
|
riskType: this.riskType,
|
||||||
riskEliminationMethod: this.riskEliminationMethod,
|
riskEliminationMethod: this.riskEliminationMethod,
|
||||||
}
|
}
|
||||||
|
// 0:待纳入、1:监测中、2:待解除、3:已解除、4:已驳回
|
||||||
if(this.pass == 1) { // 网格长
|
if(this.pass == 1) { // 网格长
|
||||||
|
if(this.status == 1) {
|
||||||
if(!this.riskEliminationMethod) {
|
if(!this.riskEliminationMethod) {
|
||||||
return this.$u.toast('请选择风险消除方式')
|
return this.$u.toast('请选择风险消除方式')
|
||||||
}
|
}
|
||||||
if(this.status == 1) {
|
|
||||||
url = '/app/apppreventionreturntopoverty/relieve' // 解除
|
url = '/app/apppreventionreturntopoverty/relieve' // 解除
|
||||||
} else if (this.status == 4 || this.status == 3) {
|
} else if (this.status == 3 || this.status == 4) {
|
||||||
if(!this.riskType) {
|
if(!this.riskType) {
|
||||||
return this.$u.toast('请选择风险因素')
|
return this.$u.toast('请选择风险因素')
|
||||||
}
|
}
|
||||||
url = `/app/apppreventionreturntopoverty/examine` // 纳入监测
|
url = `/app/apppreventionreturntopoverty/examine` // 纳入监测
|
||||||
}
|
}
|
||||||
} else { // 网格员
|
}
|
||||||
|
if (this.pass == '') { // 网格员
|
||||||
if(this.status == '0' || this.status == '3' || this.status == '4') {
|
if(this.status == '0' || this.status == '3' || this.status == '4') {
|
||||||
if(!this.riskType) {
|
if(!this.riskType) {
|
||||||
return this.$u.toast('请选择风险因素')
|
return this.$u.toast('请选择风险因素')
|
||||||
|
|||||||
@@ -10,12 +10,7 @@ export const config = {
|
|||||||
mutations: {
|
mutations: {
|
||||||
getConfig(state, params) {
|
getConfig(state, params) {
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
Vue.set(state, key, user[key])
|
Vue.set(state, key, params[key])
|
||||||
}
|
|
||||||
},
|
|
||||||
clearConfig(state) {
|
|
||||||
for (const key in state) {
|
|
||||||
delete state[key]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -26,7 +21,6 @@ export const config = {
|
|||||||
if (state.agentSignURL == url) {
|
if (state.agentSignURL == url) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
} else {
|
} else {
|
||||||
commit("clearConfig")
|
|
||||||
commit("getConfig", {agentSignURL: url})
|
commit("getConfig", {agentSignURL: url})
|
||||||
let action = "/app/wxcp/portal/agentSign"
|
let action = "/app/wxcp/portal/agentSign"
|
||||||
if (!!params?.action) {
|
if (!!params?.action) {
|
||||||
@@ -59,18 +53,22 @@ export const config = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCode({state, dispatch}, tryAgentSign = false) {
|
getCode({state, dispatch}, tryAgentSign = false) {
|
||||||
let {corpId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_base"
|
let {corpid: corpId, suiteId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_base"
|
||||||
if (/\/AppForm\//.test(location.search)) {
|
if (/\/AppForm\//.test(location.search)) {
|
||||||
scope = "snsapi_userinfo"
|
scope = "snsapi_userinfo"
|
||||||
|
} else if (suiteId) {
|
||||||
|
corpId = suiteId
|
||||||
|
scope = "snsapi_privateinfo"
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (corpId && scope) {
|
if (corpId && scope) {
|
||||||
location.replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE#wechat_redirect'
|
let oauthURL = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE#wechat_redirect'
|
||||||
.replace(/APPID/g, cid)
|
.replace(/APPID/g, corpId)
|
||||||
.replace(/REDIRECT_URI/g, REDIRECT_URI)
|
.replace(/REDIRECT_URI/g, REDIRECT_URI)
|
||||||
.replace(/SCOPE/g, scope))
|
.replace(/SCOPE/g, scope)
|
||||||
|
location.replace(oauthURL)
|
||||||
} else if (!tryAgentSign) {
|
} else if (!tryAgentSign) {
|
||||||
dispatch("agentSign").then(() => dispatch("getCode", true))
|
dispatch("agentSign").then(() => dispatch("getCode", true)).then(() => resolve())
|
||||||
} else reject("URL缺少必要参数(corpId)")
|
} else reject("URL缺少必要参数(corpId)")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -90,8 +88,11 @@ export const config = {
|
|||||||
return encrypted.toString();
|
return encrypted.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let {module} = params
|
let {module, code} = params, action = "/auth/oauth/token"
|
||||||
return http.post("/auth/oauth/token", null, {
|
if (!!code) {
|
||||||
|
action = "/auth/wechatcp/token"
|
||||||
|
}
|
||||||
|
return http.post(action, params, {
|
||||||
withoutToken: true,
|
withoutToken: true,
|
||||||
module,
|
module,
|
||||||
params: {
|
params: {
|
||||||
@@ -104,9 +105,7 @@ export const config = {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.access_token) {
|
if (res?.access_token) {
|
||||||
return [res?.token_type, res?.access_token].join(" ").trim()
|
return [res?.token_type, res?.access_token].join(" ").trim()
|
||||||
}
|
} else return Promise.reject(res.msg)
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({title: err, icon: 'none'})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['getToken','getAccount']),
|
...mapActions(['getToken', 'getAccount', 'getCode']),
|
||||||
...mapMutations(['login', 'logout']),
|
...mapMutations(['login', 'logout']),
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.loginForm.validate(v => {
|
this.$refs.loginForm.validate(v => {
|
||||||
@@ -74,7 +74,37 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
if (/wxwork/.test(navigator.userAgent)) {
|
||||||
|
//在企微端
|
||||||
|
if (this.$route.query.code) {
|
||||||
|
let {name: module, libPath} = this.currentApp,
|
||||||
|
corpId = 'ww596787bb70f08288'
|
||||||
|
if (/\/project\/police\//.test(libPath)) {
|
||||||
|
module = 'hnjc'
|
||||||
|
} else if (/\/project\/beta\//.test(libPath)) {
|
||||||
|
corpId = 'ww2a667717a70164f1'
|
||||||
|
module = 'wangge'
|
||||||
|
}
|
||||||
|
let {code} = this.$route.query
|
||||||
|
this.getToken({code}).then(token => {
|
||||||
|
if (token) {
|
||||||
|
this.login(token)
|
||||||
|
if (module != 'AppCountryAlbum') {
|
||||||
|
this.getAccount({module})
|
||||||
|
}
|
||||||
|
this.target ? uni.reLaunch({url: this.target}) : uni.navigateBack({})
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.err = err
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.getCode().catch(err => {
|
||||||
|
this.err = err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
this.handleLogout()
|
this.handleLogout()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$refs.loginForm.setRules(this.rules)
|
this.$refs.loginForm.setRules(this.rules)
|
||||||
|
|||||||
Reference in New Issue
Block a user