lilei 2 éve
szülő
commit
818634c516
6 módosított fájl, 178 hozzáadás és 101 törlés
  1. 0 98
      App.vue
  2. 7 0
      pages.json
  3. 162 0
      pages/login/apply-trial.vue
  4. 1 2
      pages/login/login.scss
  5. 7 0
      pages/login/login.vue
  6. 1 1
      pages/shelfSetting/shelfSet.vue

+ 0 - 98
App.vue

@@ -1,5 +1,4 @@
 <script>
-	var jpushModule = uni.requireNativePlugin("JG-JPush")
 	export default {
 		globalData: {  
 			baseUrl: '',
@@ -25,103 +24,6 @@
 		},
 		onLaunch: function() {
 			console.log('App launch')
-			// // 极光推送
-			// if(uni.getSystemInfoSync().platform == "ios"){
-			// 	// 请求定位权限
-			// 	let locationServicesEnabled = jpushModule.locationServicesEnabled()
-			// 	let locationAuthorizationStatus = jpushModule.getLocationAuthorizationStatus()
-			// 	console.log('locationAuthorizationStatus',locationAuthorizationStatus)	
-			// 	if (locationServicesEnabled == true && locationAuthorizationStatus < 3) {
-			// 		jpushModule.requestLocationAuthorization((result)=>{
-			// 			console.log('定位权限',result.status)
-			// 		})
-			// 	}
-			// 	jpushModule.requestNotificationAuthorization((result)=>{
-			// 		let status = result.status
-			// 		if (status < 2) {
-			// 			uni.showToast({
-			// 				icon: 'none',
-			// 				title: '您还没有打开通知权限',
-			// 				duration: 3000
-			// 			})
-			// 		}
-			// 	})
-			// }
-			// // 初始化
-			// jpushModule.initJPushService();
-			// jpushModule.setLoggerEnable(true);
-			// jpushModule.addConnectEventListener(result=>{
-			// 	let connectEnable = result.connectEnable
-			// 	uni.$emit('connectStatusChange',connectEnable)
-			// });
-			
-			// jpushModule.addNotificationListener(result=>{
-			// 	let notificationEventType = result.notificationEventType
-			// 	let messageID = result.messageID
-			// 	let title = result.title
-			// 	let content = result.content
-			// 	let extras = result.extras
-				
-			// 	uni.showToast({
-			// 		icon: 'none',
-			// 		title: JSON.stringify(result),
-			// 		duration: 3000
-			// 	})
-			// });
-			
-			// jpushModule.addCustomMessageListener(result=>{
-			// 	let type = result.type
-			// 	let messageType = result.messageType
-			// 	let content = result.content
-			// 	uni.showToast({
-			// 		icon: 'none',
-			// 		title: JSON.stringify(result),
-			// 		duration: 3000
-			// 	})
-			// })
-			
-			// jpushModule.addLocalNotificationListener(result=>{
-			// 	let messageID = result.messageID
-			// 	let title = result.title
-			// 	let content = result.content
-			// 	let extras = result.extras
-			// 	uni.showToast({
-			// 		icon: 'none',
-			// 		title: JSON.stringify(result),
-			// 		duration: 3000
-			// 	})
-			// })
-			
-			// jpushModule.addGeofenceListener(result=>{
-			// 	let code = result.code
-			// 	let type = result.type
-			// 	let geofenceId = result.geofenceId
-			// 	let userInfo = result.userInfo
-			// 	uni.showToast({
-			// 		icon: 'none',
-			// 		title: '触发地理围栏',
-			// 		duration: 3000
-			// 	})
-			// })
-			
-			// jpushModule.setIsAllowedInMessagePop(true)
-			// jpushModule.pullInMessage(result=>{
-			// 	let code = result.code
-			// 	console.log(code)
-			// })
-			
-			// jpushModule.addInMessageListener(result=>{
-			// 	let eventType = result.eventType
-			// 	let messageType = result.messageType
-			// 	let content = result.content
-			// 	console.log('inMessageListener',eventType,messageType,content)
-				
-			// 	uni.showToast({
-			// 		icon: 'none',
-			// 		title: JSON.stringify(result),
-			// 		duration: 3000
-			// 	})
-			// })
 		},
 		onShow: function() {
 			console.log('App Show')

+ 7 - 0
pages.json

@@ -9,6 +9,13 @@
 				"navigationBarTitleText": ""
 			}
 		},
+		{
+			"path": "pages/login/apply-trial",  //  申请试用
+			"style": {
+				"navigationStyle": "default",  //  是否显示导航栏  default显示,custom不显示
+				"navigationBarTitleText": "申请试用"
+			}
+		},
 		{
 			"path": "pages/index/index", // 货架
 			"style": {

+ 162 - 0
pages/login/apply-trial.vue

@@ -0,0 +1,162 @@
+<template>
+	<view class="apply-wrap">
+		<view class="login-body">
+			<u-form :model="form" :error-type="['toast']" ref="uForm" label-position="top">
+				<u-form-item label="门店名称" required prop="name">
+					<u-input v-model="form.name" maxlength="30" placeholder="请输入门店名称(最多30个字符)"/>
+				</u-form-item>
+				<u-form-item label="门店地址" required prop="addrDetail">
+					<u-input v-model="form.addrDetail" placeholder="请输入门店详细地址"/>
+				</u-form-item>
+				<u-form-item label="手机号码" required prop="contactPhone">
+					<u-input v-model="form.contactPhone" type="number" maxlength="11" placeholder="请输入手机号码"/>
+				</u-form-item>
+				<u-form-item label="姓名" required prop="userName">
+					<u-input v-model="form.userName" maxlength="11" placeholder="请输入姓名"/>
+				</u-form-item>
+			</u-form>
+			<view class="login-form">
+				<view class="form-btn-con">
+					<button class="form-btn" :style="{background:$config('primaryColor')}" @click="formSubmit">提交</button>
+					<text class="apply-btn" @click="goLogin">已有账号?去登录</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import Address from '@/components/address.vue'
+	import { clzConfirm } from '@/libs/tools.js'
+	export default{
+		components: {
+			Address,
+		},
+		data(){
+			return{
+				theme: '',
+				form: {
+					name: '',
+					addrProvince: '',
+					addrCity: '',
+					addrDistrict: '',
+					addrDetail: '',
+					contactPhone: '',
+					userName: '',
+				},
+				rules: {
+					name: [
+						{ 
+							required: true, 
+							message: '请输入门店名称', 
+							// 可以单个或者同时写两个触发验证方式 
+							trigger: ['change','blur'],
+						}
+					],
+					addrDetail: [
+						{
+							required: true, 
+							message: '请输入详细地址', 
+							trigger: 'change'
+						}
+					],
+					contactPhone: [
+						{
+							required: true, 
+							message: '请输入手机号', 
+							trigger: 'change'
+						}
+					],
+					userName: [
+						{
+							required: true, 
+							message: '请输入姓名', 
+							trigger: 'change'
+						}
+					],
+				},
+				areaIdArr: [],  //  省市区id数组
+			}
+		},
+		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+			this.theme = getApp().globalData.theme;
+		},
+		methods: {
+			//  表单提交
+			formSubmit(){
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						console.log('验证通过');
+						this.submitData()
+					} else {
+						console.log('验证失败');
+					}
+				});
+			},
+			submitData(){
+				let obj = this.form
+				//  申请试用
+				uni.showLoading({
+					title: '正在提交申请...'
+				})
+				setTimeout(() => {
+					uni.hideLoading()
+					clzConfirm({
+					    title: '提示',
+					    content: '资料已提交成功,客服会在3个工作日内同您联系。请保持电话畅通,谢谢!',
+						showCancel: false,
+						success: function (ret) {
+					        if (ret.confirm||ret.index==0) {
+								uni.reLaunch({
+									url: '/pages/login/login'
+								})
+					        }
+					    }
+					})
+				},500)
+			},
+			//  选择省区市
+			areaConfirm(e) {
+				console.log('已选择的省市区', e)
+				this.areaIdArr = [ e.provinceCode, e.cityCode, e.areaCode ]
+				this.form.label = e.label
+			},
+			openAddress(){
+				//  省市区  回显     参数为省市区id数组
+				this.$refs.applyAddress.open(this.areaIdArr)
+			},
+			//  去登录
+			goLogin(){
+				uni.navigateBack()
+			},
+		}
+	}
+</script>
+<style scoped lang="scss">
+	@import './login.scss';
+	.apply-wrap .login-form{
+		padding-top: 40upx;
+		.form-btn-con{
+			margin: 0;
+		}
+	}
+	.apply-wrap .login-body{
+		display: block;
+	}
+	.apply-wrap .authUserYs{
+		padding: 60upx 0 30upx 0;
+	}
+	.getcode-btn {
+		color: #0485F6 !important;
+		border: none !important;
+		background: none !important;
+		font-size: 28upx;
+		margin: 0;
+		padding: 0;
+		&:after{
+			border: none !important;
+		}
+	}
+</style>

+ 1 - 2
pages/login/login.scss

@@ -81,9 +81,8 @@
 				display: block;
 				text-align: center;
 				margin-top: 30upx;
-				border: 1upx solid #BBBBBB;
 				padding: 24upx 0;
-				border-radius: 100upx;
+				border-radius: 120upx;
 			}
 		}
 		.forget-pass{

+ 7 - 0
pages/login/login.vue

@@ -24,6 +24,7 @@
 				</view>
 				<view class="form-btn-con">
 					<button class="form-btn" :disabled="isDisabled" :style="{'background':isDisabled?'#e5e5e5':$config('primaryColor')}" form-type="submit">登录</button>
+					<text class="apply-btn" @click="applyTrial">没有账号?马上申请试用</text>
 				</view>
 			</form>
 		</view>
@@ -86,6 +87,12 @@ export default {
 		//#endif
 	},
 	methods: {
+		//  申请试用
+		applyTrial() {
+			uni.navigateTo({
+				url: '/pages/login/apply-trial'
+			});
+		},
 		// 版本更新
 		AndroidCheckUpdate(){
 			let _this = this

+ 1 - 1
pages/shelfSetting/shelfSet.vue

@@ -22,7 +22,7 @@
 					<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
 				</view>
 			</view>
-			<view class="card-row align_center flex justify_between">
+			<view class="card-row align_center flex justify_between" v-if="showMore">
 				<view class="label" style="width: 50%;" @click="showTip(1)">是否设置完成 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
 				<view class="text" style="width: 50%;text-align: right;"><u-switch v-model="switchVal" @change="switchChange"></u-switch></view>
 			</view>