Commit 804aa513 authored by 罗超's avatar 罗超

1

parent 4189281c
...@@ -801,6 +801,8 @@ ...@@ -801,6 +801,8 @@
"path": "goods" "path": "goods"
},{ },{
"path": "set" "path": "set"
},{
"path": "timeQuantum"
} }
] ]
} }
......
<template>
<view class="goodsItem flex-between">
<view class="imgbox">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/user.png"
mode="aspectFill"
class="img"
/>
</view>
<view class="goodsInfoBox">
<view class="goodsName"
>测试商品ssadfdsdddddddddddddddddddddddddddddddddddddddddddddddddd啛啛喳喳吃错错错错错错错错错错错dd</view
>
<view class="price">¥0.01</view>
<view class="flex-between surplus">
<text>库存:999</text>
<u-icon name="ellipsis" :size="40" @click="changeShow"></u-icon>
</view>
<view class="operationBox flex-between" v-if="showOperationBox">
<view class="btn">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/edit.png"
mode=""
style="width: 40rpx; height: 40rpx"
/>
编辑
</view>
<view class="btn">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/xiajia.png"
mode=""
style="width: 40rpx; height: 40rpx"
/>
下架
</view>
<view class="btn">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/delete.png"
mode=""
style="width: 40rpx; height: 40rpx"
/>
删除
</view>
<view class="sanjiaoxing"></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showOperationBox: false,
};
},
methods: {
changeShow() {
this.showOperationBox = !this.showOperationBox;
},
},
};
</script>
<style lang="scss" scoped>
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.goodsItem {
width: 700rpx;
height: 200rpx;
margin: 10rpx auto;
box-sizing: border-box;
padding: 20rpx;
border-radius: 6rpx;
background-color: #fff;
.imgbox {
width: 150rpx;
height: 150rpx;
border-radius: 6rpx;
overflow: hidden;
margin-right: 20rpx;
box-shadow: 0rpx 0rpx 10rpx 0px rgba(36, 36, 36, 0.2);
.img {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
}
.goodsInfoBox {
width: 490rpx;
font-size: 24rpx;
color: #333;
height: 150rpx;
position: relative;
.goodsName {
height: 50%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 28rpx;
word-break: break-all;
}
.price {
font-size: 28rpx;
color: #f00;
}
.surplus {
font-size: 24rpx;
}
.operationBox {
width: 260rpx;
height: 100rpx;
border-radius: 10rpx;
background-color: #404040;
position: absolute;
top: 0rpx;
right: 0rpx;
padding: 0 20rpx;
.btn {
width: 55rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
font-size: 26rpx;
color: #fff;
}
}
.sanjiaoxing {
width: 0;
height: 0;
border-left: 10rpx solid transparent;
border-right: 10rpx solid transparent;
border-top: 10rpx solid #404040;
position: absolute;
top: 100rpx;
right: 16rpx;
}
}
}
</style>
\ No newline at end of file
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
<text>订单号:20211018154423824347</text> <text>订单号:20211018154423824347</text>
<text style="color: #446dfc">待退款</text> <text style="color: #446dfc">待退款</text>
</view> </view>
<view class="flex-between remarks"> <view class="flex-between remarks"> 商家备注:20211018154423824347 </view>
商家备注:20211018154423824347
</view>
<view class="consigneeInfo"> <view class="consigneeInfo">
<text style="margin-right: 40rpx">信息</text> <text style="margin-right: 40rpx">信息</text>
<text style="margin-right: 20rpx">13312341234</text> <text style="margin-right: 20rpx">13312341234</text>
...@@ -70,7 +68,7 @@ export default { ...@@ -70,7 +68,7 @@ export default {
color: #333; color: #333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.remarks{ .remarks {
font-size: 26rpx; font-size: 26rpx;
color: #333; color: #333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
...@@ -103,8 +101,8 @@ export default { ...@@ -103,8 +101,8 @@ export default {
} }
} }
.goodsBox { .goodsBox {
width: 480rpx;
height: 160rpx; height: 160rpx;
flex-grow: 1;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
.goodsName { .goodsName {
...@@ -114,6 +112,7 @@ export default { ...@@ -114,6 +112,7 @@ export default {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
word-break: break-all;
} }
.weight { .weight {
height: 35%; height: 35%;
......
...@@ -15,13 +15,33 @@ ...@@ -15,13 +15,33 @@
@change="change" @change="change"
></u-tabs> ></u-tabs>
</view> </view>
<view
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding-bottom: 20px;
"
>
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
>
<goodsItem />
</scroll-view>
</view>
<tabbar></tabbar> <tabbar></tabbar>
</view> </view>
</template> </template>
<script> <script>
import tabbar from "./components/tabbar.vue"; import tabbar from "./components/tabbar.vue";
import goodsItem from "./components/goodsItem.vue";
export default { export default {
components: { components: {
goodsItem,
tabbar, tabbar,
}, },
data() { data() {
...@@ -36,12 +56,32 @@ export default { ...@@ -36,12 +56,32 @@ export default {
}, },
], ],
current: 0, current: 0,
msg: {
pageIndex: 1,
pageSize: 15,
OrderId: 0,
OrderType: 0,
DeliveryMethod: 0,
StartTime: "",
EndTime: "",
OrderStatus: 0,
OrderNo: "",
},
}; };
}, },
methods: { methods: {
change(index) { change(index) {
this.current = index; this.current = index;
}, },
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
}, },
onLoad() { onLoad() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -88,6 +128,6 @@ export default { ...@@ -88,6 +128,6 @@ export default {
} }
} }
.tabbox { .tabbox {
height: 100rpx; margin-bottom: 10rpx;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view class="indexpage"> <view class="indexpage">
<view class="topBox"> <view class="topBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/bg.png" mode="widthFix" <image
class="bg" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/bg.png"
mode="widthFix"
class="bg"
/>
<view class="topinfo"> <view class="topinfo">
<view class="flex-center"> <view class="flex-center">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png" <image
class="headimg" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png"
class="headimg"
/>
<view class="name1">饭粒汪</view> <view class="name1">饭粒汪</view>
</view> </view>
<view style="display:flex;flex-wrap:wrap;justify-content:center;width:100rpx"> <view
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/qr_code.png" style="
class="ewmimg" mode="aspectFill" /> display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100rpx;
"
>
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/qr_code.png"
class="ewmimg"
mode="aspectFill"
/>
<view class="name2">收款码</view> <view class="name2">收款码</view>
</view> </view>
</view> </view>
<view class="msgBox flex-center"> <view class="msgBox flex-center">
<view class="itemBox"> <view class="itemBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/order.png" <image
mode="" class="imgicon" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/order.png"
mode=""
class="imgicon"
/>
<view class="iconname">订单消息</view> <view class="iconname">订单消息</view>
<view class="tipNum">1</view> <view class="tipNum">1</view>
</view> </view>
<view class="itemBox"> <view class="itemBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/msg.png" mode="" <image
class="imgicon" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/msg.png"
mode=""
class="imgicon"
/>
<view class="iconname">审核消息</view> <view class="iconname">审核消息</view>
</view> </view>
<view class="itemBox"> <view class="itemBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png" <image
mode="" class="imgicon" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/cash.png"
mode=""
class="imgicon"
/>
<view class="iconname">提现申请</view> <view class="iconname">提现申请</view>
</view> </view>
<view class="itemBox"> <view class="itemBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/comment.png" <image
mode="" class="imgicon" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/comment.png"
mode=""
class="imgicon"
/>
<view class="iconname">评论管理</view> <view class="iconname">评论管理</view>
</view> </view>
<view class="itemBox"> <view class="itemBox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/user.png" <image
mode="" class="imgicon" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/user.png"
mode=""
class="imgicon"
/>
<view class="iconname">用户管理</view> <view class="iconname">用户管理</view>
</view> </view>
</view> </view>
...@@ -47,10 +77,20 @@ ...@@ -47,10 +77,20 @@
<view class="conditionOfBusiness"> <view class="conditionOfBusiness">
<view class="title">经营状况</view> <view class="title">经营状况</view>
<view class="day flex-center"> <view class="day flex-center">
<view class="dayitem choose">今日</view> <!-- <view class="dayitem choose">今日</view>
<view class="dayitem">昨日</view> <view class="dayitem">昨日</view> -->
<view class="dayitem choose">7日</view> <view
<view class="dayitem">30日</view> class="dayitem"
@click="handleClickDate('first')"
:class="{ choose: clickDate == 'first' }"
>7日</view
>
<view
class="dayitem"
@click="handleClickDate('second')"
:class="{ choose: clickDate == 'second' }"
>30日</view
>
</view> </view>
<view class="BusinessData"> <view class="BusinessData">
<view class="dataitem"> <view class="dataitem">
...@@ -77,39 +117,70 @@ ...@@ -77,39 +117,70 @@
<view class="handleItem"> <view class="handleItem">
<view class="handleItemNum">0</view> <view class="handleItemNum">0</view>
<view class="handleItemName">待发货订单</view> <view class="handleItemName">待发货订单</view>
<view class="handleItemBtn">立即发货 <u-icon name="arrow"></u-icon> <view class="handleItemBtn"
>立即发货 <u-icon name="arrow"></u-icon>
</view> </view>
</view> </view>
<view class="handleItem"> <view class="handleItem">
<view class="handleItemNum">0</view> <view class="handleItemNum">0</view>
<view class="handleItemName">维权订单</view> <view class="handleItemName">维权订单</view>
<view class="handleItemBtn">立即处理 <u-icon name="arrow"></u-icon> <view class="handleItemBtn"
>立即处理 <u-icon name="arrow"></u-icon>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="echartsBox"> <view class="echartsBox">
<view class="title flex-center"> <view class="title flex-center">
<picker @change="bindPickerChange" :value="key" :range="array" range-key="name"> <picker
<view class="payType">{{ payType }} @change="bindPickerChange"
:value="key"
:range="array"
range-key="name"
>
<view class="payType"
>{{ payType }}
<u-icon name="arrow-down"></u-icon> <u-icon name="arrow-down"></u-icon>
</view> </view>
</picker> </picker>
<picker @change="bindPickerChange1" :value="key" :range="array1" range-key="name"> <picker
<view class="payType">{{ payType1 }} @change="bindPickerChange1"
:value="key"
:range="array1"
range-key="name"
>
<view class="payType"
>{{ payType1 }}
<u-icon name="arrow-down"></u-icon> <u-icon name="arrow-down"></u-icon>
</view> </view>
</picker> </picker>
</view> </view>
<view class="day flex-center"> <view class="day flex-center">
<view class="dayitem choose">今日</view> <!-- <view class="dayitem choose">今日</view>
<view class="dayitem">昨日</view> <view class="dayitem">昨日</view> -->
<view class="dayitem choose">7日</view> <view
<view class="dayitem">30日</view> class="dayitem"
@click="handleClickDate('first')"
:class="{ choose: clickDate == 'first' }"
>7日</view
>
<view
class="dayitem"
@click="handleClickDate('second')"
:class="{ choose: clickDate == 'second' }"
>30日</view
>
</view> </view>
<view style="height:100rpx;"></view> <view style="height: 100rpx"></view>
<canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" disable-scroll="true" <canvas
@touchstart="touchColumn" @touchmove="moveColumn" @touchend="touchEndColumn"> canvas-id="canvasColumn"
id="canvasColumn"
class="charts"
disable-scroll="true"
@touchstart="touchColumn"
@touchmove="moveColumn"
@touchend="touchEndColumn"
>
</canvas> </canvas>
</view> </view>
<tabbar></tabbar> <tabbar></tabbar>
...@@ -117,17 +188,18 @@ ...@@ -117,17 +188,18 @@
</template> </template>
<script> <script>
import uCharts from "../school/components/u-charts/u-charts.min.js"; import uCharts from "../school/components/u-charts/u-charts.min.js";
import tabbar from "./components/tabbar.vue" import tabbar from "./components/tabbar.vue";
var canvaColumn = null; var canvaColumn = null;
var _self; var _self;
export default { export default {
components: { components: {
tabbar tabbar,
}, },
data() { data() {
return { return {
array: [{ array: [
{
name: "支付金额", name: "支付金额",
key: 1, key: 1,
}, },
...@@ -145,7 +217,8 @@ ...@@ -145,7 +217,8 @@
}, },
], ],
payType: "", payType: "",
array1: [{ array1: [
{
name: "全部", name: "全部",
key: 1, key: 1,
}, },
...@@ -163,6 +236,21 @@ ...@@ -163,6 +236,21 @@
}, },
], ],
payType1: "", payType1: "",
//加载
loading: false,
clickDate: "first",
dateStr: [], //日期
//查询数据
basicQMsg: {
Source: 0, //来源
StartDate: "", //开始时间
EndDate: "", //结束时间
SalesTimeType: 0, //默认今日
OrderBy: "",
UserType: -1, //0-普通用户,1-领队导游
},
basicData: {}, //基础数据
salesData: {}, //销售数据
}; };
}, },
methods: { methods: {
...@@ -221,7 +309,8 @@ ...@@ -221,7 +309,8 @@
extra: { extra: {
column: { column: {
type: "group", type: "group",
width: (_self.cWidth * _self.pixelRatio * 0.45) / width:
(_self.cWidth * _self.pixelRatio * 0.45) /
chartData.categories.length, chartData.categories.length,
}, },
}, },
...@@ -239,11 +328,67 @@ ...@@ -239,11 +328,67 @@
animation: true, animation: true,
}); });
canvaColumn.showToolTip(e, { canvaColumn.showToolTip(e, {
format: function(item, category) { format: function (item, category) {
return category + " " + item.name + ":" + item.data + "元"; return category + " " + item.name + ":" + item.data + "元";
}, },
}); });
}, },
//基础数据日期切换
handleClickDate(name) {
this.clickDate = name;
this.dateStr = [];
//7日
if (name == "first") {
this.dateStr.push(this.$utils.AddDay("", -7));
}
//30日
else if (name == "second") {
this.dateStr.push(this.$utils.AddDay("", -30));
}
this.dateStr.push(this.$utils.AddDay("", -0));
this.getBasicData();
},
//获取基础数据
getBasicData() {
this.loading = true;
if (this.dateStr && this.dateStr.length > 0) {
this.basicQMsg.StartDate = this.dateStr[0];
this.basicQMsg.EndDate = this.dateStr[1];
} else {
this.basicQMsg.StartDate = "";
this.basicQMsg.EndDate = "";
}
this.apipost("/api/Tenant/MallIndexStatistics", this.basicQMsg, (res) => {
this.loading = false;
if (res.data.resultCode == 1) {
//基础数据统计
this.basicData = res.data.data.basicData;
//销售情况统计
this.salesData = res.data.data.salesData;
// //商品购买力TOP排行
// var saleGoodsArray = res.data.data.saleIncomeData;
// if (saleGoodsArray) {
// if (saleGoodsArray.length <= 2) {
// this.saleIncomeData = saleGoodsArray;
// } else {
// this.saleIncomeData = saleGoodsArray.slice(0, 15);
// }
// }
// //用户购买力TOP排行
// var saleUserArray = res.data.data.saleUserData;
// if (saleUserArray) {
// if (saleUserArray.length <= 2) {
// this.saleUserData = saleUserArray;
// } else {
// this.saleUserData = saleUserArray.slice(0, 15);
// }
// }
// this.initMap();
} else {
// this.Info(res.data.message);
}
});
},
}, },
onLoad() { onLoad() {
this.payType = this.array[0].name; this.payType = this.array[0].name;
...@@ -251,39 +396,40 @@ ...@@ -251,39 +396,40 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "商城管理", title: "商城管理",
}); });
this.getBasicData()
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.indexpage { .indexpage {
min-height: 100vh; min-height: 100vh;
background-color: #f7f7f7; background-color: #f7f7f7;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
.flex-center { .flex-center {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.topBox { .topBox {
height: 350rpx; height: 350rpx;
position: relative; position: relative;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.bg { .bg {
width: 100%; width: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 0; z-index: 0;
} }
.topinfo { .topinfo {
height: 130rpx; height: 130rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 0 50rpx 0 20rpx; padding: 0 50rpx 0 20rpx;
...@@ -295,31 +441,31 @@ ...@@ -295,31 +441,31 @@
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
} }
.headimg { .headimg {
width: 70rpx; width: 70rpx;
height: 70rpx; height: 70rpx;
border-radius: 50%; border-radius: 50%;
} }
.name1 { .name1 {
margin-left: 24rpx; margin-left: 24rpx;
font-size: 40rpx; font-size: 40rpx;
color: #fff; color: #fff;
} }
.ewmimg { .ewmimg {
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
} }
.name2 { .name2 {
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
} }
.msgBox { .msgBox {
box-sizing: border-box; box-sizing: border-box;
width: 700rpx; width: 700rpx;
height: 200rpx; height: 200rpx;
...@@ -366,10 +512,10 @@ ...@@ -366,10 +512,10 @@
font-size: 24rpx; font-size: 24rpx;
} }
} }
} }
.conditionOfBusiness, .conditionOfBusiness,
.echartsBox { .echartsBox {
height: 480rpx; height: 480rpx;
width: 700rpx; width: 700rpx;
margin: 0 auto; margin: 0 auto;
...@@ -380,11 +526,12 @@ ...@@ -380,11 +526,12 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
.day { .day {
width: 590rpx; width: 300rpx;
height: 50rpx; height: 50rpx;
border-radius: 25rpx; border-radius: 25rpx;
border: 2rpx solid #667cb8; border: 2rpx solid #667cb8;
overflow: hidden; overflow: hidden;
margin: 0 auto;
.dayitem { .dayitem {
width: 150rpx; width: 150rpx;
...@@ -422,14 +569,14 @@ ...@@ -422,14 +569,14 @@
} }
} }
} }
} }
.title { .title {
font-size: 30rpx; font-size: 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.fastHandle { .fastHandle {
width: 700rpx; width: 700rpx;
// height: 300rpx; // height: 300rpx;
margin: 0 auto; margin: 0 auto;
...@@ -465,9 +612,9 @@ ...@@ -465,9 +612,9 @@
} }
} }
} }
} }
.echartsBox { .echartsBox {
width: 700rpx; width: 700rpx;
height: auto; height: auto;
margin: 0 auto; margin: 0 auto;
...@@ -477,5 +624,5 @@ ...@@ -477,5 +624,5 @@
display: flex; display: flex;
font-size: 30rpx; font-size: 30rpx;
} }
} }
</style> </style>
<template> <template>
<view> <view class="setPage">
<view class="topBox">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/bg.png"
mode="widthFix"
class="bg"
/>
<view class="headImgBox"></view>
<view class="nameBox"
>饭粒汪
<u-icon
name="edit"
style="margin-left: 10rpx"
@click="showBox1 = true"
></u-icon>
</view>
<u-modal
v-model="showBox1"
:show-cancel-button="true"
title="修改商城名称"
contentSlot
@confirm="showBox1 = false"
>
<input type="text" v-model="username" class="nameInput" />
</u-modal>
</view>
<view class="boxGroup">
<view class="boxItem">
<view class="leftBox flex-center">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mallManage/shop.png"
mode="widthFix"
style="width: 100%"
/>
</view>
<view class="rightBox">
<view class="name">营业状态</view>
<u-switch v-model="msg.business"></u-switch>
</view>
</view>
<view class="boxItem">
<view class="leftBox"></view>
<view
class="rightBox"
:style="businessKey == 1 ? 'border:none' : ''"
></view>
<u-radio-group
v-model="msg.businessTime"
@change="radioGroupChange"
class="radioGroup"
>
<u-radio
v-for="(item, index) in businessTimeList"
:key="index"
:name="item.key"
shape="circle"
>
{{ item.name }}
</u-radio>
</u-radio-group>
</view>
<view class="boxItem" v-if="businessKey == 2">
<view class="leftBox"></view>
<view class="rightBox" @click="showBox2 = true">
<view class="name">选择日期</view>
<view class="flex-center">
<view class="weeek">{{ weekStr }}</view>
<u-icon name="arrow" style="margin-left: 10rpx"></u-icon
></view>
</view>
</view>
<u-modal
v-model="showBox2"
:show-cancel-button="true"
title="选择日期"
contentSlot
@confirm="showBox2 = false"
>
<view class="modelBox2">
<view
v-for="(item, index) in weekArr"
:key="index"
class="modelBox2Item"
:class="item.choose ? 'modelBox2ItemActive' : ''"
@click="chooseWeek(item)"
>
{{ item.name }}
</view>
</view>
</u-modal>
<view class="boxItem" v-if="businessKey == 2">
<view class="leftBox"></view>
<view class="rightBox" style="border: none">
<view class="name">选择时间段</view>
<view class="flex-center">
<view class="weeek">{{ weekStr }}</view>
<u-icon name="arrow" style="margin-left: 10rpx"></u-icon
></view>
</view>
</view>
</view>
<tabbar></tabbar> <tabbar></tabbar>
</view> </view>
</template> </template>
<script> <script>
import tabbar from "./components/tabbar.vue"; import tabbar from "./components/tabbar.vue";
export default { export default {
components:{ components: {
tabbar tabbar,
}, },
} data() {
return {
showBox1: false,
username: "",
showBox2: false,
msg: {
business: false,
businessTime: 1,
},
businessTimeList: [
{
name: "全天24小时",
key: 1,
},
{
name: "自定义营业时间",
key: 2,
},
],
businessKey: 1,
weekArr: [
{
name: "周一",
key: 1,
choose: false,
},
{
name: "周二",
key: 2,
choose: false,
},
{
name: "周三",
key: 3,
choose: false,
},
{
name: "周四",
key: 4,
choose: false,
},
{
name: "周五",
key: 5,
choose: false,
},
{
name: "周六",
key: 6,
choose: false,
},
{
name: "周日",
key: 7,
choose: false,
},
],
weekStr: "",
};
},
methods: {
radioGroupChange(e) {
this.businessKey = e;
},
chooseWeek(e) {
e.choose = !e.choose;
this.weekStr = this.weekArr
.filter((item) => {
return item.choose;
})
.map((item) => item.name)
.join("、");
},
jumpPage(url){
uni.navigateTo({
url: url,
});
}
},
onLoad() {
uni.setNavigationBarTitle({
title: "商城设置",
});
},
};
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.flex-center{ .flex-center {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
}
.setPage {
min-height: 100vh;
background-color: #f7f7f7;
box-sizing: border-box;
padding-bottom: 100rpx;
}
.topBox {
position: relative;
margin-bottom: 20rpx;
.bg {
width: 100%;
}
.headImgBox {
position: absolute;
top: 30rpx;
left: 50%;
transform: translateX(-50%);
z-index: 2;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
border: 4rpx solid #fff;
overflow: hidden;
background-color: #f00;
}
.nameBox {
width: 700rpx;
height: 200rpx;
border-radius: 10rpx;
position: absolute;
top: 110rpx;
left: 50%;
transform: translateX(-50%);
z-index: 1;
background-color: #fff;
font-size: 28rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
.boxGroup {
width: 700rpx;
padding: 0 30rpx;
margin: 10rpx auto;
background-color: #fff;
border-radius: 10rpx;
.boxItem {
height: 100rpx;
display: flex;
align-items: center;
position: relative;
.leftBox {
width: 50rpx;
margin-right: 20rpx;
}
.rightBox {
width: 560rpx;
height: 100rpx;
border-bottom: 2rpx solid #ccced5;
display: flex;
justify-content: space-between;
align-items: center;
.name {
font-size: 28rpx;
color: #606266;
}
}
.radioGroup {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
} }
}
}
/deep/.u-radio {
margin-right: 60rpx;
}
/deep/.u-radio__icon-wrap {
margin-right: 20rpx;
}
/deep/.u-model {
border-radius: 10rpx;
}
.weeek {
max-width: 300rpx;
white-space: nowrap;
overflow: hidden;
font-size: 28rpx;
color: #606266;
}
.nameInput {
width: 560rpx;
height: 70rpx;
border-radius: 10rpx;
margin: 20rpx auto;
box-sizing: border-box;
padding: 0 20rpx;
background-color: #f7f7f7;
}
.modelBox2 {
width: 560rpx;
border-radius: 10rpx;
margin: 20rpx auto;
box-sizing: border-box;
padding: 0 20rpx;
background-color: #fff;
display: flex;
flex-wrap: wrap;
.modelBox2Item {
width: 160rpx;
height: 60rpx;
border-radius: 30rpx;
border: 2rpx solid #dfdfdf;
font-size: 30rpx;
color: #a4a4a4;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 20rpx 10rpx 0;
}
& .modelBox2Item:nth-child(3n) {
margin-right: 0;
}
.modelBox2ItemActive {
border-color: #111 !important;
color: #111;
}
}
</style> </style>
\ No newline at end of file
<template>
<view class="timepage">
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad() {
uni.setNavigationBarTitle({
title: "设置时间段",
});
},
};
</script>
<style lang="scss" scoped>
.timepage{
min-height: 100vh;
background-color: #f7f7f7;
box-sizing: border-box;
padding-bottom: var(safe-area-inset-bottom);
}
</style>
\ No newline at end of file
...@@ -7,7 +7,7 @@ function calcContentHeight(chaliang) { ...@@ -7,7 +7,7 @@ function calcContentHeight(chaliang) {
}) })
return contentHeight return contentHeight
} }
function SystemInfo(){//获取屏幕宽高 function SystemInfo() {//获取屏幕宽高
let SystemInfo = {} let SystemInfo = {}
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -17,22 +17,45 @@ function SystemInfo(){//获取屏幕宽高 ...@@ -17,22 +17,45 @@ function SystemInfo(){//获取屏幕宽高
}) })
return SystemInfo return SystemInfo
} }
function getRect(selector){//获取元素的信息 function getRect(selector) {//获取元素的信息
return new Promise((resolve) => { return new Promise((resolve) => {
let view = uni.createSelectorQuery().select(selector); let view = uni.createSelectorQuery().select(selector);
view.fields({ view.fields({
size: true, size: true,
rect: true, rect: true,
scrollOffset:true scrollOffset: true
}, (res) => { }, (res) => {
resolve(res); resolve(res);
}).exec(); }).exec();
}) })
} }
function AddDay(date, day) {
let myDate = "";
if (date) {
myDate = new Date(date);
} else {
myDate = new Date();
}
myDate = myDate.setDate(myDate.getDate() + day);
myDate = new Date(myDate);
const seperator1 = "-";
let year = myDate.getFullYear();
let month = myDate.getMonth() + 1;
let strDate = myDate.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
let currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
}
export default { export default {
calcContentHeight, calcContentHeight,
SystemInfo, SystemInfo,
getRect getRect,
AddDay
} }
\ No newline at end of file
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