Browse Source

特产 门票

master
jiazhipeng 1 year ago
parent
commit
8d9f59b3af
  1. 435
      compoents/cartData.vue
  2. 2
      compoents/contactAdd.vue
  3. 3
      static/css/base.css
  4. 199
      subPackages/techan/detail.vue
  5. 237
      subPackages/techan/order.vue
  6. 11
      subPackages/techan/selfPickUpPoint.vue
  7. 538
      subPackages/techan/techanList.vue
  8. 165
      subPackages/ticketBooking/detail.vue
  9. 61
      subPackages/ticketBooking/order.vue

435
compoents/cartData.vue

@ -0,0 +1,435 @@
<template>
<view class="bg">
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0"
:safe-area="true" @change="popChange">
<view class="cart-container" v-if="showCart">
<view class="header-container">
<view class="select-area flex flex-items-center" @click.stop="selectAllGoods">
<view class="select-cycle" v-show="!selectAll"></view>
<view class="select-cycle selected" v-show="selectAll">
<image src="https://yjdtadmin.sz-trip.com/uploads/20240726/a3d19f85c743c71320b3f879e01f6355.png">
</view>
<view style="padding-left: 26rpx;" >全选</view>
</view>
<view class="delete-area flex flex-items-center" @click.stop="clearAllGoods">
<image src="https://yjdtadmin.sz-trip.com/uploads/20240726/dde92bdf8b89abb93bd00472de06a615.png"></image>
<view style="padding-left: 8rpx;" >清空</view>
</view>
</view>
<view class="content-container">
<view class="content-item" v-for="(item,i) in cartData" :key="i" :model="cartData">
<view class="flex flex-items-center" @tap.stop="setItemSelect(item)">
<view class="select-cycle" v-show="!item.isSelected"></view>
<view class="select-cycle selected" v-show="item.isSelected">
<image src="https://yjdtadmin.sz-trip.com/uploads/20240726/a3d19f85c743c71320b3f879e01f6355.png">
</view>
<view style="padding-left: 26rpx;flex:1">
<view class="commodity box" >
<image class="img" :src="showImg(item.Specifications_image)" mode="aspectFill"></image>
<view class="title goods-text-area">
<view class="commodity-info">
<view class="text-overflowRows" style="font-weight: bold;">{{ item.good_name }}</view>
<view class="text-overflowRows" style="font-size: 27rpx;color: #999999;padding-top: 10rpx;">{{ item.Specifications_name }}</view>
</view>
<view class="flex flex-between">
<view class="commodity-price">
<view style="font-size: 40rpx;">{{item.Specifications_money/100}}</view>
</view>
<view class="add-num-area">
<image @click.stop="addBuyNum(item,-1,i)"
:src="(item.num==1?'https://yjdtadmin.sz-trip.com/uploads/20231225/634870627318043881f9c417e5ad5b52.png':'https://yjdtadmin.sz-trip.com/uploads/20240726/ea81cd01a1f32a0226d33d8e35119c96.png')" ></image>
<view>{{item.num}}</view>
<image @click.stop="addBuyNum(item,1,i)" src="https://yjdtadmin.sz-trip.com/uploads/20240726/5028bbc810386a1f301a556672711f19.png" ></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<slot name="content"></slot>
</view>
</template>
<script>
export default {
name: "cartData",
data() {
return {
cartData: [],
showCart: false,
selectAll: false,
canOpenpop: true,
allPrice: {allPrice:0, iNum:0, fNum:'00'}
}
},
props:{
paramData: {
type: Object,
},
},
mounted() {
this.canOpenpop = true
this.refreshData()
uni.$on("updateDataByConnect",this.getDataByConnect)
},
beforeUnmount () {
uni.$off("updateDataByConnect",this.getDataByConnect)
},
methods: {
calNum () {
let res = 0
this.cartData.forEach(v=>{
res += v.num
})
return res
},
closePopup() {
this.$refs.popup.close()
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
openPop(){
this.$refs.popup.open()
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
popChange (e) {
this.showCart = e.show
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
getDataByConnect(data) {
if (data.msgType == "updateCartDataInfo") {
this.refreshData(data)
}
},
refreshData (data) {
let selectedData = []
try {
selectedData = JSON.parse(uni.getStorageSync('cartDataInfo'));
} catch(e) {
selectedData = []
}
if (Array.isArray(data) && data.length>0) {
this.cartData = data
this.setAllSelect()
} else {
this.Post({},'/api/shopping/getShoppingList').then(res => {
if (res) {
this.cartData = (res.data || []).map(v=>{return {...v, isSelected:selectedData.includes(v.specifications_id)}})
this.setAllSelect()
}
})
}
},
//
setItemSelect(item) {
item.isSelected = !item.isSelected
// uni.setStorageSync('cartDataInfo', JSON.stringify(this.cartData));
this.setAllSelect()
},
selectAllGoods(){
let goods = this.cartData
if (this.selectAll) {
goods.forEach(v => v.isSelected = false)
this.selectAll = false
} else {
goods.forEach(v => v.isSelected = true)
this.selectAll = true
}
this.setAllSelect()
},
clearAllGoods(){
let _this = this
Promise.all(this.cartData.map(v=>{
return _this.Post({s_id: v.id},'/api/shopping/delShopping')
})).finally(res =>{
this.cartData = []
this.setAllSelect()
})
},
setAllSelect() {
let goods = this.cartData
if(goods.length>0&& goods.every(v => v.isSelected)){
this.selectAll = true
} else {
this.selectAll = false
}
let selectedData = goods.filter(v=>v.isSelected).map(v=>v.specifications_id)
uni.setStorageSync('cartDataInfo', JSON.stringify(selectedData));
this.calAllPrice()
},
addBuyNum(item, num,index){
if (num == -1 && item.num == 1) {
this.Post({s_id: item.id},'/api/shopping/delShopping').then(res =>{
this.cartData.splice(index,1)
this.setAllSelect()
})
} else {
let numData = item.num + num
this.Post({s_id: item.id, num: numData},'/api/shopping/updateShopping').then(res =>{
item.num += num
this.setAllSelect()
})
}
},
calAllPrice () {
let selectedGoods = this.cartData.filter(v=>v.isSelected)
let totalPrice = 0
selectedGoods.forEach(v=>{
totalPrice += v.Specifications_money/100 * v.num
})
totalPrice = totalPrice.toFixed(2)
console.log(totalPrice)
this.allPrice = {allPrice: totalPrice, iNum: totalPrice.split('.')[0], fNum: totalPrice.split('.')[1]}
this.paramData.allPrice = totalPrice
this.paramData.iNum = this.allPrice.iNum
this.paramData.fNum = this.allPrice.fNum
this.paramData.num = this.calNum()
this.$emit('changeParamData', this.paramData)
},
goCartOrder () {
if(this.cartData.every(v => !v.isSelected)){
uni.showToast({
title:'请先选中要购买的商品',
icon:'none',
})
return
}
let orderData = this.cartData.filter(v=>v.isSelected).map(v=>{
return {
goodsInfo: {
image: v.Specifications_image,
title:v.good_name,
},
skuInfo: {
title:v.Specifications_name,
buyNum:v.num,
money: v.Specifications_money,
id: v.specifications_id,
},
}
})
let orderInfo = {
// is_post: goods.is_post || "1",
is_post: 1, //
goods: orderData,
post: 0
}
uni.setStorageSync('teChanOrder', JSON.stringify(orderInfo)); //
// uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
uni.navigateTo({
url: '/subPackages/techan/order'
});
},
},
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
width: 100%;
height: 100%;
}
.cart-container{
display: flex;
flex-direction: column;
background-color: white;
height: 933rpx;
padding-bottom: 184rpx;
border-radius: 20rpx 20rpx 0rpx 0rpx;
display: flex;
flex-direction: column;
position: absolute;
width: 100%;
bottom: 0;
z-index: 20;
.header-container{
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx 26rpx;
.select-area{
font-family: PingFang SC;
font-weight: bold;
font-size: 37rpx;
color: #000000;
}
.delete-area{
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #999999;
image{
width: 26rpx;
height: 26rpx;
}
}
}
}
.content-container{
flex: 1;
height: 10rpx;
overflow-y: auto;
padding:0 26rpx 26rpx;
.content-item{
margin-bottom: 48rpx;
}
.commodity {
display: flex;
.add-num-area{
display: flex;
justify-content: space-between;
align-items: center;
width: 160rpx;
image{
width: 49rpx;
height: 49rpx;
}
}
.goods-text-area{
display: flex;
flex-direction: column;
justify-content: space-between;
}
.commodity-price{
font-weight: 500;
font-size: 24rpx;
color: #F84A56;
display: flex;
align-items: baseline;
}
.commodity-info{
font-family: PingFangSC;
font-weight: 500;
font-size: 32rpx;
color: #2C2C2C;
}
// align-items: center;
.img {
width: 217rpx;
height: 179rpx;
border-radius: 13rpx;
flex-shrink: 0;
}
.title {
flex: 1;
margin-left: 20rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
.price-list {
display: flex;
margin-top: 18rpx;
align-items: center;
.price-r {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 24rpx;
}
}
.price-g {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #b5bcc9;
text-decoration: line-through;
margin-left: 10rpx;
}
}
}
.num-box {
display: flex;
align-items: center;
margin-left: 20rpx;
width: 160rpx;
justify-content: space-between;
.num {
text-align: center;
width: 50rpx;
}
.ctrl {
width: 46rpx;
height: 46rpx;
}
}
}
}
.select-cycle{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 1px solid #999999;
image{
width: 100%;
height: 100%;
}
}
.select-cycle.selected {
border: none;
image{
width: 40rpx;
height: 40rpx;
}
}
</style>

2
compoents/contactAdd.vue

@ -26,7 +26,7 @@
<view class="list-item">
<view class="list-item-title">设为默认</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#FEB419"/>
<switch :checked="idDefault" @change="switchChange" color="#248BAA"/>
</view>
</view>
</view>

3
static/css/base.css

@ -140,3 +140,6 @@ view {
.no-scrollbar::-webkit-scrollbar{
display: none;
}
.font-bold{
font-weight: bold;
}

199
subPackages/techan/detail.vue

@ -55,16 +55,14 @@
</view>
</view>
<view class="btn-list">
<view class="btn-list" v-if="!paramData.showCart">
<view class="left-box">
<view class="img-box" @click="collect">
<image
:src="(isCollect?'https://tongli.sz-trip.com/uploads/20240827/47e86bfd7dd5c1b73d58adaa2b35f55a.png':
`https://tongli.sz-trip.com/uploads/20240827/95359568a28b0cae7accc437070eded4.png`)"
mode="aspectFill"></image>
<view class="text">
收藏
</view>
<view class="img-box" slot="content">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#F84A56',border:'1px solid #F84A56'}">
<image @click.stop="showCartClick" src="https://yjdtadmin.sz-trip.com/uploads/20240726/76702dae980283c24f9d471262f0cbbe.png" mode="aspectFill"
style="width: 78rpx;height: 78rpx;"></image>
</uni-badge>
</view>
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="img-box">
@ -77,12 +75,41 @@
</button>
</view>
<view class="btn-buy" @click="openPop">
<view class="btn-post" v-if="is_post==1">
<view class="left-btn-buy" @click="openPop(true)">加入购物车</view>
<view class="right-btn-buy" @click="openPop(false)">立即购买</view>
</view>
<view v-else class="btn-buy" @click="openPop(false)">
立即购买
</view>
</view>
<uni-popup ref="popup" type="bottom" @change="changPopShow">
<view class="btn-list" v-else>
<view class="left-box">
<view class="img-box" slot="content">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#F84A56',border:'1px solid #F84A56'}">
<image @click.stop="showCartClick" src="https://yjdtadmin.sz-trip.com/uploads/20240726/76702dae980283c24f9d471262f0cbbe.png" mode="aspectFill"
style="width: 78rpx;height: 78rpx;"></image>
</uni-badge>
</view>
<view class="bottom-price">
<view class="bottom-price-yuan">{{paramData.iNum}}</view>
<view>.{{paramData.fNum}}</view>
</view>
</view>
<view class="btn-buy" @click="goCartOrder">
提交订单
</view>
</view>
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" ></cartDataVue>
<uni-popup ref="popup" type="bottom" @change="changPopShow" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="sku.length>0">
<view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;">
<uni-icons type="closeempty" size="24"></uni-icons>
@ -136,7 +163,9 @@
</template>
<script>
import cartDataVue from '../../compoents/cartData.vue'
export default {
components: {cartDataVue},
data() {
return {
id: null,
@ -144,10 +173,13 @@
sku: [],
productIndex: 0,
is_post: "2",
isCollect: false,
showLength: 0,
buyNum: 1,
popShow: false
popShow: false,
paramData: {allPrice: 0,iNum:0, fNum:'00', showCart: false, num: 0},
};
},
onLoad(option) {
@ -191,6 +223,11 @@
).then(res => {
if (res) {
this.sku = res.data || [];
// todo
if (this.sku.length>0) {
this.is_post = this.sku[0].is_post
}
}
});
},
@ -226,7 +263,8 @@
closePopup() {
this.$refs.popup.close()
},
openPop() {
// false true
openPop(flag) {
if (!this.sku||this.sku.length<=0) {
uni.showToast({
title:'暂无可选规格',
@ -237,19 +275,58 @@
if (!this.popShow) {
this.$refs.popup.open()
} else {
if (flag) {
this.addToCart()
} else {
this.order()
}
}
},
order(item) {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
uni.setStorageSync('teChanOrder', JSON.stringify(goods)); //
uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
let orderInfo = {
// is_post: goods.is_post || "1",
is_post: 2,
goods: [{goodsInfo: this.info, skuInfo: goods }],
post: 0,
}
uni.setStorageSync('teChanOrder', JSON.stringify(orderInfo)); //
// uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
uni.navigateTo({
url: '/subPackages/techan/order'
});
},
addToCart () {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
let goodsInfo = {goodsInfo:this.info, skuInfo: goods, isSelected: true}
this.Post({good_id: this.info.id, specifications_id: goods.id,num: this.buyNum },
'/api/shopping/addShopping').then(res => {
if (res) {
let selectedData = []
try {
selectedData = JSON.parse(uni.getStorageSync('cartDataInfo'));
} catch(e) {
selectedData = []
}
let currentGoods = selectedData.find(v =>v==goods.id)
if (!currentGoods) {
selectedData.push(goods.id)
}
uni.setStorageSync('cartDataInfo', JSON.stringify(selectedData));
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closePopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
goUser() {
uni.switchTab({
url: '/pages/index/user'
@ -265,6 +342,23 @@
}
this.productIndex = index
},
//
changeParamData (data) {
for(let key in this.paramData) {
this.paramData[key] = data[key]
}
},
showCartClick () {
if (this.paramData.showCart) {
this.$refs.cartDataVueRef.closePopup()
} else {
this.$refs.cartDataVueRef.openPop()
}
},
goCartOrder () {
this.$refs.cartDataVueRef.goCartOrder()
},
},
onReachBottom() {
@ -298,7 +392,7 @@
}
.swipe-box {
height: 484rpx;
height: 400rpx;
position: relative;
.swiper-item-num {
@ -319,16 +413,16 @@
}
.swiper {
height: 484rpx;
height: 400rpx;
position: relative;
.swiper-item {
width: 100%;
height: 484rpx;
height: 400rpx;
.item-img {
width: 750rpx;
height: 484rpx;
height: 400rpx;
}
}
}
@ -391,22 +485,22 @@
overflow-x: auto;
.tag-item {
border-radius: 7rpx;
border: 1px solid #71B580;
margin-right: 14rpx;
font-size: 24rpx;
font-family: PingFangSC;
font-weight: 500;
color: #71B580;
padding: 8rpx 16rpx;
flex-shrink: 0;
background: #EAF6F9;
border-radius: 11rpx;
font-weight: 500;
font-size: 24rpx;
color: #248BAA;
}
}
.title {
margin-top: 20rpx;
font-family: PingFang;
font-weight: 500;
font-weight: bold;
font-size: 31rpx;
color: #000000;
}
@ -540,6 +634,25 @@
display: flex;
align-items: flex-start;
.bottom-price{
display: flex;
align-items: baseline;
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #F84A56;
padding-top: 20rpx;
.bottom-price-yuan{
font-size: 40rpx;
}
}
.bottom-detail-icon{
font-size: 24rpx;
display: flex;
align-items: center;
}
.img-box {
display: flex;
flex-direction: column;
@ -563,9 +676,9 @@
}
.btn-buy {
width: 254rpx;
width: 293rpx;
height: 78rpx;
background: #F84A56;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 40rpx;
text-align: center;
line-height: 78rpx;
@ -657,8 +770,8 @@
.botProducts {
// border: 1rpx solid #00AAFF;
// background-color: rgba(254, 180, 25, 1);
background-image: linear-gradient(135deg, #9EE4FE, #7FD491);
color: rgba(0, 0, 0, 1);
background: #248BAA;
color: #FFFFFF;
}
.buy-num {
@ -730,13 +843,13 @@
.sp-box {
width: 100%;
height: 120rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 0 0 12rpx 12rpx;
border-top: solid 2rpx rgba(216, 216, 216, 1);
padding: 10rpx 0 30rpx;
.sp-box-left {
display: flex;
@ -747,7 +860,7 @@
font-family: PingFang;
font-weight: 500;
font-size: 31rpx;
color: #666666;
color: #999999;
}
:last-child {
@ -766,5 +879,27 @@
}
}
.btn-post{
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
line-height: 77rpx;
text-align: center;
display: flex;
.left-btn-buy{
width: 207rpx;
height: 77rpx;
background: #FD910A;
border-radius: 39rpx 0rpx 0rpx 39rpx;
}
.right-btn-buy{
width: 207rpx;
height: 77rpx;
background: #FC5409;
border-radius: 0rpx 39rpx 39rpx 0rpx;
}
}
</style>

237
subPackages/techan/order.vue

@ -2,19 +2,16 @@
<!-- 解决滚动穿透 -->
<page-meta :page-style="'overflow:'+(popShow?'hidden':'visible')"></page-meta>
<view class="bg" v-if="info">
<view class="sendwayArea" :style="{'width': isPost==3?'340rpx':'170rpx'}" v-if="isPost>=1&&isPost<=3">
<view v-if="isPost==1||isPost==3" :class="['sendway-item',sendType==1?'active':'']"
@click="sendType=1" style="left: -2rpx;">邮寄配送</view>
<view v-if="isPost==2||isPost==3" :class="['sendway-item',sendType==2?'active':'']"
@click="sendType=2" style="right: -2rpx;">到店自提</view>
<!-- <view :class="['sendway-item',sendType==1?'active':'']"
@click="sendType=1" style="left: -2rpx;">邮寄配送</view>
<view :class="['sendway-item',sendType==2?'active':'']"
@click="sendType=2" style="right: -2rpx;">到店自提</view> -->
</view>
<!-- <view class="sendwayArea" :style="{'width': isPost==3?'340rpx':'170rpx'}" v-if="isPost>=1&&isPost<=3">
<view v-if="isPost==1||isPost==3" :class="['sendway-item',info.is_post==1?'active':'']"
@click="info.is_post=1" style="left: -2rpx;">邮寄配送</view>
<view v-if="isPost==2||isPost==3" :class="['sendway-item',info.is_post==2?'active':'']"
@click="info.is_post=2" style="right: -2rpx;">到店自提</view>
</view> -->
<!-- 邮寄 -->
<view class="address" style="margin-bottom: 36rpx;" v-if="(info.is_post==1||info.is_post==3)&&sendType==1">
<view class="address" style="margin-bottom: 36rpx;" v-if="info.is_post==1">
<view class="a-title">
<view>收货地址</view>
<view>
@ -42,10 +39,10 @@
</view>
<!-- 自提 -->
<view v-if="(info.is_post==2||info.is_post==3)&&sendType==2">
<!-- <view v-if="sendType==2"> -->
<view v-if="info.is_post==2 && info.goods[0]">
<view class="pickself" >
<navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${pickupAddress.id}&goodsId=${info.goods_id}`">
<navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${pickupAddress.id}&goodsId=${info.goods[0].skuInfo.goods_id}`">
<view class="pickpoint">
<view class="flex-shrink-0">自提点</view>
<view class="pickpointAddress">
@ -80,20 +77,23 @@
</view>
</view>
<view class="new-box">
<view class="new-box" v-for="(sku,index) in info.goods" :key="index">
<view class="box shop-name text-overflow">
店家名称店家名称店家名称店家名称店家名称店家名称店家名称
</view>
<view class="commodity box">
<image class="img" :src="showImg(detail.image)" mode="aspectFill"></image>
<image class="img" :src="showImg(sku.goodsInfo.image)" mode="aspectFill"></image>
<view class="title flex-c">
<view class="commodity-info">
<view class="text-overflowRows">{{ detail.title }}</view>
<view class="text-overflowRows">{{ sku.goodsInfo.title }}</view>
<view class="commodity-price">
{{info.money/100}}
{{sku.skuInfo.money/100}}
</view>
</view>
<view class="commodity-info">
<view class="text-overflowRows">{{ info.title }}</view>
<view class="text-overflowRows">{{ sku.skuInfo.title }}</view>
<view class="commodity-num">
x{{info.buyNum}}
x{{sku.skuInfo.buyNum}}
</view>
</view>
</view>
@ -104,25 +104,33 @@
</view>
<view class="num-box">
<!-- <image src="https://yjdtadmin.sz-trip.com/uploads/20231225/4b61998e657784d08c8dfdb08da84553.png" mode="aspectFill" class="ctrl" @click="reduce()"></image> -->
<view :class="['ctrl',info.buyNum>1?'':'disabled']" @click="reduce()">-</view>
<input class="num" type="text" v-model="info.buyNum" :disabled='true' />
<view :class="['ctrl']" @click="plus()">+</view>
<view :class="['ctrl',sku.skuInfo.buyNum>1&&info.goods.length>1?'':'disabled']" @click="reduce(sku.skuInfo,index)">-</view>
<input class="num" type="text" v-model="sku.skuInfo.buyNum" :disabled='true' />
<view :class="['ctrl']" @click="plus(sku.skuInfo)">+</view>
</view>
</view>
<view class="post top-line flex-between" v-show="sendType!=2">
<view class="post top-line flex-between" v-show="sku.info.is_post===1">
<view class="">
运费
</view>
<view style="font-weight: 500;" >
{{post===0?'免邮':post/100}}
{{sku.post==0?'免邮':sku.post/100}}
</view>
</view>
<view class="remark top-line">
<view class="remark-title" >订单备注:</view>
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="sku.skuInfo.remark" maxlength="50"/>
</view>
</view>
<!-- 优惠券 -->
<navigator :url="'/subPackages/order/orderCoupon?allprice='+ allprice + '&sku_ids='+ info.id" class="tickets-box flex-between top-line">
<view @click="goOrderCoupon" class="tickets-box flex-between">
<view class="order-title">优惠券</view>
<view class="coupon-btn" v-if="coupon==''">
<view class="select">选择</view>
<view class="select">选择优惠券</view>
<uni-icons style="height: 42rpx;" color="#999999" type="right" size="18"></uni-icons>
</view>
<div class="coupon-price" v-else>
@ -130,21 +138,17 @@
<span v-else>-{{coupon.percent}}%</span>
<span style="margin:0 31rpx 0 8rpx;color: #6C7A94;">></span>
</div>
</navigator>
<view class="remark top-line">
<view class="remark-title" >订单备注:</view>
<input style="z-index:0" type="text" placeholder="选填" v-model="remark" maxlength="50"/>
</view>
</view>
<view class="btn-list">
<view class="price-box">
<view class="text">合计:</view>
<view class="price">{{ total() }}</view>
<view class="post-text" v-if="sendType==1&&post">含邮费:¥{{ post / 100 }}</view>
<view class="post-text" v-if="info.is_post==1&&post">含邮费:¥{{ post / 100 }}</view>
</view>
<view class="btn" @click="order()">提交订单</view>
</view>
@ -187,7 +191,7 @@
<view class="top flex-between" style="height: fit-content;">
<text class="text-overflow" @click="changeAddressAddPopup('close')">取消</text>
<text style="font-size: 35rpx;font-weight: 600;">{{addressTitle}}</text>
<text style="color: #71B580;" class="confirm" @click="saveAddress">保存</text>
<text style="color: #248BAA;" class="confirm" @click="saveAddress">保存</text>
</view>
</view>
@ -236,7 +240,7 @@ export default {
onLoad() {
this.$store.commit("choseCoupon", "");
this.info = JSON.parse(uni.getStorageSync('teChanOrder'));
this.detail = JSON.parse(uni.getStorageSync('teChanInfo'));
if (!this.info) {
uni.navigateBack();
return
@ -246,9 +250,9 @@ export default {
// is_post 使0=1=2=3=/
if (this.info) {
this.isPost = this.info.is_post || "1"
this.sendType = this.isPost==3?1:this.isPost
// this.info.is_post = this.isPost==3?1:this.isPost
}
console.log(this.isPost, this.sendType)
console.log(this.isPost)
},
onShow() {
this.coupon = this.$store.state.user.coupon
@ -270,6 +274,20 @@ export default {
},
methods: {
goOrderCoupon () {
let allPrice = 0
let skuIds= []
this.info.goods.forEach(v=>{
allPrice+= v.skuInfo.money*v.skuInfo.buyNum
if (v.buyNum>0) {
skuIds.push(v.id)
}
})
uni.navigateTo({
url: `/subPackages/order/orderCoupon?allprice=${allPrice}&sku_ids=${skuIds.join(',')}`
})
},
getContacts() {
if (this.info.is_post == 0) {
return;
@ -287,11 +305,19 @@ export default {
return;
}
this.flag = false;
let data = JSON.stringify([{ specifications_id: this.info.id, num: this.info.buyNum, consignee_id: this.contacts.id }]);
console.log(data);
let param = []
this.info.goods.forEach(v=>{
param.push({specifications_id: v.skuInfo.id, num: v.skuInfo.buyNum, consignee_id:this.contacts.id})
})
let data = JSON.stringify(param);
// console.log(data);
this.Post({ data: data }, '/api/order/getNewPost').then(res => {
if (res) {
this.post = res.data[0].post_money;
for(let i=0;i<this.info.goods.length;i++) {
this.info.goods[i].post = res.data[i].post_money;
}
this.flag = true;
}
}).catch(err=>{
@ -299,47 +325,37 @@ export default {
this.flag = true;
});
},
rge(val) {
this.$nextTick(() => {
this.num = val.detail.value.replace(/^(0+)|[^\d]+/g, '');
});
},
setV() {
if (!this.num) {
plus(sku) {
this.$nextTick(() => {
this.num = 1;
this.$store.commit("choseCoupon","");
this.coupon = this.$store.state.user.coupon
sku.buyNum += 1;
if (this.flag) {
this.getPost();
}
});
} else {
if (this.flag) {
this.getPost();
}
}
},
plus() {
this.info.buyNum = Number(this.info.buyNum);
this.$nextTick(() => {
reduce(sku,index) {
if (sku.buyNum > 1) {
this.$store.commit("choseCoupon","");
this.coupon = this.$store.state.user.coupon
this.info.buyNum += 1;
this.$nextTick(() => {
sku.buyNum -= 1;
if (this.flag) {
this.getPost();
}
});
},
reduce() {
this.info.buyNum = Number(this.info.buyNum);
if (this.info.buyNum > 1) {
} else if (sku.buyNum == 1&&this.info.goods.length>1) {
this.$store.commit("choseCoupon","");
this.coupon = this.$store.state.user.coupon
this.$nextTick(() => {
this.info.buyNum -= 1;
this.info.goods.splice(index,1)
if (this.flag) {
this.getPost();
}
});
}
},
//
@ -409,30 +425,36 @@ export default {
//
total() {
let price = 0
let postPrice = this.sendType == 2?0:this.post
this.allprice = this.info.money * this.info.buyNum + postPrice
let postPrice = this.info.is_post == 2?0:this.post
let allPrice = 0
if (this.info && Array.isArray(this.info.goods)) {
this.info.goods.forEach(v=>{
allPrice += v.skuInfo.money*v.skuInfo.buyNum
})
}
this.allprice = allPrice + postPrice
if (this.coupon) {
if (this.coupon.percent == 0) {
if (this.coupon.discounts>this.info.money*this.info.buyNum) {
if (this.coupon.discounts>allPrice) {
price =postPrice
}else{
price = (this.info.money) * this.info.buyNum + postPrice - (this.coupon.discounts)
price = allPrice + postPrice - (this.coupon.discounts)
}
} else{
// bug
price = ((this.info.money) * this.info.buyNum + postPrice) - (((this.info.money) * this.info.buyNum) * this.coupon.percent/100)
price = (allPrice + postPrice) - (allPrice * this.coupon.percent/100)
}
} else {
price = (this.info.money) * this.info.buyNum + postPrice
price = allPrice + postPrice
}
return price < 0 ? 0 : (price/100).toFixed(2)
},
//
order() {
if (this.info.is_post == 1 || this.info.is_post == 3) {
console.log(this.sendType)
if (this.sendType == 1 && !this.contacts) {
console.log(this.info.is_post)
if (this.info.is_post == 1 && !this.contacts) {
uni.showToast({
title: '请选择收货地址',
icon: 'none'
@ -440,7 +462,7 @@ export default {
return;
}
if (this.sendType == 2) {
if (this.info.is_post == 2) {
if (!this.pickupAddress.id) {
uni.showToast({title: '请选择自提点',icon: 'none'});
return;
@ -466,19 +488,24 @@ export default {
}
let goods = [];
this.info.goods.forEach(v=>{
let goodsItem = {
specifications_id: this.info.id,
num: this.info.buyNum,
specifications_id: v.skuInfo.id,
num: v.skuInfo.buyNum,
remark: v.skuInfo.remark
// consignee_id: this.info.is_post == 1 ? this.contacts.id : null
};
if (this.sendType == 2) {
if (this.info.is_post == 2) {
goodsItem.extract_id = this.pickupAddress.id;
} else if (this.sendType == 1){
} else if (this.info.is_post == 1){
goodsItem.consignee_id = this.contacts.id
}
goods.push(goodsItem);
})
let data = {
goods: goods,
coupon: this.coupon ? this.coupon.id : "",
@ -537,7 +564,17 @@ export default {
//
async getMaxCouponData () {
let param = {money:this.info.money * this.info.buyNum,sku_ids:this.info.id}
let allPrice =0
let skuIds = []
if (this.info && Array.isArray(this.info.goods)) {
this.info.goods.forEach(v=>{
allPrice += v.skuInfo.money*v.skuInfo.buyNum
if (v.skuInfo.buyNum>0) {
skuIds.push(v.skuInfo.id)
}
})
}
let param = {money:allPrice,sku_ids:skuIds.join(',')}
let res = await this.getMaxCoupon(param)
if (res.id) {
this.coupon = res
@ -677,13 +714,8 @@ view {
display: flex;
align-items: center;
justify-content: center;
// height: 176rpx;
padding: 0 20rpx;
border-top:1rpx solid rgba(216, 216, 216, 1) ;
// .a-img{
// width: 220rpx;
// height: 74rpx;
// }
}
.pickup-person-list{
border-top: 1rpx solid #d8d8d8;
@ -806,7 +838,7 @@ view {
.ctrl {
width: 47rpx;
height: 47rpx;
background: #71B580;
background: #248BAA;
border-radius: 50%;
font-family: PingFang SC;
font-weight: 400;
@ -835,7 +867,7 @@ view {
.btn {
width: 294rpx;
height: 88rpx;
background: #F84A56;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 43rpx;
text-align: center;
line-height: 88rpx;
@ -860,11 +892,11 @@ view {
font-size: 36rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
color: #F84A56;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
color: #F84A56;
font-size: 36rpx;
}
}
@ -991,7 +1023,7 @@ view {
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
background: #71B580;
background: #248BAA;
}
}
@ -1167,7 +1199,9 @@ view {
}
.tickets-box {
width: 697rpx;
width: 698rpx;
margin: 26rpx auto 0;
border-radius: 13rpx;
background: #fff;
height: 120rpx;
.order-title {
@ -1221,7 +1255,7 @@ view {
.sendwayArea{
margin: 26rpx;
display: flex;
border: 1px solid #71B580;
border: 1px solid #248BAA;
border-radius: 13rpx;
width: fit-content;
background-color: white;
@ -1255,16 +1289,25 @@ view {
align-items: center;
.select {
display: block;
width: 140rpx;
height: 58rpx;
text-align: right;
line-height: 58rpx;
font-size: 31rpx;
width: 153rpx;
height: 40rpx;
background: #EE3E3B;
border-radius: 9rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
line-height: 40rpx;
font-family: PingFang SC;
font-weight: 400;
margin-right: 20rpx;
}
}
.shop-name{
font-weight: bold;
font-size: 31rpx;
color: #333333;
padding-bottom: 12rpx;
min-height: fit-content;
}
</style>

11
subPackages/techan/selfPickUpPoint.vue

@ -23,11 +23,11 @@
暂无自提点地址
</view>
</view>
<view class="btn-bottom">
<!-- <view class="btn-bottom">
<view class="addBox" @click.stop="confirmPoint">
确定
</view>
</view>
</view> -->
</view>
@ -88,6 +88,9 @@
selectPoint (item) {
this.selectItem = item
// selectItem
uni.$emit("updateDataByConnect", {msgType:'updatePickUpPoint',data:this.selectItem})
uni.navigateBack()
},
goMap (item) {
@ -168,7 +171,7 @@
width:140rpx;
flex-shrink: 0;
border-left: 1px solid #D8D8D8;
color: #71B580;
color: #248BAA;
display: flex;
flex-direction: column;
align-items: center;
@ -181,7 +184,7 @@
}
}
.item-bg.active{
background-image: linear-gradient(-20deg, #9EE4FE, #7FD491);
background: #248BAA;
}
.name {
display: flex;

538
subPackages/techan/techanList.vue

@ -2,6 +2,18 @@
<view class="bg">
<span class="iconfont topLeft" @click="goBack">&#xe660;</span>
<img :src="showImg('/uploads/20240924/4a580d7089dbdb07f830909c25f0f751.jpg')" class="topImg" />
<view class="type-container">
<view class="send-type-container">
<view :class="['type',type1==0?'active':'']" @click.stop="changeType('type1',0)">自提专区</view>
<view :class="['type',type1==1?'active':'']" @click.stop="changeType('type1',1)">邮寄专区</view>
</view>
<view class="goods-type-container">
<view :class="['type',type2==0?'active':'']" @click.stop="changeType('type2',0)">特产</view>
<view :class="['type',type2==1?'active':'']" @click.stop="changeType('type2',1)">文创</view>
</view>
</view>
<view class="box">
<view class="item" v-for="item in list" :key="item.id" @click="viewDetail(item)">
<image class="item-img" :src="showImg(item.image)" mode=""></image>
@ -11,28 +23,144 @@
<view class="price">
{{item.money/100}}
</view>
<view class="buy">
<view class="buy" v-show="type1==0">
立即购买
</view>
<view class="buy-cart" v-show="type1==1" @click.stop="showOrderCart(item)">
</view>
</view>
</view>
</view>
</view>
<view style="height: 148rpx;width: 1rpx;" v-if="type1==1"></view>
<view class="btn-bottom" v-if="type1==1">
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" style="width: 100%;height: 100%;">
<template class="btn-list" slot="content">
<view class="left-box">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#F84A56',border:'1px solid #F84A56'}">
<view class="img-box" @click.stop="showCartClick">
<image src="https://yjdtadmin.sz-trip.com/uploads/20240726/76702dae980283c24f9d471262f0cbbe.png" mode="aspectFill"></image>
</view>
</uni-badge>
<view class="bottom-price">
<view class="bottom-price-yuan">{{paramData.iNum}}</view>
<view>.{{paramData.fNum}}</view>
</view>
<view class="bottom-detail-icon" @click.stop="showCartClick">
明细
<view v-if="!paramData.showCart" style="transform: rotate(-90deg);"><uni-icons color="#000" type="left" size="15"></uni-icons></view>
<view v-else style="transform: rotate(90deg);"><uni-icons color="#000" type="left" size="15"></uni-icons></view>
</view>
</view>
<view class="btn-buy" @click="goCartOrder">
提交订单
</view>
</template>
</cartDataVue>
</view>
<uni-popup ref="popup" type="bottom" :safe-area="true">
<view class="popup-content" v-if="sku.length>0">
<view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;">
<uni-icons type="closeempty" size="24"></uni-icons>
</view>
<view class="bottom-productImg">
<img :src="showImg(sku[productIndex].image)" alt="">
<view class="right-content">
<view class="bottom-productPrice com-price">{{(sku[productIndex].money||0)/100}}</view>
<view class="bottom-content text-overflow">已选择{{sku[productIndex].title}}</view>
</view>
</view>
<view>
<view class="sp">
规格
</view>
<view style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;">
<view style="position:relative;" v-for="(botItem,botIndex) in sku" :key="botIndex">
<view :class="['botProduct','text-overflow',{'noStore':botItem.store==0},{'botProducts':productIndex==botIndex}]"
@click="changeProduct(botItem,botIndex)">
{{botItem.title}}
</view>
<view class="noStore-text" v-if="botItem.store==0">
不可购买
</view>
</view>
</view>
</view>
<view class="buy-num com-flex-tao">
数量
<view class="number-btn">
<view>
<text @click="delNumber">-</text>
</view>
<view style="width: 96rpx;height: 69rpx;margin: 0 14rpx;">{{ buyNum }}</view>
<view>
<text @click="addNumber">+</text>
</view>
</view>
</view>
</view>
<view class="placeholder-content">
<view style="height: 100rpx;"></view>
<view class="btn-cover">
<view class="btn" @click.stop="order">加入购物车</view>
</view>
</view>
<!-- <view class="btn-box">
<view class="buy-btn" @click="order">
下一步
</view>
</view> -->
</uni-popup>
</view>
</template>
<script>
import cartDataVue from '../../compoents/cartData.vue'
export default {
components: {cartDataVue},
data() {
return {
type1:0,
type2:0,
list:[],
finished: false,
paramData: {allPrice: 0,iNum:0, fNum:'00', showCart: false, num: 0},
currentGoods: {},
sku: [],
productIndex: 0,
buyNum: 1,
cartDataVueShow: false
}
},
onReady() {
this.getList()
},
methods: {
changeType (typeName, value) {
if (this[typeName]!==value) {
this[typeName]=value
// this.list = []
// this.getList()
}
},
//
getList(){
this.Post({
@ -53,7 +181,95 @@
url: '/subPackages/techan/detail?id=' + item.id
})
}
},
showCartClick () {
if (this.paramData.showCart) {
this.$refs.cartDataVueRef.closePopup()
} else {
this.$refs.cartDataVueRef.openPop()
}
},
changeParamData (data) {
for(let key in this.paramData) {
this.paramData[key] = data[key]
}
},
//
showOrderCart (item) {
console.log(item)
this.sku = []
this.productIndex = 0
this.buyNum = 1
this.currentGoods = JSON.parse(JSON.stringify(item))
this.getSpecificationsByGoodsId(item.id)
},
changeProduct(index) {
this.productIndex = index
},
getSpecificationsByGoodsId(goods_id) {
this.Post({goods_id: goods_id},'/api/goods/getSpecificationsByGoodsId'
).then(res => {
if (res) {
this.sku = res.data;
if (!this.sku||this.sku.length<=0) {
uni.showToast({
title:'暂无可选规格',
icon:'none'
})
return
}
this.openPop()
}
});
},
//
addNumber() {
this.buyNum += 1;
},
delNumber() {
if (this.buyNum <= 1) {
return;
}
this.buyNum -= 1;
},
closePopup() {
this.$refs.popup.close()
},
openPop(){
this.$refs.popup.open()
},
order() {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
let goodsInfo = {goodsInfo:this.currentGoods, skuInfo: goods, isSelected: true}
this.Post({good_id: this.currentGoods.id, specifications_id: goods.id,num: this.buyNum },
'/api/shopping/addShopping').then(res => {
if (res) {
let selectedData = []
try {
selectedData = JSON.parse(uni.getStorageSync('cartDataInfo'));
} catch(e) {
selectedData = []
}
let currentGoods = selectedData.find(v =>v==goods.id)
if (!currentGoods) {
selectedData.push(goods.id)
}
uni.setStorageSync('cartDataInfo', JSON.stringify(selectedData));
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closePopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
goCartOrder () {
this.$refs.cartDataVueRef.goCartOrder()
},
},
onReachBottom() {
setTimeout(() => {
@ -69,7 +285,7 @@
}
.bg {
background: #FFFFFF;
background:#F7F7F7;
min-height: 100vh;
padding-bottom: 26rpx;
}
@ -154,7 +370,7 @@
.buy {
width: 140rpx;
height: 42rpx;
background: #71B580;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 21rpx;
text-align: center;
line-height: 42rpx;
@ -163,5 +379,321 @@
font-size: 27rpx;
color: #FFFFFF;
}
.buy-cart{
width: 42rpx;
height: 42rpx;
imgae{
width: 100%;
height: 100%;
}
}
.type-container{
width: 100%;
height: 227rpx;
padding: 40rpx 26rpx 0;
background: #FFFFFF;
.send-type-container{
width: 100%;
height: 66rpx;
padding: 4rpx;
background: #EAF6F9;
border-radius: 13rpx;
border: 1px solid #248BAA;
display: flex;
.type{
flex: 1;
flex-shrink: 0;
text-align: center;
height: 100%;
border-radius: 13rpx;
font-weight: 500;
font-size: 28rpx;
color: #248BAA;
display: flex;
align-items: center;
justify-content: center;
}
.type.active{
color: #FFFFFF;
background: #248BAA;
}
}
.goods-type-container{
width: 100%;
margin-top: 64rpx;
height: 55rpx;
display: flex;
.type {
flex: 1;
flex-shrink: 0;
height: 100%;
font-weight: 500;
font-size: 31rpx;
color: #666666;
display: flex;
justify-content: center;
position: relative;
}
.type.active{
color: #000000;
font-weight: bold;
}
.type.active::after{
content: '';
width: 67rpx;
height: 5rpx;
background: #248BAA;
border-radius: 3rpx;
position: absolute;
bottom: 0;
}
}
}
.btn-list {
z-index: 99;
position: fixed;
bottom: 0;
width: 750rpx;
height: 148rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50rpx;
.left-box {
display: flex;
align-items: center;
.bottom-price{
display: flex;
align-items: baseline;
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #F84A56;
padding: 0 33rpx;
.bottom-price-yuan{
font-size: 40rpx;
}
}
.bottom-detail-icon{
font-size: 24rpx;
display: flex;
align-items: center;
}
.img-box {
image {
width: 78rpx;
height: 78rpx;
}
}
}
.btn-buy {
width: 254rpx;
height: 78rpx;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 40rpx;
text-align: center;
line-height: 78rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
}
//
.popup-content {
background-color: white;
padding: 0rpx 39rpx 51rpx 39rpx;
height: auto;
border-radius: 20rpx 20rpx 0 0;
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
}
.bottom-productImg img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
.right-content {
margin: 10rpx 0 0 41rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
&:before {
content: "¥";
font-size: 26rpx;
}
}
.bottom-content {
width: 331rpx;
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
.botProduct {
width: 320rpx;
// height: 78rpx;
border-radius: 13rpx;
background-color: #F5F5F5;
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
line-height: 78rpx;
text-align: center;
margin-bottom: 25rpx;
display: inline-block;
position: relative;
padding: 0 40rpx;
}
.noStore{
background-color: rgba(239, 239, 239, 1);
color: rgba(153, 153, 153, 1);
}
.noStore-text{
width: 113rpx;
height: 43rpx;
background: #C0C0C0;
border-radius: 7rpx 0rpx 7rpx 0rpx;
text-align: center;
line-height: 43rpx;
position: absolute;
right: -14rpx;
top: -20rpx;
font-size: 23rpx;
font-family: PingFangSC;
font-weight: 400;
color: #FFFFFF;
}
.botProducts {
// border: 1rpx solid #00AAFF;
// background-color: rgba(254, 180, 25, 1);
background: #248BAA;
color: #FFFFFF;
}
.buy-num {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
// border-top: 1rpx solid #CCCCCC;
padding: 39rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.buy-num .number-btn {
display: flex;
}
.buy-num .number-btn view {
display: flex;
justify-content: center;
align-items: center;
width: 69rpx;
height: 69rpx;
border: 1rpx solid #CCCCCC;
border-radius: 7rpx;
}
.buy-num .number-btn>view text {
font-size: 46rpx;
}
.buy-btn {
width: 670rpx;
height: 78rpx;
text-align: center;
line-height: 78rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
border-radius: 40rpx;
font-size: 34rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
.btn-box {
width: 750rpx;
height: 151rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
display: flex;
align-items: center;
justify-content: center;
}
.sp {
width: 100%;
height: 30rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 400;
color: #060001;
line-height: 30rpx;
border-top: solid 2rpx #ccc;
margin: 60rpx 0;
padding-top: 30rpx;
}
}
.placeholder-content{
background: white;
position: relative;
.btn-cover{
z-index: 200;
position: fixed;
bottom: 0;
width: 750rpx;
height: 148rpx;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
.btn{
width: 670rpx;
height: 78rpx;
text-align: center;
line-height: 78rpx;
background: linear-gradient(-90deg, #F84A56, #FF9834);
border-radius: 40rpx;
font-size: 34rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
}
}
</style>

165
subPackages/ticketBooking/detail.vue

@ -1,24 +1,42 @@
<template>
<view class="bg">
<view class="swipe-box">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" @change="swiperChange">
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id">
<swiper-item v-if="info && info.videourl">
<video
:src="showImg(info.videourl)"
id="detailVideo"
:poster="
showImg(info.image)
"
@play="play"
@error="videoErrorCallback"
controls
style="width: 100%;height: 100%;"
object-fit="cover"
></video>
</swiper-item>
<view class="swiper-item">
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<view class="swiper-pointer">
{{swiperCurrent}}/{{info.list_images.split(',').length}}
</view>
</view>
<view class="detail-container">
<view class="common-container info-container">
<view class="flex-between">
<view class="info-title text-overflowRows">{{info.title}}</view>
<view class="collect" @click="collect">
<!-- <view class="collect" @click="collect">
<image :src="showImg('/uploads/20240827/8a55a8936b9324fa1c7b85c2da9c015b.png')" mode="" v-if="info.is_collect == 0"></image>
<image v-else :src="showImg('/uploads/20240827/6bf73216f19c756961496031f8aed053.png')" mode="" ></image>
<view>收藏</view>
</view>
</view> -->
</view>
<view class="flex-between time-container">
<view class="flex flex-1 flex-shrink-0 flex-items-center">
@ -30,16 +48,40 @@
</view>
<view></view>
</view>
<view class="flex-between">
<view class="flex flex-1 flex-shrink-0 flex-items-center">
<image class="address-icon flex-shrink-0" :src="showImg('/uploads/20240827/3d357e6e562de9395f373dc380a790a7.png')" mode=""></image>
<view class="title text-overflowRows">
<text style="margin-right: 28rpx;">景区地址</text>
{{info.address}}
<view class="flex-between" style="align-items: flex-start;">
<view class="flex flex-1 flex-shrink-0 flex-items-center" style="align-items: flex-start;">
<image class="address-icon flex-shrink-0" style="margin-top: 5rpx;" :src="showImg('/uploads/20240827/3d357e6e562de9395f373dc380a790a7.png')" mode=""></image>
<view class="title address-title text-overflowRows">
<text class="flex-shrink-0" style="margin-right: 28rpx;">景区地址</text>
<text class="address-detail flex-1">{{info.address}}</text>
</view>
</view>
<view @click="goMap">
<img style="width: 30rpx;height: 30rpx;" :src="showImg('/uploads/20240827/5b19517f2a630f3a766ea03ac621a3be.png')">
<view @click="goMap" class="map-icon">
<img style="width: 50rpx;height: 50rpx;" :src="showImg('/uploads/20240827/5b19517f2a630f3a766ea03ac621a3be.png')">
<view>去这里</view>
</view>
</view>
</view>
<view class="box-title">语音讲解</view>
<view class="common-container info-container" >
<view class="info-title text-overflowRows" style="font-weight: normal;">{{info.title}}</view>
<view class='flex flex-between audio' >
<!-- <view class='flex-shrink-0'>{{getTime(Math.round(currentAudio.currentTime.toFixed(0)))}}</view> -->
<view class='flex-shrink-0'>01:30</view>
<!-- <Voice-play :duration="133" :play="false"></Voice-play> -->
<view class='flex-1' style="width: 10rpx;padding:0 30rpx">
<slider @change="audioSeek" style="width: 100%;margin: 0;" :block-size="12" backgroundColor='#E4F1F5'
activeColor='#248BAA' :min='0' :max="120" :value="60" :step='0.1'></slider>
<!-- :max='currentAudio.video_length.toFixed(0)' :value='currentAudio.currentTime.toFixed(0)' -->
</view>
<!-- <view class='flex-shrink-0'> {{getTime(Math.round(currentAudio.video_length))}}</view> -->
<view class='flex-shrink-0'> 03:00</view>
<view class='play-icon' style="height:59rpx" @tap.stop="playVoice">
<image src='https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20221224/cace8838685f41c4bae567937f531808.png' ></image>
<!-- <image src='https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20221224/aff3dacd182b3a413406dd4be08c5506.png' class='icon'></image> -->
</view>
</view>
</view>
@ -58,7 +100,7 @@
</view>
</view>
<view class="notice" @click="showSkuInfo(itemSku, item)">
<view style="color: #248BAA;" class="notice" @click="showSkuInfo(itemSku, item)">
预订须知 >
</view>
</view>
@ -77,7 +119,7 @@
</view>
</view>
<view class="box-title"></view>
<view class="box-title">景点简</view>
<view class="common-container" style="padding: 30rpx;">
<view class="" id="cpts" v-html="formateRichText(info.feature_content)"></view>
</view>
@ -124,6 +166,7 @@
</view>
<view class="dateMore" @click="openCalendar">
<view style="width: 55rpx;">更多日期</view>
<view style="padding-left: 9rpx;">></view>
</view>
</view>
@ -162,6 +205,7 @@
data() {
return {
headImg: null,
swiperCurrent: 1,
id: null,
@ -190,6 +234,9 @@
this.getGoodsList()
},
methods: {
swiperChange (e) {
this.swiperCurrent = e.detail.current+1
},
//
getInfo() {
this.Post({id: this.id},'/api/scenic/getScenicById').then(res => {
@ -446,9 +493,23 @@
}
.swipe-box {
height: 484rpx;
height: 413rpx;
position: relative;
.swiper-pointer{
position: absolute;
right: 26rpx;
bottom: 46rpx;
background: rgba(22,22,22,0.5);
border-radius: 23rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
padding: 6rpx 14rpx;
}
.swiper-item-num {
width: 90rpx;
height: 40rpx;
@ -467,16 +528,16 @@
}
.swiper {
height: 484rpx;
height: 413rpx;
position: relative;
.swiper-item {
width: 100%;
height: 484rpx;
height: 413rpx;
.item-img {
width: 750rpx;
height: 484rpx;
height: 413rpx;
}
}
}
@ -507,10 +568,11 @@
}
.info-title{
width: 550rpx;
width: 100%;
font-family: PingFang SC;
font-size: 31rpx;
height: 80rpx;
font-weight: bold;
}
.collect{
font-size: 23rpx;
@ -583,7 +645,7 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
justify-content: space-between;
}
.price {
font-family: PingFangSC;
@ -603,7 +665,7 @@
margin-top: 20rpx;
width: 133rpx;
height: 53rpx;
background: linear-gradient(270deg, #FD6F34, #F4A61F);
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 27rpx;
text-align: center;
line-height: 53rpx;
@ -663,11 +725,11 @@
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #000000;
color: #111;
display: flex;
flex-direction: column;
flex-direction: row;
align-items: center;
justify-content: space-around;
justify-content: center;
flex-shrink: 0;
padding: 6rpx 0;
position: absolute;
@ -691,7 +753,7 @@
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #000000;
color: #000;
display: flex;
flex-direction: column;
align-items: center;
@ -700,9 +762,8 @@
padding: 6rpx 0;
}
.item.active{
background: linear-gradient(-56deg, #9EE4FE, #7FD491);
color: #000000;
border: none;
background: rgba(36,139,170,0.12);
border: 1px solid #248BAA;
}
.item.disabled{
color: #666;
@ -741,8 +802,8 @@
color: #000;
}
.time-active {
background: linear-gradient(270deg, #9EE4FE, #7FD491);
border: none;
background: rgba(36,139,170,0.12);
border: 1px solid #248BAA;
}
.time-disable {
color: #666666;
@ -781,7 +842,7 @@
.bottom-btn {
width: 250rpx;
height: 80rpx;
background: #F74A57;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 40rpx;
font-size: 32rpx;
text-align: center;
@ -790,4 +851,48 @@
line-height: 78rpx;
}
}
.address-title{
display: flex;
align-items: flex-start;
.address-detail{
font-weight: 500;
font-size: 27rpx;
color: #666666;
padding-right: 40rpx;
}
}
.map-icon{
flex-direction: column;
height: 80rpx;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 20rpx;
color: #248BAA;
}
.audio{
.play-icon{
height: 51rpx;
padding-left: 49rpx;
width: 100rpx;
image{
width: 51rpx;
height: 51rpx;
}
}
}
/deep/ .uni-calendar-item--extra{
color: #333 !important;
}
/deep/ .uni-calendar-item--isDay{
background: #248BAA !important;
border-radius: 50%;
.uni-calendar-item--extra{
color: white !important;
}
}
</style>

61
subPackages/ticketBooking/order.vue

@ -8,7 +8,7 @@
<view v-if="showDate.startTime">{{ showDate.startTime }}-{{ showDate.endTime }} 入园</view>
</view>
</view>
<view class="top-edit" @click="changeSku">修改 ></view>
<view class="top-edit" @click="changeSku">修改 <uni-icons style="height: 20rpx;" color="#999999" type="right" size="12"></uni-icons></view>
</view>
<view class="tickets-box">
@ -34,7 +34,7 @@
</view>
<view>预订须知 ></view>
</view>
<!-- <view style="color: #71B580;" class="num-subtitle text-overflow">购票限制没有绑定字段</view> -->
<view style="color: #EE3E3B;" class="num-subtitle text-overflow">购票限制没有绑定字段</view>
</view>
</view>
<view class="buyMore" @click="showMore=!showMore">
@ -109,11 +109,11 @@
<view class="w-full" style="padding-bottom: 33rpx;" v-else>
<view class="person-need" >
<view class="flex flex-items-center">
<uni-icons color="#71B580" type="plus" size="30"></uni-icons>
<uni-icons color="#248BAA" type="plus" size="30"></uni-icons>
<text style="padding:0 30rpx;">出行人{{personIndex+1}}</text>
<text >点击填写1位出行人信息</text>
</view>
<uni-icons color="#71B580" type="right" size="16"></uni-icons>
<uni-icons color="#248BAA" type="right" size="16"></uni-icons>
</view>
</view>
</view>
@ -148,11 +148,11 @@
<view class="w-full" style="padding-bottom: 33rpx;" v-else>
<view class="person-need" >
<view class="flex flex-items-center">
<uni-icons color="#71B580" type="plus" size="30"></uni-icons>
<uni-icons color="#248BAA" type="plus" size="30"></uni-icons>
<text style="padding:0 30rpx;">出行人1</text>
<text >点击填写1位出行人信息</text>
</view>
<uni-icons color="#71B580" type="right" size="16"></uni-icons>
<uni-icons color="#248BAA" type="right" size="16"></uni-icons>
</view>
</view>
</view>
@ -178,7 +178,7 @@
<view @click="goOrderCoupon" class="tickets-container flex-between top-line">
<view class="order-title">优惠券</view>
<view class="coupon-btn" v-if="coupon==''">
<view class="select">选择</view>
<view class="select">选择优惠券</view>
<uni-icons style="height: 42rpx;" color="#999999" type="right" size="18"></uni-icons>
</view>
<div class="coupon-price" v-else>
@ -201,7 +201,7 @@
<view class="people-popup">
<view class="top flex-between" style="padding-bottom: 14rpx;">
<text class="text-overflow" @click="changeAddressPopup('close')">取消</text>
<text style="color: #71B580;" class="confirm" @click="changeAddressPopup('close',true)">确定</text>
<text style="color: #248BAA;" class="confirm" @click="changeAddressPopup('close',true)">确定</text>
</view>
<view class="button" @click="changeAddressAddPopup('open',{})">添加出行人</view>
<view class="popup-list" v-if="addressList.length > 0">
@ -231,7 +231,7 @@
<view class="top flex-between" style="height: fit-content;">
<text class="text-overflow" @click="changeAddressAddPopup('close')">取消</text>
<text style="font-size: 35rpx;font-weight: 600;">{{addressTitle}}</text>
<text style="color: #71B580;" class="confirm" @click="saveAddress">保存</text>
<text style="color: #248BAA;" class="confirm" @click="saveAddress">保存</text>
</view>
</view>
@ -697,7 +697,7 @@
//
changeAddressAddPopup(type, item) {
if (type == 'open') {
this.addressTitle = '新增出行人'
this.addressTitle = '添加出行人'
if (item.id) { this.addressTitle = '编辑出行人' }
this.$refs.addressAddPopup.open('bottom');
this.$nextTick(()=>{
@ -1107,7 +1107,7 @@
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #71B580;
color: #999999;
}
}
@ -1174,7 +1174,7 @@
width: 46rpx;
height: 46rpx;
line-height: 40rpx;
background: #71B580;
background: #248BAA;
border-radius: 50%;
font-weight: 500;
font-size: 45rpx;
@ -1205,11 +1205,11 @@
width: 148rpx;
text-align: center;
border-radius: 23rpx;
border: 1px solid #71B580;
border: 1px solid #248BAA;
font-family: PingFang SC;
font-weight: bold;
font-size: 25rpx;
color: #71B580;
color: #248BAA;
line-height: 45rpx;
}
}
@ -1247,7 +1247,7 @@
margin-right: 14rpx;
position: relative;
&.active{
background: linear-gradient(135deg, #9EE4FE, #7FD491);
background: #248BAA
}
.disabled{
font-weight: 400;
@ -1257,7 +1257,7 @@
.selected{
width: 28rpx;
height: 28rpx;
background: #87CD93;
background: #248BAA;
border-radius: 10rpx 0rpx 10rpx 0rpx;
position: absolute;
bottom: 0;
@ -1313,7 +1313,7 @@
.person-need{
width: 100%;
height: 80rpx;
background: #EFF9F1;
background: #EAF6F9;
border-radius: 13rpx;
display: flex;
align-items: center;
@ -1321,19 +1321,19 @@
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #71B580;
color: #248BAA;
padding: 0 20rpx;
}
.person-item-more{
width: 110rpx;
height: 73rpx;
background: #EFF9F1;
background: #EAF6F9;
border-radius: 11rpx;
text-align: center;
font-family: PingFang SC;
font-weight: 500;
font-size: 29rpx;
color: #71B580;
color: #248BAA;
line-height: 73rpx;
position: absolute;
right: 0;
@ -1419,7 +1419,7 @@
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
background: #71B580;
background: #248BAA;
margin-left: 10rpx;
}
}
@ -1488,7 +1488,7 @@
}
.popup-item.active{
background-image: linear-gradient(135deg, #9EE4FE, #7FD491);
background: #248BAA
}
.popup-item.disabled{
.item-top {
@ -1555,7 +1555,7 @@
.btn {
width: 250rpx;
height: 80rpx;
background: #F74A57;
background: linear-gradient(-90deg, #FC5109, #FC930A);
border-radius: 43rpx;
text-align: center;
line-height: 80rpx;
@ -1771,13 +1771,16 @@
align-items: center;
.select {
display: block;
width: 140rpx;
height: 58rpx;
text-align: right;
line-height: 58rpx;
font-size: 31rpx;
width: 153rpx;
height: 40rpx;
background: #EE3E3B;
border-radius: 9rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
line-height: 40rpx;
font-family: PingFang SC;
font-weight: 400;
margin-right: 20rpx;
}

Loading…
Cancel
Save