bug修改
parent
268fbd85f7
commit
ab67d715ed
11
App.vue
11
App.vue
|
@ -3,7 +3,7 @@
|
||||||
export default {
|
export default {
|
||||||
// 全局域名配置
|
// 全局域名配置
|
||||||
globalData:{
|
globalData:{
|
||||||
appletName:'佩丽商城'//小程序名称
|
appletName:'佩丽商城',//小程序名称
|
||||||
},
|
},
|
||||||
// 优先于show方法
|
// 优先于show方法
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
@ -51,10 +51,17 @@
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
// 检测是否登录过期或是否登录
|
// 检测是否登录过期或是否登录
|
||||||
toolAll.tools.overdue();
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
toolAll.tools.overdue();
|
||||||
|
toolAll.tools.updaX();
|
||||||
|
// 调用定时刷新token
|
||||||
|
toolAll.tools.timedRefreshToken();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
uni.removeStorageSync('isorderDetail');
|
uni.removeStorageSync('isorderDetail');
|
||||||
|
// 清除刷新token事件
|
||||||
|
toolAll.tools.clearTokenTime();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="pad-x140" :class="dataList.length ? '' : 'display-center-center'">
|
<view class="pad-x140">
|
||||||
<scroll-view scroll-y v-if="dataList.length" @scrolltolower="touchBottomEv">
|
<scroll-view scroll-y @scrolltolower="touchBottomEv" :style="{height: scrolViewheigh + 'px'}">
|
||||||
<view v-for="(item,index) in dataList" :key="index"
|
<view v-for="(item,index) in dataList" :key="index"
|
||||||
class="item-box display-between-center">
|
class="item-box display-between-center">
|
||||||
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
||||||
|
@ -13,10 +13,10 @@
|
||||||
<view @tap="goDetail(item.id)">
|
<view @tap="goDetail(item.id)">
|
||||||
<!-- 商品标题 -->
|
<!-- 商品标题 -->
|
||||||
<view class="clips2 item-title">{{item.title}}</view>
|
<view class="clips2 item-title">{{item.title}}</view>
|
||||||
<!-- 规格 -->
|
</view>
|
||||||
<view class="item-specs">
|
<!-- 规格 -->
|
||||||
<view>{{item.specs1}}</view>
|
<view class="item-specs fc line-h50">
|
||||||
</view>
|
<view v-for="(item1,index1) in item.specs" :key="index1">{{item1}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="display-between-center">
|
<view class="display-between-center">
|
||||||
<!-- 价格 -->
|
<!-- 价格 -->
|
||||||
|
@ -24,19 +24,21 @@
|
||||||
<!-- 加减按钮 -->
|
<!-- 加减按钮 -->
|
||||||
<view class="display-between-center">
|
<view class="display-between-center">
|
||||||
<!-- 减 -->
|
<!-- 减 -->
|
||||||
<button @tap="deladdEvent( item.id , index , 0)" :disabled="item.num==1" class="item-btn display-center-center">-</button>
|
<image @tap="deladdEvent( item.id , index , 0)" src="/static/public/icon-delnum.png" class="item-btn display-center-center" mode="widthFix"></image>
|
||||||
|
<!-- <view @tap="deladdEvent( item.id , index , 0)" :disabled="item.num==1" class="item-btn display-center-center">-</view> -->
|
||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<view class="input-box display-center-center">
|
<view class="input-box display-center-center">
|
||||||
<input type="text" v-model="item.num" />
|
<input type="text" @input="inputEv(index,$event)" @focus="inputFocus(index)" @blur="inputBlur(index,item.id)" v-model="item.num" />
|
||||||
</view>
|
</view>
|
||||||
<!-- 加 -->
|
<!-- 加 -->
|
||||||
<button @tap="deladdEvent( item.id , index , 1)" class="item-btn display-center-center">+</button>
|
<image @tap="deladdEvent( item.id , index , 1)" src="/static/public/icon-addnum.png" class="item-btn display-center-center" mode="widthFix"></image>
|
||||||
|
<!-- <view @tap="deladdEvent( item.id , index , 1)" class="item-btn display-center-center">+</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<pitera v-if="total==dataList.length"></pitera>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<pitera v-else></pitera>
|
|
||||||
<!-- 底部导航 -->
|
<!-- 底部导航 -->
|
||||||
<view class="display-between-center cart-foot-box">
|
<view class="display-between-center cart-foot-box">
|
||||||
<!-- 全选 -->
|
<!-- 全选 -->
|
||||||
|
@ -66,12 +68,13 @@
|
||||||
this.dataList.forEach(item=>{
|
this.dataList.forEach(item=>{
|
||||||
if(item.isActive) totalPrice += item.reckonPrice*1 * item.num*1;
|
if(item.isActive) totalPrice += item.reckonPrice*1 * item.num*1;
|
||||||
})
|
})
|
||||||
return totalPrice;
|
return this.$toolAll.tools.addXiaoShu(totalPrice);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataList:[],
|
dataList:[],
|
||||||
|
scrolViewheigh:uni.getSystemInfoSync().screenHeight - 141,
|
||||||
// dataList:[
|
// dataList:[
|
||||||
// {
|
// {
|
||||||
// id:1,
|
// id:1,
|
||||||
|
@ -148,9 +151,10 @@
|
||||||
// ],
|
// ],
|
||||||
ifCheckAll:false,
|
ifCheckAll:false,
|
||||||
page:1, // 第几页
|
page:1, // 第几页
|
||||||
size:10, // 数量
|
size:20, // 数量
|
||||||
total:0, // 总数
|
total:0, // 总数
|
||||||
pitera:false, // 是否显示暂无数据
|
tempraryData:'',//暂时储存input数据
|
||||||
|
unchangedData:''//不变的input数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 执行顺序 第一
|
// 执行顺序 第一
|
||||||
|
@ -163,6 +167,34 @@
|
||||||
this.checkList();
|
this.checkList();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
touchBottomEv(){// scroll-view触底事件
|
||||||
|
if(this.total != this.dataList.length){
|
||||||
|
this.page++;
|
||||||
|
this.checkList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 输入框获取焦点
|
||||||
|
inputFocus(index){
|
||||||
|
this.tempraryData = this.dataList[index].num;
|
||||||
|
this.unchangedData = this.dataList[index].num;
|
||||||
|
},
|
||||||
|
// 输入框失去焦点
|
||||||
|
inputBlur(index,id){
|
||||||
|
this.dataList[index].num = this.tempraryData;
|
||||||
|
// 如果改变后的数据大于初始数据,就调用加数据方法
|
||||||
|
if(this.unchangedData < this.tempraryData){
|
||||||
|
this.setShopNum(id,this.tempraryData,'up');
|
||||||
|
} else if(this.unchangedData > this.tempraryData){
|
||||||
|
this.setShopNum(id,this.tempraryData,'down');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 输入框改变事件
|
||||||
|
inputEv(index,e){
|
||||||
|
let val = e.detail.value;
|
||||||
|
if(val!=0 && val!=''){
|
||||||
|
this.tempraryData = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
// 去商品详情
|
// 去商品详情
|
||||||
goDetail(id){
|
goDetail(id){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -172,7 +204,8 @@
|
||||||
// 去结算、去购物事件
|
// 去结算、去购物事件
|
||||||
gopageEv(){
|
gopageEv(){
|
||||||
if(this.dataList.length){
|
if(this.dataList.length){
|
||||||
if(this.totalPrice){
|
console.log(this.totalPrice,207);
|
||||||
|
if(this.totalPrice!='0.00'){
|
||||||
let newList = [];
|
let newList = [];
|
||||||
this.dataList.forEach(item=>{
|
this.dataList.forEach(item=>{
|
||||||
if(item.isActive){
|
if(item.isActive){
|
||||||
|
@ -183,6 +216,7 @@
|
||||||
price:item.reckonPrice,//商品价格
|
price:item.reckonPrice,//商品价格
|
||||||
num:item.num,//商品数量
|
num:item.num,//商品数量
|
||||||
title:item.title,//商品名称
|
title:item.title,//商品名称
|
||||||
|
specs:item.specs,//商品规格
|
||||||
}
|
}
|
||||||
newList.push(obj);
|
newList.push(obj);
|
||||||
}
|
}
|
||||||
|
@ -211,9 +245,6 @@
|
||||||
this.$toolAll.tools.showToast(err.msg);
|
this.$toolAll.tools.showToast(err.msg);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
touchBottomEv(){// scroll-view触底事件
|
|
||||||
console.log(169);
|
|
||||||
},
|
|
||||||
chooseItem(index){// 商品选择
|
chooseItem(index){// 商品选择
|
||||||
this.dataList[index].isActive = !this.dataList[index].isActive
|
this.dataList[index].isActive = !this.dataList[index].isActive
|
||||||
let one = this.dataList.filter(function(item){
|
let one = this.dataList.filter(function(item){
|
||||||
|
@ -232,7 +263,12 @@
|
||||||
deladdEvent(id,cur,index){//数量加减事件
|
deladdEvent(id,cur,index){//数量加减事件
|
||||||
if(index==0){//减少数量
|
if(index==0){//减少数量
|
||||||
this.dataList[cur].num--;
|
this.dataList[cur].num--;
|
||||||
this.setShopNum(id,this.dataList[cur].num,'down');
|
if(this.dataList[cur].num > 1){
|
||||||
|
this.setShopNum(id,this.dataList[cur].num,'down');
|
||||||
|
}
|
||||||
|
if(this.dataList[cur].num==0){
|
||||||
|
this.delShop(id,cur);
|
||||||
|
}
|
||||||
} else {//增加数量
|
} else {//增加数量
|
||||||
this.dataList[cur].num++;
|
this.dataList[cur].num++;
|
||||||
this.setShopNum(id,this.dataList[cur].num,'up');
|
this.setShopNum(id,this.dataList[cur].num,'up');
|
||||||
|
@ -242,16 +278,26 @@
|
||||||
checkList(){//查询购物车列表
|
checkList(){//查询购物车列表
|
||||||
this.$requst.post('/api/order/shopping-cart',{page:this.page,size:this.size}).then(res=>{
|
this.$requst.post('/api/order/shopping-cart',{page:this.page,size:this.size}).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
if(res.data.length){
|
this.total = res.data.total;
|
||||||
res.data.forEach(item=>{
|
if(res.data.list.length){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
let newspec = [];
|
||||||
|
if(item.sku.spec_text.length){
|
||||||
|
item.sku.spec_text.forEach(itemspec=>{
|
||||||
|
for (let key in itemspec) {
|
||||||
|
newspec.push(`${key}:${itemspec[key]}`);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
coding:item.sku.coding,
|
coding:item.sku.coding,
|
||||||
isActive:false,
|
isActive:false,
|
||||||
imgSrc:item.spu.spu_cover,
|
imgSrc:item.spu.spu_cover,
|
||||||
title:item.spu_name,
|
title:item.spu_name,
|
||||||
specs1:'',
|
specs:newspec,
|
||||||
price:this.$toolAll.tools.changeNum(item.price*1),
|
// price:this.$toolAll.tools.changeNum(item.price*1),
|
||||||
|
price:item.price,
|
||||||
reckonPrice:item.price,
|
reckonPrice:item.price,
|
||||||
num:item.num
|
num:item.num
|
||||||
}
|
}
|
||||||
|
@ -266,6 +312,21 @@
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
this.$toolAll.tools.showToast(err.msg);
|
this.$toolAll.tools.showToast(err.msg);
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 删除购物车商品
|
||||||
|
delShop(id,index){
|
||||||
|
this.$requst.post('/api/order/shopping-cart-del',{id:id}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.$toolAll.tools.showToast('删除成功');
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.dataList.splice(index,1);
|
||||||
|
},1000)
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast(res.msg);
|
||||||
|
}
|
||||||
|
}).catch(err=>{
|
||||||
|
this.$toolAll.tools.showToast(err.msg);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +361,7 @@
|
||||||
.input-box {width: 78rpx;height: 40rpx;border-radius: 10rpx;margin: 0 6rpx; border: 1rpx solid #000000;overflow: hidden;}
|
.input-box {width: 78rpx;height: 40rpx;border-radius: 10rpx;margin: 0 6rpx; border: 1rpx solid #000000;overflow: hidden;}
|
||||||
input {text-align: center;}
|
input {text-align: center;}
|
||||||
.item-btn {width: 40rpx;height: 40rpx;border-radius: 10rpx;background-color: #000000;color: #FFFFFF;padding: 0rpx;}
|
.item-btn {width: 40rpx;height: 40rpx;border-radius: 10rpx;background-color: #000000;color: #FFFFFF;padding: 0rpx;}
|
||||||
|
.item-btn:first-child {padding-top: -12rpx!important;}
|
||||||
/* 底部导航 */
|
/* 底部导航 */
|
||||||
.cart-foot-box{position: fixed;bottom: 0;left: 0;right: 0;z-index: 2; height: 130rpx;background-color: #efefef;font-size: 30rpx;}
|
.cart-foot-box{position: fixed;bottom: 0;left: 0;right: 0;z-index: 2; height: 130rpx;background-color: #efefef;font-size: 30rpx;}
|
||||||
.circle-check-all {width: 33rpx;height: 33rpx;margin: 0 10rpx 0 30rpx;}
|
.circle-check-all {width: 33rpx;height: 33rpx;margin: 0 10rpx 0 30rpx;}
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
// 执行顺序 第一
|
// 执行顺序 第一
|
||||||
beforeCreate(){
|
beforeCreate(){
|
||||||
// 检测是否登录过期或是否登录
|
// 检测是否登录过期或是否登录
|
||||||
this.$toolAll.tools.overdue();
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.overdue();
|
||||||
|
}
|
||||||
this.exist = uni.getStorageSync('token');
|
this.exist = uni.getStorageSync('token');
|
||||||
this.exist ? this.loading = false : this.loading = true;
|
this.exist ? this.loading = false : this.loading = true;
|
||||||
},
|
},
|
||||||
|
@ -41,7 +43,6 @@
|
||||||
},
|
},
|
||||||
// 执行顺序 第四
|
// 执行顺序 第四
|
||||||
mounted(){
|
mounted(){
|
||||||
this.log(uni.getStorageSync('token'),4)
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},500)
|
},500)
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
<view class="auth-top">
|
<view class="auth-top">
|
||||||
<image :src="appletImg" mode=""></image>
|
<image :src="appletImg" mode=""></image>
|
||||||
<view class="auth-top-content">
|
<view class="auth-top-content">
|
||||||
<view>恒美植发客服代表提醒您:</view>
|
<view>佩丽饰品客服代表提醒您:</view>
|
||||||
<view>您当前是游客身份</view>
|
<view>您当前是游客身份</view>
|
||||||
<view>是否选择授权登录</view>
|
<view>是否选择授权登录</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="auth-center">申请 获取你的昵称、头像、地区及性别</view>
|
<view class="auth-center">申请 获取你的昵称、头像</view>
|
||||||
<view class="auth-bottom">
|
<view class="auth-bottom">
|
||||||
<view @tap="chooseBtn(0)" :class="isNo?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
<view @tap="chooseBtn(0)" :class="isNo?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
||||||
<view @tap="chooseBtn(1)" :class="isOk?'isOyin':'noyin'" class="btn btn-yes">
|
<view @tap="chooseBtn(1)" :class="isOk?'isOyin':'noyin'" class="btn btn-yes">
|
||||||
|
@ -25,9 +25,11 @@
|
||||||
export default {
|
export default {
|
||||||
name:"empower",
|
name:"empower",
|
||||||
props:{
|
props:{
|
||||||
vision:{
|
paramObj:{
|
||||||
type:Boolean,
|
type:Object,
|
||||||
default:false
|
default:()=>{
|
||||||
|
return {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
appletImg:{//小程序头像
|
appletImg:{//小程序头像
|
||||||
type:String,
|
type:String,
|
||||||
|
@ -50,8 +52,18 @@
|
||||||
return {
|
return {
|
||||||
isOk:false,
|
isOk:false,
|
||||||
isNo:false,
|
isNo:false,
|
||||||
|
vision:false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log(this.paramObj);
|
||||||
|
setTimeout(()=>{
|
||||||
|
console.log(1);
|
||||||
|
if(this.paramObj.invite_code!=undefined && uni.getStorageSync('is_active')!=1){
|
||||||
|
this.vision = true;
|
||||||
|
}
|
||||||
|
},2000)
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
moveHandle(){
|
moveHandle(){
|
||||||
return false
|
return false
|
||||||
|
@ -128,14 +140,13 @@
|
||||||
},error => {})
|
},error => {})
|
||||||
},
|
},
|
||||||
successAfterEv(userInfo){//缓存信息
|
successAfterEv(userInfo){//缓存信息
|
||||||
let ya = this
|
|
||||||
uni.hideToast()
|
uni.hideToast()
|
||||||
// console.log(uni.getStorageSync('headImg'));
|
// console.log(uni.getStorageSync('headImg'));
|
||||||
ya.$toolAll.tools.showToast('授权成功','success')
|
this.$toolAll.tools.showToast('授权成功','success')
|
||||||
ya.$emit('cancleEv',0)
|
this.$emit('cancleEv',0)
|
||||||
ya.$emit('buttonH',true)
|
this.$emit('buttonH',true)
|
||||||
if(ya.url!=''){
|
if(this.url!=''){
|
||||||
setTimeout(()=>{uni.navigateTo({url:ya.url})},1000)
|
setTimeout(()=>{uni.navigateTo({url:this.url})},1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,6 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isCustomerService:false,//是否存在客服 默认不存在客服
|
isCustomerService:false,//是否存在客服 默认不存在客服
|
||||||
check:uni.getStorageSync('is_active')
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -133,7 +132,7 @@
|
||||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
if(this.check) {
|
if(uni.getStorageSync('phone_active')) {
|
||||||
switch (index){
|
switch (index){
|
||||||
case 1:
|
case 1:
|
||||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<!-- 返回键 -->
|
<!-- 返回键 -->
|
||||||
<view class="return-box" @tap="backEv" v-if="ifReturn"
|
<view class="return-box" @tap="backEv" v-if="ifReturn"
|
||||||
:style="{height: navBarHeight+'px'}">
|
:style="{height: navBarHeight+'px'}">
|
||||||
<i class="icon icon-return"
|
<i class="icon icon-return" style="font-size: 40rpx;"
|
||||||
:style="{color: returnColor}"></i>
|
:style="{color: returnColor}"></i>
|
||||||
</view>
|
</view>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
|
@ -96,16 +96,21 @@
|
||||||
// 获取当前页面路径
|
// 获取当前页面路径
|
||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
let route = pages[pages.length - 1].route;
|
let route = pages[pages.length - 1].route;
|
||||||
|
uni.setStorageSync('url',`/${route}?invite_code=${uni.getStorageSync('invite_code')}`);
|
||||||
this.log(route,'status-nav组件打印:当前页面路径')
|
this.log(route,'status-nav组件打印:当前页面路径')
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
//返回事件
|
//返回事件
|
||||||
backEv(){
|
backEv(){
|
||||||
|
this.fromWhere = uni.getStorageSync('outside')*1;
|
||||||
|
console.log(this.fromWhere,106);
|
||||||
switch (this.fromWhere){
|
switch (this.fromWhere){
|
||||||
case 1:
|
case 1:
|
||||||
|
case 2:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/tabbar/pagehome/pagehome'
|
url:'/pages/tabbar/pagehome/pagehome'
|
||||||
})
|
})
|
||||||
|
uni.setStorageSync('outside',0)
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
|
@ -141,7 +146,7 @@
|
||||||
.return-box i {font-size: 56rpx;}
|
.return-box i {font-size: 56rpx;}
|
||||||
.tab-title{
|
.tab-title{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 36rpx;font-weight: bold;
|
font-size: 38rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.tab-title .title-box{margin-top: -4rpx;}
|
.tab-title .title-box{margin-top: -4rpx;}
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
bcurrent:0,
|
bcurrent:0,
|
||||||
isShowVideo:false,
|
isShowVideo:false,
|
||||||
autoplay:false,
|
autoplay:false,
|
||||||
isVedio:true
|
isVedio:uni.getStorageSync('is_vedio')
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
export default {
|
export default {
|
||||||
onShareAppMessage(res) { //发送给朋友
|
onShareAppMessage(res) { //发送给朋友
|
||||||
return {}
|
return {
|
||||||
|
title: '', // 默认是小程序的名称(可以写slogan等)
|
||||||
|
path: uni.getStorageSync('url') // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onShareTimeline(res) {//分享到朋友圈
|
onShareTimeline(res) {//分享到朋友圈
|
||||||
return {}
|
return {}
|
||||||
|
|
|
@ -130,7 +130,12 @@ const tools = {
|
||||||
// 整数添加.00,小数就不添加
|
// 整数添加.00,小数就不添加
|
||||||
addXiaoShu(num){
|
addXiaoShu(num){
|
||||||
let str = num.toString();
|
let str = num.toString();
|
||||||
return str.includes('.') ? num : num = num + '.00';
|
if(str.length > 9){
|
||||||
|
str = str*1;
|
||||||
|
str = str.toFixed(2);
|
||||||
|
str = str+'';
|
||||||
|
}
|
||||||
|
return str.includes('.') ? str*1 : str = num + '.00';
|
||||||
},
|
},
|
||||||
// type:+加、-减、*乘、/除
|
// type:+加、-减、*乘、/除
|
||||||
// len:小数后保留几位
|
// len:小数后保留几位
|
||||||
|
@ -312,24 +317,11 @@ const tools = {
|
||||||
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
|
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
|
||||||
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; }).replace('<section', '<div').replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto" ').replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
|
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; }).replace('<section', '<div').replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto" ').replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
|
||||||
},
|
},
|
||||||
// 延迟跳转
|
|
||||||
setTime(url,title,time){
|
|
||||||
// console.log(url,title,time);
|
|
||||||
if(url=='' && title==''){
|
|
||||||
setTimeout(function(){uni.navigateBack({delta:1,})},time)
|
|
||||||
} else if(title==''){
|
|
||||||
setTimeout(function(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:url
|
|
||||||
})
|
|
||||||
},time)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
updaX(){//检测小程序版本以及更新小程序
|
updaX(){//检测小程序版本以及更新小程序
|
||||||
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
|
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
|
||||||
const accountInfo = wx.getAccountInfoSync();//使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
const accountInfo = wx.getAccountInfoSync();//使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
||||||
var version = accountInfo.miniProgram.version
|
var version = accountInfo.miniProgram.version;
|
||||||
console.log(version);
|
console.log(version,319);
|
||||||
// 检测小程序的更新
|
// 检测小程序的更新
|
||||||
const updateManager = wx.getUpdateManager()//以下使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81
|
const updateManager = wx.getUpdateManager()//以下使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81
|
||||||
updateManager.onCheckForUpdate(function (res) {
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
|
@ -338,9 +330,9 @@ const tools = {
|
||||||
})
|
})
|
||||||
updateManager.onUpdateReady(function (res) {
|
updateManager.onUpdateReady(function (res) {
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '恒美植发客服代表提醒您',
|
title: `更新`,
|
||||||
content: '新版本已经准备就绪,是否重启应用',
|
content: `新版本${version}已上线,是否重启应用`,
|
||||||
success(res) {
|
success:(res)=> {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
updateManager.applyUpdate()
|
updateManager.applyUpdate()
|
||||||
|
@ -364,7 +356,7 @@ const tools = {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
let hInfo = wx.getAccountInfoSync();
|
let hInfo = wx.getAccountInfoSync();
|
||||||
// console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版
|
// console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版
|
||||||
if(hInfo.miniProgram.envVersion != "develop"){
|
if(hInfo.miniProgram.envVersion == "release"){
|
||||||
console.log = () =>{}
|
console.log = () =>{}
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -372,7 +364,8 @@ const tools = {
|
||||||
overdue(){//查询过期时间和是否有token,并调用登录事件
|
overdue(){//查询过期时间和是否有token,并调用登录事件
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
var timestamp = date.getTime();//精确到毫秒
|
var timestamp = date.getTime();//精确到毫秒
|
||||||
if((uni.getStorageSync('expire')*1000) - 10000 < timestamp || uni.getStorageSync('token')==''){
|
console.log('进入检测登录',375);
|
||||||
|
if((uni.getStorageSync('expire')*1000) - 60000 < timestamp || uni.getStorageSync('token')==''){
|
||||||
this.loginEv();
|
this.loginEv();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -382,7 +375,7 @@ const tools = {
|
||||||
success: (res)=> {
|
success: (res)=> {
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
let code = res.code;
|
let code = res.code;
|
||||||
let obj = uni.getStorageSync('params')
|
let obj = uni.getStorageSync('params');
|
||||||
var params = {
|
var params = {
|
||||||
invite_code: uni.getStorageSync('is_active')!='' ? uni.getStorageSync('invite_code') : '',
|
invite_code: uni.getStorageSync('is_active')!='' ? uni.getStorageSync('invite_code') : '',
|
||||||
code:code,
|
code:code,
|
||||||
|
@ -410,8 +403,8 @@ const tools = {
|
||||||
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
|
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
|
||||||
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
|
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
|
||||||
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
|
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
|
||||||
uni.setStorageSync('userId',res.data.data.account_id)
|
uni.setStorageSync('userId',res.data.data.account_id)//用户id
|
||||||
uni.setStorageSync('invite_code',res.data.data.invite_code)
|
uni.setStorageSync('invite_code',res.data.data.invite_code)//邀请码
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -470,7 +463,7 @@ const tools = {
|
||||||
},
|
},
|
||||||
isVedio(){//是否显示视频内容
|
isVedio(){//是否显示视频内容
|
||||||
uni.request({
|
uni.request({
|
||||||
url: `${uni.getStorageSync('hostapi')}index/base-config`,
|
url: `${uni.getStorageSync('hostapi')}/api/index/base-config`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json; charset=UTF-8',
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
@ -478,14 +471,47 @@ const tools = {
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if(res.data.code==0){
|
if(res.data.code==0){
|
||||||
// if(res.data.data.v==0) {
|
if(res.data.data.v==0) {
|
||||||
// uni.setStorageSync('isVedio',false);
|
uni.setStorageSync('is_vedio',false);
|
||||||
// } else {
|
} else {
|
||||||
// uni.setStorageSync('isVedio',true);
|
uni.setStorageSync('is_vedio',true);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 清空分享过来的缓存
|
||||||
|
clearShare(){
|
||||||
|
uni.removeStorageSync('existCode');
|
||||||
|
uni.removeStorageSync('transientUrl');
|
||||||
|
},
|
||||||
|
// 前往登录页
|
||||||
|
goLogin(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login.vue'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取当前页面url
|
||||||
|
obtainUrl(){
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let route = pages[pages.length - 1].route;
|
||||||
|
console.log(`/${route}`,'tools.js:当前页面路径')
|
||||||
|
return `/${route}`;
|
||||||
|
},
|
||||||
|
tokenTime:null,
|
||||||
|
// 定时刷新token
|
||||||
|
timedRefreshToken(){
|
||||||
|
console.log('开启了刷新token事件');
|
||||||
|
this.loginEv();
|
||||||
|
clearInterval(this.tokenTime);
|
||||||
|
this.tokenTime = setInterval(()=>{
|
||||||
|
this.loginEv();
|
||||||
|
},1000*3200)
|
||||||
|
},
|
||||||
|
// 清除刷新token
|
||||||
|
clearTokenTime(){
|
||||||
|
console.log('清除了刷新token事件');
|
||||||
|
clearInterval(this.tokenTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
9
main.js
9
main.js
|
@ -7,8 +7,11 @@ Vue.component('status-nav',statusNav);//全局注册状态栏组件
|
||||||
import nothingPage from './components/nothing-page.vue';//引入无内容组件
|
import nothingPage from './components/nothing-page.vue';//引入无内容组件
|
||||||
Vue.component('nothing-page',nothingPage);//全局注册无内容组件
|
Vue.component('nothing-page',nothingPage);//全局注册无内容组件
|
||||||
|
|
||||||
import authUserInfoMobile from './components/auth-userInfo-mobile.vue';//引入授权用户信息,授权手机号组件
|
// import empower from './components/empower.vue';//引入授权用户信息组件
|
||||||
Vue.component('auth-userInfo-mobile',authUserInfoMobile);//全局注册授权用户信息,授权手机号组件
|
// Vue.component('empower',empower);//全局注册授权用户信息组件
|
||||||
|
|
||||||
|
// import authUserInfoMobile from './components/auth-userInfo-mobile.vue';//引入授权用户信息,授权手机号组件
|
||||||
|
// Vue.component('auth-userInfo-mobile',authUserInfoMobile);//全局注册授权用户信息,授权手机号组件
|
||||||
|
|
||||||
import containerSubgroup from './components/containers/container-subgroup.vue';//引入容器组件
|
import containerSubgroup from './components/containers/container-subgroup.vue';//引入容器组件
|
||||||
Vue.component('container-subgroup',containerSubgroup);//全局注册容器组件
|
Vue.component('container-subgroup',containerSubgroup);//全局注册容器组件
|
||||||
|
@ -23,7 +26,7 @@ Vue.prototype.$toolAll = tools;
|
||||||
import requst from '@/jsFile/requst.js';
|
import requst from '@/jsFile/requst.js';
|
||||||
Vue.prototype.$requst = requst;
|
Vue.prototype.$requst = requst;
|
||||||
// 图片域名,专治后台仔没有返回http/https的图片
|
// 图片域名,专治后台仔没有返回http/https的图片
|
||||||
Vue.prototype.$http = 'https://oss.hmzfyy.cn';
|
Vue.prototype.$http = 'https://peili.scdxtc.cn';
|
||||||
|
|
||||||
const {log} = console;
|
const {log} = console;
|
||||||
Vue.prototype.log = log;
|
Vue.prototype.log = log;
|
||||||
|
|
|
@ -22,7 +22,15 @@
|
||||||
content:'<p>1.用户协议谢谢洗诶诶黑货币的宁波</p>'
|
content:'<p>1.用户协议谢谢洗诶诶黑货币的宁波</p>'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
uni.removeStorageSync('transientUrl');
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('transientUrl',`/pages/login/agreement?invite_code=${options.invite_code}}`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
this.$toolAll.tools.escape2Html(this.content)
|
this.$toolAll.tools.escape2Html(this.content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,17 +67,25 @@
|
||||||
refuse(){//暂不绑定事件
|
refuse(){//暂不绑定事件
|
||||||
this.isShowP=false;
|
this.isShowP=false;
|
||||||
this.$toolAll.tools.showToast('登录成功','success')
|
this.$toolAll.tools.showToast('登录成功','success')
|
||||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||||
},
|
},
|
||||||
getphonenumber(e){//授权绑定手机号
|
getphonenumber(e){//授权绑定手机号
|
||||||
let ya = this;
|
let ya = this;
|
||||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
this.$requst.post('/api/user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||||
console.log('手机号信息:',res);
|
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||||
uni.setStorageSync('bindPhone',false)
|
uni.setStorageSync('phone_active',1)//是否第一次授权
|
||||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
let newUrl = uni.getStorageSync('transientUrl');
|
||||||
|
// 如果是其他地方过来的有路径,授权成功后返回到过来的页面
|
||||||
|
if(newUrl){
|
||||||
|
uni.reLaunch({
|
||||||
|
url:newUrl
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 返回首页
|
||||||
|
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||||
|
}
|
||||||
} else this.$toolAll.tools.showToast(res.msg);
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
},error=>{})
|
},error=>{})
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,9 +143,9 @@
|
||||||
city: this.userInfo.city,//用户所在城市
|
city: this.userInfo.city,//用户所在城市
|
||||||
gender: this.userInfo.gender,//用户性别
|
gender: this.userInfo.gender,//用户性别
|
||||||
language:this.userInfo.language,//语言
|
language:this.userInfo.language,//语言
|
||||||
is_active:1
|
is_active:1,
|
||||||
|
invite_code: uni.getStorageSync('existCode'),
|
||||||
}
|
}
|
||||||
this.log(params,138)
|
|
||||||
this.$requst.post('/api/user/login',params).then(res => {
|
this.$requst.post('/api/user/login',params).then(res => {
|
||||||
if(res.data.token!=''){
|
if(res.data.token!=''){
|
||||||
uni.setStorageSync('params',params)
|
uni.setStorageSync('params',params)
|
||||||
|
@ -147,11 +155,21 @@
|
||||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||||
uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权
|
uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权
|
||||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||||
uni.navigateTo({
|
if(res.data.phone_active){
|
||||||
url:'/pages/tabbar/pagehome/pagehome'
|
let newUrl = uni.getStorageSync('transientUrl');
|
||||||
})
|
// 如果是其他地方过来的有路径,授权成功后返回到过来的页面
|
||||||
// uni.hideToast();
|
if(newUrl){
|
||||||
// this.isShowP = true;
|
uni.reLaunch({
|
||||||
|
url:newUrl
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/tabbar/pagehome/pagehome'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isShowP = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},error => {})
|
},error => {})
|
||||||
}
|
}
|
||||||
|
@ -168,4 +186,8 @@
|
||||||
.login-btn {width: 80%;margin-top: 50%;}
|
.login-btn {width: 80%;margin-top: 50%;}
|
||||||
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
|
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
|
||||||
.xieCon{color: @tcolorp;}
|
.xieCon{color: @tcolorp;}
|
||||||
|
|
||||||
|
.tank-box{margin: 0 60rpx;}
|
||||||
|
.tank-box-itemone{margin: 30rpx 0;}
|
||||||
|
.tank-btn{padding: 10rpx 30rpx;}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -27,6 +27,18 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code)
|
||||||
|
uni.setStorageSync('transientUrl',`/pages/tabbar/cate/cate`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<container-subgroup>
|
<container-subgroup>
|
||||||
<view slot="content">
|
<view slot="content">
|
||||||
<view class="pad30 sort-box mar-x20" style="margin-left: -30rpx;margin-right: -30rpx;" :style="{top: statusBarHeight+'px'}">
|
<view class="pad30 sort-box mar-x20" style="margin-left: -30rpx;margin-right: -30rpx;" :style="{top: statusBarHeight+'px'}">
|
||||||
<view class="col0 fon38 disjbac fon50">
|
<view class="col0 fon38 disjbac">
|
||||||
<view>分类筛选</view>
|
<view>分类筛选</view>
|
||||||
<i @tap="clikScreenIcon" class="icon icon-screen" style="font-size: 50rpx;"></i>
|
<i @tap="clikScreenIcon" class="icon icon-screen" style="font-size: 50rpx;"></i>
|
||||||
</view>
|
</view>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<view class="disac pad-sx10 pad-zy20 radius20 mar-y20 mar-x20"
|
<view class="disac pad-sx10 pad-zy20 radius20 mar-y20 mar-x20"
|
||||||
:class="childitem.isCheck ? 'bac0 colf' : 'colpeili'"
|
:class="childitem.isCheck ? 'bac0 colf' : 'colpeili'"
|
||||||
v-for="(childitem,childindex) in item.childrenList" :key="childindex"
|
v-for="(childitem,childindex) in item.childrenList" :key="childindex"
|
||||||
@tap.stop="chooseCate(index,childindex)">
|
@tap.stop="chooseCate(index,childindex,item.mainTitle)">
|
||||||
{{childitem.title}}<i v-if="childitem.isCheck" class="icon icon-check mar-z20" style="font-size: 30rpx;"></i>
|
{{childitem.title}}<i v-if="childitem.isCheck" class="icon icon-check mar-z20" style="font-size: 30rpx;"></i>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -169,10 +169,19 @@
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 调用获取筛选条件列表事件
|
if(uni.getStorageSync('phone_active')){
|
||||||
this.obtainScreen();
|
this.$toolAll.tools.clearShare();
|
||||||
// 调用商品列表查询事件
|
// 调用获取筛选条件列表事件
|
||||||
this.implementEv();
|
this.obtainScreen();
|
||||||
|
// 调用商品列表查询事件
|
||||||
|
this.implementEv();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pages/tabbar/cate/cate`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取筛选条件列表
|
// 获取筛选条件列表
|
||||||
|
@ -212,16 +221,20 @@
|
||||||
this.isScreen = true;
|
this.isScreen = true;
|
||||||
},
|
},
|
||||||
// 分类选择事件
|
// 分类选择事件
|
||||||
chooseCate(mainIndex,childrenIndex){
|
chooseCate(mainIndex,childrenIndex,title){
|
||||||
// 清除分类所有选中项
|
// 清除分类所有选中项
|
||||||
this.screenList[mainIndex].childrenList.forEach((item,index)=>{
|
this.screenList[mainIndex].childrenList.forEach((item,index)=>{
|
||||||
item.isCheck = false;
|
item.isCheck = false;
|
||||||
})
|
})
|
||||||
console.log(this.screenList);
|
let screenIndex = this.screenList.findIndex(item=>item.mainTitle==title);
|
||||||
// 设置分类id
|
if(screenIndex==0){
|
||||||
this.categoryId = this.screenList[0].childrenList[childrenIndex].id;
|
// 设置分类id
|
||||||
// 设置限时优惠
|
this.categoryId = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
||||||
this.activityStr = this.screenList[1].childrenList[childrenIndex].id;
|
}
|
||||||
|
if(screenIndex==1){
|
||||||
|
// 设置限时优惠
|
||||||
|
this.activityStr = this.screenList[screenIndex].childrenList[childrenIndex].id;
|
||||||
|
}
|
||||||
// 将当前选择的类别下的数组置空
|
// 将当前选择的类别下的数组置空
|
||||||
this.temporaryCate[mainIndex] = [];
|
this.temporaryCate[mainIndex] = [];
|
||||||
// 设置当前选中项为true
|
// 设置当前选中项为true
|
||||||
|
|
|
@ -108,7 +108,15 @@
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pages/tabbar/my/my`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
chooseOrderStatus(index){
|
chooseOrderStatus(index){
|
||||||
|
@ -130,8 +138,11 @@
|
||||||
this.orderStatus[0].num = this.userInfo.order_count.waiting;//待付款
|
this.orderStatus[0].num = this.userInfo.order_count.waiting;//待付款
|
||||||
this.orderStatus[1].num = this.userInfo.order_count.paid;//待发货
|
this.orderStatus[1].num = this.userInfo.order_count.paid;//待发货
|
||||||
this.orderStatus[2].num = this.userInfo.order_count.shipped;//待收货
|
this.orderStatus[2].num = this.userInfo.order_count.shipped;//待收货
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast(res.msg);
|
||||||
|
this.$toolAll.tools.goLogin();
|
||||||
}
|
}
|
||||||
},error=>{})
|
},error=>{this.$toolAll.tools.showToast(error.msg);})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,37 +16,37 @@
|
||||||
<!-- 搜索输入框 end -->
|
<!-- 搜索输入框 end -->
|
||||||
|
|
||||||
<!-- 轮播图 start -->
|
<!-- 轮播图 start -->
|
||||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'230'" :newRadius="'15'" :newBottom="'10'"></swiper-pu>
|
<swiper-pu v-if="bannerList.length" :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'230'" :newRadius="'15'" :newBottom="'10'"></swiper-pu>
|
||||||
<!-- 轮播图 end -->
|
<!-- 轮播图 end -->
|
||||||
</view>
|
</view>
|
||||||
<view style="position: sticky;z-index: 10;" :style="{ top: statusBarHeight +'px'}">
|
<view class="tab-nav" style="position: sticky;z-index: 10;" :style="{ top: statusBarHeight +'px'}">
|
||||||
<swiper-tab id="tab" :list="classifyList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000">
|
<swiper-tab id="tab" :list="classifyList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000">
|
||||||
<!-- 自定义tabs样式 -->
|
<!-- 自定义tabs样式 -->
|
||||||
<!-- <view slot="title"></view> -->
|
<!-- <view slot="title"></view> -->
|
||||||
</swiper-tab>
|
</swiper-tab>
|
||||||
</view>
|
</view>
|
||||||
<view class="pad-zy40 mar-x160">
|
<view class="pad-zy40" style="padding-bottom: 66px;">
|
||||||
<swiper class="swiper-page pad-s40" :style="{ height: swiperHeight - statusBarHeight +'px'}" :current="current" @change="swiperChange">
|
<swiper class="swiper-page pad-s40" :style="{ height: swiperHeight - (statusBarHeight + 126) +'px'}" :current="current" @change="swiperChange">
|
||||||
<swiper-item v-for="(item,index) in classifyList" :key="index">
|
<swiper-item v-for="(item,index) in classifyList" :key="index">
|
||||||
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
|
<scroll-view :scroll-y="isScroll" @scrolltolower="scrollBottomEv" :style="{ height: swiperHeight - (statusBarHeight + 126) +'px'}">
|
||||||
<!-- 活动商品 start -->
|
<!-- 活动商品 start -->
|
||||||
<view v-for="(item,index) in dataList[index][0]" :key="index" class="mar-x50">
|
<view v-for="(item1,index1) in dataList[index][0]" :key="index1" class="mar-x50">
|
||||||
<h1 class="fon36 bold">{{item.name}}</h1>
|
<h1 class="fon36 bold">{{item1.name}}</h1>
|
||||||
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.subtitle}}</view>
|
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item1.subtitle}}</view>
|
||||||
<view class="posir" @tap="goDetail(item.id)">
|
<view class="posir" @tap="goDetail(item1.id)">
|
||||||
<image class="radius30 animated fadeIn" :src="item.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
<image class="radius30 animated fadeIn" :src="item1.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
||||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
<view v-if="item1.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 活动商品 end -->
|
<!-- 活动商品 end -->
|
||||||
|
|
||||||
<!-- 子商品 start -->
|
<!-- 子商品 start -->
|
||||||
<view class="disjbac fw">
|
<view class="disjbac fw">
|
||||||
<view @tap="goDetail(item.id)" class="width47 mar-x50 posir" v-for="(item,index) in dataList[index][1]" :key="index">
|
<view @tap="goDetail(item2.id)" class="width47 mar-x50 posir" v-for="(item2,index2) in dataList[index][1]" :key="index2">
|
||||||
<image :src="item.cover" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
<image :src="item2.cover" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item.name}}</view>
|
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item2.name}}</view>
|
||||||
<view class="fon30 colpeili">¥{{item.price}}</view>
|
<view class="fon30 colpeili">¥{{item2.price}}</view>
|
||||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
<view v-if="item2.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 子商品 end -->
|
<!-- 子商品 end -->
|
||||||
|
@ -63,6 +63,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
var app = getApp();
|
||||||
// tab组件
|
// tab组件
|
||||||
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
|
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
|
||||||
// 轮播图组件
|
// 轮播图组件
|
||||||
|
@ -94,12 +95,12 @@
|
||||||
// }
|
// }
|
||||||
],
|
],
|
||||||
current:0, // 当前显示tab及swiper列表
|
current:0, // 当前显示tab及swiper列表
|
||||||
swiperHeight:uni.getSystemInfoSync().windowHeight,
|
swiperHeight:uni.getSystemInfoSync().screenHeight,
|
||||||
publicColor:'', // 主题颜色
|
publicColor:'', // 主题颜色
|
||||||
showTop:false, // 是否显示回到顶部
|
showTop:false, // 是否显示回到顶部
|
||||||
dataList:[], // 数据列表
|
dataList:[], // 数据列表
|
||||||
page:1, // 第几页
|
page:1, // 第几页
|
||||||
size:5, // 数量
|
size:200, // 数量
|
||||||
total:0, // 总数
|
total:0, // 总数
|
||||||
titleList:uni.getStorageSync('footTitle'), // 底部导航文字
|
titleList:uni.getStorageSync('footTitle'), // 底部导航文字
|
||||||
imgList:uni.getStorageSync('footimg'), // 底部导航图标
|
imgList:uni.getStorageSync('footimg'), // 底部导航图标
|
||||||
|
@ -109,13 +110,21 @@
|
||||||
refNum:0, // 刷新次数
|
refNum:0, // 刷新次数
|
||||||
bannerList:[], // 轮播图
|
bannerList:[], // 轮播图
|
||||||
isAutoPlay:false,// 是否开启自动轮播
|
isAutoPlay:false,// 是否开启自动轮播
|
||||||
check:uni.getStorageSync('is_active'),
|
|
||||||
classifyId:'',//分类id
|
classifyId:'',//分类id
|
||||||
noMore:false,
|
noMore:false,
|
||||||
|
isScroll:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false;
|
e.scrollTop > 360 ? this.showTop = true : this.showTop = false;
|
||||||
|
let info = uni.createSelectorQuery().select('.tab-nav');
|
||||||
|
info.boundingClientRect(data=>{
|
||||||
|
if(data.top==this.statusBarHeight){
|
||||||
|
this.isScroll = true;
|
||||||
|
} else {
|
||||||
|
this.isScroll = false;
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
// 关闭自动轮播
|
// 关闭自动轮播
|
||||||
|
@ -127,9 +136,9 @@
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
// 获取ID为tab元素的信息
|
// 获取ID为tab元素的信息
|
||||||
uni.createSelectorQuery().in(this).select('#tab').boundingClientRect().exec(rect => {
|
// uni.createSelectorQuery().in(this).select('#tab').boundingClientRect().exec(rect => {
|
||||||
this.swiperHeight = this.swiperHeight - rect[0].height - 150
|
// this.swiperHeight = this.swiperHeight - rect[0].height
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// 网络检测
|
// 网络检测
|
||||||
|
@ -144,6 +153,10 @@
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
// 查询是否显示视频
|
||||||
|
this.$toolAll.tools.isVedio();
|
||||||
|
// 获取当前页面url
|
||||||
|
this.$toolAll.tools.obtainUrl();
|
||||||
// if(options.q!=undefined){
|
// if(options.q!=undefined){
|
||||||
// // 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
// // 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
||||||
// // 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
// // 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
||||||
|
@ -167,10 +180,20 @@
|
||||||
// }).exec()
|
// }).exec()
|
||||||
this.checkSwi();//查询轮播图
|
this.checkSwi();//查询轮播图
|
||||||
this.classifyEv();// 调用分类查询事件
|
this.classifyEv();// 调用分类查询事件
|
||||||
|
if(options.invite_code!=undefined){
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pages/tabbar/my/my`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goDetail(id){//前往详情页
|
goDetail(id){//前往详情页
|
||||||
if(this.check){
|
if(uni.getStorageSync('phone_active')){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||||
})
|
})
|
||||||
|
@ -286,7 +309,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchEv(){//搜索事件
|
searchEv(){//搜索事件
|
||||||
if(this.check){
|
if(uni.getStorageSync('phone_active')){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pagesB/searchPage/searchPage?keyWorld=${ this.searchText }`
|
url:`/pagesB/searchPage/searchPage?keyWorld=${ this.searchText }`
|
||||||
})
|
})
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-s20">
|
<view class="disjbac mar-s20">
|
||||||
<view class="fon24 colpeili">{{item.created_at}}</view>
|
<view class="fon24 colpeili">{{item.created_at}}</view>
|
||||||
<view class="fon30 peili-colorRed bold">-{{item.price}}</view>
|
<view class="fon30 peili-colorRed bold">{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -128,9 +128,19 @@
|
||||||
this.checkCommissionEv();
|
this.checkCommissionEv();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
// 调取佣金信息事件
|
if(uni.getStorageSync('phone_active')){
|
||||||
this.checkCommissionEv();
|
this.$toolAll.tools.clearShare();
|
||||||
|
// 调取佣金信息事件
|
||||||
|
this.checkCommissionEv();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesA/distributionCenter/distributionCenter`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 查询佣金信息
|
// 查询佣金信息
|
||||||
|
@ -140,6 +150,10 @@
|
||||||
if(this.page==1) this.dataList = [];
|
if(this.page==1) this.dataList = [];
|
||||||
// 分销中心数字信息
|
// 分销中心数字信息
|
||||||
this.distributionInfo = res.data;
|
this.distributionInfo = res.data;
|
||||||
|
// 累计首页
|
||||||
|
this.distributionInfo.commission = this.$toolAll.tools.addXiaoShu(this.distributionInfo.commission);
|
||||||
|
// 累计提现
|
||||||
|
this.distributionInfo.withdrawal_total = this.$toolAll.tools.addXiaoShu(this.distributionInfo.withdrawal_total);
|
||||||
// 我的佣金
|
// 我的佣金
|
||||||
this.commission = this.distributionInfo.commission;
|
this.commission = this.distributionInfo.commission;
|
||||||
// 设置列表
|
// 设置列表
|
||||||
|
@ -157,7 +171,7 @@
|
||||||
// 调起弹框
|
// 调起弹框
|
||||||
tuneEv(){
|
tuneEv(){
|
||||||
if(this.commission*1 == 0 ){
|
if(this.commission*1 == 0 ){
|
||||||
this.$toolAll.tools.showToast('剩余佣金不足')
|
this.$toolAll.tools.showToast('剩余佣金不足');
|
||||||
} else {
|
} else {
|
||||||
this.showwithdrawal = true;
|
this.showwithdrawal = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
<image @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
<image @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
||||||
<view class="width100 disjb fc" style="height: 166rpx;">
|
<view class="width100 disjb fc" style="height: 166rpx;">
|
||||||
<view @tap="goShopDetail(item.id)" class="fon30 col3 bold clips2">{{item.title}}</view>
|
<view @tap="goShopDetail(item.id)" class="fon30 col3 bold clips2">{{item.title}}</view>
|
||||||
<!-- <view class="order-sy">{{item.sku_name}}</view> -->
|
<view class="fon24 colpeili disac fw">
|
||||||
|
<view class="mar-y40" v-for="(item1,index1) in item.specs" :key="index1">{{item1}}</view>
|
||||||
|
</view>
|
||||||
<view class="disjbac mar-s10 width100">
|
<view class="disjbac mar-s10 width100">
|
||||||
<view class="order-item-price">¥{{item.price}}</view>
|
<view class="order-item-price">¥{{item.price}}</view>
|
||||||
<view class="fon30 col6">x{{item.num}}</view>
|
<view class="fon30 col6">x{{item.num}}</view>
|
||||||
|
@ -211,12 +213,12 @@
|
||||||
freight: this.isExpress ? this.expressInfo.default_price : 0,//快递费
|
freight: this.isExpress ? this.expressInfo.default_price : 0,//快递费
|
||||||
discount:0
|
discount:0
|
||||||
}
|
}
|
||||||
if(this.addressInfo=='' && self==1){
|
if(this.addressInfo=='' && self==0){
|
||||||
this.$toolAll.tools.showToast('请完善收件人信息');
|
this.$toolAll.tools.showToast('请完善收件人信息');
|
||||||
} else if(nphone=='') {
|
} else if(nphone=='' && self==1) {
|
||||||
this.$toolAll.tools.showToast('请填写收货人手机号');
|
this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||||
this.focusEv();
|
this.focusEv();
|
||||||
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
} else if(this.$toolAll.tools.isPhone(nphone) && self==1) {
|
||||||
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||||
this.focusEv();
|
this.focusEv();
|
||||||
} else {
|
} else {
|
||||||
|
@ -259,7 +261,7 @@
|
||||||
this.$toolAll.tools.showToast('支付成功');
|
this.$toolAll.tools.showToast('支付成功');
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesA/myOrder/myOrder'
|
url:'/pagesA/myOrder/myOrder?index=2'
|
||||||
})
|
})
|
||||||
},2000)
|
},2000)
|
||||||
} else this.$toolAll.tools.showToast(res.msg);
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
|
@ -121,8 +121,18 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.checkList();
|
if(uni.getStorageSync('phone_active')){
|
||||||
this.isWhere = options.isWhere;
|
this.$toolAll.tools.clearShare();
|
||||||
|
this.checkList();
|
||||||
|
this.isWhere = options.isWhere;
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesA/myAddress/myAddress`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goBack(index){//返回到订单准备页
|
goBack(index){//返回到订单准备页
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
<image @tap="goDetail(item1.id)" :src="item2.sku_cover" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
<image @tap="goDetail(item1.id)" :src="item2.sku_cover" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
||||||
<view @tap="goDetail(item1.id)" class="width100 disjb fc" style="height: 224rpx;">
|
<view @tap="goDetail(item1.id)" class="width100 disjb fc" style="height: 224rpx;">
|
||||||
<view class="fon28 col3 bold clips2 line-h50">{{item2.spu_name}}</view>
|
<view class="fon28 col3 bold clips2 line-h50">{{item2.spu_name}}</view>
|
||||||
<view class="order-sy" v-if="item2.tag!=''"><span>颜色:粉色</span><span>尺寸:12.2</span></view>
|
<view class="disac">
|
||||||
|
<view class="order-sy mar-y40" v-for="(item3,index3) in item2.spec_info" :key="index3">{{item3}}</view>
|
||||||
|
</view>
|
||||||
<view class="colpeili disjbac"><span class="order-price">¥{{item2.price}}</span><span class="fon24">x{{item2.num}}</span></view>
|
<view class="colpeili disjbac"><span class="order-price">¥{{item2.price}}</span><span class="fon24">x{{item2.num}}</span></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -131,13 +133,22 @@
|
||||||
// 调用查询事件
|
// 调用查询事件
|
||||||
this.checkList();
|
this.checkList();
|
||||||
}
|
}
|
||||||
this.$toolAll.tools.overdue();
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
options.index==undefined ? this.current = 0 : this.current = options.index;
|
options.index==undefined ? this.current = 0 : this.current = options.index;
|
||||||
if(this.current==0){
|
if(uni.getStorageSync('phone_active')){
|
||||||
// 调用查询事件
|
this.$toolAll.tools.clearShare();
|
||||||
this.checkList();
|
if(this.current==0){
|
||||||
|
// 调用查询事件
|
||||||
|
this.checkList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesA/myOrder/myOrder?index=0`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -188,7 +199,7 @@
|
||||||
skuList:item.skus,
|
skuList:item.skus,
|
||||||
totalPrice:item.price,
|
totalPrice:item.price,
|
||||||
status:statusNum,
|
status:statusNum,
|
||||||
coding:item.skus[0].coding
|
coding:item.coding
|
||||||
}
|
}
|
||||||
this.orderList[this.current].push(obj);
|
this.orderList[this.current].push(obj);
|
||||||
})
|
})
|
||||||
|
|
|
@ -152,9 +152,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cancleEv(){
|
|
||||||
uni.setStorageSync('bindPhone',false)
|
|
||||||
},
|
|
||||||
updataInfo(){//修改资料事件
|
updataInfo(){//修改资料事件
|
||||||
let params = {
|
let params = {
|
||||||
real_name:this.dataList[5].content,//姓名
|
real_name:this.dataList[5].content,//姓名
|
||||||
|
|
|
@ -38,8 +38,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 调取关于我们信息事件
|
if(uni.getStorageSync('phone_active')){
|
||||||
this.checkAboutUs();
|
this.$toolAll.tools.clearShare();
|
||||||
|
// 调取关于我们信息事件
|
||||||
|
this.checkAboutUs();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesB/aboutUs/aboutUs`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 查询关于我们信息
|
// 查询关于我们信息
|
||||||
|
|
|
@ -30,9 +30,19 @@
|
||||||
disclaimerRich:''
|
disclaimerRich:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
// 调取免责声明信息事件
|
if(uni.getStorageSync('phone_active')){
|
||||||
this.checkDisclaimerEv();
|
this.$toolAll.tools.clearShare();
|
||||||
|
// 调取免责声明信息事件
|
||||||
|
this.checkDisclaimerEv();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesB/disclaimers/disclaimers`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 查询免责声明信息
|
// 查询免责声明信息
|
||||||
|
|
|
@ -33,7 +33,9 @@
|
||||||
<image :src="item.sku_cover" class="flexs" mode="aspectFill" style="width: 224rpx; height: 224rpx;"></image>
|
<image :src="item.sku_cover" class="flexs" mode="aspectFill" style="width: 224rpx; height: 224rpx;"></image>
|
||||||
<view class="width100 disjb fc" style="height: 224rpx;">
|
<view class="width100 disjb fc" style="height: 224rpx;">
|
||||||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||||
<view class="orderDetail-sku" v-if="item.tag!=''">{{item.tag}}</view>
|
<view class="orderDetail-sku disac" v-if="item.spec_info.length">
|
||||||
|
<view class="mar-y40" v-for="(item2,index2) in item.spec_info" :key="index2">{{item2}}</view>
|
||||||
|
</view>
|
||||||
<view class="mar-s10">
|
<view class="mar-s10">
|
||||||
<view class="colf8 fon32 bold disjbac width100"><span>¥{{item.price}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
<view class="colf8 fon32 bold disjbac width100"><span>¥{{item.price}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -140,12 +142,13 @@
|
||||||
timer:null,
|
timer:null,
|
||||||
daoTime:'',
|
daoTime:'',
|
||||||
timerDao:null,
|
timerDao:null,
|
||||||
|
orderId:''//订单id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
var shareObj = {
|
var shareObj = {
|
||||||
title: '', // 默认是小程序的名称(可以写slogan等)
|
title: '', // 默认是小程序的名称(可以写slogan等)
|
||||||
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
path: `/pagesB/orderDetail/orderDetail?id=${this.orderId}&invite_code=${uni.getStorageSync('invite_code')}}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||||
};
|
};
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
|
@ -153,7 +156,18 @@
|
||||||
uni.setStorageSync('isorderDetail',1);
|
uni.setStorageSync('isorderDetail',1);
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.checkInfo(options.id);
|
this.orderId = options.id;
|
||||||
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
this.checkInfo(this.orderId);
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesB/orderDetail/orderDetail?id=${options.id}`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirmReceipt(id){//确认收货事件
|
confirmReceipt(id){//确认收货事件
|
||||||
|
@ -238,7 +252,6 @@
|
||||||
this.allNum = 0;
|
this.allNum = 0;
|
||||||
let narr = res.data;
|
let narr = res.data;
|
||||||
narr.skus.forEach(item=>{
|
narr.skus.forEach(item=>{
|
||||||
item.spu_cover = this.$http + item.spu_cover;
|
|
||||||
// 共多少件,总计
|
// 共多少件,总计
|
||||||
if(narr.is_score==0){
|
if(narr.is_score==0){
|
||||||
this.allPrice += item.price*item.num;
|
this.allPrice += item.price*item.num;
|
||||||
|
|
|
@ -61,7 +61,17 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.searchStr = options.keyWorld;
|
this.searchStr = options.keyWorld;
|
||||||
this.searchEv()
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
this.searchEv();
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesB/searchPage/searchPage?keyWorld=${this.searchStr}`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
searchEv(){//搜索事件
|
searchEv(){//搜索事件
|
||||||
|
|
|
@ -104,12 +104,14 @@
|
||||||
specIdList:[],//多规格id
|
specIdList:[],//多规格id
|
||||||
specCehckList:[],//存查询的规格数据
|
specCehckList:[],//存查询的规格数据
|
||||||
transmitData:[],//要传递的数据
|
transmitData:[],//要传递的数据
|
||||||
|
shopId:'',//商品id
|
||||||
|
multi_spec:1//是否是单规格商品0-单规格,1-多规格
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
var shareObj = {
|
var shareObj = {
|
||||||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
title: `${this.detailObj.name}`, // 默认是小程序的名称(可以写slogan等)
|
||||||
path: `/pagesB/shopDetail/shopDetail?id=`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
path: `/pagesB/shopDetail/shopDetail?id=${this.shopId}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||||
};
|
};
|
||||||
return shareObj;
|
return shareObj;
|
||||||
|
@ -117,6 +119,7 @@
|
||||||
onShow() {
|
onShow() {
|
||||||
uni.removeStorageSync('chooseAddress');
|
uni.removeStorageSync('chooseAddress');
|
||||||
this.isAutoPlay = true;
|
this.isAutoPlay = true;
|
||||||
|
this.csNum = 0;
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.isAutoPlay = false;
|
this.isAutoPlay = false;
|
||||||
|
@ -125,8 +128,19 @@
|
||||||
this.isAutoPlay = false;
|
this.isAutoPlay = false;
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 查询订单详情
|
this.shopId = options.id;
|
||||||
this.checkDetail(options.id);
|
if(uni.getStorageSync('phone_active')){
|
||||||
|
this.$toolAll.tools.clearShare();
|
||||||
|
// 查询订单详情
|
||||||
|
this.checkDetail(options.id);
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('existCode',options.invite_code);
|
||||||
|
uni.setStorageSync('outside',2);
|
||||||
|
uni.setStorageSync('transientUrl',`/pagesB/shopDetail/shopDetail?id=${options.id}`);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/login/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//规格查询接口
|
//规格查询接口
|
||||||
|
@ -149,6 +163,8 @@
|
||||||
// 设置商品详情
|
// 设置商品详情
|
||||||
this.detailObj = res.data.detail;
|
this.detailObj = res.data.detail;
|
||||||
this.shopDetail = res.data;
|
this.shopDetail = res.data;
|
||||||
|
// 设置单多规格判断
|
||||||
|
this.multi_spec = this.detailObj.multi_spec;
|
||||||
// 调用查询规格事件
|
// 调用查询规格事件
|
||||||
this.specsEv(id);
|
this.specsEv(id);
|
||||||
// 轮播 start
|
// 轮播 start
|
||||||
|
@ -193,9 +209,14 @@
|
||||||
chooseItem(e){
|
chooseItem(e){
|
||||||
let specIndex = this.specList.findIndex(item=>item.title==e.mainTitle);
|
let specIndex = this.specList.findIndex(item=>item.title==e.mainTitle);
|
||||||
this.specIdList[specIndex*1] = e.id;
|
this.specIdList[specIndex*1] = e.id;
|
||||||
let specStr = this.specIdList.join('_');
|
let specStr = this.specIdList.join('-');
|
||||||
this.transmitData = this.specCehckList.filter(item=>item.indexes==specStr);
|
this.transmitData = this.specCehckList.filter(item=>item.indexes==specStr);
|
||||||
console.log(this.transmitData);
|
if(this.transmitData.length){
|
||||||
|
// 改变折扣价
|
||||||
|
this.discountPrice = this.transmitData[0].price;
|
||||||
|
// 改变原价
|
||||||
|
this.originalPrice = this.transmitData[0].original_price;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 立即购买
|
// 立即购买
|
||||||
immediatelyBuy(){
|
immediatelyBuy(){
|
||||||
|
@ -203,20 +224,23 @@
|
||||||
this.addCart(1);
|
this.addCart(1);
|
||||||
},
|
},
|
||||||
addCart(index=0){//添加购物车事件
|
addCart(index=0){//添加购物车事件
|
||||||
if(this.transmitData.length){
|
// console.log(this.multi_spec,this.transmitData.length,214);
|
||||||
|
if(this.transmitData.length || this.multi_spec==0){
|
||||||
if(this.csNum==0){
|
if(this.csNum==0){
|
||||||
this.csNum++;
|
this.csNum++;
|
||||||
|
let newId = '';
|
||||||
|
this.multi_spec==1 ? newId = this.transmitData[0].id : newId = this.shopDetail.sku[0].id;
|
||||||
if(index==0){
|
if(index==0){
|
||||||
this.$toolAll.tools.showToast('正在加入购物车...');
|
this.$toolAll.tools.showToast('正在加入购物车...');
|
||||||
}
|
}
|
||||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.transmitData[0].id,num:1}).then(res=>{
|
this.$requst.post('/api/order/shopping-cart-add',{sku_id:newId,num:1}).then(res=>{
|
||||||
if(res.code==0) {
|
if(res.code==0) {
|
||||||
if(index==1){
|
if(index==1){
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/tabbar/cart/cart'
|
url:'/pages/tabbar/cart/cart'
|
||||||
})
|
})
|
||||||
},500)
|
},0)
|
||||||
} else {
|
} else {
|
||||||
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
||||||
this.csNum = 0;
|
this.csNum = 0;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
statusHNH:uni.getStorageSync('statusHNH'),
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
newHeight:uni.getSystemInfoSync().windowHeight,
|
newHeight:uni.getSystemInfoSync().windowHeight,
|
||||||
videoSrc:'',
|
videoSrc:'',
|
||||||
isPlayImg:false,
|
isPlayImg:uni.getStorageSync('is_vedio'),
|
||||||
autoplay:true,
|
autoplay:true,
|
||||||
videoContext:'',
|
videoContext:'',
|
||||||
title:'',//视频的标题,全屏时在顶部展示
|
title:'',//视频的标题,全屏时在顶部展示
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 781 B |
Binary file not shown.
After Width: | Height: | Size: 720 B |
Loading…
Reference in New Issue