王文杰 10 months ago
parent 527ad3e2f7
commit 69699451c2

@ -6,7 +6,7 @@ set -e
# 1. 先提交 master
git push git@github.com:erabbit-dev/erabbit-uni-app.git master:master
git push git@github.com:xxx.git master:master
# 2. 打包生成静态文件
# npm run build:h5
@ -27,6 +27,6 @@ git commit -m 'deploy: gh-pages'
# 如果发布到 https://<USERNAME>.github.io/<REPO>
# git push -f git@gitee.com:<USERNAME>/<REPO>.git master:gh-pages
git push -f git@github.com:erabbit-dev/erabbit-uni-app.git master:gh-pages
git push -f git@github.com:xxx.git master:gh-pages
cd -

@ -17,16 +17,16 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
# 注意替换为你的 GitHub 源仓库地址
source-repo: git@github.com:erabbit-dev/erabbit-uni-app.git
source-repo: git@github.com:xxx.git
# 注意替换为你的 Gitee 目标仓库地址
destination-repo: git@gitee.com:Megasu/uniapp-shop-vue3-ts.git
destination-repo: git@gitee.com:xxx.git
# dry-run: true
- name: Build Gitee Pages
uses: yanglbme/gitee-pages-action@main
with:
# 注意替换为你的 Gitee 用户名
gitee-username: megasu@qq.com
gitee-username: xxx
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
gitee-password: ${{ secrets.GITEE_PASSWORD }}
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错

@ -45,6 +45,12 @@
"navigationBarTitleText": "商品分类"
}
},
{
"path": "pages/orerdList/orerdList",
"style": {
"navigationBarTitleText": "订单列表"
}
},
{
"path": "pages/cart/cart",
"style": {
@ -121,12 +127,12 @@
"iconPath": "static/tabs/cart_default.png",
"selectedIconPath": "static/tabs/cart_selected.png"
},
// {
// "text": "积分商城",
// "pagePath": "pages/cart/cart",
// "iconPath": "static/tabs/cart_default.png",
// "selectedIconPath": "static/tabs/cart_selected.png"
// },
{
"text": "订单",
"pagePath": "pages/orerdList/orerdList",
"iconPath": "static/tabs/cart_default.png",
"selectedIconPath": "static/tabs/cart_selected.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",

@ -69,10 +69,10 @@ const weightMenuList = [
},
]
const handleMenuChange = val => {
const handleMenuChange = (val) => {
activeMenuKey.value = val
}
const handleWeightChange = val => {
const handleWeightChange = (val) => {
activeWeightKey.value = val
}
const handleToto = () => {
@ -89,26 +89,42 @@ onMounted(() => {})
<view class="module lei">
<view class="module-title">回收品类</view>
<view class="module-menu">
<view class="item" @tab="handleMenuChange(index)" :class="{'active': activeMenuKey == index}" v-for="(item, index) in leiList" :key="item.id">{{item.name}}</view>
<view
class="item"
@click="handleMenuChange(index)"
:class="{ active: activeMenuKey == index }"
v-for="(item, index) in leiList"
:key="item.id"
>{{ item.name }}</view
>
</view>
</view>
<view class="module info">
<view class="module-title">取件信息</view>
<view class="list">
<view class="list">
<button hover-class="none" class="item arrow">取件时间</button>
<button hover-class="none" class="item arrow">取件地址</button>
</view>
<view class="weight">
<view class="weight-title">请选择预估重量<span class="desc">预估仅供参考以实际重量为准</span></view>
<view class="weight-title"
>请选择预估重量<span class="desc">预估仅供参考以实际重量为准</span></view
>
<view class="weight-menu">
<view class="item" @tab="handleWeightChange(index)" :class="{'active': activeWeightKey == index}" v-for="(item,index) in weightMenuList" :key="item.id">{{item.name}}</view>
<view
class="item"
@click="handleWeightChange(index)"
:class="{ active: activeWeightKey == index }"
v-for="(item, index) in weightMenuList"
:key="item.id"
>{{ item.name }}</view
>
</view>
</view>
</view>
<view class="submit" @click="handleToto"></view>
<!-- 底部占位空盒子 -->
<view class="toolbar-height" safe-area-inset-bottom ></view>
<view class="toolbar-height" safe-area-inset-bottom></view>
</view>
</template>

@ -44,7 +44,7 @@ onShow(() => {
const onDeleteCart = (skuId: string) => {
//
uni.showModal({
content: '是否删除',
content: "是否删除",
confirmColor: '#27BA9B',
success: async (res) => {
if (res.confirm) {

@ -2,21 +2,43 @@
<view class="sk-container">
<view class="viewport viewport">
<view is="pages/index/components/CustomNavbar">
<view class="navbar CustomNavbar--navbar data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2" style="padding-top:30px">
<view
class="navbar CustomNavbar--navbar data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2"
style="padding-top: 30px"
>
<view class="logo CustomNavbar--logo data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2">
<image class="logo-image CustomNavbar--logo-image data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-image"></image>
<image
class="logo-image CustomNavbar--logo-image data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-image"
></image>
</view>
<view class="search CustomNavbar--search data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2">
<text class="icon-search CustomNavbar--icon-search data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-transparent sk-text-14-2857-875 sk-text sk-pseudo sk-pseudo-circle">搜索商品</text>
<text class="icon-scan CustomNavbar--icon-scan data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-pseudo sk-pseudo-circle"></text>
<text
class="icon-search CustomNavbar--icon-search data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-transparent sk-text-14-2857-875 sk-text sk-pseudo sk-pseudo-circle"
>搜索商品</text
>
<text
class="icon-scan CustomNavbar--icon-scan data-v-ff0d84a2 CustomNavbar--data-v-ff0d84a2 sk-pseudo sk-pseudo-circle"
></text>
</view>
</view>
</view>
<scroll-view enable-back-to-top="true" refresher-enabled="true" scroll-y="true" class="scroll-view scroll-view">
<scroll-view
enable-back-to-top="true"
refresher-enabled="true"
scroll-y="true"
class="scroll-view scroll-view"
>
<view is="components/XtxSwiper">
<view class="carousel XtxSwiper--carousel">
<swiper circular="true" interval="3000" current="0" autoplay="false">
<swiper-item style="position: absolute; width: 100%; height: 100%; transform: translate(0%, 0px) translateZ(0px);">
<swiper-item
style="
position: absolute;
width: 100%;
height: 100%;
transform: translate(0%, 0px) translateZ(0px);
"
>
<navigator class="navigator XtxSwiper--navigator" hover-class="none">
<image class="image XtxSwiper--image sk-image" mode="aspectFill"></image>
</navigator>
@ -33,12 +55,21 @@
</view>
<view is="pages/index/components/CategoryPanel">
<view class="category CategoryPanel--category">
<view class="module-title CategoryPanel--module-title sk-transparent sk-text-14-2857-989 sk-text"> 预约上门回收 </view>
<view
class="module-title CategoryPanel--module-title sk-transparent sk-text-14-2857-989 sk-text"
>
预约上门回收
</view>
<view class="cont CategoryPanel--cont">
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-831 sk-text">旧衣服</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-227 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-831 sk-text"
>旧衣服</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-227 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -46,8 +77,13 @@
</navigator>
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-147 sk-text">家用电器</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-444 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-147 sk-text"
>家用电器</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-444 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -55,8 +91,13 @@
</navigator>
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-139 sk-text">废纸废书</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-520 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-139 sk-text"
>废纸废书</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-520 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -64,8 +105,13 @@
</navigator>
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-471 sk-text">废金属</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-372 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-471 sk-text"
>废金属</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-372 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -73,8 +119,13 @@
</navigator>
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-575 sk-text">废玻璃</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-572 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-575 sk-text"
>废玻璃</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-572 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -82,8 +133,13 @@
</navigator>
<navigator class="category-item CategoryPanel--category-item" hover-class="none">
<view class="left CategoryPanel--left">
<view class="title CategoryPanel--title sk-transparent sk-text-14-2857-961 sk-text">废塑料</view>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-400 sk-text">旧衣服回收不浪费</view>
<view
class="title CategoryPanel--title sk-transparent sk-text-14-2857-961 sk-text"
>废塑料</view
>
<view class="desc CategoryPanel--desc sk-transparent sk-text-14-2857-400 sk-text"
>旧衣服回收不浪费</view
>
</view>
<view class="right CategoryPanel--right">
<image class="icon CategoryPanel--icon sk-image"></image>
@ -93,9 +149,17 @@
</view>
</view>
<view is="pages/index/components/PhoneContact">
<view class="phone-contact PhoneContact--phone-contact data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4">
<view class="module-title PhoneContact--module-title data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4 sk-transparent sk-text-14-2857-52 sk-text">电话预约回收</view>
<view class="module-action PhoneContact--module-action data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4 sk-transparent sk-text-14-2857-16 sk-text">400-123-000</view>
<view
class="phone-contact PhoneContact--phone-contact data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4"
>
<view
class="module-title PhoneContact--module-title data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4 sk-transparent sk-text-14-2857-52 sk-text"
>电话预约回收</view
>
<view
class="module-action PhoneContact--module-action data-v-47ea6ab4 PhoneContact--data-v-47ea6ab4 sk-transparent sk-text-14-2857-16 sk-text"
>400-123-000</view
>
</view>
</view>
</scroll-view>

@ -143,7 +143,7 @@ const onRefresherrefresh = async () => {
<!-- 热门推荐 -->
<!-- <HotPanel :list="hotList" /> -->
<!-- 猜你喜欢 -->
<XtxGuess ref="guessRef" />
<!-- <XtxGuess ref="guessRef" /> -->
</template>
</scroll-view>
</view>

@ -1,4 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useGuessList } from '@/composables'
import { useMemberStore } from '@/stores'
//
@ -83,9 +84,9 @@ const { guessRef, onScrolltolower } = useGuessList()
</view>
</view>
<!-- 猜你喜欢 -->
<view class="guess">
<!-- <view class="guess">
<XtxGuess ref="guessRef" />
</view>
</view> -->
</scroll-view>
</template>

@ -0,0 +1,388 @@
<script setup lang="ts">
import { OrderState } from '@/services/constants'
import { orderStateList } from '@/services/constants'
import { putMemberOrderReceiptByIdAPI } from '@/services/order'
import { deleteMemberOrderAPI } from '@/services/order'
import { getMemberOrderAPI } from '@/services/order'
import { getPayMockAPI, getPayWxPayMiniPayAPI } from '@/services/pay'
import type { OrderItem } from '@/types/order'
import type { OrderListParams } from '@/types/order'
import { onMounted, ref } from 'vue'
//
const { safeAreaInsets } = uni.getSystemInfoSync()
// porps
const props = defineProps<{
orderState: number
}>()
//
const queryParams: Required<OrderListParams> = {
page: 1,
pageSize: 5,
orderState: props.orderState,
}
//
const orderList = ref<OrderItem[]>([])
//
const isLoading = ref(false)
const getMemberOrderData = async () => {
// 退
if (isLoading.value) return
// 退
if (isFinish.value === true) {
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
}
//
isLoading.value = true
//
const res = await getMemberOrderAPI(queryParams)
//
isLoading.value = false
//
orderList.value.push(...res.result.items)
//
if (queryParams.page < res.result.pages) {
//
queryParams.page++
} else {
//
isFinish.value = true
}
}
onMounted(() => {
getMemberOrderData()
})
//
const onOrderPay = async (id: string) => {
if (import.meta.env.DEV) {
//
await getPayMockAPI({ orderId: id })
} else {
// #ifdef MP-WEIXIN
// 1.2.API
// const res = await getPayWxPayMiniPayAPI({ orderId: id })
// await wx.requestPayment(res.result)
// 线 0.01
await getPayMockAPI({ orderId: id })
// #endif
}
//
uni.showToast({ title: '模拟支付成功' })
//
setTimeout(() => {
wx.showModal({
title: '温馨提示',
content: '此交易是模拟支付,您并未付款,不会导致实际购买商品或服务',
confirmText: '知道了',
showCancel: false,
})
}, 2000)
//
const order = orderList.value.find((v) => v.id === id)
order!.orderState = OrderState.DaiFaHuo
}
//
const onOrderConfirm = (id: string) => {
uni.showModal({
content: '为保障您的权益,请收到货并确认无误后,再确认收货',
confirmColor: '#27BA9B',
success: async (res) => {
if (res.confirm) {
await putMemberOrderReceiptByIdAPI(id)
uni.showToast({ icon: 'success', title: '确认收货成功' })
//
const order = orderList.value.find((v) => v.id === id)
order!.orderState = OrderState.DaiPingJia
}
},
})
}
//
const onOrderDelete = (id: string) => {
uni.showModal({
content: '你确定要删除该订单?',
confirmColor: '#27BA9B',
success: async (res) => {
if (res.confirm) {
await deleteMemberOrderAPI({ ids: [id] })
//
const index = orderList.value.findIndex((v) => v.id === id)
orderList.value.splice(index, 1)
}
},
})
}
//
const isFinish = ref(false)
//
const isTriggered = ref(false)
//
const onRefresherrefresh = async () => {
//
isTriggered.value = true
//
queryParams.page = 1
orderList.value = []
isFinish.value = false
//
await getMemberOrderData()
//
isTriggered.value = false
}
</script>
<template>
<scroll-view
enable-back-to-top
scroll-y
class="orders"
refresher-enabled
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getMemberOrderData"
>
<view class="card" v-for="order in orderList" :key="order.id">
<!-- 订单信息 -->
<view class="status">
<text class="date">{{ order.createTime }}</text>
<!-- 订单状态文字 -->
<text>{{ orderStateList[order.orderState].text }}</text>
<!-- 待评价/已完成/已取消 状态: 展示删除订单 -->
<text
v-if="order.orderState >= OrderState.DaiPingJia"
class="icon-delete"
@tap="onOrderDelete(order.id)"
></text>
</view>
<!-- 商品信息点击商品跳转到订单详情不是商品详情 -->
<navigator
v-for="item in order.skus"
:key="item.id"
class="goods"
:url="`/pagesOrder/detail/detail?id=${order.id}`"
hover-class="none"
>
<view class="cover">
<image class="image" mode="aspectFit" :src="item.image"></image>
</view>
<view class="meta">
<view class="name ellipsis">{{ item.name }}</view>
<view class="type">{{ item.attrsText }}</view>
</view>
</navigator>
<!-- 支付信息 -->
<view class="payment">
<text class="quantity">{{ order.totalNum }}件商品</text>
<text>实付</text>
<text class="amount"> <text class="symbol">¥</text>{{ order.payMoney }}</text>
</view>
<!-- 订单操作按钮 -->
<view class="action">
<!-- 待付款状态显示去支付按钮 -->
<template v-if="order.orderState === OrderState.DaiFuKuan">
<view class="button primary" @tap="onOrderPay(order.id)"></view>
</template>
<template v-else>
<navigator
class="button secondary"
:url="`/pagesOrder/create/create?orderId=${order.id}`"
hover-class="none"
>
再次购买
</navigator>
<!-- 待收货状态: 展示确认收货 -->
<view
v-if="order.orderState === OrderState.DaiShouHuo"
class="button primary"
@tap="onOrderConfirm(order.id)"
>
确认收货
</view>
</template>
</view>
</view>
<!-- 底部提示文字 -->
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
</view>
</scroll-view>
</template>
<style lang="scss">
//
.orders {
.card {
min-height: 100rpx;
padding: 20rpx;
margin: 20rpx 20rpx 0;
border-radius: 10rpx;
background-color: #fff;
&:last-child {
padding-bottom: 40rpx;
}
}
.status {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #999;
margin-bottom: 15rpx;
.date {
color: #666;
flex: 1;
}
.primary {
color: #ff9240;
}
.icon-delete {
line-height: 1;
margin-left: 10rpx;
padding-left: 10rpx;
border-left: 1rpx solid #e3e3e3;
}
}
.goods {
display: flex;
margin-bottom: 20rpx;
.cover {
width: 170rpx;
height: 170rpx;
margin-right: 20rpx;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 170rpx;
height: 170rpx;
}
}
.quantity {
position: absolute;
bottom: 0;
right: 0;
line-height: 1;
padding: 6rpx 4rpx 6rpx 8rpx;
font-size: 24rpx;
color: #fff;
border-radius: 10rpx 0 0 0;
background-color: rgba(0, 0, 0, 0.6);
}
.meta {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.name {
height: 80rpx;
font-size: 26rpx;
color: #444;
}
.type {
line-height: 1.8;
padding: 0 15rpx;
margin-top: 10rpx;
font-size: 24rpx;
align-self: flex-start;
border-radius: 4rpx;
color: #888;
background-color: #f7f7f8;
}
.more {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #333;
}
}
.payment {
display: flex;
justify-content: flex-end;
align-items: center;
line-height: 1;
padding: 20rpx 0;
text-align: right;
color: #999;
font-size: 28rpx;
border-bottom: 1rpx solid #eee;
.quantity {
font-size: 24rpx;
margin-right: 16rpx;
}
.amount {
color: #444;
margin-left: 6rpx;
}
.symbol {
font-size: 20rpx;
}
}
.action {
display: flex;
justify-content: flex-end;
align-items: center;
padding-top: 20rpx;
.button {
width: 180rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 20rpx;
border-radius: 60rpx;
border: 1rpx solid #ccc;
font-size: 26rpx;
color: #444;
}
.secondary {
color: #27ba9b;
border-color: #27ba9b;
}
.primary {
color: #fff;
background-color: #27ba9b;
border-color: #27ba9b;
}
}
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
}
</style>

@ -0,0 +1,105 @@
<script setup lang="ts">
import { ref } from 'vue'
import OrderList from './components/OrderList.vue'
//
const query = defineProps<{
type: string
}>()
// tabs
const orderTabs = ref([
{ orderState: 0, title: '全部', isRender: false },
{ orderState: 1, title: '待接单', isRender: false },
{ orderState: 2, title: '待回收', isRender: false },
{ orderState: 3, title: '已完成', isRender: false },
{ orderState: 4, title: '已取消', isRender: false },
])
//
const activeIndex = ref(orderTabs.value.findIndex((v) => v.orderState === Number(query.type)))
//
orderTabs.value[activeIndex.value].isRender = true
</script>
<template>
<view class="viewport">
<!-- tabs -->
<view class="tabs">
<text
class="item"
v-for="(item, index) in orderTabs"
:key="item.title"
@tap="
() => {
activeIndex = index
item.isRender = true
}
"
>
{{ item.title }}
</text>
<!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex * 20 + '%' }"></view>
</view>
<!-- 滑动容器 -->
<swiper class="swiper" :current="activeIndex" @change="activeIndex = $event.detail.current">
<!-- 滑动项 -->
<swiper-item v-for="item in orderTabs" :key="item.title">
<!-- 订单列表 -->
<OrderList v-if="item.isRender" :order-state="item.orderState" />
</swiper-item>
</swiper>
</view>
</template>
<style lang="scss">
page {
height: 100%;
overflow: hidden;
}
.viewport {
height: 100%;
display: flex;
flex-direction: column;
background-color: #fff;
}
// tabs
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
margin: 0 10rpx;
background-color: #fff;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
position: relative;
z-index: 9;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #262626;
}
.cursor {
position: absolute;
left: 0;
bottom: 0;
width: 20%;
height: 6rpx;
padding: 0 50rpx;
background-color: #5386e4;
/* 过渡效果 */
transition: all 0.4s;
}
}
// swiper
.swiper {
background-color: #f7f7f8;
}
</style>

@ -112,7 +112,7 @@ const onRefresherrefresh = async () => {
//
isTriggered.value = false
}
const handleMenuChange = val => {
const handleMenuChange = (val) => {
activeMenuKey.value = val
getDataList()
}
@ -123,26 +123,28 @@ onMounted(() => {
<template>
<view class="service-site">
<view class="menu-list">
<view class="item"
<view
class="item"
@tap="handleMenuChange(index)"
:class="{'active': activeMenuKey == index}"
v-for="(item,index) in menuList"
:key="item.id">{{item.name}} >
:class="{ active: activeMenuKey == index }"
v-for="(item, index) in menuList"
:key="item.id"
>{{ item.name }} >
</view>
</view>
<scroll-view
<scroll-view
enable-back-to-top
scroll-y
class="scroll-view"
:refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh"
@scrolltolower="getDataListList">
<siteItem class="item" v-for="item in dataList" :key="item.id" />
</scroll-view>
@scrolltolower="getDataListList"
>
<siteItem class="item" v-for="item in dataList" :key="item.id" />
</scroll-view>
</view>
<!-- 底部占位空盒子 -->
<view class="toolbar-height" safe-area-inset-bottom ></view>
<!-- 底部占位空盒子 -->
<view class="toolbar-height" safe-area-inset-bottom></view>
</template>
<style lang="scss">

@ -1,4 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue'
const bannerList = [
{
hrefUrl: '1005000',
@ -37,28 +38,57 @@ const leiList = [
name: '废塑料',
},
]
const rateValue = ref(2)
</script>
<template>
<view class="site-detail">
<XtxSwiper :list="bannerList" />
<view class="cont">
<view class="info">
<view class="hd">
<view class="name">上海松江区佘山镇</view>
<view class="num">1.03km</view>
</view>
<view class="md">
<view class="label">营业时间</view>
<view class="time">09:00 - 18:00</view>
</view>
<view class="fd">
<view class="label">地址上海市松江区新松江路92弄开元地中海园区</view>
<view class="img"></view>
<view class="info">
<view class="hd">
<view class="name">上海松江区佘山镇</view>
<view class="num">1.03km</view>
</view>
<view class="md">
<view class="label">营业时间</view>
<view class="time">09:00 - 18:00</view>
</view>
<view class="fd">
<view class="label">地址上海市松江区新松江路92弄开元地中海园区</view>
<view class="img"></view>
</view>
</view>
<view class="module-menu">
<view
class="item"
@tab="handleMenuChange(index)"
:class="{ active: activeMenuKey == index }"
v-for="(item, index) in leiList"
:key="item.id"
>{{ item.name }}</view
>
</view>
<view class="detail-list">
<view class="item arrow flex-row">
<view class="service-title">服务</view>
<view class="tag-list">
<view class="tag">上门服务</view>
<view class="tag">家电维修</view>
<view class="tag">品控质检</view>
</view>
</view>
<view class="module-menu">
<view class="item" @tab="handleMenuChange(index)" :class="{'active': activeMenuKey == index}" v-for="(item, index) in leiList" :key="item.id">{{item.name}}</view>
<view class="item flex-column rate">
<view class="service-title">评分</view>
<uni-rate active-color="#FF7D00" v-model="rateValue" />
</view>
<view class="item flex-column activity">
<view class="activity-title">活动</view>
<view class="activity-list">
<view class="activity-item">会员价</view>
<view class="activity-item">赠送积分</view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -110,6 +140,7 @@ const leiList = [
.module-menu {
display: flex;
padding: 36rpx 0rpx;
box-shadow: 0px 0px 8px 0px rgba(161, 161, 177, 0.12);
.item {
flex: 1;
color: #95969d;
@ -121,8 +152,92 @@ const leiList = [
}
}
}
/* 列表 */
.detail-list {
padding: 0 20rpx;
background-color: #fff;
margin-bottom: 20rpx;
border-radius: 10rpx;
.item {
// line-height: 90rpx;
padding-left: 10rpx;
font-size: 30rpx;
color: #333;
border-bottom: 1rpx solid #ddd;
position: relative;
text-align: left;
border-radius: 0;
background-color: #fff;
display: flex;
&::after {
width: auto;
height: auto;
left: auto;
border: none;
}
// &:first-child {
// border: none;
// }
&::after {
right: 5rpx;
}
&.flex-column {
flex-direction: column;
&:first-child {
}
}
&.rate {
line-height: 90rpx;
padding-bottom: 20rpx;
}
&.flex-row {
line-height: 90rpx;
flex-direction: row;
}
.tag-list {
display: flex;
margin-left: 20rpx;
.tag {
color: #95969d;
font-size: 24rpx;
}
}
&.activity {
margin: 20rpx 0;
.activity-list {
display: flex;
.activity-item {
margin: 20rpx 10rpx;
&:first-child {
background: #484540;
padding: 4rpx 6rpx;
border-radius: 10rpx;
color: #ffe6b5;
font-size: 24rpx;
}
&:last-child {
padding: 4rpx 6rpx;
border-radius: 10rpx;
color: #ffb739;
border: 2rpx solid #ffb739;
font-size: 24rpx;
}
}
}
}
}
.arrow::after {
content: '\e6c2';
position: absolute;
top: 50%;
color: #ccc;
font-family: 'erabbit' !important;
font-size: 32rpx;
transform: translateY(-50%);
}
}
}
}
</style>

@ -1,6 +1,6 @@
import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { computed, ref } from 'vue'
export const useAddressStore = defineStore('address', () => {
const selectedAddress = ref<AddressItem>()
@ -9,8 +9,13 @@ export const useAddressStore = defineStore('address', () => {
selectedAddress.value = val
}
const selectedAddressVal = computed(() => {
return selectedAddress.value
})
return {
selectedAddress,
selectedAddressVal,
changeSelectedAddress,
}
})

Loading…
Cancel
Save