gasListBinding.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!--气瓶列表-->
  2. <template>
  3. <view id="gasRecycle">
  4. <view class="title">{{item.airName}}-{{item.configName}}</view>
  5. <view class="register_li">
  6. <view class="register_li_min">
  7. <view>*</view>
  8. <view>电子标签:</view>
  9. <input v-model="form.newTag" type="text" placeholder="请输入电子标签ID">
  10. <img @click.stop="saoCode" class="code_img" src="@/images/basicsModules/icon_aqjc_sm.png">
  11. </view>
  12. </view>
  13. <view class="sub_btn" @click="getBinding()">确认绑定</view>
  14. </view>
  15. </template>
  16. <script>
  17. import { gasTagBinding } from '@/api/apiDemo/index.js'
  18. export default {
  19. name: "gasRecycle",
  20. data() {
  21. return {
  22. pageType:0,
  23. form:{
  24. id:'',
  25. newTag:'',
  26. },
  27. item:{},
  28. }
  29. },
  30. onLoad(option) {
  31. this.item=JSON.parse(decodeURIComponent(option.item));
  32. this.form.id=this.item.bottleStorageId;
  33. },
  34. onShow() {
  35. },
  36. mounted(){
  37. },
  38. methods: {
  39. async getBinding(){
  40. let _this=this;
  41. const {data} = await gasTagBinding(this.form);
  42. if(data.code==200){
  43. let res = data.data;
  44. if(data.code==200){
  45. uni.showToast({
  46. title: '绑定成功!',
  47. icon:"none",
  48. mask:true,
  49. duration: 2000
  50. });
  51. uni.redirectTo({
  52. url: '/pages_student/gasList/gasListDetail?item='+encodeURIComponent(JSON.stringify(this.item))
  53. });
  54. }else{
  55. _this.form.newTag='';
  56. uni.showModal({
  57. showCancel:false,
  58. confirmColor:'#0183FA',
  59. content: '该RFID已被绑定,请重新选择 RFID标签',
  60. success: function (res) {
  61. if (res.confirm) {
  62. console.log('用户点击确定');
  63. }
  64. }
  65. });
  66. }
  67. }
  68. },
  69. //调用摄像头
  70. saoCode(){
  71. let _this = this;
  72. uni.scanCode({
  73. onlyFromCamera: true,
  74. success: function (res) {
  75. _this.form.newTag=res.result;
  76. _this.getBinding();
  77. }
  78. });
  79. },
  80. }
  81. }
  82. </script>
  83. <style lang="stylus" scoped>
  84. #gasRecycle {
  85. height: 100%;
  86. width: 100%;
  87. flex :1;
  88. display flex;
  89. flex-direction column
  90. overflow hidden;
  91. .title{
  92. width: 750rpx;
  93. height: 100rpx;
  94. background: #FFFFFF;
  95. font-size: 28rpx;
  96. font-family: PingFang SC;
  97. font-weight: 500;
  98. color: #333333;
  99. line-height: 100rpx;
  100. padding-left: 40rpx;
  101. }
  102. .register_li{
  103. background #fff;
  104. border-radius:20rpx;
  105. margin:20rpx 20rpx 0;
  106. padding:20rpx 0;
  107. box-sizing: border-box;
  108. .register_li_min{
  109. height: 100rpx;
  110. margin:0 26rpx;
  111. display flex;
  112. align-items center;
  113. /* border-bottom: 1px solid #F5F5F5; */
  114. .icon_img{
  115. width: 30rpx;
  116. height: 30rpx;
  117. margin-right: 12rpx;
  118. }
  119. view{
  120. //width:140rpx;
  121. font-size: 28rpx;
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. color: #999999;
  125. }
  126. view:nth-child(1){
  127. color:red;
  128. line-height:28rpx;
  129. margin-right: 12rpx;
  130. }
  131. .code_img{
  132. width: 30rpx;
  133. height: 28rpx;
  134. margin-left: 26rpx;
  135. }
  136. >input{
  137. flex:1;
  138. text-align: right;
  139. font-size: 24rpx;
  140. font-family: PingFang SC;
  141. font-weight: 500;
  142. color: #333333;
  143. }
  144. .binding{
  145. font-size: 24rpx;
  146. font-family: PingFang SC;
  147. font-weight: 500;
  148. color: #0183FA;
  149. line-height: 24rpx;
  150. margin-left: 24rpx;
  151. }
  152. }
  153. .issue_li{
  154. margin:34rpx 26rpx 0;
  155. display flex;
  156. border-bottom: 1px solid #F5F5F5;
  157. view:nth-child(1){
  158. color:red;
  159. line-height:28rpx;
  160. margin-right: 12rpx;
  161. }
  162. view:nth-child(2){
  163. //width:140rpx;
  164. font-size: 28rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #999999;
  168. }
  169. .issue_img{
  170. width: 210rpx;
  171. height: 210rpx;
  172. border-radius: 10rpx;
  173. margin-left:250rpx;
  174. }
  175. }
  176. }
  177. /* 按钮 */
  178. .sub_btn{
  179. width: 650rpx;
  180. height: 100rpx;
  181. background: #0183FA;
  182. border-radius: 20rpx;
  183. font-size: 28rpx;
  184. font-family: PingFang SC;
  185. font-weight: 500;
  186. color: #FFFFFF;
  187. line-height: 100rpx;
  188. text-align: center;
  189. margin-left: 50rpx;
  190. position: fixed;
  191. bottom:30rpx;
  192. }
  193. }
  194. </style>