WeixinSwicth.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <view class="xiugai">
  4. 微信绑定情况
  5. </view>
  6. <view v-for="(item,index) in list" :key="index" class="body">
  7. <view class="input-two">
  8. <input type="text" class="input" :value=title+item.nickName />
  9. </view>
  10. <view class="button2">
  11. <button type="primary" @click="delet(item.id,item.adminId)" class="button">
  12. <p class="p">解除绑定</p>
  13. </button>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. adminId: '',
  23. title: "微信名:",
  24. list: []
  25. }
  26. },
  27. onShow() {
  28. var UserInfo = uni.getStorageSync("globalUser");
  29. this.adminId = UserInfo.id;
  30. var serverurl = this.serverurl;
  31. uni.request({
  32. url: serverurl + "/TWeixin/weiXinSearch",
  33. method: "POST",
  34. data: {
  35. adminId: this.adminId
  36. },
  37. success: (data) => {
  38. var list = data.data.data;
  39. this.list = list;
  40. }
  41. });
  42. },
  43. methods: {
  44. delet(id,adminid) {
  45. console.log("id==" + id);
  46. var serverurl = this.serverurl;
  47. uni.showModal({
  48. title: '提示',
  49. content: '是否取消绑定?',
  50. success: function(res) {
  51. if (res.confirm) {
  52. uni.request({
  53. url: serverurl + "/TWeixin/deleteWeixin",
  54. method: "POST",
  55. data: {
  56. id: id
  57. },
  58. success: (data) => {
  59. var list = data.data.data;
  60. if (list == 1) {
  61. uni.showModal({
  62. title: '提示',
  63. content: '解绑成功',
  64. success: function(res) {
  65. var UserInfo = uni.getStorageSync("globalUser");
  66. if (UserInfo.id == adminid) {
  67. uni.reLaunch({
  68. url: '../Login/Login',
  69. });
  70. }else{
  71. uni.reLaunch({
  72. url: '../User/user',
  73. });
  74. }
  75. }
  76. });
  77. }
  78. }
  79. });
  80. } else if (res.cancel) {
  81. setTimeout(function() {
  82. uni.startPullDownRefresh();
  83. }, 100);
  84. setTimeout(function() {
  85. uni.stopPullDownRefresh();
  86. }, 3000);
  87. }
  88. }
  89. });
  90. }
  91. }
  92. }
  93. </script>
  94. <style>
  95. .body {
  96. background-color: #FFFFFF;
  97. padding: 10upx 10upx 10upx 10upx;
  98. display: flex;
  99. flex-direction: row;
  100. justify-content: flex-start;
  101. }
  102. .input-two {
  103. width: 600upx;
  104. height: 100upx;
  105. padding-left: 30upx;
  106. padding-right: 20upx;
  107. }
  108. .p {
  109. /* #ifdef H5 */
  110. top: -13%;
  111. /* #endif */
  112. width: 120upx;
  113. height: 60upx;
  114. font-size: 30upx;
  115. /* #ifndef H5 */
  116. padding-top: 3upx;
  117. /* #endif */
  118. position: absolute;
  119. /* 水平居中 */
  120. left: 50%;
  121. -webkit-transform: translateX(-50%);
  122. transform: translateX(-50%);
  123. }
  124. .input {
  125. /* padding: 10upx 20upx 10upx 0upx; */
  126. padding-left: 20upx;
  127. padding-top: 10upx;
  128. background-color: #FFFFFF;
  129. width: 500upx;
  130. height: 50upx;
  131. box-shadow: 0upx 0upx 20upx #D3D3D3;
  132. border-radius: 5upx;
  133. }
  134. .button {
  135. /* padding: 5upx 10upx 10upx 0upx; */
  136. width: 120upx;
  137. height: 60upx;
  138. border-radius: 10upx;
  139. }
  140. .button2 {
  141. padding-right: 120upx;
  142. padding-top: 2upx;
  143. }
  144. .xiugai {
  145. width: 92%;
  146. padding-top: 20upx;
  147. border-left: 20upx;
  148. border-left: 10upx solid #FFFFFF;
  149. padding-left: 10upx;
  150. height: 38upx;
  151. padding-bottom: 30upx;
  152. font-family: "PingFang-SC-Bold";
  153. font-weight: bold;
  154. margin: auto;
  155. font-size: 32upx;
  156. color: #363D44;
  157. }
  158. </style>