order.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. </view>
  6. <view class="goodsList">
  7. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  8. <view class="title">{{ item.borderName }}
  9. <view class="state" v-if="item.finishStatus == 1 && item.upStatus == 1">
  10. <text class="icon" style="color:#13ce66">&#xe830;</text>
  11. <text>待上架</text>
  12. </view>
  13. <view class="state" v-if="item.finishStatus == 1 && item.upStatus == 2&&item.resaleStatus == 0">
  14. <text class="icon" style="color:#13ce66">&#xe830;</text>
  15. <text>已上架</text>
  16. </view>
  17. <view class="state" v-if="item.resaleStatus == 1&& item.upStatus == 2">
  18. <text class="icon" style="color: #13ce66">&#xe830;</text>
  19. <text>已转售</text>
  20. </view>
  21. </view>
  22. <view style="margin-bottom: 9px;width: 80%;font-size: 18px;">{{ item.enterpriseName }}</view>
  23. <!-- <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image> -->
  24. <view class="con">
  25. <view class="productName omit">{{ item.goodsNames }}</view>
  26. <view class="desc omit">
  27. <text>重量 {{ item.totalWeight }}{{ item.goodsUnit }}</text>
  28. <text>{{ item.veNo }}</text>
  29. </view>
  30. <view class="price">
  31. <span>申报金额 ¥ {{ item.totalPrice }}</span>
  32. <span v-if="item.upPrice&&item.upStatus==2" style="margin-left: 16px;">上架金额 ¥ {{ item.upPrice }}</span>
  33. </view>
  34. </view>
  35. <view class="clear"></view>
  36. <view class="op">
  37. <view class="date">{{ item.createTime }}</view>
  38. <template v-if="item.finishStatus == 1 && item.upStatus != 2">
  39. <view class="an down_btn" style="background-color: #3c9cff;color: white;" @click.stop="resale(item)">上架</view>
  40. </template>
  41. <!-- <template v-if="item.resaleStatus == 0 && item.beingOrder == 0&& item.upStatus == 2"> -->
  42. <template v-if="item.resaleStatus == 0 && item.beingOrder == 0&& item.upStatus == 2&&item.finishStatus==1">
  43. <view class="an down_btn" @click.stop="downOrder(item)">下架</view>
  44. </template>
  45. </view>
  46. </view>
  47. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  48. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. user: {},
  57. tab: [{
  58. name: '全部',
  59. peopleConfirmStatus: '', //边民确认状态
  60. cooperEntrustStatus: '', //互助委托申报确认状态
  61. applyConfirmStatus: '', //进口申报确认状态
  62. finishStatus: 1, //订单完成状态
  63. resaleStatus: '' //订单转售状态
  64. },
  65. {
  66. name: '待上架',
  67. finishStatus: 1,
  68. resaleStatus: 0,
  69. upStatus: 1
  70. },
  71. {
  72. name: '已上架',
  73. finishStatus: 1,
  74. resaleStatus: 0,
  75. upStatus: 2
  76. },
  77. {
  78. name: '已转售',
  79. finishStatus: 1,
  80. resaleStatus: 1,
  81. upStatus: 2
  82. }
  83. ],
  84. param: {
  85. pageNo: 1,
  86. pageSize: 10,
  87. finishStatus:1
  88. },
  89. list: [],
  90. loadMore: true,
  91. id: '',
  92. flag: '',
  93. };
  94. },
  95. onLoad() {
  96. this.user = this.getUser()
  97. uni.$on('face', res => {
  98. if (this.flag == 1) {
  99. this.http.request({
  100. url: '/level-one-server/app/TbOrder/confirmOrder',
  101. data: {
  102. orderId: this.id
  103. },
  104. success: resp => {
  105. uni.showToast({
  106. title: '订单确认成功'
  107. });
  108. this.refresh();
  109. }
  110. });
  111. } else if (this.flag == 2) {
  112. this.http.request({
  113. url: '/level-one-server/app/TbOrder/applyOrder',
  114. data: {
  115. orderId: this.id
  116. },
  117. success: resp => {
  118. uni.showToast({
  119. title: '进口申报确认成功'
  120. });
  121. this.refresh();
  122. }
  123. });
  124. }
  125. })
  126. },
  127. onShow() {
  128. this.getData();
  129. },
  130. methods: {
  131. downOrder(item) {
  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/down',
  139. data: {
  140. id: item.id
  141. },
  142. success: res => {
  143. uni.showToast({
  144. title: '提交成功'
  145. });
  146. item.upStatus = 1;
  147. }
  148. });
  149. }
  150. }
  151. });
  152. },
  153. getData() {
  154. this.http.request({
  155. url: '/level-one-server/app/TbOrder/getList',
  156. loading: 'false',
  157. data: this.param,
  158. success: res => {
  159. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  160. if (res.data.data) {
  161. this.list = res.data.data;
  162. console.log("---1---=" + this.list[0].finishStatus)
  163. console.log("---2---=" + this.list[0].resaleStatus)
  164. }
  165. }
  166. });
  167. },
  168. // 点击tab切换
  169. click(e) {
  170. console.log(e);
  171. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  172. this.param.cooperEntrustStatus = e.cooperEntrustStatus;
  173. this.param.applyConfirmStatus = e.applyConfirmStatus;
  174. this.param.finishStatus = e.finishStatus;
  175. this.param.resaleStatus = e.resaleStatus;
  176. this.param.upStatus = e.upStatus;
  177. this.refresh();
  178. },
  179. detail(item) {
  180. uni.navigateTo({
  181. url: '/pages/market/one/leader/detail?id=' + item.id
  182. });
  183. },
  184. resale(item) {
  185. uni.navigateTo({
  186. url: '/pages/market/two/leader/resale?item=' + JSON.stringify(item)
  187. });
  188. },
  189. orderRefund(id) {
  190. this.http.request({
  191. url: '/level-one-server/app/TbOrder/orderRefund',
  192. data: {
  193. id: id
  194. },
  195. method: 'POST',
  196. success: resp => {
  197. uni.showToast({
  198. title: '操作成功'
  199. });
  200. this.refresh();
  201. }
  202. });
  203. },
  204. updateResalePrice(id) {
  205. uni.navigateTo({
  206. url: '/pages/market/two/leader/updatePrice?id=' + id
  207. });
  208. },
  209. // 刷新数据
  210. refresh() {
  211. this.loadMore = true;
  212. this.param.pageNo = 1;
  213. this.list = [];
  214. this.getData();
  215. }
  216. },
  217. //下拉刷新
  218. onPullDownRefresh() {
  219. setTimeout(() => {
  220. this.refresh();
  221. uni.stopPullDownRefresh();
  222. }, 1000);
  223. },
  224. //上拉加载
  225. onReachBottom() {
  226. if (this.loadMore) {
  227. this.param.pageNo++;
  228. this.getData();
  229. }
  230. }
  231. };
  232. </script>
  233. <style lang="scss">
  234. page {
  235. background-color: $pg;
  236. }
  237. .goodsList .item .con {
  238. width: 97%;
  239. }
  240. .state {
  241. margin-right: -70px;
  242. }
  243. .down_btn {
  244. color: #f0f4f7;
  245. width: 44px;
  246. background: #f9ae3d;
  247. text-align: center;
  248. border-radius: 10px;
  249. font-size: 12px;
  250. padding: 2px 5px;
  251. }
  252. </style>