tranWechat.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="page">
  3. <view class="mainBody">
  4. <view class="menu">
  5. <view class="item" :class="{'active':tab===1}" @click="checkTab(1)">
  6. <text class="left">全部</text>
  7. <view class="line"></view>
  8. </view>
  9. <view class="item" :class="{'active':tab===2}" @click="checkTab(2)">
  10. <text class="left">待处理</text>
  11. <view class="line"></view>
  12. </view>
  13. <view class="item" :class="{'active':tab===3}" @click="checkTab(3)">
  14. <text class="left">已通过</text>
  15. <view class="line"></view>
  16. </view>
  17. <view class="item" :class="{'active':tab===4}" @click="checkTab(4)">
  18. <text class="left">已拒绝</text>
  19. <view class="line"></view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="list_info">
  24. <block v-for="(item,index) in 10" :key="index">
  25. <view class="item">
  26. <view class="avator">
  27. <image class="icon" src="../../static/me/sex_2.png" mode="widthFix">
  28. </image>
  29. </view>
  30. <view class="tit">
  31. <view class="name">原淑功</view>
  32. <view class="desc">您请求与王莹莹交换联系方式</view>
  33. </view>
  34. <view class="state">
  35. <view class="status_1">待处理</view>
  36. <view class="status_9">已同意</view>
  37. <view class="status_2">已拒绝</view>
  38. </view>
  39. </view>
  40. <view class="huifu">
  41. <view class="left">TA的微信号:lidahai</view>
  42. <view class="right">复制</view>
  43. </view>
  44. <view class="doit">
  45. <view class="btn1">拒绝</view>
  46. <view class="btn2">同意</view>
  47. </view>
  48. <view class="line"></view>
  49. </block>
  50. <view class="blankHeight"></view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. components: {},
  57. data() {
  58. return {
  59. tab: 1,
  60. list: [{
  61. name: '实名认证',
  62. 'desc': '',
  63. 'path': ''
  64. },
  65. {
  66. name: '修改密码',
  67. 'desc': '',
  68. 'path': ''
  69. },
  70. {
  71. name: '修改手机号',
  72. 'desc': '',
  73. 'path': ''
  74. },
  75. {
  76. name: '注销账号',
  77. 'desc': '',
  78. 'path': ''
  79. },
  80. {
  81. name: '青少年模式',
  82. 'switch': 1,
  83. 'desc': '',
  84. 'path': ''
  85. },
  86. {
  87. name: '客服热线',
  88. 'desc': '400-888-1688',
  89. 'path': ''
  90. }
  91. ]
  92. }
  93. },
  94. onLoad() {
  95. setTimeout(function() {
  96. uni.setNavigationBarColor({
  97. frontColor: '#ffffff',
  98. backgroundColor: '#00000000',
  99. animation: {
  100. duration: 400,
  101. timingFunc: 'easeIn'
  102. }
  103. })
  104. }, 200);
  105. },
  106. onShow() {
  107. this.loadData();
  108. },
  109. methods: {
  110. onBack() {},
  111. checkTab(tab) {
  112. this.tab = tab;
  113. // this.loadData();
  114. },
  115. loadData() {
  116. console.log("this.globalData", getApp().globalData);
  117. let obj2 = {
  118. is_first: 0
  119. }
  120. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  121. console.log(postData);
  122. uni.request({
  123. url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
  124. data: postData,
  125. method: 'POST',
  126. header: {
  127. 'content-type': 'application/json', //自定义请求头信息
  128. 'Access-Control-Allow-Origin': '*'
  129. },
  130. success: (res) => {
  131. console.log('data:', res.data);
  132. this.myinfo = res.data;
  133. }
  134. });
  135. },
  136. EditNickname() {
  137. let that = this;
  138. this.$refs['DialogBox'].confirm({
  139. title: '更改昵称',
  140. placeholder: '请输入修改的昵称',
  141. value: that.myinfo.nickname,
  142. DialogType: 'input',
  143. animation: 0
  144. }).then((res) => {
  145. if (res.value.length < 1) {
  146. uni.showToast({
  147. title: "请输入有效的昵称",
  148. icon: 'none'
  149. });
  150. return;
  151. }
  152. that.myinfo.nickname = res.value;
  153. let obj2 = {
  154. nickname: res.value
  155. }
  156. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  157. uni.request({
  158. url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
  159. data: postData,
  160. method: 'POST',
  161. header: {
  162. 'content-type': 'application/json', //自定义请求头信息
  163. 'Access-Control-Allow-Origin': '*'
  164. },
  165. success: (res) => {
  166. uni.showToast({
  167. title: res.data.str,
  168. icon: 'none'
  169. });
  170. }
  171. });
  172. })
  173. },
  174. }
  175. }
  176. </script>
  177. <style scoped lang="scss">
  178. @import 'tranWechat.scss';
  179. </style>