resale.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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: 80px;line-height: 30px;">注:本次上架需扣除服务1点数,
  38. <view>剩余服务点数:<text style="font-weight: bold;">{{user.wallet}}</text><text
  39. style="margin-left: 10px;color: blue" @click="toCharge">前往充值</text></view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="mfooter" v-if="item.upStatus != 2">
  44. <view class="flex">
  45. <view class="f">
  46. <button class="btn" @click="ok()" v-if="user.wallet>0">确定上架</button>
  47. <button class="btn" style="color: firebrick;" @click="toCharge" v-else>前往充值</button>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. item: {},
  58. resalePrice: '',
  59. weight: '',
  60. price: '',
  61. user: {},
  62. newRuleList: [],
  63. fee: {
  64. totalFee: 0,
  65. feeList: []
  66. }
  67. };
  68. },
  69. onLoad(e) {
  70. if (e.item) {
  71. this.item = JSON.parse(e.item);
  72. this.price = this.item.totalPrice;
  73. this.weight = this.item.totalWeight;
  74. this.user = this.getUser();
  75. //this.countPrice();
  76. }
  77. },
  78. methods: {
  79. toCharge() {
  80. uni.navigateTo({
  81. url: '/pages/wallet/topup/edit'
  82. });
  83. },
  84. fetchItemList() {
  85. this.http.request({
  86. url: '/level-two-server/app/TbOrders/fetchItemList',
  87. data: {
  88. id: this.item.id
  89. },
  90. success: res => {
  91. this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  92. this.newRuleList = res.data.data.newRuleList
  93. }
  94. });
  95. },
  96. //费项合计
  97. countPrice() {
  98. this.http.request({
  99. url: '/level-two-server/app/TbOrders/countPrice',
  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. this.fee = res.data.data;
  107. this.resalePrice = (this.fee.totalFee + this.item.totalPrice).toFixed(2);
  108. }
  109. });
  110. },
  111. ok() {
  112. let resalePrice = this.resalePrice;
  113. /* if(!resalePrice){
  114. uni.showToast({title: '请填写上架金额',icon:'error'});
  115. return;
  116. }
  117. if(resalePrice<this.item.totalPrice){
  118. uni.showToast({title: '上架金额不能小于订单金额',icon:'error'});
  119. return;
  120. } */
  121. uni.showModal({
  122. title: '提示',
  123. content: '确定上架?',
  124. success: res => {
  125. if (res.confirm) {
  126. let that = this;
  127. this.http.request({
  128. url: '/level-one-server/app/TbOrder/up',
  129. data: {
  130. id: this.item.id,
  131. upPrice: this.item.totalPrice
  132. },
  133. success: res => {
  134. let resp = res.data;
  135. uni.showToast({
  136. title: resp.data
  137. });
  138. if (resp.code == 200) {
  139. let user = that.user;
  140. user.wallet = user.wallet - resp.data;
  141. uni.setStorageSync('info', user);
  142. uni.navigateBack();
  143. }
  144. }
  145. });
  146. }
  147. }
  148. });
  149. }
  150. }
  151. };
  152. </script>
  153. <style lang="scss">
  154. page {
  155. background-color: $pg;
  156. }
  157. .item {
  158. input {
  159. margin-top: 0px !important;
  160. }
  161. }
  162. </style>