Browse Source

2021-8-17

cmy 3 years ago
parent
commit
1fe00a0457

+ 9 - 1
api/set.js

@@ -43,4 +43,12 @@ export function applelogin(data) {
 		data
 	});
 }
-// #endif
+// #endif
+
+export function realName(data) {
+	return request({
+		url: '/api/realName',
+		method: 'post',
+		data
+	});
+}

File diff suppressed because it is too large
+ 8 - 0
hybrid/html/cropper/cropper.min.css


File diff suppressed because it is too large
+ 9 - 0
hybrid/html/cropper/cropper.min.js


+ 41 - 0
hybrid/html/cropper/index.html

@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<style type="text/css">
+	.input-label{
+		margin: 0 auto !important;
+		height: 250px !important;
+		width: 250px !important;
+	}
+</style>
+<html lang="zh">
+	<head>
+		<meta charset="UTF-8" />
+		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
+		<title>图片裁剪</title>
+		<link rel="stylesheet" href="cropper.min.css" />
+		<link rel="stylesheet" href="style.css" />
+		<script src="cropper.min.js"></script>
+		<script src="uni.webview.1.5.2.js"></script>
+	</head>
+	<body>
+		<div class="file-upload-box">
+			<input id="my-input" type="file" class="hidden-input" accept="image/png, image/jpeg, image/webp" />
+			<label for="my-input" class="input-label">+</label>
+		</div>
+
+		<div class="img-crop-area"></div>
+
+		<!-- <div class="previewAll">
+			<div class="preview"></div>
+			<div class="preview"></div>
+			<div class="preview"></div>
+			<div class="preview"></div>
+		</div> -->
+
+		<p>
+			<button class="btn disabled" id="save">确定</button>
+			<button class="btn disabled" id="spin" onclick='spin()'>旋转</button>
+		</p>
+		<script src="index.js"></script>
+	</body>
+</html>

+ 270 - 0
hybrid/html/cropper/index.js

@@ -0,0 +1,270 @@
+// 宽高比
+const aspectRatio = 3 / 4;
+// 自动裁剪区域, 默认为 50%
+const autoCropAre = 0.5;
+// 裁剪宽度
+const croppedWidth = 200;
+// 裁剪高度
+const croppedHeight = croppedWidth * aspectRatio;
+// 是否裁剪为圆形
+const roundedCrop = false;
+// 导出图片格式
+const imgType ='image/jpeg';
+let cropper = ''; //保存cropee对象
+
+// 旋转
+function spin(e) {
+	cropper.rotate(90)
+}
+
+const fileUploadBox = document.querySelector(".file-upload-box");
+const spinBtn = document.querySelector("#spin"); //获取旋转按钮对象
+const saveBtn = document.querySelector("#save");
+const previews = document.querySelectorAll(".preview");
+let previewReady = false;
+let croppable = false;
+
+document.addEventListener("UniAppJSBridgeReady", Init);
+
+// 初始化
+async function Init(params) {
+	console.log(`uniAppSDK loaded`);
+
+	const env = await getEnv();
+	console.log("当前环境:" + JSON.stringify(env));
+
+	const imgDataUrl = await selectFile(env);
+
+	// hidden input box
+	fileUploadBox.style.display = "none";
+
+	// create image
+	const image = new Image();
+	image.src = imgDataUrl;
+	image.crossorigin = true;
+	document.querySelector(".img-crop-area").appendChild(image);
+
+	image.onload = function() {
+		const options = {
+			aspectRatio: aspectRatio,
+			autoCropAre: autoCropAre,
+			viewMode: 1,
+			ready: function() {
+				let clone = this.cloneNode();
+
+				clone.className = "";
+				clone.style.cssText =
+					"display: block;" +
+					"width: 100%;" +
+					"min-width: 0;" +
+					"min-height: 0;" +
+					"max-width: none;" +
+					"max-height: none;";
+
+				each(previews, function(elem) {
+					elem.appendChild(clone.cloneNode());
+				});
+
+				croppable = true;
+				previewReady = true;
+				saveBtn.classList.remove("disabled");
+				spinBtn.classList.remove("disabled");
+				if (roundedCrop) {
+					const elements = document.querySelectorAll(
+						".cropper-view-box, .cropper-face"
+					);
+					for (let item of elements) {
+						item.style.borderRadius = "50%";
+					}
+				}
+			},
+			crop: function(event) {
+				if (!previewReady) {
+					return;
+				}
+
+				let data = event.detail;
+				let cropper = this.cropper;
+				let imageData = cropper.getImageData();
+				let previewAspectRatio = data.width / data.height;
+
+				each(previews, function(elem) {
+					let previewImage = elem.getElementsByTagName("img").item(0);
+
+					let previewWidth = elem.offsetWidth;
+					let previewHeight = previewWidth / previewAspectRatio;
+					let imageScaledRatio = data.width / previewWidth;
+
+					if (roundedCrop) {
+						elem.style.borderRadius = "50%";
+					}
+
+					elem.style.height = previewHeight + "px";
+					previewImage.style.width =
+						imageData.naturalWidth / imageScaledRatio + "px";
+					previewImage.style.height =
+						imageData.naturalHeight / imageScaledRatio + "px";
+					previewImage.style.marginLeft = -data.x / imageScaledRatio + "px";
+					previewImage.style.marginTop = -data.y / imageScaledRatio + "px";
+				});
+			},
+		};
+		// 保存cropper对象
+		cropper = new Cropper(image, options);
+
+		save.addEventListener("click", () => {
+			if (!croppable) {
+				return;
+			}
+
+			let croppedCanvas = cropper.getCroppedCanvas({
+				width: croppedWidth,
+				height: croppedHeight,
+			});
+
+			if (roundedCrop) {
+				croppedCanvas = getRoundedCanvas(croppedCanvas);
+			}
+
+			const postData = {
+				data: {
+					type: "croppedData",
+					dataUrl: croppedCanvas.toDataURL(imgType),
+				},
+			};
+
+
+			if (env.plus) {
+				uni.postMessage(postData);
+			} else if (env.h5) {
+				top.postMessage(postData);
+			} else if (env.miniprogram) {
+				// 小程序
+				top.postMessage(postData);
+			}
+			// // 	// back to previous page
+			uni.navigateBack({
+				delta: 1,
+			});
+		});
+	};
+}
+
+function getRoundedCanvas(sourceCanvas) {
+	let canvas = document.createElement("canvas");
+	let context = canvas.getContext("2d");
+	let width = sourceCanvas.width;
+	let height = sourceCanvas.height;
+
+	canvas.width = width;
+	canvas.height = height;
+	context.imageSmoothingEnabled = true;
+	context.drawImage(sourceCanvas, 0, 0, width, height);
+	context.globalCompositeOperation = "destination-in";
+	context.beginPath();
+	context.arc(
+		width / 2,
+		height / 2,
+		Math.min(width, height) / 2,
+		0,
+		2 * Math.PI,
+		true
+	);
+	context.fill();
+	return canvas;
+}
+
+function each(arr, callback) {
+	let length = arr.length;
+	let i;
+
+	for (i = 0; i < length; i++) {
+		callback.call(arr, arr[i], i, arr);
+	}
+
+	return arr;
+}
+
+async function selectFile(env) {
+	const fileInput = document.querySelector("#my-input");
+	return new Promise((resolve, reject) => {
+		fileInput.addEventListener("change", async (event) => {
+			let result;
+			result = await getDataUrlFromReader(event);
+			resolve(result);
+		});
+	});
+}
+
+async function getDataUrlFromReader(event) {
+	const files = event.target.files;
+	return new Promise((resolve, reject) => {
+		const reader = new FileReader();
+		reader.addEventListener("loadend", () => {
+			resolve(reader.result);
+		});
+		reader.readAsDataURL(files[0]);
+	});
+}
+
+async function getEnv() {
+	return new Promise((resolve, reject) => {
+		uni.getEnv((res) => {
+			resolve(res);
+		});
+	});
+}
+
+// TODO:
+async function chooseWithPlusApi() {
+	const btnArray = [{
+			title: "拍照",
+		},
+		{
+			title: "从手机相册选择",
+		},
+	];
+
+	return new Promise((resolve, reject) => {
+		plus.nativeUI.actionSheet({
+				cancel: "取消",
+				buttons: btnArray,
+			},
+			function(e) {
+				let index = e.index;
+				switch (index) {
+					case 0:
+						break;
+					case 1:
+						let camera = plus.camera.getCamera();
+						camera.captureImage(
+							function(file) {
+								resolve(file);
+							},
+							function() {
+								console.log("从相机获取照片失败");
+								reject("从相机获取照片失败");
+							}, {
+								filename: "_doc/photo/",
+								index: 1,
+							}
+						);
+						break;
+					case 2:
+						plus.gallery.pick(
+							function(file) {
+								resolve(file);
+							},
+							function() {
+								console.log("取消图片选择");
+								reject("取消图片选择");
+							}, {
+								multiple: false,
+							}
+						);
+						break;
+				}
+			}
+		);
+	});
+}

+ 149 - 0
hybrid/html/cropper/style.css

@@ -0,0 +1,149 @@
+/* button styles */
+.btn {
+  box-sizing: border-box;
+  position: relative;
+  display: inline-block;
+  font-weight: 400;
+  line-height: 1.5;
+  color: #000;
+  text-align: center;
+  text-decoration: none;
+  vertical-align: middle;
+  cursor: pointer;
+  user-select: none;
+  background-color: #e9ecef;
+  border: 1px solid #e9ecef;
+  padding: 0.375rem 0.75rem;
+  font-size: 1rem;
+  border-radius: 4px;
+  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
+    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
+}
+.btn *,
+.btn *::before,
+.btn *::after {
+  box-sizing: inherit;
+}
+.btn img,
+.btn svg {
+  display: inline-flex;
+  vertical-align: -0.125em;
+  width: 1em;
+  height: 1em;
+}
+.btn:hover {
+  text-decoration: none;
+  background-color: #cbd3da;
+}
+.btn:focus {
+  outline: none;
+}
+.btn.disabled,
+.btn:disabled {
+  opacity: 0.65;
+  pointer-events: none;
+}
+
+.btn.primary {
+  background-color: #007bff;
+  border-color: #007bff;
+  color: #fff;
+}
+.btn.primary:hover {
+  text-decoration: none;
+  background-color: #0062cc;
+}
+
+.btn.outline {
+  background-color: transparent;
+  border-color: #e9ecef;
+}
+.btn.outline:hover {
+  text-decoration: none;
+  background-color: #e9ecef;
+}
+
+.btn.link {
+  background-color: transparent;
+  color: #007bff;
+  border-color: transparent;
+}
+.btn.link:hover {
+  background-color: #e9ecef;
+}
+
+.btn.block {
+  width: 100%;
+  display: block;
+}
+
+.btn.small {
+  padding: 0.1rem 0.4rem;
+}
+
+/* index.html */
+
+*,
+*::before,
+*::after {
+  box-sizing: border-box;
+}
+
+body,
+html {
+  padding: 0;
+  margin: 0;
+}
+
+body {
+  padding: 0.5rem;
+}
+
+img {
+  display: block;
+  /* This rule is very important, please don't ignore this */
+  max-width: 100%;
+  max-height: 400px;
+  width: 100%;
+}
+
+.previewAll {
+  display: grid;
+  grid-template-columns: 4fr 3fr 2fr 1fr;
+  gap: 0.5rem;
+  margin-top: 0.5rem;
+}
+
+.previewAll .preview {
+  overflow: hidden;
+}
+
+/* file input */
+
+.file-upload-box {
+  position: relative;
+}
+.file-upload-box .hidden-input {
+  position: absolute !important;
+  width: 1px;
+  height: 1px;
+  overflow: hidden;
+  clip: rect(1px 1px 1px 1px);
+}
+.file-upload-box input.hidden-input:focus + label {
+  outline: thin dotted;
+}
+.file-upload-box input.hidden-input:focus-within + label {
+  outline: thin dotted;
+}
+.file-upload-box .input-label {
+  border: 1px solid #eee;
+  width: 80px;
+  height: 80px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 2rem;
+  font-weight: lighter;
+  color: #555;
+}

File diff suppressed because it is too large
+ 0 - 0
hybrid/html/cropper/uni.webview.1.5.2.js


+ 13 - 7
pages.json

@@ -1,7 +1,7 @@
 {
 	"easycom": {
-			"^u-(.*)": "@/plugin/uview-ui/components/u-$1/u-$1.vue"
-		},
+		"^u-(.*)": "@/plugin/uview-ui/components/u-$1/u-$1.vue"
+	},
 	"pages": [{
 			"path": "pages/index/index",
 			"style": {
@@ -27,6 +27,12 @@
 				"navigationBarTitleText": "商城首页"
 			}
 		},
+		{
+			"path": "pages/set/cropper",
+			"style": {
+				"navigationBarTitleText": "图片裁剪"
+			}
+		},
 		{
 			"path": "pages/public/register",
 			"style": {
@@ -250,11 +256,11 @@
 			}
 		},
 		{
-			"path": "pages/user/approve",
+			"path": "pages/set/approve",
 			"style": {
 				"navigationBarTitleText": "实名认证",
-				"app-plus":{
-					"titleNView":false
+				"app-plus": {
+					"titleNView": false
 				}
 			}
 		},
@@ -267,7 +273,7 @@
 				}
 			}
 		},
-	
+
 		{
 			"path": "pages/order/expressInfo",
 			"style": {
@@ -300,7 +306,7 @@
 			"style": {
 				"navigationBarTitleText": "创建订单"
 			}
-		},  {
+		}, {
 			"path": "pages/money/pay",
 			"style": {
 				"navigationBarTitleText": "支付"

+ 1 - 1
pages/set/address.vue

@@ -202,7 +202,7 @@ page {
 	height: 80rpx;
 	font-size: $font-lg;
 	color: #fff;
-	background-color: $base-color;
+	background: $bg-green-gradual;
 	border-radius: 10rpx;
 }
 </style>

+ 1 - 1
pages/set/addressManage.vue

@@ -208,7 +208,7 @@ page {
 	margin: 60rpx auto;
 	font-size: $font-lg;
 	color: #fff;
-	background-color: $base-color;
+	background: $bg-green-gradual;
 	border-radius: 10rpx;
 	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
 }

+ 197 - 0
pages/set/approve.vue

@@ -0,0 +1,197 @@
+<template>
+	<view class="content">
+		<view class="bgimg"><image class="img" src="../../static/img/bgRz.png" mode="widthFix"></image></view>
+		<u-form class="user" :model="form" ref="uForm">
+			<u-form-item label="姓名"><u-input v-model="form.name" placeholder="请输入真实姓名" /></u-form-item>
+			<u-form-item label="身份证号" label-width="150"><u-input placeholder="请输入身份证号" v-model="form.card" /></u-form-item>
+		</u-form>
+		<view class="userBox">
+			<view class="title">上传人脸正面照片</view>
+			<view class="imgUp" @click.stop="upImg"><image class="img" :src="form.img || '../../static/img/upImgbg.png'" mode="scaleToFill"></image></view>
+		</view>
+		<button class="add-btn" @click="pushData('add')">新增地址</button>
+	</view>
+</template>
+
+<script>
+import { realName } from '@/api/set.js';
+export default {
+	data() {
+		return {
+			loding: false, //判断是否在点击中
+			form: {
+				name: '',
+				card: '',
+				img: ''
+			}
+		};
+	},
+	onLoad(option) {},
+	methods: {
+		upImg(e) {
+			console.log('上传图片');
+			const that = this;
+			uni.navigateTo({
+				url: '/pages/set/cropper',
+				events: {
+					imgCropped(event) {
+						// 监听裁剪完成
+						// 返回的 event 中包含了已经裁剪好图片的base64编码字符串
+						// 你可以使用 <image :src="imgDataUrl" mode="aspectFit"></image> 组件来展示裁剪后的图片
+						// 或者你可以将该字符串通过接口上传给服务器用来保存
+						that.$nextTick(function() {
+							that.form.img = event.data;
+							console.log(that.form.img, '图片');
+						});
+					}
+				},
+				fail(e) {
+					console.log(e, '错误');
+				}
+			});
+		},
+		ToIndex() {
+			let obj = this;
+			let ur = uni.getStorageSync('present') || '/pages/index/index';
+			// 用于处理缓存bug
+			if (ur == 'pages/product/product') {
+				ur = '/pages/index/index';
+			}
+			uni.switchTab({
+				url: ur,
+				fail(e) {
+					uni.navigateTo({
+						url: ur,
+						fail(e) {
+							uni.navigateTo({
+								url: '/pages/index/index'
+							});
+						}
+					});
+				}
+			});
+		},
+		pushData() {
+			const da = this.form;
+			if (this.loding) {
+				return;
+			}
+			if (!da.name) {
+				uni.showModal({
+					title: '提示',
+					content: '请填写名称',
+					showCancel: false
+				});
+				return;
+			}
+			if (!da.card) {
+				uni.showModal({
+					title: '提示',
+					content: '请填写身份证',
+					showCancel: false
+				});
+				return;
+			}
+			if (!da.img) {
+				uni.showModal({
+					title: '提示',
+					content: '请选择图片',
+					showCancel: false
+				});
+				return;
+			}
+			const data = {
+				face_image: da.img.replace(/^data:image\/[a-z,A-Z]*;base64,/, ''),
+				real_name: da.name,
+				id_card: da.card
+			};
+			uni.showLoading({
+				title: '审核中',
+				mask: true
+			});
+			this.loding = true;
+			// 上传
+			realName(data)
+				.then(e => {
+					uni.showModal({
+						title: '提示',
+						content: '实名成功过',
+						showCancel: false,
+						success: res => {
+							uni.switchTab({
+								url: '/pages/index/index'
+							});
+						}
+					});
+					uni.hideLoading();
+					this.loding = false;
+					console.log(e);
+				})
+				.catch(e => {
+					this.loding = false;
+					console.log(e);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.content {
+	height: 100%;
+	padding: 0 $page-row-spacing;
+}
+.add-btn {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	margin: 60rpx auto;
+	font-size: $font-lg;
+	color: #fff;
+	background: $bg-green-gradual;
+	border-radius: 10rpx;
+	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+}
+.bgimg {
+	text-align: center;
+	width: 1200rpx;
+	margin-left: -260rpx;
+	height: 400rpx;
+	background: linear-gradient(#4cb1ff, #3081df);
+	border-bottom-right-radius: 999999rpx;
+	border-bottom-left-radius: 999999rpx;
+	.img {
+		width: 400rpx;
+		margin-top: 50rpx;
+	}
+}
+.user {
+	margin-top: -50rpx;
+	border-radius: 10rpx;
+}
+.userBox,
+.user {
+	box-shadow: 0px 2px 16px 1px rgba(89, 89, 89, 0.24);
+	padding: 0 $page-row-spacing;
+	background-color: white;
+}
+.userBox {
+	margin-top: 20rpx;
+	padding: 30rpx;
+	.imgUp {
+		min-height: 100rpx;
+		text-align: center;
+		margin-top: 30rpx;
+		.img {
+			width: 300rpx;
+			height: 400rpx;
+		}
+	}
+}
+.imglist /deep/ * {
+	margin-left: auto !important;
+	margin-right: auto !important;
+}
+</style>

+ 73 - 0
pages/set/cropper.vue

@@ -0,0 +1,73 @@
+<template>
+  <view class="container">
+    <web-view
+      :webview-styles="webviewStyles"
+      @message="handleMessage"
+      :src="webviewSrc"
+    >
+    </web-view>
+  </view>
+</template>
+
+<script>
+
+export default {
+  name: "buuug7-img-cropper",
+  data() {
+    return {
+      webviewStyles: {},
+      platform: "",
+      webviewSrc:
+        "/hybrid/html/cropper/index.html",
+    };
+  },
+
+  mounted() {
+    const { platform } = uni.getSystemInfoSync();
+    this.platform = platform;
+    console.log(platform,'获取系统对象');
+
+    if (platform === "windows" || platform === "mac") {
+      this.handleH5Message();
+    }
+	// #ifdef H5
+	window.addEventListener("message", this.handleMessage, false);
+	// #endif
+  },
+
+  methods: {
+    handleMessage(event) {
+	  console.log('消息传输',event);
+	  // uni.navigateBack({
+	  // 	delta: 1,
+	  // });
+      const platform = this.platform;
+	  // #ifdef H5
+	  if(!event.data.data.type){
+		 return; 
+	  }
+      const data = event.data.data;
+	  // #endif
+	  // #ifndef H5
+	  const data = event.detail.data[0];
+	  // #endif
+      if (platform === "android" || platform === "ios") {
+        const eventChannel = this.getOpenerEventChannel();
+        eventChannel.emit("imgCropped", { data: data.dataUrl });
+      }
+    },
+    handleH5Message(e) {
+      console.log(`H5Message`);
+      window.addEventListener("message", (event) => {
+        const data = event.data.data;
+        if (data && data.type === "croppedData") {
+          const eventChannel = this.getOpenerEventChannel();
+          eventChannel.emit("imgCropped", { data: data.dataUrl });
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style></style>

+ 8 - 8
pages/set/set.vue

@@ -2,26 +2,26 @@
 	<view class="container">
 		<uni-list>
 		    <uni-list-item title="个人资料" @click="navTo('/pages/set/userinfo')" ></uni-list-item>
-			<uni-list-item title="修改密码" @click="navTo('/pages/set/password')" ></uni-list-item>
-		    <uni-list-item title="实名认证" @click="navTo('/pages/set/phone')" ></uni-list-item>
+			<!-- <uni-list-item title="修改密码" @click="navTo('/pages/set/password')" ></uni-list-item> -->
+		    <!-- <uni-list-item title="实名认证" @click="navTo('/pages/set/approve')" ></uni-list-item> -->
 		    <uni-list-item title="收货地址" @click="navTo('/pages/set/address')" ></uni-list-item>
 		</uni-list>
-		<uni-list class="margin-t-20">
+		<!-- <uni-list class="margin-t-20">
 		    <uni-list-item title="消息推送" :switch-checked='true' :show-switch="true" :show-arrow="false" switch-color='#5dbc7c'  @switchChange='switchChange'> 
 			</uni-list-item>
-		</uni-list>
+		</uni-list> -->
 		
-		<uni-list class="margin-t-20">
+		<!-- <uni-list class="margin-t-20">
 		    <uni-list-item title="清除缓存" ></uni-list-item>
 		    <uni-list-item title="检查更新" >
 				<template slot="right">
 					当前版本 1.0.3
 				</template>
 			</uni-list-item>
-		</uni-list>
-		<view class="list-cell log-out-btn" @click="toLogout">
+		</uni-list> -->
+		<!-- <view class="list-cell log-out-btn" @click="toLogout">
 			<text class="cell-tit">退出登录</text>
-		</view>
+		</view> -->
 	</view>
 </template>
 

+ 0 - 120
pages/user/approve.vue

@@ -1,120 +0,0 @@
-<template>
-	<view class="content">
-		
-		
-		
-		
-	</view>
-</template>
-
-<script>
-// #ifdef H5
-import { loginWinxin } from '@/utils/wxAuthorized';
-// #endif
-// #ifdef MP-WEIXIN
-import { wechatMpAuth } from '@/api/wx';
-// #endif
-import { mapMutations } from 'vuex';
-import { getUserInfo, bangding } from '@/api/login.js';
-export default {
-	data() {
-		return {
-			userInfo: {}, //授权用户信息
-			code: '', //授权code
-			loding: false, //判断是否在点击中
-			MaskShow: false // 手机号授权弹窗
-		};
-	},
-	onLoad(option) {
-	},
-	methods: {
-		ToIndex() {
-			let obj = this;
-			let ur = uni.getStorageSync('present') || '/pages/index/index';
-			// 用于处理缓存bug
-			if (ur == 'pages/product/product') {
-				ur = '/pages/index/index';
-			}
-			uni.switchTab({
-				url: ur,
-				fail(e) {
-					uni.navigateTo({
-						url: ur,
-						fail(e) {
-							uni.navigateTo({
-								url: '/pages/index/index'
-							});
-						}
-					});
-				}
-			});
-		},
-		// 绑定手机号
-		PhoneNumber(e) {
-			let obj = this;
-			obj.MaskShow = false;
-			(obj.iv = e.detail.iv), (obj.encryptedData = e.detail.encryptedData);
-
-			uni.setStorageSync('code', obj.code);
-			bangding({
-				flag: 1,
-				cache_key: obj.cache_key,
-				code: obj.code,
-				iv: obj.iv,
-				encryptedData: obj.encryptedData
-			}).then(function(e) {
-				if (e.data.is_bind == 1) {
-					console.log('bangding1');
-					bangding({
-						flag: 1,
-						cache_key: obj.cache_key,
-						code: obj.code,
-						iv: obj.iv,
-						encryptedData: obj.encryptedData,
-						step: 1
-					})
-						.then(function(e) {
-							// 获取用户基础信息
-							obj.GetUser();
-							obj.$api.msg(e.msg);
-							obj.$nextTick(function() {
-								obj.ToIndex();
-							});
-						})
-						.catch(e => {
-							console.log(e);
-						});
-				} else {
-					console.log('bangding2');
-					obj.$api.msg(e.msg);
-					// 获取用户基础信息
-					obj.GetUser();
-					obj.$api.msg(e.msg);
-					obj.$nextTick(function() {
-						obj.ToIndex();
-					});
-				}
-			});
-		},
-		GetUser() {
-			// 获取用户基础信息
-			getUserInfo({})
-				.then(({ data }) => {
-					this.setUserInfo(data);
-					console.log(data, 11);
-					console.log(uni.getStorageSync('userInfo'), 55);
-				})
-				.catch(e => {
-					console.log(e);
-				});
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-page,
-.content {
-	height: 100%;
-}
-</style>

+ 1 - 1
pages/user/user.vue

@@ -167,7 +167,7 @@ export default {
 							showCancel: false,
 							success: res => {
 								uni.navigateTo({
-									url: '/pages/user/approve',
+									url: '/pages/set/approve',
 								});
 							},
 						});

BIN
static/img/bgRz.png


BIN
static/img/upImgbg.png


+ 4 - 4
utils/wxAuthorized.js

@@ -224,19 +224,19 @@ function shareFun(config) {
 export function setRouter(route) {
 	return new Promise((ok, err) => {
 		router = getApp().$router;
-		console.log(router,'开始数据');
+		// console.log(router,'开始数据');
 		if (!router) {
 			const set = setInterval(() => {
 				router = getApp().$router;
-				console.log(router,'返回数据');
+				// console.log(router,'返回数据');
 				if (router) {
-					console.log(router,'结束');
+					// console.log(router,'结束');
 					clearInterval(set)
 					ok(router)
 				}
 			}, 100);
 		}else{
-			console.log(router,'成功');
+			// console.log(router,'成功');
 			ok(router)
 		}
 	})

Some files were not shown because too many files changed in this diff