Browse Source

1、首页登录按钮替换

2、test页
master
chenxuhui 7 years ago
parent
commit
9eae8c851c
10 changed files with 142 additions and 24 deletions
  1. +1
    -0
      app.js
  2. +3
    -1
      app.json
  3. BIN
      imgs/bindImage.png
  4. +2
    -2
      pages/customerChooseTemplate/customerChooseTemplate.js
  5. +14
    -19
      pages/order/newBill/newBill.js
  6. +0
    -2
      pages/saleForecastList/newBill/newBill.js
  7. +106
    -0
      pages/startImage/startImage.js
  8. +1
    -0
      pages/startImage/startImage.json
  9. +4
    -0
      pages/startImage/startImage.wxml
  10. +11
    -0
      pages/startImage/startImage.wxss

+ 1
- 0
app.js View File

@ -10,6 +10,7 @@ App({
});
},
globalData: {
customerArray:[],
goodsNameArray:[],


+ 3
- 1
app.json View File

@ -24,7 +24,9 @@
"pages/outStore/outStore",
"pages/outStore/outStoreDetail/outStoreDetail",
"pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail",
"pages/outStore/query/query"
"pages/outStore/query/query",
"pages/startImage/startImage"
],
"window": {
"backgroundTextStyle": "light",


BIN
imgs/bindImage.png View File

Before After
Width: 376  |  Height: 80  |  Size: 10 KiB Width: 1207  |  Height: 258  |  Size: 15 KiB

+ 2
- 2
pages/customerChooseTemplate/customerChooseTemplate.js View File

@ -7,7 +7,7 @@ var utilll = require('../../utils/util.js');
var fromPage = '';
var getAccountingUnit = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit";
var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomerExt";
var getCustomer = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetCustomer";
Page({
@ -31,7 +31,7 @@ Page({
"InputValue": inputValue,
"PageIndex": 0,
"PageSize": 100
}, ["CustomerCatalog_Name"]];
}];//, ["CustomerCatalog_Name"]
network.transfer_request(method, params, function(res) {
that.setData({
customerArray: res.result


+ 14
- 19
pages/order/newBill/newBill.js View File

@ -288,14 +288,10 @@ Page({
this.util();
},
getGoodsNum: function (e) {
var v = e.detail.value;
let end = v.charAt(v.length - 1)
if (end == ".")
return;
getGoodsNum: function(e) {
let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx];
let value = Number(v);
let value = Number(e.detail.value);
if (isNaN(value)) {
wx.showModal({
title: '提示',
@ -314,14 +310,10 @@ Page({
})
},
getSecondNum: function (e) {
var v = e.detail.value;
let end = v.charAt(v.length - 1)
if (end == ".")
return;
getSecondNum: function(e) {
let idx = e.target.dataset.idx;
var detail = this.data.dmo.Details[idx];
let value = Number(v);
let value = Number(e.detail.value);
if (isNaN(value)) {
wx.showModal({
title: '提示',
@ -341,13 +333,9 @@ Page({
},
//
getPrice: function (e) {
var v = e.detail.value;
let end = v.charAt(v.length - 1)
if (end == ".")
return;
getPrice: function(e) {
let idx = e.target.dataset.idx;
let value = Number(v);
let value = Number(e.detail.value);
if (isNaN(value)) {
wx.showToast({
title: '提示',
@ -428,7 +416,14 @@ Page({
})
return;
}
if (dmo.DeliverAddress == "") {
wx.showToast({
title: '请填写送货地址',
})
return;
}
for (var i = 0; i < dmo.Details.length; i++) {
if (dmo.Details[i].SaleGoods_ID == null) {
wx.showToast({


+ 0
- 2
pages/saleForecastList/newBill/newBill.js View File

@ -432,7 +432,6 @@ Page({
network.transfer_request(method, params, function (res) {
if (res.result != null) {
wx.showModal({
title: '新建预报No.' + res.result,
content: '新建成功,是否返回首页',
@ -447,6 +446,5 @@ Page({
})
}
})
},
})

+ 106
- 0
pages/startImage/startImage.js View File

@ -0,0 +1,106 @@
// pages/startImage/startImage.js
var app = getApp();
var network = require("../../utils/net.js");
var getOpenIdByCode = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetMiniOpenIdByCode';
var getBindCustomer = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetBindCustomer';
var getCookie = '/MainSystem/MainSystem/Auth/WeixinLogin';
var isBindedPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/IsBinded';
var isBindWeixinPath = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/IsBindWeixinMP';
Page({
data: {
},
onShow: function() {
var that = this;
wx.login({
success: function(res) {
let code = res.code;
let method = getOpenIdByCode;
let params = [app.globalData.appID, code];
// 获取openID
network.requestLoading(method, params, function(res) {
app.globalData.openID = res.result;
// 获取绑定客户ID及用户电话
that.GetBindCustomer();
})
}
});
},
/**
* 获取绑定客户ID及用户电话 参数1appID 2openID
* 返回值globalCustomerIDWeixinUser_Phone
* 成功调用获取cookie方法及判断是否绑定成功方法
*/
GetBindCustomer: function() {
var that = this;
let method = getBindCustomer;
let params = [app.globalData.appID, app.globalData.openID];
network.requestLoading(method, params, function(res) {
if (res.result != null) {
app.globalData.globalCustomerID = res.result.ID;
app.globalData.phoneNum = res.result.WeixinUser_Phone;
// 获取cookie值
that.WeixinLogin(function(res) {
// 判断是否绑定成功 参数openid 返回值phoneNum
that.IsBinded(app.globalData.openID);
});
}
})
},
// 获取cookie值 参数1、appID 2、openID
WeixinLogin: function(successtion) {
var that = this;
let method = getCookie;
let params = [app.globalData.appID, app.globalData.openID];
network.transfer_request(method, params, function(res) {
app.globalData.cookie = res.result;
successtion();
})
},
/**
* 判断是否绑定成功 参数openid
* 返回值phoneNum
* 成功调用是否关注公众号方法
*/
IsBinded: function(openid) {
var that = this;
let method = isBindedPath;
let params = [openid];
network.transfer_request(method, params, function(res) {
if (res.result != "") {
app.globalData.phoneNum = res.result;
// 判断是否关注公众号
that.IsBindWeixinMP(app.globalData.phoneNum)
}
})
},
// 判断是否关注公众号 参数phone 返回值bool 成功进入首页
IsBindWeixinMP: function(phone) {
let method = isBindWeixinPath;
let params = [phone];
network.requestLoading(method, params, function(res) {
// res.result = false;
if (res.result == true) {
wx.switchTab({
url: '/pages/homePage/homePage',
})
} else {
wx.showModal({
title: '提示',
content: '请关注公众号',
showCancel: false,
})
}
})
},
})

+ 1
- 0
pages/startImage/startImage.json View File

@ -0,0 +1 @@
{}

+ 4
- 0
pages/startImage/startImage.wxml View File

@ -0,0 +1,4 @@
<!--pages/startImage/startImage.wxml-->
<view class='container'>
</view>

+ 11
- 0
pages/startImage/startImage.wxss View File

@ -0,0 +1,11 @@
/* pages/startImage/startImage.wxss */
page{
width: 100%;
height: 100%;
}
.container{
width: 100%;
height: 100%;
background-color: blue;
}

Loading…
Cancel
Save