index.vue 5.8 KB

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