新增订单评价

main
yanzai 2 years ago
parent deb2b30e87
commit e0513c8d73

@ -0,0 +1,52 @@
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Yo;
class LabelController extends Controller
{
public function GetLabelList(){
$query1=DB::table('label')->select('id','type','value','order','img')->whereIn('type',['face','comment'])->where(['status'=>1,'type'=>'face'])->get();
$query2=DB::table('label')->select('id','type','value','order','img')->whereIn('type',['face','comment'])->where(['status'=>1,'type'=>'comment'])->get();
return Yo::echo([
'status' => true,
'label1'=>$query1,
'label2'=>$query2,
]);
}
public function GetOrderEvaluate(){ //获取订单是评价详情
$orderid=request('orderid');
$orderInfo=DB::select("select a.*,b.name as hname from user_orders as a left join hospitals as b on a.hospital=b.id where a.id=?",[$orderid]);
$query=DB::table('order_evaluate')->where(['order_id'=>$orderid])->get();
if(count($query)>0){
return Yo::echo([
'status' => true,
'info'=>$query,
'orderInfo'=>$orderInfo
]);
}else{
return Yo::echo([
'status' => false,
'orderInfo'=>$orderInfo
]);
}
}
public function AddOrderEvaluate(){ //新增订单评价
$orderid=request('orderid');
$faceId=request('faceId');
$pingjiaList=request('pingjiaList');
$pingjiaList=implode(',',$pingjiaList);
$i=DB::table('order_evaluate')->insert(['order_id'=>$orderid,'face_id'=>$faceId,'comment_ids'=>$pingjiaList]);
if($i){
$status=true;
}else{
$status=false;
}
return Yo::echo([
'status' => $status,
]);
}
}

@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Yo;
class UserController extends Controller
{
//检查用户是否有支付体检订单,且已经体检
public function IsChecked(){
$subinfo=request('userid');
$query=DB::table("user_orders")->where(['user'=>$subinfo,'check_status'=>2])->limit(1)->orderBy('id', 'desc') ->get();
if(count($query)>0){
return Yo::echo([
'status' => true,
'info'=>$query
]);
}else{
return Yo::echo([
'status' => false
]);
}
}
}

@ -567,7 +567,7 @@ class ReportController extends Controller
foreach ($item['基础项目列表'] as $i) {
$content_list[] = [
'title' => $i['基础项目名称'],
'content' => $i['结果值'] . $i['结果值单位'],
'content' => $i['结果值'] .' '.' '. $i['结果值单位'],
'icon' => $i['异常标识'],
'desc' => $i['结果值范围'],
];

@ -131,4 +131,6 @@ class UserController extends Controller
'token' => $this->create_token($user)
]);
}
}

@ -97,6 +97,10 @@ Route::post("api/$mp_api/Hospital/info", [\App\Http\Controllers\HospitalControll
Route::post("api/$mp_api/HospitalActivityPackage/list", [\App\Http\Controllers\HospitalActivityPackageController::class, 'mp_list']);
Route::post("api/$mp_api/Carousel/list", [\App\Http\Controllers\CarouselController::class, 'mp_list']);
Route::post("api/$mp_api/Config/get", [\App\Http\Controllers\ConfigController::class, 'mp_get']);
Route::post("api/$mp_api/User/IsChecked", [\App\Http\Controllers\API\UserController::class, 'IsChecked']);
Route::post("api/$mp_api/Label/GetLabelList", [\App\Http\Controllers\API\LabelController::class, 'GetLabelList']);
Route::post("api/$mp_api/Label/GetOrderEvaluate", [\App\Http\Controllers\API\LabelController::class, 'GetOrderEvaluate']);
Route::post("api/$mp_api/Label/AddOrderEvaluate", [\App\Http\Controllers\API\LabelController::class, 'AddOrderEvaluate']);
Route::post("api/$admin_api/UserPerson/update", [\App\Http\Controllers\UserPersonController::class, 'admin_update']);
Route::post("api/$admin_api/UserPerson/list", [\App\Http\Controllers\UserPersonController::class, 'admin_list']);

@ -1,9 +1,9 @@
let url_ = "https://bjrrtj-api.cjy.net.cn";
let report_url_ = "https://bjrrtj-api.cjy.net.cn";
let h5_url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 0;
const dev = 1;
if (dev === 1) {
url_ = "http://192.168.31.106:8000";
url_ = "http://localbeijingrenren";
report_url_ = "http://192.168.31.106:5173";
h5_url_ = "http://192.168.31.106:5173";
}
@ -39,6 +39,7 @@ url_array['User/status'] = `${url_}/api/Mp/User/status`;
url_array['Hospital/info'] = `${url_}/api/Mp/Hospital/info`;
url_array['Carousel/list'] = `${url_}/api/Mp/Carousel/list`;
url_array['Config/get'] = `${url_}/api/Mp/Config/get`;
url_array['User/IsChecked'] = `${url_}/api/Mp/User/IsChecked`; //检查用户是否有支付体检订单,且已经体检
url_array['YO'] = `${url_}/api/yo`;
const api = (mark) => {
if (mark === '') return url_;

@ -3,9 +3,9 @@ import {
} from '@/lu/axios.js'
import $api from './api.js'
let url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 0
const dev = 1
if (dev === 1) {
url_ = "http://192.168.31.106:8000"
url_ = "http://localbeijingrenren"
}
export const ReportUrl = (data) => {
return $api('Report') + `?hospital=${data.hospital}&id_number=${data.id_number}`
@ -123,6 +123,10 @@ export const HospitalInfoAction = async (data) => await $post({
url: 'Hospital/info',
data
})
export const UserIsCheckedAction = async (data) => await $post({
url: 'User/IsChecked',
data
})
export const yo = async (data) => await $post({
url: 'YO',
data

@ -22,6 +22,7 @@
const url_data = ref('')
const readUrl = () => {
url_data.value = decodeURIComponent(props.url)
console.log(url_data.value)
}
</script>

@ -13,6 +13,7 @@
CarouselListAction,
HospitalCountAction,
HospitalExtraInfoAction,
UserIsCheckedAction,
$image,
$response
} from '@/api'
@ -50,6 +51,7 @@
}
}
})
}
const hospital_info = ref(false)
@ -136,6 +138,13 @@
break;
case 4:
h5_list.value = response.data.list
uni.setStorage({
key: 'h5_list',
data: h5_list.value[1],
success: function () {
console.log('success');
}
});
break;
}
})
@ -150,9 +159,37 @@
})
}
const actionClick = (info) => {
console.log(info)
if (info.id == 9) {
//
userischecked(info)
} else {
uni.$lu.jump(info)
}
}
const userischecked = async (info) => { //
const response = await UserIsCheckedAction({
userid: user_info.value.id
})
$response(response, () => {
if (response.data.status) {
info.jump_path = info.jump_path.replace('question','question2')
info.jump_path=info.jump_path+"&orderid="+response.data.info[0].id
console.log(info.jump_path )
}
uni.$lu.jump(info)
})
}
const loginCallback = () => {
getHospitalInfo()
getUserInfo()
@ -189,7 +226,8 @@
<view>
<view @click="addPersonClick()" v-if="!!user_info && !user_info.person.id" class="user_status_wrapper">
<view class="user_status_text_wrapper" v-if="!user_info.id"><text>点击登录</text></view>
<view class="user_status_text_wrapper" v-if="!!user_info.id && !user_info.person.id"><text>点击添加</text>
<view class="user_status_text_wrapper" v-if="!!user_info.id && !user_info.person.id">
您还没有添加体检人<text>点击添加</text>
</view>
</view>
<CheckLogin @callback="loginCallback()"></CheckLogin>

@ -138,6 +138,21 @@
const refundClose = () => {
refund_show.value = false
}
const pingjia =(i)=>{
var info={}
uni.getStorage({
key: 'h5_list',
success: function (res) {
info=res.data
info.jump_path = info.jump_path.replace('question','question2')
info.jump_path=info.jump_path+"&orderid="+i.id
uni.$lu.jump(info)
}
});
}
</script>
<template>
<view>
@ -249,6 +264,7 @@
</view>
<view v-if="i.status === 4" class="order_price_box_wrapper">
<view class="order_pay_time_wrapper">到检时间 {{ i.check_time }}</view>
<view class="pingjia" @click="pingjia(i)"></view>
<view class="order_pay_price_wrapper done_info_wrapper">
<view class="order_pay_price_title_wrapper">已付</view>
<view class="order_pay_price_content_wrapper">{{ i.price }}</view>
@ -301,6 +317,15 @@
color: #999A9A;
line-height: 1;
}
.pingjia{
font-size: 20rpx;
font-weight: 500;
color: #ff5500;
line-height: 1;
border: 1px solid #ff5500;
padding: 5rpx;
border-radius: 5rpx;
}
.qrcode_wrapper image {
width: 61rpx;

@ -5,7 +5,8 @@
* date2023年4月12日 21:39:00
*/
import {
ref,watch
ref,
watch
} from 'vue'
import {
UserPersonCreateAction,
@ -163,7 +164,8 @@
watch(() => user_person_info.value.id_number, (newVal, oldVal) => {
if (Number($props.id) === 0) {
if (newVal.length == 18) {
user_person_info.value.birthday= newVal.substring(6,10)+'-'+newVal.substring(10,12)+'-'+newVal.substring(12,14)
user_person_info.value.birthday = newVal.substring(6, 10) + '-' + newVal.substring(10, 12) + '-' +
newVal.substring(12, 14)
} else {
user_person_info.value.birthday = ''
}
@ -198,6 +200,12 @@
}
const saveClick = async () => {
if(tongyi.value!='tongyi'){
uni.showToast({
title: "请阅读并同意用户协议",
icon:'none'
})
}
const response = !user_person_info.value.id ?
await UserPersonCreateAction(user_person_info.value) :
await UserPersonUpdateAction(user_person_info.value)
@ -207,11 +215,15 @@
})
})
}
let tongyi=ref(false)
const tongyiclick=(e)=>{
tongyi.value=e.detail.value
}
</script>
<template>
<view>
<uni-datetime-picker :ref="birthdayRef" class="input_line_datetime_picker_wrapper" type="date" :clear-icon="false"
v-model="user_person_info.birthday" @change="birthdayChange" />
<uni-datetime-picker :ref="birthdayRef" class="input_line_datetime_picker_wrapper" type="date"
:clear-icon="false" v-model="user_person_info.birthday" @change="birthdayChange" />
<view class="input_wrapper">
<view class="input_line_wrapper">
<view class="input_line_title_wrapper">姓名</view>
@ -266,8 +278,8 @@
<view class="input_line_wrapper">
<view class="input_line_title_wrapper">关系</view>
<view class="input_line_input_wrapper">
<picker @change="relationshipChange" :value="user_person_info.relationship_select" :range="relationship_arr"
range-key="label">
<picker @change="relationshipChange" :value="user_person_info.relationship_select"
:range="relationship_arr" range-key="label">
<view>{{ user_person_info.relationship_name || '请选择' }}</view>
</picker>
</view>
@ -284,13 +296,23 @@
</view>
</view>
<view class="break_block_wrapper"></view>
<view @click="readmeClick()" class="readme_wrapper">添加或修改体检人信息</view>
<view style="display: flex; padding-left: 30rpx; align-items: center;">
<view>
<checkbox-group @change="tongyiclick">
<label>
<checkbox value="tongyi" />已阅读并同意
</label>
</checkbox-group>
</view>
<view @click="readmeClick()" class="readme_wrapper">
即代表您已同意
<text class="blue_text_wrapper">用户服务协议</text>
<text class="blue_text_wrapper">隐私协议</text>
</view>
</view>
<view @click="saveClick()" class="add_button_wrapper">保存</view>
<view class="blank_wrapper"></view>
</view>
@ -311,7 +333,7 @@
.readme_wrapper {
font-size: 26rpx;
line-height: 50rpx;
margin-left: 30rpx;
margin-left: -10rpx;
}
.blue_text_wrapper {

@ -1,5 +1,5 @@
let url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 0
const dev = 1
if (dev === 1) {
url_ = "http://localbeijingrenren"
}
@ -11,6 +11,9 @@ url_array['User/info'] = `${url_}/api/Mp/User/info`;
url_array['Question/list'] = `${url_}/api/Mp/Question/list`;
url_array['Post/info'] = `${url_}/api/Mp/Post/info`;
url_array['Post/list'] = `${url_}/api/Mp/Post/list`;
url_array['Label/GetLabelList'] = `${url_}/api/Mp/Label/GetLabelList`;
url_array['Label/GetOrderEvaluate'] = `${url_}/api/Mp/Label/GetOrderEvaluate`; ////获取订单是评价详情
url_array['Label/AddOrderEvaluate'] = `${url_}/api/Mp/Label/AddOrderEvaluate`; ////新增订单是评价详情
url_array['YO'] = `${url_}/api/yo`;
const api = (mark) => {
if (mark === '') return url_;

@ -2,7 +2,7 @@ import {
$post
} from '@/lu/axios.js'
let url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 0
const dev = 1
if (dev === 1) {
url_ = "http://localbeijingrenren"
}
@ -34,6 +34,20 @@ export const PostInfoAction = async (data) => await $post({
url: 'Post/info',
data
})
export const LabelGetLabelListAction = async (data) => await $post({
url: 'Label/GetLabelList',
data
})
//获取订单是评价详情
export const LabelGetOrderEvaluateAction = async (data) => await $post({
url: 'Label/GetOrderEvaluate',
data
})
//新增订单是评价详情
export const LabelAddOrderEvaluateAction = async (data) => await $post({
url: 'Label/AddOrderEvaluate',
data
})
export const $image = (path) => {
return `${url_}${path}`

@ -25,6 +25,13 @@
"navigationStyle": "custom"
}
}, {
"path": "pages/main/question2/question2",
"style": {
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{
"path": "pages/main/login/login",
"style": {

@ -25,6 +25,10 @@
type: String,
default: 'home'
},
orderid: {
type: String,
default: ''
},
param: {
type: String,
default: ''
@ -41,10 +45,15 @@
if (!!info.id) {
tip_content.value = '登录成功'
let param = decodeURIComponent($props.param)
let page = !!$props.page ? $props.page : 'home'
let orderid=!!$props.orderid ? $props.orderid : ''
param = !!param ? '&' + param : ''
uni.reLaunch({
url: `/pages/main/${page}/${page}?hospital=${$props.hospital}${param}`
url: `/pages/main/${page}/${page}?hospital=${$props.hospital}${param}&orderid=${$props.orderid}`
})
} else {
tip_content.value = '登录失败'
@ -54,6 +63,7 @@
})
}
onShow(() => {
getUserInfo()
})
</script>

@ -67,7 +67,7 @@
<view class="top_line_wrapper"></view>
<view class="posts_wrapper">
<view @click="postClick(i)" class="post_item_wrapper" v-for="(i,k) in post_list">
<view class="post_title_wrapper">{{ i.title }}{{ i.title }}{{ i.title }}{{ i.title }}{{ i.title }}{{ i.title }}
<view class="post_title_wrapper">{{ i.title }}
</view>
<view v-if="Number($props.type) === 1" class="post_content_wrapper">
<view class="post_cover_wrapper">

@ -0,0 +1,280 @@
<script setup>
/**
* name
* usersa0ChunLuyu
* date2023年6月8日 20:08:53
*/
import {
ref
} from 'vue'
import {
LabelAddOrderEvaluateAction,
LabelGetOrderEvaluateAction,
LabelGetLabelListAction,
$response
} from '@/api'
import {
onShow,
onLoad
} from '@dcloudio/uni-app'
const $props = defineProps({
hospital: {
type: String,
default: '0'
}
});
let orderid = ref('')
let orderInfo = ref('')
let subbutton_show = ref(false)
let showdata=ref(false)
const face_list = ref([])
const comment_list = ref([])
const GetLabelGetLabelList = async () => {
const response = await LabelGetLabelListAction()
$response(response, () => {
face_list.value = response.data.label1
comment_list.value = response.data.label2
})
}
//
let pingjia_time = ref('')
const GetLabelGetOrderEvaluate = async (id) => {
uni.showLoading({
title: '加载中'
});
const response = await LabelGetOrderEvaluateAction({
orderid: id
})
showdata.value=true
uni.hideLoading();
$response(response, () => {
orderInfo.value = response.data.orderInfo[0]
var obj = JSON.parse(orderInfo.value.buy_info);
orderInfo.value.buy_info = obj
if(response.data.info){
faceId.value=response.data.info[0].face_id
var aa= response.data.info[0].comment_ids.split(',');
for (var i = 0; i < aa.length; i++) {
aa[i] = parseInt(aa[i]);
}
pingjiaList.value=aa
pingjia_time.value=response.data.info[0].created_at
console.log(pingjiaList.value)
}
if (response.data.status) {
} else {
//
subbutton_show.value = true
}
})
}
const submit = async () => {
if(faceId.value=='' || pingjiaList.value.length==0){
uni.showToast({
title: '请勾选评价信息',
icon: 'none'
});
return false
}
uni.showLoading({
title: '加载中'
});
let data={
faceId:faceId.value,
pingjiaList:pingjiaList.value,
orderid:orderid.value
}
const response = await LabelAddOrderEvaluateAction(data)
uni.hideLoading();
$response(response, () => {
console.log(response)
if(response.data.status==true){
subbutton_show.value=false
uni.showToast({
title: '感谢您的评价,您的满意是我们前进的动力',
icon: 'none'
});
GetLabelGetOrderEvaluate(orderid.value)
}else{
}
})
}
let faceId = ref('')
const clickFace = (id) => { //
if(!subbutton_show.value){
return false
}
faceId.value = id
console.log(faceId.value)
}
let pingjiaList = ref([])
const clickComment = (id) => { //
if(!subbutton_show.value){
return false
}
if (pingjiaList.value.indexOf(id) != -1) {
pingjiaList.value.splice(pingjiaList.value.indexOf(id), 1)
} else {
pingjiaList.value.push(id)
}
console.log(pingjiaList.value)
}
onShow(() => {
GetLabelGetLabelList()
})
onLoad((options) => {
console.log(options.orderid); //
orderid.value = options.orderid
GetLabelGetOrderEvaluate(orderid.value)
})
</script>
<template>
<view class="question2" v-show="showdata">
<view class="main">
<view class="row">
<view class="row_title"> </view>
<view class="row_cc">{{orderInfo.name}}</view>
</view>
<view class="row">
<view class="row_title"> </view>
<view class="row_cc">{{orderInfo.exam_number}}</view>
</view>
<view class="row" v-if="orderInfo.buy_info">
<view class="row_title">体检套餐</view>
<view class="row_cc">{{orderInfo.buy_info.combo.name}}</view>
</view>
<view class="row">
<view class="row_title">体检分院</view>
<view class="row_cc">{{orderInfo.hname}}</view>
</view>
<view class="row">
<view class="row_title">体检时间</view>
<view class="row_cc">{{orderInfo.check_time}}</view>
</view>
</view>
<view class="main2">
<view class="face">
<view class="face_l" v-for="(item,k) in face_list " :class="faceId==item.id?'active':''"
@click="clickFace(item.id)">{{item.value}}</view>
</view>
<view class="pingjia" v-show="!subbutton_show"></view>
<view class="common">
<view class="common_l" v-for="(item2,k) in comment_list " :class="pingjiaList.indexOf(item2.id) != -1?'active':''" @click="clickComment(item2.id)">
{{item2.value}}
</view>
</view>
<button size="default" type="default" v-show="subbutton_show" @click="submit"
style="color:#ffffff;backgroundColor:#27ada9;borderColor:#1AAD19; margin-top: 40rpx;"
hover-class="is-hover">提交评价</button>
<view style="color: #9b9b9b; font-size: 20rpx;margin-top: 20rpx;" v-show="!subbutton_show">{{pingjia_time}}</view>
</view>
<view class="blank_wrapper"></view>
</view>
</template>
<style>
page {
background: #ffffff;
}
</style>
<style scoped>
.pingjia{
width: 100%;
text-align: center;
margin: 30rpx auto;
color:#fa8527;
font-size: 25rpx;
font-weight: 700;
}
.question2 {
background-color: #f3f3f3;
padding-top: 20rpx;
height: 100vh;
}
.main {
padding: 40rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 20rpx;
}
.main2 {
padding: 20rpx;
padding-top: 40rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 20rpx;
padding-bottom: 60rpx;
}
.main3 {
padding: 20rpx;
background-color: #fff;
margin: 20rpx;
border-radius: 20rpx;
}
.row {
display: flex;
margin-top: 20rpx;
}
.row_title {
margin-right: 30rpx;
color: #a4a4a4;
text-align: right;
width: 150rpx;
}
.row_cc {
color: #373737;
}
.face {
display: flex;
justify-content: space-between;
margin-bottom: 40rpx;
}
.face_l {
border: 1px solid #ccc;
padding: 16rpx;
font-size: 20rpx;
border-radius: 8rpx;
}
.common {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.common_l {
display: inline-block;
white-space: nowrap;
width: 25%;
text-align: center;
border: 1px solid #ccc;
padding: 14rpx;
font-size: 24rpx;
border-radius: 8rpx;
margin: 10rpx;
}
.button {}
.active {
border: 1px solid #fa8527;
color: #fa8527 !important;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -1,5 +1,5 @@
let url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 1
const dev = 0
if (dev === 1) {
url_ = "http://localbeijingrenren"
}

@ -2,7 +2,7 @@ import {
$post
} from '@/lu/axios.js'
let url_ = "https://bjrrtj-api.cjy.net.cn";
const dev = 1
const dev = 0
if (dev === 1) {
url_ = "http://localbeijingrenren"
}

@ -86,7 +86,7 @@
<template>
<view>
<view class="report_list_wrapper">
<view class="report_list_wrapper" v-if="props.list.list.length>0">
<view @click="ReportDown(i['文件Id'])" class="report_item_wrapper" v-for="(i,k) in props.list.list" :key="k">
<view class="report_item_icon_wrapper">
<image :src="$image('/storage/assets/report/home/报告@2x.png')"></image>
@ -100,6 +100,9 @@
</view>
</view>
</view>
<view v-else class="nodata">
<uni-icons color="#ccc" type="info" size="30"></uni-icons> <view></view>
</view>
</view>
</template>
<style scoped>
@ -171,4 +174,12 @@
overflow-y: auto;
padding-bottom: 20rpx;
}
.nodata{
display: flex;
width: 100%;
align-items: center;
justify-content: center;
color: #ccc;
padding-top: 60rpx;
}
</style>
Loading…
Cancel
Save