result.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <!-- 胎号查询成功页面 -->
  2. <template>
  3. <view>
  4. <view class="head">
  5. <view class="tips" @tap="$u.throttle(scanning, 500)">
  6. <view>
  7. <view><text>{{$t('numberquery.clickscancode')}}</text></view>
  8. </view>
  9. </view>
  10. <view class="stripe"></view>
  11. <view class="roll">
  12. <view>
  13. <view @click="show =! show">
  14. <u-icon name="edit-pen"></u-icon>{{$t('numberquery.input')}}
  15. </view>
  16. <view class="lnput" v-if="show==false">
  17. <input type="text" v-model="number" :placeholder="$t('numberquery.pleaseinput')" clearable="true" focus="true" />
  18. <u-button type="primary" size="medium" @click="query">{{$t('numberquery.query')}}</u-button>
  19. </view>
  20. <view class="roll_s" v-else>
  21. <view>{{datalist}}</view>
  22. </view>
  23. </view>
  24. <view>
  25. <view class="left"></view>
  26. <view class="right"></view>
  27. <u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
  28. </view>
  29. <view class="Exhibition" v-if="show_s == false">
  30. <view><text>{{$t('numberquery.number')}}</text><text>{{Information.tireNumber}}</text></view>
  31. <view><text>{{$t('numberquery.brand')}}</text><text>{{Information.brand}}</text></view>
  32. <view><text>{{$t('numberquery.specifications')}}</text><text>{{Information.specification}}</text></view>
  33. <view><text>{{$t('numberquery.type')}}</text><text>{{Information.mouldInType}}</text></view>
  34. <view><text>{{$t('numberquery.time')}}</text><text>{{Information.mouldInTime}}</text></view>
  35. <view v-if="Information.mouldOutType != null "><text>{{$t('numberquery.type')}}</text><text>{{Information.mouldOutType}}</text></view>
  36. <view v-if="Information.mouldOutTime != null "><text>{{$t('numberquery.time')}}</text><text>{{Information.mouldOutTime}}</text></view>
  37. </view>
  38. <view v-else style="margin-top: 100rpx;margin-bottom: 100rpx;">
  39. <u-empty :text="text" mode="list"></u-empty>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. request
  48. } from '../../../common/request/request'
  49. require("promise.prototype.finally").shim()
  50. export default {
  51. data() {
  52. return {
  53. datalist: this.$t('numberquery.promptinput'),
  54. number: '',
  55. empty: true,
  56. mouldOutTime: '',
  57. mouldOutType: '',
  58. mouldInTime: '',
  59. mouldInType: '',
  60. tireNumber: "",
  61. brand: '',
  62. specification: '',
  63. text: this.$t('numberquery.errormessage'),
  64. show: true,
  65. show_s: true,
  66. Information: []
  67. }
  68. },
  69. onReady() {
  70. uni.getNetworkType({
  71. success: function(res) {
  72. let none = res.networkType
  73. if (none == 'none') {
  74. uni.showToast({
  75. icon: 'none',
  76. title: this.$t('unified.networkstate'),
  77. position: "bottom"
  78. })
  79. }
  80. }
  81. });
  82. // uni.$on('update', data => {
  83. // this.datalist = data.materialList
  84. // })
  85. },
  86. created() {
  87. uni.setNavigationBarTitle({
  88. title: this.$t('numberquery.title')
  89. });
  90. },
  91. methods: {
  92. rendering() {
  93. request({
  94. url: '/myapp/mouldSelect',
  95. method: 'Post',
  96. data: {
  97. storeId: this.$store.state.storeInfo.storeId,
  98. userId: this.$store.state.storeInfo.userId,
  99. tireNumber: this.datalist,
  100. }
  101. }).then(res => {
  102. this.Information = []
  103. if (res.data.code == 0) {
  104. uni.showToast({
  105. icon: 'none',
  106. title: this.$t('numberquery.success'),
  107. position: "bottom"
  108. })
  109. this.empty = false
  110. this.show_s = false
  111. this.Information = res.data.data
  112. } else if (res.data.code == 500) {
  113. this.empty = true
  114. this.show_s = true
  115. uni.showToast({
  116. icon: 'none',
  117. title: res.data.msg,
  118. position: "bottom"
  119. })
  120. }
  121. this.text = res.data.msg
  122. }).catch(err => {
  123. uni.showToast({
  124. icon: 'none',
  125. title: this$t('numberquery.networkstate'),
  126. position: "bottom"
  127. })
  128. }).finally(() => {
  129. // Loading.close()
  130. })
  131. },
  132. scanning() {
  133. let this_ = this
  134. uni.scanCode({
  135. success: function(res) {
  136. this_.datalist = res.result
  137. this_.rendering()
  138. }
  139. })
  140. },
  141. query() {
  142. request({
  143. url: '/myapp/mouldSelect',
  144. method: 'Post',
  145. data: {
  146. storeId: this.$store.state.storeInfo.storeId,
  147. userId: this.$store.state.storeInfo.userId,
  148. tireNumber: this.number,
  149. }
  150. }).then(res => {
  151. this.Information = []
  152. if (res.data.code == 0) {
  153. uni.showToast({
  154. icon: 'none',
  155. title: this.$t('numberquery.success'),
  156. position: "bottom"
  157. })
  158. this.empty = false
  159. this.show_s = false
  160. this.Information = res.data.data
  161. this.number = ''
  162. } else if (res.data.code == 500) {
  163. this.empty = true
  164. this.show_s = true
  165. this.text = res.data.msg
  166. uni.showToast({
  167. icon: 'none',
  168. title: res.data.msg,
  169. position: "bottom"
  170. })
  171. }
  172. this.text = res.data.msg
  173. }).catch(err => {
  174. uni.showToast({
  175. icon: 'none',
  176. title: this$t('numberquery.networkstate'),
  177. position: "bottom"
  178. })
  179. }).finally(() => {
  180. // Loading.close()
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. .roll>view:nth-child(1)>view:nth-child(1) {
  188. width: 200rpx;
  189. color: #0094FE;
  190. position: relative;
  191. top: -40rpx;
  192. left: 400rpx;
  193. font-size: 32rpx;
  194. text-align: center;
  195. }
  196. .lnput>input {
  197. background-color: none;
  198. width: 50%;
  199. font-size: 42rpx;
  200. float: left;
  201. margin-top: 10rpx;
  202. margin-left: 20rpx;
  203. margin-right: 20rpx;
  204. font-weight: bold;
  205. color: #0192FD;
  206. }
  207. .lnput>u-button {
  208. margin-left: 10rpx;
  209. }
  210. .button {
  211. width: 90%;
  212. margin-top: 200rpx;
  213. }
  214. .roll_s {
  215. font-size: 42rpx;
  216. font-weight: bold;
  217. color: #0192FD;
  218. margin-bottom: 50rpx;
  219. text-align: center;
  220. }
  221. .head {
  222. width: 750rpx;
  223. height: 650rpx;
  224. background-color: #0095FF;
  225. .stripe {
  226. width: 650rpx;
  227. height: 30rpx;
  228. background: rgba(0, 0, 0, 0.2);
  229. border-radius: 12rpx;
  230. margin: 0 auto;
  231. margin-top: 40rpx;
  232. }
  233. .roll {
  234. width: 600rpx;
  235. height: auto;
  236. background: #FFFFFF;
  237. margin: 0 auto;
  238. margin-top: -15rpx;
  239. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  240. border-bottom-left-radius: 10rpx;
  241. border-bottom-right-radius: 10rpx;
  242. padding-top: 50rpx;
  243. padding-bottom: 40rpx;
  244. view:nth-child(2) {
  245. width: 100%;
  246. height: auto;
  247. .left {
  248. width: 50rpx;
  249. height: 50rpx;
  250. background-color: #F4F4F4;
  251. border-radius: 100%;
  252. float: left;
  253. margin-left: -30rpx;
  254. }
  255. .right {
  256. width: 50rpx;
  257. height: 50rpx;
  258. background-color: #F4F4F4;
  259. border-radius: 100%;
  260. float: right;
  261. margin-right: -30rpx;
  262. }
  263. }
  264. }
  265. .tips {
  266. text-align: center;
  267. height: 500rpx;
  268. view {
  269. width: 500rpx;
  270. height: 500rpx;
  271. background-color: rgba(255, 255, 255, 0.1);
  272. border-radius: 20rpx;
  273. margin: 0 auto;
  274. color: #FFFFFF;
  275. font-size: 32rpx;
  276. font-weight: bold;
  277. padding-top: 2%;
  278. view {
  279. width: 92%;
  280. height: 96%;
  281. background-color: #000000;
  282. padding-top: 41%;
  283. text {
  284. font-size: 42rpx;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. .Exhibition {
  291. width: 94%;
  292. margin: 0 auto;
  293. margin-top: 25rpx;
  294. }
  295. .Exhibition>view {
  296. margin-bottom: 10rpx;
  297. }
  298. .Exhibition>view>text:nth-child(2) {
  299. float: right;
  300. }
  301. </style>