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

275 lines
4.9 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <uv-popup ref="popup"
  3. :round="30"
  4. bgColor="#f7f7f7">
  5. <view class="content">
  6. <!-- 地址 -->
  7. <view class="address"
  8. @click="openAddress">
  9. <image src="../../static/address/selectIcon.png" mode=""></image>
  10. <view class="">
  11. {{ address.name }}
  12. </view>
  13. <view class="">
  14. {{ address.addressDetail }}
  15. </view>
  16. <view class="icon">
  17. <uv-icon
  18. size="30rpx"
  19. name="arrow-right"></uv-icon>
  20. </view>
  21. </view>
  22. <!-- 商品信息和数量 -->
  23. <view class="submit-info">
  24. <view class="title">
  25. 桌布租赁
  26. </view>
  27. <view class="box">
  28. <image
  29. class="image"
  30. :src="unit.pic"
  31. mode=""></image>
  32. <view class="info">
  33. <view class="price">
  34. <text>{{ unit.depositPrice }}</text>
  35. </view>
  36. <view class="unit">
  37. 请选择规格
  38. </view>
  39. <view class="">
  40. <uv-number-box v-model="num"></uv-number-box>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 规格 -->
  46. <view class="submit-unit">
  47. <view class="title">
  48. 规格选择
  49. </view>
  50. <view class="list">
  51. <view :class="{act : unitIndex == index}"
  52. v-for="(item, index) in detail.hotelGoodsSkuList"
  53. @click="selectUnit(item, index)"
  54. :key="index">
  55. {{ item.title }}
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 费用明细 -->
  60. <view class="expense-detail">
  61. <view class="title">
  62. 费用明细
  63. </view>
  64. <view class="detail">
  65. 押金{{ unit.depositPrice }}
  66. </view>
  67. </view>
  68. <!-- 提交按钮 -->
  69. <view class="submit-btn">
  70. {{ submiitTitle }}
  71. </view>
  72. </view>
  73. <uv-popup ref="addressPopup" :round="30">
  74. <addressList
  75. ref="addressList"
  76. height="60vh"
  77. @select="selectAddress"
  78. />
  79. </uv-popup>
  80. </uv-popup>
  81. </template>
  82. <script>
  83. import addressList from '../address/addressList.vue'
  84. export default {
  85. components : {
  86. addressList,
  87. },
  88. props : {
  89. submiitTitle : {
  90. default : '立即租赁',
  91. type : String,
  92. },
  93. detail : {
  94. default : {}
  95. }
  96. },
  97. data() {
  98. return {
  99. unitIndex : 0,
  100. address : {
  101. name : '请选择联系人',
  102. addressDetail : '',
  103. },
  104. num : 1,
  105. unit : {},
  106. }
  107. },
  108. methods: {
  109. // 打开
  110. open(){
  111. this.$refs.popup.open('bottom')
  112. if(!this.unit.id){
  113. this.selectUnit(this.detail.hotelGoodsSkuList[0], 0)
  114. }
  115. },
  116. // 关闭
  117. close(){
  118. this.$refs.popup.close()
  119. },
  120. // 打开选择地址
  121. openAddress(){
  122. // 获取地址列表
  123. this.$refs.addressList.getAddressList().then(res => {
  124. if (res.total == 0) {
  125. return uni.navigateTo({
  126. url: '/pages_order/mine/address'
  127. })
  128. }
  129. this.$refs.addressPopup.open('bottom')
  130. })
  131. },
  132. // 选择地址
  133. selectAddress(e){
  134. this.address = e
  135. this.$refs.addressPopup.close()
  136. },
  137. // 选择规格
  138. selectUnit(item, index){
  139. this.unit = item
  140. this.unitIndex = index
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped lang="scss">
  146. .content{
  147. max-height: 80vh;
  148. overflow: hidden;
  149. overflow-y: auto;
  150. .address{
  151. display: flex;
  152. padding: 20rpx;
  153. background-color: #fff;
  154. image{
  155. width: 30rpx;
  156. height: 30rpx;
  157. margin: 20rpx;
  158. }
  159. view{
  160. margin: 20rpx;
  161. overflow:hidden; //超出的文本隐藏
  162. text-overflow:ellipsis; //溢出用省略号显示
  163. white-space:nowrap; //溢出不换行
  164. }
  165. .icon{
  166. margin-left: auto;
  167. }
  168. }
  169. .submit-info{
  170. background-color: #fff;
  171. padding: 30rpx;
  172. margin-top: 20rpx;
  173. .title{
  174. font-size: 30rpx;
  175. padding: 10rpx;
  176. font-weight: 600;
  177. }
  178. .box{
  179. display: flex;
  180. margin-top: 10rpx;
  181. .image{
  182. width: 200rpx;
  183. height: 200rpx;
  184. border-radius: 20rpx;
  185. margin-right: 20rpx;
  186. }
  187. .info{
  188. flex: 1;
  189. .unit{
  190. font-size: 24rpx;
  191. padding: 10rpx 20rpx;
  192. color: #717171;
  193. display: flex;
  194. align-items: center;
  195. }
  196. .price{
  197. color: $uni-color;
  198. font-size: 28rpx;
  199. padding: 10rpx 20rpx;
  200. text{
  201. font-size: 36rpx;
  202. font-weight: 900;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. .submit-unit{
  209. padding: 30rpx;
  210. background-color: #fff;
  211. .title{
  212. font-size: 28rpx;
  213. font-weight: 600;
  214. }
  215. .list{
  216. display: flex;
  217. flex-wrap: wrap;
  218. font-size: 22rpx;
  219. .act{
  220. color: $uni-color;
  221. border: 1px solid $uni-color;
  222. background-color: #F9E7DE;
  223. }
  224. view{
  225. border-radius: 15rpx;
  226. width: 320rpx;
  227. background-color: #F3F3F3;
  228. border: 1px solid #F3F3F3;
  229. margin: 10rpx;
  230. display: flex;
  231. justify-content: center;
  232. padding: 15rpx 0;
  233. }
  234. }
  235. }
  236. .expense-detail{
  237. padding: 30rpx;
  238. background-color: #fff;
  239. font-size: 28rpx;
  240. .title{
  241. font-weight: 600;
  242. }
  243. .detail{
  244. background-color: #F6F6F6;
  245. color: #717171;
  246. margin: 10rpx 0;
  247. padding: 10rpx 20rpx;
  248. }
  249. }
  250. .submit-btn{
  251. background: $uni-color;
  252. width: 600rpx;
  253. height: 80rpx;
  254. color: #fff;
  255. border-radius: 40rpx;
  256. font-size: 28rpx;
  257. margin: 20rpx auto;
  258. display: flex;
  259. justify-content: center;
  260. align-items: center;
  261. }
  262. }
  263. </style>