WeixinSwicth.vue 4.3 KB

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