Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2023-10-17 11:42:44 +08:00
commit 7634e48160
4 changed files with 124 additions and 61 deletions

View File

@ -17,7 +17,7 @@ export function getCurrentUser(openid, cityCode) {
url: `/applet/register/getCurrentResident/${openid}/${cityCode}`,
method: 'GET',
header: {
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
},
})
}

View File

@ -0,0 +1,21 @@
import request from "../../request.js"
// 列表查询
export function list(data) {
return request({
url: '/applet/service/apply/list',
method: 'POST',
data:data
})
}
export function cancel(bookingNo) {
return request({
url: `/applet/service/apply/cancel/${bookingNo}`,
method: 'GET',
// header: {
// region: uni.getStorageSync('region'),
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
// },
})
}

View File

@ -25,19 +25,22 @@
.top {
position: absolute;
background: red;
// background: red;
width: 90%;
left: 5%;
top: 7%;
span:nth-child(1) {
font-size: 32rpx;
font-size: 27rpx;
font-weight: 600;
color: #000000;
position: absolute;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
span:nth-child(2) {
font-weight: 500;
font-size: 28rpx;
font-size: 27rpx;
font-weight: 600;
color: #26A888;
position: absolute;
@ -61,7 +64,7 @@
.recorditem {
width: 100%;
font-size: 28rpx;
font-size: 27rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #868585;

View File

@ -2,87 +2,126 @@
<view class="app">
<u-tabs :list="tabslist" :is-scroll="false" :current="tabscurrent" @change="tabschange" :show-bar='false'
active-color='#26A888'></u-tabs>
<view class="record">
<view class="top">
<span>大生化</span>
<span>未完成</span>
</view>
<view class="recorddata">
<view class="recorditem">
高血压个性服务包
</view>
<view class="recorditem">
预约时间2023-12-12<span>08:30</span>
</view>
</view>
<view class="evaluate" @tap="evaluatetime">
<view class="evaluatedata">
取消预约
</view>
</view>
<u-empty v-if="appointmentlist==0" text="暂无" ></u-empty>
<view class="record" v-for="(item,index) in appointmentlist" :key="index" v-else>
<view class="top">
<span>{{item.formName}}</span>
<span v-if="item.bookingStatus=='1'&&item.approvalStatus=='1'">已完成
</span>
<span v-if="item.approvalStatus=='0'&&item.bookingStatus=='1'">待批准</span>
<span v-if="item.bookingStatus=='0'">未完成</span>
<span v-if="item.bookingStatus=='2'">已取消</span>
</view>
<view class="record">
<view class="top">
<span>大生化</span>
<span>未完成</span>
<view class="recorddata">
<view class="recorditem">
{{item.packageName}}
</view>
<view class="recorddata">
<view class="recorditem">
高血压个性服务包
</view>
<view class="recorditem">
预约时间2023-12-12<span>08:30</span>
</view>
</view>
<view class="evaluate">
<span>完成时间</span>
<span>2023-12-20</span>
<span>08:30</span>
</view>
</view>
<!-- <view class="recorditem"
v-if="item.bookingStatus=='0'||item.bookingStatus=='1'||item.bookingStatus=='2'">
申请时间{{item.applyTime}}
</view> -->
<view class="recorditem" v-if="item.bookingStatus=='1'&&item.completeTime">
完成时间{{item.completeTime}}
</view>
<view class="recorditem">
预约时间{{item.bookingTime}}
</view>
<view class="recorditem" v-if="item.bookingStatus=='2'">
取消时间{{item.cancelTime}}
</view>
</view>
<view class="evaluate" @tap="evaluatetime(item)" v-if="item.bookingStatus=='0'&&item.approvalStatus=='0'">
<view class="evaluatedata">
取消预约
</view>
</view>
<u-toast ref="uToast" />
</view>
</view>
</template>
<script>
import {
list,
cancel
} from '@/api/pagesC/myappointment/myappointment.js'
export default {
data() {
return {
tabslist: [{
name: '全部',
orderStatus: '',
completed: '',
}, {
name: '未评价',
orderStatus: 'WAIT_PAY',
name: '已完成',
completed: '2',
}, {
name: '已评价',
orderStatus: 'WAIT_RECEIVED_GOODS',
name: '未完成',
completed: '1',
}, ],
tabscurrent: 0,
query: {
pageNum: 1,
pageSize: 10,
identity: '',
completed: '',
},
appointmentlist: [],
}
},
onShow() {
const value=uni.getStorageSync('userinfo');
this.query.identity=value.cardNo
this.info();
console.log(this.appointmentlist,'555')
},
methods: {
info() {
list(this.query).then(res => {
this.appointmentlist = res.rows
})
},
evaluatetime(item) {
console.log(item, 11)
cancel(item.bookingNo).then(res => {
console.log(res, '56')
if (res.code == 200) {
this.$refs.uToast.show({
title: '取消预约成功',
type: 'success',
duration: '1500'
})
} else if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500'
})
}
})
},
//tabs
tabschange(index) {
// console.log(this.tabslist)
this.tabscurrent = index;
// this.orderStatus = this.tabslist[index].orderStatus
// this.goodsOrderinfo();
this.tabscurrent = index
console.log(index, '5')
if (index == '1') {
this.query.completed = '1'
this.info();
} else if (index == '2') {
this.query.completed = '2'
this.info();
} else if (index == '0') {
this.query.completed = ''
this.info();
}
},
}
}
</script>
<style lang="scss">
@import './Myappointment.scss'
</style>
</style>