index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view>
  3. <view class="sticky-nav">
  4. <view class="nav-box">
  5. <image src="../../../static/index/answer/trun_left_black.png" class="answer_back" @click="backHome">
  6. </image>
  7. <text class="answer-text">法师答疑</text>
  8. <image src="../../../static/index/gongdeng/more_black.png" class="answer_operate"
  9. @click="showAnswerMore"></image>
  10. </view>
  11. </view>
  12. <view class="master_info_box">
  13. <view v-for="(item,index) in masterList" :key="index">
  14. <view class="master_list_item">
  15. <view class="master_img_box">
  16. <image :src="item.avatar" class="master_img"></image>
  17. </view>
  18. <view class="master_name">{{item.name}}</view>
  19. <view class="master_consult_box">
  20. <text class="master_status">{{item.status}}</text>
  21. <text class="consult_count">{{item.consultCount}}</text>人咨询
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <u-mask :show="showMask" :duration="200" :custom-style="{background: 'transparent'}" @click="showMask = false">
  27. <view class="wrap">
  28. <div class="answer_operate_wrap answer_operate_wrap_top">
  29. <view v-for="(item,index) in operateList" :key="index" class="operate_list">
  30. <view class="operate_item" @tap.stop="answerDetail(item)">
  31. <image :src="item.icon" class="oprate_icon"></image>
  32. <text class="oprate_content">{{item.content}}</text>
  33. </view>
  34. </view>
  35. </div>
  36. </view>
  37. </u-mask>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. masterList: [{
  45. avatar: '../../../static/index/gongdeng/default_face_image.png',
  46. name: "天然居士",
  47. status: "在线",
  48. consultCount: 13
  49. }, {
  50. avatar: '../../../static/index/gongdeng/default_face_image.png',
  51. name: "国慧法师",
  52. status: "离线",
  53. consultCount: 24
  54. }, {
  55. avatar: '../../../static/index/gongdeng/default_face_image.png',
  56. name: "明心居士",
  57. status: "离线",
  58. consultCount: 165
  59. }],
  60. showMask: false, //是否显示遮罩层
  61. operateList: [{
  62. icon: '../../../static/index/answer/enter_icon.png',
  63. content: '法师入驻'
  64. }, {
  65. icon: '../../../static/index/answer/answer_icon.png',
  66. content: '答疑说明'
  67. }]
  68. }
  69. },
  70. methods: {
  71. backHome() {
  72. uni.navigateBack({
  73. delta: 1
  74. });
  75. },
  76. showAnswerMore() {
  77. this.showMask = true;
  78. },
  79. answerDetail(item) {
  80. // console.log(item.content);
  81. switch (item.content) {
  82. case '法师入驻':
  83. uni.navigateTo({
  84. url: '../answer/applyRecord'
  85. });
  86. break;
  87. case '答疑说明':
  88. uni.navigateTo({
  89. url: '../answer/answerIntroduction'
  90. });
  91. break;
  92. }
  93. }
  94. }
  95. }
  96. </script>
  97. <style>
  98. page {
  99. padding: 0;
  100. margin: 0;
  101. background-color: rgb(247, 246, 242);
  102. }
  103. </style>
  104. <style lang="less" scoped>
  105. .sticky-nav {
  106. position: sticky;
  107. width: 100%;
  108. top: 0;
  109. z-index: 1;
  110. }
  111. .nav-box {
  112. width: 100%;
  113. display: flex;
  114. align-items: center;
  115. background: #fff;
  116. height: 95rpx;
  117. .answer_back {
  118. width: 45rpx;
  119. height: 45rpx;
  120. padding-left: 20rpx;
  121. padding-right: 215rpx;
  122. }
  123. .answer-text {
  124. font-size: 37rpx;
  125. color: #000;
  126. }
  127. .answer_operate {
  128. width: 21px;
  129. height: 19px;
  130. padding-left: 260rpx;
  131. }
  132. }
  133. .master_info_box {
  134. display: flex;
  135. justify-content: space-between;
  136. align-items: center;
  137. margin: 10rpx 30rpx 0 30rpx;
  138. .master_list_item {
  139. background-color: #fff;
  140. border-radius: 12rpx;
  141. .master_img_box {
  142. display: flex;
  143. justify-content: center;
  144. .master_img {
  145. width: 125rpx;
  146. height: 125rpx;
  147. border-radius: 50%;
  148. overflow: hidden;
  149. margin: 20rpx 0;
  150. }
  151. }
  152. .master_name {
  153. font-size: 35rpx;
  154. text-align: center;
  155. padding-bottom: 15rpx;
  156. }
  157. .master_consult_box {
  158. display: flex;
  159. flex-direction: row;
  160. padding: 0 20rpx 20rpx 20rpx;
  161. .master_status {
  162. color: rgb(174, 174, 174);
  163. font-size: 25rpx;
  164. padding-right: 15rpx;
  165. }
  166. .consult_count {
  167. color: rgb(206, 133, 98);
  168. font-size: 25rpx;
  169. }
  170. }
  171. }
  172. }
  173. .wrap {
  174. position: fixed;
  175. top: 115rpx;
  176. right: 0;
  177. .answer_operate_wrap {
  178. // width: 300rpx;
  179. // height: 430rpx;
  180. background-color: #fff;
  181. border-radius: 10rpx;
  182. border: 5rpx solid rgb(247, 246, 242);
  183. position: relative;
  184. .operate_list {
  185. margin: 0 5rpx 0 25rpx;
  186. // border-bottom: 1rpx solid rgb(247, 246, 242);
  187. .operate_item {
  188. padding: 27rpx 55rpx 27rpx 20rpx;
  189. display: flex;
  190. align-items: center;
  191. }
  192. .oprate_icon {
  193. width: 50rpx;
  194. height: 50rpx;
  195. padding-right: 40rpx;
  196. }
  197. .oprate_content {
  198. font-size: 35rpx;
  199. }
  200. }
  201. }
  202. .answer_operate_wrap_top::before {
  203. content: '';
  204. position: absolute;
  205. width: 0;
  206. height: 0;
  207. left: 259rpx;
  208. top: -52rpx;
  209. border: 25rpx solid;
  210. border-color: transparent transparent rgb(255, 255, 255) transparent;
  211. z-index: 999;
  212. /*上 右 下 左 */
  213. }
  214. .answer_operate_wrap_top::after {
  215. content: "";
  216. position: absolute;
  217. width: 0;
  218. height: 0;
  219. top: -31rpx;
  220. left: 257rpx;
  221. border-width: 0 29rpx 29rpx;
  222. border-style: solid;
  223. border-color: transparent transparent rgb(247, 246, 242);
  224. }
  225. }
  226. </style>