ccj 3 anos atrás
pai
commit
67bb0352f9

+ 1 - 0
pages/grain_pulse/enter.vue

@@ -391,6 +391,7 @@
 								//成功后
 								console.log("提交企业信息",res)
 								if (res.data.code == 200) {
+									that.deptList.id = res.data.data
 									var data={
 										compName:'',
 										title:'',

+ 3 - 0
pages/grain_pulse/home.vue

@@ -72,6 +72,9 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		components: {
 

+ 64 - 64
pages/grain_pulse/perfect.vue

@@ -69,7 +69,7 @@
 				</u-form-item>
 			</view>
 		</u-form>
-		<u-button :type="buttonshow?'success':''" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
+		<u-button type="success" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
 	</view>
 </template>
 
@@ -103,13 +103,13 @@
 			}
 		},
 		computed: {
-			buttonshow(){
-				if(!this.deptList.companyContant&&this.label.length==0&&this.imgList.length==0&&!this.deptList.email&&!this.deptList.fax){
-					return false
-				}else{
-					return true
-				}
-			}
+			// buttonshow(){
+			// 	if(!this.deptList.companyContant&&this.label.length==0&&this.imgList.length==0&&!this.deptList.email&&!this.deptList.fax){
+			// 		return false
+			// 	}else{
+			// 		return true
+			// 	}
+			// }
 		},
 		methods: {
 			add() {
@@ -156,70 +156,70 @@
 			},
 			submit() {
 				
-				let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
-				if(this.buttonshow){
-					var that=this
-					for(var i=0;i<this.Persons.length;i++){
-						if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
-							this.$api.msg('联系人姓名2-10个字')
-							return
-						}
-						if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
-							this.$api.msg('联系人电话7-15位数字')
-							return
-						}
-					}
-					if(!re.test(this.deptList.email)){
-						this.$api.msg('邮箱输入错误')
+				// let re = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/;
+				// if(this.buttonshow){
+				// }
+				
+				var that=this
+				for(var i=0;i<this.Persons.length;i++){
+					if(this.Persons[i].contacts.length<2||this.Persons[i].contacts.length>10){
+						this.$api.msg('联系人姓名2-10个字')
 						return
 					}
-					if(this.deptList.fax.length<6||this.deptList.fax.length>20){
-						this.$api.msg('传真输入错误')
+					if(this.Persons[i].contactsPhone.length<2||this.Persons[i].contactsPhone.length>15){
+						this.$api.msg('联系人电话7-15位数字')
 						return
 					}
-					this.deptList.label=this.label.toString()
-					this.deptList.sitePhotoAddress=this.imgList.toString()
-					this.deptList.settledCompanyContacts=this.Persons
-					uni.showModal({
-						content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
-						showCancel: true,
-						confirmText: '提交',
-						success: function(res) {
-							if (res.confirm) {
-								uni.showLoading({
-									title:"正在提交"
-								})
-								that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
-									if (res.data.code == 200) {
-										var data={
-											compName:'',
-											title:'',
-											mainBusinessType:'',
-											companyProfile:'',
-										}
-										that.$store.commit('enterchange',data)
-										uni.switchTab({
-											url:'/pages/grain_pulse/home'
-										})
-									}else{
-										this.$api.msg(res.data.message)
+				}
+				// if(!re.test(this.deptList.email)){
+				// 	this.$api.msg('邮箱输入错误')
+				// 	return
+				// }
+				// if(this.deptList.fax.length<6||this.deptList.fax.length>20){
+				// 	this.$api.msg('传真输入错误')
+				// 	return
+				// }
+				this.deptList.label=this.label.toString()
+				this.deptList.sitePhotoAddress=this.imgList.toString()
+				this.deptList.settledCompanyContacts=this.Persons
+				uni.showModal({
+					content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
+					showCancel: true,
+					confirmText: '提交',
+					success: function(res) {
+						if (res.confirm) {
+							uni.showLoading({
+								title:"正在提交"
+							})
+							that.$api.doRequest('post', '/settledCompanyInfo/api/editSettledCompanyInfo', that.deptList).then(res => {
+								if (res.data.code == 200) {
+									var data={
+										compName:'',
+										title:'',
+										mainBusinessType:'',
+										companyProfile:'',
 									}
-									uni.hideLoading()
-								})
-								.catch(res => {
-									console.log("系统异常",res)
-									uni.hideLoading()
-									uni.showToast({
-										title: "系统异常,请联系管理员",
-										icon: 'none',
-										duration: 2000
+									that.$store.commit('enterchange',data)
+									uni.navigateBack({
+										delta:2
 									})
+								}else{
+									this.$api.msg(res.data.message)
+								}
+								uni.hideLoading()
+							})
+							.catch(res => {
+								console.log("系统异常",res)
+								uni.hideLoading()
+								uni.showToast({
+									title: "系统异常,请联系管理员",
+									icon: 'none',
+									duration: 2000
 								})
-							}
+							})
 						}
-					})
-				}
-				
+					}
+				})
 			}
 		}
 	}

+ 17 - 46
pages/public/reset.vue

@@ -143,67 +143,38 @@
 			},
 			reset(){
 				var that = this
+				uni.showLoading({
+					title: '重置密码中'
+				})
 				this.$api.doRequest('post','/commonUser/resetPassword',{phone:this.phone,password:this.password,verifyCode:this.verifyCode}).then(res => {
-				    // 获得数据
+				    console.log("重置密码",res)
+					// 获得数据
 					if(res.data.code==200){
-						var that=this
-						uni.showLoading({
-							title: '登录中',
-							mask:true
-						})
-						this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password}).then(req => {
-						if(res.data.code==200){
-					this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.phone,
-					veriCode: "123456",}).then(res1 => {
-								if(res1.data.code==200){
-									uni.setStorageSync('pcUserInfo', res1.data.data)
-								}else{
-									that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',
-									veriCode: "123456",}).then(res2 => {
-										uni.setStorageSync('pcUserInfo', res2.data.data)
-									})
-								}
-							})
-							uni.setStorageSync('userInfo', req.data.data)
-							that.$store.commit('login', req.data.data)
-							// that.liangxinLogin()
-							uni.switchTab({
-								url: '/pages/sale/information'
-							});
-							uni.hideLoading()
-						}else{
-							uni.showToast({
-								title: res.data.message,
-								icon:'none',
-								duration: 2000
-							})
-						}
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 1000)
+						uni.showToast({
+							title: '重置成功',
+							icon: 'none',
+							duration: 2000
 						})
-						.catch(res => {
-						    uni.showToast({
-						    	title: res.data.message,
-						    	icon:'none',
-						    	duration: 2000
-						    })
-						});
 					}else{
 						uni.showToast({
-							title: res.data.message,
+							title: "系统异常,请联系管理员",
 							icon:'none',
 							duration: 2000
 						})
 					}
-					uni.showLoading({
-						title: '登录中',
-						mask:true
-					})
+					uni.hideLoading()
 				})
 				.catch(res => {
+					console.log("重置密码",res)
 				    uni.showToast({
-				    	title: res.data.message,
+				    	title: "系统异常,请联系管理员",
 				    	icon:'none',
 				    	duration: 2000
 				    })
+					uni.hideLoading()
 				});
 			},
 			consent(){

+ 21 - 20
pages/sale/information.vue

@@ -178,26 +178,7 @@
 			this.loadData()
 			var userInfo = uni.getStorageSync("userInfo")
 			var that = this
-			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
-				console.log("checkSession",res)
-				if (res.data.data == "INVALID") {
-					uni.showModal({
-						title: '登录提示',
-						content: 'Session过期需要重新登录,是否立即登录?',
-						showCancel: true,
-						confirmText: '登录',
-						success: (e) => {
-							if (e.confirm) {
-								uni.navigateTo({
-									url: '/pages/public/login'
-								})
-							}
-						},
-						fail: () => {},
-						complete: () => {}
-					})
-				}
-			})
+			
 			this.$api.doRequest('get', '/notice/query/noticeNumber').then(res => {
 				console.log("noticeNumber",res)
 				if (res.data.data) {
@@ -237,6 +218,26 @@
 				});
 			}
 			var that = this
+			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
+				console.log("checkSession",res)
+				if (res.data.data == "INVALID") {
+					uni.showModal({
+						title: '登录提示',
+						content: 'Session过期需要重新登录,是否立即登录?',
+						showCancel: true,
+						confirmText: '登录',
+						success: (e) => {
+							if (e.confirm) {
+								uni.navigateTo({
+									url: '/pages/public/login'
+								})
+							}
+						},
+						fail: () => {},
+						complete: () => {}
+					})
+				}
+			})
 			uni.getSystemInfo({
 				success: function(res) {
 					console.log("statusBarHeight", res.statusBarHeight)