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

635 lines
15 KiB

5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
3 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 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. },
  207. methods:{
  208. daohang() {
  209. uni.openLocation({
  210. latitude: Number(this.activityDetails.latitude),
  211. longitude: Number(this.activityDetails.longitude),
  212. success: function () {
  213. console.log('success');
  214. },
  215. fail:(error)=> {
  216. console.log('error',error);
  217. }
  218. });
  219. },
  220. activityInfo(activityId) {
  221. let data = {activityId}
  222. if(uni.getStorageSync('token')){
  223. data.token = uni.getStorageSync('token')
  224. }
  225. this.$api('activityInfo', data,res=> {
  226. if(res.code==200) {
  227. let adminUser = res.result.adminUser || {}
  228. this.activityDetails = res.result.activityInfo
  229. this.numValue = adminUser.num
  230. this.ewmImg = adminUser.img
  231. this.adminUserInfo = res.result.adminUserInfo
  232. this.isCollect = res.result.collect
  233. this.typeList = []
  234. if(res.result.activityInfo.birdPrice){
  235. this.typeList.push({
  236. price : res.result.activityInfo.birdPrice,
  237. name : '早鸟票',
  238. type : 0,
  239. })
  240. }
  241. if(res.result.activityInfo.personPrice){
  242. this.typeList.push({
  243. price : res.result.activityInfo.personPrice,
  244. name : '单人票',
  245. type : 1,
  246. })
  247. }
  248. if(res.result.activityInfo.expensivePrice){
  249. this.typeList.push({
  250. price : res.result.activityInfo.expensivePrice,
  251. name : '尊享票',
  252. type : 2,
  253. })
  254. }
  255. // this.typeList[0].price = res.result.activityInfo.birdPrice;
  256. // this.typeList[1].price = res.result.activityInfo.personPrice;
  257. // this.typeList[2].price = res.result.activityInfo.expensivePrice;
  258. }
  259. })
  260. },
  261. toBaoming() {
  262. this.$refs.popup.open();
  263. },
  264. chooseClick(item,i) {
  265. this.chooseIndex = i
  266. },
  267. collect(){
  268. this.$api('collect', {
  269. id : this.activityId,
  270. type : 0,
  271. }, res => {
  272. this.activityInfo(this.activityId)
  273. if(res.code == 200){
  274. uni.showToast({
  275. title: res.message,
  276. icon: 'none'
  277. })
  278. }
  279. })
  280. },
  281. confirmClick(typePrice) {
  282. this.$api('createOrder',{
  283. id:this.activityId,
  284. typePrice: this.typeList[typePrice].type,
  285. type:0
  286. },res=>{
  287. if(res.code === 200) {
  288. uni.navigateTo({
  289. url: '/pages_order/payOrder?id=' + res.result.id
  290. })
  291. // uni.requestPaymentWxPay(res)
  292. // .then(res => {
  293. // uni.showToast({
  294. // title: '下单成功',
  295. // icon: 'none'
  296. // })
  297. // setTimeout(uni.switchTab, 800, {
  298. // url: '/pages/index/cart'
  299. // })
  300. // }).catch(n => {
  301. // // setTimeout(uni.switchTab, 800, {
  302. // // url: '/pages/index/cart'
  303. // // })
  304. // })
  305. }
  306. })
  307. }
  308. }
  309. }
  310. </script>
  311. <style lang="scss">
  312. page {
  313. background-color: #060504;
  314. }
  315. </style>
  316. <style lang="scss" scoped>
  317. .pop-cont {
  318. border-radius: 30rpx;
  319. padding: 10rpx;
  320. }
  321. .head-box {
  322. background: url('@/static/image/nav-bg.png') no-repeat;
  323. background-size: 100% 100%;
  324. width: 100%;
  325. height: 534rpx;
  326. position: absolute;
  327. z-index: -1;
  328. }
  329. .content {
  330. margin-top: 40rpx;
  331. padding: 0 30rpx 170rpx;
  332. padding-top: calc(var(--status-bar-height) + 130rpx);
  333. .content-head {
  334. position: relative;
  335. .image-box {
  336. width: 100%;
  337. height: 546rpx;
  338. border-radius: 12rpx;
  339. }
  340. .msg-box {
  341. background: #1B1713;
  342. border-radius: 27rpx 27rpx 67rpx 67rpx;
  343. position: absolute;
  344. top: 429rpx;
  345. left: 0;
  346. right: 0;
  347. padding-top: 38rpx;
  348. .msg-box-title {
  349. font-weight: 500;
  350. font-size: 32rpx;
  351. color: #FFFFFF;
  352. margin-bottom: 40rpx;
  353. padding-left: 38rpx;
  354. }
  355. .msg-box-time {
  356. font-weight: 400;
  357. font-size: 27rpx;
  358. color: #999999;
  359. padding-left: 38rpx;
  360. }
  361. .msg-box-address {
  362. font-weight: 400;
  363. font-size: 27rpx;
  364. color: #999999;
  365. padding-left: 38rpx;
  366. padding-right: 30rpx;
  367. margin-top: 24rpx;
  368. display: flex;
  369. justify-content: space-between;
  370. &-text {
  371. flex: 1;
  372. }
  373. .address-icon {
  374. font-weight: 400;
  375. font-size: 23rpx;
  376. color: #999999;
  377. display: flex;
  378. image {
  379. width: 25rpx;
  380. height: 27rpx;
  381. margin-right: 8rpx;
  382. }
  383. }
  384. }
  385. .lingdui-box {
  386. margin-top: 43rpx;
  387. height: 130rpx;
  388. background: #26201A;
  389. border-radius: 60rpx;
  390. display: flex;
  391. align-items: center;
  392. padding: 0 40rpx;
  393. .use-img {
  394. width: 86rpx;
  395. height: 86rpx;
  396. border-radius: 50%;
  397. }
  398. .lingdui-msg {
  399. flex: 1;
  400. margin-left: 24rpx;
  401. .lingdui-msg-name {
  402. font-weight: 500;
  403. font-size: 29rpx;
  404. color: #E6E6E6;
  405. display: flex;
  406. align-items: center;
  407. margin-bottom: 11rpx;
  408. .name-tip {
  409. padding: 0 20rpx;
  410. height: 27rpx;
  411. background: #3C2D17;
  412. border-radius: 0rpx 12rpx 12rpx 12rpx;
  413. font-weight: 500;
  414. font-size: 19rpx;
  415. color: #FFA200;
  416. line-height: 27rpx;
  417. margin-left: 14rpx;
  418. }
  419. }
  420. }
  421. .add-wx {
  422. width: 172rpx;
  423. height: 51rpx;
  424. background: #3C2D17;
  425. border-radius: 23rpx 23rpx 23rpx 23rpx;
  426. text-align: center;
  427. line-height: 51rpx;
  428. font-weight: 400;
  429. font-size: 25rpx;
  430. color: #FF8A00;
  431. }
  432. }
  433. }
  434. }
  435. .title-box {
  436. font-weight: 500;
  437. font-size: 33rpx;
  438. color: #E6E6E6;
  439. text-align: center;
  440. position: relative;
  441. &::after {
  442. content: "";
  443. position: absolute;
  444. top: 50%;
  445. left: 0;
  446. transform: translate(0,-50%);
  447. width: 100%;
  448. height: 12rpx;
  449. background: url(@/static/image/home/title-line.png) no-repeat;
  450. background-size: 100% 100%;
  451. }
  452. }
  453. .lv-miaoshu {
  454. margin-top: 370rpx;
  455. .value-box {
  456. background: #1B1713;
  457. border-radius: 27rpx;
  458. margin-top: 35rpx;
  459. margin-bottom: 52rpx;
  460. .tabs-box {
  461. border-bottom: 1px solid #2D241B;
  462. }
  463. .lv-msg-box {
  464. padding: 20rpx 40rpx;
  465. font-weight: 400;
  466. font-size: 27rpx;
  467. color: #fff;
  468. line-height: 41rpx;
  469. }
  470. }
  471. }
  472. }
  473. .bottom-box {
  474. position: fixed;
  475. bottom: 0;
  476. left: 0;
  477. right: 0;
  478. height: 150rpx;
  479. background-color: #1B1713;
  480. display: flex;
  481. align-items: center;
  482. padding: 0 40rpx;
  483. .price-box {
  484. font-weight: 400;
  485. font-size: 25rpx;
  486. color: #999999;
  487. flex: 1;
  488. .peice-val {
  489. font-weight: 500;
  490. font-size: 40rpx;
  491. color: #FF3535;
  492. margin-bottom: 15rpx;
  493. text {
  494. font-size: 26rpx;
  495. }
  496. }
  497. }
  498. .caozuo-box {
  499. display: flex;
  500. align-items: center;
  501. .caozuo-item {
  502. font-weight: 400;
  503. font-size: 20rpx;
  504. color: #999999;
  505. padding: 0 35rpx;
  506. text-align: center;
  507. height: 100rpx;
  508. display: flex;
  509. flex-direction: column;
  510. align-items: center;
  511. image {
  512. width: 48rpx;
  513. height: 48rpx;
  514. margin-bottom: 10rpx;
  515. }
  516. }
  517. .border-r {
  518. position: relative;
  519. // border-right: 1px solid #4A3E32;
  520. &::after {
  521. content: "";
  522. width: 2rpx;
  523. height: 47rpx;
  524. position: absolute;
  525. right: 0;
  526. top: 50%;
  527. transform: translate(0,-50%);
  528. background-color: #4A3E32;
  529. }
  530. }
  531. .isCollect{
  532. color: #f40;
  533. font-size: 28rpx;
  534. height: 100%;
  535. display: flex;
  536. align-items: center;
  537. }
  538. }
  539. .btn-box {
  540. width: 252rpx;
  541. height: 74rpx;
  542. font-weight: 500;
  543. font-size: 32rpx;
  544. color: #FFFFFF;
  545. text-align: center;
  546. line-height: 74rpx;
  547. background: url(@/static/image/home/hdqd-btn.png) no-repeat;
  548. background-size: 100% 100%;
  549. }
  550. .btn-box-2 {
  551. width: 252rpx;
  552. height: 74rpx;
  553. font-weight: 500;
  554. font-size: 32rpx;
  555. text-align: center;
  556. line-height: 74rpx;
  557. background-size: 100% 100%;
  558. background: #333;
  559. color: #999;
  560. border-radius: 45rpx;
  561. margin-bottom: 13rpx;
  562. }
  563. .end-btn {
  564. background: #666666;
  565. border-radius: 37rpx 37rpx 37rpx 37rpx;
  566. }
  567. }
  568. .popup-cont {
  569. width: 95%;
  570. margin: 0 auto;
  571. background-image: linear-gradient(to top, #000000, #331212);
  572. height:662rpx;
  573. border-radius: 33rpx 33rpx 0 0;
  574. .popup-title {
  575. display: flex;
  576. align-items: center;
  577. justify-content: space-between;
  578. padding: 54rpx 52rpx;
  579. font-weight: 500;
  580. font-size: 29rpx;
  581. color: #999999;
  582. }
  583. .popup-list {
  584. padding: 0 50rpx;
  585. .list-item {
  586. display: flex;
  587. justify-content: space-between;
  588. align-items: center;
  589. height: 110rpx;
  590. border-bottom: 1px solid #3F3535;
  591. .item-l {
  592. font-weight: 500;
  593. font-size: 29rpx;
  594. color: #CCCCCC;
  595. display: flex;
  596. align-items: center;
  597. .item-l-val {
  598. margin-left: 40rpx;
  599. }
  600. }
  601. .chooose-class {
  602. color: #FF5858;
  603. }
  604. }
  605. }
  606. .confirm-box {
  607. padding: 0 50rpx;
  608. margin-top: 30rpx;
  609. .confirm-btn-box {
  610. }
  611. }
  612. }
  613. </style>