updown.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="page">
  3. <u-checkbox-group @change="checkboxGroupChange">
  4. <view class="item u-flex" v-for="(item,index) in list" :key="index">
  5. <u-checkbox @change="checkboxChange" shape="circle" v-model="item.checked"></u-checkbox>
  6. <view class="box">
  7. <image :src="item.image" style="width: 120rpx ;height: 160rpx;" mode=""></image>
  8. </view>
  9. <view class=""
  10. style="justify-content: space-between;padding: 4rpx 0 ;height: 160rpx;display: flex;flex-direction: column;">
  11. <view class="">
  12. <view class="title u-line-1">{{item.title}}</view>
  13. <view class="writer">资源类型:付费资源</view>
  14. </view>
  15. <view class="money">¥{{item.entity_price}}</view>
  16. </view>
  17. </view>
  18. </u-checkbox-group>
  19. <view class="" style="height: 160rpx;"></view>
  20. <view class="bottom u-flex u-row-between">
  21. <view class="u-flex">
  22. <view class="" @click="checkedAll">
  23. <u-checkbox-group>
  24. <u-checkbox shape="circle" v-model="all"></u-checkbox>
  25. </u-checkbox-group>
  26. <text class="All">全选</text>
  27. </view>
  28. <view class="" style="margin-left: 24rpx;">
  29. <view class="">
  30. <text class="all">合计:</text>
  31. <text class="mi">¥</text>
  32. <text class="mi" style="font-size: 36rpx;">325.00</text>
  33. </view>
  34. <view class="">
  35. <text class="num">12</text>
  36. <text class="fcai">份资料</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="btn" @click="orderinfo">
  41. 下载资源
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. change: 0,
  51. all: false,
  52. list: [],
  53. series_id: ''
  54. };
  55. },
  56. onLoad(options) {
  57. this.series_id = options.id
  58. this.getSeriesBooks()
  59. },
  60. methods: {
  61. checkboxChange(e) {
  62. console.log(e);
  63. },
  64. // 系列列表
  65. getSeriesBooks() {
  66. this.$u.post('api/books/getSeriesBooks', {
  67. series_id: this.series_id
  68. }).then(res => {
  69. this.list = res.data
  70. this.list.map(item => {
  71. item.checked = false
  72. })
  73. })
  74. },
  75. //订单确认
  76. orderinfo() {
  77. this.$u.post('', {
  78. goods_id: '',
  79. type: ''
  80. }).then(res => {
  81. if (res.code == 1) {
  82. setTimeout(() => {
  83. uni.navigateTo({
  84. url: '/pages/index/orderinfo'
  85. })
  86. }, 800)
  87. }
  88. })
  89. },
  90. //全选
  91. checkedAll() {
  92. if (this.all == true) {
  93. this.list.map(val => {
  94. val.checked = false;
  95. this.all = true
  96. console.log(111);
  97. })
  98. } else {
  99. this.list.map(val => {
  100. val.checked = true;
  101. this.all = false
  102. console.log(222);
  103. })
  104. }
  105. console.log('all', this.all);
  106. },
  107. checkboxGroupChange(e) {
  108. console.log(e);
  109. if (e.length == this.list.length) {
  110. this.all = true
  111. }
  112. this.list.map(val => {
  113. if (val.checked == false) {
  114. this.all = false
  115. }
  116. })
  117. },
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. .num {
  123. font-size: 28rpx;
  124. font-family: JDZhengHT, JDZhengHT;
  125. font-weight: 400;
  126. color: #CF1534;
  127. }
  128. .fcai {
  129. font-size: 24rpx;
  130. font-family: PingFangSC, PingFang SC;
  131. font-weight: 400;
  132. color: #131415;
  133. }
  134. .All {
  135. font-size: 24rpx;
  136. font-family: PingFangSC, PingFang SC;
  137. font-weight: 400;
  138. color: #888888;
  139. margin-left: -16rpx
  140. }
  141. .mi {
  142. font-size: 28rpx;
  143. font-family: JDZhengHT, JDZhengHT;
  144. font-weight: 400;
  145. color: #CF1534;
  146. }
  147. .all {
  148. font-size: 26rpx;
  149. font-family: PingFangSC, PingFang SC;
  150. font-weight: 400;
  151. color: #131415;
  152. }
  153. .btn {
  154. width: 252rpx;
  155. height: 88rpx;
  156. background: #06A971;
  157. border-radius: 12rpx;
  158. font-size: 32rpx;
  159. font-family: PingFangSC, PingFang SC;
  160. font-weight: 500;
  161. color: #FFFFFF;
  162. line-height: 88rpx;
  163. text-align: center;
  164. }
  165. .money {
  166. font-size: 32rpx;
  167. font-family: SFPro, SFPro;
  168. font-weight: 400;
  169. color: #CF1534;
  170. }
  171. .title {
  172. width: 402rpx;
  173. font-size: 28rpx;
  174. font-family: PingFangSC, PingFang SC;
  175. font-weight: 500;
  176. color: #222222;
  177. }
  178. .writer {
  179. font-size: 24rpx;
  180. font-family: PingFangSC, PingFang SC;
  181. font-weight: 400;
  182. color: #444444;
  183. margin-top: 12rpx;
  184. }
  185. .box {
  186. width: 160rpx;
  187. height: 160rpx;
  188. border: 1rpx solid rgba(151, 151, 151, 0.1);
  189. padding: 0 20rpx;
  190. }
  191. .bottom {
  192. width: 100%;
  193. height: 166rpx;
  194. background: #FFFFFF;
  195. position: fixed;
  196. bottom: 0;
  197. left: 0;
  198. padding: 0 28rpx;
  199. }
  200. .item {
  201. width: 100%;
  202. height: 216rpx;
  203. background: #FFFFFF;
  204. border-radius: 16rpx;
  205. margin-top: 20rpx;
  206. padding: 28rpx 24rpx;
  207. }
  208. .page {
  209. background-color: #f4f4f4;
  210. min-height: 100vh;
  211. padding: 0 28rpx;
  212. overflow: hidden;
  213. }
  214. </style>