作者 lihongjuan

滨海内购开放商城

正在显示 61 个修改的文件 包含 3149 行增加733 行删除

要显示太多修改。

为保证性能只显示 61 of 61+ 个文件。

@@ -20,22 +20,36 @@ Component({ @@ -20,22 +20,36 @@ Component({
20 methods: { 20 methods: {
21 look_more(e) { 21 look_more(e) {
22 let login_new=app.globalData.login_new; 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 - } 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 35 let id = e.currentTarget.dataset.id
36 - wx.navigateTo({  
37 - url: '/pages/shop_detail/shop_detail?id=' + id  
38 - }) 36 + let token=wx.getStorageSync('token');
  37 + if(token==''){
  38 + wx.showToast({
  39 + title: '请先登录',
  40 + icon:'none',
  41 + duration: 1300
  42 + })
  43 + setTimeout(function(){
  44 + wx.navigateTo({
  45 + url: '/pages/register/register',
  46 + })
  47 + },1300)
  48 + }else{
  49 + wx.navigateTo({
  50 + url: '/pages/shop_detail/shop_detail?id=' + id
  51 + })
  52 + }
39 }, 53 },
40 }, 54 },
41 lifetimes: { 55 lifetimes: {
1 <view class='real_goods'> 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}}"> 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>
10 9
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 10
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> 11 + <view class='goods_flex'>
  12 + <!-- <view class='score'>积分</view>
  13 + <view class='price'>{{item.price2}}</view>
29 14
30 - </view>  
31 15
32 - <view class="pink_cover" wx:if="{{item.sold==0}}" /> 16 + <view class='sell'>已卖出{{item.paynum}}件</view> -->
  17 + <view class='price'>¥{{item.min_goods_price}}</view>
  18 + <view class="lineprice" wx:if="{{item.min_goods_price!=null}}">¥{{item.line_price}}</view>
33 19
34 - </view> 20 + </view>
  21 + <view class='sell'>已卖出{{item.sales}}件</view>
  22 + <!-- <view class='oldprice'>{{item.price}}</view> -->
  23 + </view>
  24 + <view class="pink_cover" wx:if="{{item.sold==0}}" />
  25 + </view>
35 </view> 26 </view>
1 .real_goods { 1 .real_goods {
2 width: 750rpx; 2 width: 750rpx;
3 margin: 0 auto; 3 margin: 0 auto;
4 - background: #f9f9f9; 4 + /* background: #f9f9f9; */
5 display: flex; 5 display: flex;
6 flex-wrap: wrap; 6 flex-wrap: wrap;
7 padding: 8rpx 0 20rpx; 7 padding: 8rpx 0 20rpx;
8 box-sizing: border-box; 8 box-sizing: border-box;
  9 + margin-bottom:120rpx;
  10 + padding: 0 32rpx;
  11 + box-sizing: border-box;
9 } 12 }
10 13
11 .real_goods_item { 14 .real_goods_item {
12 - width: 367rpx;  
13 - margin-top: 20rpx; 15 + width: 332rpx;
  16 + margin-bottom: 20rpx;
14 border-radius: 10rpx; 17 border-radius: 10rpx;
15 background: #fff; 18 background: #fff;
16 overflow: hidden; 19 overflow: hidden;
17 position: relative; 20 position: relative;
18 display:flex; 21 display:flex;
19 flex-direction: column; 22 flex-direction: column;
20 -  
21 align-items: center; 23 align-items: center;
22 - 24 + margin-right:6rpx
23 } 25 }
24 .real_goods_item:nth-child(2n){ 26 .real_goods_item:nth-child(2n){
25 border-left:16rpx solid #f5f5f5; 27 border-left:16rpx solid #f5f5f5;
  28 + margin-right: 0;
26 } 29 }
27 30
28 .real_goods_img { 31 .real_goods_img {
@@ -90,7 +93,7 @@ @@ -90,7 +93,7 @@
90 } 93 }
91 94
92 .price { 95 .price {
93 - font-size: 36rpx; 96 + font-size: 30rpx;
94 font-family: PingFang SC; 97 font-family: PingFang SC;
95 font-weight: bold; 98 font-weight: bold;
96 color: rgba(242, 0, 0, 1); 99 color: rgba(242, 0, 0, 1);
@@ -117,4 +120,12 @@ @@ -117,4 +120,12 @@
117 color:#BDC4CE; 120 color:#BDC4CE;
118 font-size: 24rpx; 121 font-size: 24rpx;
119 text-decoration: line-through 122 text-decoration: line-through
  123 +}
  124 +
  125 +.lineprice{
  126 + color: rgba(156, 156, 156, 1);
  127 + text-decoration: line-through;
  128 + font-size: 20rpx;
  129 + margin-right:5rpx;
  130 +
120 } 131 }
1 <view class="concat_box"> 1 <view class="concat_box">
2 - <button open-type="contact" class="item" plain="true">  
3 - <image src="/images/icon_65.png" />  
4 - </button> 2 + <image src="/images/icon_65.png" class="item" />
  3 + <button open-type="contact" plain="true" class="dadianhua"></button>
5 <view class="item" catchtap="tel"> 4 <view class="item" catchtap="tel">
6 <image src="/images/bodadianhua_icon.png" /> 5 <image src="/images/bodadianhua_icon.png" />
7 </view> 6 </view>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 height: 210rpx; 3 height: 210rpx;
4 position: fixed; 4 position: fixed;
5 right: -24rpx; 5 right: -24rpx;
6 - bottom: 100rpx; 6 + bottom: 127rpx;
7 } 7 }
8 8
9 .item { 9 .item {
@@ -12,6 +12,18 @@ @@ -12,6 +12,18 @@
12 padding: 0; 12 padding: 0;
13 border: none !important; 13 border: none !important;
14 margin: 0 !important; 14 margin: 0 !important;
  15 + position: relative;
  16 +}
  17 +.dadianhua{
  18 + width: 60rpx;
  19 + height: 60rpx;
  20 + border-radius: 50%;
  21 + position: absolute;
  22 + left:0;
  23 + top:0;
  24 + border:none;
  25 + outline:none;
  26 + opacity: 0;
15 } 27 }
16 28
17 .item:first-child { 29 .item:first-child {
@@ -33,11 +33,14 @@ Component({ @@ -33,11 +33,14 @@ Component({
33 }, 33 },
34 //加减商品数量 34 //加减商品数量
35 num_change(e) { 35 num_change(e) {
  36 + console.log(e)
36 let num = Number(e.currentTarget.dataset.num) 37 let num = Number(e.currentTarget.dataset.num)
37 let type = e.currentTarget.dataset.type 38 let type = e.currentTarget.dataset.type
38 let index = e.currentTarget.dataset.index 39 let index = e.currentTarget.dataset.index
39 let id = e.currentTarget.dataset.id 40 let id = e.currentTarget.dataset.id
40 - let product_id = e.currentTarget.dataset.product_id 41 + let product_id = e.currentTarget.dataset.product_id;
  42 + let spec_sku_id=e.currentTarget.dataset.specid;
  43 + console.log('属性idid ',spec_sku_id)
41 if (type == 1) { 44 if (type == 1) {
42 num++ 45 num++
43 } else { 46 } else {
@@ -56,7 +59,14 @@ Component({ @@ -56,7 +59,14 @@ Component({
56 num: num, 59 num: num,
57 index: index, 60 index: index,
58 type: type, 61 type: type,
59 - product_id: product_id 62 + product_id: product_id,
  63 + spec_sku_id:spec_sku_id
  64 + })
  65 + },
  66 + lookdetail(e){
  67 + let id=e.currentTarget.dataset.id;
  68 + wx.navigateTo({
  69 + url: '/pages/shop_detail/shop_detail?id=' + id
60 }) 70 })
61 }, 71 },
62 //改变商品选中状态 72 //改变商品选中状态
@@ -64,6 +74,7 @@ Component({ @@ -64,6 +74,7 @@ Component({
64 let index = e.currentTarget.dataset.index 74 let index = e.currentTarget.dataset.index
65 let check_type = e.currentTarget.dataset.check_type ? e.currentTarget.dataset.check_type:false 75 let check_type = e.currentTarget.dataset.check_type ? e.currentTarget.dataset.check_type:false
66 let check_num = Number(this.data.check_num) 76 let check_num = Number(this.data.check_num)
  77 +
67 if (!check_type){ 78 if (!check_type){
68 check_num ++ 79 check_num ++
69 } else { 80 } else {
@@ -72,10 +83,12 @@ Component({ @@ -72,10 +83,12 @@ Component({
72 this.triggerEvent('check_type', { 83 this.triggerEvent('check_type', {
73 index: index, 84 index: index,
74 check_type: !check_type, 85 check_type: !check_type,
75 - check_num: check_num 86 + check_num: check_num,
  87 +
76 }) 88 })
77 } 89 }
78 }, 90 },
  91 +
79 lifetimes: { 92 lifetimes: {
80 created() { 93 created() {
81 // 在组件实例刚刚被创建时执行 94 // 在组件实例刚刚被创建时执行
1 <view class="item" wx:for="{{list}}" wx:key="index"> 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}}" /> 2 + <view class="top" bindtap="lookdetail" data-id="{{item.goods_id}}">
  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':''}}"> 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> 5 + <image class="show_img" src="{{type == 3?item.image:type==4?item.image:type==2?item.image:item.image}}" mode="aspectFill" bindtap="{{type == 1 || type == 2?'look_detail':''}}" data-id="{{item.product_id}}" />
  6 + <view class="right {{type==3||type==1||type==4?'ractive':''}}">
  7 + <!-- <view class="word">{{type == 3||type==1||type==4?item.name:type==2?item.product_name:item.product.name}}</view> -->
  8 + <view class="word">{{item.name}}</view>
  9 + <view class="guige">
  10 + <view class="guigeitem" wx:for="{{item.spec}}" wx:key="index">{{item.spec_name}}:{{item.spec_value}}</view>
  11 + </view>
8 <view class="info"> 12 <view class="info">
9 <view class="jifen"> 13 <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 + <text wx:if="{{type==1}}">{{item.goods_price}}</text>
  15 + <text wx:if="{{type==2}}">{{item.goods.min_goods_price}}</text>
  16 + <text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.number}}</text>
14 </view> 17 </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"/> 18 + <view class="num_box" wx:if="{{type == 1}}">
  19 + <image class="num_btn" src="/images/reduce.png" data-index="{{index}}" data-type="2" data-num="{{item.number}}" data-id="{{item.car_id}}" data-product_id="{{item.id}}" catchtap="num_change" data-specid="{{item.spec_sku_id}}"/>
  20 + <text>{{item.number}}</text>
  21 + <image class="num_btn" src="/images/add.png" data-index="{{index}}" data-type="1" data-num="{{item.number}}" data-id="{{item.car_id}}" data-specid="{{item.spec_sku_id}}" data-product_id="{{item.id}}" catchtap="num_change"/>
19 </view> 22 </view>
20 </view> 23 </view>
21 - <!-- <view class="oldprice" wx:if="{{item.product.price2!=null||item.price2!=null}}">{{item.product.price||item.price}}</view> -->  
22 </view> 24 </view>
23 </view> 25 </view>
24 </view> 26 </view>
@@ -182,3 +182,15 @@ @@ -182,3 +182,15 @@
182 text-decoration: line-through; 182 text-decoration: line-through;
183 margin-top:10rpx; 183 margin-top:10rpx;
184 } 184 }
  185 +.guigeitem{
  186 + color: rgba(156, 156, 156, 1);
  187 + font-size:28rpx;
  188 + margin-right:20rpx;
  189 + margin-bottom:10rpx;
  190 +
  191 +}
  192 +.guige{
  193 + display:flex;
  194 + flex-wrap: wrap;
  195 + align-items: center;
  196 +}
@@ -43,7 +43,9 @@ App({ @@ -43,7 +43,9 @@ App({
43 let postData = data 43 let postData = data
44 // let baseUrl = 'https://binhai.w.broing.cn/api'; 44 // let baseUrl = 'https://binhai.w.broing.cn/api';
45 // let baseUrl ='http://binhaitest.w.brotop.cn/api' 45 // let baseUrl ='http://binhaitest.w.brotop.cn/api'
46 - let baseUrl = 'https://binhai.w.broing.cn/api' 46 + // 现在用的
  47 + // let baseUrl = 'https://binhai.w.broing.cn/api'
  48 + let baseUrl = 'http://binhaitest.w.brotop.cn/api'
47 //网络请求 49 //网络请求
48 wx.request({ 50 wx.request({
49 url: baseUrl + url, 51 url: baseUrl + url,
@@ -54,11 +56,65 @@ App({ @@ -54,11 +56,65 @@ App({
54 'token': wx.getStorageSync('token') || '' 56 'token': wx.getStorageSync('token') || ''
55 }, 57 },
56 success: function (res) { //返回取得的数据 58 success: function (res) { //返回取得的数据
  59 + console.log('ssssssssssssssssssssssssssssssssssss',res)
57 if (res.data.code == '200') { 60 if (res.data.code == '200') {
58 resolve(res.data) 61 resolve(res.data)
59 } else if (res.data.code == '5000') { 62 } else if (res.data.code == '5000') {
60 wx.hideLoading(); 63 wx.hideLoading();
61 reject(res.data) 64 reject(res.data)
  65 + // wx.removeStorageSync('token');
  66 + wx.removeStorageSync('login');
  67 + // wx.navigateTo({
  68 + // url: '/pages/register/register?type=1',
  69 + // })
  70 + } else {
  71 + wx.showModal({
  72 + title: '提示',
  73 + content: res.data.msg,
  74 + showCancel: false
  75 + })
  76 + reject(res.data)
  77 + }
  78 + setTimeout(function () {
  79 + wx.hideNavigationBarLoading()
  80 + }, 600)
  81 + },
  82 + fail: function (e) {
  83 + reject('网络出错');
  84 + wx.hideNavigationBarLoading()
  85 + }
  86 + })
  87 + });
  88 + return promise;
  89 + },
  90 +
  91 + // 开放商城公共接口
  92 + postk: function (url, data, showLoad) {
  93 + wx.showNavigationBarLoading()
  94 + var promise = new Promise((resolve, reject) => {
  95 + //init
  96 + let that = this;
  97 + let postData = data
  98 + // let baseUrl = 'https://binhai.w.broing.cn/api';
  99 + // let baseUrl ='http://binhaitest.w.brotop.cn/api'
  100 + let baseUrl = 'http://binhaidispark.t.brotop.cn/api'
  101 +
  102 +
  103 + //网络请求
  104 + wx.request({
  105 + url: baseUrl + url,
  106 + data: postData,
  107 + method: 'POST',
  108 + header: {
  109 + 'content-type': 'application/x-www-form-urlencoded',
  110 + 'token': wx.getStorageSync('token') || ''
  111 + },
  112 + success: function (res) { //返回取得的数据
  113 + if (res.data.code == '1') {
  114 + resolve(res.data)
  115 + } else if (res.data.code == '5000') {
  116 + wx.hideLoading();
  117 + reject(res.data)
62 wx.removeStorageSync('token'); 118 wx.removeStorageSync('token');
63 wx.removeStorageSync('login'); 119 wx.removeStorageSync('login');
64 // wx.navigateTo({ 120 // wx.navigateTo({
@@ -85,6 +141,52 @@ App({ @@ -85,6 +141,52 @@ App({
85 return promise; 141 return promise;
86 }, 142 },
87 143
  144 + upload(filetype, file) {
  145 +
  146 + var promise = new Promise((resolve, reject) => {
  147 + wx.showNavigationBarLoading()
  148 + wx.showLoading({
  149 + title: '上传中',
  150 + })
  151 + let url = 'http://binhaidispark.t.brotop.cn/api/common/upload';
  152 +
  153 + let head = {
  154 + 'token': wx.getStorageSync('token'),
  155 + 'XX-Device-Type': ''
  156 + }
  157 + let typename = {
  158 + filetype: filetype
  159 + }
  160 + wx.uploadFile({
  161 + url: url, //仅为示例,非真实的接口地址
  162 + filePath: file,
  163 + name: 'file',
  164 + header: head,
  165 + formData: typename,
  166 + success: function (res) {
  167 + console.log('上传文件后', res)
  168 + let temdata = JSON.parse(res.data);
  169 + console.log(temdata)
  170 + let urlobj = {
  171 + url: temdata.data.url
  172 + }
  173 + resolve(urlobj);
  174 +
  175 + },
  176 + fail: function (res) {
  177 + reject('网络出错');
  178 + wx.hideNavigationBarLoading()
  179 + wx.hideLoading()
  180 + },
  181 + complete: () => {
  182 + wx.hideNavigationBarLoading()
  183 + wx.hideLoading()
  184 + },
  185 + })
  186 + });
  187 + return promise;
  188 + },
  189 +
88 190
89 // 获取个人信息 191 // 获取个人信息
90 getInfoFun() { 192 getInfoFun() {
@@ -205,6 +307,7 @@ App({ @@ -205,6 +307,7 @@ App({
205 order_read: '/shop/read', // 订单数 307 order_read: '/shop/read', // 订单数
206 }, 308 },
207 globalData: { 309 globalData: {
208 - login_new:"" 310 + login_new:"",
  311 + baseUrlimg :'http://binhaidispark.t.brotop.cn/'
209 } 312 }
210 }) 313 })
1 { 1 {
2 - "pages": [  
3 - "pages/index/index",  
4 - "pages/register/register",  
5 - "pages/login/login",  
6 -  
7 -  
8 - "pages/startindex/startindex",  
9 -  
10 -  
11 - "pages/zuji/zuji",  
12 - "pages/messagedetail/messagedetail",  
13 - "pages/message/message",  
14 - "pages/shop_cart/shop_cart",  
15 - "pages/classify/classify",  
16 - "pages/my/my",  
17 - "pages/shop_detail/shop_detail",  
18 - "pages/order/order",  
19 - "pages/Collection/collection",  
20 - "pages/order/return_goods/return_goods",  
21 - "pages/my/about_us/about_us",  
22 - "pages/my/my_integral/my_integral",  
23 - "pages/address/address",  
24 - "pages/address/edit_address/edit_address",  
25 - "pages/address/add_address/add_address",  
26 - "pages/search/search",  
27 - "pages/search/search_result/search_result",  
28 - "pages/order/order_list/order_list",  
29 - "pages/order/order_detail/order_detail",  
30 - "pages/logistics/logistics",  
31 - "pages/notice/notice",  
32 - "pages/outerChain/outerChain",  
33 - "pages/zhuanqu/zhuanqu",  
34 - "pages/taocandetail/taocandetail",  
35 - "pages/taocanpay/taocanpay",  
36 - "pages/orderdetail/orderdetail",  
37 - "pages/xianshi/xianshi"  
38 -  
39 - ],  
40 - "window": {  
41 - "backgroundTextStyle": "light",  
42 - "navigationBarBackgroundColor": "#3D9AF8",  
43 - "navigationBarTitleText": "海创诚品",  
44 - "navigationBarTextStyle": "white"  
45 - },  
46 - "tabBar": {  
47 - "list": [  
48 - {  
49 - "pagePath": "pages/index/index",  
50 - "text": "商品",  
51 - "iconPath": "images/tabbar/icon_75.png",  
52 - "selectedIconPath": "images/tabbar/icon_68.png"  
53 - },  
54 - {  
55 - "pagePath": "pages/message/message",  
56 - "text": "消息",  
57 - "iconPath": "images/tabbar/message.png",  
58 - "selectedIconPath": "images/tabbar/messageactive.png"  
59 - },  
60 - {  
61 - "pagePath": "pages/shop_cart/shop_cart",  
62 - "text": "购物车",  
63 - "iconPath": "images/tabbar/icon_70.png",  
64 - "selectedIconPath": "images/tabbar/icon_73.png"  
65 - },  
66 - {  
67 - "pagePath": "pages/my/my",  
68 - "text": "我的",  
69 - "iconPath": "images/tabbar/icon_71.png",  
70 - "selectedIconPath": "images/tabbar/icon_72.png"  
71 - }  
72 - ],  
73 - "selectedColor": "#05091A"  
74 - },  
75 - "sitemapLocation": "sitemap.json" 2 + "pages": [
  3 + "pages/index/index",
  4 + "pages/coupon/coupon",
  5 + "pages/lingqucoupon/lingqucoupon",
  6 + "pages/register/register",
  7 + "pages/login/login",
  8 + "pages/startindex/startindex",
  9 + "pages/zuji/zuji",
  10 + "pages/messagedetail/messagedetail",
  11 + "pages/message/message",
  12 + "pages/shop_cart/shop_cart",
  13 + "pages/classify/classify",
  14 + "pages/my/my",
  15 + "pages/shop_detail/shop_detail",
  16 + "pages/order/order",
  17 + "pages/Collection/collection",
  18 + "pages/order/return_goods/return_goods",
  19 + "pages/my/about_us/about_us",
  20 + "pages/my/my_integral/my_integral",
  21 + "pages/address/address",
  22 + "pages/address/edit_address/edit_address",
  23 + "pages/address/add_address/add_address",
  24 + "pages/search/search",
  25 + "pages/search/search_result/search_result",
  26 + "pages/order/order_list/order_list",
  27 + "pages/order/order_detail/order_detail",
  28 + "pages/logistics/logistics",
  29 + "pages/notice/notice",
  30 + "pages/outerChain/outerChain",
  31 + "pages/zhuanqu/zhuanqu",
  32 + "pages/taocandetail/taocandetail",
  33 + "pages/taocanpay/taocanpay",
  34 + "pages/orderdetail/orderdetail",
  35 + "pages/xianshi/xianshi",
  36 + "pages/coupon",
  37 + "pages/pinpaibox/pinpaibox"
  38 + ],
  39 + "subpackages": [
  40 + {
  41 + "root": "packageA",
  42 + "pages": [
  43 + "pages/index/index",
  44 + "pages/register/register",
  45 + "pages/login/login",
  46 + "pages/startindex/startindex",
  47 + "pages/zuji/zuji",
  48 + "pages/messagedetail/messagedetail",
  49 + "pages/message/message",
  50 + "pages/shop_cart/shop_cart",
  51 + "pages/classify/classify",
  52 + "pages/my/my",
  53 + "pages/shop_detail/shop_detail",
  54 + "pages/order/order",
  55 + "pages/Collection/collection",
  56 + "pages/order/return_goods/return_goods",
  57 + "pages/my/about_us/about_us",
  58 + "pages/my/my_integral/my_integral",
  59 + "pages/address/address",
  60 + "pages/address/edit_address/edit_address",
  61 + "pages/address/add_address/add_address",
  62 + "pages/search/search",
  63 + "pages/search/search_result/search_result",
  64 + "pages/order/order_list/order_list",
  65 + "pages/order/order_detail/order_detail",
  66 + "pages/logistics/logistics",
  67 + "pages/notice/notice",
  68 + "pages/outerChain/outerChain",
  69 + "pages/zhuanqu/zhuanqu",
  70 + "pages/taocandetail/taocandetail",
  71 + "pages/taocanpay/taocanpay",
  72 + "pages/orderdetail/orderdetail",
  73 + "pages/xianshi/xianshi"
  74 + ]
  75 + }
  76 + ],
  77 + "window": {
  78 + "backgroundTextStyle": "light",
  79 + "navigationBarBackgroundColor": "#3D9AF8",
  80 + "navigationBarTitleText": "海创诚品",
  81 + "navigationBarTextStyle": "white"
  82 + },
  83 + "tabBar": {
  84 + "custom": true,
  85 + "list": [
  86 + {
  87 + "pagePath": "pages/index/index",
  88 + "text": "商品",
  89 + "iconPath": "images/tabbar/icon_75.png",
  90 + "selectedIconPath": "images/tabbar/icon_68.png"
  91 + },
  92 + {
  93 + "pagePath": "pages/message/message",
  94 + "text": "消息",
  95 + "iconPath": "images/tabbar/message.png",
  96 + "selectedIconPath": "images/tabbar/messageactive.png"
  97 + },
  98 + {
  99 + "pagePath": "pages/shop_cart/shop_cart",
  100 + "text": "购物车",
  101 + "iconPath": "images/tabbar/icon_70.png",
  102 + "selectedIconPath": "images/tabbar/icon_73.png"
  103 + },
  104 + {
  105 + "pagePath": "pages/my/my",
  106 + "text": "我的",
  107 + "iconPath": "images/tabbar/icon_71.png",
  108 + "selectedIconPath": "images/tabbar/icon_72.png"
  109 + }
  110 + ],
  111 + "selectedColor": "#05091A"
  112 + },
  113 + "sitemapLocation": "sitemap.json"
76 } 114 }
@@ -66,4 +66,139 @@ @@ -66,4 +66,139 @@
66 width: 0; 66 width: 0;
67 height: 0; 67 height: 0;
68 color: transparent; 68 color: transparent;
69 - }  
  69 + }
  70 + .lineprice{
  71 + color:#8E8E8E;
  72 + text-decoration: line-through;
  73 + font-size:28rpx;
  74 + margin-left:20rpx;
  75 + }
  76 +/*优惠券列表 */
  77 +.couponpageitem{
  78 + width:686rpx;
  79 + height:276rpx;
  80 + background: linear-gradient(135deg,#d6b17d 1%, #cda263);
  81 +border-radius: 8rpx;
  82 +margin:24rpx auto 0;
  83 +}
  84 +.couponpageitem{
  85 + display:flex;
  86 + align-items: center;
  87 + padding: 52rpx 24rpx;
  88 + box-sizing: border-box;
  89 +}
  90 +.finishling{
  91 + width:208rpx;
  92 + height:46rpx;
  93 + font-size: 0;
  94 + position: relative;
  95 +}
  96 +.finishling image{
  97 + width:100%;
  98 + height: 100%;
  99 +}
  100 +.coupontop{
  101 + display:flex;
  102 +}
  103 +.couponright{
  104 + display:flex;
  105 + padding-left: 16rpx;
  106 + box-sizing: border-box;
  107 +}
  108 +.bigmoney{
  109 + color:#fff;
  110 + font-size: 70rpx;
  111 +}
  112 +.smalltext{
  113 + color:#fff;
  114 + font-size: 24rpx;
  115 + margin-bottom: 20rpx;
  116 +}
  117 +.coupontitle{
  118 + color:#fff;
  119 + font-size: 32rpx;
  120 +}
  121 +.afterling{
  122 + color:#CEA365;
  123 + font-size: 22rpx;
  124 + position: absolute;
  125 + top:8rpx;
  126 + right:10rpx;
  127 +}
  128 +.fullmoney{
  129 + color:#fff;
  130 + font-size: 28rpx;
  131 + margin-top:20rpx
  132 +}
  133 +.useright{
  134 + width: 160rpx;
  135 +height: 64rpx;
  136 +background: #ffffff;
  137 +border-radius: 200rpx;
  138 +box-shadow: 0px 16rpx 16rpx 0px rgba(82,48,0,0.17);
  139 +color:#CEA467;
  140 +font-size: 28rpx;
  141 +text-align: center;
  142 +line-height: 64rpx;
  143 +margin-top:46rpx
  144 +}
  145 +.rightright{
  146 + margin-left:32rpx;
  147 +}
  148 +.couponleft{
  149 + display:flex;
  150 + align-items: baseline;
  151 + width:99rpx;
  152 + position: relative;
  153 + padding-right: 10rpx;
  154 + /* box-sizing:border-box; */
  155 + flex:0 0 auto;
  156 + /* border-right:1rpx solid #fff; */
  157 +}
  158 +.couponleftk{
  159 + display:flex;
  160 + align-items: baseline;
  161 + width:240rpx;
  162 + position: relative;
  163 + padding-right: 10rpx;
  164 + /* box-sizing:border-box; */
  165 + flex:0 0 auto;
  166 + /* border-right:1rpx solid #fff; */
  167 +}
  168 +.couponleft::after{
  169 + display:block;
  170 + content:'';
  171 + width:1rpx;
  172 + height:104rpx;
  173 + background: #ffff;
  174 + position: absolute;
  175 + top:0;
  176 + right:1rpx;
  177 +
  178 +}
  179 +.couponleftk::after{
  180 + display:block;
  181 + content:'';
  182 + width:1rpx;
  183 + height:104rpx;
  184 + background: #ffff;
  185 + position: absolute;
  186 + top:0;
  187 + right:1rpx;
  188 +}
  189 +.nodata{
  190 + color:#999;
  191 + font-size:32rpx;
  192 + text-align: center;
  193 + margin-top:100rpx
  194 +}
  195 +.flextwo{
  196 + display:flex;
  197 + align-items: center;
  198 + justify-content: space-between;
  199 +}
  200 +.flexthree{
  201 + display:flex;
  202 + align-items: center;
  203 + justify-content: flex-end;
  204 +}
  1 +let type=wx.getStorageSync('selecttype');
  2 +console.log(type,'类型')
  3 +
  4 +Component({
  5 +   data: {
  6 +     selected: 0,
  7 + text:'',
  8 +     color: "#7A7E83",
  9 +     selectedColor: "#05091A",
  10 +     list:[  {
  11 +         pagePath: "/packageA/pages/index/index",
  12 +         text: "商品",
  13 +         iconPath: "/images/tabbar/icon_75.png",
  14 +         selectedIconPath: "/images/tabbar/icon_68.png"
  15 +       },
  16 +       {
  17 +         pagePath"/packageA/pages/message/message",
  18 +         text"消息",
  19 +         iconPath"/images/tabbar/message.png",
  20 +         selectedIconPath"/images/tabbar/messageactive.png"
  21 +       },
  22 +       {
  23 +         pagePath"/packageA/pages/shop_cart/shop_cart",
  24 +         text"购物车",
  25 +         iconPath"/images/tabbar/icon_70.png",
  26 +         selectedIconPath"/images/tabbar/icon_73.png"
  27 +       },
  28 +       {
  29 +         pagePath"/packageA/pages/my/my",
  30 +         text"我的",
  31 +         iconPath"/images/tabbar/icon_71.png",
  32 +         selectedIconPath"/images/tabbar/icon_72.png"
  33 +       }]
  34 +     
  35 +   },
  36 +   properties{
  37 +     selected{
  38 +       typeNumber, // 接收父组件传过来的值
  39 +       value''
  40 +     },
  41 + text{
  42 +       typeNumber, // 接收父组件传过来的值
  43 +       value''
  44 +     },
  45 + list{
  46 +       type:Array, // 接收父组件传过来的值
  47 +       value''
  48 +     },
  49 +   },
  50 +   attached() {
  51 +   },
  52 + onLoad(){
  53 +
  54 + },
  55 + onShow: function(){
  56 + console.log(this.data.text,'我是text')
  57 + if(this.data.text==1){
  58 + this.setData({
  59 + list:[
  60 +       {
  61 +         pagePath: "/pages/index/index",
  62 +         text: "商品",
  63 +         iconPath: "/images/tabbar/icon_75.png",
  64 +         selectedIconPath: "/images/tabbar/icon_68.png"
  65 +       },
  66 +       {
  67 +         pagePath"/pages/message/message",
  68 +         text"消息",
  69 +         iconPath"/images/tabbar/message.png",
  70 +         selectedIconPath"/images/tabbar/messageactive.png"
  71 +       },
  72 +       {
  73 +         pagePath"/pages/shop_cart/shop_cart",
  74 +         text"购物车",
  75 +         iconPath"/images/tabbar/icon_70.png",
  76 +         selectedIconPath"/images/tabbar/icon_73.png"
  77 +       },
  78 +       {
  79 +         pagePath"/pages/my/my",
  80 +         text"我的",
  81 +         iconPath"/images/tabbar/icon_71.png",
  82 +         selectedIconPath"/images/tabbar/icon_72.png"
  83 +       }
  84 +     ]
  85 + })
  86 + }else{
  87 + this.setData({
  88 + list:[
  89 +       {
  90 +         pagePath: "/packageA/pages/index/index",
  91 +         text: "商品",
  92 +         iconPath: "/images/tabbar/icon_75.png",
  93 +         selectedIconPath: "/images/tabbar/icon_68.png"
  94 +       },
  95 +       {
  96 +         pagePath: "/packageA/pages/message/message",
  97 +         text: "消息",
  98 +         iconPath: "/images/tabbar/message.png",
  99 +         selectedIconPath: "/images/tabbar/messageactive.png"
  100 +       },
  101 +       {
  102 +         pagePath"/packageA/pages/shop_cart/shop_cart",
  103 +         text"购物车",
  104 +         iconPath"/images/tabbar/icon_70.png",
  105 +         selectedIconPath"/images/tabbar/icon_73.png"
  106 +       },
  107 +       {
  108 +         pagePath"/packageA/pages/my/my",
  109 +         text"我的",
  110 +         iconPath"/images/tabbar/icon_71.png",
  111 +         selectedIconPath"/images/tabbar/icon_72.png"
  112 +       }
  113 +     ]
  114 + })
  115 + }
  116 + },
  117 +
  118 +   methods{
  119 +     switchTab(e) {
  120 +       const data = e.currentTarget.dataset
  121 +       const url = data.path;
  122 + console.log('343434734783489743',this.data.text)
  123 + if(this.data.text==1){
  124 + console.log(38434477)
  125 +  wx.switchTab({url})
  126 + }else{
  127 + console.log(url)
  128 +  wx.redirectTo({url})
  129 + }
  130 +      
  131 +     }
  132 +   },
  133 +
  134 + })
  1 +{
  2 + "component": true
  3 +}
  1 +<view class="tab-bar">
  2 + <view class="tab-bar-border"></view>
  3 + <view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
  4 + <image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
  5 + <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
  6 +
  7 + </view>
  8 +</view>
  1 +.tab-bar {
  2 + position: fixed;
  3 + bottom: 0;
  4 + left: 0;
  5 + right: 0;
  6 + height: 48px;
  7 + background: white;
  8 + display: flex;
  9 + padding-bottom: env(safe-area-inset-bottom);
  10 +}
  11 +
  12 +.tab-bar-border {
  13 + background-color: rgba(0, 0, 0, 0.33);
  14 + position: absolute;
  15 + left: 0;
  16 + top: 0;
  17 + width: 100%;
  18 + height: 1px;
  19 + transform: scaleY(0.5);
  20 +}
  21 +
  22 +.tab-bar-item {
  23 + flex: 1;
  24 + text-align: center;
  25 + display: flex;
  26 + justify-content: center;
  27 + align-items: center;
  28 + flex-direction: column;
  29 + position: relative;
  30 +}
  31 +
  32 +.tab-bar-item image {
  33 + width: 27px;
  34 + height: 27px;
  35 +}
  36 +
  37 +.tab-bar-item view {
  38 + font-size: 10px;
  39 +}
  40 +.connect{
  41 + width:240rpx!important;
  42 + height:100rpx;
  43 + position: absolute;
  44 + top:0;
  45 + left:0;
  46 + background: transparent;
  47 + padding: none!important;
  48 +
  49 +}
packageA @ 6c945b2a
  1 +Subproject commit 6c945b2a1d4ad579bd4db8e826b02097a3a32ef0
1 const app = getApp() 1 const app = getApp()
2 Page({ 2 Page({
3 -  
4 /** 3 /**
5 * 页面的初始数据 4 * 页面的初始数据
6 */ 5 */
7 data: { 6 data: {
8 check_num: 0, //选中数量 7 check_num: 0, //选中数量
9 checkAll: false, //全选状态 8 checkAll: false, //全选状态
10 - check_str: '' 9 + check_str: '',
  10 + list:[],
  11 + page:1
11 }, 12 },
12 //改变商品状态 13 //改变商品状态
13 check_type(e) { 14 check_type(e) {
@@ -48,9 +49,9 @@ Page({ @@ -48,9 +49,9 @@ Page({
48 for (let obj of list) { 49 for (let obj of list) {
49 if (obj.check_type) { 50 if (obj.check_type) {
50 if (check_str == ""){ 51 if (check_str == ""){
51 - check_str = obj.id 52 + check_str = obj.goods_id
52 } else { 53 } else {
53 - check_str = check_str + ',' + obj.id 54 + check_str = check_str + ',' + obj.goods_id
54 } 55 }
55 } 56 }
56 } 57 }
@@ -59,6 +60,7 @@ Page({ @@ -59,6 +60,7 @@ Page({
59 }) 60 })
60 }, 61 },
61 delete_item(){ 62 delete_item(){
  63 + let that=this;
62 if (this.data.check_str == ""){ 64 if (this.data.check_str == ""){
63 wx.showToast({ 65 wx.showToast({
64 title: '请先选中商品', 66 title: '请先选中商品',
@@ -67,29 +69,41 @@ Page({ @@ -67,29 +69,41 @@ Page({
67 }) 69 })
68 return 70 return
69 } 71 }
70 - let url = app.interface.collectdel 72 + let url = '/goods/collect'
71 let params = { 73 let params = {
72 - ids: this.data.check_str 74 + goods_ids: this.data.check_str
73 } 75 }
74 - app.post(url,params).then((res)=>{ 76 + app.postk(url,params).then((res)=>{
75 wx.showToast({ 77 wx.showToast({
76 - title: '删除成功', 78 + title: '取消收藏成功',
77 duration: 1000 79 duration: 1000
78 }) 80 })
79 - this.get_info() 81 + setTimeout(function(){
  82 + that.setData({
  83 + page:1,
  84 + list:[]
  85 + })
  86 + that.get_info()
  87 + },1500)
  88 +
80 }) 89 })
81 }, 90 },
82 //获取页面信息 91 //获取页面信息
83 get_info() { 92 get_info() {
  93 + let that=this;
84 wx.showLoading({ 94 wx.showLoading({
85 title: '加载中' 95 title: '加载中'
86 }) 96 })
87 - let that = this  
88 - let url = app.interface.collectList  
89 - app.post(url, {}).then((res) => { 97 +
  98 + let url = '/goods/get_collect_list'
  99 + let param={
  100 + page:that.data.page,
  101 + pageNum:10
  102 + }
  103 + app.postk(url,param).then((res) => {
90 wx.hideLoading() 104 wx.hideLoading()
91 that.setData({ 105 that.setData({
92 - list: res.msg 106 + list: that.data.list.concat(res.data)
93 }) 107 })
94 }) 108 })
95 }, 109 },
@@ -141,7 +155,12 @@ Page({ @@ -141,7 +155,12 @@ Page({
141 * 页面上拉触底事件的处理函数 155 * 页面上拉触底事件的处理函数
142 */ 156 */
143 onReachBottom: function() { 157 onReachBottom: function() {
144 - 158 + let newpage=this.data.page;
  159 + newpage++;
  160 + this.setData({
  161 + page:newpage
  162 + })
  163 + this.get_info()
145 }, 164 },
146 165
147 /** 166 /**
@@ -8,5 +8,5 @@ @@ -8,5 +8,5 @@
8 <image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" /> 8 <image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" />
9 <text>全选</text> 9 <text>全选</text>
10 </view> 10 </view>
11 - <view class="del" catchtap="delete_item">删除</view> 11 + <view class="del" catchtap="delete_item">取消收藏</view>
12 </view> 12 </view>
@@ -7,9 +7,12 @@ Page({ @@ -7,9 +7,12 @@ Page({
7 data: { 7 data: {
8 name: '', 8 name: '',
9 tel: '', 9 tel: '',
10 - area: '', 10 + area: '请选择所在地区',
11 address: '', 11 address: '',
12 - mr: 0 12 + mr: 2,
  13 + province_id:'',
  14 + city_id:'',
  15 + county_id:''
13 }, 16 },
14 17
15 /** 18 /**
@@ -41,8 +44,12 @@ Page({ @@ -41,8 +44,12 @@ Page({
41 }, 44 },
42 45
43 bindRegionChange(e) { 46 bindRegionChange(e) {
  47 + console.log(e)
44 this.setData({ 48 this.setData({
45 - area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2] 49 + area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2],
  50 + province_id:e.detail.value[0] ,
  51 + city_id:e.detail.value[1] ,
  52 + county_id:e.detail.value[2] ,
46 }) 53 })
47 }, 54 },
48 55
@@ -54,7 +61,7 @@ Page({ @@ -54,7 +61,7 @@ Page({
54 }) 61 })
55 } else { 62 } else {
56 this.setData({ 63 this.setData({
57 - mr: 0 64 + mr: 2
58 }) 65 })
59 } 66 }
60 }, 67 },
@@ -62,14 +69,53 @@ Page({ @@ -62,14 +69,53 @@ Page({
62 // 保存地址 69 // 保存地址
63 addFun() { 70 addFun() {
64 let t = this; 71 let t = this;
65 - let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/;  
66 - let u = a.interface.addaddress; 72 + let AuglyTest_phone = /^1[3456789]\d{9}$/;
  73 + let u = '/address/add';
  74 + if(t.data.name==''){
  75 + wx.showToast({
  76 + title: '请输入收货人',
  77 + icon:'none'
  78 + })
  79 + return false
  80 + }
  81 + if(t.data.tel==''){
  82 + wx.showToast({
  83 + title: '请输入手机号',
  84 + icon:'none'
  85 + })
  86 + return false
  87 + }
  88 + if(t.data.tel!=''){
  89 + if (!(/^1[3456789]\d{9}$/.test(t.data.tel))) {
  90 + wx.showToast({
  91 + title: '请输入正确手机号',
  92 + icon: 'none'
  93 + })
  94 + return false;
  95 + }
  96 + }
  97 + if(t.data.province_id==''){
  98 + wx.showToast({
  99 + title: '请选择所在地区',
  100 + icon:'none'
  101 + })
  102 + return false
  103 + }
  104 + if(t.data.address==''){
  105 + wx.showToast({
  106 + title: '请输入详情地址',
  107 + icon:'none'
  108 + })
  109 + return false
  110 + }
67 let d = { 111 let d = {
68 - tel: t.data.tel, 112 + mobile: t.data.tel,
69 name: t.data.name, 113 name: t.data.name,
70 - area: t.data.area, 114 + province_id:t.data.province_id,
  115 + city_id:t.data.city_id,
  116 + county_id:t.data.county_id,
71 address: t.data.address, 117 address: t.data.address,
72 - mo: t.data.mr 118 + is_default: t.data.mr
73 } 119 }
74 if (d.name == '') { 120 if (d.name == '') {
75 wx.showToast({ 121 wx.showToast({
@@ -83,7 +129,7 @@ Page({ @@ -83,7 +129,7 @@ Page({
83 icon: 'none', 129 icon: 'none',
84 duration: 1300 130 duration: 1300
85 }) 131 })
86 - } else if (!AuglyTest_phone.test(d.tel)) { 132 + } else if (!AuglyTest_phone.test(d.mobile)) {
87 wx.showToast({ 133 wx.showToast({
88 title: '请输入正确的手机号', 134 title: '请输入正确的手机号',
89 icon: 'none', 135 icon: 'none',
@@ -103,8 +149,8 @@ Page({ @@ -103,8 +149,8 @@ Page({
103 }) 149 })
104 150
105 } else { 151 } else {
106 - a.post(u, d).then((r) => {  
107 - if (r.code == 200) { 152 + a.postk(u, d).then((r) => {
  153 + if (r.code == 1) {
108 wx.showToast({ 154 wx.showToast({
109 title: '保存成功', 155 title: '保存成功',
110 icon: 'none', 156 icon: 'none',
@@ -129,7 +175,7 @@ Page({ @@ -129,7 +175,7 @@ Page({
129 * 生命周期函数--监听页面显示 175 * 生命周期函数--监听页面显示
130 */ 176 */
131 onShow: function() { 177 onShow: function() {
132 - 178 +
133 }, 179 },
134 180
135 /** 181 /**
@@ -16,17 +16,25 @@ Page({ @@ -16,17 +16,25 @@ Page({
16 // 获取地址列表 16 // 获取地址列表
17 getListFun() { 17 getListFun() {
18 let t = this; 18 let t = this;
19 - let u = a.interface.address  
20 - a.post(u, {}).then((r) => {  
21 - if (r.code == 200) {  
22 - t.setData({  
23 - list: r.msg,  
24 - check: true  
25 - })  
26 - if (r.msg.length == 0){  
27 - wx.setStorageSync('no_address', true)  
28 - }  
29 - } 19 + let u = '/address/get_list'
  20 + let param={
  21 + page:1,
  22 + pageNum:10
  23 + }
  24 + a.postk(u,param).then((r) => {
  25 + t.setData({
  26 + list: r.data,
  27 + check: true
  28 + })
  29 + // if (r.code == 200) {
  30 + // t.setData({
  31 + // list: r.msg,
  32 + // check: true
  33 + // })
  34 + // if (r.msg.length == 0){
  35 + // wx.setStorageSync('no_address', true)
  36 + // }
  37 + // }
30 }).catch((er) => { 38 }).catch((er) => {
31 }) 39 })
32 }, 40 },
@@ -51,58 +59,98 @@ Page({ @@ -51,58 +59,98 @@ Page({
51 59
52 // 设置默认地址 60 // 设置默认地址
53 mrAddressFun(e) { 61 mrAddressFun(e) {
54 - let t = this 62 + let that = this
55 let index = e.currentTarget.dataset.index 63 let index = e.currentTarget.dataset.index
56 - let u = a.interface.mraddress; 64 + let u = '/address/setting_default';
57 let d = { 65 let d = {
58 id: e.currentTarget.dataset.id, 66 id: e.currentTarget.dataset.id,
59 - mo: 1 67 +
60 } 68 }
61 - a.post(u, d).then((r) => {  
62 - if (r.code == 200) {  
63 - t.setData({  
64 - [`list[${index}].check`]: true 69 + a.postk(u, d).then((r) => {
  70 + console.log('34u349',r)
  71 + let newlist=that.data.list;
  72 + if(newlist[index].is_default==2){
  73 + newlist[index].is_default=1
  74 + wx.showToast({
  75 + title: '设置默认地址成功',
  76 + icon: 'none',
  77 + duration: 1300
65 }) 78 })
  79 + }else{
  80 + newlist[index].is_default=2;
66 wx.showToast({ 81 wx.showToast({
67 - title: '设置成功', 82 + title: '取消默认地址成功',
68 icon: 'none', 83 icon: 'none',
69 duration: 1300 84 duration: 1300
70 }) 85 })
71 - setTimeout(() => {  
72 - t.getListFun()  
73 - }, 1300)  
74 } 86 }
  87 + that.setData({
  88 + page:1,
  89 + lsit:[]
  90 + })
  91 + that.getListFun()
  92 + // that.setData({
  93 + // list:newlist
  94 + // })
  95 +
  96 + // if (r.code == 1) {
  97 + // t.setData({
  98 + // [`list[${index}].check`]: true
  99 + // })
  100 +
  101 + // setTimeout(() => {
  102 + // t.getListFun()
  103 + // }, 1300)
  104 + // }
75 }).catch((er) => { 105 }).catch((er) => {
76 }) 106 })
77 }, 107 },
78 108
79 // 修改地址 109 // 修改地址
80 editAddressFun(e) { 110 editAddressFun(e) {
  111 + let item=e.currentTarget.dataset.item;
  112 + item=JSON.stringify(item)
81 wx.navigateTo({ 113 wx.navigateTo({
82 - url: '/pages/address/edit_address/edit_address?id=' + e.currentTarget.dataset.id, 114 + url: '/pages/address/edit_address/edit_address?id=' + e.currentTarget.dataset.id+'&item='+item,
83 }) 115 })
84 }, 116 },
85 117
86 // 删除地址 118 // 删除地址
87 delAddressFun(e) { 119 delAddressFun(e) {
  120 +
88 let t = this; 121 let t = this;
89 - let u = a.interface.deladdress;  
90 - let d = {  
91 - id: e.currentTarget.dataset.id  
92 - }  
93 - a.post(u, d).then((r) => {  
94 - if (r.code == 200) {  
95 - wx.showToast({  
96 - title: '删除成功',  
97 - icon: 'none',  
98 - duration: 1300 122 + wx.showModal({
  123 + title: '提示',
  124 + content: '是否删除该地址',
  125 + success (res) {
  126 + if (res.confirm) {
  127 + let u = '/address/del';
  128 + let d = {
  129 + id: e.currentTarget.dataset.id
  130 + }
  131 + a.postk(u, d).then((r) => {
  132 + if (r.code ==1) {
  133 + wx.showToast({
  134 + title: '删除成功',
  135 + icon: 'none',
  136 + duration: 1300
  137 + })
  138 + setTimeout(() => {
  139 + t.setData({
  140 + page:1,
  141 + list:[]
  142 + })
  143 + t.getListFun()
  144 + }, 1300)
  145 + }
  146 + }).catch((er) => {
  147 + })
  148 + } else if (res.cancel) {
  149 + console.log('用户点击取消')
  150 + }
  151 + }
99 }) 152 })
100 - setTimeout(() => {  
101 - t.getListFun()  
102 - }, 1300)  
103 - }  
104 - }).catch((er) => {  
105 - }) 153 +
106 }, 154 },
107 155
108 // 新增地址 156 // 新增地址
@@ -123,6 +171,7 @@ Page({ @@ -123,6 +171,7 @@ Page({
123 * 生命周期函数--监听页面显示 171 * 生命周期函数--监听页面显示
124 */ 172 */
125 onShow: function() { 173 onShow: function() {
  174 +
126 this.getListFun() 175 this.getListFun()
127 }, 176 },
128 177
@@ -10,11 +10,11 @@ @@ -10,11 +10,11 @@
10 </view> 10 </view>
11 <view class="btn_box"> 11 <view class="btn_box">
12 <view class="check" data-id="{{item.id}}" data-index="{{index}}" wx:if="{{item.mo != 1}}" catchtap="mrAddressFun"> 12 <view class="check" data-id="{{item.id}}" data-index="{{index}}" wx:if="{{item.mo != 1}}" catchtap="mrAddressFun">
13 - <image wx:if="{{!item.check}}" src="/images/check.png" /> 13 + <image wx:if="{{item.is_default==2}}" src="/images/check.png" />
14 <image wx:else src="/images/check@.png" /> 设为默认地址 14 <image wx:else src="/images/check@.png" /> 设为默认地址
15 </view> 15 </view>
16 <block> 16 <block>
17 - <view class="btn_item" data-id="{{item.id}}" catchtap="editAddressFun"> 17 + <view class="btn_item" data-id="{{item.id}}" catchtap="editAddressFun" data-item="{{item}}">
18 <image src="/images/icon_60.png" style="width: 26rpx;height: 26rpx;" />编辑 18 <image src="/images/icon_60.png" style="width: 26rpx;height: 26rpx;" />编辑
19 </view> 19 </view>
20 <view class="btn_item" data-id="{{item.id}}" catchtap="delAddressFun"> 20 <view class="btn_item" data-id="{{item.id}}" catchtap="delAddressFun">
@@ -10,16 +10,35 @@ Page({ @@ -10,16 +10,35 @@ Page({
10 tel: '', 10 tel: '',
11 area: '', 11 area: '',
12 address: '', 12 address: '',
13 - mr: 0, 13 + mr: 2,
14 id: 0, 14 id: 0,
15 - mo: false 15 + mo: false,
  16 + addressid:'',
  17 + addressitem:''
  18 +
16 }, 19 },
17 20
18 /** 21 /**
19 * 生命周期函数--监听页面加载 22 * 生命周期函数--监听页面加载
20 */ 23 */
21 onLoad: function(options) { 24 onLoad: function(options) {
22 - this.getInfoFun(options.id) 25 + let item=JSON.parse(options.item)
  26 + this.setData({
  27 +
  28 + id: options.id,
  29 + tel: item.mobile,
  30 + name: item.name,
  31 + province_id:item.province_name,
  32 + city_id:item.city_name,
  33 + county_id:item.county_name,
  34 + address: item.address,
  35 + mr: item.is_default,
  36 + mo:item.is_default==1?true:false,
  37 + area:item.province_name+item.city_name+item.county_name
  38 + })
  39 +
  40 + console.log(item)
  41 + // this.getInfoFun(options.id)
23 }, 42 },
24 43
25 // 获取地址详情 44 // 获取地址详情
@@ -79,7 +98,10 @@ Page({ @@ -79,7 +98,10 @@ Page({
79 // area: e.detail.value[0] + e.detail.value[1] + e.detail.value[2] 98 // area: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
80 // }) 99 // })
81 this.setData({ 100 this.setData({
82 - area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2] 101 + area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2],
  102 + province_id:e.detail.value[0],
  103 + city_id:e.detail.value[1],
  104 + county_id:e.detail.value[2]
83 }) 105 })
84 }, 106 },
85 107
@@ -91,7 +113,7 @@ Page({ @@ -91,7 +113,7 @@ Page({
91 }) 113 })
92 } else { 114 } else {
93 this.setData({ 115 this.setData({
94 - mr: 0 116 + mr: 2
95 }) 117 })
96 } 118 }
97 }, 119 },
@@ -102,11 +124,13 @@ Page({ @@ -102,11 +124,13 @@ Page({
102 let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/; 124 let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/;
103 let u = a.interface.editaddress; 125 let u = a.interface.editaddress;
104 let d = { 126 let d = {
105 - tel: t.data.tel, 127 + mobile: t.data.tel,
106 name: t.data.name, 128 name: t.data.name,
107 - area: t.data.area,  
108 - address: t.data.address,  
109 - mo: t.data.mr, 129 + province_id: t.data.province_id,
  130 + city_id: t.data.city_id,
  131 + county_id:t.data.county_id,
  132 + is_default: t.data.mr,
  133 + address:t.data.address,
110 id: t.data.id 134 id: t.data.id
111 } 135 }
112 if (d.name == '') { 136 if (d.name == '') {
@@ -115,13 +139,13 @@ Page({ @@ -115,13 +139,13 @@ Page({
115 icon: 'none', 139 icon: 'none',
116 duration: 1300 140 duration: 1300
117 }) 141 })
118 - } else if (d.tel == '') { 142 + } else if (d.mobile == '') {
119 wx.showToast({ 143 wx.showToast({
120 title: '请输入手机号', 144 title: '请输入手机号',
121 icon: 'none', 145 icon: 'none',
122 duration: 1300 146 duration: 1300
123 }) 147 })
124 - } else if (!AuglyTest_phone.test(d.tel)) { 148 + } else if (!AuglyTest_phone.test(d.mobile)) {
125 wx.showToast({ 149 wx.showToast({
126 title: '请输入正确的手机号', 150 title: '请输入正确的手机号',
127 icon: 'none', 151 icon: 'none',
@@ -140,8 +164,8 @@ Page({ @@ -140,8 +164,8 @@ Page({
140 duration: 1300 164 duration: 1300
141 }) 165 })
142 } else { 166 } else {
143 - a.post(u, d).then((r) => {  
144 - if (r.code == 200) { 167 + a.postk(u, d).then((r) => {
  168 + if (r.code == 1) {
145 wx.showToast({ 169 wx.showToast({
146 title: '保存成功', 170 title: '保存成功',
147 icon: 'none', 171 icon: 'none',
@@ -103,7 +103,7 @@ page { @@ -103,7 +103,7 @@ page {
103 margin-top:2rpx; 103 margin-top:2rpx;
104 } 104 }
105 .shezhimo{ 105 .shezhimo{
106 - width:175rpx; 106 + width:191rpx;
107 } 107 }
108 108
109 109
@@ -9,14 +9,102 @@ Page({ @@ -9,14 +9,102 @@ Page({
9 taocan:false, 9 taocan:false,
10 page:1, 10 page:1,
11 taocanlist:[], 11 taocanlist:[],
12 - remain:true 12 + remain:true,
  13 + page:1,
  14 + good_arr:[],
  15 + taocanpage:1,
  16 + kindshow:true,
  17 + // 品牌
  18 + letter: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","*"],
  19 + cityListId: '',
  20 + //下面是城市列表信息,这里只是模拟数据
  21 + citylist: [{ "letter": "A", "data": [{ "id": "v7", "cityName": "安徽" }] }, { "letter": "B", "data": [{ "id": "v10", "cityName": "巴中" }, { "id": "v4", "cityName": "包头" }, { "id": "v1", "cityName": "北京" }] }, { "letter": "C", "data": [{ "id": "v15", "cityName": "成都" }] }, { "letter": "D", "data": [{ "id": "v21", "cityName": "稻城" }] }, { "letter": "G", "data": [{ "id": "v17", "cityName": "广州" }, { "id": "v29", "cityName": "桂林" }] }, { "letter": "H", "data": [{ "id": "v9", "cityName": "海南" }, { "id": "v3", "cityName": "呼和浩特" }] }, { "letter": "L", "data": [{ "id": "v24", "cityName": "洛阳" }, { "id": "v20", "cityName": "拉萨" }, { "id": "v14", "cityName": "丽江" }] }, { "letter": "M", "data": [{ "id": "v13", "cityName": "眉山" }] }, { "letter": "N", "data": [{ "id": "v27", "cityName": "南京" }] }, { "letter": "S", "data": [{ "id": "v18", "cityName": "三亚" }, { "id": "v2", "cityName": "上海" }] }, { "letter": "T", "data": [{ "id": "v5", "cityName": "天津" }] }, { "letter": "W", "data": [{ "id": "v12", "cityName": "乌鲁木齐" }, { "id": "v25", "cityName": "武汉" }] }, { "letter": "X", "data": [{ "id": "v23", "cityName": "西安" }, { "id": "v28", "cityName": "香港" }, { "id": "v19", "cityName": "厦门" }] }, { "letter": "Z", "data": [{ "id": "v8", "cityName": "张家口" }] }],
  22 + //下面是热门城市数据,模拟数据
  23 + newcity: ['北京', '上海', '广州', '深圳', '成都', '杭州'],
  24 + // citySel: '全国',
  25 + locateCity: '',
  26 + len:''
  27 + },
  28 + // 种类和品牌切换
  29 + selkind(){
  30 + this.setData({
  31 + kindshow:true
  32 + })
  33 + },
  34 + selpinpai(){
  35 + this.setData({
  36 + kindshow:false
  37 + })
  38 + },
  39 +
  40 +
  41 + //点击进入商品列表
  42 + cityTap(e) {
  43 + console.log(e)
  44 + let id=e.currentTarget.dataset.id;
  45 + wx.navigateTo({
  46 + url: '/pages/pinpaibox/pinpaibox?pinpaiid='+id,
  47 + })
  48 +
  49 + },
  50 + //点击城市字母
  51 + letterTap(e) {
  52 + const Item = e.currentTarget.dataset.item;
  53 + console.log(Item)
  54 + if(Item=='*'){
  55 + this.setData({
  56 + scrollHeight: this.data.len
  57 + });
  58 + }
  59 + this.setData({
  60 + cityListId: Item
  61 + });
  62 + console.log("..............."+this.data.cityListId);
13 }, 63 },
  64 + //调用定位
  65 + getLocate() {
  66 + let that = this;
  67 + new qqmap().getLocateInfo().then(function (val) {//这个方法在另一个文件里,下面有贴出代码
  68 + console.log(val);
  69 + if (val.indexOf('市') !== -1) {//这里是去掉“市”这个字
  70 + console.log(val.indexOf('市') - 1);
  71 + val = val.slice(0, val.indexOf('市'));
  72 + console.log(val);
  73 + }
  74 + that.setData({
  75 + locateCity: val
  76 + });
  77 + //把获取的定位和获取的时间放到本地存储
  78 + wx.setStorageSync('locatecity', { city: val, time: new Date().getTime() });
  79 + });
  80 + },
  81 + // 获取品牌列表
  82 + getpinpailist(){
  83 + let that = this
  84 + let url = '/sundry/get_brand'
  85 + let params = {
  86 + type:2
  87 + }
  88 + app.postk(url,params).then((res) => {
  89 + console.log(res)
  90 + that.setData({
  91 + citylist:res.data,
  92 + })
  93 + let len = res.data.length;
  94 + len=len*542;
  95 + this.setData({
  96 + len:len
  97 + })
  98 + })
  99 + },
  100 +
  101 +
14 //查看更多 102 //查看更多
15 look_more(e){ 103 look_more(e){
16 let pid = e.currentTarget.dataset.id 104 let pid = e.currentTarget.dataset.id
17 let title = e.currentTarget.dataset.title 105 let title = e.currentTarget.dataset.title
18 wx.navigateTo({ 106 wx.navigateTo({
19 - url: '/pages/search/search_result/search_result?title=' + title + '&pid=' + pid 107 + url: '/pages/search/search_result/search_result?title=' + title + '&category_id2=' + pid
20 }) 108 })
21 }, 109 },
22 //查看商品详情 110 //查看商品详情
@@ -45,8 +133,12 @@ Page({ @@ -45,8 +133,12 @@ Page({
45 taocan:false, 133 taocan:false,
46 remain:true 134 remain:true
47 }) 135 })
  136 + this.setData({
  137 + page:1,
  138 + good_arr:[]
  139 +
  140 + })
48 this.good_list(e.currentTarget.dataset.id) 141 this.good_list(e.currentTarget.dataset.id)
49 -  
50 }, 142 },
51 143
52 144
@@ -57,11 +149,11 @@ Page({ @@ -57,11 +149,11 @@ Page({
57 title: '加载中' 149 title: '加载中'
58 }) 150 })
59 let that = this 151 let that = this
60 - let url = app.interface.index 152 + let url = '/sundry/get_category'
61 let params = { 153 let params = {
62 - pid: 0 154 +
63 } 155 }
64 - app.post(url, params).then((res) => { 156 + app.postk(url).then((res) => {
65 wx.hideLoading() 157 wx.hideLoading()
66 // let obj={ 158 // let obj={
67 // id:'', 159 // id:'',
@@ -69,9 +161,9 @@ Page({ @@ -69,9 +161,9 @@ Page({
69 // } 161 // }
70 // res.msg.push(obj) 162 // res.msg.push(obj)
71 that.setData({ 163 that.setData({
72 - nav_arr: res.msg 164 + nav_arr: res.data
73 }) 165 })
74 - that.good_list(res.msg[0].id) 166 + that.good_list(res.data[0].id)
75 }) 167 })
76 }, 168 },
77 //获取商品列表 169 //获取商品列表
@@ -80,14 +172,16 @@ Page({ @@ -80,14 +172,16 @@ Page({
80 title: '加载中', 172 title: '加载中',
81 }) 173 })
82 let that = this 174 let that = this
83 - let url = app.interface.getPid 175 + let url = '/sundry/get_category_goods'
84 let params = { 176 let params = {
85 - pid: pid 177 + category_id: pid,
  178 + page:that.data.page,
  179 + pageNum:6
86 } 180 }
87 - app.post(url, params).then((res) => { 181 + app.postk(url, params).then((res) => {
88 wx.hideLoading() 182 wx.hideLoading()
89 this.setData({ 183 this.setData({
90 - good_arr: res.msg 184 + good_arr:res.data
91 }) 185 })
92 }) 186 })
93 }, 187 },
@@ -108,16 +202,16 @@ Page({ @@ -108,16 +202,16 @@ Page({
108 title: '加载中', 202 title: '加载中',
109 }) 203 })
110 let that = this 204 let that = this
111 - let url = '/combo/get_all' 205 + let url = '/combo/get_list'
112 let params = { 206 let params = {
113 - page:that.data.page, 207 + page:that.data.taocanpage,
114 pageNum:10 208 pageNum:10
115 } 209 }
116 - app.post(url, params).then((res) => { 210 + app.postk(url, params).then((res) => {
117 console.log(res) 211 console.log(res)
118 wx.hideLoading() 212 wx.hideLoading()
119 this.setData({ 213 this.setData({
120 - taocanlist:that.data.taocanlist.concat(res.msg) 214 + taocanlist:that.data.taocanlist.concat(res.data)
121 }) 215 })
122 console.log(that.data.taocanlist) 216 console.log(that.data.taocanlist)
123 }) 217 })
@@ -149,8 +243,19 @@ Page({ @@ -149,8 +243,19 @@ Page({
149 * 生命周期函数--监听页面加载 243 * 生命周期函数--监听页面加载
150 */ 244 */
151 onLoad: function (options) { 245 onLoad: function (options) {
  246 + if(options.type==1){
  247 + this.setData({
  248 + kindshow:true
  249 + })
  250 + }else{
  251 + this.setData({
  252 + kindshow:false
  253 + })
  254 + }
152 this.get_info(); 255 this.get_info();
153 - this.gettaocan() 256 + this.gettaocan();
  257 + // 获取品牌
  258 + this.getpinpailist()
154 }, 259 },
155 260
156 /** 261 /**
@@ -164,7 +269,8 @@ Page({ @@ -164,7 +269,8 @@ Page({
164 * 生命周期函数--监听页面显示 269 * 生命周期函数--监听页面显示
165 */ 270 */
166 onShow: function () { 271 onShow: function () {
167 - this.get_shopnum() 272 + this.get_shopnum();
  273 +
168 }, 274 },
169 275
170 /** 276 /**
@@ -192,10 +298,10 @@ Page({ @@ -192,10 +298,10 @@ Page({
192 * 页面上拉触底事件的处理函数 298 * 页面上拉触底事件的处理函数
193 */ 299 */
194 onReachBottom: function () { 300 onReachBottom: function () {
195 - let newpage=this.data.page; 301 + let newpage=this.data.gettaocan;
196 newpage++; 302 newpage++;
197 this.setData({ 303 this.setData({
198 - page:newpage 304 + gettaocan:newpage
199 }) 305 })
200 306
201 this.gettaocan() 307 this.gettaocan()
1 -<view class='page'>  
2 - <view class='top'>  
3 - <navigator class='search_box' url="/pages/search/search">  
4 - <view class='search_icon'>  
5 - <image src='/images/search.png'></image>  
6 - </view>  
7 - <input class='real_search' placeholder='搜索您想要的商品' disabled="true" />  
8 - </navigator>  
9 - </view>  
10 - <view class='center'>  
11 - <!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->  
12 - <view class='center_child flexone'>  
13 - <view class='left'>  
14 - <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>  
15 1
16 - <view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view>  
17 -  
18 -  
19 - </view>  
20 - <!-- <view class='fake_left'></view> -->  
21 - <view class='right' wx:if="{{remain}}">  
22 - <view class='right_item' id='NAV{{index}}' wx:for='{{good_arr}}' wx:key='index' wx:if="{{good_arr[index].products.length>0}}">  
23 - <view class='right_item_top'>  
24 - <view class='right_left'>{{item.title}}</view>  
25 - <text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}" data-title="{{item.title}}">查看全部&ensp;&gt;</text>  
26 - </view>  
27 - <view class='right_goods'>  
28 - <view class='goods' wx:for="{{item.products}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-id="{{zitem.id}}" catchtap="look_detail">  
29 - <view class='goods_img'>  
30 - <image src='{{zitem.image}}'></image>  
31 - </view>  
32 - <view class='goods_name'>{{zitem.name}}</view>  
33 - </view>  
34 - </view>  
35 - </view>  
36 - </view> 2 +<view class="pinlist">
  3 + <view class="pinitem {{kindshow==true?'pinitemactive':''}}" bindtap="selkind">分类</view>
  4 + <view class="pinitem {{kindshow==false?'pinitemactive':''}}" bindtap="selpinpai">品牌</view>
  5 + </view>
  6 +<!-- 分类 -->
  7 +<view class='page' wx:if="{{kindshow}}">
  8 + <view class='top'>
  9 + <navigator class='search_box' url="/pages/search/search">
  10 + <view class='search_icon'>
  11 + <image src='/images/search.png'></image>
  12 + </view>
  13 + <input class='real_search' placeholder='搜索您想要的商品' disabled="true" />
  14 + </navigator>
  15 + </view>
  16 + <view class='center'>
  17 + <!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->
  18 + <view class='center_child flexone'>
  19 + <view class='left'>
  20 + <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>
  21 + <view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view>
  22 + </view>
  23 + <!-- <view class='fake_left'></view> -->
  24 + <view class='right' wx:if="{{remain}}">
  25 + <view class="nodata" wx:if="{{good_arr.length==0}}">暂无数据</view>
  26 + <view wx:else>
  27 + <view class='right_item' id='NAV{{index}}' wx:for='{{good_arr}}' wx:key='index'>
  28 + <!-- wx:if="{{good_arr[index].products.length>0}}" -->
  29 + <view class='right_item_top'>
  30 + <view class='right_left'>{{item.name}}</view>
  31 + <text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}" data-title="{{item.name}}">查看全部&ensp;&gt;</text>
  32 + </view>
  33 + <view class='right_goods'>
  34 + <view class='goods' wx:for="{{item.goods}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-id="{{zitem.id}}" catchtap="look_detail">
  35 + <view class='goods_img'>
  36 + <image src='{{zitem.image}}'></image>
  37 + </view>
  38 + <view class='goods_name'>{{zitem.name}}</view>
  39 + </view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 +
  44 + </view>
  45 + <view class="right" wx:else>
  46 + <view clas="nodata" wx:if="{{taocanlist.length==0}}">暂无数据</view>
  47 + <view class="right_item" wx:else>
  48 + <view class='right_goods'>
  49 + <view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}" catchtap="look_detailk">
  50 + <view class='goods_img'>
  51 + <image src='{{item.image}}'></image>
  52 + </view>
  53 + <view class='goods_name'>{{item.name}}</view>
  54 + </view>
  55 + </view>
  56 + </view>
  57 + </view>
  58 + </view>
  59 + <!-- </scroll-view> -->
  60 + </view>
  61 +</view>
  62 +
  63 +<!-- 品牌 -->
  64 +<view class='city_box' wx:else>
  65 + <view class='city_left'>
  66 + <scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}' scroll-top="{{scrollHeight}}">
37 67
38 - <view class="right" wx:else>  
39 - <view class="right_item">  
40 - <view class='right_goods'>  
41 - <view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}" catchtap="look_detailk">  
42 - <view class='goods_img'>  
43 - <image src='{{item.image}}'></image>  
44 - </view>  
45 - <view class='goods_name'>{{item.name}}</view>  
46 - </view>  
47 - </view>  
48 -  
49 - </view>  
50 - </view>  
51 - 68 + <view class='city_list_box'>
  69 + <block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
  70 + <view class='city_first_letter' id='{{letterItem.letter}}'>{{letterItem.letter}}</view>
  71 + <view class="citybox">
  72 + <view class='city_name' wx:for='{{letterItem.data}}' wx:key='this' data-types='list' catchtap='cityTap' data-index='{{index}}' data-val='{{item}}' data-id="{{item.id}}">
  73 + <view class='goods_img'>
  74 + <image src='{{item.image}}'></image>
  75 + </view>
  76 + <view class='goods_name'>{{item.name}}</view>
52 77
  78 + </view>
  79 + </view>
  80 +
53 81
54 - </view>  
55 - <!-- </scroll-view> -->  
56 - </view> 82 + </block>
  83 + </view>
  84 + </scroll-view>
  85 + </view>
  86 + <view class='city_right'>
  87 + <scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation >
  88 + <text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
  89 + </scroll-view>
  90 + </view>
57 </view> 91 </view>
@@ -51,7 +51,6 @@ page { @@ -51,7 +51,6 @@ page {
51 width: 100%; 51 width: 100%;
52 height: 100%; 52 height: 100%;
53 } 53 }
54 -  
55 .real_search { 54 .real_search {
56 display: inline-block; 55 display: inline-block;
57 height: 100%; 56 height: 100%;
@@ -112,7 +111,7 @@ page { @@ -112,7 +111,7 @@ page {
112 111
113 .left_item { 112 .left_item {
114 width: 100%; 113 width: 100%;
115 - height: 101rpx; 114 + /* height: 101rpx; */
116 text-align: center; 115 text-align: center;
117 line-height:100rpx; 116 line-height:100rpx;
118 font-size: 30rpx; 117 font-size: 30rpx;
@@ -125,7 +124,7 @@ page { @@ -125,7 +124,7 @@ page {
125 .left_item.active { 124 .left_item.active {
126 background: #f9f9f9; 125 background: #f9f9f9;
127 border: 0; 126 border: 0;
128 - height: 100rpx; 127 + /* height: 100rpx; */
129 color: rgba(61, 154, 248, 1); 128 color: rgba(61, 154, 248, 1);
130 position: relative; 129 position: relative;
131 } 130 }
@@ -223,4 +222,119 @@ page { @@ -223,4 +222,119 @@ page {
223 flex-direction: column; 222 flex-direction: column;
224 justify-content: center; 223 justify-content: center;
225 align-items: center 224 align-items: center
226 -}  
  225 +}
  226 +.pinlist{
  227 + display:flex;
  228 + justify-content: center;
  229 + align-items: center;
  230 + width:100%;
  231 + padding: 20rpx;
  232 + box-sizing: border-box;
  233 +}
  234 +.pinitem:nth-child(2){
  235 + margin-left:140rpx
  236 +}
  237 +.pinitem{
  238 + color:#333;
  239 + font-size: 28rpx;
  240 +}
  241 +.pinitemactive{
  242 + position: relative;
  243 + color: rgba(61, 154, 248, 1);
  244 +}
  245 +.pinitemactive::after{
  246 + content: '';
  247 + display:block;
  248 + width: 100rpx;
  249 + height: 1rpx;
  250 + background: rgba(61, 154, 248, 1);
  251 + position: absolute;
  252 + /* left: 50%;
  253 + transform: translateX(-50%); */
  254 + bottom:-20rpx;
  255 + left:0;
  256 +}
  257 +/* 品牌样式 */
  258 +.city_box{
  259 + height:100%;
  260 + background: #fff;
  261 + display: flex;
  262 + }
  263 + .city_left{
  264 + flex: 1;
  265 + margin-bottom:120rpx
  266 + }
  267 + .city_right{
  268 + width: 60rpx;
  269 + display: flex;
  270 + flex-direction: column;
  271 + justify-content: space-around;
  272 + overflow-y: scroll;
  273 +
  274 + }
  275 + .letter_item{
  276 + flex: 1;
  277 + display: block;
  278 + font-size: 24rpx;
  279 + color: #33B9FF;
  280 + text-align: center;
  281 + }
  282 + .city_locate,.national{
  283 + height: 80rpx;
  284 + line-height: 80rpx;
  285 + border-bottom: 1px solid #efefef;
  286 + font-size: 28rpx;
  287 + color: #333;
  288 + padding-left: 25rpx;
  289 + }
  290 + .city_locate_title{
  291 + color: #999;
  292 + margin-right: 20rpx;
  293 + }
  294 + .new_city{
  295 + background: #efefef;
  296 + font-size: 28rpx;
  297 + }
  298 + .new_city_title{
  299 + line-height: 50rpx;
  300 + color: #999;
  301 + padding-left: 25rpx;
  302 + margin-bottom: 20rpx;
  303 + }
  304 + .new_city_box{
  305 + display: flex;
  306 + flex-wrap: wrap;
  307 + }
  308 + .new_city_text{
  309 + width: 200rpx;
  310 + text-align: center;
  311 + line-height: 70rpx;
  312 + background: #fff;
  313 + border-radius: 35rpx;
  314 + margin:0 0 22rpx 22rpx;
  315 + }
  316 + .city_first_letter{
  317 + line-height: 40rpx;
  318 + height: 40rpx;
  319 + padding-left: 25rpx;
  320 + font-size: 28rpx;
  321 + background: #eee;
  322 + color: #999;
  323 + }
  324 + .city_name{
  325 + display: block;
  326 + font-size: 28rpx;
  327 + color: #333;
  328 + margin-right: 47rpx;
  329 + margin-bottom:30rpx;
  330 + }
  331 + .city_name:nth-child(4n){
  332 + margin-right:0
  333 + }
  334 + .citybox{
  335 + display:flex;
  336 + align-items: center;
  337 + flex-wrap: wrap;
  338 + padding: 15rpx 32rpx;
  339 + box-sizing: border-box;
  340 + }
  1 +// pages/coupon.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
  1 +{
  2 + "usingComponents": {}
  3 +}
  1 +<!--pages/coupon.wxml-->
  2 +<text>pages/coupon.wxml</text>
  1 +/* pages/coupon.wxss */
  1 +// pages/coupon/coupon.js
  2 +const app=getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + status:1,
  10 + goods_id:'',
  11 + couponlist:[]
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + this.setData({
  19 + goods_id:options.goods_id,
  20 + type:options.type
  21 + })
  22 + if(options.type==1){
  23 + this.getcoupon()
  24 + }else if(options.type==2){
  25 + this.getordercoupon()
  26 + }
  27 +
  28 + },
  29 +
  30 + getcoupon(){
  31 + let that=this;
  32 + let url = '/ticket/goods_ticket'
  33 + let param={
  34 + goods_id:that.data.goods_id
  35 + }
  36 + app.postk(url, param).then((res) => {
  37 + console.log(res)
  38 + that.setData({
  39 + couponlist:res.data
  40 + })
  41 +
  42 +
  43 + })
  44 + },
  45 + getordercoupon(){
  46 + let that=this;
  47 + let url = '/ticket/order_ticket'
  48 + let param={
  49 +
  50 + }
  51 + app.postk(url, param).then((res) => {
  52 + console.log(res)
  53 + that.setData({
  54 + couponlist:res.data
  55 + })
  56 +
  57 +
  58 + })
  59 + },
  60 +
  61 + selcoupon(e){
  62 + console.log(48344834)
  63 + this.status=e.currentTarget.dataset.id;
  64 + this.page=1;
  65 + // this.couponlist=[];
  66 + // this.getmycoupon();
  67 + },
  68 + lingqu(e){
  69 + let id=e.currentTarget.dataset.id;
  70 + let that=this;
  71 + let url = '/ticket/get_ticket1'
  72 + let param={
  73 + user_ticket_id:id
  74 + }
  75 + app.postk(url, param).then((res) => {
  76 + console.log(res)
  77 + wx.showToast({
  78 + title: '领取成功',
  79 + icon:'none'
  80 + })
  81 + setTimeout(function(){
  82 + if(that.data.type==1){
  83 + that.getcoupon()
  84 + }else if(that.data.type==2){
  85 + that.getordercoupon()
  86 + }
  87 +
  88 + },1000)
  89 +
  90 +
  91 +
  92 + })
  93 +
  94 + },
  95 +
  96 + /**
  97 + * 生命周期函数--监听页面初次渲染完成
  98 + */
  99 + onReady: function () {
  100 +
  101 + },
  102 +
  103 + /**
  104 + * 生命周期函数--监听页面显示
  105 + */
  106 + onShow: function () {
  107 +
  108 + },
  109 +
  110 + /**
  111 + * 生命周期函数--监听页面隐藏
  112 + */
  113 + onHide: function () {
  114 +
  115 + },
  116 +
  117 + /**
  118 + * 生命周期函数--监听页面卸载
  119 + */
  120 + onUnload: function () {
  121 +
  122 + },
  123 +
  124 + /**
  125 + * 页面相关事件处理函数--监听用户下拉动作
  126 + */
  127 + onPullDownRefresh: function () {
  128 +
  129 + },
  130 +
  131 + /**
  132 + * 页面上拉触底事件的处理函数
  133 + */
  134 + onReachBottom: function () {
  135 +
  136 + },
  137 +
  138 + /**
  139 + * 用户点击右上角分享
  140 + */
  141 + onShareAppMessage: function () {
  142 +
  143 + }
  144 +})
  1 +{
  2 + "navigationBarTitleText": "领取优惠券"
  3 +}
  1 +<view class="boxb">
  2 + <!-- <view class="xnavbox">
  3 + <view class="xnavitem" :class="status==1?'xactive':''" bindtap="selcoupon" :data-id="1">
  4 + 已使用
  5 + </view>
  6 + <view class="xnavitem status==2?'xactive':''" bindtap="selcoupon" :data-id="2">
  7 + 未使用
  8 + </view>
  9 +
  10 + </view> -->
  11 +
  12 +
  13 + <!-- <view class="couponpage" wx:else>
  14 + <view class="bitem item.status!=1?'borderactive':''" wx:for="{{couponlist}}" wx:key="index">
  15 + <view class="top">
  16 + <view class="price">¥{{item.discounts_price}}</view>
  17 + <view class="right">
  18 + <view class="bname">
  19 + <text>{{item.name}}</text>
  20 + </view>
  21 + <view class="tips" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
  22 + <view class="tips" wx:if="{{item.ticket_type==2}}">折扣{{item.discount}}</view>
  23 + </view>
  24 + </view>
  25 + <view class="btime">
  26 + <view class="lingbtn" bindtap="lingqu" data-id="{{item.id}}">领取</view>
  27 + </view>
  28 + </view>
  29 + </view> -->
  30 +
  31 + <view class="nodata" wx:if="{{couponlist.length==0}}">暂无数据</view>
  32 + <view class="couponpage" wx:else>
  33 + <view class="couponpageitem" wx:for="{{couponlist}}" wx:key="index">
  34 + <view class="coupontop">
  35 + <view class="couponleft" wx:if="{{item.ticket_type==1}}">
  36 + <view class="bigmoney">{{item.discounts_price}}</view>
  37 + <view class="smalltext">元</view>
  38 + </view>
  39 +
  40 + <view class="couponleft" wx:if="{{item.ticket_type==1}}">
  41 + <view class="bigmoney">{{item.discount}}</view>
  42 + <view class="smalltext">折</view>
  43 + </view>
  44 + <view class="couponright">
  45 + <view class="rightleft">
  46 + <view class="coupontitle">{{item.name}}</view>
  47 + <view class="fullmoney" wx:if="{{item.ticket_type==2}}">满{{item.full_price}}元可用</view>
  48 + </view>
  49 + <view class="rightright">
  50 + <view class="finishling">
  51 + <image src="/images/manjian.png"></image>
  52 + <view class="afterling">领取后30天过期</view>
  53 + </view>
  54 + <view class="useright" bindtap="lingqu" data-id="{{item.id}}">立即领取</view>
  55 +
  56 + </view>
  57 + </view>
  58 +
  59 + </view>
  60 +
  61 + </view>
  62 + </view>
  63 +</view>
  1 +page {
  2 + background: #F7F7F7;
  3 +}
  4 +.navboxk{
  5 + padding: 0 32rpx;
  6 + box-sizing: border-box;
  7 +}
  8 +.quanbox {
  9 + margin-top: 20rpx;
  10 +}
  11 +
  12 +.navbox {
  13 + height: 88rpx;
  14 + background: #fff;
  15 + display: flex;
  16 +}
  17 +
  18 +.navitem {
  19 + width: 50%;
  20 + height: 100%;
  21 + font-size: 32rpx;
  22 + font-family: PingFangSC-Regular, PingFang SC;
  23 + font-weight: 400;
  24 + color: rgba(35, 35, 35, 1);
  25 + display: flex;
  26 + align-items: center;
  27 + justify-content: center;
  28 +}
  29 +
  30 +.selactive {
  31 + color: #FF9417;
  32 + font-weight: bold;
  33 +}
  34 +
  35 +.boxa {
  36 + margin-top: 16rpx;
  37 + background: #fff;
  38 + overflow: hidden;
  39 + padding: 0 36rpx;
  40 + box-sizing: border-box;
  41 +}
  42 +
  43 +.aitem {
  44 + height: 150rpx;
  45 + border-bottom: 1px solid #FEFEFE;
  46 + display: flex;
  47 + align-items: center;
  48 + justify-content: space-between;
  49 +}
  50 +
  51 +.left {
  52 + width: 340rpx;
  53 +}
  54 +
  55 +.left .name {
  56 + font-size: 32rpx;
  57 + font-family: PingFangSC-Medium, PingFang SC;
  58 + font-weight: 500;
  59 + color: rgba(35, 35, 35, 1);
  60 +}
  61 +
  62 +.left .time {
  63 + font-size: 24rpx;
  64 + font-family: PingFangSC-Medium, PingFang SC;
  65 + font-weight: 500;
  66 + color: rgba(91, 94, 100, 1);
  67 + margin-top: 8rpx;
  68 +}
  69 +
  70 +.btn {
  71 + width: 160rpx;
  72 + height: 64rpx;
  73 + border-radius: 8rpx;
  74 + border: 1px solid rgba(255, 148, 23, 1);
  75 + font-size: 24rpx;
  76 + font-family: PingFangSC-Regular, PingFang SC;
  77 + font-weight: 400;
  78 + color: rgba(255, 148, 23, 1);
  79 + display: flex;
  80 + align-items: center;
  81 + justify-content: center;
  82 +}
  83 +
  84 +.activeA {
  85 + color: #BDC4CE;
  86 + border-color: #BDC4CE;
  87 +}
  88 +
  89 +.boxb {
  90 + padding: 0 32rpx;
  91 + box-sizing: border-box;
  92 +}
  93 +
  94 +.xnavbox {
  95 + display: flex;
  96 + align-items: center;
  97 + justify-content: space-between;
  98 + margin-top: 16rpx;
  99 +}
  100 +
  101 +.xnavitem {
  102 + width: 212rpx;
  103 + height: 62rpx;
  104 + font-size: 28rpx;
  105 + font-family: PingFangSC-Regular, PingFang SC;
  106 + font-weight: 400;
  107 + color: rgba(61, 69, 76, 1);
  108 + display: flex;
  109 + align-items: center;
  110 + justify-content: center;
  111 + background: #fff;
  112 +}
  113 +
  114 +.xactive {
  115 + background: #C29445;
  116 + color: #fff;
  117 +}
  118 +
  119 +.container {
  120 + margin-top: 12rpx;
  121 +}
  122 +
  123 +.bitem {
  124 + margin-top: 16rpx;
  125 + border-left: 8rpx solid #3D9AF8;
  126 + padding: 40rpx 32rpx 20rpx;
  127 + box-sizing: border-box;
  128 + background: #fff;
  129 +}
  130 +
  131 +.top {
  132 + height: 156rpx;
  133 + border-bottom: 1px solid #EEEEEE;
  134 + display: flex;
  135 + align-items: center;
  136 +}
  137 +
  138 +.price {
  139 + font-size: 72rpx;
  140 + font-family: PingFangSC-Medium, PingFang SC;
  141 + font-weight: 500;
  142 + color: #3D9AF8;
  143 + margin-right: 32rpx;
  144 +}
  145 +.lingbtn{
  146 + width:140rpx;
  147 + height:60rpx;
  148 + color:#fff;
  149 + font-size: 28rpx;
  150 + background: #3D9AF8;
  151 + border-radius: 20rpx;
  152 + text-align: center;
  153 + line-height: 60rpx;
  154 +}
  155 +
  156 +.right {
  157 + width: 100%;
  158 +}
  159 +
  160 +.bname {
  161 + width: 100%;
  162 + display: flex;
  163 + align-items: center;
  164 + justify-content: space-between;
  165 + font-size: 28rpx;
  166 + font-family: PingFangSC-Regular, PingFang SC;
  167 + font-weight: 400;
  168 + color: rgba(91, 94, 100, 1);
  169 +}
  170 +
  171 +.bname text:first-child {
  172 + font-size: 36rpx;
  173 + font-family: PingFangSC-Medium, PingFang SC;
  174 + font-weight: 600;
  175 + color: rgba(6, 18, 32, 1);
  176 +}
  177 +
  178 +.tips {
  179 + font-size: 32rpx;
  180 + font-family: PingFangSC-Regular, PingFang SC;
  181 + font-weight: 400;
  182 + color: rgba(61, 68, 76, 1);
  183 + margin-top: 16rpx;
  184 +}
  185 +
  186 +.btime {
  187 + font-size: 28rpx;
  188 + font-family: PingFangSC-Regular, PingFang SC;
  189 + font-weight: 400;
  190 + color: rgba(61, 69, 76, 1);
  191 + margin-top: 40rpx;
  192 + display:flex;
  193 + justify-content: flex-end;
  194 +}
  195 +
  196 +.borderactive {
  197 + /* border-color: #BDC4CE; */
  198 +}
  199 +
  200 +.wordacticve {
  201 + font-weight: 500 !important;
  202 + color: rgba(189, 196, 206, 1) !important;
  203 +}
  204 +/* 暂无数据 */
  205 +.couponleft{
  206 + /* height: 104rpx; */
  207 + /* border-right:1px solid #fff; */
  208 + padding-right: 16rpx;
  209 + box-sizing: border-box;
  210 + position: relative;
  211 + display:flex;
  212 +
  213 + align-items: flex-end;
  214 +}
  215 +.couponleft::after{
  216 + display:block;
  217 + content:'';
  218 + width:1rpx;
  219 + height:126rpx;
  220 + background: #fff;
  221 + position: absolute;
  222 + right:0;
  223 + top:0
  224 +}
  225 +.nodata {
  226 + color: #999;
  227 + font-size: 32rpx;
  228 + text-align: center;
  229 + margin-top: 30rpx;
  230 +}
@@ -30,71 +30,241 @@ Page({ @@ -30,71 +30,241 @@ Page({
30 status1: '', 30 status1: '',
31 status2: '', 31 status2: '',
32 title2: '', 32 title2: '',
33 - scrollTop:'',  
34 - pid:'' 33 + scrollTop: '',
  34 + pid: '',
  35 + logok: '',
  36 + selected: 0,
  37 + list: [{
  38 + pagePath: "/pages/index/index",
  39 + text: "商品",
  40 + iconPath: "/images/tabbar/icon_75.png",
  41 + selectedIconPath: "/images/tabbar/icon_68.png"
  42 + },
  43 + {
  44 + pagePath: "/pages/message/message",
  45 + text: "消息",
  46 + iconPath: "/images/tabbar/message.png",
  47 + selectedIconPath: "/images/tabbar/messageactive.png"
  48 + },
  49 + {
  50 + pagePath: "/pages/shop_cart/shop_cart",
  51 + text: "购物车",
  52 + iconPath: "/images/tabbar/icon_70.png",
  53 + selectedIconPath: "/images/tabbar/icon_73.png"
  54 + },
  55 + {
  56 + pagePath: "/pages/my/my",
  57 + text: "我的",
  58 + iconPath: "/images/tabbar/icon_71.png",
  59 + selectedIconPath: "/images/tabbar/icon_72.png"
  60 + }
  61 + ],
  62 + category_id1: '',
  63 + sort: '',
  64 + keyword: '',
  65 + shop_arr: [],
  66 + pricesheng: false,
  67 + xiaoliang: false,
  68 + pinpailist: [],
  69 + seltui: 0,
  70 + isyouzhi:0
  71 + },
  72 +
  73 + // 选择推荐列表
  74 + selitem(e) {
  75 + console.log(e)
  76 + let index = e.currentTarget.dataset.index;
  77 + this.setData({
  78 + seltui: index
  79 + })
  80 + },
  81 + // 进入商品列表
  82 + cityTap(e) {
  83 + console.log(e)
  84 + let id = e.currentTarget.dataset.id;
  85 + wx.navigateTo({
  86 + url: '/pages/pinpaibox/pinpaibox?pinpaiid=' + id,
  87 + })
35 }, 88 },
  89 + gopinpai() {
  90 + let token = wx.getStorageSync("token")
  91 + if (token == '') {
  92 + wx.showModal({
  93 + title: '提示',
  94 + content: '请先登录',
  95 + success(res) {
  96 + if (res.confirm) {
  97 + wx.navigateTo({
  98 + url: '/pages/register/register',
  99 + })
  100 + } else if (res.cancel) {}
  101 + }
  102 + })
36 103
  104 + return false
  105 + }
  106 + wx.navigateTo({
  107 + url: '/pages/classify/classify?type=' + 2,
  108 + })
  109 + },
37 scroll(e) { 110 scroll(e) {
38 - // console.log(e.detail.scrollTop)  
39 - // if (e.detail.scrollTop >300){  
40 - // console.log(8888)  
41 - // this.setData({  
42 - // stick:1  
43 - // })  
44 - // }else{  
45 - // this.setData({  
46 - // stick:0  
47 - // })  
48 - // } 111 + console.log(e)
  112 + console.log(e.detail.scrollTop)
  113 + if (e.detail.scrollTop >600){
  114 + console.log(8888)
  115 + this.setData({
  116 + stick:1
  117 + })
  118 + }else{
  119 + this.setData({
  120 + stick:0
  121 + })
  122 + }
49 123
50 // console.log(this.data.stick) 124 // console.log(this.data.stick)
51 }, 125 },
52 - 126 + // 公告详情
  127 + noticedetail(e) {
  128 + let id = e.currentTarget.dataset.id;
  129 + wx.navigateTo({
  130 + url: '../notice/notice?notice_id=' + id,
  131 + })
  132 + },
53 133
54 - onLoad: function(options) {  
55 - console.log( app.globalData.index)  
56 -if( app.globalData.index==undefined){  
57 - let that = this;  
58 - let token=wx.getStorageSync('token'); 134 + // 进入劳保商城
  135 + laobao() {
  136 + let token = wx.getStorageSync('token');
  137 + console.log(token)
  138 + if (token == '') {
  139 + wx.showToast({
  140 + title: '请先登录',
  141 + icon: 'none',
  142 + duration: 1300
  143 + })
  144 + setTimeout(function () {
  145 + wx.navigateTo({
  146 + url: '/pages/register/register',
  147 + })
  148 + }, 1300)
  149 + } else {
  150 + wx.setStorageSync('selecttype', 2)
  151 + wx.showLoading({
  152 + title: '加载中',
59 153
60 - console.log('woshitoe',token);  
61 - if(token!=""){  
62 - console.log(9999)  
63 - this.getInfoFun()  
64 - }  
65 - this.get_notice()  
66 - this.get_shopnum()  
67 - this.getmessagelist();  
68 - console.log('998867',this.data.pid)  
69 - if(this.data.pid){  
70 - this.get_info(this.data.pid, 2);  
71 - }else{  
72 - this.get_info(0, 1);  
73 - } 154 + })
  155 + setTimeout(function () {
  156 + wx.navigateTo({
  157 + url: '/packageA/pages/index/index',
  158 + })
  159 + }, 3000)
  160 + }
  161 + },
  162 + onLoad: function (options) {
  163 + console.log(app.globalData.index)
  164 + if (app.globalData.index == undefined) {
  165 + let that = this;
  166 + let token = wx.getStorageSync('token');
  167 +
  168 + console.log('woshitoe', token);
  169 + if (token != "") {
  170 + console.log(9999)
  171 + this.getInfoFun()
  172 + }
  173 + this.get_notice()
  174 + this.get_shopnum()
  175 + this.getmessagelist();
  176 + console.log('998867', this.data.pid)
  177 + // if(this.data.pid){
  178 + // this.get_info(this.data.pid, 2);
  179 + // }else{
  180 + // this.get_info(0, 1);
  181 + // }
  182 +
  183 + // 获取活动专区
  184 + this.getzhuanqulist();
  185 + this.getxianshi();
  186 + setTimeout(function () {
  187 + that.setData({
  188 + showtime: true
  189 + })
  190 + }, 990)
74 191
75 - // 获取活动专区  
76 - this.getzhuanqulist();  
77 - this.getxianshi();  
78 - setTimeout(function() {  
79 - that.setData({  
80 - showtime: true  
81 - })  
82 - }, 990)  
83 -}  
84 - //控制显示隐藏  
85 - this.ishow() 192 + this.getpinpailist()
  193 + }
  194 + //控制显示隐藏
  195 + this.ishow()
  196 + // 我写的项目
86 197
  198 +
  199 +
  200 + },
  201 +
  202 + // 获取一级分类
  203 + getonkind() {
  204 + let that = this;
  205 + let url = "/sundry/get_category"
  206 + app.postk(url, {}).then((r) => {
  207 + console.log('商品分类', r)
  208 + let obj = {
  209 + name: '首页',
  210 + id: '',
  211 + description:"优质推荐"
  212 + }
  213 + r.data.unshift(obj)
  214 + r.data.forEach(function (value, index, array) {
  215 + if (value.description == '') {
  216 + value.description = '暂无描述'
  217 + }
  218 + })
  219 + that.setData({
  220 + nav_arr: r.data,
  221 + })
  222 + // 获取商品列表
  223 + that.getyouzhi()
  224 + })
87 }, 225 },
88 226
  227 + // 获取优质推荐列表
  228 + getyouzhi() {
  229 + let that = this;
  230 + let url = '/activity/get_detail2'
  231 + let param = {
  232 + activity_id: '',
  233 + order: '',
  234 + page: this.data.page,
  235 + pageNum: 10
  236 + }
  237 + app.postk(url, param).then((res) => {
  238 + if (that.data.page > 1) {
  239 + if (res.data.length == 0) {
  240 + wx.showToast({
  241 + title: '没有更多了~',
  242 + icon: 'none'
  243 + })
  244 + } else {
  245 + this.setData({
  246 + shop_arr: that.data.shop_arr.concat(res.data)
  247 + })
  248 + }
  249 + } else {
  250 + this.setData({
  251 + shop_arr: that.data.shop_arr.concat(res.data)
  252 + })
  253 + }
  254 +
  255 +
  256 + console.log(that.data.shop_arr, '轮播图')
  257 + })
  258 + },
89 // 获取个人信息 259 // 获取个人信息
90 getInfoFun() { 260 getInfoFun() {
91 - let that= this; 261 + let that = this;
92 let u = app.interface.readteacher; 262 let u = app.interface.readteacher;
93 - app.post(u, {}).then((r) => {  
94 - console.log('3489523498',r) 263 + app.post(u, {}).then((r) => {
  264 + console.log('3489523498', r)
95 if (r.code == 200) { 265 if (r.code == 200) {
96 266
97 - app.globalData.login_new=r.msg.login_new; 267 + app.globalData.login_new = r.msg.login_new;
98 app.globalData.status = r.msg.status; 268 app.globalData.status = r.msg.status;
99 console.log(app.globalData.status) 269 console.log(app.globalData.status)
100 // t.setData({ 270 // t.setData({
@@ -114,43 +284,31 @@ if( app.globalData.index==undefined){ @@ -114,43 +284,31 @@ if( app.globalData.index==undefined){
114 wx.navigateTo({ 284 wx.navigateTo({
115 url: '/pages/register/register', 285 url: '/pages/register/register',
116 }) 286 })
117 - } else if (res.cancel) {  
118 - } 287 + } else if (res.cancel) {}
119 } 288 }
120 }) 289 })
121 - }else{  
122 - let login_new=wx.getStorageSync("login");  
123 - if(login_new==0){  
124 - // wx.showToast({  
125 - // title: '您还不是会员',  
126 - // icon:"none"  
127 - // })  
128 - // setTimeout(function(){  
129 - // wx.navigateTo({  
130 - // url: '/pages/login/login',  
131 - // })  
132 - // },1500)  
133 - // return false  
134 -  
135 - wx.showModal({  
136 - title: '提示',  
137 - content: '您还不是会员',  
138 - success(res) {  
139 - if (res.confirm) {  
140 - wx.navigateTo({  
141 - url: '/pages/login/login',  
142 - })  
143 - } else if (res.cancel) {  
144 - }  
145 - }  
146 - })  
147 -  
148 - return false  
149 -  
150 -  
151 - } 290 + } else {
  291 + let login_new = wx.getStorageSync("login");
  292 + // if(login_new==0){
  293 + // wx.showModal({
  294 + // title: '提示',
  295 + // content: '您还不是会员',
  296 + // success(res) {
  297 + // if (res.confirm) {
  298 + // wx.navigateTo({
  299 + // url: '/pages/login/login',
  300 + // })
  301 + // } else if (res.cancel) {
  302 + // }
  303 + // }
  304 + // })
  305 +
  306 + // return false
  307 +
  308 +
  309 + // }
152 wx.navigateTo({ 310 wx.navigateTo({
153 - url: '/pages/xianshi/xianshi?title2='+this.data.title2, 311 + url: '/pages/xianshi/xianshi?title2=' + this.data.title2,
154 }) 312 })
155 } 313 }
156 314
@@ -228,7 +386,7 @@ if( app.globalData.index==undefined){ @@ -228,7 +386,7 @@ if( app.globalData.index==undefined){
228 var that = this; 386 var that = this;
229 console.log('999', that.data.endTime) 387 console.log('999', that.data.endTime)
230 var time = that.data.endTime; 388 var time = that.data.endTime;
231 - var interval = setInterval(function() { 389 + var interval = setInterval(function () {
232 // 秒数 390 // 秒数
233 let day = parseInt(time / (60 * 60 * 24)); 391 let day = parseInt(time / (60 * 60 * 24));
234 let hou = parseInt(time % (60 * 60 * 24) / 3600); 392 let hou = parseInt(time % (60 * 60 * 24) / 3600);
@@ -257,17 +415,13 @@ if( app.globalData.index==undefined){ @@ -257,17 +415,13 @@ if( app.globalData.index==undefined){
257 //获取活动专区列表 415 //获取活动专区列表
258 getzhuanqulist() { 416 getzhuanqulist() {
259 let that = this 417 let that = this
260 - let url = '/activity/get_all';  
261 - let data = {  
262 -  
263 -  
264 - }  
265 - app.post(url, data, "POST").then((r) => { 418 + let url = '/activity/get_list';
  419 + let data = {}
  420 + app.postk(url, data, "POST").then((r) => {
266 console.log(r) 421 console.log(r)
267 that.setData({ 422 that.setData({
268 - activity: r.msg 423 + activity: r.data
269 }) 424 })
270 -  
271 console.log(that.data.activity) 425 console.log(that.data.activity)
272 // that.setData({ 426 // that.setData({
273 // messagelist: that.data.messagelist.concat(r.msg) 427 // messagelist: that.data.messagelist.concat(r.msg)
@@ -291,37 +445,52 @@ if( app.globalData.index==undefined){ @@ -291,37 +445,52 @@ if( app.globalData.index==undefined){
291 wx.navigateTo({ 445 wx.navigateTo({
292 url: '/pages/register/register', 446 url: '/pages/register/register',
293 }) 447 })
294 - } else if (res.cancel) {  
295 - }  
296 - }  
297 - })  
298 - }else{  
299 - let login_new=wx.getStorageSync('login');  
300 - if(login_new==0){  
301 - wx.showModal({  
302 - title: '提示',  
303 - content: '您还不是会员',  
304 - success(res) {  
305 - if (res.confirm) {  
306 -  
307 -  
308 - wx.navigateTo({  
309 - url: '/pages/login/login',  
310 - })  
311 - } else if (res.cancel) {  
312 - } 448 + } else if (res.cancel) {}
313 } 449 }
314 }) 450 })
315 -  
316 - return false  
317 - } 451 + } else {
  452 + let login_new = wx.getStorageSync('login');
  453 + // if(login_new==0){
  454 + // wx.showModal({
  455 + // title: '提示',
  456 + // content: '您还不是会员',
  457 + // success(res) {
  458 + // if (res.confirm) {
  459 +
  460 +
  461 + // wx.navigateTo({
  462 + // url: '/pages/login/login',
  463 + // })
  464 + // } else if (res.cancel) {
  465 + // }
  466 + // }
  467 + // })
  468 +
  469 + // return false
  470 + // }
318 wx.navigateTo({ 471 wx.navigateTo({
319 url: '/pages/zhuanqu/zhuanqu?id=' + id, 472 url: '/pages/zhuanqu/zhuanqu?id=' + id,
320 }) 473 })
321 } 474 }
322 - 475 +
323 }, 476 },
324 477
  478 + // 获取品牌专区
  479 + getpinpailist() {
  480 + let that = this
  481 + let url = '/sundry/get_brand';
  482 + let data = {
  483 + page: 1
  484 + }
  485 + app.postk(url, data, "POST").then((r) => {
  486 + console.log(r)
  487 + that.setData({
  488 + pinpailist: r.data.slice(0, 4)
  489 + })
  490 +
  491 +
  492 + }).catch((err) => {})
  493 + },
325 more() { 494 more() {
326 let token = wx.getStorageSync("token") 495 let token = wx.getStorageSync("token")
327 if (token == '') { 496 if (token == '') {
@@ -333,34 +502,15 @@ if( app.globalData.index==undefined){ @@ -333,34 +502,15 @@ if( app.globalData.index==undefined){
333 wx.navigateTo({ 502 wx.navigateTo({
334 url: '/pages/register/register', 503 url: '/pages/register/register',
335 }) 504 })
336 - } else if (res.cancel) {  
337 - }  
338 - }  
339 - })  
340 -  
341 - return false  
342 - }  
343 - let login_new=wx.getStorageSync('login');  
344 - if(login_new==0){  
345 - wx.showModal({  
346 - title: '提示',  
347 - content: '您还不是会员',  
348 - success(res) {  
349 - if (res.confirm) {  
350 -  
351 -  
352 - wx.navigateTo({  
353 - url: '/pages/login/login',  
354 - })  
355 - } else if (res.cancel) {  
356 - } 505 + } else if (res.cancel) {}
357 } 506 }
358 }) 507 })
359 508
360 return false 509 return false
361 } 510 }
  511 + let login_new = wx.getStorageSync('login');
362 wx.navigateTo({ 512 wx.navigateTo({
363 - url: '/pages/classify/classify', 513 + url: '/pages/classify/classify?type=' + 1,
364 }) 514 })
365 }, 515 },
366 //展示所有的小分类 516 //展示所有的小分类
@@ -381,38 +531,42 @@ if( app.globalData.index==undefined){ @@ -381,38 +531,42 @@ if( app.globalData.index==undefined){
381 wx.navigateTo({ 531 wx.navigateTo({
382 url: '/pages/register/register', 532 url: '/pages/register/register',
383 }) 533 })
384 - } else if (res.cancel) {  
385 - } 534 + } else if (res.cancel) {}
386 } 535 }
387 }) 536 })
388 - }else{  
389 - let login_new=wx.getStorageSync('login');  
390 - if(login_new==0){  
391 - wx.showModal({  
392 - title: '提示',  
393 - content: '您还不是会员',  
394 - success(res) {  
395 - if (res.confirm) {  
396 -  
397 -  
398 - wx.navigateTo({  
399 - url: '/pages/login/login',  
400 - })  
401 - } else if (res.cancel) {  
402 - }  
403 - }  
404 - })  
405 -  
406 - return false  
407 - } 537 + } else {
  538 + let login_new = wx.getStorageSync('login');
  539 + // if(login_new==0){
  540 + // wx.showModal({
  541 + // title: '提示',
  542 + // content: '您还不是会员',
  543 + // success(res) {
  544 + // if (res.confirm) {
  545 +
  546 +
  547 + // wx.navigateTo({
  548 + // url: '/pages/login/login',
  549 + // })
  550 + // } else if (res.cancel) {
  551 + // }
  552 + // }
  553 + // })
  554 +
  555 + // return false
  556 + // }
408 let title = this.data.nav_arr[this.data.nav_index].name 557 let title = this.data.nav_arr[this.data.nav_index].name
409 - let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0  
410 - let pid = this.data.nav_arr[this.data.nav_index].id 558 + let category_id2 = e.currentTarget.dataset.id;
411 wx.navigateTo({ 559 wx.navigateTo({
412 - url: '/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid 560 + url: '/pages/search/search_result/search_result?title=' + title + '&category_id2=' + category_id2
413 }) 561 })
  562 +
  563 + // let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
  564 + // let pid = this.data.nav_arr[this.data.nav_index].id
  565 + // wx.navigateTo({
  566 + // url: '/packageA/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
  567 + // })
414 } 568 }
415 - 569 +
416 }, 570 },
417 //监测轮播图变化 571 //监测轮播图变化
418 swiperChange(e) { 572 swiperChange(e) {
@@ -424,7 +578,8 @@ if( app.globalData.index==undefined){ @@ -424,7 +578,8 @@ if( app.globalData.index==undefined){
424 look_more(e) { 578 look_more(e) {
425 let token = wx.getStorageSync("token") 579 let token = wx.getStorageSync("token")
426 let id = e.currentTarget.dataset.id 580 let id = e.currentTarget.dataset.id
427 - let style = e.currentTarget.dataset.style 581 + let style = e.currentTarget.dataset.style;
  582 + console.log(style)
428 if (token == '') { 583 if (token == '') {
429 wx.showModal({ 584 wx.showModal({
430 title: '提示', 585 title: '提示',
@@ -434,28 +589,12 @@ if( app.globalData.index==undefined){ @@ -434,28 +589,12 @@ if( app.globalData.index==undefined){
434 wx.navigateTo({ 589 wx.navigateTo({
435 url: '/pages/register/register', 590 url: '/pages/register/register',
436 }) 591 })
437 - } else if (res.cancel) {  
438 - } 592 + } else if (res.cancel) {}
439 } 593 }
440 }) 594 })
441 } else { 595 } else {
442 - let login_new=wx.getStorageSync('login');  
443 - if(login_new==0){  
444 - wx.showModal({  
445 - title: '提示',  
446 - content: '您还不是会员',  
447 - success(res) {  
448 - if (res.confirm) {  
449 - wx.navigateTo({  
450 - url: '/pages/login/login',  
451 - })  
452 - } else if (res.cancel) {  
453 - }  
454 - }  
455 - }) 596 + let login_new = wx.getStorageSync('login');
456 597
457 - return false  
458 - }  
459 if (style == 2) { 598 if (style == 2) {
460 wx.navigateTo({ 599 wx.navigateTo({
461 url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src 600 url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
@@ -466,132 +605,205 @@ if( app.globalData.index==undefined){ @@ -466,132 +605,205 @@ if( app.globalData.index==undefined){
466 }) 605 })
467 } 606 }
468 } 607 }
469 -  
470 }, 608 },
471 609
472 -  
473 -  
474 -  
475 // 排序 610 // 排序
476 reorder(e) { 611 reorder(e) {
477 let that = this 612 let that = this
478 - let index = Number(e.currentTarget.dataset.index) 613 + that.setData({
  614 + page: 1,
  615 + shop_arr: []
  616 + })
  617 + let index = Number(e.currentTarget.dataset.index);
  618 + that.setData({
  619 + c_index: index,
  620 + sort: index
  621 + })
479 if (index == 1) { 622 if (index == 1) {
480 - if (that.data.price == "price") {  
481 - that.setData({  
482 - price: 'price desc' 623 + this.setData({
  624 + pricesheng: !this.data.pricesheng
  625 + })
  626 + if (this.data.pricesheng == true) {
  627 + this.setData({
  628 + sort: 1
483 }) 629 })
484 } else { 630 } else {
485 - that.setData({  
486 - price: 'price' 631 + this.setData({
  632 + sort: 2
487 }) 633 })
488 } 634 }
489 - } else if (index == 2) {  
490 - if (that.data.paynum == "paynum") {  
491 - that.setData({  
492 - paynum: 'paynum desc' 635 + }
  636 + if (index == 2) {
  637 + this.setData({
  638 + xiaoliang: !this.data.xiaoliang
  639 + })
  640 + if (this.data.xiaoliang == true) {
  641 + this.setData({
  642 + sort: 3
493 }) 643 })
494 } else { 644 } else {
495 - that.setData({  
496 - paynum: 'paynum' 645 + this.setData({
  646 + sort: 4
497 }) 647 })
498 } 648 }
499 } 649 }
500 - this.setData({  
501 - c_index: e.currentTarget.dataset.index,  
502 - page: 1,  
503 - page_type: false  
504 - })  
505 - //调用排序接口  
506 - this.good_list(this.data.pid, e.currentTarget.dataset.index) 650 + that.getgoodlist()
  651 +
  652 + // let that = this
  653 + // let index = Number(e.currentTarget.dataset.index)
  654 + // if (index == 1) {
  655 + // if (that.data.price == "price") {
  656 + // that.setData({
  657 + // price: 'price desc'
  658 + // })
  659 + // } else {
  660 + // that.setData({
  661 + // price: 'price'
  662 + // })
  663 + // }
  664 + // } else if (index == 2) {
  665 + // if (that.data.paynum == "paynum") {
  666 + // that.setData({
  667 + // paynum: 'paynum desc'
  668 + // })
  669 + // } else {
  670 + // that.setData({
  671 + // paynum: 'paynum'
  672 + // })
  673 + // }
  674 + // }
  675 + // this.setData({
  676 + // c_index: e.currentTarget.dataset.index,
  677 + // page: 1,
  678 + // page_type: false
  679 + // })
  680 + // //调用排序接口
  681 + // this.good_list(this.data.pid, e.currentTarget.dataset.index)
507 }, 682 },
508 - 683 + // 选择一级分类
509 select_nav(e) { 684 select_nav(e) {
510 let index = Number(e.currentTarget.dataset.index) 685 let index = Number(e.currentTarget.dataset.index)
511 - let id = e.currentTarget.dataset.id;  
512 this.setData({ 686 this.setData({
513 - pid:id 687 + seltui: index,
  688 + isyouzhi:1
514 }) 689 })
515 - 690 + let id = e.currentTarget.dataset.id;
  691 + let newclass_arr = this.data.nav_arr[index].child
516 this.setData({ 692 this.setData({
517 - scrollTop: 0 693 + category_id1: id,
  694 + class_arr: newclass_arr,
  695 + nav_index: index,
  696 + page: 1,
  697 + shop_arr: []
518 }) 698 })
519 - if (index == this.data.nav_index) {  
520 - return  
521 - } else {  
522 - this.setData({  
523 - nav_index: index,  
524 - page: 1,  
525 - page_type: false,  
526 - c_index: 0, //筛选分类下标  
527 - price: 'price desc', //价格排序方式  
528 - paynum: 'paynum desc' //销量排序方式  
529 - })  
530 - this.get_info(id, 2) 699 + if(index==0){
  700 + this.getyouzhi()
  701 + }else{
  702 + this.getgoodlist()
531 } 703 }
  704 +
  705 + },
  706 + // 获取商品列表
  707 + getgoodlist() {
  708 + let that = this;
  709 + let url = '/goods/get_goods'
  710 + let param = {
  711 + category_id1: this.data.category_id1,
  712 + sort: this.data.sort,
  713 + keyword: this.data.keyword,
  714 + page: this.data.page,
  715 + pageNum: 10
  716 + }
  717 + app.postk(url, param).then((res) => {
  718 + if (that.data.page > 1) {
  719 + if (res.data.length == 0) {
  720 + wx.showToast({
  721 + title: '没有更多了~',
  722 + icon: 'none'
  723 + })
  724 + } else {
  725 + this.setData({
  726 + shop_arr: that.data.shop_arr.concat(res.data)
  727 + })
  728 + }
  729 + } else {
  730 + this.setData({
  731 + shop_arr: that.data.shop_arr.concat(res.data)
  732 + })
  733 + }
  734 +
  735 +
  736 + console.log(that.data.shop_arr, '轮播图')
  737 + })
532 }, 738 },
  739 +
533 // 轮播图 740 // 轮播图
534 get_banner() { 741 get_banner() {
535 - let url = app.interface.banner  
536 - app.post(url, {}).then((res) => { 742 + let url = '/sundry/get_slide'
  743 + app.postk(url, {}).then((res) => {
  744 + console.log(res, '轮播图')
537 this.setData({ 745 this.setData({
538 - imgurl: res.msg 746 + imgurl: res.data
539 }) 747 })
540 }) 748 })
541 }, 749 },
542 //获取公告 750 //获取公告
543 get_notice() { 751 get_notice() {
544 let that = this 752 let that = this
545 - let url = app.interface.notice  
546 - app.post(url, {}).then((res) => {  
547 - for (let obj of res.msg) { 753 + let url = '/sundry/get_notice'
  754 + let param = {
  755 + page: 1,
  756 + pageNum: 2
  757 + }
  758 + app.postk(url, param).then((res) => {
  759 + for (let obj of res.data) {
548 obj.createtime = obj.createtime.substring(0, 10) 760 obj.createtime = obj.createtime.substring(0, 10)
549 } 761 }
550 that.setData({ 762 that.setData({
551 - notice: res.msg 763 + notice: res.data
552 }) 764 })
553 }) 765 })
554 }, 766 },
555 //获取页面信息 767 //获取页面信息
556 - get_info(pid, type) { //type 1为小标题 2为小标题下的小分类  
557 - wx.showLoading({  
558 - title: '加载中'  
559 - })  
560 - let that = this  
561 - let url = app.interface.index  
562 - let params = {  
563 - pid: pid  
564 - }  
565 - app.post(url, params).then((res) => {  
566 - console.log('88776654', res)  
567 - wx.hideLoading()  
568 - if (type == 1) {  
569 - let obj = {  
570 - name: '首页',  
571 - id: ''  
572 - }  
573 - res.msg.unshift(obj)  
574 - that.setData({  
575 - nav_arr: res.msg  
576 - })  
577 - that.get_info(res.msg[0].id, 2)  
578 - } else if (type == 2) {  
579 - console.log('666', res)  
580 - // let obj = {  
581 - // name: '全部',  
582 - // id: ''  
583 - // }  
584 - // res.msg.unshift(obj)  
585 - that.setData({  
586 - class_arr: res.msg,  
587 - cid: ''  
588 - })  
589 - that.good_list(pid, that.data.c_index)  
590 - }  
591 - }).catch((er) => {  
592 - wx.hideLoading()  
593 - })  
594 - }, 768 + // get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
  769 + // wx.showLoading({
  770 + // title: '加载中'
  771 + // })
  772 + // let that = this
  773 + // let url = app.interface.index
  774 + // let params = {
  775 + // pid: pid
  776 + // }
  777 + // app.post(url, params).then((res) => {
  778 + // console.log('88776654', res)
  779 + // wx.hideLoading()
  780 + // if (type == 1) {
  781 + // let obj = {
  782 + // name: '首页',
  783 + // id: ''
  784 + // }
  785 + // res.msg.unshift(obj)
  786 + // that.setData({
  787 + // nav_arr: res.data
  788 + // })
  789 + // that.get_info(res.msg[0].id, 2)
  790 + // } else if (type == 2) {
  791 + // console.log('666', res)
  792 + // // let obj = {
  793 + // // name: '全部',
  794 + // // id: ''
  795 + // // }
  796 + // // res.msg.unshift(obj)
  797 + // that.setData({
  798 + // class_arr: res.data,
  799 + // cid: ''
  800 + // })
  801 + // that.good_list(pid, that.data.c_index)
  802 + // }
  803 + // }).catch((er) => {
  804 + // wx.hideLoading()
  805 + // })
  806 + // },
595 //获取商品列表 807 //获取商品列表
596 good_list(pid, c_index) { 808 good_list(pid, c_index) {
597 wx.showLoading({ 809 wx.showLoading({
@@ -632,7 +844,7 @@ if( app.globalData.index==undefined){ @@ -632,7 +844,7 @@ if( app.globalData.index==undefined){
632 }) 844 })
633 }, 845 },
634 846
635 - 847 +
636 /** 848 /**
637 * 生命周期函数--监听页面加载 849 * 生命周期函数--监听页面加载
638 */ 850 */
@@ -645,7 +857,7 @@ if( app.globalData.index==undefined){ @@ -645,7 +857,7 @@ if( app.globalData.index==undefined){
645 if (res.msg > 0) { 857 if (res.msg > 0) {
646 wx.showTabBarRedDot({ 858 wx.showTabBarRedDot({
647 index: 2, 859 index: 2,
648 - success: function(red) { 860 + success: function (red) {
649 wx.setTabBarBadge({ 861 wx.setTabBarBadge({
650 index: 2, 862 index: 2,
651 text: res.msg.toString(), 863 text: res.msg.toString(),
@@ -675,7 +887,7 @@ if( app.globalData.index==undefined){ @@ -675,7 +887,7 @@ if( app.globalData.index==undefined){
675 // }) 887 // })
676 888
677 let newlist = []; 889 let newlist = [];
678 - r.msg.forEach(function(value, index, array) { 890 + r.msg.forEach(function (value, index, array) {
679 console.log(newlist) 891 console.log(newlist)
680 if (value.status == 1) { 892 if (value.status == 1) {
681 newlist.push(value) 893 newlist.push(value)
@@ -686,7 +898,7 @@ if( app.globalData.index==undefined){ @@ -686,7 +898,7 @@ if( app.globalData.index==undefined){
686 if (newlist.length != 0) { 898 if (newlist.length != 0) {
687 wx.showTabBarRedDot({ 899 wx.showTabBarRedDot({
688 index: 1, 900 index: 1,
689 - success: function(red) { 901 + success: function (red) {
690 902
691 wx.setTabBarBadge({ 903 wx.setTabBarBadge({
692 index: 1, 904 index: 1,
@@ -700,106 +912,122 @@ if( app.globalData.index==undefined){ @@ -700,106 +912,122 @@ if( app.globalData.index==undefined){
700 }).catch((err) => {}) 912 }).catch((err) => {})
701 }, 913 },
702 // 获取个人信息 914 // 获取个人信息
703 - 915 +
704 /** 916 /**
705 * 生命周期函数--监听页面初次渲染完成 917 * 生命周期函数--监听页面初次渲染完成
706 */ 918 */
707 - onReady: function() { 919 + onReady: function () {
708 920
709 }, 921 },
710 922
711 /** 923 /**
712 * 生命周期函数--监听页面显示 924 * 生命周期函数--监听页面显示
713 */ 925 */
714 - onShow: function() {  
715 - 926 + onShow: function () {
  927 +
  928 + this.setData({
  929 + logok: app.globalData.baseUrlimg + "assets/img/cb2ad36a391388f19f5f912fa021f8f.png"
  930 + })
716 this.get_banner() 931 this.get_banner()
717 console.log(app.globalData.index) 932 console.log(app.globalData.index)
718 - if(app.globalData.index==0){  
719 - app.globalData.index=undefined  
720 - let token=wx.getStorageSync('token');  
721 - console.log('woshitoe',token)  
722 - if(token!=""){  
723 - this.getInfoFun()  
724 - }  
725 - this.get_notice()  
726 - this.get_shopnum()  
727 - this.getmessagelist();  
728 - console.log('998867',this.data.pid)  
729 - if(this.data.pid){  
730 - this.get_info(this.data.pid, 2);  
731 - }else{  
732 - this.get_info(0, 1); 933 + if (app.globalData.index == 0) {
  934 + app.globalData.index = undefined
  935 + let token = wx.getStorageSync('token');
  936 + console.log('woshitoe', token)
  937 + if (token != "") {
  938 + this.getInfoFun()
  939 + }
  940 + this.get_notice()
  941 + this.get_shopnum()
  942 + this.getmessagelist();
  943 + console.log('998867', this.data.pid)
  944 + if (this.data.pid) {
  945 + // this.get_info(this.data.pid, 2);
  946 + } else {
  947 + // this.get_info(0, 1);
  948 + }
  949 +
  950 + //控制显示隐藏
  951 + this.ishow()
733 } 952 }
  953 + // 获取一级分类
  954 + this.getonkind();
734 955
735 - //控制显示隐藏  
736 - this.ishow()  
737 - }  
738 -  
739 -  
740 956
741 }, 957 },
742 958
743 /** 959 /**
744 * 生命周期函数--监听页面隐藏 960 * 生命周期函数--监听页面隐藏
745 */ 961 */
746 - onHide: function() { 962 + onHide: function () {
747 963
748 }, 964 },
749 965
750 /** 966 /**
751 * 生命周期函数--监听页面卸载 967 * 生命周期函数--监听页面卸载
752 */ 968 */
753 - onUnload: function() { 969 + onUnload: function () {
754 970
755 }, 971 },
756 972
757 /** 973 /**
758 * 页面相关事件处理函数--监听用户下拉动作 974 * 页面相关事件处理函数--监听用户下拉动作
759 */ 975 */
760 - onPullDownRefresh: function() {  
761 - 976 + onPullDownRefresh: function () {
  977 +
762 }, 978 },
763 - loadMore(e){  
764 - console.log(e)  
765 - let that = this  
766 - if (that.data.page_type) {  
767 - wx.showToast({  
768 - title: '暂无更多数据',  
769 - icon: 'none',  
770 - duration: 1000  
771 - })  
772 - return  
773 - }  
774 - that.setData({  
775 - page: that.data.page + 1 979 + loadMore(e) {
  980 + let newpage = this.data.page;
  981 + newpage++;
  982 + this.setData({
  983 + page: newpage
776 }) 984 })
777 - that.good_list(that.data.pid, that.data.c_index) 985 + if(this.data.isyouzhi==0){
  986 + this.getyouzhi()
  987 + }else{
  988 + this.getgoodlist()
  989 + }
  990 +
  991 + // console.log(e)
  992 + // let that = this
  993 + // if (that.data.page_type) {
  994 + // wx.showToast({
  995 + // title: '暂无更多数据',
  996 + // icon: 'none',
  997 + // duration: 1000
  998 + // })
  999 + // return
  1000 + // }
  1001 + // that.setData({
  1002 + // page: that.data.page + 1
  1003 + // })
  1004 + // that.good_list(that.data.pid, that.data.c_index)
778 }, 1005 },
779 /** 1006 /**
780 * 页面上拉触底事件的处理函数 1007 * 页面上拉触底事件的处理函数
781 */ 1008 */
782 - onReachBottom: function() {  
783 - console.log(43898438493)  
784 - let that = this  
785 - if (that.data.page_type) {  
786 - wx.showToast({  
787 - title: '暂无更多数据',  
788 - icon: 'none',  
789 - duration: 1000  
790 - })  
791 - return  
792 - }  
793 - that.setData({  
794 - page: that.data.page + 1  
795 - })  
796 - that.good_list(that.data.pid, that.data.c_index) 1009 + onReachBottom: function () {
  1010 +
  1011 + // console.log(43898438493)
  1012 + // let that = this
  1013 + // if (that.data.page_type) {
  1014 + // wx.showToast({
  1015 + // title: '暂无更多数据',
  1016 + // icon: 'none',
  1017 + // duration: 1000
  1018 + // })
  1019 + // return
  1020 + // }
  1021 + // that.setData({
  1022 + // page: that.data.page + 1
  1023 + // })
  1024 + // that.good_list(that.data.pid, that.data.c_index)
797 }, 1025 },
798 1026
799 /** 1027 /**
800 * 用户点击右上角分享 1028 * 用户点击右上角分享
801 */ 1029 */
802 - onShareAppMessage: function() { 1030 + onShareAppMessage: function () {
803 1031
804 } 1032 }
805 }) 1033 })
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 "navigationBarTitleText": "首页", 2 "navigationBarTitleText": "首页",
3 "usingComponents": { 3 "usingComponents": {
4 "concat": "/Components/concat/concat", 4 "concat": "/Components/concat/concat",
5 - "Model_item": "/Components/Model_item/Model_item" 5 + "Model_item": "/Components/Model_item/Model_item",
  6 + "v-tab-bar": "/custom-tab-bar/custom-tab-bar"
  7 +
6 } 8 }
7 } 9 }
@@ -5,9 +5,15 @@ @@ -5,9 +5,15 @@
5 <image src='/images/search.png' class='search_icon'></image> 5 <image src='/images/search.png' class='search_icon'></image>
6 <input class='real_search' placeholder='搜索您想要的商品'></input> 6 <input class='real_search' placeholder='搜索您想要的商品'></input>
7 </navigator> 7 </navigator>
  8 +
  9 + <view class="morebox" bindtap="more">
  10 + <view class="moreimg">
  11 + <image src="/images/more.png"></image>
  12 + </view>
  13 + </view>
8 </view> 14 </view>
9 15
10 - <view class='list' wx:if="{{nav_index!=0}}"> 16 + <!-- <view class='list' wx:if="{{nav_index!=0}}">
11 <view class='list_item' wx:if="{{index < length_num}}" wx:for="{{class_arr}}" wx:key="index" data-id="{{item.id}}" data-index="{{index}}" catchtap="look_item"> 17 <view class='list_item' wx:if="{{index < length_num}}" wx:for="{{class_arr}}" wx:key="index" data-id="{{item.id}}" data-index="{{index}}" catchtap="look_item">
12 <view class='item'> 18 <view class='item'>
13 <view class='item_img'> 19 <view class='item_img'>
@@ -24,37 +30,130 @@ @@ -24,37 +30,130 @@
24 <view class='item_font'>{{length_num == 9?'查看全部':'收起'}}</view> 30 <view class='item_font'>{{length_num == 9?'查看全部':'收起'}}</view>
25 </view> 31 </view>
26 </view> 32 </view>
27 - </view> 33 + </view> -->
28 34
29 <!-- 轮播图 --> 35 <!-- 轮播图 -->
30 - <view class="lunbo_box {{nav_index==0?'boxactive':''}}" wx:else>  
31 - <swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>  
32 - <swiper-item class='swiper-item' wx:for="{{imgurl}}" wx:key="index">  
33 - <image src='{{item.image}}' mode="aspectFill" data-id="{{item.thing_id}}" data-style="{{item.style}}" data-src="{{item.thing_id}}" catchtap="{{item.thing_id == 0?'':'look_more'}}" />  
34 - </swiper-item>  
35 - </swiper>  
36 - <view class="dots">  
37 - <block wx:for="{{imgurl}}" wx:key="index">  
38 - <view class="dot {{zcurrent == index ? 'active':''}}"></view>  
39 - </block> 36 + <!-- catchtap="{{item.goods_id == 0?'':'look_more'}}" -->
  37 + <view>
  38 + <view class="tuoyuan">
  39 + <image src="/images/tuoyuan.png"></image>
  40 + <view class="lunbo_box {{nav_index==0?'boxactive':''}}">
  41 + <swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>
  42 + <swiper-item class='swiper-item' wx:for="{{imgurl}}" wx:key="index">
  43 + <image src='{{item.image}}' mode="aspectFill" data-id="{{item.goods_id}}" data-style="{{item.type}}" data-src="{{item.url}}" catchtap="look_more" />
  44 + </swiper-item>
  45 + </swiper>
  46 + <view class="dots">
  47 + <block wx:for="{{imgurl}}" wx:key="index">
  48 + <view class="dot {{zcurrent == index ? 'active':''}}"></view>
  49 + </block>
  50 + </view>
  51 + </view>
40 </view> 52 </view>
41 </view> 53 </view>
42 <!-- 劳保 --> 54 <!-- 劳保 -->
43 - <!-- <view class="fenlei">  
44 - <view class="fenleiitem">  
45 - 劳保商城  
46 - </view>  
47 - <view class="fenleiitem">  
48 - 差旅  
49 - </view>  
50 - </view> -->  
51 - <!-- 活动区域 -->  
52 - <view wx:if="{{nav_index==0}}"> 55 + <view class="quan">
  56 + <view class="quanitem">
  57 + <image src="/images/xing.png" class="qiuimg"></image>
  58 + <view class="quanname">全球心选</view>
  59 + </view>
  60 + <view class="quanitem">
  61 + <image src="/images/zheng.png" class="qiuimg"></image>
  62 + <view class="quanname">正品保障</view>
  63 + </view>
  64 + <view class="quanitem">
  65 + <image src="/images/gou.png" class="qiuimg"></image>
  66 + <view class="quanname">售后无忧</view>
  67 + </view>
  68 + <view class="quanitem">
  69 + <image src="/images/dianhua.png" class="qiuimg"></image>
  70 + <view class="quanname">优质客服</view>
  71 + </view>
  72 + </view>
  73 + <view class="fenlei">
  74 + <view class="fenleiitem" bindtap="laobao">
  75 + <image src="/images/img_laobao.png"></image>
  76 + </view>
  77 + <view class="fenleiitem">
  78 + <image src="/images/img_chailv.png"></image>
  79 + </view>
  80 + </view>
  81 + <!-- 新品上线 -->
  82 + <view class="huo">
  83 + <image src="/images/huo.png" class="huoimg"></image>
  84 + <view class="pingtai">轻奢各样商品钜惠来袭</view>
  85 + </view>
  86 + <view class="newgoodbox">
  87 + <view class="newgood">
  88 + <view class="newgoodleft" bindtap="seeactive" data-id="{{activity[0].id}}">
  89 + <view class="newgoodlefttop">
  90 + <view class="newtitle" style="color:{{activity[0].name_color}}">{{activity[0].name}}</view>
  91 + <view class="hot" style="background:{{activity[0].describe_color}}">{{activity[0].label}}</view>
  92 + </view>
  93 + <view class="newgoodlist">
  94 + <view class="hotgoodimg">
  95 + <image src="{{activity[0].image}}"></image>
  96 + </view>
  97 +
  98 + </view>
  99 + </view>
  100 +
  101 + <view class="newgoodleft" bindtap="seeactive" data-id="{{activity[1].id}}">
  102 + <view class="newgoodlefttop">
  103 + <view class="newtitle" style="color:{{activity[1].name_color}}">{{activity[1].name}}</view>
  104 + <view class="youxuan" style="background:{{activity[1].label_color}}">{{activity[1].label}}</view>
  105 + </view>
  106 + <view class="jiesuo" style="color:{{activity[1].describe_color}}">{{activity[1].describe}}</view>
  107 + <view class="newgoodlist">
  108 + <view class="hotgoodimgk">
  109 + <image src="{{activity[1].image}}"></image>
  110 + </view>
  111 + </view>
  112 + </view>
  113 + </view>
  114 + <view class="newgood">
  115 + <view class="dapaiitem" bindtap="seeactive" data-id="{{activity[2].id}}">
  116 + <view class='dapaititle' style="color:{{activity[2].name_color}}">{{activity[2].name}}</view>
  117 + <view class='nvshen' style="color:{{activity[2].describe_color}}">{{activity[2].describe}}</view>
  118 + <view class="dapaiimg">
  119 + <image src="{{activity[2].image}}"></image>
  120 + </view>
  121 + </view>
  122 + <view class="dapaiitem" bindtap="seeactive" data-id="{{activity[3].id}}">
  123 + <view class='dapaititle' style="color:{{activity[3].name_color}}">{{activity[3].name}}</view>
  124 + <view class='nvshen' style="color:{{activity[3].describe_color}}">{{activity[3].describe}}</view>
  125 + <view class="dapaiimg">
  126 + <image src="{{activity[3].image}}"></image>
  127 + </view>
  128 + </view>
  129 + <view class="dapaiitem" bindtap="seeactive" data-id="{{activity[4].id}}">
  130 + <view class='dapaititle' style="color:{{activity[4].name_color}}">{{activity[4].name}}</view>
  131 + <view class='nvshen' style="color:{{activity[4].describe_color}}">{{activity[4].describe}}</view>
  132 + <view class="dapaiimg">
  133 + <image src="{{activity[4].image}}"></image>
  134 + </view>
  135 + </view>
  136 + </view>
  137 + </view>
53 138
  139 + <!-- 活动区域 -->
  140 + <view class="actboxpage" wx:if="{{nav_index==0}}">
  141 + <!-- <view class="pinpainame">品牌专区</view> -->
  142 + <view class="pinpaiheng">
  143 + <view class="huok">
  144 + <image src="/images/zuanshi.png" class="huoimg"></image>
  145 + <view class="pinname">品牌专区</view>
  146 + <view class="chaoduo">超多大牌 轻松选择 </view>
  147 + </view>
  148 + <view class="tosee" bindtap="gopinpai">
  149 + 全部
  150 + <image src="/images/gosee.png" class="seeimg"></image>
  151 + </view>
  152 + </view>
54 <view class="actity" wx:if="{{status1==1}}"> 153 <view class="actity" wx:if="{{status1==1}}">
55 <!-- <view class="miaoshaoname">活动专区</view> --> 154 <!-- <view class="miaoshaoname">活动专区</view> -->
56 <view class="active flexone"> 155 <view class="active flexone">
57 - <view wx:for="{{activity}}" class="actbox" wx:key="" bindtap="seeactive" data-id="{{item.id}}"> 156 + <view wx:for="{{pinpailist}}" class="actbox" wx:key="" bindtap="cityTap" data-id="{{item.id}}">
58 <view class="activeitem"> 157 <view class="activeitem">
59 <image src="{{item.image}}"></image> 158 <image src="{{item.image}}"></image>
60 </view> 159 </view>
@@ -62,65 +161,39 @@ @@ -62,65 +161,39 @@
62 </view> 161 </view>
63 </view> 162 </view>
64 </view> 163 </view>
65 -  
66 - <!-- 秒杀商城 -->  
67 - <!-- <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}">  
68 - <view class="miaoshatop flextwo">  
69 - <view class="miaoshatopleft flexone">  
70 - <view class="miaoshaoname">{{title2}}</view>  
71 - <view class="hourgou" wx:if="{{showtime}}">{{day}}:{{hou}}:{{min}}:{{sec}}</view>  
72 - </view>  
73 - <view class="miaosharight" bindtap="moremiao">  
74 - 查看更多>  
75 - </view>  
76 - </view>  
77 - <view class="miaoshalist">  
78 - <view class="miaoshalistitem" wx:for="{{xianshilist}}" wx:key="" bindtap="look_more" data-id="{{item.id}}">  
79 - <view class="goodimg">  
80 - <image src="{{item.images[0]}}"></image>  
81 - </view>  
82 - <view class="price">¥{{item.price2!=null?item.price2:item.price}}</view>  
83 - </view> 164 + <!-- <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}" bindtap="moremiao">
  165 + <view class="neigouimg">
  166 + <image src="{{logok}}"></image>
84 </view> 167 </view>
85 </view> --> 168 </view> -->
86 - <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}" bindtap="moremiao">  
87 - <view class="neigouimg">  
88 - <image src="/images/neigouk.png" ></image>  
89 - </view>  
90 - </view>  
91 </view> 169 </view>
92 170
93 <!-- 公告栏 --> 171 <!-- 公告栏 -->
94 - <navigator class="notice" url="../notice/notice"> 172 + <!-- url="../notice/notice" -->
  173 + <!-- <view class="notice">
95 <image src="/images/notice.png" class="notice_tips" /> 174 <image src="/images/notice.png" class="notice_tips" />
96 <view class="notice_word"> 175 <view class="notice_word">
97 - <view class="notice_item" wx:for="{{notice}}" wx:key="index" wx:if="{{index<2}}"> 176 + <view class="notice_item" wx:for="{{notice}}" wx:key="index" wx:if="{{index<2}}" bindtap="noticedetail" data-id="{{item.id}}">
98 <view class="dian" /> 177 <view class="dian" />
99 - <view class="word">{{item.desc}}</view> 178 + <view class="word">{{item.title}}</view>
100 <view class="time">{{item.createtime}}</view> 179 <view class="time">{{item.createtime}}</view>
101 </view> 180 </view>
102 </view> 181 </view>
103 - </navigator> 182 + </view> -->
104 183
105 <!-- 大分类 --> 184 <!-- 大分类 -->
106 <!-- {{stick==1?'navactive':''}} --> 185 <!-- {{stick==1?'navactive':''}} -->
107 -  
108 - <view class="navactive"> 186 + <!-- <view class="navactive">
109 <view class="horizontal_nav "> 187 <view class="horizontal_nav ">
110 -  
111 <view class="nav_item {{nav_index == index?'active':''}}" wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view> 188 <view class="nav_item {{nav_index == index?'active':''}}" wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
112 -  
113 -  
114 </view> 189 </view>
115 -  
116 <view class="morebox" bindtap="more"> 190 <view class="morebox" bindtap="more">
117 <view class="moreimg"> 191 <view class="moreimg">
118 <image src="/images/more.png"></image> 192 <image src="/images/more.png"></image>
119 </view> 193 </view>
120 </view> 194 </view>
121 - <!-- 小分类 -->  
122 - </view>  
123 - <view class='select_box'> 195 + </view> -->
  196 + <!-- <view class='select_box'>
124 <view class='select_item {{c_index == 0?"active":""}}' data-index="0" bindtap='reorder'>默认</view> 197 <view class='select_item {{c_index == 0?"active":""}}' data-index="0" bindtap='reorder'>默认</view>
125 <view class='select_item {{c_index == 1?"active":""}}' data-index="1" bindtap='reorder'>价格 198 <view class='select_item {{c_index == 1?"active":""}}' data-index="1" bindtap='reorder'>价格
126 <view class='select_img'> 199 <view class='select_img'>
@@ -132,11 +205,18 @@ @@ -132,11 +205,18 @@
132 <image src="{{c_index == 2?'/images/select_active.png':'/images/select.png'}}" class='select_img_no_choose' /> 205 <image src="{{c_index == 2?'/images/select_active.png':'/images/select.png'}}" class='select_img_no_choose' />
133 </view> 206 </view>
134 </view> 207 </view>
  208 + </view> -->
  209 + <!-- 品牌推荐列表 -->
  210 + <view class="tuijianlist flexone {{stick==1?'fixedactive':''}}" >
  211 + <view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">
  212 + <view class="tuijianitemname {{seltui==index?'tuiactive':''}}">{{item.name}}</view>
  213 + <view class="tuijiandes {{seltui==index?'tuiactive':''}}">{{item.description}}</view>
  214 + </view>
135 </view> 215 </view>
136 -  
137 <view class='real_goods'> 216 <view class='real_goods'>
138 <Model_item list="{{shop_arr}}" /> 217 <Model_item list="{{shop_arr}}" />
139 </view> 218 </view>
140 <concat /> 219 <concat />
141 </view> 220 </view>
142 -</scroll-view>  
  221 +</scroll-view>
  222 +<v-tab-bar selected="{{selected}}" text="1" list="{{list}}"></v-tab-bar>
1 page { 1 page {
2 width: 100%; 2 width: 100%;
3 height: 100%; 3 height: 100%;
4 - background: #fff; 4 + background: #F4F4F4;
5 } 5 }
6 6
7 image { 7 image {
@@ -23,15 +23,21 @@ image { @@ -23,15 +23,21 @@ image {
23 top: 0; 23 top: 0;
24 left: 0; 24 left: 0;
25 z-index: 99; 25 z-index: 99;
  26 + display:flex;
26 } 27 }
27 28
28 .lunbo_box { 29 .lunbo_box {
29 border: none !important; 30 border: none !important;
30 - background: rgba(61, 154, 248, 1); 31 + /* background: rgba(61, 154, 248, 1); */
31 /* padding: 2rpx 32rpx 25rpx; 32 /* padding: 2rpx 32rpx 25rpx;
32 box-sizing: border-box; */ 33 box-sizing: border-box; */
33 - position: relative;  
34 - margin-top: 10rpx; 34 + /* position: relative; */
  35 + position: absolute;
  36 + top:30rpx;
  37 + width:686rpx;
  38 + height: 283rpx;
  39 + border-radius: 20rpx;
  40 + left:32rpx;
35 } 41 }
36 42
37 .search_box { 43 .search_box {
@@ -61,7 +67,7 @@ image { @@ -61,7 +67,7 @@ image {
61 position: absolute; 67 position: absolute;
62 top: 50%; 68 top: 50%;
63 transform: translateY(-50%); 69 transform: translateY(-50%);
64 - left: 29%; 70 + left: 26%;
65 } 71 }
66 72
67 .flexone { 73 .flexone {
@@ -88,7 +94,7 @@ image { @@ -88,7 +94,7 @@ image {
88 94
89 .morebox { 95 .morebox {
90 width: 84rpx; 96 width: 84rpx;
91 - height: 88rpx; 97 + height:75rpx;
92 /* position: fixed; 98 /* position: fixed;
93 right:0; 99 right:0;
94 top:0; 100 top:0;
@@ -119,7 +125,7 @@ image { @@ -119,7 +125,7 @@ image {
119 } 125 }
120 126
121 .boxactive { 127 .boxactive {
122 - margin-top: 166rpx; 128 + /* margin-top: 166rpx; */
123 } 129 }
124 130
125 .nav_item { 131 .nav_item {
@@ -182,17 +188,15 @@ image { @@ -182,17 +188,15 @@ image {
182 } 188 }
183 189
184 .swiper_box { 190 .swiper_box {
185 - /* width: 686rpx;  
186 - height: 304rpx; */  
187 - width: 750rpx;  
188 - height: 320rpx; 191 + width: 686rpx;
  192 + height: 283rpx;
189 position: relative; 193 position: relative;
190 } 194 }
191 195
192 .swiper-item { 196 .swiper-item {
193 width: 100%; 197 width: 100%;
194 height: 100%; 198 height: 100%;
195 - border-radius: 10rpx; 199 + border-radius: 20rpx;
196 overflow: hidden; 200 overflow: hidden;
197 } 201 }
198 202
@@ -200,13 +204,14 @@ image { @@ -200,13 +204,14 @@ image {
200 width: 100%; 204 width: 100%;
201 height: 100%; 205 height: 100%;
202 overflow: hidden; 206 overflow: hidden;
  207 + border-radius:20rpx;
203 } 208 }
204 209
205 .dots { 210 .dots {
206 position: absolute; 211 position: absolute;
207 left: 0; 212 left: 0;
208 right: 0; 213 right: 0;
209 - bottom: 44rpx; 214 + bottom: 25rpx;
210 display: flex; 215 display: flex;
211 justify-content: center; 216 justify-content: center;
212 align-items: center; 217 align-items: center;
@@ -320,6 +325,7 @@ image { @@ -320,6 +325,7 @@ image {
320 border-radius: 50%; 325 border-radius: 50%;
321 background: #000; 326 background: #000;
322 margin-right: 10rpx; 327 margin-right: 10rpx;
  328 + flex:0 0 auto
323 } 329 }
324 330
325 .notice_item .word { 331 .notice_item .word {
@@ -335,14 +341,14 @@ image { @@ -335,14 +341,14 @@ image {
335 } 341 }
336 342
337 .real_goods { 343 .real_goods {
338 - background: #f9f9f9; 344 + /* background: #f9f9f9; */
339 } 345 }
340 346
341 .fenlei { 347 .fenlei {
342 display: flex; 348 display: flex;
343 align-items: center; 349 align-items: center;
344 justify-content: space-between; 350 justify-content: space-between;
345 - padding: 32rpx 32rpx; 351 + padding:21rpx 32rpx;
346 box-sizing: border-box; 352 box-sizing: border-box;
347 } 353 }
348 354
@@ -358,8 +364,8 @@ image { @@ -358,8 +364,8 @@ image {
358 } 364 }
359 365
360 .activeitem { 366 .activeitem {
361 - width: 215rpx;  
362 - height: 220rpx; 367 + width: 110rpx;
  368 + height:110rpx;
363 font-size: 0; 369 font-size: 0;
364 display: flex; 370 display: flex;
365 justify-content: center; 371 justify-content: center;
@@ -368,7 +374,6 @@ image { @@ -368,7 +374,6 @@ image {
368 margin-right: 24rpx; 374 margin-right: 24rpx;
369 margin: 0 auto; 375 margin: 0 auto;
370 } 376 }
371 -  
372 .activeitem image { 377 .activeitem image {
373 border-radius: 16rpx; 378 border-radius: 16rpx;
374 } 379 }
@@ -380,7 +385,9 @@ image { @@ -380,7 +385,9 @@ image {
380 flex-direction: column; 385 flex-direction: column;
381 align-items: center; 386 align-items: center;
382 margin-right: 16rpx; 387 margin-right: 16rpx;
383 - 388 +}
  389 +.actbox:last-child{
  390 + margin-right:0
384 } 391 }
385 392
386 image { 393 image {
@@ -393,13 +400,23 @@ image { @@ -393,13 +400,23 @@ image {
393 font-size: 32rpx; 400 font-size: 32rpx;
394 font-weight: bold; 401 font-weight: bold;
395 } 402 }
396 -  
397 -.actity {  
398 - width: 750rpx;  
399 - padding: 8rpx 30rpx; 403 +.actboxpage{
  404 + width:686rpx;
  405 + border-radius: 17rpx;
  406 + padding: 18rpx;
400 box-sizing: border-box; 407 box-sizing: border-box;
401 background: #fff; 408 background: #fff;
402 - border-bottom: 16rpx solid #f5f5f5; 409 + margin:27rpx auto 0;
  410 +
  411 +}
  412 +.actity {
  413 +
  414 +
  415 + /* width: 750rpx; */
  416 + /* padding: 8rpx 30rpx;
  417 + box-sizing: border-box; */
  418 + /* background: #fff;
  419 + border-bottom: 16rpx solid #f5f5f5; */
403 /* border-top:16rpx solid #f5f5f5; */ 420 /* border-top:16rpx solid #f5f5f5; */
404 margin-top:10rpx; 421 margin-top:10rpx;
405 } 422 }
@@ -408,15 +425,11 @@ image { @@ -408,15 +425,11 @@ image {
408 /* box-sizing: border-box; 425 /* box-sizing: border-box;
409 border-bottom: 20rpx solid #f5f5f5; */ 426 border-bottom: 20rpx solid #f5f5f5; */
410 } 427 }
411 -  
412 .active { 428 .active {
413 flex-wrap: nowrap; 429 flex-wrap: nowrap;
414 - /* overflow-x: scroll; */  
415 } 430 }
416 -  
417 .miaoshaoname { 431 .miaoshaoname {
418 color:rgba(61, 154, 248, 1); 432 color:rgba(61, 154, 248, 1);
419 -  
420 font-size: 28rpx; 433 font-size: 28rpx;
421 font-weight: bold; 434 font-weight: bold;
422 } 435 }
@@ -527,8 +540,280 @@ image { @@ -527,8 +540,280 @@ image {
527 } 540 }
528 .neigouimg{ 541 .neigouimg{
529 width:750rpx; 542 width:750rpx;
530 - height:254rpx; 543 + /* height:254rpx; */
  544 + height:196rpx;
531 font-size: 0; 545 font-size: 0;
532 display:flex; 546 display:flex;
533 justify-content: center; 547 justify-content: center;
534 } 548 }
  549 +
  550 +
  551 +
  552 +/* 新品上线 */
  553 +.newgoodbox{
  554 + width:686rpx;
  555 + border-radius: 17rpx;
  556 + background: #fff;
  557 + padding:18rpx ;
  558 + box-sizing: border-box;
  559 + margin:0 auto
  560 +}
  561 +.newgood{
  562 + /* padding: 0 32rpx ;
  563 + box-sizing: border-box; */
  564 + display:flex;
  565 + justify-content: space-between;
  566 +}
  567 +.dapaititle{
  568 + margin-top:20rpx
  569 +}
  570 +.newgoodlist{
  571 + display:flex;
  572 + align-items: center;
  573 + margin-top:12rpx
  574 +}
  575 +.newgoodlistitem{
  576 + display:flex;
  577 + flex-direction: column;
  578 + align-items: center;
  579 + justify-content: center;
  580 + padding: 12rpx;
  581 + height: 176rpx;
  582 + box-sizing: border-box;
  583 + background: #FCF6F3;
  584 +}
  585 +.hotgoodimg{
  586 + width:300rpx;
  587 + height:176rpx;
  588 + font-size: 0;
  589 + background: #FDF2E7;
  590 +}
  591 +.hotgoodimg:nth-child(2){
  592 + margin-left:18rpx
  593 +}
  594 +.hotword{
  595 + color:#F20000;
  596 + font-size: 24rpx;
  597 + margin-top:5rpx;
  598 + text-align: center;
  599 +}
  600 +.newgoodlistitemsec{
  601 + margin-left:28rpx
  602 +}
  603 +
  604 +.newtitle{
  605 + color:#06121E;
  606 + font-size: 32rpx;
  607 +}
  608 +.hot{
  609 + padding: 0 10rpx;
  610 +background: linear-gradient(270deg,#fe4e50 97%, #ff783c 2%);
  611 +border-radius: 16rpx;
  612 +box-sizing: border-box;
  613 +color:#fff;
  614 +font-size:30rpx;
  615 +margin-left:16rpx;
  616 +text-align: center;
  617 +}
  618 +.newgoodlefttop{
  619 + display:flex;
  620 + align-items: center;
  621 +}
  622 +.youxuan{
  623 +background: linear-gradient(270deg,#4e98fe 97%, #3cbcff 2%);
  624 +padding: 0 10rpx;
  625 +border-radius: 16rpx;
  626 +box-sizing: border-box;
  627 +color:#fff;
  628 +font-size:30rpx;
  629 +margin-left:16rpx;
  630 +text-align: center;
  631 +}
  632 +.hotgoodimgk{
  633 + width:288rpx;
  634 + height:127rpx;
  635 + border:1px solid #FCF6F3
  636 +}
  637 +.hotgoodimgk:nth-child(2){
  638 + margin-left:20rpx
  639 +}
  640 +.cahngxiang{
  641 + background: linear-gradient(270deg,#feba4e 97%, #ffc33c 2%);
  642 + padding: 0 10rpx;
  643 +border-radius: 16rpx;
  644 +box-sizing: border-box;
  645 +color:#fff;
  646 +font-size:30rpx;
  647 +margin-left:16rpx;
  648 +text-align: center;
  649 +}
  650 +.dapaimei{
  651 + display:flex;
  652 + align-items: center;
  653 +}
  654 +.pinpainame{
  655 + color:#06121E;
  656 + font-size: 32rpx;
  657 + padding: 24rpx 32rpx;
  658 + box-sizing: border-box;
  659 +}
  660 +.quan{
  661 + display:flex;
  662 + align-items: center;
  663 + justify-content: space-between;
  664 + padding: 21rpx 32rpx 0;
  665 + box-sizing: border-box;
  666 + margin-top:85rpx;
  667 +}
  668 +.qiuimg{
  669 + width:30rpx;
  670 + height:30rpx;
  671 + margin-right:9rpx
  672 +}
  673 +.quanitem{
  674 + display:flex;
  675 + align-items: center;
  676 +
  677 +}
  678 +.quanitem:nth-child(4){
  679 + margin-right:0
  680 +}
  681 +.quanname{
  682 + color:#6C6C6C;
  683 + font-size: 30rpx;
  684 + margin-left:10rpx
  685 +}
  686 +.huo{
  687 + display:flex;
  688 + align-items: center;
  689 + padding: 0 32rpx 21rpx;
  690 + box-sizing: border-box;
  691 +}
  692 +.huok{
  693 + display:flex;
  694 + align-items: center;
  695 +}
  696 +.jiesuo{
  697 + color:#FBA701;
  698 + font-size: 26rpx;
  699 + margin-top: 15rpx;
  700 +}
  701 +.huoimg{
  702 + width:32rpx;
  703 + height:32rpx;
  704 + margin-right:14rpx
  705 +}
  706 +.pingtai{
  707 + color:#F3342F;
  708 + font-size: 31rpx;
  709 +}
  710 +.dapaiimg{
  711 + width:206rpx;
  712 + height:247rpx;
  713 + font-size: 0;
  714 +}
  715 +.nvshen{
  716 + color:#FE2D64;
  717 + font-size: 26rpx;
  718 + margin:12rpx 0;
  719 +}
  720 +.pinname{
  721 + color:#333333;
  722 + font-size: 33rpx;
  723 + margin-left:15rpx;
  724 +}
  725 +.chaoduo{
  726 + color:#999999;
  727 + font-size: 26rpx;
  728 + margin-left:19rpx;
  729 +}
  730 +.tosee{
  731 + display:flex;
  732 + align-items: center;
  733 + color:#6C6C6C;
  734 + font-size: 30rpx;
  735 +}
  736 +.seeimg{
  737 + width:10rpx;
  738 + height:18rpx;
  739 + margin-left:20rpx
  740 +}
  741 +.pinpaiheng{
  742 + display:flex;
  743 + justify-content: space-between;
  744 + align-items: center;
  745 + /* padding:26rpx 32rpx ; */
  746 +}
  747 +.tuoyuan{
  748 + width:750rpx;
  749 + height:235rpx;
  750 + font-size: 0;
  751 + position: relative;
  752 + margin-top:74rpx
  753 +}
  754 +.tuijianlist{
  755 + width:686rpx;
  756 + margin:21rpx auto ;
  757 + overflow-x: scroll;
  758 +
  759 + /* padding: 28rpx 32rpx;
  760 + box-sizing: border-box; */
  761 + flex-wrap: nowrap;
  762 +}
  763 +.tuijianlistitem{
  764 + display:flex;
  765 + flex-direction: column;
  766 + align-items: center;
  767 + justify-content: center;
  768 + flex:0 0 auto;
  769 + padding: 0 46rpx;
  770 + box-sizing: border-box;
  771 +}
  772 +.tuijianlistitem:last-child .tuijiandes::after{
  773 + display:block;
  774 + content:'';
  775 + width:3rpx;
  776 + height: 28rpx;
  777 + background:#fff
  778 +}
  779 +.tuijianlistitem:first-child{
  780 + padding-left: 0;
  781 +}
  782 +.tuijianlistitem:last-child{
  783 + padding-right: 0;
  784 +}
  785 +.tuijianitemname{
  786 + color:#333333;
  787 + font-size:36rpx;
  788 + font-weight: bold;
  789 +}
  790 +.tuijiandes{
  791 + color:#999999;
  792 + font-size:28rpx;
  793 + margin-top:10rpx;
  794 + position: relative;
  795 +}
  796 +.tuijiandes::after{
  797 + display:block;
  798 + content:'';
  799 + width:3rpx;
  800 + height: 28rpx;
  801 + background:#dcdcdc;
  802 + position: absolute;
  803 + top:50%;
  804 + transform: translateY(-50%);
  805 + right:-46rpx;
  806 +}
  807 +.tuiactive{
  808 + color:#3D9AF7
  809 +}
  810 +.fixedactive{
  811 + width:100%;
  812 + position: fixed;
  813 + padding: 32rpx;
  814 + box-sizing: border-box;
  815 + top:60rpx;
  816 + left:0;
  817 + background: #fff;
  818 + z-index:999
  819 +}
  1 +// pages/coupon/coupon.js
  2 +const app=getApp()
  3 +Page({
  4 +
  5 + /**
  6 + * 页面的初始数据
  7 + */
  8 + data: {
  9 + status:1,
  10 + type:'',
  11 + couponlist:[],
  12 + goods_ids:[],
  13 + total:''
  14 + },
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function (options) {
  19 + console.log(options)
  20 + this.setData({
  21 + type:options.type,
  22 + goods_ids:JSON.parse(options.goods_ids),
  23 + total:options.total
  24 + })
  25 + this.getcoupon()
  26 + },
  27 +getcoupon(){
  28 + let that=this;
  29 + let url = '/ticket/my_ticket'
  30 + let param={
  31 + is_get:'',
  32 + status:2,
  33 + type:that.data.type,
  34 + total:that.data.total,
  35 + goods_ids:that.data.goods_ids.join(",")
  36 + }
  37 + console.log(param)
  38 + app.postk(url, param).then((res) => {
  39 + console.log(res)
  40 + that.setData({
  41 + couponlist:res.data
  42 + })
  43 + }).catch((err) => {
  44 + console.log(err)
  45 + })
  46 +
  47 +},
  48 +selectoupon(e){
  49 + let item=e.currentTarget.dataset.item;
  50 + console.log('8888676654',item)
  51 + let pages = getCurrentPages();
  52 + let prevPage = pages[pages.length - 2]; //上一个页面
  53 + //直接调用上一个页面的setData()方法,把数据存到上一个页面中去
  54 + if(item.type==2){
  55 + prevPage.setData({
  56 + user_ticket_id1: item.id,
  57 +
  58 + })
  59 + wx.setStorageSync('coupon', item)
  60 +
  61 +
  62 + }else if(item.type==1){
  63 + console.log(888777888,item.id)
  64 + prevPage.setData({
  65 + user_ticket_id2: item.id,
  66 +
  67 + })
  68 + wx.setStorageSync('couponone', item)
  69 +
  70 + }
  71 +
  72 + wx.navigateBack({
  73 + delta: 1
  74 + })
  75 + },
  76 +
  77 + /**
  78 + * 生命周期函数--监听页面初次渲染完成
  79 + */
  80 + onReady: function () {
  81 +
  82 + },
  83 +
  84 + /**
  85 + * 生命周期函数--监听页面显示
  86 + */
  87 + onShow: function () {
  88 +
  89 + },
  90 +
  91 + /**
  92 + * 生命周期函数--监听页面隐藏
  93 + */
  94 + onHide: function () {
  95 +
  96 + },
  97 +
  98 + /**
  99 + * 生命周期函数--监听页面卸载
  100 + */
  101 + onUnload: function () {
  102 +
  103 + },
  104 +
  105 + /**
  106 + * 页面相关事件处理函数--监听用户下拉动作
  107 + */
  108 + onPullDownRefresh: function () {
  109 +
  110 + },
  111 +
  112 + /**
  113 + * 页面上拉触底事件的处理函数
  114 + */
  115 + onReachBottom: function () {
  116 +
  117 + },
  118 +
  119 + /**
  120 + * 用户点击右上角分享
  121 + */
  122 + onShareAppMessage: function () {
  123 +
  124 + }
  125 +})
  1 +{
  2 + "usingComponents": {}
  3 +}
  1 +<view class="boxb">
  2 + <!-- <view class="xnavbox">
  3 + <view class="xnavitem" :class="status==1?'xactive':''" bindtap="selcoupon" :data-id="1">
  4 + 已使用
  5 + </view>
  6 + <view class="xnavitem status==2?'xactive':''" bindtap="selcoupon" :data-id="2">
  7 + 未使用
  8 + </view>
  9 + </view> -->
  10 + <view class="nodata" wx:if="{{couponlist.length==0}}">暂无数据</view>
  11 + <!-- <view class="couponpage">
  12 + <view class="bitem item.status!=1?'borderactive':''" wx:for="{{couponlist}}" wx:key="" bindtap="selectoupon" data-item="{{item}}">
  13 + <view class="top">
  14 + <view class="price" wx:if="{{item.ticket_type==1}}">¥{{item.discounts_price}}</view>
  15 + <view class="right">
  16 + <view class="bname">
  17 + <text>{{item.name}}</text>
  18 + </view>
  19 + <view class="tips" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
  20 + <view class="tips" wx:if="{{item.ticket_type==2}}">折扣{{item.discount}}</view>
  21 + </view>
  22 + </view>
  23 + <view class="btime">
  24 + 有效期至:{{item.pasttime}}
  25 + </view>
  26 + </view>
  27 + </view> -->
  28 + <view class="couponpage" wx:else>
  29 + <view class="couponpageitem" wx:for="{{couponlist}}" wx:key="index" bindtap="selectoupon" data-item="{{item}}">
  30 + <view class="coupontop">
  31 + <view class=" couponleftk" wx:if="{{item.ticket_type==1}}">
  32 + <view class="bigmoney">{{item.discounts_price}}</view>
  33 + <view class="smalltext">元</view>
  34 + </view>
  35 + <view class="couponleft" wx:if="{{item.ticket_type==2}}">
  36 + <view class="bigmoney">{{item.discount}}</view>
  37 + <view class="smalltext">折</view>
  38 + </view>
  39 + <view class="couponright">
  40 + <view class="rightleft">
  41 + <view class="coupontitle">{{item.name}}</view>
  42 + <view class="fullmoney" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
  43 + </view>
  44 + <view class="rightright">
  45 + <view class="finishling">
  46 + 到期时间: {{item.pasttime}}
  47 + <!-- <image src="/images/manjian.png"></image> -->
  48 + <!-- <view class="afterling">领取后30天过期</view> -->
  49 + </view>
  50 + <!-- <view class="useright" bindtap="lingqu" data-id="{{item.id}}">立即领取</view> -->
  51 + </view>
  52 + </view>
  53 + </view>
  54 + </view>
  55 + </view>
  56 +</view>
  1 +page {
  2 + background: #F7F7F7;
  3 +}
  4 +.navboxk{
  5 + padding: 0 32rpx;
  6 + box-sizing: border-box;
  7 +}
  8 +.quanbox {
  9 + margin-top: 20rpx;
  10 +}
  11 +
  12 +.navbox {
  13 + height: 88rpx;
  14 + background: #fff;
  15 + display: flex;
  16 +}
  17 +
  18 +.navitem {
  19 + width: 50%;
  20 + height: 100%;
  21 + font-size: 32rpx;
  22 + font-family: PingFangSC-Regular, PingFang SC;
  23 + font-weight: 400;
  24 + color: rgba(35, 35, 35, 1);
  25 + display: flex;
  26 + align-items: center;
  27 + justify-content: center;
  28 +}
  29 +
  30 +.selactive {
  31 + color: rgba(61, 154, 248, 1);
  32 + font-weight: bold;
  33 +}
  34 +
  35 +.boxa {
  36 + margin-top: 16rpx;
  37 + background: #fff;
  38 + overflow: hidden;
  39 + padding: 0 36rpx;
  40 + box-sizing: border-box;
  41 +}
  42 +
  43 +.aitem {
  44 + height: 150rpx;
  45 + border-bottom: 1px solid #FEFEFE;
  46 + display: flex;
  47 + align-items: center;
  48 + justify-content: space-between;
  49 +}
  50 +
  51 +.left {
  52 + width: 340rpx;
  53 +}
  54 +
  55 +.left .name {
  56 + font-size: 32rpx;
  57 + font-family: PingFangSC-Medium, PingFang SC;
  58 + font-weight: 500;
  59 + color: rgba(35, 35, 35, 1);
  60 +}
  61 +
  62 +.left .time {
  63 + font-size: 24rpx;
  64 + font-family: PingFangSC-Medium, PingFang SC;
  65 + font-weight: 500;
  66 + color: rgba(91, 94, 100, 1);
  67 + margin-top: 8rpx;
  68 +}
  69 +
  70 +.btn {
  71 + width: 160rpx;
  72 + height: 64rpx;
  73 + border-radius: 8rpx;
  74 + border: 1px solid rgba(255, 148, 23, 1);
  75 + font-size: 24rpx;
  76 + font-family: PingFangSC-Regular, PingFang SC;
  77 + font-weight: 400;
  78 + color: rgba(255, 148, 23, 1);
  79 + display: flex;
  80 + align-items: center;
  81 + justify-content: center;
  82 +}
  83 +
  84 +.activeA {
  85 + color: #BDC4CE;
  86 + border-color: #BDC4CE;
  87 +}
  88 +
  89 +.boxb {
  90 + padding: 0 32rpx;
  91 + box-sizing: border-box;
  92 +}
  93 +
  94 +.xnavbox {
  95 + display: flex;
  96 + align-items: center;
  97 + justify-content: space-between;
  98 + margin-top: 16rpx;
  99 +}
  100 +
  101 +.xnavitem {
  102 + width: 212rpx;
  103 + height: 62rpx;
  104 + font-size: 28rpx;
  105 + font-family: PingFangSC-Regular, PingFang SC;
  106 + font-weight: 400;
  107 + color: rgba(61, 69, 76, 1);
  108 + display: flex;
  109 + align-items: center;
  110 + justify-content: center;
  111 + background: #fff;
  112 +}
  113 +
  114 +.xactive {
  115 + background: #C29445;
  116 + color: #fff;
  117 +}
  118 +
  119 +.container {
  120 + margin-top: 12rpx;
  121 +}
  122 +
  123 +.bitem {
  124 + margin-top: 16rpx;
  125 + border-left: 8rpx solid rgba(61, 154, 248, 1);
  126 + padding: 40rpx 32rpx 20rpx;
  127 + box-sizing: border-box;
  128 + background: #fff;
  129 +}
  130 +
  131 +.top {
  132 + height: 156rpx;
  133 + border-bottom: 1px solid #EEEEEE;
  134 + display: flex;
  135 + align-items: center;
  136 +}
  137 +
  138 +.price {
  139 + font-size: 72rpx;
  140 + font-family: PingFangSC-Medium, PingFang SC;
  141 + font-weight: 500;
  142 + color: rgba(61, 154, 248, 1);
  143 +
  144 + margin-right: 32rpx;
  145 +}
  146 +
  147 +.right {
  148 + width: 100%;
  149 +}
  150 +
  151 +.bname {
  152 + width: 100%;
  153 + display: flex;
  154 + align-items: center;
  155 + justify-content: space-between;
  156 + font-size: 28rpx;
  157 + font-family: PingFangSC-Regular, PingFang SC;
  158 + font-weight: 400;
  159 + color: rgba(91, 94, 100, 1);
  160 +}
  161 +
  162 +.bname text:first-child {
  163 + font-size: 36rpx;
  164 + font-family: PingFangSC-Medium, PingFang SC;
  165 + font-weight: 600;
  166 + color: rgba(6, 18, 32, 1);
  167 +}
  168 +
  169 +.tips {
  170 + font-size: 32rpx;
  171 + font-family: PingFangSC-Regular, PingFang SC;
  172 + font-weight: 400;
  173 + color: rgba(61, 68, 76, 1);
  174 + margin-top: 16rpx;
  175 +}
  176 +
  177 +.btime {
  178 + font-size: 28rpx;
  179 + font-family: PingFangSC-Regular, PingFang SC;
  180 + font-weight: 400;
  181 + color: rgba(61, 69, 76, 1);
  182 + margin-top: 40rpx;
  183 +}
  184 +
  185 +.borderactive {
  186 + /* border-color: #BDC4CE; */
  187 +}
  188 +
  189 +.wordacticve {
  190 + font-weight: 500 !important;
  191 + color: rgba(189, 196, 206, 1) !important;
  192 +}
  193 +/* 暂无数据 */
  194 +.nodata {
  195 + color: #999;
  196 + font-size: 32rpx;
  197 + text-align: center;
  198 + margin-top: 30rpx;
  199 +}
  200 +.couponpage{
  201 + margin-bottom:32rpx
  202 +}
  203 +.finishling{
  204 + color:#fff;
  205 + font-size: 24rpx;
  206 +}
@@ -7,22 +7,24 @@ Page({ @@ -7,22 +7,24 @@ Page({
7 data: { 7 data: {
8 info:[], 8 info:[],
9 item:'', 9 item:'',
10 - sel:0 10 + sel:0,
  11 + newinfo:[]
11 }, 12 },
12 // 获取页面信息 13 // 获取页面信息
13 get_info(order) { 14 get_info(order) {
14 let that=this 15 let that=this
15 - let url = app.interface.kuaidi 16 + let url = '/order/logistics'
16 let params = { 17 let params = {
17 - order_odd: order 18 + order_info_id: order
18 } 19 }
19 - app.post(url,params).then((res)=>{ 20 + app.postk(url,params).then((res)=>{
20 console.log(res) 21 console.log(res)
21 this.setData({ 22 this.setData({
22 - info: res.msg.kuaidi 23 + info: res.data.result1,
  24 + newinfo:res.data.result2
23 }) 25 })
24 this.setData({ 26 this.setData({
25 - item: res.msg.kuaidi[0] 27 + item: res.data.result1[0]
26 }) 28 })
27 29
28 console.log(that.data.info) 30 console.log(that.data.info)