You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
17 KiB
1 lines
17 KiB
{"version":3,"sources":["uni-app:///main.js","webpack:///C:/Users/Administrator/Desktop/上门按摩/uniapp/user/pages/address/edit.vue?ec6a","webpack:///C:/Users/Administrator/Desktop/上门按摩/uniapp/user/pages/address/edit.vue?e0fd","webpack:///C:/Users/Administrator/Desktop/上门按摩/uniapp/user/pages/address/edit.vue?0e97","webpack:///C:/Users/Administrator/Desktop/上门按摩/uniapp/user/pages/address/edit.vue?d9e4","uni-app:///user/pages/address/edit.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page","components","data","isLoad","options","textArr","text","type","form","id","user_name","mobile","address","address_info","lng","lat","status","rule","name","checkType","errorMsg","regType","lockTap","computed","primaryColor","subColor","location","onLoad","methods","initIndex","uni","title","bg","toChooseLocation","addrLat","addrLng","locaLat","locaLng","param","longitude","latitude","toDel","content","res_del","confirm","check_id","key","val","setTimeout","url","openType","validate","item","submit","msg","methodModel"],"mappings":";;;;;;;;;;;;;AAAA;AAGA;AACA;AAHA;AACAA,EAAE,CAACC,iCAAiC,GAAGC,mBAAmB;AAG1DC,UAAU,CAACC,aAAI,CAAC,C;;;;;;;;;;;;;ACLhB;AAAA;AAAA;AAAA;AAAA;AAAiH;AACjH;AACwD;AACL;;;AAGnD;AAC6M;AAC7M,gBAAgB,iNAAU;AAC1B,EAAE,0EAAM;AACR,EAAE,+EAAM;AACR,EAAE,wFAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,mFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACtBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACdA;AAAA;AAAA;AAAA;AAAmzB,CAAgB,kyBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;ACoDv0B;AAGA;AAAA;AAAA,eACA;EACAC;EACAC;IACA;MACAC;MACAC;MACAC;QACAC;QACAC;MACA;QACAD;QACAC;MACA;MACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;MACA;MACAC;QACAC;QACAC;QACAC;QACAC;MACA;QACAH;QACAC;QACAC;MACA,GACA;QACAF;QACAC;QACAC;MACA,GACA;QACAF;QACAC;QACAC;QACAC;MACA,EACA;MACAC;IACA;EACA;EACAC;IACAC;MAAA;IAAA;IACAC;MAAA;IAAA;IACAC;MAAA;IAAA;EACA;EACAC;IACA;IACA;EACA;EACAC,yCACA;IACAC;MAAA;MAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA,mBAWA,cADApB;gBAEAqB;kBACAC;gBACA;gBAAA,IACAtB;kBAAA;kBAAA;gBAAA;gBACA;gBACA;gBACA;kBACAuB;gBACA;gBAAA;cAAA;gBAAA;gBAAA,OAGA;kBACAvB;gBACA;cAAA;gBAFAP;gBAGA;kBACA;gBACA;gBACA;kBACA8B;gBACA;gBACA;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA;IACA;IACA;IACAC;MAAA;MAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACA;kBACA1B;gBACA;cAAA;gBAAA,kBAIA,uDAFAQ,gHACAD;gBAAA,cAMA,0CAHAL,yDACAyB,2BACAC;gBAGA;kBACAC;kBACAC;gBACA;gBAEAC;gBACA,2BAkBA;gBAAA;gBAAA,OAaAR;cAAA;gBAAA;gBAAA;gBAAA;gBAAA,gDAJAlB;gBAAAA;gBACA2B;gBACAC;gBACAtB;gBAAA,IAEAN;kBAAA;kBAAA;gBAAA;gBAAA;cAAA;gBACA;gBACA;gBACA;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA;IACA;IACA6B;MAAA;MAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAGAX;kBACAC;kBACAW;gBACA;cAAA;gBAAA;gBAAA;gBALAC;gBACAC;gBAAA,IAKAA;kBAAA;kBAAA;gBAAA;gBAAA;cAAA;gBAEAnC,KACA,YADAA;gBAAA,uBAIA,0BADAoC;gBAAA,KAEA;kBAAA;kBAAA;gBAAA;gBAAA;cAAA;gBACA;gBACA;gBAAA;gBAAA;gBAAA,OAEA;kBACApC;gBACA;cAAA;gBACA;gBACA;kBACAsB;gBACA;gBACA;gBACA;kBACA;oBACAe;oBACAC;kBACA;gBACA;gBACAC;kBACA;kBACA;oBACAC;oBACAC;kBACA;gBACA;gBAAA;gBAAA;cAAA;gBAAA;gBAAA;gBAEAF;kBACA;kBACA;gBACA;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA;IAEA;IACA;IACAG;MACA;MACA;QACA,IACAjC,OACAkC,KADAlC;QAEAiC;MACA;MACA;MACA;IACA;IACAE;MAAA;MAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACAf;gBACAgB;gBAAA,KACAA;kBAAA;kBAAA;gBAAA;gBACA;kBACAvB;gBACA;gBAAA;cAAA;gBAAA,KAGA;kBAAA;kBAAA;gBAAA;gBAAA;cAAA;gBACA;gBACA;gBAAA;gBAEAwB;gBAAA;gBAAA,OACA;cAAA;gBACA;gBACA;kBACAxB;gBACA;gBACAiB;kBACA;kBACA;oBACAC;oBACAC;kBACA;gBACA;gBAAA;gBAAA;cAAA;gBAAA;gBAAA;gBAEAF;kBACA;kBACA;gBACA;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA;IAEA;EAAA;AAEA;AAAA,2B","file":"user/pages/address/edit.js","sourcesContent":["import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './user/pages/address/edit.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./edit.vue?vue&type=template&id=7147a356&\"\nvar renderjs\nimport script from \"./edit.vue?vue&type=script&lang=js&\"\nexport * from \"./edit.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"user/pages/address/edit.vue\"\nexport default component.exports","export * from \"-!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--17-0!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./edit.vue?vue&type=template&id=7147a356&\"","var components\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n if (!_vm._isMounted) {\n _vm.e0 = function ($event) {\n $event.stopPropagation()\n _vm.form.status = _vm.form.status == 1 ? 0 : 1\n }\n }\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./edit.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Downloads/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./edit.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"apply-pages\" v-if=\"isLoad\">\r\n\t\t<view class=\"apply-form pl-lg pr-lg\">\r\n\t\t\t<view class=\"fill-base mt-md radius-16\">\r\n\t\t\t\t<view class=\"flex-between ml-lg mr-lg b-1px-b\">\r\n\t\t\t\t\t<view class=\"item-text\">联系人</view>\r\n\t\t\t\t\t<input v-model=\"form.user_name\" type=\"text\" class=\"item-input flex-1\" maxlength=\"20\"\r\n\t\t\t\t\t\t:placeholder=\"rule[0].errorMsg\" />\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"flex-between ml-lg mr-lg\">\r\n\t\t\t\t\t<view class=\"item-text\">手机号</view>\r\n\t\t\t\t\t<input v-model=\"form.mobile\" type=\"text\" class=\"item-input flex-1\"\r\n\t\t\t\t\t\t:placeholder=\"rule[1].errorMsg\" />\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"fill-base mt-md radius-16\">\r\n\t\t\t\t<view class=\"flex-between ml-lg mr-lg b-1px-b\">\r\n\t\t\t\t\t<view class=\"item-text\">选择地区</view>\r\n\t\t\t\t\t<view @tap.stop=\"toChooseLocation\" class=\"item-input text flex-1\">\r\n\t\t\t\t\t\t<view class=\"flex-y-center text-right\">\r\n\t\t\t\t\t\t\t<view class=\"flex-1 text-right\">{{form.address || `点击右边图标设置`}}</view><i\r\n\t\t\t\t\t\t\t\tclass=\"iconfont iconjuli ml-sm\" :style=\"{color: primaryColor}\"></i>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t\t<view class=\"flex-between ml-lg mr-lg\">\r\n\t\t\t\t\t<view class=\"item-text\">详细地址</view>\r\n\t\t\t\t\t<input v-model=\"form.address_info\" type=\"text\" class=\"item-input flex-1\"\r\n\t\t\t\t\t\t:placeholder=\"rule[3].errorMsg\" />\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"fill-base mt-md radius-16\">\r\n\t\t\t\t<view class=\"flex-between ml-lg mr-lg\">\r\n\t\t\t\t\t<view class=\"item-text flex-1\" style=\"width: 300rpx;\">设为默认地址</view>\r\n\t\t\t\t\t<!-- status 1默认; -->\r\n\t\t\t\t\t<view @tap.stop=\"form.status = form.status ==1 ? 0 : 1\" class=\"item-input\">\r\n\t\t\t\t\t\t<i class=\"iconfont icon-switch\" :class=\"[{'icon-switch-on':form.status==1}]\"\r\n\t\t\t\t\t\t\t:style=\"{color:form.status==1? primaryColor:'#f2f2f2'}\"></i>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"f-icontext c-caption mt-md\"> 设置后,下单时优先展示该地址</view>\r\n\t\t</view>\r\n\r\n\t\t<view class=\"space-max-footer\"></view>\r\n\r\n\t\t<fix-bottom-button @cancel=\"toDel\" @confirm=\"submit\" :text=\"textArr\" bgColor=\"#fff\"></fix-bottom-button>\r\n\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport {\r\n\t\tmapState,\r\n\t\tmapMutations\r\n\t} from \"vuex\"\r\n\texport default {\r\n\t\tcomponents: {},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tisLoad: false,\r\n\t\t\t\toptions: {},\r\n\t\t\t\ttextArr: [{\r\n\t\t\t\t\ttext: '删除',\r\n\t\t\t\t\ttype: 'cancel'\r\n\t\t\t\t}, {\r\n\t\t\t\t\ttext: '保存',\r\n\t\t\t\t\ttype: 'confirm'\r\n\t\t\t\t}],\r\n\t\t\t\tform: {\r\n\t\t\t\t\tid: 0,\r\n\t\t\t\t\tuser_name: '',\r\n\t\t\t\t\tmobile: '',\r\n\t\t\t\t\taddress: '',\r\n\t\t\t\t\taddress_info: '',\r\n\t\t\t\t\tlng: '',\r\n\t\t\t\t\tlat: '',\r\n\t\t\t\t\tstatus: 0\r\n\t\t\t\t},\r\n\t\t\t\trule: [{\r\n\t\t\t\t\t\tname: \"user_name\",\r\n\t\t\t\t\t\tcheckType: \"isNotNull\",\r\n\t\t\t\t\t\terrorMsg: \"输入联系人姓名\",\r\n\t\t\t\t\t\tregType: 2\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\tname: \"mobile\",\r\n\t\t\t\t\t\tcheckType: \"isMobile\",\r\n\t\t\t\t\t\terrorMsg: \"输入手机号\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"address\",\r\n\t\t\t\t\t\tcheckType: \"isNotNull\",\r\n\t\t\t\t\t\terrorMsg: \"设置地区\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tname: \"address_info\",\r\n\t\t\t\t\t\tcheckType: \"isNotNull\",\r\n\t\t\t\t\t\terrorMsg: \"输入街道、楼牌号等\",\r\n\t\t\t\t\t\tregType: 2\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t\tlockTap: false\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed: mapState({\r\n\t\t\tprimaryColor: state => state.config.configInfo.primaryColor,\r\n\t\t\tsubColor: state => state.config.configInfo.subColor,\r\n\t\t\tlocation: state => state.user.location,\r\n\t\t}),\r\n\t\tonLoad(options) {\r\n\t\t\tthis.options = options\r\n\t\t\tthis.initIndex()\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\t...mapMutations(['updateUserItem', 'updateOrderItem']),\r\n\t\t\tasync initIndex() {\r\n\t\t\t\t// #ifdef H5\r\n\t\t\t\tif (this.$jweixin.isWechat()) {\r\n\t\t\t\t\tawait this.$jweixin.initJssdk();\r\n\t\t\t\t\tthis.$jweixin.wxReady(() => {\r\n\t\t\t\t\t\tthis.$jweixin.hideOptionMenu()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\t// #endif\r\n\t\t\t\tlet {\r\n\t\t\t\t\tid = 0\r\n\t\t\t\t} = this.options\r\n\t\t\t\tuni.setNavigationBarTitle({\r\n\t\t\t\t\ttitle: id ? `编辑地址` : `添加新地址`\r\n\t\t\t\t})\r\n\t\t\t\tif (!id) {\r\n\t\t\t\t\tthis.textArr.splice(0, 1)\r\n\t\t\t\t\tthis.isLoad = true\r\n\t\t\t\t\tthis.$util.setNavigationBarColor({\r\n\t\t\t\t\t\tbg: this.primaryColor\r\n\t\t\t\t\t})\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\tlet data = await this.$api.mine.addressInfo({\r\n\t\t\t\t\tid\r\n\t\t\t\t})\r\n\t\t\t\tfor (let key in this.form) {\r\n\t\t\t\t\tthis.form[key] = data[key]\r\n\t\t\t\t}\r\n\t\t\t\tthis.$util.setNavigationBarColor({\r\n\t\t\t\t\tbg: this.primaryColor\r\n\t\t\t\t})\r\n\t\t\t\tthis.isLoad = true\r\n\t\t\t},\r\n\t\t\t// 选择地区\r\n\t\t\tasync toChooseLocation(e) {\r\n\t\t\t\tawait this.$util.checkAuth({\r\n\t\t\t\t\ttype: 'userLocation'\r\n\t\t\t\t})\r\n\t\t\t\tlet {\r\n\t\t\t\t\tlat: locaLat = '',\r\n\t\t\t\t\tlng: locaLng = ''\r\n\t\t\t\t} = this.location\r\n\t\t\t\tlet {\r\n\t\t\t\t\tid = 0,\r\n\t\t\t\t\t\tlat: addrLat,\r\n\t\t\t\t\t\tlng: addrLng\r\n\t\t\t\t} = this.form\r\n\r\n\t\t\t\tif (id) {\r\n\t\t\t\t\tlocaLat = addrLat\r\n\t\t\t\t\tlocaLng = addrLng\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet param = {}\r\n\t\t\t\tif (!locaLat && !locaLng) {\r\n\t\t\t\t\t// #ifdef H5\r\n\t\t\t\t\tif (this.$jweixin.isWechat()) {\r\n\t\t\t\t\t\tthis.$util.showLoading()\r\n\t\t\t\t\t\tawait this.$jweixin.wxReady2();\r\n\t\t\t\t\t\tlet {\r\n\t\t\t\t\t\t\tlatitude,\r\n\t\t\t\t\t\t\tlongitude\r\n\t\t\t\t\t\t} = await this.$jweixin.getWxLocation()\r\n\t\t\t\t\t\tlocaLat = latitude\r\n\t\t\t\t\t\tlocaLng = longitude\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// #endif\r\n\t\t\t\t\t// #ifdef APP-PLUS\r\n\t\t\t\t\tlet location = await this.$util.getBmapLocation()\r\n\t\t\t\t\tlocaLat = location.lat\r\n\t\t\t\t\tlocaLng = location.lng\r\n\t\t\t\t\t// #endif\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// #ifndef MP-WEIXIN\r\n\t\t\t\tparam = {\r\n\t\t\t\t\tlatitude: locaLat,\r\n\t\t\t\t\tlongitude: locaLng\r\n\t\t\t\t}\r\n\t\t\t\t// #endif\r\n\t\t\t\tlet [, {\r\n\t\t\t\t\taddress = '',\r\n\t\t\t\t\tlongitude,\r\n\t\t\t\t\tlatitude,\r\n\t\t\t\t\tname\r\n\t\t\t\t}] = await uni.chooseLocation(param);\r\n\t\t\t\tif (!address) return\r\n\t\t\t\tthis.form.address = address\r\n\t\t\t\tthis.form.lng = longitude\r\n\t\t\t\tthis.form.lat = latitude\r\n\t\t\t},\r\n\t\t\tasync toDel() {\r\n\t\t\t\tlet [res_del, {\r\n\t\t\t\t\tconfirm\r\n\t\t\t\t}] = await uni.showModal({\r\n\t\t\t\t\ttitle: '提示',\r\n\t\t\t\t\tcontent: \"请确认是否要删除此数据?\"\r\n\t\t\t\t})\r\n\t\t\t\tif (!confirm) return;\r\n\t\t\t\tlet {\r\n\t\t\t\t\tid\r\n\t\t\t\t} = this.form\r\n\t\t\t\tlet {\r\n\t\t\t\t\tcheck_id\r\n\t\t\t\t} = this.$util.getPage(-1)\r\n\t\t\t\tif (this.lockTap) return\r\n\t\t\t\tthis.lockTap = true\r\n\t\t\t\tthis.$util.showLoading()\r\n\t\t\t\ttry {\r\n\t\t\t\t\tawait this.$api.mine.addressDel({\r\n\t\t\t\t\t\tid\r\n\t\t\t\t\t})\r\n\t\t\t\t\tthis.$util.hideAll()\r\n\t\t\t\t\tthis.$util.showToast({\r\n\t\t\t\t\t\ttitle: `删除成功`,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.lockTap = false\r\n\t\t\t\t\tif (id == check_id) {\r\n\t\t\t\t\t\tthis.updateOrderItem({\r\n\t\t\t\t\t\t\tkey: 'haveOperItem',\r\n\t\t\t\t\t\t\tval: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.$util.back()\r\n\t\t\t\t\t\tthis.$util.goUrl({\r\n\t\t\t\t\t\t\turl: 1,\r\n\t\t\t\t\t\t\topenType: `navigateBack`\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}, 1000)\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.lockTap = false\r\n\t\t\t\t\t\tthis.$util.hideAll()\r\n\t\t\t\t\t}, 2000)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t//表单验证\r\n\t\t\tvalidate(param) {\r\n\t\t\t\tlet validate = new this.$util.Validate();\r\n\t\t\t\tthis.rule.map(item => {\r\n\t\t\t\t\tlet {\r\n\t\t\t\t\t\tname,\r\n\t\t\t\t\t} = item\r\n\t\t\t\t\tvalidate.add(param[name], item);\r\n\t\t\t\t})\r\n\t\t\t\tlet message = validate.start();\r\n\t\t\t\treturn message;\r\n\t\t\t},\r\n\t\t\tasync submit() {\r\n\t\t\t\tlet param = this.$util.deepCopy(this.form)\r\n\t\t\t\tlet msg = this.validate(param);\r\n\t\t\t\tif (msg) {\r\n\t\t\t\t\tthis.$util.showToast({\r\n\t\t\t\t\t\ttitle: msg\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.lockTap) return\r\n\t\t\t\tthis.lockTap = true\r\n\t\t\t\tthis.$util.showLoading()\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlet methodModel = param.id ? `addressUpdate` : `addressAdd`\r\n\t\t\t\t\tawait this.$api.mine[methodModel](param)\r\n\t\t\t\t\tthis.$util.hideAll()\r\n\t\t\t\t\tthis.$util.showToast({\r\n\t\t\t\t\t\ttitle: `保存成功`,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.$util.back()\r\n\t\t\t\t\t\tthis.$util.goUrl({\r\n\t\t\t\t\t\t\turl: 1,\r\n\t\t\t\t\t\t\topenType: `navigateBack`\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}, 1000)\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.lockTap = false\r\n\t\t\t\t\t\tthis.$util.hideAll()\r\n\t\t\t\t\t}, 2000)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n\r\n<style lang=\"scss\">\r\n</style>\n"],"sourceRoot":""} |