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

524 lines
12 KiB

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