Commit 7b2e7c08 by zhangcheng

添加首页店铺ui,功能未完成

parent 6d7235bc
<template>
<view>
详情页
</view>
</template>
<script>
export default {
}
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
\ No newline at end of file
</style>
......@@ -42,16 +42,15 @@
"root": "menuSubPackage",
"pages": [
{
"path": "pages/demo/demo",
"style": {
// "navigationBarBackgroundColor": "",
// "navigationBarTitleText": "",
"enablePullDownRefresh": false
// "navigationStyle":"custom"
}
}
]
"path" : "pages/goodsDetail/goodsDetail",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
},
{
"root": "orderSubPackage",
......
......@@ -2,6 +2,14 @@
<view class="menu-box" :style="{height:`${height}px`}">
<view class="menu-banner">
<image src="../../static/imgs/banner.png"></image>
<view class="shop-info" :style="{top: `${menuINfo.top}px`}">
<view class="shop-box" :style="{height: `${menuINfo.height}px`,'line-height': `${menuINfo.height}px`}" @click="getLocation">
<text class="shop-name">北京国贸银泰中心店</text>
<u-icon name="arrow-right" class="arrow-right-select" color="#FFFFFF"></u-icon>
</view>
<view class="distance">距您130m</view>
</view>
<view class="login-area">
<view class="avatar"><image :src="'../../static/logo.png'"></image></view>
<view class="user-info">
......@@ -45,7 +53,7 @@
>
<view v-for="(category, index) in classifyData" :key="index" class="box">
<view class="right-title">{{category.name}}</view>
<view class="nav-right-item" v-for="(item, i) in category.goods" :key="item.goodsId" @click="cart(item.name)">
<view class="nav-right-item" v-for="(item, i) in category.goods" :key="item.goodsId" @click="cart(item)">
<image class="thumbnail" :src="item.pics.thumbnail" />
<view class="info">
<view class="goods-name">{{ item.name }}</view>
......@@ -105,6 +113,7 @@ import Menu from '@/request/menu'
},
created() {
this.menuINfo = uni.getMenuButtonBoundingClientRect();
console.log(this.menuINfo,77766)
//如果你的分类数据为后台异步获取请 将下方代码放置你的数据回调中
// this.$nextTick(()=>{
// this.getHeightList();
......@@ -144,6 +153,15 @@ import Menu from '@/request/menu'
uniGetUserInfo() {
User.uniGetUserInfo();
},
getLocation() {
uni.authorize({
scope:'scope.userLocation',
success(res) {
console.log(res)
User.getLocation();
}
})
},
async getMenuList() {
let res = await Menu.getMenuList();
if(res.data.code ==200){
......@@ -229,10 +247,11 @@ import Menu from '@/request/menu'
this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[index]); //防止两次相等造成点击不触发滚动时间
},
cart: function (text) {
uni.showToast({
title: text,
icon: "none"
});
uni.navigateTo({url:'/menuSubPackage/pages/goodsDetail/goodsDetail'})
// uni.showToast({
// title: text,
// icon: "none"
// });
}
},
components: { ShopCar }
......@@ -240,7 +259,34 @@ import Menu from '@/request/menu'
</script>
<style lang="scss">
.menu-box{}
.menu-box{
.shop-info{
position: absolute;
left: 32rpx;
color: #FFFFFF;
.shop-box{
min-width:300rpx;
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
display: flex;
.shop-name{
flex: 1;
}
.arrow-right-select{
width:9rpx;
}
}
.distance{
height: 46rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 42rpx;
}
}
}
.menu-banner{
height: 376rpx;
position:relative;
......
......@@ -30,9 +30,9 @@ uni.$u.http.interceptors.request.use((config) => { // å¯ä½¿ç”¨async await åšå¼
mask: true,
});
let Authorization = uni.getStorageSync(`Authorization`);
if (Authorization) {
config.header.Authorization = Authorization;
}
// if (Authorization) {
// config.header.Authorization = Authorization;
// }
console.log(config,4444)
if (!Authorization) { // 如果token不存在,return Promise.reject(config) 会取消本次请求
// return Promise.reject(config);
......
......@@ -3,7 +3,7 @@ export default {
getMenuList(id) {
return uni.$u.http.get('/weixin/infoByShop', {
params:{
shopId:"4"
shopId:"6"
}
}).then(res => {
return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment