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. 9
      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. 109
      src/pages/knowledgeDetailVideo/index.scss
  35. 163
      src/pages/knowledgeDetailVideo/index.ts
  36. 59
      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 @@
<!--图片文件夹svn地址--> <!--图片文件夹svn地址-->
svn://39.106.86.127:28386/projects/wutian_xueyoubing_b/proj_src/shop/frontend/web/GeneB 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 https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567

2
dist.ps1

@ -6,3 +6,5 @@ svn add . --no-ignore --force
# Commit the changes with a message # Commit the changes with a message
svn ci -m "版本更新" 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 @@
"projectname": "GeneB-miniprogram", "projectname": "GeneB-miniprogram",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": true,
"coverView": true, "coverView": true,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false, "skylineRenderEnable": false,
@ -23,11 +23,25 @@
"miniprogram": { "miniprogram": {
"list": [ "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": "患者-首页", "name": "患者-首页",
"pathName": "patient/pages/home/index", "pathName": "patient/pages/home/index",
"query": "", "query": "",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "患者-录入个人信息", "name": "患者-录入个人信息",
@ -72,36 +86,36 @@
"scene": null "scene": null
}, },
{ {
"name": "知识库详情-视频", "name": "知识库",
"pathName": "pages/knowledgeDetailVideo/index", "pathName": "pages/knowledge/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "知识夸详情-文章", "name": "基因疗法申请-结果页",
"pathName": "pages/knowledgeDetail/index", "pathName": "pages/applyFromResult/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "知识库", "name": "基因疗法申请",
"pathName": "pages/knowledge/index", "pathName": "pages/applyFrom/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "基因疗法申请-结果页", "name": "页",
"pathName": "pages/applyFromResult/index", "pathName": "pages/index/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "基因疗法申请", "name": "登录",
"pathName": "pages/applyFrom/index", "pathName": "pages/login/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

8
src/app.json

@ -1,6 +1,8 @@
{ {
"$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json", "$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json",
"pages": [ "pages": [
"pages/start/index",
"pages/login/index",
"pages/index/index", "pages/index/index",
"pages/my/index", "pages/my/index",
"pages/applyFrom/index", "pages/applyFrom/index",
@ -13,7 +15,11 @@
"subPackages": [ "subPackages": [
{ {
"root": "patient", "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": { "tabBar": {

7
src/components/login/index.ts

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

11
src/components/navbar/index.ts

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

1
src/components/pagination/index.js

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

5
src/components/pickerArea/index.ts

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

5
src/components/popup/index.scss

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

5
src/components/popup/index.ts

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

9
src/components/popup/index.wxml

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

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

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

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

@ -5,7 +5,7 @@
wx:if="{{ index != 3 || !anyWhere}}" wx:if="{{ index != 3 || !anyWhere}}"
bind:tap="handleNav" bind:tap="handleNav"
data-index="{{index}}" 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="name {{index==active && 'active'}}">{{item.text}}</view>
<view class="hot"></view> <view class="hot"></view>

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

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

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

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

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

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

@ -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 {
.from-item { .from-item {
padding: 32rpx 0; padding: 32rpx 0;
display: flex; display: flex;
align-items: center;
border-bottom: 1px solid #ededf7; border-bottom: 1px solid #ededf7;
&.no-center{
align-items: start;
}
&:last-of-type { &:last-of-type {
border: none; border: none;
} }

2
src/pages/applyFrom/index.wxml

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

6
src/pages/index/index.scss

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

38
src/pages/index/index.ts

@ -10,21 +10,22 @@ Page({
userInfo: {}, userInfo: {},
bannerList: [], bannerList: [],
knowledgeList: [] as any,
pageTop: '', pageTop: '',
background: 'transparent', background: 'transparent',
}, },
onLoad() { onLoad() {
app.waitLogin().then(() => { app.waitLogin().then(() => {
this.setData({ this.setData({})
popupShow: !app.globalData.guestPrivacyAgree,
})
app.getUserInfo().then((userInfo) => { app.getUserInfo().then((userInfo) => {
this.setData({ this.setData({
userInfo, userInfo,
popupShow: !userInfo.guestPrivacyAgree,
}) })
}) })
this.getBanner() this.getBanner()
this.getKnowledgeList()
}) })
}, },
getBanner() { getBanner() {
@ -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 const { path } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: path, 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) { routerTo(e) {
const { url } = e.currentTarget.dataset const { url } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({

45
src/pages/index/index.wxml

@ -2,7 +2,7 @@
<image class="page-title" slot="left" src="{{imageUrl}}index-title1.png?t={{Timestamp}}"></image> <image class="page-title" slot="left" src="{{imageUrl}}index-title1.png?t={{Timestamp}}"></image>
</navbar> </navbar>
<view class="page"> <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 <swiper-item
class="banner-item" class="banner-item"
wx:for="{{bannerList}}" wx:for="{{bannerList}}"
@ -15,12 +15,20 @@
</swiper> </swiper>
<view class="page-containr"> <view class="page-containr">
<view class="apply" bind:tap="routerTo" data-url="/pages/applyFrom/index"> <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: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>
<view class="module1"> <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> <image class="title" src="{{imageUrl}}index-title2.png?t={{Timestamp}}" mode="heightFix"></image>
<view class="more"> <view class="more">
查看更多 查看更多
@ -28,26 +36,15 @@
</view> </view>
</view> </view>
<view class="module-list"> <view class="module-list">
<view class="module-item" bindtap="onModuleItemTap" data-id="1"> <view
<image class="module-item"
class="item-img" wx:for="{{knowledgeList}}"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567" wx:key="Id"
></image> bindtap="handleKnowledgeDetail"
<view class="item-title">基因治疗</view> data-index="{{index}}"
</view> >
<view class="module-item" bindtap="onModuleItemTap" data-id="2"> <image class="item-img" src="{{item.CoverImg}}"></image>
<image <view class="item-title">{{item.Title}}</view>
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> </view>
</view> </view>
</view> </view>

6
src/pages/knowledge/index.scss

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

30
src/pages/knowledge/index.ts

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

18
src/pages/knowledge/index.wxml

@ -1,21 +1,21 @@
<navbar fixed title="知识库" custom-style="background:{{background}}"></navbar> <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">
<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"> <view class="photo">
<image <image class="photo-img" mode="aspectFill" src="{{item.CoverImg}}"></image>
class="photo-img"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567"
></image>
</view> </view>
<view class="wrap"> <view class="wrap">
<view class="title">一图读懂基因疗法治疗血友病B</view> <view class="title">{{item.Title}}</view>
<view class="w-footer"> <view class="w-footer">
<view class="date">2025-04-01</view> <view class="date">{{item.UpdateTime}}</view>
<view class="eye"> <view class="eye">
<image class="icon" src="{{imageUrl}}icon6.png?t={{Timestamp}}"></image> <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> </view>
</view> </view>

6
src/pages/knowledgeDetail/index.scss

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

76
src/pages/knowledgeDetail/index.ts

@ -1,8 +1,76 @@
const _app = getApp<IAppOption>(); const licia = require('miniprogram-licia')
const app = getApp<IAppOption>()
Page({ Page({
data: {}, data: {
onLoad() {}, 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 {} export {}

14
src/pages/knowledgeDetail/index.wxml

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

3
src/pages/knowledgeDetailVideo/index.json

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

109
src/pages/knowledgeDetailVideo/index.scss

@ -3,57 +3,74 @@
.swiper { .swiper {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
.container { .swiper-item {
position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} .video{
} width: 100%;
.page-footer { height: 100%;
padding: 80rpx 30rpx calc(34rpx + env(safe-area-inset-bottom)); }
width: 100%; .swiper-item-footer {
position: fixed; padding: 80rpx 30rpx calc(34rpx + env(safe-area-inset-bottom));
bottom: 0; width: 100%;
left: 0; position: absolute;
box-sizing: border-box; bottom: 0;
background: linear-gradient(to top, rgba(20, 20, 20, 0.88) 0%, rgba(20, 20, 20, 0) 100%); left: 0;
.title { box-sizing: border-box;
font-size: 32rpx; background: linear-gradient(to top, rgba(20, 20, 20, 0.88) 0%, rgba(20, 20, 20, 0) 100%);
color: rgba(255, 255, 255, 1); .title {
} font-size: 32rpx;
.container {
margin-top: 32rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.user {
display: flex;
align-items: center;
.avatar {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.name {
margin-left: 16rpx;
font-size: 28rpx;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
} }
} .container {
.options { margin-top: 32rpx;
padding-right: 26rpx; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 64rpx; justify-content: space-between;
.o-item { .user {
.icon { display: flex;
width: 36rpx; align-items: center;
height: 36rpx; .avatar {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
}
.name {
margin-left: 16rpx;
font-size: 28rpx;
color: rgba(255, 255, 255, 1);
}
} }
.num { .options {
margin-top: 6rpx; padding-right: 26rpx;
font-size: 32rpx; display: flex;
color: rgba(255, 255, 255, 1); 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;
}
.num {
margin-top: 6rpx;
font-size: 32rpx;
color: rgba(255, 255, 255, 1);
}
}
} }
} }
} }

163
src/pages/knowledgeDetailVideo/index.ts

@ -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({ Page({
data: { data: {
videoList: [ id: '',
{ activeId: '',
id: '3', LikeTimes: 0,
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250219819_tmp_e2ec2711a0532b331bf4308476e5f76e.mp4',
objectFit: 'cover', 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,
}, },
{ }).then((res) => {
id: '1', this.setData({
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250217708_B0z8keBB6vlJ7ec6b4d3bd8cad5088ae4fd5e8dd428f.mp4', videoList: [res],
objectFit: 'contain', 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) => {
id: '2', if (sort === 'before') {
url: 'https://circlehbsaas.oss-cn-beijing.aliyuncs.com/video/20250217596_TFyXNoEMijg67ec6b4d3bd8cad5088ae4fd5e8dd428f.mp4', const newVideoList = [...res.list, ...videoList]
objectFit: 'contain', 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,
}, },
], })
}, 1000),
onShareAppMessage() {
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/share',
data: { Id: this.data.activeId },
}).then(() => {
this.getDetail()
})
},
handleBack() {
wx.navigateBack()
}, },
onLoad() {},
}) })
export {} export {}

59
src/pages/knowledgeDetailVideo/index.wxml

@ -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"> <view class="page">
<mp-video-swiper class="swiper" video-list="{{videoList}}"></mp-video-swiper> <swiper class="swiper" vertical="{{true}}" current="{{current}}" bindchange="handleChange">
<view class="page-footer"> <swiper-item class="swiper-item" wx:for="{{videoList}}" wx:key="Id">
<view class="title">你关心的基因治疗一个视频帮您介绍清楚</view> <video
<view class="container"> id="video-{{item.Id}}"
<view class="user"> class="video"
<image src="{{item.VideoSrc}}"
class="avatar" poster="{{item.CoverImg}}"
src="https://pic1.zhimg.com/50/v2-8cfef5f9ea7d15963af2277c6814f152_720w.jpg?source=2c26e567" loop
></image> object-fit="cover"
<view class="name">基因知识库</view> enable-play-gesture
</view> enable-progress-gesture
<view class="options"> show-center-play-btn="{{false}}"
<view class="o-item"> controls="{{false}}"
<image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image> ></video>
<view class="num">12</view> <view class="swiper-item-footer">
</view> <view class="title">{{item.Title}}{{item.Id}}</view>
<view class="o-item"> <view class="container">
<image class="icon" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image> <view class="user">
<view class="num">12</view> <image class="avatar" src="/images/logo1.png"></image>
<view class="name">基因知识库</view>
</view>
<view class="options">
<button class="o-item" open-type="share">
<image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image>
<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">{{item.LikeTimes}}</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </swiper-item>
</view> </swiper>
</view> </view>

4
src/pages/login/index.json

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

42
src/pages/login/index.scss

@ -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 @@
const _app = getApp<IAppOption>()
Page({
data: {},
onLoad() {},
handlePhone(e) {
console.log(e)
},
})
export {}

7
src/pages/login/index.wxml

@ -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({
url, url,
}) })
}, },
handleNone() {
this.setData({
popupShow: true,
popupType: 'stayTuned',
})
},
}) })
export {} export {}

24
src/pages/my/index.wxml

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

4
src/pages/start/index.json

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

4
src/pages/start/index.scss

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

14
src/pages/start/index.ts

@ -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 @@
<image src="{{imageUrl}}start.png?t={{Timestamp}}" mode="aspectFill" class="page"></image>

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

@ -3,7 +3,7 @@
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg1.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;" 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> <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">
<view class="form-row"> <view class="form-row">
<view class="title">怎么称呼您</view> <view class="title">怎么称呼您</view>

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

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

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

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

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

@ -3,7 +3,7 @@
style="padding-top: {{pageTop + 60}}px;background:url('{{imageUrl}}bg3.png?t={{Timestamp}}') no-repeat top center/100% 976rpx;" 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> <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> <button class="phone" open-type="getPhoneNumber">手机号一键登录</button>
<view class="divider"> <view class="divider">
<van-divider contentPosition="center">或者</van-divider> <van-divider contentPosition="center">或者</van-divider>

Loading…
Cancel
Save