activeApplication.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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" @tap="call">
  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" @tap="getLocal">
  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 = options.url
  89. this.getById()
  90. },
  91. methods: {
  92. call(){
  93. uni.makePhoneCall({
  94. phoneNumber: this.form.activityPhone, // 电话号码
  95. success: function () {
  96. console.log('拨打电话成功');
  97. },
  98. fail: function () {
  99. console.log('拨打电话失败');
  100. }
  101. });
  102. },
  103. getLocal(){
  104. const _this = this
  105. uni.openLocation({
  106. latitude: Number(_this.form.latitude),
  107. longitude: Number(_this.form.longitude),
  108. success: function () {
  109. console.log('success');
  110. }
  111. });
  112. // uni.getLocation({
  113. // type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  114. // success: function (res) {
  115. // const latitude = res.latitude;
  116. // const longitude = res.longitude;
  117. //
  118. // }
  119. // });
  120. },
  121. getById(){
  122. const data = {
  123. id : this.activityId,
  124. createdBy: getUserLocalStorageInfo().userId,
  125. }
  126. getHomeCommunityActivityById(data).then(res => {
  127. if (res.errno === 0) {
  128. this.form = res.data
  129. this.statusList.forEach(item => {
  130. if (this.form.status == item.value) {
  131. this.form.statusName = item.label
  132. }
  133. })
  134. const data = {
  135. activityId: this.activityId,
  136. companyId: getUserLocalStorageInfo().userId
  137. }
  138. isRegistration(data).then(res => {
  139. if (res.errno === 0) {
  140. this.registrationFlag = res.data
  141. }
  142. })
  143. }
  144. })
  145. },
  146. async getByCodes() {
  147. let data = await getByCodes(JSON.stringify(this.dc_key));
  148. this.dic_SelectList = this.$common.handleDicList(data);
  149. this.statusList = this.dic_SelectList.activity_stat
  150. console.log('this.statusList', this.statusList)
  151. },
  152. clickColl() {
  153. if (this.form.collectorsStatus==='2'){
  154. this.form.collectorsStatus='1'
  155. }else{
  156. this.form.collectorsStatus='2'
  157. }
  158. homeActivityClickCollect({
  159. id: this.activityId,
  160. createdBy: getUserLocalStorageInfo().userId,
  161. collectorsStatus: this.form.collectorsStatus
  162. }).then(res => {
  163. });
  164. },
  165. toApplication() {
  166. uni.navigateTo({
  167. url: '/pages/subPackages/parkActivity/applicationInfo?activityId=' + this.form.id + "&registrationFlag=" + this.registrationFlag
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss">
  174. .activeApplication {
  175. padding-bottom: 120rpx;
  176. .appFirstBox {
  177. margin: 24rpx 0;
  178. padding: 24rpx 32rpx;
  179. background: white;
  180. display: flex;
  181. flex-direction: column;
  182. .firstImg {
  183. width: 686rpx;
  184. height: 300rpx;
  185. }
  186. .appTitle {
  187. display: flex;
  188. align-items: center;
  189. margin: 24rpx 0;
  190. .titleName {
  191. font-size: 32rpx;
  192. color: rgba(24, 23, 42, 1);
  193. }
  194. .titleType {
  195. background: rgba(3, 101, 249, 0.20);
  196. font-size: 28rpx;
  197. color: rgba(3, 101, 249, 1);
  198. width: 112rpx;
  199. height: 48rpx;
  200. display: flex;
  201. align-items: center;
  202. justify-content: center;
  203. border-radius: 2px 2px 2px 2px;
  204. }
  205. }
  206. .joinBox {
  207. display: flex;
  208. justify-content: space-between;
  209. align-items: center;
  210. padding-bottom: 24rpx;
  211. .joinName {
  212. font-size: 28rpx;
  213. color: rgba(136, 136, 136, 1);
  214. }
  215. .shoucang {
  216. display: flex;
  217. align-items: center;
  218. font-size: 28rpx;
  219. color: rgba(24, 23, 42, 1);
  220. .scImg {
  221. width: 32rpx;
  222. height: 28rpx;
  223. margin-right: 8rpx;
  224. }
  225. }
  226. }
  227. .contactBox {
  228. display: flex;
  229. align-items: center;
  230. justify-content: space-between;
  231. padding: 24rpx 0;
  232. border-top: 1px solid #E6E6E6;
  233. .contackLeft {
  234. display: flex;
  235. align-items: center;
  236. }
  237. .phoneIcon {
  238. width: 64rpx;
  239. height: 64rpx;
  240. }
  241. }
  242. }
  243. .appSecondBox {
  244. padding: 32rpx;
  245. background: white;
  246. .secondBoxItem {
  247. display: flex;
  248. flex-direction: column;
  249. margin-bottom: 48rpx;
  250. .secondBoxTitle {
  251. color: #222222;
  252. font-size: 32rpx;
  253. font-weight: 600;
  254. margin-bottom: 16rpx;
  255. }
  256. .secondBoxInfo {
  257. font-size: 28rpx;
  258. color: #666666;
  259. line-height: 40rpx;
  260. }
  261. .dhInfo {
  262. display: flex;
  263. justify-content: space-between;
  264. .dhIcon {
  265. width: 36rpx;
  266. height: 36rpx;
  267. padding-left: 20rpx;
  268. border-left: 1px solid #E6E6E6;
  269. }
  270. }
  271. }
  272. }
  273. .bmBtn {
  274. width: 654rpx;
  275. height: 96rpx;
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. color: white;
  280. background: #0365F9;
  281. border-radius: 8rpx;
  282. margin: 48rpx 48rpx 0rpx 48rpx;
  283. }
  284. .bmBtn2 {
  285. width: 654rpx;
  286. height: 96rpx;
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. color: white;
  291. background: #9f9e9e;
  292. border-radius: 8rpx;
  293. margin: 48rpx 48rpx 0rpx 48rpx;
  294. }
  295. }
  296. </style>