index.vue 6.0 KB

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