teamStore.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <view class="content">
  3. <!-- top -->
  4. <view class="topView">
  5. <!-- 搜索 -->
  6. <view class="searchBox">
  7. <image src="../../static/img/icon_search.png" class="searchImg"></image>
  8. <input type="text" class="searchInput" placeholder="请输入门店名称、联系人、手机号" v-model="searchValue"
  9. @confirm="searchDone" />
  10. </view>
  11. <!-- 条件筛选 -->
  12. <view class="siftBg">
  13. <picker @change="bindChange" mode="region">
  14. <view class="uni-input">{{data.address == null ? '区域筛选' : data.address}}
  15. <image class="downArrow" src="../../static/img/icon_downArrow.png"></image>
  16. </view>
  17. </picker>
  18. <picker :value="thirdIndex" mode="selector" range-key='name' :range="thirdArr"
  19. @change="bindPickerChange3" v-if="isDirector">
  20. <view class="uni-input">{{thirdIndex == null ? '运营经理' : thirdArr[thirdIndex].name}}
  21. <image class="downArrow" src="../../static/img/icon_downArrow.png"></image>
  22. </view>
  23. </picker>
  24. </view>
  25. </view>
  26. <!-- 列表 -->
  27. <view class="shopList">
  28. <view v-for="(item,index) in shopData" :key="index">
  29. <!-- shopBox -->
  30. <view class="shopBox">
  31. <view class="shopTop">
  32. <view class="shopName">{{item.ShopName}}</view>
  33. <!-- 地址 和电话 图标 -->
  34. <image class="tubiao" src="../../static/img/icon_daohang_def@2x.png" @click="goAddress(item)">
  35. </image>
  36. <image class="tubiao" src="../../static/img/icon_phone_def@2x.png"
  37. @click="call(item.ContactorPhone)">
  38. </image>
  39. </view>
  40. <!-- 门店类型-开业时间-联系人 -->
  41. <view class="shopType"><text style='color: #B98B5D;'>{{item.levelName}}</text> ·
  42. <text v-if="item.OpeningTime != null">{{item.OpeningTime}}</text> 联系人:{{item.Contactor}}
  43. </view>
  44. <!-- 详细地址 -->
  45. <view class="addressView">
  46. <view class="address">{{item.Address}}</view>
  47. <view class="distance" v-if="item.distance != 0.00">{{item.distance}}km</view>
  48. </view>
  49. <!-- 运营经理 -->
  50. <view class="manager" v-if="isDirector">运营经理:{{item.name}} {{item.AccountName}}
  51. </view>
  52. <!-- 历史记录 -->
  53. <view class="bottomView">
  54. <view class="lishi" @click="history">历史记录</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 上拉 加载更多 -->
  60. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  61. <!-- 无数据空白页 -->
  62. <view class="nodataBox" v-if="shopData.length == 0">
  63. <image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  64. <view class="noTxt">暂无数据</view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. searchValue: '',
  73. data: {
  74. provinceCode: '',
  75. province: '',
  76. cityCode: '',
  77. city: '',
  78. areaCode: '',
  79. area: '',
  80. address: null,
  81. },
  82. thirdIndex: null,
  83. thirdArr: [],
  84. managerId: '',
  85. shopData: [],
  86. page: 1,
  87. noMoreShow: false,
  88. lng: '',
  89. lat: '',
  90. isDirector:'',
  91. }
  92. },
  93. onLoad() {
  94. this.isDirector = this.$common.isDirector()
  95. var that = this
  96. uni.getLocation({
  97. success(res) {
  98. that.lng = res.longitude
  99. that.lat = res.latitude
  100. that.page = 1
  101. that.getShopData()
  102. }
  103. }),
  104. this.getManager()
  105. },
  106. methods: {
  107. searchDone(e) {
  108. this.searchValue = e.target.value
  109. this.page = 1
  110. this.getShopData()
  111. },
  112. bindChange: function(e) {
  113. this.data.provinceCode = e.detail.code[0]
  114. this.data.cityCode = e.detail.code[1]
  115. this.data.areaCode = e.detail.code[2]
  116. this.data.province = e.detail.value[0]
  117. this.data.city = e.detail.value[1]
  118. this.data.area = e.detail.value[2]
  119. this.data.address = this.data.province + this.data.city + this.data.area
  120. this.page = 1
  121. this.getShopData()
  122. },
  123. bindPickerChange3(e) {
  124. this.thirdIndex = e.target.value
  125. this.managerId = this.thirdArr[this.thirdIndex].ID
  126. this.page = 1
  127. this.getShopData()
  128. },
  129. goAddress(v) {
  130. uni.openLocation({
  131. latitude: Number(v.lat),
  132. longitude: Number(v.lng),
  133. name: v.shopName,
  134. address: v.Address,
  135. });
  136. },
  137. call(e) {
  138. if (e.length != 0) {
  139. uni.makePhoneCall({
  140. phoneNumber: e
  141. })
  142. }
  143. },
  144. history() {
  145. console.log('历史记录');
  146. },
  147. getManager() {
  148. uni.showLoading({
  149. title: '加载中'
  150. })
  151. let url = 'accompany/SuperAccounts/queryManagerListByDept',
  152. params = {
  153. name: '',
  154. }
  155. this.$http(url, params, 'GET').then(res => {
  156. this.thirdArr = res.data
  157. })
  158. },
  159. getShopData() {
  160. uni.showLoading({
  161. title: '加载中'
  162. })
  163. let url = 'accompany/SuperAccounts/listCheckPage',
  164. params = {
  165. page: this.page,
  166. limit: 20,
  167. provinceCode: this.data.provinceCode,
  168. cityCode: this.data.cityCode,
  169. areaCode: this.data.areaCode,
  170. manager: this.managerId,
  171. shopName: this.searchValue,
  172. lng: this.lng,
  173. lat: this.lat,
  174. }
  175. this.$http(url, params, 'GET').then(res => {
  176. var list = res.data.Items
  177. // 处理 undefined和null转为空白字符串
  178. list.forEach((item, index) => {
  179. for (const key in item) {
  180. item[key] = this.$praseStrEmpty(item[key])
  181. }
  182. })
  183. if (this.page == 1 && list.length == 0) {
  184. this.noMoreShow = false
  185. } else if (list.length < 20) {
  186. this.noMoreShow = true
  187. }
  188. if (this.page == 1) {
  189. this.shopData = list
  190. } else {
  191. this.shopData = this.shopData.concat(list)
  192. }
  193. })
  194. }
  195. },
  196. // 下拉刷新 上拉加载更多
  197. onPullDownRefresh() {
  198. this.page = 1
  199. this.getShopData()
  200. setTimeout(function() {
  201. uni.stopPullDownRefresh();
  202. }, 1000);
  203. },
  204. onReachBottom() {
  205. this.page++;
  206. this.getShopData()
  207. },
  208. }
  209. </script>
  210. <style>
  211. .content {
  212. background-color: #F4F5F7;
  213. min-height: 100vh;
  214. }
  215. .topView {
  216. width: 100%;
  217. height: 200rpx;
  218. background-color: #FFFFFF;
  219. left: 0rpx;
  220. top: 0rpx;
  221. position: fixed;
  222. z-index: 99;
  223. }
  224. /* #ifdef H5 */
  225. .topView {
  226. top: 44px;
  227. }
  228. /* #endif */
  229. .searchBox {
  230. height: 72rpx;
  231. margin: 24rpx;
  232. background-color: #F4F5F7;
  233. border-radius: 36rpx;
  234. display: flex;
  235. }
  236. .searchImg {
  237. margin-top: 20rpx;
  238. margin-left: 20rpx;
  239. width: 32rpx;
  240. height: 32rpx;
  241. }
  242. .searchInput {
  243. height: 72rpx;
  244. font-size: 28rpx;
  245. padding-left: 16rpx;
  246. width: 85%;
  247. }
  248. .siftBg {
  249. display: flex;
  250. justify-content: space-around;
  251. height: 80rpx;
  252. align-items: center;
  253. }
  254. .downArrow {
  255. width: 16rpx;
  256. height: 12rpx;
  257. padding: 6rpx 8rpx;
  258. }
  259. .shopList {
  260. background-color: #F4F5F7;
  261. padding: 0rpx 24rpx;
  262. padding-top: 200rpx;
  263. }
  264. .shopBox {
  265. background-color: #FFFFFF;
  266. border-radius: 10rpx;
  267. margin: 20rpx 0rpx;
  268. }
  269. .shopTop {
  270. display: flex;
  271. padding: 30rpx 20rpx 10rpx 20rpx;
  272. justify-content: space-between;
  273. }
  274. .shopName {
  275. font-size: 30rpx;
  276. color: #3C3C3C;
  277. font-weight: bold;
  278. width: 500rpx;
  279. }
  280. .tubiao {
  281. width: 48rpx;
  282. height: 48rpx;
  283. padding-left: 40rpx;
  284. }
  285. .shopType {
  286. font-size: 26rpx;
  287. padding: 10rpx 20rpx;
  288. color: #3C3C3C;
  289. }
  290. .addressView {
  291. font-size: 26rpx;
  292. color: #999999;
  293. padding: 10rpx 20rpx;
  294. display: flex;
  295. justify-content: space-between;
  296. }
  297. .distance {
  298. margin-left: 20rpx;
  299. margin-right: 20rpx;
  300. }
  301. .manager {
  302. font-size: 26rpx;
  303. color: #999999;
  304. padding-left: 20rpx;
  305. padding-right: 20rpx;
  306. padding-bottom: 30rpx;
  307. }
  308. .bottomView {
  309. border-top: 1rpx solid #EEEEEE;
  310. display: flex;
  311. justify-content: flex-end;
  312. }
  313. .lishi {
  314. margin: 20rpx 50rpx;
  315. margin-right: 20rpx;
  316. color: #3C3C3C;
  317. font-size: 28rpx;
  318. width: 150rpx;
  319. height: 56rpx;
  320. border-radius: 28rpx;
  321. border: 2rpx solid #DDDDDD;
  322. text-align: center;
  323. line-height: 56rpx;
  324. }
  325. /* 空白页css */
  326. .nodataBox {
  327. text-align: center;
  328. }
  329. .nodataImg {
  330. width: 400rpx;
  331. padding-top: 300rpx;
  332. }
  333. .noTxt {
  334. font-size: 30rpx;
  335. color: #999999;
  336. padding-top: 50rpx;
  337. }
  338. .noMore {
  339. text-align: center;
  340. line-height: 50rpx;
  341. color: #999999;
  342. font-size: 28rpx;
  343. }
  344. </style>