Browse Source

bug处理

master
kola-web 2 days ago
parent
commit
7469c70e19
  1. 14
      src/api/request.ts
  2. 24
      src/app.ts
  3. 8
      src/components/popup/index.ts
  4. 4
      src/components/popup/index.wxml
  5. 4
      src/doc/pages/doc1/index.json
  6. 3
      src/doc/pages/doc1/index.scss
  7. 4
      src/doc/pages/doc1/index.ts
  8. 5
      src/doc/pages/doc1/index.wxml
  9. 10
      src/pages/applyFrom/index.ts
  10. 7
      src/pages/applyFrom/index.wxml
  11. 7
      src/pages/applyFromResult/index.scss
  12. 5
      src/pages/ask/index.scss
  13. 6
      src/pages/ask/index.ts
  14. 16
      src/pages/ask/index.wxml
  15. 11
      src/pages/index/index.scss
  16. 22
      src/pages/index/index.ts
  17. 13
      src/pages/index/index.wxml
  18. 13
      src/pages/knowledgeDetailVideo/index.ts
  19. 6
      src/pages/knowledgeDetailVideo/index.wxml
  20. 2
      src/pages/my/index.ts
  21. 1
      typings/index.d.ts

14
src/api/request.ts

@ -5,12 +5,22 @@ interface IGlobalParams { @@ -5,12 +5,22 @@ interface IGlobalParams {
export const request = function (
{ gUrl, version }: IGlobalParams,
{ url, method, data, header, showMsg = true, loading = false, isJSON = false, ...options }: IAgaxParams,
{
url,
method,
data,
header,
showMsg = true,
loading = false,
loadingText = '加载中...',
isJSON = false,
...options
}: IAgaxParams,
): Promise<any> {
return new Promise((resolve, reject) => {
if (loading) {
wx.showLoading({
title: '加载中...',
title: loadingText,
mask: true,
})
}

24
src/app.ts

@ -56,6 +56,7 @@ App<IAppOption>({ @@ -56,6 +56,7 @@ App<IAppOption>({
onShow(options) {
if (options.query.scene) {
this.globalData.scene = parseScene(options.query.scene) as { workerId: string }
console.log(this.globalData.scene)
}
this.startLogin()
},
@ -94,20 +95,15 @@ App<IAppOption>({ @@ -94,20 +95,15 @@ App<IAppOption>({
})
},
mpBehavior(data: { PageName: string }) {
// let url = '?r=zd/mp-behavior/add'
// if (data.doctor) {
// url = '?r=zd/doctor/mp-behavior/add'
// }
// delete data.doctor
// wx.ajax({
// method: 'POST',
// url,
// data: data,
// loading: false,
// showMsg: false,
// }).then((res) => {
// console.log('res: ', res)
// })
wx.ajax({
method: 'POST',
url: '?r=wtx/mp-behavior/add',
data: data,
loading: false,
showMsg: false,
}).then((res) => {
console.log('res: ', res)
})
},
getUserInfo() {

8
src/components/popup/index.ts

@ -19,7 +19,7 @@ Component({ @@ -19,7 +19,7 @@ Component({
popup1Check1: false,
imageUrl: app.globalData.imageUrl,
Timestamp:app.globalData.Timestamp
Timestamp: app.globalData.Timestamp,
},
methods: {
handleOk() {
@ -36,5 +36,11 @@ Component({ @@ -36,5 +36,11 @@ Component({
handleCancel() {
this.triggerEvent('cancel')
},
routerTo(e: any) {
const { url } = e.currentTarget.dataset
wx.navigateTo({
url,
})
},
},
})

4
src/components/popup/index.wxml

@ -11,14 +11,14 @@ @@ -11,14 +11,14 @@
<view class="title">欢迎加入“愈见守护”</view>
<view class="content">
亲爱的用户,为了更好地向您提供平台服务保护您的权益,我们完善了
<text class="link">《个人信息及隐私政策》</text>
<text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text>
,请您仔细阅读。一旦您开始使用,即表示您已充分理解并同意协议内容。
</view>
<view class="check">
<checkbox class="checkbox" model:checked="{{popup1Check1}}" color="#f23a2f"></checkbox>
<view class="c-content">
我特此同意
<text class="link">《个人信息及隐私政策》</text>
<text class="link" bind:tap="routerTo" data-url="/doc/pages/doc1/index">《个人信息及隐私政策》</text>
规定收集我的相关敏感个人信息
</view>
</view>

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

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"mp-html": "mp-html"
}
}

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

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
.page{
padding: 0 40rpx;
}

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

File diff suppressed because one or more lines are too long

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

@ -1,2 +1,3 @@ @@ -1,2 +1,3 @@
<!--pages/story/index.wxml-->
<text>pages/story/index.wxml</text>
<view class="page">
<mp-html content="{{doc}}"></mp-html>
</view>

10
src/pages/applyFrom/index.ts

@ -87,6 +87,11 @@ Page({ @@ -87,6 +87,11 @@ Page({
})
})
},
handleToggleArgument() {
this.setData({
Argument: !this.data.Argument,
})
},
handleSubmit() {
app.mpBehavior({ PageName: 'BTN_PREAPPLY_SUBMIT' })
const { Id, UserName, Relation, BirthMonth, ProvinceId, CityId, Telephone, Remark, Argument } = this.data
@ -106,9 +111,6 @@ Page({ @@ -106,9 +111,6 @@ Page({
if (!Relation) {
toast = '请选择您的身份'
}
if (!Argument) {
toast = '请先阅读并同意《服务隐私政策》'
}
if (toast) {
wx.showToast({
title: toast,
@ -131,6 +133,8 @@ Page({ @@ -131,6 +133,8 @@ Page({
Telephone,
Remark,
},
loading: true,
loadingText: '提交中...',
}).then(() => {
wx.navigateTo({
url: '/pages/applyFromResult/index',

7
src/pages/applyFrom/index.wxml

@ -75,13 +75,6 @@ @@ -75,13 +75,6 @@
</view>
</view>
</view>
<view class="argument">
<radio class="radio" model:checked="{{Argument}}" color="#e73e37"></radio>
<view class="content">
我已阅读并同意
<text class="link">《服务隐私政策》</text>
</view>
</view>
<view class="footer">
<button open-type="share" class="share">
<image class="icon" src="{{imageUrl}}icon4.png?t={{Timestamp}}"></image>

7
src/pages/applyFromResult/index.scss

@ -2,7 +2,12 @@ page { @@ -2,7 +2,12 @@ page {
background-color: rgba(246, 246, 249, 1);
}
.page {
background: linear-gradient(172deg, #ffa340 0%, #ffdcdd 56%, #fafafa 100%) no-repeat top center/100% 726rpx;
background: linear-gradient(
157.22deg,
rgba(255, 163, 64, 0.8) -4.33%,
rgba(255, 220, 221, 0.8) 10.61%,
rgba(255, 255, 255, 0) 85.21%
);
.container {
position: relative;
margin: 272rpx 40rpx 0;

5
src/pages/ask/index.scss

@ -145,7 +145,7 @@ page { @@ -145,7 +145,7 @@ page {
.message {
margin-bottom: 32rpx;
padding: 26rpx 32rpx;
background: #fff linear-gradient(to top, #ffffff 0%, #ffcdca 100%) no-repeat top center/ 100% 200rpx;
background: linear-gradient(13deg, #FFFFFF 58.17%, #FFCDCA 156.6%);
border-radius: 32rpx;
font-size: 32rpx;
color: rgba(1, 1, 5, 1);
@ -471,12 +471,15 @@ page { @@ -471,12 +471,15 @@ page {
display: flex;
align-items: center;
justify-content: center;
gap: 10rpx;
font-weight: bold;
.icon {
width: 36rpx;
height: 36rpx;
}
}
.tabs {
margin-top: 12rpx;
padding: 24rpx 0;
display: flex;
align-items: center;

6
src/pages/ask/index.ts

@ -15,6 +15,8 @@ interface IMessageItem { @@ -15,6 +15,8 @@ interface IMessageItem {
questionId?: string // 问题ID
Reference?: string // 参考资料
LikeTimes?: number // 点赞次数
IsLike?: boolean // 是否点赞
HasAnswer?: boolean // 是否有答案
}
Page({
@ -44,7 +46,7 @@ Page({ @@ -44,7 +46,7 @@ Page({
},
onLoad(options) {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_FAQ' })
app.mpBehavior({ PageName: 'PG_FAQ' })
app.getUserInfo().then((userInfo) => {
this.setData({
userInfo,
@ -145,6 +147,8 @@ Page({ @@ -145,6 +147,8 @@ Page({
questionId: questionItem.Id,
Reference: questionItem.Reference,
LikeTimes: questionItem.LikeTimes,
IsLike: questionItem.IsLike,
HasAnswer: questionItem.HasAnswer,
msgVisitTime: '',
msgFromType: '2',
msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),

16
src/pages/ask/index.wxml

@ -14,14 +14,22 @@ @@ -14,14 +14,22 @@
scroll-with-animation
bindscrolltoupper="scrolltoupper"
>
<view class="first-ask">
<view class="first-ask" wx:if="{{headerQuestionList.length}}">
<view class="f-header">
<image class="avatar" src="{{imageUrl}}avatar1.png?t={{Timestamp}}"></image>
<view class="content">您好,我是您的健康小助手</view>
</view>
<view class="f-list">
<view class="content">关于血友病B 的基因治疗相关的问题,您关心哪些?我可以为您解答哦~</view>
<view class="l-item" wx:for="{{headerQuestionList}}" wx:key="Id" bind:tap="handleHeaderQuestion" data-index="{{index}}">{{item.Question}}</view>
<view
class="l-item"
wx:for="{{headerQuestionList}}"
wx:key="Id"
bind:tap="handleHeaderQuestion"
data-index="{{index}}"
>
{{item.Question}}
</view>
</view>
</view>
<view wx:for="{{messageList}}" wx:key="msgId" wx:for-item="message" wx:for-index="mIndex" id="view{{mIndex}}">
@ -53,9 +61,9 @@ @@ -53,9 +61,9 @@
</view>
</view>
<view class="message" wx:elif="{{message.msgContentType==='1'}}">
<view>{{message.msgContent || '您的问题我收到啦!我会继续努力,尽快帮您找到答案的~'}}</view>
<view>{{message.msgContent }}</view>
<view class="reference" wx:if="{{message.Reference}}">{{message.Reference}}</view>
<view class="m-footer" bind:tap="handleLike" data-index="{{mIndex}}">
<view class="m-footer" wx:if="{{message.HasAnswer}}" bind:tap="handleLike" data-index="{{mIndex}}">
<image wx:if="{{message.IsLike}}" class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
<image wx:else class="icon" src="{{imageUrl}}icon10.png?t={{Timestamp}}"></image>
<view class="num {{detail.IsLike && 'active'}}" wx:if="{{message.LikeTimes>0}}">

11
src/pages/index/index.scss

@ -68,6 +68,7 @@ @@ -68,6 +68,7 @@
}
.module-list {
margin: 24rpx -40rpx 0;
padding-right: 40rpx;
padding-left: 40rpx;
display: flex;
gap: 24rpx;
@ -130,6 +131,7 @@ @@ -130,6 +131,7 @@
.module-list {
margin: 24rpx -40rpx 0;
padding-left: 40rpx;
padding-right: 40rpx;
display: flex;
gap: 24rpx;
flex-wrap: nowrap;
@ -185,15 +187,20 @@ @@ -185,15 +187,20 @@
justify-content: flex-end;
margin-top: 24rpx;
.star {
font-size: 24rpx;
color: #f23a2f;
display: flex;
align-items: center;
line-height: 1;
gap: 5rpx;
.icon {
flex-shrink: 0;
width: 28rpx;
height: 28rpx;
}
.num {
padding-top: 5rpx;
font-size: 24rpx;
color: #f23a2f;
}
}
}
}

22
src/pages/index/index.ts

@ -90,14 +90,25 @@ Page({ @@ -90,14 +90,25 @@ Page({
url: `/pages/knowledgeDetailVideo/index?id=${params.Id}`,
})
},
handleAskItem(e) {
app.mpBehavior({ PageName: 'BTN_HOMEFAQENTRY' })
const { id } = e.currentTarget.dataset
wx.navigateTo({
url: `/pages/ask/index?id=${id}`,
})
wx.ajax({
method: 'POST',
url: '?r=wtx/common-question/click',
data: { Id: id },
})
},
routerTo(e) {
const { url } = e.currentTarget.dataset
let PageName = {
const PageName = {
'/pages/applyFrom/index': 'BTN_HOMEPREAPPLYCARD',
'/pages/ask/index': 'BTN_HOMEFAQENTRY',
}[url]
if (url.includes('/pages/ask/index')) {
PageName = 'BTN_HOMEFAQENTRY'
}
if (PageName) {
app.mpBehavior({ PageName })
}
@ -112,8 +123,7 @@ Page({ @@ -112,8 +123,7 @@ Page({
method: 'POST',
url: '?r=wtx/user/agree-guest-privacy',
data: {
// TODO: 待补充
WorkerId: '',
WorkerId: app.globalData.scene?.workerId || '',
},
}).then(() => {
this.setData({

13
src/pages/index/index.wxml

@ -57,7 +57,13 @@ @@ -57,7 +57,13 @@
</view>
</view>
<view class="module-list">
<view class="module-item" wx:for="{{questionList}}" wx:key="Id" bindtap="routerTo" data-url="/pages/ask/index?id={{item.Id}}">
<view
class="module-item"
wx:for="{{questionList}}"
wx:key="Id"
bindtap="handleAskItem"
data-id="{{item.Id}}"
>
<view class="item-header">
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
<view class="title">{{item.Question}}</view>
@ -65,8 +71,9 @@ @@ -65,8 +71,9 @@
<view class="content">{{item.Answer}}</view>
<view class="item-footer">
<view class="star">
<image class="icon" src="{{imageUrl}}icon3.png?t={{Timestamp}}"></image>
{{item.LikeTimes}}
<image wx:if="{{item.IsLike}}" class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
<image wx:else class="icon" src="{{imageUrl}}icon3.png?t={{Timestamp}}"></image>
<view class="num">{{item.LikeTimes}}</view>
</view>
</view>
</view>

13
src/pages/knowledgeDetailVideo/index.ts

@ -150,15 +150,14 @@ Page({ @@ -150,15 +150,14 @@ Page({
[durationKey]: duration,
})
},
handleCustomPasue(e) {
handleTogglePlay(e) {
const { index } = e.currentTarget.dataset
const { videoList } = this.data
videoList[index].ctx.pause()
},
handleCustomPlay(e: any) {
const { index } = e.currentTarget.dataset
const { videoList } = this.data
videoList[index].ctx.play()
if (videoList[index].play) {
videoList[index].ctx.pause()
} else {
videoList[index].ctx.play()
}
},
handleDragStart(e: any) {
const { index } = e.currentTarget.dataset

6
src/pages/knowledgeDetailVideo/index.wxml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
class="video"
src="{{item.VideoSrc}}"
loop
object-fit="cover"
object-fit="contain"
enable-play-gesture
enable-progress-gesture
show-center-play-btn="{{false}}"
@ -21,14 +21,14 @@ @@ -21,14 +21,14 @@
bindpause="handlePause"
bindtimeupdate="handleTimeUpdate"
data-index="{{index}}"
bind:tap="handleCustomPasue"
bind:tap="handleTogglePlay"
></video>
<image
wx:if="{{!item.play}}"
class="play"
class="play"
src="{{imageUrl}}icon19.png?t={{Timestamp}}"
catch:tap="handleCustomPlay"
catch:tap="handleTogglePlay"
data-index="{{index}}"
></image>
<view class="swiper-item-footer">

2
src/pages/my/index.ts

@ -8,7 +8,7 @@ Page({ @@ -8,7 +8,7 @@ Page({
},
onLoad() {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_MY' })
app.mpBehavior({ PageName: 'BTN_MY_NAV' })
app.getUserInfo().then((userInfo) => {
this.setData({
userInfo,

1
typings/index.d.ts vendored

@ -58,6 +58,7 @@ interface Response<T> { @@ -58,6 +58,7 @@ interface Response<T> {
interface IAgaxParams extends WechatMiniprogram.RequestOption {
showMsg?: boolean
loading?: boolean
loadingText?: string
isJSON?: boolean
}

Loading…
Cancel
Save