Branch_csl #1

Merged
root merged 5 commits from Branch_csl into master 2024-09-18 17:11:27 +08:00
Showing only changes of commit f70da5b255 - Show all commits

View File

@ -1,223 +1,205 @@
<template> <template>
<s-layout title="退货物流"> <s-layout title="退货物流">
<view> <view>
<form @submit="subRefund" report-submit="true"> <form @submit="subRefund" report-submit="true">
<view class="apply-return"> <view class="apply-return">
<view class="list borRadius14"> <view class="list borRadius14">
<view <view class="item acea-row row-between-wrapper" style="display: flex; align-items: center">
class="item acea-row row-between-wrapper" <view>物流公司</view>
style="display: flex; align-items: center" <view v-if="state.expresses.length > 0" style="flex: 1;">
> <picker mode="selector" class="num" @change="bindPickerChange"
<view>物流公司</view> :value="state.expressIndex" :range="state.expresses" range-key="name">
<view v-if="state.expresses.length > 0" style="flex: 1"> <view class="picker acea-row row-between-wrapper"
<picker style="display: flex; justify-content: space-between;">
mode="selector" <view class="reason">{{ state.expresses[state.expressIndex].name }}</view>
class="num" <text class="iconfont _icon-forward"></text>
@change="bindPickerChange" </view>
:value="state.expressIndex" </picker>
:range="state.expresses" </view>
range-key="name" </view>
> <view class="item textarea acea-row row-between" style="display: flex; align-items: center">
<view <view>物流单号</view>
class="picker acea-row row-between-wrapper" <input placeholder="请填写物流单号" class="num" name="logisticsNo" placeholder-class="placeholder" />
style="display: flex; justify-content: space-between" </view>
> <button class="returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn" form-type="submit" style="background: linear-gradient( 90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient) ) !important; ">
<view class="reason">{{ state.expresses[state.expressIndex].name }}</view> 提交</button>
<text class="iconfont _icon-forward" /> </view>
</view> </view>
</picker> </form>
</view> </view>
</view> </s-layout>
<view
class="item textarea acea-row row-between"
style="display: flex; align-items: center"
>
<view>物流单号</view>
<input
placeholder="请填写物流单号"
class="num"
name="logisticsNo"
placeholder-class="placeholder"
/>
</view>
<button
class="returnBnt bg-color ss-reset-button ui-BG-Main-Gradient sub-btn"
form-type="submit"
style="
background: linear-gradient(
90deg,
var(--ui-BG-Main),
var(--ui-BG-Main-gradient)
) !important;
"
>提交</button
>
</view>
</view>
</form>
</view>
</s-layout>
</template> </template>
<script setup> <script setup>
import { onLoad } from '@dcloudio/uni-app'; import {
import { reactive } from 'vue'; onLoad
import sheep from '@/sheep'; } from '@dcloudio/uni-app';
import AfterSaleApi from '@/sheep/api/trade/afterSale'; import {
import DeliveryApi from '@/sheep/api/trade/delivery'; reactive
} from 'vue';
import sheep from '@/sheep';
import AfterSaleApi from '@/sheep/api/trade/afterSale';
import DeliveryApi from '@/sheep/api/trade/delivery';
const state = reactive({ const state = reactive({
id: 0, // id: 0, //
expressIndex: 0, // expresses expressIndex: 0, // expresses
expresses: [], // expresses: [], //
}); });
function bindPickerChange(e) { function bindPickerChange(e) {
state.expressIndex = e.detail.value; state.expressIndex = e.detail.value;
} }
async function subRefund(e) { async function subRefund(e) {
let data = { let data = {
id: state.id, id: state.id,
logisticsId: state.expresses[state.expressIndex].id, logisticsId: state.expresses[state.expressIndex].id,
logisticsNo: e.detail.value.logisticsNo, logisticsNo: e.detail.value.logisticsNo,
}; };
const { code } = await AfterSaleApi.deliveryAfterSale(data); const {
if (code !== 0) { code
return; } = await AfterSaleApi.deliveryAfterSale(data);
} if (code !== 0) {
uni.showToast({ return;
title: '填写退货成功', }
}); uni.showToast({
sheep.$router.go('/pages/order/aftersale/detail', { id: state.id }); title: '填写退货成功',
} });
sheep.$router.go('/pages/order/aftersale/detail', {
id: state.id
});
}
// //
async function getExpressList() { async function getExpressList() {
const { code, data } = await DeliveryApi.getDeliveryExpressList(); const {
if (code !== 0) { code,
return; data
} } = await DeliveryApi.getDeliveryExpressList();
state.expresses = data; if (code !== 0) {
} return;
}
state.expresses = data;
}
onLoad((options) => { onLoad((options) => {
if (!options.id) { if (!options.id) {
sheep.$helper.toast(`缺少订单信息,请检查`); sheep.$helper.toast(`缺少订单信息,请检查`);
return; return;
} }
state.id = options.id; state.id = options.id;
// //
getExpressList(); getExpressList();
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.apply-return { .apply-return {
padding: 20rpx 30rpx 70rpx 30rpx; padding: 20rpx 30rpx 70rpx 30rpx;
} }
.apply-return .list { .apply-return .list {
background-color: #fff; background-color: #fff;
margin-top: 18rpx; margin-top: 18rpx;
padding: 0 24rpx 70rpx 24rpx; padding: 0 24rpx 70rpx 24rpx;
} }
.apply-return .list .item { .apply-return .list .item {
min-height: 90rpx; min-height: 90rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
font-size: 30rpx; font-size: 30rpx;
color: #333; color: #333;
} }
.apply-return .list .item .num { .apply-return .list .item .num {
color: #282828; color: #282828;
margin-left: 27rpx; margin-left: 27rpx;
// width: 227rpx; // width: 227rpx;
// text-align: right; // text-align: right;
} }
.apply-return .list .item .num .picker .reason { .apply-return .list .item .num .picker .reason {
width: 385rpx; width: 385rpx;
} }
.apply-return .list .item .num .picker .iconfont { .apply-return .list .item .num .picker .iconfont {
color: #666; color: #666;
font-size: 30rpx; font-size: 30rpx;
margin-top: 2rpx; margin-top: 2rpx;
} }
.apply-return .list .item.textarea { .apply-return .list .item.textarea {
padding: 24rpx 0; padding: 24rpx 0;
} }
.apply-return .list .item textarea { .apply-return .list .item textarea {
height: 100rpx; height: 100rpx;
font-size: 30rpx; font-size: 30rpx;
} }
.apply-return .list .item .placeholder { .apply-return .list .item .placeholder {
color: #bbb; color: #bbb;
} }
.apply-return .list .item .title { .apply-return .list .item .title {
height: 95rpx; height: 95rpx;
width: 100%; width: 100%;
} }
.apply-return .list .item .title .tip { .apply-return .list .item .title .tip {
font-size: 30rpx; font-size: 30rpx;
color: #bbb; color: #bbb;
} }
.apply-return .list .item .upload { .apply-return .list .item .upload {
padding-bottom: 36rpx; padding-bottom: 36rpx;
} }
.apply-return .list .item .upload .pictrue { .apply-return .list .item .upload .pictrue {
border-radius: 14rpx; border-radius: 14rpx;
margin: 22rpx 23rpx 0 0; margin: 22rpx 23rpx 0 0;
width: 156rpx; width: 156rpx;
height: 156rpx; height: 156rpx;
position: relative; position: relative;
font-size: 24rpx; font-size: 24rpx;
color: #bbb; color: #bbb;
} }
.apply-return .list .item .upload .pictrue:nth-of-type(4n) { .apply-return .list .item .upload .pictrue:nth-of-type(4n) {
margin-right: 0; margin-right: 0;
} }
.apply-return .list .item .upload .pictrue image { .apply-return .list .item .upload .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 14rpx; border-radius: 14rpx;
} }
.apply-return .list .item .upload .pictrue .icon-guanbi1 { .apply-return .list .item .upload .pictrue .icon-guanbi1 {
position: absolute; position: absolute;
font-size: 45rpx; font-size: 45rpx;
top: -10rpx; top: -10rpx;
right: -10rpx; right: -10rpx;
} }
.apply-return .list .item .upload .pictrue .icon-icon25201 { .apply-return .list .item .upload .pictrue .icon-icon25201 {
color: #bfbfbf; color: #bfbfbf;
font-size: 50rpx; font-size: 50rpx;
} }
.apply-return .list .item .upload .pictrue:nth-last-child(1) { .apply-return .list .item .upload .pictrue:nth-last-child(1) {
border: 1rpx solid #ddd; border: 1rpx solid #ddd;
box-sizing: border-box; box-sizing: border-box;
} }
.apply-return .returnBnt { .apply-return .returnBnt {
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;
width: 100%; width: 100%;
height: 86rpx; height: 86rpx;
border-radius: 50rpx; border-radius: 50rpx;
text-align: center; text-align: center;
line-height: 86rpx; line-height: 86rpx;
margin: 43rpx auto; margin: 43rpx auto;
} }
</style> </style>