Browse Source

解决精度丢失问题,删除无用页面和组件

master
邓平艺 4 years ago
parent
commit
fca8c68aa4
  1. 1
      common/js/bigc.js
  2. 1
      common/js/zh-address-parse.min.js
  3. 141
      components/birthday/birthday.less
  4. 106
      components/birthday/birthday.vue
  5. 32
      pages.json
  6. 22
      pages/address/add/add.vue
  7. 31
      pages/index/author/author.less
  8. 190
      pages/index/author/author.vue
  9. 244
      pages/index/index/index.vue
  10. 311
      pages/order/comment/comment.less
  11. 446
      pages/order/comment/comment.vue
  12. 15
      pages/order/confirm/confirm.vue
  13. 212
      pages/order/evaluate/evaluate.less
  14. 351
      pages/order/evaluate/evaluate.vue
  15. 2
      pages/order/index/onlineorder.vue
  16. 2
      pages/order/newdetail/newdetail.vue
  17. 7
      pages/store/cart/cart.vue
  18. 75
      pages/store/comment/comment.less
  19. 163
      pages/store/comment/comment.vue
  20. 3
      pages/store/invoiceDetail/invoiceDetail.less
  21. 196
      pages/store/invoiceDetail/invoiceDetail.vue
  22. 304
      pages/store/list/list.less
  23. 755
      pages/store/list/list.vue
  24. 4
      pages/user/my/center.vue

1
common/js/bigc.js
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

141
components/birthday/birthday.less

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

106
components/birthday/birthday.vue

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

32
pages.json

@ -54,20 +54,6 @@
"navigationBarTitleText":"优惠券"
}
},
{
"path": "pages/store/list/list",
"style": {
"navigationBarTitleText": "商品列表",
"navigationStyle":"custom"
}
},
{
"path": "pages/store/comment/comment",
"style": {
"navigationBarTitleText": "商品评论" ,
"navigationStyle":"custom"
}
},
{
"path": "pages/store/cart/cart",
"style": {
@ -166,12 +152,6 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/index/author/author",
"style": {
"navigationBarTitleText": "iBrand社交新零售"
}
},
{
"path": "pages/user/register/register",
"style": {
@ -204,18 +184,6 @@
},
{ "path": "pages/address/list/list", "style": { "navigationBarTitleText": "收货地址列表",
"navigationStyle":"custom" } },
{
"path": "pages/order/evaluate/evaluate",
"style": {
"navigationBarTitleText": "评价"
}
},
{
"path": "pages/order/comment/comment",
"style": {
"navigationBarTitleText": "评价"
}
},
{
"path": "pages/recharge/balance/balance",
"style": {

22
pages/address/add/add.vue

@ -111,17 +111,6 @@
<script>
import {pageLogin, getUrl,config,is} from '@/common/js/utils.js';
// #ifdef H5
import wPicker from "@/components/w-picker/w-picker.vue";
// #endif
// #ifdef APP-PLUS || H5
import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue';
import provinceData from '@/components/mpvue-citypicker/city-data/province.js';
import cityData from '@/components/mpvue-citypicker/city-data/city.js';
// #endif
import AddressParse from '@/common/js/zh-address-parse.min.js'
export default {
data() {
return {
@ -175,17 +164,6 @@ export default {
page_title: ''
};
},
components:{
// #ifdef H5
/* wPicker */
// #endif
// #ifdef APP-PLUS || H5
mpvueCityPicker
// #endif
},
onShow() {// let app =getApp();
// app.isBirthday().then(()=>{

31
pages/index/author/author.less

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

190
pages/index/author/author.vue

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

244
pages/index/index/index.vue

@ -70,243 +70,6 @@
</view>
</block>
<view style="height: 20rpx;"></view>
<!-- <view class="author">
<image mode="widthFix" src="https://cdn.guojiang.club/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20200402115441.png"></image>
</view> -->
<!-- 生日有礼 -->
<view class="is_birthday" v-if="is_showBirth">
<!-- 生日有礼 -->
<birthday :gift-data="giftData" @close="changeBirthday"></birthday>
</view>
<!--新人礼小图标-->
<view class="new-gift" @tap="showModal" v-if="!isLogin && noLoginGift">
<image src="https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/new-gift.png" />
</view>
<view class="index-gift-box" v-if="showNoGift">
<view class="mask">
</view>
<view class="box">
<view class="title">
<!--这是优惠券头头-->
<view class="title-info">
<!--领取成功状态-->
<view class="new-success">
<view class="text">
{{noLoginGift.title}}
</view>
<div class="tips">
数量有限先到先得
</div>
</view>
</view>
<image src="https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/X.png" @tap="close"/>
<!--<i class="iconfont icon-cha-"></i>-->
</view>
<view class="coupon-list">
<!--积分-->
<view class="item point" v-if="noLoginGift.point">
<view class="left">
<view class="lable">
赠送积分
</view>
</view>
<view class="right">
{{noLoginGift.point}}
</view>
</view>
<!--优惠券-->
<view class="item" v-for="(item,index) in noLoginGift.gift" :key="index">
<view class="left">
<view class="lable">
{{item.coupon.title}}
</view>
<view class="time">
{{item.coupon.usestart_at}} - {{item.coupon.useend_at}}
</view>
</view>
<view class="right">
{{item.coupon.label}}
</view>
</view>
</view>
<!--@click="login"-->
<view class="buttom" @tap="login">
<span>我知道了</span>
</view>
</view>
</view>
<view class="index-gift-box" v-if="showGift">
<view class="mask">
</view>
<view class="box">
<view class="title">
<!--这是优惠券头头-->
<view class="title-info">
<!--老用户-->
<!--v-if="!loginGift.activity.is_new_user"-->
<view class="new-success" v-if="!loginGift.activity.is_new_user">
<view class="text">
仅限新人领取
</view>
<view class="tips">
你可是老朋友哦
</view>
</view>
<!--抢光了-->
<!--v-if="loginGift.activity.is_new_user && !loginGift.activity.receive_coupon_num && !loginGift.activity.point_status"-->
<view class="new-success" v-if="(loginGift.activity.is_new_user)&&(!loginGift.activity.receive_coupon_num)&&(!loginGift.activity.point_status)">
<view class="text">
抢光了
</view>
<view class="tips">
祝你下次好运加油哦
</view>
</view>
<!--领取成功-->
<!--v-if="(loginGift.activity.is_new_user && loginGift.activity.receive_coupon_num) || (loginGift.activity.is_new_user && loginGift.activity.point_status)"-->
<view class="new-success" v-if="(loginGift.activity.is_new_user && loginGift.activity.receive_coupon_num) || (loginGift.activity.is_new_user && loginGift.activity.point_status)" >
<view class="text">
领取成功
</view>
<view class="tips">
<!--已放入你的账户-->
已放入你的账户 {{loginGift.user.mobile}}
</view>
</view>
</view>
<image src="https://ibrand-miniprogram.oss-cn-hangzhou.aliyuncs.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/X.png" @tap="closeGift"/>
<!--@click="closeGift"-->
<!--<i class="iconfont icon-cha-" ></i>-->
</view>
<!--老用户-->
<!--v-if="!loginGift.activity.is_new_user"-->
<view class="coupon-list" v-if="!loginGift.activity.is_new_user">
<!--积分-->
<!--v-if="loginGift.activity.point_status"-->
<view class="item old point" v-if="loginGift.activity.point_status">
<view class="left">
<view class="lable">
<!--赠送积分-->
赠送 {{loginGift.activity.point}} 积分
</view>
</view>
<view class="right">
</view>
</view>
<!--优惠券-->
<!--v-for="item in loginGift.activity.gift"-->
<view class="item old" v-for="(item,index) in loginGift.activity.gift" :key="index">
<div class="left">
<div class="lable">
<!--111-->
{{item.coupon.title}}
</div>
<view class="time">
<!--222-->
{{item.coupon.usestart_at}} - {{item.coupon.useend_at}}
</view>
</div>
<div class="right">
<!--333-->
{{item.coupon.label}}
</div>
</view>
</view>
<!--抢光了-->
<!--v-if="loginGift.activity.is_new_user && !loginGift.activity.receive_coupon_num && !loginGift.activity.point_status"-->
<view class="coupon-list" v-if="(loginGift.activity.is_new_user) && (!loginGift.activity.receive_coupon_num) && (!loginGift.activity.point_status)">
<!--积分-->
<!--v-if="loginGift.activity.point_status"-->
<view class="item point old" v-if="loginGift.activity.point_status">
<view class="left">
<view class="lable">
<!--赠送积分-->
赠送 {{loginGift.activity.point}} 积分
</view>
</view>
<view class="right">
</view>
</view>
<!--优惠券-->
<!--v-for="item in loginGift.activity.gift"-->
<view class="item old" v-for="(item,index) in loginGift.activity.gift" :key="index">
<view class="left">
<view class="lable">
<!--111-->
{{item.coupon.title}}
</view>
<div class="time">
<!--222-->
{{item.coupon.usestart_at}} - {{item.coupon.useend_at}}
</div>
</view>
<div class="right">
<!--333-->
{{item.coupon.label}}
</div>
</view>
</view>
<!--领取成功-->
<!--v-if="(loginGift.activity.is_new_user && loginGift.activity.receive_coupon_num) || (loginGift.activity.is_new_user && loginGift.activity.point_status)"-->
<view class="coupon-list" v-if="(loginGift.activity.is_new_user && loginGift.activity.receive_coupon_num) || (loginGift.activity.is_new_user && loginGift.activity.point_status)">
<!--积分-->
<!--v-if="loginGift.activity.point_status"-->
<view class="item point" v-if="loginGift.activity.point_status">
<view class="left">
<view class="lable">
<!--2331-->
赠送 {{loginGift.activity.point}} 积分
</view>
</view>
<view class="right">
</view>
</view>
<!--优惠券-->
<!--v-for="item in loginGift.activity.gift" v-show="item.is_receive_coupon"-->
<view class="item" v-for="(item,index) in loginGift.activity.gift" :key="index" v-if="item.is_receive_coupon">
<view class="left">
<view class="lable">
<!--222-->
{{item.coupon.title}}
</view>
<view class="time">
<!--333-->
{{item.coupon.usestart_at}} - {{item.coupon.useend_at}}
</view>
</view>
<view class="right">
<!--444-->
{{item.coupon.label}}
</view>
</view>
</view>
<!--@click="closeGift" -->
<view class="buttom" @tap="closeGift">
<span>我知道了</span>
</view>
</view>
</view>
</view>
<!-- 悬浮购物车入口 -->
<view class="fixed-right">
@ -321,7 +84,7 @@
<view class="angle-mark" v-else>99+</view>
</view>
</view>
<!-- ad广告弹出组件 TODO 暂时先注释 -->
<!-- ad广告弹出组件 -->
<lf-ad-modal :value.sync="show_ad" :list="ad_modal_list"></lf-ad-modal>
<!-- 回到顶部组件 -->
<u-back-top :scrollTop="pageScrollTop" :icon-style="{color: '#fff', 'font-size': '50rpx'}" tips="TOP"></u-back-top>
@ -334,7 +97,6 @@
import {pageLogin, getUrl,config,isBirthday,autoLogin} from '@/common/js/utils.js';
import indexBanner from '@/components/index-banner/index-banner';
import indexNav from "@/components/index-nav/index-nav";
import birthday from '@/components/birthday/birthday.vue';
import lfNav from '@/components/lf-nav/lf-nav.vue';
import lfTabbar from '@/components/lf-tabbar/lf-tabbar.vue';
import lfAdModal from '@/components/lf-adModal/lf-adModal.vue';
@ -345,6 +107,7 @@
import lfMultiColumnAd from '@/components/lf-multiColumnAd/lf-multiColumnAd.vue';
import lfSeckill from '@/components/lf-seckill/lf-seckill.vue';
var app = getApp();
export default {
data() {
return {
@ -393,7 +156,6 @@
components: {
indexBanner,
indexNav,
birthday,
lfNav,
lfTabbar,
lfAdModal,
@ -447,7 +209,7 @@
//
onLoad(e) {
// 广 todo
// 广
// if(app.globalData.app_first_full){
// getApp().globalData.app_first_full = false;
// this.$url('/pages/index/openScreenAd/openScreenAd', {type: 'launch'});

311
pages/order/comment/comment.less

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

446
pages/order/comment/comment.vue

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

15
pages/order/confirm/confirm.vue

@ -93,7 +93,8 @@
<view class="fixed-content">
<view class="lf-font-24 lf-color-777">{{ order_detail.order.count }}</view>
<view class="lf-flex">
<view class="lf-font-32 lf-color-primary" style="max-width: 400rpx;">合计 ¥{{ order_detail.order.total_yuan }}</view>
<!-- <view class="lf-font-32 lf-color-primary" style="max-width: 400rpx;">合计 ¥{{ order_detail.order.total_yuan }}</view> -->
<view class="lf-font-32 lf-color-primary" style="max-width: 400rpx;">合计 ¥{{ totalPrice }}</view>
<view class="confirm-btn" hover-class="lf-opacity" @click="confirm">提交订单</view>
</view>
</view>
@ -153,6 +154,7 @@
</template>
<script>
import Bigc from '@/common/js/bigc.js';
export default {
data(){
return {
@ -177,6 +179,17 @@
return '暂无可用优惠券';
}
}
},
totalPrice(){
let order = this.order_detail.order;
if(!this.$isRight(order)){
return 0;
}
if(this.mode){
return order.total_yuan;
}else{
return new Bigc(order.total_yuan).plus(order.payable_freight);
}
}
},
onLoad(){

212
pages/order/evaluate/evaluate.less

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

351
pages/order/evaluate/evaluate.vue

@ -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) {
// tempFilePathimgsrc
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>

2
pages/order/index/onlineorder.vue

@ -25,7 +25,7 @@
</view>
<view class="lf-m-t-30">
<text class="lf-iconfont icon-Group- lf-font-28"></text>
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">{{item2.from}}</text>
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">{{item2.brand.name}}</text>
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text>
</view>
<view v-for="(i,index3) of item2.items" :key="index3">

2
pages/order/newdetail/newdetail.vue

@ -49,7 +49,7 @@
<view class="card goods">
<view>
<text class="lf-iconfont icon-Group- lf-font-30"></text>
<text class="shop-name">{{order_details.from}}</text>
<text class="shop-name">{{order_details.brand.name}}</text>
<text class="lf-iconfont icon-xiangyou lf-font-24"></text>
</view>
<view class="lf-flex lf-m-t-20" v-for="(item,index) of order_details.items" :key="index">

7
pages/store/cart/cart.vue

@ -60,6 +60,7 @@
<script>
import lfSwipeAction from '@/components/lf-swipeAction/lf-swipeAction.vue';
import Bigc from '@/common/js/bigc.js';
export default {
components: {
lfSwipeAction
@ -90,13 +91,13 @@
deep: true,
handler: function(val){
let total_count = 0;
let total_price = 0;
// TODO 使
let total_price = new Bigc(0);
val.map(s => {
s.goods.map(g => {
if(g.checked){
total_count++;
total_price += (g.price * g.qty)
let itemPrice = new Bigc(g.price).times(g.qty);
total_price = total_price.plus(itemPrice);
}
})
})

75
pages/store/comment/comment.less

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

163
pages/store/comment/comment.vue

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

3
pages/store/invoiceDetail/invoiceDetail.less

@ -1,3 +0,0 @@
.invoice_detail{
}

196
pages/store/invoiceDetail/invoiceDetail.vue

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

304
pages/store/list/list.less

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

755
pages/store/list/list.vue

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

4
pages/user/my/center.vue

@ -44,10 +44,10 @@
<text class="lf-font-48">VIP</text>
<text class="lf-font-30 lf-m-l-10">{{ centerInfo.userLevel.name }}</text>
</view>
<view class="lf-font-28" style="color: #15716E;">卡号: 666666</view>
<!-- <view class="lf-font-28" style="color: #15716E;">卡号: 666666</view> -->
</view>
<view class="card-tag">
会员权益
会员服务
</view>
</view>
</view>

Loading…
Cancel
Save