作者 lihongjuan

滨海内购开放商城

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

要显示太多修改。

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

... ... @@ -20,22 +20,36 @@ Component({
methods: {
look_more(e) {
let login_new=app.globalData.login_new;
if(login_new==0){
wx.showToast({
title: '您还不是会员',
icon:"none"
})
setTimeout(function(){
wx.navigateTo({
url: '/pages/login/login',
})
},1500)
return false
}
// if(login_new==0){
// wx.showToast({
// title: '您还不是会员',
// icon:"none"
// })
// setTimeout(function(){
// wx.navigateTo({
// url: '/pages/login/login',
// })
// },1500)
// return false
// }
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
})
let token=wx.getStorageSync('token');
if(token==''){
wx.showToast({
title: '请先登录',
icon:'none',
duration: 1300
})
setTimeout(function(){
wx.navigateTo({
url: '/pages/register/register',
})
},1300)
}else{
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
})
}
},
},
lifetimes: {
... ...
<view class='real_goods'>
<view class="real_goods_item" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="{{item.sold==0?'':'look_more'}}">
<view class='real_goods_img'>
<image src='{{item.images[0]}}' mode="aspectFill" />
<image src='/images/mei.png' class="tip" wx:if="{{item.sold == 0}}" />
</view>
<view class='real_goods_bottom'>
<view class='goods_title'>{{item.name}}</view>
<view wx:if="{{item.price2!=null}}">
<view class="real_goods_item" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="{{item.sold==0?'':'look_more'}}">
<view class='real_goods_img'>
<image src='{{item.images[0]}}' mode="aspectFill" />
<image src='/images/mei.png' class="tip" wx:if="{{item.sold == 0}}" />
</view>
<view class='real_goods_bottom'>
<view class='goods_title'>{{item.name}}</view>
<view class='goods_flex'>
<view class='score'>积分</view>
<view class='price'>{{item.price2}}</view>
<view class='sell'>已卖出{{item.paynum}}件</view>
</view>
<!-- <view class='oldprice'>{{item.price}}</view> -->
</view>
<view class='goods_flex' wx:else>
<view class='score'>积分</view>
<view class='price'>{{item.price}}</view>
<view class='sell'>已卖出{{item.paynum}}件</view>
</view>
<view class='goods_flex'>
<!-- <view class='score'>积分</view>
<view class='price'>{{item.price2}}</view>
</view>
<view class="pink_cover" wx:if="{{item.sold==0}}" />
<view class='sell'>已卖出{{item.paynum}}件</view> -->
<view class='price'>¥{{item.min_goods_price}}</view>
<view class="lineprice" wx:if="{{item.min_goods_price!=null}}">¥{{item.line_price}}</view>
</view>
</view>
<view class='sell'>已卖出{{item.sales}}件</view>
<!-- <view class='oldprice'>{{item.price}}</view> -->
</view>
<view class="pink_cover" wx:if="{{item.sold==0}}" />
</view>
</view>
\ No newline at end of file
... ...
.real_goods {
width: 750rpx;
margin: 0 auto;
background: #f9f9f9;
/* background: #f9f9f9; */
display: flex;
flex-wrap: wrap;
padding: 8rpx 0 20rpx;
box-sizing: border-box;
margin-bottom:120rpx;
padding: 0 32rpx;
box-sizing: border-box;
}
.real_goods_item {
width: 367rpx;
margin-top: 20rpx;
width: 332rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
background: #fff;
overflow: hidden;
position: relative;
display:flex;
flex-direction: column;
align-items: center;
margin-right:6rpx
}
.real_goods_item:nth-child(2n){
border-left:16rpx solid #f5f5f5;
margin-right: 0;
}
.real_goods_img {
... ... @@ -90,7 +93,7 @@
}
.price {
font-size: 36rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(242, 0, 0, 1);
... ... @@ -117,4 +120,12 @@
color:#BDC4CE;
font-size: 24rpx;
text-decoration: line-through
}
.lineprice{
color: rgba(156, 156, 156, 1);
text-decoration: line-through;
font-size: 20rpx;
margin-right:5rpx;
}
\ No newline at end of file
... ...
<view class="concat_box">
<button open-type="contact" class="item" plain="true">
<image src="/images/icon_65.png" />
</button>
<image src="/images/icon_65.png" class="item" />
<button open-type="contact" plain="true" class="dadianhua"></button>
<view class="item" catchtap="tel">
<image src="/images/bodadianhua_icon.png" />
</view>
... ...
... ... @@ -3,7 +3,7 @@
height: 210rpx;
position: fixed;
right: -24rpx;
bottom: 100rpx;
bottom: 127rpx;
}
.item {
... ... @@ -12,6 +12,18 @@
padding: 0;
border: none !important;
margin: 0 !important;
position: relative;
}
.dadianhua{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
position: absolute;
left:0;
top:0;
border:none;
outline:none;
opacity: 0;
}
.item:first-child {
... ...
... ... @@ -33,11 +33,14 @@ Component({
},
//加减商品数量
num_change(e) {
console.log(e)
let num = Number(e.currentTarget.dataset.num)
let type = e.currentTarget.dataset.type
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
let product_id = e.currentTarget.dataset.product_id
let product_id = e.currentTarget.dataset.product_id;
let spec_sku_id=e.currentTarget.dataset.specid;
console.log('属性idid ',spec_sku_id)
if (type == 1) {
num++
} else {
... ... @@ -56,7 +59,14 @@ Component({
num: num,
index: index,
type: type,
product_id: product_id
product_id: product_id,
spec_sku_id:spec_sku_id
})
},
lookdetail(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
})
},
//改变商品选中状态
... ... @@ -64,6 +74,7 @@ Component({
let index = e.currentTarget.dataset.index
let check_type = e.currentTarget.dataset.check_type ? e.currentTarget.dataset.check_type:false
let check_num = Number(this.data.check_num)
if (!check_type){
check_num ++
} else {
... ... @@ -72,10 +83,12 @@ Component({
this.triggerEvent('check_type', {
index: index,
check_type: !check_type,
check_num: check_num
check_num: check_num,
})
}
},
lifetimes: {
created() {
// 在组件实例刚刚被创建时执行
... ...
<view class="item" wx:for="{{list}}" wx:key="index">
<view class="top">
<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}}" />
<view class="top" bindtap="lookdetail" data-id="{{item.goods_id}}">
<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}}"/>
<view class="content {{type==3?'active':''}}">
<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}}"/>
<view class="right {{type==3?'ractive':''}}">
<view class="word">{{type == 3?item.name:type==2?item.product_name:item.product.name}}</view>
<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}}" />
<view class="right {{type==3||type==1||type==4?'ractive':''}}">
<!-- <view class="word">{{type == 3||type==1||type==4?item.name:type==2?item.product_name:item.product.name}}</view> -->
<view class="word">{{item.name}}</view>
<view class="guige">
<view class="guigeitem" wx:for="{{item.spec}}" wx:key="index">{{item.spec_name}}:{{item.spec_value}}</view>
</view>
<view class="info">
<view class="jifen">
<view class="name">积分</view>
<text wx:if='{{item.product.price2!=null||item.price2!=null}}'>{{type == 3 || type == 2?item.price2:item.product.price2}}</text>
<text wx:else>{{type == 3 || type == 2?item.price:item.product.price}}</text>
<text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.num}}</text>
<text wx:if="{{type==1}}">{{item.goods_price}}</text>
<text wx:if="{{type==2}}">{{item.goods.min_goods_price}}</text>
<text style="margin-left: 10rpx;color:#ccc;font-size: 28rpx;" wx:if="{{type == 3 || type == 4}}">X{{item.number}}</text>
</view>
<view class="num_box" wx:if="{{type == 1}}">
<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" />
<text>{{item.num}}</text>
<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"/>
<view class="num_box" wx:if="{{type == 1}}">
<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}}"/>
<text>{{item.number}}</text>
<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"/>
</view>
</view>
<!-- <view class="oldprice" wx:if="{{item.product.price2!=null||item.price2!=null}}">{{item.product.price||item.price}}</view> -->
</view>
</view>
</view>
... ...
... ... @@ -182,3 +182,15 @@
text-decoration: line-through;
margin-top:10rpx;
}
.guigeitem{
color: rgba(156, 156, 156, 1);
font-size:28rpx;
margin-right:20rpx;
margin-bottom:10rpx;
}
.guige{
display:flex;
flex-wrap: wrap;
align-items: center;
}
... ...
... ... @@ -43,7 +43,9 @@ App({
let postData = data
// let baseUrl = 'https://binhai.w.broing.cn/api';
// let baseUrl ='http://binhaitest.w.brotop.cn/api'
let baseUrl = 'https://binhai.w.broing.cn/api'
// 现在用的
// let baseUrl = 'https://binhai.w.broing.cn/api'
let baseUrl = 'http://binhaitest.w.brotop.cn/api'
//网络请求
wx.request({
url: baseUrl + url,
... ... @@ -54,11 +56,65 @@ App({
'token': wx.getStorageSync('token') || ''
},
success: function (res) { //返回取得的数据
console.log('ssssssssssssssssssssssssssssssssssss',res)
if (res.data.code == '200') {
resolve(res.data)
} else if (res.data.code == '5000') {
wx.hideLoading();
reject(res.data)
// wx.removeStorageSync('token');
wx.removeStorageSync('login');
// wx.navigateTo({
// url: '/pages/register/register?type=1',
// })
} else {
wx.showModal({
title: '提示',
content: res.data.msg,
showCancel: false
})
reject(res.data)
}
setTimeout(function () {
wx.hideNavigationBarLoading()
}, 600)
},
fail: function (e) {
reject('网络出错');
wx.hideNavigationBarLoading()
}
})
});
return promise;
},
// 开放商城公共接口
postk: function (url, data, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data
// let baseUrl = 'https://binhai.w.broing.cn/api';
// let baseUrl ='http://binhaitest.w.brotop.cn/api'
let baseUrl = 'http://binhaidispark.t.brotop.cn/api'
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'token': wx.getStorageSync('token') || ''
},
success: function (res) { //返回取得的数据
if (res.data.code == '1') {
resolve(res.data)
} else if (res.data.code == '5000') {
wx.hideLoading();
reject(res.data)
wx.removeStorageSync('token');
wx.removeStorageSync('login');
// wx.navigateTo({
... ... @@ -85,6 +141,52 @@ App({
return promise;
},
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'http://binhaidispark.t.brotop.cn/api/common/upload';
let head = {
'token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function (res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.url
}
resolve(urlobj);
},
fail: function (res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
return promise;
},
// 获取个人信息
getInfoFun() {
... ... @@ -205,6 +307,7 @@ App({
order_read: '/shop/read', // 订单数
},
globalData: {
login_new:""
login_new:"",
baseUrlimg :'http://binhaidispark.t.brotop.cn/'
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/index/index",
"pages/register/register",
"pages/login/login",
"pages/startindex/startindex",
"pages/zuji/zuji",
"pages/messagedetail/messagedetail",
"pages/message/message",
"pages/shop_cart/shop_cart",
"pages/classify/classify",
"pages/my/my",
"pages/shop_detail/shop_detail",
"pages/order/order",
"pages/Collection/collection",
"pages/order/return_goods/return_goods",
"pages/my/about_us/about_us",
"pages/my/my_integral/my_integral",
"pages/address/address",
"pages/address/edit_address/edit_address",
"pages/address/add_address/add_address",
"pages/search/search",
"pages/search/search_result/search_result",
"pages/order/order_list/order_list",
"pages/order/order_detail/order_detail",
"pages/logistics/logistics",
"pages/notice/notice",
"pages/outerChain/outerChain",
"pages/zhuanqu/zhuanqu",
"pages/taocandetail/taocandetail",
"pages/taocanpay/taocanpay",
"pages/orderdetail/orderdetail",
"pages/xianshi/xianshi"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#3D9AF8",
"navigationBarTitleText": "海创诚品",
"navigationBarTextStyle": "white"
},
"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "商品",
"iconPath": "images/tabbar/icon_75.png",
"selectedIconPath": "images/tabbar/icon_68.png"
},
{
"pagePath": "pages/message/message",
"text": "消息",
"iconPath": "images/tabbar/message.png",
"selectedIconPath": "images/tabbar/messageactive.png"
},
{
"pagePath": "pages/shop_cart/shop_cart",
"text": "购物车",
"iconPath": "images/tabbar/icon_70.png",
"selectedIconPath": "images/tabbar/icon_73.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "images/tabbar/icon_71.png",
"selectedIconPath": "images/tabbar/icon_72.png"
}
],
"selectedColor": "#05091A"
},
"sitemapLocation": "sitemap.json"
"pages": [
"pages/index/index",
"pages/coupon/coupon",
"pages/lingqucoupon/lingqucoupon",
"pages/register/register",
"pages/login/login",
"pages/startindex/startindex",
"pages/zuji/zuji",
"pages/messagedetail/messagedetail",
"pages/message/message",
"pages/shop_cart/shop_cart",
"pages/classify/classify",
"pages/my/my",
"pages/shop_detail/shop_detail",
"pages/order/order",
"pages/Collection/collection",
"pages/order/return_goods/return_goods",
"pages/my/about_us/about_us",
"pages/my/my_integral/my_integral",
"pages/address/address",
"pages/address/edit_address/edit_address",
"pages/address/add_address/add_address",
"pages/search/search",
"pages/search/search_result/search_result",
"pages/order/order_list/order_list",
"pages/order/order_detail/order_detail",
"pages/logistics/logistics",
"pages/notice/notice",
"pages/outerChain/outerChain",
"pages/zhuanqu/zhuanqu",
"pages/taocandetail/taocandetail",
"pages/taocanpay/taocanpay",
"pages/orderdetail/orderdetail",
"pages/xianshi/xianshi",
"pages/coupon",
"pages/pinpaibox/pinpaibox"
],
"subpackages": [
{
"root": "packageA",
"pages": [
"pages/index/index",
"pages/register/register",
"pages/login/login",
"pages/startindex/startindex",
"pages/zuji/zuji",
"pages/messagedetail/messagedetail",
"pages/message/message",
"pages/shop_cart/shop_cart",
"pages/classify/classify",
"pages/my/my",
"pages/shop_detail/shop_detail",
"pages/order/order",
"pages/Collection/collection",
"pages/order/return_goods/return_goods",
"pages/my/about_us/about_us",
"pages/my/my_integral/my_integral",
"pages/address/address",
"pages/address/edit_address/edit_address",
"pages/address/add_address/add_address",
"pages/search/search",
"pages/search/search_result/search_result",
"pages/order/order_list/order_list",
"pages/order/order_detail/order_detail",
"pages/logistics/logistics",
"pages/notice/notice",
"pages/outerChain/outerChain",
"pages/zhuanqu/zhuanqu",
"pages/taocandetail/taocandetail",
"pages/taocanpay/taocanpay",
"pages/orderdetail/orderdetail",
"pages/xianshi/xianshi"
]
}
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#3D9AF8",
"navigationBarTitleText": "海创诚品",
"navigationBarTextStyle": "white"
},
"tabBar": {
"custom": true,
"list": [
{
"pagePath": "pages/index/index",
"text": "商品",
"iconPath": "images/tabbar/icon_75.png",
"selectedIconPath": "images/tabbar/icon_68.png"
},
{
"pagePath": "pages/message/message",
"text": "消息",
"iconPath": "images/tabbar/message.png",
"selectedIconPath": "images/tabbar/messageactive.png"
},
{
"pagePath": "pages/shop_cart/shop_cart",
"text": "购物车",
"iconPath": "images/tabbar/icon_70.png",
"selectedIconPath": "images/tabbar/icon_73.png"
},
{
"pagePath": "pages/my/my",
"text": "我的",
"iconPath": "images/tabbar/icon_71.png",
"selectedIconPath": "images/tabbar/icon_72.png"
}
],
"selectedColor": "#05091A"
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
... ... @@ -66,4 +66,139 @@
width: 0;
height: 0;
color: transparent;
}
\ No newline at end of file
}
.lineprice{
color:#8E8E8E;
text-decoration: line-through;
font-size:28rpx;
margin-left:20rpx;
}
/*优惠券列表 */
.couponpageitem{
width:686rpx;
height:276rpx;
background: linear-gradient(135deg,#d6b17d 1%, #cda263);
border-radius: 8rpx;
margin:24rpx auto 0;
}
.couponpageitem{
display:flex;
align-items: center;
padding: 52rpx 24rpx;
box-sizing: border-box;
}
.finishling{
width:208rpx;
height:46rpx;
font-size: 0;
position: relative;
}
.finishling image{
width:100%;
height: 100%;
}
.coupontop{
display:flex;
}
.couponright{
display:flex;
padding-left: 16rpx;
box-sizing: border-box;
}
.bigmoney{
color:#fff;
font-size: 70rpx;
}
.smalltext{
color:#fff;
font-size: 24rpx;
margin-bottom: 20rpx;
}
.coupontitle{
color:#fff;
font-size: 32rpx;
}
.afterling{
color:#CEA365;
font-size: 22rpx;
position: absolute;
top:8rpx;
right:10rpx;
}
.fullmoney{
color:#fff;
font-size: 28rpx;
margin-top:20rpx
}
.useright{
width: 160rpx;
height: 64rpx;
background: #ffffff;
border-radius: 200rpx;
box-shadow: 0px 16rpx 16rpx 0px rgba(82,48,0,0.17);
color:#CEA467;
font-size: 28rpx;
text-align: center;
line-height: 64rpx;
margin-top:46rpx
}
.rightright{
margin-left:32rpx;
}
.couponleft{
display:flex;
align-items: baseline;
width:99rpx;
position: relative;
padding-right: 10rpx;
/* box-sizing:border-box; */
flex:0 0 auto;
/* border-right:1rpx solid #fff; */
}
.couponleftk{
display:flex;
align-items: baseline;
width:240rpx;
position: relative;
padding-right: 10rpx;
/* box-sizing:border-box; */
flex:0 0 auto;
/* border-right:1rpx solid #fff; */
}
.couponleft::after{
display:block;
content:'';
width:1rpx;
height:104rpx;
background: #ffff;
position: absolute;
top:0;
right:1rpx;
}
.couponleftk::after{
display:block;
content:'';
width:1rpx;
height:104rpx;
background: #ffff;
position: absolute;
top:0;
right:1rpx;
}
.nodata{
color:#999;
font-size:32rpx;
text-align: center;
margin-top:100rpx
}
.flextwo{
display:flex;
align-items: center;
justify-content: space-between;
}
.flexthree{
display:flex;
align-items: center;
justify-content: flex-end;
}
\ No newline at end of file
... ...
let type=wx.getStorageSync('selecttype');
console.log(type,'类型')
Component({
  data: {
    selected: 0,
text:'',
    color: "#7A7E83",
    selectedColor: "#05091A",
    list:[  {
        pagePath: "/packageA/pages/index/index",
        text: "商品",
        iconPath: "/images/tabbar/icon_75.png",
        selectedIconPath: "/images/tabbar/icon_68.png"
      },
      {
        pagePath"/packageA/pages/message/message",
        text"消息",
        iconPath"/images/tabbar/message.png",
        selectedIconPath"/images/tabbar/messageactive.png"
      },
      {
        pagePath"/packageA/pages/shop_cart/shop_cart",
        text"购物车",
        iconPath"/images/tabbar/icon_70.png",
        selectedIconPath"/images/tabbar/icon_73.png"
      },
      {
        pagePath"/packageA/pages/my/my",
        text"我的",
        iconPath"/images/tabbar/icon_71.png",
        selectedIconPath"/images/tabbar/icon_72.png"
      }]
    
  },
  properties{
    selected{
      typeNumber, // 接收父组件传过来的值
      value''
    },
text{
      typeNumber, // 接收父组件传过来的值
      value''
    },
list{
      type:Array, // 接收父组件传过来的值
      value''
    },
  },
  attached() {
  },
onLoad(){
},
onShow: function(){
console.log(this.data.text,'我是text')
if(this.data.text==1){
this.setData({
list:[
      {
        pagePath: "/pages/index/index",
        text: "商品",
        iconPath: "/images/tabbar/icon_75.png",
        selectedIconPath: "/images/tabbar/icon_68.png"
      },
      {
        pagePath"/pages/message/message",
        text"消息",
        iconPath"/images/tabbar/message.png",
        selectedIconPath"/images/tabbar/messageactive.png"
      },
      {
        pagePath"/pages/shop_cart/shop_cart",
        text"购物车",
        iconPath"/images/tabbar/icon_70.png",
        selectedIconPath"/images/tabbar/icon_73.png"
      },
      {
        pagePath"/pages/my/my",
        text"我的",
        iconPath"/images/tabbar/icon_71.png",
        selectedIconPath"/images/tabbar/icon_72.png"
      }
    ]
})
}else{
this.setData({
list:[
      {
        pagePath: "/packageA/pages/index/index",
        text: "商品",
        iconPath: "/images/tabbar/icon_75.png",
        selectedIconPath: "/images/tabbar/icon_68.png"
      },
      {
        pagePath: "/packageA/pages/message/message",
        text: "消息",
        iconPath: "/images/tabbar/message.png",
        selectedIconPath: "/images/tabbar/messageactive.png"
      },
      {
        pagePath"/packageA/pages/shop_cart/shop_cart",
        text"购物车",
        iconPath"/images/tabbar/icon_70.png",
        selectedIconPath"/images/tabbar/icon_73.png"
      },
      {
        pagePath"/packageA/pages/my/my",
        text"我的",
        iconPath"/images/tabbar/icon_71.png",
        selectedIconPath"/images/tabbar/icon_72.png"
      }
    ]
})
}
},
  methods{
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path;
console.log('343434734783489743',this.data.text)
if(this.data.text==1){
console.log(38434477)
 wx.switchTab({url})
}else{
console.log(url)
 wx.redirectTo({url})
}
     
    }
  },
})
\ No newline at end of file
... ...
{
"component": true
}
\ No newline at end of file
... ...
<view class="tab-bar">
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image>
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
</view>
</view>
... ...
.tab-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 48px;
background: white;
display: flex;
padding-bottom: env(safe-area-inset-bottom);
}
.tab-bar-border {
background-color: rgba(0, 0, 0, 0.33);
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 1px;
transform: scaleY(0.5);
}
.tab-bar-item {
flex: 1;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: relative;
}
.tab-bar-item image {
width: 27px;
height: 27px;
}
.tab-bar-item view {
font-size: 10px;
}
.connect{
width:240rpx!important;
height:100rpx;
position: absolute;
top:0;
left:0;
background: transparent;
padding: none!important;
}
... ...
packageA @ 6c945b2a
Subproject commit 6c945b2a1d4ad579bd4db8e826b02097a3a32ef0
... ...
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
check_num: 0, //选中数量
checkAll: false, //全选状态
check_str: ''
check_str: '',
list:[],
page:1
},
//改变商品状态
check_type(e) {
... ... @@ -48,9 +49,9 @@ Page({
for (let obj of list) {
if (obj.check_type) {
if (check_str == ""){
check_str = obj.id
check_str = obj.goods_id
} else {
check_str = check_str + ',' + obj.id
check_str = check_str + ',' + obj.goods_id
}
}
}
... ... @@ -59,6 +60,7 @@ Page({
})
},
delete_item(){
let that=this;
if (this.data.check_str == ""){
wx.showToast({
title: '请先选中商品',
... ... @@ -67,29 +69,41 @@ Page({
})
return
}
let url = app.interface.collectdel
let url = '/goods/collect'
let params = {
ids: this.data.check_str
goods_ids: this.data.check_str
}
app.post(url,params).then((res)=>{
app.postk(url,params).then((res)=>{
wx.showToast({
title: '删除成功',
title: '取消收藏成功',
duration: 1000
})
this.get_info()
setTimeout(function(){
that.setData({
page:1,
list:[]
})
that.get_info()
},1500)
})
},
//获取页面信息
get_info() {
let that=this;
wx.showLoading({
title: '加载中'
})
let that = this
let url = app.interface.collectList
app.post(url, {}).then((res) => {
let url = '/goods/get_collect_list'
let param={
page:that.data.page,
pageNum:10
}
app.postk(url,param).then((res) => {
wx.hideLoading()
that.setData({
list: res.msg
list: that.data.list.concat(res.data)
})
})
},
... ... @@ -141,7 +155,12 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.get_info()
},
/**
... ...
... ... @@ -8,5 +8,5 @@
<image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" />
<text>全选</text>
</view>
<view class="del" catchtap="delete_item">删除</view>
<view class="del" catchtap="delete_item">取消收藏</view>
</view>
\ No newline at end of file
... ...
... ... @@ -7,9 +7,12 @@ Page({
data: {
name: '',
tel: '',
area: '',
area: '请选择所在地区',
address: '',
mr: 0
mr: 2,
province_id:'',
city_id:'',
county_id:''
},
/**
... ... @@ -41,8 +44,12 @@ Page({
},
bindRegionChange(e) {
console.log(e)
this.setData({
area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2]
area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2],
province_id:e.detail.value[0] ,
city_id:e.detail.value[1] ,
county_id:e.detail.value[2] ,
})
},
... ... @@ -54,7 +61,7 @@ Page({
})
} else {
this.setData({
mr: 0
mr: 2
})
}
},
... ... @@ -62,14 +69,53 @@ Page({
// 保存地址
addFun() {
let t = this;
let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/;
let u = a.interface.addaddress;
let AuglyTest_phone = /^1[3456789]\d{9}$/;
let u = '/address/add';
if(t.data.name==''){
wx.showToast({
title: '请输入收货人',
icon:'none'
})
return false
}
if(t.data.tel==''){
wx.showToast({
title: '请输入手机号',
icon:'none'
})
return false
}
if(t.data.tel!=''){
if (!(/^1[3456789]\d{9}$/.test(t.data.tel))) {
wx.showToast({
title: '请输入正确手机号',
icon: 'none'
})
return false;
}
}
if(t.data.province_id==''){
wx.showToast({
title: '请选择所在地区',
icon:'none'
})
return false
}
if(t.data.address==''){
wx.showToast({
title: '请输入详情地址',
icon:'none'
})
return false
}
let d = {
tel: t.data.tel,
mobile: t.data.tel,
name: t.data.name,
area: t.data.area,
province_id:t.data.province_id,
city_id:t.data.city_id,
county_id:t.data.county_id,
address: t.data.address,
mo: t.data.mr
is_default: t.data.mr
}
if (d.name == '') {
wx.showToast({
... ... @@ -83,7 +129,7 @@ Page({
icon: 'none',
duration: 1300
})
} else if (!AuglyTest_phone.test(d.tel)) {
} else if (!AuglyTest_phone.test(d.mobile)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
... ... @@ -103,8 +149,8 @@ Page({
})
} else {
a.post(u, d).then((r) => {
if (r.code == 200) {
a.postk(u, d).then((r) => {
if (r.code == 1) {
wx.showToast({
title: '保存成功',
icon: 'none',
... ... @@ -129,7 +175,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
... ...
... ... @@ -16,17 +16,25 @@ Page({
// 获取地址列表
getListFun() {
let t = this;
let u = a.interface.address
a.post(u, {}).then((r) => {
if (r.code == 200) {
t.setData({
list: r.msg,
check: true
})
if (r.msg.length == 0){
wx.setStorageSync('no_address', true)
}
}
let u = '/address/get_list'
let param={
page:1,
pageNum:10
}
a.postk(u,param).then((r) => {
t.setData({
list: r.data,
check: true
})
// if (r.code == 200) {
// t.setData({
// list: r.msg,
// check: true
// })
// if (r.msg.length == 0){
// wx.setStorageSync('no_address', true)
// }
// }
}).catch((er) => {
})
},
... ... @@ -51,58 +59,98 @@ Page({
// 设置默认地址
mrAddressFun(e) {
let t = this
let that = this
let index = e.currentTarget.dataset.index
let u = a.interface.mraddress;
let u = '/address/setting_default';
let d = {
id: e.currentTarget.dataset.id,
mo: 1
}
a.post(u, d).then((r) => {
if (r.code == 200) {
t.setData({
[`list[${index}].check`]: true
a.postk(u, d).then((r) => {
console.log('34u349',r)
let newlist=that.data.list;
if(newlist[index].is_default==2){
newlist[index].is_default=1
wx.showToast({
title: '设置默认地址成功',
icon: 'none',
duration: 1300
})
}else{
newlist[index].is_default=2;
wx.showToast({
title: '设置成功',
title: '取消默认地址成功',
icon: 'none',
duration: 1300
})
setTimeout(() => {
t.getListFun()
}, 1300)
}
that.setData({
page:1,
lsit:[]
})
that.getListFun()
// that.setData({
// list:newlist
// })
// if (r.code == 1) {
// t.setData({
// [`list[${index}].check`]: true
// })
// setTimeout(() => {
// t.getListFun()
// }, 1300)
// }
}).catch((er) => {
})
},
// 修改地址
editAddressFun(e) {
let item=e.currentTarget.dataset.item;
item=JSON.stringify(item)
wx.navigateTo({
url: '/pages/address/edit_address/edit_address?id=' + e.currentTarget.dataset.id,
url: '/pages/address/edit_address/edit_address?id=' + e.currentTarget.dataset.id+'&item='+item,
})
},
// 删除地址
delAddressFun(e) {
let t = this;
let u = a.interface.deladdress;
let d = {
id: e.currentTarget.dataset.id
}
a.post(u, d).then((r) => {
if (r.code == 200) {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 1300
wx.showModal({
title: '提示',
content: '是否删除该地址',
success (res) {
if (res.confirm) {
let u = '/address/del';
let d = {
id: e.currentTarget.dataset.id
}
a.postk(u, d).then((r) => {
if (r.code ==1) {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 1300
})
setTimeout(() => {
t.setData({
page:1,
list:[]
})
t.getListFun()
}, 1300)
}
}).catch((er) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
setTimeout(() => {
t.getListFun()
}, 1300)
}
}).catch((er) => {
})
},
// 新增地址
... ... @@ -123,6 +171,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getListFun()
},
... ...
... ... @@ -10,11 +10,11 @@
</view>
<view class="btn_box">
<view class="check" data-id="{{item.id}}" data-index="{{index}}" wx:if="{{item.mo != 1}}" catchtap="mrAddressFun">
<image wx:if="{{!item.check}}" src="/images/check.png" />
<image wx:if="{{item.is_default==2}}" src="/images/check.png" />
<image wx:else src="/images/check@.png" /> 设为默认地址
</view>
<block>
<view class="btn_item" data-id="{{item.id}}" catchtap="editAddressFun">
<view class="btn_item" data-id="{{item.id}}" catchtap="editAddressFun" data-item="{{item}}">
<image src="/images/icon_60.png" style="width: 26rpx;height: 26rpx;" />编辑
</view>
<view class="btn_item" data-id="{{item.id}}" catchtap="delAddressFun">
... ...
... ... @@ -10,16 +10,35 @@ Page({
tel: '',
area: '',
address: '',
mr: 0,
mr: 2,
id: 0,
mo: false
mo: false,
addressid:'',
addressitem:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getInfoFun(options.id)
let item=JSON.parse(options.item)
this.setData({
id: options.id,
tel: item.mobile,
name: item.name,
province_id:item.province_name,
city_id:item.city_name,
county_id:item.county_name,
address: item.address,
mr: item.is_default,
mo:item.is_default==1?true:false,
area:item.province_name+item.city_name+item.county_name
})
console.log(item)
// this.getInfoFun(options.id)
},
// 获取地址详情
... ... @@ -79,7 +98,10 @@ Page({
// area: e.detail.value[0] + e.detail.value[1] + e.detail.value[2]
// })
this.setData({
area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2]
area: e.detail.value[0] + ' ' + e.detail.value[1] + ' ' + e.detail.value[2],
province_id:e.detail.value[0],
city_id:e.detail.value[1],
county_id:e.detail.value[2]
})
},
... ... @@ -91,7 +113,7 @@ Page({
})
} else {
this.setData({
mr: 0
mr: 2
})
}
},
... ... @@ -102,11 +124,13 @@ Page({
let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/;
let u = a.interface.editaddress;
let d = {
tel: t.data.tel,
mobile: t.data.tel,
name: t.data.name,
area: t.data.area,
address: t.data.address,
mo: t.data.mr,
province_id: t.data.province_id,
city_id: t.data.city_id,
county_id:t.data.county_id,
is_default: t.data.mr,
address:t.data.address,
id: t.data.id
}
if (d.name == '') {
... ... @@ -115,13 +139,13 @@ Page({
icon: 'none',
duration: 1300
})
} else if (d.tel == '') {
} else if (d.mobile == '') {
wx.showToast({
title: '请输入手机号',
icon: 'none',
duration: 1300
})
} else if (!AuglyTest_phone.test(d.tel)) {
} else if (!AuglyTest_phone.test(d.mobile)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
... ... @@ -140,8 +164,8 @@ Page({
duration: 1300
})
} else {
a.post(u, d).then((r) => {
if (r.code == 200) {
a.postk(u, d).then((r) => {
if (r.code == 1) {
wx.showToast({
title: '保存成功',
icon: 'none',
... ...
... ... @@ -103,7 +103,7 @@ page {
margin-top:2rpx;
}
.shezhimo{
width:175rpx;
width:191rpx;
}
... ...
... ... @@ -9,14 +9,102 @@ Page({
taocan:false,
page:1,
taocanlist:[],
remain:true
remain:true,
page:1,
good_arr:[],
taocanpage:1,
kindshow:true,
// 品牌
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","*"],
cityListId: '',
//下面是城市列表信息,这里只是模拟数据
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": "张家口" }] }],
//下面是热门城市数据,模拟数据
newcity: ['北京', '上海', '广州', '深圳', '成都', '杭州'],
// citySel: '全国',
locateCity: '',
len:''
},
// 种类和品牌切换
selkind(){
this.setData({
kindshow:true
})
},
selpinpai(){
this.setData({
kindshow:false
})
},
//点击进入商品列表
cityTap(e) {
console.log(e)
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/pinpaibox/pinpaibox?pinpaiid='+id,
})
},
//点击城市字母
letterTap(e) {
const Item = e.currentTarget.dataset.item;
console.log(Item)
if(Item=='*'){
this.setData({
scrollHeight: this.data.len
});
}
this.setData({
cityListId: Item
});
console.log("..............."+this.data.cityListId);
},
//调用定位
getLocate() {
let that = this;
new qqmap().getLocateInfo().then(function (val) {//这个方法在另一个文件里,下面有贴出代码
console.log(val);
if (val.indexOf('市') !== -1) {//这里是去掉“市”这个字
console.log(val.indexOf('市') - 1);
val = val.slice(0, val.indexOf('市'));
console.log(val);
}
that.setData({
locateCity: val
});
//把获取的定位和获取的时间放到本地存储
wx.setStorageSync('locatecity', { city: val, time: new Date().getTime() });
});
},
// 获取品牌列表
getpinpailist(){
let that = this
let url = '/sundry/get_brand'
let params = {
type:2
}
app.postk(url,params).then((res) => {
console.log(res)
that.setData({
citylist:res.data,
})
let len = res.data.length;
len=len*542;
this.setData({
len:len
})
})
},
//查看更多
look_more(e){
let pid = e.currentTarget.dataset.id
let title = e.currentTarget.dataset.title
wx.navigateTo({
url: '/pages/search/search_result/search_result?title=' + title + '&pid=' + pid
url: '/pages/search/search_result/search_result?title=' + title + '&category_id2=' + pid
})
},
//查看商品详情
... ... @@ -45,8 +133,12 @@ Page({
taocan:false,
remain:true
})
this.setData({
page:1,
good_arr:[]
})
this.good_list(e.currentTarget.dataset.id)
},
... ... @@ -57,11 +149,11 @@ Page({
title: '加载中'
})
let that = this
let url = app.interface.index
let url = '/sundry/get_category'
let params = {
pid: 0
}
app.post(url, params).then((res) => {
app.postk(url).then((res) => {
wx.hideLoading()
// let obj={
// id:'',
... ... @@ -69,9 +161,9 @@ Page({
// }
// res.msg.push(obj)
that.setData({
nav_arr: res.msg
nav_arr: res.data
})
that.good_list(res.msg[0].id)
that.good_list(res.data[0].id)
})
},
//获取商品列表
... ... @@ -80,14 +172,16 @@ Page({
title: '加载中',
})
let that = this
let url = app.interface.getPid
let url = '/sundry/get_category_goods'
let params = {
pid: pid
category_id: pid,
page:that.data.page,
pageNum:6
}
app.post(url, params).then((res) => {
app.postk(url, params).then((res) => {
wx.hideLoading()
this.setData({
good_arr: res.msg
good_arr:res.data
})
})
},
... ... @@ -108,16 +202,16 @@ Page({
title: '加载中',
})
let that = this
let url = '/combo/get_all'
let url = '/combo/get_list'
let params = {
page:that.data.page,
page:that.data.taocanpage,
pageNum:10
}
app.post(url, params).then((res) => {
app.postk(url, params).then((res) => {
console.log(res)
wx.hideLoading()
this.setData({
taocanlist:that.data.taocanlist.concat(res.msg)
taocanlist:that.data.taocanlist.concat(res.data)
})
console.log(that.data.taocanlist)
})
... ... @@ -149,8 +243,19 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type==1){
this.setData({
kindshow:true
})
}else{
this.setData({
kindshow:false
})
}
this.get_info();
this.gettaocan()
this.gettaocan();
// 获取品牌
this.getpinpailist()
},
/**
... ... @@ -164,7 +269,8 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.get_shopnum()
this.get_shopnum();
},
/**
... ... @@ -192,10 +298,10 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
let newpage=this.data.gettaocan;
newpage++;
this.setData({
page:newpage
gettaocan:newpage
})
this.gettaocan()
... ...
<view class='page'>
<view class='top'>
<navigator class='search_box' url="/pages/search/search">
<view class='search_icon'>
<image src='/images/search.png'></image>
</view>
<input class='real_search' placeholder='搜索您想要的商品' disabled="true" />
</navigator>
</view>
<view class='center'>
<!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->
<view class='center_child flexone'>
<view class='left'>
<view class='left_item {{status == index?"active":""}}' id='Nav{{index}}' wx:for='{{nav_arr}}' wx:key='index' bindtap='{{item.id!=""?"click_category":"seltaocan"}}' data-index='{{index}}' data-id='{{item.id}}'>{{item.name}}</view>
<view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view>
</view>
<!-- <view class='fake_left'></view> -->
<view class='right' wx:if="{{remain}}">
<view class='right_item' id='NAV{{index}}' wx:for='{{good_arr}}' wx:key='index' wx:if="{{good_arr[index].products.length>0}}">
<view class='right_item_top'>
<view class='right_left'>{{item.title}}</view>
<text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}" data-title="{{item.title}}">查看全部&ensp;&gt;</text>
</view>
<view class='right_goods'>
<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">
<view class='goods_img'>
<image src='{{zitem.image}}'></image>
</view>
<view class='goods_name'>{{zitem.name}}</view>
</view>
</view>
</view>
</view>
<view class="pinlist">
<view class="pinitem {{kindshow==true?'pinitemactive':''}}" bindtap="selkind">分类</view>
<view class="pinitem {{kindshow==false?'pinitemactive':''}}" bindtap="selpinpai">品牌</view>
</view>
<!-- 分类 -->
<view class='page' wx:if="{{kindshow}}">
<view class='top'>
<navigator class='search_box' url="/pages/search/search">
<view class='search_icon'>
<image src='/images/search.png'></image>
</view>
<input class='real_search' placeholder='搜索您想要的商品' disabled="true" />
</navigator>
</view>
<view class='center'>
<!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->
<view class='center_child flexone'>
<view class='left'>
<view class='left_item {{status == index?"active":""}}' id='Nav{{index}}' wx:for='{{nav_arr}}' wx:key='index' bindtap='{{item.id!=""?"click_category":"seltaocan"}}' data-index='{{index}}' data-id='{{item.id}}'>{{item.name}}</view>
<view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view>
</view>
<!-- <view class='fake_left'></view> -->
<view class='right' wx:if="{{remain}}">
<view class="nodata" wx:if="{{good_arr.length==0}}">暂无数据</view>
<view wx:else>
<view class='right_item' id='NAV{{index}}' wx:for='{{good_arr}}' wx:key='index'>
<!-- wx:if="{{good_arr[index].products.length>0}}" -->
<view class='right_item_top'>
<view class='right_left'>{{item.name}}</view>
<text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}" data-title="{{item.name}}">查看全部&ensp;&gt;</text>
</view>
<view class='right_goods'>
<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">
<view class='goods_img'>
<image src='{{zitem.image}}'></image>
</view>
<view class='goods_name'>{{zitem.name}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="right" wx:else>
<view clas="nodata" wx:if="{{taocanlist.length==0}}">暂无数据</view>
<view class="right_item" wx:else>
<view class='right_goods'>
<view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}" catchtap="look_detailk">
<view class='goods_img'>
<image src='{{item.image}}'></image>
</view>
<view class='goods_name'>{{item.name}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- </scroll-view> -->
</view>
</view>
<!-- 品牌 -->
<view class='city_box' wx:else>
<view class='city_left'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}' scroll-top="{{scrollHeight}}">
<view class="right" wx:else>
<view class="right_item">
<view class='right_goods'>
<view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}" catchtap="look_detailk">
<view class='goods_img'>
<image src='{{item.image}}'></image>
</view>
<view class='goods_name'>{{item.name}}</view>
</view>
</view>
</view>
</view>
<view class='city_list_box'>
<block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
<view class='city_first_letter' id='{{letterItem.letter}}'>{{letterItem.letter}}</view>
<view class="citybox">
<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}}">
<view class='goods_img'>
<image src='{{item.image}}'></image>
</view>
<view class='goods_name'>{{item.name}}</view>
</view>
</view>
</view>
<!-- </scroll-view> -->
</view>
</block>
</view>
</scroll-view>
</view>
<view class='city_right'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation >
<text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
</scroll-view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -51,7 +51,6 @@ page {
width: 100%;
height: 100%;
}
.real_search {
display: inline-block;
height: 100%;
... ... @@ -112,7 +111,7 @@ page {
.left_item {
width: 100%;
height: 101rpx;
/* height: 101rpx; */
text-align: center;
line-height:100rpx;
font-size: 30rpx;
... ... @@ -125,7 +124,7 @@ page {
.left_item.active {
background: #f9f9f9;
border: 0;
height: 100rpx;
/* height: 100rpx; */
color: rgba(61, 154, 248, 1);
position: relative;
}
... ... @@ -223,4 +222,119 @@ page {
flex-direction: column;
justify-content: center;
align-items: center
}
\ No newline at end of file
}
.pinlist{
display:flex;
justify-content: center;
align-items: center;
width:100%;
padding: 20rpx;
box-sizing: border-box;
}
.pinitem:nth-child(2){
margin-left:140rpx
}
.pinitem{
color:#333;
font-size: 28rpx;
}
.pinitemactive{
position: relative;
color: rgba(61, 154, 248, 1);
}
.pinitemactive::after{
content: '';
display:block;
width: 100rpx;
height: 1rpx;
background: rgba(61, 154, 248, 1);
position: absolute;
/* left: 50%;
transform: translateX(-50%); */
bottom:-20rpx;
left:0;
}
/* 品牌样式 */
.city_box{
height:100%;
background: #fff;
display: flex;
}
.city_left{
flex: 1;
margin-bottom:120rpx
}
.city_right{
width: 60rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
overflow-y: scroll;
}
.letter_item{
flex: 1;
display: block;
font-size: 24rpx;
color: #33B9FF;
text-align: center;
}
.city_locate,.national{
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #efefef;
font-size: 28rpx;
color: #333;
padding-left: 25rpx;
}
.city_locate_title{
color: #999;
margin-right: 20rpx;
}
.new_city{
background: #efefef;
font-size: 28rpx;
}
.new_city_title{
line-height: 50rpx;
color: #999;
padding-left: 25rpx;
margin-bottom: 20rpx;
}
.new_city_box{
display: flex;
flex-wrap: wrap;
}
.new_city_text{
width: 200rpx;
text-align: center;
line-height: 70rpx;
background: #fff;
border-radius: 35rpx;
margin:0 0 22rpx 22rpx;
}
.city_first_letter{
line-height: 40rpx;
height: 40rpx;
padding-left: 25rpx;
font-size: 28rpx;
background: #eee;
color: #999;
}
.city_name{
display: block;
font-size: 28rpx;
color: #333;
margin-right: 47rpx;
margin-bottom:30rpx;
}
.city_name:nth-child(4n){
margin-right:0
}
.citybox{
display:flex;
align-items: center;
flex-wrap: wrap;
padding: 15rpx 32rpx;
box-sizing: border-box;
}
\ No newline at end of file
... ...
// pages/coupon.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/coupon.wxml-->
<text>pages/coupon.wxml</text>
... ...
/* pages/coupon.wxss */
\ No newline at end of file
... ...
// pages/coupon/coupon.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
status:1,
goods_id:'',
couponlist:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
goods_id:options.goods_id,
type:options.type
})
if(options.type==1){
this.getcoupon()
}else if(options.type==2){
this.getordercoupon()
}
},
getcoupon(){
let that=this;
let url = '/ticket/goods_ticket'
let param={
goods_id:that.data.goods_id
}
app.postk(url, param).then((res) => {
console.log(res)
that.setData({
couponlist:res.data
})
})
},
getordercoupon(){
let that=this;
let url = '/ticket/order_ticket'
let param={
}
app.postk(url, param).then((res) => {
console.log(res)
that.setData({
couponlist:res.data
})
})
},
selcoupon(e){
console.log(48344834)
this.status=e.currentTarget.dataset.id;
this.page=1;
// this.couponlist=[];
// this.getmycoupon();
},
lingqu(e){
let id=e.currentTarget.dataset.id;
let that=this;
let url = '/ticket/get_ticket1'
let param={
user_ticket_id:id
}
app.postk(url, param).then((res) => {
console.log(res)
wx.showToast({
title: '领取成功',
icon:'none'
})
setTimeout(function(){
if(that.data.type==1){
that.getcoupon()
}else if(that.data.type==2){
that.getordercoupon()
}
},1000)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "领取优惠券"
}
\ No newline at end of file
... ...
<view class="boxb">
<!-- <view class="xnavbox">
<view class="xnavitem" :class="status==1?'xactive':''" bindtap="selcoupon" :data-id="1">
已使用
</view>
<view class="xnavitem status==2?'xactive':''" bindtap="selcoupon" :data-id="2">
未使用
</view>
</view> -->
<!-- <view class="couponpage" wx:else>
<view class="bitem item.status!=1?'borderactive':''" wx:for="{{couponlist}}" wx:key="index">
<view class="top">
<view class="price">¥{{item.discounts_price}}</view>
<view class="right">
<view class="bname">
<text>{{item.name}}</text>
</view>
<view class="tips" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
<view class="tips" wx:if="{{item.ticket_type==2}}">折扣{{item.discount}}</view>
</view>
</view>
<view class="btime">
<view class="lingbtn" bindtap="lingqu" data-id="{{item.id}}">领取</view>
</view>
</view>
</view> -->
<view class="nodata" wx:if="{{couponlist.length==0}}">暂无数据</view>
<view class="couponpage" wx:else>
<view class="couponpageitem" wx:for="{{couponlist}}" wx:key="index">
<view class="coupontop">
<view class="couponleft" wx:if="{{item.ticket_type==1}}">
<view class="bigmoney">{{item.discounts_price}}</view>
<view class="smalltext">元</view>
</view>
<view class="couponleft" wx:if="{{item.ticket_type==1}}">
<view class="bigmoney">{{item.discount}}</view>
<view class="smalltext">折</view>
</view>
<view class="couponright">
<view class="rightleft">
<view class="coupontitle">{{item.name}}</view>
<view class="fullmoney" wx:if="{{item.ticket_type==2}}">满{{item.full_price}}元可用</view>
</view>
<view class="rightright">
<view class="finishling">
<image src="/images/manjian.png"></image>
<view class="afterling">领取后30天过期</view>
</view>
<view class="useright" bindtap="lingqu" data-id="{{item.id}}">立即领取</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
background: #F7F7F7;
}
.navboxk{
padding: 0 32rpx;
box-sizing: border-box;
}
.quanbox {
margin-top: 20rpx;
}
.navbox {
height: 88rpx;
background: #fff;
display: flex;
}
.navitem {
width: 50%;
height: 100%;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(35, 35, 35, 1);
display: flex;
align-items: center;
justify-content: center;
}
.selactive {
color: #FF9417;
font-weight: bold;
}
.boxa {
margin-top: 16rpx;
background: #fff;
overflow: hidden;
padding: 0 36rpx;
box-sizing: border-box;
}
.aitem {
height: 150rpx;
border-bottom: 1px solid #FEFEFE;
display: flex;
align-items: center;
justify-content: space-between;
}
.left {
width: 340rpx;
}
.left .name {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(35, 35, 35, 1);
}
.left .time {
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 94, 100, 1);
margin-top: 8rpx;
}
.btn {
width: 160rpx;
height: 64rpx;
border-radius: 8rpx;
border: 1px solid rgba(255, 148, 23, 1);
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 148, 23, 1);
display: flex;
align-items: center;
justify-content: center;
}
.activeA {
color: #BDC4CE;
border-color: #BDC4CE;
}
.boxb {
padding: 0 32rpx;
box-sizing: border-box;
}
.xnavbox {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 16rpx;
}
.xnavitem {
width: 212rpx;
height: 62rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 69, 76, 1);
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.xactive {
background: #C29445;
color: #fff;
}
.container {
margin-top: 12rpx;
}
.bitem {
margin-top: 16rpx;
border-left: 8rpx solid #3D9AF8;
padding: 40rpx 32rpx 20rpx;
box-sizing: border-box;
background: #fff;
}
.top {
height: 156rpx;
border-bottom: 1px solid #EEEEEE;
display: flex;
align-items: center;
}
.price {
font-size: 72rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #3D9AF8;
margin-right: 32rpx;
}
.lingbtn{
width:140rpx;
height:60rpx;
color:#fff;
font-size: 28rpx;
background: #3D9AF8;
border-radius: 20rpx;
text-align: center;
line-height: 60rpx;
}
.right {
width: 100%;
}
.bname {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 94, 100, 1);
}
.bname text:first-child {
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: rgba(6, 18, 32, 1);
}
.tips {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 68, 76, 1);
margin-top: 16rpx;
}
.btime {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 69, 76, 1);
margin-top: 40rpx;
display:flex;
justify-content: flex-end;
}
.borderactive {
/* border-color: #BDC4CE; */
}
.wordacticve {
font-weight: 500 !important;
color: rgba(189, 196, 206, 1) !important;
}
/* 暂无数据 */
.couponleft{
/* height: 104rpx; */
/* border-right:1px solid #fff; */
padding-right: 16rpx;
box-sizing: border-box;
position: relative;
display:flex;
align-items: flex-end;
}
.couponleft::after{
display:block;
content:'';
width:1rpx;
height:126rpx;
background: #fff;
position: absolute;
right:0;
top:0
}
.nodata {
color: #999;
font-size: 32rpx;
text-align: center;
margin-top: 30rpx;
}
... ...
... ... @@ -30,71 +30,241 @@ Page({
status1: '',
status2: '',
title2: '',
scrollTop:'',
pid:''
scrollTop: '',
pid: '',
logok: '',
selected: 0,
list: [{
pagePath: "/pages/index/index",
text: "商品",
iconPath: "/images/tabbar/icon_75.png",
selectedIconPath: "/images/tabbar/icon_68.png"
},
{
pagePath: "/pages/message/message",
text: "消息",
iconPath: "/images/tabbar/message.png",
selectedIconPath: "/images/tabbar/messageactive.png"
},
{
pagePath: "/pages/shop_cart/shop_cart",
text: "购物车",
iconPath: "/images/tabbar/icon_70.png",
selectedIconPath: "/images/tabbar/icon_73.png"
},
{
pagePath: "/pages/my/my",
text: "我的",
iconPath: "/images/tabbar/icon_71.png",
selectedIconPath: "/images/tabbar/icon_72.png"
}
],
category_id1: '',
sort: '',
keyword: '',
shop_arr: [],
pricesheng: false,
xiaoliang: false,
pinpailist: [],
seltui: 0,
isyouzhi:0
},
// 选择推荐列表
selitem(e) {
console.log(e)
let index = e.currentTarget.dataset.index;
this.setData({
seltui: index
})
},
// 进入商品列表
cityTap(e) {
console.log(e)
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/pinpaibox/pinpaibox?pinpaiid=' + id,
})
},
gopinpai() {
let token = wx.getStorageSync("token")
if (token == '') {
wx.showModal({
title: '提示',
content: '请先登录',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
}
})
return false
}
wx.navigateTo({
url: '/pages/classify/classify?type=' + 2,
})
},
scroll(e) {
// console.log(e.detail.scrollTop)
// if (e.detail.scrollTop >300){
// console.log(8888)
// this.setData({
// stick:1
// })
// }else{
// this.setData({
// stick:0
// })
// }
console.log(e)
console.log(e.detail.scrollTop)
if (e.detail.scrollTop >600){
console.log(8888)
this.setData({
stick:1
})
}else{
this.setData({
stick:0
})
}
// console.log(this.data.stick)
},
// 公告详情
noticedetail(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../notice/notice?notice_id=' + id,
})
},
onLoad: function(options) {
console.log( app.globalData.index)
if( app.globalData.index==undefined){
let that = this;
let token=wx.getStorageSync('token');
// 进入劳保商城
laobao() {
let token = wx.getStorageSync('token');
console.log(token)
if (token == '') {
wx.showToast({
title: '请先登录',
icon: 'none',
duration: 1300
})
setTimeout(function () {
wx.navigateTo({
url: '/pages/register/register',
})
}, 1300)
} else {
wx.setStorageSync('selecttype', 2)
wx.showLoading({
title: '加载中',
console.log('woshitoe',token);
if(token!=""){
console.log(9999)
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867',this.data.pid)
if(this.data.pid){
this.get_info(this.data.pid, 2);
}else{
this.get_info(0, 1);
}
})
setTimeout(function () {
wx.navigateTo({
url: '/packageA/pages/index/index',
})
}, 3000)
}
},
onLoad: function (options) {
console.log(app.globalData.index)
if (app.globalData.index == undefined) {
let that = this;
let token = wx.getStorageSync('token');
console.log('woshitoe', token);
if (token != "") {
console.log(9999)
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867', this.data.pid)
// if(this.data.pid){
// this.get_info(this.data.pid, 2);
// }else{
// this.get_info(0, 1);
// }
// 获取活动专区
this.getzhuanqulist();
this.getxianshi();
setTimeout(function () {
that.setData({
showtime: true
})
}, 990)
// 获取活动专区
this.getzhuanqulist();
this.getxianshi();
setTimeout(function() {
that.setData({
showtime: true
})
}, 990)
}
//控制显示隐藏
this.ishow()
this.getpinpailist()
}
//控制显示隐藏
this.ishow()
// 我写的项目
},
// 获取一级分类
getonkind() {
let that = this;
let url = "/sundry/get_category"
app.postk(url, {}).then((r) => {
console.log('商品分类', r)
let obj = {
name: '首页',
id: '',
description:"优质推荐"
}
r.data.unshift(obj)
r.data.forEach(function (value, index, array) {
if (value.description == '') {
value.description = '暂无描述'
}
})
that.setData({
nav_arr: r.data,
})
// 获取商品列表
that.getyouzhi()
})
},
// 获取优质推荐列表
getyouzhi() {
let that = this;
let url = '/activity/get_detail2'
let param = {
activity_id: '',
order: '',
page: this.data.page,
pageNum: 10
}
app.postk(url, param).then((res) => {
if (that.data.page > 1) {
if (res.data.length == 0) {
wx.showToast({
title: '没有更多了~',
icon: 'none'
})
} else {
this.setData({
shop_arr: that.data.shop_arr.concat(res.data)
})
}
} else {
this.setData({
shop_arr: that.data.shop_arr.concat(res.data)
})
}
console.log(that.data.shop_arr, '轮播图')
})
},
// 获取个人信息
getInfoFun() {
let that= this;
let that = this;
let u = app.interface.readteacher;
app.post(u, {}).then((r) => {
console.log('3489523498',r)
app.post(u, {}).then((r) => {
console.log('3489523498', r)
if (r.code == 200) {
app.globalData.login_new=r.msg.login_new;
app.globalData.login_new = r.msg.login_new;
app.globalData.status = r.msg.status;
console.log(app.globalData.status)
// t.setData({
... ... @@ -114,43 +284,31 @@ if( app.globalData.index==undefined){
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
}else{
let login_new=wx.getStorageSync("login");
if(login_new==0){
// wx.showToast({
// title: '您还不是会员',
// icon:"none"
// })
// setTimeout(function(){
// wx.navigateTo({
// url: '/pages/login/login',
// })
// },1500)
// return false
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
} else {
let login_new = wx.getStorageSync("login");
// if(login_new==0){
// wx.showModal({
// title: '提示',
// content: '您还不是会员',
// success(res) {
// if (res.confirm) {
// wx.navigateTo({
// url: '/pages/login/login',
// })
// } else if (res.cancel) {
// }
// }
// })
// return false
// }
wx.navigateTo({
url: '/pages/xianshi/xianshi?title2='+this.data.title2,
url: '/pages/xianshi/xianshi?title2=' + this.data.title2,
})
}
... ... @@ -228,7 +386,7 @@ if( app.globalData.index==undefined){
var that = this;
console.log('999', that.data.endTime)
var time = that.data.endTime;
var interval = setInterval(function() {
var interval = setInterval(function () {
// 秒数
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
... ... @@ -257,17 +415,13 @@ if( app.globalData.index==undefined){
//获取活动专区列表
getzhuanqulist() {
let that = this
let url = '/activity/get_all';
let data = {
}
app.post(url, data, "POST").then((r) => {
let url = '/activity/get_list';
let data = {}
app.postk(url, data, "POST").then((r) => {
console.log(r)
that.setData({
activity: r.msg
activity: r.data
})
console.log(that.data.activity)
// that.setData({
// messagelist: that.data.messagelist.concat(r.msg)
... ... @@ -291,37 +445,52 @@ if( app.globalData.index==undefined){
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
}
})
}else{
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
return false
}
} else {
let login_new = wx.getStorageSync('login');
// if(login_new==0){
// wx.showModal({
// title: '提示',
// content: '您还不是会员',
// success(res) {
// if (res.confirm) {
// wx.navigateTo({
// url: '/pages/login/login',
// })
// } else if (res.cancel) {
// }
// }
// })
// return false
// }
wx.navigateTo({
url: '/pages/zhuanqu/zhuanqu?id=' + id,
})
}
},
// 获取品牌专区
getpinpailist() {
let that = this
let url = '/sundry/get_brand';
let data = {
page: 1
}
app.postk(url, data, "POST").then((r) => {
console.log(r)
that.setData({
pinpailist: r.data.slice(0, 4)
})
}).catch((err) => {})
},
more() {
let token = wx.getStorageSync("token")
if (token == '') {
... ... @@ -333,34 +502,15 @@ if( app.globalData.index==undefined){
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
}
})
return false
}
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
return false
}
let login_new = wx.getStorageSync('login');
wx.navigateTo({
url: '/pages/classify/classify',
url: '/pages/classify/classify?type=' + 1,
})
},
//展示所有的小分类
... ... @@ -381,38 +531,42 @@ if( app.globalData.index==undefined){
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
}else{
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
return false
}
} else {
let login_new = wx.getStorageSync('login');
// if(login_new==0){
// wx.showModal({
// title: '提示',
// content: '您还不是会员',
// success(res) {
// if (res.confirm) {
// wx.navigateTo({
// url: '/pages/login/login',
// })
// } else if (res.cancel) {
// }
// }
// })
// return false
// }
let title = this.data.nav_arr[this.data.nav_index].name
let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
let pid = this.data.nav_arr[this.data.nav_index].id
let category_id2 = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
url: '/pages/search/search_result/search_result?title=' + title + '&category_id2=' + category_id2
})
// let index = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
// let pid = this.data.nav_arr[this.data.nav_index].id
// wx.navigateTo({
// url: '/packageA/pages/search/search_result/search_result?title=' + title + "&index=" + index + '&pid=' + pid
// })
}
},
//监测轮播图变化
swiperChange(e) {
... ... @@ -424,7 +578,8 @@ if( app.globalData.index==undefined){
look_more(e) {
let token = wx.getStorageSync("token")
let id = e.currentTarget.dataset.id
let style = e.currentTarget.dataset.style
let style = e.currentTarget.dataset.style;
console.log(style)
if (token == '') {
wx.showModal({
title: '提示',
... ... @@ -434,28 +589,12 @@ if( app.globalData.index==undefined){
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
} else {
let login_new=wx.getStorageSync('login');
if(login_new==0){
wx.showModal({
title: '提示',
content: '您还不是会员',
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/login/login',
})
} else if (res.cancel) {
}
}
})
let login_new = wx.getStorageSync('login');
return false
}
if (style == 2) {
wx.navigateTo({
url: '/pages/outerChain/outerChain?src=' + e.currentTarget.dataset.src
... ... @@ -466,132 +605,205 @@ if( app.globalData.index==undefined){
})
}
}
},
// 排序
reorder(e) {
let that = this
let index = Number(e.currentTarget.dataset.index)
that.setData({
page: 1,
shop_arr: []
})
let index = Number(e.currentTarget.dataset.index);
that.setData({
c_index: index,
sort: index
})
if (index == 1) {
if (that.data.price == "price") {
that.setData({
price: 'price desc'
this.setData({
pricesheng: !this.data.pricesheng
})
if (this.data.pricesheng == true) {
this.setData({
sort: 1
})
} else {
that.setData({
price: 'price'
this.setData({
sort: 2
})
}
} else if (index == 2) {
if (that.data.paynum == "paynum") {
that.setData({
paynum: 'paynum desc'
}
if (index == 2) {
this.setData({
xiaoliang: !this.data.xiaoliang
})
if (this.data.xiaoliang == true) {
this.setData({
sort: 3
})
} else {
that.setData({
paynum: 'paynum'
this.setData({
sort: 4
})
}
}
this.setData({
c_index: e.currentTarget.dataset.index,
page: 1,
page_type: false
})
//调用排序接口
this.good_list(this.data.pid, e.currentTarget.dataset.index)
that.getgoodlist()
// let that = this
// let index = Number(e.currentTarget.dataset.index)
// if (index == 1) {
// if (that.data.price == "price") {
// that.setData({
// price: 'price desc'
// })
// } else {
// that.setData({
// price: 'price'
// })
// }
// } else if (index == 2) {
// if (that.data.paynum == "paynum") {
// that.setData({
// paynum: 'paynum desc'
// })
// } else {
// that.setData({
// paynum: 'paynum'
// })
// }
// }
// this.setData({
// c_index: e.currentTarget.dataset.index,
// page: 1,
// page_type: false
// })
// //调用排序接口
// this.good_list(this.data.pid, e.currentTarget.dataset.index)
},
// 选择一级分类
select_nav(e) {
let index = Number(e.currentTarget.dataset.index)
let id = e.currentTarget.dataset.id;
this.setData({
pid:id
seltui: index,
isyouzhi:1
})
let id = e.currentTarget.dataset.id;
let newclass_arr = this.data.nav_arr[index].child
this.setData({
scrollTop: 0
category_id1: id,
class_arr: newclass_arr,
nav_index: index,
page: 1,
shop_arr: []
})
if (index == this.data.nav_index) {
return
} else {
this.setData({
nav_index: index,
page: 1,
page_type: false,
c_index: 0, //筛选分类下标
price: 'price desc', //价格排序方式
paynum: 'paynum desc' //销量排序方式
})
this.get_info(id, 2)
if(index==0){
this.getyouzhi()
}else{
this.getgoodlist()
}
},
// 获取商品列表
getgoodlist() {
let that = this;
let url = '/goods/get_goods'
let param = {
category_id1: this.data.category_id1,
sort: this.data.sort,
keyword: this.data.keyword,
page: this.data.page,
pageNum: 10
}
app.postk(url, param).then((res) => {
if (that.data.page > 1) {
if (res.data.length == 0) {
wx.showToast({
title: '没有更多了~',
icon: 'none'
})
} else {
this.setData({
shop_arr: that.data.shop_arr.concat(res.data)
})
}
} else {
this.setData({
shop_arr: that.data.shop_arr.concat(res.data)
})
}
console.log(that.data.shop_arr, '轮播图')
})
},
// 轮播图
get_banner() {
let url = app.interface.banner
app.post(url, {}).then((res) => {
let url = '/sundry/get_slide'
app.postk(url, {}).then((res) => {
console.log(res, '轮播图')
this.setData({
imgurl: res.msg
imgurl: res.data
})
})
},
//获取公告
get_notice() {
let that = this
let url = app.interface.notice
app.post(url, {}).then((res) => {
for (let obj of res.msg) {
let url = '/sundry/get_notice'
let param = {
page: 1,
pageNum: 2
}
app.postk(url, param).then((res) => {
for (let obj of res.data) {
obj.createtime = obj.createtime.substring(0, 10)
}
that.setData({
notice: res.msg
notice: res.data
})
})
},
//获取页面信息
get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
wx.showLoading({
title: '加载中'
})
let that = this
let url = app.interface.index
let params = {
pid: pid
}
app.post(url, params).then((res) => {
console.log('88776654', res)
wx.hideLoading()
if (type == 1) {
let obj = {
name: '首页',
id: ''
}
res.msg.unshift(obj)
that.setData({
nav_arr: res.msg
})
that.get_info(res.msg[0].id, 2)
} else if (type == 2) {
console.log('666', res)
// let obj = {
// name: '全部',
// id: ''
// }
// res.msg.unshift(obj)
that.setData({
class_arr: res.msg,
cid: ''
})
that.good_list(pid, that.data.c_index)
}
}).catch((er) => {
wx.hideLoading()
})
},
// get_info(pid, type) { //type 1为小标题 2为小标题下的小分类
// wx.showLoading({
// title: '加载中'
// })
// let that = this
// let url = app.interface.index
// let params = {
// pid: pid
// }
// app.post(url, params).then((res) => {
// console.log('88776654', res)
// wx.hideLoading()
// if (type == 1) {
// let obj = {
// name: '首页',
// id: ''
// }
// res.msg.unshift(obj)
// that.setData({
// nav_arr: res.data
// })
// that.get_info(res.msg[0].id, 2)
// } else if (type == 2) {
// console.log('666', res)
// // let obj = {
// // name: '全部',
// // id: ''
// // }
// // res.msg.unshift(obj)
// that.setData({
// class_arr: res.data,
// cid: ''
// })
// that.good_list(pid, that.data.c_index)
// }
// }).catch((er) => {
// wx.hideLoading()
// })
// },
//获取商品列表
good_list(pid, c_index) {
wx.showLoading({
... ... @@ -632,7 +844,7 @@ if( app.globalData.index==undefined){
})
},
/**
* 生命周期函数--监听页面加载
*/
... ... @@ -645,7 +857,7 @@ if( app.globalData.index==undefined){
if (res.msg > 0) {
wx.showTabBarRedDot({
index: 2,
success: function(red) {
success: function (red) {
wx.setTabBarBadge({
index: 2,
text: res.msg.toString(),
... ... @@ -675,7 +887,7 @@ if( app.globalData.index==undefined){
// })
let newlist = [];
r.msg.forEach(function(value, index, array) {
r.msg.forEach(function (value, index, array) {
console.log(newlist)
if (value.status == 1) {
newlist.push(value)
... ... @@ -686,7 +898,7 @@ if( app.globalData.index==undefined){
if (newlist.length != 0) {
wx.showTabBarRedDot({
index: 1,
success: function(red) {
success: function (red) {
wx.setTabBarBadge({
index: 1,
... ... @@ -700,106 +912,122 @@ if( app.globalData.index==undefined){
}).catch((err) => {})
},
// 获取个人信息
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
this.setData({
logok: app.globalData.baseUrlimg + "assets/img/cb2ad36a391388f19f5f912fa021f8f.png"
})
this.get_banner()
console.log(app.globalData.index)
if(app.globalData.index==0){
app.globalData.index=undefined
let token=wx.getStorageSync('token');
console.log('woshitoe',token)
if(token!=""){
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867',this.data.pid)
if(this.data.pid){
this.get_info(this.data.pid, 2);
}else{
this.get_info(0, 1);
if (app.globalData.index == 0) {
app.globalData.index = undefined
let token = wx.getStorageSync('token');
console.log('woshitoe', token)
if (token != "") {
this.getInfoFun()
}
this.get_notice()
this.get_shopnum()
this.getmessagelist();
console.log('998867', this.data.pid)
if (this.data.pid) {
// this.get_info(this.data.pid, 2);
} else {
// this.get_info(0, 1);
}
//控制显示隐藏
this.ishow()
}
// 获取一级分类
this.getonkind();
//控制显示隐藏
this.ishow()
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
loadMore(e){
console.log(e)
let that = this
if (that.data.page_type) {
wx.showToast({
title: '暂无更多数据',
icon: 'none',
duration: 1000
})
return
}
that.setData({
page: that.data.page + 1
loadMore(e) {
let newpage = this.data.page;
newpage++;
this.setData({
page: newpage
})
that.good_list(that.data.pid, that.data.c_index)
if(this.data.isyouzhi==0){
this.getyouzhi()
}else{
this.getgoodlist()
}
// console.log(e)
// let that = this
// if (that.data.page_type) {
// wx.showToast({
// title: '暂无更多数据',
// icon: 'none',
// duration: 1000
// })
// return
// }
// that.setData({
// page: that.data.page + 1
// })
// that.good_list(that.data.pid, that.data.c_index)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
console.log(43898438493)
let that = this
if (that.data.page_type) {
wx.showToast({
title: '暂无更多数据',
icon: 'none',
duration: 1000
})
return
}
that.setData({
page: that.data.page + 1
})
that.good_list(that.data.pid, that.data.c_index)
onReachBottom: function () {
// console.log(43898438493)
// let that = this
// if (that.data.page_type) {
// wx.showToast({
// title: '暂无更多数据',
// icon: 'none',
// duration: 1000
// })
// return
// }
// that.setData({
// page: that.data.page + 1
// })
// that.good_list(that.data.pid, that.data.c_index)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -2,6 +2,8 @@
"navigationBarTitleText": "首页",
"usingComponents": {
"concat": "/Components/concat/concat",
"Model_item": "/Components/Model_item/Model_item"
"Model_item": "/Components/Model_item/Model_item",
"v-tab-bar": "/custom-tab-bar/custom-tab-bar"
}
}
\ No newline at end of file
... ...
... ... @@ -5,9 +5,15 @@
<image src='/images/search.png' class='search_icon'></image>
<input class='real_search' placeholder='搜索您想要的商品'></input>
</navigator>
<view class="morebox" bindtap="more">
<view class="moreimg">
<image src="/images/more.png"></image>
</view>
</view>
</view>
<view class='list' wx:if="{{nav_index!=0}}">
<!-- <view class='list' wx:if="{{nav_index!=0}}">
<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">
<view class='item'>
<view class='item_img'>
... ... @@ -24,37 +30,130 @@
<view class='item_font'>{{length_num == 9?'查看全部':'收起'}}</view>
</view>
</view>
</view>
</view> -->
<!-- 轮播图 -->
<view class="lunbo_box {{nav_index==0?'boxactive':''}}" wx:else>
<swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>
<swiper-item class='swiper-item' wx:for="{{imgurl}}" wx:key="index">
<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'}}" />
</swiper-item>
</swiper>
<view class="dots">
<block wx:for="{{imgurl}}" wx:key="index">
<view class="dot {{zcurrent == index ? 'active':''}}"></view>
</block>
<!-- catchtap="{{item.goods_id == 0?'':'look_more'}}" -->
<view>
<view class="tuoyuan">
<image src="/images/tuoyuan.png"></image>
<view class="lunbo_box {{nav_index==0?'boxactive':''}}">
<swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>
<swiper-item class='swiper-item' wx:for="{{imgurl}}" wx:key="index">
<image src='{{item.image}}' mode="aspectFill" data-id="{{item.goods_id}}" data-style="{{item.type}}" data-src="{{item.url}}" catchtap="look_more" />
</swiper-item>
</swiper>
<view class="dots">
<block wx:for="{{imgurl}}" wx:key="index">
<view class="dot {{zcurrent == index ? 'active':''}}"></view>
</block>
</view>
</view>
</view>
</view>
<!-- 劳保 -->
<!-- <view class="fenlei">
<view class="fenleiitem">
劳保商城
</view>
<view class="fenleiitem">
差旅
</view>
</view> -->
<!-- 活动区域 -->
<view wx:if="{{nav_index==0}}">
<view class="quan">
<view class="quanitem">
<image src="/images/xing.png" class="qiuimg"></image>
<view class="quanname">全球心选</view>
</view>
<view class="quanitem">
<image src="/images/zheng.png" class="qiuimg"></image>
<view class="quanname">正品保障</view>
</view>
<view class="quanitem">
<image src="/images/gou.png" class="qiuimg"></image>
<view class="quanname">售后无忧</view>
</view>
<view class="quanitem">
<image src="/images/dianhua.png" class="qiuimg"></image>
<view class="quanname">优质客服</view>
</view>
</view>
<view class="fenlei">
<view class="fenleiitem" bindtap="laobao">
<image src="/images/img_laobao.png"></image>
</view>
<view class="fenleiitem">
<image src="/images/img_chailv.png"></image>
</view>
</view>
<!-- 新品上线 -->
<view class="huo">
<image src="/images/huo.png" class="huoimg"></image>
<view class="pingtai">轻奢各样商品钜惠来袭</view>
</view>
<view class="newgoodbox">
<view class="newgood">
<view class="newgoodleft" bindtap="seeactive" data-id="{{activity[0].id}}">
<view class="newgoodlefttop">
<view class="newtitle" style="color:{{activity[0].name_color}}">{{activity[0].name}}</view>
<view class="hot" style="background:{{activity[0].describe_color}}">{{activity[0].label}}</view>
</view>
<view class="newgoodlist">
<view class="hotgoodimg">
<image src="{{activity[0].image}}"></image>
</view>
</view>
</view>
<view class="newgoodleft" bindtap="seeactive" data-id="{{activity[1].id}}">
<view class="newgoodlefttop">
<view class="newtitle" style="color:{{activity[1].name_color}}">{{activity[1].name}}</view>
<view class="youxuan" style="background:{{activity[1].label_color}}">{{activity[1].label}}</view>
</view>
<view class="jiesuo" style="color:{{activity[1].describe_color}}">{{activity[1].describe}}</view>
<view class="newgoodlist">
<view class="hotgoodimgk">
<image src="{{activity[1].image}}"></image>
</view>
</view>
</view>
</view>
<view class="newgood">
<view class="dapaiitem" bindtap="seeactive" data-id="{{activity[2].id}}">
<view class='dapaititle' style="color:{{activity[2].name_color}}">{{activity[2].name}}</view>
<view class='nvshen' style="color:{{activity[2].describe_color}}">{{activity[2].describe}}</view>
<view class="dapaiimg">
<image src="{{activity[2].image}}"></image>
</view>
</view>
<view class="dapaiitem" bindtap="seeactive" data-id="{{activity[3].id}}">
<view class='dapaititle' style="color:{{activity[3].name_color}}">{{activity[3].name}}</view>
<view class='nvshen' style="color:{{activity[3].describe_color}}">{{activity[3].describe}}</view>
<view class="dapaiimg">
<image src="{{activity[3].image}}"></image>
</view>
</view>
<view class="dapaiitem" bindtap="seeactive" data-id="{{activity[4].id}}">
<view class='dapaititle' style="color:{{activity[4].name_color}}">{{activity[4].name}}</view>
<view class='nvshen' style="color:{{activity[4].describe_color}}">{{activity[4].describe}}</view>
<view class="dapaiimg">
<image src="{{activity[4].image}}"></image>
</view>
</view>
</view>
</view>
<!-- 活动区域 -->
<view class="actboxpage" wx:if="{{nav_index==0}}">
<!-- <view class="pinpainame">品牌专区</view> -->
<view class="pinpaiheng">
<view class="huok">
<image src="/images/zuanshi.png" class="huoimg"></image>
<view class="pinname">品牌专区</view>
<view class="chaoduo">超多大牌 轻松选择 </view>
</view>
<view class="tosee" bindtap="gopinpai">
全部
<image src="/images/gosee.png" class="seeimg"></image>
</view>
</view>
<view class="actity" wx:if="{{status1==1}}">
<!-- <view class="miaoshaoname">活动专区</view> -->
<view class="active flexone">
<view wx:for="{{activity}}" class="actbox" wx:key="" bindtap="seeactive" data-id="{{item.id}}">
<view wx:for="{{pinpailist}}" class="actbox" wx:key="" bindtap="cityTap" data-id="{{item.id}}">
<view class="activeitem">
<image src="{{item.image}}"></image>
</view>
... ... @@ -62,65 +161,39 @@
</view>
</view>
</view>
<!-- 秒杀商城 -->
<!-- <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}">
<view class="miaoshatop flextwo">
<view class="miaoshatopleft flexone">
<view class="miaoshaoname">{{title2}}</view>
<view class="hourgou" wx:if="{{showtime}}">{{day}}:{{hou}}:{{min}}:{{sec}}</view>
</view>
<view class="miaosharight" bindtap="moremiao">
查看更多>
</view>
</view>
<view class="miaoshalist">
<view class="miaoshalistitem" wx:for="{{xianshilist}}" wx:key="" bindtap="look_more" data-id="{{item.id}}">
<view class="goodimg">
<image src="{{item.images[0]}}"></image>
</view>
<view class="price">¥{{item.price2!=null?item.price2:item.price}}</view>
</view>
<!-- <view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}" bindtap="moremiao">
<view class="neigouimg">
<image src="{{logok}}"></image>
</view>
</view> -->
<view class="miaosha xianshi" wx:if="{{status2==1&&activitystatus==3&&xianshilist.length!=0}}" bindtap="moremiao">
<view class="neigouimg">
<image src="/images/neigouk.png" ></image>
</view>
</view>
</view>
<!-- 公告栏 -->
<navigator class="notice" url="../notice/notice">
<!-- url="../notice/notice" -->
<!-- <view class="notice">
<image src="/images/notice.png" class="notice_tips" />
<view class="notice_word">
<view class="notice_item" wx:for="{{notice}}" wx:key="index" wx:if="{{index<2}}">
<view class="notice_item" wx:for="{{notice}}" wx:key="index" wx:if="{{index<2}}" bindtap="noticedetail" data-id="{{item.id}}">
<view class="dian" />
<view class="word">{{item.desc}}</view>
<view class="word">{{item.title}}</view>
<view class="time">{{item.createtime}}</view>
</view>
</view>
</navigator>
</view> -->
<!-- 大分类 -->
<!-- {{stick==1?'navactive':''}} -->
<view class="navactive">
<!-- <view class="navactive">
<view class="horizontal_nav ">
<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>
</view>
<view class="morebox" bindtap="more">
<view class="moreimg">
<image src="/images/more.png"></image>
</view>
</view>
<!-- 小分类 -->
</view>
<view class='select_box'>
</view> -->
<!-- <view class='select_box'>
<view class='select_item {{c_index == 0?"active":""}}' data-index="0" bindtap='reorder'>默认</view>
<view class='select_item {{c_index == 1?"active":""}}' data-index="1" bindtap='reorder'>价格
<view class='select_img'>
... ... @@ -132,11 +205,18 @@
<image src="{{c_index == 2?'/images/select_active.png':'/images/select.png'}}" class='select_img_no_choose' />
</view>
</view>
</view> -->
<!-- 品牌推荐列表 -->
<view class="tuijianlist flexone {{stick==1?'fixedactive':''}}" >
<view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">
<view class="tuijianitemname {{seltui==index?'tuiactive':''}}">{{item.name}}</view>
<view class="tuijiandes {{seltui==index?'tuiactive':''}}">{{item.description}}</view>
</view>
</view>
<view class='real_goods'>
<Model_item list="{{shop_arr}}" />
</view>
<concat />
</view>
</scroll-view>
\ No newline at end of file
</scroll-view>
<v-tab-bar selected="{{selected}}" text="1" list="{{list}}"></v-tab-bar>
\ No newline at end of file
... ...
page {
width: 100%;
height: 100%;
background: #fff;
background: #F4F4F4;
}
image {
... ... @@ -23,15 +23,21 @@ image {
top: 0;
left: 0;
z-index: 99;
display:flex;
}
.lunbo_box {
border: none !important;
background: rgba(61, 154, 248, 1);
/* background: rgba(61, 154, 248, 1); */
/* padding: 2rpx 32rpx 25rpx;
box-sizing: border-box; */
position: relative;
margin-top: 10rpx;
/* position: relative; */
position: absolute;
top:30rpx;
width:686rpx;
height: 283rpx;
border-radius: 20rpx;
left:32rpx;
}
.search_box {
... ... @@ -61,7 +67,7 @@ image {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 29%;
left: 26%;
}
.flexone {
... ... @@ -88,7 +94,7 @@ image {
.morebox {
width: 84rpx;
height: 88rpx;
height:75rpx;
/* position: fixed;
right:0;
top:0;
... ... @@ -119,7 +125,7 @@ image {
}
.boxactive {
margin-top: 166rpx;
/* margin-top: 166rpx; */
}
.nav_item {
... ... @@ -182,17 +188,15 @@ image {
}
.swiper_box {
/* width: 686rpx;
height: 304rpx; */
width: 750rpx;
height: 320rpx;
width: 686rpx;
height: 283rpx;
position: relative;
}
.swiper-item {
width: 100%;
height: 100%;
border-radius: 10rpx;
border-radius: 20rpx;
overflow: hidden;
}
... ... @@ -200,13 +204,14 @@ image {
width: 100%;
height: 100%;
overflow: hidden;
border-radius:20rpx;
}
.dots {
position: absolute;
left: 0;
right: 0;
bottom: 44rpx;
bottom: 25rpx;
display: flex;
justify-content: center;
align-items: center;
... ... @@ -320,6 +325,7 @@ image {
border-radius: 50%;
background: #000;
margin-right: 10rpx;
flex:0 0 auto
}
.notice_item .word {
... ... @@ -335,14 +341,14 @@ image {
}
.real_goods {
background: #f9f9f9;
/* background: #f9f9f9; */
}
.fenlei {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 32rpx;
padding:21rpx 32rpx;
box-sizing: border-box;
}
... ... @@ -358,8 +364,8 @@ image {
}
.activeitem {
width: 215rpx;
height: 220rpx;
width: 110rpx;
height:110rpx;
font-size: 0;
display: flex;
justify-content: center;
... ... @@ -368,7 +374,6 @@ image {
margin-right: 24rpx;
margin: 0 auto;
}
.activeitem image {
border-radius: 16rpx;
}
... ... @@ -380,7 +385,9 @@ image {
flex-direction: column;
align-items: center;
margin-right: 16rpx;
}
.actbox:last-child{
margin-right:0
}
image {
... ... @@ -393,13 +400,23 @@ image {
font-size: 32rpx;
font-weight: bold;
}
.actity {
width: 750rpx;
padding: 8rpx 30rpx;
.actboxpage{
width:686rpx;
border-radius: 17rpx;
padding: 18rpx;
box-sizing: border-box;
background: #fff;
border-bottom: 16rpx solid #f5f5f5;
margin:27rpx auto 0;
}
.actity {
/* width: 750rpx; */
/* padding: 8rpx 30rpx;
box-sizing: border-box; */
/* background: #fff;
border-bottom: 16rpx solid #f5f5f5; */
/* border-top:16rpx solid #f5f5f5; */
margin-top:10rpx;
}
... ... @@ -408,15 +425,11 @@ image {
/* box-sizing: border-box;
border-bottom: 20rpx solid #f5f5f5; */
}
.active {
flex-wrap: nowrap;
/* overflow-x: scroll; */
}
.miaoshaoname {
color:rgba(61, 154, 248, 1);
font-size: 28rpx;
font-weight: bold;
}
... ... @@ -527,8 +540,280 @@ image {
}
.neigouimg{
width:750rpx;
height:254rpx;
/* height:254rpx; */
height:196rpx;
font-size: 0;
display:flex;
justify-content: center;
}
/* 新品上线 */
.newgoodbox{
width:686rpx;
border-radius: 17rpx;
background: #fff;
padding:18rpx ;
box-sizing: border-box;
margin:0 auto
}
.newgood{
/* padding: 0 32rpx ;
box-sizing: border-box; */
display:flex;
justify-content: space-between;
}
.dapaititle{
margin-top:20rpx
}
.newgoodlist{
display:flex;
align-items: center;
margin-top:12rpx
}
.newgoodlistitem{
display:flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 12rpx;
height: 176rpx;
box-sizing: border-box;
background: #FCF6F3;
}
.hotgoodimg{
width:300rpx;
height:176rpx;
font-size: 0;
background: #FDF2E7;
}
.hotgoodimg:nth-child(2){
margin-left:18rpx
}
.hotword{
color:#F20000;
font-size: 24rpx;
margin-top:5rpx;
text-align: center;
}
.newgoodlistitemsec{
margin-left:28rpx
}
.newtitle{
color:#06121E;
font-size: 32rpx;
}
.hot{
padding: 0 10rpx;
background: linear-gradient(270deg,#fe4e50 97%, #ff783c 2%);
border-radius: 16rpx;
box-sizing: border-box;
color:#fff;
font-size:30rpx;
margin-left:16rpx;
text-align: center;
}
.newgoodlefttop{
display:flex;
align-items: center;
}
.youxuan{
background: linear-gradient(270deg,#4e98fe 97%, #3cbcff 2%);
padding: 0 10rpx;
border-radius: 16rpx;
box-sizing: border-box;
color:#fff;
font-size:30rpx;
margin-left:16rpx;
text-align: center;
}
.hotgoodimgk{
width:288rpx;
height:127rpx;
border:1px solid #FCF6F3
}
.hotgoodimgk:nth-child(2){
margin-left:20rpx
}
.cahngxiang{
background: linear-gradient(270deg,#feba4e 97%, #ffc33c 2%);
padding: 0 10rpx;
border-radius: 16rpx;
box-sizing: border-box;
color:#fff;
font-size:30rpx;
margin-left:16rpx;
text-align: center;
}
.dapaimei{
display:flex;
align-items: center;
}
.pinpainame{
color:#06121E;
font-size: 32rpx;
padding: 24rpx 32rpx;
box-sizing: border-box;
}
.quan{
display:flex;
align-items: center;
justify-content: space-between;
padding: 21rpx 32rpx 0;
box-sizing: border-box;
margin-top:85rpx;
}
.qiuimg{
width:30rpx;
height:30rpx;
margin-right:9rpx
}
.quanitem{
display:flex;
align-items: center;
}
.quanitem:nth-child(4){
margin-right:0
}
.quanname{
color:#6C6C6C;
font-size: 30rpx;
margin-left:10rpx
}
.huo{
display:flex;
align-items: center;
padding: 0 32rpx 21rpx;
box-sizing: border-box;
}
.huok{
display:flex;
align-items: center;
}
.jiesuo{
color:#FBA701;
font-size: 26rpx;
margin-top: 15rpx;
}
.huoimg{
width:32rpx;
height:32rpx;
margin-right:14rpx
}
.pingtai{
color:#F3342F;
font-size: 31rpx;
}
.dapaiimg{
width:206rpx;
height:247rpx;
font-size: 0;
}
.nvshen{
color:#FE2D64;
font-size: 26rpx;
margin:12rpx 0;
}
.pinname{
color:#333333;
font-size: 33rpx;
margin-left:15rpx;
}
.chaoduo{
color:#999999;
font-size: 26rpx;
margin-left:19rpx;
}
.tosee{
display:flex;
align-items: center;
color:#6C6C6C;
font-size: 30rpx;
}
.seeimg{
width:10rpx;
height:18rpx;
margin-left:20rpx
}
.pinpaiheng{
display:flex;
justify-content: space-between;
align-items: center;
/* padding:26rpx 32rpx ; */
}
.tuoyuan{
width:750rpx;
height:235rpx;
font-size: 0;
position: relative;
margin-top:74rpx
}
.tuijianlist{
width:686rpx;
margin:21rpx auto ;
overflow-x: scroll;
/* padding: 28rpx 32rpx;
box-sizing: border-box; */
flex-wrap: nowrap;
}
.tuijianlistitem{
display:flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex:0 0 auto;
padding: 0 46rpx;
box-sizing: border-box;
}
.tuijianlistitem:last-child .tuijiandes::after{
display:block;
content:'';
width:3rpx;
height: 28rpx;
background:#fff
}
.tuijianlistitem:first-child{
padding-left: 0;
}
.tuijianlistitem:last-child{
padding-right: 0;
}
.tuijianitemname{
color:#333333;
font-size:36rpx;
font-weight: bold;
}
.tuijiandes{
color:#999999;
font-size:28rpx;
margin-top:10rpx;
position: relative;
}
.tuijiandes::after{
display:block;
content:'';
width:3rpx;
height: 28rpx;
background:#dcdcdc;
position: absolute;
top:50%;
transform: translateY(-50%);
right:-46rpx;
}
.tuiactive{
color:#3D9AF7
}
.fixedactive{
width:100%;
position: fixed;
padding: 32rpx;
box-sizing: border-box;
top:60rpx;
left:0;
background: #fff;
z-index:999
}
\ No newline at end of file
... ...
// pages/coupon/coupon.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
status:1,
type:'',
couponlist:[],
goods_ids:[],
total:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
type:options.type,
goods_ids:JSON.parse(options.goods_ids),
total:options.total
})
this.getcoupon()
},
getcoupon(){
let that=this;
let url = '/ticket/my_ticket'
let param={
is_get:'',
status:2,
type:that.data.type,
total:that.data.total,
goods_ids:that.data.goods_ids.join(",")
}
console.log(param)
app.postk(url, param).then((res) => {
console.log(res)
that.setData({
couponlist:res.data
})
}).catch((err) => {
console.log(err)
})
},
selectoupon(e){
let item=e.currentTarget.dataset.item;
console.log('8888676654',item)
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
if(item.type==2){
prevPage.setData({
user_ticket_id1: item.id,
})
wx.setStorageSync('coupon', item)
}else if(item.type==1){
console.log(888777888,item.id)
prevPage.setData({
user_ticket_id2: item.id,
})
wx.setStorageSync('couponone', item)
}
wx.navigateBack({
delta: 1
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="boxb">
<!-- <view class="xnavbox">
<view class="xnavitem" :class="status==1?'xactive':''" bindtap="selcoupon" :data-id="1">
已使用
</view>
<view class="xnavitem status==2?'xactive':''" bindtap="selcoupon" :data-id="2">
未使用
</view>
</view> -->
<view class="nodata" wx:if="{{couponlist.length==0}}">暂无数据</view>
<!-- <view class="couponpage">
<view class="bitem item.status!=1?'borderactive':''" wx:for="{{couponlist}}" wx:key="" bindtap="selectoupon" data-item="{{item}}">
<view class="top">
<view class="price" wx:if="{{item.ticket_type==1}}">¥{{item.discounts_price}}</view>
<view class="right">
<view class="bname">
<text>{{item.name}}</text>
</view>
<view class="tips" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
<view class="tips" wx:if="{{item.ticket_type==2}}">折扣{{item.discount}}</view>
</view>
</view>
<view class="btime">
有效期至:{{item.pasttime}}
</view>
</view>
</view> -->
<view class="couponpage" wx:else>
<view class="couponpageitem" wx:for="{{couponlist}}" wx:key="index" bindtap="selectoupon" data-item="{{item}}">
<view class="coupontop">
<view class=" couponleftk" wx:if="{{item.ticket_type==1}}">
<view class="bigmoney">{{item.discounts_price}}</view>
<view class="smalltext">元</view>
</view>
<view class="couponleft" wx:if="{{item.ticket_type==2}}">
<view class="bigmoney">{{item.discount}}</view>
<view class="smalltext">折</view>
</view>
<view class="couponright">
<view class="rightleft">
<view class="coupontitle">{{item.name}}</view>
<view class="fullmoney" wx:if="{{item.ticket_type==1}}">满{{item.full_price}}元可用</view>
</view>
<view class="rightright">
<view class="finishling">
到期时间: {{item.pasttime}}
<!-- <image src="/images/manjian.png"></image> -->
<!-- <view class="afterling">领取后30天过期</view> -->
</view>
<!-- <view class="useright" bindtap="lingqu" data-id="{{item.id}}">立即领取</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
page {
background: #F7F7F7;
}
.navboxk{
padding: 0 32rpx;
box-sizing: border-box;
}
.quanbox {
margin-top: 20rpx;
}
.navbox {
height: 88rpx;
background: #fff;
display: flex;
}
.navitem {
width: 50%;
height: 100%;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(35, 35, 35, 1);
display: flex;
align-items: center;
justify-content: center;
}
.selactive {
color: rgba(61, 154, 248, 1);
font-weight: bold;
}
.boxa {
margin-top: 16rpx;
background: #fff;
overflow: hidden;
padding: 0 36rpx;
box-sizing: border-box;
}
.aitem {
height: 150rpx;
border-bottom: 1px solid #FEFEFE;
display: flex;
align-items: center;
justify-content: space-between;
}
.left {
width: 340rpx;
}
.left .name {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(35, 35, 35, 1);
}
.left .time {
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 94, 100, 1);
margin-top: 8rpx;
}
.btn {
width: 160rpx;
height: 64rpx;
border-radius: 8rpx;
border: 1px solid rgba(255, 148, 23, 1);
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 148, 23, 1);
display: flex;
align-items: center;
justify-content: center;
}
.activeA {
color: #BDC4CE;
border-color: #BDC4CE;
}
.boxb {
padding: 0 32rpx;
box-sizing: border-box;
}
.xnavbox {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 16rpx;
}
.xnavitem {
width: 212rpx;
height: 62rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 69, 76, 1);
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.xactive {
background: #C29445;
color: #fff;
}
.container {
margin-top: 12rpx;
}
.bitem {
margin-top: 16rpx;
border-left: 8rpx solid rgba(61, 154, 248, 1);
padding: 40rpx 32rpx 20rpx;
box-sizing: border-box;
background: #fff;
}
.top {
height: 156rpx;
border-bottom: 1px solid #EEEEEE;
display: flex;
align-items: center;
}
.price {
font-size: 72rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(61, 154, 248, 1);
margin-right: 32rpx;
}
.right {
width: 100%;
}
.bname {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 94, 100, 1);
}
.bname text:first-child {
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: rgba(6, 18, 32, 1);
}
.tips {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 68, 76, 1);
margin-top: 16rpx;
}
.btime {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(61, 69, 76, 1);
margin-top: 40rpx;
}
.borderactive {
/* border-color: #BDC4CE; */
}
.wordacticve {
font-weight: 500 !important;
color: rgba(189, 196, 206, 1) !important;
}
/* 暂无数据 */
.nodata {
color: #999;
font-size: 32rpx;
text-align: center;
margin-top: 30rpx;
}
.couponpage{
margin-bottom:32rpx
}
.finishling{
color:#fff;
font-size: 24rpx;
}
\ No newline at end of file
... ...
... ... @@ -7,22 +7,24 @@ Page({
data: {
info:[],
item:'',
sel:0
sel:0,
newinfo:[]
},
// 获取页面信息
get_info(order) {
let that=this
let url = app.interface.kuaidi
let url = '/order/logistics'
let params = {
order_odd: order
order_info_id: order
}
app.post(url,params).then((res)=>{
app.postk(url,params).then((res)=>{
console.log(res)
this.setData({
info: res.msg.kuaidi
info: res.data.result1,
newinfo:res.data.result2
})
this.setData({
item: res.msg.kuaidi[0]
item: res.data.result1[0]
})
console.log(that.data.info)
... ...