From 407f3b0a0f08198b1edef0d05c1a12b019975330 Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Mon, 3 Feb 2025 09:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jiuyi2/api/intergral.js | 13 ++ jiuyi2/api/shop.js | 36 +++++ jiuyi2/common/js/config.js | 4 +- jiuyi2/common/js/order.js | 12 ++ jiuyi2/common/js/util.js | 13 +- jiuyi2/components/index/indexVideo.vue | 11 +- jiuyi2/components/mine/payPwd.vue | 2 +- jiuyi2/pages.json | 7 + jiuyi2/pages/login/invite.vue | 202 +++++++++++++++++++++++++ jiuyi2/pages/shop/commodity/index.vue | 31 +++- jiuyi2/pages/shop/order/detail.vue | 2 +- jiuyi2/pages/shop/order/evaluate.vue | 180 ++++++++++++++++++---- jiuyi2/pages/shop/order/index.vue | 3 +- jiuyi2/vite.config.js | 4 +- 14 files changed, 473 insertions(+), 47 deletions(-) create mode 100644 jiuyi2/pages/login/invite.vue diff --git a/jiuyi2/api/intergral.js b/jiuyi2/api/intergral.js index 9401a231..b57b6c94 100644 --- a/jiuyi2/api/intergral.js +++ b/jiuyi2/api/intergral.js @@ -100,6 +100,19 @@ const intergral = { data: param.data, }) }, + + /** + * 获取二维码 + * @param {Object} param + */ + myQrcode(param) { + return util.request({ + url: `/user/team/getH5Link`, + method: 'GET', + data: param.data, + responseType: 'arraybuffer', + }) + }, } export default intergral \ No newline at end of file diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js index 3d554f3f..398aec08 100644 --- a/jiuyi2/api/shop.js +++ b/jiuyi2/api/shop.js @@ -383,6 +383,42 @@ const shop = { load: true, }) }, + + /** + * 获取订单评论规则 + * @param {Object} param + */ + getCommentRules(param) { + return util.request({ + url: `/shopify/commentrules/finfAll`, + data: param.data, + method: 'GET', + }) + }, + + /** + * 商品评论 + * @param {Object} param + */ + addProComment(param) { + return util.request({ + url: `/shopify/reviews/add`, + data: param.data, + method: 'POST', + }) + }, + + /** + * 分页查询商品评论列表 + * @param {Object} param + */ + getProComment(param) { + return util.request({ + url: `/shopify/reviews/findReviewByProductId`, + query: param.query, + method: 'GET', + }) + }, } export default shop \ No newline at end of file diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js index 82d899b9..30280631 100644 --- a/jiuyi2/common/js/config.js +++ b/jiuyi2/common/js/config.js @@ -5,8 +5,8 @@ const config = { host: 'http://localhost:5173', // #endif // #ifndef H5 - // host: 'http://91f.xyz:8080', - host: 'http://rud57d.natappfree.cc', + host: 'http://91f.xyz:8080', + // host: 'http://6jv6aq.natappfree.cc ', // #endif // 支付方式配置 payType: { diff --git a/jiuyi2/common/js/order.js b/jiuyi2/common/js/order.js index 8e0a3208..797d4584 100644 --- a/jiuyi2/common/js/order.js +++ b/jiuyi2/common/js/order.js @@ -116,6 +116,18 @@ const order = { }) }) }, + + /** + * 去评价 + * @param {Object} event 事件对象 + */ + orderComment(event) { + uni.navigateTo({ + url: util.setUrl('/pages/shop/order/evaluate', { + orderId: event.id, + }) + }) + }, } export default order \ No newline at end of file diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index 70828da2..8b12b781 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1503,19 +1503,18 @@ const util = { isLogin(cb) { // 验证 let userinfo = uni.$store.state.userinfo - // console.log('islogin userinfo', userinfo) return new Promise((resolve, reject) => { // 登录 if (!userinfo.id) { // util.alert('请先登录') // 失败 reject() - return + } else { + // 成功 + resolve() + // 回调 + cb ? cb() : '' } - // 成功 - resolve() - // 回调 - cb ? cb() : '' }) }, @@ -1528,7 +1527,7 @@ const util = { const userinfo = store.state.userinfo // 用户id - if (userinfo.userId) { + if (userinfo.id) { uni.$emit('logout') // 触发自定义事件监听 // tim登出 diff --git a/jiuyi2/components/index/indexVideo.vue b/jiuyi2/components/index/indexVideo.vue index 8ce3dba5..56ffcc09 100644 --- a/jiuyi2/components/index/indexVideo.vue +++ b/jiuyi2/components/index/indexVideo.vue @@ -71,7 +71,7 @@ }) // const emit = defineEmits(['showTime', 'showComment', 'showCollect', 'showFastCollect', 'showShareFirend', 'onPlay', - 'onPause', 'like', 'detailMenu', 'onEnd', 'longtap','dataCenter' + 'onPause', 'like', 'detailMenu', 'onEnd', 'longtap', 'dataCenter' ]) // 视频上下文对象 @@ -112,6 +112,7 @@ if (Math.abs(formatNumber(ratio2) - formatNumber(ratio1)) < 1) result = 'cover' return result }) + const userinfo = uni.$store.state.userinfo watch(() => props.current, (nV) => { if (nV == props.index) play() @@ -365,9 +366,9 @@ * 点赞 * @param {Number} index 操作的视频下标 * @param {Number|String} likeType 点赞类型 0.公开赞 1.隐私赞 - * @param {Number|String} isDelFlag 0.点赞 1.取消点赞 + * @param {Number|String} isLike 0.点赞 1.取消点赞 */ - function handleLike(index, likeType, isDelFlag) { + function handleLike(index, likeType, isLike) { util.isLogin().then(rs => { emit('like', { index, @@ -396,12 +397,12 @@ if (rs.confirm) emit('like', { index, likeType: 1, - isDelFlag: 0, + isLike: 0, }) else emit('like', { index, likeType: 2, - isDelFlag: 0, + isLike: 0, }) }) }).catch(() => { diff --git a/jiuyi2/components/mine/payPwd.vue b/jiuyi2/components/mine/payPwd.vue index 125d76a3..797e6738 100644 --- a/jiuyi2/components/mine/payPwd.vue +++ b/jiuyi2/components/mine/payPwd.vue @@ -115,7 +115,7 @@ - 取消 + 取消 验证 diff --git a/jiuyi2/pages.json b/jiuyi2/pages.json index 8fe847c6..b57568de 100644 --- a/jiuyi2/pages.json +++ b/jiuyi2/pages.json @@ -718,6 +718,13 @@ "navigationBarTitleText" : "继续付款", "navigationBarBackgroundColor": "#fff" } + }, + { + "path": "pages/login/invite", + "style": { + "navigationBarTitleText": "邀请", + "navigationStyle": "custom" + } } ], diff --git a/jiuyi2/pages/login/invite.vue b/jiuyi2/pages/login/invite.vue new file mode 100644 index 00000000..01172474 --- /dev/null +++ b/jiuyi2/pages/login/invite.vue @@ -0,0 +1,202 @@ + + + + + \ No newline at end of file diff --git a/jiuyi2/pages/shop/commodity/index.vue b/jiuyi2/pages/shop/commodity/index.vue index f07eece0..72e55944 100644 --- a/jiuyi2/pages/shop/commodity/index.vue +++ b/jiuyi2/pages/shop/commodity/index.vue @@ -35,6 +35,11 @@ const id = ref('') // 轮播图详情 const bannerIndex = ref(0) + // 商品评论 + const comment = reactive({ + list: [], + total: 0, + }) // 详情 const banner = computed(() => { let result = [] @@ -54,6 +59,8 @@ addBrowsing() // 开启监听 addListener() + // 获取商品评论 + getProComment() }) onReady(() => { @@ -84,6 +91,28 @@ uni.$off('commodityDetail') } + // 获取商品评论 + function getProComment() { + api.shop.getProComment({ + query: { + // 产品id + productionId: id.value, + pageNum: 1, + pageSize: 2, + } + }).then(rs => { + if (rs.code == 200) { + comment.list = rs.rows + comment.total = rs.total + return + } + util.alert({ + content: rs.msg, + showCancel: false, + }) + }) + } + // 添加商品浏览记录 function addBrowsing() { // 验证登录 @@ -330,7 +359,7 @@ - + 申请平台介入 申请退款 - 评价 + 评价