123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <!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/vant-ui.css" />
- <link rel="stylesheet" type="text/css" href="css/iconfont.css">
- <link rel="stylesheet" type="text/css" href="css/main.css" />
- <script src="js/vue.js"></script>
- <script src="js/vant-ui.js"></script>
- <script src="js/main.js"></script>
- <title></title>
- </head>
- <style>
- </style>
- <body>
- <div id="app" v-cloak>
- <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="addAddress">确认提交</div>
- </div>
- </div>
- </body>
- <link rel="stylesheet" href="./mescroll/mescroll.min.css">
- <script type="text/javascript" src="./js/qrcode.min.js"></script>
- <script type="text/javascript" src="../script/aui-scroll.js"></script>
- <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">
- apiready = function() {
- var type = api.pageParam.type;
- new Vue({
- el: '#app',
- data: {
- pas: '',
- type: type,
- file: 'widget://res/city.json',
- level: '',
- checked: 0,
- address: "",
- contactsTel: "",
- contactsName: ""
- },
- methods: {
- init: function() {
- this.UIActionSelector = api.require("UIActionSelector");
- this.storeId = $api.getStorage('userid');
- },
- 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;
- })
- },
- // 添加地址
- addAddress: function() {
- if (this.contactsName == '') {
- api.toast({
- msg: '请完善联系人'
- });
- return;
- }
- if (this.contactsTel == '') {
- api.toast({
- msg: '请完善联系电话'
- });
- return;
- }
- if (!(/^1[3456789]\d{9}$/.test(this.contactsTel))) {
- api.toast({
- msg: '联系手机号格式有误'
- });
- return;
- }
- if (this.level1 == ''||this.level2 == ''||this.level3 == '') {
- api.toast({
- msg: '请完善选择地区'
- });
- return;
- }
- if (this.address == '') {
- api.toast({
- msg: '请完善详细地址'
- });
- return;
- }
- var params = {
- "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('addAddressU', params, function(ret) {
- if (ret.code == 0 || ret.code == '0') {
- api.toast({
- msg: '成功提交'
- });
- setTimeout(function() {
- _this.closeWin();
- }, 500)
- api.sendEvent({
- name: 'refreshaddress',
- extra: {}
- });
- }
- });
- }
- },
- filters: {
- },
- mounted: function() {
- this.init();
- }
- })
- }
- </script>
- </html>
|