Browse Source

优化金额

master
wanghongjun 2 years ago
parent
commit
863eac69aa
  1. 2
      pages/category/index.vue
  2. 9
      pages/user/shopcart/index.vue

2
pages/category/index.vue

@ -246,7 +246,7 @@
// //
await app.getCatList(page.num) await app.getCatList(page.num)
.then(list => { .then(list => {
console.log('list',list) //console.log('list',list)
const curPageLen = list.data.length const curPageLen = list.data.length
const totalSize = list.total const totalSize = list.total
app.mescroll.endBySize(curPageLen, totalSize) app.mescroll.endBySize(curPageLen, totalSize)

9
pages/user/shopcart/index.vue

@ -20,13 +20,13 @@
<text class="goods-title-name">{{ item.detail.goods_name }}</text> <text class="goods-title-name">{{ item.detail.goods_name }}</text>
<text class="goods-title-content">交易方式{{ item.detail.goods_entrust?'转让':'授权' }}</text> <text class="goods-title-content">交易方式{{ item.detail.goods_entrust?'转让':'授权' }}</text>
<text class="goods-title-content">购买年限{{ item.use_years }}</text> <text class="goods-title-content">购买年限{{ item.use_years }}</text>
<text class="goods-title-content">单价{{ item.goods_price }}</text> <text class="goods-title-content">单价{{ item.detail.price_str }}</text>
</view> </view>
<view class="item-foot"> <view class="item-foot">
<view class="goods-price"> <view class="goods-price">
<text>合计</text> <text>合计</text>
<text class="unit"></text> <text class="unit"></text>
<text class="value">{{ item.use_years * item.goods_price }}</text> <text class="value">{{ item.total_money_str }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -71,6 +71,7 @@
import { inArray, arrayIntersect, debounce } from '@/utils/util' import { inArray, arrayIntersect, debounce } from '@/utils/util'
import { checkLogin, setCartTotalNum, setCartTabBadge } from '@/core/app' import { checkLogin, setCartTotalNum, setCartTabBadge } from '@/core/app'
import * as UserApi from '@/api/user' import * as UserApi from '@/api/user'
import {formatAmount} from '@/api/order/comment'
import EmptyCart from '@/components/empty-cart' import EmptyCart from '@/components/empty-cart'
import uniIcons from '../../../uni_modules/uni-icons/components/uni-icons/uni-icons' import uniIcons from '../../../uni_modules/uni-icons/components/uni-icons/uni-icons'
import {createOrder, delShopCart} from "../../../api/user"; import {createOrder, delShopCart} from "../../../api/user";
@ -159,6 +160,10 @@ export default {
if (result.code == '200') { if (result.code == '200') {
app.list = result.data app.list = result.data
app.total = result.data.length app.total = result.data.length
app.list.forEach(item => {
item.total_money_str = formatAmount(item.total_money)
item.detail.price_str = formatAmount(Number(item.detail.price))
})
} }
// checkedIdsID // checkedIdsID
app.onClearInvalidId() app.onClearInvalidId()

Loading…
Cancel
Save