Commit 9292c60e by 施宇

Merge branch 'master' of http://119.23.72.7/shiyu/icsalesProgram

# Conflicts:
#	pages/tab/me/me.js
#	utils/util.js
parents 8d410c00 15f42ea0
......@@ -45,9 +45,9 @@ App({
success(res) {
if (res.data) {
wx.switchTab({
url: '/pages/tab/home/home'
});
// wx.switchTab({
// url: '/pages/tab/home/home'
// });
}
}
......@@ -59,9 +59,9 @@ App({
success(res) {
if (res.authSetting['scope.userInfo']) {
// 已经授权
wx.switchTab({
url: '/pages/tab/home/home'
})
// wx.switchTab({
// url: '/pages/tab/home/home'
// })
}
}
});
......
......@@ -9,7 +9,7 @@
"pages/person/agreement/index",
"pages/person/successfully/index",
"pages/tab/home/home",
"pages/form/good/index",
"pages/form/good/index",
"pages/tab/good/good",
"pages/tab/price/price",
"pages/form/bj/index",
......@@ -29,7 +29,8 @@
"pages/person/certification/addcertification/index",
"pages/person/certification/certificationmanage/index",
"pages/person/company/index",
"pages/person/editcompany/index"
"pages/person/editcompany/index",
"pages/person/welfare/index"
],
"window": {
"backgroundTextStyle": "light",
......
......@@ -15,56 +15,56 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
},
/**
......@@ -86,6 +86,9 @@ Page({
data: res.data.access_token
});
//登录环信帐号
getApp().getImUser();
wx.switchTab({
url: '/pages/tab/home/home'
});
......@@ -99,4 +102,4 @@ Page({
});
}
}
})
})
\ No newline at end of file
......@@ -4,6 +4,9 @@ import {
} from '../../../utils/api.js';
Page({
/**
......@@ -226,6 +229,11 @@ Page({
data: res.data.user_id
});
//登录环信帐号
getApp().getImUser();
wx.switchTab({
url: '/pages/tab/home/home'
})
......
......@@ -36,67 +36,67 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
},
/**
* 获取验证码
*/
getCode: function() {
getCode: function () {
let self = this;
let currentTime = this.data.currentTime;
let interval = setInterval(function() {
let interval = setInterval(function () {
currentTime--;
......@@ -120,7 +120,7 @@ Page({
/**
* 发送验证码
*/
getVerificationCode: function(e) {
getVerificationCode: function (e) {
//验证必填手机号
if (this.data.formData.mobile) {
......@@ -130,7 +130,7 @@ Page({
//是否填写了验证码
if (this.data.captcha) {
http.getData(apis.getRegistCode,'GET',{
http.getData(apis.getRegistCode, 'GET', {
captchaUuid: this.data.captchaUuid,
captcha: this.data.captcha,
mobile: this.data.formData.mobile,
......@@ -180,13 +180,13 @@ Page({
/**
* 刷新图形验证码
*/
refreshVerification: function() {
refreshVerification: function () {
this.setData({
vcode: true
});
http.getData(apis.captchaInfo,'GET',null, (res) => {
http.getData(apis.captchaInfo, 'GET', null, (res) => {
this.setData({
captchaUrl: res.captchaUrl,
captchaUuid: res.captchaUuid
......@@ -196,7 +196,7 @@ Page({
/**
* 校验字段
*/
bindinputFn: function(e) {
bindinputFn: function (e) {
let value = e.detail.value
let reg_mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;
let reg_pwd = /^[0-9A-Za-z]{6,}$/;
......@@ -274,7 +274,7 @@ Page({
/**
* 校验字段
*/
calcForm: function(val, type) {
calcForm: function (val, type) {
let mobile = val.mobile;
let code = val.code;
let password = val.password;
......@@ -346,7 +346,7 @@ Page({
/**
*注册
*/
formSubmit: function(e) {
formSubmit: function (e) {
if (this.calcForm(e.detail.value)) {
......@@ -355,7 +355,7 @@ Page({
loading: true
});
http.getData(apis.authRegister,'POST', e.detail.value, (res) => {
http.getData(apis.authRegister, 'POST', e.detail.value, (res) => {
if (res.err_code === 0) {
//注入token
......@@ -364,11 +364,16 @@ Page({
data: res.data.access_token
});
//登录环信帐号
getApp().getImUser();
wx.navigateTo({
url: '/pages/person/successfully/index'
});
}else if(res.err_code === 500){
} else if (res.err_code === 500) {
//图形验证码不正确的时候
this.refreshVerification();
wx.showToast({
......@@ -383,7 +388,7 @@ Page({
duration: 2000
});
}
this.setData({
disabledBtn: false,
loading: false
......@@ -394,7 +399,7 @@ Page({
/**
* 密码是否可见
*/
toggleFn: function(e) {
toggleFn: function (e) {
if (this.data['visiblePwd']) {
......@@ -412,4 +417,4 @@ Page({
}
}
})
})
\ No newline at end of file
......@@ -32,67 +32,67 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
},
/**
* 获取验证码
*/
getCode: function() {
getCode: function () {
let self = this;
let currentTime = this.data.currentTime;
let interval = setInterval(function() {
let interval = setInterval(function () {
currentTime--;
......@@ -116,7 +116,7 @@ Page({
/**
* 发送验证码
*/
getVerificationCode: function(e) {
getVerificationCode: function (e) {
//验证必填手机号
if (this.data.formData.mobile) {
......@@ -176,7 +176,7 @@ Page({
/**
* 刷新图形验证码
*/
refreshVerification: function() {
refreshVerification: function () {
this.setData({
vcode: true
......@@ -192,24 +192,24 @@ Page({
/**
* 校验字段
*/
bindinputFn: function(e) {
bindinputFn: function (e) {
let value = e.detail.value
let reg_mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;
if (e.currentTarget.dataset.type == 1) {
if (value) {
this.setData({
error: true,
errorText: '请填写正确的手机号',
mobileFlag: true
});
if (reg_mobile.test(value)) {
wx.hideKeyboard();
this.setData({
'formData.mobile': value,
'formData.mobile': value,
error: false,
errorText: '',
mobileFlag: false
......@@ -245,7 +245,7 @@ Page({
/**
* 校验字段
*/
calcForm: function(val, type) {
calcForm: function (val, type) {
let mobile = val.mobile;
let code = val.code;
let reg_mobile = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/;
......@@ -293,7 +293,7 @@ Page({
/**
* 登录
*/
formSubmit: function(e) {
formSubmit: function (e) {
if (this.calcForm(e.detail.value)) {
......@@ -311,6 +311,9 @@ Page({
data: res.data.access_token
});
//登录环信帐号
getApp().getImUser();
wx.switchTab({
url: '/pages/tab/home/home'
})
......@@ -337,4 +340,4 @@ Page({
});
}
}
})
})
\ No newline at end of file
// pages/person/welfare/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "福利中心"
}
\ No newline at end of file
This diff could not be displayed because it is too large.
<view class="welfare" hover-class="none" hover-stop-propagation="false">
<view class="head row verCenter bothSide boxsiz">
<view class="column">
<view class="red-text">
<text class="icon iconfont iconiconxiantiaoshouji27"></text>
<text class="t1">我的红包</text>
</view>
<view class="num">
<text class="t1">10.93</text>
<text class="t2">元</text>
</view>
<view class="code-text">
<text class="t1">红包码:</text>
<text class="t2">RDD23423</text>
</view>
</view>
<view class="column">
<text class="rule">查看规则</text>
<view class="exchange row verCenter ">
<text class="t1">兑换记录</text>
<view class="t2 row verCenter rowCenter">
<text class="icon iconfont iconiconxiantiaoshouji28"></text>
<text>提现兑换</text>
</view>
</view>
</view>
</view>
<view class="list">
</view>
</view>
\ No newline at end of file
This diff could not be displayed because it is too large.
......@@ -28,6 +28,22 @@ Page({
if (!http.judgeToken(true)){
return
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//获取数量统计
http.getData(apis.countBusiness, 'GET', {
token: wx.getStorageSync('access_token')
......@@ -39,6 +55,7 @@ Page({
}
}, true);
//获取用户信息
http.getData(apis.userInfo, 'GET', {
token: wx.getStorageSync('access_token')
}, (res) => {
......@@ -48,21 +65,6 @@ Page({
});
}
}, true);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
......@@ -103,15 +105,15 @@ Page({
* 跳转地址
*/
toUrl: function (e) {
console.log(e)
//认证管理
if (e.target.dataset.type == 'certification') {
if (e.target.dataset.status == null) {
wx.navigateTo({
url:"/pages/person/certification/addcertification/index"
url: "/pages/person/certification/addcertification/index"
});
}else if(e.target.dataset.status == 1){
} else if (e.target.dataset.status == 1) {
}
......
......@@ -94,11 +94,11 @@
<view class="hr"></view>
<view class="boxsiz bar row bothSide verCenter bor" data-url="/pages/person/setting/index" bind:tap="toUrl">
<view>
<text class="icon iconfont iconiconcaiseshouye"></text>
<text class="t1">设置</text>
<text class="icon iconfont iconiconcaiseshouye" data-url="/pages/person/setting/index"></text>
<text class="t1" data-url="/pages/person/setting/index">设置</text>
</view>
<view>
<text class="icon iconfont iconChevron"></text>
<text class="icon iconfont iconChevron" data-url="/pages/person/setting/index"></text>
</view>
</view>
<view class="boxsiz bar row bothSide verCenter bor">
......
......@@ -48,7 +48,7 @@
"list": []
},
"miniprogram": {
"current": 7,
"current": 9,
"list": [
{
"id": -1,
......@@ -105,6 +105,19 @@
"pathName": "pages/detail/chat/index",
"query": "username={\"myName\":\"7a2765fc7caa5e512a6d1270bcf98bf0\",\"your\":\"06b6a13c7ae849be08c98ceeefd6ee7f\",\"name\":\"sy\",\"name1\":\"11\",\"id\":\"53\",\"touserid\":\"54\",\"title\":\"11\",\"img\":\"http://img.icsales.com/test/images/icsales/201907/18/ee8b86dc8cac0e5df402a72d77a1b75e.png\",\"img1\":\"http://img.icsales.com/test/images/icsales/201907/18/767111a5b24e07d950506ea9452ff57c.jpg\"}",
"scene": null
},
{
"id": -1,
"name": "pages/tab/me/me",
"pathName": "pages/tab/me/me",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/welfare/index",
"pathName": "pages/person/welfare/index",
"scene": null
}
]
}
......
......@@ -78,6 +78,90 @@ const getData = (url, type, param, callBack, loading, isheader, istoken) => {
}
})
wx.showNavigationBarLoading();
var token, header;
//获取token
token = wx.getStorageSync('access_token');
//参数字段追加来源字段,token字段
if (istoken) {
var params = Object.assign({}, param, {
source: 1,
token: token
});
} else {
var params = Object.assign({}, param, {
source: 1
});
}
//是否启用loading加载效果
if (loading) {
wx.showLoading();
}
//是否启用请求头token
if (isheader) {
header = {
"Content-Type": "applciation/json",
"Authorization": 'Bearer ' + token
}
} else {
header = {
"Content-Type": "applciation/json"
}
}
wx.request({
url: url,
data: params,
header: header,
method: type,
success: (res) => {
//处理token失效的情况
if (res.data.hasOwnProperty('data')) {
if (res.data.err_code === 501 || res.data.errcode === 501) {
wx.navigateTo({
url: '/pages/person/login/index'
});
} else {
typeof callBack == "function" && callBack(res.data, "");
}
} else {
if (res.data.err_code === 501 || res.data.errcode === 501) {
wx.navigateTo({
url: '/pages/person/login/index'
});
} else {
typeof callBack == "function" && callBack(res.data, "");
}
}
wx.hideNavigationBarLoading();
if (loading) {
wx.hideLoading();
}
},
fail: (err) => {
typeof callBack == "function" && callBack(null, err.errMsg);
console.log(err);
wx.hideNavigationBarLoading();
if (loading) {
wx.hideLoading();
}
}
})
};
//上传文件
......
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