播放器雏形
This commit is contained in:
@@ -80,17 +80,20 @@
|
||||
<view style="height: 30rpx;"></view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
keyword: '', // 搜索索引值
|
||||
// 轮播图数据
|
||||
swiperlist: [{
|
||||
@@ -124,6 +127,9 @@
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
onLoad() {
|
||||
// 获取分类
|
||||
this.$http
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
this.$http
|
||||
.post('book/shopcategory/getOneLevel')
|
||||
.then(res => {
|
||||
console.log(res,'一级分类')
|
||||
this.oneLevel = res.list
|
||||
// this.current = e.type
|
||||
this.getTowLevel(this.oneLevel[0])
|
||||
@@ -144,6 +145,7 @@
|
||||
this.$http
|
||||
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
|
||||
.then(res => {
|
||||
console.log(res,'二级分类')
|
||||
this.towLevel = res.list
|
||||
if (this.towLevel == '') {
|
||||
this.commodityList = []
|
||||
@@ -174,6 +176,7 @@
|
||||
'catId': e.catId
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res,'二级分类')
|
||||
this.commodityList = res.list
|
||||
})
|
||||
},
|
||||
|
||||
@@ -55,8 +55,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
用户评价
|
||||
<view v-else >
|
||||
<!-- 商品评价 -->
|
||||
<view class="" v-if="commentsList && commentsList.length > 0">
|
||||
<view class="pingjiaBox" v-for="(item, index) in commentsList" :key="index">
|
||||
<view class="flexbox">
|
||||
<view class="touxiang">
|
||||
<image :src="item.avatar" mode="aspectFit"></image>
|
||||
<text class="username nowrap ">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="contentBox">
|
||||
<view class="content" v-html="item.content"></view>
|
||||
<text class="time">2023-07-28</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="quesheng" v-else>
|
||||
<text>暂无评价~</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 120rpx;"></view>
|
||||
</view>
|
||||
@@ -103,16 +120,38 @@
|
||||
productInfo: {},
|
||||
productAmount: 1, // 商品数量
|
||||
cartList: [], // 购物车列表
|
||||
commentsList:[], // 评论列表
|
||||
productId:null, // 商品评论
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.getProDetail(e)
|
||||
this.getComment()
|
||||
onLoad(e) {
|
||||
this.productId = e.id
|
||||
this.getProDetail(e)
|
||||
this.getComments()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
// 获取评价
|
||||
getComments(){
|
||||
$http.request({
|
||||
url: "buy/record/All",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档1
|
||||
data: {
|
||||
'bookid': this.productId
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res,'评价')
|
||||
if(res.code == 0){
|
||||
this.commentsList = res.list
|
||||
}
|
||||
})
|
||||
},
|
||||
getProDetail(e){
|
||||
// 获取商品详情
|
||||
uni.showLoading({
|
||||
@@ -136,12 +175,7 @@
|
||||
}
|
||||
uni.hideLoading();
|
||||
})
|
||||
},
|
||||
|
||||
// 获取商品评论
|
||||
getComment(){
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
contentButtonClick(e){
|
||||
this.contentShow = e.index
|
||||
@@ -333,6 +367,22 @@ formatRichText (html) { //控制小程序中图片大小
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91;}
|
||||
.pingjiaBox{color: #555; margin-bottom: 20rpx;}
|
||||
.flexbox{display: flex;}
|
||||
.contentBox{width: calc(100% - 50px);box-sizing: border-box; padding-left: 20rpx;
|
||||
.content{font-size: 28rpx; line-height: 40rpx;}
|
||||
.time{font-size: 24rpx; color: #999; margin-top: 6rpx; float: right;}
|
||||
}
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.touxiang{width:50px; overflow: hidden; text-align: center;
|
||||
image{width:50px !important; padding: 3px; height: 50px !important; border: 1px solid #eee; border-radius: 64px; overflow: hidden;;}
|
||||
.username{font-size: 24rpx; color: #999; margin-top: 6rpx; }
|
||||
}
|
||||
.xiangqing {
|
||||
overflow: hidden; overflow-x: hidden;
|
||||
img{display: block; max-width: 100%;}
|
||||
|
||||
@@ -49,6 +49,15 @@
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
<view class="orderOper" >
|
||||
<view style="width: 100%; text-align: right;">
|
||||
<view @click.stop="pingji(item.productId)" class="opCan" >评价</view>
|
||||
<view @click.stop="pingji(item.productId)" class="opCan" >追加评价</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<br clear="both">
|
||||
</view>
|
||||
<view class="orderContent" v-if="orderContet.products==''">
|
||||
@@ -89,48 +98,81 @@
|
||||
<text style="font-size: 24rpx;color: #666;">{{orderContet.createTime}}</text>
|
||||
</view>
|
||||
<view class="orderOper">
|
||||
<view v-if="orderContet.orderStatus==2" style="width: 100%; text-align: right;">
|
||||
<view style="width: 100%; text-align: right;">
|
||||
<!-- <u-button text="" type="success" plain ></u-button>
|
||||
<u-button text="" type="primary" plain >
|
||||
|
||||
</u-button> -->
|
||||
<view class="opFix" @click="onPageJump(orderID)">查看物流</view>
|
||||
<view class="opCan" @click="OverOrder" >确认收货</view>
|
||||
</view>
|
||||
<view v-if="orderContet.orderStatus==0" style="width: 100%; text-align: right;">
|
||||
<view class="opFix" @click="canceOrder">取消订单</view>
|
||||
<view class="opCan" @click="goPay">去支付</view>
|
||||
</view>
|
||||
<view style="width: 100%; text-align: right;">
|
||||
<view class="opFix" @click="pingji">评价</view>
|
||||
<view v-if="orderContet.orderStatus==2" class="opFix" @click="onPageJump(orderID)">查看物流</view>
|
||||
<view v-if="orderContet.orderStatus==2" class="opCan" @click="OverOrder" >确认收货</view>
|
||||
|
||||
<view v-if="orderContet.orderStatus==0" class="opFix" @click="canceOrder">取消订单</view>
|
||||
<view v-if="orderContet.orderStatus==0" class="opCan" @click="goPay">去支付</view>
|
||||
|
||||
|
||||
<view class="opCan" @click="kefu">联系客服</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 对话框 -->
|
||||
<u-popup :show="pingjiaShow" :round="10" @close="pingjiaShow=false">
|
||||
<u-popup :show="pingjiaShow" :round="10" @close="closePingjia">
|
||||
<view class="tanchu">
|
||||
<view class="dp_title">添加评价</view>
|
||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||
<uni-forms :modelValue="Pform">
|
||||
<!-- 评价图片 -->
|
||||
<!-- <uni-forms-item label-width="0">
|
||||
<uni-file-picker @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/>
|
||||
</uni-forms-item> -->
|
||||
<!-- 评价图片 -->
|
||||
<!-- end -->
|
||||
<uni-forms-item name="comment" label-width="0">
|
||||
<!-- <uni-forms-item name="comment" label-width="0">
|
||||
<uni-easyinput type="textarea" v-model="Pform.comment" placeholder="请输入您的商品评价" />
|
||||
</uni-forms-item>
|
||||
</uni-forms-item> -->
|
||||
</uni-forms>
|
||||
<u-button type="success" @click="submitPJ">提交评价</u-button>
|
||||
<!-- <u-button type="success" @click="submitPJ">提交评价</u-button> -->
|
||||
<!-- 提交 -->
|
||||
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #EEEEEE;">
|
||||
|
||||
<view class="mb20">
|
||||
<view v-html="Pform.html">
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="mb30">
|
||||
<span :class="['star',Pform.star>=1 ? 'starLight': 'starGray']" @click="getStar(1)"></span>
|
||||
<span :class="['star',Pform.star>=2 ? 'starLight': 'starGray']" @click="getStar(2)"></span>
|
||||
<span :class="['star',Pform.star>=3 ? 'starLight': 'starGray']" @click="getStar(3)"></span>
|
||||
<span :class="['star',Pform.star>=4 ? 'starLight': 'starGray']" @click="getStar(4)"></span>
|
||||
<span :class="['star',Pform.star>=5 ? 'starLight': 'starGray']" @click="getStar(5)"></span>
|
||||
</view>
|
||||
<view class="mb30">
|
||||
<!-- <uni-file-picker :auto-upload="false" ref="files" @delete="deleteImg" limit="5" @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/> -->
|
||||
<u-upload :fileList="Pform.img" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="4"
|
||||
width="80" height="80" :previewFullImage="true">
|
||||
</u-upload>
|
||||
</view>
|
||||
<view class="flex-sub flexbox">
|
||||
<i @click="showEmj()" :class="emojiIcon" ></i>
|
||||
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
|
||||
<textarea class="textarea" v-model="Pform.comment" @focus="InputFocus" @blur="InputBlur" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></textarea>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
|
||||
<u-button type="success" @click="submitPJ">提交评价</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="position: relative;">
|
||||
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth"></emotion>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import emotion from '@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue';
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
setPay,
|
||||
@@ -142,10 +184,21 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: 'Hello',
|
||||
isShowEmj: false,
|
||||
emojiIcon:'cuIcon-emoji',
|
||||
message: '',
|
||||
|
||||
|
||||
windowWidth:0,
|
||||
windowHeight:500,
|
||||
Pform:{ // 评价表单
|
||||
star:0,
|
||||
comment:'',
|
||||
img:[],
|
||||
html:''
|
||||
},
|
||||
productID:null, // 订单商品id
|
||||
imageStyles:{
|
||||
width:64,
|
||||
height:64,
|
||||
@@ -166,48 +219,191 @@
|
||||
deliverDetails: [{
|
||||
Traces: []
|
||||
}], // 物流详情信息全部
|
||||
deliverDetailsLength: null
|
||||
deliverDetailsLength: null,
|
||||
emoji:[],
|
||||
Files:[]
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||
this.orderID = e.orderId
|
||||
this.orderType = e.orderType
|
||||
this.orderSn = e.orderSn
|
||||
console.log(this.orderID,'this.orderID')
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getOrderList()
|
||||
},
|
||||
components:{
|
||||
emotion
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
|
||||
methods: {
|
||||
handleEmj(i) {
|
||||
console.log(i,'i');
|
||||
this.inputValue = i
|
||||
// console.log(this.inputValue);
|
||||
if(i.emotioni == '[em_98]') {
|
||||
//匹配最后一个表情符号并删除11。
|
||||
this.Pform.comment = this.Pform.comment.replace(/(\[[^\]]+\]|[\s\S])$/, '');
|
||||
if(this.emoji.length > 0){
|
||||
this.emoji = this.emoji.slice(0,-1)
|
||||
}
|
||||
} else {
|
||||
this.emoji.push({'tag' : i.emotion, 'name':i.emotioni})
|
||||
// console.log(this.emoji,'this.emoji')
|
||||
this.Pform.comment += i.emotioni;
|
||||
/// this.Pform.html += i.emotion
|
||||
}
|
||||
},
|
||||
textareaBInput(e) {
|
||||
console.log(e,'e')
|
||||
this.Pform.comment = e.detail.value
|
||||
/// this.Pform.html = e.detail.value
|
||||
},
|
||||
showEmj() {
|
||||
let bool = !this.isShowEmj;
|
||||
if(bool) {
|
||||
this.emojiIcon = 'cuIcon-keyboard';
|
||||
} else {
|
||||
this.emojiIcon = 'cuIcon-emoji';
|
||||
}
|
||||
|
||||
this.isShowEmj = bool;
|
||||
this.$emit('show')
|
||||
},
|
||||
InputBlur(e){
|
||||
|
||||
},
|
||||
InputFocus(e){
|
||||
this.isShowEmj = false;
|
||||
this.emojiIcon = 'cuIcon-emoji';
|
||||
this.$emit('foc')
|
||||
},
|
||||
|
||||
// end
|
||||
deleteImg(e){
|
||||
// var arr = this.Pform.img.slice(0,-1)
|
||||
this.Pform.img.pop()
|
||||
// console.log('删除文件',arr)
|
||||
console.log(this.Pform)
|
||||
},
|
||||
getStar(i){
|
||||
this.Pform.star = i
|
||||
},
|
||||
select(e){
|
||||
console.log('选择文件:',e)
|
||||
console.log('选择文件:',e)
|
||||
let arr = e.tempFiles.map(item => {
|
||||
return {'url':item.url,'name':item.name}
|
||||
})
|
||||
this.Pform.img = this.Pform.img.concat(...arr)
|
||||
//this.Pform.img = arr
|
||||
console.log(this.Pform,'img')
|
||||
},
|
||||
upSuccess(e){
|
||||
console.log(e)
|
||||
},
|
||||
// 获取html格式的评论1
|
||||
getHtmlComment(){
|
||||
var ss = this.Pform.comment
|
||||
if(this.emoji.length> 0){
|
||||
for (var i = 0; i<this.emoji.length; i++){
|
||||
if(this.Pform.comment.indexOf(this.emoji[i].name) !== -1 ){
|
||||
//var re = new RegExp(this.emoji[0].name,"g"); //定义正则表达式
|
||||
//第一个参数是要替换掉的内容,第二个参数"g"表示替换全部(global)。
|
||||
// ss = ss.replace(re, ); //第一个参数是正则表达式。
|
||||
ss = ss.replace(this.emoji[i].name, this.emoji[i].tag)
|
||||
// console.log(ss)
|
||||
}
|
||||
}
|
||||
this.Pform.html = ss
|
||||
}else{
|
||||
this.Pform.html = this.Pform.comment
|
||||
}
|
||||
|
||||
//console.log(this.Pform.html,'this.Pform.html')
|
||||
},
|
||||
deletePic() {
|
||||
let that = this
|
||||
that.Pform.img.splice(0, 1)
|
||||
//console.log(that.Pform.img)
|
||||
},
|
||||
afterRead(e) {
|
||||
//console.log(e)
|
||||
let that = this
|
||||
for (var i=0; i< e.file.length; i++) {
|
||||
//console.log(i,e.file[i].url)
|
||||
uni.uploadFile({
|
||||
url: this.$baseUrl + 'oss/fileoss',
|
||||
filePath: e.file[i].url,
|
||||
//files:e.file,
|
||||
name: 'file',
|
||||
formData: {},
|
||||
success: (res) => {
|
||||
that.Pform.img.push({
|
||||
url: JSON.parse(res.data).url
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
closePingjia(){
|
||||
this.pingjiaShow = false
|
||||
this.Pform.comment = ''
|
||||
this.Pform.html = ''
|
||||
this.emoji = []
|
||||
},
|
||||
// 提交评价
|
||||
submitPJ(){
|
||||
if(this.Pform.comment != ''){
|
||||
console.log(this.Pform,'this.Pform')
|
||||
return false
|
||||
this.$http
|
||||
.post('buy/record/comment',{
|
||||
'userid':this.userInfo.id,
|
||||
'orderSn': this.orderSn,
|
||||
//'starLevel':'',
|
||||
'comment': this.Pform.comment,
|
||||
})
|
||||
.then(res => {
|
||||
// 格式化html
|
||||
var ss = this.Pform.comment
|
||||
if(this.emoji.length> 0){
|
||||
for (var i = 0; i<this.emoji.length; i++){
|
||||
if(this.Pform.comment.indexOf(this.emoji[i].name) !== -1 ){
|
||||
//var re = new RegExp(this.emoji[0].name,"g"); //定义正则表达式
|
||||
//第一个参数是要替换掉的内容,第二个参数"g"表示替换全部(global)。
|
||||
// ss = ss.replace(re, ); //第一个参数是正则表达式。
|
||||
ss = ss.replace(this.emoji[i].name, this.emoji[i].tag)
|
||||
// console.log(ss)
|
||||
}
|
||||
}
|
||||
this.Pform.html = ss
|
||||
}else{
|
||||
this.Pform.html = this.Pform.comment
|
||||
}
|
||||
|
||||
let data={
|
||||
'userid':this.userInfo.id,
|
||||
'orderSn': this.orderSn,
|
||||
'bookid': this.productID,
|
||||
'content': this.Pform.html,
|
||||
'starLevel':this.Pform.star,
|
||||
'images':this.Pform.img
|
||||
}
|
||||
// console.log(data,'data')
|
||||
$http.request({
|
||||
url: "buy/record/UserRecordcomment",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title:'评价成功!',
|
||||
icon:'success'
|
||||
})
|
||||
|
||||
this.pingjiaShow = false
|
||||
this.Pform.comment = ''
|
||||
this.Pform.html = ''
|
||||
this.emoji = []
|
||||
}
|
||||
})
|
||||
}else{
|
||||
@@ -218,7 +414,9 @@
|
||||
}
|
||||
},
|
||||
// 添加评价
|
||||
pingji(){
|
||||
pingji(id){
|
||||
console.log(id)
|
||||
this.productID = id
|
||||
this.pingjiaShow = true
|
||||
},
|
||||
// 联系客服
|
||||
@@ -285,6 +483,10 @@
|
||||
.post(`book/buyorder/appGetOrderInfo/${this.orderType}?orderId=${this.orderID}`)
|
||||
.then(res => {
|
||||
this.orderContet = res.buyOrder
|
||||
this.productIDs = res.buyOrder.products.map(item => {
|
||||
return item.productId
|
||||
})
|
||||
// console.log(this.orderContet,'this.orderContet')
|
||||
if (this.orderContet.orderStatus == 0) {
|
||||
this.titleStat = '待支付'
|
||||
} else if (this.orderContet.orderStatus == 1) {
|
||||
@@ -383,6 +585,15 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
||||
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
||||
.cuIcon-emoji {
|
||||
background : url(../../static/biaoqing.png) no-repeat; background-size: contain; display: block; margin-right: 20rpx;
|
||||
width: 30px; }
|
||||
.cuIcon-keyboard{background : url(../../static/biaoqing.png) no-repeat; background-size: contain; display: block;
|
||||
width: 30px; }
|
||||
.mb30{margin-bottom: 30rpx; overflow: hidden;}
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user