123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <template>
- <view class="footList">
- <view class="tips">
- 提示:号码很火哦,下单太慢可能会被别人捡走
- </view>
- <view class="list">
- <view class="li" v-for="(item,index) in boxList" :key="index" @tap="ListClick(item.mobile_id)">
- <view class="number">{{item.no}}</view>
- <view class="Operator">{{item.brand}} {{item.city}}</view>
- <view class="money">¥{{item.amount}}</view>
- <view class="btn" @tap.stop="deleteMet(item.mobile_user_history_id)">删除</view>
- </view>
-
- <u-loadmore :status="status" />
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: 15,
- page: 1,
- boxList:[],
- status: 'loadmore',
- }
- },
- onReachBottom() {
- // 下拉加载
- this.status = 'loading';
- this.page = ++ this.page;
- let obj={
- page:this.page,
- limit:this.list,
- }
- this.$http.history(obj).then(res=>{
- // console.log(res)
- if(res.data.code==1){
- if(obj.page<res.data.data.per_page || obj.page == res.data.data.per_page){
- let arr=this.boxList.concat(res.data.data.data)
- this.boxList=arr;
- console.log(this.boxList)
- }
- this.status = 'nomore'
- }else{
- this.status = 'nomore'
- }
- })
- },
- onLoad() {
- this.listMet()
- },
- methods: {
- // 号码详情
- ListClick(id){
- console.log(id)
- uni.navigateTo({
- url: '/pageA/order/order?id='+id,
- })
- },
- listMet(){
- let obj={
- page:this.page,
- limit:this.list,
- }
- this.$http.history(obj).then(res=>{
- console.log(res)
- if(res.data.code==1){
- this.boxList=res.data.data.data
- if(res.data.data.total<this.list){
- this.status = 'nomore'
- }
- }
- })
- },
- deleteMet(id){
- this.$http.delete({id:id})
- .then(res=>{
- console.log(res)
- if(res.data.code==1){
- uni.showToast({
- title: '删除成功',
- duration: 2000
- });
- this.page==1
- this.listMet()
- }else{
- uni.showToast({
- title: res.data.msg,
- duration: 2000,
- icon: 'none'
- });
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- background-color: #F1F1F1;
- }
- .footList{
- .tips{
- background-color: #FF9D50;
- padding: 8rpx 0;
- font-size: 24rpx;
- text-align: center;
- }
- .list{
- margin-top: 20rpx;
- .li{
- position: relative;
- box-sizing: border-box;
- padding: 20rpx;
- background-color: #fff;
- margin-bottom: 20rpx;
- box-shadow: 0rpx 2rpx 8rpx #f1f2fb;
- .number{
- font-size: 30rpx;
- font-weight: 700;
- }
- .Operator{
- font-size: 24rpx;
- color: #696969;
- margin-top: 20rpx;
- }
- .money{
- position: absolute;
- right: 200rpx;
- top: 50%;
- transform: translateY(-50%);
- font-size: 32rpx;
- font-weight: 700;
- }
- .btn{
- position: absolute;
- font-size: 24rpx;
- padding: 10rpx 30rpx;
- border-radius: 6rpx;
- right: 20rpx;
- top: 50%;
- transform: translateY(-50%);
- border: 1rpx solid #484848;
- }
- }
- }
- }
- </style>
|