Commit 04600f3c by luyt

feat:申请增加条件判断

1 parent 0969cbe6
File mode changed
// pages/apply/apply.js // pages/apply/apply.js
const navStyle = 'background-color: transparent;' const navStyle = "background-color: transparent;";
import {IMG_URL} from '~/utils/constantData.js' import { IMG_URL } from "~/utils/constantData.js";
// `${IMG_URL}index/car2.png`, // `${IMG_URL}index/car2.png`,
//本地图片路径 //本地图片路径
let IMG_URLLocal = '../../images/' let IMG_URLLocal = "../../images/";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navStyle, navStyle,
IMG_URL, IMG_URL,
carObj:{ carObj: {
name:'kafdkf', name: "kafdkf",
model:'dfdsf3443', model: "dfdsf3443",
selNum:132, selNum: 132,
contact:'', contact: "",
phone:'', phone: "",
} },
}, },
// navbar高度设置 // navbar高度设置
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail let { height, statusBarHeight } = e.detail;
this.setData({ this.setData({
tabBarStyle: height / 2 + statusBarHeight, tabBarStyle: height / 2 + statusBarHeight,
// headerHeight: height / 2 + statusBarHeight + 88*2 // headerHeight: height / 2 + statusBarHeight + 88*2
}) });
// console.log(e)
// console.log(this.data.headerHeight)
}, },
// 提交信息 // 提交信息
applyFn(){ applyFn() {
console.log(123) let { name } = this.data.carObj;
console.log("name: ", name);
if (!name) {
wx.pro.showToast({
title: "请输入店名",
icon: "error",
});
return;
}
console.log(123);
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name;
let content = e.detail.value;
this.setData({
[`carObj.${name}`]:content
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {},
onRoute(params) {
}, console.log("params: ", params);
onRoute(params){
console.log('params: ', params);
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
onShareAppMessage() {},
});
<!-- pages/apply/apply.wxml --> <!-- pages/apply/apply.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">申请业务</navigation-bar> <navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务
</navigation-bar>
<view class="apply"> <view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" /> <image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/apply-title.png" /> <image class="introduce" src="{{IMG_URL}}index/apply-title.png" />
<view class="content" hover-class="none" hover-stop-propagation> <view class="content" hover-class="none" hover-stop-propagation>
<view class="top"> <view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" /> <view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view> <view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
开店名称
<text class="point">*</text>
</view>
<input class="inp" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面新车销量/基盘客户</view>
<input class="inp" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">门店联系人</view>
<input class="inp" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人手机号</view>
<input class="inp" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" placeholder="请输入手机号" />
</view>
</view> </view>
<view class="inp-wrap"> <button class="btn" bindtap="applyFn">提交开店信息</button>
<view class="title" hover-class="none" hover-stop-propagation="false"> </view>
开店名称
<text class="point">*</text>
</view>
<input class="inp" value="{{carObj.name}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
店面车型
</view>
<input class="inp" value="{{carObj.model}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
店面新车销量/基盘客户
</view>
<input class="inp" value="{{carObj.selNum}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
门店联系人
</view>
<input class="inp" value="{{carObj.contact}}" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
联系人手机号
</view>
<input class="inp" value="{{carObj.phone}}" placeholder="请输入手机号" />
</view>
</view>
<button class="btn" bindtap="applyFn">提交开店信息</button>
</view>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!