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

600 lines
14 KiB

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