完善茶艺师接口对接

This commit is contained in:
wangxiaowei
2026-01-05 00:40:35 +08:00
parent 58f59f1ee5
commit 6289a502f5
19 changed files with 178 additions and 128 deletions

8
env/.env vendored
View File

@ -10,15 +10,15 @@ VITE_APP_PUBLIC_BASE=/
# 登录页面 # 登录页面
VITE_LOGIN_URL = '/pages/login/login' VITE_LOGIN_URL = '/pages/login/login'
# 第一个请求地址 # 第一个请求地址
VITE_SERVER_BASEURL = 'https://cz.stnav.com' VITE_SERVER_BASEURL = 'https://76458.com'
# h5是否需要配置代理 # h5是否需要配置代理
VITE_APP_PROXY=true VITE_APP_PROXY=true
VITE_APP_PROXY_PREFIX = '/storeapi' VITE_APP_PROXY_PREFIX = '/storeapi'
# 第二个请求地址 (目前alova中可以使用) # 第二个请求地址 (目前alova中可以使用)
VITE_SERVER_BASEURL = 'https://cz.stnav.com' VITE_SERVER_BASEURL = 'https://76458.com'
# 上传图片请求地址 # 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/teamapi/Upload/image' VITE_UPLOAD_BASEURL = 'https://76458.com/teamapi/Upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://cz.stnav.com/' VITE_UPLOAD_IMAGE_URL = 'https://76458.com/'

View File

@ -25,6 +25,6 @@ export function getBankCardList() {
/** /**
* 提现申请 * 提现申请
*/ */
export function withdrawApply(store_id: number, amount: number, bank_id: number) { export function withdrawApply(amount: number, bank_id: number) {
return http.Post('/storeapi/user/submitReflect', { store_id, amount, bank_id }) return http.Post('/teamapi/user/submitReflect', { amount, bank_id })
} }

View File

@ -50,7 +50,7 @@ export interface TeaSpecialistOrderListParams {
size: number size: number
order_status?: string order_status?: string
search?: string search?: string
day_time?: string is_time?: number
} }
export function getTeaSpecialistOrderList(data: TeaSpecialistOrderListParams) { export function getTeaSpecialistOrderList(data: TeaSpecialistOrderListParams) {
@ -126,3 +126,17 @@ export function deleteTeaSpecialistOrder(id: number) {
export function getTeaSpecialistCostDetails(id: number) { export function getTeaSpecialistCostDetails(id: number) {
return http.Post<any>('/teamapi/order/amountDetails', {id}) return http.Post<any>('/teamapi/order/amountDetails', {id})
} }
/**
* 流水明细详情
*/
export function getTeaSpecialistBillDetails(id: number) {
return http.Post<any>('/teamapi/user/accounDetails', { id })
}
/**
* 茶艺师拒绝接单
*/
export function refuseTeaSpecialistOrder(id: number) {
return http.Post<any>('/teamapi/order/orderCancel', { id })
}

View File

@ -53,10 +53,10 @@ export function getUserTransactionDetails(data: IGetUserTransactionDetailsParams
} }
/** /**
* 获取流水明细详情(账单明细) * 获取流水明细详情(提现明细)
*/ */
export function getUserTransactionDetailsInfo(id: number) { export function getUserTransactionDetailsInfo(id: number) {
return http.Post<any>('/teamapi/user/balanceLogDetails', { id }) return http.Post<any>('/teamapi/user/reflectDetails', { id })
} }
/** /**

View File

@ -9,7 +9,7 @@
</route> </route>
<template> <template>
<view class="pb-48rpx"> <view class="pb-48rpx mt-40rpx">
<!-- 删除确认框 --> <!-- 删除确认框 -->
<wd-message-box selector="wd-message-box-slot"></wd-message-box> <wd-message-box selector="wd-message-box-slot"></wd-message-box>

View File

@ -12,7 +12,7 @@
<view> <view>
<view class="mt-76rpx"> <view class="mt-76rpx">
<!-- 进度1-平台审核中 --> <!-- 进度1-平台审核中 -->
<view class="mx-98rpx flex" v-if="billDetails.order.status == 0"> <view class="mx-98rpx flex" v-if="billDetails.status == 0">
<view class="mr-44rpx"> <view class="mr-44rpx">
<wd-img width="40rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image1.png`"></wd-img> <wd-img width="40rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image1.png`"></wd-img>
</view> </view>
@ -20,11 +20,11 @@
<view> <view>
<view class="font-400 text-#606266"> <view class="font-400 text-#606266">
<view class="text-26rpx leading-36rpx">发起提现申请</view> <view class="text-26rpx leading-36rpx">发起提现申请</view>
<view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.order.dtime }}</view> <view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.dtime }}</view>
</view> </view>
<view class="font-400 text-#606266 mt-26rpx"> <view class="font-400 text-#606266 mt-26rpx">
<view class="text-30rpx leading-42rpx">平台审核中</view> <view class="text-30rpx leading-42rpx">平台审核中</view>
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.dtime }}</view> <view class="mt-10rpx text-26rpx leading-36rpx">提起申请后3日内完成审核</view>
</view> </view>
<view class="mt-44rpx font-400 text-26rpx leading-36rpx text-#BFC2CC"> <view class="mt-44rpx font-400 text-26rpx leading-36rpx text-#BFC2CC">
到账成功 到账成功
@ -33,7 +33,7 @@
</view> </view>
<!-- 进度2-到账成功 --> <!-- 进度2-到账成功 -->
<view class="mx-98rpx flex" v-if="billDetails.order.status == 1"> <view class="mx-98rpx flex" v-if="billDetails.status == 1">
<view class="mr-44rpx"> <view class="mr-44rpx">
<wd-img width="22rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image2.png`"></wd-img> <wd-img width="22rpx" height="260rpx" :src="`${OSS}images/withdraw/withdraw_image2.png`"></wd-img>
</view> </view>
@ -41,15 +41,15 @@
<view> <view>
<view class="font-400 text-#606266"> <view class="font-400 text-#606266">
<view class="text-26rpx leading-36rpx">发起提现申请</view> <view class="text-26rpx leading-36rpx">发起提现申请</view>
<view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.order.dtime }}</view> <view class="mt-8rpx text-24rpx leading-34rpx">{{ billDetails.dtime }}</view>
</view> </view>
<view class="font-400 text-#606266 mt-26rpx"> <view class="font-400 text-#606266 mt-26rpx">
<view class="text-30rpx leading-42rpx">平台审核中</view> <view class="text-30rpx leading-42rpx">平台审核中</view>
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.dtime }}</view> <view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.dtime }}</view>
</view> </view>
<view class="mt-44rpx font-400 text-30rpx leading-44rpx"> <view class="mt-44rpx font-400 text-30rpx leading-44rpx">
<view>到账成功</view> <view>{{ billDetails.status == 1 ? '到账成功' : '审核未通过' }}</view>
<view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.order.update_dtime }}</view> <view class="mt-10rpx text-26rpx leading-36rpx">{{ billDetails.update_dtime }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -61,11 +61,11 @@
<view class="mx-60rpx"> <view class="mx-60rpx">
<view class="flex items-center justify-between font-400 text-28rpx leading-40rpx"> <view class="flex items-center justify-between font-400 text-28rpx leading-40rpx">
<view class="text-#606266">提现金额</view> <view class="text-#606266">提现金额</view>
<view class="text-#303133">{{ billDetails.order.amount }}</view> <view class="text-#303133">{{ billDetails.amount }}</view>
</view> </view>
<view class="flex items-center justify-between font-400 text-28rpx leading-40rpx"> <view class="flex items-center justify-between font-400 text-28rpx leading-40rpx">
<view class="text-#606266">到账银行卡</view> <view class="text-#606266">到账银行卡</view>
<view class="text-#303133">{{ billDetails.order.bank_name }}{{ Progress.handleFormatBankCardNumber(billDetails.order.bank_card) }})</view> <view class="text-#303133">{{ billDetails.bank_name }}{{ Progress.handleFormatBankCardNumber(billDetails.bank_card) }})</view>
</view> </view>
</view> </view>
@ -101,7 +101,7 @@
onLoad(async (args) => { onLoad(async (args) => {
id.value = Number(args.id) || 0 id.value = Number(args.id) || 0
const res = await getUserTransactionDetailsInfo(id.value) const res = await getUserTransactionDetailsInfo(id.value)
billDetails.value = res.details billDetails.value = res
console.log("🚀 ~ billDetails.value:", billDetails.value) console.log("🚀 ~ billDetails.value:", billDetails.value)
}) })

View File

@ -88,11 +88,11 @@
</view> </view>
<view class="mt-26rpx text-26rpx leading-36rpx mx-70rpx"> <view class="mt-26rpx text-26rpx leading-36rpx mx-70rpx">
<text class="text-#606266 mr-20rpx">可提现{{ useStore.userMoney }}</text> <text class="text-#606266 mr-20rpx">可提现{{ userInfo.user_money }}</text>
<text class="text-#4C9F44" @click="Withdraw.handleWithdrawAll">全部提现</text> <text class="text-#4C9F44" @click="Withdraw.handleWithdrawAll">全部提现</text>
</view> </view>
<view class="mx-48rpx h-90rpx leading-90rpx rounded-8rpx text-center mt-112rpx text-[#fff]" :class="withdrawMoney > 0 ? 'bg-[#4C9F44]' : 'bg-[#A5CFA1]'" @click="Withdraw.handleConfirmwithdrawMoney">确定</view> <view class="mx-48rpx h-90rpx leading-90rpx rounded-8rpx text-center mt-112rpx text-[#fff]" :class="withdrawMoney != '' ? 'bg-[#4C9F44]' : 'bg-[#A5CFA1]'" @click="Withdraw.handleConfirmwithdrawMoney">确定</view>
</view> </view>
</view> </view>
</template> </template>
@ -129,7 +129,22 @@
height: 'calc(100vh - var(--window-top) - var(--window-bottom))' height: 'calc(100vh - var(--window-top) - var(--window-bottom))'
})) }))
// 用户信息
const userInfo = ref({
avatar: '',
nickname: '',
account: '',
user_money: 0,
no_reflect_amount: 0,
work: '',
address: '',
work_time: '',
is_mileage: 0,
cert_id: 0,
})
onShow(() => { onShow(() => {
Withdraw.handleGetUserInfo()
Withdraw.getBankCardList() Withdraw.getBankCardList()
}) })
@ -142,6 +157,14 @@
bankList.value = res.list bankList.value = res.list
}, },
/**
* 获取个人信息
*/
handleGetUserInfo: async () => {
const res = await getUserInfo()
userInfo.value = res
},
/** /**
* 格式化银行卡号 * 格式化银行卡号
* @ param bankCardNumber 银行卡号 * @ param bankCardNumber 银行卡号
@ -167,12 +190,12 @@
* 全部提现 * 全部提现
*/ */
handleWithdrawAll: async () => { handleWithdrawAll: async () => {
if (useStore.userMoney <= 0) { if (userInfo.value.user_money <= 0) {
toast.info('暂无可提现金额') toast.info('暂无可提现金额')
return return
} }
withdrawMoney.value = String(useStore.userMoney) withdrawMoney.value = String(userInfo.value.user_money)
}, },
/** /**
@ -195,7 +218,7 @@
return return
} }
if (money > useStore.userMoney) { if (money > userInfo.value.user_money) {
toast.info('提现金额不能大于可提现金额') toast.info('提现金额不能大于可提现金额')
return return
} }
@ -204,14 +227,11 @@
title: '提交中...' title: '提交中...'
}) })
try { try {
await withdrawApply(store.defaultStore.id, money, selectBank.value.id) await withdrawApply(money, selectBank.value.id)
// 重新获取用户余额
const balance = await getUserInfo()
useStore.setUserMoney(Number(balance.user_money))
uni.hideLoading uni.hideLoading
toast.success('提现申请提交成功') toast.success('提现申请提交成功')
Withdraw.handleGetUserInfo()
uni.$emit('refreshWalletPage') uni.$emit('refreshWalletPage')
router.navigateBack(1, 500) router.navigateBack(1, 500)
} catch (error) { } catch (error) {

View File

@ -10,33 +10,33 @@
<template> <template>
<view class=""> <view class="">
<!-- 修改昵称 --> <!-- 修改姓名 -->
<wd-popup v-model="showEditNicknamePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom"> <wd-popup v-model="showEditNicknamePopup" lock-scroll custom-style="border-radius: 32rpx 32rpx 0rpx 0rpx;" position="bottom">
<view class="relative pb-56rpx"> <view class="relative pb-56rpx">
<view class="absolute top-18rpx right-30rpx" @click="showEditNicknamePopup = false"> <view class="absolute top-18rpx right-30rpx" @click="showEditNicknamePopup = false">
<wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img> <wd-img width="60rpx" height='60rpx' :src="`${OSS}icon/icon_close.png`"></wd-img>
</view> </view>
<view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">修改昵称</view> <view class="text-36rpx text-[#121212] leading-50rpx text-center pt-50rpx pb-40rpx">修改姓名</view>
<view class="mt-70rpx mx-48rpx"> <view class="mt-70rpx mx-48rpx">
<wd-input <wd-input
clearable clearable
type="text" type="text"
placeholder="请输入昵称" placeholder="请输入姓名"
v-model="nickname" v-model="nickname"
no-border no-border
custom-class="!bg-[#F6F7F8] !rounded-16rpx !text-30rpx !leading-48rpx" custom-class="!bg-[#F6F7F8] !rounded-16rpx !text-30rpx !leading-48rpx"
custom-input-class="!h-104rpx !pl-60rpx"> custom-input-class="!h-104rpx !pl-60rpx">
<template #prefix> <template #prefix>
<view class="ml-30rpx font-bold text-30rpx leading-48rpx text-[#303133]"> <view class="ml-30rpx font-bold text-30rpx leading-48rpx text-[#303133]">
昵称 姓名
</view> </view>
</template> </template>
</wd-input> </wd-input>
</view> </view>
<view class="mt-22rpx text-26rpx leading-36rpx text-[#909399] mx-48rpx">昵称限制1-10字符一个汉字为一个字符</view> <view class="mt-22rpx text-26rpx leading-36rpx text-[#909399] mx-48rpx">姓名限制1-10字符一个汉字为一个字符</view>
<view class="mx-48rpx h-90rpx leading-90rpx rounded-8rpx text-center mt-112rpx text-[#fff]" :class="nickname ? 'bg-[#4C9F44]' : 'bg-[#A5CFA1]'" @click="Profile.handleSaveNickname">保存</view> <view class="mx-48rpx h-90rpx leading-90rpx rounded-8rpx text-center mt-112rpx text-[#fff]" :class="nickname ? 'bg-[#4C9F44]' : 'bg-[#A5CFA1]'" @click="Profile.handleSaveNickname">保存</view>
</view> </view>
@ -85,9 +85,9 @@
</view> </view>
</view> </view>
<!-- 昵称 --> <!-- 姓名 -->
<view class="flex justify-between items-center mb-54rpx" @click="showEditNicknamePopup = true"> <view class="flex justify-between items-center mb-54rpx" @click="showEditNicknamePopup = true">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx">昵称</view> <view class="font-400 text-[#303133] text-30rpx leading-42rpx">姓名</view>
<view class="flex justify-end"> <view class="flex justify-end">
<view class="flex items-center"> <view class="flex items-center">
<view class="font-400 text-[#303133] text-30rpx leading-42rpx"> <view class="font-400 text-[#303133] text-30rpx leading-42rpx">
@ -153,9 +153,9 @@
const fileList = ref<any[]>([]) const fileList = ref<any[]>([])
const action = import.meta.env.VITE_UPLOAD_BASEURL const action = import.meta.env.VITE_UPLOAD_BASEURL
// 修改昵称 // 修改姓名
const showEditNicknamePopup = ref<boolean>(false) // 是否显示退款详情弹出框 const showEditNicknamePopup = ref<boolean>(false) // 是否显示退款详情弹出框
const nickname = ref<string>('') // 昵称 const nickname = ref<string>('') // 姓名
// 用户信息相关 // 用户信息相关
const user = ref<IUserResult>({ const user = ref<IUserResult>({
@ -215,18 +215,18 @@
}, },
/** /**
* 保存昵称 * 保存姓名
*/ */
handleSaveNickname: async () => { handleSaveNickname: async () => {
if (!nickname.value) { if (!nickname.value) {
toast.info('请输入昵称') toast.info('请输入姓名')
return return
} }
await updateUserNickname(nickname.value) await updateUserNickname(nickname.value)
showEditNicknamePopup.value = false showEditNicknamePopup.value = false
user.value.nickname = nickname.value user.value.nickname = nickname.value
toast.info('昵称修改成功') toast.info('姓名修改成功')
}, },
/** /**

View File

@ -15,17 +15,15 @@
<!-- 订单详情 --> <!-- 订单详情 -->
<view class="mt-28rpx mx-32rpx bg-white rounded-16rpx py-30rpx relative"> <view class="mt-28rpx mx-32rpx bg-white rounded-16rpx py-30rpx relative">
<view class="absolute top-0 right-38rpx"> <view class="absolute top-0 right-38rpx">
<!-- change_type: 1包间预定 2包间续订 3提现 4团购核销 --> <!-- change_type: 1.预定2.续时3.续茶4.退款5.提现-->
<wd-img v-if="billDetails.change_type == 1" width="112rpx" height="112rpx" :src="`${OSS}images/store/bill/image1.png`" <wd-img v-if="billDetails.change_type == 1" width="112rpx" height="112rpx" :src="`${OSS}images/store/bill/image1.png`"
mode="aspectFill" /> mode="aspectFill" />
<wd-img v-if="billDetails.change_type == 2" width="112rpx" height="112rpx" :src="`${OSS}images/store/bill/image2.png`" <wd-img v-if="billDetails.change_type == 2" width="112rpx" height="112rpx" :src="`${OSS}images/store/bill/image2.png`"
mode="aspectFill" /> mode="aspectFill" />
<wd-img v-if="billDetails.change_type == 4" width="112rpx" height="112rpx" :src="`${OSS}images/store/bill/image3.png`"
mode="aspectFill" />
</view> </view>
<view class="flex items-center"> <view class="flex items-center">
<view class="w-8rpx h-32rpx bg-[#4C9F44] mr-22rpx"></view> <view class="w-8rpx h-32rpx bg-[#4C9F44] mr-22rpx"></view>
<view class="font-bold text-28rpx leading-40rpx text-[#303133]">订单号{{ billDetails.order.order_sn }}</view> <view class="font-bold text-28rpx leading-40rpx text-[#303133]">订单号{{ billDetails.source_sn }}</view>
</view> </view>
<view class="mt-38rpx text-center"> <view class="mt-38rpx text-center">
@ -39,20 +37,20 @@
<view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx"> <view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx">
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>消费类型</view> <view class="w-150rpx">消费类型</view>
<view>{{ Bill.handleMapTransactionType(billDetails.change_type) }}</view> <view>{{ Bill.handleMapTransactionType(billDetails.change_type) }}</view>
</view> </view>
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>交易方式</view> <view class="w-150rpx">交易方式</view>
<view>{{ PayWayText[billDetails.order.pay_way] }}</view> <view>{{ billDetails.pay_way_title }}</view>
</view> </view>
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>消费金额</view> <view class="w-150rpx">实际收入</view>
<view>{{ billDetails.amount }}</view> <view>{{ billDetails.amount }}</view>
</view> </view>
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>平台服务费</view> <view class="w-150rpx">用户备注</view>
<view>{{ billDetails.service_price }}</view> <view class="w-400rpx text-right">{{ billDetails.remark }}</view>
</view> </view>
</view> </view>
@ -61,16 +59,11 @@
<view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx"> <view class="text-28rpx leading-40rpx text-[#606266] mx-28rpx">
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>用户名</view> <view>用户名</view>
<view>{{ billDetails.order.nickname }}</view> <view>{{ billDetails.user_name }}</view>
</view>
<!-- 如果是茶室预定类型则显示消费门店 -->
<view class="flex justify-between items-center mb-16rpx">
<view>用户手机号</view>
<view>{{ billDetails.order.mobile }}</view>
</view> </view>
<view class="flex justify-between items-center mb-16rpx"> <view class="flex justify-between items-center mb-16rpx">
<view>支付时间</view> <view>支付时间</view>
<view>{{ billDetails.order.update_dtime }}</view> <view>{{ billDetails.create_time}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -79,7 +72,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { getUserTransactionDetailsInfo } from '@/api/user' import { getTeaSpecialistBillDetails } from '@/api/tes-specialist'
import { PayWayText } from '@/utils/pay' import { PayWayText } from '@/utils/pay'
const OSS = inject('OSS') const OSS = inject('OSS')
@ -96,14 +89,14 @@
nickname: '', nickname: '',
mobile: '', mobile: '',
update_dtime: '', update_dtime: '',
service_price: '' remark: '', // 用户备注
} }
}) })
onLoad(async (args) => { onLoad(async (args) => {
id.value = Number(args.id) || 0 id.value = Number(args.id) || 0
const res = await getUserTransactionDetailsInfo(id.value) const res = await getTeaSpecialistBillDetails(id.value)
billDetails.value = res.details billDetails.value = res
console.log("🚀 ~ billDetails.value:", billDetails.value) console.log("🚀 ~ billDetails.value:", billDetails.value)
}) })

View File

@ -232,7 +232,7 @@
*/ */
handleToBillDetail: (item: {id: number, change_type: number}) => { handleToBillDetail: (item: {id: number, change_type: number}) => {
// change_type: 1.预定2.续时3.续茶4.退款5.提现 // change_type: 1.预定2.续时3.续茶4.退款5.提现
if (item.change_type === 3) { if (item.change_type === 5) {
router.navigateTo(`/bundle/parten/pages/withdraw/progress?id=${item.id}`) router.navigateTo(`/bundle/parten/pages/withdraw/progress?id=${item.id}`)
return return
} else { } else {

View File

@ -5,9 +5,8 @@ import {
arriveTeaSpecialistOrder, arriveTeaSpecialistOrder,
checkInTeaSpecialistOrder, checkInTeaSpecialistOrder,
completeTeaSpecialistOrder, completeTeaSpecialistOrder,
deleteTeaSpecialistOrder } from '@/api/tes-specialist' deleteTeaSpecialistOrder,
import { l } from 'vite/dist/node/types.d-aGj9QkWt' refuseTeaSpecialistOrder } from '@/api/tes-specialist'
/** /**
* 茶艺师接单 * 茶艺师接单
@ -94,3 +93,17 @@ export async function handleDeleteOrderHooks(id: number) {
return false return false
} }
} }
/**
* 拒绝接单
* @param id 订单ID
*/
export async function handleRefuseOrderHooks(id: number) {
try {
await refuseTeaSpecialistOrder(id)
return true
}
catch (error) {
return false
}
}

20
src/hooks/useShare.ts Normal file
View File

@ -0,0 +1,20 @@
export default function useShare() {
const miniShareOptions = reactive({
// 分享标题
title: '',
//页面 path不建议直接配置分享哪个页面就配置哪个页面的路径有些页面不建议分享如订单页所以默认都是分享首页
path: '/pages/index/index',
// 分享图标路径可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4
imageUrl: '',
})
return {
// 发送给朋友
onShareAppMessage() {
return {
...miniShareOptions,
}
}
}
}

View File

@ -4,6 +4,7 @@ import App from './App.vue'
import { routeInterceptor } from './router/interceptor' import { routeInterceptor } from './router/interceptor'
import { requestInterceptor } from './http/interceptor' import { requestInterceptor } from './http/interceptor'
import NavBar from '@/components/Navbar.vue' import NavBar from '@/components/Navbar.vue'
import useShare from '@/hooks/useShare'
import store from './store' import store from './store'
import '@/style/index.scss' import '@/style/index.scss'
@ -25,6 +26,8 @@ export function createApp() {
app.provide('navbarHeight', getNavBarHeight()) app.provide('navbarHeight', getNavBarHeight())
app.provide('capsuleOffset', getCapsuleOffset()) app.provide('capsuleOffset', getCapsuleOffset())
app.mixin(useShare())
return { return {
app, app,
} }

View File

@ -417,7 +417,7 @@
page: 1, page: 1,
size: 10, size: 10,
order_status: `${TeaSpecialistOrderStatus.Pending}, ${TeaSpecialistOrderStatus.Accepted}, ${TeaSpecialistOrderStatus.Departed}, ${TeaSpecialistOrderStatus.Arrived}, ${TeaSpecialistOrderStatus.Completed}`, // 只获取待服务、已接单和服务中的订单 order_status: `${TeaSpecialistOrderStatus.Pending}, ${TeaSpecialistOrderStatus.Accepted}, ${TeaSpecialistOrderStatus.Departed}, ${TeaSpecialistOrderStatus.Arrived}, ${TeaSpecialistOrderStatus.Completed}`, // 只获取待服务、已接单和服务中的订单
day_time: getCurrentDate(), // 获取当前日期 is_time: 1, // 查看今日订单
} }
const res = await getTeaSpecialistOrderList(filter) const res = await getTeaSpecialistOrderList(filter)

View File

@ -379,6 +379,17 @@
// 跳转到行程记录页面 // 跳转到行程记录页面
// 如过cer // 如过cer
router.navigateTo('/pages/my/travel-record') router.navigateTo('/pages/my/travel-record')
} else if (type === 'distribution') {
uni.navigateToMiniProgram({
appId: 'wxa184cbbc1bbe7621',
path: 'pages/index/index', // 可选,跳转的页面路径
success(res) {
console.log('打开成功', res);
},
fail(err) {
console.error('打开失败', err);
}
})
} }
else { else {
// TODO: 根据类型跳转到对应页面 // TODO: 根据类型跳转到对应页面

View File

@ -20,10 +20,10 @@
<text class="ml-8rpx text-32rpx text-[#FF0000] leading-44rpx">*</text> <text class="ml-8rpx text-32rpx text-[#FF0000] leading-44rpx">*</text>
</view> </view>
<!-- 姓名 --> <!-- 昵称 -->
<view class="form-item mb-24rpx"> <view class="form-item mb-24rpx">
<text class="label-text mb-12rpx block text-28rpx text-[#303133] leading-40rpx">姓名</text> <text class="label-text mb-12rpx block text-28rpx text-[#303133] leading-40rpx">昵称</text>
<wd-input v-model="formData.name" type="text" placeholder="请填写姓名" no-border <wd-input v-model="formData.name" type="text" placeholder="请填写昵称" no-border
custom-class="!bg-[#F5F7FA] !rounded-16rpx" custom-class="!bg-[#F5F7FA] !rounded-16rpx"
custom-input-class="!h-88rpx !px-24rpx !text-28rpx" /> custom-input-class="!h-88rpx !px-24rpx !text-28rpx" />
</view> </view>
@ -97,7 +97,7 @@
no-border no-border
placeholder="茶艺: 你的茶艺兴趣爱好是什么? 比如茶艺研究、品鉴、茶道美学......快来分享一下吧!" placeholder="茶艺: 你的茶艺兴趣爱好是什么? 比如茶艺研究、品鉴、茶道美学......快来分享一下吧!"
custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA] !mt-20rpx' custom-class='!rounded-18rpx !border-2rpx !border-[#EFF0EF] !bg-[#F8F9FA] !mt-20rpx'
custom-textarea-class='!bg-[#F8F9FA] !min-h-[200rpx] !px-24rpx !py-24rpx' /> custom-textarea-class='!bg-[#F8F9FA] !min-h-[100rpx] !px-24rpx !py-24rpx' />
</view> </view>
<!-- 视频信息 --> <!-- 视频信息 -->
@ -301,7 +301,7 @@
}) })
if (!formData.value.name) { if (!formData.value.name) {
toast.show('请填写姓名') toast.show('请填写昵称')
return false return false
} }

View File

@ -462,7 +462,8 @@
handleArriveOrderHooks, handleArriveOrderHooks,
handleTeaSpecialistClockInHooks, handleTeaSpecialistClockInHooks,
handleCompleteOrderHooks, handleCompleteOrderHooks,
handleDeleteOrderHooks handleDeleteOrderHooks,
handleRefuseOrderHooks
} from '@/hooks/useOrder' } from '@/hooks/useOrder'
const OSS = inject('OSS') const OSS = inject('OSS')
@ -483,7 +484,6 @@
// 订单备注 // 订单备注
const showOrderMarksPopup = ref<boolean>(false) const showOrderMarksPopup = ref<boolean>(false)
const mark = ref<string>('')
// 订单记录 // 订单记录
const showOrderRecordsPopup = ref<boolean>(false) const showOrderRecordsPopup = ref<boolean>(false)
@ -530,37 +530,6 @@
img_time: '', // 到达打卡时间 img_time: '', // 到达打卡时间
}) })
// 放弃接单
function handleDecline() {
message.confirm({
title: '确定放弃接单?',
msg: '放弃接单后无法恢复,确认放弃吗?',
confirmButtonText: '确定',
cancelButtonText: '取消',
cancelButtonProps: {
customClass: '!bg-[#F6F7F8] !text-[#303133] !text-32rpx !leading-44rpx !rounded-8rpx',
},
confirmButtonProps: {
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
},
}).then((res) => {
if (res.action === 'confirm') {
// TODO: 调用放弃接单的 API
console.log('确认放弃接单')
uni.showToast({
title: '放弃接单成功',
icon: 'success',
})
// 可以返回上一页
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
}).catch(() => {
console.log('取消放弃接单')
})
}
onLoad(async (args) => { onLoad(async (args) => {
orderId.value = args.orderId orderId.value = args.orderId
await Detail.handleInit() await Detail.handleInit()
@ -647,9 +616,15 @@
confirmButtonProps: { confirmButtonProps: {
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx', customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
} }
}).then((res) => { }).then(async (res) => {
if (res.action == 'confirm') { if (res.action === 'confirm') {
// TODO 这里需要获取经纬度 toast.loading('加载中...')
const res = await handleRefuseOrderHooks(order.value.id)
toast.close()
if (res) {
Detail.handleInit()
}
} }
}).catch(() => { }).catch(() => {
// 点击取消按钮回调事件 // 点击取消按钮回调事件
@ -822,8 +797,8 @@
*/ */
handleNavigate: () => { handleNavigate: () => {
uni.openLocation({ uni.openLocation({
latitude: order.value.latitude, latitude: Number(order.value.latitude),
longitude: order.value.longitude, longitude: Number(order.value.longitude),
name: order.value.title, name: order.value.title,
address: order.value.address, address: order.value.address,
}) })

View File

@ -114,11 +114,10 @@
import type { ITeaSpecialistOrderDetailsResult } from '@/api/types/tea' import type { ITeaSpecialistOrderDetailsResult } from '@/api/types/tea'
import { copy } from '@/utils/tools' import { copy } from '@/utils/tools'
import { getOrderStoreDetail } from '@/api/order' import { getOrderStoreDetail } from '@/api/order'
import { TeaSpecialistManageOrderStatusText, TeaSpecialistOrderStatus, TeaSpecialistManageStatusTextValue } from '@/utils/teaSpecialistOrder'
const title = ref<string>('') const title = ref<string>('')
// 取消订单弹窗 // 取消订单弹窗
const message = useMessage('wd-message-box-slot') const message = useMessage('wd-message-box-slot')
@ -184,7 +183,7 @@
handleInit: async () => { handleInit: async () => {
const res = await getOrderStoreDetail(orderId.value) const res = await getOrderStoreDetail(orderId.value)
order.value = res.details order.value = res.details
title.value = AdminOrderStatusTextValue[order.value.order_status].title || '订单详情' title.value = TeaSpecialistManageStatusTextValue[order.value.order_status].pageTitle || '订单详情'
}, },
/** /**

View File

@ -109,7 +109,7 @@
import { TeaSpecialistManageOrderStatusText, TeaSpecialistOrderStatus, TeaSpecialistManageStatusTextValue } from '@/utils/teaSpecialistOrder' import { TeaSpecialistManageOrderStatusText, TeaSpecialistOrderStatus, TeaSpecialistManageStatusTextValue } from '@/utils/teaSpecialistOrder'
import { getTeaSpecialistOrderList } from '@/api/tes-specialist' import { getTeaSpecialistOrderList } from '@/api/tes-specialist'
import { handleGetLocationFallback } from '@/hooks/useLocation' import { handleGetLocationFallback } from '@/hooks/useLocation'
import { handleReleaseOrderHooks, handleDepartOrderHooks, handleArriveOrderHooks, handleCompleteOrderHooks, handleDeleteOrderHooks } from '@/hooks/useOrder' import { handleReleaseOrderHooks, handleDepartOrderHooks, handleArriveOrderHooks, handleCompleteOrderHooks, handleDeleteOrderHooks, handleRefuseOrderHooks } from '@/hooks/useOrder'
const OSS = inject('OSS') const OSS = inject('OSS')
const toast = useToast() const toast = useToast()
@ -148,7 +148,8 @@
page: mescroll.num, page: mescroll.num,
size: mescroll.size, size: mescroll.size,
order_status: orderStatus.value, order_status: orderStatus.value,
search: keywords.value search: keywords.value,
is_time: 0
} }
getTeaSpecialistOrderList(filter).then((res) => { getTeaSpecialistOrderList(filter).then((res) => {
@ -275,9 +276,15 @@
confirmButtonProps: { confirmButtonProps: {
customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx', customClass: '!bg-[#4C9F44] !text-[#fff] !text-32rpx !leading-44rpx !rounded-8rpx',
}, },
}).then((res) => { }).then(async (res) => {
if (res.action === 'confirm') { if (res.action === 'confirm') {
toast.show('已放弃接单') toast.loading('加载中...')
const res = await handleRefuseOrderHooks(order.id)
toast.close()
if (res) {
Order.handleSearch()
}
} }
}).catch(() => {}) }).catch(() => {})
break break
@ -352,7 +359,7 @@
break break
case 'complete': case 'complete':
toast.loading('加载中...') toast.loading('加载中...')
const res = await handleCompleteOrderHooks(order.value.id) const res = await handleCompleteOrderHooks(order.id)
toast.close() toast.close()
if (res) { if (res) {
Order.handleSearch() Order.handleSearch()
@ -374,15 +381,15 @@
}).then(async (res) => { }).then(async (res) => {
if (res.action === 'confirm') { if (res.action === 'confirm') {
toast.loading('加载中...') toast.loading('加载中...')
const res = await handleDeleteOrderHooks(order.value.id) const res = await handleDeleteOrderHooks(order.id)
toast.close() toast.close()
if (res) { if (res) {
Order.handleSearch() Order.handleSearch()
} }
} }
}).catch(() => { }).catch((err) => {
// 点击取消按钮 // 点击取消按钮
console.log('取消删除订单') console.log('取消删除订单', err)
}) })
break break
} }
@ -425,11 +432,6 @@
height: 100%; height: 100%;
} }
// .order-page {
// display: flex;
// flex-direction: column;
// }
.order-header { .order-header {
position: sticky; position: sticky;
top: 0; top: 0;