zhb il y a 1 mois
Parent
commit
2f0870b0fb
1 fichiers modifiés avec 284 ajouts et 30 suppressions
  1. 284 30
      pages/activities/index.vue

+ 284 - 30
pages/activities/index.vue

@@ -33,10 +33,10 @@
                                                 @click="openSurplusActivityDialog1()"><text
                                                     v-t="'news_add_field1.activities10_trading_aoyun.item3'"></text></text>
                                             <cwg-link type="pdf" class="action-btn secondary crm-cursor" target="_blank"
-                                                title="wallet.item15" :url="`pdf/pdf13/CWG Prime cwnus-cn.pdf`" />
+                                                title="wallet.item15" :url="`pdf/pdf13/CWG Prime Bonus-cn.pdf`" />
                                             <cwg-link type="pdf" class="action-btn secondary crm-cursor" target="_blank"
                                                 title="Transfer.item7"
-                                                :url="`pdf/pdf13/CWG Markets Prime Bonus Application Pcocess-cn.pdf`" />
+                                                :url="`pdf/pdf13/CWG Markets Prime Bonus Application Process-cn.pdf`" />
                                             <text class="action-btn secondary crm-cursor"
                                                 @click="goMonthlyTaskList()"><text v-t="'wallet.item14'"></text></text>
                                         </view>
@@ -65,7 +65,7 @@
                                                     v-t="'news_add_field1.activities10_trading_aoyun.item3'"></text></text>
                                             <cwg-link type="pdf" class="action-btn secondary crm-cursor" target="_blank"
                                                 title="wallet.item15"
-                                                :url="`pdf/pdf12/CWG Prime Bonuc-${locale}.pdf`" />
+                                                :url="`pdf/pdf12/CWG Prime Bonus-${locale}.pdf`" />
                                             <cwg-link type="pdf"
                                                 v-if="locale == 'cn' || locale == 'zhHant' || locale == 'en'"
                                                 class="action-btn secondary crm-cursor" target="_blank"
@@ -142,7 +142,7 @@
                                     </view>
                                 </view>
                             </view>
-                            <!-- <view class="activity-card" v-for="(item, index) in tableData" :key="index + 'tttt'">
+                            <view class="activity-card" v-for="(item, index) in tableData" :key="index + 'tttt'">
                                 <view class="btn-tag-star" v-if="item.hot">
                                     <i class="el-icon-star-on"></i>
                                 </view>
@@ -172,7 +172,7 @@
                                         </view>
                                     </view>
                                 </view>
-                            </view> -->
+                            </view>
                         </view>
                         <!-- 加载更多状态 -->
                         <view v-if="loadingMore" class="loading-more">
@@ -363,10 +363,10 @@
             :show-footers="true">
             <view class="dia-content">
                 <view class="des1" style="font-size: 14px; line-height: 1.6; margin: 30px 0 50px">
-                    <span v-html="t('wallet.item17')"></span>{{ newTaskList.endTime }}
-                    <span v-html="t('wallet.item18')"></span>{{ newTaskList.tradeVolume }}
-                    <span v-html="t('wallet.item19')"></span>{{ newTaskList.raffleNumber }}
-                    <span v-html="t('wallet.item20')"></span>
+                    <text v-html="t('wallet.item17')"></text>{{ newTaskList.endTime }}
+                    <text v-html="t('wallet.item18')"></text>{{ newTaskList.tradeVolume }}
+                    <text v-html="t('wallet.item19')"></text>{{ newTaskList.raffleNumber }}
+                    <text v-html="t('wallet.item20')"></text>
                 </view>
 
             </view>
@@ -478,11 +478,11 @@
                         <input class="input-field" v-model="NewYear24DataBalance" type="digit" />
                     </view>
                     <view class="tip">
-                        <span v-html="t('news_add_field1.NewYear24.item6')"></span>
-                        <span class="red">${{ NewYear24Data.balance }}</span>
-                        <span v-html="t('news_add_field1.NewYear24.item7')"></span>
-                        <span class="red">${{ NewYear24Data.income }}</span>
-                        <span v-html="t('news_add_field1.NewYear24.item8')"></span>
+                        <text v-html="t('news_add_field1.NewYear24.item6')"></text>
+                        <text class="red">${{ NewYear24Data.balance }}</text>
+                        <text v-html="t('news_add_field1.NewYear24.item7')"></text>
+                        <text class="red">${{ NewYear24Data.income }}</text>
+                        <text v-html="t('news_add_field1.NewYear24.item8')"></text>
                     </view>
                 </view>
 
@@ -495,6 +495,104 @@
         </cwg-popup>
 
         <!-- 现在有的活动 -->
+        <!-- 11111111动态活动申请 -->
+        <cwg-popup v-model:visible="dialogInfoTradingAdd" :title="t('surplusList.item1')" type="center"
+            :mask-click="false" :show-footers="true" width="600px">
+            <view class="dia-content surplusActivityDialog">
+                <view class="content" style="padding: 20px">
+                    <view class="form-item">
+                        <view class="form-label">{{ t('Drawer.Label.ActivityName') }}:</view>
+                        <uni-easyinput :disabled="true" v-model="information.title"
+                            :placeholder="t('placeholder.choose')" type="text" />
+                    </view>
+
+                    <view class="form-item">
+                        <view class="form-label">{{
+                            t('Drawer.Label.ActivityLogin') }}:</view>
+                        <cwg-combox :clearable="false" v-model:value="information.login" :options="loginOptions"
+                            :placeholder="t('placeholder.choose')" />
+                    </view>
+                    <view class="form-item">
+                        <view class="form-label">{{
+                            t('Label.Note') }}:</view>
+                        <uni-easyinput v-model="information.participationNote" :placeholder="t('placeholder.choose')"
+                            type="textarea" autoHeight />
+                    </view>
+                    <view class="form-item">
+                        <checkbox-group :value="information.agree ? ['1'] : []" @change="onAgreeChange">
+                            <label class="checkbox">
+                                <checkbox value="1" :checked="information.agree" />
+                                <view class="crm-cursor" style="display: inline-block; margin-left: 10px;">
+                                    <text>
+                                        <text v-if="!isZh.value" v-t="'Drawer.msg.activityAgree1'"></text>
+                                        <text v-if="locale == 'en'" v-t="'Drawer.msg.activityAgree1'"></text>
+                                        <text v-if="locale == 'en'" v-t="'Drawer.msg.activityAgree2'"></text>
+                                        <text v-t="'Drawer.msg.activityTerms'" @click.stop="toSingle(information.id)"
+                                            style="font-weight: bold; text-decoration: underline;"
+                                            class="crm-cursor"></text>
+                                        <text v-if="!isZh.value" v-t="'Drawer.msg.activityAgree2'"></text>
+                                    </text>
+                                </view>
+                            </label>
+                        </checkbox-group>
+                    </view>
+                </view>
+            </view>
+            <template #footer>
+                <button @click="closeAdd">{{ t('Btn.Cancel') }}</button>
+                <button type="primary" @click="activityApply" :disabled="!information.login || !information.agree">
+                    {{ t('Btn.Confirm') }}
+                </button>
+            </template>
+        </cwg-popup>
+        <!-- 11111111动态活动账户操作 -->
+        <cwg-popup v-model:visible="dialogInfoTradingAdd1" :title="t('surplusList.item1')" type="center"
+            :mask-click="false" :show-footers="true" width="600px">
+            <view class="dia-content surplusActivityDialog">
+                <view class="content" style="padding: 20px">
+                    <view class="form-item">
+                        <view class="form-label">{{ t('Drawer.Label.ActivityName') }}:</view>
+                        <uni-easyinput :disabled="true" v-model="information.title"
+                            :placeholder="t('placeholder.choose')" type="text" />
+                    </view>
+
+                    <view class="form-item">
+                        <view class="form-label">{{
+                            t('Drawer.Label.ActivityList') }}:</view>
+                    </view>
+                    <cwg-tabel ref="tableRef" :columns="columns" :mobilePrimaryFields="mobilePrimaryFields"
+                        :isPages="true" :queryParams="search1" :api="getApplyListApi" @go-pages="goPages">
+                        <template #status="{ row }">
+                            <text v-if="row.status == 1" v-t="'State.ToBeProcessed'"></text>
+                            <text v-if="row.status == 2 && row.completeStatus == 0" v-t="'State.Ongoing'"></text>
+                            <text v-if="row.status == 2 && row.completeStatus == 1"
+                                v-t="'State.InTheProcessing'"></text>
+                            <text v-if="row.status == 2 && row.completeStatus == 2" v-t="'State.Completed'"></text>
+                            <text style="display: block" v-if="row.status == 3">
+                                <text style="display: block" v-t="'State.Refused'"></text>
+                                <text style="display: block">(<text v-t="'State.Participate'"></text>)</text>
+                            </text>
+                            <text style="display: block" v-if="row.completeStatus == 3">
+                                <text style="display: block" v-t="'State.Refused'"></text>
+                                <text style="display: block">(<text v-t="'State.Complete'"></text>)</text>
+                            </text>
+                        </template>
+                        <template #action="{ row }">
+                            <text class="crm-cursor status-tag status-completed" v-if="
+                                row.status == 2 && row.completeStatus == 0
+                            " v-t="'State.Complete'" @click="handleCommand(row)">{{ row.participationNote }}</text>
+                            <text v-else>{{ row.participationNote }}</text>
+                        </template>
+                    </cwg-tabel>
+                </view>
+            </view>
+            <template #footer>
+                <button @click="closeAdd">{{ t('Btn.Cancel') }}</button>
+                <button type="primary" @click="activityApply" :disabled="!information.login">
+                    {{ t('Btn.Confirm') }}
+                </button>
+            </template>
+        </cwg-popup>
         <!-- 11111111Surplus活动弹框 -->
         <cwg-popup v-model:visible="dialogSurplusActivity" :title="t('surplusList.item1')" type="center"
             :mask-click="false" :show-footers="true" width="600px">
@@ -503,6 +601,7 @@
                     <view class="form-item">
                         <view class="form-label">{{
                             t('Custom.Deposit.Title1') }}:</view>
+
                         <cwg-combox :clearable="false" v-model:value="valueInfo" :options="loginComboxOptions"
                             :placeholder="t('placeholder.choose')" @change="handleValueInfoChange" />
                     </view>
@@ -552,7 +651,7 @@ import useUserStore from "@/stores/use-user-store";
 const userStore = useUserStore();
 import { isAfterJuly28 } from "@/utils/dateUtils"
 import { useConfirm } from '@/hooks/useConfirm'
-
+const confirm = useConfirm()
 const { t, locale } = useI18n()
 let { Code, Host05 } = Config
 
@@ -582,11 +681,17 @@ const flag = ref(false)
 const pictLoading = ref(false)
 const openType = ref("")
 const dialogInfoTradingAdd = ref(false) //新增
+const dialogInfoTradingAdd1 = ref(false) //新增
 const imgUrl = ref(Host05)
 const show = ref(false)
 const dialogTableVisible = ref(false)
 const formInfo = ref({}) //传给弹窗的值
-const information = ref<any>({})
+const information = reactive({
+    id: "",
+    title: "",
+    login: "",
+    participationNote: "",
+})
 const hot = ref("")
 const singleData = ref({})
 const anshiClose = ref(true)
@@ -638,7 +743,7 @@ const dialogDealResultCpt_form = reactive({
 })
 const dialogChinaUnionPayCpt = ref(false)
 const tableDataCptFlagCode = ref("")
-
+const isZh = computed(() => ['cn', 'zh', 'zhHant'].includes(locale.value))
 //CWG 现金嘉年华-抽奖
 const newTask = ref(false) //新任务
 const newTaskList = ref({ endTime: "", tradeVolume: "", raffleNumber: "" }) //新任务列表
@@ -965,7 +1070,7 @@ const getSingle = async (id: string) => {
 }
 
 //获取客户申请活动列表
-const getApplyList = async () => {
+const Api = async () => {
     let res = await activityApi.ActivityApplyList({
         page: {
             current: pagerInfo.current,
@@ -1942,29 +2047,177 @@ const handleSearch = () => {
 //新增
 const closeDiaAdd = () => {
     dialogInfoTradingAdd.value = false
+    dialogInfoTradingAdd1.value = false
 }
 
 const closeAdd = (val: boolean) => {
-    dialogInfoTradingAdd.value = val
+    dialogInfoTradingAdd.value = false
+    dialogInfoTradingAdd1.value = false
 }
 
 const confirmToReload = () => {
     dialogInfoTradingAdd.value = false
+    dialogInfoTradingAdd1.value = false
     searchFunc()
 }
 
+//获取客户申请活动列表
+//点击操作的回调
+
+const tableRef = ref(null)
+const handleCommand = (command) => {
+    if (command.type == "check") {
+        ActivityComplete(command.id);
+    }
+}
+const ActivityComplete = async (id: number) => {
+    await confirm({
+        title: t("news_add_field.ApplicationDialog.ActivitiesDes"),
+        content: t("Msg.SystemPrompt"),
+        confirmText: t("Btn.item6"),
+        cancelText: t("Btn.item7"),
+    })
+    if (flag.value) {
+        return;
+    } else {
+        flag.value = true;
+    }
+    let res = await activityApi.ActivityComplete({ id: id });
+    if (res.code == Code.StatusOK) {
+        tableRef.value?.reload()
+        uni.showToast({
+            title: t("Msg.Success"),
+            icon: "success",
+        })
+        flag.value = false;
+    } else {
+        uni.showToast({
+            title: res.msg,
+            icon: "none",
+        })
+        flag.value = false;
+    }
+}
+// 表格列配置(支持插槽和格式化)
+const columns = computed(() => [
+    {
+        prop: 'login',
+        label: t('Drawer.Label.TradingAccount'),
+        align: 'center',
+        formatter: ({ row }) => row.login || '--'
+    },
+    {
+        prop: 'addTime',
+        label: t('Drawer.Label.Date'),
+        align: 'center',
+        formatter: ({ row }) => row.addTime || '--'
+    },
+    {
+        prop: 'status',
+        label: t('Drawer.Label.Status'),
+        align: 'center',
+        slot: 'status'
+    },
+    {
+        label: t('Label.Note'),
+        align: 'center',
+        type: 'note'
+    },
+    {
+        prop: 'action',
+        label: t('Label.Action'),
+        align: 'center',
+        slot: 'action'
+    }
+])
+//获取申请活动所需数据
+const getStatus = async () => {
+    let res = await activityApi.ActivityInfo({
+        activityId: information.id,
+    });
+    if (res.code == Code.StatusOK) {
+        loginOptions.value = res.data.map((item: any) => ({
+            text: item.login,
+            value: item.login,
+            disable: item.status == 1 ||
+                information.groupTypes.indexOf(item.groupType) == '-1' ||
+                information.loginTypes.indexOf(item.type) == '-1'
+        }))
+    } else {
+        uni.showToast({
+            title: res.msg,
+            icon: "none",
+        })
+    }
+}
+//申请活动
+const activityApply = async () => {
+
+    if (!information.agree) {
+        uni.showToast({
+            title: t("Msg.SystemPrompt"),
+            icon: "none",
+        })
+        return;
+    }
+    if (flag.value) {
+        return;
+    } else {
+        flag.value = true;
+    }
+
+    try {
+        let res = await activityApi.ActivityApply({
+            activityId: information.id,
+            ...information,
+        });
+        if (res.code == Code.StatusOK) {
+            confirmToReload();
+            uni.showToast({
+                title: t("Msg.Success"),
+                icon: "none",
+            })
+            flag.value = false;
+        } else {
+            uni.showToast({
+                title: res.msg,
+                icon: "none",
+            })
+            flag.value = false;
+        }
+    } catch (error) {
+        uni.showToast({
+            title: error?.msg,
+            icon: "none",
+        })
+        flag.value = false;
+    }
+}
+const getApplyListApi = ref(null)
+const search1 = reactive({
+    activityId: ''
+})
+
 //申请列表弹出
 const checkActivity = (val: any) => {
-    information.value.id = val.id
-    information.value.title = val.title
-    openType.value = "activity_List"
-    dialogInfoTradingAdd.value = true
+    information.id = val.id
+    information.title = val.title
+    dialogInfoTradingAdd1.value = true
+    getApplyListApi.value = activityApi.ActivityApplyList
+    search1.activityId = information.id
 }
 
+
+
+//回显
+const onAgreeChange = (e) => {
+    information.agree = e.detail.value.length > 0
+}
 //申请活动弹出
 const applications = (val: any) => {
-    information.value.id = val.id
-    information.value.title = val.title
+    information.id = val.id
+    information.title = val.title
+    getStatus()
     let loginType: any[] = []
     val.loginTypes.forEach((item: any) => {
         loginType.push(item.loginType)
@@ -1973,10 +2226,11 @@ const applications = (val: any) => {
     val.groupTypes.forEach((item: any) => {
         groupType.push(item.groupType)
     })
-    information.value.loginTypes = loginType
-    information.value.groupTypes = groupType
-    information.value.myType12 = 1
-    openType.value = "appl_activity"
+    information.loginTypes = loginType
+    information.groupTypes = groupType
+    information.myType12 = 1
+    console.log(information, 1212);
+
     dialogInfoTradingAdd.value = true
 }
 
@@ -2073,7 +2327,7 @@ onMounted(() => {
     is20Open()
     searchFunc()
     searchFunc1()
-    // getActivityPercentageGiveInfo()
+    getActivityPercentageGiveInfo()
     Activity23HundredInfo()
     // Activity23JiangxinInfo()
     Activity23JiangxinInfoVip()