接口调用
24
App.vue
|
@ -11,11 +11,11 @@
|
|||
let windowHeight = uni.getSystemInfoSync().windowHeight;
|
||||
// 获取状态栏的高度
|
||||
let statusHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||
uni.setStorageSync('hostapi','https://peili.scdxtc.cn/api/'); // 配置全局域名
|
||||
uni.setStorageSync('hostapi','https://peili.scdxtc.cn'); // 配置全局域名
|
||||
uni.setStorageSync('statusBar',statusHeight); // 缓存状态栏高度
|
||||
toolAll.tools.networkStatus(); //检查当前网络状态
|
||||
toolAll.tools.clearClog(); //去除体验版和正式版的所有输出日志
|
||||
toolAll.tools.overdue(); //查询是否第一次授权
|
||||
// toolAll.tools.overdue(); //查询是否第一次授权
|
||||
uni.setStorageSync('publicColor','#000000'); // 设置主色调
|
||||
// 设置scroll-view的高度一
|
||||
uni.setStorageSync('scrollHeight-one',windowHeight - (statusHeight + 50 + 59)); // 头部 + 底部
|
||||
|
@ -32,16 +32,16 @@
|
|||
uni.setStorageSync('footTitle',['首页','分类','我的','购物车'])
|
||||
uni.setStorageSync('footimg',[
|
||||
{
|
||||
iconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b284c96dd7.png",
|
||||
selectedIconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b284c9704a.png"
|
||||
iconPath: "/static/public/mo-home.png",
|
||||
selectedIconPath: "/static/public/active-home.png"
|
||||
},
|
||||
{
|
||||
iconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b2865a344f.png",
|
||||
selectedIconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b28659f34f.png"
|
||||
iconPath: "/static/public/mo-function.png",
|
||||
selectedIconPath: "/static/public/active-function.png"
|
||||
},
|
||||
{
|
||||
iconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b286da1ddc.png",
|
||||
selectedIconPath: "https://oss.hmzfyy.cn/storage/images/202202/620b286da2073.png"
|
||||
iconPath: "/static/public/mo-person.png",
|
||||
selectedIconPath: "/static/public/active-person.png"
|
||||
},
|
||||
{
|
||||
iconPath: "https://s6.jpg.cm/2022/02/17/LBETnT.png",
|
||||
|
@ -50,13 +50,11 @@
|
|||
])
|
||||
},
|
||||
onShow: function() {
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
// 开始埋点倒计时
|
||||
toolAll.tools.daoTime();
|
||||
}
|
||||
// 检测是否登录过期或是否登录
|
||||
toolAll.tools.overdue();
|
||||
},
|
||||
onHide: function() {
|
||||
toolAll.tools.closeTimer();//清空埋点倒计时
|
||||
uni.removeStorageSync('isorderDetail');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,34 +1,3 @@
|
|||
/* 首页 */
|
||||
.status-box{position: fixed;top: 0;left: 0;right: 0;z-index: 10;}
|
||||
.status-nav{width: 100%;position: relative;display: flex;align-items: center;}
|
||||
/* .status-nav{width: 100%;position: relative;padding: 30rpx 0;display: flex;align-items: center;} */
|
||||
.tab-title{font-size: 36rpx;font-weight: bold;color: #333333;width: 100%;}
|
||||
.tcenter{text-align: center;}
|
||||
.input-box{width: 100%;}
|
||||
.input-box>view{background-color: #FFFFFF;margin: 0 40rpx;height: 80rpx;border-radius: 10rpx;padding: 0 17rpx;}
|
||||
.searchImg{width: 28rpx;height: 28rpx;margin-right: 12rpx;}
|
||||
.linev{height: 39rpx;border: 2rpx dashed rgba(136, 136, 136, 1);}
|
||||
.searchT{font-size: 27rpx;margin: 0 23rpx 0 31rpx;}
|
||||
.gongg-box{width: 25%;color: #2C2C2C;}
|
||||
.gongg-box .img-box image{width: 108rpx;height: 108rpx;}
|
||||
.zou> image{height: auto;}
|
||||
.fawen-img{width: 335rpx;height: 400rpx;}
|
||||
.fawen-itemImg{height: 190rpx;}
|
||||
.kitemm{background-color: #E0E0E0;}
|
||||
.reitem-box{background: #F4F4F4;margin-right: 18rpx;padding: 20rpx;}
|
||||
.reitem-box>image{width: 20rpx;height: 23rpx;margin-right: 18rpx;}
|
||||
.reitem{width: 146rpx;height: 65rpx;border-radius: 20rpx;line-height: 65rpx;text-align: center;}
|
||||
.list-box{width: 48.4%;}
|
||||
.list-like-box{top: 18rpx;right: 18rpx;z-index: 1;}
|
||||
.list-like-box>image:first-child {opacity: 0.5;}
|
||||
.list-like-box>image{width: 69rpx;height: 69rpx;}
|
||||
.list-cont-box{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;}
|
||||
.list-cont-box15{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 15rpx;border-bottom-right-radius: 15rpx;}
|
||||
.list-headimg{width: 28rpx;height: 28rpx;margin-right: 6rpx;border-radius: 100%;}
|
||||
.home-quan-box{background: rgba(0,0,0,.54);position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 11;display: flex;justify-content: center;flex-direction: column;align-items: center;}
|
||||
.home-quan-box image:first-child{width: 542rpx;height: 600rpx;}
|
||||
.home-quan-box image:last-child{width: 96rpx;height: 96rpx;margin-top: 56rpx;}
|
||||
.shopKf{position: fixed;right: 16rpx;bottom: 140rpx;z-index: 999;}
|
||||
/* 分类 */
|
||||
.sort-box {background-color: #ececee;position: sticky;z-index: 6;}
|
||||
.screen-box{position: fixed;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.5);z-index: 12;}
|
||||
|
@ -38,141 +7,13 @@
|
|||
.screen-btn view {height: 80rpx;width: 229rpx;text-align: center;line-height: 80rpx;}
|
||||
.screen-btn view:first-child{border: 2rpx solid #8c8c9b;}
|
||||
.screen-btn view:last-child{border: 2rpx solid #000000;background-color: #000000;}
|
||||
/* 搜索 */
|
||||
.search-input-box{width: 100%;padding-bottom: 20rpx;}
|
||||
.tank-box{margin: 0 85rpx;}
|
||||
.tank-box-itemone{font-size: 32rpx;color: #343434;margin: 90rpx 0;}
|
||||
.tank-btn{width: 240rpx;}
|
||||
/* 我的页面 */
|
||||
.icon-box>image:nth-child(1){width: 37rpx;height: 38rpx;}
|
||||
.icon-box>image:nth-child(2){width: 32rpx;height: 34rpx;}
|
||||
.icon-box>image:nth-child(3){width: 31rpx;height: 37rpx;}
|
||||
.icon-box>image:nth-child(4){width: 32rpx;height: 33rpx;}
|
||||
.icon-box>image:nth-child(5){width: 33rpx;height: 35rpx;}
|
||||
.icon-box>image:nth-child(6){width: 35rpx;height: 32rpx;}
|
||||
.icon-box>image:nth-child(7){width: 36rpx;height: 35rpx;}
|
||||
.sigin-box{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);}
|
||||
.sigin-box view{padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;}
|
||||
.person-m{width: 325rpx;height: 325rpx;margin: 30rpx 86rpx 68rpx 86rpx;}
|
||||
.close-m{width: 96rpx;height: 96rpx;border-radius: 100%;}
|
||||
.red-num{width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;background: #F96969;right: 50rpx;top: 0;font-size: 22rpx;color: #FFFFFF;text-align: center;}
|
||||
.icon-img{width: 60rpx;height: 60rpx;}
|
||||
.white-next{width: 22rpx;height: 22rpx;}
|
||||
.yuan-box>view{width: 100%;display: flex;justify-content: center;align-items: center;position: relative;}
|
||||
.yuan-box .xian-right{height: 58rpx;width: 2rpx;background-color: #E6E6E6;right: 0;position: absolute;}
|
||||
.yuan-box image{width: 54rpx;height: 54rpx;}
|
||||
.blue-img{position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;}
|
||||
.gao .posia{left: -32rpx;right: -32rpx;z-index: -1;}
|
||||
.gao .mar-sx30{width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;}
|
||||
.gao-name{background: #FFBD39;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFFFFF;padding: 5rpx 16rpx;margin-left: 10rpx;}
|
||||
.gao-phone{width: 14rpx;height: 20rpx;}
|
||||
.gao-m{width: 43rpx;height: 43rpx;z-index: 1;}
|
||||
.gao-next-box{width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;}
|
||||
.gao-next-box image{width: 35rpx;height: 35rpx;z-index: 1;}
|
||||
/* 暂无内容时,显示的图片大小 */
|
||||
.zanw-img{width: 474rpx;height: 273rpx;}
|
||||
/* 修改资料页面 */
|
||||
.head_img{width: 140rpx;height: 140rpx;border-radius: 100%;}
|
||||
.nic{color: #101010;}
|
||||
.head_next{width: 19rpx;height: 19rpx;}
|
||||
/* 自主预约 */
|
||||
.xiala{border: 2rpx solid #CECECE;height: 80rpx;line-height: 80rpx;}
|
||||
.xiala image{width: 35rpx;height: 24rpx;}
|
||||
.yutime{width: 160rpx;height: 130rpx;}
|
||||
.timed{width: 210rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.titlel{width: 18%;}
|
||||
.titlel2{width: 20%;}
|
||||
.height-68{height: 80rpx;}
|
||||
.btnl{margin: 50rpx 80rpx;height: 90rpx;line-height: 90rpx;}
|
||||
/* 客户列表 */
|
||||
.xialak{height: 60rpx;line-height: 60rpx;border: 2rpx solid #E0E0E0;}
|
||||
.xialak image{width: 35rpx;height: 24rpx;}
|
||||
.customer-btn{height: 60rpx;width: 143rpx;line-height: 60rpx;}
|
||||
/* 医生 */
|
||||
.qdoctor:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width: 10rpx;height: 40rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #3875F6;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.doctoritem:before{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 4rpx solid #3875F6;
|
||||
background-color: #3875F6;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
/* .zhuan{transition: all 1s;transform: rotate(90deg);} */
|
||||
.nozhuan{transition: all 1s;transform: rotate(0deg);}
|
||||
.xial-box{top: 80rpx;left: 0;right: 0;z-index: 4;border: 2rpx solid #E0E0E0;}
|
||||
.xial-item-box{max-height: 400rpx;overflow-y: scroll; overflow-x: hidden;}
|
||||
.doctorx{margin: 0 15rpx;height: 18rpx;border: 2rpx solid #E6E6E6;}
|
||||
.doctorImg{width: 100%;height: 285rpx;border-top-left-radius: 10rpx;border-top-right-radius: 10rpx;}
|
||||
.isTop{background-color: #FFFFFF;box-shadow: 0rpx 3rpx 10rpx rgba(0,0,0,.6);}
|
||||
.isTops{position: sticky;left: 0;right: 0;z-index: 2;}
|
||||
.isTopf{position: fixed;left: 0;right: 0;z-index: 2;}
|
||||
|
||||
/* 底部联系客服、分享、返回首页 */
|
||||
.btnBKS{height: 120rpx;}
|
||||
.lianShare{height: 90rpx;width: 220rpx;}
|
||||
.backH{width: 190rpx;height: 190rpx;top: -126rpx;}
|
||||
.addCart-btn{border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;background-color: #3875F6;}
|
||||
.mai-btn{border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;background-color: #F85050;}
|
||||
/* 商城 */
|
||||
.shop-nav-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.shop-nav-box>view:first-child view,.jf-input-box>view:first-child view{height: 80rpx;line-height: 80rpx;}
|
||||
.shop_list_box>view>view:last-child{margin-bottom: 200rpx;}
|
||||
.shop-nav-box .pad-zy50 view:nth-child(n+2){background: #3875F6;color: #FFFFFF;border-radius: 30rpx;padding: 8rpx 20rpx;font-size: 24rpx;display: flex;align-items: center;margin-right: 20rpx;margin-top: 30rpx;}
|
||||
.shop-nav-box .mar-s40{height: 60rpx;border: 2rpx solid #E0E0E0;border-radius: 10rpx;width: 100%;box-sizing: border-box;padding-left: 20rpx;font-size: 24rpx;}
|
||||
.shop-nav-box .mar-x30 view{font-size: 28rpx;width: 294rpx;height: 60rpx;border-radius: 10rpx;text-align: center;line-height: 60rpx; }
|
||||
.shop-nav-box .mar-x30 view:first-child{background: #E6E6E6;color: #4D4D4D;}
|
||||
.shop-nav-box .mar-x30 view:last-child{background: #3875F6;color: #FFFFFF;}
|
||||
.activebcate,.shopBMo{border-radius: 20rpx;background-color: #f2f2f2;color: #333333;padding: 12rpx 24rpx;}
|
||||
.activebcate{color: #FFFFFF;}
|
||||
|
||||
.jf-input-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.jf-input-box image{width: 16rpx;height: 13rpx;}
|
||||
.jf-input-box image:last-child{margin-top: 4rpx;}
|
||||
.cart-box{position: fixed;right: 30rpx;bottom: 200rpx;}
|
||||
.cart-box .posir,.cart-box .posir image,.detail-cart-box .posir,.detail-cart-box .posir image{width: 112rpx;height: 112rpx;}
|
||||
.cart-box .posia,.detail-cart-box .posia{background: #F85050;width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;color: #FFFFFF;font-size: 24rpx;text-align: center;top: 20rpx;right: 20rpx;}
|
||||
.cart-box .posia view,.detail-cart-box .posia view{transform: scale(.8);}
|
||||
.moban{background: rgba(0,0,0,.54);width: 100%;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 2;}
|
||||
.detail-cart-box{position: fixed;right: 30rpx;bottom: 300rpx;z-index: 999;}
|
||||
/* 商品详情 */
|
||||
.activity-img{background: url(/static/public/icon-time-limit.png) no-repeat;background-size: 100% 100%;top: 10rpx;right: 10rpx;}
|
||||
.activelei,.molei{border-radius: 20rpx;padding: 10rpx 24rpx;color: #333333;margin-left: 20rpx;}
|
||||
.activelei{color: #FFFFFF;}
|
||||
.shop-price{color: #F85050;font-size: 40rpx;font-weight: bold;}
|
||||
.shop-price span:last-child{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;margin-left: 20rpx;}
|
||||
.yuan-price{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;}
|
||||
.shar-box{margin-top: -20rpx;padding-bottom: 20rpx;}
|
||||
.shar-box>view:first-child image{width: 42rpx;height: 30rpx;}
|
||||
.shop-swiper{height: 280rpx;padding-top: 20rpx;}
|
||||
.big-img{width: 70rpx;height: 70rpx; border-radius: 100%;}
|
||||
.shop-swiper .bold{width: 140rpx;height: 80rpx;line-height: 80rpx;text-align: center;background: #F85050;border-radius: 20rpx;}
|
||||
.duan-xian{border-bottom: 2rpx solid #E6E6E6;position: absolute;bottom: 0;width: 87%;right: 0;}
|
||||
.bottom-popu,.order-cancle-tk{border-radius: 40rpx 40rpx 0rpx 0rpx;}
|
||||
.bottom-popu>view:first-child image{width: 214rpx;height: 214rpx;border-radius: 15rpx;bottom: 0;flex-shrink: 0;margin-top: -107rpx;margin-right: 30rpx;}
|
||||
.bottom-popu>view:first-child .width100 image{width: 24px;height: 24px;margin-top: -20rpx;}
|
||||
.del-btn,.add-btn{width: 65rpx;height: 30px;}
|
||||
.num-input{width: 80rpx;height: 28px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||
.ev-btn{width: 294rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 10rpx;}
|
||||
.pd-tk-box{position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 6;background: rgba(0,0,0,.54);display: flex;justify-content: center;align-items: center;}
|
||||
.pd-tk-box .posir{font-weight: 500;text-align: center;margin: 0 85rpx;height: 458rpx;}
|
||||
.pd-tk-box .posir view:nth-child(1){margin: 34rpx 0 27rpx 0;}
|
||||
.pd-tk-box .posir view:nth-child(2){margin-bottom: 63rpx;}
|
||||
.pd-tk-box .posir view:nth-child(3){margin-bottom: 77rpx;}
|
||||
.pd-tk-box .posir view:nth-child(3) image:nth-child(1),.pd-tk-box .posir view:nth-child(3) image:nth-child(3){width: 100rpx;height: 100rpx;border-radius: 100%;}
|
||||
.pd-tk-box .posir view:nth-child(3) image:nth-child(2){width: 42rpx;height: 42rpx;margin: 0 47rpx;}
|
||||
.pd-tk-box .posir view:nth-child(4){width: 464rpx;height: 60rpx;line-height: 60rpx;color: #FFFFFF;background: #F85050;border-radius: 10rpx;margin: 0 auto;font-size: 28rpx;}
|
||||
.pd-tk-box .posir>image{width: 77rpx;height: 77rpx;right: -30rpx;top: -30rpx;}
|
||||
swiper-item view:last-child .duan-xian{border-bottom: none;}
|
||||
.score-box{width: 100%;height: 90rpx;line-height: 90rpx;padding-left: 62rpx;background: #3875F6;color: #FFFFFF;font-size: 40rpx;font-weight: bold;}
|
||||
.activity-img{background: url(/static/public/icon-time-limit.png) no-repeat;background-size: 100% 100%;top: 10rpx;right: 10rpx;}
|
||||
/* 准备下单 */
|
||||
.activeT,.expressT{width: 124rpx;height: 60rpx;line-height: 60rpx;text-align: center;margin-left: 20rpx;border-radius: 20rpx;}
|
||||
.activeT{color: #FFFFFF;}
|
||||
|
@ -199,75 +40,26 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
|||
.success-box image{width: 194rpx;height: 194rpx;}
|
||||
.success-hj{font-size: 46rpx;margin-bottom: 120rpx;color: #F85050;}
|
||||
/* 立即支付页面 */
|
||||
.chooseDX,.quan-item-box>view:last-child image{width: 40rpx;height: 40rpx;border-radius: 100%;}
|
||||
.dao-box{padding: 55rpx 0 64rpx 0;text-align: center;}
|
||||
.submit-pay{margin: 0 auto;color: #FFFFFF;font-weight: bold;font-size: 36rpx;text-align: center;width: 546rpx;height: 90rpx;line-height: 90rpx;background-color: #3875F6;border-radius: 20rpx;}
|
||||
.success-btn{margin-bottom: 150rpx;}
|
||||
.success-btn view{width: 244rpx;height: 70rpx;border-radius: 10rpx;text-align: center;line-height: 70rpx;}
|
||||
.success-btn view:first-child{background: #E9E9E9;color: #333333;}
|
||||
/* 购物车页面 */
|
||||
.edit-btn{width: 113rpx;height: 43rpx;border-radius: 20rpx;background: #3875F6;text-align: center;color: #FFFFFF;line-height: 43rpx;}
|
||||
.cart-list-box{overflow: hidden;}
|
||||
.cart-input-box{border-radius: 4rpx;overflow: hidden;}
|
||||
.cart-input-box image{width: 46rpx;height: 26px;}
|
||||
.cart-input-box input{width: 60rpx;height: 24px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||
.goBuy-btn{width: 200rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 35rpx;}
|
||||
.chooseAll-box{width: 40rpx;height: 40rpx;border-radius: 100%;border: 2rpx solid #3875F6;flex-shrink: 0;display: flex;justify-content: center;align-items: center;}
|
||||
.chooseAll-box view{width: 24rpx;height: 24rpx;background-color: #3875F6;border-radius: 100%;}
|
||||
.item-del-btn{width: 117rpx;height: 205rpx;background: #F85050;line-height: 205rpx;text-align: center;color: #FFFFFF;font-size: 24rpx;flex-shrink: 0;position: absolute;right: 0;bottom: 40rpx;top: 2rpx;}
|
||||
/* 我的订单页面 */
|
||||
.order-item-box image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
|
||||
.order-hx-img{width: 325rpx;height: 325rpx;}
|
||||
.order-close-btn{width: 40rpx;height: 40rpx;right: 50rpx;top: 20rpx;}
|
||||
.order-btn{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #F85050;color: #FFFFFF;margin-left: 45rpx;}
|
||||
.order-cancle{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #E9E9E9;color: #808080;}
|
||||
.heyan-close{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
|
||||
.confirm-btn{font-size: 36rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 100rpx 20rpx 100rpx;}
|
||||
/* 地址管理页面 */
|
||||
.address_active{width: 40rpx;height: 40rpx;}
|
||||
.address_add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 0 93rpx;}
|
||||
.address_add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 30rpx;height: 98rpx;line-height: 98rpx;text-align: center;margin: 0 30rpx;}
|
||||
.xiao-sanj image{width: 14rpx;height: 11rpx;}
|
||||
.xiao-sanj image:last-child{margin-top: 4rpx;}
|
||||
.address-btn-add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 76rpx 20rpx 76rpx;}
|
||||
.address-close-btn{width: 77rpx;height: 77rpx;right: -55rpx;top: -36rpx;}
|
||||
.address-btn-add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 30rpx;height: 98rpx;line-height: 98rpx;text-align: center;margin: 80rpx 0rpx 20rpx 0rpx;}
|
||||
.address-close-btn{width: 77rpx;height: 77rpx;right: -80rpx;top: -36rpx;}
|
||||
.info-box{background: #fff;left: 0;right: 0;top: 52rpx;height: 0rpx;transition: all 0.5s;border: 2rpx solid #E6E6E6;opacity: 0; z-index: 6;overflow: hidden;overflow-y: scroll;color: #666;}
|
||||
.info-box view{margin: 10rpx;font-size: 24rpx;}
|
||||
.dong {height: 200rpx;border: 2rpx solid #E6E6E6;opacity: 1;}
|
||||
/* 优惠券页面 */
|
||||
.quan-btn{width: 136rpx;height: 48rpx;line-height: 48rpx;text-align: center;border-radius: 30rpx;background: #FFFFFF;color: #3875F6;margin-right: -10rpx;}
|
||||
.quan-img{width: 218rpx;height: 200rpx;left: 0;top: 0;}
|
||||
.quan-right-box{display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #FFFFFF;}
|
||||
.quan-use{width: 94rpx;height: 94rpx;right: 20rpx;top: 20rpx;}
|
||||
.quan-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);z-index: 3;}
|
||||
.quan-tk-btn{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
|
||||
.receive-left{width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;}
|
||||
/* 活动任务 */
|
||||
.activity-dai{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;}
|
||||
.activity-mo{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #CCCCCC;}
|
||||
.task-cancle-btn,.task-confrim-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;border-radius: 10rpx;}
|
||||
.task-cancle-btn{background: #E6E6E6;color: #FFFFFF;}
|
||||
.task-confrim-btn{background: #3875F6;color: #FFFFFF;}
|
||||
.imgIng{width: 340rpx;height: 348rpx;border-radius: 10rpx;margin-bottom: 70rpx;}
|
||||
.task-add-box{width: 340rpx;height: 348rpx;background: #F0F0F0;border-radius: 10rpx;margin-bottom: 70rpx;}
|
||||
.task-add{width: 100rpx;height: 6rpx;background: #B3B3B3;border-radius: 10rpx;}
|
||||
/* 签到页面 */
|
||||
.sigin-img{width: 218rpx;height: 202rpx;margin: 0 auto;}
|
||||
.sigin-success{width: 31rpx;height: 30rpx;margin-top: 20rpx;}
|
||||
.sigin-day{width: 66rpx;height: 66rpx;border-radius: 100%;border: 2rpx solid #FFFFFF;}
|
||||
.sigin-day image{width: 27rpx;height: 27rpx;border-radius: 100%;border: 1rpx solid #759FFD;text-align: center;line-height: 27rpx;color: #759FFD;background: #FFFFFF;font-size: 20rpx;right: 0rpx;bottom: -8rpx;}
|
||||
/* 孔雀币页面 */
|
||||
.coin-tx-btn{width: 152rpx;height: 60rpx;line-height: 60rpx;text-align: center;color: #FFFFFF;background: #3875F6;border-radius: 30rpx;font-size: 26rpx;}
|
||||
.coin-yuan{font-size: 26rpx;font-weight: 400;}
|
||||
.coin-miao{height: 60rpx;line-height: 60rpx;}
|
||||
.coin-share-box{width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);}
|
||||
.coin-share-box image {width: 50rpx;height: 50rpx;}
|
||||
.tx-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);}
|
||||
.tx-tk-box input{border: 2rpx solid #E0E0E0;margin-bottom: 80rpx;height: 60rpx;}
|
||||
.tk-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;border-radius: 10rpx;font-size: 28rpx;color: #FFFFFF;}
|
||||
.tk-btn:last-child{background-color: #C8C8C8;}
|
||||
|
||||
|
||||
/* 我的订单页面 */
|
||||
.order-hx-img{width: 325rpx;height: 325rpx;}
|
||||
.order-close-btn{width: 40rpx;height: 40rpx;right: 50rpx;top: 20rpx;}
|
||||
/* 订单详情 */
|
||||
.orderInfo-btn{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;background: #3875F6;color: #FFFFFF;margin-left: 20rpx;}
|
||||
.paid-btn-box view{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;}
|
||||
|
@ -279,21 +71,17 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
|||
.orderDetail-sku{font-size: 22rpx;color: #808080;font-weight: 500;}
|
||||
.orderDetail-bottom-box{height: 124rpx;padding: 0 32rpx;display: flex;align-items: center;border-top: 2rpx solid #F5F5F5;}
|
||||
.orderDetail-bottom-box image{width: 56rpx;height: 56rpx;}
|
||||
|
||||
/* 积分管理页面 */
|
||||
.score-img{width: 108rpx;height: 108rpx;flex-shrink: 0;}
|
||||
.score-people-box{display: flex;justify-content: space-between;flex-direction: column;height: 108rpx;}
|
||||
.score-sigin-btn{width: 140rpx;height: 40rpx;line-height: 40rpx;text-align: center;color: #FFFFFF;background: #F6C338;border-radius: 30rpx;font-size: 24rpx;font-weight: 400;}
|
||||
.score-share-box{width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);}
|
||||
.score-share-box image{width: 50rpx;height: 50rpx;}
|
||||
/* 消息页面 */
|
||||
.message-img{width:46rpx;height:56rpx;}
|
||||
.message-status{border-radius: 5rpx;font-size: 24rpx;color: #FFFFFF;padding: 2rpx 8rpx 4rpx 6rpx;transform: scale(.8);}
|
||||
|
||||
.order-btn{
|
||||
width: 150rpx;height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
border-radius: 20rpx;
|
||||
background-color: #f6f6f6;
|
||||
color: #8c8c9b;
|
||||
border: 1rpx solid #d3d3d3;
|
||||
}
|
||||
/* 关于我们 */
|
||||
.navigate-to-where {height: 98rpx;line-height: 98rpx;}
|
||||
|
||||
|
||||
/* 分销中心 */
|
||||
.withdrawal-btn{height: 98rpx;line-height: 98rpx;}
|
||||
.withdrawal-box{position: fixed;top: 0;bottom: 0;left: 0;right: 0;background-color: rgba(0,0,0,.2);}
|
||||
|
@ -303,19 +91,15 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
|||
|
||||
|
||||
|
||||
@media screen and (height:812px){
|
||||
.blue-img{height: 500rpx;}
|
||||
/* @media screen and (height:812px){
|
||||
}
|
||||
@media screen and (height:844px){
|
||||
.blue-img{height: 496rpx;}
|
||||
}
|
||||
@media screen and (height:896px){
|
||||
.blue-img{height: 486rpx;}
|
||||
}
|
||||
@media screen and (min-height:926px){
|
||||
.blue-img{height: 490rpx;}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -485,6 +269,9 @@ button:after{content: none!important;}
|
|||
.peili-backColor{background-color: #fe2525;}
|
||||
|
||||
|
||||
/* 文本居中方式 */
|
||||
.tcenter{text-align: center;}
|
||||
|
||||
|
||||
/* 圆角 */
|
||||
.radius10{border-radius: 10rpx;}
|
||||
|
@ -537,6 +324,10 @@ button:after{content: none!important;}
|
|||
.mar-s80{margin-top: 80rpx;}
|
||||
.mar-s90{margin-top: 90rpx;}
|
||||
.mar-s100{margin-top: 100rpx;}
|
||||
.mar-s120{margin-top: 120rpx;}
|
||||
.mar-s140{margin-top: 140rpx;}
|
||||
.mar-s160{margin-top: 160rpx;}
|
||||
.mar-s180{margin-top: 180rpx;}
|
||||
/* 下---外边距 */
|
||||
.mar-x10{margin-bottom: 10rpx;}
|
||||
.mar-x20{margin-bottom: 20rpx;}
|
||||
|
@ -546,6 +337,15 @@ button:after{content: none!important;}
|
|||
.mar-x36{margin-bottom: 36rpx;}
|
||||
.mar-x40{margin-bottom: 40rpx;}
|
||||
.mar-x50{margin-bottom: 50rpx;}
|
||||
.mar-x60{margin-bottom: 60rpx;}
|
||||
.mar-x70{margin-bottom: 70rpx;}
|
||||
.mar-x80{margin-bottom: 80rpx;}
|
||||
.mar-x90{margin-bottom: 90rpx;}
|
||||
.mar-x100{margin-bottom: 100rpx;}
|
||||
.mar-x120{margin-bottom: 120rpx;}
|
||||
.mar-x140{margin-bottom: 140rpx;}
|
||||
.mar-x160{margin-bottom: 160rpx;}
|
||||
.mar-x180{margin-bottom: 180rpx;}
|
||||
/* 左---外边距 */
|
||||
.mar-z10{margin-left: 10rpx;}
|
||||
.mar-z20{margin-left: 20rpx;}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3180711 */
|
||||
src: url('https://at.alicdn.com/t/font_3180711_o717yf8virj.woff2?t=1645176467979') format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_3180711_o717yf8virj.woff?t=1645176467979') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_3180711_o717yf8virj.ttf?t=1645176467979') format('truetype');
|
||||
src: url('https://at.alicdn.com/t/font_3180711_ox3eswimm9g.woff2?t=1645410881050') format('woff2'),
|
||||
url('https://at.alicdn.com/t/font_3180711_ox3eswimm9g.woff?t=1645410881050') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_3180711_ox3eswimm9g.ttf?t=1645410881050') format('truetype');
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
@ -13,6 +13,14 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-address-check:before {
|
||||
content: "\e6c2";
|
||||
}
|
||||
|
||||
.icon-address-unchecked:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.icon-navigate-now:before {
|
||||
content: "\e640";
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
this.$requst.post('/api/user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.visible = true;
|
||||
|
@ -174,7 +174,7 @@
|
|||
is_active:1,
|
||||
channel:uni.getStorageSync('channel')
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
this.$requst.post('/api/user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params);
|
||||
uni.setStorageSync('userId',res.data.account_id);
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
<template>
|
||||
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
|
||||
<view class="posir">
|
||||
<image @tap="backHome" class="posia backH" src="/static/public/back-home-02.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disac fon26 colf">
|
||||
<view @tap="lianK" class="disac posir lianShare" style="background-color: #3875F6; border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;">
|
||||
<image src="/static/public/bottom-customer.png" class="mar-zy20" style="width: 47rpx;height: 47rpx;" mode="aspectFill"></image>
|
||||
<view>联系客服</view>
|
||||
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
<view class="disac posir lianShare" style="background-color: #38CE51;border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;">
|
||||
<image src="/static/public/bottom-shear.png" style="width: 47rpx;height: 47rpx;margin-left: 15rpx;margin-right: 8rpx;" mode="aspectFill">
|
||||
</image>
|
||||
<view>分享给好友</view>
|
||||
<button class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"bottom-tab",
|
||||
data() {
|
||||
return {
|
||||
haveImg: true,
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
backHome() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
lianK() { //客服
|
||||
this.$requst.post('user/rand-bind-service').then(res => {})
|
||||
this.$requst.post('user/record', {
|
||||
type: 'other',
|
||||
action: 'ask',
|
||||
id: 0
|
||||
}).then(res => {}, error => {})
|
||||
let maiOjb = {
|
||||
e: 5, //内容咨询
|
||||
t: new Date().getTime() //当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -1,38 +1,36 @@
|
|||
<template>
|
||||
<view class="pad-x140" :class="dataList.length ? '' : 'display-center-center'">
|
||||
<scroll-view scroll-y v-if="dataList.length">
|
||||
<view>
|
||||
<view v-for="(item,index) in dataList" :key="index"
|
||||
class="item-box display-between-center">
|
||||
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
||||
<!-- 勾选按钮 -->
|
||||
<view class="circle-box display-center-center flex-shrink" :class="item.isActive ? 'circle-box-active' : ''"></view>
|
||||
<!-- 商品图片 -->
|
||||
<image class="shop-img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="item-right-box display-between-column">
|
||||
<view>
|
||||
<!-- 商品标题 -->
|
||||
<view class="clips2 item-title">{{item.title}}</view>
|
||||
<!-- 规格 -->
|
||||
<view class="item-specs">
|
||||
<view>{{item.specs1}}</view>
|
||||
</view>
|
||||
<scroll-view scroll-y v-if="dataList.length" @scrolltolower="touchBottomEv">
|
||||
<view v-for="(item,index) in dataList" :key="index"
|
||||
class="item-box display-between-center">
|
||||
<view @tap="chooseItem(index)" class="display-center-center flex-shrink">
|
||||
<!-- 勾选按钮 -->
|
||||
<view class="circle-box display-center-center flex-shrink" :class="item.isActive ? 'circle-box-active' : ''"></view>
|
||||
<!-- 商品图片 -->
|
||||
<image class="shop-img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="item-right-box display-between-column width100">
|
||||
<view @tap="goDetail(item.id)">
|
||||
<!-- 商品标题 -->
|
||||
<view class="clips2 item-title">{{item.title}}</view>
|
||||
<!-- 规格 -->
|
||||
<view class="item-specs">
|
||||
<view>{{item.specs1}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="display-between-center">
|
||||
<!-- 价格 -->
|
||||
<view class="item-price">¥{{item.price}}</view>
|
||||
<!-- 加减按钮 -->
|
||||
<view class="display-between-center">
|
||||
<!-- 价格 -->
|
||||
<view class="item-price">¥{{item.price}}</view>
|
||||
<!-- 加减按钮 -->
|
||||
<view class="display-between-center">
|
||||
<!-- 减 -->
|
||||
<button @tap="deladdEvent( item.id , index , 0)" :disabled="item.num==1" class="item-btn display-center-center">﹣</button>
|
||||
<!-- 输入框 -->
|
||||
<view class="input-box display-center-center">
|
||||
<input type="text" v-model="item.num" />
|
||||
</view>
|
||||
<!-- 加 -->
|
||||
<button @tap="deladdEvent( item.id , index , 1)" class="item-btn display-center-center">﹢</button>
|
||||
<!-- 减 -->
|
||||
<button @tap="deladdEvent( item.id , index , 0)" :disabled="item.num==1" class="item-btn display-center-center">-</button>
|
||||
<!-- 输入框 -->
|
||||
<view class="input-box display-center-center">
|
||||
<input type="text" v-model="item.num" />
|
||||
</view>
|
||||
<!-- 加 -->
|
||||
<button @tap="deladdEvent( item.id , index , 1)" class="item-btn display-center-center">+</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -42,15 +40,15 @@
|
|||
<!-- 底部导航 -->
|
||||
<view class="display-between-center cart-foot-box">
|
||||
<!-- 全选 -->
|
||||
<view @tap="chooseAll" class="display--center check-all-box">
|
||||
<view @tap="chooseAll" class="display--center">
|
||||
<view class="circle-check-all display-center-center"
|
||||
:class="ifCheckAll ? 'circle-check-all-active' : ''"></view>
|
||||
全选
|
||||
</view>
|
||||
<!-- 合计 -->
|
||||
<view>合计:{{totalPrice}}</view>
|
||||
<view class="allprice-box">合计:{{totalPrice}}</view>
|
||||
<!-- 立即结算 -->
|
||||
<view class="cart-settlement">{{dataList.length ? '立即结算' : '去购物'}}</view>
|
||||
<view class="cart-settlement" @tap="gopageEv">{{dataList.length ? '立即结算' : '去购物'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -66,7 +64,7 @@
|
|||
totalPrice(){
|
||||
let totalPrice = 0;
|
||||
this.dataList.forEach(item=>{
|
||||
if(item.isActive) totalPrice += item.price*1 * item.num*1;
|
||||
if(item.isActive) totalPrice += item.reckonPrice*1 * item.num*1;
|
||||
})
|
||||
return totalPrice;
|
||||
}
|
||||
|
@ -144,14 +142,78 @@
|
|||
// imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
// title:'于亿年宝藏中臻选1的宝石级钻石每年开采数LOVE100 星座光的原石挑选 ',
|
||||
// specs1:'颜色:白色',
|
||||
// price:2000,
|
||||
// price:3000,
|
||||
// num:1
|
||||
// }
|
||||
// ],
|
||||
ifCheckAll:false
|
||||
ifCheckAll:false,
|
||||
page:1, // 第几页
|
||||
size:10, // 数量
|
||||
total:0, // 总数
|
||||
pitera:false, // 是否显示暂无数据
|
||||
};
|
||||
},
|
||||
// 执行顺序 第一
|
||||
beforeCreate(){
|
||||
|
||||
},
|
||||
// 执行顺序 第四
|
||||
mounted() {
|
||||
// 查询购物车列表
|
||||
this.checkList();
|
||||
},
|
||||
methods:{
|
||||
// 去商品详情
|
||||
goDetail(id){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
// 去结算、去购物事件
|
||||
gopageEv(){
|
||||
if(this.dataList.length){
|
||||
if(this.totalPrice){
|
||||
let newList = [];
|
||||
this.dataList.forEach(item=>{
|
||||
if(item.isActive){
|
||||
let obj = {
|
||||
id:item.id,//商品id
|
||||
imgSrc:item.imgSrc,//商品图片
|
||||
coding:item.coding,//商品coding
|
||||
price:item.reckonPrice,//商品价格
|
||||
num:item.num,//商品数量
|
||||
title:item.title,//商品名称
|
||||
}
|
||||
newList.push(obj);
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('orderList',newList);
|
||||
uni.navigateTo({url:'/pagesA/getReadyDan/getReadyDan'});
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('请选择要购买的商品');
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({url:'/pages/tabbar/cate/cate'});
|
||||
}
|
||||
},
|
||||
// 商品数量变更
|
||||
setShopNum(id,num,type){
|
||||
let parmas = {
|
||||
id,// id:商品id
|
||||
num,// num:商品数量
|
||||
type// type:变更方式down减,up加
|
||||
}
|
||||
this.$requst.post('/api/order/shopping-cart-change-num',parmas).then(res=>{
|
||||
if(res.code==0){} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
touchBottomEv(){// scroll-view触底事件
|
||||
console.log(169);
|
||||
},
|
||||
chooseItem(index){// 商品选择
|
||||
this.dataList[index].isActive = !this.dataList[index].isActive
|
||||
let one = this.dataList.filter(function(item){
|
||||
|
@ -169,12 +231,42 @@
|
|||
},
|
||||
deladdEvent(id,cur,index){//数量加减事件
|
||||
if(index==0){//减少数量
|
||||
this.dataList[cur].num--
|
||||
this.dataList[cur].num--;
|
||||
this.setShopNum(id,this.dataList[cur].num,'down');
|
||||
} else {//增加数量
|
||||
this.dataList[cur].num++
|
||||
this.dataList[cur].num++;
|
||||
this.setShopNum(id,this.dataList[cur].num,'up');
|
||||
}
|
||||
// this.changeNum()//调用数量变更事件
|
||||
},
|
||||
checkList(){//查询购物车列表
|
||||
this.$requst.post('/api/order/shopping-cart',{page:this.page,size:this.size}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length){
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
coding:item.sku.coding,
|
||||
isActive:false,
|
||||
imgSrc:item.spu.spu_cover,
|
||||
title:item.spu_name,
|
||||
specs1:'',
|
||||
price:this.$toolAll.tools.changeNum(item.price*1),
|
||||
reckonPrice:item.price,
|
||||
num:item.num
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
} else {
|
||||
this.dataList = [];
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -199,18 +291,18 @@
|
|||
width: 18rpx;height: 18rpx;background-color: #000000;border-radius: 100%;
|
||||
}
|
||||
.shop-img {width: 223rpx;height: 223rpx;border-radius: 30rpx;margin: 0 20rpx;}
|
||||
|
||||
.allprice-box{width: 30%;}
|
||||
.item-right-box{font-size: 24rpx;height: 223rpx;}
|
||||
.item-title {color: #000000;}
|
||||
.item-specs{color: #8c8c9b;}
|
||||
.item-price{font-size: 30rpx;}
|
||||
|
||||
.input-box {width: 78rpx;height: 40rpx;border-radius: 16rpx;margin: 0 6rpx; border: 1rpx solid #000000;overflow: hidden;}
|
||||
.input-box {width: 78rpx;height: 40rpx;border-radius: 10rpx;margin: 0 6rpx; border: 1rpx solid #000000;overflow: hidden;}
|
||||
input {text-align: center;}
|
||||
.item-btn {width: 40rpx;height: 40rpx;border-radius: 12rpx;background-color: #000000;color: #FFFFFF;padding: 0rpx;}
|
||||
.item-btn {width: 40rpx;height: 40rpx;border-radius: 10rpx;background-color: #000000;color: #FFFFFF;padding: 0rpx;}
|
||||
|
||||
/* 底部导航 */
|
||||
.cart-foot-box{position: fixed;bottom: 0;left: 0;right: 0;height: 130rpx;background-color: #efefef;font-size: 30rpx;}
|
||||
.cart-foot-box{position: fixed;bottom: 0;left: 0;right: 0;z-index: 2; height: 130rpx;background-color: #efefef;font-size: 30rpx;}
|
||||
.circle-check-all {width: 33rpx;height: 33rpx;margin: 0 10rpx 0 30rpx;}
|
||||
.circle-check-all-active::after{
|
||||
width: 19rpx;height: 19rpx;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<template>
|
||||
<view :style="{paddingTop: statusBarHeight +'px'}" class="pad-zy30">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"container-subgroup",
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="loading" class="container-loading">
|
||||
<view class="loading-box">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else :style="{paddingTop: statusBarHeight +'px'}" class="pad-zy30">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"container-subgroup",
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
loading:true,
|
||||
exist:''
|
||||
};
|
||||
},
|
||||
// 执行顺序 第一
|
||||
beforeCreate(){
|
||||
// 检测是否登录过期或是否登录
|
||||
this.$toolAll.tools.overdue();
|
||||
this.exist = uni.getStorageSync('token');
|
||||
this.exist ? this.loading = false : this.loading = true;
|
||||
},
|
||||
// 执行顺序 第二
|
||||
created(){
|
||||
|
||||
},
|
||||
// 执行顺序 第三
|
||||
beforeMount(){
|
||||
|
||||
},
|
||||
// 执行顺序 第四
|
||||
mounted(){
|
||||
this.log(uni.getStorageSync('token'),4)
|
||||
setTimeout(()=>{
|
||||
this.loading = false;
|
||||
},500)
|
||||
},
|
||||
// 组件更新前
|
||||
beforeUpdate(){
|
||||
|
||||
},
|
||||
// 组件更新后
|
||||
updated(){
|
||||
|
||||
},
|
||||
// 组件销毁前:实例销毁之前调用。在这一步,实例仍然完全可用
|
||||
beforeDestroy(){
|
||||
|
||||
},
|
||||
// 销毁所有实例
|
||||
destroyed(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container-loading {position: fixed;top: 0;left: 0;bottom: 0;right: 0;display: flex;justify-content: center;align-items: center;}
|
||||
.container-loading .loading-box {width: 80rpx;display: flex;flex-wrap: wrap;animation: rotate 3s linear infinite;}
|
||||
@keyframes rotate{
|
||||
to{transform: rotateZ(360deg);}
|
||||
}
|
||||
.container-loading .loading-box span {width: 32rpx;height: 32rpx;background-color: #000000;margin: 4rpx;animation: scale 1.5s linear infinite;}
|
||||
@keyframes scale{
|
||||
50%{transform: scale(1);}
|
||||
}
|
||||
.container-loading .loading-box span:nth-child(1){border-radius: 50% 50% 0 50%;transform-origin: bottom right;}
|
||||
.container-loading .loading-box span:nth-child(2){border-radius: 50% 50% 50% 0;transform-origin: bottom left;animation-delay: .5s;}
|
||||
.container-loading .loading-box span:nth-child(3){border-radius: 50% 0 50% 50%;transform-origin: top right;animation-delay: 1.5s;}
|
||||
.container-loading .loading-box span:nth-child(4){border-radius: 0 50% 50% 50%;transform-origin: top left;animation-delay: 1s;}
|
||||
</style>
|
|
@ -2,23 +2,23 @@
|
|||
<view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-nav-box display-between-center">
|
||||
<button type="default" @tap="showFrame=true">立即购买</button>
|
||||
<button type="default" @tap="immediatelyBuy">立即购买</button>
|
||||
<button type="default" @tap="showFrame=true">加入购物车</button>
|
||||
</view>
|
||||
<!-- 底部按钮弹框 -->
|
||||
<view v-show="showFrame" class="frame-box" @tap="showFrame=false">
|
||||
<view @tap.stop="showFrame=true">
|
||||
<view class="frame-top">
|
||||
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" lazy-load></image>
|
||||
<image :src="shopImg" mode="aspectFill" lazy-load></image>
|
||||
<view>
|
||||
<!-- 商品标题 -->
|
||||
<view class="clips2 frame-title">阿什拉夫开机爱上了就干了阿什拉夫开机爱上了就干了阿什拉夫开机爱上了就干了</view>
|
||||
<view class="clips2 frame-title">{{detailObj.detail.name}}</view>
|
||||
<!-- 商品价格 -->
|
||||
<view class="frame-price">
|
||||
<!-- 折扣价 -->
|
||||
<view>¥2,000</view>
|
||||
<view>¥{{discountPrice}}</view>
|
||||
<!-- 原价 -->
|
||||
<view style="text-decoration: line-through;">¥3,000</view>
|
||||
<view style="text-decoration: line-through;">¥{{originalPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -30,24 +30,24 @@
|
|||
<drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down>
|
||||
</view>
|
||||
<!-- 商品库存 -->
|
||||
<view class="frame-stock">库存:99</view>
|
||||
<view class="frame-stock">库存:{{detailObj.detail.stock}}</view>
|
||||
<!-- 加减按钮 -->
|
||||
<view class="frame-add-del">
|
||||
<view class="display-between-center add-del-box">
|
||||
<!-- 减 -->
|
||||
<button @tap="deladdEvent(0)" :disabled="buyNum==1" class="item-btn display-center-center">﹣</button>
|
||||
<button @tap="deladdEvent(0)" :disabled="buyNum==1" class="item-btn display-center-center">-</button>
|
||||
<!-- 输入框 -->
|
||||
<view class="input-box display-center-center">
|
||||
<input type="text" v-model="buyNum" />
|
||||
</view>
|
||||
<!-- 加 -->
|
||||
<button @tap="deladdEvent(1)" class="item-btn display-center-center">﹢</button>
|
||||
<button @tap="deladdEvent(1)" class="item-btn display-center-center">+</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 立即购买、加入购物车按钮 -->
|
||||
<view class="frame-btn-box">
|
||||
<button type="default" @tap="immediatelyBuy">立即购买</button>
|
||||
<button type="default">加入购物车</button>
|
||||
<button type="default" @tap="addCartEv">加入购物车</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -61,6 +61,14 @@
|
|||
components:{
|
||||
dropDown
|
||||
},
|
||||
props:{
|
||||
detailObj:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showFrame:false,
|
||||
|
@ -77,18 +85,65 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
buyNum:1
|
||||
buyNum:1,//购买数量
|
||||
originalPrice:0,//商品原价
|
||||
discountPrice:0,//商品折扣价
|
||||
shopImg:''//商品图片
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 原价金额转换
|
||||
this.originalPrice = this.detailObj.detail.original_price;
|
||||
// 折扣价金额转换
|
||||
this.discountPrice = this.detailObj.detail.price;
|
||||
// 商品图片
|
||||
this.shopImg = this.$http + this.detailObj.detail.cover;
|
||||
},
|
||||
methods:{
|
||||
// 立即购买
|
||||
immediatelyBuy(){
|
||||
let params = {};
|
||||
if(this.showFrame) {
|
||||
params = {
|
||||
id:this.detailObj.detail.id,//商品id
|
||||
imgSrc:this.detailObj.detail.cover,//商品图片
|
||||
coding:this.detailObj.sku[0].coding,//商品coding
|
||||
price:this.discountPrice,//商品价格
|
||||
num:this.buyNum || 1,//商品数量
|
||||
title:this.detailObj.detail.name,//商品名称
|
||||
}
|
||||
} else {
|
||||
// 进入详情就立即购买事件
|
||||
params = {
|
||||
id:this.detailObj.detail.id,//商品id
|
||||
imgSrc:this.detailObj.detail.cover,//商品图片
|
||||
coding:this.detailObj.sku[0].coding,//商品coding
|
||||
price:this.discountPrice,//商品价格
|
||||
num:this.buyNum || 1,//商品数量
|
||||
title:this.detailObj.detail.name,//商品名称
|
||||
}
|
||||
}
|
||||
uni.setStorageSync('orderList',[params]);
|
||||
uni.navigateTo({
|
||||
url:`/pagesA/getReadyDan/getReadyDan`
|
||||
})
|
||||
},
|
||||
// 尺寸选择
|
||||
chooseItem(e){
|
||||
this.log(e)
|
||||
},
|
||||
// 添加购物车事件
|
||||
addCartEv(){
|
||||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:this.detailObj.sku[0].id,num:this.buyNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('添加成功');
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 数量加减事件
|
||||
deladdEvent(index){
|
||||
if(index==0){//减少数量
|
||||
|
@ -108,7 +163,7 @@
|
|||
button{
|
||||
width: 310rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
line-height: 100rpx!important;
|
||||
border-radius: 30rpx;
|
||||
font-size: 36rpx;
|
||||
border: 1rpx solid #FFFFFF;
|
||||
|
@ -129,7 +184,7 @@
|
|||
.frame-price view:last-child{font-size: 28rpx;color: #868695;}
|
||||
.frame-color-box{margin-top: 20rpx;}
|
||||
.frame-btn-box{display: flex;align-items: center;justify-content: space-around;margin-top: 100rpx;}
|
||||
.frame-btn-box button{height: 80rpx;line-height: 80rpx;border-radius: 20rpx;}
|
||||
.frame-btn-box button{height: 80rpx;line-height: 80rpx!important;border-radius: 20rpx;}
|
||||
.frame-stock{font-size: 24rpx;color: #000000;text-align: right;}
|
||||
/* 加减按钮 */
|
||||
.frame-add-del{display: flex;justify-content: flex-end;}
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
.display-between-center{display: flex;justify-content: space-between;align-items: center;}
|
||||
.drop-box{position: relative; border: 1rpx solid #8c8c9b;padding: 20rpx;box-sizing: border-box;margin: 20rpx 0;font-size: 24rpx;color: #000000;}
|
||||
.drop{
|
||||
position: absolute;top:34px;left: -4rpx;right: -4rpx;z-index: 2;
|
||||
position: absolute;top:39px;left: -1rpx;right: -1rpx;z-index: 2;
|
||||
max-height: 280rpx;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
language:userInfo.language,//语言
|
||||
is_active:1
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
this.$requst.post('/api/user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
|
|
|
@ -13,15 +13,15 @@
|
|||
:class="index == isIcon ? 'centerBox' : ''"
|
||||
v-for="(itemi,index) in imgList" :key="index">
|
||||
<view class="posir" :class="index == isIcon ? 'centerBox-item':''">
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-if="newcurrent == index" :src="itemi.selectedIconPath"></image>
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-else :src="itemi.iconPath"></image>
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-if="newcurrent == index" :src="itemi.selectedIconPath" :style="{width: [39,41,32,120][index]+'rpx',height: [40,41,38,120][index]+'rpx'}"></image>
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-else :src="itemi.iconPath" :style="{width: [39,41,32,120][index]+'rpx',height: [40,41,38,120][index]+'rpx'}"></image>
|
||||
<button v-if="index == isIcon && isCustomerService" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- tab-标题列表 -->
|
||||
<view class="item-box">
|
||||
<view @tap="choosefoot(index)"
|
||||
<view @tap="choosefoot(index)" class="foot-title"
|
||||
:style="{width:100 / imgList.length +'%', color:newcurrent == index ? colorActive : colorMo}"
|
||||
v-for="(itemt,index) in titleList" :key="index">{{itemt}}</view>
|
||||
</view>
|
||||
|
@ -60,7 +60,7 @@
|
|||
// 底部导航背景图片
|
||||
backgroundImage:{
|
||||
type:String,
|
||||
default:'/static/public/member-head.png'
|
||||
default:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg'
|
||||
},
|
||||
// 背景颜色
|
||||
backgroundColor:{
|
||||
|
@ -105,7 +105,7 @@
|
|||
// 图标与文字的间距
|
||||
marginBottomNum:{
|
||||
type:Number,
|
||||
default:4
|
||||
default:0
|
||||
},
|
||||
// 默认的标题颜色
|
||||
colorMo:{
|
||||
|
@ -121,6 +121,7 @@
|
|||
data() {
|
||||
return {
|
||||
isCustomerService:false,//是否存在客服 默认不存在客服
|
||||
check:uni.getStorageSync('is_active')
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -128,29 +129,38 @@
|
|||
},
|
||||
methods:{
|
||||
choosefoot(index){
|
||||
switch (index){
|
||||
case 0:
|
||||
if(index==0){
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
break;
|
||||
case 1:
|
||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||
break;
|
||||
case 2:
|
||||
uni.reLaunch({url:'/pages/tabbar/my/my'})
|
||||
break;
|
||||
case 3:
|
||||
uni.reLaunch({url:'/pages/tabbar/cart/cart'})
|
||||
break;
|
||||
return
|
||||
} else {
|
||||
if(this.check) {
|
||||
switch (index){
|
||||
case 1:
|
||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||
break;
|
||||
case 2:
|
||||
uni.reLaunch({url:'/pages/tabbar/my/my'})
|
||||
break;
|
||||
case 3:
|
||||
uni.reLaunch({url:'/pages/tabbar/cart/cart'})
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login',
|
||||
animationType:'slide-in-bottom'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
/* 外框样式 start */
|
||||
.foot-boxtwo{
|
||||
height: 140rpx;
|
||||
height: 120rpx;
|
||||
font-size: 24rpx;
|
||||
position: fixed;bottom: 0;left: 0;right: 0;z-index: 10;
|
||||
display: flex;flex-direction: column;justify-content: center;
|
||||
|
@ -159,17 +169,20 @@
|
|||
/* 外框样式 end */
|
||||
|
||||
/* 公共 start*/
|
||||
.moImg{width: 64rpx;height: 64rpx;}
|
||||
.moImg{width: 64rpx;height: 64rpx;vertical-align: bottom;}
|
||||
/* 公共 end*/
|
||||
|
||||
/* 图标-文字外框样式 start */
|
||||
.item-box{display: flex;justify-content: space-around;align-items: center;}
|
||||
.item-box>view{text-align: center;}
|
||||
.item-box>view{text-align: center;box-sizing: border-box;}
|
||||
/* 图标-文字外框样式 end */
|
||||
|
||||
/* 突出的图标样式 start */
|
||||
.centerBox{display: flex;justify-content: center;align-items: center;}
|
||||
.centerBox-item{margin-top: -80rpx;}
|
||||
.centerImg{width: 140rpx;height: 140rpx;}
|
||||
.centerBox{display: flex;justify-content: center;align-items: center;vertical-align: bottom;}
|
||||
.centerBox-item{margin-top: -80rpx;vertical-align: bottom;margin-left: -50rpx;}
|
||||
.centerImg{width: 140rpx;height: 140rpx;vertical-align: bottom;}
|
||||
/* 突出的图标样式 end */
|
||||
|
||||
.item-box .foot-title{padding-top: 16rpx;}
|
||||
.item-box .foot-title:last-child{text-align: left;padding-left: 40rpx;}
|
||||
</style>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<view @tap="chooseItem(index)" v-for="(item,index) in list" :key="index"
|
||||
class="item-box display-between-center">
|
||||
<view class="display-between-center">
|
||||
<image v-if="item.leftImg!=''" class="left-img" :src="item.leftImg" mode="widthFix"></image>
|
||||
<image v-if="item.leftImg!=''" :style="{width:[26,38,40,33][index]+'rpx',height:[36,38,40,31][index]+'rpx'}" class="left-img" :src="item.leftImg" mode="widthFix"></image>
|
||||
<view class="item-title">{{item.title}}</view>
|
||||
</view>
|
||||
<view class="display-between-center">
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
<template>
|
||||
<view class="disjb fw">
|
||||
<view @tap="chooseDoctor(index)" class="radius10 dis fc bacf mar-x20" style="width: 48.6%;" v-for="(item,index) in list" :key="index">
|
||||
<image :src="item.imgSrc" class="doctorImg" mode="aspectFill"></image>
|
||||
<view class="col3 mar-s10 mar-x20 mar-z10">
|
||||
<view class="fon28 bold doctoritem disac">{{item.name}}</view>
|
||||
<!-- <view class="fon26 mar-sx10 disac">
|
||||
<view>从业{{item.cyear}}年</view>
|
||||
<view v-if="item.bmen!=''" class="doctorx"></view>
|
||||
<view>{{item.bmen}}</view>
|
||||
</view>
|
||||
<view class="fon26 mar-x10">职称:{{item.zcheng}}</view> -->
|
||||
<!-- <view class="fon24 disac">
|
||||
<view class="flexs">擅长:</view>
|
||||
<scroll-view scroll-x style="width: 250rpx;">
|
||||
<view class="disac">
|
||||
<view class="flexs" v-for="(itemt,indext) in item.goodAt" :key="indext">
|
||||
<text class="bold mar-y10 pcol">{{itemt.disease_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<view class="fon24 disac fw mar-s10" style="width: 166px;">
|
||||
<view class="flexs">擅长:</view>
|
||||
<view class="flexs" v-for="(itemt,indext) in item.goodAt" :key="indext">
|
||||
<text class="bold mar-y10 pcol">{{itemt.disease_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"list-doctor",
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
chooseDoctor(index){//选择医生事件
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -1,26 +1,28 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="swiper-item mar-x40" v-for="(item,index) in list" :key="index">
|
||||
<!-- <view class="mar-x40" v-for="(item,index) in list" :key="index"> -->
|
||||
<!-- 活动商品 start -->
|
||||
<h1 class="fon36 bold">{{item.title}}</h1>
|
||||
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.content}}</view>
|
||||
<view class="posir" @tap="goDetail(item.id)">
|
||||
<image class="radius30 animated fadeIn" :src="item.mainImg" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
||||
<view v-if="item.isActivity" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
<view v-for="(item,index) in activityList" :key="index" class="mar-x50">
|
||||
<h1 class="fon36 bold">{{item.name}}</h1>
|
||||
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.subtitle}}</view>
|
||||
<view class="posir" @tap="goDetail(item.id)">
|
||||
<image class="radius30 animated fadeIn" :src="item.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动商品 end -->
|
||||
|
||||
<!-- 子商品 start -->
|
||||
<view class="disjbac fw">
|
||||
<view @tap="goDetail(childrenitem.id)" class="width47 mar-s50 posir" v-for="(childrenitem,childrenindex) in item.childrenList" :key="childrenindex">
|
||||
<image :src="childrenitem.childrenImg" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{childrenitem.childrenTitle}}</view>
|
||||
<view class="fon30 colpeili">¥{{childrenitem.childrenPrice}}</view>
|
||||
<view v-if="childrenitem.isActivity" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
<view @tap="goDetail(item.id)" class="width47 mar-x50 posir" v-for="(item,index) in list" :key="index">
|
||||
<image :src="item.cover" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item.name}}</view>
|
||||
<view class="fon30 colpeili">¥{{item.price}}</view>
|
||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 子商品 end -->
|
||||
</view>
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -31,111 +33,32 @@
|
|||
list:{
|
||||
type:Array,
|
||||
default:()=>{
|
||||
return [
|
||||
{
|
||||
id:1,
|
||||
title:'虎年快乐',
|
||||
content:'欢庆虎年,与所爱之人共燃盛典烟花',
|
||||
mainImg:'/static/public/member-head.png',
|
||||
isActivity:true,
|
||||
childrenList:[
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:true,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
title:'虎年快乐',
|
||||
content:'欢庆虎年,与所爱之人共燃盛典烟花',
|
||||
mainImg:'/static/public/member-head.png',
|
||||
isActivity:true,
|
||||
childrenList:[
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:true,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
title:'虎年快乐',
|
||||
content:'欢庆虎年,与所爱之人共燃盛典烟花',
|
||||
mainImg:'/static/public/member-head.png',
|
||||
isActivity:true,
|
||||
childrenList:[
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:true,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
},
|
||||
{
|
||||
id:1,
|
||||
childrenImg:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
childrenTitle:'于亿年宝藏中臻选1的宝石级钻石每年开采数',
|
||||
childrenPrice:'2,000',
|
||||
isActivity:false,
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
return []
|
||||
}
|
||||
},
|
||||
activityList:{
|
||||
type:Array,
|
||||
default:()=>{
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
check:uni.getStorageSync('is_active')
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
goDetail(id){//前往详情页
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
if(this.check){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:`/pages/login/login`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,19 +2,30 @@
|
|||
<!-- 底部导航 -->
|
||||
<view class="display-between-center payment-foot-box">
|
||||
<!-- 合计 -->
|
||||
<view class="payment-price">合计:¥2,000</view>
|
||||
<view class="payment-price">合计:¥{{totalPrice}}</view>
|
||||
<!-- 立即结算 -->
|
||||
<view class="payment-settlement">立即支付</view>
|
||||
<view @tap="immediatePaymentEv" class="payment-settlement">立即支付</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"payment",
|
||||
props:{
|
||||
totalPrice:{
|
||||
type:String,
|
||||
default: '0'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
immediatePaymentEv(){
|
||||
this.$emit('immediatePayment');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.customer-box {
|
||||
position: fixed;z-index: 2;
|
||||
display: flex;justify-content: center;align-items: center;flex-wrap: wrap;
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
<template>
|
||||
<view class="pad20 shop_list_box">
|
||||
<view style="width: 48.6%;float: left;">
|
||||
<view v-if="index1%2==0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col3 mar-s20">所有人可买</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isTuan || item1.isPing || item1.isXian" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 48.6%;float: right;">
|
||||
<view v-if="index1%2!=0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col3 mar-s20">所有人可买</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isTuan || item1.isPing || item1.isXian" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"shop-list",
|
||||
props:{
|
||||
dataList:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return [
|
||||
{
|
||||
imgSrc:'/static/public/wen-one.png',//商品图片
|
||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',//标题
|
||||
zhePrice:'3888',//折扣价
|
||||
yuanPrice:'4205',//原价
|
||||
integral:'2888',//积分
|
||||
isTuan:false,//是否团购
|
||||
isPing:false,//是否拼团
|
||||
isXian:false,//是否限时促销
|
||||
isIntegral:false,//是否是积分
|
||||
grade:0,//等级
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
newList:[],
|
||||
timeList:[]//时间列表
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -117,6 +117,6 @@
|
|||
.img-box{position: relative;display: flex;justify-content: center;align-items: center;}
|
||||
.img{width:100%;vertical-align: bottom;}
|
||||
.dot-box{position: absolute;bottom: 36rpx;display: flex;justify-content: center;width: 100%;}
|
||||
.dotActive{width: 22rpx;height: 12rpx;margin-right: 10rpx;border-radius: 20rpx; background-color: rgba(56, 117, 246, .5);}
|
||||
.dotMo{width: 12rpx;height: 12rpx;margin-right: 10rpx;border-radius: 100%;background-color: rgba(191, 191, 191, 0.5);}
|
||||
.dotActive{width: 20rpx;height: 20rpx;margin-right: 10rpx;border-radius: 20rpx; background-color: rgba(255, 255, 255, 1);}
|
||||
.dotMo{width: 20rpx;height: 20rpx;margin-right: 10rpx;border-radius: 100%;background-color: rgba(191, 191, 191, 0.8);}
|
||||
</style>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
:style="{color: (currentIndex === index ? `${itemColor}`: '')}" id="tab_item"
|
||||
@click="select(item, index)">
|
||||
<!-- 标题 -->
|
||||
<view><slot name="title" :title="item.title"></slot></view>
|
||||
<!-- <view><slot name="title" :title="item.title"></slot></view> -->
|
||||
<!-- 标题 -->
|
||||
<view v-if="!showTitleSlot">{{item.title}}</view>
|
||||
</view>
|
||||
|
@ -132,8 +132,9 @@
|
|||
padding-bottom: 15rpx;
|
||||
white-space: nowrap;
|
||||
&__item {
|
||||
flex: 1;
|
||||
// width: 30%;
|
||||
// flex: 1;
|
||||
width: 20%;
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
color: #868695;
|
||||
|
|
|
@ -2,7 +2,7 @@ import requst from './requst.js';
|
|||
import toolAll from './tools.js';
|
||||
|
||||
export function collectionEV(data){//收藏事件
|
||||
return requst.post('archives/record',data).then(res=>{
|
||||
return requst.post('/api/archives/record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = '点赞成功'
|
||||
let num = 2
|
||||
|
@ -21,7 +21,7 @@ export function collectionEV(data){//收藏事件
|
|||
},error=>{})
|
||||
}
|
||||
export function cancleCollectionEV(data){//取消收藏事件
|
||||
return requst.post('archives/un-record',data).then(res=>{
|
||||
return requst.post('/api/archives/un-record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = '已取消点赞'
|
||||
if(data.action=='collect'){
|
||||
|
@ -34,7 +34,7 @@ export function cancleCollectionEV(data){//取消收藏事件
|
|||
// 商品收藏、积分收藏
|
||||
export function collectionShopEV(data){//收藏事件
|
||||
console.log(data);
|
||||
return requst.post('spu/record',data).then(res=>{
|
||||
return requst.post('/api/spu/record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = ''
|
||||
let num = 0
|
||||
|
@ -53,7 +53,7 @@ export function collectionShopEV(data){//收藏事件
|
|||
},error=>{})
|
||||
}
|
||||
export function cancleCollectionShopEV(data){//取消收藏事件
|
||||
return requst.post('spu/un-record',data).then(res=>{
|
||||
return requst.post('/api/spu/un-record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = ''
|
||||
if(data.action=='collect'){
|
||||
|
@ -64,14 +64,14 @@ export function cancleCollectionShopEV(data){//取消收藏事件
|
|||
},error=>{})
|
||||
}
|
||||
export function buriedPoint(){//查询埋点类型事件
|
||||
return requst.post('statistics/event').then(res=>{
|
||||
return requst.post('/api/statistics/event').then(res=>{
|
||||
// console.log('查询所有需要埋点的类型:',res);
|
||||
if(res.code==0) uni.setStorageSync('buriedPoint',res.data)
|
||||
},error=>{})
|
||||
}
|
||||
export function reportBuriedPoint(data){//上报埋点事件
|
||||
// console.log('埋点的数据:',data);
|
||||
return requst.post('statistics/report',data).then(res=>{},error=>{})
|
||||
return requst.post('/api/statistics/report',data).then(res=>{},error=>{})
|
||||
}
|
||||
// export function zhuColor(){//查询主题色
|
||||
// return requst.post('index/mini-program-setting').then(res=>{
|
||||
|
@ -81,14 +81,19 @@ export function reportBuriedPoint(data){//上报埋点事件
|
|||
// }
|
||||
// },error=>{})
|
||||
// }
|
||||
export function checkSwip(){//查询主题色
|
||||
return requst.post('common/slide-positions').then(res=>{
|
||||
|
||||
// 查询轮播图位置
|
||||
export function checkCarouselLocation(){
|
||||
return requst.post('/api/common/slide-positions').then(res=>{
|
||||
if(res.code==0){
|
||||
console.log(res);
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
export function checkBanner(data){//查询主题色
|
||||
return requst.post('common/slides',data)
|
||||
|
||||
// 查询轮播图列表
|
||||
export function checkBanner(data){
|
||||
return requst.post('/api/common/slides',data)
|
||||
}
|
||||
|
||||
|
||||
|
|
155
jsFile/tools.js
|
@ -104,16 +104,123 @@ const tools = {
|
|||
// if(num==2) hname = `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
||||
// return hname
|
||||
// },
|
||||
// 昵称从第一个字开始,后面的都用"*"代替
|
||||
hideName(name,num){
|
||||
let hname = ''
|
||||
hname = `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
||||
return hname
|
||||
},
|
||||
// 金额转换各三位数使用英文","隔开
|
||||
changeNum(num){
|
||||
if (num) {
|
||||
// 针对整数部分进行格式化处理,这是此方法的核心,也是稍难理解的一个地方,逆向的来思考或者采用简单的事例来实现就容易多了
|
||||
/*
|
||||
也可以这样想象,现在有一串数字字符串在你面前,如果让你给他家千分位的逗号的话,你是怎么来思考和操作的?
|
||||
字符串长度为0/1/2/3时都不用添加
|
||||
字符串长度大于3的时候,从右往左数,有三位字符就加一个逗号,然后继续往前数,直到不到往前数少于三位字符为止
|
||||
*/
|
||||
num = num+''; // 数字转换为字符串,数字是没有.length属性的
|
||||
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) {
|
||||
num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3))
|
||||
}
|
||||
// 将数据(符号、整数部分、小数部分)整体组合返回
|
||||
return num;
|
||||
}
|
||||
},
|
||||
// 整数添加.00,小数就不添加
|
||||
addXiaoShu(num){
|
||||
let str = num.toString();
|
||||
return str.includes('.') ? num : num = num + '.00';
|
||||
},
|
||||
// type:+加、-减、*乘、/除
|
||||
// len:小数后保留几位
|
||||
operationEv(num1,num2,type,len=0){
|
||||
// 将数字转化成字符串
|
||||
num1 = num1.toString();
|
||||
num2 = num2.toString();
|
||||
// 获取小数点的位置
|
||||
var index1 = num1.indexOf(".");
|
||||
var index2 = num2.indexOf(".");
|
||||
// 如果小数点存在,那么就再获取各自的小数位数
|
||||
var ws1 = 0;
|
||||
var ws2 = 0;
|
||||
if(index1 != -1){
|
||||
ws1 = num1.split(".")[1].length;
|
||||
}
|
||||
if(index2 != -1){
|
||||
ws2 = num2.split(".")[1].length;
|
||||
}
|
||||
// 看谁的小数位数大,谁的小数位数小
|
||||
var bigger = (ws1 > ws2) ? ws1 : ws2;
|
||||
var smaller = (ws1 < ws2) ? ws1 : ws2;
|
||||
// 计算得到需要补齐的0的个数
|
||||
var zerosCount = bigger - smaller;
|
||||
// 好了,现在不管三七二十,全部去除小数点
|
||||
num1 = num1.replace(".","");
|
||||
num2 = num2.replace(".","");
|
||||
// 比较num1和num2谁大,比较方法就是看谁是smaller,是smaller的一方就补0
|
||||
if(ws1 == smaller){
|
||||
for (var i = 0; i < zerosCount; i++) {
|
||||
num1 += "0";
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < zerosCount; i++) {
|
||||
num2 += "0";
|
||||
}
|
||||
}
|
||||
// 开始计算
|
||||
var sum = "";
|
||||
if(type=="+"){
|
||||
// 加
|
||||
sum = parseInt(num1) + parseInt(num2);
|
||||
}
|
||||
if(type=="-"){
|
||||
// 减
|
||||
sum = parseInt(num1) - parseInt(num2);
|
||||
}
|
||||
if(type=="*"){
|
||||
// 乘
|
||||
sum = parseInt(num1) * parseInt(num2);
|
||||
}
|
||||
if(type=="/"){
|
||||
// 除
|
||||
sum = parseInt(num1) / parseInt(num2);
|
||||
}
|
||||
// 根据较大的小数位数计算倍数
|
||||
var beishu = 1;
|
||||
for (var i = 0; i < bigger; i++) {
|
||||
beishu = beishu*10;
|
||||
}
|
||||
sum = sum/beishu;
|
||||
if(type=="*"){
|
||||
switch (bigger){
|
||||
case 1:
|
||||
sum = sum / 10;
|
||||
break;
|
||||
case 2:
|
||||
sum = sum / 100;
|
||||
break;
|
||||
case 3:
|
||||
sum = sum / 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(type=="/"){
|
||||
switch (bigger){
|
||||
case 1:
|
||||
sum = sum * 10;
|
||||
break;
|
||||
case 2:
|
||||
sum = sum * 100;
|
||||
break;
|
||||
case 3:
|
||||
sum = sum * 1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
len!=0 ? sum = sum.toFixed(len) : '';
|
||||
return sum;
|
||||
},
|
||||
// 时间戳===>日期
|
||||
timestampToTime(timestamp) {
|
||||
var date = timestamp.toString().length==13 ? new Date(timestamp*1) : new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||||
|
@ -205,6 +312,7 @@ const tools = {
|
|||
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
|
||||
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; }).replace('<section', '<div').replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto" ').replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
|
||||
},
|
||||
// 延迟跳转
|
||||
setTime(url,title,time){
|
||||
// console.log(url,title,time);
|
||||
if(url=='' && title==''){
|
||||
|
@ -264,35 +372,31 @@ const tools = {
|
|||
overdue(){//查询过期时间和是否有token,并调用登录事件
|
||||
var date = new Date();
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
if((uni.getStorageSync('expire')*1000) - 10000 < timestamp){
|
||||
this.loginEv()
|
||||
} else if(uni.getStorageSync('token')==''){
|
||||
this.loginEv()
|
||||
} else if(uni.getStorageSync('is_active')=='' || uni.getStorageSync('is_active')==0){
|
||||
this.loginEv()
|
||||
if((uni.getStorageSync('expire')*1000) - 10000 < timestamp || uni.getStorageSync('token')==''){
|
||||
this.loginEv();
|
||||
}
|
||||
},
|
||||
loginEv(){//执行登录事件
|
||||
let that = this;
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(res) {
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
let code = res.code;
|
||||
let obj = uni.getStorageSync('params')
|
||||
var params = {
|
||||
invite_code:'',
|
||||
invite_code: uni.getStorageSync('is_active')=='' ? uni.getStorageSync('invite_code') : '',
|
||||
code:code,
|
||||
nickname: obj.nickname,
|
||||
avatar: obj.avatarUrl,
|
||||
country: obj.country,
|
||||
province: obj.province,
|
||||
city: obj.city,
|
||||
gender: obj.gender,
|
||||
language:obj.language
|
||||
nickname: obj.nickname || '',
|
||||
avatar: obj.avatarUrl || '',
|
||||
country: obj.country || '',
|
||||
province: obj.province || '',
|
||||
city: obj.city || '',
|
||||
gender: obj.gender || '',
|
||||
language:obj.language || ''
|
||||
}
|
||||
uni.request({
|
||||
url: `${uni.getStorageSync('hostapi')}user/login`,
|
||||
url: `${uni.getStorageSync('hostapi')}/api/user/login`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
|
@ -309,7 +413,6 @@ const tools = {
|
|||
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
|
||||
uni.setStorageSync('userId',res.data.data.account_id)
|
||||
uni.setStorageSync('invite_code',res.data.data.invite_code)
|
||||
// console.log('is_active',uni.getStorageSync('is_active'));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -317,23 +420,6 @@ const tools = {
|
|||
},
|
||||
});
|
||||
},
|
||||
returnAuth(){//是否第一次授权
|
||||
let auth = false
|
||||
// if(uni.getStorageSync('is_active')==0 || uni.getStorageSync('phone_active')==0) {
|
||||
if(uni.getStorageSync('is_active')==0) {
|
||||
// this.showToast('您目前是游客,请授权登录')
|
||||
// setTimeout(()=>{
|
||||
uni.navigateTo({url:'/pages/login/login'})
|
||||
// },1500)
|
||||
auth = true
|
||||
}
|
||||
return auth
|
||||
},
|
||||
isLogin(){//是否已经登录
|
||||
if(uni.getStorageSync('is_active')!='' && uni.getStorageSync('is_active') !=0 && uni.getStorageSync('phone_active') !=0){
|
||||
this.overdue()
|
||||
}
|
||||
},
|
||||
// 文本复制
|
||||
clickCopy(data){
|
||||
uni.setClipboardData({
|
||||
|
@ -389,7 +475,6 @@ const tools = {
|
|||
method: 'get',
|
||||
header: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
// "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: res => {
|
||||
|
|
120
main.js
|
@ -1,114 +1,36 @@
|
|||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import statusNav from './components/status-nav.vue';//引入状态栏组件
|
||||
Vue.component('status-nav',statusNav)//全局注册状态栏组件
|
||||
import footTab from './components/foot-tab.vue';//引入底部tab组件
|
||||
Vue.component('foot-tab',footTab)//全局注册底部tab组件
|
||||
import backTop from './components/backTop.vue';//引入返回顶部组件
|
||||
Vue.component('back-top',backTop)//全局注册返回顶部组件
|
||||
import catePu from './components/cate-items/cate-pu.vue';//引入分类组件
|
||||
Vue.component('cate-pu',catePu)//全局注册分类组件
|
||||
import listPu from './components/list-pu.vue';//引入视频、图片列表组件
|
||||
Vue.component('list-pu',listPu)//全局注册视频、图片列表组件
|
||||
import pupo from './components/pupo.vue';//引入弹框组件
|
||||
Vue.component('pu-po',pupo)//全局注册弹框组件
|
||||
import nothingPage from './components/nothing-page.vue'//引入无内容组件
|
||||
Vue.component('nothing-page',nothingPage)//全局注册无内容组件
|
||||
import publicCustomer from './components/public-customer.vue'//引入客服组件
|
||||
Vue.component('public-customer',publicCustomer)//全局注册客服组件
|
||||
import authPhone from './components/auth-phone.vue'//引入手机授权组件
|
||||
Vue.component('auth-phone',authPhone)//全局注册手机授权组件
|
||||
import empower from './components/empower.vue'//引入用户授权组件
|
||||
Vue.component('empower',empower)//全局注册用户授权组件
|
||||
import authUserInfoMobile from './components/auth-userInfo-mobile.vue'//引入授权用户信息,授权手机号组件
|
||||
Vue.component('auth-userInfo-mobile',authUserInfoMobile)//全局注册授权用户信息,授权手机号组件
|
||||
import Vue from 'vue';
|
||||
import App from './App';
|
||||
|
||||
import containerSubgroup from './components/container-subgroup.vue'//引入容器组件
|
||||
Vue.component('container-subgroup',containerSubgroup)//全局注册容器组件
|
||||
// 全局注册分享事件
|
||||
import share from './jsFile/share.js'
|
||||
Vue.mixin(share)
|
||||
import statusNav from './components/status-nav.vue';//引入状态栏组件
|
||||
Vue.component('status-nav',statusNav);//全局注册状态栏组件
|
||||
|
||||
import nothingPage from './components/nothing-page.vue';//引入无内容组件
|
||||
Vue.component('nothing-page',nothingPage);//全局注册无内容组件
|
||||
|
||||
import authUserInfoMobile from './components/auth-userInfo-mobile.vue';//引入授权用户信息,授权手机号组件
|
||||
Vue.component('auth-userInfo-mobile',authUserInfoMobile);//全局注册授权用户信息,授权手机号组件
|
||||
|
||||
import containerSubgroup from './components/containers/container-subgroup.vue';//引入容器组件
|
||||
Vue.component('container-subgroup',containerSubgroup);//全局注册容器组件
|
||||
|
||||
import share from './jsFile/share.js';// 全局注册分享事件
|
||||
Vue.mixin(share);
|
||||
|
||||
// 常用工具
|
||||
import tools from '@/jsFile/tools.js'
|
||||
import tools from '@/jsFile/tools.js';
|
||||
Vue.prototype.$toolAll = tools;
|
||||
// 响应数据
|
||||
import requst from '@/jsFile/requst.js'
|
||||
import requst from '@/jsFile/requst.js';
|
||||
Vue.prototype.$requst = requst;
|
||||
// 域名,专治后台仔没有返回http/https的图片
|
||||
// Vue.prototype.$http = 'https://hm.hmzfyy.cn'
|
||||
// 图片域名,专治后台仔没有返回http/https的图片
|
||||
Vue.prototype.$http = 'https://oss.hmzfyy.cn';
|
||||
Vue.prototype.$hostapi = 'https://hengmei.scdxtc.cn/api/';
|
||||
|
||||
const {log} = console;
|
||||
Vue.prototype.log = log;
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
// // 动态获取手机电量栏,并设置状态栏高度
|
||||
// Vue.prototype.statusBarH = function(){
|
||||
// uni.getSystemInfo({
|
||||
// success: (e) => {
|
||||
// // 定义电量栏
|
||||
// let statusBar = 0;
|
||||
// // 定义状态栏
|
||||
// let customBar = 0;
|
||||
|
||||
// // #ifdef APP-PLUS
|
||||
// // app时执行
|
||||
// // 设置电量栏高度
|
||||
// Vue.prototype.statusBar = e.statusBarHeight;
|
||||
// // 设置状态栏高度
|
||||
// Vue.prototype.customBar = e.statusBarHeight + 45;
|
||||
// // #endif
|
||||
|
||||
// // 网页
|
||||
// // #ifdef H5
|
||||
// statusBar = 0
|
||||
// customBar = e.statusBarHeight + 45
|
||||
// // #endif
|
||||
|
||||
// // 小程序
|
||||
// // #ifdef MP
|
||||
// statusBar = e.statusBarHeight
|
||||
// customBar = e.statusBarHeight + 45
|
||||
// if (e.platform === 'android') {
|
||||
// this.$store.commit('SET_SYSTEM_IOSANDROID', false)
|
||||
// customBar = e.statusBarHeight + 50
|
||||
// }
|
||||
// // #endif
|
||||
|
||||
// // 微信小程序
|
||||
// // #ifdef MP-WEIXIN
|
||||
// statusBar = e.statusBarHeight;
|
||||
// // @ts-ignore
|
||||
// const custom = wx.getMenuButtonBoundingClientRect()
|
||||
// customBar = custom.bottom + custom.top - e.statusBarHeight;
|
||||
// // #endif
|
||||
|
||||
// // 这里你可以自己决定存放方式,建议放在store中,因为store是实时变化的
|
||||
// uni.setStorageSync('statusBar',statusBar);
|
||||
// uni.setStorageSync('customBar',customBar);
|
||||
|
||||
// // 全局配置域名
|
||||
// uni.setStorageSync('hostapi',`https://hengmei.scdxtc.cn/api/`);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
App.mpType = 'app'
|
||||
App.mpType = 'app';
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
/* 小程序特有相关 */
|
||||
"appid" : "wx2654bc27c419ada6",
|
||||
"appid" : "wxa02e44170bc722cd",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"es6" : false
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
<template>
|
||||
<view>
|
||||
<status-nav :titleVal="'协议'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="mar20">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav
|
||||
:ifTitle="true"
|
||||
:ifReturn="true"
|
||||
:ifCenter="true"
|
||||
:navBarTitle="'登录'"></status-nav>
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -11,7 +17,6 @@
|
|||
export default {
|
||||
data(){
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
content:'<p>1.用户协议谢谢洗诶诶黑货币的宁波</p>'
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,37 +1,46 @@
|
|||
<template>
|
||||
<view>
|
||||
<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav>
|
||||
<view class='login-header'>
|
||||
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
|
||||
<view class="logo-name">恒美植发</view>
|
||||
</view>
|
||||
<view class="login-box">
|
||||
<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo">微信授权</button>
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goAgreement" class="xieCon">《用户服务协议》</text></view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowP" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view :style="{background:publicColor}" class="pad-sx10 radius10 tank-btn posir">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav
|
||||
:ifTitle="true"
|
||||
:ifReturn="true"
|
||||
:ifCenter="true"
|
||||
:navBarTitle="'登录'"></status-nav>
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<view class='login-header'>
|
||||
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
|
||||
<view class="logo-name">{{appletName}}</view>
|
||||
</view>
|
||||
<view class="login-box">
|
||||
<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo">微信授权</button>
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goAgreement" class="xieCon">《用户服务协议》</text></view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowP" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view :style="{background:publicColor}" class="pad-sx10 radius10 tank-btn posir">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
appletName: getApp().globalData.appletName,
|
||||
userInfo: {},//用户信息
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
canIGetUserProfile: false,
|
||||
imgSrc: '/static/public/logo.png',//默认logo头像
|
||||
imgSrc: '',//默认logo头像
|
||||
isShowP:false,
|
||||
};
|
||||
},
|
||||
|
@ -61,7 +70,6 @@
|
|||
getphonenumber(e){//授权绑定手机号
|
||||
let ya = this;
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
console.log(e);
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
|
@ -82,31 +90,24 @@
|
|||
},
|
||||
//调起登录授权
|
||||
bindGetUserInfo(e) {
|
||||
let ya = this;
|
||||
//新版登录方式
|
||||
uni.getUserProfile({
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
console.log('res',res);
|
||||
ya.userInfo = res.userInfo;
|
||||
// console.log('可用用户信息:',ya.userInfo);
|
||||
try {
|
||||
ya.login();
|
||||
} catch (e) {}
|
||||
this.userInfo = res.userInfo;
|
||||
this.login();
|
||||
},
|
||||
fail: (res) => {}
|
||||
});
|
||||
},
|
||||
login() {
|
||||
let ya = this;
|
||||
// 获取登录用户code
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(res) {
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
let code = res.code;
|
||||
ya.updateUserInfo(code);
|
||||
this.updateUserInfo(res.code);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
|
@ -118,7 +119,6 @@
|
|||
},
|
||||
//调用登录接口
|
||||
updateUserInfo(code) {
|
||||
let ya = this;
|
||||
uni.showToast({
|
||||
title: '登录中...',
|
||||
icon:'loading',
|
||||
|
@ -126,17 +126,17 @@
|
|||
})
|
||||
var params = {
|
||||
code:code,
|
||||
nickname: ya.userInfo.nickName,//用户昵称
|
||||
headimgurl: ya.userInfo.avatarUrl,//用户头像
|
||||
country: ya.userInfo.country,//用户所在国家
|
||||
province: ya.userInfo.province,//用户所在省份
|
||||
city: ya.userInfo.city,//用户所在城市
|
||||
gender: ya.userInfo.gender,//用户性别
|
||||
language:ya.userInfo.language,//语言
|
||||
nickname: this.userInfo.nickName,//用户昵称
|
||||
headimgurl: this.userInfo.avatarUrl,//用户头像
|
||||
country: this.userInfo.country,//用户所在国家
|
||||
province: this.userInfo.province,//用户所在省份
|
||||
city: this.userInfo.city,//用户所在城市
|
||||
gender: this.userInfo.gender,//用户性别
|
||||
language:this.userInfo.language,//语言
|
||||
is_active:1
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
// console.log(res);
|
||||
this.log(params,138)
|
||||
this.$requst.post('/api/user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
|
@ -145,8 +145,11 @@
|
|||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
uni.hideToast()
|
||||
this.isShowP = true;
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
// uni.hideToast();
|
||||
// this.isShowP = true;
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="pad-x180">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav
|
||||
:ifTitle="true"
|
||||
:ifReturn="false"
|
||||
:ifCenter="true"
|
||||
:navBarTitle="'分类'"></status-nav>
|
||||
<view :style="{paddingTop: statusBarHeight+'px'}" class="pad-x140">
|
||||
<view class="pad30 sort-box" :style="{top: statusBarHeight+'px'}">
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<view class="pad30 sort-box mar-x20" style="margin-left: -30rpx;margin-right: -30rpx;" :style="{top: statusBarHeight+'px'}">
|
||||
<view class="col0 fon38 disjbac fon50">
|
||||
<view class="bold">分类筛选</view>
|
||||
<view>分类筛选</view>
|
||||
<i @tap="clikScreenIcon" class="icon icon-screen" style="font-size: 50rpx;"></i>
|
||||
</view>
|
||||
<view v-if="chooseCateList.length" class="disac fw fon24">
|
||||
|
@ -21,7 +22,16 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<list-two :scrollCate="4"></list-two>
|
||||
<view class="disjbac fw">
|
||||
<view @tap="goDetail(item.id)" class="width47 mar-s50 posir" v-for="(item,index) in dataList" :key="index">
|
||||
<image :src="item.imgSrc" mode="aspectFill" style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item.title}}</view>
|
||||
<view class="fon30 colpeili">¥{{item.price}}</view>
|
||||
<view v-if="item.isActivity" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无更多 -->
|
||||
<pitera v-if="total==dataList.length"></pitera>
|
||||
<!-- 筛选框 -->
|
||||
<view v-show="isScreen" @tap="isScreen=false" class="screen-box" :style="{top:statusBarHeight+'px'}">
|
||||
<view @tap.stop="isScreen=true" class="posir">
|
||||
|
@ -54,26 +64,25 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 全局客服 -->
|
||||
<public-customer :nbottom="520"></public-customer>
|
||||
</container-subgroup>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='1'></foot-tab>
|
||||
<!-- 全局客服 -->
|
||||
<public-customer :nbottom="320"></public-customer>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
import listTwo from '@/components/list/list-two.vue';
|
||||
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
// 客服按钮组件
|
||||
import publicCustomer from '@/components/public-customer.vue';
|
||||
// 底部组件
|
||||
import footTab from '@/components/foot-tab.vue';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
cateTu,
|
||||
listTwo
|
||||
footTab,
|
||||
publicCustomer,
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -129,34 +138,17 @@
|
|||
],
|
||||
minPrice:'',//最低价格
|
||||
maxPrice:'',//最高价格
|
||||
ccurrent:0,
|
||||
cateList:[],
|
||||
cateListTwo:[//二级分类
|
||||
|
||||
],
|
||||
dataList:[//小课堂数据列表
|
||||
dataList:[//数据列表
|
||||
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
tuList:[],
|
||||
newCurrent:0,
|
||||
cateW:'',//分类宽度
|
||||
isLoading:false,
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
category_id:'',//栏目ID
|
||||
disease_id:'',//一级病种ID 可不填
|
||||
bannerList:[],
|
||||
titleList:uni.getStorageSync('footTitle'), // 底部导航文字
|
||||
imgList:uni.getStorageSync('footimg'), // 底部导航图标
|
||||
zanArr:[],
|
||||
dataShopList:[],
|
||||
timeList:[],
|
||||
isHot:false,
|
||||
isAutoPlay:false,
|
||||
optionObj:{}
|
||||
activityStr:'',
|
||||
categoryId:''
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -165,20 +157,9 @@
|
|||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
if(!this.isHot){
|
||||
this.checkCate(this.category_id)//调用自主预约列表事件
|
||||
}
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
this.implementEv();
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pages/tabbar/cate/cate?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
|
@ -186,9 +167,44 @@
|
|||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
// 调用获取筛选条件列表事件
|
||||
this.obtainScreen();
|
||||
// 调用商品列表查询事件
|
||||
this.implementEv();
|
||||
},
|
||||
methods: {
|
||||
// 获取筛选条件列表
|
||||
obtainScreen(){
|
||||
this.$requst.post('/api/spu/condition').then(res=>{
|
||||
if(res.code==0){
|
||||
this.screenList = [];
|
||||
if(res.data.length){
|
||||
res.data.forEach((item,index)=>{
|
||||
let obj = {};
|
||||
let newlist = [];
|
||||
item.children.forEach((item1,index1)=>{
|
||||
let childObj = {
|
||||
id:item1.value,
|
||||
title:item1.name,
|
||||
isCheck:index1==0 ? true : false
|
||||
}
|
||||
newlist.push(childObj)
|
||||
})
|
||||
obj = {
|
||||
mainTitle:item.title,
|
||||
childrenList:newlist
|
||||
}
|
||||
this.screenList.push(obj)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
|
||||
// 点击筛选按钮图标
|
||||
clikScreenIcon(){
|
||||
this.isScreen = true;
|
||||
|
@ -199,6 +215,10 @@
|
|||
this.screenList[mainIndex].childrenList.forEach((item,index)=>{
|
||||
item.isCheck = false;
|
||||
})
|
||||
// 设置分类id
|
||||
this.categoryId = this.screenList[0].childrenList[childrenIndex].id;
|
||||
// 设置限时优惠
|
||||
this.activityStr = this.screenList[1].childrenList[childrenIndex].id;
|
||||
// 将当前选择的类别下的数组置空
|
||||
this.temporaryCate[mainIndex] = [];
|
||||
// 设置当前选中项为true
|
||||
|
@ -257,6 +277,12 @@
|
|||
})
|
||||
})
|
||||
this.temporaryCate = [];
|
||||
// 设置分类id
|
||||
this.categoryId = '';
|
||||
// 设置限时优惠
|
||||
this.activityStr = '';
|
||||
// 调用搜索执行事件
|
||||
this.implementEv();
|
||||
}
|
||||
},
|
||||
// 分类筛选确认事件
|
||||
|
@ -272,285 +298,52 @@
|
|||
}
|
||||
})
|
||||
this.isScreen = false;
|
||||
this.page = 1;
|
||||
// 调用搜索执行事件
|
||||
this.implementEv();
|
||||
},
|
||||
checkSwi(){
|
||||
checkBanner({position:'category-hot-banner'}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let isVideo = false
|
||||
if(item.type!='img') isVideo = true
|
||||
let banObj = {
|
||||
imgSrc:this.$http + item.src,
|
||||
url:item.url,
|
||||
isVideo:isVideo,
|
||||
poster:this.$http + item.src,
|
||||
}
|
||||
this.bannerList.push(banObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
this.dataList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
}
|
||||
},
|
||||
comfirmev(e){//确认取消收藏事件
|
||||
this.dataList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
},
|
||||
checkBZ(){//病种列表
|
||||
this.$requst.post('archives/disease').then(res=>{
|
||||
// console.log('病种列表:',res);
|
||||
if(res.code==0 && res.data.length!=0){
|
||||
this.cateList=[]
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.name,
|
||||
pid:item.pid,
|
||||
sort:item.sort
|
||||
}
|
||||
this.cateList.push(obj)
|
||||
})
|
||||
let reObj = {
|
||||
id:this.cateList[0].id,
|
||||
title:'热门推荐',
|
||||
pid:this.cateList[0].pid,
|
||||
sort:this.cateList[0].sort
|
||||
}
|
||||
this.cateList.unshift(reObj)
|
||||
this.checkCate(this.category_id)//调用分类列表事件
|
||||
setTimeout(()=>{this.isLoading = true},500)
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkCate(category_id){//分类列表事件
|
||||
this.dataShopList = [];
|
||||
// this.$toolAll.tools.showToast('加载中...')
|
||||
this.$requst.post('archives/hot',{category_id:category_id,page:this.page,size:this.size}).then(res=>{
|
||||
// console.log('分类列表:',res);
|
||||
if(res.code==0){
|
||||
if(this.category_id==''){
|
||||
if(res.data.category.length!=0){
|
||||
this.cateListTwo = []
|
||||
res.data.category.forEach(item=>{
|
||||
let cateObj = {
|
||||
id:item.id,
|
||||
model:item.model,
|
||||
model_id:item.model_id,
|
||||
sort:item.sort,
|
||||
title:item.title
|
||||
}
|
||||
this.cateListTwo.push(cateObj)
|
||||
})
|
||||
this.cateListTwo.push({title:'热门商品'})
|
||||
this.cateListTwo.push({title:'筛选'})
|
||||
this.category_id = this.cateListTwo[0].id
|
||||
}
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) {
|
||||
this.dataList = [];
|
||||
uni.pageScrollTo({
|
||||
scrollTop:0,
|
||||
duration:0
|
||||
})
|
||||
}
|
||||
if(res.data.list.list.length!=0){
|
||||
this.total = res.data.list.total
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkData(disease_id){//一级病种列表事件
|
||||
this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{
|
||||
// console.log('一级病种列表内容:',res);
|
||||
if(res.code==0){
|
||||
this.tuList = []
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let arr = []
|
||||
if(item.children.length!=0){
|
||||
item.children.forEach(itemt=>{
|
||||
let objt = {
|
||||
category_id:itemt.category_id,
|
||||
content:itemt.title,
|
||||
id:itemt.id,
|
||||
disease_id:itemt.disease_id,//一级病种ID 1
|
||||
disease_second_id:itemt.disease_second_id,//二级病种ID 12
|
||||
subtitle:itemt.subtitle//内容副标题
|
||||
}
|
||||
arr.push(objt)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
title:item.name,
|
||||
src:'',
|
||||
list:arr
|
||||
// {content:'秃顶种植保养周期'},
|
||||
// {content:'秃顶种植保养手册'},
|
||||
// {content:'秃顶种植保养项目'},
|
||||
// {content:'那些人需要保养'},
|
||||
// ]
|
||||
}
|
||||
this.tuList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseTwo(index){//二级分类选择
|
||||
this.newCurrent = index
|
||||
this.isZanw = true;
|
||||
this.isHot = false;
|
||||
this.page = 1
|
||||
this.category_id = this.cateListTwo[index].id
|
||||
// console.log('二级分类:',this.cateListTwo[index].title);
|
||||
if(this.cateListTwo[index].title=='筛选'){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage'
|
||||
})
|
||||
} else if(this.cateListTwo[index].title=='热门商品'){
|
||||
this.isHot = true;
|
||||
this.checkSotList()
|
||||
} else {
|
||||
this.checkCate(this.cateListTwo[index].id)
|
||||
}
|
||||
},
|
||||
checkSotList(){
|
||||
this.dataList = [];
|
||||
// 搜索执行事件
|
||||
implementEv(){
|
||||
this.$toolAll.tools.showToast('搜索中...')
|
||||
let params = {
|
||||
page:1,
|
||||
size:2000,
|
||||
is_hot:1
|
||||
keyword:'', //商品关键字 支持模糊搜索
|
||||
page:this.page, // 页数
|
||||
size: this.size, // 每页数量
|
||||
activity:this.activityStr,// 活动类型 默认normal=普通商品;limit_time=限时促销
|
||||
category_id:this.categoryId,// 分类ID 多个分类用英文逗号分割
|
||||
price_from:this.minPrice,// 价格区间 最低价格 0不限
|
||||
price_to:this.maxPrice,// 价格区间 最大价格 0不限
|
||||
}
|
||||
uni.request({
|
||||
url:`${uni.getStorageSync('hostapi')}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
clearInterval(this.timer);
|
||||
// if(this.page==1) {
|
||||
this.zanArr = [];
|
||||
this.dataShopList = [];
|
||||
this.timeList = [];
|
||||
// }
|
||||
this.total = res.data.total;
|
||||
if(res.data.data.list.length!=0){
|
||||
res.data.data.list.forEach(item=>{
|
||||
let tuan = false,ping = false,xian = false,integral = false;
|
||||
if(item.activity_type=='group_make') ping = true;
|
||||
if(item.activity_type=='group_buy') tuan = true;
|
||||
if(item.activity_type=='limit_time') xian = true;
|
||||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc: this.$http + item.cover,
|
||||
title: item.name,
|
||||
zhePrice:item.price/100,
|
||||
yuanPrice:item.original_price/100,
|
||||
integral:'',
|
||||
isTuan:tuan,//是否是团购
|
||||
isPing:ping,//是否是拼团活动
|
||||
isXian:xian,//是否是限时活动
|
||||
isIntegral:integral,//是否是积分
|
||||
grade:'',
|
||||
disease_name:item.disease_name,//病种名称
|
||||
reponseTime:res.header.Date,//接口响应时间
|
||||
activity_end_at:item.activity_end_at,//限时结束时间
|
||||
activity_group_cover:group_cover,//参团人的头像
|
||||
activity_group_num:item.activity_group_num,//已经参团人数
|
||||
}
|
||||
this.zanArr.push(obj)
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.activity_end_at!='') {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
reponseTime:item.reponseTime,
|
||||
time:item.activity_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
this.$toolAll.tools.showToast('加载中...')
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
this.timeList[index].reponseTime = new Date(this.timeList[index].reponseTime).getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(this.timeList[index].reponseTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.zanArr[item.nIndex].activity_end_at = "活动已结束";
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
this.dataShopList = this.zanArr;
|
||||
},1000)
|
||||
} else {
|
||||
this.dataShopList = this.zanArr;
|
||||
this.$requst.post('/api/spu/list',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = [];
|
||||
// 设置商品总数
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc:item.cover,
|
||||
title:item.name,
|
||||
// price:this.$toolAll.tools.changeNum(item.price*1),
|
||||
price:item.price,
|
||||
isActivity:item.tag == '' ? false : true,
|
||||
}
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
goDetail(id){//前往详情页
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataShopList[index].isIntegral}`
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<view class="disjcac fc">
|
||||
<image class="mar-sx20" src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 224rpx;height: 224rpx;border-radius: 60rpx;"></image>
|
||||
<view class="fon36 bold">Anita Rose</view>
|
||||
<image class="mar-sx20" :src="userInfo.headimgurl" mode="aspectFill" style="width: 224rpx;height: 224rpx;border-radius: 60rpx;"></image>
|
||||
<view class="fon36 bold">{{userInfo.nickname}}</view>
|
||||
</view>
|
||||
<!-- 我的订单状态 -->
|
||||
<view style="margin-top: 100rpx;">
|
||||
|
@ -26,7 +26,7 @@
|
|||
<view class="disjbac fon28 col3 mar-x50">
|
||||
<view @tap="chooseOrderStatus(indexo)" v-for="(itemo,indexo) in orderStatus" :key="indexo">
|
||||
<view class="disac fc posir">
|
||||
<image :src="itemo.src" class="icon-img" mode="widthFix"></image>
|
||||
<image :src="itemo.src" :style="{width:[50,46,48,49,49][indexo]+'rpx',height:[44,40,42,44,45][indexo]+'rpx'}" class="icon-img" mode="widthFix"></image>
|
||||
<view class="mar-sx10 fon24 col0">{{itemo.title}}</view>
|
||||
<view class="posia red-num" style="right: 0;top: 0;" v-if="itemo.num!=0">{{itemo.num}}</view>
|
||||
</view>
|
||||
|
@ -38,19 +38,17 @@
|
|||
</container-subgroup>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='2'></foot-tab>
|
||||
<!-- 弹框授权 -->
|
||||
<!-- <auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import functionList from '@/components/function-list/function-list.vue';
|
||||
// 底部组件
|
||||
import footTab from '@/components/foot-tab.vue';
|
||||
export default {
|
||||
components:{functionList},
|
||||
components:{functionList,footTab},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
orderStatus:[//我的订单状态
|
||||
{src:'/static/public/icon-payment.png',title:'待付款',num:0},
|
||||
{src:'/static/public/icon-send-goods.png',title:'待发货',num:0},
|
||||
|
@ -98,7 +96,8 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
// this.checkInfo();
|
||||
// 查询用户信息
|
||||
this.checkInfo();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
|
@ -114,17 +113,21 @@
|
|||
let statusIndex = ''
|
||||
if(index==0) statusIndex = 1;
|
||||
if(index==1) statusIndex = 2;
|
||||
if(index==2) statusIndex = 4;
|
||||
if(index==3) statusIndex = 5;
|
||||
if(index==2) statusIndex = 3;
|
||||
if(index==3) statusIndex = 4;
|
||||
if(index==4) statusIndex = 5;
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder?index='+statusIndex
|
||||
})
|
||||
},
|
||||
checkInfo(){
|
||||
this.$requst.post('user/info').then(res=>{
|
||||
this.$requst.post('/api/user/info').then(res=>{
|
||||
// console.log('用户信息:',res);
|
||||
if(res.code==0 && res.data.length!=0) {
|
||||
this.userInfo = res.data;
|
||||
this.orderStatus[0].num = this.userInfo.order_count.waiting;//待付款
|
||||
this.orderStatus[1].num = this.userInfo.order_count.paid;//待发货
|
||||
this.orderStatus[2].num = this.userInfo.order_count.shipped;//待收货
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
|
|
|
@ -9,30 +9,49 @@
|
|||
<view :style="{paddingTop: statusBarHeight +'px'}">
|
||||
<view class="pad-sx20 pad-zy40">
|
||||
<!-- 搜索输入框 start -->
|
||||
<view class="radius30 disac pad-zy40 pad-sx20 mar-x40" style="background-color: #f2f1f7;">
|
||||
<image src="/static/public/icon-search.png" mode="widthFix" style="width: 60rpx;height: 60rpx;"></image>
|
||||
<input @confirm="searchEv" class="pad-z20 width100" type="text" v-model="searchText" placeholder="搜索" placeholder-style="font-weight: bold;" />
|
||||
<view class="radius30 disac pad-zy40 pad-sx30 mar-x40" style="background-color: #f2f1f7;">
|
||||
<image src="/static/public/icon-search.png" mode="widthFix" style="width: 40rpx;height: 40rpx;"></image>
|
||||
<input @confirm="searchEv" class="pad-z20 width100 fon36" type="text" v-model="searchText" placeholder="搜索" />
|
||||
</view>
|
||||
<!-- 搜索输入框 end -->
|
||||
|
||||
<!-- 轮播图 start -->
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'230'" :newRadius="'15'" :newBottom="'10'"></swiper-pu>
|
||||
<!-- 轮播图 end -->
|
||||
<!-- 轮播图 end -->
|
||||
</view>
|
||||
<view style="position: sticky;z-index: 10;" :style="{ top: statusBarHeight +'px'}">
|
||||
<swiper-tab id="tab" :list="type" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000">
|
||||
<swiper-tab id="tab" :list="classifyList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000">
|
||||
<!-- 自定义tabs样式 -->
|
||||
<!-- <view slot="title">其其</view> -->
|
||||
<!-- <view slot="title"></view> -->
|
||||
</swiper-tab>
|
||||
</view>
|
||||
<view class="pad-zy40 pad-s40">
|
||||
<swiper class="swiper-page pad-x140" :style="{ height: swiperHeight - statusBarHeight +'px'}" :current="current" @change="swiperChange">
|
||||
<swiper-item v-for="item in type" :key="index">
|
||||
<view class="pad-zy40 mar-x160">
|
||||
<swiper class="swiper-page pad-s40" :style="{ height: swiperHeight - statusBarHeight +'px'}" :current="current" @change="swiperChange">
|
||||
<swiper-item v-for="(item,index) in classifyList" :key="index">
|
||||
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
|
||||
<!-- 列表数据 -->
|
||||
<list-one></list-one>
|
||||
<!-- 活动商品 start -->
|
||||
<view v-for="(item,index) in dataList[index][0]" :key="index" class="mar-x50">
|
||||
<h1 class="fon36 bold">{{item.name}}</h1>
|
||||
<view class="colpeili fon26 mar-s20 mar-x40 clips1">{{item.subtitle}}</view>
|
||||
<view class="posir" @tap="goDetail(item.id)">
|
||||
<image class="radius30 animated fadeIn" :src="item.cover" mode="aspectFill" lazy-load style="height: 425rpx;width: 100%;"></image>
|
||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动商品 end -->
|
||||
|
||||
<!-- 子商品 start -->
|
||||
<view class="disjbac fw">
|
||||
<view @tap="goDetail(item.id)" class="width47 mar-x50 posir" v-for="(item,index) in dataList[index][1]" :key="index">
|
||||
<image :src="item.cover" mode="aspectFill" lazy-load style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item.name}}</view>
|
||||
<view class="fon30 colpeili">¥{{item.price}}</view>
|
||||
<view v-if="item.tag!=''" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 子商品 end -->
|
||||
<!-- 暂无更多数据 -->
|
||||
<pitera v-if="pitera"></pitera>
|
||||
<pitera v-if="noMore"></pitera>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
@ -53,38 +72,35 @@
|
|||
// 列表组件
|
||||
import listOne from '@/components/list/list-one.vue';
|
||||
// 公共接口
|
||||
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
// 底部导航组件
|
||||
import footTab from '@/components/foot-tab.vue';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
pitera,
|
||||
swiperTab,
|
||||
listOne
|
||||
listOne,
|
||||
footTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
searchText:'',// 搜索内容
|
||||
type: [{
|
||||
title: '翡翠'
|
||||
}, {
|
||||
title: '白玉'
|
||||
}, {
|
||||
title: '彩宝'
|
||||
}, {
|
||||
title: '琥珀'
|
||||
}, {
|
||||
title: '其他'
|
||||
}],
|
||||
classifyList: [
|
||||
// {//默认结构
|
||||
// id:1,
|
||||
// title: '翡翠'
|
||||
// }
|
||||
],
|
||||
current:0, // 当前显示tab及swiper列表
|
||||
swiperHeight:uni.getSystemInfoSync().windowHeight,
|
||||
publicColor:'', // 主题颜色
|
||||
showTop:false, // 是否显示回到顶部
|
||||
dataList:[], // 数据列表
|
||||
page:1, // 第几页
|
||||
size:10, // 数量
|
||||
size:5, // 数量
|
||||
total:0, // 总数
|
||||
pitera:false, // 是否显示暂无数据
|
||||
titleList:uni.getStorageSync('footTitle'), // 底部导航文字
|
||||
imgList:uni.getStorageSync('footimg'), // 底部导航图标
|
||||
ifNet:true,
|
||||
|
@ -93,7 +109,9 @@
|
|||
refNum:0, // 刷新次数
|
||||
bannerList:[], // 轮播图
|
||||
isAutoPlay:false,// 是否开启自动轮播
|
||||
blockIng:true, // 阻止执行
|
||||
check:uni.getStorageSync('is_active'),
|
||||
classifyId:'',//分类id
|
||||
noMore:false,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -110,7 +128,7 @@
|
|||
onReady() {
|
||||
// 获取ID为tab元素的信息
|
||||
uni.createSelectorQuery().in(this).select('#tab').boundingClientRect().exec(rect => {
|
||||
this.swiperHeight = this.swiperHeight - rect[0].height
|
||||
this.swiperHeight = this.swiperHeight - rect[0].height - 150
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
|
@ -126,21 +144,21 @@
|
|||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.q!=undefined){
|
||||
// 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
||||
// 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
||||
let str = unescape(options.q);
|
||||
// console.log(str);
|
||||
let len1 = str.indexOf('invite_code=');
|
||||
let len2 = str.indexOf('channel=');
|
||||
let len3 = str.indexOf('source_code=');
|
||||
let newInvite = '';
|
||||
let newChanel = '';
|
||||
let newsource_code = '';
|
||||
if(len1!=-1) newInvite = str.slice((len1+12),(len1+12+32));
|
||||
if(len2!=-1) newChanel = str.slice((len2+8),(len2+8+8));
|
||||
if(len3!=-1) newsource_code = str.slice((len3+12),(len3+12+32));
|
||||
}
|
||||
// if(options.q!=undefined){
|
||||
// // 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
||||
// // 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
||||
// let str = unescape(options.q);
|
||||
// // console.log(str);
|
||||
// let len1 = str.indexOf('invite_code=');
|
||||
// let len2 = str.indexOf('channel=');
|
||||
// let len3 = str.indexOf('source_code=');
|
||||
// let newInvite = '';
|
||||
// let newChanel = '';
|
||||
// let newsource_code = '';
|
||||
// if(len1!=-1) newInvite = str.slice((len1+12),(len1+12+32));
|
||||
// if(len2!=-1) newChanel = str.slice((len2+8),(len2+8+8));
|
||||
// if(len3!=-1) newsource_code = str.slice((len3+12),(len3+12+32));
|
||||
// }
|
||||
// const query = wx.createSelectorQuery()
|
||||
// query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// // log('状态栏+标题栏:',rect.height);
|
||||
|
@ -148,39 +166,103 @@
|
|||
// this.statusHNH = rect.height
|
||||
// }).exec()
|
||||
this.checkSwi();//查询轮播图
|
||||
this.checkUserInfo();//查询用户信息
|
||||
this.classifyEv();// 调用分类查询事件
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){//前往详情页
|
||||
if(this.check){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:`/pages/login/login`
|
||||
})
|
||||
}
|
||||
},
|
||||
// 分类查询
|
||||
classifyEv(){
|
||||
this.$requst.post('/api/spu/category').then(res=>{
|
||||
if(res.code==0){
|
||||
this.classifyList = res.data;
|
||||
if(this.classifyList.length){
|
||||
// 分类第一次加载,设置分类id
|
||||
this.classifyId = this.classifyList[0].id;
|
||||
this.classifyList.forEach(item=>{
|
||||
this.dataList.push([[],[]]);
|
||||
})
|
||||
this.$nextTick(()=>{
|
||||
//查询商品列表
|
||||
this.checkList();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 视图容器触底事件
|
||||
scrollBottomEv(){
|
||||
// 判断总数是否等于数组长度,如果相等显示暂无更多,否则继续执行列表事件
|
||||
if(this.total!=this.dataList.length){
|
||||
if(this.total!=(this.dataList[this.current][0].length+this.dataList[this.current][1].length)){
|
||||
// 页数每次+1
|
||||
this.page++
|
||||
// this.checkList(); // 调用列表事件
|
||||
this.checkList(); // 调用列表事件
|
||||
} else {
|
||||
// 显示暂无数据
|
||||
this.pitera = true;
|
||||
this.noMore = true;
|
||||
}
|
||||
},
|
||||
// tab点击事件
|
||||
clickTab(index){
|
||||
this.current = index
|
||||
},
|
||||
// 列表滑动事件
|
||||
swiperChange(e){
|
||||
this.current = e.detail.current
|
||||
},
|
||||
// 用户信息查询
|
||||
async checkUserInfo(){
|
||||
this.$requst.post('user/info').then(res=>{
|
||||
// 查询商品列表
|
||||
checkList(){
|
||||
let params = {
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
category_id: this.classifyId,//分类id
|
||||
}
|
||||
if(this.page!=1){
|
||||
uni.showLoading({
|
||||
title:'加载中...'
|
||||
})
|
||||
}
|
||||
this.$requst.post('/api/spu/home',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.phone_active!=0){
|
||||
uni.setStorageSync('phone_active',res.data.phone_active);
|
||||
if(this.page==1) {
|
||||
this.dataList[this.current] = [[],[]];
|
||||
}
|
||||
// 设置列表总数
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
if(item.home_display=='big'){
|
||||
this.dataList[this.current][0].push(item);
|
||||
} else {
|
||||
let twoObj = {
|
||||
amount: item.amount,
|
||||
cover: item.cover,
|
||||
home_display: item.home_display,
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
original_price: this.$toolAll.tools.changeNum(item.original_price),
|
||||
price: this.$toolAll.tools.changeNum(item.price),
|
||||
stock: item.stock,
|
||||
subtitle: item.subtitle,
|
||||
tag: item.tag
|
||||
}
|
||||
this.dataList[this.current][1].push(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.total == (this.dataList[this.current][0].length + this.dataList[this.current][1].length)){
|
||||
this.noMore = true;
|
||||
}
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 顶部轮播查询事件
|
||||
|
@ -204,10 +286,14 @@
|
|||
})
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
if(this.blockIng){
|
||||
if(this.check){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/searchPage/searchPage?keyWorld=${ this.searchText }`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 网络检测事件
|
||||
|
@ -241,12 +327,24 @@
|
|||
this.checkNet()
|
||||
},1000)
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
// tab点击事件
|
||||
clickTab(index){
|
||||
// 设置选中下标
|
||||
this.current = index;
|
||||
},
|
||||
// 列表滑动事件
|
||||
swiperChange(e){
|
||||
this.current = e.detail.current;
|
||||
// 调用执行列表查询事件
|
||||
this.executeCheckList();
|
||||
},
|
||||
// 执行列表查询事件
|
||||
executeCheckList(){
|
||||
this.page = 1;
|
||||
this.classifyId = this.classifyList[this.current].id
|
||||
// 调用列表查询事件
|
||||
this.checkList();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'分销中心'"></status-nav>
|
||||
<view class="pad-zy30" :style="{paddingTop: statusBarHeight+'px'}">
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<!-- 标题 -->
|
||||
<view class="fon30 col0 mar-s30 mar-x10 tcenter">我的佣金</view>
|
||||
<!-- 佣金 -->
|
||||
|
@ -11,15 +12,15 @@
|
|||
<view class="disja mar-s30">
|
||||
<view class="disjcac fc">
|
||||
<view class="fon24 colpeili">累计收益</view>
|
||||
<view class="fon36 col0 bold mar-s20">¥2000</view>
|
||||
<view class="fon36 col0 bold mar-s20">¥{{distributionInfo.commission_total}}</view>
|
||||
</view>
|
||||
<view class="disjcac fc">
|
||||
<view class="fon24 colpeili">累计提现</view>
|
||||
<view class="fon36 col0 bold mar-s20">¥2000</view>
|
||||
<view class="fon36 col0 bold mar-s20">¥{{distributionInfo.withdrawal_total}}</view>
|
||||
</view>
|
||||
<view class="disjcac fc">
|
||||
<view class="fon24 colpeili">分享好友</view>
|
||||
<view class="fon36 col0 bold mar-s10">2000</view>
|
||||
<view class="fon36 col0 bold mar-s10">{{distributionInfo.invite_count}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 提现按钮 -->
|
||||
|
@ -27,32 +28,34 @@
|
|||
<!-- 佣金记录 -->
|
||||
<view class="fon36 col0 bold pad-sx20 bbot">佣金记录</view>
|
||||
<!-- 列表 -->
|
||||
<view>
|
||||
<view v-if="dataList.length">
|
||||
<view class="bbot pad-sx20" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="disjbac">
|
||||
<view class="fon30 col0 bold">{{item.title}}</view>
|
||||
<view class="fon24 colpeili">{{item.status}}</view>
|
||||
<view class="fon30 col0 bold">{{item.name}}</view>
|
||||
<!-- <view class="fon24 colpeili">{{item.status}}</view> -->
|
||||
</view>
|
||||
<view class="disjbac mar-s20">
|
||||
<view class="fon24 colpeili">{{item.time}}</view>
|
||||
<view class="fon24 colpeili">{{item.created_at}}</view>
|
||||
<view class="fon30 peili-colorRed bold">-{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 暂无 -->
|
||||
<pitera v-if="total==dataList.length"></pitera>
|
||||
</container-subgroup>
|
||||
<!-- 提现弹框 -->
|
||||
<view v-show="showwithdrawal" :style="{top: statusBarHeight+'px'}" @tap="showwithdrawal=false" class="withdrawal-box">
|
||||
<view @tap.stop="showwithdrawal=true" class="bacf radius20 pad30 posir fon30 col0 mar-zy50 mar-s100">
|
||||
<view class="tcenter">提现申请</view>
|
||||
<view class="mar-s20">
|
||||
<view class="fon24 colpeili">提现金额</view>
|
||||
<input type="text" class="pad-sx10 width100 bbot" value="" placeholder="请输入金额" placeholder-style="color:#000000;" />
|
||||
<input type="text" class="pad-sx10 width100 bbot" v-model="commissionPrice" placeholder="请输入金额" placeholder-style="color:#000000;" />
|
||||
</view>
|
||||
<view class="mar-s20">
|
||||
<view class="fon24 colpeili">微信号码</view>
|
||||
<input type="text" class="pad-sx10 width100 bbot" value="" placeholder="请输入微信号码" placeholder-style="color:#000000;" />
|
||||
<input type="text" class="pad-sx10 width100 bbot" v-model="wechatStr" placeholder="请输入微信号码" placeholder-style="color:#000000;" />
|
||||
</view>
|
||||
<view class="withdrawal-btn radius30 colf fon36 tcenter peili-backColor mar-s70">立即提现</view>
|
||||
<view @tap="commissionExchange" class="withdrawal-btn radius30 colf fon36 tcenter peili-backColor mar-s70">立即提现</view>
|
||||
<!-- 关闭按钮 -->
|
||||
<image @tap.stop="showwithdrawal=false" src="/static/public/icon-close-01.png" mode="" lazy-load></image>
|
||||
</view>
|
||||
|
@ -61,62 +64,126 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
commission:1000,
|
||||
commission:0, // 我的佣金
|
||||
dataList:[
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:300,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:300,
|
||||
},
|
||||
{
|
||||
title:'提现',
|
||||
time:'2022-2-19 16:56:18',
|
||||
price:600,
|
||||
status:'成功'
|
||||
name:'提现',
|
||||
created_at:'2022-2-19 16:56:18',
|
||||
num:600,
|
||||
}
|
||||
],
|
||||
showwithdrawal:false
|
||||
showwithdrawal:false, // 是否显示提现弹框
|
||||
distributionInfo:{}, // 分销数据详情
|
||||
commissionPrice:'' ,// 输入金额
|
||||
wechatStr:'',//微信号
|
||||
page:1,
|
||||
size:10,
|
||||
total:0
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList){
|
||||
this.page++;
|
||||
// 调取查询分享信息事件
|
||||
this.checkCommissionEv();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 调取佣金信息事件
|
||||
this.checkCommissionEv();
|
||||
},
|
||||
methods: {
|
||||
// 查询佣金信息
|
||||
checkCommissionEv(){
|
||||
this.$requst.post('/api/user/commission').then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = [];
|
||||
// 分销中心数字信息
|
||||
this.distributionInfo = res.data;
|
||||
// 我的佣金
|
||||
this.commission = this.distributionInfo.commission;
|
||||
// 设置列表
|
||||
this.dataList = this.dataList.concat(this.distributionInfo.log.list);
|
||||
// 设置总数
|
||||
this.total = this.distributionInfo.log.total;
|
||||
this.log(this.total,this.dataList.length)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 调起弹框
|
||||
tuneEv(){
|
||||
this.showwithdrawal = true;
|
||||
if(this.commission*1 == 0 ){
|
||||
this.$toolAll.tools.showToast('剩余佣金不足')
|
||||
} else {
|
||||
this.showwithdrawal = true;
|
||||
}
|
||||
},
|
||||
// 发起提现
|
||||
commissionExchange(){
|
||||
if(!this.commissionPrice || this.commissionPrice==0){
|
||||
this.$toolAll.tools.showToast('请输入提现金额');
|
||||
} else if(!this.wechatStr){
|
||||
this.$toolAll.tools.showToast('请输入微信号');
|
||||
} else {
|
||||
this.$requst.post('/api/user/commission-withdrawal',{commission:this.commissionPrice,wechat:this.wechatStr}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('申请提现已提交');
|
||||
this.page = 1;
|
||||
setTimeout(()=>{
|
||||
// 关闭提现弹框
|
||||
this.showwithdrawal = false;
|
||||
// 更新数据-调取佣金信息事件
|
||||
this.checkCommissionEv();
|
||||
},2000)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="pad-x160">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'确认订单'"></status-nav>
|
||||
<!-- 容器 -->
|
||||
|
@ -7,7 +7,7 @@
|
|||
<view class="bacf6 fon30 col3 radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">配送方式</view>
|
||||
<view class="disac">
|
||||
<view v-if="!isVirtual" @tap="expressEv(0)" :class="isExpress?'activeT':'expressT'" :style="{background:isExpress?publicColor:''}">快递</view>
|
||||
<view @tap="expressEv(0)" :class="isExpress?'activeT':'expressT'" :style="{background:isExpress?publicColor:''}">快递</view>
|
||||
<view @tap="expressEv(1)" :class="!isExpress?'activeT':'expressT'" :style="{background:isExpress?'':publicColor}">自提</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -16,9 +16,9 @@
|
|||
<view class="bold">收件人信息</view>
|
||||
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
|
||||
<view class="disjbac pad-s30">
|
||||
<view v-if="addressInfo==''">
|
||||
<view class="fon28 bold mar-x10">吃肉的饺子 <span class="mar-z20">17366921088</span></view>
|
||||
<view class="fon24 col9">四川省成都市成华区双店路B口</view>
|
||||
<view v-if="addressInfo!=''">
|
||||
<view class="fon28 bold mar-x10">{{addressInfo.name}}<span class="mar-z20">{{userPphone}}</span></view>
|
||||
<view class="fon24 col9">{{addressInfo.province_str}}{{addressInfo.city_str}}{{addressInfo.county_str || ''}}{{addressInfo.address || ''}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col9">请完善收件人信息</view>
|
||||
<i class="icon icon-next col0"></i>
|
||||
|
@ -28,11 +28,11 @@
|
|||
<!-- 自提地址 -->
|
||||
<view v-else class="bacf6 fon30 col3 radius20 mar-s20 pad-sx27-zy20">
|
||||
<view class="bold">自提地址</view>
|
||||
<!-- <input type="number" maxlength="11" :focus="isFocus" @blur="blurEv" v-model="zPhone" class="mar-s50 mar-x20" style="border: 2rpx solid #E0E0E0;padding: 20rpx;border-radius: 10rpx;font-size: 24rpx;" placeholder="请输入收货人手机号" /> -->
|
||||
<input type="number" maxlength="11" :focus="isFocus" @blur="blurEv" v-model="zPhone" class="mar-s50 mar-x20" style="border: 2rpx solid #E0E0E0;padding: 20rpx;border-radius: 10rpx;font-size: 24rpx;" placeholder="请输入收货人手机号" />
|
||||
<view class="disjbac mar-s50">
|
||||
<view>
|
||||
<view class="fon28 bold mar-x20">佩丽饰品</view>
|
||||
<view class="fon24 col9">四川省成都市成华区双店路B口</view>
|
||||
<view class="fon24 col9">{{goAddress}}</view>
|
||||
</view>
|
||||
<!-- 立即导航 -->
|
||||
<view @tap="goThere(goAddress)" class="disjcac fc col0 fon24">
|
||||
|
@ -50,87 +50,44 @@
|
|||
<view class="width100 disjb fw" style="height: 166rpx;">
|
||||
<view>
|
||||
<view @tap="goShopDetail(item.id)" class="fon30 col3 bold clips2">{{item.title}}</view>
|
||||
<view class="order-sy">{{item.sku_name}}</view>
|
||||
<!-- <view class="order-sy">{{item.sku_name}}</view> -->
|
||||
</view>
|
||||
<view class="disjbac mar-s10 width100">
|
||||
<view class="order-item-price" v-if="isNei!=3">¥{{item.price}}</view>
|
||||
<view class="order-item-price" v-else>积分:{{item.price}}</view>
|
||||
<view class="order-item-price">¥{{item.price}}</view>
|
||||
<view class="fon30 col6">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon30 disjbac mar-s20 pad-s10">
|
||||
<view class="col6">共{{allNum}}件</view>
|
||||
<view class="bold colf8" v-if="isNei!=3">应付款:{{zanAllPrice}}</view>
|
||||
<view class="bold colf8" v-else>应付款:{{allPrice}}</view>
|
||||
<view class="bold colf8">应付款:{{allPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 优惠 -->
|
||||
<view v-if="isNei!=3" class="bacf6 fon30 col3 radius20 mar-s20 pad-sx27-zy20 disjbac">
|
||||
<view class="bacf6 fon30 col3 radius20 mar-s20 pad-sx27-zy20 disjbac">
|
||||
<view class="bold">折扣优惠</view>
|
||||
<view class="colf8 bold">¥0</view>
|
||||
<view class="colf8 bold">¥{{discountPrice}}</view>
|
||||
</view>
|
||||
<!-- 快递费用 -->
|
||||
<view v-if="isExpress" class="bacf6 fon30 radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">快递费用</view>
|
||||
<view class="colf8 bold">¥0</view>
|
||||
<view class="colf8 bold">¥{{expressInfo.default_price}}</view>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
<payment></payment>
|
||||
<view v-if="showQuan" @tap.stop="showQuan=false" class="posAll">
|
||||
<view class="bacf posixzy" style="border-radius: 40rpx 40rpx 0rpx 0rpx;" @tap.stop="showQuan=true">
|
||||
<view class="pad-sx20 pad-zy50">
|
||||
<view class="disjbac">
|
||||
<view class="fon28 bold col3">可用优惠券({{quanList.length}})</view>
|
||||
<image @tap.stop="showQuan=false" src="/static/public/cha-close.png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- <view class="fon28 bold col3 disja pad-s50" style="padding-bottom: 16rpx;">
|
||||
<view class="posir" :class="switchQuan?'activeQuan':''" @tap="switchQuan=true">可用优惠券(1)</view>
|
||||
<view class="posir" :class="!switchQuan?'activeQuan':''" @tap="switchQuan=false">失效优惠券(0)</view>
|
||||
</view> -->
|
||||
<scroll-view scroll-y class="mar-s40 quan-list-box">
|
||||
<view @tap.stop="chooseQuan(index)" v-for="(item,index) in quanList" :key="index" class="mar-x40">
|
||||
<view class="disjbac quan-item-box">
|
||||
<view class="posir">
|
||||
<image class="posia" src="/static/public/quan-left.png" mode=""></image>
|
||||
<view class="posir" style="z-index: 1;">
|
||||
<view class="pad-s40 pad-x30 fon28">¥<span class="bold fon56">{{item.youPrice}}</span></view>
|
||||
<view class="fon24" style="padding-left: 12rpx;">满{{item.manPrice}}元可使用</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- <view class="fon28 col3 mar-s20">{{['黄金','白银'][item.isGrade]}}会员专属优惠券</view> -->
|
||||
<view class="fon28 col3 mar-s20">{{item.name}}</view>
|
||||
<view>
|
||||
<image v-if="item.isStatus" src="/static/public/chooseQuan.png"></image>
|
||||
<image v-else src="/static/public/cancleQuan.png"></image>
|
||||
</view>
|
||||
<view class="fon20 col3 mar-x20">有效期:{{item.startTime.slice(0,10)}}至{{item.endTime.slice(0,10)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 领取优惠券按钮 -->
|
||||
<view @tap.stop="goCoupon" class="ling-btn">领取优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部导航 -->
|
||||
<payment :totalPrice="totalPrice" @immediatePayment="goPayment"></payment>
|
||||
<!-- 支付成功 -->
|
||||
<view v-if="isSuccess" class="posAll" :style="{top:statusHNH+'px'}" style="z-index: 3;background-color: #F5F5F5;">
|
||||
<view v-if="isSuccess" class="posAll" style="z-index: 3;background-color: #F5F5F5;">
|
||||
<view class="bacf radius20 mar-s20 mar-zy20 success-box">
|
||||
<image src="/static/public/pay-success.png" mode=""></image>
|
||||
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
|
||||
<view class="success-hj"><span v-if="isNei!=3">¥{{jsPrice<0?0:jsPrice}}</span><span v-else>合计:{{jsPrice}}</span></view>
|
||||
<view class="success-hj"><span>¥{{jsPrice<0?0:jsPrice}}</span></view>
|
||||
<view class="disja success-btn">
|
||||
<view @tap="goDetail">查看订单</view>
|
||||
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<!-- <empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower> -->
|
||||
<!-- 弹框 -->
|
||||
<!-- <auth-phone v-if="isShowP"></auth-phone> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -142,135 +99,74 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isExpress:true,
|
||||
switchQuan:true,
|
||||
showQuan:false,//是否显示优惠券弹框
|
||||
isDui:false,
|
||||
orderList:uni.getStorageSync('orderList'),
|
||||
quanList:[],
|
||||
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||
youQuan:{
|
||||
id:0,
|
||||
youPrice:0
|
||||
},//优惠券
|
||||
delPrice:0,//立减优惠(限时活动的)
|
||||
allPrice:0,//合计
|
||||
allNum:0,//总数量
|
||||
zanAllPrice:0,//暂存合计
|
||||
goAddress:'四川省成都市青羊区草堂东路88号',
|
||||
discountPrice:0,// 折扣优惠
|
||||
isNei:0,
|
||||
expressInfo:{},//快递信息
|
||||
addressInfo:'',//地址信息
|
||||
userPphone:'请完善信息',
|
||||
zPhone:'',//自提时的手机号
|
||||
page:1,
|
||||
size:10,
|
||||
isFocus:false,
|
||||
loading:false,
|
||||
zf_allPrice:0,//实际付款
|
||||
zf_kqPrice:0,//孔雀币
|
||||
payFS:[
|
||||
{title:'微信支付',isActive:true,num:0},
|
||||
{title:'孔雀币',isActive:false,num:100},
|
||||
{title:'积分',isActive:false,num:100},
|
||||
],
|
||||
isKq:false,
|
||||
jsPrice:0,//结算时的金额,
|
||||
zc_allPrice:0,//暂存实际总金额
|
||||
coin_price:0,//孔雀币转换后的元
|
||||
isSuccess:false,//支付成功
|
||||
ntype:'money',//默认money孔雀币转钱 coin钱转孔雀币
|
||||
times:0,//点击次数
|
||||
isCurrent:2,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
isfen:false,
|
||||
checkGrounpId:0,
|
||||
expressInfo:{
|
||||
default_price:0
|
||||
code:'',//快递编号
|
||||
default_price:0 //快递费
|
||||
},
|
||||
isVirtual:false//是否是虚拟商品
|
||||
userPphone:'', // 快递时的手机号
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
// 所有商品数量
|
||||
allNum(){
|
||||
let num = 0;
|
||||
this.orderList.forEach(item=>{
|
||||
num += item.num;
|
||||
})
|
||||
return num;
|
||||
},
|
||||
// 应付款金额
|
||||
allPrice(){
|
||||
let newPrice = 0;
|
||||
this.orderList.forEach(item=>{
|
||||
newPrice += item.num * item.price;
|
||||
})
|
||||
return this.$toolAll.tools.addXiaoShu(newPrice);
|
||||
},
|
||||
// 合计金额
|
||||
totalPrice(){
|
||||
let price1 = this.$toolAll.tools.operationEv(this.allPrice, this.discountPrice, '-', 2);
|
||||
// 是否计算快递费
|
||||
let expressPrice = 0;
|
||||
this.isExpress ? expressPrice = this.expressInfo.default_price : expressPrice = 0;
|
||||
return this.$toolAll.tools.operationEv(price1, expressPrice, '+', 2);
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderList[0].id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
c:this.orderList[0].id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
if(ya.addressInfo.share_img==null) ya.addressInfo.share_img = ya.addressInfo.cover;
|
||||
var shareObj = {
|
||||
title: `${ya.orderList[0].title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=${this.orderList[0].category_id}&share_id=${this.checkGrounpId}&invite_code=${uni.getStorageSync('invite_code')}&shareCate=${this.orderList[0].cateNum}&checkGrounpId=${this.orderList[0].checkGrounpId}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.orderList[0].imgSrc//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkChoose();//检测地址
|
||||
uni.removeStorageSync('orderInfo');
|
||||
this.checkChoose();//调用检测地址
|
||||
},
|
||||
onLoad(options) {
|
||||
// 自提手机号
|
||||
this.zPhone = uni.getStorageSync('phone');
|
||||
// 判断是不是虚拟商品
|
||||
options.isVirtual == "virtual" ? this.isVirtual = true : this.isVirtual = false
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkexpress();//查询快递
|
||||
this.checkeList(options.isNei);//查询订单列表
|
||||
this.checkOrderDetail();//查询订单信息
|
||||
this.isNei = options.isNei;
|
||||
if(this.isNei==3) {
|
||||
this.payFS[0].isActive = false;
|
||||
this.payFS[2].isActive = true;
|
||||
this.isCurrent = 1;
|
||||
}
|
||||
// 调取查询快递公司信息事件
|
||||
this.checkexpress();
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
//检测地址
|
||||
checkChoose(){
|
||||
console.log(uni.getStorageSync('chooseAddress'),165);
|
||||
if(uni.getStorageSync('chooseAddress')==''){
|
||||
this.checkAddress();//查询地址
|
||||
} else {
|
||||
console.log(uni.getStorageSync('chooseAddress'));
|
||||
let naddress = uni.getStorageSync('chooseAddress');
|
||||
this.addressInfo = {
|
||||
id:naddress.id,
|
||||
|
@ -284,146 +180,18 @@
|
|||
this.userPphone = this.$toolAll.tools.hideMPhone(naddress.userPhone);
|
||||
}
|
||||
},
|
||||
obtainCoin(coinNum){//获取当前账户孔雀币
|
||||
this.$requst.post('user/get-coin-price',{amount:coinNum,get_type:this.ntype}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.ntype=='money'){
|
||||
this.coin_price = res.data.amount/100;
|
||||
} else {
|
||||
this.zf_kqPrice = res.data.amount;
|
||||
this.isKq = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goShopDetail(id){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
},
|
||||
chooseFS(index){
|
||||
this.payFS[index].isActive = !this.payFS[index].isActive;
|
||||
if(this.isNei==3){//积分
|
||||
if(!this.payFS[0].isActive && !this.payFS[2].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式');
|
||||
this.allPrice = this.zanAllPrice;
|
||||
this.isKq = false;
|
||||
return;
|
||||
}
|
||||
} else {//孔雀币
|
||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式')
|
||||
this.allPrice = this.zanAllPrice;
|
||||
this.isKq = false;
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(this.payFS[index].title=='微信支付'){
|
||||
if(this.isNei!=3){
|
||||
//选择了微信支付+选择了孔雀币
|
||||
if(this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
if(this.zanAllPrice - this.coin_price >=0){//孔雀币不足以抵扣
|
||||
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price);
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
} else {//孔雀币足以抵扣
|
||||
this.allPrice = 0;
|
||||
this.ntype = 'coin';
|
||||
this.obtainCoin(this.zanAllPrice*100);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+选择了孔雀币
|
||||
if(!this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
if(this.zanAllPrice - this.coin_price>0){
|
||||
this.$toolAll.tools.showToast('孔雀币不足');
|
||||
}
|
||||
return;
|
||||
}
|
||||
//选择了微信支付+取消了孔雀币
|
||||
if(this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.isKq = false;
|
||||
this.zf_kqPrice = 0;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(this.expressInfo.default_price==0){
|
||||
this.$toolAll.tools.showToast('暂不可微信支付');
|
||||
this.payFS[index].isActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.payFS[index].title=='孔雀币') {
|
||||
if(this.youQuan.youPrice!=0){
|
||||
this.payFS[1].isActive = false;
|
||||
this.$toolAll.tools.showToast('无法使用孔雀币支付');
|
||||
} else {
|
||||
if(this.coin_price!=0){
|
||||
//选择了微信支付+选择了孔雀币
|
||||
if(this.payFS[0].isActive && this.payFS[1].isActive) {
|
||||
if(this.zanAllPrice - this.coin_price<=0){//孔雀币足以抵扣
|
||||
this.ntype = 'coin';
|
||||
this.obtainCoin(this.zanAllPrice*100);
|
||||
this.allPrice = 0;
|
||||
} else {//孔雀币不足以抵扣
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//选择了微信支付+取消了孔雀币
|
||||
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
|
||||
this.isKq = false;
|
||||
this.zf_kqPrice = 0;
|
||||
// 如果优惠券金额等:0
|
||||
if(this.youQuan.youPrice==0){
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
|
||||
} else {
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.youQuan.youPrice)*1).toFixed(2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+选择了孔雀币
|
||||
if(!this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
if(this.zanAllPrice - this.coin_price<=0){//孔雀币足以抵扣应付款
|
||||
this.ntype = 'coin'
|
||||
this.obtainCoin(this.allPrice*100);
|
||||
this.allPrice = 0;
|
||||
}
|
||||
if(this.zanAllPrice - this.coin_price>0){//孔雀币不足以抵扣应付款
|
||||
this.$toolAll.tools.showToast('孔雀币不足')
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+取消了孔雀币
|
||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.isKq = false;
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('暂无可用孔雀币');
|
||||
this.payFS[index].isActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.payFS[index].title=='积分') {
|
||||
|
||||
}
|
||||
},
|
||||
goPayment(){//去付款
|
||||
this.isFocus = false;
|
||||
this.isDui = false;
|
||||
let nphone = '';
|
||||
if(this.isExpress) {
|
||||
nphone = this.addressInfo.phone;//默认地址的手机号
|
||||
} else nphone = this.zPhone;//自提时的手机号
|
||||
let self = 0;//快递的配送方式
|
||||
if(!this.isExpress) self = 1;//自提的方式
|
||||
let nphone = this.zPhone; // 自提时的手机号
|
||||
if(this.isExpress) nphone = this.addressInfo.phone; // 默认地址的手机号
|
||||
let self = 1; // 自提的方式
|
||||
if(this.isExpress) self = 0; // 快递的配送方式
|
||||
let nsku_list = [];
|
||||
let is_only = 0;
|
||||
this.orderList.forEach(item=>{
|
||||
let obj = {
|
||||
sku_coding:item.coding,
|
||||
|
@ -431,32 +199,19 @@
|
|||
group_id:item.pin_user_id
|
||||
}
|
||||
nsku_list.push(obj);
|
||||
is_only = item.is_only;
|
||||
})
|
||||
let is_score = 0;
|
||||
if(this.isNei == 3) {is_score = 1}
|
||||
if(this.zf_kqPrice!=0) {
|
||||
this.jsPrice = `${this.allPrice} +${this.zf_kqPrice}孔雀币`;
|
||||
} else {
|
||||
this.jsPrice = this.allPrice;
|
||||
}
|
||||
let parmas = {
|
||||
sku_list: nsku_list,//商品单号和数量数组
|
||||
total: this.allPrice*100,//总金额
|
||||
address_id: this.addressInfo.id || 0,//地址ID
|
||||
express_code: this.expressInfo.code || 0,//快递编码
|
||||
coupon_id: this.youQuan.id,//优惠券ID
|
||||
coupon_price: this.youQuan.youPrice*100,//优惠券可用
|
||||
total: this.totalPrice,//总金额
|
||||
address_id: this.isExpress ? this.addressInfo.id : 0,//地址ID
|
||||
express_code: this.isExpress ? this.expressInfo.code : '',//快递编码
|
||||
pick_self: self,//是否自提0 快递, 1自提
|
||||
pick_self_phone: nphone,//联系电话
|
||||
original_total: this.zanAllPrice*100,//原价总金额
|
||||
freight: this.expressInfo.default_price || 0,//快递费
|
||||
remarks: "",//备注
|
||||
is_only:is_only,//是否是单独购买0 不是单独购买1,2是单独购买
|
||||
is_score:is_score,//是否是积分商品0 不是积分商品,1是积分商品
|
||||
coin:this.zf_kqPrice//孔雀币
|
||||
original_total: this.allPrice,//原价总金额
|
||||
freight: this.isExpress ? this.expressInfo.default_price : 0,//快递费
|
||||
discount:0
|
||||
}
|
||||
if(this.addressInfo=='' && self!=1){
|
||||
if(this.addressInfo=='' && self==1){
|
||||
this.$toolAll.tools.showToast('请完善收件人信息');
|
||||
} else if(nphone=='') {
|
||||
this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||
|
@ -464,14 +219,6 @@
|
|||
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
||||
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||
this.focusEv();
|
||||
} else if(this.isNei == 3 && !this.payFS[2].isActive){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请选择积分付款方式');
|
||||
} else if(this.isNei == 3 && this.expressInfo.default_price!=0 && this.expressInfo.default_price!=undefined && !this.payFS[0].isActive){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请添加微信支付方式');
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式')
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && this.allPrice*1 > this.coin_price*1){
|
||||
this.$toolAll.tools.showToast('孔雀币不足');
|
||||
} else {
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
|
@ -480,28 +227,16 @@
|
|||
} else {
|
||||
this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||
}
|
||||
uni.request({
|
||||
url:`${uni.getStorageSync('hostapi')}order/create`,
|
||||
data:parmas,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
this.times = 0;
|
||||
this.payment(res.data.data);
|
||||
// uni.setStorageSync('orderList',this.orderList);
|
||||
// uni.setStorageSync('orderInfo',res.data.data);
|
||||
// uni.navigateTo({
|
||||
// url:`/pagesA/immediatePayment/immediatePayment?allPrice=${this.allPrice}&allNum=${this.allNum}&startTime=${new Date(res.header.Date).getTime()}`
|
||||
// })
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.data.msg,'none',3000);
|
||||
this.times = 0;
|
||||
}
|
||||
this.$requst.post('/api/order/create',parmas).then(res=>{
|
||||
if(res.code==0){
|
||||
// 调取微信支付
|
||||
this.payment(res.data);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
this.times = 0;
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -517,46 +252,39 @@
|
|||
signType: info.payment_params.signType,//MD5
|
||||
paySign: info.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
|
||||
this.times = 0;
|
||||
// 支付成功通知
|
||||
this.$requst.post('/api/order/paid',{order_coding:info.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.suseeceEv(info.coding);
|
||||
this.$toolAll.tools.showToast('支付成功');
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder'
|
||||
})
|
||||
},2000)
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
fail:()=> {
|
||||
fail:(err)=> {
|
||||
this.$toolAll.tools.showToast('取消支付');
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder'
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
|
||||
// 支付成功通知
|
||||
this.$requst.post('/api/order/paid',{order_coding:info.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.suseeceEv(info.coding);
|
||||
this.$toolAll.tools.showToast('支付成功');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
}
|
||||
},
|
||||
suseeceEv(coding){
|
||||
uni.removeStorageSync('chooseAddress')
|
||||
this.isSuccess = true;
|
||||
if(this.orderList[0].cateNum==1 && this.orderList.pin_user_id!=0){
|
||||
this.isfen = true;
|
||||
this.$requst.post('order/get-group-id',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.checkGrounpId = res.data.group_id;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goThere(val){//去这里
|
||||
wx.getLocation({//获取当前经纬度
|
||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||
success: function (res) {
|
||||
wx.openLocation({//使用微信内置地图查看位置。
|
||||
latitude: 30.67554,//要去的纬度-地址
|
||||
longitude: 104.010642,//要去的经度-地址
|
||||
latitude: 30.657707,//要去的纬度-地址
|
||||
longitude: 104.036007,//要去的经度-地址,
|
||||
name: val,
|
||||
address: val
|
||||
})
|
||||
|
@ -564,9 +292,9 @@
|
|||
})
|
||||
},
|
||||
checkAddress(){//默认地址查询
|
||||
this.$requst.post('user/address').then(res=>{
|
||||
this.$requst.post('/api/user/address').then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.length){
|
||||
res.data.forEach(item=>{
|
||||
if(item.is_default==1) {
|
||||
this.addressInfo = item;
|
||||
|
@ -577,56 +305,36 @@
|
|||
}
|
||||
})
|
||||
this.userPphone = this.$toolAll.tools.hideMPhone(this.addressInfo.phone);
|
||||
} else {
|
||||
this.addressInfo = '';
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkexpress(){//查询快递费
|
||||
//查询快递费
|
||||
checkexpress(){
|
||||
if(this.isExpress) {
|
||||
this.$requst.post('common/express-list').then(res=>{
|
||||
this.$requst.post('/api/common/express-list').then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
if(item.is_default==1){
|
||||
this.expressInfo = item;
|
||||
this.expressInfo.default_price = this.expressInfo.default_price/100;
|
||||
}
|
||||
// 如果查询到有默认地址,赋值默认地址,没有默认地址就取地址列表第一位
|
||||
item.is_default==1 ? this.expressInfo = item : this.expressInfo = res.data[0];
|
||||
})
|
||||
this.totalEv();
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.totalEv();
|
||||
}
|
||||
},
|
||||
expressEv(index){//快递自取切换事件
|
||||
if(index==0) {
|
||||
this.isExpress = true;
|
||||
this.checkexpress();
|
||||
if(this.addressInfo==''){this.$toolAll.tools.showToast('请完善收件人信息','none',1500);}
|
||||
}
|
||||
if(index==1) {
|
||||
this.isExpress = false;
|
||||
this.expressInfo.default_price = 0;
|
||||
}
|
||||
},
|
||||
totalEv(){//合计运算
|
||||
if(this.isNei!=3 && this.isExpress && !this.payFS[1].isActive){//普通商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||
}
|
||||
if(this.isNei!=3 && !this.isExpress){//普通商品无运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||
}
|
||||
this.allPrice = parseInt(this.$toolAll.tools.addXiaoShu(this.allPrice));
|
||||
if(this.isNei ==3 && this.isExpress){//积分商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||
}
|
||||
if(this.isNei ==3 && !this.isExpress){//积分商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||
}
|
||||
this.loading = true;
|
||||
},
|
||||
checkOrderDetail(){//查询订单准备信息
|
||||
let nsku_list = [];
|
||||
this.orderList.forEach(item=>{
|
||||
|
@ -640,95 +348,14 @@
|
|||
sku_list: nsku_list,
|
||||
pick_self: 0
|
||||
}
|
||||
this.$requst.post('order/prepare-info',parmas).then(res=>{
|
||||
this.$requst.post('/api/order/prepare-info',parmas).then(res=>{
|
||||
if(res.code==0){
|
||||
this.payFS[1].num = res.data.account.coin;
|
||||
this.obtainCoin(res.data.account.coin);
|
||||
this.payFS[2].num = res.data.account.score;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
checkeList(isJfen){
|
||||
this.allPrice = this.allPrice*1;
|
||||
this.orderList.forEach(item=>{
|
||||
this.allPrice += item.price*item.num;
|
||||
this.allNum += item.num;
|
||||
})
|
||||
if(isJfen==3){
|
||||
this.zanAllPrice = this.allPrice;
|
||||
} else {
|
||||
this.zanAllPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
|
||||
}
|
||||
this.quanEv(0);//查询优惠券列表
|
||||
this.totalEv();
|
||||
},
|
||||
quanEv(index){//调起优惠券弹框事件
|
||||
if(this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('无法使用优惠券减免');
|
||||
// this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice*1 + this.expressInfo.default_price*1);
|
||||
} else {
|
||||
if(index==1){
|
||||
this.showQuan = true
|
||||
}
|
||||
this.youQuan.id = 0;
|
||||
this.youQuan.youPrice = 0;
|
||||
this.allPrice = (this.zanAllPrice*1 - this.expressInfo.default_price*1).toFixed(2);
|
||||
this.checkQuan();//查询可用优惠券事件
|
||||
}
|
||||
},
|
||||
checkQuan(){//查询可用优惠券事件
|
||||
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.quanList = [];
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
if(item.type!='taste'){//如果不等于体验券
|
||||
let obj = {
|
||||
id:item.id,
|
||||
youPrice:item.amount/100,
|
||||
manPrice:item.condition/100,
|
||||
isGrade:0,
|
||||
name:item.name,
|
||||
startTime:item.begin_at,
|
||||
endTime:item.end_at,
|
||||
isStatus:false
|
||||
}
|
||||
this.quanList.push(obj);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseQuan(index){//选择可用优惠券事件
|
||||
if(this.zanAllPrice <= this.quanList[index].manPrice){//如果满减大于合计
|
||||
this.$toolAll.tools.showToast('未达到使用条件')
|
||||
} else {
|
||||
if(this.allPrice==0){
|
||||
this.$toolAll.tools.showToast('此订单费用为 0');
|
||||
// this.$requst.post('user/get-coin-price',{amount:this.quanList[index].youPrice,get_type:'coin'}).then(res=>{
|
||||
// if(res.code==0){
|
||||
// this.zf_kqPrice = this.zf_kqPrice - res.data.amount;
|
||||
// this.showQuan = false;
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
this.quanList.forEach(item=>{
|
||||
item.isStatus = false;
|
||||
});
|
||||
this.quanList[index].isStatus = true;
|
||||
this.showQuan = false;
|
||||
this.quanList[index].youPrice = this.$toolAll.tools.addXiaoShu(this.quanList[index].youPrice);
|
||||
this.youQuan = this.quanList[index];
|
||||
this.allPrice = this.zanAllPrice*1 - this.quanList[index].youPrice*1 + this.expressInfo.default_price*1;//合计 = 暂存合计 - 选中的优惠券
|
||||
this.allPrice = this.allPrice.toFixed(2)*1;
|
||||
}
|
||||
}
|
||||
},
|
||||
goCoupon(){//去领取优惠券
|
||||
this.showQuan = false;
|
||||
goDetail(){//去订单列表
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/coupon/coupon'
|
||||
url:'/pagesA/myOrder/myOrder'
|
||||
})
|
||||
},
|
||||
focusEv(){//获取焦点
|
||||
|
@ -737,13 +364,6 @@
|
|||
blurEv(){//失去焦点
|
||||
this.isFocus = false;
|
||||
},
|
||||
goDetail(){//去订单列表
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder'
|
||||
})
|
||||
},
|
||||
goShop(){//逛一逛
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,29 +2,30 @@
|
|||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'地址管理'"></status-nav>
|
||||
<view :style="{paddingTop:statusHNH+'px'}" class="mar-sx20 pad-zy32" style="padding-bottom: 150rpx;">
|
||||
<view v-if="loading">
|
||||
<view @tap="goBack(index)" v-for="(item,index) in dataList" :key="index" class="bacf radius20 pad20 mar-x20">
|
||||
<view class="pad-y20 disjbac">
|
||||
<view class="fon28 col3 bold">{{item.userName}} {{item.userPhone}}</view>
|
||||
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
||||
</view>
|
||||
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
|
||||
<view class="disjbac fon28 col3 mar-s32">
|
||||
<view @tap.stop="setMo(index)" class="disac">
|
||||
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
||||
<image v-else src="/static/public/cancle-FS.png" class="address_active" mode=""></image>
|
||||
<view class="mar-z10" :class="item.isActive?'':'col9'">设为默认地址</view>
|
||||
<!-- 容器 -->
|
||||
<view class="pad-x140">
|
||||
<container-subgroup>
|
||||
<view v-if="loading">
|
||||
<view @tap="goBack(index)" v-for="(item,index) in dataList" :key="index" class="bacf6 radius20 pad30 mar-s30">
|
||||
<view class="pad-y20 disjbac">
|
||||
<view class="fon28 col3 bold">{{item.userName}} {{item.userPhone}}</view>
|
||||
</view>
|
||||
<view class="disac" style="color: #808080;">
|
||||
<view @tap.stop="editAddress(index)">编辑</view>
|
||||
<view @tap.stop="delAddress(index)" class="mar-y10 mar-z50">删除</view>
|
||||
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
|
||||
<view class="disjbac fon28 col3 mar-s32">
|
||||
<view @tap.stop="setMo(index)" class="disac">
|
||||
<i class="icon" :class="item.isActive ? 'icon-address-check' : 'icon-address-unchecked'" style="font-size: 36rpx;"></i>
|
||||
<view class="mar-z10" :class="item.isActive?'':'col0'">设为默认地址</view>
|
||||
</view>
|
||||
<view class="disac col0">
|
||||
<view @tap.stop="editAddress(index)">编辑</view>
|
||||
<view @tap.stop="delAddress(index)" class="mar-y10 mar-z50">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap.stop="obtainLngLat" class="posixzy address_add" :style="{backgroundColor:publicColor}" style="bottom: 20rpx;">新增地址</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="'暂无可用地址'"></nothing-page>
|
||||
</view>
|
||||
<view @tap.stop="obtainLngLat" class="posixzy address_add" :style="{backgroundColor:publicColor}" style="bottom: 20rpx;">添加地址</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="'暂无可用地址'"></nothing-page>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
<!-- 添加地址、修改地址 -->
|
||||
<view v-if="idEdit" @tap.stop="idEdit=false" class="posAll disjcac" style="padding: 0 46rpx;z-index: 3;">
|
||||
|
@ -110,11 +111,12 @@
|
|||
countyArr:[],
|
||||
isAddress:0,
|
||||
isWhere:1,
|
||||
isMo:0
|
||||
isMo:0,
|
||||
flag:true
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkList();
|
||||
|
@ -147,7 +149,7 @@
|
|||
header: {
|
||||
'Content-Type':'application/json'
|
||||
},
|
||||
success:function(res) {
|
||||
success:(res)=> {
|
||||
// console.log('地址数据:',res)
|
||||
ya.userProvince = res.data.result.address_component.province
|
||||
ya.userCity = res.data.result.address_component.city
|
||||
|
@ -214,10 +216,11 @@
|
|||
this.userCounty = this.countyArr[index].name;
|
||||
},
|
||||
async checkList(){//查询地址列表
|
||||
this.$requst.post('user/address').then(res=>{
|
||||
this.$requst.post('/api/user/address').then(res=>{
|
||||
if(res.code==0){
|
||||
this.flag = true;
|
||||
this.dataList = [];
|
||||
if(res.data.length!=0){
|
||||
if(res.data.length){
|
||||
res.data.forEach(item=>{
|
||||
let newActive = false;
|
||||
if(item.is_default==1) newActive = true
|
||||
|
@ -237,6 +240,8 @@
|
|||
this.dataList.push(obj);
|
||||
})
|
||||
this.checkActive();
|
||||
} else {
|
||||
uni.removeStorageSync('chooseAddress');
|
||||
}
|
||||
this.loading = true;
|
||||
}
|
||||
|
@ -249,7 +254,7 @@
|
|||
this.dataList.unshift(this.dataList[have]);
|
||||
this.dataList.splice(have+1,1);
|
||||
},
|
||||
async addAddress(){//新增编辑地址
|
||||
async addAddress(){//新增、编辑地址
|
||||
if(this.userName=='') {
|
||||
this.$toolAll.tools.showToast('请输入姓名');
|
||||
} else if(this.userPhone=='') {
|
||||
|
@ -271,20 +276,33 @@
|
|||
address:this.userAddress,
|
||||
is_default:this.isMo//是否默认
|
||||
}
|
||||
this.$requst.post('user/address-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.idEdit = false;
|
||||
if(this.isChoose!='') {
|
||||
this.$toolAll.tools.showToast('地址修改成功');
|
||||
if(this.flag){
|
||||
this.flag = false;
|
||||
this.$requst.post('/api/user/address-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.idEdit = false;
|
||||
if(this.isChoose!='') {
|
||||
this.$toolAll.tools.showToast('地址修改成功');
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('新增地址成功');
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.checkList();
|
||||
this.clearAll();
|
||||
},1000)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('新增地址成功');
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
setTimeout(()=>{
|
||||
this.flag = false;
|
||||
},3000)
|
||||
}
|
||||
}).catch(res=>{
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
setTimeout(()=>{
|
||||
this.checkList();
|
||||
this.clearAll();
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
this.flag = false;
|
||||
},3000)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
setMo(index){//设置默认地址
|
||||
|
@ -300,7 +318,7 @@
|
|||
address:this.dataList[index].address,
|
||||
is_default:1//是否默认
|
||||
}
|
||||
this.$requst.post('user/address-save',params).then(res=>{
|
||||
this.$requst.post('/api/user/address-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('设置默认地址成功');
|
||||
this.dataList.forEach(item=>{
|
||||
|
@ -331,14 +349,28 @@
|
|||
if(this.delNum==1) {
|
||||
this.$toolAll.tools.showToast('双击即可删除');
|
||||
}
|
||||
if(this.delNum==2) {
|
||||
this.$requst.post('user/address-del',{id:this.dataList[index].id}).then(res=>{
|
||||
if(this.delNum==2 && this.flag) {
|
||||
this.flag = false;
|
||||
this.$requst.post('/api/user/address-del',{id:this.dataList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('删除成功');
|
||||
if(uni.getStorageSync('chooseAddress').id==this.dataList[index].id) {
|
||||
uni.removeStorageSync('chooseAddress');
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.checkList();
|
||||
},1500)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
setTimeout(()=>{
|
||||
this.flag = true;
|
||||
},2000)
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
setTimeout(()=>{
|
||||
this.flag = true;
|
||||
},2000)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="pad-x20">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'我的订单'"></status-nav>
|
||||
<view :style="{paddingTop: statusBarHeight +'px'}">
|
||||
|
@ -8,31 +8,38 @@
|
|||
<swiper-tab id="tab" :list="navList" v-model="current" @input="clickTab" itemColor="#000000" lineColor="#000000"></swiper-tab>
|
||||
</view>
|
||||
<swiper :style="{ height: swiperHeight - statusBarHeight +'px'}" class="pad-zy30 fon30" :current="current" @change="swiperChange">
|
||||
<swiper-item v-for="item in navList.length" :key="index">
|
||||
<swiper-item v-for="(item,index) in navList.length" :key="index">
|
||||
<scroll-view scroll-y @scrolltolower="scrollBottomEv" style="height: 100%;">
|
||||
<!-- 列表数据 -->
|
||||
<view class="radius20 mar-s20" style="background-color: #f6f6f6;">
|
||||
<view @tap="goDetail" class="disjbac col0 pad30" style="border-bottom: 1rpx solid #d3d3d3;">
|
||||
<view>订单号:123412351234123</view>
|
||||
<view class="bold">{{['','待付款','待发货','待核验','待收货','交易完成'][1]}}</view>
|
||||
<view class="radius20 mar-s20 bacf6" v-for="(item1,index1) in orderList[index]" :key="index1">
|
||||
<view @tap="goDetail(item1.id)" class="disjbac col0 fon30 pad30" style="border-bottom: 1rpx solid #d3d3d3;">
|
||||
<view>订单号:{{item1.coding}}</view>
|
||||
<view class="" :style="{color: ['','#f83030','#f83030','#61cf00','#8c8c9b','#8c8c9b'][item1.status]}">{{['','待付款','待发货','待收货','已完成','已取消'][item1.status]}}</view>
|
||||
</view>
|
||||
<view class="fon26 col3 disjbac pad-sx50 mar-zy30 disjbac borbot posir">
|
||||
<image @tap="goDetail" src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
||||
<view @tap="goDetail" class="width100 disjb fc" style="height: 224rpx;">
|
||||
<view class="fon28 col3 bold clips2 line-h50">就阿斯蒂芬我就阿斯蒂芬我就阿斯蒂芬我就阿斯蒂芬我就阿斯蒂芬我</view>
|
||||
<view class="order-sy"><span>颜色:粉色</span><span>尺寸:12.2</span></view>
|
||||
<view class="colpeili disjbac"><span class="order-price">¥2,000</span><span class="fon24">x1</span></view>
|
||||
<view v-for="(item2,index2) in item1.skuList" :key="index2" class="fon26 col3 disjbac pad-sx50 mar-zy30 disjbac borbot posir">
|
||||
<image @tap="goDetail(item1.id)" :src="item2.sku_cover" class="flexs mar-y20 radius30" style="width: 224rpx;height: 224rpx;" mode="aspectFill"></image>
|
||||
<view @tap="goDetail(item1.id)" class="width100 disjb fc" style="height: 224rpx;">
|
||||
<view class="fon28 col3 bold clips2 line-h50">{{item2.spu_name}}</view>
|
||||
<view class="order-sy" v-if="item2.tag!=''"><span>颜色:粉色</span><span>尺寸:12.2</span></view>
|
||||
<view class="colpeili disjbac"><span class="order-price">¥{{item2.price}}</span><span class="fon24">x{{item2.num}}</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="colpeili pad30 disjbac" style="border-top: 1rpx solid #d3d3d3;">
|
||||
<view class="order-price">合计:2,000</view>
|
||||
<view class="order-price">合计:{{item1.totalPrice}}</view>
|
||||
<view class="disjbac">
|
||||
<view @tap="transferFrame(index)" class="order-btn">取消订单</view>
|
||||
<!-- 取消订单 -->
|
||||
<view @tap="transferFrame(index1)" v-if="item1.status==1 || item1.status==2" class="order-btn">取消订单</view>
|
||||
<!-- 立即支付 -->
|
||||
<view @tap="payMentEv(item1.coding)" v-if="item1.status==1" class="order-btn" style="background-color: #f83030;color: #FFFFFF;">立即支付</view>
|
||||
<!-- 确认收获 -->
|
||||
<view @tap="confirmReceipt(item1.id)" v-if="item1.status==3" class="order-btn" style="background-color: #000000;color: #FFFFFF;">确认收货</view>
|
||||
<!-- 再次购买 -->
|
||||
<view @tap="againBuy(index1)" v-if="item1.status==4 || item1.status==5" class="order-btn">再次购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 暂无更多数据 -->
|
||||
<pitera v-if="pitera"></pitera>
|
||||
<pitera v-if="total==orderList[current].length"></pitera>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
@ -65,12 +72,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr,
|
||||
swiperTab
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -78,7 +83,6 @@
|
|||
swiperHeight:uni.getSystemInfoSync().windowHeight,
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
chuTop:'',//导航高度
|
||||
activeIndex:'',
|
||||
navList:[{title:'全部'},{title:'待付款'},{title:'待发货'},{title:'待收货'},{title:'已完成'},{title:'已取消'}],
|
||||
// 取消订单原因
|
||||
reasonList:[
|
||||
|
@ -87,39 +91,29 @@
|
|||
{title:'其他原因',isActive:false},
|
||||
],
|
||||
isCancle:false,//是否取消订单
|
||||
orderList:[],
|
||||
orderList:[[],[],[],[],[],[]],
|
||||
zanList:[],//暂存列表数据
|
||||
page:1,
|
||||
size:10,
|
||||
size:200,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
tag:'',//默认全部 waiting=待付款 paid=已付款待发货 shipped=已发货 completed=已完成 check=待核验
|
||||
current:0,//选中的订单
|
||||
remarks:'',//原因
|
||||
times:0,//点击次数
|
||||
canvasQrPath: '',
|
||||
timer:null,
|
||||
zanArr:[],
|
||||
timeList:[],
|
||||
orderInfo:{},
|
||||
checkGrounpId:0,
|
||||
orderCoding:''//选中的订单编号
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let orderIndex = res.target.dataset.id;
|
||||
this.orderInfo = this.orderList[orderIndex];
|
||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderInfo.childrenList[0].spu_id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
c:this.orderInfo.childrenList[0].spu_id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
var shareObj = {
|
||||
title: `${ya.orderInfo.childrenList[0].title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=${ya.orderInfo.childrenList[0].spu_activity_id}&category_id=0&share_id=${ya.orderInfo.group_id}&invite_code=${uni.getStorageSync('invite_code')}&shareCate=1&checkGrounpId=${ya.orderInfo.childrenList[0].spu_activity_id}&is_activity=1`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.orderInfo.childrenList[0].imgSrc//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
||||
path: ``, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
|
@ -129,179 +123,115 @@
|
|||
this.swiperHeight = this.swiperHeight - rect[0].height
|
||||
});
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.orderList.length){
|
||||
this.page++
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
onUnload() {
|
||||
uni.removeStorageSync('isorderDetail')
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
if(uni.getStorageSync('isorderDetail')==1){
|
||||
// 调用查询事件
|
||||
this.checkList();
|
||||
}
|
||||
this.$toolAll.tools.overdue();
|
||||
},
|
||||
onLoad(options) {
|
||||
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
|
||||
options.index==undefined ? this.current = 0 : this.current = options.index;
|
||||
if(this.current==0){
|
||||
// 调用查询事件
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 触底事件
|
||||
scrollBottomEv(){
|
||||
if(this.total!=this.orderList[this.current].length){
|
||||
this.page++
|
||||
this.checkList();
|
||||
}
|
||||
},
|
||||
// 状态判断事件
|
||||
statejubEv(){
|
||||
if(this.current == 0) this.tag = "";
|
||||
if(this.current == 1) this.tag = "waiting";
|
||||
if(this.current == 2) this.tag = "paid";
|
||||
if(this.current == 3) this.tag = "shipped";
|
||||
if(this.current == 4) this.tag = "completed";
|
||||
if(this.current == 5) this.tag = "closed";
|
||||
// 调用查询我的订单列表事件
|
||||
this.checkList();
|
||||
},
|
||||
// tab点击事件
|
||||
clickTab(index){
|
||||
this.current = index
|
||||
this.current = index;
|
||||
this.statejubEv();
|
||||
},
|
||||
// 列表滑动事件
|
||||
swiperChange(e){
|
||||
this.current = e.detail.current
|
||||
this.current = e.detail.current;
|
||||
this.statejubEv();
|
||||
},
|
||||
checkList(index){//查询订单列表
|
||||
this.$requst.post('user/order',{page:this.page,size:this.size,tag:this.tag}).then(res=>{
|
||||
checkList(){//查询我的订单列表事件
|
||||
this.$requst.post('/api/user/order',{page:this.page,size:this.size,tag:this.tag}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) {
|
||||
uni.pageScrollTo({//回到顶部
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
this.orderList = [];
|
||||
this.zanArr = [];
|
||||
this.timeList = [];
|
||||
}
|
||||
if(this.page==1) this.orderList[this.current] = [];
|
||||
// 设置总数
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let statusNum = 0;
|
||||
if(item.status=="waiting") statusNum = 1;
|
||||
// if(item.status=="paid" && item.has_virtual==1) {
|
||||
// statusNum = 3;
|
||||
// }
|
||||
if(item.status=="paid") {
|
||||
statusNum = 2;
|
||||
}
|
||||
// if(item.status=="check")
|
||||
if(item.status=="shipped") statusNum = 4;
|
||||
if(item.status=="completed") statusNum = 5;
|
||||
let nprice = '';
|
||||
if(item.is_score==0) nprice = this.$toolAll.tools.addXiaoShu(item.price/100);
|
||||
if(item.is_score==1) nprice = item.score;
|
||||
let nchildren = [];
|
||||
item.skus.forEach(items=>{
|
||||
let childrenPrice = '';
|
||||
if(item.is_score==0) childrenPrice = items.price/100
|
||||
if(item.is_score==1) childrenPrice = items.score
|
||||
let objs = {
|
||||
id:items.id,
|
||||
imgSrc:this.$http + items.spu_cover,
|
||||
title:items.spu_name,
|
||||
sku_name:items.sku_name,
|
||||
price:childrenPrice,
|
||||
num:items.num,
|
||||
not_check_num:items.not_check_num,
|
||||
check_type:items.check_type,
|
||||
is_virtual:items.is_virtual,
|
||||
activity_type:items.activity_type,
|
||||
spu_id:items.spu_id,
|
||||
spu_activity_id:items.spu_activity_id
|
||||
}
|
||||
nchildren.push(objs);
|
||||
})
|
||||
if(item.status=="paid") statusNum = 2;
|
||||
if(item.status=="shipped") statusNum = 3;
|
||||
if(item.status=="completed") statusNum = 4;
|
||||
if(item.status=="closed") statusNum = 5;
|
||||
let obj = {
|
||||
id:item.id,
|
||||
establish:item.created_at,//创建时间
|
||||
orderNum:item.coding,//订单号
|
||||
childrenList:nchildren,
|
||||
orderStatus:statusNum,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
||||
isShop:item.is_score,//0 商城订单,1 积分商城订单
|
||||
total: nprice,//合计
|
||||
coin:item.coin,//孔雀币
|
||||
is_only:item.is_only,//是否单独购买,1、单独购买
|
||||
virtual_check:item.virtual_check,
|
||||
open_one:item.open_one,
|
||||
is_group_make:item.is_group_make,
|
||||
open_one_success:item.open_one_success,
|
||||
group_make_end_at:item.group_make_end_at,
|
||||
group_id:item.group_id
|
||||
skuList:item.skus,
|
||||
totalPrice:item.price,
|
||||
status:statusNum,
|
||||
coding:item.skus[0].coding
|
||||
}
|
||||
this.zanArr.push(obj);
|
||||
this.orderList[this.current].push(obj);
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.group_make_end_at!='' && item.group_make_end_at!=null) {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
time:item.group_make_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
uni.showToast({
|
||||
title:'加载中...',
|
||||
icon:'none',
|
||||
duration:100000
|
||||
})
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
let startTime = new Date().getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(startTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
// this.checkList(this.activeIndex);
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].group_make_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,startTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
uni.hideToast();
|
||||
this.orderList = this.zanArr;
|
||||
// this.search_result = true;
|
||||
},1000)
|
||||
} else {
|
||||
uni.hideToast();
|
||||
this.orderList = this.zanArr;
|
||||
}
|
||||
this.zanList = this.orderList;
|
||||
if(index==0) {
|
||||
this.orderList = this.zanList;
|
||||
} else if(index==3){
|
||||
} else {
|
||||
this.orderList = this.zanList.filter(item=>{
|
||||
return item.orderStatus==index;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
payMentEv(index){//付款
|
||||
this.$requst.post('order/pay',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
appId:res.data.payment_params.appId,//appId
|
||||
timeStamp: res.data.payment_params.timeStamp,//时间戳
|
||||
nonceStr: res.data.payment_params.nonceStr,//随机字符串
|
||||
package: res.data.payment_params.package,//package
|
||||
signType: res.data.payment_params.signType,//MD5
|
||||
paySign: res.data.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('order/paid',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('付款成功');
|
||||
this.checkList(this.activeIndex)
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
payMentEv(coding){//付款
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
this.$requst.post('/api/order/pay',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
appId:res.data.payment_params.appId,//appId
|
||||
timeStamp: res.data.payment_params.timeStamp,//时间戳
|
||||
nonceStr: res.data.payment_params.nonceStr,//随机字符串
|
||||
package: res.data.payment_params.package,//package
|
||||
signType: res.data.payment_params.signType,//MD5
|
||||
paySign: res.data.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('/api/order/paid',{order_coding:this.orderList[this.current][index].coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('付款成功');
|
||||
// 调用查询列表事件
|
||||
this.implementListEv();
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
|
||||
})
|
||||
},
|
||||
fail:()=> {
|
||||
this.$toolAll.tools.showToast('取消支付');
|
||||
// 调用查询列表事件
|
||||
this.implementListEv();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
transferFrame(index){//调起取消原因弹框
|
||||
this.isCancle = true;
|
||||
this.current = index;
|
||||
this.orderCoding = this.orderList[this.current][index].coding;
|
||||
this.reasonList.forEach(item=>{
|
||||
item.isActive = false;
|
||||
})
|
||||
|
@ -316,23 +246,22 @@
|
|||
if(this.times==0){
|
||||
this.times++;
|
||||
this.$toolAll.tools.showToast('正在取消...');
|
||||
this.$requst.post('order/cancel',{order_coding:this.orderList[this.current].orderNum,remarks:this.remarks}).then(res=>{
|
||||
this.$requst.post('/api/order/cancel',{order_coding:this.orderCoding,remarks:this.remarks}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.isCancle = false;
|
||||
this.orderList.splice(this.current,1);
|
||||
this.page = 1;
|
||||
this.checkList(this.activeIndex);
|
||||
this.$toolAll.tools.showToast('取消成功');
|
||||
this.times = 0;
|
||||
// 调用查询列表事件
|
||||
this.implementListEv();
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
}
|
||||
},
|
||||
confirmReceipt(id){//确认收货事件
|
||||
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
||||
this.$requst.post('/api/order/accepted',{order_id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('收货成功');
|
||||
this.checkList(this.activeIndex);
|
||||
// 调用查询列表事件
|
||||
this.implementListEv();
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
|
@ -340,7 +269,32 @@
|
|||
uni.navigateTo({
|
||||
url:`/pagesB/orderDetail/orderDetail?id=${id}`
|
||||
})
|
||||
}
|
||||
},
|
||||
// 执行查询列表事件
|
||||
implementListEv(){
|
||||
setTimeout(()=>{
|
||||
this.times = 0;
|
||||
this.page = 1;
|
||||
this.checkList();
|
||||
},2000)
|
||||
},
|
||||
// 再次购买事件
|
||||
againBuy(index){
|
||||
let newList = [];
|
||||
this.orderList[this.current][index].skuList.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.spu_id,//商品id
|
||||
imgSrc:item.spu_cover,//商品图片
|
||||
coding:item.coding,//商品coding
|
||||
price:item.price,//商品价格
|
||||
num:item.num,//商品数量
|
||||
title:item.spu_name,//商品名称
|
||||
}
|
||||
newList.push(obj);
|
||||
})
|
||||
uni.setStorageSync('orderList',newList);
|
||||
uni.navigateTo({url:'/pagesA/getReadyDan/getReadyDan'});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -358,13 +312,5 @@
|
|||
}
|
||||
|
||||
.order-price{color: #f83030;}
|
||||
.order-btn{
|
||||
width: 150rpx;height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
border-radius: 20rpx;
|
||||
background-color: #f6f6f6;
|
||||
color: #8c8c9b;
|
||||
border: 1rpx solid #d3d3d3;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('firstInfo')
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'关于我们'"></status-nav>
|
||||
<!-- 输入框 -->
|
||||
<view class="pad-zy30" :style="{paddingTop: statusBarHeight+'px'}">
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<!-- 地图 -->
|
||||
<view class="radius30" style="overflow: hidden;">
|
||||
<map :latitude="lat" :longitude="lng" :enable-scroll="enableScroll" :enable-zoom="enableZoom" style="height: 390rpx;width: 100%;"></map>
|
||||
<view class="radius30" style="overflow: hidden;border: 2rpx solid #8c8c9b;">
|
||||
<map :latitude="lat" :longitude="lng" :enable-scroll="enableScroll" :enable-zoom="enableZoom" scale="11" style="height: 390rpx;width: 100%;"></map>
|
||||
</view>
|
||||
<!-- 导航按钮 -->
|
||||
<view class="navigate-to-where mar-s30 radius30 bac0 colf fon36 tcenter">导航至佩丽</view>
|
||||
<view @tap="goThere" class="navigate-to-where mar-s30 radius30 bac0 colf fon36 tcenter">导航至佩丽</view>
|
||||
<!-- 关于佩丽 -->
|
||||
<view class="fon48 col0 mar-sx50">关于佩丽</view>
|
||||
<rich-text :nodes="richText"></rich-text>
|
||||
</view>
|
||||
<rich-text :nodes="richText" class="fon30 colpeili line-h50"></rich-text>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -30,14 +30,55 @@
|
|||
lng:100.211328,
|
||||
enableZoom:true,//是否支持缩放
|
||||
enableScroll:true,//是否支持拖动
|
||||
richText:''//富文本
|
||||
richText:'',//富文本
|
||||
address:'',//目的地
|
||||
flag:true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
// 调取关于我们信息事件
|
||||
this.checkAboutUs();
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 查询关于我们信息
|
||||
checkAboutUs(){
|
||||
this.$requst.post('/api/index/about').then(res=>{
|
||||
if(res.code==0){
|
||||
this.lat = res.data.lat;
|
||||
this.lng = res.data.lon;
|
||||
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
this.address = res.data.address;
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
goThere(){//去这里
|
||||
if(this.flag){
|
||||
this.flag = false;
|
||||
wx.getLocation({//获取当前经纬度
|
||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||
success: (res)=> {
|
||||
wx.openLocation({//使用微信内置地图查看位置。
|
||||
latitude: this.lat*1,//要去的纬度-地址
|
||||
longitude: this.lng*1,//要去的经度-地址
|
||||
name: this.address,
|
||||
address: this.address,
|
||||
fail:err=>{
|
||||
this.$toolAll.tools.showToast('地址信息错误');
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.flag = true;
|
||||
},2000)
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('请勿多次点击');
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,19 +2,21 @@
|
|||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'免责声明'"></status-nav>
|
||||
<view class="pad-zy30" :style="{paddingTop: statusBarHeight+'px'}">
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<rich-text :nodes="disclaimerRich" class="fon24 colpeili line-h46"></rich-text>
|
||||
<!-- 标题 -->
|
||||
<view class="fon30 col0 mar-sx30 tcenter">责任条款</view>
|
||||
<!-- <view class="fon30 col0 mar-sx30 tcenter">责任条款</view> -->
|
||||
<!-- 内容 -->
|
||||
<view class="fon24 colpeili line-h40">
|
||||
<!-- <view class="fon24 colpeili line-h40">
|
||||
<view>本网站所提供的信息,只供参考之用。</view>
|
||||
<view class="mar-sx30">本网站及其雇员一概毋须以任何方式就任何信息传递或传送的失误、不准确或错误对用户或任何其他人士负任何直接或间接的责任。</view>
|
||||
<view class="mar-sx30">在法律允许的范围内,本网站在此声明,不承担用户或任何人士就使用或未能使用本网站所提供的信息或任何链接或项目所引致的任何直接、间接、附带、从属、特殊、惩罚性或惩戒性的损害赔偿(包括但不限于收益、预期利润的损失或失去的业务、未实现预期的节省)。</view>
|
||||
<view class="mar-sx30">本网站所提供的信息,若在任何司法管辖地区供任何人士使用或分发给任何人士时会违反该司法管辖地区的法律或条例的规定或会导致本网站或其第三方代理人受限于该司法管辖地区内的任何监管规定时,则该等信息不宜在该司法管辖地区供该等任何人士使用或分发给该等任何人士。用户须自行保证不会受限于任何限制或禁止用户使用或分发本网站所提供信息的当地的规定。</view>
|
||||
<view class="mar-sx30">本网站图片,文字之类版权申明,因为网站可以由注册用户自行上传图片或文字,本网站无法鉴别所上传图片或文字的知识版权,如果侵犯,请及时通知我们,本网站将在第一时间及时删除。</view>
|
||||
<view class="mar-sx30">凡以任何方式登录本网站或直接、间接使用本网站资料者,视为自愿接受本网站声明的约束。</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -23,10 +25,26 @@
|
|||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
disclaimerRich:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 调取免责声明信息事件
|
||||
this.checkDisclaimerEv();
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 查询免责声明信息
|
||||
checkDisclaimerEv(){
|
||||
this.$requst.post('/api/index/statement').then(res=>{
|
||||
if(res.code==0){
|
||||
this.disclaimerRich = this.$toolAll.tools.escape2Html(res.data.content);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,127 +1,118 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="pad-x160">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'订单详情'"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
|
||||
<!-- 容器 -->
|
||||
<container-subgroup>
|
||||
<!-- 订单类型 -->
|
||||
<block v-if="loading">
|
||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||
<view class="bacf6 radius20 mar-s20 fon30 line-h50 pad30">
|
||||
<view class="disjbac">
|
||||
<view class="bold">{{['商城订单','积分商城订单'][orderInfo.is_score]}}</view>
|
||||
<view v-if="orderInfo.status=='waiting'" class="colf8 bold">待付款</view>
|
||||
<view v-if="orderInfo.status=='paid' && orderInfo.has_virtual!=1" class="colf8 bold">待发货</view>
|
||||
<view v-if="orderInfo.status=='shipped' && orderInfo.has_virtual!=1" class="colf8 bold">待收货</view>
|
||||
<view v-if="orderInfo.status=='completed'" class="col9 bold">已完成</view>
|
||||
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1" class="colf8 bold">待核验</view>
|
||||
<view v-if="orderInfo.virtual_check==1 && orderInfo.has_virtual==1" class="col9 bold">已核验</view>
|
||||
<view v-if="orderInfo.status=='closed'" class="col9 bold">订单已取消</view>
|
||||
<view>订单编号</view>
|
||||
<view class="bold">{{orderInfo.coding}}</view>
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view>下单时间</view>
|
||||
<view class="bold">{{orderInfo.created_at}}</view>
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view>订单状态</view>
|
||||
<view class="bold">
|
||||
<view v-if="orderInfo.status=='waiting'" class="colf8">待付款</view>
|
||||
<view v-if="orderInfo.status=='paid'" class="colf8">待发货</view>
|
||||
<view v-if="orderInfo.status=='shipped'" style="color: #61cf00;">待收货</view>
|
||||
<view v-if="orderInfo.status=='completed'" class="col0">已完成</view>
|
||||
<view v-if="orderInfo.status=='closed'" class="col9">已取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<view class="bacf6 radius20 mar-s20 orderDetail-box">
|
||||
<view v-for="(item,index) in orderInfo.skus" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||
<image :src="item.sku_cover" class="flexs" mode="aspectFill" style="width: 224rpx; height: 224rpx;"></image>
|
||||
<view class="width100 disjb fc" style="height: 224rpx;">
|
||||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||
<view class="orderDetail-sku" v-if="item.tag!=''">{{item.tag}}</view>
|
||||
<view class="mar-s10">
|
||||
<view class="colf8 fon32 bold disjbac width100"><span>¥{{item.price}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon28 disjbac mar-s40 mar-x20">
|
||||
<view class="col6">共{{allNum}}件</view>
|
||||
<view class="colf8 bold">共计:{{orderInfo.original_price}}</view>
|
||||
</view>
|
||||
<view class="bold col3 mar-s40 mar-x20">订单号:{{orderInfo.coding}}</view>
|
||||
<view class="fon24 col9" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 ">{{daoTime}}</view>
|
||||
<view class="fon24 col9" v-else>{{orderInfo.created_at}}</view>
|
||||
</view>
|
||||
<!-- 物流信息 -->
|
||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||
<view v-if="orderInfo.address!='自提'" class="bacf6 radius20 mar-s20 fon28 pad30">
|
||||
<view class="bold">物流信息</view>
|
||||
<view class="bold col3 mar-s40 fon26 disjbac">
|
||||
<view>{{orderInfo.express_name}}:{{orderInfo.express_number||'暂无快递单号'}}</view>
|
||||
<view @tap="copyCont">复制</view>
|
||||
<view v-if="orderInfo.express_number" @tap="copyCont">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址信息 -->
|
||||
<view v-if="orderInfo.address!='自提'" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||
<view v-if="orderInfo.address!='自提'" class="bacf6 radius20 mar-s20 pad30">
|
||||
<view class="bold">收件人信息</view>
|
||||
<view class="fon26 col3">
|
||||
<view class="fon28 col3 bold" style="margin: 52rpx 0 20rpx 0;">{{addressInfo.userName}}<span class="mar-z10">{{addressInfo.userPhone}}</span></view>
|
||||
<view class="fon24 col9">{{addressInfo.userAddress}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||
<view class="bold">商家地址信息</view>
|
||||
<view v-else class="bacf6 radius20 mar-s20 pad30">
|
||||
<view class="disjbac">
|
||||
<view>配送方式</view>
|
||||
<view>自提</view>
|
||||
</view>
|
||||
<view class="fon26 col3 disjbac mar-s30">
|
||||
<view>
|
||||
<view class="fon28 col3 bold mar-x20">恒美植发</view>
|
||||
<view class="fon28 col3 bold mar-x20">{{appletName}}</view>
|
||||
<view class="fon24 col9">{{goAddress}}</view>
|
||||
</view>
|
||||
<!-- 立即导航 -->
|
||||
<image @tap="goThere(goAddress)" src="/static/public/daoh.png" class="there" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<view class="bacf radius20 mar-s20 orderDetail-box">
|
||||
<view v-for="(item,index) in orderInfo.skus" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||
<image :src="item.spu_cover" class="flexs" mode="aspectFill"></image>
|
||||
<view class="width100">
|
||||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||
<view class="orderDetail-sku">{{item.sku_name}}</view>
|
||||
<view class="disjbac mar-s10">
|
||||
<view class="colf8 fon32 bold"><span v-if="orderInfo.is_score==0">¥{{item.price/100}}</span><span v-else>积分:{{item.score}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
||||
<view @tap.stop="make(index)" v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1 && item.check_type=='frontend'" class="order-btn">线下核销</view>
|
||||
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1 && item.check_type!='frontend'" class="order-btn" style="background-color: #CCCCCC;">线上核销</view>
|
||||
</view>
|
||||
<view @tap="goThere(goAddress)" class="disjcac fc col0 fon24">
|
||||
<i class="icon icon-navigate-now " style="font-size: 50rpx;"></i>
|
||||
<view>立即导航</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon28 disjbac mar-s40 mar-x20">
|
||||
<view class="col6">共{{allNum}}件</view>
|
||||
<view class="colf8 bold">共计:{{allPrice}}</view>
|
||||
</view>
|
||||
<!-- 金额详情 -->
|
||||
<view class="bacf6 radius20 mar-s20 fon30 col0 line-h60 pad30">
|
||||
<view class="disjbac">
|
||||
<view>商品总金额</view>
|
||||
<view class="colf8">¥{{orderInfo.original_price}}</view>
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view>折扣优惠</view>
|
||||
<view class="colf8">0</view>
|
||||
</view>
|
||||
<view class="disjbac" v-if="orderInfo.address!='自提'">
|
||||
<view>快递费用</view>
|
||||
<view class="colf8">{{orderInfo.freight}}</view>
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view class="width100" style="text-align: right;">实付:</view>
|
||||
<view class="colf8 flexs bold">¥{{orderInfo.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 快递费用 -->
|
||||
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">快递费用</view>
|
||||
<view class="fon28 colf8 bold">¥{{orderInfo.freight}}.00</view>
|
||||
</view>
|
||||
<!-- 消费 -->
|
||||
<view class="fon28 col3 consumption-box">消费:<span class="fon36 bold colf8"><span v-if="orderInfo.is_score==0">¥{{orderInfo.price/100}}</span><span v-else>{{orderInfo.score}}积分</span> <span v-if="orderInfo.coin!=0">+{{orderInfo.coin}}孔雀币</span></span></view>
|
||||
<view class="disjbac posixzy bacf orderDetail-bottom-box">
|
||||
<view class="posir">
|
||||
<image src="/static/public/weix.png" mode=""></image>
|
||||
<view class="fon28 col3">分享</view>
|
||||
<button open-type="share" class="posia-op"></button>
|
||||
</view>
|
||||
<view @tap="comeing(orderInfo.coding)" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 " class="orderInfo-btn">直接免拼</view>
|
||||
<!-- 待付款 -->
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='waiting'">
|
||||
<view @tap="cancleEv">取消订单</view>
|
||||
<view @tap="paymentEv">立即支付</view>
|
||||
</view>
|
||||
<!-- 待发货 -->
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='paid' && orderInfo.virtual_check==0">
|
||||
<view @tap="cancleEv">取消订单</view>
|
||||
</view>
|
||||
<!-- 确认收货 -->
|
||||
<view @tap="confirmReceipt(orderInfo.id)" class="orderInfo-btn" v-if="orderInfo.status=='shipped'">确认收货</view>
|
||||
</view>
|
||||
<!-- 待核验弹框 -->
|
||||
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;" catchtouchmove="return">
|
||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
||||
<view class="fon28 col3">订单二维码</view>
|
||||
<view class="mar-sx30">
|
||||
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||
<!-- <image src="/static/public/member-head.png" class="order-hx-img" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
<view class="fon24 col3">
|
||||
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
||||
<view>订单未完成前请勿出示二维码</view>
|
||||
</view>
|
||||
<image @tap.stop="closeEv" src="/static/public/closequan.png" class="posia heyan-close" mode=""></image>
|
||||
</view>
|
||||
<!-- 底部导航 -->
|
||||
<view class="posixzy disja fe bacf pad-sx20 pad-y40">
|
||||
<!-- 取消订单 -->
|
||||
<view @tap="cancleEv" v-if="orderInfo.status=='paid' || orderInfo.status=='waiting'" class="order-btn">取消订单</view>
|
||||
<!-- 立即支付 -->
|
||||
<view @tap="paymentEv" v-if="orderInfo.status=='waiting'" class="order-btn" style="background-color: #f83030;color: #FFFFFF;">立即支付</view>
|
||||
<!-- 确认收获 -->
|
||||
<view @tap="confirmReceipt(orderInfo.id)" v-if="orderInfo.status=='shipped'" class="order-btn" style="background-color: #000000;color: #FFFFFF;">确认收货</view>
|
||||
<!-- 再次购买 -->
|
||||
<view @tap="againBuy" v-if="orderInfo.status=='completed' || orderInfo.status=='closed'" class="order-btn" style="background-color: #f83030;color: #FFFFFF;">再次购买</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<!-- <empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower> -->
|
||||
<!-- 弹框 -->
|
||||
<!-- <auth-phone v-if="isShowP"></auth-phone> -->
|
||||
</container-subgroup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
|
@ -130,13 +121,14 @@
|
|||
isExpress:true,
|
||||
switchQuan:true,
|
||||
showQuan:false,
|
||||
express:'韵达快递:2983625984729',
|
||||
express:'',
|
||||
orderInfo:'',//订单信息
|
||||
addressInfo:'',//地址信息
|
||||
allPrice:0,//共计
|
||||
allNum:0,//共
|
||||
times:0,//点击次数
|
||||
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||
appletName:'佩丽饰品',
|
||||
goAddress:'四川省成都市青羊区草堂东路88号',
|
||||
isHeyan:false,
|
||||
canvasQrPath: '',
|
||||
text: 'hello',
|
||||
|
@ -146,74 +138,24 @@
|
|||
timer:null,
|
||||
daoTime:'',
|
||||
timerDao:null,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let maiOjb = {
|
||||
e:6,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: '成都恒美毛发', // 默认是小程序的名称(可以写slogan等)
|
||||
title: '', // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onUnload() {
|
||||
this.closeEv();
|
||||
uni.setStorageSync('isorderDetail',1);
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin();}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkInfo(options.id);
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
comeing(coding){
|
||||
this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('免拼成功');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmReceipt(id){//确认收货事件
|
||||
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
||||
this.$requst.post('/api/order/accepted',{order_id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('收货成功');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
|
@ -229,7 +171,7 @@
|
|||
not_check_num:this.orderInfo.skus[index].not_check_num
|
||||
}
|
||||
this.timer = setInterval(()=>{
|
||||
this.$requst.post('order/check-result',params).then(res=>{
|
||||
this.$requst.post('/api/order/check-result',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.result==1){
|
||||
this.isHeyan = false;
|
||||
|
@ -241,15 +183,10 @@
|
|||
})
|
||||
},3000)
|
||||
},
|
||||
closeEv(){
|
||||
this.isHeyan = false;
|
||||
clearInterval(this.timer);
|
||||
clearInterval(this.timerDao);
|
||||
},
|
||||
cancleEv(){//取消订单
|
||||
this.times++;
|
||||
if(this.times==2){
|
||||
this.$requst.post('order/cancel',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
this.$requst.post('/api/order/cancel',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('取消订单成功');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
|
@ -267,7 +204,7 @@
|
|||
if(this.times==0){
|
||||
this.$toolAll.tools.showToast('正在调起支付','loading',1500)
|
||||
this.times++;
|
||||
this.$requst.post('order/pay',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
this.$requst.post('/api/order/pay',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
|
@ -278,7 +215,7 @@
|
|||
signType: res.data.payment_params.signType,//MD5
|
||||
paySign: res.data.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
this.$requst.post('/api/order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.times = 0;
|
||||
this.$toolAll.tools.showToast('支付成功');
|
||||
|
@ -293,7 +230,7 @@
|
|||
}
|
||||
},
|
||||
checkInfo(id){//查询订单信息
|
||||
this.$requst.post('user/order-detail',{id:id}).then(res=>{
|
||||
this.$requst.post('/api/user/order-detail',{id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.allPrice = 0;
|
||||
this.allNum = 0;
|
||||
|
@ -308,23 +245,7 @@
|
|||
}
|
||||
this.allNum += item.num;
|
||||
})
|
||||
if(narr.is_score==0){//商城订单的总计
|
||||
this.allPrice = this.allPrice/100;
|
||||
} else {//积分订单的总计
|
||||
this.allPrice = this.allPrice;
|
||||
}
|
||||
this.orderInfo = narr;
|
||||
if(this.orderInfo.group_make_end_at!=null){
|
||||
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
|
||||
this.timerDao = setInterval(()=>{
|
||||
if(new Date().getTime()-new Date().getTime(this.orderInfo.group_make_end_at)>0){
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
clearInterval(this.timerDao)
|
||||
} else {
|
||||
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
let naddress = this.orderInfo.address.split(',');
|
||||
if(naddress[0]!='自提'){
|
||||
let nphone = this.$toolAll.tools.hideMPhone(naddress[1].trim())
|
||||
|
@ -338,6 +259,23 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
// 再次购买事件
|
||||
againBuy(){
|
||||
let newList = [];
|
||||
this.orderInfo.skus.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.spu_id,//商品id
|
||||
imgSrc:item.spu_cover,//商品图片
|
||||
coding:item.coding,//商品coding
|
||||
price:item.price,//商品价格
|
||||
num:item.num,//商品数量
|
||||
title:item.spu_name,//商品名称
|
||||
}
|
||||
newList.push(obj);
|
||||
})
|
||||
uni.setStorageSync('orderList',newList);
|
||||
uni.navigateTo({url:'/pagesA/getReadyDan/getReadyDan'});
|
||||
},
|
||||
copyCont(){//复制快递单号
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
|
@ -355,8 +293,8 @@
|
|||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||
success: function (res) {
|
||||
wx.openLocation({//使用微信内置地图查看位置。
|
||||
latitude: 30.67554,//要去的纬度-地址
|
||||
longitude: 104.010642,//要去的经度-地址
|
||||
latitude: 30.657707,//要去的纬度-地址
|
||||
longitude: 104.036007,//要去的经度-地址,
|
||||
name: val,
|
||||
address: val
|
||||
})
|
||||
|
@ -368,7 +306,5 @@
|
|||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="pad-x20">
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'搜索'"></status-nav>
|
||||
<!-- 输入框 -->
|
||||
<view class="search-input-box bacf" :style="{paddingTop: statusBarHeight+'px'}">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<view class="disac pad-zy30 mar-s20 pad-x20">
|
||||
<!-- 输入框 -->
|
||||
<input @confirm="searchEv" v-model="searchStr" placeholder="请输入关键词" class="width100 fon34 radius10" type="text"/>
|
||||
<!-- 搜索 -->
|
||||
|
@ -12,44 +12,36 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<!-- <view v-if="dataList.length!=0"> -->
|
||||
<list-two :scrollCate="1"></list-two>
|
||||
<!-- </view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 40%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">您搜索的内容暂无结果,换个关键词试试吧</view>
|
||||
</view> -->
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<!-- <empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower> -->
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="showAuthPhone"></auth-phone>
|
||||
<view class="disjbac fw pad-zy30">
|
||||
<view @tap="goDetail(item.id)" class="width47 mar-s50 posir" v-for="(item,index) in dataList" :key="index">
|
||||
<image :src="item.imgSrc" mode="aspectFill" style="width: 100%;height: 312rpx;border-radius: 30rpx;"></image>
|
||||
<view class="clips2 fon30 col0 linh50" style="height: 100rpx;">{{item.title}}</view>
|
||||
<view class="fon30 colpeili">¥{{item.price}}</view>
|
||||
<view v-if="item.isActivity" class="posia fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无更多 -->
|
||||
<pitera v-if="total==dataList.length"></pitera>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listTwo from '@/components/list/list-two.vue';
|
||||
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
|
||||
import pitera from '@/components/nothing/pitera.vue';
|
||||
export default {
|
||||
components:{
|
||||
listTwo
|
||||
pitera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
|
||||
searchStr:'',//输入框的值
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[//小课堂数据列表
|
||||
|
||||
],
|
||||
dataList:[],
|
||||
showTop:false,//是否显示返回顶部
|
||||
page:1, // 第几页
|
||||
size:10, // 数量
|
||||
total:0, // 总数
|
||||
pitera:false, // 是否显示暂无数据
|
||||
vision:false,
|
||||
showAuthPhone:false,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
|
@ -58,72 +50,63 @@
|
|||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.searchEv()//调用自主预约列表事件
|
||||
this.implementEv()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/searchPage/searchPage?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||
this.searchStr = options.keyWorld
|
||||
this.searchEv()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(this.searchStr!=undefined && this.searchStr!='') this.searchEv()
|
||||
this.searchStr = options.keyWorld;
|
||||
this.searchEv()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.showAuthPhone = true
|
||||
}
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
this.page = 1;
|
||||
// 调用搜索执行事件
|
||||
this.implementEv();
|
||||
},
|
||||
// 搜索执行事件
|
||||
implementEv(){
|
||||
this.$toolAll.tools.showToast('搜索中...')
|
||||
let params = {
|
||||
keyword:this.searchStr, //商品关键字 支持模糊搜索
|
||||
page:this.page, // 页数
|
||||
size: this.size, // 每页数量
|
||||
}
|
||||
this.$requst.post('/api/spu/list',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = [];
|
||||
// 设置商品总数
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc:item.cover,
|
||||
title:item.name,
|
||||
// price:this.$toolAll.tools.changeNum(item.price*1),
|
||||
price:item.price,
|
||||
isActivity:item.tag == '' ? false : true,
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
goDetail(id){//前往详情页
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -3,36 +3,40 @@
|
|||
<!-- 状态栏 -->
|
||||
<status-nav :navBarTitle="'商品详情'"></status-nav>
|
||||
<!-- 容器 -->
|
||||
<view class="pad-x140">
|
||||
<view class="pad-x140" style="background-color: #fafafa;">
|
||||
<container-subgroup>
|
||||
<view style="margin: 0 -30rpx;">
|
||||
<swiper-pu v-if="cateCurrent==0" :isplay="isAutoPlay" :browseP="true" :bannerList="bannerList" :newHeight="swiperHeight" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<view class="mar-s30 mar-x20 fon36 bold clips2 line-h50">New Farandole项链,小号New Farandole项链,小号New Farandole项链,小号New Farandole项链,小号</view>
|
||||
<view class="mar-s30 mar-x20 fon36 bold clips2 line-h50">{{detailObj.name}}</view>
|
||||
<!-- 描述 -->
|
||||
<view class="colpeili fon30 clips3 line-h50">于亿年宝藏中臻选1的宝石级钻石每年开采数亿克拉的钻石中 仅有1%的宝石级钻石才可作为...LOVE100 星座极光的原石挑选 </view>
|
||||
<view class="colpeili fon30 clips3 line-h50">{{detailObj.subtitle}}</view>
|
||||
<view class="disac mar-s20">
|
||||
<!-- 是否限时优惠 -->
|
||||
<view class="fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
<view v-if="detailObj.tag!=''" class="fon24 colf pad-zy10 pad-s10 pad-x20 activity-img">限时优惠</view>
|
||||
<!-- 价格 -->
|
||||
<view class="disac">
|
||||
<view class="fon40 bold col0 mar-y10">¥20,000</view>
|
||||
<view class="fon30 colpeili" style="text-decoration: line-through;">¥16,000</view>
|
||||
<view class="fon40 bold col0 mar-y10">¥{{discountPrice}}</view>
|
||||
<view class="fon30 colpeili" style="text-decoration: line-through;">¥{{originalPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 颜色 -->
|
||||
<view class="mar-s50"><drop-down></drop-down></view>
|
||||
<!-- 尺寸 -->
|
||||
<drop-down :dropObj="dropObj" @chooseItem="chooseItem"></drop-down>
|
||||
<!-- 作品介绍 -->
|
||||
<view class="mar-s100 mar-x30 fon36 bold col0 tcenter">作品介绍</view>
|
||||
<!-- 富文本 -->
|
||||
<rich-text :nodes="shopRich"></rich-text>
|
||||
<view style="background-color: #FFFFFF;margin: 0 -30rpx;">
|
||||
<!-- 作品介绍 -->
|
||||
<view class="mar-s100 mar-x30 fon36 bold col0 tcenter pad-s50">作品介绍</view>
|
||||
<!-- 富文本 -->
|
||||
<rich-text :nodes="shopRich"></rich-text>
|
||||
</view>
|
||||
</container-subgroup>
|
||||
</view>
|
||||
<!-- 底部导航 -->
|
||||
<bottom-nav></bottom-nav>
|
||||
<view v-if="shopDetail!=''">
|
||||
<bottom-nav :detailObj="shopDetail"></bottom-nav>
|
||||
</view>
|
||||
<!-- 全局客服 -->
|
||||
<public-customer
|
||||
:nbottom="180"
|
||||
|
@ -49,12 +53,15 @@
|
|||
import shopList from '@/components/shop-list.vue';
|
||||
import dropDown from '@/components/drop-downs/drop-down.vue';
|
||||
import bottomNav from '@/components/detail-bottom-nav/bottom-nav.vue';
|
||||
// 客服按钮组件
|
||||
import publicCustomer from '@/components/public-customer.vue';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
shopList,
|
||||
dropDown,
|
||||
bottomNav
|
||||
bottomNav,
|
||||
publicCustomer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -74,14 +81,12 @@
|
|||
]
|
||||
},
|
||||
shopRich:'',//商品富文本
|
||||
bannerList:[{
|
||||
imgSrc:'https://s6.jpg.cm/2022/02/14/L4oDhy.jpg',
|
||||
url:'',
|
||||
isVideo:false,
|
||||
poster:'',
|
||||
}],//轮播
|
||||
bannerList:[],//轮播
|
||||
originalPrice:0,//商品原价
|
||||
discountPrice:0,//商品折扣价
|
||||
detailObj:{},//详情
|
||||
skuDetail:{},//sku详情
|
||||
shopDetail:'',
|
||||
buyNum:1,//购买数量
|
||||
csNum:0,//点击次数,
|
||||
isAutoPlay:false,
|
||||
|
@ -90,7 +95,7 @@
|
|||
onShareAppMessage(res) {
|
||||
var shareObj = {
|
||||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
path: `/pagesB/shopDetail/shopDetail?id=`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
|
@ -106,31 +111,59 @@
|
|||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
// 查询订单详情
|
||||
this.checkDetail(options.id);
|
||||
},
|
||||
methods: {
|
||||
// 查询商品详情
|
||||
checkDetail(id){
|
||||
this.$requst.post('/api/spu/detail',{id}).then(res=>{
|
||||
if(res.code==0){
|
||||
// 设置商品详情
|
||||
this.detailObj = res.data.detail;
|
||||
this.shopDetail = res.data;
|
||||
|
||||
// 轮播
|
||||
// 图片字符串转数组
|
||||
let arrImg = this.detailObj.images.split(',')
|
||||
arrImg.forEach(item=>{
|
||||
let newImgObj = {
|
||||
imgSrc:item,
|
||||
url:'',
|
||||
isVideo:false,
|
||||
poster:'',
|
||||
}
|
||||
// 存图片
|
||||
this.bannerList.push(newImgObj)
|
||||
})
|
||||
// 存视频
|
||||
if(this.detailObj.video!=''){
|
||||
this.bannerList[0] = {
|
||||
imgSrc:arrImg[0],
|
||||
url:this.detailObj.video,
|
||||
isVideo:true,
|
||||
poster:'',
|
||||
}
|
||||
}
|
||||
// 原价金额转换
|
||||
// this.originalPrice = this.$toolAll.tools.changeNum(this.detailObj.original_price);
|
||||
this.originalPrice = this.detailObj.original_price;
|
||||
// 折扣价金额转换
|
||||
// this.discountPrice = this.$toolAll.tools.changeNum(this.detailObj.price);
|
||||
this.discountPrice = this.detailObj.price;
|
||||
// 设置富文本
|
||||
this.shopRich = this.$toolAll.tools.escape2Html(res.data.detail.content);
|
||||
} else {
|
||||
|
||||
}
|
||||
}).catch(err=>{
|
||||
this.$toolAll.tools.showToast(err.msg);
|
||||
})
|
||||
},
|
||||
// 尺寸选择事件
|
||||
chooseItem(e){
|
||||
this.log(e);
|
||||
},
|
||||
goGetReadyDan(index){//弹框中的立即购买
|
||||
// {id:1,imgSrc:'/static/tabbar/mya.png',title:'【99皮皮节】【种植发际线】',price:3888,num:1,isActive:false},
|
||||
let params = {
|
||||
id:this.detailObj.spu_id,
|
||||
imgSrc:this.$http + this.detailObj.cover,
|
||||
coding:this.skuDetail.coding,
|
||||
price:'',
|
||||
num:this.buyNum || 1,
|
||||
title:this.detailObj.name,
|
||||
sku_name:this.skuDetail.title,
|
||||
|
||||
}
|
||||
let newList = [params];
|
||||
uni.setStorageSync('orderList',newList);
|
||||
uni.navigateTo({
|
||||
url:`/pagesA/getReadyDan/getReadyDan?isNei=${this.isNei}&isVirtual=${this.detailObj.spu_type}`
|
||||
})
|
||||
},
|
||||
addCart(){//添加购物车事件
|
||||
if(this.csNum==0){
|
||||
this.csNum++;
|
||||
|
@ -144,12 +177,6 @@
|
|||
})
|
||||
}
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 997 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 12 KiB |