建材商城系统20241014
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.

260 lines
4.8 KiB

1 year ago
1 year ago
  1. <template>
  2. <view class="page">
  3. <navbar/>
  4. <view class="user">
  5. <uv-checkbox-group
  6. shape="circle"
  7. v-model="checkboxValue">
  8. <uv-swipe-action>
  9. <view
  10. v-for="(item, index) in list"
  11. :key="index">
  12. <view style="margin-top: 20rpx;"></view>
  13. <uv-swipe-action-item
  14. :options="options">
  15. <view class="item">
  16. <view class="checkbox">
  17. <uv-checkbox
  18. :name="item.id"
  19. activeColor="#FA5A0A"
  20. size="40rpx"
  21. icon-size="35rpx"
  22. ></uv-checkbox>
  23. </view>
  24. <image
  25. class="image"
  26. src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
  27. mode=""></image>
  28. <view class="info">
  29. <view class="title">
  30. <view class="">
  31. {{ item.title }}
  32. </view>
  33. <view class="">
  34. <uv-number-box v-model="item.num"
  35. @change="valChange"></uv-number-box>
  36. </view>
  37. </view>
  38. <view class="unit">
  39. 规格{{ item.unit }}
  40. <uv-icon name="arrow-down"></uv-icon>
  41. </view>
  42. <view class="price">
  43. <text>{{ item.price }}</text>
  44. </view>
  45. </view>
  46. </view>
  47. </uv-swipe-action-item>
  48. </view>
  49. </uv-swipe-action>
  50. </uv-checkbox-group>
  51. <view class="action">
  52. <view class="icon">
  53. <image src="/static/image/cart/1.png" mode=""></image>
  54. <view class="num">
  55. {{ checkboxValue.length }}
  56. </view>
  57. </view>
  58. <view class="price">
  59. <view class="count">
  60. 合计
  61. <view class="">
  62. <text>{{ totalPrice }}</text>
  63. </view>
  64. </view>
  65. <view class="text">
  66. {{ checkboxValue.length }}已享受更低优惠
  67. </view>
  68. </view>
  69. <view class="btn">
  70. 去结算
  71. </view>
  72. </view>
  73. </view>
  74. <kefu/>
  75. <tabber select="3" />
  76. </view>
  77. </template>
  78. <script>
  79. import tabber from '@/components/base/tabbar.vue'
  80. export default {
  81. components: {
  82. tabber,
  83. },
  84. data() {
  85. return {
  86. value : 0,
  87. checkboxValue : [],
  88. options: [
  89. {
  90. text: '删除',
  91. style: {
  92. backgroundColor: '#FA5A0A'
  93. }
  94. },
  95. ],
  96. list : [
  97. {
  98. id : 1,
  99. title : '桌布租赁',
  100. num : 1,
  101. price : 299,
  102. unit : '120*40*75【桌子尺寸】',
  103. },
  104. {
  105. id : 2,
  106. title : '桌布租赁',
  107. num : 1,
  108. price : 299,
  109. unit : '120*40*75【桌子尺寸】',
  110. },
  111. ],
  112. }
  113. },
  114. computed: {
  115. totalPrice(){
  116. if (!this.checkboxValue.length) {
  117. return 0
  118. }
  119. let price = 0
  120. this.list.forEach(n => {
  121. if(this.checkboxValue.includes(n.id)){
  122. price += n.price * n.num
  123. }
  124. })
  125. return price
  126. },
  127. },
  128. methods: {
  129. valChange(){
  130. },
  131. }
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. .page {
  136. padding-bottom: 200rpx;
  137. /deep/ .uv-swipe-action{
  138. width: 100%;
  139. }
  140. }
  141. .user {
  142. .item{
  143. background-color: #fff;
  144. display: flex;
  145. padding: 30rpx;
  146. .checkbox{
  147. display: flex;
  148. justify-content: center;
  149. align-items: center;
  150. }
  151. .image{
  152. width: 200rpx;
  153. height: 200rpx;
  154. border-radius: 20rpx;
  155. }
  156. .info{
  157. flex: 1;
  158. .title{
  159. display: flex;
  160. padding: 10rpx 20rpx;
  161. justify-content: space-between;
  162. }
  163. .unit{
  164. font-size: 24rpx;
  165. padding: 10rpx 20rpx;
  166. color: #717171;
  167. display: flex;
  168. align-items: center;
  169. }
  170. .price{
  171. color: $uni-color;
  172. font-size: 28rpx;
  173. padding: 10rpx 20rpx;
  174. text{
  175. font-size: 36rpx;
  176. font-weight: 900;
  177. }
  178. }
  179. }
  180. }
  181. .action{
  182. width: 700rpx;
  183. position: fixed;
  184. bottom: 220rpx;
  185. left: 25rpx;
  186. background-color: #fff;
  187. height: 100rpx;
  188. border-radius: 50rpx;
  189. box-shadow: 0 0 6rpx 6rpx #00000010;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. overflow: hidden;
  194. .icon{
  195. position: relative;
  196. width: 80rpx;
  197. height: 80rpx;
  198. margin: 0 20rpx;
  199. image{
  200. width: 80rpx;
  201. height: 80rpx;
  202. }
  203. .num{
  204. position: absolute;
  205. right: 10rpx;
  206. top: 0rpx;
  207. background-color: $uni-color;
  208. color: #fff;
  209. font-size: 18rpx;
  210. border-radius: 50%;
  211. height: 30rpx;
  212. width: 30rpx;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. }
  217. }
  218. .price{
  219. .count{
  220. display: flex;
  221. font-size: 26rpx;
  222. align-items: center;
  223. view{
  224. color: $uni-color;
  225. margin-left: 10rpx;
  226. text{
  227. font-size: 32rpx;
  228. font-weight: 900;
  229. }
  230. }
  231. }
  232. .text{
  233. font-size: 20rpx;
  234. color: #717171;
  235. }
  236. }
  237. .btn{
  238. margin-left: auto;
  239. background-color: $uni-color;
  240. height: 100%;
  241. padding: 0 50rpx;
  242. color: #fff;
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. }
  247. }
  248. }
  249. </style>