recycle.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="app">
  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="keyword" placeholder="请输入用户昵称/用户ID" placeholder-style="color: #B3B3B3;" />
  8. <view class="fx-g1"></view>
  9. <view class="search-btn" @tap="tapSerach">搜索</view>
  10. </view>
  11. </view>
  12. <scroll-view scroll-y class="scroll" :style="'height: calc(100vh - ' + hFoot + 'px - 60px);'" @scrolltolower="loadMoreData">
  13. <view class="sc-body">
  14. <view class="item" v-for="item in listAr">
  15. <view class="info fx-r">
  16. <view class="nickname">{{ item.nickname }}</view>
  17. <view class="fx-r fx-bc" @tap="tapCall(item.mobile)">
  18. <view class="mobile">{{ item.mobile }}</view>
  19. <image src="/static/img/call-tel.png" style="width: 15px;height: 15px;margin-left: 5px;"></image>
  20. </view>
  21. <view class="fx-g1"></view>
  22. <view style="font-size: 12px;color: #2EC551">已回收</view>
  23. </view>
  24. <view class="info fx-r">
  25. <view class="id">ID号:{{ item.uid }}</view>
  26. <view class="fx-g1"></view>
  27. <view class="changci">订单编号:{{ item.order_id }}</view>
  28. </view>
  29. <view class="infos fx-r">
  30. <view class="time">订单价格:<text style="color: red;">{{ item.price }}</text></view>
  31. </view>
  32. </view>
  33. <view v-if="listAr.length > 0">
  34. <view class="loading fx-r fx-ac fx-bc" v-if="page.isFrite && !page.isFoot">
  35. <image src="/static/img/xloading.png"></image>
  36. <text>正在载入更多...</text>
  37. </view>
  38. <view class="loading complete" :hidden="!page.isFoot">已加载全部</view>
  39. </view>
  40. <view v-if="listAr.length == 0 && isFirst">
  41. <u-empty
  42. mode="data"
  43. icon="/static/img/no-empty.png"
  44. ></u-empty>
  45. </view>
  46. </view>
  47. </scroll-view>
  48. </view>
  49. </template>
  50. <script>
  51. import {mapState,mapMutations } from 'vuex';
  52. export default {
  53. computed: mapState(['user']),
  54. data() {
  55. return {
  56. isFirst:false,
  57. listAr:[],
  58. keyword : "",
  59. id : 0,
  60. hFoot : 0,
  61. page:{
  62. isFirst:false,
  63. isLoad:false,
  64. isFoot:false,
  65. page:1
  66. },
  67. }
  68. },
  69. onLoad(options) {
  70. this.id = options.id || 0;
  71. this.initView();
  72. // #ifdef H5
  73. this.hFoot = 60;
  74. // #endif
  75. },
  76. methods: {
  77. ...mapMutations(['checkUserLogin']),
  78. /**
  79. * 加载基础配置
  80. */
  81. initView:function(){
  82. this.getData(true);
  83. },
  84. /**
  85. * 获取数据
  86. */
  87. getData:function(isPull = false){
  88. if(this.page.isLoad) return;
  89. this.page.isLoad = true;
  90. if(isPull) {
  91. this.page.page = 1;
  92. this.page.isLoad = false;
  93. this.page.isFoot = false;
  94. }
  95. uni.showLoading({ title: '获取数据中..' });
  96. var post = {};
  97. post.page = this.page.page;
  98. this
  99. .request
  100. .post("auctionrecycleLog",{
  101. keyword : this.keyword,
  102. page : this.page.page
  103. })
  104. .then(res => {
  105. uni.hideLoading();
  106. this.page.isFirst = true;
  107. this.page.isLoad = false;
  108. this.isFirst = true;
  109. if(isPull) {
  110. this.listAr = res.data.list;
  111. } else {
  112. this.listAr = this.listAr.concat(res.data.list);
  113. }
  114. //是否到底
  115. if(res.data.list.length != res.data.pageSize) {
  116. this.page.isFoot = true;
  117. }
  118. })
  119. .catch((res)=>{
  120. console.log(res);
  121. uni.hideLoading();
  122. uni.showModal({title: '系统提示',content: '加载失败,返回在尝试',showCancel: false});
  123. });
  124. },
  125. tapSerach:function(){
  126. this.getData(true);
  127. },
  128. loadMoreData:function() {
  129. if(this.page.isFoot || this.page.isLoad) {
  130. return;
  131. }
  132. this.page.page ++;
  133. this.getData();
  134. },
  135. tapCall:function(tel){
  136. if(tel == null) {
  137. this.utils.showAlert({
  138. title:"系统提示",
  139. content:"暂无联系方式"
  140. });
  141. return;
  142. }
  143. const info = uni.getSystemInfoSync();
  144. if(info.platform == 'android'){
  145. uni.showModal({
  146. content: "确认拨打" + tel,
  147. confirmText: "确定",
  148. cancelText: "取消",
  149. success:function(res){
  150. if(res.confirm){
  151. this.$store.dispatch('permission/requestPermissions', 'CALL_PHONE').then(res => {
  152. if(res !== 1) return;
  153. uni.makePhoneCall({
  154. phoneNumber: tel,
  155. });
  156. });
  157. }
  158. }
  159. });
  160. } else {
  161. uni.makePhoneCall({
  162. phoneNumber: tel
  163. });
  164. }
  165. }
  166. },
  167. }
  168. </script>
  169. <style lang="scss">
  170. .app-body{
  171. padding: 0px 20rpx;
  172. }
  173. .sreach{
  174. background: #fff;
  175. margin:20rpx 0;
  176. border-radius: 32rpx;
  177. padding: 16rpx 32rpx;
  178. .icon{
  179. width: 46rpx;
  180. height: 46rpx;
  181. }
  182. input{
  183. width: calc(100% - 46rpx - 16rpx - 50px);
  184. font-size: 16px;
  185. }
  186. .search-btn{
  187. font-size: 14px;
  188. color: #FF4C4C;
  189. }
  190. }
  191. .sc-body{
  192. padding: 20rpx;
  193. .item{
  194. background: #FFFFFF;
  195. border-radius: 16rpx;
  196. padding: 26rpx 44rpx;
  197. margin-bottom: 10px;
  198. .info{
  199. margin-bottom: 10rpx;
  200. .nickname{
  201. font-weight: bold;
  202. font-size: 32rpx;
  203. color: #303133;
  204. }
  205. .mobile{
  206. font-weight: 500;
  207. font-size: 30rpx;
  208. color: #999999;
  209. margin-left: 10px;
  210. }
  211. .id{
  212. font-weight: 500;
  213. font-size: 26rpx;
  214. color: #666666;
  215. }
  216. .changci{
  217. font-weight: 500;
  218. font-size: 26rpx;
  219. color: #666666;
  220. text{
  221. color: #333333;
  222. }
  223. }
  224. }
  225. .infos{
  226. margin-top: 10px;
  227. border-top: 1px solid #f1f1f1;
  228. padding-top: 6px;
  229. .time{
  230. font-size: 14px;
  231. color: #666;
  232. }
  233. }
  234. }
  235. }
  236. </style>