|
@@ -1,188 +0,0 @@
|
|
|
-const _Http = getApp().globalData.http;
|
|
|
|
|
-import currency from "../../../utils/currency";
|
|
|
|
|
-let content = {
|
|
|
|
|
- nocache: true,
|
|
|
|
|
- "isExport": 0,
|
|
|
|
|
- "pageNumber": 1,
|
|
|
|
|
- "pageTotal": 1,
|
|
|
|
|
- pageSize: 20,
|
|
|
|
|
- "where": {
|
|
|
|
|
- "condition": "",
|
|
|
|
|
- "status": "",
|
|
|
|
|
- "brandname": "",
|
|
|
|
|
- "tradefield": ""
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- downCount = null;
|
|
|
|
|
-Component({
|
|
|
|
|
- data: {
|
|
|
|
|
- CustomBar: getApp().globalData.CustomBar,
|
|
|
|
|
- filtratelist: [{
|
|
|
|
|
- label: "品牌",
|
|
|
|
|
- index: null,
|
|
|
|
|
- showName: "brandname", //显示字段
|
|
|
|
|
- valueKey: "brandname", //返回Key
|
|
|
|
|
- selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
|
|
- value: "", //选中值
|
|
|
|
|
- list: []
|
|
|
|
|
- }, {
|
|
|
|
|
- label: "领域",
|
|
|
|
|
- index: null,
|
|
|
|
|
- showName: "tradefield", //显示字段
|
|
|
|
|
- valueKey: "tradefield", //返回Key
|
|
|
|
|
- selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
|
|
- value: "", //选中值
|
|
|
|
|
- list: []
|
|
|
|
|
- }]
|
|
|
|
|
- },
|
|
|
|
|
- options: {
|
|
|
|
|
- addGlobalClass: true
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- init() {
|
|
|
|
|
- this.getList()
|
|
|
|
|
- this.getBrand()
|
|
|
|
|
- this.getDomain()
|
|
|
|
|
- },
|
|
|
|
|
- /* 获取产品 */
|
|
|
|
|
- getList(init = false) {
|
|
|
|
|
- if (init.detail != undefined) init = init.detail;
|
|
|
|
|
- if (init) content.pageNumber = 1;
|
|
|
|
|
- if (content.pageNumber > content.pageTotal) return;
|
|
|
|
|
- this.setListHeight();
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "id": 20221224180302,
|
|
|
|
|
- content
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- console.log("订单列表", res)
|
|
|
|
|
- this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
|
|
- /* 格式化价格 */
|
|
|
|
|
- if (res.data.length != 0) res.data = res.data.map(v => {
|
|
|
|
|
- v.defaultamount = currency(v.defaultamount, {
|
|
|
|
|
- symbol: "¥",
|
|
|
|
|
- precision: 2
|
|
|
|
|
- }).format();
|
|
|
|
|
- return v
|
|
|
|
|
- })
|
|
|
|
|
- content.pageNumber = res.pageNumber + 1
|
|
|
|
|
- content.pageTotal = res.pageTotal
|
|
|
|
|
- this.setData({
|
|
|
|
|
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
|
|
- total: res.total,
|
|
|
|
|
- amount: currency(res.tips.amount, {
|
|
|
|
|
- symbol: "¥",
|
|
|
|
|
- precision: 2
|
|
|
|
|
- }).format()
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- /* 更新列表 */
|
|
|
|
|
- updateList() {
|
|
|
|
|
- let params = JSON.parse(JSON.stringify(content));
|
|
|
|
|
- params.pageSize = (params.pageNumber - 1) * params.pageSize;
|
|
|
|
|
- params.pageNumber = 1;
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "id": 20221224180302,
|
|
|
|
|
- content:params
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- console.log("订单列表", res)
|
|
|
|
|
- if (res.msg != '成功') return;
|
|
|
|
|
- /* 格式化价格 */
|
|
|
|
|
- if (res.data.length != 0) res.data = res.data.map(v => {
|
|
|
|
|
- v.defaultamount = currency(v.defaultamount, {
|
|
|
|
|
- symbol: "¥",
|
|
|
|
|
- precision: 2
|
|
|
|
|
- }).format();
|
|
|
|
|
- return v
|
|
|
|
|
- })
|
|
|
|
|
- this.setData({
|
|
|
|
|
- list: res.data,
|
|
|
|
|
- total: res.total,
|
|
|
|
|
- amount: currency(res.tips.amount, {
|
|
|
|
|
- symbol: "¥",
|
|
|
|
|
- precision: 2
|
|
|
|
|
- }).format()
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- /* 切换tabs */
|
|
|
|
|
- tabsChange(e) {
|
|
|
|
|
- let status = "";
|
|
|
|
|
- switch (e.detail.title) {
|
|
|
|
|
- case '全部':
|
|
|
|
|
- status = "";
|
|
|
|
|
- break;
|
|
|
|
|
- case '待确认':
|
|
|
|
|
- status = "交期待确认";
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- status = e.detail.title
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- content.where.status = status;
|
|
|
|
|
- this.getList(true);
|
|
|
|
|
- },
|
|
|
|
|
- /* 搜索 */
|
|
|
|
|
- onSearch({
|
|
|
|
|
- detail
|
|
|
|
|
- }) {
|
|
|
|
|
- content.where.condition = detail;
|
|
|
|
|
- this.getList(true)
|
|
|
|
|
- },
|
|
|
|
|
- /* 获取品牌 */
|
|
|
|
|
- getBrand() {
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "id": 20220924163702,
|
|
|
|
|
- "content": {
|
|
|
|
|
- "pageSize": 9999,
|
|
|
|
|
- }
|
|
|
|
|
- }, false).then(res => {
|
|
|
|
|
- console.log("查询品牌", res)
|
|
|
|
|
- if (res.msg == '成功') this.setData({
|
|
|
|
|
- "filtratelist[0].list": res.data
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- /* 获取领域 */
|
|
|
|
|
- getDomain() {
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "id": 20221223141802,
|
|
|
|
|
- "content": {
|
|
|
|
|
- "pageNumber": 1,
|
|
|
|
|
- "pageSize": 9999,
|
|
|
|
|
- "where": {
|
|
|
|
|
- "condition": ""
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }, false).then(res => {
|
|
|
|
|
- console.log("获取领域", res)
|
|
|
|
|
- if (res.msg == '成功') this.setData({
|
|
|
|
|
- "filtratelist[1].list": res.data
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- /* 设置页面高度 */
|
|
|
|
|
- setListHeight() {
|
|
|
|
|
- this.selectComponent("#ListBox").setHeight(".tips", this);
|
|
|
|
|
- },
|
|
|
|
|
- showModal(e) {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- modalName: e.currentTarget.dataset.target
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- hideModal(e) {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- modalName: null
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- handleFiltrate({
|
|
|
|
|
- detail
|
|
|
|
|
- }) {
|
|
|
|
|
- content.where.brandname = detail.brandname;
|
|
|
|
|
- content.where.tradefield = detail.tradefield;
|
|
|
|
|
- downCount = setTimeout(() => {
|
|
|
|
|
- this.getList(true);
|
|
|
|
|
- }, 300);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-})
|
|
|