index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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" @click.stop="magnify(item.facePhotoUrl)"></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">88卡</text>
  25. </view>
  26. </view>
  27. <uni-popup ref="popup">
  28. <view class="magnifyUrlView">
  29. <image :src="magnifyUrl" mode="widthFix"></image>
  30. </view>
  31. </uni-popup>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. magnifyUrl:'',
  39. serviceObjectList: [],
  40. reqParm: {
  41. auth: true
  42. },
  43. }
  44. },
  45. onLoad(query){
  46. // 查询服务对象列表
  47. this.listServiceObject();
  48. },
  49. methods: {
  50. magnify(url){
  51. if (!url){
  52. return
  53. }
  54. this.magnifyUrl = url
  55. this.$refs.popup.open()
  56. },
  57. // 查询服务对接信息列表
  58. listServiceObject(){
  59. this.$api.listServiceObject(this.reqParm).then((res)=>{
  60. console.log('++++++++++listServiceObject+++++++++++',res)
  61. this.getImgUrlByOssId(res.data.data);
  62. })
  63. },
  64. // 获取图片
  65. getImgUrlByOssId(data){
  66. for (let i = 0; i < data.length; i++) {
  67. const item = data[i];
  68. if (item.facePhoto){
  69. this.$api.getImgUrlByOssId({ossId:item.facePhoto}).then(res=>{
  70. console.log('+++++++++++++getImgUrlByOssId+++++++++++++++',res)
  71. item.facePhotoUrl= res.data.data[0].url.replace(/^http:/, "https:")
  72. this.$set(data,i,item)
  73. })
  74. }
  75. }
  76. this.serviceObjectList = data
  77. },
  78. // 选择服务老师
  79. chooseServiceObject(item){
  80. uni.navigateBack({
  81. delta: 1,
  82. success: function(res) {
  83. uni.$emit('selectedServiceObject', item);
  84. }
  85. });
  86. }
  87. },
  88. };
  89. </script>
  90. <style scoped lang="scss">
  91. @import '/common/css/common.css';
  92. .page{
  93. background: #F7F7F7;
  94. }
  95. .magnifyUrlView{
  96. border-radius: 20rpx;
  97. overflow: hidden;
  98. }
  99. .h-item-row{
  100. display: flex;
  101. font-family: PingFangSC-Medium, PingFang SC;
  102. margin: 12px;
  103. background: #fff;
  104. padding: 12px;
  105. .h-img{
  106. margin-right: 8px;
  107. display: flex;
  108. align-items: center;
  109. image{
  110. height: 80px;
  111. width: 80px;
  112. }
  113. }
  114. .h-item-content{
  115. width: 350rpx;
  116. .h-title{
  117. font-size: 16px;
  118. font-weight: 500;
  119. line-height: 30px;
  120. display: flex;
  121. .name{
  122. padding-right: 6px;
  123. color: #111111;
  124. }
  125. .btn text{
  126. background: #fff5d0;
  127. color: #333333;
  128. font-size: 12px;
  129. border: 1px solid #FFE05C;
  130. padding-left: 10px;
  131. padding-right: 10px;
  132. }
  133. }
  134. .h-desc{
  135. font-size: 12px;
  136. font-weight: 400;
  137. color: #999999;
  138. line-height: 25px;
  139. }
  140. .h-content{
  141. display: flex;
  142. align-items: center;
  143. font-size: 12px;
  144. font-weight: 400;
  145. line-height: 25px;
  146. .h-text{
  147. width: 350rpx;
  148. color: #999999;
  149. white-space: nowrap;
  150. overflow: hidden;
  151. text-overflow: ellipsis;
  152. }
  153. .h-text1{
  154. color: #ED569F;
  155. }
  156. }
  157. }
  158. }
  159. .a{
  160. font-size: 28rpx;
  161. line-height: 60rpx;
  162. padding: 0 20rpx;
  163. background: green;
  164. }
  165. .b{
  166. font-size: 24rpx;
  167. font-family: PingFangSC-Regular, PingFang SC;
  168. color: #9ed733;
  169. background: #e9f6d1;
  170. padding: 6rpx 16rpx;
  171. margin-left: 16rpx;
  172. border-radius: 12rpx;
  173. }
  174. .bord{
  175. border: 1px solid red;
  176. }
  177. </style>