index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. import {listServiceObject} from '/src/api/object/service-object.js';
  30. export default {
  31. data() {
  32. return {
  33. serviceObjectList: [],
  34. reqParm: {
  35. auth: true
  36. },
  37. }
  38. },
  39. onLoad(query){
  40. // 查询服务对象列表
  41. this.listServiceObject();
  42. },
  43. methods: {
  44. // 查询服务对接信息列表
  45. listServiceObject(){
  46. listServiceObject(null,{data:this.reqParm}).then((res)=>{
  47. this.getImgUrlByOssId(res);
  48. }).catch(() =>{
  49. uni.showToast({
  50. title: "操作失败"
  51. })
  52. });
  53. },
  54. // 获取图片
  55. async getImgUrlByOssId(data){
  56. for (let i = 0; i < data.length; i++) {
  57. const item = data[i];
  58. let url = await this.$getImgUrlByOssId(item.facePhoto);
  59. item.imgUrl = url;
  60. }
  61. this.serviceObjectList = data
  62. return data;
  63. },
  64. // 选择服务老师
  65. chooseServiceObject(item){
  66. // 选择完成后返回上一页
  67. uni.navigateBack({
  68. delta: 1,
  69. success: function(res) {
  70. // 在这里可以处理选择结果
  71. // 可以将选择的内容保存到本地或通过事件传递给上一个页面
  72. uni.$emit('selectedServiceObjectChild', item);
  73. }
  74. });
  75. }
  76. },
  77. };
  78. </script>
  79. <style scoped lang="scss">
  80. .h-item-row{
  81. display: flex;
  82. font-family: PingFangSC-Medium, PingFang SC;
  83. margin: 12px;
  84. background: #fff;
  85. padding: 12px;
  86. .h-img{
  87. margin-right: 8px;
  88. display: flex;
  89. align-items: center;
  90. image{
  91. height: 80px;
  92. width: 80px;
  93. }
  94. }
  95. .h-item-content{
  96. .h-title{
  97. font-size: 16px;
  98. font-weight: 500;
  99. line-height: 30px;
  100. display: flex;
  101. .name{
  102. padding-right: 6px;
  103. color: #111111;
  104. }
  105. .btn text{
  106. background: #fff5d0;
  107. color: #333333;
  108. font-size: 12px;
  109. border: 1px solid #FFE05C;
  110. padding-left: 10px;
  111. padding-right: 10px;
  112. }
  113. }
  114. .h-desc{
  115. font-size: 12px;
  116. font-weight: 400;
  117. color: #999999;
  118. line-height: 25px;
  119. }
  120. .h-content{
  121. display: flex;
  122. align-items: center;
  123. font-size: 12px;
  124. font-weight: 400;
  125. line-height: 25px;
  126. .h-text{
  127. padding-left: 4px;
  128. color: #999999;
  129. }
  130. .h-text1{
  131. color: #ED569F;
  132. }
  133. }
  134. }
  135. }
  136. </style>