Browse Source

知识库联调

master
kola-web 4 days ago
parent
commit
b72408e577
  1. 4
      README.md
  2. 2
      dist.ps1
  3. 40
      project.private.config.json
  4. 8
      src/app.json
  5. 7
      src/components/login/index.ts
  6. 11
      src/components/navbar/index.ts
  7. 1
      src/components/pagination/index.js
  8. 5
      src/components/pickerArea/index.ts
  9. 5
      src/components/popup/index.scss
  10. 5
      src/components/popup/index.ts
  11. 7
      src/components/popup/index.wxml
  12. 2
      src/custom-tab-bar/index.ts
  13. 2
      src/custom-tab-bar/index.wxml
  14. 3
      src/doc/pages/doc1/index.json
  15. 0
      src/doc/pages/doc1/index.scss
  16. 8
      src/doc/pages/doc1/index.ts
  17. 2
      src/doc/pages/doc1/index.wxml
  18. BIN
      src/images/banner1.png
  19. BIN
      src/images/bg5.png
  20. BIN
      src/images/login-title1.png
  21. BIN
      src/images/start.png
  22. 4
      src/pages/applyFrom/index.scss
  23. 2
      src/pages/applyFrom/index.wxml
  24. 6
      src/pages/index/index.scss
  25. 38
      src/pages/index/index.ts
  26. 45
      src/pages/index/index.wxml
  27. 6
      src/pages/knowledge/index.scss
  28. 30
      src/pages/knowledge/index.ts
  29. 18
      src/pages/knowledge/index.wxml
  30. 6
      src/pages/knowledgeDetail/index.scss
  31. 76
      src/pages/knowledgeDetail/index.ts
  32. 14
      src/pages/knowledgeDetail/index.wxml
  33. 3
      src/pages/knowledgeDetailVideo/index.json
  34. 25
      src/pages/knowledgeDetailVideo/index.scss
  35. 163
      src/pages/knowledgeDetailVideo/index.ts
  36. 41
      src/pages/knowledgeDetailVideo/index.wxml
  37. 4
      src/pages/login/index.json
  38. 42
      src/pages/login/index.scss
  39. 11
      src/pages/login/index.ts
  40. 7
      src/pages/login/index.wxml
  41. 6
      src/pages/my/index.ts
  42. 24
      src/pages/my/index.wxml
  43. 4
      src/pages/start/index.json
  44. 4
      src/pages/start/index.scss
  45. 14
      src/pages/start/index.ts
  46. 1
      src/pages/start/index.wxml
  47. 2
      src/patient/pages/entryInfo/index.wxml
  48. 5
      src/patient/pages/home/index.scss
  49. 1
      src/patient/pages/home/index.wxml
  50. 2
      src/patient/pages/login/index.wxml

4
README.md

@ -3,5 +3,9 @@ @@ -3,5 +3,9 @@
<!--图片文件夹svn地址-->
svn://39.106.86.127:28386/projects/wutian_xueyoubing_b/proj_src/shop/frontend/web/GeneB
(/images/)(\S*(?=["|']))
{{imageUrl}}$2?t={{Timestamp}}
https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567

2
dist.ps1

@ -6,3 +6,5 @@ svn add . --no-ignore --force @@ -6,3 +6,5 @@ svn add . --no-ignore --force
# Commit the changes with a message
svn ci -m "版本更新"
ssh hb127 "cd /data1/wwwroot/default/wutian_xueyoubing_b/shop/frontend/web/ && svn up && exit"

40
project.private.config.json

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
"projectname": "GeneB-miniprogram",
"setting": {
"compileHotReLoad": true,
"urlCheck": false,
"urlCheck": true,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false,
@ -23,11 +23,25 @@ @@ -23,11 +23,25 @@
"miniprogram": {
"list": [
{
"name": "知识夸详情-文章",
"pathName": "pages/knowledgeDetail/index",
"query": "id=9",
"scene": null,
"launchMode": "default"
},
{
"name": "知识库详情-视频",
"pathName": "pages/knowledgeDetailVideo/index",
"query": "id=3",
"launchMode": "default",
"scene": null
},
{
"name": "患者-首页",
"pathName": "patient/pages/home/index",
"query": "",
"scene": null,
"launchMode": "default"
"launchMode": "default",
"scene": null
},
{
"name": "患者-录入个人信息",
@ -72,36 +86,36 @@ @@ -72,36 +86,36 @@
"scene": null
},
{
"name": "知识库详情-视频",
"pathName": "pages/knowledgeDetailVideo/index",
"name": "知识库",
"pathName": "pages/knowledge/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "知识夸详情-文章",
"pathName": "pages/knowledgeDetail/index",
"name": "基因疗法申请-结果页",
"pathName": "pages/applyFromResult/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "知识库",
"pathName": "pages/knowledge/index",
"name": "基因疗法申请",
"pathName": "pages/applyFrom/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "基因疗法申请-结果页",
"pathName": "pages/applyFromResult/index",
"name": "页",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "基因疗法申请",
"pathName": "pages/applyFrom/index",
"name": "登录",
"pathName": "pages/login/index",
"query": "",
"launchMode": "default",
"scene": null

8
src/app.json

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
{
"$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json",
"pages": [
"pages/start/index",
"pages/login/index",
"pages/index/index",
"pages/my/index",
"pages/applyFrom/index",
@ -13,7 +15,11 @@ @@ -13,7 +15,11 @@
"subPackages": [
{
"root": "patient",
"pages": ["pages/protocol/index", "pages/login/index", "pages/entryInfo/index","pages/home/index"]
"pages": ["pages/protocol/index", "pages/login/index", "pages/entryInfo/index", "pages/home/index"]
},
{
"root": "doc",
"pages": ["pages/doc1/index"]
}
],
"tabBar": {

7
src/components/login/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>()
Component({
properties: {
@ -7,7 +7,10 @@ Component({ @@ -7,7 +7,10 @@ Component({
value: false,
},
},
data: {},
data: {
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp
},
methods: {
handleOk() {
this.setData({

11
src/components/navbar/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>()
Component({
options: {
@ -30,16 +30,17 @@ Component({ @@ -30,16 +30,17 @@ Component({
/**
*
*/
data: {},
data: {
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp
},
/**
*
*/
methods: {
onClickLeft() {
if (this.data.back) {
wx.navigateBack()
}
if(this.data.back)
this.triggerEvent('clickLeft', {}, {})
},
onClickRight() {

1
src/components/pagination/index.js

@ -11,6 +11,7 @@ Component({ @@ -11,6 +11,7 @@ Component({
},
data: {
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp
},
methods: {
handleTouchmove() {

5
src/components/pickerArea/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>()
Component({
properties: {
@ -13,6 +13,9 @@ Component({ @@ -13,6 +13,9 @@ Component({
},
data: {
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp,
show: false,
options: [],
fieldNames: {

5
src/components/popup/index.scss

@ -24,9 +24,14 @@ @@ -24,9 +24,14 @@
margin-top: 64rpx;
font-size: 32rpx;
color: rgba(1, 1, 5, 0.3);
display: flex;
.checkbox {
transform: scale(0.8);
}
.c-content{
padding-top: 5rpx;
line-height: 48rpx;
}
}
.link {
color: #f23a2f;

5
src/components/popup/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>()
Component({
properties: {
@ -17,6 +17,9 @@ Component({ @@ -17,6 +17,9 @@ Component({
data: {
popup1Check1: false,
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp
},
methods: {
handleOk() {

7
src/components/popup/index.wxml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
>
<view class="popup1" wx:if="{{type==='argument'}}">
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="title">欢迎加入“向光而行”</view>
<view class="title">欢迎加入“愈见守护”</view>
<view class="content">
亲爱的用户,为了更好地向您提供平台服务保护您的权益,我们完善了
<text class="link">《个人信息及隐私政策》</text>
@ -16,8 +16,11 @@ @@ -16,8 +16,11 @@
</view>
<view class="check">
<checkbox class="checkbox" model:checked="{{popup1Check1}}" color="#f23a2f"></checkbox>
我已阅读并同意
<view class="c-content">
我特此同意
<text class="link">《个人信息及隐私政策》</text>
规定收集我的相关敏感个人信息
</view>
</view>
<view class="btn1" bind:tap="handleOk">同意并继续</view>
<view class="btn2" bind:tap="handleCancel">不同意</view>

2
src/custom-tab-bar/index.ts

@ -5,6 +5,8 @@ Component({ @@ -5,6 +5,8 @@ Component({
properties: {},
data: {
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp,
isChild: 0,
active: 0,
list: [

2
src/custom-tab-bar/index.wxml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
wx:if="{{ index != 3 || !anyWhere}}"
bind:tap="handleNav"
data-index="{{index}}"
icon="/images/tabbar/{{active==index ? item.iconActive : item.icon}}.png"
icon="{{imageUrl}}/tabbar/{{active==index ? item.iconActive : item.icon}}.png?r={{Timestamp}}"
>
<view class="name {{index==active && 'active'}}">{{item.text}}</view>
<view class="hot"></view>

3
src/doc/pages/doc1/index.json

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
{
"usingComponents": {}
}

0
src/doc/pages/doc1/index.scss

8
src/doc/pages/doc1/index.ts

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
const _app = getApp<IAppOption>();
Page({
data: {},
onLoad() {},
});
export {}

2
src/doc/pages/doc1/index.wxml

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
<!--pages/story/index.wxml-->
<text>pages/story/index.wxml</text>

BIN
src/images/banner1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

BIN
src/images/bg5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
src/images/login-title1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/images/start.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

4
src/pages/applyFrom/index.scss

@ -11,7 +11,11 @@ page { @@ -11,7 +11,11 @@ page {
.from-item {
padding: 32rpx 0;
display: flex;
align-items: center;
border-bottom: 1px solid #ededf7;
&.no-center{
align-items: start;
}
&:last-of-type {
border: none;
}

2
src/pages/applyFrom/index.wxml

@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
<button wx:else class="tel" open-type="getPhoneNumber" bindgetphonenumber="handlePhoneNumber">一键获取</button>
</view>
</view>
<view class="from-item">
<view class="from-item no-center">
<view class="label">其他说明</view>
<view class="content">
<textarea

6
src/pages/index/index.scss

@ -17,6 +17,12 @@ @@ -17,6 +17,12 @@
.wx-swiper-dots.wx-swiper-dots-horizontal {
margin-bottom: 80rpx;
}
.wx-swiper-dot {
transform: scale(0.8);
}
.wx-swiper-dot-active {
transform: scale(1.2);
}
}
.page-containr {
position: relative;

38
src/pages/index/index.ts

@ -10,21 +10,22 @@ Page({ @@ -10,21 +10,22 @@ Page({
userInfo: {},
bannerList: [],
knowledgeList: [] as any,
pageTop: '',
background: 'transparent',
},
onLoad() {
app.waitLogin().then(() => {
this.setData({
popupShow: !app.globalData.guestPrivacyAgree,
})
this.setData({})
app.getUserInfo().then((userInfo) => {
this.setData({
userInfo,
popupShow: !userInfo.guestPrivacyAgree,
})
})
this.getBanner()
this.getKnowledgeList()
})
},
getBanner() {
@ -38,12 +39,41 @@ Page({ @@ -38,12 +39,41 @@ Page({
})
})
},
onBannerItemTap(e) {
getKnowledgeList() {
wx.ajax({
method: 'GET',
url: '?r=wtx/knowledge/index-list',
data: {},
}).then((res) => {
this.setData({
knowledgeList: res.list,
})
})
},
onBannerItemTap(e: any) {
const { path } = e.currentTarget.dataset
wx.navigateTo({
url: path,
})
},
handleKnowledge() {
wx.switchTab({
url: '/pages/knowledge/index',
})
},
handleKnowledgeDetail(e: any) {
const { index } = e.currentTarget.dataset
const params = this.data.knowledgeList[index]
if (params.Type == 1) {
wx.navigateTo({
url: `/pages/knowledgeDetail/index?id=${params.Id}`,
})
return
}
wx.navigateTo({
url: `/pages/knowledgeDetailVideo/index?id=${params.Id}`,
})
},
routerTo(e) {
const { url } = e.currentTarget.dataset
wx.navigateTo({

45
src/pages/index/index.wxml

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<image class="page-title" slot="left" src="{{imageUrl}}index-title1.png?t={{Timestamp}}"></image>
</navbar>
<view class="page">
<swiper class="banner" indicator-dots indicator-active-color="#fff" indicator-color="rgba(255 255 255,0.3)">
<swiper class="banner" autoplay="{{true}}" indicator-dots indicator-active-color="#FA5E48" indicator-color="#fff">
<swiper-item
class="banner-item"
wx:for="{{bannerList}}"
@ -15,12 +15,20 @@ @@ -15,12 +15,20 @@
</swiper>
<view class="page-containr">
<view class="apply" bind:tap="routerTo" data-url="/pages/applyFrom/index">
<image wx:if="{{userInfo.ApplyIntentionId}}" class="a-img" src="{{imageUrl}}index-apply-end.png?t={{Timestamp}}"></image>
<image
wx:if="{{userInfo.ApplyIntentionId}}"
class="a-img"
src="{{imageUrl}}index-apply-end.png?t={{Timestamp}}"
></image>
<image wx:else class="a-img" src="{{imageUrl}}index-apply.png?t={{Timestamp}}"></image>
<image wx:if="{{userInfo.ApplyIntentionId}}" class="a-label" src="{{imageUrl}}index-apply-label.png?t={{Timestamp}}"></image>
<image
wx:if="{{userInfo.ApplyIntentionId}}"
class="a-label"
src="{{imageUrl}}index-apply-label.png?t={{Timestamp}}"
></image>
</view>
<view class="module1">
<view class="module-header">
<view class="module-header" bind:tap="handleKnowledge">
<image class="title" src="{{imageUrl}}index-title2.png?t={{Timestamp}}" mode="heightFix"></image>
<view class="more">
查看更多
@ -28,26 +36,15 @@ @@ -28,26 +36,15 @@
</view>
</view>
<view class="module-list">
<view class="module-item" bindtap="onModuleItemTap" data-id="1">
<image
class="item-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="item-title">基因治疗</view>
</view>
<view class="module-item" bindtap="onModuleItemTap" data-id="2">
<image
class="item-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="item-title">基因检测</view>
</view>
<view class="module-item" bindtap="onModuleItemTap" data-id="3">
<image
class="item-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<view class="item-title">基因组学</view>
<view
class="module-item"
wx:for="{{knowledgeList}}"
wx:key="Id"
bindtap="handleKnowledgeDetail"
data-index="{{index}}"
>
<image class="item-img" src="{{item.CoverImg}}"></image>
<view class="item-title">{{item.Title}}</view>
</view>
</view>
</view>

6
src/pages/knowledge/index.scss

@ -6,6 +6,7 @@ page { @@ -6,6 +6,7 @@ page {
background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
.list {
.list-item {
margin-bottom: 24rpx;
display: flex;
.photo {
flex-shrink: 0;
@ -18,6 +19,7 @@ page { @@ -18,6 +19,7 @@ page {
}
}
.wrap {
flex: 1;
padding-left: 24rpx;
.title {
font-size: 32rpx;
@ -27,8 +29,9 @@ page { @@ -27,8 +29,9 @@ page {
.w-footer {
margin-top: 20rpx;
display: flex;
gap: 88rpx;
gap: 68rpx;
.date {
width: 7em;
font-size: 28rpx;
color: rgba(18, 18, 18, 0.4);
}
@ -40,6 +43,7 @@ page { @@ -40,6 +43,7 @@ page {
height: 32rpx;
}
.num {
margin-left: 10rpx;
font-size: 28rpx;
color: rgba(18, 18, 18, 0.4);
}

30
src/pages/knowledge/index.ts

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
const _app = getApp<IAppOption>()
const dayjs = require('dayjs')
const app = getApp<IAppOption>()
Page({
data: {
@ -10,15 +11,22 @@ Page({ @@ -10,15 +11,22 @@ Page({
count: 1,
},
},
onLoad() {},
onShow() {
app.waitLogin().then(() => {
this.getList()
})
},
getList(newPage = 1) {
wx.ajax({
method: 'GET',
url: '',
url: '?r=wtx/knowledge/list',
data: {
page: newPage,
},
}).then((res) => {
res.list.forEach((item: any) => {
item.UpdateTime = dayjs(item.UpdateTime).format('YYYY-MM-DD')
})
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]
this.setData({
total: res.count,
@ -37,13 +45,17 @@ Page({ @@ -37,13 +45,17 @@ Page({
this.getList(page + 1)
}
},
handleDetail() {
// wx.navigateTo({
// url: '/pages/knowledgeDetail/index',
// })
handleDetail(e) {
const { index } = e.currentTarget.dataset
const params = this.data.list[index]
if (params.Type == 1) {
wx.navigateTo({
url: `/pages/knowledgeDetail/index?id=${params.Id}`,
})
return
}
wx.navigateTo({
url: '/pages/knowledgeDetailVideo/index',
url: `/pages/knowledgeDetailVideo/index?id=${params.Id}`,
})
},
})

18
src/pages/knowledge/index.wxml

@ -1,21 +1,21 @@ @@ -1,21 +1,21 @@
<navbar fixed title="知识库" custom-style="background:{{background}}"></navbar>
<view class="page" style="background: url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 602rpx;padding-top: {{pageTop + 20}}px;">
<view
class="page"
style="background: url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 602rpx;padding-top: {{pageTop + 20}}px;"
>
<view class="list">
<view class="list-item" bind:tap="handleDetail">
<view class="list-item" wx:for="{{list}}" wx:key="Id" bind:tap="handleDetail" data-index="{{index}}">
<view class="photo">
<image
class="photo-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<image class="photo-img" mode="aspectFill" src="{{item.CoverImg}}"></image>
</view>
<view class="wrap">
<view class="title">一图读懂基因疗法治疗血友病B</view>
<view class="title">{{item.Title}}</view>
<view class="w-footer">
<view class="date">2025-04-01</view>
<view class="date">{{item.UpdateTime}}</view>
<view class="eye">
<image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image>
<view class="num">12</view>
<view class="num" wx:if="{{item.ViewTimes>0}}">{{item.ViewTimes}}</view>
</view>
</view>
</view>

6
src/pages/knowledgeDetail/index.scss

@ -4,9 +4,11 @@ @@ -4,9 +4,11 @@
font-size: 40rpx;
color: rgba(1, 1, 5, 1);
line-height: 64rpx;
font-weight: bold;
}
.info {
margin-top: 20rpx;
padding-bottom: 24rpx;
display: flex;
align-items: center;
gap: 86rpx;
@ -22,14 +24,12 @@ @@ -22,14 +24,12 @@
height: 32rpx;
}
.num {
margin-left: 10rpx;
font-size: 28rpx;
color: rgba(18, 18, 18, 0.4);
}
}
}
.mp-html {
margin-top: 24rpx;
}
.footer {
position: fixed;
bottom: 0;

76
src/pages/knowledgeDetail/index.ts

@ -1,8 +1,76 @@ @@ -1,8 +1,76 @@
const _app = getApp<IAppOption>();
const licia = require('miniprogram-licia')
const app = getApp<IAppOption>()
Page({
data: {},
onLoad() {},
});
data: {
id: '',
detail: {} as any,
LikeTimes: 0,
},
onLoad(options) {
this.setData({
id: options.id,
})
app.waitLogin().then(() => {
this.handleView()
})
},
handleView() {
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/view',
data: {
Id: this.data.id,
},
}).then(() => {
this.getDetail()
})
},
getDetail() {
wx.ajax({
method: 'GET',
url: '?r=wtx/knowledge/detail',
data: {
Id: this.data.id,
},
}).then((res) => {
this.setData({
detail: res,
})
})
},
handleLike() {
this.setData({
'detail.LikeTimes': Number(this.data.detail.LikeTimes) + 1,
LikeTimes: this.data.LikeTimes + 1,
})
this.likePost()
},
likePost: licia.debounce(function (this: any) {
const { id, LikeTimes } = this.data
this.setData({
LikeTimes: 0,
})
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/like',
data: {
Id: id,
LikeTimes,
},
}).then(() => {
this.getDetail()
})
}, 1000),
onShareAppMessage() {
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/share',
data: { Id: this.data.id },
}).then(() => {
this.getDetail()
})
},
})
export {}

14
src/pages/knowledgeDetail/index.wxml

@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
<view class="page">
<view class="title">一图读懂基因疗法治疗血友病B</view>
<view class="title">{{detail.Title}}</view>
<view class="info">
<view class="date">2025-04-01</view>
<view class="date">{{detail.UpdateTime}}</view>
<view class="eye">
<image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image>
<view class="num">12</view>
<view class="num" wx:if="{{detail.ViewNum > 0}}">{{detail.ViewTimes}}</view>
</view>
</view>
<mp-html class="mp-html" content="111111111"></mp-html>
<mp-html class="mp-html" content="{{detail.Content}}"></mp-html>
<view class="footer">
<button class="btn" open-type="share">
<image class="icon" src="{{imageUrl}}icon7.png?t={{Timestamp}}"></image>
<view class="num">10</view>
<view class="num" wx:if="{{detail.ShareTimes>0}}">{{detail.ShareTimes}}</view>
</button>
<view class="line"></view>
<view class="btn" bindtap="onDetail">
<view class="btn" bindtap="handleLike">
<image class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
<view class="num">12</view>
<view class="num" wx:if="{{detail.LikeTimes>0}}">{{detail.LikeTimes}}</view>
</view>
</view>
</view>

3
src/pages/knowledgeDetailVideo/index.json

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
{
"navigationStyle": "custom",
"usingComponents": {
"mp-video-swiper": "@miniprogram-component-plus/video-swiper"
"mp-video-swiper": "@miniprogram-component-plus/video-swiper",
"navbar": "/components/navbar/index"
}
}

25
src/pages/knowledgeDetailVideo/index.scss

@ -3,15 +3,18 @@ @@ -3,15 +3,18 @@
.swiper {
width: 100vw;
height: 100vh;
.container {
.swiper-item {
position: relative;
width: 100vw;
height: 100vh;
.video{
width: 100%;
height: 100%;
}
}
.page-footer {
.swiper-item-footer {
padding: 80rpx 30rpx calc(34rpx + env(safe-area-inset-bottom));
width: 100%;
position: fixed;
position: absolute;
bottom: 0;
left: 0;
box-sizing: border-box;
@ -46,6 +49,18 @@ @@ -46,6 +49,18 @@
align-items: center;
gap: 64rpx;
.o-item {
padding: 0;
margin: 0;
border: none;
outline: none;
background: transparent;
display: flex;
flex-direction: column;
align-items: center;
line-height: 1;
&::after {
border: none;
}
.icon {
width: 36rpx;
height: 36rpx;
@ -59,4 +74,6 @@ @@ -59,4 +74,6 @@
}
}
}
}
}
}

163
src/pages/knowledgeDetailVideo/index.ts

@ -1,26 +1,157 @@ @@ -1,26 +1,157 @@
const _app = getApp<IAppOption>()
const licia = require('miniprogram-licia')
const app = getApp<IAppOption>()
// 组件说明文档 https://github.com/wechat-miniprogram/miniprogram-component-plus/blob/master/docs/video-swiper.md
Page({
data: {
videoList: [
{
id: '3',
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250219819_tmp_e2ec2711a0532b331bf4308476e5f76e.mp4',
objectFit: 'cover',
id: '',
activeId: '',
LikeTimes: 0,
current: 0,
videoList: [] as any,
beforeLoading: false,
beforeEnd: false,
afterLoading: false,
afterEnd: false,
},
onLoad(options) {
this.setData({
id: options.id,
activeId: options.id,
})
app.waitLogin().then(() => {
this.handleView()
})
},
handleView() {
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/view',
data: {
Id: this.data.activeId,
},
}).then(() => {
this.getDetail()
})
},
getDetail() {
wx.ajax({
method: 'GET',
url: '?r=wtx/knowledge/detail',
data: {
Id: this.data.id,
},
{
id: '1',
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250217708_B0z8keBB6vlJ7ec6b4d3bd8cad5088ae4fd5e8dd428f.mp4',
objectFit: 'contain',
}).then((res) => {
this.setData({
videoList: [res],
afterLoading: true,
beforeLoading: true,
})
this.playCurrentVideo()
this.getList('before')
this.getList('after')
})
},
getList(sort: 'before' | 'after') {
const { videoList, id, current } = this.data
wx.ajax({
method: 'GET',
url: '?r=wtx/knowledge/video-sort-list',
data: {
Id: id,
sort,
},
}).then((res) => {
if (sort === 'before') {
const newVideoList = [...res.list, ...videoList]
this.setData({
videoList: newVideoList,
beforeLoading: false,
current: newVideoList.length - 1 + current,
beforeEnd: res.length === 0,
})
}
if (sort === 'after') {
this.setData({
videoList: videoList.concat(res.list),
afterLoading: false,
afterEnd: res.length === 0,
})
}
})
},
handleChange(e: any) {
const { beforeLoading, afterLoading, beforeEnd, afterEnd, videoList } = this.data
const { current } = e.detail
this.setData({
current,
})
if (current === 0 && !beforeLoading && beforeEnd) {
this.setData({
beforeLoading: true,
})
this.getList('before')
}
if (current === videoList.length - 1 && !afterLoading && afterEnd) {
this.setData({
afterLoading: true,
})
this.getList('after')
}
this.playCurrentVideo()
},
playCurrentVideo() {
const { current, videoList } = this.data
videoList.forEach((item: any, index: number) => {
if (!item.ctx) {
item.ctx = wx.createVideoContext(`video-${item.Id}`)
}
if (index === current) {
item.ctx.play()
} else {
item.ctx.pause()
}
})
},
handleLike() {
const { current, videoList } = this.data
const currentVideo = videoList[current]
const LikeTimes = Number(currentVideo.LikeTimes) + 1
const key = `videoList[${current}].LikeTimes`
this.setData({
LikeTimes: this.data.LikeTimes + 1,
[key]: LikeTimes,
})
this.likePost()
},
likePost: licia.debounce(function (this: any) {
const { activeId, LikeTimes } = this.data
this.setData({
LikeTimes: 0,
})
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/like',
data: {
Id: activeId,
LikeTimes,
},
{
id: '2',
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250217596_TFyXNoEMijg67ec6b4d3bd8cad5088ae4fd5e8dd428f.mp4',
objectFit: 'contain',
})
}, 1000),
onShareAppMessage() {
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/share',
data: { Id: this.data.activeId },
}).then(() => {
this.getDetail()
})
},
],
handleBack() {
wx.navigateBack()
},
onLoad() {},
})
export {}

41
src/pages/knowledgeDetailVideo/index.wxml

@ -1,26 +1,41 @@ @@ -1,26 +1,41 @@
<!-- https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/extended/component-plus/video-swiper.html -->
<navbar fixed custom-style="background:{{background}};color:#fff">
<van-icon name="arrow-left" slot="left" size="18px" color="#fff" bind:tap="handleBack"/>
<view slot="title" style="color: #fff">视频</view>
</navbar>
<view class="page">
<mp-video-swiper class="swiper" video-list="{{videoList}}"></mp-video-swiper>
<view class="page-footer">
<view class="title">你关心的基因治疗一个视频帮您介绍清楚</view>
<swiper class="swiper" vertical="{{true}}" current="{{current}}" bindchange="handleChange">
<swiper-item class="swiper-item" wx:for="{{videoList}}" wx:key="Id">
<video
id="video-{{item.Id}}"
class="video"
src="{{item.VideoSrc}}"
poster="{{item.CoverImg}}"
loop
object-fit="cover"
enable-play-gesture
enable-progress-gesture
show-center-play-btn="{{false}}"
controls="{{false}}"
></video>
<view class="swiper-item-footer">
<view class="title">{{item.Title}}{{item.Id}}</view>
<view class="container">
<view class="user">
<image
class="avatar"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
<image class="avatar" src="/images/logo1.png"></image>
<view class="name">基因知识库</view>
</view>
<view class="options">
<view class="o-item">
<button class="o-item" open-type="share">
<image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image>
<view class="num">12</view>
</view>
<view class="o-item">
<view class="num">{{item.ShareTimes}}</view>
</button>
<view class="o-item" bind:tap="handleLike">
<image class="icon" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image>
<view class="num">12</view>
<view class="num">{{item.LikeTimes}}</view>
</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>

4
src/pages/login/index.json

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
{
"navigationStyle": "custom",
"usingComponents": {}
}

42
src/pages/login/index.scss

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
.page {
width: 100vw;
height: 100vh;
position: relative;
.container {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
padding: 0 60rpx 120rpx;
box-sizing: border-box;
.logo {
display: block;
margin: 0 auto;
width: 164rpx;
height: 164rpx;
}
.title {
width: 352rpx;
height: 108rpx;
display: block;
margin: 36rpx auto 0;
}
.btn {
margin: 90rpx auto 0;
border: none;
border: none;
outline: none;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
display: flex;
align-items: center;
justify-content: center;
height: 96rpx;
background: linear-gradient(356deg, #f23a2f 0%, #fc684f 100%);
border-radius: 84rpx 84rpx 84rpx 84rpx;
&::after {
border: none;
}
}
}
}

11
src/pages/login/index.ts

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
const _app = getApp<IAppOption>()
Page({
data: {},
onLoad() {},
handlePhone(e) {
console.log(e)
},
})
export {}

7
src/pages/login/index.wxml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<view class="page" style="background: url('/images/bg5.png') no-repeat top center/cover;">
<view class="container">
<image class="logo" src="/images/logo1.png"></image>
<image class="title" src="/images/login-title1.png"></image>
<button class="btn" open-type="getPhoneNumber" bindgetphonenumber="handlePhone">手机号快速授权</button>
</view>
</view>

6
src/pages/my/index.ts

@ -65,6 +65,12 @@ Page({ @@ -65,6 +65,12 @@ Page({
url,
})
},
handleNone() {
this.setData({
popupShow: true,
popupType: 'stayTuned',
})
},
})
export {}

24
src/pages/my/index.wxml

@ -8,8 +8,7 @@ @@ -8,8 +8,7 @@
</button>
<view class="wrap">
<view class="name">
<text class="nickname">???</text>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
<text class="nickname">你好</text>
</view>
<view class="day">
今天是陪伴您的第
@ -18,16 +17,24 @@ @@ -18,16 +17,24 @@
</view>
</view>
<view class="apply" bind:tap="routerTo" data-url="/pages/applyFrom/index">
<image wx:if="{{userInfo.ApplyIntentionId}}" class="a-img" src="{{imageUrl}}index-apply-end.png?t={{Timestamp}}"></image>
<image
wx:if="{{userInfo.ApplyIntentionId}}"
class="a-img"
src="{{imageUrl}}index-apply-end.png?t={{Timestamp}}"
></image>
<image wx:else class="a-img" src="{{imageUrl}}index-apply.png?t={{Timestamp}}"></image>
<image wx:if="{{userInfo.ApplyIntentionId}}" class="a-label" src="{{imageUrl}}index-apply-label.png?t={{Timestamp}}"></image>
<image
wx:if="{{userInfo.ApplyIntentionId}}"
class="a-label"
src="{{imageUrl}}index-apply-label.png?t={{Timestamp}}"
></image>
</view>
<view class="list">
<view class="list-header">
<view class="list-header" bind:tap="handleNone">
<view class="name">切换身份</view>
<image class="icon" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
<view class="item" bind:tap="routerTo" data-url="/patient/pages/protocol/index">
<!-- <view class="item" bind:tap="routerTo" data-url="/patient/pages/protocol/index"> -->
<view class="item" bind:tap="handleNone">
<image class="icon" src="{{imageUrl}}icon13.png?t={{Timestamp}}"></image>
<view class="wrap">
<view class="name">我已开启基因治疗</view>
@ -35,7 +42,7 @@ @@ -35,7 +42,7 @@
</view>
<image class="icon2" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
<view class="item">
<view class="item" bind:tap="handleNone">
<image class="icon" src="{{imageUrl}}icon14.png?t={{Timestamp}}"></image>
<view class="wrap">
<view class="name">我是医生</view>
@ -44,7 +51,6 @@ @@ -44,7 +51,6 @@
<image class="icon2" src="{{imageUrl}}icon12.png?t={{Timestamp}}"></image>
</view>
</view>
<view class="login-out">退出登录</view>
</view>
<popup model:show="{{popupShow}}" type="{{popupType}}" params="{{popupParams}}" bind:cancel="handlePopupCancel"></popup>

4
src/pages/start/index.json

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
{
"navigationStyle": "custom",
"usingComponents": {}
}

4
src/pages/start/index.scss

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
.page{
width: 100vw;
height: 100vh;
}

14
src/pages/start/index.ts

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
const _app = getApp<IAppOption>()
Page({
data: {},
onLoad() {
setTimeout(() => {
wx.reLaunch({
url: '/pages/index/index',
})
}, 1500)
},
})
export {}

1
src/pages/start/index.wxml

@ -0,0 +1 @@ @@ -0,0 +1 @@
<image src="{{imageUrl}}start.png?t={{Timestamp}}" mode="aspectFill" class="page"></image>

2
src/patient/pages/entryInfo/index.wxml

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;"
>
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="page-title">欢迎加入向光而行</view>
<view class="page-title">欢迎加入愈见守护</view>
<view class="form">
<view class="form-row">
<view class="title">怎么称呼您</view>

5
src/patient/pages/home/index.scss

@ -244,6 +244,11 @@ page { @@ -244,6 +244,11 @@ page {
color: rgba(1, 1, 5, 0.36);
}
}
.m-card {
margin-top: 24rpx;
width: 670rpx;
height: 280rpx;
}
}
.module2 {

1
src/patient/pages/home/index.wxml

@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
<van-icon name="arrow" />
</view>
</view>
<image class="m-card" src="/images/banner1.png"></image>
</view>
<view class="module2">
<view class="m-header">

2
src/patient/pages/login/index.wxml

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg3.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;"
>
<image class="logo" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="title">欢迎加入向光而行</view>
<view class="title">欢迎加入愈见守护</view>
<button class="phone" open-type="getPhoneNumber">手机号一键登录</button>
<view class="divider">
<van-divider contentPosition="center">或者</van-divider>

Loading…
Cancel
Save