Browse Source

feat: QSGO-11: 登录/注册增加手机验证码

Tyler 2 years ago
parent
commit
f9deb2c3e0
8 changed files with 2526 additions and 2369 deletions
  1. 33 0
      .gitignore
  2. 203 203
      App.vue
  3. 213 203
      components/app-share.vue
  4. 81 80
      components/upload/upload.vue
  5. 26 24
      config.js
  6. 392 392
      main.js
  7. 926 817
      pages/login/applet.vue
  8. 652 650
      pages/user/index/index.vue

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+# 依赖文件夹
+node_modules/
+ 
+# 开发环境下的配置文件
+.env.development
+.env.production
+ 
+# 本地化文件
+local.config.js
+ 
+# 项目构建产生的文件
+
+unpackage/dist/
+
+# 日志文件
+logs/
+ 
+# 系统文件
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+ 
+# 编辑器配置文件
+.idea/
+.vscode/
+.hbuilderx/
+ 
+# 其他
+/uni_modules/

+ 203 - 203
App.vue

@@ -1,203 +1,203 @@
-<script>
-	import utils from './common/utils.js'
-	import config from './config.js'
-	export default {
-		onLaunch: function(e) {
-			// 隐私政策
-			// #ifdef APP-PLUS
-			this.isFirstEnter();
-			// #endif
-			console.log('App Launch');
-			//#ifdef MP-WEIXIN	
-			//检查更新
-			this.updateManager();
-			//#endif
-			// #ifdef APP-PLUS
-			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
-				uni.request({
-					url: config.app_url + '/index.php/api/index/update',
-					data: {
-						version: widgetInfo.version,
-						name: widgetInfo.name,
-						app_id: config.app_id,
-						platform: uni.getSystemInfoSync().platform
-					},
-					success: (result) => {
-						console.log(result);
-						var data = result.data.data.result;
-						if (data.update && data.wgtUrl) {
-							uni.downloadFile({
-								url: data.wgtUrl,
-								success: (downloadResult) => {
-									if (downloadResult.statusCode === 200) {
-										plus.runtime.install(downloadResult
-											.tempFilePath, {
-												force: true
-											},
-											function() {
-												console.log('install success...');
-												plus.nativeUI.alert(
-													"已更新至最新版本,确定后将重启应用",
-													function() {
-														plus.runtime.restart();
-													}, "更新提示", "确定");
-											},
-											function(e) {
-												console.error('install fail...');
-											});
-									}
-								}
-							});
-						}
-						if (data.update && data.pkgUrl) {
-							plus.nativeUI.confirm("有新版本更新,请点击确认更新到最新版本,以免影响使用", function(e) {
-								if (e.index == 0) {
-									plus.runtime.openURL(data.pkgUrl);
-								}
-							}, {
-								"title": "更新提示",
-								"buttons": ["确定", "取消"],
-								"verticalAlign": "center"
-							});
-						}
-					},
-					error: (error) => {
-						console.log('----------------error');
-						console.log(error);
-					}
-				});
-			});
-			// #endif
-			//应用启动参数
-			this.onStartupScene(e.query);
-			// #ifndef APP-PLUS
-			this.getTabBarLinks();
-			//#endif
-		},
-		onShow: function() {
-
-
-			//console.log('App Show')
-		},
-		onHide: function() {
-			//console.log('App Hide')
-		},
-		methods: {
-			isFirstEnter() {
-				var firstEnter = uni.getStorageSync('firstEnter'); //同步获取缓存中是否有首次进入字段
-				let self = this;
-				uni.getSystemInfo({
-					success(data) {
-						console.log('firstEnter='+ firstEnter);
-						// 如果是ios并且没有firstEnter缓存则弹出模态框
-						if (data.platform == 'ios' && !firstEnter) {
-							console.log('---------------');
-							uni.navigateTo({
-								url: '/pages/privacy/privacy'
-							})
-						} 
-					}
-				})
-			},
-			updateManager: function() {
-				const updateManager = uni.getUpdateManager();
-				updateManager.onCheckForUpdate(function(res) {
-					// 请求完新版本信息的回调
-					if (res.hasUpdate) {
-						updateManager.onUpdateReady(function(res2) {
-							uni.showModal({
-								title: '更新提示',
-								content: '新版本已经准备好,即将重启应用',
-								showCancel: false,
-								success(res2) {
-									if (res2.confirm) {
-										// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-										updateManager.applyUpdate();
-									}
-								}
-							});
-						});
-					}
-				});
-
-				updateManager.onUpdateFailed(function(res) {
-					// 新的版本下载失败
-					uni.showModal({
-						title: '更新提示',
-						content: '检查到有新版本,但下载失败,请检查网络设置',
-						showCancel: false
-					});
-				});
-			},
-			/**
-			 * 小程序启动场景
-			 */
-			onStartupScene(query) {
-				// 获取场景值
-				let scene = utils.getSceneData(query);
-				// 记录推荐人id
-				let refereeId = query.referee_id;
-				if (refereeId > 0) {
-					if (!uni.getStorageSync('referee_id')) {
-						uni.setStorageSync('referee_id', refereeId);
-					}
-				}
-				// 记录分销人id
-				let uid = scene.uid;
-				if (uid > 0) {
-					uni.setStorageSync('referee_id', uid);
-				}
-				// 邀请有礼id
-				let invitation_id = query.invitation_id;
-				if (invitation_id > 0) {
-					uni.setStorageSync('invitation_id', invitation_id);
-				}
-				let invitid = scene.invitid;
-				if (invitid > 0) {
-					uni.setStorageSync('invitation_id', invitid);
-				}
-				// 如果是h5,设置app_id
-				// #ifdef  H5
-				let appId = query.app_id;
-				if (appId > 0) {
-					uni.setStorageSync('app_id', appId);
-				}
-				if (uni.getStorageSync('app_id')) {
-					this.config.app_id = uni.getStorageSync('app_id');
-				}
-				// #endif
-			},
-			getTabBarLinks() {
-				uni.request({
-					url: this.config.app_url + '/index.php/api/index/nav',
-					data: {
-						app_id: this.config.app_id
-					},
-					success: (result) => {
-						let vars = result.data.data.vars;
-						uni.setStorageSync('TabBar', vars);
-						uni.setTabBarStyle({
-							color: vars.no_color,
-							selectedColor: vars.color,
-						})
-						vars.menus.forEach((item, index) => {
-							uni.setTabBarItem({
-								index: index,
-								text: item.text,
-								iconPath: item.iconPath,
-								selectedIconPath: item.selectedIconPath
-							})
-						})
-					}
-				});
-			}
-		}
-	}
-</script>
-
-<style>
-	@import './common/iconfont.css';
-	@import './common/myIcon.css';
-	/*每个页面公共css */
-	@import './common/style.css';
-</style>
+<script>
+	import utils from './common/utils.js'
+	import config from './config.js'
+	export default {
+		onLaunch: function(e) {
+			// 隐私政策
+			// #ifdef APP-PLUS
+			this.isFirstEnter();
+			// #endif
+			console.log('App Launch');
+			//#ifdef MP-WEIXIN	
+			//检查更新
+			this.updateManager();
+			//#endif
+			// #ifdef APP-PLUS
+			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
+				uni.request({
+					url: config.app_url + '/api/index/update',
+					data: {
+						version: widgetInfo.version,
+						name: widgetInfo.name,
+						app_id: config.app_id,
+						platform: uni.getSystemInfoSync().platform
+					},
+					success: (result) => {
+						console.log(result);
+						var data = result.data.data.result;
+						if (data.update && data.wgtUrl) {
+							uni.downloadFile({
+								url: data.wgtUrl,
+								success: (downloadResult) => {
+									if (downloadResult.statusCode === 200) {
+										plus.runtime.install(downloadResult
+											.tempFilePath, {
+												force: true
+											},
+											function() {
+												console.log('install success...');
+												plus.nativeUI.alert(
+													"已更新至最新版本,确定后将重启应用",
+													function() {
+														plus.runtime.restart();
+													}, "更新提示", "确定");
+											},
+											function(e) {
+												console.error('install fail...');
+											});
+									}
+								}
+							});
+						}
+						if (data.update && data.pkgUrl) {
+							plus.nativeUI.confirm("有新版本更新,请点击确认更新到最新版本,以免影响使用", function(e) {
+								if (e.index == 0) {
+									plus.runtime.openURL(data.pkgUrl);
+								}
+							}, {
+								"title": "更新提示",
+								"buttons": ["确定", "取消"],
+								"verticalAlign": "center"
+							});
+						}
+					},
+					error: (error) => {
+						console.log('----------------error');
+						console.log(error);
+					}
+				});
+			});
+			// #endif
+			//应用启动参数
+			this.onStartupScene(e.query);
+			// #ifndef APP-PLUS
+			this.getTabBarLinks();
+			//#endif
+		},
+		onShow: function() {
+
+
+			//console.log('App Show')
+		},
+		onHide: function() {
+			//console.log('App Hide')
+		},
+		methods: {
+			isFirstEnter() {
+				var firstEnter = uni.getStorageSync('firstEnter'); //同步获取缓存中是否有首次进入字段
+				let self = this;
+				uni.getSystemInfo({
+					success(data) {
+						console.log('firstEnter=' + firstEnter);
+						// 如果是ios并且没有firstEnter缓存则弹出模态框
+						if (data.platform == 'ios' && !firstEnter) {
+							console.log('---------------');
+							uni.navigateTo({
+								url: '/pages/privacy/privacy'
+							})
+						}
+					}
+				})
+			},
+			updateManager: function() {
+				const updateManager = uni.getUpdateManager();
+				updateManager.onCheckForUpdate(function(res) {
+					// 请求完新版本信息的回调
+					if (res.hasUpdate) {
+						updateManager.onUpdateReady(function(res2) {
+							uni.showModal({
+								title: '更新提示',
+								content: '新版本已经准备好,即将重启应用',
+								showCancel: false,
+								success(res2) {
+									if (res2.confirm) {
+										// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+										updateManager.applyUpdate();
+									}
+								}
+							});
+						});
+					}
+				});
+
+				updateManager.onUpdateFailed(function(res) {
+					// 新的版本下载失败
+					uni.showModal({
+						title: '更新提示',
+						content: '检查到有新版本,但下载失败,请检查网络设置',
+						showCancel: false
+					});
+				});
+			},
+			/**
+			 * 小程序启动场景
+			 */
+			onStartupScene(query) {
+				// 获取场景值
+				let scene = utils.getSceneData(query);
+				// 记录推荐人id
+				let refereeId = query.referee_id;
+				if (refereeId > 0) {
+					if (!uni.getStorageSync('referee_id')) {
+						uni.setStorageSync('referee_id', refereeId);
+					}
+				}
+				// 记录分销人id
+				let uid = scene.uid;
+				if (uid > 0) {
+					uni.setStorageSync('referee_id', uid);
+				}
+				// 邀请有礼id
+				let invitation_id = query.invitation_id;
+				if (invitation_id > 0) {
+					uni.setStorageSync('invitation_id', invitation_id);
+				}
+				let invitid = scene.invitid;
+				if (invitid > 0) {
+					uni.setStorageSync('invitation_id', invitid);
+				}
+				// 如果是h5,设置app_id
+				// #ifdef  H5
+				let appId = query.app_id;
+				if (appId > 0) {
+					uni.setStorageSync('app_id', appId);
+				}
+				if (uni.getStorageSync('app_id')) {
+					this.config.app_id = uni.getStorageSync('app_id');
+				}
+				// #endif
+			},
+			getTabBarLinks() {
+				uni.request({
+					url: this.config.app_url + '/api/index/nav',
+					data: {
+						app_id: this.config.app_id
+					},
+					success: (result) => {
+						let vars = result.data.data.vars;
+						uni.setStorageSync('TabBar', vars);
+						uni.setTabBarStyle({
+							color: vars.no_color,
+							selectedColor: vars.color,
+						})
+						vars.menus.forEach((item, index) => {
+							uni.setTabBarItem({
+								index: index,
+								text: item.text,
+								iconPath: item.iconPath,
+								selectedIconPath: item.selectedIconPath
+							})
+						})
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	@import './common/iconfont.css';
+	@import './common/myIcon.css';
+	/*每个页面公共css */
+	@import './common/style.css';
+</style>

+ 213 - 203
components/app-share.vue

@@ -1,203 +1,213 @@
-<template>
-
-	<view class="bottom-panel popup-bg" :class="Visible?'bottom-panel open':'bottom-panel close'" @click="closePopup">
-		<view class="content" v-on:click.stop>
-
-			<view class="module-box module-share">
-				<view class="hd d-c-c">
-					分享
-				</view>
-				<view class="p30 box-s-b">
-					<view class="d-c-c">
-						<view class="item flex-1 d-c-c d-c">
-							<button open-type="share" @click="share(0, 'WXSceneSession')">
-								<view class="icon-box d-c-c share-friend">
-									<text class="iconfont icon-fenxiang"></text>
-								</view>
-								<text class="pt20">微信好友</text>
-							</button>
-						</view>
-						<view class="item flex-1 d-c-c d-c">
-							<button class="d-c-c d-c" @click="share(0, 'WXSenceTimeline')">
-								<view class="icon-box d-c-c">
-									<text class="iconfont icon-edit"></text>
-								</view>
-								<text class="pt20">微信朋友圈</text>
-							</button>
-						</view>
-					</view>
-				</view>
-				<view class="btns">
-					<button type="default" @click="closePopup(1)">取消</button>
-				</view>
-			</view>
-
-		</view>
-	</view>
-
-</template>
-
-<script>
-	import config from '@/config.js';
-	export default {
-		data() {
-			return {
-				/*是否可见*/
-				Visible: false,
-				/*分享配置*/
-				shareConfig: {},
-				// logo
-				logo: ''
-			}
-		},
-		created() {
-			this.getData();
-		},
-		props: ['isAppShare', 'appParams'],
-		watch: {
-			'isAppShare': function(n, o) {
-				if (n != o) {
-					this.Visible = n;
-				}
-			}
-		},
-		methods: {
-			getData(){
-				let self = this;
-				self._get(
-					'settings/appShare',{},
-					function(res) {
-						self.shareConfig = res.data.appshare;
-						self.logo = res.data.logo;
-					}
-				);
-			},
-			/*关闭弹窗*/
-			closePopup(type) {
-				this.$emit('close');
-			},
-			// 分享
-			share: function(shareType, scene) {
-				let shareOPtions = {
-					provider: "weixin",
-					scene: scene, //WXSceneSession”分享到聊天界面,“WXSenceTimeline”分享到朋友圈
-					type: shareType,
-					success: function (res) {
-					    console.log("success:" + JSON.stringify(res));
-					},
-					fail: function (err) {
-					    console.log("fail:" + JSON.stringify(err));
-					}
-				}
-				if(this.shareConfig.type != 2){
-					shareOPtions.summary = this.appParams.summary;
-					shareOPtions.imageUrl = this.logo;
-					shareOPtions.title = this.appParams.title;
-					// 公众号/h5
-					if(this.shareConfig.type == 1){
-						shareOPtions.href = this.shareConfig.open_site + this.appParams.path;
-					}else if(this.shareConfig.type == 3){
-						//下载页
-						if(this.shareConfig.bind_type == 1){
-							shareOPtions.href = this.shareConfig.down_url;
-						}else{
-							shareOPtions.href = config.app_url + "/index.php/api/user.useropen/invite?app_id="+ config.app_id +"&referee_id=" + uni.getStorageSync('user_id');
-						}
-					}
-				}else{
-					// 分享到小程序
-					shareOPtions.scene = 'WXSceneSession';
-					shareOPtions.type = 5;
-					shareOPtions.imageUrl = this.appParams.image ? this.appParams.image : this.logo;
-					shareOPtions.title = this.appParams.title;
-					shareOPtions.miniProgram = {
-						id: this.shareConfig.gh_id,
-						path: this.appParams.path,
-						webUrl: this.shareConfig.web_url,
-						type:0
-					};
-				}
-				uni.share(shareOPtions);
-			},
-		}
-	}
-</script>
-
-<style>
-	.bottom-panel{
-		
-	}
-	.bottom-panel.popup-bg {
-		position: fixed;
-		top: 0;
-		right: 0;
-		bottom: 0;
-		left: 0;
-		background: rgba(0, 0, 0, .6);
-		height: 100%;
-		z-index: 98;
-	}
-	.bottom-panel.popup-bg .wechat-box{ padding-top: var(--window-top);}
-	.bottom-panel.popup-bg .wechat-box image{ width: 100%;}
-
-	.bottom-panel .content {
-		position: fixed;
-		width: 100%;
-		bottom: 0;
-		min-height: 200rpx;
-		max-height: 900rpx;
-		background-color: #fff;
-		transform: translate3d(0, 980rpx, 0);
-		transition: transform .2s cubic-bezier(0, 0, .25, 1);
-		bottom: env(safe-area-inset-bottom);
-		z-index: 99;
-	}
-
-	.bottom-panel.open .content {
-		transform: translate3d(0, 0, 0);
-	}
-
-	.bottom-panel.close.popup-bg {
-		display: none;
-	}
-
-	.module-share .hd {
-		height: 90rpx;
-		line-height: 90rpx;
-		font-size: 36rpx;
-	}
-	
-	.module-share .item button,.module-share .item button::after{ background: none; border: none;}
-	
-
-	.module-share .icon-box {
-		width: 100rpx;
-		height: 100rpx;
-		border-radius: 50%;
-		background: #f6bd1d;
-	}
-
-	.module-share .icon-box .iconfont {
-		font-size: 60rpx;
-		color: #FFFFFF;
-	}
-
-	.module-share .btns {
-		margin-top: 30rpx;
-	}
-
-	.module-share .btns button {
-		height: 90rpx;
-		line-height: 90rpx;
-		border-radius: 0;
-		border-top: 1px solid #EEEEEE;
-	}
-
-	.module-share .btns button::after {
-		border-radius: 0;
-	}
-
-	.module-share .share-friend {
-		background: #04BE01;
-	}
-</style>
+<template>
+
+	<view class="bottom-panel popup-bg" :class="Visible?'bottom-panel open':'bottom-panel close'" @click="closePopup">
+		<view class="content" v-on:click.stop>
+
+			<view class="module-box module-share">
+				<view class="hd d-c-c">
+					分享
+				</view>
+				<view class="p30 box-s-b">
+					<view class="d-c-c">
+						<view class="item flex-1 d-c-c d-c">
+							<button open-type="share" @click="share(0, 'WXSceneSession')">
+								<view class="icon-box d-c-c share-friend">
+									<text class="iconfont icon-fenxiang"></text>
+								</view>
+								<text class="pt20">微信好友</text>
+							</button>
+						</view>
+						<view class="item flex-1 d-c-c d-c">
+							<button class="d-c-c d-c" @click="share(0, 'WXSenceTimeline')">
+								<view class="icon-box d-c-c">
+									<text class="iconfont icon-edit"></text>
+								</view>
+								<text class="pt20">微信朋友圈</text>
+							</button>
+						</view>
+					</view>
+				</view>
+				<view class="btns">
+					<button type="default" @click="closePopup(1)">取消</button>
+				</view>
+			</view>
+
+		</view>
+	</view>
+
+</template>
+
+<script>
+	import config from '@/config.js';
+	export default {
+		data() {
+			return {
+				/*是否可见*/
+				Visible: false,
+				/*分享配置*/
+				shareConfig: {},
+				// logo
+				logo: ''
+			}
+		},
+		created() {
+			this.getData();
+		},
+		props: ['isAppShare', 'appParams'],
+		watch: {
+			'isAppShare': function(n, o) {
+				if (n != o) {
+					this.Visible = n;
+				}
+			}
+		},
+		methods: {
+			getData() {
+				let self = this;
+				self._get(
+					'settings/appShare', {},
+					function(res) {
+						self.shareConfig = res.data.appshare;
+						self.logo = res.data.logo;
+					}
+				);
+			},
+			/*关闭弹窗*/
+			closePopup(type) {
+				this.$emit('close');
+			},
+			// 分享
+			share: function(shareType, scene) {
+				let shareOPtions = {
+					provider: "weixin",
+					scene: scene, //WXSceneSession”分享到聊天界面,“WXSenceTimeline”分享到朋友圈
+					type: shareType,
+					success: function(res) {
+						console.log("success:" + JSON.stringify(res));
+					},
+					fail: function(err) {
+						console.log("fail:" + JSON.stringify(err));
+					}
+				}
+				if (this.shareConfig.type != 2) {
+					shareOPtions.summary = this.appParams.summary;
+					shareOPtions.imageUrl = this.logo;
+					shareOPtions.title = this.appParams.title;
+					// 公众号/h5
+					if (this.shareConfig.type == 1) {
+						shareOPtions.href = this.shareConfig.open_site + this.appParams.path;
+					} else if (this.shareConfig.type == 3) {
+						//下载页
+						if (this.shareConfig.bind_type == 1) {
+							shareOPtions.href = this.shareConfig.down_url;
+						} else {
+							shareOPtions.href = config.app_url + "/api/user.useropen/invite?app_id=" + config.app_id +
+								"&referee_id=" + uni.getStorageSync('user_id');
+						}
+					}
+				} else {
+					// 分享到小程序
+					shareOPtions.scene = 'WXSceneSession';
+					shareOPtions.type = 5;
+					shareOPtions.imageUrl = this.appParams.image ? this.appParams.image : this.logo;
+					shareOPtions.title = this.appParams.title;
+					shareOPtions.miniProgram = {
+						id: this.shareConfig.gh_id,
+						path: this.appParams.path,
+						webUrl: this.shareConfig.web_url,
+						type: 0
+					};
+				}
+				uni.share(shareOPtions);
+			},
+		}
+	}
+</script>
+
+<style>
+	.bottom-panel {}
+
+	.bottom-panel.popup-bg {
+		position: fixed;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		background: rgba(0, 0, 0, .6);
+		height: 100%;
+		z-index: 98;
+	}
+
+	.bottom-panel.popup-bg .wechat-box {
+		padding-top: var(--window-top);
+	}
+
+	.bottom-panel.popup-bg .wechat-box image {
+		width: 100%;
+	}
+
+	.bottom-panel .content {
+		position: fixed;
+		width: 100%;
+		bottom: 0;
+		min-height: 200rpx;
+		max-height: 900rpx;
+		background-color: #fff;
+		transform: translate3d(0, 980rpx, 0);
+		transition: transform .2s cubic-bezier(0, 0, .25, 1);
+		bottom: env(safe-area-inset-bottom);
+		z-index: 99;
+	}
+
+	.bottom-panel.open .content {
+		transform: translate3d(0, 0, 0);
+	}
+
+	.bottom-panel.close.popup-bg {
+		display: none;
+	}
+
+	.module-share .hd {
+		height: 90rpx;
+		line-height: 90rpx;
+		font-size: 36rpx;
+	}
+
+	.module-share .item button,
+	.module-share .item button::after {
+		background: none;
+		border: none;
+	}
+
+
+	.module-share .icon-box {
+		width: 100rpx;
+		height: 100rpx;
+		border-radius: 50%;
+		background: #f6bd1d;
+	}
+
+	.module-share .icon-box .iconfont {
+		font-size: 60rpx;
+		color: #FFFFFF;
+	}
+
+	.module-share .btns {
+		margin-top: 30rpx;
+	}
+
+	.module-share .btns button {
+		height: 90rpx;
+		line-height: 90rpx;
+		border-radius: 0;
+		border-top: 1px solid #EEEEEE;
+	}
+
+	.module-share .btns button::after {
+		border-radius: 0;
+	}
+
+	.module-share .share-friend {
+		background: #04BE01;
+	}
+</style>

+ 81 - 80
components/upload/upload.vue

@@ -1,80 +1,81 @@
-<template>
-	<view></view>
-</template>
-
-<script>
-export default {
-	data() {
-		return {
-			/*需要返回的图片*/
-			imageList:[]
-		};
-	},
-	onLoad() {},
-	props:['num'],
-	mounted() {
-		this.chooseImageFunc();
-	},
-	methods: {
-		
-		/*打开相机或者相册,选择图片*/
-		chooseImageFunc() {
-			let self=this;
-			uni.chooseImage({
-				count: self.$props.num || 9, //默认9
-				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-				sourceType: ['album', 'camera'], //从相册选择
-				success: function(res) {
-					self.uploadFile(res.tempFilePaths);
-				},
-				fail:function(res){
-					self.$emit('getImgs',null);
-				},
-				complete:function(res){
-					
-				}
-			});
-		},
-		
-		/*上传图片*/
-		uploadFile: function(tempList) {
-			let self = this;
-			let i = 0;
-			let img_length=tempList.length;
-			let params = {
-				token: uni.getStorageSync('token'),
-                app_id: self.getAppId()
-			};
-			uni.showLoading({
-			    title: '图片上传中'
-			});
-			tempList.forEach(function(filePath, fileKey) {
-				uni.uploadFile({
-					url: self.websiteUrl + '/index.php?s=/api/file.upload/image',
-					filePath: filePath,
-					name: 'iFile',
-					formData: params,
-					success: function(res) {
-						let result = typeof res.data === 'object' ? res.data : JSON.parse(res.data);
-						if (result.code === 1) {
-							self.imageList.push(result.data);
-						}else{
-							self.showError(result.msg);
-						}
-					},
-					complete: function() {
-						i++;
-						if (img_length === i) {
-							uni.hideLoading();
-							// 所有文件上传完成
-							self.$emit('getImgs',self.imageList);
-						}
-					}
-				});
-			});
-		}
-	}
-};
-</script>
-
-<style></style>
+<template>
+	<view></view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				/*需要返回的图片*/
+				imageList: []
+			};
+		},
+		onLoad() {},
+		props: ['num'],
+		mounted() {
+			this.chooseImageFunc();
+		},
+		methods: {
+
+			/*打开相机或者相册,选择图片*/
+			chooseImageFunc() {
+				let self = this;
+				uni.chooseImage({
+					count: self.$props.num || 9, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album', 'camera'], //从相册选择
+					success: function(res) {
+						self.uploadFile(res.tempFilePaths);
+					},
+					fail: function(res) {
+						self.$emit('getImgs', null);
+					},
+					complete: function(res) {
+
+					}
+				});
+			},
+
+			/*上传图片*/
+			uploadFile: function(tempList) {
+				let self = this;
+				let i = 0;
+				let img_length = tempList.length;
+				let params = {
+					token: uni.getStorageSync('token'),
+					app_id: self.getAppId()
+				};
+				uni.showLoading({
+					title: '图片上传中'
+				});
+				tempList.forEach(function(filePath, fileKey) {
+					uni.uploadFile({
+						url: self.websiteUrl + '/api/file.upload/image',
+						filePath: filePath,
+						name: 'iFile',
+						formData: params,
+						success: function(res) {
+							let result = typeof res.data === 'object' ? res.data : JSON.parse(res
+								.data);
+							if (result.code === 1) {
+								self.imageList.push(result.data);
+							} else {
+								self.showError(result.msg);
+							}
+						},
+						complete: function() {
+							i++;
+							if (img_length === i) {
+								uni.hideLoading();
+								// 所有文件上传完成
+								self.$emit('getImgs', self.imageList);
+							}
+						}
+					});
+				});
+			}
+		}
+	};
+</script>
+
+<style></style>

+ 26 - 24
config.js

@@ -1,24 +1,26 @@
-// var app_url = 'http://testaikang.7starsoft2.com';//测试
-// var app_url = 'http://cni-ekshop.cni.com.cn';	
-var app_url = 'https://cni-ekshop.com';	//正式
-// 如果是本地测试环境
-if(process.env.NODE_ENV === 'development'){
-    //#ifdef H5
-	app_url = app_url;
-	//#endif
-}
-// 如果是生产环境,h5环境下直接读取url
-if(process.env.NODE_ENV === 'production'){
-    //#ifdef H5
-	app_url = window.location.protocol+'//' + window.location.host;
-	//#endif
-}
-
-export default {
-	/*服务器地址*/
-	app_url: app_url,
-	/*appid*/
-	app_id: 10001,
-	//h5发布路径
-	h5_addr: '/h5',
-} 
+// var app_url = 'http://testaikang.7starsoft2.com';//测试
+// var app_url = 'http://cni-ekshop.cni.com.cn';
+var app_url = 'https://ex.mips.cni-ekshop.com:8050'; //测试
+// var app_url = 'https://cni-ekshop.com'; //正式
+
+// 如果是本地测试环境
+if (process.env.NODE_ENV === 'development') {
+	//#ifdef H5
+	app_url = app_url;
+	//#endif
+}
+// 如果是生产环境,h5环境下直接读取url
+if (process.env.NODE_ENV === 'production') {
+	//#ifdef H5
+	app_url = window.location.protocol + '//' + window.location.host;
+	//#endif
+}
+
+export default {
+	/*服务器地址*/
+	app_url: app_url,
+	/*appid*/
+	app_id: 10001,
+	//h5发布路径
+	h5_addr: '/h5',
+}

+ 392 - 392
main.js

@@ -1,393 +1,393 @@
-import Vue from 'vue'
-import App from './App'
-import directive from './common/directive.js'
-import utils from './common/utils.js'
-import config from './config.js'
-import onfire from './common/onfire.js'
-import {
-	gotopage
-} from '@/common/gotopage.js'
-
-/* Vuex */
-import store from "./store/index.js"
-Vue.prototype.$store = store;
-
-// 公共组件
-import headerBar from './components/header.vue'
-Vue.component('header-bar', headerBar)
-
-// import Vconsole from 'vconsole'
-// const vConsole = new Vconsole()
-// Vue.use(vConsole)
-Vue.prototype.$fire = new onfire()
-
-Vue.config.productionTip = false
-
-App.mpType = 'app'
-
-Vue.prototype.config = config
-
-const app = new Vue({
-	...App
-})
-app.$mount()
-
-Vue.prototype.websiteUrl = config.app_url;
-Vue.prototype.app_id = config.app_id;
-//h5发布路径
-Vue.prototype.h5_addr = config.h5_addr;
-/*页面跳转*/
-Vue.prototype.gotoPage = gotopage;
-
-
-//#ifdef H5
-app.$router.afterEach((to, from) => {
-	const u = navigator.userAgent.toLowerCase()
-	if (u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger') return
-	if (to.path !== global.location.pathname) {
-		location.assign(config.h5_addr + to.fullPath);
-	}
-})
-//#endif
-
-
-//是否是ios
-Vue.prototype.ios = function() {
-	const u = navigator.userAgent.toLowerCase();
-	if (u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger') {
-		return false;
-	}
-	return true;
-};
-
-//get请求
-Vue.prototype._get = function(path, data, success, fail, complete) {
-	data = data || {};
-	data.token = uni.getStorageSync('token') || '';
-	data.app_id = this.getAppId();
-	uni.request({
-		url: this.websiteUrl + '/index.php/api/' + path,
-		data: data,
-		dataType: 'json',
-		method: 'GET',
-		success: (res) => {
-			if (res.statusCode !== 200 || typeof res.data !== 'object') {
-				return false;
-			}
-			if (res.data.code === -2) {
-				console.log('用户已删除');
-				console.log(res.data.msg)
-				this.showError(res.data.msg, function() {
-					uni.removeStorageSync('token');
-					this.gotoPage('/pages/index/index', 'reLaunch');
-				})
-			} else if (res.data.code === -1) {
-				// 登录态失效, 重新登录
-				console.log('登录态失效, 重新登录');
-				this.doLogin();
-			} else if (res.data.code === 0) {
-				this.showError(res.data.msg, function() {
-					fail && fail(res);
-				});
-				return false;
-			} else {
-				success && success(res.data);
-			}
-		},
-		fail: (res) => {
-			fail && fail(res);
-		},
-		complete: (res) => {
-			uni.hideLoading();
-			complete && complete(res);
-		},
-	});
-};
-
-//get请求
-Vue.prototype._post = function(path, data, success, fail, complete) {
-	data = data || {};
-	data.token = uni.getStorageSync('token') || '';
-	data.app_id = this.getAppId();
-	uni.request({
-		url: this.websiteUrl + '/index.php/api/' + path,
-		data: data,
-		dataType: 'json',
-		method: 'POST',
-		header: {
-			'content-type': 'application/x-www-form-urlencoded',
-		},
-		success: (res) => {
-			if (res.statusCode !== 200 || typeof res.data !== 'object') {
-				return false;
-			}
-			if (res.data.code === -1) {
-				// 登录态失效, 重新登录
-				console.log('登录态失效, 重新登录');
-				this.doLogin();
-			} else if (res.data.code === 0) {
-				this.showError(res.data.msg, function() {
-					fail && fail(res);
-				});
-				return false;
-			} else {
-				success && success(res.data);
-			}
-		},
-		fail: (res) => {
-			fail && fail(res);
-		},
-		complete: (res) => {
-			uni.hideLoading();
-			complete && complete(res);
-		},
-	});
-};
-
-Vue.prototype.doLogin = function() {
-	let pages = getCurrentPages();
-	if (pages.length) {
-		let currentPage = pages[pages.length - 1];
-		if ("pages/login/login" != currentPage.route &&
-			"pages/login/weblogin" != currentPage.route &&
-			"pages/login/openlogin" != currentPage.route) {
-			uni.setStorageSync("currentPage", currentPage.route);
-			uni.setStorageSync("currentPageOptions", currentPage.options);
-		}
-	}
-	//公众号
-	// #ifdef  H5
-	if (this.isWeixin()) {
-		let invitation_id = uni.getStorageSync('invitation_id') ? uni.getStorageSync('invitation_id') : 0;
-		window.location.href = this.websiteUrl + '/index.php/api/user.usermp/login?app_id=' + this.getAppId() +
-			'&referee_id=' + uni.getStorageSync('referee_id') + '&invitation_id=' + invitation_id;
-	} else {
-		this.gotoPage("/pages/login/weblogin");
-	}
-	// #endif
-	// #ifdef APP-PLUS
-	this.gotoPage("/pages/login/openlogin");
-	return;
-	// #endif
-	// 非公众号,跳转授权页面
-	// #ifndef  H5
-	this.gotoPage("/pages/login/login");
-	// #endif
-};
-
-
-/**
- * 显示失败提示框
- */
-Vue.prototype.showError = function(msg, callback) {
-	uni.showModal({
-		title: '友情提示',
-		content: msg,
-		showCancel: false,
-		success: function(res) {
-			callback && callback();
-		}
-	});
-};
-
-/**
- * 显示失败提示框
- */
-Vue.prototype.showSuccess = function(msg, callback) {
-	uni.showModal({
-		title: '友情提示',
-		content: msg,
-		showCancel: false,
-		success: function(res) {
-			callback && callback();
-		}
-	});
-};
-
-/**
- * 获取应用ID
- */
-Vue.prototype.getAppId = function() {
-	return this.app_id || 10001;
-};
-
-Vue.prototype.compareVersion = function(v1, v2) {
-	v1 = v1.split('.')
-	v2 = v2.split('.')
-	const len = Math.max(v1.length, v2.length)
-
-	while (v1.length < len) {
-		v1.push('0')
-	}
-	while (v2.length < len) {
-		v2.push('0')
-	}
-
-	for (let i = 0; i < len; i++) {
-		const num1 = parseInt(v1[i])
-		const num2 = parseInt(v2[i])
-
-		if (num1 > num2) {
-			return 1
-		} else if (num1 < num2) {
-			return -1
-		}
-	}
-
-	return 0
-};
-
-
-/**
- * 生成转发的url参数
- */
-Vue.prototype.getShareUrlParams = function(params) {
-	let self = this;
-	return utils.urlEncode(Object.assign({
-		referee_id: self.getUserId(),
-		app_id: self.getAppId()
-	}, params));
-};
-
-/**
- * 当前用户id
- */
-Vue.prototype.getUserId = function() {
-	return uni.getStorageSync('user_id');
-};
-
-//#ifdef H5
-var jweixin = require('jweixin-module');
-
-Vue.prototype.configWx = function(signPackage, shareParams, params) {
-	if (signPackage == '') {
-		return;
-	}
-	let self = this;
-	jweixin.config(JSON.parse(signPackage));
-
-	let url_params = self.getShareUrlParams(params);
-
-	jweixin.ready(function(res) {
-		jweixin.updateAppMessageShareData({
-			title: shareParams.title,
-			desc: shareParams.desc,
-			link: self.websiteUrl + self.h5_addr + shareParams.link + '?' + url_params,
-			imgUrl: shareParams.imgUrl,
-			success: function() {
-
-			}
-		});
-		jweixin.updateTimelineShareData({
-			title: shareParams.title,
-			desc: shareParams.desc,
-			link: self.websiteUrl + self.h5_addr + shareParams.link + '?' + url_params,
-			imgUrl: shareParams.imgUrl,
-			success: function() {
-
-			}
-		});
-	});
-};
-
-Vue.prototype.configWxScan = function(signPackage) {
-	if (signPackage == '') {
-		return;
-	}
-	jweixin.config(JSON.parse(signPackage));
-	return jweixin;
-};
-//#endif
-
-/**
- * 获取当前平台
- */
-Vue.prototype.getPlatform = function(params) {
-	let platform = 'wx';
-	// #ifdef  APP-PLUS
-	platform = 'app';
-	// #endif
-	// #ifdef  H5
-	if (this.isWeixin()) {
-		platform = 'mp';
-	} else {
-		platform = 'h5';
-	}
-	// #endif
-	return platform;
-};
-
-/**
- * 订阅通知,目前仅小程序
- */
-Vue.prototype.subMessage = function(temlIds, callback) {
-	let self = this;
-	// #ifdef  MP-WEIXIN
-	//小程序订阅消息
-	const version = wx.getSystemInfoSync().SDKVersion;
-	if (temlIds && temlIds.length != 0 && self.compareVersion(version, '2.8.2') >= 0) {
-		wx.requestSubscribeMessage({
-			tmplIds: temlIds,
-			success(res) {},
-			fail(res) {},
-			complete(res) {
-				callback();
-			},
-		});
-	} else {
-		callback();
-	}
-	// #endif
-	// #ifndef MP-WEIXIN
-	callback();
-	// #endif
-};
-
-Vue.prototype.isWeixin = function() {
-	var ua = navigator.userAgent.toLowerCase();
-	if (ua.match(/MicroMessenger/i) == "micromessenger") {
-		return true;
-	} else {
-		return false;
-	}
-};
-
-Vue.prototype.topBarTop = function() {
-	// #ifdef MP-WEIXIN
-	return uni.getMenuButtonBoundingClientRect().top;
-	// #endif
-	// #ifndef MP-WEIXIN
-	const SystemInfo = uni.getSystemInfoSync();
-	return SystemInfo.statusBarHeight;
-	// #endif
-};
-Vue.prototype.topBarHeight = function() {
-	// #ifdef MP-WEIXIN
-	return uni.getMenuButtonBoundingClientRect().height;
-	// #endif
-	// #ifndef MP-WEIXIN
-	return 0
-	// #endif
-};
-Vue.prototype.yulan = function(e, i) {
-	let image_path_arr = [];
-	if (!Array.isArray(e)) {
-		image_path_arr = [e];
-	} else {
-		if (e[0].file_path) {
-			e.forEach((item, index) => {
-				image_path_arr.push(item.file_path)
-			})
-		} else {
-			image_path_arr = e
-		}
-	}
-	let picnum = i * 1;
-	uni.previewImage({
-		urls: image_path_arr,
-		current: picnum,
-	});
-}
-Vue.prototype.theme = function() {
-	return this.$store.state.theme
+import Vue from 'vue'
+import App from './App'
+import directive from './common/directive.js'
+import utils from './common/utils.js'
+import config from './config.js'
+import onfire from './common/onfire.js'
+import {
+	gotopage
+} from '@/common/gotopage.js'
+
+/* Vuex */
+import store from "./store/index.js"
+Vue.prototype.$store = store;
+
+// 公共组件
+import headerBar from './components/header.vue'
+Vue.component('header-bar', headerBar)
+
+// import Vconsole from 'vconsole'
+// const vConsole = new Vconsole()
+// Vue.use(vConsole)
+Vue.prototype.$fire = new onfire()
+
+Vue.config.productionTip = false
+
+App.mpType = 'app'
+
+Vue.prototype.config = config
+
+const app = new Vue({
+	...App
+})
+app.$mount()
+
+Vue.prototype.websiteUrl = config.app_url;
+Vue.prototype.app_id = config.app_id;
+//h5发布路径
+Vue.prototype.h5_addr = config.h5_addr;
+/*页面跳转*/
+Vue.prototype.gotoPage = gotopage;
+
+
+//#ifdef H5
+app.$router.afterEach((to, from) => {
+	const u = navigator.userAgent.toLowerCase()
+	if (u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger') return
+	if (to.path !== global.location.pathname) {
+		location.assign(config.h5_addr + to.fullPath);
+	}
+})
+//#endif
+
+
+//是否是ios
+Vue.prototype.ios = function() {
+	const u = navigator.userAgent.toLowerCase();
+	if (u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger') {
+		return false;
+	}
+	return true;
+};
+
+//get请求
+Vue.prototype._get = function(path, data, success, fail, complete) {
+	data = data || {};
+	data.token = uni.getStorageSync('token') || '';
+	data.app_id = this.getAppId();
+	uni.request({
+		url: this.websiteUrl + '/api/' + path,
+		data: data,
+		dataType: 'json',
+		method: 'GET',
+		success: (res) => {
+			if (res.statusCode !== 200 || typeof res.data !== 'object') {
+				return false;
+			}
+			if (res.data.code === -2) {
+				console.log('用户已删除');
+				console.log(res.data.msg)
+				this.showError(res.data.msg, function() {
+					uni.removeStorageSync('token');
+					this.gotoPage('/pages/index/index', 'reLaunch');
+				})
+			} else if (res.data.code === -1) {
+				// 登录态失效, 重新登录
+				console.log('登录态失效, 重新登录');
+				this.doLogin();
+			} else if (res.data.code === 0) {
+				this.showError(res.data.msg, function() {
+					fail && fail(res);
+				});
+				return false;
+			} else {
+				success && success(res.data);
+			}
+		},
+		fail: (res) => {
+			fail && fail(res);
+		},
+		complete: (res) => {
+			uni.hideLoading();
+			complete && complete(res);
+		},
+	});
+};
+
+//get请求
+Vue.prototype._post = function(path, data, success, fail, complete) {
+	data = data || {};
+	data.token = uni.getStorageSync('token') || '';
+	data.app_id = this.getAppId();
+	uni.request({
+		url: this.websiteUrl + '/api/' + path,
+		data: data,
+		dataType: 'json',
+		method: 'POST',
+		header: {
+			'content-type': 'application/x-www-form-urlencoded',
+		},
+		success: (res) => {
+			if (res.statusCode !== 200 || typeof res.data !== 'object') {
+				return false;
+			}
+			if (res.data.code === -1) {
+				// 登录态失效, 重新登录
+				console.log('登录态失效, 重新登录');
+				this.doLogin();
+			} else if (res.data.code === 0) {
+				this.showError(res.data.msg, function() {
+					fail && fail(res);
+				});
+				return false;
+			} else {
+				success && success(res.data);
+			}
+		},
+		fail: (res) => {
+			fail && fail(res);
+		},
+		complete: (res) => {
+			uni.hideLoading();
+			complete && complete(res);
+		},
+	});
+};
+
+Vue.prototype.doLogin = function() {
+	let pages = getCurrentPages();
+	if (pages.length) {
+		let currentPage = pages[pages.length - 1];
+		if ("pages/login/login" != currentPage.route &&
+			"pages/login/weblogin" != currentPage.route &&
+			"pages/login/openlogin" != currentPage.route) {
+			uni.setStorageSync("currentPage", currentPage.route);
+			uni.setStorageSync("currentPageOptions", currentPage.options);
+		}
+	}
+	//公众号
+	// #ifdef  H5
+	if (this.isWeixin()) {
+		let invitation_id = uni.getStorageSync('invitation_id') ? uni.getStorageSync('invitation_id') : 0;
+		window.location.href = this.websiteUrl + '/api/user.usermp/login?app_id=' + this.getAppId() +
+			'&referee_id=' + uni.getStorageSync('referee_id') + '&invitation_id=' + invitation_id;
+	} else {
+		this.gotoPage("/pages/login/weblogin");
+	}
+	// #endif
+	// #ifdef APP-PLUS
+	this.gotoPage("/pages/login/openlogin");
+	return;
+	// #endif
+	// 非公众号,跳转授权页面
+	// #ifndef  H5
+	this.gotoPage("/pages/login/login");
+	// #endif
+};
+
+
+/**
+ * 显示失败提示框
+ */
+Vue.prototype.showError = function(msg, callback) {
+	uni.showModal({
+		title: '友情提示',
+		content: msg,
+		showCancel: false,
+		success: function(res) {
+			callback && callback();
+		}
+	});
+};
+
+/**
+ * 显示失败提示框
+ */
+Vue.prototype.showSuccess = function(msg, callback) {
+	uni.showModal({
+		title: '友情提示',
+		content: msg,
+		showCancel: false,
+		success: function(res) {
+			callback && callback();
+		}
+	});
+};
+
+/**
+ * 获取应用ID
+ */
+Vue.prototype.getAppId = function() {
+	return this.app_id || 10001;
+};
+
+Vue.prototype.compareVersion = function(v1, v2) {
+	v1 = v1.split('.')
+	v2 = v2.split('.')
+	const len = Math.max(v1.length, v2.length)
+
+	while (v1.length < len) {
+		v1.push('0')
+	}
+	while (v2.length < len) {
+		v2.push('0')
+	}
+
+	for (let i = 0; i < len; i++) {
+		const num1 = parseInt(v1[i])
+		const num2 = parseInt(v2[i])
+
+		if (num1 > num2) {
+			return 1
+		} else if (num1 < num2) {
+			return -1
+		}
+	}
+
+	return 0
+};
+
+
+/**
+ * 生成转发的url参数
+ */
+Vue.prototype.getShareUrlParams = function(params) {
+	let self = this;
+	return utils.urlEncode(Object.assign({
+		referee_id: self.getUserId(),
+		app_id: self.getAppId()
+	}, params));
+};
+
+/**
+ * 当前用户id
+ */
+Vue.prototype.getUserId = function() {
+	return uni.getStorageSync('user_id');
+};
+
+//#ifdef H5
+var jweixin = require('jweixin-module');
+
+Vue.prototype.configWx = function(signPackage, shareParams, params) {
+	if (signPackage == '') {
+		return;
+	}
+	let self = this;
+	jweixin.config(JSON.parse(signPackage));
+
+	let url_params = self.getShareUrlParams(params);
+
+	jweixin.ready(function(res) {
+		jweixin.updateAppMessageShareData({
+			title: shareParams.title,
+			desc: shareParams.desc,
+			link: self.websiteUrl + self.h5_addr + shareParams.link + '?' + url_params,
+			imgUrl: shareParams.imgUrl,
+			success: function() {
+
+			}
+		});
+		jweixin.updateTimelineShareData({
+			title: shareParams.title,
+			desc: shareParams.desc,
+			link: self.websiteUrl + self.h5_addr + shareParams.link + '?' + url_params,
+			imgUrl: shareParams.imgUrl,
+			success: function() {
+
+			}
+		});
+	});
+};
+
+Vue.prototype.configWxScan = function(signPackage) {
+	if (signPackage == '') {
+		return;
+	}
+	jweixin.config(JSON.parse(signPackage));
+	return jweixin;
+};
+//#endif
+
+/**
+ * 获取当前平台
+ */
+Vue.prototype.getPlatform = function(params) {
+	let platform = 'wx';
+	// #ifdef  APP-PLUS
+	platform = 'app';
+	// #endif
+	// #ifdef  H5
+	if (this.isWeixin()) {
+		platform = 'mp';
+	} else {
+		platform = 'h5';
+	}
+	// #endif
+	return platform;
+};
+
+/**
+ * 订阅通知,目前仅小程序
+ */
+Vue.prototype.subMessage = function(temlIds, callback) {
+	let self = this;
+	// #ifdef  MP-WEIXIN
+	//小程序订阅消息
+	const version = wx.getSystemInfoSync().SDKVersion;
+	if (temlIds && temlIds.length != 0 && self.compareVersion(version, '2.8.2') >= 0) {
+		wx.requestSubscribeMessage({
+			tmplIds: temlIds,
+			success(res) {},
+			fail(res) {},
+			complete(res) {
+				callback();
+			},
+		});
+	} else {
+		callback();
+	}
+	// #endif
+	// #ifndef MP-WEIXIN
+	callback();
+	// #endif
+};
+
+Vue.prototype.isWeixin = function() {
+	var ua = navigator.userAgent.toLowerCase();
+	if (ua.match(/MicroMessenger/i) == "micromessenger") {
+		return true;
+	} else {
+		return false;
+	}
+};
+
+Vue.prototype.topBarTop = function() {
+	// #ifdef MP-WEIXIN
+	return uni.getMenuButtonBoundingClientRect().top;
+	// #endif
+	// #ifndef MP-WEIXIN
+	const SystemInfo = uni.getSystemInfoSync();
+	return SystemInfo.statusBarHeight;
+	// #endif
+};
+Vue.prototype.topBarHeight = function() {
+	// #ifdef MP-WEIXIN
+	return uni.getMenuButtonBoundingClientRect().height;
+	// #endif
+	// #ifndef MP-WEIXIN
+	return 0
+	// #endif
+};
+Vue.prototype.yulan = function(e, i) {
+	let image_path_arr = [];
+	if (!Array.isArray(e)) {
+		image_path_arr = [e];
+	} else {
+		if (e[0].file_path) {
+			e.forEach((item, index) => {
+				image_path_arr.push(item.file_path)
+			})
+		} else {
+			image_path_arr = e
+		}
+	}
+	let picnum = i * 1;
+	uni.previewImage({
+		urls: image_path_arr,
+		current: picnum,
+	});
+}
+Vue.prototype.theme = function() {
+	return this.$store.state.theme
 }

+ 926 - 817
pages/login/applet.vue

@@ -1,817 +1,926 @@
-<template>
-	<view class="login-container" :style="'height: '+phoneHeight+'px;'">
-		<!-- 取到code后登录 -->
-		<view class="p-30-75" v-if="is_login==1">
-			<view class="login_topbpx">
-				<view class="login_tit">登录</view>
-			</view>
-			<view class="group-bd">
-				<view class="form-level d-s-c">
-					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" v-model="newUser_no" placeholder="请填写会员号" />
-					</view>
-				</view>
-				<view class="form-level d-s-c" v-if="!is_code">
-					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true" v-model="newPassWord"
-							placeholder="请输入密码" /></view>
-				</view>
-			</view>
-		</view>
-		<view class="p-30-75" v-if="is_login==0">
-			<view class="login_topbpx">
-				<view class="login_tit">重置密码</view>
-				<view class="login_top"><text class="red" @click="is_login=1">立即登录</text></view>
-			</view>
-			<view class="group-bd">
-				<view class="form-level d-s-c">
-					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" v-model="resetpassword.mobile"
-							placeholder="请填写手机号/会员号" :disabled="is_send" /></view>
-				</view>
-				<view class="form-level d-s-c">
-					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true"
-							v-model="resetpassword.password" placeholder="请输入密码" /></view>
-				</view>
-				<view class="form-level d-s-c">
-					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true"
-							v-model="resetpassword.repassword" placeholder="请确认密码" /></view>
-				</view>
-				<view class="form-level d-s-c">
-					<view class="val flex-1 d-b-c input_botom">
-						<input class="flex-1" type="number" style="font-size: 18px" v-model="resetpassword.code" placeholder="请填写验证码" />
-						<button class="get-code-btn" type="default" @click="sendCode"
-							:disabled="is_send">{{ send_btn_txt }}</button>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view v-if="is_login==1" style="font-size: 14px;color:#C0C0C0;" class="gray6 p-0-75" :class="is_code?'d-e-c':'d-b-c'">
-			<view v-if="!is_code" @click="is_login=0">忘记密码?</view>
-			<!-- <view @click="isCode()">{{is_code?'使用密码登录':'使用验证码登录'}}</view> -->
-		</view>
-		<view style="padding-top: 80rpx;" class="btns p-30-75" v-if="is_login==1"><button @click="formSubmit"
-				:disabled="!isRead">登录</button></view>
-		<view style="padding-top: 80rpx;" class="btns p-30-75" v-if="is_login==0"><button
-				@click="resetpasswordSub">重置密码</button></view>
-
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				/*表单数据对象*/
-				formData: {
-					/*手机号*/
-					mobile: '',
-					/*验证码*/
-					code: '',
-				},
-				loging_password: '',
-				register: {
-					mobile: '',
-					password: '',
-					repassword: '',
-					code: '',
-					user_no: ''
-
-				},
-				resetpassword: {
-					mobile: '',
-					password: '',
-					repassword: '',
-					code: ''
-				},
-				/*是否已发验证码*/
-				is_send: false,
-				/*发送按钮文本*/
-				send_btn_txt: '获取验证码',
-				/*当前秒数*/
-				second: 60,
-				ip: '',
-				isShow: true,
-				is_login: 1,
-				is_code: true,
-				phoneHeight: 0,
-				isRead: true,
-				nickName: '',
-				avatarUrl: '',
-				gender: '',
-				province: '',
-				country: '',
-				city: '',
-				openid: '',
-				referee_id: '',
-				newOpenId: '',
-				newUser_no: '',
-				newPassWord: '',
-			};
-		},
-		onLoad(e) {
-			console.log('co', e)
-			this.newOpenId = e.openid
-			this.getData();
-			this.is_code = false
-			this.nickName = this.getQueryStringArgs().nickName
-			this.avatarUrl = this.getQueryStringArgs().avatarUrl
-			this.gender = this.getQueryStringArgs().gender
-			this.province = this.getQueryStringArgs().province
-			this.country = this.getQueryStringArgs().country
-			this.city = this.getQueryStringArgs().city
-			this.openid = this.getQueryStringArgs().openid
-			this.referee_id = this.getQueryStringArgs().referee_id
-			// 	console.log(this.getQueryStringArgs().nickName, 'nickName')
-			// console.log(this.getQueryStringArgs().avatarUrl, 'avatarUrl')
-			// console.log(this.getQueryStringArgs().gender, 'gender')
-			// console.log(this.getQueryStringArgs().province, 'province')
-			// console.log(this.getQueryStringArgs().country, 'country')
-			// console.log(this.getQueryStringArgs().openid, 'openid')
-			// console.log(this.getQueryStringArgs().referee_id, 'referee_id')
-			// console.log(this.getQueryStringArgs().city, 'city')
-			// console.log(window.location.href)
-
-		},
-		onShow() {
-			this.init()
-		},
-		methods: {
-			getQueryStringArgs() {
-				var qs = (location.search.length > 0 ? location.search.substring(1) : ""),
-					args = {},
-					items = qs.length ? qs.split("&") : [],
-					item = null,
-					name = null,
-					value = null,
-					i = 0,
-					len = items.length;
-				for (i = 0; i < len; i++) {
-					item = items[i].split("=");
-					name = decodeURIComponent(item[0]);
-					value = decodeURIComponent(item[1]);
-					if (name.length) {
-						args[name] = value;
-					}
-				}
-				return args;
-			},
-			/*初始化*/
-			init() {
-				let self = this;
-				uni.getSystemInfo({
-					success(res) {
-						self.phoneHeight = res.windowHeight;
-					}
-				});
-			},
-			getData() {
-				let self = this;
-				self._get('user.userapple/policy', {}, function(res) {
-					self.service = res.data.service;
-					self.privacy = res.data.privacy;
-				});
-			},
-			/*提交*/
-			formSubmit() {
-				let self = this;
-				if (!self.nickName) {
-
-					self.nickName = ''
-				}
-
-				if (!self.avatarUrl) {
-					self.avatarUrl = ''
-				}
-				if (!self.gender) {
-					self.gender = ''
-				}
-				if (!self.province) {
-					self.province = ''
-				}
-
-				if (!self.country) {
-					self.country = ''
-				}
-				if (!self.city) {
-					self.city = ''
-				}
-				if (!self.openid) {
-					self.openid = ''
-				}
-
-				if (!self.referee_id) {
-					self.referee_id = ''
-				}
-				let formdata = {
-					mobile: self.formData.mobile,
-					nickName: self.nickName,
-					avatarUrl: self.avatarUrl,
-					gender: self.gender,
-					province: self.province,
-					country: self.country,
-					city: self.city,
-					openid: self.openid,
-					referee_id: self.referee_id,
-				}
-				let url = ''
-				// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
-				// 	console.log(self.formData.mobile)
-				// 	uni.showToast({
-				// 		title: '手机有误,请重填!',
-				// 		duration: 2000,
-				// 		icon: 'none'
-				// 	});
-				// 	return;
-				// }
-				if (!self.newUser_no) {
-					uni.showToast({
-						title: '会员号不能为空',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.newPassWord == '') {
-					uni.showToast({
-						title: '密码不能为空!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-
-				if (!self.isRead) {
-					uni.showToast({
-						title: '请同意并勾选协议内容',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-
-				uni.showLoading({
-					title: '正在提交'
-				});
-				self._post('user.userweb/accountlogin', {
-						openid: self.newOpenId,
-						user_no: self.newUser_no,
-						password: self.newPassWord
-					},
-					result => {
-						// 记录token user_id
-						uni.setStorageSync('token', result.data.token);
-						uni.setStorageSync('user_id', result.data.user_id);
-						// 获取登录前页面
-						let url = '/' + uni.getStorageSync('currentPage');
-						let pageOptions = uni.getStorageSync('currentPageOptions');
-						if (Object.keys(pageOptions).length > 0) {
-							url += '?';
-							for (let i in pageOptions) {
-								url += i + '=' + pageOptions[i] + '&';
-							}
-							url = url.substring(0, url.length - 1);
-						}
-
-						// 执行回调函数
-						self.gotoPage(url);
-					},
-					false,
-					() => {
-						uni.hideLoading();
-					}
-				);
-			},
-			/*注册*/
-			registerSub() {
-				let self = this;
-				if (!self.nickName) {
-
-					self.nickName = ''
-				}
-
-				if (!self.avatarUrl) {
-					self.avatarUrl = ''
-				}
-				if (!self.gender) {
-					self.gender = ''
-				}
-				if (!self.province) {
-					self.province = ''
-				}
-
-				if (!self.country) {
-					self.country = ''
-				}
-				if (!self.city) {
-					self.city = ''
-				}
-				if (!self.openid) {
-					self.openid = ''
-				}
-
-				if (!self.referee_id) {
-					self.referee_id = ''
-				}
-				if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.register.mobile)) {
-					console.log(self.register.mobile)
-					uni.showToast({
-						title: '手机有误,请重填!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.register.code == '') {
-					uni.showToast({
-						title: '验证码不能为空!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.register.user_no == '') {
-					uni.showToast({
-						title: '会员号不能为空!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.register.password.length < 6) {
-					uni.showToast({
-						title: '密码至少6位数!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.register.password !== self.register.repassword) {
-					uni.showToast({
-						title: '两次密码输入不一致!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-
-				if (!self.isRead) {
-					uni.showToast({
-						title: '请同意并勾选协议内容',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-
-				self.register.invitation_id = uni.getStorageSync('invitation_id') ? uni.getStorageSync('invitation_id') :
-					0;
-				self.register.reg_source = 'h5';
-				// self.register.referee_id = uni.getStorageSync('referee_id');
-				self.register.nickName = self.nickName;
-				self.register.avatarUrl = self.avatarUrl;
-				self.register.gender = self.gender;
-				self.register.province = self.province;
-				self.register.country = self.country;
-				self.register.city = self.city;
-				self.register.openid = self.openid;
-				self.register.referee_id = self.referee_id;
-				uni.showLoading({
-					title: '正在提交'
-				});
-				self._post(
-					'user.useropen/register',
-					self.register,
-					result => {
-						uni.showToast({
-							title: '注册成功',
-							duration: 3000
-						})
-						self.formData.mobile = self.register.mobile;
-						self.register = {
-							mobile: '',
-							password: '',
-							repassword: '',
-							code: ''
-						};
-						self.second = 0;
-						self.changeMsg();
-						self.is_login = 1;
-					},
-					false,
-					() => {
-						uni.hideLoading();
-					}
-				);
-			},
-			resetpasswordSub() {
-				let self = this;
-				if (!self.nickName) {
-					self.nickName = ''
-				}
-				if (!self.avatarUrl) {
-					self.avatarUrl = ''
-				}
-				if (!self.gender) {
-					self.gender = ''
-				}
-				if (!self.province) {
-					self.province = ''
-				}
-
-				if (!self.country) {
-					self.country = ''
-				}
-				if (!self.city) {
-					self.city = ''
-				}
-				if (!self.openid) {
-					self.openid = ''
-				}
-
-				if (!self.referee_id) {
-					self.referee_id = ''
-				}
-				// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.resetpassword.mobile)) {
-				// 	uni.showToast({
-				// 		title: '手机有误,请重填!',
-				// 		duration: 2000,
-				// 		icon: 'none'
-				// 	});
-				// 	return;
-				// }
-				if (!self.resetpassword.mobile) {
-					uni.showToast({
-						title: '手机号/会员号不能为空',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.resetpassword.code == '') {
-					uni.showToast({
-						title: '验证码不能为空!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.resetpassword.password.length < 6) {
-					uni.showToast({
-						title: '密码至少6位数!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				if (self.resetpassword.password !== self.resetpassword.repassword) {
-					uni.showToast({
-						title: '两次密码输入不一致!',
-						duration: 2000,
-						icon: 'none'
-					});
-					return;
-				}
-				self.resetpassword.nickName = self.nickName;
-				self.resetpassword.avatarUrl = self.avatarUrl;
-				self.resetpassword.gender = self.gender;
-				self.resetpassword.province = self.province;
-				self.resetpassword.country = self.country;
-				self.resetpassword.city = self.city;
-				self.resetpassword.openid = self.openid;
-				self.resetpassword.referee_id = self.referee_id;
-				uni.showLoading({
-					title: '正在提交'
-				});
-				self._post(
-					'user.useropen/resetpassword',
-					self.resetpassword,
-					result => {
-						uni.showToast({
-							title: '重置成功',
-							duration: 3000
-						})
-						self.formData.mobile = self.resetpassword.mobile;
-						self.resetpassword = {
-							mobile: '',
-							password: '',
-							repassword: '',
-							code: ''
-						};
-						self.second = 0;
-						self.changeMsg();
-						self.is_login = 1;
-					},
-					false,
-					() => {
-						uni.hideLoading();
-					}
-				);
-			},
-			isCode() {
-				if (this.is_code) {
-					this.$set(this, 'is_code', false)
-				} else {
-					this.$set(this, 'is_code', true)
-				}
-
-				console.log(this.is_code)
-			},
-			/*发送短信*/
-			sendCode() {
-				let self = this;
-				if (self.is_login == 1) {
-					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
-					// 	uni.showToast({
-					// 		title: '手机有误,请重填!',
-					// 		duration: 2000,
-					// 		icon: 'none'
-					// 	});
-					// 	return;
-					// }
-					if (!self.formData.mobile) {
-						uni.showToast({
-							title: '手机号/会员号不能为空',
-							duration: 2000,
-							icon: 'none'
-						});
-						return;
-					}
-				} else if (self.is_login == 2) {
-					if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.register.mobile)) {
-						uni.showToast({
-							title: '手机有误,请重填!',
-							duration: 2000,
-							icon: 'none'
-						});
-						return;
-					}
-				} else if (self.is_login == 0) {
-					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.resetpassword.mobile)) {
-					// 	uni.showToast({
-					// 		title: '手机有误,请重填!',
-					// 		duration: 2000,
-					// 		icon: 'none'
-					// 	});
-					// 	return;
-					// }
-					if (!self.resetpassword.mobile) {
-						uni.showToast({
-							title: '手机号/会员号不能为空',
-							duration: 2000,
-							icon: 'none'
-						});
-						return;
-					}
-				}
-
-				let type = 'register'
-				let mobile = self.register.mobile
-				if (self.is_login == 1) {
-					type = 'login';
-					mobile = self.formData.mobile;
-				} else if (self.is_login == 0) {
-					type = 'login';
-					mobile = self.resetpassword.mobile;
-				}
-				self._post(
-					'user.useropen/sendCode', {
-						mobile: mobile,
-						type: type
-					},
-					result => {
-						if (result.code == 1) {
-							uni.showToast({
-								title: '发送成功'
-							});
-							self.is_send = true;
-							self.changeMsg();
-						}
-					}
-				);
-			},
-			/*改变发送验证码按钮文本*/
-			changeMsg() {
-				if (this.second > 0) {
-					this.send_btn_txt = this.second + '秒';
-					this.second--;
-					setTimeout(this.changeMsg, 1000);
-				} else {
-					this.send_btn_txt = '获取验证码';
-					this.second = 60;
-					this.is_send = false;
-				}
-			},
-			xieyi(type) {
-				let url = '';
-				if (type == 'service') {
-					url = this.service;
-				} else {
-					url = this.privacy;
-				}
-				uni.navigateTo({
-					url: '/pages/webview/webview?url=' + url
-				});
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	page {
-		background-color: #FFFFFF;
-	}
-
-	.p-30-75 {
-		padding: 30rpx 75rpx;
-	}
-
-	.p-0-75 {
-		padding: 0 75rpx;
-	}
-
-	.t-r {
-		text-align: right;
-	}
-
-	.login-container {
-		position: relative;
-		background: #ffffff;
-	}
-
-	.login-container input {
-		height: 88rpx;
-		line-height: 88rpx;
-	}
-
-	.wechatapp {
-		padding: 80rpx 0 48rpx;
-		border-bottom: 1rpx solid #e3e3e3;
-		margin-bottom: 72rpx;
-		text-align: center;
-	}
-
-	.wechatapp .header {
-		width: 190rpx;
-		height: 190rpx;
-		border: 2px solid #fff;
-		margin: 0rpx auto 0;
-		border-radius: 50%;
-		overflow: hidden;
-		box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
-	}
-
-	.auth-title {
-		color: #585858;
-		font-size: 34rpx;
-		margin-bottom: 40rpx;
-	}
-
-	.auth-subtitle {
-		color: #888;
-		margin-bottom: 88rpx;
-		font-size: 28rpx;
-	}
-
-	.login-btn {
-		padding: 0 20rpx;
-	}
-
-	.login-btn button {
-		height: 88rpx;
-		line-height: 88rpx;
-		background: #04be01;
-		color: #fff;
-		font-size: 30rpx;
-		border-radius: 999rpx;
-		text-align: center;
-	}
-
-	.no-login-btn {
-		margin-top: 20rpx;
-		padding: 0 20rpx;
-	}
-
-	.no-login-btn button {
-		height: 88rpx;
-		line-height: 88rpx;
-		background: #dfdfdf;
-		color: #fff;
-		font-size: 30rpx;
-		border-radius: 999rpx;
-		text-align: center;
-	}
-
-	.get-code-btn {
-		width: 200rpx;
-		height: 80rpx;
-		line-height: 76rpx;
-		padding: 0rpx 30rpx;
-		border-radius: 40rpx;
-		white-space: nowrap;
-		// border: 1rpx solid $dominant-color;
-		background-color: #FFFFFF;
-		color: $dominant-color;
-		font-size: 30rpx;
-	}
-
-	.get-code-btn[disabled='true'] {
-		// border: 1rpx solid #cccccc;
-		background-color: #FFFFFF;
-	}
-
-	.btns button {
-		height: 90rpx;
-		line-height: 90rpx;
-		font-size: 34rpx;
-		border-radius: 45rpx;
-		background-color: $dominant-color;
-		color: #ffffff;
-	}
-
-	.login_topbpx {
-		padding: 181rpx 0;
-		padding-bottom: 110rpx;
-	}
-
-	.login_tit {
-		font-size: 52rpx;
-		font-weight: 600;
-		margin-bottom: 33rpx;
-	}
-
-	.login_top {
-		font-size: 24rpx;
-		color: #adafb3;
-	}
-
-	.input_botom {
-		border-bottom: 1px solid #f4f4f4;
-	}
-
-	.bottom_nav {
-		width: 100%;
-		position: absolute;
-		bottom: 100rpx;
-	}
-
-	.bottom-box {
-		width: 70%;
-		margin: 0 auto;
-	}
-
-	.other_tit {
-		height: 1rpx;
-		background-color: #CACACA;
-		width: 100%;
-		line-height: 1rpx;
-		text-align: center;
-	}
-
-	.weixin_box {
-		background-color: #04BE01;
-		border-radius: 50%;
-		width: 80rpx;
-		height: 80rpx;
-		line-height: 80rpx;
-		text-align: center;
-	}
-
-	.weixin_box .icon-weixin {
-		font-size: 40rpx;
-		color: #FFFFFF;
-	}
-
-	// .btns .bg-green{
-	// 	background-color: #04BE01;
-	// }
-	.agreement {
-		border-radius: 50%;
-		width: 28rpx;
-		height: 28rpx;
-		border: 2rpx solid #EE1413;
-		background: #fff;
-		position: relative;
-		margin-right: 10rpx;
-		box-sizing: border-box;
-	}
-
-	.agreement.active::after {
-		content: '';
-		width: 16rpx;
-		height: 16rpx;
-		background-color: #EE1413;
-		border-radius: 50%;
-		position: absolute;
-		left: 0;
-		top: 0;
-		right: 0;
-		bottom: 0;
-		margin: auto;
-	}
-
-	.skip {
-		position: absolute;
-		top: 80rpx;
-		right: 30rpx;
-		font-size: 28rpx;
-		color: #999999;
-	}
-</style>
+<template>
+	<view class="login-container" :style="'height: '+phoneHeight+'px;'">
+		<!-- 取到code后登录 -->
+		<view class="p-30-75" v-if="is_login==1">
+			<view class="login_topbpx">
+				<view class="login_tit">登录</view>
+			</view>
+			<view class="group-bd">
+				<view class="form-level d-s-c">
+					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" v-model="newUser_no"
+							placeholder="请填写会员号" />
+					</view>
+				</view>
+				<view class="form-level d-s-c" v-if="!is_code">
+					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true"
+							v-model="newPassWord" placeholder="请输入密码" /></view>
+				</view>
+				<view class="form-level d-s-c" v-else>
+					<view class="val flex-1 d-b-c input_botom">
+						<input class="flex-1" type="number" style="font-size: 18px" v-model="loginCode"
+							placeholder="请填写验证码" />
+						<button class="get-code-btn" type="default" @click="sendLoginCode"
+							:disabled="is_send">{{ send_btn_txt }}</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="p-30-75" v-if="is_login==0">
+			<view class="login_topbpx">
+				<view class="login_tit">重置密码</view>
+				<view class="login_top"><text class="red" @click="is_login=1">立即登录</text></view>
+			</view>
+			<view class="group-bd">
+				<view class="form-level d-s-c">
+					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px"
+							v-model="resetpassword.mobile" placeholder="请填写手机号/会员号" :disabled="is_send" /></view>
+				</view>
+				<view class="form-level d-s-c">
+					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true"
+							v-model="resetpassword.password" placeholder="请输入密码" /></view>
+				</view>
+				<view class="form-level d-s-c">
+					<view class="val flex-1 input_botom"><input type="text" style="font-size: 18px" password="true"
+							v-model="resetpassword.repassword" placeholder="请确认密码" /></view>
+				</view>
+				<view class="form-level d-s-c">
+					<view class="val flex-1 d-b-c input_botom">
+						<input class="flex-1" type="number" style="font-size: 18px" v-model="resetpassword.code"
+							placeholder="请填写验证码" />
+						<button class="get-code-btn" type="default" @click="sendCode"
+							:disabled="is_send">{{ send_btn_txt }}</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view v-if="is_login==1" style="font-size: 14px;color:#C0C0C0;" class="gray6 p-0-75"
+			:class="is_code?'d-e-c':'d-b-c'">
+			<view v-if="!is_code" @click="is_login=0">忘记密码?</view>
+			<view @click="isCode()">{{is_code?'使用密码登录':'使用验证码登录'}}</view>
+		</view>
+		<view style="padding-top: 80rpx;" class="btns p-30-75" v-if="is_login==1"><button @click="formSubmit"
+				:disabled="!isRead">登录</button></view>
+		<view style="padding-top: 80rpx;" class="btns p-30-75" v-if="is_login==0"><button
+				@click="resetpasswordSub">重置密码</button></view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				/*表单数据对象*/
+				formData: {
+					/*手机号*/
+					mobile: '',
+					/*验证码*/
+					code: '',
+				},
+				loging_password: '',
+				register: {
+					mobile: '',
+					password: '',
+					repassword: '',
+					code: '',
+					user_no: ''
+
+				},
+				resetpassword: {
+					mobile: '',
+					password: '',
+					repassword: '',
+					code: ''
+				},
+				/*是否已发验证码*/
+				is_send: false,
+				/*发送按钮文本*/
+				send_btn_txt: '获取验证码',
+				/*当前秒数*/
+				second: 60,
+				ip: '',
+				isShow: true,
+				is_login: 1,
+				is_code: true,
+				phoneHeight: 0,
+				isRead: true,
+				nickName: '',
+				avatarUrl: '',
+				gender: '',
+				province: '',
+				country: '',
+				city: '',
+				openid: '',
+				referee_id: '',
+				newOpenId: '',
+				newUser_no: '',
+				newPassWord: '',
+				loginCode: ''
+			};
+		},
+		onLoad(e) {
+			console.log('co', e)
+			this.newOpenId = e.openid
+			this.getData();
+			this.is_code = false
+			this.nickName = this.getQueryStringArgs().nickName
+			this.avatarUrl = this.getQueryStringArgs().avatarUrl
+			this.gender = this.getQueryStringArgs().gender
+			this.province = this.getQueryStringArgs().province
+			this.country = this.getQueryStringArgs().country
+			this.city = this.getQueryStringArgs().city
+			this.openid = this.getQueryStringArgs().openid
+			this.referee_id = this.getQueryStringArgs().referee_id
+			// 	console.log(this.getQueryStringArgs().nickName, 'nickName')
+			// console.log(this.getQueryStringArgs().avatarUrl, 'avatarUrl')
+			// console.log(this.getQueryStringArgs().gender, 'gender')
+			// console.log(this.getQueryStringArgs().province, 'province')
+			// console.log(this.getQueryStringArgs().country, 'country')
+			// console.log(this.getQueryStringArgs().openid, 'openid')
+			// console.log(this.getQueryStringArgs().referee_id, 'referee_id')
+			// console.log(this.getQueryStringArgs().city, 'city')
+			// console.log(window.location.href)
+
+		},
+		onShow() {
+			this.init()
+		},
+		methods: {
+			getQueryStringArgs() {
+				var qs = (location.search.length > 0 ? location.search.substring(1) : ""),
+					args = {},
+					items = qs.length ? qs.split("&") : [],
+					item = null,
+					name = null,
+					value = null,
+					i = 0,
+					len = items.length;
+				for (i = 0; i < len; i++) {
+					item = items[i].split("=");
+					name = decodeURIComponent(item[0]);
+					value = decodeURIComponent(item[1]);
+					if (name.length) {
+						args[name] = value;
+					}
+				}
+				return args;
+			},
+			/*初始化*/
+			init() {
+				let self = this;
+				uni.getSystemInfo({
+					success(res) {
+						self.phoneHeight = res.windowHeight;
+					}
+				});
+			},
+			getData() {
+				let self = this;
+				self._get('user.userapple/policy', {}, function(res) {
+					self.service = res.data.service;
+					self.privacy = res.data.privacy;
+				});
+			},
+			/*提交*/
+			formSubmit() {
+				let self = this;
+				if (!self.nickName) {
+
+					self.nickName = ''
+				}
+
+				if (!self.avatarUrl) {
+					self.avatarUrl = ''
+				}
+				if (!self.gender) {
+					self.gender = ''
+				}
+				if (!self.province) {
+					self.province = ''
+				}
+
+				if (!self.country) {
+					self.country = ''
+				}
+				if (!self.city) {
+					self.city = ''
+				}
+				if (!self.openid) {
+					self.openid = ''
+				}
+
+				if (!self.referee_id) {
+					self.referee_id = ''
+				}
+				let formdata = {
+					mobile: self.formData.mobile,
+					nickName: self.nickName,
+					avatarUrl: self.avatarUrl,
+					gender: self.gender,
+					province: self.province,
+					country: self.country,
+					city: self.city,
+					openid: self.openid,
+					referee_id: self.referee_id,
+				}
+				let url = ''
+				// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
+				// 	console.log(self.formData.mobile)
+				// 	uni.showToast({
+				// 		title: '手机有误,请重填!',
+				// 		duration: 2000,
+				// 		icon: 'none'
+				// 	});
+				// 	return;
+				// }
+				if (!self.newUser_no) {
+					uni.showToast({
+						title: '会员号不能为空',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.is_code == false && self.newPassWord == '') {
+					uni.showToast({
+						title: '密码不能为空!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.is_code == true && self.loginCode == '') {
+					uni.showToast({
+						title: '验证码不能为空!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+
+				if (!self.isRead) {
+					uni.showToast({
+						title: '请同意并勾选协议内容',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+
+				uni.showLoading({
+					title: '正在提交'
+				});
+
+				let loginUrl = ''
+				let loginData = {}
+				if (self.is_code == true) {
+					loginUrl = 'user.useropen/smsloginWx'
+					loginData = {
+						openid: self.newOpenId,
+						mobile: self.newUser_no,
+						code: self.loginCode
+					}
+				} else {
+					loginUrl = 'user.userweb/accountlogin'
+					loginData = {
+						openid: self.newOpenId,
+						user_no: self.newUser_no,
+						password: self.newPassWord
+					}
+				}
+
+				self._post(loginUrl, loginData,
+					result => {
+						// 记录token user_id
+						uni.setStorageSync('token', result.data.token);
+						uni.setStorageSync('user_id', result.data.user_id);
+						// 获取登录前页面
+						let url = '/' + uni.getStorageSync('currentPage');
+						let pageOptions = uni.getStorageSync('currentPageOptions');
+						if (Object.keys(pageOptions).length > 0) {
+							url += '?';
+							for (let i in pageOptions) {
+								url += i + '=' + pageOptions[i] + '&';
+							}
+							url = url.substring(0, url.length - 1);
+						}
+
+						// 执行回调函数
+						self.gotoPage(url);
+					},
+					false,
+					() => {
+						uni.hideLoading();
+					}
+				);
+			},
+			/*注册*/
+			registerSub() {
+				let self = this;
+				if (!self.nickName) {
+
+					self.nickName = ''
+				}
+
+				if (!self.avatarUrl) {
+					self.avatarUrl = ''
+				}
+				if (!self.gender) {
+					self.gender = ''
+				}
+				if (!self.province) {
+					self.province = ''
+				}
+
+				if (!self.country) {
+					self.country = ''
+				}
+				if (!self.city) {
+					self.city = ''
+				}
+				if (!self.openid) {
+					self.openid = ''
+				}
+
+				if (!self.referee_id) {
+					self.referee_id = ''
+				}
+				if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.register.mobile)) {
+					console.log(self.register.mobile)
+					uni.showToast({
+						title: '手机有误,请重填!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.register.code == '') {
+					uni.showToast({
+						title: '验证码不能为空!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.register.user_no == '') {
+					uni.showToast({
+						title: '会员号不能为空!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.register.password.length < 6) {
+					uni.showToast({
+						title: '密码至少6位数!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.register.password !== self.register.repassword) {
+					uni.showToast({
+						title: '两次密码输入不一致!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+
+				if (!self.isRead) {
+					uni.showToast({
+						title: '请同意并勾选协议内容',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+
+				self.register.invitation_id = uni.getStorageSync('invitation_id') ? uni.getStorageSync('invitation_id') :
+					0;
+				self.register.reg_source = 'h5';
+				// self.register.referee_id = uni.getStorageSync('referee_id');
+				self.register.nickName = self.nickName;
+				self.register.avatarUrl = self.avatarUrl;
+				self.register.gender = self.gender;
+				self.register.province = self.province;
+				self.register.country = self.country;
+				self.register.city = self.city;
+				self.register.openid = self.openid;
+				self.register.referee_id = self.referee_id;
+				uni.showLoading({
+					title: '正在提交'
+				});
+				self._post(
+					'user.useropen/register',
+					self.register,
+					result => {
+						uni.showToast({
+							title: '注册成功',
+							duration: 3000
+						})
+						self.formData.mobile = self.register.mobile;
+						self.register = {
+							mobile: '',
+							password: '',
+							repassword: '',
+							code: ''
+						};
+						self.second = 0;
+						self.changeMsg();
+						self.is_login = 1;
+					},
+					false,
+					() => {
+						uni.hideLoading();
+					}
+				);
+			},
+			resetpasswordSub() {
+				let self = this;
+				if (!self.nickName) {
+					self.nickName = ''
+				}
+				if (!self.avatarUrl) {
+					self.avatarUrl = ''
+				}
+				if (!self.gender) {
+					self.gender = ''
+				}
+				if (!self.province) {
+					self.province = ''
+				}
+
+				if (!self.country) {
+					self.country = ''
+				}
+				if (!self.city) {
+					self.city = ''
+				}
+				if (!self.openid) {
+					self.openid = ''
+				}
+
+				if (!self.referee_id) {
+					self.referee_id = ''
+				}
+				// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.resetpassword.mobile)) {
+				// 	uni.showToast({
+				// 		title: '手机有误,请重填!',
+				// 		duration: 2000,
+				// 		icon: 'none'
+				// 	});
+				// 	return;
+				// }
+				if (!self.resetpassword.mobile) {
+					uni.showToast({
+						title: '手机号/会员号不能为空',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.resetpassword.code == '') {
+					uni.showToast({
+						title: '验证码不能为空!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.resetpassword.password.length < 6) {
+					uni.showToast({
+						title: '密码至少6位数!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				if (self.resetpassword.password !== self.resetpassword.repassword) {
+					uni.showToast({
+						title: '两次密码输入不一致!',
+						duration: 2000,
+						icon: 'none'
+					});
+					return;
+				}
+				self.resetpassword.nickName = self.nickName;
+				self.resetpassword.avatarUrl = self.avatarUrl;
+				self.resetpassword.gender = self.gender;
+				self.resetpassword.province = self.province;
+				self.resetpassword.country = self.country;
+				self.resetpassword.city = self.city;
+				self.resetpassword.openid = self.openid;
+				self.resetpassword.referee_id = self.referee_id;
+				uni.showLoading({
+					title: '正在提交'
+				});
+				self._post(
+					'user.useropen/resetpassword',
+					self.resetpassword,
+					result => {
+						uni.showToast({
+							title: '重置成功',
+							duration: 3000
+						})
+						self.formData.mobile = self.resetpassword.mobile;
+						self.resetpassword = {
+							mobile: '',
+							password: '',
+							repassword: '',
+							code: ''
+						};
+						self.second = 0;
+						self.changeMsg();
+						self.is_login = 1;
+					},
+					false,
+					() => {
+						uni.hideLoading();
+					}
+				);
+			},
+			isCode() {
+				if (this.is_code) {
+					this.$set(this, 'is_code', false)
+				} else {
+					this.$set(this, 'is_code', true)
+				}
+
+				console.log(this.is_code)
+			},
+			/*发送短信*/
+			sendCode() {
+				let self = this;
+				if (self.is_login == 1) {
+					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
+					// 	uni.showToast({
+					// 		title: '手机有误,请重填!',
+					// 		duration: 2000,
+					// 		icon: 'none'
+					// 	});
+					// 	return;
+					// }
+					if (!self.formData.mobile) {
+						uni.showToast({
+							title: '手机号/会员号不能为空',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				} else if (self.is_login == 2) {
+					if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.register.mobile)) {
+						uni.showToast({
+							title: '手机有误,请重填!',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				} else if (self.is_login == 0) {
+					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.resetpassword.mobile)) {
+					// 	uni.showToast({
+					// 		title: '手机有误,请重填!',
+					// 		duration: 2000,
+					// 		icon: 'none'
+					// 	});
+					// 	return;
+					// }
+					if (!self.resetpassword.mobile) {
+						uni.showToast({
+							title: '手机号/会员号不能为空',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				}
+
+				let type = 'register'
+				let mobile = self.register.mobile
+				if (self.is_login == 1) {
+					type = 'login';
+					mobile = self.formData.mobile;
+				} else if (self.is_login == 0) {
+					type = 'login';
+					mobile = self.resetpassword.mobile;
+				}
+				self._post(
+					'user.useropen/sendCode', {
+						mobile: mobile,
+						type: type
+					},
+					result => {
+						if (result.code == 1) {
+							uni.showToast({
+								title: '发送成功'
+							});
+							self.is_send = true;
+							self.changeMsg();
+						}
+					}
+				);
+			},
+			/*改变发送验证码按钮文本*/
+			changeMsg() {
+				if (this.second > 0) {
+					this.send_btn_txt = this.second + '秒';
+					this.second--;
+					setTimeout(this.changeMsg, 1000);
+				} else {
+					this.send_btn_txt = '获取验证码';
+					this.second = 60;
+					this.is_send = false;
+				}
+			},
+			xieyi(type) {
+				let url = '';
+				if (type == 'service') {
+					url = this.service;
+				} else {
+					url = this.privacy;
+				}
+				uni.navigateTo({
+					url: '/pages/webview/webview?url=' + url
+				});
+			},
+			//
+			sendLoginCode() {
+				let self = this;
+				if (self.is_login == 1) {
+					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
+					// 	uni.showToast({
+					// 		title: '手机有误,请重填!',
+					// 		duration: 2000,
+					// 		icon: 'none'
+					// 	});
+					// 	return;
+					// }
+					if (!self.newUser_no) {
+						uni.showToast({
+							title: '手机号/会员号不能为空',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				} else if (self.is_login == 2) {
+					if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.register.mobile)) {
+						uni.showToast({
+							title: '手机有误,请重填!',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				} else if (self.is_login == 0) {
+					// if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.resetpassword.mobile)) {
+					// 	uni.showToast({
+					// 		title: '手机有误,请重填!',
+					// 		duration: 2000,
+					// 		icon: 'none'
+					// 	});
+					// 	return;
+					// }
+					if (!self.resetpassword.mobile) {
+						uni.showToast({
+							title: '手机号/会员号不能为空',
+							duration: 2000,
+							icon: 'none'
+						});
+						return;
+					}
+				}
+
+				let type = 'register'
+				let mobile = self.register.mobile
+				if (self.is_login == 1) {
+					type = 'login';
+					mobile = self.newUser_no;
+				} else if (self.is_login == 0) {
+					type = 'login';
+					mobile = self.resetpassword.mobile;
+				}
+				self._post(
+					'user.useropen/sendCodeWx', {
+						mobile: mobile,
+						type: type
+					},
+					result => {
+						if (result.code == 1) {
+							uni.showToast({
+								title: '发送成功'
+							});
+							self.is_send = true;
+							self.changeMsg();
+						}
+					}
+				);
+			},
+
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	page {
+		background-color: #FFFFFF;
+	}
+
+	.p-30-75 {
+		padding: 30rpx 75rpx;
+	}
+
+	.p-0-75 {
+		padding: 0 75rpx;
+	}
+
+	.t-r {
+		text-align: right;
+	}
+
+	.login-container {
+		position: relative;
+		background: #ffffff;
+	}
+
+	.login-container input {
+		height: 88rpx;
+		line-height: 88rpx;
+	}
+
+	.wechatapp {
+		padding: 80rpx 0 48rpx;
+		border-bottom: 1rpx solid #e3e3e3;
+		margin-bottom: 72rpx;
+		text-align: center;
+	}
+
+	.wechatapp .header {
+		width: 190rpx;
+		height: 190rpx;
+		border: 2px solid #fff;
+		margin: 0rpx auto 0;
+		border-radius: 50%;
+		overflow: hidden;
+		box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
+	}
+
+	.auth-title {
+		color: #585858;
+		font-size: 34rpx;
+		margin-bottom: 40rpx;
+	}
+
+	.auth-subtitle {
+		color: #888;
+		margin-bottom: 88rpx;
+		font-size: 28rpx;
+	}
+
+	.login-btn {
+		padding: 0 20rpx;
+	}
+
+	.login-btn button {
+		height: 88rpx;
+		line-height: 88rpx;
+		background: #04be01;
+		color: #fff;
+		font-size: 30rpx;
+		border-radius: 999rpx;
+		text-align: center;
+	}
+
+	.no-login-btn {
+		margin-top: 20rpx;
+		padding: 0 20rpx;
+	}
+
+	.no-login-btn button {
+		height: 88rpx;
+		line-height: 88rpx;
+		background: #dfdfdf;
+		color: #fff;
+		font-size: 30rpx;
+		border-radius: 999rpx;
+		text-align: center;
+	}
+
+	.get-code-btn {
+		width: 200rpx;
+		height: 80rpx;
+		line-height: 76rpx;
+		padding: 0rpx 30rpx;
+		border-radius: 40rpx;
+		white-space: nowrap;
+		// border: 1rpx solid $dominant-color;
+		background-color: #FFFFFF;
+		color: $dominant-color;
+		font-size: 30rpx;
+	}
+
+	.get-code-btn[disabled='true'] {
+		// border: 1rpx solid #cccccc;
+		background-color: #FFFFFF;
+	}
+
+	.btns button {
+		height: 90rpx;
+		line-height: 90rpx;
+		font-size: 34rpx;
+		border-radius: 45rpx;
+		background-color: $dominant-color;
+		color: #ffffff;
+	}
+
+	.login_topbpx {
+		padding: 181rpx 0;
+		padding-bottom: 110rpx;
+	}
+
+	.login_tit {
+		font-size: 52rpx;
+		font-weight: 600;
+		margin-bottom: 33rpx;
+	}
+
+	.login_top {
+		font-size: 24rpx;
+		color: #adafb3;
+	}
+
+	.input_botom {
+		border-bottom: 1px solid #f4f4f4;
+	}
+
+	.bottom_nav {
+		width: 100%;
+		position: absolute;
+		bottom: 100rpx;
+	}
+
+	.bottom-box {
+		width: 70%;
+		margin: 0 auto;
+	}
+
+	.other_tit {
+		height: 1rpx;
+		background-color: #CACACA;
+		width: 100%;
+		line-height: 1rpx;
+		text-align: center;
+	}
+
+	.weixin_box {
+		background-color: #04BE01;
+		border-radius: 50%;
+		width: 80rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		text-align: center;
+	}
+
+	.weixin_box .icon-weixin {
+		font-size: 40rpx;
+		color: #FFFFFF;
+	}
+
+	// .btns .bg-green{
+	// 	background-color: #04BE01;
+	// }
+	.agreement {
+		border-radius: 50%;
+		width: 28rpx;
+		height: 28rpx;
+		border: 2rpx solid #EE1413;
+		background: #fff;
+		position: relative;
+		margin-right: 10rpx;
+		box-sizing: border-box;
+	}
+
+	.agreement.active::after {
+		content: '';
+		width: 16rpx;
+		height: 16rpx;
+		background-color: #EE1413;
+		border-radius: 50%;
+		position: absolute;
+		left: 0;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		margin: auto;
+	}
+
+	.skip {
+		position: absolute;
+		top: 80rpx;
+		right: 30rpx;
+		font-size: 28rpx;
+		color: #999999;
+	}
+</style>

+ 652 - 650
pages/user/index/index.vue

@@ -1,650 +1,652 @@
-<template>
-	<view class="user-index" v-if="!loadding">
-		<!-- #ifdef APP-PLUS -->
-		<header-bar :bcolor="'#e2231a'"></header-bar>
-		<!-- #endif -->
-		<!--个人信息-->
-		<view class="user-header">
-			<view class="user-header-inner">
-				<view class="user-info">
-					<view class="photo">
-						<image :src="detail.avatarUrl" mode="aspectFill"></image>
-					</view>
-					<view class="info">
-						<view class="d-c-c mb23">
-							<view class="name">{{ detail.nickName }}</view>
-							<text class="ml20 grade" v-if="detail.grade_id > 0">
-								{{ detail.grade.name }}
-							</text>
-						</view>
-						<view class="tel d-s-c">
-							<text class="f26">会员号:{{ detail.user_no }}</text>
-						</view>
-					</view>
-				</view>
-			</view>
-
-			<!--我的订单-->
-
-			<view class="my-order">
-				<view class="list d-a-c flex-1">
-					<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-wallet/my-wallet')">
-						<view class=" red_mini">{{ detail.balance }}</view>
-						<text class="pt16 f24 gray3">账号余额</text>
-					</view>
-          <view v-if="setting.is_show_personal_points != 0" class="item order_center d-c-c d-c" @click="jumpPage('/pages/user/points/points')">
-						<view class=" red_mini">{{ detail.points }}</view>
-						<text class="pt16 f24 gray3">{{setting.points_name}}</text>
-					</view>
-					<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-coupon/my-coupon')">
-						<view class="red_mini">{{ coupon }}</view>
-						<text class="pt16 f24 gray3">优惠券</text>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="bind_phone" v-if="!detail.mobile">
-			<view class="bind_content">
-				<view class="bind_txt">确保账户安全,请绑定手机号</view>
-				<!-- #ifdef MP-WEIXIN -->
-				<button open-type="getPhoneNumber" class="bind_btn" @getphonenumber="getPhoneNumber">去绑定</button>
-				<!-- #endif -->
-				<!-- #ifndef MP-WEIXIN -->
-				<button class="bind_btn" @click="bindMobile">去绑定</button>
-				<!-- #endif -->
-			</view>
-		</view>
-		<!--我的资产-->
-		<view class="my-assets">
-			<view class="my-assets-all">
-				<view class="f30 fb">我的订单</view>
-				<view class="gray9 f26" @click="jumpPage('/pages/order/myorder?dataType=all')">全部订单<text
-						class="icon iconfont icon-jiantou"></text></view>
-			</view>
-			<view class="d-b-c w100">
-				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=payment')">
-					<view class="icon-box pr">
-						<image src="../../../static/icon/icon-icon.png" mode=""></image>
-						<text class="dot d-c-c"
-							v-if="orderCount.payment != null && orderCount.payment > 0">{{ orderCount.payment }}</text>
-					</view>
-					<text>待付款</text>
-				</view>
-				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=delivery')">
-					<view class="icon-box pr">
-						<image src="../../../static/icon/icon-daifahuo.png" mode=""></image>
-						<text class="dot d-c-c"
-							v-if="orderCount.delivery != null && orderCount.delivery > 0">{{ orderCount.delivery }}</text>
-					</view>
-					<text class="">待发货</text>
-				</view>
-				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=received')">
-					<view class="icon-box pr">
-						<image src="../../../static/icon/icon-daishouhuo.png" mode=""></image>
-						<text class="dot d-c-c"
-							v-if="orderCount.received != null && orderCount.received > 0">{{ orderCount.received }}</text>
-					</view>
-					<text>待收货</text>
-				</view>
-				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=comment')">
-					<view class="icon-box pr">
-						<image src="../../../static/icon/icon-quanbudingdan.png" mode=""></image>
-						<text class="dot d-c-c"
-							v-if="orderCount.comment != null && orderCount.comment > 0">{{ orderCount.comment }}</text>
-					</view>
-					<text>待评价</text>
-				</view>
-				<view class="item" @click="jumpPage('/pages/order/refund/index/index')">
-					<view class="icon-box pr">
-						<image src="../../../static/icon/icon-tuikuan.png" mode=""></image>
-						<text class="dot d-c-c"
-							v-if="orderCount.refund != null && orderCount.refund > 0">{{ orderCount.refund }}</text>
-					</view>
-					<text>退款/售后</text>
-				</view>
-			</view>
-		</view>
-
-		<!--菜单-->
-		<view class="menu-wrap">
-			<view class="group-bd f-w">
-				<view :class="'item ' + item.icon + '-box'" v-for="(item, index) in menus" :key="index"
-					@click="jumpPage(item.path)">
-					<view class="icon-round d-c-c">
-						<image class="icon-round" :src="item.icon" mode="aspectFill"></image>
-					</view>
-					<text class="name">{{ item.name }}</text>
-				</view>
-			</view>
-		</view>
-		<view v-if="invitation.is_open && invitation.invitation_id > 0">
-			<view class="activity_img" @click="toinvitation(invitation.invitation_id)">
-				<image :src="invitation.image" mode=""></image>
-			</view>
-		</view>
-		<!--推荐-->
-		<view>
-			<recommendProduct :location="20"></recommendProduct>
-		</view>
-	</view>
-</template>
-
-<script>
-	import recommendProduct from '@/components/recommendProduct/recommendProduct.vue';
-	export default {
-		components: {
-			recommendProduct
-		},
-		data() {
-			return {
-				/*签到数据*/
-				sign: {},
-				/*是否加载完成*/
-				loadding: true,
-				indicatorDots: true,
-				autoplay: true,
-				interval: 2000,
-				duration: 500,
-				/*菜单*/
-				menus: [],
-				invitation: {},
-				detail: {
-					balance: 0,
-					points: 0,
-					grade: {
-						name: ''
-					},
-				},
-				orderCount: {},
-				coupon: 0,
-				setting: {},
-				user_type: '', //用户状态
-				sessionKey: ''
-			};
-		},
-		onShow() {
-			/*获取个人中心数据*/
-			this.getData();
-		},
-		onLoad(e) {
-			let self = this;
-			if (e.invitation_id) {
-				uni.setStorageSync('invitation_id', e.invitation_id);
-			}
-			if (e.referee_id) {
-				uni.setStorageSync('referee_id', e.referee_id);
-			}
-			//#ifdef MP-WEIXIN
-			wx.login({
-				success(res) {
-					// 发送用户信息
-					self._post('user.user/getSession', {
-						code: res.code
-					}, result => {
-						self.sessionKey = result.data.session_key;
-					});
-				}
-			});
-			//#endif
-		},
-		methods: {
-			/*获取数据*/
-			getData() {
-				let self = this;
-				uni.showLoading({
-					title: '加载中'
-				});
-				self._post('user.index/detail', {
-					source: self.getPlatform()
-				}, function(res) {
-					//#ifdef MP-WEIXIN
-					if (res.data.getPhone) {
-						//#ifdef MP-WEIXIN
-						self.gotoPage('/pages/login/bindmobile');
-						//#endif
-						//#ifndef MP-WEIXIN
-						self.bindMobile();
-						//#endif
-						return;
-					}
-					//#endif
-					self.detail = res.data.userInfo;
-					self.sign = res.data.sign;
-					self.coupon = res.data.coupon;
-					self.orderCount = res.data.orderCount;
-					self.menus = res.data.menus;
-					self.invitation = res.data.invitation;
-					self.setting = res.data.setting;
-					self.loadding = false;
-					uni.hideLoading();
-				});
-			},
-			bindMobile() {
-				this.gotoPage("/pages/user/modify-phone/modify-phone");
-			},
-			/*跳转页面*/
-			jumpPage(path) {
-				this.gotoPage(path);
-			},
-			toinvitation(id) {
-				if (id == 0) {
-					uni.showToast({
-						title: '暂无活动'
-					})
-				} else {
-					this.gotoPage('/pages/user/invite/invite?invitation_gift_id=' + id);
-				}
-			},
-			getPhoneNumber(e) {
-				var self = this;
-				console.log(e.detail);
-				if (e.detail.errMsg !== 'getPhoneNumber:ok') {
-					return false;
-				}
-				uni.showLoading({
-					title: "正在提交",
-					mask: true
-				});
-				// 发送用户信息
-				self._post('user.user/bindMobile', {
-					session_key: self.sessionKey,
-					encrypted_data: e.detail.encryptedData,
-					iv: e.detail.iv,
-				}, result => {
-					uni.showToast({
-						title: '绑定成功'
-					});
-					// 执行回调函数
-					self.detail.mobile = result.data.mobile;
-				}, false, () => {
-					uni.hideLoading();
-				});
-			},
-		}
-	};
-</script>
-
-<style lang="scss">
-	page {
-		background-color: #EBEBEB;
-	}
-
-	.w100 {
-		width: 100%;
-	}
-
-	.foot_ {
-		height: 98rpx;
-		width: 100%;
-	}
-
-	.user-header {
-		position: relative;
-		background: $dominant-color;
-	}
-
-	.user-header .user-header-inner {
-		position: relative;
-		padding: 30rpx 30rpx 120rpx;
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		overflow: hidden;
-		margin-bottom: 100rpx;
-	}
-
-	.user-header .user-header-inner::after,
-	.user-header .user-header-inner::before {
-		display: block;
-		content: '';
-		position: absolute;
-		border-radius: 50%;
-		z-index: 0;
-	}
-
-	.user-header .user-header-inner::after {
-		width: 400rpx;
-		height: 400rpx;
-		right: -100rpx;
-		bottom: -200rpx;
-		background-image: radial-gradient(90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
-	}
-
-	.user-header .user-header-inner::before {
-		width: 200rpx;
-		height: 200rpx;
-		left: -60rpx;
-		top: -20rpx;
-		background-image: radial-gradient(-90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
-	}
-
-	.user-header .user-info {
-		display: flex;
-		justify-content: flex-start;
-		align-items: center;
-	}
-
-	.user-header .photo,
-	.user-header .photo image {
-		width: 100rpx;
-		height: 100rpx;
-		border-radius: 50%;
-	}
-
-	.user-header .photo {
-		border: 4rpx solid #ffffff;
-	}
-
-	.user-header .info {
-		padding-left: 20rpx;
-		box-sizing: border-box;
-		overflow: hidden;
-		color: #ffffff;
-	}
-
-	.user-header .info .name {
-		font-weight: bold;
-		font-size: 32rpx;
-	}
-
-	.user-header .info .tel {
-		font-size: 26rpx;
-	}
-
-	.user-header .info .grade {
-		display: block;
-		padding: 4px 16rpx;
-		font-size: 22rpx;
-		/* height: 36rpx; */
-		line-height: 36rpx;
-		border-radius: 40rpx;
-		background: #B90F00;
-		color: #ffffff;
-		font-family: PingFang SC;
-	}
-
-	.user-header .sign-box {
-		position: absolute;
-		right: 20rpx;
-		padding: 0 10rpx;
-		height: 50rpx;
-		border: 1px solid #ffe300;
-		border-radius: 25rpx;
-		font-size: 24rpx;
-		color: #ffe300;
-		z-index: 10;
-	}
-
-	.user-header .sign-box .iconfont {
-		color: #ffe300;
-	}
-
-	.user-header .my-order {
-		position: absolute;
-		padding: 0 30rpx;
-		/* height: 240rpx; */
-		right: 20rpx;
-		bottom: -75rpx;
-		left: 20rpx;
-		box-sizing: border-box;
-		border-radius: 16rpx;
-		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
-		background: #ffffff;
-		z-index: 10;
-	}
-
-	.order_center {
-		border-left: 1rpx solid #D9D9D9;
-		border-right: 1rpx solid #D9D9D9;
-	}
-
-	.my-order .item {
-		display: flex;
-		margin: 20rpx 0;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		font-size: 26rpx;
-		flex: 1;
-	}
-
-	.my-assets .icon-box image {
-		width: 48rpx;
-		height: 48rpx;
-		margin-bottom: 16rpx;
-	}
-
-	.my-order .icon-box,
-	.my-assets .icon-box {
-		width: 60rpx;
-		height: 60rpx;
-	}
-
-	.my-order .icon-box .iconfont,
-	.my-assets .icon-box .iconfont {
-		font-size: 50rpx;
-		color: #333333;
-	}
-
-	.my-assets .icon-box .dot {
-		position: absolute;
-		top: -13rpx;
-		right: -8rpx;
-		height: 25rpx;
-		min-width: 25rpx;
-		padding: 4rpx;
-		border-radius: 20rpx;
-		font-size: 20rpx;
-		background: #f00808;
-		color: #ffffff;
-	}
-
-	.my-assets {
-		margin: 0 20rpx;
-		padding: 30rpx;
-		padding-top: 0;
-		background: #ffffff;
-		border-radius: 12rpx;
-	}
-
-	.my-assets .item {
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-	}
-
-	.my-wallet {
-		position: relative;
-		width: 200rpx;
-		border-left: 1px solid #dddddd;
-	}
-
-	.my-wallet::after {
-		position: absolute;
-		display: block;
-		content: '';
-		left: 0;
-		border: 8rpx solid transparent;
-		border-left-color: #dddddd;
-	}
-
-	.menu-wrap {
-		margin: 0 20rpx;
-		margin-top: 30rpx;
-		background: #ffffff;
-		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
-		border-radius: 12rpx;
-	}
-
-	.menu-wrap .group-bd {
-		display: flex;
-		justify-content: flex-start;
-		align-items: flex-start;
-	}
-
-	.menu-wrap .item {
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		flex-direction: column;
-		width: 142rpx;
-		height: 150rpx;
-		font-size: 24rpx;
-	}
-
-	.menu-wrap .item.icon-dizhi1-box .icon-round {
-		background-image: linear-gradient(135deg, #67b4e2 10%, #356dce 70%, #5c8fe8 90%);
-	}
-
-	.menu-wrap .item.icon-youhuiquan1-box .icon-round {
-		background-image: linear-gradient(135deg, #e87ea4 10%, #ff268a 70%, #fe0d76 90%);
-	}
-
-	.menu-wrap .item.icon-youhuiquan--box .icon-round {
-		background-image: linear-gradient(135deg, #ff5a30 10%, #ff2b3c 70%, #ff1740 90%);
-	}
-
-	.menu-wrap .item.icon-fenxiao1-box .icon-round {
-		background-image: linear-gradient(135deg, #7ceeba 10%, #1ed2b7 70%, #17c0ad 90%);
-	}
-
-	.menu-wrap .item.icon-kanjia-box .icon-round {
-		background-image: linear-gradient(135deg, #f2a904 10%, #f27d04 70%, #eaa031 90%);
-	}
-
-	.menu-wrap .item.icon-shezhi1-box .icon-round {
-		background-image: linear-gradient(135deg, #615f6c 10%, #4c4a58 70%, #615f6c 90%);
-	}
-
-	.menu-wrap .icon-round {
-		width: 48rpx;
-		height: 48rpx;
-		color: #ffffff;
-	}
-
-	.menu-wrap .item .iconfont {
-		font-size: 40rpx;
-		color: #ffffff;
-	}
-
-	.menu-wrap .item .name {
-		margin-top: 19rpx;
-	}
-
-	.bind_phone {
-		width: 100%;
-		height: 80rpx;
-		padding: 0 30rpx;
-		box-sizing: border-box;
-		margin-bottom: 30rpx;
-	}
-
-	.bind_content {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		background: #ffffff;
-		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
-		border-radius: 16rpx;
-		height: 100%;
-		padding: 0 20rpx;
-	}
-
-	.bind_txt {}
-
-	.bind_btn {
-		width: 134rpx;
-		height: 50rpx;
-		line-height: 50rpx;
-		font-size: 22rpx;
-		border-radius: 25rpx;
-		text-align: center;
-		color: #FFFFFF;
-		background-color: $dominant-color;
-	}
-
-	.vertical {
-		position: absolute;
-		top: 10px;
-		right: 53px;
-		z-index: 100000;
-	}
-
-	.vertical_img {
-		width: 100rpx;
-		height: 100rpx;
-	}
-
-	.f20 {
-		margin-left: 5rpx;
-		font-size: 19rpx;
-	}
-
-	.red_mini {
-		color: #333333;
-		font-size: 36rpx;
-		font-weight: bold;
-	}
-
-	.icon-zhuanshutequan {
-		color: #f5dca6;
-		margin-right: 3px;
-	}
-
-	.news {
-		position: absolute;
-		top: 40rpx;
-		right: 20rpx;
-		z-index: 100;
-	}
-
-	.news .chat {
-		width: 40rpx;
-		height: 40rpx;
-	}
-
-	.news .icon-xiaoxi {
-		font-size: 50rpx;
-		color: #FFFFFF;
-	}
-
-	.news_num {
-		position: absolute;
-		top: 24rpx;
-		right: 44rpx;
-		z-index: 100;
-		border-radius: 50%;
-		width: 25rpx;
-		height: 25rpx;
-		text-align: center;
-		line-height: 25rpx;
-		color: #FFFFFF;
-		background-color: #ff6633;
-		padding: 5rpx;
-		font-size: 20rpx;
-	}
-
-	.activity_img {}
-
-	.activity_img image {
-		width: 676rpx;
-		height: 188rpx;
-		border: 5rpx solid #ff2b3c;
-		margin: 0 auto;
-		margin-top: 15rpx;
-	}
-
-	.my-assets-all {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		height: 90rpx;
-		line-height: 90rpx;
-	}
-
-	.my-assets-all .icon.icon-jiantou {
-		font-size: 12px;
-		color: #999999;
-	}
-</style>
+<template>
+	<view class="user-index" v-if="!loadding">
+		<!-- #ifdef APP-PLUS -->
+		<header-bar :bcolor="'#e2231a'"></header-bar>
+		<!-- #endif -->
+		<!--个人信息-->
+		<view class="user-header">
+			<view class="user-header-inner">
+				<view class="user-info">
+					<view class="photo">
+						<image :src="detail.avatarUrl" mode="aspectFill"></image>
+					</view>
+					<view class="info">
+						<view class="d-c-c mb23">
+							<view class="name">{{ detail.nickName }}</view>
+							<text class="ml20 grade" v-if="detail.grade_id > 0">
+								{{ detail.grade.name }}
+							</text>
+						</view>
+						<view class="tel d-s-c">
+							<text class="f26">会员号:{{ detail.user_no }}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+
+			<!--我的订单-->
+
+			<view class="my-order">
+				<view class="list d-a-c flex-1">
+					<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-wallet/my-wallet')">
+						<view class=" red_mini">{{ detail.balance }}</view>
+						<text class="pt16 f24 gray3">账号余额</text>
+					</view>
+					<view v-if="setting.is_show_personal_points != 0" class="item order_center d-c-c d-c"
+						@click="jumpPage('/pages/user/points/points')">
+						<view class=" red_mini">{{ detail.points }}</view>
+						<text class="pt16 f24 gray3">{{setting.points_name}}</text>
+					</view>
+					<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-coupon/my-coupon')">
+						<view class="red_mini">{{ coupon }}</view>
+						<text class="pt16 f24 gray3">优惠券</text>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="bind_phone" v-if="!detail.mobile">
+			<view class="bind_content">
+				<view class="bind_txt">确保账户安全,请绑定手机号</view>
+				<!-- #ifdef MP-WEIXIN -->
+				<button open-type="getPhoneNumber" class="bind_btn" @getphonenumber="getPhoneNumber">去绑定</button>
+				<!-- #endif -->
+				<!-- #ifndef MP-WEIXIN -->
+				<button class="bind_btn" @click="bindMobile">去绑定</button>
+				<!-- #endif -->
+			</view>
+		</view>
+		<!--我的资产-->
+		<view class="my-assets">
+			<view class="my-assets-all">
+				<view class="f30 fb">我的订单</view>
+				<view class="gray9 f26" @click="jumpPage('/pages/order/myorder?dataType=all')">全部订单<text
+						class="icon iconfont icon-jiantou"></text></view>
+			</view>
+			<view class="d-b-c w100">
+				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=payment')">
+					<view class="icon-box pr">
+						<image src="../../../static/icon/icon-icon.png" mode=""></image>
+						<text class="dot d-c-c"
+							v-if="orderCount.payment != null && orderCount.payment > 0">{{ orderCount.payment }}</text>
+					</view>
+					<text>待付款</text>
+				</view>
+				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=delivery')">
+					<view class="icon-box pr">
+						<image src="../../../static/icon/icon-daifahuo.png" mode=""></image>
+						<text class="dot d-c-c"
+							v-if="orderCount.delivery != null && orderCount.delivery > 0">{{ orderCount.delivery }}</text>
+					</view>
+					<text class="">待发货</text>
+				</view>
+				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=received')">
+					<view class="icon-box pr">
+						<image src="../../../static/icon/icon-daishouhuo.png" mode=""></image>
+						<text class="dot d-c-c"
+							v-if="orderCount.received != null && orderCount.received > 0">{{ orderCount.received }}</text>
+					</view>
+					<text>待收货</text>
+				</view>
+				<view class="item" @click="jumpPage('/pages/order/myorder?dataType=comment')">
+					<view class="icon-box pr">
+						<image src="../../../static/icon/icon-quanbudingdan.png" mode=""></image>
+						<text class="dot d-c-c"
+							v-if="orderCount.comment != null && orderCount.comment > 0">{{ orderCount.comment }}</text>
+					</view>
+					<text>待评价</text>
+				</view>
+				<view class="item" @click="jumpPage('/pages/order/refund/index/index')">
+					<view class="icon-box pr">
+						<image src="../../../static/icon/icon-tuikuan.png" mode=""></image>
+						<text class="dot d-c-c"
+							v-if="orderCount.refund != null && orderCount.refund > 0">{{ orderCount.refund }}</text>
+					</view>
+					<text>退款/售后</text>
+				</view>
+			</view>
+		</view>
+
+		<!--菜单-->
+		<view class="menu-wrap">
+			<view class="group-bd f-w">
+				<view :class="'item ' + item.icon + '-box'" v-for="(item, index) in menus" :key="index"
+					@click="jumpPage(item.path)">
+					<view class="icon-round d-c-c">
+						<image class="icon-round" :src="item.icon" mode="aspectFill"></image>
+					</view>
+					<text class="name">{{ item.name }}</text>
+				</view>
+			</view>
+		</view>
+		<view v-if="invitation.is_open && invitation.invitation_id > 0">
+			<view class="activity_img" @click="toinvitation(invitation.invitation_id)">
+				<image :src="invitation.image" mode=""></image>
+			</view>
+		</view>
+		<!--推荐-->
+		<view>
+			<recommendProduct :location="20"></recommendProduct>
+		</view>
+	</view>
+</template>
+
+<script>
+	import recommendProduct from '@/components/recommendProduct/recommendProduct.vue';
+	export default {
+		components: {
+			recommendProduct
+		},
+		data() {
+			return {
+				/*签到数据*/
+				sign: {},
+				/*是否加载完成*/
+				loadding: true,
+				indicatorDots: true,
+				autoplay: true,
+				interval: 2000,
+				duration: 500,
+				/*菜单*/
+				menus: [],
+				invitation: {},
+				detail: {
+					balance: 0,
+					points: 0,
+					grade: {
+						name: ''
+					},
+				},
+				orderCount: {},
+				coupon: 0,
+				setting: {},
+				user_type: '', //用户状态
+				sessionKey: ''
+			};
+		},
+		onShow() {
+			/*获取个人中心数据*/
+			this.getData();
+		},
+		onLoad(e) {
+			let self = this;
+			if (e.invitation_id) {
+				uni.setStorageSync('invitation_id', e.invitation_id);
+			}
+			if (e.referee_id) {
+				uni.setStorageSync('referee_id', e.referee_id);
+			}
+			//#ifdef MP-WEIXIN
+			wx.login({
+				success(res) {
+					// 发送用户信息
+					self._post('user.user/getSession', {
+						code: res.code
+					}, result => {
+						self.sessionKey = result.data.session_key;
+					});
+				}
+			});
+			//#endif
+		},
+		methods: {
+			/*获取数据*/
+			getData() {
+				let self = this;
+				uni.showLoading({
+					title: '加载中'
+				});
+				self._post('user.index/detail', {
+					source: self.getPlatform()
+				}, function(res) {
+					//#ifdef MP-WEIXIN
+					if (res.data.getPhone) {
+						//#ifdef MP-WEIXIN
+						self.gotoPage('/pages/login/bindmobile');
+						//#endif
+						//#ifndef MP-WEIXIN
+						self.bindMobile();
+						//#endif
+						return;
+					}
+					//#endif
+					self.detail = res.data.userInfo;
+					self.sign = res.data.sign;
+					self.coupon = res.data.coupon;
+					self.orderCount = res.data.orderCount;
+					self.menus = res.data.menus;
+					self.invitation = res.data.invitation;
+					self.setting = res.data.setting;
+					self.loadding = false;
+					uni.hideLoading();
+				});
+			},
+			bindMobile() {
+				this.gotoPage("/pages/user/modify-phone/modify-phone");
+			},
+			/*跳转页面*/
+			jumpPage(path) {
+				this.gotoPage(path);
+			},
+			toinvitation(id) {
+				if (id == 0) {
+					uni.showToast({
+						title: '暂无活动'
+					})
+				} else {
+					this.gotoPage('/pages/user/invite/invite?invitation_gift_id=' + id);
+				}
+			},
+			getPhoneNumber(e) {
+				var self = this;
+				console.log(e.detail);
+				if (e.detail.errMsg !== 'getPhoneNumber:ok') {
+					return false;
+				}
+				uni.showLoading({
+					title: "正在提交",
+					mask: true
+				});
+				// 发送用户信息
+				self._post('user.user/bindMobile', {
+					session_key: self.sessionKey,
+					encrypted_data: e.detail.encryptedData,
+					iv: e.detail.iv,
+				}, result => {
+					uni.showToast({
+						title: '绑定成功'
+					});
+					// 执行回调函数
+					self.detail.mobile = result.data.mobile;
+				}, false, () => {
+					uni.hideLoading();
+				});
+			},
+		}
+	};
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #EBEBEB;
+	}
+
+	.w100 {
+		width: 100%;
+	}
+
+	.foot_ {
+		height: 98rpx;
+		width: 100%;
+	}
+
+	.user-header {
+		position: relative;
+		background: $dominant-color;
+	}
+
+	.user-header .user-header-inner {
+		position: relative;
+		padding: 30rpx 30rpx 120rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		overflow: hidden;
+		margin-bottom: 100rpx;
+	}
+
+	.user-header .user-header-inner::after,
+	.user-header .user-header-inner::before {
+		display: block;
+		content: '';
+		position: absolute;
+		border-radius: 50%;
+		z-index: 0;
+	}
+
+	.user-header .user-header-inner::after {
+		width: 400rpx;
+		height: 400rpx;
+		right: -100rpx;
+		bottom: -200rpx;
+		background-image: radial-gradient(90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
+	}
+
+	.user-header .user-header-inner::before {
+		width: 200rpx;
+		height: 200rpx;
+		left: -60rpx;
+		top: -20rpx;
+		background-image: radial-gradient(-90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
+	}
+
+	.user-header .user-info {
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+	}
+
+	.user-header .photo,
+	.user-header .photo image {
+		width: 100rpx;
+		height: 100rpx;
+		border-radius: 50%;
+	}
+
+	.user-header .photo {
+		border: 4rpx solid #ffffff;
+	}
+
+	.user-header .info {
+		padding-left: 20rpx;
+		box-sizing: border-box;
+		overflow: hidden;
+		color: #ffffff;
+	}
+
+	.user-header .info .name {
+		font-weight: bold;
+		font-size: 32rpx;
+	}
+
+	.user-header .info .tel {
+		font-size: 26rpx;
+	}
+
+	.user-header .info .grade {
+		display: block;
+		padding: 4px 16rpx;
+		font-size: 22rpx;
+		/* height: 36rpx; */
+		line-height: 36rpx;
+		border-radius: 40rpx;
+		background: #B90F00;
+		color: #ffffff;
+		font-family: PingFang SC;
+		opacity: 0;
+	}
+
+	.user-header .sign-box {
+		position: absolute;
+		right: 20rpx;
+		padding: 0 10rpx;
+		height: 50rpx;
+		border: 1px solid #ffe300;
+		border-radius: 25rpx;
+		font-size: 24rpx;
+		color: #ffe300;
+		z-index: 10;
+	}
+
+	.user-header .sign-box .iconfont {
+		color: #ffe300;
+	}
+
+	.user-header .my-order {
+		position: absolute;
+		padding: 0 30rpx;
+		/* height: 240rpx; */
+		right: 20rpx;
+		bottom: -75rpx;
+		left: 20rpx;
+		box-sizing: border-box;
+		border-radius: 16rpx;
+		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
+		background: #ffffff;
+		z-index: 10;
+	}
+
+	.order_center {
+		border-left: 1rpx solid #D9D9D9;
+		border-right: 1rpx solid #D9D9D9;
+	}
+
+	.my-order .item {
+		display: flex;
+		margin: 20rpx 0;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		font-size: 26rpx;
+		flex: 1;
+	}
+
+	.my-assets .icon-box image {
+		width: 48rpx;
+		height: 48rpx;
+		margin-bottom: 16rpx;
+	}
+
+	.my-order .icon-box,
+	.my-assets .icon-box {
+		width: 60rpx;
+		height: 60rpx;
+	}
+
+	.my-order .icon-box .iconfont,
+	.my-assets .icon-box .iconfont {
+		font-size: 50rpx;
+		color: #333333;
+	}
+
+	.my-assets .icon-box .dot {
+		position: absolute;
+		top: -13rpx;
+		right: -8rpx;
+		height: 25rpx;
+		min-width: 25rpx;
+		padding: 4rpx;
+		border-radius: 20rpx;
+		font-size: 20rpx;
+		background: #f00808;
+		color: #ffffff;
+	}
+
+	.my-assets {
+		margin: 0 20rpx;
+		padding: 30rpx;
+		padding-top: 0;
+		background: #ffffff;
+		border-radius: 12rpx;
+	}
+
+	.my-assets .item {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.my-wallet {
+		position: relative;
+		width: 200rpx;
+		border-left: 1px solid #dddddd;
+	}
+
+	.my-wallet::after {
+		position: absolute;
+		display: block;
+		content: '';
+		left: 0;
+		border: 8rpx solid transparent;
+		border-left-color: #dddddd;
+	}
+
+	.menu-wrap {
+		margin: 0 20rpx;
+		margin-top: 30rpx;
+		background: #ffffff;
+		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
+		border-radius: 12rpx;
+	}
+
+	.menu-wrap .group-bd {
+		display: flex;
+		justify-content: flex-start;
+		align-items: flex-start;
+	}
+
+	.menu-wrap .item {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
+		width: 142rpx;
+		height: 150rpx;
+		font-size: 24rpx;
+	}
+
+	.menu-wrap .item.icon-dizhi1-box .icon-round {
+		background-image: linear-gradient(135deg, #67b4e2 10%, #356dce 70%, #5c8fe8 90%);
+	}
+
+	.menu-wrap .item.icon-youhuiquan1-box .icon-round {
+		background-image: linear-gradient(135deg, #e87ea4 10%, #ff268a 70%, #fe0d76 90%);
+	}
+
+	.menu-wrap .item.icon-youhuiquan--box .icon-round {
+		background-image: linear-gradient(135deg, #ff5a30 10%, #ff2b3c 70%, #ff1740 90%);
+	}
+
+	.menu-wrap .item.icon-fenxiao1-box .icon-round {
+		background-image: linear-gradient(135deg, #7ceeba 10%, #1ed2b7 70%, #17c0ad 90%);
+	}
+
+	.menu-wrap .item.icon-kanjia-box .icon-round {
+		background-image: linear-gradient(135deg, #f2a904 10%, #f27d04 70%, #eaa031 90%);
+	}
+
+	.menu-wrap .item.icon-shezhi1-box .icon-round {
+		background-image: linear-gradient(135deg, #615f6c 10%, #4c4a58 70%, #615f6c 90%);
+	}
+
+	.menu-wrap .icon-round {
+		width: 48rpx;
+		height: 48rpx;
+		color: #ffffff;
+	}
+
+	.menu-wrap .item .iconfont {
+		font-size: 40rpx;
+		color: #ffffff;
+	}
+
+	.menu-wrap .item .name {
+		margin-top: 19rpx;
+	}
+
+	.bind_phone {
+		width: 100%;
+		height: 80rpx;
+		padding: 0 30rpx;
+		box-sizing: border-box;
+		margin-bottom: 30rpx;
+	}
+
+	.bind_content {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		background: #ffffff;
+		/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
+		border-radius: 16rpx;
+		height: 100%;
+		padding: 0 20rpx;
+	}
+
+	.bind_txt {}
+
+	.bind_btn {
+		width: 134rpx;
+		height: 50rpx;
+		line-height: 50rpx;
+		font-size: 22rpx;
+		border-radius: 25rpx;
+		text-align: center;
+		color: #FFFFFF;
+		background-color: $dominant-color;
+	}
+
+	.vertical {
+		position: absolute;
+		top: 10px;
+		right: 53px;
+		z-index: 100000;
+	}
+
+	.vertical_img {
+		width: 100rpx;
+		height: 100rpx;
+	}
+
+	.f20 {
+		margin-left: 5rpx;
+		font-size: 19rpx;
+	}
+
+	.red_mini {
+		color: #333333;
+		font-size: 36rpx;
+		font-weight: bold;
+	}
+
+	.icon-zhuanshutequan {
+		color: #f5dca6;
+		margin-right: 3px;
+	}
+
+	.news {
+		position: absolute;
+		top: 40rpx;
+		right: 20rpx;
+		z-index: 100;
+	}
+
+	.news .chat {
+		width: 40rpx;
+		height: 40rpx;
+	}
+
+	.news .icon-xiaoxi {
+		font-size: 50rpx;
+		color: #FFFFFF;
+	}
+
+	.news_num {
+		position: absolute;
+		top: 24rpx;
+		right: 44rpx;
+		z-index: 100;
+		border-radius: 50%;
+		width: 25rpx;
+		height: 25rpx;
+		text-align: center;
+		line-height: 25rpx;
+		color: #FFFFFF;
+		background-color: #ff6633;
+		padding: 5rpx;
+		font-size: 20rpx;
+	}
+
+	.activity_img {}
+
+	.activity_img image {
+		width: 676rpx;
+		height: 188rpx;
+		border: 5rpx solid #ff2b3c;
+		margin: 0 auto;
+		margin-top: 15rpx;
+	}
+
+	.my-assets-all {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		height: 90rpx;
+		line-height: 90rpx;
+	}
+
+	.my-assets-all .icon.icon-jiantou {
+		font-size: 12px;
+		color: #999999;
+	}
+</style>