diff --git a/common/platform/AppPlatform.js b/common/platform/AppPlatform.js
index 966c3e7..ebc1ac5 100644
--- a/common/platform/AppPlatform.js
+++ b/common/platform/AppPlatform.js
@@ -8,5 +8,20 @@ class AppPlatform extends BasePlatform {
this.code = 'APP_ANDROID';
this.env = 'app';
}
+ async pay(data, event) {
+ console.log('pay', data, event);
+ return new Promise((resolve, reject) => {
+ uni.requestPayment({
+ provider: 'alipay',
+ orderInfo: data,
+ success: (res) => {
+ resolve({ isPay: true });
+ },
+ fail: (err) => {
+ resolve({ isPay: false });
+ }
+ });
+ });
+ }
}
export default AppPlatform;
\ No newline at end of file
diff --git a/common/platform/BasePlatform.js b/common/platform/BasePlatform.js
index cf29e5d..0f50cb5 100644
--- a/common/platform/BasePlatform.js
+++ b/common/platform/BasePlatform.js
@@ -50,9 +50,7 @@ class BasePlatform {
* @param {number} amount - 支付金额(分)
* @param {string} orderId - 订单号
*/
- pay({
- data
- }, event) {
+ async pay(data, event) {
throw new Error('子类必须实现 pay 方法');
}
diff --git a/common/server/order.js b/common/server/order.js
new file mode 100644
index 0000000..abc7db6
--- /dev/null
+++ b/common/server/order.js
@@ -0,0 +1,184 @@
+import HttpRequest from "../system/request";
+
+/**
+ * 立即购买
+ * @param {Number} product_id 商品id
+ * @returns {Promise} 立即购买
+ */
+export const pay_by_order = async (product_id) => {
+ const res = await HttpRequest.post('pay_by_order', {
+ product_id: product_id
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ uni.showToast({
+ title: res.msg,
+ icon: 'none'
+ });
+ return null;
+}
+
+/**
+ * 创建订单
+ * @param {Number} product_id 商品id
+ * @param {Number} address_id 地址id
+ * @param {Number} coupon_id 优惠券id
+ * @returns {Promise} 创建订单
+ */
+export const pay_by_create_order = async (product_id, address_id, coupon_id) => {
+ const res = await HttpRequest.post('pay_by_create_order', {
+ product_id: product_id,
+ address_id: address_id,
+ coupon_id: coupon_id
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 支付成功
+ * @param {String} order_no 订单号
+ * @returns {Promise} 支付成功
+ */
+export const pay_by_pay = async (order_no) => {
+ const res = await HttpRequest.post('order_pay_success', {
+ order_no: order_no
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 获取订单列表
+ * @param {Number} status 订单状态
+ * @param {Number} page 页码
+ * @param {Number} page_size 每页条数
+ * @param {String} title 商品标题搜索关键词
+ * @returns {Promise} 获取订单列表
+ */
+export const get_order_list = async (status, page, page_size, title = "") => {
+ // 接收参数
+ const res = await HttpRequest.post('get_order_list', {
+ status: status,
+ keyword: title,
+ page: page,
+ limit: page_size
+ });
+ return res.data;
+}
+/**
+ * 订单收货
+ * @param {String} order_no 订单号
+ * @returns {Promise} 订单收货结果
+ */
+export const order_receive = async (order_no) => {
+ const res = await HttpRequest.post('order_receive', {
+ order_no: order_no
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 申请售后
+ * @param {String} order_no 订单号
+ * @param {String} extend_info 扩展信息
+ * @returns {Promise} 申请售后结果
+ */
+export const apply_refund = async (order_no, extend_info = "") => {
+ const res = await HttpRequest.post('apply_refund', {
+ order_no: order_no,
+ extend_info: extend_info
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 取消售后
+ * @param {String} order_no 订单号
+ * @returns {Promise} 取消售后结果
+ */
+export const cancel_refund = async (order_no) => {
+ const res = await HttpRequest.post('cancel_refund', {
+ order_no: order_no
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 删除订单
+ * @param {String} order_no 订单号
+ * @returns {Promise} 删除订单结果
+ */
+export const delete_order = async (order_no) => {
+ const res = await HttpRequest.post('delete_order', {
+ order_no: order_no
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 获取订单详情
+ * @param {String} order_no 订单号
+ * @returns {Promise} 获取订单详情
+ */
+export const get_order_detail = async (order_no) => {
+ const res = await HttpRequest.post('get_order_detail', {
+ order_no: order_no
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
+
+/**
+ * 申请发票
+ * @param {String} order_no 订单号
+ * @param {String} invoice_title 发票抬头
+ * @param {String} invoice_content 发票内容
+ * @param {Number} invoice_type 发票类型
+ * @param {String} user_email 用户邮箱
+ * @returns {Promise} 申请发票结果
+ */
+export const apply_invoice = async (order_no, invoice_title, invoice_content, invoice_type, user_email) => {
+ const res = await HttpRequest.post('apply_invoice', {
+ order_no: order_no,
+ invoice_title: invoice_title,
+ invoice_content: invoice_content,
+ invoice_type: invoice_type,
+ user_email: user_email
+ });
+ if (res.status == 1) {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * 获取订单统计
+ * @returns {Promise} 获取订单统计
+ */
+export const get_order_statistics = async () => {
+ const res = await HttpRequest.post('get_order_statistics');
+ if (res.status == 1) {
+ return res.data;
+ }
+ return null;
+}
\ No newline at end of file
diff --git a/common/server/other.js b/common/server/other.js
index 6af944e..4e93bb7 100644
--- a/common/server/other.js
+++ b/common/server/other.js
@@ -22,6 +22,8 @@ export const getAgreement = async (type) => {
type_id = 4;
} else if (type == "privacy") {
type_id = 5;
+ } else if (type == "product") {
+ type_id = 32;
}
const res = await HttpRequest.get('/getAgreement', {
type: type_id
diff --git a/common/server/product.js b/common/server/product.js
index 2ef5568..e9fb129 100644
--- a/common/server/product.js
+++ b/common/server/product.js
@@ -43,3 +43,72 @@ export const getProductDetail = async (id) => {
}
return null;
}
+
+
+/**
+ * 获取用户收藏商品列表
+ * @param {Number} page 页码
+ * @param {Number} limit 每页条数
+ * @returns {Promise} 收藏商品列表
+ */
+export const getFavoriteList = async (page = 1, limit = 10) => {
+ const res = await HttpRequest.get('/get_favorite_list', {
+ page: page,
+ limit: limit
+ });
+ if (res.status == 1) {
+ return res.data;
+ }
+ return [];
+}
+
+/**
+ * 添加商品收藏
+ * @param {Number} product_id 商品ID
+ * @returns {Promise} 收藏结果
+ */
+export const addFavorite = async (product_id) => {
+ const res = await HttpRequest.post('/add_favorite', {
+ product_id: product_id
+ });
+ return res.status == 1;
+}
+
+/**
+ * 取消商品收藏
+ * @param {Number} product_id 商品ID
+ * @returns {Promise} 取消收藏结果
+ */
+export const cancelFavorite = async (product_id) => {
+ const res = await HttpRequest.post('/cancel_favorite', {
+ product_id: product_id
+ });
+ return res.status == 1;
+}
+
+/**
+ * 批量取消商品收藏
+ * @param {Array} product_ids 商品ID数组
+ * @returns {Promise} 批量取消收藏结果
+ */
+export const batchCancelFavorite = async (product_ids) => {
+ const res = await HttpRequest.post('/batch_cancel_favorite', {
+ product_ids: product_ids
+ });
+ return res.status == 1;
+}
+
+/**
+ * 检查商品是否已收藏
+ * @param {Number} product_id 商品ID
+ * @returns {Promise} 是否已收藏
+ */
+export const checkIsFavorite = async (product_id) => {
+ const res = await HttpRequest.get('/check_is_favorite', {
+ product_id: product_id
+ });
+ if (res.status == 1) {
+ return res.data.is_favorite;
+ }
+ return false;
+}
\ No newline at end of file
diff --git a/components.d.ts b/components.d.ts
index 17fb582..52dde71 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -14,9 +14,11 @@ declare module 'vue' {
OrderListItem: typeof import('./components/youdas-container/order-list-item.vue')['default']
PageBaseContainer: typeof import('./components/youdas-container/page-base-container.vue')['default']
PageContainer: typeof import('./components/youdas-container/page-container.vue')['default']
+ PageKefu: typeof import('./components/youdas-container/page-kefu.vue')['default']
PageLine: typeof import('./components/youdas-container/page-line.vue')['default']
PageNoContainer: typeof import('./components/youdas-container/page-no-container.vue')['default']
PagePopup: typeof import('./components/youdas-container/page-popup.vue')['default']
+ PaymentPopup: typeof import('./components/youdas-container/payment-popup.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
TextSearch: typeof import('./components/youdas-container/text-search.vue')['default']
diff --git a/components/youdas-container/order-list-item.vue b/components/youdas-container/order-list-item.vue
index d030b46..da92610 100644
--- a/components/youdas-container/order-list-item.vue
+++ b/components/youdas-container/order-list-item.vue
@@ -4,11 +4,55 @@
+
+
+
-
- {{ item.title }}
- {{ item.detail }}
-
+
+
+
+
+
+ {{ item.product_title }}
+ ¥{{ item.payment_amount }}
+
+
+
@@ -18,12 +62,128 @@
+
+
+
+
+
+
-
diff --git a/components/youdas-container/page-kefu.vue b/components/youdas-container/page-kefu.vue
new file mode 100644
index 0000000..9a4b061
--- /dev/null
+++ b/components/youdas-container/page-kefu.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/youdas-container/payment-popup.vue b/components/youdas-container/payment-popup.vue
new file mode 100644
index 0000000..7a2cd5e
--- /dev/null
+++ b/components/youdas-container/payment-popup.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+ 确认订单
+
+
+
+
+
+
+ {{
+ product.title }}
+ 类型:实物
+
+ ¥
+ {{
+ product.price }}
+
+ x1
+
+
+
+ 收货地址
+ {{ address.receiver_name || '未设置'
+ }}
+
+
+
+
+ 优惠券
+ 未选择
+
+
+
+
+ 售前·售后须知
+
+
+
+
+
+ 我已满18岁,阅读并同意
+ 《用户协议》
+ 《隐私政策》
+
+
+
+
+ 确认支付
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 473c9d6..16cde0d 100644
--- a/pages.json
+++ b/pages.json
@@ -95,14 +95,33 @@
}
},
{
- "path" : "pages/mall/receiving-address",
- "style" :
- {
+ "path": "pages/mall/receiving-address",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/other/choose-coupon",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/mall/order-detail",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/other/user-agreement",
+ "style": {
"navigationStyle": "custom"
}
}
-
],
+ "usingComponents": {
+ "web-view": "pages/other/user-agreement"
+ },
// "globalStyle": {
// "navigationBarTextStyle": "black",
// "navigationBarTitleText": "uni-app",
diff --git a/pages/address/address-list.vue b/pages/address/address-list.vue
index 0043d98..b0f56e8 100644
--- a/pages/address/address-list.vue
+++ b/pages/address/address-list.vue
@@ -1,8 +1,16 @@
-
+
+
+
-
+
+
+
+
+
+
+
{{ item.receiver_name }}
{{ item.receiver_phone }}
@@ -12,32 +20,39 @@
{{ item.detailed_address }}
-
+
-
+
-
- 暂无收货地址
+
+ +
+ 新增地址
-
+
新增地址
+
+ 确定
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/pages/mall/mall.vue b/pages/mall/mall.vue
index d773130..e3fa1d3 100644
--- a/pages/mall/mall.vue
+++ b/pages/mall/mall.vue
@@ -13,7 +13,7 @@
-
+
diff --git a/pages/mall/order-detail.vue b/pages/mall/order-detail.vue
new file mode 100644
index 0000000..3944c0b
--- /dev/null
+++ b/pages/mall/order-detail.vue
@@ -0,0 +1,323 @@
+
+
+
+
+
+ {{ orderDetail.order_status_text }}
+
+
+
+
+ 商品信息
+
+
+
+ {{ orderDetail.product_title }}
+ ¥{{ orderDetail.product_price }}
+
+
+
+
+
+
+ 订单信息
+
+ 订单编号
+ {{ orderDetail.order_no }}
+
+
+ 创建时间
+ {{ orderDetail.create_time }}
+
+
+ 支付方式
+ {{ orderDetail.payment_type === 1 ? '微信支付' : '其他' }}
+
+
+ 支付时间
+ {{ orderDetail.payment_time || '未支付' }}
+
+
+
+
+
+ 配送信息
+
+ 快递公司
+ {{ orderDetail.shipping_company }}
+
+
+ 快递单号
+ {{ orderDetail.shipping_no }}
+
+
+ 发货时间
+ {{ orderDetail.shipping_time || '未发货' }}
+
+
+ 收货时间
+ {{ orderDetail.receive_time || '未收货' }}
+
+
+
+
+
+ 收货人信息
+
+ 收货人
+ {{ orderDetail.receiver_name }}
+
+
+ 联系电话
+ {{ orderDetail.receiver_phone }}
+
+
+ 收货地址
+ {{ orderDetail.receiver_address }}
+
+
+
+
+
+ 发票信息
+
+ 发票抬头
+ {{ orderDetail.invoice_title }}
+
+
+ 发票内容
+ {{ orderDetail.invoice_content }}
+
+
+ 发票类型
+ {{ orderDetail.invoice_type_text }}
+
+
+
+
+
+
+ 商品金额
+ ¥{{ orderDetail.product_price }}
+
+
+ 运费
+ ¥{{ orderDetail.shipping_fee }}
+
+
+ 优惠金额
+ -¥{{ orderDetail.discount_amount }}
+
+
+ 实付款
+ ¥{{ orderDetail.payment_amount }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/order-list.vue b/pages/mall/order-list.vue
index 90571da..9f9fe8e 100644
--- a/pages/mall/order-list.vue
+++ b/pages/mall/order-list.vue
@@ -24,11 +24,12 @@
diff --git a/pages/mall/product-detail.vue b/pages/mall/product-detail.vue
index b27ac08..f22d00c 100644
--- a/pages/mall/product-detail.vue
+++ b/pages/mall/product-detail.vue
@@ -5,12 +5,16 @@
+
+
+
@@ -39,6 +43,8 @@
+
+
-
-
-
-
-
-
-
- 确认订单
-
-
-
-
-
-
-
-
- {{ productDetail.title }}
-
- 类型:明信片
-
-
- ¥
- {{ productDetail.price }}
-
-
- x1
-
-
-
-
-
- 地址管理
-
-
-
-
-
-
-
- 优惠券
-
- 未选择
-
-
-
-
-
-
-
- 售前·售后须知
-
-
-
-
-
-
-
-
-
-
- 我已满18岁,阅读并同意
- 《用户协议》
- 《隐私政策》
-
-
-
-
-
- 确认支付
-
-
-
-
-
-
-
+
+
-
-
-
@@ -255,7 +185,7 @@ const toAddress = () => {
//设置图片样式
::v-deep rich-text img {
max-width: 95% !important;
- border-radius: 10rpx;
+ // border-radius: 10rpx;
height: auto !important;
display: block !important;
margin: 0 auto;
diff --git a/pages/mall/receiving-address.vue b/pages/mall/receiving-address.vue
index e5a73b8..15e5677 100644
--- a/pages/mall/receiving-address.vue
+++ b/pages/mall/receiving-address.vue
@@ -16,20 +16,20 @@
-
- {{item.name}}
+ {{ item.name }}
- {{item.phoneNum}}
+ {{ item.phoneNum }}
- {{item.address}}
+ {{
+ item.address }}
-
+
- 新增收货地址
+ style="width: 30%; height: 83.97rpx; background-color: #333333; border-radius: 15.27rpx; display: flex; align-items: center; justify-content: center;">
+ 新增地址
+
+
+ 确定收货地址
-
\ No newline at end of file
diff --git a/pages/me/me.vue b/pages/me/me.vue
index 897ca70..3b8294d 100644
--- a/pages/me/me.vue
+++ b/pages/me/me.vue
@@ -6,37 +6,49 @@
-
+
- {{ userInfo.username }}
- 已陪你走过了{{ userInfo.days }}天
-
-
-
+
+ {{ userInfo.username }}
+ 已陪你走过了{{ userInfo.days }}天
+
+
+
+
+
+
+
+
+
+
+ 点击登录
+ 登录后体验更多功能
+
+
+
- 点击登录
-
-
- 0
+
+ {{ orderStatistics.waiting_ship_count }}
待发货
-
- 0
+
+ {{ orderStatistics.waiting_receive_count }}
待收货
-
- 0
- 待评价
+
+ {{ orderStatistics.received_count }}
+ 已收货
-
- 0
- 退款售后
+
+ {{ orderStatistics.after_sales_count }}
+ 申请售后
@@ -50,18 +62,26 @@
+
+
+
\ No newline at end of file
diff --git a/pages/other/user-agreement.vue b/pages/other/user-agreement.vue
new file mode 100644
index 0000000..532b672
--- /dev/null
+++ b/pages/other/user-agreement.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/app-plus/user/sc1.png b/static/app-plus/user/sc1.png
new file mode 100644
index 0000000..bc9fad0
Binary files /dev/null and b/static/app-plus/user/sc1.png differ
diff --git a/static/app-plus/user/sc2.png b/static/app-plus/user/sc2.png
new file mode 100644
index 0000000..c0920a1
Binary files /dev/null and b/static/app-plus/user/sc2.png differ