This commit is contained in:
2026-03-30 10:14:58 +08:00
parent 2c00299634
commit a98fb14ae7
12 changed files with 364 additions and 91 deletions

5
package-lock.json generated
View File

@ -36,6 +36,7 @@
"moment": "^2.29.3", "moment": "^2.29.3",
"mp-html": "^2.5.2", "mp-html": "^2.5.2",
"node-sass": "4.14.1", "node-sass": "4.14.1",
"regenerator-runtime": "^0.14.1",
"sass": "1.26.2", "sass": "1.26.2",
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"sass-resources-loader": "^2.2.4", "sass-resources-loader": "^2.2.4",
@ -22589,7 +22590,7 @@
}, },
"node_modules/regenerator-runtime": { "node_modules/regenerator-runtime": {
"version": "0.14.1", "version": "0.14.1",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
}, },
"node_modules/regenerator-transform": { "node_modules/regenerator-transform": {
@ -44878,7 +44879,7 @@
}, },
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.14.1", "version": "0.14.1",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
}, },
"regenerator-transform": { "regenerator-transform": {

View File

@ -76,6 +76,7 @@
"moment": "^2.29.3", "moment": "^2.29.3",
"mp-html": "^2.5.2", "mp-html": "^2.5.2",
"node-sass": "4.14.1", "node-sass": "4.14.1",
"regenerator-runtime": "^0.14.1",
"sass": "1.26.2", "sass": "1.26.2",
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"sass-resources-loader": "^2.2.4", "sass-resources-loader": "^2.2.4",

View File

@ -156,7 +156,7 @@ export const createOrder = ({
}); });
}; };
// 创建购物车订单 // 创建抖音订单
export const createCartOrder = ({ export const createCartOrder = ({
product_pic= "", product_pic= "",
}) => { }) => {
@ -164,7 +164,7 @@ export const createCartOrder = ({
url: CREATE_CART_ORDER, url: CREATE_CART_ORDER,
method: "post", method: "post",
data: { data: {
product_pic orderId
}, },
}); });
}; };

View File

@ -232,8 +232,8 @@ export const DELETE_CART = "/product/cart/delete";
// 创建订单 // 创建订单
export const CREATE_ORDER_NEW = "/product/order/create"; export const CREATE_ORDER_NEW = "/product/order/create";
// 创建购物车订单 // 创建订单
export const CREATE_CART_ORDER = "/product/order/create"; export const CREATE_CART_ORDER = "/douyin/goods/order/create";
// 订单支付 // 订单支付
export const PAY_ORDER_NEW = "/ttpay/jsapi"; export const PAY_ORDER_NEW = "/ttpay/jsapi";
// 订单列表 // 订单列表

View File

@ -0,0 +1,187 @@
<template>
<view class="refund-button-wrapper" :class="{ 'compact-mode': compact }" :style="wrapperStyle">
<view class="pay-button-container">
<pay-button-sdk
:mode="mode"
:order-status="orderStatus"
:order-id="orderId"
:refund-total-amount="refundTotalAmount"
@getgoodsinfo="handleGetGoodsInfo"
@placeorder="handlePlaceOrder"
@pay="handlePay"
@refund="handleRefund"
@error="handleError"
>
<text class="refund-text">退款</text>
</pay-button-sdk>
</view>
</view>
</template>
<script>
export default {
name: "RefundButton",
props: {
// 模式1-仅退款2-退货退款
mode: {
type: [String, Number],
default: '1'
},
// 订单状态1-待发货2-待收货3-已完成
orderStatus: {
type: [String, Number],
default: '1'
},
// 订单ID
orderId: {
type: String,
required: true
},
// 退款总金额(单位:分)
refundTotalAmount: {
type: Number,
default: 0
},
// 是否使用紧凑模式(适合订单列表页)
compact: {
type: Boolean,
default: false
}
},
computed: {
wrapperStyle() {
if (!this.compact) {
return {
flex: '1',
width: '100%',
display: 'flex',
height: '48px'
}
}
return {}
}
},
methods: {
// 抖音官方组件生命周期回调 - 获取商品信息
handleGetGoodsInfo(e) {
console.log('抖音组件获取商品信息回调:', e.detail)
// 退款模式下不需要额外处理,直接返回成功即可
e.detail.success({
// 可根据实际业务补充商品信息
amount: this.refundTotalAmount
})
},
// 抖音官方组件生命周期回调 - 下单
handlePlaceOrder(e) {
console.log('抖音组件下单回调:', e.detail)
// 退款模式下不需要额外处理,直接返回成功即可
e.detail.success({
orderId: this.orderId
})
},
// 抖音官方组件生命周期回调 - 支付
handlePay(e) {
console.log('抖音组件支付回调:', e.detail)
// 退款模式下不需要额外处理,直接返回成功即可
e.detail.success()
},
// 退款成功回调
handleRefund(e) {
console.log('抖音退款组件退款成功回调:', e.detail)
this.$emit('refund', {
detail: {
status: 'success',
data: e.detail
}
})
},
// 错误回调
handleError(e) {
console.error('抖音退款组件错误回调:', e.detail)
this.$emit('error', {
detail: {
status: 'error',
message: e.detail.errMsg || '退款失败'
}
})
}
}
};
</script>
<style lang="scss" scoped>
.refund-button-wrapper {
height: 73rpx !important;
border-radius: 100px;
border: 2rpx solid #FF19A0;
color: #FF19A0;
background: transparent;
display: flex !important;
align-items: center;
justify-content: center;
font-size: 14px;
overflow: hidden;
flex: 1 !important;
width: 100% !important;
min-width: 0 !important;
box-sizing: border-box;
}
.pay-button-container {
width: 100% !important;
height: 100% !important;
display: flex !important;
align-items: center;
justify-content: center;
flex: 1 !important;
min-width: 0 !important;
}
.refund-button-sdk {
width: 100% !important;
height: 100% !important;
display: flex !important;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex: 1 !important;
}
// 强制设置 pay-button-sdk 内部元素样式
::v-deep .pay-button-sdk {
width: 100% !important;
height: 100% !important;
min-width: 100% !important;
max-width: 100% !important;
flex: 1 !important;
}
.refund-text {
color: #FF19A0;
font-family: PingFang SC;
font-size: 14px;
}
.refund-button-wrapper.compact-mode {
width: 70px;
height: 34px;
border-radius: 64rpx;
border: 1px solid #FF19A0;
margin-left: 20rpx;
font-size: 24rpx;
flex: none;
display: flex !important;
align-items: center;
justify-content: center;
padding: 0;
}
.compact-mode .refund-text {
font-size: 24rpx;
}
</style>

View File

@ -3,8 +3,8 @@ export default {
appName: "Wagoo", appName: "Wagoo",
appShareName: "Wagoo", appShareName: "Wagoo",
appId: "wx00e2dcdc7c02b23a", appId: "wx00e2dcdc7c02b23a",
// apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址 apiBaseUrl: "https://api.wagoo.me/api/v1", // 服务端测试地址
apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址 // apiBaseUrl: "https://api.wagoo.pet/api/v1", // 服务端生产地址
// apiBaseUrl: "http:192.168.30.79", //本地接口 // apiBaseUrl: "http:192.168.30.79", //本地接口
tencentMapKey: "WSBBZ-7OXK4-46QUC-KFB7B-4N3W7-M2BXM", tencentMapKey: "WSBBZ-7OXK4-46QUC-KFB7B-4N3W7-M2BXM",
tencentSecret: "vb7D0PGj7xUvmOLuJz2Jd7ykTMpjiWRJ", tencentSecret: "vb7D0PGj7xUvmOLuJz2Jd7ykTMpjiWRJ",

View File

@ -1,29 +1,25 @@
{ {
"name" : "Wagoo", "name": "Wagoo",
"appid" : "__UNI__F0AB43B", "appid": "tte57093cd7a7fbf2401",
"description" : "init", "description": "init",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
"app-plus" : { "app-plus": {
/* 5+App */ "compatible": {
"compatible" : { "ignoreVersion": true
"ignoreVersion" : true
}, },
"usingComponents" : true, "usingComponents": true,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
"modules" : {}, "modules": {},
/* */ "distribute": {
"distribute" : { "android": {
/* */ "permissions": [
"android" : {
/* android */
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
@ -48,48 +44,61 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
"ios" : {}, "ios": {},
/* ios */ "sdkConfigs": {},
"sdkConfigs" : {}, "splashscreen": {
"splashscreen" : { "useOriginalMsgbox": true
"useOriginalMsgbox" : true
} }
} }
}, },
/* SDK */ "quickapp": {},
"quickapp" : {}, "mp-weixin": {
/* */ "appid": "wx00e2dcdc7c02b23a",
"mp-weixin" : { "setting": {
"appid" : "wx00e2dcdc7c02b23a", "urlCheck": false,
"setting" : { "minified": true,
"urlCheck" : false, "postcss": true,
"minified" : true, "es6": true,
"postcss" : true, "minifyJS": true,
"es6" : true, "minifyWXML": true,
"minifyJS" : true, "minifyWXSS": true
"minifyWXML" : true,
"minifyWXSS" : true
}, },
"usingComponents" : true, "libVersion": "2.0.0",
"lazyCodeLoading" : "requiredComponents", "usingComponents": true,
"optimization" : { "lazyCodeLoading": "requiredComponents",
"subPackages" : true "optimization": {
"subPackages": true
}, },
"requiredPrivateInfos" : [], "requiredPrivateInfos": [],
"permission" : {}, "permission": {}
"plugins" : {}
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true, "usingComponents": true,
"appid" : "tte57093cd7a7fbf2401" "appid": "tte57093cd7a7fbf2401",
}, "libVersion": "2.0.0",
"mp-qq" : { "setting": {
"usingComponents" : true "urlCheck": false,
"minified": true,
"postcss": true,
"es6": true,
"minifyJS": true,
"minifyWXML": true,
"minifyWXSS": true
},
"plugins": {
"myTradePlugin": {
"version": "*",
"provider": "tta5a3d31e3aecfb9b11"
} }
} }
},
"mp-qq": {
"usingComponents": true
}
}

View File

@ -297,7 +297,11 @@
{ {
"path": "details", "path": "details",
"style": { "style": {
"navigationBarTitleText": "订单详情" "navigationBarTitleText": "订单详情",
"usingComponents": {
"refund-button": "plugin://myTradePlugin/pay-button",
"pay-button-sdk": "plugin://myTradePlugin/pay-button"
}
} }
}, },
{ {
@ -309,7 +313,10 @@
{ {
"path": "list", "path": "list",
"style": { "style": {
"navigationBarTitleText": "商城订单" "navigationBarTitleText": "商城订单",
"usingComponents": {
"pay-button-sdk": "plugin://myTradePlugin/pay-button"
}
} }
}, },
{ {
@ -527,7 +534,6 @@
{ {
"path": "coupon-package", "path": "coupon-package",
"style": { "style": {
"navigationBarTitleText": "",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
@ -552,14 +558,12 @@
{ {
"path": "member-inter", "path": "member-inter",
"style": { "style": {
"navigationBarTitleText": "",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "member-interests", "path": "member-interests",
"style": { "style": {
"navigationBarTitleText": "",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }

View File

@ -77,10 +77,21 @@
> >
申请售后 申请售后
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('refund', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('refund', data)">
退款 退款
</view> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm" <refund-button
mode="2"
order-status="1"
:order-id="data.order_no"
:refund-total-amount="(data.actual_price || 0) * 100"
:compact="true"
@refund="handleRefund"
@error="handleError"
style="width:140rpx;height:68rpx;"
/>
<view class="flex-center fs-24 app-fc-white status-btn confirm"
@click.stop="jumpToReservation"> @click.stop="jumpToReservation">
立即预约 立即预约
</view> </view>
@ -92,6 +103,7 @@
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('afterSale', data)"> <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('afterSale', data)">
申请售后 申请售后
</view> </view>
@ -143,6 +155,7 @@
<script> <script>
import PopUpModal from "@/components/PopUpModal.vue"; import PopUpModal from "@/components/PopUpModal.vue";
import GoodInfo from "./GoodInfo.vue"; import GoodInfo from "./GoodInfo.vue";
import RefundButton from "@/components/RefundButton.vue";
import { import {
SHOP_ORDER_STATUS, SHOP_ORDER_STATUS,
SHOP_ORDER_UNPAY, SHOP_ORDER_UNPAY,
@ -190,6 +203,7 @@
components: { components: {
GoodInfo, GoodInfo,
PopUpModal, PopUpModal,
RefundButton
}, },
options: { options: {
styleIsolation: "shared", styleIsolation: "shared",
@ -244,6 +258,20 @@
this.stopCountDown(); this.stopCountDown();
}, },
methods: { methods: {
handleRefund(e) {
console.log('退款结果:', e.detail)
if (e.detail.status === 'success') {
uni.showToast({ title: '退款申请已提交', icon: 'success' })
this.$emit('refund', this.data)
} else {
uni.showToast({ title: '退款失败', icon: 'none' })
}
},
handleError(e) {
console.error('组件错误:', e.detail)
},
startCountDown() { startCountDown() {
this.stopCountDown(); this.stopCountDown();
if (this.countDownTime > 0) { if (this.countDownTime > 0) {
@ -394,6 +422,7 @@
.good-info-multi { .good-info-multi {
padding-top: 20rpx; padding-top: 20rpx;
} }
} }
} }
</style> </style>

View File

@ -246,6 +246,7 @@
} }
console.log(this.orderData,'???') console.log(this.orderData,'???')
createCartOrder({ createCartOrder({
orderId:this.addressInfo.id
// product_id:this.orderData[0].price_id, // product_id:this.orderData[0].price_id,
// price_id:this.orderData[0].price_id, // price_id:this.orderData[0].price_id,
// // price_desc:this.orderData[0].product_desc, // // price_desc:this.orderData[0].product_desc,
@ -581,13 +582,6 @@
}); });
}, },
confirmPay() { confirmPay() {
if (this.WeChat === undefined && this.wallet === undefined) {
uni.showToast({
title: '请选择支付方式',
icon: "none",
});
return
}
this.createOrder() this.createOrder()
}, },
changeSliverType(item) { changeSliverType(item) {

View File

@ -263,8 +263,16 @@
<!-- 待发货 --> <!-- 待发货 -->
<template v-if="[SHOP_ORDER_UNSLIVER].includes(orderData.status)"> <template v-if="[SHOP_ORDER_UNSLIVER].includes(orderData.status)">
<view class="handle-btn" @click.stop="showCancelModal = true"> <!-- 使用原来的 RefundButton 组件 -->
<text class="fs-32 btnColor" style="color: #FF19A0;">退款</text> <view class="refund-btn-wrapper">
<refund-button
mode="2"
order-status="1"
:order-id="orderData.order_no"
:refund-total-amount="Math.round((orderData.actual_price || 0) * 100)"
@refund="handleRefundSuccess"
@error="handleRefundError"
/>
</view> </view>
<view class="handle-btn" @click.stop="remindSliver"> <view class="handle-btn" @click.stop="remindSliver">
<text class="fs-32 btnColor">立即预约</text> <text class="fs-32 btnColor">立即预约</text>
@ -336,6 +344,7 @@
import SliverInfo from "./components/SliverInfo.vue"; import SliverInfo from "./components/SliverInfo.vue";
import CallModal from "@/components/petOrder/call-modal.vue"; import CallModal from "@/components/petOrder/call-modal.vue";
import DraggableContact from "@/components/DraggableContact.vue"; import DraggableContact from "@/components/DraggableContact.vue";
import RefundButton from "@/components/RefundButton.vue";
import { import {
walletTransaction, walletTransaction,
cancelPetOrderRefund, cancelPetOrderRefund,
@ -383,6 +392,7 @@ import {
SliverInfo, SliverInfo,
CallModal, CallModal,
DraggableContact, DraggableContact,
RefundButton
}, },
data() { data() {
return { return {
@ -716,6 +726,19 @@ import {
} }
this.jumpToWeChat(); this.jumpToWeChat();
}, },
// 退款成功回调
handleRefundSuccess(e) {
console.log('退款成功:', e.detail)
uni.showToast({ title: '退款申请已提交', icon: 'success' })
this.getOrderDetail()
},
// 退款错误回调
handleRefundError(e) {
console.error('退款错误:', e.detail)
uni.showToast({ title: e.detail.message || '退款失败', icon: 'none' })
},
formatSecond(seconds) { formatSecond(seconds) {
const hour = Math.floor(seconds / 3600); const hour = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds - hour * 3600) / 60); const minutes = Math.floor((seconds - hour * 3600) / 60);
@ -1113,20 +1136,29 @@ import {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-end; justify-content: space-between;
background-color: #ffffff; background-color: #ffffff;
padding-top: 12rpx; padding-top: 12rpx;
align-items: center;
.refund-btn-wrapper {
flex: 1;
min-width: 0;
width: calc(50% - 12rpx) !important;
height: 48px;
}
.handle-btn { .handle-btn {
flex: 1;
min-width: 0;
height: 48px; height: 48px;
border-radius: 100px; border-radius: 100px;
border: 2rpx solid #ff19a0; border: 2rpx solid #ff19a0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 24rpx;
flex: 1;
background: transparent; background: transparent;
width: calc(50% - 12rpx) !important;
.btnColor { .btnColor {
color: #ff19a0; color: #ff19a0;
@ -1144,6 +1176,15 @@ import {
color: #fff !important; color: #fff !important;
} }
} }
// 确保 RefundButton 组件也能正确平均分配空间
::v-deep .refund-button-wrapper {
margin-left: 0 !important;
width: 100% !important;
height: 100% !important;
flex: 1 !important;
min-width: 0 !important;
}
} }
.contact-float-btn { .contact-float-btn {
@ -1203,5 +1244,6 @@ import {
} }
} }
} }
} }
</style> </style>

View File

@ -253,7 +253,13 @@ export default {
order_id: this.orderInfo.order_id, order_id: this.orderInfo.order_id,
// business_type:1 // business_type:1
} }
cancelPetOrderMall(data).then((res) => {
// 判断是取消订单还是退款
const apiPromise = this.cancelModalContent.includes('退款')
? cancelPetOrderRefund(data)
: cancelPetOrderMall(data);
apiPromise.then((res) => {
uni.hideLoading(); uni.hideLoading();
this.showCancelModal = false; this.showCancelModal = false;
this.reloadData(); this.reloadData();
@ -676,4 +682,4 @@ export default {
/* 可拖动联系客服组件无需额外样式 */ /* 可拖动联系客服组件无需额外样式 */
} }
</style> </style>