projectInfo.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="nameImage">
  5. <image class="image1" src="../../../static/项目管理/图像@2x.png"></image>
  6. <text class="name">{{formData.name}}</text>
  7. <view class="tianchong"></view>
  8. <view class="bottom">
  9. <view class="contact">
  10. <view class="con">
  11. <image class="image2" src="../../../static/项目管理/联系人@2x.png"></image>
  12. <text class="con1">联系人</text>
  13. </view>
  14. <text class="contact1">{{formData.customer}} {{formData.customerTel}}</text>
  15. </view>
  16. <view class="address">
  17. <view class="add">
  18. <image class="image3" src="../../../static/项目管理/地址@2x.png"></image>
  19. <text class="add1">地 址</text>
  20. </view>
  21. <text class="address1">{{formData.province}}{{formData.city}}{{formData.address}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="xiaban"></view>
  27. <view class="mid">
  28. <text class="gateway" style="font-size: 40rpx;font-weight: 550;">网关列表</text>
  29. <view class="tiao"></view>
  30. </view>
  31. <view class="gatewayList" v-for="item in gateways" :key="item.code">
  32. <view class="col">
  33. <view class="switch">
  34. <switch checked color="#007AFE" @change="switchChange" />
  35. </view>
  36. <view class="list" @tap="showDevice" :data-code="item.code">设备列表 ></view>
  37. </view>
  38. <text class="title">{{item.number}}</text>
  39. <view class="content">
  40. <text>网关IP:{{item.ip}}</text>
  41. <text>点位名称:{{item.location}}</text>
  42. </view>
  43. </view>
  44. <view class="uni-btn-v">
  45. <button form-type="submit" class="button1">删除项目</button>
  46. <button form-type="submit" class="button2">修改项目信息</button>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. gateways: [],
  55. formData: {
  56. name: '',
  57. number: '',
  58. description: '',
  59. customer: '',
  60. customerTel: '',
  61. address: '',
  62. province: '',
  63. city: '',
  64. }
  65. }
  66. },
  67. onLoad(e) {
  68. console.log(e);
  69. uni.request({
  70. url: 'http://127.0.0.1:9999/project/detail?code=' + e.code,
  71. method: 'GET',
  72. data: {},
  73. success: res => {
  74. this.formData = res.data.data.project;
  75. console.log(this.formData);
  76. },
  77. });
  78. uni.request({
  79. url: 'http://127.0.0.1:9999/gateway/list?projectCode=' + e.code,
  80. method: 'GET',
  81. data: {},
  82. success: res => {
  83. this.gateways = res.data.data.gateways;
  84. console.log(this.gateways);
  85. },
  86. });
  87. },
  88. methods: {
  89. showDevice(e) {
  90. console.log(e);
  91. var code = e.currentTarget.dataset.code;
  92. uni.navigateTo({
  93. url: '/pages/device/device?code=' + code,
  94. });
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. .list {
  101. font-size: 28rpx;
  102. color: #007AFF;
  103. margin-right: 20rpx;
  104. margin-top: 85rpx;
  105. }
  106. .switch {
  107. transform: scale(0.6);
  108. margin-left: 30rpx;
  109. }
  110. .col {
  111. float: right;
  112. }
  113. .uni-btn-v {
  114. display: flex;
  115. flex-direction: row;
  116. margin-top: 100rpx;
  117. }
  118. .button1 {
  119. width: 315rpx;
  120. height: 76rpx;
  121. margin-top: 30rpx;
  122. background-color: #E02021;
  123. color: white;
  124. font-size: unset;
  125. }
  126. .button2 {
  127. width: 315rpx;
  128. height: 76rpx;
  129. margin-top: 30rpx;
  130. background-color: #007AFF;
  131. color: white;
  132. font-size: unset;
  133. }
  134. .gatewayList {
  135. width: 702rpx;
  136. height: 230rpx;
  137. background-color: white;
  138. margin-top: 30rpx;
  139. margin-left: 24rpx;
  140. border-radius: 10rpx;
  141. padding-top: 30rpx;
  142. }
  143. .content {
  144. display: flex;
  145. flex-direction: column;
  146. margin-top: 30rpx;
  147. margin-left: 30rpx;
  148. line-height: 60rpx;
  149. color: #444546;
  150. }
  151. .title {
  152. font-size: 36rpx;
  153. margin-left: 30rpx;
  154. color: #282828;
  155. font-weight: 600;
  156. }
  157. .mid {
  158. display: flex;
  159. flex-direction: column;
  160. align-items: center;
  161. margin-top: 36rpx;
  162. }
  163. .tiao {
  164. width: 60px;
  165. height: 3px;
  166. margin-top: 20rpx;
  167. background: #007AFF;
  168. }
  169. .address1 {
  170. float: right;
  171. margin-right: 40rpx;
  172. margin-top: 40rpx;
  173. }
  174. .add1 {
  175. color: #848586;
  176. margin-left: 20rpx;
  177. }
  178. .add {
  179. float: left;
  180. margin-left: 60rpx;
  181. margin-top: 40rpx;
  182. display: flex;
  183. flex-direction: row;
  184. }
  185. .contact1 {
  186. float: right;
  187. margin-right: 40rpx;
  188. margin-top: 40rpx;
  189. }
  190. .con1 {
  191. color: #848586;
  192. margin-left: 20rpx;
  193. padding-top: 20rpx;
  194. }
  195. .con {
  196. float: left;
  197. margin-left: 60rpx;
  198. margin-top: 40rpx;
  199. }
  200. .image2 {
  201. float: left;
  202. width: 36rpx;
  203. height: 36rpx;
  204. }
  205. .image3 {
  206. width: 36rpx;
  207. height: 36rpx;
  208. }
  209. .xiaban {
  210. height: 50rpx;
  211. width: 702rpx;
  212. background-color: white;
  213. margin-left: 24rpx;
  214. border-bottom-left-radius: 10rpx;
  215. border-bottom-right-radius: 10rpx;
  216. }
  217. .head {
  218. height: 420rpx;
  219. background: linear-gradient(180deg, #2A8FFB 0%, #0467FB 100%);
  220. display: flex;
  221. justify-content: center;
  222. }
  223. .image1 {
  224. margin-left: 280rpx;
  225. height: 200rpx;
  226. width: 140rpx;
  227. margin-top: 41rpx;
  228. }
  229. .name {
  230. font-size: 36rpx;
  231. color: white;
  232. margin-top: 20rpx;
  233. margin-bottom: ;
  234. }
  235. .nameImage {
  236. display: flex;
  237. flex-direction: column;
  238. text-align: center;
  239. }
  240. .tianchong {
  241. width: 702rpx;
  242. height: 65rpx;
  243. }
  244. .bottom {
  245. width: 702rpx;
  246. height: 145rpx;
  247. background-color: white;
  248. border-top-left-radius: 10rpx;
  249. border-top-right-radius: 10rpx;
  250. display: flex;
  251. flex-direction: column;
  252. font-size: 26rpx;
  253. }
  254. </style>