index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="searchOrder">
  3. <view class="serch-box">
  4. <view class="search-container">
  5. <view class="box-left">
  6. <view class="search-text" @click="changePicker">
  7. <view class="text">{{ searchText }}</view>
  8. <tui-icon name="arrowdown" color="#999999" :size="15"></tui-icon>
  9. </view>
  10. <view class="search-icon">
  11. <tui-icon name="search-2" color="#999999" :size="15"></tui-icon>
  12. </view>
  13. </view>
  14. <view class="box-ipt">
  15. <input
  16. type="text"
  17. v-model="queryData.search"
  18. confirm-type="search"
  19. placeholder="请搜索订单"
  20. @confirm="searchConfirm"
  21. />
  22. </view>
  23. <view class="box-delete" @click="deleteSearch">
  24. <tui-icon name="close-fill" color="#999999" :size="15"></tui-icon>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- v-if="orderList.length > 0" -->
  29. <view class="order-container" v-if="orderList.length > 0">
  30. <view class="order-list">
  31. <view
  32. class="order-item"
  33. v-for="item in orderList"
  34. :key="item.orderId"
  35. @click="goOrderDetail(item)"
  36. >
  37. <view class="order-number">
  38. <view class="number">订单编号:{{ item.orderFormid }}</view>
  39. <view class="number-icon">
  40. <text>详情</text>
  41. <tui-icon
  42. name="arrowright"
  43. :size="20"
  44. color="#999999"
  45. style="padding: 0;"
  46. ></tui-icon>
  47. </view>
  48. </view>
  49. <view class="text-info">用户昵称:{{ item.customerName }}</view>
  50. <view class="text-info">用户手机号:{{ item.customerPhone }}</view>
  51. <view class="commodity-list">
  52. <view
  53. class="commodity-item"
  54. v-for="item2 in item.products"
  55. :key="item2.orderProductId"
  56. >
  57. <view class="item-left">
  58. <view class="left-image">
  59. <image :src="item2.image" />
  60. </view>
  61. <view class="left-text">
  62. <view class="text-title">{{ item2.productName }}</view>
  63. <template v-if="item2.productName == '扫码付款商品'">
  64. <view class="text-price">扫码付款商品</view>
  65. </template>
  66. <template v-else>
  67. <view class="text-price">小份</view>
  68. <view class="text-price">x1</view>
  69. </template>
  70. </view>
  71. </view>
  72. <view class="item-right">¥{{ item2.productPrice }}</view>
  73. </view>
  74. </view>
  75. <view class="gifts">
  76. <view class="gifs-left">赠送代金券</view>
  77. <view class="gifs-right">¥{{ item.presenterVoucher }}</view>
  78. </view>
  79. <view class="all-price">总价¥{{ item.price }}</view>
  80. <view class="border-box"></view>
  81. <view class="order-state">
  82. <text v-if="item.state == 1">待付款</text>
  83. <text v-if="item.state == 2">待发货</text>
  84. <text v-if="item.state == 3">待收货</text>
  85. <text v-if="item.state == 4">已完成</text>
  86. <text v-if="item.state == 5">交易关闭(已取消)</text>
  87. <text v-if="item.state == 6">待成团</text>
  88. <text v-if="item.state == 7">待售后</text>
  89. <text v-if="item.state == 8" :style="{ color: '#EA1717' }"
  90. >待核销(未付款)</text
  91. >
  92. <text v-if="item.state == 9">待核销(已付款)</text>
  93. <text v-if="item.state == 10">已核销</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <!-- v-else -->
  99. <view class="empty" v-else>
  100. <view class="order-empty">
  101. <image src="@/static/image/order/search-empty.png" />
  102. <view class="empty-title">您还没有相关订单</view>
  103. </view>
  104. </view>
  105. <tui-picker
  106. :show="showPicker"
  107. :pickerData="array"
  108. title="请选择"
  109. confirmColor="#ea5c1e"
  110. @hide="hide"
  111. @change="pickerChange"
  112. >
  113. </tui-picker>
  114. </view>
  115. </template>
  116. <script>
  117. import { orderGetAll } from "@/config/index";
  118. export default {
  119. data() {
  120. return {
  121. array: [
  122. {
  123. text: "订单Id",
  124. value: "1",
  125. },
  126. {
  127. text: "买家账户",
  128. value: "2",
  129. },
  130. {
  131. text: "收件人姓名",
  132. value: "3",
  133. },
  134. {
  135. text: "收件人电话号码",
  136. value: "4",
  137. },
  138. {
  139. text: "下单号码",
  140. value: "6",
  141. },
  142. ],
  143. showPicker: false,
  144. searchText: "订单Id",
  145. queryData: {
  146. afterState: "",
  147. dates: [],
  148. page: 1,
  149. pageSize: 10,
  150. search: "",
  151. searchType: "1",
  152. state: "",
  153. },
  154. orderList: [],
  155. total: 0,
  156. };
  157. },
  158. methods: {
  159. async searchConfirm(e) {
  160. if (this.queryData.search == "") {
  161. this.$showToast("请输入你要搜索的内容");
  162. return;
  163. }
  164. let res = await orderGetAll(this.queryData);
  165. this.orderList = [...this.orderList, ...res.data.list];
  166. this.total = res.data.total;
  167. },
  168. pickerChange(val) {
  169. this.searchText = val.text;
  170. this.queryData.searchType = val.value;
  171. },
  172. // 清除查询参数
  173. deleteSearch() {
  174. this.queryData.search = "";
  175. },
  176. // 去到订单详情
  177. goOrderDetail(item) {
  178. this.navigateTo(
  179. `/order_module/orderDetail/index?orderId=${item.orderId}`
  180. );
  181. },
  182. hide(e) {
  183. this.showPicker = false;
  184. },
  185. changePicker() {
  186. this.showPicker = true;
  187. },
  188. },
  189. // 触底加载
  190. onReachBottom() {
  191. if (this.orderList.length >= this.total) {
  192. this.$showToast("暂无更多订单数据");
  193. return
  194. };
  195. this.queryData.page++;
  196. this.searchConfirm();
  197. },
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. @import "./index.scss";
  202. </style>