index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view class="content">
  3. <view class="content-top">
  4. <view class="top-banner">
  5. <u-swiper :list="bannerList" class="banner"></u-swiper>
  6. </view>
  7. </view>
  8. <view class="content-bottom">
  9. <!-- 预约 -->
  10. <u-button :custom-style="yuYueBtn" :hair-line="false" @click="gotoYueYu">一键预约</u-button>
  11. <!-- 接单信息 -->
  12. <view class="bottom-new-notice">
  13. <view class="notice-content">
  14. <view class="notice-content-item"><span class="t-icon t-icon-home_icon_bells"></span><span class="item-title">最新通知</span></view>
  15. <view class="notice-content-item">骑手<span>已接单,</span>请耐心等待</view>
  16. <view class="notice-content-item">2020-05-20 15:30</view>
  17. </view>
  18. <view class="notice-static">
  19. <span class="notice-static-text">已接单</span>
  20. </view>
  21. </view>
  22. <!-- 回收指引 -->
  23. <view class="bottom-zhiyin" @click="toZY">
  24. <u-image src="/static/houme_bg_guide.png" mode="" height="160"></u-image>
  25. </view>
  26. <!-- 收回统计 -->
  27. <view class="statistics-title">今日回收统计</view>
  28. <view class="bottom-statistics">
  29. <view class="statistics-rubbishType">
  30. <view class="statistics-box">
  31. <view class="rubbishType-type"><span class="t-icon t-icon-home_icon_paper" style="display: inline-block;margin: 0 10upx;"></span>纸质类</view>
  32. <view v-for="item in rubbishPaperList" class="rubbishType-item">
  33. <view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
  34. </view>
  35. </view>
  36. <view class="statistics-box">
  37. <view class="rubbishType-type"><span class="t-icon t-icon-home_icon_clothing" style="display: inline-block;margin: 0 10upx;"></span>衣物&其他</view>
  38. <view v-for="item in rubbishYWList" class="rubbishType-item">
  39. <view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="statistics-rubbishType">
  44. <view class="statistics-box">
  45. <view class="rubbishType-type"><span class="t-icon t-icon-home_icon_plastic" style="display: inline-block;margin: 0 10upx;"></span>塑料类</view>
  46. <view v-for="item in rubbishSLList" class="rubbishType-item">
  47. <view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
  48. </view>
  49. </view>
  50. <view class="statistics-box">
  51. <view class="rubbishType-type"><span class="t-icon t-icon-home_icon_metal" style="display: inline-block;margin: 0 10upx;"></span>金属类</view>
  52. <view v-for="item in rubbishJSList" class="rubbishType-item">
  53. <view>{{item.name ? item.name+':' :''}}{{item.weight ? (item.weight/1000).toFixed(3)/1 :0}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. components: { },
  64. data() {
  65. return {
  66. yuYueBtn:{
  67. background: "#4F88F7",
  68. borderRadius: "12px",
  69. color:'#fff',
  70. },
  71. bannerList:[{image:"/static/banner.jpg"},{image:"/static/banner.jpg"},{image:"/static/banner.jpg"}],
  72. rubbishPaperList:[{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'},{name:'黄纸',weight:'6000'}],
  73. rubbishSLList:[{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'},{name:'塑料筐',weight:'6000'}],
  74. rubbishYWList:[{name:'衣物',weight:'6000'}],
  75. rubbishJSList:[{name:'钛',weight:'6000'},{name:'钛',weight:'6000'},{name:'钛',weight:'6000'}]
  76. }
  77. },
  78. onLoad() {
  79. },
  80. onUnload() {
  81. },
  82. onShareAppMessage(res) {
  83. },
  84. onShareTimeline(res) {
  85. },
  86. onShow() {
  87. // checkLogin().then(res => {
  88. // this.hasLogin = res.status == 200
  89. // if(this.hasLogin){
  90. // // this.pageInit()
  91. // } else {
  92. // this.noDataText = '您尚未登录或登录已过期,完成登录后可查看录入信息!'
  93. // }
  94. // })
  95. },
  96. methods: {
  97. // pageInit() {
  98. // this.pageNo = 1
  99. // this.pageSize = 10
  100. // this.total = 0
  101. // this.scrollTop = 0
  102. // this.otherTotal= 0 // 其它垃圾总和
  103. // this.jianzhuTotal= 0 // 建筑垃圾总和
  104. // this.chuyuTotal= 0 // 厨余垃圾总和
  105. // this.searchForm.beginDate = getDate.getRecentday().starttime
  106. // this.searchForm.endDate = getDate.getRecentday().endtime
  107. // console.log(this.searchForm,'this.searchForm')
  108. // this.searchHandle()
  109. // this.getTotal()
  110. // },
  111. gotoYueYu(){
  112. uni.navigateTo({
  113. url: '/pages/index/yuyue'
  114. })
  115. },
  116. // 回收指引
  117. toZY(){
  118. console.log('--------指引')
  119. uni.navigateTo({
  120. // url: url
  121. })
  122. },
  123. // 检查更新
  124. checkUpdate(){
  125. // if (uni.canIUse('getUpdateManager')) {
  126. // const updateManager = uni.getUpdateManager()
  127. // updateManager.onCheckForUpdate(function (res) {
  128. // console.log('onCheckForUpdate====', res)
  129. // // 请求完新版本信息的回调
  130. // if (res.hasUpdate) {
  131. // console.log('res.hasUpdate====')
  132. // updateManager.onUpdateReady(function () {
  133. // uni.showModal({
  134. // title: '更新提示',
  135. // content: '新版本已经准备好,是否重启应用?',
  136. // success: function (res) {
  137. // console.log('success====', res)
  138. // // res: {errMsg: "showModal: ok", cancel: false, confirm: true}
  139. // if (res.confirm) {
  140. // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  141. // updateManager.applyUpdate()
  142. // }
  143. // }
  144. // })
  145. // })
  146. // updateManager.onUpdateFailed(function () {
  147. // // 新的版本下载失败
  148. // uni.showModal({
  149. // title: '已经有新版本了哟~',
  150. // content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  151. // })
  152. // })
  153. // }
  154. // })
  155. // }
  156. },
  157. // scroll-view到底部加载更多
  158. onreachBottom() {
  159. },
  160. // 总计
  161. getTotal(){
  162. // this.titleStatus = true
  163. // gatherTotal({
  164. // beginDate: this.searchForm.beginDate?moment(this.searchForm.beginDate).format('YYYY-MM-DD 00:00:00'):'',
  165. // endDate: this.searchForm.endDate ? moment(this.searchForm.endDate).format('YYYY-MM-DD 23:59:59'):''}).then(res=>{
  166. // if(res.status==200){
  167. // const a = res.data.find(item=>item.rubbishType=='GATHER_BUILDING')
  168. // const b = res.data.find(item=>item.rubbishType=='GATHER_OTHER')
  169. // const c = res.data.find(item=>item.rubbishType=='GATHER_KITCHEN')
  170. // this.jianzhuTotal= a ? (a.rubbishWeight/1000).toFixed(3)/1 : '0'
  171. // this.chuyuTotal= c ? (c.rubbishWeight/1000).toFixed(3)/1 : '0'
  172. // this.otherTotal= b ? (b.rubbishWeight/1000).toFixed(3)/1 : '0'
  173. // }
  174. // console.log(res)
  175. // this.titleStatus = false
  176. // })
  177. },
  178. // 打开垃圾数据录入页面
  179. intoPage(item) {
  180. // const flag=item ? item.gatherId : ''
  181. // console.log(flag,'---------hangid,;;;;')
  182. // let url = flag ? `/pages/index/addData?id=${flag}` : `/pages/index/addData`
  183. // // uni.navigateTo({
  184. // // url: url
  185. // // })
  186. // if(!this.hasLogin){
  187. // uni.showModal({
  188. // title: '提示',
  189. // content: '您尚未登录或登录已过期,请登录后使用',
  190. // success: (res)=> {
  191. // if (res.confirm) {
  192. // uni.navigateTo({
  193. // url: '/pages/login/login'
  194. // })
  195. // } else if (res.cancel) {
  196. // console.log('用户点击取消');
  197. // }
  198. // }
  199. // });
  200. // } else {
  201. // uni.navigateTo({
  202. // url: url
  203. // })
  204. // }
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. .content {
  211. width: 100%;
  212. height: 100vh;
  213. display: flex;
  214. flex-direction: column;
  215. padding: 0;
  216. .content-top{
  217. width: 100%;
  218. height:260upx ;
  219. background-color: #4F88F7;
  220. border-bottom-left-radius: 50%; /* 左下角 */
  221. border-bottom-right-radius:50%; /* 右下角 */
  222. opacity: 1;
  223. .top-banner{
  224. padding: 20upx 30upx 0;
  225. .banner{
  226. width:100%;
  227. height: 140px;
  228. }
  229. }
  230. }
  231. .content-bottom{
  232. padding: 30upx;
  233. background-color: #f5f5f5;
  234. .bottom-new-notice{
  235. background-image: url('../../static/home_bg_expressage.png');
  236. height:220upx;
  237. margin: 30upx 0;
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. padding: 20upx 30upx;
  242. .notice-content{
  243. .notice-content-item{
  244. margin: 15upx 0;
  245. display: flex;
  246. align-items: center;
  247. .item-title{
  248. display: inline-block;
  249. margin-left: 20upx;
  250. }
  251. }
  252. .notice-content-item:last-child{
  253. font-size: 26upx;
  254. font-family: PingFang SC;
  255. font-weight: 400;
  256. color: #7C7D7E;
  257. }
  258. }
  259. .notice-static{
  260. width:186upx;
  261. height: 108upx;
  262. background-image: url('../../static/home_sign_rider.png');
  263. .notice-static-text{
  264. position: relative;
  265. top:21upx;
  266. left:85upx
  267. }
  268. }
  269. }
  270. .bottom-zhiyin{
  271. margin-bottom: 30upx;
  272. }
  273. .statistics-title{
  274. font-size: 36upx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #191919;
  278. opacity: 1;
  279. margin-bottom: 30upx;
  280. }
  281. .bottom-statistics{
  282. display: flex;
  283. width: 100%;
  284. justify-content: space-between;
  285. .statistics-rubbishType{
  286. width: 48%;
  287. .statistics-box{
  288. margin-bottom:30upx ;
  289. background-color: #fff;
  290. padding: 20upx;
  291. border-radius:16upx;
  292. }
  293. .statistics-box:last-child{
  294. margin-bottom:0 ;
  295. }
  296. }
  297. .rubbishType-type{
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. font-size: 28upx;
  302. font-family: PingFang SC;
  303. font-weight: 400;
  304. color: #000000;
  305. }
  306. .rubbishType-item{
  307. display: flex;
  308. justify-content: center;
  309. margin:10upx 0 ;
  310. font-size: 26upx;
  311. font-family: PingFang SC;
  312. font-weight: 400;
  313. color: #444444;
  314. }
  315. }
  316. }
  317. }
  318. </style>