Browse Source

产品详情分享;景点下的酒景;产品详情购物车放最下面

master
jiazhipeng 2 months ago
parent
commit
b16ab4dc1d
  1. 4
      App.vue
  2. 16
      mixins/myMixins.js
  3. 31
      subPackages/food/detail.vue
  4. 1
      subPackages/homestay/detail.vue
  5. 4
      subPackages/search/result.vue
  6. 3
      subPackages/search/techanResult.vue
  7. 52
      subPackages/techan/detail.vue
  8. 46
      subPackages/ticket/detail.vue

4
App.vue

@ -8,8 +8,8 @@
uni.setStorageSync('SHFlag', true) uni.setStorageSync('SHFlag', true)
this.Post({id:2388},'/api/multimedia/detail').then(res => { this.Post({id:2388},'/api/multimedia/detail').then(res => {
if (res && res.data) { if (res && res.data) {
// let SHFlag = res.data.company_name == 1 ? true : false let SHFlag = res.data.company_name == 1 ? true : false
let SHFlag = res.data.ext_link == 1 ? true : false // let SHFlag = res.data.ext_link == 1 ? true : false
uni.setStorageSync('SHFlag', SHFlag) uni.setStorageSync('SHFlag', SHFlag)
return return
} else { } else {

16
mixins/myMixins.js

@ -1,5 +1,11 @@
export const myMixins ={ export const myMixins ={
data() {
return {
shareParam: {},
}
},
onLoad(option) { onLoad(option) {
console.log('option',option) console.log('option',option)
if(option && option.wechat_qrcode){ if(option && option.wechat_qrcode){
@ -25,19 +31,23 @@ export const myMixins ={
const pages = getCurrentPages(); // 获取加载的页面 const pages = getCurrentPages(); // 获取加载的页面
const view = pages[pages.length - 1]; // 获取当前页面的对象 const view = pages[pages.length - 1]; // 获取当前页面的对象
let url = ''; let url = '';
let shareParam = {}
console.log(view) console.log(view)
if (view.$page.fullPath) { if (view.$page.fullPath) {
url = view.options.fullPath; url = view.options.fullPath;
} else { } else {
url = uni.getStorageSync('webUrl'); url = uni.getStorageSync('webUrl');
} }
if (view.data && view.data.shareParam) {
shareParam = view.data.shareParam
}
console.log(111,url,`${view.route}?url=${url}`) console.log(111,url,`${view.route}?url=${url}`)
return { return {
title: '时味苏州', // 分享的名称 title: '时味苏州', // 分享的名称
path: `${view.$page.fullPath}`, path: `${view.$page.fullPath}`,
imageUrl: "https://static.ticket.sz-trip.com/uploads/20250818/5ea2c18a15db8a438f2ce642194b6051.jpg", // imageUrl: "https://static.ticket.sz-trip.com/uploads/20250818/5ea2c18a15db8a438f2ce642194b6051.jpg",
mpId: 'wx699ed131345cf8dd' // 此处配置微信小程序的 AppId mpId: 'wx699ed131345cf8dd', // 此处配置微信小程序的 AppId
...shareParam
}; };
} }
} }

31
subPackages/food/detail.vue

@ -75,6 +75,7 @@
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="btn-box flex-center"> <view class="btn-box flex-center">
<view style="width: 180rpx;" class="flex-between">
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"> <button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="icon-container"> <view class="icon-container">
<view class="icon-item"> <view class="icon-item">
@ -83,18 +84,26 @@
</view> </view>
</view> </view>
</button> </button>
<view class="icon-container">
<view class="icon-item" style="position: relative;width: 80rpx;" @click="goCartPage()">
<image src="https://static.ticket.sz-trip.com/uploads/20250820/17eeecf12ba9fdc56bce3b84fd5fb45f.png" mode="aspectFill"></image>
<text>购物车</text>
<view class="cartNum" v-if="cartNum">{{cartNum}}</view>
</view>
</view>
</view>
<view class="flex"> <view class="flex">
<view class="btn" @click="openPop(true)">加入购物车</view> <view class="btn" @click="openPop(true)">加入购物车</view>
<view class="btn" @click="openPop(false)">立即购买</view> <view class="btn" @click="openPop(false)">立即购买</view>
</view> </view>
</view> </view>
<!-- 购物车图标 --> <!-- 购物车图标 -->
<view class="add-cart-icon" @click="goCartPage()"> <!-- <view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small" <uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}"> :custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image> <image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image>
</uni-badge> </uni-badge>
</view> </view> -->
<!-- 预定弹窗 --> <!-- 预定弹窗 -->
<uni-popup ref="popup" type="bottom" :safe-area="false" @change="changPopShow" style="position: relative;z-index: 50;"> <uni-popup ref="popup" type="bottom" :safe-area="false" @change="changPopShow" style="position: relative;z-index: 50;">
@ -222,6 +231,7 @@
} catch(e) {} } catch(e) {}
this.info = resData this.info = resData
this.sku = resData.sku this.sku = resData.sku
this.shareParam = {title: this.info.title, imageUrl: this.info.headimg}
}); });
}, },
@ -844,4 +854,21 @@
button::after { button::after {
border: none; border: none;
} }
.cartNum{
width: 28rpx;
height: 28rpx;
background: #DC2525;
border-radius: 50%;
border: 1px solid #DC2525;
font-weight: normal;
font-size: 23rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: -10rpx;
right: -6rpx;
}
</style> </style>

1
subPackages/homestay/detail.vue

@ -299,6 +299,7 @@
let info = res.data; let info = res.data;
this.info = info this.info = info
console.log(info) console.log(info)
this.shareParam = {title: this.info.title, imageUrl: this.info.headimg}
}); });
}, },
// id // id

4
subPackages/search/result.vue

@ -89,6 +89,10 @@
this.getList(); this.getList();
}, },
pushHis(keywords) { pushHis(keywords) {
if (!keywords.trim()) {
return
}
let history = JSON.parse(uni.getStorageSync('tz_trip_keyowrds')) || []; let history = JSON.parse(uni.getStorageSync('tz_trip_keyowrds')) || [];
let index = history.findIndex(item => item == keywords); let index = history.findIndex(item => item == keywords);
if (index >= 0) history.splice(index, 1); if (index >= 0) history.splice(index, 1);

3
subPackages/search/techanResult.vue

@ -162,6 +162,9 @@
this.getList() this.getList()
}, },
pushHis(keywords) { pushHis(keywords) {
if (!keywords.trim()) {
return
}
let history = JSON.parse(uni.getStorageSync('tz_trip_keyowrds')) || []; let history = JSON.parse(uni.getStorageSync('tz_trip_keyowrds')) || [];
let index = history.findIndex(item => item == keywords); let index = history.findIndex(item => item == keywords);
if (index >= 0) history.splice(index, 1); if (index >= 0) history.splice(index, 1);

52
subPackages/techan/detail.vue

@ -69,16 +69,22 @@
</view> </view>
<view class="btn-list" > <view class="btn-list" >
<view class="left-box"> <view class="left-box flex-between">
<view class="img-box" v-if="supplierInfo" @click="goShopDetail(supplierInfo.id)">
<image src="https://static.ticket.sz-trip.com/uploads/20250820/ead79154bae29fde0cd05b41539a1a74.png" mode="aspectFill"></image>
<view class="text">店铺</view>
</view>
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"> <button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="img-box"> <view class="img-box">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/627d67e48ac41903c40c31f1613f2444.png" <image src="https://static.ticket.sz-trip.com/uploads/20250820/194e12115940d2c67619a2d1fd9120c3.png" mode="aspectFill"></image>
mode="aspectFill"></image> <view class="text">客服</view>
<view class="text">
客服
</view>
</view> </view>
</button> </button>
<view class="img-box" style="position: relative;" @click="goCartPage()">
<image src="https://static.ticket.sz-trip.com/uploads/20250820/17eeecf12ba9fdc56bce3b84fd5fb45f.png" mode="aspectFill"></image>
<view class="text">购物车</view>
<view class="cartNum" v-if="cartNum">{{cartNum}}</view>
</view>
</view> </view>
<view class="btn-post"> <view class="btn-post">
@ -87,13 +93,6 @@
</view> </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" @change="changPopShow" :safe-area="false" style="position: relative;z-index: 99;"> <uni-popup ref="popup" type="bottom" @change="changPopShow" :safe-area="false" style="position: relative;z-index: 99;">
<view class="popup-content" v-if="sku.length>0"> <view class="popup-content" v-if="sku.length>0">
@ -213,6 +212,8 @@
this.info = res.data; this.info = res.data;
this.sku = res.data.sku || [] this.sku = res.data.sku || []
this.getSupplierInfo(res.data.supplier_id) this.getSupplierInfo(res.data.supplier_id)
this.shareParam = {title: this.info.title, imageUrl: this.info.headimg}
}); });
}, },
getSupplierInfo (supplier_id) { getSupplierInfo (supplier_id) {
@ -565,6 +566,9 @@
.left-box { .left-box {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
flex: 1;
width: 100rpx;
padding-right: 50rpx;
.bottom-price{ .bottom-price{
display: flex; display: flex;
@ -590,11 +594,10 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 64rpx;
image { image {
width: 48rpx; width: 44rpx;
height: 48rpx; height: 44rpx;
} }
.text { .text {
@ -814,6 +817,7 @@
line-height: 60rpx; line-height: 60rpx;
text-align: center; text-align: center;
display: flex; display: flex;
flex-shrink: 0;
.left-btn-buy{ .left-btn-buy{
width: 200rpx; width: 200rpx;
@ -948,4 +952,20 @@
} }
} }
} }
.cartNum{
width: 28rpx;
height: 28rpx;
background: #DC2525;
border-radius: 50%;
border: 1px solid #DC2525;
font-weight: normal;
font-size: 23rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: -10rpx;
right: -6rpx;
}
</style> </style>

46
subPackages/ticket/detail.vue

@ -97,6 +97,7 @@
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="btn-box flex-center"> <view class="btn-box flex-center">
<view style="width: 180rpx;" class="flex-between">
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"> <button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="icon-container"> <view class="icon-container">
<view class="icon-item"> <view class="icon-item">
@ -105,15 +106,24 @@
</view> </view>
</view> </view>
</button> </button>
<view class="icon-container">
<view class="icon-item" style="position: relative;width: 80rpx;" @click="goCartPage()">
<image src="https://static.ticket.sz-trip.com/uploads/20250820/17eeecf12ba9fdc56bce3b84fd5fb45f.png" mode="aspectFill"></image>
<text>购物车</text>
<view class="cartNum" v-if="cartNum">{{cartNum}}</view>
</view>
</view>
</view>
<view class="btn" @click="showCartPopup">加入购物车</view> <view class="btn" @click="showCartPopup">加入购物车</view>
</view> </view>
<!-- 购物车图标 --> <!-- 购物车图标 -->
<view class="add-cart-icon" @click="goCartPage()"> <!-- <view class="add-cart-icon" @click="goCartPage()">
<uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small" <uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop" :offset="[-3, -3]" size="small"
:custom-style="{background:'#DC2525',color:'#ffffff'}"> :custom-style="{background:'#DC2525',color:'#ffffff'}">
<image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image> <image src="https://static.ticket.sz-trip.com/uploads/20250611/f8c2078ad76754a0b0251f9b65784dc2.png"></image>
</uni-badge> </uni-badge>
</view> </view> -->
<!-- 预订须知的弹窗 --> <!-- 预订须知的弹窗 -->
<uni-popup ref="popupRule" type="bottom" :safe-area="false"> <uni-popup ref="popupRule" type="bottom" :safe-area="false">
@ -301,6 +311,7 @@
title: this.info.title title: this.info.title
}) })
} }
this.shareParam = {title: this.info.title, imageUrl: this.info.headimg}
}); });
}, },
@ -440,6 +451,21 @@
// //
changeSku(itemSku,goods) { changeSku(itemSku,goods) {
//
console.log(itemSku, goods)
if(goods.is_package == 1) {
let orderInfo = [{
pInfo: goods,
sInfo: {...itemSku, buyNum: 1},
}]
this.$store.commit("changeFoodOrderList", orderInfo);
uni.navigateTo({
url: '/subPackages/food/order'
});
return
}
this.skuInfo = itemSku this.skuInfo = itemSku
this.selectGoods = goods this.selectGoods = goods
this.getPriceCal(itemSku,goods) this.getPriceCal(itemSku,goods)
@ -1308,4 +1334,20 @@
button::after { button::after {
border: none; border: none;
} }
.cartNum{
width: 28rpx;
height: 28rpx;
background: #DC2525;
border-radius: 50%;
border: 1px solid #DC2525;
font-weight: normal;
font-size: 23rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: -10rpx;
right: -6rpx;
}
</style> </style>

Loading…
Cancel
Save