gjy 3 年 前
コミット
5a2994efb8

+ 1 - 0
App.vue

@@ -46,6 +46,7 @@
 </script>
 
 <style lang='scss'>
+	@import "static/iconfont/iconfont.css";
 	@import "components/colorui/main.css";
 	@import "components/colorui/icon.css";
 	@import "components/uview-ui/index.scss";

+ 66 - 13
components/code-elf-guide/code-elf-guide.vue

@@ -2,26 +2,33 @@
 	<view class="content">
 		<swiper class="swiper" 
 		:autoplay="autoplay" 
-		:duration="duration">
+		:duration="duration"
+		@change="swiperChange">
 			<swiper-item>
 				<view class="swiper-item">
-					<view class="swiper-item-img"><image src="../../static/img/splash1.png" mode="aspectFit"></image></view>
+					<view class="swiper-item-img"><image src="/static/img/splash1.png" mode="aspectFit"></image></view>
 				</view>
 				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
 			</swiper-item>
 			<swiper-item>
 				<view class="swiper-item">
-					<view class="swiper-item-img"><image src="../../static/img/splash2.png" mode="aspectFit"></image></view>
+					<view class="swiper-item-img"><image src="/static/img/splash2.png" mode="aspectFit"></image></view>
 				</view>
 				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
 			</swiper-item>
 			<swiper-item>
 				<view class="swiper-item">
-					<view class="swiper-item-img"><image src="../../static/img/splash3.png" mode="aspectFit"></image></view>
+					<view class="swiper-item-img"><image src="/static/img/splash3.png" mode="aspectFit"></image></view>
 				</view>
 				<view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
 			</swiper-item>
 		</swiper>
+		<view class="dots">
+		    <view class='dot' :class="currentSwiper == '0' ? ' active' : ''"></view>
+			<view class='dot' :class="currentSwiper== '1'? ' active' : ''"></view>
+			<view class='dot' :class="currentSwiper=='2' ? ' active' : ''"></view>
+		</view>
+		<button @click='launchFlag' v-if='show' class='experience'>立即体验</button>
 		<!-- <view class="uniapp-img"><image src="../../static/guide/uniapp4@2x.png" mode="aspectFit"></image></view> -->
 	</view>
 </template>
@@ -34,7 +41,11 @@
 				autoplay: false,
 				duration: 500,
 				jumpover: '跳过',
-				experience: '立即体验'
+				experience: '立即体验',
+				show:false,
+				indicatorColor:'#F2F2F2',
+				currentSwiper:0,
+				indicatorActivecolor:'#22C572'
 			}
 		},
 		methods: {
@@ -47,9 +58,17 @@
 						data: true,
 				});
 				uni.switchTab({
-					url: '/pages/tabBar/component/component'
+					url: '/pages/sale/information'
 				});
 				
+			},
+			swiperChange:function(e){
+				this.currentSwiper=e.detail.current
+				if(e.detail.current==2){
+					this.show=true
+				}else{
+					this.show=false
+				}
 			}
 		}
 	}
@@ -64,7 +83,7 @@
 	}
 	.swiper{
 		width: 100%;
-		height: 80%;
+		height: 100%;
 		background: #FFFFFF;
 	}
 	.swiper-item {
@@ -79,11 +98,12 @@
 	}
 	.swiper-item-img{
 		width: 100%;
-		height: auto;
+		height: 100%;
 		margin: 0 auto;
 	}
 	.swiper-item-img image{
-		width: 80%;
+		width: 75%;
+		margin:0 auto;
 	}
 	.uniapp-img{
 		height: 20%;
@@ -102,10 +122,10 @@
 		height: 60upx;
 		line-height: 60upx;
 		padding: 0 40upx;
-		border-radius: 30upx;
+		/* border-radius: 30upx; */
 		font-size: 32upx;
-		color: #454343;
-		border: 1px solid #454343;
+		color: #AFB3BF;
+		background:#F3F3F3;
 		z-index: 999;
 	}
 	.jump-over{
@@ -115,6 +135,39 @@
 	.experience{
 		right: 50%;
 		margin-right: -105upx;
-		bottom: 0;
+		bottom: 30px;
+		color: #fff;
+		height: 80upx;
+		line-height: 80upx;
+		border-radius:30px;
+		background:linear-gradient(#3BD072,#1BC771);
+	}
+	.dots {
+	  width: 170rpx;
+	  height: 20rpx;
+	  display: flex;
+	  flex-direction: row;
+	  position: absolute;
+	  left: 50%;
+	  transform: translateX(-49%);
+	  bottom: 80rpx;
+	}
+	 
+	/*未选中时的小圆点样式 */
+	 
+	.dot {
+	  width: 10rpx;
+	  height: 10rpx;
+	  border-radius: 14rpx;
+	  margin: 0 10px;
+	  background-color: #F2F2F2;
+	}
+	 
+	/*选中以后的小圆点样式  */
+	 
+	.active {
+	  width: 30rpx;
+	  height: 10rpx;
+	  background-color: #29CA78;
 	}
 </style>

+ 35 - 1
main.js

@@ -27,7 +27,6 @@ const vuexStore = require("@/store/$u.mixin.js");
 Vue.mixin(vuexStore);
 import webim from 'webim.js';
 Vue.config.productionTip = false
-Vue.prototype.$socket = webim;
 App.mpType = 'app'
 import * as filters from './filters' 
 import * as config from './config'
@@ -93,6 +92,7 @@ const isVip = () => {
 
 let loginLock = false
 
+// 原微信小程序请求方式
 const request = (_gp, _mt, data = {}, failCallback) => {
 	//异步请求数据
 	return new Promise(resolve => {
@@ -172,6 +172,39 @@ const request = (_gp, _mt, data = {}, failCallback) => {
 		})
 	})
 }
+// 现app调用方式
+
+const doRequest = (method, url, data)=> {
+	// let baseUrl = config.def().baseUrl
+	let baseUrl = 'http://192.168.1.120:8090/'
+        // 如果data为空
+        if (!data) var data = []
+        var arr = []
+        arr.push(data)
+        // 接口需要验证的可以将json转成数组添加值再调用
+        // 不需要的可以直接data:data
+        return new Promise((resolve, reject) => {
+            uni.request({
+                method: method,
+                url: baseUrl +url,
+                data: arr[0],
+                // data:data
+                header: {
+                    'content-type': 'application/x-www-form-urlencoded'
+                },
+                success: function(result) {
+                    // resolve调用后,即可传递到调用方使用then或者async+await同步方式进行处理逻辑
+                    resolve(result)
+                },
+                fail: function(e) {
+                    console.log('error in...')
+                    // reject调用后,即可传递到调用方使用catch或者async+await同步方式进行处理逻辑
+                    reject(e)
+                },
+            })
+        })
+
+    }
 
 const uploadImg = (successCallback) => {
 	let baseUrl = config.def().baseUrl
@@ -265,6 +298,7 @@ Vue.prototype.$api = {
 	prePage,
 	request,
 	uploadImg,
+	doRequest,
 	logout,
 	isVip,
 	setUserInfo,

+ 33 - 0
pages.json

@@ -94,6 +94,17 @@
 					"animationType": "slide-in-bottom"
 				} 
 			}
+		},
+		{
+			"path": "pages/public/login_account_number",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": false,
+					"animationType": "slide-in-bottom"
+				} 
+			}
 		}, 
 		{
 			"path": "pages/public/register",
@@ -106,6 +117,28 @@
 				}
 			}
 		},
+		{
+			"path": "pages/public/reset",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": false,
+					"animationType": "slide-in-bottom"
+				}
+			}
+		},
+		{
+			"path": "pages/public/code",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": false,
+					"animationType": "slide-in-bottom"
+				}
+			}
+		},
 		{
 			"path": "pages/user/user",
 			"style": {

+ 182 - 0
pages/public/code.vue

@@ -0,0 +1,182 @@
+<template>
+	<view class="top">
+		<view class="back-btn cuIcon-back" @click="navBack"></view>
+			<!-- 文字 -->
+			<view class="top_one">请输入验证码</view>
+			<view class="top_two">验证码已发送到<text class="text">{{phone}}</text></view>
+			<!-- 六个显示框 -->
+			<view class="top_three">
+				<view :class="[ !inputList[0]||inputList.length>0 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[0]}}</text>
+					<view v-if="!inputList[0]"  class="fours"></view>
+				</view>
+				<view :class="[ inputList[0] && !inputList[1]||inputList.length>1 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[1]}}</text>
+					<view v-if="inputList[0] && !inputList[1]"  class="fours"></view>
+				</view>
+				<view :class="[ inputList[1] && !inputList[2]||inputList.length>2 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[2]}}</text>
+					<view v-if="inputList[1] && !inputList[2]"  class="fours"></view>
+				</view>
+				<view :class="[ inputList[2] && !inputList[3]||inputList.length>3 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[3]}}</text>
+					<view v-if="inputList[2] && !inputList[3]"  class="fours"></view>
+				</view>
+				<view :class="[ inputList[3] && !inputList[4]||inputList.length>4 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[4]}}</text>
+					<view v-if="inputList[3] && !inputList[4]"  class="fours"></view>
+				</view>
+				<view :class="[ inputList[4] && !inputList[5]||inputList.length>5 ? 'inb' : '' ]" class="input">
+					<text>{{inputList[5]}}</text>
+					<view v-if="inputList[4] && !inputList[5]"  class="fours"></view>
+				</view>
+			</view>
+			<!-- 隐藏的input -->
+			<view class="top_four">
+				<input type="text" class="input_show" maxlength="6" @input='submit' v-model="inputList" focus="true"/>
+			</view>
+			<!-- 重新获取 -->
+			<view class="top_five" @click='regain' :class="!status ? 'active' : '' "><text v-if="!status">重新发送</text><text v-if="status">{{count_down}}秒后重新发送</text></view>
+		</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 电话
+				phone:'',
+				// 跟隐藏input绑定的数组
+				inputList:[],
+				//计时器
+				count_down:60,
+				status:false
+			}
+		},
+		methods: {
+			
+			//因项目原型要求 所以用了onshow页面加载触发函数,可换成单击事件@click
+			onShow:function(e){
+				
+				
+			},
+			onLoad:function(options){
+				this.phone=this.options.phone
+				if(this.phone){
+					this.regain()
+				}else{
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon:'none',
+						duration: 2000
+					})
+				}
+			},
+			regain(){
+				this.status=true
+				// console.log(e)150500
+				// 设定一个定时器 1000是1秒的意思
+				var interval = setInterval(() =>{
+					--this.count_down
+				},1000) 
+				// 设定一个定时器 60000就是六十秒
+				setTimeout(() =>{
+					this.status=false
+					clearInterval(interval)//括号里面的名字要与setInterval定义的相同
+				},60000)
+				this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.phone}).then(res => {
+				                // 获得数据
+								if(res.statusCode!=200){
+									uni.showToast({
+										title: res.data.message,
+										icon:'none',
+										duration: 2000
+									})
+								}
+				                console.log(res);
+				            })
+				            .catch(res => {
+				                uni.showToast({
+				                	title: res.errMsg,
+				                	icon:'none',
+				                	duration: 2000
+				                })
+				            });
+			},
+			submit(e){
+				if(e.detail.value.length==6){
+					this.$api.doRequest('get','/commonUser/loginVerifyCode',{phone:this.phone,verifyCode:this.inputList}).then(res => {
+					                // 获得数据
+					                console.log(res);
+					            })
+					            .catch(res => {
+					                console.log(res);
+					            });
+				}
+			}
+			
+		}
+	}
+</script>1
+
+<style>
+	.top{
+	padding-top: 85px;
+	position: relative;
+	width: 100vw;
+	height: 100vh;
+	overflow: hidden;
+	background: url('../../static/img/login/bg.png');
+	background-size:100%;}
+	.back-btn {
+		position: absolute;
+		left: 40upx;
+		z-index: 9999;
+		padding-top: var(--status-bar-height);
+		top: 40upx;
+		font-size: 40upx;
+		color: $font-color-dark;
+	}
+	/* 文字 */
+	.top_one{width: 90%; height: 90rpx; line-height: 90rpx; font-size: 44rpx; margin: auto; font-weight: bold;}
+	.top_two{width: 90%; height: 40rpx; line-height: 40rpx; font-size: 24rpx; margin: auto; color: #545454;}
+	.text{font-weight: bold;}
+	
+	/* 六个显示框容器 */
+	.top_three{width: 80%; height: 200rpx; margin: auto;
+		display: flex; align-items: center; justify-content: center;
+	}
+	/* 六个框显示框 */
+	.input{width: 14%; height: 80rpx; background-color: #F5F5F5; margin-right: 12rpx;
+		text-align: center; line-height: 80rpx; font-size: 50rpx;
+		border-radius:3px;
+		color:#181818;
+	}
+	/* 模拟的焦点 */
+	.inb{
+		background:#FFFFFF;
+		box-shadow: 0px 9px 10px 4px rgba(0, 0, 0, 0.07);
+		}
+	.fours{width: 5rpx; height: 40rpx; margin: auto; background-color: #000000;
+		margin-top: 20rpx;	animation: show .8s linear infinite;
+	}
+	/* 模拟焦点动画  更改animation以更改动画样式*/
+	@keyframes show{
+		from{background-color: #000000;}
+		to{background-color: #ffffff;}
+	}
+	/* 隐藏的inpit容器 */
+	.top_four{width: 80%; height: 100rpx; margin: auto; margin-top: -140rpx;}
+	.input_show{width: 100%; height: 100rpx; border-bottom: 2rpx solid #000000; margin: auto;
+		opacity: 0;background-color: #c6c6c6; 
+	}
+	/* 重新获取 */
+	.top_five{width: 100%; height: 60rpx; margin-top: 180rpx; text-align: center; line-height: 60rpx; 
+		color: #959595;
+	}
+	/* 定时器结束的字体样式 */
+	.active{color: #22C572;}
+	.button{width: 80%; height: 100rpx; line-height: 100rpx; background-color: #5473E8; border-radius: 60rpx;
+		
+	}
+</style>

+ 74 - 262
pages/public/login.vue

@@ -1,95 +1,17 @@
 <template>
 	<view class="container">
-		<view class="left-bottom-sign"></view>
-		<view class="back-btn yticon icon-zuojiantou-up" @click="navBack"></view>
-		<view class="right-top-sign"></view>
+		<view class="back-btn cuIcon-back" @click="navBack"></view>
 		<!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
 		<view class="wrapper">
-			<view class="left-top-sign">LOGIN</view>
-			<view class="welcome">
-				欢迎回来!
+			<image style='width:38px;height:38px;margin-bottom:10px;' src='../../static/img/login/logo@2x.png'></image>
+			<h2>欢迎使用易粮易运</h2>
+			<view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
+				<view style='width:15%;border-right:1px solid #E8E9ED;'>+86</view>
+				<view style='width:85%;'><input style='padding-left:10px;' v-model='phone' @input='changephone' placeholder="请输入手机号码" type="number" maxlength="11"></view>
 			</view>
-			<!-- <button v-if="!loginType" class="confirm-btn" @click="chooseLoginType('wechat')" :disabled="logining">微信快速登录(推荐)</button>
-			<button v-if="!loginType" class="confirm-btn" @click="chooseLoginType('phone')" :disabled="logining">手机注册登录</button> -->
-			<!-- #ifdef MP-WEIXIN -->
-			<!-- 旧版本方式 -->  
-			<block v-if="canIUseProfile==false" >
-				<button v-if="loginType === 'wechat'" class="confirm-btn" open-type="getUserInfo" @getuserinfo="miniWechatLogin"
-				 :disabled="logining">微信授权登录</button>
-			</block>  
-			<!-- 新版本方式 -->  
-			<block v-else>  
-				<button  v-if="loginType === 'wechat'"  class="confirm-btn" @tap="miniWechatLogin"
-				 :disabled="logining" >微信授权登录</button>  
-			</block>  
-			<!-- #endif -->
-			<!-- #ifdef APP-PLUS -->
-			<block v-if="isApple">
-				<button v-if="loginType === 'wechat'" class="confirm-btn" @click="wechatLogin" :disabled="logining">微信授权登录</button>
-				<button v-if="loginType === 'wechat' && isApple && platform == 'ios' && system >= '13'" class="confirm-btn" @click="appleLogin" :disabled="logining">通过Apple登录</button>
-			</block>
-			<block v-else>
-				<view  class="input-content">
-					<view class="cu-form-group">
-						<view class="title"><text class="cuIcon-my"></text></view>
-						<input placeholder="请输入用户名" v-model="phone" name="input" ></input>
-					</view>
-					<view class="cu-form-group">
-						<view class="title"><text class="cuIcon-lock"></text></view>
-						<input placeholder="请输入登录密码" password v-model="password" name="input" ></input>
-					</view>
-					<view style='padding:0;' class="cu-form-group">
-						<view></view>
-						<view @click='forgetpass'>忘记登录密码?</view>
-					</view>
-					<button style='width:100%;' @click='phonelogin' class="cu-btn bg-gradual-green">登录</button>
-				</view>
-				<!-- <view style='    position: fixed;bottom: 9px;width: 100%;text-align-last: center;'>
-					<text  @click="wechatLogin" class="cuIcon-weixin"></text>
-					<image class='apple' src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/tmp/apple.png" @click="appleLogin" alt=""></image>
-				</view> -->
-			</block>
-			<!-- #endif -->
-			<!-- #ifdef H5 -->
-			<button v-if="loginType === 'wechat'" class="confirm-btn" @click="wechatH5Login" :disabled="logining">微信授权登录</button>
-			<button v-if="loginType === 'wechat' && isApple && platform == 'ios' && system >= '13'" class="confirm-btn" @click="appleLogin" :disabled="logining">通过Apple登录</button>
-			<!-- #endif -->
-			<button v-if="loginType === 'phone'" class="confirm-btn" @click="toLogin" :disabled="logining">登录</button>
-			<view v-if="loginType === 'phone'" class="forget-section">
-				忘记密码?
-			</view>
-			<!-- #ifdef MP-WEIXIN -->
-			<div v-if="isPhone" class="alert" >
-			  <div class="auth">
-				<div class="apply">
-				  <span class="">需要获取您的手机权限</span>
-				  <p>(请开启手机权限)</p>
-				</div>
-				<button class="confirm" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">确认</button>
-			  </div>
-			</div>
-			<!-- #endif -->
-		    <!-- #ifdef APP-PLUS -->
-		    <neil-modal
-		    	:show="isPhone" 
-		    	@close="cancel" 
-		    	:style="{display:inputStatus}"
-		    	title="绑定手机号" 
-				showConfirm="true"
-				showCancel="true"
-				@confirm="confirm"
-		    	>
-				<view class="cu-form-group">
-					<input v-model="inputContent" style="margin:20upx;" type="mobile"  placeholder="请输入手机号" />
-				</view>
-				<view class="cu-form-group">
-					<view class="title">验证码</view>
-					<input type="mobile" value="" placeholder="6位验证码" maxlength="6"
-						 data-key="verifyCode" @input="verifyCodeInput" style="width: 60%;"></input>
-					<button class='cu-btn bg-green shadow':disabled="sendDisabled" @click="doGetVerify">{{sendText}}</button>
-				</view>
-		    </neil-modal>
-		    <!-- #endif -->
+			<button @click='gocode' :class='codestatus?"active":""' class='verificationCode'>获取验证码</button>
+			<view @click='gonumber' style='text-align:center;color:#6A6A6A;margin-top:10px;'>使用账号密码登录</view>
+		    <button @click='goregister' class='register'>手机号一键注册</button>
 		</view>
 		<view v-if="loginType === 'phone'" class="register-section">
 			还没有账号?
@@ -102,7 +24,6 @@
 	import {
 		mapMutations
 	} from 'vuex';
-
 	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
 	import { queryData, upData, initData } from '../../util/dbUtil.js'
 	export default {
@@ -116,6 +37,7 @@
 				isPhone: false,
 				isApple: true,
 				accessToken:'',
+				phone:'',
 				params:{
 					encryptedData:'',
 					session_key:'',
@@ -134,7 +56,8 @@
 				system:'',
 				platform:'',
 				userData:undefined,
-				canIUseProfile:false
+				canIUseProfile:false,
+				codestatus:false
 			}
 		},
 		onShow() {
@@ -162,11 +85,49 @@
 			})
 		},
 		methods: {
+			changephone(e){
+				if(e.detail.value.length>11){
+					this.codestatus=true
+				}else if(e.detail.value.length<11){
+					this.codestatus=false
+				}else{
+					this.codestatus=true
+				}
+			},
+			gonumber(){
+				uni.navigateTo({
+					url:'/pages/public/login_account_number'
+				})
+			},
 			forgetpass(){
 				uni.navigateTo({
 					url:'/pages/public/reset'
 				})
 			},
+			gocode(){
+				if(this.phone.length==11){
+					uni.navigateTo({
+						url:'/pages/public/code?phone='+this.phone
+					})
+				}
+				else if(this.phone.length==0){
+					uni.showToast({
+					 title:'手机号不能为空',
+					 icon:'none'
+					})
+				}else{
+					uni.showToast({
+					 title:'请输入正确的手机号',
+					 icon:'none'
+					})
+				}
+				
+			},
+			goregister(){
+				uni.navigateTo({
+					url:'/pages/public/register'
+				})
+			},
 			phonelogin(){
 				var that=this
 				uni.showLoading({
@@ -891,70 +852,22 @@
 		vertical-align: middle;
 		margin-right:5px;
 	}
-	.alert{
-		position: fixed;
-		top: 0;
-		right: 0;
-		bottom: 0;
-		left: 0;
-		overflow: hidden;
-		outline: 0;
-		-webkit-overflow-scrolling: touch;
-		background-color: rgb(0, 0, 0);  
-		filter: alpha(opacity=60);  
-		background-color: rgba(0, 0, 0, 0.6); 
-		z-index: 9999;
-		.auth{
-		  position: absolute;
-		  top: 50%;
-		  left: 50%;
-		  width: 80%;
-		  height: 340rpx;
-		  border-radius: 20rpx;
-		  transform:translate(-50%,-50%);
-		  background: #fff;
-		  display: flex;
-		  flex-direction: column;
-		  .apply{
-			margin: 0rpx auto;
-			padding: 60rpx 40rpx;
-			flex:1;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: space-between;
-			font-size: 34rpx;
-			color:rgb(34,34,34);
-			p{
-			  font-size:30rpx
-			}
-		  }
-		  .confirm{
-			border-top: 1rpx solid rgb(221,221,221);
-			text-align: center;
-			height: 100rpx;
-			width: 100%;
-			line-height: 100rpx;
-			font-size: 34rpx;
-			color:rgb(255,145,37);
-		  }
-		}
-	  }
 	.container {
-		padding-top: 115px;
+		padding-top: 85px;
 		position: relative;
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: #fff;
+		background: url('../../static/img/login/bg.png');
+		background-size:100%;
 	}
 
 	.wrapper {
 		position: relative;
 		z-index: 90;
-		background: #fff;
 		padding-bottom: 40upx;
 		height:100%;
+		padding:0 30px;
 	}
 
 	.back-btn {
@@ -966,130 +879,29 @@
 		font-size: 40upx;
 		color: $font-color-dark;
 	}
-
-	.left-top-sign {
-		font-size: 120upx;
-		color: $page-color-base;
-		position: relative;
-		left: -16upx;
-	}
-
-	.right-top-sign {
-		position: absolute;
-		top: 80upx;
-		right: -30upx;
-		z-index: 95;
-
-		&:before,
-		&:after {
-			display: block;
-			content: "";
-			width: 400upx;
-			height: 80upx;
-			background: #b4f3e2;
-		}
-
-		&:before {
-			transform: rotate(50deg);
-			border-radius: 0 50px 0 0;
-		}
-
-		&:after {
-			position: absolute;
-			right: -198upx;
-			top: 0;
-			transform: rotate(-50deg);
-			border-radius: 50px 0 0 0;
-			/* background: pink; */
-		}
-	}
-
-	.left-bottom-sign {
-		position: absolute;
-		left: -270upx;
-		bottom: -320upx;
-		border: 100upx solid #d0d1fd;
-		border-radius: 50%;
-		padding: 180upx;
-	}
-
-	.welcome {
-		position: relative;
-		left: 50upx;
-		top: -90upx;
-		font-size: 46upx;
-		color: #555;
-		text-shadow: 1px 0px 1px rgba(0, 0, 0, .3);
-	}
-
-	.input-content {
-		padding: 0 60upx;
+	.verificationCode{
+		margin-top:20px;
+		background:#F5F6F9;
+		color:#AFB3BF;
 	}
-
-	.input-item {
-		display: flex;
-		flex-direction: column;
-		align-items: flex-start;
-		justify-content: center;
-		padding: 0 30upx;
-		background: $page-color-light;
-		height: 120upx;
-		border-radius: 4px;
-		margin-bottom: 50upx;
-
-		&:last-child {
-			margin-bottom: 0;
-		}
-
-		.tit {
-			height: 50upx;
-			line-height: 56upx;
-			font-size: $font-sm+2upx;
-			color: $font-color-base;
-		}
-
-		input {
-			height: 60upx;
-			font-size: $font-base + 2upx;
-			color: $font-color-dark;
-			width: 100%;
-		}
+	.verificationCode.active{
+		background:#22C572;
+		color:#fff;
 	}
-
-	.confirm-btn {
-		width: 630upx;
-		height: 76upx;
-		line-height: 76upx;
-		border-radius: 50px;
-		margin-top: 70upx;
-		background: $uni-color-primary;
-		color: #fff;
-		font-size: $font-lg;
-
-		&:after {
-			border-radius: 100px;
-		}
+	.verificationCode:after{
+		border:none;
 	}
-
-	.forget-section {
-		font-size: $font-sm+2upx;
-		color: $font-color-spec;
-		text-align: center;
-		margin-top: 40upx;
+	.register{
+		position:absolute;
+		bottom:20px;
+		left:50%;
+		transform: translateX(-50%);
+		color:#333333;
+		height:50px;
+		line-height:50px;
+		border-radius:30px;border: 1px solid #444444;
 	}
-
-	.register-section {
-		position: absolute;
-		left: 0;
-		bottom: 50upx;
-		width: 100%;
-		font-size: $font-sm+2upx;
-		color: $font-color-base;
-		text-align: center;
-
-		text {
-			color: $font-color-spec;
-			margin-left: 10upx;
-		}
+	.register:after{
+		border:none;
 	}
 </style>

+ 913 - 0
pages/public/login_account_number.vue

@@ -0,0 +1,913 @@
+<template>
+	<view class="container">
+		<view class="back-btn cuIcon-back" @click="navBack"></view>
+		<!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
+		<view class="wrapper">
+			<image style='width:38px;height:38px;margin-bottom:10px;' src='../../static/img/login/logo@2x.png'></image>
+			<h2>欢迎使用易粮易运</h2>
+			<view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
+				<view style='width:15%;border-right:1px solid #E8E9ED;'>+86</view>
+				<view style='width:85%;'><input style='padding-left:10px;' maxlength='11' v-model='phone' placeholder="请输入手机号码" type="text"></view>
+			</view>
+			<view style='margin-top:20px;border-bottom:1px solid #E8E9ED;position:relative;'>
+				<input class='password' style='height:40px;' v-model='password' placeholder="请输入密码,6-16位字符" :type="type" value="" />
+				<view @click='switchover' style='position:absolute;right:0;top:38%;z-index:10;cursor:pointer;' class="iconfont " :class='type=="password"?"icon-yanjing-biyan":"icon-yanjing-zhengyan"'></view>
+			</view>
+			<button :class='phone!=""&&password!=""?"active":""' @click='passlogin' class='verificationCode'>登录</button>
+			<view class='flex' style='color:#6A6A6A;margin-top:10px;'>
+				<view style='flex:1;text-align:center;border-right:1px solid #E8E9ED;'>忘记密码</view>
+				<view @click='gocode' style='flex:1;text-align:center;'>验证码登录</view>
+			</view>
+		    <button class='register'>手机号一键注册</button>
+		</view>5
+		<view v-if="loginType === 'phone'" class="register-section">
+			还没有账号?
+			<text @click="toRegist">马上注册</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapMutations
+	} from 'vuex';
+	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
+	import { queryData, upData, initData } from '../../util/dbUtil.js'
+	export default {
+		data() {
+			return {
+				inputContent: null,
+				loginType: "wechat",
+				phone: '',
+				password: '',
+				logining: false,
+				isPhone: false,
+				isApple: true,
+				accessToken:'',
+				params:{
+					encryptedData:'',
+					session_key:'',
+					iv:'',
+				},
+				userInfo:{
+					nickName:'',
+					avatarUrl:'',
+					gender:'',
+					phone:''
+				},
+				type:'password',
+				inputStatus:'none',
+				verifyCode:null,
+				sendText:'获取验证码',
+				sendDisabled: false,
+				system:'',
+				platform:'',
+				userData:undefined,
+				canIUseProfile:false
+			}
+		},
+		onShow() {
+			// this.loginType = "wechat"
+			this.$api.logout()
+		},
+		onLoad(options) {
+			
+			if( wx.getUserProfile ){  
+			    console.log('--check getUserProfile--OK');  
+			    this.canIUseProfile = true;  
+			} 
+			console.log("login on load")
+			var that = this
+			that.$api.request('user', 'sendIsApple', {
+			}).then(res => {
+				that.isApple = res.data
+			})
+			 uni.getSystemInfo({
+				success:(res) => {
+					// console.log(res)
+					this.system = res.system  // ios
+					this.platform = res.platform  // 14.3
+				}
+			})
+		},
+		methods: {
+			passlogin(e){
+				var that=this
+				uni.showLoading({
+					title: '登录中',
+					mask:true
+				})
+				this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password}).then(res => {
+				    // 获得数据
+					uni.setStorageSync('userInfo', res.data)
+					that.$store.commit('login', res.data)
+					that.liangxinLogin()
+					uni.switchTab({
+						url: '/pages/sale/information'
+					});
+					uni.hideLoading()
+				})
+				.catch(res => {
+				    console.log(res);
+				});
+			},
+			switchover(){
+				if(this.type=='password'){
+					this.type='text'
+				}else{
+					this.type='password'
+				}
+			},
+			gocode(){
+				uni.navigateTo({
+					url:'/pages/public/login'
+				})
+			},
+			forgetpass(){
+				uni.navigateTo({
+					url:'/pages/public/reset'
+				})
+			},
+			phonelogin(){
+				var that=this
+				uni.showLoading({
+					title: '登录中',
+					mask:true
+				})
+				console.log("clientid",that.clientId)
+				this.$api.request('user', 'login',{
+					password:that.password,
+					phone:that.phone,
+					cid:that.clientId
+				}, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			    }).then(res => {
+					console.log(res)
+					uni.setStorageSync('userInfo', res.data)
+					that.$store.commit('login', res.data)
+					that.liangxinLogin()
+					uni.switchTab({
+						url: '/pages/sale/information'
+					});
+					uni.hideLoading()
+				})
+			},
+			appleLogin(){
+			    var that=this
+			    uni.getProvider({
+			     service: 'oauth',
+			     success: function (res) {
+			      // console.log(res.provider)
+			      if(~res.provider.indexOf('apple')) {
+			       uni.login({
+			        provider: 'apple',
+			        success: loginRes => {
+			         uni.getUserInfo({
+			          provider: 'apple',
+			          success: userInfoRes => {
+			           
+			          that.$api.request('user', 'thirdPartLogin', {
+			           loginType: 4/*  */,
+			           raw: JSON.stringify(userInfoRes.userInfo)
+			          }, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			          }).then(res => {
+			           console.log("thirdPartLogin:"+res.data.phone)
+			           that.accessToken = res.data.accessToken
+			           that.logining = false
+			           uni.getUserInfo({
+			            lang: 'zh_CN',
+			            success: (e) => {
+			             uni.setStorageSync('userInfo', res.data)
+			             that.$store.commit('login', res.data)
+			             e.userInfo.nickname = e.userInfo.nickName
+						 e.userInfo.cid = uni.getStorageSync("clientId")
+			             that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+			              //同步过后
+			              res.data.nickname = e.userInfo.nickName
+			              res.data.avatarUrl = e.userInfo.avatarUrl
+			              res.data.gender = e.userInfo.gender
+			              
+			              if(!res.data.phone){
+			               res.data.phone = e.userInfo.phone
+			              }
+			              
+			              uni.setStorageSync('userInfo', res.data)
+			              that.$store.commit('login', res.data)
+			             })
+			            },
+			            complete: (e) => {
+			             uni.hideLoading()
+			             
+			             if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+			              that.isPhone = true//显示自定义的获取手机权限提示框
+			              that.inputStatus = 'inline'
+			              that.inputContent = ''
+			             }
+			             else{
+			              uni.switchTab({
+			               url: '/pages/sale/sale'
+			              });
+			              console.log("complete")
+			             }
+			            }
+			           })
+			           
+			           })
+			           console.log('获取用户信息成功'+JSON.stringify(userInfoRes))
+			          }
+			         })
+			        },
+			        fail: err => {
+			         console.log('apple登录失败' + JSON.stringify(err))
+			         uni.showToast({
+			          title:'登录失败',
+			          icon:'none'
+			         })
+			        }
+			       })
+			      }
+			     },
+			     fail: err => {
+			      uni.showToast({
+			       title:'登录失败',
+			       icon:'none'
+			      })
+			     }
+			    })
+			   },
+			   doGetVerify() {
+				const that = this
+				var phone = this.inputContent;
+				if (!phone || phone.length != 11) {
+					uni.showToast({
+						title:'请输入正确手机号!',
+						icon:'none'
+					})
+					return
+				}
+				
+				that.$api.request('user', 'sendVerifyCode', {
+					phone: phone,
+				}).then(res => {
+					that.sendDisabled = true
+					let sec = 60
+					let interval = setInterval(() => {
+						sec--;
+						that.sendText = sec + 's后重发'
+						if (sec <= 0) {
+							that.sendDisabled = false
+							that.sendText = "获取验证码"
+							clearInterval(interval)
+						}
+					}, 1000)
+				})
+				
+			},
+			verifyCodeInput(e){
+				this.verifyCode = e.detail.value
+			},
+			cancel() {
+				this.inputShow = false
+				this.inputStatus = 'none'
+				this.isPhone = false
+			},
+			confirm() {
+				var that = this
+				if (!this.inputContent || this.inputContent.length != 11) {
+					uni.showToast({
+						title:'请输入正确手机号!',
+						icon:'none'
+					})
+					return
+				}
+				if (!this.verifyCode) {
+					uni.showToast({
+						title:'请输入验证码!',
+						icon:'none'
+					})
+					return
+				}
+				this.$api.request('user', 'mergeUser', {
+					phone: that.inputContent,
+					verifyCode:that.verifyCode
+				},failres => {
+					that.$api.msg(failres.errmsg)
+					uni.hideLoading()
+				}).then(res => {
+					that.accessToken = res.data.accessToken
+					that.$api.setUserInfo(res.data)
+					that.logining = false
+					uni.getUserInfo({
+						lang: 'zh_CN',
+						success: (e) => {
+							uni.setStorageSync('userInfo', res.data)
+							that.$store.commit('login', res.data)
+							e.userInfo.nickname = e.userInfo.nickName
+							e.userInfo.cid = uni.getStorageSync("clientId")
+							console.log(e.userInfo)
+							that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+								//同步过后
+								res.data.nickname = e.userInfo.nickName
+								res.data.avatarUrl = e.userInfo.avatarUrl
+								res.data.gender = e.userInfo.gender
+								res.data.phone = e.userInfo.phone
+								uni.setStorageSync('userInfo', res.data)
+								that.$store.commit('login', res.data)
+								that.liangxinLogin()
+							})
+						},
+						complete: (e) => {
+							uni.switchTab({
+								url: '/pages/sale/information'
+							});
+							uni.hideLoading()
+							that.isPhone=false
+							
+							uni.navigateBack()
+						}
+					})
+				})
+				
+			},
+			...mapMutations(['login']),
+			inputChange(e) {
+				const key = e.currentTarget.dataset.key;
+				this[key] = e.detail.value;
+			},
+			chooseLoginType(type) {
+				this.loginType = type
+			},
+			navBack() {
+				uni.navigateBack();
+			},
+			toRegist() {
+				uni.redirectTo({
+					url: '/pages/public/register'
+				})
+			},
+			///发起消息订阅
+			requestSubscribe(){
+				const that = this
+				wx.requestSubscribeMessage({
+			        tmplIds: ['xL_uZEqJz4QP1FbnlzQWAiO2zVBn3Qeu8JwLVOU3hU0','8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY','IE7WxBsv-fDvPWSrng-97lGWtvZf9rHuECBlhRLlWxI'],//
+			        success :(res)=>{
+			          console.log("订阅消息 成功 "+res);
+			         },
+			        fail :(errMsg) =>{ 
+			          console.log("订阅消息 失败 "+errMsg.errMsg);
+			        },
+			        complete:(errMsg)=>{
+			          console.log("订阅消息 完成 "+errMsg);
+					  
+			        }
+			    
+			      });
+			},
+			getPhoneNumber(e) {
+				
+			  console.log(e)
+			  if (e.mp.detail.errMsg==="getPhoneNumber:ok") {
+				this.isPhone = false
+				this.params.iv = e.mp.detail.iv
+				this.params.encryptedData = e.mp.detail.encryptedData
+				this.params.session_key = this.accessToken
+				console.log(this.params)
+				this.getTokenAsync(this.params)
+			  }
+			  
+			},
+			 // 请求后获取token
+			async getTokenAsync(params) {
+				let that = this
+				this.$api.request('user', 'getPhoneNumber', params).then(res => {
+					 if(res.data.phoneNumber){
+						 that.userInfo.phone = res.data.phoneNumber
+					 }
+					 if(res.data.unionId){
+						 that.userInfo.unionId = res.data.unionId
+					 }
+					 
+					 that.userInfo.cid = uni.getStorageSync("clientId")
+					 console.log(that.userInfo)
+					 that.$api.request('user', 'syncUserInfo', that.userInfo).then(syncRes => {
+					 	uni.setStorageSync('userInfo', that.userInfo)
+					 	that.$store.commit('login', that.userInfo)
+					 	that.$api.setUserInfo(that.userInfo)
+					 	uni.hideLoading()
+						that.liangxinLogin()
+					 }) 
+					 if(res.data.phoneNumber){
+						uni.switchTab({
+							url: '/pages/sale/information'
+						});
+					 }
+					 
+				 })
+			},
+			async toLogin() {
+				this.verifyCode = ''
+				const that = this
+				if (that.phone.length !== 11) {
+					that.$api.msg('请输入11位中国手机号')
+				} else if (that.password.length < 8) {
+					that.$api.msg('密码至少8位')
+				} else {
+					that.logining = true;
+					//#ifdef MP-WEIXIN
+					//若是小程序平台,则获取到openId。整个过程是静默完成的
+					uni.login({
+						provider: 'weixin',
+						success: (wxres => {
+							that.$api.request('user', 'login', {
+								phone: that.phone,
+								password: that.password,
+								loginType: 1,
+								raw: JSON.stringify(wxres)
+							}, failres => {
+								that.logining = false
+								uni.showToast({
+									title: failres.errmsg,
+									icon: "none"
+								});
+							}).then(res => {
+								that.logining = false
+								that.$store.commit('login', res.data)
+								uni.setStorageSync('userInfo', res.data)
+								if (that.$api.prePage().lodaData) {
+									that.$api.prePage().loadData()
+								}
+								uni.navigateBack()
+							})
+						})
+					})
+					//#endif
+					//#ifdef APP-PLUS || H5
+					//若是App登录,则不需要保存OpenId。可直接登录
+					that.$api.request('user', 'login', {
+						phone: that.phone,
+						password: that.password,
+					}, failres => {
+						that.logining = false
+						uni.showToast({
+							title: failres.errmsg,
+							icon: "none"
+						});
+					}).then(res => {
+						that.logining = false
+						that.$store.commit('login', res.data)
+						uni.setStorageSync('userInfo', res.data)
+						if (that.$api.prePage().lodaData) {
+							that.$api.prePage().loadData()
+						}
+						uni.navigateBack()
+					})
+					//#endif
+				}
+			},
+			
+			miniWechatLogin(e) {
+				const that = this
+				 //旧版本方式  
+				if( this.canIUseProfile == false ){  
+					console.log("旧版本方式")
+					//获取授权信息  
+					if(e.detail.userInfo){  
+			
+					console.log('用户允许了授权')  
+					console.log( e.detail.userInfo );   //1.拿到基本的微信信息!!  
+			
+					 uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					 let userInfo = e.detail.userInfo
+					 uni.login({
+					 	provider: 'weixin',
+					 	success: (wxres => {
+					 		that.logining = false
+					 		that.$api.request('user', 'thirdPartLogin', {
+					 			loginType: loginType,
+					 			raw: JSON.stringify(wxres)
+					 		}, failres => {
+					 			that.$api.msg(failres.errmsg)
+					 			uni.hideLoading()
+					 		}).then(res => {
+					 			that.accessToken = res.data.accessToken
+					 			that.$api.setUserInfo(res.data)
+					 			that.userInfo = res.data
+					 			uni.getUserInfo({
+					 				lang: 'zh_CN',
+					 				provider: 'weixin',
+					 				withCredentials:true,
+					 				success: (e) => {
+					 					that.params.iv = e.iv
+					 					that.params.encryptedData = e.encryptedData
+					 					that.params.session_key = that.accessToken
+					 					console.log(this.params)
+					 					that.getTokenAsync(this.params)
+					 					uni.setStorageSync('userInfo', res.data)
+					 					that.$store.commit('login', res.data)
+					 					e.userInfo.nickname = e.userInfo.nickName
+					 					if(e.userInfo.phone == undefined){
+					 						e.userInfo.phone = ''
+					 					}
+										e.userInfo.cid = uni.getStorageSync("clientId")
+					 					console.log(e.userInfo)
+					 					that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+					 						//同步过后
+					 						res.data.nickname = userInfo.nickName
+					 						res.data.avatarUrl = userInfo.avatarUrl
+					 						res.data.gender = userInfo.gender
+					 						if(userInfo.phone){
+					 							res.data.phone = userInfo.phone
+					 							that.liangxinLogin()
+					 						}
+					 						uni.setStorageSync('userInfo', res.data)
+					 						that.$store.commit('login', res.data)
+					 						that.$api.setUserInfo(res.data)
+					 														
+					 						uni.hideLoading()
+					 						// uni.navigateBack()
+					 					})
+					 				},
+					 				complete: (e) => {
+					 					uni.hideLoading()
+					 					
+					 					if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+					 						that.isPhone = true//显示自定义的获取手机权限提示框
+					 						that.inputStatus = 'inline'
+					 						that.inputContent = ''
+					 					}
+					 					else{
+					 						uni.setStorageSync('PageCur', "sale");
+					 						// uni.switchTab({
+					 						// 	url: '/pages/sale/sale'
+					 						// });
+					 						uni.switchTab({
+					 							url: '/pages/sale/information'
+					 						});
+					 						console.log("complete")
+					 					}
+					 				}
+					 			})
+					 		})
+					 	}),
+					 	
+					 })
+			
+					}  
+			
+				//新版本方式  
+				}else{  
+					console.log("新版本方式")
+					uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					wx.getUserProfile({  
+						desc : '用于完善用户资料',  
+						lang : 'zh_CN',  
+						success : function( proRes ){  
+							console.log('proRes.userInfo',proRes.userInfo)
+							uni.login({
+								provider: 'weixin',
+								success: (wxres => {
+									that.logining = false
+									that.$api.request('user', 'thirdPartLogin', {
+										loginType: loginType,
+										raw: JSON.stringify(wxres)
+									}, failres => {
+										that.$api.msg(failres.errmsg)
+										uni.hideLoading()
+									}).then(res => {
+										console.log('res+++++',res)
+										that.accessToken = res.data.accessToken
+										that.$api.setUserInfo(res.data)
+										that.userInfo = res.data
+										// that.params.iv = proRes.iv
+										// that.params.encryptedData = proRes.encryptedData
+										// that.params.session_key = that.accessToken
+										// console.log(that.params)
+										// that.getTokenAsync(that.params)
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+										if(proRes.userInfo.phone == undefined){
+											proRes.userInfo.phone = ''
+										}
+										res.data.cid = uni.getStorageSync("clientId")
+										that.$api.request('user', 'syncUserInfo', res.data).then(syncRes => {
+											//同步过后
+											res.data.nickname = proRes.userInfo.nickName
+											res.data.avatarUrl = proRes.userInfo.avatarUrl
+											res.data.gender = proRes.userInfo.gender
+											if(proRes.userInfo.phone){
+												res.data.phone = proRes.userInfo.phone
+											}
+											uni.setStorageSync('userInfo', res.data)
+											that.$store.commit('login', res.data)
+											that.$api.setUserInfo(res.data)
+											uni.hideLoading()
+											if(!that.userInfo.phone||that.userInfo.phone==""||that.userInfo.phone ==undefined){
+												that.isPhone = true//显示自定义的获取手机权限提示框
+												that.inputStatus = 'inline'
+												that.inputContent = ''
+											}
+											else{
+												uni.setStorageSync('PageCur', "sale");
+												// uni.switchTab({
+												// 	url: '/pages/sale/sale'
+												// });
+												uni.reLaunch({
+													url: '/pages/sale/information'
+												});
+												console.log("complete")
+												that.liangxinLogin()
+											}
+										})		
+										console.log( 'wx.getUserProfile=>用户允许了授权' );
+									})
+								})
+							})
+			
+						},  
+						fail : function( res ){  
+							console.log('wx.getUserProfile=>用户拒绝了授权');  
+							console.log( res );  
+			
+						}
+					});  
+			
+				}  
+				
+				// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
+				// wx.getSetting({
+				//  	 withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
+				//    success(res){
+				// 	debugger
+				//    if(res.subscriptionsSetting.mainSwitch){
+				    
+				//    }else{
+					  
+				// 	}
+				// 	}
+				// })
+				// uni.showModal({
+				// 	  title: '温馨提示',
+				// 	  content: '为更好的与您沟通,小程序需要向您发送通知消息',
+				// 	  confirmText:"同意",
+				// 	  cancelText:"拒绝",
+				// 	  showCancel: false,
+				// 	  success: function (res) {
+				// 		  if (res.confirm) {
+				// 			 //调用订阅消息
+				// 			  that.requestSubscribe();
+				// 		  } else if (res.cancel) {
+				// 			  ///显示第二个弹说明一下
+				// 			  wx.showModal({
+				// 				title: '温馨提示',
+				// 				content: '拒绝后您将无法获取实时的交易、物流消息',
+				// 				confirmText:"知道了",
+				// 				showCancel:false,
+				// 				success: function (res) {
+				// 					 uni.openSetting({ // 打开设置页
+				// 					   success(res) {
+				// 						console.log(res.authSetting)
+				// 					   }
+				// 					 });
+				// 				}
+				// 			});
+				// 		  }
+				// 	  }
+				// });
+				
+				
+
+
+
+			},
+			wechatLogin() {
+				const that = this
+				that.logining = true
+				let loginType = 2
+				uni.showLoading({
+					title: '正在同步消息',
+					mask:true
+				})
+				uni.login({
+					provider: 'weixin',
+					success: (wxres => {
+						that.$api.request('user', 'thirdPartLogin', {
+							loginType: loginType,
+							raw: JSON.stringify(wxres)
+						}, failres => {
+							that.$api.msg(failres.errmsg)
+							uni.hideLoading()
+						}).then(res => {
+							console.log("thirdPartLogin:"+res.data.phone)
+							that.accessToken = res.data.accessToken
+							that.logining = false
+							uni.getUserInfo({
+								lang: 'zh_CN',
+								success: (e) => {
+									uni.setStorageSync('userInfo', res.data)
+									that.$store.commit('login', res.data)
+									e.userInfo.nickname = e.userInfo.nickName
+									e.userInfo.cid = uni.getStorageSync("clientId")
+									console.log(e.userInfo)
+									that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+										//同步过后
+										res.data.nickname = e.userInfo.nickName
+										res.data.avatarUrl = e.userInfo.avatarUrl
+										res.data.gender = e.userInfo.gender
+										if(res.data.phone){
+											res.data.phone = e.userInfo.phone
+											that.liangxinLogin()
+										}
+										
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+									})
+								},
+								complete: (e) => {
+									uni.hideLoading()
+									
+									if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+										that.isPhone = true//显示自定义的获取手机权限提示框
+										that.inputStatus = 'inline'
+										that.inputContent = ''
+									}
+									else{
+										// uni.switchTab({
+										// 	url: '/pages/sale/sale'
+										// });
+										uni.switchTab({
+											url: '/pages/sale/information'
+										});
+										console.log("complete")
+										
+									}
+									
+								}
+							})
+							
+						})
+					})
+				})
+			},
+			wechatH5Login() {
+				const that = this
+				let href = window.location.origin
+				let page = that.$api.prePage()
+				let prePath = '/pages/index/index'
+				if (page) {
+					prePath = page.__page__.path
+				}
+				window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?' 
+				+ 'appid=' + that.$api.defConfig().h5Appid + '&redirect_uri=' + escape(href) + '&response_type=code&scope=snsapi_userinfo&state=' + escape(prePath) + '#wechat_redirect'
+			},
+			liangxinLogin(){
+				const that = this
+				var userInfoTmp = uni.getStorageSync("userInfo")
+				console.log('userInfoTmp',userInfoTmp)
+				console.log(that.$socket)
+				that.$socket.login(userInfoTmp.phone, "123456", null, res=>{
+					console.log('粮信登录',res)
+					if (res.success) {
+						that.$socket.showLoginDialog = false
+						// 缓存用户
+						that.userData = res.response.data
+						console.log('userData',that.userData)
+						that.$u.vuex("userData", that.userData);
+						// 	缓存通讯录
+						that.$socket.listGuests(that.userData.user.operId, res => {						
+							// #ifdef APP-PLUS
+							createFSQL(that.userData.user.operId).then();
+							let contact = res.response.data;
+							contact.forEach(c=>{
+								c.members.forEach(m=>{
+									m.name = c.name;
+									addFSQL(m, that.userData.user.operId).then();
+								})
+							})
+							// #endif
+							that.$u.vuex('firendItem', res.response.data)
+						});
+						
+						// 缓存消息列表
+						that.$socket.queryOnlineMessage(that.userData.user.operId,q =>{
+							let data = q.response.data;
+							for(var i in data){
+								initData(data[i].groupMsg.list, data[i].groupInfo.chatId);
+							}
+						})
+						
+						//	缓存链接
+						that.$socket.getLinks(that.userData.user.operId, res=>{
+							that.$u.vuex('linkItem',res.response.data)
+						});
+						
+						
+						// // 跳转到消息列表
+						// that.$u.route({
+						// 	url: 'pages/home/home',
+						// 	type: 'switchTab'
+						// });
+					} else {
+					  uni.showModal({
+						title:res.reason + ",请稍后再试",
+						showCancel:false
+					  })
+					}
+				});
+			}
+		},
+
+	}
+</script>
+
+<style lang='scss' scoped>
+	
+	.apple{
+		background: #000;
+		width: 35px;
+		height: 35px;
+		padding: 8px;
+		border-radius: 50%;
+		vertical-align: middle;
+	}
+	page {
+		background: #fff;
+	}
+	.password{
+		border:none;
+		outline:none;
+	}
+	.cuIcon-weixin{
+		background: #39b54a;
+		color: #fff;
+		font-size: 18px;
+		padding: 9px;
+		border-radius: 50%;
+		vertical-align: middle;
+		margin-right:5px;
+	}
+	.container {
+		padding-top: 85px;
+		position: relative;
+		width: 100vw;
+		height: 100vh;
+		overflow: hidden;
+		background: url('../../static/img/login/bg.png');
+		background-size:100%;
+	}
+
+	.wrapper {
+		position: relative;
+		z-index: 90;
+		padding-bottom: 40upx;
+		height:100%;
+		padding:0 30px;
+	}
+
+	.back-btn {
+		position: absolute;
+		left: 40upx;
+		z-index: 9999;
+		padding-top: var(--status-bar-height);
+		top: 40upx;
+		font-size: 40upx;
+		color: $font-color-dark;
+	}
+	.verificationCode{
+		margin-top:20px;
+		background:#F5F6F9;
+		color:#AFB3BF;
+	}
+	.verificationCode:after{
+		border:none;
+	}
+	.verificationCode.active{
+		background:#22C572;
+		color:#fff;
+	}
+	.register{
+		position:absolute;
+		bottom:20px;
+		left:50%;
+		transform: translateX(-50%);
+		color:#333333;
+		height:50px;
+		line-height:50px;
+		border-radius:30px;border: 1px solid #444444;
+	}
+	.register:after{
+		border:none;
+	}
+</style>

+ 866 - 192
pages/public/register.vue

@@ -1,87 +1,284 @@
 <template>
 	<view class="container">
-		<view class="left-bottom-sign"></view>
-		<view class="back-btn yticon icon-zuojiantou-up" @click="navBack"></view>
-		<view class="right-top-sign"></view>
-		<!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
+		<view class="back-btn cuIcon-back" @click="navBack"></view>
+		
 		<view class="wrapper">
-			<view class="left-top-sign">REGISTER</view>
-			<view class="welcome">
-				欢迎加入!
+			<h2>手机号注册</h2>
+			<view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
+				<view style='width:15%;border-right:1px solid #E8E9ED;'>+86</view>
+				<view style='width:85%;'><input maxlength="11" v-model='phone' @input='phoneinput' style='padding-left:10px;' placeholder="请输入手机号码" type="text"></view>
 			</view>
-			<view class="input-content">
-				<view class="input-item">
-					<text class="tit">手机号码</text>
-					<input type="number" :value="phone" placeholder="请输入手机号码" maxlength="11" data-key="phone" @input="inputChange" />
-				</view>
-				<view class="input-item">
-					<text class="tit">验证码</text>
-					<view class="verify-code">
-						<input type="mobile" value="" placeholder="6位验证码" maxlength="6"
-						 data-key="verifyCode" @input="inputChange" style="width: 60%;" />
-						<button class="cu-btn bg-green shadow" :disabled="sendDisabled" @click="doGetVerify">{{sendText}}</button>
-					</view>
-				</view>
-				<view class="input-item">
-					<text class="tit">密码</text>
-						<input type="mobile" value="" placeholder="8-18位数字、字母组合" placeholder-class="input-empty" maxlength="20"
-						  data-key="password" @input="inputChange" @confirm="doRegister" />
-				</view>
+			<view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
+				<view style='width:85%;'><input  v-model='verifyCode' placeholder="请输入验证码" type="text"></view>
+				<button :class='codestatus?"active":""' @click='getcode' class='getcode'>{{sendText}}</button>
+			</view>
+			<view style='border-bottom:1px solid #E8E9ED;padding:10px;position:relative;'>
+				<input maxlength='16' class='password' style='height:30px;' v-model='password' placeholder="请输入密码,6-16位字符" :type="type">
+				<view @click='switchover' style='position:absolute;right:0;top:38%;z-index:10;cursor:pointer;' class="iconfont " :class='type=="password"?"icon-yanjing-biyan":"icon-yanjing-zhengyan"'></view>
+			</view>
+			<button  :class='phone!=""&&verifyCode!=""&&password!=""?"active":""' @click='register' class='verificationCode'>注册</button>
+			<view style='color:#6A6A6A;margin-top:10px;text-align:center;'>
+				<image @click='consent' style='width:14px;height:14px;position:relative;top:2px;margin-right:5px;' :src="consentStatus==true?'../../static/img/login/select@2x.png':'../../static/img/login/selected2.png'" alt=""></image>
+					已阅读并同意
+					<navigator url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html" class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
+					 class="path" hover-class="navigator-hover">《隐私政策》</navigator>
 			</view>
-			<button class="confirm-btn" @click="doRegister" :disabled="registering">注册</button>
-			
-		</view>
-		<view class="register-section">
-			已经有账号?
-			<text @click="toLogin">马上登录</text>
 		</view>
 	</view>
 </template>
-
+ 
 <script>
 	import {
 		mapMutations
 	} from 'vuex';
-
+	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
+	import { queryData, upData, initData } from '../../util/dbUtil.js'
 	export default {
 		data() {
 			return {
+				inputContent: null,
+				loginType: "wechat",
 				phone: '',
 				password: '',
-				registering: false,
-				sendText: '获取验证码',
-				sendDisabled: false
+				logining: false,
+				isPhone: false,
+				isApple: true,
+				accessToken:'',
+				params:{
+					encryptedData:'',
+					session_key:'',
+					iv:'',
+				},
+				userInfo:{
+					nickName:'',
+					avatarUrl:'',
+					gender:'',
+					phone:''
+				},
+				consentStatus:false,
+				codestatus:false,
+				type:'password',
+				inputStatus:'none',
+				verifyCode:null,
+				sendText:'获取验证码',
+				sendDisabled: false,
+				system:'',
+				platform:'',
+				userData:undefined,
+				canIUseProfile:false
 			}
 		},
-		onLoad() {
-
+		onShow() {
+			// this.loginType = "wechat"
+			
+			// this.$api.logout()
+		},
+		onLoad(options) {
+			if( wx.getUserProfile ){  
+			    console.log('--check getUserProfile--OK');  
+			    this.canIUseProfile = true;  
+			} 
+			console.log("login on load")
+			var that = this
+			that.$api.request('user', 'sendIsApple', {
+			}).then(res => {
+				that.isApple = res.data
+			})
+			 uni.getSystemInfo({
+				success:(res) => {
+					// console.log(res)
+					this.system = res.system  // ios
+					this.platform = res.platform  // 14.3
+				}
+			})
 		},
 		methods: {
-			...mapMutations(['login']),
-			inputChange(e) {
-				const key = e.currentTarget.dataset.key;
-				this[key] = e.detail.value;
+			phoneinput(e){
+				if(e.detail.value.length==11){
+					this.codestatus=true
+				}
 			},
-			navBack() {
-				uni.navigateBack();
+			getcode(){
+				console.log(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone))
+				if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)){
+					// this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.phone}).then(res => {
+					//                 // 获得数据
+					//                 console.log(res);
+					//             })
+					//             .catch(res => {
+					                uni.showToast({
+						title: res.errmsg,
+						icon:'none',
+						duration: 2000
+					})
+					//             });
+				}else{
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon:'none',
+						duration: 2000
+					})
+				}
+				
 			},
-			toLogin() {
-				uni.redirectTo({
-					url: "/pages/public/login"
+			register(){
+				this.$api.doRequest('post','/commonUser/register',{phone:this.phone,password:this.password,verifyCode:this.verifyCode}).then(res => {
+				    // 获得数据
+				    console.log(res);
+				})
+				.catch(res => {
+				    console.log(res);
+				});
+			},
+			consent(){
+				this.consentStatus=!this.consentStatus
+				uni.setStorage({
+					key: 'policyStorageKey',
+					data: this.consentStatus
+				});
+			},
+			switchover(){
+				if(this.type=='password'){
+					this.type='text'
+				}else{
+					this.type='password'
+				}
+			},
+			gocode(){
+				uni.navigateTo({
+					url:'/pages/public/login'
+				})
+			},
+			forgetpass(){
+				uni.navigateTo({
+					url:'/pages/public/reset'
+				})
+			},
+			phonelogin(){
+				var that=this
+				uni.showLoading({
+					title: '登录中',
+					mask:true
+				})
+				console.log("clientid",that.clientId)
+				this.$api.request('user', 'login',{
+					password:that.password,
+					phone:that.phone,
+					cid:that.clientId
+				}, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			    }).then(res => {
+					console.log(res)
+					uni.setStorageSync('userInfo', res.data)
+					that.$store.commit('login', res.data)
+					that.liangxinLogin()
+					uni.switchTab({
+						url: '/pages/sale/information'
+					});
+					uni.hideLoading()
 				})
 			},
-			doGetVerify() {
+			appleLogin(){
+			    var that=this
+			    uni.getProvider({
+			     service: 'oauth',
+			     success: function (res) {
+			      // console.log(res.provider)
+			      if(~res.provider.indexOf('apple')) {
+			       uni.login({
+			        provider: 'apple',
+			        success: loginRes => {
+			         uni.getUserInfo({
+			          provider: 'apple',
+			          success: userInfoRes => {
+			           
+			          that.$api.request('user', 'thirdPartLogin', {
+			           loginType: 4/*  */,
+			           raw: JSON.stringify(userInfoRes.userInfo)
+			          }, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			          }).then(res => {
+			           console.log("thirdPartLogin:"+res.data.phone)
+			           that.accessToken = res.data.accessToken
+			           that.logining = false
+			           uni.getUserInfo({
+			            lang: 'zh_CN',
+			            success: (e) => {
+			             uni.setStorageSync('userInfo', res.data)
+			             that.$store.commit('login', res.data)
+			             e.userInfo.nickname = e.userInfo.nickName
+						 e.userInfo.cid = uni.getStorageSync("clientId")
+			             that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+			              //同步过后
+			              res.data.nickname = e.userInfo.nickName
+			              res.data.avatarUrl = e.userInfo.avatarUrl
+			              res.data.gender = e.userInfo.gender
+			              
+			              if(!res.data.phone){
+			               res.data.phone = e.userInfo.phone
+			              }
+			              
+			              uni.setStorageSync('userInfo', res.data)
+			              that.$store.commit('login', res.data)
+			             })
+			            },
+			            complete: (e) => {
+			             uni.hideLoading()
+			             
+			             if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+			              that.isPhone = true//显示自定义的获取手机权限提示框
+			              that.inputStatus = 'inline'
+			              that.inputContent = ''
+			             }
+			             else{
+			              uni.switchTab({
+			               url: '/pages/sale/sale'
+			              });
+			              console.log("complete")
+			             }
+			            }
+			           })
+			           
+			           })
+			           console.log('获取用户信息成功'+JSON.stringify(userInfoRes))
+			          }
+			         })
+			        },
+			        fail: err => {
+			         console.log('apple登录失败' + JSON.stringify(err))
+			         uni.showToast({
+			          title:'登录失败',
+			          icon:'none'
+			         })
+			        }
+			       })
+			      }
+			     },
+			     fail: err => {
+			      uni.showToast({
+			       title:'登录失败',
+			       icon:'none'
+			      })
+			     }
+			    })
+			   },
+			   doGetVerify() {
 				const that = this
-				if (!that.phone || that.phone.length != 11) {
+				var phone = this.inputContent;
+				if (!phone || phone.length != 11) {
 					uni.showToast({
 						title:'请输入正确手机号!',
 						icon:'none'
 					})
 					return
 				}
+				
 				that.$api.request('user', 'sendVerifyCode', {
-					phone: that.phone,
+					phone: phone,
 				}).then(res => {
+					that.sendDisabled = true
 					let sec = 60
 					let interval = setInterval(() => {
 						sec--;
@@ -95,25 +292,565 @@
 				})
 				
 			},
-			async doRegister() {
-				const that = this
-				that.registering = true;
-				that.$api.request('user','register', {
-					phone: that.phone,
-					password: that.password,
-					verifyCode: that.verifyCode
-				}, (failres => {
+			verifyCodeInput(e){
+				this.verifyCode = e.detail.value
+			},
+			cancel() {
+				this.inputShow = false
+				this.inputStatus = 'none'
+				this.isPhone = false
+			},
+			confirm() {
+				var that = this
+				if (!this.inputContent || this.inputContent.length != 11) {
 					uni.showToast({
-						title:failres.errmsg
+						title:'请输入正确手机号!',
+						icon:'none'
 					})
-					that.registering = false
-				})).then(res => {
-					//注册成功
-					that.registering = false
-					uni.redirectTo({
-						url: './login'
+					return
+				}
+				if (!this.verifyCode) {
+					uni.showToast({
+						title:'请输入验证码!',
+						icon:'none'
+					})
+					return
+				}
+				this.$api.request('user', 'mergeUser', {
+					phone: that.inputContent,
+					verifyCode:that.verifyCode
+				},failres => {
+					that.$api.msg(failres.errmsg)
+					uni.hideLoading()
+				}).then(res => {
+					that.accessToken = res.data.accessToken
+					that.$api.setUserInfo(res.data)
+					that.logining = false
+					uni.getUserInfo({
+						lang: 'zh_CN',
+						success: (e) => {
+							uni.setStorageSync('userInfo', res.data)
+							that.$store.commit('login', res.data)
+							e.userInfo.nickname = e.userInfo.nickName
+							e.userInfo.cid = uni.getStorageSync("clientId")
+							console.log(e.userInfo)
+							that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+								//同步过后
+								res.data.nickname = e.userInfo.nickName
+								res.data.avatarUrl = e.userInfo.avatarUrl
+								res.data.gender = e.userInfo.gender
+								res.data.phone = e.userInfo.phone
+								uni.setStorageSync('userInfo', res.data)
+								that.$store.commit('login', res.data)
+								that.liangxinLogin()
+							})
+						},
+						complete: (e) => {
+							uni.switchTab({
+								url: '/pages/sale/information'
+							});
+							uni.hideLoading()
+							that.isPhone=false
+							
+							uni.navigateBack()
+						}
 					})
 				})
+				
+			},
+			...mapMutations(['login']),
+			inputChange(e) {
+				const key = e.currentTarget.dataset.key;
+				this[key] = e.detail.value;
+			},
+			chooseLoginType(type) {
+				this.loginType = type
+			},
+			navBack() {
+				uni.navigateBack();
+			},
+			toRegist() {
+				uni.redirectTo({
+					url: '/pages/public/register'
+				})
+			},
+			///发起消息订阅
+			requestSubscribe(){
+				const that = this
+				wx.requestSubscribeMessage({
+			        tmplIds: ['xL_uZEqJz4QP1FbnlzQWAiO2zVBn3Qeu8JwLVOU3hU0','8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY','IE7WxBsv-fDvPWSrng-97lGWtvZf9rHuECBlhRLlWxI'],//
+			        success :(res)=>{
+			          console.log("订阅消息 成功 "+res);
+			         },
+			        fail :(errMsg) =>{ 
+			          console.log("订阅消息 失败 "+errMsg.errMsg);
+			        },
+			        complete:(errMsg)=>{
+			          console.log("订阅消息 完成 "+errMsg);
+					  
+			        }
+			    
+			      });
+			},
+			getPhoneNumber(e) {
+				
+			  console.log(e)
+			  if (e.mp.detail.errMsg==="getPhoneNumber:ok") {
+				this.isPhone = false
+				this.params.iv = e.mp.detail.iv
+				this.params.encryptedData = e.mp.detail.encryptedData
+				this.params.session_key = this.accessToken
+				console.log(this.params)
+				this.getTokenAsync(this.params)
+			  }
+			  
+			},
+			 // 请求后获取token
+			async getTokenAsync(params) {
+				let that = this
+				this.$api.request('user', 'getPhoneNumber', params).then(res => {
+					 if(res.data.phoneNumber){
+						 that.userInfo.phone = res.data.phoneNumber
+					 }
+					 if(res.data.unionId){
+						 that.userInfo.unionId = res.data.unionId
+					 }
+					 
+					 that.userInfo.cid = uni.getStorageSync("clientId")
+					 console.log(that.userInfo)
+					 that.$api.request('user', 'syncUserInfo', that.userInfo).then(syncRes => {
+					 	uni.setStorageSync('userInfo', that.userInfo)
+					 	that.$store.commit('login', that.userInfo)
+					 	that.$api.setUserInfo(that.userInfo)
+					 	uni.hideLoading()
+						that.liangxinLogin()
+					 }) 
+					 if(res.data.phoneNumber){
+						uni.switchTab({
+							url: '/pages/sale/information'
+						});
+					 }
+					 
+				 })
+			},
+			async toLogin() {
+				this.verifyCode = ''
+				const that = this
+				if (that.phone.length !== 11) {
+					that.$api.msg('请输入11位中国手机号')
+				} else if (that.password.length < 8) {
+					that.$api.msg('密码至少8位')
+				} else {
+					that.logining = true;
+					//#ifdef MP-WEIXIN
+					//若是小程序平台,则获取到openId。整个过程是静默完成的
+					uni.login({
+						provider: 'weixin',
+						success: (wxres => {
+							that.$api.request('user', 'login', {
+								phone: that.phone,
+								password: that.password,
+								loginType: 1,
+								raw: JSON.stringify(wxres)
+							}, failres => {
+								that.logining = false
+								uni.showToast({
+									title: failres.errmsg,
+									icon: "none"
+								});
+							}).then(res => {
+								that.logining = false
+								that.$store.commit('login', res.data)
+								uni.setStorageSync('userInfo', res.data)
+								if (that.$api.prePage().lodaData) {
+									that.$api.prePage().loadData()
+								}
+								uni.navigateBack()
+							})
+						})
+					})
+					//#endif
+					//#ifdef APP-PLUS || H5
+					//若是App登录,则不需要保存OpenId。可直接登录
+					that.$api.request('user', 'login', {
+						phone: that.phone,
+						password: that.password,
+					}, failres => {
+						that.logining = false
+						uni.showToast({
+							title: failres.errmsg,
+							icon: "none"
+						});
+					}).then(res => {
+						that.logining = false
+						that.$store.commit('login', res.data)
+						uni.setStorageSync('userInfo', res.data)
+						if (that.$api.prePage().lodaData) {
+							that.$api.prePage().loadData()
+						}
+						uni.navigateBack()
+					})
+					//#endif
+				}
+			},
+			
+			miniWechatLogin(e) {
+				const that = this
+				 //旧版本方式  
+				if( this.canIUseProfile == false ){  
+					console.log("旧版本方式")
+					//获取授权信息  
+					if(e.detail.userInfo){  
+			
+					console.log('用户允许了授权')  
+					console.log( e.detail.userInfo );   //1.拿到基本的微信信息!!  
+			
+					 uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					 let userInfo = e.detail.userInfo
+					 uni.login({
+					 	provider: 'weixin',
+					 	success: (wxres => {
+					 		that.logining = false
+					 		that.$api.request('user', 'thirdPartLogin', {
+					 			loginType: loginType,
+					 			raw: JSON.stringify(wxres)
+					 		}, failres => {
+					 			that.$api.msg(failres.errmsg)
+					 			uni.hideLoading()
+					 		}).then(res => {
+					 			that.accessToken = res.data.accessToken
+					 			that.$api.setUserInfo(res.data)
+					 			that.userInfo = res.data
+					 			uni.getUserInfo({
+					 				lang: 'zh_CN',
+					 				provider: 'weixin',
+					 				withCredentials:true,
+					 				success: (e) => {
+					 					that.params.iv = e.iv
+					 					that.params.encryptedData = e.encryptedData
+					 					that.params.session_key = that.accessToken
+					 					console.log(this.params)
+					 					that.getTokenAsync(this.params)
+					 					uni.setStorageSync('userInfo', res.data)
+					 					that.$store.commit('login', res.data)
+					 					e.userInfo.nickname = e.userInfo.nickName
+					 					if(e.userInfo.phone == undefined){
+					 						e.userInfo.phone = ''
+					 					}
+										e.userInfo.cid = uni.getStorageSync("clientId")
+					 					console.log(e.userInfo)
+					 					that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+					 						//同步过后
+					 						res.data.nickname = userInfo.nickName
+					 						res.data.avatarUrl = userInfo.avatarUrl
+					 						res.data.gender = userInfo.gender
+					 						if(userInfo.phone){
+					 							res.data.phone = userInfo.phone
+					 							that.liangxinLogin()
+					 						}
+					 						uni.setStorageSync('userInfo', res.data)
+					 						that.$store.commit('login', res.data)
+					 						that.$api.setUserInfo(res.data)
+					 														
+					 						uni.hideLoading()
+					 						// uni.navigateBack()
+					 					})
+					 				},
+					 				complete: (e) => {
+					 					uni.hideLoading()
+					 					
+					 					if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+					 						that.isPhone = true//显示自定义的获取手机权限提示框
+					 						that.inputStatus = 'inline'
+					 						that.inputContent = ''
+					 					}
+					 					else{
+					 						uni.setStorageSync('PageCur', "sale");
+					 						// uni.switchTab({
+					 						// 	url: '/pages/sale/sale'
+					 						// });
+					 						uni.switchTab({
+					 							url: '/pages/sale/information'
+					 						});
+					 						console.log("complete")
+					 					}
+					 				}
+					 			})
+					 		})
+					 	}),
+					 	
+					 })
+			
+					}  
+			
+				//新版本方式  
+				}else{  
+					console.log("新版本方式")
+					uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					wx.getUserProfile({  
+						desc : '用于完善用户资料',  
+						lang : 'zh_CN',  
+						success : function( proRes ){  
+							console.log('proRes.userInfo',proRes.userInfo)
+							uni.login({
+								provider: 'weixin',
+								success: (wxres => {
+									that.logining = false
+									that.$api.request('user', 'thirdPartLogin', {
+										loginType: loginType,
+										raw: JSON.stringify(wxres)
+									}, failres => {
+										that.$api.msg(failres.errmsg)
+										uni.hideLoading()
+									}).then(res => {
+										console.log('res+++++',res)
+										that.accessToken = res.data.accessToken
+										that.$api.setUserInfo(res.data)
+										that.userInfo = res.data
+										// that.params.iv = proRes.iv
+										// that.params.encryptedData = proRes.encryptedData
+										// that.params.session_key = that.accessToken
+										// console.log(that.params)
+										// that.getTokenAsync(that.params)
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+										if(proRes.userInfo.phone == undefined){
+											proRes.userInfo.phone = ''
+										}
+										res.data.cid = uni.getStorageSync("clientId")
+										that.$api.request('user', 'syncUserInfo', res.data).then(syncRes => {
+											//同步过后
+											res.data.nickname = proRes.userInfo.nickName
+											res.data.avatarUrl = proRes.userInfo.avatarUrl
+											res.data.gender = proRes.userInfo.gender
+											if(proRes.userInfo.phone){
+												res.data.phone = proRes.userInfo.phone
+											}
+											uni.setStorageSync('userInfo', res.data)
+											that.$store.commit('login', res.data)
+											that.$api.setUserInfo(res.data)
+											uni.hideLoading()
+											if(!that.userInfo.phone||that.userInfo.phone==""||that.userInfo.phone ==undefined){
+												that.isPhone = true//显示自定义的获取手机权限提示框
+												that.inputStatus = 'inline'
+												that.inputContent = ''
+											}
+											else{
+												uni.setStorageSync('PageCur', "sale");
+												// uni.switchTab({
+												// 	url: '/pages/sale/sale'
+												// });
+												uni.reLaunch({
+													url: '/pages/sale/information'
+												});
+												console.log("complete")
+												that.liangxinLogin()
+											}
+										})		
+										console.log( 'wx.getUserProfile=>用户允许了授权' );
+									})
+								})
+							})
+			
+						},  
+						fail : function( res ){  
+							console.log('wx.getUserProfile=>用户拒绝了授权');  
+							console.log( res );  
+			
+						}
+					});  
+			
+				}  
+				
+				// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
+				// wx.getSetting({
+				//  	 withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
+				//    success(res){
+				// 	debugger
+				//    if(res.subscriptionsSetting.mainSwitch){
+				    
+				//    }else{
+					  
+				// 	}
+				// 	}
+				// })
+				// uni.showModal({
+				// 	  title: '温馨提示',
+				// 	  content: '为更好的与您沟通,小程序需要向您发送通知消息',
+				// 	  confirmText:"同意",
+				// 	  cancelText:"拒绝",
+				// 	  showCancel: false,
+				// 	  success: function (res) {
+				// 		  if (res.confirm) {
+				// 			 //调用订阅消息
+				// 			  that.requestSubscribe();
+				// 		  } else if (res.cancel) {
+				// 			  ///显示第二个弹说明一下
+				// 			  wx.showModal({
+				// 				title: '温馨提示',
+				// 				content: '拒绝后您将无法获取实时的交易、物流消息',
+				// 				confirmText:"知道了",
+				// 				showCancel:false,
+				// 				success: function (res) {
+				// 					 uni.openSetting({ // 打开设置页
+				// 					   success(res) {
+				// 						console.log(res.authSetting)
+				// 					   }
+				// 					 });
+				// 				}
+				// 			});
+				// 		  }
+				// 	  }
+				// });
+				
+				
+
+
+
+			},
+			wechatLogin() {
+				const that = this
+				that.logining = true
+				let loginType = 2
+				uni.showLoading({
+					title: '正在同步消息',
+					mask:true
+				})
+				uni.login({
+					provider: 'weixin',
+					success: (wxres => {
+						that.$api.request('user', 'thirdPartLogin', {
+							loginType: loginType,
+							raw: JSON.stringify(wxres)
+						}, failres => {
+							that.$api.msg(failres.errmsg)
+							uni.hideLoading()
+						}).then(res => {
+							console.log("thirdPartLogin:"+res.data.phone)
+							that.accessToken = res.data.accessToken
+							that.logining = false
+							uni.getUserInfo({
+								lang: 'zh_CN',
+								success: (e) => {
+									uni.setStorageSync('userInfo', res.data)
+									that.$store.commit('login', res.data)
+									e.userInfo.nickname = e.userInfo.nickName
+									e.userInfo.cid = uni.getStorageSync("clientId")
+									console.log(e.userInfo)
+									that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+										//同步过后
+										res.data.nickname = e.userInfo.nickName
+										res.data.avatarUrl = e.userInfo.avatarUrl
+										res.data.gender = e.userInfo.gender
+										if(res.data.phone){
+											res.data.phone = e.userInfo.phone
+											that.liangxinLogin()
+										}
+										
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+									})
+								},
+								complete: (e) => {
+									uni.hideLoading()
+									
+									if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+										that.isPhone = true//显示自定义的获取手机权限提示框
+										that.inputStatus = 'inline'
+										that.inputContent = ''
+									}
+									else{
+										// uni.switchTab({
+										// 	url: '/pages/sale/sale'
+										// });
+										uni.switchTab({
+											url: '/pages/sale/information'
+										});
+										console.log("complete")
+										
+									}
+									
+								}
+							})
+							
+						})
+					})
+				})
+			},
+			wechatH5Login() {
+				const that = this
+				let href = window.location.origin
+				let page = that.$api.prePage()
+				let prePath = '/pages/index/index'
+				if (page) {
+					prePath = page.__page__.path
+				}
+				window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?' 
+				+ 'appid=' + that.$api.defConfig().h5Appid + '&redirect_uri=' + escape(href) + '&response_type=code&scope=snsapi_userinfo&state=' + escape(prePath) + '#wechat_redirect'
+			},
+			liangxinLogin(){
+				const that = this
+				var userInfoTmp = uni.getStorageSync("userInfo")
+				console.log('userInfoTmp',userInfoTmp)
+				that.$socket.login(userInfoTmp.phone, "123456", null, res=>{
+					console.log('粮信登录',res)
+					if (res.success) {
+						that.$socket.showLoginDialog = false
+						// 缓存用户
+						that.userData = res.response.data
+						console.log('userData',that.userData)
+						that.$u.vuex("userData", that.userData);
+						// 	缓存通讯录
+						that.$socket.listGuests(that.userData.user.operId, res => {						
+							// #ifdef APP-PLUS
+							createFSQL(that.userData.user.operId).then();
+							let contact = res.response.data;
+							contact.forEach(c=>{
+								c.members.forEach(m=>{
+									m.name = c.name;
+									addFSQL(m, that.userData.user.operId).then();
+								})
+							})
+							// #endif
+							that.$u.vuex('firendItem', res.response.data)
+						});
+						
+						// 缓存消息列表
+						that.$socket.queryOnlineMessage(that.userData.user.operId,q =>{
+							let data = q.response.data;
+							for(var i in data){
+								initData(data[i].groupMsg.list, data[i].groupInfo.chatId);
+							}
+						})
+						
+						//	缓存链接
+						that.$socket.getLinks(that.userData.user.operId, res=>{
+							that.$u.vuex('linkItem',res.response.data)
+						});
+						
+						
+						// // 跳转到消息列表
+						// that.$u.route({
+						// 	url: 'pages/home/home',
+						// 	type: 'switchTab'
+						// });
+					} else {
+					  uni.showModal({
+						title:res.reason + ",请稍后再试",
+						showCancel:false
+					  })
+					}
+				});
 			}
 		},
 
@@ -121,24 +858,46 @@
 </script>
 
 <style lang='scss' scoped>
+	.password{
+		border:none;
+		outline: none;
+	}
+	.apple{
+		background: #000;
+		width: 35px;
+		height: 35px;
+		padding: 8px;
+		border-radius: 50%;
+		vertical-align: middle;
+	}
 	page {
 		background: #fff;
 	}
-
+	.cuIcon-weixin{
+		background: #39b54a;
+		color: #fff;
+		font-size: 18px;
+		padding: 9px;
+		border-radius: 50%;
+		vertical-align: middle;
+		margin-right:5px;
+	}
 	.container {
-		padding-top: 115px;
+		padding-top: 85px;
 		position: relative;
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: #fff;
+		background: url('../../static/img/login/bg.png');
+		background-size:100%;
 	}
 
 	.wrapper {
 		position: relative;
 		z-index: 90;
-		background: #fff;
 		padding-bottom: 40upx;
+		height:100%;
+		padding:0 30px;
 	}
 
 	.back-btn {
@@ -150,137 +909,52 @@
 		font-size: 40upx;
 		color: $font-color-dark;
 	}
-
-	.left-top-sign {
-		font-size: 120upx;
-		color: $page-color-base;
-		position: relative;
-		left: -16upx;
+	.verificationCode{
+		margin-top:20px;
+		background:#F5F6F9;
+		color:#AFB3BF;
 	}
-
-	.right-top-sign {
-		position: absolute;
-		top: 80upx;
-		right: -30upx;
-		z-index: 95;
-
-		&:before,
-		&:after {
-			display: block;
-			content: "";
-			width: 400upx;
-			height: 80upx;
-			background: #b4f3e2;
-		}
-
-		&:before {
-			transform: rotate(50deg);
-			border-radius: 0 50px 0 0;
-		}
-
-		&:after {
-			position: absolute;
-			right: -198upx;
-			top: 0;
-			transform: rotate(-50deg);
-			border-radius: 50px 0 0 0;
-			/* background: pink; */
-		}
+	.verificationCode:after{
+		border:none;
 	}
-
-	.left-bottom-sign {
-		position: absolute;
-		left: -270upx;
-		bottom: -320upx;
-		border: 100upx solid #d0d1fd;
-		border-radius: 50%;
-		padding: 180upx;
+	.register{
+		position:absolute;
+		bottom:20px;
+		left:50%;
+		transform: translateX(-50%);
+		color:#333333;
+		height:50px;
+		line-height:50px;
+		border-radius:30px;border: 1px solid #444444;
 	}
-
-	.welcome {
-		position: relative;
-		left: 50upx;
-		top: -90upx;
-		font-size: 46upx;
-		color: #555;
-		text-shadow: 1px 0px 1px rgba(0, 0, 0, .3);
+	.register:after{
+		border:none;
 	}
-
-	.input-content {
-		padding: 0 60upx;
+	.verificationCode.active{
+		background:#22C572;
+		color:#fff;
 	}
-
-	.input-item {
-		display: flex;
-		flex-direction: column;
-		align-items: flex-start;
-		justify-content: center;
-		padding: 0 30upx;
-		background: $page-color-light;
-		height: 140upx;
-		border-radius: 4px;
-		margin-bottom: 50upx;
-
-		&:last-child {
-			margin-bottom: 0;
-		}
-
-		.tit {
-			height: 50upx;
-			line-height: 56upx;
-			font-size: $font-sm+2upx;
-			color: $font-color-base;
-		}
-
-		input {
-			height: 60upx;
-			font-size: $font-base + 2upx;
-			color: $font-color-dark;
-			width: 100%;
-		}
+	.getcode{
+		font-size:14px;
+		position:absolute;
+		right:0;
+		top:50%;
+		transform: translateY(-50%);
+		color:#AFB3BF;
+		background:#F5F6F9;
+		height:30px;
+		line-height:30px;
 		
-		.verify-code {
-			flex-direction: row;
-			display: flex;
-			justify-content:end; 
-			flex-wrap: wrap
-		}
 	}
-
-	.confirm-btn {
-		width: 630upx;
-		height: 76upx;
-		line-height: 76upx;
-		border-radius: 50px;
-		margin-top: 70upx;
-		background: $uni-color-primary;
-		color: #fff;
-		font-size: $font-lg;
-
-		&:after {
-			border-radius: 100px;
-		}
+	.getcode:after{
+		border:none;
 	}
-
-	.forget-section {
-		font-size: $font-sm+2upx;
-		color: $font-color-spec;
-		text-align: center;
-		margin-top: 40upx;
+	uni-navigator{
+		display:inline-block;
+		color:#22C572;
 	}
-
-	.register-section {
-		position: absolute;
-		left: 0;
-		bottom: 50upx;
-		width: 100%;
-		font-size: $font-sm+2upx;
-		color: $font-color-base;
-		text-align: center;
-
-		text {
-			color: $font-color-spec;
-			margin-left: 10upx;
-		}
+	.getcode.active{
+		background:#22C572;
+		color:#fff;
 	}
 </style>

+ 986 - 0
pages/public/reset.vue

@@ -0,0 +1,986 @@
+<template>
+	<view class="container">
+		<view class="back-btn cuIcon-back" @click="navBack"></view>
+		<!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
+		
+		<view class="wrapper">
+			<h2>重置密码</h2>
+			<view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
+				<view style='width:15%;border-right:1px solid #E8E9ED;'>+86</view>
+				<view style='width:85%;'><input maxlength="11" @input='phoneinput' style='padding-left:10px;' v-model='phone' placeholder="请输入手机号码" type="text"></view>
+			</view>
+			<view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
+				<view style='width:85%;'><input v-model='verifyCode' placeholder="请输入验证码" type="text"></view>
+				<button @click='getcode' :class='status&&!sendDisabled?"active":""' class='getcode'>{{sendText}}</button>
+			</view>
+			<view style='border-bottom:1px solid #E8E9ED;padding:10px;position:relative;'>
+				<input class='password' style='height:30px;' v-model='password' placeholder="请输入新密码,6-16位字符" :type="type" value="" />
+				<view @click='switchover' style='position:absolute;right:0;top:38%;z-index:10;cursor:pointer;' class="iconfont " :class='type=="password"?"icon-yanjing-biyan":"icon-yanjing-zhengyan"'></view>
+			</view>
+			<button :class='phone!=""&&verifyCode!=""&&password!=""?"active":""' @click='reset' class='verificationCode'>重置密码</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapMutations
+	} from 'vuex';
+	import { openFSqlite, createFSQL, selectFSQL, addFSQL } from '../../util/f.js'
+	import { queryData, upData, initData } from '../../util/dbUtil.js'
+	export default {
+		data() {
+			return {
+				inputContent: null,
+				loginType: "wechat",
+				phone: '',
+				password: '',
+				logining: false,
+				isPhone: false,
+				isApple: true,
+				accessToken:'',
+				params:{
+					encryptedData:'',
+					session_key:'',
+					iv:'',
+				},
+				status:false,
+				userInfo:{
+					nickName:'',
+					avatarUrl:'',
+					gender:'',
+					phone:''
+				},
+				consentStatus:false,
+				type:'password',
+				inputStatus:'none',
+				verifyCode:null,
+				sendText:'获取验证码',
+				sendDisabled: false,
+				system:'',
+				platform:'',
+				userData:undefined,
+				canIUseProfile:false
+			}
+		},
+		onShow() {
+			// this.loginType = "wechat"
+			this.$api.logout()
+		},
+		onLoad(options) {
+			
+			if( wx.getUserProfile ){  
+			    console.log('--check getUserProfile--OK');  
+			    this.canIUseProfile = true;  
+			} 
+			console.log("login on load")
+			var that = this
+			that.$api.request('user', 'sendIsApple', {
+			}).then(res => {
+				that.isApple = res.data
+			})
+			 uni.getSystemInfo({
+				success:(res) => {
+					// console.log(res)
+					this.system = res.system  // ios
+					this.platform = res.platform  // 14.3
+				}
+			})
+		},
+		methods: {
+			phoneinput(e){
+				if(e.detail.value.length==11){
+					this.status=true
+				}
+			},
+			getcode(e){
+				if(this.phone.length!=11){
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon:'none',
+						duration: 2000
+					})
+					return
+				}
+				if(/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)){
+				var that=this
+					this.$api.doRequest('get','/commonUser/sendVerifyCode',{phone:this.phone}).then(res => {
+					that.sendDisabled = true
+					let sec = 60
+					let interval = setInterval(() => {
+						sec--;
+						that.sendText = sec + 's后重发'
+						if (sec <= 0) {
+							that.sendDisabled = false
+							that.sendText = "获取验证码"
+							clearInterval(interval)
+						}
+					}, 1000)
+					})
+					.catch(res => {
+					    uni.showToast({
+							title: res.errMsg,
+							icon:'none',
+							duration: 2000
+						})
+					 });
+				}else{
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon:'none',
+						duration: 2000
+					})
+				}
+			},
+			reset(){
+				var that = this
+				this.$api.doRequest('post','/commonUser/resetPassword',{phone:this.phone,password:this.password,verifyCode:this.verifyCode}).then(res => {
+				    // 获得数据
+				    console.log(res);
+					uni.showLoading({
+						title: '登录中',
+						mask:true
+					})
+					this.$api.doRequest('get','/commonUser/login',{phone:this.phone,password:this.password}).then(res => {
+					uni.setStorageSync('userInfo', res.data)
+					that.$store.commit('login', res.data)
+					that.liangxinLogin()
+					uni.switchTab({
+						url: '/pages/sale/information'
+					});
+					uni.hideLoading()
+					})
+					.catch(res => {
+					    console.log(res);
+					});
+				})
+				.catch(res => {
+				    console.log(res);
+				});
+			},
+			consent(){
+				this.consentStatus=!this.consentStatus
+				uni.setStorage({
+					key: 'policyStorageKey',
+					data: this.consentStatus
+				});
+			},
+			switchover(){
+				if(this.type=='password'){
+					this.type='text'
+				}else{
+					this.type='password'
+				}
+			},
+			gocode(){
+				uni.navigateTo({
+					url:'/pages/public/login'
+				})
+			},
+			forgetpass(){
+				uni.navigateTo({
+					url:'/pages/public/reset'
+				})
+			},
+			phonelogin(){
+				var that=this
+				uni.showLoading({
+					title: '登录中',
+					mask:true
+				})
+				console.log("clientid",that.clientId)
+				this.$api.request('user', 'login',{
+					password:that.password,
+					phone:that.phone,
+					cid:that.clientId
+				}, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			    }).then(res => {
+					console.log(res)
+					uni.setStorageSync('userInfo', res.data)
+					that.$store.commit('login', res.data)
+					that.liangxinLogin()
+					uni.switchTab({
+						url: '/pages/sale/information'
+					});
+					uni.hideLoading()
+				})
+			},
+			appleLogin(){
+			    var that=this
+			    uni.getProvider({
+			     service: 'oauth',
+			     success: function (res) {
+			      // console.log(res.provider)
+			      if(~res.provider.indexOf('apple')) {
+			       uni.login({
+			        provider: 'apple',
+			        success: loginRes => {
+			         uni.getUserInfo({
+			          provider: 'apple',
+			          success: userInfoRes => {
+			           
+			          that.$api.request('user', 'thirdPartLogin', {
+			           loginType: 4/*  */,
+			           raw: JSON.stringify(userInfoRes.userInfo)
+			          }, failres => {
+			           that.$api.msg(failres.errmsg)
+			           uni.hideLoading()
+			          }).then(res => {
+			           console.log("thirdPartLogin:"+res.data.phone)
+			           that.accessToken = res.data.accessToken
+			           that.logining = false
+			           uni.getUserInfo({
+			            lang: 'zh_CN',
+			            success: (e) => {
+			             uni.setStorageSync('userInfo', res.data)
+			             that.$store.commit('login', res.data)
+			             e.userInfo.nickname = e.userInfo.nickName
+						 e.userInfo.cid = uni.getStorageSync("clientId")
+			             that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+			              //同步过后
+			              res.data.nickname = e.userInfo.nickName
+			              res.data.avatarUrl = e.userInfo.avatarUrl
+			              res.data.gender = e.userInfo.gender
+			              
+			              if(!res.data.phone){
+			               res.data.phone = e.userInfo.phone
+			              }
+			              
+			              uni.setStorageSync('userInfo', res.data)
+			              that.$store.commit('login', res.data)
+			             })
+			            },
+			            complete: (e) => {
+			             uni.hideLoading()
+			             
+			             if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+			              that.isPhone = true//显示自定义的获取手机权限提示框
+			              that.inputStatus = 'inline'
+			              that.inputContent = ''
+			             }
+			             else{
+			              uni.switchTab({
+			               url: '/pages/sale/sale'
+			              });
+			              console.log("complete")
+			             }
+			            }
+			           })
+			           
+			           })
+			           console.log('获取用户信息成功'+JSON.stringify(userInfoRes))
+			          }
+			         })
+			        },
+			        fail: err => {
+			         console.log('apple登录失败' + JSON.stringify(err))
+			         uni.showToast({
+			          title:'登录失败',
+			          icon:'none'
+			         })
+			        }
+			       })
+			      }
+			     },
+			     fail: err => {
+			      uni.showToast({
+			       title:'登录失败',
+			       icon:'none'
+			      })
+			     }
+			    })
+			   },
+			   doGetVerify() {
+				const that = this
+				var phone = this.inputContent;
+				if (!phone || phone.length != 11) {
+					uni.showToast({
+						title:'请输入正确手机号!',
+						icon:'none'
+					})
+					return
+				}
+				
+				that.$api.request('user', 'sendVerifyCode', {
+					phone: phone,
+				}).then(res => {
+					that.sendDisabled = true
+					let sec = 60
+					let interval = setInterval(() => {
+						sec--;
+						that.sendText = sec + 's后重发'
+						if (sec <= 0) {
+							that.sendDisabled = false
+							that.sendText = "获取验证码"
+							clearInterval(interval)
+						}
+					}, 1000)
+				})
+				
+			},
+			cancel() {
+				this.inputShow = false
+				this.inputStatus = 'none'
+				this.isPhone = false
+			},
+			confirm() {
+				var that = this
+				if (!this.inputContent || this.inputContent.length != 11) {
+					uni.showToast({
+						title:'请输入正确手机号!',
+						icon:'none'
+					})
+					return
+				}
+				if (!this.verifyCode) {
+					uni.showToast({
+						title:'请输入验证码!',
+						icon:'none'
+					})
+					return
+				}
+				this.$api.request('user', 'mergeUser', {
+					phone: that.inputContent,
+					verifyCode:that.verifyCode
+				},failres => {
+					that.$api.msg(failres.errmsg)
+					uni.hideLoading()
+				}).then(res => {
+					that.accessToken = res.data.accessToken
+					that.$api.setUserInfo(res.data)
+					that.logining = false
+					uni.getUserInfo({
+						lang: 'zh_CN',
+						success: (e) => {
+							uni.setStorageSync('userInfo', res.data)
+							that.$store.commit('login', res.data)
+							e.userInfo.nickname = e.userInfo.nickName
+							e.userInfo.cid = uni.getStorageSync("clientId")
+							console.log(e.userInfo)
+							that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+								//同步过后
+								res.data.nickname = e.userInfo.nickName
+								res.data.avatarUrl = e.userInfo.avatarUrl
+								res.data.gender = e.userInfo.gender
+								res.data.phone = e.userInfo.phone
+								uni.setStorageSync('userInfo', res.data)
+								that.$store.commit('login', res.data)
+								that.liangxinLogin()
+							})
+						},
+						complete: (e) => {
+							uni.switchTab({
+								url: '/pages/sale/information'
+							});
+							uni.hideLoading()
+							that.isPhone=false
+							
+							uni.navigateBack()
+						}
+					})
+				})
+				
+			},
+			...mapMutations(['login']),
+			inputChange(e) {
+				const key = e.currentTarget.dataset.key;
+				this[key] = e.detail.value;
+			},
+			chooseLoginType(type) {
+				this.loginType = type
+			},
+			navBack() {
+				uni.navigateBack();
+			},
+			toRegist() {
+				uni.redirectTo({
+					url: '/pages/public/register'
+				})
+			},
+			///发起消息订阅
+			requestSubscribe(){
+				const that = this
+				wx.requestSubscribeMessage({
+			        tmplIds: ['xL_uZEqJz4QP1FbnlzQWAiO2zVBn3Qeu8JwLVOU3hU0','8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY','IE7WxBsv-fDvPWSrng-97lGWtvZf9rHuECBlhRLlWxI'],//
+			        success :(res)=>{
+			          console.log("订阅消息 成功 "+res);
+			         },
+			        fail :(errMsg) =>{ 
+			          console.log("订阅消息 失败 "+errMsg.errMsg);
+			        },
+			        complete:(errMsg)=>{
+			          console.log("订阅消息 完成 "+errMsg);
+					  
+			        }
+			    
+			      });
+			},
+			getPhoneNumber(e) {
+				
+			  console.log(e)
+			  if (e.mp.detail.errMsg==="getPhoneNumber:ok") {
+				this.isPhone = false
+				this.params.iv = e.mp.detail.iv
+				this.params.encryptedData = e.mp.detail.encryptedData
+				this.params.session_key = this.accessToken
+				console.log(this.params)
+				this.getTokenAsync(this.params)
+			  }
+			  
+			},
+			 // 请求后获取token
+			async getTokenAsync(params) {
+				let that = this
+				this.$api.request('user', 'getPhoneNumber', params).then(res => {
+					 if(res.data.phoneNumber){
+						 that.userInfo.phone = res.data.phoneNumber
+					 }
+					 if(res.data.unionId){
+						 that.userInfo.unionId = res.data.unionId
+					 }
+					 
+					 that.userInfo.cid = uni.getStorageSync("clientId")
+					 console.log(that.userInfo)
+					 that.$api.request('user', 'syncUserInfo', that.userInfo).then(syncRes => {
+					 	uni.setStorageSync('userInfo', that.userInfo)
+					 	that.$store.commit('login', that.userInfo)
+					 	that.$api.setUserInfo(that.userInfo)
+					 	uni.hideLoading()
+						that.liangxinLogin()
+					 }) 
+					 if(res.data.phoneNumber){
+						uni.switchTab({
+							url: '/pages/sale/information'
+						});
+					 }
+					 
+				 })
+			},
+			async toLogin() {
+				this.verifyCode = ''
+				const that = this
+				if (that.phone.length !== 11) {
+					that.$api.msg('请输入11位中国手机号')
+				} else if (that.password.length < 8) {
+					that.$api.msg('密码至少8位')
+				} else {
+					that.logining = true;
+					//#ifdef MP-WEIXIN
+					//若是小程序平台,则获取到openId。整个过程是静默完成的
+					uni.login({
+						provider: 'weixin',
+						success: (wxres => {
+							that.$api.request('user', 'login', {
+								phone: that.phone,
+								password: that.password,
+								loginType: 1,
+								raw: JSON.stringify(wxres)
+							}, failres => {
+								that.logining = false
+								uni.showToast({
+									title: failres.errmsg,
+									icon: "none"
+								});
+							}).then(res => {
+								that.logining = false
+								that.$store.commit('login', res.data)
+								uni.setStorageSync('userInfo', res.data)
+								if (that.$api.prePage().lodaData) {
+									that.$api.prePage().loadData()
+								}
+								uni.navigateBack()
+							})
+						})
+					})
+					//#endif
+					//#ifdef APP-PLUS || H5
+					//若是App登录,则不需要保存OpenId。可直接登录
+					that.$api.request('user', 'login', {
+						phone: that.phone,
+						password: that.password,
+					}, failres => {
+						that.logining = false
+						uni.showToast({
+							title: failres.errmsg,
+							icon: "none"
+						});
+					}).then(res => {
+						that.logining = false
+						that.$store.commit('login', res.data)
+						uni.setStorageSync('userInfo', res.data)
+						if (that.$api.prePage().lodaData) {
+							that.$api.prePage().loadData()
+						}
+						uni.navigateBack()
+					})
+					//#endif
+				}
+			},
+			
+			miniWechatLogin(e) {
+				const that = this
+				 //旧版本方式  
+				if( this.canIUseProfile == false ){  
+					console.log("旧版本方式")
+					//获取授权信息  
+					if(e.detail.userInfo){  
+			
+					console.log('用户允许了授权')  
+					console.log( e.detail.userInfo );   //1.拿到基本的微信信息!!  
+			
+					 uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					 let userInfo = e.detail.userInfo
+					 uni.login({
+					 	provider: 'weixin',
+					 	success: (wxres => {
+					 		that.logining = false
+					 		that.$api.request('user', 'thirdPartLogin', {
+					 			loginType: loginType,
+					 			raw: JSON.stringify(wxres)
+					 		}, failres => {
+					 			that.$api.msg(failres.errmsg)
+					 			uni.hideLoading()
+					 		}).then(res => {
+					 			that.accessToken = res.data.accessToken
+					 			that.$api.setUserInfo(res.data)
+					 			that.userInfo = res.data
+					 			uni.getUserInfo({
+					 				lang: 'zh_CN',
+					 				provider: 'weixin',
+					 				withCredentials:true,
+					 				success: (e) => {
+					 					that.params.iv = e.iv
+					 					that.params.encryptedData = e.encryptedData
+					 					that.params.session_key = that.accessToken
+					 					console.log(this.params)
+					 					that.getTokenAsync(this.params)
+					 					uni.setStorageSync('userInfo', res.data)
+					 					that.$store.commit('login', res.data)
+					 					e.userInfo.nickname = e.userInfo.nickName
+					 					if(e.userInfo.phone == undefined){
+					 						e.userInfo.phone = ''
+					 					}
+										e.userInfo.cid = uni.getStorageSync("clientId")
+					 					console.log(e.userInfo)
+					 					that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+					 						//同步过后
+					 						res.data.nickname = userInfo.nickName
+					 						res.data.avatarUrl = userInfo.avatarUrl
+					 						res.data.gender = userInfo.gender
+					 						if(userInfo.phone){
+					 							res.data.phone = userInfo.phone
+					 							that.liangxinLogin()
+					 						}
+					 						uni.setStorageSync('userInfo', res.data)
+					 						that.$store.commit('login', res.data)
+					 						that.$api.setUserInfo(res.data)
+					 														
+					 						uni.hideLoading()
+					 						// uni.navigateBack()
+					 					})
+					 				},
+					 				complete: (e) => {
+					 					uni.hideLoading()
+					 					
+					 					if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+					 						that.isPhone = true//显示自定义的获取手机权限提示框
+					 						that.inputStatus = 'inline'
+					 						that.inputContent = ''
+					 					}
+					 					else{
+					 						uni.setStorageSync('PageCur', "sale");
+					 						// uni.switchTab({
+					 						// 	url: '/pages/sale/sale'
+					 						// });
+					 						uni.switchTab({
+					 							url: '/pages/sale/information'
+					 						});
+					 						console.log("complete")
+					 					}
+					 				}
+					 			})
+					 		})
+					 	}),
+					 	
+					 })
+			
+					}  
+			
+				//新版本方式  
+				}else{  
+					console.log("新版本方式")
+					uni.showLoading({
+					 	title: '加载中',
+						mask:true
+					 })
+					 that.logining = true
+					 let loginType = 1
+					wx.getUserProfile({  
+						desc : '用于完善用户资料',  
+						lang : 'zh_CN',  
+						success : function( proRes ){  
+							console.log('proRes.userInfo',proRes.userInfo)
+							uni.login({
+								provider: 'weixin',
+								success: (wxres => {
+									that.logining = false
+									that.$api.request('user', 'thirdPartLogin', {
+										loginType: loginType,
+										raw: JSON.stringify(wxres)
+									}, failres => {
+										that.$api.msg(failres.errmsg)
+										uni.hideLoading()
+									}).then(res => {
+										console.log('res+++++',res)
+										that.accessToken = res.data.accessToken
+										that.$api.setUserInfo(res.data)
+										that.userInfo = res.data
+										// that.params.iv = proRes.iv
+										// that.params.encryptedData = proRes.encryptedData
+										// that.params.session_key = that.accessToken
+										// console.log(that.params)
+										// that.getTokenAsync(that.params)
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+										if(proRes.userInfo.phone == undefined){
+											proRes.userInfo.phone = ''
+										}
+										res.data.cid = uni.getStorageSync("clientId")
+										that.$api.request('user', 'syncUserInfo', res.data).then(syncRes => {
+											//同步过后
+											res.data.nickname = proRes.userInfo.nickName
+											res.data.avatarUrl = proRes.userInfo.avatarUrl
+											res.data.gender = proRes.userInfo.gender
+											if(proRes.userInfo.phone){
+												res.data.phone = proRes.userInfo.phone
+											}
+											uni.setStorageSync('userInfo', res.data)
+											that.$store.commit('login', res.data)
+											that.$api.setUserInfo(res.data)
+											uni.hideLoading()
+											if(!that.userInfo.phone||that.userInfo.phone==""||that.userInfo.phone ==undefined){
+												that.isPhone = true//显示自定义的获取手机权限提示框
+												that.inputStatus = 'inline'
+												that.inputContent = ''
+											}
+											else{
+												uni.setStorageSync('PageCur', "sale");
+												// uni.switchTab({
+												// 	url: '/pages/sale/sale'
+												// });
+												uni.reLaunch({
+													url: '/pages/sale/information'
+												});
+												console.log("complete")
+												that.liangxinLogin()
+											}
+										})		
+										console.log( 'wx.getUserProfile=>用户允许了授权' );
+									})
+								})
+							})
+			
+						},  
+						fail : function( res ){  
+							console.log('wx.getUserProfile=>用户拒绝了授权');  
+							console.log( res );  
+			
+						}
+					});  
+			
+				}  
+				
+				// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
+				// wx.getSetting({
+				//  	 withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
+				//    success(res){
+				// 	debugger
+				//    if(res.subscriptionsSetting.mainSwitch){
+				    
+				//    }else{
+					  
+				// 	}
+				// 	}
+				// })
+				// uni.showModal({
+				// 	  title: '温馨提示',
+				// 	  content: '为更好的与您沟通,小程序需要向您发送通知消息',
+				// 	  confirmText:"同意",
+				// 	  cancelText:"拒绝",
+				// 	  showCancel: false,
+				// 	  success: function (res) {
+				// 		  if (res.confirm) {
+				// 			 //调用订阅消息
+				// 			  that.requestSubscribe();
+				// 		  } else if (res.cancel) {
+				// 			  ///显示第二个弹说明一下
+				// 			  wx.showModal({
+				// 				title: '温馨提示',
+				// 				content: '拒绝后您将无法获取实时的交易、物流消息',
+				// 				confirmText:"知道了",
+				// 				showCancel:false,
+				// 				success: function (res) {
+				// 					 uni.openSetting({ // 打开设置页
+				// 					   success(res) {
+				// 						console.log(res.authSetting)
+				// 					   }
+				// 					 });
+				// 				}
+				// 			});
+				// 		  }
+				// 	  }
+				// });
+				
+				
+
+
+
+			},
+			wechatLogin() {
+				const that = this
+				that.logining = true
+				let loginType = 2
+				uni.showLoading({
+					title: '正在同步消息',
+					mask:true
+				})
+				uni.login({
+					provider: 'weixin',
+					success: (wxres => {
+						that.$api.request('user', 'thirdPartLogin', {
+							loginType: loginType,
+							raw: JSON.stringify(wxres)
+						}, failres => {
+							that.$api.msg(failres.errmsg)
+							uni.hideLoading()
+						}).then(res => {
+							console.log("thirdPartLogin:"+res.data.phone)
+							that.accessToken = res.data.accessToken
+							that.logining = false
+							uni.getUserInfo({
+								lang: 'zh_CN',
+								success: (e) => {
+									uni.setStorageSync('userInfo', res.data)
+									that.$store.commit('login', res.data)
+									e.userInfo.nickname = e.userInfo.nickName
+									e.userInfo.cid = uni.getStorageSync("clientId")
+									console.log(e.userInfo)
+									that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
+										//同步过后
+										res.data.nickname = e.userInfo.nickName
+										res.data.avatarUrl = e.userInfo.avatarUrl
+										res.data.gender = e.userInfo.gender
+										if(res.data.phone){
+											res.data.phone = e.userInfo.phone
+											that.liangxinLogin()
+										}
+										
+										uni.setStorageSync('userInfo', res.data)
+										that.$store.commit('login', res.data)
+									})
+								},
+								complete: (e) => {
+									uni.hideLoading()
+									
+									if(!res.data.phone||res.data.phone==""||res.data.phone ==undefined){
+										that.isPhone = true//显示自定义的获取手机权限提示框
+										that.inputStatus = 'inline'
+										that.inputContent = ''
+									}
+									else{
+										// uni.switchTab({
+										// 	url: '/pages/sale/sale'
+										// });
+										uni.switchTab({
+											url: '/pages/sale/information'
+										});
+										console.log("complete")
+										
+									}
+									
+								}
+							})
+							
+						})
+					})
+				})
+			},
+			wechatH5Login() {
+				const that = this
+				let href = window.location.origin
+				let page = that.$api.prePage()
+				let prePath = '/pages/index/index'
+				if (page) {
+					prePath = page.__page__.path
+				}
+				window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?' 
+				+ 'appid=' + that.$api.defConfig().h5Appid + '&redirect_uri=' + escape(href) + '&response_type=code&scope=snsapi_userinfo&state=' + escape(prePath) + '#wechat_redirect'
+			},
+			liangxinLogin(){
+				const that = this
+				var userInfoTmp = uni.getStorageSync("userInfo")
+				console.log('userInfoTmp',userInfoTmp)
+				that.$socket.login(userInfoTmp.phone, "123456", null, res=>{
+					console.log('粮信登录',res)
+					if (res.success) {
+						that.$socket.showLoginDialog = false
+						// 缓存用户
+						that.userData = res.response.data
+						console.log('userData',that.userData)
+						that.$u.vuex("userData", that.userData);
+						// 	缓存通讯录
+						that.$socket.listGuests(that.userData.user.operId, res => {						
+							// #ifdef APP-PLUS
+							createFSQL(that.userData.user.operId).then();
+							let contact = res.response.data;
+							contact.forEach(c=>{
+								c.members.forEach(m=>{
+									m.name = c.name;
+									addFSQL(m, that.userData.user.operId).then();
+								})
+							})
+							// #endif
+							that.$u.vuex('firendItem', res.response.data)
+						});
+						
+						// 缓存消息列表
+						that.$socket.queryOnlineMessage(that.userData.user.operId,q =>{
+							let data = q.response.data;
+							for(var i in data){
+								initData(data[i].groupMsg.list, data[i].groupInfo.chatId);
+							}
+						})
+						
+						//	缓存链接
+						that.$socket.getLinks(that.userData.user.operId, res=>{
+							that.$u.vuex('linkItem',res.response.data)
+						});
+						
+						
+						// // 跳转到消息列表
+						// that.$u.route({
+						// 	url: 'pages/home/home',
+						// 	type: 'switchTab'
+						// });
+					} else {
+					  uni.showModal({
+						title:res.reason + ",请稍后再试",
+						showCancel:false
+					  })
+					}
+				});
+			}
+		},
+
+	}
+</script>
+
+<style lang='scss' scoped>
+	
+	.apple{
+		background: #000;
+		width: 35px;
+		height: 35px;
+		padding: 8px;
+		border-radius: 50%;
+		vertical-align: middle;
+	}
+	page {
+		background: #fff;
+	}
+	.cuIcon-weixin{
+		background: #39b54a;
+		color: #fff;
+		font-size: 18px;
+		padding: 9px;
+		border-radius: 50%;
+		vertical-align: middle;
+		margin-right:5px;
+	}
+	.container {
+		padding-top: 85px;
+		position: relative;
+		width: 100vw;
+		height: 100vh;
+		overflow: hidden;
+		background: url('../../static/img/login/bg.png');
+		background-size:100%;
+	}
+
+	.wrapper {
+		position: relative;
+		z-index: 90;
+		padding-bottom: 40upx;
+		height:100%;
+		padding:0 30px;
+	}
+
+	.back-btn {
+		position: absolute;
+		left: 40upx;
+		z-index: 9999;
+		padding-top: var(--status-bar-height);
+		top: 40upx;
+		font-size: 40upx;
+		color: $font-color-dark;
+	}
+	.verificationCode{
+		margin-top:20px;
+		background:#F5F6F9;
+		color:#AFB3BF;
+	}
+	.verificationCode:after{
+		border:none;
+	}
+	.verificationCode.active{
+		background:#22C572;
+		color:#fff;
+	}
+	.register{
+		position:absolute;
+		bottom:20px;
+		left:50%;
+		transform: translateX(-50%);
+		color:#333333;
+		height:50px;
+		line-height:50px;
+		border-radius:30px;border: 1px solid #444444;
+	}
+	.register:after{
+		border:none;
+	}
+	.getcode{
+		font-size:14px;
+		position:absolute;
+		right:0;
+		top:50%;
+		transform: translateY(-50%);
+		color:#AFB3BF;
+		background:#F5F6F9;
+		height:30px;
+		line-height:30px;
+		
+	}
+	.password{
+		border:none;
+		outline: none;
+	}
+	.getcode:after{
+		border:none;
+	}
+	.getcode.active{
+		background:#22C572;
+		color:#fff;
+	}
+	uni-navigator{
+		display:inline-block;
+		color:#22C572;
+	}
+</style>

+ 539 - 0
static/iconfont/demo.css

@@ -0,0 +1,539 @@
+/* Logo 字体 */
+@font-face {
+  font-family: "iconfont logo";
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
+}
+
+.logo {
+  font-family: "iconfont logo";
+  font-size: 160px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+/* tabs */
+.nav-tabs {
+  position: relative;
+}
+
+.nav-tabs .nav-more {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  height: 42px;
+  line-height: 42px;
+  color: #666;
+}
+
+#tabs {
+  border-bottom: 1px solid #eee;
+}
+
+#tabs li {
+  cursor: pointer;
+  width: 100px;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  font-size: 16px;
+  border-bottom: 2px solid transparent;
+  position: relative;
+  z-index: 1;
+  margin-bottom: -1px;
+  color: #666;
+}
+
+
+#tabs .active {
+  border-bottom-color: #f00;
+  color: #222;
+}
+
+.tab-container .content {
+  display: none;
+}
+
+/* 页面布局 */
+.main {
+  padding: 30px 100px;
+  width: 960px;
+  margin: 0 auto;
+}
+
+.main .logo {
+  color: #333;
+  text-align: left;
+  margin-bottom: 30px;
+  line-height: 1;
+  height: 110px;
+  margin-top: -50px;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.main .logo a {
+  font-size: 160px;
+  color: #333;
+}
+
+.helps {
+  margin-top: 40px;
+}
+
+.helps pre {
+  padding: 20px;
+  margin: 10px 0;
+  border: solid 1px #e7e1cd;
+  background-color: #fffdef;
+  overflow: auto;
+}
+
+.icon_lists {
+  width: 100% !important;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.icon_lists li {
+  width: 100px;
+  margin-bottom: 10px;
+  margin-right: 20px;
+  text-align: center;
+  list-style: none !important;
+  cursor: default;
+}
+
+.icon_lists li .code-name {
+  line-height: 1.2;
+}
+
+.icon_lists .icon {
+  display: block;
+  height: 100px;
+  line-height: 100px;
+  font-size: 42px;
+  margin: 10px auto;
+  color: #333;
+  -webkit-transition: font-size 0.25s linear, width 0.25s linear;
+  -moz-transition: font-size 0.25s linear, width 0.25s linear;
+  transition: font-size 0.25s linear, width 0.25s linear;
+}
+
+.icon_lists .icon:hover {
+  font-size: 100px;
+}
+
+.icon_lists .svg-icon {
+  /* 通过设置 font-size 来改变图标大小 */
+  width: 1em;
+  /* 图标和文字相邻时,垂直对齐 */
+  vertical-align: -0.15em;
+  /* 通过设置 color 来改变 SVG 的颜色/fill */
+  fill: currentColor;
+  /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
+      normalize.css 中也包含这行 */
+  overflow: hidden;
+}
+
+.icon_lists li .name,
+.icon_lists li .code-name {
+  color: #666;
+}
+
+/* markdown 样式 */
+.markdown {
+  color: #666;
+  font-size: 14px;
+  line-height: 1.8;
+}
+
+.highlight {
+  line-height: 1.5;
+}
+
+.markdown img {
+  vertical-align: middle;
+  max-width: 100%;
+}
+
+.markdown h1 {
+  color: #404040;
+  font-weight: 500;
+  line-height: 40px;
+  margin-bottom: 24px;
+}
+
+.markdown h2,
+.markdown h3,
+.markdown h4,
+.markdown h5,
+.markdown h6 {
+  color: #404040;
+  margin: 1.6em 0 0.6em 0;
+  font-weight: 500;
+  clear: both;
+}
+
+.markdown h1 {
+  font-size: 28px;
+}
+
+.markdown h2 {
+  font-size: 22px;
+}
+
+.markdown h3 {
+  font-size: 16px;
+}
+
+.markdown h4 {
+  font-size: 14px;
+}
+
+.markdown h5 {
+  font-size: 12px;
+}
+
+.markdown h6 {
+  font-size: 12px;
+}
+
+.markdown hr {
+  height: 1px;
+  border: 0;
+  background: #e9e9e9;
+  margin: 16px 0;
+  clear: both;
+}
+
+.markdown p {
+  margin: 1em 0;
+}
+
+.markdown>p,
+.markdown>blockquote,
+.markdown>.highlight,
+.markdown>ol,
+.markdown>ul {
+  width: 80%;
+}
+
+.markdown ul>li {
+  list-style: circle;
+}
+
+.markdown>ul li,
+.markdown blockquote ul>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown>ul li p,
+.markdown>ol li p {
+  margin: 0.6em 0;
+}
+
+.markdown ol>li {
+  list-style: decimal;
+}
+
+.markdown>ol li,
+.markdown blockquote ol>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown code {
+  margin: 0 3px;
+  padding: 0 5px;
+  background: #eee;
+  border-radius: 3px;
+}
+
+.markdown strong,
+.markdown b {
+  font-weight: 600;
+}
+
+.markdown>table {
+  border-collapse: collapse;
+  border-spacing: 0px;
+  empty-cells: show;
+  border: 1px solid #e9e9e9;
+  width: 95%;
+  margin-bottom: 24px;
+}
+
+.markdown>table th {
+  white-space: nowrap;
+  color: #333;
+  font-weight: 600;
+}
+
+.markdown>table th,
+.markdown>table td {
+  border: 1px solid #e9e9e9;
+  padding: 8px 16px;
+  text-align: left;
+}
+
+.markdown>table th {
+  background: #F7F7F7;
+}
+
+.markdown blockquote {
+  font-size: 90%;
+  color: #999;
+  border-left: 4px solid #e9e9e9;
+  padding-left: 0.8em;
+  margin: 1em 0;
+}
+
+.markdown blockquote p {
+  margin: 0;
+}
+
+.markdown .anchor {
+  opacity: 0;
+  transition: opacity 0.3s ease;
+  margin-left: 8px;
+}
+
+.markdown .waiting {
+  color: #ccc;
+}
+
+.markdown h1:hover .anchor,
+.markdown h2:hover .anchor,
+.markdown h3:hover .anchor,
+.markdown h4:hover .anchor,
+.markdown h5:hover .anchor,
+.markdown h6:hover .anchor {
+  opacity: 1;
+  display: inline-block;
+}
+
+.markdown>br,
+.markdown>p>br {
+  clear: both;
+}
+
+
+.hljs {
+  display: block;
+  background: white;
+  padding: 0.5em;
+  color: #333333;
+  overflow-x: auto;
+}
+
+.hljs-comment,
+.hljs-meta {
+  color: #969896;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-strong,
+.hljs-emphasis,
+.hljs-quote {
+  color: #df5000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+  color: #a71d5d;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute {
+  color: #0086b3;
+}
+
+.hljs-section,
+.hljs-name {
+  color: #63a35c;
+}
+
+.hljs-tag {
+  color: #333333;
+}
+
+.hljs-title,
+.hljs-attr,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+  color: #795da3;
+}
+
+.hljs-addition {
+  color: #55a532;
+  background-color: #eaffea;
+}
+
+.hljs-deletion {
+  color: #bd2c00;
+  background-color: #ffecec;
+}
+
+.hljs-link {
+  text-decoration: underline;
+}
+
+/* 代码高亮 */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+code[class*="language-"],
+pre[class*="language-"] {
+  color: black;
+  background: none;
+  text-shadow: 0 1px white;
+  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+  text-align: left;
+  white-space: pre;
+  word-spacing: normal;
+  word-break: normal;
+  word-wrap: normal;
+  line-height: 1.5;
+
+  -moz-tab-size: 4;
+  -o-tab-size: 4;
+  tab-size: 4;
+
+  -webkit-hyphens: none;
+  -moz-hyphens: none;
+  -ms-hyphens: none;
+  hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection,
+pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection,
+code[class*="language-"] ::-moz-selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection,
+pre[class*="language-"] ::selection,
+code[class*="language-"]::selection,
+code[class*="language-"] ::selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+@media print {
+
+  code[class*="language-"],
+  pre[class*="language-"] {
+    text-shadow: none;
+  }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+  padding: 1em;
+  margin: .5em 0;
+  overflow: auto;
+}
+
+:not(pre)>code[class*="language-"],
+pre[class*="language-"] {
+  background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre)>code[class*="language-"] {
+  padding: .1em;
+  border-radius: .3em;
+  white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+  color: slategray;
+}
+
+.token.punctuation {
+  color: #999;
+}
+
+.namespace {
+  opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+  color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+  color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+  color: #9a6e3a;
+  background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+  color: #07a;
+}
+
+.token.function,
+.token.class-name {
+  color: #DD4A68;
+}
+
+.token.regex,
+.token.important,
+.token.variable {
+  color: #e90;
+}
+
+.token.important,
+.token.bold {
+  font-weight: bold;
+}
+
+.token.italic {
+  font-style: italic;
+}
+
+.token.entity {
+  cursor: help;
+}

+ 234 - 0
static/iconfont/demo_index.html

@@ -0,0 +1,234 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8"/>
+  <title>iconfont Demo</title>
+  <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
+  <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
+  <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
+  <link rel="stylesheet" href="demo.css">
+  <link rel="stylesheet" href="iconfont.css">
+  <script src="iconfont.js"></script>
+  <!-- jQuery -->
+  <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
+  <!-- 代码高亮 -->
+  <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
+  <style>
+    .main .logo {
+      margin-top: 0;
+      height: auto;
+    }
+
+    .main .logo a {
+      display: flex;
+      align-items: center;
+    }
+
+    .main .logo .sub-title {
+      margin-left: 0.5em;
+      font-size: 22px;
+      color: #fff;
+      background: linear-gradient(-45deg, #3967FF, #B500FE);
+      -webkit-background-clip: text;
+      -webkit-text-fill-color: transparent;
+    }
+  </style>
+</head>
+<body>
+  <div class="main">
+    <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
+      <img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
+      
+    </a></h1>
+    <div class="nav-tabs">
+      <ul id="tabs" class="dib-box">
+        <li class="dib active"><span>Unicode</span></li>
+        <li class="dib"><span>Font class</span></li>
+        <li class="dib"><span>Symbol</span></li>
+      </ul>
+      
+      <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=2689912" target="_blank" class="nav-more">查看项目</a>
+      
+    </div>
+    <div class="tab-container">
+      <div class="content unicode" style="display: block;">
+          <ul class="icon_lists dib-box">
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe63a;</span>
+                <div class="name">眼睛-睁眼</div>
+                <div class="code-name">&amp;#xe63a;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe63b;</span>
+                <div class="name">眼睛-闭眼</div>
+                <div class="code-name">&amp;#xe63b;</div>
+              </li>
+          
+          </ul>
+          <div class="article markdown">
+          <h2 id="unicode-">Unicode 引用</h2>
+          <hr>
+
+          <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
+          <ul>
+            <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
+            <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
+          </ul>
+          <blockquote>
+            <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
+          </blockquote>
+          <p>Unicode 使用步骤如下:</p>
+          <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
+<pre><code class="language-css"
+>@font-face {
+  font-family: 'iconfont';
+  src: url('iconfont.woff2?t=1626844777898') format('woff2'),
+       url('iconfont.woff?t=1626844777898') format('woff'),
+       url('iconfont.ttf?t=1626844777898') format('truetype');
+}
+</code></pre>
+          <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
+<pre><code class="language-css"
+>.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+</code></pre>
+          <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
+<pre>
+<code class="language-html"
+>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
+</code></pre>
+          <blockquote>
+            <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
+          </blockquote>
+          </div>
+      </div>
+      <div class="content font-class">
+        <ul class="icon_lists dib-box">
+          
+          <li class="dib">
+            <span class="icon iconfont icon-yanjing-zhengyan"></span>
+            <div class="name">
+              眼睛-睁眼
+            </div>
+            <div class="code-name">.icon-yanjing-zhengyan
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-yanjing-biyan"></span>
+            <div class="name">
+              眼睛-闭眼
+            </div>
+            <div class="code-name">.icon-yanjing-biyan
+            </div>
+          </li>
+          
+        </ul>
+        <div class="article markdown">
+        <h2 id="font-class-">font-class 引用</h2>
+        <hr>
+
+        <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
+        <p>与 Unicode 使用方式相比,具有如下特点:</p>
+        <ul>
+          <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
+          <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
+        </ul>
+        <p>使用步骤如下:</p>
+        <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
+<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
+</code></pre>
+        <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
+<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
+</code></pre>
+        <blockquote>
+          <p>"
+            iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
+        </blockquote>
+      </div>
+      </div>
+      <div class="content symbol">
+          <ul class="icon_lists dib-box">
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-yanjing-zhengyan"></use>
+                </svg>
+                <div class="name">眼睛-睁眼</div>
+                <div class="code-name">#icon-yanjing-zhengyan</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-yanjing-biyan"></use>
+                </svg>
+                <div class="name">眼睛-闭眼</div>
+                <div class="code-name">#icon-yanjing-biyan</div>
+            </li>
+          
+          </ul>
+          <div class="article markdown">
+          <h2 id="symbol-">Symbol 引用</h2>
+          <hr>
+
+          <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
+            这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
+          <ul>
+            <li>支持多色图标了,不再受单色限制。</li>
+            <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
+            <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
+            <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
+          </ul>
+          <p>使用步骤如下:</p>
+          <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
+<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
+</code></pre>
+          <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
+<pre><code class="language-html">&lt;style&gt;
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+&lt;/style&gt;
+</code></pre>
+          <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
+<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
+  &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
+&lt;/svg&gt;
+</code></pre>
+          </div>
+      </div>
+
+    </div>
+  </div>
+  <script>
+  $(document).ready(function () {
+      $('.tab-container .content:first').show()
+
+      $('#tabs li').click(function (e) {
+        var tabContent = $('.tab-container .content')
+        var index = $(this).index()
+
+        if ($(this).hasClass('active')) {
+          return
+        } else {
+          $('#tabs li').removeClass('active')
+          $(this).addClass('active')
+
+          tabContent.hide().eq(index).fadeIn()
+        }
+      })
+    })
+  </script>
+</body>
+</html>

+ 24 - 0
static/iconfont/iconfont.css

@@ -0,0 +1,24 @@
+@font-face {
+  font-family: 'iconfont';  /* Project id 2689912 */
+  src: url('https://at.alicdn.com/t/font_2689912_fw9nxtj4xak.woff2?t=1626845532530') format('woff2'),
+       url('https://at.alicdn.com/t/font_2689912_fw9nxtj4xak.woff?t=1626845532530') format('woff'),
+       url('https://at.alicdn.com/t/font_2689912_fw9nxtj4xak.ttf?t=1626845532530') format('truetype');
+}
+
+
+.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-yanjing-zhengyan:before {
+  content: "\e63a";
+}
+
+.icon-yanjing-biyan:before {
+  content: "\e63b";
+}
+

ファイルの差分が大きいため隠しています
+ 0 - 0
static/iconfont/iconfont.js


+ 23 - 0
static/iconfont/iconfont.json

@@ -0,0 +1,23 @@
+{
+  "id": "2689912",
+  "name": "易粮易运app",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon-",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "10715457",
+      "name": "眼睛-睁眼",
+      "font_class": "yanjing-zhengyan",
+      "unicode": "e63a",
+      "unicode_decimal": 58938
+    },
+    {
+      "icon_id": "10715460",
+      "name": "眼睛-闭眼",
+      "font_class": "yanjing-biyan",
+      "unicode": "e63b",
+      "unicode_decimal": 58939
+    }
+  ]
+}

BIN
static/iconfont/iconfont.ttf


BIN
static/iconfont/iconfont.woff


BIN
static/iconfont/iconfont.woff2


BIN
static/img/login/bg.png


BIN
static/img/login/bg@2x.png


BIN
static/img/login/bg@3x.png


BIN
static/img/login/logo.png


BIN
static/img/login/logo@2x.png


BIN
static/img/login/logo@3x.png


BIN
static/img/login/select.png


BIN
static/img/login/select@2x.png


BIN
static/img/login/select@3x.png


BIN
static/img/login/selected1.png


BIN
static/img/login/selected2.png


BIN
static/img/login/selected3.png


+ 3 - 0
webim.js

@@ -141,6 +141,9 @@ const WEBIM = {
 			let pages = getCurrentPages();
 			let curPage = pages[pages.length-1];
 			if(curPage.$page.fullPath != '/pages/public/login'
+			&& curPage.$page.fullPath != '/pages/public/login_account_number'
+			&& curPage.$page.fullPath != '/pages/public/register'
+			&& curPage.$page.fullPath != '/pages/public/code'
 			 && curPage.$page.fullPath != '/pages/public/reset'
 			 && curPage.$page.fullPath != '/pages/index/index'
 			 && curPage.$page.fullPath != '/pages/sale/index'

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません