ccj 3 년 전
부모
커밋
b28bd6f0e6
2개의 변경된 파일68개의 추가작업 그리고 26개의 파일을 삭제
  1. 62 25
      pages/grain_pulse/dynamic.vue
  2. 6 1
      pages/grain_pulse/release.vue

+ 62 - 25
pages/grain_pulse/dynamic.vue

@@ -179,37 +179,74 @@
 				this.keyword = ""
 			},
 			release() {
-				this.getCompany.loginPhone = this.userInfo.phone
-				this.$api.doRequest('get', '/settledCompanyInfo/companyList', this.getCompany)
-					.then(res => {
-						if (res.data.code == 200) {
-							console.log("companyList",res)
-							if(res.data.data.length > 0){
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: '登录提示',
+						content: '您尚未登录,是否立即登录?',
+						showCancel: true,
+						confirmText: '登录',
+						success: (e) => {
+							if (e.confirm) {
 								uni.navigateTo({
-									url: `/pages/grain_pulse/release`
-								})
-							}else{
-								uni.showModal({
-									content: "您还没有入驻粮脉,不能发布,是否前去完善入驻信息!",
-									showCancel: true,
-									confirmText: '前往',
-									success: function(res) {
-										if (res.confirm) {
-											uni.navigateTo({
-												url: `/pages/grain_pulse/enter`
-											})
-										}
-									}
+									url: '/pages/public/login'
 								})
 							}
-						}
+						},
+						fail: () => {},
+						complete: () => {}
 					})
-				
+				}
+				else{
+					this.getCompany.loginPhone = this.userInfo.phone
+					this.$api.doRequest('get', '/settledCompanyInfo/companyList', this.getCompany)
+						.then(res => {
+							if (res.data.code == 200) {
+								console.log("companyList",res)
+								if(res.data.data.length > 0){
+									uni.navigateTo({
+										url: `/pages/grain_pulse/release`
+									})
+								}else{
+									uni.showModal({
+										content: "您还没有入驻粮脉,不能发布,是否前去完善入驻信息!",
+										showCancel: true,
+										confirmText: '前往',
+										success: function(res) {
+											if (res.confirm) {
+												uni.navigateTo({
+													url: `/pages/grain_pulse/enter`
+												})
+											}
+										}
+									})
+								}
+							}
+						})
+				}
 			},
 			record() {
-				uni.navigateTo({
-					url: `/pages/grain_pulse/record`
-				})
+				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/record`
+					})
+				}
 			}
 		}
 	}

+ 6 - 1
pages/grain_pulse/release.vue

@@ -88,8 +88,10 @@
 				this.$api.doRequest('get', '/settledCompanyInfo/companyList', this.getCompany)
 					.then(res => {
 						if (res.data.code == 200) {
-							this.release.compName = res.data.data[0].compName
 							for (let i = 0; i < res.data.data.length; i++) {
+								if(i ==0 && !this.release.compName){
+									this.release.compName = res.data.data[i].compName
+								}
 								this.companyType.push(res.data.data[i].compName)
 							}
 						}
@@ -111,8 +113,10 @@
 				}
 			},
 			companyChange(e) {
+				
 				this.companyIndex = e.detail.value
 				this.release.compName = this.companyType[this.companyIndex]
+				console.log("companyChange",e,this.release.compName)
 			},
 			getImgUrl(e) {
 				this.address.push(e)
@@ -172,6 +176,7 @@
 											uni.showLoading({
 												title:"正在提交"
 											})
+											console.log("addSettledCompanyDynamics",that.release)
 											that.$api.doRequest('post',
 													'/settledCompanyDynamics/api/addSettledCompanyDynamics',
 													that.release)