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

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