Browse Source

feat:查看充值/提现记录,添加输入密码弹窗

tengpanxu 4 months ago
parent
commit
bec2c16fd5

+ 4 - 2
src/api/common.js

@@ -1,5 +1,7 @@
 import request from '@/utils/request'
 
+// 邮箱验证码发送
+export const sendEmail = (data) => request('api/common/send_email', 'post', data, true)
 
-//邮箱验证码发送
-export const sendEmail = (data) => request('api/common/send_email', 'post', data,true)
+//  验证提款密码
+export const verifyPayPass_API = (data) => request('api/member/verifyPayPass', 'post', data)

+ 15 - 0
src/locales/Arab.json

@@ -37,6 +37,21 @@
     "zc":"التسجيل"
   },
 
+  "placeholder": {
+		"emailPlaceId": "أدخل عنوان البريد الإلكتروني",
+		"pwdPlace": "أدخل كلمة المرور",
+    "logOut": "تسجيل الخروج",
+		"logoutTitle": "تسجيل الخروج",
+		"logoutTip": "هل أنت متأكد أنك تريد تسجيل الخروج؟",
+		"logoutCancel": "إلغاء",
+		"logoutSubmit": "موافق",
+		"originalPwd": "الرجاء إدخال كلمة المرور الحالية",
+		"newPwd": "الرجاء تعيين كلمة مرور جديدة",
+		"newPwdTwo": "الرجاء تأكيد كلمة المرور الجديدة مرة أخرى",
+		"payPwd": "الرجاء تعيين كلمة سر السحب",
+		"payPwdTwo": "الرجاء إعادة إدخال كلمة سر السحب"
+	},
+
   "home":{
     "text1":"مركز الأعمال العالمي منصة الإنترنت",
     "text2":"حجز التذاكر وتصفح مواقع السفر العالمية الساخنة",

+ 15 - 0
src/locales/en.json

@@ -37,6 +37,21 @@
 		  "zc":"Sign Up"
 	},
 
+	"placeholder": {
+		"emailPlaceId": "Enter your email address",
+		"pwdPlace": "Enter password",
+    "logOut": "Log out",
+		"logoutTitle": "Log out",
+		"logoutTip": "Are you sure you want to log out?",
+		"logoutCancel": "Cancel",
+		"logoutSubmit": "Confirm",
+		"originalPwd": "Please enter the current password",
+		"newPwd": "Please set a new password",
+		"newPwdTwo": "Please confirm your new password again",
+		"payPwd": "Please set a withdrawal password",
+		"payPwdTwo": "Confirm withdrawal password again"
+	},
+
 	"home":{
 		  "text1":"Global Merchant Center Internet Platform",
 		  "text2":"Book tickets and browse popular travel attractions around the world",

+ 15 - 0
src/locales/zh-CN.json

@@ -37,6 +37,21 @@
 	  "zc":"註冊"
   },
 
+	"placeholder": {
+		"emailPlaceId": "輸入電郵地址",
+		"pwdPlace": "輸入密碼",
+    "logOut": "登出帳號",
+		"logoutTitle": "登出帳號",
+		"logoutTip": "您確定要登出嗎?",
+		"logoutCancel": "取消",
+		"logoutSubmit": "確定",
+		"originalPwd": "請輸入原密碼",
+		"newPwd": "請設定新密碼",
+		"newPwdTwo": "請再次確認新密碼",
+		"payPwd": "請設定提款密碼",
+		"payPwdTwo": "請再次確認提款密碼"
+	},
+
   "home":{
 	  "text1":"全球商戶中心互聯網平臺",
 	  "text2":"預訂門票和瀏覽全球熱門旅行景點",

+ 154 - 33
src/views/Forestage/Me/index.vue

@@ -13,7 +13,7 @@
 			<div class="box-2 fs-18 hand-cursor " :class="navType==6?'fc-755C82 bg-c-f fw-700':'fc-f fw-400'" @click="selectType(6)">{{$t('home6.nav6')}}</div>
 		</div>
 		<div class="flex-1 ">
-			<MyMoney v-if="navType == 1" ref="myMoney"></MyMoney>
+			<MyMoney v-if="navType == 1" ref="myMoney" @record="openPwdPopup" :showList="showList" @success="closePwdPopup"></MyMoney>
 			<MyOrder v-else-if="navType == 2" ref="myOrder"></MyOrder>
 			<Msg v-else-if="navType == 3" ref="msg"></Msg>
 			<Secure v-else-if="navType == 4" ref="secure"></Secure>
@@ -21,42 +21,86 @@
 			<AboutUs v-else-if="navType == 6" ref="aboutUs"></AboutUs>
 		</div>
 	</div>
+
+  <Bounced v-if="dialogVisible" :dialogVisible="dialogVisible" :titleName="''" bouncedWidth="400px">
+      <template slot="from">
+        <div class="pwd-container">
+          <div class="head">
+            <div class="label">{{ $t('home5.text16') }}</div>
+            <div class="close" @click="closePwdPopup">
+              <img class="close-img" src="@/assets/img/close.png"></img>
+            </div>
+          </div>
+          <div class="content">
+            <el-input v-model="payPwd" type="password" :placeholder="$t('home5.text16')"></el-input>
+          </div>
+          <div class="operates">
+            <div class="cancel btn" @click="closePwdPopup">{{ $t('placeholder.logoutCancel') }}</div>
+            <div class="confirm btn" @click="handleConfirmPwd">{{ $t('placeholder.logoutSubmit') }}</div>
+          </div>
+        </div>
+      </template>
+    </Bounced>
   </div>
 </template>
 
 <script>
-	import store from '@/store'
-  import MyMoney from './mod/my-money.vue';
-  import MyOrder from './mod/my-order.vue';
-  import Notice from './mod/notice.vue';
-  import AboutUs from './mod/about-us.vue';
-  import Secure from './mod/secure.vue';
-  import Msg from './mod/msg.vue';
-	
-  export default {
-		components:{MyMoney,MyOrder,AboutUs,Notice,Secure,Msg},
-		data(){
-			return{
-				navType:1,
-			}
-		},
-		mounted() {
-			let index = this.$route.query.index
-			if(index){
-				store.commit('user/setNavActive', 6)
-				this.navType = index;
-			}else{
-				this.navType = 1;
-			}
-		},
-		methods:{
-			selectType(type){
-				if(this.navType!= type){
-					this.navType = type;
-				}
-			},
-		},
+import store from '@/store'
+import tools from '@/utils/tools'
+import MyMoney from './mod/my-money.vue'
+import MyOrder from './mod/my-order.vue'
+import Notice from './mod/notice.vue'
+import AboutUs from './mod/about-us.vue'
+import Secure from './mod/secure.vue'
+import Msg from './mod/msg.vue'
+import Bounced from '@/components/Admin/bounced.vue'
+import { verifyPayPass_API } from '@/api/common.js'
+
+export default {
+  components: { MyMoney, MyOrder, AboutUs, Notice, Secure, Msg, Bounced },
+  data () {
+    return {
+      navType: 1,
+      dialogVisible: false,
+      payPwd: '',
+      showList: false
+    }
+  },
+  mounted () {
+    const index = this.$route.query.index
+    if (index) {
+      store.commit('user/setNavActive', 6)
+      this.navType = index
+    } else {
+      this.navType = 1
+    }
+  },
+  methods: {
+    selectType (type) {
+      if (this.navType != type) {
+        this.navType = type
+      }
+    },
+    openPwdPopup () {
+      this.payPwd = ''
+      this.dialogVisible = true
+    },
+    closePwdPopup () {
+      this.payPwd = ''
+      this.dialogVisible = false
+    },
+    handleConfirmPwd () {
+      if (this.payPwd.length != 6) return
+      verifyPayPass_API({ pay_pass: this.payPwd }).then((res) => {
+        if (res.code === 1) {
+          this.showList = true
+        } else {
+          tools.error(res.msg)
+        }
+      })
+    }
   }
+}
 </script>
 
 <style scoped lang="scss">
@@ -65,7 +109,7 @@
 		min-height: calc(100vh - 92px);
 		padding-top: 70px;
 		background: #C1B5C5;
-		
+
 		.info-box{
 			width: 100%;
 			min-height: 683px;
@@ -89,4 +133,81 @@
 			}
 		}
 	}
+
+  .pwd-container {
+    /* width: 400px; */
+    height: 200px;
+    margin: 0 auto;
+
+    .head {
+      position: relative;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      height: 25%;
+
+      .label {
+        color: #171717;
+        font-size: 18px;
+      }
+
+      .close {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        position: absolute;
+        top: 12px;
+        right: 10px;
+        z-index: 999;
+        width: 25px;
+        height: 25px;
+        background-color: #f1f1f1;
+        border-radius: 50%;
+        cursor: pointer;
+
+        .close-img {
+          width: 14px;
+          height: 14px;
+        }
+      }
+    }
+
+    .content {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      width: 72%;
+      height: 30%;
+      margin: 0 auto;
+      padding: 20px;
+    }
+
+    .operates {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      .btn {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 160px;
+        height: 32px;
+        font-size: 14px;
+        font-weight: 500;
+        border-radius: 10px;
+        cursor: pointer;
+
+        &:not(:first-child) {
+          margin-left: 20px;
+        }
+
+        &.cancel { background-color: #E0E0E0; }
+
+        &.confirm {
+          background-color: #C7AB7B;
+        }
+      }
+    }
+  }
 </style>

+ 107 - 81
src/views/Forestage/Me/mod/my-money.vue

@@ -145,88 +145,115 @@
 </template>
 
 <script>
-	import {getchargelist} from '@/api/money.js';
-	import {getwithdrawList} from '@/api/withdraw.js';
+import { getchargelist } from '@/api/money.js'
+import { getwithdrawList } from '@/api/withdraw.js'
 
-	import {userInfo} from '@/api/member.js';
+import { userInfo } from '@/api/member.js'
 
-	import tools from '@/utils/tools.js';
-	export default {
-		name:"my-money",
-		data(){
-			return{
-				indexType:0,
-				page:1,
-				list:[],
-				total:0,
-				userInfo:{},
-			}
-		},
-		mounted() {
-			this.getInfo();
-		},
-		methods:{
-			getInfo(){
-				userInfo().then((res)=>{
-					if(res.code == 1){
-						this.userInfo = res.data;
-					}
-				})
-			},
-			getchargelist(){
-				getchargelist({page:this.page}).then((res)=>{
-					if(res.code == 1){
-						this.list = res.data.items;
-						this.total = res.data.toatl;
-					}
-				})
-			},
-			getwithdrawList(){
-				getwithdrawList({page:this.page}).then((res)=>{
-					if(res.code == 1){
-						this.list = res.data.items;
-						this.total = res.data.toatl;
-					}
-				})
-			},
-			toIndex(type){
-				this.indexType = type;
-				this.page = 1;
-				this.list = [];
-				this.total = 0;
-				if(type == 1){
-					this.getchargelist();
-				}else if(type == 2){
-					this.getwithdrawList();
-				}
-			},
-			upPage(){
-				if(this.page == 1){
-					return tools.error(this.$t('yddyy'))
-				}else{
-					this.page -= 1;
-					if(this.indexType == 1){
-						this.getchargelist();
-					}else if(type == 2){
-						this.getwithdrawList();
-					}
-				}
-			},
-			downPage(){
-				let flag = (this.page*1)*20 < (this.total * 1);
-				if(!flag){
-					return tools.error(this.$t('mygdsj'))
-				}else{
-					this.page += 1;
-					if(this.indexType == 1){
-						this.getchargelist();
-					}else if(type == 2){
-						this.getwithdrawList();
-					}
-				}
-			},
-		},
-	}
+import tools from '@/utils/tools.js'
+export default {
+  name: 'my-money',
+  data () {
+    return {
+      indexType: 0,
+      page: 1,
+      list: [],
+      total: 0,
+      userInfo: {},
+      currentType: ''
+    }
+  },
+  props: {
+    showList: false
+  },
+  mounted () {
+    this.getInfo()
+  },
+  watch: {
+    showList (val) {
+      if (val) {
+        this.$emit('success')
+        this.indexType = this.currentType
+        this.page = 1
+        this.list = []
+        this.total = 0
+        if (this.currentType == 1) {
+          this.getchargelist()
+        } else if (this.currentType == 2) {
+          this.getwithdrawList()
+        }
+      }
+    }
+  },
+  methods: {
+    getInfo () {
+      userInfo().then((res) => {
+        if (res.code == 1) {
+          this.userInfo = res.data
+        }
+      })
+    },
+    getchargelist () {
+      getchargelist({ page: this.page }).then((res) => {
+        if (res.code == 1) {
+          this.list = res.data.items
+          this.total = res.data.toatl
+        }
+      })
+    },
+    getwithdrawList () {
+      getwithdrawList({ page: this.page }).then((res) => {
+        if (res.code == 1) {
+          this.list = res.data.items
+          this.total = res.data.toatl
+        }
+      })
+    },
+    toIndex (type) {
+      this.currentType = type
+      console.log(this.currentType)
+      if ((type == 1 || type == 2)) {
+        this.$emit('record')
+        return
+      }
+
+      this.indexType = type
+      this.page = 1
+      this.list = []
+      this.total = 0
+      if (type == 1) {
+        this.getchargelist()
+      } else if (type == 2) {
+        this.getwithdrawList()
+      }
+    },
+    upPage () {
+      if (this.page == 1) {
+        return tools.error(this.$t('yddyy'))
+      } else {
+        this.page -= 1
+        if (this.indexType == 1) {
+          this.getchargelist()
+        } else if (type == 2) {
+          this.getwithdrawList()
+        }
+      }
+    },
+    downPage () {
+      const flag = (this.page * 1) * 20 < (this.total * 1)
+      if (!flag) {
+        return tools.error(this.$t('mygdsj'))
+      } else {
+        this.page += 1
+        if (this.indexType == 1) {
+          this.getchargelist()
+        } else if (type == 2) {
+          this.getwithdrawList()
+        }
+      }
+    }
+  }
+}
 </script>
 
 <style scoped lang="scss">
@@ -312,7 +339,6 @@
 			}
 		}
 
-
 		.right-border{
 			border-right: 1px solid #C1B5C5;
 		}