2025.2.11 工作代码提交

This commit is contained in:
sx 2025-02-12 09:05:14 +08:00
parent 28843fa3d3
commit b56aae7b27
17 changed files with 413 additions and 302 deletions

View File

@ -207,6 +207,16 @@ export const news = {
method: 'POST' method: 'POST'
}) })
}, },
// 群聊发消息
getMessageList(param) {
return util.request({
url: `/user/chat/getMessageList`,
query: param.query,
data: param.data,
method: 'GET'
})
},
} }
export default news export default news

View File

@ -422,6 +422,19 @@ const shop = {
url: `/shopify/reviews/findReviewByProductId`, url: `/shopify/reviews/findReviewByProductId`,
query: param.query, query: param.query,
method: 'GET', method: 'GET',
load: true,
})
},
/**
* 分页查询商品评论列表
* @param {Object} param
*/
recentOrder(param) {
return util.request({
url: `/shopify/appOrder/recentOrder`,
query: param.query,
method: 'GET',
}) })
}, },
} }

View File

@ -7,8 +7,9 @@ const config = {
// #endif // #endif
// #ifndef H5 // #ifndef H5
host: 'http://91f.xyz:8080', host: 'http://91f.xyz:8080',
// host: 'http://22vn9z.natappfree.cc', // host: 'http://6t42vi.natappfree.cc',
// host: 'https://63fdb472.r24.cpolar.top', // host: 'http://nrpnpc.natappfree.cc',
// host: 'http://6aa4a4c3.r24.cpolar.top',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {

View File

@ -209,13 +209,14 @@
// //
function removelistener() { function removelistener() {
uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED); uni.$chat.off(TencentCloudChat.EVENT.FRIEND_LIST_UPDATED, () => {});
} }
// //
function getFriendList() { function getFriendList() {
// sdk // sdk
let isReady = uni.$chat.isReady(); let isReady = uni.$chat.isReady();
console.log('getFriendList', isReady)
if (!isReady) { if (!isReady) {
setTimeout(function() { setTimeout(function() {
@ -223,6 +224,7 @@
}, 500); }, 500);
return return
} }
console.log('getFriendList')
// //
api.news.getFriendList().then(rs => { api.news.getFriendList().then(rs => {

View File

@ -81,10 +81,19 @@
// //
function getList() { function getList() {
uni.$chat.getConversationList().then(rs => { api.news.getMessageList({
// console.log('getConversation', rs) query: {
list.length = 0 userId: userinfo.value.id,
list.push(...rs.data.conversationList) }
}).then(rs => {
if (rs.code == 200) {
//
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}) })
} }
@ -202,7 +211,8 @@
</view> </view>
</view> </view>
</uni-swipe-action-item> --> </uni-swipe-action-item> -->
<uni-swipe-action-item :right-options="rightOption" v-for="(item, index) in list" :key="index" @click="handleMenu($event,item)"> <uni-swipe-action-item :right-options="rightOption" v-for="(item, index) in list" :key="index"
@click="handleMenu($event,item)">
<view class="item rows ptb20 plr30" @click="handleChat(item)"> <view class="item rows ptb20 plr30" @click="handleChat(item)">
<view class="image wh90 pr"> <view class="image wh90 pr">
<template v-if="item.type == 'GROUP'"> <template v-if="item.type == 'GROUP'">
@ -224,7 +234,8 @@
<text>{{item.userProfile.nick}}</text> <text>{{item.userProfile.nick}}</text>
</template> </template>
</view> </view>
<view class="datetime c999 f22">{{ util.formatTime('MM-dd HH:mm',item.lastMessage.lastTime) }}</view> <view class="datetime c999 f22">
{{ util.formatTime('MM-dd HH:mm',item.lastMessage.lastTime) }}</view>
</view> </view>
<view class="desc thd mt10 c666 f24">{{item.lastMessage.messageForShow}}</view> <view class="desc thd mt10 c666 f24">{{item.lastMessage.messageForShow}}</view>
</view> </view>

View File

@ -1,180 +1,171 @@
<template> <template>
<view class="tab"> <view class="tab">
<scroll-view class="scroll" scroll-x scroll-with-animation :show-scrollbar="false" :scroll-left="scrollLeft"> <scroll-view class="scroll" scroll-x scroll-with-animation :show-scrollbar="false" :scroll-left="scrollLeft">
<view class="list" :class="scroll ? '' : 'flex-row-left'" id="tab"> <view class="list" :class="scroll ? '' : 'flex-row-left'" id="tab">
<view class="item fmid ptb10 plr20" :class="{'active': index === currentIndex}" :id="'tab-item-' + index" <view class="item fmid ptb10 plr20" :class="{'active': index === currentIndex}" :id="'tab-item-' + index"
v-for="(item, index) in list" :key="index" @click="clickTab(item, index)"> v-for="(item, index) in list" :key="index" @click="handleTabClick(item, index)">
{{ item[titalName] }} {{ item[titalName] }}
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
list: { list: {
type: Array, type: Array,
default: () => { default: () => []
return [] },
} titalName: {
}, type: String,
titalName: { default: 'name'
type: String, },
default: 'name' //
}, scroll: {
// type: Boolean,
scroll: { default: true
type: Boolean, },
default: true // prop
}, modelValue: {
}, type: [Number,String],
data() { default: 0
return { }
scrollLeft: 0, },
componentWidth: 0, // tabspx computed: {
parentLeft: 0, // (tabs) currentIndex: {
scrollBarLeft: 0, // bartranslateX() get() {
tabItemRectInfo: [], return this.modelValue;
currentIndex: 0, },
barFirstTimeMove: true set(newValue) {
} this.$emit('update:modelValue', newValue);
}, }
watch: { }
list(n, o) { },
// list data() {
if (n.length !== o.length) this.currentIndex = 0; return {
this.$nextTick(() => { scrollLeft: 0,
this.init(); componentWidth: 0, // tabspx
}); parentLeft: 0, // (tabs)
}, scrollBarLeft: 0, // bartranslateX()
}, tabItemRectInfo: [],
mounted() { barFirstTimeMove: true
this.init() };
}, },
methods: { watch: {
init() { list: {
this.$nextTick(() => { deep: true,
uni.createSelectorQuery().in(this).select(`#tab`).fields({ handler(newList, oldList) {
size: true, if (newList.length !== oldList.length) {
rect: true this.currentIndex = 0;
}, data => { }
this.parentLeft = data.left; this.$nextTick(() => {
// tabs this.initialize();
this.componentWidth = data.width; });
}).exec(); }
this.getTabItemRect() },
}) },
}, mounted() {
getTabItemRect() { this.initialize();
let query = uni.createSelectorQuery().in(this); },
for (let i = 0; i < this.list.length; i++) { methods: {
// sizerect initialize() {
query.select(`#tab-item-${i}`).fields({ this.getComponentRect();
size: true, this.getTabItemRect();
rect: true },
}); getComponentRect() {
} uni.createSelectorQuery().in(this).select('#tab').fields({
query.exec((data) => { size: true,
this.tabItemRectInfo = data rect: true
this.scrollByIndex() }, (data) => {
}) if (data) {
}, this.parentLeft = data.left;
scrollByIndex() { this.componentWidth = data.width;
let tabInfo = this.tabItemRectInfo[this.currentIndex] }
if (!tabInfo) return }).exec();
// tab },
let tabWidth = tabInfo.width getTabItemRect() {
let offsetLeft = tabInfo.left - this.parentLeft const query = uni.createSelectorQuery().in(this);
// tabs-itemscroll-view this.list.forEach((_, index) => {
let scrollLeft = offsetLeft - (this.componentWidth - tabWidth) / 2 query.select(`#tab-item-${index}`).fields({
this.scrollLeft = scrollLeft < 0 ? 0 : scrollLeft; size: true,
// item rect: true
let left = tabInfo.left + tabInfo.width / 2 - this.parentLeft });
this.scrollBarLeft = left - this.barWidth / 2; });
if (this.barFirstTimeMove == true) { query.exec((data) => {
setTimeout(() => { if (data) {
this.barFirstTimeMove = false; this.tabItemRectInfo = data;
}, 100) this.scrollToActiveTab();
} }
}, });
},
clickTab(item, index) { scrollToActiveTab() {
// tab const tabInfo = this.tabItemRectInfo[this.currentIndex];
if (index === this.currentIndex) return if (!tabInfo) return;
this.currentIndex = index const tabWidth = tabInfo.width;
this.$emit('tabItemClick', item, index) const offsetLeft = tabInfo.left - this.parentLeft;
this.scrollByIndex() let scrollLeft = offsetLeft - (this.componentWidth - tabWidth) / 2;
} this.scrollLeft = Math.max(0, scrollLeft);
} const left = tabInfo.left + tabWidth / 2 - this.parentLeft;
} this.scrollBarLeft = left - this.barWidth / 2;
if (this.barFirstTimeMove) {
setTimeout(() => {
this.barFirstTimeMove = false;
}, 100);
}
},
handleTabClick(item, index) {
if (index === this.currentIndex) return;
this.currentIndex = index;
this.$emit('tabItemClick', item, index);
this.scrollToActiveTab();
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tab { .tab {
position: sticky; position: sticky;
top: 88rpx; top: 88rpx;
left: 0; left: 0;
width: 100%; width: 100%;
z-index: 9; z-index: 9;
} }
scroll-view { .scroll {
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
} position: relative;
white-space: nowrap;
width: 100%;
::v-deep ::-webkit-scrollbar { .list {
display: none position: relative;
} width: 100%;
white-space: nowrap;
}
/* #ifndef APP-NVUE */ .item {
::-webkit-scrollbar, position: relative;
::-webkit-scrollbar, display: inline-block;
::-webkit-scrollbar { color: #8C8C8C;
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */ &.active {
/* #ifdef H5 */ color: #333;
// 穿H5scroll-view font-weight: bold;
scroll-view ::v-deep ::-webkit-scrollbar { transform: scale(1.1);
display: none; }
width: 0 !important; }
height: 0 !important; }
-webkit-appearance: none;
background: transparent;
}
/* #endif */ //
::-webkit-scrollbar {
.scroll { display: none;
position: relative; width: 0 !important;
white-space: nowrap; height: 0 !important;
width: 100%; -webkit-appearance: none;
background: transparent;
.list { }
position: relative;
width: 100%;
white-space: nowrap;
}
.item {
position: relative;
display: inline-block;
color: #8C8C8C;
//
&.active {
color: #333;
font-weight: bold;
transform: scale(1.1);
}
}
}
</style> </style>

View File

@ -505,7 +505,8 @@
"path": "pages/shop/commodity/evaluate", "path": "pages/shop/commodity/evaluate",
"style": { "style": {
"navigationBarTitleText": "商品评价", "navigationBarTitleText": "商品评价",
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#fff",
"enablePullDownRefresh": true
} }
}, },
{ {

View File

@ -277,6 +277,7 @@
// 获取首页分页视频 // 获取首页分页视频
api.video.homeVideo({ api.video.homeVideo({
query: { query: {
userId: userinfo.value.id || 0,
pageNum: recList.pageNum, pageNum: recList.pageNum,
pageSize: recList.pageSize, pageSize: recList.pageSize,
} }

View File

@ -192,7 +192,7 @@
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10"> <view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10">
<text>商家明细</text> <text>商家明细</text>
<uni-icons type="right" color="" /> <uni-icons type="right" c1olor="" />
</view> </view>
<view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="$refs.get.open()"> <view class="rows mtb30 ptb20 plr30 cfff f34 b000 br10" @click="$refs.get.open()">

View File

@ -112,23 +112,23 @@
</view> </view>
<view class="main ptb20 f24"> <view class="main ptb20 f24">
<view class="item ver"> <view class="item ver" @click="link('/pages/shop/order/index?tabIndex=1')">
<image src="/static/mine-daifukuan.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-daifukuan.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">待付款</text> <text class="txt mt10 wsn">待付款</text>
</view> </view>
<view class="item ver"> <view class="item ver" @click="link('/pages/shop/order/index?tabIndex=2')">
<image src="/static/mine-daifahuo.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-daifahuo.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">待发货</text> <text class="txt mt10 wsn">待发货</text>
</view> </view>
<view class="item ver"> <view class="item ver" @click="link('/pages/shop/order/index?tabIndex=3')">
<image src="/static/mine-daishouhuo.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-daishouhuo.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">待收货</text> <text class="txt mt10 wsn">待收货</text>
</view> </view>
<view class="item ver"> <view class="item ver" @click="link('/pages/shop/order/index?tabIndex=6')">
<image src="/static/mine-daipingjia.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-daipingjia.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">评价</text> <text class="txt mt10 wsn">评价</text>
</view> </view>
<view class="item ver"> <view class="item ver" @click="link('/pages/shop/order/index?tabIndex=6')">
<image src="/static/mine-tuikuan_shouhou.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-tuikuan_shouhou.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">退款/售后</text> <text class="txt mt10 wsn">退款/售后</text>
</view> </view>
@ -171,7 +171,7 @@
</view> </view>
</template> </template>
<template v-else-if="userinfo.isShop == 1"> <template v-else-if="userinfo.isShop == 1">
<view class="item ver" @click="link('/pages/shop/settle')" > <view class="item ver" @click="link('/pages/shop/settle')">
<image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" /> <image src="/static/mine-ruzhushangjia.png" mode="aspectFit" class="wh50" />
<text class="txt mt10 wsn">店铺管理</text> <text class="txt mt10 wsn">店铺管理</text>
</view> </view>

View File

@ -43,11 +43,11 @@
name: '即时消息', name: '即时消息',
load: false, load: false,
}, },
{ // {
key: 'video', // key: 'video',
name: '视讯消息', // name: '',
load: false, // load: false,
}, // },
// { // {
// key: 'video', // key: 'video',
// name: '', // name: '',

View File

@ -18,21 +18,37 @@
const more_share_data = ref([]) const more_share_data = ref([])
// //
const more_share = { const more_share = {
more: [{ more: [
icon: '/static/news.png', // {
title: '信息' // icon: '/static/news.png',
}, // title: ''
// },
{ {
icon: '/static/home.png', icon: '/static/home.png',
title: '回到首页' title: '回到首页',
event: () => {
uni.switchTab({
url: '/pages/shop/shop'
})
}
}, },
{ {
icon: '/static/individual.png', icon: '/static/individual.png',
title: '个人中心' title: '个人中心',
event: () => {
uni.switchTab({
url: '/pages/mine/mine'
})
}
}, },
{ {
icon: '/static/order.png', icon: '/static/order.png',
title: '我的订单' title: '我的订单',
event: () => {
uni.redirectTo({
url: '/pages/shop/order/index'
})
}
} }
], ],
share: [{ share: [{
@ -52,6 +68,14 @@
share_more.value.open() share_more.value.open()
} }
/**
* 列表项事件
* @param {Object} item
*/
function handleItem(item) {
if (item.event) item.event()
}
// //
function goBack(url) { function goBack(url) {
// //
@ -83,11 +107,13 @@
<view class="side"> <view class="side">
<image @click="goBack('/pages/shop/shop')" class="back wh55" src="/static/back.png" /> <image @click="goBack('/pages/shop/shop')" class="back wh55" src="/static/back.png" />
</view> </view>
<view class="main f1 tac"> <view class="main f1 tac">
<text>销量: {{detail.sales}}</text> <text>销量: {{detail.sales}}</text>
</view> </view>
<view class="side df fdr jcr"> <view class="side df fdr jcr">
<image @click="open('share')" class="share wh55" src="/static/share1.png" /> <!-- <image @click="open('share')" class="share wh55" src="/static/share1.png" /> -->
<image @click="open('more')" class="more wh55 ml20" src="/static/more.png" /> <image @click="open('more')" class="more wh55 ml20" src="/static/more.png" />
</view> </view>
</view> </view>
@ -97,8 +123,7 @@
<uni-popup ref="share_more" type="bottom"> <uni-popup ref="share_more" type="bottom">
<view class="menuAlt popBot"> <view class="menuAlt popBot">
<view class="main df ptb40"> <view class="main df ptb40">
<view class="item ver" v-for="(item, index) in more_share_data" :key="index" <view class="item ver" v-for="(item, index) in more_share_data" :key="index" @click="handleItem(item)">
@click="handle_share(item)">
<image class="wh100" :src="item.icon" /> <image class="wh100" :src="item.icon" />
<view class="title mt10"> <view class="title mt10">
<text class="txt c666 f8">{{ item.title }}</text> <text class="txt c666 f8">{{ item.title }}</text>

View File

@ -9,85 +9,107 @@
import { import {
onLoad, onLoad,
onReady, onReady,
onPageScroll, onPullDownRefresh,
onReachBottom
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
useStore useStore
} from 'vuex' } from 'vuex'
// //
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
//
import api from '@/api/index.js'
const { const {
proxy proxy
} = getCurrentInstance() } = getCurrentInstance()
const { const {
userinfo userinfo
} = useStore().state } = useStore().state
//
const typeList = ref([{ const typeList = ref([{
text: '全部', text: '全部',
icon: null, param: {},
value: 1
}, { }, {
text: '最新', text: '最新',
icon: '/static/picture.png', param: {
value: 2 isNew: 1,
},
}, { }, {
text: '图/视频', text: '有图',
icon: '/static/time.png', param: {
value: 3 isImage: 1,
},
}]) }])
// //
const typeIndex = ref(0) const typeIndex = ref(0)
// id
const id = ref('')
//
const comment = reactive({
pageNum: 1,
pageSize: 5,
list: [],
})
// onLoad((option) => {
const list = reactive([{ if (option.id) id.value = option.id
id: 0,
userId: 1, //
ks: 123, getProComment()
isLike: 1, })
userName: '明月天涯',
portrait: 'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', onPullDownRefresh(() => {
time: '2023年10月30日 14:20', refreshList()
content: '明月天涯明月天涯明月天涯明月天涯明月天涯明月天涯明月天涯', })
imageList: [
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', onReachBottom(() => {
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', getMoreList()
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', })
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg',
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', //
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', function refreshList() {
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', comment.pageNum = 1
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', getProComment()
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg' }
],
child: [{ //
nickname: '用户a', function getMoreList() {
content: '这款产品怎么样?', if (comment.total <= comment.list.length) return
}, { comment.pageNum++
nickname: '用户b', getProComment()
content: '这款产品怎么样?', }
}, ],
}, { //
id: 0, function getProComment() {
userId: 1, api.shop.getProComment({
isLike: 0, query: {
ks: 123, // id
userName: '明月天涯', productId: id.value,
portrait: 'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', pageNum: comment.pageNum,
time: '2023年10月30日 14:20', pageSize: comment.pageSize,
content: '明月天涯明月天涯明月天涯明月天涯明月天涯明月天涯明月天涯', ...typeList.value[typeIndex.value].param,
imageList: [ }
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', }).then(rs => {
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', if (rs.code == 200) {
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', //
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', if (comment.pageNum == 1) comment.list.length = 0
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', //
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', comment.list.push(...rs.rows.map(item => {
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', if(item.imageUrls) item.imageUrls = item.imageUrls.split(',')
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg', return item
'https://mp-bcaa355d-ec14-4cb2-a10e-482127e7cb48.cdn.bspapp.com/VKCEYUGU-bcaa355d-ec14-4cb2-a10e-482127e7cb48/00412594-656b-4379-a49e-0b381d5f6652.jpg' }))
], //
child: [], comment.total = rs.total
}]) return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}).finally(() => {
uni.stopPullDownRefresh()
})
}
/** /**
* 当前评论状态 * 当前评论状态
@ -96,6 +118,8 @@
function handleTypeIndex(index) { function handleTypeIndex(index) {
if (typeIndex.value === index) return if (typeIndex.value === index) return
typeIndex.value = index typeIndex.value = index
//
refreshList()
} }
// //
@ -123,36 +147,36 @@
</view> </view>
<view class="listBox f28"> <view class="listBox f28">
<view class="nomore" v-if="!list[0]">暂无评论~</view> <view class="nomore mtb30" v-if="!comment.list[0]">暂无评论~</view>
<view class="list df fdc" v-for="(item, index) in list" :key="index"> <view class="list df fdc mlr30" v-for="(item, index) in comment.list" :key="index">
<!-- 评论的用户 --> <!-- 评论的用户 -->
<view class="userinfo rows mtb20 mlr20"> <view class="userinfo rows mtb20 ">
<image class="wh80 cir" :src="item.portrait" mode="aspectFill" /> <image class="wh80 cir" :src="item.avatar" mode="aspectFill" />
<view class="name f1 mlr20 c333 f34">{{ item.userName }}</view> <view class="name f1 mlr20 c333 f34">{{ item.nickname }}</view>
<uni-icons type="more-filled" color="#999" /> <!-- <uni-icons type="more-filled" color="#999" /> -->
</view> </view>
<view class="content ml40 plr20 bfff br20"> <view class="content ml30 plr20 bfff br20">
<!-- 款式日期 --> <!-- 款式日期 -->
<view class="rows mtb20 c999"> <view class="rows mtb20 c999">
<view class="">款式{{ item.ks }}</view> <view class="">款式{{ item.sku }}</view>
<view class="">{{ item.time }}</view> <view class="">{{ item.commentTime }}</view>
</view> </view>
<!-- 评论内容 --> <!-- 评论内容 -->
<view class="content mtb20 f30">{{item.content}}</view> <view class="content mtb20 f30">{{item.content}}</view>
<!-- 图片 --> <!-- 图片 -->
<view class="images mtb20" v-if="item.imageList[0]"> <view class="images mtb20" v-if="item.imageUrls">
<view class="item pr" @click="preview(item.imageList,index)" <view class="item pr" @click="preview(item.imageUrls,secIndex)"
v-for="(image, index) in item.imageList" :key="index"> v-for="(image, secIndex) in item.imageUrls" :key="secIndex">
<image class="img pa br10" :src="image" mode="aspectFill" /> <image class="img pa br10" :src="image" mode="aspectFill" />
</view> </view>
</view> </view>
<!-- 菜单 --> <!-- 菜单 -->
<view class="fn df jcr aic mtb20 c999"> <view class="fn df jcr aic mtb20 c999" v-if="0">
<!-- 点赞 --> <!-- 点赞 -->
<view class="ec-item df aic mr20"> <view class="ec-item df aic mr20">
<uni-icons type="hand-up-filled" color="#FF0000" v-if="item.isLike == 1" /> <uni-icons type="hand-up-filled" color="#FF0000" v-if="item.isLike == 1" />
@ -177,7 +201,7 @@
</view> </view>
</view> </view>
<view class="nomore mtb30">暂无更多评论~</view> <view class="nomore mtb30" v-if="comment.list[0]">暂无更多评论~</view>
</view> </view>
</view> </view>
</template> </template>

View File

@ -1,4 +1,5 @@
<script setup> <script setup>
//
import { import {
ref, ref,
reactive, reactive,
@ -40,6 +41,8 @@
list: [], list: [],
total: 0, total: 0,
}) })
//
const recentOrderList = ref([])
// //
const banner = computed(() => { const banner = computed(() => {
let result = [] let result = []
@ -57,10 +60,12 @@
getDetail() getDetail()
// //
addBrowsing() addBrowsing()
//
addListener()
// //
getProComment() getProComment()
//
getRecentOrder()
//
addListener()
}) })
onReady(() => { onReady(() => {
@ -91,12 +96,39 @@
uni.$off('commodityDetail') uni.$off('commodityDetail')
} }
//
function getRecentOrder() {
api.shop.recentOrder({
query: {
// id
productId: id.value,
}
}).then(rs => {
if (rs.code == 200) {
//
const result = rs.data
let list = []
//
for (let i = 0; i < result.length / 2; i++) {
if (!result[i * 2 + 1]) break
list.push([result[i * 2], result[i * 2 + 1]])
}
recentOrderList.value = list
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
// //
function getProComment() { function getProComment() {
api.shop.getProComment({ api.shop.getProComment({
query: { query: {
// id // id
productionId: id.value, productId: id.value,
pageNum: 1, pageNum: 1,
pageSize: 2, pageSize: 2,
} }
@ -301,7 +333,7 @@
<!-- 商品名称 --> <!-- 商品名称 -->
<view class="name mtb20 f34 c333 t2hd">{{detail.name}}</view> <view class="name mtb20 f34 c333 t2hd">{{detail.name}}</view>
<view class="history mtb20 rows"> <view class="history mtb20 rows" v-if="0">
<view class="c666 f28">商品修改历史</view> <view class="c666 f28">商品修改历史</view>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
@ -327,21 +359,19 @@
</view> </view>
<!-- 最近购买 --> <!-- 最近购买 -->
<view class="recently mtb20"> <view class="recently mtb20" v-if="recentOrderList[0]">
<swiper class="swiper" :autoplay="true" vertical="true"> <swiper class="swiper" :autoplay="true" vertical="true">
<swiper-item v-for="(item, index) in 2" :key="index"> <swiper-item v-for="(item, index) in recentOrderList" :key="index">
<view class="list plr10 bfff"> <view class="list plr10 bfff">
<view class="item bsb rows plr10" v-for="(item, index) in 2" :key="index"> <view class="item bsb rows plr10" v-for="(secItem, secIndex) in item" :key="secIndex">
<view class="avatar"> <view class="avatar">
<image class="avatar wh70 cir" <image class="avatar wh70 cir" :src="secItem.avatar" mode="aspectFill" />
src="https://img30.360buyimg.com/popWareDetail/jfs/t1/124291/22/31317/138753/6449f30dF90683c84/4fee5d1a337f7b90.jpg.avif"
mode="aspectFill" />
</view> </view>
<view class="name f1 mlr10 f28">用户xxx</view> <view class="name f1 mlr10 f28">{{secItem.nickname}}</view>
<view class="info mlr10 f26 tar"> <view class="info mlr10 f26 tar">
<view class="fn">刚刚下单</view> <!-- <view class="fn">刚刚下单</view> -->
<view class="time c999">2014.12.08 18:00</view> <view class="time c999">{{secItem.time}}</view>
</view> </view>
<view class="btn sm warm plr15">立即购买</view> <view class="btn sm warm plr15">立即购买</view>
</view> </view>
@ -352,21 +382,20 @@
<!-- 商品评价 --> <!-- 商品评价 -->
<view class="evaluate mtb20 plr25 bfff"> <view class="evaluate mtb20 plr25 bfff">
<view class="header rows ptb25" @click="link(util.setUrl('/pages/shop/commodity/evaluate',{id: 1}))"> <view class="header rows ptb25"
<text class="modelTitle">商品评价(3)</text> @click="link(util.setUrl('/pages/shop/commodity/evaluate',{id: detail.id}))">
<text class="modelTitle">商品评价({{comment.total}})</text>
<uni-icons type="right" /> <uni-icons type="right" />
</view> </view>
<!-- 部分评论 --> <!-- 部分评论 -->
<view class="list"> <view class="list">
<view class="item ptb20" v-for="(item, index) in comment" :key="index"> <view class="item ptb20" v-for="(item, index) in comment.list" :key="index">
<view class="userinfo df c666 f28"> <view class="userinfo df c666 f28">
<image class="avatar wh45 cir" <image class="avatar wh45 cir" :src="item.avatar" mode="aspectFill" />
src="https://img30.360buyimg.com/popWareDetail/jfs/t1/124291/22/31317/138753/6449f30dF90683c84/4fee5d1a337f7b90.jpg.avif" <view class="name thd f32 f1 ml20">{{item.nickname}}</view>
mode="aspectFill" />
<view class="name thd f32 f1 ml20">用户xxx</view>
</view> </view>
<view class="content t2hd mt10 c333 f28">这个商品不错</view> <view class="content t2hd mt10 c333 f28">{{item.content}}</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -3,14 +3,15 @@
import { import {
ref, ref,
reactive, reactive,
getCurrentInstance getCurrentInstance,
watch,
} from 'vue' } from 'vue'
import { import {
onLoad, onLoad,
onUnload, onUnload,
onReachBottom, onReachBottom,
onPullDownRefresh, onPullDownRefresh,
onPageScroll onPageScroll,
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
@ -60,6 +61,8 @@
name: '已取消' name: '已取消'
} }
]) ])
// tab
const tabIndex = ref(0)
// //
const list = reactive({ const list = reactive({
status: '', status: '',
@ -74,8 +77,8 @@
// //
const orderDetail = reactive({}) const orderDetail = reactive({})
onLoad((options) => { onLoad((option) => {
// this.params.currentTab = options.currentTab / 1 if (option.tabIndex) tabIndex.value = Number(option.tabIndex)
// //
getList() getList()
// //
@ -265,7 +268,7 @@
<!-- tab选项卡 --> <!-- tab选项卡 -->
<view class="f1 pr"> <view class="f1 pr">
<JyShopNavigation :list="tabs" @tabItemClick="itemClick" /> <JyShopNavigation v-model="tabIndex" :list="tabs" @tabItemClick="itemClick" />
</view> </view>
<!-- 订单列表 --> <!-- 订单列表 -->

View File

@ -117,7 +117,7 @@
</swiper> </swiper>
<!-- 公告 --> <!-- 公告 -->
<swiper class="notice mtb30 mlr30 c333 f28 br20" vertical="true"> <swiper class="notice mtb30 mlr30 c333 f28 br20" vertical="true" v-if="0">
<swiper-item class="item bsb rows plr20" v-for="(item, index) in 2" :key="index"> <swiper-item class="item bsb rows plr20" v-for="(item, index) in 2" :key="index">
<image class="wh30" src="/static/notice.png" mode="aspectFit" /> <image class="wh30" src="/static/notice.png" mode="aspectFit" />
<view class="f1 mlr20">九亿商城上线啦~</view> <view class="f1 mlr20">九亿商城上线啦~</view>
@ -127,8 +127,8 @@
<!-- 功能区 --> <!-- 功能区 -->
<view class="fn rows mtb30 mlr30"> <view class="fn rows mtb30 mlr30">
<uni-icons type="scan" size="48rpx" color="#FF7F37" /> <!-- <uni-icons type="scan" class="mr20" size="48rpx" color="#FF7F37" /> -->
<view class="searchBox rows f1 ml20 ptb10 plr20 bar"> <view class="searchBox rows f1 ptb10 plr20 bar">
<input type="text" v-model="keyword" class="f1" placeholder="请输入关键字" @blur="handleSearch" /> <input type="text" v-model="keyword" class="f1" placeholder="请输入关键字" @blur="handleSearch" />
<uni-icons type="search" size="30rpx" color="#999" /> <uni-icons type="search" size="30rpx" color="#999" />
</view> </view>

View File

@ -4,8 +4,8 @@ import {
import uni from '@dcloudio/vite-plugin-uni'; import uni from '@dcloudio/vite-plugin-uni';
let target = 'http://91f.xyz:8080' let target = 'http://91f.xyz:8080'
// let target = 'http://22vn9z.natappfree.cc' // let target = 'http://nrpnpc.natappfree.cc'
// let target = 'https://63fdb472.r24.cpolar.top' // let target = 'http://6aa4a4c3.r24.cpolar.top'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],