index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="trace">
  3. <image style="width:100%;border-radius:10rpx;margin-bottom:30rpx"
  4. src="http://icc-oss.oss-cn-hangzhou.aliyuncs.com/app/czzn-app/trace-banner.png" mode="widthFix" />
  5. <view class="check-result">
  6. <view class="title">
  7. <image style="width:36rpx;margin-right:20rpx" src="../../static/czzn-img/approve/trace.png"
  8. mode="widthFix" />
  9. 防伪结果查询
  10. </view>
  11. <template v-if="traceInfo">
  12. <view class="info">
  13. <view class="head">亲爱的{{vehicleOrder.companyName}}: </view>
  14. <view class="content">
  15. 您好!您所查询的防伪编码为{{vehicleOrder.markingCodeName}},是{{vehicleOrder.tenantName}}生产正品{{vehicleOrder.materialName}}编码。该编码首次查询时间为{{traceInfo.createTime}}当前是第{{traceInfo.number}}次查询。请检验核对,谨防假冒。
  16. </view>
  17. <view class="bottom">
  18. 查询时间:{{traceInfo.traceTime}}
  19. </view>
  20. </view>
  21. </template>
  22. <template v-else>
  23. <u-empty mode="data" icon="https://cdn.uviewui.com/uview/empty/list.png" text="无法显示该订单的溯源信息">
  24. </u-empty>
  25. </template>
  26. </view>
  27. <view class="btn-wrap" v-if="traceInfo">
  28. <view class="btn" @click="toPage(0)">溯源链条</view>
  29. <view class="btn" @click="toPage(1)">电子票据</view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. create
  36. } from '../../api/trace'
  37. export default {
  38. data() {
  39. return {
  40. orderId: "",
  41. tenantId: "",
  42. traceInfo: null,
  43. vehicleOrder:null,
  44. }
  45. },
  46. onLoad(options) {
  47. console.log("获取到参数信息、", options);
  48. this.orderId = options.orderId
  49. this.tenantId = options.tenantId
  50. this.createTrace()
  51. },
  52. methods: {
  53. createTrace() {
  54. let data = {
  55. orderId: this.orderId,
  56. tenantId: this.tenantId
  57. }
  58. create(data).then(res => {
  59. if (res.statusCode == 200 && res.data.code == 0) {
  60. this.traceInfo = res.data.data
  61. this.vehicleOrder = res.data.data.vehicleOrder
  62. console.log("当前订单信息、", this.traceInfo);
  63. }
  64. })
  65. },
  66. toPage(index) {
  67. uni.navigateTo({
  68. url: `/substaticpages/trace/trace?index=${index}&orderId=${this.orderId}&tenantId=${this.tenantId}`
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. /* #ifndef APP-NVUE */
  76. page {
  77. background-color: #f5f7fa;
  78. }
  79. /* #endif */
  80. </style>
  81. <style lang="scss" scoped>
  82. .trace {
  83. padding: 20rpx 30rpx 150rpx;
  84. .btn-wrap {
  85. box-sizing: border-box;
  86. position: fixed;
  87. bottom: 0;
  88. left: 0;
  89. padding: 30rpx;
  90. background-color: #f5f7fa;
  91. width: 100%;
  92. display: flex;
  93. justify-content: space-around;
  94. .btn {
  95. width: 288rpx;
  96. line-height: 88rpx;
  97. color: #528BF7;
  98. border: 1px solid #528BF7;
  99. text-align: center;
  100. background-color: #fff;
  101. border-radius: 10rpx;
  102. font-size: 30rpx;
  103. }
  104. }
  105. }
  106. .check-result {
  107. padding: 0 30rpx;
  108. background-color: #fff;
  109. border-radius: 10rpx;
  110. .title {
  111. line-height: 90rpx;
  112. border-bottom: 1px solid #F0F2F5;
  113. display: flex;
  114. align-items: center;
  115. font-size: 30rpx;
  116. font-weight: bold;
  117. }
  118. .info {
  119. font-size: 28rpx;
  120. line-height: 48rpx;
  121. padding: 30rpx 0 100rpx;
  122. }
  123. .head {
  124. font-size: 24rpx;
  125. line-height: 40rpx;
  126. padding: 0 0 25rpx;
  127. }
  128. .content {
  129. text-indent: 20px;
  130. }
  131. .bottom {
  132. padding-top: 20px;
  133. text-align: end;
  134. }
  135. }
  136. </style>