增加永久保存本地 还有客户关联客户名称OK
This commit is contained in:
parent
b0d1c23204
commit
f12d1c9dd4
6
app.js
6
app.js
@ -14,6 +14,12 @@ App({
|
||||
username: '441785369@qq.com',
|
||||
password: 'Sj89061189'
|
||||
};
|
||||
const conf = wx.getStorageSync('conf') || {};
|
||||
conf.odooUrl = this.globalData.odooUrl;
|
||||
conf.db = this.globalData.db;
|
||||
conf.username = this.globalData.username;
|
||||
// conf.password = this.globalData.password;
|
||||
wx.setStorageSync('conf', conf)
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
|
@ -3,7 +3,8 @@ const util = require('../../utils/util.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
logs: []
|
||||
logs: [],
|
||||
conf: []
|
||||
},
|
||||
onLoad() {
|
||||
this.setData({
|
||||
@ -12,7 +13,21 @@ Page({
|
||||
date: util.formatTime(new Date(log)),
|
||||
timeStamp: log
|
||||
}
|
||||
}),
|
||||
conf: wx.getStorageSync('conf') || {}
|
||||
})
|
||||
})
|
||||
},
|
||||
clearStorageSync() {
|
||||
wx.clearStorageSync();
|
||||
wx.showToast({
|
||||
title: '缓存已清除',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
// 清除缓存后,可以重新加载数据或重置页面状态
|
||||
this.setData({
|
||||
logs: [],
|
||||
conf: {}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
@ -1,6 +1,10 @@
|
||||
<!--logs.wxml-->
|
||||
<scroll-view class="scrollarea" scroll-y type="list">
|
||||
<button bindtap="clearStorageSync">清除缓存</button>
|
||||
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
|
||||
<view class="log-item">{{index + 1}}. {{log.date}}</view>
|
||||
<view class="log-item">{{index + 1}}. {{conf.username}}</view>
|
||||
<view class="log-item">{{index + 1}}. {{conf.db}}</view>
|
||||
<view class="log-item">{{index + 1}}. {{conf.odooUrl}}</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
|
@ -125,10 +125,12 @@ Page({
|
||||
product_ids = product_ids.map(idObj => idObj.int?._text);
|
||||
}
|
||||
|
||||
// 提取 partner_id
|
||||
const partner_id = item.struct.member.find(member => member.name._text === 'partner_id')?.value.array?.data?.value[0]?.int?._text || '';
|
||||
// 提取 partner_id 和 partner_name
|
||||
const partnerInfo = item.struct.member.find(member => member.name._text === 'partner_id')?.value.array?.data?.value;
|
||||
const partner_id = partnerInfo?.[0]?.int?._text || '';
|
||||
const partner_name = partnerInfo?.[1]?.string?._text || '';
|
||||
|
||||
return { id, name, orde_ddje, date_order, product_ids, partner_id };
|
||||
return { id, name, orde_ddje, date_order, product_ids, partner_id, partner_name };
|
||||
});
|
||||
|
||||
console.log('Data fetched successfully:', partners);
|
||||
@ -162,6 +164,7 @@ Page({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建一个函数来进行 XML-RPC 请求
|
||||
*/
|
||||
@ -287,6 +290,7 @@ Page({
|
||||
订单金额: ${partner.orde_ddje}
|
||||
产品: ${productNames}
|
||||
合作伙伴ID: ${partner.partner_id || '无'}
|
||||
合作伙伴名称: ${partner.partner_name || '无'}
|
||||
`;
|
||||
},
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
num="{{item.date_order || '日期'}}"
|
||||
tag="{{index}}"
|
||||
price="{{item.orde_ddje || '0.00'}}"
|
||||
desc="{{item.partner_id|| '描述信息'}}"
|
||||
desc="{{item.partner_name|| '描述信息'}}"
|
||||
bind:tap="onCardClick"
|
||||
bind:click-thumb="onThumbClick"
|
||||
title="{{item.name || '商品标题'}}"
|
||||
|
Loading…
Reference in New Issue
Block a user