shoppingCart.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false" title="购物车" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  4. <view class="slot-wrap">
  5. <image src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  6. </view>
  7. </u-navbar>
  8. <view style="padding: 30rpx;padding-bottom: 98rpx;">
  9. <uni-swipe-action>
  10. <u-checkbox-group
  11. v-model="checkboxValue1"
  12. placement="column"
  13. @change="checkboxChange">
  14. <uni-swipe-action-item :autoClose="false" @change="swipeChange($event, item)" :show="item.show" v-for="(item,index) in list" :key="index" >
  15. <view class="item">
  16. <view>
  17. <view style="display: flex;justify-content: space-between;padding-bottom: 15rpx;">
  18. <view style="display: flex;align-items:center;">
  19. <u-checkbox
  20. v-model="item.checked"
  21. shape="circle"
  22. :name="item.name">
  23. </u-checkbox>
  24. </view>
  25. <image src="/static/login_bg.jpg" style="height: 134rpx;width: 388rpx;border-radius: 16rpx;"></image>
  26. <view style="margin-left: 20rpx;">
  27. <view style="color: #333333;font-size: 30rpx;font-weight: bold;">
  28. 2020年二建建筑工程管理与实
  29. 务(实务专题班)
  30. </view>
  31. <view class="priceTag">
  32. ¥ 999.00
  33. </view>
  34. </view>
  35. </view>
  36. <u-line color="#D6D6DB" />
  37. <view style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(index)">
  38. <view style="color: #666666;font-size: 24rpx;margin-left: 60rpx;">选择班级</view>
  39. <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  40. </view>
  41. </view>
  42. </view>
  43. <template v-slot:right>
  44. <view class="operate" @click="delItem(item)">
  45. <view ><text>删除</text></view>
  46. </view>
  47. </template>
  48. </uni-swipe-action-item>
  49. </u-checkbox-group>
  50. </uni-swipe-action>
  51. </view>
  52. <view class="bottomBox">
  53. <view>
  54. <u-checkbox
  55. label="all"
  56. name="all"
  57. shape="circle"
  58. @change="checkboxAllChange"
  59. v-model="allChecked"
  60. >
  61. </u-checkbox>
  62. <text>全选</text>
  63. </view>
  64. <view style="display: flex;align-items: center;">
  65. <view style="color: #999999;margin-right: 8rpx;">合计</view>
  66. <view class="priceTag">¥ 999.00</view>
  67. <view style="display: flex;color: #FFFFFF;align-items: center;">
  68. <view class="btn2" @click="goBuy()">结算</view>
  69. </view>
  70. </view>
  71. </view>
  72. <u-popup v-model="show" mode="bottom"border-radius="40">
  73. <view class="popup_box">
  74. <view style="margin-bottom: 20rpx;">
  75. <view class="line1"></view>
  76. <view class="grade">选择班级</view>
  77. </view>
  78. <u-line color="#D6D6DB" />
  79. <view>
  80. <scroll-view scroll-y="true" style="height: 500rpx;">
  81. <view>
  82. <u-checkbox-group @change="checkboxGroupChange">
  83. <view v-for="(item, index) in list" :key="index" >
  84. <view style="display: flex;align-items: center;padding: 20rpx;">
  85. <view>
  86. <u-checkbox
  87. shape="circle"
  88. @change="checkboxChange"
  89. v-model="item.checked"
  90. :name="item.name"
  91. ></u-checkbox>
  92. </view>
  93. <view :class="item.checked?'white-box blue-box':'white-box'" >
  94. <view>
  95. <view class="blackTxt">2021年第1期二级建造师继续教育选修课(市政)标题过长换行显示</view>
  96. <view class="redTxt">有效期至:2021/11/30</view>
  97. <view class="redTxt">本班还剩41天将结束学习</view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </u-checkbox-group>
  103. </view>
  104. </scroll-view>
  105. </view>
  106. <view class="confrim-btn">
  107. <view class="okBtn">确定</view>
  108. </view>
  109. </view>
  110. </u-popup>
  111. <u-popup v-model="show1" mode="bottom"border-radius="40">
  112. <view class="popup_box">
  113. <view style="margin-bottom: 20rpx;">
  114. <view class="line1"></view>
  115. <view class="grade">选择考期/地区</view>
  116. </view>
  117. <u-line color="#D6D6DB" />
  118. <view style="display: flex;height: 500rpx;">
  119. <view style="width: 50%;">
  120. <view class="topTxt">考期</view>
  121. <view>
  122. <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
  123. <picker-view-column>
  124. <view class="picker-item" v-for="(item,index) in list1" :key="index">{{item.label}}</view>
  125. </picker-view-column>
  126. </picker-view>
  127. </view>
  128. </view>
  129. <view style="width: 50%;">
  130. <view class="topTxt">地区</view>
  131. <view>
  132. <picker-view :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
  133. <picker-view-column>
  134. <view class="picker-item" v-for="(item,index) in list2" :key="index">{{item.label}}</view>
  135. </picker-view-column>
  136. <picker-view-column>
  137. <view class="picker-item" v-for="(item,index) in list3" :key="index">{{item.label}}</view>
  138. </picker-view-column>
  139. </picker-view>
  140. </view>
  141. </view>
  142. </view>
  143. <view class="confrim-btn">
  144. <view class="okBtn">确定</view>
  145. </view>
  146. </view>
  147. </u-popup>
  148. </view>
  149. </template>
  150. <script>
  151. export default {
  152. data() {
  153. return {
  154. allChecked:false,
  155. checkboxValue1:[],
  156. list: [{
  157. name: 'apple',
  158. checked: false,
  159. disabled: false,
  160. show: false
  161. },
  162. {
  163. name: 'banner',
  164. checked: false,
  165. disabled: false,
  166. show: false
  167. },
  168. {
  169. name: 'orange',
  170. checked: false,
  171. disabled: false,
  172. show: false
  173. }
  174. ],
  175. list1:[
  176. {
  177. value: '1',
  178. label: '2021年6月'
  179. },
  180. {
  181. value: '2',
  182. label: '2021年7月'
  183. }
  184. ],
  185. list1:[
  186. {
  187. value: '1',
  188. label: '2021年6月'
  189. },
  190. {
  191. value: '2',
  192. label: '2021年7月'
  193. },
  194. {
  195. value: '3',
  196. label: '2021年8月'
  197. },
  198. {
  199. value: '4',
  200. label: '2021年9月'
  201. }
  202. ],
  203. list2:[
  204. {
  205. value: '1',
  206. label: '广东'
  207. },
  208. {
  209. value: '2',
  210. label: '北京'
  211. }
  212. ],
  213. list3:[
  214. {
  215. value: '1',
  216. label: '广州'
  217. },
  218. {
  219. value: '2',
  220. label: '深圳'
  221. }
  222. ],
  223. value1:'',
  224. show:false,
  225. show1:false
  226. }
  227. },
  228. methods: {
  229. delItem(option) {
  230. console.log(option)
  231. },
  232. swipeChange(e, item) {
  233. item.show = e;
  234. },
  235. goBuy(){
  236. this.$navTo.togo('/pages2/order/confirm_pay');
  237. },
  238. checkboxChange(n) {
  239. console.log('change', n);
  240. },
  241. openPopup(index){
  242. if(index==0){
  243. this.show = true
  244. }else{
  245. this.show1 = true
  246. }
  247. },
  248. checkboxAllChange(n){
  249. console.log(this.allChecked,n)
  250. if(n.value){
  251. for(let i =0;i<this.list.length;i++){
  252. this.list[i].checked = true
  253. }
  254. }else{
  255. for(let i =0;i<this.list.length;i++){
  256. this.list[i].checked = false
  257. }
  258. }
  259. }
  260. }
  261. }
  262. </script>
  263. <style >
  264. page{
  265. background-color: #EAEEF1;
  266. }
  267. </style>
  268. <style scoped>
  269. .operate{
  270. background-color: #FF3B30;
  271. color: #FFFFFF;
  272. border-top-right-radius: 16rpx;
  273. border-bottom-right-radius: 16rpx;
  274. margin-bottom: 20rpx;
  275. display: flex;
  276. align-items:center;
  277. justify-content:center;
  278. padding: 0 20rpx;
  279. }
  280. .picker-item {
  281. height: 50px;
  282. align-items: center;
  283. justify-content: center;
  284. text-align: center;
  285. }
  286. .picker-view {
  287. width: 100%;
  288. height: 420rpx;
  289. text-align: center;
  290. }
  291. .topTxt{
  292. font-size: 30rpx;
  293. color: #666666;
  294. text-align: center;
  295. padding: 20rpx 0;
  296. }
  297. .blackTxt{
  298. font-size: 30rpx;
  299. font-family: PingFang SC;
  300. font-weight: bold;
  301. color: #333333;
  302. }
  303. .redTxt{
  304. font-size: 30rpx;
  305. font-family: PingFang SC;
  306. color: #FF2D55;
  307. margin-top: 13rpx;
  308. }
  309. .blue-box{
  310. background: #EBF5FF;
  311. }
  312. .white-box{
  313. width: 646rpx;
  314. height: 220rpx;
  315. border-radius: 24rpx;
  316. align-items: center;
  317. display: flex;
  318. padding-left: 15rpx;
  319. }
  320. .okBtn{
  321. width: 200rpx;
  322. height: 64rpx;
  323. background: linear-gradient(0deg, #015EEA, #00C0FA);
  324. border-radius: 32rpx;
  325. color: #FFFFFF;
  326. text-align: center;
  327. line-height: 64rpx;
  328. }
  329. .confrim-btn{
  330. height: 98rpx;
  331. width: 100%;
  332. display: flex;
  333. align-items: center;
  334. justify-content:center;
  335. }
  336. .grade{
  337. height: 23rpx;
  338. font-size: 24rpx;
  339. color: #999999;
  340. margin: 0 auto;
  341. margin-top: 15rpx;
  342. text-align: center;
  343. }
  344. .line1{
  345. width: 80rpx;
  346. height: 8rpx;
  347. background: #999999;
  348. border-radius: 4rpx;
  349. margin: 0 auto;
  350. margin-top: 15rpx;
  351. }
  352. .popup_box {
  353. height: 700rpx;
  354. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  355. border-radius: 32rpx 32rpx 0rpx 0rpx;
  356. }
  357. .item{
  358. width: 100%;
  359. background: #FFFFFF;
  360. border-radius: 16rpx;
  361. margin-bottom: 20rpx;
  362. padding: 15rpx;
  363. display: flex;
  364. }
  365. .priceTag{
  366. font-size: 30rpx;
  367. font-family: PingFang SC;
  368. font-weight: bold;
  369. color: #FF2D55;
  370. display: flex;
  371. flex-direction: row-reverse;
  372. margin-right: 8rpx;
  373. }
  374. .btn2{
  375. width: 200rpx;
  376. height: 64rpx;
  377. background: linear-gradient(0deg, #015EEA, #00C0FA);
  378. border-radius: 32rpx;
  379. text-align: center;
  380. line-height: 64rpx;
  381. }
  382. .bottomBox{
  383. position: fixed;
  384. bottom: 0;
  385. width: 100%;
  386. left: 0;
  387. height:98rpx ;
  388. background-color: #FFFFFF;
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. padding: 0 30rpx;
  393. }
  394. </style>