123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- <!DOCTYPE html>
- <html class="">
- <!--STATUS OK-->
- <head>
- <meta name="referrer" content="always" />
- <meta charset='utf-8' />
- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="x-dns-prefetch-control" content="on">
- <meta name="description" content="">
- <meta name="format-detection" content="telephone=no" />
- <link rel="stylesheet" type="text/css" href="../css/api.css" />
- <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
- <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css">
- <link rel="stylesheet" type="text/css" href="css/main.css" />
- <script type="text/javascript" src="../script/aui-tab.js"></script>
- <script src="js/vue.js"></script>
- <script src="js/vant-ui.js"></script>
- <script src="js/main.js"></script>
- <title></title>
- </head>
- <style>
- .card-main {
- position: relative;
- top: -2.5rem;
- height: 100%
- }
- .card {
- display: flex;
- justify-content: center;
- height: 100%
- }
- .card-left {
- background-color: #EBEBEB;
- width: 1.8rem;
- border-top-left-radius: .3rem;
- }
- .type-list {
- padding: .2rem 0;
- font-size: .3rem;
- display: flex;
- justify-content: center;
- color: #333333;
- }
- .type-active {
- background-color: #fff;
- }
- .card-right {
- background-color: #fff;
- border-top-right-radius: .3rem;
- width: 5.2rem;
- }
- .shop-list {
- display: flex;
- padding: .15rem;
- }
- /*.shop-img {
- width: 1.5rem;
- height: 1.5rem;
- background-color: #000
- }*/
- .shop-list-right {
- display: flex;
- flex-direction: column;
- height: 1.5rem;
- width: 3.4rem;
- justify-content: space-between;
- padding-left: .1rem;
- }
- .shop-title {
- display: flex;
- font-size: .32rem;
- color: #333333;
- }
- .shop-integral {
- display: flex;
- align-items: flex-end;
- }
- .shop-integral-left {
- font-size: .28rem;
- width: 1.4rem;
- color: #666666;
- }
- .shop-integral-right {
- font-size: .28rem;
- color: #FF0000;
- }
- .shop-add {
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- }
- .shop-add-left {
- display: flex;
- font-size: .28rem;
- }
- .shop-add-left input {
- width: .6rem;
- border: 1px solid rgba(229, 229, 229, 1);
- text-align: center;
- }
- .but-sub {
- border-top: 1px solid rgba(229, 229, 229, 1);
- border-left: 1px solid rgba(229, 229, 229, 1);
- border-bottom: 1px solid rgba(229, 229, 229, 1);
- width: .45rem;
- text-align: center;
- border-top-left-radius: .05rem;
- border-bottom-left-radius: .05rem;
- }
- .but-add {
- border-top: 1px solid rgba(229, 229, 229, 1);
- border-right: 1px solid rgba(229, 229, 229, 1);
- border-bottom: 1px solid rgba(229, 229, 229, 1);
- width: .45rem;
- text-align: center;
- border-top-right-radius: .05rem;
- border-bottom-right-radius: .05rem;
- }
- .shop-add-right {
- font-size: .25rem;
- color: #fff;
- background-color: #0098E2;
- padding: .05rem .15rem;
- border-radius: .1rem;
- }
- [v-cloak] {
- display: none;
- }
- </style>
- <body>
- <div id="app">
- <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
- <div>
- <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span> </a>
- <div class="aui-title" id="aui-title">
- 收货地址详情
- </div>
- <div style="display:flex;justify-content:flex-end;align-items:center;margin-right:.3rem;padding-top:.35rem">
- <img src="img/del.png" alt="" style="width:.3rem;height:.3rem" v-on:click="addressDel">
- </div>
- </div>
- </header>
- <div class="login">
- <div class="shouhuodizhiBox">
- <div class="addressTitle flex a-center">
- <div class="icon"></div>
- 联系人
- </div>
- <input type="text" placeholder="" v-model="contactsName">
- <div class="addressTitle flex a-center">
- <div class="icon i2"></div>
- 联系电话
- </div>
- <input type="text" placeholder="" v-model="contactsTel">
- <div v-on:click="chooseAddress">
- <div class="addressTitle flex a-center">
- <div class="icon i3"></div>
- 选择地区
- <i class="iconfont icon-right"></i>
- </div>
- <input type="text" placeholder="" disabled="disabled" v-model="level">
- </div>
- <div class="addressTitle flex a-center">
- <div class="icon i3"></div>
- 详细地址
- </div>
- <input type="text" placeholder="" v-model="address">
- <div style="display:flex;justify-content:space-between;font-size:.24rem;margin:.2rem 0;display:flex;align-items:center">
- <div style="display:flex;align-items:center">
- <div class="icon i3"></div>
- 默认地址
- </div>
- <van-switch v-model="checked" size=".5rem" active-value="1" inactive-value="0" />
- </div>
- </div>
- <div class="addressFooter flex a-center j-center" v-on:click="updateAddress">确认修改</div>
- </div>
- </div>
- </body>
- <link rel="stylesheet" href="./mescroll/mescroll.min.css">
- <script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript" src="../script/httpRequest.js"></script>
- <script type="text/javascript" src="../script/vue_plugins.js"></script>
- <script type="text/javascript">
- function closeWin() {
- api.closeWin({});
- }
- apiready = function() {
- api.parseTapmode();
- var mainId = api.pageParam.mainId;
- var storeId = api.pageParam.storeId;
- var province = api.pageParam.province;
- var city = api.pageParam.city;
- var county = api.pageParam.county;
- var street = api.pageParam.street;
- var contactsName = api.pageParam.contactsName;
- var contactsTel = api.pageParam.contactsTel;
- var address = api.pageParam.address;
- var addressType = api.pageParam.addressType;
- var beDefault = api.pageParam.beDefault;
- var header = $api.byId('aui-header');
- $api.fixStatusBar(header);
- new Vue({
- el: '#app',
- data: {
- pas: '',
- file: 'widget://res/city.json',
- level: province + "-" + city + "-" + "" + county,
- checked: beDefault.toString(),
- mainId: mainId, //主键
- storeId: storeId, //登录loginid
- province: province,
- city: city,
- county: county,
- street: street,
- contactsName: contactsName,
- contactsTel: contactsTel,
- address: address,
- addressType: addressType,
- beDefault: beDefault,
- },
- methods: {
- init: function() {
- this.UIActionSelector = api.require("UIActionSelector");
- },
- chooseAddress: function() {
- var _this = this;
- this.chooseRegion(this.UIActionSelector, 3, this.file, function(ret) {
- _this.level = ret.level1 + '-' + ret.level2 + '-' + ret.level3;
- _this.level1 = ret.level1;
- _this.level2 = ret.level2;
- _this.level3 = ret.level3;
- })
- },
- updateAddress: function() {
- if (!(/^1[3456789]\d{9}$/.test(this.contactsTel))) {
- api.toast({
- msg: '联系手机号格式有误'
- });
- return;
- }
- var params = {
- "mainId": this.mainId,
- "storeId": this.storeId,
- "province": this.level1,
- "city": this.level2,
- "county": this.level3,
- "street": null,
- "contactsName": this.contactsName,
- "contactsTel": this.contactsTel,
- "address": this.address,
- "addressType": "1",
- "beDefault": this.checked,
- "url": 'json',
- "type": 'body'
- },
- _this = this;
- this.$post('updateAddress', params, function(ret) {
- if (ret.code == 0 || ret.code == '0') {
- api.toast({
- msg: '成功修改'
- });
- setTimeout(function() {
- _this.closeWin();
- }, 500)
- api.sendEvent({
- name: 'refreshaddress',
- extra: {}
- });
- }
- });
- },
- addressDel:function(){
- var params = {
- "mainId": this.mainId,
- "url": 'json',
- "type": 'body'
- },
- _this = this;
- this.$post('addressDel', params, function(ret) {
- _this.showModal('温馨提示', '是否确认删除?', ["取消", "确认"], function(res) {
- if (res == 2) {
- if (ret.code == 0 || ret.code == '0') {
- api.toast({
- msg: ret.msg
- });
- setTimeout(function() {
- _this.closeWin();
- }, 500)
- api.sendEvent({
- name: 'refreshaddress',
- extra: {}
- });
- }else {
- _this.showToast("删除失败")
- }
- }
- })
- });
- }
- },
- filters: {
- },
- mounted: function() {
- this.init();
- }
- })
- }
- </script>
- </html>
|