operator.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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() {
  19. uni.request({
  20. url: 'http://127.0.0.1:9999/operator/list',
  21. method: 'GET',
  22. data: {},
  23. success: res => {
  24. this.operators = res.data.data.operators;
  25. console.log(res.data.data.operators);
  26. },
  27. })
  28. },
  29. methods: {
  30. showDetail(e) {
  31. console.log(e);
  32. var code = e.currentTarget.dataset.code;
  33. uni.navigateTo({
  34. url: '/pages/operator/operatorInfo/operatorInfo?code=' + code,
  35. });
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .operatorList {
  42. display: flex;
  43. flex-direction: row;
  44. height: 125rpx;
  45. background-color: white;
  46. margin-top: 30rpx;
  47. width: 704rpx;
  48. margin-left: 23rpx;
  49. border-radius: 10rpx;
  50. }
  51. .image1 {
  52. width: 90rpx;
  53. height: 90rpx;
  54. margin-top: 20rpx;
  55. margin-left: 20rpx;
  56. }
  57. .image2 {
  58. width: 10px;
  59. height: 10px;
  60. margin-top: 50rpx;
  61. // margin-left: 400rpx;
  62. }
  63. .back {
  64. background-color: aliceblue;
  65. width: 100%;
  66. height: 100%;
  67. }
  68. </style>