index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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=""></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. }).catch(() =>{
  65. uni.showToast({
  66. title: "操作失败"
  67. })
  68. });
  69. },
  70. // 获取图片
  71. getImgUrlByBannerOssId(items){
  72. for(let i = 0; i <items.length; i++) {
  73. if (items[i].facePhoto){
  74. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  75. console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
  76. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  77. this.$set(this.serviceObjectList,i,items[i])
  78. })
  79. }
  80. }
  81. },
  82. /* 添加服务对象 */
  83. gotoAddServiceObject(){
  84. uni.navigateTo({
  85. url: '/myPages/serviceObjectFaceAuth/index',
  86. })
  87. },
  88. // 去修改服务对象
  89. gotoUpdateServiceObject(item){
  90. item.facePhotoUrl = item.imgUrl;
  91. if(item.wardship == '1'){ // 监护人
  92. uni.navigateTo({
  93. url: '/myPages/serviceObjectAllInfo/index?data=' + JSON.stringify(item),
  94. })
  95. } else { // 不是监护人
  96. item.opType = '2';
  97. uni.navigateTo({
  98. url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(item) ,
  99. })
  100. }
  101. },
  102. }
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. .page{
  107. background: #f7f7f7;
  108. border-top: 1px solid #f7f7f7;
  109. }
  110. .add{
  111. width: 686rpx;
  112. margin-left: 32rpx;
  113. margin-top: 30px;
  114. text-align: center;
  115. color: #333333;
  116. line-height: 42px;
  117. border-radius: 6px;
  118. font-size: 16px;
  119. height: 42px;
  120. background: #FFE05C;
  121. border-radius: 27px;
  122. .name{
  123. padding-left: 6px;
  124. }
  125. }
  126. .service-object-wrap{
  127. margin-left: 12px;
  128. margin-right: 12px;
  129. .service-object-list{
  130. .store-content{
  131. padding:10px;
  132. margin-top: 16px;
  133. background: #fff;
  134. display: flex;
  135. border-radius: 6px;
  136. .store-img{
  137. image{
  138. width: 90px;
  139. height: 90px;
  140. border-radius: 3px;
  141. }
  142. }
  143. .content{
  144. width: 100%;
  145. padding-left: 8px;
  146. padding-top: 4px;
  147. .title-price{
  148. display: flex;
  149. font-size: 20px;
  150. .title{
  151. font-size: 16px;
  152. color: #111111;
  153. width: 100%;
  154. font-family: "黑体", sans-serif;
  155. line-height: 30px;
  156. }
  157. .icon-btn{
  158. text-align: right;
  159. padding-right: 12px;
  160. image{
  161. height: 30px;
  162. width: 30px;
  163. }
  164. }
  165. }
  166. .desc{
  167. line-height: 26px;
  168. color: #999999;
  169. font-size: 12px;
  170. white-space: nowrap; /* Prevent line breaks */
  171. overflow: hidden; /* Hide overflowing content */
  172. text-overflow: ellipsis; /* Show ellipsis (...) for overflow */
  173. .teacher{
  174. padding-left: 6px;
  175. }
  176. .completed{
  177. }
  178. }
  179. }
  180. }
  181. }
  182. }
  183. </style>