specialistsDetail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view>
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="累计交友圈专员详情" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <view class="flex-row justify-center">
  8. <u-tabs :list="tabList" lineWidth="50" :scrollable="false" @click="clickTabs" :current="current"></u-tabs>
  9. </view>
  10. <swiper class="swiper" :style="{height:height}" :current="current" @change="swiperChange">
  11. <swiper-item>
  12. <view class="msg bord" :style="{height:height}">
  13. <view class="flex-row justify-between msgItem">
  14. <view>
  15. <text>头像</text>
  16. </view>
  17. <view>
  18. <image :src="expandUser.selfPhotoUrl || '/static/ud4.png'" class="profilePhoto"></image>
  19. </view>
  20. </view>
  21. <view class="flex-row justify-between msgItem">
  22. <view>
  23. <text>好友编号</text>
  24. </view>
  25. <view>
  26. <text>{{expandUser.id}}</text>
  27. </view>
  28. </view>
  29. <view class="flex-row justify-between msgItem">
  30. <view>
  31. <text>姓名</text>
  32. </view>
  33. <view>
  34. <text>{{expandUser.name}}</text>
  35. </view>
  36. </view>
  37. <view class="flex-row justify-between msgItem">
  38. <view>
  39. <text>电话号码</text>
  40. </view>
  41. <view>
  42. <text>{{expandUser.phone}}</text>
  43. </view>
  44. </view>
  45. <view class="flex-row justify-between msgItem">
  46. <view>
  47. <text>备注</text>
  48. </view>
  49. <view class="itemValue">
  50. <text>{{expandUser.remake}}</text>
  51. </view>
  52. </view>
  53. <view class="flex-row justify-between msgItem">
  54. <view>
  55. <text>备注地址</text>
  56. </view>
  57. <view class="itemValue">
  58. <text>{{expandUser.remarkAddress}}</text>
  59. </view>
  60. </view>
  61. <view class="flex-row justify-between msgItem">
  62. <view>
  63. <text>现场照片</text>
  64. </view>
  65. <view class="itemValue scenePhoto">
  66. <image :src="item.url" class="photo" v-for="(item,index) in scenePhotoArr" :key="index" @click="amplifier(item.url)"></image>
  67. </view>
  68. </view>
  69. <view class="flex-row justify-center">
  70. <button class="jiechuBtn" type="warn" @click="unbind">解除绑定</button>
  71. </view>
  72. </view>
  73. </swiper-item>
  74. <swiper-item>
  75. <mescroll-item ref="MescrollItem" :i="0" :index="0" :height="height" :expandUserId="expandUserId">
  76. </mescroll-item>
  77. </swiper-item>
  78. </swiper>
  79. <uni-popup ref="amplifierPopup" type="center">
  80. <view class="amplifierImg">
  81. <image mode="widthFix" :src="amplifierUrl"></image>
  82. </view>
  83. </uni-popup>
  84. <!--#ifdef H5-->
  85. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  86. <!--#endif-->
  87. </view>
  88. </template>
  89. <script>
  90. import MescrollItem from "./module/mescrollUni-item.vue";
  91. import {url} from "../../uni_modules/uv-ui-tools/libs/function/test";
  92. export default {
  93. components: {
  94. MescrollItem
  95. },
  96. data() {
  97. return {
  98. amplifierUrl:'',
  99. scenePhotoArr:[],
  100. expandUser: {},
  101. expandUserId: null,
  102. height: '',
  103. current: 0,
  104. tabList: [{
  105. name: '详情备注',
  106. }, {
  107. name: '交友记录',
  108. }]
  109. }
  110. },
  111. onLoad(e) {
  112. this.expandUserId = e.id
  113. let sysInfo = uni.getSystemInfoSync()
  114. this.height = sysInfo.windowHeight - 140 + 'px' //除标题栏栏外的屏幕可用高度
  115. this.expandUserDetail()
  116. },
  117. methods: {
  118. unbind(){
  119. let that = this
  120. uni.showModal({
  121. title: '危险操作',
  122. content: '解除绑定后不可恢复,请再次确认!',
  123. success: function (res) {
  124. if (res.confirm) {
  125. console.log('用户点击确定');
  126. that.$api.service.unbind({
  127. id:that.expandUserId
  128. }).then(res=>{
  129. uni.$u.toast("解除绑定成功")
  130. console.log(res)
  131. uni.navigateBack({
  132. delta: 1
  133. });
  134. })
  135. } else if (res.cancel) {
  136. console.log('用户点击取消');
  137. }
  138. }
  139. });
  140. },
  141. amplifier(url){
  142. this.amplifierUrl = url
  143. this.$refs.amplifierPopup.open()
  144. },
  145. expandUserDetail(){
  146. this.$api.service.expandUserDetail({
  147. expandUserId:this.expandUserId
  148. }).then(async res=>{
  149. this.expandUser = res.data.data
  150. if (this.expandUser.img){
  151. let oss = await this.$commonUtils.getImgUrlByOssId(this.expandUser.img)
  152. this.expandUser.selfPhotoUrl = oss[0].url
  153. }
  154. if (this.expandUser.scenePhoto){
  155. if (this.expandUser.scenePhoto){
  156. let arr = this.expandUser.scenePhoto.split(',')
  157. for (const imgId of arr) {
  158. let oss = await this.$commonUtils.getImgUrlByOssId(imgId)
  159. this.scenePhotoArr.push(oss[0])
  160. this.$set(this.scenePhotoArr)
  161. }
  162. }
  163. }
  164. this.$set(this.expandUser)
  165. console.log('人员详情',this.expandUser)
  166. })
  167. },
  168. swiperChange(e) {
  169. console.log(e)
  170. this.current = e.detail.current
  171. },
  172. clickTabs(e) {
  173. this.current = e.index
  174. },
  175. back() {
  176. let pages = getCurrentPages()
  177. if (pages.length > 1) {
  178. uni.navigateBack({
  179. delta: 1,
  180. fail: err => {
  181. console.log(err)
  182. }
  183. })
  184. } else {
  185. uni.switchTab({
  186. url: '/pages/index/index'
  187. });
  188. }
  189. },
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. @import './index.rpx.css';
  195. </style>