addressBook.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="container">
  3. <!-- 搜索框区域 -->
  4. <view class="search">
  5. <img src="../../static/images/repairsImg/search.png" />
  6. <input type="text" placeholder="请输入搜索内容" />
  7. </view>
  8. <view class="title">外部维修成员({{ list.length }})</view>
  9. <!-- 每一个外部维修成员区域 -->
  10. <view class="box" v-for="item in list" :key="item.id" @click="handleEdit(item)">
  11. <img src="../../static/images/repairsImg/photo.png" />
  12. <view class="item_info">
  13. <view class="info_msg">
  14. {{ item.name }}
  15. <view class="msg_work">{{ item.work }}</view>
  16. </view>
  17. <view class="info_phone">{{ item.phone }}</view>
  18. </view>
  19. <view class="item_type color_type" v-if="item.type === 1">接单中</view>
  20. <view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
  21. <view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
  22. </view>
  23. <view class="title">内部维修成员({{ list2.length }})</view>
  24. <!-- 每一个内部维修成员区域 -->
  25. <view class="box" v-for="item in list2" :key="item.id" @click="handleEdit(item)">
  26. <img src="../../static/images/repairsImg/photo.png" />
  27. <view class="item_info">
  28. <view class="info_msg">
  29. {{ item.name }}
  30. <view class="msg_work">{{ item.work }}</view>
  31. </view>
  32. <view class="info_phone">{{ item.phone }}</view>
  33. </view>
  34. <view class="item_type color_type" v-if="item.type === 1">接单中</view>
  35. <view class="item_type color_type2" v-if="item.type === 2">订单饱和</view>
  36. <view class="item_type color_type3" v-if="item.type === 3">停止接单</view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. list: [
  45. {
  46. id: 1,
  47. name: '张三',
  48. phone: '13659856958',
  49. type: 1,
  50. work: '电工'
  51. },
  52. {
  53. id: 2,
  54. name: '李四',
  55. phone: '13659856958',
  56. type: 2,
  57. work: '电工'
  58. },
  59. {
  60. id: 3,
  61. name: '张三',
  62. phone: '13659856958',
  63. type: 3,
  64. work: '电工'
  65. },
  66. {
  67. id: 4,
  68. name: '张三',
  69. phone: '13659856958',
  70. type: 1,
  71. work: '电工'
  72. },
  73. {
  74. id: 5,
  75. name: '李四',
  76. phone: '13659856958',
  77. type: 1,
  78. work: '电工'
  79. },
  80. {
  81. id: 6,
  82. name: '张三',
  83. phone: '13659856958',
  84. type: 1,
  85. work: '电工'
  86. }
  87. ],
  88. list2: [
  89. {
  90. id: 1,
  91. name: '张三',
  92. phone: '13659856958',
  93. type: 1,
  94. work: '电工'
  95. },
  96. {
  97. id: 2,
  98. name: '李四',
  99. phone: '13659856958',
  100. type: 3,
  101. work: '电工'
  102. },
  103. {
  104. id: 3,
  105. name: '张三',
  106. phone: '13659856958',
  107. type: 2,
  108. work: '电工'
  109. },
  110. {
  111. id: 4,
  112. name: '张三',
  113. phone: '13659856958',
  114. type: 1,
  115. work: '电工'
  116. }
  117. ]
  118. }
  119. },
  120. mounted() {
  121. console.log('通讯录页面加载')
  122. },
  123. methods: {
  124. handleEdit(item) {
  125. // console.log(item.id)
  126. uni.showActionSheet({
  127. itemList: ['编辑', '删除'],
  128. success: (res) => {
  129. if (res.tapIndex === 0) {
  130. uni.navigateTo({
  131. url: '/pagesRepairs/edit/edit'
  132. })
  133. } else if (res.tapIndex === 1) {
  134. uni.showModal({
  135. title: '提示',
  136. content: `确定删除${item.name}吗?`,
  137. success: (res) => {
  138. if (res.confirm) {
  139. uni.showToast({
  140. title: '删除成功',
  141. icon: 'success'
  142. })
  143. }
  144. }
  145. })
  146. }
  147. },
  148. fail: (res) => {}
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .container {
  156. width: 100vw;
  157. height: calc(100vh - 152rpx);
  158. overflow-y: auto;
  159. .search {
  160. display: flex;
  161. align-items: center;
  162. margin: 30rpx auto 30rpx;
  163. width: 690rpx;
  164. height: 80rpx;
  165. border-radius: 4rpx;
  166. background-color: #f2f2f2;
  167. img {
  168. margin: 0 20rpx;
  169. width: 40rpx;
  170. height: 40rpx;
  171. }
  172. input {
  173. flex: 1;
  174. padding: 10rpx;
  175. }
  176. }
  177. .title {
  178. display: flex;
  179. align-items: flex-end;
  180. box-sizing: border-box;
  181. padding: 0 30rpx;
  182. height: 80rpx;
  183. font-size: 36rpx;
  184. font-weight: bold;
  185. border-top: 1rpx solid #e5e5e5;
  186. }
  187. .box {
  188. display: flex;
  189. align-items: center;
  190. padding-right: 30rpx;
  191. height: 160rpx;
  192. border-bottom: 1rpx solid #e5e5e5;
  193. img {
  194. margin: 0 24rpx 0 27rpx;
  195. width: 82rpx;
  196. height: 82rpx;
  197. border-radius: 50%;
  198. }
  199. .item_info {
  200. display: flex;
  201. flex-direction: column;
  202. .info_msg {
  203. display: flex;
  204. align-items: center;
  205. font-size: 32rpx;
  206. font-weight: bold;
  207. .msg_work {
  208. display: flex;
  209. justify-content: center;
  210. align-items: center;
  211. margin-left: 13rpx;
  212. padding: 0 10rpx;
  213. height: 32rpx;
  214. color: #6fb6b8;
  215. font-size: 24rpx;
  216. font-weight: 400;
  217. border-radius: 7rpx;
  218. border: 1rpx solid #6fb6b8;
  219. }
  220. }
  221. .info_phone {
  222. margin-top: 10rpx;
  223. color: #808080;
  224. font-size: 28rpx;
  225. }
  226. }
  227. .item_type {
  228. margin-left: auto;
  229. font-size: 24rpx;
  230. }
  231. .color_type {
  232. color: #6fb6b8;
  233. }
  234. .color_type2 {
  235. color: #1e7dfb;
  236. }
  237. .color_type3 {
  238. color: #ff5733;
  239. }
  240. }
  241. }
  242. </style>