Forráskód Böngészése

refactor:页面跳转优化

zhanghui 2 éve
szülő
commit
681e85d836

+ 2 - 2
common/js/env.js

@@ -1,8 +1,8 @@
 "use strict";
 
-// let baseUrl = `https://jje.admin.xinyuekj.com.cn`
+let baseUrl = `https://jje.admin.xinyuekj.com.cn`
 // let baseUrl = `http://127.0.0.1:9000`
-let baseUrl = `http://192.168.1.150:8080`
+// let baseUrl = `http://192.168.1.150:8080`
 
 // 变量可自行添加修改
 export default { //存放变量的容器

+ 1 - 1
loginPages/login/retrieve-account.vue

@@ -134,7 +134,7 @@ export default {
 	},
 	onLoad(option) {
 		// 判断Openid是否为空
-		if(!this.$isDataEmpty(option.openId)){
+		if(option.openId){
 			this.userInfo.openId = option.openId;
 			console.log(option)
 		}

+ 4 - 9
loginPages/login/retrieve-method.vue

@@ -24,9 +24,7 @@ export default {
 	},
 	onLoad(option) {
 		// 判断Openid是否为空
-		if(!this.$isDataEmpty(option)){
-			this.userInfo.telphone = option.data;
-		}
+		this.userInfo.telphone = option.data;
 	},
 	onReady() {
 	},
@@ -34,11 +32,8 @@ export default {
 		// 去找回账号页面
 		gotoAccountPassword(){
 			let that = this;
-			uni.$u.route({
-				url: '/pages/login/retrieve-account-password',
-				params: {
-					data: that.userInfo.telphone
-				}
+			uni.navigateTo({
+				url: '/pages/login/retrieve-account-password?data=' + that.userInfo.telphone,
 			})
 		},
 	}
@@ -57,4 +52,4 @@ page,body{
 	justify-content: center;
 	align-items: center;
 }
-</style>
+</style>

+ 4 - 4
myPages/setting/index.vue

@@ -60,25 +60,25 @@ export default {
 		// 去设置手机号
 		gotoSettingtelphone(){
 			uni.navigateTo({
-				url: '/loginPages/login/retrieve-account-phone"',
+				url: '/myPages/setting/setting-telphone',
 			})
 		},
 		// 去设置微信号
 		gotoSettingWechat(){
 			uni.navigateTo({
-				url: '/pages/setting/setting-wechat"',
+				url: '/myPages/setting/setting-wechat',
 			})
 		},
 		// 去设置账号密码
 		gotoSettingAccountPassword(){
 			uni.navigateTo({
-				url: '/pages/setting/setting-account-password"',
+				url: '/myPages/setting/setting-account-password',
 			})
 		},
 		// 去设置交易密码页面
 		gotoSettingTransactionPassword(){
 			uni.navigateTo({
-				url: '/pages/setting/setting-transaction-password"',
+				url: '/myPages/setting/setting-transaction-password',
 			})
 		}
 	}

+ 354 - 0
myPages/setting/setting-account-password.vue

@@ -0,0 +1,354 @@
+<template>
+  <view class="container">
+    <view class="login-wrap">
+		<view class="login-form">
+			<u--form
+				labelPosition="left"
+				:model="userInfo"
+				:rules="rules"
+				ref="form1"
+			>
+					<u-form-item
+							label="手机号"
+							prop="phonenumber"
+							labelWidth="auto"
+							labelAlign="right"
+						  >
+						<u--input
+							v-model="userInfo.phonenumber"
+							placeholder="请输入手机号"
+							border="bottom"
+							type="number"
+							disabled="disabled"
+							maxlength="11"
+						></u--input>
+					</u-form-item>
+					<u-form-item
+						labelWidth="auto"
+						labelAlign="right"
+						label="验证码"
+						prop="smsCode"
+						width="120"
+					>
+					<u--input
+						v-model="userInfo.smsCode"
+						disabledColor="#ffffff"
+						placeholder="请输入验证码"
+						border="bottom"
+						maxlength="4"
+					></u--input>
+					<template #right>
+						<view class="identifying-code">
+							<u-code
+								ref="uCode2"
+								@change="codeChange2"
+								keep-running
+								start-text="获取验证码"
+							></u-code>
+							<text
+								@tap="getCode2"
+								:text="tips2"
+								class="u-page__code-text"
+							>{{tips2}}</text>
+						</view>
+					</template>
+
+					</u-form-item>
+
+				  <u-form-item
+					label="新账号支付密码"
+					prop="password"
+					labelWidth="auto"
+					labelAlign="right"
+				  >
+					<u--input
+						v-model="userInfo.password"
+						placeholder="请输入6位新密码"
+						border="bottom"
+						maxlength="6"
+						type="password"
+					></u--input>
+				</u-form-item>
+				<u-form-item
+						labelWidth="auto"
+						labelAlign="right"
+						label="确认密码"
+						prop="password1"
+						width="120"
+					>
+					<u--input
+						maxlength="6"
+						v-model="userInfo.password1"
+						placeholder="请再次输入密码"
+						border="bottom"
+						type="password"
+					></u--input>
+				</u-form-item>
+			</u--form>
+		</view>
+	</view>
+	<view  @click="submitData()" class="op-btn-wrap">
+		<view class="h-btn">
+			<text>确定</text>
+		</view>
+	</view>
+
+	<!-- 提示 -->
+	<view class="h-mark-desc">
+		<view class="h-text">
+			<text>*账号密码建议输入不连续的6位数</text>
+		</view>
+	</view>
+
+	<!-- 密码找回 -->
+	<u-popup :show="show" :round="10"  mode="center"  @close="close" @open="open">
+	  <view class="h-popo-content">
+		   <view class="h-img">
+			   <u-icon name="checkbox-mark" color="green" size="40"></u-icon>
+		   </view>
+		   <view class="text">
+			   <text>密码找回成功</text>
+		   </view>
+		   <view class="h-btn-wrap">
+			   <view @click="passwordSucessSure()" class="h-right-btn">
+			   		<text>确定</text>
+			   </view>
+		   </view>
+	  </view>
+	</u-popup>
+  </view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			show:  false,
+			userInfo: {
+				auth: true,
+				password: '',
+				password1: '',
+				phone: '',
+				phonenumber: '',
+				smsCode: '',
+				code: ''
+			},
+			tips2: '',
+			rules: {
+				phonenumber:  [
+					{
+						required: true,
+						min: 10,
+						max: 12,
+						message: '请输入11位电话号码',
+						trigger: ['blur', 'change'],
+					},
+					{
+						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
+						validator: (rule, value, callback) => {
+							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+							return !this.$isDataEmpty(value);
+						},
+						message: "请认真填写电话号码",
+						trigger: ['blur', 'change'],
+					}
+				],
+				smsCode: {
+					required: true,
+					min: 4,
+					max: 6,
+					message: '请输入4位验证码',
+					trigger: ['blur', 'change'],
+				},
+				password: {
+					required: true,
+					min: 6,
+					max: 18,
+					message: '请输入6位密账号交易密码',
+					trigger: ['blur', 'change'],
+				},
+				password1:  [
+					{
+						required: true,
+						min: 6,
+						max: 18,
+						message: '请再次输入',
+						trigger: ['blur', 'change'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							if(this.userInfo.password === value){
+								return true;
+							}
+							return false;
+						},
+						message: "两次输入密码不一致",
+						trigger: ['blur', 'change'],
+					}
+				],
+			},
+		}
+	},
+	onLoad() {
+		// 用户信息
+		let user = uni.getStorageSync('userInfo');
+		this.userInfo.phonenumber = user.phone;
+	},
+	onReady() {
+		this.$refs.form1.setRules(this.rules)
+	},
+	methods: {
+		// 提交交易密码
+		submitData(){
+
+			// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
+			this.$refs.form1.validate().then(res => {
+				// 设置新密码
+				this.updateUserAccountPassword();
+			}).catch(errors => {
+				uni.$u.toast('校验失败,请认真填写')
+			})
+		},
+		// 设置交易密码
+		updateUserAccountPassword(){
+
+			this.userInfo.phone = this.userInfo.phonenumber;
+			this.userInfo.code = this.userInfo.smsCode;
+			// 保存数据
+			this.$api.passwordByPhone(this.userInfo).then((res)=>{
+					this.show = true;
+
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+		},
+		passwordSucessSure(){
+			uni.switchTab({
+				url: '/pages/my/index'
+			});
+		},
+		codeChange2(text) {
+			this.tips2 = text;
+		},
+		getCode2() {
+			let that = this;
+			if (this.$refs.uCode2.canGetCode) {
+				that.getSmsCode();
+			} else {
+				uni.$u.toast('倒计时结束后再发送');
+			}
+		},
+		// 获取手机验证码
+		getSmsCode(){
+			let that = this;
+			if(!this.userInfo.phonenumber){
+				uni.$u.toast('请认真填写手机号');
+				return;
+			}
+			that.getPhoneCode();
+		},
+		// 获取验证码
+		getPhoneCode(){
+			let that = this;
+			// 模拟向后端请求验证码
+			uni.showLoading({
+				title: '正在获取验证码'
+			})
+			this.$api.getSmsCode({phonenumber:this.userInfo.phonenumber,auth: true}).then((res)=>{
+				uni.hideLoading();
+				// 这里此提示会被this.start()方法中的提示覆盖
+				uni.$u.toast('验证码已发送');
+				// 通知验证码组件内部开始倒计时
+				that.$refs.uCode2.start();
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+		},
+	}
+}
+</script>
+<style lang="scss">
+page,body{
+	background: #fff;
+}
+.container{
+	background: #fff;
+	height: 300px;
+	.login-wrap {
+		display: flex;
+		justify-content: center;
+		.login-form{
+			width: 90%;
+		}
+		.account{
+			display: flex;
+		}
+		.identifying-code{
+		}
+	}
+	.op-btn-wrap{
+		margin-top: 30px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.h-btn{
+			text-align: center;
+			width: 343px;
+			height: 42px;
+			background: #FFE05C;
+			border-radius: 27px;
+			line-height: 42px;
+		}
+	}
+}
+.h-popo-content{
+	height: 160px;
+	padding: 12px;
+	width: 300px;
+	text-align: center;
+	font-size: 14px;
+	font-family: PingFangSC-Semibold, PingFang SC;
+	.h-img{
+		display: flex;
+		justify-content: center;
+	}
+	.h-text{
+		margin-top: 12px;
+		font-weight: 400;
+		color: #666666;
+	}
+	.text{
+		margin-top: 6px;
+		font-weight: 400;
+		color: #666666;
+	}
+	.h-btn-wrap{
+		display: flex;
+		justify-content: space-between;
+		color: #333333;
+		text-align: center;
+		margin-top: 14px;
+		.h-left-btn{
+			height: 32px;
+			line-height: 30px;
+			background: #EEEEEE;
+			width: 100px;
+			text-align: center;
+			border-radius: 16px;
+			margin: 0 auto;
+		}
+		.h-right-btn{
+			height: 32px;
+			line-height: 30px;
+			background: #FFE05C;
+			width: 100px;
+			border-radius: 16px;
+			margin: 0 auto;
+
+		}
+	}
+}
+</style>

+ 310 - 0
myPages/setting/setting-telphone.vue

@@ -0,0 +1,310 @@
+<template>
+  <view class="container">
+    <view class="login-wrap">
+		<view class="login-form">
+			<u--form
+				labelPosition="left"
+				:model="userInfo"
+				:rules="rules"
+				ref="form1"
+			>
+				<u-form-item
+					label="手机号"
+					prop="phonenumber"
+					labelWidth="auto"
+					labelAlign="right"
+				  >
+				<u--input
+					v-model="userInfo.phonenumber"
+					placeholder="请输入手机号"
+					border="bottom"
+					type="number"
+					maxlength="11"
+				></u--input>
+			  </u-form-item>
+			  <u-form-item
+					labelWidth="auto"
+					labelAlign="right"
+					label="验证码"
+					prop="smsCode"
+					width="120"
+				>
+				<u--input
+					v-model="userInfo.smsCode"
+					disabledColor="#ffffff"
+					placeholder="请输入验证码"
+					border="bottom"
+					maxlength="4"
+				></u--input>
+				<template #right>
+					<view class="identifying-code">
+						<u-code
+							ref="uCode2"
+							@change="codeChange2"
+							keep-running
+							start-text="获取验证码"
+						></u-code>
+						<text
+							@tap="getCode2"
+							:text="tips2"
+							class="u-page__code-text"
+						>{{tips2}}</text>
+					</view>
+				</template>
+
+			  </u-form-item>
+			</u--form>
+		</view>
+	</view>
+
+	<view v-if="errTipShow" class="h-err">
+		<text>你输入的手机号码已存在,请换一个</text>
+	</view>
+
+	<view @click="setPhone()" class="op-btn-wrap">
+		<view class="h-btn">
+			<text>确定</text>
+		</view>
+	</view>
+
+
+  </view>
+</template>
+ <script>
+
+export default {
+	data() {
+		return {
+			errTipShow: false,
+			errShow: false,
+			userInfo: {
+				auth: true,
+				phonenumber: '',
+				phone: '',
+				smsCode: '',
+				openId: '',
+				password: "",
+				transactionPassword: "",
+				reference: "",
+				type: '' // 实名认证创建新账号
+			},
+			tips2: '',
+			rules: {
+				phonenumber:  [
+					{
+						required: true,
+						min: 10,
+						max: 12,
+						message: '请输入11位电话号码',
+						trigger: ['blur', 'change'],
+					},
+					{
+						// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
+						validator: (rule, value, callback) => {
+							// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
+							return !this.$isDataEmpty(value);
+						},
+						message: "请认真填写电话号码",
+						trigger: ['blur', 'change'],
+					}
+				],
+				smsCode: {
+					required: true,
+					min: 4,
+					max: 6,
+					message: '请输入4位验证码',
+					trigger: ['blur', 'change'],
+				},
+			},
+		}
+	},
+	onLoad(option) {
+	},
+	onReady() {
+		this.$refs.form1.setRules(this.rules)
+	},
+	methods: {
+		// 验证电话号码是否存在
+		saveSetPhoneData(){
+			let that = this;
+			// 验证电话号码是否存在
+			setPhone(null,{data:this.userInfo}).then((res)=>{
+				uni.showToast({
+					title: '绑定成功'
+				})
+				setTimeout(function() {
+				   // 选择完成后返回上一页
+				   uni.navigateBack({
+				     delta: 1,
+				     success: function(res) {
+				        console.log('返回成功');
+				     }
+				   });
+				}, 2000); // 延迟2秒执行
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+		},
+		// 去绑定账号密码页面
+		setPhone(){
+			let that = this;
+			this.$refs.form1.validate().then(res => {
+				that.saveSetPhoneData();
+			}).catch(errors => {
+				uni.$u.toast('校验失败,请认真填写')
+			})
+		},
+		codeChange2(text) {
+			this.tips2 = text;
+		},
+		getCode2() {
+			let that = this;
+			if (this.$refs.uCode2.canGetCode) {
+				that.getSmsCode();
+			} else {
+				uni.$u.toast('倒计时结束后再发送');
+			}
+		},
+		// 获取手机验证码
+		getSmsCode(){
+			let that = this;
+			if(this.$isDataEmpty(this.userInfo.phonenumber)){
+				uni.$u.toast('请认真填写手机号');
+				return;
+			}
+
+			// 验证电话号码是否存在
+			phoneIsExist(null,{data:this.userInfo}).then((res)=>{
+				if(res.phoneIsExist){ // 存在
+					that.errTipShow = true;
+					setTimeout(() => {
+						that.errTipShow = false;
+					    // 在这里编写延迟执行的代码
+						that.userInfo.phonenumber = null;
+					}, 3000);
+				} else {
+					that.getPhoneCode();
+				}
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败",
+					duration: 3000
+				})
+			});
+
+
+		},
+		// 获取验证码
+		getPhoneCode(){
+			let that = this;
+			// 模拟向后端请求验证码
+			uni.showLoading({
+				title: '正在获取验证码'
+			})
+			getSmsCode({data:{phonenumber:this.userInfo.phonenumber,auth: true}}).then((res)=>{
+				uni.hideLoading();
+				// 这里此提示会被this.start()方法中的提示覆盖
+				uni.$u.toast('验证码已发送');
+				// 通知验证码组件内部开始倒计时
+				that.$refs.uCode2.start();
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+		},
+	}
+}
+</script>
+<style lang="scss">
+page,body{
+	background: #fff;
+}
+
+.h-err{
+	color: red;
+	text-align: center;
+	font-size: 14px;
+}
+
+.h-popo-content{
+	height: 170px;
+	padding: 12px;
+	width: 300px;
+	text-align: center;
+	font-size: 14px;
+	font-family: PingFangSC-Semibold, PingFang SC;
+	.h-img{
+		display: flex;
+		justify-content: center;
+	}
+	.h-text{
+		margin-top: 12px;
+		font-weight: 400;
+		color: #666666;
+	}
+	.text{
+		margin-top: 6px;
+		font-weight: 400;
+		color: #666666;
+	}
+	.h-btn-wrap{
+		display: flex;
+		justify-content: space-between;
+		color: #333333;
+		text-align: center;
+		margin-top: 14px;
+		.h-left-btn{
+			height: 32px;
+			line-height: 30px;
+			background: #EEEEEE;
+			width: 100px;
+			text-align: center;
+			border-radius: 16px;
+			margin: 0 auto;
+		}
+		.h-right-btn{
+			height: 32px;
+			line-height: 30px;
+			background: #FFE05C;
+			width: 100px;
+			border-radius: 16px;
+			margin: 0 auto;
+
+		}
+	}
+}
+
+.container{
+	background: #fff;
+	height: 300px;
+	.login-wrap {
+		display: flex;
+		justify-content: center;
+		.login-form{
+			width: 90%;
+		}
+		.account{
+			display: flex;
+		}
+		.identifying-code{
+		}
+	}
+	.op-btn-wrap{
+		margin-top: 30px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.h-btn{
+			text-align: center;
+			width: 343px;
+			height: 42px;
+			background: #FFE05C;
+			border-radius: 27px;
+			line-height: 42px;
+		}
+	}
+}
+</style>

+ 195 - 0
myPages/setting/setting-transaction-password.vue

@@ -0,0 +1,195 @@
+<template>
+  <view class="container">
+    <view class="login-wrap">
+		<view class="login-form">
+			<u--form
+				labelPosition="left"
+				:model="userInfo"
+				:rules="rules"
+				ref="form1"
+			>
+			<u-form-item
+				label="原密码"
+				prop="oldPassword"
+				labelWidth="auto"
+				labelAlign="right"
+			  >
+			<u--input
+				v-model="userInfo.oldPassword"
+				placeholder="请输入原密码"
+				border="bottom"
+				maxlength="6"
+				type="password"
+			></u--input>
+			</u-form-item>
+				<u-form-item
+					label="密码"
+					prop="password"
+					labelWidth="auto"
+					labelAlign="right"
+				  >
+				<u--input
+					v-model="userInfo.password"
+					placeholder="请输入密码"
+					border="bottom"
+					maxlength="6"
+					type="password"
+				></u--input>
+				</u-form-item>
+			  <u-form-item
+					labelWidth="auto"
+					labelAlign="right"
+					label="确认密码"
+					prop="password1"
+					width="120"
+				>
+				<u--input
+					maxlength="6"
+					v-model="userInfo.password1"
+					placeholder="请再次输入密码"
+					border="bottom"
+					type="password"
+				></u--input>
+			  </u-form-item>
+			</u--form>
+		</view>
+	</view>
+	<view @click="submitData" class="op-btn-wrap">
+		<view class="h-btn">
+			<text>确定</text>
+		</view>
+	</view>
+
+	<!-- 提示 -->
+	<view class="h-mark-desc">
+		<view class="h-text">
+			<text>*交易密码建议输入不连续的6位数密码</text>
+		</view>
+	</view>
+
+  </view>
+</template>
+ <script>
+export default {
+	data() {
+		return {
+			userInfo: {
+				oldPassword: '',
+				auth: true,
+				password: '',
+				password1: '',
+			},
+			tips2: '',
+			rules: {
+				oldPassword: {
+					required: true,
+					min: 6,
+					max: 18,
+					message: '请输入6到18位密码',
+					trigger: ['blur', 'change'],
+				},
+				password: {
+					required: true,
+					min: 6,
+					max: 6,
+					message: '请输入6位密码',
+					trigger: ['blur', 'change'],
+				},
+				password1:  [
+					{
+						required: true,
+						min: 6,
+						max: 6,
+						message: '请输入6位密码',
+						trigger: ['blur', 'change'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							if(this.userInfo.password === value){
+								return true;
+							}
+							return false;
+						},
+						message: "两次输入密码不一致",
+						trigger: ['blur', 'change'],
+					}
+				],
+			},
+		}
+	},
+	onLoad() {
+		this.$refs.form1.setRules(this.rules)
+	},
+	methods: {
+		// 提交交易密码
+		submitData(){
+			// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
+			this.$refs.form1.validate().then(res => {
+				this.updateUserTransactionPassword();
+			}).catch(errors => {
+				uni.$u.toast('校验失败,请认真填写')
+			})
+
+		},
+		updateUserTransactionPassword(){
+			// 保存数据
+			updateUserTransactionPassword(null,{data:this.userInfo}).then((res)=>{
+				uni.showToast({
+					title: '设置成功'
+				})
+				setTimeout(function() {
+				   // 选择完成后返回上一页
+				   uni.navigateBack({
+				     delta: 1,
+				     success: function(res) {
+				       // 在这里可以处理选择结果
+				   	   // 可以将选择的内容保存到本地或通过事件传递给上一个页面
+				   	   uni.$emit('selectedServiceObjectChild', item);
+				     }
+				   });
+				}, 2000); // 延迟2秒执行
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+		},
+	}
+}
+</script>
+<style lang="scss">
+page,body{
+	background: #fff;
+}
+.container{
+	background: #fff;
+	height: 300px;
+	.login-wrap {
+		display: flex;
+		justify-content: center;
+		.login-form{
+			width: 90%;
+		}
+		.account{
+			display: flex;
+		}
+		.identifying-code{
+		}
+	}
+	.op-btn-wrap{
+		margin-top: 30px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.h-btn{
+			text-align: center;
+			width: 343px;
+			height: 42px;
+			background: #FFE05C;
+			border-radius: 27px;
+			line-height: 42px;
+		}
+	}
+}
+
+</style>

+ 87 - 0
myPages/setting/setting-wechat.vue

@@ -0,0 +1,87 @@
+<template>
+<view class="container">
+	<view  class="h-method flex-row justify-center">
+		<view class="btn flex-row justify-center " @click="bindWechat()">
+			<view class="h-img flex-col justify-center">
+				<u-icon name="weixin-fill" color="green" size="30"></u-icon>
+			</view>
+			<view class="h-name ">
+				<text>绑定当前登录微信号</text>
+			</view>
+		</view>
+
+	</view>
+</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			userInfo: {
+				auth: true,
+				openId: ''
+			},
+			tips2: '',
+		}
+	},
+	onReady() {
+	},
+	onLoad() {
+		// 用户信息
+		let user = uni.getStorageSync('userInfo');
+		this.userInfo.openId = user.openId;
+	},
+	methods: {
+		// 绑定微信
+		bindWechat(){
+			// 保存数据
+			this.$api.bindWechat(this.userInfo).then((res)=>{
+				uni.showToast({
+					title: '绑定成功'
+				})
+				setTimeout(function() {
+				   // 选择完成后返回上一页
+				   uni.navigateBack({
+				     delta: 1,
+				     success: function(res) {
+				       console.log('返回成功');
+				     }
+				   });
+				}, 2000); // 延迟2秒执行
+			}).catch(() =>{
+				uni.showToast({
+					title: "操作失败"
+				})
+			});
+
+		},
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+	@import '/common/css/common.css';
+page,body{
+	background: #F7F7F7;
+}
+.container{
+}
+.h-method{
+	height: 100vh;
+	background: #f7f7f7;
+}
+
+	.btn{
+
+		width: 686rpx;
+		height: 100rpx;
+		background: #FFFFFF;
+		border-radius: 50rpx;
+		margin-top: 35vh;
+
+		.h-name{
+			line-height: 100rpx;
+		}
+	}
+</style>

+ 3 - 0
orderPages/myCoupon/index.rpx.scss

@@ -0,0 +1,3 @@
+.page{
+  background: #F7F7F7;
+}

+ 74 - 0
orderPages/myCoupon/index.vue

@@ -0,0 +1,74 @@
+<template>
+    <view class="page">
+        <u-sticky>
+            <View class=" tabs">
+                <u-tabs :list="tabList" :scrollable="false"
+                        lineWidth="30"
+                        lineColor="#FFE05C"
+                        :activeStyle="{
+            					color: '#333333',
+            					fontWeight: 'bold',
+            					transform: 'scale(1.05)'
+       							 }"
+                        :current="tabIndex" @click="clickTab"></u-tabs>
+            </View>
+        </u-sticky>
+
+        <!-- 订单列表 -->
+        <view :style="{'height':windowHeight}" >
+            <swiper :style="{'height':windowHeight}" :current="tabIndex" @change="swiperChange">
+                <swiper-item class="swiperItem" v-for="(item,index) in tabList" :key="index" >
+                    <view>
+                        <mescroll-item ref="MescrollItem" :i="index"  :index="tabIndex" :tabs="tabList" :height="windowHeight">
+                        </mescroll-item>
+                    </view>
+                </swiper-item>
+            </swiper>
+        </view>
+
+    </view>
+</template>
+
+<script>
+
+    import MescrollItem from "./module/mescrollUni-item.vue";
+export default {
+    components: {
+        MescrollItem
+    },
+    data() {
+        return {
+            windowHeight:'',
+            tabIndex:0,
+            tabList: [{
+                name: '可使用'
+            }, {
+                name: '已使用'
+            }, {
+                name: '已过期'
+            }],
+        };
+    },
+    onLoad() {
+        let sysInfo = uni.getSystemInfoSync()
+        this.windowHeight =sysInfo.windowHeight-44+'px'//除标题栏栏外的屏幕可用高度
+    },
+    methods: {
+
+        clickTab(e){
+            this.tabIndex = e.index
+        },
+        swiperChange(e){
+            this.tabIndex = e.detail.current
+            // if (this.$refs.MescrollItem[e.detail.current].orderList.length>0){
+            // 	this.$refs.MescrollItem[e.detail.current].downCallback()
+            // }
+        },
+    }
+}
+</script>
+
+<style scoped lang="scss">
+@import '../../common/css/common.css';
+@import './index.rpx.scss';
+</style>

+ 79 - 0
orderPages/myCoupon/module/index.rpx.css

@@ -0,0 +1,79 @@
+.row-list{
+    width: 686rpx;
+    height: 188rpx;
+    margin-top: 24rpx;
+    background-image: url('/static/coupon/u210.png');
+    background-repeat: no-repeat;
+    background-size: cover;
+}
+
+.listBackground{
+    background-image: url('/static/coupon/u211.png');
+    background-repeat: no-repeat;
+    background-size: cover;
+}
+
+.h-text{
+    width: 200rpx;
+    height: 188rpx;
+}
+.h-center-content{
+    width: 298rpx;
+    height: 188rpx;
+}
+.h-right-content{
+    width: 188rpx;
+    height: 188rpx;
+}
+.money{
+    height: 52rpx;
+    font-size: 36rpx;
+    font-family: DINAlternate-Bold, DINAlternate;
+    font-weight: bold;
+    color: #333333;
+    line-height: 52rpx;
+    text-align: center;
+}
+.desc{
+    height: 36rpx;
+    font-size: 20rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #333333;
+    line-height: 36rpx;
+    text-align: center;
+}
+.h-value{
+    font-size: 28rpx;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: bold;
+    color: #333333;
+    line-height: 44rpx;
+    margin-top: 24rpx;
+    margin-left: 24rpx;
+}
+.title{
+    font-size: 20rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #999999;
+    line-height: 36rpx;
+    margin-left: 24rpx;
+}
+.h-btn-value-use{
+    width: 156rpx;
+    height: 64rpx;
+    background: #93D21A;
+    border-radius: 32rpx;
+
+    font-size: 24rpx;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #FFFFFF;
+    line-height: 64rpx;
+    text-align: center;
+}
+.h-btn-img{
+    width: 136rpx;
+    height: 136rpx;
+}

+ 184 - 0
orderPages/myCoupon/module/mescrollUni-item.vue

@@ -0,0 +1,184 @@
+<template>
+	<!--
+    swiper中的transfrom会使fixed失效,此时用height固定高度;
+    swiper中无法触发mescroll-mixins.js的onPageScroll和onReachBottom方法,只能用mescroll-uni,不能用mescroll-body
+    -->
+	<!-- ref动态生成: 字节跳动小程序编辑器不支持一个页面存在相同的ref (如不考虑字节跳动小程序可固定值为 ref="mescrollRef") -->
+	<!-- top的高度等于悬浮菜单tabs的高度 -->
+	<mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
+		:up="upOption" @up="upCallback" @emptyclick="emptyClick">
+
+		<view class="flex-row justify-center">
+
+			<view class="flex-col">
+
+				<view  class="row-list flex-row justify-start" :class="item.state == '0'?'':'listBackground'" v-for="(item,index) in list" :key="index" >
+
+					<view class="h-text flex-col justify-center ">
+						<view class="money">
+							<text>¥{{item.discountsPrice}}</text>
+						</view>
+						<view class="desc">
+							<text>{{item.name}}</text>
+						</view>
+					</view>
+
+					<view class="h-center-content flex-col ">
+						<view class="h-value">
+							<text>门店通用</text>
+						</view>
+						<view class="title">
+							使用平台:<text v-if="item.strategyType == '0'">全平台</text>
+							<text v-else-if="item.strategyType == '1'">个人优惠卷</text>
+						</view>
+						<view class="title">
+							使用次数:{{item.degree}}
+						</view>
+						<view class="title">
+							到期时间:{{item.endTime.substring(0,10)}}
+						</view>
+					</view>
+
+					<view class="h-right-content flex-col justify-center ">
+							<view v-if="item.state == 0" ></view>
+<!--							<view @click="gotoUseCoupon(item)" v-if="item.state == 0" class="h-btn-value-use">立即使用</view>-->
+							<!-- <view @click="gotoReceiveCoupon()" v-else-if="index == 1" class="h-btn-value-receive">立即领取</view> -->
+							<view v-else-if="item.state == 1" class="h-btn-img">
+								<image class="h-btn-img" src="/static/coupon/u2109.png" mode=""></image>
+							</view>
+							<view v-else class="h-btn-img">
+								<image class="h-btn-img" src="/static/coupon/u2108.png" mode=""></image>
+							</view>
+					</view>
+
+				</view>
+			</view>
+
+
+
+
+		</view>
+
+	</mescroll-uni>
+</template>
+
+<script>
+import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
+export default {
+	mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
+	components: {
+	},
+
+	data() {
+		return {
+			downOption: {
+				auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
+			},
+			upOption: {
+				auto: false, // 不自动加载
+				// page: {
+				// 	num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+				// 	size: 10 // 每页数据的数量
+				// },
+				noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
+				empty: {
+					icon: '/static/imageIcon/empty.png',
+					tip: '暂无内容', // 提示
+					// btnText: '去看看'
+				},
+				textNoMore: '没有更多了'
+			},
+			list: [],
+		}
+	},
+	props: {
+		i: Number, // 每个tab页的专属下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+		index: { // 当前tab的下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+			type: Number,
+			default() {
+				return 0
+			}
+		},
+		dataTime: {
+			type: String,
+			default() {
+				return ''
+			}
+		},
+
+		tabs: { // 为了请求数据,演示用,可根据自己的项目判断是否要传
+			type: Array,
+			default() {
+				return []
+			}
+		},
+		height: [Number, String], // mescroll的高度
+
+	},
+	watch: {
+
+	},
+
+	created() {
+	},
+
+	methods: {
+
+
+
+		/*下拉刷新的回调 */
+		downCallback() {
+			// 这里加载你想下拉刷新的数据, 比如刷新轮播数据
+			// loadSwiper();
+			// 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
+			this.mescroll.resetUpScroll()
+		},
+		/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
+		upCallback(page) {
+
+			//联网加载数据
+			let httpData = {
+				pageNum: page.num,
+				pageSize: 10,
+				type: this.index
+			}
+
+			this.$api.getMyCouponList(httpData).then((res) => {
+				//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+				this.mescroll.endSuccess(res.data.rows.length, res.data.rows.length === 10);
+				//设置列表数据
+				if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
+				this.list = this.list.concat(res.data.rows); //追加新数据
+				console.log(this.list)
+			}).catch((err) => {
+				//联网失败, 结束加载
+				this.mescroll.endErr();
+			})
+
+
+		},
+
+		//点击空布局按钮的回调
+		emptyClick() {
+			uni.showToast({
+				title: '点击了按钮,具体逻辑自行实现'
+			})
+		},
+		// 搜索
+		doSearch() {
+			this.list = []; // 先清空列表,显示加载进度
+			this.mescroll.resetUpScroll();
+		},
+
+		gotoUseCoupon(item){
+			console.log(item)
+		}
+
+	}
+}
+</script>
+<style>
+@import '/common/css/common.css';
+@import './index.rpx.css';
+</style>

+ 271 - 0
orderPages/receiveCoupons/index.vue

@@ -0,0 +1,271 @@
+<template>
+  <view class="order-content-wrap">
+
+
+		  <view class="custom-line"></view>
+		  <!-- 当前订单-->
+		  <view class="service-order">
+
+
+			  <!-- 门店列表 -->
+			  <view v-for="(item,index) in countsList" :class="computedStyle(item)" class="store-wrap  bg-img">
+				 <view  class="row-list" >
+					<view  class="store-content">
+						<view class="h-left-content">
+							<view class="h-text">
+								<view class="money">¥{{item.discountsPrice}}</view>
+								<view class="desc">{{item.name}}</view>
+							</view>
+						</view>
+						<view class="h-center-content">
+							<view class="title">
+								<text class="h-value">门店通用</text>
+							</view>
+							<view class="title">
+								使用平台:<text v-if="item.strategyType == '0'">全平台</text>
+								<text v-else-if="item.strategyType == '1'">个人优惠卷</text>
+							</view>
+							<view class="title">
+								有效时间:{{this.dateFormat(item.startTime)}}~{{this.dateFormat(item.endTime)}}
+							</view>
+						</view>
+						<view class="h-right-content">
+							<view class="h-btn">
+								<view @click="gotoReceiveCoupon(item)"  class="h-btn-value-receive">立即领取</view>
+							</view>
+						</view>
+					</view>
+				 </view>
+			  </view>
+
+
+		  <view v-if="countsList.length == 0"  class="footer">
+			<view class="">---暂无数据---</view>
+		  </view>
+		  <view v-if="countsList.length > 0"  class="footer">
+		  	<view class="">---到底了---</view>
+		  </view>
+    </view>
+
+  </view>
+</template>
+ <script>
+export default {
+  data() {
+    return {
+	  currentServiceTab: 'orderTab1', // 当前选中的 Tab
+	  list: [1, 2, 3, 4],
+	  reqParm: {
+		  auth: true,
+		  id: null
+	  },
+	  countsList: []
+    };
+  },
+  onLoad() {
+	// 查询可领取的优惠劵
+	this.getUserDiscountsList();
+  },
+  computed: {
+
+  },
+  methods: {
+	// 日期格式化
+	dateFormat(date){
+	  let time = Date.parse(date);
+	  return uni.$u.date(time, 'yyyy-mm-dd');
+	},
+	// 查询可领取的优惠劵
+	getUserDiscountsList(){
+		let that = this;
+		// 用户绑定门店
+		this.$api.getUserDiscountsList(this.reqParm).then((res)=>{
+			console.log(res.data.data)
+			this.countsList = res.data.data;
+		}).catch(() =>{
+			uni.showToast({
+				title: "操作失败"
+			})
+		})
+	},
+	computedStyle(item) {
+	   return 'bg-img';
+	},
+	// 切换菜单
+	changeServiceTab(tab){
+	  this.currentServiceTab = tab;
+	},
+	// 领取优惠劵
+	gotoReceiveCoupon(item){
+		let that = this;
+		that.reqParm.id = item.id;
+		// 用户绑定门店
+		this.$api.claimCoupon(this.reqParm).then((res)=>{
+			uni.showToast({
+				title: "领取成功"
+			})
+			// 查询可领取的优惠劵
+			that.getUserDiscountsList();
+			// uni.$u.route({
+			// 	url: '/pages/coupon/coupon',
+			// 	params: {}
+			// })
+		}).catch(() =>{
+			uni.showToast({
+				title: "操作失败"
+			})
+		})
+	},
+	// 去使用优惠劵
+	gotoUseCoupon(){
+		uni.$u.route({
+			url: '/pages/index/tabbar',
+			params: {
+				PageCur: 'goods'
+			}
+		})
+	},
+  },
+};
+</script>
+ <style lang="scss" scoped>
+
+ /* 服务订单内容*/
+.service-order-tab-bar{
+	background: #fff;
+	display: flex;
+	justify-content: space-around;
+	height: 50px;
+	background-color: #f5f5f5;
+	.service-order-tab-item{
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 16px;
+		color: #333;
+		line-height: 26px;
+	}
+	.service-order-tab-item.active {
+	  // color: #ff0000;
+	}
+
+	.underline {
+	  border-bottom: 2px solid #FFE05C ;
+	}
+}
+
+.bg-img{
+	background-image: url('/static/coupon/u210.png');
+	background-repeat: repeat;
+	height: 94px;
+	margin: 12px;
+}
+.bg-img1{
+	background-image: url('/static/coupon/u211.png');
+	background-repeat: repeat;
+	height: 94px;
+	margin: 12px;
+}
+
+.service-order{
+	// background: #fff;
+}
+
+/* 门店列表 */
+.store-wrap{
+	border-radius: 2px;
+	padding-bottom: 12px;
+	padding-left: 12px;
+	padding-right: 12px;
+	.row-list{
+		.store-content{
+			display: flex;
+			align-items: center;
+			height: 94px;
+			color: #333333;
+			.h-left-content{
+				width: 26%;
+				text-align: center;
+				.h-text{
+					width: 100%;
+					font-weight: 400;
+					line-height: 18px;
+					font-size: 12px;
+					.money{
+						font-size: 18px;
+						font-weight: bold;
+						line-height: 26px;
+					}
+				}
+			}
+			.h-center-content{
+				width: 50%;
+				padding-left: 12px;
+				.title{
+					width: 100%;
+					color: #999999;
+					font-size: 12px;
+					.h-value{
+						font-size: 14px;
+						line-height: 42px;
+						color: #333333;
+					}
+				}
+			}
+			.h-right-content{
+				width: 24%;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				background-image: url('/static/coupon/u2102.png');
+				height: 94px;
+				font-size: 12px;
+				.h-btn-value-use{
+					background: #FFE05C;
+					color: #333333;
+					height: 30px;
+					width: 80px;
+					text-align: center;
+					line-height: 30px;
+					border-radius: 15px;
+				}
+				.h-btn-value-receive{
+					background: #93D21A;
+					color: #fff;
+					height: 30px;
+					width: 80px;
+					text-align: center;
+					line-height: 30px;
+					border-radius: 15px;
+				}
+				.h-btn-img{
+					display: flex;
+					align-items: center;
+					image{
+						height: 68px;
+						width: 68px;
+					}
+				}
+			}
+		}
+
+	}
+
+}
+
+/* 产品订单 */
+.product-order{
+	margin-top: 12px;
+}
+
+/* 底部 */
+.footer{
+	margin-top: 30px;
+	height: 120px;
+	font-size: 12px;
+	text-align: center;
+	color: #666;
+}
+
+</style>

+ 317 - 0
orderPages/useCoupons/index.vue

@@ -0,0 +1,317 @@
+<template>
+  <view class="order-content-wrap">
+
+		  <!-- 当前订单-->
+		  <view class="service-order">
+
+			  <view @click="noUseCoupon()" class="h-no-use-coupons">
+				  <u-icon name="share-square" color="#333" size="25"></u-icon>
+				  <view class="">
+					  <text>不使用优惠券</text>
+				  </view>
+			  </view>
+
+			  <view v-for="(item,index) in countsList" :class="computedStyle(item)" class="store-wrap  bg-img">
+				 <view  class="row-list" >
+					<view @click="useCoupon(item)"  class="store-content">
+						<view class="h-left-content">
+							<view class="h-text">
+								<view class="money">¥{{item.discountsPrice}}</view>
+								<view class="desc">{{item.name}}</view>
+							</view>
+						</view>
+						<view class="h-center-content">
+							<view class="title">
+								<text class="h-value">门店通用</text>
+							</view>
+							<view class="title">
+								使用平台:全平台
+							</view>
+							<view class="title">
+								有效时间:{{this.dateFormat(item.startTime)}}~{{this.dateFormat(item.endTime)}}
+							</view>
+						</view>
+						<view class="h-right-content">
+							<u-icon v-if="item.id == couponIds" name="checkmark-circle" color="#333" size="25"></u-icon>
+							<view v-else class="no-checked"></view>
+							<view class="h-btn">
+								<!-- <view @click="useCoupon(item)"  class="h-btn-value-receive">选择使用</view> -->
+							</view>
+						</view>
+					</view>
+				 </view>
+			  </view>
+
+		  <view v-if="countsList.length == 0"  class="footer">
+		  	 <view class="">---暂无数据---</view>
+		  </view>
+
+		  <view v-if="countsList.length > 0"  class="footer">
+		  	<view class="">---到底了---</view>
+		  </view>
+    </view>
+
+  </view>
+</template>
+ <script>
+export default {
+  data() {
+    return {
+		  checkboxList1:[
+		  {
+		    name: '苹果',
+		    disabled: false,
+		  },
+		  {
+		    name: '香蕉',
+		    disabled: false,
+		  },
+		  {
+		    name: '橙子',
+		    disabled: false,
+		  },
+		],
+	  checkboxValue1: '',
+	  isChecked: false,
+	  couponIds: null ,
+	  currentServiceTab: 'orderTab1', // 当前选中的 Tab
+	  list: [1, 2, 3, 4],
+	  reqParm: {
+		  auth: true,
+		  type: 0
+	  },
+	  countsList: []
+    };
+  },
+  onLoad(option) {
+  	// 选择的优惠券
+	this.couponIds = option.couponIds;
+	console.log(option.couponIds)
+	// 查询可领取的优惠劵
+	this.getUserDiscountsList();
+  },
+  computed: {
+
+  },
+  methods: {
+	// 日期格式化
+	dateFormat(date){
+	  let time = Date.parse(date);
+	  return uni.$u.date(time, 'yyyy-mm-dd');
+	},
+	// 查询可领取的优惠劵
+	getUserDiscountsList(){
+		let that = this;
+		// 用户绑定门店
+		getMyCouponList({data:this.reqParm}).then((res)=>{
+			console.log(res)
+			this.countsList = res.rows;
+		}).catch(() =>{
+			uni.showToast({
+				title: "操作失败"
+			})
+		})
+	},
+
+
+	computedStyle(item) {
+	   return 'bg-img';
+	},
+	// 切换菜单
+	changeServiceTab(tab){
+	  this.currentServiceTab = tab;
+	},
+	// 领取优惠劵
+	gotoReceiveCoupon(){
+		uni.showToast({
+			title: "领取成功"
+		})
+	},
+	// 去使用优惠劵
+	useCoupon(item){
+		// 选择完成后返回上一页
+		uni.navigateBack({
+		  delta: 1,
+		  success: function(res) {
+		    console.log('返回成功');
+		    // 在这里可以处理选择结果
+			// 可以将选择的内容保存到本地或通过事件传递给上一个页面
+			uni.$emit('selectedDataCouponChild', item);
+		  }
+		});
+	},
+	// 不使用优惠券
+	noUseCoupon(){
+		let data = {
+			id: null,
+			discountsPrice: 0
+		}
+		// 选择完成后返回上一页
+		uni.navigateBack({
+		  delta: 1,
+		  success: function(res) {
+		    console.log('返回成功');
+		    // 在这里可以处理选择结果
+			// 可以将选择的内容保存到本地或通过事件传递给上一个页面
+			uni.$emit('selectedDataCouponChild', data);
+		  }
+		});
+	}
+  },
+};
+</script>
+ <style lang="scss" scoped>
+
+.h-no-use-coupons{
+	display: flex;
+	padding-top: 12px;
+	padding-left: 12px;
+	padding-right: 12px;
+}
+
+ /* 服务订单内容*/
+.service-order-tab-bar{
+	background: #fff;
+	display: flex;
+	justify-content: space-around;
+	height: 50px;
+	background-color: #f5f5f5;
+	.service-order-tab-item{
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 16px;
+		color: #333;
+		line-height: 26px;
+	}
+	.service-order-tab-item.active {
+	  // color: #ff0000;
+	}
+
+	.underline {
+	  border-bottom: 2px solid #FFE05C ;
+	}
+}
+
+.bg-img{
+	background-image: url('/static/coupon/u210.png');
+	background-repeat: repeat;
+	height: 94px;
+	margin: 12px;
+}
+.bg-img1{
+	background-image: url('/static/coupon/u211.png');
+	background-repeat: repeat;
+	height: 94px;
+	margin: 12px;
+}
+
+.service-order{
+	// background: #fff;
+}
+
+/* 门店列表 */
+.store-wrap{
+	border-radius: 2px;
+	padding-bottom: 12px;
+	padding-left: 12px;
+	padding-right: 12px;
+	.row-list{
+		.store-content{
+			display: flex;
+			align-items: center;
+			height: 94px;
+			color: #333333;
+			.h-left-content{
+				width: 26%;
+				text-align: center;
+				.h-text{
+					width: 100%;
+					font-weight: 400;
+					line-height: 18px;
+					font-size: 12px;
+					.money{
+						font-size: 18px;
+						font-weight: bold;
+						line-height: 26px;
+					}
+				}
+			}
+			.h-center-content{
+				width: 60%;
+				padding-left: 12px;
+				.title{
+					width: 100%;
+					color: #999999;
+					font-size: 12px;
+					.h-value{
+						font-size: 14px;
+						line-height: 42px;
+						color: #333333;
+					}
+				}
+			}
+			.h-right-content{
+				width: 14%;
+				display: flex;
+				justify-content: flex-end;;
+				align-items: center;
+				background-image: url('/static/coupon/u2102.png');
+				height: 94px;
+				font-size: 12px;
+				padding-right: 12px;
+				.no-checked{
+					height: 22px;width: 22px;
+					border-radius: 11px;
+					border: 2px solid #999;
+				}
+				.h-btn-value-use{
+					background: #FFE05C;
+					color: #333333;
+					height: 30px;
+					width: 80px;
+					text-align: center;
+					line-height: 30px;
+					border-radius: 15px;
+				}
+				.h-btn-value-receive{
+					background: #FFE05C;
+					color: #333;
+					height: 30px;
+					width: 80px;
+					text-align: center;
+					line-height: 30px;
+					border-radius: 15px;
+					font-size: 14px;
+				}
+				.h-btn-img{
+					display: flex;
+					align-items: center;
+					image{
+						height: 68px;
+						width: 68px;
+					}
+				}
+			}
+		}
+
+	}
+
+}
+
+/* 产品订单 */
+.product-order{
+	margin-top: 12px;
+}
+
+/* 底部 */
+.footer{
+	margin-top: 30px;
+	height: 120px;
+	font-size: 12px;
+	text-align: center;
+	color: #666;
+}
+
+</style>

+ 65 - 14
pages.json

@@ -3,13 +3,7 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
-		},
+
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -44,12 +38,21 @@
 				"navigationStyle": "custom",
 				"enablePullDownRefresh": false
 			}
+		},{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
 		}
 	],
 	"subPackages": [
 		{
 			"root": "loginPages",
 			"pages": [
+
+
+
 				{
 					"path": "login/bind-account",
 					"style": {
@@ -118,6 +121,27 @@
 		{
 			"root": "orderPages",
 			"pages": [
+				{
+					"path": "myCoupon/index",
+					"style": {
+						"navigationBarTitleText": "我的优惠券",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "receiveCoupons/index",
+					"style": {
+						"navigationBarTitleText": "领券中心",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "useCoupons/index",
+					"style": {
+						"navigationBarTitleText": "使用优惠券",
+						"enablePullDownRefresh": false
+					}
+				},
 
 				{
 					"path": "orderDetail/index",
@@ -164,6 +188,39 @@
 		{
 			"root": "myPages",
 			"pages": [
+
+				{
+					"path": "setting/setting-account-password",
+					"style": {
+						"navigationBarTitleText": "设置交易密码",
+						"enablePullDownRefresh": false
+					}
+
+				},
+				{
+					"path": "setting/setting-telphone",
+					"style": {
+						"navigationBarTitleText": "设置手机号",
+						"enablePullDownRefresh": false
+					}
+
+				},
+				{
+					"path": "setting/setting-transaction-password",
+					"style": {
+						"navigationBarTitleText": "账号绑定",
+						"enablePullDownRefresh": false
+					}
+
+				},
+				{
+					"path": "setting/setting-wechat",
+					"style": {
+						"navigationBarTitleText": "绑定微信",
+						"enablePullDownRefresh": false
+					}
+
+				},
 				{
 					"path": "statisticalPanel/index",
 					"style": {
@@ -213,13 +270,7 @@
 						"enablePullDownRefresh": false
 					}
 				},
-				{
-					"path": "coupon/index",
-					"style": {
-						"navigationBarTitleText": "优惠券",
-						"enablePullDownRefresh": false
-					}
-				},
+
 				{
 					"path": "realNameAuth/index",
 					"style": {

+ 27 - 29
pages/index/index.vue

@@ -8,6 +8,7 @@
 				<view class="h-bg">
 					<!-- 轮播图 -->
 					<u-swiper
+							:circular="true"
 							:list="bannerList"
 							:height="340"
 					></u-swiper>
@@ -129,16 +130,16 @@
 						<!-- 导航菜单 -->
 						<view class="horizontal-dashed-line"></view>
 						<view class="menu-tab">
-							<view class="button-wrap">
-								<view @click="gotoComeOrder()" class="btn">
-									<view class="icon">
-										<u-icon name="/static/index/u213.png" color="red" size="30"></u-icon>
-									</view>
-									<view class="name">
-										再来一单
-									</view>
-								</view>
-							</view>
+<!--							<view class="button-wrap">-->
+<!--								<view @click="gotoComeOrder()" class="btn">-->
+<!--									<view class="icon">-->
+<!--										<u-icon name="/static/index/u213.png" color="red" size="30"></u-icon>-->
+<!--									</view>-->
+<!--									<view class="name">-->
+<!--										再来一单-->
+<!--									</view>-->
+<!--								</view>-->
+<!--							</view>-->
 							<view class="button-wrap">
 								<view @click="gotoRechargeService()" class="btn">
 									<view class="icon">
@@ -276,7 +277,9 @@
 
 			// 用户信息
 			this.userInfo = uni.getStorageSync('userInfo');
-			this.getImgUrlByOssId(this.userInfo.selfPhoto);
+			if (this.userInfo.selfPhoto){
+				this.getImgUrlByOssId(this.userInfo.selfPhoto);
+			}
 		},
 		// 分享到朋友圈
 		onShareTimeline() {},
@@ -307,15 +310,14 @@
 			},
 			// 去优惠劵大厅
 			gotoReceiveCoupons(){
-				uni.$u.route({
-					url: '/pages/coupon/receive-coupons',
-					params: {}
+				uni.navigateTo({
+					url: '/orderPages/receiveCoupons/index'
 				})
 			},
 			// 去我的优惠劵页面
 			gotoCoupon(){
 				uni.navigateTo({
-					url: '/myPages/coupon/index?name=lisa',
+					url: '/orderPages/myCoupon/index'
 				})
 			},
 			// 储值服务
@@ -337,10 +339,11 @@
 			},
 			async getImgUrlByBannerOssId(items){
 				for(let i = 0; i <items.length; i++) {
-					this.$api.getImgUrlByOssId({ossId:items[i].slideshowId}).then(res=>{
-						this.bannerList.push(res.data.data[0].url.replace(/^http:/, "https:"))
-					})
-
+					if (items[i].slideshowId){
+						this.$api.getImgUrlByOssId({ossId:items[i].slideshowId}).then(res=>{
+							this.bannerList.push(res.data.data[0].url.replace(/^http:/, "https:"))
+						})
+					}
 				}
 			},
 			// 获取门店列表数据
@@ -435,20 +438,15 @@
 
 			// 去订单页面
 			gotoOrder(){
-				uni.$u.route({
-					url: '/pages/index/tabbar',
-					params: {
-						PageCur: 'orderList'
-					}
+				uni.setStorageSync('orderListIndex',1)
+				uni.switchTab({
+					url: '/pages/order/index',
 				})
 			},
 			// 去商品下单页面
 			gotoGoods(){
-				uni.$u.route({
-					url: '/pages/index/tabbar',
-					params: {
-						PageCur: 'goods'
-					}
+				uni.navigateTo({
+					url: '/orderPages/bookService/index',
 				})
 			},
 

+ 269 - 40
pages/login/login.vue

@@ -1,62 +1,144 @@
 <template>
-	<view class="page">
-		<view class="content">
-			<view class="title flex-col justify-center">
-				<text>HI,您好!</text>
-				<text>欢迎登录</text>
+	<view class="container">
+
+		<view class="login-wrap">
+			<view class="title">
+				<text>HI,您好! 欢迎登录</text>
 			</view>
-			<view class="h-logo  flex-row justify-center">
-				<image class="logo-img" src="../../static/logo.png"></image>
+			<view class="h-logo">
+				<image class="logo-img" src="../../static/logo.png" mode=""></image>
 			</view>
 
-			<button class="login-btn flex-row justify-center" @click="wechatCodeLogin">
+			<!-- <button class="login-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
+              <u-icon name="weixin-fill" color="green" size="26"></u-icon>
+              微信授权手机号登录
+            </button> -->
+
+			<button class="login-btn" @click="authWechatCodeLogin()">
 				<u-icon name="weixin-fill" color="green" size="26"></u-icon>
-				<text class="weixinLogin">授权微信登录</text>
+				授权微信登录
 			</button>
 
 
-<!--			<view class="login-form flex-row justify-between">-->
-<!--				<view class="flex-row">-->
-<!--					<view  class="o"></view>-->
-<!--					<view  class="v"></view>-->
-<!--					<text class="text1">自动登录</text>-->
-<!--				</view>-->
-
-<!--				<view @click="gotoRetieveAccount()" class="forget-acconut-password">-->
-<!--					<text>找回账号</text>-->
-<!--				</view>-->
-<!--			</view>-->
-
-			<view class="bottom flex-row justify-between">
-					<view  class="o"></view>
-					<view  class="v"></view>
-					<view class="login-form1 ">
-						<text class="text2">允许我们在必要的场景下合理使用你的相关信息,且阅读并同意</text>
-						<text class="text3">《会员协议》、《服务对象协《隐私协议》</text>
-						<text class="text2">等内容</text>
+			<view class="login-form">
+				<view class="remember-acconut">
+					<view class="remember-acconut-password">
+						<u-radio-group
+								v-model="radiovalue1"
+								placement="column"
+								@change="groupChange"
+						>
+							<u-radio
+									:customStyle="{marginBottom: '8px'}"
+									v-for="(item, index) in radiolist1"
+									:key="index"
+									:label="item.name"
+									:name="item.name"
+									@change="radioChange"
+							>
+							</u-radio>
+						</u-radio-group>
 					</view>
+					<view @click="gotoRetieveAccount()" class="forget-acconut-password">
+						找回账号
+					</view>
+				</view>
 			</view>
 
+			<view class="login-form">
+				<view class="agreement-content">
+					<u-icon name="checkmark-circle-fill" color="#2979ff" size="20"></u-icon>
+					<view class="agreement">
+						<text>允许我们在必要的场景下合理使用你的相关信息,登录且同意</text>
+						<text @click="gotoAgreement('1','会员协议')" class="text-color">《会员协议》、</text>
+						<text @click="gotoAgreement('2','服务对象协议')" class="text-color">《服务对象协议》、</text>
+						<text @click="gotoAgreement('3','服务对象协议')" class="text-color">《服务对象协议》</text>等内容
+					</view>
+				</view>
+			</view>
+
+
+			<!-- 判断微信是否绑定账号 -->
+			<u-popup :show="show" :round="10"  mode="center" >
+				<view class="h-popo-content">
+					<view class="h-img">
+						<u-icon name="/static/login/u01.png" color="red" size="60"></u-icon>
+					</view>
+					<view class="text">
+						<text>该微信未绑定账号</text>
+					</view>
+					<view class="h-btn-wrap">
+						<view @click="cancelOption" class="h-left-btn">
+							<text>取消</text>
+						</view>
+						<view @click="gotoBindAccount" class="h-right-btn">
+							<text>去绑定</text>
+						</view>
+					</view>
+				</view>
+			</u-popup>
 		</view>
 	</view>
 </template>
-
 <script>
 	export default {
 		data() {
 			return {
-				title: 'Hello'
-			}
+				show: false,
+				userInfo: {
+					username: 'uview-plus UI',
+					password: '',
+					openId: ''
+				},
+				// 基本案列数据
+				radiolist1: [{
+					name: '自动登录',
+					disabled: true
+				}],
+				radiolist2: [{
+					name: '允许我们在必要的场景下合理使用你的相关信息,登录且同意',
+					disabled: true
+				}],
+				// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
+				radiovalue1: '自动登录',
+				radiovalue2: '22222',
+			};
 		},
 		onLoad() {
-
+			this.wechatCodeLogin();
 		},
 		methods: {
+			// 去协议页面
+			gotoAgreement(type,name){
+				uni.navigateTo({
+					url: '/myPages/TermsOfService/index?name='+name + '&type=' + type,
+				})
+			},
+			// 取消操作
+			cancelOption(){
+				this.show = false;
+			},
+			// 去绑定账号
+			gotoBindAccount(){
+				this.show = false;
+				uni.navigateTo({
+					url: '/loginPages/login/bind-account',
+				})
+			},
+			// 自动登录不成功,用户手动授权登录
+			authWechatCodeLogin(){
+				if(!this.userInfo.openId){
+					this.show = true;
+				}
+			},
+			// 微信小程序code自动登录
 			wechatCodeLogin(){
 				let that = this;
+
 				wx.login({
 					success(re) {
 						that.$api.wxAuthLogin({code:re.code}).then(res=>{
+							that.userInfo = res.data.data.userInfo
 							uni.setStorageSync('userInfo',res.data.data.userInfo)
 							uni.setStorageSync('accessToken',res.data.data.access_token)
 							uni.setStorageSync('phoneIsBind',res.data.data.phoneIsBind)
@@ -66,21 +148,168 @@
 									url: '/pages/index/index',
 								})
 							}else {
-								uni.navigateTo({
-									url: '/loginPages/bindAccount/index',
-								})
+								that.show = true
 							}
 
 						})
 
 					},
-				});
+				})
 			},
+			getPhoneNumber (e) {
+				uni.showToast({
+					title: e.detail.code
+				})
+				console.log(e.detail.code)  // 动态令牌
+				console.log(e.detail.errMsg) // 回调信息(成功失败都会返回)
+				console.log(e.detail.errno)  // 错误码(失败时返回)
+			},
+			// 去找回账号页面
+			gotoRetieveAccount(){
+				uni.navigateTo({
+					url: '/loginPages/login/retrieve-account',
+				})
+			},
+
+			groupChange(n) {
+				console.log('groupChange', n);
+			},
+			radioChange(n) {
+				this.radiovalue1 = ""
+				console.log('radioChange', n);
+			},
+		},
+	};
+</script>
+<style lang="scss">
+	page,body{
+		background: #fff;
+	}
+	.container{
+		width: 90%;
+		margin: 0 auto;
+		font-family: PingFangSC-Semibold, PingFang SC;
+		.title{
+			margin-top: 12px;
+			width: 140px;
+			font-size: 24px;
+			font-weight: 600;
+			color: #333333;
+			line-height: 38px;
+		}
+		.h-logo{
+			text-align: center;
+			.logo-img{
+				width: 160px;
+				height: 122px;
+			}
+		}
+		.login-wrap {
+			.account{
+				display: flex;
+			}
+		}
+		.login-btn{
+			text-align: center;
+			color: #333;
+			width: 70%;
+			justify-content: center;
+			margin: 0 auto;
+			margin-top: 50px;
+			height: 40px;
+			line-height: 40px;
+			border-radius: 8px;
+			background: #FFE05C;
+			border-radius: 21px;
+			font-size: 14px;
+			display: flex;
+			.wechat-logo{
+				height: 12px;
+				width: 12px;
+			}
+		}
+		.identifying-code{
+			image{
+				width: 80px;
+				height: 30px;
+			}
+		}
+		.remember-acconut{
+			margin-top: 18px;
+			display: flex;
+			justify-content: space-between;
+			color: #999999;
+			.forget-acconut-password{
+				color: rgb(96, 98, 102);
+				font-size: 15px;
+				line-height: 25px;
+				margin-left: 30%;
+			}
+		}
+		.agreement-content{
+			margin-top: 18px;
+			display: flex;
+			// justify-content: space-between;
+			color: #999999;
+			align-items: center;
+			.agreement{
+				color: rgb(96, 98, 102);
+				padding-left: 1px;
+				font-size: 15px;
+				.text-color{
+					color: blue;
+				}
+			}
 		}
 	}
-</script>
 
-<style>
-	@import '/common/css/common.css';
-	@import './index.rpx.css';
+	.h-popo-content{
+		height: 180px;
+		padding: 12px;
+		width: 300px;
+		text-align: center;
+		font-size: 14px;
+		font-family: PingFangSC-Semibold, PingFang SC;
+		.h-img{
+			padding: 7px;
+			display: flex;
+			justify-content: center;
+
+		}
+		.h-text{
+			margin-top: 12px;
+			font-weight: 400;
+			color: #666666;
+		}
+		.text{
+			margin-top: 6px;
+			font-weight: 400;
+			color: #666666;
+		}
+		.h-btn-wrap{
+			display: flex;
+			justify-content: space-between;
+			color: #333333;
+			text-align: center;
+			margin-top: 14px;
+			.h-left-btn{
+				height: 32px;
+				line-height: 30px;
+				background: #EEEEEE;
+				width: 100px;
+				text-align: center;
+				border-radius: 16px;
+				margin: 0 auto;
+			}
+			.h-right-btn{
+				height: 32px;
+				line-height: 30px;
+				background: #FFE05C;
+				width: 100px;
+				border-radius: 16px;
+				margin: 0 auto;
+
+			}
+		}
+	}
 </style>

+ 1 - 1
pages/my/index.vue

@@ -152,7 +152,7 @@ export default {
 
 		goCoupon(){
 			uni.navigateTo({
-				url:'/myPages/coupon/index'
+				url:'/orderPages/myCoupon/index'
 			})
 		}
 	}

+ 5 - 1
pages/qrCode/index.vue

@@ -53,9 +53,13 @@
 		},
 		onLoad() {
 			// 用户信息
-			this.userInfo = uni.getStorageSync('userInfo');
+
 			let sysInfo = uni.getSystemInfoSync()
 			this.height = sysInfo.screenHeight - (sysInfo.screenWidth/750)*138 + 'px'
+
+		},
+		onShow(){
+			this.userInfo = uni.getStorageSync('userInfo');
 			this.getImgUrlByOssId(this.userInfo.selfPhoto, 1)
 			this.getImgUrlByOssId(this.userInfo.wxQrCode, 2)
 		},