chenkainan 6 months ago
parent
commit
2fb43ba984
  1. 12
      pages.json
  2. 47
      subPackages/activity/commonRule.vue
  3. 344
      subPackages/activity/springTour.vue
  4. 54
      subPackages/order/detail.vue
  5. 14
      subPackages/ticketBooking/detail.vue
  6. 4
      subPackages/ticketBooking/order.vue

12
pages.json

@ -299,6 +299,18 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "activity/springTour",
"style": {
"navigationBarTitleText": "花开盐都 春游水乡"
}
},
{
"path": "activity/commonRule",
"style": {
"navigationBarTitleText": "活动规则"
}
} }
] ]
}], }],

47
subPackages/activity/commonRule.vue

@ -0,0 +1,47 @@
<template>
<view class="bg">
<view class="content" v-html="formateRichText(detail.rule_content)"></view>
</view>
</template>
<script>
export default {
data() {
return {
detail: {}
}
},
onLoad(option) {
if(option.title) {
uni.setNavigationBarTitle({
title: option.title
});
}
this.Post({
id: option.id
},'/api/lottery_activity/getActivityById').then(res => {
this.detail = res.data
})
}
}
</script>
<style lang="scss" scoped>
.bg {
width: 750rpx;
min-height: 100vh;
}
.content {
width: 697rpx;
height: auto;
background: #FFFFFF;
border-radius: 13rpx;
margin: -28rpx auto 0;
padding: 48rpx 21rpx 98rpx;
position: relative;
}
</style>

344
subPackages/activity/springTour.vue

@ -0,0 +1,344 @@
<template>
<view class="bg">
<image :src="showImg('/uploads/20250411/c2f08776888c2c46ffbd2c48cc232baf.png')" class="topImg" />
<view class="rule" @click="goRule()">
<text style="padding-bottom: 6rpx;display: inline-block;">活动规则</text>
<uni-icons color="#ffffff" type="right" size="14"></uni-icons></view>
<image :src="showImg('/uploads/20250411/98c8999a389c972aa7e2af20595e4045.png')" class="coupon-header">
<view class="coupon-box">
<view class="coupon-item" v-for="(item,i) in couponList" :key="i" @click="getCoupon(item)"
:style="{'backgroundImage':`url(${item.img})`}">
<image src="https://tongli.sz-trip.com/uploads/20250411/c5c7e3ee78863380bbdace18bd8ac228.png" class="coupon-btn" />
</view>
</view>
<view class="box">
<view class="item" v-for="item in list" :key="item.id" @click="goDetailByType(item.goods)">
<image class="item-img" :src="showImg(item.goods.image)" mode=""></image>
<view class="content">
<view>
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="tag-content" v-if="item.goods.goods_new_tag">
<view class="tag-item" v-for="(tag,i) in item.goods.goods_new_tag.split(',')" :key="i">
{{tag}}
</view>
</view>
</view>
<view class="bottom">
<view >
<text class="oldPrice">{{item.goods.price/100}}</text>
<text class="price">{{item.goods.money/100}}</text>
</view>
<view class="buy">
抢购
</view>
</view>
</view>
</view>
</view>
<image v-if="goTop" @click="Totop()" class="goTopImg" src="https://tongli.sz-trip.com/uploads/20250411/83aaaa1a483aa1effe82f6a869ffce50.png"></image>
</view>
</template>
<script>
export default {
data() {
return {
couponList: [
{id: 1, price:5, title: '满15减5',img: 'https://tongli.sz-trip.com/uploads/20250411/c94ac0d977b4767d2809134fdace5a62.png'},
{id: 2, price:10, title: '满30减10',img: 'https://tongli.sz-trip.com/uploads/20250411/15a8af6400b71c5b7e2f8da78ead6f04.png'},
{id: 3, price:15, title: '满50减15',img: 'https://tongli.sz-trip.com/uploads/20250411/529b589eec9ac511f13fadbdd8188f2c.png'},
{id: 4, price:20, title: '满60减20',img: 'https://tongli.sz-trip.com/uploads/20250411/883734155ee9cbbbcee590194f6143be.png'},
],
list:[],
finished: false,
isReceive: true,
goTop: false
}
},
onReady() {
this.getCouponId()
this.getList()
},
onPageScroll(e){
//
if(e.scrollTop>200){
this.goTop=true;
}else{
this.goTop=false;
}
},
methods: {
Totop(){
uni.pageScrollTo({
scrollTop: 0,//
duration: 300
});
},
// id
getCouponId () {
this.Post({id: 256},'/api/multimedia/detail').then(res=>{
if (res.code == 1 && res.data) {
let ids = res.data.ext_link.split(',')
for(let i=0;i<this.couponList.length;i++) {
this.couponList[i].id = ids[i]
}
console.log(this.couponList)
}
})
},
//
getList(){
this.Post({
tag_id: 57,
offset: this.list.length,
limit: 10,
},'/api/tag/getGoodsByTagId').then(res => {
this.list = [...this.list, ...res.data];
if (res.data.length < 10) {
this.finished = true
}
})
},
goRule() {
uni.navigateTo({
url: '/subPackages/activity/commonRule?id=1&title=花开盐都 春游水乡-活动规则'
})
},
getCoupon (item) {
if(!this.isReceive) {
uni.showToast({
title:'短时间内请勿重复点击!',
icon:'none'
})
}
if(item.id && this.isReceive){
this.isReceive = false
setTimeout(() => {
this.isReceive = true
},3000)
this.Post({
ids: item.id
},'/api/coupon/getCouponsByActivityIds').then(res => {
if (res.code == 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
// this.Post({
// ids: item.id,
// is_all: 1
// },'/api/coupon/getNewCouponsByActivitiesIds').then(res => {
// })
}
},
},
onReachBottom() {
setTimeout(() => {
if (!this.finished) this.getList()
},1000)
}
}
</script>
<style lang="scss" scoped>
view {
box-sizing: border-box;
}
.bg {
background: #AFEBB7;
min-height: 100vh;
padding-bottom: 120rpx;
position: relative;
}
.topImg {
width: 750rpx;
height: 893.33rpx;
}
.rule{
width: 58rpx;
height: 170rpx;
background: rgba(255,122,69,0.86);
border-radius: 7rpx 0rpx 0rpx 7rpx;
border: 2px solid #FF503B;
font-weight: 500;
font-size: 27rpx;
color: #FFFFFF;
text-align: center;
position: absolute;
top: 529rpx;
right: 0;
padding: 8rpx 14rpx 0;
line-height: 28rpx;
}
.box {
margin-top: 50rpx;
padding: 0 26rpx;
}
.item {
margin-bottom: 22rpx;
width: 100%;
height: 272.67rpx;
position: relative;
}
.item-img {
width: 307rpx;
height: 100%;
background: #FA6216;
border-radius: 20rpx;
}
.content {
height: 100%;
width: 459rpx;
background: #FFFFFF;
border-radius: 20rpx;
position: absolute;
top: 0;
right: 0;
padding: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.title {
font-family: PingFang SC;
font-weight: 500;
font-size: 31rpx;
color: #00132F;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.oldPrice{
font-weight: 400;
font-size: 24rpx;
color: #66676A;
line-height: 15rpx;
text-decoration-line: line-through;
display: block;
}
.price {
font-size: 33.33rpx;
font-family: PingFangSC;
font-weight: bold;
color: #F75008;
}
.price::before {
content: '¥';
font-size: 24rpx;
}
.tag-content {
display: flex;
width: 100%;
overflow: hidden;
margin-top: 20rpx;
.tag-item{
border-radius: 20rpx;
border: 1px solid #FFA416;
font-weight: 500;
font-size: 24rpx;
color: #FFA416;
line-height: 23rpx;
padding:10rpx 20rpx;
flex-shrink: 0;
margin-right: 13rpx;
}
}
.buy {
width: 107rpx;
height: 53rpx;
background: linear-gradient(90deg, #FF413B, #FFAB2E);
border-radius: 27rpx;
text-align: center;
line-height: 53rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #FFFFFF;
}
.coupon-header{
width: 450rpx;
height: 100rpx;
display: block;
margin: 0 auto;
position: relative;
z-index: 2;
}
.coupon-box{
width: 697rpx;
height: 597rpx;
background: #FFFFFF;
border-radius: 20rpx;
margin: -50rpx auto 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 62rpx 32rpx 0;
position: relative;
z-index: 1;
.coupon-item{
width: 306.67rpx;
height: 233.33rpx;
display: flex;
background-size: 100% 100%;
margin-bottom: 24rpx;
}
.coupon-price{
font-weight: 600;
font-size: 67rpx;
color: #E71F57;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.coupon-content{
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
flex: 1;
}
.coupon-btn{
width: 205.33rpx;
height: 48.67rpx;
margin: 161rpx auto 0;
}
}
.goTopImg{
width: 102rpx;
height: 102rpx;
position: fixed;
right: 28rpx;
bottom: 48rpx;
}
</style>

54
subPackages/order/detail.vue

@ -19,18 +19,18 @@
<!-- 景点美食二维码 --> <!-- 景点美食二维码 -->
<view v-if="isQrcode" style="margin-top: -66rpx;"> <view v-if="isQrcode" style="margin-top: -66rpx;">
<view class="qrcode-remain" v-if="!info.order_child[0].extract_id">还剩<span>{{remainNum}}</span>张未核销</view> <!-- <view class="qrcode-remain" v-if="!info.order_child[0].extract_id">还剩<span>{{remainNum}}</span>张未核销</view> -->
<swiper class="qrcode-box" :circular="false" previous-margin="120rpx" next-margin="120rpx" :duration="800" <swiper class="qrcode-box" :circular="false" previous-margin="120rpx" next-margin="120rpx" :duration="800"
:current="current" @change="swiperChange"> :current="current" @change="swiperChange">
<swiper-item v-for="(item, index) in info.order_child" :key="index" class="flex-center"> <swiper-item v-for="(item, index) in qrCodeImgs" :key="index" class="flex-center">
<view class="qrcode-item flex-column"> <view class="qrcode-item flex-column">
<view class="qrcode-title">{{item.specifications_name}}</view> <view class="qrcode-title">{{item.specifications_name}}</view>
<image :src="item.qrcodeimg" style="width: 300rpx;height: 300rpx;" mode="aspectFill"></image> <image :src="item.qrcodeimg" style="width: 300rpx;height: 300rpx;" mode="aspectFill"></image>
<canvas :id="'qrcodeT'+index" :canvas-id="'qrcodeT'+index" <canvas :id="'qrcodeT'+index" :canvas-id="'qrcodeT'+index"
style="width:150px;height:150px;z-index: -20;bottom: -500px;position: absolute;"></canvas> style="width:150px;height:150px;z-index: -20;bottom: -500px;position: absolute;"></canvas>
<view class="qrcode-subtitle">核销码:{{item.third_order_id||item.child_id}}</view> <!-- <view class="qrcode-subtitle">核销码:{{item.third_order_id||item.child_id}}</view> -->
<view class="qrcode-subtitle">核销码:{{item.code}}</view>
<view class="complete-text flex-center" <view class="complete-text flex-center"
v-if="['WAIT_REFUND','REFUND_SUCCESS','WAIT_COMMENT','COMPLETE'].includes(item.status)"> v-if="['WAIT_REFUND','REFUND_SUCCESS','WAIT_COMMENT','COMPLETE'].includes(item.status)">
<view class="flex-center" v-if="item.status == 'WAIT_COMMENT'"> <view class="flex-center" v-if="item.status == 'WAIT_COMMENT'">
@ -432,7 +432,8 @@
isQrcode: false, isQrcode: false,
remainNum: 0, remainNum: 0,
maskShow: false, maskShow: false,
postInfo: [] postInfo: [],
qrCodeImgs: [],
} }
}, },
onLoad(option) { onLoad(option) {
@ -478,29 +479,66 @@
.includes(this.info.status)) { .includes(this.info.status)) {
this.isQrcode = true this.isQrcode = true
for (let i = 0; i < this.info.order_child.length; i++) { for (let i = 0; i < this.info.order_child.length; i++) {
// third_order_id third_order_id let orderChildItem = this.info.order_child[i]
// third_order_id third_order_id getCodeImg setQRCodeImgs
this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i); this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i);
this.setQRCodeImgs(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id,
{specifications_name:orderChildItem.specifications_name, status:orderChildItem.status})
// //
if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1 if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1
} }
} else if (!['WAIT_PAYMENT', 'CLOSED'].includes(this.info.status)) { } else if (!['WAIT_PAYMENT', 'CLOSED'].includes(this.info.status)) {
for (let i = 0; i < this.info.order_child.length; i++) { for (let i = 0; i < this.info.order_child.length; i++) {
let orderChildItem = this.info.order_child[i]
if (this.info.order_child[i].is_display_order_qrcode) { if (this.info.order_child[i].is_display_order_qrcode) {
this.isQrcode = true this.isQrcode = true
//getCodeImg
this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i); this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i);
this.setQRCodeImgs(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id,
{specifications_name:orderChildItem.specifications_name, status:orderChildItem.status})
// //
if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1 if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1
} }
} }
} }
for (let i = 0;i<this.qrCodeImgs.length;i++) {
this.getCodeImgNew(this.qrCodeImgs[i],i)
}
} }
setTimeout(() => { setTimeout(() => {
console.log(this.info.order_child) console.log(this.info.order_child)
}, 1000) }, 1000)
}) })
}, },
//
setQRCodeImgs(codeStr, otherParam) {
if (codeStr) {
let arrCode = codeStr.split(',').map(v=> {return {code: v, qrcodeimg: '', ...otherParam}})
this.qrCodeImgs = this.qrCodeImgs.concat(arrCode)
}
},
//
getCodeImgNew(item,index) {
console.log(item)
new QRCode('qrcodeT'+index, {
text: item.code,
width: 150,
height: 150,
padding: 2,
colorDark: 'rgb(0,0,0)',
colorLight: 'rgb(255,255,255)',
correctLevel: QRCode.CorrectLevel.M, //
callback: res => {
console.log('callback')
this.$set(item, 'qrcodeimg', res.path);
item.qrcodeimg = res.path
this.$forceUpdate();
}
});
},
// //
getCodeImg(code, index) { getCodeImg(code, index) {
new QRCode('qrcodeT' + index, { new QRCode('qrcodeT' + index, {

14
subPackages/ticketBooking/detail.vue

@ -290,8 +290,18 @@
}, '/api/goods/getPriceCalendarListBySpecifications').then(res => { }, '/api/goods/getPriceCalendarListBySpecifications').then(res => {
this.allSeldDate = res.data || [] this.allSeldDate = res.data || []
this.seldDateIndex = this.allSeldDate.findIndex(item => item.store != 0) this.seldDateIndex = this.allSeldDate.findIndex(item => item.store != 0)
this.getTimeStock(this.allSeldDate[this.seldDateIndex].date)
this.openPop() if (this.seldDateIndex>=0) {
this.getTimeStock(this.allSeldDate[this.seldDateIndex].date)
this.openPop()
} else {
uni.showToast({
title:"库存不足",
icon:"none"
})
}
}) })
}, },
// //

4
subPackages/ticketBooking/order.vue

@ -52,8 +52,8 @@
<view class="people-box" > <view class="people-box" >
<view class="people-box-title"> <view class="people-box-title">
<view v-if="!skuBuyMultiple">仅需填写{{pInfo.specifications[0].buyNum}}位出行人</view> <!-- <view v-if="!skuBuyMultiple">仅需填写{{pInfo.specifications[0].buyNum}}位出行人</view> -->
<view v-else>出行人信息</view> <view>请填写出行人信息</view>
</view> </view>
<view style="padding: 42rpx 0 10rpx;"> <view style="padding: 42rpx 0 10rpx;">

Loading…
Cancel
Save