index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="" >
  3. <view v-for="(item,index) in serviceObjectList" @click="chooseServiceObject(item)" class="h-item-row">
  4. <view class="h-img">
  5. <image v-if="item.imgUrl" :src="item.imgUrl" mode=""></image>
  6. <image v-else src="../../static/logo.png" mode=""></image>
  7. </view>
  8. <view class="h-item-content">
  9. <view class="h-title">
  10. <view class="name">
  11. <text v-if="item.nickName">{{item.nickName}}</text>
  12. <text v-else>未填写</text>
  13. </view>
  14. </view>
  15. <view class="h-desc">
  16. <text>关系:{{item.blood}}</text>
  17. </view>
  18. <view class="h-content">
  19. <view class="h-text">
  20. 备注:<text v-if="item.remark">{{item.remark}}</text>
  21. <text v-else>无</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. serviceObjectList: [],
  33. reqParm: {
  34. auth: true
  35. },
  36. }
  37. },
  38. onLoad(query){
  39. // 查询服务对象列表
  40. this.listServiceObject();
  41. },
  42. methods: {
  43. // 查询服务对接信息列表
  44. listServiceObject(){
  45. this.$api.listServiceObject(this.reqParm).then((res)=>{
  46. console.log('++++++++++listServiceObject+++++++++++',res)
  47. this.getImgUrlByOssId(res.data.data);
  48. }).catch(() =>{
  49. uni.showToast({
  50. title: "操作失败"
  51. })
  52. });
  53. },
  54. // 获取图片
  55. getImgUrlByOssId(data){
  56. for (let i = 0; i < data.length; i++) {
  57. const item = data[i];
  58. if (item.facePhoto){
  59. this.$api.getImgUrlByOssId({ossId:item.facePhoto}).then(res=>{
  60. console.log('+++++++++++++getImgUrlByOssId+++++++++++++++',res)
  61. })
  62. }
  63. }
  64. this.serviceObjectList = data
  65. },
  66. // 选择服务老师
  67. chooseServiceObject(item){
  68. uni.navigateBack({
  69. delta: 1,
  70. success: function(res) {
  71. uni.$emit('selectedServiceObject', item);
  72. }
  73. });
  74. }
  75. },
  76. };
  77. </script>
  78. <style scoped lang="scss">
  79. .h-item-row{
  80. display: flex;
  81. font-family: PingFangSC-Medium, PingFang SC;
  82. margin: 12px;
  83. background: #fff;
  84. padding: 12px;
  85. .h-img{
  86. margin-right: 8px;
  87. display: flex;
  88. align-items: center;
  89. image{
  90. height: 80px;
  91. width: 80px;
  92. }
  93. }
  94. .h-item-content{
  95. .h-title{
  96. font-size: 16px;
  97. font-weight: 500;
  98. line-height: 30px;
  99. display: flex;
  100. .name{
  101. padding-right: 6px;
  102. color: #111111;
  103. }
  104. .btn text{
  105. background: #fff5d0;
  106. color: #333333;
  107. font-size: 12px;
  108. border: 1px solid #FFE05C;
  109. padding-left: 10px;
  110. padding-right: 10px;
  111. }
  112. }
  113. .h-desc{
  114. font-size: 12px;
  115. font-weight: 400;
  116. color: #999999;
  117. line-height: 25px;
  118. }
  119. .h-content{
  120. display: flex;
  121. align-items: center;
  122. font-size: 12px;
  123. font-weight: 400;
  124. line-height: 25px;
  125. .h-text{
  126. padding-left: 4px;
  127. color: #999999;
  128. }
  129. .h-text1{
  130. color: #ED569F;
  131. }
  132. }
  133. }
  134. }
  135. </style>