feat:添加发货内容详情,优化积分商城接口,取消订单添加确认框,物流追踪样式修改,收银台页面优化,添加小程序直播组件

This commit is contained in:
kele
2023-03-09 18:45:09 +08:00
parent 8a78cb9a7a
commit 8eb4e4609d
16 changed files with 670 additions and 96 deletions
+101 -21
View File
@@ -76,10 +76,68 @@
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white">
<view class="item-title">配送方式</view>
<view class="ss-flex ss-col-center">
<text class="item-value">{{ item.dispatch_type_text }}</text>
<text class="item-value ss-m-r-20">{{ item.dispatch_type_text }}</text>
<button
class="ss-reset-button copy-btn"
@tap="onDetail(item)"
v-if="
(item.dispatch_type === 'autosend' || item.dispatch_type === 'custom') &&
item.dispatch_status !== 0
"
>详情</button
>
</view>
</view>
</template>
<template #tool>
<view class="ss-flex">
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
申请售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('re_aftersale')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item),
})
"
>
重新售后
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale_info')"
@tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', {
id: item.ext.aftersale_id,
})
"
>
售后详情
</button>
<button
class="ss-reset-button apply-btn"
v-if="item.btns.includes('buy_again')"
@tap.stop="
sheep.$router.go('/pages/goods/index', {
id: item.goods_id,
})
"
>
再次购买
</button>
</view>
</template>
<template #priceSuffix>
<button class="ss-reset-button tag-btn" v-if="item.status_text">
{{ item.status_text }}
@@ -148,7 +206,7 @@
</view>
<view class="notice-item all-rpice-item ss-flex ss-m-t-20">
<text class="title">{{
['unpaid', 'cancel', 'closed','pending'].includes(state.orderInfo.status) ? '付款' : '付款'
['paid', 'completed'].includes(state.orderInfo.status) ? '付款' : '付款'
}}</text>
<text class="detail all-price" v-if="Number(state.orderInfo.pay_fee) > 0"
>¥{{ state.orderInfo.pay_fee }}</text
@@ -157,7 +215,7 @@
v-if="
state.orderInfo.score_amount &&
Number(state.orderInfo.pay_fee) > 0 &&
!['unpaid', 'cancel', 'closed'].includes(state.orderInfo.status)
['paid', 'completed'].includes(state.orderInfo.status)
"
class="detail all-price"
>+</view
@@ -165,8 +223,7 @@
<view
class="price-text ss-flex ss-col-center"
v-if="
state.orderInfo.score_amount &&
!['unpaid', 'cancel', 'closed'].includes(state.orderInfo.status)
state.orderInfo.score_amount && ['paid', 'completed'].includes(state.orderInfo.status)
"
>
<image
@@ -296,10 +353,18 @@
// 取消订单
async function onCancel(orderId) {
const { error, data } = await sheep.$api.order.cancel(orderId);
if (error === 0) {
getOrderDetail(data.order_sn);
}
uni.showModal({
title: '提示',
content: '确定要取消订单吗?',
success: async function (res) {
if (res.confirm) {
const { error, data } = await sheep.$api.order.cancel(orderId);
if (error === 0) {
getOrderDetail(data.order_sn);
}
}
},
});
}
// 申请退款
@@ -340,6 +405,14 @@
});
}
// 配送方式详情
function onDetail(item) {
sheep.$router.go('/pages/order/dispatch/content', {
id: item.order_id,
item_id: item.id,
});
}
// 评价
function onComment(orderSN) {
uni.$once('SELECT_INVOICE', (e) => {
@@ -376,6 +449,15 @@
height: 36rpx;
margin: 0 4rpx;
}
.apply-btn {
width: 140rpx;
height: 50rpx;
border-radius: 25rpx;
font-size: 24rpx;
border: 2rpx solid #dcdcdc;
line-height: normal;
margin-left: 16rpx;
}
.state-box {
color: rgba(#fff, 0.9);
width: 100%;
@@ -419,7 +501,6 @@
.order-list {
margin-bottom: 20rpx;
background-color: #fff;
padding: 0 20rpx;
.order-card {
padding: 20rpx 0;
@@ -496,19 +577,18 @@
color: #333;
flex: 1;
}
.copy-btn {
width: 100rpx;
line-height: 50rpx;
border-radius: 25rpx;
padding: 0;
background: rgba(238, 238, 238, 1);
font-size: 22rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
}
}
.copy-btn {
width: 100rpx;
line-height: 50rpx;
border-radius: 25rpx;
padding: 0;
background: rgba(238, 238, 238, 1);
font-size: 22rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
// 订单价格信息
.order-price-box {
+87
View File
@@ -0,0 +1,87 @@
<template>
<s-layout title="发货内容">
<view class="order-card ss-m-x-20 ss-r-20">
<s-goods-item
:img="state.data.goods_image"
:title="state.data.goods_title"
:skuText="state.data.goods_sku_text"
:price="state.data.goods_price"
:num="state.data.goods_num"
radius="20"
>
<template #priceSuffix>
<button class="ss-reset-button tag-btn" v-if="state.data.status_text">
{{ state.data.status_text }}
</button>
</template>
</s-goods-item>
</view>
<view class="bg-white ss-p-20 ss-m-x-20 ss-r-20">
<view class="title ss-m-b-26">发货信息</view>
<view v-if="state.data.ext?.dispatch_content_type === 'params'">
<view class="desc ss-m-b-20" v-for="item in state.data.ext.dispatch_content" :key="item">
{{ item.title }}: {{ item.content }}
</view>
</view>
<view class="desc" v-else>{{ state.data.ext?.dispatch_content }}</view>
</view>
</s-layout>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { reactive } from 'vue';
import sheep from '@/sheep';
const state = reactive({
data: [],
});
async function getDetail(id, item_id) {
const { error, data } = await sheep.$api.order.itemDetail({
id: id,
item_id: item_id,
});
if (error === 0) {
state.data = data;
}
}
onLoad(async (options) => {
getDetail(options.id, options.item_id);
});
</script>
<style lang="scss" scoped>
.order-card {
padding: 20rpx 0;
.order-sku {
font-size: 24rpx;
font-weight: 400;
color: rgba(153, 153, 153, 1);
width: 450rpx;
margin-bottom: 20rpx;
.order-num {
margin-right: 10rpx;
}
}
.tag-btn {
margin-left: 16rpx;
font-size: 24rpx;
height: 36rpx;
color: var(--ui-BG-Main);
border: 2rpx solid var(--ui-BG-Main);
border-radius: 14rpx;
padding: 0 4rpx;
}
}
.title {
font-size: 28rpx;
font-weight: bold;
color: #333333;
}
.desc {
font-size: 26rpx;
font-weight: 400;
color: #333333;
}
</style>
+2 -2
View File
@@ -2,7 +2,7 @@
<template>
<s-layout title="物流追踪">
<view class="log-wrap">
<view class="log-card ss-flex" v-if="goodsImages.length > 0">
<view class="log-card ss-flex ss-m-20 ss-r-10" v-if="goodsImages.length > 0">
<uni-swiper-dot :info="goodsImages" :current="state.current" mode="round">
<swiper class="swiper-box" @change="change">
<swiper-item v-for="(item, index) in goodsImages" :key="index">
@@ -20,7 +20,7 @@
<view>快递公司{{ state.info.express_name }}</view>
</view>
</view>
<view class="log-content">
<view class="log-content ss-m-20 ss-r-10">
<view
class="log-content-box ss-flex"
v-for="(item, index) in state.info.logs"
+20 -12
View File
@@ -287,7 +287,7 @@
function onTabsChange(e) {
if (state.currentTab === e.index) return;
state.pagination = pagination
state.pagination = pagination;
state.currentTab = e.index;
getOrderList();
@@ -354,11 +354,19 @@
// 取消订单
async function onCancel(orderId) {
const { error, data } = await sheep.$api.order.cancel(orderId);
if (error === 0) {
let index = state.pagination.data.findIndex((order) => order.id === orderId);
state.pagination.data[index] = data;
}
uni.showModal({
title: '提示',
content: '确定要取消订单吗?',
success: async function (res) {
if (res.confirm) {
const { error, data } = await sheep.$api.order.cancel(orderId);
if (error === 0) {
let index = state.pagination.data.findIndex((order) => order.id === orderId);
state.pagination.data[index] = data;
}
}
},
});
}
// 删除订单
@@ -408,11 +416,11 @@
});
state.error = res.error;
if (res.error === 0) {
let orderList = _.concat(state.pagination.data, res.data.data);
state.pagination = {
...res.data,
data: orderList,
};
let orderList = _.concat(state.pagination.data, res.data.data);
state.pagination = {
...res.data,
data: orderList,
};
if (state.pagination.current_page < state.pagination.last_page) {
state.loadStatus = 'more';
@@ -443,7 +451,7 @@
//下拉刷新
onPullDownRefresh(() => {
state.pagination = pagination
state.pagination = pagination;
getOrderList();
setTimeout(function () {
uni.stopPullDownRefresh();