Commit 2cec7bd9 by zhangxw

联调修改

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