Explorar o código

注册手机号、客服中心等修复

李万涛 hai 1 ano
pai
achega
86a04d9102
Modificáronse 5 ficheiros con 114 adicións e 78 borrados
  1. 1 1
      pages/robot/index.vue
  2. 59 42
      pages/user/public/kefu.vue
  3. 33 29
      pages/user/signin.vue
  4. 21 6
      pages/user/user.vue
  5. BIN=BIN
      static/kefu1.jpg

+ 1 - 1
pages/robot/index.vue

xqd
@@ -172,7 +172,7 @@
 		},
 		onHide() {
 			// 清除定时器
-			clearInterval(this.timer)
+			// clearInterval(this.timer)
 		},
 		onShow() {
 			// console.log('当前时间戳:', Date.now() + 180000);

+ 59 - 42
pages/user/public/kefu.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -1,8 +1,8 @@
 <template>
 	<view>
 		<view style="color: #fff;">
-		<tn-nav-bar :bottomShadow="false" backgroundColor="#26B3A0">客服中心</tn-nav-bar>
-		<view :style="{height: tobheight+'px'}"></view>
+			<tn-nav-bar :bottomShadow="false" backgroundColor="#26B3A0">客服中心</tn-nav-bar>
+			<view :style="{height: tobheight+'px'}"></view>
 		</view>
 		<view class="server">
 			<image src="/static/images/kefu.png" mode=""></image>
@@ -10,13 +10,15 @@
 		<view v-if="appInfo.kf_tel" class="kefu">
 			<view class="dian"></view>
 			<view class="">客服手机号:{{appInfo.kf_tel}}</view>
-			<view class="yijian"><u-button @click="bohao" color="#26B3A0" size="mini" type="primary" shape="circle" text="一键拨号"></u-button></view>
+			<view class="yijian"><u-button @click="bohao" color="#26B3A0" size="mini" type="primary" shape="circle"
+					text="一键拨号"></u-button></view>
 		</view>
 		<view v-if="appInfo.kf_wechat" class="kefu">
-			<view class="dian" ></view>
-			<view >客服微信号:{{appInfo.kf_wechat}}</view>
-			<view class="yijian"><u-button @click="fhuzhi" color="#26B3A0" size="mini" type="primary" shape="circle" text="一键复制"></u-button></view>
-			
+			<view class="dian"></view>
+			<view>客服微信号:{{appInfo.kf_wechat}}</view>
+			<view class="yijian"><u-button @click="fhuzhi" color="#26B3A0" size="mini" type="primary" shape="circle"
+					text="一键复制"></u-button></view>
+
 		</view>
 		<!-- <view class="sds">dfhsfsdh25</view> -->
 		<block v-if="appInfo.kf_qrcode_path">
@@ -28,27 +30,37 @@
 				<image @click="viewsave(appInfo.kf_qrcode_path)" :src="appInfo.kf_qrcode_path" mode="widthFix"></image>
 			</view>
 		</block>
-		
-		
+
+
 		<wike-loading-page :isLoading="isLoading"></wike-loading-page>
 	</view>
 </template>
 
 <script>
-	import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
+	import {
+		mapMutations,
+		mapActions,
+		mapState,
+		mapGetters
+	} from 'vuex';
 	export default {
 		data() {
 			return {
-				tobheight:45,
+				tobheight: 45,
 				platform: this.$platform.get(),
-				isLoading:true,
-				themeColor:'#007AFF',
-				codeBgColor:'#26B3A0',
-				content:'if(daur){this.fhdj = fgjf}'
+				isLoading: true,
+				themeColor: '#007AFF',
+				codeBgColor: '#26B3A0',
+				content: 'if(daur){this.fhdj = fgjf}',
+				appInfo: {
+					kf_qrcode_path: require('@/static/kefu1.jpg'),
+					kf_wechat: '18981831779',
+					kf_tel: '18981831779'
+				}
 			}
 		},
 		computed: {
-			...mapGetters(['appInfo'])
+			// ...mapGetters(['appInfo'])
 		},
 		watch: {
 			appInfo: function(e) {
@@ -59,33 +71,33 @@
 			}
 		},
 		onLoad() {
-			if(this.platform == 'wxMiniProgram'){
-			var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
-			var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
-			this.tobheight = (menumtop+paddingtop+uni.getMenuButtonBoundingClientRect().height)
+			if (this.platform == 'wxMiniProgram') {
+				var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
+				var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
+				this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
 			}
 			this.isLoading = false
 		},
 		methods: {
-			viewsave(e){
+			viewsave(e) {
 				uni.previewImage({
-					urls:[e],
-					current:0
+					urls: [e],
+					current: 0
 				})
 			},
-			bohao(){
+			bohao() {
 				var that = this;
 				uni.makePhoneCall({
 					phoneNumber: that.appInfo.kf_tel
 				});
 			},
-			fhuzhi(){
+			fhuzhi() {
 				var that = this;
 				uni.setClipboardData({
 					data: that.appInfo.kf_wechat,
-					success: function () {
+					success: function() {
 						uni.showToast({
-							title:'微信号已复制'
+							title: '微信号已复制'
 						})
 					}
 				});
@@ -95,10 +107,11 @@
 </script>
 
 <style lang="scss">
-	page{
+	page {
 		background: #F6F7FB;
 	}
-	.kefu{
+
+	.kefu {
 		background: #ffffff;
 		padding: 38rpx 30rpx;
 		display: flex;
@@ -107,7 +120,8 @@
 		// margin-top: 38rpx;
 		font-size: 32rpx;
 		border-bottom: 1px solid #ededed;
-		.dian{
+
+		.dian {
 			width: 20rpx;
 			height: 20rpx;
 			border-radius: 50%;
@@ -115,38 +129,41 @@
 			margin-right: 16rpx;
 		}
 	}
-	.qrcode_path{
+
+	.qrcode_path {
 		width: 100%;
 		// height: 800rpx;
 		padding: 30rpx;
 		background: #ffffff;
 		display: flex;
 		justify-content: center;
-		image{
+
+		image {
 			width: 92%;
 			height: 100%;
-			
+
 		}
 	}
-	.sds{
+
+	.sds {
 		background: #ffffff;
 		padding: 0 30rpx;
 	}
-    
-	.yijian{
+
+	.yijian {
 		width: 150rpx;
 		margin-left: 30rpx;
 	}
-	.server{
+
+	.server {
 		display: flex;
 		justify-content: center;
-		
+
 		margin: 60rpx 0;
-		image{
+
+		image {
 			width: 100px;
 			height: 100px;
 		}
 	}
-	
-	
-</style>
+</style>

+ 33 - 29
pages/user/signin.vue

xqd xqd xqd xqd
@@ -24,7 +24,7 @@
 						<view class="input u-flex align-center">
 							<u-icon name="account-fill" color="#26B3A0" size="24"></u-icon>
 							<input class="vs-flex-item" v-model="accountLogin.account" :maxlength="11"
-								placeholder="请输入账号" />
+								:placeholder="showlogon?'请输入账号':'请输入手机号'" />
 						</view>
 						<view class="input u-flex align-center">
 							<u-icon name="lock-fill" color="#26B3A0" size="24"></u-icon>
@@ -242,20 +242,39 @@
 				// })
 			},
 			async getlogin() {
-				if (!this.accountLogin.account) {
-					uni.showToast({
-						title: '请输入账号',
-						icon: 'none'
-					})
-					return;
-				}
-				if (!uni.$u.test.rangeLength(this.accountLogin.account, [4, 16])) {
-					uni.showToast({
-						title: '账号不能低于4位和高于16位',
-						icon: 'none'
-					})
-					return;
+				if (this.showlogon) {
+					if (!this.accountLogin.account) {
+						uni.showToast({
+							title: '请输入账号',
+							icon: 'none'
+						})
+						return;
+					}
+					if (!uni.$u.test.rangeLength(this.accountLogin.account, [4, 16])) {
+						uni.showToast({
+							title: '账号不能低于4位和高于16位',
+							icon: 'none'
+						})
+						return;
+					}
+				} else {
+					if (!this.accountLogin.account) {
+						uni.showToast({
+							title: '请输入手机号',
+							icon: 'none'
+						})
+						return;
+					}
+					let phoneReg = /^[1][3,4,5,7,8,9][0-9]{9}$/
+					if (!phoneReg.test(this.accountLogin.account)) {
+						uni.showToast({
+							title: '手机号不合法',
+							icon: 'none'
+						})
+						return;
+					}
 				}
+
 				if (!this.accountLogin.password) {
 					uni.showToast({
 						title: '请输入密码',
@@ -278,14 +297,6 @@
 					})
 					return;
 				}
-				// if (!this.showlogon && !this.password2) {
-				// 	uni.showToast({
-				// 		title: '请再次确认密码',
-				// 		icon: 'none'
-				// 	})
-				// 	return;
-				// }
-
 				if (!uni.$u.test.enOrNum(this.accountLogin.password) || !uni.$u.test.enOrNum(this.password2)) {
 					uni.showToast({
 						title: '密码只能是字母和数字',
@@ -293,13 +304,6 @@
 					})
 					return;
 				}
-				// if (!this.showlogon && this.accountLogin.password != this.password2) {
-				// 	uni.showToast({
-				// 		title: '两次密码不相同,请重新确认',
-				// 		icon: 'none'
-				// 	})
-				// 	return;
-				// }
 
 				// 新登录接口
 				if (!this.showlogon) {

+ 21 - 6
pages/user/user.vue

xqd xqd xqd xqd
@@ -111,7 +111,7 @@
 					<navigator class="cell" v-for="(item, index) in userList" :key="index" :url="item.url"
 						@click="getroute">
 						<view class="cell-left">
-							<u-icon :name="item.icon" :color="item.color" size="22"></u-icon>
+							<u-icon :name="item.icon" color="#26b3a0" size="22"></u-icon>
 							<view class="cell-text">{{ item.title }}</view>
 						</view>
 						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
@@ -129,14 +129,23 @@
 
 			<!-- 用户服务 -->
 			<view class="com-item">
-				<view class="com-wrap" v-if="!hasLogin">
+				<!-- <view class="com-wrap" v-if="!hasLogin">
 					<view class="cell" @click="getlogin">
 						<view class="cell-left">
-							<!-- <u-icon name="scan" color="#007aff" size="22"></u-icon> -->
+							<u-icon name="" color="#26b3a0" size="22"></u-icon>
 							<view class="cell-text">立即登录</view>
 						</view>
 						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
 					</view>
+				</view> -->
+				<view class="com-wrap" style="margin-top: 20rpx;">
+					<view class="cell" @click="kefuCenter">
+						<view class="cell-left">
+							<u-icon name="server-fill" color="#26b3a0" size="22"></u-icon>
+							<view class="cell-text">客服中心</view>
+						</view>
+						<u-icon name="arrow-right" color="#9e9e9e" size="18"></u-icon>
+					</view>
 				</view>
 
 				<view class="com-wrap" v-if="hasLogin">
@@ -362,10 +371,11 @@
 				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30"
 					@click="jump('/pages/user/public/kefu')">
 					<view class="tn-flex tn-flex-col-center">
-						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
+						<!-- <view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center"
 							style="color: #7C8191;">
-							<view class="tn-icon-science-fill"></view>
-						</view>
+							<view class="tn-icon-science-fill "></view>
+						</view> -->
+
 						<view class="tn-margin-left-sm tn-flex-1">客服中心</view>
 						<view class="tn-color-gray tn-icon-right"></view>
 					</view>
@@ -676,6 +686,11 @@
 			clearInterval(time2);
 		},
 		methods: {
+			kefuCenter() {
+				uni.navigateTo({
+					url: '/pages/user/public/kefu'
+				})
+			},
 			loginout() {
 				let that = this;
 				uni.showModal({

BIN=BIN
static/kefu1.jpg