景徳镇旅游微信小程序
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.

255 lines
4.7 KiB

7 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. }
  137. .user {
  138. .item{
  139. background-color: #fff;
  140. display: flex;
  141. padding: 30rpx;
  142. .checkbox{
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. }
  147. .image{
  148. width: 200rpx;
  149. height: 200rpx;
  150. border-radius: 20rpx;
  151. }
  152. .info{
  153. flex: 1;
  154. .title{
  155. display: flex;
  156. padding: 10rpx 20rpx;
  157. justify-content: space-between;
  158. }
  159. .unit{
  160. font-size: 24rpx;
  161. padding: 10rpx 20rpx;
  162. color: #717171;
  163. display: flex;
  164. align-items: center;
  165. }
  166. .price{
  167. color: $uni-color;
  168. font-size: 28rpx;
  169. padding: 10rpx 20rpx;
  170. text{
  171. font-size: 36rpx;
  172. font-weight: 900;
  173. }
  174. }
  175. }
  176. }
  177. .action{
  178. width: 700rpx;
  179. position: fixed;
  180. bottom: 220rpx;
  181. left: 25rpx;
  182. background-color: #fff;
  183. height: 100rpx;
  184. border-radius: 50rpx;
  185. box-shadow: 0 0 6rpx 6rpx #00000010;
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. overflow: hidden;
  190. .icon{
  191. position: relative;
  192. width: 80rpx;
  193. height: 80rpx;
  194. margin: 0 20rpx;
  195. image{
  196. width: 80rpx;
  197. height: 80rpx;
  198. }
  199. .num{
  200. position: absolute;
  201. right: 10rpx;
  202. top: 0rpx;
  203. background-color: $uni-color;
  204. color: #fff;
  205. font-size: 18rpx;
  206. border-radius: 50%;
  207. height: 30rpx;
  208. width: 30rpx;
  209. display: flex;
  210. justify-content: center;
  211. align-items: center;
  212. }
  213. }
  214. .price{
  215. .count{
  216. display: flex;
  217. font-size: 26rpx;
  218. align-items: center;
  219. view{
  220. color: $uni-color;
  221. margin-left: 10rpx;
  222. text{
  223. font-size: 32rpx;
  224. font-weight: 900;
  225. }
  226. }
  227. }
  228. .text{
  229. font-size: 20rpx;
  230. color: #717171;
  231. }
  232. }
  233. .btn{
  234. margin-left: auto;
  235. background-color: $uni-color;
  236. height: 100%;
  237. padding: 0 50rpx;
  238. color: #fff;
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. }
  243. }
  244. }
  245. </style>