customer-management.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">客户管理</text>
  6. </view>
  7. </view>
  8. <view class="t-btn">+添加客户</view>
  9. <u-sticky offset-top="-90">
  10. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  11. </u-sticky>
  12. <view class="card-box">
  13. <view class="card" v-for="(customerItem,index) in customerItemList" :key="index">
  14. <view class="t">
  15. <image class="icon" src="../../static/home-icon-01.png"></image>
  16. <text class="title">{{customerItem.companyName}}</text>
  17. </view>
  18. <view class="c">
  19. <view class="item">
  20. <text class="p1">联系人:</text>
  21. <text class="p2">{{customerItem.user}}</text>
  22. </view>
  23. <view class="item">
  24. <text class="p1">联系电话:</text>
  25. <text class="p2">{{customerItem.phone}}</text>
  26. </view>
  27. <view class="item">
  28. <text class="p1">营业执照:</text>
  29. <text class="p2">{{customerItem.license}}</text>
  30. </view>
  31. <view class="item">
  32. <text class="p1">状态:</text>
  33. <text class="p2">{{customerItem.state}}</text>
  34. </view>
  35. </view>
  36. <view class="b">
  37. <view class="btn b1" v-if="customerItem.btnShow==1" @click="sh(index)">审核</view>
  38. </view>
  39. </view>
  40. </view>
  41. <u-loadmore style="margin: 30rpx;" :status="status"/>
  42. <uni-popup ref="shpopup" type="dialog">
  43. <uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
  44. </uni-popup>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. current:0,
  52. status: 'loadmore',
  53. page: 0,
  54. tabs: [
  55. {
  56. name: '全部',
  57. },
  58. {
  59. name: '未审核',
  60. },
  61. {
  62. name: '审核通过',
  63. },
  64. {
  65. name: '禁用',
  66. }
  67. ],
  68. customerItemList:[
  69. {
  70. companyName:'广西医科大一附院',
  71. user:'张三',
  72. phone:'18888888888',
  73. license:'有',
  74. state:'未审核',
  75. btnShow:1
  76. },
  77. {
  78. companyName:'广西医科大一附院',
  79. user:'张三',
  80. phone:'18888888888',
  81. license:'有',
  82. state:'审核通过',
  83. btnShow:0
  84. },
  85. {
  86. companyName:'广西医科大一附院',
  87. user:'张三',
  88. phone:'18888888888',
  89. license:'有',
  90. state:'禁用',
  91. btnShow:0
  92. },
  93. {
  94. companyName:'广西医科大一附院',
  95. user:'张三',
  96. phone:'18888888888',
  97. license:'有',
  98. state:'禁用',
  99. btnShow:0
  100. }
  101. ]
  102. }
  103. },
  104. methods: {
  105. //点击上方切换栏,根据点击项重新加载数据
  106. change(index) {
  107. this.current = index;
  108. if(index==0){
  109. //加载全部
  110. }
  111. if(index==1){
  112. //加载未审核
  113. }
  114. if(index==2){
  115. //只加载审核通过
  116. }
  117. if(index==3){
  118. //只加载禁用
  119. }
  120. },
  121. //点击按钮
  122. //------------------------------------------
  123. sh(){
  124. this.$refs.shpopup.open('center')
  125. },
  126. shconfirm(index) {
  127. console.log('审核')
  128. this.$refs.shpopup.close()
  129. },
  130. //------------------------------------------
  131. //上拉加载更多,分页模拟数据
  132. onReachBottom() {
  133. if(this.page >= 3) return ;
  134. this.status = 'loading';
  135. this.page = ++ this.page;
  136. setTimeout(() => {
  137. this.customerItemList += 5;//接接口后把数据加上,懒得写假数据了
  138. if(this.page >= 3) this.status = 'nomore';
  139. else this.status = 'loading';
  140. }, 2000)
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. .card-box{
  147. display: flex;
  148. width: 100%;
  149. flex-direction: column;
  150. .card{
  151. background-color: #fff;
  152. border-radius: 20rpx;
  153. margin: 20rpx 20rpx 0 20rpx;
  154. padding: 30rpx;
  155. box-sizing: border-box;
  156. display: flex;
  157. flex-direction: column;
  158. .t{
  159. width: 100%;
  160. display: flex;
  161. align-items: center;
  162. padding-bottom: 30rpx;
  163. border-bottom: 1rpx solid #f5f5f5;
  164. .icon{
  165. width: 40rpx;
  166. height: 40rpx;
  167. }
  168. .title{
  169. font-size: 30rpx;
  170. font-weight: bold;
  171. margin-left: 20rpx;
  172. }
  173. }
  174. .c{
  175. padding:15rpx 0 30rpx 0;
  176. display: flex;
  177. flex-wrap: wrap;
  178. border-bottom: 1rpx solid #f5f5f5;
  179. .item{
  180. width: 50%;
  181. padding: 20rpx 0;
  182. display: flex;
  183. .car-num{
  184. background-color: #edf6ff;
  185. color: #0080ff;
  186. font-size: 44rpx;
  187. padding: 15rpx 0;
  188. text-align: center;
  189. width: 100%;
  190. border-radius: 10rpx;
  191. font-weight: bold;
  192. letter-spacing: 20rpx;
  193. }
  194. .p1{
  195. font-size: 28rpx;
  196. color: #999;
  197. flex: 5;
  198. }
  199. .p2{
  200. font-size: 28rpx;
  201. color: #191919;
  202. font-weight: bold;
  203. margin-left: 20rpx;
  204. flex: 7;
  205. }
  206. }
  207. .car-num-item{
  208. width: 100%;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. }
  214. .b{
  215. display: flex;
  216. width: 100%;
  217. align-items: center;
  218. justify-content: space-between;
  219. .btn{
  220. height: 70rpx;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. //width: calc(50% - 15rpx);
  225. width: 100%;
  226. margin: 30rpx 0 0 0;
  227. border-radius: 10rpx;
  228. border-width: 1rpx;
  229. box-sizing: border-box;
  230. }
  231. .b1{
  232. background-color: #0080ff;
  233. color: #fff;
  234. }
  235. .b2{
  236. background-color: #f7f7f7;
  237. color: #191919;
  238. }
  239. .b3{
  240. background-color: #fff;
  241. color: #0080ff;
  242. border: 1rpx solid #0080ff;
  243. }
  244. }
  245. }
  246. }
  247. .t-btn{
  248. width: 400rpx;
  249. margin: 0 auto 80rpx auto;
  250. height: 88rpx;
  251. font-weight: bold;
  252. display: flex;
  253. align-items: center;
  254. justify-content: center;
  255. border-radius: 10rpx;
  256. color: #191919;
  257. font-size: 28rpx;
  258. background-color: #fff;
  259. border: 1px solid #eee;
  260. }
  261. @import '@/common/common.scss'
  262. </style>