operator.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="back">
  3. <view class="operatorList" v-for="item in operators" :key="item.number" @tap="showDetail"
  4. :data-code="item.code">
  5. <image class="image1" src="../../static/运营商管理/1@3x.png"></image>
  6. <text style="margin-top: 38rpx;margin-left: 30rpx; width: 500rpx;">{{item.name}}</text>
  7. <image class="image2" src="../../static/运营商管理/ico2@3x.png"></image>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. operators: [],
  16. }
  17. },
  18. onLoad(e) {
  19. this.list(e)
  20. uni.$on('flush', () => {
  21. this.list(e)
  22. })
  23. },
  24. methods: {
  25. async list(e) {
  26. let vm = this;
  27. let url = uni.$api.operator.list;
  28. let res = await uni.$http.get(url);
  29. console.log('form发生了submit事件')
  30. console.log(res);
  31. this.operators = res.data.data.operators;
  32. console.log(res.data.data.operators);
  33. },
  34. showDetail(e) {
  35. console.log(e);
  36. var code = e.currentTarget.dataset.code;
  37. uni.navigateTo({
  38. url: '/pages/operator/operatorInfo/operatorInfo?code=' + code,
  39. });
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .operatorList {
  46. display: flex;
  47. flex-direction: row;
  48. height: 125rpx;
  49. background-color: white;
  50. margin-top: 30rpx;
  51. width: 704rpx;
  52. margin-left: 23rpx;
  53. border-radius: 10rpx;
  54. }
  55. .image1 {
  56. width: 90rpx;
  57. height: 90rpx;
  58. margin-top: 20rpx;
  59. margin-left: 20rpx;
  60. }
  61. .image2 {
  62. width: 10px;
  63. height: 10px;
  64. margin-top: 50rpx;
  65. // margin-left: 400rpx;
  66. }
  67. .back {
  68. background-color: aliceblue;
  69. width: 100%;
  70. height: 100%;
  71. }
  72. </style>