master
parent
f8c127a6cf
commit
0da5ee3496
18
App.vue
18
App.vue
|
@ -3,23 +3,27 @@
|
||||||
// import {checkSwip} from '@/jsFile/publicAPI.js'
|
// import {checkSwip} from '@/jsFile/publicAPI.js'
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
toolAll.tools.clearClog()//去除体验版和正式版的所有输出日志
|
toolAll.tools.clearClog();//去除体验版和正式版的所有输出日志
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
toolAll.tools.zhuColorT()
|
toolAll.tools.zhuColorT();
|
||||||
// uni.clearStorageSync()
|
// uni.clearStorageSync()
|
||||||
if(uni.getStorageSync('token')!='') {
|
if(uni.getStorageSync('token')!='') {
|
||||||
toolAll.tools.daoTime()
|
toolAll.tools.daoTime();
|
||||||
toolAll.tools.networkStatus()//检查当前网络状态
|
toolAll.tools.networkStatus();//检查当前网络状态
|
||||||
toolAll.tools.updaX()//检测版本更新
|
toolAll.tools.updaX();//检测版本更新
|
||||||
}
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
toolAll.tools.overdue()//查询是否第一次授权
|
toolAll.tools.overdue();//查询是否第一次授权
|
||||||
},3000)
|
},3000)
|
||||||
// checkSwip()//查询轮播图位置
|
// checkSwip()//查询轮播图位置
|
||||||
|
toolAll.tools.checkQuan();
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
toolAll.tools.closeTimer()//清空埋点倒计时
|
toolAll.tools.closeTimer();//清空埋点倒计时
|
||||||
|
uni.removeStorageSync('isQuan');
|
||||||
|
uni.removeStorageSync('quanImg');
|
||||||
|
uni.removeStorageSync('quanId');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
.tank-box-itemone{font-size: 32rpx;color: #343434;margin: 90rpx 0;}
|
.tank-box-itemone{font-size: 32rpx;color: #343434;margin: 90rpx 0;}
|
||||||
.tank-btn{width: 240rpx;}
|
.tank-btn{width: 240rpx;}
|
||||||
/* 我的页面 */
|
/* 我的页面 */
|
||||||
|
|
||||||
.icon-box>image:nth-child(1){width: 37rpx;height: 38rpx;}
|
.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(2){width: 32rpx;height: 34rpx;}
|
||||||
.icon-box>image:nth-child(3){width: 31rpx;height: 37rpx;}
|
.icon-box>image:nth-child(3){width: 31rpx;height: 37rpx;}
|
||||||
|
@ -44,6 +43,24 @@
|
||||||
.icon-box>image:nth-child(5){width: 33rpx;height: 35rpx;}
|
.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(6){width: 35rpx;height: 32rpx;}
|
||||||
.icon-box>image:nth-child(7){width: 36rpx;height: 35rpx;}
|
.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;}
|
.zanw-img{width: 474rpx;height: 273rpx;}
|
||||||
/* 修改资料页面 */
|
/* 修改资料页面 */
|
||||||
|
@ -137,7 +154,7 @@
|
||||||
.bottom-popu>view:first-child .width100 image{width: 24px;height: 24px;margin-top: -20rpx;}
|
.bottom-popu>view:first-child .width100 image{width: 24px;height: 24px;margin-top: -20rpx;}
|
||||||
.del-btn,.add-btn{width: 65rpx;height: 30px;}
|
.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;}
|
.num-input{width: 80rpx;height: 28px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||||
.ev-btn{width: 294rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 10rpx;}
|
.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{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{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(1){margin: 34rpx 0 27rpx 0;}
|
||||||
|
@ -148,6 +165,7 @@
|
||||||
.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 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;}
|
.pd-tk-box .posir>image{width: 77rpx;height: 77rpx;right: -30rpx;top: -30rpx;}
|
||||||
swiper-item view:last-child .duan-xian{border-bottom: none;}
|
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;}
|
||||||
/* 准备下单 */
|
/* 准备下单 */
|
||||||
.activeT,.expressT{width: 124rpx;height: 60rpx;line-height: 60rpx;text-align: center;margin-left: 20rpx;border-radius: 20rpx;}
|
.activeT,.expressT{width: 124rpx;height: 60rpx;line-height: 60rpx;text-align: center;margin-left: 20rpx;border-radius: 20rpx;}
|
||||||
.activeT{color: #FFFFFF;}
|
.activeT{color: #FFFFFF;}
|
||||||
|
@ -166,6 +184,13 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
||||||
.quan-list-box{max-height: 600rpx;}
|
.quan-list-box{max-height: 600rpx;}
|
||||||
.quan-list-box .mar-x40:last-child{margin-bottom: 0rpx;}
|
.quan-list-box .mar-x40:last-child{margin-bottom: 0rpx;}
|
||||||
.ling-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-top: 156rpx;margin-bottom: 20rpx;}
|
.ling-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-top: 156rpx;margin-bottom: 20rpx;}
|
||||||
|
.zhun-dui-box{display: flex;justify-content: center;align-items: center;padding: 0 85rpx;}
|
||||||
|
.zhun-dui-btn view{width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 28rpx;font-weight: 500;border-radius: 10rpx;color: #FFFFFF;}
|
||||||
|
.zhun-dui-btn view:first-child{background: #C8C8C8;}
|
||||||
|
.zhun-dui-btn view:last-child{background: #3875F6;}
|
||||||
|
.success-box{padding: 27rpx 20rpx;text-align: center;}
|
||||||
|
.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%;}
|
.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;}
|
.dao-box{padding: 55rpx 0 64rpx 0;text-align: center;}
|
||||||
|
@ -179,7 +204,7 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
||||||
.cart-input-box{border-radius: 4rpx;overflow: hidden;}
|
.cart-input-box{border-radius: 4rpx;overflow: hidden;}
|
||||||
.cart-input-box image{width: 46rpx;height: 26px;}
|
.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;}
|
.cart-input-box input{width: 60rpx;height: 24px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||||
.goBuy-btn{width: 170rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;}
|
.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{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%;}
|
.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;}
|
.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;}
|
||||||
|
@ -206,15 +231,89 @@ swiper-item view:last-child .duan-xian{border-bottom: none;}
|
||||||
.quan-use{width: 94rpx;height: 94rpx;right: 20rpx;top: 20rpx;}
|
.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-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;}
|
.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;}
|
||||||
|
.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;}
|
||||||
|
.paid-btn-box view:first-child{background: #E9E9E9;color: #808080;}
|
||||||
|
.paid-btn-box view:last-child{background: #3875F6;color: #FFFFFF;margin-left: 20rpx;}
|
||||||
|
.consumption-box{margin: 40rpx 0 40rpx 0;text-align: right;}
|
||||||
|
.orderDetail-box{padding: 0rpx 20rpx 27rpx 20rpx;}
|
||||||
|
.orderDetail-box image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
|
||||||
|
.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);}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (height:812px){
|
||||||
|
.blue-img{height: 500rpx;}
|
||||||
|
}
|
||||||
|
@media screen and (height:844px){
|
||||||
|
.blue-img{height: 496rpx;}
|
||||||
|
}
|
||||||
|
@media screen and (height:896px){
|
||||||
|
.blue-img{height: 486rpx;}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bottoc{margin-top: 6rpx;color: #414141;}
|
.bottoc{margin-top: 6rpx;color: #414141;}
|
||||||
.opc{opacity: 0.7;}
|
.opc{opacity: 0.7;}
|
||||||
.width100{width: 100%;}
|
.width100{width: 100%;}
|
||||||
.width33{width: 33%;}
|
|
||||||
.width45{width: 45%;}
|
|
||||||
.width50{width: 50%;}
|
|
||||||
.width55{width: 55%;}
|
.width55{width: 55%;}
|
||||||
|
.width50{width: 50%;}
|
||||||
|
.width48{width: 48%;}
|
||||||
|
.width45{width: 45%;}
|
||||||
|
.width33{width: 33%;}
|
||||||
|
.width25{width: 25%;}
|
||||||
|
|
||||||
.posAll{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.45);z-index: 12;}
|
.posAll{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.45);z-index: 12;}
|
||||||
.posir{position: relative;}
|
.posir{position: relative;}
|
||||||
|
@ -277,6 +376,7 @@ button:after{content: none!important;}
|
||||||
.colb{color: #000000;}
|
.colb{color: #000000;}
|
||||||
.colc{color: #CCCCCC;}
|
.colc{color: #CCCCCC;}
|
||||||
.col3{color: #333333;}
|
.col3{color: #333333;}
|
||||||
|
.col34{color: #343434;}
|
||||||
.col6{color: #666666;}
|
.col6{color: #666666;}
|
||||||
.colf8{color: #F85050;}
|
.colf8{color: #F85050;}
|
||||||
.col9{color: #999999;}
|
.col9{color: #999999;}
|
||||||
|
@ -285,12 +385,18 @@ button:after{content: none!important;}
|
||||||
.col80{color: #808080;}
|
.col80{color: #808080;}
|
||||||
.col7D{color: #7D7D7D;}
|
.col7D{color: #7D7D7D;}
|
||||||
.colB3{color: #B3B3B3;}
|
.colB3{color: #B3B3B3;}
|
||||||
|
.col5b{color: #5B5B5B;}
|
||||||
/* 字体位置 */
|
/* 字体位置 */
|
||||||
.tc{text-align: center;}
|
.tc{text-align: center;}
|
||||||
.tright{text-align: right;}
|
.tright{text-align: right;}
|
||||||
|
|
||||||
|
/* 行间距 */
|
||||||
|
.linh40{line-height: 40rpx;}
|
||||||
|
|
||||||
/* 粗体 */
|
/* 粗体 */
|
||||||
.bold{font-weight: bold;}
|
.bold{font-weight: bold;}
|
||||||
|
.font5{font-weight: 500;}
|
||||||
|
.font4{font-weight: 400;}
|
||||||
|
|
||||||
|
|
||||||
/* 背景颜色 */
|
/* 背景颜色 */
|
||||||
|
@ -298,6 +404,7 @@ button:after{content: none!important;}
|
||||||
.bacf{background-color: #FFFFFF;}
|
.bacf{background-color: #FFFFFF;}
|
||||||
.bcdb{background-color: #DBDBDB;}
|
.bcdb{background-color: #DBDBDB;}
|
||||||
.bcf8{background: #F85050;}
|
.bcf8{background: #F85050;}
|
||||||
|
.bacf5{background: #F5F5F5;}
|
||||||
|
|
||||||
/* 圆角 */
|
/* 圆角 */
|
||||||
.radius10{border-radius: 10rpx;}
|
.radius10{border-radius: 10rpx;}
|
||||||
|
@ -335,6 +442,7 @@ button:after{content: none!important;}
|
||||||
.mar-zy36{margin-left: 36rpx;margin-right: 36rpx;}
|
.mar-zy36{margin-left: 36rpx;margin-right: 36rpx;}
|
||||||
.mar-zy40{margin-left: 40rpx;margin-right: 40rpx;}
|
.mar-zy40{margin-left: 40rpx;margin-right: 40rpx;}
|
||||||
.mar-zy50{margin-left: 50rpx;margin-right: 50rpx;}
|
.mar-zy50{margin-left: 50rpx;margin-right: 50rpx;}
|
||||||
|
.mar-zy85{margin-left: 85rpx;margin-right: 85rpx;}
|
||||||
/* 上---外边距 */
|
/* 上---外边距 */
|
||||||
.mar-s10{margin-top: 10rpx;}
|
.mar-s10{margin-top: 10rpx;}
|
||||||
.mar-s20{margin-top: 20rpx;}
|
.mar-s20{margin-top: 20rpx;}
|
||||||
|
@ -417,6 +525,7 @@ button:after{content: none!important;}
|
||||||
.pad-x36{padding-bottom: 36rpx;}
|
.pad-x36{padding-bottom: 36rpx;}
|
||||||
.pad-x40{padding-bottom: 40rpx;}
|
.pad-x40{padding-bottom: 40rpx;}
|
||||||
.pad-x50{padding-bottom: 50rpx;}
|
.pad-x50{padding-bottom: 50rpx;}
|
||||||
|
.pad-x160{padding-bottom: 160rpx;}
|
||||||
.pad-x180{padding-bottom: 180rpx;}
|
.pad-x180{padding-bottom: 180rpx;}
|
||||||
.pad-x260{padding-bottom: 260rpx;}
|
.pad-x260{padding-bottom: 260rpx;}
|
||||||
/* 左---内边距 */
|
/* 左---内边距 */
|
||||||
|
|
|
@ -116,6 +116,7 @@
|
||||||
if(!this.jieDuan){
|
if(!this.jieDuan){
|
||||||
let isAuth = this.$toolAll.tools.returnAuth()
|
let isAuth = this.$toolAll.tools.returnAuth()
|
||||||
if(!isAuth){
|
if(!isAuth){
|
||||||
|
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||||
// uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'})
|
// uni.navigateTo({url:'/pages/tabbar/pagehome/pagehome'})
|
||||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
lianK(){
|
lianK(){
|
||||||
|
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||||
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
|
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
|
||||||
let maiOjb = {
|
let maiOjb = {
|
||||||
|
|
|
@ -0,0 +1,125 @@
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
<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>
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="pad20 shop_list_box">
|
<view class="pad20 shop_list_box">
|
||||||
<view style="width: 48.6%;float: left;">
|
<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" @tap="goPage(item1.id,index1)">
|
<view v-if="index1%2==0" v-for="(item1,index1) in newList" :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>
|
<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="pad-zy20 pad-s10 pad-x30">
|
||||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||||
<view class="radius10 colf" style="padding: 6rpx 10rpx;margin-right: 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
<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.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.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||||
|
@ -34,19 +34,20 @@
|
||||||
<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>
|
<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>
|
</view>
|
||||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:15小时00分00秒</view>
|
<view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 48.6%;float: right;">
|
<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" @tap="goPage(item1.id,index1)">
|
<view v-if="index1%2!=0" v-for="(item1,index1) in newList" :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>
|
<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="pad-zy20 pad-s10 pad-x30">
|
||||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||||
<view class="radius10 colf" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
<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;margin-left: 10rpx;">团购</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;margin-left: 10rpx;">拼团活动</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>
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||||
|
@ -71,7 +72,7 @@
|
||||||
<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>
|
<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>
|
</view>
|
||||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:15小时00分00秒</view>
|
<view v-if="item1.isXian || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -100,24 +101,62 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
iswhere:{
|
||||||
|
type:Number,
|
||||||
|
default:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
publicColor:uni.getStorageSync('publicColor'),
|
publicColor:uni.getStorageSync('publicColor'),
|
||||||
|
newList:[],
|
||||||
|
timeList:[],//时间列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
if(this.dataList.length!=0){
|
||||||
|
this.dataList.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);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$toolAll.tools.showToast('加载中...','none',1000);
|
||||||
|
if(this.timeList!=0){
|
||||||
|
let timer = setInterval(()=>{//定时器
|
||||||
|
if(this.timeList.length!=0){
|
||||||
|
this.timeList.forEach((item,index)=>{
|
||||||
|
if(item.id==this.dataList[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.dataList[item.nIndex].activity_end_at = "活动已结束";
|
||||||
|
} else {
|
||||||
|
// 继续进行倒计时
|
||||||
|
this.dataList[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},1000)
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.newList = this.dataList;
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
goPage(id,index){//进入商品详情事件
|
goPage(id,index){//进入商品详情事件
|
||||||
let isText = '';
|
|
||||||
if(this.dataList[index].isTuan) isText = "团购"
|
|
||||||
if(this.dataList[index].isPing) isText = "拼团"
|
|
||||||
if(this.dataList[index].isXian) isText = "限时"
|
|
||||||
if(this.dataList[index].integral) isText = "积分"
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isText=${isText}`
|
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
## 功能描述
|
||||||
|
根据内容生成二维码,并返回图片地址
|
||||||
|
|
||||||
|
## 平台兼容性
|
||||||
|
兼容APP、H5及微信小程序。其他平台未测试
|
||||||
|
|
||||||
|
## 安装方式
|
||||||
|
安装到components文件夹,支持[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)组件模式。
|
||||||
|
|
||||||
|
## 使用方式
|
||||||
|
**<font color=#FF0000 >可根据属性自定义二维码</font>**
|
||||||
|
``` javascript
|
||||||
|
<yz-qr></yz-qr>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 属性说明
|
||||||
|
|属性名 |类型 |默认值 |说明 |
|
||||||
|
|-- |-- |-- |-- |
|
||||||
|
|text |String |'hello' |二维码内容 |
|
||||||
|
|size |Number |340 |单位是px |
|
||||||
|
|colorDark |String |'#000000' |黑色二维码 |
|
||||||
|
|colorLight |String |'#ffffff' |白色背景 |
|
||||||
|
|
||||||
|
## 示例代码
|
||||||
|
``` javascript
|
||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<!-- 通过 ref 为子组件赋予一个 ID 引用,访问子组件实例 -->
|
||||||
|
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||||
|
|
||||||
|
<view class="text">
|
||||||
|
二维码内容:<text>{{text}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
图片地址:<text>{{canvasQrPath}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
canvasQrPath: '',
|
||||||
|
text: 'hello',
|
||||||
|
size: 200,
|
||||||
|
colorDark: '#ff0000',
|
||||||
|
colorLight: '#ffffff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getQrPath()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getQrPath() {
|
||||||
|
var that = this;
|
||||||
|
setTimeout(function() {
|
||||||
|
that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
|
||||||
|
console.log('获取二维码地址:', that.canvasQrPath)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.text {
|
||||||
|
background-color: #f3f3f3;
|
||||||
|
margin: 24rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text text {
|
||||||
|
font-weight: 700;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
## <font color=#FF0000 >canvas踩坑</font>
|
||||||
|
1. uni-app中的canvas的width、height的值依赖于父元素的宽高。canvas的父级如果被隐藏。canvas的width、height则都为0。
|
||||||
|
2. 当父元素出现,canvas的高度也就有了。但是canvas并不会绘制显示。解决方法:可以将绘制方法写在异步方法中,同时要注意组件的生命周期,确保实例挂载成功之后再执行。
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,81 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="qrcode">
|
||||||
|
<canvas :style="{width:size+ 'px', height:size+ 'px', background:bgc}" canvas-id="couponQrcode"></canvas>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const qrCode = require('./weapp-qrcode.js')
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bgc: 'rgba(200, 200, 200, 0.1)', //测试画布是否与内容相同大小
|
||||||
|
canvasQrPath: '', //
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
text: {
|
||||||
|
type: String,
|
||||||
|
default: 'hello'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: 340
|
||||||
|
},
|
||||||
|
colorDark: {
|
||||||
|
type: String,
|
||||||
|
default: '#000000'
|
||||||
|
},
|
||||||
|
colorLight: {
|
||||||
|
type: String,
|
||||||
|
default: '#ffffff'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 在实例创建完成后被立即调用
|
||||||
|
created() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.couponQrCode()
|
||||||
|
}, 50)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 二维码生成工具
|
||||||
|
couponQrCode() {
|
||||||
|
var that = this;
|
||||||
|
new qrCode('couponQrcode', {
|
||||||
|
text: this.text,
|
||||||
|
width: this.size,
|
||||||
|
height: this.size,
|
||||||
|
showLoading: true, // 是否显示loading
|
||||||
|
loadingText: '二维码生成中', // loading文字
|
||||||
|
colorDark: this.colorDark, //二维码暗部颜色
|
||||||
|
colorLight: this.colorLight, //二维码亮部颜色
|
||||||
|
correctLevel: qrCode.CorrectLevel.H, //二维码质量L/M/Q/H
|
||||||
|
usingIn: this //在自定义组件下,第二个参数传入组件实例this
|
||||||
|
})
|
||||||
|
// 把当前画布指定区域的内容导出生成图片,并返回文件路径。
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'couponQrcode',
|
||||||
|
success: function(res) {
|
||||||
|
// 在H5平台下,tempFilePath 为 base64
|
||||||
|
console.log('yz-qr图片路径:',res.tempFilePath)
|
||||||
|
that.canvasQrPath = res.tempFilePath
|
||||||
|
}
|
||||||
|
}, this)
|
||||||
|
this.$emit('update:canvasQrPath', that.canvasQrPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.qrcode {
|
||||||
|
padding: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -91,4 +91,17 @@ export function checkSwip(){//查询主题色
|
||||||
export function checkBanner(data){//查询主题色
|
export function checkBanner(data){//查询主题色
|
||||||
return requst.post('common/slides',data)
|
return requst.post('common/slides',data)
|
||||||
}
|
}
|
||||||
|
export function checkQuan(){//查询优惠券
|
||||||
|
return requst.post('user/home-coupon').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.has_coupon==1){
|
||||||
|
uni.setStorageSync('isQuan',true);
|
||||||
|
uni.setStorageSync('quanImg','https://oss.hmzfyy.cn' + res.data.home_coupon.cover);
|
||||||
|
uni.setStorageSync('quanId',res.data.home_coupon.id);
|
||||||
|
} else {
|
||||||
|
uni.setStorageSync('isQuan',false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,8 @@ const request = (method, url, options) => {
|
||||||
fail: e => {
|
fail: e => {
|
||||||
checkError(e, reject)
|
checkError(e, reject)
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: rest => {
|
||||||
|
// console.log(rest);
|
||||||
!hideLoading && uni.hideToast()
|
!hideLoading && uni.hideToast()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {buriedPoint,reportBuriedPoint,zhuColor} from './publicAPI.js';
|
import {buriedPoint,reportBuriedPoint,zhuColor,checkQuan} from './publicAPI.js';
|
||||||
const tools = {
|
const tools = {
|
||||||
timer:'',
|
timer:'',
|
||||||
timerNot:'',
|
timerNot:'',
|
||||||
|
@ -16,7 +16,7 @@ const tools = {
|
||||||
uni.removeStorageSync('daoTime')//清空倒计时
|
uni.removeStorageSync('daoTime')//清空倒计时
|
||||||
clearInterval(this.timer)//关闭倒计时
|
clearInterval(this.timer)//关闭倒计时
|
||||||
// console.log('上/报,埋点');
|
// console.log('上/报,埋点');
|
||||||
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
// reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
||||||
uni.removeStorageSync('maiList')//清空上报参数
|
uni.removeStorageSync('maiList')//清空上报参数
|
||||||
this.daoTime()//重新倒计时
|
this.daoTime()//重新倒计时
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ const tools = {
|
||||||
uni.removeStorageSync('daoTime')//清空倒计时
|
uni.removeStorageSync('daoTime')//清空倒计时
|
||||||
clearInterval(this.timer)//关闭倒计时
|
clearInterval(this.timer)//关闭倒计时
|
||||||
// console.log('上报,埋点');
|
// console.log('上报,埋点');
|
||||||
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
// reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
||||||
uni.removeStorageSync('maiList')//清空上报参数
|
uni.removeStorageSync('maiList')//清空上报参数
|
||||||
this.daoTime()//重新倒计时
|
this.daoTime()//重新倒计时
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ const tools = {
|
||||||
zhuColorT(){//调用主色调
|
zhuColorT(){//调用主色调
|
||||||
zhuColor()
|
zhuColor()
|
||||||
},
|
},
|
||||||
|
// 查券
|
||||||
|
checkQuan(){
|
||||||
|
checkQuan();
|
||||||
|
},
|
||||||
networkStatus(){//检查网络状态
|
networkStatus(){//检查网络状态
|
||||||
uni.getNetworkType({
|
uni.getNetworkType({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
@ -338,7 +342,40 @@ const tools = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
dayTime(endTime,startTime=''){//开启倒计时
|
||||||
|
let totalSecond = '';
|
||||||
|
// 本地倒计时
|
||||||
|
// if(startTime=='') totalSecond = Math.floor((new Date(endTime).getTime() - new Date().getTime())/1000);
|
||||||
|
// 服务器倒计时
|
||||||
|
if(startTime!='') totalSecond = Math.floor((new Date(endTime).getTime() - startTime)/1000);
|
||||||
|
// 总秒数
|
||||||
|
let second = totalSecond;
|
||||||
|
// 天数
|
||||||
|
let day = Math.floor(second / 3600 / 24);
|
||||||
|
let dayStr = day.toString();
|
||||||
|
if(dayStr.length == 1) dayStr = '0' + dayStr;
|
||||||
|
// 小时
|
||||||
|
let hr = Math.floor((second - day * 3600 * 24) / 3600);
|
||||||
|
let hrStr = hr.toString();
|
||||||
|
if(hrStr.length == 1) hrStr = '0' + hrStr;
|
||||||
|
// 分钟
|
||||||
|
let min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
|
||||||
|
let minStr = min.toString();
|
||||||
|
if(minStr.length == 1) minStr = '0' + minStr;
|
||||||
|
// 秒
|
||||||
|
let sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
|
||||||
|
let secStr = sec.toString();
|
||||||
|
if(secStr.length == 1) secStr = '0' + secStr;
|
||||||
|
|
||||||
|
let newTime = '';
|
||||||
|
if(dayStr==0) {
|
||||||
|
newTime = hrStr +'时'+ minStr +'分'+ secStr +'秒';
|
||||||
|
} else {
|
||||||
|
newTime = dayStr +'天'+ hrStr +'时'+ minStr +'分'+ secStr +'秒';
|
||||||
}
|
}
|
||||||
|
return newTime;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
22
pages.json
22
pages.json
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
{
|
||||||
"path" : "pages/tabbar/my/staffDuan",
|
"path" : "pages/tabbar/pagehome/pagehome",
|
||||||
"style" :{}
|
"style" :{}
|
||||||
},{
|
},{
|
||||||
"path" : "pages/tabbar/pagehome/pagehome",
|
"path" : "pages/tabbar/my/staffDuan",
|
||||||
"style" :{}
|
"style" :{}
|
||||||
},{
|
},{
|
||||||
"path" : "pages/login/login",
|
"path" : "pages/login/login",
|
||||||
|
@ -238,6 +238,24 @@
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
,{
|
||||||
|
"path" : "customerCheck/customerCheck",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
,{
|
||||||
|
"path" : "shopSearch/shopSearch",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
<view>
|
<view>
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :statusBack="false"></status-nav>
|
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :statusBack="false"></status-nav>
|
||||||
<image src="/static/public/staff-head.png" style="position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;"></image>
|
<image src="/static/public/staff-head.png" class="blue-img"></image>
|
||||||
<view class="mar-zy32 posir pad-x260" :style="{paddingTop:statusHNH+'px'}">
|
<view class="mar-zy32 posir pad-x260" :style="{paddingTop:statusHNH+'px'}">
|
||||||
<view class="radius20 posir gao">
|
<view class="radius20 posir gao">
|
||||||
<view class="posia" :style="{top:`-${gaoh*0.4}px`,height:gaoh+'px'}" style="left: -32rpx;right: -32rpx;z-index: -1;"></view>
|
<view class="posia" :style="{top:`-${gaoh*0.4}px`,height:gaoh+'px'}"></view>
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="disac colf">
|
<view class="disac colf">
|
||||||
<!-- 头像 -->
|
<!-- 头像 -->
|
||||||
<image class="mar-sx30" :src="userInfo.headimgurl || ''" style="width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;" mode="aspectFill"></image>
|
<image class="mar-sx30" :src="userInfo.headimgurl || ''" mode="aspectFill"></image>
|
||||||
<view class="mar-z30">
|
<view class="mar-z30">
|
||||||
<!-- 昵称 -->
|
<!-- 昵称 -->
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="fon36 bold">{{userInfo.nickname || ''}}</view>
|
<view class="fon36 bold">{{userInfo.nickname || ''}}</view>
|
||||||
<view style="background: #FFBD39;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFFFFF;padding: 5rpx 16rpx;margin-left: 10rpx;">黄金</view>
|
<view class="gao-name">黄金</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disac mar-s10" v-if="userInfo.mobile!==''">
|
<view class="disac mar-s10" v-if="userInfo.mobile!==''">
|
||||||
<image src="/static/public/phone-02.png" style="width: 14rpx;height: 20rpx;" mode=""></image>
|
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
|
||||||
<!-- 手机号 -->
|
<!-- 手机号 -->
|
||||||
<view class="fon24 mar-z10">{{userInfo.mobile}}</view>
|
<view class="fon24 mar-z10">{{userInfo.mobile}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -25,43 +25,43 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="mar-y25 disac">
|
<view class="mar-y25 disac">
|
||||||
<!-- 二维码 -->
|
<!-- 二维码 -->
|
||||||
<image @tap="isQrcode=true" src="/static/public/staff-qro.png" style="width: 43rpx;height: 43rpx;z-index: 1;" mode=""></image>
|
<image @tap="isQrcode=true" src="/static/public/staff-qro.png" class="gao-m" mode=""></image>
|
||||||
<!-- 前进键 -->
|
<!-- 前进键 -->
|
||||||
<view @tap="goNodifyData" style="width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;" class="disac">
|
<view @tap="goNodifyData" class="disac gao-next-box">
|
||||||
<image class="" src="/static/public/next-white.png" style="width: 35rpx;height: 35rpx;z-index: 1;" mode="aspectFill"></image>
|
<image class="" src="/static/public/next-white.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac posir mar-s40 fon24 pad-zy50" style="z-index: 1;color: #F8CE59;">
|
<view class="disjbac posir mar-s40 fon24 pad-zy50" style="z-index: 1;color: #F8CE59;">
|
||||||
<view>
|
<view>
|
||||||
<view class="disac"><span style="font-weight: bold;margin-right: 20rpx;">VIP</span>黄金会员</view>
|
<view class="disac"><span class="bold mar-y20">VIP</span>黄金会员</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator url="/pagesA/member/member" hover-class="none">
|
<navigator url="/pagesA/member/member" hover-class="none">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view>更多权益</view>
|
<view>更多权益</view>
|
||||||
<image src="/static/public/next-yellow.png" style="width: 22rpx;height: 22rpx;" mode=""></image>
|
<image src="/static/public/next-yellow.png" class="white-next" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disja posir" style="z-index: 1;margin-top: 75rpx;">
|
<view class="disja posir" style="z-index: 1;margin-top: 75rpx;">
|
||||||
<view @tap="choosesjf(indext)" class="disac fc flexs" style="width: 33%;" v-for="(itemt,indext) in tongList" :key="indext">
|
<view @tap="chooseone(indext)" class="disac fc flexs width33" v-for="(itemt,indext) in tongList" :key="indext">
|
||||||
<view class="fon28 bold mar-sx20 clips1">{{itemt.num}}<text v-if="indext==2">天</text></view>
|
<view class="fon28 bold mar-sx20 clips1">{{itemt.num}}<text v-if="indext==2">天</text></view>
|
||||||
<view class="fon28 mar-x25">{{itemt.title}}</view>
|
<view class="fon28 mar-x25">{{itemt.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 员工功能 v-if="userInfo.is_staff && yuanList.length!=0" -->
|
<!-- 员工功能 v-if="userInfo.is_staff && yuanList.length!=0" -->
|
||||||
<view v-if="userInfo.is_staff==1" class="bacf radius20 mar-s20 pad20">
|
<view v-if="userInfo.is_staff==1" class="bacf radius20 mar-s20 pad20">
|
||||||
<view class="bacf radius20 mar-s20 pad20">
|
|
||||||
<view class="mar-x30 fon28 bold col3">员工功能</view>
|
<view class="mar-x30 fon28 bold col3">员工功能</view>
|
||||||
<view class="disac yuan-box">
|
<view class="disja yuan-box">
|
||||||
<view @tap="chooseYitem(indexy)" style="width: 33%;display: flex;justify-content: center;align-items: center;position: relative;" v-for="(itemy,indexy) in yuanList" :key="indexy">
|
<view @tap="chooseYitem(indexy)" v-for="(itemy,indexy) in yuanList" :key="indexy">
|
||||||
<view class="disac fc">
|
<view class="disac fc">
|
||||||
<image :src="itemy.src" style="width: 54rpx;height: 54rpx;" mode="aspectFill"></image>
|
<image :src="itemy.src" mode="aspectFill"></image>
|
||||||
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
|
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="indexy<(yuanList.length-1)" style="height: 58rpx;border: 2rpx solid #E6E6E6;position: absolute;right: 0;"></view>
|
<block v-if="indexy<yuanList.length-1">
|
||||||
</view>
|
<view class="xian-right"></view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -72,16 +72,16 @@
|
||||||
<navigator url="/pagesA/myOrder/myOrder?index=0" hover-class="none">
|
<navigator url="/pagesA/myOrder/myOrder?index=0" hover-class="none">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="fon24 col9">全部</view>
|
<view class="fon24 col9">全部</view>
|
||||||
<image src="/static/public/nextM.png" style="width: 22rpx;height: 22rpx;" mode=""></image>
|
<image src="/static/public/nextM.png" class="white-next" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
<view class="disja fon28 col3">
|
<view class="disja fon28 col3">
|
||||||
<view @tap="chooseOrderStatus(indexo)" v-for="(itemo,indexo) in myOrderList" :key="indexo">
|
<view @tap="chooseOrderStatus(indexo)" v-for="(itemo,indexo) in myOrderList" :key="indexo">
|
||||||
<view class="disac fc posir">
|
<view class="disac fc posir">
|
||||||
<image :src="itemo.src" style="width: 60rpx;height: 60rpx;" mode="aspectFill"></image>
|
<image :src="itemo.src" class="icon-img" mode="aspectFill"></image>
|
||||||
<view class="mar-s20 mar-x10">{{itemo.title}}</view>
|
<view class="mar-s20 mar-x10">{{itemo.title}}</view>
|
||||||
<view class="posia" style="width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;background: #F96969;right: 0;top: 0;font-size: 22rpx;color: #FFFFFF;text-align: center;">19</view>
|
<view class="posia red-num" style="right: 0;top: 0;" v-if="itemo.num!=0">{{itemo.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -89,11 +89,11 @@
|
||||||
<!-- 广告 -->
|
<!-- 广告 -->
|
||||||
<image @tap="goPage" class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image>
|
<image @tap="goPage" class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image>
|
||||||
<!-- 功能列表① -->
|
<!-- 功能列表① -->
|
||||||
<view class="bacf radius20 mar-s20">
|
<view class="bacf radius20">
|
||||||
<view class="disjbac fon28 col3 fw">
|
<view class="disjbac fon28 col3 fw">
|
||||||
<view @tap="goPageNew(indexm)" v-for="(itemm,indexm) in moneyList" :key="indexm" class="mar-s20 mar-x20" style="width: 25%;">
|
<view @tap="goPageNew(indexm)" v-for="(itemm,indexm) in moneyList" :key="indexm" class="mar-s20 mar-x20 width25">
|
||||||
<view class="disac fc">
|
<view class="disac fc">
|
||||||
<image :src="itemm.src" style="width: 60rpx;height: 60rpx;" mode="aspectFill"></image>
|
<image :src="itemm.src" class="icon-img" mode="aspectFill"></image>
|
||||||
<view class="mar-s20 mar-x10">{{itemm.title}}</view>
|
<view class="mar-s20 mar-x10">{{itemm.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -102,11 +102,11 @@
|
||||||
<!-- 功能列表② -->
|
<!-- 功能列表② -->
|
||||||
<view class="bacf radius20 mar-s20">
|
<view class="bacf radius20 mar-s20">
|
||||||
<view class="disac fon28 col3 fw">
|
<view class="disac fon28 col3 fw">
|
||||||
<view @tap="goPageTwo(indexf)" v-for="(itemf,indexf) in toolsList" :key="indexf" class="mar-s20 mar-x20" style="width: 25%;">
|
<view @tap="goPageTwo(indexf)" v-for="(itemf,indexf) in toolsList" :key="indexf" class="mar-s20 mar-x20 width25">
|
||||||
<view class="disac fc posir">
|
<view class="disac fc posir">
|
||||||
<image :src="itemf.src" style="width: 60rpx;height: 60rpx;" mode="aspectFill"></image>
|
<image :src="itemf.src" class="icon-img" mode="aspectFill"></image>
|
||||||
<view class="mar-s20 mar-x10">{{itemf.title}}</view>
|
<view class="mar-s20 mar-x10">{{itemf.title}}</view>
|
||||||
<view v-if="indexf==4" class="posia" style="width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;background: #F96969;right: 50rpx;top: 0;font-size: 22rpx;color: #FFFFFF;text-align: center;">19</view>
|
<view v-if="indexf==4 && itemf.num!=0" class="posia red-num">{{itemf.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -117,10 +117,10 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="bacf radius20" style="margin: 0 130rpx;">
|
<view class="bacf radius20" style="margin: 0 130rpx;">
|
||||||
<view class="fon28 col3 tc pad-s40">我的二维码</view>
|
<view class="fon28 col3 tc pad-s40">我的二维码</view>
|
||||||
<image :src="myqr" style="width: 325rpx;height: 325rpx;margin: 30rpx 86rpx 68rpx 86rpx;" mode="aspectFill"></image>
|
<image :src="myqr" class="person-m" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<image @tap="isQrcode=false" class="mar-s50" src="/static/public/qrcodec.png" style="width: 96rpx;height: 96rpx;border-radius: 100%;" mode="aspectFill"></image>
|
<image @tap="isQrcode=false" class="mar-s50 close-m" src="/static/public/qrcodec.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -128,8 +128,8 @@
|
||||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
||||||
<!-- 弹框授权 -->
|
<!-- 弹框授权 -->
|
||||||
<empower :vision="vision" @cancleEv="cancleEv"></empower>
|
<empower :vision="vision" @cancleEv="cancleEv"></empower>
|
||||||
<view v-if="isQian" style="position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);">
|
<view v-if="isQian" class="sigin-box">
|
||||||
<view style="padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;">签到成功</view>
|
<view>签到成功</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -155,12 +155,14 @@
|
||||||
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
|
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
|
||||||
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
|
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
|
||||||
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
|
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
|
||||||
|
{src:'/static/public/customer-check.png',title:'客服查询',rule:'customer-list'},
|
||||||
|
{src:'/static/public/scan.png',title:'核销扫码',rule:'check-scan'},
|
||||||
],
|
],
|
||||||
myOrderList:[//我的订单状态
|
myOrderList:[//我的订单状态
|
||||||
{src:'/static/public/dai-fu60.png',title:'待付款'},
|
{src:'/static/public/dai-fu60.png',title:'待付款',num:0},
|
||||||
{src:'/static/public/dai-fa60.png',title:'待发货'},
|
{src:'/static/public/dai-fa60.png',title:'待发货',num:0},
|
||||||
{src:'/static/public/dai-shou60.png',title:'待收货'},
|
{src:'/static/public/dai-shou60.png',title:'待收货',num:0},
|
||||||
{src:'/static/public/wan-60.png',title:'已完成'},
|
{src:'/static/public/wan-60.png',title:'已完成',num:0},
|
||||||
],
|
],
|
||||||
moneyList:[
|
moneyList:[
|
||||||
{src:'/static/public/integral60.png',title:'积分商城'},
|
{src:'/static/public/integral60.png',title:'积分商城'},
|
||||||
|
@ -261,6 +263,9 @@
|
||||||
this.checkGM()
|
this.checkGM()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
chooseone(index){
|
||||||
|
if(index==2){uni.navigateTo({url:'/pagesA/signIn/signIn'})}
|
||||||
|
},
|
||||||
goPageNew(index){
|
goPageNew(index){
|
||||||
if(index==0){uni.navigateTo({url:'/pagesA/pointsMall/pointsMall'})}
|
if(index==0){uni.navigateTo({url:'/pagesA/pointsMall/pointsMall'})}
|
||||||
if(index==1){uni.navigateTo({url:'/pagesA/myAddress/myAddress'})}
|
if(index==1){uni.navigateTo({url:'/pagesA/myAddress/myAddress'})}
|
||||||
|
@ -337,14 +342,18 @@
|
||||||
if(res.code==0 && res.data.length!=0) {
|
if(res.code==0 && res.data.length!=0) {
|
||||||
this.userInfo = res.data;
|
this.userInfo = res.data;
|
||||||
this.userInfo.mobile = this.$toolAll.tools.hideMPhone(this.userInfo.mobile);
|
this.userInfo.mobile = this.$toolAll.tools.hideMPhone(this.userInfo.mobile);
|
||||||
this.tongList[1].num = res.data.score//个人积分
|
this.tongList[0].num = res.data.score;//个人积分
|
||||||
this.tongList[0].num = res.data.collects//收藏总数
|
this.tongList[1].num = res.data.coin;//个人孔雀币
|
||||||
this.tongList[2].num = res.data.share_users.total//分享人总数
|
this.tongList[2].num = res.data.continuity_sign;//个人连续签到
|
||||||
this.toolsList[4].num = res.data.unread_messages//分享人总数
|
this.toolsList[4].num = res.data.unread_messages;//分享人总数
|
||||||
this.is_worker = res.data.is_worker//是否为职工账号,0否(客户), 1是
|
this.myOrderList[0].num = res.data.order_count.waiting;//待支付总数
|
||||||
this.is_doctor = res.data.is_doctor//是否为医生,0否,1是
|
this.myOrderList[1].num = res.data.order_count.paid;//待发货总数
|
||||||
this.is_servicer = res.data.is_servicer//是否为客服,0否,1是
|
this.myOrderList[2].num = res.data.order_count.shipped;//待收货总数
|
||||||
this.is_staff = res.data.is_staff//是否为普通员工,0否,1是
|
this.myOrderList[3].num = res.data.order_count.completed;//已完成总数
|
||||||
|
this.is_worker = res.data.is_worker;//是否为职工账号,0否(客户), 1是
|
||||||
|
this.is_doctor = res.data.is_doctor;//是否为医生,0否,1是
|
||||||
|
this.is_servicer = res.data.is_servicer;//是否为客服,0否,1是
|
||||||
|
this.is_staff = res.data.is_staff;//是否为普通员工,0否,1是
|
||||||
if(res.data.is_staff==1){
|
if(res.data.is_staff==1){
|
||||||
if(this.toolsList.length!=8){
|
if(this.toolsList.length!=8){
|
||||||
this.toolsList.push({src:'/static/public/aboutus.png',title:'客服二维码',num:''})
|
this.toolsList.push({src:'/static/public/aboutus.png',title:'客服二维码',num:''})
|
||||||
|
@ -376,18 +385,17 @@
|
||||||
},
|
},
|
||||||
chooseYitem(index){//员工功能事件
|
chooseYitem(index){//员工功能事件
|
||||||
// console.log('当前选项:',this.yuanList[index].title);
|
// console.log('当前选项:',this.yuanList[index].title);
|
||||||
switch (index){
|
if(this.yuanList[index].title=='客户列表') {
|
||||||
case 0:
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesB/customerList/customerList'
|
url:'/pagesB/customerList/customerList'
|
||||||
})
|
})
|
||||||
break;
|
}
|
||||||
case 1:
|
if(this.yuanList[index].title=='用户足迹') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pagesB/userFootprint/userFootprint'
|
url:'/pagesB/userFootprint/userFootprint'
|
||||||
})
|
})
|
||||||
break;
|
}
|
||||||
case 2:
|
if(this.yuanList[index].title=='扫码签到') {
|
||||||
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
||||||
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
||||||
fail: (res) => {}, //接口调用失败的回调函数
|
fail: (res) => {}, //接口调用失败的回调函数
|
||||||
|
@ -406,24 +414,27 @@
|
||||||
},error=>{})
|
},error=>{})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
if(this.yuanList[index].title=='核销扫码') {
|
||||||
choosesjf(index){//文章收藏事件、积分、我的分享
|
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
||||||
// console.log('当前选项:',this.tongList[index].title);
|
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
||||||
switch (index){
|
fail: (res) => {}, //接口调用失败的回调函数
|
||||||
case 0:
|
onlyFromCamera: false, //是否只能从相机扫码,不允许从相册选择图片,这里是只允许相机扫码
|
||||||
uni.navigateTo({//我的收藏
|
scanType: ['qrCode'], // scanType:扫码类型 : 二维码
|
||||||
url:'/pagesB/myCollection/myCollection'
|
success: (rt) => { // 接口调用成功的回调函数
|
||||||
|
let narr = rt.result.split(',');
|
||||||
|
this.$requst.post('order/check',{order_coding:narr[0],id:narr[1],check_user:this.userInfo.id}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.$toolAll.tools.showToast('核销成功...');
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
},error=>{})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
break;
|
}
|
||||||
case 1:
|
if( this.yuanList[index].title=='客服查询') {
|
||||||
break;
|
uni.navigateTo({
|
||||||
case 2:
|
url:'/pagesB/customerCheck/customerCheck'
|
||||||
uni.navigateTo({//客户列表
|
|
||||||
url:'/pagesB/mysharer/mysharer'
|
|
||||||
})
|
})
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goNodifyData(){//去修改资料页面
|
goNodifyData(){//去修改资料页面
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
<!-- <public-customer></public-customer> -->
|
<!-- <public-customer></public-customer> -->
|
||||||
<!-- 弹框优惠券 -->
|
<!-- 弹框优惠券 -->
|
||||||
<view class="" v-if="isQuan" style="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;">
|
<view class="" v-if="isQuan" style="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;">
|
||||||
<image src="../../../static/public/yquan.png" style="width: 542rpx;height: 600rpx;" mode="aspectFill"></image>
|
<image @tap="recerveEv" :src="quanImg" style="width: 542rpx;height: 600rpx;" mode="aspectFill"></image>
|
||||||
<image @tap="closeEv" src="../../../static/public/closequan.png" style="width: 96rpx;height: 96rpx;margin-top: 56rpx;" mode=""></image>
|
<image @tap="closeEv" src="../../../static/public/closequan.png" style="width: 96rpx;height: 96rpx;margin-top: 56rpx;" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -132,7 +132,8 @@
|
||||||
bannerList:[],//轮播图
|
bannerList:[],//轮播图
|
||||||
jieDuan:false,
|
jieDuan:false,
|
||||||
isNewRenderDone:false ,//锁的作用
|
isNewRenderDone:false ,//锁的作用
|
||||||
isQuan:true
|
isQuan:uni.getStorageSync('isQuan'),
|
||||||
|
quanImg:uni.getStorageSync('quanImg'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
|
@ -210,15 +211,46 @@
|
||||||
uni.setStorageSync('statusHNH',rect.height)
|
uni.setStorageSync('statusHNH',rect.height)
|
||||||
this.statusHNH = rect.height
|
this.statusHNH = rect.height
|
||||||
}).exec()
|
}).exec()
|
||||||
this.checkBCate()
|
this.checkBCate();
|
||||||
this.checkKey()
|
this.checkKey();
|
||||||
this.checkSwi()//查询轮播图
|
this.checkSwi();//查询轮播图
|
||||||
// this.checkBanner()//调用轮播图查询事件
|
// this.checkBanner()//调用轮播图查询事件
|
||||||
this.$toolAll.tools.buriedPointAll()//查询需要埋点的事件id
|
this.$toolAll.tools.buriedPointAll();//查询需要埋点的事件id
|
||||||
|
// this.checkQ();
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.isQuan = uni.getStorageSync('isQuan');
|
||||||
|
this.quanImg= uni.getStorageSync('quanImg');
|
||||||
|
this.quanId = uni.getStorageSync('quanId');
|
||||||
|
},3000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkQ(){//查询优惠券
|
||||||
|
this.$requst.post('user/home-coupon').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.has_coupon==1){
|
||||||
|
this.isQuan = true;
|
||||||
|
this.quanImg = this.$http + res.data.home_coupon.cover;
|
||||||
|
this.quanId = res.data.home_coupon.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
recerveEv(){//领取优惠券
|
||||||
|
this.$requst.post('user/get-coupon',{coupon_id:uni.getStorageSync('quanId')}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.isQuan = false;
|
||||||
|
this.$toolAll.tools.showToast('领取成功');
|
||||||
|
setTimeout(()=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesA/coupon/coupon'
|
||||||
|
})
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
closeEv(){
|
closeEv(){
|
||||||
this.isQuan = false;
|
this.isQuan = false;
|
||||||
|
uni.setStorageSync('isQuan',false);
|
||||||
},
|
},
|
||||||
checkSwi(){
|
checkSwi(){
|
||||||
checkBanner({position:'home-banner'}).then(res=>{
|
checkBanner({position:'home-banner'}).then(res=>{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHNH+'px'}">
|
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHNH+'px'}">
|
||||||
<view class="disac pad-zy30 mar-s20">
|
<view class="disac pad-zy30 mar-s20">
|
||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<input class="width100 fon34 radius10" type="text" @confirm="searchEv" v-model="searchVal" placeholder="请输入商品名称"/>
|
<input @focus="focusEv" class="width100 fon34 radius10" type="text" @confirm="searchEv" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<view class="flexs mar-z30 radius10 pad-zy40 fon34 colf" @tap="searchEv" :style="{background:publicColor}">搜索</view>
|
<view class="flexs mar-z30 radius10 pad-zy40 fon34 colf" @tap="searchEv" :style="{background:publicColor}">搜索</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||||
<!-- 数据列表 -->
|
<!-- 数据列表 -->
|
||||||
<view :style="{marginTop:statusHNH+titleHeight+'px'}">
|
<view v-if="loading" :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||||
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
||||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}商品`"></nothing-page>
|
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}商品`"></nothing-page>
|
||||||
</view>
|
</view>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<view class="cart-box">
|
<view class="cart-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
<view class="posia"><view>99</view></view>
|
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -59,6 +59,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import shopList from '@/components/shop-list.vue';
|
import shopList from '@/components/shop-list.vue';
|
||||||
|
import {cartNum} from '@/jsFile/publicAPI.js';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
shopList
|
shopList
|
||||||
|
@ -84,10 +85,13 @@
|
||||||
doctor_name:'',//医生姓名 模糊搜索
|
doctor_name:'',//医生姓名 模糊搜索
|
||||||
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||||
disease_id:'',//病种ID
|
disease_id:'',//病种ID
|
||||||
|
loading:false,
|
||||||
|
cartNum:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.cartNumEv();//查询购物车数量
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.titleList = uni.getStorageSync('footTitle')
|
this.titleList = uni.getStorageSync('footTitle')
|
||||||
|
@ -101,6 +105,13 @@
|
||||||
this.checkSX();
|
this.checkSX();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
cartNumEv(){//购物车数量
|
||||||
|
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.cartNum = res.data.count;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
async checkSX(){//商品筛选条件
|
async checkSX(){//商品筛选条件
|
||||||
this.$requst.get('spu/condition').then(res=>{
|
this.$requst.get('spu/condition').then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
@ -113,7 +124,6 @@
|
||||||
if(this.activeIndex==index && this.isXiao) {
|
if(this.activeIndex==index && this.isXiao) {
|
||||||
this.isXiao = false;
|
this.isXiao = false;
|
||||||
} else this.isXiao = true;
|
} else this.isXiao = true;
|
||||||
this.shaiList = []
|
|
||||||
this.bingzList = [];
|
this.bingzList = [];
|
||||||
this.isClick = false;
|
this.isClick = false;
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
|
@ -169,17 +179,25 @@
|
||||||
let params = {
|
let params = {
|
||||||
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||||
page:1,
|
page:1,
|
||||||
size:10,
|
size:2000,
|
||||||
doctor_role:this.doctor_role,//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
doctor_role:this.doctor_role,//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||||
doctor_name:this.doctor_name,//医生姓名 模糊搜索
|
doctor_name:this.doctor_name,//医生姓名 模糊搜索
|
||||||
activity:this.activity,//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
activity:this.activity,//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||||
disease_id:this.disease_id//病种ID
|
disease_id:this.disease_id//病种ID
|
||||||
}
|
}
|
||||||
this.$requst.post('spu/list',params).then(res=>{
|
uni.request({
|
||||||
if(res.code==0){
|
url:'https://hengmei.scdxtc.cn/api/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){
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
if(res.data.list.length!=0){
|
if(res.data.data.list.length!=0){
|
||||||
res.data.list.forEach(item=>{
|
res.data.data.list.forEach(item=>{
|
||||||
let tuan = false,ping = false,xian = false,integral = false;
|
let tuan = false,ping = false,xian = false,integral = false;
|
||||||
if(item.activity_type=='group_make') ping = true;
|
if(item.activity_type=='group_make') ping = true;
|
||||||
if(item.activity_type=='group_buy') tuan = true;
|
if(item.activity_type=='group_buy') tuan = true;
|
||||||
|
@ -197,31 +215,33 @@
|
||||||
zhePrice:item.price/100,
|
zhePrice:item.price/100,
|
||||||
yuanPrice:item.original_price/100,
|
yuanPrice:item.original_price/100,
|
||||||
integral:'',
|
integral:'',
|
||||||
isTuan:tuan,
|
isTuan:tuan,//是否是团购
|
||||||
isPing:ping,
|
isPing:ping,//是否是拼团活动
|
||||||
isXian:xian,
|
isXian:xian,//是否是限时活动
|
||||||
isIntegral:integral,
|
isIntegral:integral,//是否是积分
|
||||||
grade:'',
|
grade:'',
|
||||||
disease_name:item.disease_name,//病种名称
|
disease_name:item.disease_name,//病种名称
|
||||||
disease_id:item.disease_id,//病种ID
|
disease_id:item.disease_id,//病种ID
|
||||||
|
reponseTime:res.header.Date,//接口响应时间
|
||||||
activity_end_at:item.activity_end_at,//限时结束时间
|
activity_end_at:item.activity_end_at,//限时结束时间
|
||||||
activity_group_cover:group_cover,//参团人的头像
|
activity_group_cover:group_cover,//参团人的头像
|
||||||
activity_group_num:item.activity_group_num//已经参团人数
|
activity_group_num:item.activity_group_num,//已经参团人数
|
||||||
}
|
}
|
||||||
this.dataList.push(obj)
|
this.dataList.push(obj)
|
||||||
})
|
})
|
||||||
|
this.loading = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
chooseBing(index){//小分类选择事件
|
chooseBing(index){//小分类选择事件
|
||||||
this.bingzList[index].isActive = !this.bingzList[index].isActive;
|
this.bingzList.forEach(item=>{
|
||||||
let cun = this.shaiList.indexOf(this.bingzList[index].id);
|
item.isActive = false;
|
||||||
if(cun==-1){
|
})
|
||||||
this.shaiList.push(this.bingzList[index].title);
|
this.bingzList[index].isActive = true;
|
||||||
}
|
this.shaiList[this.activeIndex] = this.bingzList[index].title;
|
||||||
this.searchVal = this.shaiList.join(',');
|
console.log(this.shaiList);
|
||||||
console.log(this.searchVal);
|
|
||||||
},
|
},
|
||||||
chongz(){//重置
|
chongz(){//重置
|
||||||
this.isClick = false;
|
this.isClick = false;
|
||||||
|
@ -238,8 +258,16 @@
|
||||||
this.isClick = false;
|
this.isClick = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
focusEv(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesB/shopSearch/shopSearch'
|
||||||
|
})
|
||||||
|
},
|
||||||
searchEv(){//搜索事件
|
searchEv(){//搜索事件
|
||||||
this.checkShopList();
|
// uni.navigateTo({
|
||||||
|
// url:'/pagesB/shopSearch/shopSearch'
|
||||||
|
// })
|
||||||
|
// this.checkShopList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,26 +4,38 @@
|
||||||
<status-nav :titleVal="'活动任务'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'活动任务'" :statusTitle="true"></status-nav>
|
||||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x20">
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x20">
|
||||||
<!-- 签到领积分 -->
|
<!-- 签到领积分 -->
|
||||||
<view class="bacf radius20 pad20 mar-s20">
|
<view v-for="(item,index) in activityList" :key="index" class="bacf radius20 pad20 mar-s20">
|
||||||
<view class="bold col3 disjbac">
|
<view class="bold col3 disjbac">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<image src="/static/public/task-01-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
<image :src="item.imgSrc" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
||||||
<view class="fon28">签到领积分</view>
|
<view class="fon28">{{item.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view><span style="color: #3875F6;">0</span>/7</view>
|
<view><span style="color: #3875F6;">{{item.danc}}</span>/{{item.allc}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon24" style="color: #808080;">
|
<view class="fon24" style="color: #808080;">
|
||||||
<view class="mar-s30">活动要求:七天签到可领取7000个积分</view>
|
<view class="mar-s30">活动要求:{{item.description}}</view>
|
||||||
<view class="mar-s20">获得奖励:10积分</view>
|
<view class="mar-s20">获得奖励:{{item.amount}} <span v-if="item.isIcon!=1">积分</span><span v-else>孔雀币</span></view>
|
||||||
<view class="mar-s20">会员:暂无</view>
|
<view class="mar-s20">会员:暂无</view>
|
||||||
<view class="mar-s20">结束时间:2021-09-10 10:30</view>
|
<view class="mar-s20">结束时间:{{item.endTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<view class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;">立即签到</view>
|
<!-- 线下签到 -->
|
||||||
|
<view v-if="item.ntype=='offline_sign_in'">
|
||||||
|
<view @tap="btnEv(index)" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'"><span>{{partakeVal}}</span></view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.ntype=='sign_in'" class="disja">
|
||||||
|
<view @tap="goTosigin" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'" :style="{width:(item.danc==item.allc)?'260rpx':'546rpx'}">{{siginVal}}</view>
|
||||||
|
<view v-if="item.danc==item.allc" @tap="btnEv(index)" class="mar-s30 mar-z20" :class="item.isStatus!=0?'activity-dai':'activity-mo'" style="width: 260rpx;background: #f8bf2c;">{{partakeVal}}</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.ntype!='offline_sign_in' && item.ntype!='sign_in'">
|
||||||
|
<view @tap="btnEv(index)" class="mar-s30" :class="item.isStatus!=0?'activity-dai':'activity-mo'" :style="{background:item.account_status==0?'#ccc':''}">
|
||||||
|
<span>{{['审核中...','立即完成','审核不通过','立即完成'][item.account_status]}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分享孔雀币 -->
|
<!-- 分享孔雀币 -->
|
||||||
<view class="bacf radius20 pad20 mar-s20">
|
<!-- <view class="bacf radius20 pad20 mar-s20">
|
||||||
<view class="bold col3 disjbac">
|
<view class="bold col3 disjbac">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<image src="/static/public/task-02-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
<image src="/static/public/task-02-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
||||||
|
@ -40,9 +52,9 @@
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<view class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;">立即参与</view>
|
<view class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;">立即参与</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 分享领积分 -->
|
<!-- 分享领积分 -->
|
||||||
<view class="bacf radius20 pad20 mar-s20">
|
<!-- <view class="bacf radius20 pad20 mar-s20">
|
||||||
<view class="bold col3 disjbac">
|
<view class="bold col3 disjbac">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<image src="/static/public/task-03-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
<image src="/static/public/task-03-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
||||||
|
@ -59,9 +71,9 @@
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<view class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;">立即参与</view>
|
<view class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;">立即参与</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 分享至朋友圈 -->
|
<!-- 分享至朋友圈 -->
|
||||||
<view class="bacf radius20 pad20 mar-s20">
|
<!-- <view class="bacf radius20 pad20 mar-s20">
|
||||||
<view class="bold col3 disjbac">
|
<view class="bold col3 disjbac">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<image src="/static/public/task-04-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
<image src="/static/public/task-04-60.png" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
||||||
|
@ -78,24 +90,24 @@
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<view @tap="isScreenshot=true" :style="{background:!isScreenshot?publicColor:'#CCCCCC'}" class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;">{{!isScreenshot?'立即参与':'审核中...'}}</view>
|
<view @tap="isScreenshot=true" :style="{background:!isScreenshot?publicColor:'#CCCCCC'}" class="mar-s30" style="width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;">{{!isScreenshot?'立即参与':'审核中...'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 上传截图弹框 -->
|
<!-- 上传截图弹框 -->
|
||||||
<view v-if="isScreenshot" @tap.stop="isScreenshot=false,upImg=''" class="posAll disjcac" style="padding: 0 85rpx;z-index: 3;">
|
<view v-if="isScreenshot" @tap.stop="isScreenshot=false,upImg=''" class="posAll disjcac" style="padding: 0 85rpx;z-index: 3;">
|
||||||
<view class="bacf width100" @tap.stop="isScreenshot=true" style="padding: 0 33rpx;border-radius: 20rpx;">
|
<view class="bacf width100" @tap.stop="isScreenshot=true" style="padding: 0 33rpx;border-radius: 20rpx;">
|
||||||
<view class=" disjcac fc">
|
<view class=" disjcac fc">
|
||||||
<view class="fon32 col3 mar-s30 mar-x40">截图上传</view>
|
<view class="fon32 col3 mar-s30 mar-x40">截图上传</view>
|
||||||
<view v-if="upImg==''" @tap="chooseImg" class=" disjcac fc" style="width: 340rpx;height: 348rpx;background: #F0F0F0;border-radius: 10rpx;margin-bottom: 70rpx;">
|
<view v-if="upImg==''" @tap="chooseImg" class="task-add-box disjcac fc">
|
||||||
<view class="posir disjcac mar-s50">
|
<view class="posir disjcac mar-s50">
|
||||||
<view class="posia" style="width: 100rpx;height: 6rpx;background: #B3B3B3;border-radius: 10rpx;transform: rotate(90deg);"></view>
|
<view class="posia task-add" style="transform: rotate(90deg);"></view>
|
||||||
<view class="posia" style="width: 100rpx;height: 6rpx;background: #B3B3B3;border-radius: 10rpx;"></view>
|
<view class="posia task-add"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon28 col9" style="margin-top: 120rpx;">点击上传截图</view>
|
<view class="fon28 col9" style="margin-top: 120rpx;">点击上传截图</view>
|
||||||
</view>
|
</view>
|
||||||
<image v-else @tap="chooseImg" :src="upImg" style="width: 340rpx;height: 348rpx;border-radius: 10rpx;margin-bottom: 70rpx;" mode="aspectFill"></image>
|
<image v-else @tap="chooseImg" class="imgIng" :src="upImg" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-x20" style="text-align: center;">
|
<view class="disjbac mar-x20 tc">
|
||||||
<view @tap.stop="isScreenshot=false,upImg=''" style="width: 196rpx;height: 60rpx;line-height: 60rpx;border-radius: 10rpx;background: #E6E6E6;color: #FFFFFF;">取消</view>
|
<view @tap.stop="isScreenshot=false,upImg=''" class="task-cancle-btn">取消</view>
|
||||||
<view @tap.stop="shareEv" style="width: 196rpx;height: 60rpx;line-height: 60rpx;border-radius: 10rpx;background: #3875F6;color: #FFFFFF;position: relative;">确定</view>
|
<view @tap.stop="shareEv" class="task-confrim-btn">确定</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -110,24 +122,96 @@
|
||||||
statusHNH:uni.getStorageSync('statusHNH'),
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
isScreenshot:false,
|
isScreenshot:false,
|
||||||
upImg:''
|
upImg:'',
|
||||||
|
chooseIndex:0,
|
||||||
|
activityList:[],//活动列表
|
||||||
|
isNum:0,
|
||||||
|
siginVal:'立即签到',
|
||||||
|
partakeVal:'立即完成'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.checkList();
|
this.checkList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
btnEv(index){
|
||||||
|
this.chooseIndex = index;
|
||||||
|
if(this.activityList[index].isIcon!=3 && this.activityList[index].account_status==1 || this.activityList[index].account_status==3) {
|
||||||
|
if(this.isNum==0) {
|
||||||
|
this.isNum++;
|
||||||
|
this.$requst.post('task/task/complete-task',{task_id:this.activityList[index].id}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.isNum = 0;
|
||||||
|
} else {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.isNum = 0;
|
||||||
|
},2000)
|
||||||
|
this.$toolAll.tools.showToast(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(this.activityList[index].account_status==1 || this.activityList[index].account_status==3){
|
||||||
|
this.isScreenshot = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
checkList(){//查询任务列表
|
checkList(){//查询任务列表
|
||||||
this.$requst.post('task/task/task-list').then(res=>{
|
this.$requst.post('task/task/task-list').then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
this.activityList = [];
|
||||||
if(res.data.length!=0){
|
if(res.data.length!=0){
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item=>{
|
||||||
|
let nIcon = 0;
|
||||||
|
let nimg = '/static/public/task-01-60.png';
|
||||||
|
if(item.icon==1) {
|
||||||
|
nimg = '/static/public/task-02-60.png';
|
||||||
|
nIcon = 1;
|
||||||
|
}
|
||||||
|
if(item.icon==2) {
|
||||||
|
nimg = '/static/public/task-03-60.png';
|
||||||
|
nIcon = 2;
|
||||||
|
}
|
||||||
|
if(item.icon==3) {
|
||||||
|
nimg = '/static/public/task-04-60.png';
|
||||||
|
nIcon = 3;
|
||||||
|
}
|
||||||
|
let obj = {
|
||||||
|
id:item.id,
|
||||||
|
imgSrc:nimg,//icon图标
|
||||||
|
title:item.title,//标题
|
||||||
|
danc:item.completed_quantity,//进度次数
|
||||||
|
allc:item.cycle,//总次数
|
||||||
|
description:item.description,//活动要求
|
||||||
|
amount:item.reward_number,//奖励数量
|
||||||
|
account_status:item.account_status,
|
||||||
|
member:'',//会员
|
||||||
|
isStatus:item.status,
|
||||||
|
endTime:item.end_at,//结束时间
|
||||||
|
isIcon:nIcon,//什么类型的任务 0签到 1孔雀币 2积分 3分享截图
|
||||||
|
ntype:item.type//签到类型
|
||||||
|
}
|
||||||
|
this.activityList.push(obj);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// account_status: 1 用户任务状态 0待审核 1正常 2拒绝 3重复完成(也是正常的一种)
|
||||||
|
// completed_quantity: 0 完成进度
|
||||||
|
// create_time: "2021-10-20 18:12:37" 任务创建时间
|
||||||
|
// cycle: 1 周期数
|
||||||
|
// description: "" 任务简介
|
||||||
|
// end_at: "2021-10-30" 任务结束时间
|
||||||
|
// id: 4 任务的id
|
||||||
|
// long_term: 0 是否长期任务 长期为0
|
||||||
|
// repeat: 0 是否可以重复完成
|
||||||
|
// reward_number: 10 奖励总数
|
||||||
|
// reward_type: "coin" 奖励类型 孔雀币或者积分
|
||||||
|
// start_at: "2020-10-20" 任务开始时间
|
||||||
|
// status: 1 任务状态 1 进行中 0 冻结
|
||||||
|
// title: "分享截图任务" 任务标题
|
||||||
|
// type: "share_screenshots" 任务类型 'share','sign_in','offline_sign_in','share_screenshots'型 分享 签到 线下签到 分享截图
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -142,8 +226,29 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
shareEv(){//确认上传凭证
|
shareEv(){//确认上传凭证
|
||||||
|
if(this.isNum==0) {
|
||||||
|
this.isNum++;
|
||||||
|
this.$requst.post('task/task/complete-task',{task_id:this.activityList[this.chooseIndex].id,image:this.upImg}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.isNum = 0;
|
||||||
|
this.isScreenshot = false;
|
||||||
|
this.upImg = '';
|
||||||
|
this.$toolAll.tools.showToast('截图已上传');
|
||||||
|
this.checkList();
|
||||||
|
} else {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.isNum = 0;
|
||||||
|
},2000)
|
||||||
|
this.$toolAll.tools.showToast(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
goTosigin(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesA/signIn/signIn'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
||||||
<view class="pad-x30">
|
<view class="pad-x30">
|
||||||
<view v-if="dataList.length!=0" class="mar-x20" v-for="(item,index) in dataList" :key="index">
|
<view v-if="dataList.length!=0" class="mar-x20 animated fadeInLeft" v-for="(item,index) in dataList" :key="index">
|
||||||
<view style="height: 200rpx;" class="disjbac posir">
|
<view style="height: 200rpx;" class="disjbac posir">
|
||||||
<view class="posir disjcac fc" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
|
<view class="disjcac fc recerve-left" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
|
||||||
<image v-if="item.statusNum!=0 && item.statusNum!=2" class="posia quan-img" src="/static/public/quan-left-two.png" mode=""></image>
|
<image v-if="item.statusNum!=0 && item.statusNum!=2" class="posia quan-img" src="/static/public/quan-left-two.png" mode=""></image>
|
||||||
<image v-else class="posia quan-img" src="/static/public/quan-left.png" mode=""></image>
|
<image v-else class="posia quan-img" src="/static/public/quan-left.png" mode=""></image>
|
||||||
<view class="posir disjcac fc" style="z-index: 1;">
|
<view class="posir disjcac fc" style="z-index: 1;">
|
||||||
|
@ -74,7 +74,6 @@
|
||||||
// console.log('状态栏+标题栏:',rect);
|
// console.log('状态栏+标题栏:',rect);
|
||||||
this.chuTop = rect.height;
|
this.chuTop = rect.height;
|
||||||
}).exec()
|
}).exec()
|
||||||
this.zcList = this.dataList;
|
|
||||||
this.checkAllList(0);
|
this.checkAllList(0);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -87,23 +86,25 @@
|
||||||
this.$requst.post('user/get-coupon-list',params).then(res=>{
|
this.$requst.post('user/get-coupon-list',params).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
|
this.zcList = [];
|
||||||
if(res.data.length!=0){
|
if(res.data.length!=0){
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item=>{
|
||||||
let leix = false;
|
let leix = false;
|
||||||
if(item.type=='taste') leix = true;
|
if(item.type=='taste') leix = true;
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
num:item.amount,
|
num:item.amount/100,
|
||||||
title:item.name,
|
title:item.name,
|
||||||
cover:this.$http + item.cover,
|
cover:this.$http + item.cover,
|
||||||
manPrice:item.condition,
|
manPrice:item.condition/100,
|
||||||
startTime:item.begin_at,
|
startTime:item.begin_at.slice(0,10),
|
||||||
endTime:item.end_at,
|
endTime:item.end_at.slice(0,10),
|
||||||
isTiyan:leix,
|
isTiyan:leix,
|
||||||
isZhek:false,
|
isZhek:false,
|
||||||
statusNum:index
|
statusNum:index
|
||||||
}
|
}
|
||||||
this.zcList = this.dataList.push(obj);
|
this.dataList.push(obj);//渲染的列表
|
||||||
|
this.zcList.push(obj);//暂存的列表
|
||||||
})
|
})
|
||||||
this.checkList(index);
|
this.checkList(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,11 @@
|
||||||
<view class="bold">收件人信息</view>
|
<view class="bold">收件人信息</view>
|
||||||
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
|
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
|
||||||
<view class="fon26 col3 disjbac pad-s50">
|
<view class="fon26 col3 disjbac pad-s50">
|
||||||
<view>
|
<view v-if="addressInfo!=''">
|
||||||
<view class="fon28 col3 bold mar-x20">{{addressInfo.name}} <span class="mar-z20">{{userPphone}}</span></view>
|
<view class="fon28 col3 bold mar-x20">{{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 class="fon24 col9">{{addressInfo.province_str}}{{addressInfo.city_str}}{{addressInfo.county_str || ''}}{{addressInfo.address || ''}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="fon24 col9">请完善收件人信息</view>
|
||||||
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -40,15 +41,11 @@
|
||||||
<view class="bacf radius20 mar-s20 pad-sx27-zy20">
|
<view class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||||
<view class="bold">订单信息</view>
|
<view class="bold">订单信息</view>
|
||||||
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
<image @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
||||||
<image :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
|
||||||
</navigator>
|
|
||||||
<view class="width100 disjb fw" style="height: 166rpx;">
|
<view class="width100 disjb fw" style="height: 166rpx;">
|
||||||
<view>
|
<view>
|
||||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
<view @tap="goShopDetail(item.id)" class="fon28 col3 bold clips2">{{item.title}}</view>
|
||||||
<view class="fon28 col3 bold clips2">{{item.title}}</view>
|
<view class="order-sy">{{item.sku_name}}</view>
|
||||||
</navigator>
|
|
||||||
<view class="order-sy">试用</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-s10 width100">
|
<view class="disjbac mar-s10 width100">
|
||||||
<view class="order-item-price" v-if="isNei!=3">¥{{item.price}}</view>
|
<view class="order-item-price" v-if="isNei!=3">¥{{item.price}}</view>
|
||||||
|
@ -57,6 +54,23 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="fon28 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>
|
||||||
|
</view>
|
||||||
|
<!-- 选择支付方式 -->
|
||||||
|
<view class="bacf radius20 mar-s20 fon28 col3 pad-sx30 pad-zy20">
|
||||||
|
<view class="bold fon28">选择支付方式</view>
|
||||||
|
<view @tap="chooseFS(index)" v-for="(item,index) in payFS" :key="index" v-if="isCurrent!=index" class="disjbac mar-s30">
|
||||||
|
<view class="disac">
|
||||||
|
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="chooseDX" mode=""></image>
|
||||||
|
<image v-else src="/static/public/cancle-FS.png" class="chooseDX" mode=""></image>
|
||||||
|
<view class="mar-z25">{{item.title}}</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.num!=0">余{{item.num}}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 优惠 -->
|
<!-- 优惠 -->
|
||||||
<view v-if="isNei!=3" class="bacf radius20 mar-s20 pad-sx27-zy20">
|
<view v-if="isNei!=3" class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||||
|
@ -64,7 +78,7 @@
|
||||||
<view @tap="quanEv(1)" class="fon28 col3 disjbac mar-sx40">
|
<view @tap="quanEv(1)" class="fon28 col3 disjbac mar-sx40">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="colf8 bold">-¥{{youQuan.youPrice}}.00</view>
|
<view class="colf8 bold">-¥{{youQuan.youPrice}}</view>
|
||||||
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -80,10 +94,10 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
|
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
|
||||||
<!-- 去支付 -->
|
<!-- 去支付 -->
|
||||||
<view class="fon40 colf8 bold" v-if="isNei!=3">合计:¥{{allPrice}}</view>
|
<view class="fon36 colf8 bold" v-if="isNei!=3">合计:¥{{allPrice}}<span v-if="isKq">+{{zf_kqPrice}}孔雀币</span></view>
|
||||||
<view class="fon40 colf8 bold dis" v-else><span class="col3 fon28">合计积分:</span>{{allPrice}}<span v-if="isExpress">+ ¥{{expressInfo.default_price}}</span></view>
|
<view class="fon40 colf8 bold dis" v-else><span class="col3 fon28">合计积分:</span>{{allPrice}}<span v-if="isExpress && expressInfo.default_price!=0">+ ¥{{expressInfo.default_price}}</span></view>
|
||||||
<view @tap="goPayment" v-if="isNei!=3" class="goPayment">去支付</view>
|
<view @tap="goPayment" v-if="isNei!=3" class="goPayment">去支付</view>
|
||||||
<view @tap="goPayment" v-else class="goPayment">去兑换</view>
|
<view @tap="isDui=true" v-else class="goPayment">去兑换</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="showQuan" @tap.stop="showQuan=false" class="posAll">
|
<view v-if="showQuan" @tap.stop="showQuan=false" class="posAll">
|
||||||
|
@ -125,13 +139,25 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 确认兑换弹框 -->
|
<!-- 确认兑换弹框 -->
|
||||||
<view v-if="isDui" @tap.stop="isDui=false" class="posAll" style="display: flex;justify-content: center;align-items: center;padding: 0 85rpx;">
|
<view v-if="isDui" @tap.stop="isDui=false" class="posAll zhun-dui-box">
|
||||||
<view class="bacf radius20 width100 tc fon28 col3 pad20" @tap.stop="isDui=true">
|
<view class="bacf radius20 width100 tc fon28 col3 pad20" @tap.stop="isDui=true">
|
||||||
<view class="bold" style="margin: 0rpx 0 56rpx 0;">兑换商品</view>
|
<view class="bold" style="margin: 0rpx 0 56rpx 0;">兑换商品</view>
|
||||||
<view style="margin: 0rpx 0 66rpx 0;">您确定使用7666积分兑换吗?</view>
|
<view style="margin: 0rpx 0 66rpx 0;">您确定使用{{allPrice}}积分兑换吗?</view>
|
||||||
<view class="disjbac mar-x20 pad-zy20">
|
<view class="disjbac mar-x20 pad-zy20 zhun-dui-btn">
|
||||||
<view @tap.stop="isDui=false" style="width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 28rpx;font-weight: 500;border-radius: 10rpx;background: #C8C8C8;color: #FFFFFF;">暂不兑换</view>
|
<view @tap.stop="isDui=false">暂不兑换</view>
|
||||||
<view @tap.stop="isDui=false" style="width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 28rpx;font-weight: 500;border-radius: 10rpx;background: #3875F6;color: #FFFFFF;">立即兑换</view>
|
<view @tap.stop="goPayment">立即兑换</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 支付成功 -->
|
||||||
|
<view v-if="isSuccess" class="posAll" :style="{top:statusHNH+'px'}" 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}}</span><span v-else>合计:{{jsPrice}}</span></view>
|
||||||
|
<view class="disja success-btn">
|
||||||
|
<view @tap="goDetail">查看订单</view>
|
||||||
|
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -161,30 +187,191 @@
|
||||||
zanAllPrice:0,//暂存合计
|
zanAllPrice:0,//暂存合计
|
||||||
isNei:0,
|
isNei:0,
|
||||||
expressInfo:{},//快递信息
|
expressInfo:{},//快递信息
|
||||||
addressInfo:{},//地址信息
|
addressInfo:'',//地址信息
|
||||||
userPphone:'',
|
userPphone:'请完善信息',
|
||||||
zPhone:'',//自提时的手机号
|
zPhone:'',//自提时的手机号
|
||||||
page:1,
|
page:1,
|
||||||
size:10,
|
size:10,
|
||||||
isFocus:false,
|
isFocus:false,
|
||||||
loading: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
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin();
|
this.$toolAll.tools.isLogin();
|
||||||
this.checkexpress();//查询快递
|
this.checkexpress();//查询快递
|
||||||
this.checkAddress();//查询地址
|
this.checkChoose();//检测地址
|
||||||
this.quanEv(0);//查询优惠券列表
|
|
||||||
uni.removeStorageSync('orderInfo');
|
uni.removeStorageSync('orderInfo');
|
||||||
|
setTimeout(()=>{
|
||||||
|
if(this.addressInfo==''){this.$toolAll.tools.showToast('请完善收件人信息','none',1500);}
|
||||||
|
},2000)
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.checkeList();//查询订单列表
|
this.checkeList();//查询订单列表
|
||||||
this.checkOrderDetail();//查询订单信息
|
this.checkOrderDetail();//查询订单信息
|
||||||
this.isNei = options.isNei;
|
this.isNei = options.isNei;
|
||||||
|
if(this.isNei==3) {
|
||||||
|
this.payFS[0].isActive = false;
|
||||||
|
this.payFS[2].isActive = true;
|
||||||
|
this.isCurrent = 1;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkChoose(){
|
||||||
|
if(uni.getStorageSync('chooseAddress')==''){
|
||||||
|
this.checkAddress();//查询地址
|
||||||
|
} else {
|
||||||
|
let naddress = uni.getStorageSync('chooseAddress');
|
||||||
|
this.addressInfo = {
|
||||||
|
id:naddress.id,
|
||||||
|
name:naddress.userName,
|
||||||
|
phone:naddress.userPhone,
|
||||||
|
province_str:naddress.province,
|
||||||
|
city_str:naddress.city,
|
||||||
|
county_str:naddress.county,
|
||||||
|
address:naddress.address
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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).toFixed(2);
|
||||||
|
this.zf_kqPrice = this.payFS[1].num;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//选择了微信支付+取消了孔雀币
|
||||||
|
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
|
||||||
|
this.isKq = false;
|
||||||
|
if(this.youQuan.youPrice==0){
|
||||||
|
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice).toFixed(2);
|
||||||
|
} else {
|
||||||
|
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice-this.youQuan.youPrice).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;
|
||||||
|
} else {//孔雀币不足以抵扣应付款
|
||||||
|
this.$toolAll.tools.showToast('孔雀币不足')
|
||||||
|
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price).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).toFixed(2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast('暂无可用孔雀币');
|
||||||
|
this.payFS[index].isActive = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.payFS[index].title=='积分') {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
goPayment(){//去付款
|
goPayment(){//去付款
|
||||||
this.isFocus = false;
|
this.isFocus = false;
|
||||||
|
this.isDui = false;
|
||||||
let nphone = '';
|
let nphone = '';
|
||||||
if(this.isExpress) {
|
if(this.isExpress) {
|
||||||
nphone = this.addressInfo.phone;//默认地址的手机号
|
nphone = this.addressInfo.phone;//默认地址的手机号
|
||||||
|
@ -192,44 +379,121 @@
|
||||||
let self = 0;//快递的配送方式
|
let self = 0;//快递的配送方式
|
||||||
if(!this.isExpress) self = 1;//自提的方式
|
if(!this.isExpress) self = 1;//自提的方式
|
||||||
let nsku_list = [];
|
let nsku_list = [];
|
||||||
|
let is_only = 0;
|
||||||
this.orderList.forEach(item=>{
|
this.orderList.forEach(item=>{
|
||||||
let obj = {
|
let obj = {
|
||||||
sku_coding:item.coding,
|
sku_coding:item.coding,
|
||||||
num:item.num
|
num:item.num,
|
||||||
|
group_id:item.group_id
|
||||||
}
|
}
|
||||||
nsku_list.push(obj);
|
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 = {
|
let parmas = {
|
||||||
sku_list: nsku_list,//商品单号和数量数组
|
sku_list: nsku_list,//商品单号和数量数组
|
||||||
total: this.allPrice,//总金额
|
total: this.allPrice*100,//总金额
|
||||||
address_id: this.addressInfo.id,//地址ID
|
address_id: this.addressInfo.id,//地址ID
|
||||||
express_code: this.expressInfo.code,//快递编码
|
express_code: this.expressInfo.code,//快递编码
|
||||||
coupon_id: this.youQuan.id,//优惠券ID
|
coupon_id: this.youQuan.id,//优惠券ID
|
||||||
coupon_price: this.youQuan.youPrice,//优惠券可用
|
coupon_price: this.youQuan.youPrice*100,//优惠券可用
|
||||||
pick_self: self,//是否自提0 快递, 1自提
|
pick_self: self,//是否自提0 快递, 1自提
|
||||||
pick_self_phone: nphone,//联系电话
|
pick_self_phone: nphone,//联系电话
|
||||||
original_total: 0,//原价总金额
|
original_total: this.zanAllPrice*100,//原价总金额
|
||||||
freight: this.expressInfo.default_price,
|
freight: this.expressInfo.default_price,//快递费
|
||||||
remarks: ""//备注
|
remarks: "",//备注
|
||||||
|
is_only:is_only,//是否是单独购买0 不是单独购买,2是单独购买
|
||||||
|
is_score:is_score,//是否是积分商品0 不是积分商品,1是积分商品
|
||||||
|
coin:this.zf_kqPrice//孔雀币
|
||||||
|
|
||||||
}
|
}
|
||||||
if(nphone=='') {
|
if(this.addressInfo=='' && self!=1){
|
||||||
|
this.$toolAll.tools.showToast('请完善收件人信息');
|
||||||
|
} else if(nphone=='') {
|
||||||
this.$toolAll.tools.showToast('请填写收货人手机号');
|
this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||||
this.focusEv();
|
this.focusEv();
|
||||||
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
||||||
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||||
this.focusEv();
|
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.$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 {
|
} else {
|
||||||
this.$requst.post('order/create',parmas).then(res=>{
|
if(this.times==0){
|
||||||
if(res.code==0){
|
this.times++;
|
||||||
uni.setStorageSync('orderList',this.orderList);
|
if(this.allPrice==0){
|
||||||
uni.setStorageSync('orderInfo',res.data);
|
this.$toolAll.tools.showToast('正在支付','loading',1500);
|
||||||
console.log(res.data);
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pagesA/immediatePayment/immediatePayment?allPrice=${this.allPrice}&allNum=${this.allNum}`
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.$toolAll.tools.showToast(res.msg);
|
this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||||
}
|
}
|
||||||
|
uni.request({
|
||||||
|
url:'https://hengmei.scdxtc.cn/api/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);
|
||||||
|
this.times = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
payment(info){
|
||||||
|
if(info.needPay){
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'wxpay',
|
||||||
|
appId:info.payment_params.appId,//appId
|
||||||
|
timeStamp: info.payment_params.timeStamp,//时间戳
|
||||||
|
nonceStr: info.payment_params.nonceStr,//随机字符串
|
||||||
|
package: info.payment_params.package,//package
|
||||||
|
signType: info.payment_params.signType,//MD5
|
||||||
|
paySign: info.payment_params.sign,//签名
|
||||||
|
success:(res)=> {
|
||||||
|
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
uni.removeStorageSync('chooseAddress')
|
||||||
|
this.isSuccess = true;
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail() {
|
||||||
|
this.times = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
uni.removeStorageSync('chooseAddress')
|
||||||
|
this.isSuccess = true;
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -238,8 +502,8 @@
|
||||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
wx.openLocation({//使用微信内置地图查看位置。
|
wx.openLocation({//使用微信内置地图查看位置。
|
||||||
latitude: 22.5542080000,//要去的纬度-地址
|
latitude: 30.67554,//要去的纬度-地址
|
||||||
longitude: 113.8878770000,//要去的经度-地址
|
longitude: 104.010642,//要去的经度-地址
|
||||||
name: val,
|
name: val,
|
||||||
address: val
|
address: val
|
||||||
})
|
})
|
||||||
|
@ -269,6 +533,7 @@
|
||||||
if(item.is_default==1){
|
if(item.is_default==1){
|
||||||
this.expressInfo = item;
|
this.expressInfo = item;
|
||||||
this.expressInfo.default_price = this.expressInfo.default_price/100;
|
this.expressInfo.default_price = this.expressInfo.default_price/100;
|
||||||
|
this.quanEv(0);//查询优惠券列表
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.totalEv();
|
this.totalEv();
|
||||||
|
@ -289,13 +554,19 @@
|
||||||
this.checkexpress();
|
this.checkexpress();
|
||||||
},
|
},
|
||||||
totalEv(){//合计运算
|
totalEv(){//合计运算
|
||||||
if(this.isNei!=3 && this.isExpress){
|
if(this.isNei!=3 && this.isExpress){//普通商品,有运费
|
||||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice + this.expressInfo.default_price;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice + this.expressInfo.default_price;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||||
}
|
}
|
||||||
if(this.isNei!=3 && !this.isExpress){
|
if(this.isNei!=3 && !this.isExpress){//普通商品无运费
|
||||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||||
}
|
}
|
||||||
this.allPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
|
this.allPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
|
||||||
|
if(this.isNei ==3 && this.isExpress){//积分商品,有运费
|
||||||
|
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice + this.expressInfo.default_price;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||||
|
}
|
||||||
|
if(this.isNei ==3 && !this.isExpress){//积分商品,有运费
|
||||||
|
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||||
|
}
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
},
|
},
|
||||||
checkOrderDetail(){//查询订单准备信息
|
checkOrderDetail(){//查询订单准备信息
|
||||||
|
@ -313,7 +584,9 @@
|
||||||
}
|
}
|
||||||
this.$requst.post('order/prepare-info',parmas).then(res=>{
|
this.$requst.post('order/prepare-info',parmas).then(res=>{
|
||||||
if(res.code==0){
|
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);
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -322,16 +595,21 @@
|
||||||
this.allPrice += item.price*item.num;
|
this.allPrice += item.price*item.num;
|
||||||
this.allNum += item.num;
|
this.allNum += item.num;
|
||||||
})
|
})
|
||||||
this.zanAllPrice = this.allPrice;
|
this.zanAllPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
|
||||||
},
|
},
|
||||||
quanEv(index){//调起优惠券弹框事件
|
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){
|
if(index==1){
|
||||||
this.showQuan = true
|
this.showQuan = true
|
||||||
}
|
}
|
||||||
this.youQuan.id = 0;
|
this.youQuan.id = 0;
|
||||||
this.youQuan.youPrice = 0;
|
this.youQuan.youPrice = 0;
|
||||||
this.allPrice = this.zanAllPrice + this.expressInfo.default_price;
|
this.allPrice = (this.zanAllPrice*1 - this.expressInfo.default_price*1).toFixed(2);
|
||||||
this.checkQuan();
|
this.checkQuan();//查询可用优惠券事件
|
||||||
|
}
|
||||||
},
|
},
|
||||||
checkQuan(){//查询可用优惠券事件
|
checkQuan(){//查询可用优惠券事件
|
||||||
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
|
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
|
||||||
|
@ -360,14 +638,26 @@
|
||||||
chooseQuan(index){//选择可用优惠券事件
|
chooseQuan(index){//选择可用优惠券事件
|
||||||
if(this.zanAllPrice <= this.quanList[index].manPrice){//如果满减大于合计
|
if(this.zanAllPrice <= this.quanList[index].manPrice){//如果满减大于合计
|
||||||
this.$toolAll.tools.showToast('未达到使用条件')
|
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 {
|
} else {
|
||||||
this.quanList.forEach(item=>{
|
this.quanList.forEach(item=>{
|
||||||
item.isStatus = false;
|
item.isStatus = false;
|
||||||
});
|
});
|
||||||
this.quanList[index].isStatus = true;
|
this.quanList[index].isStatus = true;
|
||||||
this.showQuan = false;
|
this.showQuan = false;
|
||||||
|
this.quanList[index].youPrice = this.$toolAll.tools.addXiaoShu(this.quanList[index].youPrice);
|
||||||
this.youQuan = this.quanList[index];
|
this.youQuan = this.quanList[index];
|
||||||
this.allPrice = this.zanAllPrice - this.quanList[index].youPrice + this.expressInfo.default_price;//合计 = 暂存合计 - 选中的优惠券
|
this.allPrice = this.zanAllPrice*1 - this.quanList[index].youPrice*1 + this.expressInfo.default_price*1;//合计 = 暂存合计 - 选中的优惠券
|
||||||
|
this.allPrice = this.allPrice.toFixed(2)*1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
goCoupon(){//去领取优惠券
|
goCoupon(){//去领取优惠券
|
||||||
|
@ -381,8 +671,20 @@
|
||||||
},
|
},
|
||||||
blurEv(){//失去焦点
|
blurEv(){//失去焦点
|
||||||
this.isFocus = false;
|
this.isFocus = false;
|
||||||
|
},
|
||||||
|
goDetail(){//去订单列表
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pagesA/myOrder/myOrder'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goShop(){//逛一逛
|
||||||
|
let nurl = '';
|
||||||
|
if(this.isNei==3) nurl = '/pagesA/pointsMall/pointsMall';
|
||||||
|
else nurl = '/pages/tabbar/shop/shop';
|
||||||
|
uni.reLaunch({
|
||||||
|
url:nurl
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -41,7 +41,8 @@
|
||||||
<view v-if="item.num!=0">余{{item.num}}</view>
|
<view v-if="item.num!=0">余{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon28 col3 dao-box">请在<span class="colf8 bold">23时25分36秒</span>完成支付</view>
|
<view v-if="isGuo" class="fon28 col3 dao-box">该订单已过期</view>
|
||||||
|
<view v-else class="fon28 col3 dao-box">请在<span class="colf8 bold">{{daoTime}}</span>完成支付</view>
|
||||||
<!-- 确认支付 -->
|
<!-- 确认支付 -->
|
||||||
<view @tap="payment" class="submit-pay">确认支付</view>
|
<view @tap="payment" class="submit-pay">确认支付</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -77,7 +78,9 @@
|
||||||
isKq:false,
|
isKq:false,
|
||||||
jsPrice:0,//结算时的金额,
|
jsPrice:0,//结算时的金额,
|
||||||
zc_allPrice:0,//暂存实际总金额
|
zc_allPrice:0,//暂存实际总金额
|
||||||
orderInfo:uni.getStorageSync('orderInfo')
|
orderInfo:uni.getStorageSync('orderInfo'),
|
||||||
|
daoTime:'',//支付倒计时
|
||||||
|
isGuo:false//是否过期
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -90,44 +93,76 @@
|
||||||
this.zc_allPrice = this.zf_allPrice = options.allPrice;
|
this.zc_allPrice = this.zf_allPrice = options.allPrice;
|
||||||
this.zf_allPrice = this.$toolAll.tools.addXiaoShu(this.zf_allPrice);
|
this.zf_allPrice = this.$toolAll.tools.addXiaoShu(this.zf_allPrice);
|
||||||
this.zf_allNum = options.allNum;
|
this.zf_allNum = options.allNum;
|
||||||
|
let endTime = this.orderInfo.expired_at;
|
||||||
|
let endChuo = new Date(this.orderInfo.expired_at).getTime();
|
||||||
|
this.daoTime = this.$toolAll.tools.dayTime(endTime,options.startTime);
|
||||||
|
let timer = setInterval(()=>{
|
||||||
|
if(options.startTime - endChuo>=0){
|
||||||
|
this.isGuo = true;
|
||||||
|
clearInterval(timer);
|
||||||
|
} else {
|
||||||
|
options.startTime = options.startTime*1 + 1000;
|
||||||
|
this.daoTime = this.$toolAll.tools.dayTime(endTime,options.startTime)
|
||||||
|
}
|
||||||
|
},1000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
chooseFS(index){
|
chooseFS(index){
|
||||||
this.payFS[index].isActive = !this.payFS[index].isActive;
|
this.payFS[index].isActive = !this.payFS[index].isActive;
|
||||||
if(index==0){
|
if(index==0){
|
||||||
if(this.payFS[0].isActive && this.payFS[1].isActive){//选择了微信支付+选择了孔雀币
|
//选择了微信支付+选择了孔雀币
|
||||||
|
if(this.payFS[0].isActive && this.payFS[1].isActive){
|
||||||
this.isKq = true;
|
this.isKq = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this.payFS[0].isActive && this.payFS[1].isActive){//取消了微信支付+选择了孔雀币
|
//取消了微信支付+选择了孔雀币
|
||||||
|
if(!this.payFS[0].isActive && this.payFS[1].isActive){
|
||||||
this.$toolAll.tools.showToast('孔雀币不足');
|
this.$toolAll.tools.showToast('孔雀币不足');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){//取消了微信支付+取消了孔雀币
|
//取消了微信支付+取消了孔雀币
|
||||||
|
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||||
this.$toolAll.tools.showToast('请选择支付方式');
|
this.$toolAll.tools.showToast('请选择支付方式');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//选择了微信支付+选择了孔雀币
|
||||||
|
if(this.payFS[0].isActive && this.payFS[1].isActive){
|
||||||
|
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
||||||
|
this.zf_kqPrice = this.payFS[index].num;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(index==1) {
|
if(index==1) {
|
||||||
if(this.payFS[0].isActive && this.payFS[1].isActive) {//选择了微信支付+选择了孔雀币
|
//选择了微信支付+选择了孔雀币
|
||||||
|
if(this.payFS[0].isActive && this.payFS[1].isActive) {
|
||||||
this.isKq = true;
|
this.isKq = true;
|
||||||
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
||||||
this.zf_kqPrice = this.payFS[index].num;
|
this.zf_kqPrice = this.payFS[index].num;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.payFS[0].isActive && !this.payFS[1].isActive) {//选择了微信支付+取消了孔雀币
|
//选择了微信支付+取消了孔雀币
|
||||||
|
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
|
||||||
this.isKq = false;
|
this.isKq = false;
|
||||||
this.zf_allPrice = this.zc_allPrice;
|
this.zf_allPrice = this.zc_allPrice;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){//取消了微信支付+选择了孔雀币+孔雀币不足以抵扣应付款
|
//取消了微信支付+选择了孔雀币+孔雀币不足以抵扣应付款
|
||||||
|
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){
|
||||||
this.$toolAll.tools.showToast('孔雀币不足')
|
this.$toolAll.tools.showToast('孔雀币不足')
|
||||||
this.isKq = true;
|
this.isKq = true;
|
||||||
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
||||||
this.zf_kqPrice = this.payFS[index].num;
|
this.zf_kqPrice = this.payFS[index].num;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){//取消了微信支付+取消了孔雀币
|
//取消了微信支付+选择了孔雀币+孔雀币足以抵扣应付款
|
||||||
|
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 < this.zf_kqPrice*1){
|
||||||
|
this.isKq = true;
|
||||||
|
this.zf_allPrice = this.zc_allPrice - this.payFS[index].num;
|
||||||
|
this.zf_kqPrice = this.payFS[index].num;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//取消了微信支付+取消了孔雀币
|
||||||
|
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||||
this.$toolAll.tools.showToast('请选择支付方式')
|
this.$toolAll.tools.showToast('请选择支付方式')
|
||||||
this.isKq = false;
|
this.isKq = false;
|
||||||
this.zf_allPrice = this.zc_allPrice;
|
this.zf_allPrice = this.zc_allPrice;
|
||||||
|
|
|
@ -5,21 +5,21 @@
|
||||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3">
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3">
|
||||||
<view class="mar-s20 bacf pad20 radius20 bold">
|
<view class="mar-s20 bacf pad20 radius20 bold">
|
||||||
<view class="mar-x30">当前积分</view>
|
<view class="mar-x30">当前积分</view>
|
||||||
<view style="font-size: 56rpx;">3000</view>
|
<view style="font-size: 56rpx;">{{dangScore}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mar-s20 disjbac">
|
<view class="mar-s20 disjbac">
|
||||||
<view class="disjbac pad20 bacf radius20" style="width: 48%;box-sizing: border-box;">
|
<view class="disjbac pad20 bacf radius20 width48" style="box-sizing: border-box;">
|
||||||
<image src="../../static/public/integral-01-108.png" style="width: 108rpx;height: 108rpx;flex-shrink: 0;" mode=""></image>
|
<image src="../../static/public/integral-01-108.png" class="score-img" mode=""></image>
|
||||||
<view class="width100" style="display: flex;justify-content: space-between;flex-direction: column;height: 108rpx;">
|
<view class="width100 score-people-box">
|
||||||
<view style="font-weight: 400;">我的分享人</view>
|
<view class="font4">我的分享人</view>
|
||||||
<view class="fon36 bold">100 <span style="font-size: 26rpx;font-weight: 400;">人</span></view>
|
<view class="fon36 bold">{{sharePeople}}<span class="fon26 font4">人</span></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac pad20 bacf radius20" style="width: 48%;box-sizing: border-box;">
|
<view class="disjbac pad20 bacf radius20" style="box-sizing: border-box;">
|
||||||
<image src="../../static/public/integral-02-108.png" style="width: 108rpx;height: 108rpx;flex-shrink: 0;" mode=""></image>
|
<image src="../../static/public/integral-02-108.png" class="score-img" mode=""></image>
|
||||||
<view class="disjbac fc width100"style="display: flex;justify-content: space-between;flex-direction: column;height: 108rpx;">
|
<view class="width100 score-people-box">
|
||||||
<view style="font-weight: 400;">签到记录</view>
|
<view class="font4">签到记录</view>
|
||||||
<view style="width: 140rpx;height: 40rpx;line-height: 40rpx;text-align: center;color: #FFFFFF;background: #F6C338;border-radius: 30rpx;font-size: 24rpx;font-weight: 400;">立即签到</view>
|
<view @tap="goSigin" class="score-sigin-btn">立即签到</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -30,20 +30,23 @@
|
||||||
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">消费列表</view>
|
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">消费列表</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 积分列表 -->
|
<!-- 积分列表 -->
|
||||||
|
<block v-if="dataList.length!=0">
|
||||||
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
||||||
<view>
|
<view>
|
||||||
<view class="fon26 col3">{{item.title}}</view>
|
<view class="fon26 col3">{{item.title}}</view>
|
||||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="activeJF" class="fon36 bold" style="color: #3875F6;">+{{item.num}}</view>
|
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
|
||||||
<view v-show="!activeJF" class="fon36 bold">-{{item.num}}</view>
|
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
</block>
|
||||||
|
<view v-if="isHave" class="disjcac fon24 col9 bold">暂无更多列表信息</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分享按钮 -->
|
<!-- 分享按钮 -->
|
||||||
<view class="disjcac" style="width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);">
|
<view class="disjcac score-share-box">
|
||||||
<image src="/static/public/bottom-shear.png" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
<image src="/static/public/bottom-shear.png" mode=""></image>
|
||||||
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
||||||
<button class="posia" open-type="share" style="top: 0;left: 0;right: 0;bottom: 0;opacity: 0;"></button>
|
<button class="posia-op" open-type="share"></button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -57,32 +60,78 @@
|
||||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
activeJF:true,
|
activeJF:true,
|
||||||
dataList:[
|
dataList:[
|
||||||
{title:'签到兑换',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'签到兑换',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'分享注册',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'分享注册',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'二级分销',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'二级分销',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
]
|
],
|
||||||
|
dangScore:0,//当前积分
|
||||||
|
sharePeople:0,//我的分享人
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:0,
|
||||||
|
isZanw:true,
|
||||||
|
ntype:'in',
|
||||||
|
isHave:false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.total!=this.dataList.length){
|
||||||
|
this.page++
|
||||||
|
this.checkList(this.ntype)//调用自主预约列表事件
|
||||||
|
} else {
|
||||||
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
|
||||||
|
this.isZanw = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.checkInfo();
|
||||||
|
this.checkList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchState(flag){
|
checkList(){//查询积分列表
|
||||||
this.activeJF = flag;
|
this.$requst.post('user/score-log',{page:this.page,size:this.size,type:this.ntype}).then(res=>{
|
||||||
if(flag) {
|
if(res.code==0){
|
||||||
this.dataList = [
|
if(this.page==1) this.dataList = [];
|
||||||
{title:'签到兑换',time:'2021.09.06 10:30:10',num:'1'},
|
this.total = res.data.total;
|
||||||
{title:'分享注册',time:'2021.09.06 10:30:10',num:'1'},
|
if(res.data.list.length!=0){
|
||||||
{title:'二级分销',time:'2021.09.06 10:30:10',num:'1'},
|
res.data.list.forEach(item=>{
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
let obj = {
|
||||||
]
|
title:item.name,
|
||||||
} else {
|
time:item.created_at,
|
||||||
this.dataList = [
|
num:item.num
|
||||||
{title:'兑换商品',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
{title:'商品购买',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
this.dataList.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(this.dataList.length==0)this.isHave = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkInfo(){//查询个人积分信息
|
||||||
|
this.$requst.post('user/score-load').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.dangScore = res.data.score;
|
||||||
|
this.sharePeople = res.data.share.total;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchState(flag){//切换事件
|
||||||
|
this.dataList = [];
|
||||||
|
this.activeJF = flag;
|
||||||
|
this.page =1;
|
||||||
|
this.isZanw = true;
|
||||||
|
if(flag) {
|
||||||
|
this.ntype ='in';
|
||||||
|
this.checkList(this.ntype);
|
||||||
|
} else {
|
||||||
|
this.ntype ='out';
|
||||||
|
this.checkList(this.ntype);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goSigin(){
|
||||||
|
uni.navigateTo({url:'/pagesA/signIn/signIn'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,15 +41,15 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="fon30 bold tc mar-s50 mar-x30" :style="{color:publicColor}">积分兑换</view>
|
<view class="fon30 bold tc mar-s50 mar-x30" :style="{color:publicColor}">积分兑换</view>
|
||||||
</view>
|
</view>
|
||||||
<shopList :dataList="dataList"></shopList>
|
<scoreList :dataList="dataList"></scoreList>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import shopList from '@/components/shop-list.vue';
|
import scoreList from '@/components/score-list.vue';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
shopList
|
scoreList
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -63,88 +63,63 @@
|
||||||
{src:'/static/public/te-quan50.png',title:'特权日'},
|
{src:'/static/public/te-quan50.png',title:'特权日'},
|
||||||
{src:'/static/public/share-hai50.png',title:'分享海报'},
|
{src:'/static/public/share-hai50.png',title:'分享海报'},
|
||||||
],
|
],
|
||||||
dataList:[
|
dataList:[]
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:true,
|
|
||||||
grade:0,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.checkList();
|
||||||
|
this.checkInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkInfo(){
|
||||||
|
this.$requst.post('level/index').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkList(){//查询列表事件
|
||||||
|
let params = {
|
||||||
|
keyword:'',//商品关键字 支持模糊搜索
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
type:'normal',//type=normal综合 newest=最新
|
||||||
|
sort_field:'',//排序字段 score=积分 num=兑换量
|
||||||
|
sort_value:''//排序值 asc=升序 desc=降序
|
||||||
|
}
|
||||||
|
this.$requst.post('spu/score',params).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.dataList = [];
|
||||||
|
if(res.data.list.length!=0){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
id:item.id,
|
||||||
|
imgSrc: this.$http + item.cover,
|
||||||
|
saleable:item.saleable,//是否下架
|
||||||
|
stock:item.stock,//库存
|
||||||
|
title: item.name,
|
||||||
|
zhePrice:item.price,
|
||||||
|
yuanPrice:item.original_price,
|
||||||
|
integral:item.score,
|
||||||
|
isTuan:false,
|
||||||
|
isPing:false,
|
||||||
|
isXian:false,
|
||||||
|
isIntegral:true,
|
||||||
|
grade:item.level_id,
|
||||||
|
published_at:item.published_at,//发布时间
|
||||||
|
amount:item.amount,//销量
|
||||||
|
level_text:item.level_text//会员限制提示 如青铜会员可购买
|
||||||
|
}
|
||||||
|
this.dataList.push(obj)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast('暂无更多积分商品')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,21 +4,21 @@
|
||||||
<status-nav :titleVal="'地址管理'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'地址管理'" :statusTitle="true"></status-nav>
|
||||||
<view :style="{paddingTop:statusHNH+'px'}" class="mar-sx20 pad-zy32" style="padding-bottom: 150rpx;">
|
<view :style="{paddingTop:statusHNH+'px'}" class="mar-sx20 pad-zy32" style="padding-bottom: 150rpx;">
|
||||||
<view v-if="loading">
|
<view v-if="loading">
|
||||||
<view v-for="(item,index) in dataList" :key="index" class="bacf radius20 pad20 mar-x20">
|
<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="pad-y20 disjbac">
|
||||||
<view class="fon28 col3 bold">{{item.userName}} {{item.userPhone}}</view>
|
<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>
|
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
|
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
|
||||||
<view class="disjbac fon28 col3 mar-s32">
|
<view class="disjbac fon28 col3 mar-s32">
|
||||||
<view @tap="setMo(index)" class="disac">
|
<view @tap.stop="setMo(index)" class="disac">
|
||||||
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
<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>
|
<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="mar-z10" :class="item.isActive?'':'col9'">设为默认地址</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disac" style="color: #808080;">
|
<view class="disac" style="color: #808080;">
|
||||||
<view @tap="editAddress(index)">编辑</view>
|
<view @tap.stop="editAddress(index)">编辑</view>
|
||||||
<view @tap="delAddress(index)" class="mar-y10 mar-z50">删除</view>
|
<view @tap.stop="delAddress(index)" class="mar-y10 mar-z50">删除</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="fon26 col9 mar-s30">手机号码</view>
|
<view class="fon26 col9 mar-s30">手机号码</view>
|
||||||
<view class="bbot mar-s30 pad-x10">
|
<view class="bbot mar-s30 pad-x10">
|
||||||
<input type="text" class="width100" v-model="userPhone" placeholder="请输入联系电话" />
|
<input type="num" maxlength="11" class="width100" v-model="userPhone" placeholder="请输入联系电话" />
|
||||||
</view>
|
</view>
|
||||||
<view class="fon26 col9 mar-s30">地址</view>
|
<view class="fon26 col9 mar-s30">地址</view>
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
|
@ -109,7 +109,8 @@
|
||||||
cityArr:[],
|
cityArr:[],
|
||||||
countyArr:[],
|
countyArr:[],
|
||||||
isAddress:0,
|
isAddress:0,
|
||||||
isWhere:1
|
isWhere:1,
|
||||||
|
isMo:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -120,8 +121,15 @@
|
||||||
this.isWhere = options.isWhere;
|
this.isWhere = options.isWhere;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
goBack(index){//返回到订单准备页
|
||||||
|
if(this.isWhere==0) {
|
||||||
|
uni.setStorageSync('chooseAddress',this.dataList[index]);
|
||||||
|
uni.navigateBack({delta:1})
|
||||||
|
}
|
||||||
|
},
|
||||||
obtainLngLat(){//添加地址事件
|
obtainLngLat(){//添加地址事件
|
||||||
this.idEdit = true;
|
this.idEdit = true;
|
||||||
|
this.isMo = 0;
|
||||||
this.clearAll();
|
this.clearAll();
|
||||||
// 获取当前位置的经纬度
|
// 获取当前位置的经纬度
|
||||||
wx.getLocation({
|
wx.getLocation({
|
||||||
|
@ -223,13 +231,14 @@
|
||||||
city:item.city_str,
|
city:item.city_str,
|
||||||
county:item.county_str,
|
county:item.county_str,
|
||||||
address:item.address,
|
address:item.address,
|
||||||
isActive:newActive
|
isActive:newActive,
|
||||||
|
is_default:item.is_default
|
||||||
}
|
}
|
||||||
this.dataList.push(obj);
|
this.dataList.push(obj);
|
||||||
})
|
})
|
||||||
this.loading = true;
|
|
||||||
this.checkActive();
|
this.checkActive();
|
||||||
}
|
}
|
||||||
|
this.loading = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -260,7 +269,7 @@
|
||||||
city_str:this.userCity,//市
|
city_str:this.userCity,//市
|
||||||
county_str:this.userCounty,//区
|
county_str:this.userCounty,//区
|
||||||
address:this.userAddress,
|
address:this.userAddress,
|
||||||
is_default:1//是否默认
|
is_default:this.isMo//是否默认
|
||||||
}
|
}
|
||||||
this.$requst.post('user/address-save',params).then(res=>{
|
this.$requst.post('user/address-save',params).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
@ -298,10 +307,8 @@
|
||||||
item.isActive = false;
|
item.isActive = false;
|
||||||
});
|
});
|
||||||
this.dataList[index].isActive = true;
|
this.dataList[index].isActive = true;
|
||||||
|
this.dataList[index].is_default = 1;
|
||||||
this.checkActive();
|
this.checkActive();
|
||||||
if(this.isWhere==0) {
|
|
||||||
uni.navigateBack({delta:1})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -314,6 +321,7 @@
|
||||||
this.userCity = this.dataList[index].city;
|
this.userCity = this.dataList[index].city;
|
||||||
this.userCounty = this.dataList[index].county;
|
this.userCounty = this.dataList[index].county;
|
||||||
this.userAddress = this.dataList[index].address;
|
this.userAddress = this.dataList[index].address;
|
||||||
|
this.isMo = this.dataList[index].is_default
|
||||||
},
|
},
|
||||||
delAddress(index){//删除地址事件
|
delAddress(index){//删除地址事件
|
||||||
this.delNum++
|
this.delNum++
|
||||||
|
|
|
@ -3,52 +3,63 @@
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :titleVal="'订单管理'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'订单管理'" :statusTitle="true"></status-nav>
|
||||||
<!-- 自定义二级分类 -->
|
<!-- 自定义二级分类 -->
|
||||||
<view class="isTopf bacf" :style="{top:statusHNH+'px'}">
|
<view class="isTopf bacf pad-zy30" :style="{top:statusHNH+'px'}">
|
||||||
<scroll-view scroll-x>
|
<scroll-view scroll-x>
|
||||||
<view id="daoh" class="disjbac pad-s20 mar-zy30">
|
<view id="daoh" class="disjbac pad-s20">
|
||||||
<view @tap="chooseNav(indexn)" class="posir pad-s20 pad-zy20 pad-x30 flexs mar-y10" style="text-align: center;" :class="activeIndex==indexn?'activeD':''" :style="{color:activeIndex==indexn?'#3875F6':'#000000'}" v-for="(itemn,indexn) in statusList" :key="indexn">{{itemn}}</view>
|
<view @tap="chooseNav(indexn)" class="posir pad-s20 pad-zy20 pad-x30 flexs mar-y10" style="text-align: center;" :class="activeIndex==indexn?'activeD':''" :style="{color:activeIndex==indexn?'#3875F6':'#000000'}" v-for="(itemn,indexn) in statusList" :key="indexn">{{itemn}}</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{paddingTop:(statusHNH+12+chuTop)+'px'}" class="pad-sx20 pad-zy32">
|
<view :style="{paddingTop:(statusHNH+12+chuTop)+'px'}" class="pad-sx20 pad-zy32">
|
||||||
<view v-for="(item,index) in orderList" :key="index" class="radius20 bacf pad20 mar-x20 order-item-box">
|
<view v-if="orderList.length!=0" v-for="(item,index) in orderList" :key="index" class="radius20 bacf pad20 mar-x20 order-item-box">
|
||||||
<view class="bbot disjbac pad-x20 mar-x20"><view class="fon28 col3 bold">{{item.isShop==0?'商城订单':'积分商城订单'}}</view><view class="fon24 col9">{{item.establish}}</view></view>
|
<view @tap="goDetail(item.id)" class="bbot disjbac pad-x20 mar-x20"><view class="fon28 col3 bold">{{item.isShop==0?'商城订单':'积分商城订单'}}</view><view class="fon24 col9">{{item.establish}}</view></view>
|
||||||
<view class="disjbac fon24"><view class="col3">订单号:{{item.orderNum}}</view><view class="bold" :class="(item.orderStatus==1 || item.orderStatus==2 || item.orderStatus==3) ? 'colf8':'col9'">{{['','待付款','待发货','待核验','待收货','交易完成'][item.orderStatus]}}</view></view>
|
<view @tap="goDetail(item.id)" class="disjbac fon24">
|
||||||
|
<view class="col3">订单号:{{item.orderNum}}</view>
|
||||||
|
<view v-if="item.virtual_check==0" class="bold" :class="(item.orderStatus==1 || item.orderStatus==2 || item.orderStatus==3) ? 'colf8':'col9'">{{['','待付款','待发货','待核验','待收货','交易完成'][item.orderStatus]}}</view>
|
||||||
|
<view v-if="item.virtual_check==1" class="bold col9">已核验</view>
|
||||||
|
</view>
|
||||||
<view v-for="(itemc,indexc) in item.childrenList" :key="indexc" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
<view v-for="(itemc,indexc) in item.childrenList" :key="indexc" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
<image @tap="goDetail(item.id)" :src="itemc.imgSrc" class="flexs" mode="aspectFill"></image>
|
||||||
<image :src="itemc.imgSrc" class="flexs" mode="aspectFill"></image>
|
<view @tap="goDetail(item.id)" class="width100 disjb fc" style="height: 166rpx;">
|
||||||
</navigator>
|
|
||||||
<view class="width100 disjb fc" style="height: 166rpx;">
|
|
||||||
<view>
|
<view>
|
||||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
|
||||||
<view class="fon28 col3 bold clips2">{{itemc.title}}</view>
|
<view class="fon28 col3 bold clips2">{{itemc.title}}</view>
|
||||||
</navigator>
|
<view class="order-sy">{{itemc.sku_name}}</view>
|
||||||
<view class="order-sy">试用</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-s10">
|
<view class="disjbac mar-s10">
|
||||||
<view class="colf8 fon32 bold"><span v-if="item.isShop==0">¥</span>{{itemc.price}}</view>
|
<view class="colf8 fon32 bold"><span v-if="item.isShop==0">¥</span><span v-else>积分:</span>{{itemc.price}}<span class="fon28 col6 mar-z20 font4">x{{itemc.num}}</span></view>
|
||||||
<view class="fon28 col6 mar-y40">x{{itemc.num}}</view>
|
<view @tap.stop="make(index,indexc)" v-if="item.orderStatus == 3 && item.virtual_check==0" class="order-btn">线下核销</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon28 col3 pad-s20 disjbac">
|
<!-- <view class="fon28 col3 pad-s20 disjbac">
|
||||||
<view class="flexs"><span v-if="item.isShop==0">合计:{{item.total}}.00</span><span v-else>合计积分:{{item.total}}</span></view>
|
<view class="flexs"><span v-if="item.isShop==0">合计:<span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> +<span v-if="item.coin!=0">{{item.coin}}孔雀币</span></span><span v-else>合计积分:{{item.total}}</span></view>
|
||||||
<view class="width100 disac" style="justify-content: flex-end;">
|
<view class="width100 disac" style="justify-content: flex-end;">
|
||||||
<view @tap="isCancle=true" v-if="item.orderStatus != 0 && item.orderStatus != 5" class="order-cancle">取消订单</view>
|
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5" class="order-cancle">取消订单</view>
|
||||||
<view v-if="item.orderStatus == 1" class="order-btn">付款</view>
|
<view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn">付款</view>
|
||||||
<view @tap="isHeyan=true" v-if="item.orderStatus == 3" class="order-btn">线下核销</view>
|
<view @tap="isHeyan=true" v-if="item.orderStatus == 3" class="order-btn">线下核销</view>
|
||||||
<!-- <view class="order-btn">单人拼团</view> -->
|
<view class="order-btn">单人拼团</view>
|
||||||
|
<view @tap="confirmReceipt(item.id)" v-if="item.orderStatus == 4" class="order-btn">确认收货</view>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="fon28 col3">
|
||||||
|
<view class="mar-sx20 disje"><span v-if="item.isShop==0">合计:<span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> <span v-if="item.coin!=0">+{{item.coin}}孔雀币</span></span><span v-else>合计积分:{{item.total}}</span></view>
|
||||||
|
<view class="width100 disje">
|
||||||
|
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5 && item.virtual_check==0" class="order-cancle">取消订单</view>
|
||||||
|
<view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn">付款</view>
|
||||||
|
<view class="order-btn" v-if="item.is_only==1">单人拼团</view>
|
||||||
<view @tap="confirmReceipt(item.id)" v-if="item.orderStatus == 4" class="order-btn">确认收货</view>
|
<view @tap="confirmReceipt(item.id)" v-if="item.orderStatus == 4" class="order-btn">确认收货</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<nothing-page v-if="orderList.length==0" :content="`暂无更多订单列表`"></nothing-page>
|
||||||
</view>
|
</view>
|
||||||
<!-- 待核验弹框 -->
|
<!-- 待核验弹框 -->
|
||||||
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;">
|
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;">
|
||||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
||||||
<view class="fon28 col3">订单二维码</view>
|
<view class="fon28 col3">订单二维码</view>
|
||||||
<view class="mar-sx30">
|
<view class="mar-sx30">
|
||||||
<image src="/static/public/member-head.png" style="width: 325rpx;height: 325rpx;" mode=""></image>
|
<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>
|
||||||
<view class="fon24 col3">
|
<view class="fon24 col3">
|
||||||
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
||||||
|
@ -63,10 +74,10 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="bbot pad-sx20 posir">
|
<view class="bbot pad-sx20 posir">
|
||||||
<view class="fon28 bold col3 width100" style="text-align: center;">取消订单</view>
|
<view class="fon28 bold col3 width100" style="text-align: center;">取消订单</view>
|
||||||
<image class="posia" @tap.stop="isCancle=false" src="/static/public/cha-close.png" style="width: 40rpx;height: 40rpx;right: 50rpx;top: 20rpx;" mode="aspectFill"></image>
|
<image class="posia order-close-btn" @tap.stop="isCancle=false" src="/static/public/cha-close.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="pad-zy32 pad-sx20" style="color: #5B5B5B;">
|
<view class="pad-zy32 pad-sx20 col5b">
|
||||||
<view class="fon24" style="line-height: 40rpx;">
|
<view class="fon24 linh40">
|
||||||
<view>温馨提示:</view>
|
<view>温馨提示:</view>
|
||||||
<view>订单取消需要提交工作人员审核,商品金额将原路径返还账户,订单一旦取消,系统无法恢复。</view>
|
<view>订单取消需要提交工作人员审核,商品金额将原路径返还账户,订单一旦取消,系统无法恢复。</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -85,7 +96,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||||
export default {
|
export default {
|
||||||
|
components:{
|
||||||
|
yzQr
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusHNH:uni.getStorageSync('statusHNH'),
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
|
@ -101,72 +116,36 @@
|
||||||
],
|
],
|
||||||
isHeyan:false,//是否线下审核
|
isHeyan:false,//是否线下审核
|
||||||
isCancle:false,//是否取消订单
|
isCancle:false,//是否取消订单
|
||||||
orderList:[
|
orderList:[],
|
||||||
{
|
|
||||||
id:1,
|
|
||||||
establish:'2021-09-06 20:30',//创建时间
|
|
||||||
orderNum:'1234567890',//订单号
|
|
||||||
childrenList:[
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
],
|
|
||||||
orderStatus:5,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
|
||||||
isShop:0,//0 商城订单,1 积分商城订单
|
|
||||||
total: 15552//合计
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:2,
|
|
||||||
establish:'2021-09-06 20:30',//创建时间
|
|
||||||
orderNum:'1234567890',//订单号
|
|
||||||
childrenList:[
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
],
|
|
||||||
orderStatus:3,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
|
||||||
isShop:0,//0 商城订单,1 积分商城订单
|
|
||||||
total: 15552//合计
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:3,
|
|
||||||
establish:'2021-09-06 20:30',//创建时间
|
|
||||||
orderNum:'1234567890',//订单号
|
|
||||||
childrenList:[
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
],
|
|
||||||
orderStatus:4,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
|
||||||
isShop:0,//0 商城订单,1 积分商城订单
|
|
||||||
total: 15552//合计
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:4,
|
|
||||||
establish:'2021-09-06 20:30',//创建时间
|
|
||||||
orderNum:'1234567890',//订单号
|
|
||||||
childrenList:[
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】100美人',price:3888,num:2},
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
],
|
|
||||||
orderStatus:1,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
|
||||||
isShop:0,//0 商城订单,1 积分商城订单
|
|
||||||
total: 15552//合计
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:5,
|
|
||||||
establish:'2021-09-06 20:30',//创建时间
|
|
||||||
orderNum:'1234567890',//订单号
|
|
||||||
childrenList:[
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
{imgSrc:'/static/public/member-head.png',title:'【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人1000单位FUE技术案例招募门美人',price:3888,num:2},
|
|
||||||
],
|
|
||||||
orderStatus:2,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
|
||||||
isShop:1,//0 商城订单,1 积分商城订单
|
|
||||||
total: 15552//合计
|
|
||||||
}
|
|
||||||
],
|
|
||||||
zanList:[],//暂存列表数据
|
zanList:[],//暂存列表数据
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:'',//总数
|
||||||
|
isZanw:true,
|
||||||
|
tag:'',//默认全部 waiting=待付款 paid=已付款待发货 shipped=已发货 completed=已完成 check=待核验
|
||||||
|
current:0,//选中的订单
|
||||||
|
remarks:'',//原因
|
||||||
|
times:0,//点击次数
|
||||||
|
canvasQrPath: '',
|
||||||
|
text: 'hello',
|
||||||
|
size: 162,
|
||||||
|
colorDark: '#000000',
|
||||||
|
colorLight: '#ffffff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.total!=this.orderList.length){
|
||||||
|
this.page++
|
||||||
|
this.checkList(this.activeIndex)//调用自主预约列表事件
|
||||||
|
} else {
|
||||||
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
|
||||||
|
this.isZanw = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.checkZT(this.activeIndex);
|
||||||
|
this.checkList(this.activeIndex);
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const query = wx.createSelectorQuery()
|
const query = wx.createSelectorQuery()
|
||||||
|
@ -175,15 +154,89 @@
|
||||||
this.chuTop = rect.height
|
this.chuTop = rect.height
|
||||||
}).exec()
|
}).exec()
|
||||||
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
|
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
|
||||||
this.zanList = this.orderList;
|
|
||||||
this.checkList(this.activeIndex);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
make(index,index2){
|
||||||
|
this.isHeyan = true;
|
||||||
|
this.text = `${this.orderList[index].orderNum},${this.orderList[index].childrenList[index2].id}`;
|
||||||
|
console.log(this.text);
|
||||||
|
// var that = this;
|
||||||
|
// setTimeout(function() {
|
||||||
|
// that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
|
||||||
|
// console.log('获取二维码地址:', that.canvasQrPath)
|
||||||
|
// }, 1000)
|
||||||
|
},
|
||||||
|
checkZT(index){
|
||||||
|
if(index==0){this.tag=""}
|
||||||
|
if(index==1){this.tag="waiting"}
|
||||||
|
if(index==2){this.tag="paid"}
|
||||||
|
if(index==3){this.tag="check"}
|
||||||
|
if(index==4){this.tag="shipped"}
|
||||||
|
if(index==5){this.tag="completed"}
|
||||||
|
},
|
||||||
chooseNav(index){
|
chooseNav(index){
|
||||||
|
this.page =1;
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
this.checkList(index)
|
this.checkZT(index);
|
||||||
|
this.checkList(index);
|
||||||
},
|
},
|
||||||
checkList(index){//查询订单列表
|
checkList(index){//查询订单列表
|
||||||
|
this.$requst.post('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.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" && item.has_virtual==0) {
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
nchildren.push(objs);
|
||||||
|
})
|
||||||
|
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,//是否单独购买
|
||||||
|
virtual_check:item.virtual_check
|
||||||
|
}
|
||||||
|
this.orderList.push(obj);
|
||||||
|
})
|
||||||
|
this.zanList = this.orderList;
|
||||||
if(index==0) {
|
if(index==0) {
|
||||||
this.orderList = this.zanList;
|
this.orderList = this.zanList;
|
||||||
} else {
|
} else {
|
||||||
|
@ -191,25 +244,81 @@
|
||||||
return item.orderStatus==index;
|
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);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
hexiaoEv(){//核销事件
|
||||||
|
this.$requst.post('order/check').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
transferFrame(index){//调起取消原因弹框
|
||||||
|
this.isCancle = true;
|
||||||
|
this.current = index;
|
||||||
|
this.reasonList.forEach(item=>{
|
||||||
|
item.isActive = false;
|
||||||
|
})
|
||||||
|
this.reasonList[0].isActive = true;
|
||||||
},
|
},
|
||||||
chooseReason(index){//取消订单原因选择事件
|
chooseReason(index){//取消订单原因选择事件
|
||||||
this.reasonList.forEach(item=>item.isActive = false);
|
this.reasonList.forEach(item=>item.isActive = false);
|
||||||
this.reasonList[index].isActive = true;
|
this.reasonList[index].isActive = true;
|
||||||
|
this.remarks = this.reasonList[index].title;
|
||||||
},
|
},
|
||||||
confirmEv(){//确认取消订单事件
|
confirmEv(){//确认取消订单事件
|
||||||
|
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=>{
|
||||||
|
if(res.code==0){
|
||||||
this.isCancle = false;
|
this.isCancle = false;
|
||||||
let con = '';
|
this.orderList.splice(this.current,1);
|
||||||
this.reasonList.forEach(item=>{
|
this.page = 1;
|
||||||
if(item.isActive) con = item.title;
|
this.checkList(this.activeIndex);
|
||||||
|
this.$toolAll.tools.showToast('取消成功');
|
||||||
|
this.times = 0;
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
confirmReceipt(id){//确认收货事件
|
confirmReceipt(id){//确认收货事件
|
||||||
console.log(id);
|
|
||||||
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
|
||||||
} else this.$toolAll.tools.showToast(res.msg);
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
goDetail(id){//去订单详情
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/orderDetail/orderDetail?id=${id}`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
<view>
|
<view>
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :titleVal="'孔雀币管理'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'孔雀币管理'" :statusTitle="true"></status-nav>
|
||||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3">
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3 pad-x180">
|
||||||
<view class="mar-s20 bacf pad20 radius20">
|
<view class="mar-s20 bacf pad20 radius20">
|
||||||
<view class="mar-x30">当前孔雀币</view>
|
<view class="mar-x30">当前孔雀币</view>
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="disjcac fc width33" style="align-items: flex-start;">
|
<view class="disjcac fc width33" style="align-items: flex-start;">
|
||||||
<view class="fon36 bold mar-z20">3000</view>
|
<view class="fon36 bold mar-z20">{{dangKQ}}</view>
|
||||||
<view class="mar-s36" @tap="isTiX=true" style="width: 152rpx;height: 60rpx;line-height: 60rpx;text-align: center;color: #FFFFFF;background: #3875F6;border-radius: 30rpx;font-size: 26rpx;">提现</view>
|
<view class="mar-s36 coin-tx-btn" @tap="isTiX=true">提现</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjcac fc width33">
|
<view class="disjcac fc width33">
|
||||||
<view class="fon36 bold">300 <span style="font-size: 26rpx;font-weight: 400;">元</span></view>
|
<view class="fon36 bold">{{shenHZ}}<span class="coin-yuan">元</span></view>
|
||||||
<view class="mar-s36 fon26 col3" style="height: 60rpx;line-height: 60rpx;">审核中</view>
|
<view class="mar-s36 fon26 col3 coin-miao">审核中</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjcac fc width33">
|
<view class="disjcac fc width33">
|
||||||
<view class="fon36 bold">0 <span style="font-size: 26rpx;font-weight: 400;">元</span></view>
|
<view class="fon36 bold">{{yiTKQ}}<span class="coin-yuan">元</span></view>
|
||||||
<view class="mar-s36 fon26 col3" style="height: 60rpx;line-height: 60rpx;">已提现</view>
|
<view class="mar-s36 fon26 col3 coin-miao">已提现</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -24,32 +24,32 @@
|
||||||
<view class="mar-s20 bacf pad20 radius20">
|
<view class="mar-s20 bacf pad20 radius20">
|
||||||
<view class="mar-x50 fon28 disja">
|
<view class="mar-x50 fon28 disja">
|
||||||
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">获取列表</view>
|
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">获取列表</view>
|
||||||
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">提现列表</view>
|
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">支出列表</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
||||||
<view>
|
<view>
|
||||||
<view class="fon26 col3">{{item.title}}</view>
|
<view class="fon26 col3">{{item.title}}</view>
|
||||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="activeJF" class="fon36 bold" style="color: #3875F6;">+{{item.num}}</view>
|
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
|
||||||
<view v-show="!activeJF" class="fon36 bold">-{{item.num}}</view>
|
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 分享按钮 -->
|
<!-- 分享按钮 -->
|
||||||
<view class="disjcac" style="width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);">
|
<view class="disjcac coin-share-box">
|
||||||
<image src="/static/public/bottom-shear.png" style="width: 50rpx;height: 50rpx;" mode=""></image>
|
<image src="/static/public/bottom-shear.png" mode=""></image>
|
||||||
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
||||||
<button class="posia" open-type="share" style="top: 0;left: 0;right: 0;bottom: 0;opacity: 0;"></button>
|
<button class="posia-op" open-type="share"></button>
|
||||||
</view>
|
</view>
|
||||||
<!-- 提现弹框 -->
|
<!-- 提现弹框 -->
|
||||||
<view v-if="isTiX" @tap="isTiX=false" class="disjcac tc" style="position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);">
|
<view v-if="isTiX" @tap="isTiX=false" class="disjcac tc tx-tk-box">
|
||||||
<view class="bacf width100 radius20 pad30" style="margin: 0 85rpx;" @tap.stop="isTiX=true">
|
<view class="bacf width100 radius20 pad30 mar-zy85" @tap.stop="isTiX=true">
|
||||||
<view class="fon28 bold" style="color: #343434;">孔雀币提现</view>
|
<view class="fon28 bold col34">孔雀币提现</view>
|
||||||
<view class="fon28 mar-sx30" style="color: #343434;font-weight: 500;">兑换比例100孔雀币兑换1元人民币</view>
|
<view class="fon28 mar-sx30 col34 font5">兑换比例{{kqbl}}孔雀币兑换{{whatPrice}}元人民币</view>
|
||||||
<input type="text" value="" placeholder="请输入提现金额" class="width100 radius10" style="border: 2rpx solid #E0E0E0;margin-bottom: 80rpx;height: 60rpx;"/>
|
<input type="number" v-model="kNum" placeholder="请输入孔雀币" class="width100 radius10"/>
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view @tap.stop="isTiX=false" style="width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;border-radius: 10rpx;font-size: 28rpx;color: #FFFFFF;background-color: #3875F6;">立即提现</view>
|
<view @tap.stop="confrimT" class="tk-btn pbackc">立即提现</view>
|
||||||
<view @tap.stop="isTiX=false" style="width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;border-radius: 10rpx;font-size: 28rpx;color: #FFFFFF;background-color: #C8C8C8;">暂不提现</view>
|
<view @tap.stop="isTiX=false" class="tk-btn">暂不提现</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -64,40 +64,112 @@
|
||||||
statusHNH:uni.getStorageSync('statusHNH'),
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
activeJF:true,
|
activeJF:true,
|
||||||
|
kNum:'',//输入框孔雀币数量
|
||||||
dataList:[
|
dataList:[
|
||||||
{title:'积分兑换',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'积分兑换',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'分享订单',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'分享订单',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'订单分享',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'订单分享',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
],
|
],
|
||||||
isTiX:true
|
isTiX:false,
|
||||||
|
dangKQ:3000,//当前孔雀币
|
||||||
|
shenHZ:300 ,//审核中的孔雀币
|
||||||
|
yiTKQ:0 ,//已提孔雀币
|
||||||
|
kqbl:0,//兑换比例
|
||||||
|
whatPrice:0,//多少元
|
||||||
|
ntype:'in',//默认coin:孔雀币记录获取 withdrawal:提现记录获取
|
||||||
|
times:0,//次数
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:'',//总数
|
||||||
|
isZanw:true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if(this.total!=this.dataList.length){
|
||||||
|
this.page++
|
||||||
|
this.checkList(this.ntype)//调用自主预约列表事件
|
||||||
|
} else {
|
||||||
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
|
||||||
|
this.isZanw = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.checkInfo();
|
||||||
|
this.checkList(this.ntype);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchState(flag){
|
confrimT(){//确定提现事件
|
||||||
this.activeJF = flag;
|
if(this.kNum=='' || this.kNum<=0){
|
||||||
if(flag) {
|
this.$toolAll.tools.showToast('请输入孔雀币数量');
|
||||||
this.dataList = [
|
} else if(this.kNum>this.dangKQ){
|
||||||
{title:'积分兑换',time:'2021.09.06 10:30:10',num:'1'},
|
this.$toolAll.tools.showToast('请输入正确的孔雀币数量');
|
||||||
{title:'分享订单',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
{title:'订单分享',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
]
|
|
||||||
} else {
|
} else {
|
||||||
this.dataList = [
|
if(this.times==0){
|
||||||
{title:'孔雀币提现',time:'2021.09.06 10:30:10',num:'1'},
|
this.times++;
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
this.$requst.post('user/withdrawal-coin',{coin:this.kNum}).then(res=>{
|
||||||
{title:'分享订单',time:'2021.09.06 10:30:10',num:'1'},
|
if(res.code==0){
|
||||||
{title:'任务完成',time:'2021.09.06 10:30:10',num:'1'},
|
this.isTiX = false;
|
||||||
]
|
this.$toolAll.tools.showToast('提现已提交审核');
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.dataList = [];
|
||||||
|
this.page =1;
|
||||||
|
this.isZanw = true;
|
||||||
|
this.ntype = 'out';
|
||||||
|
this.checkInfo();//查询账户信息
|
||||||
|
this.checkList(this.ntype);//查询已提现列表
|
||||||
|
this.activeJF = false;
|
||||||
|
this.times = 0;//可点
|
||||||
|
this.kNum = '';//清空输入框
|
||||||
|
},1500)
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
checkList(ntype){//查询数据列表
|
||||||
|
this.$requst.post('user/coin-log',{type:ntype,page:this.page,size:this.size}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
if(this.page==1) this.dataList = [];
|
||||||
|
this.total = res.data.total;
|
||||||
|
if(res.data.list.length!=0){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
title:item.name,
|
||||||
|
time:item.created_at,
|
||||||
|
num:item.num
|
||||||
|
}
|
||||||
|
this.dataList.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkInfo(){//查询账户详情
|
||||||
|
this.$requst.post('user/coin-load').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.dangKQ = res.data.coin;//当前孔雀币
|
||||||
|
this.shenHZ = res.data.withdrawal_ing;//审核中的孔雀币
|
||||||
|
this.yiTKQ = res.data.withdrawald;//已提孔雀币
|
||||||
|
this.kqbl = res.data.withdrawal_proportion.coin;//孔雀币比例
|
||||||
|
this.whatPrice = res.data.withdrawal_proportion.money;//兑换后的钱
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchState(flag){//切换事件
|
||||||
|
this.dataList = [];
|
||||||
|
this.activeJF = flag;
|
||||||
|
this.page =1;
|
||||||
|
this.isZanw = true;
|
||||||
|
if(flag) {
|
||||||
|
this.ntype ='in';
|
||||||
|
this.checkList(this.ntype);
|
||||||
|
} else {
|
||||||
|
this.ntype ='out';
|
||||||
|
this.checkList(this.ntype);
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- 数据列表 -->
|
<!-- 数据列表 -->
|
||||||
<view :style="{marginTop:statusHNH+titleHeight+'px'}">
|
<view :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||||
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
<score-list id="myComponent" :dataList="dataList" v-if="dataList.length!=0"></score-list>
|
||||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}积分商品`"></nothing-page>
|
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}积分商品`"></nothing-page>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部tab -->
|
<!-- 底部tab -->
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<view class="cart-box">
|
<view class="cart-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
<view class="posia"><view>99</view></view>
|
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -41,10 +41,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import shopList from '@/components/shop-list.vue';
|
import scoreList from '@/components/score-list.vue';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
shopList
|
scoreList
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -60,11 +60,13 @@
|
||||||
type:'normal',//type=normal综合 newest=最新
|
type:'normal',//type=normal综合 newest=最新
|
||||||
sort_field:'',//排序字段 score=积分 num=兑换量
|
sort_field:'',//排序字段 score=积分 num=兑换量
|
||||||
sort_value:'asc',//排序值 asc=升序 desc=降序
|
sort_value:'asc',//排序值 asc=升序 desc=降序
|
||||||
cishu:0
|
cishu:0,
|
||||||
|
cartNum:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.cartNumEv();
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.titleList = uni.getStorageSync('footTitle')
|
this.titleList = uni.getStorageSync('footTitle')
|
||||||
|
@ -78,6 +80,13 @@
|
||||||
this.checkList();
|
this.checkList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
cartNumEv(){//购物车数量
|
||||||
|
this.$requst.post('order/shopping-cart-count',{type:'score'}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.cartNum = res.data.count;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
checkList(){//查询列表事件
|
checkList(){//查询列表事件
|
||||||
let params = {
|
let params = {
|
||||||
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||||
|
@ -157,7 +166,7 @@
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
page{background: #F5F5F5;}
|
page{background: #F5F5F5;}
|
||||||
.activecate,.shopMo{border-radius: 20rpx;text-align: center;background-color: #f2f2f2;color: #333333;padding: 16rpx 25rpx;}
|
.activecate,.shopMo{border-radius: 20rpx;text-align: center;background-color: #f2f2f2;color: #333333;padding: 16rpx 25rpx;width: 100rpx;}
|
||||||
.activecate{color: #FFFFFF;}
|
.activecate{color: #FFFFFF;}
|
||||||
.activecate image{
|
.activecate image{
|
||||||
-webkit-filter: invert(1); /* Chrome, Safari, Opera */
|
-webkit-filter: invert(1); /* Chrome, Safari, Opera */
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
<view>
|
<view>
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
|
||||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30">
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 pad-x160">
|
||||||
<view class="bacf radius20 mar-s20 pad20" v-if="cartList.length!=0">
|
<view class="bacf radius20 mar-s20 pad20" v-if="cartList.length!=0">
|
||||||
<view class="fon28 col3 disjbac" style="height: 43rpx;">
|
<view class="fon28 col3 disjbac" style="height: 43rpx;">
|
||||||
<view class="bold">订单信息</view>
|
<view class="bold">订单信息</view>
|
||||||
<view v-if="!cancle_del && cartList.length!=0" @tap="guanEv(0)">管理</view>
|
<view v-if="!cancle_del && cartList.length!=0" @tap="guanEv(0)">管理</view>
|
||||||
<view v-if="cancle_del && cartList.length!=0" @tap="guanEv(1)" class="edit-btn">管理 ×</view>
|
<view v-if="cancle_del && cartList.length!=0" @tap="guanEv(1)" class="edit-btn">管理 ×</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item,index) in cartList" :key="index" class="disjbac pad-sx40 bbot posir cart-list-box" @touchstart="moveStart(index,$event)" @touchend="moveEnd">
|
<view v-for="(item,index) in cartList" :key="index" class="disjbac pad-sx40 borbot posir cart-list-box" @touchstart="moveStart(index,$event)" @touchend="moveEnd">
|
||||||
<view class="disjbac width100" :style="{marginLeft:(showDel && isDang==index)?'-70px':'',paddingRight:(showDel && isDang==index)?'70px':''}">
|
<view class="disjbac width100" :style="{marginLeft:(showDel && isDang==index)?'-70px':'',paddingRight:(showDel && isDang==index)?'70px':''}">
|
||||||
<!-- 圈 -->
|
<!-- 圈 -->
|
||||||
<view @tap="chooseItem(index)">
|
<view @tap="chooseItem(index)">
|
||||||
|
@ -19,10 +19,8 @@
|
||||||
<image @tap="chooseItem(index)" :src="item.imgSrc" class="order-image mar-z25 flexs" mode="aspectFill"></image>
|
<image @tap="chooseItem(index)" :src="item.imgSrc" class="order-image mar-z25 flexs" mode="aspectFill"></image>
|
||||||
<view class="width100 disjbac fc" style="height: 166rpx;">
|
<view class="width100 disjbac fc" style="height: 166rpx;">
|
||||||
<view class="width100">
|
<view class="width100">
|
||||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
<view @tap="goShoptDetail(item.spu_id,item.spu_activity_id)" class="fon28 col3 bold clips2">{{item.title}}</view>
|
||||||
<view class="fon28 col3 bold clips2">{{item.title}}</view>
|
<view class="order-sy">{{item.sku_name}}</view>
|
||||||
</navigator>
|
|
||||||
<view class="order-sy">试用</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac width100 mar-s10">
|
<view class="disjbac width100 mar-s10">
|
||||||
<view class="order-item-price"><span v-if="item.is_score!=1">¥</span><span v-else>积分:</span>{{item.price}}</view>
|
<view class="order-item-price"><span v-if="item.is_score!=1">¥</span><span v-else>积分:</span>{{item.price}}</view>
|
||||||
|
@ -48,10 +46,10 @@
|
||||||
<!-- 去支付 -->
|
<!-- 去支付 -->
|
||||||
<view v-if="!cancle_del" class="disjbac">
|
<view v-if="!cancle_del" class="disjbac">
|
||||||
<view>
|
<view>
|
||||||
<view class="fon28" v-if="isScore!='score'">合计:<span class="fon40 bold colf8">¥{{allPrice}}.00</span></view>
|
<view class="fon28" v-if="isScore!='score'">合计:<span class="fon40 bold colf8">¥{{allPrice}}</span></view>
|
||||||
<view class="fon28" v-else>合计:<span class="fon40 bold colf8">{{allPrice}}</span></view>
|
<view class="fon28" v-else>合计:<span class="fon40 bold colf8">{{allPrice}}</span></view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="goGetReadyDan" class="colf fon28 bold mar-z10 goBuy-btn" style="background: #3875F6;">{{cartList.length==0?'去购物':'去支付'}}</view>
|
<view @tap="goGetReadyDan" class="colf fon30 bold mar-z10 goBuy-btn" style="background: #3875F6;">{{cartList.length==0?'去购物':'去支付'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<view @tap="delBtn" v-else class="colf fon28 bold goBuy-btn" style="background: #F85050;">删除</view>
|
<view @tap="delBtn" v-else class="colf fon28 bold goBuy-btn" style="background: #F85050;">删除</view>
|
||||||
|
@ -104,16 +102,20 @@
|
||||||
if(res.data.length!=0){
|
if(res.data.length!=0){
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item=>{
|
||||||
let nprice = '';
|
let nprice = '';
|
||||||
item.is_score ==1 ? nprice = item.score : nprice = item.sku.sku_price;
|
item.is_score ==1 ? nprice = item.score : nprice = item.sku.sku_price/100;
|
||||||
let obj = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
|
spu_id:item.spu.id,
|
||||||
|
spu_activity_id:item.spu_activity_id,//活动商品id
|
||||||
imgSrc:this.$http + item.spu.spu_cover,
|
imgSrc:this.$http + item.spu.spu_cover,
|
||||||
coding:item.sku.coding,
|
coding:item.sku.coding,
|
||||||
title:item.sku.sku_name,
|
title:item.spu_name,
|
||||||
|
sku_name:item.sku.sku_name,
|
||||||
price:nprice,//实际价格
|
price:nprice,//实际价格
|
||||||
num:item.num,
|
num:item.num,
|
||||||
isActive:false,
|
isActive:false,
|
||||||
is_score:item.is_score
|
is_score:item.is_score,//是否是积分
|
||||||
|
group_id:0//0发起拼团 1参与拼团 2单独购买
|
||||||
}
|
}
|
||||||
this.cartList.push(obj)
|
this.cartList.push(obj)
|
||||||
})
|
})
|
||||||
|
@ -211,15 +213,33 @@
|
||||||
} else {
|
} else {
|
||||||
newUrl = '/pages/tabbar/shop/shop';
|
newUrl = '/pages/tabbar/shop/shop';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(this.cartList.length > 0) {
|
|
||||||
uni.setStorageSync('orderList',this.newList);
|
|
||||||
newUrl = `/pagesA/getReadyDan/getReadyDan?isNei=${isNei}`;
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:newUrl
|
url:newUrl
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if(this.cartList.length > 0) {
|
||||||
|
uni.setStorageSync('orderList',this.newList);
|
||||||
|
if(this.newList.length==0){
|
||||||
|
this.$toolAll.tools.showToast('请选择要支付的商品');
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesA/getReadyDan/getReadyDan?isNei=${isNei}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goShoptDetail(id,is_activity){
|
||||||
|
// &isIntegral=${this.dataList[index].isIntegral}
|
||||||
|
if(this.isScore=='score'){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=true`
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/shopDetail/shopDetail?id=${id}&is_activity=${is_activity}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -2,21 +2,23 @@
|
||||||
<view>
|
<view>
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :titleVal="'签到管理'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'签到管理'" :statusTitle="true"></status-nav>
|
||||||
<view :style="{paddingTop: statusHNH+'px'}" class=" fon28 col3">
|
<view v-if="loading" :style="{paddingTop: statusHNH+'px'}" class=" fon28 col3">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image class="posia width100" src="/static/public/sign-01.png" mode="widthFix"></image>
|
<image class="posia width100" src="/static/public/sign-01.png" mode="widthFix"></image>
|
||||||
<view class="posir tc pad-sx20" style="z-index: 5;">
|
<view class="posir tc pad-sx20" style="z-index: 5;">
|
||||||
<image src="/static/public/sign-02.png" mode="" style="width: 218rpx;height: 202rpx;margin: 0 auto;"></image>
|
<image v-if="isSigin==0" @tap="siginEv" src="/static/public/sign-02.png" mode="" class="sigin-img"></image>
|
||||||
<view class="fon20 colf mar-s20">在连续签到6天,就可以获得额外300积分哦~加油吧</view>
|
<image v-else src="/static/public/sigined.png" mode="" class="sigin-img"></image>
|
||||||
|
<view class="fon20 colf mar-s20">在连续签到可获得积分</view>
|
||||||
<view class="disjcac mar-sx30">
|
<view class="disjcac mar-sx30">
|
||||||
<image src="/static/public/sign-03.png" style="width: 31rpx;height: 30rpx;margin-top: 20rpx;" mode=""></image>
|
<image src="/static/public/sign-03.png" class="sigin-success" mode=""></image>
|
||||||
<view class="bold colf mar-z10" style="font-size: 56rpx;">1000</view>
|
<view class="bold colf mar-z10 fon56">{{user_score}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjb pad-zy30">
|
<view class="disjb pad-zy30">
|
||||||
<view v-for="(item,index) in timeList" :key="index" class="disjcac fc">
|
<view v-for="(item,index) in timeList" :key="index" class="disjcac fc">
|
||||||
<view class="disjcac fon24 posir" :style="{color:item.isSign?'#789CFB':'#FFFFFF',background:item.isSign?'#FFFFFF':''}" style="width: 66rpx;height: 66rpx;border-radius: 100%;border: 2rpx solid #FFFFFF;">
|
<view class="disjcac fon24 posir sigin-day" :style="{color:item.isSign?'#789CFB':'#FFFFFF',background:item.isSign?'#FFFFFF':''}">
|
||||||
+{{item.num}}
|
+{{item.num}}
|
||||||
<view v-if="index==1" class="posia" style="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;">√</view>
|
<!-- <view></view> -->
|
||||||
|
<image v-if="item.isSign==1" class="posia" src="/static/public/gou.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon28 colf mar-s20">{{item.day}}</view>
|
<view class="fon28 colf mar-s20">{{item.day}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -32,7 +34,7 @@
|
||||||
<view class="fon26 col3">{{item.title}}</view>
|
<view class="fon26 col3">{{item.title}}</view>
|
||||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon36 bold" style="color: #3875F6;">+{{item.num}}</view>
|
<view class="fon36 bold pcol">+{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -46,28 +48,74 @@
|
||||||
return {
|
return {
|
||||||
statusHNH:uni.getStorageSync('statusHNH'),
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
timeList:[
|
timeList:[],
|
||||||
{num:'10',day:'3.21',isSign:true},
|
|
||||||
{num:'10',day:'今天',isSign:true},
|
|
||||||
{num:'20',day:'明天',isSign:false},
|
|
||||||
{num:'20',day:'9.11',isSign:false},
|
|
||||||
{num:'20',day:'9.12',isSign:false},
|
|
||||||
{num:'20',day:'9.13',isSign:false},
|
|
||||||
{num:'20',day:'9.14',isSign:false},
|
|
||||||
],
|
|
||||||
dataList:[
|
dataList:[
|
||||||
{title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
// {title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
||||||
{title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
{title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
{title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
|
||||||
],
|
],
|
||||||
|
user_score:0,//账户余额
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
isSigin:0,
|
||||||
|
loading:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
|
this.checkTime();
|
||||||
|
this.checkList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
siginEv(){
|
||||||
|
this.$toolAll.tools.showToast('正在签到...');
|
||||||
|
this.$requst.post('sign/online-singIn').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.$toolAll.tools.showToast('签到成功');
|
||||||
|
this.checkTime();
|
||||||
|
this.checkList();
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkTime(){
|
||||||
|
this.$requst.post('sign/online-sign-record',{page:this.page,size:this.size}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.dataList = [];
|
||||||
|
if(res.data.length!=0){
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
title:'签到积分',
|
||||||
|
time:item.created_at,
|
||||||
|
num:item.score
|
||||||
|
}
|
||||||
|
this.dataList.push(obj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkList(){
|
||||||
|
this.$requst.post('sign/mini-load').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.timeList = [];
|
||||||
|
for (let key in res.data.sign_record) {
|
||||||
|
let obj = {
|
||||||
|
num:res.data.sign_record[key].record,
|
||||||
|
day:res.data.sign_record[key].key,
|
||||||
|
isSign:res.data.sign_record[key].is_sign
|
||||||
|
}
|
||||||
|
this.timeList.push(obj)
|
||||||
|
// console.log(key);
|
||||||
|
}
|
||||||
|
this.isSigin = res.data.today_sign_in;//0未签到 1已签到
|
||||||
|
this.user_score = res.data.user_score;
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.loading = true;
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
// console.log(res);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 状态栏 -->
|
||||||
|
<status-nav :titleVal="'客服查询'" :statusTitle="true"></status-nav>
|
||||||
|
<!-- 自定义二级分类 -->
|
||||||
|
<!-- 列表 -->
|
||||||
|
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30">
|
||||||
|
<view class="radius20 fon28 col3 mar-sx20">
|
||||||
|
<view class="disac">
|
||||||
|
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
|
||||||
|
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="客户的手机号/微信昵称查找" placeholder-style="color: #B3B3B3;" />
|
||||||
|
</view>
|
||||||
|
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<view class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
|
||||||
|
<view class="col3 bold">客户信息</view>
|
||||||
|
<view class="mar-sx20 fon24 disjbac col6">
|
||||||
|
<text>昵称:{{item.customer_name}}</text>
|
||||||
|
<text><text v-if="item.customer_phone!=''">手机号:{{item.customer_phone}}</text><text v-else>暂未绑定手机号</text></text>
|
||||||
|
</view>
|
||||||
|
<view class="col3 bold">绑定的客服</view>
|
||||||
|
<view v-if="item.staff!=null" class="mar-s20 fon24 disjbac col6">
|
||||||
|
<text>昵称:{{item.staff.name}}</text>
|
||||||
|
<text v-if="item.staff.phone!=''">手机号:{{item.staff.phone}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-else class="mar-s20 fon24 disjbac col6">
|
||||||
|
<text>昵称:{{item.account.nickname}}</text>
|
||||||
|
<text><text v-if="item.account.mobile!=''">手机号:{{item.account.mobile}}</text><text v-else>暂未绑定手机号</text></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
<!-- 底部客服 -->
|
||||||
|
<public-customer :nbottom="100"></public-customer>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
|
dataList:[],//数据列表
|
||||||
|
showTop:false,//是否显示返回顶部的箭头
|
||||||
|
keyword:'',//关键词
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:'',//总数
|
||||||
|
isZanw:true,
|
||||||
|
ntype:''//类型 mine=自己绑定的客户 否则是全部
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||||
|
},
|
||||||
|
onReachBottom() {//触底事件
|
||||||
|
if(this.total!=this.dataList.length){
|
||||||
|
this.page++
|
||||||
|
this.checkList()
|
||||||
|
} else {
|
||||||
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多客服数据')
|
||||||
|
this.isZanw = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.$toolAll.tools.isLogin()
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.checkList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
searchEv(){//搜索事件
|
||||||
|
if(this.keyword!='') this.ntype = ''
|
||||||
|
this.page = 1
|
||||||
|
this.isZanw = true
|
||||||
|
this.checkList()
|
||||||
|
},
|
||||||
|
checkList(){//查询列表事件
|
||||||
|
let params = {
|
||||||
|
page:this.page,
|
||||||
|
size:this.size,
|
||||||
|
type:this.ntype,//客户ID
|
||||||
|
keyword:this.keyword
|
||||||
|
}
|
||||||
|
this.$requst.post('user/get-bind-service-list',params).then(res=>{
|
||||||
|
// console.log('足迹列表查询:',res);
|
||||||
|
if(res.code==0){
|
||||||
|
if(this.page==1) this.dataList = []
|
||||||
|
this.total = res.data.total;
|
||||||
|
if(res.data.list.length!=0){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
let obj = {
|
||||||
|
id:item.account_id,
|
||||||
|
customer_name:item.customer.nickname,
|
||||||
|
customer_phone:item.customer.mobile,
|
||||||
|
staff:item.staff,//绑定的客服
|
||||||
|
account:item.account//备用:当staff不存在时调用,
|
||||||
|
}
|
||||||
|
this.dataList.push(obj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
backTop(){//回到顶部事件
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
duration: 300
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
|
@ -23,7 +23,7 @@
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view v-if="dataList.length!=0" class="dis bacf radius10 pad20 mar-x20 posir" v-for="(item,index) in dataList" :key="index">
|
<view v-if="dataList.length!=0" class="dis bacf radius10 pad20 mar-x20 posir" v-for="(item,index) in dataList" :key="index">
|
||||||
<image class="mar-y20 flexs" :src="item.imgSrc" style="width: 98rpx;height: 98rpx;" mode="aspectFill"></image>
|
<image class="mar-y20 flexs" :src="item.imgSrc" style="width: 98rpx;height: 98rpx;" mode="aspectFill"></image>
|
||||||
<view class="fon24 col3 width100">
|
<view class="fon24 col3 width100 mar-x40">
|
||||||
<view class="bold disjbac">
|
<view class="bold disjbac">
|
||||||
<view class="fon28 clips1">{{item.name}}</view>
|
<view class="fon28 clips1">{{item.name}}</view>
|
||||||
<view class="flexs">来源:{{item.come}}</view>
|
<view class="flexs">来源:{{item.come}}</view>
|
||||||
|
@ -35,8 +35,8 @@
|
||||||
<view class="col3">{{item.qudao}}</view>
|
<view class="col3">{{item.qudao}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn"
|
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}">分配客服</view>
|
||||||
style="right: 20rpx;bottom: 70rpx;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}">分配客服</view>
|
<view class="fon24 col3 posia clips1 bold" style="bottom: 20rpx;left: 20rpx;right: 20rpx;">详细来源:{{item.source_detail}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
|
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
|
||||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
// }
|
// }
|
||||||
if(this.total!=this.dataList.length){
|
if(this.total!=this.dataList.length){
|
||||||
this.page++
|
this.page++
|
||||||
this.checkCL()
|
this.checkCL(this.ntype)
|
||||||
} else {
|
} else {
|
||||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表数据')
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表数据')
|
||||||
this.isZanw = false
|
this.isZanw = false
|
||||||
|
@ -119,8 +119,8 @@
|
||||||
},error=>{})
|
},error=>{})
|
||||||
},
|
},
|
||||||
searchEv(){//搜索事件
|
searchEv(){//搜索事件
|
||||||
this.page = 1
|
this.page = 1;
|
||||||
this.isZanw = true
|
this.isZanw = true;
|
||||||
this.checkCL(this.ntype)
|
this.checkCL(this.ntype)
|
||||||
},
|
},
|
||||||
checkLY(){//查询来源渠道事件
|
checkLY(){//查询来源渠道事件
|
||||||
|
@ -156,7 +156,8 @@
|
||||||
customer:item.service[0],
|
customer:item.service[0],
|
||||||
time:item.created_at,
|
time:item.created_at,
|
||||||
qudao:item.tag[0],
|
qudao:item.tag[0],
|
||||||
service:item.service
|
service:item.service,
|
||||||
|
source_detail:item.source_detail
|
||||||
}
|
}
|
||||||
this.dataList.push(cuObj)
|
this.dataList.push(cuObj)
|
||||||
})
|
})
|
||||||
|
@ -197,9 +198,10 @@
|
||||||
// console.log('开启下拉');
|
// console.log('开启下拉');
|
||||||
},
|
},
|
||||||
chooseXia(index){
|
chooseXia(index){
|
||||||
this.xialCurrent = index
|
this.xialCurrent = index;
|
||||||
this.ntype = this.xialone[index].name
|
this.ntype = this.xialone[index].name;
|
||||||
this.category = this.xialone[index].title
|
console.log(this.ntype);
|
||||||
|
this.category = this.xialone[index].title;
|
||||||
},
|
},
|
||||||
chooseXiaT(e){
|
chooseXiaT(e){
|
||||||
this.staff_id = e.id
|
this.staff_id = e.id
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<!-- 状态栏 -->
|
<!-- 状态栏 -->
|
||||||
<status-nav :titleVal="'消息'" :statusTitle="true"></status-nav>
|
<status-nav :titleVal="'消息'" :statusTitle="true"></status-nav>
|
||||||
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
||||||
<view @tap="isWen=true" :class="isWen?'isWen bold':'col9'" class="posir">日程提醒</view>
|
<view @tap="switchEv(true)" :class="isWen?'isWen bold':'col9'" class="posir">日程提醒</view>
|
||||||
<view @tap="isWen=false" :class="!isWen?'isWen bold':'col9'" class="posir">消息中心</view>
|
<view @tap="switchEv(false)" :class="!isWen?'isWen bold':'col9'" class="posir">消息中心</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
||||||
|
@ -13,10 +13,10 @@
|
||||||
<view class="fon24 col6 tc mar-sx50">{{item.time}}</view>
|
<view class="fon24 col6 tc mar-sx50">{{item.time}}</view>
|
||||||
<view class="radius10 bacf pad20 mar-x20" v-for="(iteml,indexl) in item.list" :key="indexl">
|
<view class="radius10 bacf pad20 mar-x20" v-for="(iteml,indexl) in item.list" :key="indexl">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<image v-if="iteml.is_read==0" style="width:46rpx;height:56rpx;" src="/static/public/unread.png" mode=""></image>
|
<image v-if="iteml.is_read==0" class="message-img" src="/static/public/unread.png" mode=""></image>
|
||||||
<image v-if="iteml.is_read==1" style="width:46rpx;height:56rpx;" src="/static/public/read.png" mode=""></image>
|
<image v-if="iteml.is_read==1" class="message-img" src="/static/public/read.png" mode=""></image>
|
||||||
<view class="fon28 col3 bold mar-zy10">{{iteml.title}}</view>
|
<view class="fon28 col3 bold mar-zy10">{{iteml.title}}</view>
|
||||||
<view :style="{background:iteml.is_read==1?'rgba(204, 204, 204,1)':'#FF4D4D'}" style="border-radius: 5rpx;font-size: 24rpx;color: #FFFFFF;padding: 2rpx 8rpx 4rpx 6rpx;transform: scale(.8);">{{iteml.is_read==1?'已读':'未读'}}</view>
|
<view :style="{background:iteml.is_read==1?'rgba(204, 204, 204,1)':'#FF4D4D'}" class="message-status">{{iteml.is_read==1?'已读':'未读'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="iteml.content!=''" class="fon26 col3 mar-s20">{{iteml.content}}</view>
|
<view v-if="iteml.content!=''" class="fon26 col3 mar-s20">{{iteml.content}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -62,26 +62,27 @@
|
||||||
showTop:false,//是否显示返回顶部
|
showTop:false,//是否显示返回顶部
|
||||||
chuTop:'',
|
chuTop:'',
|
||||||
isWen:true,
|
isWen:true,
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:0,
|
||||||
|
isZanw:true,
|
||||||
|
ntype:'reminders'//默认日程提醒
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||||
},
|
},
|
||||||
onReachBottom() {//触底事件
|
onReachBottom() {
|
||||||
// for (let i = 0; i < 4; i++) {
|
if(this.total!=this.dataList.length){
|
||||||
// let obj = {
|
this.page++
|
||||||
// status:false,
|
this.checkList()//调用自主预约列表事件
|
||||||
// main_img:'/static/public/main_img.png',
|
} else {
|
||||||
// title:'恒美小课堂',
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多消息','none',1000)
|
||||||
// content:'饺子会吃肉?',
|
this.isZanw = false
|
||||||
// head_img:'/static/public/like.png',
|
}
|
||||||
// name:'吃肉的饺子'
|
|
||||||
// }
|
|
||||||
// this.dataList.push(obj)
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const query = wx.createSelectorQuery()
|
const query = wx.createSelectorQuery()
|
||||||
|
@ -89,14 +90,16 @@
|
||||||
// console.log('状态栏+标题栏:',rect);
|
// console.log('状态栏+标题栏:',rect);
|
||||||
this.chuTop = rect.height
|
this.chuTop = rect.height
|
||||||
}).exec()
|
}).exec()
|
||||||
if(options.index==undefined){this.isWen = false}
|
if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
|
||||||
this.checkMsg()
|
this.checkMsg();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkMsg(){
|
checkMsg(){
|
||||||
this.$requst.post('user/messages').then(res=>{
|
this.$requst.post('user/messages',{page:this.page,size:this.size,type:this.ntype}).then(res=>{
|
||||||
// console.log('消息列表:',res);
|
// console.log('消息列表:',res);
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
if(this.page==1) this.dataList = [];
|
||||||
|
this.total = res.data.total;
|
||||||
if(res.data.list.length!=0){
|
if(res.data.list.length!=0){
|
||||||
res.data.list.forEach(item=>{
|
res.data.list.forEach(item=>{
|
||||||
let titleMsg = ''
|
let titleMsg = ''
|
||||||
|
@ -118,6 +121,18 @@
|
||||||
}
|
}
|
||||||
},error=>{})
|
},error=>{})
|
||||||
},
|
},
|
||||||
|
switchEv(flag){
|
||||||
|
this.isWen = flag;
|
||||||
|
this.isZanw = true;
|
||||||
|
this.page = 1;
|
||||||
|
if(flag){
|
||||||
|
this.ntype = 'reminders';
|
||||||
|
this.checkMsg();
|
||||||
|
} else {
|
||||||
|
this.ntype = 'message';
|
||||||
|
this.checkMsg();
|
||||||
|
}
|
||||||
|
},
|
||||||
backTop(){//回到顶部事件
|
backTop(){//回到顶部事件
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<view>
|
<view>
|
||||||
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
||||||
<view @tap="isWen=true" :class="isWen?'isWen':''" class="posir">文章收藏</view>
|
<view @tap="isWen=true" :class="isWen?'isWen':''" class="posir">文章收藏</view>
|
||||||
<view @tap="isWen=false" :class="!isWen?'isWen':''" class="posir">商品收藏</view>
|
<view @tap="shopCollection" :class="!isWen?'isWen':''" class="posir">商品收藏</view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{paddingTop:(statusHNH+chuTop+15)+'px'}">
|
<view :style="{paddingTop:(statusHNH+chuTop+15)+'px'}">
|
||||||
<view v-if="isWen">
|
<view v-if="isWen">
|
||||||
|
@ -24,7 +24,92 @@
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<view v-if="shopList.length!=0" style="margin-top: -20rpx;">
|
<view v-if="shopList.length!=0" style="margin-top: -20rpx;">
|
||||||
<shopList :dataList="shopList"></shopList>
|
<view class="pad20">
|
||||||
|
<view style="width: 48.6%;float: left;">
|
||||||
|
<view v-if="index1%2==0" v-for="(item1,index1) in shopList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @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="posia list-like-box" @tap.stop="chooseLike(index1)">
|
||||||
|
<image class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<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>
|
||||||
|
<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 shopList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @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="posia list-like-box" @tap.stop="chooseLike(index1)">
|
||||||
|
<image class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||||
|
</view>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
<!-- 弹框 -->
|
||||||
|
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="submitQu" @cancleev="isShowT=false"></pu-po>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="disjcac fc" style="margin-top: 50%;">
|
<view v-else class="disjcac fc" style="margin-top: 50%;">
|
||||||
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
|
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
|
||||||
|
@ -41,7 +126,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {cancleCollectionEV} from '@/jsFile/publicAPI.js';
|
import {cancleCollectionEV,cancleCollectionShopEV} from '@/jsFile/publicAPI.js';
|
||||||
import shopList from '@/components/shop-list.vue';
|
import shopList from '@/components/shop-list.vue';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
|
@ -64,56 +149,13 @@
|
||||||
category_id:0,//栏目ID
|
category_id:0,//栏目ID
|
||||||
chuTop:'',
|
chuTop:'',
|
||||||
isWen:true,
|
isWen:true,
|
||||||
shopList:[
|
shopList:[],
|
||||||
{
|
activeIndex:0,
|
||||||
imgSrc:'/static/public/wen-one.png',
|
isShowT:false,
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
pu_content:'是否需要取消收藏?',
|
||||||
zhePrice:'3888',
|
page:1,
|
||||||
yuanPrice:'4205',
|
size:10,
|
||||||
integral:'2888',
|
timeList:[],//时间列表
|
||||||
isTuan:true,
|
|
||||||
isPing:false,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:false,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:true,
|
|
||||||
isXian:false,
|
|
||||||
isIntegral:false,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imgSrc:'/static/public/wen-one.png',
|
|
||||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',
|
|
||||||
zhePrice:'3888',
|
|
||||||
yuanPrice:'4205',
|
|
||||||
integral:'2888',
|
|
||||||
isTuan:false,
|
|
||||||
isPing:false,
|
|
||||||
isXian:true,
|
|
||||||
isIntegral:false,
|
|
||||||
grade:0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
|
@ -143,6 +185,95 @@
|
||||||
}).exec()
|
}).exec()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
shopCollection(){//查询商品的收藏列表
|
||||||
|
this.isWen = false;
|
||||||
|
uni.request({
|
||||||
|
url:'https://hengmei.scdxtc.cn/api/spu/collection',
|
||||||
|
data:{page:this.page,size:this.size},
|
||||||
|
method:'post',
|
||||||
|
header:{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code==0){
|
||||||
|
this.shopList = [];
|
||||||
|
let nArr = [];
|
||||||
|
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,//病种名称
|
||||||
|
disease_id:item.disease_id,//病种ID
|
||||||
|
reponseTime:res.header.Date,//接口响应时间
|
||||||
|
activity_end_at:item.activity_end_at,//限时结束时间
|
||||||
|
activity_group_cover:group_cover,//参团人的头像
|
||||||
|
activity_group_num:item.activity_group_num,//已经参团人数
|
||||||
|
}
|
||||||
|
nArr.push(obj)
|
||||||
|
})
|
||||||
|
this.loading = true;
|
||||||
|
}
|
||||||
|
console.log(nArr);
|
||||||
|
nArr.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('加载中...')
|
||||||
|
let timer = setInterval(()=>{//定时器
|
||||||
|
if(this.timeList.length!=0){
|
||||||
|
this.timeList.forEach((item,index)=>{
|
||||||
|
if(item.id==nArr[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 活动结束
|
||||||
|
nArr[item.nIndex].activity_end_at = "活动已结束";
|
||||||
|
} else {
|
||||||
|
// 继续进行倒计时
|
||||||
|
nArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},1000)
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.shopList = nArr;
|
||||||
|
},1000)
|
||||||
|
} else {
|
||||||
|
this.shopList = nArr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
checkConList(category_id){//查询收藏列表
|
checkConList(category_id){//查询收藏列表
|
||||||
// this.$toolAll.tools.showToast('加载中...')
|
// this.$toolAll.tools.showToast('加载中...')
|
||||||
let params = {
|
let params = {
|
||||||
|
@ -212,6 +343,18 @@
|
||||||
},300)
|
},300)
|
||||||
this.dataList[e].is_collected = 0
|
this.dataList[e].is_collected = 0
|
||||||
},
|
},
|
||||||
|
chooseLike(index){
|
||||||
|
this.activeIndex = index;
|
||||||
|
this.isShowT = true;
|
||||||
|
},
|
||||||
|
submitQu(){
|
||||||
|
this.$toolAll.tools.showToast('正在取消...','loading');
|
||||||
|
// 调用取消收藏事件
|
||||||
|
cancleCollectionShopEV({action:'collect',id:this.shopList[this.activeIndex].id});
|
||||||
|
this.isShowT = false;
|
||||||
|
this.shopList.splice(this.activeIndex,1);
|
||||||
|
// this.shopCollection();
|
||||||
|
},
|
||||||
chooseTwo(index){//二级分类选择
|
chooseTwo(index){//二级分类选择
|
||||||
this.newCurrent = index
|
this.newCurrent = index
|
||||||
this.isZanw = true
|
this.isZanw = true
|
||||||
|
@ -226,6 +369,11 @@
|
||||||
duration: 300
|
duration: 300
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
goPage(id,index){//进入商品详情事件
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.shopList[index].isIntegral}`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,133 +6,87 @@
|
||||||
<!-- 订单类型 -->
|
<!-- 订单类型 -->
|
||||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||||
<view class="disjbac">
|
<view class="disjbac">
|
||||||
<view class="bold">商城订单</view>
|
<view class="bold">{{['商城订单','积分商城订单'][orderInfo.is_score]}}</view>
|
||||||
<view style="color: #F85050;font-weight: bold;">待付款</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'" 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 col3 mar-s40 mar-x20">订单号:1234567890</view>
|
<view class="bold col3 mar-s40 mar-x20">订单号:{{orderInfo.coding}}</view>
|
||||||
<view class="fon24 col9">2021-09-06 10:30</view>
|
<view class="fon24 col9">{{orderInfo.created_at}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 物流信息 -->
|
<!-- 物流信息 -->
|
||||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||||
<view class="bold">物流信息</view>
|
<view class="bold">物流信息</view>
|
||||||
<view class="bold col3 mar-s40 fon26 disjbac">
|
<view class="bold col3 mar-s40 fon26 disjbac">
|
||||||
<view>{{express}}</view>
|
<view>{{orderInfo.express_name}}:{{orderInfo.express_number||'暂无快递单号'}}</view>
|
||||||
<view @tap="copyCont">复制</view>
|
<view @tap="copyCont">复制</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 地址信息 -->
|
<!-- 地址信息 -->
|
||||||
<view v-if="isExpress" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
<view v-if="orderInfo.address!='自提'" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||||
<view class="bold">收件人信息</view>
|
<view class="bold">收件人信息</view>
|
||||||
<view class="fon26 col3">
|
<view class="fon26 col3">
|
||||||
<view class="fon28 col3 bold" style="margin: 52rpx 0 20rpx 0;">蒋灰灰 <span>188****0362</span></view>
|
<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">四川省成都市成华区中环路双店路段奥园广场</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 class="fon26 col3 disjbac mar-s30">
|
||||||
|
<view>
|
||||||
|
<view class="fon28 col3 bold mar-x20">恒美植发</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>
|
</view>
|
||||||
<!-- 订单信息 -->
|
<!-- 订单信息 -->
|
||||||
<view class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
<view class="bacf radius20 mar-s20 orderDetail-box">
|
||||||
<view class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
<view v-for="(item,index) in orderInfo.skus" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||||
<image src="/static/public/banner.png" class="flexs" style="width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;" mode="aspectFill"></image>
|
<image :src="item.spu_cover" class="flexs" mode="aspectFill"></image>
|
||||||
<view class="width100">
|
<view class="width100">
|
||||||
<view class="fon28 col3 bold clips2">【99皮皮节】【种植发际线】1000单位FUE技术案例招募门美人</view>
|
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||||
<view style="font-size: 22rpx;color: #808080;font-weight: 500;">试用</view>
|
<view class="orderDetail-sku">{{item.sku_name}}</view>
|
||||||
<view class="disjbac mar-s10">
|
<view class="disjbac mar-s10">
|
||||||
<view style="color: #F85050;font-size: 32rpx;font-weight: bold;">¥3888</view>
|
<view class="colf8 fon32 bold"><span v-if="orderInfo.is_score==0">¥{{item.price/100}}</span><span v-else>积分:{{item.score}}</span></view>
|
||||||
<view class="fon28 col6">x2</view>
|
<view class="fon28 col6">x{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fon28 disjbac" style="margin: 60rpx 0 20rpx 0;">
|
<view class="fon28 disjbac mar-s40 mar-x20">
|
||||||
<view class="col6">共4件</view>
|
<view class="col6">共{{allNum}}件</view>
|
||||||
<view style="font-weight: bold;color: #F85050;">应付款:3888.00+300孔雀币</view>
|
<view class="colf8 bold">共计:{{allPrice}}</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 优惠 -->
|
|
||||||
<view class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
|
||||||
<view class="bold">优惠</view>
|
|
||||||
<view @tap="showQuan=true" class="fon28 col3 disjbac mar-sx40">
|
|
||||||
<view>优惠券</view>
|
|
||||||
<view class="disac">
|
|
||||||
<view style="color: #F85050;font-weight: bold;">-¥99.00</view>
|
|
||||||
<image src="/static/public/nextM.png" style="width: 16px;height: 16px;flex-shrink: 0;" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="fon28 col3 disjbac">
|
|
||||||
<view>立减优惠</view>
|
|
||||||
<view style="color: #F85050;font-weight: bold;">-¥99.00</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 快递费用 -->
|
<!-- 快递费用 -->
|
||||||
<view class="bacf radius20 mar-s20 disjbac" style="padding: 27rpx 20rpx;">
|
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||||
<view class="bold">快递费用</view>
|
<view class="bold">快递费用</view>
|
||||||
<view class="fon28" style="color: #F85050;font-weight: bold;">¥10.00</view>
|
<view class="fon28 colf8 bold">¥{{orderInfo.freight}}.00</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 消费 -->
|
<!-- 消费 -->
|
||||||
<view class="fon28 col3" style="margin: 40rpx 0 40rpx 0;text-align: right;">消费:<span style="font-size: 36rpx;font-weight: bold;color: #F85050;">¥3898+300孔雀币</span></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" style="height: 124rpx;padding: 0 32rpx;display: flex;align-items: center;">
|
<view class="disjbac posixzy bacf orderDetail-bottom-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/weix.png" style="width: 56rpx;height: 56rpx;" mode=""></image>
|
<image src="/static/public/weix.png" mode=""></image>
|
||||||
<view class="fon28 col3">分享</view>
|
<view class="fon28 col3">分享</view>
|
||||||
<button open-type="share" class="posia" style="top: 0;left: 0;right: 0;bottom: 0;opacity: 0;"></button>
|
<button open-type="share" class="posia-op"></button>
|
||||||
|
</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'">
|
||||||
|
<view @tap="cancleEv">取消订单</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 待收货 -->
|
|
||||||
<!-- <view class="disac">
|
|
||||||
<view style="width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;background: #E9E9E9;color: #808080;">取消订单</view>
|
|
||||||
<view style="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;">立即支付</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- 确认收货 -->
|
<!-- 确认收货 -->
|
||||||
<view style="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;">确认收货</view>
|
<view class="orderInfo-btn" v-if="orderInfo.status=='shipped'">确认收货</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<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 style="padding: 20rpx 50rpx;">
|
|
||||||
<view class="disjbac">
|
|
||||||
<view class="fon28 bold col3">优惠券</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" style="display: flex;justify-content: space-around;align-items: center;padding: 50rpx 0 16rpx 0;">
|
|
||||||
<view class="posir" :class="switchQuan?'activeQuan':''" @tap="switchQuan=true">可用优惠券(1)</view>
|
|
||||||
<view class="posir" :class="!switchQuan?'activeQuan':''" @tap="switchQuan=false">失效优惠券(0)</view>
|
|
||||||
</view>
|
|
||||||
<view class="mar-s40">
|
|
||||||
<view style="height: 200rpx;" class="disjbac">
|
|
||||||
<view class="posir" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
|
|
||||||
<image class="posia" src="/static/public/quan-left.png" style="width: 218rpx;height: 200rpx;left: 0;top: 0;" mode=""></image>
|
|
||||||
<view class="posir" style="z-index: 1;">
|
|
||||||
<view style="margin: 40rpx 0 30rpx 0rpx;" class="fon28">¥<span style="font-size: 56rpx;font-weight: bold;">10</span></view>
|
|
||||||
<view class="fon24">满300元可使用</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #F5F5F5;">
|
|
||||||
<view class="fon28 col3 mar-s20">黄金会员专属优惠券</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/public/chooseQuan.png" style="width: 40rpx;height: 40rpx;border-radius: 100%;float: right;"></image>
|
|
||||||
</view>
|
|
||||||
<view class="fon20 col3 mar-x20">有效期:2021-09-06至2021-09-15</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="mar-s40">
|
|
||||||
<view style="height: 200rpx;" class="disjbac">
|
|
||||||
<view class="posir" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
|
|
||||||
<image class="posia" src="/static/public/quan-left.png" style="width: 218rpx;height: 200rpx;left: 0;top: 0;" mode=""></image>
|
|
||||||
<view class="posir" style="z-index: 1;">
|
|
||||||
<view style="margin: 40rpx 0 30rpx 0rpx;" class="fon28">¥<span style="font-size: 56rpx;font-weight: bold;">10</span></view>
|
|
||||||
<view class="fon24">满300元可使用</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #F5F5F5;">
|
|
||||||
<view class="fon28 col3 mar-s20">黄金会员专属优惠券</view>
|
|
||||||
<view>
|
|
||||||
<image src="/static/public/cancleQuan.png" style="width: 40rpx;height: 40rpx;border-radius: 100%;float: right;"></image>
|
|
||||||
</view>
|
|
||||||
<view class="fon20 col3 mar-x20">有效期:2021-09-06至2021-09-15</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 领取优惠券按钮 -->
|
|
||||||
<view @tap.stop="showQuan=false" style="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-top: 156rpx;margin-bottom: 20rpx;">领取优惠券</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -147,37 +101,127 @@
|
||||||
isExpress:true,
|
isExpress:true,
|
||||||
switchQuan:true,
|
switchQuan:true,
|
||||||
showQuan:false,
|
showQuan:false,
|
||||||
express:'韵达快递:2983625984729'
|
express:'韵达快递:2983625984729',
|
||||||
|
orderInfo:'',//订单信息
|
||||||
|
addressInfo:'',//地址信息
|
||||||
|
allPrice:0,//共计
|
||||||
|
allNum:0,//共
|
||||||
|
times:0,//点击次数
|
||||||
|
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.$toolAll.tools.isLogin()
|
this.$toolAll.tools.isLogin();
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
|
this.checkInfo(options.id);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goThere(){
|
cancleEv(){//取消订单
|
||||||
|
this.times++;
|
||||||
|
if(this.times==2){
|
||||||
|
this.$requst.post('order/cancel',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.$toolAll.tools.showToast('取消订单成功');
|
||||||
|
this.checkInfo(this.orderInfo.id);
|
||||||
|
this.times = 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.times = 0;
|
||||||
|
},1500)
|
||||||
|
this.$toolAll.tools.showToast('双击即可取消订单');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
paymentEv(){//立即支付
|
||||||
|
if(this.times==0){
|
||||||
|
this.$toolAll.tools.showToast('正在调起支付','loading',1500)
|
||||||
|
this.times++;
|
||||||
|
this.$requst.post('order/pay',{order_coding:this.orderInfo.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('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.times = 0;
|
||||||
|
this.$toolAll.tools.showToast('支付成功');
|
||||||
|
this.checkInfo(this.orderInfo.id);
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkInfo(id){//查询订单信息
|
||||||
|
this.$requst.post('user/order-detail',{id:id}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.allPrice = 0;
|
||||||
|
this.allNum = 0;
|
||||||
|
let narr = res.data;
|
||||||
|
narr.skus.forEach(item=>{
|
||||||
|
item.spu_cover = this.$http + item.spu_cover;
|
||||||
|
// 共多少件,总计
|
||||||
|
if(narr.is_score==0){
|
||||||
|
this.allPrice += item.price*item.num;
|
||||||
|
} else {
|
||||||
|
this.allPrice += item.score*item.num;
|
||||||
|
}
|
||||||
|
this.allNum += item.num;
|
||||||
|
})
|
||||||
|
if(narr.is_score==0){//商城订单的总计
|
||||||
|
this.allPrice = this.allPrice/100;
|
||||||
|
} else {//积分订单的总计
|
||||||
|
this.allPrice = this.allPrice;
|
||||||
|
}
|
||||||
|
this.orderInfo = narr;
|
||||||
|
let naddress = this.orderInfo.address.split(',');
|
||||||
|
if(naddress[0]!='自提'){
|
||||||
|
let nphone = this.$toolAll.tools.hideMPhone(naddress[1].trim())
|
||||||
|
this.addressInfo = {
|
||||||
|
userName:naddress[0].trim(),
|
||||||
|
userPhone:nphone,
|
||||||
|
userAddress:naddress[2].trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
copyCont(){//复制快递单号
|
||||||
|
if(this.times==0){
|
||||||
|
this.times++;
|
||||||
|
if(this.orderInfo.express_number!=null){
|
||||||
|
this.$toolAll.tools.clickCopy(this.orderInfo.express_number);
|
||||||
|
this.$toolAll.tools.showToast('复制快递单号成功');
|
||||||
|
} else this.$toolAll.tools.showToast('暂无可查询的快递信息');
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.times = 0;
|
||||||
|
},2000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goThere(val){//去这里
|
||||||
wx.getLocation({//获取当前经纬度
|
wx.getLocation({//获取当前经纬度
|
||||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
wx.openLocation({//使用微信内置地图查看位置。
|
wx.openLocation({//使用微信内置地图查看位置。
|
||||||
latitude: 22.5542080000,//要去的纬度-地址
|
latitude: 30.67554,//要去的纬度-地址
|
||||||
longitude: 113.8878770000,//要去的经度-地址
|
longitude: 104.010642,//要去的经度-地址
|
||||||
name: "宝安中心A地铁口",
|
name: val,
|
||||||
address:'宝安中心A地铁口'
|
address: val
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goPayment(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pagesA/immediatePayment/immediatePayment'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
copyCont(){
|
|
||||||
this.$toolAll.tools.clickCopy(this.express)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -57,31 +57,56 @@
|
||||||
//如果还没有生成海报
|
//如果还没有生成海报
|
||||||
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//弹框关闭
|
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//弹框关闭
|
||||||
else this.imgList = []
|
else this.imgList = []
|
||||||
console.log(this.imgList.length);
|
this.checkPoster();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
chooseImg(index){
|
checkPoster(){//查询海报模板
|
||||||
|
this.$requst.get('user/poster').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.list.length!=0){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
this.imgList.push(this.$http + item);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
chooseImg(index){//选择海报模板,并生成海报
|
||||||
this.haved = this.showBtn = true;
|
this.haved = this.showBtn = true;
|
||||||
this.imgSrc = this.imgList[index]
|
this.$toolAll.tools.showToast('正在生成海报...','loading',10000);
|
||||||
|
this.$requst.post('user/poster-info',{poster_src:this.imgList[index]}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
base64ToPath(res.data.poster).then(path => {
|
||||||
|
this.imgSrc = path;
|
||||||
|
}).catch(error => {})
|
||||||
|
this.$toolAll.tools.showToast('海报生成成功','none',1500);
|
||||||
|
} else {
|
||||||
|
this.$toolAll.tools.showToast('海报生成失败','none',1500);
|
||||||
|
this.haved = this.showBtn = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
shareEv(){
|
shareEv(){
|
||||||
this.haved = false
|
this.haved = false;
|
||||||
wx.showShareImageMenu({
|
wx.showShareImageMenu({
|
||||||
path: this.imgSrc,
|
path: this.imgSrc,
|
||||||
fail:(res=>{//取消分享
|
success:(res=>{
|
||||||
this.haved = true
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
|
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||||
let maiOjb = {
|
let maiOjb = {
|
||||||
e:4,//内容分享
|
e:4,//内容分享
|
||||||
t:new Date().getTime()//当前时间戳
|
t:new Date().getTime()//当前时间戳
|
||||||
}
|
}
|
||||||
this.$toolAll.tools.maiDian(maiOjb)
|
this.$toolAll.tools.maiDian(maiOjb);
|
||||||
|
}),
|
||||||
|
fail:(res=>{//取消分享
|
||||||
|
this.haved = true
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
comfirmev(){//立即生成事件
|
comfirmev(){//立即生成事件
|
||||||
this.$toolAll.tools.showToast('生成中...')
|
this.$toolAll.tools.showToast('生成中...')
|
||||||
this.isShowT = false
|
this.isShowT = false
|
||||||
|
// 单张海报
|
||||||
this.$requst.get('user/personal-poster').then(res=>{
|
this.$requst.get('user/personal-poster').then(res=>{
|
||||||
// console.log('生成个人海报成功:',res);
|
// console.log('生成个人海报成功:',res);
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
||||||
<image src="/static/public/weix.png" style="width: 42rpx;height: 42rpx;" mode=""></image>
|
<image src="/static/public/weix.png" style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||||
<view class="fon24 col9">分享</view>
|
<view class="fon24 col9">分享</view>
|
||||||
<button class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
<button class="posia-op" open-type="share">分享</button>
|
||||||
<!-- <button v-if="haveImg" class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button> -->
|
<!-- <button v-if="haveImg" class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="disac fc" @tap="tapConllection">
|
<view class="disac fc" @tap="tapConllection">
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
<view @tap="shareEv" class="disac posir lianShare" style="background-color: #38CE51;border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;">
|
<view @tap="shareEv" 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>
|
<image src="/static/public/bottom-shear.png" style="width: 47rpx;height: 47rpx;margin-left: 15rpx;margin-right: 8rpx;" mode="aspectFill"></image>
|
||||||
<view>分享给好友</view>
|
<view>分享给好友</view>
|
||||||
<button v-if="haveImg" class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
<button v-if="haveImg" class="posia-op" open-type="share">分享</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -382,6 +382,7 @@
|
||||||
if(this.haveImg == false) {
|
if(this.haveImg == false) {
|
||||||
this.vision = true
|
this.vision = true
|
||||||
} else {
|
} else {
|
||||||
|
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||||
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
|
||||||
let maiOjb = {
|
let maiOjb = {
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<view class="pad-x180" :style="{paddingTop: isNei!=3?(statusHNH+60)+'px':statusHNH+'px'}">
|
<view class="pad-x180" :style="{paddingTop: isNei!=3?(statusHNH+60)+'px':statusHNH+'px'}">
|
||||||
<!-- 自定义轮播 -->
|
<!-- 自定义轮播 -->
|
||||||
<view v-if="isLoading">
|
<view v-if="isLoading">
|
||||||
<swiper-pu :browseP="true" :bannerList="bannerList" :newHeight="'250'" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
|
<swiper-pu v-if="cateCurrent==0" :browseP="true" :bannerList="bannerList" :newHeight="'250'" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
|
||||||
<view v-if="isNei==3" style="width: 100%;height: 90rpx;line-height: 90rpx;padding-left: 62rpx;background: #3875F6;color: #FFFFFF;font-size: 40rpx;font-weight: bold;">积分:{{detailObj.score}}</view>
|
<!-- <view v-if="isNei==3" class="score-box">积分:{{detailObj.score}}</view> -->
|
||||||
<view v-show="cateCurrent==isNum">
|
<view v-show="cateCurrent==isNum">
|
||||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
|
@ -40,6 +40,7 @@
|
||||||
<image class="flexs" src="/static/public/huiy.png" mode="aspectFill"></image>
|
<image class="flexs" src="/static/public/huiy.png" mode="aspectFill"></image>
|
||||||
<view class="fon24 col9">{{detailObj.level_text}}</view>
|
<view class="fon24 col9">{{detailObj.level_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="fon24 col9">全部人员可买</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disac flexs">
|
<view class="disac flexs">
|
||||||
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
||||||
|
@ -54,28 +55,32 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pad-x30 pad-s10 borbot" v-if="isNei==2">
|
<view class="pad-x30 pad-s10 borbot" v-if="isNei==0 || isNei==1 ||isNei==2">
|
||||||
<view class="fon36 colf bold pbackc tc pad-sx20 radius45">倒计时:25小时35分26秒</view>
|
<view class="fon36 colf bold pbackc tc pad-sx20 radius45" v-if="daoTime!='活动已结束'">倒计时:{{daoTime}}</view>
|
||||||
|
<view class="fon36 colf bold pbackc tc pad-sx20 radius45" v-else>{{daoTime}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 规格 -->
|
<!-- 规格 -->
|
||||||
<view class="disjbac tc mar-s20">
|
<view class="dis tc mar-s20 fon28">
|
||||||
<view class="disjcac fon28 col3">规格:</view>
|
<view class="col3 flexs" style="margin-top: 6rpx;">类型:</view>
|
||||||
<view>
|
<view class="width100 disac fw" style="justify-content: flex-end;">
|
||||||
|
<view class="col6 mar-z30 mar-x20 molei" style="background: #F2F2F2;" v-for="(item,index) in skuCate" :key="index">{{item.title}}</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view>
|
||||||
<view class="fon26 col3 mar-x20">上市时间</view>
|
<view class="fon26 col3 mar-x20">上市时间</view>
|
||||||
<view class="fon24 colB3">2021.02.01</view>
|
<view class="fon24 colB3">{{detailObj.param_maket_time||'今年'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="fon26 col3 mar-x20">有效期</view>
|
<view class="fon26 col3 mar-x20">有效期</view>
|
||||||
<view class="fon24 colB3">三个月</view>
|
<view class="fon24 colB3">{{detailObj.param_validity_time||'永久'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="fon26 col3 mar-x20">可用时间</view>
|
<view class="fon26 col3 mar-x20">可用时间</view>
|
||||||
<view class="fon24 colB3">正常使用</view>
|
<view class="fon24 colB3">{{detailObj.param_use_time||'长期'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="fon26 col3 mar-x20">术前须知</view>
|
<view class="fon26 col3 mar-x20">术前须知</view>
|
||||||
<view class="fon24 colB3">无</view>
|
<view class="fon24 colB3">{{detailObj.param_notice||'无'}}</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 销量,库存 -->
|
<!-- 销量,库存 -->
|
||||||
|
@ -90,17 +95,17 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 拼团 -->
|
<!-- 拼团 -->
|
||||||
<view v-if="isNei==1" class="pad20 bacf mar-zy20 radius20 mar-s20">
|
<view v-if="isNei==1 && len!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||||
<view class="fon28 col3">{{len}}人正在拼团,可以直接参与</view>
|
<view class="fon28 col3">{{len}}人正在拼团,可以直接参与</view>
|
||||||
<swiper :autoplay="true" :interval="3000" :duration="1000" circular="true" class="shop-swiper" vertical="true">
|
<swiper :autoplay="true" :interval="3000" :duration="1000" circular="true" class="shop-swiper" :style="{height: (len==1 && pingArr[0].length==1)?'110rpx':'280rpx'}" vertical="true">
|
||||||
<swiper-item v-for="(item,index) in pingArr" :key="index">
|
<swiper-item v-if="pingArr[index].length!=0" v-for="(item,index) in pingArr" :key="index">
|
||||||
<view class="disjbac posir pad-x20" v-for="(itemt,indext) in item" :key="indext">
|
<view class="disjbac posir pad-x20" v-for="(itemt,indext) in item" :key="indext">
|
||||||
<image :src="itemt.imgSrc" mode="aspectFill" class="flexs big-img"></image>
|
<image :src="itemt.imgSrc" mode="aspectFill" class="flexs big-img"></image>
|
||||||
<view class="disjbac width100 mar-z20 pad-sx20">
|
<view class="disjbac width100 mar-z20 pad-sx20">
|
||||||
<view class="fon28 col3 width45">{{itemt.name}}</view>
|
<view class="fon28 col3 width45">{{itemt.name}}</view>
|
||||||
<view class="fon28 disjbac width100 col7D">
|
<view class="fon28 disjbac width100 col7D">
|
||||||
<view class="flexs">
|
<view class="flexs">
|
||||||
<view>还差1人拼成</view>
|
<view>还差{{itemt.num}}人拼成</view>
|
||||||
<view style="margin-top: 7rpx;">{{itemt.time_text}}</view>
|
<view style="margin-top: 7rpx;">{{itemt.time_text}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="comeTuan(itemt.id,index,indext)" class="colf bold flexs">去拼单</view>
|
<view @tap="comeTuan(itemt.id,index,indext)" class="colf bold flexs">去拼单</view>
|
||||||
|
@ -120,28 +125,61 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 医生 -->
|
<!-- 医生 -->
|
||||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
<view v-if="doctorList.length!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||||
<view class="fon28 col3 bold">医生</view>
|
<view class="fon28 col3 bold">医生</view>
|
||||||
<view class="disjbac posir pad-sx20">
|
<view @tap="goDoctor(item.id)" v-for="(item,index) in doctorList" :key="index" class="disjbac posir pad-sx20">
|
||||||
<image src="/static/public/like.png" mode="aspectFill" class="flexs big-img"></image>
|
<image :src="item.imgSrc" mode="aspectFill" class="flexs big-img"></image>
|
||||||
<view class="disjbac width100 mar-z20 pad-sx20">
|
<view class="disjbac width100 mar-z20 pad-sx20">
|
||||||
<view class="fon28 col3 width50">廖恒利医生</view>
|
<view class="fon28 col3 width50">{{item.name}}</view>
|
||||||
<view class="fon24 width50 col7D">擅长:毛发种植</view>
|
<view class="fon24 width50 col7D">擅长:{{item.goodAt}}</view>
|
||||||
</view>
|
|
||||||
<view class="duan-xian"></view>
|
|
||||||
</view>
|
|
||||||
<view class="disjbac pad-sx20">
|
|
||||||
<image src="/static/public/like.png" mode="aspectFill" class="flexs big-img"></image>
|
|
||||||
<view class="disjbac width100 mar-z20 pad-sx20">
|
|
||||||
<view class="fon28 col3 width50">廖恒利医生</view>
|
|
||||||
<view class="fon24 width50 col7D">擅长:毛发种植</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="(doctorList.length-1)!=index" class="duan-xian"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 产品推荐 -->
|
<!-- 产品推荐 -->
|
||||||
<view class="fon30 bold mar-s40 mar-x10 pad-zy50 pcol">产品推荐</view>
|
<view v-if="dataList.length!=0" class="fon30 bold mar-s40 mar-x10 pad-zy50 pcol">产品推荐</view>
|
||||||
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 案例日记 -->
|
||||||
|
<view v-show="cateCurrent==1" class="pad-zy20">
|
||||||
|
<view v-if="listArrone.length!=0">
|
||||||
|
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="listArrone"></list-pu>
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
|
<!-- 案例日记 -->
|
||||||
|
<view v-show="cateCurrent==2" class="pad-zy20">
|
||||||
|
<view v-if="listArrtwo.length!=0">
|
||||||
|
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="listArrtwo"></list-pu>
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
|
<!-- 效果模拟 -->
|
||||||
|
<view v-show="cateCurrent==3" class="pad-zy20">
|
||||||
|
<view v-if="listArrthree.length!=0">
|
||||||
|
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="listArrthree"></list-pu>
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
|
<!-- 科普视频 -->
|
||||||
|
<view v-show="cateCurrent==4" class="pad-zy20">
|
||||||
|
<view v-if="listArrfour.length!=0">
|
||||||
|
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="listArrfour"></list-pu>
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部导航 -->
|
<!-- 底部导航 -->
|
||||||
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
|
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
|
||||||
|
@ -149,22 +187,22 @@
|
||||||
<image @tap="backHome" class="posia backH" src="/static/public/back-home.png" mode="aspectFill"></image>
|
<image @tap="backHome" class="posia backH" src="/static/public/back-home.png" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="disac fon26 colf">
|
<view class="disac fon26 colf">
|
||||||
<view @tap="chooseShop" class="disjcac lianShare addCart-btn">加入购物车</view>
|
<view @tap="showTK = true" class="disjcac lianShare addCart-btn"><span v-if="isNei!=1">加入购物车</span><span v-else>单独购买</span></view>
|
||||||
<view @tap="chooseShop" class="disjcac lianShare mai-btn">立即购买</view>
|
<view @tap="showTK = true" class="disjcac lianShare mai-btn"><span v-if="isNei!=1">立即购买</span><span v-else>发起拼团</span></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
<view @tap="goShopCart" class="detail-cart-box">
|
<view @tap="goShopCart" class="detail-cart-box">
|
||||||
<view class="posir">
|
<view class="posir">
|
||||||
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
<view class="posia"><view>99</view></view>
|
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 客服 -->
|
<!-- 客服 -->
|
||||||
<view style="position: fixed;right: 16rpx;bottom: 140rpx;">
|
<view @tap="lianK" style="position: fixed;right: 16rpx;bottom: 140rpx;">
|
||||||
<view class="posir" style="width: 142rpx;height: 142rpx;">
|
<view class="posir" style="width: 142rpx;height: 142rpx;">
|
||||||
<image src="/static/public/kf-logo.png" mode="aspectFill" style="width: 142rpx;height: 142rpx;"></image>
|
<image src="/static/public/kf-logo.png" mode="aspectFill" style="width: 142rpx;height: 142rpx;"></image>
|
||||||
<button open-type="share" class="posia-op"></button>
|
<button v-if="haveImg" open-type="contact" class="posia-op"></button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 立即购买,加入购物车弹框 -->
|
<!-- 立即购买,加入购物车弹框 -->
|
||||||
|
@ -189,12 +227,12 @@
|
||||||
<span class="radius15 colf fon20 mar-z10" v-if="isNei==1">拼团活动</span>
|
<span class="radius15 colf fon20 mar-z10" v-if="isNei==1">拼团活动</span>
|
||||||
<span class="radius15 colf fon20 mar-z10" v-if="isNei==2">促销活动</span>
|
<span class="radius15 colf fon20 mar-z10" v-if="isNei==2">促销活动</span>
|
||||||
</view>
|
</view>
|
||||||
<span>{{skuDetail.title}}</span>
|
<span>{{detailObj.name}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-sx40 pad-zy30 col3">
|
<view class="dis mar-sx40 pad-zy30 col3">
|
||||||
<view class="fon28">类型:</view>
|
<view class="fon28 flexs" style="margin-top: 6rpx;">类型:</view>
|
||||||
<view class="fon26 disac">
|
<view class="fon26 disac fw width100" style="justify-content: flex-end;">
|
||||||
<view @tap="chooselei(indexl)" v-for="(item,indexl) in allRes.sku" :key="indexl" :class="leiIndex==indexl?'activelei':'molei'" :style="{background:leiIndex==indexl?publicColor:'#F2F2F2'}">{{item.title}}</view>
|
<view @tap="chooselei(indexl)" class="mar-x20" v-for="(item,indexl) in allRes.sku" :key="indexl" :class="leiIndex==indexl?'activelei':'molei'" :style="{background:leiIndex==indexl?publicColor:'#F2F2F2'}">{{item.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="disjbac mar-sx40 pad-zy30 fon28">
|
<view class="disjbac mar-sx40 pad-zy30 fon28">
|
||||||
|
@ -210,15 +248,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 加入购物车,立即购买 -->
|
<!-- 加入购物车,立即购买 -->
|
||||||
<view v-if="isNei!=1" class="disjbac pad-zy30 colf fon28 mar-x20">
|
<view v-if="isNei!=1" class="disjbac pad-zy30 colf fon32 mar-x50">
|
||||||
<view @tap="addCart" class="ev-btn pbackc">加入购物车</view>
|
<view @tap="addCart" class="ev-btn pbackc">加入购物车</view>
|
||||||
<view v-if="isNei!=3" @tap.stop="goGetReadyDan" class="ev-btn bcf8">立即购买</view>
|
<view v-if="isNei!=3" @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">立即购买</view>
|
||||||
<view v-else @tap.stop="goGetReadyDan" class="ev-btn bcf8">立即兑换</view>
|
<view v-else @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">立即兑换</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 单独购买,立即拼团 -->
|
<!-- 单独购买,立即拼团 -->
|
||||||
<view v-else class="disjbac pad-zy30 colf fon28 mar-x20">
|
<view v-else class="disjbac pad-zy30 colf fon32 mar-x50">
|
||||||
<view class="ev-btn" style="background: #C8C8C8;">单独购买</view>
|
<view @tap.stop="goGetReadyDan(2)" class="ev-btn" style="background: #C8C8C8;">单独购买</view>
|
||||||
<view class="ev-btn bcf8">立即拼团</view>
|
<view @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">发起拼团</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -226,7 +264,7 @@
|
||||||
<view v-if="showPD" class="pd-tk-box" @tap.stop="showPD=false">
|
<view v-if="showPD" class="pd-tk-box" @tap.stop="showPD=false">
|
||||||
<view class="bacf radius20 width100 posir" @tap.stop="showPD=true">
|
<view class="bacf radius20 width100 posir" @tap.stop="showPD=true">
|
||||||
<view class="fon28 col3">参与{{pinInfo.name}}的拼单</view>
|
<view class="fon28 col3">参与{{pinInfo.name}}的拼单</view>
|
||||||
<view class="fon24 col3">仅剩1个名额,{{pinInfo.time_text.slice(3)}}后结束</view>
|
<view class="fon24 col3">仅剩{{pinInfo.num}}个名额,{{pinInfo.time_text.slice(3)}}后结束</view>
|
||||||
<view class="disjcac">
|
<view class="disjcac">
|
||||||
<image :src="pinInfo.imgSrc" mode="aspectFill"></image>
|
<image :src="pinInfo.imgSrc" mode="aspectFill"></image>
|
||||||
<image src="/static/public/pin-jie.png" mode=""></image>
|
<image src="/static/public/pin-jie.png" mode=""></image>
|
||||||
|
@ -300,6 +338,8 @@
|
||||||
listArrthree:[],
|
listArrthree:[],
|
||||||
//科普视频
|
//科普视频
|
||||||
listArrfour:[],
|
listArrfour:[],
|
||||||
|
//医生列表
|
||||||
|
doctorList:[],
|
||||||
detailObj:{},//详情
|
detailObj:{},//详情
|
||||||
detailInfo:'',//富文本
|
detailInfo:'',//富文本
|
||||||
category_id:'',//栏目ID
|
category_id:'',//栏目ID
|
||||||
|
@ -310,7 +350,6 @@
|
||||||
showTK:false,
|
showTK:false,
|
||||||
leiIndex:0,
|
leiIndex:0,
|
||||||
showPD:false,
|
showPD:false,
|
||||||
orderId:'',//订单ID
|
|
||||||
isNei:'',//什么类型的商品
|
isNei:'',//什么类型的商品
|
||||||
pingArr:[],//拼团列表
|
pingArr:[],//拼团列表
|
||||||
len:0,//正在拼团人数
|
len:0,//正在拼团人数
|
||||||
|
@ -319,7 +358,13 @@
|
||||||
zhuImg:'',//cover图
|
zhuImg:'',//cover图
|
||||||
skuDetail:{},//sku详情
|
skuDetail:{},//sku详情
|
||||||
buyNum:1,//购买数量
|
buyNum:1,//购买数量
|
||||||
isScore:''
|
daoTime:'',//储存倒计时
|
||||||
|
csNum:0,//点击次数,
|
||||||
|
isBuy:0,//
|
||||||
|
ispt:0,//拼团的方式0默认发起拼团,1参与平台 2单独购买
|
||||||
|
isScore:0,//是否是积分
|
||||||
|
cartNum:0,
|
||||||
|
skuCate:[]//类型
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
|
@ -327,22 +372,23 @@
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
var ya = this;
|
var ya = this;
|
||||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.spu_id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||||
let maiOjb = {
|
let maiOjb = {
|
||||||
e:4,//内容分享
|
e:4,//内容分享
|
||||||
c:this.detailObj.id*1,
|
c:this.detailObj.spu_id*1,
|
||||||
t:new Date().getTime()//当前时间戳
|
t:new Date().getTime()//当前时间戳
|
||||||
}
|
}
|
||||||
this.$toolAll.tools.maiDian(maiOjb)
|
this.$toolAll.tools.maiDian(maiOjb)
|
||||||
if(ya.detailObj.share_img==null) ya.detailObj.share_img = ya.detailObj.cover;
|
if(ya.detailObj.share_img==null) ya.detailObj.share_img = ya.detailObj.cover;
|
||||||
var shareObj = {
|
var shareObj = {
|
||||||
title: `${ya.detailObj.name}`, // 默认是小程序的名称(可以写slogan等)
|
title: `${ya.detailObj.name}`, // 默认是小程序的名称(可以写slogan等)
|
||||||
path: `/pagesB/shopDetail/shopDetail?id=${this.detailObj.id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
path: `/pagesB/shopDetail/shopDetail?id=${this.detailObj.spu_id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||||
imageUrl: ya.$http + ya.detailObj.share_img//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
imageUrl: ya.$http + ya.detailObj.share_img//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||||
};
|
};
|
||||||
return shareObj;
|
return shareObj;
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
uni.removeStorageSync('chooseAddress');
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
if(options.category_id!=undefined) {
|
if(options.category_id!=undefined) {
|
||||||
|
@ -383,30 +429,68 @@
|
||||||
t:new Date().getTime()//当前时间戳
|
t:new Date().getTime()//当前时间戳
|
||||||
}
|
}
|
||||||
this.$toolAll.tools.maiDian(maiOjb);
|
this.$toolAll.tools.maiDian(maiOjb);
|
||||||
this.orderId = options.id;
|
if(options.isIntegral=="true"){this.isScore = 3;}
|
||||||
if(options.isText=='团购') this.isNei = 0;
|
this.checkDetail(options.id,options.is_activity);
|
||||||
if(options.isText=='拼团') this.isNei = 1;
|
this.cartNumEv();
|
||||||
if(options.isText=='限时') this.isNei = 2;
|
|
||||||
if(options.isText=='积分') this.isNei = 3;
|
|
||||||
if(options.isText=='') this.isNei = 10;
|
|
||||||
this.checkDetail(this.orderId);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goGetReadyDan(){//弹框中的立即购买
|
cartNumEv(){//购物车数量
|
||||||
|
let ntype = 'spu'
|
||||||
|
if(this.isScore==3) ntype = 'score';
|
||||||
|
this.$requst.post('order/shopping-cart-count',{type:ntype}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.cartNum = res.data.count;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkPTList(id){//查询正在拼团的人数
|
||||||
|
this.$requst.post('spu/group-list',{id:id}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.length!=0){
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
let pObj = {
|
||||||
|
id:item.id,
|
||||||
|
imgSrc:item.cover,
|
||||||
|
name:item.name,
|
||||||
|
num:item.num,//剩余拼团数量
|
||||||
|
time:item.time,//拼团截止时间
|
||||||
|
time_text:item.time_text//拼团截止时间展示文本
|
||||||
|
}
|
||||||
|
this.pingArr.push(pObj);
|
||||||
|
})
|
||||||
|
this.len = this.pingArr.length;
|
||||||
|
let n = 2; //假设每行显示2个
|
||||||
|
let lineNum = this.len % 2 === 0 ? this.len / 2 : Math.floor( (this.len / 2) + 2 );
|
||||||
|
let newPArr = [];
|
||||||
|
for (let i = 0; i < lineNum; i++) {
|
||||||
|
let temp = this.pingArr.slice(i*n, i*n+n);
|
||||||
|
newPArr.push(JSON.parse(JSON.stringify(temp)));
|
||||||
|
}
|
||||||
|
this.pingArr = newPArr;
|
||||||
|
}
|
||||||
|
} else this.$toolAll.tools.showToast(res.msg);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goGetReadyDan(index){//弹框中的立即购买
|
||||||
this.showTK = false;
|
this.showTK = false;
|
||||||
// {id:1,imgSrc:'/static/tabbar/mya.png',title:'【99皮皮节】【种植发际线】',price:3888,num:1,isActive:false},
|
// {id:1,imgSrc:'/static/tabbar/mya.png',title:'【99皮皮节】【种植发际线】',price:3888,num:1,isActive:false},
|
||||||
let nprice = '';
|
let nprice = '';
|
||||||
if(this.isNei==3) {
|
if(this.isNei==3) {
|
||||||
nprice = this.detailObj.score;
|
nprice = this.detailObj.score;
|
||||||
} else nprice = this.skuDetail.price/100;
|
} else nprice = this.skuDetail.price/100;
|
||||||
|
this.ispt = index;
|
||||||
|
if(index==2){nprice = this.skuDetail.original_price/100;}
|
||||||
let params = {
|
let params = {
|
||||||
id:this.skuDetail.id,
|
id:this.detailObj.spu_id,
|
||||||
imgSrc:this.$http + this.detailObj.cover,
|
imgSrc:this.$http + this.detailObj.cover,
|
||||||
coding:this.skuDetail.coding,
|
coding:this.skuDetail.coding,
|
||||||
price:nprice,
|
price:nprice,
|
||||||
num:this.buyNum,
|
num:this.buyNum,
|
||||||
title:this.detailObj.name,
|
title:this.detailObj.name,
|
||||||
is_score:this.detailObj.is_score
|
sku_name:this.skuDetail.title,
|
||||||
|
is_score:this.detailObj.is_score,
|
||||||
|
group_id:this.ispt,//0发起拼团 1参与拼团 2单独购买
|
||||||
|
is_only:this.ispt
|
||||||
}
|
}
|
||||||
let newList = [params];
|
let newList = [params];
|
||||||
uni.setStorageSync('orderList',newList);
|
uni.setStorageSync('orderList',newList);
|
||||||
|
@ -415,12 +499,18 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addCart(){//添加购物车事件
|
addCart(){//添加购物车事件
|
||||||
|
if(this.csNum==0){
|
||||||
|
this.csNum++;
|
||||||
|
this.$toolAll.tools.showToast('正在加入购物车...');
|
||||||
this.$requst.post('order/shopping-cart-add',{sku_id:this.skuDetail.id,num:this.buyNum}).then(res=>{
|
this.$requst.post('order/shopping-cart-add',{sku_id:this.skuDetail.id,num:this.buyNum}).then(res=>{
|
||||||
if(res.code==0) {
|
if(res.code==0) {
|
||||||
this.showTK = false;
|
this.showTK = false;
|
||||||
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
||||||
|
this.cartNumEv();
|
||||||
|
this.csNum = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
comeTuan(pinId,index,index2){//去拼单
|
comeTuan(pinId,index,index2){//去拼单
|
||||||
this.showPD = true;
|
this.showPD = true;
|
||||||
|
@ -433,6 +523,25 @@
|
||||||
moveHandle(){//禁止底层滑动
|
moveHandle(){//禁止底层滑动
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
lianK(){//客服
|
||||||
|
// if(!this.jieDuan){
|
||||||
|
// let isAuth = this.$toolAll.tools.returnAuth()
|
||||||
|
// if(!isAuth){
|
||||||
|
if(this.haveImg == false) {
|
||||||
|
this.vision = true
|
||||||
|
} else {
|
||||||
|
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||||
|
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
// } else this.jieDuan = true
|
||||||
|
// }
|
||||||
|
},
|
||||||
getphonenumber(e){//授权绑定手机号
|
getphonenumber(e){//授权绑定手机号
|
||||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||||
|
@ -449,19 +558,19 @@
|
||||||
chooseLike(e){//收藏事件
|
chooseLike(e){//收藏事件
|
||||||
let cateId = ''
|
let cateId = ''
|
||||||
let newArr = []
|
let newArr = []
|
||||||
if(this.cateCurrent==0) {
|
if(this.cateCurrent==1) {
|
||||||
newArr = this.listArrone
|
newArr = this.listArrone
|
||||||
cateId = newArr[e].id
|
cateId = newArr[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==1) {
|
if(this.cateCurrent==2) {
|
||||||
newArr = this.listArrtwo
|
newArr = this.listArrtwo
|
||||||
cateId = newArr[e].id
|
cateId = newArr[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==2) {
|
if(this.cateCurrent==3) {
|
||||||
newArr = this.listArrthree
|
newArr = this.listArrthree
|
||||||
cateId = newArr[e].id
|
cateId = newArr[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==3) {
|
if(this.cateCurrent==4) {
|
||||||
newArr = this.listArrfour
|
newArr = this.listArrfour
|
||||||
cateId = newArr[e].id
|
cateId = newArr[e].id
|
||||||
}
|
}
|
||||||
|
@ -473,19 +582,19 @@
|
||||||
},
|
},
|
||||||
comfirmev(e){//确认取消收藏事件
|
comfirmev(e){//确认取消收藏事件
|
||||||
let cateId = ''
|
let cateId = ''
|
||||||
if(this.cateCurrent==0) {
|
if(this.cateCurrent==1) {
|
||||||
this.listArrone[e].is_collected = 0
|
this.listArrone[e].is_collected = 0
|
||||||
cateId = this.listArrone[e].id
|
cateId = this.listArrone[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==1) {
|
if(this.cateCurrent==2) {
|
||||||
this.listArrtwo[e].is_collected = 0
|
this.listArrtwo[e].is_collected = 0
|
||||||
cateId = this.listArrtwo[e].id
|
cateId = this.listArrtwo[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==2) {
|
if(this.cateCurrent==3) {
|
||||||
this.listArrthree[e].is_collected = 0
|
this.listArrthree[e].is_collected = 0
|
||||||
cateId = this.listArrthree[e].id
|
cateId = this.listArrthree[e].id
|
||||||
}
|
}
|
||||||
if(this.cateCurrent==3) {
|
if(this.cateCurrent==4) {
|
||||||
this.listArrfour[e].is_collected = 0
|
this.listArrfour[e].is_collected = 0
|
||||||
cateId = this.listArrfour[e].id
|
cateId = this.listArrfour[e].id
|
||||||
}
|
}
|
||||||
|
@ -493,19 +602,6 @@
|
||||||
// 调用取消收藏事件
|
// 调用取消收藏事件
|
||||||
cancleCollectionShopEV({action:'collect',id:cateId})
|
cancleCollectionShopEV({action:'collect',id:cateId})
|
||||||
},
|
},
|
||||||
chooseLikex(e){//收藏事件
|
|
||||||
if(this.xgList[e].is_collected==0){
|
|
||||||
this.xgList[e].is_collected = 1
|
|
||||||
// 调用收藏事件
|
|
||||||
collectionShopEV({action:'collect',id:this.xgList[e].id})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
comfirmevx(e){//确认取消收藏事件
|
|
||||||
this.xgList[e].is_collected = 0
|
|
||||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
|
||||||
// 调用取消收藏事件
|
|
||||||
cancleCollectionShopEV({action:'collect',id:this.xgList[e].id})
|
|
||||||
},
|
|
||||||
buttonH(e){//授权成功
|
buttonH(e){//授权成功
|
||||||
this.haveImg = e
|
this.haveImg = e
|
||||||
if(e) {
|
if(e) {
|
||||||
|
@ -514,7 +610,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cancleEv(e){//取消授权
|
cancleEv(e){//取消授权
|
||||||
if(e==0) this.vision = false
|
// if(e==0) this.vision = false
|
||||||
},
|
},
|
||||||
backHome(){
|
backHome(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -526,15 +622,22 @@
|
||||||
this.vision = true
|
this.vision = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkDetail(newId){
|
checkDetail(newId,is_activity){
|
||||||
this.$requst.post('spu/detail',{id:newId}).then(res=>{
|
uni.request({
|
||||||
// console.log('详情数据:',res);
|
url:'https://hengmei.scdxtc.cn/api/spu/detail',
|
||||||
if(res.code==0){
|
data:{id:newId,is_activity:is_activity},
|
||||||
this.allRes = res.data;
|
method:'post',
|
||||||
this.zhuImg = this.$http + res.data.detail.cover;
|
header:{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code==0){
|
||||||
|
this.allRes = res.data.data;
|
||||||
|
this.zhuImg = this.$http + res.data.data.detail.cover;
|
||||||
// 默认显示的sku
|
// 默认显示的sku
|
||||||
if(res.data.sku.length!=0){
|
if(res.data.data.sku.length!=0){
|
||||||
res.data.sku.forEach(item=>{
|
res.data.data.sku.forEach(item=>{
|
||||||
if(item.is_default==1) {
|
if(item.is_default==1) {
|
||||||
this.skuDetail = item;
|
this.skuDetail = item;
|
||||||
}
|
}
|
||||||
|
@ -542,8 +645,8 @@
|
||||||
}
|
}
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
// 栏目类别
|
// 栏目类别
|
||||||
if(res.data.category.length!=0){
|
if(res.data.data.category.length!=0){
|
||||||
res.data.category.forEach((item,index)=>{
|
res.data.data.category.forEach((item,index)=>{
|
||||||
let cateObj = {
|
let cateObj = {
|
||||||
id:item.id,//栏目ID
|
id:item.id,//栏目ID
|
||||||
title:item.title,//栏目名称
|
title:item.title,//栏目名称
|
||||||
|
@ -568,10 +671,32 @@
|
||||||
}).exec()
|
}).exec()
|
||||||
}
|
}
|
||||||
// 详情
|
// 详情
|
||||||
this.detailObj = res.data.detail
|
this.detailObj = res.data.data.detail;
|
||||||
|
// 类型
|
||||||
|
this.skuCate = res.data.data.sku;
|
||||||
|
if(this.detailObj.activity_type=='group_buy') this.isNei = 0;
|
||||||
|
if(this.detailObj.activity_type=='group_make') this.isNei = 1;
|
||||||
|
if(this.detailObj.activity_type=='limit_time') this.isNei = 2;
|
||||||
|
if(this.detailObj.activity_type=='normal') {
|
||||||
|
console.log(this.isScore);
|
||||||
|
if(this.isScore==3) {
|
||||||
|
this.isNei = this.isScore;
|
||||||
|
} else this.isNei = 10;
|
||||||
|
}
|
||||||
|
let startTime = new Date(res.header.Date).getTime();
|
||||||
|
let endTime = new Date(res.data.data.detail.activity_end_at).getTime();
|
||||||
|
if(startTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||||
|
this.daoTime = "活动已结束";
|
||||||
|
} else {
|
||||||
|
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);//初始化
|
||||||
|
let timer = setInterval(()=>{//倒计时赋值
|
||||||
|
startTime = startTime + 1000;
|
||||||
|
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
let maiOjb = {
|
let maiOjb = {
|
||||||
e:1,//内容访问
|
e:1,//内容访问
|
||||||
c:this.detailObj.id*1,
|
c:this.detailObj.spu_id*1,
|
||||||
t:new Date().getTime()//当前时间戳
|
t:new Date().getTime()//当前时间戳
|
||||||
}
|
}
|
||||||
this.$toolAll.tools.maiDian(maiOjb)
|
this.$toolAll.tools.maiDian(maiOjb)
|
||||||
|
@ -602,35 +727,60 @@
|
||||||
if(this.detailObj.is_collected==1) this.isDetailConllection = true
|
if(this.detailObj.is_collected==1) this.isDetailConllection = true
|
||||||
// 富文本
|
// 富文本
|
||||||
this.detailInfo = this.$toolAll.tools.escape2Html(this.detailObj.content)
|
this.detailInfo = this.$toolAll.tools.escape2Html(this.detailObj.content)
|
||||||
|
// 医生列表
|
||||||
|
if(res.data.data.doctor.length!=0){
|
||||||
|
res.data.data.doctor.forEach(item=>{
|
||||||
|
let docObj = {
|
||||||
|
id:item.id,
|
||||||
|
imgSrc:item.headimg,
|
||||||
|
name:item.name,
|
||||||
|
goodAt:item.skill
|
||||||
|
}
|
||||||
|
this.doctorList.push(docObj);
|
||||||
|
})
|
||||||
|
}
|
||||||
// 正在平团人数
|
// 正在平团人数
|
||||||
if(this.isNei==1 && this.detailObj.activity_going.length!=0) {
|
if(this.isNei==1 && this.detailObj.activity_going.length!=0) {
|
||||||
this.detailObj.activity_going.forEach(item=>{
|
this.checkPTList(this.detailObj.id);//查询商品正在拼团列表
|
||||||
let pObj = {
|
}
|
||||||
id:item.id,
|
this.checkShopList();
|
||||||
imgSrc:this.$http + item.cover,
|
}
|
||||||
name:item.name,
|
|
||||||
num:item.num,//剩余拼团数量
|
|
||||||
time:item.time,//拼团截止时间
|
|
||||||
time_text:item.time_text//拼团截止时间展示文本
|
|
||||||
}
|
}
|
||||||
this.pingArr.push(pObj);
|
|
||||||
})
|
})
|
||||||
this.len = this.pingArr.length;
|
},
|
||||||
let n = 2; //假设每行显示2个
|
checkShopList(){// 产品推荐
|
||||||
let lineNum = this.len % 2 === 0 ? this.len / 2 : Math.floor( (this.len / 2) + 2 );
|
let params = {
|
||||||
let newPArr = [];
|
keyword:'',//商品关键字 支持模糊搜索
|
||||||
for (let i = 0; i < lineNum; i++) {
|
page:1,
|
||||||
let temp = this.pingArr.slice(i*n, i*n+n);
|
size:10,
|
||||||
newPArr.push(JSON.parse(JSON.stringify(temp)));
|
doctor_role:'',//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||||
|
doctor_name:'',//医生姓名 模糊搜索
|
||||||
|
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||||
|
disease_id:''//病种ID
|
||||||
}
|
}
|
||||||
this.pingArr = newPArr;
|
uni.request({
|
||||||
// 产品推荐
|
url:'https://hengmei.scdxtc.cn/api/spu/list',
|
||||||
if(res.data.product.length!=0){
|
data:params,
|
||||||
res.data.product.forEach(item=>{
|
method:'post',
|
||||||
|
header:{
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if(res.data.code==0){
|
||||||
|
this.dataList = [];
|
||||||
|
if(res.data.data.list.length!=0){
|
||||||
|
res.data.data.list.forEach(item=>{
|
||||||
let tuan = false,ping = false,xian = false,integral = false;
|
let tuan = false,ping = false,xian = false,integral = false;
|
||||||
if(item.activity_type=='group_make') ping = true;
|
if(item.activity_type=='group_make') ping = true;
|
||||||
if(item.activity_type=='group_buy') tuan = true;
|
if(item.activity_type=='group_buy') tuan = true;
|
||||||
if(item.activity_type=='limit_time') xian = 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 = {
|
let obj = {
|
||||||
id:item.id,
|
id:item.id,
|
||||||
imgSrc: this.$http + item.cover,
|
imgSrc: this.$http + item.cover,
|
||||||
|
@ -638,31 +788,35 @@
|
||||||
zhePrice:item.price/100,
|
zhePrice:item.price/100,
|
||||||
yuanPrice:item.original_price/100,
|
yuanPrice:item.original_price/100,
|
||||||
integral:'',
|
integral:'',
|
||||||
isTuan:tuan,
|
isTuan:tuan,//是否是团购
|
||||||
isPing:ping,
|
isPing:ping,//是否是拼团活动
|
||||||
isXian:xian,
|
isXian:xian,//是否是限时活动
|
||||||
isIntegral:integral,
|
isIntegral:integral,//是否是积分
|
||||||
grade:'',
|
grade:'',
|
||||||
disease_name:item.disease_name,//病种名称
|
disease_name:item.disease_name,//病种名称
|
||||||
disease_id:item.disease_id,//病种ID
|
disease_id:item.disease_id,//病种ID
|
||||||
activity_end_at:'',//限时结束时间
|
reponseTime:res.header.Date,//接口响应时间
|
||||||
activity_group_cover:[],//参团人的头像
|
activity_end_at:item.activity_end_at,//限时结束时间
|
||||||
activity_group_num:''//已经参团人数
|
activity_group_cover:group_cover,//参团人的头像
|
||||||
|
activity_group_num:item.activity_group_num,//已经参团人数
|
||||||
}
|
}
|
||||||
this.dataList.push(obj)
|
this.dataList.push(obj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},error=>{})
|
})
|
||||||
},
|
|
||||||
chooseShop(){//加入购物车,立即购买调起弹框事件
|
|
||||||
this.showTK = true;
|
|
||||||
},
|
},
|
||||||
goShopCart(){//去购物车事件
|
goShopCart(){//去购物车事件
|
||||||
if(this.isNei==3) this.isScore = 'score';
|
let isScore = '';
|
||||||
|
if(this.isNei==3) isScore = 'score';
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:`/pagesA/shopCart/shopCart?isScore=${this.isScore}`
|
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goDoctor(id){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:`/pagesB/doctorDetail/doctorDetail?doctor_id=${id}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
choosecateEv(e){
|
choosecateEv(e){
|
||||||
|
@ -670,10 +824,10 @@
|
||||||
this.$requst.post('archives/category',{category_id:this.cateList[e].id,keyword:''}).then(res=>{
|
this.$requst.post('archives/category',{category_id:this.cateList[e].id,keyword:''}).then(res=>{
|
||||||
// console.log('该分类下的列表:',res);
|
// console.log('该分类下的列表:',res);
|
||||||
if(res.code==0){
|
if(res.code==0){
|
||||||
if(e==0 && this.active!=e) this.listArrone = []
|
if(e==1 && this.active!=e) this.listArrone = []
|
||||||
if(e==1 && this.active!=e) this.listArrtwo = []
|
if(e==2 && this.active!=e) this.listArrtwo = []
|
||||||
if(e==2 && this.active!=e) this.listArrthree = []
|
if(e==3 && this.active!=e) this.listArrthree = []
|
||||||
if(e==3 && this.active!=e) this.listArrfour = []
|
if(e==4 && this.active!=e) this.listArrfour = []
|
||||||
if(res.data.list.list.length!=0){
|
if(res.data.list.list.length!=0){
|
||||||
res.data.list.list.forEach(item=>{
|
res.data.list.list.forEach(item=>{
|
||||||
let num = item.video.search(".mp4")
|
let num = item.video.search(".mp4")
|
||||||
|
@ -694,10 +848,10 @@
|
||||||
isVideo:isVideo//是否是视频
|
isVideo:isVideo//是否是视频
|
||||||
}
|
}
|
||||||
if(item.cover!=''){
|
if(item.cover!=''){
|
||||||
if(e==0 && this.active!=e) this.listArrone.push(arrObj)
|
if(e==1 && this.active!=e) this.listArrone.push(arrObj)
|
||||||
if(e==1 && this.active!=e) this.listArrtwo.push(arrObj)
|
if(e==2 && this.active!=e) this.listArrtwo.push(arrObj)
|
||||||
if(e==2 && this.active!=e) this.listArrthree.push(arrObj)
|
if(e==3 && this.active!=e) this.listArrthree.push(arrObj)
|
||||||
if(e==3 && this.active!=e) this.listArrfour.push(arrObj)
|
if(e==4 && this.active!=e) this.listArrfour.push(arrObj)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -705,11 +859,14 @@
|
||||||
},error=>{})
|
},error=>{})
|
||||||
},
|
},
|
||||||
tapConllection(){//收藏、取消收藏事件
|
tapConllection(){//收藏、取消收藏事件
|
||||||
let isLikeCon = 'collect'
|
let isLikeCon = 'collect';
|
||||||
|
let nid = '';
|
||||||
|
if(this.detailObj.is_activity==1) nid=this.detailObj.spu_id;
|
||||||
|
else nid=this.detailObj.id;
|
||||||
// 调用收藏事件
|
// 调用收藏事件
|
||||||
if(!this.isDetailConllection) collectionShopEV({action:isLikeCon,id:this.detailObj.id})
|
if(!this.isDetailConllection) collectionShopEV({action:isLikeCon,id:nid})
|
||||||
// 调用取消收藏事件
|
// 调用取消收藏事件
|
||||||
else cancleCollectionShopEV({action:isLikeCon,id:this.detailObj.id})
|
else cancleCollectionShopEV({action:isLikeCon,id:nid})
|
||||||
this.isDetailConllection = !this.isDetailConllection
|
this.isDetailConllection = !this.isDetailConllection
|
||||||
},
|
},
|
||||||
backTop(){//回到顶部事件
|
backTop(){//回到顶部事件
|
||||||
|
|
|
@ -0,0 +1,467 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 状态栏 -->
|
||||||
|
<status-nav :titleVal="'商品搜索'" :statusTitle="true"></status-nav>
|
||||||
|
<!-- 输入框 -->
|
||||||
|
<view class="search-input-box bacf" :style="{paddingTop: statusHNH+'px'}">
|
||||||
|
<view class="disac pad-zy30 mar-s20">
|
||||||
|
<!-- 输入框 -->
|
||||||
|
<input @confirm="searchEv" style="border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;" class="width100 fon34 radius10" type="text" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<!-- 分类标题 -->
|
||||||
|
<view style="background: #FFFFFF;font-size: 24rpx;" class="disjbac pad-zy20 pad-s20">
|
||||||
|
<view v-for="(item,index) in shopCate" @tap="chooseShopCate(index)" :class="activeIndex==index?'activecate':'shopMo'" :style="{background:activeIndex==index?publicColor:'#F2F2F2'}" :key="index"><span>{{item}}</span></view>
|
||||||
|
</view>
|
||||||
|
<!-- 筛选结果 -->
|
||||||
|
<view v-if="isClick" class="pad-zy50 disac fw pad-x20">
|
||||||
|
<view class="col3 fon28 mar-s30">筛选:</view>
|
||||||
|
<view v-for="(item,indexx) in shaiList" :key="indexx">{{item}} <view class="mar-z10" @tap="deleteSX(indexx)">×</view></view>
|
||||||
|
</view>
|
||||||
|
<view v-if="isXiao">
|
||||||
|
<view class="pad-zy30">
|
||||||
|
<view class="mar-s50 mar-x20 fon28 bold">{{cateTitle}}</view>
|
||||||
|
<view class="disac fw">
|
||||||
|
<view @tap="chooseBing(indexb)" v-for="(itemb,indexb) in bingzList" class="mar-y30 fon26 mar-s30" :key="indexb" :class="itemb.isActive?'activebcate':'shopBMo'" :style="{background:itemb.isActive?publicColor:'#F2F2F2'}">{{itemb.title}}</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="activeIndex==1">
|
||||||
|
<view class="fon28 bold mar-sx40">医生选择</view>
|
||||||
|
<input type="text" class="mar-x40" value="" placeholder="请输入医生姓名并选择" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 重置、筛选 -->
|
||||||
|
<view class="disjbac pad-zy20 mar-s50 mar-x30 pad-s20">
|
||||||
|
<view @tap="chongz">重置</view>
|
||||||
|
<view @tap="shaix">筛选</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||||
|
<!-- 数据列表 -->
|
||||||
|
<view v-if="loading" :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||||
|
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
|
||||||
|
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}商品`"></nothing-page>
|
||||||
|
</view>
|
||||||
|
<!-- 购物车 -->
|
||||||
|
<navigator url="/pagesA/shopCart/shopCart?isScore=false" hover-class="none">
|
||||||
|
<view class="cart-box">
|
||||||
|
<view class="posir">
|
||||||
|
<image src="/static/public/cart.png" mode="aspectFill"></image>
|
||||||
|
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</navigator>
|
||||||
|
<!-- 历史搜索和热门搜索 -->
|
||||||
|
<view class="pad-z30 mar-s30" v-if="isList">
|
||||||
|
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
||||||
|
</view>
|
||||||
|
<view v-else class="pad-zy20 mar-s20">
|
||||||
|
<!-- 列表 -->
|
||||||
|
<view v-if="dataList.length!=0">
|
||||||
|
|
||||||
|
</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>
|
||||||
|
</view>
|
||||||
|
<!-- 弹框 -->
|
||||||
|
<pu-po :isShowT="isShowT" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||||
|
<!-- 返回顶部 -->
|
||||||
|
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||||
|
import shopList from '@/components/shop-list.vue';
|
||||||
|
import {cartNum} from '@/jsFile/publicAPI.js';
|
||||||
|
export default {
|
||||||
|
components:{
|
||||||
|
cateTu,
|
||||||
|
shopList
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statusHNH:uni.getStorageSync('statusHNH'),
|
||||||
|
searchVal:'',//输入框的值
|
||||||
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||||
|
reSearchList:[//历史记录列表
|
||||||
|
{
|
||||||
|
title:'历史搜索',
|
||||||
|
src:'/static/public/del-icon.png',
|
||||||
|
list:[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'热门搜索',
|
||||||
|
src:'',
|
||||||
|
list:[
|
||||||
|
// {content:'秃顶种植需要的条件'},
|
||||||
|
// {content:'眉毛种植的是什么'},
|
||||||
|
// {content:'那些人能种植'},
|
||||||
|
// {content:'眉毛种植需要多少钱'},
|
||||||
|
// {content:'那些人能种植'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isShowT:false,//是否显示弹框
|
||||||
|
isList:true,//是否显示默认显示
|
||||||
|
dataList:[//小课堂数据列表
|
||||||
|
|
||||||
|
],
|
||||||
|
showTop:false,//是否显示返回顶部
|
||||||
|
newCurrent:0,
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
total:'',//总数
|
||||||
|
isZanw:true,
|
||||||
|
activeIndex:'-1',
|
||||||
|
shopCate:['全部病种','全部医生','全部活动'],
|
||||||
|
cateTitle:'',
|
||||||
|
bingzList:[],//小分类列表
|
||||||
|
zanBingArr:[],//暂存小分类
|
||||||
|
isXiao:false,//
|
||||||
|
titleHeight:'',//标题高度
|
||||||
|
shaiList:[],//筛选后的结果列表
|
||||||
|
isClick:false,//是否点击了筛选
|
||||||
|
dataList:[],
|
||||||
|
searchVal:'',//关键词
|
||||||
|
doctor_role:'',//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||||
|
doctor_name:'',//医生姓名 模糊搜索
|
||||||
|
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||||
|
disease_id:'',//病种ID
|
||||||
|
loading:false,
|
||||||
|
cartNum:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPageScroll(e) {
|
||||||
|
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||||
|
},
|
||||||
|
onReachBottom() {//触底事件
|
||||||
|
if(this.total!=this.dataList.length){
|
||||||
|
this.page++
|
||||||
|
this.searchEv()//调用自主预约列表事件
|
||||||
|
} else {
|
||||||
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||||
|
this.isZanw = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||||
|
this.searchVal = options.keyWorld
|
||||||
|
this.searchEv()
|
||||||
|
}
|
||||||
|
this.checkSearchHistory()
|
||||||
|
this.checkKey()
|
||||||
|
// 缓存状态栏+标题栏的高度
|
||||||
|
const query = wx.createSelectorQuery()
|
||||||
|
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||||
|
// console.log('状态栏+标题栏:',rect.height);
|
||||||
|
this.titleHeight = rect.height
|
||||||
|
}).exec()
|
||||||
|
this.checkSX();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.$toolAll.tools.isLogin()
|
||||||
|
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv();
|
||||||
|
this.cartNumEv();//查询购物车数量
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
cartNumEv(){//购物车数量
|
||||||
|
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.cartNum = res.data.count;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async checkSX(){//商品筛选条件
|
||||||
|
this.$requst.get('spu/condition').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.zanBingArr = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
await this.checkShopList();
|
||||||
|
},
|
||||||
|
chooseShopCate(index){//大分类选择事件
|
||||||
|
if(this.activeIndex==index && this.isXiao) {
|
||||||
|
this.isXiao = false;
|
||||||
|
} else this.isXiao = true;
|
||||||
|
this.bingzList = [];
|
||||||
|
this.isClick = false;
|
||||||
|
this.activeIndex = index;
|
||||||
|
let arr = [];
|
||||||
|
let obj = {};
|
||||||
|
if(this.activeIndex==0) {
|
||||||
|
this.cateTitle = '病种选择';
|
||||||
|
this.zanBingArr.disease.forEach(item=>{
|
||||||
|
obj = {
|
||||||
|
pid: item.pid,
|
||||||
|
title: item.name,
|
||||||
|
id: item.id,
|
||||||
|
sort: item.sort,
|
||||||
|
isActive:false
|
||||||
|
}
|
||||||
|
arr.push(obj);
|
||||||
|
})
|
||||||
|
this.bingzList = arr;
|
||||||
|
this.bingzList.unshift({pid: '', title: "全部", id: '', sort: '',isActive:true});
|
||||||
|
this.bingzList.push({pid: '', title: "其他", id: '', sort: ''});
|
||||||
|
}
|
||||||
|
if(this.activeIndex==1) {
|
||||||
|
this.cateTitle = '职位选择';
|
||||||
|
this.zanBingArr.doctor_roles.forEach(item=>{
|
||||||
|
obj = {
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
title: item.title,
|
||||||
|
pid: item.pid,
|
||||||
|
is_group: item.is_group,
|
||||||
|
isActive:false
|
||||||
|
}
|
||||||
|
arr.push(obj);
|
||||||
|
})
|
||||||
|
this.bingzList = arr;
|
||||||
|
this.bingzList.unshift({id: '', name: '', title: "全部", pid: '', is_group: '',isActive:true});
|
||||||
|
}
|
||||||
|
if(this.activeIndex==2) {
|
||||||
|
this.cateTitle = '活动选择';
|
||||||
|
this.zanBingArr.activity.forEach(item=>{
|
||||||
|
obj = {
|
||||||
|
name: item.name,
|
||||||
|
title: item.title,
|
||||||
|
isActive:false
|
||||||
|
}
|
||||||
|
arr.push(obj);
|
||||||
|
})
|
||||||
|
this.bingzList = arr;
|
||||||
|
this.bingzList.unshift({name: '', title: "全部",isActive:true});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkShopList(){
|
||||||
|
let params = {
|
||||||
|
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||||
|
page:1,
|
||||||
|
size:10,
|
||||||
|
doctor_role:this.doctor_role,//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||||
|
doctor_name:this.doctor_name,//医生姓名 模糊搜索
|
||||||
|
activity:this.activity,//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||||
|
disease_id:this.disease_id//病种ID
|
||||||
|
}
|
||||||
|
uni.request({
|
||||||
|
url:'https://hengmei.scdxtc.cn/api/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){
|
||||||
|
this.dataList = [];
|
||||||
|
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,//病种名称
|
||||||
|
disease_id:item.disease_id,//病种ID
|
||||||
|
reponseTime:res.header.Date,//接口响应时间
|
||||||
|
activity_end_at:item.activity_end_at,//限时结束时间
|
||||||
|
activity_group_cover:group_cover,//参团人的头像
|
||||||
|
activity_group_num:item.activity_group_num,//已经参团人数
|
||||||
|
}
|
||||||
|
this.dataList.push(obj)
|
||||||
|
})
|
||||||
|
this.loading = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// this.$requst.post('spu/list',params).then(res=>{
|
||||||
|
// if(res.code==0){
|
||||||
|
// this.dataList = [];
|
||||||
|
// if(res.data.list.length!=0){
|
||||||
|
// res.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,//病种名称
|
||||||
|
// disease_id:item.disease_id,//病种ID
|
||||||
|
// activity_end_at:item.activity_end_at,//限时结束时间
|
||||||
|
// activity_group_cover:group_cover,//参团人的头像
|
||||||
|
// activity_group_num:item.activity_group_num,//已经参团人数
|
||||||
|
// }
|
||||||
|
// this.dataList.push(obj)
|
||||||
|
// })
|
||||||
|
// this.loading = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
chooseBing(index){//小分类选择事件
|
||||||
|
this.bingzList.forEach(item=>{
|
||||||
|
item.isActive = false;
|
||||||
|
})
|
||||||
|
this.bingzList[index].isActive = true;
|
||||||
|
this.shaiList[this.activeIndex] = this.bingzList[index].title;
|
||||||
|
console.log(this.shaiList);
|
||||||
|
},
|
||||||
|
chongz(){//重置
|
||||||
|
this.isClick = false;
|
||||||
|
this.shaiList = []
|
||||||
|
},
|
||||||
|
shaix(){//筛选
|
||||||
|
this.isXiao = false
|
||||||
|
this.isClick = true;
|
||||||
|
this.checkShopList();
|
||||||
|
},
|
||||||
|
deleteSX(index){//删除筛选
|
||||||
|
this.shaiList.splice(index,1);
|
||||||
|
if(this.shaiList.length==0){
|
||||||
|
this.isClick = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkKey(){//查询热搜关键词事件
|
||||||
|
this.$requst.get('index/hot-keywords').then(res=>{
|
||||||
|
// console.log('关键词列表:',res);
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.length!=0){
|
||||||
|
res.data.forEach(item=>{
|
||||||
|
let reObj = {
|
||||||
|
id:item.id,
|
||||||
|
content:item.keyword
|
||||||
|
}
|
||||||
|
this.reSearchList[1].list.push(reObj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
checkSearchHistory(){//查询历史搜索的搜索记录
|
||||||
|
this.$requst.post('user/search-history',{page:this.page,size:this.size}).then(res=>{
|
||||||
|
// console.log(res);
|
||||||
|
if(res.code==0){
|
||||||
|
if(res.data.list.length!=0){
|
||||||
|
res.data.list.forEach(item=>{
|
||||||
|
if(item.keyword!=null){
|
||||||
|
let searchObj = {
|
||||||
|
id:item.id,
|
||||||
|
content:item.keyword
|
||||||
|
}
|
||||||
|
this.reSearchList[0].list.push(searchObj)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
searchEv(){//搜索事件
|
||||||
|
this.$toolAll.tools.showToast('搜索中...')
|
||||||
|
this.$requst.post('archives/category',{page:this.page,size:this.size,keyword:this.searchVal}).then(res=>{
|
||||||
|
// console.log('搜索提交:',res);
|
||||||
|
if(res.code==0){
|
||||||
|
// 获取列表
|
||||||
|
if(this.page==1) this.dataList = []
|
||||||
|
this.total = res.data.list.total
|
||||||
|
if(res.data.list.list.length!=0){
|
||||||
|
res.data.list.list.forEach(item=>{
|
||||||
|
let tObj = {
|
||||||
|
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:'/static/public/logo.png',//发布者头像
|
||||||
|
name:'恒美植发',//发布者昵称
|
||||||
|
isVideo:item.video.includes(".mp4")//是否是视频
|
||||||
|
}
|
||||||
|
this.dataList.push(tObj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let obj = {
|
||||||
|
content:this.searchVal
|
||||||
|
}
|
||||||
|
this.reSearchList[0].list.push(obj)
|
||||||
|
this.isList = false
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
delev(){//删除事件
|
||||||
|
this.isShowT = true
|
||||||
|
},
|
||||||
|
comfirmev(){//清空历史搜索确认事件
|
||||||
|
this.isShowT = false
|
||||||
|
this.$requst.post('user/clear-search').then(res=>{
|
||||||
|
if(res.code==0){
|
||||||
|
this.$toolAll.tools.showToast('已清空')
|
||||||
|
this.reSearchList[0].list = []//清空搜索历史
|
||||||
|
}
|
||||||
|
},error=>{})
|
||||||
|
},
|
||||||
|
cancleev(){//取消事件
|
||||||
|
this.isShowT = false
|
||||||
|
},
|
||||||
|
chooseTwo(index){//二级分类选择
|
||||||
|
// console.log('二级分类:',index);
|
||||||
|
this.isZanw = true
|
||||||
|
this.page = 1
|
||||||
|
this.newCurrent = index
|
||||||
|
this.searchEv()
|
||||||
|
},
|
||||||
|
backTop(){//回到顶部事件
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
duration: 300
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
|
@ -8,7 +8,7 @@
|
||||||
<view class="radius20 fon28 col3 mar-sx20">
|
<view class="radius20 fon28 col3 mar-sx20">
|
||||||
<view class="disac">
|
<view class="disac">
|
||||||
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
|
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
|
||||||
<input class="fon28 width100" type="text" v-model="keyword" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" />
|
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" />
|
||||||
</view>
|
</view>
|
||||||
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
|
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue