Commit 3ce4dae8 authored by spc's avatar spc

jump serviceUrl

parent c61cea87
......@@ -111,7 +111,7 @@
</view>
<!-- 客服按钮 -->
<view class="service-btn">
<view class="service-btn" @click="handleServiceClick">
<image class="service-icon" :src="$baseUrl + 'homepage/Q3Res/settlementCenter_serviceBtn.png'"
mode="aspectFit"></image>
</view>
......@@ -120,70 +120,78 @@
<script>
import { getOrderDetail } from '@/api/user.js';
import { useHomeStore } from '@/stores/home';
import { jump, JumpType } from '../../utils';
export default {
data() {
return {
// 订单数据
orderData: {
productType: '', // 'physical' | 'virtual'
status: '', // 实物: '等待商家发货' | '已发货' | '已完成' | 虚拟: '交易成功' | '交易关闭'
statusCode: 'completed', // 'waiting_ship' | 'shipped' | 'completed' | 'success' | 'failed'
failureReason: '', // 失败原因
productName: '',
price: '',
quantity: 1,
totalPrice: '',
actualPayment: '',
orderNumber: '',
orderTime: '',
logisticsCompany: '',
trackingNumber: '',
expireTime: '',
usageInstructions: '',
// 新增字段
orderNo: '',
credits: '',
creditsDiscount: 0,
totalCredits: '',
addCredits: '',
creditsType: '',
creditsTypeName: '',
payPrice: '',
totalPayPrice: '',
priceMarket: '',
buyNum: 1,
payChannel: [],
bizDesc: '',
remark: '',
skuDesc: '',
createTime: '',
flowState: 0,
useState: 0,
appGoodsId: 0,
goodsType: '',
goodsName: '',
goodsDesc: '',
goodsContent: '',
goodsIcon: '',
goodsImage: [],
selfSell: false,
coupon: {},
address: {},
phone: '',
express: {},
refundVO: {},
stores: [],
checkRule: {},
failRule: {},
errMsg: '',
virtualConfig: {}
},
isLoading: true
return {
// 订单数据
orderData: {
productType: '', // 'physical' | 'virtual'
status: '', // 实物: '等待商家发货' | '已发货' | '已完成' | 虚拟: '交易成功' | '交易关闭'
statusCode: 'completed', // 'waiting_ship' | 'shipped' | 'completed' | 'success' | 'failed'
failureReason: '', // 失败原因
productName: '',
price: '',
quantity: 1,
totalPrice: '',
actualPayment: '',
orderNumber: '',
orderTime: '',
logisticsCompany: '',
trackingNumber: '',
expireTime: '',
usageInstructions: '',
// 新增字段
orderNo: '',
credits: '',
creditsDiscount: 0,
totalCredits: '',
addCredits: '',
creditsType: '',
creditsTypeName: '',
payPrice: '',
totalPayPrice: '',
priceMarket: '',
buyNum: 1,
payChannel: [],
bizDesc: '',
remark: '',
skuDesc: '',
createTime: '',
flowState: 0,
useState: 0,
appGoodsId: 0,
goodsType: '',
goodsName: '',
goodsDesc: '',
goodsContent: '',
goodsIcon: '',
goodsImage: [],
selfSell: false,
coupon: {},
address: {},
phone: '',
express: {},
refundVO: {},
stores: [],
checkRule: {},
failRule: {},
errMsg: '',
virtualConfig: {}
},
isLoading: true,
// 商店信息
homeStore: null
}
},
onLoad(options) {
console.log('订单详情页面参数:', options);
// 初始化homeStore
this.homeStore = useHomeStore();
if (options.orderId) {
this.loadOrderDetail(options.orderId);
} else {
......@@ -256,8 +264,8 @@ import { getOrderDetail } from '@/api/user.js';
}
},
methods: {
// 加载订单详情
async loadOrderDetail(orderId) {
// 加载订单详情
async loadOrderDetail(orderId) {
this.isLoading = true;
try {
const response = await getOrderDetail({ orderNo: orderId });
......@@ -388,6 +396,17 @@ import { getOrderDetail } from '@/api/user.js';
}
}
},
// 处理客服按钮点击
handleServiceClick() {
const { memberId, mobile, openId, unionId } = this.homeStore.homeInfo || {};
const customerUrl = `https://intelcc-user.icsoc.net/?channelKey=45839e0505554f8c8aea3c7b6259b049&init=1&crmld=${memberId || ''}&mobile=${mobile || ''}&openId=${openId || ''}&unionId=${unionId || ''}`;
jump({
type: JumpType.H5,
url: customerUrl
});
}
},
// 映射订单状态
mapFlowStateToStatus(flowState) {
......
......@@ -44,13 +44,16 @@
</view>
<!-- 客服按钮 -->
<view class="service-btn">
<view class="service-btn" @click="handleServiceClick">
<image class="service-icon" :src="$baseUrl + 'homepage/Q3Res/settlementCenter_serviceBtn.png'" mode="aspectFit"></image>
</view>
</view>
</template>
<script>
import { useHomeStore } from '@/stores/home';
import { jump, JumpType } from '../../utils';
export default {
data() {
return {
......@@ -70,7 +73,9 @@ export default {
gid: '',
skuld: '',
buy_num: 1
}
},
// 商店信息
homeStore: null
}
},
computed: {
......@@ -112,6 +117,9 @@ export default {
onLoad(options) {
console.log('支付结果页面接收到的参数:', options);
// 初始化homeStore
this.homeStore = useHomeStore();
// 处理页面参数
if (options.isSuccess !== undefined) {
this.resultData.isSuccess = options.isSuccess === 'true';
......@@ -166,13 +174,23 @@ export default {
},
// 设置支付结果 - 供外部调用
setPaymentResult(isSuccess, pointsValue = '', failureReason = '', orderId = '') {
this.resultData.isSuccess = isSuccess;
this.resultData.pointsValue = pointsValue;
this.resultData.failureReason = failureReason;
this.resultData.orderId = orderId;
setPaymentResult(isSuccess, pointsValue = '', failureReason = '', orderId = '') {
this.resultData.isSuccess = isSuccess;
this.resultData.pointsValue = pointsValue;
this.resultData.failureReason = failureReason;
this.resultData.orderId = orderId;
},
// 处理客服按钮点击
handleServiceClick() {
const { memberId, mobile, openId, unionId } = this.homeStore.homeInfo || {};
const customerUrl = `https://intelcc-user.icsoc.net/?channelKey=45839e0505554f8c8aea3c7b6259b049&init=1&crmld=${memberId || ''}&mobile=${mobile || ''}&openId=${openId || ''}&unionId=${unionId || ''}`;
jump({
type: JumpType.H5,
url: customerUrl
});
}
}
}
}
</script>
......
......@@ -66,7 +66,7 @@
</view>
<!-- 客服按钮 -->
<view class="service-btn">
<view class="service-btn" @click="handleServiceClick">
<image class="service-icon" :src="$baseUrl + 'homepage/Q3Res/settlementCenter_serviceBtn.png'"
mode="aspectFit"></image>
</view>
......@@ -85,6 +85,8 @@
<script>
import { fetchTradeCredits } from '@/api/goods.js';
import { getAddressList } from '@/api/address.js';
import { useHomeStore } from '@/stores/home';
import { jump, JumpType } from '../../utils';
export default {
data() {
......@@ -105,12 +107,17 @@ export default {
spec: '',
points: 0,
quantity: 1
}
},
// 商店信息
homeStore: null
}
},
onLoad(options) {
console.log('结算页面参数:', options);
// 初始化homeStore
this.homeStore = useHomeStore();
// 解析页面参数
this.parsePageParams(options);
......@@ -366,6 +373,16 @@ export default {
return Object.keys(params)
.map(key => `${key}=${encodeURIComponent(params[key])}`)
.join('&');
},
// 处理客服按钮点击
handleServiceClick() {
const { memberId, mobile, openId, unionId } = this.homeStore.homeInfo || {};
const customerUrl = `https://intelcc-user.icsoc.net/?channelKey=45839e0505554f8c8aea3c7b6259b049&init=1&crmld=${memberId || ''}&mobile=${mobile || ''}&openId=${openId || ''}&unionId=${unionId || ''}`;
jump({
type: JumpType.H5,
url: customerUrl
});
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment