member_manage.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!-- +---------------------------------------------------------------------- -->
  2. <!-- | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -->
  3. <!-- +---------------------------------------------------------------------- -->
  4. <!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
  5. <!-- +---------------------------------------------------------------------- -->
  6. <!-- | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -->
  7. <!-- +---------------------------------------------------------------------- -->
  8. <!-- | Author: CRMEB Team <admin@crmeb.com> -->
  9. <!-- +---------------------------------------------------------------------- -->
  10. {extend name="public/container"}
  11. {block name="title"}卡密激活{/block}
  12. {block name="head"}
  13. <style>
  14. body {
  15. background-color: #F5F5F5;
  16. }
  17. </style>
  18. {/block}
  19. {block name="content"}
  20. <div v-cloak id="app">
  21. <div class="exchange-page">
  22. <div class="title-section">
  23. <div class="text">激活会员卡</div>
  24. </div>
  25. <form class="form-section" @submit.prevent="onSubmit">
  26. <label class="label">
  27. <span class="iconfont iconqiahao"></span>
  28. <input v-model="member_code" class="input" maxlength="18" placeholder="请输入卡号">
  29. </label>
  30. <label class="label password">
  31. <span class="iconfont iconkahao"></span>
  32. <input v-model="member_pwd" class="input" type="password" placeholder="请输入密码">
  33. </label>
  34. <button class="button" type="submit">确认激活</button>
  35. </form>
  36. <div v-if="interests.length" class="power-section">
  37. <div class="title">
  38. <div class="text">会员尊享权益</div>
  39. </div>
  40. <div class="list">
  41. <div v-for="item in interests" :key="item.id" class="item">
  42. <div class="img-wrap">
  43. <img class="img" :src="item.pic">
  44. </div>
  45. <div class="name">{{ item.name }}</div>
  46. <div class="info">{{ item.explain }}</div>
  47. </div>
  48. </div>
  49. </div>
  50. <div v-if="description.length" class="explain-section">
  51. <div class="title">会员说明:</div>
  52. <ol>
  53. <li v-for="item in description" :key="item.id">{{ item.text }}</li>
  54. </ol>
  55. </div>
  56. </div>
  57. <base-login :login-show="loginShow" :site-name="site_name" @login-close="logComplete"></base-login>
  58. </div>
  59. <script>
  60. var site_name = '{$Auth_site_name}', isWechat={$isWechat ? 'true' : 'false'};
  61. require(['vue', 'helper', 'store', 'components/base-login/index'], function (Vue, $h, api, BaseLogin) {
  62. var app = new Vue({
  63. el: '#app',
  64. components: {
  65. 'base-login': BaseLogin
  66. },
  67. data: {
  68. description: [],
  69. interests: [],
  70. member_code: '',
  71. member_pwd: '',
  72. loginShow: false,
  73. url: isWechat ? $h.U({ c: 'index', a: 'login' }):$h.U({ c: 'login', a: 'phone_check' }),
  74. site_name: site_name
  75. },
  76. created: function () {
  77. this.init();
  78. },
  79. methods: {
  80. init: function () {
  81. var that = this;
  82. $h.loadFFF();
  83. api.baseGet($h.U({
  84. c: 'auth_api',
  85. a: 'merberDatas'
  86. }), function (res) {
  87. var data = res.data.data;
  88. $h.loadClear();
  89. that.description = data.description;
  90. that.interests = data.interests;
  91. }, function (err) {
  92. $h.loadClear();
  93. $h.pushMsg(err);
  94. });
  95. },
  96. onSubmit: function () {
  97. var that = this;
  98. $h.loadFFF();
  99. api.baseGet($h.U({
  100. c: 'index',
  101. a: 'user_login'
  102. }), function (res) {
  103. $h.loadClear();
  104. if (!that.member_code) {
  105. return $h.pushMsg('请输入卡号');
  106. }
  107. if (that.member_code.length !== 18) {
  108. return $h.pushMsg('请输入正确的卡号');
  109. }
  110. if (!that.member_pwd) {
  111. return $h.pushMsg('请输入密码');
  112. }
  113. if (that.member_pwd.length !== 5) {
  114. return $h.pushMsg('请输入正确的密码');
  115. }
  116. api.basePost($h.U({
  117. c: 'auth_api',
  118. a: 'confirm_activation'
  119. }), {
  120. member_code: that.member_code,
  121. member_pwd: that.member_pwd
  122. }, function (res) {
  123. $h.showMsg({
  124. title: res.data.msg,
  125. icon: 'success',
  126. success: function() {
  127. window.location.href=$h.U({c:'special',a:'member_recharge'});
  128. }
  129. });
  130. });
  131. }, function () {
  132. that.loginShow = true;
  133. });
  134. },
  135. changeVal: function (opt) {
  136. if (typeof opt != 'object') opt = {};
  137. var action = opt.action || '';
  138. var value = opt.value || '';
  139. this[action] && this[action](value);
  140. },
  141. loginClose:function(value){
  142. this.loginShow=false;
  143. value && this.logComplete();
  144. },
  145. logComplete:function(){
  146. this.loginShow=false;
  147. },
  148. enter: function () {
  149. this.appear = false;
  150. }
  151. }
  152. });
  153. });
  154. </script>
  155. {/block}