index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view style="width: 100%; height: 100vh; background: rgb(247, 248, 255)">
  3. <zj-page-container>
  4. <view class="toubuyangs">
  5. <view class="search-container">
  6. <u-search shape="round" :showAction="false" placeholder="输入网点名称搜索" v-model="keyword"
  7. @search="getList">
  8. </u-search>
  9. </view>
  10. </view>
  11. <zj-page-fill style="height: 100vh;">
  12. <view class="list-container" v-if="showDataList.length > 0"
  13. style="box-sizing: border-box;padding-bottom: 100rpx;">
  14. <view class="mode" v-for="(item, index) in showDataList" :key="index">
  15. <view class="flex_asb" style="align-items: flex-start">
  16. <view class="content flex1">
  17. <view class="flex_asb">
  18. <view class="title">({{ item.websitId }}){{ item.name }}</view>
  19. </view>
  20. <view class="flex">
  21. <view class="hui" style="min-width: 80rpx;">地址</view>
  22. <view class="text">{{ item.address || '无' }}</view>
  23. </view>
  24. <view class="flex_end">
  25. <u-button style="width: 80rpx; height: 40rpx; margin: 0" shape="circle" text="选择"
  26. @tap="goEnter(item)"></u-button>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </zj-page-fill>
  33. </zj-page-container>
  34. </view>
  35. </template>
  36. <script>
  37. import zjPageLayout from '@/components/zj-container/zj-page-layout.vue'
  38. import zjPageContainer from '@/components/zj-page-container/zj-page-container.vue'
  39. import zjPageFill from '@/components/zj-page-container/zj-page-fill.vue'
  40. import {
  41. mapState
  42. } from 'vuex';
  43. export default {
  44. components: {
  45. zjPageLayout,
  46. zjPageContainer,
  47. zjPageFill,
  48. },
  49. data() {
  50. return {
  51. dataList: [],
  52. keyword: '',
  53. }
  54. },
  55. onShow() {
  56. this.getList()
  57. },
  58. computed: {
  59. ...mapState(['userInfo', 'isLogin', 'userId', 'websitData']),
  60. showDataList() {
  61. if (this.keyword) {
  62. return this.dataList.filter(item => ~item.name.indexOf(this.keyword) || ~item.websitId.indexOf(this
  63. .keyword))
  64. } else {
  65. return this.dataList
  66. }
  67. }
  68. },
  69. methods: {
  70. async getList() {
  71. console.log(11111)
  72. uni.getLocation({
  73. type: 'gcj02',
  74. success: res => {
  75. console.log(222222,res)
  76. this.$axios({
  77. url: '/user/websitList',
  78. method: 'post',
  79. params: {
  80. lat: res.latitude,
  81. lng: res.longitude,
  82. },
  83. }).then((resData) => {
  84. this.dataList = resData.data
  85. console.log(resData)
  86. });
  87. },
  88. fail: err => {
  89. }
  90. })
  91. },
  92. goEnter(item) {
  93. this.$axios({
  94. url: '/user/getWebsitId',
  95. method: 'post',
  96. params: {
  97. websitId: item.websitId,
  98. },
  99. }).then((res) => {
  100. this.$axios({
  101. url: '/user/user/detail',
  102. method: 'get',
  103. params: {
  104. userId: this.userId
  105. }
  106. }).then(resData => {
  107. this.$store.commit('changeUserInfo', resData?.data);
  108. uni.setStorageSync('userInfo', resData?.data);
  109. if (resData?.data?.adminWebsit?.websitId) {
  110. this.$store.commit('changeWebsitObj', resData?.data?.adminWebsit);
  111. uni.setStorageSync('websitData', resData?.data?.adminWebsit);
  112. uni.setStorageSync("websitIdSj", resData?.data?.adminWebsit?.websitId);
  113. }
  114. uni.reLaunch({
  115. url: "/pages/index/index"
  116. })
  117. })
  118. });
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .search-container {
  125. background: #ffffff;
  126. padding: 20rpx;
  127. ::v-deep .u-search {
  128. height: 60rpx;
  129. input {
  130. background: #f7f8ff !important;
  131. }
  132. .u-search__content {
  133. background: #f7f8ff !important;
  134. height: 60rpx;
  135. }
  136. }
  137. }
  138. .quanjuanniu {
  139. width: 100%;
  140. height: auto;
  141. padding: 30rpx;
  142. box-sizing: border-box;
  143. }
  144. .neirongquyu {
  145. width: 100%;
  146. height: auto;
  147. padding: 30rpx 30rpx 15rpx 30rpx;
  148. box-sizing: border-box;
  149. .zhegeshineirong {
  150. width: 100%;
  151. height: auto;
  152. padding: 30rpx;
  153. box-sizing: border-box;
  154. background: #fff;
  155. border-radius: 20rpx;
  156. margin-bottom: 30rpx;
  157. .neirongbiaot {
  158. width: 100%;
  159. height: auto;
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. box-sizing: border-box;
  164. margin-bottom: 40rpx;
  165. text {
  166. font-size: 32rpx;
  167. font-weight: 700;
  168. }
  169. }
  170. .neironglieju {
  171. width: 100%;
  172. height: auto;
  173. display: flex;
  174. align-items: center;
  175. justify-content: flex-start;
  176. box-sizing: border-box;
  177. margin-bottom: 30rpx;
  178. text {
  179. font-size: 28rpx;
  180. }
  181. }
  182. .neironghengxin {
  183. width: 100%;
  184. border-bottom: 1rpx solid #aaa;
  185. margin-bottom: 30rpx;
  186. }
  187. .neironganniuqu {
  188. widows: 100%;
  189. text-align: right;
  190. }
  191. }
  192. }
  193. .toubuyangs {
  194. width: 100%;
  195. height: auto;
  196. box-sizing: border-box;
  197. padding: 30rpx 30rpx 15rpx 30rpx;
  198. background: #fff;
  199. .toubuyangsTab {
  200. width: 100%;
  201. height: auto;
  202. padding: 30rpx;
  203. box-sizing: border-box;
  204. background: #fff;
  205. border-radius: 20rpx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: space-around;
  209. .toubuyangsTabItem {
  210. box-sizing: border-box;
  211. font-size: 32rpx;
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. flex-direction: column;
  216. .hengxian {
  217. margin-top: 20rpx;
  218. width: 100rpx;
  219. }
  220. .xuanzhong {
  221. border-bottom: 4rpx solid #000;
  222. }
  223. }
  224. }
  225. }
  226. .flex {
  227. display: flex;
  228. align-items: center;
  229. }
  230. .flex_asb {
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. }
  235. .flex_end {
  236. display: flex;
  237. align-items: center;
  238. justify-content: flex-end;
  239. margin-top: 30rpx;
  240. }
  241. .flex1 {
  242. flex: 1;
  243. }
  244. .list-container {
  245. box-sizing: border-box;
  246. padding: 0 30rpx;
  247. }
  248. .mode {
  249. @include zj-card;
  250. padding: 30rpx 20rpx;
  251. margin-top: 30rpx;
  252. border-radius: 20rpx;
  253. box-sizing: border-box;
  254. background-color: #ffffff;
  255. .order {
  256. margin-bottom: 20rpx;
  257. }
  258. .content {
  259. width: 450rpx;
  260. .title {
  261. font-weight: bold;
  262. font-size: 30rpx;
  263. }
  264. .text,
  265. .hui {
  266. font-size: 28rpx;
  267. margin-top: 16rpx;
  268. }
  269. .hui {
  270. color: #999999;
  271. margin-right: 20rpx;
  272. }
  273. }
  274. .status {
  275. font-size: 28rpx;
  276. color: #0379ff;
  277. }
  278. .zhihui {
  279. .text,
  280. .hui,
  281. .title,
  282. .status {
  283. color: #999999 !important;
  284. }
  285. }
  286. .img {
  287. width: 100rpx;
  288. height: 100rpx;
  289. margin-right: 30rpx;
  290. }
  291. }
  292. .search-container {
  293. background: #ffffff;
  294. padding: 20rpx;
  295. ::v-deep .u-search {
  296. height: 60rpx;
  297. input {
  298. background: #f7f8ff !important;
  299. }
  300. .u-search__content {
  301. background: #f7f8ff !important;
  302. height: 60rpx;
  303. }
  304. }
  305. }
  306. </style>