express.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <!--mine/express/express.wxml-->
  4. <!-- <view class="list">
  5. <view class="li">
  6. <text>快递公司</text>
  7. </view>
  8. <view class="li">
  9. <text>快递单号:</text>
  10. <input value="" placeholder="填写订单号"></input>
  11. </view>
  12. </view> -->
  13. <!-- <view class="list">
  14. <view class="li">
  15. <text>联系方式:</text>
  16. <input value="" placeholder="填写手机号"></input>
  17. </view>
  18. </view> -->
  19. <view class="list">
  20. <view class="li" @tap="getRefund" data-isrefund="4">
  21. <text>快递公司</text>
  22. <view class="dflex express">
  23. <text>{{express?express:'请选择'}}</text>
  24. <image src="/static/pages/images/more.png" class="right"></image>
  25. </view>
  26. </view>
  27. <view class="li">
  28. <text>快递单号:</text>
  29. <input placeholder="输入您的快递单号" @input="getexpressId"></input>
  30. </view>
  31. </view>
  32. <!-- <view class="list">
  33. <view class="li">
  34. <text>联系方式:</text>
  35. <input placeholder="12342235321"></input>
  36. </view>
  37. </view> -->
  38. <view class="btn bgline" @tap="sub">确定</view>
  39. <block v-if="isShow">
  40. <refund-popup :refund-type="type" @hidePopup="hidePopup" @getValue="getValue" @getIndex="getIndex"></refund-popup>
  41. </block>
  42. </view>
  43. </template>
  44. <script>
  45. // mine/express/express.js
  46. const req = require("../../../utils/request.js");
  47. import refundPopup from '../../components/refund-popup/index.vue';
  48. export default {
  49. data() {
  50. return {
  51. isShow: true,
  52. id: "",
  53. isrefund: "",
  54. type: "",
  55. expressIndex: "",
  56. express: "",
  57. expressId: ""
  58. };
  59. },
  60. components: {
  61. refundPopup
  62. },
  63. props: {},
  64. /**
  65. * 生命周期函数--监听页面加载
  66. */
  67. onLoad: function (options) {
  68. // console.log(options);
  69. this.setData({
  70. isShow: false,
  71. id: options.id,
  72. isrefund: options.isrefund
  73. });
  74. },
  75. /**
  76. * 生命周期函数--监听页面显示
  77. */
  78. onShow: function () {},
  79. methods: {
  80. getRefund(event) {
  81. // console.log(event.currentTarget.dataset.isrefund)
  82. this.setData({
  83. isShow: true,
  84. type: event.currentTarget.dataset.isrefund
  85. });
  86. },
  87. hidePopup() {
  88. this.setData({
  89. isShow: false
  90. });
  91. },
  92. getIndex: function (e) {
  93. if (this.type == 4) {
  94. this.setData({
  95. expressIndex: e.detail
  96. });
  97. }
  98. },
  99. getValue: function (e) {
  100. if (this.type == 4) {
  101. this.setData({
  102. express: e.detail
  103. });
  104. }
  105. },
  106. getexpressId(event) {
  107. let expressId = "";
  108. expressId = event.detail.value;
  109. this.setData({
  110. expressId: expressId
  111. });
  112. // console.log(this.expressId);
  113. },
  114. sub() {
  115. let parameter = {
  116. express: this.express,
  117. expressCode: this.expressIndex,
  118. expressNo: this.expressId,
  119. // dto[0].orderId:this.data.orderId
  120. id: this.id
  121. };
  122. // console.log(parameter);
  123. if (parameter.express == undefined) return req.msg("请您选择快递公司");
  124. if (parameter.expressNo == undefined || parameter.expressNo == '') return req.msg("请您填写快递单号");
  125. req.putRequest('/api/orderRefund/update', parameter, data => {
  126. uni.navigateBack({
  127. url: '/mine/refund/refundDetails/refundDetails?id=' + this.id + '&isrefund=' + this.isrefund
  128. });
  129. });
  130. }
  131. }
  132. };
  133. </script>
  134. <style>
  135. @import "./express.css";
  136. </style>