gjy 2 lat temu
rodzic
commit
f630305db7

+ 35 - 1
main.js

@@ -12,14 +12,48 @@ import request from '@/util/request.js'
 import utils from '@/util/util.js'
 import webim from 'webim.js';
 import helper from'@/common/helper.js'
+// import axios from 'axios'
+
 Vue.prototype.$api = baseApi
 Vue.prototype.$request = request
 Vue.prototype.$utils = utils
 Vue.prototype.$helper = helper
 Vue.prototype.$socket = webim;
 Vue.prototype.$store = store
+// Vue.prototype.$axios = axios
 
-
+// import axios from 'axios'
+ 
+ 
+ 
+// // 解决uniapp 适配axios请求,避免报adapter is not a function错误
+// axios.defaults.adapter = config => {
+// 	console.log(config)
+// 	return new Promise((resolve, reject) => {
+// 		let settle = require('axios/lib/core/settle');
+// 		let buildURL = require('axios/lib/helpers/buildURL');
+// 		uni.request({
+// 			method: config.method.toUpperCase(),
+// 			url: config.baseURL + buildURL(config.url, config.params, config.paramsSerializer),
+// 			header: config.headers,
+// 			data: config.data,
+// 			dataType: config.dataType,
+// 			responseType: config.responseType,
+// 			sslVerify: config.sslVerify,
+// 			complete: function complete(response) {
+// 				// console.log("执行完成:", response)
+// 				response = {
+// 					data: response.data,
+// 					status: response.statusCode,
+// 					errMsg: response.errMsg,
+// 					header: response.header,
+// 					config: config
+// 				};
+// 				settle(resolve, reject, response);
+// 			}
+// 		})
+// 	})
+// }
 Vue.config.productionTip = false
 
 App.mpType = 'app'

+ 6 - 2
package.json

@@ -9,5 +9,9 @@
         "没有网络",
         "遮罩",
         "遮罩页面"
-    ]
-}
+    ],
+    "dependencies": {
+        "axios": "^0.27.2",
+        "weapp-cookie": "^1.4.8"
+    }
+}

+ 2 - 1
pages/mine/editDriverCertificationNext.vue

@@ -244,7 +244,7 @@
 					class="path" hover-class="navigator-hover">《隐私政策》</navigator>
 			</view>
 			<u-button class="btn-color" @click="btnBClick">提交</u-button>
-			<u-toast ref="uToast"></u-toast>
+			
 			<u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
 				@select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
 				@close="isShowimgType=false">
@@ -255,6 +255,7 @@
 			<u-picker :show="isShowDrive" ref="uPicker" :columns="driveList" @confirm="confirmDriveType"
 				:closeOnClickOverlay='true' @close='isShowDrive=false' @cancel='isShowDrive=false'>
 			</u-picker>
+			<u-toast ref="uToast"></u-toast>
 		</view>
 		<!-- <u-modal :show="isShowAlert" :title="" :content='修改认证信息需要重新登录!' :closeOnClickOverlay='true' :showCancelButton='true' confirmColor='#22C572'  @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal> -->
 	</view>

+ 25 - 14
pages/mine/settings/editPassword.vue

@@ -94,6 +94,7 @@
 				}
 			},
 			getcode(e){
+				console.log(this.phone)
 				if(this.phone.length!=11){
 					uni.showToast({
 						title: '请输入正确的手机号',
@@ -104,23 +105,33 @@
 				}
 				if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)){
 				var that=this
-					this.$request.baseRequest('get','/commonUser/sendVerifyCode',{phone:this.phone}).then(res => {
-					that.sendDisabled = true
-					let sec = 60
-					let interval = setInterval(() => {
-						sec--;
-						that.sendText = sec + 's后重发'
-						if (sec <= 0) {
-							that.sendDisabled = false
-							that.sendText = "获取验证码"
-							clearInterval(interval)
-						}
-					}, 1000)
+					this.$request.baseRequest('get','/commonUser/sendVerifyCode',{phone:this.phone,identification:1}).then(res => {
+					
+					if(res.code==200){
+						that.sendDisabled = true
+						let sec = 60
+						let interval = setInterval(() => {
+							sec--;
+							that.sendText = sec + 's后重发'
+							if (sec <= 0) {
+								that.sendDisabled = false
+								that.sendText = "获取验证码"
+								clearInterval(interval)
+							}
+						}, 1000)
+					}else{
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
+					
 					})
 					.catch(res => {
-					    if(res.errmsg){
+					    if(res.message){
 					    	uni.showToast({
-					    		title: res.errmsg,
+					    		title: res.message,
 					    		icon: 'none',
 					    		duration: 2000
 					    	})

+ 1 - 1
pages/news/index.vue

@@ -17,7 +17,7 @@
 						</image>
 
 					</view>
-					<view class="right">
+					<view class="right" :style="{'border-bottom':index==news.length-1?'1px solid #fff':'1px solid #e6e6e6'}">
 						<view class="row1 flex flex-space-between">
 							<view class="title">
 								{{item.newsType}}

+ 4 - 1
pages/order/orderDetails.vue

@@ -206,7 +206,7 @@
 			</view>
 		</view>
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
-			:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="$u.throttle(confirmClick, 5000)" @close="cancelClick"
+			:closeOnClickOverlay='true' :showCancelButton='showCancelButton' @confirm="$u.throttle(confirmClick(), 5000)" @close="cancelClick"
 			@cancel="cancelClick" class="modal">
 			<u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason' class='row'>
 				<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
@@ -498,7 +498,10 @@
 							terminator:1
 						}).then(res => {
 							this.show=false
+							this.radiovalue1 == '已与货主协商'
+							this.value2=''
 							this.isShowAlert = false
+							
 							// this.mescroll.resetUpScroll()
 							this.$refs.uToast.show({
 								type: 'success',

+ 2 - 0
pages/public/code.vue

@@ -158,6 +158,8 @@
 										}
 									}
 								})
+								uni.setStorageSync("shiro",encodeURIComponent(`ws_login_companyShortName=
+								'黑龙江中天昊元贸易有限公司'; ws_login_rememberMe=1; ws_login_account=${that.phone}; ws_login_pwd=${that.password}; shiro.session=65500189-7bb5-457f-9ff6-0db069150e78`))
 									uni.setStorageSync('pcuserInfo', res.data)
 									uni.setStorageSync('userInfo', res.data)
 									uni.setStorageSync('firstAuthentication', res2.data)

+ 4 - 2
pages/public/login.vue

@@ -179,10 +179,12 @@
 						password: that.password,
 						loginFlag: 2,
 						identification: 1
-					}).then(res => {
+					},'application/x-www-form-urlencoded').then(res => {
 						if (res.code == 200) {
-							console.log("userInfo", res.data)
+// 							uni.setStorageSync("shiro",encodeURIComponent(`ws_login_companyShortName=
+// '黑龙江中天昊元贸易有限公司'; ws_login_rememberMe=1; ws_login_account=${that.phone}; ws_login_pwd=${that.password}; shiro.session=65500189-7bb5-457f-9ff6-0db069150e78`)
 							uni.setStorageSync('userInfo', res.data)
+							// uni.setStorageSync("shiro",res.header['Set-Cookie'])
 							that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 								reCommonId: that.userInfo.id,
 							}).then(res3 => {

+ 2 - 0
pages/public/register.vue

@@ -264,6 +264,8 @@
 									identification:1  //司机标识
 								}).then(res => {
 									if (res.code == 200) {
+										uni.setStorageSync("shiro",encodeURIComponent(`ws_login_companyShortName=
+										'黑龙江中天昊元贸易有限公司'; ws_login_rememberMe=1; ws_login_account=${that.phone}; ws_login_pwd=${that.password}; shiro.session=65500189-7bb5-457f-9ff6-0db069150e78`))
 										// // pc登录
 										// that.$request.baseRequest('post', '/commonUser/api/loginQuickly', {
 										// 	mobilePhone: this.phone,

+ 20 - 4
util/request.js

@@ -6,6 +6,7 @@ const baseRequest = (method, url, data, header) => {
 	if (header) {
 		contentheader = header
 	}
+	console.log(uni.getStorageSync("shiro"))
 	let baseDefaultOpts = {
 		url: baseUrl + url,
 		// 请求接口地址
@@ -14,12 +15,14 @@ const baseRequest = (method, url, data, header) => {
 		method: method,
 		// 配置请求类型
 		header: {
-			'content-type': contentheader //'application/x-www-form-urlencoded; charset=UTF-8',
-		}
+			'Content-Type': contentheader, //'application/x-www-form-urlencoded; charset=UTF-8',
+			// cookie: uni.getStorageSync("shiro")
+			// token:uni.getStorageSync("shiro")
+		},
 	}
 	let promise = new Promise(function(resolve, reject) {
 		uni.getNetworkType({}).then((res) => {
-			console.log(res)
+			// console.log(res)
 			if (res[1].networkType === "none") {
 				uni.showToast({
 					icon: 'none',
@@ -27,8 +30,20 @@ const baseRequest = (method, url, data, header) => {
 					duration: 2000
 				});
 			} else {
+				// uni.request({
+				// 			...baseDefaultOpts,
+				// 			//请求成功的回调,可以在方法做返回状态码的判断。也可以直接返回resolve  ==》success: resolve,fail:reject
+				// 			success: (res) => {
+				// 				resolve(res)
+				// 			},
+				// 			//请求失败的回调,可以在方法。反馈用户、提示用户,也可以直接返回reject  ==》success: resolve,fail:reject
+				// 			fail: (err) => {
+				// 				reject(err)
+				// 			},
+				// 		})
 				uni.request(baseDefaultOpts).then(
 					(res) => {
+						console.log(res)
 						// console.log(JSON.stringify(res[1].data))
 						// if(res[1].data.code == '200' || res[1].data.code == 200){
 						// 	// 后端返回的状态码100为成功状态,成功则返回请求结果,在app调试时可以通过console.log(JSON.stringify(res[1].data))来查看返回值(以项目实际情况为准)
@@ -53,7 +68,8 @@ const baseRequest = (method, url, data, header) => {
 								// 	}); 
 							}
 						} else {
-							reject(response)
+							// console.log(res)
+							reject(res)
 							// uni.showToast({
 							// 	icon: 'none',
 							// 	title: '网络异常,请检查网络状况',