酒店桌布为微信小程序
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.

254 lines
4.7 KiB

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