推广小程序前端代码
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.

656 lines
15 KiB

4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
2 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
2 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months 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. top: 0;
  346. }
  347. .content {
  348. margin-top: 40rpx;
  349. padding: 0 30rpx 170rpx;
  350. padding-top: calc(var(--status-bar-height) + 130rpx);
  351. .content-head {
  352. position: relative;
  353. .image-box {
  354. width: 100%;
  355. height: 546rpx;
  356. border-radius: 12rpx;
  357. }
  358. .msg-box {
  359. background: #1B1713;
  360. border-radius: 27rpx 27rpx 67rpx 67rpx;
  361. position: absolute;
  362. top: 429rpx;
  363. left: 0;
  364. right: 0;
  365. padding-top: 38rpx;
  366. .msg-box-title {
  367. font-weight: 500;
  368. font-size: 32rpx;
  369. color: #FFFFFF;
  370. margin-bottom: 40rpx;
  371. padding-left: 38rpx;
  372. }
  373. .msg-box-time {
  374. font-weight: 400;
  375. font-size: 27rpx;
  376. color: #999999;
  377. padding-left: 38rpx;
  378. }
  379. .msg-box-address {
  380. font-weight: 400;
  381. font-size: 27rpx;
  382. color: #999999;
  383. padding-left: 38rpx;
  384. padding-right: 30rpx;
  385. margin-top: 24rpx;
  386. display: flex;
  387. justify-content: space-between;
  388. &-text {
  389. flex: 1;
  390. }
  391. .address-icon {
  392. font-weight: 400;
  393. font-size: 23rpx;
  394. color: #999999;
  395. display: flex;
  396. image {
  397. width: 25rpx;
  398. height: 27rpx;
  399. margin-right: 8rpx;
  400. }
  401. }
  402. }
  403. .lingdui-box {
  404. margin-top: 43rpx;
  405. height: 130rpx;
  406. background: #26201A;
  407. border-radius: 60rpx;
  408. display: flex;
  409. align-items: center;
  410. padding: 0 40rpx;
  411. .use-img {
  412. width: 86rpx;
  413. height: 86rpx;
  414. border-radius: 50%;
  415. }
  416. .lingdui-msg {
  417. flex: 1;
  418. margin-left: 24rpx;
  419. .lingdui-msg-name {
  420. font-weight: 500;
  421. font-size: 29rpx;
  422. color: #E6E6E6;
  423. display: flex;
  424. align-items: center;
  425. margin-bottom: 11rpx;
  426. .name-tip {
  427. padding: 0 20rpx;
  428. height: 27rpx;
  429. background: #3C2D17;
  430. border-radius: 0rpx 12rpx 12rpx 12rpx;
  431. font-weight: 500;
  432. font-size: 19rpx;
  433. color: #FFA200;
  434. line-height: 27rpx;
  435. margin-left: 14rpx;
  436. }
  437. }
  438. }
  439. .add-wx {
  440. width: 172rpx;
  441. height: 51rpx;
  442. background: #3C2D17;
  443. border-radius: 23rpx 23rpx 23rpx 23rpx;
  444. text-align: center;
  445. line-height: 51rpx;
  446. font-weight: 400;
  447. font-size: 25rpx;
  448. color: #FF8A00;
  449. }
  450. }
  451. }
  452. }
  453. .title-box {
  454. font-weight: 500;
  455. font-size: 33rpx;
  456. color: #E6E6E6;
  457. text-align: center;
  458. position: relative;
  459. &::after {
  460. content: "";
  461. position: absolute;
  462. top: 50%;
  463. left: 0;
  464. transform: translate(0,-50%);
  465. width: 100%;
  466. height: 12rpx;
  467. background: url(@/static/image/home/title-line.png) no-repeat;
  468. background-size: 100% 100%;
  469. }
  470. }
  471. .lv-miaoshu {
  472. margin-top: 440rpx;
  473. .value-box {
  474. background: #1B1713;
  475. border-radius: 27rpx;
  476. margin-top: 35rpx;
  477. margin-bottom: 52rpx;
  478. .tabs-box {
  479. border-bottom: 1px solid #2D241B;
  480. }
  481. .lv-msg-box {
  482. padding: 20rpx 40rpx;
  483. font-weight: 400;
  484. font-size: 27rpx;
  485. color: #fff;
  486. line-height: 41rpx;
  487. }
  488. }
  489. }
  490. }
  491. .bottom-box {
  492. position: fixed;
  493. bottom: 0;
  494. left: 0;
  495. right: 0;
  496. height: 150rpx;
  497. background-color: #1B1713;
  498. display: flex;
  499. align-items: center;
  500. padding: 0 40rpx;
  501. .price-box {
  502. font-weight: 400;
  503. font-size: 25rpx;
  504. color: #999999;
  505. flex: 1;
  506. .peice-val {
  507. font-weight: 500;
  508. font-size: 40rpx;
  509. color: #FF3535;
  510. margin-bottom: 15rpx;
  511. text {
  512. font-size: 26rpx;
  513. }
  514. }
  515. }
  516. .caozuo-box {
  517. display: flex;
  518. align-items: center;
  519. .caozuo-item {
  520. font-weight: 400;
  521. font-size: 20rpx;
  522. color: #999999;
  523. padding: 0 35rpx;
  524. text-align: center;
  525. height: 100rpx;
  526. display: flex;
  527. flex-direction: column;
  528. align-items: center;
  529. image {
  530. width: 48rpx;
  531. height: 48rpx;
  532. margin-bottom: 10rpx;
  533. }
  534. }
  535. .border-r {
  536. position: relative;
  537. // border-right: 1px solid #4A3E32;
  538. &::after {
  539. content: "";
  540. width: 2rpx;
  541. height: 47rpx;
  542. position: absolute;
  543. right: 0;
  544. top: 50%;
  545. transform: translate(0,-50%);
  546. background-color: #4A3E32;
  547. }
  548. }
  549. .isCollect{
  550. color: #f40;
  551. font-size: 28rpx;
  552. height: 100%;
  553. display: flex;
  554. align-items: center;
  555. }
  556. }
  557. .btn-box {
  558. width: 252rpx;
  559. height: 74rpx;
  560. font-weight: 500;
  561. font-size: 32rpx;
  562. color: #FFFFFF;
  563. text-align: center;
  564. line-height: 74rpx;
  565. background: url(@/static/image/home/hdqd-btn.png) no-repeat;
  566. background-size: 100% 100%;
  567. }
  568. .btn-box-2 {
  569. width: 252rpx;
  570. height: 74rpx;
  571. font-weight: 500;
  572. font-size: 32rpx;
  573. text-align: center;
  574. line-height: 74rpx;
  575. background-size: 100% 100%;
  576. background: #333;
  577. color: #999;
  578. border-radius: 45rpx;
  579. margin-bottom: 13rpx;
  580. }
  581. .end-btn {
  582. background: #666666;
  583. border-radius: 37rpx 37rpx 37rpx 37rpx;
  584. }
  585. }
  586. .popup-cont {
  587. width: 95%;
  588. margin: 0 auto;
  589. background-image: linear-gradient(to top, #000000, #331212);
  590. height:662rpx;
  591. border-radius: 33rpx 33rpx 0 0;
  592. .popup-title {
  593. display: flex;
  594. align-items: center;
  595. justify-content: space-between;
  596. padding: 54rpx 52rpx;
  597. font-weight: 500;
  598. font-size: 29rpx;
  599. color: #999999;
  600. }
  601. .popup-list {
  602. padding: 0 50rpx;
  603. .list-item {
  604. display: flex;
  605. justify-content: space-between;
  606. align-items: center;
  607. height: 110rpx;
  608. border-bottom: 1px solid #3F3535;
  609. .item-l {
  610. font-weight: 500;
  611. font-size: 29rpx;
  612. color: #CCCCCC;
  613. display: flex;
  614. align-items: center;
  615. .item-l-val {
  616. margin-left: 40rpx;
  617. }
  618. }
  619. .chooose-class {
  620. color: #FF5858;
  621. }
  622. }
  623. }
  624. .confirm-box {
  625. padding: 0 50rpx;
  626. margin-top: 30rpx;
  627. .confirm-btn-box {
  628. }
  629. }
  630. }
  631. </style>