From cbc599a912a167632e4570a1c8cc2c92016072ec Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Fri, 6 Dec 2024 23:04:16 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/model/index.js | 12 +++++++++
api/model/info.js | 12 +++++++++
components/product/productItem.vue | 28 ++++++++++++++++++--
config.js | 2 +-
mixins/configList.js | 31 +++++++++++++++++++++-
mixins/order.js | 39 ++++++++++++++++++++++++++++
pages/index/center.vue | 3 ++-
pages/index/index.vue | 5 ++++
pages/index/order.vue | 23 ++++++++--------
pages_order/mine/promotion.vue | 14 +++++++---
pages_order/mine/recharge.vue | 26 ++++++++++++++++---
pages_order/mine/withdraw.vue | 47 +++++++++++++++++++++++----------
pages_order/order/createOrder.vue | 49 ++++++++++++++++++++++++++++-------
pages_order/order/orderDetail.vue | 2 +-
pages_order/product/productDetail.vue | 19 +++++++++++---
store/store.js | 10 +++++--
16 files changed, 266 insertions(+), 56 deletions(-)
create mode 100644 mixins/order.js
diff --git a/api/model/index.js b/api/model/index.js
index e6712ba..2feb348 100644
--- a/api/model/index.js
+++ b/api/model/index.js
@@ -78,12 +78,24 @@ const api = {
method: 'GET',
auth : true,
},
+ // 创建订单-再次支付
+ createOrderTwo: {
+ url: '/rice_index/createOrderTwo',
+ method: 'GET',
+ auth : true,
+ },
// 多商品创建订单
createSumOrder: {
url: '/rice_index/createSumOrder',
method: 'POST',
auth : true,
},
+ // 多商品订单再次支付
+ createSumOrderAgain: {
+ url: '/rice_index/createSumOrderAgain',
+ method: 'POST',
+ auth : true,
+ },
}
export default api
\ No newline at end of file
diff --git a/api/model/info.js b/api/model/info.js
index 64d48a4..8449c8c 100644
--- a/api/model/info.js
+++ b/api/model/info.js
@@ -2,6 +2,18 @@
// 个人相关接口
const api = {
+ // 充值
+ recharge: {
+ url: '/rice_info/recharge',
+ method: 'GET',
+ auth : true,
+ },
+ // 提现
+ withdraw: {
+ url: '/rice_info/withdraw',
+ method: 'GET',
+ auth : true,
+ },
// 获取地址列表带分页
getAddressPageList: {
url: '/rice_info/getAddressPageList',
diff --git a/components/product/productItem.vue b/components/product/productItem.vue
index 2c4d90e..ccaef1a 100644
--- a/components/product/productItem.vue
+++ b/components/product/productItem.vue
@@ -13,8 +13,24 @@
{{ item.sku }}
-
- ¥{{ item.price }}
+
+
+ 会员价¥{{ item.vipPrice }}
+
+
+ 零售价¥{{ item.price }}
+
+
+
+
+
+ 价格¥{{ item.price }}
+
+
+ 原价¥{{ item.oldPrice }}
+
@@ -84,6 +100,14 @@
font-size: 30rpx;
font-weight: 900;
}
+ &>view:nth-child(2){
+ font-size: 22rpx;
+ color: #777;
+ text{
+ font-size: 26rpx;
+ font-weight: 900;
+ }
+ }
}
}
}
diff --git a/config.js b/config.js
index 4938f33..35d1689 100644
--- a/config.js
+++ b/config.js
@@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
-const type = 'dev'
+const type = 'prod'
// 环境配置
diff --git a/mixins/configList.js b/mixins/configList.js
index 0fd9cc6..f621471 100644
--- a/mixins/configList.js
+++ b/mixins/configList.js
@@ -4,11 +4,40 @@ import { mapState } from 'vuex'
export default {
data() {
return {
+ // 默认的全局分享内容
+ Gshare: {
+ // title: '三只青蛙',
+ path: '/pages/index/index', // 全局分享的路径,比如 首页
+ // imageUrl: '/static/image/login/logo.png', // 全局分享的图片(可本地可网络)
+ }
}
},
computed: {
- ...mapState(['configList']),
+ ...mapState(['configList', 'userInfo']),
},
+ // 定义全局分享
+ // 1.发送给朋友
+ onShareAppMessage(res) {
+ let o = {
+ ...this.Gshare,
+ title : this.configList.logo_name,
+ }
+ if(this.userInfo.id){
+ o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
+ }
+ return o
+ },
+ //2.分享到朋友圈
+ onShareTimeline(res) {
+ let o = {
+ ...this.Gshare,
+ title : this.configList.logo_name,
+ }
+ if(this.userInfo.id){
+ o.path = this.Gshare.path + '?shareId=' + this.userInfo.id
+ }
+ return o
+ },
methods: {
}
}
\ No newline at end of file
diff --git a/mixins/order.js b/mixins/order.js
new file mode 100644
index 0000000..95f0400
--- /dev/null
+++ b/mixins/order.js
@@ -0,0 +1,39 @@
+
+
+export default {
+ data() {
+ return {
+ }
+ },
+ computed: {
+ },
+ methods: {
+ toPayOrder(item){
+ let api = ''
+
+ if([0, 1].includes(item.shopState)){
+ api = 'createOrderTwo'
+ }else{
+ api = 'createSumOrderAgain'
+ }
+
+ this.$api(api, {
+ orderId : item.id,
+ addressId : item.addressId
+ }, res => {
+ if(res.code == 200){
+ uni.requestPaymentWxPay(res)
+ .then(res => {
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ })
+ this.getData()
+ }).catch(n => {
+ this.getData()
+ })
+ }
+ })
+ },
+ }
+}
\ No newline at end of file
diff --git a/pages/index/center.vue b/pages/index/center.vue
index 9289254..415ea89 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -29,7 +29,8 @@
+ v-if="userInfo.isPay"
+ @click="$utils.navigateTo('/pages/index/member')">
会员等级:{{ vipType[userInfo.isPay] }}
查看权益>
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 846a547..b72c6a9 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -214,6 +214,11 @@
}
},
computed: {},
+ onLoad(query) {
+ if (query.shareId) {
+ uni.setStorageSync('shareId', query.shareId)
+ }
+ },
onShow() {
this.getBanner()
this.getRiceNoticeList()
diff --git a/pages/index/order.vue b/pages/index/order.vue
index 7a5a492..f286bf0 100644
--- a/pages/index/order.vue
+++ b/pages/index/order.vue
@@ -13,6 +13,7 @@
lineHeight="8rpx"
lineWidth="50rpx"
:current="current"
+ :scrollable="false"
@click="clickTabs">
@@ -36,7 +37,8 @@
v-for="(good, index) in item.commonOrderSkuList">
-
+
@@ -71,11 +73,11 @@
立即付款
-
立即评价
-
+ -->
@@ -87,8 +89,9 @@
diff --git a/pages_order/mine/promotion.vue b/pages_order/mine/promotion.vue
index 8e7613d..53cf18a 100644
--- a/pages_order/mine/promotion.vue
+++ b/pages_order/mine/promotion.vue
@@ -2,7 +2,10 @@
-
+
@@ -194,6 +197,9 @@