Browse Source

Merge branch 'landong' of https://git.lotus-wallet.com/Loki/zsw-farm-bxg into sxx

home_hotList
whyneedname 2 years ago
parent
commit
be9c8443aa
  1. 3
      pages.json
  2. 145
      pages/shop/Evaluations/EvaluationDetail/index.vue
  3. 317
      pages/shop/GoodsFoot/index.vue
  4. 45
      pages/shop/brands/brandAll/index.vue

3
pages.json

@ -103,7 +103,8 @@
{
"path": "pages/shop/GoodsFoot/index",
"style": {
"navigationBarTitleText": "我的足迹"
"navigationBarTitleText": "我的足迹",
"navigationStyle": "custom"
}
},
{

145
pages/shop/Evaluations/EvaluationDetail/index.vue

@ -51,7 +51,7 @@
</view>
</view>
<view class="wrapper">
<!-- <view class="wrapper">
<view class="item" v-if="info.summary">
<view class="title-box acea-row row-middle">
<view class="num">1</view>
@ -93,6 +93,17 @@
</view>
</view>
</view>
</view> -->
<view class="wrapper-box">
<view class="item" v-for="(item,index) in editableTabs" :key="index">
<view class="title-box acea-row row-middle">
<view class="num">{{index+1}}</view>
<view class="">{{item.content}}</view>
</view>
<mp-html id="article" :setTitle="false" :lazy-load="true" :copy-link="false" :tag-style="tagStyle"
:content="item.configuration"/>
</view>
</view>
<view :style="addBottom?'height: 162rpx;':'height: 122rpx;'"></view>
@ -113,9 +124,6 @@
</view>
<view class="btn" @click="goGoodsDetail">立即购买</view>
</view>
</view>
</template>
@ -131,6 +139,11 @@
info: {},
feelCurrent: 0,
accessibilityCurrent: 0,
editableTabs:[],
tagStyle: {
p: 'text-indent:2em;font-family: PingFang SC;font-size:28rpx;text-indent: 42rpx;',
img: 'padding:0;margin:0;font-size:0;display:block;'
}
};
},
onLoad() {
@ -144,8 +157,6 @@
}
},
methods: {
getCollection: function() {
let param={}
param.id=this.id
@ -167,6 +178,7 @@
getEvaluationDetail(id).then(res => {
this.info = res.data;
this.isCollect=this.info.isCollect;
this.$set(this,'editableTabs',res.data.editableTabs)
uni.hideLoading();
})
},
@ -325,7 +337,85 @@
}
}
.wrapper {
// .wrapper {
// margin: 20rpx 32rpx;
// padding: 16rpx 24rpx;
// width: 686rpx;
// background: #F5F6F8;
// box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0,0,0,0.15);
// border-radius: 16rpx;
// .item {
// padding-bottom: 22rpx;
// .title-box {
// font-size: 30rpx;
// font-family: SourceHanSansSCVF;
// font-weight: 600;
// color: #3A3A3C;
// line-height: 23px;
// .num {
// width: 34rpx;
// height: 34rpx;
// border-radius: 50%;
// background: #2DB5AE;
// font-size: 20rpx;
// font-family: PingFang SC;
// font-weight: 600;
// color: #FFFFFF;
// line-height: 34rpx;
// text-align: center;
// margin-right: 8rpx;
// }
// }
// .info-text {
// margin-bottom: 24rpx;
// font-size: 24rpx;
// font-family: PingFang SC;
// font-weight: 500;
// color: #3A3A3C;
// line-height: 32rpx;
// text-indent: 42rpx;
// }
// .images-box {
// padding-bottom: 24rpx;
// position: relative;
// swiper {
// width: 638rpx;
// height: 360rpx;
// border-radius: 16rpx;
// overflow: hidden;
// swiper-item {
// border-radius: 16rpx;
// image {
// width: 638rpx;
// height: 360rpx;
// border-radius: 16rpx;
// }
// }
// }
// .dot-box {
// position: absolute;
// bottom: 40rpx;
// left: 50%;
// transform: translateX(-50%);
// .dot {
// width: 8rpx;
// height: 8rpx;
// background: #FFFFFF;
// border-radius: 6rpx;
// margin: 0rpx 8rpx;
// transition: width .5s cubic-bezier(.18,.89,.17,.88);
// }
// .on {
// width: 36rpx;
// background: #2DB5AE;
// transition: width .5s cubic-bezier(.18,.89,.17,.88);
// }
// }
// }
// }
// }
.wrapper-box {
margin: 20rpx 32rpx;
padding: 16rpx 24rpx;
width: 686rpx;
@ -335,6 +425,7 @@
.item {
padding-bottom: 22rpx;
.title-box {
// padding: 0 30rpx;
font-size: 30rpx;
font-family: SourceHanSansSCVF;
font-weight: 600;
@ -363,46 +454,12 @@
line-height: 32rpx;
text-indent: 42rpx;
}
.images-box {
padding-bottom: 24rpx;
position: relative;
swiper {
width: 638rpx;
height: 360rpx;
border-radius: 16rpx;
overflow: hidden;
swiper-item {
border-radius: 16rpx;
image {
width: 638rpx;
height: 360rpx;
border-radius: 16rpx;
}
}
}
.dot-box {
position: absolute;
bottom: 40rpx;
left: 50%;
transform: translateX(-50%);
.dot {
width: 8rpx;
height: 8rpx;
background: #FFFFFF;
border-radius: 6rpx;
margin: 0rpx 8rpx;
transition: width .5s cubic-bezier(.18,.89,.17,.88);
}
.on {
width: 36rpx;
background: #2DB5AE;
transition: width .5s cubic-bezier(.18,.89,.17,.88);
}
}
}
}
}
.footer {
position: fixed;
bottom: 0;

317
pages/shop/GoodsFoot/index.vue

@ -1,5 +1,5 @@
<template>
<view ref="container">
<!-- <view ref="container">
<view class="collectionGoods" v-if="collectProductList.length > 0">
<view class="item acea-row row-between-wrapper" v-for="(item, collectProductListIndex) in collectProductList" :key="collectProductListIndex" @click="goGoodsCon(item)">
<view class="pictrue">
@ -22,80 +22,247 @@
</view>
<Recommend></Recommend>
</view>
</view>
</view> -->
<view>
<view class="header">
<cu-custom :isBack="true" :isCenter="true">
<block slot="backText">
<view class="backImg">
<image src="@/static/images/back-btn.png" mode=""></image>
</view>
</block>
<block slot="content">
<view class="tab-title">我的足迹</view>
</block>
</cu-custom>
</view>
<view class="content-box">
<view class="item-box" v-for="(item, collectProductListIndex) in collectProductList"
:key="collectProductListIndex" :data-index="collectProductListIndex" @touchstart="drawStart"
@touchmove="drawMove" @touchend="drawEnd" :style="'right:' + item.right + 'rpx'">
<view class="acea-row" @click="goGoodsCon(item)">
<image class="img" :src="item.image" mode=""></image>
<view class="right-box acea-row row-column-between row-top">
<view class="title-top">{{ item.storeName }}</view>
<view class="pic" v-if="item.isIntegral == 1">{{ item.costPrice }}积分</view>
<view class="pic" v-else>{{ item.price }}</view>
</view>
</view>
<view class="delete" :style="item.right?'right: -122rpx;':''" @click="delCollection(collectProductListIndex)">删除</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
<view class="noCommodity" style="background-color:#fff;" v-if="collectProductList.length < 1 && page > 1">
<view class="noPictrue">
<image :src="`${$VUE_APP_RESOURCES_URL}/images/noCollection.png`" class="image" />
</view>
</view>
</view>
<Recommend></Recommend>
</view>
</template>
<script>
import Recommend from '@/components/Recommend'
import { getCollectUser, getCollectDel } from '@/api/user'
import Loading from '@/components/Loading'
export default {
name: 'GoodsFoot',
components: {
Recommend,
Loading,
},
props: {},
data: function() {
return {
page: 1,
limit: 20,
type: 'foot',
collectProductList: [],
loadTitle: '',
loading: false,
loadend: false,
}
},
mounted: function() {
this.get_user_collect_product()
},
onReachBottom() {
!this.loading && this.get_user_collect_product()
},
methods: {
goGoodsCon(item) {
if (item.isIntegral == 1) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: { id: item.pid },
})
} else {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: { id: item.pid },
})
}
},
get_user_collect_product: function() {
let that = this
if (that.loading) return //false
if (that.loadend) return //false
that.loading = true
getCollectUser(that.page, that.limit, that.type).then(res => {
that.loading = false
//apply();js;
that.collectProductList.push.apply(that.collectProductList, res.data)
that.loadend = res.data.length < that.limit //
that.page = that.page + 1
})
},
//
delCollection: function(index) {
let that = this,
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category
getCollectDel(id, category).then(function() {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1)
that.$set(that, 'collectProductList', that.collectProductList)
},
})
})
},
},
}
import Loading from '@/components/Loading'
import Recommend from '@/components/Recommend'
import {
getCollectUser,
getCollectDel
} from '@/api/user'
export default {
name: 'GoodsFoot',
components: {
Recommend,
Loading,
},
props: {},
data: function() {
return {
page: 1,
limit: 20,
type: 'foot',
collectProductList: [],
loadTitle: '',
loading: false,
loadend: false,
startX: 0,
delBtnWidth: 154
}
},
mounted: function() {
this.get_user_collect_product()
},
onReachBottom() {
!this.loading && this.get_user_collect_product()
},
methods: {
goGoodsCon(item) {
if (item.isIntegral == 1) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.pid
},
})
} else {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.pid
},
})
}
},
get_user_collect_product: function() {
let that = this
if (that.loading) return //false
if (that.loadend) return //false
that.loading = true
getCollectUser(that.page, that.limit, that.type).then(res => {
that.loading = false
//apply();js;
res.data.forEach(val => {
val.right = 0;
})
that.collectProductList.push.apply(that.collectProductList, res.data)
that.loadend = res.data.length < that.limit //
that.page = that.page + 1
})
},
//
delCollection: function(index) {
let that = this,
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category
getCollectDel(id, category).then(function() {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1)
that.$set(that, 'collectProductList', that.collectProductList)
},
})
})
},
drawStart(e) {
var touch = e.touches[0];
// let index = e.currentTarget.dataset.index;
for (var index in this.collectProductList) {
this.collectProductList[index].right = 0;
}
this.startX = touch.clientX;
// console.log(this.startX, "drawStart", index)
},
drawMove(e) {
let touch = e.touches[0];
// console.log(touch, "drawMove")
let index = e.currentTarget.dataset.index;
let item = this.collectProductList[index];
let disX = this.startX - touch.clientX;
// console.log(index, "drawMove")
if (disX >= 20) {
if (disX > this.delBtnWidth) {
disX = this.delBtnWidth;
}
this.collectProductList[index].right = disX;
} else {
this.collectProductList[index].right = 0;
}
},
drawEnd(e) {
let index = e.currentTarget.dataset.index;
let item = this.collectProductList[index];
if (item.right >= 80) {
this.collectProductList[index].right = this.delBtnWidth;
} else {
this.collectProductList[index].right = 0;
}
},
},
}
</script>
<style lang="less" scoped>
.header {
.tab-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: #2DB5AE;
line-height: 42rpx;
}
.backImg {
width: 88rpx;
height: 62rpx;
padding-left: 26rpx;
image {
width: 100%;
height: 100%;
}
}
}
.content-box {
position: relative;
width: 100%;
padding: 50rpx 30rpx 30rpx;
overflow: hidden;
background-color: #fff;
height: 100%;
border-radius: 28rpx 28rpx 0rpx 0rpx;
.item-box {
position: relative;
width: 686rpx;
background: #F5F6F8;
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0, 0, 0, 0.06);
border-radius: 16rpx;
padding: 20rpx;
margin-bottom: 20rpx;
.img {
width: 170rpx;
height: 170rpx;
margin-right: 20rpx;
border-radius: 16rpx;
}
.right-box {
.title-top {
color: #3A3A3C;
font-size: 28rpx;
}
.pic {
color: #2DB5AE;
font-size: 32rpx;
font-weight: 700;
}
}
//
.delete {
position: absolute;
top: 0;
right: -190rpx;
width: 154rpx;
height: 210rpx;
background: #EC3A5B;
box-shadow: 0rpx 10rpx 16rpx 0rpx rgba(0, 0, 0, 0.06);
border-radius: 16rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 600;
color: #FFFFFF;
line-height: 202rpx;
text-align: center;
text-shadow: 0rpx 10rpx 16rpx rgba(0, 0, 0, 0.06);
}
}
}
</style>

45
pages/shop/brands/brandAll/index.vue

@ -13,14 +13,14 @@
</cu-custom>
</view>
<!-- 搜索 -->
<view class="search acea-row row-middle" @click="goGoodSearch" :style="[{top:CustomBar + 'px'}]">
<view v-if="brandList" class="search acea-row row-middle" @click="goGoodSearch" :style="[{top:CustomBar + 'px'}]">
<image class="search-img" src="@/static/images/search.png" mode=""></image>
<text>搜索</text>
</view>
<view class="concent-box acea-row">
<view class="scoll-left">
<scroll-view class="scroll-box" scroll-y="true" :scroll-into-view="scollId" scroll-with-animation="true"
show-scrollbar="false">
show-scrollbar="false" @scroll="scrollLoad($event)">
<view :id="'item-'+key" class="navLeftName" v-for="(val,key) in brandList" :key="val">
<view class="moulding-box acea-row row-middle row-between">
<view class="moulding-left"></view>
@ -40,7 +40,7 @@
</view>
<view class="scoll-right">
<view scroll-y="true" class="acea-row row-center-column">
<view class="navRightName" :class="{'active':isLight==i}" v-for="(b,i) in navRight"
<view class="navRightName" :class="{'active':isLight==b}" v-for="(b,i) in navRight"
@click="brandListId(b,i)" :key="i">{{b}}</view>
</view>
</view>
@ -60,13 +60,48 @@
brandList: {},
navRight: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ#',
scollId: '',
isLight: -1
isLight: -1,
rectInfoList:[]
}
},
onLoad() {
this.getBrandList();
this.getRectInfo()
},
methods: {
getRectInfo(){
var top=0
var bottom=0
var temp=0
for(let key in this.brandList){
let view=uni.createSelectorQuery().select('#item-'+key);
view.boundingClientRect(data=>{
top=temp;
bottom=top+data.height;
temp=bottom;
this.rectInfoList.push({
'top':parseInt(top),
'bottom':parseInt(bottom),
key
})
}).exec();
}
},
scrollLoad(e){
if(this.rectInfoList.length==0){
this.getRectInfo()
}
let scrollTop=e.target.scrollTop;
for(let i=0;i<this.rectInfoList.length;i++){
if(i<=this.rectInfoList.length-2){
let top=this.rectInfoList[i].top;
let bottom=this.rectInfoList[i].bottom;
if(scrollTop>=top && scrollTop<bottom){
this.isLight=this.rectInfoList[i].key
}
}
}
},
goGoodSearch() {
this.$yrouter.push({
path: '/pages/shop/GoodSearch/index',
@ -75,7 +110,7 @@
brandListId(b, i) {
if (this.isLight === i) return
this.scollId = 'item-' + b
this.isLight = i
this.isLight = b
},
getBrandList() {

Loading…
Cancel
Save