第一次上传
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 478 B |
@@ -0,0 +1,538 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<!-- Tab 切换栏 -->
|
||||
<!-- <view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index" class="tab-item" :class="{ active: currentTab === index }"
|
||||
@click="switchTab(index)">
|
||||
<text class="tab-text">{{ tab.label }}</text>
|
||||
<view v-if="currentTab === index" class="tab-indicator"></view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 统计卡片 -->
|
||||
<view class="stats-section">
|
||||
<view class="stats-card">
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{allAmount}}</text>
|
||||
<text class="stat-label">营业额</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{ Number(average).toFixed(2) }}</text>
|
||||
<text class="stat-label">实际到账</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">{{ orderTotal }}</text>
|
||||
<text class="stat-label">订单数</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="date-filter" style="margin: 20rpx;">
|
||||
<view class="date-picker">
|
||||
<up-icon name="calendar" color="#3B82F6" size="25"></up-icon>
|
||||
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="date" v-model="begin" @change='changeTime()'>
|
||||
<view class="date-text">
|
||||
<text class="label">开始日期</text>
|
||||
<text class="value">{{begin}}</text>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="date-picker">
|
||||
<up-icon name="calendar" color="#3B82F6" size="25"></up-icon>
|
||||
<uni-datetime-picker type="date" v-model="end" @change='changeTime()'>
|
||||
<view class="date-text">
|
||||
<text class="label">结束日期</text>
|
||||
<text class="value">{{end}}</text>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 订单列表 -->
|
||||
<view class="orders-content">
|
||||
<view v-if="orderList.length > 0" class="orders-list">
|
||||
<view v-for="order in orderList"
|
||||
@click="Service.GoPage('/pages/goods/storeOrderInfo?orderId='+order.orderId)" :key="order.orderId"
|
||||
class="order-card">
|
||||
<!-- 店铺信息 -->
|
||||
<view class="order-header">
|
||||
<image class="shop-avatar" :src="Service.GetMateUrlByImg(order.headImg)" mode="aspectFill" />
|
||||
<view class="shop-info">
|
||||
<text class="shop-name">{{ order.nick }}</text>
|
||||
<text class="order-time">{{ Service.formatDate(order.payTime,1) }}</text>
|
||||
</view>
|
||||
<!-- <view class="order-status status-completed">
|
||||
<text class="status-text">已完成</text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 订单详情 -->
|
||||
<view class="order-details">
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">订单总金额</text>
|
||||
<text class="detail-value amount">¥{{ Number(order.amount).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">结算到账</text>
|
||||
<text class="detail-value used-points">¥{{ Number(order.okAmount).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">余额到账</text>
|
||||
<text class="detail-value points-text">¥{{ Number(order.okIntegral).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="detail-row">
|
||||
<text class="detail-label">实际到账</text>
|
||||
<text
|
||||
class="detail-value coupon-text" style="color: #000; font-weight: bold;" >¥{{ Number(order.okIntegral+order.okAmount).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空状态 -->
|
||||
<view v-if="orderList.length === 0" class="empty-state">
|
||||
<text class="ri-file-list-line empty-icon"></text>
|
||||
<text class="empty-text">暂无订单</text>
|
||||
</view>
|
||||
<up-loadmore v-else :status="status" />
|
||||
</view>
|
||||
|
||||
<up-calendar :show="showDate" closeOnClickOverlay='true' :mode="mode" monthNum='5' minDate='2025-12-01'
|
||||
maxDate='2999-12-31' @close="showDate=false" @confirm="confirmDate"></up-calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import { Service } from '@/Service/Service'
|
||||
import { vpMerchService } from '@/Service/vp/vpMerchService'
|
||||
|
||||
|
||||
|
||||
// 当前Tab
|
||||
const currentTab = ref(0)
|
||||
|
||||
|
||||
const begin = ref<string>(Service.formatDate(new Date(), 2))
|
||||
const end = ref<string>(Service.formatDate(new Date(), 2))
|
||||
|
||||
// Tab 配置
|
||||
const tabs = [{
|
||||
label: '全部',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '今日',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '本月',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '自定义',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
|
||||
// 日历管理
|
||||
const showDate = ref(false);
|
||||
const mode = ref('range');
|
||||
let time = ref('')
|
||||
let page = ref(1)
|
||||
let status = ref('nomore')
|
||||
|
||||
let allAmount = ref('')
|
||||
let average = ref('')
|
||||
let orderTotal = ref('')
|
||||
let orderList = ref<Array<any>>([])
|
||||
|
||||
|
||||
|
||||
let type = ref(null)
|
||||
onLoad(() => {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '订单列表'
|
||||
})
|
||||
getData()
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
getList()
|
||||
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
status.value = 'Loadmore'
|
||||
page.value = 1
|
||||
orderList.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
|
||||
if (status.value == 'loading' || status.value == 'nomore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
vpMerchService.GetMerchOrderList(begin.value + '_' + end.value, page.value).then(res => {
|
||||
if (res.code == 0) {
|
||||
allAmount.value = res.data.allAmount
|
||||
average.value = res.data.average
|
||||
orderTotal.value = res.data.orderTotal.value
|
||||
orderList.value = [...orderList.value, ...res.data.orderList]
|
||||
status.value = res.data.orderList.length == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 切换Tab
|
||||
const switchTab = (index : any) => {
|
||||
if (index == 3) {
|
||||
showDate.value = true
|
||||
return
|
||||
}
|
||||
currentTab.value = index
|
||||
getData()
|
||||
}
|
||||
|
||||
const changetab = (e : number) => {
|
||||
if (e == 3) {
|
||||
showDate.value = true
|
||||
return
|
||||
}
|
||||
currentTab.value = e
|
||||
getData()
|
||||
}
|
||||
|
||||
const confirmDate = (e : any) => {
|
||||
currentTab.value = 3
|
||||
time.value = e[0] + '_' + e[e.length - 1]
|
||||
getData()
|
||||
showDate.value = false
|
||||
};
|
||||
|
||||
|
||||
const changeTime = () => {
|
||||
|
||||
getData()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
// .active{
|
||||
// background-color: #F3F4F6;
|
||||
// color: #4B5563;
|
||||
// }
|
||||
// .actived{
|
||||
// background-color: #FF6B35;
|
||||
// color: #fff;
|
||||
// }
|
||||
|
||||
// 开始结束时间
|
||||
|
||||
|
||||
|
||||
/* 订单内容区域 */
|
||||
.orders-content {
|
||||
padding: 20rpx;
|
||||
padding-top: 24rpx;
|
||||
}
|
||||
|
||||
/* 订单列表 */
|
||||
.orders-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* 订单头部 */
|
||||
.order-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
|
||||
.shop-avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-right: 16rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.order-time {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.order-status {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.order-status.status-completed {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.order-status.status-pending {
|
||||
background: #FFF4E6;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.order-status.status-refunding {
|
||||
background: #E3F2FD;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.order-status.status-refunded {
|
||||
background: #FFEBEE;
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
/* 订单详情 */
|
||||
.order-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
font-size: 26rpx;
|
||||
color: #222222;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.detail-value.amount {
|
||||
font-size: 32rpx;
|
||||
color: #FF6B00;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.detail-value.points-text {
|
||||
color: #4CAF50;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.detail-value.used-points {
|
||||
color: #F44336;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.detail-value.coupon-text {
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.detail-value.order-no {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty-state {
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
padding: 120rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 96rpx;
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
|
||||
.date-filter {
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
|
||||
.date-picker {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
|
||||
.date-text {
|
||||
.label {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.value {
|
||||
display: block;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-top: 4rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* Tab 切换栏 */
|
||||
.tab-bar {
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24rpx 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #FF6B00;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab-indicator {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 40rpx;
|
||||
height: 4rpx;
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
/* 统计卡片 */
|
||||
.stats-section {
|
||||
padding: 20rpx 20rpx 10rpx;
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
box-shadow: 0 4rpx 16rpx rgba(255, 107, 0, 0.3);
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
height: 60rpx;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,477 @@
|
||||
<template>
|
||||
<view>
|
||||
<view :style="{'height':topHeight+'rpx'}"
|
||||
style=" position: fixed; top: 0; z-index: 2; width: 100%; background-color: #fff; ">
|
||||
<view class="" :style="{'margin-top':top+'rpx','height':height+'rpx','line-height':height+'rpx'}"
|
||||
style=" margin-left: 40rpx; display: flex; align-items: center;">
|
||||
<img :src="Service.GetIconImg('/static/index/index/location.png')" style="width: 40rpx; height: 40rpx;"
|
||||
alt="" />
|
||||
<text style="margin-left: 15rpx; font-size: 26rpx; font-weight: 600; ">{{address}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin: 40rpx 20rpx;" :style="{marginTop:topHeight+20+'rpx'}">
|
||||
<up-swiper imgMode='heightFix' :list="swiperList" height='140' @change="e => current = e.current"
|
||||
:autoplay="false">
|
||||
<template #indicator>
|
||||
<view class="indicator">
|
||||
<view class="indicator__dot" v-for="(item, index) in swiperList" :key="index"
|
||||
:class="[index === current && 'indicator__dot--active']">
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</up-swiper>
|
||||
</view>
|
||||
|
||||
<view class=""
|
||||
style=" display: flex; align-items: center; justify-content: space-around; margin: 20rpx 0; background-color: #fff; padding: 20rpx">
|
||||
|
||||
<up-scroll-list>
|
||||
<view v-for="(item, index) in tabList" @click="chooseTab(index)"
|
||||
style="display: flex; flex-direction: column; align-items: center; justify-content: center;"
|
||||
:key="index">
|
||||
<!-- <view class="" :class="{tabimgActive:index==tabCurrent,tabimg: index!=tabCurrent }"
|
||||
style=" border-radius: 50%; display: flex; align-items: center; justify-content: center; height: 80rpx; width: 80rpx; ">
|
||||
<img :src="Service.GetIconImg( index==tabCurrent? item.imged:item.img)"
|
||||
style="width: 45rpx; height: 45rpx; "></img>
|
||||
</view>
|
||||
<view :class="{tabActivefont:index==tabCurrent,tabfont:index!=tabCurrent}"
|
||||
style="font-size: 26rpx; margin-top: 15rpx;" class="">
|
||||
{{item.name}}
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
</up-scroll-list>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="" style="background-color: #fff; padding: 20rpx; ">
|
||||
<view class=""
|
||||
style=" display: grid; grid-template-columns: repeat(2,1fr); gap: 20rpx; margin-top: 40rpx; ">
|
||||
<view class="">
|
||||
<view @click="Service.GoPage('/pages/community/merchantDetail?merchId='+leftItem.merchId)"
|
||||
v-for="(leftItem,Leftindex) in leftGoodsList"
|
||||
style="margin-bottom: 20rpx; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #E2e2e2; "
|
||||
:key="Leftindex" class="">
|
||||
<view class="" style="position: relative;">
|
||||
<image :src="Service.GetMateUrlByImg(leftItem.showImg)"
|
||||
style="border-top-right-radius: 20rpx; border-top-left-radius: 20rpx; width: 100%; "
|
||||
mode="widthFix" alt="" />
|
||||
<view class="tag"
|
||||
style=" font-size: 20rpx; padding: 6rpx 12rpx; border-top-right-radius: 20rpx; position: absolute; bottom: 8rpx; left: 0; background-color: #F97316; color: #fff; ">
|
||||
{{cancleDistance(leftItem.distance)}}
|
||||
</view>
|
||||
<view class="tag"
|
||||
style=" font-size: 20rpx; border-radius: 20rpx; padding: 8rpx 16rpx; position: absolute; top: 12rpx; right: 20rpx; background-color: #F97316; color: #fff; ">
|
||||
{{leftItem.tips.split(',')[0]}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="padding: 20rpx;">
|
||||
<view class="" style="font-size: 32rpx; font-weight: 600; ">
|
||||
{{leftItem.name}}
|
||||
</view>
|
||||
<view class=""
|
||||
style=" margin: 15rpx 0; display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="" style="display: flex; align-items: center;">
|
||||
<up-rate count="1" activeColor='#FACC15' size='16' :readonly='true'></up-rate>
|
||||
<text
|
||||
style="color: #666666; font-size: 26rpx; font-weight: 600; ">{{leftItem.score.toFixed(1)}}</text>
|
||||
</view>
|
||||
<view class="" style="font-weight: 600; color: #FF6B35; font-size: 28rpx; ">
|
||||
¥{{leftItem.price}}/人
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if='leftItem.tag' style="display: flex;align-items: center;">
|
||||
<view class="tag" v-for="(tagItem,tagIndex) in leftItem.tag.split(',') " :key="tagIndex"
|
||||
style=" padding: 10rpx 20rpx; border-radius: 25rpx; margin-right: 15rpx; background-color: #F3F4F6; color: #4B5563; ">
|
||||
{{tagItem}}
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="">
|
||||
<view @click="Service.GoPage('/pages/community/merchantDetail?merchId='+rightItem.merchId)"
|
||||
v-for="(rightItem,rightIndex) in rightGoodsList" :key="rightIndex"
|
||||
style="margin-bottom: 20rpx; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #E2e2e2; "
|
||||
class="">
|
||||
<view class="" style="position: relative;">
|
||||
<image :src="Service.GetMateUrlByImg(rightItem.showImg)"
|
||||
style="border-top-right-radius: 20rpx; border-top-left-radius: 20rpx; width: 100%; "
|
||||
mode="widthFix" alt="" />
|
||||
<view class="tag"
|
||||
style=" font-size: 20rpx; padding: 6rpx 12rpx; border-top-right-radius: 20rpx; position: absolute; bottom: 8rpx; left: 0; background-color: #F97316; color: #fff; ">
|
||||
{{cancleDistance(rightItem.distance)}}
|
||||
</view>
|
||||
<view class="tag"
|
||||
style=" font-size: 20rpx; border-radius: 20rpx; padding: 8rpx 16rpx; position: absolute; top: 12rpx; right: 20rpx; background-color: #F97316; color: #fff; ">
|
||||
{{rightItem.tips.split(',')[0]}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="padding: 20rpx;">
|
||||
<view class="" style="font-size: 32rpx; font-weight: 600; ">
|
||||
{{rightItem.name}}
|
||||
</view>
|
||||
<view class=""
|
||||
style=" margin: 15rpx 0; display: flex; align-items: center; justify-content: space-between;">
|
||||
<view class="" style="display: flex; align-items: center;">
|
||||
<up-rate count="1" activeColor='#FACC15' size='16' :readonly='true'></up-rate>
|
||||
<text
|
||||
style="color: #666666; font-size: 26rpx; font-weight: 600; ">{{rightItem.score.toFixed(1)}}</text>
|
||||
</view>
|
||||
<view class="" style="font-weight: 600; color: #FF6B35; font-size: 28rpx; ">
|
||||
¥{{rightItem.price}}/人
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if='rightItem.tag' style="display: flex;align-items: center;">
|
||||
<view class="tag" v-for="(tagItem,tagIndex) in rightItem.tag.split(',') "
|
||||
:key="tagIndex"
|
||||
style=" padding: 10rpx 20rpx; border-radius: 25rpx; margin-right: 15rpx; background-color: #F3F4F6; color: #4B5563; ">
|
||||
{{tagItem}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { onShow, onLoad, onShareAppMessage, onShareTimeline, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { Service } from "@/Service/Service"
|
||||
import { vpLoginService } from '@/Service/vp/vpLoginService'
|
||||
import { vpHomeService } from '@/Service/vp/vpHomeService'
|
||||
|
||||
|
||||
interface tab{
|
||||
name:string
|
||||
icon:string
|
||||
assortId:string
|
||||
}
|
||||
|
||||
|
||||
interface Goods {
|
||||
showImg : string
|
||||
distance : number
|
||||
tips : string
|
||||
price : number
|
||||
name : string
|
||||
score : number
|
||||
tag : string
|
||||
merchId : string
|
||||
}
|
||||
|
||||
// 导航栏
|
||||
let topHeight = ref()
|
||||
let height = ref()
|
||||
let top = ref()
|
||||
|
||||
let status = ref('nomore')
|
||||
let current = ref(0)
|
||||
let swiperList = ref([])
|
||||
|
||||
let address = ref('许昌市魏都区')
|
||||
|
||||
let tabCurrent = ref(0)
|
||||
// let tabList = ref(
|
||||
// [
|
||||
// {
|
||||
// name: '美食',
|
||||
// img: '/static/index/index/food.png',
|
||||
// imged: '/static/index/index/fooded.png'
|
||||
// },
|
||||
// {
|
||||
// name: '饮品',
|
||||
// img: '/static/index/index/cofe.png',
|
||||
// imged: '/static/index/index/cofed.png'
|
||||
// },
|
||||
// {
|
||||
// name: '超市',
|
||||
// img: '/static/index/index/shop.png',
|
||||
// imged: '/static/index/index/shoped.png'
|
||||
// },
|
||||
// {
|
||||
// name: '美妆',
|
||||
// img: '/static/index/index/good.png',
|
||||
// imged: '/static/index/index/gooded.png'
|
||||
// },
|
||||
// {
|
||||
// name: '医疗',
|
||||
// img: '/static/index/index/medical.png',
|
||||
// imged: '/static/index/index/medicaled.png'
|
||||
// }
|
||||
// ]
|
||||
// )
|
||||
|
||||
let tabList = ref([])
|
||||
|
||||
|
||||
let leftGoodsList = ref<Array<Goods>>([
|
||||
{
|
||||
showImg: '',
|
||||
tips: '',
|
||||
price: 0,
|
||||
name: '',
|
||||
score: 0,
|
||||
tag: '',
|
||||
distance: 0,
|
||||
merchId: ''
|
||||
}
|
||||
])
|
||||
|
||||
let rightGoodsList = ref<Array<Goods>>([
|
||||
{
|
||||
showImg: '',
|
||||
tips: '',
|
||||
price: 0,
|
||||
name: '',
|
||||
score: 0,
|
||||
tag: '',
|
||||
distance: 0,
|
||||
merchId: ''
|
||||
}
|
||||
])
|
||||
let assId = ref('')
|
||||
let comId = ref('')
|
||||
let page = ref(1)
|
||||
|
||||
let longitude = ref()
|
||||
let latitude = ref()
|
||||
|
||||
|
||||
onShow(() => {
|
||||
|
||||
})
|
||||
onLoad(() => {
|
||||
let res = wx.getMenuButtonBoundingClientRect()
|
||||
topHeight.value = (res.top + res.height + 5) * 2
|
||||
height.value = res.height * 2
|
||||
top.value = res.top * 2
|
||||
getLocation()
|
||||
login()
|
||||
})
|
||||
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
// 分享
|
||||
onShareAppMessage((res) => {
|
||||
return {
|
||||
path: '/pages/index/index'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
onShareTimeline(() => {
|
||||
return {
|
||||
path: '/pages/index/index'
|
||||
}
|
||||
})
|
||||
|
||||
const getLocation = () => {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function (res) {
|
||||
longitude.value = res.longitude
|
||||
latitude.value = res.latitude
|
||||
getdata()
|
||||
},
|
||||
fail: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const getdata = () => {
|
||||
leftGoodsList.value = []
|
||||
rightGoodsList.value = []
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
|
||||
|
||||
if (status.value !== 'loadmore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
|
||||
|
||||
vpHomeService.GetMerchList(assId.value ? assId.value : '', comId.value ? comId.value : '', longitude.value, latitude.value, page.value).then(res => {
|
||||
res.data.banner.map((item : any) => {
|
||||
swiperList.value.push(Service.GetMateUrlByImg(item.img))
|
||||
})
|
||||
|
||||
res.data.merchList.forEach((goodsItem : any, GoodsIndex : number) => {
|
||||
if (GoodsIndex % 2 == 0) {
|
||||
leftGoodsList.value.push(goodsItem)
|
||||
} else {
|
||||
rightGoodsList.value.push(goodsItem)
|
||||
}
|
||||
})
|
||||
tabList.value=res.data.assortList
|
||||
status.value = res.data.merchList.length == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
})
|
||||
}
|
||||
|
||||
const login = () => {
|
||||
uni.login({
|
||||
onlyAuthorize: true,
|
||||
provider: 'weixin',
|
||||
success: function (loginRes) {
|
||||
vpLoginService.GetOpenIdByWeixin(loginRes.code, 1).then(res => {
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const chooseTab = (e) => {
|
||||
tabCurrent.value = e
|
||||
}
|
||||
|
||||
const cancleDistance = (item : any) => {
|
||||
if (item >= 1000) {
|
||||
return (item / 1000).toFixed(1) + 'km'
|
||||
} else {
|
||||
return item + 'm'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
@include flex(row);
|
||||
justify-content: center;
|
||||
|
||||
&__dot {
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
border-radius: 100px;
|
||||
background-color: rgba(255, 255, 255, 0.35);
|
||||
margin: 0 5px;
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&--active {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabimgActive {
|
||||
background-color: var(--nav-mian);
|
||||
}
|
||||
|
||||
.tabimg {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
|
||||
.tabActivefont {
|
||||
color: var(--nav-mian);
|
||||
}
|
||||
|
||||
.tabfont {
|
||||
color: #333333
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
// 瀑布流
|
||||
.demo-warter {
|
||||
border-radius: 8px;
|
||||
margin: 5px;
|
||||
background-color: #ffffff;
|
||||
padding: 8px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.u-close {
|
||||
position: absolute;
|
||||
top: 32rpx;
|
||||
right: 32rpx;
|
||||
}
|
||||
|
||||
.demo-image {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.demo-title {
|
||||
font-size: 30rpx;
|
||||
margin-top: 5px;
|
||||
|
||||
}
|
||||
|
||||
.demo-tag {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.demo-tag-owner {
|
||||
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 20rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.demo-tag-text {
|
||||
|
||||
|
||||
margin-left: 10px;
|
||||
border-radius: 50rpx;
|
||||
line-height: 1;
|
||||
padding: 4rpx 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 50rpx;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.demo-price {
|
||||
font-size: 30rpx;
|
||||
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.demo-shop {
|
||||
font-size: 22rpx;
|
||||
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user