address_body.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <title></title>
  18. </head>
  19. <style>
  20. .jingxiaoshangliebiao {
  21. background-color: #fff;
  22. }
  23. .jingxiaoshangliebiao .listbox ul li {
  24. background-color: #00a0ea;
  25. }
  26. .jingxiaoshangliebiao .listbox ul li h4 {
  27. color: #fff;
  28. }
  29. .jingxiaoshangliebiao .listbox ul li span {
  30. color: #fff;
  31. }
  32. .line {
  33. width: 1px;
  34. height: 0.8rem;
  35. background-color: #fff;
  36. }
  37. .mescroll{
  38. position: relative;
  39. height: 100%;
  40. }
  41. </style>
  42. <body>
  43. <div id="app">
  44. <div class="pageView jingxiaoshangliebiao flex col mescroll-touch-y mescroll" id="mescroll">
  45. <div class="listbox" v-show="list.length > 0" >
  46. <ul>
  47. <!-- <van-radio-group v-model="radio"> -->
  48. <li v-for="(item,index) in list" :key="index" style="display:flex">
  49. <!-- <van-radio :name="item"> -->
  50. <div class="infoRadios" style="width:85%">
  51. <h4 style="font-size:.28rem;">{{item.contactsName}}</h4>
  52. <p style="font-size:.26rem;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width:5rem;color:#fff">{{item.province}} {{item.city}} {{item.county}} {{item.address}}</p>
  53. </div>
  54. <div class="infoRadios" style="display:flex">
  55. <div class="line"></div>
  56. <span style="margin: 0.2rem;font-size:.26rem" v-on:click="fixaddress(item)">编辑</span>
  57. </div>
  58. <!-- </van-radio> -->
  59. </li>
  60. <!-- </van-radio-group> -->
  61. </ul>
  62. </div>
  63. <div v-show="list.length == 0" style="text-align:center">
  64. <img src="./image/noData.png" style="margin:2rem auto" />
  65. </div>
  66. </div>
  67. </div>
  68. </body>
  69. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  70. <script type="text/javascript" src="./js/qrcode.min.js"></script>
  71. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  72. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  73. <script type="text/javascript" src="../script/api.js"></script>
  74. <script type="text/javascript" src="../script/httpRequest.js"></script>
  75. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  76. <script type="text/javascript">
  77. apiready = function() {
  78. new Vue({
  79. el: '#app',
  80. data: {
  81. radio: '1',
  82. list: '',
  83. loginid: '',
  84. current: 1,
  85. size: 11,
  86. frist: 1,
  87. totalPages: 1,
  88. mescroll: '',
  89. hasOther: false,
  90. },
  91. methods: {
  92. init: function() {
  93. this.storeId = $api.getStorage('userid');
  94. this.getAddressList();
  95. _this=this;
  96. this.addEvent("refreshaddress", function() {
  97. _this.getAddressList();
  98. });
  99. },
  100. /**
  101. * 配置上拉加载下拉刷新
  102. */
  103. configs: function() {
  104. var _this = this;
  105. this.frist = 2;
  106. this.configDownAndPull("mescroll", function(mescroll) {
  107. _this.current = 1;
  108. _this.mescroll = mescroll;
  109. _this.getAddressList(mescroll);
  110. }, function(mescroll) {
  111. if (_this.current < _this.totalPages) {
  112. _this.current = _this.current + 1;
  113. _this.getAddressList(mescroll, 1);
  114. } else {
  115. mescroll.endSuccess(_this.size, false);
  116. }
  117. })
  118. },
  119. addMore: function() {
  120. var _this = this;
  121. if (_this.current < _this.totalPages) {
  122. _this.current = _this.current + 1;
  123. _this.getAddressList(_this.mescroll, 1);
  124. } else {
  125. _this.hasOther = true;
  126. }
  127. },
  128. /**
  129. * 获取地址列表
  130. */
  131. getAddressList: function(mescroll) {
  132. var url = "getAddressListU",
  133. _this = this;
  134. var data = {
  135. storeId: this.storeId,
  136. current: this.current,
  137. size: this.size,
  138. url: 'json',
  139. type: 'body'
  140. }
  141. this.$post(url, data, function(ret) {
  142. if (ret.code == 0 || ret.code == '0') {
  143. _this.totalPages = ret.page.pages;
  144. _this.list= _this.current == 1 ? ret.page.records : _this.list.concat(ret.page.records);
  145. if (mescroll) {
  146. mescroll.endSuccess(_this.size, true);
  147. }
  148. if (_this.frist == 1) {
  149. _this.$nextTick(function() {
  150. _this.configs();
  151. })
  152. }
  153. }
  154. })
  155. },
  156. fixaddress: function(item) {
  157. this.goWin('addressfix', 'addressfix_body.html', {
  158. mainId: item.mainId, //主键
  159. storeId: item.storeId, //登录loginid
  160. province: item.province,
  161. city: item.city,
  162. county:item.county,
  163. street: item.street,
  164. contactsName: item.contactsName,
  165. contactsTel: item.contactsTel,
  166. address: item.address,
  167. addressType: 1,
  168. beDefault: item.beDefault,
  169. });
  170. api.sendEvent({
  171. name: 'refreshaddressfix',
  172. extra: {}
  173. });
  174. }
  175. },
  176. mounted: function() {
  177. this.init();
  178. }
  179. })
  180. }
  181. </script>
  182. </html>