yueList.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="content">
  3. <!-- <view class="top">
  4. <view class="Search-box">
  5. <view class="Search-box-size">
  6. <image class="box-img" src="../../static/images/img01.png"></image>
  7. <input type="text" class="box-word" placeholder="请输入关键字" v-model="keyword" />
  8. </view>
  9. <view class="Search-box-sort" @click="messagesearch">搜索</view>
  10. </view>
  11. </view> -->
  12. <!-- <view class="list-box" v-for="(item,index) in science" :key='index' @click="Jump(item.id)">
  13. <view class="box-left">
  14. <image :src="$store.state.baseURL + item.image" mode="" class="left-img"></image>
  15. </view>
  16. <view class="box-right">
  17. <view class="right-top word1_ellipsis">
  18. {{item.title}}
  19. </view>
  20. <view class="right-center">
  21. {{item.synopsis}}
  22. </view>
  23. </view>
  24. </view> -->
  25. <view class="list-box" v-for="(item,index) in science" :key='index' @click="Jump(item.id,item.plan_id)">
  26. <view class="box-left">
  27. <image :src="$store.state.baseURL + item.image" mode="" class="left-img"></image>
  28. </view>
  29. <view class="box-right">
  30. <view class="right-top word1_ellipsis">
  31. {{item.order_name}}
  32. </view>
  33. <view class="right-center">
  34. 每月捐款金额:{{item.price}}
  35. </view>
  36. <view class="right-foot">
  37. 当前状态:{{item.is_signing == 0 ?'进行中': '已停止'}}
  38. </view>
  39. </view>
  40. </view>
  41. <!-- <view class="xq" v-for="item in science" @click="Jump(item.id)">
  42. <view class="line flex">
  43. <image src="../../static/icon/dk1.png" mode=""></image>
  44. <view class="name">
  45. 捐款项目
  46. </view>
  47. <view class="val">
  48. {{item.order_name}}
  49. </view>
  50. </view>
  51. <view class="line flex">
  52. <image src="../../static/icon/dk2.png" mode=""></image>
  53. <view class="name">
  54. 每月捐款金额
  55. </view>
  56. <view class="val">
  57. {{item.price}}元
  58. </view>
  59. </view>
  60. <view class="line flex">
  61. <image src="../../static/icon/dk3.png" mode=""></image>
  62. <view class="name">
  63. 支付方式
  64. </view>
  65. <view class="val">
  66. 微信支付
  67. </view>
  68. </view>
  69. </view> -->
  70. <!-- <uni-load-more :status="loadingType"></uni-load-more> -->
  71. </view>
  72. </template>
  73. <script>
  74. import { getArticList} from '@/api/index.js';
  75. import { getMyPlan} from '@/api/money.js';
  76. export default{
  77. data(){
  78. return{
  79. keyword:'',
  80. science:[],
  81. page: 1,
  82. limit: 10,
  83. loadingType:'more'
  84. }
  85. },
  86. onLoad() {
  87. this.loadData();
  88. },
  89. onReachBottom() {
  90. this.loadData()
  91. },
  92. filters: {
  93. time(val) {
  94. let arr = val.split(' ')
  95. return arr[0]
  96. }
  97. },
  98. methods:{
  99. messagesearch() {
  100. let keyword = this.keyword;
  101. console.log(keyword);
  102. let arrlist = [];
  103. for (let i = 0; i < this.science.length; i++) {
  104. if (this.science[i].title.indexOf(keyword) != -1) {
  105. arrlist.push(this.science[i]);
  106. }
  107. }
  108. this.science = arrlist;
  109. if (keyword == '') {
  110. this.loadData();
  111. }
  112. },
  113. loadData(){
  114. let obj = this;
  115. if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  116. return
  117. }
  118. obj.loadingType = 'loading'
  119. getMyPlan({
  120. page: obj.page,
  121. limit: obj.limit
  122. }).then(({ data }) => {
  123. obj.science = obj.science.concat(data.data);
  124. obj.page++
  125. if(obj.limit == data.data.length) {
  126. obj.loadingType = 'more'
  127. }else {
  128. obj.loadingType = 'noMore'
  129. }
  130. });
  131. },
  132. Jump(id,plan_id) {
  133. uni.navigateTo({
  134. url:"/pages/index/dk?id="+id + '&plan_id=' + plan_id
  135. })
  136. },
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. //搜索框
  142. .Search-box {
  143. padding-left: 20rpx;
  144. padding-right: 20rpx;
  145. height: 100rpx;
  146. background: #ffffff;
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. .Search-box-sort {
  151. font-size: 30rpx;
  152. font-weight: 500;
  153. color: rgba(102, 102, 102, 1);
  154. .sort-text {
  155. width: 57rpx;
  156. height: 29rpx;
  157. font-size: 30rpx;
  158. font-weight: 500;
  159. color: rgba(51, 51, 51, 1);
  160. line-height: 58rpx;
  161. margin-right: 19rpx;
  162. }
  163. .sort-img {
  164. width: 21rpx;
  165. height: 11rpx;
  166. margin-bottom: 4rpx;
  167. }
  168. }
  169. .Search-box-size {
  170. width: 630rpx;
  171. height: 65rpx;
  172. border-radius: 32rpx;
  173. background-color: #f1f1f1;
  174. padding-left: 36rpx;
  175. display: flex;
  176. align-items: center;
  177. .box-img {
  178. height: 32rpx;
  179. width: 32rpx;
  180. margin-right: 16rpx;
  181. }
  182. .box-word {
  183. width: 100%;
  184. font-size: 22rpx;
  185. font-weight: 500;
  186. color: rgba(205, 203, 203, 1);
  187. line-height: 55rpx;
  188. }
  189. }
  190. }
  191. .content{
  192. line-height: 1;
  193. .list-box{
  194. width: 725rpx;
  195. height: 200rpx;
  196. margin: 20rpx auto 0;
  197. background: #FFFFFF;
  198. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  199. border-radius: 7rpx;
  200. padding:0 20rpx;
  201. display: flex;
  202. align-items: center;
  203. .box-left{
  204. width: 230rpx;
  205. height: 145rpx;
  206. margin-right: 20rpx;
  207. .left-img{
  208. width: 230rpx;
  209. height: 145rpx;
  210. }
  211. }
  212. .box-right{
  213. width: 430rpx;
  214. height: 145rpx;
  215. position: relative;
  216. .right-top{
  217. font-size: 25rpx;
  218. font-weight: bold;
  219. color: #333333;
  220. margin-bottom: 24rpx;
  221. }
  222. .right-center{
  223. width: 362rpx;
  224. // height: 53rpx;
  225. font-size: 21rpx;
  226. font-weight: bold;
  227. color: #999999;
  228. line-height: 33rpx;
  229. overflow: hidden;
  230. text-overflow: ellipsis;
  231. display: -webkit-box;
  232. -webkit-line-clamp: 2;//在第几行显示...
  233. -webkit-box-orient: vertical;
  234. }
  235. .right-foot{
  236. font-size: 21rpx;
  237. font-weight: bold;
  238. color: #999999;
  239. line-height: 31rpx;
  240. text-align: right;
  241. // margin-top: 13rpx;
  242. position: absolute;
  243. right: 0;
  244. bottom: 0;
  245. }
  246. }
  247. }
  248. }
  249. .xq {
  250. margin: 20rpx 0;
  251. background-color: #fff;
  252. padding: 45rpx 0;
  253. .line {
  254. align-items: center;
  255. padding: 30rpx 27rpx 30rpx 33rpx;
  256. * {
  257. flex-shrink: 0;
  258. }
  259. image {
  260. width: 34rpx;
  261. height: 34rpx;
  262. }
  263. .name {
  264. font-weight: bold;
  265. font-size: 30rpx;
  266. color: #333333;
  267. padding-left: 12rpx;
  268. }
  269. .val {
  270. flex-grow: 1;
  271. font-size: 26rpx;
  272. color: #666666;
  273. text-align: right;
  274. }
  275. }
  276. }
  277. </style>