第一次上传
This commit is contained in:
@@ -0,0 +1,510 @@
|
||||
<template>
|
||||
<view class="order-detail-page">
|
||||
<view class="detail-container">
|
||||
<!-- 沉浸式状态栏 -->
|
||||
<view class="status-bar"></view>
|
||||
|
||||
<!-- 顶部导航栏 -->
|
||||
<view class="nav-bar">
|
||||
<image class="back-icon" src="/static/icons/back.svg" @click="goBack" mode="aspectFit" />
|
||||
<text class="nav-title">订单详情</text>
|
||||
<view class="nav-placeholder"></view>
|
||||
</view>
|
||||
|
||||
<!-- 店铺信息卡片 -->
|
||||
<view class="shop-info-card" @click="goToShop">
|
||||
<view class="shop-header">
|
||||
<image class="shop-avatar" :src="Service.GetMateUrlByImg(userInfo.headImg)" mode="aspectFill" />
|
||||
<view class="shop-info">
|
||||
<text class="shop-name">{{ userInfo.nick }}</text>
|
||||
<view class="" style="font-size: 26rpx; color: #666; margin-top: 4rpx;">
|
||||
{{ Service.formatDate(orderInfo.payTime,1) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单信息卡片 -->
|
||||
<view class="order-info-card">
|
||||
<view class="card-title">
|
||||
<text class="title-icon">📋</text>
|
||||
<text class="title-text">订单信息</text>
|
||||
</view>
|
||||
|
||||
<view class="info-section">
|
||||
<view class="info-row">
|
||||
<text class="info-label">订单号</text>
|
||||
<text class="info-value">{{ orderInfo.orderId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">支付方式</text>
|
||||
<text class="info-value " style=" color: #000; " >{{ orderInfo.payway=='wx'?'微信':'支付宝' }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">订单总金额</text>
|
||||
<text class="info-value amount ">¥{{Number( orderInfo.amount).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">结算到账</text>
|
||||
<text class="info-value " style="font-weight: bold; color: #FF6B00; " >¥{{ Number(okAmount).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<text class="info-label">余额到账</text>
|
||||
<text class="info-value " style="font-weight: bold; color: #4CAF50; " >¥{{ Number(okIntegral).toFixed(2) }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">实际到账</text>
|
||||
<text class="info-value " style="font-weight: bold; color: #000; " >¥{{ Number(okAmount+okIntegral).toFixed(2) }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<!-- <view v-if="order.statusType === 'completed'" class="bottom-actions">
|
||||
<button class="action-btn secondary" @click="contactService">
|
||||
<text class="ri-customer-service-2-line btn-icon"></text>
|
||||
<text class="btn-text">联系客服</text>
|
||||
</button>
|
||||
<button class="action-btn primary" @click="writeReview">
|
||||
<text class="ri-edit-line btn-icon"></text>
|
||||
<text class="btn-text">评价订单</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<view v-else-if="order.statusType === 'pending'" class="bottom-actions">
|
||||
<button class="action-btn secondary" @click="contactService">
|
||||
<text class="ri-customer-service-2-line btn-icon"></text>
|
||||
<text class="btn-text">联系客服</text>
|
||||
</button>
|
||||
<button class="action-btn primary" @click="writeReview">
|
||||
<text class="ri-star-line btn-icon"></text>
|
||||
<text class="btn-text">评价订单</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<view v-else-if="order.statusType === 'refunding'" class="bottom-actions">
|
||||
<button class="action-btn warning" @click="checkRefundStatus">
|
||||
<text class="ri-time-line btn-icon"></text>
|
||||
<text class="btn-text">查看退款进度</text>
|
||||
</button>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<!-- <view v-else class="loading">
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
vpMerchService,
|
||||
Service
|
||||
} from '@/Service/vp/vpMerchService'
|
||||
|
||||
// 用户信息
|
||||
let userInfo = ref<any>({})
|
||||
|
||||
let merchInfo = ref<any>({})
|
||||
let orderInfo = ref<any>({})
|
||||
let okIntegral=ref('')
|
||||
let okAmount=ref('')
|
||||
let orderId = ref('')
|
||||
// 页面加载
|
||||
onLoad((options) => {
|
||||
if (options.orderId) {
|
||||
orderId.value = options.orderId
|
||||
console.log(options.orderId);
|
||||
getData()
|
||||
}
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
vpMerchService.GetMerchOrderInfo(orderId.value).then(res => {
|
||||
if (res.code == 0) {
|
||||
userInfo.value = res.data.userInfo
|
||||
orderInfo.value = res.data.orderInfo
|
||||
okIntegral.value=res.data.okIntegral
|
||||
okAmount.value=res.data.okAmount
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 跳转到商家详情
|
||||
const goToShop = () => {
|
||||
if (!order.value) return
|
||||
// 使用商家ID跳转,这里使用order.id作为商家ID
|
||||
uni.navigateTo({
|
||||
url: `/pages/shop/shop?id=${order.value.id}`
|
||||
})
|
||||
}
|
||||
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
|
||||
// 联系客服
|
||||
const contactService = () => {
|
||||
uni.showToast({
|
||||
title: '正在联系客服...',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
// 评价订单
|
||||
const writeReview = () => {
|
||||
uni.showToast({
|
||||
title: '跳转到评价页面',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
// 查看退款进度
|
||||
const checkRefundStatus = () => {
|
||||
uni.showToast({
|
||||
title: '退款处理中,请耐心等待',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/* 状态栏 */
|
||||
.status-bar {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 导航栏 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 50rpx 24rpx 20rpx;
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
padding: 8rpx;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.nav-placeholder {
|
||||
width: 48rpx;
|
||||
}
|
||||
|
||||
/* 店铺信息卡片 */
|
||||
.shop-info-card {
|
||||
background: #FFFFFF;
|
||||
margin: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.shop-info-card:active {
|
||||
transform: scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.shop-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.shop-arrow {
|
||||
font-size: 32rpx;
|
||||
color: #CCCCCC;
|
||||
margin-left: auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.shop-avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.order-time {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.order-status-badge {
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.order-status-badge.status-completed {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.order-status-badge.status-pending {
|
||||
background: #FFF4E6;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.order-status-badge.status-refunding {
|
||||
background: #E3F2FD;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.order-status-badge.status-refunded {
|
||||
background: #FFEBEE;
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
/* 订单信息卡片 */
|
||||
.order-info-card {
|
||||
background: #FFFFFF;
|
||||
margin: 0 20rpx 20rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 24rpx;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
}
|
||||
|
||||
.title-icon {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 26rpx;
|
||||
color: #222222;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info-value.amount {
|
||||
font-size: 36rpx;
|
||||
color: #FF6B00;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.status-tag.status-completed {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.status-tag.status-pending {
|
||||
background: #FFF4E6;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.status-tag.status-refunding {
|
||||
background: #E3F2FD;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.status-tag.status-refunded {
|
||||
background: #FFEBEE;
|
||||
color: #F44336;
|
||||
}
|
||||
|
||||
/* 积分徽章 */
|
||||
.points-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.points-badge.earned {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.points-badge.used {
|
||||
background: #FFF4E6;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.points-icon {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.points-text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* 优惠券徽章 */
|
||||
.coupon-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
background: linear-gradient(135deg, #FFF4E6, #FFE0B2);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.coupon-icon {
|
||||
font-size: 20rpx;
|
||||
color: #FF6B00;
|
||||
}
|
||||
|
||||
.coupon-text {
|
||||
font-size: 24rpx;
|
||||
color: #FF6B00;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 底部操作栏 */
|
||||
.bottom-actions {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 20rpx;
|
||||
padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
|
||||
box-shadow: 0 -2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.action-btn.secondary {
|
||||
background: linear-gradient(135deg, #F5F5F5, #EEEEEE);
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.action-btn.primary {
|
||||
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.action-btn.warning {
|
||||
background: linear-gradient(135deg, #2196F3, #42A5F5);
|
||||
color: #FFFFFF;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
/* 加载状态 */
|
||||
.loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<!-- 新增商品按钮 -->
|
||||
<view class="add-product-btn">
|
||||
<up-button @click="Service.GoPage('/pages/goods/addGoods')" color="var(--nav-mian)"
|
||||
:customStyle="{'border-radius':'15rpx'}"> + 新增商品 </up-button>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view class="product-list">
|
||||
<view class="product-item" v-for="(product, index) in products" :key="index">
|
||||
<view class="product-info">
|
||||
<image :src="Service.GetMateUrlByImg(product.img)" mode="aspectFill" class="product-image"></image>
|
||||
<view class="product-details">
|
||||
<view class="product-header">
|
||||
<text class="product-name">{{ product.name }}</text>
|
||||
|
||||
</view>
|
||||
<text class="product-price">¥{{ product.price }}</text>
|
||||
|
||||
</view>
|
||||
<view class="tag" :style="{ 'background-color':product.status==0?'#D9D9D9':'#52C41A', } "
|
||||
style="padding: 7rpx 24rpx;border-radius: 31rpx;font-size: 24rpx; color: #fff; height: fit-content; ">
|
||||
{{ product.status==0?'已下架':'已上架' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-actions">
|
||||
<text class="action-btn edit-btn" @click="editProduct(product)">编辑</text>
|
||||
<text class="action-btn" :class="product.status === 0 ? '上架' : '下架'"
|
||||
@click="toggleStatus(product)">
|
||||
{{ product.status === 0? '上架' : '下架' }}
|
||||
</text>
|
||||
<text class="action-btn delete-btn" @click="deleteProduct(index)">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { Service } from '@/Service/Service'
|
||||
import { vpMerchService } from '@/Service/vp/vpMerchService'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
|
||||
|
||||
// 商品数据类型定义
|
||||
interface Product {
|
||||
goodsId : string
|
||||
name : string
|
||||
price : number
|
||||
status : number
|
||||
img : string
|
||||
brief:string
|
||||
}
|
||||
|
||||
// 模拟商品数据
|
||||
const products = ref<Product[]>([
|
||||
{
|
||||
goodsId: '',
|
||||
name: '',
|
||||
price: null,
|
||||
status: null,
|
||||
img: '',
|
||||
brief:''
|
||||
}
|
||||
])
|
||||
|
||||
let status = ref('nomore')
|
||||
let page = ref(1)
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
getData()
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
products.value = []
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
if (status.value !== 'loadmore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
vpMerchService.GetMerchGoods(page.value).then(res => {
|
||||
products.value=[...products.value,...res.data.list]
|
||||
status.value=res.data.list.length==10?'loadmore':'nomore'
|
||||
page.value++
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 编辑商品
|
||||
const editProduct = (product : Product) => {
|
||||
Service.GoPage('/pages/goods/addGoods?goodsId='+product.goodsId)
|
||||
}
|
||||
|
||||
// 切换商品状态(上架/下架)
|
||||
const toggleStatus = (product : Product) => {
|
||||
|
||||
}
|
||||
|
||||
// 删除商品
|
||||
const deleteProduct = (index : number) => {
|
||||
// 在实际项目中,这里应该显示确认对话框
|
||||
products.value.splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 新增商品按钮 */
|
||||
.add-product-btn {
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 商品列表 */
|
||||
.product-list {
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.product-item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.product-info {
|
||||
display: flex;
|
||||
// align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-image {
|
||||
width: 155rpx;
|
||||
height: 155rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.product-details {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.product-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
font-size: 36rpx;
|
||||
color: #ff6600;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.product-sales {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.product-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 20rpx;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
font-size: 28rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.online-btn {
|
||||
color: #4cd964;
|
||||
}
|
||||
|
||||
.offline-btn {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
color: #ff3b30;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user