作者 朱振飞

212122121212

正在显示 100 个修改的文件 包含 1849 行增加0 行删除

要显示太多修改。

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

const app=getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
list: Array
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
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
// }
let id = e.currentTarget.dataset.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: {
created() {
// 在组件实例刚刚被创建时执行
},
attached() {
// 在组件实例进入页面节点树时执行
},
ready() {
// 在组件在视图层布局完成后执行
this.setData({
list: this.properties.list
})
},
detached() {
// 在组件实例被从页面节点树移除时执行
},
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<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.image||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 class='price'>¥{{item.min_goods_price||item.price}}</view>
<block wx:if="{{item.min_goods_price}}">
<view class="lineprice" >¥{{item.line_price}}</view>
</block>
</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; */
display: flex;
flex-wrap: wrap;
padding: 8rpx 0 20rpx;
box-sizing: border-box;
margin-bottom:120rpx;
padding:8rpx 32rpx;
box-sizing: border-box;
min-height: 600rpx;
}
.real_goods_item {
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 {
width: 332rpx;
height: 332rpx;
margin-bottom: 16rpx;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
overflow: hidden;
position: relative;
}
.real_goods_img image {
width: 100%;
height: 100%;
}
.tip {
width: 87rpx !important;
height: 80rpx !important;
position: absolute;
right: 0;
top: 0;
z-index: 2;
}
.real_goods_bottom {
padding: 16rpx 20rpx 28rpx 20rpx;
box-sizing: border-box;
background: #fff;
width: 100%;
}
.goods_title {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
line-height: 36rpx;
color: rgba(5, 9, 26, 1);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
margin-bottom: 10rpx;
}
.goods_flex {
height: 50rpx;
display: flex;
align-items: center;
}
.score {
width: 64rpx;
height: 32rpx;
background: rgba(242, 0, 0, 1);
border-radius: 2rpx;
text-align: center;
color: #fff;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-right: 12rpx;
}
.price {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(242, 0, 0, 1);
margin-right: 20rpx;
}
.sell {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(156, 156, 156, 1);
}
.pink_cover{
width: 100%;
height: 100%;
background: #ccc;
opacity: 0.3;
position: absolute;
left: 0;
top: 0;
}
.oldprice{
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
... ...
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
tel(){
wx.makePhoneCall({
phoneNumber: wx.getStorageSync('tel')
})
}
}
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="concat_box">
<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>
</view>
\ No newline at end of file
... ...
.concat_box {
width: 96rpx;
height: 210rpx;
position: fixed;
right: -24rpx;
bottom: 127rpx;
}
.item {
width: 60rpx;
height: 60rpx;
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 {
margin-bottom: 30rpx !important;
}
.item image {
width: 100%;
height: 100%;
}
... ...
Component({
/**
* 组件的属性列表
*/
properties: {
check_num: Number, //已选择商品数量
list: Array,
type: Number,
checkAll: Boolean,
action: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
//查看商品详情
look_detail(e) {
let id = e.currentTarget.dataset.id;
// wx.navigateTo({
// url: '/pages/shop_detail/shop_detail?id=' + id
// })
},
enter(){
console.log(this.data.list)
},
//加减商品数量
num_change(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
if (type == 1) {
num++
} else {
num--
if (num < 1) {
//触发删除商品的接口
this.triggerEvent('delete_shop', {
index: index,
id: id
})
return
}
}
this.triggerEvent('change_num', {
num: num,
index: index,
type: type,
product_id: product_id
})
},
//改变商品选中状态
check_item(e){
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 {
check_num --
}
this.triggerEvent('check_type', {
index: index,
check_type: !check_type,
check_num: check_num
})
}
},
lifetimes: {
created() {
// 在组件实例刚刚被创建时执行
},
attached() {
// 在组件实例进入页面节点树时执行
},
ready() {
// 在组件在视图层布局完成后执行
this.setData({
list: this.properties.list,
type: this.properties.type,
actioning: this.properties.actioning,
checkAll: this.properties.checkAll,
check_num: this.properties.check_num ? this.properties.check_num:0
})
console.log(this.data.list)
},
detached() {
// 在组件实例被从页面节点树移除时执行
},
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="item" wx:for="{{list}}" wx:key="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.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">
<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="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>
</view>
</view>
<view class="info_box" wx:if="{{type == 3}}">
<view class="f_item">
<view class="shop" bindtap="enter">
商品积分
<text wx:if="{{item.price2!=null}}">{{item.price2*100*item.num/100}}积分</text>
<text wx:else>{{item.price*100*item.num/100}}积分</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
.item {
width: 100%;
background: #fff;
padding: 0 24rpx;
box-sizing: border-box;
margin-top: 20rpx;
}
.item:first-child {
margin-top: 0;
}
.item .top {
padding: 36rpx 0;
box-sizing: border-box;
display: flex;
align-items: center;
}
.check_box {
width: 36rpx;
height: 36rpx;
padding: 30rpx 30rpx 30rpx 0;
}
.content {
width: 564rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.show_img {
width: 164rpx;
height: 164rpx;
margin-right: 24rpx;
}
.right {
width: 376rpx;
}
.word {
width: 100%;
height: 76rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.info {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 32rpx;
}
.jifen {
display: flex;
align-items: center;
}
.jifen .name {
width: 64rpx;
height: 36rpx;
background: rgba(242, 0, 0, 1);
border-radius: 4rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.jifen text {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(242, 0, 0, 1);
}
.num_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.num_box .num_btn {
width: 36rpx;
height: 36rpx;
}
.num_box text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
margin: 0 24rpx;
}
.active {
width: 100%;
}
.ractive {
width: 448rpx;
}
.info_box {
width: 100%;
margin-top: 26rpx;
}
.f_item {
width: 100%;
padding: 28rpx 0;
box-sizing: border-box;
border-bottom: 1px solid #eee;
}
.f_item .shop {
width: 100%;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
display: flex;
justify-content: space-between;
align-items: center;
}
.f_item .shop text:last-child {
color: #8e8e8e;
}
.youfei {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 34rpx;
color: rgba(142, 142, 142, 1);
margin-top: 10rxp;
}
.jifen_num {
width: 100%;
padding: 28rpx 0;
box-sizing: border-box;
display: flex;
flex-direction: row-reverse;
align-items: center;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: Regular;
color: #131a2e;
}
.jifen_num text:last-child {
font-size: 32rpx;
color: rgba(242, 0, 0, 1);
font-family: PingFang SC Bold;
font-weight: Bold;
}
.jifen_num text:first-child {
color: rgba(242, 0, 0, 1);
margin-left: 10rpx;
}
.oldprice {
color: #bdc4ce;
font-size: 24rpx;
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;
}
... ...
Component({
/**
* 组件的属性列表
*/
properties: {
check_num: Number, //已选择商品数量
list: Array,
type: Number,
checkAll: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
//查看商品详情
look_detail(e) {
let id = e.currentTarget.dataset.id;
// wx.navigateTo({
// url: '/pages/shop_detail/shop_detail?id=' + id
// })
},
enter(){
console.log(this.data.list)
},
//加减商品数量
num_change(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
if (type == 1) {
num++
} else {
num--
if (num < 1) {
//触发删除商品的接口
this.triggerEvent('delete_shop', {
index: index,
id: id
})
return
}
}
this.triggerEvent('change_num', {
num: num,
index: index,
type: type,
product_id: product_id
})
},
//改变商品选中状态
check_item(e){
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 {
check_num --
}
this.triggerEvent('check_type', {
index: index,
check_type: !check_type,
check_num: check_num
})
}
},
lifetimes: {
created() {
// 在组件实例刚刚被创建时执行
},
attached() {
// 在组件实例进入页面节点树时执行
},
ready() {
// 在组件在视图层布局完成后执行
this.setData({
list: this.properties.list,
type: this.properties.type,
checkAll: this.properties.checkAll,
check_num: this.properties.check_num ? this.properties.check_num:0
})
console.log(this.data.list)
},
detached() {
// 在组件实例被从页面节点树移除时执行
},
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
<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="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>
<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.goods_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>
</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>
</view>
<view class="oldprice" wx:if="{{item.product.price2!=null||item.price2!=null}}">{{item.product.price||item.price}}</view>
</view>
</view>
</view>
<view class="info_box" wx:if="{{type == 3}}">
<view class="f_item">
<view class="shop" bindtap="enter">
商品积分
<text wx:if="{{item.price2!=null}}">{{item.price2*100*item.num/100}}积分</text>
<text wx:else>{{item.price*100*item.num/100}}积分</text>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
.item {
width: 100%;
background: #fff;
padding: 0 24rpx;
box-sizing: border-box;
margin-top: 20rpx;
}
.item:first-child {
margin-top: 0;
}
.item .top {
padding: 36rpx 0;
box-sizing: border-box;
display: flex;
align-items: center;
}
.check_box {
width: 36rpx;
height: 36rpx;
padding: 30rpx 30rpx 30rpx 0;
}
.content {
width: 564rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.show_img {
width: 164rpx;
height: 164rpx;
margin-right: 24rpx;
}
.right {
width: 376rpx;
}
.word {
width: 100%;
height: 76rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.info {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 32rpx;
}
.jifen {
display: flex;
align-items: center;
}
.jifen .name {
width: 64rpx;
height: 36rpx;
background: rgba(242, 0, 0, 1);
border-radius: 4rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin-right: 20rpx;
}
.jifen text {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(242, 0, 0, 1);
}
.num_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.num_box .num_btn {
width: 36rpx;
height: 36rpx;
}
.num_box text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
margin: 0 24rpx;
}
.active {
width: 100%;
}
.ractive {
width: 448rpx;
}
.info_box {
width: 100%;
margin-top: 26rpx;
}
.f_item {
width: 100%;
padding: 28rpx 0;
box-sizing: border-box;
border-bottom: 1px solid #eee;
}
.f_item .shop {
width: 100%;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
display: flex;
justify-content: space-between;
align-items: center;
}
.f_item .shop text:last-child {
color: #8e8e8e;
}
.youfei {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 34rpx;
color: rgba(142, 142, 142, 1);
margin-top: 10rxp;
}
.jifen_num {
width: 100%;
padding: 28rpx 0;
box-sizing: border-box;
display: flex;
flex-direction: row-reverse;
align-items: center;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: Regular;
color: #131a2e;
}
.jifen_num text:last-child {
font-size: 32rpx;
color: rgba(242, 0, 0, 1);
font-family: PingFang SC Bold;
font-weight: Bold;
}
.jifen_num text:first-child {
color: rgba(242, 0, 0, 1);
margin-left: 10rpx;
}
.oldprice {
color: #bdc4ce;
font-size: 24rpx;
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;
}
... ...
App({
onLaunch: function () {
this.getmessagelist()
this.getToken();
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '更新提示',
content: '新版本下载失败',
showCancel: false
})
})
},
post: function (url, data, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data , baseUrl;
// 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 = 'http://binhaitest.w.brotop.cn/api'
var entrance_type = wx.getStorageSync("entrance_type");
console.log(entrance_type);
if(entrance_type == '1'||url=='/getopenid/get'||url.indexOf('address')>-1){
//劳保商城入口
baseUrl = 'https://binhai.w.broing.cn/api';
}else{
//工会商城入口
baseUrl = 'https://binhaigh.w.broing.cn/api';
}
console.log(baseUrl);
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'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('login');
// wx.removeStorageSync('token');
// 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;
},
getToken(){
let that= this;
let u = that.interface.getToken;
wx.login({
success: (result) => {
that.postk(u, {
code: result.code
}).then((r) => {
wx.setStorageSync('token', r.data.token)
wx.setStorageSync('login', r.data.login_new1)
wx.setStorageSync('gh_login', r.data.login_new2)
})
},
fail: (res) => {},
complete: (res) => {},
})
},
// 开放商城公共接口
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 = 'https://binhaidispark.w.broing.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({
// 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;
},
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'https://binhaidispark.w.broing.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() {
let that= this;
let u = that.interface.readteacher;
that.post(u, {}).then((r) => {
console.log('3489523498',r)
if (r.code == 200) {
wx.setStorageSync('login', r.msg.login_new)
// that.globalData.login_new=r.msg.login_new;
// console.log( that.globalData.login_new)
// t.setData({
// obj: r.msg
// })
}
})
},
getmessagelist() {
let that = this
let url = '/information/get_all';
let data = {
page: 1,
pageNum: 10,
}
this.post(url, data, "POST").then((r) => {
// console.log(r)
// that.setData({
// messagelist: that.data.messagelist.concat(r.msg)
// })
let newlist = [];
r.msg.forEach(function (value, index, array) {
console.log(newlist)
if (value.status == 1) {
newlist.push(value)
}
})
console.log('77889944556',newlist)
if (newlist.length != 0) {
wx.showTabBarRedDot({
index: 1,
success: function (red) {
wx.setTabBarBadge({
index: 1,
text: newlist.length.toString(),
})
}
})
}
}).catch((err) => { })
},
onShow: function() {
console.log('hahahahhahahahhhahh')
},
//接口管理
interface: {
openid: '/getopenid/get', // 获取openid
getcode: '/getopenid/getcode', // 获取验证码,
getToken: '/user/getToken',
readteacher: '/getopenid/readteacher', // 获取个人信息
login: '/getopenid/smslogin', // 登录
jifenlist: '/order/jifenlist', // 积分列表
address: '/address/index', // 地址列表
addaddress: '/address/add', // 添加地址
editaddress: '/address/edit', // 修改地址
deladdress: '/address/delete', // 删除地址
mraddress: '/address/mo', // 修改默认地址
adshow: '/address/editshow', //地址详情(数据回显)
about: '/wb/wb', // 关于我们
order: '/order/orderlist', // 获取订单列表
payorder: '/order/payorder', // 订单页点击支付
disorder: '/order/disorder', // 订单列表取消订单
orderrefund: '/order/orderrefund', // 退换货详情
// upload: 'https://binhai.w.broing.cn/api/common/upload', // 上传图片
upload: 'https://binhai.w.brotop.cn/api',
refund: '/order/refund', // 退货提交
delorder: '/order/delorder', // 删除订单
okorder: '/order/okorder', // 确认订单
orderInfo: '/order/orderInfo', // 订单详情
kuaidi: '/kuaidi/kuaidi', //物流信息
collectdel: '/product/collectdel', //收藏删除
collectList: '/getopenid/collectlist', //收藏列表
deleteseach: '/product/deleteseach', //删除搜索历史
order_pay: '/order/pay', //订单支付
now_add: '/order/now_add', //点击结算
hotsreach: '/product/hotsreach', // 热门搜索
searchhis: '/product/searchhis', // 商品搜索历史
search: '/product/search', // 商品搜索结果列表
getPid: '/cap/getpid', // 分类页面
prev_pay: '/shop/prev_pay', // 购物车点击结算
gwcshop: '/shop/gwcshop', //购物车数量修改保存
deletes: '/shop/deletes', //购物车删除
shopcar: '/shop/shopcar', // 购物车页面
now_prev_pay: '/shop/now_prev_pay', // 直接购买
addshop: '/shop/addshop', // 添加购物车
collect: '/product/collect', // 收藏
getInfo: '/product/getInfo', //商品详情
good_list: '/product/get', // 商品
index: '/cap/get', // 首页大小分类
banner: '/banner/index', // 轮播图
notice: '/cap/notice', // 公告
youfei: '/shop/youfei1', // 单算邮费
youfei1: '/shop/youfei', // 購物車邮费
shopcarNum: '/shop/shopcarnum', // 购物车数量
orderlist: '/shop/orderlist', // 订单各状态数量
order_read: '/shop/read', // 订单数
},
globalData: {
login_new:"",
baseUrlimg :'https://binhaidispark.w.broing.cn/'
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/index/index",
"pages/chailvcode/chailvcode",
"pages/login/login",
"pages/register/register",
"pages/coupon/coupon",
"pages/lingqucoupon/lingqucoupon",
"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",
"pages/jumplink/jumplink",
"pages/birthday/birthday"
],
"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"
]
}
],
"preloadRule":{
"pages/index/index":{
"network":"all",
"packages": ["packageA"]
}
},
"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
... ...
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
.flex{
display:flex;
}
.flexone {
display: flex;
align-items: center;
}
.flextwo {
display: flex;
align-items: center;
justify-content: space-between;
}
.flexthree {
display: flex;
align-items: center;
justify-content: center;
}
.flex {
display: flex;
}
.flexone {
display: flex;
align-items: center;
}
.flextwo {
display: flex;
align-items: center;
justify-content: space-between;
}
.flexthree {
display: flex;
align-items: center;
justify-content: center;
}
.empty {
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 400;
color: #ccc;
margin-top: 200rpx;
text-align: center;
}
.oldprice{
color:#BDC4CE;
font-size: 24rpx;
text-decoration: line-through
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.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: "/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"
}
]
},
properties: {
selected: {
type: Number, // 接收父组件传过来的值
value: ''
},
text: {
type: Number, // 接收父组件传过来的值
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="tabBar">
<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}}" class="tabIcon"></image>
<view style="color: {{selected === index ? selectedColor : color}}" class="tabText">{{item.text}}</view>
</view>
</view>
... ...
.tabBar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
background: white;
display: flex;
z-index: 12000;
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 .tabIcon {
width: 28px;
height: 28px;
}
.tab-bar-item .tabText {
font-size: 10px;
}
.connect{
width:240rpx!important;
height:100rpx;
position: absolute;
top:0;
left:0;
background: transparent;
padding: none!important;
}
... ...

595 字节

533 字节

578 字节

976 字节

662 字节

740 字节

1007 字节

688 字节