activeApplication.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div class="activeApplication">
  3. <div class="appFirstBox">
  4. <img :src="url" class="firstImg"/>
  5. <div class="appTitle">
  6. <span class="titleName">{{ form.activityName }}</span>
  7. <span class="titleType">{{ form.statusName }}</span>
  8. </div>
  9. <div @tap.stop="clickColl()" class="joinBox">
  10. <span class="joinName">{{ form.registrationNumbers }}人参加</span>
  11. <span class="shoucang"><img :src="form.collectorsStatus==='2' ? heartSel : heart" class="scImg"/> 收藏</span>
  12. </div>
  13. <div class="contactBox">
  14. <span class="contackLeft">
  15. <span style="color: #666666;font-size: 28rpx">联系电话:</span>
  16. <span style="color: #18172A;font-size: 36rpx;font-weight: 600">{{ form.activityPhone }}</span>
  17. </span>
  18. <img src="https://www.idea-co-sf.com/gardenProduct/image/phoneIcon.png" class="phoneIcon">
  19. </div>
  20. </div>
  21. <div class="appSecondBox">
  22. <div class="secondBoxItem">
  23. <span class="secondBoxTitle">活动举办</span>
  24. <span class="secondBoxInfo">{{ form.activitiesNotice }}</span>
  25. </div>
  26. <div class="secondBoxItem">
  27. <span class="secondBoxTitle">活动内容</span>
  28. <span class="secondBoxInfo">{{ form.activityContent }}</span>
  29. </div>
  30. <div class="secondBoxItem">
  31. <span class="secondBoxTitle">活动时间</span>
  32. <span class="secondBoxInfo">{{ form.activityStartTime }} ~ {{ form.activityEndTime }}</span>
  33. </div>
  34. <div class="secondBoxItem">
  35. <span class="secondBoxTitle">活动地址</span>
  36. <span class="secondBoxInfo dhInfo">
  37. <span>{{ form.activityAddress }} - {{ form.activityAddressDetail }}</span>
  38. <img src="./image/dhIcon.png" class="dhIcon">
  39. </span>
  40. </div>
  41. <div class="secondBoxItem">
  42. <span class="secondBoxTitle">报名条件</span>
  43. <span class="secondBoxInfo">
  44. {{ form.registrationConditions }}
  45. </span>
  46. </div>
  47. <div class="secondBoxItem">
  48. <span class="secondBoxTitle">报名时间</span>
  49. <span class="secondBoxInfo">
  50. {{ form.registrationStartTime }} ~ {{ form.registrationEndTime }}
  51. </span>
  52. </div>
  53. <div class="secondBoxItem">
  54. <span class="secondBoxTitle">活动参与</span>
  55. <span class="secondBoxInfo">
  56. {{ form.activityQuota }}
  57. </span>
  58. </div>
  59. </div>
  60. <button v-if="!registrationFlag" class="bmBtn" @tap="toApplication">我要报名</button>
  61. <button v-if="registrationFlag" class="bmBtn2" @tap="toApplication">已报名</button>
  62. </div>
  63. </template>
  64. <script>
  65. import {getHomeCommunityActivityById, getByCodes, isRegistration, getUserLocalStorageInfo, homeActivityClickCollect} from "../../../js_sdk/http";
  66. export default {
  67. name: "activeApplication",
  68. data() {
  69. return {
  70. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  71. dc_key: ['activity_stat'],
  72. heartSel: "https://www.idea-co-sf.com/gardenProduct/image/heartSel.png",
  73. heart: "https://www.idea-co-sf.com/gardenProduct/image/heart.png",
  74. isColl: true,
  75. form: {},
  76. dic_SelectList: [],
  77. statusList: [],
  78. activityId: '',
  79. registrationFlag: false,
  80. url: ''
  81. }
  82. },
  83. created() {
  84. this.getByCodes()
  85. },
  86. onLoad(options) {
  87. this.activityId = options.activityId
  88. this.url = url
  89. this.getById()
  90. },
  91. methods: {
  92. getById(){
  93. const data = {
  94. id : this.activityId,
  95. createdBy: getUserLocalStorageInfo().userId,
  96. }
  97. getHomeCommunityActivityById(data).then(res => {
  98. if (res.errno === 0) {
  99. this.form = res.data
  100. this.statusList.forEach(item => {
  101. if (this.form.status == item.value) {
  102. this.form.statusName = item.label
  103. }
  104. })
  105. const data = {
  106. activityId: this.activityId,
  107. companyId: getUserLocalStorageInfo().userId
  108. }
  109. isRegistration(data).then(res => {
  110. if (res.errno === 0) {
  111. this.registrationFlag = res.data
  112. }
  113. })
  114. }
  115. })
  116. },
  117. async getByCodes() {
  118. let data = await getByCodes(JSON.stringify(this.dc_key));
  119. this.dic_SelectList = this.$common.handleDicList(data);
  120. this.statusList = this.dic_SelectList.activity_stat
  121. console.log('this.statusList', this.statusList)
  122. },
  123. clickColl() {
  124. if (this.form.collectorsStatus==='2'){
  125. this.form.collectorsStatus='1'
  126. }else{
  127. this.form.collectorsStatus='2'
  128. }
  129. homeActivityClickCollect({
  130. id: this.activityId,
  131. createdBy: getUserLocalStorageInfo().userId,
  132. collectorsStatus: this.form.collectorsStatus
  133. }).then(res => {
  134. });
  135. },
  136. toApplication() {
  137. uni.navigateTo({
  138. url: '/pages/subPackages/parkActivity/applicationInfo?activityId=' + this.form.id + "&registrationFlag=" + this.registrationFlag
  139. })
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss">
  145. .activeApplication {
  146. padding-bottom: 120rpx;
  147. .appFirstBox {
  148. margin: 24rpx 0;
  149. padding: 24rpx 32rpx;
  150. background: white;
  151. display: flex;
  152. flex-direction: column;
  153. .firstImg {
  154. width: 686rpx;
  155. height: 300rpx;
  156. }
  157. .appTitle {
  158. display: flex;
  159. align-items: center;
  160. margin: 24rpx 0;
  161. .titleName {
  162. font-size: 32rpx;
  163. color: rgba(24, 23, 42, 1);
  164. }
  165. .titleType {
  166. background: rgba(3, 101, 249, 0.20);
  167. font-size: 28rpx;
  168. color: rgba(3, 101, 249, 1);
  169. width: 112rpx;
  170. height: 48rpx;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. border-radius: 2px 2px 2px 2px;
  175. }
  176. }
  177. .joinBox {
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. padding-bottom: 24rpx;
  182. .joinName {
  183. font-size: 28rpx;
  184. color: rgba(136, 136, 136, 1);
  185. }
  186. .shoucang {
  187. display: flex;
  188. align-items: center;
  189. font-size: 28rpx;
  190. color: rgba(24, 23, 42, 1);
  191. .scImg {
  192. width: 32rpx;
  193. height: 28rpx;
  194. margin-right: 8rpx;
  195. }
  196. }
  197. }
  198. .contactBox {
  199. display: flex;
  200. align-items: center;
  201. justify-content: space-between;
  202. padding: 24rpx 0;
  203. border-top: 1px solid #E6E6E6;
  204. .contackLeft {
  205. display: flex;
  206. align-items: center;
  207. }
  208. .phoneIcon {
  209. width: 64rpx;
  210. height: 64rpx;
  211. }
  212. }
  213. }
  214. .appSecondBox {
  215. padding: 32rpx;
  216. background: white;
  217. .secondBoxItem {
  218. display: flex;
  219. flex-direction: column;
  220. margin-bottom: 48rpx;
  221. .secondBoxTitle {
  222. color: #222222;
  223. font-size: 32rpx;
  224. font-weight: 600;
  225. margin-bottom: 16rpx;
  226. }
  227. .secondBoxInfo {
  228. font-size: 28rpx;
  229. color: #666666;
  230. line-height: 40rpx;
  231. }
  232. .dhInfo {
  233. display: flex;
  234. justify-content: space-between;
  235. .dhIcon {
  236. width: 36rpx;
  237. height: 36rpx;
  238. padding-left: 20rpx;
  239. border-left: 1px solid #E6E6E6;
  240. }
  241. }
  242. }
  243. }
  244. .bmBtn {
  245. width: 654rpx;
  246. height: 96rpx;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. color: white;
  251. background: #0365F9;
  252. border-radius: 8rpx;
  253. margin: 48rpx 48rpx 0rpx 48rpx;
  254. }
  255. .bmBtn2 {
  256. width: 654rpx;
  257. height: 96rpx;
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. color: white;
  262. background: #9f9e9e;
  263. border-radius: 8rpx;
  264. margin: 48rpx 48rpx 0rpx 48rpx;
  265. }
  266. }
  267. </style>