detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <my-bar title="活动详情" :transparent="transparent">
  4. <view slot="content" class="publish">
  5. <image @click="$util.preview(detail.poster)" :src="detail.poster" style="height: 340rpx;width: 100%;">
  6. </image>
  7. </view>
  8. </my-bar>
  9. <view class="clock">
  10. </view>
  11. <view class="content">
  12. <text class="title">{{detail.title}}</text>
  13. <view class="data flex" style="margin-top: 30rpx;">
  14. <u-icon name="eye" color="#EF9944"></u-icon>
  15. <view v-if="detail.auditStatus=='WAITING_MALL'" class="margin-left-10">
  16. 审核状态:
  17. <text style="color: #EF9944;">待审核</text>
  18. </view>
  19. <view v-if="detail.auditStatus=='WAITING_PLATFORM'" class="margin-left-10">
  20. 审核状态:
  21. <text style="color: #EF9944;">待平台审核</text>
  22. </view>
  23. <view v-if="detail.auditStatus=='PASS'" class="margin-left-10">
  24. 审核状态:
  25. <text style="color: #19be6b;">审核通过</text>
  26. </view>
  27. <view v-if="detail.auditStatus=='FAIL'" class="margin-left-10">
  28. 审核状态:
  29. <text style="color: #fa3534;">审核不通过</text>
  30. </view>
  31. <view v-if="detail.auditStatus=='STOP'" class="margin-left-10">
  32. 审核状态:
  33. <text style="color: #fa3534;">活动已停用</text>
  34. </view>
  35. </view>
  36. <view class="data" style="margin-top: 30rpx;">
  37. <u-icon name="clock" color="#EF9944"></u-icon>
  38. <text class="margin-left-10">开始时间:{{detail.beginTime}}</text>
  39. </view>
  40. <view class="data" style="margin-top: 30rpx;">
  41. <u-icon name="clock" color="#EF9944"></u-icon>
  42. <text class="margin-left-10">结束时间:{{detail.endTime}}</text>
  43. </view>
  44. <view class="data" style="margin-top: 30rpx;">
  45. <u-icon name="grid" color="#EF9944"></u-icon>
  46. <text class="margin-left-10">活动分类:{{detail.labelKey}}</text>
  47. </view>
  48. <view class="data" style="margin-top: 30rpx;">
  49. <u-icon name="coupon" color="#EF9944"></u-icon>
  50. <text class="margin-left-10">活动折扣:{{detail.discount * 10}} 折</text>
  51. </view>
  52. </view>
  53. <view class="attend" v-if="!$isEmpty(joinRecords)">
  54. <view class="margin-bottom-20">
  55. <u-icon name="calendar-fill" color="#EF9944"></u-icon>
  56. <text class="margin-left-10">已参加</text>
  57. </view>
  58. <view class="flex">
  59. <view class="flex " style="width: 90%;">
  60. <view class="data" v-for="(item,index) in joinRecords" :key="index">
  61. <view class="item">
  62. <image style="border-radius: 50%;" :src="item.joinLogo" mode="aspectFill"></image>
  63. <view>
  64. <text>{{item.joinName | ellipsis}}</text>
  65. <text>{{item.discount * 10}}折</text>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view v-if="detail.activityJoinRecords.length>3" class="center" style="width: 10%;margin-right: 15rpx;">
  71. <u-icon name="more-circle" size="80" color="#ababab"></u-icon>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="intro">
  76. <view class="flex">
  77. <u-icon name="bookmark" color="#EF9944"></u-icon>
  78. <text class="margin-left-10">活动介绍</text>
  79. </view>
  80. <view class="desc">
  81. {{detail.intro}}
  82. </view>
  83. </view>
  84. <view class="" v-if="current==0">
  85. <view @click="open=!open" class="intro" style="width: 100%;">
  86. <text class="text-bold text-lg">审核流程</text>
  87. <text :class="open?'cuIcon-fold':'cuIcon-unfold'" class=" margin-left-10"></text>
  88. </view>
  89. <view class="history" v-if="open" :style="{marginBottom:safeAreaBottom}">
  90. <u-time-line>
  91. <u-time-line-item nodeTop="2" v-for="(item,index) in historyList" :key="index">
  92. <template v-slot:node>
  93. <view class="u-node bg-white">
  94. <u-icon name="clock-fill" color="#e0e3ea" :size="28"></u-icon>
  95. </view>
  96. </template>
  97. <template v-slot:content>
  98. <view>
  99. <view class="">{{item.createTime}}</view>
  100. <view style="width: 636rpx;">
  101. <view class="content">
  102. <view class="nav-title">
  103. <view class="">
  104. <text>【{{item.assigneeName?item.assigneeName:'联兑通平台'}}】在
  105. [{{item.createTime}}] 开始处理 [{{item.historyActivityName}}] 环节</text>
  106. </view>
  107. <view class="" v-if="item.historyActivityDurationTime">
  108. 任务历时:
  109. [{{item.historyActivityDurationTime}}]
  110. </view>
  111. <view class="" v-if="item.comment">
  112. 批复意见:
  113. [{{item.comment}}]
  114. </view>
  115. <view class="" v-if="item.endTime">
  116. 结束时间:
  117. [{{item.endTime}}]
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. </u-time-line-item>
  125. </u-time-line>
  126. </view>
  127. </view>
  128. <block v-if="isShowBtn">
  129. <view class="" style="height: 50rpx;"></view>
  130. <view :style="{paddingBottom:safeAreaBottom}" class=" center" :class="current==0?'':'footer-fixed'">
  131. <view @click="operate" class="cu-btn df btn-bg-color radius " style="width: 90%;height: 80rpx;">
  132. <text v-if="current==1">参加活动</text>
  133. <text v-if="current==2">退出活动</text>
  134. </view>
  135. </view>
  136. </block>
  137. <u-modal :show-cancel-button="true" confirm-color="#FF9447" @confirm="join" title="提示" :mask-close-able="true"
  138. v-model="modalShow">
  139. <view class="slot-content" style="margin: 20rpx;">
  140. <u-form label-width="150" ref="uForm">
  141. <u-form-item :border-bottom="false">
  142. <view class="flex center">
  143. <u-input style="width: 80%;" height="150" placeholder="请输入活动折扣(如输入9,表示9折)"
  144. v-model="discount" />
  145. <text class="center margin-left-10">折</text>
  146. </view>
  147. </u-form-item>
  148. </u-form>
  149. </view>
  150. </u-modal>
  151. </view>
  152. </template>
  153. <script>
  154. import myBar from "@/components/my-bar.vue"
  155. export default {
  156. components: {
  157. myBar
  158. },
  159. onPageScroll(obj) {
  160. this.transparent = obj.scrollTop * 0.006;
  161. },
  162. filters: {
  163. // 名称超出显示省略号
  164. ellipsis(value) {
  165. if (!value) return '';
  166. if (value.length > 4) {
  167. return value.slice(0, 3) + '...'
  168. }
  169. return value
  170. }
  171. },
  172. data() {
  173. return {
  174. id: '',
  175. current: 0,
  176. transparent: '',
  177. //活动详情
  178. detail: {},
  179. //流程详情
  180. flowDetail: {},
  181. //审核历史
  182. open: true,
  183. historyList: [],
  184. //参加活动
  185. discount: '',
  186. joinRecords: [],
  187. isShowBtn: false,
  188. modalShow: false,
  189. //退出活动
  190. joinRecordId: ''
  191. }
  192. },
  193. onLoad(options) {
  194. this.id = options.id
  195. this.current = options.current
  196. this.joinRecordId = options.joinRecordId ? options.joinRecordId : ''
  197. if (!this.id) {
  198. this.$u.toast('系统错误')
  199. return
  200. }
  201. this.fetchDetail()
  202. this.getJoinRecord()
  203. },
  204. methods: {
  205. getJoinRecord() {
  206. let params = {
  207. activityId: this.id
  208. }
  209. this.$api.joinRecord.list(params).then(res => {
  210. this.joinRecords = res.data.records
  211. })
  212. },
  213. async getHistoryFlowList(processInstanceId) {
  214. this.$api.flow.historyFlowList({
  215. processInstanceId
  216. }).then(res => {
  217. this.historyList = res.data
  218. })
  219. },
  220. fetchDetail() {
  221. this.$api.activity.detail({
  222. id: this.id
  223. }).then(res => {
  224. this.detail = res.data
  225. if (!this.detail.auditStatus.includes('WAITING') && this.detail.auditStatus != this.$global
  226. .shop_auditStatus.FAIL&&this.current!=0) {
  227. this.isShowBtn = true
  228. }
  229. this.getHistoryFlowList(this.detail.processInstanceId)
  230. })
  231. },
  232. operate() {
  233. if (this.current == 0) {
  234. //暂时不需要停用活动这个操作
  235. } else if (this.current == 1) {
  236. this.modalShow = true
  237. } else if (this.current == 2) {
  238. this.exit()
  239. }
  240. },
  241. stop() {
  242. let item = this.$u.deepClone(this.detail)
  243. item.auditStatus = this.$global.shop_auditStatus.STOP
  244. this.$dialog.showModal('确定停用?').then(() => {
  245. this.$api.activity.stop(item).then(res => {
  246. if (res.success) {
  247. this.$util.isReloadAndBack()
  248. }
  249. })
  250. })
  251. },
  252. join() {
  253. let mall = this.$cache.get('selectedMall')
  254. let params = {
  255. activityId: this.id,
  256. joinType: this.$global.sponsorType.mall,
  257. joinId: this.vuex_mallId,
  258. joinName: mall.mallName,
  259. discount: this.discount ? (this.discount / 10) : this.detail.discount,
  260. joinLogo: mall.logo
  261. }
  262. this.$api.joinRecord.submit(params).then(res => {
  263. if (res.success) {
  264. this.$util.isReloadAndBack()
  265. }
  266. })
  267. },
  268. exit() {
  269. this.$dialog.showModal('确定退出活动?').then(() => {
  270. this.$api.joinRecord.remove(this.joinRecordId).then(res => {
  271. if (res.success) {
  272. this.$util.isReloadAndBack()
  273. }
  274. })
  275. })
  276. },
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .publish {
  282. overflow: hidden;
  283. border-radius: 10rpx;
  284. height: 320rpx;
  285. position: absolute;
  286. bottom: 20rpx;
  287. left: 0;
  288. right: 0;
  289. width: 90%;
  290. margin: 0 auto -50rpx;
  291. border-radius: 10rpx;
  292. box-shadow: 0rpx 16rpx 8rpx -8rpx #a8a8a8;
  293. display: flex;
  294. justify-content: center;
  295. align-items: center;
  296. flex-direction: column;
  297. text {
  298. font-size: 26rpx;
  299. color: #797979;
  300. }
  301. }
  302. .clock {
  303. background-color: #FFFFFF;
  304. height: 80rpx;
  305. padding-bottom: 20rpx;
  306. display: flex;
  307. flex-direction: column;
  308. justify-content: flex-end;
  309. align-items: center;
  310. .tips {
  311. margin-top: 10rpx;
  312. font-size: 24rpx;
  313. color: #FF9447;
  314. }
  315. }
  316. .content {
  317. padding: 0rpx 30rpx 15rpx;
  318. background-color: #FFFFFF;
  319. .title {
  320. line-height: 50rpx;
  321. font-weight: 800;
  322. font-size: 32rpx;
  323. }
  324. .data {
  325. margin: 20rpx 0;
  326. color: #787878;
  327. }
  328. }
  329. .intro {
  330. margin-top: 15rpx;
  331. padding: 15rpx 30rpx;
  332. background-color: #FFFFFF;
  333. .desc {
  334. color: #9a9a9a;
  335. margin-top: 20rpx;
  336. line-height: 46rpx;
  337. font-size: 28rpx;
  338. }
  339. }
  340. .attend {
  341. margin-top: 15rpx;
  342. padding: 15rpx 0 15rpx 30rpx;
  343. background-color: #FFFFFF;
  344. .data {
  345. margin: 10rpx 20rpx 10rpx 0;
  346. $width: 80rpx;
  347. .item {
  348. width: 200rpx;
  349. height: $width;
  350. background-color: #f0f0f0;
  351. border-radius: 50rpx;
  352. display: flex;
  353. image {
  354. width: $width;
  355. height: $width;
  356. }
  357. view {
  358. padding-left: 10rpx;
  359. display: flex;
  360. flex-direction: column;
  361. justify-content: center;
  362. font-size: 20rpx;
  363. text:first-child {
  364. margin-bottom: 4rpx;
  365. }
  366. }
  367. }
  368. }
  369. }
  370. .history {
  371. background-color: #ffff;
  372. box-sizing: border-box;
  373. padding: 40rpx 20rpx 20rpx 50rpx;
  374. }
  375. .nav-title {
  376. font-weight: 300;
  377. font-size: 28upx;
  378. padding-top: 20rpx;
  379. line-height: 50rpx;
  380. }
  381. .content {
  382. box-shadow: 0 8rpx 10rpx rgba(234, 234, 234, 0.5), 8rpx 0rpx 10rpx rgba(234, 234, 234, .5), -8rpx 0rpx 10rpx rgba(234, 234, 234, .5);
  383. background-color: #FFFFFF;
  384. padding: 20rpx;
  385. border-radius: 10rpx;
  386. margin: 20rpx 0;
  387. }
  388. </style>