cmy преди 2 години
родител
ревизия
79e5ec976a
променени са 5 файла, в които са добавени 70 реда и са изтрити 22 реда
  1. 5 5
      pages/index/index.vue
  2. 2 2
      pages/public/wxLogin.vue
  3. 38 13
      pages/user/model/modelrz.vue
  4. 2 1
      pages/user/realName/cropper.vue
  5. 23 1
      utils/newRequest.js

+ 5 - 5
pages/index/index.vue

@@ -232,7 +232,7 @@
 				try {
 					getWorkerList().then(res => {
 						let arr = []
-						console.log(res,'basa');
+						// console.log(res,'basa');
 						res.data.list.forEach(item => {
 							let cc = false
 							arr.forEach(itemt => {
@@ -242,11 +242,11 @@
 							})
 							if(!cc) {
 								arr.push(item)
-								console.log(item,arr);
+								// console.log(item,arr);
 							}
 						})
 						this.jxList = arr
-						console.log(arr,this.jxList,'dddddd');
+						// console.log(arr,this.jxList,'dddddd');
 					})
 				} catch (e) {
 					//TODO handle the exception
@@ -276,7 +276,7 @@
 				getBannerList().then(
 					(res) => {
 						that.imagelist = res.data.list
-						console.log(res);
+						// console.log(res);
 					}
 				).catch(
 					(res) => {
@@ -294,7 +294,7 @@
 							res.old_price = +res.old_price
 							return res
 						})
-						console.log(res);
+						// console.log(res);
 					}
 				).catch(
 					(res) => {

+ 2 - 2
pages/public/wxLogin.vue

@@ -6,8 +6,8 @@
 				<image class="logo-img" src="../../static/image/logo.png" mode="scaleToFill"></image>
 				<!--  -->
 				<button class="userInfo flex-center" type="warn" @tap="loding?'':userInfoData()">
-					<image class="icon margin-r-10" src="../../static/icon/weichat.png" mode="widthFix"></image>
-					<text>微信授权登录</text>
+					<!-- <image class="icon margin-r-10" src="../../static/icon/weichat.png" mode="widthFix"></image> -->
+					<text>手机号授权登录</text>
 				</button>
 				<agreement @checkedChange='changeChecked'></agreement>
 			</view>

+ 38 - 13
pages/user/model/modelrz.vue

@@ -367,11 +367,11 @@
 			// 选择学历
 			changeEducation(res) {
 				this.updata.education = this.educationList[res.detail.value];
-				console.log(res);
+				// console.log(res);
 			},
 			changeAreaList(res) {
 				this.updata.is_wm = this.areaList[res.detail.value];
-				console.log(res);
+				// console.log(res);
 			},
 			// 初始化
 			init() {
@@ -412,7 +412,7 @@
 								}
 							}
 						}
-						console.log(res, '服务');
+						// console.log(res, '服务');
 					}
 				).catch(
 					(res) => {
@@ -421,7 +421,7 @@
 				)
 				getUserWorkTypeList().then(
 					(res) => {
-						console.log(res);
+						// console.log(res);
 						that.workTypeList = res.data.list
 						if (that.type == 0) {
 							that.updata.word = that.workTypeList[0];
@@ -465,7 +465,7 @@
 						}
 					}
 				)
-				console.log(that.updata);
+				// console.log(that.updata);
 				let data = {
 					is_china: that.updata.is_wm == '是'?0:1,
 					name: that.updata.name,
@@ -494,7 +494,7 @@
 					user_work_type_title: that.updata.word.title,
 					service_count: that.updata.service_count
 				}
-				console.log('baocun',data);
+				// console.log('baocun',data);
 				uni.setStorageSync('modeldata', data)
 				uni.navigateTo({
 					url: '/pages/user/model/model?mtype=' + that.modelid + '&type=1'
@@ -507,7 +507,7 @@
 					getUserCardInfo().then(
 						(data) => {
 							const res = data.data;
-							console.log(res, '返回');
+							// console.log(res, '返回');
 							// 存储返回用户数据
 							that.userModelData = res;
 							that.updata = Object.assign(that.updata, {
@@ -538,7 +538,7 @@
 								no: res.no,
 								service_count: res.service_count
 							})
-							console.log(that.updata, 'that.updata');
+							// console.log(that.updata, 'that.updata');
 							resolve('初始化数据成功')
 						}
 					).catch(
@@ -552,12 +552,12 @@
 			// 选中的服务类型
 			checkTypeChange(type) {
 				this.updata.checkedType = type.detail.value;
-				console.log(type)
+				// console.log(type)
 			},
 			// 选中的工作类型
 			changeWorkType(type) {
 				this.updata.word = this.workTypeList[type.detail.value];
-				console.log(this.updata.word)
+				// console.log(this.updata.word)
 			},
 			// 选择时间类型
 			changetimetype(res) {
@@ -566,7 +566,7 @@
 			// 时间选择
 			changetime(time) {
 				this.updata.time = time.detail.value;
-				console.log(time);
+				// console.log(time);
 			},
 			// 选择籍贯
 			changeAncestralPlace(val) {
@@ -581,7 +581,7 @@
 				address.city = data[1];
 				address.district = data[2];
 				this.updata.onCity.push(address)
-				console.log(this.onCity, 'cs');
+				// console.log(this.onCity, 'cs');
 			},
 			upLoad(path) {
 				// #ifdef H5
@@ -693,7 +693,30 @@
 				return new Promise((ok, error) => {
 					// 从相册/相机选择
 					// 如需直接开相机或直接选相册,请只使用一个选项
-					const sourceType = index === 0 ? ['camera'] : ['album']
+					const sourceType = index === 0 ? ['camera'] : ['album'];
+					// #ifdef MP
+					uni.chooseMedia({
+						count: 1,
+						mediaType:['image'],
+						sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
+						sourceType: sourceType,
+						success(res) {
+							console.log(res);
+							// 缓存文件路径
+							ok(res.tempFiles[0])
+						},
+						fail(err) {
+							console.log(err,'’1111')
+							uni.showModal({
+								title: '文件打开错误',
+								content: '请设置授权文件存储权限',
+								showCancel: false,
+							});
+							error(e)
+						}
+					})
+					// #endif
+					// #ifndef MP
 					uni.chooseImage({
 						count: 1, //默认9
 						sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
@@ -710,6 +733,8 @@
 							error(e)
 						}
 					});
+					// #endif
+					
 				})
 			},
 			// 实名认证

+ 2 - 1
pages/user/realName/cropper.vue

@@ -32,7 +32,8 @@
 			that.eventChannel = that.getOpenerEventChannel();
 			// #endif
 			that.eventChannel.on('urlNext', function(data) {
-				that.url = data.url;
+				console.log(data);
+				that.url = data.url.tempFilePath;
 			})
 		},
 		methods: {

+ 23 - 1
utils/newRequest.js

@@ -116,6 +116,7 @@ let service = {
 				// 选择图片
 				choose(num) {
 					return new Promise((resolve, reject) => {
+						// #ifndef MP
 						uni.chooseImage({
 							count: num,
 							success(res) {
@@ -124,15 +125,36 @@ let service = {
 								resolve(res.tempFilePaths)
 							},
 							fail(err) {
+								console.log(err,'’1111')
 								uni.showModal({
 									title: '文件打开错误',
 									content: '请设置授权文件存储权限',
 									showCancel: false,
 								});
-								console.log(err)
 								reject(err)
 							}
 						})
+						// #endif
+						// #ifdef MP-WEIXIN
+						console.log('233');
+						uni.chooseMedia({
+							count: num,
+							success(res) {
+								console.log(res);
+								// 缓存文件路径
+								resolve(res.tempFilePaths)
+							},
+							fail(err) {
+								console.log(err,'’1111')
+								uni.showModal({
+									title: '文件打开错误',
+									content: '请设置授权文件存储权限',
+									showCancel: false,
+								});
+								reject(err)
+							}
+						})
+						// #endif
 					})
 
 				},