瀏覽代碼

优化

master
pangdongxu 3 年之前
父節點
當前提交
6c1ed9ed84
共有 5 個檔案被更改,包括 73 行新增23 行删除
  1. +53
    -15
      pages/payee/add/add.js
  2. +6
    -0
      pages/payee/list/list.js
  3. +8
    -6
      pages/payee/list/list.wxml
  4. +1
    -1
      project.private.config.json
  5. +5
    -1
      utils/API.js

+ 53
- 15
pages/payee/add/add.js 查看文件

@@ -33,20 +33,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {
var that = this ;
that.setData({
projectId:options.id
})
var that = this; var that = this;
// 所属银行字典查询 // 所属银行字典查询
UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, { UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'bank_type', {method:'GET'}, {
@@ -73,6 +63,44 @@ Page({
}) })
} }
}) })
if(options.id){
UTIL.httpRequest(API.URL_GET_PAYEEGET + options.id, {method:'GET'}, {
success: (res) => {
UTIL.httpRequest(API.URL_GET_DEPOSITLIST, {method:'GET',bankType:res.data.bankType,status:'0'}, {
success: (res2) => {
that.setData({
depositOptions:res2.rows,
})
console.log(res.data.bankType)
console.log(res2.rows)
if(res.data.bankType!="999"){
res.data.bankDepositText = res2.rows.filter(function (e) { return e.id == res.data.bankDeposit; })[0].bankDeposit;
}
res.data.payeeTypeText = UTIL.getTransform(res.data.payeeType,that.data.payeeTypeOptions);
res.data.bankTypeText = UTIL.getTransform(res.data.bankType,that.data.bankTypeOptions);
that.setData({
form:res.data,
})
}
})
}
})
}
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {

},

/**
* 生命周期函数--监听页面显示
*/
onShow() {
}, },
back:function(){ back:function(){
@@ -176,7 +204,17 @@ Page({
that.setData({ that.setData({
['form.method']:'POST' ['form.method']:'POST'
}) })
UTIL.httpRequest(API.URL_GET_PAYEEADD, that.data.form, {

let url = '';

if(this.data.projectId){
url = API.URL_GET_PAYEEEDIT;
console.log("修改");
}else{
url = API.URL_GET_PAYEEADD;
console.log("新增");
}
UTIL.httpRequest(url, that.data.form, {
success: (res) => { success: (res) => {
if (res.code == API.SUCCESS_CODE) { if (res.code == API.SUCCESS_CODE) {
wx.showToast({ wx.showToast({


+ 6
- 0
pages/payee/list/list.js 查看文件

@@ -157,6 +157,12 @@ Page({


}, },


goEdit(e){
wx.navigateTo({
url: '/pages/payee/add/add?id='+e.currentTarget.dataset.id,
})
},

/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */


+ 8
- 6
pages/payee/list/list.wxml 查看文件

@@ -15,14 +15,11 @@
/> />
<view class="add_btn" bindtap="goAdd"><text>新增</text></view> <view class="add_btn" bindtap="goAdd"><text>新增</text></view>
</view> </view>
<van-cell-group>

<van-swipe-cell right-width="{{ 65 }}" class="workflow" wx:for="{{list}}" data-index="{{ index }}" data-id="{{item.id}}" bindtap="goEdit" wx:key="index">
<van-cell <van-cell
wx:for="{{ list }}"
wx:key="index"
value-class="value-class" value-class="value-class"
clickable clickable
data-index="{{ index }}"
bind:click="toggle"
use-label-slot use-label-slot
> >
<view slot="icon" style="margin-right: 10px;"> <view slot="icon" style="margin-right: 10px;">
@@ -39,7 +36,12 @@
<text decode = "{{true}}">{{item.payeeAccountText}}&emsp;&emsp;&emsp;&emsp;{{item.bankTypeText}}</text> <text decode = "{{true}}">{{item.payeeAccountText}}&emsp;&emsp;&emsp;&emsp;{{item.bankTypeText}}</text>
</view> </view>
</van-cell> </van-cell>
</van-cell-group>
<view slot="right" class="deleteBox">
<view style="flex: 1;height: 100%;display: flex;align-items: center;">
<image src="../../image/apply/icon_delete.png" style="width: 25px;height: 25px;margin: 0 auto;" data-id="{{item.id}}" data-index="{{index}}" bindtap="delete"></image>
</view>
</view>
</van-swipe-cell>
<view class="ipXbtn"></view> <view class="ipXbtn"></view>


</scroll-view> </scroll-view>

+ 1
- 1
project.private.config.json 查看文件

@@ -1,6 +1,6 @@
{ {
"setting": { "setting": {
"compileHotReLoad": true
"compileHotReLoad": false
}, },
"condition": { "condition": {
"miniprogram": { "miniprogram": {


+ 5
- 1
utils/API.js 查看文件

@@ -274,6 +274,9 @@ const URL_GET_PASSWORDEDIT = `${URL_PREFIX}/cashier/account/editPassWord`;
//收款人修改 //收款人修改
const URL_GET_PAYEEEDIT = `${URL_PREFIX}/yinnong/payee/edit`; const URL_GET_PAYEEEDIT = `${URL_PREFIX}/yinnong/payee/edit`;


//收款人查询
const URL_GET_PAYEEGET = `${URL_PREFIX}/yinnong/payee/get/`;





/****************接口地址end****************/ /****************接口地址end****************/
@@ -380,5 +383,6 @@ export {
URL_GET_PROJECTADD, URL_GET_PROJECTADD,
URL_GET_PROJECTDELETE, URL_GET_PROJECTDELETE,
URL_GET_PASSWORDEDIT, URL_GET_PASSWORDEDIT,
URL_GET_PAYEEEDIT
URL_GET_PAYEEEDIT,
URL_GET_PAYEEGET
} }

Loading…
取消
儲存