order.vue 6.1 KB

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