index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="page" :style="{'height':windowHeight}">
  3. <scroll-view :style="{'height':windowHeight}" scroll-y>
  4. <view class="service-object-wrap">
  5. <view class="service-object-list" >
  6. <view v-for="(item,index) in serviceObjectList" class="store-content" :key="index">
  7. <view class="store-img">
  8. <image :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFill"></image>
  9. </view>
  10. <view class="content">
  11. <view class="title-price">
  12. <view class="title">
  13. <text>{{item.nickName || '未填写'}}</text>
  14. </view>
  15. <view @click="gotoUpdateServiceObject(item)" class="icon-btn">
  16. <image src="/static/me/u2299.png" mode=""></image>
  17. </view>
  18. </view>
  19. <view class="desc">
  20. <view class="in-progress">关系:{{item.blood}}</view>
  21. <view class="completed" >
  22. 备注:<text>{{item.remark || '无'}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. <view @click="gotoAddServiceObject()" class="add">
  31. +<text class="name">添加服务对象</text>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. windowHeight:'',
  40. reqParm: {
  41. auth: true
  42. },
  43. serviceObjectList: [],
  44. images: [],
  45. };
  46. },
  47. mounted() {
  48. },
  49. onLoad() {
  50. let sysInfo = uni.getSystemInfoSync()
  51. this.windowHeight =sysInfo.windowHeight -100 +'px'//除标题栏栏外的屏幕可用高度
  52. },
  53. onShow(){
  54. // 查询服务对象列表
  55. this.listServiceObject();
  56. },
  57. methods: {
  58. // 查询服务对接信息列表
  59. listServiceObject(){
  60. this.$api.listServiceObject(this.reqParm).then((res)=>{
  61. console.log(res)
  62. this.serviceObjectList = res.data.data
  63. this.getImgUrlByBannerOssId(this.serviceObjectList);
  64. })
  65. },
  66. // 获取图片
  67. getImgUrlByBannerOssId(items){
  68. for(let i = 0; i <items.length; i++) {
  69. if (items[i].facePhoto){
  70. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  71. console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
  72. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  73. this.$set(this.serviceObjectList,i,items[i])
  74. })
  75. }
  76. }
  77. },
  78. /* 添加服务对象 */
  79. gotoAddServiceObject(){
  80. uni.navigateTo({
  81. url: '/myPages/serviceObjectFaceAuth/index',
  82. })
  83. },
  84. // 去修改服务对象
  85. gotoUpdateServiceObject(item){
  86. if(item.wardship == '1'){ // 监护人
  87. uni.navigateTo({
  88. url: '/myPages/serviceObjectAllInfo/index?data=' + JSON.stringify(item),
  89. })
  90. } else { // 不是监护人
  91. item.opType = '2';
  92. uni.navigateTo({
  93. url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(item) ,
  94. })
  95. }
  96. },
  97. }
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. .page{
  102. background: #f7f7f7;
  103. border-top: 1px solid #f7f7f7;
  104. }
  105. .add{
  106. width: 686rpx;
  107. margin-left: 32rpx;
  108. margin-top: 30px;
  109. text-align: center;
  110. color: #333333;
  111. line-height: 42px;
  112. border-radius: 6px;
  113. font-size: 16px;
  114. height: 42px;
  115. background: #FFE05C;
  116. border-radius: 27px;
  117. .name{
  118. padding-left: 6px;
  119. }
  120. }
  121. .service-object-wrap{
  122. margin-left: 12px;
  123. margin-right: 12px;
  124. .service-object-list{
  125. .store-content{
  126. padding:10px;
  127. margin-top: 16px;
  128. background: #fff;
  129. display: flex;
  130. border-radius: 6px;
  131. .store-img{
  132. image{
  133. width: 90px;
  134. height: 90px;
  135. border-radius: 3px;
  136. }
  137. }
  138. .content{
  139. width: 100%;
  140. padding-left: 8px;
  141. padding-top: 4px;
  142. .title-price{
  143. display: flex;
  144. font-size: 20px;
  145. .title{
  146. font-size: 16px;
  147. color: #111111;
  148. width: 100%;
  149. font-family: "黑体", sans-serif;
  150. line-height: 30px;
  151. }
  152. .icon-btn{
  153. text-align: right;
  154. padding-right: 12px;
  155. image{
  156. height: 30px;
  157. width: 30px;
  158. }
  159. }
  160. }
  161. .desc{
  162. line-height: 26px;
  163. color: #999999;
  164. font-size: 12px;
  165. white-space: nowrap; /* Prevent line breaks */
  166. overflow: hidden; /* Hide overflowing content */
  167. text-overflow: ellipsis; /* Show ellipsis (...) for overflow */
  168. .teacher{
  169. padding-left: 6px;
  170. }
  171. .completed{
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }
  178. </style>