1 line
8.8 KiB
Plaintext
1 line
8.8 KiB
Plaintext
|
{"version":3,"file":"cart.js","sources":["../../../../../../src/modules/mall/index/cart.vue","../../../../../../uniPage:/bW9kdWxlcy9tYWxsL2luZGV4L2NhcnQudnVl"],"sourcesContent":["<template>\r\n <s-layout title=\"购物车\" tabbar=\"/modules/mall/index/cart\" :bgStyle=\"{ color: '#fff' }\">\r\n <s-empty\r\n v-if=\"state.list.length === 0\"\r\n text=\"购物车空空如也,快去逛逛吧~\"\r\n icon=\"/static/cart-empty.png\"\r\n />\r\n\r\n <!-- 头部 -->\r\n <view class=\"cart-box ss-flex ss-flex-col ss-row-between\" v-if=\"state.list.length\">\r\n <view class=\"cart-header ss-flex ss-col-center ss-row-between ss-p-x-30\">\r\n <view class=\"header-left ss-flex ss-col-center ss-font-26\">\r\n 共\r\n <text class=\"goods-number ui-TC-Main ss-flex\">{{ state.list.length }}</text>\r\n 件商品\r\n </view>\r\n <view class=\"header-right\">\r\n <button v-if=\"state.editMode\" class=\"ss-reset-button\" @tap=\"state.editMode = false\">\r\n 取消\r\n </button>\r\n <button v-else class=\"ss-reset-button ui-TC-Main\" @tap=\"state.editMode = true\">\r\n 编辑\r\n </button>\r\n </view>\r\n </view>\r\n <!-- 内容 -->\r\n <view class=\"cart-content ss-flex-1 ss-p-x-30 ss-m-b-40\">\r\n <view class=\"goods-box ss-r-10 ss-m-b-14\" v-for=\"item in state.list\" :key=\"item.id\">\r\n <view class=\"ss-flex ss-col-center\">\r\n <label class=\"check-box ss-flex ss-col-center ss-p-l-10\" @tap=\"onSelectSingle(item.id)\">\r\n <radio\r\n :checked=\"state.selectedIds.includes(item.id)\"\r\n color=\"var(--ui-BG-Main)\"\r\n style=\"transform: scale(0.8)\"\r\n @tap.stop=\"onSelectSingle(item.id)\"\r\n />\r\n </label>\r\n <s-goods-item\r\n :title=\"item.spu.name\"\r\n :img=\"item.spu.picUrl || item.goods.image\"\r\n :price=\"item.sku.price\"\r\n :skuText=\"\r\n item.sku.properties.length > 1\r\n ? item.sku.properties.reduce(\r\n (items2, items) => items2.valueName + ' ' + items.valueName,\r\n )\r\n : item.sku.properties[0].valueName\r\n \"\r\n priceColor=\"#FF3000\"\r\n :titleWidth=\"400\"\r\n >\r\n <template v-if=\"!state.editMode\" v-slot:tool>\r\n <su-number-box\r\n :min=\"0\"\r\n :max=\"item.sku.stock\"\r\n :step=\"1\"\r\n v-model=\"item.count\"\r\n @change=\"onNumberChange($event, item)\"\r\n />\r\n </template>\r\n </s-goods-item>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- 底部 -->\r\n <su-fixed bottom :val=\"48\" placeholder v-if=\"state.list.length > 0\" :isInset=\"false\">\r\n <view class=\"cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom\">\r\n <view class=\"footer-left ss-flex ss-col-center\">\r\n <label class=\"check-box ss-flex ss-col-center ss-p-r-30\" @tap=\"onSelectAll\">\r\n <radio\r\n :checked=\"state.isAllSelected\"\r\n color=\"var(--ui-BG-Main)\"\r\n style=\"transform: scale(0.8)\"\r\n @tap.stop=\"onSelectAll\"\r\n />\r\n <view class=\"ss-m-l-8\">全选</view>\r\n </label>\r\n <text>合计:</text>\r\n <view class=\"text-price price-text\">\r\n {{ fen2yuan(state.totalPriceSelected) }}\r\n </view>\r\n </view>\r\n <view class=\"footer-right\">\r\n <button\r\n v-if=\"state.editMode\"\r\n class=\"ss-reset-button ui-BG-Main-Gradient pay-btn ui-Shadow-Main\"\r\n @tap=\"onDelete\"\r\n >\r\n
|