detail.vue 10 KB

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