页面UI更新

This commit is contained in:
李琦
2026-06-01 09:52:26 +08:00
parent 63ea420c03
commit 105f9eafa2
11 changed files with 1250 additions and 860 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="consultation-container safe-area-inset-bottom"> <view class="consultation-container safe-area-inset-bottom">
<view class="consultation-header"> <view class="consultation-header">
<view class="header-back" @click="$emit('back')"> <view class="header-back" @click="handleHeaderBack">
<text class="iconfont icon-arrow-left"></text> <text class="iconfont icon-arrow-left"></text>
</view> </view>
<view class="header-title">{{ headerTitle }}</view> <view class="header-title">{{ headerTitle }}</view>
@@ -19,24 +19,25 @@
</view> </view>
</view> </view>
<u-popup <page-container
v-model="agreementPopupVisible" :show="agreementPopupVisible"
:safe-area-inset-bottom="true" position="bottom"
mode="bottom" round
height="88%" overlay
border-radius="20" custom-style="height:88%;"
:closeable="true" @clickoverlay="closeAgreement"
z-index="20000" @afterleave="closeAgreement"
> >
<view class="agreement-popup"> <view class="agreement-popup">
<view class="agreement-header"> <view class="agreement-header">
<text class="agreement-title">{{ currentAgreementName || '协议详情' }}</text> <text class="agreement-title">{{ currentAgreementName || '协议详情' }}</text>
<view class="agreement-close" @click="closeAgreement">×</view>
</view> </view>
<view class="agreement-content"> <scroll-view scroll-y class="agreement-content" :show-scrollbar="true">
<u-parse :html="agreementContent"></u-parse> <u-parse :html="agreementContent"></u-parse>
</view> </scroll-view>
</view> </view>
</u-popup> </page-container>
<scroll-view class="messages-scroll" scroll-y="true" :scroll-into-view="scrollIntoView" scroll-with-animation> <scroll-view class="messages-scroll" scroll-y="true" :scroll-into-view="scrollIntoView" scroll-with-animation>
<view class="messages-container"> <view class="messages-container">
@@ -235,6 +236,16 @@ export default {
}, },
}, },
methods: { methods: {
handleHeaderBack() {
if (this.showAgreement) {
this.closeAgreement();
return;
}
this.$emit('back');
},
closeAgreement() {
this.$emit('update:showAgreement', false);
},
answerButtonClass(answer, index) { answerButtonClass(answer, index) {
const answers = this.currentQuestionAnswers const answers = this.currentQuestionAnswers
const totalAnswers = answers.length const totalAnswers = answers.length
@@ -517,12 +528,24 @@ export default {
} }
.agreement-header { .agreement-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 50rpx 20rpx; padding: 30rpx 50rpx 20rpx;
border-bottom: 1rpx solid #e5e7eb; border-bottom: 1rpx solid #e5e7eb;
background: #fff; background: #fff;
position: sticky; flex-shrink: 0;
top: 0; }
z-index: 10;
.agreement-close {
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
color: #64748b;
line-height: 1;
} }
.agreement-title { .agreement-title {
@@ -530,12 +553,15 @@ export default {
font-weight: 600; font-weight: 600;
color: #1e293b; color: #1e293b;
line-height: 1.5; line-height: 1.5;
flex: 1;
min-width: 0;
} }
.agreement-content { .agreement-content {
flex: 1; flex: 1;
height: 0;
min-height: 200rpx;
padding: 30rpx 50rpx 40rpx; padding: 30rpx 50rpx 40rpx;
overflow-y: auto; box-sizing: border-box;
min-height: 0;
} }
</style> </style>

View File

@@ -1,6 +1,15 @@
import http from './request' import http from './request'
import { get } from './http' import { get } from './http'
/** 将 xk-api 的 code/result 格式转为旧版 errcode/data兼容现有页面 */
function normalizeXkApiResponse(res) {
if (res && res.data && (res.data.code === 0 || res.data.code === '0')) {
res.data.errcode = 0;
res.data.data = res.data.result;
}
return res;
}
// 登录 授权 其他手机号授权 // 登录 授权 其他手机号授权
export async function getsLogin(params) { export async function getsLogin(params) {
let data = await http('/oldApi/v1/user/login', params) let data = await http('/oldApi/v1/user/login', params)
@@ -34,20 +43,20 @@ export async function getAgreem(params) {
// 首页 门店 门店切换 // 首页 门店 门店切换
export async function storeChange(params) { export async function storeChange(params) {
let data = await http('/oldApi/v1/store/store-change', params) let data = await http('/xkApi/store/store-change', params)
return data return normalizeXkApiResponse(data)
} }
// 首页 门店 用户所有门店 // 首页 门店 用户所有门店
export async function storeList(params) { export async function storeList(params) {
let data = await http('/oldApi/v1/store/list', params) let data = await http('/xkApi/store/list', params)
return data return normalizeXkApiResponse(data)
} }
// 首页 门店 门店信息 // 首页 门店 门店信息
export async function storeInfo(params) { export async function storeInfo(params) {
let data = await http('/oldApi/v1/store/info', params) let data = await http('/xkApi/store/info', params)
return data return normalizeXkApiResponse(data)
} }
// 医生列表 // 医生列表

View File

@@ -141,6 +141,12 @@ function request(url, params, method = 0) {
} else if (url.indexOf('/xkApi/platform/qualifications') !== -1) { } else if (url.indexOf('/xkApi/platform/qualifications') !== -1) {
url = url.replace('/xkApi/platform/qualifications', '/guest/guest-platform/qualifications'); url = url.replace('/xkApi/platform/qualifications', '/guest/guest-platform/qualifications');
baseURL = envUrls.xkApi; baseURL = envUrls.xkApi;
} else if (url.indexOf('/xkApi/store/info') !== -1) {
url = url.replace('/xkApi/store/info', '/guest/guest-home/store-info');
baseURL = envUrls.xkApi;
} else if (url.indexOf('/xkApi/store/list') !== -1) {
url = url.replace('/xkApi/store/list', '/guest/guest-home/store-list');
baseURL = envUrls.xkApi;
} }
} }

View File

@@ -116,17 +116,25 @@
</scroll-view> </scroll-view>
<!-- 协议抽屉 --> <!-- 协议抽屉 -->
<u-popup v-model="showAgreement" :safe-area-inset-bottom="true" mode="bottom" height="88%" border-radius="20" <page-container
:closeable="true" z-index="20000"> :show="showAgreement"
position="bottom"
round
overlay
custom-style="height:88%;"
@clickoverlay="closeAgreement"
@afterleave="closeAgreement"
>
<view class="agreement-popup"> <view class="agreement-popup">
<view class="agreement-header"> <view class="agreement-header">
<text class="agreement-title">{{ currentAgreementName || '协议详情' }}</text> <text class="agreement-title">{{ currentAgreementName || '协议详情' }}</text>
<view class="agreement-close" @click="closeAgreement">×</view>
</view> </view>
<view class="agreement-content"> <scroll-view scroll-y class="agreement-content" :show-scrollbar="true">
<u-parse :html="agreementContent"></u-parse> <u-parse :html="agreementContent"></u-parse>
</view> </scroll-view>
</view> </view>
</u-popup> </page-container>
<!-- ================= 底部输入与工具栏 (重构优化版) ================= --> <!-- ================= 底部输入与工具栏 (重构优化版) ================= -->
<view class="chat-footer safe-area-inset-bottom" :style="{ bottom: keyboardHeight + 'px' }"> <view class="chat-footer safe-area-inset-bottom" :style="{ bottom: keyboardHeight + 'px' }">
@@ -327,9 +335,12 @@ export default {
}, },
onBackPress() { onBackPress() {
// 拦截物理返回键,跳转到首页 if (this.showAgreement) {
this.closeAgreement();
return true;
}
this.handleBack(); this.handleBack();
return true; // 阻止默认返回行为 return true;
}, },
onUnload() { onUnload() {
@@ -553,6 +564,10 @@ export default {
} }
}, },
closeAgreement() {
this.showAgreement = false;
},
// === 音频播放逻辑 === // === 音频播放逻辑 ===
playAudio(msg) { playAudio(msg) {
const audioUrl = getParsedContent(msg.message_type, msg.message_content); const audioUrl = getParsedContent(msg.message_type, msg.message_content);
@@ -1054,6 +1069,10 @@ export default {
// 处理返回操作(自定义返回逻辑) // 处理返回操作(自定义返回逻辑)
handleBack() { handleBack() {
if (this.showAgreement) {
this.closeAgreement();
return false;
}
// 跳转到首页tabBar页面需要使用switchTab // 跳转到首页tabBar页面需要使用switchTab
uni.switchTab({ uni.switchTab({
url: '/pages/index/index', url: '/pages/index/index',
@@ -1267,12 +1286,24 @@ $bg-white: #ffffff;
} }
.agreement-header { .agreement-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 50rpx 20rpx; padding: 30rpx 50rpx 20rpx;
border-bottom: 1rpx solid #e5e7eb; border-bottom: 1rpx solid #e5e7eb;
background: #fff; background: #fff;
position: sticky; flex-shrink: 0;
top: 0; }
z-index: 10;
.agreement-close {
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
color: #64748b;
line-height: 1;
} }
.agreement-title { .agreement-title {
@@ -1280,12 +1311,15 @@ $bg-white: #ffffff;
font-weight: 600; font-weight: 600;
color: #1e293b; color: #1e293b;
line-height: 1.5; line-height: 1.5;
flex: 1;
min-width: 0;
} }
.agreement-content { .agreement-content {
flex: 1; flex: 1;
height: 0;
min-height: 200rpx;
padding: 30rpx 50rpx 40rpx; padding: 30rpx 50rpx 40rpx;
overflow-y: auto; box-sizing: border-box;
min-height: 0;
} }
</style> </style>

View File

@@ -343,6 +343,13 @@ export default {
uni.showToast({ title: '缺少商品信息', icon: 'none' }); uni.showToast({ title: '缺少商品信息', icon: 'none' });
} }
}, },
onBackPress() {
if (this.mode === 'clinic_post_register' && this.showPostRegisterAgreement) {
this.showPostRegisterAgreement = false;
return true;
}
return false;
},
methods: { methods: {
postRegisterScrollToBottom() { postRegisterScrollToBottom() {
this.postRegisterScrollIntoView = 'bottom-anchor'; this.postRegisterScrollIntoView = 'bottom-anchor';
@@ -497,6 +504,10 @@ export default {
} }
}, },
handlePostRegisterBack() { handlePostRegisterBack() {
if (this.showPostRegisterAgreement) {
this.showPostRegisterAgreement = false;
return;
}
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定返回首页吗?未完成确认将无法同步给医生。', content: '确定返回首页吗?未完成确认将无法同步给医生。',

View File

@@ -542,7 +542,6 @@ export default {
let that = this let that = this
if (this.flag) { if (this.flag) {
this.flag = false this.flag = false
// 获取支付配置
getPayConfig({ getPayConfig({
method: "post", method: "post",
data: { data: {
@@ -585,30 +584,20 @@ export default {
}, 300) }, 300)
}, },
fail: function(err) { fail: function(err) {
that.flag = false that.flag = true
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '支付失败', title: err.errMsg && err.errMsg.indexOf('cancel') !== -1 ? '支付已取消' : '支付失败',
duration: 1500, duration: 1500,
mask: false, mask: false,
icon: 'error' icon: 'none'
}) })
setTimeout(() => {
if (res.data.msg) {
uni.showToast({
title: res.data.msg,
duration: 1500,
mask: false,
icon: 'error'
})
return
}
}, 1000)
} }
}) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
that.flag = true
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,
type: 'default', type: 'default',
@@ -616,6 +605,15 @@ export default {
}) })
} }
}).catch((err) => {
console.error('getPayConfig error:', err);
uni.hideLoading();
that.flag = true
uni.showToast({
title: '获取支付配置失败',
icon: 'none',
duration: 1500
})
}) })
} }

File diff suppressed because it is too large Load Diff

View File

@@ -6,51 +6,91 @@
<view class="store"> <view class="store">
<view class="name"> <view class="name">
<text>当前门店</text> <text>当前门店</text>
{{infoList.store.name}} {{ infoList.store && infoList.store.name }}
<u-tag
v-if="infoList.store"
:text="getStoreTypeLabel(infoList.store.type)"
:type="getStoreTypeTag(infoList.store.type)"
size="mini"
class="type-tag"
/>
</view> </view>
<view class="info" v-if="infoList.store"> <view class="info" v-if="infoList.store">
<text class="iconfont icon-icon-"></text> <text class="iconfont icon-icon-"></text>
营业时间 营业时间
{{infoList.store.start_time }}-{{infoList.store.end_time }} {{ infoList.store.start_time }}-{{ infoList.store.end_time }}
</view> </view>
<view class="info"> <view class="info" v-if="infoList.store">
<text class="iconfont icon-tel"></text> <text class="iconfont icon-tel"></text>
联系电话 联系电话
{{infoList.store.mobile}} {{ infoList.store.mobile }}
</view> </view>
<view class="info"> <view class="info" v-if="infoList.store">
<text class="iconfont icon-shouhuodizhi"></text> <text class="iconfont icon-shouhuodizhi"></text>
地址 &nbsp;&nbsp; 地址 &nbsp;&nbsp;
{{infoList.store.position}} {{ infoList.store.position }}
</view> </view>
</view> </view>
</view> </view>
<!-- 其他门店 -->
<view class="list"> <view class="list">
<view class="title"> <view class="title">
其他门店 其他门店
</view> </view>
<view class="tabs-wrap">
<!-- 空页 --> <u-tabs
<view class="empty" v-if="storeinfo.length<=0"> :list="tabList"
<image src="https://xiaokang88.oss-cn-hangzhou.aliyuncs.com/xk-client-wx/static/empty/orders.png" mode="aspectFit"></image> :is-scroll="false"
<text>暂无门店信息</text> :current="tabIndex"
@change="onTabChange"
></u-tabs>
</view> </view>
<swiper
class="store-swiper"
:current="tabIndex"
@change="onSwiperChange"
>
<swiper-item v-for="(tab, tabIdx) in tabList" :key="tabIdx">
<scroll-view scroll-y class="store-scroll">
<view class="empty" v-if="getFilteredStores(tabIdx).length <= 0">
<image src="https://xiaokang88.oss-cn-hangzhou.aliyuncs.com/xk-client-wx/static/empty/orders.png" mode="aspectFit"></image>
<text>暂无{{ tab.name }}信息</text>
</view>
<view class="item" @click="toChang(item.store.id)" v-for="(item,index) in storeinfo" :key="item.id"> <view
<view class="name"> class="item"
{{item.store.name}} :class="{ 'item-current': isCurrentStore(item.store.id) }"
</view> @click="onStoreItemClick(item)"
<view class="timer" v-if="item.store"> v-for="item in getFilteredStores(tabIdx)"
营业时间{{item.store.start_time }}-{{item.store.end_time }} :key="item.id"
&nbsp;</view> >
<view class="timer">地址{{item.store.position}}</view> <view class="name">
</view> {{ item.store.name }}
<u-tag
v-if="isCurrentStore(item.store.id)"
text="当前"
type="info"
size="mini"
class="type-tag"
/>
<u-tag
:text="getStoreTypeLabel(item.store.type)"
:type="getStoreTypeTag(item.store.type)"
size="mini"
class="type-tag"
/>
</view>
<view class="timer" v-if="item.store">
营业时间{{ item.store.start_time }}-{{ item.store.end_time }}
&nbsp;</view>
<view class="timer">地址{{ item.store.position }}</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view> </view>
</view> </view>
</template> </template>
@@ -60,131 +100,175 @@
storeInfo, storeInfo,
storeList storeList
} from '../../request/api/api' } from '../../request/api/api'
import { isGuestMode } from '@/common/utils/auth.js'
export default { export default {
data() { data() {
return { return {
isshow: false,
storeinfo: [], storeinfo: [],
infoList: [], infoList: {
headerTitle: "", // 标题 store: null
},
headerTitle: '',
tabIndex: 0,
tabChanging: false,
tabList: [
{ name: '诊所' },
{ name: '药店' }
],
} }
}, },
onLoad() {
// this.getStore();
},
created() { created() {
this.getStore(); this.getStore();
this.getInfo(); this.getInfo();
}, },
onReady() { onReady() {
this.getStore();
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.headerTitle, title: this.headerTitle,
success() {
console.log('success');
}
}); });
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 frontColor: '#000000',
}) })
}, },
methods: { methods: {
// 切换门店 parseApiData(res) {
toChang(e) { if (res.data.code === 0 || res.data.code === '0') {
// console.log(e, 'id'); return res.data.result;
storeChange({ }
method: "post", if (res.data.errcode === 0 || res.data.errcode === '0') {
data: { return res.data.data;
store_id: e }
return null;
},
isApiSuccess(res) {
return (res.data.code === 0 || res.data.code === '0')
|| (res.data.errcode === 0 || res.data.errcode === '0');
},
getStoreTypeLabel(type) {
return (type === 1 || type === '1') ? '药店' : '诊所';
},
getStoreTypeTag(type) {
return (type === 1 || type === '1') ? 'success' : 'primary';
},
getFilteredStores(tabIdx) {
return this.storeinfo.filter((item) => {
if (!item.store) return false;
const storeType = item.store.type;
return tabIdx === 1
? (storeType === 1 || storeType === '1')
: (storeType === 0 || storeType === '0');
});
},
isCurrentStore(storeId) {
const currentStoreId = this.infoList.store && this.infoList.store.id;
return currentStoreId && storeId === currentStoreId;
},
onStoreItemClick(item) {
if (!item.store) return;
if (this.isCurrentStore(item.store.id)) {
uni.showToast({
title: '当前已经在这个门店了',
icon: 'none',
duration: 2000
});
return;
}
this.toChang(item.store.id, item.store.type);
},
setDefaultTabByStoreType(type) {
this.tabIndex = (type === 1 || type === '1') ? 1 : 0;
},
onTabChange(index) {
if (this.tabChanging) return;
this.tabChanging = true;
this.tabIndex = index;
this.$nextTick(() => {
this.tabChanging = false;
});
},
onSwiperChange(e) {
if (this.tabChanging) return;
this.tabChanging = true;
this.tabIndex = e.detail.current;
this.$nextTick(() => {
this.tabChanging = false;
});
},
toChang(storeId, storeType) {
const token = uni.getStorageSync('token');
if (!token || isGuestMode()) {
uni.setStorageSync('store_id', storeId);
uni.setStorageSync('stores_id', storeId);
if (storeType !== undefined && storeType !== null) {
uni.setStorageSync('store_type', storeType);
} }
uni.showToast({
title: '切换成功',
duration: 2000,
icon: 'success'
});
uni.switchTab({ url: '/pages/home/home' });
return;
}
storeChange({
method: 'post',
data: { store_id: storeId }
}).then((res) => { }).then((res) => {
if (res.data.errcode == 0) { if (this.isApiSuccess(res)) {
uni.setStorageSync('store_id', e) const data = this.parseApiData(res);
uni.setStorageSync('stores_id', e) uni.setStorageSync('store_id', storeId);
uni.setStorageSync('stores_id', storeId);
const type = data && data.store ? data.store.type : storeType;
if (type !== undefined && type !== null) {
uni.setStorageSync('store_type', type);
}
uni.showToast({ uni.showToast({
title: '切换成功', title: '切换成功',
duration: 2000, duration: 2000,
icon: "success" icon: 'success'
}); });
// uni.removeStorageSync('stores_id') uni.switchTab({ url: '/pages/home/home' });
// setTimeout(() => {
// uni.switchTab({
// url: '/pages/home/home'
// })
// }, 2000)
uni.switchTab({
url: '/pages/home/home'
})
} }
}) });
this.getStore();
}, },
// 门店列表
getStore() { getStore() {
storeList({ storeList({
method: "post", method: 'post',
data: { data: {
store_id: 11001 store_id: uni.getStorageSync('store_id') || '11001'
} }
}).then((res) => { }).then((res) => {
// console.log(res, 'list'); if (this.isApiSuccess(res)) {
if (res.data.errcode == 0) { const data = this.parseApiData(res);
this.storeinfo = res.data.data.list if (data && data.list) {
this.storeinfo = data.list;
}
} }
}) });
}, },
// 门店信息
getInfo() { getInfo() {
storeInfo({ storeInfo({
method: "post", method: 'post',
data: { data: {
store_id: uni.getStorageSync('store_id') || '11001', store_id: uni.getStorageSync('store_id') || '11001',
} }
}).then((res) => { }).then((res) => {
// console.log(res, 'info'); if (this.isApiSuccess(res)) {
if (res.data.errcode == 0) { const data = this.parseApiData(res);
this.infoList = res.data.data if (data && data.store) {
this.headerTitle = this.infoList.store['name'] this.infoList = data;
uni.setNavigationBarTitle({ this.headerTitle = data.store.name;
title: this.headerTitle, this.setDefaultTabByStoreType(data.store.type);
success() { uni.setNavigationBarTitle({
console.log(3333); title: this.headerTitle,
} });
}); uni.setNavigationBarColor({
uni.setNavigationBarColor({ frontColor: '#000000',
frontColor: '#000000', //前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 });
}) }
} }
}) });
},
},
mounted() {
// this.getStore();
},
onShow() {
// this.getStore();
},
onUnload() {
// uni.removeStorageSync('store_id')
},
filters: {
//过滤器 用于格式化时间
dateFormat: function(value) {
var date = new Date(value * 1000); //时间戳为10位需*1000时间戳为13位的话不需乘1000
var year = date.getFullYear();
var month = ("0" + (date.getMonth() + 1)).slice(-2);
var sdate = ("0" + date.getDate()).slice(-2);
var hour = ("0" + date.getHours()).slice(-2);
var minute = ("0" + date.getMinutes()).slice(-2);
var second = ("0" + date.getSeconds()).slice(-2);
// 拼接
var result = hour + ":" + minute //+ ":" + second;
// 返回
return result;
}, },
}, },
} }
@@ -193,30 +277,38 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
width: 750rpx; width: 750rpx;
max-height: 100%; height: 100vh;
min-height: 100vh; display: flex;
flex-direction: column;
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
background: #F5F5F5; background: #F5F5F5;
box-sizing: border-box;
.card { .card {
width: 750rpx; width: 750rpx;
height: 310rpx; min-height: 310rpx;
background: #FFFFFF; background: #FFFFFF;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 40rpx 20rpx; padding: 40rpx 20rpx;
flex-shrink: 0;
image { image {
width: 172rpx; width: 172rpx;
height: 188rpx; height: 188rpx;
vertical-align: middle; vertical-align: middle;
margin-right: 36rpx; margin-right: 36rpx;
flex-shrink: 0;
} }
.store { .store {
flex: 1;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
.name { .name {
display: flex;
flex-wrap: wrap;
align-items: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
@@ -227,6 +319,10 @@
color: #666666; color: #666666;
margin-right: 10rpx; margin-right: 10rpx;
} }
.type-tag {
margin-left: 12rpx;
}
} }
.info { .info {
@@ -240,31 +336,72 @@
color: #4175EE; color: #4175EE;
margin-right: 16rpx; margin-right: 16rpx;
} }
} }
} }
} }
.list { .list {
width: 750rpx; width: 750rpx;
padding: 34rpx; padding: 34rpx;
margin: 30rpx auto; margin: 30rpx auto 0;
border-radius: 20rpx; border-radius: 20rpx;
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
min-height: 0;
box-sizing: border-box;
.tabs-wrap {
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
margin-top: 20rpx;
flex-shrink: 0;
}
.store-swiper {
flex: 1;
height: 0;
min-height: 400rpx;
}
.store-scroll {
height: 100%;
box-sizing: border-box;
}
.item { .item {
width: 688rpx; width: 688rpx;
font-family: PingFang SC-Bold, PingFang SC; font-family: PingFang SC-Bold, PingFang SC;
padding: 20rpx 32rpx; padding: 20rpx 32rpx;
background: #FFFFFF; background: #FFFFFF;
margin: 40rpx auto 20rpx; margin: 20rpx auto;
border-radius: 20rpx; border-radius: 20rpx;
&.item-current {
background: #FFFFFF;
.name {
color: #999999;
}
.timer {
color: #AAAAAA;
}
}
.name { .name {
display: flex;
flex-wrap: wrap;
align-items: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
margin-top: 8rpx; margin-top: 8rpx;
.type-tag {
margin-left: 12rpx;
}
} }
.timer { .timer {
@@ -282,6 +419,7 @@
color: #232323; color: #232323;
border-bottom: 1rpx solid #DDDDDD; border-bottom: 1rpx solid #DDDDDD;
padding: 0 0 20rpx 0; padding: 0 0 20rpx 0;
flex-shrink: 0;
} }
.empty { .empty {
@@ -309,4 +447,4 @@
} }
} }
} }
</style> </style>

View File

@@ -604,7 +604,6 @@
let that = this let that = this
if (this.flag) { if (this.flag) {
this.flag = false this.flag = false
// 获取支付配置
getPayConfig({ getPayConfig({
method: "post", method: "post",
data: { data: {
@@ -647,30 +646,20 @@
}, 300) }, 300)
}, },
fail: function(err) { fail: function(err) {
that.flag = false that.flag = true
console.log('fail:' + JSON.stringify(err)); console.log('fail:' + JSON.stringify(err));
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '支付失败', title: err.errMsg && err.errMsg.indexOf('cancel') !== -1 ? '支付已取消' : '支付失败',
duration: 1500, duration: 1500,
mask: false, mask: false,
icon: 'error' icon: 'none'
}) })
setTimeout(() => {
if (res.data.msg) {
uni.showToast({
title: res.data.msg,
duration: 1500,
mask: false,
icon: 'error'
})
return
}
}, 1000)
} }
}) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
that.flag = true
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.data.msg, title: res.data.msg,
type: 'default', type: 'default',
@@ -678,6 +667,15 @@
}) })
} }
}).catch((err) => {
console.error('getPayConfig error:', err);
uni.hideLoading();
that.flag = true
uni.showToast({
title: '获取支付配置失败',
icon: 'none',
duration: 1500
})
}) })
} }

View File

@@ -39,7 +39,11 @@
</view> </view>
<!-- 3. 主体内容区左侧分类 + 右侧商品 --> <!-- 3. 主体内容区左侧分类 + 右侧商品 -->
<view class="main-content"> <view
class="main-content"
@touchstart="onZoneTouchStart"
@touchend="onZoneTouchEnd"
>
<!-- 左侧分类栏 --> <!-- 左侧分类栏 -->
<view class="category-sidebar"> <view class="category-sidebar">
<scroll-view scroll-y class="category-scroll"> <scroll-view scroll-y class="category-scroll">
@@ -185,6 +189,7 @@ export default {
homeZones: [], homeZones: [],
selectedZoneIndex: 0, selectedZoneIndex: 0,
selectedZoneType: 'otc', selectedZoneType: 'otc',
zoneTouch: { startX: 0, startY: 0 },
// 分类相关 // 分类相关
categoryList: [], categoryList: [],
@@ -296,10 +301,25 @@ export default {
this.selectedZoneIndex = index; this.selectedZoneIndex = index;
this.selectedZoneType = this.homeZones[index]?.type || 'otc'; this.selectedZoneType = this.homeZones[index]?.type || 'otc';
this.selectedCategoryId = 0; this.selectedCategoryId = 0;
// 重新获取分类和商品
this.getCategoryList(); this.getCategoryList();
}, },
onZoneTouchStart(e) {
const touch = e.touches[0] || e.changedTouches[0];
if (!touch) return;
this.zoneTouch.startX = touch.clientX;
this.zoneTouch.startY = touch.clientY;
},
onZoneTouchEnd(e) {
const dx = e.changedTouches[0].clientX - this.zoneTouch.startX;
const dy = e.changedTouches[0].clientY - this.zoneTouch.startY;
if (Math.abs(dx) < 60 || Math.abs(dx) < Math.abs(dy)) return;
const next = dx < 0 ? this.selectedZoneIndex + 1 : this.selectedZoneIndex - 1;
if (next < 0 || next >= this.homeZones.length) return;
this.onZoneChange(next);
},
// 分类选择 // 分类选择
selectCategory(categoryId) { selectCategory(categoryId) {
this.selectedCategoryId = categoryId; this.selectedCategoryId = categoryId;

View File

@@ -196,6 +196,13 @@ export default {
this.loadAssistantConfig() this.loadAssistantConfig()
this.loadAgreementInfo() this.loadAgreementInfo()
}, },
onBackPress() {
if (this.showAgreement) {
this.showAgreement = false
return true
}
return false
},
methods: { methods: {
// 加载转诊详情(获取药品信息) // 加载转诊详情(获取药品信息)
async loadTransferDetail() { async loadTransferDetail() {
@@ -448,6 +455,10 @@ export default {
}, },
// 返回 // 返回
handleBack() { handleBack() {
if (this.showAgreement) {
this.showAgreement = false
return
}
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要退出咨询吗?未完成的回答将不会保存。', content: '确定要退出咨询吗?未完成的回答将不会保存。',