authVip.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view>
  3. <view class="lz-modal lz-modal-show">
  4. <view class="lz-modal-dialog">
  5. <view class="lz-list">
  6. <view class="lz-list-header" style="display: flex;flex-direction: row;">
  7. <view>温馨提示</view>
  8. <view class="iconfont icon-cuo1" @tap="hideAuthVip()"></view>
  9. </view>
  10. <view class="lz-list-body">
  11. <view class="lz-list-item lz-list-item-middle">
  12. <view class="lz-list-line">
  13. <view class="ktvip">
  14. <image src="../static/img/zs.png" mode="" class="ktvip-img"></image>
  15. <view class="ktvip-flex"><text>请激活VIP</text>(当前科目:{{subject.subject_name}})</view>
  16. </view>
  17. <view class="index-bm-title">
  18. <input class="uni-input" v-model="vipnum" confirm-type="search"
  19. placeholder="请输入激活码" />
  20. </view>
  21. <view class="ktvip-b">
  22. <!-- #ifdef H5 || APP-PLUS -->
  23. <button @tap="$openrul('/pages/my/about?id=1')">联系客服</button>
  24. <!-- #endif -->
  25. <!-- #ifdef MP-WEIXIN -->
  26. <button open-type="contact">联系客服</button>
  27. <!-- #endif -->
  28. <button @tap="authVip()" class="ktvip-b-r">确认激活</button>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="lz-margin--b-md"></view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. mapState
  42. } from 'vuex';
  43. export default {
  44. name: "auth-vip",
  45. data() {
  46. return {
  47. vipnum: '',
  48. mode: '',
  49. }
  50. },
  51. computed: {
  52. ...mapState(['subject', 'userinfo', 'subjectVip']),
  53. },
  54. mounted() {
  55. this.mode = this.$myConfig.mode
  56. },
  57. methods: {
  58. hideAuthVip() {
  59. this.$emit('hideAuthVip', false)
  60. },
  61. async authVip() {
  62. let res = await this.$myHttp.post({
  63. url: this.$myHttp.urlMap.exchangesubject,
  64. data: {
  65. code: this.vipnum,
  66. subject_id: this.subject.id
  67. },
  68. needLogin: true
  69. })
  70. if (res.code == 1) {
  71. uni.showToast({
  72. title: '激活成功',
  73. icon: 'none',
  74. duration: 1000
  75. })
  76. this.$myUserLogin.getSubvip(this.subject.id)
  77. this.hideAuthVip()
  78. } else {
  79. uni.showToast({
  80. title: res.msg,
  81. icon: 'none',
  82. duration: 1000
  83. })
  84. }
  85. },
  86. //获取获取解密手机号
  87. // async userDecryptData(encryptedData,iv,code) {
  88. // let res = await this.$myHttp.post({
  89. // url: this.$myHttp.urlMap.decryptData,
  90. // data: {
  91. // encryptedData:encryptedData,
  92. // iv:iv,
  93. // code:code,
  94. // },
  95. // needLogin: true
  96. // })
  97. // if (res.code == 1) {
  98. // let jmPnumber = res.data
  99. // let myPhone = jmPnumber.phoneNumber
  100. // console.log(myPhone);
  101. // }
  102. // },
  103. // getPhoneNumber(e) {
  104. // let enc = e.detail.encryptedData
  105. // let iv = e.detail.iv
  106. // this.userDecryptData(enc,iv,this.cod)
  107. // },
  108. }
  109. }
  110. </script>
  111. <style>
  112. .ktvip {
  113. color: #848484;
  114. font-size: 15px;
  115. }
  116. .ktvip-flex {
  117. width: 84%;
  118. margin: 0px auto;
  119. }
  120. .ktvip-flex text {
  121. color: #000;
  122. font-weight: bold;
  123. }
  124. .ktvip-img {
  125. width: 68px;
  126. height: 68px;
  127. margin-bottom: 3px;
  128. }
  129. .ktvip-b {
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. font-size: 14px;
  134. margin: 14px 0;
  135. }
  136. .ktvip-b button {
  137. font-size: 14px;
  138. margin: 0 8px;
  139. border: solid 1px #ebebeb;
  140. }
  141. .ktvip-b-r {
  142. font-size: 14px;
  143. background: #3c7bfc;
  144. border: solid 1px #3c7bfc !important;
  145. color: #fff;
  146. }
  147. .ktvip-b-r button::after,
  148. .ktvip-b button::after {
  149. border: none;
  150. }
  151. .index-bm-title {
  152. width: 86%;
  153. margin: 12px auto 10px;
  154. }
  155. .index-bm-content {
  156. margin-top: 10px;
  157. }
  158. .index-bm-flex {
  159. display: flex;
  160. font-size: 15px;
  161. align-items: center;
  162. margin-bottom: 8px;
  163. }
  164. .index-bm-title input {
  165. border-radius: 5px;
  166. border: none;
  167. padding: 10px;
  168. flex: 1;
  169. font-size: 15px;
  170. color: #000;
  171. text-align: left;
  172. border: 1px #eee solid;
  173. }
  174. </style>