Commit beb7cc87 by LJM

账期

parent 4982b2c6
Showing with 158 additions and 21 deletions
...@@ -11,28 +11,28 @@ ...@@ -11,28 +11,28 @@
<text class="t1">*</text> <text class="t1">*</text>
<text class="t2">公司名称:</text> <text class="t2">公司名称:</text>
</view> </view>
<view><input type="text" placeholder="请输入公司名称" class="uni-input" /></view> <view><input type="text" placeholder="请输入公司名称" class="uni-input" v-model="formParams.com_name" /></view>
</view> </view>
<view class="input-box column"> <view class="input-box column">
<view class="text"> <view class="text">
<text class="t1">*</text> <text class="t1">*</text>
<text class="t2">联系人:</text> <text class="t2">联系人:</text>
</view> </view>
<view><input type="text" placeholder="请输入联系人" class="uni-input" /></view> <view><input type="text" placeholder="请输入联系人" class="uni-input" v-model="formParams.linkman" /></view>
</view> </view>
<view class="input-box column"> <view class="input-box column">
<view class="text"> <view class="text">
<text class="t1">*</text> <text class="t1">*</text>
<text class="t2">联系电话:</text> <text class="t2">联系电话:</text>
</view> </view>
<view><input type="text" placeholder="请输入联系电话" class="uni-input" /></view> <view><input type="text" placeholder="请输入联系电话" class="uni-input" v-model="formParams.mobile" /></view>
</view> </view>
<view class="input-box column"> <view class="input-box column">
<view class="text"> <view class="text">
<text class="t1">*</text> <text class="t1">*</text>
<text class="t2">邮箱:</text> <text class="t2">邮箱:</text>
</view> </view>
<view><input type="text" placeholder="请输入邮箱" class="uni-input" /></view> <view><input type="text" placeholder="请输入邮箱" class="uni-input" v-model="formParams.email" /></view>
</view> </view>
<view class="input-box column"> <view class="input-box column">
<view class="text"> <view class="text">
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
<text class="t2">公司性质:</text> <text class="t2">公司性质:</text>
</view> </view>
<view class="select-box"> <view class="select-box">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array" :range-key="'name'">
<view class="row verCenter bothSide"> <view class="row verCenter bothSide">
<view class="uni-input row verCenter">{{ array[index] }}</view> <view class="uni-input row verCenter">{{ index == -1 ? '请选择' : array[index].name }}</view>
<view class="iconfont icon-arrbot"></view> <view class="iconfont icon-arrbot"></view>
</view> </view>
</picker> </picker>
...@@ -54,15 +54,13 @@ ...@@ -54,15 +54,13 @@
<text class="t2">营业执照:</text> <text class="t2">营业执照:</text>
</view> </view>
<view class="upload-box row"> <view class="upload-box row">
<view class="default row rowCenter verCenter"><text class="iconfont icon-juxing4"></text></view> <template v-if="image_list.length > 0">
<view class="box"> <view class="box" v-for="(item, index) in image_list" :key="index">
<image src="https://img.ichunt.com/images/ichunt/202305/20/441caaf538f3f5fb4c7b9e735d2401f2.jpg" mode="aspectFill"></image> <image :src="item" mode="aspectFill" @click="previewChange(image_list, index)"></image>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-del"></text></view> <view class="delete row rowCenter verCenter" @click="deletePic(index)"><text class="iconfont icon-del"></text></view>
</view> </view>
<view class="box"> </template>
<image src="https://img.ichunt.com/images/ichunt/202305/20/441caaf538f3f5fb4c7b9e735d2401f2.jpg" mode="aspectFill"></image> <view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="image_list.length < maxNum"><text class="iconfont icon-juxing4"></text></view>
<view class="delete row rowCenter verCenter"><text class="iconfont icon-del"></text></view>
</view>
</view> </view>
</view> </view>
<view class="btn row rowCenter verCenter" @click="submit()">提交</view> <view class="btn row rowCenter verCenter" @click="submit()">提交</view>
...@@ -85,13 +83,23 @@ ...@@ -85,13 +83,23 @@
</template> </template>
<script> <script>
import { Api_Url } from '@/util/api.js'; import { Api_Url, Oss_Url } from '@/util/api.js';
export default { export default {
data() { data() {
return { return {
index: 0, index: -1,
array: ['0086', '00886', '00853', '00852'] array: [{ name: '代理商', value: 3 }, { name: '终端采购商', value: 1 }, { name: '代工厂', value: 2 }, { name: '学校、科研机构', value: 4 }, { name: '贸易商', value: 5 }, { name: '个人', value: 0 }, { name: '其他', value: 6 }],
image_list: [], //图片列表
maxNum: 10, //最大上传图片数量
formParams: {
com_name: '',
linkman: '',
mobile: '',
email: '',
com_nature: '',
business_license_src: ''
}
}; };
}, },
onShow() {}, onShow() {},
...@@ -99,6 +107,7 @@ export default { ...@@ -99,6 +107,7 @@ export default {
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value; this.index = e.detail.value;
this.formParams.com_nature = this.array[e.detail.value].name;
}, },
open() { open() {
this.$refs.popup.open('center'); this.$refs.popup.open('center');
...@@ -106,8 +115,131 @@ export default { ...@@ -106,8 +115,131 @@ export default {
close() { close() {
this.$refs.popup.close(); this.$refs.popup.close();
}, },
/**
* 删除图片
* @param {Object} index
*/
deletePic(index) {
this.image_list.splice(index, 1);
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(img, index) {
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: img
});
},
/**
* 选择图片
*/
chooseImageChange() {
this.noexebshowFalg = false;
var self = this;
uni.chooseImage({
count: self.maxNums,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
let maxNum = tempFilePaths.length * 1 + self.image_list.length * 1;
if (maxNum > self.maxNum) {
uni.hideLoading();
uni.showToast({
title: '图片不超过' + self.maxNum + '张',
icon: 'error'
});
return false;
}
for (let i = 0; i < tempFilePaths.length; i++) {
uni.uploadFile({
url: Oss_Url + '/uploadFile?sys_type=4',
filePath: tempFilePaths[i],
name: 'file',
header: {
'Content-Type': 'multipart/form-data'
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 0) {
self.image_list.push(data.data.oss_file_url);
} else {
uni.showToast({
title: data.msg,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
}
});
}
}
});
},
submit() { submit() {
this.open(); if (!this.formParams.com_name) {
uni.showToast({
title: '请填写公司名称',
icon: 'none'
});
return false;
}
if (!this.formParams.linkman) {
uni.showToast({
title: '请填写联系人',
icon: 'none'
});
return false;
}
if (!this.formParams.mobile) {
uni.showToast({
title: '请填写电话',
icon: 'none'
});
return false;
}
if (!this.formParams.email) {
uni.showToast({
title: '请填写邮箱',
icon: 'none'
});
return false;
}
if (!this.formParams.com_nature) {
uni.showToast({
title: '请选择公司性质',
icon: 'none'
});
return false;
}
this.request(Api_Url + '/help/help/addCreditApply', 'POST', this.formParams, true, true).then(res => {
if (res.err_code === 0) {
uni.showToast({
title: '提交成功',
icon: 'success'
});
setTimeout(() => {
this.open();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.err_msg,
showCancel: false
});
}
});
} }
} }
}; };
......
...@@ -3,6 +3,8 @@ var Api_Url = ''; //api项目url ...@@ -3,6 +3,8 @@ var Api_Url = ''; //api项目url
var Api_Es = ''; //api项目url var Api_Es = ''; //api项目url
var Api_ES_Go = ''; //型号联想 var Api_ES_Go = ''; //型号联想
var Code_Url = ''; //图形验证码 var Code_Url = ''; //图形验证码
var Oss_Url = ''; //oss系统
switch (window.location.hostname) { switch (window.location.hostname) {
...@@ -12,14 +14,15 @@ switch (window.location.hostname) { ...@@ -12,14 +14,15 @@ switch (window.location.hostname) {
Api_Es = "//so12.ichunt.com" Api_Es = "//so12.ichunt.com"
Api_ES_Go = "https://s.ichunt.com" Api_ES_Go = "https://s.ichunt.com"
Code_Url = "https://www.ichunt.com/v3/public/verify"; Code_Url = "https://www.ichunt.com/v3/public/verify";
Oss_Url = "https://file.ichunt.net";
break; break;
default: default:
//本地proxy配置参考vue.config.js
Ichunt_Api = '/v3' Ichunt_Api = '/v3'
Api_Url = '/apis'; Api_Url = '/apis';
Api_Es = "/esapi"; Api_Es = "/esapi";
Api_ES_Go = "http://192.168.1.237:9008"; Api_ES_Go = "http://192.168.1.237:9008";
Code_Url = "http://www.liexin.com/v3/public/verify"; Code_Url = "http://www.liexin.com/v3/public/verify";
Oss_Url = "http://file.liexindev.net";
} }
...@@ -28,5 +31,6 @@ module.exports = { ...@@ -28,5 +31,6 @@ module.exports = {
Api_Url, Api_Url,
Api_Es, Api_Es,
Api_ES_Go, Api_ES_Go,
Code_Url Code_Url,
Oss_Url
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment