Bläddra i källkod

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
修改

1004749546@qq.com 4 år sedan
förälder
incheckning
4af0b07bc7
3 ändrade filer med 27 tillägg och 8 borttagningar
  1. 1 1
      App.vue
  2. 8 0
      api/order.js
  3. 18 7
      pages/userCenter/userInfo/paymentPwd.vue

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'https://carwash.test.zyucgj.com/gc-shop/' // 预发布
-	const uat_URL = 'http://192.168.16.102:8302/gc-shop/' // 本地
+	const uat_URL = 'http://192.168.16.155:8302/gc-shop/' // 本地
 	const pro_URL = 'https://carwash.zyucgj.com/gc-shop/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 8 - 0
api/order.js

@@ -14,6 +14,14 @@ export const existPayPwd = params => {
     method: 'get',
   })
 };
+// 设置支付密码
+export const setPayPwd = params => {
+  return axios.request({
+    url: `customer/setPayPassword/${params.password}`,
+    method: 'get',
+  })
+};
+
 // 下单 保存订单
 export const saveOrder = params => {
   return axios.request({

+ 18 - 7
pages/userCenter/userInfo/paymentPwd.vue

@@ -14,6 +14,7 @@
 </template>
 
 <script>
+	import {setPayPwd} from '@/api/order.js'
 	export default {
 		data() {
 			return {
@@ -65,13 +66,23 @@
 			checkPwd(){
 				if(this.oPwd == this.tPwd){
 					//  请求接口
-					uni.showToast({ title: '支付密码设置成功', icon: 'none' })
-					 uni.$emit('setPswSuccess', {success: true})
-					setTimeout(()=>{
-						uni.navigateBack({
-						    delta: 1
-						})
-					}, 2000)
+					setPayPwd({password: this.tPwd}).then(res=>{
+						if(res.status==200) {
+							uni.showToast({ title: '支付密码设置成功', icon: 'none' })
+							 uni.$emit('setPswSuccess', {success: true})
+							setTimeout(()=>{
+								uni.navigateBack({
+								    delta: 1
+								})
+							}, 2000)
+						} else {
+							uni.showToast({
+								title: res.message,
+								icon: 'none'
+							})
+						}
+					})
+					
 				}else{
 					uni.showToast({ title: '两次密码不一致请重新输入', icon: 'none' })
 					this.value = ''