Commit 2cec7bd9 by zhangxw

联调修改

1 parent 720d4e21
......@@ -35,7 +35,9 @@ module.exports = {
},
// 获取活动的商品信息
getMerchandiseInformation(){
getMerchandiseInformation(){},
// 获取众筹活动商品
getSamePriceGoodsAPI(data) {
return api.post('dj.api.smartcarlife.shopmallActivity.selectSamePriceGoods', data)
}
}
......@@ -16,7 +16,6 @@ Component({
}
return i
})
console.log(pickerObj)
this.setData({
optionList: pickerObj?.optionList || []
})
......@@ -63,11 +62,19 @@ Component({
let thisPage = wx.$router.getPageInstance()
orderInfo[pickerObj.optionId] = arr[0][pickerObj.optionId] || ''
orderInfo[pickerObj.optionName] = arr[0][pickerObj.optionName] || ''
if (pickerObj.flag) { // 商品带出金额
orderInfo['activityPrice'] = `¥${this.priceFilter(arr[0]?.activityPrice / 100 || 0)}`
orderInfo['crowdFundingPrice'] = `¥${this.priceFilter(arr[0]?.crowdFundingPrice / 100 || 0)}`
}
thisPage.setData({
orderInfo,
showPickerSelect: false
})
console.log(orderInfo)
},
priceFilter(num) {
var pow = Math.pow(10, 2)
return (Math.round(num * pow) / pow).toFixed(2)
},
cancel() {
let thisPage = wx.$router.getPageInstance()
......
// packageCrowdFunding/pages/activityList/activityList.js
import api from "../../api"
const app = getApp()
Page({
/**
......@@ -21,6 +23,19 @@ Page({
activityId,
activityName
})
// 获取商品
this.getShop(activityId)
},
getShop(activityId) {
api.getSamePriceGoodsAPI({actId: activityId}).then(res => {
let { code, data, message } = res
if (code == 0) {
app.globalData.crowdFundingShopInfo = data || []
} else {
wx.$util.showToast(message)
}
})
},
navbarReady(e) {
......
......@@ -10,7 +10,9 @@ Page({
data: {
orderObj: constantData.orderObj,
orderInfo: {},
orderNoPopup: false
orderNoPopup: false,
activityName: '',
activityId: ''
},
/**
......@@ -18,14 +20,37 @@ Page({
*/
onLoad(options) {
// 推荐人
let { orderObj } = this.data
let { orderObj, orderInfo } = this.data
if (app.globalData?.staffListRange && orderObj?.orderFormList) {
orderObj.orderFormList[orderObj.orderFormList.length - 1].optionList = app.globalData.staffListRange
}
// 商品
if (app.globalData?.crowdFundingShopInfo && orderObj?.shopFormList) {
if (app.globalData?.crowdFundingShopInfo?.length > 1) { // 多商品
orderObj.shopFormList[0].optionList = app.globalData?.crowdFundingShopInfo
} else { // 单商品直接带出商品名称
orderObj.shopFormList[0].type = 'input'
orderObj.shopFormList[0].readonly = true
orderInfo.shopmallGoodsId = app.globalData?.crowdFundingShopInfo[0]?.goodsId || ''
orderInfo.goodsName = app.globalData?.crowdFundingShopInfo[0]?.goodsName || ''
orderInfo.activityPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.activityPrice || 0)}`
orderInfo.crowdFundingPrice = `¥${this.priceFilter(app.globalData?.crowdFundingShopInfo[0]?.crowdFundingPrice || 0)}`
}
}
this.setData({orderObj})
},
priceFilter(num) {
var pow = Math.pow(10, 2)
return (Math.round(num * pow) / pow).toFixed(2)
},
onRoute(options) {
let { activityId, activityName } = options
this.setData({
activityId,
activityName
})
},
// 交易流水号
......@@ -45,7 +70,7 @@ Page({
},
confirm() {
let { orderInfo } = this.data
let { orderInfo, activityName, activityId } = this.data
let userInfo = wx.$util.getUserInfo()
let validObj = wx.$util.checkRule(orderInfo, constantData.formRule)
if (validObj) {
......@@ -66,7 +91,11 @@ Page({
userId: orderInfo.uuid,
employeeName: orderInfo.staffName,
merchantId: userInfo?.default4SStoreInfo?.merchantId,
merchantName: userInfo?.default4SStoreInfo?.merchantName
merchantName: userInfo?.default4SStoreInfo?.merchantName,
shopmallGoodsId: orderInfo.goodsId,
orderPaySource: 4,
activityId: activityId,
activityName: activityName
}
api.creatFullPayOrderAPI(params)
}
......
......@@ -11,6 +11,7 @@ const formRule = {
}
],
uuid: [{ required: true, message: '推荐人不能为空' }],
goodsId: [ { required: true, message: '请选择商品' } ]
}
const orderObj = {
......@@ -47,19 +48,22 @@ const orderObj = {
shopFormList: [
{
label: '商品名称',
name: 'shopName',
name: 'goodsName',
type: 'select',
readonly: true
optionList: [],
optionId: 'goodsId',
optionName: 'goodsName',
flag: true
},
{
label: '订金金额',
name: 'frontPrice',
name: 'activityPrice',
type: 'input',
readonly: true
},
{
label: '尾款金额',
name: 'balancePrice',
name: 'crowdFundingPrice',
type: 'input',
readonly: true,
noBorder: true
......
......@@ -37,3 +37,18 @@
transform: rotate(270deg);
}
.layout {
box-sizing: border-box;
position: relative;
font-size: 24rpx;
color: #8A8C90;
display: flex;
flex-direction: column;
height: calc(100vh - 100rpx - env(safe-area-inset-bottom));
height: calc(100vh - 100rpx - constant(safe-area-inset-bottom));
overflow: hidden;
}
.layout .pagedetail{
height: 100%;
}
......@@ -202,6 +202,7 @@ Component({
contractNo: target.contractNo
}
carLifeApi.printContract(params).then(res => {
wx.hideLoading()
if (res.code == '0') {
this.setData({
url: res.data
......@@ -215,7 +216,6 @@ Component({
} else {
wx.$util.showToast(res.message || '接口异常')
}
wx.hideLoading()
})
},
......
......@@ -294,6 +294,7 @@ Page({
}
carLifeApi.printContract(params).then(res => {
console.log(res)
wx.hideLoading()
if (res.code == '0') {
this.setData({
url: res.data
......@@ -303,7 +304,6 @@ Page({
} else {
wx.$util.showToast(res.message || '接口异常')
}
wx.hideLoading()
})
},
......
......@@ -40,10 +40,10 @@ Page({
success: res => {}
})
// 获取开通业务场景
// let arr = sceneList.filter(v => openSceneArr.includes(v.sceneType))
let arr = sceneList.filter(v => openSceneArr.includes(v.sceneType))
this.setData({
isShow: Object.keys(userInfo).length,
// sceneList: arr
sceneList: arr
})
// 没有登录信息 或无开通场景 退出登录
if (!Object.keys(userInfo).length || !userInfo.openSceneArr?.length) {
......
......@@ -23,7 +23,7 @@
<view class="cell">
<view class="label">抵用礼券:</view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
</view>
</block>
......
......@@ -28,7 +28,7 @@
<view class="cell">
<view class="label">抵用礼券:</view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
</view>
</block>
......@@ -46,7 +46,7 @@
<view class="cell">
<view class="label">抵用券:</view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
</view>
<view class="line" />
......
......@@ -18,7 +18,7 @@
<view class="cell">
<view class="label">抵用礼券:</view>
<view class="value">
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}
{{orderInfo.couponName || ''}}{{orderInfo.customerCoupon.customerCouponCode ||''}}({{orderInfo.customerCoupon.employeeName || ''}})
</view>
</view>
</block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!