edit-add.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="edit-add-index flex-common-css box-border-box iPhone-bottom">
  3. <Nav :title="fromData.id?'编辑地址':'新增地址'"></Nav>
  4. <view class="scroll-view-css box-border-box p-24">
  5. <view class="box-card box-border-box p-24 mb-20">
  6. <EnInput label="收货人" placeholder="请输入收货人姓名" v-model="fromData.consignee"></EnInput>
  7. <EnInput label="电话号码" type="number" placeholder="请输入电话号码" v-model="fromData.phone"></EnInput>
  8. <EnSelect label="收货学校" placeholder="请选择收货学校" v-model="fromData.id" :localData="schoolList" :valueType="'1'"></EnSelect>
  9. <EnSelect label="楼栋" placeholder="请选择楼栋" v-model="fromData.id" :localData="builList" :valueType="'1'"></EnSelect>
  10. <EnInput label="详细地址" placeholder="请输入详细地址" v-model="fromData.address"></EnInput>
  11. </view>
  12. <view class="box-card box-border-box p-24 flex-justify-space">
  13. <view class="">
  14. <view class="fs-30 mb-16">设为默认地址</view>
  15. <view class="fs-24 fc-9">提醒:下单会优先使用该地址</view>
  16. </view>
  17. <view class="r-right" @click="fromData.is_default == 1?fromData.is_default=0:fromData.is_default=1"
  18. :class="fromData.is_default == 0?'n-r':'s-r'">
  19. <view class="r-y"></view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="box-border-box p-24 bgc-f " @click="save()">
  24. <view class="add-box text-align-center fs-34 fc-f mb-20">确定</view>
  25. <view class="add-box-1 text-align-center fs-34 fc-41ABF5">删除</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import tools from "@/service/tools.js";
  31. import EnSelect from "@/components/en-from/en-select/en-select";
  32. import EnInput from "@/components/en-from/en-input/en-input";
  33. export default {
  34. components: {
  35. EnInput,
  36. EnSelect,
  37. },
  38. data() {
  39. return {
  40. radioData: [{
  41. 'id': '0',
  42. 'name': '否'
  43. },
  44. {
  45. 'id': '1',
  46. 'name': '是'
  47. }
  48. ],
  49. fromData: {
  50. id: '',
  51. address: '',
  52. is_default: 0,
  53. consignee: '',
  54. city_names: '',
  55. phone: '',
  56. province: '',
  57. city: '',
  58. area: '',
  59. lon: '',
  60. lat: '',
  61. },
  62. schoolList: [
  63. {
  64. value:1,
  65. text:'学校1',
  66. },
  67. {
  68. value:2,
  69. text:'学校2',
  70. }
  71. ],
  72. builList:[
  73. {
  74. value:1,
  75. text:'楼栋1',
  76. },
  77. {
  78. value:2,
  79. text:'楼栋2',
  80. }
  81. ],
  82. isAJAX: false,
  83. }
  84. },
  85. onLoad(e) {
  86. if (e.id) {
  87. this.getInfo(e.id)
  88. } else {
  89. this.fromData.id = '';
  90. }
  91. },
  92. mounted() {
  93. },
  94. methods: {
  95. getInfo(id) {
  96. },
  97. save() {
  98. },
  99. },
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. .edit-add-index {
  104. .add-box {
  105. width: 100%;
  106. height: 80rpx;
  107. line-height: 80rpx;
  108. background-color: #2F80ED;
  109. border-radius: 200rpx;
  110. }
  111. .add-box-1{
  112. width: 100%;
  113. height: 88rpx;
  114. line-height: 88rpx;
  115. background: #FFFFFF;
  116. border-radius: 200rpx 200rpx 200rpx 200rpx;
  117. box-sizing: border-box;
  118. border: 2rpx solid #41ABF5;
  119. }
  120. .box-card{
  121. width: 1005;
  122. min-height: 152rpx;
  123. background: #FFFFFF;
  124. border-radius: 20rpx;
  125. }
  126. .r-right{
  127. margin-top: 24rpx;
  128. width: 88rpx;
  129. height: 52rpx;
  130. border-radius: 200rpx;
  131. position: relative;
  132. .r-y{
  133. width: 44rpx;
  134. height: 44rpx;
  135. background: #FFFFFF;
  136. border-radius: 200rpx;
  137. position: absolute;
  138. top: 4rpx;
  139. }
  140. }
  141. .s-r{
  142. background-color: #41ABF5;
  143. transition: all 1s;
  144. .r-y{
  145. right: 4rpx !important;
  146. transition: all 1s;
  147. }
  148. }
  149. .n-r{
  150. background-color: #ccc;
  151. transition: all 1s;
  152. .r-y{
  153. left: 4rpx !important;
  154. transition: all 1s;
  155. }
  156. }
  157. }
  158. </style>