267 lines
8.9 KiB
JavaScript
267 lines
8.9 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_booking_matchOrder_index = require("../../api/booking/matchOrder/index.js");
|
|
const store_modules_user = require("../../store/modules/user.js");
|
|
const userStore = store_modules_user.useUserStore();
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
logo: "",
|
|
matchId: 0,
|
|
userInfo: {},
|
|
isLogin: false,
|
|
disabled: false,
|
|
// 表单数据
|
|
formData: [
|
|
{
|
|
name: void 0,
|
|
phone: void 0,
|
|
sex: void 0,
|
|
idCardNo: void 0,
|
|
userId: 0,
|
|
matchId: void 0
|
|
}
|
|
],
|
|
// 单选数据源
|
|
sexs: [
|
|
{
|
|
text: "男",
|
|
value: 0
|
|
},
|
|
{
|
|
text: "女",
|
|
value: 1
|
|
}
|
|
],
|
|
rules: {}
|
|
};
|
|
},
|
|
onLoad(option) {
|
|
this.matchId = option.id;
|
|
this.formData[0].matchId = option.id;
|
|
this.logo = common_vendor.index.getStorageSync("app_logo") ? common_vendor.index.getStorageSync("app_logo") : "https://oss.wsdns.cn/20240423/7f6878104a6d4427884721f412ab5441.png?x-oss-process=image/resize,m_fixed,w_100,h_100/quality,Q_90";
|
|
this.reload();
|
|
},
|
|
onShow() {
|
|
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
|
|
this.isLogin = true;
|
|
}
|
|
this.openLogin();
|
|
},
|
|
methods: {
|
|
async reload() {
|
|
const app = this;
|
|
const userInfo = await userStore.fetchUserInfo();
|
|
app.userInfo = userInfo;
|
|
if (userInfo.userId) {
|
|
this.isLogin = true;
|
|
}
|
|
},
|
|
onDisabled() {
|
|
this.disabled = !this.disabled;
|
|
},
|
|
navTo(url) {
|
|
common_vendor.index.navigateTo({
|
|
url
|
|
});
|
|
},
|
|
openUrl(url) {
|
|
if (!this.isLogin) {
|
|
this.$refs.login.open("bottom");
|
|
return false;
|
|
} else {
|
|
common_vendor.index.navigateTo({
|
|
url
|
|
});
|
|
}
|
|
},
|
|
onSexValue(text) {
|
|
this.formData.sex = text;
|
|
},
|
|
addUser() {
|
|
const app = this;
|
|
this.formData.push({
|
|
name: void 0,
|
|
phone: void 0,
|
|
sex: void 0,
|
|
idCardNo: void 0,
|
|
matchId: app.id
|
|
});
|
|
},
|
|
removeUser(index) {
|
|
this.formData.splice(index, 1);
|
|
},
|
|
// 弹出登录提示框
|
|
openLogin() {
|
|
if (!this.isLogin) {
|
|
this.$refs.login.open("bottom");
|
|
return false;
|
|
}
|
|
},
|
|
submit() {
|
|
console.log("表单数据信息:", this.formData);
|
|
api_booking_matchOrder_index.addBatchMatchOrder(this.formData).then((res) => {
|
|
console.log("173", res);
|
|
if (res.code == 1) {
|
|
common_vendor.index.showToast({
|
|
title: res.message,
|
|
icon: "none"
|
|
});
|
|
return false;
|
|
}
|
|
common_vendor.index.showToast({
|
|
title: `报名成功`,
|
|
icon: "success"
|
|
});
|
|
this.formData = [
|
|
{
|
|
name: void 0,
|
|
phone: void 0,
|
|
sex: void 0,
|
|
idCardNo: void 0,
|
|
userId: void 0,
|
|
matchId: void 0
|
|
}
|
|
];
|
|
}).catch((err) => {
|
|
common_vendor.index.showToast({
|
|
title: err.message,
|
|
icon: "none"
|
|
});
|
|
console.log("err: ", err);
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
|
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
|
|
const _easycom_uni_data_checkbox2 = common_vendor.resolveComponent("uni-data-checkbox");
|
|
const _easycom_uv_input2 = common_vendor.resolveComponent("uv-input");
|
|
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
|
|
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
|
|
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
|
|
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
|
|
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
|
|
(_easycom_uni_icons2 + _easycom_uni_easyinput2 + _easycom_uni_forms_item2 + _easycom_uni_data_checkbox2 + _easycom_uv_input2 + _easycom_uni_card2 + _easycom_uni_forms2 + _easycom_uv_button2 + _easycom_uv_gap2 + _easycom_ws_login2)();
|
|
}
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
|
const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js";
|
|
const _easycom_uni_data_checkbox = () => "../../uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.js";
|
|
const _easycom_uv_input = () => "../../uni_modules/uv-input/components/uv-input/uv-input.js";
|
|
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
|
|
const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js";
|
|
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
|
|
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
|
|
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
|
|
if (!Math) {
|
|
(_easycom_uni_icons + _easycom_uni_easyinput + _easycom_uni_forms_item + _easycom_uni_data_checkbox + _easycom_uv_input + _easycom_uni_card + _easycom_uni_forms + _easycom_uv_button + _easycom_uv_gap + _easycom_ws_login)();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: common_vendor.f($data.formData, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.o(($event) => $options.removeUser(index), index),
|
|
b: "8df695a9-2-" + i0 + "," + ("8df695a9-1-" + i0),
|
|
c: "8df695a9-4-" + i0 + "," + ("8df695a9-3-" + i0),
|
|
d: common_vendor.o(($event) => $data.formData[index].name = $event, index),
|
|
e: common_vendor.p({
|
|
type: "text",
|
|
placeholder: "请输入姓名",
|
|
modelValue: $data.formData[index].name
|
|
}),
|
|
f: "8df695a9-3-" + i0 + "," + ("8df695a9-1-" + i0),
|
|
g: "8df695a9-6-" + i0 + "," + ("8df695a9-5-" + i0),
|
|
h: common_vendor.o(($event) => $data.formData[index].sex = $event, index),
|
|
i: common_vendor.p({
|
|
localdata: $data.sexs,
|
|
modelValue: $data.formData[index].sex
|
|
}),
|
|
j: "8df695a9-5-" + i0 + "," + ("8df695a9-1-" + i0),
|
|
k: "8df695a9-8-" + i0 + "," + ("8df695a9-7-" + i0),
|
|
l: common_vendor.o(($event) => $data.formData[index].phone = $event, index),
|
|
m: common_vendor.p({
|
|
type: "text",
|
|
maxlength: "11",
|
|
placeholder: "请输入手机号",
|
|
modelValue: $data.formData[index].phone
|
|
}),
|
|
n: "8df695a9-7-" + i0 + "," + ("8df695a9-1-" + i0),
|
|
o: "8df695a9-10-" + i0 + "," + ("8df695a9-9-" + i0),
|
|
p: common_vendor.o(($event) => $data.formData[index].idCardNo = $event, index),
|
|
q: common_vendor.p({
|
|
placeholder: "请输入",
|
|
modelValue: $data.formData[index].idCardNo
|
|
}),
|
|
r: "8df695a9-9-" + i0 + "," + ("8df695a9-1-" + i0),
|
|
s: index,
|
|
t: "8df695a9-1-" + i0 + ",8df695a9-0",
|
|
v: common_vendor.p({
|
|
title: `报名人 ${index + 1}`,
|
|
border: false,
|
|
["is-shadow"]: true
|
|
})
|
|
};
|
|
}),
|
|
b: common_vendor.p({
|
|
type: "closeempty",
|
|
color: "#999999",
|
|
size: "18"
|
|
}),
|
|
c: common_vendor.p({
|
|
label: "姓名",
|
|
name: "name",
|
|
required: true
|
|
}),
|
|
d: common_vendor.p({
|
|
label: "性别",
|
|
name: "sex",
|
|
required: true
|
|
}),
|
|
e: common_vendor.p({
|
|
label: "手机号码",
|
|
name: "phone",
|
|
required: true
|
|
}),
|
|
f: common_vendor.p({
|
|
label: "身份证号",
|
|
name: "idCardNo",
|
|
required: true
|
|
}),
|
|
g: common_vendor.sr("form", "8df695a9-0"),
|
|
h: common_vendor.p({
|
|
["label-width"]: 80
|
|
}),
|
|
i: common_vendor.o($options.addUser),
|
|
j: common_vendor.p({
|
|
icon: "plus",
|
|
iconSize: "16",
|
|
customStyle: {
|
|
borderRadius: "8px"
|
|
},
|
|
text: "新增报名人"
|
|
}),
|
|
k: common_vendor.p({
|
|
height: "50"
|
|
}),
|
|
l: common_vendor.o($options.submit),
|
|
m: common_vendor.p({
|
|
customStyle: {
|
|
background: "linear-gradient(to right, #ccff66, #008e04)",
|
|
borderRadius: "30px",
|
|
color: "#ffffff"
|
|
},
|
|
text: "确定"
|
|
}),
|
|
n: common_vendor.sr("login", "8df695a9-14"),
|
|
o: common_vendor.o($options.reload),
|
|
p: common_vendor.p({
|
|
logo: $data.logo
|
|
})
|
|
};
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8df695a9"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/match/checkout.vue"]]);
|
|
wx.createPage(MiniProgramPage);
|