tapd问题修改
This commit is contained in:
parent
cc97b6acca
commit
56b115a695
|
|
@ -26,7 +26,7 @@
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<picker @change="categoryChange" :value="categoryCurrent" range-key="name" :range="category">
|
<picker @change="categoryChange" :value="pageData.categoryCurrent" range-key="name" :range="pageData.category">
|
||||||
<view class=" u-flex u-row-between border-bottom u-relative ">
|
<view class=" u-flex u-row-between border-bottom u-relative ">
|
||||||
<view class="zhezhao u-absolute position-all" style="z-index: 1;"></view>
|
<view class="zhezhao u-absolute position-all" style="z-index: 1;"></view>
|
||||||
|
|
||||||
|
|
@ -118,8 +118,10 @@
|
||||||
list: [],
|
list: [],
|
||||||
current: ''
|
current: ''
|
||||||
})
|
})
|
||||||
let category = reactive([])
|
const pageData = reactive({
|
||||||
let categoryCurrent = ref('')
|
category: [],
|
||||||
|
categoryCurrent: ''
|
||||||
|
})
|
||||||
|
|
||||||
const refform = ref(null)
|
const refform = ref(null)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
|
|
@ -202,7 +204,7 @@
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 600
|
size: 600
|
||||||
})
|
})
|
||||||
category = res.map(v => {
|
pageData.category = res.map(v => {
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
value: v.id
|
value: v.id
|
||||||
|
|
@ -211,8 +213,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function categoryChange(e) {
|
function categoryChange(e) {
|
||||||
categoryCurrent.value = e.detail.value
|
pageData.categoryCurrent = e.detail.value
|
||||||
form.category = category[e.detail.value].name
|
form.category = pageData.category[e.detail.value].name
|
||||||
}
|
}
|
||||||
|
|
||||||
function unitChange(e) {
|
function unitChange(e) {
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,7 @@
|
||||||
* 打包费
|
* 打包费
|
||||||
*/
|
*/
|
||||||
const $packFee = computed(() => {
|
const $packFee = computed(() => {
|
||||||
|
console.log("打包费===",goods.list)
|
||||||
return goods.list.reduce((prve, cur) => {
|
return goods.list.reduce((prve, cur) => {
|
||||||
return prve + (cur.packFee*parseFloat(cur.pack_number).toFixed(0))
|
return prve + (cur.packFee*parseFloat(cur.pack_number).toFixed(0))
|
||||||
}, 0).toFixed(2)
|
}, 0).toFixed(2)
|
||||||
|
|
@ -447,7 +448,7 @@
|
||||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
const lowMemberPrice = cur.lowMemberPrice ? cur.lowMemberPrice : cur.lowPrice
|
const lowMemberPrice = cur.lowMemberPrice ? cur.lowMemberPrice : cur.lowPrice
|
||||||
const tPrice = (isVip.value ? lowMemberPrice : cur.lowPrice) * cur.number
|
const tPrice = (isVip.value ? lowMemberPrice : cur.lowPrice) * cur.number
|
||||||
const tpackFee = parseFloat(cur.pack_number).toFixed(0) > 0 ? cur.packFee*parseFloat(cur.pack_number).toFixed(0) : 0
|
const tpackFee = cur.is_temporary !=1&&parseFloat(cur.pack_number).toFixed(0) > 0 ? cur.packFee*parseFloat(cur.pack_number).toFixed(0) : 0
|
||||||
return prve + (cur.is_gift ? 0 : tPrice) + tpackFee
|
return prve + (cur.is_gift ? 0 : tPrice) + tpackFee
|
||||||
}, 0)
|
}, 0)
|
||||||
return ((goodsTotalPrice - discount_sale_amount.value) || 0).toFixed(2)
|
return ((goodsTotalPrice - discount_sale_amount.value) || 0).toFixed(2)
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
|
console.log("购物车数据==",props.data)
|
||||||
return props.data.reduce((prve, cur) => {
|
return props.data.reduce((prve, cur) => {
|
||||||
return prve + cur.lowPrice * cur.number
|
return prve + cur.lowPrice * cur.number
|
||||||
}, 0).toFixed(2)
|
}, 0).toFixed(2)
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
|
|
||||||
import appConfig from '@/config/appConfig.js';
|
import appConfig from '@/config/appConfig.js';
|
||||||
import WebsocketUtil from '@/commons/utils/websocket.js'
|
import WebsocketUtil from '@/commons/utils/websocket.js'
|
||||||
import { getShopTable } from '@/api/table.js'
|
import { getShopTable,getShopTableDetail } from '@/api/table.js'
|
||||||
import { getProductList } from '@/api/product.js'
|
import { getProductList } from '@/api/product.js'
|
||||||
import { categoryPage } from '@/api/cateGory.js'
|
import { categoryPage } from '@/api/cateGory.js'
|
||||||
import { inject } from 'vue';
|
import { inject } from 'vue';
|
||||||
|
|
@ -954,16 +954,14 @@
|
||||||
console.log('scanCode');
|
console.log('scanCode');
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success: function(res) {
|
success: async function(res) {
|
||||||
console.log('条码类型:' + res.scanType);
|
console.log('条码类型:' + res.scanType);
|
||||||
console.log('条码内容:' + res.result);
|
console.log('条码内容:' + res.result);
|
||||||
if (res.result.includes('codeplate?code=')) {
|
if (res.result.includes('codeplate?code=')) {
|
||||||
const par = returnUrlPar(res.result)
|
const par = returnUrlPar(res.result)
|
||||||
const tableId = par.code
|
const tableCode = par.code
|
||||||
|
let resData = await getShopTableDetail({tableCode:tableCode})
|
||||||
onChooseTable({
|
onChooseTable(resData)
|
||||||
id: tableId
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ export function getNowCart(carItem,goodsList,user) {
|
||||||
carItem.number = parseFloat(carItem.number)
|
carItem.number = parseFloat(carItem.number)
|
||||||
carItem.name = carItem.product_name
|
carItem.name = carItem.product_name
|
||||||
carItem.lowPrice = carItem.discount_sale_amount
|
carItem.lowPrice = carItem.discount_sale_amount
|
||||||
|
carItem.discount_sale_amount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return carItem
|
return carItem
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue