powerbank/pages/agentpages/shopguanli/myshop/index.vue

337 lines
8.6 KiB
Vue
Raw Normal View History

2024-05-11 10:57:53 +08:00
<template>
<view class="page">
<u-navbar title="我的店铺" :border-bottom="false" :background="bgc" title-color='#000' title-size='36'
2024-05-25 18:06:00 +08:00
height='58'></u-navbar>
2024-05-17 18:10:58 +08:00
<view class="box">
<view class="top">
<u-search placeholder="搜索" input-align="center" v-model="keyword" @custom="searchs"></u-search>
</view>
2024-05-11 10:57:53 +08:00
<view class="list">
2024-05-30 18:02:15 +08:00
<view class="listitem" @scrolltolower="onReachBottom" v-for="(item,index) in wateringList" :key="index">
2024-05-11 10:57:53 +08:00
<view class="toptit">
2024-05-15 18:01:50 +08:00
<u-icon name="calendar-fill" size="36"></u-icon>
2024-05-17 18:10:58 +08:00
<view class="tit">
{{item.name}}
2024-05-11 10:57:53 +08:00
</view>
2024-05-15 18:01:50 +08:00
<!-- <view class="bd">
2024-05-11 10:57:53 +08:00
绑定设备
2024-05-15 18:01:50 +08:00
</view> -->
2024-05-25 18:06:00 +08:00
<view class="bd" @click="btnjifei(item.storeId)">
2024-05-11 10:57:53 +08:00
计费规则
</view>
2024-05-17 18:10:58 +08:00
<view class="yuan" @click="btnxq(item)">
<text
style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;background-color: #000;display: inline-block;"></text>
<text
style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;background-color: #000;display: inline-block;"></text>
<text
style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;background-color: #000;display: inline-block;"></text>
2024-05-11 10:57:53 +08:00
</view>
</view>
<view class="rishou">
<view class="rishouwz">
<text>日收</text><text>月收</text><text>上月收</text><text>在线</text><text>离线</text>
</view>
<view class="rishouje">
2024-05-31 18:01:02 +08:00
<text>{{item.todayIncome == null ? 0 :item.todayIncome}}</text>
<text>{{item.monthIncome == null ? 0 :item.monthIncome}}</text>
<text>{{item.lastMonthIncome == null ? 0 :item.lastMonthIncome}}</text>
<text>{{item.onlineCount == null ? 0 :item.onlineCount}}</text>
<text>{{item.offlineCount == null ? 0 :item.offlineCount}}</text>
2024-05-11 10:57:53 +08:00
</view>
</view>
<view class="gzlist">
<view class="jfgz">
2024-05-31 18:01:02 +08:00
<text>计费规则</text>{{item.feePrice == null ? 0 : item.feePrice}}/小时{{item.feeFreeTime == null ? 0 : item.feeFreeTime}}分钟免费封顶{{item.feeMaxPrice == null ? '0' : item.feeMaxPrice}}
2024-05-11 10:57:53 +08:00
</view>
<view class="phone">
2024-05-17 18:10:58 +08:00
<text>联系电话</text>{{item.contactMobile}}
2024-05-11 10:57:53 +08:00
</view>
<view class="phones">
2024-05-17 18:10:58 +08:00
<text>联系人员</text>{{item.contactName}}
2024-05-11 10:57:53 +08:00
</view>
</view>
<view class="yunxing">
2024-05-17 18:10:58 +08:00
<text>已运营{{item.daysDifference + 1}}</text> <text>{{item.createTime}}</text>
</view>
2024-05-11 10:57:53 +08:00
</view>
2024-05-31 18:01:02 +08:00
<view class="" style="width: 448rpx;height: 448rpx;margin: auto;margin-top: 100rpx;text-align: center;"
v-if="showflag">
<image style="width: 448rpx;height: 448rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/ufLi6IZd5kh1MIEZFYTo" mode=""></image>
<view class="" style="font-size: 30rpx;color: #ccc;margin-top: 30rpx;">暂无更多店铺...</view>
</view>
2024-05-17 18:10:58 +08:00
2024-05-11 10:57:53 +08:00
</view>
2024-05-17 18:10:58 +08:00
</view>
2024-05-11 10:57:53 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2024-05-17 18:10:58 +08:00
pagenum: 1,
wateringList: [],
pagesize: 10, // 一页多少数据
isLoading: false, // 是否正在加载数据
noMoreData: false, // 是否没有更多数据
total: 0,
agentId:'',
2024-05-31 18:01:02 +08:00
keyword:'',
bgc: {
background: '#25CE88'
},
showflag: false
2024-05-11 10:57:53 +08:00
}
},
2024-05-17 18:10:58 +08:00
onLoad() {
this.agentId = uni.getStorageSync('userdata').agentId
},
onShow() {
this.pagenum = 1
this.wateringList = []
this.getlist()
},
2024-05-11 10:57:53 +08:00
methods: {
2024-05-17 18:10:58 +08:00
getlist() {
this.$u.get("/agent/store/listChildren?pageNum=" + this.pagenum + '&pageSize=' + this.pagesize +'&agentId=' +this.agentId + '&keyword=' + this.keyword).then(res => {
if (res.code == 200) {
this.total = res.total
2024-05-31 18:01:02 +08:00
if (this.total > 0) {
this.showflag = false
} else {
this.showflag = true
}
2024-05-17 18:10:58 +08:00
if (res.rows.length > 0) {
// 有数据,追加到列表
this.wateringList = this.wateringList.concat(res.rows)
this.pagenum++
// 计算创建到现在运行了多少天
this.wateringList.forEach((item, index) => {
var dateTime = new Date(item.createTime);
if (isNaN(dateTime.getTime())) {
console.error(`无法解析日期时间字符串: ${item.createTime}`);
return;
}
var now = new Date().getTime();
var differenceInMilliseconds = now - dateTime.getTime();
var differenceInDays = Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24));
// 直接修改原数组中的对象添加daysDifference属性
item.daysDifference = differenceInDays;
})
} else {
// 没有更多数据
this.noMoreData = true;
}
this.isLoading = false;
}
})
},
searchs(){
this.wateringList = []
this.getlist()
},
onReachBottom() {
let sum = this.total / this.pagesize
if (this.pagenum-1 < sum) {
this.getlist(); // 上拉加载更多
} else {
uni.showToast({
2024-05-25 18:06:00 +08:00
title: '没有更多店铺了',
2024-05-17 18:10:58 +08:00
icon: 'none',
duration: 1000
});
}
},
btnxq(item) {
uni.navigateTo({
url: '/page_user/shopdetail?storeId=' + item.storeId
})
},
2024-05-25 18:06:00 +08:00
btnjifei(storeId) {
2024-05-17 18:10:58 +08:00
uni.navigateTo({
2024-05-25 18:06:00 +08:00
url: '/page_user/jifei?storeId=' + storeId
2024-05-17 18:10:58 +08:00
})
}
2024-05-11 10:57:53 +08:00
}
}
</script>
<style lang="scss">
2024-05-25 18:06:00 +08:00
/deep/ .u-title,
/deep/ .uicon-nav-back {
padding-bottom: 40rpx;
}
2024-05-11 10:57:53 +08:00
page {
2024-05-31 18:01:02 +08:00
// background: linear-gradient(180deg, #25CE88 0%, rgba(255, 255, 255, 0) 100%);
2024-05-11 10:57:53 +08:00
}
.page {
width: 750rpx;
2024-05-31 18:01:02 +08:00
// position: fixed;
// top: 0;
// left: 0;
2024-05-17 18:10:58 +08:00
.box {
2024-05-11 10:57:53 +08:00
width: 750rpx;
2024-05-31 18:01:02 +08:00
height: 100%;
2024-05-11 10:57:53 +08:00
background: #F4F5F7;
border-radius: 0rpx 0rpx 0rpx 0rpx;
2024-05-17 18:10:58 +08:00
.list {
2024-05-11 10:57:53 +08:00
overflow-y: scroll;
2024-05-31 18:01:02 +08:00
height: 100%;
2024-05-11 10:57:53 +08:00
padding-bottom: 400rpx;
2024-05-31 18:01:02 +08:00
margin-top: 170rpx;
2024-05-17 18:10:58 +08:00
.listitem {
2024-05-11 10:57:53 +08:00
margin-bottom: 28rpx !important;
padding: 12rpx 38rpx;
box-sizing: border-box;
width: 680rpx;
2024-05-17 18:10:58 +08:00
height: 460rpx;
2024-05-11 10:57:53 +08:00
background: #FFFFFF;
border-radius: 38rpx 38rpx 38rpx 38rpx;
margin: auto;
2024-05-17 18:10:58 +08:00
.yunxing {
2024-05-11 10:57:53 +08:00
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #808080;
margin-top: 26rpx;
}
2024-05-17 18:10:58 +08:00
.phones {
2024-05-11 10:57:53 +08:00
margin-top: 16rpx;
font-size: 24rpx;
color: #1DBE7B;
border-bottom: 1px solid #ccc;
padding-bottom: 26rpx;
box-sizing: border-box;
2024-05-17 18:10:58 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #808080;
}
}
2024-05-17 18:10:58 +08:00
.phone {
2024-05-11 10:57:53 +08:00
margin-top: 16rpx;
font-size: 24rpx;
color: #3D3D3D;
2024-05-17 18:10:58 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #808080;
}
}
2024-05-17 18:10:58 +08:00
.gzlist {
2024-05-11 10:57:53 +08:00
margin-top: 30rpx;
2024-05-17 18:10:58 +08:00
.jfgz {
2024-05-11 10:57:53 +08:00
font-size: 24rpx;
color: #3D3D3D;
2024-05-17 18:10:58 +08:00
text {
2024-05-11 10:57:53 +08:00
color: #808080;
}
}
}
2024-05-17 18:10:58 +08:00
.rishou {
2024-05-11 10:57:53 +08:00
margin-top: 26rpx;
padding: 0 28rpx;
box-sizing: border-box;
2024-05-17 18:10:58 +08:00
.rishouwz {
2024-05-11 10:57:53 +08:00
display: flex;
justify-content: space-between;
2024-05-17 18:10:58 +08:00
text {
2024-05-11 10:57:53 +08:00
font-size: 24rpx;
color: #808080;
}
}
2024-05-17 18:10:58 +08:00
.rishouje {
2024-05-11 10:57:53 +08:00
display: flex;
justify-content: space-between;
margin-top: 10rpx;
2024-05-17 18:10:58 +08:00
text {
2024-05-11 10:57:53 +08:00
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
}
}
2024-05-17 18:10:58 +08:00
.toptit {
2024-05-11 10:57:53 +08:00
border-bottom: 1px solid #ccc;
display: flex;
justify-content: space-between;
padding-bottom: 12rpx;
box-sizing: border-box;
2024-05-17 18:10:58 +08:00
.tit {
2024-05-15 18:01:50 +08:00
width: 350rpx;
2024-05-11 10:57:53 +08:00
background: #DBFAED;
border-radius: 16rpx 16rpx 16rpx 16rpx;
font-weight: 600;
font-size: 30rpx;
color: #3D3D3D;
padding: 10rpx 12rpx;
box-sizing: border-box;
}
2024-05-17 18:10:58 +08:00
.bd {
2024-05-15 18:01:50 +08:00
margin-top: 18rpx;
2024-05-17 18:10:58 +08:00
height: 100%;
2024-05-11 10:57:53 +08:00
font-size: 20rpx;
color: #FFFFFF;
padding: 4rpx 12rpx;
box-sizing: border-box;
background: #1DBE7B;
border-radius: 6rpx 6rpx 6rpx 6rpx;
}
2024-05-17 18:10:58 +08:00
.yuan {
2024-05-15 18:01:50 +08:00
margin-top: 10rpx;
2024-05-11 10:57:53 +08:00
}
}
}
}
2024-05-17 18:10:58 +08:00
.top {
2024-05-11 10:57:53 +08:00
width: 750rpx;
height: 136rpx;
background: #FFFFFF;
padding: 32rpx 36rpx;
box-sizing: border-box;
2024-05-31 18:01:02 +08:00
position: fixed;
top: 200rpx;
z-index: 99;
2024-05-17 18:10:58 +08:00
/deep/ .u-content {
2024-05-11 10:57:53 +08:00
border: 1px solid #ccc;
2024-05-17 18:10:58 +08:00
border-radius: 50rpx 0 0 50rpx !important;
2024-05-11 10:57:53 +08:00
}
2024-05-17 18:10:58 +08:00
/deep/ .u-action {
border-radius: 0 50rpx 50rpx 0 !important;
2024-05-11 10:57:53 +08:00
width: 112rpx;
height: 65rpx;
line-height: 65rpx;
border: 2rpx solid #ccc;
margin-left: 0;
color: #3D3D3D;
background-color: #f2f2f2;
}
}
}
}
</style>