videoShopTour.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="videoShopTour-wrap">
  3. <u-sticky>
  4. <!-- 搜索方式 -->
  5. <u-grid :col="2" class="search-type-con" hover-class="none">
  6. <u-grid-item class="search-module" @click="goSearch">
  7. <u-icon class="search-icon" name="xundianguanli" custom-prefix="xd-icon" size="80" color="#2b85e4"></u-icon>
  8. <view class="search-txt">按门店名称查询</view>
  9. </u-grid-item>
  10. <u-grid-item class="search-module" @click="goOrgSearch">
  11. <u-icon class="search-icon" name="zuzhijigou" custom-prefix="xd-icon" size="80" color="#19be6b"></u-icon>
  12. <view class="search-txt">按组织机构查询</view>
  13. </u-grid-item>
  14. </u-grid>
  15. </u-sticky>
  16. <!-- 门店列表 -->
  17. <view class="list-con">
  18. <view class="list-tit">门店列表</view>
  19. <!-- 列表数据 -->
  20. <view class="listData-con">
  21. <view class="listData-item" v-for="(item, index) in list" :key="index" @click="goPage(item)">
  22. <view class="listData-item-l">
  23. <u-icon class="listData-item-l-icon" name="mendian" custom-prefix="xd-icon" size="40" color="#888"></u-icon>
  24. <text class="listData-item-l-name">{{item.name}}</text>
  25. </view>
  26. <view class="listData-item-r">
  27. <u-icon class="listData-item-r-icon" name="yuanchengxundian" custom-prefix="xd-icon" size="40" color="#2b85e4"></u-icon>
  28. </view>
  29. </view>
  30. <u-empty :text="noDataText" img-width="120" v-if="list.length == 0 && status != 'loading'" :margin-top="20" mode="list"></u-empty>
  31. <u-loadmore bg-color="#f8f8f8" v-if="list.length < total || status == 'loading'" :status="status" class="loadmore" />
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import { clzConfirm } from '@/libs/tools.js'
  38. import { findStoreList } from '@/api/store.js'
  39. export default{
  40. data(){
  41. return{
  42. noDataText: '暂无数据', // 数据异常提示
  43. status: 'loadmore', // 加载中状态
  44. list: [], // 数据列表
  45. total: 0, // 数据总条数
  46. pageNo: 1, // 当前页码
  47. pageSize: 10, // 每页条数
  48. }
  49. },
  50. onLoad() {
  51. this.init()
  52. },
  53. methods: {
  54. // 初始
  55. init(){
  56. // 获取门店列表
  57. findStoreList().then(res => {
  58. if(res.status == 200){
  59. this.list = res.data.list
  60. this.total = res.data.count || 0
  61. }else{
  62. this.list = []
  63. this.total = 0
  64. }
  65. })
  66. },
  67. // 按门店名称查询
  68. goSearch(){
  69. uni.navigateTo({
  70. url: '/pages/searchPage/searchPage'
  71. })
  72. },
  73. // 按组织机构查询
  74. goOrgSearch(){
  75. uni.navigateTo({
  76. url: '/pages/organization/organization'
  77. })
  78. },
  79. // 开始巡店
  80. goPage(item){
  81. // 校验是否有历史巡店记录
  82. clzConfirm({
  83. title: '提示',
  84. content: '有进行中的巡店任务,是否继续?',
  85. confirmText: '继续巡店',
  86. cancelText: '重新开始',
  87. success: function (res) {
  88. if (res.confirm || res.index==0) { // 继续巡店
  89. uni.navigateTo({
  90. url: '/pages/shopTour/shopTour?storeId=' + item.id + '&type=0'
  91. })
  92. }else{ // 重新开始
  93. uni.navigateTo({
  94. url: '/pages/shopTour/shopTour?storeId=' + item.id + '&type=1'
  95. })
  96. }
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. page {
  105. background-color: #f8f8f8;
  106. height: calc(100vh - 44px);
  107. }
  108. .videoShopTour-wrap{
  109. // 搜索方式
  110. .search-type-con{
  111. .search-module{
  112. .search-txt{
  113. font-size: 26upx;
  114. padding-top: 6upx;
  115. }
  116. }
  117. }
  118. // 门店列表
  119. .list-con{
  120. background-color: #fff;
  121. margin-top: 20upx;
  122. .list-tit{
  123. padding: 20upx 30upx;
  124. border-bottom: 1upx solid #f8f8f8;
  125. }
  126. .listData-con{
  127. padding: 0 30upx;
  128. .listData-item{
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. padding: 20upx 0;
  133. border-bottom: 1upx dashed #f8f8f8;
  134. &-l{
  135. flex-grow: 1;
  136. padding-right: 10upx;
  137. position: relative;
  138. padding-left: 50upx;
  139. &-icon{
  140. vertical-align: sub;
  141. padding-right: 8upx;
  142. position: absolute;
  143. left: 0;
  144. top: -4upx;
  145. }
  146. }
  147. &-r{
  148. flex-shrink: 0;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. </style>