device1.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="container">
  3. <i-drawer mode="left" :visible="isShowShopContainer" @close="handleCloseShopContainer">
  4. <view class="shop-container">
  5. <i-collapse name="xxxx" class="xxxxx">
  6. <!-- 最多6层 -->
  7. <i-collapse-item
  8. v-if="userInfo.shop_id"
  9. :title="userInfo.shop_name + '[' + userInfo.own_device_cnt + '/' + userInfo.all_device_cnt + ']'"
  10. i-class-title="collapse-item-title"
  11. @tap.native.stop.prevent="bindClickMainShop"
  12. >
  13. <view slot="content">
  14. <i-collapse-item
  15. @tap.native.stop.prevent="loadFirstChildren"
  16. :data-parentid="item1.shop_id"
  17. :data-index="index1 + ',' + ',' + ',' + ',' + ','"
  18. :title="item1.shop_name + '[' + item1.own_device_cnt + '/' + item1.all_device_cnt + ']'"
  19. i-class-title="collapse-item-title"
  20. v-for="(item1, index1) in shopChildrenList"
  21. :key="index1"
  22. >
  23. <view slot="content">
  24. <i-collapse-item
  25. @tap.native.stop.prevent="loadFirstChildren"
  26. :data-parentid="item2.shop_id"
  27. :data-index="index1 + ',' + index2 + ',' + ',' + ',' + ','"
  28. :title="item2.shop_name + '[' + item2.own_device_cnt + '/' + item2.all_device_cnt + ']'"
  29. i-class-title="collapse-item-title"
  30. v-for="(item2, index2) in item1.childrenList"
  31. :key="index2"
  32. >
  33. <view slot="content">
  34. <i-collapse-item
  35. @tap.native.stop.prevent="loadFirstChildren"
  36. :data-parentid="item3.shop_id"
  37. :data-index="index1 + ',' + index2 + ',' + index3 + ',' + ',' + ','"
  38. :title="item3.shop_name + '[' + item3.own_device_cnt + '/' + item3.all_device_cnt + ']'"
  39. i-class-title="collapse-item-title"
  40. v-for="(item3, index3) in item2.childrenList"
  41. :key="index3"
  42. >
  43. <view slot="content">
  44. <i-collapse-item
  45. @tap.native.stop.prevent="loadFirstChildren"
  46. :data-parentid="item4.shop_id"
  47. :data-index="index1 + ',' + index2 + ',' + index3 + ',' + index4 + ',' + ','"
  48. :title="item4.shop_name + '[' + item4.own_device_cnt + '/' + item4.all_device_cnt + ']'"
  49. i-class-title="collapse-item-title"
  50. v-for="(item4, index4) in item3.childrenList"
  51. :key="index4"
  52. >
  53. <view slot="content">
  54. <i-collapse-item
  55. @tap.native.stop.prevent="loadFirstChildren"
  56. :data-parentid="item5.shop_id"
  57. :data-index="index1 + ',' + index2 + ',' + index3 + ',' + index4 + ',' + index5 + ','"
  58. :title="item5.shop_name + '[' + item5.own_device_cnt + '/' + item5.all_device_cnt + ']'"
  59. i-class-title="collapse-item-title"
  60. v-for="(item5, index5) in item4.childrenList"
  61. :key="index5"
  62. >
  63. <view slot="content"></view>
  64. </i-collapse-item>
  65. </view>
  66. </i-collapse-item>
  67. </view>
  68. </i-collapse-item>
  69. </view>
  70. </i-collapse-item>
  71. </view>
  72. </i-collapse-item>
  73. </view>
  74. </i-collapse-item>
  75. </i-collapse>
  76. </view>
  77. </i-drawer>
  78. <view class="device-container">
  79. <view class="device-search-container"></view>
  80. <view class="device-pannel">
  81. <view class="list-group">
  82. <view class="list-item" @tap="bindTest" v-for="(item, index) in deviceList" :key="index">
  83. <view class="list-item-head flex-row flex-between">
  84. <view class="flex-row flex-start">
  85. <image class="car-icon" :src="iconList[item.car_icon].product"></image>
  86. <text>{{ item.battery_sn }}</text>
  87. <text v-if="item.user_id != 0" class="i-tag i-tag-red">已租</text>
  88. <text v-else class="i-tag i-tag-green">未租</text>
  89. </view>
  90. <view class="order-status">
  91. <text class="i-status shop-name">{{ item.shop_name }}</text>
  92. </view>
  93. </view>
  94. <view class="list-item-body">
  95. <view class="form-item flex-row flex-between">
  96. <view class="form-label">型号</view>
  97. <view class="form-value">{{ item.battery_type_id }}</view>
  98. </view>
  99. <view class="form-item flex-row flex-between">
  100. <view class="form-label">单价</view>
  101. <view class="form-value">
  102. <text>{{ item.hire_price }}元/</text>
  103. <text v-if="item.hire_duration_unit == 1">天</text>
  104. <text v-else-if="item.hire_duration_unit == 2">月</text>
  105. <text v-else-if="item.hire_duration_unit == 3">年</text>
  106. </view>
  107. </view>
  108. <view class="form-item flex-row flex-between">
  109. <view class="form-label">押金</view>
  110. <view class="form-value">{{ item.pledge_money }}</view>
  111. </view>
  112. <view class="form-item flex-row flex-between">
  113. <view class="form-label">租赁用户</view>
  114. <view class="form-value">{{ item.user_name }} {{ item.phone }}</view>
  115. </view>
  116. <view class="form-item flex-row flex-between">
  117. <view class="form-label">起租时间</view>
  118. <view class="form-value">{{ item.hire_time }}</view>
  119. </view>
  120. <view class="form-item flex-row flex-between">
  121. <view class="form-label">租赁时长</view>
  122. <view class="form-value">
  123. <text>{{ item.chire_duration }}</text>
  124. <text>天</text>
  125. </view>
  126. </view>
  127. <view class="form-item flex-row flex-between">
  128. <view class="form-label">到期时间</view>
  129. <view class="form-value">{{ item.hire_expire_time }}</view>
  130. </view>
  131. <view class="form-item flex-row flex-between">
  132. <view class="form-label">备注</view>
  133. <view class="form-value">{{ item.remark }}</view>
  134. </view>
  135. </view>
  136. <view v-if="item.pay_type == 1 && item.status == 0" class="list-item-footer flex-row flex-end">
  137. <view class="op-btn" @tap="bindCheckPay" :data-ordersn="item.order_sn" :data-idx="index">确认支付</view>
  138. </view>
  139. </view>
  140. <view class="battery-item" v-for="(item, index) in deviceList" :key="index">
  141. <view class="batter-info-group flex-row flex-between">
  142. <view class="battery-icon">
  143. <image class="battery-icon-img" :src="item.iconProduct"></image>
  144. </view>
  145. <view class="battery-info flex-row flex-between">
  146. <view class="no-class" @tap="bindTapToMap" :data-macid="item.macid">
  147. <view class="battery-name">{{ item.dev_name }}</view>
  148. <view class="battery-macid">IMEI:{{ item.macid }}</view>
  149. <view class="battery-macid">
  150. <view class="flex-row">
  151. <view class="flex-row" style="color: rgb(64, 187, 85)">{{ item.voltage }} V</view>
  152. <view class="flex-row" style="margin-left: 8px">里程: {{ item.mil }} 公里</view>
  153. <view class="flex-row" style="margin-left: 8px">{{ item.su }}km/h</view>
  154. </view>
  155. </view>
  156. <view class="battery-com"></view>
  157. </view>
  158. <form :report-submit="true" @submit="toRenew" :data-macid="item.macid">
  159. <button class="no-class no-btn" form-type="submit">
  160. <view v-if="item.surplus_days >= 0" class="b-day">剩余{{ item.surplus_days }}天</view>
  161. <view v-else class="b-day">已过期{{ item.surplus_days * -1 }}天</view>
  162. <view v-if="item.surplus_days > 5" class="b-status">使用正常</view>
  163. <view v-else class="b-status b-status-xf">立即续费</view>
  164. </button>
  165. </form>
  166. </view>
  167. </view>
  168. <view class="op-group flex-row flex-around">
  169. <picker mode="date" :value="date" :end="curDate" @change="bindDateChange" :data-macid="item.macid">
  170. <view class="op-item flex-row flex-start">
  171. <view>
  172. <image class="op-icon" src="/static/resource/images/g-j.png"></image>
  173. </view>
  174. <view class="op-des">轨迹</view>
  175. </view>
  176. </picker>
  177. <form :report-submit="true" @submit="navToPage" :data-url="'/pages/warnList/warnList?macid=' + item.macid">
  178. <view class="op-item flex-row flex-start">
  179. <view>
  180. <image class="op-icon" src="/static/resource/images/b-j.png"></image>
  181. </view>
  182. <!-- <view class="op-des">报警</view> -->
  183. <button class="op-des no-btn" form-type="submit">报警</button>
  184. </view>
  185. </form>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="show-shop-btn" @tap="handleShowShopContainer">→</view>
  192. <!-- <movable-area class="mov-area">
  193. <movable-view style="height: 50px; width: 50px; background: #2d8cf0;z-index: 20" direction="all"></movable-view>
  194. </movable-area> -->
  195. </view>
  196. </template>
  197. <style>
  198. @import './device1.css';
  199. </style>