index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="content">
  3. <!-- 轮播图 -->
  4. <swiper class="top-ad-swiper" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="600" :circular="true">
  5. <swiper-item v-for="(item,index) in imageTopList" :key="index">
  6. <div class="swiper-item uni-bg-red">
  7. <!-- <image class="swiper-item-imgse" :fade-show='true' :src="item.photo"></image> -->
  8. <u-image mode="scaleToFill" width="750upx" height="400upx" :src="item.photo"></u-image>
  9. </div>
  10. </swiper-item>
  11. </swiper>
  12. <!-- 导航按钮 -->
  13. <div class="nav-items">
  14. <iconItemsList :list="navList"></iconItemsList>
  15. </div>
  16. <u-gap height="10" bg-color="#f8f8f8"></u-gap>
  17. <!-- 待办单 -->
  18. <div class="panel-box">
  19. <div class="panel-title">
  20. <span class="texts">待办单</span>
  21. <span class="btns" @click="toDoList">更多
  22. <u-icon name="icon-xian-11" custom-prefix="xd-icon" size="24" color="#4eacfe"></u-icon>
  23. </span>
  24. </div>
  25. <div class="panel-body">
  26. <div class="order-list">
  27. <div v-for="item in toDoData" :key="item.id">
  28. <span>{{item.createDate}}</span>
  29. <span>{{item.sourceType}}</span>
  30. <span>{{item.status}}</span>
  31. </div>
  32. </div>
  33. <div class="nodata" v-if="toDoData.length==0">{{notoDoDataText}}</div>
  34. </div>
  35. </div>
  36. </view>
  37. </template>
  38. <script>
  39. import iconItemsList from '@/components/icon-items-list/icon-items-list.vue'
  40. import { bannerList } from "@/api/banner.js"
  41. import { getBackLogList } from '@/api/backLog'
  42. import { getLookUpDatas } from "@/api/data.js"
  43. import moment from 'moment'
  44. export default {
  45. components: {
  46. iconItemsList
  47. },
  48. data() {
  49. return {
  50. // 顶部轮播图片
  51. imageTopList:[],
  52. notoDoDataText: '数据加载中,请稍后...',
  53. toDoData: [],
  54. // 快捷导航
  55. navList: [
  56. {
  57. id: 'SPXD',
  58. icon: 'xundian',
  59. color: '#00aaff',
  60. name: '视频巡店',
  61. url: '/pages/videoShopTour/videoShopTour',
  62. target: 'page',
  63. auth: true
  64. },
  65. {
  66. id: 'DJZX',
  67. icon: 'dianjian',
  68. color: '#ff5500',
  69. name: '点检中心',
  70. url:'/pages/spotCheckCenter/spotChecking',
  71. target: 'page',
  72. auth: true
  73. },
  74. {
  75. id: 'XCXD',
  76. icon: 'xianchangjiancha',
  77. color: '#00aa00',
  78. name: '现场巡店',
  79. url:'/pages/siteInspection/siteInspection',
  80. target: 'page',
  81. auth: true
  82. },
  83. {
  84. id: 'XDJL',
  85. icon: 'tubiaokuwenjian-gengxin-',
  86. color: '#d0527e',
  87. name: '巡店记录',
  88. url:'/pages/shopTourRecord/shopTourRecord',
  89. target: 'page',
  90. auth: true
  91. }
  92. ],
  93. };
  94. },
  95. onLoad() {
  96. this.getBanner('HOME_TOP')
  97. this.gettoDoData()
  98. // 获取周
  99. this.getLookUpList('WEEK', 'vuex_weeks');
  100. },
  101. methods: {
  102. // 或某一项字典列表,参数code
  103. getLookUpList(code, vuexKey) {
  104. getLookUpDatas({ type: code }).then(res => {
  105. if (res.status == 200) {
  106. this.$store.state[vuexKey] = res.data || [];
  107. }
  108. });
  109. },
  110. openVideo() {
  111. uni.navigateTo({
  112. url:"/pages/shopTour/shopTour"
  113. })
  114. },
  115. // 消息提示
  116. showTotast(title){
  117. uni.showToast({
  118. icon: 'none',
  119. title:title
  120. })
  121. },
  122. // 获取顶部与中部轮播图片
  123. getBanner(position){
  124. bannerList({
  125. position: position,
  126. status : '1',
  127. bannerType: 'App'
  128. }).then(res=>{
  129. if(res.status == 200){
  130. if(position == 'HOME_TOP'){
  131. this.imageTopList=res.data
  132. }
  133. }
  134. }).catch(err=>{
  135. console.log('数据获取失败')
  136. })
  137. },
  138. // 获取待办单
  139. gettoDoData(){
  140. let _this = this
  141. let toDoData = {
  142. pageNo: 1,
  143. pageSize: 5,
  144. endDate: moment().format('YYYY-MM-DD'),
  145. beginDate: moment().subtract(7, 'days').format('YYYY-MM-DD')
  146. }
  147. getBackLogList(toDoData).then(res=>{
  148. if(res.status==200){
  149. let data = res.data.list
  150. if(data.length) {
  151. _this.toDoData = data.slice(0,10)
  152. } else {
  153. _this.toDoData = []
  154. _this.notoDoDataText = '暂无数据'
  155. }
  156. } else {
  157. this.showTotast(res.message ? res.message : '网络似乎出错了,请稍后再试')
  158. this.notoDoDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
  159. }
  160. })
  161. },
  162. // 更多待办
  163. toDoList(){
  164. uni.navigateTo({
  165. url: '/pages/toDoList/toDoList'
  166. })
  167. }
  168. }
  169. };
  170. </script>
  171. <style lang="scss">
  172. .content {
  173. .top-ad-swiper{
  174. height: 340upx;
  175. }
  176. .swiper-item-imgse{
  177. width: 750upx;
  178. height: 340upx;
  179. }
  180. .panel-box{
  181. .panel-title{
  182. display: flex;
  183. align-items: center;
  184. padding:20upx 15upx;
  185. border-bottom: 2upx solid #eee;
  186. .texts{
  187. font-size: 28upx;
  188. flex-grow: 1;
  189. padding-left: 15upx;
  190. background: url(/static/pt.png) no-repeat left center;
  191. background-size: auto 80%;
  192. }
  193. .btns{
  194. font-size: 24upx;
  195. color: #999;
  196. }
  197. }
  198. .panel-body{
  199. padding: 20upx 0;
  200. .nodata{
  201. text-align: center;
  202. font-size: 24upx;
  203. width: 100%;
  204. color: #999999;
  205. padding: 30upx 0;
  206. }
  207. }
  208. }
  209. .order-list{
  210. > div{
  211. display: flex;
  212. align-items: center;
  213. font-size: 30upx;
  214. padding: 14upx 0;
  215. span{
  216. flex-grow: 1;
  217. text-align: center;
  218. color: #666;
  219. width: 33.3%;
  220. }
  221. span.daiJs{
  222. color: #ff0000;
  223. }
  224. span.daiWg{
  225. color: #ffaa00;
  226. }
  227. span.yiJs{
  228. color: #5fbe00;
  229. }
  230. }
  231. }
  232. }
  233. </style>