order.vue 7.3 KB

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