|
@@ -6,10 +6,10 @@
|
|
|
</view>
|
|
|
<view class="right">
|
|
|
<view class="row1">
|
|
|
- 姓名|职务
|
|
|
+ {{cardInfo.name}}|{{cardInfo.post}}
|
|
|
</view>
|
|
|
<view class="">
|
|
|
- 公司名称
|
|
|
+ {{cardInfo.companyName}}
|
|
|
</view>
|
|
|
<view class="">
|
|
|
地址
|
|
@@ -31,7 +31,7 @@
|
|
|
</view>
|
|
|
<u--form labelPosition="left" :model="cardInfo" ref="uForm">
|
|
|
<u-form-item label="名片标识" prop="userInfo.cardBusiness" borderBottom>
|
|
|
- <text>名片-{{cardInfo.cardBusiness}}</text>
|
|
|
+ <u--input v-model="cardInfo.cardBusiness" border="none" placeholder="输入名片标识"></u--input>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="姓名" prop="userInfo.name" borderBottom>
|
|
|
<u--input v-model="cardInfo.name" border="none" placeholder="输入姓名"></u--input>
|
|
@@ -42,14 +42,19 @@
|
|
|
<u-form-item label="公司/机构名称" prop="userInfo.companyName" borderBottom>
|
|
|
<u--input v-model="cardInfo.companyName" border="none" placholder="输入公司/机构名称"></u--input>
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="定位" prop="userInfo.name" borderBottom @click="placeSelect();hideKeyboard()">
|
|
|
- <text>选择定位> </text>
|
|
|
+ </u-form-item>
|
|
|
+ <!-- <u-form-item label="地址" prop="userInfo.name" borderBottom>
|
|
|
+ <view @click="showPicker">选择地址</view>
|
|
|
+ <view>{{ province }}{{ city }}{{ area }}</view>
|
|
|
+ </u-form-item> -->
|
|
|
+ <u-form-item label="定位" prop="userInfo.name" borderBottom @click="placeSelect();hideKeyboard()">
|
|
|
+ <text>选择地址> </text>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="详细地址" prop="userInfo.name" borderBottom>
|
|
|
- <u--input v-model="cardInfo.name" border="none" placeholder="输入地址,不超过15个字"></u--input>
|
|
|
+ <u--input v-model="cardInfo.detailedAddress" border="none" placeholder="输入地址,不超过15个字"></u--input>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="联系电话" prop="userInfo.name" borderBottom>
|
|
|
- <u--input v-model="cardInfo.name" border="none" placeholder="输入联系电话"></u--input>
|
|
|
+ <u--input v-model="cardInfo.phone" border="none" placeholder="输入联系电话"></u--input>
|
|
|
</u-form-item>
|
|
|
</u--form>
|
|
|
</view>
|
|
@@ -63,30 +68,41 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="bottom">
|
|
|
- <button>提交</button>
|
|
|
+ <button @click="submit">提交</button>
|
|
|
</view>
|
|
|
+ <city-picker ref="picker" mode="multiSelector" :list="areaData" :level="3" @confirm="finishSelectAddress">
|
|
|
+ </city-picker>
|
|
|
+ <u-modal :show="isSubmit" :content='content' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
|
|
|
+ @cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
|
|
|
+ <u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ var that;
|
|
|
import uploadImage from '@/components/ossutil/uploadFile.js';
|
|
|
export default {
|
|
|
+ onLoad() {
|
|
|
+ that = this
|
|
|
+ this.userInfo = uni.getStorageSync("userInfo")
|
|
|
+ this.cardInfo.commonId = this.userInfo.id
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isSubmit: false,
|
|
|
+ content: '确定提交名片信息?',
|
|
|
+ userInfo: {},
|
|
|
fileList1: [],
|
|
|
cardInfo: {
|
|
|
- commonId:'',
|
|
|
- cardBusiness:'',
|
|
|
- name:'',
|
|
|
- post:'',
|
|
|
- companyName:'',
|
|
|
- location:'',
|
|
|
- detailedAddress:'',
|
|
|
- phone:'',
|
|
|
- headSculpture:''
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ commonId: '',
|
|
|
+ cardBusiness: '名片标识-1',
|
|
|
+ name: '',
|
|
|
+ post: '',
|
|
|
+ companyName: '',
|
|
|
+ location: '',
|
|
|
+ detailedAddress: '',
|
|
|
+ phone: '',
|
|
|
+ headSculpture: ''
|
|
|
}
|
|
|
};
|
|
|
},
|
|
@@ -95,22 +111,12 @@
|
|
|
uni.chooseLocation({
|
|
|
success: function(res) {
|
|
|
console.log(res);
|
|
|
- 111
|
|
|
- // console.log('位置名称:' + res.name);
|
|
|
- // console.log('详细地址:' + res.address);
|
|
|
- // console.log('纬度:' + res.latitude);
|
|
|
- // console.log('经度:' + res.longitude);
|
|
|
- this.cardInfo.location = res.latitude+','+res.longitude
|
|
|
- this.
|
|
|
- console.log('----------------------------')
|
|
|
- // that.addressInfo.latitude = res.latitude
|
|
|
- // that.addressInfo.longitude = res.longitude
|
|
|
- // that.addressInfo.detailedAddress = _address.Village
|
|
|
- // that.addressInfo.province = _address.Province
|
|
|
- // that.addressInfo.city = _address.City
|
|
|
- // that.addressInfo.area = _address.Country
|
|
|
- // that.addressInfo.commonId = that.userInfo.id
|
|
|
- // that.$forceUpdate()
|
|
|
+ that.cardInfo.location = res.latitude + ',' + res.longitude
|
|
|
+ let _address = that.$helper.formatLocation(res.address)
|
|
|
+ that.cardInfo.province = _address.Province
|
|
|
+ that.cardInfo.city = _address.City
|
|
|
+ that.cardInfo.area = _address.Country
|
|
|
+ that.cardInfo.detailedAddress = _address.Village
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -144,29 +150,37 @@
|
|
|
fileListLen++
|
|
|
}
|
|
|
},
|
|
|
- uploadFilePromise(url) {
|
|
|
+ uploadFilePromise(res) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- // uploadImage(res.tempFilePaths[0], 'cardImages/',
|
|
|
- // result => {
|
|
|
- // // this.trainImg = result
|
|
|
- // uni.hideLoading();
|
|
|
- // }
|
|
|
- // )
|
|
|
- // let a = uni.uploadFile({
|
|
|
- // url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
|
|
|
- // filePath: url,
|
|
|
- // name: 'file',
|
|
|
- // formData: {
|
|
|
- // user: 'test'
|
|
|
- // },
|
|
|
- // success: (res) => {
|
|
|
- // setTimeout(() => {
|
|
|
- // resolve(res.data.data)
|
|
|
- // }, 1000)
|
|
|
- // }
|
|
|
- // });
|
|
|
+ uploadImage(res, 'cardImages/',
|
|
|
+ result => {
|
|
|
+ that.cardInfo.headSculpture = result
|
|
|
+ resolve(res)
|
|
|
+ }
|
|
|
+ )
|
|
|
})
|
|
|
},
|
|
|
+ confirmSubmit() {
|
|
|
+ this.$request.baseRequest('admin.unimall.cardManagementInfo', 'add', {
|
|
|
+ cardManagementInfo: JSON.stringify(this.cardInfo)
|
|
|
+ }, failres => {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: failres.errmsg,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ }).then(res => {
|
|
|
+ this.isSubmit = false
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: '提交成功!',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ this.isSubmit = true
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|