chenkainan 4 months ago
parent
commit
202fdd1a77
  1. 51
      components/cartData.vue
  2. 18
      pages.json
  3. 7
      static/js/CommonFunction.js
  4. 835
      subPackages/food/detail.vue
  5. 150
      subPackages/food/index.vue
  6. 669
      subPackages/food/order.vue
  7. 322
      subPackages/techan/detail.vue
  8. 446
      subPackages/techan/index.vue
  9. 15
      subPackages/techan/order.vue
  10. 11
      subPackages/techan/selfPickUpPoint.vue
  11. 297
      subPackages/ticket/detail.vue

51
components/cartData.vue

@ -8,12 +8,12 @@
<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="showImg('/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png')">
<image src="https://cgc.js-dyyj.com/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png">
</view>
<view style="padding-left: 26rpx;" >全选</view>
</view>
<view class="delete-area flex flex-items-center" @click.stop="clearAllGoods">
<image :src="showImg('/uploads/20241104/50900c9a5fa5fbdbdee526abc9af4a40.png')"></image>
<image src="https://cgc.js-dyyj.com/uploads/20241104/50900c9a5fa5fbdbdee526abc9af4a40.png"></image>
<view style="padding-left: 8rpx;" >清空</view>
</view>
</view>
@ -23,25 +23,24 @@
<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="showImg('/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png')">
<image src="https://cgc.js-dyyj.com/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png">
</view>
<view style="padding-left: 26rpx;flex:1">
<view class="commodity box" >
<image class="img" :src="showImg(item.Specifications_image)" mode="aspectFill"></image>
<image class="img" :src="showImg(item.sku.headimg)" 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 class="text-overflowRows" style="font-weight: bold;">{{ item.product.title }}</view>
<view class="text-overflowRows" style="font-size: 27rpx;color: #999999;padding-top: 10rpx;">{{ item.sku.sku_name }}</view>
</view>
<view class="flex flex-between">
<view class="commodity-price">
<view style="font-size: 40rpx;">{{item.Specifications_money/100}}</view>
<view style="font-size: 40rpx;">{{item.sku.price/100}}</view>
</view>
<view class="add-num-area">
<view :class="['ctrl',item.num>1?'':'disabled']" @click.stop="addBuyNum(item,-1,i)" >-</view>
<view>{{item.num}}</view>
<view :class="['ctrl']" @click.stop="addBuyNum(item,1,i)">+</view>
</view>
</view>
</view>
@ -50,7 +49,10 @@
</view>
</view>
<view style="height: 140rpx;width: 1rpx;"></view>
</view>
</view>
</uni-popup>
@ -137,7 +139,7 @@
this.cartData = data
this.setAllSelect()
} else {
this.Post({},'/api/shopping/getShoppingList').then(res => {
this.Post({},'/api/cart/get_list').then(res => {
if (res) {
this.cartData = (res.data || []).map(v=>{return {...v, isSelected:selectedData.includes(v.specifications_id)}})
this.setAllSelect()
@ -166,13 +168,13 @@
},
clearAllGoods(){
let _this = this
Promise.all(this.cartData.map(v=>{
return _this.Post({s_id: v.id},'/api/shopping/delShopping')
})).finally(res =>{
let ids = this.cartData.map(v=>v.sku.id)
if (ids.length>0) {
this.Post({sku_id:ids.join(',')},'/api/cart/del_sku').then(res=>{
this.cartData = []
this.setAllSelect()
})
}
},
setAllSelect() {
let goods = this.cartData
@ -188,13 +190,13 @@
addBuyNum(item, num,index){
if (num == -1 && item.num == 1) {
this.Post({s_id: item.id},'/api/shopping/delShopping').then(res =>{
this.Post({sku_id: item.id, num: 0},'/api/cart/del_sku').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 =>{
this.Post({sku_id: item.id, num: numData},'/api/cart/update_sku').then(res =>{
item.num += num
this.setAllSelect()
})
@ -205,7 +207,7 @@
let selectedGoods = this.cartData.filter(v=>v.isSelected)
let totalPrice = 0
selectedGoods.forEach(v=>{
totalPrice += v.Specifications_money/100 * v.num
totalPrice += v.sku.price/100 * v.num
})
totalPrice = totalPrice.toFixed(2)
console.log(totalPrice)
@ -227,6 +229,8 @@
})
return
}
return
// todo
let orderData = this.cartData.filter(v=>v.isSelected).map(v=>{
return {
goodsInfo: {
@ -245,17 +249,7 @@
})
let orderInfo = {
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'
});
},
},
@ -275,7 +269,6 @@
flex-direction: column;
background-color: white;
height: 933rpx;
padding-bottom: 184rpx;
border-radius: 20rpx 20rpx 0rpx 0rpx;
display: flex;
flex-direction: column;
@ -316,7 +309,7 @@
flex: 1;
height: 10rpx;
overflow-y: auto;
padding:0 26rpx 26rpx;
padding:0 26rpx 0rpx;
.content-item{
margin-bottom: 48rpx;
@ -438,7 +431,7 @@
.ctrl {
width: 47rpx;
height: 47rpx;
background: #515150;
background: #6A8A2D;
border-radius: 50%;
font-family: PingFang SC;
font-weight: 400;

18
pages.json

@ -90,6 +90,24 @@
"navigationBarTitleText" : "选择自提点"
}
},
{
"path": "food/index",
"style": {
"navigationBarTitleText" : "农家烟火"
}
},
{
"path": "food/detail",
"style": {
"navigationBarTitleText" : "详情"
}
},
{
"path": "food/order",
"style": {
"navigationBarTitleText" : "订单填写"
}
},
{
"path" : "line/index",

7
static/js/CommonFunction.js

@ -242,3 +242,10 @@ Vue.prototype.gotoDetailByType = item => {
console.log(url)
Vue.prototype.gotoPath(url)
}
// 跳转购物车
Vue.prototype.goCartPage = ()=>{
uni.switchTab({
url: "/pages/cart/cart"
})
}

835
subPackages/food/detail.vue

@ -0,0 +1,835 @@
<template>
<view class="bg" v-if="info">
<view class="swipe-box">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular>
<swiper-item v-for="(item, index) in info.listimg" :key="item.id">
<view class="swiper-item">
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
</view>
<view class="detail-container">
<!-- 景点信息 -->
<view class="info-container">
<view class="wineScene-price">
<view class="price">
{{info.price / 100}}
<text class="old-price">{{info.market_price/100}}</text>
</view>
<view>已售{{info.sales_number||0}}</view>
</view>
<view class="info-data">
<view class="text-overflowRows">{{info.title}}</view>
<view style="padding-top: 27rpx;" v-if="info.is_package">
<view class="wineScene-subtitle" v-for="(item,key,index) in info.product_data || []" :key="index">
<view>{{ key[0] }}</view>
<view class="wineScene-item">
<view class="flex-between" v-for="(data,dataI) in item" :key="dataI">
{{ data.title }}
<text>{{ data.unit }}</text>
</view>
</view>
<view class="wineScene-line"></view>
</view>
</view>
</view>
<view style="margin: 16rpx 0;">
<view class="map-container flex-between">
<view class="flex flex-column flex-1 w-1rpx" style="padding-right: 20rpx;">
<text class="text-overflow" style="font-size: 28rpx;color: #000000;">{{info.scene_name}}</text>
<text class="text-overflow" style="margin-top: 14rpx;">{{info.scene_address}}</text>
</view>
<view @click="goMap" class="flex flex-column flex-between flex-shrink-0">
<image style="width: 29rpx;height: 29rpx;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/wineScene/navigation.png"></image>
<text style="margin-top: 14rpx;">去这里</text>
</view>
</view>
</view>
<view class="scroll-all-box" id="menus">
<view :class="'scroll-menus' + (fixed ? ' fixed-menus' : '')">
<view :class="'scroll-menu-item' + (type == 1 ? ' active' : '')" @click="changeMenu(1)">产品特色</view>
<view :class="'scroll-menu-item' + (type == 2 ? ' active' : '')" @click="changeMenu(2)">费用说明</view>
<view :class="'scroll-menu-item' + (type == 3 ? ' active' : '')" @click="changeMenu(3)">预定须知</view>
</view>
<view style="height: 85rpx" v-if="fixed"></view>
<view class="info-box info-box-query" id="box1">
<view class="info-title">产品特色</view>
<view class="info-content" v-html="formateRichText(info.content)"></view>
</view>
<view class="info-box info-box-query" id="box2">
<view class="info-title">费用说明</view>
<view class="info-content" v-html="formateRichText(info.expense_info)"></view>
</view>
<view class="info-box info-box-query" id="box3">
<view class="info-title">预定须知</view>
<view class="info-content" v-html="formateRichText(info.book_info)"></view>
</view>
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="btn-box flex-center">
<view class="icon-container">
<view class="icon-item">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/627d67e48ac41903c40c31f1613f2444.png"></image>
<text>客服</text>
</view>
</view>
<view class="flex">
<view class="btn" @click="openPop(true)">加入购物车</view>
<view class="btn" @click="openPop(false)">立即购买</view>
</view>
</view>
<!-- 购物车图标 -->
<view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image>
</uni-badge>
</view>
<!-- 预定弹窗 -->
<uni-popup ref="popup" type="bottom" :safe-area="false" @change="changPopShow" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="sku.length>0">
<view style="padding: 0rpx 39rpx 50rpx 39rpx;">
<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].headimg)" alt="">
<view class="right-content">
<view class="bottom-productPrice com-price">{{(sku[productIndex].price||0)/100}}</view>
<view class="bottom-content">已选择{{sku[productIndex].sku_name}}</view>
</view>
</view>
<view>
<view class="sp">规格</view>
<view class="sp-container" style="">
<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.sku_name}}
</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="sp-bottom-btn">
<view class="btn" @click="openPop">{{addCart?"加入购物车":"立即购买"}}</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
headImg: null,
id: null,
info: null,
down: false,
type: 1,
fixed: false,
sku: [],
productIndex: 0, // sku index
buyNum: 1,
popShow: false,
addCart: false, //
skuInfo: {}, //
selectGoods: {}, //
cartNum: 0,
}
},
onShow(options) {
this.getCartList()
},
onLoad(options) {
this.id = options.id;
this.getInfo();
// this.getGoodsList()
},
onPageScroll(e){
let query = uni.createSelectorQuery()
query.select("#menus").boundingClientRect(res => {
  if(res.top < 0){
this.fixed = true
}else{
this.fixed = false
}
}).exec()
if (this.down) {
return
}else{
this.down = true
query.selectAll(".info-box-query").boundingClientRect(res=>{
let i = res.findLastIndex(v=>v.top-100<=0)
console.log(res, i)
if (i>=0) {
this.type = i+1
}
}).exec()
this.down = false
}
},
methods: {
//
getInfo() {
this.Post({id: this.id},'/api/product/get_product_detail').then(res => {
if (res.data.title) {
uni.setNavigationBarTitle({
title: res.data.title
})
}
let resData = res.data
try {
if (resData.product_data && resData.is_package==1) {
for(let key in resData.product_data) {
resData.product_data[key] = JSON.parse(resData.product_data[key])
}
}
} catch(e) {}
this.info = resData
this.sku = resData.sku
});
},
goMap () {
if (!this.info.lat || !this.info.lon) {
uni.showToast({
title: '暂未配置地理位置',
icon: 'none'
})
return
}
uni.openLocation({
latitude: Number(this.info.lat),
longitude: Number(this.info.lon),
name: this.info.title,
address: this.info.address,
success: function () {
console.log('success');
}
});
},
changeProduct(item,index) {
if (item.store==0) {
uni.showToast({
title:"库存不足!",
icon:'none'
})
return
}
this.productIndex = index
},
getCartList () {
this.Post({},'/api/cart/get_list').then(res=>{
this.cartNum = (res.data || []).length
})
},
order() {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
let orderInfo = [{
pInfo: this.info,
sInfo: goods,
}]
uni.setStorageSync('foodOrder', JSON.stringify(orderInfo)); //
uni.navigateTo({
url: '/subPackages/food/order'
});
},
addToCart () {
let goods = this.sku[this.productIndex]
goods.buyNum = this.buyNum
this.Post({sku_id: goods.id,num: this.buyNum },'api/cart/add_sku').then(res => {
if (res.code == 1) {
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closePopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
closePopup() {
this.$refs.popup.close()
},
openPop(flag) {
if (!this.sku||this.sku.length<=0) {
uni.showToast({
title:'暂无可选规格',
icon:'none'
})
return
}
if (!this.popShow) {
this.addCart = flag
this.$refs.popup.open()
} else {
if (this.addCart) {
this.addToCart()
} else {
this.order()
}
}
},
//
addNumber() {
this.buyNum += 1;
},
delNumber() {
if (this.buyNum <= 1) {
return;
}
this.buyNum -= 1;
},
//
showNoPriceNew(price) {
if (price && price > 0) {
return (price / 100)
} else {
return '0'
}
},
changPopShow (e) {
this.popShow = e.show
},
changeMenu(e) {
this.down = true
let index = e;
let that = this
const query = uni.createSelectorQuery(); //
query.select('#box'+index).boundingClientRect(); //toViewid
query.selectViewport().scrollOffset(); //
query.exec(function (res) {
console.log(res)
let scrollTop = res[0].top + res[1].scrollTop;
uni.pageScrollTo({
scrollTop: scrollTop-50,
duration: 200,
fail: (e)=>{
console.log(e)
},
complete: ()=>{
that.type = index
setTimeout(()=>{that.down = false},1000)
}
});
});
},
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
min-height: 100vh;
background: #F8F8F8;
}
.swipe-box {
height: 413rpx;
position: relative;
.swiper {
height: 413rpx;
position: relative;
.swiper-item {
width: 100%;
height: 413rpx;
.item-img {
width: 750rpx;
height: 413rpx;
}
}
}
}
.detail-container{
width: 100%;
z-index: 2;
padding: 26rpx 0;
position: relative;
top: -52rpx;
}
.info-container{
font-family: PingFang;
font-weight: 500;
font-size: 27rpx;
color: #666;
.wineScene-price{
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
display: flex;
align-items: flex-end;
justify-content: space-between;
width: 750rpx;
background: linear-gradient(-90deg, #FF413B, #FFAB2E);
border-radius: 20rpx 20rpx 0rpx 0rpx;
padding: 32rpx 26rpx;
.price{
font-size: 48rpx;
font-weight: bold;
&::before{
content: '¥';
font-size: 24rpx;
}
}
.old-price{
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
text-decoration-line: line-through;
padding-left: 14rpx;
}
}
.info-data{
background: white;
width: 100%;
padding: 26rpx;
font-weight: bold;
font-size: 32rpx;
color: #000000;
.wineScene-subtitle {
display: flex;
font-weight: 500;
font-size: 24rpx;
color: #666666;
position: relative;
margin-bottom: 16rpx;
&>view:first-child {
width: 33rpx;
height: 33rpx;
background: #6A8A27;
border-radius: 50%;
line-height: 33rpx;
text-align: center;
font-weight: 500;
font-size: 23rpx;
color: #FFFFFF;
margin-right: 8rpx;
position: relative;
z-index: 2;
}
.wineScene-item {
flex: 1;
view:nth-child(n+2) {
margin-top: .3rem;
}
}
.wineScene-line {
width: 11rpx;
background: #D3E8A7;
border-radius: 5rpx;
height: 100%;
position: absolute;
left: 11rpx;
}
}
}
.map-container{
width: 100%;
height: 128rpx;
padding: 30rpx 27rpx;
font-weight: 500;
font-size: 24rpx;
color: #666666;
background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/wineScene/locationBg.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
}
.scroll-all-box {
margin: 20rpx 0;
background-color: #fff;
.scroll-menus {
padding: 0 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 29rpx;
color: #333;
height: 84rpx;
border-bottom: 1rpx solid #d9d9d9;
.scroll-menu-item {
position: relative;
line-height: 84rpx;
&.active{
font-weight: bold;
font-size: 33rpx;
color: #000000;
}
}
.scroll-menu-item.active::after {
content: '1';
font-size: 0;
display: block;
position: absolute;
width: 46rpx;
height: 6rpx;
border-radius: 3rpx;
background: #6A8A27;
left: 50%;
margin-left: -23rpx;
bottom: 0rpx;
}
}
.fixed-menus {
position: fixed;
top: 0;
left: 0;
right: 0;
background: white;
z-index: 1;
}
.info-box {
padding: 20rpx 0;
margin: 0 40rpx;
border-bottom: 1px solid #CCCCCC;
box-sizing: border-box;
.info-title {
font-size: 35rpx;
font-weight: bold;
color: #000;
}
.info-content {
width: 697rpx;
background: #FFFFFF;
border-radius: 20rpx;
padding: 22rpx 14rpx;
margin-top: 20rpx;
}
}
}
.fixed-menus {
position: fixed;
top: 0;
left: 0;
right: 0;
background: white;
z-index: 1;
}
.btn-box {
width: 750rpx;
height: 133rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6,0,1,0.1);
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 10;
padding: 0 46rpx;
.icon-container{
font-weight: 400;
font-size: 23rpx;
color: #666666;
text-align: center;
.icon-item{
display: flex;
align-items: center;
flex-direction: column;
width: 44rpx;
image{
width: 44rpx;
height: 42rpx;
margin-bottom: 8rpx;
}
}
}
.btn{
width: 200rpx;
height: 60rpx;
font-weight: 500;
font-size: 31rpx;
color: #FFFFFF;
line-height: 60rpx;
text-align: center;
background: #6A8A27;
border-radius: 0rpx 11rpx 11rpx 0rpx;
&:first-of-type{
background: #D3E8A7;
border-radius: 11rpx 0rpx 0rpx 11rpx;
color: #6A8A27;
}
}
}
.add-cart-icon{
width: 80rpx;
height: 80rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 140rpx;
right: 20rpx;
z-index: 10;
image{
width: 43.33rpx;
height: 42rpx;
}
}
.popup-content {
background-color: white;
height: auto;
border-radius: 20rpx 20rpx 0 0;
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
flex-shrink: 0;
}
.bottom-productImg img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
.right-content {
margin: 10rpx 0 0 41rpx;
flex: 1;
width: 1rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
&:before {
content: "¥";
font-size: 26rpx;
}
}
.bottom-content {
width: 100%;
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 {
background: #6A8A27;
color: #FFFFFF;
}
.buy-num {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
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: 32rpx 0 60rpx;
padding-top: 30rpx;
}
.sp-container{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
max-height: 400rpx;
overflow-y: auto;
padding-top: 20rpx;
padding-right: 20rpx;
overflow-x: hidden;
}
.sp-bottom-btn{
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;
.btn{
width: 697rpx;
height: 73rpx;
background: #6A8A2D;
border-radius: 11rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 73rpx;
}
}
}
</style>

150
subPackages/food/index.vue

@ -0,0 +1,150 @@
<template>
<view class="bg">
<view class="topImg relative">
<img v-if="headImg" :src="showImg(headImg)" class="topImg" mode="aspectFill">
</view>
<view class="goodBox">
<view @click="viewDetail(item)" class="goodItem" v-for="(item,index) in list" :key="index">
<image class="left-image" :src="showImg(item.headimg||'')" mode="aspectFill"></image>
<view class="contentBox flex-column flex-1 w-1rpx">
<view class="title text-overflowRows">{{item.title}}</view>
<view class="subtitle text-overflow" v-if="item.display_tags" style="font-size: 24rpx;color: #6A8A27;">
{{item.display_tags.split(',').join(" | ")}}
</view>
<view class="subtitle text-overflowRows">{{item.address}}</view>
<view class="price price-money">
{{item.price/100}}
</view>
</view>
</view>
</view>
<!-- <view class="finished-text" v-if="finished">没有更多数据了</view> -->
</view>
</template>
<script>
export default{
data(){
return {
headImg:null,
list: [],
finished: false,
type_id: 391,//id
}
},
onShow() {
this.finished = false
},
onReady() {
this.getHeadImg(2366).then(res => {this.headImg = res})
this.getList()
},
onLoad(options) {
},
methods: {
//
getList(){
this.Post({tag_id: this.type_id,offset: this.list.length,limit: 10},
'/api/product/get_product_by_tag').then(res => {
this.list = [...this.list, ...res.data.list];
if (res.data.length < 10) {
this.finished = true
}
})
},
viewDetail (item) {
uni.navigateTo({
url:'/subPackages/food/detail?id='+item.id
})
},
},
onReachBottom() {
setTimeout(() => {
if (!this.finished) this.getList()
},1000)
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
font-family: PingFangSC;
}
.bg{
min-height: 100vh;
background: #F9FCF3;
}
.topImg{
width: 100%;
height: 386rpx;
}
.goodBox{
width: 100%;
z-index: 2;
padding: 26rpx;
.goodItem{
width: 100%;
height: 240rpx;
margin-bottom: 30rpx;
display: flex;
.left-image{
width: 240rpx;
height: 100%;
border-radius: 20rpx;
flex-shrink: 0;
}
.contentBox{
padding: 10rpx 20rpx 0;
height: 100%;
justify-content: space-between;
.title{
width: 100%;
font-weight: bold;
font-size: 31rpx;
color: #333333;
}
.subtitle{
font-weight: 400;
font-size: 23rpx;
color: #999999;
}
.price{
font-family: PingFang SC;
font-weight: bold;
font-size: 33rpx;
color: #DC2525;
text-align: right;
}
.price-money::before{
content: '¥';
font-size: 24rpx;
}
.price-money::after{
content: '起';
color: #999;
font-size: 24rpx;
font-weight: normal;
}
}
}
}
</style>

669
subPackages/food/order.vue

@ -0,0 +1,669 @@
<template>
<view class="bg">
<view class="order-goods-container" v-for="(item,i) in orderList" :key="i">
<view class="top-box1" >{{ item.pInfo.title }}</view>
<view class="tickets-box">
<view class="w-full num-box">
<view class="flex-between num-left">
<view class="left-title text-overflow">{{item.sInfo.sku_name}}</view>
<view class="left-price">{{item.sInfo.price / 100}}</view>
<view class="num-right">
<view :class="['btn-num',item.sInfo.buyNum<=1?'disabled':'']" @click="delNumber(item.sInfo)" >-</view>
<view class="num-span">{{ item.sInfo.buyNum }}</view>
<view class="btn-num" @click="addNumber(item.sInfo)" >+</view>
</view>
</view>
<view style="padding: 30rpx 0 0rpx;" class="num-subtitle" @click="showpopRule(true, item.sInfo)">
<view style="padding-left:4rpx">预订须知 ></view>
</view>
</view>
</view>
</view>
<view class="people-box" >
<view class="people-box-title">出行人信息</view>
<view style="padding: 42rpx 0 10rpx;">
<view class="people-box-sku">
<view class="w-full flex flex-items-center" style="padding-bottom: 33rpx;font-size: 29rpx;">
<view style="width: 170rpx;font-weight: bold;font-size: 29rpx;" class="flex-shrink-0">联系电话</view>
<view class="flex flex-between flex-1 w-1rpx" >
<input class="input" type="text" placeholder="请输入手机号" v-model="phone" />
<uni-icons v-if="phone&&phone.length>0"
type="closeempty" size="14" @click="clearTel()"></uni-icons>
</view>
</view>
</view>
</view>
</view>
<!-- 优惠券 -->
<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>
<uni-icons style="height: 42rpx;" color="#999999" type="right" size="18"></uni-icons>
</view>
<div class="coupon-price" v-else>
<span v-if="coupon.percent == 0">-{{coupon.discounts/100}}</span>
<span v-else>-{{coupon.percent}}%</span>
<span style="margin:0 31rpx 0 8rpx;color: #6C7A94;">></span>
</div>
</view>
<view class="btn-list">
<view class="price-box">
<view class="text">合计:</view>
<view class="price">{{ total() }}</view>
</view>
<view class="btn" @click="order()">去支付</view>
</view>
<!-- 预订须知的弹窗 -->
<uni-popup ref="popupRule" type="bottom" :safe-area="false">
<view class="popup-content-date flex-column flex" >
<view class="popup-content-title flex">
<view class="flex-1 w-1rpx text-overflow">
{{skuInfo.sku_name}}
</view>
<img src="https://static.ticket.sz-trip.com/taizhou/images/cha.png" @click="showpopRule(null)"
style="width: 20rpx;height: 20rpx;" class="flex-shrink-0">
</view>
<view class="content flex-1 h-1rpx no-scrollbar" v-if="skuInfo && skuInfo.sku_model">
<view class="detail-content" v-html="formateRichText(skuInfo.sku_model.bookinfo)"></view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
//
orderList: [],
phone: '',
coupon:'',
skuInfo: {}, // sku
}
},
onLoad(options) {
// this.getList();
this.$store.commit("choseCoupon", "");
this.initPageData()
},
onShow() {
this.coupon = this.$store.state.user.coupon
},
methods: {
goOrderCoupon () {
let allPrice = 0
let skuIds= []
this.pInfo.specifications.forEach(v=>{
allPrice+= v.price*v.buyNum
if (v.buyNum>0) {
skuIds.push(v.id)
}
})
uni.navigateTo({
url: `/subPackages/order/orderCoupon?allprice=${allPrice}&sku_ids=${skuIds.join(',')}`
})
},
//
async getMaxCouponData () {
let allPrice = 0
this.pInfo.specifications.forEach(v=>{
allPrice+= v.price*v.buyNum
})
let param = {money:allPrice,sku_ids:this.sInfo.id}
let res = await this.getMaxCoupon(param)
if (res.id) {
this.coupon = res
}
},
initPageData () {
let data = uni.getStorageSync('foodOrder');
try{
data = JSON.parse(data)
this.orderList = data
console.log(this.orderList)
} catch(e){
console.log(e)
}
// this.getMaxCouponData()
},
clearTel () {this.phone = ''},
//
delNumber(skuItem) {
if (skuItem.buyNum <= 1) {
return
}
skuItem.buyNum -= 1
this.$store.commit("choseCoupon","");
this.coupon = ''
},
//
addNumber(skuItem) {
skuItem.buyNum += 1
this.$store.commit("choseCoupon","");
this.coupon = ''
},
//
total() {
let price = 0
let allPrice = 0
this.orderList.forEach(v=>{
allPrice+= v.sInfo.price*v.sInfo.buyNum
})
this.allprice = allPrice
if (this.coupon) {
if (this.coupon.percent == 0) {
if (this.coupon.discounts>allPrice) {
price =0
}else{
price = allPrice - (this.coupon.discounts)
}
} else{
price = allPrice - allPrice * (this.coupon.percent/100)
}
} else {
price = allPrice
}
return price < 0 ? 0 : (price/100).toFixed(2)
},
//
showpopRule(flag, item) {
if (item) {
this.skuInfo = item
}
if (flag) {
this.$refs.popupRule.open('bottom');
} else {
this.$refs.popupRule.close();
}
},
/*---------------------------价格日历-----------------------------------*/
order() {
let goods = []
//
let canSubmit = true
this.orderList.filter(v=>v.sInfo.buyNum>0).forEach(item=>{
let sku = item.sInfo
let use_date = item.allSeldDate[item.seldDateIndex].date
let start_time =(item.timesArr[item.seldTimeIndex]||{}).start_time
let end_time = (item.timesArr[item.seldTimeIndex]||{}).end_time
let param = {
specifications_id: sku.id,
num: sku.buyNum,
date: use_date,
start_time: start_time||'',
end_time: end_time||'',
reserve_mobile: this.phone,
}
goods.push(param)
})
let data = {
goods: goods,
coupon: this.coupon ? this.coupon.id : "",
}
console.log('data数据',data);
this.Post({
method: 'POST',
data: JSON.stringify(data)
}, '/api/order/create').then(res => {
if (res.code == 1) {
uni.removeStorageSync('ticketOrder')
console.log(res.data.order_id);
let order_id = res.data.order_id
this.$store.commit("choseCoupon", "");
this.Post({
order_id: order_id,
type: "miniprogram",
platform: 'miniprogram'
}, '/api/pay/unify').then(res => {
if (res.data) {
uni.requestPayment({
nonceStr: res.data.nonceStr,
package: res.data.package,
paySign: res.data.paySign,
signType: res.data.signType,
timeStamp: res.data.timeStamp,
success: () => {
this.getSubscribeMessage()
},
fail() {
uni.navigateTo({
url: '/subPackages/order/trades'
})
}
})
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
min-height: 100vh;
padding: 20rpx;
padding-bottom: 200rpx;
background-color: rgb(247, 247, 247);
}
.top-box1 {
width: 100%;
background: #FFFFFF;
border-radius: 13rpx;
padding: 28rpx 20rpx;
font-weight: bold;
font-size: 33rpx;
color: #000000;
}
.tickets-box{
background: #FFFFFF;
border-radius: 13rpx;
width: 100%;
margin: 20rpx 0;
.num-box {
display: flex;
justify-content: space-between;
flex-direction: column;
padding: 30rpx 20rpx 40rpx;
.num-left {
width: 100%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
.left-title {
font-family: PingFang SC;
font-weight: bold;
font-size: 31rpx;
color: #000000;
width: 450rpx;
}
.left-price {
font-weight: bold;
font-size: 36rpx;
color: #D62828;
padding-right: 27rpx;
}
.left-price::before {
font-size: 24rpx;
content: '¥';
}
}
.num-subtitle {
display: flex;
align-items: center;
width: 100%;
font-family: PingFang SC;
font-weight: 500;
font-size: 23rpx;
color: #6A8A27;
}
.num-right {
display: flex;
align-items: center;
font-weight: bold;
font-size: 29rpx;
color: #000000;
text-align: center;
.num-span {
width: 67rpx;
line-height: 63rpx;
}
.btn-num {
width: 46rpx;
height: 46rpx;
line-height: 40rpx;
background: #6A8A27;
border-radius: 50%;
font-weight: 500;
font-size: 45rpx;
font-size: 34rpx;
color: #FFFFFF;
}
.btn-num.disabled{
color: #999999;
background: white;
border: 1px solid #999;
}
}
}
.buyMore{
height: 118rpx;
font-family: PingFang SC;
font-weight: bold;
font-size: 31rpx;
color: #000000;
display: flex;
align-items: center;
justify-content: space-between;
padding:0 20rpx;
.buyMore-btn{
height: 47rpx;
width: 148rpx;
text-align: center;
border-radius: 23rpx;
border: 1px solid #515150;
font-family: PingFang SC;
font-weight: bold;
font-size: 25rpx;
color: #515150;
line-height: 45rpx;
}
}
}
.people-box{
width: 100%;
background: #FFFFFF;
border-radius: 13rpx;
.people-box-title{
font-family: PingFangSC;
font-weight: 600;
font-size: 31rpx;
color: #000000;
padding: 42rpx 18rpx;
border-bottom: 1px solid #CCCCCC;
}
.people-box-sku{
width: 100%;
background: #FFFFFF;
border-radius: 18rpx;
padding: 0rpx 20rpx;
.sku-title{
font-weight: 400;
font-size: 29rpx;
color: #060001;
padding-bottom: 25rpx;
}
.person-info{
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 400;
font-size: 27rpx;
color: #000000;
margin-bottom: 33rpx;
.person-info-detail{
font-weight: 400;
font-size: 24rpx;
color: #666666;
width: 400rpx;
}
}
.person-need{
width: 100%;
height: 80rpx;
background: #F2F2F2;
border-radius: 13rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #515150;
padding: 0 20rpx;
}
.person-item-more{
width: 110rpx;
height: 73rpx;
background: #F2F2F2;
border-radius: 11rpx;
text-align: center;
font-family: PingFang SC;
font-weight: 500;
font-size: 29rpx;
color: #515150;
line-height: 73rpx;
position: absolute;
right: 0;
top: 0;
}
}
}
.tickets-container {
width: 100%;
background: #fff;
height: 120rpx;
margin-top: 22rpx;
.order-title {
margin: 31rpx 0 31rpx 30rpx;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
.coupon-price {
color:#DD0000;
font-size: 30rpx;
font-weight: bold;
}
}
.btn-list {
width: 100%;
height: 166rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 9rpx 1rpx rgba(227, 229, 232, 0.5);
display: flex;
position: fixed;
bottom: 0;
left: 0;
right:0;
padding: 20rpx 50rpx;
align-items: center;
justify-content: space-between;
.btn {
width: 250rpx;
height: 80rpx;
background: #6A8A27;
border-radius: 11rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
.price-box {
display: flex;
align-items: baseline;
.text {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #393b3e;
}
.price {
margin-left: 15rpx;
font-size: 48rpx;
font-weight: bold;
color: #C3282E;
&:before {
content: '¥';
display: inline-block;
color: #C3282E;
font-size: 24rpx;
}
}
.post-text {
margin-left: 15rpx;
color: #C3282E;
font-size: 24rpx;
}
}
}
.popup-content-date {
background-color: white;
padding: 0rpx 28rpx 166rpx;
height: 70vh;
border-radius: 20rpx 20rpx 0 0 ;
.popup-content-title{
font-family: PingFang SC;
font-weight: bold;
font-size: 37rpx;
color: #000000;
padding: 39rpx 0;
display: flex;
align-items: center;
border-bottom: 1px solid #CCCCCC;
}
//
.content{
padding-top: 48rpx;
overflow-y: auto;
}
.order-popup-detail{
.sku-title{
padding: 48rpx 0 26rpx;
font-family: PingFangSC;
font-weight: 500;
font-size: 31rpx;
color: #000000;
}
}
.dateMore{
width: 120rpx;
height: 133rpx;
background: white;
border-radius: 10rpx;
background: #FFFFFF;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #6A8A27;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 6rpx 0;
position: absolute;
bottom: 0;
right: 0;
}
.date-content{
width: 100%;
display: flex;
overflow-y: auto;
position: relative;
padding-right: 140rpx;
.item{
width: 120rpx;
height: 133rpx;
border-radius: 10rpx;
margin-right: 24rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 27rpx;
color: #000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
flex-shrink: 0;
padding: 6rpx 0;
background: #F5F5F5;
}
.item.active{
background: #6A8A27;
color: white;
.price{color: white;}
}
.item.disabled{
background: #F5F5F5;
color: #999999;
}
.price{
color: #EE3E3B;
}
}
.date-content::-webkit-scrollbar{
display: none;
}
}
.coupon-btn {
color: #999999;;
display: flex;
align-items: center;
.select {
display: block;
width: 153rpx;
height: 40rpx;
background: #6A8A27;
border-radius: 9rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
line-height: 40rpx;
font-family: PingFang SC;
margin-right: 20rpx;
}
}
</style>

322
subPackages/techan/detail.vue

@ -10,53 +10,42 @@
</swiper-item>
</swiper>
<view class="swiper-pointer">
<!-- <view class="swiper-pointer">
<view :class="['cricle',swiperCurrent==i?'active':'']" v-for="(item,i) in info.listimg" :key="i"></view>
</view>
</view> -->
</view>
<view class="w-full relative" style="padding: 26rpx;top: -52rpx;">
<view class="w-full relative">
<view class="price-box ">
<view class="price-zan">
<view class="price">
<view class="present-price">{{ info.price / 100 }}</view>
<view class="flex flex-between" style="font-weight: 500;font-size: 24rpx;color: #666666;">
<view >
<text class="present-price">{{ info.price / 100 }}</text>
/
</view>
<view>已售{{info.sales_number || 0}}</view>
</view>
<view class="title text-overflowRows">{{ info.title }}</view>
<view class="title text-overflowRows" style="font-weight: 500;font-size: 24rpx;color: #999999;">{{ info.subtitle }}</view>
<view class="tag no-scrollbar" v-if="info.display_tags">
<view class="tag-item" v-for="(item, index) in info.display_tags.split(',')" :key="index">
{{ item }}
</view>
</view>
</view>
<view class="sp-box" @click="openPop">
<view class="sp-box-left flex-1">
<view class="flex-shrink-0">
选择
</view>
<view class="flex-1">
{{sku[productIndex].sku_name || '暂无可选规格'}}
</view>
</view>
<uni-icons class="flex-shrink-0" style="height: 36rpx;margin-right: 20rpx;" type="right" size="18"></uni-icons>
</view>
<view class="pro-title">产品简介</view>
<view class="price-box" style="margin-top: 20rpx;">
<view class="pro-title">产品详情</view>
<view class="notice" >
<view class="rich-text" v-html="formateRichText(info.content)"></view>
</view>
</view>
</view>
<view class="btn-list" v-if="!paramData.showCart">
<view class="btn-list" >
<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="showImg('/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.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">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/627d67e48ac41903c40c31f1613f2444.png"
@ -72,32 +61,15 @@
<view class="left-btn-buy" @click="openPop(true)">加入购物车</view>
<view class="right-btn-buy" @click="openPop(false)">立即购买</view>
</view>
</view>
<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="showImg('/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png')" mode="aspectFill"
style="width: 78rpx;height: 78rpx;"></image>
<!-- 购物车图标 -->
<view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></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" :key="new Date().getTime()"></cartDataVue>
<uni-popup ref="popup" type="bottom" @change="changPopShow" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="sku.length>0">
@ -142,7 +114,7 @@
</view>
</view>
</view>
<view style="height: 100rpx;"></view>
<view style="height: 40rpx;"></view>
<!-- <view class="btn-box">
<view class="buy-btn" @click="order">
下一步
@ -166,18 +138,18 @@
sku: [],
productIndex: 0,
is_post: "2",
showLength: 0,
buyNum: 1,
popShow: false,
paramData: {allPrice: 0,iNum:0, fNum:'00', showCart: false, num: 0},
cartNum: 0,
};
},
onLoad(option) {
this.id = option.id;
this.getInfo();
this.getCartList()
},
methods: {
changPopShow (e) {
@ -241,8 +213,6 @@
goods.buyNum = this.buyNum
let orderInfo = [{
// is_post: goods.is_post || "1",
// is_post: 2,
pInfo: this.info,
sInfo: goods,
// post: 0,
@ -254,37 +224,17 @@
});
},
addToCart () {
let goods = this.sku[this.productIndex]
let goods = this.trueSku[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));
this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => {
if (res.code == 1) {
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closePopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
goUser() {
uni.switchTab({
url: '/pages/index/user'
})
},
changeProduct(item,index) {
if (item.store==0) {
uni.showToast({
@ -295,22 +245,11 @@
}
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()
getCartList () {
this.Post({},'/api/cart/get_list').then(res=>{
this.cartNum = (res.data || []).length
})
},
swiperChange (e) {
@ -327,7 +266,7 @@
.bg {
min-height: 100vh;
overflow-x: hidden;
background: #f2f4f7;
background: #F7F7F7;;
padding-bottom: 210rpx;
}
@ -421,53 +360,28 @@
}
}
.common-container{
width: 100%;
padding: 32rpx;
}
.pro-title{
font-weight: bold;
font-size: 37rpx;
color: #000000;
margin: 66rpx 0 19rpx 0;
font-size: 35rpx;
color: #010101;
}
.price-box {
width: 100%;
background: #ffffff;
border-radius: 20rpx 20rpx 0 0;
padding: 24rpx 30rpx;
padding: 40rpx 24rpx;
.price-zan {
display: flex;
align-items: center;
justify-content: space-between;
.price {
display: flex;
.present-price {
font-size: 42rpx;
font-family: PingFang SC;
font-weight: bold;
color: #C3282E;
&:before {
content: '¥';
display: inline-block;
font-size: 26rpx;
}
&:after {
content: '起';
display: inline-block;
font-size: 24rpx;
font-family: PingFangSC;
color: #8D8D8D;
}
}
}
}
.tag {
@ -480,13 +394,13 @@
.tag-item {
margin-right: 14rpx;
font-family: PingFangSC;
padding: 8rpx 16rpx;
padding: 7rpx 14rpx;
flex-shrink: 0;
border:1px solid #515150;
border-radius: 11rpx;
border-radius: 5rpx 4rpx 4rpx 5rpx;
border: 1px solid #6A8A27;
font-weight: 500;
font-size: 24rpx;
color: #515150;
color: #6A8A27;
}
}
@ -499,11 +413,15 @@
}
}
.limit{
border-top: 1px solid #D8D8D8;
padding: 27rpx 24rpx;
width: 100%;
background: #FFFFFF;
}
.notice {
padding: 35rpx;
padding: 35rpx 0;
width: 100%;
background: #ffffff;
border-radius: 20rpx;
}
.tab {
@ -550,73 +468,12 @@
}
}
.more {
width: 100%;
height: 93rpx;
line-height: 93rpx;
text-align: center;
border-top: solid 1rpx rgba(227, 229, 232, 1);
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4D526C;
margin-top: 50rpx;
}
.xzPopup {
width: 750rpx;
padding: 33rpx 26rpx 20rpx;
box-sizing: border-box;
background-color: #FFFFFF;
position: relative;
max-height: 70vh;
overflow-y: auto;
view {
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 35rpx;
}
img {
width: 32rpx;
height: 32rpx;
position: absolute;
top: 33rpx;
right: 27rpx;
}
}
.comment {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
width: 710rpx;
height: 100rpx;
background: #FFFFFF;
border-radius: 13rpx;
margin: 0 auto;
margin-top: 20rpx;
padding: 0 20rpx;
.comment-left {
display: flex;
align-items: center;
font-size: 36rpx;
font-family: PingFangSC;
font-weight: bold;
color: #000000;
}
}
.btn-list {
position: fixed;
z-index: 9999;
bottom: 0;
width: 750rpx;
height: 180rpx;
height: 140rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
display: flex;
@ -687,8 +544,6 @@
padding: 0rpx 39rpx 51rpx 39rpx;
height: auto;
border-radius: 20rpx 20rpx 0 0;
}
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
@ -761,9 +616,7 @@
.botProducts {
// border: 1rpx solid #00AAFF;
// background-color: rgba(254, 180, 25, 1);
background: #515150;
background: #6A8A27;
color: #FFFFFF;
}
@ -820,7 +673,6 @@
align-items: center;
justify-content: center;
}
.sp {
width: 100%;
height: 30rpx;
@ -834,67 +686,49 @@
padding-top: 30rpx;
}
.sp-box {
width: 100%;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 0 0 12rpx 12rpx;
padding: 10rpx 0 30rpx;
.sp-box-left {
display: flex;
margin-left: 38rpx;
align-items: center;
:first-child {
font-family: PingFang;
font-weight: 500;
font-size: 31rpx;
color: #999999;
}
:last-child {
width: 403rpx;
font-family: PingFang SC;
font-weight: 400;
font-size: 31rpx;
color: #000000;
}
}
image {
width: 16rpx;
height: 28rpx;
margin-right: 38rpx;
}
}
.btn-post{
font-size: 32rpx;
font-size: 31rpx;
font-family: PingFangSC;
font-weight: 500;
font-weight: bold;
color: #FFFFFF;
line-height: 77rpx;
line-height: 60rpx;
text-align: center;
display: flex;
.left-btn-buy{
width: 207rpx;
height: 77rpx;
color: #C3282E;
border-radius: 39rpx 0rpx 0rpx 39rpx;
border: 1px solid #C3282E;
height: 60rpx;
color: #6A8A27;
background: #D3E8A7;
border-radius: 11rpx 0rpx 0rpx 11rpx;
}
.right-btn-buy{
width: 207rpx;
height: 77rpx;
background: #C3282E;
border-radius: 0rpx 39rpx 39rpx 0rpx;
height: 60rpx;
background: #6A8A27;
border-radius: 0rpx 11rpx 11rpx 0rpx;
}
}
.add-cart-icon{
width: 80rpx;
height: 80rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 140rpx;
right: 20rpx;
z-index: 10;
image{
width: 43.33rpx;
height: 42rpx;
}
}
</style>

446
subPackages/techan/index.vue

@ -4,7 +4,8 @@
<uni-icons type="left" size="20" @click="goBack" style="flex-shrink: 0;"></uni-icons>
<view class="input-model">
<uni-icons style="height: 1.4rem;line-height: 1.4rem;" type="search" size="15" color="#ABAAAD" ></uni-icons>
<input class="input-text" placeholder="请输入商品名称" v-model="searchText" @confirm="search(false)" @keyup.enter="search(false)"></text>
<input class="input-text" placeholder="搜索" v-model="searchText" @confirm="search(false)" @keyup.enter="search(false)"></text>
<view class="search-btn" @click="search(false)">搜索</view>
</view>
</view>
@ -12,25 +13,54 @@
<!-- 正常产品 -->
<template v-if="searchText.trim().length<=0">
<img :src="showImg(headImg)" class="topImg" />
<view style="width: 100%;position: relative;">
<scroll-view class="type-container" scroll-x="true" scroll-with-animation="true" enable-flex>
<view :class="['type-item',typeIndex==i?'active':'']" v-for="(item,i) in typeParam" :key="i" @click="changeType(item,i)">
<view class="img-container" >
<image :src="item.image"></image>
</view>
<view class="type-name">{{item.name}}</view>
</view>
<view style="height: 1rpx;width: 70rpx;flex-shrink: 0;"></view>
</scroll-view>
<view class="more-btn" @click="showTypes(true)">
展开
</view>
</view>
<view class="goods-container">
<scroll-view class="left-container no-scrollbar" :scroll-y="true">
<view :class="['type-item',typeIndex==i?'active':'']"
v-for="(item,i) in typeParam" :key="i" @click="changeType(item,i)">
{{item.title}}
<view class="active-type-bar" v-if="typeIndex==i"></view>
<view class="search-container">
<view >
<text :class="[search_type==0?'active-search-item':'']">综合</text>
</view>
<view >
<text :class="[[1,2].includes(search_type)?'active-search-item':'']">销量</text>
<view class="search-item">
<view :class="[search_type==1?'active-search-item':'','triangle-up']" @click="changeSearchParm(1)"></view>
<view :class="[search_type==2?'active-search-item':'']" @click="changeSearchParm(2)"></view>
</view>
</view>
<view >
<text :class="[[3,4].includes(search_type)?'active-search-item':'']">价格</text>
<view class="search-item">
<view :class="[search_type==3?'active-search-item':'','triangle-up']" @click="changeSearchParm(3)"></view>
<view :class="[search_type==4?'active-search-item':'']" @click="changeSearchParm(4)"></view>
</view>
</view>
</view>
<view style="height: 148rpx;width: 1rpx;"></view>
</scroll-view>
<scroll-view class="right-container no-scrollbar" :scroll-y="true" @scrolltolower="scrollLow()">
<view class="item" v-for="item in list" :key="item.id" @click="viewDetail(item)">
<image class="item-img" :src="showImg(item.headimg)" mode=""></image>
<view class="content">
<view class="title text-overflowRows">{{item.title}}</view>
<view style="font-weight: 500;font-size: 21rpx;color: #999999;">已售{{item.sales_number}}</view>
<view class="bottom">
<view class="price">
{{item.price/100}}
<view>
<text class="price">{{item.price/100}}</text>
<text class="oldPrice">{{item.market_price/100}}</text>
</view>
<view class="buy-cart" @click.stop="showOrderCart(item)">+</view>
@ -47,24 +77,24 @@
<!-- 搜索 -->
<view v-else style="flex: 1;">
<view v-if="searchList.length<=0" class="flex-center" style="width: 100%;height: 100%;flex-direction: column;">
<image style="width: 328rpx;height: 450.67rpx;" :src="showImg('/uploads/20250514/0e5f4c089ba2f3a86d3c6f9d8d818d5b.png')"></image>
<view style="font-weight: 500;font-size: 28rpx;color: #666666;
text-align: center;margin-top: 67rpx;padding-bottom: 300rpx;">暂无搜索结果</view>
</view>
<view style="padding:0 26rpx;background: #FFFFFF;min-height: 100%;" v-else>
<view style="padding:30rpx 26rpx 0;background: #F7F7F7;min-height: 100%;" v-else>
<view class="flex" style="justify-content: space-between;">
<view class="search-result" >
<view v-for="(item,i) in searchList" >
<view v-if="i%2==0" class="search-item" :key="i" @click="viewDetail(item.goods)">
<image :src="showImg(item.goods.image)" mode="widthFix"></image>
<image :src="showImg(item.headimg)" mode="widthFix"></image>
<view class="search-container">
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="title text-overflowRows">{{item.title}}</view>
<view class="flex-between" style="padding-top: 20rpx;">
<view>
<text class="price">{{item.goods.money/100}}</text>
<text class="oldPrice">{{item.goods.price/100}}</text>
<text class="price">{{item.price/100}}</text>
<text class="oldPrice">{{item.market_price/100}}</text>
</view>
<view class="buy-cart" @click.stop="showOrderCart(item.goods)">+</view>
<view class="buy-cart" @click.stop="showOrderCart(item)">+</view>
</view>
</view>
</view>
@ -72,16 +102,16 @@
</view>
<view class="search-result" >
<view v-for="(item,i) in searchList">
<view class="search-item" v-if="i%2==1" :key="i" @click="viewDetail(item.goods)">
<image :src="showImg(item.goods.image)" mode="widthFix"></image>
<view class="search-item" v-if="i%2==1" :key="i" @click="viewDetail(item)">
<image :src="showImg(item.headimg)" mode="widthFix"></image>
<view class="search-container">
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="title text-overflowRows">{{item.title}}</view>
<view class="flex-between" style="padding-top: 20rpx;">
<view>
<text class="price">{{item.goods.money/100}}</text>
<text class="oldPrice">{{item.goods.price/100}}</text>
<text class="price">{{item.price/100}}</text>
<text class="oldPrice">{{item.market_price/100}}</text>
</view>
<view class="buy-cart" @click.stop="showOrderCart(item.goods)">+</view>
<view class="buy-cart" @click.stop="showOrderCart(item)">+</view>
</view>
</view>
</view>
@ -101,7 +131,7 @@
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#D90F01',color:'#ffffff',border:'1px solid #ffffff'}">
<view class="img-box" @click.stop="showCartClick">
<image :src="showImg('/uploads/20250513/cc33cde475ce45c274cb304e20805aa1.png')" mode="aspectFill"></image>
<image src="https://static.ticket.sz-trip.com/uploads/20250616/d716b89802b12b14c9c186e68a3ea754.png" mode="aspectFill"></image>
</view>
</uni-badge>
<view class="bottom-price">
@ -110,15 +140,10 @@
<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="#0B898E" type="left" size="15"></uni-icons></view>
<view v-else style="transform: rotate(-90deg);"><uni-icons color="#0B898E" type="left" size="15"></uni-icons></view>
</view>
</view>
<view class="btn-buy" @click="goCartOrder">
结算
去下单
</view>
</template>
@ -132,23 +157,25 @@
</view>
<view class="bottom-productImg">
<img :src="showImg(sku[productIndex].image)" alt="">
<img :src="showImg(sku[productIndex].headimg)" 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 class="bottom-productPrice com-price">{{(sku[productIndex].price||0)/100}}</view>
<view class="bottom-content">已选择{{sku[productIndex].sku_name}}</view>
</view>
</view>
<view>
<view style="max-height: 600rpx;overflow-y: auto;">
<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}}
{{botItem.sku_name}}
</view>
<view class="noStore-text" v-if="botItem.store==0">
不可购买
</view>
<!-- <view class="noStore-text" v-else-if="botItem.is_post!=1">不可加购</view> -->
</view>
</view>
</view>
@ -168,10 +195,27 @@
<view class="placeholder-content">
<view style="height: 100rpx;"></view>
<view class="btn-cover">
<view class="btn" @click.stop="order">加入购物车</view>
<view class="btn" @click.stop="addToCart">加入购物车</view>
</view>
</view>
</uni-popup>
<!-- 全部分类 -->
<uni-popup ref="typePopup" type="top">
<view class="typePopup-container">
<view class="place-area" :style="{'height': height+'px'}"></view>
<view class="type-container typedata-container">
<view :class="['type-item',typeIndex==i?'active':'']" v-for="(item,i) in typeParam" :key="i" @click="changeType(item,i)">
<view class="img-container" >
<image :src="item.image"></image>
</view>
<view class="type-name">{{item.name}}</view>
</view>
</view>
<view class="bottom-close" @click="showTypes(false)">收起 <text class="triangle-up"></text></view>
</view>
</uni-popup>
</view>
</template>
@ -186,14 +230,8 @@
statusBarHeight: 0,
headImg: "https://cgc.js-dyyj.com/uploads/20250513/f8b255f965efcd71b6843e4b72c3f1f3.png",
typeParam: [
{id: 366, title: '味 | WEI'},
{id: 46, title: '服 | FU'},
{id: 47, title: '器 | QI'},
{id: 48, title: '香 | XIANG'},
{id: 49, title: '饰 | SHI'},
{id: 50, title: '艺 | YI'},
],
type_pid: 20,
typeParam: [],
typeIndex: 0,
list:[],
finished: false,
@ -209,6 +247,8 @@
searchText: '',
searchList: [],
searchFinish: false,
search_type: 0,
}
},
onLoad(options) {
@ -224,7 +264,8 @@
},
onReady() {
this.initRectInfo()
this.getList()
// this.getList()
this.getTypeTags()
},
methods: {
initRectInfo () {
@ -234,21 +275,46 @@
this.height = sysInfo.statusBarHeight + 40
},
getTypeTags () {
this.Post({
pid: this.type_pid
},'/api/product/tag_list').then(res => {
this.typeParam = res.data || []
this.getList()
})
},
changeType (item, i) {
if (this.typeIndex!== i) {
this.typeIndex=i
this.finished = false
this.list = []
this.getList()
this.showTypes(false)
}
},
changeSearchParm(value) {
this.search_type = value
this.finished = false
this.list = []
this.getList()
},
//
getList(){
let param = {}
if (this.search_type == 1) { param = {order: 'asc',sort:'sales_number'} }
if (this.search_type == 2) { param = {order: 'desc',sort:'sales_number'} }
if (this.search_type == 3) { param = {order: 'asc',sort:'price'} }
if (this.search_type == 4) { param = {order: 'desc',sort:'price'} }
this.Post({
tag_id: this.typeParam[this.typeIndex].id,
offset: this.list.length,
limit: 10,
...param
},'/api/product/get_product_by_tag').then(res => {
this.list = [...this.list, ...res.data.list];
if (res.data.list.length < 10) {
@ -304,10 +370,10 @@
this.productIndex = index
},
getSpecificationsByGoodsId(goods_id) {
this.Post({goods_id: goods_id},'/api/goods/getSpecificationsByGoodsId'
this.Post({id: goods_id},'/api/product/get_product_detail'
).then(res => {
if (res) {
this.sku = res.data;
this.sku = res.data.sku || [];
if (!this.sku||this.sku.length<=0) {
uni.showToast({
title:'暂无可选规格',
@ -335,40 +401,16 @@
openPop(){
this.$refs.popup.open()
},
order() {
let goods = this.sku[this.productIndex]
if(goods.is_post!=1) {
uni.showToast({
title: '此规格不支持加入购物车',
icon: 'none'
})
return
}
addToCart() {
let goods = this.trueSku[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));
this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => {
if (res.code == 1) {
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closePopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
goCartOrder () {
this.$refs.cartDataVueRef.goCartOrder()
@ -389,21 +431,28 @@
this.searchFinish = false
}
this.Post({
name: this.searchText.trim(),
title: this.searchText.trim(),
offset: this.searchList.length,
// type: 'pgoods',
limit: 10,
}, '/api/search/search').then(res => {
let resData = (res.data || []).map(v=> {return {id: v.id, goods: v.search_data}})
console.log(resData)
this.searchList = [...this.searchList, ...resData];
tag_id: this.type_pid,
limit: 20,
}, '/api/product/get_product_by_tag').then(res => {
this.searchList = [...this.searchList, ...res.data.list];
console.log(this.searchList, res)
this.searchFinish = false
console.log(resData, this.searchList)
if (res.data.length<10) {
this.searchFinish = true
}
})
},
showTypes(flag) {
if (flag) {
this.$refs.typePopup.open()
} else {
this.$refs.typePopup.close()
}
},
},
onReachBottom() {
if (!this.searchFinish) {
@ -429,14 +478,15 @@
align-items: center;
padding-left: 10rpx;
padding-right: 120px;
background: #EDF5DC;
z-index: 9999999;
.input-model{
flex: 1;
width: 1rpx;
height: 64rpx;
background: #FFFFFF;
background: white;
border-radius: 55rpx;
border: 1rpx solid #20898D;
margin-left: 12rpx;
display: flex;
align-items: center;
@ -452,6 +502,16 @@
font-size: 24rpx;
color: #030000;
}
.search-btn{
font-weight: 500;
font-size: 29rpx;
color: #6A8A2D;
border-left: 1px solid #CCCCCC;
padding-left: 25rpx;
width: 85rpx;
height: 50%;
line-height: 1;
}
}
@ -463,63 +523,116 @@
background: #F8FAFB;
}
.topImg {
width: 750rpx;
height: 344rpx;
.type-container{
display: flex;
height: 133rpx;
background: #EDF5DC;
width: 100%;
padding: 8rpx 0;
.type-item{
height: 120rpx;
width: 130rpx;
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 23rpx;
color: #111111;
text-align: center;
.img-container{
width: 80rpx;
height: 80rpx;
padding: 2rpx;
border-radius: 50%;
image{
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.type-name{
width: 80rpx;
height: 30rpx;
line-height: 30rpx;
word-break: keep-all;
}
&.active{
.img-container{
border: 2rpx solid #6A8A2D;
}
.type-name{
background: #6A8A2D;
border-radius: 7rpx;
color: #FFFFFF;
}
}
}
}
.more-btn{
position: absolute;
right: 0;
top: 0;
bottom: 0;
height: 100%;
font-weight: 500;
font-size: 28rpx;
color: #111111;
width: 67rpx;
background: #EDF5DC;
padding: 24rpx 20rpx;
}
.goods-container{
height: 1rpx;
flex: 1;
display: flex;
}
.left-container{
width: 214rpx;
flex-shrink: 0;
.type-item{
font-weight: 400;
font-size: 24rpx;
flex-direction: column;
background: #FFFFFF;
.search-container{
display: flex;
align-items: center;
justify-content: space-between;
font-weight: bold;
font-size: 27rpx;
color: #000000;
text-align: center;
width: 216rpx;
height: 120rpx;
line-height: 120rpx;
position: relative;
.active-type-bar{
position: absolute;
left: 0;
top: 0;
bottom: 0;
height: 107rpx;
flex-shrink: 0;
padding: 0 32rpx;
&>view{
display: flex;
width: 80rpx;
align-items: center;
justify-content: space-between;
height: 100%;
width: 12rpx;
background: #74A5AA;
}
}
.type-item.active{
background: linear-gradient( 90deg, rgba(32,137,141,0.4) 0%, rgba(32,137,141,0) 100%);
font-weight: 600;
font-size: 28rpx;
.search-item{
display: flex;
flex-direction: column;
line-height: 16rpx;
font-size: 20rpx;
}
}
.right-container{
flex: 1;
width: 1rpx;
width: 100%;
height: 1rpx;
background: white;
padding-top: 32rpx;
.item {
width: 100%;
padding:0 32rpx 32rpx 32rpx;
display: flex;
.item-img {
width: 148rpx;
height: 148rpx;
width: 161rpx;
height: 161rpx;
border-radius: 15rpx;
flex-shrink: 0;
}
.content {
height: 148rpx;
height: 161rpx;
padding-left: 24rpx;
display: flex;
flex-direction: column;
@ -537,14 +650,20 @@
justify-content: space-between;
align-items: center;
.price {
font-size: 40rpx;
color: #FA0000;
font-size: 33.33rpx;
color: #DC2525;
font-weight: 400;
}
.price::before {
content: '¥';
font-size: 24rpx;
}
.oldPrice{
font-weight: 500;
font-size: 21rpx;
color: #999999;
text-decoration-line: line-through;
}
}
}
@ -553,7 +672,7 @@
width: 44rpx;
height: 44rpx;
color: #FFFFFF;
background: #74A5AA;
background: #6A8A2D;
line-height: 44rpx;
font-size: 30rpx;
text-align: center;
@ -582,7 +701,7 @@
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #D70000;
color: #DC2525;
padding: 0 12rpx;
.bottom-price-yuan{
font-size: 40rpx;
@ -608,8 +727,8 @@
.btn-buy {
width: 240rpx;
height: 78rpx;
background: #74A5AA;
border-radius: 40rpx;
background: #6A8A2D;
border-radius: 11rpx;
text-align: center;
line-height: 78rpx;
font-size: 32rpx;
@ -620,7 +739,6 @@
}
//
.popup-content {
background-color: white;
padding: 0rpx 39rpx 51rpx 39rpx;
@ -628,7 +746,7 @@
border-radius: 20rpx 20rpx 0 0;
.bottom-productImg {
display: flex;
margin-bottom: 48rpx;
margin-bottom: 23rpx;
}
.bottom-productImg img {
@ -644,7 +762,7 @@
.bottom-productPrice {
font-size: 40rpx;
color: #C3282E;
color: #FC524B;
&:before {
content: "¥";
@ -664,7 +782,7 @@
width: 320rpx;
// height: 78rpx;
border-radius: 13rpx;
background-color: #EFEFEF;
background-color: #F5F5F5;
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
@ -695,8 +813,10 @@
font-weight: 400;
color: #FFFFFF;
}
.botProducts {
background: #74A5AA;
background: #6A8A27;
color: #FFFFFF;
}
@ -710,7 +830,6 @@
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #CCCCCC;
}
.buy-num .number-btn {
@ -731,6 +850,20 @@
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;
@ -740,9 +873,23 @@
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;
@ -762,8 +909,8 @@
height: 78rpx;
text-align: center;
line-height: 78rpx;
background: #74A5AA;
border-radius: 40rpx;
background: #6A8A2D;
border-radius: 11rpx;
font-size: 34rpx;
font-family: PingFangSC;
@ -817,4 +964,39 @@
}
}
}
.typePopup-container{
.place-area{
width: 100%;
opacity: 0;
}
.type-container.typedata-container{
flex-wrap: wrap;background: #EDF5DC;padding: 30rpx 40rpx 0;
width: 100%;
display: flex;
height: auto;
padding-bottom: 30rpx;
.type-item {
margin-bottom: 30rpx;
}
}
.bottom-close{
width: 100%;
height: 80rpx;
background: #FFFFFF;
font-weight: 500;
font-size: 28rpx;
color: #111111;
line-height: 80rpx;
text-align: center;
}
}
.triangle-up {
transform: rotate(180deg);
display: inline-block;
}
.active-search-item{
color: #6A8A2D;
}
</style>

15
subPackages/techan/order.vue

@ -170,13 +170,8 @@
<view class="add-edit-content">
<addressAddVue ref="addressAddVueRef"></addressAddVue>
</view>
</view>
</uni-popup>
</view>
</template>
@ -201,9 +196,6 @@ export default {
post: 0,
flag: true,
reserve_name: '',
reserve_idcard: '',
reserve_phone: '',
remark: '',
coupon: "",
allprice: 0,
@ -460,10 +452,6 @@ export default {
uni.showToast({title: '请选择自提点',icon: 'none'});
return;
}
}
}
@ -563,9 +551,6 @@ export default {
this.coupon = res
}
}
}
};
</script>

11
subPackages/techan/selfPickUpPoint.vue

@ -61,13 +61,11 @@
this.pending = true
// this.getLocation()
let param = {
goods_id: this.goodsId,
offset: this.list.length,
limit: 10,
product_id: this.goodsId,
lon: uni.getStorageSync('location').lon || '',
lat: uni.getStorageSync('location').lat || '',
}
this.Post(param, "/api/extract/getMerchantExtractListByGoodsIdNew").then(res => {
this.Post(param, "/api/product/getDeliverShop").then(res => {
if (res) {
this.list = [...this.list, ...res.data];
if (res.data.length < 10) {
@ -117,11 +115,6 @@
},
onReachBottom() {
setTimeout(() => {
if (!this.load) {
this.getList()
}
}, 1000);
}
}
</script>

297
subPackages/ticket/detail.vue

@ -103,11 +103,11 @@
<text>客服</text>
</view>
</view>
<view class="btn" @click="order">加入购物车</view>
<view class="btn" @click="showCartPopup">加入购物车</view>
</view>
<!-- 购物车图标 -->
<view class="add-cart-icon">
<uni-badge class="uni-badge-left-margin" :text="1" absolute="rightTop" :offset="[-3, -3]" size="small"
<view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image>
</uni-badge>
@ -175,7 +175,7 @@
<view class="flex" style="align-items: baseline;">
合计<view class="bottom-price">{{allSeldDate[seldDateIndex].price / 100 || 0}}</view>
</view>
<view class="bottom-btn" @click="addBuyCard">
<view class="bottom-btn" @click="order">
下一步
</view>
</view>
@ -183,6 +183,52 @@
</uni-popup>
<uni-popup ref="popupCart" type="bottom" :safe-area="false" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="trueSku.length>0">
<view style="padding: 0rpx 39rpx 50rpx 39rpx;">
<view @click="closeCartPopup" 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(trueSku[productIndex].headimg)" alt="">
<view class="right-content">
<view class="bottom-productPrice com-price">{{(trueSku[productIndex].price||0)/100}}</view>
<view class="bottom-content">已选择{{trueSku[productIndex].sku_name}}</view>
</view>
</view>
<view>
<view class="sp">规格</view>
<view class="sp-container" style="">
<view style="position:relative;" v-for="(botItem,botIndex) in trueSku" :key="botIndex">
<view :class="['botProduct','text-overflow',{'noStore':botItem.store==0},{'botProducts':productIndex==botIndex}]"
@click="changeProduct(botItem,botIndex)">
{{botItem.sku_name}}
</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="sp-bottom-btn">
<view class="btn" @click="addToCart">加入购物车</view>
</view>
</view>
</uni-popup>
<uni-calendar ref="calendar" class="uni-calendar--hook" :clear-date="true"
:date="allSeldDate[seldDateIndex].date" :insert="false" :startDate="calendarParam.startDate"
:endDate="calendarParam.endDate" @confirm="confirmCalendar" :selected="calendarParam.selected"/>
@ -193,6 +239,7 @@
export default {
data() {
return {
cartNum: 0,
headImg: null,
swiperCurrent: 0,
@ -215,6 +262,10 @@
stratDate:'',endDate: '', selected: []
},
trueSku: [],
productIndex: 0,
buyNum: 1,
}
},
onShow(options) {
@ -235,6 +286,13 @@
this.Post({id: this.id},'/api/scene/detail').then(res => {
this.info = res.data
this.sku = this.info.product || []
let trueSku = []
this.sku.forEach(v=>{
trueSku = trueSku.concat(v.sku)
})
this.trueSku = trueSku
if (this.info.title) {
uni.setNavigationBarTitle({
title: this.info.title
@ -454,7 +512,53 @@
}
},
addBuyCard() {
//
getCartList () {
this.Post({},'/api/cart/get_list').then(res=>{
this.cartNum = (res.data || []).length
})
},
showCartPopup () {
this.$refs.popupCart.open()
},
closeCartPopup () {
this.$refs.popupCart.close()
},
changeProduct(item,index) {
if (item.store==0) {
uni.showToast({
title:"库存不足!",
icon:'none'
})
return
}
this.productIndex = index
},
//
addNumber() {
this.buyNum += 1;
},
delNumber() {
if (this.buyNum <= 1) {
return;
}
this.buyNum -= 1;
},
addToCart () {
let goods = this.trueSku[this.productIndex]
goods.buyNum = this.buyNum
this.Post({sku_id: goods.id,num: this.buyNum },'/api/cart/add_sku').then(res => {
if (res.code == 1) {
uni.$emit("updateDataByConnect", {msgType:'updateCartDataInfo',data:null})
this.closeCartPopup()
// this.$refs.cartDataVueRef.openPop()
}
});
},
//-----------------------------
order() {
let that = this;
//
console.log(this.skuInfo)
@ -1004,4 +1108,187 @@
}
}
.popup-content {
background-color: white;
height: auto;
border-radius: 20rpx 20rpx 0 0;
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
flex-shrink: 0;
}
.bottom-productImg img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
.right-content {
margin: 10rpx 0 0 41rpx;
flex: 1;
width: 1rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
&:before {
content: "¥";
font-size: 26rpx;
}
}
.bottom-content {
width: 100%;
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 {
background: #6A8A27;
color: #FFFFFF;
}
.buy-num {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
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: 32rpx 0 60rpx;
padding-top: 30rpx;
}
.sp-container{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
max-height: 400rpx;
overflow-y: auto;
padding-top: 20rpx;
padding-right: 20rpx;
overflow-x: hidden;
}
.sp-bottom-btn{
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;
.btn{
width: 697rpx;
height: 73rpx;
background: #6A8A2D;
border-radius: 11rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 73rpx;
}
}
}
</style>

Loading…
Cancel
Save