travelDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <view class="detailsPage">
  3. <u-swiper height=900 :list="list2" keyName="image" showTitle :autoplay="false" circular autoplay></u-swiper>
  4. <view class="details">
  5. <view class="title flex-item">
  6. <view class="">
  7. {{goodsInfo.name?goodsInfo.name:''}}
  8. <!-- 深林康养 -->
  9. </view>
  10. <view >
  11. ¥{{goodsInfo.min_price?goodsInfo.min_price:''}}
  12. <!-- ¥300 -->
  13. </view>
  14. </view>
  15. <view class="describe">
  16. {{goodsInfo.subtitle?goodsInfo.subtitle:''}}
  17. <!-- 夏日的森林,雨水充沛了山林,鲜花盛放,溪水潺潺。漫步于自然之中,感受清新的空气,放空心灵,沉醉于山雾之中,感受不同于城市的静谧与轻松 -->
  18. </view>
  19. <view class="flex" >
  20. <view class="tags" v-for="item in tags">
  21. {{item}}
  22. </view>
  23. <!-- <view class="tags">
  24. 康养
  25. </view> -->
  26. </view>
  27. </view>
  28. <view class="detailsContent">
  29. <u-sticky bgColor="#fff">
  30. <view class="" style="box-shadow: 0px 2rpx 8rpx 0px rgba(0, 0, 0, 0.06);">
  31. <u-tabs :list="list1" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=30 :scrollable="false" @click="check"></u-tabs>
  32. </view>
  33. </u-sticky>
  34. <view class="detailsList" >
  35. <!-- {{goodsInfo.description}} -->
  36. <view class="duction list-item">
  37. <u-icon name="tags" size="50" color="#1E9F6A"></u-icon>
  38. <view style="margin-left: 20rpx;">套餐特色</view>
  39. </view>
  40. <u-parse :content="goodsInfo.description?goodsInfo.description:''"></u-parse>
  41. <view class="trips list-item">
  42. <u-icon name="calendar" size="50" color="#1E9F6A"></u-icon>
  43. <view style="margin-left: 20rpx;">行程简介</view>
  44. </view>
  45. <view style="margin: 20rpx 0;" v-for="item,index in goodsInfo.trips" :key="index">
  46. <view style="color:#1E9F6A;margin: 20rpx 0;">
  47. Day{{item.day?item.day:''}}
  48. </view>
  49. <u-parse :content="item.content"></u-parse>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="navbar footer">
  54. <view class="kefu flex">
  55. <view class="" @click="gomes">
  56. <image src="../../static/travelD/service.png" mode="heightFix" ></image>
  57. <view class="">
  58. 客服
  59. </view>
  60. </view>
  61. <view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
  62. </view>
  63. <view class="kefu haibao flex" @click="share=true">
  64. <view class="" @click="goposter">
  65. <image src="../../static/travelD/share.png" mode="heightFix" class="icon"></image>
  66. <view class="" >
  67. 生成海报
  68. </view>
  69. </view>
  70. <view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
  71. </view>
  72. <view class="kefu wxin flex" >
  73. <view class="">
  74. <image src="../../static/travelD/share2.png" mode="heightFix" class="icon"></image>
  75. <view class="">
  76. 分享
  77. </view>
  78. </view>
  79. <view style="height: 50rpx;width: 1px;background-color:rgba(255, 255, 255, 0.5);margin:0 40rpx;"></view>
  80. </view>
  81. <view class="want" @click="open">
  82. 我要报名
  83. </view>
  84. </view>
  85. <u-popup :show="show" mode="bottom" @close="close" @open="open" closeIconPos :customStyle="{padding:'30rpx',borderRadius:'0px 56rpx 0px 0px'}" :zIndex="zindex">
  86. <view class="flex popupTop" >
  87. <view class="image">
  88. <image :src="goodsInfo.cover_picture" ></image>
  89. </view>
  90. <view class="">
  91. <view class="" style="font-size: 36rpx;font-weight: 600;color: #333333;margin-bottom: 18rpx;">
  92. 夕阳红康养团
  93. </view>
  94. <view class="" style="font-size: 28rpx;color: #333333;">
  95. 请选择出发日期:{{choosedays}}
  96. </view>
  97. </view>
  98. </view>
  99. <view class="day" >
  100. <view class="" style="font-size: 30rpx;font-weight: bold;color: #333333;">
  101. 出发日期
  102. </view>
  103. <view class="" style="border-bottom: 1rpx solid #E3E3E3;">
  104. <u-tabs :list="month" @change="chooseDay" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}" :inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" :scrollable="true"></u-tabs>
  105. </view>
  106. <view class="item" >
  107. <view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days" @click="dayItem(index,item)">
  108. <view class="">
  109. {{item.start_at.slice(5,10)?item.start_at.slice(5,10):''}}
  110. </view>
  111. <view class="">
  112. {{item.week?item.week:''}}
  113. </view>
  114. <view class="" style="font-size: 26rpx;font-weight: 600;">
  115. ¥{{item.min_price?item.min_price:''}}
  116. </view>
  117. </view>
  118. <!-- <view class="day-item">
  119. <view class="">
  120. 04-21
  121. </view>
  122. <view class="">
  123. 周三
  124. </view>
  125. <view class="" style="font-size: 26rpx;font-weight: 600;">
  126. ¥12332
  127. </view>
  128. </view> -->
  129. </view>
  130. </view>
  131. <view class="navbars">
  132. <view class="price">
  133. ¥12929
  134. </view>
  135. <view class="choose" @click="isshow = true;zindex=10070">
  136. 选择房型
  137. </view>
  138. </view>
  139. </u-popup>
  140. <!-- 模态框 -->
  141. <!-- <view class="model">
  142. <u-modal :show="isshow" title="报名前必看" :content='content' showCancelButton @confirm="goadd" @cancel="cancel" confirmColor="#ffffff"></u-modal>
  143. </view> -->
  144. <!-- <scroll-view scroll-y="true" style="height: 90vh;" scroll-with-animation="true"> -->
  145. <view class="model">
  146. <u-modal :show="isshow" title="报名前必看" :content='content' showCancelButton @confirm="goadd" @cancel="cancel" confirmColor="#ffffff"></u-modal>
  147. </view>
  148. <!-- </scroll-view> -->
  149. </view>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. share:false,
  156. // 标签
  157. tags:[],
  158. // 出行时间
  159. days:[],
  160. // 选择状态
  161. dayindex:-1,
  162. choosedays:'',
  163. list2: [{
  164. image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
  165. },{
  166. image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
  167. },{
  168. image: "https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png",
  169. }],
  170. list1: [
  171. {name: '特色'},
  172. {name: '行程'},
  173. {name: '费用'},
  174. {name: '须知'},
  175. {name: '置顶'}
  176. ],
  177. month: [],
  178. // 弹出层
  179. show: false,
  180. // 层级
  181. zindex:10075,
  182. // 模态框
  183. isshow:false,
  184. // 模态框内容
  185. content:'*以上旅游行程在实际执行中可能会根据季节气候、自然环境等不可抗因素进行调整,购买前请知悉。 *如出发地或目的地,有疫情中等风险及以上地区的,可免费转为保留金,保留支付金额,后续预订时以实际预订金额为准。 关于夕阳团的温馨提示: 1、支付完成后,我们将在1个工作日内与您确认是否预订成功。 2、夕阳团默认2个人一个房间。需报名人数满足最低发团数后发团。为了避免造成您的损失,建议您在与客服确认发团后再购买机票。 3、此产品最少需要30人报名才可出发,最多不超过40人。我们会在出发前20天与您再次确认,如届时仍未报满规定人数,则很遗 4、此产品最少需要30人报名才可出发,最多不',
  186. // 套餐内容
  187. goodsInfo:{},
  188. // 房间选择
  189. plans:{},
  190. //
  191. scrollTop:0
  192. }
  193. },
  194. onLoad(options) {
  195. console.log(options)
  196. this.init(options.id)
  197. },
  198. onPageScroll(e){
  199. // console.log(e,"<==============距离顶部的距离")
  200. this.scrollTop=e.scrollTop
  201. },
  202. methods:{
  203. init(id){
  204. this.$showLoadding("")
  205. uni.$u.http.post('/api/good/show',{good_id:id},{
  206. custom: {
  207. auth: true
  208. }
  209. }).then((res) => {
  210. uni.hideLoading()
  211. console.log(res,"套餐详情")
  212. this.goodsInfo=res
  213. this.tags=res.tags
  214. // console.log(res.plans,"===========出行日期============")
  215. let newmonth=[]
  216. for(let key in res.plans){
  217. newmonth.push({name:res.plans[key].month,days:res.plans[key].days})
  218. this.days=res.plans[5].days
  219. // console.log(res.plans[key].days,"xxxxxxxxxxxx")
  220. }
  221. this.month=newmonth
  222. }).catch((err) => {
  223. console.log( err)
  224. })
  225. },
  226. load() {
  227. this.$refs.uReadMore.init();
  228. },
  229. open() {
  230. this.show=true
  231. // console.log('open');
  232. },
  233. // 关闭popup
  234. close() {
  235. this.show = false
  236. // console.log('close');
  237. },
  238. // 添加出行人
  239. goadd(){
  240. this.isshow=false
  241. console.log(this.plans)
  242. let goodsInfo={}
  243. goodsInfo.cover_picture=this.goodsInfo.cover_picture
  244. goodsInfo.name=this.goodsInfo.name
  245. goodsInfo.id=this.goodsInfo.id
  246. goodsInfo.subtitle=this.goodsInfo.subtitle
  247. uni.navigateTo({
  248. url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
  249. })
  250. },
  251. // 关闭提示框
  252. cancel(){
  253. this.zindex=10075;
  254. this.isshow=false
  255. },
  256. // 选择当前日期
  257. dayItem(index,days){
  258. this.plans=days
  259. // console.log(index,days)
  260. let start=days.start_at.slice(0,10)
  261. let end=days.end_at.slice(0,10)
  262. this.choosedays=`${start}~${end}`
  263. this.dayindex=index
  264. },
  265. // 选择日期
  266. chooseDay(item){
  267. // console.log(item)
  268. this.days=item.days
  269. },
  270. // 切换标签
  271. check(item){
  272. // console.log(item)
  273. if(item.name=="行程"){
  274. uni.createSelectorQuery().select('.trips').boundingClientRect(data=>{//目标位置的节点:类或者id
  275. uni.pageScrollTo({
  276. duration: 100,//过渡时间
  277. scrollTop:data.top + this.scrollTop - 50,//到达距离顶部的top值
  278. })
  279. }).exec();
  280. }else if(item.name=="特色"){
  281. uni.createSelectorQuery().select(".duction").boundingClientRect(res=>{//目标位置的节点:类或者id
  282. uni.pageScrollTo({
  283. duration: 100,//过渡时间
  284. scrollTop:res.top + this.scrollTop - 50,//到达距离顶部的top值
  285. })
  286. }).exec()
  287. }else if(item.name=="置顶"){
  288. uni.pageScrollTo({
  289. duration: 100,//过渡时间
  290. scrollTop:0,//到达距离顶部的top值
  291. })
  292. }
  293. },
  294. // 生成海报
  295. goposter(){
  296. uni.navigateTo({
  297. url:"/pages/travel/poster"
  298. })
  299. },
  300. // 客服
  301. gomes(){
  302. uni.navigateTo({
  303. url:"/pages/customerService"
  304. })
  305. }
  306. }
  307. }
  308. </script>
  309. <style lang="less">
  310. page{
  311. background-color: #f4f4f4;
  312. }
  313. .model{
  314. // height: 500rpx !important;
  315. }
  316. .detailsPage{
  317. width: 100%;
  318. .flex{
  319. display: flex;
  320. align-items: center;
  321. }
  322. .flex-item{
  323. display: flex;
  324. justify-content: space-between;
  325. margin: 10rpx 0;
  326. }
  327. .details{
  328. background-color: #fff;
  329. padding:40rpx 30rpx 40rpx;
  330. margin: 24rpx 0;
  331. font-family: PingFang-SC-Medium, PingFang-SC;
  332. .title{
  333. color: #333333;
  334. font-size: 34rpx;
  335. font-weight: 600;
  336. margin-bottom: 24rpx;
  337. }
  338. .describe{
  339. font-size: 28rpx;
  340. color: #666666;
  341. margin-bottom: 40rpx;
  342. }
  343. .tags{
  344. font-size: 26rpx;
  345. color: #1E9F6A;
  346. height: 56rpx;
  347. padding: 0 28rpx;
  348. line-height: 56rpx;
  349. background: rgba(30, 159, 106, 0.06);
  350. margin-right: 24rpx;
  351. }
  352. }
  353. .detailsContent{
  354. background-color: #fff;
  355. margin-bottom: 160rpx;
  356. height: 100%;
  357. .detailsList{
  358. padding: 20rpx;
  359. }
  360. .list-item{
  361. display: flex;
  362. align-items: center;
  363. color: #1E9F6A;
  364. font-size: 36rpx;
  365. }
  366. }
  367. .navbar{
  368. background: #1E9F6A;
  369. border-radius: 16rpx 16rpx 0px 0px;
  370. color: #ffffff;
  371. display: flex;
  372. bottom: 0;
  373. left: 0;
  374. position: fixed;
  375. width: 100%;
  376. padding: 16rpx 40rpx;
  377. box-sizing: border-box;
  378. z-index: 10000;
  379. .kefu{
  380. image{
  381. // width: 42rpx;
  382. height: 44rpx;
  383. }
  384. font-size: 20rpx;
  385. color: rgba(255, 255, 255, 0.8);
  386. text-align: center;
  387. }
  388. .haibao{
  389. image{
  390. // width: 42rpx;
  391. height: 38rpx;
  392. }
  393. }
  394. .wxin{
  395. image{
  396. // width: 42rpx;
  397. height: 42rpx;
  398. }
  399. }
  400. .want{
  401. display: flex;
  402. flex: 1;
  403. align-items: center;
  404. justify-content: center;
  405. margin-right: 50rpx;
  406. }
  407. }
  408. .popupTop{
  409. padding-bottom: 24rpx;
  410. .image{
  411. margin: 20rpx 20rpx 0 0;
  412. }
  413. image{
  414. height: 120rpx;
  415. width: 200rpx;
  416. border-radius: 6rpx;
  417. }
  418. }
  419. .day{
  420. margin-bottom: 250rpx;
  421. }
  422. .item{
  423. display: flex;
  424. }
  425. .day-item-active{
  426. width: 120rpx;
  427. height: 164rpx;
  428. border-radius: 0px 32rpx 0px 32rpx;
  429. background: rgba(30, 159, 106, 0.1);
  430. border: 1px solid #1E9F6A;
  431. font-size: 22rpx;
  432. color: #333333;
  433. text-align: center;
  434. margin: 56rpx 24rpx 0 0;
  435. box-sizing: border-box;
  436. padding: 39rpx 0 42rpx;
  437. }
  438. .day-item{
  439. width: 122rpx;
  440. height: 166rpx;
  441. background: #F4F4F4;
  442. border-radius: 0px 32rpx 0px 32rpx;
  443. font-size: 22rpx;
  444. color: #333333;
  445. text-align: center;
  446. margin: 56rpx 24rpx 0 0;
  447. box-sizing: border-box;
  448. padding: 39rpx 0 42rpx;
  449. }
  450. .navbars{
  451. box-sizing: border-box;
  452. width: 100%;
  453. height: 104rpx;
  454. // line-height:104rpx;
  455. padding: 28rpx 0;
  456. background: #1E9F6A;
  457. border-radius: 16rpx 16rpx 0px 0px;
  458. color: #ffffff;
  459. display: flex;
  460. bottom: 0;
  461. left: 0;
  462. position: fixed;
  463. .price{
  464. border-right: 1px solid #ffffff;
  465. padding: 0 64rpx 0 30rpx;
  466. }
  467. .choose{
  468. margin: auto;
  469. }
  470. }
  471. }
  472. </style>