Initial Commit
This commit is contained in:
107
pages/welfareImg/welfareImg.js
Normal file
107
pages/welfareImg/welfareImg.js
Normal file
@ -0,0 +1,107 @@
|
||||
const WxParse = require('../../wxParse/wxParse.js');
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
bgImg: app.globalData.bgImg,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
//上级id
|
||||
if (options.pId) {
|
||||
wx.setStorage({
|
||||
data: options.pId,
|
||||
key: 'pId',
|
||||
})
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/banner/getWelfareCustom',
|
||||
method: 'GET',
|
||||
header: {
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
data: {},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
WxParse.wxParse('article', 'html', res.data.value.welfarePhoto, this, 20);
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '获取数据失败!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
custom(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/welfareImg/welfare_tj/welfare_tj',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
app.share();
|
||||
return {
|
||||
path: '/pages/index/index?pId=' + app.globalData.userId,
|
||||
title: '三品慧采小程序等你来~'
|
||||
}
|
||||
},
|
||||
})
|
4
pages/welfareImg/welfareImg.json
Normal file
4
pages/welfareImg/welfareImg.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "福利定制"
|
||||
}
|
7
pages/welfareImg/welfareImg.wxml
Normal file
7
pages/welfareImg/welfareImg.wxml
Normal file
@ -0,0 +1,7 @@
|
||||
<import src="../../wxParse/wxParse.wxml" />
|
||||
<view class="cont">
|
||||
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
|
||||
</view>
|
||||
<view class="btn" catchtap="custom">
|
||||
<image src="{{bgImg}}welfareImg.png"></image>
|
||||
</view>
|
19
pages/welfareImg/welfareImg.wxss
Normal file
19
pages/welfareImg/welfareImg.wxss
Normal file
@ -0,0 +1,19 @@
|
||||
@import "../../wxParse/wxParse.wxss";
|
||||
.cont{
|
||||
width:750rpx;
|
||||
}
|
||||
.cont image{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.btn{
|
||||
width: 416rpx;
|
||||
height: 81rpx;
|
||||
position: fixed;
|
||||
left:167rpx;
|
||||
bottom: 50rpx;
|
||||
}
|
||||
.btn image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
192
pages/welfareImg/welfare_tj/welfare_tj.js
Normal file
192
pages/welfareImg/welfare_tj/welfare_tj.js
Normal file
@ -0,0 +1,192 @@
|
||||
// pages/welfareImg/welfare_tj/welfare_tj.js
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
bgImg: app.globalData.bgImg,
|
||||
name: '',
|
||||
phone: '',
|
||||
gsmc: '',
|
||||
time: '',
|
||||
cont: '',
|
||||
|
||||
date: '',
|
||||
dataNow: '',
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var date = new Date();
|
||||
this.setData({
|
||||
dataNow: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
||||
})
|
||||
console.log(this.data.dataNow)
|
||||
},
|
||||
|
||||
bindDateChange: function (e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setData({
|
||||
date: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
//申请提现
|
||||
cash: function () {
|
||||
let name = this.data.name;
|
||||
let phone = this.data.phone;
|
||||
let cont = this.data.cont;
|
||||
let gsmc = this.data.gsmc;
|
||||
let time = this.data.date;
|
||||
if (name == "") {
|
||||
wx.showToast({
|
||||
title: '请填写姓名~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (phone == "" || phone.length != 11) {
|
||||
wx.showToast({
|
||||
title: '请填写正确手机号~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (gsmc == "") {
|
||||
wx.showToast({
|
||||
title: '请填写公司名称~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (time == "") {
|
||||
wx.showToast({
|
||||
title: '请选择要货时间~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (cont == "") {
|
||||
wx.showToast({
|
||||
title: '请填写定制内容~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.showLoading({
|
||||
title: '提交中..',
|
||||
mask: true,
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/banner/addWelfareCustom',
|
||||
method: 'POST',
|
||||
data: {
|
||||
joinPhone: phone,
|
||||
joinName: name,
|
||||
joinContent: cont,
|
||||
joinCompanyName: gsmc,
|
||||
joinTime: time,
|
||||
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
wx.showModal({
|
||||
title: '申请成功!',
|
||||
content: "稍后工作人员就会处理您的申请信息,请耐心等待",
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
wx.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '申请失败!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
}
|
||||
}, fail: f => {
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '请求异常,请稍后重试~',
|
||||
icon: "none",
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
name: function (e) {
|
||||
this.setData({
|
||||
name: e.detail.value
|
||||
})
|
||||
},
|
||||
phone: function (e) {
|
||||
this.setData({
|
||||
phone: e.detail.value
|
||||
})
|
||||
},
|
||||
gsmc: function (e) {
|
||||
this.setData({
|
||||
gsmc: e.detail.value
|
||||
})
|
||||
},
|
||||
time: function (e) {
|
||||
this.setData({
|
||||
time: e.detail.value
|
||||
})
|
||||
},
|
||||
cont: function (e) {
|
||||
this.setData({
|
||||
cont: e.detail.value
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
})
|
4
pages/welfareImg/welfare_tj/welfare_tj.json
Normal file
4
pages/welfareImg/welfare_tj/welfare_tj.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "申请定制"
|
||||
}
|
34
pages/welfareImg/welfare_tj/welfare_tj.wxml
Normal file
34
pages/welfareImg/welfare_tj/welfare_tj.wxml
Normal file
@ -0,0 +1,34 @@
|
||||
<!--pages/welfareImg/welfare_tj/welfare_tj.wxml-->
|
||||
<view class="top">
|
||||
<image src="{{bgImg}}welfare_top.png"></image>
|
||||
</view>
|
||||
<view class="cont">
|
||||
<view class="title">联系方式</view>
|
||||
<view class="itp display_J_S display_A_C">
|
||||
<view class="itp-l">真实姓名</view>
|
||||
<input type="text" placeholder="请输入您的姓名" value="{{name}}" bindinput="name" placeholder-class="ccc" />
|
||||
</view>
|
||||
<view class="itp display_J_S display_A_C">
|
||||
<view class="itp-l">联系方式</view>
|
||||
<input type="text" placeholder="请输入您的联系方式" value="{{phone}}" bindinput="phone" placeholder-class="ccc" />
|
||||
</view>
|
||||
<view class="itp display_J_S display_A_C">
|
||||
<view class="itp-l">公司名称</view>
|
||||
<input type="text" placeholder="请输入您的公司名称" value="{{gsmc}}" bindinput="gsmc" placeholder-class="ccc" />
|
||||
</view>
|
||||
<view class="itp display_J_S display_A_C" style="margin-bottom:90rpx;">
|
||||
<view class="itp-l">要货时间</view>
|
||||
<!-- <input type="text" placeholder="请输入您的要货时间" value="{{time}}" bindinput="time" /> -->
|
||||
<picker mode="date" value="{{date}}" start="{{dataNow}}" bindchange="bindDateChange">
|
||||
<view class="display_J_S display_A_C itp_pic">
|
||||
<view class="pic {{date==''?'ccc':''}}">{{date==''?'请选择您的要货时间':date}}</view>
|
||||
<image src="/icon/c-down.png"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="title">定制内容</view>
|
||||
<textarea maxlength='-1' bindinput="cont" value="{{cont}}" placeholder-class="ccc" placeholder="填写您需要的内容"></textarea>
|
||||
<view class="height100"></view>
|
||||
<view class="height100"></view>
|
||||
<view class="btn" catchtap="cash">提交</view>
|
||||
</view>
|
83
pages/welfareImg/welfare_tj/welfare_tj.wxss
Normal file
83
pages/welfareImg/welfare_tj/welfare_tj.wxss
Normal file
@ -0,0 +1,83 @@
|
||||
/* pages/welfareImg/welfare_tj/welfare_tj.wxss */
|
||||
.top{
|
||||
width: 750rpx;
|
||||
height: 146rpx;
|
||||
}
|
||||
.top image{
|
||||
width: 750rpx;
|
||||
height: 146rpx;
|
||||
}
|
||||
.cont{
|
||||
width: 690rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
position: relative;
|
||||
top: -15rpx;
|
||||
}
|
||||
.title{
|
||||
font-size: 36rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.itp{
|
||||
height: 120rpx;
|
||||
width: 100%;
|
||||
border-bottom: 1rpx #eee solid;
|
||||
}
|
||||
.itp-l{
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #9792a6;
|
||||
}
|
||||
.itp input{
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #333333;
|
||||
width: 500rpx;
|
||||
height: 120rpx;
|
||||
line-height: 120rpx;
|
||||
margin-left: 50rpx;
|
||||
border: none;
|
||||
}
|
||||
.itp_pic image{
|
||||
width: 16rpx;
|
||||
height: 10rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.pic{
|
||||
margin-left: 50rpx;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #333333;
|
||||
height: 120rpx;
|
||||
line-height: 120rpx;
|
||||
}
|
||||
.ccc{
|
||||
color: #888;
|
||||
}
|
||||
textarea{
|
||||
width: 630rpx;
|
||||
height: 300rpx;
|
||||
padding: 30rpx;
|
||||
background-color: #eeeeee;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #333;
|
||||
}
|
||||
.btn{
|
||||
width: 690rpx;
|
||||
height: 88rpx;
|
||||
background-color: #ec9a3e;
|
||||
border-radius: 44rpx;
|
||||
font-size: 36rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #ffffff;
|
||||
line-height: 88rpx;
|
||||
text-align: center;
|
||||
position: fixed;
|
||||
bottom: 30rpx;
|
||||
left: 30rpx;
|
||||
}
|
Reference in New Issue
Block a user