lock-position.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view>
  3. <navbar :config="config" backColor="#999999"></navbar>
  4. <view class="select-top">
  5. <block v-for="(item , index) in selectCity" :key="index">
  6. <view class="reserve-item" @click.stop="selectProvince">
  7. <view class="reserve-lable">
  8. <text class="reserve-text" v-if="item.label">{{ item.label }}</text>
  9. <text class="reserve-hint" v-else-if="index == 0">--省--</text>
  10. <text class="reserve-hint" v-else-if="index == 1">--市--</text>
  11. <text class="reserve-hint" v-else-if="index == 2">--区/县--</text>
  12. </view>
  13. <view class="reserve-icon iconfont3">&#xe65c;</view>
  14. </view>
  15. </block>
  16. </view>
  17. <view class="card-box">
  18. <block v-for="item in lockList" :key="item.id">
  19. <view class="reserve-card">
  20. <text class="title">{{item.province_name}}-{{item.city_name}}-{{item.area_name}}</text>
  21. <text class="hint">很遗憾此城市区域已被锁定,请您选择其他城市</text>
  22. <text class="status">被锁定</text>
  23. </view>
  24. </block>
  25. <loadMore v-if="lockList.length>0" :status="status"></loadMore>
  26. <nodata v-else :config="{ top: 1, content: '暂无数据~' }"></nodata>
  27. </view>
  28. <u-select v-model="areaShow" mode="mutil-column-auto" :list="provincesList" @confirm="confirmSite"></u-select>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. applyareaagentPage
  34. } from "@/api/personal-center.js"
  35. import selectSite from "./select.vue"
  36. export default {
  37. components: {
  38. selectSite
  39. },
  40. data() {
  41. return {
  42. config: {
  43. back: true, //false是tolbar页面 是则不写
  44. title: '查看被锁定的区县',
  45. color: '#1A1A1A',
  46. // autoBack:true,
  47. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  48. backgroundColor: [1, "#fff"],
  49. statusBarFontColor: '#1A1A1A'
  50. },
  51. areaShow: false,
  52. provincesList: [],
  53. selectCity: [{}, {}, {}],
  54. lockList: [],
  55. params: {
  56. page: 1,
  57. limit: 20
  58. },
  59. status: 'loading', //more|loading|noMore
  60. }
  61. },
  62. created() {
  63. // this.getCode()
  64. },
  65. onShow() {
  66. this.getAddressList();
  67. this.initialize();
  68. },
  69. onLoad() {},
  70. onReachBottom() {
  71. if (this.activeType === 2 && this.status !== 'loading' && this.status !== 'noMore') {
  72. this.params.page++
  73. this.getApplyareaagentPage()
  74. }
  75. },
  76. onPullDownRefresh() {
  77. this.params.page = 1
  78. this.lockList = []
  79. this.getApplyareaagentPage()
  80. },
  81. methods: {
  82. initialize() {
  83. this.params.page = 1;
  84. this.lockList = [];
  85. this.getApplyareaagentPage();
  86. },
  87. getApplyareaagentPage() {
  88. let province_code = this.selectCity[0].value;
  89. let city_code = this.selectCity[1].value;
  90. let area_code = this.selectCity[2].value;
  91. let parms =
  92. `${province_code ? 'province_code=' + province_code + '&' :''}${city_code ? 'city_code=' + city_code + '&' :''}${area_code ? 'area_code=' + area_code + '&' :''}page=${this.params.page}&limit=${this.params.limit}&lock=1`;
  93. this.$http.get(`${applyareaagentPage}?${parms}`).then(res => {
  94. if (res && res.code == 200) {
  95. uni.stopPullDownRefresh()
  96. this.lockList = this.lockList.concat(res.page.list);
  97. if (res.page.totalPage <= res.page.currPage) {
  98. this.status = 'noMore'
  99. } else {
  100. this.status = 'more'
  101. }
  102. }
  103. })
  104. },
  105. //
  106. // 区域代理
  107. lockPosition() {
  108. uni.navigateTo({
  109. url: '/pages/user/regional-agency/lock-position'
  110. })
  111. },
  112. confirmSite(e) {
  113. this.selectCity = e;
  114. this.initialize();
  115. },
  116. //获取地址列表
  117. async getAddressList() {
  118. let req = this.$http.get('/cnarea/tree-lbs', {});
  119. req.then(res => {
  120. console.log('getAddressList = ', res)
  121. this.provincesList = res.tree.children;
  122. })
  123. },
  124. selectProvince() {
  125. this.areaShow = true
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. page {
  132. background-color: #f5f5f5;
  133. }
  134. .select-top {
  135. width: 100%;
  136. height: 136.5rpx;
  137. display: flex;
  138. align-items: center;
  139. padding: 30rpx 60rpx 0;
  140. background-color: #fff;
  141. .reserve-item {
  142. flex: 1 0;
  143. height: 100%;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. border-bottom: 1rpx solid #d9d9d9;
  148. }
  149. .reserve-icon {
  150. flex-shrink: 0;
  151. font-size: 30rpx;
  152. color: #808080;
  153. }
  154. }
  155. .card-box {
  156. width: 100%;
  157. padding: 0 30rpx;
  158. .reserve-card {
  159. margin-top: 30rpx;
  160. padding: 40rpx 30rpx;
  161. background-color: #fff;
  162. border-radius: 12rpx;
  163. display: flex;
  164. flex-direction: column;
  165. position: relative;
  166. .title {
  167. font-size: 28rpx;
  168. font-family: PingFang SC, PingFang SC-Bold;
  169. font-weight: 700;
  170. color: #1a1a1a;
  171. }
  172. .hint {
  173. margin-top: 15rpx;
  174. font-size: 26rpx;
  175. font-family: PingFang SC, PingFang SC-Regular;
  176. font-weight: 400;
  177. color: #333333;
  178. }
  179. .status {
  180. position: absolute;
  181. right: 0;
  182. top: 0;
  183. padding: 11rpx 16rpx;
  184. background: #e7eefc;
  185. border-radius: 0rpx 12rpx 0rpx 12rpx;
  186. font-size: 24rpx;
  187. font-family: PingFang SC, PingFang SC-Regular;
  188. font-weight: 400;
  189. color: #FA6138;
  190. }
  191. }
  192. }
  193. </style>