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

453 lines
10 KiB

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