Browse Source

bug处理

master
kola-web 3 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. 4
      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. 9
      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 {
export const request = function ( export const request = function (
{ gUrl, version }: IGlobalParams, { 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> { ): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (loading) { if (loading) {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: loadingText,
mask: true, mask: true,
}) })
} }

24
src/app.ts

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

8
src/components/popup/index.ts

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

4
src/components/popup/index.wxml

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

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

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

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

@ -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 @@
<!--pages/story/index.wxml--> <view class="page">
<text>pages/story/index.wxml</text> <mp-html content="{{doc}}"></mp-html>
</view>

10
src/pages/applyFrom/index.ts

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

7
src/pages/applyFrom/index.wxml

@ -75,13 +75,6 @@
</view> </view>
</view> </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"> <view class="footer">
<button open-type="share" class="share"> <button open-type="share" class="share">
<image class="icon" src="{{imageUrl}}icon4.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon4.png?t={{Timestamp}}"></image>

7
src/pages/applyFromResult/index.scss

@ -2,7 +2,12 @@ page {
background-color: rgba(246, 246, 249, 1); background-color: rgba(246, 246, 249, 1);
} }
.page { .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 { .container {
position: relative; position: relative;
margin: 272rpx 40rpx 0; margin: 272rpx 40rpx 0;

5
src/pages/ask/index.scss

@ -145,7 +145,7 @@ page {
.message { .message {
margin-bottom: 32rpx; margin-bottom: 32rpx;
padding: 26rpx 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; border-radius: 32rpx;
font-size: 32rpx; font-size: 32rpx;
color: rgba(1, 1, 5, 1); color: rgba(1, 1, 5, 1);
@ -471,12 +471,15 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 10rpx;
font-weight: bold;
.icon { .icon {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
} }
} }
.tabs { .tabs {
margin-top: 12rpx;
padding: 24rpx 0; padding: 24rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;

4
src/pages/ask/index.ts

@ -15,6 +15,8 @@ interface IMessageItem {
questionId?: string // 问题ID questionId?: string // 问题ID
Reference?: string // 参考资料 Reference?: string // 参考资料
LikeTimes?: number // 点赞次数 LikeTimes?: number // 点赞次数
IsLike?: boolean // 是否点赞
HasAnswer?: boolean // 是否有答案
} }
Page({ Page({
@ -145,6 +147,8 @@ Page({
questionId: questionItem.Id, questionId: questionItem.Id,
Reference: questionItem.Reference, Reference: questionItem.Reference,
LikeTimes: questionItem.LikeTimes, LikeTimes: questionItem.LikeTimes,
IsLike: questionItem.IsLike,
HasAnswer: questionItem.HasAnswer,
msgVisitTime: '', msgVisitTime: '',
msgFromType: '2', msgFromType: '2',
msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),

16
src/pages/ask/index.wxml

@ -14,14 +14,22 @@
scroll-with-animation scroll-with-animation
bindscrolltoupper="scrolltoupper" bindscrolltoupper="scrolltoupper"
> >
<view class="first-ask"> <view class="first-ask" wx:if="{{headerQuestionList.length}}">
<view class="f-header"> <view class="f-header">
<image class="avatar" src="{{imageUrl}}avatar1.png?t={{Timestamp}}"></image> <image class="avatar" src="{{imageUrl}}avatar1.png?t={{Timestamp}}"></image>
<view class="content">您好,我是您的健康小助手</view> <view class="content">您好,我是您的健康小助手</view>
</view> </view>
<view class="f-list"> <view class="f-list">
<view class="content">关于血友病B 的基因治疗相关的问题,您关心哪些?我可以为您解答哦~</view> <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> </view>
<view wx:for="{{messageList}}" wx:key="msgId" wx:for-item="message" wx:for-index="mIndex" id="view{{mIndex}}"> <view wx:for="{{messageList}}" wx:key="msgId" wx:for-item="message" wx:for-index="mIndex" id="view{{mIndex}}">
@ -53,9 +61,9 @@
</view> </view>
</view> </view>
<view class="message" wx:elif="{{message.msgContentType==='1'}}"> <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="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:if="{{message.IsLike}}" class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
<image wx:else class="icon" src="{{imageUrl}}icon10.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}}"> <view class="num {{detail.IsLike && 'active'}}" wx:if="{{message.LikeTimes>0}}">

11
src/pages/index/index.scss

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

22
src/pages/index/index.ts

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

13
src/pages/index/index.wxml

@ -57,7 +57,13 @@
</view> </view>
</view> </view>
<view class="module-list"> <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"> <view class="item-header">
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
<view class="title">{{item.Question}}</view> <view class="title">{{item.Question}}</view>
@ -65,8 +71,9 @@
<view class="content">{{item.Answer}}</view> <view class="content">{{item.Answer}}</view>
<view class="item-footer"> <view class="item-footer">
<view class="star"> <view class="star">
<image class="icon" src="{{imageUrl}}icon3.png?t={{Timestamp}}"></image> <image wx:if="{{item.IsLike}}" class="icon" src="{{imageUrl}}icon8.png?t={{Timestamp}}"></image>
{{item.LikeTimes}} <image wx:else class="icon" src="{{imageUrl}}icon3.png?t={{Timestamp}}"></image>
<view class="num">{{item.LikeTimes}}</view>
</view> </view>
</view> </view>
</view> </view>

9
src/pages/knowledgeDetailVideo/index.ts

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

6
src/pages/knowledgeDetailVideo/index.wxml

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

2
src/pages/my/index.ts

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

1
typings/index.d.ts vendored

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

Loading…
Cancel
Save