|
|
@@ -12,6 +12,14 @@
|
|
|
<uni-icons type="location" size="20" color="#007AFF"></uni-icons>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 咨询方式 -->
|
|
|
+ <view class="phone">
|
|
|
+ 咨询方式:
|
|
|
+ <view class="phone_value" @click="clickPhone(info.phone)">
|
|
|
+ {{ info.phone }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 富文本区域 -->
|
|
|
<view class="richtext">
|
|
|
<uv-parse :content="info.themeDetail" :tagStyle="tagStyle"></uv-parse>
|
|
|
@@ -61,11 +69,11 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 活动相册区域 -->
|
|
|
- <view class="box" v-if="info.isImage == 1 && info.images?.length">
|
|
|
+ <view class="box" v-if="info.isImage == 1 && info.isReport == 1">
|
|
|
<view class="box_icon"></view>
|
|
|
<view class="box_title">活动相册</view>
|
|
|
<view class="box_more" @click="goDetail(3)">
|
|
|
- 查看更多
|
|
|
+ {{ info.images?.length ? '查看更多 ' : '去上传 ' }}
|
|
|
<uni-icons type="right" size="18" color="#007AFF"></uni-icons>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -82,7 +90,7 @@
|
|
|
<view class="btn_text">{{ dayjs(info.signsTime).format('YYYY-MM-DD HH:mm:ss') }} 开始报名</view>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="dayjs(info.signeTime).valueOf() > Date.now()" class="btn" @click="handleApply(info.id)">
|
|
|
+ <view v-if="dayjs(info.signeTime).valueOf() > Date.now()" class="btn" @click="handleApply_throttle">
|
|
|
我要报名
|
|
|
<view class="btn_text">{{ dayjs(info.signeTime).format('YYYY-MM-DD HH:mm:ss') }} 报名截止</view>
|
|
|
</view>
|
|
|
@@ -98,7 +106,7 @@
|
|
|
<view class="btn_text">{{ dayjs(info.startTime).format('YYYY-MM-DD HH:mm:ss') }} 开始签到</view>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="dayjs(info.endTime).valueOf() > Date.now()" class="btn" @click="handleSign(info.id)">
|
|
|
+ <view v-if="dayjs(info.endTime).valueOf() > Date.now()" class="btn" @click="handleSign_throttle">
|
|
|
我要签到
|
|
|
<view class="btn_text">{{ dayjs(info.endTime).format('YYYY-MM-DD HH:mm:ss') }} 签到截止</view>
|
|
|
</view>
|
|
|
@@ -116,6 +124,7 @@ import { ref } from 'vue'
|
|
|
import { getDetailInfoById, getReportById, getSigninById } from '@/api/index.js'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { calculateDistance } from '@/utils/calculateDistance.js'
|
|
|
+import lodash from 'lodash'
|
|
|
|
|
|
// 富文本样式
|
|
|
let tagStyle = {
|
|
|
@@ -179,14 +188,14 @@ const goDetail = (e) => {
|
|
|
}
|
|
|
|
|
|
// 我要报名按钮回调
|
|
|
-const handleApply = (id) => {
|
|
|
+const handleApply = () => {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定报名吗?',
|
|
|
success: async (res) => {
|
|
|
if (res.confirm) {
|
|
|
let data = {
|
|
|
- id
|
|
|
+ id: currentId.value
|
|
|
}
|
|
|
const res = await getReportById(data)
|
|
|
// console.log(res)
|
|
|
@@ -197,7 +206,7 @@ const handleApply = (id) => {
|
|
|
mask: true
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
- getData(info.id)
|
|
|
+ getData(currentId.value)
|
|
|
}, 1500)
|
|
|
}
|
|
|
}
|
|
|
@@ -205,8 +214,13 @@ const handleApply = (id) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 节流
|
|
|
+const handleApply_throttle = lodash.throttle(handleApply, 1000, {
|
|
|
+ trailing: false
|
|
|
+})
|
|
|
+
|
|
|
// 我要签到按钮回调
|
|
|
-const handleSign = (id) => {
|
|
|
+const handleSign = () => {
|
|
|
let rangValue = 500
|
|
|
|
|
|
// 计算出距离
|
|
|
@@ -220,7 +234,7 @@ const handleSign = (id) => {
|
|
|
success: async (res) => {
|
|
|
if (res.confirm) {
|
|
|
let data = {
|
|
|
- id
|
|
|
+ id: currentId.value
|
|
|
}
|
|
|
const res = await getSigninById(data)
|
|
|
// console.log(res)
|
|
|
@@ -231,7 +245,7 @@ const handleSign = (id) => {
|
|
|
mask: true
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
- getData(info.id)
|
|
|
+ getData(currentId.value)
|
|
|
}, 1500)
|
|
|
}
|
|
|
}
|
|
|
@@ -245,6 +259,18 @@ const handleSign = (id) => {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 节流
|
|
|
+const handleSign_throttle = lodash.throttle(handleSign, 1000, {
|
|
|
+ trailing: false
|
|
|
+})
|
|
|
+
|
|
|
+// 拨打电话回调
|
|
|
+const clickPhone = (phone) => {
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber: phone
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -272,6 +298,18 @@ const handleSign = (id) => {
|
|
|
color: #808080;
|
|
|
}
|
|
|
|
|
|
+ .phone {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 15rpx;
|
|
|
+ line-height: 45rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #808080;
|
|
|
+
|
|
|
+ .phone_value {
|
|
|
+ color: #007aff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.richtext {
|
|
|
margin: 15rpx 0;
|
|
|
}
|