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

150 lines
3.0 KiB

11 months ago
9 months ago
11 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
9 months ago
11 months ago
9 months ago
11 months ago
10 months ago
9 months ago
11 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
11 months ago
  1. <template>
  2. <uv-popup ref="addPopup" :round="30">
  3. <view class="title">
  4. 添加我的物品 进行水洗下单
  5. </view>
  6. <!-- 地址 -->
  7. <!-- <view class="address" @click="openAddress">
  8. <image src="/static/image/address/selectIcon.png" mode=""></image>
  9. <view class="">
  10. {{ address.name }}
  11. </view>
  12. <view class="">
  13. {{ address.addressDetail }}
  14. </view>
  15. <view class="icon">
  16. <uv-icon size="30rpx" name="arrow-right"></uv-icon>
  17. </view>
  18. </view> -->
  19. <uv-popup ref="addressPopup" :round="30">
  20. <addressList ref="addressList" height="60vh" @select="selectAddress" />
  21. </uv-popup>
  22. <addLeaseForm ref="addLeaseForm"/>
  23. <view class="btn" @click="submit">
  24. <button class="a">添加</button>
  25. </view>
  26. </uv-popup>
  27. </template>
  28. <script>
  29. import addLeaseForm from './addLeaseForm.vue'
  30. import addressList from '@/components/address/addressList.vue'
  31. export default {
  32. components : {
  33. addLeaseForm,
  34. addressList,
  35. },
  36. data() {
  37. return {
  38. address: {
  39. name: '请选择联系人',
  40. addressDetail: '',
  41. },
  42. addressTotal: 0,
  43. }
  44. },
  45. methods: {
  46. // 打开选择地址
  47. openAddress() {
  48. if (this.addressTotal == 0) {
  49. this.$refs.popup.close()
  50. return uni.navigateTo({
  51. url: '/pages_order/mine/address?type=back'
  52. })
  53. }
  54. this.$refs.addressPopup.open('bottom')
  55. },
  56. // 选择地址
  57. selectAddress(e) {
  58. this.address = e
  59. this.$refs.addressPopup.close()
  60. },
  61. submit() {
  62. // if(!this.address.id){
  63. // return uni.showToast({
  64. // title: '请选择地址'
  65. // })
  66. // }
  67. this.$refs.addLeaseForm.submit(form => {
  68. // form.addressId = this.address.id, //地址id
  69. this.$api('tablecloth', form, res => {
  70. if (res.code == 200) {
  71. this.$emit('submit')
  72. this.$refs.addPopup.close()
  73. }
  74. })
  75. })
  76. },
  77. open() {
  78. this.$refs.addLeaseForm.closeForm()
  79. this.$refs.addPopup.open('bottom')
  80. // 获取地址列表
  81. // this.$refs.addressList.getAddressList().then(res => {
  82. // this.addressTotal = res.total
  83. // if (this.addressTotal != 0) {
  84. // this.address = res.records[0]
  85. // }
  86. // })
  87. },
  88. }
  89. }
  90. </script>
  91. <style scoped lang="scss">
  92. .title{
  93. background-color: #fff;
  94. padding: 30rpx;
  95. text-align: center;
  96. font-weight: 900;
  97. font-size: 34rpx;
  98. }
  99. .address {
  100. display: flex;
  101. padding: 20rpx;
  102. background-color: #fff;
  103. border-bottom: 20rpx solid #f3f3f3;
  104. image {
  105. width: 30rpx;
  106. height: 30rpx;
  107. margin: 20rpx;
  108. }
  109. view {
  110. margin: 20rpx;
  111. overflow: hidden; //超出的文本隐藏
  112. text-overflow: ellipsis; //溢出用省略号显示
  113. white-space: nowrap; //溢出不换行
  114. }
  115. .icon {
  116. margin-left: auto;
  117. }
  118. }
  119. .btn {
  120. display: flex;
  121. justify-content: center;
  122. width: 100%;
  123. .a {
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. width: 90%;
  128. height: 100rpx;
  129. color: #FFF;
  130. background-color: $uni-color;
  131. border: 1px solid red;
  132. border-radius: 100rpx;
  133. font-size: 30rpx;
  134. }
  135. }
  136. </style>