diff --git a/api/model/order.js b/api/model/order.js
index 946e2bd..152b570 100644
--- a/api/model/order.js
+++ b/api/model/order.js
@@ -42,6 +42,13 @@ const api = {
limit: 500
},
+ // 订单-购物车-删除购物车
+ deleteShopcar: {
+ url: '/teambuy/shopcar/deleteShopcar',
+ method: 'POST',
+ limit: 500
+ },
+
// 订单-支付订单
payOrder: {
url: '/teambuy/order/payOrder',
@@ -117,7 +124,23 @@ const api = {
url: '/teambuy/afterservice/addAfterService',
method: 'POST',
limit: 500
- }
+ },
+
+ // 订单-取消团员订单
+ deleteMemberOrderById: {
+ url: '/teambuy/order/deleteMemberOrderById',
+ method: 'POST',
+ limit: 500
+ },
+
+ // 订单-团员完成取餐
+ finishMemberOrderById: {
+ url: '/teambuy/order/finishMemberOrderById',
+ method: 'POST',
+ limit: 500
+ },
+
+
}
export default api
\ No newline at end of file
diff --git a/pages/index/cart.vue b/pages/index/cart.vue
index 51ccd10..56ba621 100644
--- a/pages/index/cart.vue
+++ b/pages/index/cart.vue
@@ -102,6 +102,9 @@ export default {
}
return total
}, 0)
+ },
+ deleteCartIds(){
+ return this.checkboxValue.join(';')
}
},
methods: {
@@ -115,11 +118,11 @@ export default {
})
},
// 增加或者减少数量
- modifyCart(item){
+ modifyCart(item, type){
this.$api('addShopcar', {
goodsId: item.goodsId,
id: item.id,
- num: item.num
+ num: type,
}, res => {
console.log(res);
})
@@ -134,13 +137,13 @@ export default {
},
increaseQuantity(item) {
item.num += 1;
- this.modifyCart(item)
+ this.modifyCart(item, 1)
// this.updateCart();
},
decreaseQuantity(item) {
if (item.num > 1) {
item.num -= 1;
- this.modifyCart(item)
+ this.modifyCart(item, -1)
}
},
// 结账
@@ -180,6 +183,16 @@ export default {
})
// 编写收藏函数的调用
}, 800)
+ },
+ // 删除购物车
+ deleteCart(){
+ this.$api('deleteShopcar', {
+ shopcarId: this.deleteCartIds,
+ }, res => {
+ if (res.code == 200){
+ this.getCartData()
+ }
+ })
}
},
onShow(){
diff --git a/pages/index/center.vue b/pages/index/center.vue
index f4fca88..4e9a331 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -182,9 +182,6 @@
diff --git a/pages_order/mine/team.vue b/pages_order/mine/team.vue
index d3535af..6aac428 100644
--- a/pages_order/mine/team.vue
+++ b/pages_order/mine/team.vue
@@ -5,21 +5,23 @@
color="#fff" />
-
+ s
+
+
- 送餐点照片
+ 送餐点照片
+
添加图片
-
+
@@ -46,8 +48,9 @@
所在地区
{{ formData.area }}
-
+
+
详细地址
@@ -57,12 +60,8 @@
-
- {{ !identity ? '提交申请' : '提交保存' }}
-
-
- 修改
- 保存
+
+ {{ buttonText }}
@@ -91,20 +90,28 @@ export default {
longitude: '' // 经度
},
identity: uni.getStorageSync('identity'),
- beModify: false // 为团员并且可以修改的模式
+ status: '-1', // 团长申请状态 -1 未提交 0 审核中 1 审核通过 2 审核不通过
+ remark: '' // 审核不通过原因
}
},
methods: {
// 选择图片
chooseImage() {
- uni.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
+ this.$Oss.ossUploadImage({
+ key: '',
+ folder: '',
+ compressed: true,
success: (res) => {
- // 这里可以添加图片上传到服务器的逻辑
- // 暂时只展示选择的图片
- this.formData.spotImage = res.tempFilePaths[0]
+ console.log('上传成功',res);
+ this.formData.spotImage = ''
+ this.formData.spotImage = res
+ },
+ fail: (res) => {
+ console.log('上传失败',res);
+ uni.showToast({
+ title: `上传失败,${res.errMsg}`,
+ icon: 'error'
+ })
}
})
},
@@ -114,6 +121,8 @@ export default {
// this.formData.area = e.detail.value[1] + e.detail.value[2]
position.selectAddress(0, 0, res => {
delete res.errMsg
+ res.area = res.name
+ delete res.name
this.formData = {
...this.formData,
...res
@@ -127,28 +136,28 @@ export default {
if (!this.formData.spotImage) {
return uni.showToast({
title: '请上传送餐点照片',
- icon: 'none'
+ icon: 'error'
})
}
if (!this.formData.spotName) {
return uni.showToast({
title: '请输入送餐点名称',
- icon: 'none'
+ icon: 'error'
})
}
if (!this.formData.name) {
return uni.showToast({
title: '请输入您的姓名',
- icon: 'none'
+ icon: 'error'
})
}
if (!this.formData.phone) {
return uni.showToast({
title: '请输入联系手机号',
- icon: 'none'
+ icon: 'error'
})
}
@@ -162,14 +171,14 @@ export default {
if (!this.formData.area) {
return uni.showToast({
title: '请选择所在地区',
- icon: 'none'
+ icon: 'error'
})
}
if (!this.formData.address) {
return uni.showToast({
title: '请输入详细地址',
- icon: 'none'
+ icon: 'error'
})
}
@@ -178,6 +187,8 @@ export default {
title: '提交中...'
})
+ console.log(this.formData);
+
// 如果是团员 提交申请
this.$api('updateLeaderInfo', {
...this.formData,
@@ -201,7 +212,7 @@ export default {
},
- // 获取初始值进行赋值
+ // 获取初始值进行赋值 赋值关键部分
assign(data) {
this.formData.address = data.address
this.formData.area = data.area
@@ -210,34 +221,52 @@ export default {
this.formData.spotImage = data.spotImage
this.formData.spotName = data.spotName
this.formData.id = data.id
+ },
+ },
+ computed: {
+ buttonText() {
+ switch (this.status) {
+ case '-1':
+ return '提交申请'
+ case '0':
+ return '修改申请'
+ case '1':
+ return '修改信息'
+ case '2':
+ return '重新申请'
+ default:
+ return '提交申请'
+ }
+ },
+ toastTitle() {
+ if (this.status == '2') {
+ return '审核不通过!'
+ } else if (this.status == '1') {
+ return '审核已通过!请前往个人页面右上角切换团长身份'
+ } else if (this.status == '0') {
+ return '审核中...'
+ }
+ },
+ toastType() {
+ if (this.status == '2') {
+ return 'error'
+ } else if (this.status == '1') {
+ return 'success'
+ } else if (this.status == '0') {
+ return 'warning'
+ } else {
+ return 'info'
+ }
}
-
},
onLoad() {
- if (!this.identity) {
- this.$api('queryLeaderInfo', {}, res => {
- if (res.code == 200){
- this.assign(res.result)
- if (this.formData.remark){
- if (this.formData.status != 0){
- uni.showModal({
- title: `${ this.formData.status == 1 ? '审核通过' : '审核不通过' }`,
- content: this.formData.remark,
- showCancel: false,
- confirmColor: '#019245',
- })
- }else {
- uni.showModal({
- title: `还在审核中 请稍等`,
- content: this.formData.remark,
- showCancel: false,
- confirmColor: '#019245',
- })
- }
- }
- }
- })
- }
+ this.$api('queryLeaderInfo', { }, res => {
+ if (res.code == 200){
+ this.assign(res.result)
+ this.status = res.result.status
+ this.remark = res.result.remark
+ }
+ })
}
}
diff --git a/pages_order/order/newOrderDetail.vue b/pages_order/order/newOrderDetail.vue
index 5d201a0..78f85f7 100644
--- a/pages_order/order/newOrderDetail.vue
+++ b/pages_order/order/newOrderDetail.vue
@@ -155,7 +155,7 @@
// 格式为 goodId,goodNum;goodId2,goodsNum
goodss() {
return this.orderDetail.goodsList.map(item => {
- return `${item.id},${item.num}`
+ return `${item.id},${item.num},${item.goods.price * item.num}`
}).join(';')
}