首页分享样式修改-803
parent
9b27a28eab
commit
ffa10cb4d3
commons
pages
index
pagesA/order
pagesB/distributor
static/img
unpackage/dist/dev
.sourcemap/mp-weixin
common
components
nothing
share-coupon
status-nav
tabbar
pages
pagesA/order
pagesB
distributor
shop-detail
mp-weixin
common
pages
pagesA/order
pagesB/distributor
static/img
|
@ -71,13 +71,17 @@ page {background-color: #FFFFFF;}
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
margin-top: -20rpx;
|
margin-top: -20rpx;
|
||||||
}
|
}
|
||||||
|
/* 顶部背景 */
|
||||||
|
.index-statis-bg{
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
/* 搜索框 */
|
/* 搜索框 */
|
||||||
.pull-search-bg{
|
.pull-search-bg{
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
position: sticky;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: 9;
|
|
||||||
}
|
}
|
||||||
.pull-search{
|
.pull-search{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -98,12 +102,10 @@ page {background-color: #FFFFFF;}
|
||||||
.index-cate-bg{
|
.index-cate-bg{
|
||||||
position: sticky;
|
position: sticky;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 140rpx;
|
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
.index-cate-bg.show{
|
.index-cate-bg.show{
|
||||||
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
|
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
|
||||||
padding-top: 20rpx;
|
|
||||||
}
|
}
|
||||||
.index-cate{
|
.index-cate{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
skuId:'',
|
skuId:'',
|
||||||
listData: [],
|
listData: [],
|
||||||
page:1,
|
page:1,
|
||||||
size:4,
|
size:10,
|
||||||
total:0,
|
total:0,
|
||||||
delIds:'', //删除ids
|
delIds:'', //删除ids
|
||||||
noMore:false, //没有更多
|
noMore:false, //没有更多
|
||||||
|
@ -267,12 +267,10 @@
|
||||||
confirmDel(){
|
confirmDel(){
|
||||||
this.$requst.post('/api/order/shopping-cart-del',{ids:this.delIds.toString()}).then(res=>{
|
this.$requst.post('/api/order/shopping-cart-del',{ids:this.delIds.toString()}).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
// 查询购物车列表
|
||||||
|
this.listData = [];
|
||||||
|
this.getList();
|
||||||
this.$toolAll.tools.showToast('删除成功');
|
this.$toolAll.tools.showToast('删除成功');
|
||||||
this.listData.forEach((item,index)=>{
|
|
||||||
if(item.ifcheck){
|
|
||||||
this.listData.splice(index,1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
}else{
|
||||||
this.$toolAll.tools.showToast(res.msg)
|
this.$toolAll.tools.showToast(res.msg)
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,8 @@
|
||||||
<view class="title">积分抵扣</view>
|
<view class="title">积分抵扣</view>
|
||||||
<view class="section-list font30">
|
<view class="section-list font30">
|
||||||
<view class="item flex">
|
<view class="item flex">
|
||||||
<label class="radio">
|
<label class="radio" @tap="chooseEv('score')">
|
||||||
<radio :checked="scoreCheck" @tap="chooseEv('score')" color="#febf00" :disabled="!checkedYes"/>
|
<radio :checked="scoreCheck" color="#febf00" :disabled="!checkedYes"/>
|
||||||
<text>可用积分</text>
|
<text>可用积分</text>
|
||||||
</label>
|
</label>
|
||||||
<view class="txt flex">
|
<view class="txt flex">
|
||||||
|
|
|
@ -1,382 +1,385 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="index-page pad-x190 border-box" v-if="isLoading">
|
<view class="index-page pad-x190 border-box" v-if="isLoading">
|
||||||
<!-- 顶部背景 -->
|
<!-- 顶部背景 -->
|
||||||
<view class="index-top">
|
<view class="index-top">
|
||||||
<image :src="indexBackground" mode="widthFix"></image>
|
<image :src="indexBackground" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="index-content background-white">
|
<view class="index-content background-white">
|
||||||
<!-- 搜索 -->
|
<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">
|
<!-- 搜索 -->
|
||||||
<view class="pull-search radius20 flex" v-if="isShow">
|
<view class="pull-search-bg background-white radius20 pad-sx30 border-box" v-if="isShow">
|
||||||
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
|
<view class="pull-search radius20 flex">
|
||||||
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
|
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
|
||||||
</view>
|
<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>
|
||||||
<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="index-cate-bg pad-zy20 background-white" :class="!isShow?'show':''" id="index-cate-bg" :style="{top:statusHeight+35+'px'}">
|
||||||
<view class="pull-title">
|
<view class="index-cate pad-zy20 border-box" :class="!isShow?'show':''">
|
||||||
<view class="txt font32 pad-sx10" v-if="isShow">商品</view>
|
<view class="pull-title" v-if="isShow">
|
||||||
<view class="line background-orange" v-if="isShow"></view>
|
<view class="txt font32 pad-sx10">商品</view>
|
||||||
</view>
|
<view class="line background-orange"></view>
|
||||||
<view class="cate-list-bg">
|
</view>
|
||||||
<scroll-view scroll-x="true" :scroll-left="tabsScrollLeft" @scroll="scroll">
|
<view class="cate-list-bg">
|
||||||
<view class="cate-list flex" id="tab_list" :style="{width:cateWidth}">
|
<scroll-view scroll-x="true" :scroll-left="tabsScrollLeft" @scroll="scroll">
|
||||||
<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="cate-list flex" id="tab_list" :style="{width:cateWidth}">
|
||||||
<view class="img mar-sx20"><image :src="item.cover" mode="widthFix"></image></view>
|
<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="txt font24">{{item.title}}</view>
|
<view class="img mar-sx20"><image :src="item.cover" mode="widthFix"></image></view>
|
||||||
</view>
|
<view class="txt font24">{{item.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</view>
|
||||||
</view>
|
</scroll-view>
|
||||||
</view>
|
</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="commodity pad-zy20 border-box flex">
|
||||||
<view class="img">
|
<view class="item mar-s40 radius20" v-for="(item,index) in commodityList" :key="index" @tap.stop="goDetail(item.id)">
|
||||||
<image :src="item.cover" mode="widthFix"></image>
|
<view class="img">
|
||||||
</view>
|
<image :src="item.cover" mode="widthFix"></image>
|
||||||
<view class="txt pad-all20">
|
</view>
|
||||||
<view class="title fon30 clips2">{{item.name}}</view>
|
<view class="txt pad-all20">
|
||||||
<view class="price font30 mar-sx10">¥{{item.price}}</view>
|
<view class="title fon30 clips2">{{item.name}}</view>
|
||||||
<view class="bottom flex">
|
<view class="price font30 mar-sx10">¥{{item.price}}</view>
|
||||||
<view class="sold font24 color-99">{{item.amount>=100?'99+':item.amount}}件已售</view>
|
<view class="bottom flex">
|
||||||
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
|
<view class="sold font24 color-99">{{item.amount>=100?'99+':item.amount}}件已售</view>
|
||||||
</view>
|
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 到底啦 -->
|
</view>
|
||||||
<view class="no-more font24" v-if="noMore"><text>—— 到底啦 ——</text></view>
|
<!-- 到底啦 -->
|
||||||
</view>
|
<view class="no-more font24" v-if="noMore"><text>—— 到底啦 ——</text></view>
|
||||||
</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="pull-bg" v-if="showSearch"></view>
|
||||||
<view class="close-box" :style="{height:statusHeight+50+'px'}" @tap="closeSearch"></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">
|
<view class="search-bg background-white pad-sx30 border-box">
|
||||||
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
|
<view class="search radius20 flex">
|
||||||
<input class="input pad-zy15 border-box font30" v-model="keyword" type="text" placeholder="搜索" confirm-type="search" @confirm="doSearch" placeholder-style="color: #666666">
|
<image class="img" src="/static/icon/icon-search.png" mode="widthFix"></image>
|
||||||
</view>
|
<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>
|
</view>
|
||||||
<scroll-view scroll-y="true" class="search-list background-white">
|
<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="commodity pad-zy20 border-box flex">
|
||||||
<view class="img">
|
<view class="item mar-s40 radius20" v-for="(item,index) in searchList" :key="index" @tap.stop="goDetail(item.id)">
|
||||||
<image :src="item.cover" mode="widthFix"></image>
|
<view class="img">
|
||||||
</view>
|
<image :src="item.cover" mode="widthFix"></image>
|
||||||
<view class="txt pad-all20">
|
</view>
|
||||||
<view class="title fon30 clips2">{{item.name}}</view>
|
<view class="txt pad-all20">
|
||||||
<view class="price font30 mar-sx10">¥{{item.price}}</view>
|
<view class="title fon30 clips2">{{item.name}}</view>
|
||||||
<view class="bottom flex">
|
<view class="price font30 mar-sx10">¥{{item.price}}</view>
|
||||||
<view class="sold font24 color-99">{{item.stock>=100?'99+':item.stock}}件已售</view>
|
<view class="bottom flex">
|
||||||
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
|
<view class="sold font24 color-99">{{item.stock>=100?'99+':item.stock}}件已售</view>
|
||||||
</view>
|
<view class="btn font24 background-orange flex" @tap.stop="joinCart(index)">加入购物车</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 没有相关结果 -->
|
</view>
|
||||||
<view class="no-more font24" v-if="searchList.length==0"><text>—— 没有相关结果 ——</text></view>
|
<!-- 没有相关结果 -->
|
||||||
</scroll-view>
|
<view class="no-more font24" v-if="searchList.length==0"><text>—— 没有相关结果 ——</text></view>
|
||||||
</view>
|
</scroll-view>
|
||||||
<!-- 尾部 -->
|
</view>
|
||||||
<tabbar v-if="isLoading"></tabbar>
|
<!-- 尾部 -->
|
||||||
</view>
|
<tabbar v-if="isLoading"></tabbar>
|
||||||
</template>
|
</view>
|
||||||
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import tabbar from '@/components/tabbar/tabbar';
|
import tabbar from '@/components/tabbar/tabbar';
|
||||||
import {getCartInfo} from '@/jsFile/public-api.js';
|
import {getCartInfo} from '@/jsFile/public-api.js';
|
||||||
import {mapState} from 'vuex'//引入mapState
|
import {mapState} from 'vuex'//引入mapState
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
tabbar
|
tabbar
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusHeight:uni.getSystemInfoSync().statusBarHeight,
|
statusHeight:uni.getSystemInfoSync().statusBarHeight,
|
||||||
scrollTop:0, //分类距离顶部距离
|
scrollTop:0, //分类距离顶部距离
|
||||||
isShow: true, //显示
|
isShow: true, //显示
|
||||||
//分类导航
|
//分类导航
|
||||||
currentIndex:0,
|
currentIndex:0,
|
||||||
scrollLeft:0,
|
scrollLeft:0,
|
||||||
tabsScrollLeft:0,
|
tabsScrollLeft:0,
|
||||||
cateWidth:'',
|
cateWidth:'',
|
||||||
indexBackground:'', //背景图
|
indexBackground:'', //背景图
|
||||||
keyword:'', //关键词
|
keyword:'', //关键词
|
||||||
cateList:[], //商品分类
|
cateList:[], //商品分类
|
||||||
commodityList:[], //商品列表
|
commodityList:[], //商品列表
|
||||||
ifLoading:true,
|
ifLoading:true,
|
||||||
page:1, //分页
|
page:1, //分页
|
||||||
size:10, //条数
|
size:10, //条数
|
||||||
total:0, //总数
|
total:0, //总数
|
||||||
noMore:false, //没有更多
|
noMore:false, //没有更多
|
||||||
vip_level:0, //是否是会员
|
vip_level:0, //是否是会员
|
||||||
keyword:'', //关键词
|
keyword:'', //关键词
|
||||||
searchKeyword:'', //搜索关键词
|
searchKeyword:'', //搜索关键词
|
||||||
searchList:[], //搜索结果
|
searchList:[], //搜索结果
|
||||||
showSearch:false, //显示搜索结果
|
showSearch:false, //显示搜索结果
|
||||||
isLoading: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'
|
||||||
}
|
}
|
||||||
},
|
// 返回shareObj
|
||||||
onLoad() {
|
return shareObj;
|
||||||
// 获取用户信息
|
},
|
||||||
this.getUserInfo();
|
// 分享到朋友圈
|
||||||
// 获取头部背景
|
onShareTimeline(res){
|
||||||
this.getTabbarEv();
|
|
||||||
// 获取分类列表
|
},
|
||||||
this.getCateEv();
|
// 触底
|
||||||
},
|
onReachBottom(e) {
|
||||||
onShow() {
|
if(!this.noMore){
|
||||||
// 刷新购物车信息
|
this.page++;
|
||||||
getCartInfo();
|
// 查询商品列表
|
||||||
|
this.getCommodityEv(this.cateList[this.currentIndex].id);
|
||||||
this.playTimer = setTimeout(()=>{
|
}
|
||||||
this.isplay = true;
|
},
|
||||||
},2000)
|
watch: {
|
||||||
this.vip_level = uni.getStorageSync('vip_level');
|
list() {
|
||||||
},
|
this.setTabList()
|
||||||
onReady() {
|
},
|
||||||
|
value() {
|
||||||
},
|
this.currentIndex = this.value
|
||||||
onHide() {
|
this.setTabList()
|
||||||
clearTimeout(this.playTimer);
|
}
|
||||||
this.isplay =false;
|
},
|
||||||
},
|
methods: {
|
||||||
onPageScroll(object){
|
// 获取个人信息
|
||||||
this.setTop();
|
getUserInfo(){
|
||||||
if(object.scrollTop>this.scrollTop){
|
this.$requst.get('/api/user/info').then(res=>{
|
||||||
this.isShow = false;
|
if(res.code == 0){
|
||||||
}else{
|
console.log(res,'个人信息')
|
||||||
this.isShow = true;
|
uni.setStorageSync('vip_level',res.data.vip_level);
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
// 分享到微信
|
},
|
||||||
onShareAppMessage(res) {
|
// 获取头部背景
|
||||||
|
getTabbarEv(){
|
||||||
},
|
this.$requst.get('/api/index/mini-program-setting').then(res=>{
|
||||||
// 分享到朋友圈
|
if(res.code == 0){
|
||||||
onShareTimeline(res){
|
console.log(res,'个性装扮')
|
||||||
|
this.indexBackground = this.$hostHttp + res.data.indexBackground;
|
||||||
},
|
}
|
||||||
// 触底
|
})
|
||||||
onReachBottom(e) {
|
},
|
||||||
if(!this.noMore){
|
// 获取商品分类
|
||||||
this.page++;
|
getCateEv(){
|
||||||
// 查询商品列表
|
this.$requst.get('/api/spu/category').then(res=>{
|
||||||
this.getCommodityEv(this.cateList[this.currentIndex].id);
|
if(res.code == 0){
|
||||||
}
|
console.log(res,'商品分类')
|
||||||
},
|
let cateArr =[];
|
||||||
watch: {
|
res.data.forEach(item=>{
|
||||||
list() {
|
let obj = {
|
||||||
this.setTabList()
|
id:item.id,
|
||||||
},
|
title:item.title,
|
||||||
value() {
|
cover:item.cover
|
||||||
this.currentIndex = this.value
|
}
|
||||||
this.setTabList()
|
cateArr.push(obj);
|
||||||
}
|
})
|
||||||
},
|
this.cateList = cateArr;
|
||||||
methods: {
|
this.cateWidth = this.cateList.length*158 - 58 + 'rpx';
|
||||||
// 获取个人信息
|
// 查询商品列表
|
||||||
getUserInfo(){
|
this.getCommodityEv(this.cateList[this.currentIndex].id);
|
||||||
this.$requst.get('/api/user/info').then(res=>{
|
}
|
||||||
if(res.code == 0){
|
})
|
||||||
console.log(res,'个人信息')
|
},
|
||||||
uni.setStorageSync('vip_level',res.data.vip_level);
|
|
||||||
}
|
// 查询商品列表
|
||||||
})
|
getCommodityEv(id){
|
||||||
},
|
uni.showLoading({
|
||||||
// 获取头部背景
|
title:'加载中'
|
||||||
getTabbarEv(){
|
})
|
||||||
this.$requst.get('/api/index/mini-program-setting').then(res=>{
|
let params = {
|
||||||
if(res.code == 0){
|
page:this.page,
|
||||||
console.log(res,'个性装扮')
|
size:this.size,
|
||||||
this.indexBackground = this.$hostHttp + res.data.indexBackground;
|
category_id:id
|
||||||
}
|
}
|
||||||
})
|
this.$requst.get('/api/spu/list',params).then(res=>{
|
||||||
},
|
if(res.code == 0){
|
||||||
// 获取商品分类
|
console.log(res,'商品列表')
|
||||||
getCateEv(){
|
this.total = res.data.total;
|
||||||
this.$requst.get('/api/spu/category').then(res=>{
|
let commodityArr = [];
|
||||||
if(res.code == 0){
|
res.data.list.forEach(item=>{
|
||||||
console.log(res,'商品分类')
|
let obj = {
|
||||||
let cateArr =[];
|
id:item.id,
|
||||||
res.data.forEach(item=>{
|
cover:item.cover,
|
||||||
let obj = {
|
name:item.name,
|
||||||
id:item.id,
|
original_price:item.original_price,
|
||||||
title:item.title,
|
price:item.price,
|
||||||
cover:item.cover
|
tag:item.tag,
|
||||||
}
|
stock:item.stock,
|
||||||
cateArr.push(obj);
|
sku_id:item.default_sku.id,
|
||||||
})
|
amount:item.amount,
|
||||||
this.cateList = cateArr;
|
}
|
||||||
this.cateWidth = this.cateList.length*158 - 58 + 'rpx';
|
commodityArr.push(obj)
|
||||||
// 查询商品列表
|
})
|
||||||
this.getCommodityEv(this.cateList[this.currentIndex].id);
|
this.commodityList = this.commodityList.concat(commodityArr);
|
||||||
}
|
if(this.commodityList.length==this.total){
|
||||||
})
|
this.noMore =true;
|
||||||
},
|
}
|
||||||
|
}
|
||||||
// 查询商品列表
|
uni.hideLoading();
|
||||||
getCommodityEv(id){
|
this.isLoading = true;
|
||||||
uni.showLoading({
|
})
|
||||||
title:'加载中'
|
},
|
||||||
})
|
|
||||||
let params = {
|
// 加入购物车
|
||||||
page:this.page,
|
joinCart(index){
|
||||||
size:this.size,
|
if(this.$toolAll.tools.judgeAuth()) {
|
||||||
category_id:id
|
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.commodityList[index].sku_id,num:1}).then(res=>{
|
||||||
}
|
if(res.code==0) {
|
||||||
this.$requst.get('/api/spu/list',params).then(res=>{
|
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
|
||||||
if(res.code == 0){
|
getCartInfo();
|
||||||
console.log(res,'商品列表')
|
} else {
|
||||||
this.total = res.data.total;
|
this.$toolAll.tools.showToast(res.msg)
|
||||||
let commodityArr = [];
|
}
|
||||||
res.data.list.forEach(item=>{
|
})
|
||||||
let obj = {
|
}
|
||||||
id:item.id,
|
},
|
||||||
cover:item.cover,
|
|
||||||
name:item.name,
|
// 去详情页
|
||||||
original_price:item.original_price,
|
goDetail(id){
|
||||||
price:item.price,
|
uni.navigateTo({
|
||||||
tag:item.tag,
|
url:`/pagesB/shop-detail/shop-detail?id=${id}`
|
||||||
stock:item.stock,
|
})
|
||||||
sku_id:item.default_sku.id,
|
},
|
||||||
amount:item.amount,
|
|
||||||
}
|
// 分类选择事件
|
||||||
commodityArr.push(obj)
|
changeCateEv(index) {
|
||||||
})
|
if(this.currentIndex !== index){
|
||||||
this.commodityList = this.commodityList.concat(commodityArr);
|
this.currentIndex = index;
|
||||||
if(this.commodityList.length==this.total){
|
// 获取商品列表
|
||||||
this.noMore =true;
|
this.commodityList = [];
|
||||||
}
|
this.noMore = false;
|
||||||
}
|
this.getCommodityEv(this.cateList[index].id);
|
||||||
uni.hideLoading();
|
// 分类切换效果
|
||||||
this.isLoading = true;
|
this.setTabList();
|
||||||
})
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加入购物车
|
// 分类切换效果
|
||||||
joinCart(index){
|
setTabList() {
|
||||||
if(this.$toolAll.tools.judgeAuth()) {
|
this.$nextTick(() => {
|
||||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.commodityList[index].sku_id,num:1}).then(res=>{
|
if (this.cateList.length > 0) {
|
||||||
if(res.code==0) {
|
//计算左滑距离
|
||||||
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
|
this.setLeft()
|
||||||
getCartInfo();
|
}
|
||||||
} else {
|
})
|
||||||
this.$toolAll.tools.showToast(res.msg)
|
},
|
||||||
}
|
|
||||||
})
|
//计算左滑距离
|
||||||
}
|
setLeft() {
|
||||||
},
|
let lineLeft = 0;
|
||||||
|
this.getElementData('#tab_list', (data) => {
|
||||||
// 去详情页
|
let list = data[0];
|
||||||
goDetail(id){
|
this.getElementData('#tab_item', (res) => {
|
||||||
uni.navigateTo({
|
let el = res[this.currentIndex]
|
||||||
url:`/pagesB/shop-detail/shop-detail?id=${id}`
|
lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
|
||||||
})
|
this.tabsScrollLeft = this.scrollLeft + lineLeft
|
||||||
},
|
})
|
||||||
|
})
|
||||||
// 分类选择事件
|
},
|
||||||
changeCateEv(index) {
|
|
||||||
if(this.currentIndex !== index){
|
// 计算顶部距离
|
||||||
this.currentIndex = index;
|
setTop(){
|
||||||
// 获取商品列表
|
this.getElementData('#index-cate-bg', (res) => {
|
||||||
this.commodityList = [];
|
let el = res[0];
|
||||||
this.noMore = false;
|
this.scrollTop = el.top + el.height/4;
|
||||||
this.getCommodityEv(this.cateList[index].id);
|
})
|
||||||
// 分类切换效果
|
},
|
||||||
this.setTabList();
|
|
||||||
}
|
// 获取DOM距离
|
||||||
},
|
getElementData(el, callback) {
|
||||||
|
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
||||||
// 分类切换效果
|
callback(data[0]);
|
||||||
setTabList() {
|
});
|
||||||
this.$nextTick(() => {
|
},
|
||||||
if (this.cateList.length > 0) {
|
|
||||||
//计算左滑距离
|
// 滚动
|
||||||
this.setLeft()
|
scroll(e) {
|
||||||
}
|
this.scrollLeft = e.detail.scrollLeft;
|
||||||
})
|
},
|
||||||
},
|
|
||||||
|
// 搜索结果
|
||||||
//计算左滑距离
|
doSearch(){
|
||||||
setLeft() {
|
this.showSearch = true;
|
||||||
let lineLeft = 0;
|
this.searchKeyword = this.keyword;
|
||||||
this.getElementData('#tab_list', (data) => {
|
this.keyword = '';
|
||||||
let list = data[0];
|
this.$requst.get('/api/spu/list',{keyword:this.searchKeyword}).then(res=>{
|
||||||
this.getElementData('#tab_item', (res) => {
|
if(res.code == 0){
|
||||||
let el = res[this.currentIndex]
|
console.log(res,'搜索列表')
|
||||||
lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
|
this.total = res.data.total;
|
||||||
this.tabsScrollLeft = this.scrollLeft + lineLeft
|
let searchArr = [];
|
||||||
})
|
res.data.list.forEach(item=>{
|
||||||
})
|
let obj = {
|
||||||
},
|
id:item.id,
|
||||||
|
cover:item.cover,
|
||||||
// 计算顶部距离
|
name:item.name,
|
||||||
setTop(){
|
original_price:item.original_price,
|
||||||
this.getElementData('#index-cate-bg', (res) => {
|
price:item.price,
|
||||||
let el = res[0];
|
tag:item.tag,
|
||||||
this.scrollTop = el.top + el.height/4;
|
stock:item.stock,
|
||||||
})
|
sku_id:item.default_sku.id
|
||||||
},
|
}
|
||||||
|
searchArr.push(obj)
|
||||||
// 获取DOM距离
|
})
|
||||||
getElementData(el, callback) {
|
this.searchList = this.searchList.concat(searchArr);
|
||||||
uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
|
}
|
||||||
callback(data[0]);
|
})
|
||||||
});
|
},
|
||||||
},
|
|
||||||
|
// 关闭搜索
|
||||||
// 滚动
|
closeSearch(){
|
||||||
scroll(e) {
|
this.showSearch = false;
|
||||||
this.scrollLeft = e.detail.scrollLeft;
|
this.searchKeyword = '';
|
||||||
},
|
this.searchList = [];
|
||||||
|
}
|
||||||
// 搜索结果
|
}
|
||||||
doSearch(){
|
}
|
||||||
this.showSearch = true;
|
</script>
|
||||||
this.searchKeyword = this.keyword;
|
<style>
|
||||||
this.keyword = '';
|
|
||||||
this.$requst.get('/api/spu/list',{keyword:this.searchKeyword}).then(res=>{
|
</style>
|
||||||
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>
|
|
|
@ -97,8 +97,8 @@
|
||||||
this.tag = op.tag;
|
this.tag = op.tag;
|
||||||
this.activeIndex = op.index;
|
this.activeIndex = op.index;
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
// 导航切换
|
//计算左滑距离
|
||||||
this.changeNav(op.index,op.tag);
|
this.setLeft()
|
||||||
},200)
|
},200)
|
||||||
}
|
}
|
||||||
if(op.backTag){this.backTag = op.backTag;}
|
if(op.backTag){this.backTag = op.backTag;}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
}
|
}
|
||||||
this.$requst.post('/api/user/distributor-apply',params).then(res=>{
|
this.$requst.post('/api/user/distributor-apply',params).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
this.$toolAll.tools.showToast('恭喜您申请成功o(╥﹏╥)o');
|
this.$toolAll.tools.showToast('恭喜您申请成功!');
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:`/pages/index/index`
|
url:`/pages/index/index`
|
||||||
|
|
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
|
@ -395,14 +395,17 @@ page {background-color: #FFFFFF;}
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
margin-top: -20rpx;
|
margin-top: -20rpx;
|
||||||
}
|
}
|
||||||
|
/* 顶部背景 */
|
||||||
|
.index-statis-bg{
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
/* 搜索框 */
|
/* 搜索框 */
|
||||||
.pull-search-bg{
|
.pull-search-bg{
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
position: -webkit-sticky;
|
|
||||||
position: sticky;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: 9;
|
|
||||||
}
|
}
|
||||||
.pull-search{
|
.pull-search{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -424,12 +427,10 @@ page {background-color: #FFFFFF;}
|
||||||
position: -webkit-sticky;
|
position: -webkit-sticky;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 140rpx;
|
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
.index-cate-bg.show{
|
.index-cate-bg.show{
|
||||||
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
|
box-shadow: 0 7rpx 7rpx rgba(0,0,0,.18);
|
||||||
padding-top: 20rpx;
|
|
||||||
}
|
}
|
||||||
.index-cate{
|
.index-cate{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -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, //当前输入框原值
|
var _default = { data: function data() {return { statusHeight: uni.getSystemInfoSync().statusBarHeight, originalNum: 0, //当前输入框原值
|
||||||
maxNum: 99999, //最大可输入数量
|
maxNum: 99999, //最大可输入数量
|
||||||
minNum: 1, //最小可输入数量
|
minNum: 1, //最小可输入数量
|
||||||
skuId: '', listData: [], page: 1, size: 4, total: 0, delIds: '', //删除ids
|
skuId: '', listData: [], page: 1, size: 10, total: 0, delIds: '', //删除ids
|
||||||
noMore: false, //没有更多
|
noMore: false, //没有更多
|
||||||
isLoading: true, flag: true };}, onShow: function onShow() {uni.removeStorageSync('buyList');this.listData = []; // 查询购物车列表
|
isLoading: true, flag: true };}, onShow: function onShow() {uni.removeStorageSync('buyList');this.listData = []; // 查询购物车列表
|
||||||
this.getList();}, onReachBottom: function onReachBottom() {if (!this.noMore) {this.page++; // 获取商品列表
|
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;
|
confirmDel: function confirmDel() {var _this5 = this;
|
||||||
this.$requst.post('/api/order/shopping-cart-del', { ids: this.delIds.toString() }).then(function (res) {
|
this.$requst.post('/api/order/shopping-cart-del', { ids: this.delIds.toString() }).then(function (res) {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
// 查询购物车列表
|
||||||
|
_this5.listData = [];
|
||||||
|
_this5.getList();
|
||||||
_this5.$toolAll.tools.showToast('删除成功');
|
_this5.$toolAll.tools.showToast('删除成功');
|
||||||
_this5.listData.forEach(function (item, index) {
|
|
||||||
if (item.ifcheck) {
|
|
||||||
_this5.listData.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
_this5.$toolAll.tools.showToast(res.msg);
|
_this5.$toolAll.tools.showToast(res.msg);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -314,7 +314,11 @@ var _default = {
|
||||||
},
|
},
|
||||||
// 分享到微信
|
// 分享到微信
|
||||||
onShareAppMessage: function onShareAppMessage(res) {
|
onShareAppMessage: function onShareAppMessage(res) {
|
||||||
|
var shareObj = {
|
||||||
|
imageUrl: '/static/img/shear-index.jpg' };
|
||||||
|
|
||||||
|
// 返回shareObj
|
||||||
|
return shareObj;
|
||||||
},
|
},
|
||||||
// 分享到朋友圈
|
// 分享到朋友圈
|
||||||
onShareTimeline: function onShareTimeline(res) {
|
onShareTimeline: function onShareTimeline(res) {
|
||||||
|
|
|
@ -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>
|
|
@ -284,8 +284,8 @@ var _vuex = __webpack_require__(/*! vuex */ 13); //
|
||||||
//引入mapState
|
//引入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: '', //导航宽度
|
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: '', //订单号
|
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 () {// 导航切换
|
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();}}, // 分享到微信
|
_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() {}, // 分享到朋友圈
|
onShareAppMessage: function onShareAppMessage() {}, // 分享到朋友圈
|
||||||
onShareTimeline: function onShareTimeline(res) {}, methods: { // 导航切换
|
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();
|
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();
|
||||||
|
|
|
@ -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: { // 提交申请
|
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) {
|
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) {
|
if (res.code == 0) {
|
||||||
_this.$toolAll.tools.showToast('恭喜您申请成功o(╥﹏╥)o');
|
_this.$toolAll.tools.showToast('恭喜您申请成功!');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/index/index" });
|
url: "/pages/index/index" });
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Loading…
Reference in New Issue