Explorar o código

增加原密码校验,短信验证码校验,订单详情时间修改

1004749546@qq.com %!s(int64=4) %!d(string=hai) anos
pai
achega
b98e243dad

+ 27 - 7
pages/order/orderDetail.vue

@@ -5,7 +5,7 @@
 			<view class="order-status">
 			<view class="order-status">
 				<view class="status-title">{{orderInfo.orderStateDictValue}}</view>
 				<view class="status-title">{{orderInfo.orderStateDictValue}}</view>
 				<view v-if="orderInfo.orderState=='WAIT_PAY'" class="status-care">
 				<view v-if="orderInfo.orderState=='WAIT_PAY'" class="status-care">
-					请在 <text>29</text>分钟内付款,过期系统将自动取消订单
+					请在 <text>{{leftTime}}</text>分钟内付款,过期系统将自动取消订单
 				</view>
 				</view>
 				<view v-if="orderInfo.orderState=='CANCEL'" class="status-care">
 				<view v-if="orderInfo.orderState=='CANCEL'" class="status-care">
 					超时未支付,系统已自动取消订单
 					超时未支付,系统已自动取消订单
@@ -122,7 +122,8 @@
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showSetPswModal: false,  // 设置支付密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showInputPsw: false, // 打开输入密码弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
 				showLeavePsw: false, // 打开确定放弃弹窗
-				orderStatusList: []
+				orderId: '', // 订单id
+				leftTime: null
 			}
 			}
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
@@ -130,19 +131,38 @@
 			uni.$once('setPswSuccess', this.setPsw)
 			uni.$once('setPswSuccess', this.setPsw)
 			if (options.id) {
 			if (options.id) {
 				console.log(options.id)
 				console.log(options.id)
-				this.getOrderDetail(options.id)
-				this.orderStatusList = this.$store.state.vuex_payStatus
+				this.orderId = options.id
+				this.getOrderDetail()
 			}
 			}
+		},
+		computed: {
+			
 		},
 		},
 		methods: {
 		methods: {
+			// 支付剩余时间
+			leftTimeFun() {
+				let nowT = new Date().valueOf() // 现在时间戳
+				let orderT = new Date(this.orderInfo.orderTime).valueOf() // 下单时间戳
+				let tt = (1800 * 1000) - (nowT - orderT)   // 距离30分钟支付 相差时间戳  
+				console.log(tt,'tttttt')
+				if (tt >0) {
+					this.leftTime =  parseInt(tt/(60*1000))
+				} else {
+					// this.getOrderDetail()
+					this.leftTime = '00'
+				}
+			},
 			// 获取订单详情
 			// 获取订单详情
-			getOrderDetail(id) {
-				let payTypeList = this.$store.state.vuex_payType
+			getOrderDetail() {
 				orderDetail({
 				orderDetail({
-					id: id
+					id: this.orderId
 				}).then(res => {
 				}).then(res => {
+					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 					if (res.status == 200) {
 						this.orderInfo = res.data
 						this.orderInfo = res.data
+						if(this.orderInfo.orderState=='WAIT_PAY') {
+							this.leftTimeFun()
+						}
 					} else {
 					} else {
 						uni.showToast({
 						uni.showToast({
 							title: res.message,
 							title: res.message,

+ 14 - 3
pages/userCenter/userInfo/changePayPwd.vue

@@ -15,6 +15,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import { checkPayPwd } from '@/api/order.js'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -29,10 +30,20 @@
 			//  确定
 			//  确定
 			submit(){
 			submit(){
 				if(this.oldPwd){
 				if(this.oldPwd){
-					//  跳转到设置密码
-					uni.redirectTo({
-						url: `/pages/userCenter/userInfo/paymentPwd?oldPwd=${this.oldPwd}`
+					checkPayPwd({oldPayPassword:this.oldPwd}).then(res=>{
+						if(res.status == 200) {
+							//  跳转到设置密码
+							uni.redirectTo({
+								url: `/pages/userCenter/userInfo/paymentPwd?oldPwd=${this.oldPwd}`
+							})
+						} else {
+							uni.showToast({
+								title: res.message,
+								icon: 'none'
+							})
+						}
 					})
 					})
+					
 				}else{
 				}else{
 					uni.showToast({ title: '请输入支付密码', icon: 'none' })
 					uni.showToast({ title: '请输入支付密码', icon: 'none' })
 				}
 				}

+ 19 - 4
pages/userCenter/userInfo/smsVerification.vue

@@ -26,7 +26,8 @@
 <script>
 <script>
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'
-	import { loginPhone, sendVerifyCode } from '@/api/user.js'
+	import { sendVerifyCode } from '@/api/user.js'
+	import { checkCode } from '@/api/order.js'
 	export default {
 	export default {
 		components: {
 		components: {
 			uniPopup,
 			uniPopup,
@@ -67,10 +68,24 @@
 				handler(newVal) {
 				handler(newVal) {
 					// console.log(newVal.length,'NNNNNNNNNNNN')
 					// console.log(newVal.length,'NNNNNNNNNNNN')
 					if(newVal.length==6) {
 					if(newVal.length==6) {
-						//  跳转到设置密码
-						uni.redirectTo({
-							url: `/pages/userCenter/userInfo/paymentPwd?code=${this.value}&mobile=${this.phone}`
+						let params = {
+							mobile: this.phone,
+							verifiCode: newVal
+						}
+						checkCode(params).then(res=>{
+							if(res.status==200) {
+								//  跳转到设置密码
+								uni.redirectTo({
+									url: `/pages/userCenter/userInfo/paymentPwd?code=${this.value}&mobile=${this.phone}`
+								})
+							} else {
+								uni.showToast({
+									title: res.message,
+									icon: 'none'
+								})
+							}
 						})
 						})
+						
 					}
 					}
 				},
 				},
 				deep: true
 				deep: true