作者 李洪娟

提交

... ... @@ -2,6 +2,56 @@
App({
onLaunch: function () {
// 展示本地存储能力
wx.request({
url: 'http://39.97.184.199:8080/CommonInterface/GetToken',
method: 'POST',
success: function (res) {//返回取得的数据
console.log(res.data.ResultObj)
wx.setStorageSync('authToken', res.data.ResultObj)
if (res.data.code == '20000') {
resolve(res.data.data);
}
},
fail: function (e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
},
complate() {
wx.hideLoading({
title: '加载中',
})
}
})
// wx.request({
// url: 'http://39.97.184.199:8080//Staff/GetAccessToken',
// method: 'POST',
// success: function (res) {//返回取得的数据
// console.log(res.data.ResultObj)
// wx.setStorageSync('authToken', res.data.ResultObj)
// if (res.data.code == '20000') {
// resolve(res.data.data);
// }
// },
// fail: function (e) {
// reject('网络出错');
// // wx.hideLoading()
// wx.hideNavigationBarLoading()
// },
// complate() {
// wx.hideLoading({
// title: '加载中',
// })
// }
// })
},
... ... @@ -18,23 +68,24 @@ App({
// wx.showLoading({
// title: '加载中',
// })
let that = this;
wx.showNavigationBarLoading()
wx.showLoading({
title: '加载中',
})
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'http://39.97.184.199:8080';
//网络请求
let header = {
'content-type': 'application/x-www-form-urlencoded'
'content-type': 'application/x-www-form-urlencoded',
'authToken': wx.getStorageSync('authToken')||''
}
header = Object.assign(header, headerParams)
wx.request({
url: baseUrl + url,
url: that.globalData.baseUrl + url,
data: postData,
method: 'POST',
header: header,
... ... @@ -124,6 +175,10 @@ App({
},
//上传文件
upload(filetype, file) {
... ... @@ -171,7 +226,9 @@ App({
return promise;
},
globalData: {
userInfo: null
userInfo: null,
baseUrl : 'http://39.97.184.199:8080'
},
... ...
... ... @@ -2,6 +2,7 @@
// const app = getApp();
// import menu from '../template/template'
const app=getApp()
Page({
/**
... ... @@ -18,9 +19,6 @@ Page({
interval: 2000,
duration: 1000,
currentSwiper: 0,
imgUrlsmiddle:[
'../../img/middlebanner1.png',
'../../img/middlebanner1.png',
... ... @@ -38,8 +36,37 @@ Page({
onLoad: function (options) {
this.gethomeinfo();
this.getaccessToken()
},
getaccessToken() {
let that = this;
var url = '/Staff/GetAccessToken';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
gethomeinfo(){
let that = this;
var url = '/Notice/SelectNoticeMessage';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
jump(e) {
... ...
// pages/shopcar/shopcar.js
const app=getApp();
Page({
/**
... ... @@ -38,6 +39,7 @@ Page({
allselect: false,
money: 0,
arr: [],
suid:''
},
... ... @@ -63,6 +65,23 @@ Page({
that.setData({
items: newitems
})
that.getaddress()
},
//获取收货地址
getaddress(){
let that = this;
var url = '/Address/SelectAddressList';
var params = {
suid: that.data.suid,
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
//新建地址
newaddress(){
... ... @@ -78,6 +97,8 @@ Page({
url: '/pages/myinfo/newaddress/newaddress',
})
},
//选择数量
select(e) {
let that = this;
... ... @@ -159,9 +180,26 @@ Page({
},
//删除事件
del: function (e) {
let that = this;
// this.data.items.splice(e.currentTarget.dataset.index, 1)
this.setData({
items: this.data.items
that.setData({
items: that.data.items
})
console.log(9090)
let id = e.currentTarget.dataset.id;
let url = '/Address/DelAddress', params = {
id: id
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
... ...
... ... @@ -59,7 +59,7 @@
</view>
<view class="del" catchtap="del" data-index="{{index}}">删除</view>
<view class="del" catchtap="del" data-index="{{index}}" data-id="{{item.id}}">删除</view>
</view>
<view class="clearshop" bindtap="newaddress">+新建地址</view>
... ...
... ... @@ -11,7 +11,15 @@ Page({
//身份证正面
fronthumb:'',
//身份证反面
beithumb:''
beithumb:'',
//姓名
entername:'',
//手机号
phone:'',
//详细地址
address:'',
//身份证号
identitynumber:''
},
/**
... ... @@ -66,6 +74,137 @@ Page({
fail: function (res) { }
})
},
//姓名
entername(e){
this.setData({
name:e.detail.value
})
},
//手机号
enterphone(e){
this.setData({
phone:e.detail.value
})
},
//详细地址
detailaddress(){
this.setData({
address:e.detail.value
})
},
//身份证号
entercard(e){
this.setData({
identitynumber:e.detail.value
})
},
//提交审核
subshen(){
let that = this;
if(that.data.name==''){
wx.showToast({
title: '请填写姓名',
icon:"none"
})
return false
}
if(that.data.phone==''){
wx.showToast({
title: '请输入手机号',
icon:'none'
})
return false
}
let reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
if(!reg.test(that.data.phone)){
wx.showToast({
title: '请输入正确的手机号',
icon:'none'
})
return false
}
if (that.data.reginname ='省份 城市 区域'){
wx.showToast({
title: '请选择地址',
icon:'none'
})
return false
}
if(that.data.address==''){
wx.showToast({
title: '请输入详细地址',
icon:'none'
})
return false
}
if (that.data.identitynumber==''){
wx.showToast({
title: '请输入身份证号',
icon:'none'
})
return false
}
let cardreg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (!cardreg.test(that.data.identitynumber)){
wx.showToast({
title: '请输入正确的身份证号',
icon: 'none'
})
return false
}
if (that.data.fronthumb==''){
wx.showToast({
title: '请上传身份证正面照',
icon: 'none'
})
return false
}
if (that.data.beithumb == '') {
wx.showToast({
title: '请上传身份证反面照',
icon: 'none'
})
return false
}
let url = '/api/portal/archives/archivesList', params = {
suid: that.data.suid,
name:that.data.name,
phone:that.data.phone,
identitynumber: taht.data.identitynumber,
city:that.data.cityid,
area:that.data.areaid,
address: that.data.address,
front: that.data.fronthumb,
rear: that.data.beithumb
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -4,13 +4,13 @@
<view class="applayofhomeitem">
<view class='applayofhomeleft'>申请人:</view>
<view class='applayofhomeright'>
<input placeholder='姓名' />
<input placeholder='姓名' bindinput="entername"/>
</view>
</view>
<view class="applayofhomeitem">
<view class='applayofhomeleft'>手机号:</view>
<view class='applayofhomeright'>
<input placeholder='联系电话' type="number"/>
<input placeholder='联系电话' type="number" bindinput="enterphone"/>
</view>
</view>
... ... @@ -29,14 +29,14 @@
<view class="applayofhomeitem">
<view class='applayofhomeleft'>详细地址:</view>
<view class='applayofhomeright'>
<input placeholder='楼号 / 单元 / 门牌号' />
<input placeholder='楼号 / 单元 / 门牌号' bindinput="detailaddress"/>
</view>
</view>
<view class="applayofhomeitem">
<view class='applayofhomeleft'>身份证号:</view>
<view class='applayofhomeright'>
<input placeholder='身份证号' />
<input placeholder='身份证号' bindinput="entercard"/>
</view>
</view>
</view>
... ... @@ -71,4 +71,4 @@
</view>
</view>
<view class="clearshop">提交审核</view>
\ No newline at end of file
<view class="clearshop" bindtap="subshen">提交审核</view>
\ No newline at end of file
... ...
... ... @@ -13,7 +13,8 @@ Page({
currentTime: 60,
code: '',
success:false,
lose: false
lose: false,
openid:''
},
/**
... ... @@ -54,7 +55,6 @@ Page({
icon: 'none'
})
}else if (!reg.test(phone)) {
wx.showToast({
title: '请填写正确的手机号',
... ... @@ -85,16 +85,80 @@ Page({
})
}
}, 1000)
var url = '/Vertificateion/AddVertificateCode';
var params = {
phone: that.data.phonenum,
msgType:1
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
}
},
sub(){
//输入手机号验证码
entercode(e) {
this.setData({
success:true
code: e.detail.value
})
},
sub(){
// this.setData({
// success:true
// })
let that = this;
if (that.data.phonenum == '') {
wx.showToast({
title: '请输入手机号',
icon: 'none'
})
return false
}
let reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
let phone = that.data.phonenum;
if (!reg.test(phone)) {
wx.showToast({
title: '请填写正确的手机号',
icon: 'none'
})
return false
}
if (that.data.code == '') {
wx.showToast({
title: '请输入验证码',
icon: 'none'
})
return false
}
let url = '/Staff/ActivateAccount_Living', params = {
phone: that.data.phonenum,
openid: that.data.openid,
code: that.data.code
};
app.post(url, params).then(res => {
console.log(res);
}).catch((err) => {
})
},
/**
... ...
... ... @@ -34,7 +34,7 @@
<view class="phonenum codeenter">
<view class="codenum">
<input placeholder='请输入手机号验证码'/>
<input placeholder='请输入手机号验证码' bindinput="entercode"/>
</view>
<button class="getcode" bindtap="getcode" disabled="{{disable}}">
{{time}}
... ...
... ... @@ -5,7 +5,9 @@ Page({
* 页面的初始数据
*/
data: {
select:false
select:false,
money:'',
suid:""
},
/**
... ... @@ -24,6 +26,38 @@ Page({
select:!this.data.select
})
},
//输入提现金额
entermoney(e){
this.setData({
money:e.detail.value
})
},
//提现
getmoney(){
let that = this;
if(that.data.money==''){
wx.showToast({
title: '请输入提现金额',
icon:'none'
})
return false
}
let url = '/api/portal/archives/archivesList', params = {
cash: that.data.money,
suid:that.data.suid
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -5,7 +5,7 @@
<text class="entersign">¥</text>
<view class="enterinput">
<input placeholder='输入申请提现金额' type="number"/>
<input placeholder='输入申请提现金额' type="number" bindinput="entermoney"/>
</view>
</view>
</view>
... ...
// pages/myinfo/mymessage/mymessage.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
suid:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getmymessage()
},
getmymessage(){
let that = this;
let url = '/Message/SelectMessageList', params = {
suid: that.data.suid,
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
... ...
... ... @@ -13,7 +13,12 @@ Page({
//身份证反面
beithumb: '',
selectkind:['住宅','公司','学校','家人','住宅','住宅'],
currnetindex:0
currnetindex:0,
suid:'',
name:'',
phone:'',
address:'',
tagId:''
},
/**
... ... @@ -74,6 +79,94 @@ Page({
fail: function (res) { }
})
},
//输入姓名
entername(e){
this.setData({
name:e.detail.value
})
},
//电话
enterphone(e){
this.setData({
phone:e.detail.value
})
},
//详细地址
enteraddress(e){
this.setData({
address:e.detail.value
})
},
//新增收货地址
saveaddress(){
let that = this;
if(that.data.name==''){
wx.showToast({
title: '请输入姓名',
icon:'none'
})
return false
}
if (that.data.phone == '') {
wx.showToast({
title: '请输入电话',
icon: 'none'
})
return false
}
let reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
if (!reg.test(that.data.phone)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return false
}
if (that.data.reginname == '省份 城市 区域') {
wx.showToast({
title: '请输入省份',
icon: 'none'
})
return false
}
if (that.data.address == '') {
wx.showToast({
title: '请输入详细地址',
icon: 'none'
})
return false
}
let url = '/Address/AddAddress', params = {
name:that.data.name,
phone:that.data.phone,
suid:that.data.suid,
provinceId: that.data.provinceId,
cityId: that.data.cityId,
zoneid: that.data.zoneid,
address: that.data.address,
tagId: that.data.tagId
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -2,13 +2,13 @@
<view class="applayofhomeitem">
<view class='applayofhomeleft'>姓名:</view>
<view class='applayofhomeright'>
<input placeholder='请输入姓名' />
<input placeholder='请输入姓名' bindinput="entername"/>
</view>
</view>
<view class="applayofhomeitem">
<view class='applayofhomeleft'>电话:</view>
<view class='applayofhomeright'>
<input placeholder='请输入电话' />
<input placeholder='请输入电话' bindinput="enterphone"/>
</view>
</view>
... ... @@ -27,7 +27,7 @@
<view class="applayofhomeitem">
<view class='applayofhomeleft'>详细地址:</view>
<view class='applayofhomeright'>
<input placeholder='详细地址' />
<input placeholder='详细地址' bindinput="enteraddress"/>
</view>
</view>
</view>
... ... @@ -42,4 +42,4 @@
<view class="clearshop">保存</view>
\ No newline at end of file
<view class="clearshop" bindatap="saveaddress">保存</view>
\ No newline at end of file
... ...
... ... @@ -13,7 +13,8 @@ Page({
currentTime: 60,
code: '',
success: false,
lose: false
lose: false,
openid:''
},
/**
... ... @@ -88,28 +89,77 @@ Page({
})
}
}, 1000)
var url = '/Vertificateion/AddVertificateCode';
var params = {
phone: that.data.phonenum,
msgType:2
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
}
},
sub() {
// this.setData({
// success: true
// })
//输入手机号验证码
entercode(e){
this.setData({
code:e.detail.value
})
},
sub() {
let that = this;
var url = '/Address/AddAddress';
var params = {
token: wx.getStorageSync('token'),
if (that.data.phonenum==''){
wx.showToast({
title: '请输入手机号',
icon:'none'
})
return false
}
let reg = /^[1][3,4,5,6,7,8][0-9]{9}$/;
let phone = that.data.phonenum;
if (!reg.test(phone)) {
wx.showToast({
title: '请填写正确的手机号',
icon: 'none'
})
return false
}
app.post(url, params).then((res) => {
console.log(res);
if(that.data.code==''){
wx.showToast({
title: '请输入验证码',
icon: 'none'
})
return false
}
// this.setData({
// success: true
// })
let url = '/Address/AddAddress',params = {
phone: that.data.phonenum,
openid:that.data.openid,
code:that.data.code
};
app.post(url, params).then(res => {
console.log(res);
}).catch((err) => {
})
... ...
... ... @@ -34,7 +34,7 @@
<view class="phonenum codeenter">
<view class="codenum">
<input placeholder='请输入手机号验证码'/>
<input placeholder='请输入手机号验证码' bindinput="entercode"/>
</view>
<button class="getcode" bindtap="getcode" disabled="{{disable}}">
{{time}}
... ...
// pages/myinfo/widthdrawcashlist/widthdrawcashlist.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
suid:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getmoneylist()
},
getmoneylist(){
let that = this;
let url = '/Staff/SelectWithdrawRecord', params = {
suid: that.data.suid,
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
... ...
// pages/ordercontainer/income/income.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
suid:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getmoney()
},
//获取员工可提现总额
getmoney(){
let that = this;
let url = '/Staff/SelectPersonWithdrawByUserId', params = {
suid: that.data.suid,
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
//可提现
... ...
... ... @@ -64,6 +64,22 @@ Page({
this.setData({
num: wx.getStorageSync('num')
})
this.getshop()
},
//获取商品列表
getshop(){
let that = this;
let url = '/Product/SelectProductList', params = {
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
//底部导航跳转
jump(e) {
... ...
... ... @@ -14,7 +14,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.6.4",
"appid": "wx1f51f42105b63343",
"appid": "wxa714aad2a58f444d",
"projectname": "weijing",
"debugOptions": {
"hidedInDevtools": []
... ...