zydx-plus 1.12.46 → 1.12.48

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.12.46",
3
+ "version": "1.12.48",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -6,8 +6,8 @@
6
6
  <div class="book">
7
7
  <flipbook class="flipbook" :pages="imgArr" @flip-left-end="flipLeft" @flip-right-end="flipRight" v-slot="flipbook" :singlePage="singlePage" :ambient="0" :gloss="1" :dragToFlip="false" :pagesHiRes="0">
8
8
  <div class="but">
9
- <button class="but-brown" @click="flipbook.flipLeft">上一页</button>
10
- <button class="but-brown" @click="flipbook.flipRight">下一页</button>
9
+ <button class="but-brown" :class="{'but-act': pageIndex === 1}" @click="flipbook.flipLeft">上一页</button>
10
+ <button class="but-brown" :class="{'but-act': pageIndex === pdfPages}" @click="flipbook.flipRight">下一页</button>
11
11
  </div>
12
12
  </flipbook>
13
13
  </div>
@@ -25,7 +25,8 @@ export default {
25
25
  return {
26
26
  pdfPages: 0,
27
27
  imgArr: [],
28
- hei: 0
28
+ hei: 0,
29
+ pageIndex: 1
29
30
  }
30
31
  },
31
32
  props: {
@@ -45,10 +46,18 @@ export default {
45
46
  },
46
47
  methods: {
47
48
  flipLeft(e) {
48
- this.$emit('flip',e)
49
+ this.pageIndex = e
50
+ this.$emit('flip',{
51
+ page: e,
52
+ total: this.pdfPages
53
+ })
49
54
  },
50
55
  flipRight(e) {
51
- this.$emit('flip',e)
56
+ this.pageIndex = e
57
+ this.$emit('flip',{
58
+ page: e,
59
+ total: this.pdfPages
60
+ })
52
61
  },
53
62
  readPdf() {
54
63
  let that = this
@@ -81,7 +90,7 @@ export default {
81
90
  const dataURL = canvas.toDataURL("image/jpeg",1); //获取Base64编码
82
91
  that.imgArr.push(dataURL)
83
92
  }
84
- },0)
93
+ },100)
85
94
  })
86
95
  }
87
96
  }
@@ -131,4 +140,8 @@ export default {
131
140
  left: 0;
132
141
  z-index: -100;
133
142
  }
143
+ .but-act{
144
+ background-color: #bbbbbb;
145
+ color: #fff;
146
+ }
134
147
  </style>
@@ -8,7 +8,7 @@ render(divNode, document.body)
8
8
  const container = divNode.el
9
9
 
10
10
  // 导出函数可通过调用 Confirm() 函数动态创建 XtxConfirm 组件
11
- const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr }) => {
11
+ const Confirm = ({ type, url ,title,radioArr, promptContent, middle, cancelShow, inputArr }) => {
12
12
  // 返回 Promise 对象
13
13
  return new Promise((resolve, reject) => {
14
14
  // 2. 点击确认按钮,触发resolve同时销毁组件
@@ -23,6 +23,13 @@ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr
23
23
  }
24
24
  }
25
25
  }
26
+ if(type === 'radio') {
27
+ for(let i=0; i< radioArr.length; i++) {
28
+ if(radioArr[i].checked) {
29
+ val.push(radioArr[i].value)
30
+ }
31
+ }
32
+ }
26
33
  render(null, container)
27
34
  resolve(val)
28
35
  }
@@ -32,7 +39,7 @@ const Confirm = ({ type, url ,title, promptContent, middle, cancelShow, inputArr
32
39
  reject('点击取消')
33
40
  }
34
41
  // 1. 创建 XtxConfirm 组件
35
- const VNode = createVNode(XtxConfirm, { type, url ,title, promptContent, middle, cancelShow, inputArr, submit, cancel })
42
+ const VNode = createVNode(XtxConfirm, { type, url ,title, promptContent,radioArr, middle, cancelShow, inputArr, submit, cancel })
36
43
  render(VNode, container)
37
44
  })
38
45
  }
@@ -12,6 +12,14 @@
12
12
  <div class="tip-img" v-if="type === 'img'">
13
13
  <img :src="url"/>
14
14
  </div>
15
+ <div v-if="type === 'radio'">
16
+ <div class="radio-list" v-for="(item,index) in radioArr" :key="index">
17
+ <label>
18
+ <input type="radio" name="radio" :value="item.value" :checked="item.checked" @change="radioTao(index)" />
19
+ <span>{{ item.label }}</span>
20
+ </label>
21
+ </div>
22
+ </div>
15
23
  <div class="tip-img" v-if="type === 'input'">
16
24
  <div class="tip-input" v-for="(item,index) in inputArr" :key="index">
17
25
  <span v-if="item.name">{{ item.name }}</span>
@@ -85,6 +93,10 @@ export default {
85
93
  type: Array,
86
94
  default: []
87
95
  },
96
+ radioArr: { // 单选数据
97
+ type: Array,
98
+ default: []
99
+ },
88
100
  // 确认按钮
89
101
  submit: {
90
102
  type: Function,
@@ -98,6 +110,12 @@ export default {
98
110
  }
99
111
  },
100
112
  methods: {
113
+ radioTao(index){
114
+ this.radioArr.forEach(item => {
115
+ item.checked = false
116
+ })
117
+ this.radioArr[index].checked = true
118
+ },
101
119
  focus() {
102
120
  this.tip = true
103
121
  },
@@ -99,7 +99,6 @@ font-size: 12px;
99
99
  display: inline-block;
100
100
  line-height: 30px;
101
101
  padding-right: 10px;
102
- min-width: 80px;
103
102
  text-align: right;
104
103
  }
105
104
  .tip-input input{
@@ -151,4 +150,21 @@ font-size: 12px;
151
150
  line-height: 30px;
152
151
  border: 0;
153
152
  border-left: 1px solid #ccc;
153
+ }
154
+ .radio-list{
155
+ padding: 10px 20px;
156
+ text-align: left;
157
+ font-size: 16px;
158
+ position: relative;
159
+ }
160
+ .radio-list span{
161
+ padding-left: 22px;
162
+ }
163
+ .radio-list input{
164
+ width: 16px;
165
+ height: 16px;
166
+ position: absolute;
167
+ top: 12px;
168
+ left: 20px;
169
+ z-index: 1;
154
170
  }
package/src/index.js CHANGED
@@ -43,7 +43,7 @@ function install(app) {
43
43
  }
44
44
 
45
45
  export default {
46
- version: '1.12.46',
46
+ version: '1.12.48',
47
47
  install,
48
48
  Calendar,
49
49
  Message,