|
@@ -82,7 +82,13 @@
|
82
|
82
|
size="mini"
|
83
|
83
|
type="danger"
|
84
|
84
|
@click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
|
85
|
|
- <a v-if="scope.row.SendType === 'channel'" class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
|
|
85
|
+ <el-button
|
|
86
|
+ size="mini"
|
|
87
|
+ type="success"
|
|
88
|
+ v-clipboard:copy="this.clientUrl + '/receiveChannelShared/' + scope.row.GymCardId + '/' + scope.row.GymTypeId + '/receive'"
|
|
89
|
+ v-clipboard:success="onCopy"
|
|
90
|
+ v-clipboard:error="onError"
|
|
91
|
+ >点击复制链接</el-button>
|
86
|
92
|
</template>
|
87
|
93
|
</el-table-column>
|
88
|
94
|
</el-table>
|
|
@@ -201,7 +207,6 @@
|
201
|
207
|
v-model="currentCopyUrl"
|
202
|
208
|
clearable>
|
203
|
209
|
</el-input>
|
204
|
|
- <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
|
205
|
210
|
</div>
|
206
|
211
|
<span slot="footer" class="dialog-footer">
|
207
|
212
|
<el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
|
|
@@ -211,7 +216,6 @@
|
211
|
216
|
</template>
|
212
|
217
|
|
213
|
218
|
<script>
|
214
|
|
-import Clipboard from 'clipboard'
|
215
|
219
|
import { mapState, createNamespacedHelpers } from 'vuex'
|
216
|
220
|
const { mapState: mapGymCardState, mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
|
217
|
221
|
const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
|
|
@@ -220,6 +224,7 @@ export default {
|
220
|
224
|
name: '',
|
221
|
225
|
data () {
|
222
|
226
|
return {
|
|
227
|
+ clipboardArr: [],
|
223
|
228
|
currentCopyUrl: '',
|
224
|
229
|
copyDialogVisible: false,
|
225
|
230
|
selectCustomer: [],
|
|
@@ -253,6 +258,7 @@ export default {
|
253
|
258
|
gymCardList: x => x.gymCardList,
|
254
|
259
|
}),
|
255
|
260
|
...mapState({
|
|
261
|
+ clientUrl: x => x.app.clientUrl,
|
256
|
262
|
cases: x => x.app.cases.list,
|
257
|
263
|
defaultCaseId: x => x.app.cases.default
|
258
|
264
|
}),
|
|
@@ -293,7 +299,6 @@ export default {
|
293
|
299
|
},
|
294
|
300
|
toSendCard () { // 赠送卡
|
295
|
301
|
if (this.selectCustomer.length) {
|
296
|
|
- console.log(this.selectCustomer)
|
297
|
302
|
this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
|
298
|
303
|
this.giveCard({
|
299
|
304
|
id: this.currentCardId,
|
|
@@ -338,7 +343,6 @@ export default {
|
338
|
343
|
caseid: this.CaseId || this.defaultCaseId
|
339
|
344
|
}).then((res) => {
|
340
|
345
|
this.total = res.pagenum
|
341
|
|
- // console.log(JSON.stringify(res))
|
342
|
346
|
})
|
343
|
347
|
},
|
344
|
348
|
handleCurrentChange (val) { // 跳转到分页
|
|
@@ -347,21 +351,21 @@ export default {
|
347
|
351
|
handleEdit (index, row) { // 编辑
|
348
|
352
|
this.$router.push({ name: 'editBodyBuildingCard', query: { id: row.GymCardId } })
|
349
|
353
|
},
|
350
|
|
- toCopy (index, row) { // 复制
|
351
|
|
- console.log(1)
|
352
|
|
- var clipboard = new Clipboard(this.$refs['copy' + index])
|
353
|
|
- clipboard.on('success', e => {
|
354
|
|
- console.log('复制成功')
|
355
|
|
- clipboard.destroy()
|
|
354
|
+ addCard () {
|
|
355
|
+ this.$router.push({ name: 'editBodyBuildingCard', query: {} })
|
|
356
|
+ },
|
|
357
|
+ onCopy () {
|
|
358
|
+ this.$message({
|
|
359
|
+ type: 'success',
|
|
360
|
+ message: '复制成功!'
|
356
|
361
|
})
|
357
|
|
- clipboard.on('error', e => {
|
358
|
|
- console.log('该浏览器不支持自动复制')
|
359
|
|
- clipboard.destroy()
|
|
362
|
+ },
|
|
363
|
+ onError () {
|
|
364
|
+ this.$message({
|
|
365
|
+ type: 'error',
|
|
366
|
+ message: '复制失败!'
|
360
|
367
|
})
|
361
|
368
|
},
|
362
|
|
- addCard () {
|
363
|
|
- this.$router.push({ name: 'editBodyBuildingCard', query: {} })
|
364
|
|
- }
|
365
|
369
|
}
|
366
|
370
|
}
|
367
|
371
|
</script>
|
|
@@ -382,7 +386,7 @@ export default {
|
382
|
386
|
}
|
383
|
387
|
}
|
384
|
388
|
}
|
385
|
|
-.copyBtn{
|
|
389
|
+.copyBtn {
|
386
|
390
|
line-height: 29px;
|
387
|
391
|
border-radius: 3px;
|
388
|
392
|
color: #fff;
|