|
@@ -126,9 +126,9 @@ export default {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
var that = this
|
|
var that = this
|
|
|
uni.request({
|
|
uni.request({
|
|
|
- url: config.danshop('/danshop/cart/list'),
|
|
|
|
|
|
|
+ url: config.api('/api/cart/list'),
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- data: { userId: this.userId },
|
|
|
|
|
|
|
+ data: {},
|
|
|
header: {
|
|
header: {
|
|
|
'Content-Type': 'application/json',
|
|
'Content-Type': 'application/json',
|
|
|
'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
@@ -186,9 +186,9 @@ export default {
|
|
|
success: function(confirm) {
|
|
success: function(confirm) {
|
|
|
if (confirm.confirm) {
|
|
if (confirm.confirm) {
|
|
|
uni.request({
|
|
uni.request({
|
|
|
- url: config.danshop('/danshop/cart/remove'),
|
|
|
|
|
|
|
+ url: config.api('/api/cart/remove'),
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- data: { userId: that.userId, productId: productId },
|
|
|
|
|
|
|
+ data: { productId: productId },
|
|
|
header: {
|
|
header: {
|
|
|
'Content-Type': 'application/json',
|
|
'Content-Type': 'application/json',
|
|
|
'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
'Authorization': 'Bearer ' + uni.getStorageSync('token')
|
|
@@ -224,7 +224,7 @@ export default {
|
|
|
uni.setStorageSync('checkoutItems', selected)
|
|
uni.setStorageSync('checkoutItems', selected)
|
|
|
uni.navigateTo({ url: '/pages/shop/checkout/checkout' })
|
|
uni.navigateTo({ url: '/pages/shop/checkout/checkout' })
|
|
|
},
|
|
},
|
|
|
- formatPrice(price) {
|
|
|
|
|
|
|
+ formatPriceWithSymbol(price) {
|
|
|
if (price === null || price === undefined) return '0.00'
|
|
if (price === null || price === undefined) return '0.00'
|
|
|
return (Number(price) / 100).toFixed(2)
|
|
return (Number(price) / 100).toFixed(2)
|
|
|
}
|
|
}
|