作者 lihongjuan

代提交

const app=getApp()
Component({
/**
* 组件的属性列表
... ... @@ -19,6 +19,19 @@ Component({
*/
methods: {
look_more(e) {
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showToast({
title: '您还不是会员',
icon:"none"
})
setTimeout(function(){
wx.navigateTo({
url: '/pages/login/login',
})
},1500)
return false
}
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
... ...
App({
onLaunch: function () {
this.getmessagelist()
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
if(token!=""){
this.getInfoFun()
}
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
... ... @@ -78,6 +84,24 @@ App({
return promise;
},
// 获取个人信息
getInfoFun() {
let that= this;
let u = that.interface.readteacher;
that.post(u, {}).then((r) => {
console.log('3489523498',r)
if (r.code == 200) {
that.globalData.login_new=r.msg.login_new;
console.log( that.globalData.login_new)
// t.setData({
// obj: r.msg
// })
}
})
},
getmessagelist() {
let that = this
let url = '/information/get_all';
... ... @@ -118,11 +142,13 @@ App({
}).catch((err) => { })
},
onShow: function() {
console.log('hahahahhahahahhhahh')
},
//接口管理
interface: {
openid: '/getopenid/get', // 获取openid
getcode: '/getopenid/getcode', // 获取验证码
readteacher: '/getopenid/readteacher', // 获取个人信息
... ... @@ -177,6 +203,6 @@ App({
order_read: '/shop/read', // 订单数
},
globalData: {
login_new:""
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/startindex/startindex",
"pages/index/index",
"pages/startindex/startindex",
"pages/register/register",
"pages/login/login",
"pages/zuji/zuji",
... ...
... ... @@ -7,14 +7,12 @@ Page({
data: {
list: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
// 获取地址列表
getListFun() {
let t = this;
... ... @@ -35,6 +33,7 @@ Page({
//选择地址返回确认订单页面
selectAdddressFun(e) {
console.log(e)
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
... ...
{
"usingComponents": {}
"usingComponents": {},
"disableScroll": true
}
\ No newline at end of file
... ...
... ... @@ -8,14 +8,16 @@
</navigator>
</view>
<view class='center'>
<scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}">
<view class='center_child'>
<!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->
<view class='center_child flexone'>
<view class='left'>
<view class='left_item {{status == index?"active":""}}' id='Nav{{index}}' wx:for='{{nav_arr}}' wx:key='index' bindtap='{{item.id!=""?"click_category":"seltaocan"}}' data-index='{{index}}' data-id='{{item.id}}'>{{item.name}}</view>
<view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view>
</view>
<view class='fake_left'></view>
<!-- <view class='fake_left'></view> -->
<view class='right' wx:if="{{remain}}">
<view class='right_item' id='NAV{{index}}' wx:for='{{good_arr}}' wx:key='index' wx:if="{{good_arr[index].products.length>0}}">
<view class='right_item_top'>
... ... @@ -50,6 +52,6 @@
</view>
</scroll-view>
<!-- </scroll-view> -->
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -89,9 +89,10 @@ page {
width: 21.4%;
height: 100%;
background: #fff;
position: fixed;
top: 114rpx;
/* position: fixed;
top: 114rpx; */
overflow-y: scroll;
z-index:9999
}
... ... @@ -143,6 +144,8 @@ page {
.right {
width: 76.3%;
height: 100%;
overflow-y: scroll;
}
.right_item {
... ...
... ... @@ -49,6 +49,23 @@ Page({
// console.log(this.data.stick)
},
// 获取个人信息
getInfoFun() {
let that= this;
let u = app.interface.readteacher;
app.post(u, {}).then((r) => {
console.log('3489523498',r)
if (r.code == 200) {
app.globalData.login_new=r.msg.login_new;
console.log( app.globalData.login_new)
// t.setData({
// obj: r.msg
// })
}
})
},
moremiao() {
let token = wx.getStorageSync("token")
if (token == '') {
... ... @@ -64,8 +81,37 @@ Page({
}
}
})
}else{
let login_new=app.globalData.login_new;
if(login_new==0){
// wx.showToast({
// title: '您还不是会员',
// icon:"none"
// })
// setTimeout(function(){
// wx.navigateTo({
// url: '/pages/login/login',
// })
// },1500)
// return false
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
wx.navigateTo({
url: '/pages/xianshi/xianshi?title2='+this.data.title2,
})
... ... @@ -79,7 +125,6 @@ Page({
let url = '//wb/wb';
let data = {
}
app.post(url, data, "POST").then((r) => {
console.log('4456789', r)
... ... @@ -214,6 +259,25 @@ Page({
}
})
}else{
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
wx.navigateTo({
url: '/pages/zhuanqu/zhuanqu?id=' + id,
})
... ... @@ -222,6 +286,42 @@ Page({
},
more() {
let token = wx.getStorageSync("token")
if (token == '') {
wx.showModal({
title: '提示',
content: '请先登录',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
}
})
return false
}
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
wx.navigateTo({
url: '/pages/classify/classify',
})
... ... @@ -234,12 +334,48 @@ Page({
},
// 查看小分类
look_item(e) {
let token = wx.getStorageSync("token")
if (token == '') {
wx.showModal({
title: '提示',
content: '请先登录',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
}
})
}else{
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
let title = this.data.nav_arr[this.data.nav_index].name
let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
let pid = this.data.nav_arr[this.data.nav_index].id
wx.navigateTo({
url: '/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
})
}
},
//监测轮播图变化
swiperChange(e) {
... ... @@ -266,6 +402,25 @@ Page({
}
})
} else {
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
if (style == 2) {
wx.navigateTo({
url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
... ... @@ -313,7 +468,7 @@ Page({
page_type: false
})
//调用排序接口
this.good_list(this.data.cid, e.currentTarget.dataset.index)
this.good_list(this.data.pid, e.currentTarget.dataset.index)
},
select_nav(e) {
... ... @@ -441,13 +596,20 @@ Page({
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this
let that = this;
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
if(token!=""){
this.getInfoFun()
}
this.get_banner()
this.get_info(0, 1);
// 获取活动专区
this.getzhuanqulist();
this.getxianshi();
... ... @@ -523,6 +685,22 @@ Page({
}).catch((err) => {})
},
// 获取个人信息
getInfoFun() {
let that= this;
let u = app.interface.readteacher;
app.post(u, {}).then((r) => {
console.log('3489523498',r)
if (r.code == 200) {
app.globalData.login_new=r.msg.login_new;
console.log( app.globalData.login_new)
// t.setData({
// obj: r.msg
// })
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -534,9 +712,25 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
shop_arr:[],
page:1
})
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
if(token!=""){
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist()
this.getmessagelist();
console.log('998867',this.data.pid)
if(this.data.pid){
this.get_info(this.data.pid, 2);
}else{
this.get_info(0, 1);
}
//控制显示隐藏
this.ishow()
},
... ... @@ -594,7 +788,7 @@ Page({
that.setData({
page: that.data.page + 1
})
that.good_list(that.data.cid, that.data.c_index)
that.good_list(that.data.pid, that.data.c_index)
},
/**
... ...
... ... @@ -64,11 +64,11 @@
</view>
<!-- 秒杀商城 -->
<view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}">
<!-- <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}">
<view class="miaoshatop flextwo">
<view class="miaoshatopleft flexone">
<view class="miaoshaoname">{{title2}}</view>
<!-- <view class="hourgou" wx:if="{{showtime}}">{{day}}:{{hou}}:{{min}}:{{sec}}</view> -->
<view class="hourgou" wx:if="{{showtime}}">{{day}}:{{hou}}:{{min}}:{{sec}}</view>
</view>
<view class="miaosharight" bindtap="moremiao">
查看更多>
... ... @@ -82,8 +82,12 @@
<view class="price">¥{{item.price2!=null?item.price2:item.price}}</view>
</view>
</view>
</view> -->
<view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}" bindtap="moremiao">
<view class="neigouimg">
<image src="/images/neigouk.png" ></image>
</view>
</view>
</view>
<!-- 公告栏 -->
... ... @@ -114,13 +118,8 @@
<image src="/images/more.png"></image>
</view>
</view>
<!-- 小分类 -->
</view>
<view class='select_box'>
<view class='select_item {{c_index == 0?"active":""}}' data-index="0" bindtap='reorder'>默认</view>
<view class='select_item {{c_index == 1?"active":""}}' data-index="1" bindtap='reorder'>价格
... ... @@ -138,6 +137,6 @@
<view class='real_goods'>
<Model_item list="{{shop_arr}}" />
</view>
<concat/>
<concat />
</view>
</scroll-view>
\ No newline at end of file
... ...
... ... @@ -514,7 +514,7 @@ image {
.xianshi {
width: 750rpx;
padding: 8rpx 30rpx;
/* padding: 8rpx 30rpx; */
box-sizing: border-box;
background: #fff;
border-bottom:16rpx solid #f5f5f5;
... ... @@ -525,3 +525,10 @@ image {
top: 0;
left: 0;
}
.neigouimg{
width:750rpx;
height:254rpx;
font-size: 0;
display:flex;
justify-content: center;
}
... ...
... ... @@ -7,7 +7,9 @@ Page({
*/
data: {
page: 1,
messagelist: []
messagelist: [],
token:'',
login_new:''
},
/**
... ... @@ -88,6 +90,11 @@ Page({
*/
onShow: function() {
this.setData({
token:wx.getStorageSync('token'),
login_new:app.globalData.login_new
})
this.setData({
messagelist: [],
page: 1
})
... ...
<block wx:if="{{token==''}}">
<navigator class="no_login" catchtap="go_login" url="/pages/register/register" hover-class="none">请先登录</navigator>
</block>
<block wx:elif="{{login_new==''}}">
<navigator class="no_login" catchtap="go_login" url="/pages/login/login" hover-class="none">请先绑定会员</navigator>
</block>
<block wx:else>
<view class="empty" wx:if="{{messagelist.length==0}}">暂无更多数据</view>
<view class="messagelist" wx:else>
... ... @@ -11,3 +19,5 @@
</view>
</view>
</block>
... ...
... ... @@ -48,3 +48,11 @@ page {
.messagename {
margin-top: 10rpx;
}
.no_login{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 400;
color: #ccc;
margin-top: 200rpx;
text-align: center;
}
\ No newline at end of file
... ...
const a = getApp()
Page({
/**
* 页面的初始数据
*/
... ... @@ -11,8 +10,8 @@ Page({
indicatorDots: false,
vertical: false,
autoplay: true,
interval: 2000,
duration: 500,
interval: 3000,
duration: 1500,
kuaidi:''
},
... ... @@ -39,12 +38,7 @@ Page({
that.data.kuaidi.forEach(function(value,index,array){
console.log(value.kuaidi[0].kuaidi.Traces)
})
console.log(that.data.kuaidi)
}).catch((err) => { })
},
... ... @@ -87,6 +81,7 @@ Page({
let type = e.currentTarget.dataset.i;
let index = e.currentTarget.dataset.t;
if (wx.getStorageSync("token") && wx.getStorageSync("login") == 1 && index != 5) {
if (index == 1) {
// 跳转订单列表
wx.navigateTo({
... ... @@ -119,18 +114,39 @@ Page({
url: '/pages/my/about_us/about_us',
})
} else {
let token=wx.getStorageSync('token');
if(token==''){
wx.showToast({
title: '请先登录',
icon:"none"
})
setTimeout(function(){
wx.navigateTo({
url: '/pages/register/register',
})
},1500)
return false
}
let login_new=a.globalData.login_new;
if(login_new==0){
wx.showModal({
title: '提示',
content: '请先登录',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/register/register',
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
}
},
//获取购物车数量
... ... @@ -218,6 +234,8 @@ Page({
*/
onShow: function() {
let t = this
t.getInfoFun()
t.getnewwuliu()
t.get_shopnum()
t.get_order()
... ...
... ... @@ -3,7 +3,7 @@
<image class="avator" src="{{obj.image || '/images/icon_59.png'}}"></image>
<!-- 未登录 -->
<view class="right" wx:if="{{no_login}}">
<view class="tips_word">您好,请登录</view>
<view class="tips_word">点击登录</view>
</view>
<!-- 登录 -->
<view class="right" wx:else>
... ... @@ -54,7 +54,8 @@
<!-- 物流信息 -->
<view class="wuliuinfo" wx:if="{{kuaidi.length!=0}}">
<view class="page-section page-section-spacing swiper">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" vertical="true" circular="true">
<!-- vertical="true" -->
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" circular="true">
<block wx:for="{{kuaidi}}" wx:key="*this">
<swiper-item>
<view class="swiper-item" bindtap="look_logistics" data-ordernum="{{item.order_odd}}">
... ... @@ -128,5 +129,5 @@
</view>
</view>
</view>
<concat/>
<concat />
</block>
\ No newline at end of file
... ...
... ... @@ -24,7 +24,7 @@ Page({
a.post(u, {}).then((r) => {
if (r.code == 200) {
t.setData({
jifen: r.msg.jifen,
jifen: r.msg.jifen==null?0: r.msg.jifen,
time: r.msg.start + "日到" + r.msg.end + '日',
list: r.msg.res
})
... ...
... ... @@ -5,7 +5,8 @@
<view class="header_top">
<view class="tips_word">积分余额</view>
<view class="jifen">{{jifen}}</view>
<view class="time">积分可用时间:每月{{time}}之前</view>
<!-- <view class="time">积分可用时间:每月{{time}}之前</view> -->
<view class="time">积分可用时间:以各公司宣贯为准</view>
</view>
</view>
<view class="line" />
... ...
... ... @@ -14,7 +14,18 @@ Page({
area: '',
address: '',
cover_type: false,
total:''
total:'',
info:{
address:{
address:'',
area:'',
id:'',
tel:'',
name:''
}
}
},
//加减商品数量
num_change(e) {
... ... @@ -272,9 +283,14 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
let pages = getCurrentPages();
let currPage = pages[pages.length - 1]
console.log('887766554',currPage.data.id)
if (currPage.data.id) {
console.log('4778785',this.data.info)
this.setData({
"info.address.address": currPage.data.address,
"info.address.area": currPage.data.area,
... ... @@ -282,14 +298,16 @@ Page({
"info.address.tel": currPage.data.tel,
"info.address.name": currPage.data.name
})
console.log(this.data.info)
console.log(currPage.data.address)
this.get_youfei(currPage.data.id)
}
if (wx.getStorageSync('no_address')) {
wx.setStorageSync('no_address', false)
this.setData({
"info.address": null
})
}
// if (wx.getStorageSync('no_address')) {
// wx.setStorageSync('no_address', false)
// this.setData({
// "info.address": null
// })
// }
},
... ...
... ... @@ -37,6 +37,9 @@ Page({
noClick: false,
word: e.currentTarget.dataset.name
})
wx.navigateTo({
url: 'search_result/search_result?title=' + '搜索' + '&name=' + this.data.word
})
},
//获取热门搜索标签
get_hot() {
... ...
... ... @@ -8,7 +8,9 @@ Page({
check_num: 0, //选中数量
checkAll: false, //全选状态
integral: 0, //总积分
all_num: 0 //总数量
all_num: 0, //总数量
token:'',
login_new:''
},
//删除商品
... ... @@ -242,6 +244,12 @@ submit(){
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
token:wx.getStorageSync('token'),
login_new:app.globalData.login_new
})
this.get_info()
this.judge()
this.get_shopnum();
... ...
<block wx:if="{{no_login}}">
<navigator class="no_login" catchtap="go_login" url="/pages/register/register">请先登录</navigator>
<navigator class="no_login" catchtap="go_login" url="/pages/register/register" hover-class="none">请先登录</navigator>
</block>
<block wx:elif="{{login_new==''}}">
<navigator class="no_login" catchtap="go_login" url="/pages/login/login" hover-class="none">请先绑定会员</navigator>
</block>
<block wx:else>
<view class="content">
<shop_item list="{{list}}" wx:if="{{list.length>0}}" type="1" check_num="{{check_num}}" bindcheck_type="check_type" bindchange_num="change_num" binddelete_shop="delete_shop" />
... ...
... ... @@ -27,7 +27,6 @@
<view class='three_one'>
<view class='three_one_item {{status==index?"active":""}}' wx:for='{{nav}}' wx:for-index='index' wx:key='{{index}}' bindtap='clickNav' data-index='{{index}}'>{{item}}</view>
</view>
<view class='three_two'>
<template is="wxParse" data="{{wxParseData:contenta.nodes}}" wx:if="{{status==0}}" />
<template is="wxParse" data="{{wxParseData:contenb.nodes}}" wx:elif="{{status==1}}" />
... ...
... ... @@ -151,9 +151,10 @@ Page({
})
time--;
if (time ==1) {
console.log(34643)
that.getCodeFun()
// if (time ==1) {
// console.log(34643)
// that.getCodeFun()
// let token=wx.getStorageSync('token')
// wx.navigateTo({
// url: '/pages/register/register',
... ... @@ -168,8 +169,13 @@ Page({
//  })
// }
}else if (time<=0){
// }
if (time<=0){
clearInterval(interval);
 wx.switchTab({
url: '/pages/index/index'
 })
}
}.bind(this), 1000);
},
... ...
... ... @@ -119,6 +119,13 @@
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "注册",
"pathName": "pages/register/register",
"scene": null
}
]
... ...