result.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <!-- 胎号查询成功页面 -->
  2. <template>
  3. <view>
  4. <view class="head" v-if="empty == true">
  5. <view class="tips">
  6. <image src="../../../static/sailun/successful.png" mode=""></image>
  7. <view>查询失败</view>
  8. </view>
  9. <view class="stripe"></view>
  10. <view class="roll">
  11. <view>查询失败</view>
  12. <view>
  13. <view></view>
  14. <view></view>
  15. <u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
  16. </view>
  17. <view class="Exhibition">
  18. <u-empty text="查询失败" mode="list"></u-empty>
  19. </view>
  20. </view>
  21. <u-button type="primary" shape="circle" class="button" @click="scanning">立即查询</u-button>
  22. </view>
  23. <view class="head" v-else>
  24. <view class="tips">
  25. <image src="../../../static/sailun/successful.png" mode=""></image>
  26. <view>查询成功</view>
  27. </view>
  28. <view class="stripe"></view>
  29. <view class="roll">
  30. <view>{{tireNumber}}</view>
  31. <view>
  32. <view></view>
  33. <view></view>
  34. <u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
  35. </view>
  36. <view class="Exhibition">
  37. <view><text>轮胎胎号</text><text>{{tireNumber}}</text></view>
  38. <view><text>轮胎类型</text><text>{{mouldType}}</text></view>
  39. <view><text>轮胎品牌</text><text>{{brand}}</text></view>
  40. <view><text>轮胎规格</text><text>{{specification}}</text></view>
  41. <view><text>创建时间</text><text>{{createTime}}</text></view>
  42. </view>
  43. </view>
  44. <u-button type="primary" shape="circle" class="button" @click="scanning">继续查询</u-button>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. request
  51. } from '../../../common/request/request'
  52. require("promise.prototype.finally").shim()
  53. export default {
  54. data() {
  55. return {
  56. datalist: '',
  57. empty: true,
  58. tireNumber: "未查询",
  59. mouldType: '未查询',
  60. brand: '未查询',
  61. specification: '未查询',
  62. createTime: '未查询'
  63. }
  64. },
  65. onReady() {
  66. uni.getNetworkType({
  67. success: function(res) {
  68. let none = res.networkType
  69. console.log(res.networkType);
  70. if (none == 'none') {
  71. uni.showToast({
  72. icon: 'none',
  73. title: '无网络,请连接网络后再试~',
  74. position: "bottom"
  75. })
  76. }
  77. }
  78. });
  79. setTimeout(() => {
  80. this.scanning()
  81. }, 100)
  82. },
  83. methods: {
  84. rendering() {
  85. console.log(this.datalist)
  86. request({
  87. url: '/myapp/mouldSelect',
  88. method: 'Post',
  89. data: {
  90. storeId: this.$store.state.storeInfo.storeId,
  91. userId: this.$store.state.storeInfo.userId,
  92. tireNumber: this.datalist,
  93. }
  94. }).then(res => {
  95. console.log(res.data)
  96. if(res.data.code == 0){
  97. this.empty = false
  98. this.tireNumber = res.data.data.tireNumber
  99. this.mouldType = res.data.data.mouldType
  100. this.brand = res.data.data.brand
  101. this.specification = res.data.data.specification
  102. this.createTime = res.data.data.createTime
  103. }else if (res.data.code == 500) {
  104. this.empty = true
  105. uni.showToast({
  106. icon: 'none',
  107. title: res.data.msg,
  108. position: "bottom"
  109. })
  110. }
  111. }).catch(err => {
  112. console.log(err)
  113. uni.showToast({
  114. icon: 'none',
  115. title: '出错了请联系管理员~',
  116. position: "bottom"
  117. })
  118. }).finally(() => {
  119. // Loading.close()
  120. })
  121. },
  122. scanning() {
  123. let this_ = this
  124. uni.scanCode({
  125. success: function(res) {
  126. console.log('条码类型:' + res.scanType);
  127. console.log('条码内容:' + res.result);
  128. this_.datalist = res.result
  129. this_.rendering()
  130. }
  131. })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .button {
  138. width: 90%;
  139. margin-top: 200rpx;
  140. }
  141. .head {
  142. width: 750rpx;
  143. height: 440rpx;
  144. background-color: #0095FF;
  145. .stripe {
  146. width: 650rpx;
  147. height: 30rpx;
  148. background: rgba(0, 0, 0, 0.2);
  149. border-radius: 12rpx;
  150. margin: 0 auto;
  151. margin-top: 40rpx;
  152. }
  153. .roll>view:nth-child(1) {
  154. font-size: 42rpx;
  155. font-weight: bold;
  156. color: #0192FD;
  157. text-align: center;
  158. margin-bottom: 50rpx;
  159. }
  160. .roll {
  161. width: 600rpx;
  162. height: auto;
  163. background: #FFFFFF;
  164. margin: 0 auto;
  165. margin-top: -15rpx;
  166. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  167. border-bottom-left-radius: 10rpx;
  168. border-bottom-right-radius: 10rpx;
  169. padding-top: 50rpx;
  170. padding-bottom: 40rpx;
  171. view:nth-child(2) {
  172. width: 100%;
  173. height: auto;
  174. view:nth-child(1),
  175. {
  176. width: 50rpx;
  177. height: 50rpx;
  178. background-color: #F4F4F4;
  179. border-radius: 100%;
  180. float: left;
  181. margin-left: -30rpx;
  182. }
  183. view:nth-child(2) {
  184. width: 50rpx;
  185. height: 50rpx;
  186. background-color: #F4F4F4;
  187. border-radius: 100%;
  188. float: right;
  189. margin-right: -30rpx;
  190. }
  191. }
  192. }
  193. .tips {
  194. text-align: center;
  195. image {
  196. margin-top: 60rpx;
  197. width: 106rpx;
  198. height: 112rpx;
  199. }
  200. view {
  201. margin-top: 50rpx;
  202. color: #FFFFFF;
  203. font-size: 32rpx;
  204. font-weight: bold;
  205. }
  206. }
  207. }
  208. .Exhibition {
  209. width: 94%;
  210. margin: 0 auto;
  211. margin-top: 25rpx;
  212. }
  213. .Exhibition>view {
  214. margin-bottom: 10rpx;
  215. }
  216. .Exhibition>view>text:nth-child(2) {
  217. float: right;
  218. }
  219. </style>