|
|
@@ -16,14 +16,25 @@
|
|
|
:rules="rules"
|
|
|
:auto-label-width="true"
|
|
|
>
|
|
|
+ <a-form-item label="游戏名称" field="game_id">
|
|
|
+ <a-select
|
|
|
+ v-model="formData.game_id"
|
|
|
+ :options="gameOptions"
|
|
|
+ placeholder="请选择游戏"
|
|
|
+ search
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
<a-form-item label="开启时间" field="pay_stime">
|
|
|
<a-time-picker
|
|
|
+ style="width: 100%"
|
|
|
v-model="formData.pay_stime"
|
|
|
placeholder="请选择开启时间"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="结束时间" field="pay_etime">
|
|
|
<a-time-picker
|
|
|
+ style="width: 100%"
|
|
|
v-model="formData.pay_etime"
|
|
|
placeholder="请选择结束时间"
|
|
|
/>
|
|
|
@@ -40,11 +51,8 @@
|
|
|
<a-form-item label="屏蔽地区" field="city">
|
|
|
<a-input v-model="formData.city" placeholder="请输入屏蔽地区" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item label="苹果支付" field="apple_pay">
|
|
|
- <sa-switch v-model="formData.apple_pay" />
|
|
|
- </a-form-item>
|
|
|
<a-form-item label="充值渠道开关" field="pay_way">
|
|
|
- <sa-radio v-model="formData.pay_way" dict="open_close" />
|
|
|
+ <sa-radio v-model="formData.pay_way" dict="ios_pay_way" />
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
<!-- 表单信息 end -->
|
|
|
@@ -55,7 +63,8 @@
|
|
|
import { ref, reactive, computed } from "vue";
|
|
|
import tool from "@/utils/tool";
|
|
|
import { Message, Modal } from "@arco-design/web-vue";
|
|
|
-import api from "../../api/iosPayWay";
|
|
|
+import api from "../../api/center/iosPayWay";
|
|
|
+import centerCommonApi from "../../api/center/common";
|
|
|
|
|
|
const emit = defineEmits(["success"]);
|
|
|
// 引用定义
|
|
|
@@ -63,6 +72,7 @@ const visible = ref(false);
|
|
|
const loading = ref(false);
|
|
|
const formRef = ref();
|
|
|
const mode = ref("");
|
|
|
+const gameOptions = ref([]);
|
|
|
|
|
|
let title = computed(() => {
|
|
|
return "ios切支付" + (mode.value == "add" ? "-新增" : "-编辑");
|
|
|
@@ -71,6 +81,7 @@ let title = computed(() => {
|
|
|
// 表单初始值
|
|
|
const initialFormData = {
|
|
|
id: null,
|
|
|
+ game_id: null,
|
|
|
pay_stime: "",
|
|
|
pay_etime: "",
|
|
|
pay_money: 45,
|
|
|
@@ -78,7 +89,7 @@ const initialFormData = {
|
|
|
reg_day: 1,
|
|
|
city: "",
|
|
|
apple_pay: 1,
|
|
|
- pay_way: "0",
|
|
|
+ pay_way: 1,
|
|
|
};
|
|
|
|
|
|
// 表单信息
|
|
|
@@ -86,6 +97,8 @@ const formData = reactive({ ...initialFormData });
|
|
|
|
|
|
// 验证规则
|
|
|
const rules = {
|
|
|
+ pay_stime: [{ required: true, message: "开启时间必需填写" }],
|
|
|
+ pay_etime: [{ required: true, message: "结束时间必需填写" }],
|
|
|
game_id: [{ required: true, message: "游戏名称必需填写" }],
|
|
|
pay_money: [{ required: true, message: "充值金额必需填写" }],
|
|
|
pay_num: [{ required: true, message: "充值次数必需填写" }],
|
|
|
@@ -94,6 +107,14 @@ const rules = {
|
|
|
pay_way: [{ required: true, message: "充值渠道开关必需填写" }],
|
|
|
};
|
|
|
|
|
|
+// 获取游戏列表
|
|
|
+const getGameOptionsList = async () => {
|
|
|
+ const res = await centerCommonApi.getGameOptionsApi();
|
|
|
+ if (res.code == 200) {
|
|
|
+ gameOptions.value = res.data;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 打开弹框
|
|
|
const open = async (type = "add") => {
|
|
|
mode.value = type;
|
|
|
@@ -105,7 +126,9 @@ const open = async (type = "add") => {
|
|
|
};
|
|
|
|
|
|
// 初始化页面数据
|
|
|
-const initPage = async () => {};
|
|
|
+const initPage = async () => {
|
|
|
+ await getGameOptionsList();
|
|
|
+};
|
|
|
|
|
|
// 设置数据
|
|
|
const setFormData = async (data) => {
|