operator.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. realname: '',
  16. operators: [],
  17. }
  18. },
  19. onLoad(e) {
  20. this.list(e)
  21. uni.getStorage({
  22. key: 'realname',
  23. success: function(res) {
  24. console.log(res.data);
  25. this.realname = res.data
  26. if (this.realname == '') {
  27. uni.navigateTo({
  28. url: '/pages/login/login',
  29. });
  30. console.log("未找到用户,请登录");
  31. }
  32. }
  33. })
  34. uni.$on('flush', () => {
  35. this.list(e)
  36. })
  37. },
  38. methods: {
  39. async list(e) {
  40. let vm = this;
  41. let url = uni.$api.operator.list;
  42. let res = await uni.$http.get(url);
  43. console.log('form发生了submit事件')
  44. console.log(res);
  45. this.operators = res.data.data.operators;
  46. console.log(res.data.data.operators);
  47. },
  48. showDetail(e) {
  49. console.log(e);
  50. var code = e.currentTarget.dataset.code;
  51. uni.navigateTo({
  52. url: '/pages/operator/operatorInfo/operatorInfo?code=' + code,
  53. });
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .operatorList {
  60. display: flex;
  61. flex-direction: row;
  62. height: 125rpx;
  63. background-color: white;
  64. margin-top: 30rpx;
  65. width: 704rpx;
  66. margin-left: 23rpx;
  67. border-radius: 10rpx;
  68. }
  69. .image1 {
  70. width: 90rpx;
  71. height: 90rpx;
  72. margin-top: 20rpx;
  73. margin-left: 20rpx;
  74. }
  75. .image2 {
  76. width: 10px;
  77. height: 10px;
  78. margin-top: 50rpx;
  79. // margin-left: 400rpx;
  80. }
  81. .back {
  82. background-color: aliceblue;
  83. width: 100%;
  84. height: 100%;
  85. }
  86. </style>