|
@@ -188,12 +188,20 @@
|
|
|
</div>
|
|
|
<span class="o-pl-10">{{ $t("user.currentChoose") }}: {{ sevencloudPay ? "汇付" : "汇聚" }}</span>
|
|
|
</div>
|
|
|
-
|
|
|
+ <!-- 订单通知 -->
|
|
|
<div v-if="isInWeChat && user.type == '2'" class="userInfo l-flex-RC">
|
|
|
<span class="userInfoLeft l-flex-RC">{{ $t("user.orderNotice") }}: </span>
|
|
|
<div class="cust_vantBorder">
|
|
|
- <van-switch :model-value="orderNotice" active-color="#0090fa"
|
|
|
- style="font-size: 19px;" @update:model-value="changeOrderNotice" />
|
|
|
+ <van-switch :model-value="orderNotice" active-color="#0090fa" style="font-size: 18px;"
|
|
|
+ @update:model-value="changeOrderNotice" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 设备上下线提醒 -->
|
|
|
+ <div v-if="isInWeChat && user.type == '2'" class="userInfo l-flex-RC">
|
|
|
+ <span class="userInfoLeft l-flex-RC">{{ $t("user.onOffNotice") }}: </span>
|
|
|
+ <div class="cust_vantBorder">
|
|
|
+ <van-switch :model-value="onOffNotice" active-color="#0090fa" style="font-size: 18px;"
|
|
|
+ @update:model-value="changeOnOffNotice" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -299,7 +307,6 @@
|
|
|
|
|
|
<!-- 意见反馈 -->
|
|
|
<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>
|
|
@@ -323,7 +330,6 @@
|
|
|
</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')"
|
|
@@ -345,15 +351,13 @@ 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, updateDIYPassword, updateOrderNotice } from "@/service/user";
|
|
|
-// import { tAdminGetRelation, tAdminSetRelationAdmin, updatePayPlatform } from "@/service/user";
|
|
|
+import { tAdminGetRelation, updatePayPlatform, updateDIYPassword, updateOrderNotice, updateOnOffNotice } from "@/service/user";
|
|
|
import { showFailToast, showToast, showSuccessToast, showConfirmDialog } from 'vant';
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
import { styleUrl } from "../common/js/utils";
|
|
@@ -386,6 +390,8 @@ export default {
|
|
|
|
|
|
// 订单通知开关状态
|
|
|
const orderNotice = ref(false);
|
|
|
+ // 设备上/离线通知开关状态
|
|
|
+ const onOffNotice = ref(false);
|
|
|
|
|
|
const user = getLoginUser();
|
|
|
const router = useRouter();
|
|
@@ -573,6 +579,9 @@ export default {
|
|
|
if (accountDetail.value.orderNotice == "1") {
|
|
|
orderNotice.value = true;
|
|
|
}
|
|
|
+ if (accountDetail.value.onOffNotice == "1") {
|
|
|
+ onOffNotice.value = true;
|
|
|
+ }
|
|
|
// 查询地址回显
|
|
|
kCascaderRef.value.init(accountDetail.value.areaId);
|
|
|
});
|
|
@@ -673,7 +682,7 @@ export default {
|
|
|
console.error(error);
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+ // 切换订单通知开关
|
|
|
const changeOrderNotice = (value) => {
|
|
|
showConfirmDialog({
|
|
|
title: t('user.tips'),
|
|
@@ -688,7 +697,7 @@ export default {
|
|
|
if (data.code == "00000") {
|
|
|
showSuccessToast(value ? t('user.openSuccess') : t('user.closeSuccess'));
|
|
|
orderNotice.value = value;
|
|
|
- } else if(data.code == "A0001") {
|
|
|
+ } else if (data.code == "A0001") {
|
|
|
showToast(t('user.pleaseBindWechat'));
|
|
|
} else {
|
|
|
showFailToast(data.message);
|
|
@@ -698,6 +707,30 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 切换设备通知开关
|
|
|
+ const changeOnOffNotice = (value) => {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: t('user.tips'),
|
|
|
+ message: onOffNotice.value ? t('user.closeOnOffNotice') : t('user.openOnOffNotice'),
|
|
|
+ }).then(async () => {
|
|
|
+ const params = reactive({
|
|
|
+ adminId: user.id,
|
|
|
+ onOffNotice: value ? '1' : '0',
|
|
|
+ });
|
|
|
+ const { data } = await updateOnOffNotice(params);
|
|
|
+ console.log("data", data)
|
|
|
+ if (data.code == "00000") {
|
|
|
+ showSuccessToast(value ? t('user.openSuccess') : t('user.closeSuccess'));
|
|
|
+ onOffNotice.value = value;
|
|
|
+ } else if (data.code == "A0001") {
|
|
|
+ showToast(t('user.pleaseBindWechat'));
|
|
|
+ } else {
|
|
|
+ showFailToast(data.message);
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.error(error);
|
|
|
+ })
|
|
|
+ }
|
|
|
// 初始化页面获取列表
|
|
|
onMounted(async () => {
|
|
|
// 加载样式
|
|
@@ -716,13 +749,6 @@ export default {
|
|
|
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({
|
|
@@ -898,7 +924,9 @@ export default {
|
|
|
changeSunzeePay,
|
|
|
changeSevenCloudPay,
|
|
|
orderNotice,
|
|
|
- changeOrderNotice
|
|
|
+ changeOrderNotice,
|
|
|
+ onOffNotice,
|
|
|
+ changeOnOffNotice,
|
|
|
};
|
|
|
}
|
|
|
};
|