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

457 lines
10 KiB

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