播放器雏形
This commit is contained in:
@@ -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