正在显示
100 个修改的文件
包含
1144 行增加
和
0 行删除
Components/Model_item/Model_item.js
0 → 100644
1 | +const app=getApp() | ||
2 | +Component({ | ||
3 | + /** | ||
4 | + * 组件的属性列表 | ||
5 | + */ | ||
6 | + properties: { | ||
7 | + list: Array | ||
8 | + }, | ||
9 | + | ||
10 | + /** | ||
11 | + * 组件的初始数据 | ||
12 | + */ | ||
13 | + data: { | ||
14 | + | ||
15 | + }, | ||
16 | + | ||
17 | + /** | ||
18 | + * 组件的方法列表 | ||
19 | + */ | ||
20 | + methods: { | ||
21 | + look_more(e) { | ||
22 | + let login_new=app.globalData.login_new; | ||
23 | + if(login_new==0){ | ||
24 | + wx.showToast({ | ||
25 | + title: '您还不是会员', | ||
26 | + icon:"none" | ||
27 | + }) | ||
28 | + setTimeout(function(){ | ||
29 | + wx.navigateTo({ | ||
30 | + url: '/pages/login/login', | ||
31 | + }) | ||
32 | + },1500) | ||
33 | + return false | ||
34 | + } | ||
35 | + let id = e.currentTarget.dataset.id | ||
36 | + wx.navigateTo({ | ||
37 | + url: '/pages/shop_detail/shop_detail?id=' + id | ||
38 | + }) | ||
39 | + }, | ||
40 | + }, | ||
41 | + lifetimes: { | ||
42 | + created() { | ||
43 | + // 在组件实例刚刚被创建时执行 | ||
44 | + | ||
45 | + | ||
46 | + }, | ||
47 | + attached() { | ||
48 | + // 在组件实例进入页面节点树时执行 | ||
49 | + }, | ||
50 | + ready() { | ||
51 | + // 在组件在视图层布局完成后执行 | ||
52 | + this.setData({ | ||
53 | + list: this.properties.list | ||
54 | + }) | ||
55 | + | ||
56 | + }, | ||
57 | + detached() { | ||
58 | + // 在组件实例被从页面节点树移除时执行 | ||
59 | + }, | ||
60 | + } | ||
61 | +}) |
Components/Model_item/Model_item.json
0 → 100644
Components/Model_item/Model_item.wxml
0 → 100644
1 | +<view class='real_goods'> | ||
2 | + <view class="real_goods_item" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="{{item.sold==0?'':'look_more'}}"> | ||
3 | + <view class='real_goods_img'> | ||
4 | + <image src='{{item.images[0]}}' mode="aspectFill" /> | ||
5 | + <image src='/images/mei.png' class="tip" wx:if="{{item.sold == 0}}" /> | ||
6 | + </view> | ||
7 | + <view class='real_goods_bottom'> | ||
8 | + <view class='goods_title'>{{item.name}}</view> | ||
9 | + <view wx:if="{{item.price2!=null}}"> | ||
10 | + | ||
11 | + <view class='goods_flex'> | ||
12 | + <view class='score'>积分</view> | ||
13 | + <view class='price'>{{item.price2}}</view> | ||
14 | + | ||
15 | + | ||
16 | + <view class='sell'>已卖出{{item.paynum}}件</view> | ||
17 | + </view> | ||
18 | + | ||
19 | + <!-- <view class='oldprice'>{{item.price}}</view> --> | ||
20 | + </view> | ||
21 | + | ||
22 | + <view class='goods_flex' wx:else> | ||
23 | + <view class='score'>积分</view> | ||
24 | + <view class='price'>{{item.price}}</view> | ||
25 | + | ||
26 | + | ||
27 | + <view class='sell'>已卖出{{item.paynum}}件</view> | ||
28 | + </view> | ||
29 | + | ||
30 | + </view> | ||
31 | + | ||
32 | + <view class="pink_cover" wx:if="{{item.sold==0}}" /> | ||
33 | + | ||
34 | + </view> | ||
35 | +</view> |
Components/Model_item/Model_item.wxss
0 → 100644
1 | +.real_goods { | ||
2 | + width: 750rpx; | ||
3 | + margin: 0 auto; | ||
4 | + background: #f9f9f9; | ||
5 | + display: flex; | ||
6 | + flex-wrap: wrap; | ||
7 | + padding: 8rpx 0 20rpx; | ||
8 | + box-sizing: border-box; | ||
9 | +} | ||
10 | + | ||
11 | +.real_goods_item { | ||
12 | + width: 367rpx; | ||
13 | + margin-top: 20rpx; | ||
14 | + border-radius: 10rpx; | ||
15 | + background: #fff; | ||
16 | + overflow: hidden; | ||
17 | + position: relative; | ||
18 | + display:flex; | ||
19 | + flex-direction: column; | ||
20 | + | ||
21 | + align-items: center; | ||
22 | + | ||
23 | +} | ||
24 | +.real_goods_item:nth-child(2n){ | ||
25 | + border-left:16rpx solid #f5f5f5; | ||
26 | +} | ||
27 | + | ||
28 | +.real_goods_img { | ||
29 | + width: 332rpx; | ||
30 | + height: 332rpx; | ||
31 | + margin-bottom: 16rpx; | ||
32 | + border-top-left-radius: 10rpx; | ||
33 | + border-top-right-radius: 10rpx; | ||
34 | + overflow: hidden; | ||
35 | + position: relative; | ||
36 | +} | ||
37 | + | ||
38 | +.real_goods_img image { | ||
39 | + width: 100%; | ||
40 | + height: 100%; | ||
41 | +} | ||
42 | + | ||
43 | +.tip { | ||
44 | + width: 87rpx !important; | ||
45 | + height: 80rpx !important; | ||
46 | + position: absolute; | ||
47 | + right: 0; | ||
48 | + top: 0; | ||
49 | + z-index: 2; | ||
50 | +} | ||
51 | + | ||
52 | +.real_goods_bottom { | ||
53 | + padding: 16rpx 32rpx 28rpx 32rpx; | ||
54 | + box-sizing: border-box; | ||
55 | + background: #fff; | ||
56 | +} | ||
57 | + | ||
58 | +.goods_title { | ||
59 | + | ||
60 | + font-size: 26rpx; | ||
61 | + font-family: PingFang SC; | ||
62 | + font-weight: 500; | ||
63 | + line-height: 36rpx; | ||
64 | + color: rgba(5, 9, 26, 1); | ||
65 | + overflow: hidden; | ||
66 | + text-overflow: ellipsis; | ||
67 | + display: -webkit-box; | ||
68 | + -webkit-box-orient: vertical; | ||
69 | + -webkit-line-clamp: 2; | ||
70 | + margin-bottom: 10rpx; | ||
71 | +} | ||
72 | + | ||
73 | +.goods_flex { | ||
74 | + height: 50rpx; | ||
75 | + display: flex; | ||
76 | + align-items: center; | ||
77 | +} | ||
78 | + | ||
79 | +.score { | ||
80 | + width: 64rpx; | ||
81 | + height: 32rpx; | ||
82 | + background: rgba(242, 0, 0, 1); | ||
83 | + border-radius: 2rpx; | ||
84 | + text-align: center; | ||
85 | + color: #fff; | ||
86 | + font-size: 22rpx; | ||
87 | + font-family: PingFang SC; | ||
88 | + font-weight: 400; | ||
89 | + margin-right: 12rpx; | ||
90 | +} | ||
91 | + | ||
92 | +.price { | ||
93 | + font-size: 36rpx; | ||
94 | + font-family: PingFang SC; | ||
95 | + font-weight: bold; | ||
96 | + color: rgba(242, 0, 0, 1); | ||
97 | + margin-right: 20rpx; | ||
98 | +} | ||
99 | + | ||
100 | +.sell { | ||
101 | + font-size: 20rpx; | ||
102 | + font-family: PingFang SC; | ||
103 | + font-weight: 400; | ||
104 | + color: rgba(156, 156, 156, 1); | ||
105 | +} | ||
106 | + | ||
107 | +.pink_cover{ | ||
108 | + width: 100%; | ||
109 | + height: 100%; | ||
110 | + background: #ccc; | ||
111 | + opacity: 0.3; | ||
112 | + position: absolute; | ||
113 | + left: 0; | ||
114 | + top: 0; | ||
115 | +} | ||
116 | +.oldprice{ | ||
117 | + color:#BDC4CE; | ||
118 | + font-size: 24rpx; | ||
119 | + text-decoration: line-through | ||
120 | +} |
Components/concat/concat.js
0 → 100644
Components/concat/concat.json
0 → 100644
Components/concat/concat.wxml
0 → 100644
Components/concat/concat.wxss
0 → 100644
1 | +.concat_box { | ||
2 | + width: 96rpx; | ||
3 | + height: 210rpx; | ||
4 | + position: fixed; | ||
5 | + right: -24rpx; | ||
6 | + bottom: 100rpx; | ||
7 | +} | ||
8 | + | ||
9 | +.item { | ||
10 | + width: 60rpx; | ||
11 | + height: 60rpx; | ||
12 | + padding: 0; | ||
13 | + border: none !important; | ||
14 | + margin: 0 !important; | ||
15 | +} | ||
16 | + | ||
17 | +.item:first-child { | ||
18 | + margin-bottom: 30rpx !important; | ||
19 | +} | ||
20 | + | ||
21 | +.item image { | ||
22 | + width: 100%; | ||
23 | + height: 100%; | ||
24 | +} |
Components/shop_item/shop_item.js
0 → 100644
1 | +Component({ | ||
2 | + /** | ||
3 | + * 组件的属性列表 | ||
4 | + */ | ||
5 | + properties: { | ||
6 | + check_num: Number, //已选择商品数量 | ||
7 | + list: Array, | ||
8 | + type: Number, | ||
9 | + checkAll: Boolean | ||
10 | + }, | ||
11 | + | ||
12 | + /** | ||
13 | + * 组件的初始数据 | ||
14 | + */ | ||
15 | + data: { | ||
16 | + | ||
17 | + }, | ||
18 | + | ||
19 | + /** | ||
20 | + * 组件的方法列表 | ||
21 | + */ | ||
22 | + methods: { | ||
23 | + //查看商品详情 | ||
24 | + look_detail(e) { | ||
25 | + let id = e.currentTarget.dataset.id; | ||
26 | + | ||
27 | + // wx.navigateTo({ | ||
28 | + // url: '/pages/shop_detail/shop_detail?id=' + id | ||
29 | + // }) | ||
30 | + }, | ||
31 | + enter(){ | ||
32 | + console.log(this.data.list) | ||
33 | + }, | ||
34 | + //加减商品数量 | ||
35 | + num_change(e) { | ||
36 | + let num = Number(e.currentTarget.dataset.num) | ||
37 | + let type = e.currentTarget.dataset.type | ||
38 | + let index = e.currentTarget.dataset.index | ||
39 | + let id = e.currentTarget.dataset.id | ||
40 | + let product_id = e.currentTarget.dataset.product_id | ||
41 | + if (type == 1) { | ||
42 | + num++ | ||
43 | + } else { | ||
44 | + num-- | ||
45 | + if (num < 1) { | ||
46 | + //触发删除商品的接口 | ||
47 | + | ||
48 | + this.triggerEvent('delete_shop', { | ||
49 | + index: index, | ||
50 | + id: id | ||
51 | + }) | ||
52 | + return | ||
53 | + } | ||
54 | + } | ||
55 | + this.triggerEvent('change_num', { | ||
56 | + num: num, | ||
57 | + index: index, | ||
58 | + type: type, | ||
59 | + product_id: product_id | ||
60 | + }) | ||
61 | + }, | ||
62 | + //改变商品选中状态 | ||
63 | + check_item(e){ | ||
64 | + let index = e.currentTarget.dataset.index | ||
65 | + let check_type = e.currentTarget.dataset.check_type ? e.currentTarget.dataset.check_type:false | ||
66 | + let check_num = Number(this.data.check_num) | ||
67 | + if (!check_type){ | ||
68 | + check_num ++ | ||
69 | + } else { | ||
70 | + check_num -- | ||
71 | + } | ||
72 | + this.triggerEvent('check_type', { | ||
73 | + index: index, | ||
74 | + check_type: !check_type, | ||
75 | + check_num: check_num | ||
76 | + }) | ||
77 | + } | ||
78 | + }, | ||
79 | + lifetimes: { | ||
80 | + created() { | ||
81 | + // 在组件实例刚刚被创建时执行 | ||
82 | + | ||
83 | + | ||
84 | + }, | ||
85 | + attached() { | ||
86 | + // 在组件实例进入页面节点树时执行 | ||
87 | + }, | ||
88 | + ready() { | ||
89 | + // 在组件在视图层布局完成后执行 | ||
90 | + this.setData({ | ||
91 | + list: this.properties.list, | ||
92 | + type: this.properties.type, | ||
93 | + checkAll: this.properties.checkAll, | ||
94 | + check_num: this.properties.check_num ? this.properties.check_num:0 | ||
95 | + }) | ||
96 | + | ||
97 | + console.log(this.data.list) | ||
98 | + | ||
99 | + }, | ||
100 | + detached() { | ||
101 | + // 在组件实例被从页面节点树移除时执行 | ||
102 | + }, | ||
103 | + } | ||
104 | +}) |
Components/shop_item/shop_item.json
0 → 100644
Components/shop_item/shop_item.wxml
0 → 100644
1 | +<view class="item" wx:for="{{list}}" wx:key="index"> | ||
2 | + <view class="top"> | ||
3 | + <image class="check_box" src="{{item.check_type?'/images/check@.png':'/images/check.png'}}" wx:if="{{type == 1 || type == 2}}" catchtap="check_item" data-check_type="{{item.check_type}}" data-index="{{index}}" /> | ||
4 | + <view class="content {{type==3?'active':''}}"> | ||
5 | + <image class="show_img" src="{{type == 3?item.images[0]:type==4?item.product.images[0]:type==2?item.image:item.product.allimages[0]}}" mode="aspectFill" bindtap="{{type == 1 || type == 2?'look_detail':''}}" data-id="{{item.product_id}}"/> | ||
6 | + <view class="right {{type==3?'ractive':''}}"> | ||
7 | + <view class="word">{{type == 3?item.name:type==2?item.product_name:item.product.name}}</view> | ||
8 | + <view class="info"> | ||
9 | + <view class="jifen"> | ||
10 | + <view class="name">积分</view> | ||
11 | + <text wx:if='{{item.product.price2!=null||item.price2!=null}}'>{{type == 3 || type == 2?item.price2:item.product.price2}}</text> | ||
12 | + <text wx:else>{{type == 3 || type == 2?item.price:item.product.price}}</text> | ||
13 | + <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.num}}</text> | ||
14 | + </view> | ||
15 | + <view class="num_box" wx:if="{{type == 1}}"> | ||
16 | + <image class="num_btn" src="/images/reduce.png" data-index="{{index}}" data-type="0" data-num="{{item.num}}" data-id="{{item.id}}" data-product_id="{{item.product_id}}" catchtap="num_change" /> | ||
17 | + <text>{{item.num}}</text> | ||
18 | + <image class="num_btn" src="/images/add.png" data-index="{{index}}" data-type="1" data-num="{{item.num}}" data-id="{{item.id}}" data-product_id="{{item.product_id}}" catchtap="num_change"/> | ||
19 | + </view> | ||
20 | + </view> | ||
21 | + <!-- <view class="oldprice" wx:if="{{item.product.price2!=null||item.price2!=null}}">{{item.product.price||item.price}}</view> --> | ||
22 | + </view> | ||
23 | + </view> | ||
24 | + </view> | ||
25 | + <view class="info_box" wx:if="{{type == 3}}"> | ||
26 | + <view class="f_item"> | ||
27 | + <view class="shop" bindtap="enter"> | ||
28 | + 商品积分 | ||
29 | + <text wx:if="{{item.price2!=null}}">{{item.price2*100*item.num/100}}积分</text> | ||
30 | + <text wx:else>{{item.price*100*item.num/100}}积分</text> | ||
31 | + </view> | ||
32 | + </view> | ||
33 | + </view> | ||
34 | +</view> |
Components/shop_item/shop_item.wxss
0 → 100644
1 | +.item { | ||
2 | + width: 100%; | ||
3 | + background: #fff; | ||
4 | + padding: 0 24rpx; | ||
5 | + box-sizing: border-box; | ||
6 | + margin-top: 20rpx; | ||
7 | +} | ||
8 | + | ||
9 | +.item:first-child { | ||
10 | + margin-top: 0; | ||
11 | +} | ||
12 | + | ||
13 | +.item .top { | ||
14 | + padding: 36rpx 0; | ||
15 | + box-sizing: border-box; | ||
16 | + display: flex; | ||
17 | + align-items: center; | ||
18 | +} | ||
19 | + | ||
20 | +.check_box { | ||
21 | + width: 36rpx; | ||
22 | + height: 36rpx; | ||
23 | + padding: 30rpx 30rpx 30rpx 0; | ||
24 | +} | ||
25 | + | ||
26 | +.content { | ||
27 | + width: 564rpx; | ||
28 | + display: flex; | ||
29 | + justify-content: space-between; | ||
30 | + align-items: center; | ||
31 | +} | ||
32 | + | ||
33 | +.show_img { | ||
34 | + width: 164rpx; | ||
35 | + height: 164rpx; | ||
36 | + margin-right: 24rpx; | ||
37 | +} | ||
38 | + | ||
39 | +.right { | ||
40 | + width: 376rpx; | ||
41 | +} | ||
42 | + | ||
43 | +.word { | ||
44 | + width: 100%; | ||
45 | + height: 76rpx; | ||
46 | + font-size: 28rpx; | ||
47 | + font-family: PingFang SC; | ||
48 | + font-weight: 400; | ||
49 | + overflow: hidden; | ||
50 | + text-overflow: ellipsis; | ||
51 | + display: -webkit-box; | ||
52 | + word-break: break-all; | ||
53 | + -webkit-box-orient: vertical; | ||
54 | + -webkit-line-clamp: 2; | ||
55 | +} | ||
56 | + | ||
57 | +.info { | ||
58 | + display: flex; | ||
59 | + align-items: center; | ||
60 | + justify-content: space-between; | ||
61 | + margin-top: 32rpx; | ||
62 | +} | ||
63 | + | ||
64 | +.jifen { | ||
65 | + display: flex; | ||
66 | + align-items: center; | ||
67 | +} | ||
68 | + | ||
69 | +.jifen .name { | ||
70 | + width: 64rpx; | ||
71 | + height: 36rpx; | ||
72 | + background: rgba(242, 0, 0, 1); | ||
73 | + border-radius: 4rpx; | ||
74 | + font-size: 22rpx; | ||
75 | + font-family: PingFang SC; | ||
76 | + font-weight: 400; | ||
77 | + color: #fff; | ||
78 | + display: flex; | ||
79 | + justify-content: center; | ||
80 | + align-items: center; | ||
81 | + margin-right: 20rpx; | ||
82 | +} | ||
83 | + | ||
84 | +.jifen text { | ||
85 | + font-size: 26rpx; | ||
86 | + font-family: PingFang SC; | ||
87 | + font-weight: bold; | ||
88 | + color: rgba(242, 0, 0, 1); | ||
89 | +} | ||
90 | + | ||
91 | +.num_box { | ||
92 | + display: flex; | ||
93 | + align-items: center; | ||
94 | + justify-content: space-between; | ||
95 | +} | ||
96 | + | ||
97 | +.num_box .num_btn { | ||
98 | + width: 36rpx; | ||
99 | + height: 36rpx; | ||
100 | +} | ||
101 | + | ||
102 | +.num_box text { | ||
103 | + font-size: 30rpx; | ||
104 | + font-family: PingFang SC; | ||
105 | + font-weight: 400; | ||
106 | + color: rgba(19, 26, 46, 1); | ||
107 | + margin: 0 24rpx; | ||
108 | +} | ||
109 | + | ||
110 | +.active { | ||
111 | + width: 100%; | ||
112 | +} | ||
113 | + | ||
114 | +.ractive { | ||
115 | + width: 448rpx; | ||
116 | +} | ||
117 | + | ||
118 | +.info_box { | ||
119 | + width: 100%; | ||
120 | + margin-top: 26rpx; | ||
121 | +} | ||
122 | + | ||
123 | +.f_item { | ||
124 | + width: 100%; | ||
125 | + padding: 28rpx 0; | ||
126 | + box-sizing: border-box; | ||
127 | + border-bottom: 1px solid #eee; | ||
128 | +} | ||
129 | + | ||
130 | +.f_item .shop { | ||
131 | + width: 100%; | ||
132 | + font-size: 28rpx; | ||
133 | + font-family: PingFang SC; | ||
134 | + font-weight: 400; | ||
135 | + color: rgba(19, 26, 46, 1); | ||
136 | + display: flex; | ||
137 | + justify-content: space-between; | ||
138 | + align-items: center; | ||
139 | +} | ||
140 | + | ||
141 | +.f_item .shop text:last-child { | ||
142 | + color: #8e8e8e; | ||
143 | +} | ||
144 | + | ||
145 | +.youfei { | ||
146 | + font-size: 24rpx; | ||
147 | + font-family: PingFang SC; | ||
148 | + font-weight: 400; | ||
149 | + line-height: 34rpx; | ||
150 | + color: rgba(142, 142, 142, 1); | ||
151 | + margin-top: 10rxp; | ||
152 | +} | ||
153 | + | ||
154 | +.jifen_num { | ||
155 | + width: 100%; | ||
156 | + padding: 28rpx 0; | ||
157 | + box-sizing: border-box; | ||
158 | + display: flex; | ||
159 | + flex-direction: row-reverse; | ||
160 | + align-items: center; | ||
161 | + font-size: 28rpx; | ||
162 | + font-family: PingFang SC; | ||
163 | + font-weight: Regular; | ||
164 | + color: #131a2e; | ||
165 | +} | ||
166 | + | ||
167 | +.jifen_num text:last-child { | ||
168 | + font-size: 32rpx; | ||
169 | + color: rgba(242, 0, 0, 1); | ||
170 | + font-family: PingFang SC Bold; | ||
171 | + font-weight: Bold; | ||
172 | +} | ||
173 | + | ||
174 | +.jifen_num text:first-child { | ||
175 | + color: rgba(242, 0, 0, 1); | ||
176 | + margin-left: 10rpx; | ||
177 | +} | ||
178 | + | ||
179 | +.oldprice { | ||
180 | + color: #bdc4ce; | ||
181 | + font-size: 24rpx; | ||
182 | + text-decoration: line-through; | ||
183 | + margin-top:10rpx; | ||
184 | +} |
app.js
0 → 100644
1 | +App({ | ||
2 | + onLaunch: function () { | ||
3 | + this.getmessagelist() | ||
4 | + let token=wx.getStorageSync('token'); | ||
5 | + console.log('woshitoe',token) | ||
6 | + if(token!=""){ | ||
7 | + this.getInfoFun() | ||
8 | + } | ||
9 | + | ||
10 | + //自动更新版本 | ||
11 | + const updateManager = wx.getUpdateManager() | ||
12 | + updateManager.onCheckForUpdate(function (res) { | ||
13 | + // 请求完新版本信息的回调 | ||
14 | + | ||
15 | + }) | ||
16 | + updateManager.onUpdateReady(function () { | ||
17 | + wx.showModal({ | ||
18 | + title: '更新提示', | ||
19 | + content: '新版本已经准备好,是否重启应用?', | ||
20 | + success: function (res) { | ||
21 | + if (res.confirm) { | ||
22 | + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
23 | + updateManager.applyUpdate() | ||
24 | + } | ||
25 | + } | ||
26 | + }) | ||
27 | + }) | ||
28 | + updateManager.onUpdateFailed(function () { | ||
29 | + // 新的版本下载失败 | ||
30 | + wx.showModal({ | ||
31 | + title: '更新提示', | ||
32 | + content: '新版本下载失败', | ||
33 | + showCancel: false | ||
34 | + }) | ||
35 | + }) | ||
36 | + }, | ||
37 | + post: function (url, data, showLoad) { | ||
38 | + | ||
39 | + wx.showNavigationBarLoading() | ||
40 | + var promise = new Promise((resolve, reject) => { | ||
41 | + //init | ||
42 | + let that = this; | ||
43 | + let postData = data | ||
44 | + // let baseUrl = 'https://binhai.w.broing.cn/api'; | ||
45 | + // let baseUrl ='http://binhaitest.w.brotop.cn/api' | ||
46 | + let baseUrl = 'https://binhai.w.broing.cn/api' | ||
47 | + //网络请求 | ||
48 | + wx.request({ | ||
49 | + url: baseUrl + url, | ||
50 | + data: postData, | ||
51 | + method: 'POST', | ||
52 | + header: { | ||
53 | + 'content-type': 'application/x-www-form-urlencoded', | ||
54 | + 'token': wx.getStorageSync('token') || '' | ||
55 | + }, | ||
56 | + success: function (res) { //返回取得的数据 | ||
57 | + if (res.data.code == '200') { | ||
58 | + resolve(res.data) | ||
59 | + } else if (res.data.code == '5000') { | ||
60 | + wx.hideLoading(); | ||
61 | + reject(res.data) | ||
62 | + wx.removeStorageSync('token'); | ||
63 | + wx.removeStorageSync('login'); | ||
64 | + // wx.navigateTo({ | ||
65 | + // url: '/pages/register/register?type=1', | ||
66 | + // }) | ||
67 | + } else { | ||
68 | + wx.showModal({ | ||
69 | + title: '提示', | ||
70 | + content: res.data.msg, | ||
71 | + showCancel: false | ||
72 | + }) | ||
73 | + reject(res.data) | ||
74 | + } | ||
75 | + setTimeout(function () { | ||
76 | + wx.hideNavigationBarLoading() | ||
77 | + }, 600) | ||
78 | + }, | ||
79 | + fail: function (e) { | ||
80 | + reject('网络出错'); | ||
81 | + wx.hideNavigationBarLoading() | ||
82 | + } | ||
83 | + }) | ||
84 | + }); | ||
85 | + return promise; | ||
86 | + }, | ||
87 | + | ||
88 | + | ||
89 | + // 获取个人信息 | ||
90 | + getInfoFun() { | ||
91 | + let that= this; | ||
92 | + let u = that.interface.readteacher; | ||
93 | + that.post(u, {}).then((r) => { | ||
94 | + console.log('3489523498',r) | ||
95 | + if (r.code == 200) { | ||
96 | + | ||
97 | + wx.setStorageSync('login', r.msg.login_new) | ||
98 | + // that.globalData.login_new=r.msg.login_new; | ||
99 | + // console.log( that.globalData.login_new) | ||
100 | + // t.setData({ | ||
101 | + // obj: r.msg | ||
102 | + // }) | ||
103 | + } | ||
104 | + }) | ||
105 | + }, | ||
106 | + | ||
107 | + getmessagelist() { | ||
108 | + let that = this | ||
109 | + let url = '/information/get_all'; | ||
110 | + let data = { | ||
111 | + page: 1, | ||
112 | + pageNum: 10, | ||
113 | + | ||
114 | + } | ||
115 | + this.post(url, data, "POST").then((r) => { | ||
116 | + // console.log(r) | ||
117 | + // that.setData({ | ||
118 | + // messagelist: that.data.messagelist.concat(r.msg) | ||
119 | + // }) | ||
120 | + | ||
121 | + let newlist = []; | ||
122 | + r.msg.forEach(function (value, index, array) { | ||
123 | + console.log(newlist) | ||
124 | + if (value.status == 1) { | ||
125 | + newlist.push(value) | ||
126 | + } | ||
127 | + }) | ||
128 | + | ||
129 | + console.log('77889944556',newlist) | ||
130 | + if (newlist.length != 0) { | ||
131 | + wx.showTabBarRedDot({ | ||
132 | + index: 1, | ||
133 | + success: function (red) { | ||
134 | + | ||
135 | + wx.setTabBarBadge({ | ||
136 | + index: 1, | ||
137 | + text: newlist.length.toString(), | ||
138 | + }) | ||
139 | + } | ||
140 | + }) | ||
141 | + } | ||
142 | + | ||
143 | + | ||
144 | + }).catch((err) => { }) | ||
145 | + }, | ||
146 | + | ||
147 | + onShow: function() { | ||
148 | + console.log('hahahahhahahahhhahh') | ||
149 | + }, | ||
150 | + | ||
151 | + | ||
152 | + //接口管理 | ||
153 | + interface: { | ||
154 | + openid: '/getopenid/get', // 获取openid | ||
155 | + getcode: '/getopenid/getcode', // 获取验证码 | ||
156 | + readteacher: '/getopenid/readteacher', // 获取个人信息 | ||
157 | + login: '/getopenid/smslogin', // 登录 | ||
158 | + jifenlist: '/order/jifenlist', // 积分列表 | ||
159 | + address: '/address/index', // 地址列表 | ||
160 | + addaddress: '/address/add', // 添加地址 | ||
161 | + editaddress: '/address/edit', // 修改地址 | ||
162 | + deladdress: '/address/delete', // 删除地址 | ||
163 | + mraddress: '/address/mo', // 修改默认地址 | ||
164 | + adshow: '/address/editshow', //地址详情(数据回显) | ||
165 | + about: '/wb/wb', // 关于我们 | ||
166 | + order: '/order/orderlist', // 获取订单列表 | ||
167 | + payorder: '/order/payorder', // 订单页点击支付 | ||
168 | + disorder: '/order/disorder', // 订单列表取消订单 | ||
169 | + orderrefund: '/order/orderrefund', // 退换货详情 | ||
170 | + // upload: 'https://binhai.w.broing.cn/api/common/upload', // 上传图片 | ||
171 | + upload: 'http://binhaitest.w.brotop.cn/api', | ||
172 | + refund: '/order/refund', // 退货提交 | ||
173 | + | ||
174 | + delorder: '/order/delorder', // 删除订单 | ||
175 | + okorder: '/order/okorder', // 确认订单 | ||
176 | + orderInfo: '/order/orderInfo', // 订单详情 | ||
177 | + kuaidi: '/kuaidi/kuaidi', //物流信息 | ||
178 | + collectdel: '/product/collectdel', //收藏删除 | ||
179 | + collectList: '/getopenid/collectlist', //收藏列表 | ||
180 | + deleteseach: '/product/deleteseach', //删除搜索历史 | ||
181 | + order_pay: '/order/pay', //订单支付 | ||
182 | + now_add: '/order/now_add', //点击结算 | ||
183 | + hotsreach: '/product/hotsreach', // 热门搜索 | ||
184 | + searchhis: '/product/searchhis', // 商品搜索历史 | ||
185 | + search: '/product/search', // 商品搜索结果列表 | ||
186 | + getPid: '/cap/getpid', // 分类页面 | ||
187 | + prev_pay: '/shop/prev_pay', // 购物车点击结算 | ||
188 | + gwcshop: '/shop/gwcshop', //购物车数量修改保存 | ||
189 | + deletes: '/shop/deletes', //购物车删除 | ||
190 | + shopcar: '/shop/shopcar', // 购物车页面 | ||
191 | + now_prev_pay: '/shop/now_prev_pay', // 直接购买 | ||
192 | + addshop: '/shop/addshop', // 添加购物车 | ||
193 | + collect: '/product/collect', // 收藏 | ||
194 | + getInfo: '/product/getInfo', //商品详情 | ||
195 | + good_list: '/product/get', // 商品 | ||
196 | + index: '/cap/get', // 首页大小分类 | ||
197 | + banner: '/banner/index', // 轮播图 | ||
198 | + notice: '/cap/notice', // 公告 | ||
199 | + youfei: '/shop/youfei1', // 单算邮费 | ||
200 | + youfei1: '/shop/youfei', // 購物車邮费 | ||
201 | + | ||
202 | + shopcarNum: '/shop/shopcarnum', // 购物车数量 | ||
203 | + orderlist: '/shop/orderlist', // 订单各状态数量 | ||
204 | + | ||
205 | + order_read: '/shop/read', // 订单数 | ||
206 | + }, | ||
207 | + globalData: { | ||
208 | + login_new:"" | ||
209 | + } | ||
210 | +}) |
app.json
0 → 100644
1 | +{ | ||
2 | + "pages": [ | ||
3 | + "pages/index/index", | ||
4 | + "pages/record/record", | ||
5 | + | ||
6 | + "pages/choujiang/choujiang", | ||
7 | + | ||
8 | + "pages/rule/rule", | ||
9 | + "pages/zhuanpan/zhuanpan", | ||
10 | + | ||
11 | + | ||
12 | + "pages/logistics/logistics", | ||
13 | + | ||
14 | + "pages/register/register", | ||
15 | + "pages/login/login", | ||
16 | + | ||
17 | + | ||
18 | + "pages/startindex/startindex", | ||
19 | + | ||
20 | + | ||
21 | + "pages/zuji/zuji", | ||
22 | + "pages/messagedetail/messagedetail", | ||
23 | + "pages/message/message", | ||
24 | + "pages/shop_cart/shop_cart", | ||
25 | + "pages/classify/classify", | ||
26 | + "pages/my/my", | ||
27 | + "pages/shop_detail/shop_detail", | ||
28 | + "pages/order/order", | ||
29 | + "pages/Collection/collection", | ||
30 | + "pages/order/return_goods/return_goods", | ||
31 | + "pages/my/about_us/about_us", | ||
32 | + "pages/my/my_integral/my_integral", | ||
33 | + "pages/address/address", | ||
34 | + "pages/address/edit_address/edit_address", | ||
35 | + "pages/address/add_address/add_address", | ||
36 | + "pages/search/search", | ||
37 | + "pages/search/search_result/search_result", | ||
38 | + "pages/order/order_list/order_list", | ||
39 | + "pages/order/order_detail/order_detail", | ||
40 | + | ||
41 | + "pages/notice/notice", | ||
42 | + "pages/outerChain/outerChain", | ||
43 | + "pages/zhuanqu/zhuanqu", | ||
44 | + "pages/taocandetail/taocandetail", | ||
45 | + "pages/taocanpay/taocanpay", | ||
46 | + "pages/orderdetail/orderdetail", | ||
47 | + "pages/xianshi/xianshi" | ||
48 | + | ||
49 | + ], | ||
50 | + "window": { | ||
51 | + "backgroundTextStyle": "light", | ||
52 | + "navigationBarBackgroundColor": "#3D9AF8", | ||
53 | + "navigationBarTitleText": "海创诚品", | ||
54 | + "navigationBarTextStyle": "white" | ||
55 | + }, | ||
56 | + "tabBar": { | ||
57 | + "list": [ | ||
58 | + { | ||
59 | + "pagePath": "pages/index/index", | ||
60 | + "text": "商品", | ||
61 | + "iconPath": "images/tabbar/icon_75.png", | ||
62 | + "selectedIconPath": "images/tabbar/icon_68.png" | ||
63 | + }, | ||
64 | + { | ||
65 | + "pagePath": "pages/message/message", | ||
66 | + "text": "消息", | ||
67 | + "iconPath": "images/tabbar/message.png", | ||
68 | + "selectedIconPath": "images/tabbar/messageactive.png" | ||
69 | + }, | ||
70 | + { | ||
71 | + "pagePath": "pages/shop_cart/shop_cart", | ||
72 | + "text": "购物车", | ||
73 | + "iconPath": "images/tabbar/icon_70.png", | ||
74 | + "selectedIconPath": "images/tabbar/icon_73.png" | ||
75 | + }, | ||
76 | + { | ||
77 | + "pagePath": "pages/my/my", | ||
78 | + "text": "我的", | ||
79 | + "iconPath": "images/tabbar/icon_71.png", | ||
80 | + "selectedIconPath": "images/tabbar/icon_72.png" | ||
81 | + } | ||
82 | + ], | ||
83 | + "selectedColor": "#05091A" | ||
84 | + }, | ||
85 | + "sitemapLocation": "sitemap.json" | ||
86 | +} |
app.wxss
0 → 100644
1 | + | ||
2 | +.container { | ||
3 | + height: 100%; | ||
4 | + display: flex; | ||
5 | + flex-direction: column; | ||
6 | + align-items: center; | ||
7 | + justify-content: space-between; | ||
8 | + padding: 200rpx 0; | ||
9 | + box-sizing: border-box; | ||
10 | +} | ||
11 | +.flex{ | ||
12 | + display:flex; | ||
13 | +} | ||
14 | +.flexone { | ||
15 | + display: flex; | ||
16 | + align-items: center; | ||
17 | + } | ||
18 | + | ||
19 | + .flextwo { | ||
20 | + display: flex; | ||
21 | + align-items: center; | ||
22 | + justify-content: space-between; | ||
23 | + } | ||
24 | + | ||
25 | + .flexthree { | ||
26 | + display: flex; | ||
27 | + align-items: center; | ||
28 | + justify-content: center; | ||
29 | + } | ||
30 | + .flex { | ||
31 | + display: flex; | ||
32 | +} | ||
33 | + | ||
34 | +.flexone { | ||
35 | + display: flex; | ||
36 | + align-items: center; | ||
37 | +} | ||
38 | + | ||
39 | +.flextwo { | ||
40 | + display: flex; | ||
41 | + align-items: center; | ||
42 | + justify-content: space-between; | ||
43 | +} | ||
44 | + | ||
45 | +.flexthree { | ||
46 | + display: flex; | ||
47 | + align-items: center; | ||
48 | + justify-content: center; | ||
49 | +} | ||
50 | + | ||
51 | + | ||
52 | +.empty { | ||
53 | + font-size: 36rpx; | ||
54 | + font-family: PingFang SC; | ||
55 | + font-weight: 400; | ||
56 | + color: #ccc; | ||
57 | + margin-top: 200rpx; | ||
58 | + text-align: center; | ||
59 | +} | ||
60 | +.oldprice{ | ||
61 | + color:#BDC4CE; | ||
62 | + font-size: 24rpx; | ||
63 | + text-decoration: line-through | ||
64 | +} | ||
65 | +::-webkit-scrollbar { | ||
66 | + width: 0; | ||
67 | + height: 0; | ||
68 | + color: transparent; | ||
69 | + } | ||
70 | + /* 弹层 */ | ||
71 | +.register { | ||
72 | + width: 100%; | ||
73 | + height: 100%; | ||
74 | + background-color: rgba(0, 0, 0, 0.5); | ||
75 | + position: fixed; | ||
76 | + top: 0; | ||
77 | + left: 0; | ||
78 | + right: 0; | ||
79 | + z-index: 5; | ||
80 | +} |
images/38.png
0 → 100644
595 字节
images/39.png
0 → 100644
533 字节
images/40.png
0 → 100644
578 字节
images/add.png
0 → 100644
1.0 KB
images/alcheck.png
0 → 100644
499 字节
images/all.png
0 → 100644
976 字节
images/anniu.png
0 → 100644
21.5 KB
images/bingo.png
0 → 100644
165 字节
images/bodadianhua_icon.png
0 → 100644
634 字节
images/bubble.png
0 → 100644
7.6 KB
images/chahao.png
0 → 100644
2.4 KB
images/check.png
0 → 100644
844 字节
images/check@.png
0 → 100644
673 字节
images/chou.png
0 → 100644
18.5 KB
images/choujiang.png
0 → 100644
5.1 KB
images/close.png
0 → 100644
1.2 KB
images/del.png
0 → 100644
662 字节
images/delete.png
0 → 100644
450 字节
images/icon_13.png
0 → 100644
843 字节
images/icon_14.png
0 → 100644
994 字节
images/icon_15.png
0 → 100644
984 字节
images/icon_16.png
0 → 100644
1.0 KB
images/icon_29.png
0 → 100644
1.1 KB
images/icon_30.png
0 → 100644
1.5 KB
images/icon_31.png
0 → 100644
1.7 KB
images/icon_32.png
0 → 100644
991 字节
images/icon_33.png
0 → 100644
750 字节
images/icon_34.png
0 → 100644
860 字节
images/icon_35.png
0 → 100644
560 字节
images/icon_37.png
0 → 100644
909 字节
images/icon_41.png
0 → 100644
278 字节
images/icon_43.png
0 → 100644
543 字节
images/icon_46.png
0 → 100644
3.7 KB
images/icon_48.png
0 → 100644
494 字节
images/icon_50.png
0 → 100644
7.9 KB
images/icon_51.png
0 → 100644
813 字节
images/icon_54.png
0 → 100644
966 字节
images/icon_55.png
0 → 100644
3.3 KB
images/icon_58.png
0 → 100644
1.0 KB
images/icon_59.png
0 → 100644
4.6 KB
images/icon_60.png
0 → 100644
388 字节
images/icon_61.png
0 → 100644
1.2 KB
images/icon_62.png
0 → 100644
1.1 KB
images/icon_64.png
0 → 100644
1.1 KB
images/icon_65.png
0 → 100644
4.5 KB
images/icon_78.png
0 → 100644
4.9 KB
images/icon_79.png
0 → 100644
53.6 KB
images/icon_80.png
0 → 100644
5.5 KB
images/icon_81.png
0 → 100644
1.8 KB
images/icon_82.png
0 → 100644
1.7 KB
images/icon_83.png
0 → 100644
1.0 KB
images/icon_84.png
0 → 100644
2.2 KB
images/icon_85.png
0 → 100644
7.6 KB
images/jilu.png
0 → 100644
1.1 KB
images/kefu_icon.png
0 → 100644
847 字节
images/line.png
0 → 100644
295 字节
images/login_bg.png
0 → 100644
20.7 KB
images/logo.png
0 → 100644
6.3 KB
images/mei.png
0 → 100644
740 字节
images/mingdan.png
0 → 100644
1012 字节
images/more.png
0 → 100644
2.2 KB
images/neigouk.png
0 → 100644
123.5 KB
images/neigoukk.png
0 → 100644
790.2 KB
images/notice.png
0 → 100644
2.2 KB
images/reduce.png
0 → 100644
961 字节
images/sc.png
0 → 100644
1007 字节
images/sc@.png
0 → 100644
688 字节
images/search.png
0 → 100644
782 字节
images/select.png
0 → 100644
338 字节
images/select_active.png
0 → 100644
347 字节
images/shoubiao.png
0 → 100644
12.0 KB
images/success.png
0 → 100644
4.5 KB
images/tabbar/icon_68.png
0 → 100644
1.9 KB
images/tabbar/icon_70.png
0 → 100644
1.0 KB
images/tabbar/icon_71.png
0 → 100644
1.1 KB
images/tabbar/icon_72.png
0 → 100644
1.7 KB
images/tabbar/icon_73.png
0 → 100644
1.5 KB
images/tabbar/icon_75.png
0 → 100644
1.4 KB
images/tabbar/message.png
0 → 100644
1.2 KB
images/tabbar/messageactive.png
0 → 100644
1.7 KB
images/up.png
0 → 100644
1.2 KB
images/youjiantou.png
0 → 100644
489 字节
images/zuji.png
0 → 100644
3.3 KB
pages/Collection/collection.js
0 → 100644
1 | +const app = getApp() | ||
2 | +Page({ | ||
3 | + | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + check_num: 0, //选中数量 | ||
9 | + checkAll: false, //全选状态 | ||
10 | + check_str: '' | ||
11 | + }, | ||
12 | + //改变商品状态 | ||
13 | + check_type(e) { | ||
14 | + let index = Number(e.detail.index) | ||
15 | + this.setData({ | ||
16 | + [`list[${index}].check_type`]: e.detail.check_type, | ||
17 | + check_num: e.detail.check_num | ||
18 | + }) | ||
19 | + if (e.detail.check_num == this.data.list.length) { | ||
20 | + this.setData({ | ||
21 | + checkAll: true | ||
22 | + }) | ||
23 | + } else if (e.detail.check_num == 0) { | ||
24 | + this.setData({ | ||
25 | + checkAll: false | ||
26 | + }) | ||
27 | + } | ||
28 | + this.get_all() | ||
29 | + }, | ||
30 | + //全选|全不选 | ||
31 | + check_all() { | ||
32 | + let list = this.data.list | ||
33 | + for (let obj of list) { | ||
34 | + obj.check_type = !this.data.checkAll | ||
35 | + } | ||
36 | + this.setData({ | ||
37 | + checkAll: !this.data.checkAll, | ||
38 | + list: list, | ||
39 | + check_num: !this.data.checkAll ? list.length : 0 | ||
40 | + }) | ||
41 | + this.get_all() | ||
42 | + }, | ||
43 | + //获取选中商品 | ||
44 | + get_all() { | ||
45 | + let that = this | ||
46 | + let list = that.data.list | ||
47 | + let check_str = '' | ||
48 | + for (let obj of list) { | ||
49 | + if (obj.check_type) { | ||
50 | + if (check_str == ""){ | ||
51 | + check_str = obj.id | ||
52 | + } else { | ||
53 | + check_str = check_str + ',' + obj.id | ||
54 | + } | ||
55 | + } | ||
56 | + } | ||
57 | + that.setData({ | ||
58 | + check_str: check_str | ||
59 | + }) | ||
60 | + }, | ||
61 | + delete_item(){ | ||
62 | + if (this.data.check_str == ""){ | ||
63 | + wx.showToast({ | ||
64 | + title: '请先选中商品', | ||
65 | + icon: 'none', | ||
66 | + duration: 1000 | ||
67 | + }) | ||
68 | + return | ||
69 | + } | ||
70 | + let url = app.interface.collectdel | ||
71 | + let params = { | ||
72 | + ids: this.data.check_str | ||
73 | + } | ||
74 | + app.post(url,params).then((res)=>{ | ||
75 | + wx.showToast({ | ||
76 | + title: '删除成功', | ||
77 | + duration: 1000 | ||
78 | + }) | ||
79 | + this.get_info() | ||
80 | + }) | ||
81 | + }, | ||
82 | +//获取页面信息 | ||
83 | + get_info() { | ||
84 | + wx.showLoading({ | ||
85 | + title: '加载中' | ||
86 | + }) | ||
87 | + let that = this | ||
88 | + let url = app.interface.collectList | ||
89 | + app.post(url, {}).then((res) => { | ||
90 | + wx.hideLoading() | ||
91 | + that.setData({ | ||
92 | + list: res.msg | ||
93 | + }) | ||
94 | + }) | ||
95 | + }, | ||
96 | + | ||
97 | + | ||
98 | + /** | ||
99 | + * 生命周期函数--监听页面加载 | ||
100 | + */ | ||
101 | + onLoad: function(options) { | ||
102 | + this.get_info() | ||
103 | + }, | ||
104 | + | ||
105 | + /** | ||
106 | + * 生命周期函数--监听页面初次渲染完成 | ||
107 | + */ | ||
108 | + onReady: function() { | ||
109 | + | ||
110 | + }, | ||
111 | + | ||
112 | + /** | ||
113 | + * 生命周期函数--监听页面显示 | ||
114 | + */ | ||
115 | + onShow: function() { | ||
116 | + | ||
117 | + }, | ||
118 | + | ||
119 | + /** | ||
120 | + * 生命周期函数--监听页面隐藏 | ||
121 | + */ | ||
122 | + onHide: function() { | ||
123 | + | ||
124 | + }, | ||
125 | + | ||
126 | + /** | ||
127 | + * 生命周期函数--监听页面卸载 | ||
128 | + */ | ||
129 | + onUnload: function() { | ||
130 | + | ||
131 | + }, | ||
132 | + | ||
133 | + /** | ||
134 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
135 | + */ | ||
136 | + onPullDownRefresh: function() { | ||
137 | + | ||
138 | + }, | ||
139 | + | ||
140 | + /** | ||
141 | + * 页面上拉触底事件的处理函数 | ||
142 | + */ | ||
143 | + onReachBottom: function() { | ||
144 | + | ||
145 | + }, | ||
146 | + | ||
147 | + /** | ||
148 | + * 用户点击右上角分享 | ||
149 | + */ | ||
150 | + onShareAppMessage: function() { | ||
151 | + | ||
152 | + } | ||
153 | +}) |
-
请 注册 或 登录 后发表评论