resale.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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">
  36. <input type="number" v-model="resalePrice" placeholder="请输入" />
  37. </text>
  38. </view> -->
  39. <!-- <view class="item">
  40. <text class="label">利润</text>
  41. <text class="desc">50元</text>
  42. </view> -->
  43. <view class="item">
  44. <text class="label">上架金额</text>
  45. <text class="desc">¥ {{ resalePrice }}</text>
  46. </view>
  47. </view>
  48. <u-divider text="费项明细"></u-divider>
  49. <view>交易服务费用明细:{{fee.totalFee}}<span style="color: coral;margin-left: 5px;font-size: 16px;">元</span></view>
  50. <view class="box">
  51. <u-collapse v-for="(item,index) in fee.feeList" :key="index" :is-open="true">
  52. <u-collapse-item :title="item.name" class="cell_title" >
  53. <view class="itm">1、系统服务费:{{ item.name }}</view>
  54. <view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
  55. <view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
  56. <view class="itm" v-if="item.feeType ==3">2、收费类型:按吨收取</view>
  57. <view class="itm" v-if="item.feeType ==1">3、收费%(按交易额收):<span style="color: coral;">{{ item.percent }} %</span></view>
  58. <view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  59. <view class="itm" v-if="item.feeType ==3">3、收费%(按吨收):<span style="color: coral;">{{ item.percent }} %</span></view>
  60. <view class="itm">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  61. </u-collapse-item>
  62. </u-collapse>
  63. </view>
  64. </view>
  65. <view class="mfooter" v-if="item.upStatus != 2">
  66. <view class="flex">
  67. <view class="f">
  68. <button class="btn" @click="ok()">上架</button>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. data() {
  77. return {
  78. item: {},
  79. resalePrice: '',
  80. weight: '',
  81. price: '',
  82. newRuleList: [],
  83. fee:{
  84. totalFee:0,
  85. feeList:[]
  86. }
  87. };
  88. },
  89. onLoad(e) {
  90. if (e.item) {
  91. this.item = JSON.parse(e.item);
  92. this.price = this.item.totalPrice;
  93. this.weight = this.item.totalWeight;
  94. this.countPrice();
  95. }
  96. },
  97. methods: {
  98. fetchItemList(){
  99. this.http.request({
  100. url: '/level-two-server/app/TbOrders/fetchItemList',
  101. data: {id: this.item.id},
  102. success: res => {
  103. this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  104. this.newRuleList = res.data.data.newRuleList
  105. }
  106. });
  107. },
  108. //费项合计
  109. countPrice(){
  110. this.http.request({
  111. url: '/level-two-server/app/TbOrders/countPrice',
  112. data: {id: this.item.id},
  113. success: res => {
  114. // this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  115. // this.newRuleList = res.data.data.newRuleList
  116. this.fee=res.data.data;
  117. this.resalePrice = (this.fee.totalFee + this.item.totalPrice).toFixed(2);
  118. }
  119. });
  120. },
  121. ok() {
  122. let resalePrice=this.resalePrice;
  123. /* if(!resalePrice){
  124. uni.showToast({title: '请填写上架金额',icon:'error'});
  125. return;
  126. }
  127. if(resalePrice<this.item.totalPrice){
  128. uni.showToast({title: '上架金额不能小于订单金额',icon:'error'});
  129. return;
  130. } */
  131. uni.showModal({
  132. title: '提示',
  133. content: '确定上架?',
  134. success: res => {
  135. if (res.confirm) {
  136. this.http.request({
  137. url: '/level-one-server/app/TbOrder/up',
  138. data: {id: this.item.id, upPrice: this.resalePrice},
  139. success: res => {
  140. uni.showToast({title: '提交成功'});
  141. uni.navigateBack();
  142. }
  143. });
  144. }
  145. }
  146. });
  147. }
  148. }
  149. };
  150. </script>
  151. <style lang="scss">
  152. page {
  153. background-color: $pg;
  154. }
  155. .item {
  156. input{
  157. margin-top: 0px!important;
  158. }
  159. }
  160. </style>