合并代码

This commit is contained in:
sx 2025-02-03 09:05:19 +08:00
parent 6e948972e8
commit 407f3b0a0f
14 changed files with 473 additions and 47 deletions

View File

@ -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

View File

@ -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

View File

@ -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: {

View File

@ -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

View File

@ -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登出

View File

@ -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(() => {

View File

@ -115,7 +115,7 @@
</view>
<view class="btns mtb30 rows">
<view class="btn lg cancel plr40 f1" @click="$refs.pwd.close()">取消</view>
<view class="btn lg cancel plr40 f1" @click="$refs.pwdRef.close()">取消</view>
<view class="btn lg black plr40 f1" @click="handleConfirm">验证</view>
</view>
</view>

View File

@ -718,6 +718,13 @@
"navigationBarTitleText" : "继续付款",
"navigationBarBackgroundColor": "#fff"
}
},
{
"path": "pages/login/invite",
"style": {
"navigationBarTitleText": "邀请",
"navigationStyle": "custom"
}
}
],

View File

@ -0,0 +1,202 @@
<script setup>
/**
* 注册账号
*/
import {
ref,
reactive,
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
//
import getCode from '@/components/getCode/getCode.vue'
//
import notice from '@/components/login/notice'
// api
import api from '@/api/index'
//
import util from '@/common/js/util.js'
//
import CryptoJS from 'crypto-js';
//
const showPwd = ref(false)
//
const form = reactive({
//
phoneNumber: '',
//
password: '',
//
invitationCode: '',
//
verifyCode: '',
})
//
const cache = ref('')
//
const read = ref(false)
onLoad((option) => {
//
if (option.code) form.invitationCode = option.code
})
//
function handleLogin() {
const data = {
...form
}
//
if (!data.phoneNumber) {
util.alert('请输入手机号')
return
}
if (!data.verifyCode) {
util.alert('请输入验证码')
return
}
if (!data.password) {
util.alert('请输入密码')
return
}
if (!data.invitationCode) {
util.alert('请输入推荐码')
return
}
if (!read.value) {
util.alert('请阅读并勾选服务协议》和《隐私政策》')
return
}
data.password = CryptoJS.MD5(data.password).toString();
// imei
if (!data.userImei) {
const info = uni.getSystemInfoSync()
//
data.userImei = info.deviceId
}
//
api.login.userRegister({
data: data,
path: [cache.value],
}).then(rs => {
if (rs.code == 200) {
util.alert('注册成功')
setTimeout(() => {
downloadApp()
}, 1000)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
// app
function downloadApp() {
//
const menu = [{
name: '安卓下载链接1',
key: 'FIR',
url: 'https://fir.xcxwo.com/8tn4qjxd'
},
{
name: '安卓下载链接2',
key: '蒲公英',
url: 'https://www.pgyer.com/u24vT3b2',
}
]
//
uni.showActionSheet({
itemList: menu.map(node => {
return node.name
}),
success: rs => {
//
location.href = menu[rs.tapIndex].url
}
})
}
</script>
<template>
<view class="appbw">
<view class="container">
<view class="logo mauto">
<image class="logo" src="/static/Jiu Yi.png" mode="aspectFit" />
</view>
<view class="form mt60 mlr60 mb30">
<view class="title mtb30">新用户注册</view>
<view class="inputBox mtb30 ptb10 plr30">
<input type="text" v-model="form.phoneNumber" placeholder="请输入手机号" />
</view>
<view class="rows mtb30">
<view class="inputBox f1 ptb10 plr30">
<input type="text" v-model="form.verifyCode" placeholder="请输入验证码" class="f1" />
</view>
<view class="getCode btn sm ml20 plr20">
<getCode :phone="form.phoneNumber" />
</view>
</view>
<view class="inputBox rows mtb20 ptb10 plr30">
<template v-if="showPwd">
<input v-model="form.password" placeholder="请输入密码" />
</template>
<template v-else>
<input :password="true" v-model="form.password" placeholder="请输入密码" />
</template>
<uni-icons :type="showPwd ? 'eye' : 'eye-slash'" color="#999" size="40rpx"
@click="showPwd = !showPwd" />
</view>
<view class="rows mtb30">
<view class="inputBox f1 ptb10 plr30">
<input type="text" v-model="form.invitationCode" placeholder="请输入推荐码" />
</view>
<view class="f1"></view>
</view>
<view class="">
<view class="btn lg bar black mtb30" @click="handleLogin">注册</view>
</view>
<view>
<view class="btn lg bar colourful mt30" @click="downloadApp">下载app</view>
</view>
</view>
</view>
<view class="footer">
<notice class="mb60" v-model:value="read" />
</view>
</view>
</template>
<style lang="scss">
//
.container {
margin-top: 15vh;
//
.logo {
width: 152rpx;
height: 80rpx;
}
}
//
.getCode {
color: #666;
background-color: #fff;
}
</style>

View File

@ -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 @@
<!-- 部分评论 -->
<view class="list">
<view class="item ptb20" v-for="(item, index) in 2" :key="index">
<view class="item ptb20" v-for="(item, index) in comment" :key="index">
<view class="userinfo df c666 f28">
<image class="avatar wh45 cir"
src="https://img30.360buyimg.com/popWareDetail/jfs/t1/124291/22/31317/138753/6449f30dF90683c84/4fee5d1a337f7b90.jpg.avif"

View File

@ -267,7 +267,7 @@
<view class="btn bar closeHollow plr30" v-if="detail.afterSaleStatus === 1">
申请平台介入</view>
<view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(detail)">申请退款</view>
<view class="btn bar warmHollow plr30">评价</view>
<view class="btn bar warmHollow plr30" @click.stop="order.orderComment(detail)">评价</view>
</template>
<!-- 已完成 -->
<template v-else-if="detail.status == 6">

View File

@ -1,66 +1,187 @@
<script setup>
//
import {
ref,
watch,
reactive
reactive,
getCurrentInstance
} from 'vue';
import {
onLoad,
onUnload,
onReachBottom,
onPullDownRefresh,
onPageScroll
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js';
//
import payPwd from '@/components/mine/payPwd.vue';
//
const rateValue = reactive(['', '非常差', '差', '一般', '好', '非常好'])
//
//
const form = reactive({
rate1: 0,
rate2: 0,
rate3: 0,
orderId: '',
productId: '',
imageUrls: [],
rating: 0,
// rate2: 0,
// rate3: 0,
})
//
const ruleList = reactive([])
//
const {
proxy
} = getCurrentInstance()
onLoad((option) => {
if (option.orderId) form.orderId = option.orderId
//
getCommentRules()
})
watch(form, (ev) => {
console.log('form', ev)
}, {
deep: true,
})
//
function getCommentRules() {
api.shop.getCommentRules({}).then(res => {
if (res.code == 200) {
ruleList.length = 0
ruleList.push(...res.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function uploadImg() {
util.upload_image({
type: 2,
success: rs => {
form.imageUrls.push(rs.value)
},
})
}
//
function removeMedia(index, key) {
util.alert({
content: '确认删除?',
}).then(rs => {
if (rs.confirm) form.imageUrls.splice(index, 1)
})
}
//
function showPayPwd() {
console.log('handleSubmit data', form)
//
if (!form.content) {
util.alert('商品评论不能为空')
return
}
proxy.$refs.payPwdRef.open()
}
/**
* 二级密码点击确认
* @param {Object} secondPassword 二级密码
*/
function handleSubmit(secondPassword) {
const data = {
...form
}
//
data.imageUrls = data.imageUrls.join(',')
//
data.secondPassword = secondPassword
//
api.shop.addProComment({
data,
}).then(rs => {
if (rs.code == 200) {
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
<view class="app">
<view class="container oh ptb30 imgList df fww">
<view class="imgs upload wh140">
<view class="imgs wh140" v-for="(item,index) in form.imageUrls" :key="index">
<image class="wh140" :src="item" mode="aspectFill" />
<view class="close" @click="removeMedia(index)">
<uni-icons type="clear" size="50rpx" color="#f00" />
</view>
</view>
<view class="imgs upload wh140" @click="uploadImg">
<image class="wh140" src="/static/shop-upload-image.png" mode="aspectFill" />
</view>
</view>
<view class="message container">
<textarea class="txtplus mtb20 plr20" placeholder="展开说说对商品的想法吧" placeholder-class="placeholderStyle" />
<textarea class="txtplus mtb20 plr20" v-model="form.content" placeholder="展开说说对商品的想法吧"
placeholder-class="placeholderStyle" />
</view>
<view class="stars container">
<view class="item df aic mtb20">
<view class="key w200">描述相符</view>
<view class="key w200">商品评价</view>
<view class="value mlr20">
<uni-rate v-model="form.rate1" :max="5" color="#d8d8d8" activeColor="#FF9B27" />
<uni-rate v-model="form.rating" :max="5" color="#d8d8d8" activeColor="#FF9B27" />
</view>
<view class="c999 f28">{{rateValue[form.rate1]}}</view>
<view class="c999 f28">{{rateValue[form.rating]}}</view>
</view>
<view class="item df aic mtb20">
<view class="key w200">物流服务</view>
<view class="value mlr20">
<uni-rate v-model="form.rate2" color="#d8d8d8" activeColor="#FF9B27" />
<template v-if="0">
<view class="item df aic mtb20">
<view class="key w200">物流服务</view>
<view class="value mlr20">
<uni-rate v-model="form.rate2" color="#d8d8d8" activeColor="#FF9B27" />
</view>
<view class="c999 f28">{{rateValue[form.rate2]}}</view>
</view>
<view class="c999 f28">{{rateValue[form.rate2]}}</view>
<view class="item df aic mtb20">
<view class="key w200">服务态度</view>
<view class="value mlr20">
<uni-rate v-model="form.rate3" color="#d8d8d8" activeColor="#FF9B27" />
</view>
<view class="c999 f28">{{rateValue[form.rate3]}}</view>
</view>
</template>
</view>
<!-- 评论消耗榴莲果规则 -->
<view class="rule mtb30 mlr30">
<view class="header df aic f28">
<image class="wh30 mr10" src="/static/fruit.png" mode="aspectFit" />
<view>评论商品消耗榴莲果规则</view>
</view>
<view class="item df aic mtb20">
<view class="key w200">服务态度</view>
<view class="value mlr20">
<uni-rate v-model="form.rate3" color="#d8d8d8" activeColor="#FF9B27" />
</view>
<view class="c999 f28">{{rateValue[form.rate3]}}</view>
<view class="list mt20 c666 f24">
<view class="item mtb10" v-for="(item,index) in ruleList" :key="index">{{item.description}}</view>
</view>
</view>
<payPwd ref="payPwdRef" :check="true" @confirm='handleSubmit' />
<view class="fill" style="height: 120rpx;"></view>
<view class="footer plr30 bfff shadow">
<view class="btn lg primary">发布评论</view>
<view class="btn lg primary" @click="showPayPwd">发布评论</view>
</view>
</view>
</template>
@ -77,4 +198,9 @@
background-color: #fff;
border-radius: 15rpx;
}
//
.txtplus {
width: 100%;
}
</style>

View File

@ -317,7 +317,8 @@
申请平台介入</view>
<view class="btn bar closeHollow plr30"
@click.stop="order.orderAfterSales(scope.item)">申请退款</view>
<view class="btn bar warmHollow plr30">评价</view>
<view class="btn bar warmHollow plr30"
@click.stop="order.orderComment(scope.item)">评价</view>
</template>
<!-- 已完成 -->
<template v-else-if="scope.item.status == 6">

View File

@ -4,8 +4,8 @@ import {
import uni from '@dcloudio/vite-plugin-uni';
//
// let target = 'http://91f.xyz:8080'
let target = 'http://rud57d.natappfree.cc'
let target = 'http://91f.xyz:8080'
// let target = 'http://6jv6aq.natappfree.cc '
export default defineConfig({
plugins: [uni()],