leDouQuery.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="query-content">
  3. <view class="query-input">
  4. <u-input v-model="queryWord" :border="true" :maxlength="11" placeholder="请输入完整手机号码查询" type="number"/>
  5. <view class="query-button">
  6. <u-button shape="circle" @click="queryData" type="primary">查询</u-button>
  7. </view>
  8. </view>
  9. <view class="query-result">
  10. <u-gap height="20" bg-color="#f8f8f8"></u-gap>
  11. <view class="result-list" v-if="result">
  12. <view class="result-title">
  13. <view>
  14. <u-icon name="account-fill" color="#666" size="28"></u-icon>
  15. <text>{{result.customerRoleDictValue}}</text>
  16. </view>
  17. <view v-if="result.customerRole == 1">
  18. <u-button @click="hexiao" type="warning" size="mini">乐豆核销</u-button>
  19. </view>
  20. </view>
  21. <view class="result-info">
  22. <u-cell-group>
  23. <u-cell-item :arrow="false" title="注册时间" :value="result.registerTime"></u-cell-item>
  24. <u-cell-item :arrow="false" title="用户手机" :value="result.mobile"></u-cell-item>
  25. <u-cell-item :arrow="false" title="乐豆余额" :value-style="{color:'red'}" :value="result.currentGold||'0'">
  26. </u-cell-item>
  27. </u-cell-group>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { queryldByMobile } from '@/api/officialPartnerGoldLog.js'
  35. export default{
  36. data() {
  37. return {
  38. queryWord: '',
  39. result: null
  40. }
  41. },
  42. methods: {
  43. queryData(){
  44. if(this.queryWord.length == 11){
  45. queryldByMobile({mobile:this.queryWord}).then(res => {
  46. console.log(res)
  47. if(res.status == 200){
  48. this.result = res.data
  49. }
  50. })
  51. }else{
  52. uni.showToast({
  53. icon: 'none',
  54. title: '请输入手机号码'
  55. })
  56. }
  57. },
  58. hexiao() {
  59. // if(this.result.currentGold>0){
  60. uni.navigateTo({
  61. url: "/pages/ledouHexiao/ledouHexiao?item="+ encodeURIComponent(JSON.stringify(this.result))
  62. })
  63. // }else{
  64. // uni.showToast({
  65. // icon: 'none',
  66. // title: '此用户的乐豆余额为0'
  67. // })
  68. // }
  69. }
  70. },
  71. }
  72. </script>
  73. <style lang="less">
  74. .query-content{
  75. width: 100%;
  76. display: flex;
  77. flex-direction: column;
  78. .query-input{
  79. padding: 20rpx 60rpx;
  80. background: #FFFFFF;
  81. }
  82. .query-button{
  83. padding: 20rpx 0;
  84. }
  85. .query-result{
  86. flex-grow: 1;
  87. }
  88. .result-title{
  89. display: flex;
  90. align-items: center;
  91. justify-content: space-between;
  92. background: #fff;
  93. padding: 25rpx 30rpx;
  94. border-bottom: 1rpx solid #eee;
  95. }
  96. }
  97. </style>