Pārlūkot izejas kodu

[dev]
1、监听通知的wss接口未做,
2、selectOrderDetail接口数据缺很多,需要和后端沟通;
3、新增一个扫码功能,
4、模拟器跑通,
5、如有后端api,则跑通全部api
6、pc端连成功后端,写pc端新增页面。

Neo.Sun 2 gadi atpakaļ
vecāks
revīzija
50a2ef27ec

+ 1 - 0
.gitignore

@@ -1 +1,2 @@
 node_modules
+uni_modules

+ 1 - 0
App.vue

@@ -36,6 +36,7 @@ onHide(()=>{
 	/* page{
 		padding-top: 0;
 	} */
+	/* @import "@/static/iconfont.css" */
 	.main{
 		background-color: #bcbcbc;
 		display: flex;

+ 37 - 14
components/nav-bar/nav-bar.vue

@@ -1,10 +1,10 @@
 <template>
   <view class="nav">
 		<view class="navbar">
-			<view class="status">{{userInfo.status === 1?"接单中":"暂停接单"}}</view>
+			<view class="status">{{props.userInfo.workStatus === '0'?"接单中":"暂停接单"}}</view>
 			<view class="userinfo">
-				<button type="primary" class="lef" @click="hangdleChange">{{userInfo.status === 1?"暂停接单":"开始接单"}}</button>
-				<image class="mid" aspectFill :src="userInfo.faceurl?userInfo.faceurl:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/cat-1.png'" />
+				<button type="primary" class="lef" @click="handleChange">{{props.userInfo.workStatus === '0'?"暂停接单":"开始接单"}}</button>
+				<image class="mid" aspectFill src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/cat-1.png" />
 				<view class="rig">
 					<text class="name">{{props.userInfo.name?props.userInfo.name:"张三三"}}</text>
 					<button size="mini" type="primary" @click="handleLogout"  class="logout">退出</button>
@@ -22,6 +22,7 @@
 
 <script setup>
 import { onMounted,ref } from 'vue'
+import {updateWorkStatus, updateOnlineStatus } from "@/static/api.js"
 
 const props = defineProps({
 	userInfo: {
@@ -34,29 +35,51 @@ const props = defineProps({
 
 const emit = defineEmits(['updateUser'])
 
-const userInfo = ref({})
+console.log("props.userInfo.workStatus", props.userInfo.workStatus)
 
 onMounted(() => {
-	userInfo.value = props.userInfo
+	// userInfo.value = props.userInfo
 	// console.log("props.userInfo.name", props.userInfo.name)
 })
 
-const hangdleChange =()=>{
-	console.log("hangdleChange", 555)
-	if(userInfo.value.status ===1){
-		userInfo.value.status = 0
-	} else {
-		userInfo.value.status = 1
+const handleChange =async()=>{
+	console.log("hangdleChange props.userInfo.workStatus", props.userInfo.workStatus)
+	const token = uni.getStorageSync('token')
+	const userId = uni.getStorageSync('userId')
+	if(props.userInfo.workStatus){
+		const params = {
+			token: token,
+			data: {
+				pharmacistUserId: userId,
+				workStatus: props.userInfo.workStatus ==='1'?'0':'1'
+			}
+		}
+		console.log('params.data.workStatus', params)
+		
+		const {data:res} = await updateWorkStatus(params)
+		if (res.code === 200) {
+			emit('updateUser', params.data.workStatus)
+		}
+		emit('updateUser', props.userInfo.workStatus)
 	}
-	emit('updateUser', userInfo)
 }
 
-const handleLogout = ()=>{
+const handleLogout = async()=>{
 	console.log("handleLogout", 555)
+	const tokens = uni.getStorageSync('token')
+	const userId = uni.getStorageSync('userId')
+	const params = {
+		token: tokens,
+		data: {
+			pharmacistUserId: userId,
+			onlineStatus: 1
+		}
+	}
+	const {data:res} = await updateOnlineStatus(params)
 	uni.redirectTo({
 		url:"/pages/login/login"
 	})
-	// emit('updateUser', userInfo)
+	
 }
 
 </script>

+ 11 - 2
main.js

@@ -1,6 +1,6 @@
 import App from './App'
 
-
+import Print from 'vue3-print-nb'
 // #ifndef VUE3
 import Vue from 'vue'
 import './uni.promisify.adaptor'
@@ -12,11 +12,20 @@ const app = new Vue({
 app.$mount()
 // #endif
 
+// 封装弹框的方法
+uni.$showMsg = (title = '数据请求失败!', duration = 1500) => {
+	uni.showToast({
+		title,
+		duration,
+		icon: 'none'
+	})
+}
+
 // #ifdef VUE3
 import { createSSRApp } from 'vue'
 export function createApp() {
   const app = createSSRApp(App)
-
+	app.use(Print)
   return {
     app
   }

+ 2 - 1
package.json

@@ -1,6 +1,7 @@
 {
   "dependencies": {
-    "element-plus": "^2.3.7"
+    "element-plus": "^2.3.7",
+    "vue3-print-nb": "^0.1.4"
   },
   "devDependencies": {
     "node-sass": "^9.0.0",

+ 37 - 4
pages/detail/detail.vue

@@ -10,7 +10,7 @@
 					<view class="left">
 						<view class="baracode">
 							<w-barcode :options="preseObj"></w-barcode>
-							<view class="barnum">{{v.pres_id}}</view>
+							<view class="barnum">{{v.preNo}}</view>
 						</view>
 					</view>
 					<view class="mid">
@@ -29,7 +29,7 @@
 					<view class="r2">
 						<view class="row">就诊科室:{{v.office}}</view>
 						<view class="row">临床诊断:{{v.dis_name}}—{{v.sym_name}}</view>
-						<view class="row">开方时间:{{v.create_at}}</view>
+						<view class="row">开方时间:{{v.prescriptionTime}}</view>
 					</view>
 					<view class="r3">联系地址:{{v.addr}}</view>
 				</view>
@@ -103,8 +103,9 @@
 
 <script setup>
 import { onMounted, ref } from 'vue'
+import { selectOrderDetail } from "@/static/api.js"
+import { onLoad } from '@dcloudio/uni-app'
 
-const preseId = ref(11220822134401)
 const preseObj = ref({
 		code: '11220822134401',
 		color:['#000'], // 条形码的颜色
@@ -128,7 +129,7 @@ const v=ref({
 	office:'中医内科',
 	dis_name:'胃脘痛病',
 	sym_name:'脾胃虚寒证',
-	create_at:'2023-06-01 15:58',
+	prescriptionTime:'2023-06-01 15:58',
 	addr:'浙江省某某事某某去某某事中医院门诊楼三楼302是',
 	rp:[
 		{name:'车前子',num:'6g',tips:'包煎',sign:'医生签名'},
@@ -206,6 +207,38 @@ onMounted(() => {
 
 })
 
+onLoad(async() => {
+	const params = {
+		token: token,
+		data: {
+			id: userId,
+		}
+	}
+	const {data:res } = selectOrderDetail(params)
+	if (res.code === 200) {
+		v.prescriptionTime = res.data.prescriptionTime,
+		v.value.name = res.data.name,
+		v.value.sex = res.data.sex,
+		v.value.age = res.data.age,
+		v.value.deployState = res.data.deployState,
+		v.value.disName = res.data.disName,
+		v.value.symName = res.data.symName,
+		v.value.preNo = res.data.preNo,
+		v.value.department = res.data.department,
+		v.value.dosageForm = res.data.dosageForm,
+		v.value.number = res.data.number,
+		v.value.prescriptionSum = res.data.prescriptionSum,
+		v.value.prescriptionTotalSum = res.data.prescriptionTotalSum,
+		v.value.daijianCost = res.data.daijianCost,
+		v.value.distributionCost = res.data.distributionCost,
+		v.value.entrust = res.data.entrust,
+		v.value.rp = res.data.detailList
+		
+		
+		preseObj.value.code = res.data.preNo,
+	}
+})
+
 const handleBack =()=>{
 	uni.navigateBack({
 		delta: 1

+ 16 - 1
pages/edit/edit.vue

@@ -125,7 +125,7 @@
 		<view class="popup">
 			<uni-popup ref="alertDialog" type="dialog">
 				<uni-popup-dialog type="center" cancelText="不打印" confirmText="打印" title="打印标签" @confirm="dialogConfirm" @close="dialogClose">
-					<view class="cotent">
+					<view class="cotent" id="printMe">
 						<view class="title">默默事中医院取药标签打印(门诊)</view>
 						<view class="body">
 							<view class="lef">
@@ -154,6 +154,8 @@
 
 <script setup>
 import { onMounted, ref, getCurrentInstance } from 'vue'
+import { selectOrderDetail } from "@/static/api.js"
+import { onLoad } from '@dcloudio/uni-app'
 
 const preseId = ref(11220822134401)
 const preseObj = ref({
@@ -283,6 +285,17 @@ onMounted(() => {
 
 })
 
+
+onLoad(async() => {
+	const params = {
+		token: token,
+		data: {
+			id: userId,
+		}
+	}
+	const {data:res } = selectOrderDetail(params)
+})
+
 const handleGetRps = (v)=>{
 	console.log('handleGetRps', v)
 	if(!selectRps.value.includes(v)) {
@@ -306,6 +319,7 @@ const handleBack =()=>{
 const handleSubmit = ()=>{
 	if(!isPrint){
 		// 直接调用接口,然后打印
+		print("#printMe")
 		console.log('直接调用接口,然后打印')
 	} else {
 		// 弹窗提醒
@@ -316,6 +330,7 @@ const handleSubmit = ()=>{
 
 const dialogConfirm = ()=>{
 	console.log('dialogConfirm直接调用接口,然后打印')
+	print("#printMe")
 }
 const dialogClose = ()=>{
 	console.log('dialogClose直接调用接口,不打印')

+ 199 - 36
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="main">
-		<NavBar :userInfo="userInfo" @updateInfo="updateUser" />
+		<NavBar :user-info="userInfo" @update-user="updateUser" />
 		<view class="body">
 			<view class="tab-box">
 				<view class="tab-bar">
@@ -15,14 +15,14 @@
 							<uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
 						</view>
 						<button type="primary" @click="handleSearch" class="search-button">搜索</button>
-						<button type="primary" @click="handleRefresh" class="refresh">刷新</button>
+						<button type="primary" :disabled="userInfo.workStatus==='1'?false:true" @click="handleRefresh" class="refresh">一键释放</button>
 					</view>
 					<view v-else class="history">
 						<view class="searchchoice">
 							<view class="row1">
 								<view class="timequan">
 									<text class="time_t">时间区间:</text>
-									<uni-datetime-picker v-model="datetimerange" type="datetimerange" :hide-second="true" rangeSeparator=" - " />
+									<uni-datetime-picker v-model="searchTime" type="datetimerange" :hide-second="true" rangeSeparator=" - " />
 								</view>
 								<view class="office">
 									<view class="uni-list-cell-left office_t">
@@ -43,7 +43,7 @@
 									<uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
 								</view>
 								<view v-else class="search">
-									<uni-easyinput prefixIcon="search" v-model="searchPres" placeholder="请输入处方号" />
+									<uni-easyinput prefixIcon="search" v-model="searchPreNo" placeholder="请输入处方号" />
 								</view>
 								<button type="primary" @click="handleSearch" class="search-button">搜索</button>
 							</view>
@@ -79,6 +79,9 @@
 import NavBar from "@/components/nav-bar/nav-bar.vue"
 import OrderCard from "@/components/order-card/order-card.vue"
 import { onMounted,ref } from 'vue'
+import { onLoad } from "@dcloudio/uni-app"
+import {receiveOrderList } from "@/static/api.js"
+
 
 const userInfo = ref({})
 const searchVal = ref('')
@@ -87,57 +90,146 @@ const tabList = ref([
 	{title:"历史处方", status: 1},
 ])
 
-const currentStatus = ref(0)
+const currentStatus = ref('0')
 
-const tabActive = ref(1) // 当前tab Index
+const tabActive = ref(0) // 当前tab Index
 const tabName = ref('今日待完成') // 当前tab Name
 
 // const tags = ref([])
 const orderList = ref([
-	{prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
-	{prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
-	{prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'},
-	{prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
-	{prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'}
+	{id:1,prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
+	{id:2,prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
+	{id:3,prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'},
+	{id:4,prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
+	{id:5,prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'}
 ])
 
 const isBottom = ref(false) // 是否触底
 
 
-const datetimerange = ref([])
-
 const officeArr = ref(['全部','中医骨伤科门诊一','中医内科门诊一','中医儿科门诊'])
 const officeIndex = ref(0)
 
 const typeArr = ref(['姓名:','处方号:'])
 const typeIndex = ref(0)
+
+const searchTime =ref([])
+const searchDepartment = ref('')
 const searchName = ref('')
-const searchPres = ref('')
-const searchTags = ref([])
+const searchPreNo = ref('')
+const searchSex = ref('')
+const searchPreMzZy = ref('')
+const searchStatus = ref('')
 
+const searchTags = ref([])
 const tags = ref(['全部','门诊','住院','男','女','煎煮','发药'])
 
+
 const page = ref(0)
+const total = ref(0)
+const pageSize = ref(10)
 
 onMounted(() => {
+	
+})
 
+onLoad(async () => {
+	const token = uni.getStorageSync('token')
+	userInfo.value.name = uni.getStorageSync('username')
+	userInfo.value.workStatus = '0'
+	const params = {
+		token: token,
+		data:{
+			status: '0',
+			page: page.value,
+			pageSize: pageSize.value,
+		}
+	}
+	
+	const {data:res} = await receiveOrderList(params)
+	if (res.code === 200) {
+		total.value = res.total
+		orderList.value = res.rows
+	}
 })
 
 // 子传父,更新userInfo
 const updateUser = (v)=>{
-	console.log('updateUser', v)
+	console.log('updateUserStatus', v)
+	userInfo.value.workStatus = v
 }
 
 const updateList = (v)=>{
 	console.log('updateList', v)
 }
 
-const handleSearch = ()=>{
+const handleSearch = async()=>{
+	const token = uni.getStorageSync('token')
 	console.log('handleSearch searchVal', searchVal.value)
+	searchVal.value = searchVal.value.trim()
+	if(currentStatus.value ==='0' && searchVal.value) {
+		const params = {
+			token: token,
+			data: {
+				status: currentStatus.value,
+				name: searchVal.value,
+				page: page.value,
+				pageSize: pageSize.value,
+			}
+		}
+		const {data:res} = await receiveOrderList(params)
+		if (res.code === 200) {
+			total.value = res.total
+			orderList.value = res.rows
+		}
+	}
+	if(currentStatus.value==='1'){
+		// searchTime.value = []
+		// searchDepartment.value = ''
+		// searchName.value = ''
+		// searchPreNo.value = ''
+		// searchSex.value = ''
+		// searchPreMzZy.value = ''
+		// searchStatus.value = ''
+		const params = {
+			token: token,
+			data: {
+				startTime: searchTime.value[0] || '',
+				endTime:  searchTime.value[1] || '',
+				status: currentStatus.value || '',
+				name: searchVal.value || '',
+				preNo: searchPreNo.value || '',
+				prescriptionStatus: searchStatus.value || '',
+				sex: searchSex.value || '',
+				preMzZy: searchPreMzZy.value || '',
+				
+				page: page.value,
+				pageSize: pageSize.value,
+			}
+		}
+		const {data:res} = await receiveOrderList(params)
+		if (res.code === 200) {
+			total.value = res.total
+			orderList.value = res.rows
+		}
+	}
 }
 
-const handleRefresh = ()=>{
-	console.log('handleSearch', v)
+const handleRefresh = async()=>{
+	
+	let ids = orderList.value.map((v)=>{ return v.id }).join(',')
+	
+	const params = {
+		token: token,
+		data:{
+			ids:ids
+		}
+	}
+	const {data:res} = await releaseOrder(params)
+	if (res.code === 200) {
+		total.value = res.total
+		orderList.value = []
+	}
 }
 
 const handleGetOffice = (e)=>{
@@ -152,6 +244,11 @@ const handleGetType = (e)=>{
 	console.log('typeIndex', typeIndex)
 	console.log('typeArr', typeIndex)
 	typeIndex.value = e.detail.value
+	if(typeIndex.value ===1 ){
+		searchName.value = ''
+	} else {
+		searchPreNo.value = ''
+	}
 }
 
 const handleGetTags = (v)=>{
@@ -161,6 +258,76 @@ const handleGetTags = (v)=>{
 	} else {
 		searchTags.value.splice(searchTags.value.indexOf(v), 1)
 	}
+	switch (v) {
+		case '全部':
+			if(searchTags.value.includes(v)){
+				searchTags.value = ['全部']
+				searchTime.value = []
+				searchDepartment.value = ''
+				searchName.value = ''
+				searchPreNo.value = ''
+				searchSex.value = ''
+				searchPreMzZy.value = ''
+				searchStatus.value = ''
+			}
+			break
+		case '门诊':
+			if(searchTags.value.includes(v) && searchTags.value.includes('住院')){
+				searchTags.value.splice(searchTags.value.indexOf('住院'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchPreMzZy.value = '1'
+			break
+		case '住院':
+			if(searchTags.value.includes(v) && searchTags.value.includes('门诊')){
+				searchTags.value.splice(searchTags.value.indexOf('门诊'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchPreMzZy.value = '2'
+			break
+		case '男':
+			if(searchTags.value.includes(v) && searchTags.value.includes('女')){
+				searchTags.value.splice(searchTags.value.indexOf('女'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchSex.value = '男'
+			break
+		case '女':
+			if(searchTags.value.includes(v) && searchTags.value.includes('男')){
+				searchTags.value.splice(searchTags.value.indexOf('男'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchSex.value = '女'
+			break
+		case '煎煮':
+			if(searchTags.value.includes(v) && searchTags.value.includes('发药')){
+				searchTags.value.splice(searchTags.value.indexOf('发药'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchStatus.value = '煎煮'
+			break
+		case '发药':
+			if(searchTags.value.includes(v) && searchTags.value.includes('煎煮')){
+				searchTags.value.splice(searchTags.value.indexOf('煎煮'), 1)
+			}
+			if(searchTags.value.includes('全部')){
+				searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
+			}
+			searchStatus.value = '发药'
+			break
+		default:
+			searchTags.value = ['全部']
+	}
 }
 
 // 更新处方列表
@@ -168,25 +335,21 @@ const checkIndex = async(index) => {
 	tabActive.value = index
 	tabName.value = tabList.value[index].title
 	currentStatus.value = parseInt(tabList.value[index].status)
+	const token = uni.getStorageSync('token')
 	const params = {
-		// token: userStore.token,
-		// appId: userStore.userInfo.appId,
-		// uId: userStore.userInfo.uId,
-
-		page: page.value,
-		pageSize: 10,
-		status: currentStatus.value,
+		token: token,
+		data: {
+			status: currentStatus.value,
+			page: page.value,
+			pageSize: pageSize.value,
+		}
 	}
 	console.log('checkIndex params',params)
-	// const { data: res } = await getOrderList(params)
-	// if(res.code===0) {
-	// 	orderList.value = res.data.list
-	// 	total.value = res.data.total
-	// 	page.value = res.data.page
-	// 	pageSize.value = res.data.pageSize
-	// 	console.log('checkIndex orderList>>>', orderList.value)
-	// }
-	
+	const {data:res} = await receiveOrderList(params)
+	if (res.code === 200) {
+		total.value = res.total
+		orderList.value = res.rows
+	}
 }
 
 
@@ -256,7 +419,7 @@ const checkIndex = async(index) => {
 						font-size: 18px;
 					}
 					.refresh {
-						width:100px;
+						width:200px;
 						margin: 8px 12px;
 						font-size: 18px;
 					}

+ 22 - 4
pages/login/login.vue

@@ -42,7 +42,7 @@
 
 <script setup>
 import { onMounted, ref } from 'vue'
-import { login } from '@/static/api.js'
+import { login } from '@/static/request.js'
 
 const showPassword = ref(false)
 const formData = ref({
@@ -63,15 +63,33 @@ const submit = async ()=> {
 		password: formData.value.password,
 		code: '2',
 	}
+	// uni.setStorageSync('token', 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjQ0ZTExZWNlLTdlNGUtNGZjNi1iMTgzLTZhMTM2NTJiZTVlZiJ9.uZpHzo-AnKFcG3qwdTz85Wd61r1BUSS4TENUgsy1aQHZgdP1gnOZA1XUdFJChO1ReCzvyUENcMgG6GNrh1m_IQ')
+	// uni.redirectTo({
+	// 		url:"/pages/index/index"
+	// 	})
 	const res = await login(params)
-	if (res.code === 0 && res.token) {
-		uni.setStorageSync('token', res.token);
+	if (res.code === 200 && res.token) {
+		uni.setStorageSync('token', res.token)
+		uni.setStorageSync('userId', res.userId)
+		const tokens = uni.getStorageSync('token')
+		const userId = uni.getStorageSync('userId')
+		const params = {
+			token: res.token,
+			data: {
+				pharmacistUserId: res.userId,
+				onlineStatus: 0
+			}
+		}
+		const {data:res} = await updateOnlineStatus(params)
 		uni.redirectTo({
 			url:"/pages/index/index"
 		})
 	} else {
+		uni.redirectTo({
+			url:"/pages/index/index"
+		})
 			console.log('登录失败')
-			uni.$showMsg('加购物车成功', 1500)
+			uni.$showMsg('登录失败', 1500)
 	}
 }
 const handleChange = ()=>{

+ 16 - 7
static/api.js

@@ -14,7 +14,7 @@ export const receiveOrderList = (data) => {
 	return service({
 		url: '/prescription/prescriptionCore/receiveOrderList',
 		method: 'POST',
-		data: data
+		data: data.data
 	})
 }
 
@@ -23,24 +23,33 @@ export const selectOrderDetail = (data) => {
 	return service({
 		url: '/prescription/prescriptionCore/selectOrderDetail',
 		method: 'POST',
-		data: data
+		data: data.data
 	})
 }
 
 // 更改接单状态
 export const updateWorkStatus = (data) => {
 	return service({
-		url: 'pharmacistStatus/updateWorkStatus',
+		url: '/pharmacistStatus/updateWorkStatus',
 		method: 'POST',
-		data: data
+		data: data.data
 	})
 }
 
 // 更改用户在线状态
 export const updateOnlineStatus = (data) => {
 	return service({
-		url: 'pharmacistOnlineStatus/updateOnlineStatus',
+		url: '/pharmacistOnlineStatus/updateOnlineStatus',
 		method: 'POST',
-		data: data
+		data: data.data
+	})
+}
+
+// 释放订单
+export const releaseOrder = (data) => {
+	return service({
+		url: '/pharmacistStatus/releaseOrder',
+		method: 'POST',
+		data: data.data
 	})
-}
+}

+ 21 - 0
static/iconfont.css

@@ -0,0 +1,21 @@
+@font-face {
+  font-family: "iconfont"; /* Project id 4160604 */
+  src: url('/static/iconfont.ttf') format('truetype');
+}
+
+.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-biyanjing:before {
+  content: "\e901";
+}
+
+.icon-yanjing:before {
+  content: "\e8c7";
+}
+

BIN
static/iconfont.ttf


+ 7 - 7
static/request.js

@@ -9,10 +9,9 @@ export const service = (params = {}) => {
 			url: 'http://127.0.0.1:8888' + params.url || '', // 接收请求的API
 			method: params.method || 'POST', // 接收请求的方式,如果不传默认为POST
 			data: params.data || {}, // 接收请求的data,不传默认为空
-			header: {
-				'Content-Type': 'application/json;charset=UTF-8;',
-				'Proxy-Connection': 'keep-alive',
-				'token': params.data.token || ''
+			header: {
+				'Access-Control-Allow-Origin': 'http://localhost:8888',
+				'Authorization': 'Bearer '+ params.token || '',
 			},
 			success: res => {
 				if (res.statusCode !== 200 && res.statusCode !== 201) {
@@ -31,7 +30,7 @@ export const service = (params = {}) => {
 };
 
 // 直接通过uni.login获取微信接口提供的code
-export const login = () => {
+export const login = (params = {}) => {
 	return new Promise((resolve, reject) => {
 		uni.request({
 			url: 'http://127.0.0.1:8888' + '/login/v2',
@@ -39,8 +38,9 @@ export const login = () => {
 			data: params.data || {}, 
 			header: {
 				'Content-Type': 'application/json;charset=UTF-8;',
-				'Proxy-Connection': 'keep-alive',
-				'token': params.data.token || ''
+				'Accept':'application/json, text/plain, */*',
+				'Accept-Encoding':'gzip, deflate',
+				'Accept-Language':'zh-CN,zh;q=0.9',
 			},
 			success: res => {
 				if (res.statusCode !== 200 && res.statusCode !== 201) {