bindIndex.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="container">
  3. <view class="app-body">
  4. <!--关键词搜索-->
  5. <view class="sreach fx-r fx-bc fx-ac">
  6. <image class="icon" src="/static/img/tb-seach.png"></image>
  7. <input type="text" v-model="uid" placeholder="请输入用户UID" placeholder-style="color: #B3B3B3;" />
  8. <view class="fx-g1"></view>
  9. <view class="search-btn" @tap="tapSerach">搜索</view>
  10. </view>
  11. </view>
  12. <!-- #ifdef APP-PLUS -->
  13. <scroll-view scroll-y class="scroll" style="height: calc(100vh - 150px)"
  14. @scrolltolower="loadMoreData">
  15. <!-- #endif -->
  16. <!-- #ifdef H5 -->
  17. <scroll-view scroll-y class="scroll" style="height: calc(100vh - 190px)"
  18. @scrolltolower="loadMoreData">
  19. <!-- #endif -->
  20. <view class="sc-body">
  21. <view class="item flex" v-for="(item,index) in listAr" :key="index">
  22. <view class="itemTpl">
  23. <view class="tpl"><text>归属馆:</text>{{item.gz_name}}</view>
  24. <view class="tpl"><text>ID号1:</text>{{item.u1_uid}}<text style="padding-left: 25rpx;">手机号1:</text>{{item.u1_mobile}}</view>
  25. <view class="tpl"><text>ID号2:</text>{{item.u2_uid}}<text style="padding-left: 25rpx;">手机号3:</text>{{item.u2_mobile}}</view>
  26. </view>
  27. <view class="imageBox">
  28. <image src="../../static/image/img18.png" style="width: 42rpx;height: 42rpx;"></image>
  29. <view class="delBtn" @tap="delBind(item.id)">解绑</view>
  30. </view>
  31. </view>
  32. <view v-if="listAr.length > 0">
  33. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  34. <image src="/static/img/xloading.png"></image>
  35. <text>正在载入更多...</text>
  36. </view>
  37. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  38. </view>
  39. <view v-if="listAr.length == 0 && isFirst">
  40. <uv-empty mode="data" icon="/static/img/no-empty.png"></uv-empty>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. <view class="addBtn" @tap="addBind()">+添加互助</view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return{
  51. listAr:[],
  52. isFirst: false,
  53. page: {
  54. isFirst: false,
  55. isLoad: false,
  56. isFoot: false,
  57. page: 1
  58. },
  59. uid:'',//
  60. };
  61. },
  62. onShow() {
  63. this.getList(true)
  64. },
  65. methods: {
  66. tapSerach: function() {
  67. this.getList(true);
  68. },
  69. addBind(){
  70. uni.navigateTo({
  71. url:'/pages/gz/addBind'
  72. })
  73. },
  74. delBind(id){
  75. let obj = this
  76. uni.showModal({
  77. title: '提示',
  78. content: '你确定要解绑吗?',
  79. success: function (res) {
  80. if (res.confirm) {
  81. uni.showLoading({
  82. title: '解绑中..'
  83. });
  84. obj.request.post("unbind",{
  85. id:id,
  86. }).then(res => {
  87. uni.hideLoading();
  88. uni.showModal({
  89. title: '系统提示',
  90. content: res.msg,
  91. showCancel: false
  92. });
  93. obj.getList(true)
  94. }).catch(res=>{
  95. console.log(res,'99999')
  96. uni.hideLoading();
  97. uni.showModal({
  98. title: '系统提示',
  99. content: res,
  100. showCancel: false
  101. });
  102. });
  103. } else if (res.cancel) {
  104. console.log('用户点击取消');
  105. }
  106. }
  107. });
  108. },
  109. getList(isPull = false){
  110. if (this.page.isLoad) return;
  111. this.page.isLoad = true;
  112. if (isPull) {
  113. this.page.page = 1;
  114. this.page.isLoad = false;
  115. this.page.isFoot = false;
  116. }
  117. uni.showLoading({
  118. title: '获取数据中..'
  119. });
  120. this.request.post("bindList",{
  121. uid:this.uid,//手机号
  122. page: this.page.page,
  123. }).then(res => {
  124. uni.hideLoading();
  125. this.page.isFirst = true;
  126. this.page.isLoad = false;
  127. this.isFirst = true;
  128. if (isPull) {
  129. this.listAr = res.data.list;
  130. } else {
  131. this.listAr = this.listAr.concat(res.data.list);
  132. }
  133. //是否到底
  134. if (res.data.list.length != res.data.pageSize) {
  135. this.page.isFoot = true;
  136. }
  137. }).catch(res=>{
  138. console.log(res);
  139. uni.hideLoading();
  140. uni.showModal({
  141. title: '系统提示',
  142. content: '加载失败,返回在尝试',
  143. showCancel: false
  144. });
  145. });
  146. },
  147. loadMoreData() {
  148. if (this.page.isFoot || this.page.isLoad) {
  149. return;
  150. }
  151. this.page.page++;
  152. this.getList();
  153. },
  154. },
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .addBtn{
  159. position: fixed;
  160. background: linear-gradient(89deg, #FF332C, #FF6030);
  161. border-radius: 10rpx;
  162. bottom: 25rpx;
  163. width: 90%;
  164. line-height: 80rpx;
  165. font-weight: bold;
  166. font-size: 29rpx;
  167. color: #FFFFFF;
  168. margin: 0 5%;
  169. text-align: center;
  170. }
  171. .flex {
  172. display: flex;
  173. align-items: center;
  174. justify-content: space-between;
  175. }
  176. .flex_item {
  177. display: flex;
  178. align-items: center;
  179. }
  180. .app-body {
  181. padding: 20px 20rpx;
  182. background: #fff;
  183. .sreach {
  184. background: #eee;
  185. border-radius: 32rpx;
  186. padding: 16rpx 32rpx;
  187. .icon {
  188. width: 46rpx;
  189. height: 46rpx;
  190. }
  191. input {
  192. width: calc(100% - 46rpx - 16rpx - 50px);
  193. font-size: 16px;
  194. }
  195. .search-btn {
  196. font-size: 14px;
  197. color: #FF4C4C;
  198. }
  199. }
  200. }
  201. .sc-body{
  202. padding: 25rpx 25rpx;
  203. .item{
  204. padding: 34rpx 30rpx 14rpx 30rpx;
  205. background: #fff;
  206. border-radius: 25rpx;
  207. margin-bottom: 25rpx;
  208. box-shadow: 0rpx 3rpx 3rpx 0rpx rgba(39,39,39,0.09);
  209. align-items: center;
  210. .itemTpl{
  211. .tpl{
  212. padding-bottom: 20rpx;
  213. font-size: 30rpx;
  214. text{
  215. font-weight: 500;
  216. color: #666666;
  217. }
  218. }
  219. }
  220. .imageBox{
  221. text-align: center;
  222. border-radius: 10rpx;
  223. border: 2rpx solid #FF332C;
  224. padding: 10rpx 15rpx;
  225. .delBtn{
  226. font-weight: bold;
  227. font-size: 28rpx;
  228. color: #FFFFFF;
  229. background: linear-gradient(89deg, #FF332C 31.34765625%, #FF6030 86.865234375%);
  230. -webkit-background-clip: text;
  231. -webkit-text-fill-color: transparent;
  232. }
  233. }
  234. }
  235. }
  236. </style>