作者 朱振飞

12121212

... ... @@ -4,7 +4,8 @@ Component({
* 组件的属性列表
*/
properties: {
list: Array
list: Array,
type:String
},
/**
... ... @@ -34,22 +35,29 @@ Component({
// }
let id = e.currentTarget.dataset.id
let token=wx.getStorageSync('token');
if(token==''){
wx.showToast({
title: '请先登录',
icon:'none',
duration: 1300
})
setTimeout(function(){
// if(token==''){
// wx.showToast({
// title: '请先登录',
// icon:'none',
// duration: 1300
// })
// setTimeout(function(){
// wx.navigateTo({
// url: '/pages/register/register',
// })
// },1300)
// }else{
if(this.data.type=='open'){
wx.navigateTo({
url: '/pages/register/register',
url: '/pages/shop_detail/shop_detail?id=' + id
})
},1300)
}else{
wx.navigateTo({
url: '/packageA/pages/shop_detail/shop_detail?id=' + id
})
}
// }
},
},
lifetimes: {
... ...
App({
onLaunch: function () {
if(wx.getStorageSync('token')){
this.getmessagelist()
}
this.getToken();
//自动更新版本
... ...

40.6 KB | 宽: | 高:

30.6 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
... ... @@ -12,7 +12,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
wx.setNavigationBarTitle({
title: options.type==1?'生日福利':'电影福利',
})
},
/**
... ...
... ... @@ -244,7 +244,7 @@ Page({
},
// 进入生日
birthday() {
birthday(e) {
let that = this;
let token = wx.getStorageSync('token');
if (token == '') {
... ... @@ -259,8 +259,9 @@ Page({
})
}, 1300)
} else {
console.log(e)
wx.navigateTo({
url: '/pages/birthday/birthday',
url: '/pages/birthday/birthday?type='+e.currentTarget.id,
})
}
... ... @@ -281,7 +282,6 @@ Page({
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867', this.data.pid)
// if(this.data.pid){
// this.get_info(this.data.pid, 2);
... ... @@ -440,7 +440,7 @@ Page({
pageNum: 6
}
app.post(url, data, "POST").then((r) => {
app.postk(url, data, "POST").then((r) => {
console.log(r)
console.log(r.msg.residue_time)
that.setData({
... ... @@ -677,31 +677,31 @@ Page({
let id = e.currentTarget.dataset.id
let style = e.currentTarget.dataset.style;
console.log(style)
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 = wx.getStorageSync('login');
// 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 = wx.getStorageSync('login');
if (style == 2) {
wx.navigateTo({
url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
})
} else {
// if (style == 2) {
// wx.navigateTo({
// url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
// })
// } else {
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
})
}
}
// }
// }
},
// 排序
... ... @@ -791,9 +791,7 @@ Page({
})
if(index==0){
this.setData({
isyouzhi: 1
})
if(this.data.stick==1){
wx.pageScrollTo({
duration: 3,
... ... @@ -805,6 +803,9 @@ Page({
}
this.getyouzhi()
}else{
this.setData({
isyouzhi: 1
})
this.getgoodlist()
if(this.data.stick==1){
wx.pageScrollTo({
... ... @@ -951,7 +952,7 @@ Page({
} else if (c_index == 2) {
params.paynum = that.data.paynum
}
app.post(url, params).then((res) => {
app.postk(url, params).then((res) => {
if (that.data.page == 1) {
wx.hideLoading()
that.setData({
... ... @@ -984,7 +985,7 @@ Page({
get_shopnum() {
let that = this
let url = app.interface.shopcarNum
app.post(url, {}).then((res) => {
app.postk(url, {}).then((res) => {
if (res.msg > 0) {
wx.showTabBarRedDot({
index: 2,
... ... @@ -1011,7 +1012,7 @@ Page({
pageNum: 10,
}
app.post(url, data, "POST").then((r) => {
app.postk(url, data, "POST").then((r) => {
// console.log(r)
// that.setData({
// messagelist: that.data.messagelist.concat(r.msg)
... ... @@ -1067,10 +1068,13 @@ Page({
console.log('woshitoe', token)
if (token != "") {
this.getInfoFun()
this.getmessagelist();
// this.get_shopnum()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867', this.data.pid)
if (this.data.pid) {
// this.get_info(this.data.pid, 2);
... ... @@ -1084,7 +1088,6 @@ Page({
// 获取一级分类
this.getonkind();
},
/**
... ...
... ... @@ -75,10 +75,13 @@
<image src="/images/img_laobao.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="gonghui">
<image src="/images/img_gonghui.png" mode="widthFix"></image>
<image src="/images/img_laobao2.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="birthday">
<image src="/images/img_shengri.png" mode="widthFix"></image>
<view class="fenleiitem" bindtap="birthday" id="1">
<image src="/images/img_laobao3.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="birthday" id="2">
<image src="/images/img_laobao4.png" mode="widthFix"></image>
</view>
</view>
<!-- 新品上线 -->
... ... @@ -223,7 +226,7 @@
</view>
</view>
<view class='real_goods product_container' id="real_goods">
<Model_item list="{{shop_arr}}" wx:if="{{shop_arr.length>0}}" />
<Model_item list="{{shop_arr}}" type='open' wx:if="{{shop_arr.length>0}}" />
<view wx:else class="noData">暂无相关产品</view>
</view>
... ...
... ... @@ -134,7 +134,8 @@ Page({
a.post(u, d).then((r) => {
if (r.code == 200) {
a.globalData.index=0
wx.setStorageSync('login', 1);
let type = wx.getStorageSync('entrance_type');
type == '1'?wx.setStorageSync('login', 1):wx.setStorageSync('gh_login', 1)
wx.showToast({
title: '登录成功',
duration: 1000,
... ...
... ... @@ -2,7 +2,7 @@
<!-- 地址信息 -->
<view class="address_box" wx:if="{{info.address}}" bindtap="add_address">
<view class="name"> {{info.address.name}}
<text>{{info.address.tel}}</text>
<text>{{info.address.mobile}}</text>
</view>
<view class="address">
<image class="tips_img" src="/images/icon_54.png" />
... ...
... ... @@ -5,7 +5,7 @@
<view class="real_goods_item" wx:for="{{goodlist}}" wx:key="index" data-id="{{item.id}}" bindtap="look_more" data-type="{{item.type}}">
<view class='real_goods_img'>
<image src='{{item.image}}' mode="aspectFill" />
<image src='/images/mei.png' class="tip" />
<image src='/images/mei.png' class="tip" wx:if="{{item.stock_num==0}}"/>
</view>
<view class='real_goods_bottom'>
<view class='goods_title'>{{item.name}}</view>
... ...
... ... @@ -88,8 +88,11 @@ Page({
// wx.reLaunch({
// url: '/pages/index/index'
// })
wx.reLaunch({
url: '/pages/index/index'
// wx.reLaunch({
// url: '/pages/index/index'
// })
wx.navigateBack({
delta: 0,
})
// if (r.new_login == 0) {
// // 未绑定手机号
... ...
... ... @@ -22,7 +22,7 @@
<!-- 商品列表 -->
<view class='real_goods'>
<Model_item list="{{shop_arr}}" wx:if="{{shop_arr.length>0}}"/>
<Model_item list="{{shop_arr}}" type='open' wx:if="{{shop_arr.length>0}}"/>
<view class="empty" wx:else>暂无更多数据</view>
</view>
... ...
... ... @@ -33,7 +33,7 @@ Page({
goods_id:id
// goods_id:911
}
app.post(url, param).then((res) => {
app.postk(url, param).then((res) => {
console.log(res,'商品')
if(res.data.length!=undefined){
let data=res.data;
... ... @@ -98,7 +98,7 @@ Page({
goods_id:that.data.goods_id,
spec_sku_id:that.data.spec_sku_id.join("_")
}
app.post(url, param).then((res) => {
app.postk(url, param).then((res) => {
console.log(res,'购物车数量')
that.setData({
min_goods_price:res.data.goods_price,
... ... @@ -173,7 +173,7 @@ Page({
type:1,
spec_sku_id:that.data.spec_sku_id.join("_")
}
app.post(url, params).then((res) => {
app.postk(url, params).then((res) => {
that.setData({
"info.shop": Number(that.data.info.shop) + that.data.num,
num: 1
... ... @@ -328,7 +328,7 @@ Page({
go_login() {
wx.showModal({
title: '提示',
content: '请先登录',
content: '请登录后操作',
success(res) {
if (res.confirm) {
wx.navigateTo({
... ...
... ... @@ -42,7 +42,7 @@
<view class='bottom'>
<view class='cart_box' catchtap="go_car">
<view class='cart_img'>
<view class='cart_count'>{{cartnum}}</view>
<view class='cart_count' wx:if='{{cartnum>0}}'>{{cartnum}}</view>
<image src='/images/icon_51.png'></image>
</view>
<view class='cart_font'>购物车</view>
... ...
... ... @@ -119,7 +119,7 @@ Page({
change_cover(e) {
if( app.globalData.status==0){
wx.showToast({
title: '您已被拉黑',
title: '您已您所在单位暂未开始劳保购买!',
icon:'none'
})
return false
... ...
... ... @@ -15,7 +15,7 @@
</view>
<!-- 商品列表 -->
<view class='real_goods'>
<Model_item list="{{shop_arr}}" />
<Model_item list="{{shop_arr}}" type='open' />
<view class='real_goods' wx:if="{{activelist.length>0}}">
<view class="real_goods_item" wx:for="{{activelist}}" wx:key="index" data-id="{{item.goods_id}}" bindtap="{{item.product.sold==0?'':'look_more'}}" data-type="{{item.type}}">
... ...