|
@@ -2,12 +2,11 @@
|
|
<view class="detail">
|
|
<view class="detail">
|
|
<!-- 轮播图 -->
|
|
<!-- 轮播图 -->
|
|
<view class="carousel-map">
|
|
<view class="carousel-map">
|
|
- <u-swiper :list="swiperList" previousMargin="30" nextMargin="30" circular bgColor="#ffffff"
|
|
|
|
- height="190" />
|
|
|
|
|
|
+ <u-swiper :list="swiperList" previousMargin="30" nextMargin="30" circular bgColor="#ffffff" height="190" />
|
|
<view class="carousel-item">
|
|
<view class="carousel-item">
|
|
<view class="mark">
|
|
<view class="mark">
|
|
<view class="mark-item">{{ merchant.score }}分</view>
|
|
<view class="mark-item">{{ merchant.score }}分</view>
|
|
- <u-rate count="5" v-model="merchant.score" active-color="#fff" readonly inactive-color="#fff" :size="12" />
|
|
|
|
|
|
+ <u-rate count="5" v-model="merchant.score" active-color="#fff" readonly inactive-color="#fff" :size="12" />
|
|
</view>
|
|
</view>
|
|
<view class="good-item">近期有6266个购买者给了给好评</view>
|
|
<view class="good-item">近期有6266个购买者给了给好评</view>
|
|
</view>
|
|
</view>
|
|
@@ -96,7 +95,7 @@
|
|
|
|
|
|
<!-- 底部购物车 -->
|
|
<!-- 底部购物车 -->
|
|
<view class="bottom-box">
|
|
<view class="bottom-box">
|
|
- <settleBottomBtn :goodsCateList.sync='goodsCateList' :ids='ids'/>
|
|
|
|
|
|
+ <settleBottomBtn :goodsCateList.sync='goodsCateList' :ids='ids' />
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
@@ -127,11 +126,19 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import { getSellsDetail, addReservation , addShoppingCart } from '@/api/client/business.js';
|
|
|
|
- import { getCurrentLocation, hotMerchant } from '@/api/client/home';
|
|
|
|
|
|
+ import {
|
|
|
|
+ getSellsDetail,
|
|
|
|
+ addReservation,
|
|
|
|
+ addShoppingCart,
|
|
|
|
+ getCartList
|
|
|
|
+ } from '@/api/client/business.js';
|
|
|
|
+ import {
|
|
|
|
+ getCurrentLocation,
|
|
|
|
+ hotMerchant
|
|
|
|
+ } from '@/api/client/home';
|
|
import settleBottomBtn from "@/components/settleBottomBtn/settleBottomBtn.vue"
|
|
import settleBottomBtn from "@/components/settleBottomBtn/settleBottomBtn.vue"
|
|
export default {
|
|
export default {
|
|
- components:{
|
|
|
|
|
|
+ components: {
|
|
settleBottomBtn
|
|
settleBottomBtn
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -143,8 +150,8 @@
|
|
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
|
|
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
|
|
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
|
|
'https://cdn.uviewui.com/uview/swiper/swiper1.png'
|
|
],
|
|
],
|
|
- categoryList:[], // 分类列表
|
|
|
|
- goodsCateList:[],
|
|
|
|
|
|
+ categoryList: [], // 分类列表
|
|
|
|
+ goodsCateList: [],
|
|
queryParams: {
|
|
queryParams: {
|
|
//请求参数
|
|
//请求参数
|
|
id: null, //商家ID
|
|
id: null, //商家ID
|
|
@@ -160,7 +167,7 @@
|
|
appointTime: '',
|
|
appointTime: '',
|
|
},
|
|
},
|
|
template_time: '',
|
|
template_time: '',
|
|
- ids:null // 商家id
|
|
|
|
|
|
+ ids: null // 商家id
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -168,6 +175,14 @@
|
|
this.queryParams.id = option.id;
|
|
this.queryParams.id = option.id;
|
|
this.handlerInitLocation();
|
|
this.handlerInitLocation();
|
|
},
|
|
},
|
|
|
|
+ onShow() {
|
|
|
|
+ getCartList(this.ids).then(res => {
|
|
|
|
+ console.log('getCartList', res);
|
|
|
|
+ if(res.data.cartItems.length){
|
|
|
|
+ this.goodsCateList = res.data.cartItems
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
reserve_show(newValue) {
|
|
reserve_show(newValue) {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
@@ -209,8 +224,8 @@
|
|
longitude: 119.13279,
|
|
longitude: 119.13279,
|
|
};
|
|
};
|
|
// getCurrentLocation(point).then(rc => {
|
|
// getCurrentLocation(point).then(rc => {
|
|
- this.queryParams.region = 370705;
|
|
|
|
- this.handlerInitList();
|
|
|
|
|
|
+ this.queryParams.region = 370705;
|
|
|
|
+ this.handlerInitList();
|
|
// });
|
|
// });
|
|
},
|
|
},
|
|
// 初始化列表
|
|
// 初始化列表
|
|
@@ -224,9 +239,7 @@
|
|
// 获取锚点
|
|
// 获取锚点
|
|
hotMerchant(this.queryParams.id).then();
|
|
hotMerchant(this.queryParams.id).then();
|
|
|
|
|
|
- addShoppingCart({merchantId:this.ids}).then(res=>{
|
|
|
|
- console.log('addShoppingCart',res);
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
// 点击拨打电话
|
|
// 点击拨打电话
|
|
handlerMakeCall() {
|
|
handlerMakeCall() {
|
|
@@ -301,21 +314,31 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 收藏按钮
|
|
// 收藏按钮
|
|
- handlerFavouriteShop(){
|
|
|
|
|
|
+ handlerFavouriteShop() {
|
|
|
|
|
|
},
|
|
},
|
|
// 添加购物车
|
|
// 添加购物车
|
|
- handlerAddCart(e){
|
|
|
|
|
|
+ handlerAddCart(e) {
|
|
let params = {
|
|
let params = {
|
|
- merchantId:this.ids,
|
|
|
|
- goodsId:e.id,
|
|
|
|
- quantity:1,
|
|
|
|
- price:e.specialPrice,
|
|
|
|
- goodsName:e.name,
|
|
|
|
- goodsPic:e.logo, // 这个没了
|
|
|
|
|
|
+ merchantId: this.ids,
|
|
|
|
+ goodsId: e.id,
|
|
|
|
+ quantity: 1,
|
|
|
|
+ price: e.specialPrice,
|
|
|
|
+ goodsName: e.name,
|
|
|
|
+ goodsPic: e.logo,
|
|
// goodsSubTitle:this.goods.description
|
|
// goodsSubTitle:this.goods.description
|
|
}
|
|
}
|
|
- this.goodsCateList.push(params)
|
|
|
|
|
|
+ addShoppingCart(params).then(res => {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.goodsCateList.push(params)
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:res.msg,
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
formatter(type, value) {
|
|
formatter(type, value) {
|
|
if (type === 'minute') {
|
|
if (type === 'minute') {
|
|
@@ -337,7 +360,7 @@
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.detail {
|
|
.detail {
|
|
- min-height: calc( 100vh - 200rpx );
|
|
|
|
|
|
+ min-height: calc(100vh - 200rpx);
|
|
background-color: #efefef;
|
|
background-color: #efefef;
|
|
padding-bottom: 200rpx;
|
|
padding-bottom: 200rpx;
|
|
}
|
|
}
|
|
@@ -461,11 +484,11 @@
|
|
margin: 10rpx 0 10rpx;
|
|
margin: 10rpx 0 10rpx;
|
|
color: #333;
|
|
color: #333;
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
- .item-text-left{
|
|
|
|
|
|
|
|
- }
|
|
|
|
- .item-text-right{
|
|
|
|
- .img{
|
|
|
|
|
|
+ .item-text-left {}
|
|
|
|
+
|
|
|
|
+ .item-text-right {
|
|
|
|
+ .img {
|
|
width: 50rpx;
|
|
width: 50rpx;
|
|
height: 50rpx;
|
|
height: 50rpx;
|
|
}
|
|
}
|
|
@@ -483,6 +506,7 @@
|
|
.star {
|
|
.star {
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+
|
|
.line {
|
|
.line {
|
|
margin: 0 12rpx;
|
|
margin: 0 12rpx;
|
|
margin-top: 5rpx;
|
|
margin-top: 5rpx;
|
|
@@ -526,15 +550,18 @@
|
|
|
|
|
|
.btn-box {
|
|
.btn-box {
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+
|
|
.btn {
|
|
.btn {
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.btn1 {
|
|
.btn1 {
|
|
border-radius: 40rpx 0 0 40rpx;
|
|
border-radius: 40rpx 0 0 40rpx;
|
|
border: 2rpx solid #ec5729;
|
|
border: 2rpx solid #ec5729;
|
|
color: #ec5729;
|
|
color: #ec5729;
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
}
|
|
}
|
|
|
|
+
|
|
.btn2 {
|
|
.btn2 {
|
|
color: #fff;
|
|
color: #fff;
|
|
background-color: #ec5729;
|
|
background-color: #ec5729;
|
|
@@ -569,7 +596,7 @@
|
|
border-width: 0.5px !important;
|
|
border-width: 0.5px !important;
|
|
border-color: #dadbde !important;
|
|
border-color: #dadbde !important;
|
|
border-style: solid;
|
|
border-style: solid;
|
|
- padding:12rpx 12rpx 18rpx 18rpx;
|
|
|
|
|
|
+ padding: 12rpx 12rpx 18rpx 18rpx;
|
|
border-radius: 8rpx;
|
|
border-radius: 8rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -593,7 +620,7 @@
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
}
|
|
}
|
|
|
|
|
|
- .bottom-box{
|
|
|
|
|
|
+ .bottom-box {
|
|
width: 100%;
|
|
width: 100%;
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 5%;
|
|
bottom: 5%;
|