123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <!--
- * @Author: xiebaomin 1771403033@qq.com
- * @Date: 2023-03-29 10:58:14
- * @LastEditors: xiebaomin 1771403033@qq.com
- * @LastEditTime: 2023-05-12 09:16:20
- * @FilePath: \caimei-authentic-manager\src\components\PermissionButton\index.vue
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- -->
- <template>
- <el-button v-bind="$attrs" @click="handleClick"><slot /></el-button>
- </template>
- <script>
- export default {
- name: 'PermissionButton',
- data() {
- return {
- hasPermission: true
- }
- },
- methods: {
- handleClick($event) {
- const { freeUseFlag, vipStatus } = this.$store.getters.vipInfo
- // 试用期 || 会员未到期
- this.hasPermission = freeUseFlag > 0 || [0, 3].indexOf(vipStatus) === -1
- if (this.hasPermission) {
- this.$emit('click', $event)
- } else {
- this.$confirm('对不起,您账号的会员权限已到期,请尽快续费会员,以免影响正常使用!', '提示', {
- confirmButtonText: '续费',
- cancelButtonText: '取消'
- })
- .then(() => {
- // jumpAction()
- // console.log('开通会员')
- this.$router.push('/vip/vip-open')
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '已取消操作'
- })
- })
- }
- }
- }
- }
- </script>
|