演示项目-图书馆
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.

263 lines
8.5 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="main">
  3. <div class="cart-main">
  4. <div class="cart-top">
  5. <div class="cart-num">图书数量<span>(5)</span></div>
  6. <span @click="cartDelt">{{ !isDeltHandle ? '管理' : '完成' }}</span>
  7. </div>
  8. <div class="cart-list">
  9. <div class="cart-item">
  10. <div class="list-top">
  11. <van-checkbox v-model="checked"></van-checkbox>
  12. <div class="top-info">
  13. <p class="active-name">你选书我买单<i></i></p>
  14. <p class="dealer">京东商城</p>
  15. </div>
  16. </div>
  17. <div class="product-list">
  18. <div class="product-item">
  19. <van-checkbox v-model="checked"></van-checkbox>
  20. <div class="product-cont">
  21. <div class="product-img"><img src="" alt="" /></div>
  22. <div class="product-txt">
  23. <div class="product-info">
  24. <h4 class="overflow-txt-only">秒懂AI提问让人工智能开发大脑 </h4>
  25. <div class="author-date">
  26. <p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p>
  27. <p class="date overflow-txt-only ">2023年07月</p>
  28. </div>
  29. <div class="intro overflow-txt">精心提炼20种GPT提问方法及指令从入门到进阶再到精通100个案例带你玩</div>
  30. </div>
  31. <div class="product-bottom">
  32. <p class="product-price">实付款 <span><i class="rmb"></i>29.0</span><i>129.0</i></p>
  33. <span v-if="!isDeltHandle" class="product-num">x1</span>
  34. <span v-else class="item-delt"></span>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="product-item">
  40. <van-checkbox v-model="checked"></van-checkbox>
  41. <div class="product-cont">
  42. <div class="product-img"><img src="" alt="" /></div>
  43. <div class="product-txt">
  44. <div class="product-info">
  45. <h4 class="overflow-txt-only">秒懂AI提问让人工智能开发大脑 </h4>
  46. <div class="author-date">
  47. <p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p>
  48. <p class="date overflow-txt-only ">2023年07月</p>
  49. </div>
  50. <div class="intro overflow-txt">精心提炼20种GPT提问方法及指令从入门到进阶再到精通100个案例带你玩</div>
  51. </div>
  52. <div class="product-bottom">
  53. <p class="product-price">实付款 <span><i class="rmb"></i>29.0</span><i>129.0</i></p>
  54. <span v-if="!isDeltHandle" class="product-num">x1</span>
  55. <span v-else class="item-delt"></span>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="cart-item">
  63. <div class="list-top">
  64. <van-checkbox v-model="checked"></van-checkbox>
  65. <div class="top-info">
  66. <p class="active-name">你选书我买单<i></i></p>
  67. <p class="dealer">京东商城</p>
  68. </div>
  69. </div>
  70. <div class="product-list">
  71. <div class="product-item">
  72. <van-checkbox v-model="checked"></van-checkbox>
  73. <div class="product-cont">
  74. <div class="product-img"><img src="" alt="" /></div>
  75. <div class="product-txt">
  76. <div class="product-info">
  77. <h4 class="overflow-txt-only">秒懂AI提问让人工智能开发大脑 </h4>
  78. <div class="author-date">
  79. <p class="author overflow-txt-only">秋叶 刘进新 姜梅 定秋枫</p>
  80. <p class="date overflow-txt-only ">2023年07月</p>
  81. </div>
  82. <div class="intro overflow-txt">精心提炼20种GPT提问方法及指令从入门到进阶再到精通100个案例带你玩</div>
  83. </div>
  84. <div class="product-bottom">
  85. <p class="product-price">实付款 <span><i class="rmb"></i>29.0</span><i>129.0</i></p>
  86. <span v-if="!isDeltHandle" class="product-num">x1</span>
  87. <span v-else class="item-delt"></span>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="cart-pay">
  97. <van-checkbox v-model="checked">全选</van-checkbox>
  98. <div v-if="!isDeltHandle" class="payment-right">
  99. <div class="total-num">合计:<span><i class="rmb"></i>0</span></div>
  100. <p class="pay-btn" @click="goPay">下单</p>
  101. </div>
  102. <div v-else class="payment-right">
  103. <p class="delt-btn" @click="confirmDelt">删除</p>
  104. </div>
  105. </div>
  106. <TabBar :tabCur.sync="tabCur" />
  107. </div>
  108. </template>
  109. <script>
  110. import { Toast } from 'vant'
  111. import { reactive, computed, onMounted, getCurrentInstance, toRefs } from 'vue'
  112. import TabBar from '@/components/tabBar/index.vue'
  113. export default {
  114. name: 'Cart',
  115. components: { TabBar },
  116. setup() {
  117. const { proxy } = getCurrentInstance()
  118. let data = reactive({
  119. tabCur: 1,
  120. checked: false,
  121. isDeltHandle: false
  122. })
  123. onMounted(() => {})
  124. let goPay = () => {
  125. proxy.$router.push({ path: '/CartResult' })
  126. }
  127. let cartDelt = () =>{
  128. data.isDeltHandle = !data.isDeltHandle
  129. }
  130. return {
  131. ...toRefs(data),
  132. goPay,
  133. cartDelt
  134. }
  135. },
  136. }
  137. </script>
  138. <style scoped lang="scss">
  139. .cart-main{
  140. padding: 0 .16rem 2.2rem .16rem;
  141. color: #191A1A;
  142. .cart-top{
  143. position: fixed;
  144. top: 0;
  145. right: 0;
  146. left: 0;
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. font-size: .32rem;
  151. padding: .18rem .32rem;
  152. background-color: #F4F4FC;
  153. z-index: 999;
  154. .cart-num{
  155. font-size: .32rem;
  156. opacity: 0.6;
  157. span{
  158. font-size: 0.3rem;
  159. }
  160. }
  161. }
  162. }
  163. .cart-list{
  164. padding-top: 1rem;
  165. }
  166. .cart-item{
  167. padding: .24rem;
  168. margin-bottom: .2rem;
  169. box-shadow: 0px .03rem 0.6rem 1px rgba(0,0,0,0.08);
  170. border-radius: 0.1rem;
  171. background-color: #fff;
  172. }
  173. .product-list{
  174. .product-item{
  175. display: flex;
  176. justify-content: flex-start;
  177. margin-top: .3rem;
  178. }
  179. }
  180. .cart-pay{
  181. position: fixed;
  182. left: 0;
  183. right: 0;
  184. bottom: 0.98rem;
  185. padding: 0 .32rem;
  186. height: 1rem;
  187. background: linear-gradient(#fff, #f1f1f1);
  188. display: flex;
  189. justify-content: space-between;
  190. align-items: center;
  191. .payment-right{
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. font-size: .28rem;
  196. .total-num{
  197. font-size: 0.28rem;
  198. span{
  199. font-size: .4rem;
  200. font-weight: bold;
  201. color: #FF3871;
  202. .rmb{
  203. font-style: normal;
  204. font-size: .28rem;
  205. text-decoration: none;
  206. }
  207. }
  208. }
  209. .pay-btn{
  210. width: 1.5rem;
  211. height: 0.6rem;
  212. margin-left: 0.4rem;
  213. line-height: 0.6rem;
  214. text-align: center;
  215. color: #fff;
  216. background: url('@assets/images/btn3.png') no-repeat center center;
  217. background-size: 100% 100%;
  218. }
  219. .delt-btn{
  220. width: 1.5rem;
  221. height: 0.6rem;
  222. line-height: 0.6rem;
  223. font-size: .28rem;
  224. color: #000;
  225. text-align: center;
  226. border: 0.02rem solid #000;
  227. opacity: 0.6;
  228. border-radius: .4rem;
  229. }
  230. }
  231. }
  232. .van-checkbox{
  233. margin-right: .2rem;
  234. }
  235. :deep(.van-checkbox__icon){
  236. height: .35rem;
  237. }
  238. :deep(.van-checkbox__icon .van-icon){
  239. width: .35rem;
  240. height: .35rem;
  241. border-color: rgba(0,0,0,.3);
  242. }
  243. :deep(.van-checkbox__icon--checked .van-icon){
  244. border: none;
  245. background: url('@assets/images/selected.png') no-repeat transparent;
  246. background-size: .35rem .35rem;
  247. }
  248. :deep(.van-icon-success:before){
  249. display: none;
  250. }
  251. :deep(.van-checkbox__label){
  252. font-size: .28rem;
  253. }
  254. </style>