phoneList.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="box">
  3. <view class="main">
  4. <view class="phoneListBox">
  5. <view class="phoneLine" v-for="(item,index) in phoneList" @click="lineClick(item)">
  6. <view class="phoneLeft">
  7. <view class="name">{{item.name}}</view>
  8. <view class="phoneNUm">{{item.phone}}</view>
  9. <view class="default" v-show="item.isDefault==1">默认</view>
  10. </view>
  11. <view @click.stop="edit(item)">
  12. <image src="../../static/img/icon_edit.png" mode="aspectFit" class="phoneEdit"></image>
  13. </view>
  14. </view>
  15. <view class="phoneLine" style="border: none;" @click="goadd">
  16. <view class="addTxt">新增联系人</view>
  17. <view class="addjt">></view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. page:1,
  28. phoneList:[],
  29. }
  30. },
  31. onLoad() {
  32. },
  33. onShow() {
  34. this.page=1;
  35. this.phoneList=[];
  36. this.getList()
  37. },
  38. methods: {
  39. lineClick(item){
  40. console.log(item);
  41. uni.setStorage({
  42. key: 'phoneData',
  43. data: item,
  44. success: function () {
  45. uni.navigateBack({
  46. delta:1
  47. })
  48. }
  49. });
  50. },
  51. getList(){
  52. uni.showLoading({ });
  53. this.$http('miniAppMyBMemberCar/listBMemberContactPage', {
  54. page:this.page,
  55. limit:10,
  56. },'GET').then(res => {
  57. uni.hideLoading();
  58. var a=res.data.Items
  59. this.phoneList=this.phoneList.concat(a);
  60. })
  61. },
  62. goadd(){
  63. uni.navigateTo({
  64. url:'addphone'
  65. })
  66. },
  67. edit(item){
  68. item=JSON.stringify(item)
  69. uni.navigateTo({
  70. url:'addphone?item='+item
  71. })
  72. },
  73. }
  74. }
  75. </script>
  76. <style scoped>
  77. .box{
  78. min-height: 100vh;
  79. background:#F4F5F7 ;
  80. }
  81. .main{
  82. padding: 24rpx;
  83. }
  84. .phoneListBox{
  85. background: #FFFFFF;
  86. border-radius: 10rpx;
  87. padding: 0 24rpx;
  88. }
  89. .phoneLine{
  90. display: flex;
  91. justify-content: space-between;
  92. padding: 30rpx;
  93. border-bottom: 1px solid #DDDDDD;
  94. }
  95. .phoneEdit{
  96. width: 40rpx;
  97. height: 40rpx;
  98. }
  99. .name{
  100. font-size: 28rpx;
  101. font-family: PingFangSC-Medium, PingFang SC;
  102. font-weight: 500;
  103. color: #3C3C3C;
  104. width: 200rpx;
  105. }
  106. .phoneNUm{
  107. font-size: 28rpx;
  108. font-family: PingFangSC-Regular, PingFang SC;
  109. font-weight: 400;
  110. color: #3C3C3C;
  111. }
  112. .phoneLeft{
  113. display: flex;
  114. }
  115. .default{
  116. width: 64rpx;
  117. height: 30rpx;
  118. background: rgba(255, 79, 0, 0.06);
  119. border-radius: 4rpx;
  120. text-align: center;line-height: 30rpx;
  121. color: #FF4F00;font-size: 22rpx;
  122. margin-left: 30rpx;margin-top: 4rpx;
  123. }
  124. .addTxt{
  125. color: #FF4F00;
  126. font-size: 30rpx;
  127. }
  128. .addjt{
  129. color: #CCCCCC;
  130. font-size: 30rpx;
  131. }
  132. </style>