123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <view class="page">
- <view class="list_info">
- <view class="name">收件人:</view>
- <view class="item">
- <input type="text" class="input" placeholder="请输入收件人姓名" v-model="info.realname" maxlength="10" />
- </view>
- <view class="name">联系方式:</view>
- <view class="item">
- <input type="text" class="input" placeholder="请输入联系方式" v-model="info.mobile" maxlength="11" />
- </view>
- <view class="name">所在地区:</view>
- <view class="item" @click="SelAddrArea">
- <input type="text" class="input" placeholder="请选择所在地区" v-model="info.area" disabled="true" />
- <image class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix" />
- </view>
- <view class="name">详细地址:</view>
- <view class="item">
- <input type="text" class="input" placeholder="请输入详细地址" v-model="info.address" maxlength="30" />
- </view>
- <view class="blankHeight"></view>
- </view>
- <view class="btn_submit" @click="submitData">提交</view>
- <cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm"
- @cancel="cancel" :visible="visible" />
- </view>
- </template>
- <script>
- import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
- export default {
- components: {
- cityPicker
- },
- data() {
- return {
- title: '',
- sel: 1,
- info: {},
- area: '',
- realname: '',
- mobile: '',
- address: '',
- visible: false,
- maskCloseAble: true,
- str: '',
- defaultValue: '',
- // defaultValue: ['河北省','唐山市','丰南区'],
- column: 3
- }
- },
- onLoad() {},
- onShow() {
- this.getInfo();
- },
- methods: {
- onBack() {},
- chkSel() {
- if (this.sel == 1) {
- this.sel = 0;
- } else {
- this.sel = 1;
- }
- },
- SelAddrArea() {
- this.visible = true
- },
- confirm(val) {
- console.log(val)
- this.info.area = val.name; //JSON.stringify(val)
- this.visible = false
- },
- cancel() {
- this.visible = false
- },
- getInfo() {
- uni.request({
- url: this.$apiHost + '/Address/getinfo', //仅为示例,并非真实接口地址。
- data: {
- uuid: getApp().globalData.uuid
- },
- header: {
- 'content-type': 'application/json' //自定义请求头信息
- },
- success: (res) => {
- console.log("----", res.data);
- this.info = res.data.info;
- }
- });
- },
- submitData() {
- if (this.info.realname == "") {
- uni.showToast({
- title: "请输入收件人",
- icon: 'none'
- });
- return;
- }
- if (this.info.mobile == "") {
- uni.showToast({
- title: "请输入联系电话",
- icon: 'none'
- });
- return;
- }
- if (this.info.address == "") {
- uni.showToast({
- title: "请输入地址",
- icon: 'none'
- });
- return;
- }
- uni.request({
- url: this.$apiHost + '/Address/submitaddress', //仅为示例,并非真实接口地址。
- data: {
- uuid: getApp().globalData.uuid,
- realname: this.info.realname,
- mobile: this.info.mobile,
- area: this.info.area,
- address: this.info.address,
- },
- header: {
- 'content-type': 'application/json' //自定义请求头信息
- },
- success: (res) => {
- console.log("----", res.data);
- uni.showToast({
- title: res.data.str,
- icon: 'none'
- });
- if (res.data.success == "yes") {
- }
- }
- });
- },
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'normal.scss';
- </style>
|