bug修改

master
chen 2022-02-25 17:24:06 +08:00
parent 268fbd85f7
commit ab67d715ed
30 changed files with 475 additions and 169 deletions

11
App.vue
View File

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

View File

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

View File

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

View File

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

View File

@ -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'})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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: {
} }

View File

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

View File

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

View File

@ -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, // tabswiper current:0, // tabswiper
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() {
// IDtab // IDtab
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 }`
}) })

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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: {
// //

View File

@ -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: {
// //

View File

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

View File

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

View File

@ -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: ''//PNGJPG imageUrl 使 5:4      imageUrl: ''//PNGJPG 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;

View File

@ -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:'',//视频的标题,全屏时在顶部展示

BIN
static/public/chooseFS.png Normal file

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