detail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <my-bar title="活动详情" :transparent="transparent">
  4. <view slot="content" class="publish">
  5. <image :src="detail.pic" style="height: 380rpx;width: 100%;"></image>
  6. </view>
  7. </my-bar>
  8. <view class="clock">
  9. <!-- <view class="cu-btn round sm" style="background-color: #dcdcdc;">
  10. <u-icon name="clock"></u-icon>
  11. <text class="margin-left-10">设置响应倒计时</text>
  12. </view>
  13. <view class="tips">
  14. <text>*</text>
  15. <text>如未在限定时间内响应,系统默认自动推送给旗下商户。</text>
  16. </view> -->
  17. </view>
  18. <view class="content">
  19. <text class="title">{{detail.title}}</text>
  20. <view class="data" style="margin-top: 30rpx;">
  21. <u-icon name="clock" color="#EF9944"></u-icon>
  22. <text class="margin-left-10">开始时间:{{detail.beginTime}}</text>
  23. </view>
  24. <view class="data" style="margin-top: 30rpx;">
  25. <u-icon name="clock" color="#EF9944"></u-icon>
  26. <text class="margin-left-10">结束时间:{{detail.endTime}}</text>
  27. </view>
  28. <!-- <view class="data">
  29. <u-icon name="map"></u-icon>
  30. <text class="margin-left-10">仅限全天河区内报名</text>
  31. </view> -->
  32. <view class="data flex">
  33. <view class="flex">
  34. <u-icon name="grid" color="#EF9944"></u-icon>
  35. <text class="margin-left-10">{{detail.labelNames}}</text>
  36. </view>
  37. <view class="flex margin-left-50">
  38. <u-icon name="bag" color="#EF9944"></u-icon>
  39. <text class="margin-left-10">活动折扣 {{detail.supplyPrice/10}} 折</text>
  40. </view>
  41. </view>
  42. <view class="data">
  43. <u-icon name="home-fill" color="#EF9944"></u-icon>
  44. <text class="margin-left-10">联营积分全场通用</text>
  45. </view>
  46. </view>
  47. <view class="intro" v-if="current==1">
  48. <view class="flex">
  49. <u-icon name="coupon" color="#EF9944"></u-icon>
  50. <text class="margin-left-10">商场活动补贴</text>
  51. </view>
  52. <view class="desc" style="display: flex;border-bottom: 1rpx solid #DDDDDD;align-items: center;">
  53. <u-input v-model="appendSupplyPrice" placeholder="请输入折扣" style="width: 90%;" />
  54. <text class="padding-left-20">%</text>
  55. </view>
  56. </view>
  57. <view class="intro">
  58. <view class="flex">
  59. <u-icon name="bookmark" color="#EF9944"></u-icon>
  60. <text class="margin-left-10">活动介绍</text>
  61. </view>
  62. <view class="desc">
  63. {{detail.detail}}
  64. </view>
  65. </view>
  66. <view class="attend" v-if="!$isEmpty(detail.activityJoinRecords)">
  67. <view class="margin-bottom-20">
  68. <u-icon name="calendar-fill" color="#EF9944"></u-icon>
  69. <text class="margin-left-10">已参加</text>
  70. </view>
  71. <view class="flex">
  72. <view class="flex " style="width: 90%;">
  73. <view class="data" v-for="(item,index) in detail.activityJoinRecords" :key="index">
  74. <view class="item">
  75. <image :src="item.joinPic" mode=""></image>
  76. <view>
  77. <text>{{name | ellipsis}}</text>
  78. <text>{{item.finalSupplyPrice}}折</text>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view v-if="detail.activityJoinRecords.length>3" class="center" style="width: 10%;margin-right: 15rpx;">
  84. <u-icon name="more-circle" size="80" color="#ababab"></u-icon>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- <block >
  89. <view class="" style="height: 90rpx;"></view>
  90. <view @click="operate" :style="{paddingBottom:safeAreaBottom}" class="footer-fixed center">
  91. <view class="cu-btn df btn-bg-color round " style="width: 90%;height: 80rpx;">
  92. <block v-if="current==0">
  93. <text v-if="detail.auditStatus==0">待审核</text>
  94. <text v-if="detail.auditStatus==1">审核通过</text>
  95. <text v-if="detail.auditStatus==2">审核不通过</text>
  96. <text v-if="detail.auditStatus==3">已停用</text>
  97. </block>
  98. <block v-if="current==1">
  99. <text>参加活动</text>
  100. </block>
  101. <block v-if="current==2">
  102. <text>退出活动</text>
  103. </block>
  104. </view>
  105. </view>
  106. </block> -->
  107. </view>
  108. </template>
  109. <script>
  110. import myBar from "@/components/my-bar.vue"
  111. export default {
  112. components: {
  113. myBar
  114. },
  115. onPageScroll(obj) {
  116. this.transparent = obj.scrollTop * 0.006;
  117. },
  118. filters: {
  119. // 名称超出显示省略号
  120. ellipsis(value) {
  121. if (!value) return '';
  122. if (value.length > 4) {
  123. return value.slice(0, 3) + '...'
  124. }
  125. return value
  126. }
  127. },
  128. data() {
  129. return {
  130. id: '',
  131. current: 0, //0 发起活动详情,1可参加活动详情,2已参加活动详情
  132. transparent: '',
  133. name: '星巴克',
  134. detail: {},
  135. appendSupplyPrice: 100
  136. }
  137. },
  138. onLoad(options) {
  139. if(options.detail){
  140. this.detail = JSON.parse(options.detail)
  141. }
  142. // this.current = options.current || 0
  143. // if (!this.id) {
  144. // this.$u.toast('系统错误')
  145. // return
  146. // }
  147. // this.fetchDetail()
  148. },
  149. methods: {
  150. fetchDetail() {
  151. this.$api.activity.detail({
  152. id: this.id
  153. }).then(res => {
  154. this.detail = res.data
  155. })
  156. },
  157. operate() {
  158. if (this.current == 0) {
  159. return
  160. }
  161. if (this.current == 1) {
  162. //参加活动
  163. this.join()
  164. } else if (this.current == 2) {
  165. //退出活动
  166. this.exit()
  167. }
  168. },
  169. join() {
  170. this.$dialog.showModal("确定参加?").then(res => {
  171. let operateList = {
  172. activityId: this.id,
  173. joinType: 1,
  174. joinId: this.vuex_mallId,
  175. appendSupplyPrice: this.appendSupplyPrice
  176. }
  177. this.$api.activity.join(operateList).then(res => {
  178. if (res.success) {
  179. this.$dialog.showModal("参加成功", false).then(() => {
  180. this.$util.isReloadAndBack()
  181. })
  182. }
  183. })
  184. })
  185. },
  186. exit() {
  187. this.$dialog.showModal("确定退出?").then(res => {
  188. let operateList = [{
  189. activityId: this.id,
  190. joinType: 1,
  191. joinId: this.vuex_mallId
  192. }]
  193. this.$api.activity.exit(operateList).then(res => {
  194. if (res.success) {
  195. this.$dialog.showModal("退出成功", false).then(() => {
  196. this.$util.isReloadAndBack()
  197. })
  198. }
  199. })
  200. })
  201. },
  202. }
  203. }
  204. </script>
  205. <style lang="scss" scoped>
  206. .publish {
  207. background-color: #FFFFFF;
  208. overflow: hidden;
  209. border-radius: 10rpx;
  210. height: 380rpx;
  211. position: absolute;
  212. bottom: 20rpx;
  213. left: 0;
  214. right: 0;
  215. width: 92%;
  216. margin: 0 auto -120rpx;
  217. border-radius: 10rpx;
  218. box-shadow: 0rpx 16rpx 8rpx -8rpx #a8a8a8;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. flex-direction: column;
  223. text {
  224. font-size: 26rpx;
  225. color: #797979;
  226. }
  227. }
  228. .clock {
  229. background-color: #FFFFFF;
  230. height: 120rpx;
  231. padding-bottom: 20rpx;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: flex-end;
  235. align-items: center;
  236. .tips {
  237. margin-top: 10rpx;
  238. font-size: 24rpx;
  239. color: #FF9447;
  240. }
  241. }
  242. .content {
  243. padding: 15rpx 30rpx;
  244. background-color: #FFFFFF;
  245. .title {
  246. line-height: 50rpx;
  247. font-weight: 800;
  248. font-size: 32rpx;
  249. }
  250. .data {
  251. margin: 20rpx 0;
  252. color: #787878;
  253. }
  254. }
  255. .intro {
  256. margin-top: 15rpx;
  257. padding: 15rpx 30rpx;
  258. background-color: #FFFFFF;
  259. .desc {
  260. color: #9a9a9a;
  261. margin-top: 20rpx;
  262. line-height: 46rpx;
  263. font-size: 28rpx;
  264. }
  265. }
  266. .attend {
  267. margin-top: 15rpx;
  268. padding: 15rpx 0 15rpx 30rpx;
  269. background-color: #FFFFFF;
  270. .data {
  271. margin: 10rpx 20rpx 10rpx 0;
  272. $width: 80rpx;
  273. .item {
  274. width: 190rpx;
  275. height: $width;
  276. background-color: #eeeeee;
  277. border-radius: 50rpx;
  278. display: flex;
  279. image {
  280. width: $width;
  281. height: $width;
  282. }
  283. view {
  284. padding-left: 10rpx;
  285. display: flex;
  286. flex-direction: column;
  287. justify-content: center;
  288. font-size: 22rpx;
  289. text:first-child {
  290. font-weight: 800;
  291. margin-bottom: 4rpx;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. </style>