update
|
|
@ -16,4 +16,27 @@ export const orderPay = data =>
|
||||||
* @description 获取订单信息
|
* @description 获取订单信息
|
||||||
*/
|
*/
|
||||||
export const orderInfo = params =>
|
export const orderInfo = params =>
|
||||||
request.get('/order/infomation', params)
|
request.get('/order/infomation', params)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取取消原因列表
|
||||||
|
*/
|
||||||
|
export const reasonList = params =>
|
||||||
|
request.get('/reason/list', params)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取订单列表
|
||||||
|
*/
|
||||||
|
export const orderList = data =>
|
||||||
|
request.post('/order/orderList', data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 取消订单
|
||||||
|
*/
|
||||||
|
export const cancelOrder = data =>
|
||||||
|
request.post('/order/cancelOrder', data)
|
||||||
|
/**
|
||||||
|
* @description 申请退款
|
||||||
|
*/
|
||||||
|
export const orderRefund = data =>
|
||||||
|
request.post('/refound', data)
|
||||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
|
@ -52,6 +52,7 @@ const handleAgree = () => {
|
||||||
$Router.push({ path: '/pages/statement/index' })
|
$Router.push({ path: '/pages/statement/index' })
|
||||||
}
|
}
|
||||||
const handleAgreeCheck = () => {
|
const handleAgreeCheck = () => {
|
||||||
|
if (prop.disabled) return
|
||||||
checked.value[0] = checked.value[0] === '1' ? '' : '1'
|
checked.value[0] = checked.value[0] === '1' ? '' : '1'
|
||||||
emit('update:agreed', !!checked.value[0])
|
emit('update:agreed', !!checked.value[0])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
:safeAreaInsetBottom="true"
|
:safeAreaInsetBottom="true"
|
||||||
:fixed="true"
|
:fixed="true"
|
||||||
:border="false"
|
:border="false"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
>
|
>
|
||||||
<block v-for="item in tabbarList" :key="item.path">
|
<block v-for="item in tabbarList" :key="item.path">
|
||||||
<u-tabbar-item
|
<u-tabbar-item
|
||||||
|
|
@ -34,70 +34,68 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
uni.hideTabBar()
|
uni.hideTabBar()
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
const { $assets,$Router,$Route,$store } = instance.proxy
|
const { $assets, $Router, $Route, $store } = instance.proxy
|
||||||
const tabbarList = ref([])
|
const tabbarList = ref([])
|
||||||
const List = {
|
const List = {
|
||||||
simple: [
|
simple: [
|
||||||
{
|
{
|
||||||
text: '首页',
|
text: '首页',
|
||||||
icon: '/tabbar/home.png',
|
icon: '/tabbar/home.png',
|
||||||
activeIcon: '/tabbar/home-sel.png',
|
activeIcon: '/tabbar/home-sel.png',
|
||||||
path: '/pages/index/home/index',
|
path: '/pages/index/home/index',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '订单',
|
text: '订单',
|
||||||
icon: '/tabbar/order.png',
|
icon: '/tabbar/order.png',
|
||||||
activeIcon: '/tabbar/order-sel.png',
|
activeIcon: '/tabbar/order-sel.png',
|
||||||
path: '/pages/index/order/index',
|
path: '/pages/index/order/index',
|
||||||
name: 'order',
|
name: 'order',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '我的',
|
text: '我的',
|
||||||
icon: '/tabbar/my.png',
|
icon: '/tabbar/my.png',
|
||||||
activeIcon: '/tabbar/my-sel.png',
|
activeIcon: '/tabbar/my-sel.png',
|
||||||
path: '/pages/index/personal/index',
|
path: '/pages/index/personal/index',
|
||||||
name: 'personal',
|
name: 'personal',
|
||||||
show: true
|
show: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
common: [
|
common: [
|
||||||
{
|
{
|
||||||
text: '首页',
|
text: '首页',
|
||||||
icon: '/tabbar/order.png',
|
icon: '/tabbar/order.png',
|
||||||
activeIcon: '/tabbar/order-sel.png',
|
activeIcon: '/tabbar/order-sel.png',
|
||||||
path: '/pages/index/order/index',
|
path: '/pages/index/order/index',
|
||||||
name: 'order',
|
name: 'order',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '我的',
|
text: '我的',
|
||||||
icon: '/tabbar/my.png',
|
icon: '/tabbar/my.png',
|
||||||
activeIcon: '/tabbar/my-sel.png',
|
activeIcon: '/tabbar/my-sel.png',
|
||||||
path: '/pages/index/personal/index',
|
path: '/pages/index/personal/index',
|
||||||
name: 'personal',
|
name: 'personal',
|
||||||
show: true
|
show: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeItem = ref()
|
const activeItem = ref($Route.meta.key || 'home')
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
activeItem.value = $Route.meta.key
|
const roleName = $store.user.roleName
|
||||||
const roleName = $store.user.roleName
|
if (activeItem.value === 'home' && roleName === 'common') {
|
||||||
if(activeItem.value === 'home' && roleName === 'common') {
|
activeItem.value = 'order'
|
||||||
activeItem.value = 'order'
|
}
|
||||||
}
|
tabbarList.value = List[roleName]
|
||||||
tabbarList.value = List[roleName]
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.u-tabbar-item__icon {
|
.u-tabbar-item__icon {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
height: 48rpx;
|
height: 48rpx;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@
|
||||||
errorType="toast"
|
errorType="toast"
|
||||||
labelWidth="auto"
|
labelWidth="auto"
|
||||||
>
|
>
|
||||||
|
<!-- :labelStyle="{
|
||||||
|
padding: '12rpx 0'
|
||||||
|
}" -->
|
||||||
<u-form-item
|
<u-form-item
|
||||||
v-for="item in formList"
|
v-for="item in formList"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
|
|
@ -79,7 +82,7 @@
|
||||||
<!-- model[item.key] ? item.type === 'date' ? $u.timeFormat(model[item.key], 'yyyy-mm-dd') : model[item.key] : item.placeholder -->
|
<!-- model[item.key] ? item.type === 'date' ? $u.timeFormat(model[item.key], 'yyyy-mm-dd') : model[item.key] : item.placeholder -->
|
||||||
<view
|
<view
|
||||||
v-else
|
v-else
|
||||||
@click="item.show = true"
|
@click="item.show = current === 1 ? true : false"
|
||||||
class="w-full text-right u-line-1 pl-2"
|
class="w-full text-right u-line-1 pl-2"
|
||||||
:class="item.val ? '' : 'text-#C0C4CC'"
|
:class="item.val ? '' : 'text-#C0C4CC'"
|
||||||
>{{ item.val || item.placeholder }}
|
>{{ item.val || item.placeholder }}
|
||||||
|
|
@ -101,7 +104,7 @@
|
||||||
>
|
>
|
||||||
<upload-img
|
<upload-img
|
||||||
v-model="fileList"
|
v-model="fileList"
|
||||||
:disabled="false"
|
:disabled="current > 1"
|
||||||
:maxCount="10"
|
:maxCount="10"
|
||||||
multiple
|
multiple
|
||||||
></upload-img>
|
></upload-img>
|
||||||
|
|
@ -111,6 +114,7 @@
|
||||||
v-model="model.remark"
|
v-model="model.remark"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
maxlength="300"
|
maxlength="300"
|
||||||
|
:disabled="current > 1"
|
||||||
count
|
count
|
||||||
:autoHeight="false"
|
:autoHeight="false"
|
||||||
/>
|
/>
|
||||||
|
|
@ -123,7 +127,7 @@
|
||||||
3. 服务地点为必填项
|
3. 服务地点为必填项
|
||||||
<br />
|
<br />
|
||||||
</view>
|
</view>
|
||||||
<agreed-comp v-model:agreed="agreed" :disabled="false" />
|
<agreed-comp v-model:agreed="agreed" :disabled="current > 1" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-picker
|
<u-picker
|
||||||
|
|
@ -191,39 +195,50 @@
|
||||||
</view>
|
</view>
|
||||||
<button-contact />
|
<button-contact />
|
||||||
<view
|
<view
|
||||||
|
v-if="!orderInfo.reasonId"
|
||||||
class="bg-#fff h-150rpx w-full sticky bottom-0 z-2 flex justify-between items-center pr-24rpx pl-40rpx pb-48rpx rounded-sm"
|
class="bg-#fff h-150rpx w-full sticky bottom-0 z-2 flex justify-between items-center pr-24rpx pl-40rpx pb-48rpx rounded-sm"
|
||||||
>
|
>
|
||||||
<block v-if="true">
|
<block v-if="orderInfo.status < 3 || !orderId">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-32rpx">¥</text>
|
<text class="text-32rpx">¥</text>
|
||||||
<text class="font-bold text-54rpx">{{ selTypeItem.price || 0 }}</text>
|
<text class="font-bold text-54rpx">{{
|
||||||
|
orderInfo.orderPrice || selTypeItem.price || 0
|
||||||
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
|
v-if="orderInfo.status === 2"
|
||||||
@click="$u.throttle(orderPay, 1000)"
|
@click="$u.throttle(orderPay, 1000)"
|
||||||
class="text-white mr-4 bg-#FF8CA6 rounded-24rpx w-240rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
class="text-white mr-4 bg-#FF8CA6 rounded-24rpx w-240rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
||||||
>支付</view
|
>支付</view
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
|
v-if="!orderId"
|
||||||
@click="$u.throttle(onSubmit, 1000)"
|
@click="$u.throttle(onSubmit, 1000)"
|
||||||
class="text-white bg-#FF8CA6 rounded-24rpx w-240rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
class="text-white bg-#FF8CA6 rounded-24rpx w-240rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
||||||
>立即下单</view
|
>立即下单</view
|
||||||
>
|
>
|
||||||
</block>
|
</block>
|
||||||
<view
|
<view
|
||||||
v-if="false"
|
v-if="roleName === 'common'"
|
||||||
class="text-white bg-#FF8CA6 rounded-24rpx w-full mx-30rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
class="text-white bg-#FF8CA6 rounded-24rpx w-full mx-30rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
||||||
>{{ true ? '开始服务' : '订单已完成,提交工作记录' }}</view
|
>{{ true ? '开始服务' : '订单已完成,提交工作记录' }}</view
|
||||||
>
|
>
|
||||||
|
<view
|
||||||
|
v-if="roleName === 'simple' && orderInfo.status > 2"
|
||||||
|
class="text-white bg-#FF8CA6 rounded-24rpx w-full mx-30rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
||||||
|
>{{
|
||||||
|
orderInfo.status === 3 ? '订单已提交,请耐心等待' : '服务完成,请评价'
|
||||||
|
}}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from '@/utils/uni-router'
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
const { $u, $api, $Router, $dialog, $toast, $store, $loading } = instance.proxy
|
const { $u, $api, $Router, $Route, $dialog, $toast, $store, $loading } =
|
||||||
|
instance.proxy
|
||||||
|
const roleName = $store.user.userInfo.roleName
|
||||||
// 填写订单 在线支付 服务中 服务完成
|
// 填写订单 在线支付 服务中 服务完成
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{ label: '填写订单', id: 1 },
|
{ label: '填写订单', id: 1 },
|
||||||
|
|
@ -263,6 +278,7 @@ const formItems = [
|
||||||
label: '就诊医院',
|
label: '就诊医院',
|
||||||
placeholder: '请选择就诊医院',
|
placeholder: '请选择就诊医院',
|
||||||
key: 'hospitalId',
|
key: 'hospitalId',
|
||||||
|
keyName: 'hospitalName',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
trigger: ['blur', 'change'],
|
trigger: ['blur', 'change'],
|
||||||
|
|
@ -275,6 +291,7 @@ const formItems = [
|
||||||
label: '上门护理',
|
label: '上门护理',
|
||||||
placeholder: '请选择上门护理类型',
|
placeholder: '请选择上门护理类型',
|
||||||
key: 'typeId',
|
key: 'typeId',
|
||||||
|
keyName: 'typeName',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
trigger: ['blur', 'change'],
|
trigger: ['blur', 'change'],
|
||||||
|
|
@ -300,6 +317,7 @@ const formItems = [
|
||||||
label: '报告类型',
|
label: '报告类型',
|
||||||
placeholder: '请选择报告类型',
|
placeholder: '请选择报告类型',
|
||||||
key: 'reportType',
|
key: 'reportType',
|
||||||
|
keyName: 'reportTypeName',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
trigger: ['blur', 'change'],
|
trigger: ['blur', 'change'],
|
||||||
|
|
@ -417,7 +435,7 @@ const formRef = ref(null)
|
||||||
const dateAndSelectFormList = ref()
|
const dateAndSelectFormList = ref()
|
||||||
const formList = ref()
|
const formList = ref()
|
||||||
const model = ref({})
|
const model = ref({})
|
||||||
const curType = ref(route.query.cur ? +route.query.cur : columns[0][0].id)
|
const curType = ref($Route.query.cur ? +$Route.query.cur : columns[0][0].id)
|
||||||
const typeVal = ref('')
|
const typeVal = ref('')
|
||||||
const selTypeItem = ref({})
|
const selTypeItem = ref({})
|
||||||
const rules = ref({})
|
const rules = ref({})
|
||||||
|
|
@ -426,7 +444,7 @@ const hospitalList = ref([])
|
||||||
const serverTypelList = ref([])
|
const serverTypelList = ref([])
|
||||||
const reportTypelList = ref([])
|
const reportTypelList = ref([])
|
||||||
const dateKeyObj = {}
|
const dateKeyObj = {}
|
||||||
const orderId = ref(route.query.id ? +route.query.id : '')
|
const orderId = ref($Route.query.id ? +$Route.query.id : '')
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({})
|
||||||
|
|
||||||
const getPzList = async () => {
|
const getPzList = async () => {
|
||||||
|
|
@ -456,13 +474,16 @@ const getReportTypelList = async () => {
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
const getOrderInfo = async () => {
|
const getOrderInfo = async () => {
|
||||||
// if (!orderId.value) return
|
if (!orderId.value) return
|
||||||
$loading(true)
|
$loading(true)
|
||||||
const res = await $api.orderInfo({ id: orderId.value || 12 })
|
const res = await $api.orderInfo({ id: orderId.value })
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const { order = {} } = res
|
const { order = {} } = res
|
||||||
|
console.log('🚀 ~ file: index.vue:465 ~ order:', order.result)
|
||||||
orderInfo.value = order
|
orderInfo.value = order
|
||||||
curType.value = order.serverId
|
curType.value = order.serverId
|
||||||
|
current.value = order.status || 1
|
||||||
|
agreed.value = true
|
||||||
}
|
}
|
||||||
$loading(false)
|
$loading(false)
|
||||||
}
|
}
|
||||||
|
|
@ -489,11 +510,22 @@ const orderPay = async () => {
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
// 在这里处理支付成功的回调
|
// 在这里处理支付成功的回调
|
||||||
console.log(res)
|
console.log(res)
|
||||||
$toast('支付成功!')
|
$toast('支付成功!', {
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2 * 1000
|
||||||
|
})
|
||||||
|
getOrderInfo()
|
||||||
},
|
},
|
||||||
fail: function (err) {
|
fail: function (err) {
|
||||||
// 处理支付失败的回调
|
// 处理支付失败的回调
|
||||||
console.error(err.errMsg)
|
console.error(err.errMsg)
|
||||||
|
getOrderInfo()
|
||||||
|
if (err.errMsg === 'requestPayment:fail cancel') {
|
||||||
|
$toast('支付取消!', {
|
||||||
|
type: 'error',
|
||||||
|
duration: 2 * 1000
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -545,15 +577,16 @@ const onSubmit = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(curType, () => {
|
watchEffect(() => {
|
||||||
const item = columns[0].find((item) => item.id === curType.value)
|
const cur = curType.value
|
||||||
|
const item = columns[0].find((item) => item.id === cur)
|
||||||
typeVal.value = item?.serveName
|
typeVal.value = item?.serveName
|
||||||
selTypeItem.value = item || {}
|
selTypeItem.value = item || {}
|
||||||
dateAndSelectFormList.value = []
|
dateAndSelectFormList.value = []
|
||||||
formList.value = []
|
formList.value = []
|
||||||
formItems.forEach((item) => {
|
formItems.forEach((item) => {
|
||||||
const { required, key, message, trigger, type } = item
|
const { required, key, keyName, message, trigger, type } = item
|
||||||
if (item.cur.includes(curType.value)) {
|
if (item.cur.includes(cur)) {
|
||||||
if (key === 'hospitalId') item.options = [hospitalList.value]
|
if (key === 'hospitalId') item.options = [hospitalList.value]
|
||||||
if (key === 'typeId') item.options = [serverTypelList.value]
|
if (key === 'typeId') item.options = [serverTypelList.value]
|
||||||
if (key === 'reportType') item.options = [reportTypelList.value]
|
if (key === 'reportType') item.options = [reportTypelList.value]
|
||||||
|
|
@ -562,8 +595,11 @@ watch(curType, () => {
|
||||||
dateAndSelectFormList.value.push(item)
|
dateAndSelectFormList.value.push(item)
|
||||||
}
|
}
|
||||||
rules.value[item.key] = { required, message, trigger }
|
rules.value[item.key] = { required, message, trigger }
|
||||||
if (orderInfo.value.srReport) {
|
if (orderInfo.value.result) {
|
||||||
item.val = model.value[key] = orderInfo.value.srReport[key]
|
item.val = model.value[key] = orderInfo.value.result[key]
|
||||||
|
if (keyName) {
|
||||||
|
item.val = orderInfo.value.result[keyName] || ''
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
model.value[key] = ''
|
model.value[key] = ''
|
||||||
if (type === 'time') model.value[key] = `${new Date().getHours()}:00`
|
if (type === 'time') model.value[key] = `${new Date().getHours()}:00`
|
||||||
|
|
@ -571,10 +607,10 @@ watch(curType, () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (typeof orderInfo.value.srReport?.pictureUrl === 'string') {
|
if (typeof orderInfo.value.result?.pictureUrl === 'string') {
|
||||||
fileList.value = JSON.parse(orderInfo.value.srReport.pictureUrl)
|
fileList.value = JSON.parse(orderInfo.value.result.pictureUrl)
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ file: index.vue:572 ~ model.value:', model.value)
|
model.value.remark = orderInfo.value?.result?.remark || ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleShowPicker = () => {
|
const handleShowPicker = () => {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
<template>
|
<template>
|
||||||
<z-paging-swiper>
|
<z-paging-swiper>
|
||||||
<template #top>
|
<template #top>
|
||||||
<view
|
<view v-if="roleName === 'common'" class="px-24rpx pt-20rpx relative">
|
||||||
v-if="userInfo.roleName === 'common'"
|
|
||||||
class="px-24rpx pt-20rpx relative"
|
|
||||||
>
|
|
||||||
<u--image
|
<u--image
|
||||||
width="100%"
|
width="100%"
|
||||||
height="200rpx"
|
height="200rpx"
|
||||||
|
|
@ -50,65 +48,105 @@
|
||||||
@animationfinish="swiperAnimationfinish"
|
@animationfinish="swiperAnimationfinish"
|
||||||
>
|
>
|
||||||
<swiper-item v-for="(_, index) in list" :key="index">
|
<swiper-item v-for="(_, index) in list" :key="index">
|
||||||
<z-paging
|
<view class="h-full">
|
||||||
:ref="(el) => (paging[index] = el)"
|
<z-paging
|
||||||
v-model="dataList[current]"
|
:ref="(el) => (paging[index] = el)"
|
||||||
@query="queryList"
|
v-if="dataList[index].show"
|
||||||
:min-delay="300"
|
v-model="dataList[index].data"
|
||||||
>
|
@query="queryList"
|
||||||
<view
|
:min-delay="300"
|
||||||
v-for="(item, i) of dataList[current]"
|
|
||||||
:key="i"
|
|
||||||
class="min-h-410rpx bg-white rounded-16rpx mx-30rpx px-20rpx py-30rpx mb-20rpx shadow-current"
|
|
||||||
>
|
>
|
||||||
<view class="flex-row-between">
|
|
||||||
<text class="text-#999 text-24rpx">订单号:22323232323</text>
|
|
||||||
<view
|
|
||||||
class="w-124rpx h-48rpx leading-48rpx text-center rounded-sm text-24rpx"
|
|
||||||
:class="`${stateColorList[status].bg} ${stateColorList[status].color}`"
|
|
||||||
>{{ stateColorList[status].text }}</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
<view class="flex-row-between text-28rpx text-#999 mt-20rpx">
|
|
||||||
<view>服务项目:<text class="text-#000">服务项目</text></view>
|
|
||||||
<view class="text-#FF3939 font-bold">预计收入:¥100</view>
|
|
||||||
</view>
|
|
||||||
<view
|
<view
|
||||||
class="mt-10rpx mb-24rpx flex text-24rpx bg-#f2f2f2 w-full min-h-140rpx rounded-sm px-34rpx pt-20rpx pb-10rpx"
|
v-for="(item, i) of dataList[index].data"
|
||||||
|
:key="i"
|
||||||
|
class="min-h-410rpx bg-white rounded-16rpx mx-30rpx px-20rpx py-30rpx mb-20rpx shadow-current"
|
||||||
>
|
>
|
||||||
<view class="flex flex-col text-#666">
|
<view class="flex-row-between">
|
||||||
<text>就诊人</text>
|
<text class="text-#999 text-24rpx">订单号:22323232323</text>
|
||||||
<text class="text-#000 mt-8rpx">就诊人</text>
|
<view
|
||||||
|
v-if="item.orderStatus !== null"
|
||||||
|
class="w-124rpx h-48rpx leading-48rpx text-center rounded-sm text-24rpx"
|
||||||
|
:class="`${stateColorList[item.orderStatus].bg} ${
|
||||||
|
stateColorList[item.orderStatus].color
|
||||||
|
}`"
|
||||||
|
>{{ stateColorList[item.orderStatus].text }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex flex-col flex-1 pl-40rpx pr-20rpx text-#666">
|
<view class="flex-row-between text-28rpx text-#999 mt-20rpx">
|
||||||
<text>医院</text>
|
<view
|
||||||
<text class="text-#000 mt-8rpx">医院医院医院医院医院</text>
|
>服务项目:<text class="text-#000">{{
|
||||||
|
item.projectName
|
||||||
|
}}</text></view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="roleName === 'common'"
|
||||||
|
class="text-#FF3939 font-bold"
|
||||||
|
>预计收入:¥{{ '100' }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex flex-col text-#666">
|
<view
|
||||||
<text>预约时间:</text>
|
class="mt-10rpx mb-24rpx flex text-24rpx bg-#f2f2f2 w-full min-h-140rpx rounded-sm px-34rpx pt-20rpx pb-10rpx"
|
||||||
<text class="text-#000 mt-8rpx">2023/02/02</text>
|
>
|
||||||
<text class="text-#000">10:00</text>
|
<view class="flex flex-col text-#666">
|
||||||
|
<block v-if="item.result?.clinicPerson">
|
||||||
|
<text>就诊人</text>
|
||||||
|
<text class="text-#000 mt-8rpx">{{
|
||||||
|
item.result.clinicPerson
|
||||||
|
}}</text>
|
||||||
|
</block>
|
||||||
|
<block v-else-if="item.result?.contact">
|
||||||
|
<text>联系人</text>
|
||||||
|
<text class="text-#000 mt-8rpx">{{
|
||||||
|
item.result?.contact
|
||||||
|
}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<view class="flex flex-col flex-1 pl-40rpx pr-20rpx text-#666">
|
||||||
|
<text>医院</text>
|
||||||
|
<text class="text-#000 mt-8rpx">{{
|
||||||
|
item.result?.hospitalName
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex flex-col text-#666">
|
||||||
|
<text>预约时间:</text>
|
||||||
|
<text class="text-#000 mt-8rpx">{{
|
||||||
|
item.result?.clinicDate ||
|
||||||
|
item.result?.visitDate ||
|
||||||
|
item.result?.serviceTime
|
||||||
|
}}</text>
|
||||||
|
<text class="text-#000">{{
|
||||||
|
item.result?.clinicTime || item.result?.visitTime
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex justify-end items-center">
|
||||||
|
<view
|
||||||
|
v-if="item.orderStatus === 4"
|
||||||
|
@click="handleClick(item, 'refund')"
|
||||||
|
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#5F5F5F text-#5F5F5F"
|
||||||
|
>申请退款</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="roleName === 'common' && item.orderStatus === 1"
|
||||||
|
@click="$u.throttle(() => handleClick(item, 'start'), 800)"
|
||||||
|
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#40A0E4 text-#40A0E4"
|
||||||
|
>开始服务</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
@click="$u.throttle(() => handleClick(item, 'detail'), 800)"
|
||||||
|
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#FF8CA6 text-#FF8CA6"
|
||||||
|
>查看详情</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="!item.reasonId && item.orderStatus < 3"
|
||||||
|
@click="handleClick(item, 'cancel')"
|
||||||
|
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#5F5F5F text-#5F5F5F"
|
||||||
|
>取消订单</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end items-center">
|
</z-paging>
|
||||||
<view
|
</view>
|
||||||
@click="handleClick(item)"
|
|
||||||
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#40A0E4 text-#40A0E4"
|
|
||||||
>开始服务</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
@click="handleClick(item)"
|
|
||||||
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#FF8CA6 text-#FF8CA6"
|
|
||||||
>查看详情</view
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
@click="handleClick(item)"
|
|
||||||
class="btn text-30rpx px-30rpx py-14rpx ml-30rpx border-#5F5F5F text-#5F5F5F"
|
|
||||||
>取消订单</view
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</z-paging>
|
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<u-popup
|
<u-popup
|
||||||
|
|
@ -125,15 +163,15 @@
|
||||||
<view
|
<view
|
||||||
class="h-full w-full overflow-y-auto py-10rpx px-40rpx rounded-16rpx overflow-hidden"
|
class="h-full w-full overflow-y-auto py-10rpx px-40rpx rounded-16rpx overflow-hidden"
|
||||||
>
|
>
|
||||||
<u-radio-group v-model="value" placement="row" @change="groupChange">
|
<u-radio-group v-model="cancelVal" placement="row">
|
||||||
<u-radio
|
<u-radio
|
||||||
labelSize="16"
|
labelSize="16"
|
||||||
iconSize="20"
|
iconSize="20"
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in reasonList"
|
||||||
:key="index"
|
:key="index"
|
||||||
activeColor="#FF8CA6"
|
activeColor="#FF8CA6"
|
||||||
:label="'思悠悠,恨悠悠,恨到归时方始休' + index"
|
:label="item.reason"
|
||||||
:name="index"
|
:name="item.id"
|
||||||
></u-radio>
|
></u-radio>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
<view class="mt-20rpx mb-20rpx text-28rpx">其他理由,请填写</view>
|
<view class="mt-20rpx mb-20rpx text-28rpx">其他理由,请填写</view>
|
||||||
|
|
@ -145,6 +183,7 @@
|
||||||
:autoHeight="false"
|
:autoHeight="false"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
|
@click="handleCancelSubmit"
|
||||||
class="text-white bg-#FF8CA6 rounded-24rpx w-full mx-auto mt-30rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
class="text-white bg-#FF8CA6 rounded-24rpx w-full mx-auto mt-30rpx h-80rpx text-center leading-80rpx hover:shadow-md"
|
||||||
>提交</view
|
>提交</view
|
||||||
>
|
>
|
||||||
|
|
@ -157,9 +196,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
const { $api, $store, $Router, $loading } = instance.proxy
|
const { $api, $store, $Router, $toast, $dialog } = instance.proxy
|
||||||
const userInfo = computed(() => $store.user.userInfo)
|
const roleName = computed(() => $store.user.userInfo.roleName)
|
||||||
// 全部 待服务 进行中 已完成 已取消
|
// 全部 待服务 进行中 已完成 已取消
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{ name: '全部', id: 0 },
|
{ name: '全部', id: 0 },
|
||||||
|
|
@ -169,13 +210,26 @@ const list = ref([
|
||||||
{ name: '已取消', id: 4 }
|
{ name: '已取消', id: 4 }
|
||||||
])
|
])
|
||||||
const paging = ref([])
|
const paging = ref([])
|
||||||
const dataList = ref([[], [], [], [], []])
|
const dataList = ref([
|
||||||
|
{ data: [], show: true },
|
||||||
|
{ data: [], show: false },
|
||||||
|
{ data: [], show: false },
|
||||||
|
{ data: [], show: false },
|
||||||
|
{ data: [], show: false }
|
||||||
|
])
|
||||||
const popupShow = ref(false)
|
const popupShow = ref(false)
|
||||||
const value = ref(0)
|
const cancelVal = ref()
|
||||||
const remark = ref('')
|
const remark = ref('')
|
||||||
const status = ref(Math.floor(Math.random() * 4))
|
const status = ref(0)
|
||||||
const current = ref(0)
|
const current = ref(0)
|
||||||
|
const outTradeNo = ref('')
|
||||||
|
const reasonList = ref([])
|
||||||
const stateColorList = [
|
const stateColorList = [
|
||||||
|
{
|
||||||
|
text: '待支付',
|
||||||
|
color: 'text-#fff',
|
||||||
|
bg: 'bg-primary-500'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: '待服务',
|
text: '待服务',
|
||||||
color: 'text-#01BB88',
|
color: 'text-#01BB88',
|
||||||
|
|
@ -198,47 +252,121 @@ const stateColorList = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const getReasonList = () => {
|
||||||
|
$api.reasonList().then(({ page = {} }) => {
|
||||||
|
reasonList.value = page.list || []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getReasonList()
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
if (!roleName.value) {
|
||||||
|
$dialog('请先登录', {
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '去登录',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmColor: '#FF8CA6'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
$Router.push('/personal')
|
||||||
|
})
|
||||||
|
.catch(() => '')
|
||||||
|
return
|
||||||
|
} else paging.value[current.value]?.reload()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const handleTabChange = (item) => {
|
const handleTabChange = (item) => {
|
||||||
|
console.log('🚀 ~ file: index.vue:250 ~ item:', item)
|
||||||
|
current.value = item.id
|
||||||
status.value = item.id - 1 < 0 ? 0 : item.id - 1
|
status.value = item.id - 1 < 0 ? 0 : item.id - 1
|
||||||
paging.value[current.value]?.reload()
|
dataList.value[item.id].show = true
|
||||||
}
|
}
|
||||||
//swiper滑动结束
|
//swiper滑动结束
|
||||||
const swiperAnimationfinish = (e) => {
|
const swiperAnimationfinish = (e) => {
|
||||||
current.value = e.detail.current
|
const cur = e.detail.current
|
||||||
|
current.value = cur
|
||||||
|
dataList.value[cur].show = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(current, (cur) => {
|
||||||
|
dataList.value[cur].show && paging.value[cur]?.reload()
|
||||||
|
})
|
||||||
|
|
||||||
const queryList = (pageNo, pageSize) => {
|
const queryList = (pageNo, pageSize) => {
|
||||||
|
if (!roleName.value) return
|
||||||
const params = {
|
const params = {
|
||||||
pageNo: pageNo,
|
pageNum: pageNo,
|
||||||
pageSize: pageSize,
|
pageSize: pageSize,
|
||||||
type: current.value
|
status: current.value,
|
||||||
|
roleName: roleName.value
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
|
||||||
paging.value[current.value].complete(
|
|
||||||
new Array(Math.floor(Math.random() * 20)).fill({})
|
|
||||||
)
|
|
||||||
}, 300)
|
|
||||||
return
|
|
||||||
$loading(true)
|
|
||||||
$api
|
$api
|
||||||
.queryList(params)
|
.orderList(params)
|
||||||
.then((res) => {
|
.then(({ data }) => {
|
||||||
paging.value[current.value].complete(res.data.list)
|
paging.value[current.value]?.complete(data?.records || [])
|
||||||
dataList.value[current.value] = res.data.list
|
dataList.value[current.value].data = data?.records || []
|
||||||
$loading(false)
|
dataList.value[current.value].show = true
|
||||||
})
|
})
|
||||||
.catch((res) => {
|
.catch((res) => {
|
||||||
paging.value.complete(false)
|
paging.value[current.value]?.complete(false)
|
||||||
$loading(false)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (item) => {
|
const handleClick = async (item, type) => {
|
||||||
console.log('🚀 ~ file: index.vue:133 ~ item:', item)
|
console.log('🚀 ~ file: index.vue:284 ~ item:', item)
|
||||||
popupShow.value = true
|
if (type === 'start') {
|
||||||
|
} else if (type === 'detail') {
|
||||||
|
$Router.push({
|
||||||
|
path: '/pages/form/index',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (type === 'cancel') {
|
||||||
|
outTradeNo.value = item.outTradeNo
|
||||||
|
popupShow.value = true
|
||||||
|
} else if (type === 'refund') {
|
||||||
|
$dialog('确定要申请退款吗?', {
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmColor: '#FF8CA6'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
$api
|
||||||
|
.orderRefund({
|
||||||
|
outTradeNo: item.outTradeNo
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success)
|
||||||
|
$toast('申请成功,请耐心等待到账!', {
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => '')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const groupChange = (value) => {
|
|
||||||
console.log('🚀 ~ file: index.vue:133 ~ value:', value)
|
const handleCancelSubmit = async () => {
|
||||||
|
if (!cancelVal.value) return $toast('请选择取消理由')
|
||||||
|
if (cancelVal.value === 5 && !remark.value?.trim()) {
|
||||||
|
return $toast('请填写取消理由')
|
||||||
|
}
|
||||||
|
const res = await $api.cancelOrder({
|
||||||
|
outTradeNo: outTradeNo.value,
|
||||||
|
reasonId: cancelVal.value,
|
||||||
|
remark: remark.value,
|
||||||
|
roleName: roleName.value
|
||||||
|
})
|
||||||
|
if (res.success) {
|
||||||
|
$toast('取消成功')
|
||||||
|
popupShow.value = false
|
||||||
|
paging.value[current.value]?.reload()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,9 +178,9 @@ const listConst = [
|
||||||
]
|
]
|
||||||
const menuList = ref([])
|
const menuList = ref([])
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
const { roleName = 'simple', roleList = [] } = userInfo.value
|
const { roleName, roleList = [] } = userInfo.value
|
||||||
list.simple[1].text = roleList.includes('common') ? '切换身份' : '成为陪诊师'
|
list.simple[1].text = roleList.includes('common') ? '切换身份' : '成为陪诊师'
|
||||||
menuList.value = [...list[roleName], ...listConst]
|
menuList.value = [...list[roleName || 'simple'], ...listConst]
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleInfo = async (item) => {
|
const handleInfo = async (item) => {
|
||||||
|
|
|
||||||