infoLock.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. <template>
  2. <view class="jpmain ">
  3. <view class="gradient-header">
  4. <view class="jpback">
  5. </view>
  6. </view>
  7. <view class="body">
  8. <view class="page-top">
  9. <view class="text1">地锁名称</view>
  10. <view class="text2">地锁名称11<u-icon name="edit-pen" size="32" color="#FFFFFF" ></u-icon></view>
  11. </view>
  12. <view class="page">
  13. <view class="info-title">
  14. <view class="name">设备信息</view>
  15. <view class="value">
  16. <view class="pack-up" v-show="listShow" @click="listShow=false">
  17. 收起<u-icon name="arrow-up" size="32" color="#AAAAAA" ></u-icon>
  18. </view>
  19. <view class="pack-up" v-if="!listShow" @click="listShow=true">
  20. 展开<u-icon name="arrow-down" size="32" color="#AAAAAA" ></u-icon>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="table">
  25. <view class="row">
  26. <view class="name">设备型号</view>
  27. <view class="value">{{obj.model}}</view>
  28. </view>
  29. <view class="row">
  30. <view class="name">出厂编号</view>
  31. <view class="value">{{obj.deviceNo}}</view>
  32. </view>
  33. <template v-if="!listShow">
  34. <view class="row">
  35. <view class="name">固件版号</view>
  36. <view class="value">{{obj.firmwareVersion}}</view>
  37. </view>
  38. <view class="row">
  39. <view class="name">防护等级</view>
  40. <view class="value">{{obj.protectionGrade}}</view>
  41. </view>
  42. <view class="row">
  43. <view class="name">输入电压</view>
  44. <view class="value">{{obj.inputVoltage}}</view>
  45. </view>
  46. <view class="row">
  47. <view class="name">输出电压</view>
  48. <view class="value">{{obj.outputVoltage}}</view>
  49. </view>
  50. <view class="row">
  51. <view class="name">输出电流</view>
  52. <view class="value">{{obj.outputCurrent}}</view>
  53. </view>
  54. <view class="row">
  55. <view class="name">输出功率</view>
  56. <view class="value">{{obj.outputPower}}</view>
  57. </view>
  58. <view class="row">
  59. <view class="name">生产日期</view>
  60. <view class="value">{{obj.manufactureTime}}</view>
  61. </view>
  62. <view class="row">
  63. <view class="name">标准依据</view>
  64. <view class="value">{{obj.standardBasis}}</view>
  65. </view>
  66. <view class="row">
  67. <view class="name">联网卡号</view>
  68. <view class="value">{{obj.trafficCardNumber}}</view>
  69. </view>
  70. <view class="row">
  71. <view class="name">资费标准</view>
  72. <view class="value">{{obj.tariffStandard}}</view>
  73. </view>
  74. <view class="row">
  75. <view class="name">设备启动时间</view>
  76. <view class="value">{{obj.bindingTime}}</view>
  77. </view>
  78. <view class="row">
  79. <view class="name">设备质保期</view>
  80. <view class="value">{{obj.shelfLife}}</view>
  81. </view>
  82. </template>
  83. </view>
  84. </view>
  85. <view class="page">
  86. <view class="info-title">
  87. <view class="name">联网信息</view>
  88. <view class="value">
  89. </view>
  90. </view>
  91. <view class="table">
  92. <view class="row">
  93. <view class="name">联网卡号</view>
  94. <view class="value">{{obj.trafficCardNumber}}</view>
  95. </view>
  96. <view class="row">
  97. <view class="name">有效期至</view>
  98. <view class="value">{{obj.expirationTime?obj.expirationTime.split(' ')[0]:''}}
  99. </view>
  100. </view>
  101. <view class="tips">
  102. <u-icon style=" margin-top: 2px;" size="30" name="info-circle"></u-icon>
  103. <view>
  104. 家用充电桩内含物联网卡,此卡随设备出厂时赠送三年免费使用时长,三年后将按5元/月资费标准收取费用。
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="page">
  110. <view class="info-title">
  111. <view class="name">充电白名单<span class="span">({{vipUserList.length}}/3)</span></view>
  112. <view class="value" @click="addUser()">
  113. <u-icon style=" margin-top: 2px;" size="30" name="plus"></u-icon> 添加
  114. </view>
  115. </view>
  116. <view class="table">
  117. <table>
  118. <tr>
  119. <td>姓名</td>
  120. <td>手机号</td>
  121. <td>车牌号</td>
  122. <td>操作</td>
  123. </tr>
  124. <tr v-for="(item,i) in vipUserList" :key="i">
  125. <td>{{item.userName}}</td>
  126. <td>{{item.phone}}</td>
  127. <td>{{item.carNum==0?'':item.carNum}}</td>
  128. <td class="" style="color:#1677FF" @click="editUser(item)">修改</td>
  129. </tr>
  130. </table>
  131. </view>
  132. </view>
  133. </view>
  134. <u-popup v-model="popupShow" mode="bottom" :closeable="true" border-radius="30">
  135. <view class="popup-screen">
  136. <view class="popup-title">{{vipUser.id?'修改':'添加'}}白名单信息</view>
  137. <view style="padding: 4px;">白名单车主姓名<span style="color: red;">*</span></view>
  138. <u-input :customStyle="customStyle" v-model="vipUser.name" placeholder="白名单车主姓名(必填)"></u-input>
  139. <view style="padding: 4px;">白名单车主手机号码<span style="color: red;">*</span></view>
  140. <u-input :customStyle="customStyle" type="number" v-model="vipUser.phone"
  141. placeholder="白名单车主手机号码(必填)"></u-input>
  142. <view style="padding: 4px;">白名单车主车牌号</view>
  143. <u-input :customStyle="customStyle" v-model="vipUser.carNum" placeholder="白名单车主车牌号"></u-input>
  144. <view v-if="vipUser.id" style="display: flex;">
  145. <u-button type="info" style="margin-top: 10px;width: 49%;" shape="circle"
  146. @click="delUser()">删除</u-button>
  147. <u-button type="success" style="margin-top: 10px;width: 49%;" shape="circle"
  148. @click="submitUser()">保存</u-button>
  149. </view>
  150. <view v-else>
  151. <u-button type="success" style="margin-top: 10px;" shape="circle"
  152. @click="submitUser()">保存</u-button>
  153. </view>
  154. </view>
  155. </u-popup>
  156. <u-modal v-model="delShow" @confirm="confirmDelete" confirm-color="#fa3534" :show-cancel-button="true"
  157. ref="uModal" title="删除白名单用户" content="是否删除当前白名单用户?" confirm-text="删除"></u-modal>
  158. <view class="floating-button">
  159. <view class="button">
  160. 保存
  161. </view>
  162. </view>
  163. </view>
  164. </template>
  165. <script>
  166. export default {
  167. data() {
  168. return {
  169. listShow: true,
  170. popupShow: false,
  171. customStyle: {
  172. "border-radius": "50px",
  173. "background-color": 'rgba(242, 244, 246, 1)',
  174. padding: "5px 20px",
  175. margin: "5px 0 "
  176. },
  177. applyList: [],
  178. vipUserList: [],
  179. vipUser: {},
  180. delShow: false,
  181. obj: {},
  182. };
  183. },
  184. onLoad(op) {
  185. //this.myApplyList()
  186. },
  187. methods: {
  188. submitUser() {
  189. if (!this.vipUser.name) {
  190. uni.showToast({
  191. title: "请填写白名单车主姓名"
  192. })
  193. return
  194. }
  195. if (!this.vipUser.phone) {
  196. uni.showToast({
  197. title: "请填写白名单车主手机号码"
  198. })
  199. return
  200. }
  201. uni.showLoading({
  202. title: "加载中",
  203. mask: true,
  204. })
  205. API_apply.saveVipUser(this.vipUser).then((res) => {
  206. //this.obj = res.data
  207. uni.hideLoading()
  208. this.delShow = false
  209. this.popupShow = false
  210. this.findVipUser(1)
  211. }).catch(error => {
  212. uni.showToast({
  213. title: error
  214. })
  215. })
  216. },
  217. confirmDelete() {
  218. uni.showLoading({
  219. title: "加载中",
  220. mask: true,
  221. })
  222. API_apply.deleteVipUser({
  223. id: this.vipUser.id
  224. }).then((res) => {
  225. //this.obj = res.data
  226. uni.hideLoading()
  227. this.delShow = false
  228. this.popupShow = false
  229. uni.showToast({
  230. title: "操作成功"
  231. })
  232. this.findVipUser(1)
  233. }).catch(error => {
  234. uni.showToast({
  235. title: error
  236. })
  237. })
  238. },
  239. delUser() {
  240. this.delShow = true;
  241. },
  242. editUser(item) {
  243. this.popupShow = true;
  244. this.vipUser = item;
  245. this.vipUser.name = item.userName
  246. var item = this.applyList[0]
  247. this.vipUser.stationId = item.stationId
  248. if (this.vipUser.carNum == 0) {
  249. this.vipUser.carNum = ''
  250. }
  251. },
  252. addUser() {
  253. if (this.vipUserList.length >= 3) {
  254. uni.showToast({
  255. title: "添加白名单用户已达到上限"
  256. })
  257. return
  258. }
  259. this.popupShow = true;
  260. this.vipUser = {}
  261. var item = this.applyList[0]
  262. this.vipUser.stationId = item.stationId
  263. },
  264. findDeviceByNo() {
  265. var item = this.applyList[0]
  266. API_apply.findDeviceByNoD({
  267. deviceNo: item.deviceNo
  268. }).then((res) => {
  269. this.obj = res.data.chargingDevice
  270. uni.hideLoading()
  271. }).catch(error => {
  272. uni.showToast({
  273. title: error
  274. })
  275. })
  276. },
  277. findVipUser(bl) {
  278. if (bl) {
  279. uni.showLoading({
  280. title: "加载中",
  281. mask: true,
  282. })
  283. }
  284. var item = this.applyList[0]
  285. this.vipUserList = []
  286. API_apply.findVipUser({
  287. stationId: item.stationId
  288. }).then((res) => {
  289. if (bl) {
  290. uni.hideLoading()
  291. uni.showToast({
  292. title: "操作成功"
  293. })
  294. }
  295. this.vipUserList = res.data.vipUserList
  296. }).catch(error => {
  297. uni.showToast({
  298. title: error
  299. })
  300. })
  301. },
  302. myApplyList() {
  303. uni.showLoading({
  304. title: "加载中",
  305. mask: true,
  306. })
  307. API_apply.myApplyList({
  308. }).then((res) => {
  309. //this.obj = res.data
  310. this.applyList = res.data.applyList;
  311. this.findVipUser()
  312. this.findDeviceByNo()
  313. }).catch(error => {
  314. uni.showToast({
  315. title: error
  316. })
  317. })
  318. },
  319. }
  320. }
  321. </script>
  322. <style>
  323. page {
  324. background-color: rgba(242, 244, 246, 1);
  325. }
  326. </style>
  327. <style lang="scss" scoped>
  328. .gradient-header {
  329. height: 0px;
  330. }
  331. .jpback {
  332. height: 360rpx;
  333. background: linear-gradient(180deg, rgba(22,119,255,1) 11%,rgba(242,244,246,1) 100%); }
  334. .body {
  335. padding: 32rpx;
  336. }
  337. .page-top{
  338. color: rgba(255,255,255,1);
  339. margin: 48rpx 0;
  340. .text1{
  341. font-size: 36rpx;
  342. margin-bottom: 12rpx;
  343. }
  344. .text2{
  345. font-size: 40rpx;
  346. }
  347. }
  348. .page {
  349. border-radius: 16rpx;
  350. background-color: rgba(255, 255, 255, 1);
  351. color: rgba(16, 16, 16, 1);
  352. padding: 32rpx;
  353. margin-bottom: 32rpx;
  354. font-size: 32rpx;
  355. color: rgb(16, 16, 16);
  356. .info-title{
  357. display: flex;
  358. justify-content: space-between;
  359. padding-bottom: 24rpx ;
  360. .name{
  361. font-size: 36rpx;
  362. color: rgba(51, 51, 51, 1);
  363. font-weight: bold;
  364. .span{
  365. font-weight: 400;
  366. font-size: 28rpx;
  367. color: rgba(119, 119, 119, 1);
  368. }
  369. }
  370. .value{
  371. font-size: 28rpx;
  372. color: rgba(119, 119, 119, 1);
  373. }
  374. }
  375. .pack-up {
  376. color: rgba(119, 119, 119, 100);
  377. }
  378. .tips{
  379. margin-top: 12rpx;
  380. display: flex;
  381. align-items: flex-start;
  382. font-size: 24rpx;
  383. }
  384. .table{
  385. table{
  386. width: 100%;
  387. }
  388. .row{
  389. display: flex;
  390. align-items: center;
  391. height: 72rpx;
  392. font-size: 28rpx;
  393. padding: 0 24rpx;
  394. .name{
  395. width: 240rpx;
  396. }
  397. }
  398. td{
  399. height: 72rpx;
  400. font-size: 28rpx;
  401. padding: 0 24rpx;
  402. }
  403. /* 隔行变色: 偶数行设置背景色 */
  404. .row:nth-child(odd) {
  405. background-color: #f9f9f9; /* 偶数行 */
  406. }
  407. tr:nth-child(odd) {
  408. background-color: #f9f9f9; /* 偶数行 */
  409. }
  410. .row:nth-child(even) {
  411. background-color: #ffffff; /* 奇数行 */
  412. }
  413. tr:nth-child(even) {
  414. background-color: #ffffff; /* 奇数行 */
  415. }
  416. }
  417. }
  418. .popup-screen{
  419. padding: 40rpx;
  420. .popup-title{
  421. font-size: 36rpx;
  422. color: rgba(51, 51, 51, 1);
  423. font-weight: bold;
  424. padding-bottom: 10px;
  425. }
  426. .cardList{
  427. display: flex;
  428. justify-content: space-evenly;
  429. .cardInfo{
  430. display: flex;
  431. flex-direction: column;
  432. justify-content: center;
  433. width: 160rpx;
  434. height: 160rpx;
  435. border-radius: 8px;
  436. background-color: rgba(255, 255, 255, 1);
  437. text-align: center;
  438. border: 1px solid rgba(187, 187, 187, 1);
  439. .name{
  440. color: rgba(16, 16, 16, 1);
  441. font-size: 28rpx;
  442. }
  443. .price{
  444. color: rgba(16, 16, 16, 1);
  445. font-size: 48rpx;
  446. font-weight: bold;
  447. }
  448. }
  449. .cardInfoCk{
  450. background-color: rgba(225, 247, 237, 1);
  451. border: 1px solid rgba(0, 185, 98, 1);
  452. .price{
  453. color: rgba(0, 161, 85, 1);
  454. }
  455. }
  456. }
  457. }
  458. .floating-button {
  459. position: fixed;
  460. bottom: 0;
  461. /* 距离底部 20px */
  462. width: 100%;
  463. display: flex;
  464. height: 120rpx;
  465. justify-content: center;
  466. background-color: rgba(255, 255, 255, 1);
  467. .button {
  468. margin-top: 24rpx;
  469. border-radius: 50px;
  470. height: 80rpx;
  471. width: 80%;
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. padding: 12rpx;
  476. background-color: rgba(22, 119, 255, 1);
  477. color: rgba(255, 255, 255, 1);
  478. font-size: 36rpx;
  479. }
  480. }
  481. </style>