123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779 |
- <template>
- <div class="userPage flex-col">
- <div class="userPageBox">
- <s-header :name="sys ? sys.title : $t('user.personalCenter')" :noback="true" :isFixed="false"></s-header>
- <div class="userBaseBox">
- <div class="baseRow flex-row justify-between">
- <div class="group2 flex-col"></div>
- <span class="baseText">{{ $t("user.essentialInformation") }}</span>
- </div>
- <div class="userMessage flex-row justify-between">
- <div class="userId">
- <p class="userText">{{ accountDetail.managerId }}</p>
- <p class="userText">{{ $t("user.systemId") }}</p>
- </div>
- <div class="userLine"></div>
- <div class="userId">
- <p class="userText">{{ accountDetail.username }}</p>
- <p class="userText">{{ $t("user.myAccount") }}</p>
- </div>
- <div class="userLine"></div>
- <div class="userId">
- <p class="userText">{{ accountDetail.name }}</p>
- <p class="userText">{{ $t("user.myName") }}</p>
- </div>
- </div>
- <div class="userInfoBox">
- <!-- 地区 -->
- <div v-if="isInland && user.type != '0'">
- <div v-if="!areaShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.region") }}: </span>
- <div class="cust_vantBorder">
- <div class="filedInpPad">
- <van-field @click-input="fieldValueInpClk" readonly clearable v-model="fieldValue"
- :placeholder="$t('user.regionPlace')">
- <template #right-icon>
- <div class="l-flex-RC">
- <van-icon v-if="fieldValue" @click="
- fieldValue = '';
- accountDetail.areaId = '';
- " class="o-mr-6" name="clear" />
- <van-icon @click="fieldValueInpClk" name="arrow-down" />
- </div>
- </template>
- </van-field>
- </div>
- </div>
- <van-icon name="edit" class="editIcon" @click="editClk(4)" />
- </div>
- <div v-else class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.region") }}: </span>
- <span>{{ fieldValue }}</span>
- <van-icon name="edit" class="editIcon" @click="editClk(4)" />
- </div>
- </div>
- <!-- 邮箱 -->
- <div v-if="user.type != '0'">
- <div v-if="!mailboxShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
- <div>
- <van-field class="relationClass" v-model="cofficentForm.mailBox" :placeholder="$t('user.mailboxPlace')">
- <template #button>
- <van-button type="primary" @click="mailboxChg(cofficentForm.mailBox, 2)">{{ $t("user.confirmLog") }}
- </van-button>
- </template>
- </van-field>
- </div>
- <van-icon name="edit" class="editIcon" @click="editClk(2)" />
- </div>
- <div v-else class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.mailbox") }}: </span>
- <span>{{ accountDetail.email }}</span>
- <van-icon name="edit" class="editIcon" @click="editClk(2)" />
- </div>
- </div>
- <!-- 上级账号 -->
- <div v-if="isInland && user.type == '2'">
- <div v-if="haveRelation" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.superiorAccount") }}: </span>
- <span>{{ relationAdminName }}</span>
- </div>
- </div>
- <!-- 手机号码 -->
- <div v-if="user.type != '0'">
- <div v-if="!phoneNumberShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
- <div>
- <van-field class="relationClass" v-model="cofficentForm.phone" :placeholder="$t('user.phoneNumberPlace')">
- <template #button>
- <van-button type="primary" @click="mailboxChg(cofficentForm.phone, 3)">{{ $t("user.confirmLog") }}
- </van-button>
- </template>
- </van-field>
- </div>
- <van-icon name="edit" class="editIcon" @click="editClk(3)" />
- </div>
- <div v-else class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.phoneNumber") }}: </span>
- <span>{{ accountDetail.phone }}</span>
- <van-icon name="edit" class="editIcon" @click="editClk(3)" />
- </div>
- </div>
- <!-- 关联上级 -->
- <!-- <div v-if="isInland && user.type == '2'">
- <div v-if="!relationType" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.associateParent") }}: </span>
- <div >
- <van-field class="relationClass" v-model="cofficentForm.associateParent"
- :placeholder="$t('user.associateParentPlace')">
- <template #button>
- <van-button type="primary" @click="mailboxChg(cofficentForm.associateParent, 1)">{{
- $t("user.confirmLog") }}
- </van-button>
- </template>
- </van-field>
- </div>
- <van-icon name="edit" class="editIcon" @click="editClk(1)" />
- </div>
- <div v-else class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.associateParent") }}: </span>
- <span>{{ relationAdminName }}</span>
- <van-icon name="edit" class="editIcon" @click="editClk(1)" />
- </div>
- </div> -->
- <!-- 自定义货币符号 -->
- <div v-if="!symbolShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.currencySymbol") }}: </span>
- <div>
- <van-field class="relationClass" v-model="cofficentForm.currencySymbol"
- :placeholder="$t('user.currencySymbolPlace')">
- <template #button>
- <van-button type="primary" @click="mailboxChg(cofficentForm.currencySymbol, 5)">{{
- $t("user.confirmLog") }}
- </van-button>
- </template>
- </van-field>
- </div>
- <van-icon name="edit" class="editIcon" @click="editClk(5)" />
- </div>
- <div v-else class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.currencySymbol") }}: </span>
- <span>{{ accountDetail.currencySymbol }}</span>
- <van-icon name="edit" class="editIcon" @click="editClk(5)" />
- </div>
- <!-- 切换支付平台 -->
- <div v-if="chaSzPayShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.szPayType") }}: </span>
- <div class="cust_vantBorder o-pl-15">
- <van-switch :model-value="sunzeePay" active-color="#0090fa" inactive-color="#30c25c" size="21px"
- @update:model-value="changeSunzeePay" />
- </div>
- <span class="o-pl-50">{{ $t("user.currentChoose") }}: {{ sunzeePay ? "汇付" : "汇聚" }}</span>
- </div>
- <div v-if="chaScPayShow" class="userInfo l-flex-between">
- <span class="userInfoLeft">{{ $t("user.scPayType") }}: </span>
- <div class="cust_vantBorder o-pl-15">
- <van-switch :model-value="sevencloudPay" active-color="#0090fa" inactive-color="#30c25c" size="21px"
- @update:model-value="changeSevenCloudPay" />
- </div>
- <span class="o-pl-50">{{ $t("user.currentChoose") }}: {{ sevencloudPay ? "汇付" : "汇聚" }}</span>
- </div>
- </div>
- </div>
- <div class="lineBox"></div>
- <div class="commonOperBox">
- <!-- 常用操作 -->
- <div class="baseRow flex-row justify-between">
- <div class="group2 flex-col"></div>
- <span class="baseText">{{ $t("user.commonOperations") }}</span>
- </div>
- <div class="operListBox">
- <!-- 任务消息 -->
- <div v-if="roleCheck()" class="taskListRow flex-col" @click="pushPageList('/taskMessage')">
- <div class="taskIcon taskMessageIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.taskMessage") }}</div>
- </div>
- </div>
- <!-- 提现帐号 -->
- <div v-if="isInland && user.type != '0'" class="taskListRow flex-col" @click="pushPageList('/settlement')">
- <div class="taskIcon joinPayMchIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.settlementAccount") }}</div>
- </div>
- </div>
- <!-- 提现帐号 -->
- <!-- <div v-if="isInland" class="taskListRow flex-col" @click="pushPageList('/joinpayMch')">
- <div class="taskIcon joinPayMchIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.withdrawalAccountNo") }}</div>
- </div>
- </div> -->
- <!-- Airwallex 钱包 -->
- <!-- <div v-if="isAbroad && user.companyType != '1'" class="taskListRow flex-col"
- @click="pushPageList('/airwallex')">
- <div class="taskIcon airwallexIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.airwallex") }}</div>
- </div>
- </div> -->
- <!-- 公告编辑 -->
- <div v-if="user.type == '0'" class="taskListRow flex-col" @click="pushPageList('/announcement')">
- <div class="taskIcon announcementIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">
- {{ $t("user.announcement") }}
- </div>
- </div>
- </div>
- <!-- <div class="taskListRow flex-col" @click="pushPageList('/shandeMch')">
- <div class="taskIcon shandeMchIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">
- {{ $t("user.standbyWithdrawalAccountNo") }}
- </div>
- </div>
- </div>-->
- <!-- 绑定微信 -->
- <div v-if="isInWeChat" class="taskListRow flex-col" @click="pushPageList('/bindWechat')">
- <!-- <div class="taskListRow flex-col" @click="pushPageList('/bindWechat')">-->
- <div class="taskIcon bindWechatIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">
- {{ $t("user.bindWechat") }}
- </div>
- </div>
- </div>
- <!-- 定位修改 -->
- <div v-if="user.type <= '1'" class="taskListRow flex-col" @click="pushPageList('/modifyLoc')">
- <!-- <div class="taskListRow flex-col" @click="pushPageList('/modifyLoc')"> -->
- <div class="taskIcon modifyLocIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">
- {{ $t("user.modifyLoc") }}
- </div>
- </div>
- </div>
- <!-- 数据同步 -->
- <div v-if="user.type == '0'" class="taskListRow flex-col" @click="pushPageList('/syncOldData')">
- <!-- <div class="taskListRow flex-col" @click="pushPageList('/syncOldData')"> -->
- <div class="taskIcon syncOldDataIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">
- {{ $t("user.syncOldData") }}
- </div>
- </div>
- </div>
- <!-- 修改密码 -->
- <div class="taskListRow flex-col" @click="pushPageList('/changepassword')">
- <div class="taskIcon changePasswordIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.changePassword") }}</div>
- </div>
- </div>
- <!-- 意见反馈 -->
- <!-- <div v-if="user.type > 1" class="taskListRow flex-col" @click="pushPageList('/feedback')"> -->
- <div v-if="user.id == 31 || user.id == 34" class="taskListRow flex-col" @click="pushPageList('/feedback')">
- <div class="taskIcon feedbackIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.feedback") }}</div>
- </div>
- </div>
- <!-- 自动充值 -->
- <!-- <div v-if="isInland" class="taskListRow flex-col" @click="operUnipay()">
- <div class="taskIcon selfPayIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.selfRecharging") }}</div>
- </div>
- </div> -->
- <div class="taskListRow flex-col" @click="onperExitSys()">
- <div class="taskIcon loginOutIcon"></div>
- <div class="taskRight">
- <div class="taskTitle">{{ $t("user.logOut") }}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- <nav-bar></nav-bar> -->
- <!-- 退出登录弹窗 -->
- <kDialog :dialogTitle="$t('user.logOutTips')" :cancelBtnTxt="$t('user.cancelLog')"
- :confirmBtnTxt="$t('user.confirmLog')" ref="kDialogRef" :dialogContent="$t('user.logOutContent')"
- @confirmclk="confirmClk">
- </kDialog>
- <!-- 地区弹窗 -->
- <kCascader @getareaname="getAreaName" :selectId="accountDetail.areaId" @areapopfinish="areaPopFinish"
- ref="kCascaderRef"></kCascader>
- </div>
- </template>
- <script>
- // 导入地区弹窗
- import kCascader from "@/components/commom/kCascader/index.vue";
- // 导入接口
- import { getAdmin } from "@/service/merchantManage";
- import { updateAdmin } from "@/service/merchantManage";
- // 引入弹窗
- import kDialog from "@/components/commom/kDialog/index.vue";
- import { onMounted, reactive, ref } from "vue";
- import sHeader from "@/components/SimpleHeader";
- // import navBar from "@/components/NavBar";
- import {
- getLoginUser,
- $M_EmailAvailable,
- $M_PhoneTest,
- } from "@/common/js/utils";
- import { useRouter } from "vue-router";
- import { tAdminGetRelation, updatePayPlatform } from "@/service/user";
- // import { tAdminGetRelation, tAdminSetRelationAdmin, updatePayPlatform } from "@/service/user";
- import { showFailToast, showToast, showSuccessToast, showConfirmDialog } from 'vant';
- import { useI18n } from "vue-i18n";
- import { styleUrl } from "../common/js/utils";
- export default {
- components: { sHeader, kDialog, kCascader },
- setup() {
- // 引入语言
- const { t } = useI18n();
- // 账户信息
- const accountDetail = ref({});
- // 控制地区显示隐藏
- const areaShow = ref(true);
- // 控制手机显示隐藏
- const phoneNumberShow = ref(true);
- // 控制邮箱显示隐藏
- const mailboxShow = ref(true);
- // 控制货币显示隐藏 货币符号,默认“¥”
- const symbolShow = ref(true);
- // 控制切换支付平台按钮显示隐藏
- const chaSzPayShow = ref(false);
- const chaScPayShow = ref(false);
- const sunzeePay = ref(false);
- const sevencloudPay = ref(false);
- const user = getLoginUser();
- const router = useRouter();
- const relationAdminName = ref("");
- const relationType = ref(true);
- const sys = ref(null);
- // 修改的个人信息
- const cofficentForm = reactive({
- associateParent: relationAdminName.value,
- mailBox: accountDetail.value.email,
- phone: accountDetail.value.phone,
- area: "",
- currencySymbol: accountDetail.value.currencySymbol,
- });
- //
- const params = reactive({
- id: '', // 用户ID
- payPlatform: '', //支付平台
- });
- // 点击修改图标
- const editClk = (idx) => {
- switch (idx) {
- case 1:
- cofficentForm.associateParent = relationAdminName.value;
- relationType.value = !relationType.value;
- mailboxShow.value = true;
- phoneNumberShow.value = true;
- areaShow.value = true;
- symbolShow.value = true;
- break;
- case 2:
- cofficentForm.mailBox = accountDetail.value.email;
- relationType.value = true;
- mailboxShow.value = !mailboxShow.value;
- phoneNumberShow.value = true;
- areaShow.value = true;
- symbolShow.value = true;
- break;
- case 3:
- cofficentForm.phone = accountDetail.value.phone;
- relationType.value = true;
- mailboxShow.value = true;
- phoneNumberShow.value = !phoneNumberShow.value;
- areaShow.value = true;
- symbolShow.value = true;
- break;
- case 4:
- cofficentForm.area = accountDetail.value.area;
- relationType.value = true;
- mailboxShow.value = true;
- phoneNumberShow.value = true;
- areaShow.value = !areaShow.value;
- symbolShow.value = true;
- break;
- case 5:
- cofficentForm.currencySymbol = accountDetail.value.currencySymbol;
- relationType.value = true;
- mailboxShow.value = true;
- phoneNumberShow.value = true;
- areaShow.value = true;
- symbolShow.value = !symbolShow.value;
- break;
- }
- };
- // 点击邮箱的确定按钮
- const mailboxChg = async (e, idx) => {
- switch (idx) {
- // case 1:
- // if (!e) {
- // showToast(t("user.associateParentPlace"));
- // } else {
- // const { data } = await tAdminSetRelationAdmin({
- // adminId: user.id,
- // username: e,
- // });
- // relationType.value = true;
- // if (data.code === "00000") {
- // showToast(data.message);
- // setTimeout(() => {
- // gettAdminGetRelation();
- // }, 500);
- // }
- // }
- // break;
- case 2:
- if (!e) {
- showToast(t("user.mailboxPlace"));
- } else if (!$M_EmailAvailable(e)) {
- showToast(t("user.corrEmailPlace"));
- } else {
- const params = {
- id: user.id,
- email: e,
- };
- const { data } = await updateAdmin(params);
- mailboxShow.value = true;
- if (data.code === "00000") {
- showToast(data.message);
- setTimeout(() => {
- getAcccountDetail();
- }, 500);
- }
- }
- break;
- case 3:
- if (!e) {
- showToast(t("user.phoneNumberPlace"));
- } else if (!$M_PhoneTest(e)) {
- showToast(t("user.corrPhonePlace"));
- } else {
- const params = {
- id: user.id,
- phone: e,
- };
- const { data } = await updateAdmin(params);
- phoneNumberShow.value = true;
- if (data.code === "00000") {
- showToast(data.message);
- setTimeout(() => {
- getAcccountDetail();
- }, 500);
- }
- }
- break;
- case 5:
- if (!e) {
- showToast(t("user.currencySymbolPlace"));
- } else {
- const params = {
- id: user.id,
- currencySymbol: e,
- };
- const { data } = await updateAdmin(params);
- symbolShow.value = true;
- if (data.code === "00000") {
- showToast(data.message);
- // 更新本地存储缓存中的currencySymbol的值
- user.currencySymbol = e; // 将新的currencySymbol的值赋值给user
- localStorage.setItem("loginUser", JSON.stringify(user));
- setTimeout(() => {
- getAcccountDetail();
- }, 500);
- }
- }
- break;
- }
- };
- // 获取账户详情
- const getAcccountDetail = () => {
- getAdmin({ id: user.id }).then((res) => {
- accountDetail.value = res.data.data;
- // 查询地址回显
- kCascaderRef.value.init(accountDetail.value.areaId);
- });
- };
- // 获取申泽支付平台
- const getSunzeeDetail = () => {
- getAdmin({ id: 2738 }).then((res) => {
- // sunzeePay.value = res.data.data.payPlatform;
- if (res.data.data.payPlatform == '1') {
- sunzeePay.value = true;
- }
- console.log("sunzeePay", sunzeePay.value)
- });
- };
- // 获取七云支付平台
- const getSevenCloudDetail = () => {
- getAdmin({ id: 2739 }).then((res) => {
- // sevencloudPay.value = res.data.data.payPlatform;
- if (res.data.data.payPlatform == '1') {
- sevencloudPay.value = true;
- }
- console.log("sevencloudPay", sevencloudPay.value)
- });
- };
- // 退出登录弹窗
- const kDialogRef = ref(null);
- // 点击右侧按钮
- const confirmClk = () => {
- // 获取缓存的语言
- const savedCredentials = localStorage.getItem('savedCredentials');
- const curLang = localStorage.getItem("curLang");
- // 清空缓存
- localStorage.clear();
- localStorage.setItem("curLang", curLang);
- if (savedCredentials) {
- localStorage.setItem('savedCredentials', savedCredentials);
- }
- if (sys.value) {
- setTimeout(() => {
- router.push({
- path: "login",
- query: { relation_admin_id: sys.value.relationAdminId },
- });
- }, 200);
- } else {
- setTimeout(() => {
- router.push({ path: "login" });
- }, 200);
- }
- };
- //切换申泽支付平台
- const changeSunzeePay = (value) => {
- showConfirmDialog({
- title: t('user.tips'),
- message: t('user.changeTips'),
- }).then(() => {
- // checked.value = newValue;
- console.log(value);
- params.id = 2738;
- if (value) {
- params.payPlatform = '1';
- } else {
- params.payPlatform = '0';
- }
- const { data } = updatePayPlatform(params);
- if (data.code) {
- showSuccessToast(t('user.changeSuccess'));
- sunzeePay.value = value;
- } else {
- showFailToast(data.message);
- }
- }).catch((error) => {
- console.error(error);
- })
- }
- //切换七云支付平台
- const changeSevenCloudPay = (value) => {
- showConfirmDialog({
- title: t('user.tips'),
- message: t('user.changeTips'),
- }).then(() => {
- // checked.value = newValue;
- console.log(value);
- params.id = 2739;
- if (value) {
- params.payPlatform = '1';
- } else {
- params.payPlatform = '0';
- }
- const { data } = updatePayPlatform(params);
- if (data.code) {
- showSuccessToast(t('user.changeSuccess'));
- sunzeePay.value = value;
- } else {
- showFailToast(data.message);
- }
- }).catch((error) => {
- console.error(error);
- })
- }
- // 初始化页面获取列表
- onMounted(async () => {
- // 加载样式
- styleUrl('user');
- if (localStorage.getItem("loginSys")) {
- const loginSysString = localStorage.getItem("loginSys");
- sys.value = JSON.parse(loginSysString);
- }
- // 获取关联上级
- gettAdminGetRelation();
- // 获取账户
- getAcccountDetail();
- if (user.id == 1) {
- chaSzPayShow.value = true;
- chaScPayShow.value = true;
- getSunzeeDetail();
- getSevenCloudDetail();
- }
- // else if (user.id == 2738) {
- // chaSzPayShow.value = true;
- // getSunzeeDetail();
- // } else if (user.id == 2739) {
- // chaScPayShow.value = true;
- // getSevenCloudDetail();
- // }
- });
- const gettAdminGetRelation = async () => {
- const { data } = await tAdminGetRelation({
- relationAdminId: user.relationAdminId,
- });
- if (typeof data === "string") {
- relationAdminName.value = data;
- }
- };
- const operUnipay = () => {
- router.push({ path: "uniPay" });
- };
- const onperExitSys = () => {
- kDialogRef.value.openDialog();
- };
- const pushPageList = (url) => {
- router.push({ path: url });
- };
- const roleCheck = () => {
- if (user.isAdmined) {
- return true;
- } else {
- const menuList = user.menuCodeList.filter((item) => item === "M6");
- return menuList.length > 0;
- }
- };
- // 地区弹窗
- const fieldValue = ref("");
- const kCascaderRef = ref(null);
- // 点击地区输入框
- const fieldValueInpClk = () => {
- kCascaderRef.value.openPop();
- };
- // 选择地区完成
- const areaPopFinish = async (e) => {
- console.log("e", e);
- fieldValue.value = e.selectName;
- accountDetail.value.areaId = e.selectId;
- const params = {
- id: user.id,
- areaId: e.selectId,
- };
- const { data } = await updateAdmin(params);
- areaShow.value = true;
- if (data.code === "00000") {
- showToast(data.message);
- setTimeout(() => {
- getAcccountDetail();
- }, 500);
- }
- };
- const isInWeChat = ref(false);
- const checkInWechat = () => {
- const ua = window.navigator.userAgent.toLowerCase();
- // 如果是在微信中打开
- if (/MicroMessenger/i.test(ua)) {
- isInWeChat.value = true;
- }
- };
- // 是否内陆或海外
- const isInland = ref(true);
- const isAbroad = ref(false);
- // 是否有上级账号
- const haveRelation = ref(false);
- const haveRelationCheck = () => {
- if (user.relationAdminId !== null) {
- haveRelation.value = true;
- }
- }
- // const checkIsAbroad = async () => {
- // try {
- // const { data } = await getIfForeign(user.id);
- // console.log("isAbroad >>> ", data);
- // if (data.data === '1') {
- // // TODO: 这里先把isAbroad设置为fasle,等开发完成再改成true;
- // isAbroad.value = false;
- // isInland.value = false;
- // }
- // } catch (error) {
- // console.error(error);
- // }
- // };
- const checkIsAbroad = async () => {
- try {
- const userInfo = localStorage.getItem("loginUser");
- const userIfForeign = JSON.parse(userInfo);
- // console.log("用户的海内外信息" + userIfForeign.ifForeign);
- // console.log("看下user是什么***" + user.menuCodeList);
- if (userIfForeign.ifForeign === '1') {
- isAbroad.value = true;
- isInland.value = false;
- }
- } catch (error) {
- console.error(error);
- }
- };
- onMounted(() => {
- checkInWechat();
- checkIsAbroad();
- haveRelationCheck();
- })
- // 获取回显的值
- const getAreaName = (e) => {
- fieldValue.value = e;
- };
- return {
- user,
- operUnipay,
- onperExitSys,
- relationAdminName,
- relationType,
- pushPageList,
- roleCheck,
- sys,
- kDialogRef,
- confirmClk,
- mailboxShow,
- mailboxChg,
- phoneNumberShow,
- editClk,
- cofficentForm,
- params,
- areaShow,
- accountDetail,
- fieldValue,
- kCascaderRef,
- fieldValueInpClk,
- areaPopFinish,
- isInWeChat,
- getAreaName,
- isAbroad,
- haveRelation,
- checkIsAbroad,
- isInland,
- symbolShow,
- chaSzPayShow,
- chaScPayShow,
- sunzeePay,
- sevencloudPay,
- changeSunzeePay,
- changeSevenCloudPay,
- };
- }
- };
- </script>
- <style lang="less" scoped>
- @import "../common/style/mixin";
- @import "../styles/user/index";
- </style>
|