cart.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <!-- 购物车 -->
  3. <view>
  4. <u-navbar :safeAreaInsetTop="true" :placeholder='true'>
  5. <view class="u-nav-slot" slot="left">
  6. <view class="">
  7. <text class="shopcart">{{i18n.Shopping}}</text>
  8. <text class="sum">(12)</text>
  9. </view>
  10. </view>
  11. <view class="u-nav-slot" slot="right">
  12. <view class="u-flex">
  13. <text @click="admin" v-if="success">{{i18n.manage}}</text>
  14. <text @click="admin" v-else>{{i18n.complete}}</text>
  15. <view class="" style="width: 200rpx;"></view>
  16. </view>
  17. </view>
  18. </u-navbar>
  19. <u-checkbox-group v-model="checkboxValue1" placement="column" @change="checkboxChange">
  20. <view class="box" v-for="(item,idx) in 6" :key="idx">
  21. <view class="item">
  22. <view class="shopname u-flex">
  23. <image src="/static/images/logo.png" style="width: 28rpx;height: 28rpx;" mode=""></image>
  24. <text>妞妞团🇨🇳进群抢秒杀❗️❗️</text>
  25. <image src="/static/express/next1.png" style="width: 32rpx;height: 32rpx;" mode=""></image>
  26. </view>
  27. <u-swipe-action>
  28. <view class="u-flex" style="margin-top: 30rpx;width: 100%;" v-for="(chid,index) in 2"
  29. :key="index">
  30. <u-swipe-action-item :options="options2">
  31. <u-checkbox shape='circle' :customStyle="{marginBottom: '8px'}" :name="shopitem">
  32. </u-checkbox>
  33. <image src="../../static/images/logo.png" style="width: 172rpx;height: 172rpx;" mode="">
  34. </image>
  35. <view class="good" style="flex: 1;">
  36. <view class="goodname">布兰德超级锁鲜全价主食冻干成</view>
  37. <view class="goods">兔肉味-提高免疫 主食白金包</view>
  38. <view class="" style="margin-top: 21rpx;">
  39. <view class="goodtab">{{i18n.postage}}</view>
  40. </view>
  41. <view class="u-flex u-row-between" style="width: 100%;margin-top: 20rpx;">
  42. <view class="">
  43. <text class="money">¥</text>
  44. <text class="money" style="font-size: 30rpx;">179</text>
  45. <text class="money">.00</text>
  46. <text class="weight">500g</text>
  47. </view>
  48. <view class="">
  49. <view class="" v-if="num&&success">
  50. <u-number-box v-model="value" @change="valChange"></u-number-box>
  51. </view>
  52. <view class="num" v-if="num==false&&success" @click="num = true">
  53. x1
  54. </view>
  55. </view>
  56. <view v-if="success==false" class="icon">
  57. <u-icon name="trash" color="#fff" size="20"></u-icon>
  58. </view>
  59. </view>
  60. </view>
  61. </u-swipe-action-item>
  62. </view>
  63. </u-swipe-action>
  64. </view>
  65. </view>
  66. </u-checkbox-group>
  67. <view class="" style="height: 260rpx;"></view>
  68. <kj-tabbar ref="tabbar1" :value1=3></kj-tabbar>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. success: true,
  76. shopitem: -1,
  77. checkboxValue1: [], //商品数组
  78. value: 0,
  79. all: [], //全选数组
  80. selectall: -1,
  81. num: false,
  82. options2: [{
  83. text: '收藏',
  84. style: {
  85. backgroundColor: '#3c9cff'
  86. }
  87. }, {
  88. text: '删除',
  89. style: {
  90. backgroundColor: '#f56c6c'
  91. }
  92. }],
  93. tabarheight: ''
  94. };
  95. },
  96. computed: {
  97. i18n() {
  98. return this.$t('index')
  99. }
  100. },
  101. onLoad() {
  102. const systemInfo = wx.getSystemInfoSync()
  103. console.log(systemInfo);
  104. const tab = systemInfo.screenHeight - systemInfo.safeArea.bottom + systemInfo.statusBarHeight;
  105. this.tabarheight = tab
  106. console.log(this.tabarheight);
  107. },
  108. methods: {
  109. admin() {
  110. this.success = !this.success
  111. console.log(this.success);
  112. },
  113. valChange(e) {
  114. console.log('当前值为: ' + e.value)
  115. },
  116. //全选
  117. checkAll(e) {
  118. console.log('all', e);
  119. },
  120. aaa(){
  121. console.log(this.$refs.tabbar1.getLabelHeight())
  122. },
  123. checkboxChange(n) {
  124. console.log('change', n);
  125. }
  126. },
  127. mounted() {
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .allweight {
  133. font-family: PingFangSC, PingFang SC;
  134. font-weight: 400;
  135. font-size: 22rpx;
  136. color: #333333;
  137. line-height: 32rpx;
  138. text-align: left;
  139. font-style: normal;
  140. }
  141. .sum {
  142. font-family: PingFangSC, PingFang SC;
  143. font-weight: 400;
  144. font-size: 22rpx;
  145. color: #333333;
  146. line-height: 32rpx;
  147. text-align: left;
  148. font-style: normal;
  149. }
  150. .summon {
  151. font-family: JDZhengHT, JDZhengHT;
  152. font-weight: 400;
  153. font-size: 24rpx;
  154. color: #FF1515;
  155. line-height: 30rpx;
  156. text-align: left;
  157. font-style: normal;
  158. }
  159. .settle {
  160. width: 176rpx;
  161. height: 68rpx;
  162. background: #F83224;
  163. border-radius: 38rpx;
  164. font-family: PingFangSC, PingFang SC;
  165. font-weight: 500;
  166. font-size: 28rpx;
  167. color: #FFFFFF;
  168. line-height: 68rpx;
  169. text-align: center;
  170. font-style: normal;
  171. margin-left: 20rpx;
  172. }
  173. .icon {
  174. width: 40rpx;
  175. height: 40rpx;
  176. background: #F83224;
  177. border-radius: 12rpx;
  178. display: flex;
  179. justify-content: center;
  180. align-items: center;
  181. }
  182. .dle {
  183. width: 136rpx;
  184. height: 60rpx;
  185. border-radius: 38rpx;
  186. border: 1rpx solid #979797;
  187. font-family: PingFangSC, PingFang SC;
  188. font-weight: 400;
  189. font-size: 26rpx;
  190. color: #333333;
  191. line-height: 60rpx;
  192. text-align: center;
  193. font-style: normal;
  194. }
  195. ::v-deep .u-swipe-action-item__content {
  196. flex-direction: row !important;
  197. }
  198. ::v-deep .u-swipe-action-item {
  199. width: 100% !important;
  200. }
  201. ::v-deep .u-swipe-action-item__right {
  202. top: 2rpx !important;
  203. right: 2rpx !important;
  204. bottom: 2rpx !important;
  205. }
  206. .bottom {
  207. width: 750rpx;
  208. height: 100rpx;
  209. background: #FFFFFF;
  210. padding: 0 24rpx;
  211. box-sizing: border-box;
  212. }
  213. .num {
  214. width: 40rpx;
  215. height: 40rpx;
  216. border-radius: 20rpx;
  217. border: 1rpx solid rgba(151, 151, 151, 0.4);
  218. font-family: HarmonyOS_Sans;
  219. font-size: 20rpx;
  220. color: #222222;
  221. line-height: 40rpx;
  222. text-align: center;
  223. font-style: normal;
  224. }
  225. .box {
  226. padding: 0rpx 24rpx 20rpx;
  227. margin-top: 20rpx;
  228. box-sizing: border-box;
  229. .item {
  230. padding: 36rpx 20rpx;
  231. box-sizing: border-box;
  232. width: 702rpx;
  233. // height: 556rpx;
  234. background: #FFFFFF;
  235. border-radius: 16rpx;
  236. .money {
  237. font-family: HarmonyOS_Sans_Medium;
  238. font-size: 20rpx;
  239. color: #FF1515;
  240. line-height: 26rpx;
  241. text-align: left;
  242. font-style: normal;
  243. }
  244. .weight {
  245. font-family: SFPro, SFPro;
  246. font-weight: 400;
  247. font-size: 20rpx;
  248. color: #333333;
  249. line-height: 24rpx;
  250. text-align: left;
  251. font-style: normal;
  252. margin-left: 12rpx;
  253. }
  254. .goodtab {
  255. // width: 96rpx;
  256. height: 32rpx;
  257. border-radius: 4rpx;
  258. border: 1rpx solid #FF1515;
  259. padding: 2rpx 8rpx;
  260. box-sizing: border-box;
  261. text-align: center;
  262. line-height: 32rpx;
  263. display: inline;
  264. font-family: PingFangSC, PingFang SC;
  265. font-weight: 400;
  266. font-size: 20rpx;
  267. color: #FF1515;
  268. line-height: 28rpx;
  269. text-align: left;
  270. font-style: normal;
  271. }
  272. .goods {
  273. // width: 284rpx;
  274. height: 40rpx;
  275. background: #F4F4F4;
  276. border-radius: 8rpx;
  277. display: inline;
  278. text-align: center;
  279. line-height: 40rpx;
  280. margin-top: 20rpx;
  281. padding: 6rpx 12rpx;
  282. box-sizing: border-box;
  283. font-family: PingFangSC, PingFang SC;
  284. font-weight: 400;
  285. font-size: 20rpx;
  286. color: #555555;
  287. line-height: 28rpx;
  288. text-align: left;
  289. font-style: normal;
  290. }
  291. .goodname {
  292. font-family: PingFangSC, PingFang SC;
  293. font-weight: 500;
  294. font-size: 28rpx;
  295. color: #333333;
  296. line-height: 40rpx;
  297. text-align: left;
  298. font-style: normal;
  299. }
  300. .shopname {
  301. font-family: PingFangSC, PingFang SC;
  302. font-weight: 500;
  303. font-size: 26rpx;
  304. color: #333333;
  305. line-height: 36rpx;
  306. text-align: left;
  307. font-style: normal;
  308. }
  309. }
  310. }
  311. .shopcart {
  312. font-family: PingFangSC, PingFang SC;
  313. font-weight: 500;
  314. font-size: 36rpx;
  315. color: #222222;
  316. line-height: 50rpx;
  317. text-align: right;
  318. font-style: normal;
  319. }
  320. .sum {
  321. font-family: HarmonyOS_Sans;
  322. font-size: 22rpx;
  323. color: #333333;
  324. line-height: 32rpx;
  325. text-align: left;
  326. font-style: normal;
  327. }
  328. </style>