更换版本
This commit is contained in:
171
pages/part/apply/index.js
Normal file
171
pages/part/apply/index.js
Normal file
@@ -0,0 +1,171 @@
|
||||
var t;
|
||||
(t = getApp()),
|
||||
Page({
|
||||
data: {
|
||||
buttscan: !1,
|
||||
isShow: !1,
|
||||
carTypeId: 0,
|
||||
carTypeName: "请选择车型",
|
||||
carTypeList: [],
|
||||
partTypeId: 0,
|
||||
partTypeName: "请选择配件类型",
|
||||
partTypeList: [
|
||||
{ id: 1, name: "原厂全新" },
|
||||
{ id: 2, name: "副厂全新" },
|
||||
{ id: 3, name: "原车拆件" },
|
||||
],
|
||||
tel: "",
|
||||
partImg: "",
|
||||
imgPath: "",
|
||||
},
|
||||
onLoad: function (a) {
|
||||
var e = this;
|
||||
console.log(e.data.partTypeList),
|
||||
t.util.getUserInfo(function (t) {
|
||||
t.memberInfo || e.setData({ isShow: !0 });
|
||||
}),
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: { m: "monai_market", r: "part.index.get_car_type" },
|
||||
success: function (t) {
|
||||
e.setData({ carTypeList: t.data.data });
|
||||
},
|
||||
});
|
||||
},
|
||||
hideDialog: function () {
|
||||
this.setData({ isShow: !this.data.isShow });
|
||||
},
|
||||
updateUserInfo: function (a) {
|
||||
var e = this;
|
||||
t.util.getUserInfo(function (t) {
|
||||
wx.setStorageSync("uid", t.memberInfo.uid), e.hideDialog();
|
||||
}, a.detail);
|
||||
},
|
||||
selectCarType: function (t) {
|
||||
console.log(t), console.log(t.detail.value);
|
||||
var a = this.data.carTypeList[t.detail.value];
|
||||
a && this.setData({ carTypeId: a.id, carTypeName: a.name });
|
||||
},
|
||||
selectPartType: function (t) {
|
||||
var a = this.data.partTypeList[t.detail.value];
|
||||
a && this.setData({ partTypeId: a.id, partTypeName: a.name });
|
||||
},
|
||||
getPhoneNumber: function (a) {
|
||||
console.log(a);
|
||||
var e = this;
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
r: "part.index.get_tel",
|
||||
m: "monai_market",
|
||||
iv: a.detail.iv,
|
||||
encryptedData: a.detail.encryptedData,
|
||||
},
|
||||
success: function (t) {
|
||||
e.setData({ tel: t.data.data });
|
||||
},
|
||||
});
|
||||
},
|
||||
release: function (a) {
|
||||
var e = this;
|
||||
if (e.data.buttscan) return !1;
|
||||
e.setData({ buttscan: !0 });
|
||||
var r = e.data.imgPath;
|
||||
if (!r)
|
||||
return (
|
||||
t.util.message({ title: "请上传配件图片", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var i = a.detail.value.part_name;
|
||||
if (!i)
|
||||
return (
|
||||
t.util.message({ title: "请输入配件名称", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var s = e.data.carTypeId;
|
||||
if (s <= 0)
|
||||
return (
|
||||
t.util.message({ title: "请选择车型", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var n = a.detail.value.car_year;
|
||||
if (!n)
|
||||
return (
|
||||
t.util.message({ title: "请输入年份", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var u = e.data.partTypeId;
|
||||
if (u <= 0)
|
||||
return (
|
||||
t.util.message({ title: "请选择配件类型", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var p = a.detail.value.user_tel;
|
||||
if (!n)
|
||||
return (
|
||||
t.util.message({ title: "请输入手机号码", type: "error" }),
|
||||
e.setData({ buttscan: !1 }),
|
||||
!1
|
||||
);
|
||||
var c = {
|
||||
r: "part.index.order_add",
|
||||
m: "monai_market",
|
||||
uid: t.getuid(),
|
||||
part_img: r,
|
||||
part_name: i,
|
||||
car_type: s,
|
||||
car_year: n,
|
||||
part_type: u,
|
||||
user_tel: p,
|
||||
};
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: c,
|
||||
success: function (t) {
|
||||
wx.showModal({
|
||||
content: "提交成功",
|
||||
showCancel: !1,
|
||||
success: function (t) {
|
||||
e.setData({ buttscan: !1 }), wx.navigateBack();
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: function (t) {
|
||||
e.setData({ buttscan: !1 });
|
||||
},
|
||||
});
|
||||
},
|
||||
upcarsimgs: function () {
|
||||
var a = this;
|
||||
t.upimgs({
|
||||
scannums: 1,
|
||||
filename: "parts",
|
||||
success: function (t) {
|
||||
console.log(t), a.setData({ partImg: t[0].all, imgPath: t[0].short });
|
||||
},
|
||||
});
|
||||
},
|
||||
showimg: function (t) {
|
||||
wx.previewImage({
|
||||
current: this.data.partImg,
|
||||
urls: [this.data.partImg],
|
||||
});
|
||||
},
|
||||
delImg: function (a) {
|
||||
t.util.request({
|
||||
url: "entry/wxapp/Api",
|
||||
data: {
|
||||
m: "monai_market",
|
||||
uid: t.getuid(),
|
||||
imgurl: this.data.partImg,
|
||||
r: "Upimg.delImg",
|
||||
},
|
||||
}),
|
||||
this.setData({ partImg: "", imgPath: "" });
|
||||
},
|
||||
});
|
1
pages/part/apply/index.json
Normal file
1
pages/part/apply/index.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "汽配订购", "usingComponents": {} }
|
35
pages/part/apply/index.wxml
Normal file
35
pages/part/apply/index.wxml
Normal file
@@ -0,0 +1,35 @@
|
||||
<form bindsubmit="release" reportSubmit="true">
|
||||
<view class="modle" style="border-bottom:0"> 配件图片 <text class="must_red">*</text>
|
||||
</view>
|
||||
<view class="shangchuan_view" wx:if="{{partImg!=''}}">
|
||||
<image bindtap="delImg" class="shangchuan_Img_close" src="/pages/image/tupiangb_btn.png"></image>
|
||||
<image bindtap="showimg" class="shangchuan_Img" src="{{partImg}}"></image>
|
||||
</view>
|
||||
<view class="shangchuan_view" wx:if="{{partImg==''}}">
|
||||
<image bindtap="upcarsimgs" class="shangchuan_Img" src="/pages/image/tianjiantp_btn.png"></image>
|
||||
</view>
|
||||
<view class="modle"> 配件名称 <text class="must_red">*</text>
|
||||
<input class="modle_right" name="part_name" placeholder="请输入配件名称" placeholderStyle="color: #9295A8;" type="text" value=""></input>
|
||||
</view>
|
||||
<view class="modle"> 车辆类型 <text class="must_red">*</text>
|
||||
<picker bindchange="selectCarType" class="modle_right" range="{{carTypeList}}" rangeKey="name" value="{{index}}">
|
||||
<view> {{carTypeName}} </view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="modle"> 年份 <text class="must_red">*</text>
|
||||
<input class="modle_right" name="car_year" placeholder="请输入年份" placeholderStyle="color: #9295A8;" style="width:350rpx;" type="digit" value="{{defult_value}}"></input>
|
||||
</view>
|
||||
<view class="modle"> 配件类型 <text class="must_red">*</text>
|
||||
<picker bindchange="selectPartType" class="modle_right" range="{{partTypeList}}" rangeKey="name" value="{{index}}">
|
||||
<view> {{partTypeName}} </view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="modle">
|
||||
<input class="modle_right btm_input" name="user_tel" placeholder="" placeholderStyle="color: #9295A8;" type="number" value="{{tel}}"></input> 联系电话 <text class="must_red">*</text>
|
||||
<button bindgetphonenumber="getPhoneNumber" class="modle_btn" openType="getPhoneNumber">电话授权</button>
|
||||
</view>
|
||||
<button class="bufa_btn" formType="submit">提交</button>
|
||||
<view class="jinggao">提交后,后台客服会根据提交信息进行报价。</view>
|
||||
</form>
|
||||
<import src="/pages/alert/index.wxml"></import>
|
||||
<template is="alert" data="{{isShow:isShow}}"></template>
|
219
pages/part/apply/index.wxss
Normal file
219
pages/part/apply/index.wxss
Normal file
@@ -0,0 +1,219 @@
|
||||
@import "/pages/alert/index.wxss";
|
||||
.xiaoxi {
|
||||
background: #3d61f0;
|
||||
border-bottom: 20rpx solid #f9f9f9;
|
||||
height: 88rpx;
|
||||
padding-top: 1rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.text_area,
|
||||
.xiaoxi {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.text_area {
|
||||
background: #f0f0f0;
|
||||
border-radius: 10rpx;
|
||||
color: #555;
|
||||
font-size: 24rpx;
|
||||
height: 288rpx;
|
||||
padding: 20rpx;
|
||||
width: 650rpx;
|
||||
}
|
||||
.xiaoxi_leftImg {
|
||||
float: left;
|
||||
height: 40rpx;
|
||||
margin-top: 24rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 15rpx;
|
||||
width: 40rpx;
|
||||
}
|
||||
.xiaoxi_right_btn {
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5rpx;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
height: 45rpx;
|
||||
line-height: 45rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-top: 21.5rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
text-align: center;
|
||||
width: 100rpx;
|
||||
}
|
||||
.show_diandian,
|
||||
.update_scroll_modle {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.update_scroll_modle {
|
||||
color: #fff;
|
||||
float: left;
|
||||
padding-right: 150rpx;
|
||||
position: relative;
|
||||
text-overflow: ellipsis;
|
||||
width: 505rpx;
|
||||
z-index: 15;
|
||||
}
|
||||
.modle,
|
||||
.update_scroll_modle {
|
||||
font-size: 28rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.modle {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
color: #333;
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
}
|
||||
.modle_right {
|
||||
color: #9295a8;
|
||||
display: block;
|
||||
height: 88rpx;
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
.modle_btn,
|
||||
.modle_right {
|
||||
float: right;
|
||||
font-size: 24rpx;
|
||||
padding: 0;
|
||||
}
|
||||
.modle_btn {
|
||||
background: #fff;
|
||||
border: 1px solid #3d61f0;
|
||||
border-radius: 8rpx;
|
||||
color: #3d61f0;
|
||||
height: 48rpx;
|
||||
line-height: 46rpx;
|
||||
margin: 21.5rpx 0 0 30rpx;
|
||||
text-align: center;
|
||||
width: 120rpx;
|
||||
}
|
||||
.shangchuan_view {
|
||||
display: inline-block;
|
||||
height: 165rpx;
|
||||
margin-left: 19rpx;
|
||||
margin-top: 20rpx;
|
||||
width: 165rpx;
|
||||
}
|
||||
.shangchuan_Img {
|
||||
height: 165rpx;
|
||||
position: absolute;
|
||||
width: 165rpx;
|
||||
}
|
||||
.shangchuan_Img_close {
|
||||
float: right;
|
||||
height: 38rpx;
|
||||
position: relative;
|
||||
width: 38rpx;
|
||||
z-index: 5;
|
||||
}
|
||||
.bufa_btn {
|
||||
background: #3d61f0;
|
||||
border-radius: 15rpx;
|
||||
color: #fff;
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
margin: 40rpx auto 0;
|
||||
text-align: center;
|
||||
width: 690rpx;
|
||||
}
|
||||
.jinggao {
|
||||
color: #9295a8;
|
||||
font-size: 24rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.must_red {
|
||||
color: red;
|
||||
}
|
||||
.textarea_text {
|
||||
color: #888;
|
||||
font-size: 24rpx;
|
||||
height: 310rpx;
|
||||
margin: -310rpx auto 0;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
position: relative;
|
||||
width: 650rpx;
|
||||
z-index: 1000;
|
||||
}
|
||||
.textarea_text_active {
|
||||
color: #333;
|
||||
}
|
||||
.dizhi_area {
|
||||
color: #9295a8;
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
height: 110rpx;
|
||||
line-height: 50rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-top: 18rpx;
|
||||
width: 385rpx;
|
||||
}
|
||||
.car_messageView {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
height: 88rpx;
|
||||
margin: 0 auto;
|
||||
width: 690rpx;
|
||||
}
|
||||
.car_messageView_input {
|
||||
color: #333;
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 88rpx;
|
||||
width: 600rpx;
|
||||
}
|
||||
.car_messageView_sc {
|
||||
color: #f75f5f;
|
||||
float: left;
|
||||
font-size: 24rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
text-align: right;
|
||||
width: 90rpx;
|
||||
}
|
||||
.shangchuan_view_border {
|
||||
margin-top: -15rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.kefu_modle {
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: fixed;
|
||||
right: 10rpx;
|
||||
top: 70rpx;
|
||||
width: 150rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
.kefu_modle_img {
|
||||
background: #fff;
|
||||
border-radius: 100%;
|
||||
display: block;
|
||||
height: 100rpx;
|
||||
margin: 0 auto;
|
||||
width: 100rpx;
|
||||
}
|
||||
.kefu_modle_title {
|
||||
color: #666;
|
||||
font-size: 27rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
button::after {
|
||||
border: none;
|
||||
}
|
||||
.btm_input {
|
||||
position: absolute;
|
||||
right: 180rpx;
|
||||
width: 340rpx;
|
||||
}
|
Reference in New Issue
Block a user