|
|
@@ -1,9 +1,69 @@
|
|
|
<template>
|
|
|
<view class="page-container">
|
|
|
- <view v-if="activityId">
|
|
|
- <view class="text-center text-danger mb-5" v-if="form.isClose == 1">活动已关闭</view>
|
|
|
- <view class="text-center text-danger mb-5" v-else-if="form.auditStatus == 2">活动未通过审核,修改后重新发布</view>
|
|
|
+ <view v-if="activityId" class="mb-15">
|
|
|
+ <view class="text-center text-danger" v-if="form.isClose == 1">活动已关闭</view>
|
|
|
+ <view class="text-center text-danger" v-else-if="form.auditStatus == 2">活动未通过审核,修改后重新发布</view>
|
|
|
+ <view class="text-center text-vb font-bold" v-else-if="form.auditStatus == 1">活动报名中</view>
|
|
|
</view>
|
|
|
+ <vb-cell-group v-if="form.isClose != 1 && form.auditStatus == '1'">
|
|
|
+ <view class="d-fcv py-15">
|
|
|
+ <view class="bg-warning text-white w-100 text-center py-8 br-8 mx-10" @click="onGenQrcode('AD')">
|
|
|
+ 报名二维码
|
|
|
+ </view>
|
|
|
+ <view class="bg-success text-white w-100 text-center py-8 br-8 mx-10" @click="onGenQrcode('AA')">
|
|
|
+ 签到二维码
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="showQrCodeBox" class="d-fc flex-column w-100 p-20 pt-5">
|
|
|
+ <view class="text-danger mb-10">
|
|
|
+ 活动
|
|
|
+ <text class="font-bold">{{ qrType == "AD" ? "报名" : "签到" }}</text>
|
|
|
+ 二维码
|
|
|
+ </view>
|
|
|
+ <vb-qrcode
|
|
|
+ ref="qrcodeRef"
|
|
|
+ :canvas-id="qrcode.id"
|
|
|
+ :value="qrcode.value"
|
|
|
+ :size="qrcode.size"
|
|
|
+ :options="{
|
|
|
+ margin: 20,
|
|
|
+ backgroundPadding: 10,
|
|
|
+ areaColor: '#f2f2f2',
|
|
|
+ foregroundColor: '#0e9489',
|
|
|
+ foregroundImageSrc: qrcode.logo,
|
|
|
+ // foregroundImageWidth: 50,
|
|
|
+ // foregroundImageHeight: 50,
|
|
|
+ // foregroundImagePadding: 1,
|
|
|
+ // foregroundImageBackgroundColor: '#f5f5f5',
|
|
|
+ foregroundImageBorderRadius: qrcode.size / 4,
|
|
|
+ }"
|
|
|
+ ></vb-qrcode>
|
|
|
+ <view class="mt-15 bg-vb text-white w-100 text-center py-8 br-8" @click="onSaveQrcode">保存二维码</view>
|
|
|
+ <view
|
|
|
+ class="mt-15 bg-gray-1 text-vb border border-1 border-vb w-100 text-center py-8 br-8"
|
|
|
+ @click="showQrCodeBox = false"
|
|
|
+ >
|
|
|
+ 关闭二维码
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="d-fcv pb-15">
|
|
|
+ <view
|
|
|
+ v-if="form.auditStatus == 1"
|
|
|
+ class="w-100 bg-vb text-white text-center py-8 br-8 mx-10"
|
|
|
+ @click="onApplyAudit"
|
|
|
+ >
|
|
|
+ 报名审核
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ type="danger"
|
|
|
+ v-if="form.isClose && form.isClose != 1"
|
|
|
+ class="w-100 bg-danger text-white text-center py-8 br-8 mx-10"
|
|
|
+ @click="onCloseActivity"
|
|
|
+ >
|
|
|
+ 关闭活动
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </vb-cell-group>
|
|
|
<uni-forms :modelValue="form" ref="formRef" :label-width="75" label-align="right" border validate-trigger="bind">
|
|
|
<vb-cell-group outset>
|
|
|
<uni-forms-item
|
|
|
@@ -12,7 +72,13 @@
|
|
|
name="title"
|
|
|
:rules="[{ required: true, errorMessage: '请填写活动标题' }]"
|
|
|
>
|
|
|
- <uni-easyinput type="text" v-model="form.title" :inputBorder="false" placeholder="请输入活动标题" />
|
|
|
+ <uni-easyinput
|
|
|
+ type="text"
|
|
|
+ v-model="form.title"
|
|
|
+ :disabled="disabled"
|
|
|
+ :inputBorder="false"
|
|
|
+ placeholder="请输入活动标题"
|
|
|
+ />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item
|
|
|
required
|
|
|
@@ -20,13 +86,19 @@
|
|
|
name="category"
|
|
|
:rules="[{ required: true, errorMessage: '请选择活动分类' }]"
|
|
|
>
|
|
|
- <vb-picker v-model="form.category" :columns="categoryColumns" label="活动分类"></vb-picker>
|
|
|
+ <vb-picker
|
|
|
+ v-model="form.category"
|
|
|
+ :disabled="disabled"
|
|
|
+ :columns="categoryColumns"
|
|
|
+ label="活动分类"
|
|
|
+ ></vb-picker>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item required label="人数上限" name="peopleMax">
|
|
|
<uni-easyinput
|
|
|
type="number"
|
|
|
v-model="form.peopleMax"
|
|
|
:inputBorder="false"
|
|
|
+ :disabled="disabled"
|
|
|
:rules="[{ required: true, errorMessage: '请填写活动填写' }]"
|
|
|
placeholder="请输入活动人数上限"
|
|
|
/>
|
|
|
@@ -35,6 +107,7 @@
|
|
|
<uni-easyinput
|
|
|
type="text"
|
|
|
v-model="form.contact"
|
|
|
+ :disabled="disabled"
|
|
|
:inputBorder="false"
|
|
|
:rules="[{ required: true, errorMessage: '请填写联系方式' }]"
|
|
|
placeholder="请输入联系方式"
|
|
|
@@ -44,6 +117,7 @@
|
|
|
<uni-datetime-picker
|
|
|
type="date"
|
|
|
v-model="form.activityDate"
|
|
|
+ :disabled="disabled"
|
|
|
:start="dateStart"
|
|
|
:end="dateEnd"
|
|
|
:border="false"
|
|
|
@@ -55,6 +129,7 @@
|
|
|
<uni-datetime-picker
|
|
|
type="date"
|
|
|
v-model="form.expiryDate"
|
|
|
+ :disabled="disabled"
|
|
|
:start="dateStart"
|
|
|
:end="dateEnd"
|
|
|
:border="false"
|
|
|
@@ -68,10 +143,21 @@
|
|
|
name="area"
|
|
|
:rules="[{ required: true, errorMessage: '请选择活动方式' }]"
|
|
|
>
|
|
|
- <vb-picker v-model="form.area" :columns="activityAreaColumns" label="活动方式"></vb-picker>
|
|
|
+ <vb-picker
|
|
|
+ v-model="form.area"
|
|
|
+ :disabled="disabled"
|
|
|
+ :columns="activityAreaColumns"
|
|
|
+ label="活动方式"
|
|
|
+ ></vb-picker>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item v-if="form.area == '线下活动'" label="详细地点" name="address">
|
|
|
- <uni-easyinput type="text" v-model="form.address" :inputBorder="false" placeholder="请填写详细地点" />
|
|
|
+ <uni-easyinput
|
|
|
+ type="text"
|
|
|
+ :disabled="disabled"
|
|
|
+ v-model="form.address"
|
|
|
+ :inputBorder="false"
|
|
|
+ placeholder="请填写详细地点"
|
|
|
+ />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item
|
|
|
required
|
|
|
@@ -85,6 +171,7 @@
|
|
|
{ value: '0', text: '不需要缴费' },
|
|
|
{ value: '1', text: '需要缴费(填写费用说明)' },
|
|
|
]"
|
|
|
+ :disabled="disabled"
|
|
|
selectedColor="var(--vb-color)"
|
|
|
selectedTextColor="var(--vb-color)"
|
|
|
></uni-data-checkbox>
|
|
|
@@ -94,6 +181,7 @@
|
|
|
type="textarea"
|
|
|
v-model="form.cost"
|
|
|
:inputBorder="false"
|
|
|
+ :disabled="disabled"
|
|
|
autoHeight
|
|
|
placeholder="请填写费用说明"
|
|
|
/>
|
|
|
@@ -103,6 +191,7 @@
|
|
|
type="textarea"
|
|
|
v-model="form.content"
|
|
|
:inputBorder="false"
|
|
|
+ :disabled="disabled"
|
|
|
autoHeight
|
|
|
placeholder="请填写活动详情"
|
|
|
/>
|
|
|
@@ -112,6 +201,8 @@
|
|
|
ref="imageUploadRef"
|
|
|
v-model="imageList"
|
|
|
fileMediatype="image"
|
|
|
+ :disabled="disabled"
|
|
|
+ :del-icon="!disabled"
|
|
|
mode="grid"
|
|
|
limit="8"
|
|
|
title="上传图片"
|
|
|
@@ -128,23 +219,6 @@
|
|
|
</vb-button>
|
|
|
</vb-cell-group>
|
|
|
</uni-forms>
|
|
|
- <view class="d-flex mb-15">
|
|
|
- <view
|
|
|
- v-if="form.auditStatus == 1"
|
|
|
- class="w-100 bg-vb text-white text-center py-8 br-5 mx-5"
|
|
|
- @click="onApplyAudit"
|
|
|
- >
|
|
|
- 报名审核
|
|
|
- </view>
|
|
|
- <view
|
|
|
- type="danger"
|
|
|
- v-if="form.isClose && form.isClose != 1"
|
|
|
- class="w-100 bg-danger text-white text-center py-8 br-5 mx-5"
|
|
|
- @click="onCloseActivity"
|
|
|
- >
|
|
|
- 关闭活动
|
|
|
- </view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -155,6 +229,7 @@ import route from "@/route"
|
|
|
import configs from "@/core/config"
|
|
|
|
|
|
const imageUploadRef = ref()
|
|
|
+const qrcodeRef = ref()
|
|
|
|
|
|
const form = ref<any>({
|
|
|
activityId: "",
|
|
|
@@ -171,6 +246,7 @@ const form = ref<any>({
|
|
|
address: "",
|
|
|
images: "",
|
|
|
})
|
|
|
+
|
|
|
const params = route.getRouteParams("activityEdit")
|
|
|
const activityId = ref(params?.id)
|
|
|
const categoryColumns = ref<any[]>([])
|
|
|
@@ -181,12 +257,33 @@ const activityAreaColumns = computed(() => {
|
|
|
]
|
|
|
})
|
|
|
const imageList = ref<any[]>([])
|
|
|
+const disabled = computed(() => {
|
|
|
+ return form.value.isClose == 1 || form.value.auditStatus == 1
|
|
|
+})
|
|
|
+
|
|
|
const dateStart = computed(() => {
|
|
|
return dayjs(new Date()).format("YYYY-MM-DD")
|
|
|
})
|
|
|
const dateEnd = computed(() => {
|
|
|
return dayjs(new Date()).add(6, "M").format("YYYY-MM-DD")
|
|
|
})
|
|
|
+
|
|
|
+const qrType = ref("AD")
|
|
|
+const qrLogo = ref("/static/logos/yz_logo.png")
|
|
|
+const qrSize = ref(300)
|
|
|
+const showQrCodeBox = ref(false)
|
|
|
+const qrcode = computed(() => {
|
|
|
+ return {
|
|
|
+ id: qrType.value + activityId.value,
|
|
|
+ value: qrType.value + "@" + activityId.value,
|
|
|
+ size: qrSize.value,
|
|
|
+ logo: qrLogo.value,
|
|
|
+ }
|
|
|
+})
|
|
|
+// function formatDate(date: any, format = "YYYY-MM-DD") {
|
|
|
+// return dayjs(new Date(date)).format(format)
|
|
|
+// }
|
|
|
+
|
|
|
function onApplyAudit() {
|
|
|
route.navigate("activityApplyAudit", params)
|
|
|
}
|
|
|
@@ -239,7 +336,25 @@ function onSubmit() {
|
|
|
}, 1500)
|
|
|
})
|
|
|
}
|
|
|
+function onGenQrcode(type: string) {
|
|
|
+ if (qrType.value == type) {
|
|
|
+ showQrCodeBox.value = true
|
|
|
|
|
|
+ return
|
|
|
+ }
|
|
|
+ showQrCodeBox.value = false
|
|
|
+ nextTick(() => {
|
|
|
+ qrType.value = type
|
|
|
+ showQrCodeBox.value = true
|
|
|
+ })
|
|
|
+}
|
|
|
+function onSaveQrcode() {
|
|
|
+ qrcodeRef.value.save({
|
|
|
+ success: () => {
|
|
|
+ message.msgSuccess("保存成功")
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
function loadCategory() {
|
|
|
apis.system.categoryApi.getActivityCategory().then((res) => {
|
|
|
categoryColumns.value = []
|