Browse Source

首页改版

master
chenkainan 2 months ago
parent
commit
d0d4263b3a
  1. 2
      app.js
  2. 8
      app.json
  3. BIN
      images/ais.png
  4. BIN
      images/indexs.png
  5. BIN
      images/tuyous.png
  6. BIN
      images/users.png
  7. 1458
      pages/index/index.js
  8. 166
      pages/index/index.wxml
  9. 316
      pages/index/index.wxss
  10. 9
      pages/info/sceneProductInfo/index.js
  11. 2
      pages/info/sceneProductInfo/index.wxml
  12. 8
      pages/info/sceneProductInfo/index.wxss
  13. 395
      pages/pbService/web/index.js
  14. 3
      pages/user/order/list.wxml
  15. 844
      pages/user/order/sceneOrderInfo/index.js
  16. 70
      pages/user/order/sceneOrderInfo/index.wxml
  17. 214
      pages/user/order/sceneOrderInfo/index.wxss

2
app.js

@ -39,7 +39,7 @@ App({
// 获取前端配置文件 // 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => { commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest162? true : false; data.isTest = data.isTest165? true : false;
data.indexSeason = null data.indexSeason = null
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {

8
app.json

@ -254,26 +254,26 @@
{ {
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "/images/index.png", "iconPath": "/images/index.png",
"selectedIconPath": "/images/index_seld.png", "selectedIconPath": "/images/indexs.png",
"text": "首页", "text": "首页",
"shareTimeline": true "shareTimeline": true
}, },
{ {
"pagePath": "pages/pbService/aiHelpYou/index", "pagePath": "pages/pbService/aiHelpYou/index",
"iconPath": "/images/ai.png", "iconPath": "/images/ai.png",
"selectedIconPath": "/images/ai_seld.png", "selectedIconPath": "/images/ais.png",
"text": "AI" "text": "AI"
}, },
{ {
"pagePath": "pages/map/index", "pagePath": "pages/map/index",
"iconPath": "/images/map.png", "iconPath": "/images/map.png",
"selectedIconPath": "/images/map_seld.png", "selectedIconPath": "/images/tuyous.png",
"text": "图游" "text": "图游"
}, },
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user",
"iconPath": "/images/user.png", "iconPath": "/images/user.png",
"selectedIconPath": "/images/user_seld.png", "selectedIconPath": "/images/users.png",
"text": "我的" "text": "我的"
} }
] ]

BIN
images/ais.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
images/indexs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/tuyous.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/users.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

1458
pages/index/index.js

File diff suppressed because it is too large

166
pages/index/index.wxml

@ -1,5 +1,6 @@
<!--index.wxml--> <!--index.wxml-->
<view class="bg" wx:if="{{!isTest}}"> <view class="bg" wx:if="{{!isTest}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/topImgs.gif" style="margin-left:0" mode="widthFix" style="position: absolute;top: 0;left: 0;width: 100vw;"></image>
<!-- 顶部banner --> <!-- 顶部banner -->
<view style="position:relative;z-index: 1;padding-top: 200rpx;"> <view style="position:relative;z-index: 1;padding-top: 200rpx;">
<view class="top-box" style="top: {{systemStyle.padHeight}}px;right:{{systemStyle.right+10}}px"> <view class="top-box" style="top: {{systemStyle.padHeight}}px;right:{{systemStyle.right+10}}px">
@ -63,30 +64,47 @@
</view> --> </view> -->
</view> </view>
<view class="ai-box" style="padding: 0 25rpx;box-sizing: border-box;" wx:if="{{mainTypeList.length>0}}"> <view class="small-box">
<image class="ai-fix" bind:tap="goAIUrl" mode="widthFix" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/indexWinter2025/banniyou.gif"></image> <!-- <view class="small-swiper-box" wx:if="{{ztbanner.length>0 && func_data.tour_guide}}">
<view class="ai-text">{{aiStr}}</view> <image class="small-bg" style="" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/swiperBg.png" mode="aspectFill"></image>
</view> <swiper class="small-swiper" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}"
bindchange="changeBannerIndex" data-keyname="ztBannerIndex" circular>
<block wx:for="{{ztbanner}}" wx:key="index">
<swiper-item bindtap="bannerClick" data-item="{{item}}">
<image lazy-load style="" src="{{item.head_img}}" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
</view> -->
<view class="small-swiper-box" wx:if="{{xiaobanner.length>0 && func_data.banner_mini}}" style="border: 3rpx solid #E96B11;">
<!-- <image class="small-bg" style="" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/swiperBg.png" mode="aspectFill"></image> -->
<swiper class="small-swiper" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}"
bindchange="changeBannerIndex" data-keyname="smBannerIndex" circular indicator-dots indicator-color="rgba(156, 31, 35, .6)" indicator-active-color="#9C1F23">
<block wx:for="{{xiaobanner}}" wx:key="index">
<swiper-item bindtap="bannerClick" data-item="{{item}}" style="position: relative;">
<!-- 原 圆角77rpx,现改为13rpx -->
<!-- <image lazy-load style="position: absolute;left: 0;right: 0;top: 0;bottom: 0;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2025/smallBg.png"></image> -->
<image lazy-load style="" src="{{item.head_img}}" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
<!-- <view class="dot-list com-flex sm-dot-list">
<view class="dot{{smBannerIndex==index?' active':''}}" wx:for="{{xiaobanner}}" wx:key="index"></view>
</view> -->
</view>
<view class="small-bottom">
<view class="ai-box" style="" wx:if="{{mainTypeList.length>0}}">
<image class="ai-fix" bind:tap="goAIUrl" mode="widthFix" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/aiBgs.gif"></image>
<!-- <view class="ai-text">{{aiStr}}</view> -->
</view>
<image bind:tap="goYjgl" style="" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/yjgl.png" mode="aspectFill" class="yjgl"></image>
</view>
</view>
<view class="content-box"> <view class="content-box">
<!-- 苏城环游记 todo--> <!-- 苏城环游记 todo-->
<view class="small-swiper-box" wx:if="{{ztbanner.length>0 && func_data.tour_guide}}">
<swiper class="small-swiper" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}"
bindchange="changeBannerIndex" data-keyname="ztBannerIndex" circular>
<block wx:for="{{ztbanner}}" wx:key="index">
<swiper-item bindtap="bannerClick" data-item="{{item}}">
<!-- 原 圆角77rpx,现改为13rpx -->
<image lazy-load style="border-radius:13rpx" src="{{item.head_img}}" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
<!-- <view class="dot-list com-flex sm-dot-list">
<view class="dot{{smBannerIndex==index?' active':''}}" wx:for="{{xiaobanner}}" wx:key="index"></view>
</view> -->
</view>
<!-- 限时特惠--新版--> <!-- 限时特惠--新版-->
<view class="sale-road-boxes" style="margin-top:0;" wx:if="{{func_data.hot_deals}}"> <view class="sale-road-boxes" style="margin-top:0;" wx:if="{{func_data.hot_deals}}">
@ -183,22 +201,6 @@
</view> </view>
<view class="small-swiper-box" wx:if="{{xiaobanner.length>0 && func_data.banner_mini}}">
<swiper class="small-swiper" autoplay="{{true}}" interval="{{3000}}" duration="{{300}}"
bindchange="changeBannerIndex" data-keyname="smBannerIndex" circular>
<block wx:for="{{xiaobanner}}" wx:key="index">
<swiper-item bindtap="bannerClick" data-item="{{item}}" style="position: relative;">
<!-- 原 圆角77rpx,现改为13rpx -->
<!-- <image lazy-load style="position: absolute;left: 0;right: 0;top: 0;bottom: 0;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/index2025/smallBg.png"></image> -->
<image lazy-load style="border-radius:13rpx" src="{{item.head_img}}" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
<!-- <view class="dot-list com-flex sm-dot-list">
<view class="dot{{smBannerIndex==index?' active':''}}" wx:for="{{xiaobanner}}" wx:key="index"></view>
</view> -->
</view>
<!-- 公共服务 --> <!-- 公共服务 -->
<view class="sale-road-boxes" style="margin-top:0;" wx:if="{{func_data.service_public}}"> <view class="sale-road-boxes" style="margin-top:0;" wx:if="{{func_data.service_public}}">
<image lazy-load class="common-header-img" mode="widthFix" src="{{indexSeason.ggfw}}"></image> <image lazy-load class="common-header-img" mode="widthFix" src="{{indexSeason.ggfw}}"></image>
@ -211,6 +213,7 @@
<view class="ggfw-list" style="width:100%;margin-top: 16rpx;position: relative;z-index: 1;"> <view class="ggfw-list" style="width:100%;margin-top: 16rpx;position: relative;z-index: 1;">
<view class="ggfw" wx:for="{{publicSerivce}}" wx:key="index" data-item="{{item}}" bindtap="mainNavClick"> <view class="ggfw" wx:for="{{publicSerivce}}" wx:key="index" data-item="{{item}}" bindtap="mainNavClick">
<image lazy-load src="{{item.icon}}" mode="aspectFill"></image> <image lazy-load src="{{item.icon}}" mode="aspectFill"></image>
<view>{{item.menu_name}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -276,7 +279,7 @@
</scroll-view> --> </scroll-view> -->
<view class="big-image-box" style="height: 333rpx;"> <view class="big-image-box" style="height: 333rpx;">
<image style="border-radius: 0;" lazy-load src="{{SQSM[cityIndex].icon}}" mode="aspectFill" bindtap="mainNavClick" data-item="{{SQSM[cityIndex]}}"></image> <image style="border-radius: 0;" lazy-load src="{{SQSM[cityIndex].icon}}" mode="heightFix" bindtap="mainNavClick" data-item="{{SQSM[cityIndex]}}"></image>
</view> </view>
</view> </view>
@ -298,7 +301,7 @@
<image lazy-load mode="widthFix" class="common-header-img" src="{{indexSeason.rmtj}}"></image> <image lazy-load mode="widthFix" class="common-header-img" src="{{indexSeason.rmtj}}"></image>
<!-- <image lazy-load class="rmtj-right" src="{{imageSourceList.CBTP[4]}}" mode="" style="width: 276rpx;height: 100rpx;"/> --> <!-- <image lazy-load class="rmtj-right" src="{{imageSourceList.CBTP[4]}}" mode="" style="width: 276rpx;height: 100rpx;"/> -->
</view> </view>
<view class="hot-list" style="margin-top: 7rpx;position: relative;z-index: 1;" wx:if="{{func_data.repurchase}}"> <!-- <view class="hot-list" style="margin-top: 7rpx;position: relative;z-index: 1;" wx:if="{{func_data.repurchase}}">
<view class="hot-list-item" wx:for="{{2}}" wx:for-index="number" wx:key="number"> <view class="hot-list-item" wx:for="{{2}}" wx:for-index="number" wx:key="number">
<view wx:for="{{repurchaseList}}" wx:if="{{index%2==number}}" bindtap="gotoDetail" data-item="{{item}}" data-source="回购榜" wx:key="id"> <view wx:for="{{repurchaseList}}" wx:if="{{index%2==number}}" bindtap="gotoDetail" data-item="{{item}}" data-source="回购榜" wx:key="id">
<view class="hot-item"> <view class="hot-item">
@ -318,17 +321,86 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<!-- <view wx:if="{{listMore}}" class="more-btn-text" bindtap="getList">查看更多</view>
<view wx:else class="more-btn-text" bindtap="getList">暂无更多推荐</view> -->
</view>
<!-- Tab 切换 -->
<scroll-view scroll-x class="custom-tabs" enable-flex>
<view
wx:for="{{recommendType}}"
wx:key="id"
class="tab-btn {{activeIndex === index ? 'active' : ''}}"
bindtap="handleTabClick"
data-index="{{index}}"
>
{{ item.name }}
</view>
</scroll-view>
<!-- 堆叠卡片轮播 -->
<view
class="stack-swiper"
bindtouchstart="handleTouchStart"
bindtouchend="handleTouchEnd"
>
<!--
直接从 cardStyles 数组中取样式
cardStyles[index] 对应第 index 个卡片的样式字符串
-->
<view
class="stack-item"
wx:for="{{recommendType}}"
wx:key="id"
style="{{cardStyles[index]}}"
bindtap="handleCardClick"
data-index="{{index}}"
>
<!-- 内容区域:只有当前选中的显示 -->
<view class="card-inner-border" style="opacity: {{index === activeIndex ? 1 : 0}}">
<view
class="product-item"
wx:for="{{item.list}}"
wx:for-item="pItem"
wx:for-index="pIndex"
wx:key="id"
bindtap="gotoDetail"
data-item="{{pItem}}"
data-index="{{index}}"
>
<!-- 图片 -->
<image class="product-img" src="{{pItem.headimg}}" mode="aspectFill"></image>
<!-- 内容 -->
<view class="product-content">
<!-- 标题 (多行省略) -->
<view class="title text-overflowRows">{{pItem.title}}</view>
<!-- 标签 -->
<view class="tags" wx:if="{{pItem.tagsArray}}">
<!-- 使用 wxs 处理字符串分割 -->
<view
class="tag-item text-overflow"
wx:for="{{pItem.tagsArray}}"
wx:for-item="tagItem"
wx:key="*this"
>
{{tagItem}}
</view>
</view>
<!-- 价格与按钮 -->
<view class="flex-between">
<view class="price">¥{{pItem.price / 100}}</view>
<view class="btn-img">立即购买</view>
</view>
</view>
</view>
<view class="see-more-link" bindtap="gotoPath" data-item="{{item}}">查看更多 >></view>
</view>
</view>
</view>
</view>
</view> </view>
<!-- 广告弹窗 --> <!-- 广告弹窗 -->
<view class="zzc" bindtap="closeAdv" wx:if="{{showAdv}}"></view> <view class="zzc" bindtap="closeAdv" wx:if="{{showAdv}}"></view>
<view class="alertavd" wx:if="{{showAdv}}"> <view class="alertavd" wx:if="{{showAdv}}">
@ -415,7 +487,7 @@
<block wx:for="{{xiaobanner}}" wx:key="index"> <block wx:for="{{xiaobanner}}" wx:key="index">
<swiper-item data-item="{{item}}" style="position: relative;"> <swiper-item data-item="{{item}}" style="position: relative;">
<image lazy-load style="border-radius:13rpx" src="{{item.head_img}}" mode="aspectFill"></image> <image lazy-load style="border-radius:13rpx;" src="{{item.head_img}}" mode="aspectFill"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>

316
pages/index/index.wxss

@ -5,13 +5,17 @@
min-height: 100vh; min-height: 100vh;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
background-size: 100% auto; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
padding-bottom: 200rpx; padding-bottom: 100rpx;
background-color:#F8E0C6; background-color: rgba(80, 84, 136, 1);
background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/indexWinter2025/topGifs.gif"); background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/bg.jpg");
}
.top-img {
position: absolute;
top: 0;
left: 0;
width: 100vw;
} }
.swiper{ .swiper{
display: block; display: block;
@ -71,7 +75,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 26rpx 20rpx 30rpx; padding: 26rpx 28rpx 30rpx;
box-sizing: border-box; box-sizing: border-box;
/* background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.2)) */ /* background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.2)) */
} }
@ -103,7 +107,7 @@
border-radius: 20rpx; border-radius: 20rpx;
/* background: #FFEEAD; */ /* background: #FFEEAD; */
padding-top: 13rpx; padding-top: 13rpx;
background-image: url("https://static.ticket.sz-trip.com/uploads/20251127/971ccf61fe5446130501fb26ac7e8ffc.png"); /* background-image: url("https://static.ticket.sz-trip.com/uploads/20251127/971ccf61fe5446130501fb26ac7e8ffc.png"); */
background-size: 100% 100%; background-size: 100% 100%;
} }
.top-icon-item { .top-icon-item {
@ -154,27 +158,36 @@
.common-header-img{ .common-header-img{
width: 100%; width: 100%;
position: relative; position: relative;
margin-top: 25rpx;
} }
.small-swiper { .small-swiper {
height: 154rpx; height: 366.73rpx;
} }
.small-swiper image { .small-swiper image {
display: block; display: block;
width: 100%; width: 100%;
height: 154rpx; height: 366.73rpx;
} }
.small-swiper-box { .small-swiper-box {
margin: 50rpx 0; width: 306.73rpx;
width: 100%; height: 366.73rpx;
height: 154rpx;
border-radius: 20rpx; border-radius: 20rpx;
/* border-radius: 77rpx; */ /* border-radius: 77rpx; */
overflow: hidden; overflow: hidden;
margin-top: 33rpx; /* margin-top: 33rpx; */
position: relative; position: relative;
} }
.small-bg {
position: absolute;
top: 0;
left: 0;
width: 306.73rpx;
height: 366.73rpx;
z-index: 2000;
}
.sale-road-boxes { .sale-road-boxes {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -812,11 +825,15 @@
.ggfw-list .ggfw { .ggfw-list .ggfw {
width: 157.33rpx; width: 157.33rpx;
height: 130.67rpx; height: 130.67rpx;
/* margin-bottom: 23rpx; */ margin-bottom: 21rpx;
font-weight: 500;
font-size: 23rpx;
color: #FFF2E0;
text-align: center;
} }
.ggfw image{ .ggfw image{
width: 100%; width: 113.33rpx;
height: 100%; height: 113.33rpx;
} }
.six-box-new { .six-box-new {
@ -835,7 +852,6 @@
} }
.six-box-new .big-image-box image{ .six-box-new .big-image-box image{
width: 100%;
height: 100%; height: 100%;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
} }
@ -1059,8 +1075,8 @@
} }
.ai-box{ .ai-box{
margin: 15rpx 0 40rpx; /* margin: 15rpx 0 40rpx; */
width: 100%; width: 373.33rpx;
position: relative; position: relative;
} }
.ai-text{ .ai-text{
@ -1137,3 +1153,263 @@
width: 100%; width: 100%;
} }
.small-box {
/* width: 100%; */
height: 366.73rpx;
display: flex;
justify-content: space-between;
margin: 30rpx;
}
.small-bottom {
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* Tab */
.custom-tabs {
white-space: nowrap;
width: 100%;
height: 100rpx;
margin-top: 32rpx;
}
.tab-btn {
display: inline-block;
width: 200rpx;
height: 53rpx;
line-height: 53rpx;
text-align: center;
font-weight: 500;
font-size: 28rpx;
margin-right: 10rpx;
background-size: 100% 100%;
background-repeat: no-repeat;
transition: all 0.3s;
color: #111;
background-image: url('https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/hotBg.png');
background-size: 100% 100%;
}
.tab-btn.active {
font-weight: bold;
color: #E33929;
}
/* Stack Swiper */
.stack-swiper {
position: relative;
width: 700rpx;
height: 850rpx;
margin: 0 auto;
/* padding-right: 50rpx; */
box-sizing: border-box;
margin-left: -10rpx;
}
.stack-item {
position: absolute;
width: 630rpx;
height: 100%;
border-radius: 20rpx;
top: 0;
left: 10rpx;
/* 动画过渡 */
transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, background-color 0.4s;
box-shadow: -4rpx 4rpx 16rpx rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.card-inner-border {
width: 100%;
height: 100%;
border-radius: 20rpx;
padding: 20rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: transparent;
transition: opacity 0.3s;
}
/* Content Demo */
.product-content-demo {
flex: 1;
display: flex;
flex-direction: column;
}
.demo-img {
width: 100%;
height: 350rpx;
background-color: #ddd;
border-radius: 16rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: center;
color: #666;
font-size: 32rpx;
}
.demo-info {
flex: 1;
}
.demo-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 10rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.demo-tags text {
display: inline-block;
border: 1px solid #ff6b6b;
color: #ff6b6b;
font-size: 20rpx;
padding: 2rpx 10rpx;
border-radius: 8rpx;
margin-right: 10rpx;
}
.demo-price-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 30rpx;
}
.price {
color: #d43d3d;
font-size: 40rpx;
font-weight: bold;
}
.buy-btn {
background: linear-gradient(90deg, #ff6b6b, #e03e3e);
color: #fff;
padding: 10rpx 30rpx;
border-radius: 30rpx;
font-size: 26rpx;
}
.see-more-link {
text-align: center;
width: 220rpx; /* 3.03rem */
height: 50rpx; /* 0.7rem */
background: #FFF9F2;
border-radius: 25rpx; /* 0.35rem */
font-weight: bold;
font-size: 26rpx; /* 0.42rem */
color: #CE3B2B;
line-height: 50rpx;
margin: 0 0 20rpx auto;
display: block;
}
.yjgl {
width: 373.33rpx;
height: 133.33rpx;
}
.product-item {
width: 100%; /* 自动填满容器 */
height: 220rpx; /* 3rem ≈ 210-220rpx */
background: #FFF9F2;
border-radius: 14rpx; /* 0.2rem */
display: flex;
margin-bottom: 20rpx;
box-sizing: border-box;
padding: 10rpx; /* 稍微加点内边距 */
}
.product-img {
width: 200rpx; /* 3rem */
height: 200rpx; /* 3rem */
background: #F9EFD7;
border-radius: 14rpx; /* 0.2rem */
border: 1rpx solid #FAD29B;
margin-right: 14rpx; /* 0.19rem */
flex-shrink: 0; /* 防止图片被压缩 */
}
.product-content {
height: 200rpx; /* 3rem */
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding-right: 10rpx;
overflow: hidden; /* 防止内容溢出 */
}
.title {
font-weight: bold;
font-size: 30rpx; /* 0.42rem */
color: #000000;
line-height: 1.3;
}
/* 多行省略通用样式 */
.text-overflowRows {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 限制2行 */
overflow: hidden;
text-overflow: ellipsis;
}
.tags {
display: flex;
margin: 8rpx 0;
}
.tag-item {
line-height: 36rpx; /* 0.5rem */
border-radius: 8rpx; /* 0.1rem */
border: 1rpx solid #CE3B2B;
padding: 0 10rpx;
margin-right: 10rpx;
font-weight: 500;
font-size: 24rpx; /* 0.34rem */
color: #CE3B2B;
white-space: nowrap;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: flex-end; /* 底部对齐 */
}
.price {
font-weight: bold;
font-size: 32rpx; /* 0.42rem 稍微调大增加强调 */
color: #DD2723;
}
.btn-img {
width: 150rpx; /* 2.1rem */
height: 50rpx; /* 0.71rem */
line-height: 50rpx;
text-align: center;
font-weight: bold;
font-size: 24rpx; /* 0.34rem */
color: #F9EFD7;
/* 请确保背景图链接有效 */
background-image: url('https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/btnBg.png');
background-size: 100% 100%;
border-radius: 25rpx; /* 按钮圆角 */
}

9
pages/info/sceneProductInfo/index.js

@ -64,6 +64,8 @@ Page({
skuDays: 30, skuDays: 30,
advList: [], advList: [],
zzShow: true
}, },
/** /**
@ -77,9 +79,10 @@ Page({
} }
if(options.id) { if(options.id) {
let tempUrl = util.detailDomain+`/ScenicDetail?id=${options.id}` let tempUrl = util.detailDomain+`/ScenicDetail?id=${options.id}`
wx.navigateTo({ wx.redirectTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl), url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl),
}) })
return
} }
if (options.retailId) { if (options.retailId) {
this.setData({ this.setData({
@ -272,7 +275,9 @@ Page({
}, },
onReady() {
this.setData({zzShow: false})
},
// 获取广告 // 获取广告
getAdv() { getAdv() {
commonApi._post("adv/getAdv", { commonApi._post("adv/getAdv", {

2
pages/info/sceneProductInfo/index.wxml

@ -372,3 +372,5 @@
</view> </view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}"> <code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code> </code>
<view class="zhezhao" wx:if="{{zzShow}}"></view>

8
pages/info/sceneProductInfo/index.wxss

@ -1083,3 +1083,11 @@ line-height: 93rpx;
.adv-swiper{ .adv-swiper{
height: 166.67rpx; height: 166.67rpx;
} }
.zhezhao {
width: 100vw;
height: 100vh;
position: fixed;
background-color: #fff;
z-index: 2000;
}

395
pages/pbService/web/index.js

@ -3,270 +3,213 @@ let app = getApp()
import commonApi from "../../../utils/https/common" import commonApi from "../../../utils/https/common"
import userApi from "../../../utils/https/user" import userApi from "../../../utils/https/user"
import https from "../../../utils/https.js" import https from "../../../utils/https.js"
Page({
/** Page({
* 页面的初始数据
*/
data: { data: {
webUrl:"", webUrl: "",
shareTitle: "", shareTitle: "",
shareUrl: "", shareUrl: "",
canSetData: true
cachedOptions: null,
isWaitingLogin: false,
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { onLoad: function (options) {
let weburl = decodeURIComponent(options.weburl) // onLoad 只负责存参数,不执行任何跳转逻辑,防止和页面初始化冲突
// weburl = 'https://test.m.cloud.sz-trip.com/petYou2024' console.log('onLoad options:', options);
console.log('weburl',weburl) this.data.cachedOptions = options;
// 获取路径参数 },
let webParam = {}
let baseUrl = ""
try {
baseUrl = weburl.split('?')[0]
let paramStr = weburl.split('?')[1]
if (paramStr) {
paramStr.split('&').forEach((param) => {
let parts = param.split('=');
webParam[(parts[0])] = (parts[1]);
});
}
} catch(e) { onShow: function () {
console.log(e) // 将所有逻辑移到 onShow,确保页面加载完毕后再执行跳转
} this.checkLoginAndLoad();
console.log(webParam) },
let lowerUrl = weburl.toLowerCase() checkLoginAndLoad: function() {
// 宠你有礼 市民卡授权 // 1. 防白屏容错:检查参数
if (lowerUrl.indexOf('petyou2024') && webParam.cnylCode) { let options = this.data.cachedOptions;
commonApi._get("uservice/user/loginByCnyl", { if (!options || !options.weburl) {
cnylCode: webParam.cnylCode setTimeout(() => { wx.navigateBack(); }, 100);
}).then(res => { return;
}
if(res.data && res.data.id && res.data.token) { let token = wx.getStorageSync('jstrip_token');
wx.setStorageSync("jstrip_userid", res.data.id)
wx.setStorageSync("jstrip_token", res.data.token)
wx.setStorageSync("jstrip_userInfo", res.data)
weburl += '&token='+res.data.token // 2. 有 Token:正常加载
} if (token) {
}).finally(()=>{ // 如果是刚登录回来,或者页面还没加载过 URL
// this.setData({ if (this.data.isWaitingLogin || !this.data.webUrl) {
// webUrl:weburl console.log('已登录,开始加载页面');
// }) this.data.isWaitingLogin = false;
this.setUrl(weburl) this.handleUrlProcess();
}) }
return;
} }
// 遇见昆山
else if (lowerUrl.indexOf('couponAndKs') && webParam.ksCode) { // 3. 无 Token:处理跳转
commonApi._get("uservice/user/loginBykunshan", { // 3.1 如果 isWaitingLogin 为 true,说明是刚从登录页返回(用户取消了登录)
code: webParam.ksCode if (this.data.isWaitingLogin) {
}).then(res => { console.log('用户取消登录,返回上一页');
if(res.data && res.data.id && res.data.token) { wx.navigateBack();
wx.setStorageSync("jstrip_userid", res.data.id) return;
wx.setStorageSync("jstrip_token", res.data.token)
wx.setStorageSync("jstrip_userInfo", res.data)
weburl += '&token='+res.data.token
}
}).finally(()=>{
// this.setData({
// webUrl:weburl
// })
this.setUrl(weburl)
})
} }
// 君到苏州 加token
else if(lowerUrl.indexOf('m.cloud.sz-trip.com')!=-1) {
delete webParam.token
delete webParam.lon
delete webParam.lat
weburl = baseUrl
if(Object.keys(webParam).length>0) { // 3.2 第一次检测到未登录,跳转登录页
const newParamsArray = []; console.log('未登录,延时跳转登录页');
for (let key in webParam) { this.data.isWaitingLogin = true;
newParamsArray.push(`${key}=${(webParam[key])}`);
// ★关键修复★:使用 setTimeout 延迟跳转,解决 "navigateTo with an already exist webviewId" 报错
setTimeout(() => {
wx.navigateTo({
url: '/pages/login/index',
fail: (err) => {
console.error('跳转失败:', err);
this.data.isWaitingLogin = false; // 重置标记以便重试
} }
weburl = `${baseUrl}?${newParamsArray.join('&')}`; });
} }, 300); // 延迟 300ms 足够让页面初始化完成
},
let token = wx.getStorageSync('jstrip_token') handleUrlProcess: function () {
if (token) { let options = this.data.cachedOptions;
if (Object.keys(webParam).length>0) { // 双重检查
weburl += '&token='+token if (!options || !options.weburl) return;
} else {
weburl += '?token='+token
}
}
let _this = this
try {
let lonAndLat = (wx.getStorageSync('lonAndLat'))
if (lonAndLat && JSON.parse(lonAndLat)) {
lonAndLat = JSON.parse(lonAndLat)
if (Object.keys(webParam).length>0 || token) {
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}`
} else {
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}`
}
this.setUrl(weburl)
return
} else {
wx.getLocation({
type: 'gcj02',
success: (res) => {
let lonAndLat = JSON.stringify({lat: res.latitude,lon: res.longitude})
wx.setStorageSync('lonAndLat', lonAndLat)
if (Object.keys(webParam).length>0 || token) {
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}`
} else {
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}`
}
_this.setUrl(weburl)
},
fail: (err) => {
_this.setUrl(weburl)
}
})
}
} catch(e) {
this.setUrl(weburl)
}
// this.setUrl(weburl)
} else {
// this.setData({
// webUrl:weburl
// })
this.setUrl(weburl)
}
// if(weburl.indexOf('m.cloud.sz-trip.com')!=-1){ let weburl = decodeURIComponent(options.weburl)
// userApi.user_post("user/getMyInfo").then(res=>{
// let weburl = weburl
// if(weburl.indexOf('?')!=-1){
// weburl += '&token='+res.data.token;
// }
// else {
// weburl += '?token='+res.data.token
// }
// this.setData({
// info:res.data,
// webUrl:weburl
// })
// })
// }
// else if(weburl.indexOf('m.jszhwlpt.com')!=-1 || weburl.indexOf('wechat.b2c.zj-trip.net')!=-1){
// // 如果是去苏心游或者镇江的话
// userApi.user_post("user/getJumpThirdAppCode",{}).then(res=>{
// let weburl = weburl
// if(weburl.indexOf('?')!=-1){
// weburl += '&original_sys_name=jdsz&auth_code='+res.data;
// }
// else {
// weburl += '?original_sys_name=jdsz&auth_code='+res.data
// }
// this.setData({
// info:res.data,
// webUrl:weburl
// })
// })
// }
// else {
// } let webParam = {}
}, let baseUrl = ""
handleMessage(data) { try {
// this.setData({ baseUrl = weburl.split('?')[0]
// shareTitle:data.shareTitle, let paramStr = weburl.split('?')[1]
// shareUrl:data.shareUrl if (paramStr) {
// }) paramStr.split('&').forEach((param) => {
console.log('打印22222',data); let parts = param.split('=');
}, webParam[(parts[0])] = (parts[1]);
});
}
} catch (e) { console.log(e) }
loginByCode () { let lowerUrl = weburl.toLowerCase()
// 市民卡
if(options && options.cnylCode) { // 此时 Token 肯定存在
commonApi._post("uservice/user/loginByCnyl", { let token = wx.getStorageSync('jstrip_token');
cnylCode: options.cnylCode
}).then(res => { // 1. 宠你有礼
if(res.data && res.data.id && res.data.token) { if (lowerUrl.indexOf('petyou2024') != -1 && webParam.cnylCode) {
https.set_logininfo(res); commonApi._get("uservice/user/loginByCnyl", { cnylCode: webParam.cnylCode })
} .then(res => {
}) if (res.data && res.data.id && res.data.token) {
this.saveLoginInfo(res.data);
weburl += '&token=' + res.data.token
}
}).finally(() => { this.setUrl(weburl) })
} }
}, // 2. 遇见昆山
else if (lowerUrl.indexOf('couponAndKs') != -1 && webParam.ksCode) {
commonApi._get("uservice/user/loginBykunshan", { code: webParam.ksCode })
.then(res => {
if (res.data && res.data.id && res.data.token) {
this.saveLoginInfo(res.data);
weburl += '&token=' + res.data.token
}
}).finally(() => { this.setUrl(weburl) })
}
// 3. 君到苏州
else if (lowerUrl.indexOf('m.cloud.sz-trip.com') != -1) {
delete webParam.token
delete webParam.lon
delete webParam.lat
weburl = baseUrl
if (Object.keys(webParam).length > 0) {
const newParamsArray = [];
for (let key in webParam) {
newParamsArray.push(`${key}=${(webParam[key])}`);
}
weburl = `${baseUrl}?${newParamsArray.join('&')}`;
}
setUrl (url) { if (Object.keys(webParam).length > 0) {
console.log(url) weburl += '&token=' + token
let that = this } else {
if (this.data.canSetData) { weburl += '?token=' + token
this.data.canSetData = false
this.setData({
webUrl:url
})
setTimeout(() => {
that.data.canSetData = true
}, 1000);
} }
this.handleLocationAndSetUrl(weburl, webParam, token);
}
// 4. 其他
else {
this.setUrl(weburl)
}
}, },
/** handleLocationAndSetUrl(weburl, webParam, token) {
* 生命周期函数--监听页面初次渲染完成 let that = this;
*/ try {
onReady: function () { let lonAndLat = wx.getStorageSync('lonAndLat')
let locObj = null;
}, if (lonAndLat) {
try { locObj = JSON.parse(lonAndLat); } catch(e) {}
}
/** if (locObj && locObj.lon && locObj.lat) {
* 生命周期函数--监听页面显示 weburl = that.appendLocation(weburl, locObj.lon, locObj.lat, webParam, token);
*/ that.setUrl(weburl);
onShow: function () { return;
}
wx.getLocation({
type: 'gcj02',
success: (res) => {
let newLoc = { lat: res.latitude, lon: res.longitude };
wx.setStorageSync('lonAndLat', JSON.stringify(newLoc));
weburl = that.appendLocation(weburl, newLoc.lon, newLoc.lat, webParam, token);
that.setUrl(weburl);
},
fail: (err) => {
console.log('定位失败');
that.setUrl(weburl);
}
})
} catch (e) {
console.error(e);
that.setUrl(weburl);
}
}, },
/** appendLocation(url, lon, lat, webParam, token) {
* 生命周期函数--监听页面隐藏 if (Object.keys(webParam).length > 0 || token) {
*/ return url + `&lon=${lon}&lat=${lat}`;
onHide: function () { } else {
return url + `?lon=${lon}&lat=${lat}`;
}
}, },
/** saveLoginInfo(data) {
* 生命周期函数--监听页面卸载 wx.setStorageSync("jstrip_userid", data.id)
*/ wx.setStorageSync("jstrip_token", data.token)
onUnload: function () { wx.setStorageSync("jstrip_userInfo", data)
}, },
/** setUrl(url) {
* 页面相关事件处理函数--监听用户下拉动作 console.log('设置webUrl:', url)
*/ if (!url) return;
onPullDownRefresh: function () { this.setData({ webUrl: url })
}, },
/** handleMessage(data) {},
* 页面上拉触底事件的处理函数 loginByCode() {},
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () { onShareAppMessage: function () {
return { return {
title: this.data.shareTitle, title: this.data.shareTitle,
path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`, path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`,
} }
}, },
onShareTimeline: function() { onShareTimeline: function () {
return { return {
title: this.data.shareTitle, title: this.data.shareTitle,
path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`, path: `/pages/pbService/web/index?weburl=${encodeURIComponent(this.data.webUrl)}`,

3
pages/user/order/list.wxml

@ -8,6 +8,7 @@
</view> </view>
<view class="types"> <view class="types">
<view class="type-item{{type?'':' active'}}" bindtap="changeType" data-type="">全部</view> <view class="type-item{{type?'':' active'}}" bindtap="changeType" data-type="">全部</view>
<!-- <view class="type-item{{type=='RESERVATION'?' active':''}}" bindtap="changeType" data-type="RESERVATION">抢票中</view> -->
<view class="type-item{{type=='WAIT_PAYMENT'?' active':''}}" bindtap="changeType" data-type="WAIT_PAYMENT">待付款</view> <view class="type-item{{type=='WAIT_PAYMENT'?' active':''}}" bindtap="changeType" data-type="WAIT_PAYMENT">待付款</view>
<view class="type-item{{type=='WAIT_CONFIRM'?' active':''}}" bindtap="changeType" data-type="WAIT_CONFIRM">待确认</view> <view class="type-item{{type=='WAIT_CONFIRM'?' active':''}}" bindtap="changeType" data-type="WAIT_CONFIRM">待确认</view>
<view class="type-item{{type=='WAIT_POST'?' active':''}}" bindtap="changeType" data-type="WAIT_POST">待发货</view> <view class="type-item{{type=='WAIT_POST'?' active':''}}" bindtap="changeType" data-type="WAIT_POST">待发货</view>
@ -21,7 +22,7 @@
<view class="order-item" bindtap="gotoDetail" data-item="{{item}}" wx:for="{{list}}" > <view class="order-item" bindtap="gotoDetail" data-item="{{item}}" wx:for="{{list}}" >
<view class="order-top"> <view class="order-top">
<text>订单号:{{item.order_id}}</text> <text>订单号:{{item.order_id}}</text>
<text class="status">{{item.orderStateText?item.orderStateText:orderState[item.state]}}</text> <text class="status">{{item.state_text}}</text>
</view> </view>
<view data-item="{{order}}" wx:for="{{item.order_product_list}}" wx:for-item="order"> <view data-item="{{order}}" wx:for="{{item.order_product_list}}" wx:for-item="order">
<view class="order-info" wx:if="{{!order.is_bind_agent}}"> <view class="order-info" wx:if="{{!order.is_bind_agent}}">

844
pages/user/order/sceneOrderInfo/index.js

@ -3,418 +3,470 @@ import commonApi from "../../../../utils/https/common"
import userApi from "../../../../utils/https/user" import userApi from "../../../../utils/https/user"
import QRCode from '../../../../utils/weapp-qrcode.js' import QRCode from '../../../../utils/weapp-qrcode.js'
import util from '../../../../utils/util' import util from '../../../../utils/util'
let app = getApp(),timer let app = getApp(),
timer
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
id:null, id: null,
info:null, info: null,
orderState:app.globalData.orderState, orderState: app.globalData.orderState,
productState:app.globalData.productState, productState: app.globalData.productState,
product_model:null, product_model: null,
isRefund:false, isRefund: false,
feeInfoFlag:false, feeInfoFlag: false,
codeIndex:0, codeIndex: 0,
codeImgs:[], codeImgs: [],
minute:0, minute: 0,
second:0, second: 0,
cardTypes:{}, cardTypes: {},
cxr1:false, cxr1: false,
cxr1Text:'更多', cxr1Text: '更多',
sysm:false, sysm: false,
sysmText:'更多', sysmText: '更多',
sysm2:false, sysm2: false,
sysm2Text:'更多', sysm2Text: '更多',
imgLen:[], imgLen: [],
ids:[], ids: [],
isPost: false, // 有没有邮寄产品 isPost: false, // 有没有邮寄产品
},
/** showProgressPopup: false,
* 生命周期函数--监听页面加载 reversedProgressList: [] // 数据源
*/ },
onLoad: function (options) {
this.setData({
id:options.id
})
userApi.user_post("user/getCardTypeList").then(res=>{
let cardTypes = {};
res.data.map(item=>{
cardTypes[item.type]=item.title;
})
this.setData({
cardTypes:cardTypes
})
})
},
copy:function(e){
let code = e.currentTarget.dataset.num;
wx.setClipboardData({
data: code,
success: function (res) {
wx.showToast({
title: '复制成功',
icon:'success'
})
}
})
},
getCodeImg:function(){
let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[],codeId=0,arr = [];
this.data.info.order_product_list.forEach(qrcode=>{
qrcode.qrcode.map((item,index)=>{
console.log(qrcode.is_force_display_code);
item.is_force_display_code = qrcode.is_force_display_code
console.log(item.is_force_display_code);
arr.push(index)
this.setData({
imgLen:arr
})
if(item.use_url&&item.use_code){
codeImgs.push({img:item.use_url,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
// if(codeImgs.length==qrcode.qrcode.length){
// that.setData({
// codeImgs:codeImgs
// })
// }
that.setData({
codeImgs:codeImgs
})
}
else {
console.log(item);
new QRCode('damocode'+codeId,{
text: item.use_code,
width: 300 * radio,
height: 300 * radio,
padding:10, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
callback: (res) => {
console.log(res);
codeImgs.push({img:res.path,code:item.use_code,text:item.use_code_display_text,state:item.stateText,is_force_display_code:item.is_force_display_code,flag:item.state});
that.setData({
codeImgs:codeImgs
})
}
})
console.log(this.data.codeImgs);
codeId = codeId + 1
}
})
})
console.log(this.data.imgLen);
console.log(this.data.codeImgs);
},
prevCodeImg:function(){
let qrcode=this.data.codeImgs,codeIndex = this.data.codeIndex;
console.log(codeIndex)
if(codeIndex==0){
this.setData({
codeIndex:qrcode.length-1
})
}
else {
this.setData({
codeIndex:codeIndex-1
})
}
console.log(codeIndex)
},
nextCodeImg:function(){
console.log(this.data.codeImgs);
let qrcode=this.data.codeImgs,codeIndex = this.data.codeIndex;
codeIndex = codeIndex + 1;
if(codeIndex==qrcode.length){
codeIndex = 0;
}
this.setData({
codeIndex:codeIndex
}) /**
}, * 生命周期函数--监听页面加载
showFeeInfo:function(){ */
this.setData({ onLoad: function(options) {
feeInfoFlag:!this.data.feeInfoFlag this.setData({
}) id: options.id
}, })
close:function(){ userApi.user_post("user/getCardTypeList").then(res => {
let _this = this,info = _this.data.info; let cardTypes = {};
wx.showModal({ res.data.map(item => {
title:'提示', cardTypes[item.type] = item.title;
content:"确定取消吗", })
success:function(res){ this.setData({
if(res.confirm){ cardTypes: cardTypes
commonApi.user_post("order/close",{ })
order_id:info.order_id })
}).then(res=>{ },
if(res.code==1){ // 防止弹窗背景滚动
wx.showToast({ preventTouchMove() {
title: '取消成功', return;
icon:'success' },
})
info.state = "CLOSED";
info.order_product_list.map(item=>{
item.state='CLOSED'
})
_this.setData({
info:info
})
}
})
}
}
})
},
refund:function(){
let _this = this,info = _this.data.info;
wx.showModal({
title:'提示',
content:"确定取消吗",
success:function(res){
if(res.confirm){
commonApi.user_post("order/refund",{
order_id:info.order_id
}).then(res=>{
if(res.code==1){
wx.showToast({
title: '取消成功',
icon:'success'
})
info.state = "WAIT_REFUND";
info.order_product_list.map(item=>{
item.state='WAIT_REFUND'
})
_this.setData({
info:info
})
}
})
}
}
})
},
daojishi:function(time){
let now = new Date().getTime();
if(now>time){
clearTimeout(timer);
timer = null;
util.back();
return;
}
let times = time - now,minute = Math.floor(times / (60 * 1000)),second = Math.round((times - minute * 60 * 1000) / 1000);
this.setData({
minute:util.formatNumber(minute),
second:util.formatNumber(second)
})
timer = setTimeout(()=>{
this.daojishi(time);
},1000)
},
// 查看苏康码
gotoSku:function(){
commonApi.user_post("pbservice/Ztfw/sukangCode").then(res=>{
console.log(res)
app.globalData.weburl = res.data.url;
wx.navigateTo({
url: '/pages/pbService/web/index'
})
return;
})
},
goDetail(e){
console.log(e.currentTarget.dataset);
let item = e.currentTarget.dataset.set
// 组合产品 跳线路
if (item.compose_product_id) {
wx.navigateTo({
url: '/pages/info/roadInfo/index?id='+item.compose_product_id
})
return
}
if (item.is_package == 1) {
wx.navigateTo({
url:"/pages/info/postProductInfo/index?id="+item.product_id
})
return
} else if (item.is_package==2) {
wx.navigateTo({
url: '/subPackages/goods/oneCardTour/info/index?id='+item.scene_id
});
return
} else if (item.is_package==3) {
wx.navigateTo({
url: '/subPackages/goods/memberCard/index?id='+item.product_id
});
return
}
if (item.product_model=='ticket') { // 关闭弹窗
wx.navigateTo({ closeProgressPopup() {
url:"/pages/info/sceneProductInfo/index?id="+item.scene_id this.setData({
}) showProgressPopup: false
}else if (item.product_model=='post') { });
wx.navigateTo({ },
url:"/pages/info/postProductInfo/index?id="+item.product_id
})
}
},
showMsg(e){
console.log(e.currentTarget.dataset);
let msg = e.currentTarget.dataset.msg
switch (msg) {
case 'cxr1':
this.setData({
cxr1:!this.data.cxr1,
cxr1Text:this.data.cxr1?'更多':'收起',
}) // 打开弹窗
break; openProgressPopup() {
case 'sysm1': this.setData({
this.setData({ showProgressPopup: true
sysm:!this.data.sysm, });
sysmText:this.data.sysm?'更多':'收起', },
}) copy: function(e) {
break; let code = e.currentTarget.dataset.num;
case 'sysm2': wx.setClipboardData({
this.setData({ data: code,
sysm2:!this.data.sysm2, success: function(res) {
sysm2Text:this.data.sysm2?'更多':'收起', wx.showToast({
}) title: '复制成功',
break; icon: 'success'
default: })
break; }
} })
}, },
/** getCodeImg: function() {
* 生命周期函数--监听页面初次渲染完成 let that = this,
*/ sys = wx.getSystemInfoSync(),
onReady: function () { radio = sys.screenWidth / 750,
qrcode = this.data.info.order_product_list[0].qrcode,
codeImgs = [],
codeId = 0,
arr = [];
this.data.info.order_product_list.forEach(qrcode => {
qrcode.qrcode.map((item, index) => {
console.log(qrcode.is_force_display_code);
item.is_force_display_code = qrcode.is_force_display_code
console.log(item.is_force_display_code);
arr.push(index)
this.setData({
imgLen: arr
})
if (item.use_url && item.use_code) {
codeImgs.push({
img: item.use_url,
code: item.use_code,
text: item.use_code_display_text,
state: item.stateText,
is_force_display_code: item.is_force_display_code,
flag: item.state
});
// if(codeImgs.length==qrcode.qrcode.length){
// that.setData({
// codeImgs:codeImgs
// })
// }
that.setData({
codeImgs: codeImgs
})
} else {
console.log(item);
new QRCode('damocode' + codeId, {
text: item.use_code,
width: 300 * radio,
height: 300 * radio,
padding: 10, // 生成二维码四周自动留边宽度,不传入默认为0
correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
callback: (res) => {
console.log(res);
codeImgs.push({
img: res.path,
code: item.use_code,
text: item.use_code_display_text,
state: item.stateText,
is_force_display_code: item
.is_force_display_code,
flag: item.state
});
that.setData({
codeImgs: codeImgs
})
}
})
console.log(this.data.codeImgs);
codeId = codeId + 1
}
})
})
console.log(this.data.imgLen);
console.log(this.data.codeImgs);
},
prevCodeImg: function() {
let qrcode = this.data.codeImgs,
codeIndex = this.data.codeIndex;
console.log(codeIndex)
if (codeIndex == 0) {
this.setData({
codeIndex: qrcode.length - 1
})
} else {
this.setData({
codeIndex: codeIndex - 1
})
}
console.log(codeIndex)
},
nextCodeImg: function() {
console.log(this.data.codeImgs);
let qrcode = this.data.codeImgs,
codeIndex = this.data.codeIndex;
codeIndex = codeIndex + 1;
if (codeIndex == qrcode.length) {
codeIndex = 0;
}
this.setData({
codeIndex: codeIndex
}, })
},
showFeeInfo: function() {
this.setData({
feeInfoFlag: !this.data.feeInfoFlag
})
},
close: function() {
let _this = this,
info = _this.data.info;
wx.showModal({
title: '提示',
content: "确定取消吗",
success: function(res) {
if (res.confirm) {
commonApi.user_post("order/close", {
order_id: info.order_id
}).then(res => {
if (res.code == 1) {
wx.showToast({
title: '取消成功',
icon: 'success'
})
info.state = "CLOSED";
info.order_product_list.map(item => {
item.state = 'CLOSED'
})
_this.setData({
info: info
})
}
})
}
}
})
},
refund: function() {
let _this = this,
info = _this.data.info;
wx.showModal({
title: '提示',
content: "确定取消吗",
success: function(res) {
if (res.confirm) {
commonApi.user_post("order/refund", {
order_id: info.order_id
}).then(res => {
if (res.code == 1) {
wx.showToast({
title: '取消成功',
icon: 'success'
})
info.state = "WAIT_REFUND";
info.order_product_list.map(item => {
item.state = 'WAIT_REFUND'
})
_this.setData({
info: info
})
}
})
}
}
})
},
daojishi: function(time) {
let now = new Date().getTime();
if (now > time) {
clearTimeout(timer);
timer = null;
util.back();
return;
}
let times = time - now,
minute = Math.floor(times / (60 * 1000)),
second = Math.round((times - minute * 60 * 1000) / 1000);
this.setData({
minute: util.formatNumber(minute),
second: util.formatNumber(second)
})
timer = setTimeout(() => {
this.daojishi(time);
}, 1000)
},
// 查看苏康码
gotoSku: function() {
commonApi.user_post("pbservice/Ztfw/sukangCode").then(res => {
console.log(res)
app.globalData.weburl = res.data.url;
wx.navigateTo({
url: '/pages/pbService/web/index'
})
return;
})
},
goDetail(e) {
console.log(e.currentTarget.dataset);
let item = e.currentTarget.dataset.set
// 组合产品 跳线路
if (item.compose_product_id) {
wx.navigateTo({
url: '/pages/info/roadInfo/index?id=' + item.compose_product_id
})
return
}
if (item.is_package == 1) {
wx.navigateTo({
url: "/pages/info/postProductInfo/index?id=" + item.product_id
})
return
} else if (item.is_package == 2) {
wx.navigateTo({
url: '/subPackages/goods/oneCardTour/info/index?id=' + item.scene_id
});
return
} else if (item.is_package == 3) {
wx.navigateTo({
url: '/subPackages/goods/memberCard/index?id=' + item.product_id
});
return
}
/** if (item.product_model == 'ticket') {
* 生命周期函数--监听页面显示 wx.navigateTo({
*/ url: "/pages/info/sceneProductInfo/index?id=" + item.scene_id
onShow: function () { })
commonApi.user_post("order/query",{ } else if (item.product_model == 'post') {
order_id:this.data.id wx.navigateTo({
}).then(res=>{ url: "/pages/info/postProductInfo/index?id=" + item.product_id
if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){ })
let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000); }
this.daojishi(time); },
} showMsg(e) {
let proId = [] console.log(e.currentTarget.dataset);
res.data.order_product_list.forEach(item => { let msg = e.currentTarget.dataset.msg
proId.push(item.product_id) switch (msg) {
}) case 'cxr1':
let state = "" this.setData({
res.data.order_product_list.map(order=>{ cxr1: !this.data.cxr1,
order.qrcode.map(item=>{ cxr1Text: this.data.cxr1 ? '更多' : '收起',
item.stateText = app.globalData.codeState[item.state];
})
order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[];
state = state + order.state;
})
this.setData({
isRefund:state.indexOf("REFUND")!=-1,
info:res.data,
product_model:"ticket"||res.data.order_product_list[0].product_model,
ids: proId.join(","),
isPost: res.data.order_product_list.some(x=>x.product_model == 'post'),
})
console.log(res.data);
// debugger
console.log('ids',this.data.ids);
this.getCodeImg()
// 获取行程规划
let that = this;
wx.getLocation({
type: 'gcj02',
success: function (r) {
let ajaxes=[];
res.data.order_product_list.map(item=>{
ajaxes.push(commonApi.user_post("order/tripplan",{
point_type:"gd",
child_order_id:item.child_order_id,
lon:r.longitude,
lat:r.latitude
}))
})
Promise.all(ajaxes).then(r=>{
console.log(r)
let orderInfo = that.data.info;
r.map((item,index)=>{
if(item && item.data && item.data.url){
orderInfo.order_product_list[index].btnUrl = item.data.url;
}
})
that.setData({
info:orderInfo
})
})
}
})
})
},
// 行程规划
leadRoad:function(e){
let url = e.currentTarget.dataset.url;
app.globalData.weburl = url;
wx.navigateTo({
url: '/pages/pbService/web/index'
})
},
expandPost:function (e) { })
let index = e.currentTarget.dataset.index break;
let productList = this.data.info.order_product_list case 'sysm1':
let item = productList[index] this.setData({
item.showMore = !item.showMore sysm: !this.data.sysm,
this.setData({ sysmText: this.data.sysm ? '更多' : '收起',
info: this.data.info })
}) break;
}, case 'sysm2':
this.setData({
sysm2: !this.data.sysm2,
sysm2Text: this.data.sysm2 ? '更多' : '收起',
})
break;
default:
break;
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
expandMsg: function(e) { },
let index = e.currentTarget.dataset.index
let productList = this.data.info.order_product_list
let item = productList[index]
item.showMsg = !item.showMsg
this.setData({
info: this.data.info
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面显示
*/ */
onHide: function () { onShow: function() {
clearTimeout(timer) commonApi.user_post("order/query", {
timer = null order_id: this.data.id
}, }).then(res => {
if (res.data.create_time && res.data.auto_close_time && res.data.state == 'UNPAID') {
let time = (new Date(res.data.create_time.replace(/-/g, '/')).getTime() + Number(res
.data.auto_close_time) * 1000);
this.daojishi(time);
}
let proId = []
res.data.order_product_list.forEach(item => {
proId.push(item.product_id)
})
let state = ""
res.data.order_product_list.map(order => {
order.qrcode.map(item => {
item.stateText = app.globalData.codeState[item.state];
})
order.contacts_info = order.contacts_info ? JSON.parse(order
.contacts_info) : [];
state = state + order.state;
})
let reversedList = [...res.data.reservation_log].reverse();
this.setData({
isRefund: state.indexOf("REFUND") != -1,
info: res.data,
product_model: "ticket" || res.data.order_product_list[0].product_model,
ids: proId.join(","),
isPost: res.data.order_product_list.some(x => x.product_model == 'post'),
reversedProgressList: reversedList
})
console.log(res.data);
// debugger
console.log('ids', this.data.ids);
this.getCodeImg()
// 获取行程规划
let that = this;
wx.getLocation({
type: 'gcj02',
success: function(r) {
let ajaxes = [];
res.data.order_product_list.map(item => {
ajaxes.push(commonApi.user_post("order/tripplan", {
point_type: "gd",
child_order_id: item.child_order_id,
lon: r.longitude,
lat: r.latitude
}))
})
Promise.all(ajaxes).then(r => {
console.log(r)
let orderInfo = that.data.info;
r.map((item, index) => {
if (item && item.data && item.data.url) {
orderInfo.order_product_list[index]
.btnUrl = item.data.url;
}
})
that.setData({
info: orderInfo
})
})
}
})
})
},
// 行程规划
leadRoad: function(e) {
let url = e.currentTarget.dataset.url;
app.globalData.weburl = url;
wx.navigateTo({
url: '/pages/pbService/web/index'
})
},
/** expandPost: function(e) {
* 生命周期函数--监听页面卸载 let index = e.currentTarget.dataset.index
*/ let productList = this.data.info.order_product_list
onUnload: function () { let item = productList[index]
item.showMore = !item.showMore
this.setData({
info: this.data.info
})
},
}, expandMsg: function(e) {
let index = e.currentTarget.dataset.index
let productList = this.data.info.order_product_list
let item = productList[index]
item.showMsg = !item.showMsg
this.setData({
info: this.data.info
})
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 生命周期函数--监听页面隐藏
*/ */
onPullDownRefresh: function () { onHide: function() {
clearTimeout(timer)
timer = null
},
}, /**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
/** },
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
} /**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
}
}) })

70
pages/user/order/sceneOrderInfo/index.wxml

@ -4,11 +4,23 @@
<view class="top-bg"></view> <view class="top-bg"></view>
<canvas wx:for="{{imgLen}}" class="code-img" style="position:absolute;z-index:-1;" canvas-id="damocode{{index}}"></canvas> <canvas wx:for="{{imgLen}}" class="code-img" style="position:absolute;z-index:-1;" canvas-id="damocode{{index}}"></canvas>
<view class="state-text" wx:if="{{info}}"> <view class="state-text" wx:if="{{info}}">
{{info.state_text}} <view class="state-texts">
{{info.state_text}}
<block wx-if="{{info.order_type == 'reservation' || info.order_type == 'reserve'}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/order/loading.gif"></image>
<view class="progress-box" catchtap="openProgressPopup">查看进度 ></view>
</block>
</view>
<navigator url="/pages/user/service/index" class="kefu-img"> <navigator url="/pages/user/service/index" class="kefu-img">
<image lazy-load src="https://static.ticket.sz-trip.com/jundaosuzhou/images/movieKefu.png" mode="widthFix"></image> <image lazy-load src="https://static.ticket.sz-trip.com/jundaosuzhou/images/movieKefu.png" mode="widthFix"></image>
</navigator> </navigator>
</view> </view>
<view class="order-text" wx-if="{{info.order_type == 'reservation' || info.order_type == 'reserve'}}">
<view wx-if="{{info.order_type == 'reservation'}}">
我们将于{{info.reservation_date}} 00:00为您预约抢票,最晚在{{info.reservation_date}}
09:30前告知抢票结果,请您耐心等待
</view>
</view>
<!-- <view class="code-box box" wx:if="{{info && codeImgs.length>0}}"> <!-- <view class="code-box box" wx:if="{{info && codeImgs.length>0}}">
<view bindtap="prevCodeImg" class="iconfont icon-you-copy"></view> <view bindtap="prevCodeImg" class="iconfont icon-you-copy"></view>
<view wx:for="{{info.order_product_list[0].qrcode}}" wx:if="{{codeIndex==index && codeImgs[codeIndex]}}"> <view wx:for="{{info.order_product_list[0].qrcode}}" wx:if="{{codeIndex==index && codeImgs[codeIndex]}}">
@ -315,3 +327,59 @@
<view class="mask-item"><text>订单实付</text><text>¥{{info.paid_money/100}}</text></view> <view class="mask-item"><text>订单实付</text><text>¥{{info.paid_money/100}}</text></view>
</view> </view>
</view> </view>
<!-- 自定义底部弹窗 -->
<!-- catchtouchmove 用于防止弹窗出现时底部页面还可以滚动 -->
<view class="custom-popup" wx:if="{{showProgressPopup}}" catchtouchmove="preventTouchMove">
<!-- 遮罩层 (点击关闭) -->
<view class="popup-mask" bindtap="closeProgressPopup"></view>
<!-- 弹窗内容容器 -->
<view class="popup-container">
<!-- 头部 -->
<view class="popup-header">
<view class="title">预订进度</view>
<!-- 关闭按钮 -->
<view class="close-btn" bindtap="closeProgressPopup">×</view>
</view>
<!-- 内容区 (可滚动) -->
<scroll-view scroll-y class="progress-content">
<view class="content-padding">
<!-- 列表循环 -->
<view class="timeline-item" wx:for="{{reversedProgressList}}" wx:key="index">
<!-- 左侧轴线 -->
<view class="timeline-left">
<!-- 连接线 -->
<view
class="line {{item.status == 1 && reversedProgressList[index+1].status == 1 ? 'active-line' : ''}}"
wx:if="{{index < reversedProgressList.length - 1}}"
></view>
<!-- 1. 抢票中 -->
<view class="icon-box processing" wx:if="{{item.status == 1 && item.remark == '抢票中'}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/order/loading.gif" class="loading-img" mode="aspectFit"></image>
</view>
<!-- 2. 其他已完成 (用CSS画对勾) -->
<view class="icon-box finished" wx:elif="{{item.status == 1}}">
<view class="css-checkmark"></view>
</view>
<!-- 3. 未完成 -->
<view class="icon-box pending" wx:else></view>
</view>
<!-- 右侧内容 -->
<view class="timeline-right">
<view class="item-title">{{ item.remark }}</view>
<view class="item-time" wx:if="{{item.execution_time}}">{{ item.execution_time }}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>

214
pages/user/order/sceneOrderInfo/index.wxss

@ -19,6 +19,27 @@ page {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.progress-box {
width: 148rpx;
height: 41rpx;
border-radius: 20rpx;
border: 1rpx solid #FFFFFF;
line-height: 41rpx;
text-align: center;
box-sizing: border-box;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
}
.state-texts {
display: flex;
align-items: center;
}
.state-texts image {
width: 40rpx;
height: 40rpx;
margin: 0 14rpx;
}
.kefu-img{width: 85rpx;height: 85rpx;} .kefu-img{width: 85rpx;height: 85rpx;}
.kefu-img image{width: 85rpx;height: 85rpx;} .kefu-img image{width: 85rpx;height: 85rpx;}
.box { .box {
@ -383,3 +404,196 @@ page {
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
/* --- 弹窗容器 --- */
.custom-popup {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 9999;
}
.popup-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.popup-container {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
/* 调整:最大高度从 80% 降到 60%,更协调 */
max-height: 60vh;
min-height: 40vh;
background: #fff;
border-radius: 24rpx 24rpx 0 0;
display: flex;
flex-direction: column;
/* animation: slideUp 0.3s ease-out; */
padding-bottom: env(safe-area-inset-bottom); /* 适配iPhone底部黑条 */
}
@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
/* --- 头部 --- */
.popup-header {
position: relative;
/* 调整:减小头部上下内边距 */
padding: 30rpx 0;
text-align: center;
flex-shrink: 0;
border-bottom: 1rpx solid #f5f5f5;
}
.popup-header .title {
/* 调整:标题字号 48 -> 36 */
font-size: 36rpx;
font-weight: bold;
color: #333;
}
.popup-header .close-btn {
position: absolute;
right: 20rpx;
top: 20rpx; /* 随 padding 调整 */
font-size: 50rpx; /* 60 -> 50 */
color: #999;
padding: 10rpx 20rpx;
line-height: 1;
}
/* --- 内容区 --- */
.progress-content {
flex: 1;
height: 0;
}
.content-padding {
padding: 30rpx 40rpx 50rpx;
}
.timeline-item {
display: flex;
min-height: 120rpx;
position: relative;
}
/* 左侧轴 */
.timeline-left {
width: 60rpx;
display: flex;
flex-direction: column;
align-items: center;
flex-shrink: 0;
position: relative;
}
/* 线条 */
.timeline-left .line {
position: absolute;
width: 2rpx;
background-color: #E5E5E5;
top: 36rpx;
height: 100%;
left: 50%;
transform: translateX(-50%);
z-index: 1;
}
.timeline-left .line.active-line {
background-color: #0B898E;
}
/* 图标容器通用 */
.icon-box {
margin-top: 10rpx;
z-index: 2;
background-color: #fff;
box-sizing: border-box;
}
/* 1. 灰色圆点 */
.icon-box.pending {
width: 32rpx;
height: 32rpx;
background-color: #E0E0E0; /* 颜色稍微深一点点 */
border-radius: 50%;
box-shadow: 0 0 0 6rpx #fff;
}
/* 2. 完成态 */
.icon-box.finished {
width: 32rpx;
height: 32rpx;
background-color: #0B898E;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0 0 6rpx #fff;
}
/* 纯CSS画对勾 */
.css-checkmark {
width: 8rpx;
height: 14rpx;
border-bottom: 3rpx solid #fff; /* 4 -> 3 */
border-right: 3rpx solid #fff;
transform: rotate(45deg);
margin-bottom: 2rpx;
}
/* 3. 进行中 */
.icon-box.processing {
width: 36rpx;
height: 36rpx;
background: #0B898E;
border-radius: 50%;
box-shadow: 0 0 0 6rpx #fff;
margin-top: 8rpx;
display: flex;
align-items: center;
justify-content: center;
}
.loading-img {
width: 60%;
height: 60%;
}
/* 右侧文字 */
.timeline-right {
flex: 1;
padding-left: 24rpx;
padding-top: 4rpx;
padding-bottom: 40rpx;
}
.item-title {
font-size: 30rpx;
color: #333;
font-weight: 500;
margin-bottom: 10rpx;
}
.item-time {
font-size: 24rpx;
color: #999;
}
.order-text {
font-weight: 500;
font-size: 25rpx;
color: #FFFFFF;
padding: 0 32rpx;
}
Loading…
Cancel
Save