fix: 修复了一些东西,新增了方法

This commit is contained in:
2025-11-19 13:48:42 +08:00
parent 20bb923494
commit 33750943b4
23 changed files with 1655 additions and 604 deletions

View File

@@ -60,7 +60,7 @@
</view>
</view>
<view class="list_right">挂号</view>
<view class="list_right">{{ typeMap[type] }}</view>
</view>
<!-- 文字部分 -->
<view class="card">
@@ -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 + '&register_type=2'
})
} else if (this.type === '3') {
console.log(this.type, 'sssssssssssssssssssss')
return uni.navigateTo({
url: '/subPackages/product/product?doctor_id=' + id + '&register_type=3'
})
}
uni.navigateTo({
url: '/subPackages/doctor/doctor-detail?id=' + id
})
},
goProduct() {
uni.navigateTo({
url: '/subPackages/product/product?id=' + id
})
},
// 医生列表
getList() {
doctorList({

View File

@@ -35,28 +35,61 @@
</view>
<!-- 导航栏 -->
<view class="nav">
<view class="nav_service" @click="goYard">
<view class="nav" v-if="storeType === '0'">
<view class="nav_service" @click="goYard(1)">
<view class="nav_service_img">
<image src="../../static/home/bg1.png" mode=""></image>
</view>
<view class="nav_service_title">
挂号咨询
</view>
<!-- 挂号咨询-->
到店挂号
</view>
</view>
<view class="nav_service" @click="golist">
<view class="nav_service_img">
<image src="../../static/home/bg2.png" mode=""></image>
</view>
<view class="nav_service_title">
线上复诊
</view>
</view>
<!-- <view class="nav_service" @click="golist(2)">-->
<!-- <view class="nav_service_img">-->
<!-- <image src="../../static/home/bg2.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="nav_service_title">-->
<!-- 线上复诊-->
<!-- </view>-->
<!-- </view>-->
<view class="nav_service" @click="golist(3)">
<view class="nav_service_img">
<image src="../../static/home/bg2.png" mode=""></image>
</view>
<view class="nav_service_title">
预约购药
</view>
</view>
</view>
<!-- &lt;!&ndash; 导航栏第二行 &ndash;&gt;-->
<!-- <view class="nav">-->
<!-- <view class="nav_service" @click="golist(3)">-->
<!-- <view class="nav_service_img">-->
<!-- <image src="../../static/home/bg2.png" mode=""></image>-->
<!-- </view>-->
<!-- <view class="nav_service_title">-->
<!-- 预约购药-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- 导航栏第二行 -->
<view class="nav" v-if="storeType === '1'">
<view class="nav_service" @click="golist(3)">
<view class="nav_service_img">
<image src="../../static/home/bg2.png" mode=""></image>
</view>
<view class="nav_service_title">
预约购药
</view>
</view>
</view>
<view class="doctor_list" @click="goYard">
<view v-if="storeType === '0'" class="doctor_list" @click="goYard(1)">
医生列表
<view class="info">
更多 <text class="iconfont icon-jiantou1"></text>
@@ -64,7 +97,7 @@
</view>
<!-- 医生列表 -->
<view class="doctor-card" @click="goLookDoctor(item.id)" v-for="(item,index) in doctorList" :key="item.id">
<view v-if="storeType === '0'" class="doctor-card" @click="goLookDoctor(item.id)" v-for="(item,index) in doctorList" :key="item.id">
<view class="card-content">
<!-- 医生头像 -->
<image :src="item.avatar || '/static/mine/avatar_1.png'" mode="aspectFill" class="doctor-avatar"></image>
@@ -108,6 +141,43 @@
</view>
</view>
<!-- 药店版本-->
<!-- <view v-if="storeType === '1'" class="doctor_list" @click="golist(3)">-->
<!-- 药品列表-->
<!-- <view class="info">-->
<!-- 更多 <text class="iconfont icon-jiantou1"></text>-->
<!-- </view>-->
<!-- </view>-->
<!-- &lt;!&ndash; 医生列表 &ndash;&gt;-->
<!-- <view v-if="storeType === '1'" class="doctor-card" @click="goLookDoctor(item.id)" v-for="(item,index) in doctorList" :key="item.id">-->
<!-- <view class="card-content">-->
<!-- &lt;!&ndash; 医生头像 &ndash;&gt;-->
<!-- <image :src="item.avatar || '/static/mine/avatar_1.png'" mode="aspectFill" class="doctor-avatar"></image>-->
<!-- &lt;!&ndash; 医生信息 &ndash;&gt;-->
<!-- <view class="doctor-info">-->
<!-- &lt;!&ndash; 姓名和职称 &ndash;&gt;-->
<!-- <view class="name-section">-->
<!-- <text class="doctor-name">{{item.name}}</text>-->
<!-- <view class="title-badge">{{item.title}}</view>-->
<!-- </view>-->
<!-- &lt;!&ndash; 科室和医院 &ndash;&gt;-->
<!-- <view class="department-section">-->
<!-- <text class="iconfont icon-location"></text>-->
<!-- <text class="department">{{item.depart}} | {{item.store}}</text>-->
<!-- </view>-->
<!-- &lt;!&ndash; 擅长领域 &ndash;&gt;-->
<!-- <view class="expertise">-->
<!-- <text class="expertise-label">擅长</text>-->
<!-- <text class="expertise-content">{{item.good_at}}</text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- 遮罩层 -->
<view class="bg-" v-if="bgShow" @click="bgShow=false">
@@ -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 + '&register_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() {

View File

@@ -34,7 +34,7 @@
<image src="../../static/home/bg1.png" mode=""></image>
</view>
<view class="nav_service_title">
挂号咨询
到店挂号
</view>
</view>
@@ -43,7 +43,7 @@
<image src="../../static/home/bg2.png" mode=""></image>
</view>
<view class="nav_service_title">
线上复诊
预约购药
</view>
</view>
</view>
@@ -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) {

View File

@@ -93,7 +93,7 @@
<!-- </view>-->
</view>
<!-- 在线问诊 - 用户-->
<view v-if="checkDev('open-im')" v-for="item in imChat" :key="item.id" class="list" @click="goChat(item)">
<view v-if="checkDev('open-im')" v-for="(item, index) in imChat" :key="item.id" class="list" @click="goChat(item, index)">
<!-- 头像 -->
<view class="avator">
<view class="img">
@@ -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}`
})

View File

@@ -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({