support.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="container">
  3. <top :type="pageType"></top>
  4. <view class="content1">
  5. <view class="title">
  6. 联系方式
  7. </view>
  8. <view class="row">
  9. <text>微信:</text>
  10. <text>ccjgmwz</text>
  11. </view>
  12. <view class="row">
  13. <text>手机:</text>
  14. <text>18241771147</text>
  15. </view>
  16. <view class="row">
  17. <text>QQ:</text>
  18. <text>841968545</text>
  19. </view>
  20. <view class="row">
  21. <text>邮箱:</text>
  22. <text>ccjgmwz@foxmail.com</text>
  23. </view>
  24. <view class="row">
  25. <text>联系地址:</text>
  26. <text>辽宁省营口市鲅鱼圈区</text>
  27. </view>
  28. <view class="row">
  29. <text>联系人:</text>
  30. <text>程长江</text>
  31. </view>
  32. </view>
  33. <!-- <bottom></bottom> -->
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. mapState
  39. } from 'vuex';
  40. import top from '@/components/top.vue'
  41. import bottom from '@/components/bottom.vue'
  42. export default {
  43. components: {
  44. top,
  45. bottom
  46. },
  47. data() {
  48. return {
  49. pageType: 'support',
  50. navTitle: '',
  51. searchVal: '',
  52. tableData: [],
  53. // 每页数据量
  54. pageSize: 10,
  55. // 当前页
  56. currentPage: 1,
  57. // 数据总量
  58. total: 200,
  59. loading: false,
  60. user: {}
  61. }
  62. },
  63. onLoad(options) {
  64. this.type = options.type
  65. this.selectedIndexs = []
  66. if (this.type == 1) {
  67. this.navTitle = '公告'
  68. } else {
  69. this.navTitle = '公示'
  70. }
  71. this.user = uni.getStorageSync('userInfo');
  72. if (this.user) {
  73. this.$store.commit('login', this.user)
  74. this.init()
  75. }
  76. // this.getData(1)
  77. },
  78. methods: {
  79. // 获取富文本的纯文字内容
  80. convertIdeogramToNormalCharacter(val) {
  81. const arrEntities = {
  82. 'lt': '<',
  83. 'gt': '>',
  84. 'nbsp': ' ',
  85. 'amp': '&',
  86. 'quot': '"'
  87. };
  88. return val.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t) {
  89. return arrEntities[t];
  90. });
  91. },
  92. getPlainText(richCont) {
  93. debugger
  94. const str = richCont;
  95. let value = richCont;
  96. if (richCont) {
  97. // 方法一:
  98. value = value.replace(/\s*/g, ""); //去掉空格
  99. value = value.replace(/<[^>]+>/g, ""); //去掉所有的html标记
  100. value = value.replace(/↵/g, ""); //去掉所有的↵符号
  101. value = value.replace(/[\r\n]/g, "") //去掉回车换行
  102. value = value.replace(/&nbsp;/g, "") //去掉空格
  103. value = this.convertIdeogramToNormalCharacter(value);
  104. return value;
  105. } else {
  106. return null;
  107. }
  108. },
  109. init() {
  110. this.$request.baseRequest('get', '/hyPublicConsultation/selectHyPublicConsultation', {
  111. currentPage: this.currentPage,
  112. pageSize: this.pageSize,
  113. searchKeyWord: '',
  114. searchType: this.navTitle
  115. }).then(res => {
  116. console.log("res", res)
  117. if (res.code == 200) {
  118. debugger
  119. this.tableData = res.data.records
  120. this.total = res.data.total
  121. for (let i = 0; i < this.tableData.length; i++) {
  122. this.tableData[i].content = this.getPlainText(this.tableData[i].releaseContent)
  123. }
  124. uni.hideLoading()
  125. } else {
  126. uni.hideLoading()
  127. uni.showToast({
  128. title: res.message,
  129. icon: 'none',
  130. duration: 2000
  131. })
  132. }
  133. })
  134. .catch(res => {
  135. uni.showToast({
  136. title: res.message,
  137. icon: 'none',
  138. duration: 2000
  139. })
  140. });
  141. },
  142. toDetail(id, type) {
  143. debugger
  144. let _src = ''
  145. if (type == 'zx') {
  146. _src = "/pages/index/zxDetail?id=" + id
  147. } else {
  148. _src = "/pages/index/infoDetail?id=" + id + '&type=' + type
  149. }
  150. uni.navigateTo({
  151. url: _src
  152. })
  153. },
  154. change(val) {
  155. console.log(val)
  156. this.currentPage = val.current
  157. this.init()
  158. },
  159. }
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .content1 {
  164. width: 80%;
  165. background: white;
  166. margin: 132rpx auto;
  167. padding: 40rpx;
  168. .nav-title {
  169. font-size: 28rpx;
  170. color: #66686C;
  171. line-height: 20px;
  172. }
  173. .content-view {
  174. .item {
  175. display: flex;
  176. justify-content: space-between;
  177. border-bottom: 1px solid #F5F5F5;
  178. padding-right: 80rpx;
  179. line-height: 55px;
  180. height: 55px;
  181. .point {
  182. width: 12rpx;
  183. height: 12rpx;
  184. background: #D8D8D8;
  185. margin: 0 6px;
  186. }
  187. .left-text {
  188. font-size: 36rpx;
  189. color: #333333;
  190. line-height: 64rpx;
  191. display: flex;
  192. align-items: center;
  193. }
  194. .date {
  195. font-size: 36rpx;
  196. color: #90969B;
  197. }
  198. }
  199. // .item:nth-last-of-type(1) {
  200. // border-bottom: 0;
  201. // }
  202. }
  203. }
  204. .uni-pagination-box {
  205. margin-top: 40rpx;
  206. }
  207. .title {
  208. font-size: 42rpx;
  209. font-weight: 700;
  210. }
  211. .row {
  212. margin-top: 20rpx;
  213. }
  214. </style>