首页分享样式修改-803

master
Lee-1203 2022-08-03 16:13:19 +08:00
parent 9b27a28eab
commit ffa10cb4d3
27 changed files with 435 additions and 429 deletions

View File

@ -71,13 +71,17 @@ page {background-color: #FFFFFF;}
border-radius: 20rpx 20rpx 0 0;
margin-top: -20rpx;
}
/* 顶部背景 */
.index-statis-bg{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 9;
}
/* 搜索框 */
.pull-search-bg{
height: 140rpx;
position: sticky;
left: 0;
top: 0;
z-index: 9;
}
.pull-search{
align-items: center;
@ -98,12 +102,10 @@ page {background-color: #FFFFFF;}
.index-cate-bg{
position: sticky;
left: 0;
top: 140rpx;
z-index: 9;
}
.index-cate-bg.show{
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
padding-top: 20rpx;
}
.index-cate{
width: 100%;

View File

@ -65,7 +65,7 @@
skuId:'',
listData: [],
page:1,
size:4,
size:10,
total:0,
delIds:'', //ids
noMore:false, //
@ -267,12 +267,10 @@
confirmDel(){
this.$requst.post('/api/order/shopping-cart-del',{ids:this.delIds.toString()}).then(res=>{
if(res.code==0){
//
this.listData = [];
this.getList();
this.$toolAll.tools.showToast('删除成功');
this.listData.forEach((item,index)=>{
if(item.ifcheck){
this.listData.splice(index,1)
}
})
}else{
this.$toolAll.tools.showToast(res.msg)
}

View File

@ -69,8 +69,8 @@
<view class="title">积分抵扣</view>
<view class="section-list font30">
<view class="item flex">
<label class="radio">
<radio :checked="scoreCheck" @tap="chooseEv('score')" color="#febf00" :disabled="!checkedYes"/>
<label class="radio" @tap="chooseEv('score')">
<radio :checked="scoreCheck" color="#febf00" :disabled="!checkedYes"/>
<text>可用积分</text>
</label>
<view class="txt flex">

View File

@ -1,382 +1,385 @@
<template>
<view>
<view class="index-page pad-x190 border-box" v-if="isLoading">
<!-- 顶部背景 -->
<view class="index-top">
<image :src="indexBackground" mode="widthFix"></image>
</view>
<template>
<view>
<view class="index-page pad-x190 border-box" v-if="isLoading">
<!-- 顶部背景 -->
<view class="index-top">
<image :src="indexBackground" mode="widthFix"></image>
</view>
<view class="index-content background-white">
<!-- 搜索 -->
<view class="pull-search-bg background-white radius20 pad-sx30 border-box">
<view class="pull-search radius20 flex" v-if="isShow">
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
</view>
</view>
<!-- 商品分类 -->
<view class="index-cate-bg pad-zy20 background-white" :class="!isShow?'show':''" id="index-cate-bg">
<view class="index-cate pad-zy20 border-box" :class="!isShow?'show':''">
<view class="pull-title">
<view class="txt font32 pad-sx10" v-if="isShow"></view>
<view class="line background-orange" v-if="isShow"></view>
</view>
<view class="cate-list-bg">
<scroll-view scroll-x="true" :scroll-left="tabsScrollLeft" @scroll="scroll">
<view class="cate-list flex" id="tab_list" :style="{width:cateWidth}">
<view class="cate-item" :class="index==currentIndex?'color-orange':''" id="tab_item" v-for="(item,index) in cateList" :key="index" @tap="changeCateEv(index)">
<view class="img mar-sx20"><image :src="item.cover" mode="widthFix"></image></view>
<view class="txt font24">{{item.title}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="commodity pad-zy20 border-box flex">
<view class="item mar-s40 radius20" v-for="(item,index) in commodityList" :key="index" @tap.stop="goDetail(item.id)">
<view class="img">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="txt pad-all20">
<view class="title fon30 clips2">{{item.name}}</view>
<view class="price font30 mar-sx10">{{item.price}}</view>
<view class="bottom flex">
<view class="sold font24 color-99">{{item.amount>=100?'99+':item.amount}}件已售</view>
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
</view>
</view>
</view>
</view>
<!-- 到底啦 -->
<view class="no-more font24" v-if="noMore"><text> 到底啦 </text></view>
</view>
</view>
<!-- 搜索结果 -->
<view class="pull-bg" v-if="showSearch"></view>
<view class="search-box border-box" v-if="showSearch" @tap.stop="closeSearch">
<view class="close-box" :style="{height:statusHeight+50+'px'}" @tap="closeSearch"></view>
<!-- 搜索 -->
<view class="search-bg background-white pad-sx30 border-box">
<view class="search radius20 flex">
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
</view>
</view>
<view class="keyword-txt background-white font30">关键词{{searchKeyword}}</view>
<scroll-view scroll-y="true" class="search-list background-white">
<!-- 搜索列表 -->
<view class="commodity pad-zy20 border-box flex">
<view class="item mar-s40 radius20" v-for="(item,index) in searchList" :key="index" @tap.stop="goDetail(item.id)">
<view class="img">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="txt pad-all20">
<view class="title fon30 clips2">{{item.name}}</view>
<view class="price font30 mar-sx10">{{item.price}}</view>
<view class="bottom flex">
<view class="sold font24 color-99">{{item.stock>=100?'99+':item.stock}}件已售</view>
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
</view>
</view>
</view>
</view>
<!-- 没有相关结果 -->
<view class="no-more font24" v-if="searchList.length==0"><text> 没有相关结果 </text></view>
</scroll-view>
</view>
<!-- 尾部 -->
<tabbar v-if="isLoading"></tabbar>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar';
import {getCartInfo} from '@/jsFile/public-api.js';
import {mapState} from 'vuex'//mapState
export default {
components:{
tabbar
},
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight,
scrollTop:0, //
isShow: true, //
//
currentIndex:0,
scrollLeft:0,
tabsScrollLeft:0,
cateWidth:'',
indexBackground:'', //
keyword:'', //
cateList:[], //
commodityList:[], //
ifLoading:true,
page:1, //
size:10, //
total:0, //
noMore:false, //
vip_level:0, //
keyword:'', //
searchKeyword:'', //
searchList:[], //
showSearch:false, //
isLoading:false,
<view class="index-statis-bg background-white" :style="{height:statusHeight+35+'px'}" v-if="!isShow"></view>
<!-- 搜索 -->
<view class="pull-search-bg background-white radius20 pad-sx30 border-box" v-if="isShow">
<view class="pull-search radius20 flex">
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
</view>
</view>
<!-- 商品分类 -->
<view class="index-cate-bg pad-zy20 background-white" :class="!isShow?'show':''" id="index-cate-bg" :style="{top:statusHeight+35+'px'}">
<view class="index-cate pad-zy20 border-box" :class="!isShow?'show':''">
<view class="pull-title" v-if="isShow">
<view class="txt font32 pad-sx10">商品</view>
<view class="line background-orange"></view>
</view>
<view class="cate-list-bg">
<scroll-view scroll-x="true" :scroll-left="tabsScrollLeft" @scroll="scroll">
<view class="cate-list flex" id="tab_list" :style="{width:cateWidth}">
<view class="cate-item" :class="index==currentIndex?'color-orange':''" id="tab_item" v-for="(item,index) in cateList" :key="index" @tap="changeCateEv(index)">
<view class="img mar-sx20"><image :src="item.cover" mode="widthFix"></image></view>
<view class="txt font24">{{item.title}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="commodity pad-zy20 border-box flex">
<view class="item mar-s40 radius20" v-for="(item,index) in commodityList" :key="index" @tap.stop="goDetail(item.id)">
<view class="img">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="txt pad-all20">
<view class="title fon30 clips2">{{item.name}}</view>
<view class="price font30 mar-sx10">{{item.price}}</view>
<view class="bottom flex">
<view class="sold font24 color-99">{{item.amount>=100?'99+':item.amount}}件已售</view>
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
</view>
</view>
</view>
</view>
<!-- 到底啦 -->
<view class="no-more font24" v-if="noMore"><text> 到底啦 </text></view>
</view>
</view>
<!-- 搜索结果 -->
<view class="pull-bg" v-if="showSearch"></view>
<view class="search-box border-box" v-if="showSearch" @tap.stop="closeSearch">
<view class="close-box" :style="{height:statusHeight+50+'px'}" @tap="closeSearch"></view>
<!-- 搜索 -->
<view class="search-bg background-white pad-sx30 border-box">
<view class="search radius20 flex">
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
</view>
</view>
<view class="keyword-txt background-white font30">关键词{{searchKeyword}}</view>
<scroll-view scroll-y="true" class="search-list background-white">
<!-- 搜索列表 -->
<view class="commodity pad-zy20 border-box flex">
<view class="item mar-s40 radius20" v-for="(item,index) in searchList" :key="index" @tap.stop="goDetail(item.id)">
<view class="img">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="txt pad-all20">
<view class="title fon30 clips2">{{item.name}}</view>
<view class="price font30 mar-sx10">{{item.price}}</view>
<view class="bottom flex">
<view class="sold font24 color-99">{{item.stock>=100?'99+':item.stock}}件已售</view>
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
</view>
</view>
</view>
</view>
<!-- 没有相关结果 -->
<view class="no-more font24" v-if="searchList.length==0"><text> 没有相关结果 </text></view>
</scroll-view>
</view>
<!-- 尾部 -->
<tabbar v-if="isLoading"></tabbar>
</view>
</template>
<script>
import tabbar from '@/components/tabbar/tabbar';
import {getCartInfo} from '@/jsFile/public-api.js';
import {mapState} from 'vuex'//mapState
export default {
components:{
tabbar
},
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight,
scrollTop:0, //
isShow: true, //
//
currentIndex:0,
scrollLeft:0,
tabsScrollLeft:0,
cateWidth:'',
indexBackground:'', //
keyword:'', //
cateList:[], //
commodityList:[], //
ifLoading:true,
page:1, //
size:10, //
total:0, //
noMore:false, //
vip_level:0, //
keyword:'', //
searchKeyword:'', //
searchList:[], //
showSearch:false, //
isLoading:false,
}
},
onLoad() {
//
this.getUserInfo();
//
this.getTabbarEv();
//
this.getCateEv();
},
onShow() {
//
getCartInfo();
this.playTimer = setTimeout(()=>{
this.isplay = true;
},2000)
this.vip_level = uni.getStorageSync('vip_level');
},
onReady() {
},
onHide() {
clearTimeout(this.playTimer);
this.isplay =false;
},
onPageScroll(object){
this.setTop();
if(object.scrollTop>this.scrollTop){
this.isShow = false;
}else{
this.isShow = true;
}
},
//
onShareAppMessage(res) {
let shareObj = {
imageUrl:'/static/img/shear-index.jpg'
}
},
onLoad() {
//
this.getUserInfo();
//
this.getTabbarEv();
//
this.getCateEv();
},
onShow() {
//
getCartInfo();
this.playTimer = setTimeout(()=>{
this.isplay = true;
},2000)
this.vip_level = uni.getStorageSync('vip_level');
},
onReady() {
},
onHide() {
clearTimeout(this.playTimer);
this.isplay =false;
},
onPageScroll(object){
this.setTop();
if(object.scrollTop>this.scrollTop){
this.isShow = false;
}else{
this.isShow = true;
}
},
//
onShareAppMessage(res) {
},
//
onShareTimeline(res){
},
//
onReachBottom(e) {
if(!this.noMore){
this.page++;
//
this.getCommodityEv(this.cateList[this.currentIndex].id);
}
},
watch: {
list() {
this.setTabList()
},
value() {
this.currentIndex = this.value
this.setTabList()
}
},
methods: {
//
getUserInfo(){
this.$requst.get('/api/user/info').then(res=>{
if(res.code == 0){
console.log(res,'个人信息')
uni.setStorageSync('vip_level',res.data.vip_level);
}
})
},
//
getTabbarEv(){
this.$requst.get('/api/index/mini-program-setting').then(res=>{
if(res.code == 0){
console.log(res,'个性装扮')
this.indexBackground = this.$hostHttp + res.data.indexBackground;
}
})
},
//
getCateEv(){
this.$requst.get('/api/spu/category').then(res=>{
if(res.code == 0){
console.log(res,'商品分类')
let cateArr =[];
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.title,
cover:item.cover
}
cateArr.push(obj);
})
this.cateList = cateArr;
this.cateWidth = this.cateList.length*158 - 58 + 'rpx';
//
this.getCommodityEv(this.cateList[this.currentIndex].id);
}
})
},
//
getCommodityEv(id){
uni.showLoading({
title:'加载中'
})
let params = {
page:this.page,
size:this.size,
category_id:id
}
this.$requst.get('/api/spu/list',params).then(res=>{
if(res.code == 0){
console.log(res,'商品列表')
this.total = res.data.total;
let commodityArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.name,
original_price:item.original_price,
price:item.price,
tag:item.tag,
stock:item.stock,
sku_id:item.default_sku.id,
amount:item.amount,
}
commodityArr.push(obj)
})
this.commodityList = this.commodityList.concat(commodityArr);
if(this.commodityList.length==this.total){
this.noMore =true;
}
}
uni.hideLoading();
this.isLoading = true;
})
},
//
joinCart(index){
if(this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.commodityList[index].sku_id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
getCartInfo();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
}
},
//
goDetail(id){
uni.navigateTo({
url:`/pagesB/shop-detail/shop-detail?id=${id}`
})
},
//
changeCateEv(index) {
if(this.currentIndex !== index){
this.currentIndex = index;
//
this.commodityList = [];
this.noMore = false;
this.getCommodityEv(this.cateList[index].id);
//
this.setTabList();
}
},
//
setTabList() {
this.$nextTick(() => {
if (this.cateList.length > 0) {
//
this.setLeft()
}
})
},
//
setLeft() {
let lineLeft = 0;
this.getElementData('#tab_list', (data) => {
let list = data[0];
this.getElementData('#tab_item', (res) => {
let el = res[this.currentIndex]
lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
this.tabsScrollLeft = this.scrollLeft + lineLeft
})
})
},
//
setTop(){
this.getElementData('#index-cate-bg', (res) => {
let el = res[0];
this.scrollTop = el.top + el.height/4;
})
},
// DOM
getElementData(el, callback) {
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
callback(data[0]);
});
},
//
scroll(e) {
this.scrollLeft = e.detail.scrollLeft;
},
//
doSearch(){
this.showSearch = true;
this.searchKeyword = this.keyword;
this.keyword = '';
this.$requst.get('/api/spu/list',{keyword:this.searchKeyword}).then(res=>{
if(res.code == 0){
console.log(res,'搜索列表')
this.total = res.data.total;
let searchArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.name,
original_price:item.original_price,
price:item.price,
tag:item.tag,
stock:item.stock,
sku_id:item.default_sku.id
}
searchArr.push(obj)
})
this.searchList = this.searchList.concat(searchArr);
}
})
},
//
closeSearch(){
this.showSearch = false;
this.searchKeyword = '';
this.searchList = [];
}
}
}
</script>
<style>
</style>
// shareObj
return shareObj;
},
//
onShareTimeline(res){
},
//
onReachBottom(e) {
if(!this.noMore){
this.page++;
//
this.getCommodityEv(this.cateList[this.currentIndex].id);
}
},
watch: {
list() {
this.setTabList()
},
value() {
this.currentIndex = this.value
this.setTabList()
}
},
methods: {
//
getUserInfo(){
this.$requst.get('/api/user/info').then(res=>{
if(res.code == 0){
console.log(res,'个人信息')
uni.setStorageSync('vip_level',res.data.vip_level);
}
})
},
//
getTabbarEv(){
this.$requst.get('/api/index/mini-program-setting').then(res=>{
if(res.code == 0){
console.log(res,'个性装扮')
this.indexBackground = this.$hostHttp + res.data.indexBackground;
}
})
},
//
getCateEv(){
this.$requst.get('/api/spu/category').then(res=>{
if(res.code == 0){
console.log(res,'商品分类')
let cateArr =[];
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.title,
cover:item.cover
}
cateArr.push(obj);
})
this.cateList = cateArr;
this.cateWidth = this.cateList.length*158 - 58 + 'rpx';
//
this.getCommodityEv(this.cateList[this.currentIndex].id);
}
})
},
//
getCommodityEv(id){
uni.showLoading({
title:'加载中'
})
let params = {
page:this.page,
size:this.size,
category_id:id
}
this.$requst.get('/api/spu/list',params).then(res=>{
if(res.code == 0){
console.log(res,'商品列表')
this.total = res.data.total;
let commodityArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.name,
original_price:item.original_price,
price:item.price,
tag:item.tag,
stock:item.stock,
sku_id:item.default_sku.id,
amount:item.amount,
}
commodityArr.push(obj)
})
this.commodityList = this.commodityList.concat(commodityArr);
if(this.commodityList.length==this.total){
this.noMore =true;
}
}
uni.hideLoading();
this.isLoading = true;
})
},
//
joinCart(index){
if(this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.commodityList[index].sku_id,num:1}).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
getCartInfo();
} else {
this.$toolAll.tools.showToast(res.msg)
}
})
}
},
//
goDetail(id){
uni.navigateTo({
url:`/pagesB/shop-detail/shop-detail?id=${id}`
})
},
//
changeCateEv(index) {
if(this.currentIndex !== index){
this.currentIndex = index;
//
this.commodityList = [];
this.noMore = false;
this.getCommodityEv(this.cateList[index].id);
//
this.setTabList();
}
},
//
setTabList() {
this.$nextTick(() => {
if (this.cateList.length > 0) {
//
this.setLeft()
}
})
},
//
setLeft() {
let lineLeft = 0;
this.getElementData('#tab_list', (data) => {
let list = data[0];
this.getElementData('#tab_item', (res) => {
let el = res[this.currentIndex]
lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
this.tabsScrollLeft = this.scrollLeft + lineLeft
})
})
},
//
setTop(){
this.getElementData('#index-cate-bg', (res) => {
let el = res[0];
this.scrollTop = el.top + el.height/4;
})
},
// DOM
getElementData(el, callback) {
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
callback(data[0]);
});
},
//
scroll(e) {
this.scrollLeft = e.detail.scrollLeft;
},
//
doSearch(){
this.showSearch = true;
this.searchKeyword = this.keyword;
this.keyword = '';
this.$requst.get('/api/spu/list',{keyword:this.searchKeyword}).then(res=>{
if(res.code == 0){
console.log(res,'搜索列表')
this.total = res.data.total;
let searchArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.name,
original_price:item.original_price,
price:item.price,
tag:item.tag,
stock:item.stock,
sku_id:item.default_sku.id
}
searchArr.push(obj)
})
this.searchList = this.searchList.concat(searchArr);
}
})
},
//
closeSearch(){
this.showSearch = false;
this.searchKeyword = '';
this.searchList = [];
}
}
}
</script>
<style>
</style>

View File

@ -97,8 +97,8 @@
this.tag = op.tag;
this.activeIndex = op.index;
setTimeout(()=>{
//
this.changeNav(op.index,op.tag);
//
this.setLeft()
},200)
}
if(op.backTag){this.backTag = op.backTag;}

View File

@ -74,7 +74,7 @@
}
this.$requst.post('/api/user/distributor-apply',params).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('恭喜您申请成功o(╥﹏╥)o');
this.$toolAll.tools.showToast('恭喜您申请成功!');
setTimeout(()=>{
uni.reLaunch({
url:`/pages/index/index`

BIN
static/img/shear-index.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -395,14 +395,17 @@ page {background-color: #FFFFFF;}
border-radius: 20rpx 20rpx 0 0;
margin-top: -20rpx;
}
/* 顶部背景 */
.index-statis-bg{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 9;
}
/* 搜索框 */
.pull-search-bg{
height: 140rpx;
position: -webkit-sticky;
position: sticky;
left: 0;
top: 0;
z-index: 9;
height: 140rpx;
}
.pull-search{
align-items: center;
@ -424,12 +427,10 @@ page {background-color: #FFFFFF;}
position: -webkit-sticky;
position: sticky;
left: 0;
top: 140rpx;
z-index: 9;
}
.index-cate-bg.show{
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
padding-top: 20rpx;
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
}
.index-cate{
width: 100%;

View File

@ -269,7 +269,7 @@ var _publicApi = __webpack_require__(/*! @/jsFile/public-api.js */ 24); //
var _default = { data: function data() {return { statusHeight: uni.getSystemInfoSync().statusBarHeight, originalNum: 0, //当前输入框原值
maxNum: 99999, //最大可输入数量
minNum: 1, //最小可输入数量
skuId: '', listData: [], page: 1, size: 4, total: 0, delIds: '', //删除ids
skuId: '', listData: [], page: 1, size: 10, total: 0, delIds: '', //删除ids
noMore: false, //没有更多
isLoading: true, flag: true };}, onShow: function onShow() {uni.removeStorageSync('buyList');this.listData = []; // 查询购物车列表
this.getList();}, onReachBottom: function onReachBottom() {if (!this.noMore) {this.page++; // 获取商品列表
@ -424,12 +424,10 @@ var _default = { data: function data() {return { statusHeight: uni.getSystemInfo
confirmDel: function confirmDel() {var _this5 = this;
this.$requst.post('/api/order/shopping-cart-del', { ids: this.delIds.toString() }).then(function (res) {
if (res.code == 0) {
// 查询购物车列表
_this5.listData = [];
_this5.getList();
_this5.$toolAll.tools.showToast('删除成功');
_this5.listData.forEach(function (item, index) {
if (item.ifcheck) {
_this5.listData.splice(index, 1);
}
});
} else {
_this5.$toolAll.tools.showToast(res.msg);
}

File diff suppressed because one or more lines are too long

View File

@ -314,7 +314,11 @@ var _default = {
},
// 分享到微信
onShareAppMessage: function onShareAppMessage(res) {
var shareObj = {
imageUrl: '/static/img/shear-index.jpg' };
// 返回shareObj
return shareObj;
},
// 分享到朋友圈
onShareTimeline: function onShareTimeline(res) {

View File

@ -1 +1 @@
<view><block wx:if="{{isLoading}}"><view class="index-page pad-x190 border-box"><view class="index-top"><image src="{{indexBackground}}" mode="widthFix"></image></view><view class="index-content background-white"><view class="pull-search-bg background-white radius20 pad-sx30 border-box"><block wx:if="{{isShow}}"><view class="pull-search radius20 flex"><image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image><input class="input pad-zy15 border-box font30" type="text" placeholder="搜索" confirm-type="search" placeholder-style="color: #666666" data-event-opts="{{[['confirm',[['doSearch',['$event']]]],['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindconfirm="__e" bindinput="__e"/></view></block></view><view class="{{['index-cate-bg','pad-zy20','background-white',!isShow?'show':'']}}" id="index-cate-bg"><view class="{{['index-cate','pad-zy20','border-box',!isShow?'show':'']}}"><view class="pull-title"><block wx:if="{{isShow}}"><view class="txt font32 pad-sx10">商品</view></block><block wx:if="{{isShow}}"><view class="line background-orange"></view></block></view><view class="cate-list-bg"><scroll-view scroll-x="true" scroll-left="{{tabsScrollLeft}}" data-event-opts="{{[['scroll',[['scroll',['$event']]]]]}}" bindscroll="__e"><view class="cate-list flex" style="{{'width:'+(cateWidth)+';'}}" id="tab_list"><block wx:for="{{cateList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['cate-item',index==currentIndex?'color-orange':'']}}" id="tab_item" data-event-opts="{{[['tap',[['changeCateEv',[index]]]]]}}" bindtap="__e"><view class="img mar-sx20"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt font24">{{item.title}}</view></view></block></view></scroll-view></view></view></view><view class="commodity pad-zy20 border-box flex"><block wx:for="{{commodityList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goDetail',['$0'],[[['commodityList','',index,'id']]]]]]]}}" class="item mar-s40 radius20" catchtap="__e"><view class="img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt pad-all20"><view class="title fon30 clips2">{{item.name}}</view><view class="price font30 mar-sx10">{{"¥"+item.price}}</view><view class="bottom flex"><view class="sold font24 color-99">{{(item.amount>=100?'99+':item.amount)+"件已售"}}</view><view data-event-opts="{{[['tap',[['joinCart',[index]]]]]}}" class="btn font24 background-orange flex" catchtap="__e">加入购物车</view></view></view></view></block></view><block wx:if="{{noMore}}"><view class="no-more font24"><text>—— 到底啦 ——</text></view></block></view></view></block><block wx:if="{{showSearch}}"><view class="pull-bg"></view></block><block wx:if="{{showSearch}}"><view data-event-opts="{{[['tap',[['closeSearch',['$event']]]]]}}" class="search-box border-box" catchtap="__e"><view data-event-opts="{{[['tap',[['closeSearch',['$event']]]]]}}" class="close-box" style="{{'height:'+(statusHeight+50+'px')+';'}}" bindtap="__e"></view><view class="search-bg background-white pad-sx30 border-box"><view class="search radius20 flex"><image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image><input class="input pad-zy15 border-box font30" type="text" placeholder="搜索" confirm-type="search" placeholder-style="color: #666666" data-event-opts="{{[['confirm',[['doSearch',['$event']]]],['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindconfirm="__e" bindinput="__e"/></view></view><view class="keyword-txt background-white font30">{{"关键词:"+searchKeyword}}</view><scroll-view class="search-list background-white" scroll-y="true"><view class="commodity pad-zy20 border-box flex"><block wx:for="{{searchList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goDetail',['$0'],[[['searchList','',index,'id']]]]]]]}}" class="item mar-s40 radius20" catchtap="__e"><view class="img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt pad-all20"><view class="title fon30 clips2">{{item.name}}</view><view class="price font30 mar-sx10">{{"¥"+item.price}}</view><view class="bottom flex"><view class="sold font24 color-99">{{(item.stock>=100?'99+':item.stock)+"件已售"}}</view><view data-event-opts="{{[['tap',[['joinCart',[index]]]]]}}" class="btn font24 background-orange flex" catchtap="__e">加入购物车</view></view></view></view></block></view><block wx:if="{{searchList.length==0}}"><view class="no-more font24"><text>—— 没有相关结果 ——</text></view></block></scroll-view></view></block><block wx:if="{{isLoading}}"><tabbar vue-id="8dd740cc-1" bind:__l="__l"></tabbar></block></view>
<view><block wx:if="{{isLoading}}"><view class="index-page pad-x190 border-box"><view class="index-top"><image src="{{indexBackground}}" mode="widthFix"></image></view><view class="index-content background-white"><block wx:if="{{!isShow}}"><view class="index-statis-bg background-white" style="{{'height:'+(statusHeight+35+'px')+';'}}"></view></block><block wx:if="{{isShow}}"><view class="pull-search-bg background-white radius20 pad-sx30 border-box"><view class="pull-search radius20 flex"><image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image><input class="input pad-zy15 border-box font30" type="text" placeholder="搜索" confirm-type="search" placeholder-style="color: #666666" data-event-opts="{{[['confirm',[['doSearch',['$event']]]],['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindconfirm="__e" bindinput="__e"/></view></view></block><view class="{{['index-cate-bg','pad-zy20','background-white',!isShow?'show':'']}}" style="{{'top:'+(statusHeight+35+'px')+';'}}" id="index-cate-bg"><view class="{{['index-cate','pad-zy20','border-box',!isShow?'show':'']}}"><block wx:if="{{isShow}}"><view class="pull-title"><view class="txt font32 pad-sx10">商品</view><view class="line background-orange"></view></view></block><view class="cate-list-bg"><scroll-view scroll-x="true" scroll-left="{{tabsScrollLeft}}" data-event-opts="{{[['scroll',[['scroll',['$event']]]]]}}" bindscroll="__e"><view class="cate-list flex" style="{{'width:'+(cateWidth)+';'}}" id="tab_list"><block wx:for="{{cateList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['cate-item',index==currentIndex?'color-orange':'']}}" id="tab_item" data-event-opts="{{[['tap',[['changeCateEv',[index]]]]]}}" bindtap="__e"><view class="img mar-sx20"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt font24">{{item.title}}</view></view></block></view></scroll-view></view></view></view><view class="commodity pad-zy20 border-box flex"><block wx:for="{{commodityList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goDetail',['$0'],[[['commodityList','',index,'id']]]]]]]}}" class="item mar-s40 radius20" catchtap="__e"><view class="img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt pad-all20"><view class="title fon30 clips2">{{item.name}}</view><view class="price font30 mar-sx10">{{"¥"+item.price}}</view><view class="bottom flex"><view class="sold font24 color-99">{{(item.amount>=100?'99+':item.amount)+"件已售"}}</view><view data-event-opts="{{[['tap',[['joinCart',[index]]]]]}}" class="btn font24 background-orange flex" catchtap="__e">加入购物车</view></view></view></view></block></view><block wx:if="{{noMore}}"><view class="no-more font24"><text>—— 到底啦 ——</text></view></block></view></view></block><block wx:if="{{showSearch}}"><view class="pull-bg"></view></block><block wx:if="{{showSearch}}"><view data-event-opts="{{[['tap',[['closeSearch',['$event']]]]]}}" class="search-box border-box" catchtap="__e"><view data-event-opts="{{[['tap',[['closeSearch',['$event']]]]]}}" class="close-box" style="{{'height:'+(statusHeight+50+'px')+';'}}" bindtap="__e"></view><view class="search-bg background-white pad-sx30 border-box"><view class="search radius20 flex"><image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image><input class="input pad-zy15 border-box font30" type="text" placeholder="搜索" confirm-type="search" placeholder-style="color: #666666" data-event-opts="{{[['confirm',[['doSearch',['$event']]]],['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindconfirm="__e" bindinput="__e"/></view></view><view class="keyword-txt background-white font30">{{"关键词:"+searchKeyword}}</view><scroll-view class="search-list background-white" scroll-y="true"><view class="commodity pad-zy20 border-box flex"><block wx:for="{{searchList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goDetail',['$0'],[[['searchList','',index,'id']]]]]]]}}" class="item mar-s40 radius20" catchtap="__e"><view class="img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="txt pad-all20"><view class="title fon30 clips2">{{item.name}}</view><view class="price font30 mar-sx10">{{"¥"+item.price}}</view><view class="bottom flex"><view class="sold font24 color-99">{{(item.stock>=100?'99+':item.stock)+"件已售"}}</view><view data-event-opts="{{[['tap',[['joinCart',[index]]]]]}}" class="btn font24 background-orange flex" catchtap="__e">加入购物车</view></view></view></view></block></view><block wx:if="{{searchList.length==0}}"><view class="no-more font24"><text>—— 没有相关结果 ——</text></view></block></scroll-view></view></block><block wx:if="{{isLoading}}"><tabbar vue-id="8dd740cc-1" bind:__l="__l"></tabbar></block></view>

View File

@ -284,8 +284,8 @@ var _vuex = __webpack_require__(/*! vuex */ 13); //
//引入mapState
var _default = { data: function data() {return { newTop: uni.getSystemInfoSync().statusBarHeight + 50, orderNav: [{ title: '全部', tag: 'all' }, { title: '待付款', tag: 'waiting' }, { title: '已下单', tag: 'paid' }, { title: '已发货', tag: 'shipped' }, { title: '已完成', tag: 'completed' }, { title: '已取消', tag: 'closed' }], activeIndex: 0, scrollLeft: 0, tabsScrollLeft: 0, navWidth: '', //导航宽度
orderList: [], flag: true, isLoading: false, total: 0, totalAll: -1, page: 1, size: 10, tag: 'all', order_coding: '', //订单号
backTag: '' };}, onLoad: function onLoad(op) {var _this = this;if (op.tag && op.index) {this.tag = op.tag;this.activeIndex = op.index;setTimeout(function () {// 导航切换
_this.changeNav(op.index, op.tag);}, 200);}if (op.backTag) {this.backTag = op.backTag;}this.navWidth = this.orderNav.length * 150 - 20 + 'rpx';}, onShow: function onShow() {this.orderList = [];this.getOrderList();}, onReachBottom: function onReachBottom(e) {if (this.orderList.length < this.total) {this.page++;this.getOrderList();}}, // 分享到微信
backTag: '' };}, onLoad: function onLoad(op) {var _this = this;if (op.tag && op.index) {this.tag = op.tag;this.activeIndex = op.index;setTimeout(function () {//计算左滑距离
_this.setLeft();}, 200);}if (op.backTag) {this.backTag = op.backTag;}this.navWidth = this.orderNav.length * 150 - 20 + 'rpx';}, onShow: function onShow() {this.orderList = [];this.getOrderList();}, onReachBottom: function onReachBottom(e) {if (this.orderList.length < this.total) {this.page++;this.getOrderList();}}, // 分享到微信
onShareAppMessage: function onShareAppMessage() {}, // 分享到朋友圈
onShareTimeline: function onShareTimeline(res) {}, methods: { // 导航切换
changeNav: function changeNav(index, tag) {this.total = 0;this.totalAll = -1;this.activeIndex = index;this.tag = tag;this.orderList = [];this.page = 1;this.order_coding = '';this.getOrderList();

View File

@ -229,7 +229,7 @@ var _default = { data: function data() {return { disclaimersHeight: "calc(100vh
uni.setStorageSync('inviteCode', op.invite_code);this.invite_code = op.invite_code;}if (op.invite_name) {this.invite_name = op.invite_name;}}, methods: { // 提交申请
submitEv: function submitEv() {var _this = this;if (this.checkEmpty() && this.flag) {var params = { invite_code: this.invite_code, invite_name: this.invite_name, real_name: this.real_name, phone: this.phone, deposit_bank: this.deposit_bank, bank_account: this.bank_account };this.$requst.post('/api/user/distributor-apply', params).then(function (res) {
if (res.code == 0) {
_this.$toolAll.tools.showToast('恭喜您申请成功o(╥﹏╥)o');
_this.$toolAll.tools.showToast('恭喜您申请成功!');
setTimeout(function () {
uni.reLaunch({
url: "/pages/index/index" });

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB