Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <!-- 订单列表2 -->
  2. <template>
  3. <u-navbar :is-back="false" title="订单查询"></u-navbar>
  4. <view class="order-list" v-if="state.list && state.list.length > 0">
  5. <view class="order-item" v-for="item in state.list">
  6. <orderListItemNew :item="item"></orderListItemNew>
  7. </view>
  8. <uni-load-more :status="state.status" iconType="snow" :icon-size="16" :content-text="state.contentTxt" v-if="state.list.length > 0" />
  9. </view>
  10. <NoDataView v-else></NoDataView>
  11. <FixedFooter>
  12. <button
  13. type="default"
  14. class="ui-btn"
  15. @click="searchShow">
  16. 查询
  17. </button>
  18. </FixedFooter>
  19. <!--填写手机号 start-->
  20. <u-popup v-model="state.inputPhonePopup" mode="center">
  21. <view class="input-phone">
  22. <view class="title">订单查询</view>
  23. <view class="tips">请输入手机号进行订单查询</view>
  24. <u-form ref="myForm">
  25. <view class="input-phone-from">
  26. <u-form-item prop="phone">
  27. <view class="from_item">
  28. <text><text style="color: red"></text>手机号:</text>
  29. <u-input v-model="phone" class="input" placeholder="请输出查询手机号"/>
  30. </view>
  31. </u-form-item>
  32. <!-- <u-form-item prop="code">
  33. <view class="from_item">
  34. <text><text style="color: red"></text>验证码:</text>
  35. <u-input v-model="code" placeholder="请输入验证码" class="input" />
  36. <view class="hint2">
  37. <view class="green">{{ codeDuration === 0 ? "" : codeDuration }}</view>
  38. <view class="grey" @click="sendRegisterCode">{{ codeDuration === 0 ? "发送验证码" : "秒后可重发"
  39. }}</view>
  40. </view>
  41. </view>
  42. </u-form-item> -->
  43. </view>
  44. </u-form>
  45. <button type="default" class="ui-btn search-btn" @click="search">
  46. 查询
  47. </button>
  48. </view>
  49. </u-popup>
  50. <!--填写手机号 end-->
  51. </template>
  52. <script setup lang="ts">
  53. import { msg, navTo, confirm, checkStr } from "@/utils/utils";
  54. import orderTabbar from "./components/order-tabbar.vue";
  55. import orderListItem from "./components/order-list-item";
  56. import useOrderList from "@/composables/order/useOrderList";
  57. import filter from '@/components/filter/filter.vue';
  58. import {onUnload, onLoad} from '@dcloudio/uni-app'
  59. import { reactive } from "vue";
  60. import NoDataView from "@/components/no-data-view/no-data-view.vue";
  61. import orderListItemNew from "./components/order-list-item-new.vue";
  62. import { requestNew } from "@/utils/network/request";
  63. import { sendMessage, getChannleOrder} from "@/utils/network/api.js";
  64. import { ref } from "vue";
  65. import FixedFooter from '@/components/common/FixedFooter.vue'
  66. onLoad((option : any) => {
  67. console.log(option)
  68. })
  69. const state = reactive({
  70. list: [],
  71. status: 'nomore',
  72. contentTxt: {
  73. contentdown: '~上拉加载更多~',
  74. contentrefresh: '努力加载中...',
  75. contentnomore: '-- 我是有底线的 --'
  76. },
  77. inputPhonePopup: true
  78. });
  79. const getList = () => {
  80. let options = {
  81. type: 2,
  82. data: { mobile: phone.value },
  83. method: "POST",
  84. showLoading: true,
  85. }
  86. console.log(phone.value)
  87. requestNew(getChannleOrder, options).then((res) => {
  88. console.log(res)
  89. let list = res.orderList || []
  90. state.list = list
  91. if (list.length > 0) {
  92. state.inputPhonePopup = false
  93. } else {
  94. msg("该手机号暂无相关订单")
  95. }
  96. });
  97. }
  98. const search = () => {
  99. if (!phone.value) {
  100. msg("请输入手机号");
  101. return;
  102. } if (!checkStr(phone.value, 'mobile')) {
  103. msg("请输入正确的手机号");
  104. return;
  105. }
  106. getList();
  107. }
  108. const searchShow = () => {
  109. state.inputPhonePopup = true
  110. }
  111. //倒计时时常
  112. const codeDuration = ref(0);
  113. const phone = ref("");
  114. let interval = null;
  115. /* 验证码倒计时 */
  116. const codeInterval = () => {
  117. codeDuration.value = 60;
  118. interval = setInterval(() => {
  119. codeDuration.value--;
  120. if (codeDuration.value === 0) {
  121. if (interval) {
  122. clearInterval(interval);
  123. interval = null;
  124. }
  125. }
  126. }, 1000);
  127. };
  128. /* 发送验证码 */
  129. const sendRegisterCode = () => {
  130. if (codeDuration.value !== 0) {
  131. return;
  132. }
  133. const options = {
  134. type: 2,
  135. data: { mobile: phone.value },
  136. method: "POST",
  137. showLoading: true,
  138. };
  139. requestNew(sendMessage, options).then((res) => {
  140. msg("验证码发送成功!");
  141. codeInterval();
  142. });
  143. };
  144. </script>
  145. <style lang="scss">
  146. page {
  147. background: #E9EDF0;
  148. }
  149. :deep(.u-mode-center-box) {
  150. border-radius: 20rpx;
  151. }
  152. </style>
  153. <style lang="scss" scoped>
  154. .hint2 {
  155. margin-top: 40rpx;
  156. display: flex;
  157. .green {
  158. font-size: 28rpx;
  159. color: #00b38b;
  160. }
  161. .grey {
  162. font-size: 24rpx;
  163. color: #999999;
  164. margin-left: 16rpx;
  165. }
  166. }
  167. .input-phone{
  168. width: 600rpx;
  169. padding: 32rpx ;
  170. .title{
  171. padding: 12rpx 0;
  172. text-align: center;
  173. font-weight: bold;
  174. font-size: 32rpx;
  175. }
  176. .tips{
  177. color: #CCB375;
  178. font-size: 26rpx;
  179. line-height: 1.5;
  180. text-align: center;
  181. margin-bottom: 24rpx;
  182. }
  183. }
  184. .input-phone-from{
  185. padding: 12rpx 24rpx;
  186. background-color: #f7f7f7;
  187. border-radius: 12rpx;
  188. }
  189. .search-btn{
  190. width: 520rpx;
  191. margin: 32rpx auto 0;
  192. }
  193. </style>