铝交易,微信公众号
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.

258 lines
4.8 KiB

4 months 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. <tabber select="3" />
  75. </view>
  76. </template>
  77. <script>
  78. import tabber from '@/components/base/tabbar.vue'
  79. export default {
  80. components: {
  81. tabber,
  82. },
  83. data() {
  84. return {
  85. value : 0,
  86. checkboxValue : [],
  87. options: [
  88. {
  89. text: '删除',
  90. style: {
  91. backgroundColor: '#FA5A0A'
  92. }
  93. },
  94. ],
  95. list : [
  96. {
  97. id : 1,
  98. title : '桌布租赁',
  99. num : 1,
  100. price : 299,
  101. unit : '120*40*75【桌子尺寸】',
  102. },
  103. {
  104. id : 2,
  105. title : '桌布租赁',
  106. num : 1,
  107. price : 299,
  108. unit : '120*40*75【桌子尺寸】',
  109. },
  110. ],
  111. }
  112. },
  113. computed: {
  114. totalPrice(){
  115. if (!this.checkboxValue.length) {
  116. return 0
  117. }
  118. let price = 0
  119. this.list.forEach(n => {
  120. if(this.checkboxValue.includes(n.id)){
  121. price += n.price * n.num
  122. }
  123. })
  124. return price
  125. },
  126. },
  127. methods: {
  128. valChange(){
  129. },
  130. }
  131. }
  132. </script>
  133. <style scoped lang="scss">
  134. .page {
  135. padding-bottom: 200rpx;
  136. /deep/ .uv-swipe-action{
  137. width: 100%;
  138. }
  139. }
  140. .user {
  141. .item{
  142. background-color: #fff;
  143. display: flex;
  144. padding: 30rpx;
  145. .checkbox{
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. }
  150. .image{
  151. width: 200rpx;
  152. height: 200rpx;
  153. border-radius: 20rpx;
  154. }
  155. .info{
  156. flex: 1;
  157. .title{
  158. display: flex;
  159. padding: 10rpx 20rpx;
  160. justify-content: space-between;
  161. }
  162. .unit{
  163. font-size: 24rpx;
  164. padding: 10rpx 20rpx;
  165. color: #717171;
  166. display: flex;
  167. align-items: center;
  168. }
  169. .price{
  170. color: $uni-color;
  171. font-size: 28rpx;
  172. padding: 10rpx 20rpx;
  173. text{
  174. font-size: 36rpx;
  175. font-weight: 900;
  176. }
  177. }
  178. }
  179. }
  180. .action{
  181. width: 700rpx;
  182. position: fixed;
  183. bottom: 220rpx;
  184. left: 25rpx;
  185. background-color: #fff;
  186. height: 100rpx;
  187. border-radius: 50rpx;
  188. box-shadow: 0 0 6rpx 6rpx #00000010;
  189. display: flex;
  190. justify-content: center;
  191. align-items: center;
  192. overflow: hidden;
  193. .icon{
  194. position: relative;
  195. width: 80rpx;
  196. height: 80rpx;
  197. margin: 0 20rpx;
  198. image{
  199. width: 80rpx;
  200. height: 80rpx;
  201. }
  202. .num{
  203. position: absolute;
  204. right: 10rpx;
  205. top: 0rpx;
  206. background-color: $uni-color;
  207. color: #fff;
  208. font-size: 18rpx;
  209. border-radius: 50%;
  210. height: 30rpx;
  211. width: 30rpx;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. }
  216. }
  217. .price{
  218. .count{
  219. display: flex;
  220. font-size: 26rpx;
  221. align-items: center;
  222. view{
  223. color: $uni-color;
  224. margin-left: 10rpx;
  225. text{
  226. font-size: 32rpx;
  227. font-weight: 900;
  228. }
  229. }
  230. }
  231. .text{
  232. font-size: 20rpx;
  233. color: #717171;
  234. }
  235. }
  236. .btn{
  237. margin-left: auto;
  238. background-color: $uni-color;
  239. height: 100%;
  240. padding: 0 50rpx;
  241. color: #fff;
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. }
  246. }
  247. }
  248. </style>