deliver-goods.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="container">
  3. <Navbar title="我的订单" background-color="#fff" color="#333"></Navbar>
  4. <view class="content">
  5. <view class="row" @click="selectNameModal">
  6. <view class="label">物流公司</view>
  7. <view class="right">
  8. {{name || '请选择'}}
  9. <IconText size="12" :code="`\ue764`" color="#999"></IconText>
  10. </view>
  11. </view>
  12. <view class="row">
  13. <view class="label">物流单号</view>
  14. <view class="right">
  15. <input type="text" placeholder="请填写物流单号" v-model="code">
  16. </view>
  17. </view>
  18. <view class="bottom-btn">
  19. <view class="solid-btn" @click="handleConfirm">提交</view>
  20. </view>
  21. </view>
  22. <uni-popup ref="namePop" :safe-area="false">
  23. <view class="reason-popup-box">
  24. <view class="title">选择物流公司</view>
  25. <view class="reason-list">
  26. <view class="item" v-for="item in list" :key="item" @click="nameActive = item">
  27. {{item}}
  28. <IconText :code="`\ue73f`" class="icon" size="15"
  29. :color="nameActive === item ? '#BF2071' : '#DEDEDE'"></IconText>
  30. </view>
  31. </view>
  32. <view class="solid-btn" @click="handleSelectName">确认</view>
  33. </view>
  34. </uni-popup>
  35. </view>
  36. </template>
  37. <script lang="ts">
  38. import {
  39. Component,
  40. Vue,
  41. } from 'vue-property-decorator';
  42. @Component({
  43. filters: {
  44. moneyFormat(val: any) {
  45. if (!+val) return '0.00';
  46. return (+val).toFixed(2);
  47. },
  48. }
  49. })
  50. export default class DeliverGoods extends Vue {
  51. list: any = [];
  52. nameActive: any = '';
  53. name: any = '';
  54. code: any = '';
  55. onShow() {
  56. this.getCompanyList();
  57. }
  58. getCompanyList() {
  59. this.$http
  60. .get({
  61. url: this.$api.getCompanyList,
  62. data: {}
  63. })
  64. .then((res: any) => {
  65. this.list = res.list;
  66. uni.hideLoading();
  67. }, (err: any) => {
  68. uni.hideLoading();
  69. console.log(err);
  70. });
  71. }
  72. selectNameModal() {
  73. this.nameActive = this.name;
  74. (this.$refs.namePop as any).open('bottom');
  75. }
  76. handleSelectName() {
  77. this.name = this.nameActive;
  78. (this.$refs.namePop as any).close();
  79. }
  80. handleConfirm() {
  81. this.$http
  82. .put({
  83. url: this.$api.setCompanyInfo,
  84. data: {
  85. id: +this.$Route.query.id,
  86. goodsReturnCompany: this.name,
  87. goodsReturnCode: this.code
  88. }
  89. })
  90. .then((res: any) => {
  91. uni.hideLoading();
  92. this.$Router.back(1);
  93. }, (err: any) => {
  94. uni.hideLoading();
  95. console.log(err);
  96. });
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .row {
  102. height: vw(50);
  103. margin-bottom: vw(10);
  104. background: #fff;
  105. @include flex-x();
  106. @include word-vw(14, #333);
  107. padding: 0 vw(15);
  108. .label{
  109. white-space: nowrap;
  110. }
  111. .right {
  112. @include word-vw(14, #999);
  113. text-align: right;
  114. }
  115. }
  116. .reason-popup-box {
  117. background: #FAFAFA;
  118. @include flex-y();
  119. border-top-left-radius: vw(34);
  120. border-top-right-radius: vw(34);
  121. .title {
  122. width: 100%;
  123. height: vw(60);
  124. @include word-vw(18, #000);
  125. font-weight: bold;
  126. @include flex-x(center);
  127. }
  128. .reason-list {
  129. width: vw(355);
  130. @include flex-y();
  131. border-radius: vw(10);
  132. overflow: hidden;
  133. height: 50vh;
  134. overflow-y: auto;
  135. .item {
  136. width: 100%;
  137. height: vw(60);
  138. background: #fff;
  139. @include flex-x();
  140. padding: 0 vw(16);
  141. box-sizing: border-box;
  142. @include word-vw(14, #333);
  143. margin-top: vw(1);
  144. flex-shrink: 0;
  145. }
  146. }
  147. .solid-btn {
  148. background: $bk-color;
  149. @include solid-btn(345, 48, #333);
  150. border-radius: vw(24);
  151. @include word-vw(14, #fff);
  152. margin: vw(24) 0;
  153. }
  154. }
  155. .bottom-btn {
  156. height: vw(60);
  157. width: 100%;
  158. background: #fff;
  159. @include flex-x(center);
  160. position: fixed;
  161. bottom: 0;
  162. left: 0;
  163. .solid-btn {
  164. background: $bk-color;
  165. @include solid-btn(345, 48, #333);
  166. border-radius: vw(24);
  167. @include word-vw(14, #fff);
  168. }
  169. }
  170. </style>