addressfix_body.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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/api.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
  13. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  14. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  15. <link rel="stylesheet" type="text/css" href="css/main.css" />
  16. <script type="text/javascript" src="../script/aui-tab.js"></script>
  17. <script src="js/vue.js"></script>
  18. <script src="js/vant-ui.js"></script>
  19. <script src="js/main.js"></script>
  20. <title></title>
  21. </head>
  22. <style>
  23. .card-main {
  24. position: relative;
  25. top: -2.5rem;
  26. height: 100%
  27. }
  28. .card {
  29. display: flex;
  30. justify-content: center;
  31. height: 100%
  32. }
  33. .card-left {
  34. background-color: #EBEBEB;
  35. width: 1.8rem;
  36. border-top-left-radius: .3rem;
  37. }
  38. .type-list {
  39. padding: .2rem 0;
  40. font-size: .3rem;
  41. display: flex;
  42. justify-content: center;
  43. color: #333333;
  44. }
  45. .type-active {
  46. background-color: #fff;
  47. }
  48. .card-right {
  49. background-color: #fff;
  50. border-top-right-radius: .3rem;
  51. width: 5.2rem;
  52. }
  53. .shop-list {
  54. display: flex;
  55. padding: .15rem;
  56. }
  57. /*.shop-img {
  58. width: 1.5rem;
  59. height: 1.5rem;
  60. background-color: #000
  61. }*/
  62. .shop-list-right {
  63. display: flex;
  64. flex-direction: column;
  65. height: 1.5rem;
  66. width: 3.4rem;
  67. justify-content: space-between;
  68. padding-left: .1rem;
  69. }
  70. .shop-title {
  71. display: flex;
  72. font-size: .32rem;
  73. color: #333333;
  74. }
  75. .shop-integral {
  76. display: flex;
  77. align-items: flex-end;
  78. }
  79. .shop-integral-left {
  80. font-size: .28rem;
  81. width: 1.4rem;
  82. color: #666666;
  83. }
  84. .shop-integral-right {
  85. font-size: .28rem;
  86. color: #FF0000;
  87. }
  88. .shop-add {
  89. display: flex;
  90. align-items: flex-end;
  91. justify-content: space-between;
  92. }
  93. .shop-add-left {
  94. display: flex;
  95. font-size: .28rem;
  96. }
  97. .shop-add-left input {
  98. width: .6rem;
  99. border: 1px solid rgba(229, 229, 229, 1);
  100. text-align: center;
  101. }
  102. .but-sub {
  103. border-top: 1px solid rgba(229, 229, 229, 1);
  104. border-left: 1px solid rgba(229, 229, 229, 1);
  105. border-bottom: 1px solid rgba(229, 229, 229, 1);
  106. width: .45rem;
  107. text-align: center;
  108. border-top-left-radius: .05rem;
  109. border-bottom-left-radius: .05rem;
  110. }
  111. .but-add {
  112. border-top: 1px solid rgba(229, 229, 229, 1);
  113. border-right: 1px solid rgba(229, 229, 229, 1);
  114. border-bottom: 1px solid rgba(229, 229, 229, 1);
  115. width: .45rem;
  116. text-align: center;
  117. border-top-right-radius: .05rem;
  118. border-bottom-right-radius: .05rem;
  119. }
  120. .shop-add-right {
  121. font-size: .25rem;
  122. color: #fff;
  123. background-color: #0098E2;
  124. padding: .05rem .15rem;
  125. border-radius: .1rem;
  126. }
  127. [v-cloak] {
  128. display: none;
  129. }
  130. </style>
  131. <body>
  132. <div id="app">
  133. <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
  134. <div>
  135. <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span> </a>
  136. <div class="aui-title" id="aui-title">
  137. 收货地址详情
  138. </div>
  139. <div style="display:flex;justify-content:flex-end;align-items:center;margin-right:.3rem;padding-top:.35rem">
  140. <img src="img/del.png" alt="" style="width:.3rem;height:.3rem" v-on:click="addressDel">
  141. </div>
  142. </div>
  143. </header>
  144. <div class="login">
  145. <div class="shouhuodizhiBox">
  146. <div class="addressTitle flex a-center">
  147. <div class="icon"></div>
  148. 联系人
  149. </div>
  150. <input type="text" placeholder="" v-model="contactsName">
  151. <div class="addressTitle flex a-center">
  152. <div class="icon i2"></div>
  153. 联系电话
  154. </div>
  155. <input type="text" placeholder="" v-model="contactsTel">
  156. <div v-on:click="chooseAddress">
  157. <div class="addressTitle flex a-center">
  158. <div class="icon i3"></div>
  159. 选择地区
  160. <i class="iconfont icon-right"></i>
  161. </div>
  162. <input type="text" placeholder="" disabled="disabled" v-model="level">
  163. </div>
  164. <div class="addressTitle flex a-center">
  165. <div class="icon i3"></div>
  166. 详细地址
  167. </div>
  168. <input type="text" placeholder="" v-model="address">
  169. <div style="display:flex;justify-content:space-between;font-size:.24rem;margin:.2rem 0;display:flex;align-items:center">
  170. <div style="display:flex;align-items:center">
  171. <div class="icon i3"></div>
  172. 默认地址
  173. </div>
  174. <van-switch v-model="checked" size=".5rem" active-value="1" inactive-value="0" />
  175. </div>
  176. </div>
  177. <div class="addressFooter flex a-center j-center" v-on:click="updateAddress">确认修改</div>
  178. </div>
  179. </div>
  180. </body>
  181. <link rel="stylesheet" href="./mescroll/mescroll.min.css">
  182. <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
  183. <script type="text/javascript" src="../script/api.js"></script>
  184. <script type="text/javascript" src="../script/httpRequest.js"></script>
  185. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  186. <script type="text/javascript">
  187. function closeWin() {
  188. api.closeWin({});
  189. }
  190. apiready = function() {
  191. api.parseTapmode();
  192. var mainId = api.pageParam.mainId;
  193. var storeId = api.pageParam.storeId;
  194. var province = api.pageParam.province;
  195. var city = api.pageParam.city;
  196. var county = api.pageParam.county;
  197. var street = api.pageParam.street;
  198. var contactsName = api.pageParam.contactsName;
  199. var contactsTel = api.pageParam.contactsTel;
  200. var address = api.pageParam.address;
  201. var addressType = api.pageParam.addressType;
  202. var beDefault = api.pageParam.beDefault;
  203. var header = $api.byId('aui-header');
  204. $api.fixStatusBar(header);
  205. new Vue({
  206. el: '#app',
  207. data: {
  208. pas: '',
  209. file: 'widget://res/city.json',
  210. level: province + "-" + city + "-" + "" + county,
  211. checked: beDefault.toString(),
  212. mainId: mainId, //主键
  213. storeId: storeId, //登录loginid
  214. province: province,
  215. city: city,
  216. county: county,
  217. street: street,
  218. contactsName: contactsName,
  219. contactsTel: contactsTel,
  220. address: address,
  221. addressType: addressType,
  222. beDefault: beDefault,
  223. },
  224. methods: {
  225. init: function() {
  226. this.UIActionSelector = api.require("UIActionSelector");
  227. },
  228. chooseAddress: function() {
  229. var _this = this;
  230. this.chooseRegion(this.UIActionSelector, 3, this.file, function(ret) {
  231. _this.level = ret.level1 + '-' + ret.level2 + '-' + ret.level3;
  232. _this.level1 = ret.level1;
  233. _this.level2 = ret.level2;
  234. _this.level3 = ret.level3;
  235. })
  236. },
  237. updateAddress: function() {
  238. if (!(/^1[3456789]\d{9}$/.test(this.contactsTel))) {
  239. api.toast({
  240. msg: '联系手机号格式有误'
  241. });
  242. return;
  243. }
  244. var params = {
  245. "mainId": this.mainId,
  246. "storeId": this.storeId,
  247. "province": this.level1,
  248. "city": this.level2,
  249. "county": this.level3,
  250. "street": null,
  251. "contactsName": this.contactsName,
  252. "contactsTel": this.contactsTel,
  253. "address": this.address,
  254. "addressType": "1",
  255. "beDefault": this.checked,
  256. "url": 'json',
  257. "type": 'body'
  258. },
  259. _this = this;
  260. this.$post('updateAddress', params, function(ret) {
  261. if (ret.code == 0 || ret.code == '0') {
  262. api.toast({
  263. msg: '成功修改'
  264. });
  265. setTimeout(function() {
  266. _this.closeWin();
  267. }, 500)
  268. api.sendEvent({
  269. name: 'refreshaddress',
  270. extra: {}
  271. });
  272. }
  273. });
  274. },
  275. addressDel:function(){
  276. var params = {
  277. "mainId": this.mainId,
  278. "url": 'json',
  279. "type": 'body'
  280. },
  281. _this = this;
  282. this.$post('addressDel', params, function(ret) {
  283. _this.showModal('温馨提示', '是否确认删除?', ["取消", "确认"], function(res) {
  284. if (res == 2) {
  285. if (ret.code == 0 || ret.code == '0') {
  286. api.toast({
  287. msg: ret.msg
  288. });
  289. setTimeout(function() {
  290. _this.closeWin();
  291. }, 500)
  292. api.sendEvent({
  293. name: 'refreshaddress',
  294. extra: {}
  295. });
  296. }else {
  297. _this.showToast("删除失败")
  298. }
  299. }
  300. })
  301. });
  302. }
  303. },
  304. filters: {
  305. },
  306. mounted: function() {
  307. this.init();
  308. }
  309. })
  310. }
  311. </script>
  312. </html>