diff --git a/components/center/orderCard.vue b/components/center/orderCard.vue
index b217940..93ba49d 100644
--- a/components/center/orderCard.vue
+++ b/components/center/orderCard.vue
@@ -1,6 +1,6 @@
-
+
{{ item.value }}
@@ -19,13 +19,19 @@
},
mounted() {
this.list = [
- { id: '001', label: '待支付', value: 2, icon: '/pages_order/static/center/order-1.png' },
- { id: '002', label: '待发货', value: 2, icon: '/pages_order/static/center/order-2.png' },
- { id: '003', label: '待收货', value: 0, icon: '/pages_order/static/center/order-3.png' },
- { id: '004', label: '售后', value: 0, icon: '/pages_order/static/center/order-4.png' },
- { id: '005', label: '全部', icon: '/pages_order/static/center/order-5.png' },
+ { id: '001', label: '待支付', value: 2, index: 1, icon: '/pages_order/static/center/order-1.png' },
+ { id: '002', label: '待发货', value: 2, index: 2, icon: '/pages_order/static/center/order-2.png' },
+ { id: '003', label: '待收货', value: 0, index: 3, icon: '/pages_order/static/center/order-3.png' },
+ // todo: check
+ { id: '004', label: '售后', value: 0, index: 0, icon: '/pages_order/static/center/order-4.png' },
+ { id: '005', label: '全部', index: 0, icon: '/pages_order/static/center/order-5.png' },
]
},
+ methods: {
+ jumpToOrderList(index) {
+ this.$utils.navigateTo(`/pages_order/order/orderList/index?index=${index}`)
+ }
+ },
}
diff --git a/components/product/productCard.vue b/components/product/productCard.vue
index 911206d..c5fc044 100644
--- a/components/product/productCard.vue
+++ b/components/product/productCard.vue
@@ -17,7 +17,7 @@
{{ `¥${data.originalPrice}/份` }}
-
@@ -44,8 +44,8 @@
}
},
methods: {
- addToCart(id) {
- // todo
+ onAddCart(id) {
+ this.$store.commit('addCart', this.data)
},
jumpToProductDetail() {
this.$utils.navigateTo(`/pages_order/product/productDetail?id=${this.data.id}`)
diff --git a/pages.json b/pages.json
index 9b38ed7..5318295 100644
--- a/pages.json
+++ b/pages.json
@@ -85,6 +85,9 @@
{
"path": "order/orderList/index"
},
+ {
+ "path": "order/orderDetail/index"
+ },
{
"path": "address/addressList"
},
@@ -94,6 +97,9 @@
{
"path": "comment/commentWrite"
},
+ {
+ "path": "service/index"
+ },
{
diff --git a/pages/index/cart copy.vue b/pages/index/cart copy.vue
deleted file mode 100644
index 381c5b0..0000000
--- a/pages/index/cart copy.vue
+++ /dev/null
@@ -1,260 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
-
-
-
- 规格:{{ item.unit }}
-
-
-
- ¥{{ item.price }}元
-
-
-
-
-
-
-
-
-
-
-
-
- {{ checkboxValue.length }}
-
-
-
-
- 合计
-
- ¥{{ totalPrice }}
-
-
-
- 共{{ checkboxValue.length }}件,已享受更低优惠
-
-
-
- 去结算
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/index/cart.vue b/pages/index/cart.vue
index 100372e..ff6fcbf 100644
--- a/pages/index/cart.vue
+++ b/pages/index/cart.vue
@@ -81,7 +81,7 @@
合计¥{{ totalPrice }}
- 去结算
+ 去结算
@@ -92,6 +92,7 @@
@@ -495,6 +503,10 @@
line-height: 1;
background-image: linear-gradient(to right, #4B348F, #845CFA);
border-radius: 41rpx;
+
+ &.is-disabled {
+ opacity: 0.5;
+ }
}
}
}
diff --git a/pages_order/address/addressView.vue b/pages_order/address/addressView.vue
index a6d7bad..46b0eaf 100644
--- a/pages_order/address/addressView.vue
+++ b/pages_order/address/addressView.vue
@@ -3,12 +3,18 @@
{{ data.name }}
- {{ data.phone }}
+
+ {{ data.phone }}
+ 复制
+
默认
- {{ `${data.area.join('')}${data.address}` }}
+
+ {{ displayAddress }}
+ 复制
+
@@ -29,13 +35,38 @@
showIcon: {
type: Boolean,
default: false,
- }
+ },
+ enableCopy: {
+ type: Boolean,
+ default: false,
+ },
+ },
+ computed: {
+ displayAddress() {
+ if (!this.data) {
+ return ''
+ }
+ const { area, address } = this.data
+
+ return `${area.join('')}${address}`
+ },
},
}
\ No newline at end of file
diff --git a/pages_order/comment/commentWrite.vue b/pages_order/comment/commentWrite.vue
index fb0512d..381c1fe 100644
--- a/pages_order/comment/commentWrite.vue
+++ b/pages_order/comment/commentWrite.vue
@@ -1,7 +1,7 @@
-
+
@@ -129,7 +129,11 @@
// todo
- this.$utils.redirectTo(`/pages_order/comment/commentRecords?creator=${userInfo.id}`)
+ setTimeout(() => {
+ this.$utils.navigateBack()
+ }, 800)
+
+ // this.$utils.redirectTo(`/pages_order/comment/commentRecords?creator=${userInfo.id}`)
} catch (err) {
console.log('onSubmit err', err)
diff --git a/pages_order/components/formInput.vue b/pages_order/components/formInput.vue
index 6ac062a..c5c86a9 100644
--- a/pages_order/components/formInput.vue
+++ b/pages_order/components/formInput.vue
@@ -1,5 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单编号
+ {{ orderData.number }}
+
+
+ 下单时间
+ {{ $dayjs(orderData.createTime).format('YYYY-MM-DD HH:mm') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 我已阅读并同意
+
+ 《用户协议》
+
+ 《隐私协议》
+
+ 《消费者告知》
+
+
+
+
+ 合计
+ ¥{{ totalPrice }}
+
+ 立即支付
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/order/orderConfirm/productCard.vue b/pages_order/order/orderConfirm/productCard.vue
new file mode 100644
index 0000000..795823e
--- /dev/null
+++ b/pages_order/order/orderConfirm/productCard.vue
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+ {{ data.name }}
+ {{ data.desc }}
+
+ ¥{{ data.price.toFixed(2) }}
+
+
+
+ 规格:{{ data.countDesc || data.count }}
+
+
+
+
+
+ 定制组合
+
+
+ 自定组合
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/order/orderDetail/index.vue b/pages_order/order/orderDetail/index.vue
new file mode 100644
index 0000000..391278b
--- /dev/null
+++ b/pages_order/order/orderDetail/index.vue
@@ -0,0 +1,647 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单详情
+ {{ statusDesc }}
+
+
+
+
+
+ {{ item.name }}
+
+ 产品类型:
+ {{ item.type }}
+
+
+ 产品内容:
+ {{ item.content }}
+
+
+ 价格:
+ ¥{{ item.price.toFixed(2) }}
+
+
+
+
+
+ 总价格
+ ¥{{ orderData.amount.toFixed(2) }}
+
+
+
+
+
+ 售后信息
+
+
+
+
+
+
+
+
+ {{ item.desc }}
+
+
+
+
+
+
+
+
+ 订单信息
+
+
+
+ 订单编号
+ {{ orderData.number }}
+
+
+ 下单时间
+ {{ $dayjs(orderData.createTime).format('YYYY-MM-DD HH:mm') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 联系客服
+
+
+
+
+
+ 合计
+ ¥{{ orderData.amount.toFixed(2) }}
+
+ 立即支付
+
+
+
+ 申请售后
+
+
+
+ 申请售后
+ 确认收货
+
+
+
+ 申请售后
+ 立即评价
+
+
+
+ 申请售后
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/order/orderList/index.vue b/pages_order/order/orderList/index.vue
new file mode 100644
index 0000000..902eafb
--- /dev/null
+++ b/pages_order/order/orderList/index.vue
@@ -0,0 +1,453 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/order/orderList/orderCard.vue b/pages_order/order/orderList/orderCard.vue
new file mode 100644
index 0000000..e8ad0fd
--- /dev/null
+++ b/pages_order/order/orderList/orderCard.vue
@@ -0,0 +1,245 @@
+
+
+
+ {{ data.title }}
+ {{ statusDesc }}
+
+
+
+
+
+ 客户姓名:
+ {{ data.userName }}
+
+
+ 下单时间:
+ {{ data.createTime }}
+
+
+ 联系电话:
+ {{ data.phone }}
+
+
+
+
+
+ 总价格:
+ ¥{{ data.amount.toFixed(2) }}
+
+
+
+
+ 立即支付
+
+
+
+ 申请售后
+
+
+
+ 申请售后
+ 确认收货
+
+
+
+ 申请售后
+ 立即评价
+
+
+
+ 申请售后
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/order/payPopup.vue b/pages_order/order/payPopup.vue
new file mode 100644
index 0000000..3cb9832
--- /dev/null
+++ b/pages_order/order/payPopup.vue
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages_order/product/productDetail.vue b/pages_order/product/productDetail.vue
index 82f27e7..660324a 100644
--- a/pages_order/product/productDetail.vue
+++ b/pages_order/product/productDetail.vue
@@ -62,7 +62,7 @@
评价
- 加入购物车
+ 加入购物车
立即购买
@@ -210,6 +210,9 @@
this.onBuy()
},
+ onAddCart(id) {
+ this.$store.commit('addCart', this.detail)
+ },
onBuy() {
const { count, options } = this.detail
@@ -223,7 +226,7 @@
this.$refs.agreementPopup.open()
- // this.jumpToCreateOrder()
+ this.$store.commit('createOrder', [this.detail])
},
},
}
diff --git a/pages_order/report/nutritionProgram/index.vue b/pages_order/report/nutritionProgram/index.vue
index 465caf2..236b58f 100644
--- a/pages_order/report/nutritionProgram/index.vue
+++ b/pages_order/report/nutritionProgram/index.vue
@@ -51,7 +51,7 @@
class="flex btn btn-settle"
:class="[selectedCount ? '' : 'is-disabled']"
:disabled="!selectedCount"
- @click="onSettle"
+ @click="onBuy"
>
结算
{{ `(${selectedCount}种)` }}
@@ -176,21 +176,24 @@
},
methods: {
onSelect(stepIdx, childIdx, selected) {
- console.log('onSelect', stepIdx, childIdx, selected)
-
this.list[stepIdx].children[childIdx].selected = selected
+ },
+ getSelectedList() {
+ return this.list.reduce((arr, step) => {
+ const selectedArr = step.children.filter(product => product.selected)
- // todo
+ return arr.concat(selectedArr)
+ }, [])
},
onAddCart() {
- console.log('onAddCart')
+ const selectedList = this.getSelectedList()
- // todo
+ this.$store.commit('addCart', selectedList)
},
- onSettle() {
- console.log('onSettle')
+ onBuy() {
+ const selectedList = this.getSelectedList()
- // todo
+ this.$store.commit('createOrder', selectedList)
},
},
}
@@ -284,6 +287,14 @@
}
}
+.tips {
+ font-family: PingFang SC;
+ font-weight: 400;
+ font-size: 18rpx;
+ line-height: 1.4;
+ color: #989898;
+}
+
.card {
& + & {
margin-top: 32rpx;
diff --git a/pages_order/static/order/icon-wx.png b/pages_order/static/order/icon-wx.png
new file mode 100644
index 0000000..d354a51
Binary files /dev/null and b/pages_order/static/order/icon-wx.png differ
diff --git a/store/store.js b/store/store.js
index 84fef34..0f9dc2c 100644
--- a/store/store.js
+++ b/store/store.js
@@ -11,7 +11,9 @@ const store = new Vuex.Store({
configList: {}, //配置列表
shop : false,//身份判断如果不需要,可以删除
userInfo : {}, //用户信息
- payOrderProduct: [], //支付订单中的商品
+ payOrderProduct: [], //支付订单中的商品applyServiceProduct
+ applyServiceProduct: [], // 售后服务商品
+ addressInfo: null,
},
getters: {
// 角色 true为水洗店 false为酒店 : 身份判断如果不需要,可以删除
@@ -104,10 +106,32 @@ const store = new Vuex.Store({
}
})
},
+ addCart(state, data) {
+ // todo: fetch
+
+ console.log('addCart', data)
+
+ },
+ setAddressInfo(state, data) {
+ state.addressInfo = data
+ },
// 设置支付订单中的商品
setPayOrderProduct(state, data) {
state.payOrderProduct = data
},
+ createOrder(state, data) {
+
+ state.payOrderProduct = data
+
+ // todo: create order
+
+ uni.navigateTo({
+ url: '/pages_order/order/orderConfirm/index'
+ })
+ },
+ setApplyServiceProduct(state, data) {
+ state.applyServiceProduct = data
+ },
},
actions: {},
})