index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="page" >
  3. <view v-for="(item,index) in serviceObjectList" @click="chooseServiceObject(item)" class="h-item-row">
  4. <view class="h-img">
  5. <image :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFill"></image>
  6. </view>
  7. <view class="h-item-content">
  8. <view class="h-title">
  9. <view class="name">
  10. <text>{{item.nickName || '未填写'}}</text>
  11. </view>
  12. </view>
  13. <view class="h-desc">
  14. <text>关系:{{item.blood}}</text>
  15. </view>
  16. <view class="h-content">
  17. <view class="h-text">
  18. 备注:<text v-if="item.remark">{{item.remark}}</text>
  19. <text v-else>无</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-if="item.haveEquityCard" class="flex-col justify-center">
  24. <text class="b">权益券</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  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. this.$api.listServiceObject(this.reqParm).then((res)=>{
  47. console.log('++++++++++listServiceObject+++++++++++',res)
  48. this.getImgUrlByOssId(res.data.data);
  49. })
  50. },
  51. // 获取图片
  52. getImgUrlByOssId(data){
  53. for (let i = 0; i < data.length; i++) {
  54. const item = data[i];
  55. if (item.facePhoto){
  56. this.$api.getImgUrlByOssId({ossId:item.facePhoto}).then(res=>{
  57. console.log('+++++++++++++getImgUrlByOssId+++++++++++++++',res)
  58. item.facePhotoUrl= res.data.data[0].url.replace(/^http:/, "https:")
  59. this.$set(data,i,item)
  60. })
  61. }
  62. }
  63. this.serviceObjectList = data
  64. },
  65. // 选择服务老师
  66. chooseServiceObject(item){
  67. uni.navigateBack({
  68. delta: 1,
  69. success: function(res) {
  70. uni.$emit('selectedServiceObject', item);
  71. }
  72. });
  73. }
  74. },
  75. };
  76. </script>
  77. <style scoped lang="scss">
  78. @import '/common/css/common.css';
  79. .page{
  80. background: #F7F7F7;
  81. }
  82. .h-item-row{
  83. display: flex;
  84. font-family: PingFangSC-Medium, PingFang SC;
  85. margin: 12px;
  86. background: #fff;
  87. padding: 12px;
  88. .h-img{
  89. margin-right: 8px;
  90. display: flex;
  91. align-items: center;
  92. image{
  93. height: 80px;
  94. width: 80px;
  95. }
  96. }
  97. .h-item-content{
  98. width: 350rpx;
  99. .h-title{
  100. font-size: 16px;
  101. font-weight: 500;
  102. line-height: 30px;
  103. display: flex;
  104. .name{
  105. padding-right: 6px;
  106. color: #111111;
  107. }
  108. .btn text{
  109. background: #fff5d0;
  110. color: #333333;
  111. font-size: 12px;
  112. border: 1px solid #FFE05C;
  113. padding-left: 10px;
  114. padding-right: 10px;
  115. }
  116. }
  117. .h-desc{
  118. font-size: 12px;
  119. font-weight: 400;
  120. color: #999999;
  121. line-height: 25px;
  122. }
  123. .h-content{
  124. display: flex;
  125. align-items: center;
  126. font-size: 12px;
  127. font-weight: 400;
  128. line-height: 25px;
  129. .h-text{
  130. width: 350rpx;
  131. color: #999999;
  132. white-space: nowrap;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. }
  136. .h-text1{
  137. color: #ED569F;
  138. }
  139. }
  140. }
  141. }
  142. .a{
  143. font-size: 28rpx;
  144. line-height: 60rpx;
  145. padding: 0 20rpx;
  146. background: green;
  147. }
  148. .b{
  149. font-size: 24rpx;
  150. font-family: PingFangSC-Regular, PingFang SC;
  151. color: #9ed733;
  152. background: #e9f6d1;
  153. padding: 6rpx 16rpx;
  154. margin-left: 16rpx;
  155. border-radius: 12rpx;
  156. }
  157. .bord{
  158. border: 1px solid red;
  159. }
  160. </style>