order.vue 5.8 KB

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