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