data.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="main main-bg">
  3. <view class="main-list">
  4. <view class="list-left font-color3 font-thirty-two">姓名</view>
  5. <view class="list-right font-color2 font-thirty-two">{{ list.veteransName ? list.veteransName : '' }}</view>
  6. </view>
  7. <view class="main-list">
  8. <view class="list-left font-color3 font-thirty-two">身份证号码</view>
  9. <view class="list-right font-color2 font-thirty-two">{{ list.veteransIdcard ? change(list.veteransIdcard) : '' }}</view>
  10. </view>
  11. <view class="main-list">
  12. <view class="list-left font-color3 font-thirty-two">电话</view>
  13. <view class="list-right font-color2 font-thirty-two">{{ list.veteransTel ? changeTel(list.veteransTel) : '' }}</view>
  14. </view>
  15. <!-- <view class="main-list">
  16. <view class="list-left font-color3 font-thirty-two">军人等级</view>
  17. <view class="list-right font-color2 font-thirty-two">{{ list.level ? list.level : '' }}</view>
  18. </view> -->
  19. <view class="footer">
  20. <view class="left header-long-bg font-color1 font-thirty" @click="gotoshop">惠军购</view>
  21. <view class="right font-color2 font-thirty" @click="goto">返回店铺</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import server from "@/api/index";
  27. export default {
  28. data() {
  29. return {
  30. list:{},
  31. userId: null,
  32. type: null
  33. };
  34. },
  35. onLoad(e) {
  36. this.userId = e.money;
  37. this.type = e.id;
  38. this.getInfoFn(e.money, e.id);
  39. },
  40. methods:{
  41. getInfoFn(id, type){
  42. server.getRegister(id, type).then(res =>{
  43. this.list = res
  44. })
  45. },
  46. change(name){
  47. let mystr = name.substring(0,6)+'****'+name.substring(10);
  48. return mystr
  49. },
  50. changeTel(name){
  51. let mystr = name.substring(0,3)+'****'+name.substring(7);
  52. return mystr
  53. },
  54. goto(){
  55. uni.reLaunch({
  56. url: '/pages/index/index'
  57. })
  58. },
  59. gotoshop(){
  60. console.log(this.userId, this.type, this.list.veteransName)
  61. uni.navigateTo({
  62. url: '/pages/merchant/home/shop?userId=' + this.userId + '&type=' + this.type + '&veteransName=' + this.list.veteransName
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .main{
  70. width: 100%;
  71. height: auto;
  72. min-height: 100vh;
  73. padding: 30rpx;
  74. .main-list{
  75. width: 100%;
  76. height: 102rpx;
  77. line-height: 102rpx;
  78. padding-left: 30rpx;
  79. padding-right: 30rpx;
  80. display: flex;
  81. justify-content: space-between;
  82. background: #fff;
  83. border-radius: 24rpx;
  84. margin-bottom: 30rpx;
  85. .list-right{
  86. font-weight: 600;
  87. }
  88. }
  89. .footer{
  90. width: 100%;
  91. height: 125rpx;
  92. background: #FFFFFF;
  93. position: fixed;
  94. left: 0rpx;
  95. bottom: 0rpx;
  96. padding: 14rpx 30rpx;
  97. display: flex;
  98. justify-content: space-between;
  99. .left{
  100. width: 330rpx;
  101. height: 96rpx;
  102. line-height: 96rpx;
  103. border-radius: 48rpx;
  104. text-align: center;
  105. }
  106. .right{
  107. width: 330rpx;
  108. height: 96rpx;
  109. line-height: 96rpx;
  110. border-radius: 48rpx;
  111. text-align: center;
  112. border: 4rpx solid #2E4F1C;
  113. }
  114. }
  115. }
  116. </style>