index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view class="orders-container">
  3. <JHeader title="商家订单" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <view style="text-align: right;">
  5. <tui-button
  6. type="danger" width="220rpx" height="60rpx" margin="0 30upx 0 0"
  7. style="display: inline-block;border-radius: 30rpx;" @click="isShowVerificationCodeDialog = true"
  8. >
  9. 订单核销 →
  10. </tui-button>
  11. </view>
  12. <view class="navs">
  13. <view
  14. v-for="item in businessSubNavs" :key="item.value" class="nav-item"
  15. :class="{ 'nav-item-active': queryInfo.state === item.value }" @click="handleSwitchStatus(item.value)"
  16. >
  17. {{ item.label }}
  18. </view>
  19. </view>
  20. <view v-if="orderList && orderList.length" class="order-list-wrapper">
  21. <view
  22. v-for="item in orderList" :key="item.id"
  23. style="padding: 16upx 24upx 26upx;margin: 0 14upx 20upx;font-size: 28upx;background-color: #ffffff;"
  24. >
  25. <view>
  26. <!-- <view>
  27. <text>订单ID:</text>
  28. <text>{{ item.orderId || '--' }}</text>
  29. </view> -->
  30. <view style="display: flex;justify-content: space-between;align-items: center;">
  31. <view>
  32. <text>订单编号:</text>
  33. <text>{{ item.orderFormid || '--' }}</text>
  34. </view>
  35. <view>
  36. <text>{{ orderTypeEnum[item.state] || '--' }}</text>
  37. </view>
  38. </view>
  39. <view style="display: flex;justify-content: space-between;align-items: center;">
  40. <view>
  41. <text>用户手机号:</text>
  42. <text>{{ item.buyerPhone || '--' }}</text>
  43. </view>
  44. <view>
  45. <text v-if="item.paymentState">已支付</text>
  46. <text v-else>未支付</text>
  47. </view>
  48. </view>
  49. <view style="margin-top: 8upx;">
  50. <view style="display: flex;justify-content: space-between;align-items: center;">
  51. <view>
  52. <text>收货人姓名:</text>
  53. <text>{{ item.receiveName || '--' }}</text>
  54. </view>
  55. <view>
  56. <text>手机号:</text>
  57. <text>{{ item.receivePhone || '--' }}</text>
  58. </view>
  59. </view>
  60. <view>
  61. <text>收货人地址:</text>
  62. <text>{{ item.receiveAdress || '--' }}</text>
  63. </view>
  64. <view>
  65. <text>详细地址:</text>
  66. <text>{{ item.address || '--' }}</text>
  67. </view>
  68. </view>
  69. <view v-if="item.logisticsName || item.deliverFormid" style="margin-top: 8upx;">
  70. <view style="display: flex;justify-content: space-between;align-items: center;">
  71. <view>
  72. <text>物流方案名称:</text>
  73. <text>{{ item.logisticsName || '--' }}</text>
  74. </view>
  75. <view>
  76. <text>费用:</text>
  77. <text style="font-size: 32upx;color: #eb0909;">¥{{ item.logisticsPrice || '--' }}</text>
  78. </view>
  79. </view>
  80. <view style="display: flex;justify-content: space-between;align-items: center;">
  81. <view>
  82. <text>单号:</text>
  83. <text>{{ item.deliverFormid || '--' }}</text>
  84. </view>
  85. <view>
  86. <text>公司:</text>
  87. <text>{{ item.express || '--' }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <view style="padding: 12upx 0;margin-top: 12upx;border-top: 2upx solid #eeeeee;border-bottom: 2upx solid #eeeeee;">
  92. <view v-if="item.products && item.products.length">
  93. <view v-for="prod in item.products" :key="prod.skuId" style="display: flex;margin-top: 10upx;">
  94. <view>
  95. <image :src="common.seamingImgUrl(prod.image)" style="width: 180upx;height: 180upx;" />
  96. </view>
  97. <view style="display: flex;flex-direction: column;justify-content: space-evenly;margin-left: 18upx;">
  98. <view>{{ prod.productName }}</view>
  99. <view>{{ prod.value }}</view>
  100. <view><text style="margin-right: 8upx;font-size: 32upx;color: #eb0909;">¥{{ prod.price }}</text> x {{ prod.number }}</view>
  101. </view>
  102. </view>
  103. </view>
  104. <view style="margin-top: 8upx;">
  105. <view style="display: flex;justify-content: space-between;align-items: center;">
  106. <view>
  107. <text>商品数量:</text>
  108. <text>{{ item.number }}</text>
  109. </view>
  110. <view>
  111. <text>售后单号:</text>
  112. <text>{{ item.afterFormIds || '--' }}</text>
  113. </view>
  114. </view>
  115. <view style="display: flex;justify-content: space-between;align-items: center;">
  116. <view>
  117. <text>商品总价:</text>
  118. <text style="font-size: 32upx;color: #eb0909;">¥{{ item.orderPrice }}</text>
  119. </view>
  120. <view>
  121. <text>支付金额:</text>
  122. <text style="font-size: 32upx;color: #eb0909;">¥{{ item.price }}</text>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <view style="padding: 18upx 15upx 0;">
  129. <view style="display: flex;justify-content: space-between;">
  130. <text>下单时间:</text>
  131. <text>{{ item.createTime || '--' }}</text>
  132. </view>
  133. <view style="display: flex;justify-content: space-between;">
  134. <text>支付时间:</text>
  135. <text>{{ item.paymentTime || '--' }}</text>
  136. </view>
  137. <view style="display: flex;justify-content: space-between;align-items: center;">
  138. <view>
  139. <text>下单账户:</text>
  140. <text>{{ item.customerName || '--' }}</text>
  141. </view>
  142. <view>
  143. <text>下单总数:</text>
  144. <text>{{ item.total || '--' }}</text>
  145. </view>
  146. </view>
  147. <view style="display: flex;justify-content: space-between;">
  148. <text>下单备注:</text>
  149. <text>{{ item.remark || '--' }}</text>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <view style="padding-bottom: 45upx;">
  155. <LoadingMore
  156. :status="!isEmpty && !orderList.length
  157. ? 'loading' : !isEmpty && orderList.length && (orderList.length >= orderTotal) ? 'no-more' : ''"
  158. >
  159. </LoadingMore>
  160. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">暂无数据</tui-no-data>
  161. </view>
  162. <!-- 订单核销dialog -->
  163. <tui-dialog
  164. style="position: relative;z-index: 888;" :buttons="[{ text: '取消' }, { text: '确认核销', color: '#586c94' }]"
  165. :show="isShowVerificationCodeDialog" title="订单核销" @click="handleVerificationDialog"
  166. >
  167. <template #content>
  168. <view>
  169. <tui-input v-model="verificationCode" padding="26upx 0" label="核销码" placeholder="请填写核销码"></tui-input>
  170. </view>
  171. </template>
  172. </tui-dialog>
  173. </view>
  174. </template>
  175. <script>
  176. import { businessSubNavs } from '../../../pages/order/config'
  177. import { orderTypeEnum } from '../../../components/ATFOrderInfo/config'
  178. import { getShopOrderAllApi, updateSetHxCodeApi } from '../../../api/anotherTFInterface'
  179. export default {
  180. name: 'ShopOrders',
  181. data() {
  182. return {
  183. orderList: [],
  184. orderTotal: 0,
  185. isEmpty: false,
  186. queryInfo: {
  187. searchType: 1, // "搜索类型 1-订单ID 2-买家账户 3-收件人姓名 4-收件人手机号 5-商品ID"
  188. search: '',
  189. state: 0,
  190. afterState: '',
  191. dates: [],
  192. page: 1,
  193. pageSize: 10
  194. },
  195. businessSubNavs,
  196. orderTypeEnum,
  197. isShowVerificationCodeDialog: false,
  198. verificationCode: ''
  199. }
  200. },
  201. onShow() {
  202. this.queryInfo.page = 1
  203. this.getOrderList()
  204. },
  205. methods: {
  206. // 获取订单信息
  207. getOrderList(isLoadmore) {
  208. uni.showLoading()
  209. getShopOrderAllApi({ ...this.queryInfo, state: this.queryInfo.state || '' })
  210. .then((res) => {
  211. this.orderTotal = res.data.total
  212. if (isLoadmore) {
  213. this.orderList.push(...res.data.list)
  214. } else {
  215. this.orderList = res.data.list
  216. }
  217. this.isEmpty = this.orderList.length === 0
  218. uni.hideLoading()
  219. })
  220. .catch(() => {
  221. uni.hideLoading()
  222. })
  223. },
  224. // 切换状态
  225. handleSwitchStatus(status) {
  226. this.queryInfo.state = status
  227. this.queryInfo.page = 1
  228. this.getOrderList()
  229. },
  230. async handleVerificationDialog(e) {
  231. console.log(e)
  232. if (e.index === 0) {
  233. } else if (e.index === 1) {
  234. if (!this.verificationCode) return this.$showToast('请填写核销码')
  235. await updateSetHxCodeApi({ orderId: this.verificationCode, noticeId: 0 })
  236. .then((res) => {
  237. this.$showToast('核销成功', 'success')
  238. this.queryInfo.page = 1
  239. this.getOrderList()
  240. })
  241. }
  242. this.verificationCode = ''
  243. this.isShowVerificationCodeDialog = false
  244. }
  245. },
  246. onReachBottom() {
  247. if (this.orderList.length < this.orderTotal) {
  248. ++this.queryInfo.page
  249. this.getOrderList(true)
  250. }
  251. }
  252. }
  253. </script>
  254. <style lang="less" scoped>
  255. .orders-container {
  256. font-size: 28upx;
  257. color: #3d3d3d;
  258. padding: 60upx 0;
  259. box-sizing: border-box;
  260. .navs {
  261. width: 100%;
  262. display: flex;
  263. margin: 34upx 0;
  264. padding: 0 28upx;
  265. white-space: nowrap;
  266. overflow-x: auto;
  267. .nav-item {
  268. width: fit-content;
  269. padding: 0 26upx;
  270. transition: all 350ms;
  271. &.nav-item-active {
  272. color: #ff8f1f;
  273. }
  274. }
  275. }
  276. .order-list-wrapper {
  277. background-color: #f6f6f6;
  278. padding-top: 10px;
  279. font-size: 24upx;
  280. }
  281. }
  282. </style>