index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <view class="uni-main">
  3. <view class="sticky-nav">
  4. <view class="nav-box">
  5. <text class="header-text">寺院</text>
  6. <image src="../../static/index/more_black_icon.png" class="header_operate" @click="showGongdengMask">
  7. </image>
  8. </view>
  9. </view>
  10. <view class="uni-list">
  11. <view class="uni-list-item" v-for="(item,index) in activityList" :key="index">
  12. <view class="uni-list-item_box">
  13. <view>
  14. <image :src="item.thumb" class="thumb"></image>
  15. </view>
  16. <view class="uni-list_text">
  17. <view class="text_title">{{item.title}}</view>
  18. <view class="text_desc">
  19. <text class="text_count">{{item.join_count}}人参与</text><text
  20. class="text_time">{{item.publish_at}}</text>
  21. </view>
  22. </view>
  23. <view class="uni-list_btn" v-if="item.type ==1">
  24. <navigator :url="'./activity?id='+item.id">代订</navigator>
  25. </view>
  26. <view class="uni-list_btn" v-if="item.type ==2">
  27. <navigator :url="'./activity?id='+item.id">助印</navigator>
  28. </view>
  29. <view class="uni-list_btn" v-if="item.type ==3">
  30. <navigator :url="'./activity?id='+item.id">供奉</navigator>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="uni-list-media">
  36. <view class="uni-list-media-header">
  37. <view class="list-media-header_text">
  38. <text class="text_title">优选寺院</text>
  39. <!-- <view class="text_operation"><text>推荐</text><img src="../../static/index/arrow_down.png" width="18"></view> -->
  40. </view>
  41. </view>
  42. <view class="uni-list-media-item" v-for="(item,index) in recommList" :key="index">
  43. <view class="uni-list-media-item_box">
  44. <navigator :url="'./detail?id='+item.id">
  45. <view>
  46. <image :src="item.thumb" class="thumb"></image>
  47. </view>
  48. <view class="uni-list_text">
  49. <text class="text_title">{{item.title}}</text>
  50. <text class="text_count"><img src="../../static/index/popular_value.png"
  51. width="9">{{item.count}}</text>
  52. </view>
  53. </navigator>
  54. </view>
  55. </view>
  56. </view>
  57. <u-mask :show="showMask" @click="showMask = false">
  58. <view class="wrap">
  59. <div class="shiyuan_operate_wrap shiyuan_operate_wrap_top">
  60. <view v-for="(item,index) in operateList" :key="index" class="operate_list">
  61. <view class="operate_item">
  62. <navigator :url="item.pages">
  63. <image :src="item.icon" class="oprate_icon" width="20"></image>
  64. <text class="oprate_content">{{item.content}}</text>
  65. </navigator>
  66. </view>
  67. </view>
  68. </div>
  69. </view>
  70. </u-mask>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. activityList: [],
  78. recommList: [],
  79. showMask: false, //是否显示遮罩层
  80. operateList: [{
  81. icon: '../../static/index/menu_history_icon.png',
  82. content: '我的活动',
  83. pages: '/pages/my/activity',
  84. }, {
  85. icon: '../../static/index/search_bold_icon.png',
  86. content: '搜索寺院',
  87. pages: '/pages/temple/search',
  88. }]
  89. }
  90. },
  91. onLoad(option) {
  92. this.getActivityList();
  93. this.getSiyuanList(option.keyword);
  94. },
  95. methods: {
  96. backHome() {
  97. location.href = "/pages/temple/index"
  98. },
  99. showGongdengMask() {
  100. this.showMask = true;
  101. },
  102. // 活动列表
  103. getActivityList() {
  104. let _uni = this
  105. uni.showLoading()
  106. this.$request.api('/api/activity/list', {}).then(res => {
  107. uni.hideLoading()
  108. if (res.success == true) {
  109. _uni.activityList = res.data
  110. }
  111. }).catch(err => {
  112. uni.showToast({
  113. title: typeof(err.msg) != 'undefined' ? err.msg : '服务器错误',
  114. icon: 'none'
  115. })
  116. })
  117. },
  118. // 寺院列表
  119. getSiyuanList(keyword){
  120. let _uni = this
  121. let params = {is_recommand: 1};
  122. if(typeof(keyword) != 'undefined' && keyword){
  123. params = {keyword: keyword}
  124. }
  125. this.$request.api('/api/siyuan/list', params).then(res => {
  126. if (res.success == true) {
  127. _uni.recommList = res.data
  128. }
  129. }).catch(err => {
  130. uni.showToast({
  131. title: typeof(err.msg) != 'undefined' ? err.msg : '服务器错误',
  132. icon: 'none'
  133. })
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style>
  140. page {
  141. background-color: rgb(247, 246, 242);
  142. }
  143. </style>
  144. <style lang="less" scoped>
  145. .uni-main {
  146. width: 100%;
  147. height: 100%;
  148. background-color: #f6f7f5;
  149. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  150. }
  151. .sticky-nav {
  152. position: sticky;
  153. width: 100%;
  154. top: 0;
  155. z-index: 1;
  156. }
  157. .nav-box {
  158. width: 100%;
  159. padding-top: 90rpx;
  160. display: flex;
  161. align-items: center;
  162. background: linear-gradient(rgb(255, 152, 101), rgb(255, 122, 85));
  163. height: 135rpx;
  164. padding-bottom: 50rpx;
  165. .header-text {
  166. font-size: 45rpx;
  167. color: #333;
  168. font-weight: bold;
  169. width: 100%;
  170. text-align: center;
  171. margin-left: 20rpx;
  172. }
  173. .header_operate {
  174. width: 48rpx;
  175. height: 46rpx;
  176. float: right;
  177. margin-right: 20rpx;
  178. }
  179. }
  180. .uni-list {
  181. margin: 20rpx 20rpx 15rpx 20rpx;
  182. }
  183. .uni-list-item {
  184. padding: 20rpx 30rpx;
  185. margin-bottom: 12rpx;
  186. background-color: #FFFFFF;
  187. border-radius: 8rpx;
  188. position: relative;
  189. }
  190. .uni-list-item_box .thumb {
  191. width: 100%;
  192. height: 200rpx;
  193. border-radius: 8rpx;
  194. }
  195. .uni-list_text .text_title {
  196. font-size: 32rpx;
  197. font-weight: bold;
  198. padding: 4rpx 0rpx;
  199. }
  200. .uni-list_text .text_count {
  201. margin-right: 20rpx;
  202. }
  203. .uni-list_text .text_time {
  204. color: #999;
  205. }
  206. .uni-list .uni-list_btn {
  207. text-align: center;
  208. min-width: 120rpx;
  209. position: absolute;
  210. right: 40rpx;
  211. bottom: 40rpx;
  212. background-color: #ccac56;
  213. color: #fff;
  214. border-radius: 30rpx;
  215. padding: 8rpx 20rpx;
  216. display: inline-block;
  217. }
  218. .uni-list-media {
  219. background-color: #fff;
  220. margin: 0rpx 20rpx 4rpx;
  221. border-radius: 8rpx;
  222. }
  223. .uni-list-media-header {
  224. padding: 20rpx 20rpx 24rpx;
  225. }
  226. .uni-list-media-header .text_title {
  227. font-size: 36rpx;
  228. font-weight: bold;
  229. }
  230. .uni-list-media-header .text_operation {
  231. display: inline-block;
  232. float: right;
  233. color: #999;
  234. font-size: 24rpx;
  235. margin-top: 4rpx;
  236. }
  237. .uni-list-media-header .text_operation img {
  238. vertical-align: middle;
  239. }
  240. .uni-list-media-item {
  241. width: calc(50% - 16rpx);
  242. display: inline-block;
  243. margin: 0rpx 8rpx;
  244. margin-bottom: 20rpx;
  245. }
  246. .uni-list-media-item_box {
  247. width: 100%;
  248. height: 100%;
  249. }
  250. .uni-list-media-item .thumb {
  251. width: 100%;
  252. height: 200rpx;
  253. }
  254. .uni-list-media-item .text_title {
  255. font-weight: normal;
  256. padding: 8rpx 0rpx;
  257. }
  258. .uni-list-media-item .text_count {
  259. float: right;
  260. margin-right: 6rpx;
  261. color: #cc540e;
  262. font-size: 24rpx;
  263. line-height: 40rpx;
  264. }
  265. .uni-list-media-item .text_count img {
  266. margin-right: 6rpx;
  267. }
  268. .wrap {
  269. position: fixed;
  270. top: 140rpx;
  271. right: 0;
  272. .shiyuan_operate_wrap {
  273. width: 300rpx;
  274. // height: 430rpx;
  275. background-color: #fff;
  276. border-radius: 10rpx;
  277. position: relative;
  278. .operate_list {
  279. margin: 0 5rpx 0 25rpx;
  280. border-bottom: 1rpx solid rgb(165, 165, 165);
  281. .operate_item {
  282. padding: 27rpx 5rpx 27rpx 25rpx;
  283. display: flex;
  284. align-items: center;
  285. }
  286. .oprate_icon {
  287. width: 50rpx;
  288. height: 50rpx;
  289. padding-right: 15rpx;
  290. }
  291. .oprate_content {
  292. font-size: 35rpx;
  293. }
  294. }
  295. .operate_list:last-of-type {
  296. border-bottom: none;
  297. }
  298. }
  299. .shiyuan_operate_wrap_top::before {
  300. content: '';
  301. position: absolute;
  302. width: 0;
  303. height: 0;
  304. left: 220rpx;
  305. top: -52rpx;
  306. border: 25rpx solid;
  307. border-color: transparent transparent rgb(255, 255, 255) transparent;
  308. /*上 右 下 左 */
  309. }
  310. }
  311. </style>