detail.vue 7.4 KB

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