zzzz
2024-03-27 71d9414eea8a2aa2f1bb9cc8f23f0a69973269f5
src/page/home/help.vue
@@ -5,11 +5,10 @@
            <img src="../../assets/img/zuojiantou.png" alt />
         </div>
         <div class="titles">
            <span>{{ $t('bz') }}</span>
        <span>{{ $t("bz") }}</span>
         </div>
      </div>
      <div style="width: 100%;height: 10px;background-color: #f8f8f8;"></div>
    <div style="width: 100%; height: 10px; background-color: #f8f8f8"></div>
      <div class="jy" @click="gohelp(1)">
         <div class="left_gn">
@@ -17,7 +16,7 @@
               <img src="../../assets/img/help.png" alt />
            </div>
            <div class="r_title">
               <span>{{ $t('zgzs') }}</span>
          <span>{{ $t("zgzs") }}</span>
            </div>
         </div>
         <div class="right_gos">
@@ -30,7 +29,7 @@
               <img src="../../assets/img/help.png" alt />
            </div>
            <div class="r_title">
               <span>{{ $t('yszc') }}</span>
          <span>{{ $t("yszc") }}</span>
            </div>
         </div>
         <div class="right_gos">
@@ -43,7 +42,7 @@
               <img src="../../assets/img/help.png" alt />
            </div>
            <div class="r_title">
               <span>{{ $t('fxkz') }}</span>
          <span>{{ $t("fxkz") }}</span>
            </div>
         </div>
         <div class="right_gos">
@@ -56,23 +55,37 @@
               <img src="../../assets/img/help.png" alt />
            </div>
            <div class="r_title">
               <span>{{ $t('wmdfw') }}</span>
          <span>{{ $t("wmdfw") }}</span>
            </div>
         </div>
         <div class="right_gos">
            <img src="../../assets/img/youjiantou.png" alt />
         </div>
      </div>
      <van-popup v-model="settingDialog" position="bottom" :style="{ height: '35%' }" @close="popClose">
         <div class="lang_box" v-for="(item,index) in actions" :key="index" @click="qkclick(item)">
            <div :class="$i18n.locale==item.lang?'lang_box_txt':'lang_box_txta'">{{item.text}}</div>
    <van-popup
      v-model="settingDialog"
      position="bottom"
      :style="{ height: '35%' }"
      @close="popClose"
    >
      <div
        class="lang_box"
        v-for="(item, index) in actions"
        :key="index"
        @click="qkclick(item)"
      >
        <div
          :class="$i18n.locale == item.lang ? 'lang_box_txt' : 'lang_box_txta'"
        >
          {{ item.text }}
        </div>
         </div>
      </van-popup>
      <van-popup v-model="pswDialog" position="bottom" :style="{ height: '40%' }">
        <div class="setting_content">
          <div class="old_password">
            <div class="left_titles">
              <span>{{ $t('hj150') + ':' }}</span>
            <span>{{ $t("hj150") + ":" }}</span>
            </div>
            <div class="right_password_input">
              <input type="password" v-model="oldPassword" />
@@ -80,7 +93,7 @@
          </div>
          <div class="old_password">
            <div class="left_titles">
              <span>{{ $t('hj151') + ':' }}</span>
            <span>{{ $t("hj151") + ":" }}</span>
            </div>
            <div class="right_password_input">
              <input type="password" v-model="newPassword" />
@@ -88,178 +101,177 @@
          </div>
          <div class="old_password">
            <div class="left_titles">
              <span>{{ $t('hj152') + ':' }}</span>
            <span>{{ $t("hj152") + ":" }}</span>
            </div>
            <div class="right_password_input">
              <input type="password" v-model="cirNewPassword" />
            </div>
          </div>
          <div class="btn_setting" @click="changeLoginPsd()">
            <span>{{ $t('hj153') }}</span>
          <span>{{ $t("hj153") }}</span>
          </div>
        </div>
      </van-popup>
   </div>
</template>
<script>
   import * as api from '@/axios/api'
   import {
      Toast,
      MessageBox
   } from 'mint-ui'
   import {
      isNull,
      pwdReg
   } from '@/utils/utils'
import * as api from "@/axios/api";
import { Toast, MessageBox } from "mint-ui";
import { isNull, pwdReg } from "@/utils/utils";
   export default {
      name: 'newUser',
  name: "newUser",
      data() {
         return {
            name: '大狗子',
      name: "大狗子",
            pswDialog:false,
            selectUserFlag: true,
            settingDialog: false,
            oldPassword: '', // 旧密码
            newPassword: '', // 新密码
            cirNewPassword: '', // 确认新密码
      oldPassword: "", // 旧密码
      newPassword: "", // 新密码
      cirNewPassword: "", // 确认新密码
            userInfo: [],
            onlineService: '',
            language:'',
      onlineService: "",
      language: "",
            actions: [
              { text: 'English', icon: require('@/assets/ico/english.png'), lang: 'zh-CN' },
              { text: 'हिंदी', icon: require('@/assets/ico/india.png'), lang: 'en' },
        {
          text: "English",
          icon: require("@/assets/ico/english.png"),
          lang: "zh-CN",
        },
        { text: "हिंदी", icon: require("@/assets/ico/india.png"), lang: "en" },
              // { text: '繁体中文', icon: require('@/assets/ico/tw.png'), lang: 'tw' }
            ]
         }
      ],
    };
      },
      components: {},
      created() {
         this.getUserInfo()
         this.language = window.localStorage.getItem('language')
         console.log(window.localStorage.getItem('language'));
         if(this.language == 'zh-CN'){
            this.language = 'English'
    this.getUserInfo();
    this.language = window.localStorage.getItem("language");
    console.log(window.localStorage.getItem("language"));
    if (this.language == "zh-CN") {
      this.language = "English";
         }else{
            this.language = 'हिंदी'
      this.language = "हिंदी";
         }
      },
      methods: {
         gohelp(e){
            if(e==2){
               this.$router.push('/help_html')
        this.$router.push("/help_html");
            }else if(e==3){
               this.$router.push('/help_fxkz')
        this.$router.push("/help_fxkz");
            }else if(e==4){
               this.$router.push('/help_wdfw')
        this.$router.push("/help_wdfw");
            }
         },
         popClose(){
            this.settingDialog = false
      this.settingDialog = false;
         },
         qkclick(e){
            this.settingDialog = false
            window.localStorage.setItem('language', e.lang)
            this.$i18n.locale = e.lang
            this.language = e.text
      this.settingDialog = false;
      window.localStorage.setItem("language", e.lang);
      this.$i18n.locale = e.lang;
      this.language = e.text;
         },
         clicklang(){
            this.settingDialog = true
      this.settingDialog = true;
         },
         yebclick() {
            this.$router.push('/yeb')
      this.$router.push("/yeb");
         },
         regexNum(str) {
            console.log(str);
            str = str.toString()
      str = str.toString();
            if (str.indexOf(".") == -1) {
               str = str + ".00"
        str = str + ".00";
            }
            var newStr = str.split('.')
            var point = newStr[1]
      var newStr = str.split(".");
      var point = newStr[1];
            if (point.length < 2) {
               point = point + "0"
        point = point + "0";
            }
            var moneyPoint = newStr[0]
      var moneyPoint = newStr[0];
            if (moneyPoint.length <= 3) {
               return moneyPoint + "." + point
        return moneyPoint + "." + point;
            } else {
               var mPoint = moneyPoint.substr(moneyPoint.length - 3, moneyPoint.length)
               var twoPoint = moneyPoint.substr(0, moneyPoint.length - 3)
               var endString = twoPoint.toString().replace(/(\d)(?=(\d{2})+(?!\d))/g, '$1,')
               return endString + "," + mPoint + '.' + point;
        var mPoint = moneyPoint.substr(
          moneyPoint.length - 3,
          moneyPoint.length
        );
        var twoPoint = moneyPoint.substr(0, moneyPoint.length - 3);
        var endString = twoPoint
          .toString()
          .replace(/(\d)(?=(\d{2})+(?!\d))/g, "$1,");
        return endString + "," + mPoint + "." + point;
            }
         },
         goOnline() {
            if (navigator.vibrate) {
               // 支持
               navigator.vibrate([55])
        navigator.vibrate([55]);
            }
            this.$router.push('/service')
      this.$router.push("/service");
         },
         async getInfoSite() {
            let data = await api.getInfoSite()
      let data = await api.getInfoSite();
            if (data.status === 0) {
               this.onlineService = data.data.onlineService
        this.onlineService = data.data.onlineService;
            } else {
               Toast(data.msg)
        Toast(data.msg);
            }
         },
         goWall() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            this.$router.push('/wallet')
      this.$router.push("/wallet");
         },
         gotoa(e){
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            if(e==0){
               this.$router.push('/wallet')
        this.$router.push("/wallet");
            }else if(e==1){
               this.$router.push('/tixian')
        this.$router.push("/tixian");
            }else{
               this.$router.push('/transfers')
        this.$router.push("/transfers");
            }
         },
         subclick() {
            this.$router.push('/SubDK')
      this.$router.push("/SubDK");
         },
         subaclick() {
            this.$router.push('/tixian')
      this.$router.push("/tixian");
         },
         handleZh() {
            this.selectUserFlag = !this.selectUserFlag
      this.selectUserFlag = !this.selectUserFlag;
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            if (navigator.vibrate) {
               // 支持
               navigator.vibrate([55])
        navigator.vibrate([55]);
            }
         },
         async getUserInfo() {
            // 获取用户信息
            let data = await api.getUserInfo()
      let data = await api.getUserInfo();
            if (data.status === 0) {
               // 判断是否登录
               this.$store.commit('dialogVisible', false)
               this.$store.state.userInfo = data.data
               this.userInfo = data.data
        this.$store.commit("dialogVisible", false);
        this.$store.state.userInfo = data.data;
        this.userInfo = data.data;
            } else {
               this.$store.commit('dialogVisible', true)
        this.$store.commit("dialogVisible", true);
            }
         },
         goToTopUp() {
@@ -271,72 +283,72 @@
            //    // 支持
            //    navigator.vibrate([55])
            // }
            this.$router.push('/setting')
      this.$router.push("/setting");
         },
         handleOutLoginClick() {
            // 退出登录
            MessageBox.confirm(this.$t('hj149') + '?', this.$t('hj165'), {
               confirmButtonText: this.$t('hj161'),
               cancelButtonText: this.$t('hj106')
            }).then(() => {
               this.toRegister()
            }).catch(() => {
      MessageBox.confirm(this.$t("hj149") + "?", this.$t("hj165"), {
        confirmButtonText: this.$t("hj161"),
        cancelButtonText: this.$t("hj106"),
            })
        .then(() => {
          this.toRegister();
        })
        .catch(() => {});
         },
         goToSettings() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            // 每次打开dialog 清空密码数据
            this.pswDialog = !this.pswDialog
      this.pswDialog = !this.pswDialog;
            if (this.pswDialog) {
               this.oldPassword = ''
               this.newPassword = ''
               this.cirNewPassword = ''
        this.oldPassword = "";
        this.newPassword = "";
        this.cirNewPassword = "";
            }
         },
         handleGoToTransfer() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            this.$router.push('/transfers')
      this.$router.push("/transfers");
         },
         handleGoToAuthentication() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            this.$router.push('/authentications')
      this.$router.push("/authentications");
         },
         handleGoToAuthenticationaz() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            this.$router.push('/download')
      this.$router.push("/download");
         },
         handleGoToBankCard() {
            if (this.userInfo.length === 0) {
               this.$store.commit('dialogVisible', true)
               return
        this.$store.commit("dialogVisible", true);
        return;
            }
            this.$router.push('/bankCard')
      this.$router.push("/bankCard");
         },
         async toRegister() {
            // 注销登陆
            window.localStorage.removeItem('USERTOKEN') // 清空本地存储 USERTOKEN字段
            this.clearCookie()
            let data = await api.logout()
      window.localStorage.removeItem("USERTOKEN"); // 清空本地存储 USERTOKEN字段
      this.clearCookie();
      let data = await api.logout();
            if (data.status === 0) {
               // Toast(data.msg)
               this.$router.push('/login')
        this.$router.push("/login");
            } else {
               Toast(data.msg)
        Toast(data.msg);
            }
            this.$router.push('/login')
      this.$router.push("/login");
         },
         async changeLoginPsd() {
            // 修改密码
@@ -345,40 +357,39 @@
               isNull(this.newPassword) ||
               isNull(this.cirNewPassword)
            ) {
               Toast(this.$t('hj154'))
               this.settingDialog = false
        Toast(this.$t("hj154"));
        this.settingDialog = false;
            } else if (!pwdReg(this.newPassword)) {
               Toast(this.$t('hj19'))
               this.settingDialog = false
        Toast(this.$t("hj19"));
        this.settingDialog = false;
            } else {
               // 修改密码
               if (this.newPassword === this.cirNewPassword) {
                  let opts = {
                     oldPwd: this.oldPassword,
                     newPwd: this.newPassword
                  }
                  let data = await api.changePassword(opts)
            newPwd: this.newPassword,
          };
          let data = await api.changePassword(opts);
                  if (data.status === 0) {
                     this.changeLoginPsdBox = false
                     Toast(data.msg)
                     this.settingDialog = false
            this.changeLoginPsdBox = false;
            Toast(data.msg);
            this.settingDialog = false;
                  } else {
                     Toast(data.msg)
                     this.settingDialog = false
            Toast(data.msg);
            this.settingDialog = false;
                  }
               } else {
                  Toast(this.$t('hj155'))
                  this.settingDialog = false
          Toast(this.$t("hj155"));
          this.settingDialog = false;
               }
            }
            if (navigator.vibrate) {
               // 支持
               navigator.vibrate([55])
            }
        navigator.vibrate([55]);
         }
      },
   }
  },
};
</script>
<style scoped lang="less">
@@ -455,7 +466,7 @@
      text-align: center;
      line-height: 100px;
      border-bottom: 1px solid #ecf5ff;
      color: #2196F3;
  color: #2196f3;
   }
   .lang_box{
      width: 100%;
@@ -542,7 +553,7 @@
      }
   }
   body {
      background-color: #F8F8F8;
  background-color: #f8f8f8;
   }
   .pages_logo_btn_right {
@@ -563,7 +574,7 @@
      padding: 16px 40px;
      text-decoration: none;
      color: #fff;
      background: #2196F3;
  background: #2196f3;
   }
   .pages_logo_btn {
@@ -634,6 +645,5 @@
            }
         }
      }
   }
</style>