Commit f29f06d9 by liimin

refactor(order): 优化订单相关页面和组件

- 更新积分商城名称
- 修复物流信息显示逻辑
- 优化订单详情页面布局
- 调整订单列表组件样式
- 重构订单相关数据处理方法
- 优化用户信息展示页面
1 parent f53d5b06
...@@ -153,4 +153,4 @@ ...@@ -153,4 +153,4 @@
<!-- <block wx:if="{{showComponent&&!isGH}}"> <!-- <block wx:if="{{showComponent&&!isGH}}">
<coupons-list bind:getCoupons="getCouponsItem" couponsId="{{query.couponId}}" show="{{showCoupons}}" goodsId="{{curentGoodsItem.id}}"></coupons-list> <coupons-list bind:getCoupons="getCouponsItem" couponsId="{{query.couponId}}" show="{{showCoupons}}" goodsId="{{curentGoodsItem.id}}"></coupons-list>
</block> --> </block> -->
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
</block> </block>
</view> </view>
<authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize scopeType="userLocation" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -39,4 +39,4 @@ ...@@ -39,4 +39,4 @@
</view> </view>
<glsx-privacy appletName="海马刀"></glsx-privacy> <glsx-privacy appletName="积分商城"></glsx-privacy>
...@@ -26,4 +26,4 @@ ...@@ -26,4 +26,4 @@
</block> </block>
</view> </view>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
import { getAfterSaleDetail } from "~/packageMine/pages/order/utils"; import { getAfterSaleDetail } from "~/packageMine/pages/order/utils";
import {
ORDER_STATUS,
OrderStatusEnum,
} from "~/constants/mine.js";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -78,13 +82,6 @@ Page({ ...@@ -78,13 +82,6 @@ Page({
// console.log('this.button', this.data.button) // console.log('this.button', this.data.button)
this[this.data.button.handler]() this[this.data.button.handler]()
}, },
toAfterSale(){
const { orderInfo } = this.data;
wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two",
orderInfo
);
},
/**撤销申请 */ /**撤销申请 */
cancelSaleApply() { cancelSaleApply() {
const { orderInfo } = this.data; const { orderInfo } = this.data;
...@@ -104,7 +101,9 @@ Page({ ...@@ -104,7 +101,9 @@ Page({
wx.hideLoading(); wx.hideLoading();
if (res) { if (res) {
wx.p.wxApi.showToast("撤销成功"); wx.p.wxApi.showToast("撤销成功");
wx.p.router.back(); wx.p.router.go("/packageMine/pages/order/index/index", {
tab: ORDER_STATUS[OrderStatusEnum.COMPLETED],
});
} }
}); });
} }
......
import { afterSaleMixin } from "~/mixins/index"; import { afterSaleMixin } from "~/mixins/index";
import { RefundReason, GoodsSource } from "~/constants/mine.js"; import {
RefundReason,
GoodsSource,
ORDER_STATUS,
OrderStatusEnum,
} from "~/constants/mine.js";
const Methods = { const Methods = {
[GoodsSource.YZH]: wx.p.api.shopmallApi.afterSalesPlatform, [GoodsSource.YZH]: wx.p.api.shopmallApi.afterSalesPlatform,
[GoodsSource.SELF]: wx.p.api.shopmallApi.afterSale, [GoodsSource.SELF]: wx.p.api.shopmallApi.afterSale,
...@@ -11,17 +16,18 @@ Page({ ...@@ -11,17 +16,18 @@ Page({
*/ */
data: { data: {
RefundReason: Object.freeze(RefundReason), RefundReason: Object.freeze(RefundReason),
method:null, method: null,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then((orderObj) => { wx.p.router.getRouterParams(options).then((orderObj) => {
orderObj.returnType = 1001 console.log("🚀 ~ orderObj:", orderObj)
orderObj.returnType = 1001;
this.setData({ this.setData({
orderObj, orderObj,
method:Methods[orderObj.goodsSource], method: Methods[orderObj.goodsSource],
// maxRefundCount: orderObj.refundCount, // maxRefundCount: orderObj.refundCount,
}); });
}); });
...@@ -113,10 +119,12 @@ Page({ ...@@ -113,10 +119,12 @@ Page({
if (code == "0") { if (code == "0") {
wx.p.wxApi.showToast("申请成功!"); wx.p.wxApi.showToast("申请成功!");
setTimeout(() => { setTimeout(() => {
wx.p.router.back((prevPage) => { // wx.p.router.back((prevPage) => {
console.log(prevPage); // prevPage.clearAndGetList && prevPage.clearAndGetList();
prevPage.clearData && prevPage.clearData(); // }, 1);
}, 2); wx.p.router.reLaunch("/packageMine/pages/order/index/index", {
tab: ORDER_STATUS[OrderStatusEnum.AFTER_SALE],
});
}, 1.5 * 1000); }, 1.5 * 1000);
} else { } else {
wx.p.wxApi.showToast(message); wx.p.wxApi.showToast(message);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- <view class="type text-center"> --> <!-- <view class="type text-center"> -->
<afterSale_step_one bindreturnType="changeReturnType"/> <afterSale_step_one bindreturnType="changeReturnType"/>
<!-- </view> --> <!-- </view> -->
<view class="title">申请退货退款</view> <view class="title">申请<text wx:if="{{orderObj.returnType===1001}}">退货</text>退款</view>
<!-- 退款信息组件 --> <!-- 退款信息组件 -->
<refund-info-box <refund-info-box
orderObj="{{orderObj}}" orderObj="{{orderObj}}"
...@@ -31,4 +31,4 @@ ...@@ -31,4 +31,4 @@
<view class="btn text-center" bindtap="submit">提交</view> <view class="btn text-center" bindtap="submit">提交</view>
</view> </view>
<glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
const LOGISTICS_STATUS = { const LOGISTICS_STATUS = {
1000: '待揽件', 1000: "待揽件",
1001: '已揽件', 1001: "已揽件",
1002: '运输中', 1002: "运输中",
1003: '已签收', 1003: "已签收",
1004: '拒收' 1004: "拒收",
}; };
Component({ Component({
properties: { properties: {
...@@ -11,15 +11,13 @@ Component({ ...@@ -11,15 +11,13 @@ Component({
type: Object, type: Object,
value: {}, value: {},
observer: function (val) { observer: function (val) {
console.log("🚀 ~ val:", val) if (!val) return;
this.setData({ this.processExpressInfo(val);
logisticsData: this.processExpressInfo(val) },
})
}
}, },
showExpress: { showExpress: {
type: Boolean, type: Boolean,
value: false value: false,
}, },
// height: { // height: {
// type: String, // type: String,
...@@ -60,48 +58,58 @@ Component({ ...@@ -60,48 +58,58 @@ Component({
methods: { methods: {
processShipmentTrack(shipmentTrack, logisticsStatus) { processShipmentTrack(shipmentTrack, logisticsStatus) {
if (!this.data.showExpress) { if (!this.data.showExpress) {
shipmentTrack = shipmentTrack ? shipmentTrack.slice(0, 2) : [] shipmentTrack = shipmentTrack ? shipmentTrack.slice(0, 2) : [];
} }
return shipmentTrack.map((track, index) => { return shipmentTrack
.map((track, index) => {
let status = 1000; let status = 1000;
let statusDesc = '待揽件'; let statusDesc = "待揽件";
const content = track.content; const content = track.content;
const operateTime = track.operateTime; const operateTime = track.operateTime;
const isLast = index === 0; const isLast = index === 0;
// 根据内容判断状态 // 根据内容判断状态
if (content.includes('已签收') || content.includes('签收人')) { if (content.includes("已签收") || content.includes("签收人")) {
status = 1003; status = 1003;
statusDesc = '已签收'; statusDesc = "已签收";
} else if (content.includes('拒收') || content.includes('退回')) { } else if (content.includes("拒收") || content.includes("退回")) {
status = 1004; status = 1004;
statusDesc = '拒收'; statusDesc = "拒收";
} else if (content.includes('派件') || content.includes('驿站') || content.includes('暂存')) { } else if (
content.includes("派件") ||
content.includes("驿站") ||
content.includes("暂存")
) {
status = 1002; status = 1002;
statusDesc = '运输中'; statusDesc = "运输中";
} else if (content.includes('转运中心') || content.includes('发往') || content.includes('到达')) { } else if (
content.includes("转运中心") ||
content.includes("发往") ||
content.includes("到达")
) {
status = 1002; status = 1002;
statusDesc = '运输中'; statusDesc = "运输中";
} else if (content.includes('已收件') || content.includes('揽收')) { } else if (content.includes("已收件") || content.includes("揽收")) {
status = 1001; status = 1001;
statusDesc = '已揽件'; statusDesc = "已揽件";
} else if (content.includes('已发往')) { } else if (content.includes("已发往")) {
status = 1001; status = 1001;
statusDesc = '已揽件'; statusDesc = "已揽件";
} }
// 根据整体物流状态进行最终调整 // 根据整体物流状态进行最终调整
if (logisticsStatus < status) { if (logisticsStatus < status) {
// 如果整体状态低于当前轨迹状态,说明该轨迹尚未完成 // 如果整体状态低于当前轨迹状态,说明该轨迹尚未完成
statusDesc = LOGISTICS_STATUS[logisticsStatus] + '(进行中)'; statusDesc = LOGISTICS_STATUS[logisticsStatus] + "(进行中)";
} }
return { return {
...track, ...track,
type: isLast ? 'active' : 'small', type: isLast ? "active" : "small",
status, status,
statusDesc statusDesc,
}; };
}).filter(track => { })
.filter((track) => {
// 根据整体物流状态过滤轨迹 // 根据整体物流状态过滤轨迹
switch (logisticsStatus) { switch (logisticsStatus) {
case 1000: // 待揽件 - 只显示收件相关记录 case 1000: // 待揽件 - 只显示收件相关记录
...@@ -120,20 +128,20 @@ Component({ ...@@ -120,20 +128,20 @@ Component({
}); });
}, },
processExpressInfo(expressInfo) { processExpressInfo(expressInfo) {
const { const { logisticsStatus, shipmentTrack, ...rest } = expressInfo;
logisticsStatus, const processedTrack = this.processShipmentTrack(
shipmentTrack, shipmentTrack,
...rest logisticsStatus
} = expressInfo; );
const logisticsData = {
const processedTrack = this.processShipmentTrack(shipmentTrack, logisticsStatus);
return {
...rest, ...rest,
logisticsStatus, logisticsStatus,
logisticsStatusDesc: LOGISTICS_STATUS[logisticsStatus], logisticsStatusDesc: LOGISTICS_STATUS[logisticsStatus],
shipmentTrack: processedTrack shipmentTrack: processedTrack,
}; };
} this.setData({
logisticsData,
} });
},
},
}); });
Component({ Component({
options: {
addGlobalClass: true,
},
properties: { properties: {
orderInfo: { orderInfo: {
type: Object, type: Object,
...@@ -13,13 +10,14 @@ Component({ ...@@ -13,13 +10,14 @@ Component({
}, },
methods: { methods: {
compute(info) { compute(info) {
let { freightAmount = 0, sellQty, redeemPoints } = info; let { freightAmount = 0, sellQty,applyQty, redeemPoints } = info;
console.log("🚀 ~ compute ~ freightAmount = 0, sellQty, redeemPoints:", freightAmount, sellQty, redeemPoints) const total = +redeemPoints * +(sellQty||applyQty) + +freightAmount;
const total = +redeemPoints * +sellQty + +freightAmount;
this.setData({ this.setData({
total, total,
freightAmount freightAmount,
info
}) })
console.log(this.data.orderInfo)
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.wait-icon { .wait-icon {
width: 32px; width: 32px;
height: 32px; height: 32px;
margin-right: 10rpx; margin-right: 20rpx;
} }
.dispatched-txt { .dispatched-txt {
......
import { import {
orderMixin orderMixin
} from "~/mixins/index"; } from "~/mixins/index";
import {
OrderStatus
} from "~/constants/mine.js";
Page({ Page({
behaviors: [orderMixin], behaviors: [orderMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
OrderStatus,
expressInfo: { expressInfo: {
"orderCode": "295057717192728657", "orderCode": "295057717192728657",
"expressCode": "yuantong", "expressCode": "yuantong",
...@@ -112,9 +116,9 @@ Page({ ...@@ -112,9 +116,9 @@ Page({
//用来获取发货信息 //用来获取发货信息
this.getOrderDetail(params.item.subOrderCode); this.getOrderDetail(params.item.subOrderCode);
} }
this.setData({ // this.setData({
Status: OrderStatus[this.data.orderInfo.orderStatus], // Status: OrderStatus[this.data.orderInfo.orderStatus],
}); // });
}); });
}, },
queryLogistics() { queryLogistics() {
...@@ -127,7 +131,7 @@ Page({ ...@@ -127,7 +131,7 @@ Page({
wx.p.api.shopmallApi.queryLogistics(params).then((data) => { wx.p.api.shopmallApi.queryLogistics(params).then((data) => {
console.log(data, '物流信息') console.log(data, '物流信息')
this.setData({ this.setData({
// expressInfo: data expressInfo: data
}) })
}) })
}, },
...@@ -151,6 +155,7 @@ Page({ ...@@ -151,6 +155,7 @@ Page({
} = data.receiveAddress } = data.receiveAddress
this.setData({ this.setData({
orderInfo: { orderInfo: {
...data,
...orderInfo, ...orderInfo,
receiveAddress: provinceName + cityName + countyName + address, receiveAddress: provinceName + cityName + countyName + address,
receviveInfo: receiveName + receiveMobile receviveInfo: receiveName + receiveMobile
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
</BlockBox> --> </BlockBox> -->
<!-- 云中鹤的有物流信息 --> <!-- 云中鹤的有物流信息 -->
<BlockBox wx:if="{{orderInfo.goodsSource==1||!orderInfo.goodsSource}}"> <BlockBox wx:if="{{orderInfo.goodsSource==1||!orderInfo.goodsSource}}">
<view class="express-box" bindtap="showExpressPop" wx:if="{{expressInfo}}"> <view class="express-box" bindtap="showExpressPop" wx:if="{{expressInfo &&expressInfo.shipmentTrack&&expressInfo.shipmentTrack.length}}">
<view class="express-detail">物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon> <view class="express-detail">
物流详情
<mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon>
</view> </view>
<Express expressInfo="{{expressInfo}}" /> <Express expressInfo="{{expressInfo}}" />
</view> </view>
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
</BlockBox> </BlockBox>
<!-- 自营商品展示快递信息 --> <!-- 自营商品展示快递信息 -->
<BlockBox wx:if="{{orderInfo.goodsSource==2}}"> <BlockBox wx:if="{{orderInfo.goodsSource==2}}">
<Expressage expressInfo="{{expressInfo}}" wx:if="{{expressInfo}}"></Expressage> <Expressage expressInfo="{{expressInfo}}" wx:if="{{expressInfo && expressInfo.shipmentTrack&&expressInfo.shipmentTrack.length}}"></Expressage>
<WaitDeliver wx:else></WaitDeliver> <WaitDeliver wx:else></WaitDeliver>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
...@@ -26,7 +28,6 @@ ...@@ -26,7 +28,6 @@
<!-- <BlockBox> <!-- <BlockBox>
<content item="{{orderInfo}}" /> <content item="{{orderInfo}}" />
</BlockBox> --> </BlockBox> -->
<Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}" /> <Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}" />
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
...@@ -9,8 +9,8 @@ Component({ ...@@ -9,8 +9,8 @@ Component({
value: {}, value: {},
observer: function (v) { observer: function (v) {
this.compute(v); this.compute(v);
} },
} },
}, },
/** /**
...@@ -18,13 +18,13 @@ Component({ ...@@ -18,13 +18,13 @@ Component({
*/ */
methods: { methods: {
compute(item) { compute(item) {
let { applyQty, sellQty, redeemPoints } = item; let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item;
const total = sellQty || applyQty || 0; const total = sellQty || applyQty || 0;
let sum = redeemPoints * total; let sum = redeemPoints * total + +freightAmount;
this.setData({ this.setData({
sum, sum,
total
})
}
}
})
\ No newline at end of file \ No newline at end of file
total,
});
},
},
});
...@@ -13,37 +13,4 @@ Component({ ...@@ -13,37 +13,4 @@ Component({
value: false value: false
} }
}, },
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
// 查看评价
onLookEvaluate(e) {
this.triggerEvent('lookEvaluate', {
item: e.currentTarget.dataset.item
});
},
// 获取用户信息
onGetUserProfile(e) {
this.triggerEvent('getUserProfile', {
item: e.currentTarget.dataset.item
});
},
// 立即评价
onEvaluate(e) {
this.triggerEvent('evaluate', {
item: e.currentTarget.dataset.item
});
}
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -140,15 +140,16 @@ Component({ ...@@ -140,15 +140,16 @@ Component({
// 售后 // 售后
onAfterSale(e) { onAfterSale(e) {
let { subOrderCode, redeemPoints, goodsSource, sellQty,goodsSkuCode } = let { subOrderCode, redeemPoints, goodsSource, sellQty,applyQty,goodsSkuCode } =
this.data.order; this.data.order;
console.log(this.data.order)
wx.p.router.go( wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two", "/packageMine/pages/order/afterSale_step_two/afterSale_step_two",
{ {
subOrderCode, subOrderCode,
refundPoints: redeemPoints, refundPoints: redeemPoints,
goodsSource, goodsSource,
applyQty: sellQty, applyQty: applyQty || sellQty,
goodsSkuCode goodsSkuCode
} }
); );
......
...@@ -289,14 +289,7 @@ Page({ ...@@ -289,14 +289,7 @@ Page({
} }
); );
}, },
onPullDownRefresh: function () {
/** this.clearAndGetList()
* 刷新订单列表
*/
onRefresh() {
// 调用混入中的方法获取订单列表
if (this.getOrderList && typeof this.getOrderList === "function") {
this.getOrderList();
}
}, },
}); });
...@@ -3,5 +3,8 @@ ...@@ -3,5 +3,8 @@
"usingComponents": { "usingComponents": {
"tab": "/components/Tab/Tab", "tab": "/components/Tab/Tab",
"OrderCard": "./components/OrderCard/OrderCard" "OrderCard": "./components/OrderCard/OrderCard"
} },
"onReachBottomDistance": 10,
"backgroundTextStyle": "dark",
"enablePullDownRefresh": true
} }
\ No newline at end of file \ No newline at end of file
// pages/tab/mine/index.js // pages/tab/mine/index.js
import commonApi from '~/api/module/common' import commonApi from "~/api/module/common";
import { import { ToolList } from "~/constants/index";
ToolList
} from "~/constants/index";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -10,21 +8,22 @@ Page({ ...@@ -10,21 +8,22 @@ Page({
data: { data: {
navStyle: "background-color: transparent;", navStyle: "background-color: transparent;",
scoreSummary: { scoreSummary: {
currentScore: '-', //当前积分 currentScore: "-", //当前积分
bankCardSize: '-', bankCardSize: "-",
totalGoodExchangeScore: '-', //累计兑换积分 totalGoodExchangeScore: "-", //累计兑换积分
totalRewardScore: '-', //累计收益积分 totalRewardScore: "-", //累计收益积分
totalWithdrawalScore: '-', //累计提现积分 totalWithdrawalScore: "-", //累计提现积分
}, },
toolList: ToolList, toolList: ToolList,
guideList: [{ guideList: [
key: 'currentScore', {
leftIcon: 'logo' key: "currentScore",
}, { leftIcon: "logo",
key: 'bankCardSize', },
text: '银行卡' {
} key: "bankCardSize",
text: "银行卡",
},
], ],
}, },
...@@ -32,55 +31,50 @@ Page({ ...@@ -32,55 +31,50 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let userInfo = wx.p.storage.get('userInfo') let userInfo = wx.p.storage.get("userInfo");
this.setData({ this.setData({
userInfo userInfo,
}) });
this.searchScoreSummaryData() this.searchScoreSummaryData();
// this.getMemberCardData(); // this.getMemberCardData();
}, },
searchScoreSummaryData() { searchScoreSummaryData() {
const { const { phone, channelSource } = this.data.userInfo;
phone, wx.p.api.withdrawalApi
channelSource .searchScoreSummary({
} = this.data.userInfo staffPhone: phone,
wx.p.api.withdrawalApi.searchScoreSummary({ channelSource, //1.阳光激励 2.续保用户 3.管理层
staffPhone:phone, })
channelSource //1.阳光激励 2.续保用户 3.管理层 .then((res) => {
}).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.setData({ this.setData({
scoreSummary: res.data scoreSummary: res.data,
}) });
} }
}).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
}) })
.catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err));
});
}, },
go(e) { go(e) {
console.log(e) console.log(e);
const thisPage = wx.p.router.getPageInstance() const thisPage = wx.p.router.getPageInstance();
let { let { index } = e.currentTarget.dataset;
index
} = e.currentTarget.dataset
let arr = [ let arr = [
() => { () => {
wx.p.router.go('/packageIndex/pages/integral/index/index') wx.p.router.go("/packageIndex/pages/integral/index/index");
}, },
() => { () => {
wx.p.router.go('/packageIndex/pages/bankAccount/list/list') wx.p.router.go("/packageIndex/pages/bankAccount/list/list");
} },
] ];
arr[index]() arr[index]();
}, },
navbarReady(e) { navbarReady(e) {
let { let { height } = e.detail;
height
} = e.detail;
this.setData({ this.setData({
navHeight: height navHeight: height,
}) });
}, },
login() { login() {
wx.p.router.go("/pages/Login/Login"); wx.p.router.go("/pages/Login/Login");
...@@ -89,13 +83,11 @@ Page({ ...@@ -89,13 +83,11 @@ Page({
wx.p.router.go("/packageMine/pages/setting/index"); wx.p.router.go("/packageMine/pages/setting/index");
}, },
jump(e) { jump(e) {
const { const { url } = e.currentTarget.dataset;
url
} = e.currentTarget.dataset;
wx.p.router.go(url); wx.p.router.go(url);
}, },
async getOrderNumberList() { async getOrderNumberList() {
const loginStatus = !wx.p.isLogin const loginStatus = !wx.p.isLogin;
if (loginStatus) return; if (loginStatus) return;
wx.p.api.mineApi.getOrderNumberList().then((res) => { wx.p.api.mineApi.getOrderNumberList().then((res) => {
this.setData({ this.setData({
...@@ -111,23 +103,31 @@ Page({ ...@@ -111,23 +103,31 @@ Page({
// 切换门店 // 切换门店
changeMerchant() { changeMerchant() {
// 获取门店接口 门店数量大于1跳转切换,否则不需切换 // 获取门店接口 门店数量大于1跳转切换,否则不需切换
let {userInfo} = this.data let { userInfo } = this.data;
commonApi.getMerchantData({staffPhone: userInfo?.phone, channelSource: userInfo?.channelSource}).then(res => { commonApi
let {code, data, message} = res .getMerchantData({
staffPhone: userInfo?.phone,
channelSource: userInfo?.channelSource,
})
.then((res) => {
let { code, data, message } = res;
if (code == 0) { if (code == 0) {
if (data?.length > 1) { if (data?.length > 1) {
wx.p.router.go('/pages/chooseMerchant/index', {loginData: userInfo, merchantList: data}) wx.p.router.go("/pages/chooseMerchant/index", {
loginData: userInfo,
merchantList: data,
});
} }
} else { } else {
wx.p.wxApi.showToast(message) wx.p.wxApi.showToast(message);
} }
}) });
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// this.getOrderNumberList(); this.getOrderNumberList();
// this.toCheckMember(); // this.toCheckMember();
}, },
}); });
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!