diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index a4b9443..ae45ba1 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -14,7 +14,7 @@ diff --git a/App.vue b/App.vue index 6642a82..19fd7d9 100644 --- a/App.vue +++ b/App.vue @@ -4,6 +4,7 @@ } from './request/api/api' import { webSocketManager } from '@/utils/ws/websocket.js'; import {checkDev} from "@/utils/utils"; + import {bindUserApi} from "@/request/api/salesperson"; export default { // //初始化状态-如果登录过,保持登录状态 onLaunch: async function() { @@ -100,14 +101,41 @@ return {}; const scene = decodeURIComponent(e.query.scene) + // 这里接收扫码参数 if (scene) { + // 判断scene中是否包含sal_id + let isSalespersonId = decodeURIComponent(e.query.scene).includes('sal_id'); const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_') - uni.setStorageSync('stores_id', scene[1]) + if (scene[1]) { + uni.setStorageSync('stores_id', scene[1]) + uni.setStorageSync('store_id', scene[1]) + } + // uni.setStorageSync('stores_id', scene[1]) const st_id = decodeURIComponent(e.query.scene).split('&') + let store_id = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_') + store_id = decodeURIComponent(store_id[1]).split('&') const doctors_id = decodeURIComponent(e.query.scene).split('=') + if (store_id[0] !== 'undefined') { + uni.setStorageSync('stores_id', store_id[0]) + uni.setStorageSync('store_id', store_id[0]) + } uni.setStorageSync('doctors_id', st_id[0].split('su_id=')[1]) + if (isSalespersonId) { + uni.setStorageSync('sal_id', st_id[1].split('sal_id=')[1]) + } uni.setStorageSync('st_id', doctors_id[2]) - // console.log(scene[1], '4444'); + + let userId = uni.getStorageSync('user_id') + if (isSalespersonId && userId) { + bindUserApi({ + user_id: userId, + salesperson_id: st_id[1].split('sal_id=')[1], + }).then((res) => { + console.log('userId', userId, st_id[0].split('su_id=')[1], res); + }) + } + // console.log(st_id, '4444111111111'); + // console.log(scene, '4444'); } // const scene = decodeURIComponent(e.query.scene).split('STORE_QR_CODE_') // console.log(scene, '11111'); diff --git a/pages.json b/pages.json index c2db908..b052eac 100644 --- a/pages.json +++ b/pages.json @@ -1,488 +1,502 @@ { - "easycom": { - // 下载安装方式 - // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" - // npm安装方式 - "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" - }, - "pages": [ - //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/home/index", - "style": { - "navigationBarTitleText": "萧康互联网医院", - "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#298DFF", - "navigationBarTextStyle": "white" - }, - "needLogin": false - }, - { - "path": "pages/home/home", - "style": { - // "navigationBarTitleText": "custom" - "navigationStyle": "default", - "navigationBarBackgroundColor": "#298DFF", - "navigationBarTextStyle": "white" - } - }, - { - "path": "pages/home/index-list", - "style": { - "navigationBarTitleText": "萧康互联网医院" - } - }, - { - "path": "pages/home/home-banner", - "style": { - "navigationBarTitleText": "萧康互联网医院" - } - }, - { - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "授权登录", - "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#EAF2FF" - } - }, - { - "path": "pages/cate/index", - "style": { - "navigationBarTitleText": "健康资讯" - } - // "needLogin": true - }, - { - "path": "pages/cate/info-detail", - "style": { - "navigationBarTitleText": "文章详情" - } - // "needLogin": true - }, - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "消息" - } - // "needLogin": true - }, - { - "path": "pages/index/system", - "style": { - "navigationBarTitleText": "系统消息" - } - // "needLogin": true - }, - { - "path": "pages/index/order-info", - "style": { - "navigationBarTitleText": "产品订单" - } - }, - { - "path": "pages/index/doctor-info", - "style": { - "navigationBarTitleText": "医生消息" - } - }, - { - "path": "pages/mine/mine", - "style": { - "navigationBarTitleText": "我的", - "navigationBarBackgroundColor": "#4175EE", - "navigationBarTextStyle": "white" - } - // "needLogin": true - }, - { - "path": "pages/login/logon", - "style": { - "navigationBarTitleText": "注册", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/Inquiries/Inquiries", - "style": { - "navigationBarTitleText": "医生列表", - "enablePullDownRefresh": false - } - // "needLogin": true - } - ], - "subPackages": [ - { - "root": "subPackages", - "pages": [ - { - "path": "doctor/doctor-detail", - "style": { - "navigationBarTitleText": "医生详情", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/doctor-info", - "style": { - "navigationBarTitleText": "医生简介", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/doctor-evaluation", - "style": { - "navigationBarTitleText": "患者评价", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/doctor-picture", - "style": { - "navigationBarTitleText": "图文问诊", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/appraise", - "style": { - "navigationBarTitleText": "评价", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/doctor-userinfo", - "style": { - "navigationBarTitleText": "选择就诊人", - "enablePullDownRefresh": false - } - }, - { - "path": "doctor/doctor_newsinfo", - "style": { - "navigationBarTitleText": "医生消息", - "enablePullDownRefresh": false - } - } - ] - }, - { - "root": "subPackages", - "pages": [ - { - "path": "my/myinfo-add", - "style": { - "navigationBarTitleText": "添加就诊人", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myrecord-detail", - "style": { - "navigationBarTitleText": "处方详情", - "enablePullDownRefresh": false - } - }, - { - "path": "my/record-pay", - "style": { - "navigationBarTitleText": "预约购药", - "enablePullDownRefresh": false - } - }, - { - "path": "my/unpaid-order", - "style": { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myreport", - "style": { - "navigationBarTitleText": "检查报告", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myinfo", - "style": { - "navigationBarTitleText": "就诊人管理", - "enablePullDownRefresh": false - } - }, - { - "path": "my/my_online", - "style": { - "navigationBarTitleText": "线上复诊", - "enablePullDownRefresh": false - } - }, - { - "path": "my/mystore", - "style": { - "navigationStyle": "default", - "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#1777FF", - "navigationBarTextStyle": "white" - } - }, - { - "path": "my/mycollection", - "style": { - "navigationBarTitleText": "个人资料", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myabout", - "style": { - "navigationBarTitleText": "关于", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myorder", - "style": { - "navigationBarTitleText": "问诊记录", - "enablePullDownRefresh": false - } - }, - { - "path": "my/myrecord", - "style": { - "navigationBarTitleText": "处方记录", - "enablePullDownRefresh": true - } - }, - { - "path": "my/myappiont", - "style": { - "navigationBarTitleText": "挂号记录", - "enablePullDownRefresh": true - } - }, - { - "path": "my/myinfo-edit", - "style": { - "navigationBarTitleText": "编辑信息", - "enablePullDownRefresh": false - } - }, - { - "path": "my/my-drug/drug-list", - "style": { - "navigationBarTitleText": "产品订单", - "enablePullDownRefresh": true, - "onReachBottomDistance": 50 - } - }, - { - "path": "my/my-drug/drug-info", - "style": { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false - } - }, - { - "path": "my/my-drug/to-next", - "style": { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false - } - } - ] - }, - { - "root": "subPackages", - "pages": [ - { - "path": "register/register", - "style": { - "navigationBarTitleText": "确认挂号信息" - } - }, - { - "path": "register/register-success", - "style": { - "navigationBarTitleText": "确认挂号信息" - } - }, - { - "path": "register/register-info", - "style": { - "navigationBarTitleText": "挂号详情", - "navigationStyle": "custom" - } - } - ] - }, - { - "root": "subPackages", - "pages": [ - { - "path": "shop/orders", - "style": { - "navigationBarTitleText": "商城订单", - "enablePullDownRefresh": true - } - }, - { - "path": "shop/search-home", - "style": { - "navigationBarTitleText": "萧康诊所门店" - } - }, - { - "path": "shop/search-list", - "style": { - "navigationBarTitleText": "萧康诊所门店" - } - }, - { - "path": "shop/orders-detail", - "style": { - "navigationBarTitleText": "商品详情" - } - }, - { - "path": "shop/shop-cate", - "style": { - "navigationBarTitleText": "购物车" - } - }, - { - "path": "shop/shop-pay", - "style": { - "navigationBarTitleText": "订单详情" - } - }, - { - "path": "shop/paied", - "style": { - "navigationBarTitleText": "确认付款信息" - } - }, - { - "path": "shop/paied-detail", - "style": { - "navigationBarTitleText": "订单详情" - } - }, - { - "path": "shop/written", - "style": { - "navigationBarTitleText": "买家留言" - } - }, - { - "path": "shop/after-sales", - "style": { - "navigationBarTitleText": "申请售后" - } - }, - { - "path": "shop/logistics", - "style": { - "navigationBarTitleText": "物流详情" - } - } - ] - }, - { - "root": "subPackages", - "pages": [ - { - "path": "setup/filed", - "style": { - "navigationBarTitleText": "设置" - } - }, - { - "path": "setup/choose-area", - "style": { - "navigationBarTitleText": "管理地址" - } - }, - { - "path": "setup/area-list", - "style": { - "navigationBarTitleText": "地址管理" - } - }, - { - "path": "setup/fw-serve", - "style": { - "navigationBarTitleText": "服务协议" - } - }, - { - "path": "setup/ys-serve", - "style": { - "navigationBarTitleText": "隐私政策" - } - }, - { - "path": "setup/zz-serve", - "style": { - "navigationBarTitleText": "资质证照" - } - }, - { - "path": "setup/customer-service", - "style": { - "navigationBarTitleText": "客服中心" - } - }, - { - "path": "chat/chat", - "style": { - "navigationBarTitleText": "在线问诊", - "enablePullDownRefresh": false - } - } - ] - } - ], - "tabBar": { - "fontSize": "18px", - "height": "60px", - "spacing": "4px", - "backgroundColor": "#fff", - "selectedColor": "#1575FC", - "list": [ - { - "pagePath": "pages/home/home", - "text": "首页", - "iconPath": "static/home/02.png", - "selectedIconPath": "static/home/01.png" - }, - { - "pagePath": "pages/cate/index", - "text": "资讯", - "iconPath": "static/home/03.png", - "selectedIconPath": "static/home/04.png" - }, - { - "pagePath": "pages/index/index", - "text": "消息", - "iconPath": "static/home/05.png", - "selectedIconPath": "static/home/06.png" - }, - { - "pagePath": "pages/mine/mine", - "text": "我的", - "iconPath": "static/home/07.png", - "selectedIconPath": "static/home/08.png" - } - ], - "color": "" - }, - "globalStyle": { - "navigationBarTextStyle": "black", - // "navigationBarTitleText": "萧康互联网医院", - "navigationBarBackgroundColor": "#F8FAFC", - "backgroundColor": "#F8F8F8" - }, - "uniIdRouter": {} + "easycom": { + // 下载安装方式 + // "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" + // npm安装方式 + "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" + }, + "pages": [ + //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/home/index", + "style": { + "navigationBarTitleText": "惠佑康", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#298DFF", + "navigationBarTextStyle": "white" + }, + "needLogin": false + }, + { + "path": "pages/home/home", + "style": { + // "navigationBarTitleText": "custom" + "navigationStyle": "default", + "navigationBarBackgroundColor": "#298DFF", + "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/home/index-list", + "style": { + "navigationBarTitleText": "惠佑康" + } + }, + { + "path": "pages/home/home-banner", + "style": { + "navigationBarTitleText": "惠佑康" + } + }, + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "授权登录", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#EAF2FF" + } + }, + { + "path": "pages/cate/index", + "style": { + "navigationBarTitleText": "健康资讯" + } + // "needLogin": true + }, + { + "path": "pages/cate/info-detail", + "style": { + "navigationBarTitleText": "文章详情" + } + // "needLogin": true + }, + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "消息" + } + // "needLogin": true + }, + { + "path": "pages/index/system", + "style": { + "navigationBarTitleText": "系统消息" + } + // "needLogin": true + }, + { + "path": "pages/index/order-info", + "style": { + "navigationBarTitleText": "产品订单" + } + }, + { + "path": "pages/index/doctor-info", + "style": { + "navigationBarTitleText": "医生消息" + } + }, + { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#4175EE", + "navigationBarTextStyle": "white" + } + // "needLogin": true + }, + { + "path": "pages/login/logon", + "style": { + "navigationBarTitleText": "注册", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/Inquiries/Inquiries", + "style": { + "navigationBarTitleText": "医生列表", + "enablePullDownRefresh": false + } + // "needLogin": true + } + ], + "subPackages": [ + { + "root": "subPackages", + "pages": [ + { + "path": "doctor/doctor-detail", + "style": { + "navigationBarTitleText": "医生详情", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/doctor-info", + "style": { + "navigationBarTitleText": "医生简介", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/doctor-evaluation", + "style": { + "navigationBarTitleText": "患者评价", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/doctor-picture", + "style": { + "navigationBarTitleText": "图文问诊", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/appraise", + "style": { + "navigationBarTitleText": "评价", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/doctor-userinfo", + "style": { + "navigationBarTitleText": "选择就诊人", + "enablePullDownRefresh": false + } + }, + { + "path": "doctor/doctor_newsinfo", + "style": { + "navigationBarTitleText": "医生消息", + "enablePullDownRefresh": false + } + }, + { + "path": "product/product", + "style": { + "navigationBarTitleText": "购药", + "enablePullDownRefresh": false + } + }, + { + "path": "product/symptoms", + "style": { + "navigationBarTitleText": "填写病症", + "enablePullDownRefresh": false + } + } + ] + }, + { + "root": "subPackages", + "pages": [ + { + "path": "my/myinfo-add", + "style": { + "navigationBarTitleText": "添加就诊人", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myrecord-detail", + "style": { + "navigationBarTitleText": "处方详情", + "enablePullDownRefresh": false + } + }, + { + "path": "my/record-pay", + "style": { + "navigationBarTitleText": "预约购药", + "enablePullDownRefresh": false + } + }, + { + "path": "my/unpaid-order", + "style": { + "navigationBarTitleText": "订单详情", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myreport", + "style": { + "navigationBarTitleText": "检查报告", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myinfo", + "style": { + "navigationBarTitleText": "就诊人管理", + "enablePullDownRefresh": false + } + }, + { + "path": "my/my_online", + "style": { + "navigationBarTitleText": "线上复诊", + "enablePullDownRefresh": false + } + }, + { + "path": "my/mystore", + "style": { + "navigationStyle": "default", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#1777FF", + "navigationBarTextStyle": "white" + } + }, + { + "path": "my/mycollection", + "style": { + "navigationBarTitleText": "个人资料", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myabout", + "style": { + "navigationBarTitleText": "关于", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myorder", + "style": { + "navigationBarTitleText": "问诊记录", + "enablePullDownRefresh": false + } + }, + { + "path": "my/myrecord", + "style": { + "navigationBarTitleText": "处方记录", + "enablePullDownRefresh": true + } + }, + { + "path": "my/myappiont", + "style": { + "navigationBarTitleText": "挂号记录", + "enablePullDownRefresh": true + } + }, + { + "path": "my/myinfo-edit", + "style": { + "navigationBarTitleText": "编辑信息", + "enablePullDownRefresh": false + } + }, + { + "path": "my/my-drug/drug-list", + "style": { + "navigationBarTitleText": "产品订单", + "enablePullDownRefresh": true, + "onReachBottomDistance": 50 + } + }, + { + "path": "my/my-drug/drug-info", + "style": { + "navigationBarTitleText": "订单详情", + "enablePullDownRefresh": false + } + }, + { + "path": "my/my-drug/to-next", + "style": { + "navigationBarTitleText": "订单详情", + "enablePullDownRefresh": false + } + } + ] + }, + { + "root": "subPackages", + "pages": [ + { + "path": "register/register", + "style": { + "navigationBarTitleText": "确认挂号信息" + } + }, + { + "path": "register/register-success", + "style": { + "navigationBarTitleText": "确认挂号信息" + } + }, + { + "path": "register/register-info", + "style": { + "navigationBarTitleText": "挂号详情", + "navigationStyle": "custom" + } + } + ] + }, + { + "root": "subPackages", + "pages": [ + { + "path": "shop/orders", + "style": { + "navigationBarTitleText": "商城订单", + "enablePullDownRefresh": true + } + }, + { + "path": "shop/search-home", + "style": { + "navigationBarTitleText": "萧康诊所门店" + } + }, + { + "path": "shop/search-list", + "style": { + "navigationBarTitleText": "萧康诊所门店" + } + }, + { + "path": "shop/orders-detail", + "style": { + "navigationBarTitleText": "商品详情" + } + }, + { + "path": "shop/shop-cate", + "style": { + "navigationBarTitleText": "购物车" + } + }, + { + "path": "shop/shop-pay", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "shop/paied", + "style": { + "navigationBarTitleText": "确认付款信息" + } + }, + { + "path": "shop/paied-detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "shop/written", + "style": { + "navigationBarTitleText": "买家留言" + } + }, + { + "path": "shop/after-sales", + "style": { + "navigationBarTitleText": "申请售后" + } + }, + { + "path": "shop/logistics", + "style": { + "navigationBarTitleText": "物流详情" + } + } + ] + }, + { + "root": "subPackages", + "pages": [ + { + "path": "setup/filed", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "setup/choose-area", + "style": { + "navigationBarTitleText": "管理地址" + } + }, + { + "path": "setup/area-list", + "style": { + "navigationBarTitleText": "地址管理" + } + }, + { + "path": "setup/fw-serve", + "style": { + "navigationBarTitleText": "服务协议" + } + }, + { + "path": "setup/ys-serve", + "style": { + "navigationBarTitleText": "隐私政策" + } + }, + { + "path": "setup/zz-serve", + "style": { + "navigationBarTitleText": "资质证照" + } + }, + { + "path": "setup/customer-service", + "style": { + "navigationBarTitleText": "客服中心" + } + }, + { + "path": "chat/chat", + "style": { + "navigationBarTitleText": "在线问诊", + "enablePullDownRefresh": false + } + } + ] + } + ], + "tabBar": { + "fontSize": "18px", + "height": "60px", + "spacing": "4px", + "backgroundColor": "#fff", + "selectedColor": "#1575FC", + "list": [ + { + "pagePath": "pages/home/home", + "text": "首页", + "iconPath": "static/home/02.png", + "selectedIconPath": "static/home/01.png" + }, + { + "pagePath": "pages/cate/index", + "text": "资讯", + "iconPath": "static/home/03.png", + "selectedIconPath": "static/home/04.png" + }, + { + "pagePath": "pages/index/index", + "text": "消息", + "iconPath": "static/home/05.png", + "selectedIconPath": "static/home/06.png" + }, + { + "pagePath": "pages/mine/mine", + "text": "我的", + "iconPath": "static/home/07.png", + "selectedIconPath": "static/home/08.png" + } + ], + "color": "" + }, + "globalStyle": { + "navigationBarTextStyle": "black", + // "navigationBarTitleText": "萧康互联网医院", + "navigationBarBackgroundColor": "#F8FAFC", + "backgroundColor": "#F8F8F8" + }, + "uniIdRouter": {} } diff --git a/pages/Inquiries/Inquiries.vue b/pages/Inquiries/Inquiries.vue index e7750bf..1ff888b 100644 --- a/pages/Inquiries/Inquiries.vue +++ b/pages/Inquiries/Inquiries.vue @@ -60,7 +60,7 @@ - 挂号 + {{ typeMap[type] }} @@ -134,6 +134,12 @@ }, data() { return { + typeMap: { + 0: '挂号', + 1: '咨询', + 2: '复诊', + 3: '购药', + }, dropdownMask: true, show: false, keyword: "", @@ -228,11 +234,27 @@ }, // 医生id goLookDoctor(id) { + if (this.type === '2') { + return uni.navigateTo({ + url: '/subPackages/product/product?doctor_id=' + id + '®ister_type=2' + }) + } else if (this.type === '3') { + console.log(this.type, 'sssssssssssssssssssss') + return uni.navigateTo({ + url: '/subPackages/product/product?doctor_id=' + id + '®ister_type=3' + }) + } uni.navigateTo({ url: '/subPackages/doctor/doctor-detail?id=' + id }) }, + goProduct() { + uni.navigateTo({ + url: '/subPackages/product/product?id=' + id + }) + }, + // 医生列表 getList() { doctorList({ diff --git a/pages/home/home.vue b/pages/home/home.vue index 4229bd6..6222961 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -35,28 +35,61 @@ - - + + - 挂号咨询 - + + 到店挂号 + - - - - - - 线上复诊 - - + + + + + + + + + + + + + + 预约购药 + + + + + + + + + + + + + + + + + + + + + + + + 预约购药 + + - + 医生列表 更多 @@ -64,7 +97,7 @@ - + @@ -108,6 +141,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,6 +199,8 @@ export default { data() { return { + storeId: 0, + storeType: 0, storeinfo: [], doctorList: [], show: true, @@ -178,7 +250,8 @@ }, onReady() { - if (uni.getStorageSync('stores_id')) { + console.log(uni.getStorageSync('store_id'), '3') + if (uni.getStorageSync('store_id')) { this.getStore(); } else { this.goNewlist() @@ -193,11 +266,11 @@ }) }, methods: { - goYard() { + goYard(type) { //订阅消息 uni.navigateTo({ - url: '/pages/Inquiries/Inquiries?type=' + 1 + url: '/pages/Inquiries/Inquiries?type=' + type }) // uni.requestSubscribeMessage({ // tmplIds: ['JdSs08cMSiL17xwwHZ8fZ5UBUqeY0eKAuvyW7n4Fl20', @@ -213,44 +286,53 @@ // }) }, // 线上复诊 - golist() { - // 提醒用户正在开发 - uni.showToast({ - title: '正在开发中', - icon: 'none', - duration: 2000 + golist(type) { + if (type === 3) { + return uni.navigateTo({ + url: '/subPackages/product/product?doctor_id=' + 39 + '®ister_type=3' + }) + } + uni.navigateTo({ + // url: '/subPackages/product/product' + url: '/pages/Inquiries/Inquiries?type=' + type }) - return; - // this.bgShow = true - let that = this - if (!this.flag) { - this.getH5() - this.flag = true - uni.showLoading({ - title: "加载中" - }); - - setTimeout(() => { - uni.hideLoading(); - if (uni.getStorageSync('token_platform_id')) { - uni.navigateTo({ - url: '/subPackages/my/my_online', - success: () => { - setTimeout(() => { - that.flag = false; - }, 200) - uni.hideLoading(); - }, - fail: () => { - setTimeout(() => { - that.flag = false; - }, 200) - uni.hideLoading(); - } - }) - } - }, 600) - } + // // 提醒用户正在开发 + // uni.showToast({ + // title: '正在开发中', + // icon: 'none', + // duration: 2000 + // }) + // return; + // // this.bgShow = true + // let that = this + // if (!this.flag) { + // this.getH5() + // this.flag = true + // uni.showLoading({ + // title: "加载中" + // }); + // + // setTimeout(() => { + // uni.hideLoading(); + // if (uni.getStorageSync('token_platform_id')) { + // uni.navigateTo({ + // url: '/subPackages/my/my_online', + // success: () => { + // setTimeout(() => { + // that.flag = false; + // }, 200) + // uni.hideLoading(); + // }, + // fail: () => { + // setTimeout(() => { + // that.flag = false; + // }, 200) + // uni.hideLoading(); + // } + // }) + // } + // }, 600) + // } }, getH5() { // 进入token @@ -263,7 +345,7 @@ nickname: uni.getStorageSync('userinfo')['nickname'], openid: uni.getStorageSync('userinfo')['openid'], session_key: uni.getStorageSync('userinfo')['session_key'], - store_id: uni.getStorageSync('stores_id') || '11001', + store_id: uni.getStorageSync('store_id') || '11001', }, }).then((res) => { if (res.data.errcode == 0) { @@ -290,7 +372,7 @@ }, goLookDoctor(id, sts_id) { if (!sts_id) { - let sts_id = uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') + let sts_id = uni.getStorageSync('store_id') } setTimeout(() => { @@ -328,16 +410,17 @@ // 门店 getStore() { - if (uni.getStorageSync('stores_id')) { + if (uni.getStorageSync('store_id')) { this.show = false storeInfo({ method: "post", data: { - store_id: uni.getStorageSync('stores_id') || '11001', + store_id: uni.getStorageSync('store_id') || '11001', } }).then((res) => { // console.log(res, 'info'); if (res.data.errcode == 0) { + this.storeType = res.data.data.store['type'] this.infoList = res.data.data this.headerTitle = res.data.data.store['name'] uni.setNavigationBarTitle({ @@ -356,10 +439,14 @@ } }) } else { + console.log(uni.getStorageSync('store_id')) this.goNewlist() } }, + /** + * 获取绑定的用户诊所,选择最后登录的 + */ goNewlist() { storeList({ method: "post", @@ -376,8 +463,10 @@ this.getBannered(); } else { this.storeinfo = res.data.data.list.filter((item) => item.is_online == 1) + console.log(this.storeinfo, 'storeinfo') uni.setStorageSync('store_id', this.storeinfo[0].store.id) this.headerTitle = this.storeinfo[0].store['name'] + // this.storeType = this.storeinfo[0].store['type'] uni.setNavigationBarTitle({ title: this.headerTitle, success() { @@ -418,12 +507,12 @@ doctorList({ method: "post", data: { - store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001', + store_id: uni.getStorageSync('store_id') || '11001', } }).then((res) => { // console.log(res, 'list'); if (res.data.errcode === 0) { - this.doctorList = (res.data.data.list).slice(0, 3) + this.doctorList = (res.data.data.list).slice(0, 5) } }) }, @@ -440,11 +529,11 @@ if (res.data.errcode == 0) { this.getStore() this.getList(); - uni.showToast({ - title: '切换成功', - duration: 2000, - icon: "success" - }); + // uni.showToast({ + // title: '切换成功', + // duration: 2000, + // icon: "success" + // }); } }) }, @@ -454,13 +543,15 @@ getBanner({ method: "post", data: { - store_id: uni.getStorageSync('stores_id') || uni.getStorageSync('store_id') || '11001', + store_id: uni.getStorageSync('store_id') || '11001', } }).then((res) => { console.log(res, 'info'); if (res.data.errcode == 0) { this.info = res.data.data this.urlInfo = res.data.data.nav + this.storeType = res.data.data.type + console.log(this.storeType) this.list = (res.data.data.nav).map((item) => { return item.pic }) @@ -491,12 +582,14 @@ } }, mounted() { + + console.log('加载js') const token = uni.getStorageSync('token') - const id = uni.getStorageSync('stores_id') + const id = uni.getStorageSync('store_id') const d_id = uni.getStorageSync('doctors_id') const d_store = uni.getStorageSync('st_id') if (token && id) { - console.log('门店码'); + console.log(id, 'ssssss') this.toChang(id) } if (d_id && token && d_store) { @@ -504,8 +597,14 @@ } }, onShow() { + + console.log('显示') + this.storeId = uni.getStorageSync('store_id'); this.infoList = "" - this.goNewlist() + // this.goNewlist() + // 获取门店信息 + this.getStore(); + // 获取医生列表 this.getList(); }, // onUnload() { diff --git a/pages/home/index.vue b/pages/home/index.vue index a2f04c0..98dc6c5 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -34,7 +34,7 @@ - 挂号咨询 + 到店挂号 @@ -43,7 +43,7 @@ - 线上复诊 + 预约购药 @@ -218,7 +218,7 @@ getBanner({ method: "post", data: { - store_id: uni.getStorageSync('stores_id') || '11001', + store_id: uni.getStorageSync('store_id') || '11001', } }).then((res) => { if (res.data.errcode == 0) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 150a373..5bece67 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -93,7 +93,7 @@ - + @@ -207,7 +207,10 @@ export default { // console.log(res, 'res'); }) }, - goChat(item) { + goChat(item, index) { + console.log(this.imChat, 'ssssssssss') + console.log(item, 'ssssssssss') + console.log(index, 'ssssssssss') uni.navigateTo({ url: `/subPackages/chat/chat?room_id=${item.room_id}&nick_name=${item.nick_name}&user_id=${item.id}&avatar=${item.avatar}` }) diff --git a/pages/login/login.vue b/pages/login/login.vue index da29a1f..3f45519 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -45,15 +45,16 @@ import { getAgreem, getLogin, - getsLogin + getsLogin, storeChange } from '../../request/api/api.js' +import {bindUserApi} from "@/request/api/salesperson"; export default { data() { return { code: "", form: { - check: false + check: true }, encryptedData: "", iv: "", @@ -88,10 +89,15 @@ export default { // uni.navigateBack({ delta: 1 }) }, getPhoneNumber(e) { - uni.showLoading({ + uni.loading({ title: "加载中" }); + setTimeout(function () { + + uni.hideLoading(); + }, 800) + return; if (!this.form['check']) { uni.showToast({ icon: "error", @@ -205,6 +211,11 @@ export default { }, getToLogin(e) { + + uni.showLoading({ + title: "登录中" + }); + uni.login({ provider: 'weixin', success: (loginRes) => { @@ -217,14 +228,34 @@ export default { status: 1 } }).then((res) => { + + uni.hideLoading(); // console.log(res, "res"); if (res.data.errcode == 0) { uni.setStorageSync('token', res.data.data.token) //存储token uni.setStorageSync('user_id', res.data.data.data.user.id) uni.setStorageSync('userinfo', res.data.data.data['user']) - uni.setStorageSync('store_id', res.data.data.data.store_id) + if (uni.getStorageSync('salesperson_id')) { + bindUserApi({ + user_id: res.data.data.data.user.id, + salesperson_id: uni.getStorageSync('salesperson_id'), + }).then((res) => { + console.log(res, 'bindUserApi', res); + }) + } + if (uni.getStorageSync('store_id')) { + + storeChange({ + method: "post", + data: { + store_id: uni.getStorageSync('store_id') + } + }) + } else { + uni.setStorageSync('store_id', res.data.data.data.store_id) + } if (res.data.data.data.user.mobile != '') { setTimeout(function () { uni.reLaunch({ diff --git a/request/api/order.js b/request/api/order.js new file mode 100644 index 0000000..3c51e0c --- /dev/null +++ b/request/api/order.js @@ -0,0 +1,20 @@ +import http from './request' +import {get, post, uploadFile} from './http' + +const prefix = '/order'; +/** + * 获取扫码诊所的商品详情 + * @param params + * @returns {Promise<*>} + */ +export async function genOrderApi(params) { + return await post(`${prefix}/gen-order`, params, 3) +} +/** + * 保存购药、复诊状态下的挂号信息 + * @param params + * @returns {Promise<*>} + */ +export async function saveRegisterInfoApi(params) { + return await post(`${prefix}/save-register-info`, params, 3) +} diff --git a/request/api/request.js b/request/api/request.js index b84db95..76a3bea 100644 --- a/request/api/request.js +++ b/request/api/request.js @@ -25,11 +25,11 @@ function request(url, params, method = 0) { let baseURL = isDev === true? 'http://127.0.0.1:18000/member': "https://app.xiaokang88.com/member" // let baseURL = "http://127.0.0.1:18000/member" if (url.split('/').indexOf('imApi') !== -1) { - baseURL = "http://127.0.0.1:12080/api" - let baseURL = isDev === true? 'http://127.0.0.1:12080/api': "https://app.xiaokang88.com/member" + // baseURL = "http://127.0.0.1:12080/api" + baseURL = isDev === true? 'http://127.0.0.1:12080/api': "http://im.xiaokang88.com/api" } if (url.split('/').indexOf('newApi') !== -1) { - baseURL = isDev === true? 'https://shop.xiaokang88.com/member': "https://shop.xiaokang88.com/member" + baseURL = isDev === true? 'http://127.0.0.1:18018/member': "https://shop.xiaokang88.com/member" } if (url.split('/').indexOf('xkApi') !== -1) { baseURL = isDev === true? 'http://127.0.0.1:18001/api/mobile': "https://api.xiaokang88.com/api/mobile" diff --git a/request/api/salesperson.js b/request/api/salesperson.js new file mode 100644 index 0000000..349ef50 --- /dev/null +++ b/request/api/salesperson.js @@ -0,0 +1,10 @@ +import http from './request' +import {get, post, uploadFile} from './http' +/** + * 绑定推广员 + * @param params + * @returns {Promise<*>} + */ +export async function bindUserApi(params) { + return await post('/salesperson/bind-user', params, 3) +} diff --git a/request/api/store.js b/request/api/store.js new file mode 100644 index 0000000..ca34bd4 --- /dev/null +++ b/request/api/store.js @@ -0,0 +1,18 @@ +import http from './request' +import {get, post, uploadFile} from './http' +/** + * 获取扫码诊所的商品列表 + * @param params + * @returns {Promise<*>} + */ +export async function getStoreDrugListBySalespersonApi(params) { + return await get('/store/drug-list-by-salesperson', params, 3) +} +/** + * 获取扫码诊所的商品详情 + * @param params + * @returns {Promise<*>} + */ +export async function getStoreDrugDetailApi(params) { + return await get('/store/product-detail', params, 3) +} diff --git a/request/api/tmp.js b/request/api/tmp.js new file mode 100644 index 0000000..349ef50 --- /dev/null +++ b/request/api/tmp.js @@ -0,0 +1,10 @@ +import http from './request' +import {get, post, uploadFile} from './http' +/** + * 绑定推广员 + * @param params + * @returns {Promise<*>} + */ +export async function bindUserApi(params) { + return await post('/salesperson/bind-user', params, 3) +} diff --git a/subPackages/doctor/doctor-detail.vue b/subPackages/doctor/doctor-detail.vue index 4f8d4f2..1bb9a41 100644 --- a/subPackages/doctor/doctor-detail.vue +++ b/subPackages/doctor/doctor-detail.vue @@ -153,7 +153,7 @@ } else { // 点击详情 this.doctorID = e.id - const id = e.sts_id || uni.getStorageSync('stores_id') + const id = e.sts_id || uni.getStorageSync('store_id') if (id!='undefined' && id) { console.log('idddd'); this.toChang(id) diff --git a/subPackages/doctor/doctor-userinfo.vue b/subPackages/doctor/doctor-userinfo.vue index c0bdf13..ce72f7e 100644 --- a/subPackages/doctor/doctor-userinfo.vue +++ b/subPackages/doctor/doctor-userinfo.vue @@ -2,7 +2,7 @@ - 您需要为谁挂号 + 您需要为谁{{ registerType === '3'? '购药' : '挂号' }} 请选择患者信息,以便医生给出更准确的诊疗建议,患者信息仅医生可见 @@ -26,7 +26,7 @@ - + 挂号类型 @@ -37,8 +37,10 @@ active-color="#2979FF" @change="handleTypeChange" > - 线下问诊 + 线下问诊 线上咨询 + 在线复诊 + 预约购药 @@ -131,6 +133,7 @@ import { registe } from '@/request/api/api.js' import {checkDev} from "@/utils/utils"; +import {genOrderApi, saveRegisterInfoApi} from "@/request/api/order"; export default { data() { return { @@ -182,11 +185,20 @@ export default { avator: "", name: "", heathList: [], // 健康信息 + rInfo: [], // 健康信息 registerType: "0", // 新增:挂号类型(0线下/1线上) } }, onLoad(e) { this.Did = e.id + if (e.r_type) { + + this.registerType = e.r_type + // this.registerType = '1' + this.rInfo = e.r_info + } + + console.log(e) }, computed: { setInfoList() { @@ -322,11 +334,41 @@ export default { if (res.data.errcode == 0) { this.register_id = res.data.data.register_id + // if (this.registerType === "3" || this.registerType === "2") { + if (this.registerType === "3") { + let params = JSON.parse(this.rInfo); + + // 保存病患信息 + saveRegisterInfoApi({ + register_id: this.register_id, + doctor_id: params.doctor_id, + drug_id: params.id, + has_visited: params.hasVisited, + has_used_drug: params.hasUsedDrug, + illnessInfo: params.illnessInfo, + type: params.type, + number: params.number, + store_id: uni.getStorageSync('store_id') || '11001', + }).then(() => { + + // 直接跳转到付款页面 + genOrderApi({ + register_id: this.register_id, + register_info: this.rInfo, + }).then((resOrder) => { + console.log(resOrder); + uni.navigateTo({ + url: `/subPackages/my/my-drug/drug-info?id=${resOrder.data.result.id}&order_type=${resOrder.data.result.order_type}` + }) + }) + }) + return; + } uni.setStorageSync('register_id', this.register_id) if (res.data.data.isHas == 0) { uni.navigateTo({ - url: "/subPackages/register/register?id=" + this.register_id + "&doctor_id=" + this.Did, + url: `/subPackages/register/register?id=${this.register_id}&doctor_id=${this.Did}&r_info=${this.rInfo}`, }) } else { this.$refs.uToast.show({ @@ -336,7 +378,7 @@ export default { }) setTimeout(() => { uni.navigateTo({ - url: "/subPackages/register/register?id=" + this.register_id + "&doctor_id=" + this.Did, + url: `/subPackages/register/register?id=${this.register_id}&doctor_id=${this.Did}&r_info=${this.rInfo}`, }) }, 900) } diff --git a/subPackages/my/my-drug/drug-info.vue b/subPackages/my/my-drug/drug-info.vue index 2028564..c45f2b8 100644 --- a/subPackages/my/my-drug/drug-info.vue +++ b/subPackages/my/my-drug/drug-info.vue @@ -173,7 +173,6 @@ isshow: true, isshowed: false, show: false, - order_no: '', form: { check: false }, @@ -187,6 +186,7 @@ order_id: "", // 订单id order_no: "", // 订单编号 p_id: "", // 处方id + orderType: 0, // 处方id list: [{ text: '快递到家' }, { @@ -211,6 +211,7 @@ }, onLoad(e) { this.p_id = e.id + this.orderType = e.order_type }, methods: { // 不需要代煎-代煎费 @@ -316,6 +317,14 @@ uni.setStorageSync('delivery_method', res.data.data.ProductOrder.delivery_method) // this.order_no = res.data.data.ProductOrder.order_no // console.log(this.west.content); + + if (res.data.data.ProductOrder.delivery_method == 1) { + this.isshowed = true + this.isshow = false + } else { + this.isshowed = false + this.isshow = true + } } }) }, @@ -369,6 +378,9 @@ }, // 地址 toChoose() { + // if (this.orderType === 2) { + // return; + // } uni.navigateTo({ url: '/subPackages/setup/area-list?id=' + this.p_id + '&order_id=' + this.order_id }) @@ -400,6 +412,16 @@ }); if (res.data.errcode == 0) { + if (!res.data.data.appId) { + setTimeout(() => { + that.flag = false + uni.navigateTo({ + url: '/subPackages/my/my-drug/drug-list' + }) + uni.hideLoading(); + }, 300) + return; + } uni.requestPayment({ provider: res.data.data.appId, diff --git a/subPackages/my/my-drug/drug-list.vue b/subPackages/my/my-drug/drug-list.vue index 4041834..e746178 100644 --- a/subPackages/my/my-drug/drug-list.vue +++ b/subPackages/my/my-drug/drug-list.vue @@ -304,6 +304,16 @@ // console.log(res, 'pay'); if (res.data.errcode == 0) { + if (!res.data.data.appId) { + setTimeout(() => { + that.flag = false + uni.navigateTo({ + url: '/subPackages/my/my-drug/drug-list' + }) + uni.hideLoading(); + }, 300) + return; + } uni.requestPayment({ provider: res.data.data.appId, timeStamp: res.data.data.timestamp, diff --git a/subPackages/my/myinfo-add.vue b/subPackages/my/myinfo-add.vue index 6c5f050..0e7cfc2 100644 --- a/subPackages/my/myinfo-add.vue +++ b/subPackages/my/myinfo-add.vue @@ -21,8 +21,13 @@ 性别 - + + + + + + + @@ -49,6 +54,13 @@ @click="actionSheetCallback"> + + + 设为默认就诊人 + (非必填) + + + @@ -183,13 +195,13 @@ - - - 设为默认就诊人 - (非必填) - - - + + + + + + + @@ -227,7 +239,7 @@ text: "", // 添加病情 form: { identityCardNo: "", - sex: "", + sex: "男", age: "", }, // 身份证 sex: "", @@ -436,7 +448,7 @@ id: this.addid, name: this.names, id_card: this.form.identityCardNo, - sex: (this.sex) , + sex: (this.form.sex) , age: this.form.age, mobile: this.phone, relation: this.relation, diff --git a/subPackages/my/mystore.vue b/subPackages/my/mystore.vue index 3ba0867..fcacab5 100644 --- a/subPackages/my/mystore.vue +++ b/subPackages/my/mystore.vue @@ -98,18 +98,23 @@ } }).then((res) => { if (res.data.errcode == 0) { + uni.setStorageSync('store_id', e) + uni.setStorageSync('stores_id', e) uni.showToast({ title: '切换成功', duration: 2000, icon: "success" }); - uni.setStorageSync('store_id', e) // uni.removeStorageSync('stores_id') - setTimeout(() => { - uni.switchTab({ - url: '/pages/home/home' - }) - }, 2000) + // setTimeout(() => { + // uni.switchTab({ + // url: '/pages/home/home' + // }) + // }, 2000) + + uni.switchTab({ + url: '/pages/home/home' + }) } }) @@ -163,7 +168,7 @@ // this.getStore(); }, onUnload() { - uni.removeStorageSync('stores_id') + // uni.removeStorageSync('store_id') }, filters: { //过滤器 用于格式化时间 diff --git a/subPackages/product/product.vue b/subPackages/product/product.vue new file mode 100644 index 0000000..917e3e9 --- /dev/null +++ b/subPackages/product/product.vue @@ -0,0 +1,221 @@ + + + + + \ No newline at end of file diff --git a/subPackages/product/symptoms.vue b/subPackages/product/symptoms.vue new file mode 100644 index 0000000..c283c66 --- /dev/null +++ b/subPackages/product/symptoms.vue @@ -0,0 +1,447 @@ + + + + + \ No newline at end of file diff --git a/subPackages/register/register.vue b/subPackages/register/register.vue index 3c7320c..2d6b410 100644 --- a/subPackages/register/register.vue +++ b/subPackages/register/register.vue @@ -137,6 +137,7 @@ } from '../../request/api/api'; import {createRoomByDoctorIdApi, sendToUserApi} from "@/request/api/im"; import {checkDev} from "@/utils/utils"; + import {genOrderApi} from "@/request/api/order"; export default { data() { return { @@ -153,14 +154,18 @@ flag: true, registerType: '线下就诊', registerMap: { - 0: '线下就诊', - 1: '线上咨询' - } + 0: '挂号', + 1: '咨询', + 2: '复诊', + 3: '购药', + }, + rInfo: {}, } }, onLoad(e) { // console.log(e, 'role'); this.register_id = e.id + this.rInfo = e.r_info this.currentUserId = 'user-' + uni.getStorageSync('user_id') || 'user-2512'; this.currentDoctorId = 'doctor-' + e.doctor_id; // if (this.currentDoctorId == null) { @@ -188,6 +193,7 @@ }, // 确认挂号 next() { + let that = this if (this.flag) { this.flag = false @@ -203,9 +209,9 @@ uni.showLoading({ title: "加载中" }); + console.log(checkDev('open-im') && that.registList.register_type === 1, 'sssssssssssss') - - if (checkDev('open-im') && that.registList.register_type === 1) { + if (checkDev('open-im') && (that.registList.register_type === 1 || that.registList.register_type === 2)) { createRoomByDoctorIdApi({ doctor_id: that.currentDoctorId }).then(result => { @@ -219,14 +225,38 @@ }), duration: 0 }) + // 发送在线复诊信息 + if (that.registList.register_type === 2) { + that.rInfo.register_id = that.register_id; + sendToUserApi({ + room_id: result.data.result.room_id, + sender_user_id: that.currentUserId, + receiver_user_id: that.currentDoctorId, + message_type: 11, + message_content: that.rInfo, + duration: 0 + }) + } }) } if (res.data.data.is_paid == 1) { + + if (that.registList.register_type === 3) { + genOrderApi({ + register_id: that.register_id, + register_info: that.rInfo, + }).then((resOrder) => { + console.log(res); + uni.navigateTo({ + url: `/subPackages/my/my-drug/drug-info?id=${resOrder.data.result.id}&order_type=${resOrder.data.result.order_type}` + }) + }) + return; + } setTimeout(() => { uni.navigateTo({ - url: '/subPackages/register/register-success?id=' + this - .register_id, + url: `/subPackages/register/register-success?id=${that.register_id}®ister_type=${that.registList.register_type}`, }) uni.hideLoading(); }, 800) diff --git a/utils/utils.js b/utils/utils.js index bc11277..18aa351 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -6,7 +6,8 @@ export function checkDev(key = '') { // 判断某些模块是否开启 switch (key) { case 'dev': - return true; + return false; + // return true; case 'open-im': return false; default: