25 changed files with 85 additions and 3638 deletions
-
1common/js/bigc.js
-
1common/js/zh-address-parse.min.js
-
141components/birthday/birthday.less
-
106components/birthday/birthday.vue
-
32pages.json
-
22pages/address/add/add.vue
-
2pages/business/center/center.vue
-
31pages/index/author/author.less
-
190pages/index/author/author.vue
-
336pages/index/index/index.vue
-
311pages/order/comment/comment.less
-
446pages/order/comment/comment.vue
-
20pages/order/confirm/confirm.vue
-
212pages/order/evaluate/evaluate.less
-
351pages/order/evaluate/evaluate.vue
-
8pages/order/index/onlineorder.vue
-
6pages/order/newdetail/newdetail.vue
-
7pages/store/cart/cart.vue
-
75pages/store/comment/comment.less
-
163pages/store/comment/comment.vue
-
3pages/store/invoiceDetail/invoiceDetail.less
-
196pages/store/invoiceDetail/invoiceDetail.vue
-
304pages/store/list/list.less
-
755pages/store/list/list.vue
-
4pages/user/my/center.vue
1
common/js/bigc.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
common/js/zh-address-parse.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,141 +0,0 @@ |
|||||
.birthday-box{ |
|
||||
.mask{ |
|
||||
position: fixed; |
|
||||
top: 0; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
bottom: 0; |
|
||||
z-index: 200; |
|
||||
overflow-y: hidden; |
|
||||
background-color: rgba(0, 0, 0, 0.4); |
|
||||
} |
|
||||
.box{ |
|
||||
position: fixed; |
|
||||
z-index: 500; |
|
||||
width: 80%; |
|
||||
top: 47%; |
|
||||
left: 50%; |
|
||||
transform: translate(-50%, -50%); |
|
||||
overflow: auto; |
|
||||
height: 70%; |
|
||||
.title{ |
|
||||
position: relative; |
|
||||
height: 45%; |
|
||||
background: url("http://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/18-12-27/10678114.jpg") no-repeat; |
|
||||
background-size: 100% 100%; |
|
||||
image{ |
|
||||
position: absolute; |
|
||||
right: 0; |
|
||||
top: 2px; |
|
||||
color: #fff; |
|
||||
width: 30px; |
|
||||
height: 30px; |
|
||||
} |
|
||||
i{ |
|
||||
position: absolute; |
|
||||
right: 0; |
|
||||
top: -5px; |
|
||||
color: #fff; |
|
||||
font-size: 30px; |
|
||||
} |
|
||||
} |
|
||||
.name{ |
|
||||
font-size: 14px; |
|
||||
text-align: center; |
|
||||
margin-right: 2px; |
|
||||
color: #FFFFFF; |
|
||||
background: #ffce2f; |
|
||||
span{ |
|
||||
color: #e7636f; |
|
||||
} |
|
||||
} |
|
||||
.coupon-list{ |
|
||||
overflow: auto; |
|
||||
height: 37%; |
|
||||
background: #ffce2f; |
|
||||
/*margin: 0 9px 0 10px;*/ |
|
||||
margin-right: 2px; |
|
||||
padding: 0 15px; |
|
||||
.item{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
position: relative; |
|
||||
padding: 5px 10px; |
|
||||
margin-bottom: 10px; |
|
||||
background: #FFFFFF; |
|
||||
border-radius: 4px; |
|
||||
|
|
||||
&:first-child{ |
|
||||
margin-top: 10px; |
|
||||
} |
|
||||
&::before { |
|
||||
position: absolute; |
|
||||
left: -5px; |
|
||||
top: 20px; |
|
||||
content: ''; |
|
||||
background: #ffce2f; |
|
||||
width: 10px; |
|
||||
height: 10px; |
|
||||
border-radius: 100%; |
|
||||
} |
|
||||
&::after { |
|
||||
position: absolute; |
|
||||
right: -5px; |
|
||||
top: 20px; |
|
||||
content: ''; |
|
||||
background: #ffce2f; |
|
||||
width: 10px; |
|
||||
height: 10px; |
|
||||
border-radius: 100%; |
|
||||
} |
|
||||
|
|
||||
.left{ |
|
||||
flex: 1; |
|
||||
font-size: 14px; |
|
||||
margin-right: 10px; |
|
||||
overflow: hidden; |
|
||||
div{ |
|
||||
white-space: nowrap; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
|
|
||||
} |
|
||||
.time{ |
|
||||
font-size: 10px; |
|
||||
color: #9B9B9B; |
|
||||
min-height: 19px; |
|
||||
} |
|
||||
} |
|
||||
.right{ |
|
||||
|
|
||||
font-size: 16px; |
|
||||
color: #e7636f; |
|
||||
} |
|
||||
&.point{ |
|
||||
padding: 13px 10px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.buttom{ |
|
||||
font-size: 14px; |
|
||||
padding: 14px; |
|
||||
/*height: 10%;*/ |
|
||||
text-align: center; |
|
||||
color: #FFFFFF; |
|
||||
background: #ffce2f; |
|
||||
border-top: 4px solid #f7a63d; |
|
||||
border-radius: 0 0 5px 5px; |
|
||||
margin-right: 2px; |
|
||||
span{ |
|
||||
background: #e7636f; |
|
||||
border-radius: 20px; |
|
||||
padding: 10px 50px; |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
@ -1,106 +0,0 @@ |
|||||
<template> |
|
||||
<view> |
|
||||
<view class="birthday-box"> |
|
||||
<view class="mask"> |
|
||||
|
|
||||
</view> |
|
||||
<view class="box"> |
|
||||
<view class="title"> |
|
||||
<image src="https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/X.png" @tap="closeBirthdayTap"/> |
|
||||
<!--<i class="iconfont icon-cha-"></i>--> |
|
||||
</view> |
|
||||
<view class="name"> |
|
||||
亲爱的 <span>{{giftData.user.nick_name}}</span> 祝你生日快乐 |
|
||||
</view> |
|
||||
<view class="coupon-list"> |
|
||||
<!--赠送积分--> |
|
||||
<!--v-if="data.activity.point_status"--> |
|
||||
<view class="item point" v-if="giftData.activity.point_status"> |
|
||||
<view class="left"> |
|
||||
<view class="lable"> |
|
||||
<!--赠送111积分--> |
|
||||
赠送 {{giftData.activity.point}} 积分 |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="right"> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<!--积分翻倍--> |
|
||||
<!--v-if="data.activity.point_double_status"--> |
|
||||
<view class="item" v-if="giftData.activity.point_double_status"> |
|
||||
<view class="left"> |
|
||||
<view class="lable"> |
|
||||
<!--123--> |
|
||||
{{giftData.activity.point_double_title}} |
|
||||
</view> |
|
||||
<view class="time"> |
|
||||
<!--456--> |
|
||||
{{giftData.activity.point_double_time}} |
|
||||
</view> |
|
||||
</view> |
|
||||
<div class="right"> |
|
||||
<!--X--> |
|
||||
X {{giftData.activity.point_double}} |
|
||||
</div> |
|
||||
</view> |
|
||||
<!--v-for="item in data.activity.gift" v-show="item.is_receive_coupon" --> |
|
||||
<!--优惠券--> |
|
||||
<view class="item" v-if="item.is_receive_coupon" v-for="(item,index) in giftData.activity.gift" :key="index"> |
|
||||
<view class="left"> |
|
||||
<view class="lable"> |
|
||||
<!--123--> |
|
||||
{{item.coupon.title}} |
|
||||
</view> |
|
||||
<view class="time"> |
|
||||
<!--32121--> |
|
||||
{{item.coupon.usestart_at}} - {{item.coupon.useend_at}} |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="right"> |
|
||||
<!--2323--> |
|
||||
{{item.coupon.label}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!--@click="close"--> |
|
||||
<view class="buttom" @tap="closeBirthdayTap"> |
|
||||
<span>我知道了</span> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
export default{ |
|
||||
data(){ |
|
||||
return{ |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
props:{ |
|
||||
isShow:{ |
|
||||
type:Boolean, |
|
||||
value:'' |
|
||||
}, |
|
||||
giftData:{ |
|
||||
type:Object, |
|
||||
value:'' |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
methods:{ |
|
||||
closeBirthdayTap(){ |
|
||||
this.$emit('close'); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
|
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "birthday"; |
|
||||
</style> |
|
||||
@ -1,31 +0,0 @@ |
|||||
#author { |
|
||||
/* image { |
|
||||
width:100% !important; |
|
||||
vertical-align:top; |
|
||||
} */ |
|
||||
.canvasContent{ |
|
||||
position: fixed; |
|
||||
bottom: 0; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
top: 0; |
|
||||
background: rgba(0,0,0,0.5); |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
flex-direction: column; |
|
||||
padding-top: 50upx; |
|
||||
|
|
||||
.canvasName{ |
|
||||
width: 80%; |
|
||||
height: calc(100vh - 300upx); |
|
||||
} |
|
||||
.canvasText{ |
|
||||
margin: 30upx 0 20upx; |
|
||||
color: #FFFFFF; |
|
||||
} |
|
||||
.errorImage{ |
|
||||
width: 80upx; |
|
||||
height: 80upx; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,190 +0,0 @@ |
|||||
<template> |
|
||||
|
|
||||
<!-- <view id="author"> |
|
||||
<u-parse :content="info.content" v-if="info.content" /> |
|
||||
</view> --> |
|
||||
<view> |
|
||||
<view class="personal_li" |
|
||||
@click="shareClick"> |
|
||||
<image src="../../../static/card-r.png" |
|
||||
mode="widthFix" |
|
||||
class="iconImage"></image> |
|
||||
<text class="font14">分享生成图片</text> |
|
||||
<image src="../../../static/home-r.png" |
|
||||
mode="widthFix" |
|
||||
class="jtIcon"></image> |
|
||||
</view> |
|
||||
<view class="canvasContent" v-if="canvasShow"> |
|
||||
<canvas canvas-id="shareCanvas" class="canvasName"></canvas> |
|
||||
<view class="canvasText">图片已保存到相册,可分享给好友</view> |
|
||||
<image src="../../../static/error.png" class="errorImage" @click="canvasShow = false"></image> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</template> |
|
||||
<script> |
|
||||
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js'; |
|
||||
import uParse from '@/components/gaoyia-parse/parse.vue'; |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
info: '', |
|
||||
canvasShow: false |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
components:{ |
|
||||
|
|
||||
uParse |
|
||||
}, |
|
||||
|
|
||||
onLoad() { |
|
||||
/* this.getAuthor(); */ |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
getAuthor() { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
this.$http.get({ |
|
||||
api: 'api/ibrand' |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
this.setData({ |
|
||||
info: res.data |
|
||||
}); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: res.message || '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: res.message || '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
}).catch(err => { |
|
||||
wx.hideLoading(); |
|
||||
wx.showModal({ |
|
||||
content: '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
setData: function (obj) { |
|
||||
let that = this; |
|
||||
let keys = []; |
|
||||
let val, data; |
|
||||
Object.keys(obj).forEach(function (key) { |
|
||||
keys = key.split('.'); |
|
||||
val = obj[key]; |
|
||||
data = that.$data; |
|
||||
keys.forEach(function (key2, index) { |
|
||||
if (index + 1 == keys.length) { |
|
||||
that.$set(data, key2, val); |
|
||||
} else { |
|
||||
if (!data[key2]) { |
|
||||
that.$set(data, key2, {}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
data = data[key2]; |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
//这是一个封装好的方法 |
|
||||
promisify: api => { |
|
||||
return (options, ...params) => { |
|
||||
return new Promise((resolve, reject) => { |
|
||||
const extras = { |
|
||||
success: resolve, |
|
||||
fail: reject |
|
||||
} |
|
||||
api({ ...options, ...extras }, ...params) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
shareClick() { |
|
||||
const wxGetImageInfo = this.promisify(uni.getImageInfo) |
|
||||
Promise.all([ |
|
||||
// 图片目前只随机找了几张图片,后期可自行替换 |
|
||||
wxGetImageInfo({ |
|
||||
src: 'http://pics.ksudi.com/pic/2019/soms/companycard/jd2.png' // 背景图片 |
|
||||
}), |
|
||||
wxGetImageInfo({ |
|
||||
src: 'http://pics.ksudi.com/pic/2019/soms/companycard/st2.png' // 二维码图片,二维码图片如需要携带参数,可根据接口将需要扫码进入页面的路径+参数传入后端,后端可根据生产小程序二维码路径,将路径放入这里就ok了,<a href="https://www.jianshu.com/p/5f96a4f91b9c" target="_blank">可参考</a> |
|
||||
}) |
|
||||
]).then(res => { |
|
||||
console.log(3454) |
|
||||
const ctx = wx.createCanvasContext('shareCanvas') |
|
||||
console.log(ctx) |
|
||||
// 底图 |
|
||||
ctx.drawImage(res[0].path, 0, 0, 600, 700) |
|
||||
// 作者名称 |
|
||||
ctx.setTextAlign('center') // 文字居中 |
|
||||
ctx.setFillStyle('#000000') // 文字颜色:黑色 |
|
||||
ctx.setFontSize(22) // 文字字号:22px |
|
||||
ctx.fillText('作者:张杰', 300 / 2, 100) |
|
||||
// 小程序码 |
|
||||
const qrImgSize = 150 |
|
||||
ctx.drawImage(res[1].path, (340 - qrImgSize) / 2, 230, qrImgSize, qrImgSize) |
|
||||
ctx.stroke() |
|
||||
// 绘图生成临时图片 |
|
||||
console.log('res', res) |
|
||||
ctx.draw(false,() => { |
|
||||
this.tempFileImage() |
|
||||
}) |
|
||||
this.canvasShow = true |
|
||||
}) |
|
||||
}, |
|
||||
tempFileImage() { |
|
||||
let that = this |
|
||||
uni.canvasToTempFilePath({ |
|
||||
canvasId: 'shareCanvas', |
|
||||
success: (res) => { |
|
||||
uni.hideLoading() |
|
||||
that.savePic(res.tempFilePath) |
|
||||
}, |
|
||||
fail:function () { |
|
||||
//TODO |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
//保存 |
|
||||
savePic (filePath) { |
|
||||
console.log('filePath', filePath) |
|
||||
uni.showLoading({ |
|
||||
title: '正在保存' |
|
||||
}); |
|
||||
uni.saveImageToPhotosAlbum({ |
|
||||
filePath: filePath, |
|
||||
success: function () { |
|
||||
uni.showToast({ |
|
||||
title: '图片保存成功~' |
|
||||
}); |
|
||||
}, |
|
||||
fail: function (e) { |
|
||||
//TODO |
|
||||
}, |
|
||||
complete: function (){ |
|
||||
uni.hideLoading() |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
</script> |
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "author"; |
|
||||
</style> |
|
||||
@ -1,311 +0,0 @@ |
|||||
@import '../../../common/css/global'; |
|
||||
#order-index { |
|
||||
|
|
||||
.navbar { |
|
||||
position: fixed; |
|
||||
top: 0px; |
|
||||
width: 100%; |
|
||||
display: flex; |
|
||||
z-index: 20; |
|
||||
height: 50px; |
|
||||
line-height: 50px; |
|
||||
background: #FFFFFF; |
|
||||
font-size: 14px; |
|
||||
color: #353535; |
|
||||
|
|
||||
.navbar-item { |
|
||||
flex: 1; |
|
||||
width: 0%; |
|
||||
text-align: center; |
|
||||
|
|
||||
&.activity { |
|
||||
color: @globalColor; |
|
||||
} |
|
||||
} |
|
||||
.navbar-slider { |
|
||||
position: absolute; |
|
||||
content: " "; |
|
||||
left: 0; |
|
||||
bottom: 0; |
|
||||
width: 4em; |
|
||||
height: 3px; |
|
||||
background-color: @globalColor; |
|
||||
-webkit-transition: -webkit-transform .3s; |
|
||||
transition: -webkit-transform .3s; |
|
||||
transition: transform .3s; |
|
||||
transition: transform .3s, -webkit-transform .3s |
|
||||
} |
|
||||
} |
|
||||
.tab-panel{ |
|
||||
padding-top: 50px; |
|
||||
} |
|
||||
.order-box { |
|
||||
.order-item__none{ |
|
||||
text-align: center; |
|
||||
color: #959595; |
|
||||
padding-top: 10px; |
|
||||
} |
|
||||
.order-item { |
|
||||
margin-top: 10px; |
|
||||
background: #FFFFFF; |
|
||||
font-size: 15px; |
|
||||
|
|
||||
.item-top { |
|
||||
.indent { |
|
||||
line-height: 35px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
padding: 0 10px; |
|
||||
|
|
||||
.order-num { |
|
||||
white-space: nowrap; |
|
||||
text-overflow: ellipsis; |
|
||||
overflow: hidden; |
|
||||
flex: 1; |
|
||||
padding-right: 10px; |
|
||||
color: #4A4A4A; |
|
||||
font-size: 12px; |
|
||||
line-height: 17px; |
|
||||
|
|
||||
/*span { |
|
||||
font-weight: bold; |
|
||||
}*/ |
|
||||
} |
|
||||
.order-type { |
|
||||
color: @globalColor; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.item-middle { |
|
||||
.middle-item { |
|
||||
display: flex; |
|
||||
padding: 15px; |
|
||||
color: #959595; |
|
||||
|
|
||||
image { |
|
||||
width: 60px; |
|
||||
height: 60px; |
|
||||
border: 1px solid #e5e5e5; |
|
||||
} |
|
||||
.commodity_detail{ |
|
||||
flex: 1; |
|
||||
overflow: hidden; |
|
||||
padding-left: 13px; |
|
||||
.detail_name{ |
|
||||
|
|
||||
color: #000; |
|
||||
font-size: 14px; |
|
||||
line-height: 20px; |
|
||||
overflow: hidden; |
|
||||
white-space: nowrap; |
|
||||
text-overflow: ellipsis; |
|
||||
} |
|
||||
.detail_num{ |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
align-items: center; |
|
||||
.num_css{ |
|
||||
span{ |
|
||||
font-size: 12px; |
|
||||
line-height: 16px; |
|
||||
padding-right: 4px; |
|
||||
color: #9B9B9B; |
|
||||
} |
|
||||
} |
|
||||
.num_money{ |
|
||||
font-size: 12px; |
|
||||
line-height: 16px; |
|
||||
color: #9B9B9B; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
.closeTime{ |
|
||||
padding: 10px; |
|
||||
font-size: 12px; |
|
||||
color: @globalColor; |
|
||||
|
|
||||
.iconfont{ |
|
||||
margin-right: 5px; |
|
||||
} |
|
||||
} |
|
||||
.item-bottom { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
padding: 10px; |
|
||||
.all-money{ |
|
||||
color: #4a4a4a; |
|
||||
font-size: 12px; |
|
||||
line-height: 17px; |
|
||||
} |
|
||||
.button-box { |
|
||||
font-size: 13px; |
|
||||
color: @globalColor; |
|
||||
padding: 5px 10px; |
|
||||
border: 1px solid @globalColor; |
|
||||
border-radius: 3px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.evaluate-item { |
|
||||
margin-top: 10px; |
|
||||
background: #FFFFFF; |
|
||||
.adapter{ |
|
||||
padding: 12px 15px 18px 15px; |
|
||||
|
|
||||
.adapter_item{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
.item_title{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
.adapter-img{ |
|
||||
position: relative; |
|
||||
width: 34px; |
|
||||
height: 34px; |
|
||||
display: inline-block; |
|
||||
overflow: visible; |
|
||||
border-radius: 100%; |
|
||||
border: 1px solid #825139; |
|
||||
image{ |
|
||||
display: inline-block; |
|
||||
width: 32px; |
|
||||
height: 32px; |
|
||||
border-radius: 50%; |
|
||||
} |
|
||||
.justify{ |
|
||||
font-size: 10px; |
|
||||
position: absolute; |
|
||||
width: 14px; |
|
||||
height: 14px; |
|
||||
text-align: center; |
|
||||
content:""; |
|
||||
right: 0; |
|
||||
bottom: 0; |
|
||||
border-radius: 100%; |
|
||||
background-color: #825139; |
|
||||
color: #ffffff; |
|
||||
} |
|
||||
} |
|
||||
.text{ |
|
||||
color: #717071; |
|
||||
font-size: 12px; |
|
||||
line-height: 14px; |
|
||||
padding-left: 12px; |
|
||||
} |
|
||||
} |
|
||||
.rater { |
|
||||
.vlc-rater { |
|
||||
display: flex; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.adapter_type{ |
|
||||
padding-bottom: 6px; |
|
||||
span{ |
|
||||
color: #9B9B9B; |
|
||||
font-size: 10px; |
|
||||
line-height: 14px; |
|
||||
padding-right: 20px; |
|
||||
} |
|
||||
} |
|
||||
.adapter_content{ |
|
||||
color: #000; |
|
||||
font-size: 14px; |
|
||||
line-height: 20px; |
|
||||
.content_text{ |
|
||||
color: #000; |
|
||||
font-size: 14px; |
|
||||
line-height: 20px; |
|
||||
padding-bottom: 3px; |
|
||||
} |
|
||||
.content_img{ |
|
||||
//width: 25%; |
|
||||
width: 100%; |
|
||||
box-sizing: border-box; |
|
||||
.img_item{ |
|
||||
width: 25%; |
|
||||
text-align: center; |
|
||||
display: inline-block; |
|
||||
padding: 3px; |
|
||||
box-sizing: border-box; |
|
||||
view { |
|
||||
height: 0; |
|
||||
padding-bottom: 100%; |
|
||||
position: relative; |
|
||||
} |
|
||||
.img{ |
|
||||
overflow: hidden; |
|
||||
image { |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
left: 0; |
|
||||
top: 0; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.commodity{ |
|
||||
padding: 15px 12px 11px 12px; |
|
||||
.commodity_item{ |
|
||||
background: #f3f3f3; |
|
||||
padding: 5px; |
|
||||
display: flex; |
|
||||
.commodity_img{ |
|
||||
width: 60px; |
|
||||
height: 60px; |
|
||||
image{ |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
} |
|
||||
} |
|
||||
.commodity_detail{ |
|
||||
flex: 1; |
|
||||
overflow: hidden; |
|
||||
padding-left: 13px; |
|
||||
.detail_name{ |
|
||||
|
|
||||
color: #000; |
|
||||
font-size: 14px; |
|
||||
line-height: 20px; |
|
||||
overflow: hidden; |
|
||||
white-space: nowrap; |
|
||||
text-overflow: ellipsis; |
|
||||
} |
|
||||
.detail_num{ |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
align-items: center; |
|
||||
.num_css{ |
|
||||
span{ |
|
||||
font-size: 12px; |
|
||||
line-height: 16px; |
|
||||
padding-right: 4px; |
|
||||
color: #9B9B9B; |
|
||||
} |
|
||||
} |
|
||||
.num_money{ |
|
||||
font-size: 12px; |
|
||||
line-height: 16px; |
|
||||
color: #9B9B9B; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.loadingbox{ |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
text-align: center; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,446 +0,0 @@ |
|||||
<template> |
|
||||
|
|
||||
<view id="order-index"> |
|
||||
<view class="navbar mx-1px-bottom"> |
|
||||
<block v-for="(item, index) in tabList" :key="index" > |
|
||||
<view :id="index" class="navbar-item" :class="activeIndex == index ? 'activity' : ''" @tap="tabClick"> |
|
||||
<view class="navbar-title">{{item.title}}</view> |
|
||||
</view> |
|
||||
</block> |
|
||||
<view class="navbar-slider" :style="'width: ' + width + 'px; transform: translateX(' + sliderOffset + 'px); -webkit-transform: translateX(' + sliderOffset + 'px);'"></view> |
|
||||
|
|
||||
</view> |
|
||||
<view class="tab-panel"> |
|
||||
<view class="tab-content" :hidden="activeIndex != 0"> |
|
||||
|
|
||||
<view class="order-box"> |
|
||||
<view class="order-item__none" v-if="dataList[0] == '' && tabList[activeIndex].init"> |
|
||||
暂无数据 |
|
||||
</view> |
|
||||
<view v-for="(item, idx) in dataList[0]" :key="idx"> |
|
||||
<view class="order-item" :data-no="order.order_no" v-for="(order, index) in dataList[0][idx]" :key="index" @tap="jumps"> |
|
||||
<view class="item-top"> |
|
||||
<view class="indent mx-1px-bottom"> |
|
||||
<view class="order-num"> |
|
||||
<span>线上门店</span> | 订单编号:{{order.order_no}} |
|
||||
</view> |
|
||||
<view class="order-type"> |
|
||||
{{typeList[0]}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item-middle"> |
|
||||
<view class="middle-item mx-1px-bottom" v-for="(good, index) in order.items" :key="index" > |
|
||||
<image :src="good.item_meta.image"></image> |
|
||||
<view class="commodity_detail"> |
|
||||
<view class="detail_name"> |
|
||||
{{good.item_name}} |
|
||||
</view> |
|
||||
<view class="detail_num"> |
|
||||
<view class="num_css"> |
|
||||
<span>{{good.quantity}}件</span> |
|
||||
<span>{{good.item_meta.specs_text}}</span> |
|
||||
</view> |
|
||||
<view class="num_money"> |
|
||||
¥{{good.total_yuan}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item-bottom" > |
|
||||
<view class="all-money"> |
|
||||
{{order.count}}件, 共计 ¥{{order.total_yuan}} |
|
||||
</view> |
|
||||
<view class="button-box"> |
|
||||
立即评价 |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="loadingbox" :hidden="!tabList[0].show"> |
|
||||
{{showText}} |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
<view class="tab-content" :hidden="activeIndex != 1"> |
|
||||
<view class="order-box"> |
|
||||
<view class="order-item__none" v-if="dataList[1] == '' && tabList[activeIndex].init"> |
|
||||
暂无数据 |
|
||||
</view> |
|
||||
<view v-for="(item, indexs) in dataList[1]" :key="indexs" > |
|
||||
<view class="evaluate-item" v-for="(comment, index) in dataList[1][indexs]" :key="index"> |
|
||||
<view class="adapter mx-1px-bottom"> |
|
||||
<view class="adapter_item"> |
|
||||
<view class="item_title"> |
|
||||
<view class="adapter-img"> |
|
||||
<image :src="comment.user.avatar"></image> |
|
||||
<!-- <view class="justify globalColor">V{{comment.user.grade}}</view> --> |
|
||||
</view> |
|
||||
<view class="text">{{comment.user.nick_name}}</view> |
|
||||
</view> |
|
||||
<view class="rater"> |
|
||||
<uni-rate size="18" disabled="true" active-color="red" :value="comment.point" ></uni-rate> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="adapter_type"> |
|
||||
<span>{{comment.created_at}}</span> |
|
||||
<span>颜色分类:{{comment.item_meta.specs_text}}</span> |
|
||||
</view> |
|
||||
<view class="adapter_content"> |
|
||||
<view class="content_item"> |
|
||||
<view class="content_text"> |
|
||||
{{comment.contents}} |
|
||||
</view> |
|
||||
<view class="content_img"> |
|
||||
<view class="img_item" v-for="(imgList, index) in comment.pic_list" :key="index" > |
|
||||
<view class="img"> |
|
||||
<image mode="widthFix" :src="imgList"></image> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="commodity" :hidden="order_item == ''"> |
|
||||
|
|
||||
<view class="commodity_item" :data-id="comment.item_meta.detail_id" @tap="jumpDetail"> |
|
||||
<view class="commodity_img"> |
|
||||
<image :src="comment.item_meta.image"></image> |
|
||||
</view> |
|
||||
<view class="commodity_detail"> |
|
||||
<view class="detail_name"> |
|
||||
{{comment.order_item.item_name}} |
|
||||
</view> |
|
||||
<view class="detail_num"> |
|
||||
<view class="num_css"> |
|
||||
<span>{{comment.order_item.quantity}}件</span> |
|
||||
<span>{{comment.item_meta.specs_text}}</span> |
|
||||
</view> |
|
||||
<view class="num_money"> |
|
||||
¥{{comment.order_item.total_yuan}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="loadingbox" :hidden="!tabList[0].show"> |
|
||||
{{showText}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</template> |
|
||||
<script> |
|
||||
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js'; |
|
||||
import uniRate from "@/components/score/uni-rate/uni-rate.vue" |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
status: { |
|
||||
0: 0, |
|
||||
1: 0, |
|
||||
2: 0, |
|
||||
3: 0 |
|
||||
}, |
|
||||
activeIndex: 0, |
|
||||
sliderOffset: 0, |
|
||||
sliderLeft: 0, |
|
||||
width: 0, |
|
||||
tabList: [{ |
|
||||
title: "待评价", |
|
||||
init: false, |
|
||||
line: false, |
|
||||
statusNum: { |
|
||||
page: 0, |
|
||||
more: true |
|
||||
}, |
|
||||
show: false |
|
||||
}, { |
|
||||
title: "已评价", |
|
||||
init: false, |
|
||||
line: false, |
|
||||
statusNum: { |
|
||||
page: 0, |
|
||||
more: true |
|
||||
}, |
|
||||
show: false |
|
||||
}], |
|
||||
dataList: { |
|
||||
0: [], |
|
||||
1: [] |
|
||||
}, |
|
||||
orderList: {}, |
|
||||
typeList: { |
|
||||
0: '已完成' |
|
||||
}, |
|
||||
showText: '正在加载下一页数据' |
|
||||
}; |
|
||||
}, |
|
||||
components:{ |
|
||||
uniRate |
|
||||
}, |
|
||||
|
|
||||
onReachBottom(e) { |
|
||||
var status = this.activeIndex; |
|
||||
var page = this.tabList[status].page + 1; |
|
||||
var tabList = `tabList[${status}]`; |
|
||||
|
|
||||
if (this.tabList[status].more) { |
|
||||
if (status == 0) { |
|
||||
|
|
||||
// this.setData({ |
|
||||
// [`${tabList}.show`]: true |
|
||||
// }); |
|
||||
|
|
||||
this.tabList.show=true; |
|
||||
|
|
||||
this.orderListF(page); |
|
||||
} else if (status == 1) { |
|
||||
// this.setData({ |
|
||||
// [`${tabList}.show`]: true |
|
||||
// }); |
|
||||
this.tabList.show=true; |
|
||||
this.commentList(page); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showToast({ |
|
||||
title: '再拉也没有啦' |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
onShow() { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
wx.getSystemInfo({ |
|
||||
success: res => { |
|
||||
this.setData({ |
|
||||
width: res.windowWidth / this.tabList.length, |
|
||||
sliderOffset: res.windowWidth / this.tabList.length * this.activeIndex |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
this.orderListF(); |
|
||||
}, |
|
||||
|
|
||||
onLoad(e) {}, |
|
||||
|
|
||||
components: {}, |
|
||||
props: {}, |
|
||||
methods: { |
|
||||
|
|
||||
tabClick(e) { |
|
||||
var status = e.currentTarget.id; |
|
||||
|
|
||||
// this.setData({ |
|
||||
// sliderOffset: e.currentTarget.offsetLeft, |
|
||||
// activeIndex: status |
|
||||
// }); |
|
||||
// |
|
||||
this.sliderOffset=e.currentTarget.offsetLeft; |
|
||||
this.activeIndex=status |
|
||||
|
|
||||
if (status == 0) { |
|
||||
if (!this.tabList[status].init) { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
this.orderListF(); |
|
||||
} |
|
||||
} else if (status == 1) { |
|
||||
if (!this.tabList[status].init) { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
this.commentList(); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
jump(e) { |
|
||||
wx.navigateTo({ |
|
||||
url: '/pages/order/detail/detail?no=' + e.currentTarget.dataset.no |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
jumps(e) { |
|
||||
wx.navigateTo({ |
|
||||
url: '/pages/order/evaluate/evaluate?no=' + e.currentTarget.dataset.no |
|
||||
}); |
|
||||
console.log(1); |
|
||||
}, |
|
||||
|
|
||||
jumpDetail(e) { |
|
||||
wx.navigateTo({ |
|
||||
url: '/pages/store/detail/detail?id=' + e.currentTarget.dataset.id |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
//获取已评价列表 |
|
||||
commentList(page = 1) { |
|
||||
this.$http.get({ |
|
||||
api: 'api/comment/list', |
|
||||
header: { |
|
||||
Authorization: this.$cookieStorage.get('user_token') |
|
||||
}, |
|
||||
data: { |
|
||||
page: page |
|
||||
} |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
console.log(res.data); |
|
||||
var pages = res.meta.pagination; |
|
||||
var current_page = pages.current_page; |
|
||||
var total_pages = pages.total_pages; |
|
||||
var tabList = `tabList[1]`; |
|
||||
// this.setData({ |
|
||||
// [`dataList[1][${page - 1}]`]: res.data, |
|
||||
// [`${tabList}.init`]: true, |
|
||||
// [`${tabList}.page`]: current_page, |
|
||||
// [`${tabList}.more`]: current_page < total_pages |
|
||||
// }); |
|
||||
|
|
||||
this.dataList[1][page - 1]=res.data; |
|
||||
this.tabList[1].init=res.data; |
|
||||
this.tabList[1].page=current_page; |
|
||||
this.tabList[1].more=current_page < total_pages; |
|
||||
|
|
||||
res.data.forEach(v => { |
|
||||
/* Rater.init(`${v.id}`, { |
|
||||
value: v.point, |
|
||||
disabled: true, |
|
||||
activeColor: '#EA4448', |
|
||||
fontSize: 14 |
|
||||
})*/ |
|
||||
|
|
||||
|
|
||||
}); |
|
||||
} else { |
|
||||
wx.showToast({ |
|
||||
title: "请求失败", |
|
||||
image: '../../../static/error.png' |
|
||||
}); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
}).catch(rej => { |
|
||||
wx.showToast({ |
|
||||
title: "请求失败", |
|
||||
image: '../../../static/error.png' |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 获取订单列表 |
|
||||
orderListF(page = 1, type = 0) { |
|
||||
var token = this.$cookieStorage.get('user_token'); |
|
||||
var params = {}; |
|
||||
params.status = 4, params.page = page; |
|
||||
params.type = type; |
|
||||
params.channel = ''; |
|
||||
this.$http.get({ |
|
||||
api: 'api/order/list', |
|
||||
header: { |
|
||||
Authorization: token |
|
||||
}, |
|
||||
data: params |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
console.log(res.data); |
|
||||
var pages = res.meta.pagination; |
|
||||
var current_page = pages.current_page; |
|
||||
var total_pages = pages.total_pages; |
|
||||
var tabList = `tabList[0]`; |
|
||||
// this.setData({ |
|
||||
// [`dataList[0][${page - 1}]`]: res.data, |
|
||||
// [`${tabList}.init`]: true, |
|
||||
// [`${tabList}.page`]: current_page, |
|
||||
// [`${tabList}.more`]: current_page < total_pages |
|
||||
// }); |
|
||||
|
|
||||
this.dataList[0][page - 1]=res.data; |
|
||||
this.tabList[0].init=res.data; |
|
||||
this.tabList[0].page=current_page; |
|
||||
this.tabList[0].more=current_page < total_pages; |
|
||||
|
|
||||
|
|
||||
} else { |
|
||||
wx.showToast({ |
|
||||
title: res.message, |
|
||||
image: '../../../static/error.png' |
|
||||
}); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
}).catch(rej => { |
|
||||
wx.showToast({ |
|
||||
title: "请求失败", |
|
||||
image: '../../../static/error.png' |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
setData: function (obj) { |
|
||||
let that = this; |
|
||||
let keys = []; |
|
||||
let val, data; |
|
||||
Object.keys(obj).forEach(function (key) { |
|
||||
keys = key.split('.'); |
|
||||
val = obj[key]; |
|
||||
data = that.$data; |
|
||||
keys.forEach(function (key2, index) { |
|
||||
if (index + 1 == keys.length) { |
|
||||
that.$set(data, key2, val); |
|
||||
} else { |
|
||||
if (!data[key2]) { |
|
||||
that.$set(data, key2, {}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
data = data[key2]; |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
computed: {}, |
|
||||
watch: {} |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "comment"; |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
@import '../../../common/css/global'; |
|
||||
#order-comment { |
|
||||
height: 100%; |
|
||||
box-sizing: border-box; |
|
||||
overflow: auto; |
|
||||
.order-status { |
|
||||
display: flex; |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
background-color: #FFFFFF; |
|
||||
padding: 0 10px; |
|
||||
|
|
||||
.left { |
|
||||
flex: 1; |
|
||||
font-size: 15px; |
|
||||
} |
|
||||
|
|
||||
.right { |
|
||||
color: #ff0000; |
|
||||
font-size: 13px; |
|
||||
} |
|
||||
} |
|
||||
.order-items { |
|
||||
/*margin-top: 10px;*/ |
|
||||
background-color: #eeeeee; |
|
||||
/*background-color: #FFFFFF;*/ |
|
||||
font-size: 14px; |
|
||||
.order-item{ |
|
||||
background-color: #FFFFFF; |
|
||||
margin-top: 10px; |
|
||||
padding: 15px; |
|
||||
} |
|
||||
.order-item:first-child{ |
|
||||
margin-top: 0px; |
|
||||
} |
|
||||
.order-info { |
|
||||
padding-bottom: 15px; |
|
||||
display: flex; |
|
||||
|
|
||||
.image { |
|
||||
width: 60px; |
|
||||
height: 60px; |
|
||||
border: 1px solid #e5e5e5; |
|
||||
margin-right: 10px; |
|
||||
|
|
||||
image { |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.texts { |
|
||||
flex: 1; |
|
||||
font-size: 12px; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
.name { |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
white-space: nowrap; |
|
||||
} |
|
||||
|
|
||||
.spec { |
|
||||
color: #838383; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.comment-stars { |
|
||||
padding: 10px; |
|
||||
display: flex; |
|
||||
} |
|
||||
|
|
||||
.comment-content { |
|
||||
width: 100%; |
|
||||
box-sizing:border-box ; |
|
||||
/*padding: 10px;*/ |
|
||||
display: flex; |
|
||||
height: 120px; |
|
||||
resize:none; |
|
||||
padding: 15px 0; |
|
||||
textarea { |
|
||||
width: 100%; |
|
||||
height: 90px; |
|
||||
border: 1px solid #e3e3e3; |
|
||||
appearance: none; |
|
||||
outline: none; |
|
||||
box-sizing: border-box; |
|
||||
padding: 5px; |
|
||||
} |
|
||||
|
|
||||
.number { |
|
||||
position: absolute; |
|
||||
bottom: 5px; |
|
||||
right: 5px; |
|
||||
font-size: 12px; |
|
||||
color: #e0e0e0; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.label { |
|
||||
width: 50px; |
|
||||
} |
|
||||
|
|
||||
.content { |
|
||||
flex: 1; |
|
||||
position: relative; |
|
||||
.item_start{ |
|
||||
.vlc-rater{ |
|
||||
display: flex; |
|
||||
.is-active{ |
|
||||
color: @globalColor !important; |
|
||||
} |
|
||||
} |
|
||||
/* i{ |
|
||||
font-size: 12px; |
|
||||
color: @globalColor; |
|
||||
padding: 0 2px; |
|
||||
}*/ |
|
||||
} |
|
||||
} |
|
||||
.uploading-box { |
|
||||
width: 100%; |
|
||||
box-sizing: border-box; |
|
||||
font-size: 0; |
|
||||
padding-top: 15px; |
|
||||
|
|
||||
.uploading-item { |
|
||||
width: 25%; |
|
||||
text-align: center; |
|
||||
display: inline-block; |
|
||||
padding: 0 5px 5px 5px; |
|
||||
box-sizing: border-box; |
|
||||
position: relative; |
|
||||
|
|
||||
.uploading-input { |
|
||||
border: 2px dashed #ddd; |
|
||||
margin: -2px; |
|
||||
} |
|
||||
.delete { |
|
||||
position: absolute; |
|
||||
color: #fff; |
|
||||
font-size: 12px; |
|
||||
top: -10px; |
|
||||
width: 20px; |
|
||||
right: 0px; |
|
||||
height: 20px; |
|
||||
border-radius: 10px; |
|
||||
background: #000; |
|
||||
} |
|
||||
view { |
|
||||
height: 0; |
|
||||
padding-bottom: 100%; |
|
||||
position: relative; |
|
||||
} |
|
||||
.img{ |
|
||||
overflow: hidden; |
|
||||
image { |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
left: 0; |
|
||||
top: 0; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
.uploading { |
|
||||
background: url("https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/uploading.png") no-repeat center; |
|
||||
background-size:30% 30%; |
|
||||
input { |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
bottom: 0; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
opacity: 0; |
|
||||
width: 100%; |
|
||||
} |
|
||||
.add { |
|
||||
font-size: 35px; |
|
||||
font-weight: bold; |
|
||||
} |
|
||||
image { |
|
||||
width: 25px; |
|
||||
height: 25px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
.submit { |
|
||||
margin-top: 10px; |
|
||||
width: 100%; |
|
||||
line-height: 45px; |
|
||||
color: #FFFFFF; |
|
||||
background-color: @globalColor; |
|
||||
font-size: 16px; |
|
||||
border-radius: 0px; |
|
||||
border: none; |
|
||||
text-align: center; |
|
||||
&.disabled { |
|
||||
background-color: #e0e0e0; |
|
||||
|
|
||||
.doing .spinner { |
|
||||
display: none; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,351 +0,0 @@ |
|||||
<template> |
|
||||
<!--<import src="../../../component/rater/rater.wxml"></import>--> |
|
||||
|
|
||||
<view id="order-comment"> |
|
||||
<view class="order-items"> |
|
||||
<view class="order-item" v-for="(item, index) in orderData.items" :key="index"> |
|
||||
<view class="order-info mx-1px-bottom"> |
|
||||
<view class="image"> |
|
||||
<image :src="item.item_meta.image"></image> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
<view class="texts"> |
|
||||
<view class="name">{{item.item_name}}</view> |
|
||||
<view class="spec">{{item.item_meta.specs_text}}</view> |
|
||||
<view class="content"> |
|
||||
<view class="item_start"> |
|
||||
|
|
||||
<uni-rate size="18" active-color="red" value="5" @change="changeStar"></uni-rate> |
|
||||
|
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="comment-content mx-1px-bottom"> |
|
||||
<view class="content"> |
|
||||
<textarea @input="changeEvaluate" :data-index="index" :value="item.comment" placeholder="请输入您对该商品的想法"></textarea> |
|
||||
<view class="number">还可以输入{{500 - length}}字</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="uploading-box"> |
|
||||
<view class="img-item uploading-item" v-for="(itemVal,idx) in item.upload_images" :key="idx"> |
|
||||
<view class="img"> |
|
||||
<image mode="widthFix" :src="itemVal"></image> |
|
||||
</view> |
|
||||
<span class="delete" :data-index="index" :data-idx="idx" :data-images="item.upload_images" @tap="deleteImg($event,item.upload_images)"> |
|
||||
x |
|
||||
</span> |
|
||||
</view> |
|
||||
<view class="uploading uploading-item" @tap="upload" v-if="item.upload_images.length<5" :data-index="index"> |
|
||||
<view class="uploading-input"> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="submit" :disabled="disabled" @tap="submit">提交评价</view> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
</template> |
|
||||
<script> |
|
||||
|
|
||||
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js'; |
|
||||
import uniRate from "@/components/score/uni-rate/uni-rate.vue" |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
orderData:'', |
|
||||
minLength: 5, |
|
||||
disabled: true, |
|
||||
order_no: '', |
|
||||
length: '', |
|
||||
star:5 |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
components:{ |
|
||||
uniRate |
|
||||
}, |
|
||||
|
|
||||
onLoad(e) { |
|
||||
console.log(e); |
|
||||
var no = e.no; |
|
||||
this.initOrderComment(no); |
|
||||
this.setData({ |
|
||||
order_no: no |
|
||||
}); |
|
||||
}, |
|
||||
methods: { |
|
||||
upload(e) { |
|
||||
var index = e.currentTarget.dataset.index; |
|
||||
var that = this; |
|
||||
wx.chooseImage({ |
|
||||
count: 1, |
|
||||
// 默认9 |
|
||||
success: function (res) { |
|
||||
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 |
|
||||
var tempFilePaths = res.tempFilePaths; |
|
||||
|
|
||||
var token = that.$cookieStorage.get('user_token'); |
|
||||
/* that.$http.uploadFile({ |
|
||||
header: { |
|
||||
'content-type': 'multipart/form-data', |
|
||||
Authorization: token |
|
||||
}, |
|
||||
api: 'api/users/upload/avatar', |
|
||||
//仅为示例,非真实的接口地址 |
|
||||
filePath: tempFilePaths[0], |
|
||||
name: 'avatar_file' |
|
||||
}).then(res => { |
|
||||
var result = JSON.parse(res.data); |
|
||||
var arr = that.orderData.items[index].upload_images; |
|
||||
arr.push(result.data.url); |
|
||||
var uploadData = `orderData.items[${index}]`; |
|
||||
|
|
||||
|
|
||||
that.orderData.items[index].upload_images=arr; |
|
||||
|
|
||||
}); */ |
|
||||
uni.uploadFile({ |
|
||||
header: { |
|
||||
Authorization: token |
|
||||
}, |
|
||||
url: config.GLOBAL.baseUrl + 'api/users/upload/avatar', |
|
||||
filePath: tempFilePaths[0], |
|
||||
fileType: 'image', |
|
||||
name: 'avatar_file', |
|
||||
success: res => { |
|
||||
var result = JSON.parse(res.data); |
|
||||
var arr = that.orderData.items[index].upload_images; |
|
||||
arr.push(result.data.url); |
|
||||
var uploadData = `orderData.items[${index}]`; |
|
||||
|
|
||||
|
|
||||
that.orderData.items[index].upload_images=arr; |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
changeEvaluate(e) { |
|
||||
var len = e.detail.value; |
|
||||
var index = e.currentTarget.dataset.index; |
|
||||
|
|
||||
if (e.detail.value.length > 500) { |
|
||||
wx.showModal({ |
|
||||
title: '提示', |
|
||||
content: '超出字数限制' |
|
||||
}); |
|
||||
len = len.slice(0, 500); |
|
||||
} |
|
||||
|
|
||||
// this.setData({ |
|
||||
// [`orderData.items[${index}].comment`]: len, |
|
||||
// length: e.detail.value.length |
|
||||
// }); |
|
||||
|
|
||||
this.length=e.detail.value.length; |
|
||||
this.orderData.items[index].comment=len; |
|
||||
|
|
||||
|
|
||||
}, |
|
||||
|
|
||||
deleteImg(e,images) { |
|
||||
var index = e.currentTarget.dataset.index; |
|
||||
var idx = e.currentTarget.dataset.idx; |
|
||||
// #ifndef H5 |
|
||||
|
|
||||
// #endif |
|
||||
// #ifdef H5 |
|
||||
images = images |
|
||||
// #endif |
|
||||
images.splice(idx, 1); |
|
||||
// this.setData({ |
|
||||
// [`orderData.items[${index}].upload_images`]: images |
|
||||
// }); |
|
||||
|
|
||||
this.orderData.items[index].upload_images=images; |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
|
|
||||
allowComment() { |
|
||||
|
|
||||
if (this.orderData.items && this.orderData.items.length) { |
|
||||
for (let item of this.orderData.items) { |
|
||||
if (item.comment.length < this.minLength) return false; |
|
||||
} |
|
||||
|
|
||||
return true; |
|
||||
} else { |
|
||||
return false; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
submit() { |
|
||||
if (this.allowComment()) { |
|
||||
var no = this.order_no; |
|
||||
var comments = []; |
|
||||
var data = this.orderData.items; |
|
||||
|
|
||||
var rater = this.star; |
|
||||
data.forEach((item,index) => { |
|
||||
comments.push({ |
|
||||
order_no: no, |
|
||||
order_item_id: item.id, |
|
||||
contents: item.comment, |
|
||||
point: rater, |
|
||||
images:item.upload_images |
|
||||
}) |
|
||||
}); |
|
||||
this.postSubmit(comments); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: "请填写完成", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
changeStar(e){ |
|
||||
this.star=e.value; |
|
||||
}, |
|
||||
|
|
||||
postSubmit(comments) { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
var data = {}; |
|
||||
comments.forEach((comment, index) => { |
|
||||
data[index] = comment; |
|
||||
}); |
|
||||
|
|
||||
this.$http.post({ |
|
||||
api: 'api/shopping/order/review', |
|
||||
header: { |
|
||||
Authorization: this.$cookieStorage.get('user_token') |
|
||||
}, |
|
||||
data: data |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status |
|
||||
&& comments.length |
|
||||
) { |
|
||||
console.log(23423423); |
|
||||
wx.showModal({ |
|
||||
content: '评价成功', |
|
||||
showCancel: false, |
|
||||
success: res => { |
|
||||
if (res.confirm || !res.cancel && !res.confirm) { |
|
||||
wx.redirectTo({ |
|
||||
url: '/pages/order/comment/comment' |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: res.message || "请求失败", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: "请求失败", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
initOrderComment(id) { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
this.$http.get({ |
|
||||
api: 'api/order/' + id, |
|
||||
header: { |
|
||||
Authorization: this.$cookieStorage.get('user_token') |
|
||||
} |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
// var start = Rater; |
|
||||
var data = res.data; |
|
||||
data.items.forEach((v, index) => { |
|
||||
/* start.init(index, { |
|
||||
value: 5 |
|
||||
})*/ |
|
||||
v.score = ''; |
|
||||
v.comment = ''; |
|
||||
v.upload_images = []; |
|
||||
}); |
|
||||
this.setData({ |
|
||||
orderData: data |
|
||||
}); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: res.message || "请求失败", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
content: "请求失败", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
setData: function (obj) { |
|
||||
let that = this; |
|
||||
let keys = []; |
|
||||
let val, data; |
|
||||
Object.keys(obj).forEach(function (key) { |
|
||||
keys = key.split('.'); |
|
||||
val = obj[key]; |
|
||||
data = that.$data; |
|
||||
keys.forEach(function (key2, index) { |
|
||||
if (index + 1 == keys.length) { |
|
||||
that.$set(data, key2, val); |
|
||||
} else { |
|
||||
if (!data[key2]) { |
|
||||
that.$set(data, key2, {}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
data = data[key2]; |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
computed: {}, |
|
||||
watch: {} |
|
||||
}; |
|
||||
</script> |
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "evaluate"; |
|
||||
</style> |
|
||||
@ -1,75 +0,0 @@ |
|||||
#comments { |
|
||||
|
|
||||
.no-list { |
|
||||
text-align: center; |
|
||||
padding: 10px 0; |
|
||||
} |
|
||||
background: #FFFFFF; |
|
||||
|
|
||||
.comment_list { |
|
||||
font-size: 12px; |
|
||||
line-height: 20px; |
|
||||
padding: 10px 15px; |
|
||||
.comment_user { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
.img-box { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
flex: 1; |
|
||||
image{ |
|
||||
width: 25px; |
|
||||
height: 25px; |
|
||||
border-radius: 100%; |
|
||||
} |
|
||||
} |
|
||||
.rater { |
|
||||
.vlc-rater { |
|
||||
display: flex; |
|
||||
} |
|
||||
} |
|
||||
.user_name { |
|
||||
margin-left: 15px; |
|
||||
display: inline-block; |
|
||||
color: #717071; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.comment_content { |
|
||||
margin-top: 0px; |
|
||||
} |
|
||||
|
|
||||
.comment-img { |
|
||||
font-size: 0; |
|
||||
margin: 5px 0; |
|
||||
image{ |
|
||||
display: inline-block; |
|
||||
width: 25%; |
|
||||
//height: 100%; |
|
||||
padding: 0 5px; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.comment_time { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
margin: 10px 0; |
|
||||
.time { |
|
||||
margin-right: 15px; |
|
||||
} |
|
||||
color: #838282; |
|
||||
} |
|
||||
.all-comment { |
|
||||
text-align: center; |
|
||||
.text { |
|
||||
margin-top: 10px; |
|
||||
display: inline-block; |
|
||||
font-size: 10px; |
|
||||
color: #4A4A4A; |
|
||||
border: 1px solid #4A4A4A; |
|
||||
border-radius: 3px; |
|
||||
padding: 2px 4px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,163 +0,0 @@ |
|||||
<template> |
|
||||
|
|
||||
<!--<import src="../../../component/rater/rater.wxml"></import>--> |
|
||||
|
|
||||
<view id="comments"> |
|
||||
<view class="content"> |
|
||||
<view class="no-list" v-if="!list[0].length && init"> |
|
||||
暂无数据 |
|
||||
</view> |
|
||||
<view v-for="(items, idx) in list" :key="idx"> |
|
||||
<view class="comment_list mx-1px-bottom" v-for="(item, index) in list[idx]" :key="index"> |
|
||||
<view class="comment_user"> |
|
||||
<view class="img-box"> |
|
||||
<image :src="item.user.avatar"></image> |
|
||||
<view class="user_name">{{item.user.nick_name}}</view> |
|
||||
</view> |
|
||||
<view class="rater"> |
|
||||
<!--<template is="rater" data="{{ ...$vlc.rater[item.id] }}"/>--> |
|
||||
<uni-rate size="18" disabled="true" active-color="red" :value="item.point"></uni-rate> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="comment_time"> |
|
||||
<view class="time"> |
|
||||
{{item.updated_at}} |
|
||||
</view> |
|
||||
<view class="model"> |
|
||||
{{item.item_meta.specs_text!=undefined?item.item_meta.specs_text:''}} |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="comment_content"> |
|
||||
{{item.contents}} |
|
||||
</view> |
|
||||
<view class="comment-img"> |
|
||||
<image :src="item" mode="widthFix" alt v-for="(item, index) in item.pic_list" :key="index"></image> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
<script> |
|
||||
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js'; |
|
||||
import uniRate from "@/components/score/uni-rate/uni-rate.vue" |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
hasMore: true, |
|
||||
init: false, |
|
||||
list: [], |
|
||||
page: '', |
|
||||
id: '' |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
components: { |
|
||||
uniRate |
|
||||
}, |
|
||||
// 加载更多 |
|
||||
onReachBottom() { |
|
||||
if (this.hasMore) { |
|
||||
var page = this.page + 1; |
|
||||
this.queryCommodityComments(this.id, page); |
|
||||
} else { |
|
||||
wx.showToast({ |
|
||||
image: '../../../static/error.png', |
|
||||
title: '再拉也没有啦' |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
onLoad(e) { |
|
||||
wx.showLoading({ |
|
||||
title: "加载中", |
|
||||
mask: true |
|
||||
}); |
|
||||
this.queryCommodityComments(e.id, 1); |
|
||||
this.setData({ |
|
||||
id: e.id |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
components: {}, |
|
||||
props: {}, |
|
||||
methods: { |
|
||||
// 请求评论列表 |
|
||||
queryCommodityComments(id, page = 1) { |
|
||||
this.$http.get({ |
|
||||
api: 'api/store/detail/' + id + '/comments', |
|
||||
data: { |
|
||||
page: page |
|
||||
} |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
var pages = res.meta.pagination; |
|
||||
var current_page = pages.current_page; |
|
||||
var total_pages = pages.total_pages; |
|
||||
this.setData({ |
|
||||
// [`list[${page - 1}]`]: res.data, |
|
||||
init: true, |
|
||||
page: current_page, |
|
||||
hasMore: current_page < total_pages |
|
||||
}); |
|
||||
this.list[[page-1]]=res.data; |
|
||||
|
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
title: '', |
|
||||
content: '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
title: '', |
|
||||
content: '请求失败', |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.hideLoading(); |
|
||||
this.show=false; |
|
||||
}, err => { |
|
||||
wx.hideLoading(); |
|
||||
// this.setData({ |
|
||||
// show: false |
|
||||
// }); |
|
||||
this.show=false; |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
setData: function (obj) { |
|
||||
let that = this; |
|
||||
let keys = []; |
|
||||
let val, data; |
|
||||
Object.keys(obj).forEach(function (key) { |
|
||||
keys = key.split('.'); |
|
||||
val = obj[key]; |
|
||||
data = that.$data; |
|
||||
keys.forEach(function (key2, index) { |
|
||||
if (index + 1 == keys.length) { |
|
||||
that.$set(data, key2, val); |
|
||||
} else { |
|
||||
if (!data[key2]) { |
|
||||
that.$set(data, key2, {}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
data = data[key2]; |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
computed: {}, |
|
||||
watch: {} |
|
||||
}; |
|
||||
</script> |
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "comment"; |
|
||||
</style> |
|
||||
@ -1,3 +0,0 @@ |
|||||
.invoice_detail{ |
|
||||
|
|
||||
} |
|
||||
@ -1,196 +0,0 @@ |
|||||
<template> |
|
||||
<view class="invoice_detail"> |
|
||||
<view class="header_box"> |
|
||||
<view class="item"> |
|
||||
<view class="name"> |
|
||||
抬头类型 |
|
||||
</view> |
|
||||
<view class="type"> |
|
||||
<radio-group @change="change($event)" style="display: flex;"> |
|
||||
<view class="type-item"> |
|
||||
<label class="checkbox" style="margin-right:10px;"> |
|
||||
<radio checked="true" value="personal" /> |
|
||||
<text>个人</text> |
|
||||
</label> |
|
||||
</view> |
|
||||
<view class="type-item"> |
|
||||
<label class="checkbox"> |
|
||||
<radio value="enterprise" /> |
|
||||
<text>单位</text> |
|
||||
</label> |
|
||||
</view> |
|
||||
</radio-group> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item"> |
|
||||
<view class="name">发票抬头</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="抬头名称" placeholder-class="input-placeholder" v-model="name" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!-- 企业的选择 --> |
|
||||
<view class="conpany" v-if="type == 'enterprise'"> |
|
||||
<view class="item"> |
|
||||
<view class="name">税号</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="纳税人识别号" placeholder-class="input-placeholder" v-model="number" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item"> |
|
||||
<view class="name">开户银行</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="选填" placeholder-class="input-placeholder" v-model="bank" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item"> |
|
||||
<view class="name">银行账号</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="选填" placeholder-class="input-placeholder" v-model="bank_number" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item"> |
|
||||
<view class="name">企业地址</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="选填" placeholder-class="input-placeholder" v-model="address" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="item"> |
|
||||
<view class="name">企业电话</view> |
|
||||
<view class="input-box"> |
|
||||
<input type="text" placeholder="选填" placeholder-class="input-placeholder" v-model="phone" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
<view class="content"> |
|
||||
<view class="detail"> |
|
||||
<view class="name">发票明细:</view> |
|
||||
</view> |
|
||||
<view class="tips"> |
|
||||
开票金额为用户实际支付金额(不含礼品卡、优惠券、积分抵扣) |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
<view class="content" @click="jumpback"> |
|
||||
<view class="detail"> |
|
||||
<view class="name">本次不开具发票,继续下单</view> |
|
||||
<view class="iconfont icon--xiangyoujiantou"></view> |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
<!-- 完成按钮 --> |
|
||||
<view class="btn-box" @click="submit">完成</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
type: 'personal', //发票;类型 |
|
||||
name: '', //发票抬头 |
|
||||
number: '', //税号 |
|
||||
bank: '', //开户银行 |
|
||||
bank_number: '', //银行账号, |
|
||||
phone: '', //企业电话 |
|
||||
address: '', //企业地址 |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
onLoad() { |
|
||||
|
|
||||
}, |
|
||||
onShow() { |
|
||||
|
|
||||
}, |
|
||||
methods: { |
|
||||
change(e) { |
|
||||
this.type = e.detail.value; |
|
||||
}, |
|
||||
// 点击完成时候所完成的动作 |
|
||||
submit() { |
|
||||
var message = ''; |
|
||||
if (this.type == 'personal') { |
|
||||
if (this.name) { |
|
||||
var data = { |
|
||||
type: 'personal', |
|
||||
name: this.name |
|
||||
} |
|
||||
this.addInvoiceInfo(data); |
|
||||
} else { |
|
||||
message = "请输入抬头名称" |
|
||||
wx.showModal({ |
|
||||
content: message, |
|
||||
showCancel: false |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
} |
|
||||
if (this.type == 'enterprise') { |
|
||||
if(!this.name){ |
|
||||
message = "请输入抬头名称" |
|
||||
wx.showModal({ |
|
||||
content: message, |
|
||||
showCancel: false |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
var regExp = /^([1-9]{1})(\d{15}|\d{18})$/; |
|
||||
if (!this.number) { |
|
||||
message = "请输入纳税人识别号" |
|
||||
wx.showModal({ |
|
||||
content: message, |
|
||||
showCancel: false |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
if (this.bank_number) { |
|
||||
if (!regExp.test(this.bank_number)) { |
|
||||
message = "请输入正确的银行卡号", |
|
||||
wx.showModal({ |
|
||||
content: message, |
|
||||
showCancel: false |
|
||||
}) |
|
||||
return |
|
||||
} |
|
||||
} |
|
||||
var data = { |
|
||||
type: 'enterprise', |
|
||||
name:this.name, |
|
||||
number: this.number, |
|
||||
bank: this.bank, |
|
||||
bank_number: this.bank_number, |
|
||||
phone: this.phone, |
|
||||
address: this.address |
|
||||
} |
|
||||
this.addInvoiceInfo(data); |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
// 向后端发送发票信息 |
|
||||
addInvoiceInfo(info) { |
|
||||
var data = this.$cookieStorage.get('order_form'); |
|
||||
|
|
||||
data.invoice = info; |
|
||||
this.$cookieStorage.set('order_form', data); |
|
||||
wx.navigateBack(); |
|
||||
|
|
||||
}, |
|
||||
// 返回 |
|
||||
jumpback(){ |
|
||||
var data = this.$cookieStorage.get('order_form'); |
|
||||
data.invoice = ""; |
|
||||
this.$cookieStorage.set('order_form', data); |
|
||||
wx.navigateBack(); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "invoiceDetail"; |
|
||||
</style> |
|
||||
@ -1,304 +0,0 @@ |
|||||
#store-list{ |
|
||||
.commodity-top{ |
|
||||
position: fixed; |
|
||||
top: 0; |
|
||||
width: 100%; |
|
||||
z-index: 10; |
|
||||
.sidebar{ |
|
||||
background: #FFFFFF; |
|
||||
font-size: 18px; |
|
||||
width: 100%; |
|
||||
height: 50px; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
|
|
||||
.sidebar-left{ |
|
||||
flex: 1; |
|
||||
height: 100%; |
|
||||
|
|
||||
span{ |
|
||||
display: inline-block; |
|
||||
line-height: 50px; |
|
||||
height: 100%; |
|
||||
padding-left: 15px; |
|
||||
} |
|
||||
} |
|
||||
.sidebar-right{ |
|
||||
width: 120px; |
|
||||
height: 100%; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
view{ |
|
||||
display: inline-block; |
|
||||
width: 40px; |
|
||||
height: 100%; |
|
||||
text-align: center; |
|
||||
line-height: 50px; |
|
||||
font-size: 20px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.filter-box{ |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
align-items: center; |
|
||||
font-size: 14px; |
|
||||
background: #FFFFFF; |
|
||||
|
|
||||
.filter-item{ |
|
||||
display: flex; |
|
||||
flex: 1; |
|
||||
width: 0%; |
|
||||
justify-content: center; |
|
||||
align-items: center; |
|
||||
line-height: 40px; |
|
||||
height: 40px; |
|
||||
|
|
||||
.left{ |
|
||||
flex: 1; |
|
||||
margin-left: 20px; |
|
||||
text-align: center; |
|
||||
|
|
||||
&.active { |
|
||||
color: #099FFF; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
&.dis { |
|
||||
color: #eeeeee; |
|
||||
} |
|
||||
.right{ |
|
||||
width: 20px; |
|
||||
height: 100%; |
|
||||
margin-right: 5px; |
|
||||
background: url("https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/ico-filter.png") no-repeat center; |
|
||||
background-size: 8px 12px; |
|
||||
|
|
||||
&.asc { |
|
||||
background-image: url("https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/ico-filter1.png"); |
|
||||
transform: rotate(180deg); |
|
||||
} |
|
||||
&.desc { |
|
||||
background-image: url("https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/ico-filter1.png"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.commodity-bottom{ |
|
||||
//height: 100%; |
|
||||
font-size: 0; |
|
||||
box-sizing: border-box; |
|
||||
padding: 90px 5px 20px 5px; |
|
||||
.commodity-out{ |
|
||||
width: 50%; |
|
||||
display: inline-block; |
|
||||
font-size: 12px; |
|
||||
padding: 10px 5px 0 5px; |
|
||||
box-sizing: border-box; |
|
||||
.commodity-box{ |
|
||||
background: #ffffff; |
|
||||
overflow: hidden; |
|
||||
width: 100%; |
|
||||
padding: 10px; |
|
||||
box-sizing: border-box; |
|
||||
font-size: 14px; |
|
||||
|
|
||||
.commodity-img { |
|
||||
overflow: hidden; |
|
||||
text-align: center; |
|
||||
image{ |
|
||||
width: 290rpx; |
|
||||
//height: 310rpx; |
|
||||
} |
|
||||
} |
|
||||
.commodity-name{ |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
white-space: nowrap; |
|
||||
} |
|
||||
.commodity-money{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
margin-top: 10px; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
white-space: nowrap; |
|
||||
height: 25px; |
|
||||
.money{ |
|
||||
color: #ED3327; |
|
||||
margin-top: 2px; |
|
||||
.origin-money{ |
|
||||
color: #AAAAAA; |
|
||||
font-size: 12px; |
|
||||
display: inline-block; |
|
||||
padding-left:2px; |
|
||||
text-decoration: line-through; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
.discount-tags{ |
|
||||
font-size: 0; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
.tags-item{ |
|
||||
display: block; |
|
||||
float: left; |
|
||||
color: #ffffff; |
|
||||
background: #EB7073; |
|
||||
border-radius: 2px; |
|
||||
padding: 2px 5px; |
|
||||
font-size: 12px; |
|
||||
margin: 0 0 0px 5px; |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
.vip-type { |
|
||||
width: 15px; |
|
||||
height: 15px; |
|
||||
margin-left: 5px; |
|
||||
image { |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.commodity-out-vertical{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
padding-right:5px; |
|
||||
background-color: #FFFFFF; |
|
||||
margin-top: 10px; |
|
||||
.img-box{ |
|
||||
width:110px; |
|
||||
margin-right: 10px; |
|
||||
image{ |
|
||||
vertical-align: middle; |
|
||||
width: 100%; |
|
||||
} |
|
||||
} |
|
||||
.right-box{ |
|
||||
flex: 1; |
|
||||
overflow: hidden; |
|
||||
.goods-name{ |
|
||||
color: #111111; |
|
||||
font-size: 14px; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
display: -webkit-box; |
|
||||
-webkit-line-clamp:2; |
|
||||
-webkit-box-orient: vertical; |
|
||||
padding-top: 10px; |
|
||||
} |
|
||||
.goods-money{ |
|
||||
color:#FB5054; |
|
||||
font-size: 14px; |
|
||||
padding:26px 0px 13px 0; |
|
||||
.origin-money{ |
|
||||
color: #AAAAAA; |
|
||||
font-size: 12px; |
|
||||
display: inline-block; |
|
||||
padding-left:2px; |
|
||||
text-decoration: line-through; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
|
||||
.loadingbox{ |
|
||||
margin-top: 10px; |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
text-align: center; |
|
||||
font-size:14px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.right-filter-box{ |
|
||||
overflow: auto; |
|
||||
position: fixed; |
|
||||
top: 0; |
|
||||
bottom: 0; |
|
||||
width: 100%; |
|
||||
padding: 6px; |
|
||||
background: #FFFFFF; |
|
||||
font-size: 14px; |
|
||||
//overflow: hidden; |
|
||||
z-index: 10; |
|
||||
//transform: translateX(100%); |
|
||||
.box{ |
|
||||
height: 100%; |
|
||||
.title{ |
|
||||
padding: 10px 5px; |
|
||||
} |
|
||||
.list{ |
|
||||
font-size: 0; |
|
||||
.list-block{ |
|
||||
display: inline-block; |
|
||||
width: 33.33%; |
|
||||
font-size: 12px; |
|
||||
margin-bottom: 10px; |
|
||||
padding: 0 5px; |
|
||||
|
|
||||
.selected{ |
|
||||
background-color: #fff; |
|
||||
border-color: #f9be00; |
|
||||
} |
|
||||
|
|
||||
view{ |
|
||||
display: block; |
|
||||
height: 34px; |
|
||||
line-height: 30px; |
|
||||
text-align: center; |
|
||||
background: #ededed; |
|
||||
width: 100%; |
|
||||
border: 2px solid #ededed; |
|
||||
box-sizing: border-box; |
|
||||
white-space: nowrap; |
|
||||
overflow: hidden; |
|
||||
text-overflow: ellipsis; |
|
||||
} |
|
||||
} |
|
||||
.price-inputs{ |
|
||||
padding: 0 5px; |
|
||||
display: flex; |
|
||||
|
|
||||
input{ |
|
||||
display: block; |
|
||||
text-align: center; |
|
||||
width: 31%; |
|
||||
height: 35px; |
|
||||
outline: none; |
|
||||
background: #f8f8f8; |
|
||||
} |
|
||||
.minus{ |
|
||||
font-size: 12px; |
|
||||
height: 35px; |
|
||||
line-height: 35px; |
|
||||
text-align: center; |
|
||||
padding: 0 5px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.button-box{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
font-size: 12px; |
|
||||
margin: 15px 0; |
|
||||
|
|
||||
button{ |
|
||||
width: 0%; |
|
||||
height: 40px; |
|
||||
line-height: 40px; |
|
||||
text-align: center; |
|
||||
flex: 1; |
|
||||
margin: 0 8px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,755 +0,0 @@ |
|||||
<template> |
|
||||
|
|
||||
<view> |
|
||||
<view id="store-list"> |
|
||||
<view class="commodity-top" catchtouchmove="move"> |
|
||||
<view class="sidebar mx-1px-bottom"> |
|
||||
<view class="sidebar-left"> |
|
||||
<span class="iconfont icon-fenzu" @tap="classF"> |
|
||||
|
|
||||
</span> |
|
||||
</view> |
|
||||
<view class="sidebar-right"> |
|
||||
<view class="right-seek iconfont icon-sousuo" @tap="search"> |
|
||||
|
|
||||
</view> |
|
||||
<view class="right-cart iconfont icon-gouwuche" @tap="cart"> |
|
||||
|
|
||||
</view> |
|
||||
<view class="right-cart iconfont icon-qiehuan1" v-if="arrangement == 'rank'" @tap="changeRange"> |
|
||||
|
|
||||
</view> |
|
||||
<view class="right-cart iconfont icon-qiehuanduotuSVG" v-if="arrangement == 'vertical'" @tap="changeRange"> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="filter-box"> |
|
||||
<view class="filter-item mx-1px-right" data-type="updated_at" @tap="changeOrderBy"> |
|
||||
<view class="left" :class=" orderBy === 'updated_at' ? 'active' : ''">最新</view> |
|
||||
<view class="right" :class="(orderBy === 'updated_at' && sort === 'desc') ? 'desc' : ''"></view> |
|
||||
</view> |
|
||||
<view class="filter-item mx-1px-right" data-type="sell_price" @tap="changeOrderBy"> |
|
||||
<view class="left" :class=" orderBy === 'sell_price' ? 'active' : ''">价格</view> |
|
||||
<view class="right" :class="(orderBy === 'sell_price' && sort === 'desc') ? 'desc' : ''"></view> |
|
||||
</view> |
|
||||
<view class="filter-item mx-1px-right" data-type="sale" @tap="changeOrderBy"> |
|
||||
<view class="left" :class=" orderBy === 'sale' ? 'active' : ''">销量</view> |
|
||||
<view class="right" :class="(orderBy === 'sale' && sort === 'desc') ? 'desc' : ''"></view> |
|
||||
</view> |
|
||||
<view class="filter-item big-filter" :class="c_id ? '' : 'dis'" @tap="showFilterF"> |
|
||||
筛选 ▼ |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="commodity-bottom" :hidden="showFilter"> |
|
||||
<!-- 一排显示1个 --> |
|
||||
<view v-for="(items, idx) in storeList" :key="idx" v-if="arrangement == 'rank'"> |
|
||||
<view class="commodity-out" :data-id="item.id" v-for="(item, index) in storeList[idx]" :key="index" @tap="jump"> |
|
||||
<view class="commodity-box"> |
|
||||
<view class="commodity-img"> |
|
||||
<image mode="widthFix" :src="item.img"></image> |
|
||||
</view> |
|
||||
<view class="commodity-name"> |
|
||||
{{item.name}} |
|
||||
</view> |
|
||||
<view class="commodity-money"> |
|
||||
<view class="money"> |
|
||||
¥{{item.sell_price}} |
|
||||
<view class="origin-money"> |
|
||||
¥{{item.market_price}} |
|
||||
</view> |
|
||||
</view> |
|
||||
<!-- <view class="discount-tags"> |
|
||||
<span class="tags-item" v-for="(tags, index) in item.discount_tags" :key="index" >{{tags}}</span> |
|
||||
</view> --> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<!-- 一排显示一个 --> |
|
||||
<view v-for="(items, idx) in storeList" :key="idx" v-if="arrangement == 'vertical'"> |
|
||||
<view class="commodity-out-vertical" :data-id="item.id" v-for="(item, index) in storeList[idx]" :key="index" @tap="jump"> |
|
||||
<view class="img-box"> |
|
||||
<image mode="widthFix" :src="item.img"></image> |
|
||||
</view> |
|
||||
<view class="right-box"> |
|
||||
<view class="goods-name"> |
|
||||
{{item.name}} |
|
||||
</view> |
|
||||
<view class="goods-money"> |
|
||||
¥{{item.sell_price}} |
|
||||
<view class="origin-money"> |
|
||||
¥{{item.market_price}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="loadingbox" :hidden="!show"> |
|
||||
正在加载下一页数据 |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
<view class="right-filter-box" :hidden="!showFilter"> |
|
||||
|
|
||||
<view class="box"> |
|
||||
<view> |
|
||||
<view class="title"> |
|
||||
价格区间 |
|
||||
</view> |
|
||||
<view class="list"> |
|
||||
<view class="list-block"> |
|
||||
<view data-num="200-500" :class="shadows.price == '200-500' ? 'selected' : ''" @tap="checkPrice">200-500元</view> |
|
||||
</view> |
|
||||
<view class="list-block"> |
|
||||
<view data-num="501-1000" :class="shadows.price == '501-1000' ? 'selected' : ''" @tap="checkPrice">501-1000元</view> |
|
||||
</view> |
|
||||
<view class="list-block"> |
|
||||
<view data-num="1001-1500" :class="shadows.price == '1001-1500' ? 'selected' : ''" @tap="checkPrice">1001-1500元</view> |
|
||||
</view> |
|
||||
<view class="list-block"> |
|
||||
<view data-num="1501-2000" :class="shadows.price == '1501-2000' ? 'selected' : ''" @tap="checkPrice">1501-2000元</view> |
|
||||
</view> |
|
||||
<view class="list-block"> |
|
||||
<view data-num="2000-" :class="shadows.price == '2000-' ? 'selected' : ''" @tap="checkPrice">2000-元以上</view> |
|
||||
</view> |
|
||||
|
|
||||
<!-- <view class="price-inputs"> |
|
||||
<input type="number" data-type="0" bindinput="modifyPrice" /> |
|
||||
<view class="minus"> |
|
||||
- |
|
||||
</view> |
|
||||
<input type="number" data-type="1" bindinput="modifyPrice" /> |
|
||||
</view> --> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
<!-- #ifdef APP-PLUS || MP-WEIXIN --> |
|
||||
<view v-for="(item, index) in filter" :key="index"> |
|
||||
<view class="title"> |
|
||||
{{item.key}} |
|
||||
</view> |
|
||||
<view class="list"> |
|
||||
<view class="list-block" v-for="(obj, index) in item.values" :key="index"> |
|
||||
<view :class="!!selections[obj.id] ? 'selected' : ''" :data-id="obj.id" :data-type="obj" @tap="check"> |
|
||||
{{obj.text}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<!-- #endif --> |
|
||||
|
|
||||
<!-- #ifdef H5 --> |
|
||||
<view v-for="(item, index) in filter" :key="index"> |
|
||||
<view class="title"> |
|
||||
{{item.key}} |
|
||||
</view> |
|
||||
<view class="list"> |
|
||||
<view class="list-block" v-for="(obj, index) in item.values" :key="index"> |
|
||||
<view :class="!!selections[obj.id] ? 'selected' : ''" :data-id="obj.id" :data-type="obj" @tap="check(obj)"> |
|
||||
{{obj.text}} |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<!-- #endif --> |
|
||||
|
|
||||
<view class="button-box"> |
|
||||
<button type="default" @tap="cancel">取消</button> |
|
||||
<button type="primary" @tap="confirm">确定</button> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
</template> |
|
||||
<script> |
|
||||
var app = getApp(); |
|
||||
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js'; |
|
||||
import Animation from '@/common/js/animation.js'; |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
page: 1, |
|
||||
storeList: [], |
|
||||
orderBy: '', |
|
||||
sort: '', |
|
||||
c_id: '', |
|
||||
meta: '', |
|
||||
show: false, |
|
||||
showFilter: false, |
|
||||
filter: null, |
|
||||
price:{}, |
|
||||
priceCache:{}, |
|
||||
shadows: {}, |
|
||||
selections:{}, |
|
||||
arrangement:'rank',//判断当前的排列方式,是横列 还是 竖列 |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
onReachBottom() { |
|
||||
var hasMore = this.meta.pagination.total_pages > this.meta.pagination.current_page; |
|
||||
|
|
||||
if (!this.showFilter) { |
|
||||
if (hasMore) { |
|
||||
this.setData({ |
|
||||
show: true |
|
||||
}); |
|
||||
var query = { |
|
||||
sort: this.sort, |
|
||||
orderBy: this.orderBy, |
|
||||
c_id: this.c_id |
|
||||
}; |
|
||||
var page = this.meta.pagination.current_page + 1; |
|
||||
this.queryCommodityList(query, page); |
|
||||
} else { |
|
||||
wx.showToast({ |
|
||||
image: '../../../static/error.png', |
|
||||
title: '再拉也没有啦' |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
onReady() { |
|
||||
var query = { |
|
||||
sort: this.sort, |
|
||||
orderBy: this.orderBy, |
|
||||
c_id: this.c_id |
|
||||
}; |
|
||||
this.queryCommodityList(query); |
|
||||
}, |
|
||||
|
|
||||
onLoad(e) { |
|
||||
if (e.c_id) { |
|
||||
this.setData({ |
|
||||
c_id: e.c_id |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
if (e.orderBy) { |
|
||||
this.setData({ |
|
||||
orderBy: e.orderBy, |
|
||||
sort: e.sort |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
var price = { |
|
||||
min: '', |
|
||||
max: '' |
|
||||
}; |
|
||||
var shadows = { |
|
||||
attr: {}, |
|
||||
specs: {} |
|
||||
}; |
|
||||
|
|
||||
if (e.attr) { |
|
||||
e.attr.forEach(v => shadows.attr[v] = true); |
|
||||
} |
|
||||
|
|
||||
Object.keys(e).forEach(key => { |
|
||||
let ret = /^specs\[([^\]]+)]$/.exec(key); |
|
||||
|
|
||||
if (ret) { |
|
||||
let name = ret[1]; |
|
||||
shadows.specs[name] = e[key]; |
|
||||
} |
|
||||
}); |
|
||||
var priceList = ['200-500', '501-1000', '1001-1500', '1501-2000', '2000-']; |
|
||||
shadows.price = e.price || ''; |
|
||||
|
|
||||
if (!~priceList.indexOf(shadows.price)) { |
|
||||
var parts = shadows.price.split(/\s*\-\s*/); |
|
||||
price.min = parts[0] || ''; |
|
||||
price.max = parts[1] || ''; |
|
||||
} |
|
||||
|
|
||||
// this.setData({ |
|
||||
// price: price, |
|
||||
// shadows: shadows, |
|
||||
// selections: {}, |
|
||||
// priceList: priceList, |
|
||||
// priceCache: {} |
|
||||
// }); |
|
||||
|
|
||||
this.price=price; |
|
||||
this.shadows=shadows; |
|
||||
this.selections={}; |
|
||||
this.priceList=priceList; |
|
||||
this.priceCache={}; |
|
||||
|
|
||||
|
|
||||
}, |
|
||||
|
|
||||
onShareAppMessage() { |
|
||||
var url = decodeURIComponent(getUrl()); |
|
||||
return { |
|
||||
title: '商品列表', |
|
||||
path: '/' + url |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
methods: { |
|
||||
//点击切换排列方式 |
|
||||
changeRange(){ |
|
||||
if(this.arrangement == 'rank'){ |
|
||||
this.arrangement = 'vertical' |
|
||||
} else if(this.arrangement == 'vertical'){ |
|
||||
this.arrangement = 'rank' |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 价格点击 |
|
||||
checkPrice(e) { |
|
||||
var num = e.currentTarget.dataset.num; |
|
||||
if (this.shadows.price == num) { |
|
||||
console.log("gaehgae"); |
|
||||
this.setData({ |
|
||||
'priceCache.value': num |
|
||||
}); |
|
||||
|
|
||||
if (this.priceCache.min !== undefined) { |
|
||||
this.setData({ |
|
||||
'price.min': this.priceCache.min |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
if (this.priceCache.max !== undefined) { |
|
||||
this.setData({ |
|
||||
'price.min': this.priceCache.max |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
// this.setData({ |
|
||||
// 'shadows.price': '' |
|
||||
// }); |
|
||||
|
|
||||
this.shadows={price:''} |
|
||||
|
|
||||
|
|
||||
} else { |
|
||||
console.log(46846846846846); |
|
||||
|
|
||||
if (this.price.min !== '') { |
|
||||
// this.setData({ |
|
||||
// 'priceCache.min': this.priceCache.min |
|
||||
// }); |
|
||||
|
|
||||
this.priceCache.min=this.priceCache.min; |
|
||||
} |
|
||||
|
|
||||
if (this.price.max !== '') { |
|
||||
// this.setData({ |
|
||||
// 'priceCache.max': this.priceCache.max |
|
||||
// }); |
|
||||
this.priceCache.max=this.priceCache.max; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
// this.setData({ |
|
||||
// 'price.min': '', |
|
||||
// 'price.max': '', |
|
||||
// 'shadows.price': num |
|
||||
// }); |
|
||||
// |
|
||||
this.price.min=''; |
|
||||
this.price.max=''; |
|
||||
this.shadows.price=num; |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 价格输入 |
|
||||
modifyPrice(e) { |
|
||||
var type = e.currentTarget.dataset.type; |
|
||||
var val = this.price[type ? 'max' : 'min']; |
|
||||
val = parseFloat(val); |
|
||||
if (isNaN(val)) val = ''; |
|
||||
|
|
||||
if (this.price[type] == 'max') { |
|
||||
// this.setData({ |
|
||||
// 'price.max': val |
|
||||
// }); |
|
||||
this.price={max:val}; |
|
||||
|
|
||||
} else { |
|
||||
// this.setData({ |
|
||||
// 'price.min': val |
|
||||
// }); |
|
||||
this.price={min:val}; |
|
||||
} |
|
||||
// this.setData({ |
|
||||
// 'shadows.price': '' |
|
||||
// }); |
|
||||
// |
|
||||
this.shadows={price:''} |
|
||||
}, |
|
||||
|
|
||||
// 点击筛选条件 |
|
||||
// #ifdef APP-PLUS || MP-WEIXIN |
|
||||
check(e) { |
|
||||
var type = e.currentTarget.dataset.type; |
|
||||
|
|
||||
var id = type.id; |
|
||||
var selections = Object.assign({}, this.selections); |
|
||||
|
|
||||
if (!selections[id]) { |
|
||||
for (let k in selections) { |
|
||||
if (selections.hasOwnProperty(k)) { |
|
||||
let o = selections[k] |
|
||||
if (o.type === type.type && o.key === type.key) { |
|
||||
delete selections[k]; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
selections[id] = { |
|
||||
key: type.key, |
|
||||
type: type.type, |
|
||||
value: type.value, |
|
||||
field: type.field |
|
||||
} |
|
||||
} else { |
|
||||
delete selections[id]; |
|
||||
} |
|
||||
|
|
||||
this.setData({ |
|
||||
selections: Object.assign({}, selections) |
|
||||
}) |
|
||||
}, |
|
||||
// #endif |
|
||||
|
|
||||
// #ifdef H5 |
|
||||
check(e) { |
|
||||
var type = e; |
|
||||
var id = type.id; |
|
||||
var selections = Object.assign({}, this.selections); |
|
||||
|
|
||||
if (!selections[id]) { |
|
||||
for (let k in selections) { |
|
||||
if (selections.hasOwnProperty(k)) { |
|
||||
let o = selections[k]; |
|
||||
|
|
||||
if (o.type === type.type && o.key === type.key) { |
|
||||
delete selections[k]; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
selections[id] = { |
|
||||
key: type.key, |
|
||||
type: type.type, |
|
||||
value: type.value, |
|
||||
field: type.field |
|
||||
}; |
|
||||
} else { |
|
||||
delete selections[id]; |
|
||||
} |
|
||||
|
|
||||
this.setData({ |
|
||||
selections: Object.assign({}, selections) |
|
||||
}); |
|
||||
|
|
||||
/* this.selections=Object.assign({}, selections); */ |
|
||||
}, |
|
||||
// #endif |
|
||||
|
|
||||
|
|
||||
// 取消 |
|
||||
cancel() { |
|
||||
|
|
||||
// var animation = new Animation('show'); |
|
||||
// animation.right().then(() => { |
|
||||
this.setData({ |
|
||||
showFilter: false, |
|
||||
selections: {}, |
|
||||
shadows: {} |
|
||||
}); |
|
||||
// }); |
|
||||
|
|
||||
|
|
||||
}, |
|
||||
|
|
||||
// 确定 |
|
||||
confirm() { |
|
||||
var attr = [], |
|
||||
specs = {}; |
|
||||
|
|
||||
for (let k in this.selections) { |
|
||||
if (this.selections.hasOwnProperty(k)) { |
|
||||
let o = this.selections[k]; |
|
||||
|
|
||||
if (o.type === 'attr') { |
|
||||
attr.push(o.value); |
|
||||
} else { |
|
||||
specs['specs[' + o.field + ']'] = o.value; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
attr = attr.join(','); |
|
||||
var price = this.shadows.price; |
|
||||
|
|
||||
if (attr.length) { |
|
||||
var query = Object.assign({}, { |
|
||||
attr |
|
||||
}, { |
|
||||
c_id: this.c_id, |
|
||||
orderBy: this.orderBy, |
|
||||
sort: this.sort, |
|
||||
price: price |
|
||||
}, specs); |
|
||||
} else { |
|
||||
var query = Object.assign({}, { |
|
||||
c_id: this.c_id, |
|
||||
orderBy: this.orderBy, |
|
||||
sort: this.sort, |
|
||||
price: price |
|
||||
}, specs); |
|
||||
} |
|
||||
|
|
||||
console.log(query); |
|
||||
this.queryCommodityList(query); |
|
||||
}, |
|
||||
|
|
||||
changeOrderBy(e) { |
|
||||
var field = e.currentTarget.dataset.type; |
|
||||
|
|
||||
if (this.orderBy === field) { |
|
||||
this.setData({ |
|
||||
sort: this.sort === 'desc' ? 'asc' : 'desc' |
|
||||
}); |
|
||||
} else { |
|
||||
this.setData({ |
|
||||
orderBy: field, |
|
||||
sort: 'desc' |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
wx.redirectTo({ |
|
||||
url: '/pages/store/list/list?orderBy=' + this.orderBy + '&sort=' + this.sort + '&c_id=' + this.c_id |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
jump(e) { |
|
||||
var id = e.currentTarget.dataset.id; |
|
||||
wx.navigateTo({ |
|
||||
url: '/pages/store/detail/detail?id=' + id |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
classF() { |
|
||||
wx.switchTab({ |
|
||||
url: '/pages/index/classification/classification' |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
search() { |
|
||||
wx.navigateTo({ |
|
||||
url: '/pages/store/search/search' |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
cart() { |
|
||||
wx.switchTab({ |
|
||||
url: '/pages/store/cart/cart' |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
showFilterF() { |
|
||||
if (this.c_id) { |
|
||||
this.setData({ |
|
||||
showFilter: true |
|
||||
}); |
|
||||
// var animation = new Animation('show'); |
|
||||
// animation.Pullleft(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
move() {}, |
|
||||
|
|
||||
loadMore() { |
|
||||
this.$http.get({ |
|
||||
api: "api/store/list?page=" + (this.page + 1) |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 查询商品列表 |
|
||||
queryCommodityList(query = {}, page = 1) { |
|
||||
var token = this.$cookieStorage.get('user_token') || ''; |
|
||||
var params = Object.assign({}, query, { |
|
||||
page |
|
||||
}); |
|
||||
wx.showLoading({ |
|
||||
title: '加载中', |
|
||||
mask: true |
|
||||
}); |
|
||||
this.$http.get({ |
|
||||
api: 'api/store/list', |
|
||||
data: params, |
|
||||
header: { |
|
||||
Authorization: token |
|
||||
} |
|
||||
}).then(res => { |
|
||||
if (res.statusCode == 200) { |
|
||||
res = res.data; |
|
||||
|
|
||||
if (res.status) { |
|
||||
// 商品列表页赋值 |
|
||||
this.setData({ |
|
||||
[`storeList.${page - 1}`]: res.data, |
|
||||
meta: res.meta |
|
||||
}); // 右侧筛选赋值 |
|
||||
|
|
||||
|
|
||||
if (res.meta && res.meta.filter) { |
|
||||
if (Array.isArray(res.meta.filter)) { |
|
||||
this.setData({ |
|
||||
filter: null |
|
||||
}); |
|
||||
} else { |
|
||||
let filter = res.meta.filter; |
|
||||
let list = []; |
|
||||
|
|
||||
if (filter.attr && filter.attr.keys) { |
|
||||
let type = 'attr'; |
|
||||
filter.attr.keys.forEach(key => { |
|
||||
let arr = []; |
|
||||
let arrText = []; |
|
||||
|
|
||||
for (let attr in filter.attr.values[key]) { |
|
||||
!!attr && arrText.push(filter.attr.values[key][attr]); |
|
||||
!!attr && arr.push(attr); |
|
||||
} |
|
||||
|
|
||||
list.push({ |
|
||||
key, |
|
||||
values: arr.map((v, index) => { |
|
||||
return { |
|
||||
id: [type, key, v].join('-'), |
|
||||
key, |
|
||||
type, |
|
||||
value: v, |
|
||||
text: arrText[index] |
|
||||
}; |
|
||||
}) |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
if (filter.specs && filter.specs.keys) { |
|
||||
let type = 'specs'; |
|
||||
filter.specs.keys.forEach(key => { |
|
||||
let entries = key.split(':'); |
|
||||
let field = entries[1]; |
|
||||
key = entries[0]; |
|
||||
var newKey = key + ':' + field; |
|
||||
let specs = []; |
|
||||
let specsText = []; |
|
||||
|
|
||||
for (let spec in filter.specs.values[newKey]) { |
|
||||
!!spec && specsText.push(filter.specs.values[newKey][spec]); |
|
||||
!!spec && specs.push(spec); |
|
||||
} |
|
||||
|
|
||||
list.push({ |
|
||||
key, |
|
||||
values: specs.map((v, index) => { |
|
||||
return { |
|
||||
id: [type, key, v].join('-'), |
|
||||
key, |
|
||||
type, |
|
||||
field, |
|
||||
value: v, |
|
||||
text: specsText[index] |
|
||||
}; |
|
||||
}) |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
this.setData({ |
|
||||
filter: list |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
this.setData({ |
|
||||
showFilter: false |
|
||||
}); |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
title: '', |
|
||||
content: res.message, |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
} else { |
|
||||
wx.showModal({ |
|
||||
title: '', |
|
||||
content: "请求失败", |
|
||||
showCancel: false |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
this.setData({ |
|
||||
show: false |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
}).catch(rej => { |
|
||||
wx.showModal({ |
|
||||
title: '', |
|
||||
content: '请求失败', |
|
||||
success: res => { |
|
||||
if (res.confirm) {} |
|
||||
} |
|
||||
}); |
|
||||
this.setData({ |
|
||||
show: false |
|
||||
}); |
|
||||
wx.hideLoading(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
setData: function (obj) { |
|
||||
let that = this; |
|
||||
let keys = []; |
|
||||
let val, data; |
|
||||
Object.keys(obj).forEach(function (key) { |
|
||||
keys = key.split('.'); |
|
||||
val = obj[key]; |
|
||||
data = that.$data; |
|
||||
keys.forEach(function (key2, index) { |
|
||||
if (index + 1 == keys.length) { |
|
||||
that.$set(data, key2, val); |
|
||||
} else { |
|
||||
if (!data[key2]) { |
|
||||
that.$set(data, key2, {}); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
data = data[key2]; |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
computed: {}, |
|
||||
watch: {} |
|
||||
}; |
|
||||
</script> |
|
||||
<style rel="stylesheet/less" lang="less"> |
|
||||
@import "list"; |
|
||||
</style> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue