diff --git a/.idea/ehs_mp2.iml b/.idea/ehs_mp2.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/.idea/ehs_mp2.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..28a804d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..a0ad843
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..e95ff16
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Logout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1658992730309
+
+
+ 1658992730309
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/App.vue b/App.vue
index 75c5d91..8d12b31 100644
--- a/App.vue
+++ b/App.vue
@@ -2,7 +2,7 @@
export default {
// 此处globalData为了演示其作用,不是uView框架的一部分
globalData: {
- username: '白居易'
+ appid: 'wxf7d6140f507466be'
},
onLaunch() {
// 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
@@ -15,7 +15,8 @@
*/
//var that=this
// 小程序自动登录
- /* uni.showLoading({
+ // #ifdef MP-WEIXIN
+ uni.showLoading({
title: '微信自动登录中...',
mask: true
})
@@ -54,17 +55,7 @@
})
}
});
- */
- let accessToken = this.$store.state.vuex_token;
- if(accessToken){
- uni.reLaunch({
- url:'/pages/home/home_'
- })
- }else{
- uni.reLaunch({
- url:'/pages/login/login_'
- })
- }
+ // #endif
},
}
diff --git a/common/http.api.js b/common/http.api.js
index 65e32e2..f48ecea 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -35,14 +35,6 @@ const install = (Vue, vm) => {
let getOpreation = (id)=>vm.$u.get(`/opm/operation/${id}/`);//rpj查询
let getOpl = (id)=>vm.$u.get(`/opm/opl/${id}/`);//opl作业许可证查询
-
-
-
-
-
-
-
-
vm.$u.api = {getUserInfo,
getCode,
codeLogin,
diff --git a/pages.json b/pages.json
index d2a00f0..5824cbc 100644
--- a/pages.json
+++ b/pages.json
@@ -18,9 +18,17 @@
}
},
{
- "path": "pages/login/login",
+ "path" : "pages/login/login",
+ "style" :
+ {
+ "navigationBarTitleText": "验证码登录",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/login/login_password",
"style": {
- "navigationBarTitleText": "验证码登录",
+ "navigationBarTitleText": "密码登录",
"enablePullDownRefresh": false
}
},
@@ -80,7 +88,7 @@
{
"path": "pages/workSpace/newWork/work",
"style": {
- "navigationBarTitleText": "作业管理",
+ "navigationBarTitleText": "新建作业",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
@@ -88,13 +96,37 @@
{
"path": "pages/workSpace/newWork/relevant",
"style": {
- "navigationBarTitleText": "入厂项目",
+ "navigationBarTitleText": "新建入厂项目",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/newWork/visit",
+ "style": {
+ "navigationBarTitleText": "新建来访项目",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/workSpace/list/opreation",
+ "style": {
+ "navigationBarTitleText": "作业列表",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/workSpace/list/rpj",
+ "style": {
+ "navigationBarTitleText": "入厂项目",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/workSpace/list/visit",
"style": {
"navigationBarTitleText": "来访项目",
"navigationStyle": "custom",
diff --git a/pages/login/login.vue b/pages/login/login.vue
index f5c816d..f421676 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -48,7 +48,9 @@
export default {
data() {
return {
+ wxcode: null,
imageURL: '/static/banner3.jpg',
+ testUrl: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf7d6140f507466be&redirect_uri=http%3A%2F%2Fqyjy.ctc-zc.com&response_type=code&scope=snsapi_base#wechat_redirect',
loginForm: {
phone: "",
code: ""
@@ -88,7 +90,19 @@
},
onReady() {
this.$refs.uForm.setRules(this.rules);
+ // #ifdef MP-WEIXIN
uni.hideHomeButton()
+ // #endif
+ },
+ onLoad() {
+ // #ifdef H5
+ this.wxcode = this.getUrlCode('code')
+ // 微信公众号自动登录
+ if(this.wxcode) {
+ this.wxcodeLogin()
+ }
+ // #endif
+
},
computed: {
inputStyle() {
@@ -113,8 +127,16 @@
uni.showLoading({})
this.$u.api.codeLogin(this.loginForm).then(res => {
this.$u.vuex('vuex_token', res.access)
+ // #ifdef MP-WEIXIN
let data = {openid: uni.getStorageSync('wxmp_openid')}
this.$u.api.bindmp(data).then(res=>{})
+ // #endif
+ // #ifdef H5
+ let data = {openid: uni.getStorageSync('wx_openid')}
+ if(data){
+ this.$u.api.bindwx(data).then(res=>{})
+ }
+ // #endif
this.$u.api.getUserInfo().then(res => {
this.$u.vuex('vuex_user', res)
// 修改资源请求地址
@@ -154,7 +176,43 @@
this.$u.toast('倒计时结束后再发送');
}
},
+ wxcodeLogin(){
+ uni.showLoading({
+ title: '微信登录中...',
+ mask: true
+ })
+ this.$u.api.wxLogin({
+ code: this.wxcode
+ }).then(res => {
+ this.$u.vuex('vuex_token', res.access)
+ this.$u.api.getUserInfo().then(res => {
+ uni.hideLoading()
+ uni.showToast({
+ title: "登录成功",
+ icon: "none"
+ })
+ uni.reLaunch({
+ url: "/pages/home/home"
+ })
+ this.$u.vuex('vuex_user', res)
+ // 修改资源请求地址
+ // this.$u.vuex('vuex_user.avatar', this.vuex_user.avatar +
+ // '?token=' + this.vuex_token)
+ })
+ }).catch(e => {
+ uni.setStorageSync('wx_openid', e.data.wx_openid)
+ uni.hideLoading()
+ uni.showToast({
+ title: "暂未绑定微信!",
+ icon: "none"
+ })
+ })
+ },
mpLogin() {
+ // #ifdef H5
+ this.getWxCode()
+ // #endif
+ // #ifdef MP-WEIXIN
uni.showLoading({
title: '微信登录中...',
mask: true
@@ -181,6 +239,7 @@
// '?token=' + this.vuex_token)
})
}).catch(e => {
+ uni.setStorageSync('wxmp_openid', e.data.wxmp_openid)
uni.hideLoading()
uni.showToast({
title: "暂未绑定微信!",
@@ -189,7 +248,33 @@
})
}
});
- }
+ // #endif
+ },
+ // 获取code
+ // 先判断url中有没有code,如果有code,表明已经授权,如果没有code,跳转微信授权链接
+ getWxCode () {
+ // const isWechat = () => {
+ // return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
+ // }
+ // if(isWechat()) {
+ // 截取地址中的code,如果没有code就去微信授权,如果已经获取到code了就直接把code传给后台获取openId
+ let code = this.getUrlCode('code')
+ if (code === null || code === '') {
+ window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+this.vuex_appid+'&redirect_uri=' + encodeURIComponent(this.vuex_login) + '&response_type=code&scope=snsapi_base&state=1#wechat_redirect'
+ // redirect_uri是授权成功后,跳转的url地址,微信会帮我们跳转到该链接,并且通过?的形式拼接code,这里需要用encodeURIComponent对链接进行处理。
+ // 如果配置参数一一对应,那么此时已经通过回调地址刷新页面后,你就会再地址栏中看到code了。
+ // http://127.0.0.1/pages/views/profile/login/login?code=001BWV4J1lRzz00H4J1J1vRE4J1BWV4q&state=1
+ }else{
+ this.wxcode = code
+ this.wxcodeLogin()
+ }
+ // }
+ },
+
+ getUrlCode (name) {
+ return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
+ },
+
}
};
diff --git a/pages/login/login_.vue b/pages/login/login_.vue
index 3a5465c..604d5cd 100644
--- a/pages/login/login_.vue
+++ b/pages/login/login_.vue
@@ -5,19 +5,20 @@
- 登录
+ 密码登录
+ 验证码登录
-
+
-
+
+
+
+
第三方登录
-
+
@@ -57,12 +87,15 @@
export default {
data() {
return {
+ wxcode: null,
agreement: false,
- checkedShow: false,
+ checkedShow: true,
key: "",
img: "",
username: '',
password: '',
+ phoneNumber: '',
+ message: '',
code: "",
isShow: true,
myTopBgSrc: require("../../static/login/my-bg.jpg"),
@@ -70,6 +103,11 @@
userContent: '',
privacyContent: '',
wxShow: false,
+ isPassword: true,
+ isMessage: false,
+ codeTips: "获取验证码",
+ testUrl: 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf7d6140f507466be&redirect_uri=http%3A%2F%2Fqyjy.ctc-zc.com&response_type=code&scope=snsapi_base#wechat_redirect',
+
}
},
onLoad() {
@@ -132,7 +170,67 @@
})
},
- //
+ mpLogin() {
+ // #ifdef H5
+ this.getWxCode()
+ // #endif
+ // #ifdef MP-WEIXIN
+ uni.showLoading({
+ title: '微信登录中...',
+ mask: true
+ })
+ uni.login({
+ provider: 'weixin',
+ success: (loginRes) => {
+ this.$u.api.wxmplogin({
+ code: loginRes.code
+ }).then(res => {
+ this.$u.vuex('vuex_token', res.access)
+ this.$u.api.getUserInfo().then(res => {
+ uni.hideLoading()
+ uni.showToast({
+ title: "登录成功",
+ icon: "none"
+ })
+ uni.reLaunch({
+ url: "/pages/home/home"
+ })
+ this.$u.vuex('vuex_user', res)
+ // 修改资源请求地址
+ // this.$u.vuex('vuex_user.avatar', this.vuex_user.avatar +
+ // '?token=' + this.vuex_token)
+ })
+ }).catch(e => {
+ uni.setStorageSync('wxmp_openid', e.data.wxmp_openid)
+ uni.hideLoading()
+ uni.showToast({
+ title: "暂未绑定微信!",
+ icon: "none"
+ })
+ })
+ }
+ });
+ // #endif
+ },
+ // 获取code
+ // 先判断url中有没有code,如果有code,表明已经授权,如果没有code,跳转微信授权链接
+ getWxCode() {
+ // 截取地址中的code,如果没有code就去微信授权,如果已经获取到code了就直接把code传给后台获取openId
+ let code = this.getUrlCode('code')
+ if (code === null || code === '') {
+ window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + this.vuex_appid +
+ '&redirect_uri=' + encodeURIComponent(this.vuex_login) +
+ '&response_type=code&scope=snsapi_base&state=1#wechat_redirect'
+ // redirect_uri是授权成功后,跳转的url地址,微信会帮我们跳转到该链接,并且通过?的形式拼接code,这里需要用encodeURIComponent对链接进行处理。
+ // 如果配置参数一一对应,那么此时已经通过回调地址刷新页面后,你就会再地址栏中看到code了。
+ // http://127.0.0.1/pages/views/profile/login/login?code=001BWV4J1lRzz00H4J1J1vRE4J1BWV4q&state=1
+ } else {
+ this.wxcode = code
+ this.wxcodeLogin()
+ }
+ // }
+ },
+
updateCidFn(username) {
var data = {
userCid: uni.getStorageSync('setcid'),
@@ -186,33 +284,69 @@
};
return true;
},
+ changeLogType(index) {
+ if (index === 'password') {
+ this.isPassword = true;
+ this.isMessage = false;
+ } else {
+ this.isPassword = false;
+ this.isMessage = true;
+ }
+ },
formSubmit(e) {
var that = this;
const obj = e.target.value;
if (!that.checkedParams(obj)) return;
debugger;
console.log(obj)
- that.$u.api.login(obj).then(res=>{
+ that.$u.api.login(obj).then(res => {
that.$u.vuex('vuex_token', res.access)
that.$u.vuex('vuex_refresh', res.refresh)
// let data = {openid: uni.getStorageSync('wxmp_openid')}
// that.$u.api.bindmp(data).then(res=>{})
- that.$u.api.getUserInfo().then(res=>{
+ that.$u.api.getUserInfo().then(res => {
that.$u.vuex('vuex_user', res)
// 修改资源请求地址
})
uni.reLaunch({
- url:'/pages/home/home_'
+ url: '/pages/home/home_'
})
- }
- ).catch(e=>{
+ }).catch(e => {
console.log(e)
uni.showToast({
- title:'账户密码错误',
- icon:'none'
+ title: '账户密码错误',
+ icon: 'none'
})
})
- }
+ },
+
+ codeChange(text) {
+ this.codeTips = text;
+ },
+ // 获取验证码
+ getCode() {
+ debugger;
+ if (this.phoneNumber !== '') {
+ uni.showLoading({
+ title: '正在获取验证码',
+ mask: true
+ })
+ this.$u.api.getCode({
+ phone: 16619852123
+ }).then(res => {
+ setTimeout(() => {
+ uni.hideLoading();
+ // 这里此提示会被this.start()方法中的提示覆盖
+ this.$u.toast('验证码已发送');
+ // 通知验证码组件内部开始倒计时
+ this.$refs.uCode.start();
+ }, 2000);
+ })
+ } else {
+ // this.$u.toast('倒计时结束后再发送');
+ this.$u.toast('请输入手机号');
+ }
+ },
}
}
@@ -322,8 +456,12 @@
padding: 62rpx;
}
+ .typeText {
+ margin-right: 20rpx;
+ }
+
.active {
- font-size: 38rpx;
+ font-size: 34rpx;
line-height: 72rpx;
color: #2c6fd9;
font-weight: bold;
@@ -333,7 +471,7 @@
.active::after {
display: block;
content: "";
- width: 42rpx;
+ width: 100%;
height: 6rpx;
background-color: #2c6fd9;
border-radius: 3rpx;
@@ -355,6 +493,10 @@
margin-bottom: 56rpx;
}
+ .loginItemInput {
+ border-radius: 0 88rpx 88rpx 0;
+ }
+
.code-img-item {
padding-left: 72rpx;
}
@@ -389,6 +531,20 @@
background-color: #EEEEEE;
}
+ .getMessageCode {
+ width: fit-content;
+ position: absolute;
+ top: 10%;
+ right: 20rpx;
+ height: 80%;
+ color: #ffffff;
+ font-size: 26rpx;
+ border-color: #19be6b;
+ background-color: #19be6b;
+ z-index: 100;
+ border-radius: 36rpx !important;
+ }
+
.login-btn,
.register-btn {
width: 635rpx;
diff --git a/pages/login/login_password.vue b/pages/login/login_password.vue
index f96b4b7..2fc6811 100644
--- a/pages/login/login_password.vue
+++ b/pages/login/login_password.vue
@@ -60,7 +60,9 @@ export default {
},
onReady() {
this.$refs.uForm.setRules(this.rules);
+ // #ifdef MP-WEIXIN
uni.hideHomeButton()
+ // #endif
},
computed: {
inputStyle() {
@@ -79,10 +81,19 @@ export default {
this.$u.api.login(this.loginForm).then(
res=>{
this.$u.vuex('vuex_token', res.access)
+ // #ifdef MP-WEIXIN
let data = {openid: uni.getStorageSync('wxmp_openid')}
this.$u.api.bindmp(data).then(res=>{})
+ // #endif
+ // #ifdef H5
+ let data = {openid: uni.getStorageSync('wx_openid')}
+ if(data){
+ this.$u.api.bindwx(data).then(res=>{})
+ }
+ // #endif
this.$u.api.getUserInfo().then(res=>{
this.$u.vuex('vuex_user', res)
+
// 修改资源请求地址
})
uni.reLaunch({
diff --git a/pages/my/my.vue b/pages/my/my.vue
index acfb489..5f9c5ec 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -13,12 +13,16 @@
-
+
{{vuex_user.name}}
- {{vuex_user.type}}
+
+
+
+
+
@@ -28,6 +32,7 @@
我的申请
+
@@ -43,6 +48,7 @@
+
diff --git a/pages/my/my_.vue b/pages/my/my_.vue
index 2058709..7762ffe 100644
--- a/pages/my/my_.vue
+++ b/pages/my/my_.vue
@@ -1,101 +1,451 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{vuex_user.name}}
-
-
-
-
- {{vuex_user.username}}-{{vuex_user.belong_dept_name}}-{{vuex_user.post_name}}
- 已绑定微信小程序
- 已绑定公众号通知
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{vuex_user.name}}
+ {{vuex_user.type}}
+
+
+
+ <<<<<<< HEAD
+
+
+
+
+ 我的申请
+
+ =======
+
+
+ {{vuex_user.name}}
+
+
+
+
+
+
+
+
+ {{vuex_user.username}}-{{vuex_user.belong_dept_name}}-{{vuex_user.post_name}}
+
+
+
+
+
+
+ >>>>>>> 810142d6db853cb8dd13af76655edff443dd42c1
+
+
+
+ 我的审批
+
+
+
+
+ 我的资料
+
+
+
+ <<<<<<< HEAD
+
+
+ =======
+
+
+
+
+
+
+
+
+ -->
+
+
+
+
+
+
+ >>>>>>> 810142d6db853cb8dd13af76655edff443dd42c1
+
+
-
-
+
-c
\ No newline at end of file
diff --git a/pages/workSpace/list/opreation.vue b/pages/workSpace/list/opreation.vue
new file mode 100644
index 0000000..d907575
--- /dev/null
+++ b/pages/workSpace/list/opreation.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+ {{val.title}}
+
+
+ 所属工作流:{{val.workflow_.name}}
+ 工单状态:{{val.state_.name}}
+ 提交时间:{{val.create_time}}
+ 更新时间:{{val.update_time}}
+
+
+
+
+ 处理
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/workSpace/list/rpj.vue b/pages/workSpace/list/rpj.vue
new file mode 100644
index 0000000..649f75d
--- /dev/null
+++ b/pages/workSpace/list/rpj.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+ {{val.title}}
+
+
+ 所属工作流:{{val.workflow_.name}}
+ 工单状态:{{val.state_.name}}
+ 提交时间:{{val.create_time}}
+ 更新时间:{{val.update_time}}
+
+
+
+
+ 处理
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/workSpace/list/visit.vue b/pages/workSpace/list/visit.vue
new file mode 100644
index 0000000..f149934
--- /dev/null
+++ b/pages/workSpace/list/visit.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+ {{val.title}}
+
+
+ 所属工作流:{{val.workflow_.name}}
+ 工单状态:{{val.state_.name}}
+ 提交时间:{{val.create_time}}
+ 更新时间:{{val.update_time}}
+
+
+
+
+ 处理
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/workSpace/workSpace.vue b/pages/workSpace/workSpace.vue
index a30a4a1..8e44d3b 100644
--- a/pages/workSpace/workSpace.vue
+++ b/pages/workSpace/workSpace.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
-
-
+
+
{{item.name}}
-
+
-
-
+
+
-
+
-
+
@@ -38,7 +39,7 @@
作业管理
-
+
查看更多
@@ -61,23 +62,23 @@
申请人:{{val.applicantName}}
-
+
{{val.submissionTime}}
-
+
-
+
-
+
入场项目
-
+
查看更多
@@ -100,13 +101,13 @@
申请人:{{val.applicantName}}
-
+
{{val.submissionTime}}
-
+
-
+
@@ -116,7 +117,7 @@
来访项目
-
+
查看更多
@@ -139,13 +140,13 @@
申请人:{{val.applicantName}}
-
+
{{val.submissionTime}}
-
+
-
+
@@ -153,46 +154,52 @@