| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <template>
- <view class="safe-area-inset-bottom">
- <my-bar title="发布活动" :transparent="transparent">
- <view slot="content" class="publish">
- <image :src="detail.pic" style="height: 380rpx;width: 100%;"></image>
- </view>
- </my-bar>
- <view class="clock">
- <!-- <view class="cu-btn round sm" style="background-color: #dcdcdc;">
- <u-icon name="clock"></u-icon>
- <text class="margin-left-10">设置响应倒计时</text>
- </view>
- <view class="tips">
- <text>*</text>
- <text>如未在限定时间内响应,系统默认自动推送给旗下商户。</text>
- </view> -->
- </view>
- <view class="content">
- <text class="title">{{detail.title}}</text>
- <view class="data" style="margin-top: 30rpx;">
- <u-icon name="clock"></u-icon>
- <text class="margin-left-10">{{detail.beginTime | date('mm/dd hh:MM:ss')}} 至 {{detail.endTime | date('mm/dd hh:MM:ss')}}</text>
- </view>
- <!-- <view class="data">
- <u-icon name="map"></u-icon>
- <text class="margin-left-10">仅限全天河区内报名</text>
- </view> -->
- <view class="data flex">
- <view class="flex">
- <u-icon name="grid"></u-icon>
- <text class="margin-left-10">{{detail.labelNames}}</text>
- </view>
- <view class="flex margin-left-50">
- <u-icon name="bag"></u-icon>
- <text class="margin-left-10">活动供应价{{detail.supplyPrice/10}}折</text>
- </view>
- </view>
- <view class="data">
- <u-icon name="home-fill"></u-icon>
- <text class="margin-left-10">联营积分全场通用</text>
- </view>
- </view>
- <view class="intro" v-if="current==1">
- <view class="flex">
- <u-icon name="coupon"></u-icon>
- <text class="margin-left-10">商场活动补贴</text>
- </view>
- <view class="desc" style="display: flex;border-bottom: 1rpx solid #DDDDDD;align-items: center;">
- <u-input v-model="appendSupplyPrice" placeholder="请输入折扣" style="width: 90%;" />
- <text class="padding-left-20">%</text>
- </view>
- </view>
- <view class="intro">
- <view class="flex">
- <u-icon name="bookmark"></u-icon>
- <text class="margin-left-10">活动介绍</text>
- </view>
- <view class="desc">
- {{detail.detail}}
- </view>
- </view>
- <view class="attend" v-if="!$isEmpty(detail.activityJoinRecords)">
- <view class="margin-bottom-20">
- <u-icon name="calendar-fill"></u-icon>
- <text class="margin-left-10">已参加</text>
- </view>
- <view class="flex">
- <view class="flex " style="width: 90%;">
- <view class="data" v-for="(item,index) in detail.activityJoinRecords" :key="index">
- <view class="item">
- <image style="border-radius: 50%;" :src="item.joinPic" mode=""></image>
- <view>
- <text>{{item.joinName | ellipsis}}</text>
- <text>{{item.finalSupplyPrice/10}}折</text>
- </view>
- </view>
- </view>
- </view>
- <view v-if="detail.activityJoinRecords.length>3" class="center" style="width: 10%;margin-right: 15rpx;">
- <u-icon name="more-circle" size="80" color="#ababab"></u-icon>
- </view>
- </view>
- </view>
- <view @click="operate" class="center" style="margin:50rpx 0rpx 20rpx;">
- <view class="cu-btn btn-bg-color" style="width: 90%;height: 86rpx;border-radius: 12rpx;">
- <block v-if="current==0">
- <text v-if="detail.auditStatus==0">待审核</text>
- <text v-if="detail.auditStatus==1">审核通过</text>
- <text v-if="detail.auditStatus==2">审核不通过</text>
- <text v-if="detail.auditStatus==3">已停用</text>
- </block>
- <block v-if="current==1">
- <text>参加活动</text>
- </block>
- <block v-if="current==2">
- <text>退出活动</text>
- </block>
- </view>
- </view>
- </view>
- </template>
- <script>
- import myBar from "@/components/my-bar.vue"
- export default {
- components: {
- myBar
- },
- onPageScroll(obj) {
- this.transparent = obj.scrollTop * 0.006;
- },
- filters: {
- // 名称超出显示省略号
- ellipsis(value) {
- if (!value) return '';
- if (value.length > 4) {
- return value.slice(0, 3) + '...'
- }
- return value
- }
- },
- data() {
- return {
- id: '',
- current: 0, //0 发起活动详情,1可参加活动详情,2已参加活动详情
- transparent: '',
- detail: {},
- appendSupplyPrice: 100
- }
- },
- onLoad(options) {
- this.id = options.id
- this.current = options.current || 0
- if (!this.id) {
- this.$u.toast('系统错误')
- return
- }
- this.fetchDetail()
- },
- methods: {
- fetchDetail() {
- this.$api.activity.detail({
- id: this.id
- }).then(res => {
- this.detail = res.data
- })
- },
- operate() {
- if (this.current == 0) {
- return
- }
- if (this.current == 1) {
- //参加活动
- this.join()
- } else if (this.current == 2) {
- //退出活动
- this.exit()
- }
- },
- join() {
- this.$dialog.showModal("确定参加?").then(res => {
- let operateList = {
- activityId: this.id,
- joinType: 2,
- joinId: this.vuex_shopId,
- appendSupplyPrice: this.appendSupplyPrice
- }
- this.$api.activity.join(operateList).then(res => {
- if (res.success) {
- this.$dialog.showModal("参加成功", false).then(() => {
- this.$util.isReloadAndBack()
- })
- }
- })
- })
- },
- exit() {
- this.$dialog.showModal("确定退出?").then(res => {
- let operateList = [{
- activityId: this.id,
- joinType: 2,
- joinId: this.vuex_shopId
- }]
- this.$api.activity.exit(operateList).then(res => {
- if (res.success) {
- this.$dialog.showModal("退出成功", false).then(() => {
- this.$util.isReloadAndBack()
- })
- }
- })
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .publish {
- overflow: hidden;
- border-radius: 10rpx;
- height: 380rpx;
- position: absolute;
- bottom: 20rpx;
- left: 0;
- right: 0;
- width: 92%;
- margin: 0 auto -120rpx;
- border-radius: 10rpx;
- box-shadow: 0rpx 16rpx 8rpx -8rpx #a8a8a8;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- text {
- font-size: 26rpx;
- color: #797979;
- }
- }
- .clock {
- background-color: #FFFFFF;
- height: 120rpx;
- padding-bottom: 20rpx;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- align-items: center;
- .tips {
- margin-top: 10rpx;
- font-size: 24rpx;
- color: #FF9447;
- }
- }
- .content {
- padding: 15rpx 30rpx;
- background-color: #FFFFFF;
- .title {
- line-height: 50rpx;
- font-weight: 800;
- font-size: 32rpx;
- }
- .data {
- margin: 20rpx 0;
- color: #787878;
- }
- }
- .intro {
- margin-top: 15rpx;
- padding: 15rpx 30rpx;
- background-color: #FFFFFF;
- .desc {
- color: #9a9a9a;
- margin-top: 20rpx;
- line-height: 46rpx;
- font-size: 28rpx;
- }
- }
- .attend {
- margin-top: 15rpx;
- padding: 15rpx 0 15rpx 30rpx;
- background-color: #FFFFFF;
- .data {
- margin: 10rpx 20rpx 10rpx 0;
- $width: 80rpx;
- .item {
- width: 190rpx;
- height: $width;
- background-color: #eeeeee;
- border-radius: 50rpx;
- display: flex;
- image {
- width: $width;
- height: $width;
- }
- view {
- padding-left: 10rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- font-size: 22rpx;
- text:first-child {
- font-weight: 800;
- margin-bottom: 4rpx;
- }
- }
- }
- }
- }
- </style>
|