|
@@ -61,7 +61,7 @@
|
|
|
@setCurrencyList="setCurrentCurrencyInfo"></currency-list>
|
|
|
</div>
|
|
|
|
|
|
- <div class="left">
|
|
|
+ <div class="left" v-if="showComType != 'preview'">
|
|
|
<div class="gift-pack-wrapper">
|
|
|
<img class="icon"
|
|
|
:src="require('../../assets/svg/icon-gift-pack.svg')"/>
|
|
@@ -70,7 +70,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="right">
|
|
|
+ <div class="right"
|
|
|
+ :class="{'fill-right': showComType == 'preview'}">
|
|
|
<div class="form-wrapper" v-if="showComType == 'default'">
|
|
|
<img
|
|
|
class="img-mode"
|
|
@@ -284,9 +285,10 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, watch, reactive, defineProps, defineEmits, onMounted, nextTick } from "vue";
|
|
|
-import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord } from "@/http/publishApi";
|
|
|
+import { postPublish, verifyPaypalResult, syncChainTokenRechargeRecord, getCurrencyInfoByCode } from "@/http/publishApi";
|
|
|
import { payCalcFee, getPayConfig } from "@/http/pay";
|
|
|
import { getFrontConfig } from "@/http/account";
|
|
|
+import {setChromeStorage, getChromeStorage} from "@/uilts/chromeExtension"
|
|
|
import { throttle } from "@/uilts/help"
|
|
|
import { ElMessage, ElLoading } from "element-plus";
|
|
|
import "element-plus/es/components/message/style/css";
|
|
@@ -305,14 +307,24 @@ const config = {
|
|
|
}
|
|
|
const math = create(all, config);
|
|
|
|
|
|
+//临时货币信息
|
|
|
let tempCurrentCurrencyInfo = ref({});
|
|
|
|
|
|
let paypalClientId = ref("");
|
|
|
-let payConfig = ref({})
|
|
|
+let payConfig = ref({});
|
|
|
let paypalHtml = ref("");
|
|
|
|
|
|
+// 发布后返回的结果
|
|
|
let publishRes = reactive({});
|
|
|
|
|
|
+//弹窗是否展示
|
|
|
+let visible = ref(false);
|
|
|
+
|
|
|
+//弹窗高度
|
|
|
+let dialogHeight = ref(680);
|
|
|
+
|
|
|
+// 当前展示组件内容 default(表单) preview(预览) topUp(充值)
|
|
|
+let showComType = ref("default");
|
|
|
let currentComData = {
|
|
|
default: {
|
|
|
title: "Giveaway",
|
|
@@ -325,36 +337,45 @@ let currentComData = {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
-let visible = ref(false);
|
|
|
-let showComType = ref("default"); // default(表单) preview(预览) topUp(充值)
|
|
|
+// 机器人开关
|
|
|
let openAntiBot = ref(false);
|
|
|
-let dialogHeight = ref(680);
|
|
|
+
|
|
|
// 是否正在提交
|
|
|
let submitIng = ref(false);
|
|
|
+
|
|
|
// 艾特关注人列表
|
|
|
let atUserList = ref([]);
|
|
|
|
|
|
+// 表单错误提示
|
|
|
let iptErrMsgTxt = ref("Select a reward");
|
|
|
|
|
|
// 是否返回
|
|
|
let isBack = ref(false);
|
|
|
+
|
|
|
// 展示消息提示
|
|
|
let showMessageBox = ref(false);
|
|
|
+
|
|
|
// 展示货币列表pop
|
|
|
let showCurrencyPop = ref(false);
|
|
|
|
|
|
+// 展示更多按钮下的选项
|
|
|
let showMoreOption = ref(false);
|
|
|
|
|
|
+// 货币列表的dom
|
|
|
let currencyListDom = ref('');
|
|
|
|
|
|
+// 刷新按钮旋转
|
|
|
let refreshRotate = ref(false);
|
|
|
|
|
|
+// 预览字体大小
|
|
|
let previewFontSize = ref(56);
|
|
|
|
|
|
let postId = ref('');
|
|
|
|
|
|
+// 余额是否同步中
|
|
|
let asyncIng = ref(false);
|
|
|
|
|
|
+// 提交按钮-充值引导提示
|
|
|
let depositGuide = ref(false);
|
|
|
|
|
|
let messageBoxData = ref({
|
|
@@ -428,6 +449,7 @@ watch(
|
|
|
console.log("watch", newVal);
|
|
|
visible.value = newVal;
|
|
|
if (newVal) {
|
|
|
+ getLocalCurrencyInfoByCode();
|
|
|
setTimeout(() => {
|
|
|
setDialogHeight();
|
|
|
}, 300);
|
|
@@ -452,16 +474,19 @@ const close = () => {
|
|
|
* 设置弹窗高度
|
|
|
*/
|
|
|
const setDialogHeight = (resize = false) => {
|
|
|
- let clientHeight = window.innerHeight;
|
|
|
- let gapSafe = 40;
|
|
|
+ nextTick(() => {
|
|
|
+ let clientHeight = window.innerHeight;
|
|
|
+ let gapSafe = 40;
|
|
|
+ console.log('resize',resize)
|
|
|
|
|
|
- if (dialogHeight.value > clientHeight - gapSafe) {
|
|
|
- dialogHeight.value = clientHeight - gapSafe;
|
|
|
- } else {
|
|
|
- if(resize) {
|
|
|
- dialogHeight.value = 680;
|
|
|
+ if (dialogHeight.value > clientHeight - gapSafe) {
|
|
|
+ dialogHeight.value = clientHeight - gapSafe;
|
|
|
+ } else {
|
|
|
+ if(resize) {
|
|
|
+ dialogHeight.value = 680;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
const selectCurrencyPopHandle = () => {
|
|
@@ -494,6 +519,7 @@ const getPayAmount = async (amountValue) => {
|
|
|
return res.data;
|
|
|
};
|
|
|
|
|
|
+
|
|
|
const confirm = () => {
|
|
|
if(depositGuide.value) { //余额不够去充值
|
|
|
goTopUp();
|
|
@@ -509,6 +535,9 @@ const confirm = () => {
|
|
|
submitRequest();
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 货币列表-选中货币
|
|
|
+ */
|
|
|
const selectCurrency = (params) => {
|
|
|
tempCurrentCurrencyInfo.value = params;
|
|
|
depositGuide.value = false;
|
|
@@ -520,6 +549,7 @@ const selectCurrency = (params) => {
|
|
|
});
|
|
|
} else {
|
|
|
currentCurrencyInfo.value = params;
|
|
|
+ setLocalSelectCurrencyInfo(currentCurrencyInfo.value);
|
|
|
showCurrencyPop.value = false;
|
|
|
finalAmountData.value.currencyCode = currentCurrencyInfo.value.currencyCode;
|
|
|
calcDomZoom();
|
|
@@ -544,16 +574,15 @@ const resetFormIpt = () => {
|
|
|
baseFormData.totalCount = "";
|
|
|
}
|
|
|
|
|
|
+const setLocalSelectCurrencyInfo = (params = {}) => {
|
|
|
+ setChromeStorage({ selectCurrencyInfo : JSON.stringify(params)})
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
- * 设置默认使用货币
|
|
|
+ * 获取完货币列表
|
|
|
*/
|
|
|
|
|
|
const setCurrentCurrencyInfo = (params) => {
|
|
|
- let {list} = params;
|
|
|
- if(list && list.length && list[0].data && list[0].data.length) {
|
|
|
- // currentCurrencyInfo.value = list[0].data[0];
|
|
|
- // finalAmountData.value.currencyCode = currentCurrencyInfo.value.currencyCode;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
const messageBoxBlock = ({ title = "", content = "" }) => {
|
|
@@ -575,6 +604,7 @@ const messageBoxConfirm = () => {
|
|
|
*/
|
|
|
const messageBoxCancel = () => {
|
|
|
currentCurrencyInfo.value = tempCurrentCurrencyInfo.value;
|
|
|
+ setLocalSelectCurrencyInfo(currentCurrencyInfo.value);
|
|
|
showMessageBox.value = false;
|
|
|
showCurrencyPop.value = false;
|
|
|
calcDomZoom();
|
|
@@ -974,9 +1004,34 @@ const goTransactionsList = () => {
|
|
|
window.open(`${chrome.runtime.getURL('/iframe/home.html#/transactions')}`)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/**
|
|
|
+ * 默认获取上次选中的货币信息
|
|
|
+ */
|
|
|
+const getLocalCurrencyInfoByCode = () => {
|
|
|
+ if(!currentCurrencyInfo.value.currencyCode) {
|
|
|
+ getChromeStorage('selectCurrencyInfo', (res) => {
|
|
|
+ if(res && res.currencyCode) {
|
|
|
+ getCurrencyInfoByCode({
|
|
|
+ params: {
|
|
|
+ currencyCode: res.currencyCode
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 0 && res.data) {
|
|
|
+ currentCurrencyInfo.value = res.data;
|
|
|
+ tempCurrentCurrencyInfo.value = res.data;
|
|
|
+ onIptSetErrorTxt();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
setFrontConfig();
|
|
|
setPayConfig();
|
|
|
+ getLocalCurrencyInfoByCode();
|
|
|
document.onkeydown = function (e) {
|
|
|
var keyNum = window.event ? e.keyCode : e.which;
|
|
|
let escKey = 27;
|
|
@@ -986,9 +1041,9 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- window.onresize = throttle(function () {
|
|
|
- setDialogHeight(true)
|
|
|
- }, 300)
|
|
|
+ window.addEventListener('resize', function () {
|
|
|
+ setDialogHeight(true);
|
|
|
+ })
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -1494,6 +1549,10 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .fill-right {
|
|
|
+ width: 100% !important;
|
|
|
+ border-bottom-left-radius: 16px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|