askbot-dragon 1.5.18 → 1.5.21-beta
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.
|
@@ -3,39 +3,48 @@
|
|
|
3
3
|
<div class="ticketMessage">
|
|
4
4
|
<ticket-swiper ref="swiper" :content="content" :type="type" @touchEnd="touchEnd">
|
|
5
5
|
<template>
|
|
6
|
-
<ticket-swiper-item
|
|
7
|
-
v-for="(item,_index) in content.cards"
|
|
8
|
-
:key="_index"
|
|
9
|
-
:content="content"
|
|
10
|
-
>
|
|
6
|
+
<ticket-swiper-item v-for="(item, _index) in formatContent(content.cards)" :key="_index" :content="content">
|
|
11
7
|
<template>
|
|
12
8
|
<div class="ticketMessageContain">
|
|
13
|
-
<div :class="{isPhoneClass:isPhone===true,isCompayClass:isCompany===true}">
|
|
14
|
-
<div :class="{isIosClass:isIos===true,isAndroidClass:isAndroid===true}">
|
|
9
|
+
<div :class="{ isPhoneClass: isPhone === true, isCompayClass: isCompany === true }">
|
|
10
|
+
<div :class="{ isIosClass: isIos === true, isAndroidClass: isAndroid === true }">
|
|
15
11
|
<div class="htmlClass">
|
|
16
|
-
<div v-for="(items,ind) in item.content.htmlList"
|
|
17
|
-
|
|
18
|
-
class="html-item"
|
|
19
|
-
>
|
|
20
|
-
<div class="img" v-if="items.type==='IMAGE'">
|
|
12
|
+
<div v-for="(items, ind) in item.content.htmlList" :key="'Out_' + ind" class="html-item">
|
|
13
|
+
<div class="img" v-if="items.type === 'IMAGE'">
|
|
21
14
|
<img :src="items.src">
|
|
22
15
|
</div>
|
|
23
|
-
<div class="singleClass" v-
|
|
24
|
-
<div v-html="itemss" class="singleItem"
|
|
16
|
+
<div class="singleClass" v-if="items.type === 'SINGLE'">
|
|
17
|
+
<div v-html="itemss" class="singleItem" v-for="(itemss, inde) in items.list" :key="'s_' + inde">
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="doubleClass" v-if="items.type === 'DOUBLE' && item.version != 1">
|
|
21
|
+
<div class="doubleItem" v-for="(itemss, index) in items.list" :key="'__' + index"
|
|
22
|
+
v-html="itemss">
|
|
23
|
+
</div>
|
|
25
24
|
</div>
|
|
26
|
-
<div class="
|
|
27
|
-
<div
|
|
25
|
+
<div class="updateDoubleClass" v-if="items.type === 'DOUBLE' && item.version == 1">
|
|
26
|
+
<div class="doubleItem" :style="{ 'width': itemss.style.col / itemss.style.colums * 100 + '%' }"
|
|
27
|
+
v-for="(itemss, index) in items.tampList" :key="'__D' + index" v-html="itemss.html">
|
|
28
28
|
</div>
|
|
29
|
+
<!-- <div class="doubleItem" v-for="(itemss,index) in items.tampList" :key="'__'+index">
|
|
30
|
+
{{itemss.style.col/itemss.style.colums*100}}{{itemss.html}}
|
|
31
|
+
</div> -->
|
|
29
32
|
</div>
|
|
30
|
-
<div class="tripleClass" v-
|
|
31
|
-
<div v-html="itemss" class="tripleItem" v-for="(itemss,index) in items.list"
|
|
33
|
+
<div class="tripleClass" v-if="items.type === 'TRIPLE'">
|
|
34
|
+
<div v-html="itemss" class="tripleItem" v-for="(itemss, index) in items.list"
|
|
35
|
+
:key="'__t_' + index">
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="quadrupleClass" v-if="items.type === 'QUADRUPLE'">
|
|
39
|
+
<div v-html="itemss" class="quadrupleItem" v-for="(itemss, index) in items.list"
|
|
40
|
+
:key="'_q__' + index"></div>
|
|
32
41
|
</div>
|
|
33
42
|
</div>
|
|
34
43
|
</div>
|
|
35
44
|
<div class="button-list">
|
|
36
|
-
<div v-for="(items,index) in item.content.buttonList" :key="'____'+index" class="button-item">
|
|
45
|
+
<div v-for="(items, index) in item.content.buttonList" :key="'____' + index" class="button-item">
|
|
37
46
|
<div @click="btnClick(items)" class="buttonClassItem">
|
|
38
|
-
<span class="btn-name">{{items.name}}</span>
|
|
47
|
+
<span class="btn-name">{{ items.name }}</span>
|
|
39
48
|
</div>
|
|
40
49
|
</div>
|
|
41
50
|
</div>
|
|
@@ -50,129 +59,144 @@
|
|
|
50
59
|
</div>
|
|
51
60
|
</template>
|
|
52
61
|
<script>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.$refs.swiper.slideOn();
|
|
124
|
-
},
|
|
125
|
-
btnClick(items){
|
|
126
|
-
items.apiKey=this.content.apiKey
|
|
127
|
-
let that = this;
|
|
128
|
-
if (that.onoff) {
|
|
129
|
-
that.onoff = false;
|
|
130
|
-
console.debug('card_template',items)
|
|
131
|
-
this.$emit('btnClick',items,this.content.apiKey)
|
|
132
|
-
setTimeout(function () {
|
|
133
|
-
that.onoff = true;
|
|
134
|
-
}, 600)
|
|
135
|
-
} else {
|
|
136
|
-
//如果一直走else分支可能是你没有在页面的data下面挂载onoff:true,不然一直都会走else
|
|
137
|
-
console.debug("请稍后点击")
|
|
62
|
+
import ticketSwiper from "./swiper/ticketSwiper";
|
|
63
|
+
import ticketSwiperItem from "./swiper/ticketSwiperItem";
|
|
64
|
+
export default {
|
|
65
|
+
name: "TicketMessage",
|
|
66
|
+
props: {
|
|
67
|
+
content: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default() {
|
|
70
|
+
return {}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
type: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: ''
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
components: {
|
|
79
|
+
ticketSwiperItem,
|
|
80
|
+
ticketSwiper
|
|
81
|
+
},
|
|
82
|
+
data() {
|
|
83
|
+
return {
|
|
84
|
+
device: 'PC',
|
|
85
|
+
slideWidth: '',
|
|
86
|
+
swiperStyle: {},
|
|
87
|
+
currIndex: 1,
|
|
88
|
+
distance: 0,
|
|
89
|
+
isAndroid: false,
|
|
90
|
+
isIos: false,
|
|
91
|
+
isPhone: false,
|
|
92
|
+
isCompany: false,
|
|
93
|
+
swiper: false,
|
|
94
|
+
text: [],
|
|
95
|
+
textarea: [],
|
|
96
|
+
onoff: true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
created() {
|
|
100
|
+
this.isIosOrIsAndroid()
|
|
101
|
+
this.isMobile()
|
|
102
|
+
},
|
|
103
|
+
mounted() {
|
|
104
|
+
// console.log(JSON.stringify(this.content.cards));
|
|
105
|
+
// this.content.cards.forEach(element => {
|
|
106
|
+
// if (element.version == 1) {
|
|
107
|
+
// element.content.htmlList.forEach((item) => {
|
|
108
|
+
// item.tampList = [];
|
|
109
|
+
// item.list.forEach((cell, cellIndex) => {
|
|
110
|
+
// let tampCell = {
|
|
111
|
+
// html: cell,
|
|
112
|
+
// style: item.style[cellIndex]
|
|
113
|
+
// }
|
|
114
|
+
// item.tampList.push(tampCell);
|
|
115
|
+
// })
|
|
116
|
+
// })
|
|
117
|
+
// }
|
|
118
|
+
// });
|
|
119
|
+
// this.content.cards = [...this.content.cards];
|
|
120
|
+
// console.log(this.content.cards);
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
formatContent(arr) {
|
|
124
|
+
arr.forEach(element => {
|
|
125
|
+
if (element.version == 1) {
|
|
126
|
+
element.content.htmlList.forEach((item) => {
|
|
127
|
+
item.tampList = [];
|
|
128
|
+
item.list.forEach((cell, cellIndex) => {
|
|
129
|
+
let tampCell = {
|
|
130
|
+
html: cell,
|
|
131
|
+
style: item.style[cellIndex]
|
|
138
132
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
133
|
+
item.tampList.push(tampCell);
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return arr;
|
|
139
|
+
},
|
|
140
|
+
SwiperImgLoad() {
|
|
141
|
+
if (!this.loadCheck) {
|
|
142
|
+
this.$emit("SwiperImgLoadEvent");
|
|
143
|
+
this.loadCheck = true;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
slideLoadOn() {
|
|
147
|
+
this.$refs.swiper.slideOn();
|
|
148
|
+
},
|
|
149
|
+
btnClick(items) {
|
|
150
|
+
items.apiKey = this.content.apiKey
|
|
151
|
+
let that = this;
|
|
152
|
+
if (that.onoff) {
|
|
153
|
+
that.onoff = false;
|
|
154
|
+
console.debug('card_template', items)
|
|
155
|
+
this.$emit('btnClick', items, this.content.apiKey)
|
|
156
|
+
setTimeout(function () {
|
|
157
|
+
that.onoff = true;
|
|
158
|
+
}, 600)
|
|
159
|
+
} else {
|
|
160
|
+
//如果一直走else分支可能是你没有在页面的data下面挂载onoff:true,不然一直都会走else
|
|
161
|
+
console.debug("请稍后点击")
|
|
162
|
+
}
|
|
163
|
+
},
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
isIosOrIsAndroid() {
|
|
166
|
+
var u = navigator.userAgent;
|
|
167
|
+
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
168
|
+
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
|
|
169
|
+
if (isAndroid) {
|
|
170
|
+
this.isAndroid = true
|
|
171
|
+
}
|
|
172
|
+
if (isiOS) {
|
|
173
|
+
this.isIos = true
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
isMobile() {
|
|
177
|
+
let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
|
|
178
|
+
if (flag) {
|
|
179
|
+
this.isPhone = true
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.isCompany = true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
touchMove() {
|
|
168
186
|
|
|
169
|
-
|
|
187
|
+
},
|
|
188
|
+
touchEnd(index) {
|
|
189
|
+
this.$emit('touchEnd', index)
|
|
170
190
|
}
|
|
191
|
+
|
|
192
|
+
},
|
|
193
|
+
}
|
|
171
194
|
</script>
|
|
172
195
|
|
|
173
196
|
<style lang="less">
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
197
|
+
@import "../../assets/less/ticketMessage";
|
|
198
|
+
|
|
199
|
+
a {
|
|
200
|
+
text-decoration: none;
|
|
177
201
|
}
|
|
178
202
|
</style>
|