合并代码

This commit is contained in:
sx 2025-01-23 21:29:16 +08:00
parent ec7d686245
commit 9b9b2a568d
12 changed files with 536 additions and 362 deletions

View File

@ -190,6 +190,19 @@ const mine = {
load: true,
})
},
/**
* 获取收益列表
* @param {Object} param
*/
getGetList(param) {
return util.request({
url: '/user/profitSharingRecord/find',
data: param.data,
query: param.query,
method: 'POST',
})
},
}
export default mine

View File

@ -357,6 +357,19 @@ const shop = {
load: true,
})
},
/**
* 订单确认收货
* @param {Object} param
*/
orderReceived(param) {
return util.request({
url: `/shopify/appOrder/receivedOrder`,
query: param.query,
method: 'PUT',
load: true,
})
},
}
export default shop

View File

@ -6,7 +6,7 @@ const config = {
// #endif
// #ifndef H5
// host: 'http://91f.xyz:8080',
host: 'http://ugcege.natappfree.cc',
host: 'http://yz78nt.natappfree.cc',
// #endif
// 支付方式配置
payType: {

View File

@ -45,6 +45,41 @@ const order = {
})
},
/**
* 查看物流
* @param {Object} event 事件对象
*/
logistics(event) {
uni.navigateTo({
url: util.setUrl('/pages/shop/order/logistics', {
orderId: event.id,
})
})
},
/**
* 订单确认收货
* @param {Object} event 事件对象
*/
orderReceived: (event) => {
return new Promise((resolve, reject) => {
api.shop.orderReceived({
query: {
id: event.orderId,
},
}).then(res => {
if (res.code == 200) {
resolve(res.data)
return
}
util.alert({
content: res.msg,
showCancel: false,
})
})
})
},
/**
* 申请售后
* @param {Object} event 事件对象

View File

@ -1,21 +1,18 @@
<template>
<view class="tab" :style="{ background }">
<scroll-view class="scroll-view-content" scroll-x scroll-with-animation :show-scrollbar="false"
:scroll-left="scrollLeft">
<view class="scroll-item-view" :class="scroll ? '' : 'flex-row-left'" id="tab">
<view class="scroll-item" :class="[index == list.length - 1 ? 'no-right' : '']"
:style="{ color: currentIndex == index ? activeColor : '', height: tabHeight, 'line-height': tabHeight, 'font-size': fontSize, width: !scroll ? (100 / list.length) + '%' : '', 'margin-right': scroll ? marright : '', 'font-weight': currentIndex == index ? activeWeight : '' }"
:id="'tab-item-' + index" v-for="(item, index) in list" :key="index" @click="clickTab(item, index)">
<view class="tab">
<scroll-view class="scroll" scroll-x scroll-with-animation :show-scrollbar="false" :scroll-left="scrollLeft">
<view class="list" :class="scroll ? '' : 'flex-row-left'" id="tab">
<view class="item fmid ptb10 plr20" :class="{'active': index === currentIndex}" :id="'tab-item-' + index"
v-for="(item, index) in list" :key="index" @click="clickTab(item, index)">
{{ item[titalName] }}
</view>
<view class="scroll-tab-bar" :style="[tabBarStyle]"></view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
export default {
props: {
list: {
type: Array,
@ -23,111 +20,15 @@ export default {
return []
}
},
// tab
current: {
type: [Number, String],
default: 0
},
titalName: {
type: String,
default: 'name'
},
// barpx
barWidth: {
type: [String, Number],
default: 16
},
// bar
barHeight: {
type: [String, Number],
default: 2
},
barStyle: {
type: Object,
default() {
return {}
}
},
// bar
activeBarColor: {
type: String,
default: '#4990F9'
},
//
activeColor: {
type: String,
default: '#4990F9'
},
// , ms
duration: {
type: [String, Number],
default: 0.5
},
// tab
height: {
type: Number,
default: 34
},
//
fontSize: {
type: String,
default: '16px'
},
//
scroll: {
type: Boolean,
default: true
},
// margin-right
marright: {
type: String,
default: '38px'
},
// font-weight
activeWeight: {
type: String,
default: 'normal'
},
background: {
type: String,
default: ''
}
},
watch: {
list(n, o) {
// list
if (n.length !== o.length) this.currentIndex = 0;
this.$nextTick(() => {
this.init();
});
},
current: {
immediate: true,
handler(nVal, oVal) {
//
this.$nextTick(() => {
this.currentIndex = nVal;
this.scrollByIndex();
});
}
}
},
computed: {
tabBarStyle: function () {
let style = {
width: this.barWidth + 'px',
height: this.barHeight + 'px',
transform: `translateX(${this.scrollBarLeft}px)`,
'transition-duration': `${this.barFirstTimeMove ? 0 : this.duration}s`,
'border-radius': `${this.barHeight / 2}px`,
'background-color': this.activeBarColor
}
Object.assign(style, this.barStyle)
return style
},
tabHeight() {
return this.height + 'px'
}
},
data() {
return {
@ -138,7 +39,16 @@ export default {
tabItemRectInfo: [],
currentIndex: 0,
barFirstTimeMove: true
};
}
},
watch: {
list(n, o) {
// list
if (n.length !== o.length) this.currentIndex = 0;
this.$nextTick(() => {
this.init();
});
},
},
mounted() {
this.init()
@ -189,92 +99,82 @@ export default {
}, 100)
}
},
clickTab(item, index) {
// tab
if (index == this.currentIndex) return
if (index === this.currentIndex) return
this.currentIndex = index
this.$emit('tabItemClick', item, index)
this.scrollByIndex()
}
}
}
}
</script>
<style lang="scss" scoped>
.tab {
.tab {
position: sticky;
top: 88rpx;
left: 0;
width: 100%;
z-index: 9;
height: 88rpx;
}
}
scroll-view {
scroll-view {
box-sizing: border-box;
height: 100%;
}
}
::v-deep ::-webkit-scrollbar {
::v-deep ::-webkit-scrollbar {
display: none
}
/* #ifndef APP-NVUE */
::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
/* #ifdef H5 */
// 穿H5scroll-view
scroll-view ::v-deep ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.scroll-view-content {
white-space: nowrap;
width: 100%;
position: relative;
.scroll-item-view {
width: 100%;
white-space: nowrap;
position: relative;
margin-bottom: 20rpx;
}
.scroll-item {
/* #ifndef APP-NVUE */
::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
/* #ifdef H5 */
// 穿H5scroll-view
scroll-view ::v-deep ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.scroll {
position: relative;
white-space: nowrap;
width: 100%;
.list {
position: relative;
width: 100%;
white-space: nowrap;
}
.item {
position: relative;
padding: 0 20rpx;
display: inline-block;
text-align: center;
color: #8C8C8C;
}
.mar-r-38 {
margin-right: 76rpx;
//
&.active {
color: #333;
font-weight: bold;
transform: scale(1.1);
}
.no-right {
margin: 0;
}
.scroll-tab-bar {
position: absolute;
bottom: 0;
z-index: 10;
}
}
</style>

View File

@ -122,12 +122,17 @@
util.alert('请选择收货地址')
return
}
emit('confirm', {
//
let param = {
spec: currentSpec.value,
spaceIndex: spaceIndex.value,
payNum: payNum.value,
})
}
//
if (address.id) param.address = address
emit('confirm', param)
//
spaceIndexLast.value = spaceIndex.value
payNumLast.value = payNum.value

View File

@ -0,0 +1,79 @@
<script setup>
//
import {
ref,
reactive,
getCurrentInstance,
defineExpose,
} from 'vue'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js';
const {
proxy
} = getCurrentInstance()
//
const form = reactive({
//
expressName: '',
//
trackingNumber: '',
})
//
function getExpressList() {
api.getDict({
path: ['express_company'],
}).then(rs => {
if (rs.code == 200) {
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function open() {
proxy.$refs.express.open()
}
//
function close() {
proxy.$refs.express.close()
}
defineExpose({
open,
close
})
</script>
<template>
<uni-popup ref="express" type="center">
<view class="expressAlt">
<view class="header rows">
<view>填写快递单号</view>
<uni-icons type="closeempty" />
</view>
<view class="form">
<view class="line df aic">
<view class="">快递公司</view>
<input type="text" placeholder="输入快递公司" />
</view>
<view class="line df aic">
<view class="">快递单号</view>
<input type="text" placeholder="输入快递公司" />
</view>
</view>
</view>
</uni-popup>
</template>
<style>
</style>

View File

@ -27,13 +27,35 @@
proxy
} = getCurrentInstance()
const store = useStore()
//
//
const scrollLog = reactive({
data: [],
pageNum: 1,
pageSize: 30,
total: 0,
})
//
const getLog = reactive({
data: [],
pageNum: 1,
pageSize: 30,
total: 0,
})
//
const getTypeList = reactive([{
type: 0,
name: '待结算',
}, {
type: 1,
name: '待入账',
}, {
type: 2,
name: '已入账',
}])
//
const getTypeListIndex = ref(0)
//
const releasedLst = ref([])
//
const userinfo = computed(() => {
let result = store.state.userinfo || {}
@ -44,16 +66,57 @@
let result = store.state.purse || {}
return result
})
//
const releasedList = ref([])
onLoad(() => {
//
getReleased()
//
getGetList()
//
util.getPurse()
})
//
function refreshMoreGetList() {
getLog.pageNum = 1
//
getGetList()
}
//
function getMoreGetList() {
if (getLog.total <= getLog.data.length) return
getLog.pageNum++
//
getGetList()
}
//
function getGetList() {
api.mine.getGetList({
query: {
pageSize: getLog.pageSize,
pageNum: getLog.pageNum,
},
data: {
status: getTypeList[getTypeListIndex.value].type,
},
}).then(rs => {
if (rs.code == 200) {
if (getLog.pageNum === 1) getLog.data.length = 0
//
getLog.data.push(...rs.rows)
//
getLog.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function getReleased() {
api.mine.releasedList({}).then(rs => {
@ -68,6 +131,18 @@
})
}
/**
* 收益类型下标
* @param {Object} index
*/
function handleGetTypeIndex(index) {
if (getTypeListIndex.value === index) return
getTypeListIndex.value = index
getLog.data.length = 0
//
refreshMoreGetList()
}
/**
* 跳转
* @param {Object} url 路径
@ -113,19 +188,19 @@
<uni-icons type="right" color="" />
</view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="link('/pages/index/wallet/merchantBill')">
<text>商家账单</text>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10">
<text>商家明细</text>
<uni-icons type="right" color="" />
</view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="link('/pages/index/wallet/merchantBill')">
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="$refs.get.open()">
<text>我的收益</text>
<uni-icons type="right" color="" />
</view>
<!-- 待释放 -->
<uni-popup ref="released" type="center">
<view class="releasedAlt oh popMid bfff br20">
<view class="releasedAlt alertContainer oh popMid bfff br20">
<view class="header rows ptb20 plr20 c333 f34 b">
<view class="title">待入账列表</view>
<uni-icons type="closeempty" @click="$refs.released.close()" />
@ -146,6 +221,36 @@
</view>
</view>
</uni-popup>
<!-- 收益 -->
<uni-popup ref="get" type="center">
<view class="getAlt alertContainer oh popMid bfff br20">
<view class="header rows ptb20 plr20 c333 f34 b">
<view class="title">我的收益</view>
<uni-icons type="closeempty" @click="$refs.get.close()" />
</view>
<view class="tab">
<view class="item fmid fdc ptb10" :class="{'active':index === getTypeListIndex}"
v-for="(item,index) in getTypeList" :key="index" @click="handleGetTypeIndex(index)">
<view>{{item.name}}</view>
</view>
</view>
<view class="main mtb20 plr30">
<scroll-view scroll-y="true" class="scroll" @scrolltolower="getMoreGetList">
<view class="list c333 f30">
<view class="item mtb30 f32" v-for="(item,index) in getLog.data" :key="index">
<view>{{item.typeName}}{{item.amount}}</view>
<view class="time mt10 c999 f28 ">{{item.createTime}}</view>
</view>
</view>
<view class="nomore" v-if="!getLog.data[0]">暂无内容~</view>
<view class="nomore" v-else-if="getLog.data.length === getLog.total">暂无更多~</view>
</scroll-view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -156,62 +261,29 @@
}
//
.releasedAlt {
.alertContainer {
.header {
border-bottom: 2rpx solid #ddd;
}
// tab
.tab {
display: flex;
//
.item {
flex: 1;
color: #999;
&.active {
font-weight: 600;
color: #333;
}
}
}
.scroll {
height: 50vh;
}
}
//
.setted {
width: 562rpx;
height: 516rpx;
background-image: linear-gradient(143deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.3);
border-radius: 20rpx;
//
.title {
top: 80rpx;
left: 30rpx;
}
//
.cartoon {
top: 20rpx;
right: -50rpx;
width: 280rpx;
height: 400rpx;
}
//
.weal {
width: 562rpx;
height: 268rpx;
//
.bg {
border-radius: 20rpx;
}
}
}
//
.button {
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, .3);
}
//
.close {
width: 86rpx;
height: 86rpx;
margin: 0 auto;
border-radius: 50%;
background-color: #999999;
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.3);
}
</style>

View File

@ -114,7 +114,7 @@
api.shop.addOrder({
data: [{
// id
addressId: address.id,
addressId: event.address.id,
// id
productId: props.detail.id,
// id

View File

@ -2,7 +2,8 @@
//
import {
ref,
reactive
reactive,
getCurrentInstance
} from 'vue'
import {
onLoad,
@ -11,18 +12,23 @@
onPullDownRefresh,
onPageScroll
} from '@dcloudio/uni-app';
//
import apex from '@/components/header/apex.vue'
//
import JyShopNavigation from '@/components/public/jy-shop-navigation'
//
import orderItem from '@/components/shop/order/item.vue';
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js';
//
import order from '@/common/js/order.js'
//
import apex from '@/components/header/apex.vue'
//
import JyShopNavigation from '@/components/public/jy-shop-navigation'
//
import orderItem from '@/components/shop/order/item.vue';
//
import expressVue from '@/components/shop/order/express.vue';
const {
proxy
} = getCurrentInstance()
// tabs
const tabs = reactive([{
@ -132,16 +138,32 @@
if (res.code == 200) {
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 =
item.refundStatus = Number(item.refundStatus)
//
if (item.refundStatus != 0) {
item.status_text = {
'1': '售后中',
'3': '售后完成',
} [item.refundStatus]
} else {
item.status_text = {
'0': '待支付',
'1': '待发货',
'4': '待收货',
'5': '已收货',
'6': '已完成',
'9': '已取消',
} [item.status]
}
return item
}))
list.total = res.total
return
}
util.alert({
content: rs.msg,
content: res.msg,
showCancel: false
})
})
@ -164,6 +186,7 @@
* @param {Object} ev
*/
function itemClick(ev) {
list.status = ev.id
//
refreshList()
}
@ -180,6 +203,19 @@
refreshList()
})
}
/**
* 确认收货
* @param {Object} item
*/
function handleReceived(item) {
order.orderReceived({
orderId: item.id,
}).then(res => {
//
refreshList()
})
}
</script>
<template>
@ -196,8 +232,7 @@
<view class="shopHeaderBg bgColor"></view>
<view class="f1 pr">
<JyShopNavigation :current="list.status" :list="tabs" @tabItemClick="itemClick" marright="25px"
activeWeight='600' activeColor="#333333" activeBarColor="initial" />
<JyShopNavigation :list="tabs" @tabItemClick="itemClick" />
</view>
<view class="product mlr20 pr">
@ -206,28 +241,38 @@
<template v-for="(item,index) in list.data" :key="index">
<view class="mtb30">
<orderItem :item="item" mode="mine" @item="handleItem">
<!-- 操作按钮 -->
<template #menu="scope">
<view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status)">
<template v-if="scope.item.status == 0">
<template v-if="scope.item.refundStatus == 1">
<view class="btn bar warmHollow plr30" @click.stop="handleCancel(scope.item)">
填写退货物流信息</view>
</template>
<template v-else-if="scope.item.status == 0">
<view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)">
取消订单</view>
<view class="btn bar warmHollow plr30" @click.stop="order.orderPay(item)">继续付款
</view>
</template>
<template v-if="scope.item.status == 1">
<!-- <view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(item)">申请退款</view> -->
<template v-else-if="scope.item.status == 1">
<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 == 4">
<!-- <view class="btn bar closeHollow plr30">申请退款</view> -->
<view class="btn bar closeHollow plr30">查看物流</view>
<view class="btn bar warmHollow plr30">确认收货</view>
<template v-else-if="scope.item.status == 4">
<view class="btn bar closeHollow plr30"
@click.stop="order.orderAfterSales(item)">申请退款</view>
<view class="btn bar closeHollow plr30" @click.stop="order.logistics(item)">查看物流
</view>
<view class="btn bar warmHollow plr30" @click.stop="handleReceived(item)">确认收货
</view>
</template>
<template v-if="scope.item.status == 5">
<view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(item)">申请退款</view>
<template v-else-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">
<template v-else-if="scope.item.status == 6">
<view class="btn bar closeHollow plr30">取消售后</view>
<view class="btn bar closeHollow plr30">钱款去向</view>
<view class="btn bar warmHollow plr30">平台介入</view>
@ -238,9 +283,11 @@
</view>
</template>
</view>
<!-- <JyOrderCard v-for="(item, index) in 10" type="user_order"></JyOrderCard> -->
</view>
</view>
<!-- 物流弹窗 -->
<expressVue ref="expressRef" />
</template>
<style scoped lang="scss">

View File

@ -45,17 +45,28 @@
// select form
const mode = ref('select')
//
const typeList = reactive([{
const typeList = computed(() => {
let result = []
//
if ([4].includes(detail.status)) {
result.push({
type: 1,
name: '我要退款(无需退货)',
text: '未收到货,或与商家协商之后申请',
},
{
})
}
//
if ([5, 6].includes(detail.status)) {
result.push({
type: 2,
name: '已收到货,我要退货退款',
text: '已收到货,需要退还已收到的货物',
},
])
})
}
return result
})
// 退
const typeIndex = ref('')
//
@ -188,7 +199,7 @@
//
orderId: detail.id,
// 1-退2-退退
afterSalesType: typeList[typeIndex.value].type,
afterSalesType: typeList.value[typeIndex.value].type,
// 退-refund_reason
refundReasonWap: reasonList[reasonIndex.value].dictLabel,
// 退
@ -197,7 +208,6 @@
refundReasonContent: data.refundReasonContent,
},
}).then(res => {
return
if (res.code == 200) {
//
uni.$off('updateOrderList')

View File

@ -5,7 +5,7 @@ import uni from '@dcloudio/vite-plugin-uni';
//
// let target = 'http://91f.xyz:8080'
let target = 'http://ugcege.natappfree.cc'
let target = 'http://yz78nt.natappfree.cc'
export default defineConfig({
plugins: [uni()],