添加geek模板库
parent
3185e4a287
commit
14d2c3e579
@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<view class="card" :class="type" @click="$emit('click')">
|
||||||
|
<image class="img" :src="img"/>
|
||||||
|
<view class="right">
|
||||||
|
<view class="title">{{ title }}</view>
|
||||||
|
<view class="subTitle">{{ subTitle }}</view>
|
||||||
|
<view class="price">¥ {{ price }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
img: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
subTitle: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
price: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'line'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.card {
|
||||||
|
padding: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
height: 240rpx;
|
||||||
|
width: 700rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin: 10rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
height: 200rpx;
|
||||||
|
width: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
position: absolute;
|
||||||
|
top: 20rpx;
|
||||||
|
left: 240rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 400rpx;
|
||||||
|
font-size: 35rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subTitle {
|
||||||
|
width: 400rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: rgb(87, 87, 87);
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: red;
|
||||||
|
bottom: 10rpx;
|
||||||
|
width: 400rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rect {
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
height: 500rpx;
|
||||||
|
width: 350rpx;
|
||||||
|
padding: 0px;
|
||||||
|
margin: 10rpx;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
height: 350rpx;
|
||||||
|
width: 350rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
padding: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
height: 160rpx;
|
||||||
|
width: 350rpx;
|
||||||
|
top: 350rpx;
|
||||||
|
left: 20rpx;
|
||||||
|
.title {
|
||||||
|
width: 330rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subTitle {
|
||||||
|
width: 330rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: rgb(87, 87, 87);
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: red;
|
||||||
|
bottom: 10rpx;
|
||||||
|
width: 330rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<view class="geek-card" @click="$emit('click')">
|
||||||
|
<view class="geek-header">
|
||||||
|
<view class="geek-shop">{{ shop }} > </view>
|
||||||
|
<view class="geek-status">{{ status }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="geek-content">
|
||||||
|
<image class="geek-img" :src="img"></image>
|
||||||
|
<view class="geek-label">{{ label }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="geek-footer">
|
||||||
|
<view class="geek-more" @click="$emit('more')">更多</view>
|
||||||
|
<view class="geek-buttonGroup">
|
||||||
|
<view class="geek-btn" @click="$emit('sell')">卖了换钱</view>
|
||||||
|
<view class="geek-btn" @click="$emit('return')">退换/售后</view>
|
||||||
|
<view class="geek-buy" @click="$emit('again')">再次购买</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
shop: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
img: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
price: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'line'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.geek-card {
|
||||||
|
border: 1rpx solid rgb(183, 183, 183);
|
||||||
|
position: relative;
|
||||||
|
padding: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 320rpx;
|
||||||
|
width: 700rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin: 20rpx;
|
||||||
|
|
||||||
|
.geek-header {
|
||||||
|
.geek-shop {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-status {
|
||||||
|
width: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-content {
|
||||||
|
.geek-label {
|
||||||
|
position: absolute;
|
||||||
|
top: 100rpx;
|
||||||
|
width: 500rpx;
|
||||||
|
left: 180rpx;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-img {
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 160rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
top: 70rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-footer {
|
||||||
|
width: 660rpx;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10rpx;
|
||||||
|
font-size: 25rpx;
|
||||||
|
|
||||||
|
.geek-more {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-buttonGroup {
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
bottom: 0;
|
||||||
|
|
||||||
|
.geek-btn {
|
||||||
|
border: 1rpx solid black;
|
||||||
|
width: 150rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 10rpx;
|
||||||
|
padding: 6rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.geek-buy {
|
||||||
|
color: red;
|
||||||
|
border: 1rpx solid red;
|
||||||
|
width: 150rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
border-radius: 100px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 10rpx;
|
||||||
|
padding: 6rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
<template>
|
||||||
|
<uni-section class="mb-10" title="数值板" sub-title="statistic" type="line"></uni-section>
|
||||||
|
<u-row gutter="0">
|
||||||
|
<u-col span="6">
|
||||||
|
<geek-statistic label="订单数量(个)" labelColor="#1f1f1f" :number="0" numberColor="red" />
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<geek-statistic label="交易金额(元)" labelColor="#1f1f1f" :number="0" numberColor="red" />
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
|
||||||
|
<uni-section class="mb-10" title="菜单" sub-title="menu" type="line"></uni-section>
|
||||||
|
<u-row>
|
||||||
|
<u-col :span="2.1" :offset="0.3" v-for="menu, index in menus" :key="index">
|
||||||
|
<geek-menu :icon="menu.icon" :label="menu.label" :size="60" @click="modal.msg(menu.label)" type="circle" />
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<u-row>
|
||||||
|
<u-col :span="2.1" :offset="0.3" v-for="menu, index in menus" :key="index">
|
||||||
|
<geek-menu :icon="menu.icon" :label="menu.label" :size="60" @click="modal.msg(menu.label)" type="rect" />
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
|
||||||
|
<uni-section class="mb-10" title="商品列表" sub-title="commodity" type="line"></uni-section>
|
||||||
|
<geek-commodity v-for="item, index in commodityList" :key="index" :price="item.price" :title="item.title"
|
||||||
|
:sub-title="item.subTitle" :img="item.img" type="line" @click="modal.msg(item.title)" />
|
||||||
|
<geek-commodity v-for="item, index in commodityList" :key="index" :price="item.price" :title="item.title"
|
||||||
|
:sub-title="item.subTitle" :img="item.img" type="rect" @click="modal.msg(item.title)" />
|
||||||
|
|
||||||
|
|
||||||
|
<uni-section class="mb-10" title="订单列表" sub-title="order" type="line"></uni-section>
|
||||||
|
<geek-order v-for="item, index in orderList" :img="item.img" :label="item.title" :shop="item.shop" :status="item.status"
|
||||||
|
:price="item.price" @more="modal.msg('更多')" @again="modal.msg('再次购买')" @return="modal.msg('退换')"
|
||||||
|
@sell="modal.msg('卖了换钱')"></geek-order>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
|
||||||
|
const menus = reactive([
|
||||||
|
{ icon: "/static/images/icon/rocket.png", label: '抢单' },
|
||||||
|
{ icon: "/static/images/icon/phone.png", label: '回访' },
|
||||||
|
{ icon: "/static/images/icon/message.png", label: '消息' },
|
||||||
|
{ icon: "/static/images/icon/dialogue.png", label: '公告' },
|
||||||
|
{ icon: "/static/images/icon/knowledge.png", label: '知识库' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
const commodityList = reactive([
|
||||||
|
{
|
||||||
|
img: '/static/images/banner/banner01.jpg',
|
||||||
|
title: '商品1',
|
||||||
|
subTitle: '商品1简介',
|
||||||
|
price: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
img: '/static/images/banner/banner02.jpg',
|
||||||
|
title: '商品2',
|
||||||
|
subTitle: '商品2简介',
|
||||||
|
price: 300,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
img: '/static/images/banner/banner03.jpg',
|
||||||
|
title: '商品3',
|
||||||
|
subTitle: '商品3简介',
|
||||||
|
price: 200,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
const orderList = [
|
||||||
|
{
|
||||||
|
shop: 'geek自营旗舰店',
|
||||||
|
status: '完成',
|
||||||
|
img: '/static/images/banner/banner01.jpg',
|
||||||
|
title: '商品1',
|
||||||
|
subTitle: '商品1简介',
|
||||||
|
price: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
shop: 'geek自营旗舰店',
|
||||||
|
status: '已取消',
|
||||||
|
img: '/static/images/banner/banner03.jpg',
|
||||||
|
title: '商商商商商商商商商商商商商商商商商商商商商商商商商商商商商商商商商商品3',
|
||||||
|
subTitle: '商品3简介',
|
||||||
|
price: 200,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@ -1,38 +0,0 @@
|
|||||||
<template>
|
|
||||||
<uni-section class="mb-10" title="数值板" sub-title="statistic" type="line"></uni-section>
|
|
||||||
<u-row gutter="0">
|
|
||||||
<u-col span="6">
|
|
||||||
<statistic label="订单数量(个)" labelColor="#1f1f1f" number="0" numberColor="red" />
|
|
||||||
</u-col>
|
|
||||||
<u-col span="6">
|
|
||||||
<statistic label="交易金额(元)" labelColor="#1f1f1f" number="0" numberColor="red" />
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
|
|
||||||
<uni-section class="mb-10" title="圆形菜单" sub-title="circle-menu" type="line"></uni-section>
|
|
||||||
<u-row>
|
|
||||||
<u-col :span="2.1" :offset="0.3" v-for="menu, index in menus" :key="index">
|
|
||||||
<circleMenu :icon="menu.icon" :label="menu.label" :size="60" @click="modal.msg(menu.label)"></circleMenu>
|
|
||||||
</u-col>
|
|
||||||
</u-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
|
||||||
import circleMenu from '../../components/circle-menu'
|
|
||||||
import statistic from '../../components/statistic.vue';
|
|
||||||
import modal from '@/plugins/modal.js'
|
|
||||||
|
|
||||||
|
|
||||||
// 菜单板块
|
|
||||||
const menus = reactive(
|
|
||||||
[
|
|
||||||
{ icon: "/static/images/icon/rocket.png", label: '抢单' },
|
|
||||||
{ icon: "/static/images/icon/phone.png", label: '回访' },
|
|
||||||
{ icon: "/static/images/icon/message.png", label: '消息' },
|
|
||||||
{ icon: "/static/images/icon/dialogue.png", label: '公告' },
|
|
||||||
{ icon: "/static/images/icon/knowledge.png", label: '知识库' }
|
|
||||||
]);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
Loading…
Reference in New Issue