VisitLogs.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view>
  3. <view class="keyword-view clearfix">
  4. <u-search
  5. disabled
  6. @custom="clearValue"
  7. @search="searchConfirm()"
  8. action-text="重置"
  9. :clearabled="true"
  10. placeholder="请选择客户"
  11. v-model="customer_name"
  12. @click="goPage('/pagesT/customer/selCustomer')"
  13. ></u-search>
  14. </view>
  15. <view class="logs-ul">
  16. <view class="look-li" v-for="(item, index) in order_list" :key="index">
  17. <view class="goods-name">{{ item.goodsName }}</view>
  18. <view class="other-info clearfix">
  19. <view class="float_left"><text class="label">客户</text>{{ item.customerName }}</view>
  20. <view class="float_right" @click="callPhone(item.mobile)"><u-icon name="ziyuan" custom-prefix="custom-icon" :label="item.mobile" label-color="#4076D6"></u-icon></view>
  21. </view>
  22. <view class="other-info">
  23. <text class="label">时间</text>
  24. {{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}
  25. </view>
  26. </view>
  27. <!-- <view class="logs-li clearfix" v-for="(item, index) in order_list" :key="index">
  28. <view class="clearfix logs-goods">
  29. <view class="float_left goods-img">
  30. <image src="../../static/Tar_bar_slices/goods-fill.png" mode="aspectFill"></image>
  31. </view>
  32. <view class="float_left goods-info">
  33. <view class="goods-name ellipsis">{{ item.goodsName }}</view>
  34. <view class="other-info">
  35. <view class="info-li">购买价格:89</view>
  36. <view class="info-li">购买数量:51</view>
  37. </view>
  38. <view class="look-time-out clearfix">
  39. <view class="price float_left">¥117</view>
  40. <view class="look-time float_right">
  41. <view class="triangle"><text>浏览</text></view>
  42. <view class="second">21s</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="bottom clearfix">
  48. <view class="float_left">
  49. <view class="cutomer ellipsis">{{ item.customerName }}</view>
  50. <view class="date">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  51. </view>
  52. <view class="float_right">
  53. <view class="btn-li">查看订单</view>
  54. <view class="btn-li">联系客户</view>
  55. </view>
  56. </view>
  57. </view> -->
  58. <u-loadmore :status="load_status" />
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. load_status: 'nomore',
  67. page: 1,
  68. pageSize: 10,
  69. total: 0,
  70. order_list: [],
  71. keyword: '',
  72. customerData: '',
  73. customer_name: '',
  74. customer_id: ''
  75. };
  76. },
  77. watch: {
  78. customerData(val) {
  79. if (val) {
  80. this.customer_name = val.name;
  81. this.customer_id = val.id;
  82. this.page = 1;
  83. this.getAllCustomerVisitsLog();
  84. }
  85. }
  86. },
  87. onLoad() {
  88. this.getAllCustomerVisitsLog();
  89. },
  90. onPullDownRefresh() {
  91. this.page = 1;
  92. this.getAllCustomerVisitsLog();
  93. },
  94. onReachBottom() {
  95. if (this.total / this.pageSize > this.page) {
  96. this.page += 1;
  97. this.getAllCustomerVisitsLog();
  98. }
  99. },
  100. methods: {
  101. clearValue() {
  102. this.customer_name = '';
  103. this.customer_id = 0;
  104. this.page = 1;
  105. this.getAllCustomerVisitsLog();
  106. },
  107. searchConfirm() {
  108. this.page = 1;
  109. this.getAllCustomerVisitsLog();
  110. },
  111. getAllCustomerVisitsLog() {
  112. let params = {
  113. page: this.page,
  114. pageSize: this.pageSize,
  115. customerId: this.customer_id
  116. };
  117. this.load_status = 'loading';
  118. this.$u.api.getAllCustomerVisitsLog(params).then(res => {
  119. if (this.page === 1) {
  120. this.order_list = res.data;
  121. } else {
  122. this.order_list = this.order_list.concat(res.data);
  123. }
  124. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  125. this.total = res.pageTotal;
  126. // console.log(this.order_list);
  127. });
  128. }
  129. }
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .keyword-view {
  134. position: fixed;
  135. width: 100%;
  136. top: 0;
  137. left: 0;
  138. padding: 20rpx 24rpx;
  139. background-color: #ffffff;
  140. z-index: 9;
  141. .float_left {
  142. width: 640rpx;
  143. }
  144. .float_right {
  145. line-height: 64rpx;
  146. width: 50rpx;
  147. text-align: center;
  148. color: #666666;
  149. }
  150. }
  151. .logs-ul {
  152. padding-top: 100rpx;
  153. .logs-li {
  154. width: 710rpx;
  155. margin: 20rpx auto;
  156. background-color: #ffffff;
  157. border-radius: 20rpx;
  158. padding: 24rpx;
  159. .goods-img {
  160. position: relative;
  161. width: 120rpx;
  162. height: 120rpx;
  163. border-radius: 20rpx;
  164. overflow: hidden;
  165. margin-right: 20rpx;
  166. border: 1px solid #f5f5f5;
  167. image {
  168. width: 100%;
  169. height: 100%;
  170. display: block;
  171. }
  172. .buy-status {
  173. position: absolute;
  174. line-height: 30rpx;
  175. height: 30rpx;
  176. font-size: 20rpx;
  177. text-align: center;
  178. width: 100%;
  179. left: 0;
  180. bottom: 0;
  181. background-color: $uni-color-success;
  182. color: #ffffff;
  183. &.no-buy {
  184. background-color: $uni-color-error;
  185. }
  186. }
  187. }
  188. .goods-info {
  189. width: 520rpx;
  190. position: relative;
  191. .goods-name {
  192. font-weight: bold;
  193. }
  194. .date-time {
  195. font-size: 22rpx;
  196. }
  197. .other-info {
  198. padding-top: 10rpx;
  199. display: flex;
  200. flex-wrap: wrap;
  201. font-size: 22rpx;
  202. .info-li {
  203. width: 50%;
  204. display: inline-block;
  205. color: #6c6c6c;
  206. }
  207. }
  208. }
  209. .look-time-out {
  210. .price {
  211. color: $uni-color-error;
  212. }
  213. .look-time {
  214. color: #ffffff;
  215. font-size: 18rpx;
  216. width: 150rpx;
  217. height: 40rpx;
  218. line-height: 40rpx;
  219. overflow: hidden;
  220. background-color: $uni-color-warning;
  221. position: relative;
  222. border-radius: 6rpx;
  223. .triangle {
  224. text-align: center;
  225. position: absolute;
  226. width: 76rpx;
  227. height: 0;
  228. border-bottom: 40rpx solid #000000;
  229. border-left: 10px solid transparent;
  230. -webkit-transform: rotate(180deg);
  231. transform: rotate(180deg);
  232. text {
  233. display: block;
  234. transform: rotate(180deg);
  235. }
  236. }
  237. .second {
  238. font-size: 22rpx;
  239. position: absolute;
  240. right: 0;
  241. width: 74rpx;
  242. height: 40rpx;
  243. text-align: center;
  244. top: 50%;
  245. transform: translateY(-50%);
  246. }
  247. }
  248. }
  249. }
  250. .bottom {
  251. padding-top: 24rpx;
  252. border-top: 1px solid #eeeeee;
  253. margin-top: 24rpx;
  254. .float_left {
  255. width: 320rpx;
  256. .cutomer {
  257. font-weight: bold;
  258. font-size: 26rpx;
  259. padding-bottom: 6rpx;
  260. }
  261. .date {
  262. font-size: 22rpx;
  263. color: #666666;
  264. }
  265. }
  266. .float_right {
  267. .btn-li {
  268. display: inline-block;
  269. border-radius: 10rpx;
  270. margin-left: 16rpx;
  271. width: 140rpx;
  272. line-height: 54rpx;
  273. font-size: 24rpx;
  274. text-align: center;
  275. border: 1px solid $uni-color-primary;
  276. color: $uni-color-primary;
  277. &:last-child {
  278. background-color: $uni-color-primary;
  279. color: #ffffff;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. .look-li {
  286. width: 710rpx;
  287. margin: 24rpx auto;
  288. background-color: #ffffff;
  289. padding: 24rpx;
  290. border-radius: 8rpx;
  291. .goods-name {
  292. color: #2d405e;
  293. font-weight: 600;
  294. font-size: 30rpx;
  295. padding-bottom: 20rpx;
  296. }
  297. .other-info {
  298. line-height: 40rpx;
  299. margin-top: 10rpx;
  300. .label {
  301. width: 82rpx;
  302. font-weight: 400;
  303. color: #b8c0c8;
  304. margin-right: 30rpx;
  305. }
  306. }
  307. }
  308. </style>