resale.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view>
  3. <view class="cmain" style="padding-bottom: 80px;">
  4. <view class="box order_detail">
  5. <view class="item">
  6. <text class="label">订单编号</text>
  7. <text class="desc omit">{{ item.tradeNo }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">商品名称</text>
  11. <text class="desc omit">{{ item.goodsNames }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">商品重量</text>
  15. <text class="desc">{{ item.totalWeight }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">净重</text>
  19. <text class="desc">{{ item.netWt }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">毛重</text>
  23. <text class="desc">{{ item.grossWt }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">商品单位</text>
  27. <text class="desc">{{ item.goodsUnit }}</text>
  28. </view>
  29. <view class="item">
  30. <text class="label">申报金额</text>
  31. <text class="desc">¥ {{ item.totalPrice }}</text>
  32. </view>
  33. <view class="item">
  34. <text class="label">预上架金额</text>
  35. <text class="desc">¥ {{ item.totalPrice }}</text>
  36. </view>
  37. <view style="font-size: 16px;padding: 5px;height: 100px;line-height: 30px;">*注:
  38. <view>本次上架需扣除服务1点数,</view>
  39. <view>重复上架只收取一次。剩余服务点数:<text style="font-weight: bold;color: blue;">{{user.wallet}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="mfooter" v-if="item.upStatus != 2">
  45. <view class="flex">
  46. <view class="f">
  47. <button class="btn" v-if="user.wallet>0" @click="ok()">确定上架</button>
  48. <button class="btn" v-else @click="toCharge()" style="background-color: chocolate;">前往充值</button>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. item: {},
  59. resalePrice: '',
  60. weight: '',
  61. price: '',
  62. user: {},
  63. newRuleList: [],
  64. fee: {
  65. totalFee: 0,
  66. feeList: []
  67. }
  68. };
  69. },
  70. onLoad(e) {
  71. if (e.item) {
  72. this.item = JSON.parse(e.item);
  73. this.price = this.item.totalPrice;
  74. this.weight = this.item.totalWeight;
  75. this.user = this.getUser();
  76. //this.countPrice();
  77. }
  78. },
  79. onShow() {
  80. this.http.request({
  81. url: '/level-one-server/app/TbPeople/getById',
  82. data: {
  83. id: this.user.fkId
  84. },
  85. success: res => {
  86. this.user.wallet = res.data.data.wallet;
  87. uni.setStorageSync('info', this.user);
  88. }
  89. });
  90. },
  91. methods: {
  92. toCharge() {
  93. uni.navigateTo({
  94. url: '/pages/wallet/topup/edit'
  95. });
  96. },
  97. fetchItemList() {
  98. this.http.request({
  99. url: '/level-two-server/app/TbOrders/fetchItemList',
  100. data: {
  101. id: this.item.id
  102. },
  103. success: res => {
  104. this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  105. this.newRuleList = res.data.data.newRuleList
  106. }
  107. });
  108. },
  109. //费项合计
  110. countPrice() {
  111. this.http.request({
  112. url: '/level-two-server/app/TbOrders/countPrice',
  113. data: {
  114. id: this.item.id
  115. },
  116. success: res => {
  117. this.fee = res.data.data;
  118. this.resalePrice = (this.fee.totalFee + this.item.totalPrice).toFixed(2);
  119. }
  120. });
  121. },
  122. ok() {
  123. let resalePrice = this.resalePrice;
  124. uni.showModal({
  125. title: '提示',
  126. content: '确定上架?',
  127. success: res => {
  128. if (res.confirm) {
  129. let that = this;
  130. this.http.request({
  131. url: '/level-one-server/app/TbOrder/up',
  132. data: {
  133. id: this.item.id,
  134. upPrice: this.item.totalPrice
  135. },
  136. success: res => {
  137. let resp = res.data;
  138. uni.showToast({
  139. title: resp.data
  140. });
  141. if (resp.code == 200) {
  142. let user = that.user;
  143. user.wallet = user.wallet - resp.data;
  144. uni.setStorageSync('info', user);
  145. uni.navigateBack();
  146. }
  147. }
  148. });
  149. }
  150. }
  151. });
  152. }
  153. }
  154. };
  155. </script>
  156. <style lang="scss">
  157. page {
  158. background-color: $pg;
  159. }
  160. .item {
  161. input {
  162. margin-top: 0px !important;
  163. }
  164. }
  165. </style>