address_new_body.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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: #eeeeee;
  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. }
  36. .mescroll{
  37. position: relative;
  38. height: 100%;
  39. }
  40. </style>
  41. <body>
  42. <div id="app" v-cloak>
  43. <div class="pageView jingxiaoshangliebiao flex col mescroll-touch-y mescroll" id="mescroll">
  44. <div class="listbox" v-show="list.length > 0" >
  45. <ul>
  46. <!-- <van-radio-group v-model="radio" v-on:change="onChange" > -->
  47. <li v-for="(item,index) in list" :key="index" style="display:flex">
  48. <!-- <van-radio :name="index" > </van-radio> -->
  49. <div style="width:80%;margin-left: .1rem" v-on:click="getitem(index)" >
  50. <h4 style="font-size:.28rem;">{{item.contactsName}} </h4>
  51. <p style="font-size:.26rem;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width:5rem;">{{item.province}} {{item.city}} {{item.county}} {{item.address}}</p>
  52. </div>
  53. <div class="infoRadios" style="display:flex;justify-content: center;align-items: center">
  54. <span style="font-size:.26rem" v-on:click="fixaddress(item)">编辑</span>
  55. </div>
  56. </li>
  57. <!-- </van-radio-group> -->
  58. </ul>
  59. </div>
  60. <div v-show="list.length == 0" style="text-align:center">
  61. <img src="./image/noData.png" style="margin:2rem auto" />
  62. </div>
  63. </div>
  64. </div>
  65. </body>
  66. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  67. <script type="text/javascript" src="./js/qrcode.min.js"></script>
  68. <script type="text/javascript" src="../script/aui-scroll.js"></script>
  69. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  70. <script type="text/javascript" src="../script/api.js"></script>
  71. <script type="text/javascript" src="../script/httpRequest.js"></script>
  72. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  73. <script type="text/javascript">
  74. apiready = function() {
  75. new Vue({
  76. el: '#app',
  77. data: {
  78. radio: '',
  79. list: '',
  80. loginid: '',
  81. current: 1,
  82. size: 11,
  83. frist: 1,
  84. totalPages: 1,
  85. mescroll: '',
  86. hasOther: false,
  87. },
  88. methods: {
  89. init: function() {
  90. this.storeId = $api.getStorage('userid');
  91. this.getAddressList();
  92. _this=this;
  93. this.addEvent("refreshaddress", function() {
  94. _this.getAddressList();
  95. });
  96. },
  97. /**
  98. * 配置上拉加载下拉刷新
  99. */
  100. configs: function() {
  101. var _this = this;
  102. this.frist = 2;
  103. this.configDownAndPull("mescroll", function(mescroll) {
  104. _this.current = 1;
  105. _this.mescroll = mescroll;
  106. _this.getAddressList(mescroll);
  107. }, function(mescroll) {
  108. if (_this.current < _this.totalPages) {
  109. _this.current = _this.current + 1;
  110. _this.getAddressList(mescroll, 1);
  111. } else {
  112. mescroll.endSuccess(_this.size, false);
  113. }
  114. })
  115. },
  116. addMore: function() {
  117. var _this = this;
  118. if (_this.current < _this.totalPages) {
  119. _this.current = _this.current + 1;
  120. _this.getAddressList(_this.mescroll, 1);
  121. } else {
  122. _this.hasOther = true;
  123. }
  124. },
  125. /**
  126. * 获取地址列表
  127. */
  128. getAddressList: function(mescroll) {
  129. var url = "getAddressListU",
  130. _this = this;
  131. var data = {
  132. storeId: this.storeId,
  133. current: this.current,
  134. size: this.size,
  135. url: 'json',
  136. type: 'body'
  137. }
  138. this.$post(url, data, function(ret) {
  139. if (ret.code == 0 || ret.code == '0') {
  140. _this.totalPages = ret.page.pages;
  141. _this.list= _this.current == 1 ? ret.page.records : _this.list.concat(ret.page.records);
  142. if (mescroll) {
  143. mescroll.endSuccess(_this.size, true);
  144. }
  145. if (_this.frist == 1) {
  146. _this.$nextTick(function() {
  147. _this.configs();
  148. })
  149. }
  150. }
  151. })
  152. },
  153. getitem:function(index){
  154. api.sendEvent({
  155. name: 'refresh_order_address',
  156. extra: this.list[index]
  157. });
  158. //.radio= event.detail;
  159. api.closeWin({
  160. });
  161. },
  162. fixaddress: function(item) {
  163. this.goWin('addressfix', 'addressfix_body.html', {
  164. mainId: item.mainId, //主键
  165. storeId: item.storeId, //登录loginid
  166. province: item.province,
  167. city: item.city,
  168. county:item.county,
  169. street: item.street,
  170. contactsName: item.contactsName,
  171. contactsTel: item.contactsTel,
  172. address: item.address,
  173. addressType: 1,
  174. beDefault: item.beDefault,
  175. });
  176. api.sendEvent({
  177. name: 'refreshaddressfix',
  178. extra: {}
  179. });
  180. }
  181. },
  182. mounted: function() {
  183. this.init();
  184. }
  185. })
  186. }
  187. </script>
  188. </html>