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

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