合并代码
This commit is contained in:
parent
ec7d686245
commit
9b9b2a568d
|
@ -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
|
|
@ -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
|
|
@ -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: {
|
||||
|
|
|
@ -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 事件对象
|
||||
|
|
|
@ -1,280 +1,180 @@
|
|||
<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)">
|
||||
{{ item[titalName] }}
|
||||
</view>
|
||||
<view class="scroll-tab-bar" :style="[tabBarStyle]"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<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>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 当前活动tab的索引
|
||||
current: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
},
|
||||
titalName: {
|
||||
type: String,
|
||||
default: 'name'
|
||||
},
|
||||
// 菜单底部移动的bar的宽度,单位px
|
||||
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 {
|
||||
scrollLeft: 0,
|
||||
componentWidth: 0, // tabs组件宽度,单位为px
|
||||
parentLeft: 0, // 父元素(tabs组件)到屏幕左边的距离
|
||||
scrollBarLeft: 0, // 移动bar需要通过translateX()移动的距离
|
||||
tabItemRectInfo: [],
|
||||
currentIndex: 0,
|
||||
barFirstTimeMove: true
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
uni.createSelectorQuery().in(this).select(`#tab`).fields({
|
||||
size: true,
|
||||
rect: true
|
||||
}, data => {
|
||||
this.parentLeft = data.left;
|
||||
// tabs组件的宽度
|
||||
this.componentWidth = data.width;
|
||||
}).exec();
|
||||
this.getTabItemRect()
|
||||
})
|
||||
},
|
||||
getTabItemRect() {
|
||||
let query = uni.createSelectorQuery().in(this);
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
// 只要size和rect两个参数
|
||||
query.select(`#tab-item-${i}`).fields({
|
||||
size: true,
|
||||
rect: true
|
||||
});
|
||||
}
|
||||
query.exec((data) => {
|
||||
this.tabItemRectInfo = data
|
||||
this.scrollByIndex()
|
||||
})
|
||||
},
|
||||
scrollByIndex() {
|
||||
let tabInfo = this.tabItemRectInfo[this.currentIndex]
|
||||
if (!tabInfo) return
|
||||
// 活动tab的宽度
|
||||
let tabWidth = tabInfo.width
|
||||
let offsetLeft = tabInfo.left - this.parentLeft
|
||||
// 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
|
||||
let scrollLeft = offsetLeft - (this.componentWidth - tabWidth) / 2
|
||||
this.scrollLeft = scrollLeft < 0 ? 0 : scrollLeft;
|
||||
// 计算当前活跃item到组件左边的距离
|
||||
let left = tabInfo.left + tabInfo.width / 2 - this.parentLeft
|
||||
this.scrollBarLeft = left - this.barWidth / 2;
|
||||
if (this.barFirstTimeMove == true) {
|
||||
setTimeout(() => {
|
||||
this.barFirstTimeMove = false;
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
clickTab(item, index) {
|
||||
// 点击当前活动tab,不触发事件
|
||||
if (index == this.currentIndex) return
|
||||
this.currentIndex = index
|
||||
this.$emit('tabItemClick', item, index)
|
||||
this.scrollByIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
titalName: {
|
||||
type: String,
|
||||
default: 'name'
|
||||
},
|
||||
// 是否滚动,默认是,否则是不滚动,按个数等分宽度
|
||||
scroll: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
scrollLeft: 0,
|
||||
componentWidth: 0, // tabs组件宽度,单位为px
|
||||
parentLeft: 0, // 父元素(tabs组件)到屏幕左边的距离
|
||||
scrollBarLeft: 0, // 移动bar需要通过translateX()移动的距离
|
||||
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()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
uni.createSelectorQuery().in(this).select(`#tab`).fields({
|
||||
size: true,
|
||||
rect: true
|
||||
}, data => {
|
||||
this.parentLeft = data.left;
|
||||
// tabs组件的宽度
|
||||
this.componentWidth = data.width;
|
||||
}).exec();
|
||||
this.getTabItemRect()
|
||||
})
|
||||
},
|
||||
getTabItemRect() {
|
||||
let query = uni.createSelectorQuery().in(this);
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
// 只要size和rect两个参数
|
||||
query.select(`#tab-item-${i}`).fields({
|
||||
size: true,
|
||||
rect: true
|
||||
});
|
||||
}
|
||||
query.exec((data) => {
|
||||
this.tabItemRectInfo = data
|
||||
this.scrollByIndex()
|
||||
})
|
||||
},
|
||||
scrollByIndex() {
|
||||
let tabInfo = this.tabItemRectInfo[this.currentIndex]
|
||||
if (!tabInfo) return
|
||||
// 活动tab的宽度
|
||||
let tabWidth = tabInfo.width
|
||||
let offsetLeft = tabInfo.left - this.parentLeft
|
||||
// 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
|
||||
let scrollLeft = offsetLeft - (this.componentWidth - tabWidth) / 2
|
||||
this.scrollLeft = scrollLeft < 0 ? 0 : scrollLeft;
|
||||
// 计算当前活跃item到组件左边的距离
|
||||
let left = tabInfo.left + tabInfo.width / 2 - this.parentLeft
|
||||
this.scrollBarLeft = left - this.barWidth / 2;
|
||||
if (this.barFirstTimeMove == true) {
|
||||
setTimeout(() => {
|
||||
this.barFirstTimeMove = false;
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
|
||||
clickTab(item, index) {
|
||||
// 点击当前活动tab,不触发事件
|
||||
if (index === this.currentIndex) return
|
||||
this.currentIndex = index
|
||||
this.$emit('tabItemClick', item, index)
|
||||
this.scrollByIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tab {
|
||||
position: sticky;
|
||||
top: 88rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
height: 88rpx;
|
||||
}
|
||||
.tab {
|
||||
position: sticky;
|
||||
top: 88rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
scroll-view {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
scroll-view {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
display: none
|
||||
}
|
||||
::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;
|
||||
}
|
||||
/* #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 */
|
||||
// 通过样式穿透,隐藏H5下,scroll-view下的滚动条
|
||||
scroll-view ::v-deep ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
// 通过样式穿透,隐藏H5下,scroll-view下的滚动条
|
||||
scroll-view ::v-deep ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
/* #endif */
|
||||
|
||||
.scroll-view-content {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
.scroll {
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
|
||||
.scroll-item-view {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.list {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scroll-item {
|
||||
position: relative;
|
||||
padding: 0 20rpx;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
color: #8C8C8C;
|
||||
}
|
||||
.item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
color: #8C8C8C;
|
||||
|
||||
.mar-r-38 {
|
||||
margin-right: 76rpx;
|
||||
}
|
||||
|
||||
.no-right {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.scroll-tab-bar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
//
|
||||
&.active {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -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
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -114,7 +114,7 @@
|
|||
api.shop.addOrder({
|
||||
data: [{
|
||||
// 地址id
|
||||
addressId: address.id,
|
||||
addressId: event.address.id,
|
||||
// 产品id
|
||||
productId: props.detail.id,
|
||||
// 规格id
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -45,17 +45,28 @@
|
|||
// 当前模式 select选择 form表单
|
||||
const mode = ref('select')
|
||||
// 类型列表
|
||||
const typeList = reactive([{
|
||||
type: 1,
|
||||
name: '我要退款(无需退货)',
|
||||
text: '未收到货,或与商家协商之后申请',
|
||||
},
|
||||
{
|
||||
type: 2,
|
||||
name: '已收到货,我要退货退款',
|
||||
text: '已收到货,需要退还已收到的货物',
|
||||
},
|
||||
])
|
||||
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')
|
||||
|
|
|
@ -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()],
|
||||
|
|
Loading…
Reference in New Issue