Commit 53dc6d7f by chenwq

开通业务联调

1 parent d84edd32
// packageOutput/pages/openBusiness/openBusiness.js
import outputApi from '~/api/outputApi/index'
Page({
/**
......@@ -6,6 +7,8 @@ Page({
*/
data: {
IMGURL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
merchantInfo: {},
sceneCodeList: [],
// 场景业务
formData: {
scene1: true,
......@@ -22,89 +25,108 @@ Page({
scene3: [],
scene4: [],
// scene1: [{
// name: '360实景导航',
// productName: '360实景导航',
// price: 10
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }, {
// name: 'AR实景导航',
// productName: 'AR实景导航',
// price: 20
// }],
// scene2: [{
// name: '座椅通风',
// productName: '座椅通风',
// price: 30
// }, {
// name: '座椅通风',
// productName: '座椅通风',
// price: 40
// }],
// scene3: [{
// name: '氛围灯',
// productName: '氛围灯',
// price: 50
// }, {
// name: '氛围灯',
// productName: '氛围灯',
// price: 60
// }],
// scene4: [{
// name: '数字化',
// productName: '数字化',
// price: 70
// }, {
// name: '数字化',
// productName: '数字化',
// price: 80
// }, {
// name: '数字化',
// productName: '数字化',
// price: 70
// }, {
// name: '数字化',
// productName: '数字化',
// price: 80
// }, {
// name: '数字化',
// productName: '数字化',
// price: 70
// }, {
// name: '数字化',
// productName: '数字化',
// price: 80
// }, {
// name: '数字化',
// productName: '数字化',
// price: 70
// }, {
// name: '数字化',
// productName: '数字化',
// price: 80
// }]
}
},
getNoOpenPro(sceneCode) {
var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId,
merchant4sId: this.data.merchantInfo.merchantId,
sceneCode: sceneCode
}
outputApi.getNoOpenPro(params).then(res => {
this.setData({
['sceneActivityObj.scene' + this.data.sceneActive]: res
})
this.setCurActivity()
})
},
// 场景切换
handleSceneChange(e) {
var idx = e.detail.sceneIdx
this.setData({
sceneActive: idx
})
if (!this.data.sceneActivityObj['scene' + this.data.sceneActive].length) {
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
return true
}
this.setCurActivity()
// console.log('换内容---')
},
......@@ -115,10 +137,11 @@ Page({
})
},
// 活动切换
handleActClick(e) {
var idx = e.currentTarget.dataset.idx
this.setData({
['activityList[' + idx +'].checked']: !this.data.activityList[idx].checked
['activityList[' + idx + '].checked']: !this.data.activityList[idx].checked
})
},
......@@ -127,7 +150,7 @@ Page({
sceneActive: this.data.sceneActive,
activityIdxList: this.data.activityList.filter(item => item.checked == true)
}
if(!params.activityIdxList.length) {
if (!params.activityIdxList.length) {
wx.$api.showToast('请选产品/活动')
return true
}
......@@ -136,28 +159,22 @@ Page({
title: '提交成功',
icon: 'success'
})
// equityApi.addClueRescue(obj).then(res => {
// wx.hideLoading()
// wx.showModal({
// content: '您的救援服务单已提交成功',
// confirmText: '返回',
// showCancel: false,
// confirmColor: '#FC5B32'
// }).then(res => {
// if (res.confirm) {
// wx.switchTab({
// url: '/pages/tab/index/index'
// })
// }
// })
// })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setCurActivity()
wx.$router.getData(obj => {
console.log(obj)
this.setData({
merchantInfo: obj,
sceneActive: obj.sceneActive,
sceneCodeList: obj.sceneCodeList
})
this.getNoOpenPro(this.data.sceneCodeList[this.data.sceneActive - 1])
})
},
/**
......
......@@ -16,7 +16,7 @@
<view class="box">
<view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view>
<view class="activity-box">
<view class="activity-item text-hide {{ item.checked ? 'active' : '' }}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActClick" data-idx="{{index}}">{{item.name}}</view>
<view class="activity-item text-hide {{ item.checked ? 'active' : '' }}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</view>
</view>
</view>
</view>
......
......@@ -173,8 +173,13 @@ Page({
},
handleJump(e) {
console.log(this.data.activityList[this.data.activityActive])
wx.$router.go('packageOutput.openBusiness')
// console.log(this.data.activityList[this.data.activityActive])
var params = {
merchantInfo: this.data.merchantInfo,
sceneActive: this.data.sceneActive,
sceneCodeList: this.data.sceneCodeList
}
wx.$router.go('packageOutput.openBusiness', params)
},
getNoOpenPro(sceneCode) {
......@@ -231,8 +236,8 @@ Page({
res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode)
if (idx != -1) {
var orderTotal = item.orderTotal
if(item.orderTotal) {
var orderTotal = item.orderTotal
if (item.orderTotal) {
item.orderTotal.calCustomerUnitPrice = Math.round(orderTotal.totalSubOrderOrderMoney / orderTotal.upgradeCount).toFixed(0)
item.orderTotal.calExperience = Math.round((orderTotal.experienceCount * 100) / orderTotal.toShopCount).toFixed(0)
item.orderTotal.calTransform = Math.round((orderTotal.upgradeCount * 100) / orderTotal.experienceCount).toFixed(0)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!