diff --git a/commons/js/utils/apiQuery.js b/commons/js/utils/apiQuery.js index 9d45c29..d5c4017 100644 --- a/commons/js/utils/apiQuery.js +++ b/commons/js/utils/apiQuery.js @@ -1118,4 +1118,10 @@ apiQuery.postAppCusorderDestroy = function (params) { HttpRequest(false, Config.api.appCusorderDestroy, 2, params, "POST", resolve, reject) }) } +//优惠券记录 +apiQuery.getAppCusorderDestroy = function (params) { + return new Promise(function (resolve, reject) { + HttpRequest(false, Config.api.appCusorderDestroy, 2, params, "GET", resolve, reject) + }) +} export default apiQuery; \ No newline at end of file diff --git a/pages/customer/score/exchange.js b/pages/customer/score/exchange.js index 8c7200c..1f3cfa0 100644 --- a/pages/customer/score/exchange.js +++ b/pages/customer/score/exchange.js @@ -1,4 +1,5 @@ // pages/customer/score/exchange.js 20250624 +import _ from '../../../commons/js/commons' Page({ /** @@ -7,33 +8,12 @@ Page({ data: { startDate: '', endDate: '', - orderList: [ - { - id: 1, - orderNumber: 'LC202505101913247', - customerName: '李先生', - customerPhone: '138****382', - points: 3000, - couponAmount: 2000, - couponTitle: '购车补贴', - validityPeriod: '2025-01-01~2025-12-12', - orderTime: '2025-05-10 19:13' - }, - { - id: 2, - orderNumber: 'LC202505101913247', - customerName: '李先生', - customerPhone: '138****382', - points: 3000, - couponAmount: 2000, - couponTitle: '购车补贴', - validityPeriod: '2025-01-01~2025-12-12', - orderTime: '2025-05-10 19:13' - } - ], + list: [], loading: true, end: false, - noData: false + noData: false, + pageNo: 1, + size: 20 }, /** @@ -60,6 +40,15 @@ Page({ onSearch() { console.log('搜索', this.data.startDate, this.data.endDate); // 这里可以添加搜索逻辑 + this.setData({ + pageNo: 1, + list: [], + noData: false, + end: false, + load: true, + loading: false + }) + this.getAppCusorderDestroy(); }, /** @@ -83,7 +72,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + this.getAppCusorderDestroy(); }, /** @@ -131,7 +120,46 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage() { + onShareAppMessage() {}, + getAppCusorderDestroy() { + this.setData({ + load: false, + loading: true, + }) - } + let params = {}; + params['page'] = this.data.pageNo; + params['size'] = this.data.size; + if (this.data.startDate) { + params['startDate'] = this.data.startDate; + } + if (this.data.endDate) { + params['endDate'] = this.data.endDate; + } + _.apiQuery.getAppCusorderDestroy(params).then(res => { + this.setData({ + total: res.data.total, + pageNo: this.data.pageNo + 1, + list: this.data.list.concat(res.data.list), + load: true, + loading: false, + }) + if (res.data.total == 0) { + this.setData({ + noData: true + }) + } else if (this.data.list.length == res.data.total) { + this.setData({ + end: true + }) + } + wx.stopPullDownRefresh() + }); + }, + //推送链接 + pushLink(e) { + if (e.currentTarget.dataset.url) { + _.$router.openUrlScheme(e.currentTarget.dataset.url) + } + }, }) \ No newline at end of file diff --git a/pages/customer/score/exchange.json b/pages/customer/score/exchange.json index 8835af0..344f794 100644 --- a/pages/customer/score/exchange.json +++ b/pages/customer/score/exchange.json @@ -1,3 +1,8 @@ { + "navigationBarTitleText": "核销记录", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#1a1c26", + "backgroundColor": "#ffffff", + "backgroundColorTop": "#1a1c26", "usingComponents": {} } \ No newline at end of file diff --git a/pages/customer/score/exchange.wxml b/pages/customer/score/exchange.wxml index 17ac482..31414d9 100644 --- a/pages/customer/score/exchange.wxml +++ b/pages/customer/score/exchange.wxml @@ -25,20 +25,20 @@ - + - - 订单编号 {{item.orderNumber}} - + + 订单编号 {{item.order_sid}} + 订单详情 > - {{item.customerName}} - ({{item.customerPhone}}) - + {{item.name}} + ({{item.mobile}}) + 消耗积分: {{item.points}} @@ -48,7 +48,7 @@ - {{item.couponAmount}} + {{item.price}} @@ -57,14 +57,15 @@ - 购车补贴 - 时限 {{item.validityPeriod}} + + {{item.type_cn}}{{item.red_type_cn}} + 时限 {{item.timeStart}}-{{item.timeEnd}} - 下单时间: {{item.orderTime}} + 核销时间: {{item.use_time}} diff --git a/pages/mine/index.js b/pages/mine/index.js index 73cf110..65e09f3 100644 --- a/pages/mine/index.js +++ b/pages/mine/index.js @@ -8,6 +8,7 @@ Page({ mobile: '', isShowProfile: true, //是否显示授权用户信息按钮 isShowSwitchingRoles: false, + biz_type_4s: 5 //门店类型4s店 }, onLoad: function (options) { for (let key in options) { @@ -203,8 +204,32 @@ Page({ bindScanCode(){ wx.scanCode({ success(res) { - console.log(res) - } + let params = { + 'sid':res.result + } + _.apiQuery.postAppCusorderDestroy(params).then(res => { + if (res.code == 200) { + wx.showToast({ + title: res.msg, + icon: 'success', + duration: 2000 + }) + }else{ + wx.showToast({ + title: res.msg, + duration: 2000 + }) + } + }); + }, + fail(err) { + wx.showToast({ + title: '扫描失败,请重试', + icon: 'none', + duration: 2000 + }); + }, + }) }, //其他菜单 diff --git a/pages/mine/index.wxml b/pages/mine/index.wxml index 2913da2..19527e9 100644 --- a/pages/mine/index.wxml +++ b/pages/mine/index.wxml @@ -16,7 +16,7 @@ - + 扫码 diff --git a/pages/order/detail/index2.js b/pages/order/detail/index2.js index b11187f..6b824a3 100644 --- a/pages/order/detail/index2.js +++ b/pages/order/detail/index2.js @@ -29,7 +29,7 @@ Page({ confirm_count_down: 3, wxTimerList: {}, wxTimer: null, - group_id_4s: 5 //角色类型4店铺 + biz_type_4s: 5 //门店类型4s店 }, onLoad: function (options) { for (let key in options) { diff --git a/pages/order/detail/index2.wxml b/pages/order/detail/index2.wxml index 7a2f9b5..8eaaab1 100644 --- a/pages/order/detail/index2.wxml +++ b/pages/order/detail/index2.wxml @@ -98,7 +98,7 @@ - + 订单合同 diff --git a/pages/order/edit/index2.js b/pages/order/edit/index2.js index a5d87ce..3095734 100644 --- a/pages/order/edit/index2.js +++ b/pages/order/edit/index2.js @@ -62,7 +62,7 @@ Page({ discount_amount: '', //⻋身优惠 business_type: 0, brand_page_show: false, - group_id_4s: 5 //角色类型4店铺 + biz_type_4s: 5 //门店类型4s店 }, //生命周期函数--监听页面加载 onLoad: function (options) { @@ -308,7 +308,7 @@ Page({ this.setData({ userInfo: res, }) - if (res.group_id == this.data.group_id_4s) { //4s店铺 + if (res.biz_type == this.data.biz_type_4s) { //4s店铺 let tab = [{ title: '车辆信息', step: 2, diff --git a/pages/order/edit/index2.wxml b/pages/order/edit/index2.wxml index b356184..cb716a6 100644 --- a/pages/order/edit/index2.wxml +++ b/pages/order/edit/index2.wxml @@ -148,7 +148,7 @@ - + diff --git a/pages/order/register/index.js b/pages/order/register/index.js index eb096c7..1dbfca9 100644 --- a/pages/order/register/index.js +++ b/pages/order/register/index.js @@ -18,7 +18,7 @@ Page({ step: 1, name: '', //姓名 mobile: '', //手机号 - cardid: '350822198911298152', //身份证 + cardid: '', //身份证 brand_id: '', //品牌 brand_name: '', //品牌名称 series_id: '', //车系id @@ -68,7 +68,7 @@ Page({ confirm_amount: '', //定⾦ discount_amount: '', //⻋身优惠 brand_page_show: false, - group_id_4s: 5 //角色类型4店铺 + biz_type_4s: 5 //门店类型4s店 }, //生命周期函数--监听页面加载 onLoad: function (options) { @@ -145,7 +145,7 @@ Page({ icon: 'none' }) } else { - if (this.data.userInfo.group_id == this.data.group_id_4s) { + if (this.data.userInfo.biz_type == this.data.biz_type_4s) { this.showPreview(); } else { this.setData({ @@ -203,7 +203,7 @@ Page({ this.setData({ userInfo: res, }) - if (res.group_id == this.data.group_id_4s) { //4s店铺 + if (res.biz_type == this.data.biz_type_4s) { //4s店铺 let main = [{ title: '个人', value: 0 diff --git a/pages/order/register/index.wxml b/pages/order/register/index.wxml index 0a80410..6a6e5bd 100644 --- a/pages/order/register/index.wxml +++ b/pages/order/register/index.wxml @@ -215,7 +215,7 @@ - + @@ -271,7 +271,7 @@ 内饰颜色 {{in_color}} - + 其他信息 付款方式 @@ -369,7 +369,7 @@ 订单登记成功 --- 请及时上传 --- - + 订单合同 付款凭证