chenkainan 7 months ago
parent
commit
66e70a0e22
  1. 28
      pages.json
  2. 104
      pages/index/index.vue
  3. 8
      pages/map/map.vue
  4. BIN
      static/images/home.png
  5. BIN
      static/images/map.png
  6. BIN
      static/images/mine.png
  7. BIN
      static/images/selectHome.png
  8. BIN
      static/images/selectMap.png
  9. BIN
      static/images/selectMine.png
  10. 123
      static/js/CommonFunction.js
  11. 3
      static/js/request.js
  12. 1578
      subPackages/order/detail.vue
  13. 424
      subPackages/order/orderCoupon.vue
  14. 400
      subPackages/order/orderPay.vue
  15. 2
      subPackages/peripheralActivity/peripheralActivity.vue
  16. 27
      subPackages/webPage/webPage.vue

28
pages.json

@ -13,6 +13,13 @@
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
}, },
{
"path": "pages/map/map",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "智游常熟"
}
},
{ {
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {
@ -101,6 +108,12 @@
"navigationBarTitleText": "全部订单" "navigationBarTitleText": "全部订单"
} }
}, },
{
"path": "order/orderPay",
"style": {
"navigationBarTitleText": "支付"
}
},
{ {
"path": "eventCalendar/eventCalendar", "path": "eventCalendar/eventCalendar",
"style": { "style": {
@ -113,12 +126,19 @@
"style": { "style": {
"navigationBarTitleText": "活动详情" "navigationBarTitleText": "活动详情"
} }
},
{
"path": "webPage/webPage",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
} }
] ]
}], }],
"tabBar": { "tabBar": {
"color": "#999999", "color": "#999999",
"selectedColor": "#333333", "selectedColor": "#00AEA0",
"borderStyle": "black", "borderStyle": "black",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"fontSize": "24rpx", "fontSize": "24rpx",
@ -130,6 +150,12 @@
"selectedIconPath": "/static/images/selectHome.png", "selectedIconPath": "/static/images/selectHome.png",
"text": "首页" "text": "首页"
}, },
{
"pagePath": "pages/map/map",
"iconPath": "/static/images/map.png",
"selectedIconPath": "/static/images/selectMap.png",
"text": "地图"
},
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user",
"iconPath": "/static/images/mine.png", "iconPath": "/static/images/mine.png",

104
pages/index/index.vue

@ -29,12 +29,12 @@
<!-- 常熟精选 --> <!-- 常熟精选 -->
<image src="https://static.ticket.sz-trip.com/changshu/images/index/title1.png" mode="heightFix" class="title-img"></image> <image src="https://static.ticket.sz-trip.com/changshu/images/index/title1.png" mode="heightFix" class="title-img"></image>
<view class="winnow-box"> <view class="winnow-box">
<view v-for="(item,index) in winnowList" :key="index"> <view v-for="(item,index) in winnowList" :key="index" @click.stop="gotoUrlNew(item.url)">
<view class="winnow-title flex-between"> <view class="winnow-title flex-between">
{{item.title}} {{item.title}}
<span :style="{color: item.spanColor}">查看更多产品 ></span> <span :style="{color: item.spanColor}">查看更多产品 ></span>
</view> </view>
<view class="winnow-item" v-for="(pItem, pIndex) in item.list" :key="pIndex"> <view class="winnow-item" v-for="(pItem, pIndex) in item.list" :key="pIndex" @click="gotoDetailByTypeToJdsz(pItem)">
<image :src="showImgs(pItem.headimg)" mode="aspectFill" class="winnow-img"></image> <image :src="showImgs(pItem.headimg)" mode="aspectFill" class="winnow-img"></image>
<view class="winnow-content flex-column"> <view class="winnow-content flex-column">
<view class="title text-overflowRows">{{pItem.title}}</view> <view class="title text-overflowRows">{{pItem.title}}</view>
@ -51,7 +51,7 @@
<view v-if="calendarItem"> <view v-if="calendarItem">
<image src="https://static.ticket.sz-trip.com/changshu/images/index/title2.png" mode="heightFix" class="title-img"></image> <image src="https://static.ticket.sz-trip.com/changshu/images/index/title2.png" mode="heightFix" class="title-img"></image>
<view class="calendar-item"> <view class="calendar-item" @click="calendarItem.type='calendar';gotoDetailByTypeToJdsz(calendarItem)">
<image :src="showImgs(calendarItem.post_url)" mode="aspectFill" class="calendar-img"></image> <image :src="showImgs(calendarItem.post_url)" mode="aspectFill" class="calendar-img"></image>
<view class="calendar-content flex-column"> <view class="calendar-content flex-column">
<view class="title text-overflow">{{calendarItem.name}}</view> <view class="title text-overflow">{{calendarItem.name}}</view>
@ -87,7 +87,7 @@
<view class="hot-box"> <view class="hot-box">
<view class="hot-column" v-for="(column, index) in 2" :key="index"> <view class="hot-column" v-for="(column, index) in 2" :key="index">
<view v-for="(item,index) in getColumnItems(index)" :key="index" class="hot-item"> <view v-for="(item,index) in getColumnItems(index)" :key="index" class="hot-item" @click="gotoDetailByTypeToJdsz(item)">
<view class="image-container"> <view class="image-container">
<image :src="showImgs(item.headimg || item.head_img || item.post_url)" mode="widthFix" class="hot-img"></image> <image :src="showImgs(item.headimg || item.head_img || item.post_url)" mode="widthFix" class="hot-img"></image>
<image src="https://static.ticket.sz-trip.com/changshu/images/index/play.png" mode="" class="play-img" v-if="typeIndex == 5"></image> <image src="https://static.ticket.sz-trip.com/changshu/images/index/play.png" mode="" class="play-img" v-if="typeIndex == 5"></image>
@ -178,13 +178,21 @@
title: '景点', title: '景点',
id: '619', id: '619',
spanColor: '#529AE7', spanColor: '#529AE7',
list: [] list: [],
url: {
jump_type:3,
tdata: 'https://m.cloud.sz-trip.com/AttractionsTickets'
}
}, },
{ {
title: '特产', title: '特产',
id: '620', id: '620',
spanColor: '#EE710C', spanColor: '#EE710C',
list: [] list: [],
url: {
jump_type:3,
tdata: 'https://m.cloud.sz-trip.com/CulturalCreation'
}
} }
], ],
calendarItem: {}, calendarItem: {},
@ -269,6 +277,82 @@
}, 500); }, 500);
}, },
methods: { methods: {
// banner
// 234
gotoUrlNew(item) {
console.log(item);
let that = this;
let url = '';
switch (item.jump_type) {
case 0:
break;
case 2:
uni.navigateTo({
url: item.tdata
});
break;
case 3:
let isJDSZ = this.goJDSZMiniProgram(item.tdata)
if (isJDSZ) return
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + item.tdata
});
break;
case 4:
uni.navigateToMiniProgram({
appId: item.tdata.appid, // appid
path: item.tdata.page, //
envVersion: 'release',
success: res => {
//
console.log('打开成功', res);
},
fail: err => {
console.log(err);
}
});
break;
default:
break;
}
},
//
goJDSZMiniProgram (tpage) {
if (tpage.indexOf('m.cloud.sz-trip.com') > -1) {
//
let userInfo = null
try {
userInfo = JSON.parse(uni.getStorageSync('userInfo'))
} catch(e) {}
if (userInfo && userInfo.token && !userInfo.mobile) {
uni.showToast({
title: '未授权手机号',
icon: 'none'
})
//
setTimeout(()=>{
uni.navigateTo({
url: '/pages/login/login?needAuth=1'
})
},200)
return true
}
// code
this.checkIsLoginJdsz().then(res => {
if(res) {
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(`${tpage}?token=` + res + '&isKunshan=1')
});
}
})
return true
}
return false
},
// //
getColumnItems(columnIndex) { getColumnItems(columnIndex) {
const columnItems = []; const columnItems = [];
@ -282,9 +366,8 @@
getBanner() { getBanner() {
// banner // banner
this.Post({ this.Post({
apiType: 'jdsz', type_id: 3,
type_id: 5, position: 6,
position: 0,
}, '/api/adv/getAdv').then(res => { }, '/api/adv/getAdv').then(res => {
if(res) { if(res) {
this.topBanner = res.data this.topBanner = res.data
@ -293,8 +376,7 @@
// banner // banner
this.Post({ this.Post({
apiType: 'jdsz', type_id: 3,
type_id: 5,
position: 1, position: 1,
}, '/api/adv/getAdv').then(res => { }, '/api/adv/getAdv').then(res => {
if(res) { if(res) {

8
pages/map/map.vue

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

BIN
static/images/home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
static/images/map.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/images/mine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
static/images/selectHome.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/images/selectMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
static/images/selectMine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 14 KiB

123
static/js/CommonFunction.js

@ -233,7 +233,128 @@ Vue.prototype.getHeadImg = type => {
}); });
} }
// 判断君到苏州token是否生效
Vue.prototype.checkIsLoginJdsz = () => {
Vue.prototype.Post({
apiType: 'jdsz',
}, '/api/uservice/user/getMyInfo').then(res => {
if(res.code == 1 || res.code == 200) {
return res.data.token
}else if(res.code == 401) {
// 重新登陆
Vue.prototype.Post({}, '/api/user/getAuthCode').then(res => {
if (res.code == 1 || res.code == 200) {
Vue.prototype.Post({
apiType: 'jdsz',
}, '/api/uservice/user/loginBykunshan').then(res => {
if(res.data.code == 401) {
this.$store.commit('changeLoginPath')
return;
}
uni.setStorageSync('jdszToken', res.data.data.token)
})
}
}).catch(res => {
if (res.data.code == 201) {
uni.showToast({
title: '未授权手机号',
icon: 'none'
})
// 去登录页面授权
setTimeout(()=>{
uni.navigateTo({
url: '/pages/login/login?needAuth=1'
})
},400)
}
})
}
})
}
// 跳转君到苏州详情 // 跳转君到苏州详情
Vue.prototype.gotoDetailByType = item => { Vue.prototype.gotoDetailByTypeToJdsz = item => {
let httpUrl = 'https://m.cloud.sz-trip.com/'
let url = ''
// 酒景套餐
if (item.is_package) {
url = httpUrl + 'MailMerchandiseDetail?id=' + item.id
}
switch (item.type) {
case 'ticket': // 是产品的 票务
url = httpUrl + 'ScenicDetail?id=' + item.scene_id || item.id
break;
case 'hotel': // 是产品的 酒店
url = httpUrl + 'HotelDetail?id=' + item.scene_id || item.id
break;
case 'post': // 是产品的 邮寄
url = httpUrl + 'MailMerchandiseDetail?id=' + item.id
break;
case 'line': // 是产品的 线路
url = httpUrl + 'LineDetail?id=' + item.id
break;
case 'coupon': // 是产品的 卡券
url = httpUrl + 'CardDetail?id=' + item.id
break;
case 'show': // 是产品的 演出
url = httpUrl + 'PerformDetail?id=' + item.id
break;
case 'food': // 是产品的 食品
url = httpUrl + 'FoodDetail?id=' + item.id
break;
case 'activity': // 是产品的 活动 todo 这里要弄成是活动的id去跳转的,特别是从 江苏夜游过去的
url = httpUrl + 'AppointmentDetail?id=' + item.act_calendar_id || item.id
break;
case 'calendar': // ai入口活动日历
url = httpUrl + 'AppointmentDetail?id=' + item.id
break;
case 'movie': // 是产品的 电影
url = httpUrl + 'MovieDetail?id=' + item.third_id || item.id
break;
case 'scenic': // 是场景的 景点
url = httpUrl + 'ScenicDetail?id=' + item.scene_id || item.id
break;
case 'room': // 是场景的 酒店
url = httpUrl + 'HotelDetail?id=' + item.scene_id || item.id
break;
case 'restaurant': // 是场景 美食
url = httpUrl + 'RestaurantDetail?id=' + item.id
break;
case 'tenscenic': // 是场景 十景
url = httpUrl + 'TenScenicDetail?id=' + item.id
break;
case 'venue': // 是场景的 场馆
url = httpUrl + 'PavilionDetail?id=' + item.scene_id || item.id
break;
case 'cinema': // 是场景的 影院
url = httpUrl + 'CinemaDetail?id=' + item.third_id || item.id
break;
case 'relic': // 文物
url = httpUrl + 'ProtectionUnitsInfo?id=' + item.id
break;
case 'units': // 文化单位
url = httpUrl + 'CulturalUnitInfo?id=' + item.id
break;
case 'red_map': // 红色地图
url = httpUrl + 'RedTouristInfo?id=' + item.id
break;
case 'travels': // 红色地图
url = httpUrl + 'TravelNotesIntroductionInfo?id=' + item.id
break;
}
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(url)
});
return;
Vue.prototype.checkIsLoginJdsz().then(res => {
if(res) {
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(url + '&token=' + res)
});
}
})
} }

3
static/js/request.js

@ -15,8 +15,7 @@ const getToken = () => {
return userInfo.token; return userInfo.token;
} }
} }
// return store.state.user.userInfo.token; return store.state.user.userInfo.token;
return "ce870b90-d976-42b7-b4d8-d2957316886b"
}; };
// 定义错误处理函数 // 定义错误处理函数

1578
subPackages/order/detail.vue

File diff suppressed because it is too large

424
subPackages/order/orderCoupon.vue

@ -0,0 +1,424 @@
<template>
<view class="bg">
<!-- 列表 -->
<view class="coupon-list" v-if="list.length>0">
<view class="coupon-item" v-for="(item, index) in list" :key="index">
<!-- 分割线上部分 -->
<view class="item-top">
<view class="top-left">
<view class="price" v-if="item.type == 1">
<span>{{item.discounts/100}}</span>
</view>
<view class="price" v-else>
<span>{{getPecenet(item.percent)}}</span>
</view>
<view class="subtitle">
{{item.min_limit/100}}元可用
</view>
</view>
<view class="top-right">
<view class="title">
{{item.title}}
</view>
<view class="time">
{{item.open_time.slice(0,10)}}-{{item.end_time.slice(0,10)}}可用
</view>
</view>
<image class="selected" v-if="item.selected" @click="selectCoupon(item,index)" src="https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230418/c588002859433c217602260b0228b977.png" mode=""></image>
<view v-else class="yuan" @click="selectCoupon(item,index)"></view>
</view>
<!-- 分割线 -->
<view class="item-circle">
<view class="circle left"></view>
<view class="line"></view>
<view class="circle right"></view>
</view>
<!-- 分割线下部分 -->
<view class="item-bottom">
<view class="rules" @click="changeRules(item,index)">
<span v-if="!item.openRules">使用规则{{item.content}}</span>
<view class="open" v-else>使用规则{{item.content}}</view>
<image v-if="!item.openRules" src="https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230415/6a7630c176f976bb16674dde482779fb.png" mode=""></image>
<image v-else src="https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230415/f0073b18b3ab88cac62de60411360fc1.png" mode=""></image>
</view>
</view>
</view>
</view>
<view v-else class="noCoupon">
<img :src="showImg('/uploads/20240902/376de17481e3010f50305be570009745.png')" class="no-couPon">
<view>暂无优惠券</view>
</view>
<view class="bottom-btn" v-if="list.length>0">
<view class="left" v-if="item.percent == 0">
优惠
<span style="font-size: 24rpx;color:#FC5109;margin-left: 19.33rpx;"></span>
<span style="font-size: 48rpx;color:#FC5109;font-weight: bold;">{{reducePrice}}</span>
</view>
<view class="left" v-else>
优惠
<span style="font-size: 48rpx;color:#FC5109;font-weight: bold;">{{reducePrice}}</span>
</view>
<!-- <view class="sure" @click="setCoupon(reducePrice*100)"> -->
<view class="sure" @click="setCoupon(coupon)">
确定
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
openRules: false,
list:[],
couponSel:false,
allPrice:0,
sku_ids:'',
reducePrice: 0,
coupon:{},
needDefault:false
}
},
onShow() {
this.getList();
},
onLoad(options) {
this.allPrice = (options.allprice) /100
this.sku_ids = options.sku_ids
this.needDefault = options.needDefault
console.log('11111',options);
},
methods: {
getPecenet:function (percent) {
if(percent>=100 || percent<=0) return "";
percent = 100 - percent;
if(percent%10==0){
percent = percent/10;
}
return percent
},
//
selectCoupon(item,index) {
let list = this.list
list.forEach((Item, Index) => {
if (Index === index) {
Item.selected = !Item.selected
} else {
Item.selected = false
}
})
this.list = list
console.log('选中的',this.list[index].selected);
if(this.list[index].selected) {
if (item.type == 1) {
this.reducePrice = this.list[index].discounts/100+'元'
this.coupon = item
} else{
this.coupon = item
this.reducePrice = this.getPecenet(item.percent)+'折'
}
}else {
this.reducePrice = 0
this.coupon = {}
}
this.$forceUpdate()
},
// 使
changeRules(item,index){
let coupons = this.list
coupons.forEach((Item, Index) => {
if (Index === index) {
Item.openRules = !Item.openRules
} else {
Item.openRules = false
}
})
this.list = coupons
this.$forceUpdate()
},
//
showNoPriceNew(price) {
if (price && price > 0) {
return (price / 100)
} else {
return '0'
}
},
getList:function () {
this.Post({
money:this.allPrice,
sku_ids:this.sku_ids
}, "/api/coupon/use_coupon_list").then((res) => {
this.list = res.data
this.list.forEach(item => {
item.selected = false
})
if (this.needDefault) {
this.calMaxCost()
}
})
},
setCoupon(item) {
if (item.id) {
console.log('选择的优惠券',item);
this.$store.commit("choseCoupon",item);
} else{
this.$store.commit("choseCoupon","");
}
uni.navigateBack({
delta: 1
})
},
//
calMaxCost () {
let maxCost = {}
let maxCostPrice = 0
let index = -1
this.list.forEach((item,i)=>{
let reducePrice = 0
if (item.type == 1) {
reducePrice = item.discounts/100
} else{
reducePrice = this.allPrice * (100-item.percent)/100
}
if (reducePrice > maxCostPrice) {
maxCostPrice = reducePrice
maxCost = item
index = i
}
})
if (maxCost.id) {
this.selectCoupon(maxCost, index)
}
}
}
}
</script>
<style scoped>
.bg {
background: #F7F7F7;
min-height: 100vh;
}
.coupon-list .coupon-item .item-circle {
line-height: 1rpx;
height: 1rpx;
width: 652rpx;
}
.coupon-list .coupon-item .item-circle .line {
border-bottom: 1px dashed #ccc;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: .1rpx;
margin: auto;
z-index: 9;
}
.coupon-list .coupon-item .item-circle .circle {
position: absolute;
top: 0;
bottom: 0;
margin: auto;
border-radius: 50%;
background: #ccc;
width: .46rpx;
height: .46rpx;
z-index: 10;
}
.coupon-list .coupon-item .item-circle .circle.left{
left:-.23rpx;
}
.coupon-list .coupon-item .item-circle .circle.right{
right: -.23rpx;
}
.item-bottom {
padding: 16rpx 20rpx;
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.item-bottom .rules {
font-size: 24rpx;
font-weight: 500;
color: #999;
display: flex;
line-height: 47rpx;
}
.item-bottom .rules span {
width: 570rpx;
overflow: hidden; //
white-space: nowrap; //
text-overflow: ellipsis;
}
.item-bottom .rules image {
width: 20rpx;
height: 20rpx;
margin-left: 20rpx;
margin-top: 15rpx;
}
.open {
width: 570rpx;
min-height: 30rpx;
flex-wrap: wrap;
}
.coupon-item {
margin: 20.67rpx 26.67rpx;
background: #fff;
}
.coupon-list .coupon-item .item-top {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 16rpx 24rpx 36rpx;
}
.coupon-item .item-top .price {
font-size: 25rpx;
font-weight: bold;
color: #FC5209;
display: flex;
align-items: baseline;
justify-content: center;
}
.coupon-item .item-top .price span {
font-size: 67rpx;
margin-right: 6.67rpx;
}
.top-left .subtitle {
width: 100%;
font-size: 24rpx;
color: #FC5209;
padding-left: 6rpx;
overflow: hidden;
white-space: nowrap;
}
.top-right {
width: 336rpx;
margin-left: 46.67rpx;
font-size: 25rpx;
font-weight: 500;
color: #111;
}
.top-right .title {
margin-bottom: 26rpx;
font-size: 31rpx;
font-weight: bold;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item-bottom {
padding: 16rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.item-bottom .use {
width: 133rpx;
height: 47rpx;
border: 1px solid #FC5209;
border-radius: 23rpx;
text-align: center;
font-size: 25rpx;
font-weight: 500;
color: #fc5209;
line-height: 47rpx;
}
.coupon-list{
background: #F7F7F7;
min-height: 100vh;
padding: 20rpx 20rpx 160rpx;
}
.coupon-list .coupon-item {
background: #ffffff;
border-radius: 13rpx;
}
.yuan {
width: 37rpx;
height: 37rpx;
border: 1px solid #FC5209;
border-radius: 20rpx;
margin-right: 16rpx;
}
.selected {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.bottom-btn {
/* width: 100%; */
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 22rpx 50rpx 64rpx 50.67rpx;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom-btn .left {
font-size: 28rpx;
font-weight: 500;
color: #393B3E;
}
.sure {
width: 250rpx;
height: 80rpx;
background: linear-gradient(270deg, #FC6712, #FD9526);
color: #fff;
font-size: 32rpx;
font-weight: bold;
text-align: center;
line-height: 80rpx;
border-radius: 50rpx;
}
.top-left {
width: 136rpx;
}
.top-left .price {
width: 100%;
overflow: hidden;
white-space: nowrap;
}
.noCoupon{
padding-top: 524rpx;
text-align: center;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.no-couPon{
width: 173rpx;
height: 173rpx;
margin-bottom: 15rpx;
}
</style>

400
subPackages/order/orderPay.vue

@ -0,0 +1,400 @@
<template>
<view class="bg">
<view class="title">支付剩余时间</view>
<view class="time-box">
<uni-countdown :font-size="40" :show-day="false" :hour="times.hours" :minute="times.minutes"
:second="times.seconds" @timeup="timeup"></uni-countdown>
</view>
<view class="money-box" style="padding-bottom: 30rpx;">
<view>应付金额</view>
<view style="color: red;">{{detail.paid_money / 100}}</view>
</view>
<view class="money-box" style="border-bottom: none;">
<view>支付方式:</view>
</view>
<!-- 优惠券 -->
<view v-if="coupon_activity">
<view class="pay-box" @click="payType = 1" v-if="pay_type.includes('WEIXIN')">
<view style="display: flex; align-items: center;">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/wxPay.png" mode="widthFix"></image>
微信支付
</view>
<view class="select-box">
<view class="select" v-if="payType == 1"></view>
</view>
</view>
<view v-if="walletList.length > 0 && pay_type.includes('SUBWALLET')">
<view class="pay-box">
<view style="display: flex; align-items: center;">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/numLogo.png" mode="widthFix">
</image>
数字人民币子钱包支付
</view>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/selectB.png" class="select-img"
mode="widthFix" :style="{'transform': showMore ? 'rotate(180deg)' : ''}"
@click="showMore = !showMore"></image>
</view>
<view v-show="showMore" style="padding-left: 40rpx;">
<view class="pay-box" v-for="(item,index) in walletList" :key="index" @click="payType = 2;walletIndex = index">
<view style="display: flex; align-items: center;">
<image :src="item.bank_logo" mode="widthFix"></image>
{{item.bank_name}}
</view>
<view class="select-box">
<view class="select" v-if="payType == 2 && walletIndex === index"></view>
</view>
</view>
</view>
</view>
</view>
<view class="" v-else>
<view class="pay-box" @click="payType = 1">
<view style="display: flex; align-items: center;">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/wxPay.png" mode="widthFix"></image>
微信支付
</view>
<view class="select-box">
<view class="select" v-if="payType == 1"></view>
</view>
</view>
<view v-if="walletList.length > 0">
<view class="pay-box">
<view style="display: flex; align-items: center;">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/numLogo.png" mode="widthFix">
</image>
数字人民币子钱包支付
</view>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/selectB.png" class="select-img"
mode="widthFix" :style="{'transform': showMore ? 'rotate(180deg)' : ''}"
@click="showMore = !showMore"></image>
</view>
<view v-show="showMore" style="padding-left: 40rpx;">
<view class="pay-box" v-for="(item,index) in walletList" :key="index" @click="payType = 2;walletIndex = index">
<view style="display: flex; align-items: center;">
<image :src="item.bank_logo" mode="widthFix"></image>
{{item.bank_name}}
</view>
<view class="select-box">
<view class="select" v-if="payType == 2 && walletIndex === index"></view>
</view>
</view>
</view>
</view>
</view>
<view class="btn" @click="pay">
立即付款
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: '',
token: {},
detail: {},
closeTime: 1000 * 60 * 30,
times: {},
showMore: true,
walletList: [],
walletIndex: 0,
payType: null,
coupon_activity: false,
pay_type: "",
}
},
onReady() {
},
onLoad(option) {
this.id = option.orderId
this.token = option.token
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/subwallet.ermb/wallet',
header: {
'content-type': 'application/json',
'token': option.token
},
data: {},
success: res => {
this.walletList = res.data.data
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/order/query',
header: {
'content-type': 'application/json',
'token': option.token
},
data: {
order_id: option.orderId
},
success: res => {
//
if(res.data.data.coupon_activity && res.data.data.coupon_activity.pay_type) {
this.coupon_activity = true
this.pay_type = res.data.data.coupon_activity.pay_type
}
if(res.data.data.paid_money == 0) {
uni.redirectTo({
url: '/subPackages/order/trades'
})
return;
}
this.detail = res.data.data
let createTime = new Date(
(this.detail.create_time + "").replace(/-/g, "/")
).getTime();
createTime += this.detail.auto_close_time * 1000;
this.closeTime = createTime - new Date().getTime();
const hours = parseInt((this.closeTime % (1000 * 60 * 60 * 24)) / (
1000 * 60 * 60));
const minutes = parseInt((this.closeTime % (1000 * 60 * 60)) / (
1000 * 60));
const seconds = (this.closeTime % (1000 * 60)) / 1000;
this.times = {
hours: hours,
minutes: minutes,
seconds: seconds
}
}
})
}
})
},
onShow() {
},
methods: {
//
timeup() {
let flag = false
setTimeout(() => {
flag = true
}, 2000)
if (flag) {
console.log('倒计时结束')
}
},
//
pay() {
if(this.payType == null) {
uni.showToast({
title: '请选择支付方式',
icon: 'none'
})
return;
}
uni.showLoading({
title: '加载中'
})
if(this.payType == 1) {
//
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/order/pay',
header: {
'content-type': 'application/json',
'token': this.token
},
data: {
order_id: this.id,
pay_method: "WEIXIN",
pay_platform: "MINI",
app_name: "WxXcxConfig"
},
success: res => {
uni.hideLoading()
if (res.data.code == 1) {
let data = JSON.parse(res.data.data)
uni.requestPayment({
nonceStr: data.nonceStr || data.noncestr,
package: data.package,
paySign: data.paySign || data.sign,
signType: data.signType,
timeStamp: "" + (data.timeStamp || data.timestamp),
complete: function(res) {
setTimeout(() => {
uni.redirectTo({
url: '/subPackages/order/trades'
})
}, 1000)
}
});
} else {
uni.showToast({
title:res.data.msg,
icon:'none'
})
}
},
})
}else if(this.payType == 2) {
//
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/subwallet.ermb/wallet',
header: {
'content-type': 'application/json',
'token': this.token
},
data: {
order_id: this.id,
pay_method: "SUBWALLET",
pay_platform: "MWEB",
ins_no: this.walletList[this.walletIndex].ins_no,
return_url: "https://m.cloud.sz-trip.com/OrderWaiting",
},
success: res => {
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/order/pay',
header: {
'content-type': 'application/json',
'token': this.token
},
data: {
order_id: this.id,
pay_method: "SUBWALLET",
pay_platform: "MWEB",
ins_no: this.walletList[this.walletIndex].ins_no,
return_url: "https://https://m.cloud.sz-trip.com/OrderWaiting",
},
success: res => {
let data = JSON.parse(res.data.data);
if(data && data.RESULT && data.RESULT=='Y'){
uni.request({
method: 'POST',
url: this.JDSZAPIURL + '/api/order/query',
header: {
'content-type': 'application/json',
'token': this.token
},
data: {
order_id: this.id,
},
success: res => {
uni.hideLoading()
if (res.data.data.state != "UNPAID") {
uni.redirectTo({
url: '/subPackages/order/trades'
})
} else {
uni.showToast({
title: '未查询到支付结果!',
icon: 'none'
})
}
},
complete: (res) => {uni.hideLoading()}
})
} else {
uni.hideLoading()
if (res.data.code!=1 && res.data.msg) {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}
},
})
},
})
}
}
}
}
</script>
<style scoped lang="scss">
.bg {
padding-top: 40rpx;
box-sizing: border-box;
}
.title {
text-align: center;
font-size: 35rpx;
line-height: 60rpx;
}
.time-box {
display: flex;
justify-content: center;
align-items: center;
}
.money-box {
width: 670rpx;
margin: 30rpx auto 0;
font-size: 35rpx;
display: flex;
justify-content: space-between;
border-bottom: 1rpx solid #000;
height: 60rpx;
align-items: center;
}
.pay-box {
padding: 0 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 35rpx;
margin-top: 40rpx;
image {
width: 70rpx;
margin-right: 20rpx;
}
.select-box {
width: 35rpx;
height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid #000;
border-radius: 50%;
.select {
width: 15rpx;
height: 15rpx;
background: #000;
border-radius: 50%;
}
}
.select-img {
width: 50rpx;
height: 50rpx;
margin-right: 0rpx;
}
}
.btn {
margin: 80rpx auto 0;
width: 670rpx;
line-height: 80rpx;
text-align: center;
font-size: 40rpx;
background: #d62828;
color: #fff;
border-radius: 40rpx;
}
</style>

2
subPackages/peripheralActivity/peripheralActivity.vue

@ -3,7 +3,7 @@
<image :src="topImg" mode="aspectFill" class="topImg"></image> <image :src="topImg" mode="aspectFill" class="topImg"></image>
<view class="box"> <view class="box">
<view v-for="(item,index) in list" :key="index" class="item"> <view v-for="(item,index) in list" :key="index" class="item" @click="item.type='calendar';gotoDetailByTypeToJdsz(item)">
<image :src="showImgs(item.post_url)" mode="aspectFill" class="img"></image> <image :src="showImgs(item.post_url)" mode="aspectFill" class="img"></image>
<view class="content flex-column"> <view class="content flex-column">
<view class="title text-overflow">{{item.name}}</view> <view class="title text-overflow">{{item.name}}</view>

27
subPackages/webPage/webPage.vue

@ -0,0 +1,27 @@
<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(option) {
if (option.url) {
this.url = decodeURIComponent(option.url)
}else{
this.url = uni.getStorageSync('webUrl')
}
console.log(this.url)
// 使web-view
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save