askbot-dragon 1.4.99 → 1.5.11-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,47 @@
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 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
- :key="ind"
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="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-else-if="items.type==='SINGLE'">
24
- <div v-html="itemss" class="singleItem" v-for="(itemss,inde) in items.list" :key="inde"></div>
16
+ <div class="singleClass" v-else-if="items.type === 'SINGLE'">
17
+ <div v-html="itemss" class="singleItem" v-for="(itemss, inde) in items.list" :key="inde"></div>
25
18
  </div>
26
- <div class="doubleClass" v-else-if="items.type==='DOUBLE'">
27
- <div class="doubleItem" v-for="(itemss,index) in items.list" :key="'__'+index" v-html="itemss">
19
+ <div class="doubleClass" v-else-if="items.type === 'DOUBLE' && item.version != 1">
20
+ <div class="doubleItem" v-for="(itemss, index) in items.list" :key="'__' + index"
21
+ v-html="itemss">
28
22
  </div>
29
23
  </div>
30
- <div class="tripleClass" v-else-if="items.type==='TRIPLE'">
31
- <div v-html="itemss" class="tripleItem" v-for="(itemss,index) in items.list" :key="'___'+index"></div>
24
+ <div class="updateDoubleClass" v-else-if="items.type === 'DOUBLE' && item.version == 1">
25
+ <div class="doubleItem" :style="{ 'width': itemss.style.col / itemss.style.colums * 100 + '%' }"
26
+ v-for="(itemss, index) in items.tampList" :key="'__' + index" v-html="itemss.html">
27
+ </div>
28
+ <!-- <div class="doubleItem" v-for="(itemss,index) in items.tampList" :key="'__'+index">
29
+ {{itemss.style.col/itemss.style.colums*100}}{{itemss.html}}
30
+ </div> -->
31
+ </div>
32
+ <div class="tripleClass" v-else-if="items.type === 'TRIPLE'">
33
+ <div v-html="itemss" class="tripleItem" v-for="(itemss, index) in items.list"
34
+ :key="'___' + index">
35
+ </div>
36
+ </div>
37
+ <div class="quadrupleClass" v-else-if="items.type === 'QUADRUPLE'">
38
+ <div v-html="itemss" class="quadrupleItem" v-for="(itemss, index) in items.list"
39
+ :key="'___' + index"></div>
32
40
  </div>
33
41
  </div>
34
42
  </div>
35
43
  <div class="button-list">
36
- <div v-for="(items,index) in item.content.buttonList" :key="'____'+index" class="button-item">
44
+ <div v-for="(items, index) in item.content.buttonList" :key="'____' + index" class="button-item">
37
45
  <div @click="btnClick(items)" class="buttonClassItem">
38
- <span class="btn-name">{{items.name}}</span>
46
+ <span class="btn-name">{{ items.name }}</span>
39
47
  </div>
40
48
  </div>
41
49
  </div>
@@ -50,129 +58,149 @@
50
58
  </div>
51
59
  </template>
52
60
  <script>
53
- import ticketSwiper from "./swiper/ticketSwiper";
54
- import ticketSwiperItem from "./swiper/ticketSwiperItem";
55
- export default {
56
- name: "TicketMessage",
57
- props:{
61
+ import ticketSwiper from "./swiper/ticketSwiper";
62
+ import ticketSwiperItem from "./swiper/ticketSwiperItem";
63
+ export default {
64
+ name: "TicketMessage",
65
+ props: {
66
+ content: {
67
+ type: Object,
68
+ default() {
69
+ return {}
70
+ }
71
+ },
72
+ type: {
73
+ type: String,
74
+ default: ''
75
+ }
76
+ },
77
+ components: {
78
+ ticketSwiperItem,
79
+ ticketSwiper
80
+ },
81
+ data() {
82
+ return {
83
+ contents: {
84
+ multiple: true,
85
+ cards: [
86
+ {
58
87
  content: {
59
- type: Object,
60
- default() {
61
- return {}
62
- }
63
- },
64
- type:{
65
- type:String,
66
- default:''
88
+ htmlList: [{ type: 'IMAGE', src: 'https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-office-website/images/09-4.png' }, { type: 'SINGLE', list: ['<p>aaaaaaaaaa</p>'] }, { type: 'DOUBLE', list: ['<p>北京首都国际机场</p>', '<div>bbbbb</div>'] }, { type: 'TRIPLE', list: ['<p>北京首都国际机场啦啦啦啦</p>', '<div>CA5689</div>', '<p>上海虹桥国际机场</p>'] }, { type: 'TRIPLE', list: ['<p>7:00</p>', '<div>SSS</div>', '<p>12:00</p>'] }],
89
+ buttonList: [{ name: '我是标签1', scope: '', test: '' }, { name: '我是标签2' }]
67
90
  }
68
- },
69
- components:{
70
- ticketSwiperItem,
71
- ticketSwiper
72
- },
73
- data(){
74
- return{
75
- contents:{
76
- multiple:true,
77
- cards:[
78
- {content:{
79
- htmlList:[{type:'IMAGE',src:'https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-office-website/images/09-4.png'},{type:'SINGLE',list:['<p>aaaaaaaaaa</p>']},{type:'DOUBLE',list:['<p>北京首都国际机场</p>','<div>bbbbb</div>']},{type:'TRIPLE',list:['<p>北京首都国际机场啦啦啦啦</p>','<div>CA5689</div>','<p>上海虹桥国际机场</p>']},{type:'TRIPLE',list:['<p>7:00</p>','<div>SSS</div>','<p>12:00</p>']}],
80
- buttonList:[{name:'我是标签1',scope:'',test:''},{name:'我是标签2'}]
81
- }},
82
- {content:{
83
- htmlList:[{type:'SINGLE',list:['<p>aaaaa</p>','<a>我是链接</a>']},{type:'DOUBLE',list:['<p>aaaaa</p>','<div>bbbbb</div>']},{type:'TRIPLE',list:['<p>7:00</p>','<div></div>','<p>ccccc</p>']},{type:'TRIPLE',list:['<p>7:00</p>','<div>bbbbb</div>','<p>12:00</p>']}],
84
- buttonList:[{name:'我是标签1',scope:'',test:''}]
85
- }},
86
- {content:{
87
- htmlList:[{type:'SINGLE',list:['<p>邓伦李沁的背景图片</p>']},{type:'SINGLE',list:['<p>男生藏快递向求婚被他人错拆</p>']},{type:'SINGLE',list:['<p>aaaaa</p>']},{type:'SINGLE',list:['<p>aaaaa</p>']}],
88
- buttonList:[{name:'我是标签1'}]
89
- }}
90
-
91
- ]
92
- },
93
- device:'PC',
94
- slideWidth:'',
95
- swiperStyle: {},
96
- currIndex: 1,
97
- distance:0,
98
- isAndroid:false,
99
- isIos:false,
100
- isPhone:false,
101
- isCompany:false,
102
- swiper:false,
103
- text:[],
104
- textarea:[],
105
- onoff:true
106
- }
107
- },
108
- created() {
109
- this.isIosOrIsAndroid()
110
- this.isMobile()
111
- },
112
- mounted() {
113
-
114
- },
115
- methods:{
116
- SwiperImgLoad() {
117
- if (!this.loadCheck) {
118
- this.$emit("SwiperImgLoadEvent");
119
- this.loadCheck = true;
120
- }
121
- },
122
- slideLoadOn() {
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("请稍后点击")
138
- }
139
- },
140
-
141
- isIosOrIsAndroid(){
142
- var u = navigator.userAgent;
143
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
144
- var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
145
- if(isAndroid){
146
- this.isAndroid=true
147
- }
148
- if(isiOS){
149
- this.isIos=true
150
- }
151
- },
152
- isMobile() {
153
- 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);
154
- if (flag) {
155
- this.isPhone=true
156
- }
157
- else
158
- {
159
- this.isCompany=true
160
- }
161
- },
162
- touchMove(){
163
-
164
91
  },
165
- touchEnd(index){
166
- this.$emit('touchEnd',index)
92
+ {
93
+ content: {
94
+ htmlList: [{ type: 'SINGLE', list: ['<p>aaaaa</p>', '<a>我是链接</a>'] }, { type: 'DOUBLE', list: ['<p>aaaaa</p>', '<div>bbbbb</div>'] }, { type: 'TRIPLE', list: ['<p>7:00</p>', '<div></div>', '<p>ccccc</p>'] }, { type: 'TRIPLE', list: ['<p>7:00</p>', '<div>bbbbb</div>', '<p>12:00</p>'] }],
95
+ buttonList: [{ name: '我是标签1', scope: '', test: '' }]
96
+ }
97
+ },
98
+ {
99
+ content: {
100
+ htmlList: [{ type: 'SINGLE', list: ['<p>邓伦李沁的背景图片</p>'] }, { type: 'SINGLE', list: ['<p>男生藏快递向求婚被他人错拆</p>'] }, { type: 'SINGLE', list: ['<p>aaaaa</p>'] }, { type: 'SINGLE', list: ['<p>aaaaa</p>'] }],
101
+ buttonList: [{ name: '我是标签1' }]
102
+ }
167
103
  }
168
104
 
169
- },
105
+ ]
106
+ },
107
+ device: 'PC',
108
+ slideWidth: '',
109
+ swiperStyle: {},
110
+ currIndex: 1,
111
+ distance: 0,
112
+ isAndroid: false,
113
+ isIos: false,
114
+ isPhone: false,
115
+ isCompany: false,
116
+ swiper: false,
117
+ text: [],
118
+ textarea: [],
119
+ onoff: true
120
+ }
121
+ },
122
+ created() {
123
+ this.isIosOrIsAndroid()
124
+ this.isMobile()
125
+ },
126
+ mounted() {
127
+ this.content.cards.forEach(element => {
128
+ if (element.version == 1) {
129
+ element.content.htmlList.forEach((item) => {
130
+ item.tampList = [];
131
+ item.list.forEach((cell, cellIndex) => {
132
+ let tampCell = {
133
+ html: cell,
134
+ style: item.style[cellIndex]
135
+ }
136
+ item.tampList.push(tampCell);
137
+ })
138
+ })
139
+ }
140
+ });
141
+ this.content.cards = [...this.content.cards];
142
+ },
143
+ methods: {
144
+ SwiperImgLoad() {
145
+ if (!this.loadCheck) {
146
+ this.$emit("SwiperImgLoadEvent");
147
+ this.loadCheck = true;
148
+ }
149
+ },
150
+ slideLoadOn() {
151
+ this.$refs.swiper.slideOn();
152
+ },
153
+ btnClick(items) {
154
+ items.apiKey = this.content.apiKey
155
+ let that = this;
156
+ if (that.onoff) {
157
+ that.onoff = false;
158
+ console.debug('card_template', items)
159
+ this.$emit('btnClick', items, this.content.apiKey)
160
+ setTimeout(function () {
161
+ that.onoff = true;
162
+ }, 600)
163
+ } else {
164
+ //如果一直走else分支可能是你没有在页面的data下面挂载onoff:true,不然一直都会走else
165
+ console.debug("请稍后点击")
166
+ }
167
+ },
168
+
169
+ isIosOrIsAndroid() {
170
+ var u = navigator.userAgent;
171
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
172
+ var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
173
+ if (isAndroid) {
174
+ this.isAndroid = true
175
+ }
176
+ if (isiOS) {
177
+ this.isIos = true
178
+ }
179
+ },
180
+ isMobile() {
181
+ 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);
182
+ if (flag) {
183
+ this.isPhone = true
184
+ }
185
+ else {
186
+ this.isCompany = true
187
+ }
188
+ },
189
+ touchMove() {
190
+
191
+ },
192
+ touchEnd(index) {
193
+ this.$emit('touchEnd', index)
170
194
  }
195
+
196
+ },
197
+ }
171
198
  </script>
172
199
 
173
200
  <style lang="less">
174
- @import "../../assets/less/ticketMessage";
175
- a{
176
- text-decoration: none;
201
+ @import "../../assets/less/ticketMessage";
202
+
203
+ a {
204
+ text-decoration: none;
177
205
  }
178
206
  </style>