resale.vue 4.9 KB

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