You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install-activation-order.vue 6.3KB

2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
1 vuosi sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
1 vuosi sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <!-- 安装激活-选择订单 -->
  2. <template>
  3. <empty-view :mode="config.emptyHint.mode" :content="config.emptyHint.hint" v-if="params.ordersList.length === 0" />
  4. <view class="list" v-else>
  5. <view class="item" v-for="(item,index) in params.ordersList" :key="index" :item="item">
  6. <view class="head">
  7. <view class="name">
  8. <image :src="`${$imgUrl}order/icon-star-green.png`" class="icon"></image>
  9. <text class="title">{{item.productName ?item.productName: ''}}</text>
  10. </view>
  11. <view class="status text-orange">{{getOrderStatusName(item.orderStep)}}</view>
  12. </view>
  13. <view class="detail">
  14. <view class="orders">
  15. <view class="order-text">
  16. <text class="type">新办单号:</text>
  17. <text class="value">{{item.orderId}}</text>
  18. </view>
  19. <view class="order-text odd">
  20. <text class="type">业务类型:</text>
  21. <text class="value">{{getOrderTypeName(item.orderType)}}</text>
  22. </view>
  23. <view class="order-text odd">
  24. <text class="type">订单车牌号:</text>
  25. <text class="value">{{item.vehiclePlate}}</text>
  26. </view>
  27. <view class="order-text ">
  28. <text class="type">订单金额:</text>
  29. <text class="value">¥ {{item.amount / 100 ?item.amount / 100: '0.00'}}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="btns">
  34. <view class="btn btn-primary as-gravity-center" @click="gotoActiveOrder(item)">去激活</view>
  35. </view>
  36. </view>
  37. <uni-load-more :status="params.status" iconType="snow" :icon-size="16" :content-text="config.contentTxt"
  38. v-if="params.ordersList.length > 0" />
  39. </view>
  40. </template>
  41. <script setup lang="ts">
  42. import { reactive, ref, watch } from "vue";
  43. import { request } from "@/utils/network/request.js";
  44. import { stringToJson } from "@/utils/network/encryption";
  45. import { onLoad, onUnload, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
  46. import { getItem, StorageKeys } from "@/utils/storage";
  47. import { hasLogin, msg, getOrderStatusName, getOrderTypeName } from "@/utils/utils";
  48. import { noActivationOrder } from "@/utils/network/api";
  49. import { PageData } from "@/datas/enum";
  50. import useOrderSkip from "@/composables/order/useOrderSkip";
  51. //跳转
  52. const { gotoActiveOrder } = useOrderSkip();
  53. const config = {
  54. emptyHint: {
  55. hint: '~ 暂无待激活订单 ~',
  56. icon: '',
  57. mode: 'order'
  58. },
  59. contentTxt: {
  60. contentdown: '~上拉加载更多~',
  61. contentrefresh: '努力加载中...',
  62. contentnomore: '-- 我是有底线的 --'
  63. }
  64. }
  65. //请求参数
  66. const params = reactive({
  67. pageNum: PageData.NUM,
  68. pageSize: PageData.SIZE,
  69. total: 0,
  70. status: 'more',
  71. reload: false,
  72. ordersList: [],
  73. })
  74. /* 刷新列表 */
  75. const refreshList = () => {
  76. params.pageNum = 1;
  77. params.total = 0;
  78. params.ordersList = [];
  79. params.status = 'more';
  80. params.reload = false;
  81. getList();
  82. }
  83. /* 加载更多 */
  84. const loadMore = () => {
  85. if (params.total > params.ordersList.length) {
  86. params.status = 'loading';
  87. params.pageNum++;
  88. getList();
  89. } else {
  90. params.status = 'noMore';
  91. }
  92. }
  93. /* 获取列表数据 */
  94. const getList = async () => {
  95. if (!hasLogin()) {
  96. uni.stopPullDownRefresh();
  97. return;
  98. }
  99. let source = ""
  100. // #ifdef MP-ALIPAY
  101. source = "ALI"
  102. // #endif
  103. // #ifdef MP-WEIXIN
  104. source = "WECHAT"
  105. // #endif
  106. let res : any = null;
  107. const options = {
  108. type: 2,
  109. data: {
  110. "opId": getItem(StorageKeys.OpenId),
  111. },
  112. method: 'POST',
  113. showLoading: params.pageNum === 1 ? true : false,
  114. }
  115. try {
  116. res = await request(noActivationOrder, options);
  117. const data = stringToJson(res.bizContent);
  118. params.total = data.data;
  119. console.log("res====", params.total)
  120. if (params.total.length > 0) {
  121. const curList = data.data || [];
  122. params.ordersList = params.reload ? curList : params.ordersList.concat(curList);
  123. params.reload = false;
  124. }
  125. if (params.total === params.ordersList.length) {
  126. params.reload = false;
  127. params.status = 'noMore';
  128. }
  129. if (params.pageNum === 1) {
  130. uni.stopPullDownRefresh();
  131. }
  132. console.log("params.ordersList", params.ordersList)
  133. } catch (e) {
  134. console.log('输出内容', e)
  135. uni.stopPullDownRefresh();
  136. }
  137. }
  138. onLoad(() => {
  139. //监听订单刷新信息
  140. uni.$on('refreshOrder', (data) => {
  141. refreshList();
  142. });
  143. refreshList();
  144. });
  145. onUnload(() => {
  146. uni.$off('refreshOrder');
  147. });
  148. onPullDownRefresh(() => {
  149. refreshList();
  150. });
  151. onReachBottom(() => {
  152. loadMore();
  153. });
  154. </script>
  155. <style>
  156. page {
  157. background-color: #EEF7F7;
  158. }
  159. </style>
  160. <style lang="scss" scoped>
  161. .list {
  162. padding: 30rpx 30rpx 0rpx;
  163. display: flex;
  164. flex-direction: column;
  165. }
  166. .list .item {
  167. background: #ffffff;
  168. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  169. border-radius: 20rpx;
  170. box-sizing: border-box;
  171. display: flex;
  172. flex-direction: column;
  173. margin-bottom: 30rpx;
  174. }
  175. .list .item .head {
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. padding: 20rpx 28rpx;
  180. border-bottom: 1px solid #dcdcdc;
  181. }
  182. .list .item .head .icon {
  183. width: 48rpx;
  184. height: 48rpx;
  185. }
  186. .list .item .head .name {
  187. display: flex;
  188. align-items: center;
  189. }
  190. .list .text-green {
  191. font-size: 26rpx;
  192. color: #00b38b;
  193. }
  194. .list .text-orange {
  195. font-size: 26rpx;
  196. color: #ff8000;
  197. }
  198. .list .title {
  199. font-size: 30rpx;
  200. color: #333;
  201. }
  202. .list .detail {
  203. display: flex;
  204. justify-content: space-between;
  205. align-items: center;
  206. padding: 30rpx 32rpx;
  207. }
  208. .list .detail .type {
  209. font-size: 26rpx;
  210. color: #999;
  211. }
  212. .list .detail .value {
  213. font-size: 26rpx;
  214. color: #333;
  215. }
  216. .list .finished .detail .value {
  217. color: #999;
  218. }
  219. .list .detail .odd {
  220. margin: 20rpx 0;
  221. }
  222. .list .cny {
  223. font-size: 26rpx;
  224. color: #333;
  225. }
  226. .list .finished .cny {
  227. color: #999;
  228. }
  229. .list .amount {
  230. font-size: 40rpx;
  231. font-weight: bold;
  232. }
  233. .list .finished .amount {
  234. color: #999;
  235. }
  236. .list .btns {
  237. display: flex;
  238. align-items: center;
  239. justify-content: flex-end;
  240. border-top: 1px solid #dcdcdc;
  241. margin: 0 30rpx;
  242. padding: 20rpx 0;
  243. }
  244. .list .btn {
  245. height: 60rpx;
  246. // line-height: 60rpx;
  247. border-radius: 30rpx;
  248. padding: 0 24rpx;
  249. font-size: 26rpx;
  250. box-sizing: border-box;
  251. margin-right: 20rpx;
  252. }
  253. .list .btns .btn:last-child {
  254. margin: 0;
  255. }
  256. .list .btn-primary {
  257. border: 1px solid #00b38b;
  258. color: #00b38b;
  259. }
  260. .list .btn-normal {
  261. border: 1px solid #dcdcdc;
  262. color: #333;
  263. }
  264. </style>