index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="zxbox">
  3. <view class="zxtop">
  4. <view class="navbox">
  5. <uni-nav-bar color="#ffffff" leftWidth='110rpx' rightWidth="48rpx" :background-color="backgroundColor" :border="false" statusBar='true'>
  6. <block slot="left">
  7. <view class="topl flexc">
  8. <view class="over">客户</view>
  9. </view>
  10. </block>
  11. <view class="topc flexc">
  12. <image :src="secimg"></image>
  13. <input placeholder="输入关键字进行查询" confirm-type="search" v-model="usename" @confirm="getConfirm"/>
  14. </view>
  15. <block slot="right">
  16. <view class="topr" @click='getNoticeFn'>
  17. <image :src="noticeimg"></image>
  18. <view class="cir">99+</view>
  19. <!-- <block v-if="noticenum>99">99+</block>
  20. <block v-else>{{noticenum}}</block> -->
  21. </view>
  22. </block>
  23. </uni-nav-bar>
  24. </view>
  25. <image :src="bgimg" class="bgimg"></image>
  26. <view class="zxmain" :style="'margin-top:-'+marTop+'rpx;'">
  27. <!-- list -->
  28. <bus-list :datalist="list" :wtdt="wtdt" :type="type" @getDetail="getDetail"></bus-list>
  29. </view>
  30. </view>
  31. <footers v-if="isfootflag" :footerindex="footerindex" :isHomeIndex="true"></footers>
  32. </view>
  33. </template>
  34. <script>
  35. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  36. let { calendar } = require("@/components/lunc-calendar/calendar.js");
  37. // import {getReservatcountl,getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
  38. import {getDictionaryFn} from "@/api/mine/register.js"
  39. import busList from "@/work/components/business/list.vue"
  40. import footers from '@/components/footer/footer.vue'
  41. export default {
  42. components:{footers,busList},
  43. data(){
  44. return{
  45. footerindex:'custom',
  46. isfootflag:true,
  47. backgroundColor:'transparent',
  48. bgimg:require("@/static/images/bg.png"),
  49. noticeimg:require("@/static/images/home/notice.png"),
  50. secimg:require("@/static/images/home/search.png"),
  51. list:[{tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},{tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},
  52. {tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},{tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},
  53. {tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},{tit:'【申报审核】— 潜山弘立新型建材有限公司…',time:'04-07'},
  54. ],
  55. pageSize: 10,
  56. pageNum: 1,
  57. reachflag: true,
  58. wtdt:'加载更多',
  59. nvaHeight:44,
  60. marTop:0,//距离顶部的距离
  61. stubarHeight:0,//
  62. scroflag:false,
  63. type:'custom',
  64. usename:'',
  65. }
  66. },
  67. onPageScroll(e) {
  68. var scrollTop = Number(e.scrollTop);
  69. // var listTop=Number(this.listTop)-Number(this.nvaHeight)
  70. if (scrollTop <=this.nvaHeight) {
  71. const opacity = scrollTop / 100 // 计算透明度值
  72. const color = `rgba(4, 145, 253, ${opacity})`
  73. this.backgroundColor = color // 更新盒子背景颜色
  74. } else {
  75. this.backgroundColor = '#00A9F0'
  76. }
  77. },
  78. onLoad: function() {
  79. // uni.$on('refreshdatalist',(e) => {
  80. // this.reachflag=false;
  81. // this.pageNum=1;
  82. // this.list=[];
  83. // this.getDataFn();
  84. // })
  85. // this.init()
  86. // this.getDataFn()
  87. uni.getSystemInfo({
  88. success: (e) => {
  89. this.stubarHeight=Number(e.statusBarHeight);
  90. this.nvaHeight = Number(e.statusBarHeight)+44;
  91. }
  92. })
  93. },
  94. onUnload() {
  95. uni.$off('refreshdatalist')
  96. },
  97. onShow() {
  98. // var that=this;
  99. // this.time();
  100. },
  101. mounted() {
  102. this.getHeightFn()
  103. },
  104. // 上拉触底加载更多触发事件
  105. onReachBottom() {
  106. // if (this.reachflag) {
  107. // this.pageNum++
  108. // this.getDataFn()
  109. // }
  110. },
  111. methods:{
  112. checkPermi, checkRole,
  113. getConfirm(){
  114. // this.$tab.navigateTo("/pages/order/list")
  115. // this.init()
  116. },
  117. getNoticeFn(){
  118. this.$tab.navigateTo("/pages/index/notice")
  119. },
  120. getrefreshData(){
  121. // this.pageNum=1;
  122. // this.list=[];
  123. // this.reachflag=true;
  124. // this.getDataFn()
  125. },
  126. getHeightFn(){
  127. let query = uni.createSelectorQuery().in(this);
  128. //需要给黄色区域设置一个id标识,在这里是demo
  129. query.select('.navbox').boundingClientRect(data => {
  130. var top=data.top<0 ? -data.top : data.top;
  131. var stubarHeight=Number(this.stubarHeight);
  132. this.marTop =stubarHeight > 0?420 - Number(data.height)*2 : 420 - Number(data.height)*2 + 40 //赋值,待会要用
  133. if (top <=this.nvaHeight) {
  134. const opacity = top / 100 // 计算透明度值
  135. const color = `rgba(4, 145, 253, ${opacity})`
  136. this.backgroundColor = color // 更新盒子背景颜色
  137. } else {
  138. this.backgroundColor = '#00A9F0'
  139. }
  140. }).exec();
  141. },
  142. init(){
  143. // 记录来源
  144. getDictionaryFn('jluly').then(res=>{
  145. if(res.code==200){
  146. this.adrlist = res.data.map(v => {
  147. return {
  148. dictLabel: v.dictLabel,
  149. dictValue: Number(v.dictValue)
  150. }
  151. })
  152. }
  153. })
  154. },
  155. getDetail(){
  156. this.$tab.navigateTo("/work/pages/custom/details")
  157. },
  158. getDataFn(){
  159. var params={
  160. pageSize:this.pageSize,
  161. pageNum: this.pageNum,
  162. // visitType:3
  163. }
  164. getReservatList(params).then(res=>{
  165. if(res.code==200){
  166. if (res.rows.length < this.pageSize) {
  167. this.reachflag = false
  168. this.wtdt = '到底了~';
  169. } else {
  170. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  171. if (num < res.total) {
  172. this.reachflag = true
  173. this.wtdt = '上拉加载更多'
  174. } else {
  175. this.reachflag = false
  176. this.wtdt = '到底了~';
  177. }
  178. }
  179. if (this.pageNum == 1) {
  180. this.list = res.rows;
  181. } else {
  182. this.list = this.list.concat(res.rows)
  183. }
  184. }else{
  185. this.$toast(res.msg)
  186. }
  187. })
  188. },
  189. },
  190. }
  191. </script>
  192. <style lang="scss" scoped>
  193. page{background-color: #f6f6f6;}
  194. .navbox /deep/ .uni-navbar__header-container {align-items: center;padding-left: 0;}
  195. .navbox /deep/ uni-picker{flex: 1;}
  196. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4;
  197. .topl{padding-left: 16rpx;overflow: hidden;
  198. image{width: 30rpx;height: 38rpx;margin-right: 18rpx;flex: 0 0 auto;}
  199. view{font-weight: bold;font-size: 30rpx;color: #FFFFFF;}
  200. }
  201. .topc{border-radius: 34rpx;height:68rpx;box-sizing: border-box;padding:0 32rpx 0 32rpx ;position: relative;flex:1;background-color: #FFFFFF;
  202. input{font-weight: 500;font-size: 26rpx;color: #222327;}
  203. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  204. }
  205. .topr{width: 48rpx;height: 38rpx;position: relative;margin-right: 10rpx;
  206. image{width: 32rpx;height: 38rpx;margin: 0 auto;}
  207. .cir{background: #FF4747;font-size: 14rpx;color: #FFFFFF;border-radius: 50%;border: 2rpx solid #FFFFFF;min-width: 20rpx;height: 20rpx;
  208. position: absolute;right: -5rpx;top: -5rpx;text-align: center;line-height: 16rpx;
  209. }
  210. // .cir{width: 14rpx;height: 14rpx;background: #DF0024;border-radius: 50%;position: absolute;right: -7rpx;top: -7rpx;}
  211. }
  212. }
  213. .zxbox{
  214. .bgimg{width: 100%;height: 420rpx;}
  215. .zxmain{position: relative;padding: 48rpx 36rpx 0;
  216. }
  217. }
  218. </style>