完善分类页面
This commit is contained in:
parent
44dae598a1
commit
4f27f78409
|
@ -1,6 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {},
|
onLaunch: function () {
|
||||||
|
this.$store.dispatch('system/initConfig');
|
||||||
|
},
|
||||||
onShow: function () {},
|
onShow: function () {},
|
||||||
onHide: function () {},
|
onHide: function () {},
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex';
|
||||||
import CateTmpl from "@/components/cate/template/cate";
|
import CateTmpl from "@/components/cate/template/cate";
|
||||||
import ListTmpl from "@/components/cate/template/list";
|
import ListTmpl from "@/components/cate/template/list";
|
||||||
export default {
|
export default {
|
||||||
|
@ -95,14 +96,25 @@ export default {
|
||||||
CateTmpl,
|
CateTmpl,
|
||||||
ListTmpl,
|
ListTmpl,
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
config: state => state.system.config,
|
||||||
|
bodyPaddingTop: (state) => state.system.bodyPaddingTop,
|
||||||
|
})
|
||||||
|
},
|
||||||
created() {},
|
created() {},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getMenuItemTop();
|
this.getMenuItemTop();
|
||||||
let headerHeight = 40;
|
let headerHeight = this.$utils.rpx2px(this.bodyPaddingTop);
|
||||||
const { windowHeight, statusBarHeight } = uni.getSystemInfoSync();
|
let offsetHeight = this.$utils.rpx2px(this.offsetHeight);
|
||||||
this.wrapHeight = windowHeight - headerHeight - this.offsetHeight;
|
const { windowHeight, statusBarHeight } = this.config;
|
||||||
|
// 窗口高度 - 头部高度 - 顶部内容高度 = 分类容器高度
|
||||||
|
this.wrapHeight = windowHeight - headerHeight - offsetHeight;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
this.wrapHeight = this.wrapHeight - statusBarHeight;
|
// 微信窗口高度不会计算tabbar高度,这里加回来
|
||||||
|
if (this.cateType == 'cate') {
|
||||||
|
this.wrapHeight += this.$utils.rpx2px(100);
|
||||||
|
}
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
destroyed() {},
|
destroyed() {},
|
||||||
|
@ -222,7 +234,7 @@ export default {
|
||||||
// scrollHeight为右边菜单垂直中点位置
|
// scrollHeight为右边菜单垂直中点位置
|
||||||
// let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
|
// let scrollHeight = e.detail.scrollTop + this.menuHeight / 2;
|
||||||
// scrollHeight为右边菜单头部位置
|
// scrollHeight为右边菜单头部位置
|
||||||
let scrollHeight = e.detail.scrollTop + 10;
|
let scrollHeight = e.detail.scrollTop + 15;
|
||||||
for (let i = 0; i < this.arr.length; i++) {
|
for (let i = 0; i < this.arr.length; i++) {
|
||||||
let height1 = this.arr[i];
|
let height1 = this.arr[i];
|
||||||
let height2 = this.arr[i + 1];
|
let height2 = this.arr[i + 1];
|
||||||
|
|
|
@ -11,17 +11,25 @@
|
||||||
@click="clickItem(child.id, child.name)"
|
@click="clickItem(child.id, child.name)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="item-menu-image"
|
class="cover-image"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
:src="child.icon"
|
:src="child.icon"
|
||||||
></image>
|
></image>
|
||||||
<view class="item-menu-name">{{ child.name }}</view>
|
<view class="item-box">
|
||||||
|
<view class="title">{{ child.name }}</view>
|
||||||
|
<view class="text-box">
|
||||||
|
{{ "已服务113256次" }}
|
||||||
|
</view>
|
||||||
|
<view class="price">¥158元起</view>
|
||||||
|
<mini-add class="component-add" :initNumber="child.buyNumber" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import MiniAdd from "@/components/mini/add";
|
||||||
export default {
|
export default {
|
||||||
name: "component-cate-template-list",
|
name: "component-cate-template-list",
|
||||||
data() {
|
data() {
|
||||||
|
@ -33,7 +41,7 @@ export default {
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {},
|
components: { MiniAdd },
|
||||||
created() {},
|
created() {},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
destroyed() {},
|
destroyed() {},
|
||||||
|
@ -54,28 +62,47 @@ export default {
|
||||||
.item-container {
|
.item-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
.thumb-box {
|
}
|
||||||
width: 100%;
|
.thumb-box {
|
||||||
display: flex;
|
width: 100%;
|
||||||
justify-content: flex-start;
|
display: flex;
|
||||||
flex-direction: column;
|
justify-content: space-between;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
.thumb-box:nth-child(3n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.cover-image {
|
||||||
|
width: 130rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
border: 2rpx solid #d8d8d8;
|
||||||
|
}
|
||||||
|
.item-box {
|
||||||
|
position: relative;
|
||||||
|
width: 300rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: column;
|
||||||
|
.title {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #010101;
|
||||||
}
|
}
|
||||||
.thumb-box:nth-child(3n) {
|
.text-box {
|
||||||
margin-right: 0;
|
display: inline-block;
|
||||||
}
|
font-size: 22rpx;
|
||||||
.item-menu-image {
|
|
||||||
width: 120rpx;
|
|
||||||
height: 120rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
border: 2rpx solid #d8d8d8;
|
|
||||||
}
|
|
||||||
.item-menu-name {
|
|
||||||
margin-top: 15rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 24rpx;
|
}
|
||||||
|
.price {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #ec7655;
|
||||||
|
}
|
||||||
|
.component-add {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -1,15 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="page-layout" :style="{backgroundColor: pageBackgroundColor}">
|
<view class="page-layout" :style="{ backgroundColor: pageBackgroundColor }">
|
||||||
<view
|
<view
|
||||||
class="page-header"
|
class="page-header"
|
||||||
:class="[textColor]"
|
:class="[textColor]"
|
||||||
:style="{height: header.height + 'rpx', paddingTop: header.pt + 'rpx', backgroundColor: backgroundColor}"
|
:style="{
|
||||||
|
height: header.height + 'rpx',
|
||||||
|
paddingTop: header.pt + 'rpx',
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<!-- 首页选择地址 -->
|
<!-- 首页选择地址 -->
|
||||||
<block v-if="btnType === 'city'">
|
<block v-if="btnType === 'city'">
|
||||||
<view
|
<view
|
||||||
class="page-index-btn change-city"
|
class="page-index-btn change-city"
|
||||||
:style="{height: header.height + 'rpx'}"
|
:style="{ height: header.height + 'rpx' }"
|
||||||
@click="changeCity"
|
@click="changeCity"
|
||||||
>
|
>
|
||||||
<text class="iconfont icon-31dingwei"></text>
|
<text class="iconfont icon-31dingwei"></text>
|
||||||
|
@ -20,17 +24,20 @@
|
||||||
<block v-if="btnType === 'back'">
|
<block v-if="btnType === 'back'">
|
||||||
<view
|
<view
|
||||||
class="page-index-btn back"
|
class="page-index-btn back"
|
||||||
:style="{height: header.height + 'rpx'}"
|
:style="{ height: header.height + 'rpx' }"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
<text class="iconfont icon-fanhui"></text>
|
<text class="iconfont icon-fanhui"></text>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="page-title" :style="{lineHeight: header.height + 'rpx'}">
|
<view
|
||||||
<text class="title-text">{{title}}</text>
|
class="page-title"
|
||||||
|
:style="{ lineHeight: header.height + 'rpx' }"
|
||||||
|
>
|
||||||
|
<text class="title-text">{{ title }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="page-body" :style="{paddingTop: header.bodyPt + 'rpx'}">
|
<view class="page-body" :style="{ paddingTop: header.bodyPt + 'rpx' }">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</view>
|
</view>
|
||||||
<view class="page-footer"></view>
|
<view class="page-footer"></view>
|
||||||
|
@ -38,6 +45,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: "component-layout",
|
name: "component-layout",
|
||||||
data() {
|
data() {
|
||||||
|
@ -76,24 +84,25 @@ export default {
|
||||||
default: "unset",
|
default: "unset",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
config: (state) => state.system.config,
|
||||||
|
}),
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
const { statusBarHeight } = uni.getSystemInfoSync();
|
const { statusBarHeight } = this.config;
|
||||||
const { height } = uni.getMenuButtonBoundingClientRect();
|
this.header.pt = this.$utils.px2rpx(statusBarHeight);
|
||||||
this.header.pt = statusBarHeight;
|
this.header.height = this.$utils.px2rpx(50);
|
||||||
this.header.height = height;
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.header.pt = 0;
|
this.header.pt = 0;
|
||||||
this.header.height = 40;
|
this.header.height = this.$utils.px2rpx(40);
|
||||||
// #endif
|
// #endif
|
||||||
this.header.bodyPt = this.header.pt + this.header.height;
|
// 向下取整,避免留白
|
||||||
// px转rpx
|
this.header.bodyPt = Math.floor(this.header.pt + this.header.height);
|
||||||
this.header.pt = this.header.pt * 2;
|
this.$store.commit('system/setBodyPaddingTop', this.header.bodyPt);
|
||||||
this.header.height = this.header.height * 2;
|
|
||||||
this.header.bodyPt = this.header.bodyPt * 2;
|
|
||||||
},
|
},
|
||||||
computed: {},
|
|
||||||
methods: {
|
methods: {
|
||||||
onClick() {
|
onClick() {
|
||||||
if (this.customBtn) {
|
if (this.customBtn) {
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
<template>
|
||||||
|
<view class="mini-add" :class="[number > 0 ? 'between' : 'end']">
|
||||||
|
<view v-if="number > 0" class="btn sub" @click="sub">
|
||||||
|
<text class="iconfont icon-jianhao"></text>
|
||||||
|
</view>
|
||||||
|
<view v-if="number > 0" class="num">{{ number }}</view>
|
||||||
|
<view class="btn add" @click="add">
|
||||||
|
<text class="iconfont icon-jiahao-"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "mini-add",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
number: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
initNumber: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
created() {
|
||||||
|
this.number = this.initNumber;
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
destroyed() {},
|
||||||
|
methods: {
|
||||||
|
sub() {
|
||||||
|
if (this.number > 0) {
|
||||||
|
this.number--;
|
||||||
|
} else {
|
||||||
|
this.number = 0;
|
||||||
|
}
|
||||||
|
this.$emit('onSub', this.data, this.number);
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.number++;
|
||||||
|
this.$emit('onAdd', this.data, this.number);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.mini-add {
|
||||||
|
width: 130rpx;
|
||||||
|
height: 35rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.num {
|
||||||
|
color: #2D2D2D;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.mini-add.between {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.mini-add.end {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.btn.sub .iconfont,
|
||||||
|
.btn.add .iconfont {
|
||||||
|
color: #4b65ed;
|
||||||
|
font-size: 35rpx;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
function time() {
|
function time() {
|
||||||
return parseInt(Math.round(new Date() / 1000));
|
return parseInt(Math.round(new Date() / 1000));
|
||||||
};
|
};
|
||||||
|
@ -142,7 +144,17 @@ function debounce(func, wait = 500, immediate = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
function px2rpx(px) {
|
||||||
|
const { windowWidth } = uni.getStorageSync('system_config');
|
||||||
|
return 750 * (px / windowWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
function rpx2px(rpx) {
|
||||||
|
const { windowWidth } = uni.getStorageSync('system_config');
|
||||||
|
return (rpx / 750) * windowWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
time,
|
time,
|
||||||
datetime,
|
datetime,
|
||||||
timeDifference,
|
timeDifference,
|
||||||
|
@ -150,4 +162,6 @@ export {
|
||||||
randomString,
|
randomString,
|
||||||
throttle,
|
throttle,
|
||||||
debounce,
|
debounce,
|
||||||
|
px2rpx,
|
||||||
|
rpx2px,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<app-layout btnType="unset" title="分类" pageBackgroundColor="#F6F6F6">
|
<app-layout btnType="unset" title="分类" pageBackgroundColor="#F6F6F6" backgroundColor="#F6F6F6">
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<view class="icon">
|
<view class="icon">
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="cate">
|
<view class="cate">
|
||||||
<app-cate
|
<app-cate
|
||||||
:offsetHeight="60"
|
:offsetHeight="195"
|
||||||
:data="data"
|
:data="data"
|
||||||
cateType="cate"
|
cateType="cate"
|
||||||
@clickCate="clickCate"
|
@clickCate="clickCate"
|
||||||
|
@ -108,10 +108,11 @@ export default {
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.search {
|
.search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120rpx;
|
height: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
.input-box {
|
.input-box {
|
||||||
width: 670rpx;
|
width: 670rpx;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
|
@ -1,7 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<app-layout btnType="back" title="服务列表" pageBackgroundColor="#FFFFFF">
|
<app-layout btnType="back" title="服务列表" pageBackgroundColor="#FFFFFF">
|
||||||
<view class="cate">
|
<view class="cate">
|
||||||
<app-cate :offsetHeight="0" :data="data" cateType="list" />
|
<app-cate :data="data" cateType="list" />
|
||||||
|
</view>
|
||||||
|
<view class="buy-components" :style="{bottom: bottom + 'rpx'}">
|
||||||
|
<view class="cart">
|
||||||
|
<view class="cart-icon">
|
||||||
|
<text class="iconfont icon-gouwuche"></text>
|
||||||
|
</view>
|
||||||
|
<view class="cart-number">
|
||||||
|
<text class="text">99</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-btn">
|
||||||
|
<text class="text">去下单</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</app-layout>
|
</app-layout>
|
||||||
</template>
|
</template>
|
||||||
|
@ -9,6 +22,7 @@
|
||||||
<script>
|
<script>
|
||||||
import AppLayout from "@/components/layout/layout";
|
import AppLayout from "@/components/layout/layout";
|
||||||
import AppCate from "@/components/cate/cate";
|
import AppCate from "@/components/cate/cate";
|
||||||
|
import { mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: "service-list",
|
name: "service-list",
|
||||||
data() {
|
data() {
|
||||||
|
@ -23,21 +37,25 @@ export default {
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "空调安装",
|
name: "空调安装",
|
||||||
icon: require("@/static/temp/cate/1.png"),
|
icon: require("@/static/temp/cate/1.png"),
|
||||||
|
buyNumber: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: "空调拆卸",
|
name: "空调拆卸",
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
icon: require("@/static/temp/cate/2.png"),
|
||||||
|
buyNumber: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: "热水器安装",
|
name: "热水器安装",
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
icon: require("@/static/temp/cate/3.png"),
|
||||||
|
buyNumber: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
name: "油烟机安装",
|
name: "油烟机安装",
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
icon: require("@/static/temp/cate/4.png"),
|
||||||
|
buyNumber: 0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -50,30 +68,106 @@ export default {
|
||||||
id: 6,
|
id: 6,
|
||||||
name: "空调安装",
|
name: "空调安装",
|
||||||
icon: require("@/static/temp/cate/2.png"),
|
icon: require("@/static/temp/cate/2.png"),
|
||||||
|
buyNumber: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 7,
|
id: 7,
|
||||||
name: "空调拆卸",
|
name: "空调拆卸",
|
||||||
icon: require("@/static/temp/cate/3.png"),
|
icon: require("@/static/temp/cate/3.png"),
|
||||||
|
buyNumber: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 8,
|
id: 8,
|
||||||
name: "热水器安装",
|
name: "热水器安装",
|
||||||
icon: require("@/static/temp/cate/4.png"),
|
icon: require("@/static/temp/cate/4.png"),
|
||||||
|
buyNumber: 0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
bottom: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: { AppLayout, AppCate },
|
components: { AppLayout, AppCate },
|
||||||
onLoad() {},
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
config: (state) => state.system.config
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.bottom = this.$utils.px2rpx(this.config.safeAreaInsets.bottom);
|
||||||
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {},
|
||||||
methods: {},
|
methods: {},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped>
|
||||||
|
.buy-components {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: @tabBarHeight;
|
||||||
|
background-color: #ffffff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 20rpx 0 50rpx;
|
||||||
|
.cart {
|
||||||
|
position: relative;
|
||||||
|
width: 95rpx;
|
||||||
|
height: 95rpx;
|
||||||
|
}
|
||||||
|
.cart-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 0;
|
||||||
|
width: 95rpx;
|
||||||
|
height: 95rpx;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #4b65ed;
|
||||||
|
border-radius: 50%;
|
||||||
|
.iconfont {
|
||||||
|
color: #4b65ed;
|
||||||
|
font-size: 50rpx;
|
||||||
|
line-height: 95rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cart-number {
|
||||||
|
position: absolute;
|
||||||
|
top: -24rpx;
|
||||||
|
right: -16rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background-color: #ec7655;
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 0;
|
||||||
|
.text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-btn {
|
||||||
|
width: 300rpx;
|
||||||
|
height: 75rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: linear-gradient(-90deg, #8194f2, #4c60c1);
|
||||||
|
border-radius: 38rpx;
|
||||||
|
.text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 75rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,13 +1,13 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
|
|
||||||
import moduleA from '@/store/modules/moduleA'
|
|
||||||
import user from "@/store/modules/user"
|
import user from "@/store/modules/user"
|
||||||
|
import system from "@/store/modules/system"
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
moduleA,
|
|
||||||
user,
|
user,
|
||||||
|
system,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state: {
|
||||||
|
config: {},
|
||||||
|
bodyPaddingTop: 0,
|
||||||
|
},
|
||||||
|
getters: {
|
||||||
|
config(state) {
|
||||||
|
return state.config;
|
||||||
|
},
|
||||||
|
bodyPaddingTop(state) {
|
||||||
|
return bodyPaddingTop;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
setConfig(state, data) {
|
||||||
|
state.config = data;
|
||||||
|
},
|
||||||
|
setBodyPaddingTop(state, data) {
|
||||||
|
state.bodyPaddingTop = data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
initConfig(context) {
|
||||||
|
let config = uni.getStorageSync('system_config');
|
||||||
|
if (!config) {
|
||||||
|
let { windowWidth, windowHeight, statusBarHeight, safeAreaInsets } = uni.getSystemInfoSync();
|
||||||
|
config = { windowWidth, windowHeight, statusBarHeight, safeAreaInsets };
|
||||||
|
uni.setStorageSync('system_config', config);
|
||||||
|
}
|
||||||
|
context.commit('setConfig', config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue