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

465 lines
10 KiB

5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 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
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
4 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
4 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 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. <uv-swiper :list="travelDetails.travel.image
  8. && travelDetails.travel.image.split(',')"
  9. keyName="image"
  10. height="406rpx" radius="30rpx"
  11. bgColor="transparent" indicator
  12. indicatorMode="dot"></uv-swiper>
  13. <!-- <image class="image-box" :src="travelDetails.travel.image" mode="aspectFill"></image> -->
  14. <view class="msg-box">
  15. <view class="msg-box-title">{{travelDetails.travel.title}}</view>
  16. <view class="msg-box-time">开始时间{{travelDetails.travel.startTime}}</view>
  17. <view class="lingdui-box">
  18. <image class="use-img" :src="travelDetails.adminUserInfo.headImage" mode=""></image>
  19. <view class="lingdui-msg">
  20. <view class="lingdui-msg-name">
  21. <view>{{travelDetails.adminUserInfo.nickName}}</view>
  22. <view class="name-tip">领队</view>
  23. </view>
  24. <view>
  25. <uv-rate :count="count"
  26. disabled
  27. v-model="travelDetails.adminUser.num" size="23" activeColor="#FFA200"></uv-rate>
  28. </view>
  29. </view>
  30. <view class="add-wx" @click="$refs.ewmpopup.open()">添加微信</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="lv-miaoshu">
  35. <view class="title-box">旅行描述</view>
  36. <view class="value-box">
  37. <view class="tabs-box">
  38. <uv-tabs :list="list" @click="tabsClick" lineColor="#FE5E5E" :activeStyle="{color:'#FE5E5E',fontSize:'29rpx',fontWeight: 'bold'}" :inactiveStyle="{color:'#D6D6D6',fontSize:'29rpx',fontWeight: 'bold'}"></uv-tabs>
  39. </view>
  40. <view class="lv-msg-box">
  41. <uv-parse :content="content"></uv-parse>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="bottom-box">
  47. <view class="price-box">
  48. <view class="peice-val"><text></text>{{travelDetails.travel.price}}</view>
  49. <view>报名费用</view>
  50. </view>
  51. <view class="caozuo-box">
  52. <view class="caozuo-item border-r"
  53. @click="collect"
  54. v-if="!isCollect">
  55. <image src="./static/shoucang-icon.png"
  56. mode=""></image>
  57. <text>收藏</text>
  58. </view>
  59. <view class="caozuo-item border-r isCollect"
  60. @click="collect"
  61. style=""
  62. v-else>
  63. <text>已收藏</text>
  64. </view>
  65. <button type="primary" style="background-color: transparent;height: 100rpx;font-size: 20rpx;padding: 0;" open-type="share" >
  66. <view class="caozuo-item">
  67. <image src="./static/zhuanfa-icon.png" mode=""></image>
  68. <text style="line-height: initial;">转发</text>
  69. </view>
  70. </button>
  71. </view>
  72. <view class="btn-box"
  73. v-if="travelDetails.travel.state == 0"
  74. @click="toBaoming">立即报名</view>
  75. <view class="btn-box-2"
  76. v-if="travelDetails.travel.state == 1"
  77. >已结束</view>
  78. </view>
  79. <uv-popup ref="ewmpopup" mode="center" round="30rpx">
  80. <view class="pop-cont">
  81. <uv-image :src="travelDetails.adminUser.img" width="380rpx" height="380rpx"></uv-image>
  82. </view>
  83. </uv-popup>
  84. </view>
  85. </template>
  86. <script>
  87. export default{
  88. data() {
  89. return {
  90. travelDetails: {},
  91. bgColor:'transparent',
  92. count:5,
  93. value:3,
  94. content:'',
  95. current:0,
  96. list:[
  97. {
  98. name:'介绍',
  99. key:'js'
  100. },
  101. {
  102. name:'路线',
  103. key:'lx'
  104. },
  105. {
  106. name:'费用',
  107. key:'fy'
  108. },
  109. {
  110. name:'须知',
  111. key:'xz'
  112. },
  113. {
  114. name:'代理',
  115. key:'dl'
  116. },
  117. ],
  118. travelId:'',
  119. isCollect : false,
  120. }
  121. },
  122. onShareAppMessage(res) {
  123. console.log(res)
  124. if (res.from === 'button') {
  125. // 来自详情页页面内分享按
  126. return {
  127. title:this.travelDetails.travel.title,
  128. path: `/pages_order/lvyou-detail?travelId=${this.travelId}`,
  129. imageUrl: this.travelDetails.travel.image,
  130. success: function(res) {
  131. // 转发成功
  132. console.log('转发成功')
  133. },
  134. fail: function(res) {
  135. // 转发失败
  136. }
  137. };
  138. }
  139. // 设置转发的参数
  140. return {
  141. title:this.travelDetails.title,
  142. path: `/pages_order/lvyou-detail?travelId=${this.travelId}`,
  143. imageUrl: this.travelDetails.travel.image,
  144. success: function(res) {
  145. console.log(res, '发生过是');
  146. if (res.errMsg == 'shareAppMessage:ok') {
  147. console.log("成功", res)
  148. }
  149. },
  150. fail: function(res) {
  151. console.log("失败", res)
  152. }
  153. }
  154. },
  155. onPageScroll(e) {
  156. if(e.scrollTop > 50) {
  157. this.bgColor = '#49070c'
  158. }else{
  159. this.bgColor = 'transparent'
  160. }
  161. },
  162. onLoad({travelId}) {
  163. this.travelId = travelId
  164. this.travelInfo(travelId)
  165. },
  166. methods:{
  167. toBaoming() {
  168. this.$api('createOrder',{
  169. id : this.travelId,
  170. typePrice : 1,
  171. type : 1
  172. }, res=>{
  173. if(res.code === 200) {
  174. uni.navigateTo({
  175. url: '/pages_order/payOrder?id=' + res.result.id
  176. })
  177. // uni.requestPaymentWxPay(res)
  178. // .then(res => {
  179. // uni.showToast({
  180. // title: '下单成功',
  181. // icon: 'none'
  182. // })
  183. // setTimeout(uni.switchTab, 800, {
  184. // url: '/pages/index/cart'
  185. // })
  186. // }).catch(n => {
  187. // })
  188. }
  189. })
  190. },
  191. collect(){
  192. this.$api('collect', {
  193. id : this.travelId,
  194. type : 1,
  195. }, res => {
  196. this.travelInfo(this.travelId)
  197. if(res.code == 200){
  198. uni.showToast({
  199. title: res.message,
  200. icon: 'none'
  201. })
  202. }
  203. })
  204. },
  205. tabsClick(val) {
  206. this.current = val.index
  207. this.content = this.travelDetails.travel[this.list[this.current].key]
  208. },
  209. travelInfo(travelId) {
  210. let data = {travelId}
  211. if(uni.getStorageSync('token')){
  212. data.token = uni.getStorageSync('token')
  213. }
  214. this.$api('travelInfo', data, res=> {
  215. if(res.code==200) {
  216. this.travelDetails = res.result
  217. this.isCollect = res.result.collect
  218. this.content = res.result.travel[this.list[this.current].key]
  219. }
  220. })
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss">
  226. page {
  227. background-color: #060504;
  228. }
  229. </style>
  230. <style lang="scss" scoped>
  231. .pop-cont {
  232. border-radius: 30rpx;
  233. padding: 10rpx;
  234. }
  235. .head-box {
  236. background: url('@/static/image/nav-bg.png') no-repeat;
  237. background-size: 100% 100%;
  238. width: 100%;
  239. height: 534rpx;
  240. top: 0;
  241. position: absolute;
  242. z-index: -1;
  243. }
  244. .content {
  245. margin-top: 40rpx;
  246. padding: 0 30rpx 170rpx;
  247. padding-top: calc(var(--status-bar-height) + 110rpx);
  248. .content-head {
  249. position: relative;
  250. .image-box {
  251. width: 100%;
  252. border-radius: 20rpx 20rpx 0 0;
  253. height: 546rpx;
  254. }
  255. .msg-box {
  256. background: #1B1713;
  257. border-radius: 27rpx 27rpx 67rpx 67rpx;
  258. position: absolute;
  259. top: 429rpx;
  260. left: 0;
  261. right: 0;
  262. padding-top: 38rpx;
  263. .msg-box-title {
  264. font-weight: 500;
  265. font-size: 32rpx;
  266. color: #FFFFFF;
  267. margin-bottom: 40rpx;
  268. padding-left: 38rpx;
  269. }
  270. .msg-box-time {
  271. font-weight: 400;
  272. font-size: 27rpx;
  273. color: #999999;
  274. padding-left: 38rpx;
  275. }
  276. .lingdui-box {
  277. margin-top: 43rpx;
  278. height: 130rpx;
  279. background: #26201A;
  280. border-radius: 60rpx;
  281. display: flex;
  282. align-items: center;
  283. padding: 0 40rpx;
  284. .use-img {
  285. width: 86rpx;
  286. height: 86rpx;
  287. border-radius: 50%;
  288. }
  289. .lingdui-msg {
  290. flex: 1;
  291. margin-left: 24rpx;
  292. .lingdui-msg-name {
  293. font-weight: 500;
  294. font-size: 29rpx;
  295. color: #E6E6E6;
  296. display: flex;
  297. align-items: center;
  298. margin-bottom: 11rpx;
  299. .name-tip {
  300. padding: 0 20rpx;
  301. height: 27rpx;
  302. background: #3C2D17;
  303. border-radius: 0rpx 12rpx 12rpx 12rpx;
  304. font-weight: 500;
  305. font-size: 19rpx;
  306. color: #FFA200;
  307. line-height: 27rpx;
  308. margin-left: 14rpx;
  309. }
  310. }
  311. }
  312. .add-wx {
  313. width: 172rpx;
  314. height: 51rpx;
  315. background: #3C2D17;
  316. border-radius: 23rpx 23rpx 23rpx 23rpx;
  317. text-align: center;
  318. line-height: 51rpx;
  319. font-weight: 400;
  320. font-size: 25rpx;
  321. color: #FF8A00;
  322. }
  323. }
  324. }
  325. }
  326. .title-box {
  327. font-weight: 500;
  328. font-size: 33rpx;
  329. color: #E6E6E6;
  330. text-align: center;
  331. position: relative;
  332. &::after {
  333. content: "";
  334. position: absolute;
  335. top: 50%;
  336. left: 0;
  337. transform: translate(0,-50%);
  338. width: 100%;
  339. height: 12rpx;
  340. background: url(@/static/image/home/title-line.png) no-repeat;
  341. background-size: 100% 100%;
  342. }
  343. }
  344. .lv-miaoshu {
  345. margin-top: 400rpx;
  346. .value-box {
  347. background: #1B1713;
  348. border-radius: 27rpx;
  349. margin-top: 35rpx;
  350. .tabs-box {
  351. border-bottom: 1px solid #2D241B;
  352. }
  353. .lv-msg-box {
  354. padding: 20rpx 40rpx;
  355. font-weight: 400;
  356. font-size: 27rpx;
  357. color: #E6E6E6;
  358. line-height: 41rpx;
  359. }
  360. }
  361. }
  362. }
  363. .bottom-box {
  364. position: fixed;
  365. bottom: 0;
  366. left: 0;
  367. right: 0;
  368. height: 150rpx;
  369. background-color: #1B1713;
  370. display: flex;
  371. align-items: center;
  372. padding: 0 40rpx;
  373. .price-box {
  374. font-weight: 400;
  375. font-size: 25rpx;
  376. color: #999999;
  377. flex: 1;
  378. .peice-val {
  379. font-weight: 500;
  380. font-size: 40rpx;
  381. color: #FF3535;
  382. margin-bottom: 15rpx;
  383. text {
  384. font-size: 26rpx;
  385. }
  386. }
  387. }
  388. .caozuo-box {
  389. display: flex;
  390. align-items: center;
  391. .caozuo-item {
  392. font-weight: 400;
  393. font-size: 20rpx;
  394. color: #999999;
  395. padding: 0 35rpx;
  396. text-align: center;
  397. height: 100rpx;
  398. display: flex;
  399. flex-direction: column;
  400. align-items: center;
  401. image {
  402. width: 48rpx;
  403. height: 48rpx;
  404. margin-bottom: 10rpx;
  405. }
  406. }
  407. .border-r {
  408. position: relative;
  409. // border-right: 1px solid #4A3E32;
  410. &::after {
  411. content: "";
  412. width: 2rpx;
  413. height: 47rpx;
  414. position: absolute;
  415. right: 0;
  416. top: 50%;
  417. transform: translate(0,-50%);
  418. background-color: #4A3E32;
  419. }
  420. }
  421. .isCollect{
  422. color: #f40;
  423. font-size: 28rpx;
  424. height: 100%;
  425. display: flex;
  426. align-items: center;
  427. }
  428. }
  429. .btn-box {
  430. width: 252rpx;
  431. height: 74rpx;
  432. font-weight: 500;
  433. font-size: 32rpx;
  434. color: #FFFFFF;
  435. text-align: center;
  436. line-height: 74rpx;
  437. background: url(@/static/image/home/hdqd-btn.png) no-repeat;
  438. background-size: 100% 100%;
  439. }
  440. .btn-box-2 {
  441. width: 252rpx;
  442. height: 74rpx;
  443. font-weight: 500;
  444. font-size: 32rpx;
  445. text-align: center;
  446. line-height: 74rpx;
  447. background-size: 100% 100%;
  448. background: #333;
  449. color: #999;
  450. border-radius: 45rpx;
  451. margin-bottom: 13rpx;
  452. }
  453. }
  454. </style>