|
|
@@ -107,24 +107,37 @@
|
|
|
<block v-if="status">
|
|
|
<fixed-bottom @get-height="getFooterHeight">
|
|
|
<view class="bottom-footer u-flex">
|
|
|
- <block v-if="status * 1 === 1 || status * 1 === 2">
|
|
|
+ <block v-if="(status * 1 === 2)">
|
|
|
<view class="u-flex-1">
|
|
|
- <view class="line-34 bold">距活动结束还有:</view>
|
|
|
+ <view class="line-34 bold">{{'距截止提交还有:'}}</view>
|
|
|
<view class="u-font-20 u-content-color line-28">{{remainingTime}}</view>
|
|
|
</view>
|
|
|
- <block v-if="status * 1 === 1">
|
|
|
- <button class="sign-up-btn u-font-30 bold line-42"
|
|
|
- @click="join">我要报名</button>
|
|
|
- </block>
|
|
|
<block v-if="status * 1 === 2">
|
|
|
<view class="u-flex">
|
|
|
<button class="canel-btn u-font-28 line-40"
|
|
|
- @click="cancelJoin">取消报名</button>
|
|
|
- <button class="submit-btn u-font-28 line-40 u-m-l-16"
|
|
|
+ @click="cancelJoin"
|
|
|
+ v-show="!isExpire">取消报名</button>
|
|
|
+ <button :class="isExpire ? 'sign-up-btn u-font-28 line-40 u-m-l-16' : 'submit-btn u-font-28 line-40 u-m-l-16'"
|
|
|
@click="toSubmiteOrder">提交结果</button>
|
|
|
</view>
|
|
|
</block>
|
|
|
</block>
|
|
|
+ <block v-if="status * 1 === 1">
|
|
|
+ <block v-if="isExpire">
|
|
|
+ <button class="end-btn u-m-l-12"
|
|
|
+ disabled
|
|
|
+ v-if="status * 1 === 1">已结束</button>
|
|
|
+ </block>
|
|
|
+ <view class="u-flex-1"
|
|
|
+ v-if="!isExpire">
|
|
|
+ <view class="line-34 bold">{{isStart ? '距活动结束还有:' : '距活动开始还有:'}}</view>
|
|
|
+ <view class="u-font-20 u-content-color line-28">{{remainingTime}}</view>
|
|
|
+ </view>
|
|
|
+ <block v-if="status * 1 === 1 && !isExpire">
|
|
|
+ <button :class="isStart ? 'sign-up-btn u-font-30 bold line-42' : 'sign-up-btn u-font-30 bold line-42'"
|
|
|
+ @click="join">{{isStart ? '我要报名' : '即将开始'}}</button>
|
|
|
+ </block>
|
|
|
+ </block>
|
|
|
<block v-if="status * 1 === 3 || status * 1 === 4">
|
|
|
<block v-if="status * 1 === 3">
|
|
|
<view class="u-flex-1">
|
|
|
@@ -158,11 +171,17 @@
|
|
|
</view>
|
|
|
</fixed-bottom>
|
|
|
</block>
|
|
|
- <view class="fixed-copy">
|
|
|
- <view class="btn-copy u-font-22"
|
|
|
- :style="{marginBottom: `${footerHeight}rpx`}"
|
|
|
- v-show="detail.search_key"
|
|
|
- @click.stop="copyShopName">复制店名</view>
|
|
|
+ <view class="fixed-copy"
|
|
|
+ :style="{marginBottom: `${footerHeight}rpx`}">
|
|
|
+ <view class="copy-container">
|
|
|
+ <image src="@/static/common/share.png"
|
|
|
+ mode="scaleToFill"
|
|
|
+ v-if="isCommissionEnable"
|
|
|
+ @click="onClickShare" />
|
|
|
+ <view class="btn-copy u-font-22"
|
|
|
+ v-show="detail.search_key"
|
|
|
+ @click.stop="copyShopName">复制店名</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -203,9 +222,35 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ isCommissionEnable () {
|
|
|
+ return this.$store.state.enable_commission * 1 === 1
|
|
|
+ },
|
|
|
userId () {
|
|
|
return this.$store.state.userInfo.token
|
|
|
},
|
|
|
+ isStart () {
|
|
|
+ if (!this.nowTime) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ const now = this.nowTime.format('HH:mm:ss')
|
|
|
+ console.log(this.detail.start_time)
|
|
|
+ console.log(now)
|
|
|
+ if (this.detail.start_time < now) {
|
|
|
+ console.log(this.detail.start_time < now)
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
+ isExpire () {
|
|
|
+ if (!this.nowTime) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ const now = this.nowTime.format('HH:mm:ss')
|
|
|
+ if (this.detail.end_time < now) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
businessHours () {
|
|
|
const date = this.$dayjs(`${this.detail.start_date}`).format('YYYY年MM月DD日')
|
|
|
const start = this.$dayjs(`${this.detail.start_date} ${this.detail.start_time}`).format('HH:mm')
|
|
|
@@ -225,8 +270,6 @@ export default {
|
|
|
return 1
|
|
|
} else if (this.detail.join_status === 6) {
|
|
|
return 6
|
|
|
- } else if (this.remainingTime === 0) {
|
|
|
- return 6
|
|
|
} else if (this.detail.join_count === this.detail.join_number && this.detail.join_count) {
|
|
|
return 7
|
|
|
} else if (this.detail.join_status === 0) {
|
|
|
@@ -237,13 +280,23 @@ export default {
|
|
|
},
|
|
|
remainingTime () {
|
|
|
if (!this.detail.end_time) { return }
|
|
|
- const endTime = this.$dayjs(`${this.$dayjs().format('YYYY-MM-DD')} ${this.detail.end_time}`)
|
|
|
- if (isNaN(endTime.diff(this.nowTime, 's'))) { return }
|
|
|
- if (!isNaN(endTime.diff(this.nowTime, 's')) && endTime.diff(this.nowTime, 's') === 0) {
|
|
|
- clearTimeout(this.timer)
|
|
|
- return 0
|
|
|
+ if (this.status * 1 === 2) {
|
|
|
+ const endTime = this.$dayjs(`${this.$dayjs().format('YYYY-MM-DD 23:59:59')}`)
|
|
|
+ if (isNaN(endTime.diff(this.nowTime, 's'))) { return }
|
|
|
+ return this.$dayjs(endTime.diff(this.nowTime)).subtract(8, 'h').format('HH小时mm分ss秒')
|
|
|
+ }
|
|
|
+ if (this.isStart) {
|
|
|
+ const endTime = this.$dayjs(`${this.$dayjs().format('YYYY-MM-DD')} ${this.detail.end_time}`)
|
|
|
+ if (isNaN(endTime.diff(this.nowTime, 's'))) { return }
|
|
|
+ if (!isNaN(endTime.diff(this.nowTime, 's')) && endTime.diff(this.nowTime, 's') === 0) {
|
|
|
+ clearTimeout(this.timer)
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ return this.$dayjs(endTime.diff(this.nowTime)).subtract(8, 'h').format('HH小时mm分ss秒')
|
|
|
+ } else {
|
|
|
+ const endTime = this.$dayjs(`${this.$dayjs().format('YYYY-MM-DD')} ${this.detail.start_time}`)
|
|
|
+ return this.$dayjs(endTime.diff(this.nowTime)).subtract(8, 'h').format('HH小时mm分ss秒')
|
|
|
}
|
|
|
- return this.$dayjs(endTime.diff(this.nowTime)).subtract(8, 'h').format('HH小时mm分ss秒')
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -300,6 +353,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onClickShare () {
|
|
|
+ uni.navigateTo({ url: '/pagesSub/commission/invite' })
|
|
|
+ },
|
|
|
getShareUrl () {
|
|
|
let url = `/pagesSub/activity/activityDetail?id=${this.detail.id}`
|
|
|
if (this.userInfo) {
|
|
|
@@ -344,6 +400,7 @@ export default {
|
|
|
const { code, data } = await getActivityDetail(params)
|
|
|
if (code === 200) {
|
|
|
this.detail = data
|
|
|
+ this.nowTime = this.$dayjs()
|
|
|
}
|
|
|
uni.stopPullDownRefresh()
|
|
|
},
|
|
|
@@ -396,6 +453,13 @@ export default {
|
|
|
},
|
|
|
// 我要报名
|
|
|
join () {
|
|
|
+ if (!this.isStart) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '活动还未开始',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
uni.requestSubscribeMessage({
|
|
|
tmplIds: this.$store.state.joinTemplateIds,
|
|
|
complete: () => {
|
|
|
@@ -494,23 +558,32 @@ export default {
|
|
|
.fixed-copy {
|
|
|
position: fixed;
|
|
|
bottom: 0;
|
|
|
+ right: 0;
|
|
|
z-index: 99;
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
padding-bottom: 16rpx;
|
|
|
- .btn-copy {
|
|
|
- width: 72rpx;
|
|
|
- height: 72rpx;
|
|
|
- text-align: center;
|
|
|
- padding: 8rpx;
|
|
|
- margin-right: 16rpx;
|
|
|
- background: #111111;
|
|
|
- box-shadow: 0px 1px 4px 0px rgba(17, 17, 17, 0.6);
|
|
|
- opacity: 0.8;
|
|
|
- color: #eaebec;
|
|
|
- font-weight: 400;
|
|
|
- border-radius: 36rpx;
|
|
|
+
|
|
|
+ .copy-container {
|
|
|
+ padding-right: 24rpx;
|
|
|
+ align-items: center;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ image {
|
|
|
+ width: 122rpx;
|
|
|
+ height: 122rpx;
|
|
|
+ }
|
|
|
+ .btn-copy {
|
|
|
+ width: 72rpx;
|
|
|
+ height: 72rpx;
|
|
|
+ text-align: center;
|
|
|
+ padding: 8rpx;
|
|
|
+ background: #111111;
|
|
|
+ box-shadow: 0px 1px 4px 0px rgba(17, 17, 17, 0.6);
|
|
|
+ opacity: 0.8;
|
|
|
+ color: #eaebec;
|
|
|
+ font-weight: 400;
|
|
|
+ border-radius: 36rpx;
|
|
|
+ margin-top: 32rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.over-view {
|
|
|
@@ -593,6 +666,15 @@ export default {
|
|
|
background-color: $u-type-primary;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
+
|
|
|
+ .sign-up-btn-disable {
|
|
|
+ padding: 24px 128px;
|
|
|
+ width: 374px;
|
|
|
+ height: 88px;
|
|
|
+ border-radius: 44px;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
.canel-btn,
|
|
|
.submit-btn {
|
|
|
padding: 16px 40px;
|