activitydetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <template>
  2. <view :class="[AppTheme]" class="all_box">
  3. <image class="live_thumbnails" lazy-load="true" mode="scaleToFill" :src="activitydetails.activity_img"></image>
  4. <view class="basic_information">
  5. <view class="information_line">
  6. <view class="information_line_p1">
  7. <text class="information_line_p1_ti1">{{ activitydetails.activity_title || '未知标题' }}</text>
  8. <view class="activity_typeid bg-primary">{{ activitydetails.cate_name || '未知类别' }}</view>
  9. </view>
  10. <u-icon name="share" @click="opensharebox" color="#000" size="25"></u-icon>
  11. </view>
  12. <view class="browse_information">
  13. <view class="browse_information_item">浏览人数 {{ activitydetails.page_view || 0 }}</view>
  14. <view class="browse_information_item">收藏人数 {{ activitydetails.collect_num || 0 }}</view>
  15. </view>
  16. <view class="information_line">
  17. <view class="address_p1">
  18. <u-icon name="map-fill" labelSize="15" :color="primary" labelPos="right" label="举办地址" size="22">
  19. </u-icon>
  20. </view>
  21. <view class="address_p2" @click="casemap">
  22. <u-icon :name="position?'arrow-right':''" labelSize="15" labelPos="left"
  23. :label="(activitydetails.activity_address || '未知位置')" size="18">
  24. </u-icon>
  25. </view>
  26. </view>
  27. <view class="information_line">
  28. <view class="address_p1">
  29. <u-icon name="clock-fill" labelSize="15" :color="primary" labelPos="right" label="活动时间" size="22">
  30. </u-icon>
  31. </view>
  32. <view class="address_p2">
  33. <text>{{ retushorttime(activitydetails.start_time || '2021-10-01') }}</text>
  34. <text style="font-size: 40rpx;">-</text>
  35. <text>{{ retushorttime(activitydetails.end_time || '2021-10-01') }}</text>
  36. </view>
  37. </view>
  38. <view class="information_line">
  39. <view class="address_p1">
  40. <u-icon name="coupon-fill" labelSize="15" :color="primary" labelPos="right" label="票卷价格" size="22">
  41. </u-icon>
  42. </view>
  43. <view class="address_p2">
  44. <text>{{ activitydetails.child_fares || 0 }}</text>
  45. <text style="font-size: 40rpx;">-</text>
  46. <text>{{ activitydetails.adult_fares || 0 }} / 人</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="activity_details">
  51. <view class="details_title">活动详情</view>
  52. <view class="dotted_line_segmentation"></view>
  53. <u-parse :content="activitydetails.activity_content"></u-parse>
  54. </view>
  55. <admyself :opshow="true"></admyself>
  56. <view style="height: 100rpx;"></view>
  57. <!-- 底部操作菜单 -->
  58. <view class="page-bottom">
  59. <navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
  60. <u-icon labelSize="12" color="#909399" label="首页" labelPos="bottom" labelColor="#909399" size="25"
  61. name="home"></u-icon>
  62. </navigator>
  63. <view class="p-b-btn" style="position: relative;">
  64. <u-icon labelSize="12" color="#909399" label="主办方" labelPos="bottom" labelColor="#909399" size="25"
  65. name="account" @click="callphone"></u-icon>
  66. </view>
  67. <view class="p-b-btn">
  68. <u-icon v-if="!ifcare" @click="setcareheart(1)" labelSize="12" color="#909399" label="收藏"
  69. labelPos="bottom" labelColor="#909399" size="24" name="heart-fill"></u-icon>
  70. <u-icon v-if="ifcare" @click="setcareheart(2)" labelSize="12" :color="primary" label="收藏"
  71. labelPos="bottom" :labelColor="primary" size="24" name="heart-fill"></u-icon>
  72. </view>
  73. <view class="action-btn-group"><button type="primary"
  74. class=" bg-linear-gradient action-btn no-border buy-now-btn" @click="gochoose">立即报名</button></view>
  75. </view>
  76. <!-- #ifdef MP-WEIXIN -->
  77. <nologin ref="nologin" v-on:loginback="loginback"></nologin>
  78. <!-- #endif -->
  79. <!-- 分享 -->
  80. <sharebox ref="sbox" v-if="sharedata" :data="sharedata"></sharebox>
  81. </view>
  82. </template>
  83. <script>
  84. import mallApi from '@/api/mall/index.js';
  85. import untiljs from '@/common/until.js';
  86. import homeApi from '@/api/home/index.js';
  87. import nologin from '@/components/nologin/nologin.vue';
  88. export default {
  89. components: {
  90. nologin
  91. },
  92. data() {
  93. return {
  94. primary: this.$theme.primary,
  95. sharedata: null,
  96. settingFile: getApp().globalData.siteinfo,
  97. //详细信息
  98. activitydetails: {},
  99. //是否收藏
  100. ifcare: false,
  101. // 坐标地址
  102. latitude: 34.758351,
  103. longitude: 113.768284,
  104. position: false
  105. };
  106. },
  107. onLoad(options) {
  108. let that = this;
  109. this.$bindid.getbindid(options, this.$store);
  110. let id = options.id;
  111. if (that.$config) {
  112. if (that.$config.app.position == 1) {
  113. that.position = true;
  114. }
  115. }
  116. if (id !== undefined || id !== null) {
  117. this.vueinit(id);
  118. }
  119. },
  120. onShareAppMessage(res) {
  121. let that = this
  122. let data = {
  123. title: that.sharedata.title,
  124. imageUrl: that.sharedata.imageUrl,
  125. path: that.sharedata.path
  126. };
  127. return data;
  128. },
  129. onShareTimeline(res) {
  130. let that = this
  131. return {
  132. title: that.sharedata.title,
  133. imageUrl: that.sharedata.imageUrl,
  134. path: that.sharedata.path
  135. }
  136. },
  137. methods: {
  138. loginback() {
  139. //登录回调
  140. },
  141. opensharebox() {
  142. this.$refs.sbox.opensharebox(this.sharedata);
  143. },
  144. //更改收藏
  145. setcareheart(settype) {
  146. let that = this;
  147. let params = {
  148. activity_id: that.activitydetails.id,
  149. status: settype
  150. };
  151. mallApi.setcareheart(params).then(res => {
  152. if (res.status == 1) {
  153. that.ifcare = !that.ifcare;
  154. uni.showToast({
  155. title: res.msg,
  156. icon: "none"
  157. })
  158. } else {
  159. that.$api.msg(res.msg);
  160. }
  161. });
  162. },
  163. //切换地图
  164. casemap() {
  165. if (this.position) {
  166. // #ifdef MP-WEIXIN || APP-PLUS
  167. uni.openLocation({
  168. latitude: Number(this.latitude), //要去的纬度-地址---请注意这里的Number,如果不加Number,就会出错
  169. longitude: Number(this.longitude), //要去的经度-地址---请注意这里的Number,如果不加Number,就会出错
  170. name: '',
  171. address: this.activitydetails.activity_address
  172. });
  173. // #endif
  174. }
  175. },
  176. //拨打电话
  177. callphone() {
  178. uni.makePhoneCall({
  179. phoneNumber: this.activitydetails.host_mobile
  180. });
  181. },
  182. // 返回指定格式时间
  183. retushorttime(time) {
  184. if (time !== undefined && time !== null) {
  185. let date = new Date(time);
  186. return untiljs.formatDate(date, 'yyyy.MM.dd');
  187. }
  188. },
  189. //选择活动票
  190. gochoose() {
  191. let that = this;
  192. uni.setStorage({
  193. key: 'activitydetails',
  194. data: that.activitydetails
  195. });
  196. let tmplIdsone = that.$config.temlist;
  197. if (tmplIdsone) {
  198. that.$until.requestSubscribeMessage([tmplIdsone['orderSuccess'], tmplIdsone['orderDelivery'],
  199. tmplIdsone['returnReminder']
  200. ], tmplIdsone, function() {
  201. if (that.$store.state.islogin()) {
  202. uni.navigateTo({
  203. url: '/pagesB/pages/chooseticket/chooseticket'
  204. });
  205. } else {
  206. that.$refs.nologin.open();
  207. }
  208. });
  209. }else{
  210. if (that.$store.state.islogin()) {
  211. uni.navigateTo({
  212. url: '/pagesB/pages/chooseticket/chooseticket'
  213. });
  214. } else {
  215. that.$refs.nologin.open();
  216. }
  217. }
  218. },
  219. vueinit(id) {
  220. let that = this;
  221. let params = {
  222. id: id
  223. };
  224. mallApi.getdeitbyid(params).then(res => {
  225. if (res.status == 1) {
  226. res.data.activity_content = res.data.activity_content.replace(/\<img src="/gi,
  227. `<img style='width:100%;display:block' src="${that.settingFile.root_rich_img}`);
  228. that.activitydetails = res.data;
  229. that.sharedata = res.data.sharedata;
  230. that.sharedata.title = res.data.activity_title;
  231. that.sharedata.path = '/pagesB/pages/activitydetails/activitydetails?pid=' + that
  232. .$getuid() + '&id=' + id;
  233. that.latitude = res.data.location[1];
  234. that.longitude = res.data.location[0];
  235. if (that.activitydetails.is_collect === 1) {
  236. that.ifcare = true;
  237. }
  238. } else {
  239. that.activitydetails = res.data;
  240. that.$api.msg(res.msg);
  241. }
  242. });
  243. }
  244. }
  245. };
  246. </script>
  247. <style lang="scss">
  248. .all_box {
  249. background-color: #fafafa;
  250. min-height: 100vh;
  251. .live_thumbnails {
  252. width: 100%;
  253. height: 420rpx;
  254. box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08);
  255. }
  256. .basic_information {
  257. background-color: #fafafa;
  258. border-radius: 40rpx 40rpx 0 0;
  259. padding: 0 30rpx;
  260. position: relative;
  261. top: -35rpx;
  262. .information_line {
  263. font-size: 31rpx;
  264. line-height: 70rpx;
  265. color: #111;
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. .information_line_p1 {
  270. display: flex;
  271. justify-content: flex-start;
  272. align-items: center;
  273. font-size: 34rpx;
  274. color: #333;
  275. .information_line_p1_ti1 {
  276. font-size: 32rpx;
  277. line-height: 42rpx;
  278. padding-top: 10rpx;
  279. color: #000;
  280. }
  281. .activity_typeid {
  282. font-size: 28rpx;
  283. color: #ffffff;
  284. height: 40rpx;
  285. line-height: 40rpx;
  286. padding: 0 10rpx;
  287. border-radius: 10rpx;
  288. margin-left: 25rpx;
  289. }
  290. }
  291. .wx_share {
  292. width: auto;
  293. margin: 0;
  294. padding: 0;
  295. }
  296. .wx_share::after {
  297. border: none;
  298. }
  299. .address_p1 {
  300. width: 170rpx;
  301. display: flex;
  302. justify-content: flex-start;
  303. align-items: center;
  304. flex-wrap: nowrap;
  305. font-size: 28rpx;
  306. color: #000;
  307. margin-right: 20rpx;
  308. }
  309. .address_p2 {
  310. font-size: 26.5rpx;
  311. color: #111;
  312. display: flex;
  313. justify-content: flex-start;
  314. align-items: center;
  315. text {
  316. display: block;
  317. }
  318. }
  319. .cost {
  320. color: #56ab2f;
  321. }
  322. u-icon {
  323. margin-right: 15rpx;
  324. }
  325. }
  326. .browse_information {
  327. display: flex;
  328. justify-content: flex-start;
  329. align-items: center;
  330. margin-bottom: 25rpx;
  331. .browse_information_item {
  332. font-size: 22rpx;
  333. color: #a6a6a6;
  334. margin-right: 25rpx;
  335. }
  336. }
  337. }
  338. .activity_details {
  339. background-color: #ffffff;
  340. border-radius: 20rpx;
  341. margin: 0 3% 0 3%;
  342. padding: 15rpx;
  343. box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.08);
  344. margin-bottom: 20rpx;
  345. min-height: 500rpx;
  346. .details_title {
  347. font-size: 32rpx;
  348. color: #000;
  349. font-weight: 900;
  350. }
  351. .dotted_line_segmentation {
  352. width: 100%;
  353. border-bottom: 2rpx solid #eeeeee;
  354. margin: 25rpx 0;
  355. }
  356. .details_contont {
  357. width: 100%;
  358. image {
  359. max-width: 100%;
  360. }
  361. }
  362. }
  363. /* 底部操作菜单 */
  364. .page-bottom {
  365. position: fixed;
  366. left: 0;
  367. bottom: 0;
  368. z-index: 95;
  369. display: flex;
  370. justify-content: center;
  371. align-items: center;
  372. width: 100%;
  373. height: 100upx;
  374. background: rgba(255, 255, 255, 0.9);
  375. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, 0.5);
  376. .p-b-btn {
  377. display: flex;
  378. flex-direction: column;
  379. align-items: center;
  380. justify-content: center;
  381. font-size: $font-sm;
  382. width: 96upx;
  383. height: 80upx;
  384. .yticon {
  385. font-size: 40upx;
  386. line-height: 48upx;
  387. color: $font-color-light;
  388. }
  389. &.active,
  390. &.active .yticon {
  391. color: $tab-color-1;
  392. }
  393. .icon-fenxiang2 {
  394. font-size: 42upx;
  395. transform: translateY(-2upx);
  396. }
  397. .icon-shoucang {
  398. font-size: 46upx;
  399. }
  400. }
  401. .action-btn-group {
  402. display: flex;
  403. height: 76upx;
  404. border-radius: 100px;
  405. overflow: hidden;
  406. box-shadow: 0 20upx 40upx -16upx #fa436a;
  407. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  408. // background: linear-gradient(to right, #ffac30);
  409. margin-left: 20upx;
  410. position: relative;
  411. .action-btn {
  412. display: flex;
  413. align-items: center;
  414. justify-content: center;
  415. width: 400rpx;
  416. height: 100%;
  417. font-size: $font-base;
  418. padding: 0;
  419. border-radius: 0;
  420. }
  421. }
  422. }
  423. .padd_bottom {
  424. height: calc(env(safe-area-inset-bottom) + 130rpx);
  425. width: 100%;
  426. }
  427. }
  428. </style>