推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

655 lines
15 KiB

1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
10 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
  1. <template>
  2. <view>
  3. <view class="head-box"></view>
  4. <uv-navbar autoBack title="活动详情" leftIconColor="#fff" :bgColor="bgColor" height="100rpx" :titleStyle="{color:'#fff'}"></uv-navbar>
  5. <view class="content">
  6. <view class="content-head">
  7. <uv-swiper :list="imageArr"
  8. keyName="image"
  9. height="406rpx" radius="30rpx"
  10. bgColor="transparent" indicator
  11. indicatorMode="dot"></uv-swiper>
  12. <!-- <image class="image-box" :src="imageArr" mode="aspectFill"></image> -->
  13. <view class="msg-box">
  14. <view class="msg-box-title">{{activityDetails.title}}</view>
  15. <view class="msg-box-time">开始时间{{activityDetails.startTime}}</view>
  16. <view class="msg-box-address">
  17. <view class="msg-box-address-text">活动地址{{activityDetails.address}}</view>
  18. <view class="address-icon" @click="daohang">
  19. <image src="@/static/image/home/address-icon-2.png" mode="aspectFill"></image>
  20. <view>导航</view>
  21. </view>
  22. </view>
  23. <view class="lingdui-box">
  24. <image class="use-img" :src="adminUserInfo.headImage" mode="aspectFill"></image>
  25. <view class="lingdui-msg">
  26. <view class="lingdui-msg-name">
  27. <view>{{adminUserInfo.nickName}}</view>
  28. <view class="name-tip">主理人</view>
  29. </view>
  30. <view>
  31. <uv-rate :count="count"
  32. disabled
  33. v-model="numValue" size="23" activeColor="#FFA200"></uv-rate>
  34. </view>
  35. </view>
  36. <view class="add-wx" @click="$refs.ewmpopup.open();">添加微信</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="lv-miaoshu">
  41. <view class="title-box">活动描述</view>
  42. <view class="value-box">
  43. <view class="uv-content lv-msg-box">
  44. <uv-parse :content="activityDetails.details"></uv-parse>
  45. </view>
  46. </view>
  47. <!-- <view class="value-box">
  48. <view class="lv-msg-box">
  49. 当金黄的落叶轻柔地铺满了小城的每个角落我们知道最温柔的季节已悄然而至在这个收获的季节里我们诚挚邀请您加入我们的秋日私旅
  50. </view>
  51. </view> -->
  52. <view class="title-box">注意事项</view>
  53. <view class="value-box">
  54. <view class="lv-msg-box">
  55. <uv-parse :content="activityDetails.precautions"></uv-parse>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="bottom-box">
  61. <view class="price-box">
  62. <view class="peice-val"><text></text>{{activityDetails.price}}</view>
  63. <view>报名费用</view>
  64. </view>
  65. <view class="caozuo-box">
  66. <view class="caozuo-item border-r"
  67. @click="collect"
  68. v-if="!isCollect">
  69. <image src="./static/shoucang-icon.png"
  70. mode=""></image>
  71. <text>收藏</text>
  72. </view>
  73. <view class="caozuo-item border-r isCollect"
  74. @click="collect"
  75. style=""
  76. v-else>
  77. <text>已收藏</text>
  78. </view>
  79. <button type="primary" style="background-color: transparent;height: 100rpx;font-size: 20rpx;padding: 0;" open-type="share" >
  80. <view class="caozuo-item">
  81. <image src="./static/zhuanfa-icon.png" mode=""></image>
  82. <text style="line-height: initial;">转发</text>
  83. </view>
  84. </button>
  85. </view>
  86. <!-- <view class="btn-box" @click="toBaoming">立即报名</view> -->
  87. <!-- <view class="btn-box end-btn">已结束</view> -->
  88. <view class="btn-box"
  89. v-if="activityDetails.state == 0"
  90. @click="toBaoming">立即报名</view>
  91. <view class="btn-box-2"
  92. v-if="activityDetails.state == 1"
  93. >已结束</view>
  94. </view>
  95. <uv-popup ref="popup" mode="bottom" bgColor="">
  96. <view class="popup-cont">
  97. <view class="popup-title">
  98. <view></view>
  99. <view>选择活动状态</view>
  100. <uv-icon name="close" color="#fff" @click="$refs.popup.close();"></uv-icon>
  101. </view>
  102. <view class="popup-list">
  103. <view class="list-item"
  104. v-for="(item,i) in typeList" :key="i"
  105. @click="chooseClick(item,i)">
  106. <view class="item-l" :class="chooseIndex == i ? 'chooose-class' : ''">
  107. <view>{{item.name}}</view>
  108. <view class="item-l-val">{{item.price}}</view>
  109. </view>
  110. <uv-icon name="checkmark" color="#FF5858" v-if="chooseIndex == i"></uv-icon>
  111. </view>
  112. </view>
  113. <view class="confirm-box">
  114. <uv-button @click="confirmClick(chooseIndex)" text="确定" color="#381615" shape="circle" :customStyle="btnCustomStyle"></uv-button>
  115. </view>
  116. </view>
  117. </uv-popup>
  118. <uv-popup ref="ewmpopup" mode="center" round="30rpx">
  119. <view class="pop-cont">
  120. <uv-image :src="ewmImg" width="380rpx" height="380rpx"></uv-image>
  121. </view>
  122. </uv-popup>
  123. </view>
  124. </template>
  125. <script>
  126. export default{
  127. data() {
  128. return {
  129. activityDetails:{},
  130. adminUserInfo:{},
  131. btnCustomStyle:{
  132. color:'#FF5858'
  133. },
  134. chooseIndex:0,
  135. bgColor:'transparent',
  136. count:5,
  137. numValue:0,
  138. ewmImg:'',
  139. typeList:[
  140. // {
  141. // name:'早鸟票',
  142. // price: 0
  143. // },
  144. // {
  145. // name:'单人票',
  146. // price: 0
  147. // },
  148. // {
  149. // name:'尊享票',
  150. // price: 0
  151. // }
  152. ],
  153. activityId:'',
  154. isCollect : false,
  155. }
  156. },
  157. computed:{
  158. imageArr() {
  159. return this.activityDetails.image
  160. && this.activityDetails.image.split(',')
  161. }
  162. },
  163. onShareAppMessage(res) {
  164. console.log(res)
  165. if (res.from === 'button') {
  166. // 来自详情页页面内分享按
  167. return {
  168. title:this.activityDetails.title,
  169. path: `/pages_order/huodong-detail?activityId=${this.activityId}`,
  170. imageUrl: this.imageArr[0],
  171. success: function(res) {
  172. // 转发成功
  173. console.log('转发成功')
  174. },
  175. fail: function(res) {
  176. // 转发失败
  177. }
  178. };
  179. }
  180. // 设置转发的参数
  181. return {
  182. title:this.activityDetails.title,
  183. path: `/pages_order/huodong-detail?activityId=${this.activityId}`,
  184. imageUrl: this.imageArr[0],
  185. success: function(res) {
  186. console.log(res, '发生过是');
  187. if (res.errMsg == 'shareAppMessage:ok') {
  188. console.log("成功", res)
  189. }
  190. },
  191. fail: function(res) {
  192. console.log("失败", res)
  193. }
  194. }
  195. },
  196. onPageScroll(e) {
  197. if(e.scrollTop > 50) {
  198. this.bgColor = '#49070c'
  199. }else{
  200. this.bgColor = 'transparent'
  201. }
  202. },
  203. onLoad({activityId}) {
  204. this.activityId = activityId
  205. this.activityInfo(activityId)
  206. if(this.isLogin){
  207. this.$store.commit('getUserInfo')
  208. }
  209. },
  210. methods:{
  211. daohang() {
  212. uni.openLocation({
  213. latitude: Number(this.activityDetails.latitude),
  214. longitude: Number(this.activityDetails.longitude),
  215. success: function () {
  216. console.log('success');
  217. },
  218. fail:(error)=> {
  219. console.log('error',error);
  220. }
  221. });
  222. },
  223. activityInfo(activityId) {
  224. let data = {activityId}
  225. if(uni.getStorageSync('token')){
  226. data.token = uni.getStorageSync('token')
  227. }
  228. this.$api('activityInfo', data,res=> {
  229. if(res.code==200) {
  230. let adminUser = res.result.adminUser || {}
  231. this.activityDetails = res.result.activityInfo
  232. this.numValue = adminUser.num
  233. this.ewmImg = adminUser.img
  234. this.adminUserInfo = res.result.adminUserInfo
  235. this.isCollect = res.result.collect
  236. this.typeList = []
  237. if(res.result.activityInfo.birdPrice){
  238. this.typeList.push({
  239. price : res.result.activityInfo.birdPrice,
  240. name : '早鸟票',
  241. type : 0,
  242. })
  243. }
  244. if(res.result.activityInfo.personPrice){
  245. this.typeList.push({
  246. price : res.result.activityInfo.personPrice,
  247. name : '单人票',
  248. type : 1,
  249. })
  250. }
  251. if(res.result.activityInfo.expensivePrice){
  252. this.typeList.push({
  253. price : res.result.activityInfo.expensivePrice,
  254. name : '尊享票',
  255. type : 2,
  256. })
  257. }
  258. // this.typeList[0].price = res.result.activityInfo.birdPrice;
  259. // this.typeList[1].price = res.result.activityInfo.personPrice;
  260. // this.typeList[2].price = res.result.activityInfo.expensivePrice;
  261. }
  262. })
  263. },
  264. toBaoming() {
  265. this.$refs.popup.open();
  266. },
  267. chooseClick(item,i) {
  268. this.chooseIndex = i
  269. },
  270. collect(){
  271. this.$api('collect', {
  272. id : this.activityId,
  273. type : 0,
  274. }, res => {
  275. this.activityInfo(this.activityId)
  276. if(res.code == 200){
  277. uni.showToast({
  278. title: res.message,
  279. icon: 'none'
  280. })
  281. }
  282. })
  283. },
  284. confirmClick(typePrice) {
  285. console.log(this.userInfo);
  286. if(!this.userInfo.nickName ||
  287. !this.userInfo.headImage ||
  288. !this.userInfo.phone ||
  289. !this.userInfo.sex){
  290. uni.showToast({
  291. title: '请您先完善必要信息',
  292. icon: 'none'
  293. })
  294. setTimeout(uni.navigateTo, 800, {
  295. url: '/pages_login/wxUserInfo'
  296. })
  297. return
  298. }
  299. this.$api('createOrder',{
  300. id:this.activityId,
  301. typePrice: this.typeList[typePrice].type,
  302. type:0
  303. },res=>{
  304. if(res.code === 200) {
  305. uni.navigateTo({
  306. url: '/pages_order/payOrder?id=' + res.result.id
  307. })
  308. // uni.requestPaymentWxPay(res)
  309. // .then(res => {
  310. // uni.showToast({
  311. // title: '下单成功',
  312. // icon: 'none'
  313. // })
  314. // setTimeout(uni.switchTab, 800, {
  315. // url: '/pages/index/cart'
  316. // })
  317. // }).catch(n => {
  318. // // setTimeout(uni.switchTab, 800, {
  319. // // url: '/pages/index/cart'
  320. // // })
  321. // })
  322. }
  323. })
  324. }
  325. }
  326. }
  327. </script>
  328. <style lang="scss">
  329. page {
  330. background-color: #060504;
  331. }
  332. </style>
  333. <style lang="scss" scoped>
  334. .pop-cont {
  335. border-radius: 30rpx;
  336. padding: 10rpx;
  337. }
  338. .head-box {
  339. background: url('@/static/image/nav-bg.png') no-repeat;
  340. background-size: 100% 100%;
  341. width: 100%;
  342. height: 534rpx;
  343. position: absolute;
  344. z-index: -1;
  345. }
  346. .content {
  347. margin-top: 40rpx;
  348. padding: 0 30rpx 170rpx;
  349. padding-top: calc(var(--status-bar-height) + 130rpx);
  350. .content-head {
  351. position: relative;
  352. .image-box {
  353. width: 100%;
  354. height: 546rpx;
  355. border-radius: 12rpx;
  356. }
  357. .msg-box {
  358. background: #1B1713;
  359. border-radius: 27rpx 27rpx 67rpx 67rpx;
  360. position: absolute;
  361. top: 429rpx;
  362. left: 0;
  363. right: 0;
  364. padding-top: 38rpx;
  365. .msg-box-title {
  366. font-weight: 500;
  367. font-size: 32rpx;
  368. color: #FFFFFF;
  369. margin-bottom: 40rpx;
  370. padding-left: 38rpx;
  371. }
  372. .msg-box-time {
  373. font-weight: 400;
  374. font-size: 27rpx;
  375. color: #999999;
  376. padding-left: 38rpx;
  377. }
  378. .msg-box-address {
  379. font-weight: 400;
  380. font-size: 27rpx;
  381. color: #999999;
  382. padding-left: 38rpx;
  383. padding-right: 30rpx;
  384. margin-top: 24rpx;
  385. display: flex;
  386. justify-content: space-between;
  387. &-text {
  388. flex: 1;
  389. }
  390. .address-icon {
  391. font-weight: 400;
  392. font-size: 23rpx;
  393. color: #999999;
  394. display: flex;
  395. image {
  396. width: 25rpx;
  397. height: 27rpx;
  398. margin-right: 8rpx;
  399. }
  400. }
  401. }
  402. .lingdui-box {
  403. margin-top: 43rpx;
  404. height: 130rpx;
  405. background: #26201A;
  406. border-radius: 60rpx;
  407. display: flex;
  408. align-items: center;
  409. padding: 0 40rpx;
  410. .use-img {
  411. width: 86rpx;
  412. height: 86rpx;
  413. border-radius: 50%;
  414. }
  415. .lingdui-msg {
  416. flex: 1;
  417. margin-left: 24rpx;
  418. .lingdui-msg-name {
  419. font-weight: 500;
  420. font-size: 29rpx;
  421. color: #E6E6E6;
  422. display: flex;
  423. align-items: center;
  424. margin-bottom: 11rpx;
  425. .name-tip {
  426. padding: 0 20rpx;
  427. height: 27rpx;
  428. background: #3C2D17;
  429. border-radius: 0rpx 12rpx 12rpx 12rpx;
  430. font-weight: 500;
  431. font-size: 19rpx;
  432. color: #FFA200;
  433. line-height: 27rpx;
  434. margin-left: 14rpx;
  435. }
  436. }
  437. }
  438. .add-wx {
  439. width: 172rpx;
  440. height: 51rpx;
  441. background: #3C2D17;
  442. border-radius: 23rpx 23rpx 23rpx 23rpx;
  443. text-align: center;
  444. line-height: 51rpx;
  445. font-weight: 400;
  446. font-size: 25rpx;
  447. color: #FF8A00;
  448. }
  449. }
  450. }
  451. }
  452. .title-box {
  453. font-weight: 500;
  454. font-size: 33rpx;
  455. color: #E6E6E6;
  456. text-align: center;
  457. position: relative;
  458. &::after {
  459. content: "";
  460. position: absolute;
  461. top: 50%;
  462. left: 0;
  463. transform: translate(0,-50%);
  464. width: 100%;
  465. height: 12rpx;
  466. background: url(@/static/image/home/title-line.png) no-repeat;
  467. background-size: 100% 100%;
  468. }
  469. }
  470. .lv-miaoshu {
  471. margin-top: 440rpx;
  472. .value-box {
  473. background: #1B1713;
  474. border-radius: 27rpx;
  475. margin-top: 35rpx;
  476. margin-bottom: 52rpx;
  477. .tabs-box {
  478. border-bottom: 1px solid #2D241B;
  479. }
  480. .lv-msg-box {
  481. padding: 20rpx 40rpx;
  482. font-weight: 400;
  483. font-size: 27rpx;
  484. color: #fff;
  485. line-height: 41rpx;
  486. }
  487. }
  488. }
  489. }
  490. .bottom-box {
  491. position: fixed;
  492. bottom: 0;
  493. left: 0;
  494. right: 0;
  495. height: 150rpx;
  496. background-color: #1B1713;
  497. display: flex;
  498. align-items: center;
  499. padding: 0 40rpx;
  500. .price-box {
  501. font-weight: 400;
  502. font-size: 25rpx;
  503. color: #999999;
  504. flex: 1;
  505. .peice-val {
  506. font-weight: 500;
  507. font-size: 40rpx;
  508. color: #FF3535;
  509. margin-bottom: 15rpx;
  510. text {
  511. font-size: 26rpx;
  512. }
  513. }
  514. }
  515. .caozuo-box {
  516. display: flex;
  517. align-items: center;
  518. .caozuo-item {
  519. font-weight: 400;
  520. font-size: 20rpx;
  521. color: #999999;
  522. padding: 0 35rpx;
  523. text-align: center;
  524. height: 100rpx;
  525. display: flex;
  526. flex-direction: column;
  527. align-items: center;
  528. image {
  529. width: 48rpx;
  530. height: 48rpx;
  531. margin-bottom: 10rpx;
  532. }
  533. }
  534. .border-r {
  535. position: relative;
  536. // border-right: 1px solid #4A3E32;
  537. &::after {
  538. content: "";
  539. width: 2rpx;
  540. height: 47rpx;
  541. position: absolute;
  542. right: 0;
  543. top: 50%;
  544. transform: translate(0,-50%);
  545. background-color: #4A3E32;
  546. }
  547. }
  548. .isCollect{
  549. color: #f40;
  550. font-size: 28rpx;
  551. height: 100%;
  552. display: flex;
  553. align-items: center;
  554. }
  555. }
  556. .btn-box {
  557. width: 252rpx;
  558. height: 74rpx;
  559. font-weight: 500;
  560. font-size: 32rpx;
  561. color: #FFFFFF;
  562. text-align: center;
  563. line-height: 74rpx;
  564. background: url(@/static/image/home/hdqd-btn.png) no-repeat;
  565. background-size: 100% 100%;
  566. }
  567. .btn-box-2 {
  568. width: 252rpx;
  569. height: 74rpx;
  570. font-weight: 500;
  571. font-size: 32rpx;
  572. text-align: center;
  573. line-height: 74rpx;
  574. background-size: 100% 100%;
  575. background: #333;
  576. color: #999;
  577. border-radius: 45rpx;
  578. margin-bottom: 13rpx;
  579. }
  580. .end-btn {
  581. background: #666666;
  582. border-radius: 37rpx 37rpx 37rpx 37rpx;
  583. }
  584. }
  585. .popup-cont {
  586. width: 95%;
  587. margin: 0 auto;
  588. background-image: linear-gradient(to top, #000000, #331212);
  589. height:662rpx;
  590. border-radius: 33rpx 33rpx 0 0;
  591. .popup-title {
  592. display: flex;
  593. align-items: center;
  594. justify-content: space-between;
  595. padding: 54rpx 52rpx;
  596. font-weight: 500;
  597. font-size: 29rpx;
  598. color: #999999;
  599. }
  600. .popup-list {
  601. padding: 0 50rpx;
  602. .list-item {
  603. display: flex;
  604. justify-content: space-between;
  605. align-items: center;
  606. height: 110rpx;
  607. border-bottom: 1px solid #3F3535;
  608. .item-l {
  609. font-weight: 500;
  610. font-size: 29rpx;
  611. color: #CCCCCC;
  612. display: flex;
  613. align-items: center;
  614. .item-l-val {
  615. margin-left: 40rpx;
  616. }
  617. }
  618. .chooose-class {
  619. color: #FF5858;
  620. }
  621. }
  622. }
  623. .confirm-box {
  624. padding: 0 50rpx;
  625. margin-top: 30rpx;
  626. .confirm-btn-box {
  627. }
  628. }
  629. }
  630. </style>