Browse Source

../

master
chenxuhui 7 years ago
parent
commit
98d91dc0e8
10 changed files with 260 additions and 28 deletions
  1. +3
    -3
      app.js
  2. +2
    -1
      app.json
  3. +90
    -0
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
  4. +5
    -0
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.json
  5. +62
    -0
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml
  6. +65
    -0
      pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss
  7. +19
    -14
      pages/login/login.js
  8. +6
    -0
      pages/saleForecastList/newBill/newBill.js
  9. +2
    -4
      pages/saleForecastList/newBill/newBill.wxml
  10. +6
    -6
      pages/saleForecastList/saleForecastList.js

+ 3
- 3
app.js View File

@ -13,14 +13,14 @@ App({
DecryptCookie: '',
UserInfo: null,
BaseUrl: "https://miniprogram.food988.com/Rest.aspx",
LoginPath: "/MainSystem/MainSystem/Auth/WeixinLogin",
TransferUrl: 'https://miniprogram.food988.com/RequestTransfer.aspx',
CustomerId: 0,
globalCustomerID: 0,
SelectCustomer_ID: null,
SelectStartDate: null,
SelectEndDate: null,
SelectBillState: null,
billInfo: [],
billInfoUp: []
billInfoUp: [],
shareInState:1,
}
})

+ 2
- 1
app.json View File

@ -16,7 +16,8 @@
"pages/guarantee/detail/detail",
"pages/guarantee/newbill/newbill",
"pages/guarantee/selectbill/selectbill",
"pages/guarantee/detailshow/detailshow"
"pages/guarantee/detailshow/detailshow",
"pages/goodaNameChooseTemplate/goodaNameChooseTemplate"
],
"window": {
"backgroundTextStyle": "light",


+ 90
- 0
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js View File

@ -0,0 +1,90 @@
// pages/goodaNameChooseTemplate/goodaNameChooseTemplate.js
Page({
/**
* 页面的初始数据
*/
data: {
currentTab: 0,
winHeight: 0,
winWidth: 0,
},
/**
* 滑动切换tab
*/
bindChange: function (e) {
var that = this;
that.setData({
currentTab: e.detail.current
});
},
/**
* 点击tab切换
*/
swichNav: function (e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
that.setData({
currentTab: e.target.dataset.current
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

+ 5
- 0
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.json View File

@ -0,0 +1,5 @@
{
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "存货列表"
}

+ 62
- 0
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml View File

@ -0,0 +1,62 @@
<!--pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxml-->
<view class="swiper-tab">
<view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">全部</view>
<view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">收藏夹</view>
</view>
<view class='searchView'>
<input class='imput_goodsName' bindinput='getGoodsName' type='text' placeholder='请输入存货名称' placeholder-style='color:rgb(202, 202, 202)'></input>
<view class='storageView'>收藏</view>
</view>
<swiper current="{{currentTab}}" class="swiper-box" style='height:{{winHeight -83}}px' duration="300" bindchange="bindChange">
<!-- 全部 -->
<swiper-item class="swiper-items1">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="unCheckedScrollUpper" bindscrolltolower="unCheckedScrollLower">
<block wx:for="{{unCheckDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
</swiper-item>
<!-- 收藏夹 -->
<swiper-item class="swiper-items2">
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views' bindscrolltoupper="checkedScrollUpper" bindscrolltolower="CheckedScrollLower">
<block wx:for="{{checkedDataArr}}" wx:for-item="item">
<template is="outStoreOrderTemplate" data="{{item}}" />
</block>
</scroll-view>
</swiper-item>
</swiper>
<image class='xinjian' bindtap="createNew" src="/imgs/create.png"></image>
<button class='chose' catchtap='chose'>筛选</button>
<template name="outStoreOrderTemplate">
<view class='listItem' catchtap='transToOrderDetail' data-detailitemid='{{item.orderID}}' data-detailitemstate='{{item.orderState}}'>
<!-- <view class='orderID'>
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view> -->
<view class='bottomView'>
<!-- <view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}</text>
</view> -->
<view class='goodsNum'>
<text class='goodsIDText'>NO:{{item.orderID}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>流程状态:{{item.workFlowState}}</text>
</view>
</view>
<view class='bottomView'>
<view class='goodsNum'>
<text class='goodsNumText'>{{item.Customer_Name}}</text>
</view>
<view class='goodsMoney'>
<text class='goodsMoneyText'>发货日期:{{item.time}}</text>
</view>
</view>
</view>
</template>

+ 65
- 0
pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss View File

@ -0,0 +1,65 @@
/* pages/goodaNameChooseTemplate/goodaNameChooseTemplate.wxss */
.swiper-tab {
width: 100%;
text-align: center;
line-height: 80rpx;
background: white;
display: flex;
flex-direction: row;
justify-content: space-around;
border-bottom: 0.2rpx solid rgb(236, 231, 231);
}
.swiper-tab-list {
font-size: 30rpx;
width: 25%;
color: #777;
}
.on {
border-bottom: 1.5px solid #2E8CF5 ;
color: #2E8CF5;
}
.searchView{
margin: 20px 20px;
height: 60rpx;
display: flex;
flex-direction: row;
}
.imput_goodsName{
height: 100%;
width: 80%;
}
.storageView{
height: 100%;
width: 20%;
color: orange;
text-align: center;
justify-content: center;
}
.swiper-box {
margin-top: 3px;
display: block;
width: 100%;
overflow: hidden;
}
.swiper-items1 {
height: 100%;
}
.swiper-items2 {
height: 100%;
}
.scroll-views {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}

+ 19
- 14
pages/login/login.js View File

@ -6,25 +6,27 @@ var openID;
var isBindedPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/IsBinded';
var isBindByPhone = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/AccountRpc/XuBindByPhone';
var isBindWeixinPath = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/IsBindWeixinMP';
var getOpenIdByCode = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetMiniOpenIdByCode';
var bindPath = "/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/Bind";
var getBindCustomer = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetBindCustomer';
var getCookie ='/MainSystem/MainSystem/Auth/WeixinLogin';
var getCustomerList = '/MainSystem/B3WeChatMiniProgram/Rpcs/CustomerRpc/GetList';
/**
* 获取绑定客户ID及用户电话 参数1appID 2openID
* 返回值globalCustomerIDWeixinUser_Phone
* 成功调用获取cookie方法及判断是否绑定成功方法
*/
function GetBindCustomer(that) {
let method = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetBindCustomer';
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值
WeixinLogin(function (res) {
// 判断是否绑定成功 参数openid 返回值phoneNum
IsBinded(app.globalData.openID);
});
}
@ -36,11 +38,12 @@ function GetBindCustomer(that) {
* 成功调用是否关注公众号方法
*/
function IsBinded(openid) {
let method = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/AccountRpc/IsBinded';
let method = isBindedPath;
let params = [openid];
network.newRequestLoading(method, params, function (res) {
network.transfer_request(method, params, function (res) {
if (res.result != "") {
app.globalData.phoneNum = res.result;
// 判断是否关注公众号
IsBindWeixinMP(app.globalData.phoneNum)
}
})
@ -53,7 +56,7 @@ function IsBindWeixinMP(phone) {
// res.result = false;
if (res.result == true) {
wx.switchTab({
url: '/pages/indexL/indexL',
url: '/pages/homePage/homePage',
})
} else {
wx.showModal({
@ -66,9 +69,9 @@ function IsBindWeixinMP(phone) {
}
// 获取cookie值 参数1、appID 2、openID
function WeixinLogin(successtion) {
let method = '/MainSystem/MainSystem/Auth/WeixinLogin';
let method = getCookie;
let params = [app.globalData.appID, app.globalData.openID];
network.newRequestLoading(method, params, function (res) {
network.transfer_request(method, params, function (res) {
app.globalData.cookie = res.result;
successtion();
})
@ -76,7 +79,7 @@ function WeixinLogin(successtion) {
//绑定中转服务器客户对应信息 成功判断是否关注公众号
function Bind(that) {
let userInfos = app.globalData.userInfo
let method2 = "/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/Bind";
let method2 = bindPath;
let params2 = [{
"AppId": app.globalData.appID,
"OpenId": app.globalData.openID,
@ -118,22 +121,24 @@ Page({
// 页面生命周期函数
onShow: function () {
var that = this;
/*
//由登录页面进入详情页变更值为0;分享直接进入为1
app.globalData.shareInState = 0;
wx.login({
success: function (res) {
let code = res.code;
let method = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetMiniOpenIdByCode';
let method = getOpenIdByCode;
let params = [app.globalData.appID, code];
// 获取openID
network.requestLoading(method, params, function (res) {
app.globalData.openID = res.result;
// 获取绑定客户ID及用户电话
GetBindCustomer(that)
})
}
});
*/
let method = '/MainSystem/B3WeChatMiniProgram/Rpcs/CustomerRpc/GetList';
// 获取客户列表
let method = getCustomerList;
let params = [];
network.requestLoading(method, params, function (res) {
if (res.result.length > 0) {
@ -191,7 +196,7 @@ Page({
"HeadImgUrl": userInfos.avatarUrl,
"UnionId": ""
}];
network.newRequestLoading(method, params, function (res) {
network.transfer_request(method, params, function (res) {
if (res.result != null) {
app.globalData.phoneNum = that.data.phoneNum;
Bind(that)


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

@ -29,6 +29,12 @@ function GetAccountingUnit(that, inputValue) {
})
}
function choiceCustomer(){
wx.navigateTo({
url: '../../../goodaNameChooseTemplate/goodaNameChooseTemplate',
})
}
function GetCustomer(that, inputValue) {
let method = getCustomer;
let params = [{


+ 2
- 4
pages/saleForecastList/newBill/newBill.wxml View File

@ -9,10 +9,8 @@
<scroll-view scroll-x="false" scroll-y="true" class='scroll-views'>
<view class='baseitem'>
<text class='baseitem_key'>购货客户</text>
<!-- <picker class='baseitem_value' mode='selector' bindchange='choseCustomer' value='{{customerIndex}}' range-key="name" range='{{customer}}'>
<text>{{customer[customerIndex].name}}</text>
</picker> -->
<view class='baseitem_value' bindtap="powerDrawer" data-statu="open" data-x='购货客户' data-item='{{which}}'>
<view class='baseitem_value' bindtap="choiceCustomer" data-statu="open" data-x='购货客户' data-item='{{which}}'>
{{customer[customerIndex].Name}}
</view>
</view>


+ 6
- 6
pages/saleForecastList/saleForecastList.js View File

@ -155,8 +155,8 @@ Page({
onShow: function (options) {
this.setData({
checkedDataArr: [1,2,3],
unCheckDataArr: [1,2,3],
checkedDataArr: [],
unCheckDataArr: [],
Customer_ID: app.globalData.SelectCustomer_ID,
})
var that = this;
@ -168,10 +168,10 @@ Page({
});
}
});
// UnCheckPageIndex = 0;
// CheckedPageIndex = 0;
// getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize);
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
UnCheckPageIndex = 0;
CheckedPageIndex = 0;
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize);
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
},
/**


Loading…
Cancel
Save