index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view class="s_page">
  3. <!-- <map
  4. class="myMap"
  5. :latitude="latitude"
  6. :longitude="longitude"
  7. :markers="markers"
  8. style="width: 750rpx; flex: 1"
  9. scale="11"
  10. ></map> -->
  11. <!-- 左上角返回按钮 -->
  12. <image
  13. @tap.stop="navBack"
  14. class="map-back"
  15. src="/static/images/map_back.png"
  16. mode=""
  17. :style="{ top: StatusBar + 'px' }"
  18. ></image>
  19. <!-- 申请记录按钮 -->
  20. <view class="record-application" @tap.stop="toNavigate" :style="{ top: StatusBar + 'px' }">
  21. <text class="record-application-text">申请记录</text>
  22. </view>
  23. <!-- 列表 -->
  24. <view class="bottom-con">
  25. <zj-page-fill
  26. @scrolltolower="loadMore"
  27. :scrollAttribute="{
  28. 'refresher-enabled': false
  29. }"
  30. >
  31. <view class="list_view_lay">
  32. <view class="box" v-for="item in websitList" :key="item.websitId">
  33. <view class="mb20 flex_abs mt20">
  34. <text class="fw600 f32_302">{{ item.websitName }}</text>
  35. <text class="f24_999">距离{{ item.distance }}km</text>
  36. </view>
  37. <view class="flex_abs">
  38. <text class="f28_666" style="width: 520rpx">地址:{{ item.address }}</text>
  39. <tag
  40. style="
  41. width: 150rpx;
  42. height: 50rpx;
  43. background-image: linear-gradient(to bottom right, #7fdaff, #6da7ff);
  44. border-radius: 30rpx;
  45. "
  46. >
  47. <text @tap.stop="toApplicationPartsForm(item)" class="f24_FFF">申请</text>
  48. </tag>
  49. </view>
  50. </view>
  51. </view>
  52. </zj-page-fill>
  53. <!-- <list @loadmore="loadMore" loadmoreoffset="20" show-scrollbar>
  54. <cell class="item" v-for="item in websitList" :key="item.websitId">
  55. <view class="mb20 flex_abs mt20">
  56. <text class="fw600 f32_302">{{ item.websitName }}</text>
  57. <text class="f24_999">距离{{ item.distance }}km</text>
  58. </view>
  59. <view class="flex_abs">
  60. <text class="f28_666" style="width: 520rpx">地址:{{ item.address }}</text>
  61. <tag
  62. style="
  63. width: 150rpx;
  64. height: 50rpx;
  65. background-image: linear-gradient(to bottom right, #7fdaff, #6da7ff);
  66. border-radius: 30rpx;
  67. "
  68. >
  69. <text @tap.stop="toApplicationPartsForm(item)" class="f24_FFF">申请</text>
  70. </tag>
  71. </view>
  72. </cell>
  73. </list> -->
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. const sysInfo = uni.getSystemInfoSync()
  79. import api from '@/common/http/'
  80. import tag from '@/components/tag.vue'
  81. import zjPageFill from '@/components/zj-page-container/zj-page-fill.vue'
  82. import wx from 'weixin-js-sdk'
  83. export default {
  84. components: {
  85. tag,
  86. zjPageFill
  87. },
  88. data() {
  89. return {
  90. StatusBar: sysInfo.statusBarHeight,
  91. latitude: '',
  92. longitude: '',
  93. markers: [
  94. {
  95. id: 'm_1',
  96. latitude: 23.183466,
  97. longitude: 113.35709,
  98. iconPath: '/static/images/order_call.png'
  99. }
  100. ],
  101. websitList: [],
  102. page: 1,
  103. pageSize: 3,
  104. websit_number: ''
  105. }
  106. },
  107. async onLoad() {
  108. const getWebsit_number = uni.getStorageSync('userInfo')
  109. this.websit_number = getWebsit_number.websit_number
  110. await this.getCurrentWebsit()
  111. await this.getWebsitList()
  112. },
  113. methods: {
  114. navBack() {
  115. uni.navigateBack({
  116. delta: 1
  117. })
  118. },
  119. toNavigate() {
  120. this.$navToPage({
  121. url: `/packageAttachment/pages/orderOfSales/index`
  122. })
  123. },
  124. toApplicationPartsForm(item) {
  125. var { websitId, websitName, partsWebsitId } = item
  126. this.$navToPage({
  127. url: `/packageAttachment/pages/applicationParts/applicationPartsForm?websitId=${websitId}&websitName=${websitName}&partsWebsitId=${partsWebsitId}`
  128. })
  129. },
  130. loadMore() {
  131. this.page++
  132. this.getWebsitList()
  133. },
  134. getWebsitList() {
  135. let params = {
  136. latitude: this.latitude,
  137. longitude: this.longitude,
  138. pageNo: this.page,
  139. pageSize: this.pageSize,
  140. websitNumber: this.websit_number
  141. }
  142. api.post('/app/buy/websit/list', params).then(res => {
  143. this.websitList = this.websitList.concat(res.data.records).filter(item => item.partsWebsitId)
  144. // if (this.websitList.length != 0) {
  145. // this.markers = this.websitList.map(item => {
  146. // return {
  147. // id: item.websitId,
  148. // latitude: item.latitude,
  149. // longitude: item.longitude,
  150. // width: 28,
  151. // height: 28,
  152. // fontSize: 16,
  153. // iconPath: '',
  154. // callout: {
  155. // content: item.websitName,
  156. // padding: 5,
  157. // display: 'ALWAYS',
  158. // borderRadius: 5,
  159. // color: '#E95505'
  160. // }
  161. // }
  162. // })
  163. // }
  164. })
  165. },
  166. async getCurrentWebsit() {
  167. try {
  168. const addressInfo = await new Promise((resolve, reject) => {
  169. wx.getLocation({
  170. type: 'gcj02',
  171. isHighAccuracy: true,
  172. geocode: true,
  173. success: res => {
  174. resolve({
  175. lat: res.latitude,
  176. lng: res.longitude,
  177. address: res.address
  178. })
  179. },
  180. fail: err => {
  181. reject(err)
  182. }
  183. })
  184. })
  185. console.log(addressInfo, '-------------------')
  186. let { lat, lng } = addressInfo
  187. this.latitude = lat
  188. this.longitude = lng
  189. } catch (error) {
  190. console.log(error, '======================')
  191. }
  192. }
  193. }
  194. }
  195. </script>
  196. <style scoped lang="scss">
  197. .confirm-btn {
  198. background-image: linear-gradient(to bottom right, #7fdaff, #6da7ff);
  199. }
  200. .map-back {
  201. position: absolute;
  202. left: 30rpx;
  203. width: 60rpx;
  204. height: 60rpx;
  205. border-radius: 30rpx;
  206. overflow: hidden;
  207. }
  208. .record-application {
  209. position: absolute;
  210. right: 30rpx;
  211. width: auto;
  212. height: 60rpx;
  213. border-radius: 30rpx;
  214. box-sizing: border-box;
  215. padding: 0 20rpx;
  216. background: #6da7ff;
  217. }
  218. .record-application-text {
  219. font-size: 28rpx;
  220. font-weight: 500;
  221. text-align: center;
  222. color: #ffffff !important;
  223. line-height: 60rpx;
  224. }
  225. .bottom-con {
  226. width: 750rpx;
  227. padding-top: 25rpx;
  228. padding-left: 25rpx;
  229. padding-bottom: 30rpx;
  230. padding-right: 25rpx;
  231. // border-radius: 40rpx;
  232. border-top-right-radius: 40rpx;
  233. border-top-left-radius: 40rpx;
  234. // box-shadow: 0px -10rpx 40rpx 0px rgba(0, 0, 0, 0.05);
  235. position: fixed;
  236. bottom: 0;
  237. left: 0;
  238. background-color: #ffffff;
  239. z-index: 100;
  240. // overflow:hidden;
  241. height: 500rpx;
  242. }
  243. .item {
  244. background-color: #ffffff;
  245. overflow: hidden;
  246. border-bottom: 2rpx solid #f7f7f7;
  247. padding-bottom: 20rpx;
  248. }
  249. .flex_abs {
  250. flex-direction: row;
  251. }
  252. .mask {
  253. position: fixed;
  254. left: 0;
  255. top: 0;
  256. bottom: 0;
  257. right: 0;
  258. background-color: rgba(0, 0, 0, 0.3);
  259. z-index: 1000;
  260. justify-content: center;
  261. align-items: center;
  262. }
  263. .closes {
  264. flex-direction: row;
  265. justify-content: flex-end;
  266. }
  267. .closes-img {
  268. height: 40rpx;
  269. width: 40rpx;
  270. }
  271. .phone-con {
  272. width: 540rpx;
  273. border-radius: 20rpx;
  274. background-color: #ffffff;
  275. text-align: center;
  276. padding: 10rpx 30rpx 40rpx 30rpx;
  277. position: relative;
  278. .confirm-btn {
  279. font-size: 32rpx;
  280. color: #ffffff;
  281. }
  282. .iconfont {
  283. color: #e5e5e5;
  284. position: absolute;
  285. right: 30rpx;
  286. top: 30rpx;
  287. color: #333333;
  288. }
  289. }
  290. </style>