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