From 9b9b2a568d9484ec1331c982d4eb8c1086c4153c Mon Sep 17 00:00:00 2001
From: sx <2427911852@qq.com>
Date: Thu, 23 Jan 2025 21:29:16 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jiuyi2/api/mine.js | 13 +
jiuyi2/api/shop.js | 13 +
jiuyi2/common/js/config.js | 2 +-
jiuyi2/common/js/order.js | 35 ++
.../public/jy-shop-navigation/index.vue | 426 +++++++-----------
jiuyi2/components/shop/detail/makeOrder.vue | 11 +-
jiuyi2/components/shop/order/express.vue | 79 ++++
jiuyi2/pages/index/wallet/wallet.vue | 186 +++++---
.../components/jy-commodity-foot/index.vue | 2 +-
jiuyi2/pages/shop/order/index.vue | 93 +++-
jiuyi2/pages/shop/order/refundStar.vue | 36 +-
jiuyi2/vite.config.js | 2 +-
12 files changed, 536 insertions(+), 362 deletions(-)
create mode 100644 jiuyi2/components/shop/order/express.vue
diff --git a/jiuyi2/api/mine.js b/jiuyi2/api/mine.js
index 5431498a..1cdbde63 100644
--- a/jiuyi2/api/mine.js
+++ b/jiuyi2/api/mine.js
@@ -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
\ No newline at end of file
diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js
index e398172b..19628e4c 100644
--- a/jiuyi2/api/shop.js
+++ b/jiuyi2/api/shop.js
@@ -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
\ No newline at end of file
diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js
index 958515aa..01c06e18 100644
--- a/jiuyi2/common/js/config.js
+++ b/jiuyi2/common/js/config.js
@@ -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: {
diff --git a/jiuyi2/common/js/order.js b/jiuyi2/common/js/order.js
index c8f0de5b..e62cca1c 100644
--- a/jiuyi2/common/js/order.js
+++ b/jiuyi2/common/js/order.js
@@ -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 事件对象
diff --git a/jiuyi2/components/public/jy-shop-navigation/index.vue b/jiuyi2/components/public/jy-shop-navigation/index.vue
index 350e8c42..642dd330 100644
--- a/jiuyi2/components/public/jy-shop-navigation/index.vue
+++ b/jiuyi2/components/public/jy-shop-navigation/index.vue
@@ -1,280 +1,180 @@
-
-
-
-
- {{ item[titalName] }}
-
-
-
-
-
+
+
+
+
+ {{ item[titalName] }}
+
+
+
+
\ No newline at end of file
diff --git a/jiuyi2/components/shop/detail/makeOrder.vue b/jiuyi2/components/shop/detail/makeOrder.vue
index eebbaa51..127098fd 100644
--- a/jiuyi2/components/shop/detail/makeOrder.vue
+++ b/jiuyi2/components/shop/detail/makeOrder.vue
@@ -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
diff --git a/jiuyi2/components/shop/order/express.vue b/jiuyi2/components/shop/order/express.vue
new file mode 100644
index 00000000..eebbdc10
--- /dev/null
+++ b/jiuyi2/components/shop/order/express.vue
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+ 快递公司
+
+
+
+
+ 快递单号
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jiuyi2/pages/index/wallet/wallet.vue b/jiuyi2/pages/index/wallet/wallet.vue
index bb60a4d2..13adbc83 100644
--- a/jiuyi2/pages/index/wallet/wallet.vue
+++ b/jiuyi2/pages/index/wallet/wallet.vue
@@ -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 @@
-
- 商家账单
+
+ 商家明细
-
+
我的收益
-
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+ {{item.typeName}}{{item.amount}}
+ {{item.createTime}}
+
+
+ 暂无内容~
+ 暂无更多~
+
+
+
+
@@ -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);
- }
\ No newline at end of file
diff --git a/jiuyi2/pages/shop/commodity/components/jy-commodity-foot/index.vue b/jiuyi2/pages/shop/commodity/components/jy-commodity-foot/index.vue
index 66665050..6cc639e3 100644
--- a/jiuyi2/pages/shop/commodity/components/jy-commodity-foot/index.vue
+++ b/jiuyi2/pages/shop/commodity/components/jy-commodity-foot/index.vue
@@ -114,7 +114,7 @@
api.shop.addOrder({
data: [{
// 地址id
- addressId: address.id,
+ addressId: event.address.id,
// 产品id
productId: props.detail.id,
// 规格id
diff --git a/jiuyi2/pages/shop/order/index.vue b/jiuyi2/pages/shop/order/index.vue
index f6b44308..0f02f51d 100644
--- a/jiuyi2/pages/shop/order/index.vue
+++ b/jiuyi2/pages/shop/order/index.vue
@@ -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()
+ })
+ }
@@ -196,8 +232,7 @@
-
+
@@ -206,28 +241,38 @@
+
-
+
+
+