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

628 lines
15 KiB

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