作者 朱振飞

12121212

@@ -4,7 +4,8 @@ Component({ @@ -4,7 +4,8 @@ Component({
4 * 组件的属性列表 4 * 组件的属性列表
5 */ 5 */
6 properties: { 6 properties: {
7 - list: Array 7 + list: Array,
  8 + type:String
8 }, 9 },
9 10
10 /** 11 /**
@@ -34,22 +35,29 @@ Component({ @@ -34,22 +35,29 @@ Component({
34 // } 35 // }
35 let id = e.currentTarget.dataset.id 36 let id = e.currentTarget.dataset.id
36 let token=wx.getStorageSync('token'); 37 let token=wx.getStorageSync('token');
37 - if(token==''){  
38 - wx.showToast({  
39 - title: '请先登录',  
40 - icon:'none',  
41 - duration: 1300  
42 - })  
43 - setTimeout(function(){ 38 + // if(token==''){
  39 + // wx.showToast({
  40 + // title: '请先登录',
  41 + // icon:'none',
  42 + // duration: 1300
  43 + // })
  44 + // setTimeout(function(){
  45 + // wx.navigateTo({
  46 + // url: '/pages/register/register',
  47 + // })
  48 + // },1300)
  49 + // }else{
  50 + if(this.data.type=='open'){
44 wx.navigateTo({ 51 wx.navigateTo({
45 - url: '/pages/register/register', 52 + url: '/pages/shop_detail/shop_detail?id=' + id
46 }) 53 })
47 - },1300)  
48 }else{ 54 }else{
49 wx.navigateTo({ 55 wx.navigateTo({
50 url: '/packageA/pages/shop_detail/shop_detail?id=' + id 56 url: '/packageA/pages/shop_detail/shop_detail?id=' + id
51 }) 57 })
52 } 58 }
  59 +
  60 + // }
53 }, 61 },
54 }, 62 },
55 lifetimes: { 63 lifetimes: {
1 App({ 1 App({
2 onLaunch: function () { 2 onLaunch: function () {
  3 + if(wx.getStorageSync('token')){
3 this.getmessagelist() 4 this.getmessagelist()
  5 +
  6 + }
4 this.getToken(); 7 this.getToken();
5 8
6 //自动更新版本 9 //自动更新版本

40.6 KB | 宽: | 高:

30.6 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
@@ -12,7 +12,10 @@ Page({ @@ -12,7 +12,10 @@ Page({
12 * 生命周期函数--监听页面加载 12 * 生命周期函数--监听页面加载
13 */ 13 */
14 onLoad: function (options) { 14 onLoad: function (options) {
15 - 15 + console.log(options)
  16 + wx.setNavigationBarTitle({
  17 + title: options.type==1?'生日福利':'电影福利',
  18 + })
16 }, 19 },
17 20
18 /** 21 /**
@@ -244,7 +244,7 @@ Page({ @@ -244,7 +244,7 @@ Page({
244 }, 244 },
245 245
246 // 进入生日 246 // 进入生日
247 - birthday() { 247 + birthday(e) {
248 let that = this; 248 let that = this;
249 let token = wx.getStorageSync('token'); 249 let token = wx.getStorageSync('token');
250 if (token == '') { 250 if (token == '') {
@@ -259,8 +259,9 @@ Page({ @@ -259,8 +259,9 @@ Page({
259 }) 259 })
260 }, 1300) 260 }, 1300)
261 } else { 261 } else {
  262 + console.log(e)
262 wx.navigateTo({ 263 wx.navigateTo({
263 - url: '/pages/birthday/birthday', 264 + url: '/pages/birthday/birthday?type='+e.currentTarget.id,
264 }) 265 })
265 266
266 } 267 }
@@ -281,7 +282,6 @@ Page({ @@ -281,7 +282,6 @@ Page({
281 } 282 }
282 this.get_notice() 283 this.get_notice()
283 this.get_shopnum() 284 this.get_shopnum()
284 - this.getmessagelist();  
285 console.log('998867', this.data.pid) 285 console.log('998867', this.data.pid)
286 // if(this.data.pid){ 286 // if(this.data.pid){
287 // this.get_info(this.data.pid, 2); 287 // this.get_info(this.data.pid, 2);
@@ -440,7 +440,7 @@ Page({ @@ -440,7 +440,7 @@ Page({
440 pageNum: 6 440 pageNum: 6
441 441
442 } 442 }
443 - app.post(url, data, "POST").then((r) => { 443 + app.postk(url, data, "POST").then((r) => {
444 console.log(r) 444 console.log(r)
445 console.log(r.msg.residue_time) 445 console.log(r.msg.residue_time)
446 that.setData({ 446 that.setData({
@@ -677,31 +677,31 @@ Page({ @@ -677,31 +677,31 @@ Page({
677 let id = e.currentTarget.dataset.id 677 let id = e.currentTarget.dataset.id
678 let style = e.currentTarget.dataset.style; 678 let style = e.currentTarget.dataset.style;
679 console.log(style) 679 console.log(style)
680 - if (token == '') {  
681 - wx.showModal({  
682 - title: '提示',  
683 - content: '请先登录',  
684 - success(res) {  
685 - if (res.confirm) {  
686 - wx.navigateTo({  
687 - url: '/pages/register/register',  
688 - })  
689 - } else if (res.cancel) {}  
690 - }  
691 - })  
692 - } else {  
693 - let login_new = wx.getStorageSync('login'); 680 + // if (token == '') {
  681 + // wx.showModal({
  682 + // title: '提示',
  683 + // content: '请先登录',
  684 + // success(res) {
  685 + // if (res.confirm) {
  686 + // wx.navigateTo({
  687 + // url: '/pages/register/register',
  688 + // })
  689 + // } else if (res.cancel) {}
  690 + // }
  691 + // })
  692 + // } else {
  693 + // let login_new = wx.getStorageSync('login');
694 694
695 - if (style == 2) {  
696 - wx.navigateTo({  
697 - url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src  
698 - })  
699 - } else { 695 + // if (style == 2) {
  696 + // wx.navigateTo({
  697 + // url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
  698 + // })
  699 + // } else {
700 wx.navigateTo({ 700 wx.navigateTo({
701 url: '/pages/shop_detail/shop_detail?id=' + id 701 url: '/pages/shop_detail/shop_detail?id=' + id
702 }) 702 })
703 - }  
704 - } 703 + // }
  704 + // }
705 }, 705 },
706 706
707 // 排序 707 // 排序
@@ -791,9 +791,7 @@ Page({ @@ -791,9 +791,7 @@ Page({
791 791
792 }) 792 })
793 if(index==0){ 793 if(index==0){
794 - this.setData({  
795 - isyouzhi: 1  
796 - }) 794 +
797 if(this.data.stick==1){ 795 if(this.data.stick==1){
798 wx.pageScrollTo({ 796 wx.pageScrollTo({
799 duration: 3, 797 duration: 3,
@@ -805,6 +803,9 @@ Page({ @@ -805,6 +803,9 @@ Page({
805 } 803 }
806 this.getyouzhi() 804 this.getyouzhi()
807 }else{ 805 }else{
  806 + this.setData({
  807 + isyouzhi: 1
  808 + })
808 this.getgoodlist() 809 this.getgoodlist()
809 if(this.data.stick==1){ 810 if(this.data.stick==1){
810 wx.pageScrollTo({ 811 wx.pageScrollTo({
@@ -951,7 +952,7 @@ Page({ @@ -951,7 +952,7 @@ Page({
951 } else if (c_index == 2) { 952 } else if (c_index == 2) {
952 params.paynum = that.data.paynum 953 params.paynum = that.data.paynum
953 } 954 }
954 - app.post(url, params).then((res) => { 955 + app.postk(url, params).then((res) => {
955 if (that.data.page == 1) { 956 if (that.data.page == 1) {
956 wx.hideLoading() 957 wx.hideLoading()
957 that.setData({ 958 that.setData({
@@ -984,7 +985,7 @@ Page({ @@ -984,7 +985,7 @@ Page({
984 get_shopnum() { 985 get_shopnum() {
985 let that = this 986 let that = this
986 let url = app.interface.shopcarNum 987 let url = app.interface.shopcarNum
987 - app.post(url, {}).then((res) => { 988 + app.postk(url, {}).then((res) => {
988 if (res.msg > 0) { 989 if (res.msg > 0) {
989 wx.showTabBarRedDot({ 990 wx.showTabBarRedDot({
990 index: 2, 991 index: 2,
@@ -1011,7 +1012,7 @@ Page({ @@ -1011,7 +1012,7 @@ Page({
1011 pageNum: 10, 1012 pageNum: 10,
1012 1013
1013 } 1014 }
1014 - app.post(url, data, "POST").then((r) => { 1015 + app.postk(url, data, "POST").then((r) => {
1015 // console.log(r) 1016 // console.log(r)
1016 // that.setData({ 1017 // that.setData({
1017 // messagelist: that.data.messagelist.concat(r.msg) 1018 // messagelist: that.data.messagelist.concat(r.msg)
@@ -1067,10 +1068,13 @@ Page({ @@ -1067,10 +1068,13 @@ Page({
1067 console.log('woshitoe', token) 1068 console.log('woshitoe', token)
1068 if (token != "") { 1069 if (token != "") {
1069 this.getInfoFun() 1070 this.getInfoFun()
  1071 + this.getmessagelist();
  1072 + // this.get_shopnum()
  1073 +
  1074 +
1070 } 1075 }
1071 this.get_notice() 1076 this.get_notice()
1072 - this.get_shopnum()  
1073 - this.getmessagelist(); 1077 +
1074 console.log('998867', this.data.pid) 1078 console.log('998867', this.data.pid)
1075 if (this.data.pid) { 1079 if (this.data.pid) {
1076 // this.get_info(this.data.pid, 2); 1080 // this.get_info(this.data.pid, 2);
@@ -1084,7 +1088,6 @@ Page({ @@ -1084,7 +1088,6 @@ Page({
1084 // 获取一级分类 1088 // 获取一级分类
1085 this.getonkind(); 1089 this.getonkind();
1086 1090
1087 -  
1088 }, 1091 },
1089 1092
1090 /** 1093 /**
@@ -75,10 +75,13 @@ @@ -75,10 +75,13 @@
75 <image src="/images/img_laobao.png" mode="widthFix"></image> 75 <image src="/images/img_laobao.png" mode="widthFix"></image>
76 </view> 76 </view>
77 <view class="fenleiitem" bindtap="gonghui"> 77 <view class="fenleiitem" bindtap="gonghui">
78 - <image src="/images/img_gonghui.png" mode="widthFix"></image> 78 + <image src="/images/img_laobao2.png" mode="widthFix"></image>
79 </view> 79 </view>
80 - <view class="fenleiitem" bindtap="birthday">  
81 - <image src="/images/img_shengri.png" mode="widthFix"></image> 80 + <view class="fenleiitem" bindtap="birthday" id="1">
  81 + <image src="/images/img_laobao3.png" mode="widthFix"></image>
  82 + </view>
  83 + <view class="fenleiitem" bindtap="birthday" id="2">
  84 + <image src="/images/img_laobao4.png" mode="widthFix"></image>
82 </view> 85 </view>
83 </view> 86 </view>
84 <!-- 新品上线 --> 87 <!-- 新品上线 -->
@@ -223,7 +226,7 @@ @@ -223,7 +226,7 @@
223 </view> 226 </view>
224 </view> 227 </view>
225 <view class='real_goods product_container' id="real_goods"> 228 <view class='real_goods product_container' id="real_goods">
226 - <Model_item list="{{shop_arr}}" wx:if="{{shop_arr.length>0}}" /> 229 + <Model_item list="{{shop_arr}}" type='open' wx:if="{{shop_arr.length>0}}" />
227 <view wx:else class="noData">暂无相关产品</view> 230 <view wx:else class="noData">暂无相关产品</view>
228 231
229 </view> 232 </view>
@@ -134,7 +134,8 @@ Page({ @@ -134,7 +134,8 @@ Page({
134 a.post(u, d).then((r) => { 134 a.post(u, d).then((r) => {
135 if (r.code == 200) { 135 if (r.code == 200) {
136 a.globalData.index=0 136 a.globalData.index=0
137 - wx.setStorageSync('login', 1); 137 + let type = wx.getStorageSync('entrance_type');
  138 + type == '1'?wx.setStorageSync('login', 1):wx.setStorageSync('gh_login', 1)
138 wx.showToast({ 139 wx.showToast({
139 title: '登录成功', 140 title: '登录成功',
140 duration: 1000, 141 duration: 1000,
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!-- 地址信息 --> 2 <!-- 地址信息 -->
3 <view class="address_box" wx:if="{{info.address}}" bindtap="add_address"> 3 <view class="address_box" wx:if="{{info.address}}" bindtap="add_address">
4 <view class="name"> {{info.address.name}} 4 <view class="name"> {{info.address.name}}
5 - <text>{{info.address.tel}}</text> 5 + <text>{{info.address.mobile}}</text>
6 </view> 6 </view>
7 <view class="address"> 7 <view class="address">
8 <image class="tips_img" src="/images/icon_54.png" /> 8 <image class="tips_img" src="/images/icon_54.png" />
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <view class="real_goods_item" wx:for="{{goodlist}}" wx:key="index" data-id="{{item.id}}" bindtap="look_more" data-type="{{item.type}}"> 5 <view class="real_goods_item" wx:for="{{goodlist}}" wx:key="index" data-id="{{item.id}}" bindtap="look_more" data-type="{{item.type}}">
6 <view class='real_goods_img'> 6 <view class='real_goods_img'>
7 <image src='{{item.image}}' mode="aspectFill" /> 7 <image src='{{item.image}}' mode="aspectFill" />
8 - <image src='/images/mei.png' class="tip" /> 8 + <image src='/images/mei.png' class="tip" wx:if="{{item.stock_num==0}}"/>
9 </view> 9 </view>
10 <view class='real_goods_bottom'> 10 <view class='real_goods_bottom'>
11 <view class='goods_title'>{{item.name}}</view> 11 <view class='goods_title'>{{item.name}}</view>
@@ -88,8 +88,11 @@ Page({ @@ -88,8 +88,11 @@ Page({
88 // wx.reLaunch({ 88 // wx.reLaunch({
89 // url: '/pages/index/index' 89 // url: '/pages/index/index'
90 // }) 90 // })
91 - wx.reLaunch({  
92 - url: '/pages/index/index' 91 + // wx.reLaunch({
  92 + // url: '/pages/index/index'
  93 + // })
  94 + wx.navigateBack({
  95 + delta: 0,
93 }) 96 })
94 // if (r.new_login == 0) { 97 // if (r.new_login == 0) {
95 // // 未绑定手机号 98 // // 未绑定手机号
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 22
23 <!-- 商品列表 --> 23 <!-- 商品列表 -->
24 <view class='real_goods'> 24 <view class='real_goods'>
25 - <Model_item list="{{shop_arr}}" wx:if="{{shop_arr.length>0}}"/> 25 + <Model_item list="{{shop_arr}}" type='open' wx:if="{{shop_arr.length>0}}"/>
26 <view class="empty" wx:else>暂无更多数据</view> 26 <view class="empty" wx:else>暂无更多数据</view>
27 </view> 27 </view>
28 28
@@ -33,7 +33,7 @@ Page({ @@ -33,7 +33,7 @@ Page({
33 goods_id:id 33 goods_id:id
34 // goods_id:911 34 // goods_id:911
35 } 35 }
36 - app.post(url, param).then((res) => { 36 + app.postk(url, param).then((res) => {
37 console.log(res,'商品') 37 console.log(res,'商品')
38 if(res.data.length!=undefined){ 38 if(res.data.length!=undefined){
39 let data=res.data; 39 let data=res.data;
@@ -98,7 +98,7 @@ Page({ @@ -98,7 +98,7 @@ Page({
98 goods_id:that.data.goods_id, 98 goods_id:that.data.goods_id,
99 spec_sku_id:that.data.spec_sku_id.join("_") 99 spec_sku_id:that.data.spec_sku_id.join("_")
100 } 100 }
101 - app.post(url, param).then((res) => { 101 + app.postk(url, param).then((res) => {
102 console.log(res,'购物车数量') 102 console.log(res,'购物车数量')
103 that.setData({ 103 that.setData({
104 min_goods_price:res.data.goods_price, 104 min_goods_price:res.data.goods_price,
@@ -173,7 +173,7 @@ Page({ @@ -173,7 +173,7 @@ Page({
173 type:1, 173 type:1,
174 spec_sku_id:that.data.spec_sku_id.join("_") 174 spec_sku_id:that.data.spec_sku_id.join("_")
175 } 175 }
176 - app.post(url, params).then((res) => { 176 + app.postk(url, params).then((res) => {
177 that.setData({ 177 that.setData({
178 "info.shop": Number(that.data.info.shop) + that.data.num, 178 "info.shop": Number(that.data.info.shop) + that.data.num,
179 num: 1 179 num: 1
@@ -328,7 +328,7 @@ Page({ @@ -328,7 +328,7 @@ Page({
328 go_login() { 328 go_login() {
329 wx.showModal({ 329 wx.showModal({
330 title: '提示', 330 title: '提示',
331 - content: '请先登录', 331 + content: '请登录后操作',
332 success(res) { 332 success(res) {
333 if (res.confirm) { 333 if (res.confirm) {
334 wx.navigateTo({ 334 wx.navigateTo({
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 <view class='bottom'> 42 <view class='bottom'>
43 <view class='cart_box' catchtap="go_car"> 43 <view class='cart_box' catchtap="go_car">
44 <view class='cart_img'> 44 <view class='cart_img'>
45 - <view class='cart_count'>{{cartnum}}</view> 45 + <view class='cart_count' wx:if='{{cartnum>0}}'>{{cartnum}}</view>
46 <image src='/images/icon_51.png'></image> 46 <image src='/images/icon_51.png'></image>
47 </view> 47 </view>
48 <view class='cart_font'>购物车</view> 48 <view class='cart_font'>购物车</view>
@@ -119,7 +119,7 @@ Page({ @@ -119,7 +119,7 @@ Page({
119 change_cover(e) { 119 change_cover(e) {
120 if( app.globalData.status==0){ 120 if( app.globalData.status==0){
121 wx.showToast({ 121 wx.showToast({
122 - title: '您已被拉黑', 122 + title: '您已您所在单位暂未开始劳保购买!',
123 icon:'none' 123 icon:'none'
124 }) 124 })
125 return false 125 return false
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 </view> 15 </view>
16 <!-- 商品列表 --> 16 <!-- 商品列表 -->
17 <view class='real_goods'> 17 <view class='real_goods'>
18 - <Model_item list="{{shop_arr}}" /> 18 + <Model_item list="{{shop_arr}}" type='open' />
19 19
20 <view class='real_goods' wx:if="{{activelist.length>0}}"> 20 <view class='real_goods' wx:if="{{activelist.length>0}}">
21 <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}}"> 21 <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}}">