Commit 536db5f1 by chenwq

successpage,创建客户成功后跳转

1 parent 2249e460
...@@ -112,10 +112,15 @@ Page({ ...@@ -112,10 +112,15 @@ Page({
if (res.confirm) { if (res.confirm) {
// 创建/编辑接口 // 创建/编辑接口
mineCustomerApi[apiNameObj[addOrEdit]](formData).then(res => { mineCustomerApi[apiNameObj[addOrEdit]](formData).then(res => {
let { code, message } = res let { code, data, message } = res
if (code == '0') { if (code == '0') {
if (addOrEdit == 'add') { if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=customer') if (data) {
let params = '&merchantId=' + data.merchantId + '&sceneList=' + data.sceneList
wx.$router.redirectTo(`packageMine.successPage?page=customer${params}`)
} else {
wx.$api.showToast('返回参数有误')
}
} else { } else {
wx.$api.showToast('修改成功') wx.$api.showToast('修改成功')
setTimeout(() => { setTimeout(() => {
......
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
handlePopupConfirm() { handlePopupConfirm() {
let { popupVal } = this.data let { popupVal } = this.data
if(!popupVal) { if (!popupVal) {
wx.$api.showToast('请选择邀请方式') wx.$api.showToast('请选择邀请方式')
return true return true
} }
...@@ -120,6 +120,17 @@ Page({ ...@@ -120,6 +120,17 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
if (options?.isRedirect) {
let { merchantId } = options
this.setData({
customerInfo: {
merchantId,
sceneList: options.sceneList.split(',')
}
})
this.getList()
return true
}
wx.$router.getData(res => { wx.$router.getData(res => {
this.setData({ this.setData({
customerInfo: res customerInfo: res
......
...@@ -9,7 +9,7 @@ const obj = { ...@@ -9,7 +9,7 @@ const obj = {
customer: { customer: {
navigationTitle: '创建客户', navigationTitle: '创建客户',
primaryBtn: '邀请销售顾问', primaryBtn: '邀请销售顾问',
primaryCallback: 'packageMine.editCustomer?addOrEdit=add', primaryCallback: 'packageMine.saleList',
cancelBtn: 'S后自动跳转我的客户' cancelBtn: 'S后自动跳转我的客户'
}, },
staff: { staff: {
...@@ -33,15 +33,17 @@ Page({ ...@@ -33,15 +33,17 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// this.setData({ if (options) {
// paramsObj: options
// })
console.log(options)
if(options) {
let { page } = options let { page } = options
this.setData({ this.setData({
paramsObj: obj[page] paramsObj: JSON.parse(JSON.stringify(obj[page]))
}) })
if (page == 'customer') {
let { merchantId, sceneList } = options
this.setData({
['paramsObj.primaryCallback']: JSON.parse(JSON.stringify(obj[page].primaryCallback)) + '?merchantId=' + merchantId + '&sceneList=' + sceneList + '&isRedirect=true'
})
}
} }
let { count, paramsObj } = this.data let { count, paramsObj } = this.data
this.countDownTime = setInterval(() => { this.countDownTime = setInterval(() => {
...@@ -67,7 +69,7 @@ Page({ ...@@ -67,7 +69,7 @@ Page({
} else { } else {
wx.$router.back() wx.$router.back()
} }
}, },
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!