xq-csg-weapp_uni-ts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
5.5KB

  1. <template>
  2. <view>
  3. <custom-nav-bar position="fixed" color="black" :left-text="options.name" left-arrow />
  4. <view class="second-model" v-if="options.name === '办事指南'">
  5. <view class="second-line flex flex-v-center flex-between" :style="itemName.cssStyle"
  6. v-for="(itemName, idx) in recursionList" :key="idx">
  7. <navigator v-if="itemName.clickUrl" class="line-navigator" :url="updateQuery(itemName.clickUrl, itemName)"
  8. hover-class="none"></navigator>
  9. <image class="line-img" :src="itemName.icon"></image>
  10. <view class="line-name flex1">{{ itemName.name }}</view>
  11. <image class="line-you" src="/static/images/ic-you.png"></image>
  12. </view>
  13. </view>
  14. <view class="two-model flex flex-v-center flex-between" v-if="options.name === '事务办理'">
  15. <view class="second-line flex flex-col line1" :style="itemName.cssStyle" v-for="(itemName, idx) in recursionList"
  16. :key="idx">
  17. <navigator v-if="itemName.clickUrl" class="line-navigator" :url="updateQuery(itemName.clickUrl, itemName)"
  18. hover-class="none"></navigator>
  19. <image class="line-bg" :src="itemName.icon"></image>
  20. <view class="line-title">{{ itemName.name }}</view>
  21. <view v-if="itemName.remark" class="line-msg">{{ itemName.remark }}</view>
  22. </view>
  23. </view>
  24. <view class="three-model" v-if="options.name === '便民小知识'">
  25. <view class="second-line flex flex-v-center flex-between" :style="itemName.cssStyle"
  26. v-for="(itemName, idx) in recursionList" :key="idx">
  27. <navigator v-if="itemName.clickUrl" class="line-navigator" :url="updateQuery(itemName.clickUrl, itemName)"
  28. hover-class="none"></navigator>
  29. <view class="line-name flex1 line-text-1">{{ itemName.name }}</view>
  30. <image class="line-you" src="/static/images/ic-you.png"></image>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. // const app = getApp();
  37. // const {
  38. // publicApi
  39. // } = app.globalData.api;
  40. import * as publicApi from '@/api/publicApi';
  41. import utils from '@/utils/util.map.js'
  42. export default {
  43. data() {
  44. return {
  45. options: {
  46. name: ''
  47. },
  48. recursionList: []
  49. };
  50. },
  51. onLoad(options) {
  52. this.options = options
  53. this.recursionApi();
  54. },
  55. methods: {
  56. updateQuery(url, name) {
  57. return utils.updateQuery(url, name);
  58. },
  59. async recursionApi() {
  60. const {
  61. bannerType,
  62. parentId
  63. } = this.options;
  64. const res = await publicApi.recursionApi({
  65. bannerType,
  66. parentId
  67. });
  68. if (res.data) {
  69. this.recursionList = res.data
  70. console.log(this.recursionList)
  71. }
  72. },
  73. // 通用函数
  74. generalFunction(res) {
  75. if (res.data && res.data.createTime) {
  76. // res.data.createTime = app.globalData.util.timeFormat(res.data.createTime);
  77. if (res.data.content) {
  78. res.data.content = res.data.content
  79. .replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ')
  80. .replace(/&lt;/g, '<')
  81. .replace(/&gt;/g, '>')
  82. .replace(/&amp;nbsp;/g, ' ')
  83. .replace(/&quot;/g, '"');
  84. }
  85. return res.data;
  86. }
  87. return {};
  88. }
  89. }
  90. };
  91. </script>
  92. <style lang="less">
  93. .line-navigator {
  94. width: 100%;
  95. height: 100%;
  96. position: absolute;
  97. z-index: 10;
  98. top: 0;
  99. left: 0;
  100. }
  101. .second-model {
  102. margin-top: 32rpx;
  103. width: 100%;
  104. height: 100%;
  105. padding: 0 12rpx;
  106. .second-line {
  107. height: 120rpx;
  108. border-bottom: 1px solid #efefef;
  109. position: relative;
  110. .line-img {
  111. width: 70rpx;
  112. height: 70rpx;
  113. border-radius: 50%;
  114. }
  115. .line-bg {
  116. width: 100%;
  117. height: 100%;
  118. position: absolute;
  119. z-index: 0;
  120. top: 0;
  121. left: 0;
  122. }
  123. .line-name {
  124. position: absolute;
  125. font-size: 34rpx;
  126. font-weight: 400;
  127. color: #333333;
  128. line-height: 34rpx;
  129. margin-left: 42rpx;
  130. }
  131. .line-you {
  132. width: 32rpx;
  133. height: 32rpx;
  134. }
  135. }
  136. }
  137. .two-model {
  138. margin-top: 29rpx;
  139. flex-wrap: wrap;
  140. .second-line {
  141. width: 343rpx;
  142. height: 110rpx;
  143. justify-content: center;
  144. padding-left: 39rpx;
  145. position: relative;
  146. &:not(:first-child) {
  147. margin-top: 16rpx;
  148. }
  149. .line-bg {
  150. width: 100%;
  151. height: 100%;
  152. position: absolute;
  153. z-index: 0;
  154. top: 0;
  155. left: 0;
  156. }
  157. .line-title {
  158. position: absolute;
  159. font-size: 40rpx;
  160. font-weight: 500;
  161. line-height: 32rpx;
  162. }
  163. .line-msg {
  164. position: absolute;
  165. margin-top: 100rpx;
  166. font-size: 26rpx;
  167. font-weight: 400;
  168. color: #666666;
  169. line-height: 26rpx;
  170. }
  171. }
  172. .line1 {
  173. width: 100%;
  174. height: 171rpx;
  175. .line-title {
  176. font-size: 40rpx;
  177. font-weight: 500;
  178. line-height: 40rpx;
  179. }
  180. }
  181. }
  182. .three-model {
  183. margin-top: 32rpx;
  184. width: 100%;
  185. height: 100%;
  186. padding: 0 12rpx;
  187. .second-line {
  188. height: 120rpx;
  189. border-bottom: 1px solid #efefef;
  190. position: relative;
  191. .line-name {
  192. font-size: 34rpx;
  193. font-weight: 400;
  194. color: #007bd7;
  195. line-height: 34rpx;
  196. margin-left: 42rpx;
  197. }
  198. .line-you {
  199. width: 32rpx;
  200. height: 32rpx;
  201. }
  202. }
  203. }
  204. </style>