迁移一部分接口

This commit is contained in:
李琦
2026-01-13 13:36:55 +08:00
parent 2a294898ec
commit 11ade5d7ae
11 changed files with 81 additions and 47 deletions

View File

@@ -147,14 +147,15 @@
<view class="product-list-container">
<view class="product-card" @click="goProductDetail(item)" v-for="(item, index) in displayProductList" :key="index">
<view class="prod-img-box">
<image :src="(item.drug && item.drug.image) ? item.drug.image : '/static/mine/avatar_1.png'" mode="aspectFill" class="prod-img" :class="{ 'prescription-blur': item.drug && (item.drug.is_otc === 0 || item.drug.is_otc === '0') }"></image>
<image :src="(item.drug && item.drug.image) ? item.drug.image : '/static/mine/avatar_1.png'" mode="aspectFill" class="prod-img" :class="{ 'prescription-blur': item.drug && item.drug.type == 2 && (item.drug.is_otc === 0 || item.drug.is_otc === '0') }"></image>
</view>
<view class="prod-info">
<view>
<view class="prod-title">{{ item.drug ? item.drug.drug_name : '' }}</view>
<view class="tag-row">
<text class="otc-tag" :class="item.drug && item.drug.is_otc ? 'otc-green' : 'otc-red'">{{item.drug && item.drug.is_otc ? 'OTC' : 'Rx'}}</text>
<!-- 只有西药type == 2才显示OTC/Rx标签 -->
<text v-if="item.drug && item.drug.type == 2" class="otc-tag" :class="item.drug.is_otc ? 'otc-green' : 'otc-red'">{{item.drug.is_otc ? 'OTC' : 'Rx'}}</text>
</view>
<view class="prod-spec">{{ item.drug ? item.drug.specification : '' }}</view>
</view>

View File

@@ -106,8 +106,8 @@
<script>
import {
getuserInfo
} from '../../request/api/api'
getUserInfoApi
} from '../../request/api/user'
export default {
data() {
return {
@@ -137,15 +137,12 @@
// 用户信息
getInfo() {
getuserInfo({
method: "post",
data: {
store_id: uni.getStorageSync('store_id') || 11001
}
getUserInfoApi({
store_id: uni.getStorageSync('store_id') || 11001
}).then((res) => {
// console.log(res, 'ingo');
if (res.data.errcode == 0) {
this.infoList = res.data.data
if (res.data.code == 0) {
this.infoList = res.data.result
}
})
},

View File

@@ -0,0 +1,10 @@
import {post} from './http'
/**
* 获取处方记录列表
* @param params { up_id: number, store_id: number, page: number }
* @returns {Promise<*>}
*/
export async function getPrescriptionListApi(params) {
return await post('/prescription/list', params, 3)
}

10
request/api/register.js Normal file
View File

@@ -0,0 +1,10 @@
import {post} from './http'
/**
* 获取挂号记录列表
* @param params { patient_id: number, store_id: number, page: number }
* @returns {Promise<*>}
*/
export async function getRegisterListApi(params) {
return await post('/register/list', params, 3)
}

10
request/api/user.js Normal file
View File

@@ -0,0 +1,10 @@
import {post} from './http'
/**
* 获取用户信息(包含订单统计)
* @param params { store_id: number }
* @returns {Promise<*>}
*/
export async function getUserInfoApi(params) {
return await post('/user/info', params, 3)
}

View File

@@ -69,14 +69,14 @@
</view>
</view>
<view class="list_west" v-if="orderInfo.ProductOrder.prescription_type==2">
<view class="list_west" v-if="orderInfo.ProductOrder.prescription_type==2||orderInfo.ProductOrder.prescription_type==5||orderInfo.ProductOrder.prescription_type==7">
<view class="list" v-for="(item,index) in orderInfo.ProductOrderItems" :key="item.id">
<view class="img">
<image :src="item.drug_image || '/static/empty/gwc.png'" mode=""></image>
</view>
<view class="it">
<view class="it_name">{{item.drug_name}}{{item.drug.function}}</view>
<view class="it_info">
<view class="it_info" v-if="orderInfo.ProductOrder.prescription_type==2">
{{item.drug.usage}}
</view>
<!-- 添加查看说明书按钮 -->

View File

@@ -66,11 +66,11 @@
<!-- 西药 -->
<view class="item_info" v-if="item.prescription_type==2||item.prescription_type==5">
<view class="item_info" v-if="item.prescription_type==2||item.prescription_type==5||item.prescription_type==7">
<view class="new_store">
<text class="iconfont icon-mendian"></text>
<text style="width: 70%;overflow-x: hidden">{{item.store.name}}</text>
<u-tag :text="item.prescription_type == 2? '西(中成)药': '产品服务包'" :type="(item.prescription_type==2||item.prescription_type==5)&&'primary'" size="mini"
<u-tag :text="item.prescription_type == 2? '西(中成)药': item.prescription_type == 5? '产品服务包': '医疗器械'" :type="(item.prescription_type==2||item.prescription_type==5||item.prescription_type==7)&&'primary'" size="mini"
style="margin-left: 20rpx;" />
</view>
<view class="info" v-for="it in (item.items).slice(0,3)" :key="it.id">

View File

@@ -73,9 +73,11 @@
<script>
import {
registeList,
userList
} from '../../request/api/api'
import {
getRegisterListApi
} from '../../request/api/register'
export default {
data() {
return {
@@ -131,24 +133,22 @@
// 列表
getInfos() {
registeList({
method: "post",
data: {
store_id: uni.getStorageSync('store_id') || 11001,
patient_id: this.id || '',
page: this.page
}
getRegisterListApi({
store_id: uni.getStorageSync('store_id') || 11001,
patient_id: this.id || '',
page: this.page
}).then((res) => {
// console.log(res, 'info');
if (res.data.errcode == 0) {
// this.infoList = (res.data.data.list).reverse()
this.totalPage = res.data.data.pagination.totalPage
this.total = res.data.data.pagination.total
if (res.data.code == 0) {
const data = res.data.result
// this.infoList = (data.list).reverse()
this.totalPage = data.pagination.totalPage
this.total = data.pagination.total
if (this.page > 1) {
this.infoList = [...this.infoList, ...res.data.data.list]
this.infoList = [...this.infoList, ...data.list]
} else {
this.infoList = res.data.data.list
this.infoList = data.list
}
}
})

View File

@@ -114,7 +114,7 @@
</view>
</block>
<block v-if="data.prescription_type==2||data.prescription_type == 5">
<block v-if="data.prescription_type==2||data.prescription_type == 5||data.prescription_type == 7">
<view class="item" v-for="(it,index) in infoList.repice" :key="item.id">
<!-- v-for="(it,index) in item.content" :key="it.id" -->
<view class="name" style="justify-content: space-between;">

View File

@@ -47,7 +47,13 @@
<view class="lists_name">
药品
</view>
<text>{{(item.drug_name).map(it=>it)}}</text>
<view style="display: flex; align-items: center; flex-wrap: wrap;">
<text style="margin-right: 10rpx;">{{(item.drug_name).map(it=>it)}}</text>
<u-tag v-if="item.prescription_type"
:text="item.prescription_type==1?'中药饮片':item.prescription_type==2?'西(中成)药':item.prescription_type==3?'保健食品':item.prescription_type==5?'产品服务包':item.prescription_type==7?'医疗器械':''"
:type="item.prescription_type==1?'success':item.prescription_type==3?'warning':'primary'"
size="mini" />
</view>
</view>
<view class="info">
<view class="list_names">
@@ -65,9 +71,11 @@
<script>
import {
getPrescript,
userList
} from '../../request/api/api'
import {
getPrescriptionListApi
} from '../../request/api/prescription'
export default {
data() {
return {
@@ -125,23 +133,21 @@
// 列表
getInfos() {
getPrescript({
method: "post",
data: {
up_id: this.id,
store_id: uni.getStorageSync('store_id') || 11001,
page: this.page
}
getPrescriptionListApi({
up_id: this.id,
store_id: uni.getStorageSync('store_id') || 11001,
page: this.page
}).then((res) => {
if (res.data.errcode == 0) {
// this.infoList = res.data.data.list
this.totalPage = res.data.data.pagination.totalPage
this.total = res.data.data.pagination.total
if (res.data.code == 0) {
const data = res.data.result
// this.infoList = data.list
this.totalPage = data.pagination.totalPage
this.total = data.pagination.total
if (this.page > 1) {
this.infoList = [...this.infoList, ...res.data.data.list]
this.infoList = [...this.infoList, ...data.list]
} else {
this.infoList = res.data.data.list
this.infoList = data.list
}
}
})

View File

@@ -6,8 +6,8 @@ export function checkDev(key = '') {
// 判断某些模块是否开启
switch (key) {
case 'dev':
return false;
// return true;
// return false;
return true;
case 'open-im':
// return false;
return true;