合并代码
This commit is contained in:
parent
6e9ca6a925
commit
204261ac3c
|
@ -344,6 +344,19 @@ const shop = {
|
|||
load: true,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 订单取消
|
||||
* @param {Object} param
|
||||
*/
|
||||
orderAfterSales(param) {
|
||||
return util.request({
|
||||
url: `/shopify/appRefundOrder/addRefund`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
load: true,
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export default shop
|
|
@ -43,7 +43,19 @@ const order = {
|
|||
orderId: event.id,
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 申请售后
|
||||
* @param {Object} event 事件对象
|
||||
*/
|
||||
orderAfterSales(event) {
|
||||
uni.navigateTo({
|
||||
url: util.setUrl('/pages/shop/order/refundStar', {
|
||||
orderId: event.id,
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export default order
|
|
@ -0,0 +1,142 @@
|
|||
<script setup>
|
||||
//
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
getCurrentInstance,
|
||||
computed,
|
||||
defineEmits,
|
||||
onMounted,
|
||||
defineProps,
|
||||
} from 'vue'
|
||||
//
|
||||
import util from '@/common/js/util.js'
|
||||
//
|
||||
import api from '@/api/index.js'
|
||||
|
||||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
//
|
||||
const props = defineProps({
|
||||
// 商品信息
|
||||
detail: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
})
|
||||
// 地址
|
||||
const address = reactive({})
|
||||
// 已选择的规格下标
|
||||
const spaceIndex = ref(0)
|
||||
// 数量
|
||||
const payNum = ref(1)
|
||||
// 当前选择的规格
|
||||
const currentSpec = computed(() => {
|
||||
let spec = props.detail.specs || []
|
||||
return spec[spaceIndex.value] || {}
|
||||
})
|
||||
// 应付总价
|
||||
const total = computed(() => {
|
||||
let price = parseFloat(props.detail.price) * 100
|
||||
let result = parseInt(price * payNum.value) / 100
|
||||
return result
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 获取默认收货地址
|
||||
getDefaultAddress()
|
||||
})
|
||||
|
||||
// 获取默认收货地址
|
||||
function getDefaultAddress() {
|
||||
api.shop.getDefaultAddress({}).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) Object.assign(address, {}, res.data)
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} url 跳转路径
|
||||
*/
|
||||
function link(url) {
|
||||
uni.navigateTo({
|
||||
url,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择规格
|
||||
* @param {Object} index 选择规格下标
|
||||
*/
|
||||
function handleSpec(index) {
|
||||
if (spaceIndex.value !== index) spaceIndex.value = index
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 规格 -->
|
||||
<uni-popup type="bottom" ref="payment">
|
||||
<view class="buy popBot plr20 bfff">
|
||||
<view class="address mtb40">
|
||||
<template v-if="address.id">
|
||||
<JyCommodityAddress :address="address" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="fmid c999 f28" @click="link('/pages/mine/address/index?select=1')">
|
||||
<view>暂无默认地址</view>
|
||||
<uni-icons type="right" color="#999" size="30rpx" />
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<!-- 商品图 价格 明细 数量 -->
|
||||
<view class="jy-card-commodity-content df mtb40">
|
||||
<!-- 商品图 -->
|
||||
<image class="wh200 br10" :src="currentSpec.image" mode="aspectFill" />
|
||||
<!-- 价格 明细 数量 -->
|
||||
<view class="info f1 df fdc jcsb ml30">
|
||||
<!-- 价格 -->
|
||||
<view class="content-info-price">
|
||||
<text class="cFF9B27 f28">单价</text>
|
||||
<text class="cFF9B27 f24">¥</text>
|
||||
<text class="cFF9B27 f50">{{detail.price}}</text>
|
||||
</view>
|
||||
<!-- 已选 -->
|
||||
<view class="content-info-num">
|
||||
<text class="f26 c333">已选: {{currentSpec.sku}}</text>
|
||||
</view>
|
||||
<!-- 计数器 -->
|
||||
<view class="w200">
|
||||
<uni-number-box v-model="payNum" :step="1" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 规格 -->
|
||||
<view class="spec">
|
||||
<view class="selection df">
|
||||
<!-- disabled 销量为零不能选 -->
|
||||
<view class="option mtb20 mr20" :class="{'active': spaceIndex === index}"
|
||||
v-for="(item,index) in detail.specs" :key="index" @click="handleSpec(index)">
|
||||
<text class="txt">{{item.sku}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn lg primary mtb30" @click="handlePay">
|
||||
<text class="cfff">立即下单 ¥{{total}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -39,7 +39,7 @@
|
|||
function link(url) {
|
||||
uni.navigateTo({
|
||||
url: util.setUrl('/pages/shop/order/logistics', {
|
||||
//
|
||||
orderId: props.detail.id,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
// 商品收藏
|
||||
|
||||
import {
|
||||
ref
|
||||
ref,
|
||||
reactive,
|
||||
} from 'vue';
|
||||
import apex from '@/components/header/apex'
|
||||
import {
|
||||
|
@ -18,6 +19,10 @@
|
|||
import util from '@/common/js/util';
|
||||
//
|
||||
const setting = ref(false)
|
||||
// 收藏列表
|
||||
const list = reactive({
|
||||
data: [],
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
// 获取列表
|
||||
|
@ -28,7 +33,23 @@
|
|||
function getList() {
|
||||
api.shop.getCollectList({}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
list.data = res.data
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格选择
|
||||
* @param {Object} secItem
|
||||
*/
|
||||
function handleSpec(secItem) {
|
||||
//
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -44,17 +65,16 @@
|
|||
</apex>
|
||||
|
||||
<view class="list">
|
||||
<view class="item oh mb20 plr30 bfff" v-for="(item,index) in 10" :key="index">
|
||||
<view class="item oh mb20 plr30 bfff" v-for="(item,index) in list.data" :key="index">
|
||||
<!-- 店铺 -->
|
||||
<view class="store line df aic ptb20 thd f1 f28">
|
||||
<image class="wh50 br10"
|
||||
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
|
||||
<image class="wh50 br10" :src="item.rectangleLogo"
|
||||
mode="aspectFill" />
|
||||
<view class="name ml10 c333">家纺专营店</view>
|
||||
<view class="name ml10 c333">{{item.name}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<view class="product line df ptb20">
|
||||
<view class="product line df ptb20" v-for="(secItem,secIndex) in item.shopifyProductInfos" :key="secIndex">
|
||||
<view class="fmid mr10">
|
||||
<template v-if="index == 0">
|
||||
<uni-icons type="circle" size="40rpx" color="#aaa" />
|
||||
|
@ -66,26 +86,26 @@
|
|||
|
||||
<view class="poster wh160">
|
||||
<image class="wh160 br10"
|
||||
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
|
||||
:src="secItem.sliderImage.split(',')[0]"
|
||||
mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<view class="info df fdc jcsb f1 ml20">
|
||||
<view class="name c333 f28">靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学</view>
|
||||
<view class="info oh df fdc jcsb f1 ml20">
|
||||
<view class="name thd c333 f28">{{item.name}}</view>
|
||||
|
||||
<view class="spec line df thd mtb10 ptb10 plr10 df aic c666 f24 br10" @click="handleSpec(secItem)">
|
||||
<text>已选规格: 升级款/小熊</text>
|
||||
</view>
|
||||
|
||||
<view class="other df aic">
|
||||
<view class="price c333">
|
||||
<text class="f20">¥</text>
|
||||
<text class="f30">89</text>
|
||||
<text class="f30">{{secItem.price}}</text>
|
||||
</view>
|
||||
<view class="count ml20 fs0 c999 f24">销量:0</view>
|
||||
<view class="count ml20 fs0 c999 f24">销量:{{secItem.sales}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="spec line df ptb20 df aic c666 f24">
|
||||
<text>已选规格: 升级款/小熊</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -111,5 +131,10 @@
|
|||
.line+.line {
|
||||
border-top: 2rpx solid #eee;
|
||||
}
|
||||
|
||||
// 规格
|
||||
.spec {
|
||||
border: 2rpx solid #ddd;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -13,7 +13,6 @@
|
|||
//
|
||||
import api from '@/api/index.js'
|
||||
|
||||
import JyPopup from '@/components/public/jy-popup'
|
||||
// 地址
|
||||
import JyCommodityAddress from '@/components/public/jy-commodity-address'
|
||||
//
|
||||
|
@ -210,19 +209,20 @@
|
|||
</view>
|
||||
|
||||
<!-- 下单 -->
|
||||
<view class="btn lg primary f1 ml30" @click="$refs.popup.open()">
|
||||
<view class="btn lg primary f1 ml30" @click="$refs.payment.open()">
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup type="bottom" ref="popup">
|
||||
<!-- 规格 -->
|
||||
<uni-popup type="bottom" ref="payment">
|
||||
<view class="buy popBot plr20 bfff">
|
||||
<view class="address mtb40">
|
||||
<template v-if="address.id">
|
||||
<JyCommodityAddress :address="address" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="fmid c999 f28" @click="link('/pages/mine/address/index')">
|
||||
<view class="fmid c999 f28" @click="link('/pages/mine/address/index?select=1')">
|
||||
<view>暂无默认地址</view>
|
||||
<uni-icons type="right" color="#999" size="30rpx" />
|
||||
</view>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
onPullDownRefresh,
|
||||
onPageScroll
|
||||
} from '@dcloudio/uni-app';
|
||||
|
||||
// 订单方法
|
||||
import order from '@/common/js/order.js'
|
||||
// api
|
||||
|
@ -212,7 +211,7 @@
|
|||
<view class="btn bar warmHollow plr30" @click="order.orderPay(detail)">继续付款</view>
|
||||
</template>
|
||||
<template v-if="detail.status == 1">
|
||||
<view class="btn bar closeHollow plr30">申请退款</view>
|
||||
<view class="btn bar closeHollow plr30" @click="order.orderAfterSales(detail)">申请退款</view>
|
||||
<!-- <view class="btn bar warmHollow plr30">催发货</view> -->
|
||||
</template>
|
||||
<template v-if="detail.status == 3">
|
||||
|
|
|
@ -39,16 +39,17 @@
|
|||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '已收货'
|
||||
name: '待收货'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '待收货'
|
||||
name: '已收货'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: '已完成'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
name: '已取消'
|
||||
}
|
||||
|
@ -132,6 +133,8 @@
|
|||
if (list.pageNum == 1) list.data.length = 0
|
||||
list.data.push(...res.rows.map(item => {
|
||||
item.status = Number(item.status)
|
||||
if(item.refundStatus != 0) item.status_text = '售后'
|
||||
// item.status_text =
|
||||
return item
|
||||
}))
|
||||
list.total = res.total
|
||||
|
@ -212,16 +215,16 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-if="scope.item.status == 1">
|
||||
<view class="btn bar closeHollow plr30">申请退款</view>
|
||||
<!-- <view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(item)">申请退款</view> -->
|
||||
<!-- <view class="btn bar warmHollow plr30">催发货</view> -->
|
||||
</template>
|
||||
<template v-if="scope.item.status == 3">
|
||||
<view class="btn bar closeHollow plr30">申请退款</view>
|
||||
<template v-if="scope.item.status == 4">
|
||||
<!-- <view class="btn bar closeHollow plr30">申请退款</view> -->
|
||||
<view class="btn bar closeHollow plr30">查看物流</view>
|
||||
<view class="btn bar warmHollow plr30">确认收货</view>
|
||||
</template>
|
||||
<template v-if="scope.item.status == 4">
|
||||
<view class="btn bar closeHollow plr30">申请退款</view>
|
||||
<template v-if="scope.item.status == 5">
|
||||
<view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(item)">申请退款</view>
|
||||
<view class="btn bar warmHollow plr30">评价</view>
|
||||
</template>
|
||||
<template v-if="scope.item.status == 6">
|
||||
|
|
|
@ -5,12 +5,18 @@
|
|||
reactive,
|
||||
computed,
|
||||
} from 'vue';
|
||||
// 产品列表
|
||||
import productList from '@/components/shop/productList/productList.vue';
|
||||
import {
|
||||
onLoad,
|
||||
onUnload,
|
||||
} from '@dcloudio/uni-app';
|
||||
// 工具库
|
||||
import util from '@/common/js/util.js'
|
||||
// api
|
||||
import api from '@/api/index.js'
|
||||
// 产品列表
|
||||
import productList from '@/components/shop/productList/productList.vue';
|
||||
// 地址
|
||||
import JyCommodityAddress from '@/components/public/jy-commodity-address'
|
||||
|
||||
// 订单详情
|
||||
const detail = reactive({
|
||||
|
@ -19,36 +25,25 @@
|
|||
// 订单商品列表信息
|
||||
orderDetailList: [],
|
||||
// 物流信息
|
||||
logistics: {
|
||||
info: [],
|
||||
},
|
||||
logistics: {},
|
||||
})
|
||||
// 物流信息
|
||||
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {})
|
||||
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {
|
||||
logisticsTraceDetailList: []
|
||||
})
|
||||
// 订单id
|
||||
const orderId = ref('')
|
||||
|
||||
// 物流状态
|
||||
const flow = reactive([{
|
||||
content: '您的宝贝正在运输中',
|
||||
},
|
||||
{
|
||||
content: '您的快递正在由普通快递运送,预计三日后到达',
|
||||
},
|
||||
{
|
||||
content: '您的宝贝已被普通快递捡收',
|
||||
},
|
||||
{
|
||||
content: '您的宝贝已出仓',
|
||||
},
|
||||
])
|
||||
// 查看更多订单信息
|
||||
const showMore = ref(false)
|
||||
|
||||
// 物流状态
|
||||
const flow = computed(() => {
|
||||
return []
|
||||
})
|
||||
// 物流状态
|
||||
const formatFlow = computed(() => {
|
||||
let result = [...flow]
|
||||
if (!showMore.value) result.length = Math.min(flow.length, 2)
|
||||
let result = [...logistics.value.logisticsTraceDetailList]
|
||||
if (!showMore.value) result.length = Math.min(logistics.value.logisticsTraceDetailList.length, 2)
|
||||
return result
|
||||
})
|
||||
|
||||
|
@ -90,30 +85,23 @@
|
|||
<template>
|
||||
<view class="app">
|
||||
<!-- 地址详情 -->
|
||||
<view class="address rows ptb15 plr30 bfff">
|
||||
<image class="wh30 oh fs0" src="/static/address.png" mode="aspectFill" />
|
||||
<!-- -->
|
||||
<view class="f1 mlr20">
|
||||
<view class="f30">山东省济南市槐荫区绿地新城商务大厦</view>
|
||||
<view class="mt10 c999 f26">
|
||||
<text>海棠的秋</text>
|
||||
<text class="ml10">15666006592</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bfff mtb20 p25">
|
||||
<!-- 地址 -->
|
||||
<JyCommodityAddress v-model:address="detail.address" :shopEdit="false" />
|
||||
</view>
|
||||
|
||||
<!-- 快递公司 -->
|
||||
<view class="container rows ptb20 f28">
|
||||
<image class="wh70" src="/static/shop-logistics.png" mode="aspectFit" />
|
||||
<view class="value f1 mlr20">快递公司:普通快递</view>
|
||||
<view class="btn sm closeHollow plr20">复制</view>
|
||||
<view class="value f1 mlr20">快递公司:{{logistics.logisticsCompanyName}}</view>
|
||||
<view class="btn sm closeHollow plr20" @click="handleCopy(logistics.logisticsCompanyName)">复制</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单编号 -->
|
||||
<view class="container rows ptb20 f28">
|
||||
<image class="wh70" src="/static/shop-document.png" mode="aspectFit" />
|
||||
<view class="value f1 mlr20">订单编号:kd11111111111</view>
|
||||
<view class="btn sm closeHollow plr20">复制</view>
|
||||
<view class="value f1 mlr20">订单编号:{{detail.logistics.orderNo}}</view>
|
||||
<view class="btn sm closeHollow plr20" @click="handleCopy(detail.logistics.orderNo)">复制</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单流程 -->
|
||||
|
@ -126,7 +114,7 @@
|
|||
<view class="line f1"></view>
|
||||
</view>
|
||||
<view class="content f1 ml20 pb20">
|
||||
<view class="f30">{{item.content}}</view>
|
||||
<view class="f30">{{item.desc}}</view>
|
||||
<view class="mt10 f28">2024-03-05 13:24:00</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -3,19 +3,55 @@
|
|||
|
||||
import {
|
||||
reactive,
|
||||
ref
|
||||
ref,
|
||||
computed,
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onUnload,
|
||||
onReachBottom,
|
||||
onPullDownRefresh,
|
||||
onPageScroll
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
useStore
|
||||
} from 'vuex';
|
||||
// api
|
||||
import api from '@/api/index.js'
|
||||
// util
|
||||
import util from '@/common/js/util';
|
||||
// 物流信息
|
||||
import logistics from '@/components/shop/order/logistics';
|
||||
import logisticsVue from '@/components/shop/order/logistics';
|
||||
// 仓库
|
||||
const store = useStore();
|
||||
|
||||
// 订单详情
|
||||
const detail = reactive({
|
||||
createTime: '',
|
||||
coutDownTime: '',
|
||||
// 订单商品列表信息
|
||||
orderDetailList: [],
|
||||
// 物流信息
|
||||
logistics: {
|
||||
info: [],
|
||||
},
|
||||
})
|
||||
// 物流信息
|
||||
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {
|
||||
logisticsTraceDetailList: []
|
||||
})
|
||||
// 订单id
|
||||
const orderId = ref('')
|
||||
// 当前模式 select选择 form表单
|
||||
const mode = ref('select')
|
||||
// 类型列表
|
||||
const typeList = reactive([{
|
||||
type: 1,
|
||||
name: '我要退款(无需退货)',
|
||||
text: '未收到货,活鱼商家协商之后申请',
|
||||
text: '未收到货,或与商家协商之后申请',
|
||||
},
|
||||
{
|
||||
type: 2,
|
||||
name: '已收到货,我要退货退款',
|
||||
text: '已收到货,需要退还已收到的货物',
|
||||
},
|
||||
|
@ -23,14 +59,62 @@
|
|||
// 退款列表
|
||||
const typeIndex = ref('')
|
||||
// 申请原因列表
|
||||
const reasonList = reactive([{
|
||||
name: '不想要了',
|
||||
}, {
|
||||
name: '买错了',
|
||||
}])
|
||||
const reasonList = reactive([])
|
||||
// 申请原因下标
|
||||
const reasonIndex = ref('')
|
||||
// 表单
|
||||
const form = reactive({
|
||||
// 退款说明
|
||||
refundReasonContent: '',
|
||||
// 退款图片
|
||||
refundReasonWapImg: [],
|
||||
})
|
||||
// 用户信息
|
||||
const userinfo = computed(() => store.state.userinfo)
|
||||
|
||||
onLoad((option) => {
|
||||
if (option.orderId) orderId.value = option.orderId
|
||||
// 获取订单详情
|
||||
getDetail()
|
||||
// 获取分类字典
|
||||
getDictList()
|
||||
})
|
||||
|
||||
// 获取分类字典
|
||||
function getDictList() {
|
||||
api.getDict({
|
||||
path: ['refund_reason'],
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
Object.assign(reasonList, {}, res.data)
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取订单详情
|
||||
function getDetail() {
|
||||
api.shop.getOrderDetail({
|
||||
query: {
|
||||
id: orderId.value
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let result = res.data
|
||||
result.status = Number(result.status)
|
||||
Object.assign(detail, {}, result)
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 选择售后
|
||||
* @param {Object} index 选择的下标
|
||||
|
@ -43,13 +127,97 @@
|
|||
title: '申请售后',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 原因切换
|
||||
* @param {Object} event 默认事件
|
||||
*/
|
||||
function handleReason(event) {
|
||||
let index = event.detail.value
|
||||
if (reasonIndex.value === index) return
|
||||
reasonIndex.value = index
|
||||
}
|
||||
|
||||
// 图片上传
|
||||
function uploadImg() {
|
||||
util.upload_image({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
form.refundReasonWapImg.push(res.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} index
|
||||
*/
|
||||
function handleRemoveImg(index) {
|
||||
util.alert({
|
||||
content: '确定删除该图片吗?',
|
||||
success: (res) => {
|
||||
if (!res.confirm) return
|
||||
form.refundReasonWapImg.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单发起售后
|
||||
* @param {Object} event 事件对象
|
||||
*/
|
||||
function handleSubmit() {
|
||||
const data = {
|
||||
...form
|
||||
}
|
||||
|
||||
// 验证必填项
|
||||
if (reasonIndex.value === '') {
|
||||
util.alert('请选择退款原因')
|
||||
return
|
||||
}
|
||||
if (!data.refundReasonContent) {
|
||||
util.alert('申请说明不能为空')
|
||||
return
|
||||
}
|
||||
// 图片
|
||||
if (data.refundReasonWapImg) data.refundReasonWapImg = data.refundReasonWapImg.join(',')
|
||||
|
||||
//
|
||||
api.shop.orderAfterSales({
|
||||
data: {
|
||||
// 订单
|
||||
orderId: detail.id,
|
||||
// 售后类型:1-仅退款,2-退货退款
|
||||
afterSalesType: typeList[typeIndex.value].type,
|
||||
// 退款原因-数据字典refund_reason
|
||||
refundReasonWap: reasonList[reasonIndex.value].dictLabel,
|
||||
// 退款图片
|
||||
refundReasonWapImg: data.refundReasonWapImg,
|
||||
// 退款内容
|
||||
refundReasonContent: data.refundReasonContent,
|
||||
},
|
||||
}).then(res => {
|
||||
return
|
||||
if (res.code == 200) {
|
||||
// 触发自定义事件
|
||||
uni.$off('updateOrderList')
|
||||
uni.$off('updateOrderDetail')
|
||||
uni.navigateBack()
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="app">
|
||||
<template v-if="mode === 'select'">
|
||||
<view class="detail">
|
||||
<logistics />
|
||||
<logisticsVue :logistics="logistics" :detail="detail" />
|
||||
</view>
|
||||
|
||||
<!-- 列表类型 -->
|
||||
|
@ -67,33 +235,29 @@
|
|||
|
||||
<template v-else-if="mode === 'form'">
|
||||
<!-- 商品信息 -->
|
||||
<view class="product df ptb20 plr20 bfff">
|
||||
<view class="poster wh160">
|
||||
<image class="wh160 br10"
|
||||
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
|
||||
mode="aspectFill" />
|
||||
<view class="goods df mtb20 ptb20 plr20 bfff" v-for="(item,index) in detail.orderDetailList">
|
||||
<!-- 产品图 -->
|
||||
<image class="wh180 br10" :src="item.productInfo.sliderImage.split(',')[0]" mode="aspectFill" />
|
||||
<!-- 产品信息 -->
|
||||
<view class="f1 ml20 mr10">
|
||||
<view class="name f30 t2hd">{{item.productName}}</view>
|
||||
<view class="spec mt10 c999 f26">升级款 {{item.sku}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品名称 和 购买的规格 -->
|
||||
<view class="info mlr20 f1">
|
||||
<view class="name c333 f28">靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学</view>
|
||||
<view class="spec mt10 c999 f26">款式:普通款 小熊</view>
|
||||
</view>
|
||||
|
||||
<!-- 单价 数量 -->
|
||||
<!-- 其他 -->
|
||||
<view class="tar">
|
||||
<view class="price c666">
|
||||
<view class="price">
|
||||
<text class="f20">¥</text>
|
||||
<text class="f26">89</text>
|
||||
<text class="f30">{{item.price}}</text>
|
||||
</view>
|
||||
<view class="number f24 c999">x 1</view>
|
||||
<view class="c999 f28">x{{item.payNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 申请信息 -->
|
||||
<view class="apply container">
|
||||
<view class="line ptb20">
|
||||
<picker :range="typeList" :value="typeIndex" range-key="name" @change="handleType">
|
||||
<picker :range="typeList" :value="typeIndex" range-key="name"
|
||||
@change="handleType($event.detail.value)">
|
||||
<view class="rows">
|
||||
<view class="key">申请类型</view>
|
||||
<view class="value f1 mlr20">{{typeList[typeIndex].name}}</view>
|
||||
|
@ -103,11 +267,11 @@
|
|||
</view>
|
||||
|
||||
<view class="line ptb20">
|
||||
<picker :range="reasonList" range-key="name" @change="handleType">
|
||||
<picker :range="reasonList" range-key="dictLabel" @change="handleReason($event,'reasonIndex')">
|
||||
<view class="rows">
|
||||
<view class="key">申请原因</view>
|
||||
<view class="value f1 mlr20">
|
||||
<text v-if="reasonIndex !== ''">{{reasonList[reasonIndex].name}}</text>
|
||||
<text v-if="reasonIndex !== ''">{{reasonList[reasonIndex].dictLabel}}</text>
|
||||
<text v-else class="placeholderStyle">点击选择申请原因</text>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999" />
|
||||
|
@ -121,7 +285,8 @@
|
|||
<view class="title f30">申请金额</view>
|
||||
<view class="value df mt10 c333 f60">
|
||||
<text>¥</text>
|
||||
<input type="text" class="input f1 c333 f60" :value="89" />
|
||||
<text class="input f1 c333 f60">{{detail.totalPrice}}</text>
|
||||
<!-- <input type="text" class="input f1 c333 f60" :value="89" /> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -129,10 +294,16 @@
|
|||
<view class="form container">
|
||||
<view class="title mtb20 f30">申请说明</view>
|
||||
<textarea type="text" class="input mtb20 c333 f30" placeholder="必填,请您详细填写申请说明"
|
||||
placeholder-class="placeholderStyle" auto-height="true" />
|
||||
v-model="form.refundReasonContent" placeholder-class="placeholderStyle" auto-height="true" />
|
||||
|
||||
<view class="imgList df fww">
|
||||
<view class="imgs upload wh140">
|
||||
<view class="imgs" v-for="(item,index) in form.refundReasonWapImg" :key="index">
|
||||
<image class="wh140" :src="item" mode="aspectFill" />
|
||||
<view class="close" @click="handleRemoveImg(index)">
|
||||
<uni-icons type="clear" color="#f00" size="40rpx" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="imgs upload wh140" @click="uploadImg">
|
||||
<image class="wh140" src="/static/shop-upload-image.png" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
|
@ -141,14 +312,14 @@
|
|||
<view class="other container">
|
||||
<view class="line df mtb30">
|
||||
<view class="key w200">联系电话</view>
|
||||
<view class="value f1">13979897890</view>
|
||||
<view class="value f1">{{userinfo.phoneNumber}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fill" style="height: 120rpx;"></view>
|
||||
|
||||
<view class="footer plr30 bfff shadow">
|
||||
<view class="btn lg primary">提交申请</view>
|
||||
<view class="btn lg primary" @click="handleSubmit">提交申请</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
|
|
@ -5,7 +5,7 @@ import uni from '@dcloudio/vite-plugin-uni';
|
|||
|
||||
//
|
||||
// let target = 'http://101.35.80.139:8080'
|
||||
let target = 'http://2h34ni.natappfree.cc'
|
||||
let target = 'http://8ii5rt.natappfree.cc'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [uni()],
|
||||
|
|
Loading…
Reference in New Issue