chat-drawer.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view class="drawer-content">
  3. <!--右抽屉-->
  4. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  5. <view
  6. class="drawer-container clearfix"
  7. scroll-y
  8. :style="{
  9. paddingTop: CustomBar - StatusBar + 8 + 'px',
  10. paddingBottom: isIphoneX ? '180rpx' : '146rpx'
  11. }"
  12. >
  13. <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
  14. </scroll-view>
  15. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  16. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  17. <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
  18. </view>
  19. </view>
  20. </tui-drawer>
  21. </view>
  22. </template>
  23. <script>
  24. import { mapState, mapMutations } from 'vuex'
  25. export default {
  26. name: 'rightDrawer',
  27. props: {
  28. rightDrawer: {
  29. type: Boolean,
  30. default: false
  31. },
  32. current:{
  33. type:Number
  34. }
  35. },
  36. data() {
  37. return {
  38. date: currentDate,
  39. CustomBar: this.CustomBar, // 顶部导航栏高度
  40. StatusBar: this.StatusBar,
  41. isIphoneX: this.$store.state.isIphoneX,
  42. height: 0,
  43. drawerH: 0, // 抽屉内部scrollview高度
  44. list: [],
  45. chatHistoryParams: {
  46. userId: '',
  47. pageNum: 1,
  48. pageSize: 10
  49. },
  50. }
  51. },
  52. created() {
  53. this.setScrollHeight()
  54. },
  55. computed: {
  56. },
  57. methods: {
  58. async userNewChatHistory() {
  59. //获取组员协销列表
  60. try{
  61. const userInfo = await this.$api.getStorage()
  62. this.chatHistoryParams.userId = userInfo.userId
  63. const res = await this.UserService.userNewChatHistory({ spId: userInfo.serviceProviderId })
  64. this.list = res.data
  65. }catch(e){
  66. console.log('=========>获取AI记录异常')
  67. }
  68. },
  69. closeDrawer() {
  70. this.$parent.rightDrawer = false
  71. },
  72. handSearchConfirm() {
  73. //确定筛选
  74. this.$emit('handSearchConfirm', this.queryData)
  75. this.$parent.rightDrawer = false
  76. },
  77. setScrollHeight() {
  78. let obj = {}
  79. const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
  80. uni.getSystemInfo({
  81. success: res => {
  82. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  83. this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
  84. }
  85. })
  86. this.windowHeight = windowHeight - 1
  87. this.scrollHeight = windowHeight - 1
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. /*screen*/
  94. .drawer-container {
  95. width: 580rpx;
  96. height: 100%;
  97. padding: 80rpx 0;
  98. overflow: hidden;
  99. box-sizing: border-box;
  100. background-color: #ffffff;
  101. .drawer-title {
  102. width: 100%;
  103. height: 72rpx;
  104. line-height: 72rpx;
  105. box-sizing: border-box;
  106. padding: 0 30rpx;
  107. float: left;
  108. background-color: #f7f7f7;
  109. font-size: $font-size-26;
  110. color: #333333;
  111. font-weight: bold;
  112. text-align: left;
  113. }
  114. .drawer-main {
  115. width: 100%;
  116. height: auto;
  117. box-sizing: border-box;
  118. float: left;
  119. .drawer-main-name {
  120. width: 100%;
  121. height: 80rpx;
  122. line-height: 80rpx;
  123. text-align: left;
  124. font-size: $font-size-26;
  125. color: #333333;
  126. box-sizing: border-box;
  127. padding: 0 20rpx;
  128. font-weight: bold;
  129. .small{
  130. font-weight: normal;
  131. color: #999999;
  132. }
  133. }
  134. .drawer-main-time{
  135. width: 100%;
  136. height: 56rpx;
  137. box-sizing: border-box;
  138. .line{
  139. color: #999999;
  140. float: left;
  141. line-height: 56rpx;
  142. }
  143. .drawer-main-time-input{
  144. width: 228rpx;
  145. height: 56rpx;
  146. background: #F7F7F7;
  147. border-radius: 28rpx;
  148. box-sizing: border-box;
  149. padding: 0 20rpx;
  150. line-height: 56rpx;
  151. float: left;
  152. margin: 0 20rpx;
  153. position: relative;
  154. .input-text{
  155. display: block;
  156. height: 56rpx;
  157. font-size: 26rpx;
  158. color: #666666;
  159. }
  160. .icon-riqi{
  161. color: #FF5B00;
  162. display: block;
  163. width: 40rpx;
  164. height: 56rpx;
  165. position: absolute;
  166. right: 10rpx;
  167. top: 0;
  168. line-height: 56rpx;
  169. }
  170. }
  171. }
  172. .drawer-main-radiov {
  173. width: 100%;
  174. height: auto;
  175. box-sizing: border-box;
  176. padding: 0 20rpx;
  177. .drawer-main-radio {
  178. width: 100%;
  179. height: 80rpx;
  180. box-sizing: border-box;
  181. padding: 0 10rpx;
  182. border: 1px solid rgba(0, 0, 0, 0.2);
  183. border-radius: 6rpx;
  184. margin-bottom: 30rpx;
  185. position: relative;
  186. &.btn {
  187. border: none;
  188. margin-top: 40rpx;
  189. }
  190. .input {
  191. width: 100%;
  192. height: 80rpx;
  193. line-height: 80rpx;
  194. float: left;
  195. box-sizing: border-box;
  196. font-size: $font-size-24;
  197. color: #333333;
  198. padding: 0 10rpx;
  199. padding-right: 68rpx;
  200. }
  201. .iconfont {
  202. width: 50rpx;
  203. height: 80rpx;
  204. display: block;
  205. line-height: 80rpx;
  206. text-align: center;
  207. font-size: 30rpx;
  208. color: #999999;
  209. position: absolute;
  210. right: 0;
  211. top: 0;
  212. }
  213. }
  214. }
  215. }
  216. .drawer-input {
  217. width: 100%;
  218. float: left;
  219. box-sizing: border-box;
  220. padding: 24rpx 10rpx 0 10rpx;
  221. border: 1px solid rgba(0, 0, 0, 0.2);
  222. border-radius: 4rpx;
  223. position: relative;
  224. background-color: #ffffff;
  225. &.btn {
  226. border: none;
  227. display: flex;
  228. position: fixed;
  229. left: 0;
  230. bottom: 0;
  231. }
  232. .drawer-btn {
  233. width: 210rpx;
  234. height: 84rpx;
  235. border-radius: 42rpx;
  236. background: $btn-confirm;
  237. line-height: 84rpx;
  238. text-align: center;
  239. font-size: $font-size-26;
  240. color: #ffffff;
  241. flex: 1;
  242. margin: 0 10rpx;
  243. &.comfrim {
  244. background: $btn-confirm;
  245. }
  246. &.clear {
  247. background: #ffe6dc;
  248. color: $color-system;
  249. }
  250. }
  251. }
  252. }
  253. </style>