球星卡微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.5 KiB

4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view class="flex-col page">
  3. <view class="flex-col section_2">
  4. <view class="flex-col section_3">
  5. <view class="justify-between search">
  6. <u-input class="search-input" v-model="value" :focus="inputFocus" @focus="focusEvent" @blur="blurEvent" placeholder="请输入评级编号" border="surround" :clearable="true" ></u-input>
  7. <view class="flex-col items-center text-wrapper" @click="search">
  8. <text>搜索</text>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import { ratingSearch } from '@/service/grading.js';
  17. export default {
  18. data() {
  19. return {
  20. value: '',
  21. inputFocus: true
  22. };
  23. },
  24. methods: {
  25. async search(){
  26. if(!this.value) return this.$msg('请输入评级编号');
  27. let userInfo = uni.getStorageSync('userInfo') || {};
  28. if(!this.$isRight(userInfo)){
  29. return this.$url('/pages/login/login')
  30. }
  31. let res = await ratingSearch(this.value);
  32. let datas = res.data.datas;
  33. if(this.$isRight(datas.sub_order)){ // 查询到订单,默认取第一条
  34. let base_data = encodeURIComponent(JSON.stringify(datas));
  35. this.$url('/packages/ratingQueryDetail/ratingQueryDetail?data='+ base_data);
  36. }else{
  37. uni.showModal({
  38. title: '提示',
  39. content: '该评级编号暂无订单,换个编号试试?',
  40. showCancel: false
  41. })
  42. }
  43. },
  44. focusEvent(){
  45. this.inputFocus = true;
  46. },
  47. blurEvent(){
  48. this.inputFocus = false;
  49. }
  50. }
  51. };
  52. </script>
  53. <style scoped lang="css">
  54. .page {
  55. background-color: #f6f6f6;
  56. width: 100%;
  57. overflow-y: auto;
  58. height: 100%;
  59. }
  60. .search-input{
  61. width: 492rpx;
  62. height: 84rpx;
  63. }
  64. .section_2 {
  65. padding: 32rpx 32rpx 16rpx;
  66. flex: 1 1 auto;
  67. background-color: rgb(255, 255, 255);
  68. overflow-y: auto;
  69. }
  70. .section_3 {
  71. padding: 6rpx 0;
  72. background-color: rgb(246, 246, 246);
  73. border-radius: 10rpx;
  74. }
  75. .search {
  76. margin-left: 31rpx;
  77. margin-right: 6rpx;
  78. }
  79. .group_4 {
  80. align-self: center;
  81. color: rgb(195, 195, 195);
  82. font-size: 28rpx;
  83. font-weight: 500;
  84. line-height: 40rpx;
  85. white-space: nowrap;
  86. }
  87. .text-wrapper {
  88. padding: 20rpx 0;
  89. color: rgb(255, 255, 255);
  90. font-size: 32rpx;
  91. font-weight: 500;
  92. line-height: 44rpx;
  93. white-space: nowrap;
  94. background-color: rgb(231, 162, 63);
  95. border-radius: 6rpx;
  96. width: 130rpx;
  97. height: 84rpx;
  98. }
  99. .image_6 {
  100. margin-bottom: 4rpx;
  101. width: 37rpx;
  102. height: 34rpx;
  103. }
  104. .text_2 {
  105. margin-left: 10rpx;
  106. }
  107. </style>