fuli-info.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="fuli-info">
  3. <u-parse :html="content"></u-parse>
  4. <view class="" style="height: 170rpx;"></view>
  5. <view class="houses-btn u-flex u-row-between">
  6. <text @click="opentel">隐私电话</text>
  7. <text @click="tochat">在线咨询</text>
  8. </view>
  9. <u-popup v-model="showtocall" mode="center" background="rgba(0,0,0,0)">
  10. <view class="tocall-box u-flex-col u-col-center">
  11. <image class="tocall-img" src="../../static/images/popup1-1.png" mode=""></image>
  12. <view class="u-flex-col u-col-center tocall-text">您是否进行呼叫?</view>
  13. <view class="u-flex u-row-between tocall-btn">
  14. <text @click="showtocall = false">取消</text>
  15. <text @click="totel">确定</text>
  16. </view>
  17. </view>
  18. </u-popup>
  19. <u-popup v-model="showlogin" mode="center" background="rgba(0,0,0,0)">
  20. <view class="tocall-box u-flex-col u-col-center">
  21. <image class="tocall-img" src="../../static/images/popup1-1.png" mode=""></image>
  22. <view class="u-flex-col u-col-center tocall-text">你目前处于未登录状态请前往登录</view>
  23. <view class="u-flex u-row-between tocall-btn">
  24. <text @click="showlogin = false">取消</text>
  25. <text @click="tologin">确定</text>
  26. </view>
  27. </view>
  28. </u-popup>
  29. <gf-chat ref="chatlist" @over="getuser"></gf-chat>
  30. <gf-tel ref="tellist" @over="getuser"></gf-tel>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. id: '',
  38. content: '',
  39. worker_id: 0,
  40. worker_phone: '',
  41. worker_hx_username: '',
  42. showtocall: false,
  43. showlogin: false,
  44. }
  45. },
  46. onLoad(option) {
  47. this.id = option.id
  48. this.getdata()
  49. },
  50. onShow() {
  51. if (uni.getStorageSync("token")) {
  52. this.getuser()
  53. }
  54. },
  55. methods: {
  56. tologin() {
  57. this.showlogin = false
  58. uni.navigateTo({
  59. url: "/pages/mine/login"
  60. })
  61. },
  62. opentel() {
  63. if (uni.getStorageSync("token")) {
  64. this.showtocall = true
  65. } else {
  66. this.showlogin = true
  67. }
  68. },
  69. getuser() {
  70. this.$u.post('/api/Member/member_info').then(res => {
  71. this.worker_id = res.data.worker_id
  72. this.worker_phone = res.data.worker_phone
  73. this.worker_hx_username = res.data.worker_hx_username
  74. })
  75. },
  76. totel() {
  77. if (uni.getStorageSync("token")) {
  78. this.showtocall = false
  79. if (this.worker_id == 0) {
  80. this.$refs.tellist.open(this.id, 2)
  81. } else {
  82. this.$u.post('/api/Member/consult_record', {
  83. type: 1
  84. })
  85. uni.makePhoneCall({
  86. phoneNumber: this.worker_phone
  87. })
  88. }
  89. } else {
  90. this.showlogin = true
  91. }
  92. },
  93. tochat() {
  94. if (uni.getStorageSync("token")) {
  95. if (this.worker_id == 0) {
  96. this.$refs.chatlist.open(this.id, 2)
  97. } else {
  98. this.$u.post('/api/Member/consult_record', {
  99. type: 2
  100. })
  101. uni.navigateTo({
  102. url: "./chat?hx_username=" + this.worker_hx_username + "&worker_id=" + this.worker_id
  103. })
  104. }
  105. } else {
  106. this.showlogin = true
  107. }
  108. },
  109. getdata() {
  110. this.$u.post("/api/welfare/welfare_detail", {
  111. id: this.id
  112. }).then(res => {
  113. const regex = new RegExp('<img', 'gi')
  114. this.content = res.data.content.replace(regex, `<img style="max-width: 100%; height: auto"`)
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .fuli-info {
  122. padding: 24rpx;
  123. .tocall-box {
  124. position: relative;
  125. .tocall-img {
  126. width: 650rpx;
  127. height: 476rpx;
  128. }
  129. .tocall-btn {
  130. position: absolute;
  131. bottom: 70rpx;
  132. left: 0;
  133. width: 100%;
  134. padding: 0 48rpx;
  135. text:first-child {
  136. width: 254rpx;
  137. line-height: 80rpx;
  138. background: #FFA120;
  139. border-radius: 20rpx;
  140. text-align: center;
  141. font-size: 34rpx;
  142. font-family: PingFangSC-Medium, PingFang SC;
  143. font-weight: 500;
  144. color: #FFFFFF;
  145. }
  146. text:last-child {
  147. width: 254rpx;
  148. line-height: 80rpx;
  149. background: #1F7EFF;
  150. border-radius: 20rpx;
  151. text-align: center;
  152. font-size: 34rpx;
  153. font-family: PingFangSC-Medium, PingFang SC;
  154. font-weight: 500;
  155. color: #FFFFFF;
  156. }
  157. }
  158. .tocall-text {
  159. text-align: center;
  160. font-size: 24rpx;
  161. font-family: PingFangSC-Regular, PingFang SC;
  162. font-weight: 400;
  163. color: #999999;
  164. position: absolute;
  165. top: 244rpx;
  166. left: 0;
  167. z-index: 10;
  168. width: 100%;
  169. }
  170. }
  171. .houses-btn {
  172. position: fixed;
  173. bottom: 0;
  174. left: 0;
  175. width: 750rpx;
  176. height: 166rpx;
  177. background: #FFFFFF;
  178. padding: 0 24rpx 54rpx 24rpx;
  179. z-index: 1;
  180. text:first-child {
  181. width: 338rpx;
  182. line-height: 84rpx;
  183. background: #FFA120;
  184. border-radius: 20rpx;
  185. text-align: center;
  186. font-size: 28rpx;
  187. font-family: PingFangSC-Regular, PingFang SC;
  188. font-weight: 400;
  189. color: #FFFFFF;
  190. }
  191. text:last-child {
  192. width: 338rpx;
  193. line-height: 84rpx;
  194. background: #1F7EFF;
  195. border-radius: 20rpx;
  196. text-align: center;
  197. font-size: 28rpx;
  198. font-family: PingFangSC-Regular, PingFang SC;
  199. font-weight: 400;
  200. color: #FFFFFF;
  201. }
  202. }
  203. }
  204. </style>