|
|
@@ -0,0 +1,84 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ title=""
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ :append-to-body="true"
|
|
|
+ width="800px"
|
|
|
+ custom-class="cc-dialog"
|
|
|
+ >
|
|
|
+
|
|
|
+ <div class="tips" style="color: #103a22">
|
|
|
+ 当前用户:{{$store.state.userinfo.nickname}}没有VIP权限,无法查阅此文章!
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex mt-24px">
|
|
|
+ <ui-vip-preset class="mr-32px" @choose="handleChoose(vipSmeal)" v-for="vipSmeal in vipSmeals" :item="vipSmeal"></ui-vip-preset>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ name: "vip-srv-box",
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ dialogVisible: false,
|
|
|
+ vipSmeals:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ open(){
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ this.dialogVisible = false;
|
|
|
+ },
|
|
|
+ async handleChoose(vipSmeal) {
|
|
|
+
|
|
|
+ let resp = await this.$http.post(this.$api.mzUser.createVipOrder,this.$qs.stringify({vipCode:vipSmeal.code}))
|
|
|
+ if(resp.data.status === 200){
|
|
|
+ await this.$confirm('请在弹出的窗口完成付款操作?', '提示', {
|
|
|
+ confirmButtonText: '已完成付款',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ resp = await this.$http.post(this.$api.mzUser.confirmVipOrder,this.$qs.stringify({orderCode:resp.data.data.vipSmOrder.code}))
|
|
|
+
|
|
|
+ if(resp.data.status === 200){
|
|
|
+ this.$message.success("开通成功");
|
|
|
+ this.loadData();
|
|
|
+ this.close();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ async loadData(){
|
|
|
+ let resp = await this.$http.post(this.$api.mzUser.userinfo);
|
|
|
+
|
|
|
+ if(resp.data.status === 200){
|
|
|
+ this.userinfo = resp.data.data.mzUser;
|
|
|
+ this.$store.commit('UPDATE_LOGIN_INFO',resp.data.data.mzUser)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ let r = await this.$http.post(this.$api.common.vipSmeals);
|
|
|
+ if(r.data.status === 200){
|
|
|
+ this.vipSmeals = r.data.data.vipSmeals;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .cc-dialog{
|
|
|
+ background-color:#F7F7F7;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</style>
|