Commit 7b2e7c08 by zhangcheng

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

parent 6d7235bc
<template> <template>
<view>
详情页
</view>
</template> </template>
<script> <script>
export default { export default {
data() {
} return {
}
},
methods: {
}
}
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
...@@ -42,16 +42,15 @@ ...@@ -42,16 +42,15 @@
"root": "menuSubPackage", "root": "menuSubPackage",
"pages": [ "pages": [
{ {
"path": "pages/demo/demo", "path" : "pages/goodsDetail/goodsDetail",
"style": { "style" :
// "navigationBarBackgroundColor": "", {
// "navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
// "navigationStyle":"custom" }
}
}
} ]
]
}, },
{ {
"root": "orderSubPackage", "root": "orderSubPackage",
......
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
<view class="menu-box" :style="{height:`${height}px`}"> <view class="menu-box" :style="{height:`${height}px`}">
<view class="menu-banner"> <view class="menu-banner">
<image src="../../static/imgs/banner.png"></image> <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="login-area">
<view class="avatar"><image :src="'../../static/logo.png'"></image></view> <view class="avatar"><image :src="'../../static/logo.png'"></image></view>
<view class="user-info"> <view class="user-info">
...@@ -45,7 +53,7 @@ ...@@ -45,7 +53,7 @@
> >
<view v-for="(category, index) in classifyData" :key="index" class="box"> <view v-for="(category, index) in classifyData" :key="index" class="box">
<view class="right-title">{{category.name}}</view> <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" /> <image class="thumbnail" :src="item.pics.thumbnail" />
<view class="info"> <view class="info">
<view class="goods-name">{{ item.name }}</view> <view class="goods-name">{{ item.name }}</view>
...@@ -105,6 +113,7 @@ import Menu from '@/request/menu' ...@@ -105,6 +113,7 @@ import Menu from '@/request/menu'
}, },
created() { created() {
this.menuINfo = uni.getMenuButtonBoundingClientRect(); this.menuINfo = uni.getMenuButtonBoundingClientRect();
console.log(this.menuINfo,77766)
//如果你的分类数据为后台异步获取请 将下方代码放置你的数据回调中 //如果你的分类数据为后台异步获取请 将下方代码放置你的数据回调中
// this.$nextTick(()=>{ // this.$nextTick(()=>{
// this.getHeightList(); // this.getHeightList();
...@@ -144,6 +153,15 @@ import Menu from '@/request/menu' ...@@ -144,6 +153,15 @@ import Menu from '@/request/menu'
uniGetUserInfo() { uniGetUserInfo() {
User.uniGetUserInfo(); User.uniGetUserInfo();
}, },
getLocation() {
uni.authorize({
scope:'scope.userLocation',
success(res) {
console.log(res)
User.getLocation();
}
})
},
async getMenuList() { async getMenuList() {
let res = await Menu.getMenuList(); let res = await Menu.getMenuList();
if(res.data.code ==200){ if(res.data.code ==200){
...@@ -229,10 +247,11 @@ import Menu from '@/request/menu' ...@@ -229,10 +247,11 @@ import Menu from '@/request/menu'
this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[index]); //防止两次相等造成点击不触发滚动时间 this.scrollTop == this.arr[index] ? (this.scrollTop = this.scrollTop + 1) : (this.scrollTop = this.arr[index]); //防止两次相等造成点击不触发滚动时间
}, },
cart: function (text) { cart: function (text) {
uni.showToast({ uni.navigateTo({url:'/menuSubPackage/pages/goodsDetail/goodsDetail'})
title: text, // uni.showToast({
icon: "none" // title: text,
}); // icon: "none"
// });
} }
}, },
components: { ShopCar } components: { ShopCar }
...@@ -240,7 +259,34 @@ import Menu from '@/request/menu' ...@@ -240,7 +259,34 @@ import Menu from '@/request/menu'
</script> </script>
<style lang="scss"> <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{ .menu-banner{
height: 376rpx; height: 376rpx;
position:relative; position:relative;
......
...@@ -30,9 +30,9 @@ uni.$u.http.interceptors.request.use((config) => { // å¯ä½¿ç”¨async await åšå¼ ...@@ -30,9 +30,9 @@ uni.$u.http.interceptors.request.use((config) => { // å¯ä½¿ç”¨async await åšå¼
mask: true, mask: true,
}); });
let Authorization = uni.getStorageSync(`Authorization`); let Authorization = uni.getStorageSync(`Authorization`);
if (Authorization) { // if (Authorization) {
config.header.Authorization = Authorization; // config.header.Authorization = Authorization;
} // }
console.log(config,4444) console.log(config,4444)
if (!Authorization) { // 如果token不存在,return Promise.reject(config) 会取消本次请求 if (!Authorization) { // 如果token不存在,return Promise.reject(config) 会取消本次请求
// return Promise.reject(config); // return Promise.reject(config);
......
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
getMenuList(id) { getMenuList(id) {
return uni.$u.http.get('/weixin/infoByShop', { return uni.$u.http.get('/weixin/infoByShop', {
params:{ params:{
shopId:"4" shopId:"6"
} }
}).then(res => { }).then(res => {
return 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