index.vue 5.0 KB

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