This commit is contained in:
zoujiandong 2025-05-16 17:16:23 +08:00
parent 7003f55dec
commit fc0d7ce817
19 changed files with 1354 additions and 311 deletions

View File

@ -26,4 +26,10 @@
wx-button:after{
border: none;
}
.ellipsis-two-lines {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
</style>

View File

@ -1,4 +1,6 @@
import {request} from '@/utils/request.js'
const loadingTime = 500;
const showLog = false;
const api = {
wxLogin(data) {
return request('/login/wechat_mobile_login', data, 'post', true);
@ -22,142 +24,89 @@ const api = {
getQuestionPage(data) { //获取问题列表-分页
return request('/question/page', data, 'post', true, 'application/json');
},
getQuestionDetail(id,data) { //获取问题详情
return request('/question/'+id, data, 'get', false);
},
collect(data) {
return request('/collection/question', data, 'post', false, 'application/json');
},
cancelCollect(data) {
return request('/collection/question/cancel', data, 'put', false, 'application/json');
},
getHotList() { //获取问题详情
return request('/question/hot', {}, 'get', true);
},
getQuestionStatus(id) { //获取问题解锁状态
return request('/question/unlock/status/' + id, {}, 'get', true);
},
getQuestionCoupon(data) { //获取患者可使用优惠卷-单项
return request('/coupon/usable/question', data, 'get', true);
},
getVipCoupon(data) { //获取会员可使用优惠卷-单项
return request('/coupon/usable/member', data, 'get', true);
},
getVipPrice() { //获取会员配置数据
return request('/member', {}, 'get', false);
},
getRecentList() {
return request('/order/member/recent/list', {}, 'get', false);
},
getUserInfo() {
return request('/user', {}, 'get', true);
},
getUnnotifyCoupon() { //获取还未弹窗的优惠卷
return request('/coupon/unnotified', {}, 'get', false);
},
getLeast() { //获取最少立减金额
return request('/member/least', {}, 'get', false);
},
getItemList(data) { //获取单项订单列表-分页
return request('/order/single/page', data, 'get', true);
},
getVipList(data) { //获取会员订单列表-分页
return request('/order/member/page', data, 'get', true);
},
createItemOrder(data) { //创建单项订单
return request('/order/single', data, 'post', true);
},
createVipOrder(data) { //创建会员订单
return request('/order/member', data, 'post', true);
},
cancelItemOrder(id) {
return request('/order/single/cancel/' + id, {}, 'put', false);
},
getItemPayData(data, id) {
return request('/order/single/pay/' + id, data, 'get', true);
},
getWxConfig(url, data) {
return request(url, data, 'get', false);
},
getCollectList(data) { //获取用户收藏题目列表-分页
return request('/collection/question', data, 'get', true);
},
getFuliList(data) { //获取用户收藏题目列表-分页
return request('/coupon', data, 'get', true);
},
addClickCount(id) { //增加问题点击次数(点击进入详情页的人次
return request('/question/click/' + id, {}, 'put', false);
},
addSubmitCount(id) { //增加问题提交次数(提交个人信息进行了算算的人次)
return request('/question/click/submit/' + id, {}, 'put', false);
},
checkUser(data) { //检测用户数据绑定状态
return request('/user/check', data, 'GET', false);
},
getBasic(data) {
return request('/user/info', data, 'GET', true);
},
updateBasic(data) {
return request('/user', data, 'PUT', true,'application/json');
},
getCase(data) {
return request('/user/case', data, 'GET', true);
},
updateCase(data) {
return request('/user/case', data, 'PUT', true,'application/json');
},
getArea(data) {
return request('/area/list', data, 'GET', false);
},
getDiseaseList(data) {
return request('/disease/list', data, 'GET', false);
},
getNation(data) {
return request('/nation/list', data, 'GET', false);
},
getOssSign(data) {
return request('/sign/oss', data, 'GET', false);
},
ossUpload(url,data){
return request(url,data,'post',false,'multipart/form-data')
},
checkItemPaySatus(id) {
return request('/order/single/pay/status/'+id, {}, 'GET', false);
},
checkVipPaySatus(id) {
return request('/order/member/pay/status/'+id, {}, 'GET', false);
},
saveAnswer(data,id){//保存单项答案
return request('/order/single/answer/'+id, data, 'post', false);
},
getAnswer(id){//获取单项答案
return request('/order/single/answer/'+id, {}, 'get', false);
},
getSearchRecommend(){//搜索推荐
return request('/class/recommend/list', {}, 'get', false);
},
changeCoupon(){
return request('/coupon/unnotified', {}, 'put', false);
},
delVipOrder(id){
return request('/order/member/'+id, {}, 'DELETE', false);
},
delItemOrder(id){
return request('/order/single/'+id, {}, 'DELETE', false);
},
shareSign(data){
return request('https://dev-app.igandan.com/app/manager/getSignature4bing', data, 'get', false);
},
getLikeList(){//搜索推荐
return request('question/like', {}, 'get', false);
},
getData(){
return request('https://www.fastmock.site/mock/32012a46e9f66a6180214eef5edc79ac/mydata/promote', {}, 'get', false);
queryList(data) {
const listCount = 24;
return _queryList(data, listCount);
}
};
function _queryList(data, listCount, showNews = false ,random = false, showChat = false) {
if (!data.pageNo || !data.pageSize) {
return _callQueryResult([]);
}
let pageNo = parseInt(data.pageNo);
let pageSize = parseInt(data.pageSize);
let type = data.type || 0;
if (pageNo < 0 || pageSize <= 0) {
return _callQueryResult([]);
}
if (showLog) {
console.log('%c\n----------请求开始--------', 'color:green;');
console.info(`请求参数【pageNo:${pageNo},pageSize:${pageSize}`)
console.log('%c----------请求结束--------\n', 'color:green;');
}
uni.showLoading({
title: '加载中...'
})
if (pageNo == 0) {
pageNo = 1;
}
var totalPagingList = [];
for (let i = 0; i < listCount; i++) {
if (!showChat) {
const item = {
'title': (i + 1).toString(),
'detail': '测试信息' + type
};
if (showNews) {
item.detail = getNews(random);
}
totalPagingList.push(item);
} else {
const item = {
'name': '哆啦A梦',
'icon': '/static/duola.jpg',
'content': getNews(true),
'isMe': false
};
totalPagingList.push(item);
}
}
let pageNoIndex = (pageNo - 1) * pageSize;
if (pageNoIndex + pageSize <= totalPagingList.length) {
return _callQueryResult(totalPagingList.splice(pageNoIndex, pageSize));
} else if (pageNoIndex < totalPagingList.length) {
return _callQueryResult(totalPagingList.splice(pageNoIndex, totalPagingList.length - pageNoIndex));
} else {
return _callQueryResult([]);
}
}
function _callQueryResult(arg) {
return new Promise((resolve, reject) => {
setTimeout(() => {
uni.hideLoading();
if (showLog) {
console.log('%c\n----------响应开始--------', 'color:#0113fa;');
// #ifdef H5
console.table(arg);
// #endif
// #ifndef H5
console.log(arg);
// #endif
console.log('%c----------响应结束--------\n', 'color:#0113fa;');
}
resolve({
data: {
list: arg
}
});
}, loadingTime)
})
}
export default api

73
components/dNav/dNav.vue Normal file
View File

@ -0,0 +1,73 @@
<template>
<view class="navbox">
<view class="bg"></view>
<view class="namebox">
<view class="logo">logo</view>
<view class="name">肝胆相照临床病例库</view>
</view>
</view>
</template>
<script setup>
</script>
<style lang="scss" scoped>
.navbox {
padding-bottom: 20rpx;
background-color: #f9fafb;
position: relative;
height:200rpx;
background: radial-gradient(
60% 90% at 4% 2%,
#43c9c3 0%,
rgba(255, 255, 255, 0) 100%
);
}
.bg {
z-index: 0;
top: 0;
bottom: 0;
width: 100%;
position: absolute;
background: radial-gradient(
43% 90% at 84% 6%,
#ffd6c9 0%,
rgba(255, 255, 255, 0) 100%
);
}
.namebox {
padding-top: 102rpx;
margin: 0rpx 30rpx 0rpx;
display: flex;
.name {
margin-left: 16rpx;
font-size: 30rpx;
color: #111827;
}
}
.search {
margin: 40rpx 30rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
.searchwrap {
display: flex;
align-items: center;
flex: 1;
padding-left: 28rpx;
margin-right: 23rpx;
height: 80rpx;
background: #fbfbfb;
box-shadow: 0px 4rpx 10rpx 0px rgba(153, 153, 153, 0.5);
border-radius: 40rpx;
.ipt {
margin-left: 15rpx;
font-size: 28rpx;
}
}
}
</style>

View File

@ -1,59 +0,0 @@
<template>
<view class="u-page">
<up-list
@scrolltolower="scrolltolower"
>
<up-list-item
v-for="(item, index) in indexList"
:key="index"
>
<up-cell
:title="`列表长度-${index + 1}`"
>
<template #icon>
<up-avatar
shape="square"
size="35"
:src="item.url"
customStyle="margin: -3px 5px -3px 0"
></up-avatar>
</template>
</up-cell>
</up-list-item>
</up-list>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const indexList = ref([]);
const urls = [
'https://uview-plus.jiangruyi.com/album/1.jpg',
'https://uview-plus.jiangruyi.com/album/2.jpg',
'https://uview-plus.jiangruyi.com/album/3.jpg',
'https://uview-plus.jiangruyi.com/album/4.jpg',
'https://uview-plus.jiangruyi.com/album/5.jpg',
'https://uview-plus.jiangruyi.com/album/6.jpg',
'https://uview-plus.jiangruyi.com/album/7.jpg',
'https://uview-plus.jiangruyi.com/album/8.jpg',
'https://uview-plus.jiangruyi.com/album/9.jpg',
'https://uview-plus.jiangruyi.com/album/10.jpg',
];
onLoad(() => {
loadmore();
});
const scrolltolower = () => {
loadmore();
};
const loadmore = () => {
for (let i = 0; i < 30; i++) {
indexList.value.push({
url: urls[uni.$u.random(0, urls.length - 1)],
});
}
};
</script>

View File

@ -0,0 +1,93 @@
<template>
<view class="navbox">
<view class="bg"></view>
<view class="namebox">
<view class="logo">logo</view>
<view class="name">肝胆相照临床病例库</view>
</view>
<view class="search">
<view class="searchwrap">
<up-icon name="search" size="26" color="#999"></up-icon>
<!-- <up--image
:src="ssImg"
class="ssImg"
mode="widthFix"
width="30rpx"
height="30rpx"
></up--image> -->
<input type="text" class="ipt" />
</view>
<up--image
:src="headImg"
mode="widthFix"
width="62rpx"
height="62rpx"
radius="50%"
></up--image>
</view>
</view>
</template>
<script setup>
import headImg from "@/static/headImg.png";
import ssImg from "@/static/ss.png";
</script>
<style lang="scss" scoped>
.navbox {
padding-bottom: 20rpx;
background-color: #f9fafb;
position: relative;
background: radial-gradient(
60% 90% at 4% 2%,
#43c9c3 0%,
rgba(255, 255, 255, 0) 100%
);
}
.bg {
z-index: -1;
top: 0;
bottom: 0;
width: 100%;
position: absolute;
background: radial-gradient(
43% 90% at 84% 6%,
#ffd6c9 0%,
rgba(255, 255, 255, 0) 100%
);
}
.namebox {
padding-top: 102rpx;
margin: 0rpx 30rpx 0rpx;
display: flex;
.name {
margin-left: 16rpx;
font-size: 30rpx;
color: #111827;
}
}
.search {
margin: 40rpx 30rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
.searchwrap {
display: flex;
align-items: center;
flex: 1;
padding-left: 28rpx;
margin-right: 23rpx;
height: 80rpx;
background: #fbfbfb;
box-shadow: 0px 4rpx 10rpx 0px rgba(153, 153, 153, 0.5);
border-radius: 40rpx;
.ipt {
margin-left: 15rpx;
font-size: 28rpx;
}
}
}
</style>

View File

@ -33,5 +33,3 @@ export function createApp() {
}
}
// #endif
console.log(1111)
console.log(process.env.NODE_ENV)

View File

@ -11,20 +11,34 @@
},
"pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/detail/detail",
"style": {
"navigationBarTitleText": "详情",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
"navigationBarTitleText": "uni-app",
"navigationStyle": "custom"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app",
"navigationStyle": "custom"
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app",
"enablePullDownRefresh":false
}
},
{
"path": "pages/case/case",
"style": {

View File

@ -1,34 +1,27 @@
<template>
<view class="content">
<view class="page">
<web-view src="https://wx.igandan.com/hcp/toRegister" @load="loadView"></web-view>
</view>
<tabBar :value="1"></tabBar>
</view>
<view class="content">
<view class="page">
<web-view src="https:www.baidu.com/" ></web-view>
</view>
<tabBar :value="1"></tabBar>
</view>
</template>
<script setup>
import { reactive, ref } from "vue";
import { onShow, onReady } from "@dcloudio/uni-app";
import tabBar from "@/components/tabBar/tabBar.vue";
const loadView = () => {
console.log("加载完成");
uni.setNavigationBarTitle({
title: "注册", // 使datatitletitle
});
};
onShow(() => {
});
onReady(() => {});
import { reactive, ref } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import tabBar from '@/components/tabBar/tabBar.vue';
const webviewStyles=reactive({
width:"100%",
height:'calc(100vh - 0rpx)'
})
</script>
<style scoped>
.page {
width: 100%;
height: calc(100vh - 100rpx);
overflow-y: scroll;
display: flex;
}
.page{
width:100%;
height:calc(100vh - 100rpx);
overflow-y: scroll;
}
</style>

613
pages/detail/detail.vue Normal file
View File

@ -0,0 +1,613 @@
<template>
<z-paging
ref="paging"
inside-more
loading-more-no-more-text="咱也是有底线的!"
:auto-show-back-to-top="true"
v-model="dataList"
@query="queryList"
>
<template #top>
<dNav></dNav>
<view class="box" >
<view class="title">肝胆相照临床病例库肝胆相照临床病例库肝胆相照临床病例库</view>
<view class="content">
<view class="info">
<up--image :src="headImg" mode="widthFix" class="headImg" width="46rpx" height="46rpx"
radius="50%"></up--image>
<view class="name">陈医生 · 北京某三甲医院</view>
</view>
<view class="deal">
<view class="left">
<view class="eyebox">
<up-icon name="eye" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
<view class="collect">
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
</view>
<view class="time">
<up-icon name="clock" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
</view>
</view>
<view class="bar"></view>
<!-- 评论框 -->
<up-popup :zIndex="11" :overlayStyle="{ zIndex: 10 }" :closeOnClickOverlay="false" :show="showCommentDialog" :round="10" closeable mode="bottom" @close="close" @open="open">
<view class="poptitle"></view>
<view class="wraper">
<up--textarea height="200" v-model="comment" placeholder="请输入评论内容"></up--textarea>
</view>
<view class="imgbox">
<view class="imgunit">
<up--image :src="shangImg" radius="6" width="150rpx" height="150rpx" @click="previewImg"></up--image>
<view class="close">
<up-icon name="close-circle" color="#666" size="16" ></up-icon>
</view>
</view>
</view>
<view class="sendbox">
<view class="left"><up--image :src="uploadImg" mode="widthFix" width="40rpx" height="77rpx" @click="chooseImg"></up--image></view>
<view class="btn">发送</view>
</view>
</up-popup>
<canvas
v-if="showCanvas"
type="2d"
id="watermarkCanvas"
style="width:200px;
height:200px;position: fixed; top: -9999px;"
/>
</view>
</template>
<template #bottom>
<view class="bottom">
<view class="iptbox">
<up--image :src="chatImg" mode="widthFix" width="46rpx" radius="50%"></up--image>
<up-input @focus="open" type="text" placeholderClass="placeholderClass" placeholder="对病例发表您的看法" class="ipt" />
</view>
<view class="right">
<up--image :src="collectImg" mode="widthFix" width="38rpx"></up--image>
<view class="imgboxshang" >
<up--image :src="shangImg" mode="widthFix" width="169rpx" height="77rpx"></up--image>
</view>
</view>
</view>
</template>
<view class="desc">
<view class="item" v-for="(item, index) in dataList" :key="index">
<view class="qq">
{{index}}
</view>
</view>
</view>
</z-paging>
</template>
<script setup>
import {
ref
} from 'vue'
import headImg from "@/static/headImg.png";
import collectImg from "@/static/collect.png";
import shangImg from "@/static/shang.png";
import chatImg from "@/static/chat.png";
import uploadImg from "@/static/uploadImg.png";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
const paging = ref(null);
const dataList = ref([]);
const showCanvas=ref(false)
const showCommentDialog = ref(false);
const canvasWidth=ref(0);
const canvasHeight=ref(0);
const comment = ref('');
onLoad(() => {});
const queryList = (pageNo, pageSize) => {
const params = {
pageNo: pageNo,
pageSize: pageSize,
type: 1,
};
//
api
.queryList(params)
.then((res) => {
// console.log(res)
// dataList.value=dataList.value.concat(res.data.list)
// completez-paging
paging.value.complete(res.data.list);
})
.catch((res) => {
// paging.value.complete(false);
// catchz-paging
// uni.$emit('z-paging-error-emit');
paging.value.complete(false);
});
};
const open=()=>{
showCommentDialog.value = true;
console.log('open');
};
const close=()=>{
showCommentDialog.value = false
console.log('close');
};
const previewImg=()=>{
uni.previewImage({
current: 'https://example.com/image1.jpg',
urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg']
});
};
const fillTextToImgWx=(base64)=>{
let maskText="@zjd嗯嗯嗯嗯嗯嗯3评论暂时真实的334"
return new Promise((resolve, reject) => {
wx.createSelectorQuery().select('#watermarkCanvas').fields({
node: true,
size: true
}).exec((res) => {
const canvas = res[0].node;
const ctx = canvas.getContext('2d');
let textMetrics = ctx.measureText(maskText);
console.log(textMetrics)
//
let { width: textWidth, actualBoundingBoxAscent, actualBoundingBoxDescent } = textMetrics;
//
let textHeight = actualBoundingBoxAscent ? (actualBoundingBoxAscent + actualBoundingBoxDescent) : (textMetrics.fontBoundingBoxAscent + textMetrics.fontBoundingBoxDescent);
let imgHeight,imgWidth;
let font='';//fontsize"px Arial";
let fontColor="#fff"
let strokeWidth=3;
uni.getImageInfo({
src: base64,
success: (imageRes) => {
// canvas
let scale=(imageRes.width/800)*30>12?(imageRes.width/800)*30:12
font=scale+"px Arial"
console.log(imageRes)
canvas.width = imageRes.width
canvas.height = imageRes.height;
imgHeight=imageRes.height;
imgWidth=imageRes.width;
//
const image = canvas.createImage();
image.src='';
image.src = base64;
image.onload = () => {
//
//ctx.clearRect(0, 0, canvas.width, canvas.height);
// canvas
ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
let posXmargin =10; //this.data.posXmargin // /
let posYmargin =10;// this.data.posYmargin // /
let randomNumber =3;//Math.floor(Math.random() * (3 + 1));
console.log('randomNumber:'+randomNumber);
switch (randomNumber) {
case 0: //
let lt_x = posXmargin
let lt_y = posYmargin + textHeight
ctx.font = font
ctx.fillStyle = fontColor
ctx.storkStyle = "black";
ctx.strokeWidth= strokeWidth
ctx.fillStyle = "#fff";
ctx.fillText(maskText, lt_x, lt_y)
//ctx.restore()
//ctx.save()
break;
case 1: //
let lb_x = posXmargin
let lb_y = imgHeight- posYmargin
ctx.font = font
ctx.fillStyle = fontColor
ctx.strokeStyle = "black";
ctx.strokeWidth= strokeWidth
ctx.fillStyle = "#fff";
ctx.fillText(maskText, lb_x, lb_y)
//ctx.restore()
//ctx.save()
break;
case 2: //
let rt_x = imgWidth - textWidth*2.9- posXmargin<=0?10:imgWidth - textWidth*2.9- posXmargin
let rt_y = posYmargin + textHeight*2
ctx.font = font
ctx.fillStyle = fontColor
ctx.strokeStyle = "black";
ctx.strokeWidth= strokeWidth
ctx.fillStyle = "#fff";
ctx.fillText(maskText, rt_x, rt_y)
ctx.restore()
ctx.save()
break;
case 3: //
let rb_x = imgWidth - textWidth*2.9- posXmargin<=0?10:imgWidth - textWidth*2.9- posXmargin
let rb_y = imgHeight - posYmargin
ctx.font = font
ctx.fillStyle = fontColor;
ctx.strokeStyle = "black";
ctx.strokeWidth= strokeWidth
ctx.fillStyle = "#fff";
ctx.fillText(maskText, rb_x, rb_y)
//ctx.restore()
//ctx.save()
break;
}
//ctx.restore()
// canvas
//setTimeout(() => {
wx.canvasToTempFilePath({
canvas: canvas,
success: function (res) {
//
resolve(res.tempFilePath)
wx.previewImage({ urls: [res.tempFilePath] });
showCanvas.value=false;
},
fail: function (res) {
// reject(res)
console.error(res);
}
});
//})
}
}
})
})
})
}
const fillTextToImg=(base64)=>{
const img = new Image();
img.src = base64;
img.setAttribute("crossOrigin", "Anonymous");
return new Promise((resolve, reject) => {
img.onload = () => {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
canvas.width = img.width;
canvas.height = img.height;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
const remFontSize = 30; //canvas.width / 35;
ctx.font = remFontSize + "px '微软雅黑'";
ctx.textAlign = "right";
ctx.strokeStyle = "#000";
ctx.fillStyle = "#fff";
const uploadTime = new Date();
const name = "@zjd";
const spaceH = remFontSize * 0.1;
let randomNumber = Math.floor(Math.random() * (3 + 1));
let position = [
{
top: remFontSize,
left: name.length * 30 || 30,
},
{
top: remFontSize,
left: canvas.width - remFontSize * 0.1 - spaceH,
},
{
top: canvas.height - remFontSize * 0.5 - spaceH,
left: name.length * 30 || 30,
},
{
top: canvas.height - remFontSize * 0.5 - spaceH,
left: canvas.width - remFontSize * 0.1 - spaceH,
},
];
ctx.strokeText(
name,
position[randomNumber].left,
position[randomNumber].top
);
ctx.fillText(
name,
position[randomNumber].left,
position[randomNumber].top
);
resolve(canvas.toDataURL("image/jpeg"));
};
});
};
const base64ToFile=(base64Data, filename)=> {
var arr = base64Data.split(",");
var type = arr[0].match(/:(.*?);/)[1];
var fileExt = type.split("/")[1];
var bstr = atob(arr[1]);
var n = bstr.length;
var u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, {
type: type,
});
};
const generateUUID=()=> {
let d = new Date().getTime();
if (
typeof performance !== "undefined" &&
typeof performance.now === "function"
) {
d += performance.now(); // 使 APIperformance.now()
}
const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
const r = (d + Math.random() * 16) % 16 | 0;
d = Math.floor(d / 16);
return (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
}
);
return uuid;
};
const readImages=async(localIds)=>{
console.log(localIds)
let promiseFun = [];
for (var i = 0; i < localIds.length; i++) {
//let localData = await doreadImage(localIds[i]);
let img=null;
/* #ifdef H5 */
let imgBase64=await getImageBase64(localIds[i]) ;
img = await fillTextToImg(imgBase64);
console.log(img)
uni.previewImage({ urls: [img]})
/* #endif */
/* #ifdef MP-WEIXIN */
let imgpromise = await fillTextToImgWx(localIds[i]);;
console.log(22222);
//console.log(imgBase64);
/* #endif */
//let imgFile = base64ToFile(img, new Date().getTime() + ".jpg");
// console.log(imgFile)
//promiseFun.push(uploadImg(imgFile));
}
Promise.all(promiseFun).then((res) => {
uni.showToast({
duration: 1000,
message: "上传成功",
});
});
};
// 64
const getImageBase64=(url)=> {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "blob";
xhr.onload = function () {
if (this.status == 200) {
const fileReader = new FileReader();
fileReader.onloadend = function () {
resolve(fileReader.result); // Base64
};
fileReader.readAsDataURL(xhr.response); // blobbase64
} else {
reject("Could not fetch the file.");
}
};
xhr.onerror = function () {
reject("XHR error");
};
xhr.send();
});
}
const chooseImg=()=>{
showCanvas.value=true;
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album','camera '], //
success: function (res) {
console.log(333)
readImages(res.tempFilePaths);
}
});
}
</script>
<style lang='scss' scoped>
.imgboxshang{
display: flex;
align-items: center;
}
.imgbox{
margin:0 30rpx 30rpx;
.imgunit{
width:150rpx;
hight:150rpx;
position: relative;
.close{
position: absolute;
top:0rpx;
right:0;
}
}
}
.poptitle{
height: 88rpx;
border-bottom:1rpx solid #e7e7e7;
}
.sendbox{
display: flex;
justify-content: space-between;
margin:0 30rpx 30rpx;
.btn{
width:120rpx;
height: 58rpx;
display: flex;
align-items: center;
justify-content: center;
background: #3cc7c0;
font-weight: 400;
font-size: 30rpx;
color: #fff;
border-radius:12rpx;
}
}
.wraper{
margin: 0rpx 12rpx;
}
.desc {
padding-bottom: 80rpx;
}
.bottom {
position: fixed;
display: flex;
width:100%;
box-sizing: border-box;
padding: 40rpx 30rpx;
align-items: center;
border-top: 2rpx solid #f9fafb;
background: #fff;
bottom: 0;
:deep(.u-image) {
background: none !important;
}
:deep(.placeholderClass) {
font-size: 30rpx;
color: #4B5563;
}
.right {
margin-left: 20rpx;
display: flex;
align-items: center;
background: #fff;
.imgbox {
margin-left: 20rpx;
}
}
.iptbox {
flex: 1;
padding-left: 30rpx;
background: #F3F4F6;
border-radius: 38px;
height: 77rpx;
display: flex;
align-items: center;
.ipt {
margin-left: 15rpx;
}
}
}
.bar {
width: 100%;
background: #f9fafb;
height: 24rpx;
}
.box {
background: #fff;
/* height: calc(100vh - 220rpx);
overflow-y: scroll;
-webkit-overflow-scrolling: touch; */
.title {
position: relative;
z-index: 1;
padding: 35rpx 30rpx 0;
background: #fff;
margin-top: -40rpx;
font-weight: 400;
font-size: 38rpx;
color: #111827;
line-height: 54rpx;
}
.info {
display: flex;
align-items: center;
margin-top: 20rpx;
padding: 0 30rpx;
font-size: 28rpx;
color: #4b5563;
line-height: 38rpx;
:deep(.u-image) {
margin-top: 10rpx;
}
.name {
margin-left: 15rpx;
}
}
}
.deal {
margin-top: 12rpx;
padding: 0 30rpx 20rpx;
display: flex;
color: #6b7280;
font-size: 24rpx;
justify-content: space-between;
.left {
display: flex;
align-items: center;
}
.collect {
display: flex;
align-items: center;
}
.eyebox {
width: 160rpx;
display: flex;
align-items: center;
}
.time {
display: flex;
align-items: center;
}
.num {
margin-left: 8rpx;
}
}
</style>

View File

@ -1,89 +1,267 @@
<template>
<view class="u-page">
<scroll-view scroll-y="true"
@scrolltolower="scrolltolower" refresher-enabled="true" :refresher-triggered="triggered"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" :refresher-threshold="100">
<view v-for="(item, index) in indexList" :key="index">
<up-cell :title="`111`">
<template #icon>
<up-avatar shape="square" size="35" :src="item.url"
customStyle="margin: -3px 5px -3px 0"></up-avatar>
</template>
</up-cell>
</view>
</scroll-view>
<tabBar></tabBar>
</view>
<navBar></navBar>
<view class="page">
<view class="databox">
<view class="cell">
<view class="num">123</view>
<view class="name">文章</view>
</view>
<view class="cell">
<view class="num">123</view>
<view class="name">视频</view>
</view>
<view class="cell">
<view class="num">123</view>
<view class="name">阅读量</view>
</view>
</view>
<view class="kubox">
<view class="row">
<view class="item">
<u-icon name="order" size="28" color="#00919E"></u-icon>
<view class="name">视频病例库</view>
</view>
<view class="item" style="background: #fef8f0; margin-right: 30rpx">
<u-icon name="order" size="28" color="#F08500"></u-icon>
<view class="name" style="color: #f08500">疾病病例库</view>
</view>
</view>
<view class="row" style="margin-top: 30rpx">
<view class="item" style="background: #eff8ff">
<u-icon name="order" size="28" color="#1776D6"></u-icon>
<view class="name" style="color: #1776d6">医院病例库</view>
</view>
<view class="item" style="background: #fef0eb; margin-right: 30rpx">
<u-icon name="order" size="28" color="#EE4C1F"></u-icon>
<view class="name" style="color: #ee4c1f">医生病例库</view>
</view>
</view>
</view>
<view class="newsbox">
<view class="titlebox">
<view class="title">最新上线</view>
<view class="more">
<view class="morename">查看更多</view>
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
</view>
</view>
<view class="listbox">
<view class="cell">
<view class="circle"></view>
<view class="info">
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
<view class="author">端重排 | 陈煜 | 工商局</view>
</view>
</view>
<view class="cell">
<view class="circle"></view>
<view class="info">
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
<view class="author">端重排 | 陈煜 | 工商局</view>
</view>
</view>
</view>
</view>
<view class="newsbox">
<view class="titlebox">
<view class="title">最多阅读</view>
<view class="more">
<view class="morename">查看更多</view>
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
</view>
</view>
<view class="listbox">
<view class="cell">
<view class="circle"></view>
<view class="info">
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
<view class="author">端重排 | 陈煜 | 工商局</view>
</view>
</view>
<view class="cell">
<view class="circle"></view>
<view class="info">
<view class="name">肝胆相照临床病例库肝胆相照临床病例库</view>
<view class="author">端重排 | 陈煜 | 工商局</view>
</view>
</view>
</view>
</view>
<view class="recbox">
<view class="titlebox">
<view class="title">医院病例库推荐</view>
<view class="more">
<view class="morename">查看更多</view>
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
</view>
</view>
<view class="list">
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
</view>
</view>
<view class="recbox">
<view class="titlebox">
<view class="title">医生病例库推荐</view>
<view class="more">
<view class="morename">查看更多</view>
<u-icon name="arrow-right" size="16" color="#3CC7C0"></u-icon>
</view>
</view>
<view class="list">
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
<view class="cell"> 首都医科大学附属北京佑安医院 </view>
</view>
</view>
</view>
<tabBar></tabBar>
</template>
<script setup>
import {
ref,
reactive
} from 'vue';
import {
onLoad,
onShow,
onPullDownRefresh
} from '@dcloudio/uni-app';
import tabBar from '@/components/tabBar/tabBar.vue';
import api from "@/api/api"
console.log(api)
const indexList = ref([]);
const status = ref('loadmore');
const triggered = ref(false);
const urls = [
'https://uview-plus.jiangruyi.com/album/1.jpg',
'https://uview-plus.jiangruyi.com/album/2.jpg',
'https://uview-plus.jiangruyi.com/album/3.jpg',
'https://uview-plus.jiangruyi.com/album/4.jpg',
'https://uview-plus.jiangruyi.com/album/5.jpg',
'https://uview-plus.jiangruyi.com/album/6.jpg',
'https://uview-plus.jiangruyi.com/album/7.jpg',
'https://uview-plus.jiangruyi.com/album/8.jpg',
'https://uview-plus.jiangruyi.com/album/9.jpg',
'https://uview-plus.jiangruyi.com/album/10.jpg',
];
import { ref, reactive } from "vue";
import { onLoad} from "@dcloudio/uni-app";
import tabBar from "@/components/tabBar/tabBar.vue";
import navBar from "@/components/navBar/navBar.vue";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
const paging = ref(null);
const dataList = ref([]);
onLoad(() => {
loadmore();
triggered.value = 'restore';
});
const onRefresh = () => {
setTimeout(() => {
triggered.value = false
}, 1000)
onLoad(() => {});
const queryList = (pageNo, pageSize) => {
const params = {
pageNo: pageNo,
pageSize: pageSize,
type: 1,
};
//
api
.queryList(params)
.then((res) => {
// console.log(res)
// dataList.value=dataList.value.concat(res.data.list)
// completez-paging
paging.value.complete(res.data.list);
})
.catch((res) => {
// paging.value.complete(false);
// catchz-paging
// uni.$emit('z-paging-error-emit');
paging.value.complete(false);
});
};
</script>
<style lang="scss" scoped>
.newsbox {
margin-bottom: 16rpx;
}
.recbox{
padding-bottom: 23rpx;
padding-top: 36rpx;
background: #fff;
.cell {
margin: 23rpx 30rpx 0;;
padding: 34rpx;
background: #f3f4f6;
font-size: 30rpx;
color: #4b5563;
line-height: 43rpx;
border-radius: 15rpx;
}
}
.listbox {
.cell {
margin: 0 30rpx;
display: flex;
align-items: flex-start;
border-bottom: 1rpx solid #f3f4f6;
padding: 34rpx 0;
.circle {
margin-right: 30rpx;
margin-top: 18rpx;
width: 16rpx;
height: 16rpx;
background: #3cc7c0;
border-radius: 50%;
}
.name {
font-size: 32rpx;
color: #000000;
line-height: 46rpx;
}
.author {
font-size: 28rpx;
color: #4b5563;
line-height: 38rpx;
}
}
}
.titlebox {
margin: 0 30rpx;
display: flex;
justify-content: space-between;
.more {
display: flex;
align-items: center;
.morename {
margin-right: 10rpx;
font-size: 28rpx;
color: #3cc7c0;
}
}
}
.newsbox {
padding-top: 36rpx;
background: #fff;
}
.page {
background: #f9fafb;
min-height: 100vh;
}
.kubox {
padding: 30rpx 0;
width: 100%;
background: rgba(0, 0, 0, 0);
.row {
display: flex;
justify-content: space-between;
.item {
margin-left: 30rpx;
padding: 32rpx;
flex: 1;
background: #e9fafb;
border-radius: 15rpx;
.name {
font-size: 32rpx;
color: #00919e;
line-height: 46rpx;
}
}
}
}
.databox {
height: 162rpx;
background: #ffffff;
display: flex;
padding: 0 30rpx;
justify-content: space-between;
.cell {
flex: 1;
padding: 35rpx 0;
}
const onRestore = () => {
triggered.value = 'restore'; //
console.log("onRestore");
};
const scrolltolower = () => {
loadmore();
};
// onPullDownRefresh(() => {
// getData();
text-align: center;
// });
const getData = () => {
setTimeout(() => {
triggered.value = false;
}, 2000)
// api.getData().then(res=>{
// alert(11)
// refresherTriggered.value=false;
// uni.stopPullDownRefresh()
// })
}
const loadmore = () => {
for (let i = 0; i < 30; i++) {
indexList.value.push({
url: urls[uni.$u.random(0, urls.length - 1)],
});
}
};
</script>
.num {
font-size: 38rpx;
color: #3cc7c0;
}
.name {
margin-top: 18rpx;
font-size: 28rpx;
color: #4b5563;
}
}
}
</style>

View File

@ -139,10 +139,11 @@ const start = () => {
};
onLoad(() => {
const { envVersion } = uni.getAccountInfoSync().miniProgram;
console.log(envVersion)
if (envVersion == "release") {
src.value = "https://wx.igandan.com/hcp/toRegister";
} else {
src.value = "https://dev-wx.igandan.com/hcp/toRegister";
src.value = "https://dev-wx.igandan.com/hcp/toRegister?fromType=weChat";
}
});
</script>

168
pages/search/search.vue Normal file
View File

@ -0,0 +1,168 @@
<template>
<view class="u-page">
<z-paging
ref="paging"
inside-more
loading-more-no-more-text="咱也是有底线的!"
:auto-show-back-to-top="true"
v-model="dataList"
@query="queryList"
>
<template #top>
<navBar></navBar>
<view class="detail">
<view class="desc">检索到XX篇文章</view>
<view class="desc">检索到X个视频</view>
<view class="desc">检索词陈煜</view>
</view>
<view class="filterbox">
<u-dropdown class="u-dropdown">
<up-dropdown-item
v-model="value"
title="温度"
:options="options"
></up-dropdown-item>
</u-dropdown>
</view>
</template>
<view class="item" v-for="(item, index) in dataList" :key="index">
<view class="title ellipsis">{{ item.title }}</view>
<view class="tagsbox">
<view class="tag">陈煜</view>
</view>
<view class="deal">
<view class="left">
<view class="eyebox">
<up-icon name="eye" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
<view class="collect">
<up-icon name="heart" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
</view>
<view class="time">
<up-icon name="clock" color="#6B7280" size="28rpx"></up-icon>
<view class="num">1</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script setup>
import { ref, reactive } from "vue";
import navBar from "@/components/navBar/navBar.vue";
import list from "@/uni_modules/z-paging/components/z-paging/z-paging";
import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
const paging = ref(null);
const dataList = ref([]);
const value = ref("");
const options = ref([
{
label: "去冰",
value: 1,
},
{
label: "加冰",
value: 2,
},
]);
onLoad(() => {});
const queryList = (pageNo, pageSize) => {
const params = {
pageNo: pageNo,
pageSize: pageSize,
type: 1,
};
//
api
.queryList(params)
.then((res) => {
// console.log(res)
// dataList.value=dataList.value.concat(res.data.list)
// completez-paging
paging.value.complete(res.data.list);
})
.catch((res) => {
// paging.value.complete(false);
// catchz-paging
// uni.$emit('z-paging-error-emit');
paging.value.complete(false);
});
};
</script>
<style lang="scss" scoped>
.u-page {
:deep(.u-flex) {
display: flex;
flex-direction:row;
}
.deal {
margin-top: 20rpx;
display: flex;
color: #6b7280;
font-size: 24rpx;
justify-content: space-between;
.left {
display: flex;
align-items: center;
}
.collect {
display: flex;
align-items: center;
}
.eyebox {
width: 160rpx;
display: flex;
align-items: center;
}
.time {
display: flex;
align-items: center;
}
.num {
margin-left: 8rpx;
}
}
.item {
border-bottom: 1rpx solid #f3f4f6;
padding: 30rpx;
.title {
font-size: 30rpx;
color: #111827;
line-height: 46rpx;
}
}
.tagsbox {
margin-top: 20rpx;
display: flex;
.tag {
padding: 0 10rpx;
margin-right: 16rpx;
height: 46rpx;
line-height: 46rpx;
text-align: center;
background: rgba(60, 199, 192, 0.1);
border-radius: 8rpx;
font-weight: 400;
font-size: 24rpx;
color: #3cc7c0;
}
}
}
.detail {
background: #f9f9f9;
padding: 12rpx 30rpx;
.desc {
font-size: 26rpx;
color: #4b5563;
line-height: 40rpx;
}
}
</style>

View File

@ -0,0 +1,16 @@
<template>
<web-view :src="src"></web-view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
const src=ref('')
onLoad((option)=>{
src.value=option.src
})
</script>
<style scoped>
</style>

BIN
static/chat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
static/collect.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/headImg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/shang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
static/ss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/uploadImg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B