WeixinSwicth.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="page">
  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.nickName)" class="button">
  12. <p class="p">解除绑定</p>
  13. </button>
  14. </view>
  15. </view>
  16. <view class="xiugai2">
  17. <button type="primary" @click="backN()" class="xiugai2">
  18. <p class="xiugai3">返回上一页</p>
  19. </button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. adminId: '',
  28. stated:'1',
  29. title: "微信名:",
  30. list: []
  31. }
  32. },
  33. onUnload: function() {
  34. var stated = uni.getStorageSync("stated");
  35. if(stated!=2){
  36. wx.switchTab({
  37. url: '../User/user'
  38. })
  39. }
  40. },
  41. onShow() {
  42. var UserInfo = uni.getStorageSync("globalUser");
  43. this.adminId = UserInfo.id;
  44. var serverurl = this.serverurl;
  45. uni.removeStorageSync('stated');
  46. uni.request({
  47. url: serverurl + "/TWeixin/weiXinSearch",
  48. method: "POST",
  49. data: {
  50. adminId: this.adminId
  51. },
  52. success: (data) => {
  53. var list = data.data.data;
  54. this.list = list;
  55. }
  56. });
  57. },
  58. methods: {
  59. backN(){
  60. uni.reLaunch({
  61. url: '../User/user'
  62. });
  63. },
  64. delet(id, nickName) {
  65. // console.log("id==" + id);
  66. var serverurl = this.serverurl;
  67. uni.showModal({
  68. title: '提示',
  69. content: '是否取消绑定?',
  70. success: function(res) {
  71. if (res.confirm) {
  72. uni.request({
  73. url: serverurl + "/TWeixin/deleteWeixin",
  74. method: "POST",
  75. data: {
  76. id: id
  77. },
  78. success: (data) => {
  79. var list = data.data.data;
  80. if (list == 1) {
  81. uni.showModal({
  82. title: '提示',
  83. content: '解绑成功',
  84. success: function(res) {
  85. var UserInfo = uni.getStorageSync("newparm");
  86. uni.setStorageSync("stated",2);
  87. if (UserInfo.nickName == nickName) {
  88. uni.reLaunch({
  89. url: '../Login/Login',
  90. });
  91. } else {
  92. uni.reLaunch({
  93. url: '../User/user',
  94. });
  95. }
  96. }
  97. });
  98. }
  99. }
  100. });
  101. } else if (res.cancel) {
  102. setTimeout(function() {
  103. uni.startPullDownRefresh();
  104. }, 100);
  105. setTimeout(function() {
  106. uni.stopPullDownRefresh();
  107. }, 3000);
  108. }
  109. }
  110. });
  111. }
  112. }
  113. }
  114. </script>
  115. <style>
  116. .page{
  117. padding-bottom: 30upx;
  118. }
  119. .body {
  120. background-color: #FFFFFF;
  121. padding: 10upx 10upx 10upx 10upx;
  122. display: flex;
  123. flex-direction: row;
  124. justify-content: flex-start;
  125. }
  126. .input-two {
  127. width: 600upx;
  128. height: 100upx;
  129. padding-left: 30upx;
  130. padding-right: 20upx;
  131. }
  132. .p {
  133. /* #ifdef H5 */
  134. top: -13%;
  135. /* #endif */
  136. width: 120upx;
  137. height: 60upx;
  138. font-size: 30upx;
  139. /* #ifndef H5 */
  140. padding-top: 3upx;
  141. /* #endif */
  142. position: absolute;
  143. /* 水平居中 */
  144. left: 50%;
  145. -webkit-transform: translateX(-50%);
  146. transform: translateX(-50%);
  147. }
  148. .input {
  149. /* padding: 10upx 20upx 10upx 0upx; */
  150. padding-left: 20upx;
  151. padding-top: 10upx;
  152. background-color: #FFFFFF;
  153. width: 500upx;
  154. height: 50upx;
  155. box-shadow: 0upx 0upx 20upx #D3D3D3;
  156. border-radius: 5upx;
  157. }
  158. .button {
  159. /* padding: 5upx 10upx 10upx 0upx; */
  160. width: 120upx;
  161. height: 60upx;
  162. border-radius: 10upx;
  163. }
  164. .button2 {
  165. padding-right: 120upx;
  166. padding-top: 2upx;
  167. }
  168. .xiugai {
  169. width: 92%;
  170. padding-top: 20upx;
  171. border-left: 20upx;
  172. border-left: 10upx solid #FFFFFF;
  173. padding-left: 10upx;
  174. height: 38upx;
  175. padding-bottom: 30upx;
  176. font-family: "PingFang-SC-Bold";
  177. font-weight: bold;
  178. margin: auto;
  179. font-size: 32upx;
  180. color: #363D44;
  181. }
  182. .xiugai2 {
  183. width: 100%;
  184. height: 80upx;
  185. font-family: "PingFang-SC-Bold";
  186. font-weight: bold;
  187. margin: auto;
  188. font-size: 50upx;
  189. color: #363D44;
  190. position:fixed;
  191. bottom:0;
  192. }
  193. .xiugai3 {
  194. height: 80upx;
  195. font-family: "PingFang-SC-Bold";
  196. font-weight: bold;
  197. margin: auto;
  198. font-size: 40upx;
  199. color: #363D44;
  200. }
  201. </style>