activeApplication.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="activeApplication">
  3. <div class="appFirstBox">
  4. <img src="https://www.idea-co-sf.com/gardenProduct/image/img1.png" 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. }
  81. },
  82. created() {
  83. this.getByCodes()
  84. },
  85. onShow() {
  86. this.getById()
  87. },
  88. onLoad(options) {
  89. this.activityId = options.activityId
  90. this.getById()
  91. },
  92. methods: {
  93. getById(){
  94. const data = {
  95. id : this.activityId,
  96. createdBy: getUserLocalStorageInfo().userId,
  97. }
  98. getHomeCommunityActivityById(data).then(res => {
  99. if (res.errno === 0) {
  100. this.form = res.data
  101. this.statusList.forEach(item => {
  102. if (this.form.status == item.value) {
  103. this.form.statusName = item.label
  104. }
  105. })
  106. const data = {
  107. activityId: this.activityId,
  108. companyId: getUserLocalStorageInfo().userId
  109. }
  110. isRegistration(data).then(res => {
  111. if (res.errno === 0) {
  112. this.registrationFlag = res.data
  113. }
  114. })
  115. }
  116. })
  117. },
  118. async getByCodes() {
  119. let data = await getByCodes(JSON.stringify(this.dc_key));
  120. this.dic_SelectList = this.$common.handleDicList(data);
  121. this.statusList = this.dic_SelectList.activity_stat
  122. console.log('this.statusList', this.statusList)
  123. },
  124. clickColl() {
  125. if (this.form.collectorsStatus==='2'){
  126. this.form.collectorsStatus='1'
  127. }else{
  128. this.form.collectorsStatus='2'
  129. }
  130. homeActivityClickCollect({
  131. id: this.activityId,
  132. createdBy: getUserLocalStorageInfo().userId,
  133. collectorsStatus: this.form.collectorsStatus
  134. }).then(res => {
  135. });
  136. },
  137. toApplication() {
  138. uni.navigateTo({
  139. url: '/pages/subPackages/parkActivity/applicationInfo?activityId=' + this.form.id + "&registrationFlag=" + this.registrationFlag
  140. })
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. .activeApplication {
  147. padding-bottom: 120rpx;
  148. .appFirstBox {
  149. margin: 24rpx 0;
  150. padding: 24rpx 32rpx;
  151. background: white;
  152. display: flex;
  153. flex-direction: column;
  154. .firstImg {
  155. width: 686rpx;
  156. height: 300rpx;
  157. }
  158. .appTitle {
  159. display: flex;
  160. align-items: center;
  161. margin: 24rpx 0;
  162. .titleName {
  163. font-size: 32rpx;
  164. color: rgba(24, 23, 42, 1);
  165. }
  166. .titleType {
  167. background: rgba(3, 101, 249, 0.20);
  168. font-size: 28rpx;
  169. color: rgba(3, 101, 249, 1);
  170. width: 112rpx;
  171. height: 48rpx;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. border-radius: 2px 2px 2px 2px;
  176. }
  177. }
  178. .joinBox {
  179. display: flex;
  180. justify-content: space-between;
  181. align-items: center;
  182. padding-bottom: 24rpx;
  183. .joinName {
  184. font-size: 28rpx;
  185. color: rgba(136, 136, 136, 1);
  186. }
  187. .shoucang {
  188. display: flex;
  189. align-items: center;
  190. font-size: 28rpx;
  191. color: rgba(24, 23, 42, 1);
  192. .scImg {
  193. width: 32rpx;
  194. height: 28rpx;
  195. margin-right: 8rpx;
  196. }
  197. }
  198. }
  199. .contactBox {
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. padding: 24rpx 0;
  204. border-top: 1px solid #E6E6E6;
  205. .contackLeft {
  206. display: flex;
  207. align-items: center;
  208. }
  209. .phoneIcon {
  210. width: 64rpx;
  211. height: 64rpx;
  212. }
  213. }
  214. }
  215. .appSecondBox {
  216. padding: 32rpx;
  217. background: white;
  218. .secondBoxItem {
  219. display: flex;
  220. flex-direction: column;
  221. margin-bottom: 48rpx;
  222. .secondBoxTitle {
  223. color: #222222;
  224. font-size: 32rpx;
  225. font-weight: 600;
  226. margin-bottom: 16rpx;
  227. }
  228. .secondBoxInfo {
  229. font-size: 28rpx;
  230. color: #666666;
  231. line-height: 40rpx;
  232. }
  233. .dhInfo {
  234. display: flex;
  235. justify-content: space-between;
  236. .dhIcon {
  237. width: 36rpx;
  238. height: 36rpx;
  239. padding-left: 20rpx;
  240. border-left: 1px solid #E6E6E6;
  241. }
  242. }
  243. }
  244. }
  245. .bmBtn {
  246. width: 654rpx;
  247. height: 96rpx;
  248. display: flex;
  249. align-items: center;
  250. justify-content: center;
  251. color: white;
  252. background: #0365F9;
  253. border-radius: 8rpx;
  254. margin: 48rpx 48rpx 0rpx 48rpx;
  255. }
  256. .bmBtn2 {
  257. width: 654rpx;
  258. height: 96rpx;
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. color: white;
  263. background: #9f9e9e;
  264. border-radius: 8rpx;
  265. margin: 48rpx 48rpx 0rpx 48rpx;
  266. }
  267. }
  268. </style>