第一次上传
This commit is contained in:
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
|
||||
|
||||
<!-- 商品图片展示 -->
|
||||
<view class="product-image-section">
|
||||
<image :src="Service.GetMateUrlByImg('/static/dele/dele4.jpg')" mode="aspectFill" class="product-image">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<view class="product-info-section">
|
||||
<view class="shop-header">
|
||||
<view class="shop-name">美食小铺</view>
|
||||
<view class="shop-tags">
|
||||
<text class="tag new-shop">新店</text>
|
||||
<text class="tag popular">人气店</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="display: flex; align-items: center;">
|
||||
<view class="func-detail">
|
||||
<text style="color: #FF6B35;">4.7</text>分
|
||||
</view>
|
||||
<view class="func-detail">
|
||||
月销<text style="color: #FF6B35;">4.7</text>
|
||||
</view>
|
||||
<view class="func-detail">
|
||||
人均<text style="color: #FF6B35;">¥47</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商家信息卡片 -->
|
||||
<view class="shop-card-section">
|
||||
|
||||
<view class="shop-info">
|
||||
<view class="" @click="handleViewLocation()" style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="info-item">
|
||||
<u-icon name="map" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">朝阳区美食街123号</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<u-icon name="arrow-right" size="18" color="#999999" class="info-icon"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" @click="handleContactShop()" style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="info-item">
|
||||
<u-icon name="phone" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">010-12345678</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<u-icon name="arrow-right" size="18" color="#999999" class="info-icon"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<u-icon name="home" size="22" color="#999999" class="info-icon"></u-icon>
|
||||
<text class="info-text">朝阳美食社区</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 同店推荐 -->
|
||||
<view class="recommendations-section">
|
||||
<text class="section-title">店内商品</text>
|
||||
<view class="recommendations-list">
|
||||
<view @click="Service.GoPage('/pages/goods/goodsDetail')" class="recommendation-item"
|
||||
v-for="(item, index) in recommendations" :key="index">
|
||||
<image :src="item.image" mode="aspectFill" class="recommendation-image"></image>
|
||||
<view class="recommendation-info">
|
||||
<text class="recommendation-name">{{ item.name }}</text>
|
||||
<text class="recommendation-price">{{ item.price }}</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="28rpx" color="#999999" class="arrow-icon"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" style="width: 100%; height: 150rpx;">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { Service } from "@/Service/Service"
|
||||
|
||||
// 推荐商品数据类型
|
||||
interface Recommendation {
|
||||
id : number;
|
||||
name : string;
|
||||
price : string;
|
||||
image : string;
|
||||
}
|
||||
|
||||
// 同店推荐商品数据
|
||||
const recommendations = ref<Recommendation[]>([
|
||||
{
|
||||
id: 1,
|
||||
name: '招牌卤肉饭',
|
||||
price: '¥26',
|
||||
image: '/static/dele/dele4.jpg'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '红烧牛肉面',
|
||||
price: '¥32',
|
||||
image: '/static/dele/dele4.jpg'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '香菇三明治',
|
||||
price: '¥28',
|
||||
image: '/static/dele/dele4.jpg'
|
||||
}
|
||||
]);
|
||||
|
||||
// 联系商家按钮样式
|
||||
const contactButtonStyle = ref({
|
||||
backgroundColor: '#FF6600',
|
||||
borderColor: '#FF6600',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '75rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginRight: '20rpx'
|
||||
});
|
||||
|
||||
// 查看位置按钮样式
|
||||
const locationButtonStyle = ref({
|
||||
backgroundColor: '#FF6600',
|
||||
borderColor: '#FF6600',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '75rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginLeft: '20rpx'
|
||||
});
|
||||
|
||||
// 处理联系商家
|
||||
const handleContactShop = () => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: '10086', // 要拨打的电话号码
|
||||
success: function () {
|
||||
console.log('拨打电话成功');
|
||||
},
|
||||
fail: function (err) {
|
||||
console.error('拨打电话失败', err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 处理查看位置
|
||||
const handleViewLocation = () => {
|
||||
wx.chooseLocation({
|
||||
success: res => {
|
||||
|
||||
// latitude.value = res.latitude.toString();
|
||||
// longitude.value = res.longitude.toString();
|
||||
}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 商品图片展示 */
|
||||
.product-image-section {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 商家信息 */
|
||||
|
||||
.func-detail {
|
||||
margin-right: 30rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.product-info-section {
|
||||
padding: 30rpx;
|
||||
margin: 30rpx;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
font-size: 40rpx;
|
||||
color: #FF6600;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-description {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
|
||||
/* 商家信息卡片 */
|
||||
.shop-card-section {
|
||||
padding: 30rpx;
|
||||
margin: 30rpx;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.shop-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 38rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.shop-tags {
|
||||
display: flex;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.tag.new-shop {
|
||||
background-color: #4CD964;
|
||||
}
|
||||
|
||||
.tag.popular {
|
||||
background-color: #FF9500;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.info-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-icon {
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
font-size: 28rpx;
|
||||
margin-left: 15rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
/* 同店推荐 */
|
||||
.recommendations-section {
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.recommendations-list {
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.recommendation-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
margin: 20rpx 0;
|
||||
box-shadow: 0 0 10rpx 4rpx #E2e2e2;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.recommendation-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.recommendation-image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.recommendation-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.recommendation-name {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.recommendation-price {
|
||||
font-size: 30rpx;
|
||||
color: #FF6600;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
/* 底部操作按钮 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
padding: 30rpx 30rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user