xiaoe_mp_npm 1.0.22-test07 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.js +131 -131
  2. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.json +5 -5
  3. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxml +64 -64
  4. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxs +78 -78
  5. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.js +40 -40
  6. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.json +5 -5
  7. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.scss +6 -6
  8. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxml +1 -1
  9. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -50
  10. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -623
  11. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -183
  12. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -216
  13. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -3563
  14. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -2364
  15. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -209
  16. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -269
  17. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -1276
  18. package/miniprogram_dist/Task/TaskQuizPopup/index.js +225 -225
  19. package/miniprogram_dist/Task/TaskQuizPopup/index.json +7 -7
  20. package/miniprogram_dist/Task/TaskQuizPopup/index.wxml +96 -96
  21. package/miniprogram_dist/Task/taskQuizRemindPopup/index.js +74 -74
  22. package/miniprogram_dist/Task/taskQuizRemindPopup/index.json +5 -5
  23. package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxml +27 -27
  24. package/package.json +1 -1
  25. package/src/Task/TaskQuizPopup/components/quizContent/index.js +131 -131
  26. package/src/Task/TaskQuizPopup/components/quizContent/index.json +5 -5
  27. package/src/Task/TaskQuizPopup/components/quizContent/index.wxml +64 -64
  28. package/src/Task/TaskQuizPopup/components/quizContent/index.wxs +78 -78
  29. package/src/Task/TaskQuizPopup/components/quizRichText/index.js +40 -40
  30. package/src/Task/TaskQuizPopup/components/quizRichText/index.json +5 -5
  31. package/src/Task/TaskQuizPopup/components/quizRichText/index.scss +6 -6
  32. package/src/Task/TaskQuizPopup/components/quizRichText/index.wxml +1 -1
  33. package/src/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -50
  34. package/src/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -623
  35. package/src/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -183
  36. package/src/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -216
  37. package/src/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -3563
  38. package/src/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -2364
  39. package/src/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -209
  40. package/src/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -269
  41. package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -1276
  42. package/src/Task/TaskQuizPopup/index.js +225 -225
  43. package/src/Task/TaskQuizPopup/index.json +7 -7
  44. package/src/Task/TaskQuizPopup/index.wxml +96 -96
  45. package/src/Task/taskQuizRemindPopup/index.js +74 -74
  46. package/src/Task/taskQuizRemindPopup/index.json +5 -5
  47. package/src/Task/taskQuizRemindPopup/index.wxml +27 -27
@@ -1,132 +1,132 @@
1
- const computedBehavior = require('miniprogram-computed').behavior
2
- Component({
3
- behaviors: [computedBehavior],
4
-
5
- /**
6
- * 组件的属性列表
7
- */
8
- properties: {
9
- // 展示的题目内容对象
10
- questionContent: {
11
- type: Object,
12
- value: {},
13
- observer(val){
14
- // 获取正确答案和用户作答的选项
15
- if (val?.id) {
16
- // 获取富文本的内容操作
17
- // this.getRichTextContent(val)
18
- const correctAnswer = this.getAnswerMap(val, val.correct_answer)
19
- const userAnswer = this.getAnswerMap(val, val.user_answer)
20
- this.setData({
21
- correctAnswer,
22
- userAnswer
23
- })
24
- }
25
- }
26
- },
27
- // 是否是结果解析
28
- showAnalysis: {
29
- type: Boolean,
30
- value: false,
31
- },
32
- // 题目序号
33
- quizIndex: {
34
- type: Number,
35
- value: 1,
36
- },
37
- },
38
-
39
- /**
40
- * 组件的初始数据
41
- */
42
- data: {
43
- // 答案选项映射
44
- optionIndexMap: [
45
- 'A',
46
- 'B',
47
- 'C',
48
- 'D',
49
- 'E',
50
- 'F',
51
- 'G',
52
- 'H',
53
- 'I',
54
- 'J',
55
- 'K',
56
- 'L',
57
- 'M',
58
- 'N',
59
- 'O',
60
- 'P',
61
- 'Q',
62
- 'R',
63
- 'S',
64
- 'T',
65
- 'U',
66
- 'V',
67
- 'W',
68
- 'X',
69
- 'Y',
70
- 'Z',
71
- ],
72
- correctAnswer: '', // 正确答案
73
- userAnswer: '', // 用户作答选项
74
- },
75
- computed: {
76
- // 单选题/多选题/判断题才会显示答案
77
- isShowOptionList({ questionContent }) {
78
- return [0, 1, 3].includes(questionContent?.qs_type)
79
- },
80
- // 用户是否回答正确
81
- isSuccess({ questionContent }) {
82
- let correctAnswer = questionContent?.correct_answer
83
- let userAnswer = questionContent?.user_answer
84
- return (
85
- correctAnswer &&
86
- userAnswer &&
87
- userAnswer.length === correctAnswer.length &&
88
- userAnswer.every((val) => correctAnswer.includes(val))
89
- )
90
- },
91
- },
92
- /**
93
- * 组件的方法列表
94
- */
95
- methods: {
96
- // 选择答案操作
97
- clickOption(e) {
98
- // 查看解析情况下,不能选择
99
- if (this.data.showAnalysis) return
100
- this.triggerEvent('clickOption', e.currentTarget.dataset.index)
101
- },
102
- /**
103
- * 获取答案对应的结果
104
- * @param questionContent 题目内容
105
- * @param answerList 需要操作的答案列表
106
- * @returns
107
- */
108
- getAnswerMap(questionContent, answerList) {
109
- if (!this.data.showAnalysis) return ''
110
- let letters = []
111
- let temp = JSON.parse(JSON.stringify(answerList))
112
- if (typeof temp === 'number') {
113
- temp = [temp]
114
- }
115
- questionContent.options.forEach((item, index) => {
116
- if (temp.indexOf(String(item.op_id)) >= 0) {
117
- // 如果是判断题写入的是正确,错误
118
- if (questionContent.qs_type === 3) {
119
- letters.push(
120
- this.data.optionIndexMap[index] === 'A'
121
- ? '正确'
122
- : '错误'
123
- )
124
- } else {
125
- letters.push(this.data.optionIndexMap[index])
126
- }
127
- }
128
- })
129
- return letters.join(' ')
130
- },
131
- }
1
+ const computedBehavior = require('miniprogram-computed').behavior
2
+ Component({
3
+ behaviors: [computedBehavior],
4
+
5
+ /**
6
+ * 组件的属性列表
7
+ */
8
+ properties: {
9
+ // 展示的题目内容对象
10
+ questionContent: {
11
+ type: Object,
12
+ value: {},
13
+ observer(val){
14
+ // 获取正确答案和用户作答的选项
15
+ if (val?.id) {
16
+ // 获取富文本的内容操作
17
+ // this.getRichTextContent(val)
18
+ const correctAnswer = this.getAnswerMap(val, val.correct_answer)
19
+ const userAnswer = this.getAnswerMap(val, val.user_answer)
20
+ this.setData({
21
+ correctAnswer,
22
+ userAnswer
23
+ })
24
+ }
25
+ }
26
+ },
27
+ // 是否是结果解析
28
+ showAnalysis: {
29
+ type: Boolean,
30
+ value: false,
31
+ },
32
+ // 题目序号
33
+ quizIndex: {
34
+ type: Number,
35
+ value: 1,
36
+ },
37
+ },
38
+
39
+ /**
40
+ * 组件的初始数据
41
+ */
42
+ data: {
43
+ // 答案选项映射
44
+ optionIndexMap: [
45
+ 'A',
46
+ 'B',
47
+ 'C',
48
+ 'D',
49
+ 'E',
50
+ 'F',
51
+ 'G',
52
+ 'H',
53
+ 'I',
54
+ 'J',
55
+ 'K',
56
+ 'L',
57
+ 'M',
58
+ 'N',
59
+ 'O',
60
+ 'P',
61
+ 'Q',
62
+ 'R',
63
+ 'S',
64
+ 'T',
65
+ 'U',
66
+ 'V',
67
+ 'W',
68
+ 'X',
69
+ 'Y',
70
+ 'Z',
71
+ ],
72
+ correctAnswer: '', // 正确答案
73
+ userAnswer: '', // 用户作答选项
74
+ },
75
+ computed: {
76
+ // 单选题/多选题/判断题才会显示答案
77
+ isShowOptionList({ questionContent }) {
78
+ return [0, 1, 3].includes(questionContent?.qs_type)
79
+ },
80
+ // 用户是否回答正确
81
+ isSuccess({ questionContent }) {
82
+ let correctAnswer = questionContent?.correct_answer
83
+ let userAnswer = questionContent?.user_answer
84
+ return (
85
+ correctAnswer &&
86
+ userAnswer &&
87
+ userAnswer.length === correctAnswer.length &&
88
+ userAnswer.every((val) => correctAnswer.includes(val))
89
+ )
90
+ },
91
+ },
92
+ /**
93
+ * 组件的方法列表
94
+ */
95
+ methods: {
96
+ // 选择答案操作
97
+ clickOption(e) {
98
+ // 查看解析情况下,不能选择
99
+ if (this.data.showAnalysis) return
100
+ this.triggerEvent('clickOption', e.currentTarget.dataset.index)
101
+ },
102
+ /**
103
+ * 获取答案对应的结果
104
+ * @param questionContent 题目内容
105
+ * @param answerList 需要操作的答案列表
106
+ * @returns
107
+ */
108
+ getAnswerMap(questionContent, answerList) {
109
+ if (!this.data.showAnalysis) return ''
110
+ let letters = []
111
+ let temp = JSON.parse(JSON.stringify(answerList))
112
+ if (typeof temp === 'number') {
113
+ temp = [temp]
114
+ }
115
+ questionContent.options.forEach((item, index) => {
116
+ if (temp.indexOf(String(item.op_id)) >= 0) {
117
+ // 如果是判断题写入的是正确,错误
118
+ if (questionContent.qs_type === 3) {
119
+ letters.push(
120
+ this.data.optionIndexMap[index] === 'A'
121
+ ? '正确'
122
+ : '错误'
123
+ )
124
+ } else {
125
+ letters.push(this.data.optionIndexMap[index])
126
+ }
127
+ }
128
+ })
129
+ return letters.join(' ')
130
+ },
131
+ }
132
132
  })
@@ -1,6 +1,6 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "quizRichText": "../quizRichText/index"
5
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "quizRichText": "../quizRichText/index"
5
+ }
6
6
  }
@@ -1,65 +1,65 @@
1
- <wxs src="./index.wxs" module="quizTools" />
2
- <view
3
- wx:if="{{ questionContent }}"
4
- class="question-cover {{ showAnalysis && 'card-margin-bottom' }}"
5
- >
6
- <!-- 题目类型 -->
7
- <view class="question-type">{{ quizTools.typeText(questionContent.qs_type) }}</view>
8
- <!-- 题目 -->
9
- <view class="question-content-cover">
10
- <view class="question-order">{{ quizIndex }}.</view>
11
- <quizRichText wx:if="{{ questionContent.qs_content }}" richTextContent="{{ questionContent.qs_content }}" />
12
- </view>
13
- <!-- 选项 -->
14
- <view class="question-option-list">
15
- <view
16
- class="question-option"
17
- wx:for="{{ questionContent.options }}"
18
- >
19
- <!-- 单选题/多选题/判断题 -->
20
- <block wx:if="{{ isShowOptionList }}">
21
- <view class="img-cover" data-index="{{ index }}" catchtap="clickOption">
22
- <image
23
- src="{{ quizTools.getChoiceIcon(item, questionContent.qs_type, questionContent.correct_answer, questionContent.user_answer, showAnalysis) }}"
24
- class="check-icon"
25
- />
26
- </view>
27
- <!-- 判断题答案选项无需使用富文本 -->
28
- <block wx:if="{{ questionContent.qs_type === 3 }}">
29
- <view class="judge-item" data-index="{{ index }}" catchtap="clickOption">
30
- {{ item.op_content }}
31
- </view>
32
- </block>
33
- <!-- 单选题/多选题答案选项使用富文本 -->
34
- <block wx:else>
35
- <view class="index">{{ optionIndexMap[index] }}.</view>
36
- <view class="title" data-index="{{ index }}" catchtap="clickOption">
37
- <quizRichText wx:if="{{ item.op_content }}" richTextContent="{{ item.op_content }}" />
38
- </view>
39
- </block>
40
- </block>
41
- </view>
42
- </view>
43
- <!-- 解析 -->
44
- <view class="question-analysis" wx:if="{{ showAnalysis }}">
45
- <view class="question-analysis-top-part">
46
- <view class="question-result {{ isSuccess && 'right-color' }}">
47
- {{ isSuccess ? '回答正确' : '回答错误' }}
48
- </view>
49
- <view class="question-answer-box">
50
- <view class="question-answer">
51
- 正确答案:{{ correctAnswer }}
52
- </view>
53
- <view class="question-answer">
54
- 我的答案:{{ userAnswer }}
55
- </view>
56
- </view>
57
- </view>
58
- <view class="question-tip" wx:if="{{ questionContent.qs_analysis }}">
59
- 解析
60
- </view>
61
- <view class="question-analysis-content">
62
- <quizRichText wx:if="{{ questionContent.qs_analysis }}" richTextContent="{{ questionContent.qs_analysis }}" />
63
- </view>
64
- </view>
1
+ <wxs src="./index.wxs" module="quizTools" />
2
+ <view
3
+ wx:if="{{ questionContent }}"
4
+ class="question-cover {{ showAnalysis && 'card-margin-bottom' }}"
5
+ >
6
+ <!-- 题目类型 -->
7
+ <view class="question-type">{{ quizTools.typeText(questionContent.qs_type) }}</view>
8
+ <!-- 题目 -->
9
+ <view class="question-content-cover">
10
+ <view class="question-order">{{ quizIndex }}.</view>
11
+ <quizRichText wx:if="{{ questionContent.qs_content }}" richTextContent="{{ questionContent.qs_content }}" />
12
+ </view>
13
+ <!-- 选项 -->
14
+ <view class="question-option-list">
15
+ <view
16
+ class="question-option"
17
+ wx:for="{{ questionContent.options }}"
18
+ >
19
+ <!-- 单选题/多选题/判断题 -->
20
+ <block wx:if="{{ isShowOptionList }}">
21
+ <view class="img-cover" data-index="{{ index }}" catchtap="clickOption">
22
+ <image
23
+ src="{{ quizTools.getChoiceIcon(item, questionContent.qs_type, questionContent.correct_answer, questionContent.user_answer, showAnalysis) }}"
24
+ class="check-icon"
25
+ />
26
+ </view>
27
+ <!-- 判断题答案选项无需使用富文本 -->
28
+ <block wx:if="{{ questionContent.qs_type === 3 }}">
29
+ <view class="judge-item" data-index="{{ index }}" catchtap="clickOption">
30
+ {{ item.op_content }}
31
+ </view>
32
+ </block>
33
+ <!-- 单选题/多选题答案选项使用富文本 -->
34
+ <block wx:else>
35
+ <view class="index">{{ optionIndexMap[index] }}.</view>
36
+ <view class="title" data-index="{{ index }}" catchtap="clickOption">
37
+ <quizRichText wx:if="{{ item.op_content }}" richTextContent="{{ item.op_content }}" />
38
+ </view>
39
+ </block>
40
+ </block>
41
+ </view>
42
+ </view>
43
+ <!-- 解析 -->
44
+ <view class="question-analysis" wx:if="{{ showAnalysis }}">
45
+ <view class="question-analysis-top-part">
46
+ <view class="question-result {{ isSuccess && 'right-color' }}">
47
+ {{ isSuccess ? '回答正确' : '回答错误' }}
48
+ </view>
49
+ <view class="question-answer-box">
50
+ <view class="question-answer">
51
+ 正确答案:{{ correctAnswer }}
52
+ </view>
53
+ <view class="question-answer">
54
+ 我的答案:{{ userAnswer }}
55
+ </view>
56
+ </view>
57
+ </view>
58
+ <view class="question-tip" wx:if="{{ questionContent.qs_analysis }}">
59
+ 解析
60
+ </view>
61
+ <view class="question-analysis-content">
62
+ <quizRichText wx:if="{{ questionContent.qs_analysis }}" richTextContent="{{ questionContent.qs_analysis }}" />
63
+ </view>
64
+ </view>
65
65
  </view>
@@ -1,79 +1,79 @@
1
-
2
- // 题目类型
3
- var typeText = function(type) {
4
- var text = '';
5
- switch (type) {
6
- // 单选
7
- case 0:
8
- text = '单选题';
9
- break;
10
- // 多选
11
- case 1:
12
- text = '多选题';
13
- break;
14
- // 判断
15
- case 3:
16
- text = '判断题';
17
- break;
18
- default:
19
- break;
20
- }
21
- return text;
22
- }
23
-
24
-
25
- /**
26
- * 获取展示的勾选icon
27
- * @param item 当前选项的item
28
- * @param type 题目类型,单选/多选/判断
29
- * @param correct_answer 正确的答案
30
- * @param user_answer 用户选择的答案
31
- * @param showAnalysis 是否是展示题目解析情况
32
- * @returns
33
- */
34
- var getChoiceIcon = function (item, type, correct_answer, user_answer, showAnalysis) {
35
- var judgeAnswer = function(item) {
36
- if (!showAnalysis) return '';
37
- var correctAnswer = correct_answer;
38
- var userAnswer = user_answer;
39
- var type = '';
40
- // 选项是否在用户选择内
41
- for (var i = 0; i < userAnswer.length; i++) {
42
- if (userAnswer[i] === item.op_id) {
43
- // 判断答案正确与否
44
- for (var index = 0; index < correctAnswer.length; index++) {
45
- if (correctAnswer[index] === item.op_id) {
46
- type = 'right';
47
- break
48
- } else {
49
- type = 'wrong';
50
- }
51
- }
52
- break
53
- }
54
- }
55
- return type;
56
- }
57
- var iconSrc = '';
58
- // 区别多选和单选、判断
59
- if (item.selected) {
60
- // 选中状态
61
- iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr12yki0h1u.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr114sn0g54.svg';
62
- } else if (judgeAnswer(item) === 'right') {
63
- // 正确状态
64
- iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyki0skx.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykn0iix.svg';
65
- } else if (judgeAnswer(item) === 'wrong') {
66
- // 错误状态
67
- iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykm0zhs.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyko0tts.svg';
68
- } else {
69
- // 空状态
70
- iconSrc =
71
- type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0ve6b0ezt.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0mnyy0uwf.svg';
72
- }
73
- return iconSrc;
74
- };
75
-
76
- module.exports = {
77
- typeText:typeText,
78
- getChoiceIcon:getChoiceIcon
1
+
2
+ // 题目类型
3
+ var typeText = function(type) {
4
+ var text = '';
5
+ switch (type) {
6
+ // 单选
7
+ case 0:
8
+ text = '单选题';
9
+ break;
10
+ // 多选
11
+ case 1:
12
+ text = '多选题';
13
+ break;
14
+ // 判断
15
+ case 3:
16
+ text = '判断题';
17
+ break;
18
+ default:
19
+ break;
20
+ }
21
+ return text;
22
+ }
23
+
24
+
25
+ /**
26
+ * 获取展示的勾选icon
27
+ * @param item 当前选项的item
28
+ * @param type 题目类型,单选/多选/判断
29
+ * @param correct_answer 正确的答案
30
+ * @param user_answer 用户选择的答案
31
+ * @param showAnalysis 是否是展示题目解析情况
32
+ * @returns
33
+ */
34
+ var getChoiceIcon = function (item, type, correct_answer, user_answer, showAnalysis) {
35
+ var judgeAnswer = function(item) {
36
+ if (!showAnalysis) return '';
37
+ var correctAnswer = correct_answer;
38
+ var userAnswer = user_answer;
39
+ var type = '';
40
+ // 选项是否在用户选择内
41
+ for (var i = 0; i < userAnswer.length; i++) {
42
+ if (userAnswer[i] === item.op_id) {
43
+ // 判断答案正确与否
44
+ for (var index = 0; index < correctAnswer.length; index++) {
45
+ if (correctAnswer[index] === item.op_id) {
46
+ type = 'right';
47
+ break
48
+ } else {
49
+ type = 'wrong';
50
+ }
51
+ }
52
+ break
53
+ }
54
+ }
55
+ return type;
56
+ }
57
+ var iconSrc = '';
58
+ // 区别多选和单选、判断
59
+ if (item.selected) {
60
+ // 选中状态
61
+ iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr12yki0h1u.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr114sn0g54.svg';
62
+ } else if (judgeAnswer(item) === 'right') {
63
+ // 正确状态
64
+ iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyki0skx.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykn0iix.svg';
65
+ } else if (judgeAnswer(item) === 'wrong') {
66
+ // 错误状态
67
+ iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykm0zhs.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyko0tts.svg';
68
+ } else {
69
+ // 空状态
70
+ iconSrc =
71
+ type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0ve6b0ezt.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0mnyy0uwf.svg';
72
+ }
73
+ return iconSrc;
74
+ };
75
+
76
+ module.exports = {
77
+ typeText:typeText,
78
+ getChoiceIcon:getChoiceIcon
79
79
  }
@@ -1,40 +1,40 @@
1
- import WxParse from '../wxParse/wxParse'
2
- Component({
3
- /**
4
- * 组件的属性列表
5
- */
6
- properties: {
7
- // 展示的内容对象
8
- richTextContent: {
9
- type: String,
10
- value: '',
11
- observer(val) {
12
- // 获取富文本的内容操作
13
- if (val) this.getRichTextContent(val)
14
- },
15
- },
16
- },
17
-
18
- /**
19
- * 组件的初始数据
20
- */
21
- data: {},
22
-
23
- /**
24
- * 组件的方法列表
25
- */
26
- methods: {
27
- // 获取富文本的内容
28
- getRichTextContent(richContent) {
29
- WxParse.wxParse('richContent', 'html', richContent, this)
30
- },
31
- imageInit(e) {
32
- WxParse.imageLoad(e, this).then(() => {
33
- // 不知道为啥不响应渲染,所以这里重新setdata一次
34
- this.setData({
35
- richContent: this.data.richContent,
36
- })
37
- })
38
- },
39
- },
40
- })
1
+ import WxParse from '../wxParse/wxParse'
2
+ Component({
3
+ /**
4
+ * 组件的属性列表
5
+ */
6
+ properties: {
7
+ // 展示的内容对象
8
+ richTextContent: {
9
+ type: String,
10
+ value: '',
11
+ observer(val) {
12
+ // 获取富文本的内容操作
13
+ if (val) this.getRichTextContent(val)
14
+ },
15
+ },
16
+ },
17
+
18
+ /**
19
+ * 组件的初始数据
20
+ */
21
+ data: {},
22
+
23
+ /**
24
+ * 组件的方法列表
25
+ */
26
+ methods: {
27
+ // 获取富文本的内容
28
+ getRichTextContent(richContent) {
29
+ WxParse.wxParse('richContent', 'html', richContent, this)
30
+ },
31
+ imageInit(e) {
32
+ WxParse.imageLoad(e, this).then(() => {
33
+ // 不知道为啥不响应渲染,所以这里重新setdata一次
34
+ this.setData({
35
+ richContent: this.data.richContent,
36
+ })
37
+ })
38
+ },
39
+ },
40
+ })
@@ -1,6 +1,6 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "audio-player": "../../../../components/audio_player/index"
5
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "audio-player": "../../../../components/audio_player/index"
5
+ }
6
6
  }