瀏覽代碼

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

gjy 3 年之前
父節點
當前提交
c770c59634

+ 8 - 8
pages/grain_pulse/editcompany.vue

@@ -510,14 +510,14 @@
 							return
 						}
 					}
-					if(!re.test(this.deptList.email)){
-						this.$api.msg('邮箱输入错误')
-						return
-					}
-					if(this.deptList.fax && (this.deptList.fax.length<6||this.deptList.fax.length>20)){
-						this.$api.msg('传真输入错误')
-						return
-					}
+					// if(!re.test(this.deptList.email)){
+					// 	this.$api.msg('邮箱输入错误')
+					// 	return
+					// }
+					// if(this.deptList.fax && (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

+ 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:'',

+ 32 - 5
pages/grain_pulse/home.vue

@@ -72,6 +72,9 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex';
 	export default {
 		components: {
 
@@ -119,6 +122,9 @@
 				datalist: []
 			}
 		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
 		onPullDownRefresh() {
 		    this.getList()
 		     setTimeout(function () {
@@ -169,7 +175,8 @@
 					mainBusinessType: this.mainBusinessType,
 					pageSize: this.pageSize,
 					currentPage: this.currentPage,
-					pcFlag: 2
+					pcFlag: 2,
+					searchType: 2
 				}).then(res => {
 					if (res.data.code == 200) {
 						this.datalist = res.data.data.records
@@ -202,10 +209,30 @@
 				this.mainBusinessTypeKey = item.value
 			},
 			enterUrl() {
-				//入驻
-				uni.navigateTo({
-					url: '/pages/grain_pulse/enter'
-				})
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: '登录提示',
+						content: '您尚未登录,是否立即登录?',
+						showCancel: true,
+						confirmText: '登录',
+						success: (e) => {
+							if (e.confirm) {
+								uni.navigateTo({
+									url: '/pages/public/login'
+								})
+							}
+						},
+						fail: () => {},
+						complete: () => {}
+					})
+				}
+				else{
+					//入驻
+					uni.navigateTo({
+						url: '/pages/grain_pulse/enter'
+					})
+				}
+				
 			},
 			friendcircle() {
 				uni.navigateTo({

+ 25 - 1
pages/grain_pulse/my_grain_pulse.vue

@@ -104,13 +104,37 @@
 			if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
 				this.currentPage += 1
 			}
-				this.getList()
+			this.getData()
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		
 		methods: {
+			getData(){
+				this.isLoadMore=true
+				if(this.mainBusinessType=='我的企业'){
+					this.$api.doRequest('get','/settledCompanyInfo/selectSettledCompanyInfo',{mainBusinessType:'',pageSize: this.pageSize,
+							currentPage: this.currentPage,pcFlag:2,createPhone:this.userInfo.phone}).then(res => {
+					if(res.data.code==200){
+						this.isLoadMore=false
+						this.datalist=this.datalist.concat(res.data.data.records)
+					}
+				})
+				}else{
+					this.$api.doRequest('get','/settledCompanyInfo/myCollection',{phone:this.userInfo.phone,pageSize:this.pageSize,
+							currentPage: this.currentPage,pcFlag:2}).then(res => {
+					if(res.data.code==200){
+						this.datalist=this.datalist.concat(res.data.data.records)
+						let lat2 =this.position.location.split(',')[1];
+						let lng2 = this.position.location.split(',')[0];
+						for(var i=0;i<this.datalist.length;i++){
+							this.datalist[i]._metre=this.utils.getDistance(this.datalist[i].latitude,this.datalist[i].longitude,lat2,lng2)
+						}
+					}
+					})
+				}
+			},
 			getList(){
 				this.isLoadMore=true
 				if(this.mainBusinessType=='我的企业'){

+ 65 - 52
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,57 +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) {
-								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:'',
 									}
+									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(){

+ 8 - 6
pages/sale/information.vue

@@ -180,6 +180,7 @@
 			var that = this
 			
 			this.$api.doRequest('get', '/notice/query/noticeNumber').then(res => {
+				console.log("noticeNumber",res)
 				if (res.data.data) {
 					let name = 'myTip';
 					let value = res.data.data.task;
@@ -217,12 +218,6 @@
 				});
 			}
 			var that = this
-			uni.getSystemInfo({
-				success: function(res) {
-					console.log("statusBarHeight", res.statusBarHeight)
-					that.statusBarHeight += res.statusBarHeight + "px"; //这就是状态栏的高度
-				},
-			});
 			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
 				console.log("checkSession",res)
 				if (res.data.data == "INVALID") {
@@ -243,6 +238,13 @@
 					})
 				}
 			})
+			uni.getSystemInfo({
+				success: function(res) {
+					console.log("statusBarHeight", res.statusBarHeight)
+					that.statusBarHeight += res.statusBarHeight + "px"; //这就是状态栏的高度
+				},
+			});
+			
 			var infoList = [];
 			uni.request({
 				url: "https://hq.sinajs.cn/list=C0,C2109,C2111,C2201,C2203,C2205,C2207,A0,A2109,A2111,A2201,A2203,A2205,A2207",

二進制
static/img/liangmai/ruzhu.png