Преглед изворни кода

Merge branch 'dev_1.1.2' of https://git.yishihui.com/DeNet/de-net into dev_1.1.2

zhangwei пре 2 година
родитељ
комит
94ba7cca7f

+ 8 - 1
src/view/iframe/red-packet/luck-draw.vue

@@ -677,7 +677,7 @@ function changeNotification(checked) {
     putSetting({
         params: { noticeSwitch }
     }).then(res => {
-        let { code, data } = res;
+        let { code } = res;
         if (code === 0) {
             state.notification_switch = checked
         } else {
@@ -688,6 +688,10 @@ function changeNotification(checked) {
     })
 }
 
+function setNotification(req) {
+    state.notification_switch = req.status;
+}
+
 async function clickReply(params) {
     let _userInfo = await checkIsLogin()
     if (!_userInfo) {
@@ -1921,6 +1925,9 @@ function onRuntimeMsg() {
                     }
                 }
                 break;
+            case 'USER_SETTING':
+                setNotification(req.data)
+                break;
         }
     })
 }

+ 13 - 0
src/view/popup/setting/index.vue

@@ -44,6 +44,19 @@ function change(checked) {
     }).catch(() => {
         noticeStatus.value = !checked
     })
+
+    noticeSetting()
+}
+
+function noticeSetting() {
+    chrome.runtime.sendMessage({
+        actionType: "USER_SETTING",
+        data: {
+            status: noticeStatus.value
+        }
+    }, (response) => {
+        console.log("res", response);
+    });
 }
 
 onBeforeMount(() => {

+ 13 - 2
src/view/popup/tabbar-page/message/index.vue

@@ -210,8 +210,8 @@
     </div>
     <modal
       :visible="modalVisible"
-      title="Early termination of Giveaway?"
-      content="The remaining amount will be returned to your wallet within 1 day."
+      :title="modalTitle"
+      :content="modalContent"
       cancelText="Termination"
       confirmText="Cancel"
       @cancel="modalCancel"
@@ -254,6 +254,8 @@ let pageWrapperDom = ref(null);
 let pageGiveListDom = ref(null);
 
 let modalVisible = ref(false);
+let modalTitle = ref('');
+let modalContent = ref('');
 let terminaTask = {};
 
 let giveList = ref([]);
@@ -367,6 +369,15 @@ const callEventPageMethod = (actionType, data, callback) => {
 const terminaHandler = (params, index) => {
   terminaTask = params;
   terminaTask.index = index;
+
+  // set font
+  if (params && params.postTaskLuckdrop && params.postTaskLuckdrop.luckdropType == 2) {
+    modalTitle.value = `Early Termination of Lottery?`
+    modalContent.value = `This operation will terminate the lottery process and refund the lottery prizes.`
+  } else {
+    modalTitle.value = `Early termination of Giveaway?`
+    modalContent.value = `The remaining amount will be returned to your wallet within 1 day.`
+  }
   modalVisible.value = true;
 };