ccj 2 năm trước cách đây
mục cha
commit
e9ad55bce0
3 tập tin đã thay đổi với 116 bổ sung57 xóa
  1. 2 2
      config/index.js
  2. 2 2
      manifest.json
  3. 112 53
      pages/user/user.vue

+ 2 - 2
config/index.js

@@ -1,7 +1,7 @@
 const dev = {
 	baseUrl: 'https://www.zthymaoyi.com',
 	// baseUrl: 'http://localhost:8080/',
-	// baseUrlNew: 'http://192.168.110.67:9100/',
+	baseUrlNew: 'http://192.168.110.67:9100/',
 	// baseUrlNew: 'http://192.168.1.118:8090/',
 	// baseUrlNew: 'http://192.168.110.9:9100/',
 	// baseUrlNew: 'http://192.168.110.138:8090/',
@@ -10,7 +10,7 @@ const dev = {
 	// baseUrlNew: 'http://192.168.110.202:8090/',
 	// baseUrlNew: 'http://192.168.110.138:8090/',
 	// 上传图片的
-	baseUrlNew: 'https://api2.eliangeyun.com/',
+	// baseUrlNew: 'https://api2.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "易粮易运",
     "appid" : "__UNI__7297DA2",
     "description" : "易粮易运——为天下粮食人服务的App",
-    "versionName" : "2.1.145",
-    "versionCode" : 21145,
+    "versionName" : "2.1.146",
+    "versionCode" : 21146,
     "transformPx" : false,
     /* SDK配置 */
     "quickapp" : {},

+ 112 - 53
pages/user/user.vue

@@ -384,7 +384,7 @@
 		},
 		// #endif
 		computed: {
-			...mapState(['hasLogin', 'userInfo']),
+			...mapState(['hasLogin', 'userInfo','clientId']),
 			// 手机号中间4位加*
 			starUserphone() {
 				let reg = /^(\d{3})\d{4}(\d{4})$/;
@@ -468,38 +468,39 @@
 					}
 				})
 									console.log("this.1111")
-				uni.getStorage({
-					key: 'compName1',
-					success: function (res) {
-									console.log("this.2222")
-						console.log(res.data);
-						if(res.data){
-							that.compName = res.data
+				// uni.getStorage({
+				// 	key: 'compName1',
+				// 	success: function (res) {
+				// 					console.log("this.2222")
+				// 		console.log(res.data);
+				// 		if(res.data){
+				// 			that.compName = res.data
+				// 			that.haveCompany = true
+				// 		}
+				// 	},
+				// 	fail() {
+						
+				// 	}
+				// });
+				that.$api.doRequest('get', '/commonUser/getCompOwn', {
+					phone: that.userInfo.phone
+				}).then(res => {
+					if (res.data.data) {
+						that.companyList = res.data.data
+							console.log("that.3333")
+							console.log(that.companyList)
+						if (that.companyList.length > 0) {
+							that.compName = that.companyList[0].compName
+							console.log("this.compName")
+							console.log(that.compName)
+							uni.setStorageSync('compName1', that.companyList[0].compName)
 							that.haveCompany = true
 						}
-					},
-					fail() {
-						that.$api.doRequest('get', '/commonUser/getCompOwn', {
-							phone: that.userInfo.phone
-						}).then(res => {
-							if (res.data.data) {
-								that.companyList = res.data.data
-									console.log("that.3333")
-									console.log(that.companyList)
-								if (that.companyList.length > 0) {
-									that.compName = that.companyList[0].compName
-									console.log("this.compName")
-									console.log(that.compName)
-									uni.setStorageSync('compName1', that.companyList[0].compName)
-									that.haveCompany = true
-								}
-								else{
-									that.haveCompany = false
-								}
-							}
-						})
+						else{
+							that.haveCompany = false
+						}
 					}
-				});
+				})
 
 			} else {
 				this.headUrl = "../../static/img/myimg/YongHu@3x.png"
@@ -517,34 +518,92 @@
 				this.isShowAlert = false
 			},
 			compconfirm(e) {
-
-				var that = this
-				this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
-					mobilePhone: this.userInfo.phone,
-					companyName: this.companyList[e[0]].compName,
-					veriCode: "123456",
-				}).then(res1 => {
-					if (res1.data.code == 200) {
-						uni.setStorageSync('pcUserInfo', res1.data.data)
-						uni.setStorageSync('compName1', that.companyList[e[0]].compName)
-						that.compName = that.companyList[e[0]].compName
-						helper.getListByUserId()
-						that.$api.msg('切换成功')
-					} else {
-						that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
-							mobilePhone: '14444444444',
+				var that=this
+				uni.showLoading({
+					title: '登录中',
+					mask:true
+				})
+				console.log("clinetId",this.clientId)
+				this.$api.doRequest('get','/commonUser/login',{phone:this.userInfo.phone,password:"999999",cid:this.clientId}).then(res => {
+					if(res.data.code==200){
+						console.log("userInfo",res.data.data)
+						uni.setStorageSync('userInfo', res.data.data)
+						this.$api.doRequest('post','/commonUser/api/loginQuickly',{
+							mobilePhone: this.userInfo.phone,
 							companyName: this.companyList[e[0]].compName,
-							veriCode: "123456",
-						}).then(res2 => {
-							uni.setStorageSync('pcUserInfo', res2.data.data)
-							uni.setStorageSync('compName1', that.companyList[e[0]].compName)
-							that.compName = that.companyList[e[0]].compName
-							helper.getListByUserId()
+							veriCode: "123456",}).then(res1 => {
+							console.log("loginQuickly",res)
+							if(res1.data.code==200){
+								uni.setStorageSync('pcUserInfo', res1.data.data)
+								uni.setStorageSync('compName1', that.companyList[e[0]].compName)
+								that.compName = that.companyList[e[0]].compName
+								helper.getListByUserId()
+							}
+							else{
+								// that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
+								// veriCode: "123456",}).then(res2 => {
+								// 	uni.setStorageSync('pcUserInfo', res2.data.data)
+								// 	helper.getListByUserId()
+								// })
+							}
+							that.$store.commit('login', res.data.data)
+							var name = 'userInfo';
+							var value = res.data.data;
+							that.$store.commit('$uStore', {
+								name,
+								value
+							});
+							// that.liangxinLogin()
+							
+							// uni.switchTab({
+							// 	url: '/pages/sale/information'
+							// });
+							uni.hideLoading()
 							that.$api.msg('切换成功')
 						})
+						
+					}else{
+						uni.hideLoading()
+						uni.showToast({
+							title: res.data.message,
+							icon:'none',
+							duration: 2000
+						})
 					}
-
 				})
+				.catch(res => {
+				    console.log(res);
+				});
+
+
+
+				// var that = this
+				// this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
+				// 	mobilePhone: this.userInfo.phone,
+				// 	companyName: this.companyList[e[0]].compName,
+				// 	veriCode: "123456",
+				// }).then(res1 => {
+				// 	if (res1.data.code == 200) {
+				// 		uni.setStorageSync('pcUserInfo', res1.data.data)
+				// 		uni.setStorageSync('compName1', that.companyList[e[0]].compName)
+				// 		that.compName = that.companyList[e[0]].compName
+				// 		helper.getListByUserId()
+				// 		that.$api.msg('切换成功')
+				// 	} else {
+				// 		that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
+				// 			mobilePhone: '14444444444',
+				// 			companyName: this.companyList[e[0]].compName,
+				// 			veriCode: "123456",
+				// 		}).then(res2 => {
+				// 			uni.setStorageSync('pcUserInfo', res2.data.data)
+				// 			uni.setStorageSync('compName1', that.companyList[e[0]].compName)
+				// 			that.compName = that.companyList[e[0]].compName
+				// 			helper.getListByUserId()
+				// 			that.$api.msg('切换成功')
+				// 		})
+				// 	}
+
+				// })
 			},
 			getRoles: function(role) {
 				let _roles = uni.getStorageSync('rolesList')