Commit 33b6c3cf by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !179
2 parents e32e69f4 32a7f6de
...@@ -18,13 +18,13 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,13 +18,13 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 4 let index = 2
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion const envName = accountInfo.miniProgram.envVersion
//手动控制体验版环境的请求 true就依据下面index false就默认2 //手动控制体验版环境的请求 true就依据下面index false就默认2
const manual = true const manual = false
const release = false const release = false
// 判断小程序环境 // 判断小程序环境
......
...@@ -12,12 +12,12 @@ Page({ ...@@ -12,12 +12,12 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { }, onLoad(options) {},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { }, onReady() {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -29,35 +29,40 @@ Page({ ...@@ -29,35 +29,40 @@ Page({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { }, onHide() {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { }, onUnload() {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { }, onPullDownRefresh() {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { }, onReachBottom() {},
init() { init() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
wx.nextTick(() => { wx.nextTick(() => {
// 没有登录信息 退出登录 // 没有登录信息 退出登录
if (!userInfo || !Object.keys(userInfo).length) { if (!userInfo || !Object.keys(userInfo).length) {
return app.login(false,'请重新登录') return app.login(false, '请重新登录')
} }
// 未选择4s店 非超管 // 未选择4s店 非超管
if ((userInfo?.shopMerchantId ?? '') === '' && !userInfo?.isSuper) return wx.$router.reLaunch('pages.accountItems') if ((userInfo?.shopMerchantId ?? '') === '' && !userInfo?.isSuper) return wx.$router.reLaunch('pages.accountItems')
// 未选择场景 // 未选择场景
if ((userInfo?.sceneType ?? '') === '') return wx.$router.reLaunch('pages.sceneIndex') if ((userInfo?.sceneType ?? '') === '') return wx.$router.reLaunch('pages.sceneIndex')
if (!((userInfo?.sceneType ?? '') === '')) return wx.$router.reLaunch(constantData?.pageUrl[userInfo?.sceneType], {resetStoreList: true}) // 登录了更新用户权限
app.gobalCheckYqdSuper(userInfo)
if (!((userInfo?.sceneType ?? '') === '')) return wx.$router.reLaunch(constantData?.pageUrl[userInfo?.sceneType], {
resetStoreList: true
})
}) })
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -231,35 +231,35 @@ Page({ ...@@ -231,35 +231,35 @@ Page({
this.setGoodsTotal(goodsList) this.setGoodsTotal(goodsList)
}, },
// 屏蔽不用 // 屏蔽不用
setGoodsTotal(goodsList) { // setGoodsTotal(goodsList) {
let { totalFee } = this.data // let { totalFee } = this.data
let total = 0 // let total = 0
// goodsList.map(i => (total += i.count * i.price)) // // goodsList.map(i => (total += i.count * i.price))
goodsList.map(i => { // goodsList.map(i => {
const totalPrice = NP.times(i.count, i.price) // const totalPrice = NP.times(i.count, i.price)
total = NP.plus(total, totalPrice) // total = NP.plus(total, totalPrice)
}) // })
// 用来解决小数相减导致精度问题 // // 用来解决小数相减导致精度问题
// total = this.accMul(total, 100) // // total = this.accMul(total, 100)
total = NP.times(total, 100) // total = NP.times(total, 100)
// total = parseFloat(total.toFixed(2)) // // total = parseFloat(total.toFixed(2))
// console.log(total * 100) // // console.log(total * 100)
// console.log(totalFee) // // console.log(totalFee)
// console.log(totalFee * 100) // // console.log(totalFee * 100)
// 计算差价格 没有就归0 100是用来解决小数相减导致精度问题 // // 计算差价格 没有就归0 100是用来解决小数相减导致精度问题
// console.log(this.accMul(total, 100)) // // console.log(this.accMul(total, 100))
// 解决数据精度丢失问题 // // 解决数据精度丢失问题
// let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0 // // let priceSpread = goodsList.length ? parseFloat((total - totalFee).toFixed(2)) : 0
let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0 // let priceSpread = goodsList.length ? NP.minus(total, totalFee) : 0
// console.log(priceSpread) // // console.log(priceSpread)
this.setData({ // this.setData({
priceSpread: priceSpread, // priceSpread: priceSpread,
// total: wx.$util.decimal(total, 2) // // total: wx.$util.decimal(total, 2)
// total // // total
}) // })
}, // },
// accSub(arg1, arg2) { // accSub(arg1, arg2) {
// let r1, r2, m, n // let r1, r2, m, n
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
placeholder="30字以内" placeholder="30字以内"
value="{{ orderObj.remark }}" value="{{ orderObj.remark }}"
/> />
<!-- <view class="sellerUserId"> <view class="sellerUserId">
<gl-cell <gl-cell
border border
valueAlign="right" valueAlign="right"
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
</view> </view>
</block> </block>
</gl-cell> </gl-cell>
</view> --> </view>
</view> </view>
<view class="box"> <view class="box">
<block wx:if="{{ orderObj.merchantId }}"> <block wx:if="{{ orderObj.merchantId }}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!