| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <html>
- <head>
- <style>
- #qrcode {
- width: 200px;
- height: 200px;
- margin: 80px auto 30px;
- display: none;
- }
- #icon {
- font-size: 120px;
- width: 120px;
- height: 120px;
- margin: 80px auto 30px;
- text-align: center;
- color: #409EFF;
- display: none;
- }
- .desc {
- text-align: center;
- font-size: 16px;
- color: #999;
- }
- .btns {
- margin: 30px auto 0px auto;
- text-align: center;
- display: none;
- }
- #headimgurl {
- text-align: center;
- display: none;
- }
- #headimgurl img {
- width: 160px;
- height: 160px;
- border-radius: 3px;
- margin-top: 30px;
- border: 1px solid #efefef;
- }
- #headimgurl p {
- margin: 25px 0 66px 0px;
- color: #333;
- }
- </style>
- </head>
- <body>
- <div id="space-content">
- <el-form action='@service{name:`wechat_binding_cancel`, page:`toTips` }@' method="post" :model="obj"
- label-width="100px"></el-form>
- <div id="icon">
- <i id="i" class="el-icon-success"></i>
- </div>
- <div id="headimgurl">
- <img :src="headimgurlMax">
- <p>
- ${userInfo.nickname}
- </p>
- </div>
- <div id="qrcode"></div>
- <div class="desc">
- </div>
- <div id="btns" class="btns">
- <el-button type="danger" plain @click="confirm()">解除绑定</el-button>
- </div>
- </el-form>
- </div>
- </body>
- <script src="/apps/space/plug-in/jquery-qrcode/jquery.qrcode.min.js"></script>
- <script type="text/javascript">
- space.vue = new Vue({
- el: space.appContent,
- data() {
- return {
- obj: {},
- result: space.utils.parseBoolean('${res}'),
- headimgurl: '${userInfo.headimgurl}'
- };
- },
- computed: {
- headimgurlMax: function () {
- var indexNum = this.headimgurl.lastIndexOf('/');
- return this.headimgurl.slice(0, indexNum + 1) + "0";
- }
- },
- mounted: function () {
- if (!this.result) {
- var URL = "${url}";
- $('#qrcode').qrcode({ text: URL, width: 200, height: 200 });
- $("#qrcode").show();
- $("div.desc").html("请打开微信扫一扫");
- var _this = this;
- var statusInterval = setInterval(function () {
- space.utils.ajax({
- url: "@service{ name:`wechat_binding_status` }@",
- dataType: 'json',
- loadLayer: false,
- callback: function (data) {
- if (data.code == "success" && data.msg == "ok") {
- $("#qrcode").hide();
- $("#icon").show();
- $("#i").addClass("el-icon-success");
- $(".desc").html("绑定成功");
- window.clearInterval(statusInterval);
- }
- }
- });
- }, 2000);
- }
- else {
- $("#headimgurl").show();
- $("#btns").show();
- $(".desc").html("你已经绑定了微信");
- }
- },
- methods: {
- confirm() {
- if (this.result) {
- this.$confirm('此操作将解除和微信账号的绑定, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- space.forms.submit();
- }).catch(() => {
- });
- }
- }
- }
- })
- </script>
- </html>
|