模板框架上传
commit
2561c40930
|
@ -0,0 +1,8 @@
|
|||
/vendor
|
||||
/node_modules
|
||||
/public/storage
|
||||
/unpackage
|
||||
Homestead.yaml
|
||||
Homestead.json
|
||||
.env
|
||||
.idea
|
|
@ -0,0 +1,16 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
<script>
|
||||
import toolAll from '@/jsFile/tools.js';
|
||||
import requst from '@/jsFile/requst.js';
|
||||
export default {
|
||||
// 全局域名配置
|
||||
globalData:{
|
||||
// domainName:'https://hengmei.scdxtc.cn/api/',
|
||||
domainName:'https://hm.hmzfyy.cn/api/',
|
||||
},
|
||||
onLaunch: function() {
|
||||
toolAll.tools.clearClog();//去除体验版和正式版的所有输出日志
|
||||
// 主题颜色
|
||||
// toolAll.tools.zhuColorT();
|
||||
uni.request({
|
||||
url: `${this.globalData.domainName}index/mini-program-setting`,
|
||||
method: 'GET',
|
||||
data: '',
|
||||
header: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: res => {
|
||||
// console.log('反的结果===>',res);
|
||||
if (res.statusCode == 200) {
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync('publicColor', res.data.data.mainColor) //#3875F6 #2E8B57
|
||||
// uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onShow: function() {
|
||||
|
||||
// uni.clearStorageSync()
|
||||
if(uni.getStorageSync('token')!='') {
|
||||
toolAll.tools.daoTime();
|
||||
toolAll.tools.networkStatus();//检查当前网络状态
|
||||
toolAll.tools.updaX();//检测版本更新
|
||||
}
|
||||
setTimeout(()=>{
|
||||
toolAll.tools.overdue();//查询是否第一次授权
|
||||
},3000)
|
||||
toolAll.tools.isVedio();
|
||||
toolAll.tools.checkQuan();
|
||||
},
|
||||
onHide: function() {
|
||||
toolAll.tools.closeTimer();//清空埋点倒计时
|
||||
uni.removeStorageSync('isQuan');
|
||||
uni.removeStorageSync('quanImg');
|
||||
uni.removeStorageSync('quanId');
|
||||
uni.removeStorageSync('isQuan');
|
||||
uni.removeStorageSync('firstTime');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
@import url("./commons/hengmei.css");
|
||||
@import url("./commons/animate.min.css");
|
||||
page {background-color: rgba(244, 244, 244, 1);}
|
||||
</style>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,583 @@
|
|||
/* 首页 */
|
||||
.status-box{position: fixed;top: 0;left: 0;right: 0;z-index: 10;}
|
||||
.status-nav{width: 100%;position: relative;padding: 30rpx 0;display: flex;align-items: center;}
|
||||
.tab-title{font-size: 36rpx;font-weight: bold;color: #333333;width: 100%;}
|
||||
.tcenter{text-align: center;}
|
||||
.input-box{width: 100%;}
|
||||
.input-box>view{background-color: #FFFFFF;margin: 0 40rpx;height: 80rpx;border-radius: 10rpx;padding: 0 17rpx;}
|
||||
.searchImg{width: 28rpx;height: 28rpx;margin-right: 12rpx;}
|
||||
.linev{height: 39rpx;border: 2rpx dashed rgba(136, 136, 136, 1);}
|
||||
.searchT{font-size: 27rpx;margin: 0 23rpx 0 31rpx;}
|
||||
.gongg-box{width: 25%;color: #2C2C2C;}
|
||||
.gongg-box .img-box image{width: 108rpx;height: 108rpx;}
|
||||
.zou> image{height: auto;}
|
||||
.fawen-img{width: 335rpx;height: 400rpx;}
|
||||
.fawen-itemImg{height: 190rpx;}
|
||||
.kitemm{background-color: #E0E0E0;}
|
||||
.reitem-box{background: #F4F4F4;margin-right: 18rpx;padding: 20rpx;}
|
||||
.reitem-box>image{width: 20rpx;height: 23rpx;margin-right: 18rpx;}
|
||||
.reitem{width: 146rpx;height: 65rpx;border-radius: 20rpx;line-height: 65rpx;text-align: center;}
|
||||
.list-box{width: 48.4%;}
|
||||
.list-like-box{top: 18rpx;right: 18rpx;z-index: 1;}
|
||||
.list-like-box>image:first-child {opacity: 0.5;}
|
||||
.list-like-box>image{width: 69rpx;height: 69rpx;}
|
||||
.list-cont-box{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;}
|
||||
.list-cont-box15{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 15rpx;border-bottom-right-radius: 15rpx;}
|
||||
.list-headimg{width: 28rpx;height: 28rpx;margin-right: 6rpx;border-radius: 100%;}
|
||||
.home-quan-box{background: rgba(0,0,0,.54);position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 11;display: flex;justify-content: center;flex-direction: column;align-items: center;}
|
||||
.home-quan-box image:first-child{width: 542rpx;height: 600rpx;}
|
||||
.home-quan-box image:last-child{width: 96rpx;height: 96rpx;margin-top: 56rpx;}
|
||||
.shopKf{position: fixed;right: 16rpx;bottom: 140rpx;z-index: 999;}
|
||||
/* 分类 */
|
||||
.catemo{color: #4D4D4D;padding: 20rpx 10rpx;text-align: center;margin-left: 10rpx;}
|
||||
.cateActive{background-color: #F5F5F5;border-radius: 10rpx 0rpx 0rpx 10rpx;padding: 20rpx 10rpx;text-align: center;margin-left: 10rpx;}
|
||||
.cate-tu-item{padding: 16rpx 20rpx;background-color: #DFDFDF;}
|
||||
.cate-box{position: fixed;top: 0;left: 0;bottom: 140rpx;background-color: #FFFFFF;}
|
||||
.list-min{min-height: 260rpx;}
|
||||
.cate-box .fon26 .mar-s20:first-child {margin-top: 50rpx;}
|
||||
/* 搜索 */
|
||||
.search-input-box{width: 100%;padding-bottom: 20rpx;}
|
||||
.tank-box{margin: 0 85rpx;}
|
||||
.tank-box-itemone{font-size: 32rpx;color: #343434;margin: 90rpx 0;}
|
||||
.tank-btn{width: 240rpx;}
|
||||
/* 我的页面 */
|
||||
.icon-box>image:nth-child(1){width: 37rpx;height: 38rpx;}
|
||||
.icon-box>image:nth-child(2){width: 32rpx;height: 34rpx;}
|
||||
.icon-box>image:nth-child(3){width: 31rpx;height: 37rpx;}
|
||||
.icon-box>image:nth-child(4){width: 32rpx;height: 33rpx;}
|
||||
.icon-box>image:nth-child(5){width: 33rpx;height: 35rpx;}
|
||||
.icon-box>image:nth-child(6){width: 35rpx;height: 32rpx;}
|
||||
.icon-box>image:nth-child(7){width: 36rpx;height: 35rpx;}
|
||||
.sigin-box{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);}
|
||||
.sigin-box view{padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;}
|
||||
.person-m{width: 325rpx;height: 325rpx;margin: 30rpx 86rpx 68rpx 86rpx;}
|
||||
.close-m{width: 96rpx;height: 96rpx;border-radius: 100%;}
|
||||
.red-num{width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;background: #F96969;right: 50rpx;top: 0;font-size: 22rpx;color: #FFFFFF;text-align: center;}
|
||||
.icon-img{width: 60rpx;height: 60rpx;}
|
||||
.white-next{width: 22rpx;height: 22rpx;}
|
||||
.yuan-box>view{width: 100%;display: flex;justify-content: center;align-items: center;position: relative;}
|
||||
.yuan-box .xian-right{height: 58rpx;width: 2rpx;background-color: #E6E6E6;right: 0;position: absolute;}
|
||||
.yuan-box image{width: 54rpx;height: 54rpx;}
|
||||
.blue-img{position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;}
|
||||
.gao .posia{left: -32rpx;right: -32rpx;z-index: -1;}
|
||||
.gao .mar-sx30{width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;}
|
||||
.gao-name{background: #FFBD39;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFFFFF;padding: 5rpx 16rpx;margin-left: 10rpx;}
|
||||
.gao-phone{width: 14rpx;height: 20rpx;}
|
||||
.gao-m{width: 43rpx;height: 43rpx;z-index: 1;}
|
||||
.gao-next-box{width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;}
|
||||
.gao-next-box image{width: 35rpx;height: 35rpx;z-index: 1;}
|
||||
/* 暂无内容时,显示的图片大小 */
|
||||
.zanw-img{width: 474rpx;height: 273rpx;}
|
||||
/* 修改资料页面 */
|
||||
.head_img{width: 140rpx;height: 140rpx;border-radius: 100%;}
|
||||
.nic{color: #101010;}
|
||||
.head_next{width: 19rpx;height: 19rpx;}
|
||||
/* 自主预约 */
|
||||
.xiala{border: 2rpx solid #CECECE;height: 80rpx;line-height: 80rpx;}
|
||||
.xiala image{width: 35rpx;height: 24rpx;}
|
||||
.yutime{width: 160rpx;height: 130rpx;}
|
||||
.timed{width: 210rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.titlel{width: 18%;}
|
||||
.titlel2{width: 20%;}
|
||||
.height-68{height: 80rpx;}
|
||||
.btnl{margin: 50rpx 80rpx;height: 90rpx;line-height: 90rpx;}
|
||||
/* 客户列表 */
|
||||
.xialak{height: 60rpx;line-height: 60rpx;border: 2rpx solid #E0E0E0;}
|
||||
.xialak image{width: 35rpx;height: 24rpx;}
|
||||
.customer-btn{height: 60rpx;width: 143rpx;line-height: 60rpx;}
|
||||
/* 医生 */
|
||||
.qdoctor:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width: 10rpx;height: 40rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: #3875F6;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.doctoritem:before{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 4rpx solid #3875F6;
|
||||
background-color: #3875F6;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
/* .zhuan{transition: all 1s;transform: rotate(90deg);} */
|
||||
.nozhuan{transition: all 1s;transform: rotate(0deg);}
|
||||
.xial-box{top: 80rpx;left: 0;right: 0;z-index: 4;border: 2rpx solid #E0E0E0;}
|
||||
.xial-item-box{max-height: 400rpx;overflow-y: scroll; overflow-x: hidden;}
|
||||
.doctorx{margin: 0 15rpx;height: 18rpx;border: 2rpx solid #E6E6E6;}
|
||||
.doctorImg{width: 100%;height: 285rpx;border-top-left-radius: 10rpx;border-top-right-radius: 10rpx;}
|
||||
.isTop{background-color: #FFFFFF;box-shadow: 0rpx 3rpx 10rpx rgba(0,0,0,.6);}
|
||||
.isTops{position: sticky;left: 0;right: 0;z-index: 2;}
|
||||
.isTopf{position: fixed;left: 0;right: 0;z-index: 2;}
|
||||
|
||||
/* 底部联系客服、分享、返回首页 */
|
||||
.btnBKS{height: 120rpx;}
|
||||
.lianShare{height: 90rpx;width: 220rpx;}
|
||||
.backH{width: 190rpx;height: 190rpx;top: -126rpx;}
|
||||
.addCart-btn{border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;background-color: #3875F6;}
|
||||
.mai-btn{border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;background-color: #F85050;}
|
||||
/* 商城 */
|
||||
.shop-nav-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.shop-nav-box>view:first-child view,.jf-input-box>view:first-child view{height: 80rpx;line-height: 80rpx;}
|
||||
.shop_list_box>view>view:last-child{margin-bottom: 200rpx;}
|
||||
.shop-nav-box .pad-zy50 view:nth-child(n+2){background: #3875F6;color: #FFFFFF;border-radius: 30rpx;padding: 8rpx 20rpx;font-size: 24rpx;display: flex;align-items: center;margin-right: 20rpx;margin-top: 30rpx;}
|
||||
.shop-nav-box .mar-s40{height: 60rpx;border: 2rpx solid #E0E0E0;border-radius: 10rpx;width: 100%;box-sizing: border-box;padding-left: 20rpx;font-size: 24rpx;}
|
||||
.shop-nav-box .mar-x30 view{font-size: 28rpx;width: 294rpx;height: 60rpx;border-radius: 10rpx;text-align: center;line-height: 60rpx; }
|
||||
.shop-nav-box .mar-x30 view:first-child{background: #E6E6E6;color: #4D4D4D;}
|
||||
.shop-nav-box .mar-x30 view:last-child{background: #3875F6;color: #FFFFFF;}
|
||||
.activebcate,.shopBMo{border-radius: 20rpx;background-color: #f2f2f2;color: #333333;padding: 12rpx 24rpx;}
|
||||
.activebcate{color: #FFFFFF;}
|
||||
|
||||
.jf-input-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
|
||||
.jf-input-box image{width: 16rpx;height: 13rpx;}
|
||||
.jf-input-box image:last-child{margin-top: 4rpx;}
|
||||
.cart-box{position: fixed;right: 30rpx;bottom: 200rpx;}
|
||||
.cart-box .posir,.cart-box .posir image,.detail-cart-box .posir,.detail-cart-box .posir image{width: 112rpx;height: 112rpx;}
|
||||
.cart-box .posia,.detail-cart-box .posia{background: #F85050;width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;color: #FFFFFF;font-size: 24rpx;text-align: center;top: 20rpx;right: 20rpx;}
|
||||
.cart-box .posia view,.detail-cart-box .posia view{transform: scale(.8);}
|
||||
.moban{background: rgba(0,0,0,.54);width: 100%;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 2;}
|
||||
.detail-cart-box{position: fixed;right: 30rpx;bottom: 300rpx;z-index: 999;}
|
||||
/* 商品详情 */
|
||||
.activelei,.molei{border-radius: 20rpx;padding: 10rpx 24rpx;color: #333333;margin-left: 20rpx;}
|
||||
.activelei{color: #FFFFFF;}
|
||||
.shop-title-box view{display: inline-block;float: left;}
|
||||
.shop-title-box view span{padding: 6rpx 10rpx;}
|
||||
.shop-title-box view span:nth-child(n+2){background: #F85050;}
|
||||
.shop-price{color: #F85050;font-size: 40rpx;font-weight: bold;}
|
||||
.shop-price span:last-child{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;margin-left: 20rpx;}
|
||||
.yuan-price{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;}
|
||||
.shar-box{margin-top: -20rpx;padding-bottom: 20rpx;}
|
||||
.shar-box>view:first-child image{width: 42rpx;height: 30rpx;}
|
||||
.shop-swiper{height: 280rpx;padding-top: 20rpx;}
|
||||
.big-img{width: 70rpx;height: 70rpx; border-radius: 100%;}
|
||||
.shop-swiper .bold{width: 140rpx;height: 80rpx;line-height: 80rpx;text-align: center;background: #F85050;border-radius: 20rpx;}
|
||||
.duan-xian{border-bottom: 2rpx solid #E6E6E6;position: absolute;bottom: 0;width: 87%;right: 0;}
|
||||
.bottom-popu,.order-cancle-tk{border-radius: 40rpx 40rpx 0rpx 0rpx;}
|
||||
.bottom-popu>view:first-child image{width: 214rpx;height: 214rpx;border-radius: 15rpx;bottom: 0;flex-shrink: 0;margin-top: -107rpx;margin-right: 30rpx;}
|
||||
.bottom-popu>view:first-child .width100 image{width: 24px;height: 24px;margin-top: -20rpx;}
|
||||
.del-btn,.add-btn{width: 65rpx;height: 30px;}
|
||||
.num-input{width: 80rpx;height: 28px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||
.ev-btn{width: 294rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 10rpx;}
|
||||
.pd-tk-box{position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 6;background: rgba(0,0,0,.54);display: flex;justify-content: center;align-items: center;}
|
||||
.pd-tk-box .posir{font-weight: 500;text-align: center;margin: 0 85rpx;height: 458rpx;}
|
||||
.pd-tk-box .posir view:nth-child(1){margin: 34rpx 0 27rpx 0;}
|
||||
.pd-tk-box .posir view:nth-child(2){margin-bottom: 63rpx;}
|
||||
.pd-tk-box .posir view:nth-child(3){margin-bottom: 77rpx;}
|
||||
.pd-tk-box .posir view:nth-child(3) image:nth-child(1),.pd-tk-box .posir view:nth-child(3) image:nth-child(3){width: 100rpx;height: 100rpx;border-radius: 100%;}
|
||||
.pd-tk-box .posir view:nth-child(3) image:nth-child(2){width: 42rpx;height: 42rpx;margin: 0 47rpx;}
|
||||
.pd-tk-box .posir view:nth-child(4){width: 464rpx;height: 60rpx;line-height: 60rpx;color: #FFFFFF;background: #F85050;border-radius: 10rpx;margin: 0 auto;font-size: 28rpx;}
|
||||
.pd-tk-box .posir>image{width: 77rpx;height: 77rpx;right: -30rpx;top: -30rpx;}
|
||||
swiper-item view:last-child .duan-xian{border-bottom: none;}
|
||||
.score-box{width: 100%;height: 90rpx;line-height: 90rpx;padding-left: 62rpx;background: #3875F6;color: #FFFFFF;font-size: 40rpx;font-weight: bold;}
|
||||
/* 准备下单 */
|
||||
.activeT,.expressT{width: 124rpx;height: 60rpx;line-height: 60rpx;text-align: center;margin-left: 20rpx;border-radius: 20rpx;}
|
||||
.activeT{color: #FFFFFF;}
|
||||
.activeQuan::before{content: '';display: block;width: 50%;height: 8rpx;background: #3875F6;position: absolute;bottom: -20rpx;left: 50%;transform: translateX(-50%);}
|
||||
.xiaDan-next{width: 16px;height: 16px;flex-shrink: 0;}
|
||||
.there{width: 90rpx;height: 86rpx;flex-shrink: 0;}
|
||||
.order-image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
|
||||
.order-sy{font-size: 22rpx;color: #808080;font-weight: 500;margin-top: 6rpx;}
|
||||
.order-item-price{color: #F85050;font-size: 32rpx;font-weight: bold;}
|
||||
.goPayment{color: #FFFFFF;font-size: 28rpx;font-weight: bold;width: 170rpx;height: 70rpx;line-height: 70rpx;text-align: center;background: #3875F6;border-radius: 35rpx;margin-left: 10rpx;}
|
||||
.quan-item-box{height: 200rpx;}
|
||||
.quan-item-box>view:first-child{width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;}
|
||||
.quan-item-box>view:first-child image{width: 218rpx;height: 200rpx;left: 0;top: 0;}
|
||||
.quan-item-box>view:last-child{display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #F5F5F5;}
|
||||
.quan-item-box>view:last-child image{float: right;}
|
||||
.quan-list-box{max-height: 600rpx;}
|
||||
.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;}
|
||||
.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%;}
|
||||
.dao-box{padding: 55rpx 0 64rpx 0;text-align: center;}
|
||||
.submit-pay{margin: 0 auto;color: #FFFFFF;font-weight: bold;font-size: 36rpx;text-align: center;width: 546rpx;height: 90rpx;line-height: 90rpx;background-color: #3875F6;border-radius: 20rpx;}
|
||||
.success-btn{margin-bottom: 150rpx;}
|
||||
.success-btn view{width: 244rpx;height: 70rpx;border-radius: 10rpx;text-align: center;line-height: 70rpx;}
|
||||
.success-btn view:first-child{background: #E9E9E9;color: #333333;}
|
||||
/* 购物车页面 */
|
||||
.edit-btn{width: 113rpx;height: 43rpx;border-radius: 20rpx;background: #3875F6;text-align: center;color: #FFFFFF;line-height: 43rpx;}
|
||||
.cart-list-box{overflow: hidden;}
|
||||
.cart-input-box{border-radius: 4rpx;overflow: hidden;}
|
||||
.cart-input-box image{width: 46rpx;height: 26px;}
|
||||
.cart-input-box input{width: 60rpx;height: 24px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
|
||||
.goBuy-btn{width: 200rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 35rpx;}
|
||||
.chooseAll-box{width: 40rpx;height: 40rpx;border-radius: 100%;border: 2rpx solid #3875F6;flex-shrink: 0;display: flex;justify-content: center;align-items: center;}
|
||||
.chooseAll-box view{width: 24rpx;height: 24rpx;background-color: #3875F6;border-radius: 100%;}
|
||||
.item-del-btn{width: 117rpx;height: 205rpx;background: #F85050;line-height: 205rpx;text-align: center;color: #FFFFFF;font-size: 24rpx;flex-shrink: 0;position: absolute;right: 0;bottom: 40rpx;top: 2rpx;}
|
||||
/* 我的订单页面 */
|
||||
.order-item-box image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
|
||||
.order-btn{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #F85050;color: #FFFFFF;margin-left: 45rpx;}
|
||||
.order-cancle{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #E9E9E9;color: #808080;}
|
||||
.heyan-close{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
|
||||
.confirm-btn{font-size: 36rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 100rpx 20rpx 100rpx;}
|
||||
/* 地址管理页面 */
|
||||
.address_active{width: 40rpx;height: 40rpx;}
|
||||
.address_add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 0 93rpx;}
|
||||
.xiao-sanj image{width: 14rpx;height: 11rpx;}
|
||||
.xiao-sanj image:last-child{margin-top: 4rpx;}
|
||||
.address-btn-add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 76rpx 20rpx 76rpx;}
|
||||
.address-close-btn{width: 77rpx;height: 77rpx;right: -55rpx;top: -36rpx;}
|
||||
.info-box{background: #fff;left: 0;right: 0;top: 52rpx;height: 0rpx;transition: all 0.5s;border: 2rpx solid #E6E6E6;opacity: 0; z-index: 6;overflow: hidden;overflow-y: scroll;color: #666;}
|
||||
.info-box view{margin: 10rpx;font-size: 24rpx;}
|
||||
.dong {height: 200rpx;border: 2rpx solid #E6E6E6;opacity: 1;}
|
||||
/* 优惠券页面 */
|
||||
.quan-btn{width: 136rpx;height: 48rpx;line-height: 48rpx;text-align: center;border-radius: 30rpx;background: #FFFFFF;color: #3875F6;margin-right: -10rpx;}
|
||||
.quan-img{width: 218rpx;height: 200rpx;left: 0;top: 0;}
|
||||
.quan-right-box{display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #FFFFFF;}
|
||||
.quan-use{width: 94rpx;height: 94rpx;right: 20rpx;top: 20rpx;}
|
||||
.quan-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);z-index: 3;}
|
||||
.quan-tk-btn{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
|
||||
.receive-left{width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;}
|
||||
/* 活动任务 */
|
||||
.activity-dai{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #3875F6;}
|
||||
.activity-mo{width: 546rpx;height: 70rpx;line-height: 70rpx;text-align: center;border-radius: 35rpx;font-size: 30rpx;color: #FFFFFF;background: #CCCCCC;}
|
||||
.task-cancle-btn,.task-confrim-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;border-radius: 10rpx;}
|
||||
.task-cancle-btn{background: #E6E6E6;color: #FFFFFF;}
|
||||
.task-confrim-btn{background: #3875F6;color: #FFFFFF;}
|
||||
.imgIng{width: 340rpx;height: 348rpx;border-radius: 10rpx;margin-bottom: 70rpx;}
|
||||
.task-add-box{width: 340rpx;height: 348rpx;background: #F0F0F0;border-radius: 10rpx;margin-bottom: 70rpx;}
|
||||
.task-add{width: 100rpx;height: 6rpx;background: #B3B3B3;border-radius: 10rpx;}
|
||||
/* 签到页面 */
|
||||
.sigin-img{width: 218rpx;height: 202rpx;margin: 0 auto;}
|
||||
.sigin-success{width: 31rpx;height: 30rpx;margin-top: 20rpx;}
|
||||
.sigin-day{width: 66rpx;height: 66rpx;border-radius: 100%;border: 2rpx solid #FFFFFF;}
|
||||
.sigin-day image{width: 27rpx;height: 27rpx;border-radius: 100%;border: 1rpx solid #759FFD;text-align: center;line-height: 27rpx;color: #759FFD;background: #FFFFFF;font-size: 20rpx;right: 0rpx;bottom: -8rpx;}
|
||||
/* 孔雀币页面 */
|
||||
.coin-tx-btn{width: 152rpx;height: 60rpx;line-height: 60rpx;text-align: center;color: #FFFFFF;background: #3875F6;border-radius: 30rpx;font-size: 26rpx;}
|
||||
.coin-yuan{font-size: 26rpx;font-weight: 400;}
|
||||
.coin-miao{height: 60rpx;line-height: 60rpx;}
|
||||
.coin-share-box{width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);}
|
||||
.coin-share-box image {width: 50rpx;height: 50rpx;}
|
||||
.tx-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);}
|
||||
.tx-tk-box input{border: 2rpx solid #E0E0E0;margin-bottom: 80rpx;height: 60rpx;}
|
||||
.tk-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;border-radius: 10rpx;font-size: 28rpx;color: #FFFFFF;}
|
||||
.tk-btn:last-child{background-color: #C8C8C8;}
|
||||
|
||||
|
||||
/* 我的订单页面 */
|
||||
.order-hx-img{width: 325rpx;height: 325rpx;}
|
||||
.order-close-btn{width: 40rpx;height: 40rpx;right: 50rpx;top: 20rpx;}
|
||||
/* 订单详情 */
|
||||
.orderInfo-btn{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;background: #3875F6;color: #FFFFFF;margin-left: 20rpx;}
|
||||
.paid-btn-box view{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;}
|
||||
.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);}
|
||||
|
||||
|
||||
/* 我的日记 */
|
||||
.diary-img{margin-right: 13rpx;width: 32%; height: 212rpx;background-color: #F5F5F5;border-radius: 12rpx;}
|
||||
.diary-img:nth-child(3n){
|
||||
margin-right: 0;
|
||||
}
|
||||
.diary-item-img {
|
||||
width: 32%;height: 168rpx;border-radius: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.diary-item-img .addImg {
|
||||
height: 168rpx;width: 100%;border-radius: 10rpx;
|
||||
}
|
||||
.diary-item-img:nth-child(3n){
|
||||
margin-right: 0;
|
||||
}
|
||||
@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;}
|
||||
}
|
||||
@media screen and (min-height:926px){
|
||||
.blue-img{height: 490rpx;}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.bottoc{margin-top: 6rpx;color: #414141;}
|
||||
.opc{opacity: 0.7;}
|
||||
.width100{width: 100%;}
|
||||
.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;}
|
||||
.posir{position: relative;}
|
||||
.posia{position: absolute;}
|
||||
.poszy{position: fixed;left: 0;right: 0;z-index: 3;}
|
||||
.posiszy{position: fixed;left: 0;right: 0;z-index: 5;}
|
||||
.posixzy{position: fixed;left: 0;right: 0;z-index: 2;bottom: 0;}
|
||||
.posia-op{position: absolute;top: 0;right: 0;left: 0;bottom: 0;opacity: 0;}
|
||||
.syxzo{top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
|
||||
|
||||
|
||||
.dis{display: flex;}
|
||||
.disac{display: flex;align-items: center;}
|
||||
.disja{display: flex;justify-content: space-around;}
|
||||
.disjb{display: flex;justify-content: space-between;}
|
||||
.disje{display: flex;justify-content: flex-end;}
|
||||
.disjbac{display: flex;justify-content: space-between;align-items: center;}
|
||||
.disjcac{display: flex;justify-content: center;align-items: center;}
|
||||
.fc{flex-direction: column;}
|
||||
.fw{flex-wrap: wrap;}
|
||||
.fe{justify-content: flex-end;}
|
||||
.flexs{flex-shrink: 0;}
|
||||
|
||||
|
||||
.wh42{width: 42rpx;height: 42rpx;}
|
||||
.wh44{width: 44rpx;height: 44rpx;}
|
||||
|
||||
button:after{content: none!important;}
|
||||
.borbot{border-bottom: 2rpx solid #E6E6E6;}
|
||||
.borbot:last-child{border-bottom: none;}
|
||||
.bbot{border-bottom: 2rpx solid #E6E6E6;}
|
||||
.borbot-df{border: 2rpx solid #DFDFDF;}
|
||||
.borbot-cc{border: 2rpx solid #CCCCCC;}
|
||||
|
||||
.line-h50{line-height: 50rpx;}
|
||||
|
||||
|
||||
.clips1{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
|
||||
.clips2{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
|
||||
.clips3{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
|
||||
|
||||
|
||||
/* 字体大小 */
|
||||
.fon20{font-size: 20rpx;}
|
||||
.fon24{font-size: 24rpx;}
|
||||
.fon25{font-size: 25rpx;}
|
||||
.fon26{font-size: 26rpx;}
|
||||
.fon27{font-size: 27rpx;}
|
||||
.fon28{font-size: 28rpx;}
|
||||
.fon30{font-size: 30rpx;}
|
||||
.fon32{font-size: 32rpx;}
|
||||
.fon34{font-size: 34rpx;}
|
||||
.fon36{font-size: 36rpx;}
|
||||
.fon38{font-size: 38rpx;}
|
||||
.fon40{font-size: 40rpx;}
|
||||
.fon56{font-size: 56rpx;}
|
||||
|
||||
/* 字体颜色 */
|
||||
.colf{color: #FFFFFF;}
|
||||
.colb{color: #000000;}
|
||||
.colc{color: #CCCCCC;}
|
||||
.col3{color: #333333;}
|
||||
.col34{color: #343434;}
|
||||
.col6{color: #666666;}
|
||||
.colf8{color: #F85050;}
|
||||
.col9{color: #999999;}
|
||||
.pcol{color: #3875F6;}
|
||||
.col2c{color: #2C2C2C;}
|
||||
.col80{color: #808080;}
|
||||
.col7D{color: #7D7D7D;}
|
||||
.colB3{color: #B3B3B3;}
|
||||
.col5b{color: #5B5B5B;}
|
||||
/* 字体位置 */
|
||||
.tc{text-align: center;}
|
||||
.tright{text-align: right;}
|
||||
|
||||
/* 行间距 */
|
||||
.linh40{line-height: 40rpx;}
|
||||
|
||||
/* 粗体 */
|
||||
.bold{font-weight: bold;}
|
||||
.font5{font-weight: 500;}
|
||||
.font4{font-weight: 400;}
|
||||
|
||||
|
||||
/* 背景颜色 */
|
||||
.pbackc{background-color: #3875F6;}
|
||||
.bacf{background-color: #FFFFFF;}
|
||||
.bcdb{background-color: #DBDBDB;}
|
||||
.bcf8{background: #F85050;}
|
||||
.bacf5{background: #F5F5F5;}
|
||||
|
||||
/* 圆角 */
|
||||
.radius10{border-radius: 10rpx;}
|
||||
.radius15{border-radius: 15rpx;}
|
||||
.radius20{border-radius: 20rpx;}
|
||||
.radius30{border-radius: 30rpx;}
|
||||
.radius35{border-radius: 35rpx;}
|
||||
.radius40{border-radius: 40rpx;}
|
||||
.radius45{border-radius: 45rpx;}
|
||||
|
||||
/* 上下左右---外边距 */
|
||||
.mar10{margin: 10rpx;}
|
||||
.mar20{margin: 20rpx;}
|
||||
.mar25{margin: 25rpx;}
|
||||
.mar30{margin: 30rpx;}
|
||||
.mar32{margin: 32rpx;}
|
||||
.mar36{margin: 36rpx;}
|
||||
.mar40{margin: 40rpx;}
|
||||
.mar50{margin: 50rpx;}
|
||||
/* 上下---外边距 */
|
||||
.mar-sx10{margin-top: 10rpx;margin-bottom: 10rpx;}
|
||||
.mar-sx20{margin-top: 20rpx;margin-bottom: 20rpx;}
|
||||
.mar-sx25{margin-top: 25rpx;margin-bottom: 25rpx;}
|
||||
.mar-sx30{margin-top: 30rpx;margin-bottom: 30rpx;}
|
||||
.mar-sx32{margin-top: 32rpx;margin-bottom: 32rpx;}
|
||||
.mar-sx36{margin-top: 36rpx;margin-bottom: 36rpx;}
|
||||
.mar-sx40{margin-top: 40rpx;margin-bottom: 40rpx;}
|
||||
.mar-sx50{margin-top: 50rpx;margin-bottom: 50rpx;}
|
||||
/* 左右---外边距 */
|
||||
.mar-zy10{margin-left: 10rpx;margin-right: 10rpx;}
|
||||
.mar-zy20{margin-left: 20rpx;margin-right: 20rpx;}
|
||||
.mar-zy25{margin-left: 25rpx;margin-right: 25rpx;}
|
||||
.mar-zy30{margin-left: 30rpx;margin-right: 30rpx;}
|
||||
.mar-zy32{margin-left: 32rpx;margin-right: 32rpx;}
|
||||
.mar-zy36{margin-left: 36rpx;margin-right: 36rpx;}
|
||||
.mar-zy40{margin-left: 40rpx;margin-right: 40rpx;}
|
||||
.mar-zy50{margin-left: 50rpx;margin-right: 50rpx;}
|
||||
.mar-zy85{margin-left: 85rpx;margin-right: 85rpx;}
|
||||
/* 上---外边距 */
|
||||
.mar-s10{margin-top: 10rpx;}
|
||||
.mar-s20{margin-top: 20rpx;}
|
||||
.mar-s25{margin-top: 25rpx;}
|
||||
.mar-s30{margin-top: 30rpx;}
|
||||
.mar-s32{margin-top: 32rpx;}
|
||||
.mar-s36{margin-top: 36rpx;}
|
||||
.mar-s40{margin-top: 40rpx;}
|
||||
.mar-s50{margin-top: 50rpx;}
|
||||
/* 下---外边距 */
|
||||
.mar-x10{margin-bottom: 10rpx;}
|
||||
.mar-x20{margin-bottom: 20rpx;}
|
||||
.mar-x25{margin-bottom: 25rpx;}
|
||||
.mar-x30{margin-bottom: 30rpx;}
|
||||
.mar-x32{margin-bottom: 32rpx;}
|
||||
.mar-x36{margin-bottom: 36rpx;}
|
||||
.mar-x40{margin-bottom: 40rpx;}
|
||||
.mar-x50{margin-bottom: 50rpx;}
|
||||
/* 左---外边距 */
|
||||
.mar-z10{margin-left: 10rpx;}
|
||||
.mar-z20{margin-left: 20rpx;}
|
||||
.mar-z25{margin-left: 25rpx;}
|
||||
.mar-z30{margin-left: 30rpx;}
|
||||
.mar-z32{margin-left: 32rpx;}
|
||||
.mar-z36{margin-left: 36rpx;}
|
||||
.mar-z40{margin-left: 40rpx;}
|
||||
.mar-z50{margin-left: 50rpx;}
|
||||
/* 右---外边距 */
|
||||
.mar-y10{margin-right: 10rpx;}
|
||||
.mar-y20{margin-right: 20rpx;}
|
||||
.mar-y25{margin-right: 25rpx;}
|
||||
.mar-y30{margin-right: 30rpx;}
|
||||
.mar-y32{margin-right: 32rpx;}
|
||||
.mar-y36{margin-right: 36rpx;}
|
||||
.mar-y40{margin-right: 40rpx;}
|
||||
.mar-y50{margin-right: 50rpx;}
|
||||
|
||||
/* 上下左右---内边距 */
|
||||
.pad10{padding: 10rpx;}
|
||||
.pad20{padding: 20rpx;}
|
||||
.pad25{padding: 25rpx;}
|
||||
.pad30{padding: 30rpx;}
|
||||
.pad32{padding: 32rpx;}
|
||||
.pad36{padding: 36rpx;}
|
||||
.pad40{padding: 40rpx;}
|
||||
.pad50{padding: 50rpx;}
|
||||
/* 上下---内边距 */
|
||||
.pad-sx10{padding-top: 10rpx;padding-bottom: 10rpx;}
|
||||
.pad-sx20{padding-top: 20rpx;padding-bottom: 20rpx;}
|
||||
.pad-sx25{padding-top: 25rpx;padding-bottom: 25rpx;}
|
||||
.pad-sx30{padding-top: 30rpx;padding-bottom: 30rpx;}
|
||||
.pad-sx32{padding-top: 32rpx;padding-bottom: 32rpx;}
|
||||
.pad-sx36{padding-top: 36rpx;padding-bottom: 36rpx;}
|
||||
.pad-sx40{padding-top: 40rpx;padding-bottom: 40rpx;}
|
||||
.pad-sx50{padding-top: 50rpx;padding-bottom: 50rpx;}
|
||||
/* 左右---内边距 */
|
||||
.pad-zy10{padding-left: 10rpx;padding-right: 10rpx;}
|
||||
.pad-zy20{padding-left: 20rpx;padding-right: 20rpx;}
|
||||
.pad-zy25{padding-left: 25rpx;padding-right: 25rpx;}
|
||||
.pad-zy30{padding-left: 30rpx;padding-right: 30rpx;}
|
||||
.pad-zy32{padding-left: 32rpx;padding-right: 32rpx;}
|
||||
.pad-zy36{padding-left: 36rpx;padding-right: 36rpx;}
|
||||
.pad-zy40{padding-left: 40rpx;padding-right: 40rpx;}
|
||||
.pad-zy50{padding-left: 50rpx;padding-right: 50rpx;}
|
||||
/* 上---内边距 */
|
||||
.pad-s10{padding-top: 10rpx;}
|
||||
.pad-s20{padding-top: 20rpx;}
|
||||
.pad-s25{padding-top: 25rpx;}
|
||||
.pad-s30{padding-top: 30rpx;}
|
||||
.pad-s32{padding-top: 32rpx;}
|
||||
.pad-s36{padding-top: 36rpx;}
|
||||
.pad-s40{padding-top: 40rpx;}
|
||||
.pad-s50{padding-top: 50rpx;}
|
||||
/* 下---内边距 */
|
||||
.pad-x10{padding-bottom: 10rpx;}
|
||||
.pad-x20{padding-bottom: 20rpx;}
|
||||
.pad-x25{padding-bottom: 25rpx;}
|
||||
.pad-x30{padding-bottom: 30rpx;}
|
||||
.pad-x32{padding-bottom: 32rpx;}
|
||||
.pad-x36{padding-bottom: 36rpx;}
|
||||
.pad-x40{padding-bottom: 40rpx;}
|
||||
.pad-x50{padding-bottom: 50rpx;}
|
||||
.pad-x160{padding-bottom: 160rpx;}
|
||||
.pad-x180{padding-bottom: 180rpx;}
|
||||
.pad-x260{padding-bottom: 260rpx;}
|
||||
/* 左---内边距 */
|
||||
.pad-z10{padding-left: 10rpx;}
|
||||
.pad-z20{padding-left: 20rpx;}
|
||||
.pad-z25{padding-left: 25rpx;}
|
||||
.pad-z30{padding-left: 30rpx;}
|
||||
.pad-z32{padding-left: 32rpx;}
|
||||
.pad-z36{padding-left: 36rpx;}
|
||||
.pad-z40{padding-left: 40rpx;}
|
||||
.pad-z50{padding-left: 50rpx;}
|
||||
/* 右---内边距 */
|
||||
.pad-y10{padding-right: 10rpx;}
|
||||
.pad-y20{padding-right: 20rpx;}
|
||||
.pad-y25{padding-right: 25rpx;}
|
||||
.pad-y30{padding-right: 30rpx;}
|
||||
.pad-y32{padding-right: 32rpx;}
|
||||
.pad-y36{padding-right: 36rpx;}
|
||||
.pad-y40{padding-right: 40rpx;}
|
||||
.pad-y50{padding-right: 50rpx;}
|
||||
|
||||
.pad-sx27-zy20{padding: 27rpx 20rpx;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<template>
|
||||
<view v-if="showPhone" @touchmove.stop.prevent="moveHandle" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view class="pad-sx10 radius10 tank-btn posir pbackc">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"wx_auth_phone",
|
||||
data() {
|
||||
return {
|
||||
showPhone:true
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
moveHandle(){//禁止底层滑动
|
||||
return false
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.showPhone = false;
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
console.log('用户拒绝');
|
||||
this.showPhone = true;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,240 @@
|
|||
<template>
|
||||
<view v-if="visible">
|
||||
<!-- 用户信息授权 -->
|
||||
<view v-if="userInfo_mobile" @touchmove.stop.prevent="moveHandle" :class="isAnimation==2?'card-box-userinfo':''" class="auth-box">
|
||||
<view :class="isAnimation==1?'card-box-userinfo':''">
|
||||
<view class="auth-top">
|
||||
<image :src="appletImg" mode=""></image>
|
||||
<view class="auth-top-content">
|
||||
<view>恒美植发客服代表提醒您:</view>
|
||||
<view>您当前是游客身份</view>
|
||||
<view>是否选择授权登录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="auth-center">申请 获取你的昵称、头像、地区及性别</view>
|
||||
<view class="auth-bottom">
|
||||
<view @tap="chooseBtn(0)" :class="isNo?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
||||
<view @tap="chooseBtn(1)" :class="isOk?'isOyin':'noyin'" class="btn btn-yes">
|
||||
<text>立即授权</text>
|
||||
<button open-type="getUserInfo" @tap="shouq" class="auth-btn">立即授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 手机号授权 -->
|
||||
<view v-if="!userInfo_mobile" @touchmove.stop.prevent="moveHandle" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view class="pad-sx10 radius10 tank-btn posir pbackc">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"empower",
|
||||
props:{
|
||||
optionObj:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
return {}
|
||||
}
|
||||
},
|
||||
appletImg:{//小程序头像
|
||||
type:String,
|
||||
default:'/static/public/like.png'
|
||||
},
|
||||
appletName:{//小程序名称
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
url:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
isWhere:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isOk:false,
|
||||
isNo:false,
|
||||
isAnimation:0,
|
||||
visible:false,
|
||||
userInfo_mobile:true,
|
||||
currentPage:''//当前页面路径
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.optionObj,'参数');
|
||||
if(uni.getStorageSync('is_active')!=1){this.visible = true;}
|
||||
if(this.optionObj.invite_code!='' && this.optionObj.invite_code!=undefined){
|
||||
this.loginEv(this.optionObj.invite_code);
|
||||
} else if(this.optionObj.source_code!='' && this.optionObj.source_code!=undefined){
|
||||
this.loginEv('',this.optionObj.source_code,this.optionObj.channel);
|
||||
}
|
||||
//转发进入
|
||||
let pages = getCurrentPages(); //获取加载的页面
|
||||
let currentPage = pages[pages.length - 1]; //获取当前页面的对象
|
||||
this.currentPage = currentPage.route ;//当前页面url
|
||||
console.log(this.currentPage,'当前页面路径');
|
||||
},
|
||||
methods:{
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.visible = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
moveHandle(){
|
||||
return false
|
||||
},
|
||||
tiaoZ(){//跳转方式
|
||||
if(this.isWhere==0) uni.navigateBack({delta:1}) //返回上一页
|
||||
if(this.isWhere==1) uni.navigateTo({url:this.url})//跳转到指定页面
|
||||
if(this.isWhere!=0 && this.isWhere!=1) return//不跳转
|
||||
this.isOk = false;
|
||||
},
|
||||
chooseBtn(index){//暂不授权、立即授权
|
||||
this.$emit('cancleEv',index)//继承事件
|
||||
if(index==0){//暂不授权
|
||||
// this.tiaoZ()
|
||||
uni.navigateTo({
|
||||
url:`/${this.currentPage}`
|
||||
})
|
||||
this.isOk = false
|
||||
} else {
|
||||
this.isOk = !this.isOk
|
||||
this.isNo = false
|
||||
}
|
||||
},
|
||||
shouq(){//立即授权事件
|
||||
let ya = this;
|
||||
this.$toolAll.tools.showToast('正在调起授权...')
|
||||
let code = ''//声明code
|
||||
uni.login({// 获取登录用户code
|
||||
provider: 'weixin',
|
||||
success: function(result) {
|
||||
uni.hideToast()
|
||||
code = result.code
|
||||
},
|
||||
});
|
||||
uni.getUserProfile({//调起微信授权弹框
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
ya.updateUserInfo(code,res.userInfo);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('用户拒绝授权');
|
||||
this.tiaoZ()
|
||||
this.$emit('cancleEv',0)
|
||||
this.isOk = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//调用登录接口
|
||||
updateUserInfo(code,userInfo) {
|
||||
let ya = this;
|
||||
uni.showToast({title: '授权中...',icon:'loading',})
|
||||
var params = {
|
||||
code:code,
|
||||
nickname: userInfo.nickName,//用户昵称
|
||||
headimgurl: userInfo.avatarUrl,//用户头像
|
||||
country: userInfo.country,//用户所在国家
|
||||
province: userInfo.province,//用户所在省份
|
||||
city: userInfo.city,//用户所在城市
|
||||
gender: userInfo.gender,//用户性别
|
||||
language:userInfo.language,//语言
|
||||
is_active:1,
|
||||
channel:uni.getStorageSync('channel')
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params);
|
||||
uni.setStorageSync('userId',res.data.account_id);
|
||||
uni.setStorageSync('token',res.data.token);//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire);//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active);//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code);
|
||||
ya.successAfterEv(userInfo);
|
||||
ya.isAnimation++;
|
||||
ya.userInfo_mobile = false;
|
||||
ya.$emit('onload');
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
successAfterEv(userInfo){//缓存信息
|
||||
let ya = this
|
||||
uni.hideToast();
|
||||
// console.log(uni.getStorageSync('headImg'));
|
||||
ya.$toolAll.tools.showToast('授权成功','success')
|
||||
ya.$emit('cancleEv',0)
|
||||
ya.$emit('buttonH',true)
|
||||
if(ya.url!=''){
|
||||
setTimeout(()=>{uni.navigateTo({url:ya.url})},1000)
|
||||
}
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||
this.visible = false;
|
||||
uni.reLaunch({
|
||||
url:`/${this.currentPage}`
|
||||
})
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
console.log('用户拒绝');
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.auth-box {position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;z-index: 3;}
|
||||
.auth-box > view {background-color: #FFFFFF;border-radius: 10rpx;padding: 30rpx;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.5);margin: 0 100rpx;}
|
||||
.auth-top {display: flex;}
|
||||
.auth-top image {width: 96rpx;height: 96rpx;flex-shrink: 0;}
|
||||
.auth-top-content {margin-left: 20rpx;}
|
||||
.auth-top-content view {font-size: 28rpx;margin-top: 20rpx;color: #999999;}
|
||||
.auth-top-content view:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
|
||||
.auth-center {font-size: 28rpx;margin: 30rpx 0;border-bottom: 1rpx solid #F5F5F5;border-top: 1rpx solid #F5F5F5;padding: 20rpx 0;}
|
||||
.auth-bottom {display: flex;justify-content: center;align-items: center;font-size: 24rpx;}
|
||||
.btn {padding: 12rpx 40rpx;border-radius: 4rpx;}
|
||||
.btn-no {color: #07ad60;background-color: #FFFFFF;border: 1rpx solid #CCCCCC;}
|
||||
.btn-yes {color: #FFFFFF;background-color: #07ad60;border: 1rpx solid #07ad60;position: relative;margin-left: 20rpx;}
|
||||
.auth-btn {position: absolute;top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
|
||||
.isNyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,.5);}
|
||||
.isOyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,1);}
|
||||
.card-box-userinfo {transform: rotate(360deg) scale(0);transition: all 1s ease-in-out;}
|
||||
</style>
|
|
@ -0,0 +1,411 @@
|
|||
<template>
|
||||
<view :class="modal?'show-qrcode':'hide-qrcode'">
|
||||
<view class="box-qrcode" :style="{'margin-left': marginLeft + 'px'}" @longtap="longtapCode">
|
||||
<!-- style="width: 550rpx;height: 550rpx;" -->
|
||||
|
||||
<canvas class="canvas-qrcode" :style="style_w_h" :canvas-id="qrcode_id">
|
||||
|
||||
<!-- #ifndef MP -->
|
||||
<view v-if="modal&&is_themeImg" :style="style_w_h" class="box-img-qrcode">
|
||||
<image :style="style_w_h_img" mode="scaleToFill" :src="themeImg"></image>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
</canvas>
|
||||
|
||||
<!-- <image mode="scaleToFill" :src="imagePath"></image> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var qr_we = require("./qrcode_wx.js");
|
||||
const qrCode = require('./weapp-qrcode.js')
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAndroid : false ,
|
||||
show: true,
|
||||
imagePath: '',
|
||||
// qrcode_id: 'qrcode_id',
|
||||
marginLeft: 0,
|
||||
//一般的安卓app只需加30就能显示全
|
||||
//苹果app的不加就能显示全,加了就要弄margin-left
|
||||
//有些安卓app显示不全
|
||||
add_num : 30 ,
|
||||
add_num_key : 'rectify_code_key',
|
||||
}
|
||||
},
|
||||
props: {
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 260
|
||||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 260
|
||||
},
|
||||
themeColor: {
|
||||
type: String,
|
||||
default: '#333333',
|
||||
},
|
||||
qrcode_id: {
|
||||
type: String,
|
||||
default: 'qrcode_id',
|
||||
},
|
||||
is_themeImg: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
themeImg: {
|
||||
type: String,
|
||||
default: 'https://cdn.pixabay.com/photo/2016/11/29/13/24/balloons-1869816__340.jpg',
|
||||
},
|
||||
h_w_img: {
|
||||
type: Number,
|
||||
default: 30
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
watch:{
|
||||
|
||||
},
|
||||
computed: {
|
||||
style_w_h() {
|
||||
return this.set_style_w_h();
|
||||
},
|
||||
style_w_h_img() {
|
||||
let that = this;
|
||||
var height = parseInt(that.h_w_img);
|
||||
var width = parseInt(that.h_w_img);
|
||||
var style = '';
|
||||
if (height > 0) {
|
||||
style = `height:${height*2}rpx;`;
|
||||
}
|
||||
if (width > 0) {
|
||||
style += `width:${width*2}rpx;z-index: 2;`;
|
||||
}
|
||||
|
||||
return style;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
let that = this;
|
||||
try {
|
||||
//app苹果二维码不居中
|
||||
//#ifndef MP
|
||||
let isAndroid = false ;
|
||||
const res = uni.getSystemInfoSync();
|
||||
if(res.platform == 'android'){
|
||||
isAndroid = true ;
|
||||
}else{
|
||||
isAndroid = false ;
|
||||
}
|
||||
|
||||
|
||||
if (!isAndroid) {
|
||||
that.marginLeft = 46;
|
||||
}
|
||||
|
||||
that.isAndroid = isAndroid ;
|
||||
try {
|
||||
const add_num = uni.getStorageSync(that.add_num_key);
|
||||
if (add_num) {
|
||||
that.add_num = add_num;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
// error
|
||||
|
||||
}
|
||||
// #endif
|
||||
|
||||
} catch (e) {
|
||||
// error
|
||||
}
|
||||
|
||||
//#ifdef MP
|
||||
//that.marginLeft = 40;
|
||||
// #endif
|
||||
|
||||
},
|
||||
methods: {
|
||||
set_style_w_h(){
|
||||
|
||||
let that = this;
|
||||
var height = parseInt(that.height);
|
||||
var width = parseInt(that.width);
|
||||
var style = '';
|
||||
var height = height*2 ;
|
||||
var width = width*2 ;
|
||||
|
||||
//#ifndef MP
|
||||
var add = that.add_num ;
|
||||
|
||||
height += add;
|
||||
width += add;
|
||||
// #endif
|
||||
|
||||
if (height > 0) {
|
||||
style = `height:${height}rpx;`;
|
||||
}
|
||||
if (width > 0) {
|
||||
style += `width:${width}rpx;`;
|
||||
}
|
||||
|
||||
return style;
|
||||
},
|
||||
hideQrcode() {
|
||||
this.$emit("hideQrcode")
|
||||
},
|
||||
// 二维码生成工具
|
||||
crtQrCode() {
|
||||
let that = this;
|
||||
//#ifndef MP
|
||||
new qrCode(that.qrcode_id, {
|
||||
text: this.url,
|
||||
width: that.width,
|
||||
height: that.height,
|
||||
colorDark: that.themeColor,//#333333
|
||||
colorLight: "#FFFFFF",
|
||||
correctLevel: qrCode.CorrectLevel.H,
|
||||
})
|
||||
// #endif
|
||||
//#ifdef MP
|
||||
that.createQrCode(this.url, that.qrcode_id, that.width, that.height,that.themeColor,that.is_themeImg,that.themeImg,that.h_w_img);
|
||||
// #endif
|
||||
|
||||
//that.createQrCode(this.url, that.qrcode_id, that.width, that.height);
|
||||
},
|
||||
//#ifdef MP
|
||||
|
||||
createQrCode: function(url, canvasId, cavW, cavH,cavColor,haveImg,imgurl,imgsize) {
|
||||
//调用插件中的draw方法,绘制二维码图片
|
||||
qr_we.api.draw(url, canvasId, cavW, cavH,cavColor,haveImg,imgurl,imgsize, this, this.canvasToTempImage);
|
||||
// setTimeout(() => { this.canvasToTempImage();},100);
|
||||
|
||||
},
|
||||
|
||||
// #endif
|
||||
//获取临时缓存照片路径,存入data中
|
||||
canvasToTempImage: function() {
|
||||
var that = this;
|
||||
},
|
||||
saveImage: function() {
|
||||
var that = this;
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: that.qrcode_id,
|
||||
success: function(res) {
|
||||
var tempFilePath = res.tempFilePath;
|
||||
// console.log(tempFilePath);
|
||||
that.imagePath = tempFilePath;
|
||||
|
||||
//保存到相册
|
||||
// uni.saveFile({
|
||||
// tempFilePath: tempFilePath,
|
||||
// success: function (res2) {
|
||||
// var savedFilePath = res2.savedFilePath;
|
||||
|
||||
|
||||
// }
|
||||
// });
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath : tempFilePath ,
|
||||
success: function (res3) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '保存成功',
|
||||
confirmText: '确定',
|
||||
showCancel: false,
|
||||
confirmColor: '#33CCCC',
|
||||
success(res4) {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
// console.log(res);
|
||||
}
|
||||
}, that);
|
||||
},
|
||||
//微信小程序支持:长按二维码,提示是否保存相册
|
||||
//安卓APP长按校正二维码
|
||||
longtapCode(){
|
||||
var that = this;
|
||||
|
||||
//#ifndef MP
|
||||
uni.showModal({
|
||||
title: '校正二维码',
|
||||
content: '二维码是否异常',
|
||||
confirmText: '确定',
|
||||
confirmColor: '#33CCCC',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.rectify_code();
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
//#ifdef MP-WEIXIN
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否保存到相册',
|
||||
confirmText: '确定',
|
||||
confirmColor: '#33CCCC',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.saveImage();
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
//安卓有些手机不正常,长按可选择矫正
|
||||
rectify_code(){
|
||||
var that = this;
|
||||
let add_num = that.add_num ;
|
||||
add_num += 30 ;
|
||||
that.add_num = add_num;
|
||||
that.crtQrCode();//重新生成才会立即覆盖
|
||||
try {
|
||||
//第一次长按校正设置了就不用在设置
|
||||
uni.setStorage({
|
||||
key: that.add_num_key,
|
||||
data: add_num,
|
||||
success: function() {
|
||||
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
// error
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
// .qrcode-box {
|
||||
// position: fixed;
|
||||
// left: 0;
|
||||
// top: 0;
|
||||
// right: 0;
|
||||
// bottom: 0;
|
||||
// height: 100vh;
|
||||
// width: 100vw;
|
||||
// background-color: rgba(59, 59, 59, 0.6);
|
||||
// // opacity: 0.8;
|
||||
// text-align: center;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// display: none;
|
||||
|
||||
// .qrcode-item {
|
||||
// flex: 1;
|
||||
// position: relative;
|
||||
// text-align: center;
|
||||
|
||||
// .item-box {
|
||||
// width: 90%;
|
||||
// margin: auto;
|
||||
// display: inline-block;
|
||||
// margin-top: 30%;
|
||||
// padding-bottom: 30rpx;
|
||||
|
||||
// // animation: show 0.7s;
|
||||
// .title {
|
||||
// font-size: 46rpx;
|
||||
// text-align: center;
|
||||
// margin-bottom: 24rpx;
|
||||
// }
|
||||
|
||||
// .canvas {
|
||||
// margin: auto;
|
||||
// display: inline-block;
|
||||
// margin: auto;
|
||||
// }
|
||||
|
||||
// background-color: #FFFFFF;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
.box-qrcode{
|
||||
text-align: center;
|
||||
position: relative;
|
||||
.box-img-qrcode{
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
image{
|
||||
width: 60upx;
|
||||
height: 60upx;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
.canvas-qrcode {
|
||||
|
||||
margin: auto;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
||||
.opacity-qrcode {
|
||||
opacity: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.show-qrcode {
|
||||
display: block;
|
||||
animation: fade 0.7s;
|
||||
|
||||
// -moz-animation: fade 0.5s; /* Firefox */
|
||||
// -webkit-animation: fade 0.5s; /* Safari 和 Chrome */
|
||||
// -o-animation: fade 0.5s;
|
||||
}
|
||||
|
||||
.hide-qrcode {
|
||||
animation: hide 0.7s;
|
||||
}
|
||||
|
||||
@keyframes fade {
|
||||
from {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes hide {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,872 @@
|
|||
!(function() {
|
||||
|
||||
// alignment pattern
|
||||
var adelta = [
|
||||
0, 11, 15, 19, 23, 27, 31,
|
||||
16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24,
|
||||
26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28
|
||||
];
|
||||
|
||||
// version block
|
||||
var vpat = [
|
||||
0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d,
|
||||
0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9,
|
||||
0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75,
|
||||
0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64,
|
||||
0x541, 0xc69
|
||||
];
|
||||
|
||||
// final format bits with mask: level << 3 | mask
|
||||
var fmtword = [
|
||||
0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L
|
||||
0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M
|
||||
0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q
|
||||
0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H
|
||||
];
|
||||
|
||||
// 4 per version: number of blocks 1,2; data width; ecc width
|
||||
var eccblocks = [
|
||||
1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17,
|
||||
1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28,
|
||||
1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22,
|
||||
1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16,
|
||||
1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22,
|
||||
2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28,
|
||||
2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26,
|
||||
2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26,
|
||||
2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24,
|
||||
2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28,
|
||||
4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24,
|
||||
2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28,
|
||||
4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22,
|
||||
3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24,
|
||||
5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24,
|
||||
5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30,
|
||||
1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28,
|
||||
5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28,
|
||||
3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26,
|
||||
3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28,
|
||||
4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30,
|
||||
2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24,
|
||||
4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30,
|
||||
6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30,
|
||||
8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30,
|
||||
10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30,
|
||||
8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30,
|
||||
3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30,
|
||||
7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30,
|
||||
5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30,
|
||||
13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30,
|
||||
17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30,
|
||||
17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30,
|
||||
13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30,
|
||||
12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30,
|
||||
6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30,
|
||||
17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30,
|
||||
4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30,
|
||||
20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30,
|
||||
19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30
|
||||
];
|
||||
|
||||
// Galois field log table
|
||||
var glog = [
|
||||
0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b,
|
||||
0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71,
|
||||
0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45,
|
||||
0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6,
|
||||
0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88,
|
||||
0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40,
|
||||
0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d,
|
||||
0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57,
|
||||
0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18,
|
||||
0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e,
|
||||
0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61,
|
||||
0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2,
|
||||
0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6,
|
||||
0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a,
|
||||
0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7,
|
||||
0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf
|
||||
];
|
||||
|
||||
// Galios field exponent table
|
||||
var gexp = [
|
||||
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26,
|
||||
0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0,
|
||||
0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23,
|
||||
0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1,
|
||||
0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0,
|
||||
0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2,
|
||||
0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce,
|
||||
0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc,
|
||||
0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54,
|
||||
0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73,
|
||||
0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff,
|
||||
0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41,
|
||||
0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6,
|
||||
0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09,
|
||||
0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16,
|
||||
0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00
|
||||
];
|
||||
|
||||
// Working buffers:
|
||||
// data input and ecc append, image working buffer, fixed part of image, run lengths for badness
|
||||
var strinbuf = [],
|
||||
eccbuf = [],
|
||||
qrframe = [],
|
||||
framask = [],
|
||||
rlens = [];
|
||||
// Control values - width is based on version, last 4 are from table.
|
||||
var version, width, neccblk1, neccblk2, datablkw, eccblkwid;
|
||||
var ecclevel = 2;
|
||||
// set bit to indicate cell in qrframe is immutable. symmetric around diagonal
|
||||
function setmask(x, y) {
|
||||
var bt;
|
||||
if (x > y) {
|
||||
bt = x;
|
||||
x = y;
|
||||
y = bt;
|
||||
}
|
||||
// y*y = 1+3+5...
|
||||
bt = y;
|
||||
bt *= y;
|
||||
bt += y;
|
||||
bt >>= 1;
|
||||
bt += x;
|
||||
framask[bt] = 1;
|
||||
}
|
||||
|
||||
// enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask)
|
||||
function putalign(x, y) {
|
||||
var j;
|
||||
|
||||
qrframe[x + width * y] = 1;
|
||||
for (j = -2; j < 2; j++) {
|
||||
qrframe[(x + j) + width * (y - 2)] = 1;
|
||||
qrframe[(x - 2) + width * (y + j + 1)] = 1;
|
||||
qrframe[(x + 2) + width * (y + j)] = 1;
|
||||
qrframe[(x + j + 1) + width * (y + 2)] = 1;
|
||||
}
|
||||
for (j = 0; j < 2; j++) {
|
||||
setmask(x - 1, y + j);
|
||||
setmask(x + 1, y - j);
|
||||
setmask(x - j, y - 1);
|
||||
setmask(x + j, y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Reed Solomon error correction
|
||||
// exponentiation mod N
|
||||
function modnn(x) {
|
||||
while (x >= 255) {
|
||||
x -= 255;
|
||||
x = (x >> 8) + (x & 255);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
var genpoly = [];
|
||||
|
||||
// Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given.
|
||||
function appendrs(data, dlen, ecbuf, eclen) {
|
||||
var i, j, fb;
|
||||
|
||||
for (i = 0; i < eclen; i++)
|
||||
strinbuf[ecbuf + i] = 0;
|
||||
for (i = 0; i < dlen; i++) {
|
||||
fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]];
|
||||
if (fb != 255) /* fb term is non-zero */
|
||||
for (j = 1; j < eclen; j++)
|
||||
strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])];
|
||||
else
|
||||
for (j = ecbuf; j < ecbuf + eclen; j++)
|
||||
strinbuf[j] = strinbuf[j + 1];
|
||||
strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])];
|
||||
}
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Frame data insert following the path rules
|
||||
|
||||
// check mask - since symmetrical use half.
|
||||
function ismasked(x, y) {
|
||||
var bt;
|
||||
if (x > y) {
|
||||
bt = x;
|
||||
x = y;
|
||||
y = bt;
|
||||
}
|
||||
bt = y;
|
||||
bt += y * y;
|
||||
bt >>= 1;
|
||||
bt += x;
|
||||
return framask[bt];
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Apply the selected mask out of the 8.
|
||||
function applymask(m) {
|
||||
var x, y, r3x, r3y;
|
||||
|
||||
switch (m) {
|
||||
case 0:
|
||||
for (y = 0; y < width; y++)
|
||||
for (x = 0; x < width; x++)
|
||||
if (!((x + y) & 1) && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
break;
|
||||
case 1:
|
||||
for (y = 0; y < width; y++)
|
||||
for (x = 0; x < width; x++)
|
||||
if (!(y & 1) && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
break;
|
||||
case 2:
|
||||
for (y = 0; y < width; y++)
|
||||
for (r3x = 0, x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3)
|
||||
r3x = 0;
|
||||
if (!r3x && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for (r3y = 0, y = 0; y < width; y++, r3y++) {
|
||||
if (r3y == 3)
|
||||
r3y = 0;
|
||||
for (r3x = r3y, x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3)
|
||||
r3x = 0;
|
||||
if (!r3x && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for (y = 0; y < width; y++)
|
||||
for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3) {
|
||||
r3x = 0;
|
||||
r3y = !r3y;
|
||||
}
|
||||
if (!r3y && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
for (r3y = 0, y = 0; y < width; y++, r3y++) {
|
||||
if (r3y == 3)
|
||||
r3y = 0;
|
||||
for (r3x = 0, x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3)
|
||||
r3x = 0;
|
||||
if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
for (r3y = 0, y = 0; y < width; y++, r3y++) {
|
||||
if (r3y == 3)
|
||||
r3y = 0;
|
||||
for (r3x = 0, x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3)
|
||||
r3x = 0;
|
||||
if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
for (r3y = 0, y = 0; y < width; y++, r3y++) {
|
||||
if (r3y == 3)
|
||||
r3y = 0;
|
||||
for (r3x = 0, x = 0; x < width; x++, r3x++) {
|
||||
if (r3x == 3)
|
||||
r3x = 0;
|
||||
if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y))
|
||||
qrframe[x + y * width] ^= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Badness coefficients.
|
||||
var N1 = 3,
|
||||
N2 = 3,
|
||||
N3 = 40,
|
||||
N4 = 10;
|
||||
|
||||
// Using the table of the length of each run, calculate the amount of bad image
|
||||
// - long runs or those that look like finders; called twice, once each for X and Y
|
||||
function badruns(length) {
|
||||
var i;
|
||||
var runsbad = 0;
|
||||
for (i = 0; i <= length; i++)
|
||||
if (rlens[i] >= 5)
|
||||
runsbad += N1 + rlens[i] - 5;
|
||||
// BwBBBwB as in finder
|
||||
for (i = 3; i < length - 1; i += 2)
|
||||
if (rlens[i - 2] == rlens[i + 2] &&
|
||||
rlens[i + 2] == rlens[i - 1] &&
|
||||
rlens[i - 1] == rlens[i + 1] &&
|
||||
rlens[i - 1] * 3 == rlens[i]
|
||||
// white around the black pattern? Not part of spec
|
||||
&&
|
||||
(rlens[i - 3] == 0 // beginning
|
||||
||
|
||||
i + 3 > length // end
|
||||
||
|
||||
rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4)
|
||||
)
|
||||
runsbad += N3;
|
||||
return runsbad;
|
||||
}
|
||||
|
||||
// Calculate how bad the masked image is - blocks, imbalance, runs, or finders.
|
||||
function badcheck() {
|
||||
var x, y, h, b, b1;
|
||||
var thisbad = 0;
|
||||
var bw = 0;
|
||||
|
||||
// blocks of same color.
|
||||
for (y = 0; y < width - 1; y++)
|
||||
for (x = 0; x < width - 1; x++)
|
||||
if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] &&
|
||||
qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black
|
||||
||
|
||||
!(qrframe[x + width * y] || qrframe[(x + 1) + width * y] ||
|
||||
qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white
|
||||
thisbad += N2;
|
||||
|
||||
// X runs
|
||||
for (y = 0; y < width; y++) {
|
||||
rlens[0] = 0;
|
||||
for (h = b = x = 0; x < width; x++) {
|
||||
if ((b1 = qrframe[x + width * y]) == b)
|
||||
rlens[h]++;
|
||||
else
|
||||
rlens[++h] = 1;
|
||||
b = b1;
|
||||
bw += b ? 1 : -1;
|
||||
}
|
||||
thisbad += badruns(h);
|
||||
}
|
||||
|
||||
// black/white imbalance
|
||||
if (bw < 0)
|
||||
bw = -bw;
|
||||
|
||||
var big = bw;
|
||||
var count = 0;
|
||||
big += big << 2;
|
||||
big <<= 1;
|
||||
while (big > width * width)
|
||||
big -= width * width, count++;
|
||||
thisbad += count * N4;
|
||||
|
||||
// Y runs
|
||||
for (x = 0; x < width; x++) {
|
||||
rlens[0] = 0;
|
||||
for (h = b = y = 0; y < width; y++) {
|
||||
if ((b1 = qrframe[x + width * y]) == b)
|
||||
rlens[h]++;
|
||||
else
|
||||
rlens[++h] = 1;
|
||||
b = b1;
|
||||
}
|
||||
thisbad += badruns(h);
|
||||
}
|
||||
return thisbad;
|
||||
}
|
||||
|
||||
function genframe(instring) {
|
||||
var x, y, k, t, v, i, j, m;
|
||||
|
||||
// find the smallest version that fits the string
|
||||
t = instring.length;
|
||||
version = 0;
|
||||
do {
|
||||
version++;
|
||||
k = (ecclevel - 1) * 4 + (version - 1) * 16;
|
||||
neccblk1 = eccblocks[k++];
|
||||
neccblk2 = eccblocks[k++];
|
||||
datablkw = eccblocks[k++];
|
||||
eccblkwid = eccblocks[k];
|
||||
k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9);
|
||||
if (t <= k)
|
||||
break;
|
||||
} while (version < 40);
|
||||
|
||||
// FIXME - insure that it fits insted of being truncated
|
||||
width = 17 + 4 * version;
|
||||
|
||||
// allocate, clear and setup data structures
|
||||
v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
|
||||
for (t = 0; t < v; t++)
|
||||
eccbuf[t] = 0;
|
||||
strinbuf = instring.slice(0);
|
||||
|
||||
for (t = 0; t < width * width; t++)
|
||||
qrframe[t] = 0;
|
||||
|
||||
for (t = 0; t < (width * (width + 1) + 1) / 2; t++)
|
||||
framask[t] = 0;
|
||||
|
||||
// insert finders - black to frame, white to mask
|
||||
for (t = 0; t < 3; t++) {
|
||||
k = 0;
|
||||
y = 0;
|
||||
if (t == 1)
|
||||
k = (width - 7);
|
||||
if (t == 2)
|
||||
y = (width - 7);
|
||||
qrframe[(y + 3) + width * (k + 3)] = 1;
|
||||
for (x = 0; x < 6; x++) {
|
||||
qrframe[(y + x) + width * k] = 1;
|
||||
qrframe[y + width * (k + x + 1)] = 1;
|
||||
qrframe[(y + 6) + width * (k + x)] = 1;
|
||||
qrframe[(y + x + 1) + width * (k + 6)] = 1;
|
||||
}
|
||||
for (x = 1; x < 5; x++) {
|
||||
setmask(y + x, k + 1);
|
||||
setmask(y + 1, k + x + 1);
|
||||
setmask(y + 5, k + x);
|
||||
setmask(y + x + 1, k + 5);
|
||||
}
|
||||
for (x = 2; x < 4; x++) {
|
||||
qrframe[(y + x) + width * (k + 2)] = 1;
|
||||
qrframe[(y + 2) + width * (k + x + 1)] = 1;
|
||||
qrframe[(y + 4) + width * (k + x)] = 1;
|
||||
qrframe[(y + x + 1) + width * (k + 4)] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// alignment blocks
|
||||
if (version > 1) {
|
||||
t = adelta[version];
|
||||
y = width - 7;
|
||||
for (;;) {
|
||||
x = width - 7;
|
||||
while (x > t - 3) {
|
||||
putalign(x, y);
|
||||
if (x < t)
|
||||
break;
|
||||
x -= t;
|
||||
}
|
||||
if (y <= t + 9)
|
||||
break;
|
||||
y -= t;
|
||||
putalign(6, y);
|
||||
putalign(y, 6);
|
||||
}
|
||||
}
|
||||
|
||||
// single black
|
||||
qrframe[8 + width * (width - 8)] = 1;
|
||||
|
||||
// timing gap - mask only
|
||||
for (y = 0; y < 7; y++) {
|
||||
setmask(7, y);
|
||||
setmask(width - 8, y);
|
||||
setmask(7, y + width - 7);
|
||||
}
|
||||
for (x = 0; x < 8; x++) {
|
||||
setmask(x, 7);
|
||||
setmask(x + width - 8, 7);
|
||||
setmask(x, width - 8);
|
||||
}
|
||||
|
||||
// reserve mask-format area
|
||||
for (x = 0; x < 9; x++)
|
||||
setmask(x, 8);
|
||||
for (x = 0; x < 8; x++) {
|
||||
setmask(x + width - 8, 8);
|
||||
setmask(8, x);
|
||||
}
|
||||
for (y = 0; y < 7; y++)
|
||||
setmask(8, y + width - 7);
|
||||
|
||||
// timing row/col
|
||||
for (x = 0; x < width - 14; x++)
|
||||
if (x & 1) {
|
||||
setmask(8 + x, 6);
|
||||
setmask(6, 8 + x);
|
||||
}
|
||||
else {
|
||||
qrframe[(8 + x) + width * 6] = 1;
|
||||
qrframe[6 + width * (8 + x)] = 1;
|
||||
}
|
||||
|
||||
// version block
|
||||
if (version > 6) {
|
||||
t = vpat[version - 7];
|
||||
k = 17;
|
||||
for (x = 0; x < 6; x++)
|
||||
for (y = 0; y < 3; y++, k--)
|
||||
if (1 & (k > 11 ? version >> (k - 12) : t >> k)) {
|
||||
qrframe[(5 - x) + width * (2 - y + width - 11)] = 1;
|
||||
qrframe[(2 - y + width - 11) + width * (5 - x)] = 1;
|
||||
}
|
||||
else {
|
||||
setmask(5 - x, 2 - y + width - 11);
|
||||
setmask(2 - y + width - 11, 5 - x);
|
||||
}
|
||||
}
|
||||
|
||||
// sync mask bits - only set above for white spaces, so add in black bits
|
||||
for (y = 0; y < width; y++)
|
||||
for (x = 0; x <= y; x++)
|
||||
if (qrframe[x + width * y])
|
||||
setmask(x, y);
|
||||
|
||||
// convert string to bitstream
|
||||
// 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported)
|
||||
v = strinbuf.length;
|
||||
|
||||
// string to array
|
||||
for (i = 0; i < v; i++)
|
||||
eccbuf[i] = strinbuf.charCodeAt(i);
|
||||
strinbuf = eccbuf.slice(0);
|
||||
|
||||
// calculate max string length
|
||||
x = datablkw * (neccblk1 + neccblk2) + neccblk2;
|
||||
if (v >= x - 2) {
|
||||
v = x - 2;
|
||||
if (version > 9)
|
||||
v--;
|
||||
}
|
||||
|
||||
// shift and repack to insert length prefix
|
||||
i = v;
|
||||
if (version > 9) {
|
||||
strinbuf[i + 2] = 0;
|
||||
strinbuf[i + 3] = 0;
|
||||
while (i--) {
|
||||
t = strinbuf[i];
|
||||
strinbuf[i + 3] |= 255 & (t << 4);
|
||||
strinbuf[i + 2] = t >> 4;
|
||||
}
|
||||
strinbuf[2] |= 255 & (v << 4);
|
||||
strinbuf[1] = v >> 4;
|
||||
strinbuf[0] = 0x40 | (v >> 12);
|
||||
} else {
|
||||
strinbuf[i + 1] = 0;
|
||||
strinbuf[i + 2] = 0;
|
||||
while (i--) {
|
||||
t = strinbuf[i];
|
||||
strinbuf[i + 2] |= 255 & (t << 4);
|
||||
strinbuf[i + 1] = t >> 4;
|
||||
}
|
||||
strinbuf[1] |= 255 & (v << 4);
|
||||
strinbuf[0] = 0x40 | (v >> 4);
|
||||
}
|
||||
// fill to end with pad pattern
|
||||
i = v + 3 - (version < 10);
|
||||
while (i < x) {
|
||||
strinbuf[i++] = 0xec;
|
||||
// buffer has room if (i == x) break;
|
||||
strinbuf[i++] = 0x11;
|
||||
}
|
||||
|
||||
// calculate and append ECC
|
||||
|
||||
// calculate generator polynomial
|
||||
genpoly[0] = 1;
|
||||
for (i = 0; i < eccblkwid; i++) {
|
||||
genpoly[i + 1] = 1;
|
||||
for (j = i; j > 0; j--)
|
||||
genpoly[j] = genpoly[j] ?
|
||||
genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1];
|
||||
genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)];
|
||||
}
|
||||
for (i = 0; i <= eccblkwid; i++)
|
||||
genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step
|
||||
|
||||
// append ecc to data buffer
|
||||
k = x;
|
||||
y = 0;
|
||||
for (i = 0; i < neccblk1; i++) {
|
||||
appendrs(y, datablkw, k, eccblkwid);
|
||||
y += datablkw;
|
||||
k += eccblkwid;
|
||||
}
|
||||
for (i = 0; i < neccblk2; i++) {
|
||||
appendrs(y, datablkw + 1, k, eccblkwid);
|
||||
y += datablkw + 1;
|
||||
k += eccblkwid;
|
||||
}
|
||||
// interleave blocks
|
||||
y = 0;
|
||||
for (i = 0; i < datablkw; i++) {
|
||||
for (j = 0; j < neccblk1; j++)
|
||||
eccbuf[y++] = strinbuf[i + j * datablkw];
|
||||
for (j = 0; j < neccblk2; j++)
|
||||
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
|
||||
}
|
||||
for (j = 0; j < neccblk2; j++)
|
||||
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))];
|
||||
for (i = 0; i < eccblkwid; i++)
|
||||
for (j = 0; j < neccblk1 + neccblk2; j++)
|
||||
eccbuf[y++] = strinbuf[x + i + j * eccblkwid];
|
||||
strinbuf = eccbuf;
|
||||
|
||||
// pack bits into frame avoiding masked area.
|
||||
x = y = width - 1;
|
||||
k = v = 1; // up, minus
|
||||
/* inteleaved data and ecc codes */
|
||||
m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2;
|
||||
for (i = 0; i < m; i++) {
|
||||
t = strinbuf[i];
|
||||
for (j = 0; j < 8; j++, t <<= 1) {
|
||||
if (0x80 & t)
|
||||
qrframe[x + width * y] = 1;
|
||||
do { // find next fill position
|
||||
if (v)
|
||||
x--;
|
||||
else {
|
||||
x++;
|
||||
if (k) {
|
||||
if (y != 0)
|
||||
y--;
|
||||
else {
|
||||
x -= 2;
|
||||
k = !k;
|
||||
if (x == 6) {
|
||||
x--;
|
||||
y = 9;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y != width - 1)
|
||||
y++;
|
||||
else {
|
||||
x -= 2;
|
||||
k = !k;
|
||||
if (x == 6) {
|
||||
x--;
|
||||
y -= 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
v = !v;
|
||||
} while (ismasked(x, y));
|
||||
}
|
||||
}
|
||||
|
||||
// save pre-mask copy of frame
|
||||
strinbuf = qrframe.slice(0);
|
||||
t = 0; // best
|
||||
y = 30000; // demerit
|
||||
// for instead of while since in original arduino code
|
||||
// if an early mask was "good enough" it wouldn't try for a better one
|
||||
// since they get more complex and take longer.
|
||||
for (k = 0; k < 8; k++) {
|
||||
applymask(k); // returns black-white imbalance
|
||||
x = badcheck();
|
||||
if (x < y) { // current mask better than previous best?
|
||||
y = x;
|
||||
t = k;
|
||||
}
|
||||
if (t == 7)
|
||||
break; // don't increment i to a void redoing mask
|
||||
qrframe = strinbuf.slice(0); // reset for next pass
|
||||
}
|
||||
if (t != k) // redo best mask - none good enough, last wasn't t
|
||||
applymask(t);
|
||||
|
||||
// add in final mask/ecclevel bytes
|
||||
y = fmtword[t + ((ecclevel - 1) << 3)];
|
||||
// low byte
|
||||
for (k = 0; k < 8; k++, y >>= 1)
|
||||
if (y & 1) {
|
||||
qrframe[(width - 1 - k) + width * 8] = 1;
|
||||
if (k < 6)
|
||||
qrframe[8 + width * k] = 1;
|
||||
else
|
||||
qrframe[8 + width * (k + 1)] = 1;
|
||||
}
|
||||
// high byte
|
||||
for (k = 0; k < 7; k++, y >>= 1)
|
||||
if (y & 1) {
|
||||
qrframe[8 + width * (width - 7 + k)] = 1;
|
||||
if (k)
|
||||
qrframe[(6 - k) + width * 8] = 1;
|
||||
else
|
||||
qrframe[7 + width * 8] = 1;
|
||||
}
|
||||
return qrframe;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var _canvas = null;
|
||||
|
||||
var api = {
|
||||
|
||||
get ecclevel() {
|
||||
return ecclevel;
|
||||
},
|
||||
|
||||
set ecclevel(val) {
|
||||
ecclevel = val;
|
||||
},
|
||||
|
||||
get size() {
|
||||
return _size;
|
||||
},
|
||||
|
||||
set size(val) {
|
||||
_size = val
|
||||
},
|
||||
|
||||
get canvas() {
|
||||
return _canvas;
|
||||
},
|
||||
|
||||
set canvas(el) {
|
||||
_canvas = el;
|
||||
},
|
||||
|
||||
getFrame: function(string) {
|
||||
return genframe(string);
|
||||
},
|
||||
//这里的utf16to8(str)是对Text中的字符串进行转码,让其支持中文
|
||||
utf16to8: function(str) {
|
||||
var out, i, len, c;
|
||||
|
||||
out = "";
|
||||
len = str.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
},
|
||||
/**
|
||||
* 新增$this参数,传入组件的this,兼容在组件中生成
|
||||
*/
|
||||
draw: function(str, canvas, cavW, cavH, cavColor, haveImg, imageUrl, imageSize, $this, cb = function() {}, ecc) {
|
||||
var that = this;
|
||||
ecclevel = ecc || ecclevel;
|
||||
canvas = canvas || _canvas;
|
||||
if (!canvas) {
|
||||
console.warn('No canvas provided to draw QR code in!')
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let pre_background = "#ffffff";
|
||||
var size = Math.min(cavW, cavH);
|
||||
str = that.utf16to8(str); //增加中文显示
|
||||
|
||||
var frame = that.getFrame(str);
|
||||
// 组件中生成qrcode需要绑定this
|
||||
var ctx = uni.createCanvasContext(canvas, $this);
|
||||
var px = Math.round(size / (width ));
|
||||
|
||||
var roundedSize = px * (width);
|
||||
// var px = 1 ;
|
||||
// var roundedSize = px * (width + 8) ;
|
||||
|
||||
//var roundedSize = 0 ;
|
||||
//var offset = Math.floor((size - roundedSize) / 2);
|
||||
var offset = 0 ;
|
||||
size = roundedSize;
|
||||
//ctx.clearRect(0, 0, cavW, cavW);
|
||||
ctx.setFillStyle(pre_background)
|
||||
ctx.fillRect(0, 0, cavW, cavW);
|
||||
ctx.setFillStyle(cavColor);
|
||||
for (var i = 0; i < width; i++) {
|
||||
for (var j = 0; j < width; j++) {
|
||||
if (frame[j * width + i]) {
|
||||
ctx.fillRect(px * ( i) + offset, px * ( j) + offset, px, px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//画图片
|
||||
if (haveImg) {
|
||||
try {
|
||||
var x = Number(((cavW - imageSize - 14) / 2).toFixed(2));
|
||||
var y = Number(((cavH - imageSize -14) / 2).toFixed(2));
|
||||
drawRoundedRect(ctx, x, y, imageSize, imageSize, imageSize / 2, 6, true, true)
|
||||
|
||||
let isNetImg = false;
|
||||
|
||||
isNetImg = imageUrl.substr(0, 4) == 'http' ? true : false;
|
||||
|
||||
if (isNetImg) {
|
||||
//网络图片下载到本地
|
||||
uni.getImageInfo({
|
||||
src: imageUrl,
|
||||
success: function(res) {
|
||||
ctx.drawImage(res.path, x, y, imageSize, imageSize);
|
||||
//--增加绘制完成回调
|
||||
ctx.draw(false, function() {
|
||||
cb();
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ctx.drawImage(imageUrl, x, y, imageSize, imageSize);
|
||||
//--增加绘制完成回调
|
||||
ctx.draw(false, function() {
|
||||
cb();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 画圆角矩形
|
||||
function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
|
||||
ctxi.setLineWidth(lineWidth);
|
||||
ctxi.setFillStyle(pre_background);
|
||||
ctxi.setStrokeStyle(pre_background);
|
||||
ctxi.beginPath(); // draw top and top right corner
|
||||
ctxi.moveTo(x + r, y);
|
||||
ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
|
||||
ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
|
||||
ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
|
||||
ctxi.arcTo(x, y, x + r, y, r);
|
||||
ctxi.closePath();
|
||||
if (fill) {
|
||||
ctxi.fill();
|
||||
}
|
||||
if (stroke) {
|
||||
ctxi.stroke();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
} else {
|
||||
//--增加绘制完成回调
|
||||
ctx.draw(false, function() {
|
||||
cb();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
api
|
||||
}
|
||||
})();
|
|
@ -0,0 +1,424 @@
|
|||
//Core code comes from https://github.com/davidshimjs/qrcodejs
|
||||
|
||||
var QRCode;
|
||||
|
||||
(function () {
|
||||
/**
|
||||
* Get the type by string length
|
||||
*
|
||||
* @private
|
||||
* @param {String} sText
|
||||
* @param {Number} nCorrectLevel
|
||||
* @return {Number} type
|
||||
*/
|
||||
function _getTypeNumber(sText, nCorrectLevel) {
|
||||
var nType = 1;
|
||||
var length = _getUTF8Length(sText);
|
||||
|
||||
for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
|
||||
var nLimit = 0;
|
||||
|
||||
switch (nCorrectLevel) {
|
||||
case QRErrorCorrectLevel.L:
|
||||
nLimit = QRCodeLimitLength[i][0];
|
||||
break;
|
||||
case QRErrorCorrectLevel.M:
|
||||
nLimit = QRCodeLimitLength[i][1];
|
||||
break;
|
||||
case QRErrorCorrectLevel.Q:
|
||||
nLimit = QRCodeLimitLength[i][2];
|
||||
break;
|
||||
case QRErrorCorrectLevel.H:
|
||||
nLimit = QRCodeLimitLength[i][3];
|
||||
break;
|
||||
}
|
||||
|
||||
if (length <= nLimit) {
|
||||
break;
|
||||
} else {
|
||||
nType++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nType > QRCodeLimitLength.length) {
|
||||
throw new Error("Too long data");
|
||||
}
|
||||
|
||||
return nType;
|
||||
}
|
||||
|
||||
function _getUTF8Length(sText) {
|
||||
var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
|
||||
return replacedText.length + (replacedText.length != sText ? 3 : 0);
|
||||
}
|
||||
|
||||
function QR8bitByte(data) {
|
||||
this.mode = QRMode.MODE_8BIT_BYTE;
|
||||
this.data = data;
|
||||
this.parsedData = [];
|
||||
|
||||
// Added to support UTF-8 Characters
|
||||
for (var i = 0, l = this.data.length; i < l; i++) {
|
||||
var byteArray = [];
|
||||
var code = this.data.charCodeAt(i);
|
||||
|
||||
if (code > 0x10000) {
|
||||
byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
|
||||
byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
|
||||
byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
|
||||
byteArray[3] = 0x80 | (code & 0x3F);
|
||||
} else if (code > 0x800) {
|
||||
byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
|
||||
byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
|
||||
byteArray[2] = 0x80 | (code & 0x3F);
|
||||
} else if (code > 0x80) {
|
||||
byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
|
||||
byteArray[1] = 0x80 | (code & 0x3F);
|
||||
} else {
|
||||
byteArray[0] = code;
|
||||
}
|
||||
|
||||
this.parsedData.push(byteArray);
|
||||
}
|
||||
|
||||
this.parsedData = Array.prototype.concat.apply([], this.parsedData);
|
||||
|
||||
if (this.parsedData.length != this.data.length) {
|
||||
this.parsedData.unshift(191);
|
||||
this.parsedData.unshift(187);
|
||||
this.parsedData.unshift(239);
|
||||
}
|
||||
}
|
||||
|
||||
QR8bitByte.prototype = {
|
||||
getLength: function (buffer) {
|
||||
return this.parsedData.length;
|
||||
},
|
||||
write: function (buffer) {
|
||||
for (var i = 0, l = this.parsedData.length; i < l; i++) {
|
||||
buffer.put(this.parsedData[i], 8);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// QRCodeModel
|
||||
function QRCodeModel(typeNumber, errorCorrectLevel) {
|
||||
this.typeNumber = typeNumber;
|
||||
this.errorCorrectLevel = errorCorrectLevel;
|
||||
this.modules = null;
|
||||
this.moduleCount = 0;
|
||||
this.dataCache = null;
|
||||
this.dataList = [];
|
||||
}
|
||||
QRCodeModel.prototype = {
|
||||
addData: function (data) { var newData = new QR8bitByte(data); this.dataList.push(newData); this.dataCache = null; }, isDark: function (row, col) {
|
||||
if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { throw new Error(row + "," + col); }
|
||||
return this.modules[row][col];
|
||||
}, getModuleCount: function () { return this.moduleCount; }, make: function () { this.makeImpl(false, this.getBestMaskPattern()); }, makeImpl: function (test, maskPattern) {
|
||||
this.moduleCount = this.typeNumber * 4 + 17; this.modules = new Array(this.moduleCount); for (var row = 0; row < this.moduleCount; row++) { this.modules[row] = new Array(this.moduleCount); for (var col = 0; col < this.moduleCount; col++) { this.modules[row][col] = null; } }
|
||||
this.setupPositionProbePattern(0, 0); this.setupPositionProbePattern(this.moduleCount - 7, 0); this.setupPositionProbePattern(0, this.moduleCount - 7); this.setupPositionAdjustPattern(); this.setupTimingPattern(); this.setupTypeInfo(test, maskPattern); if (this.typeNumber >= 7) { this.setupTypeNumber(test); }
|
||||
if (this.dataCache == null) { this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); }
|
||||
this.mapData(this.dataCache, maskPattern);
|
||||
}, setupPositionProbePattern: function (row, col) { for (var r = -1; r <= 7; r++) { if (row + r <= -1 || this.moduleCount <= row + r) continue; for (var c = -1; c <= 7; c++) { if (col + c <= -1 || this.moduleCount <= col + c) continue; if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } } }, getBestMaskPattern: function () {
|
||||
var minLostPoint = 0; var pattern = 0; for (var i = 0; i < 8; i++) { this.makeImpl(true, i); var lostPoint = QRUtil.getLostPoint(this); if (i == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; pattern = i; } }
|
||||
return pattern;
|
||||
}, createMovieClip: function (target_mc, instance_name, depth) {
|
||||
var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); var cs = 1; this.make(); for (var row = 0; row < this.modules.length; row++) { var y = row * cs; for (var col = 0; col < this.modules[row].length; col++) { var x = col * cs; var dark = this.modules[row][col]; if (dark) { qr_mc.beginFill(0, 100); qr_mc.moveTo(x, y); qr_mc.lineTo(x + cs, y); qr_mc.lineTo(x + cs, y + cs); qr_mc.lineTo(x, y + cs); qr_mc.endFill(); } } }
|
||||
return qr_mc;
|
||||
}, setupTimingPattern: function () {
|
||||
for (var r = 8; r < this.moduleCount - 8; r++) {
|
||||
if (this.modules[r][6] != null) { continue; }
|
||||
this.modules[r][6] = (r % 2 == 0);
|
||||
}
|
||||
for (var c = 8; c < this.moduleCount - 8; c++) {
|
||||
if (this.modules[6][c] != null) { continue; }
|
||||
this.modules[6][c] = (c % 2 == 0);
|
||||
}
|
||||
}, setupPositionAdjustPattern: function () {
|
||||
var pos = QRUtil.getPatternPosition(this.typeNumber); for (var i = 0; i < pos.length; i++) {
|
||||
for (var j = 0; j < pos.length; j++) {
|
||||
var row = pos[i]; var col = pos[j]; if (this.modules[row][col] != null) { continue; }
|
||||
for (var r = -2; r <= 2; r++) { for (var c = -2; c <= 2; c++) { if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) { this.modules[row + r][col + c] = true; } else { this.modules[row + r][col + c] = false; } } }
|
||||
}
|
||||
}
|
||||
}, setupTypeNumber: function (test) {
|
||||
var bits = QRUtil.getBCHTypeNumber(this.typeNumber); for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; }
|
||||
for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; }
|
||||
}, setupTypeInfo: function (test, maskPattern) {
|
||||
var data = (this.errorCorrectLevel << 3) | maskPattern; var bits = QRUtil.getBCHTypeInfo(data); for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 6) { this.modules[i][8] = mod; } else if (i < 8) { this.modules[i + 1][8] = mod; } else { this.modules[this.moduleCount - 15 + i][8] = mod; } }
|
||||
for (var i = 0; i < 15; i++) { var mod = (!test && ((bits >> i) & 1) == 1); if (i < 8) { this.modules[8][this.moduleCount - i - 1] = mod; } else if (i < 9) { this.modules[8][15 - i - 1 + 1] = mod; } else { this.modules[8][15 - i - 1] = mod; } }
|
||||
this.modules[this.moduleCount - 8][8] = (!test);
|
||||
}, mapData: function (data, maskPattern) {
|
||||
var inc = -1; var row = this.moduleCount - 1; var bitIndex = 7; var byteIndex = 0; for (var col = this.moduleCount - 1; col > 0; col -= 2) {
|
||||
if (col == 6) col--; while (true) {
|
||||
for (var c = 0; c < 2; c++) {
|
||||
if (this.modules[row][col - c] == null) {
|
||||
var dark = false; if (byteIndex < data.length) { dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); }
|
||||
var mask = QRUtil.getMask(maskPattern, row, col - c); if (mask) { dark = !dark; }
|
||||
this.modules[row][col - c] = dark; bitIndex--; if (bitIndex == -1) { byteIndex++; bitIndex = 7; }
|
||||
}
|
||||
}
|
||||
row += inc; if (row < 0 || this.moduleCount <= row) { row -= inc; inc = -inc; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
QRCodeModel.PAD0 = 0xEC;
|
||||
QRCodeModel.PAD1 = 0x11;
|
||||
QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
|
||||
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); var buffer = new QRBitBuffer(); for (var i = 0; i < dataList.length; i++) { var data = dataList[i]; buffer.put(data.mode, 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); data.write(buffer); }
|
||||
var totalDataCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalDataCount += rsBlocks[i].dataCount; }
|
||||
if (buffer.getLengthInBits() > totalDataCount * 8) {
|
||||
throw new Error("code length overflow. ("
|
||||
+ buffer.getLengthInBits()
|
||||
+ ">"
|
||||
+ totalDataCount * 8
|
||||
+ ")");
|
||||
}
|
||||
if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { buffer.put(0, 4); }
|
||||
while (buffer.getLengthInBits() % 8 != 0) { buffer.putBit(false); }
|
||||
while (true) {
|
||||
if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }
|
||||
buffer.put(QRCodeModel.PAD0, 8); if (buffer.getLengthInBits() >= totalDataCount * 8) { break; }
|
||||
buffer.put(QRCodeModel.PAD1, 8);
|
||||
}
|
||||
return QRCodeModel.createBytes(buffer, rsBlocks);
|
||||
};
|
||||
QRCodeModel.createBytes = function (buffer, rsBlocks) {
|
||||
var offset = 0; var maxDcCount = 0; var maxEcCount = 0; var dcdata = new Array(rsBlocks.length); var ecdata = new Array(rsBlocks.length); for (var r = 0; r < rsBlocks.length; r++) {
|
||||
var dcCount = rsBlocks[r].dataCount; var ecCount = rsBlocks[r].totalCount - dcCount; maxDcCount = Math.max(maxDcCount, dcCount); maxEcCount = Math.max(maxEcCount, ecCount); dcdata[r] = new Array(dcCount); for (var i = 0; i < dcdata[r].length; i++) { dcdata[r][i] = 0xff & buffer.buffer[i + offset]; }
|
||||
offset += dcCount; var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); var modPoly = rawPoly.mod(rsPoly); ecdata[r] = new Array(rsPoly.getLength() - 1); for (var i = 0; i < ecdata[r].length; i++) { var modIndex = i + modPoly.getLength() - ecdata[r].length; ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0; }
|
||||
}
|
||||
var totalCodeCount = 0; for (var i = 0; i < rsBlocks.length; i++) { totalCodeCount += rsBlocks[i].totalCount; }
|
||||
var data = new Array(totalCodeCount); var index = 0; for (var i = 0; i < maxDcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < dcdata[r].length) { data[index++] = dcdata[r][i]; } } }
|
||||
for (var i = 0; i < maxEcCount; i++) { for (var r = 0; r < rsBlocks.length; r++) { if (i < ecdata[r].length) { data[index++] = ecdata[r][i]; } } }
|
||||
return data;
|
||||
};
|
||||
var QRMode = { MODE_NUMBER: 1 << 0, MODE_ALPHA_NUM: 1 << 1, MODE_8BIT_BYTE: 1 << 2, MODE_KANJI: 1 << 3 };
|
||||
var QRErrorCorrectLevel = { L: 1, M: 0, Q: 3, H: 2 };
|
||||
var QRMaskPattern = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 };
|
||||
var QRUtil = {
|
||||
PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), getBCHTypeInfo: function (data) {
|
||||
var d = data << 10; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); }
|
||||
return ((data << 10) | d) ^ QRUtil.G15_MASK;
|
||||
}, getBCHTypeNumber: function (data) {
|
||||
var d = data << 12; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); }
|
||||
return (data << 12) | d;
|
||||
}, getBCHDigit: function (data) {
|
||||
var digit = 0; while (data != 0) { digit++; data >>>= 1; }
|
||||
return digit;
|
||||
}, getPatternPosition: function (typeNumber) { return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; }, getMask: function (maskPattern, i, j) { switch (maskPattern) { case QRMaskPattern.PATTERN000: return (i + j) % 2 == 0; case QRMaskPattern.PATTERN001: return i % 2 == 0; case QRMaskPattern.PATTERN010: return j % 3 == 0; case QRMaskPattern.PATTERN011: return (i + j) % 3 == 0; case QRMaskPattern.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; case QRMaskPattern.PATTERN101: return (i * j) % 2 + (i * j) % 3 == 0; case QRMaskPattern.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 == 0; case QRMaskPattern.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 == 0; default: throw new Error("bad maskPattern:" + maskPattern); } }, getErrorCorrectPolynomial: function (errorCorrectLength) {
|
||||
var a = new QRPolynomial([1], 0); for (var i = 0; i < errorCorrectLength; i++) { a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); }
|
||||
return a;
|
||||
}, getLengthInBits: function (mode, type) { if (1 <= type && type < 10) { switch (mode) { case QRMode.MODE_NUMBER: return 10; case QRMode.MODE_ALPHA_NUM: return 9; case QRMode.MODE_8BIT_BYTE: return 8; case QRMode.MODE_KANJI: return 8; default: throw new Error("mode:" + mode); } } else if (type < 27) { switch (mode) { case QRMode.MODE_NUMBER: return 12; case QRMode.MODE_ALPHA_NUM: return 11; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 10; default: throw new Error("mode:" + mode); } } else if (type < 41) { switch (mode) { case QRMode.MODE_NUMBER: return 14; case QRMode.MODE_ALPHA_NUM: return 13; case QRMode.MODE_8BIT_BYTE: return 16; case QRMode.MODE_KANJI: return 12; default: throw new Error("mode:" + mode); } } else { throw new Error("type:" + type); } }, getLostPoint: function (qrCode) {
|
||||
var moduleCount = qrCode.getModuleCount(); var lostPoint = 0; for (var row = 0; row < moduleCount; row++) {
|
||||
for (var col = 0; col < moduleCount; col++) {
|
||||
var sameCount = 0; var dark = qrCode.isDark(row, col); for (var r = -1; r <= 1; r++) {
|
||||
if (row + r < 0 || moduleCount <= row + r) { continue; }
|
||||
for (var c = -1; c <= 1; c++) {
|
||||
if (col + c < 0 || moduleCount <= col + c) { continue; }
|
||||
if (r == 0 && c == 0) { continue; }
|
||||
if (dark == qrCode.isDark(row + r, col + c)) { sameCount++; }
|
||||
}
|
||||
}
|
||||
if (sameCount > 5) { lostPoint += (3 + sameCount - 5); }
|
||||
}
|
||||
}
|
||||
for (var row = 0; row < moduleCount - 1; row++) { for (var col = 0; col < moduleCount - 1; col++) { var count = 0; if (qrCode.isDark(row, col)) count++; if (qrCode.isDark(row + 1, col)) count++; if (qrCode.isDark(row, col + 1)) count++; if (qrCode.isDark(row + 1, col + 1)) count++; if (count == 0 || count == 4) { lostPoint += 3; } } }
|
||||
for (var row = 0; row < moduleCount; row++) { for (var col = 0; col < moduleCount - 6; col++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) { lostPoint += 40; } } }
|
||||
for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount - 6; row++) { if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) { lostPoint += 40; } } }
|
||||
var darkCount = 0; for (var col = 0; col < moduleCount; col++) { for (var row = 0; row < moduleCount; row++) { if (qrCode.isDark(row, col)) { darkCount++; } } }
|
||||
var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; lostPoint += ratio * 10; return lostPoint;
|
||||
}
|
||||
};
|
||||
var QRMath = {
|
||||
glog: function (n) {
|
||||
if (n < 1) { throw new Error("glog(" + n + ")"); }
|
||||
return QRMath.LOG_TABLE[n];
|
||||
}, gexp: function (n) {
|
||||
while (n < 0) { n += 255; }
|
||||
while (n >= 256) { n -= 255; }
|
||||
return QRMath.EXP_TABLE[n];
|
||||
}, EXP_TABLE: new Array(256), LOG_TABLE: new Array(256)
|
||||
}; for (var i = 0; i < 8; i++) { QRMath.EXP_TABLE[i] = 1 << i; }
|
||||
for (var i = 8; i < 256; i++) { QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8]; }
|
||||
for (var i = 0; i < 255; i++) { QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; }
|
||||
function QRPolynomial(num, shift) {
|
||||
if (num.length == undefined) { throw new Error(num.length + "/" + shift); }
|
||||
var offset = 0; while (offset < num.length && num[offset] == 0) { offset++; }
|
||||
this.num = new Array(num.length - offset + shift); for (var i = 0; i < num.length - offset; i++) { this.num[i] = num[i + offset]; }
|
||||
}
|
||||
QRPolynomial.prototype = {
|
||||
get: function (index) { return this.num[index]; }, getLength: function () { return this.num.length; }, multiply: function (e) {
|
||||
var num = new Array(this.getLength() + e.getLength() - 1); for (var i = 0; i < this.getLength(); i++) { for (var j = 0; j < e.getLength(); j++) { num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); } }
|
||||
return new QRPolynomial(num, 0);
|
||||
}, mod: function (e) {
|
||||
if (this.getLength() - e.getLength() < 0) { return this; }
|
||||
var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); var num = new Array(this.getLength()); for (var i = 0; i < this.getLength(); i++) { num[i] = this.get(i); }
|
||||
for (var i = 0; i < e.getLength(); i++) { num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); }
|
||||
return new QRPolynomial(num, 0).mod(e);
|
||||
}
|
||||
};
|
||||
function QRRSBlock(totalCount, dataCount) { this.totalCount = totalCount; this.dataCount = dataCount; }
|
||||
QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
|
||||
QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
|
||||
var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == undefined) { throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); }
|
||||
var length = rsBlock.length / 3; var list = []; for (var i = 0; i < length; i++) { var count = rsBlock[i * 3 + 0]; var totalCount = rsBlock[i * 3 + 1]; var dataCount = rsBlock[i * 3 + 2]; for (var j = 0; j < count; j++) { list.push(new QRRSBlock(totalCount, dataCount)); } }
|
||||
return list;
|
||||
};
|
||||
QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRErrorCorrectLevel.L: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRErrorCorrectLevel.M: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRErrorCorrectLevel.Q: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRErrorCorrectLevel.H: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default: return undefined; } };
|
||||
function QRBitBuffer() { this.buffer = []; this.length = 0; }
|
||||
QRBitBuffer.prototype = {
|
||||
get: function (index) { var bufIndex = Math.floor(index / 8); return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; }, put: function (num, length) { for (var i = 0; i < length; i++) { this.putBit(((num >>> (length - i - 1)) & 1) == 1); } }, getLengthInBits: function () { return this.length; }, putBit: function (bit) {
|
||||
var bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); }
|
||||
if (bit) { this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)); }
|
||||
this.length++;
|
||||
}
|
||||
};
|
||||
var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
|
||||
|
||||
// QRCode object
|
||||
QRCode = function (canvasId, vOption) {
|
||||
this._htOption = {
|
||||
width: 256,
|
||||
height: 256,
|
||||
typeNumber: 4,
|
||||
colorDark: "#000000",
|
||||
colorLight: "#ffffff",
|
||||
correctLevel: QRErrorCorrectLevel.H
|
||||
};
|
||||
|
||||
if (typeof vOption === 'string') {
|
||||
vOption = {
|
||||
text: vOption
|
||||
};
|
||||
}
|
||||
|
||||
// Overwrites options
|
||||
if (vOption) {
|
||||
for (var i in vOption) {
|
||||
this._htOption[i] = vOption[i];
|
||||
}
|
||||
}
|
||||
|
||||
this._oQRCode = null;
|
||||
this.canvasId = canvasId
|
||||
|
||||
if (this._htOption.text && this.canvasId) {
|
||||
this.makeCode(this._htOption.text);
|
||||
}
|
||||
};
|
||||
|
||||
QRCode.prototype.makeCode = function (sText) {
|
||||
this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
|
||||
this._oQRCode.addData(sText);
|
||||
this._oQRCode.make();
|
||||
this.makeImage();
|
||||
};
|
||||
|
||||
QRCode.prototype.makeImage = function () {
|
||||
var _oContext
|
||||
if (this._htOption.usingIn) {
|
||||
_oContext = wx.createCanvasContext(this.canvasId, this._htOption.usingIn)
|
||||
}
|
||||
else {
|
||||
_oContext = wx.createCanvasContext(this.canvasId)
|
||||
}
|
||||
var _htOption = this._htOption;
|
||||
var oQRCode = this._oQRCode
|
||||
|
||||
var nCount = oQRCode.getModuleCount();
|
||||
var nWidth = _htOption.width / nCount;
|
||||
var nHeight = _htOption.height / nCount;
|
||||
var nRoundedWidth = Math.round(nWidth);
|
||||
var nRoundedHeight = Math.round(nHeight);
|
||||
|
||||
if (_htOption.image && _htOption.image != '') {
|
||||
_oContext.drawImage(_htOption.image, 0, 0, _htOption.width, _htOption.height)
|
||||
}
|
||||
|
||||
for (var row = 0; row < nCount; row++) {
|
||||
for (var col = 0; col < nCount; col++) {
|
||||
var bIsDark = oQRCode.isDark(row, col);
|
||||
var nLeft = col * nWidth;
|
||||
var nTop = row * nHeight;
|
||||
_oContext.setStrokeStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)
|
||||
// _oContext.setStrokeStyle('yellow')
|
||||
_oContext.setLineWidth(1)
|
||||
_oContext.setFillStyle(bIsDark ? _htOption.colorDark : _htOption.colorLight)
|
||||
// _oContext.setFillStyle('red')
|
||||
// if (bIsDark) {
|
||||
_oContext.fillRect(nLeft, nTop, nWidth, nHeight);
|
||||
// }
|
||||
|
||||
// 안티 앨리어싱 방지 처리
|
||||
// if (bIsDark) {
|
||||
_oContext.strokeRect(
|
||||
Math.floor(nLeft) + 0.5,
|
||||
Math.floor(nTop) + 0.5,
|
||||
nRoundedWidth,
|
||||
nRoundedHeight
|
||||
);
|
||||
|
||||
_oContext.strokeRect(
|
||||
Math.ceil(nLeft) - 0.5,
|
||||
Math.ceil(nTop) - 0.5,
|
||||
nRoundedWidth,
|
||||
nRoundedHeight
|
||||
);
|
||||
// }
|
||||
// _oContext.fillRect(
|
||||
// Math.floor(nLeft) + 0.5,
|
||||
// Math.floor(nTop) + 0.5,
|
||||
// nRoundedWidth,
|
||||
// nRoundedHeight
|
||||
// );
|
||||
// _oContext.fillRect(
|
||||
// Math.ceil(nLeft) - 0.5,
|
||||
// Math.ceil(nTop) - 0.5,
|
||||
// nRoundedWidth,
|
||||
// nRoundedHeight
|
||||
// );
|
||||
// _oContext.clearRect(
|
||||
// Math.floor(nLeft) + 0.5,
|
||||
// Math.floor(nTop) + 0.5,
|
||||
// nRoundedWidth,
|
||||
// nRoundedHeight
|
||||
// );
|
||||
// _oContext.clearRect(
|
||||
// Math.ceil(nLeft) - 0.5,
|
||||
// Math.ceil(nTop) - 0.5,
|
||||
// nRoundedWidth,
|
||||
// nRoundedHeight
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
_oContext.draw()
|
||||
};
|
||||
|
||||
// 保存为图片,将临时路径传给回调
|
||||
QRCode.prototype.exportImage = function (callback) {
|
||||
if (!callback) {
|
||||
return
|
||||
}
|
||||
wx.canvasToTempFilePath({
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this._htOption.width,
|
||||
height: this._htOption.height,
|
||||
destWidth: this._htOption.width,
|
||||
destHeight: this._htOption.height,
|
||||
canvasId: this.canvasId,
|
||||
success: function (res) {
|
||||
// console.log(res.tempFilePath)
|
||||
callback(res.tempFilePath)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
QRCode.CorrectLevel = QRErrorCorrectLevel;
|
||||
})();
|
||||
|
||||
module.exports = QRCode
|
|
@ -0,0 +1,37 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="showTop" class="backTop-box">
|
||||
<image class="animated pulse infinite" @tap="backTop" src="/static/public/backTop.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"backTop",
|
||||
props:{
|
||||
showTop:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
// console.log(e);
|
||||
},
|
||||
methods:{
|
||||
backTop(){
|
||||
this.$emit('backTop')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.backTop-box{position: fixed;right: 20rpx;bottom: 160rpx;}
|
||||
.backTop-box>image{width: 60rpx;height: 50rpx;}
|
||||
</style>
|
|
@ -0,0 +1,56 @@
|
|||
<template>
|
||||
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
|
||||
<view class="posir">
|
||||
<image @tap="backHome" class="posia backH" src="/static/public/back-home-02.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disac fon26 colf">
|
||||
<view @tap="lianK" class="disac posir lianShare" style="background-color: #3875F6; border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;">
|
||||
<image src="/static/public/bottom-customer.png" class="mar-zy20" style="width: 47rpx;height: 47rpx;" mode="aspectFill"></image>
|
||||
<view>联系客服</view>
|
||||
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
<view class="disac posir lianShare" style="background-color: #38CE51;border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;">
|
||||
<image src="/static/public/bottom-shear.png" style="width: 47rpx;height: 47rpx;margin-left: 15rpx;margin-right: 8rpx;" mode="aspectFill">
|
||||
</image>
|
||||
<view>分享给好友</view>
|
||||
<button class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"bottom-tab",
|
||||
data() {
|
||||
return {
|
||||
haveImg: true,
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
backHome() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
lianK() { //客服
|
||||
this.$requst.post('user/rand-bind-service').then(res => {})
|
||||
this.$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);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,97 @@
|
|||
<template>
|
||||
<view>
|
||||
<scroll-view scroll-x >
|
||||
<view class="" :class="isCenter?'disac':'disjb'">
|
||||
<view @tap="choosecate(index)" v-if="item.title!='仿真设计'"
|
||||
:style="{
|
||||
background : newCurrent==index ? activeb:newbmo,
|
||||
fontSize:newfmo+'px',
|
||||
borderRadius:newRadius+'px',
|
||||
minWidth:isMinW ? newMinWidth+'px':'',
|
||||
color : newCurrent==index ? activec:newcmo}"
|
||||
class="flexs cateitem" :class="(!isCenter && newcateList.length<=3)?'maright0':''"
|
||||
v-for="(item,index) in newcateList" :key="index">{{item.title}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"cate-pu",
|
||||
props:{
|
||||
isCenter:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
activeb:{//选中背景色
|
||||
type:String,
|
||||
default:'#3875F6'
|
||||
},
|
||||
activec:{//选中字体颜色
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
newcateList:{//分类列表
|
||||
type:Array,
|
||||
default:function(){
|
||||
return [
|
||||
{title:'热门问题'},
|
||||
{title:'病种'},
|
||||
{title:'案例日记'},
|
||||
{title:'效果模拟'},
|
||||
{title:'效果模拟'},
|
||||
]
|
||||
}
|
||||
},
|
||||
newbmo:{//默认背景色
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
newcmo:{//默认字体颜色
|
||||
type:String,
|
||||
default:'#333333'
|
||||
},
|
||||
newfmo:{//默认字体大小
|
||||
type:String,
|
||||
default:'15'
|
||||
},
|
||||
newRadius:{//圆角
|
||||
type:String,
|
||||
default:'10'
|
||||
},
|
||||
isMinW:{//是否使用最小宽度
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
newMinWidth:{//最小宽度
|
||||
type:String,
|
||||
default:'52'//49
|
||||
},
|
||||
newCurrent:{//默认选中
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current:0,
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
choosecate(index){//二级分类选择
|
||||
// console.log('二级分类:',index);
|
||||
this.$emit('choosecateEv',index)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.catetwomo{background-color: #FFFFFF;color: #4D4D4D;}
|
||||
.disac{display: flex;align-items: center;}
|
||||
.flexs{flex-shrink: 0;}
|
||||
.cateitem{padding: 16rpx 20rpx;text-align: center;margin-right: 20rpx;}
|
||||
.maright0{margin-right: 0!important;}
|
||||
</style>
|
|
@ -0,0 +1,65 @@
|
|||
<template>
|
||||
<view v-if="list.lenght!=0">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<!-- 一级title -->
|
||||
<view class="disjbac mar-x30 mar-s10">
|
||||
<view class="fon34 bold col3">{{item.title}}</view>
|
||||
<image class="mar-y50" @tap="delSearch" v-if="item.src!=''" :src="item.src" style="width: 30rpx;height: 30rpx;" mode="heightFix"></image>
|
||||
</view>
|
||||
<view class="fon24 col6 disac fw">
|
||||
<!-- 二级title -->
|
||||
<view @tap="choosetwo(index,indexo)"
|
||||
v-for="(itemo,indexo) in item.list" :key="indexo"
|
||||
class="radius10 mar-y20 flexs mar-x20 cate-tu-item">{{itemo.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"cate-tu",
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
isDetail:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
choosetwo(e1,e2){
|
||||
// console.log('一级索引:',e1);
|
||||
// console.log('二级索引:',e2);
|
||||
// console.log(this.list[e1].list[e2].content);
|
||||
if(this.isDetail){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/problemDetail/problemDetail?id=${this.list[e1].list[e2].id}&category_id=${this.list[e1].list[e2].category_id}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/searchPage/searchPage?keyWorld=${this.list[e1].list[e2].content}`
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
delSearch(){
|
||||
// this.list = []
|
||||
this.$emit('delev')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,107 @@
|
|||
.lotus-address-picker {
|
||||
font-size: 26rpx;
|
||||
padding-top: 30rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
line-height: normal;
|
||||
padding-right: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.lotus-address-picker-box {
|
||||
/*display: -webkit-box;
|
||||
display: -webkit-flex;*/
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
padding-top: 10rpx;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.lotus-address-picker-box-item {
|
||||
height: 600upx;
|
||||
overflow-y: auto;
|
||||
width: 33.333%;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.lotus-address-picker2 {
|
||||
color: #e93b3d;
|
||||
position: relative;
|
||||
}
|
||||
.lotus-address-picker2:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 65%;
|
||||
transform: translateY(-35%) rotate(-45deg);
|
||||
width: 20rpx;
|
||||
height: 10rpx;
|
||||
border-left-width: 4rpx;
|
||||
border-bottom-width: 4rpx;
|
||||
border-left-style: solid;
|
||||
border-bottom-style: solid;
|
||||
border-left-color: #e93b3d;
|
||||
border-bottom-color: #e93b3d;
|
||||
}
|
||||
.lotus-address-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.lotus-address-box {
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.lotus-address-action {
|
||||
font-size: 30rpx;
|
||||
/*display: -webkit-box;
|
||||
display: -webkit-flex;*/
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
padding: 25rpx 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
.lotus-address-action:after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
border-top: 1px solid #eee;
|
||||
color: #eee;
|
||||
transform-origin: 0 0;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.lotus-address-action:before {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
border-bottom: 1px solid #eee;
|
||||
color: #eee;
|
||||
transform-origin: 0 100%;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.lotus-address-action-cancel {
|
||||
color: #969696;
|
||||
}
|
||||
.lotus-address-action-affirm {
|
||||
color: #e93b3d;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,233 @@
|
|||
<template>
|
||||
<!--地址picker-->
|
||||
<view :status="checkStatus" v-if="lotusAddressData.visible" class="lotus-address-mask">
|
||||
<view :class="lotusAddressData.visible?'lotus-address-box':'lotus-address-box lotus-address-box-out'">
|
||||
<view class="lotus-address-action">
|
||||
<text @tap="cancelPicker" class="lotus-address-action-cancel">取消</text>
|
||||
<text @tap="chosedVal" class="lotus-address-action-affirm">确认</text>
|
||||
</view>
|
||||
<view class="lotus-address-picker-box">
|
||||
<!--省-->
|
||||
<scroll-view scroll-y :scroll-into-view="'pid'+pChoseIndex" class="lotus-address-picker-box-item">
|
||||
<view @tap="clickPicker(0,pIndex,pItem);" :id="'pid'+pIndex" :class="pIndex === pChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(pItem,pIndex) in province" :key="pIndex">{{pItem}}</view>
|
||||
</scroll-view>
|
||||
<!--市-->
|
||||
<scroll-view scroll-y :scroll-into-view="'cid'+cChoseIndex" class="lotus-address-picker-box-item">
|
||||
<view @tap="clickPicker(1,cIndex,cItem);" :id="'cid'+cIndex" :class="cIndex === cChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(cItem,cIndex) in city" :key="cIndex">{{cItem}}</view>
|
||||
</scroll-view>
|
||||
<!--区-->
|
||||
<scroll-view scroll-y :scroll-into-view="'tid'+tChoseIndex" class="lotus-address-picker-box-item">
|
||||
<view @tap="clickPicker(2,tIndex,tItem);" :id="'tid'+tIndex" :class="tIndex === tChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(tItem,tIndex) in town" :key="tIndex">{{tItem}}</view>
|
||||
</scroll-view>
|
||||
<!--区END-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--地址picker END-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {lotusAddressJson} from "./city.js";
|
||||
export default {
|
||||
props:['lotusAddressData'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
province:[],
|
||||
city:[],
|
||||
town:[],
|
||||
provinceName:'',
|
||||
cityName:'',
|
||||
townName:'',
|
||||
type:0,//0新增1编辑
|
||||
pChoseIndex:-1,
|
||||
cChoseIndex:-1,
|
||||
tChoseIndex:-1
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
//取消
|
||||
cancelPicker(){
|
||||
const provinceCode = this.getTarId(this.provinceName);
|
||||
const cityCode = this.getTarId(this.cityName);
|
||||
const townCode = this.getTarId(this.townName);
|
||||
this.visible = false;
|
||||
this.$emit("choseVal",{
|
||||
province:this.provinceName,
|
||||
provinceCode,
|
||||
city:this.cityName,
|
||||
cityCode,
|
||||
town:this.townName,
|
||||
townCode,
|
||||
isChose:0,
|
||||
visible:false
|
||||
});
|
||||
},
|
||||
//获取最后选择的省市区的值
|
||||
chosedVal() {
|
||||
this.type = 1;
|
||||
const provinceCode = this.getTarId(this.provinceName);
|
||||
const cityCode = this.getTarId(this.cityName);
|
||||
const townCode = this.getTarId(this.townName);
|
||||
this.visible = false;
|
||||
let isChose = 0;
|
||||
//已选省市区 isChose = 1
|
||||
if((this.provinceName&&this.cityName)||(this.provinceName&&this.cityName&&this.townName)){
|
||||
isChose = 1;
|
||||
}
|
||||
this.$emit("choseVal",{
|
||||
province:this.provinceName,
|
||||
provinceCode,
|
||||
city:this.cityName,
|
||||
cityCode,
|
||||
town:this.townName,
|
||||
townCode,
|
||||
isChose,
|
||||
visible:false
|
||||
});
|
||||
},
|
||||
//获取省市区value
|
||||
getTarId(name,type){
|
||||
let id = 0;
|
||||
lotusAddressJson.map((item,index)=>{
|
||||
if(item.name === name){
|
||||
id = item.value;
|
||||
}
|
||||
});
|
||||
return id;
|
||||
},
|
||||
//获取市数据
|
||||
getCityArr(parentId){
|
||||
let city = [];
|
||||
lotusAddressJson.map((item,index)=>{
|
||||
if(item.parent === parentId){
|
||||
city.push(item.name);
|
||||
}
|
||||
});
|
||||
return city;
|
||||
},
|
||||
//获取区数据
|
||||
getTownArr(parentId){
|
||||
let town = [];
|
||||
lotusAddressJson.map((item,index)=>{
|
||||
if(index>34&&item.parent === parentId){
|
||||
town.push(item.name);
|
||||
}
|
||||
});
|
||||
return town;
|
||||
},
|
||||
//初始化数据
|
||||
initFn(){
|
||||
if(!this.province.length){
|
||||
lotusAddressJson.map((item,index)=>{
|
||||
if(index<=34){
|
||||
this.province.push(item.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
//已选择省市区,高亮显示对应选择省市区
|
||||
const p = this._props.lotusAddressData.provinceName;
|
||||
const c = this._props.lotusAddressData.cityName;
|
||||
const t = this._props.lotusAddressData.townName;
|
||||
//已选省
|
||||
if(p){
|
||||
this.pChoseIndex = this.getTarIndex(this.province,p);
|
||||
}
|
||||
//已选市
|
||||
if(p&&c){
|
||||
const pid = this.getTarId(p);
|
||||
this.city = this.getCityArr(pid);
|
||||
this.cChoseIndex = this.getTarIndex(this.city,c);
|
||||
}
|
||||
//已选区
|
||||
if(p&&c&&t){
|
||||
const cid= this.getTarId(c);
|
||||
this.town = this.getTownArr(cid);
|
||||
this.tChoseIndex = this.getTarIndex(this.town,t);
|
||||
}
|
||||
//未选省市区
|
||||
if(!p&&!c&&!t){
|
||||
this.pChoseIndex = -1;
|
||||
this.cChoseIndex = -1;
|
||||
this.tChoseIndex = -1;
|
||||
this.city = [];
|
||||
this.town = [];
|
||||
}
|
||||
},
|
||||
//获取已选省市区
|
||||
getChosedData(){
|
||||
const pid = this.getTarId(this.provinceName,'province');
|
||||
this.city = this.getCityArr(pid);
|
||||
const cid= this.getTarId(this.cityName,'city');
|
||||
this.town = this.getTownArr(cid);
|
||||
//已选省市区获取对应index
|
||||
if(this.provinceName){
|
||||
this.pChoseIndex = this.getTarIndex(this.province,this.provinceName);
|
||||
}
|
||||
if(this.cityName){
|
||||
this.cChoseIndex = this.getTarIndex(this.city,this.cityName);
|
||||
}
|
||||
if(this.townName){
|
||||
this.tChoseIndex = this.getTarIndex(this.town,this.townName);
|
||||
}
|
||||
},
|
||||
//选择省市区交互
|
||||
clickPicker(type,index,name){
|
||||
//省
|
||||
if(type === 0){
|
||||
this.pChoseIndex = index;
|
||||
this.provinceName = name;
|
||||
this.cChoseIndex = -1;
|
||||
this.tChoseIndex = -1;
|
||||
this.cityName = '';
|
||||
this.townName = '';
|
||||
}
|
||||
//市
|
||||
if(type ===1){
|
||||
this.cChoseIndex = index;
|
||||
this.cityName = name;
|
||||
this.tChoseIndex = -1;
|
||||
this.townName = '';
|
||||
}
|
||||
//区
|
||||
if(type === 2){
|
||||
this.tChoseIndex = index;
|
||||
this.townName = name;
|
||||
}
|
||||
//获取省市区数据
|
||||
this.getChosedData();
|
||||
},
|
||||
//获取已选省市区index
|
||||
getTarIndex(arr,tarName){
|
||||
let cIndex = 0;
|
||||
arr.map((item,index)=>{
|
||||
if(item === tarName){
|
||||
cIndex = index;
|
||||
}
|
||||
});
|
||||
return cIndex;
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
checkStatus(){
|
||||
let t = null;
|
||||
const _this = this;
|
||||
if(!_this.visible){
|
||||
_this.visible = _this._props.lotusAddressData.visible;
|
||||
//获取省市区
|
||||
_this.provinceName = _this._props.lotusAddressData.provinceName;
|
||||
_this.cityName = _this._props.lotusAddressData.cityName;
|
||||
_this.townName = _this._props.lotusAddressData.townName;
|
||||
//生成初始化数据
|
||||
_this.initFn();
|
||||
t = _this.visible;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import "./city.css";
|
||||
</style>
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<view @touchmove.stop.prevent="moveHandle" v-if="vision" class="auth-box">
|
||||
<view>
|
||||
<view class="auth-top">
|
||||
<image :src="appletImg" mode=""></image>
|
||||
<view class="auth-top-content">
|
||||
<view>恒美植发客服代表提醒您:</view>
|
||||
<view>您当前是游客身份</view>
|
||||
<view>是否选择授权登录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="auth-center">申请 获取你的昵称、头像、地区及性别</view>
|
||||
<view class="auth-bottom">
|
||||
<view @tap="chooseBtn(0)" :class="isNo?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
|
||||
<view @tap="chooseBtn(1)" :class="isOk?'isOyin':'noyin'" class="btn btn-yes">
|
||||
<text>立即授权</text>
|
||||
<button open-type="getUserInfo" @tap="shouq" class="auth-btn">立即授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"empower",
|
||||
props:{
|
||||
vision:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
appletImg:{//小程序头像
|
||||
type:String,
|
||||
default:'/static/public/like.png'
|
||||
},
|
||||
appletName:{//小程序名称
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
url:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
isWhere:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isOk:false,
|
||||
isNo:false,
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
moveHandle(){
|
||||
return false
|
||||
},
|
||||
tiaoZ(){//跳转方式
|
||||
if(this.isWhere==0) uni.navigateBack({delta:1}) //返回上一页
|
||||
if(this.isWhere==1) uni.navigateTo({url:this.url})//跳转到指定页面
|
||||
if(this.isWhere!=0 && this.isWhere!=1) return//不跳转
|
||||
this.isOk = false
|
||||
},
|
||||
chooseBtn(index){//暂不授权、立即授权
|
||||
this.$emit('cancleEv',index)//继承事件
|
||||
if(index==0){//暂不授权
|
||||
// this.tiaoZ()
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
this.isOk = false
|
||||
} else {
|
||||
this.isOk = !this.isOk
|
||||
this.isNo = false
|
||||
}
|
||||
},
|
||||
shouq(){//立即授权事件
|
||||
let ya = this;
|
||||
this.$toolAll.tools.showToast('正在调起授权...')
|
||||
let code = ''//声明code
|
||||
uni.login({// 获取登录用户code
|
||||
provider: 'weixin',
|
||||
success: function(result) {
|
||||
uni.hideToast()
|
||||
code = result.code
|
||||
},
|
||||
});
|
||||
uni.getUserProfile({//调起微信授权弹框
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
ya.updateUserInfo(code,res.userInfo)
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('用户拒绝授权');
|
||||
this.tiaoZ()
|
||||
this.$emit('cancleEv',0)
|
||||
this.isOk = false
|
||||
}
|
||||
});
|
||||
},
|
||||
//调用登录接口
|
||||
updateUserInfo(code,userInfo) {
|
||||
let ya = this;
|
||||
uni.showToast({title: '授权中...',icon:'loading',})
|
||||
var params = {
|
||||
code:code,
|
||||
nickname: userInfo.nickName,//用户昵称
|
||||
headimgurl: userInfo.avatarUrl,//用户头像
|
||||
country: userInfo.country,//用户所在国家
|
||||
province: userInfo.province,//用户所在省份
|
||||
city: userInfo.city,//用户所在城市
|
||||
gender: userInfo.gender,//用户性别
|
||||
language:userInfo.language,//语言
|
||||
is_active:1
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
ya.successAfterEv(userInfo)
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
successAfterEv(userInfo){//缓存信息
|
||||
let ya = this
|
||||
uni.hideToast()
|
||||
// console.log(uni.getStorageSync('headImg'));
|
||||
ya.$toolAll.tools.showToast('授权成功','success')
|
||||
ya.$emit('cancleEv',0)
|
||||
ya.$emit('buttonH',true)
|
||||
if(ya.url!=''){
|
||||
setTimeout(()=>{uni.navigateTo({url:ya.url})},1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.auth-box {position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;z-index: 3;}
|
||||
.auth-box > view {background-color: #FFFFFF;border-radius: 10rpx;padding: 30rpx;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.5);margin: 0 100rpx;}
|
||||
.auth-top {display: flex;}
|
||||
.auth-top image {width: 96rpx;height: 96rpx;flex-shrink: 0;}
|
||||
.auth-top-content {margin-left: 20rpx;}
|
||||
.auth-top-content view {font-size: 28rpx;margin-top: 20rpx;color: #999999;}
|
||||
.auth-top-content view:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
|
||||
.auth-center {font-size: 28rpx;margin: 30rpx 0;border-bottom: 1rpx solid #F5F5F5;border-top: 1rpx solid #F5F5F5;padding: 20rpx 0;}
|
||||
.auth-bottom {display: flex;justify-content: center;align-items: center;font-size: 24rpx;}
|
||||
.btn {padding: 12rpx 40rpx;border-radius: 4rpx;}
|
||||
.btn-no {color: #07ad60;background-color: #FFFFFF;border: 1rpx solid #CCCCCC;}
|
||||
.btn-yes {color: #FFFFFF;background-color: #07ad60;border: 1rpx solid #07ad60;position: relative;margin-left: 20rpx;}
|
||||
.auth-btn {position: absolute;top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
|
||||
.isNyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,.5);}
|
||||
.isOyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,1);}
|
||||
</style>
|
|
@ -0,0 +1,176 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="foot-boxtwo"
|
||||
:style="{
|
||||
background: isGradualChange ? `linear-gradient( to ${direction}, ${colorOne} 0%, ${colorTwo} 20%, ${colorThree} 80%, ${colorFour} 100%)` : `url(${backgroundImage}) ${backgroundColor} `,
|
||||
boxShadow: `-10rpx 0rpx 20rpx rgba( 0, 0, 0, ${boxShadowNum})`
|
||||
}">
|
||||
<!-- tab-图标列表 -->
|
||||
<view class="item-box" :style="{marginBottom: marginBottomNum +'px'}">
|
||||
<view @tap="choosefoot(index)"
|
||||
:style="{width: 100 / imgList.length +'%'}"
|
||||
:class="index == isIcon ? 'centerBox' : ''"
|
||||
v-for="(itemi,index) in imgList" :key="index">
|
||||
<view class="posir" :class="index == isIcon ? 'centerBox-item':''">
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-if="newcurrent == index" :src="itemi.selectedIconPath"></image>
|
||||
<image :class="index == isIcon ? 'centerImg':'moImg'" v-else :src="itemi.iconPath"></image>
|
||||
<button v-if="index == isIcon && isCustomerService" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- tab-标题列表 -->
|
||||
<view class="item-box">
|
||||
<view @tap="choosefoot(index)"
|
||||
:style="{width:100 / imgList.length +'%', color:newcurrent == index ? colorActive : colorMo}"
|
||||
v-for="(itemt,index) in titleList" :key="index">{{itemt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:'foot-tab',
|
||||
props:{
|
||||
// 当前选中项
|
||||
newcurrent:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
// 标题内容
|
||||
titleList:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return uni.getStorageSync('footTitle')
|
||||
}
|
||||
},
|
||||
// icon图标
|
||||
imgList:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return uni.getStorageSync('imgList');
|
||||
}
|
||||
},
|
||||
// 默认哪个图标突出
|
||||
isIcon:{
|
||||
type:Number,
|
||||
default:2
|
||||
},
|
||||
// 底部导航背景图片
|
||||
backgroundImage:{
|
||||
type:String,
|
||||
default:'/static/public/member-head.png'
|
||||
},
|
||||
// 背景颜色
|
||||
backgroundColor:{
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
// 是否开启背景颜色渐变
|
||||
isGradualChange:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
// 渐变方向
|
||||
direction:{
|
||||
type:String,
|
||||
default:'right top'
|
||||
},
|
||||
// 第一种颜色
|
||||
colorOne:{
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
// 第二种颜色
|
||||
colorTwo:{
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
// 第三种颜色
|
||||
colorThree:{
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
// 第四种颜色
|
||||
colorFour:{
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
// 阴影大小0~1之间 0表示没有阴影
|
||||
boxShadowNum:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
// 图标与文字的间距
|
||||
marginBottomNum:{
|
||||
type:Number,
|
||||
default:4
|
||||
},
|
||||
// 默认的标题颜色
|
||||
colorMo:{
|
||||
type:String,
|
||||
default:'#999999'
|
||||
},
|
||||
// 选中的标题颜色
|
||||
colorActive:{
|
||||
type:String,
|
||||
default:'#000000'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isCustomerService:false,//是否存在客服 默认不存在客服
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
choosefoot(index){
|
||||
switch (index){
|
||||
case 0:
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
break;
|
||||
case 1:
|
||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||
break;
|
||||
case 2:
|
||||
uni.reLaunch({url:'/pages/tabbar/cate/cate'})
|
||||
break;
|
||||
case 3:
|
||||
uni.reLaunch({url:'/pages/tabbar/shop/shop'})
|
||||
break;
|
||||
case 4:
|
||||
uni.reLaunch({url:'/pages/tabbar/my/staffDuan'})
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* 外框样式 start */
|
||||
.foot-boxtwo{
|
||||
height: 140rpx;
|
||||
font-size: 24rpx;
|
||||
position: fixed;bottom: 0;left: 0;right: 0;z-index: 10;
|
||||
display: flex;flex-direction: column;justify-content: center;
|
||||
background-repeat: no-repeat;background-size: 100% 100%;
|
||||
}
|
||||
/* 外框样式 end */
|
||||
|
||||
/* 公共 start*/
|
||||
.moImg{width: 64rpx;height: 64rpx;}
|
||||
/* 公共 end*/
|
||||
|
||||
/* 图标-文字外框样式 start */
|
||||
.item-box{display: flex;justify-content: space-around;align-items: center;}
|
||||
.item-box>view{text-align: center;}
|
||||
/* 图标-文字外框样式 end */
|
||||
|
||||
/* 突出的图标样式 start */
|
||||
.centerBox{display: flex;justify-content: center;align-items: center;}
|
||||
.centerBox-item{width: 124rpx;height: 124rpx;margin-top: -40rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;}
|
||||
.centerImg{width: 112rpx;height: 112rpx;}
|
||||
/* 突出的图标样式 end */
|
||||
</style>
|
|
@ -0,0 +1,65 @@
|
|||
<template>
|
||||
<view class="disjb fw">
|
||||
<view @tap="chooseDoctor(index)" class="radius10 dis fc bacf mar-x20" style="width: 48.6%;" v-for="(item,index) in list" :key="index">
|
||||
<image :src="item.imgSrc" class="doctorImg" mode="aspectFill"></image>
|
||||
<view class="col3 mar-s10 mar-x20 mar-z10">
|
||||
<view class="fon28 bold doctoritem disac">{{item.name}}</view>
|
||||
<!-- <view class="fon26 mar-sx10 disac">
|
||||
<view>从业{{item.cyear}}年</view>
|
||||
<view v-if="item.bmen!=''" class="doctorx"></view>
|
||||
<view>{{item.bmen}}</view>
|
||||
</view>
|
||||
<view class="fon26 mar-x10">职称:{{item.zcheng}}</view> -->
|
||||
<!-- <view class="fon24 disac">
|
||||
<view class="flexs">擅长:</view>
|
||||
<scroll-view scroll-x style="width: 250rpx;">
|
||||
<view class="disac">
|
||||
<view class="flexs" v-for="(itemt,indext) in item.goodAt" :key="indext">
|
||||
<text class="bold mar-y10 pcol">{{itemt.disease_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view> -->
|
||||
<view class="fon24 disac fw mar-s10" style="width: 166px;">
|
||||
<view class="flexs">擅长:</view>
|
||||
<view class="flexs" v-for="(itemt,indext) in item.goodAt" :key="indext">
|
||||
<text class="bold mar-y10 pcol">{{itemt.disease_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"list-doctor",
|
||||
props:{
|
||||
list:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
chooseDoctor(index){//选择医生事件
|
||||
console.log(this.list[index].id);
|
||||
if(this.list[index].show_detail==1){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/doctorDetail/doctorDetail?doctor_id='+this.list[index].id
|
||||
})
|
||||
} else this.$toolAll.tools.showToast('禁止查看该医生信息')
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,174 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="disjb fw" v-if="list.length!=0">
|
||||
<!-- 左侧列表 -->
|
||||
<view class="list-box">
|
||||
<view @tap="goDetail(index)" v-if="index%2==0" :class="radiu?'radius15 mar-x10':'radius30 mar-x30'" class="posir colf zou" v-for="(item,index) in list" :key="index">
|
||||
<!-- 背景图 -->
|
||||
<image :class="radiu?'radius15':'radius30'" class=" width100 list-min" :src="item.main_img" mode="widthFix"></image>
|
||||
<view class="posia list-like-box" @tap.stop="chooseLike(index)">
|
||||
<!-- 不喜欢 -->
|
||||
<image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image>
|
||||
<!-- 喜欢 -->
|
||||
<image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20">
|
||||
<!-- 视频标题 -->
|
||||
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
|
||||
<view class="clips1">{{item.title}}</view>
|
||||
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text> -->
|
||||
</view>
|
||||
<!-- 视频描述 -->
|
||||
<view class="mar-x10 clips1 opc">{{item.content}}</view>
|
||||
<view class="disjbac">
|
||||
<view class="disac">
|
||||
<!-- 发布者头像 -->
|
||||
<image class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
|
||||
<!-- 发布者昵称 -->
|
||||
<view class="clips1 opc">{{item.name}}</view>
|
||||
</view>
|
||||
<text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 右侧列表 -->
|
||||
<view class="list-box">
|
||||
<view @tap="goDetail(index)" v-if="index%2!=0" :class="radiu?'radius15 mar-x10':'radius30 mar-x30'" class="posir colf zou" v-for="(item,index) in list" :key="index">
|
||||
<!-- 背景图 -->
|
||||
<image :class="radiu?'radius15':'radius30'" class="width100 list-min" :src="item.main_img" mode="widthFix"></image>
|
||||
<view class="posia list-like-box" @tap.stop="chooseLike(index)">
|
||||
<!-- 不喜欢 -->
|
||||
<image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image>
|
||||
<!-- 喜欢 -->
|
||||
<image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20 ">
|
||||
<!-- 视频标题 -->
|
||||
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
|
||||
<view class="clips1">{{item.title}}</view>
|
||||
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text> -->
|
||||
</view>
|
||||
<!-- 视频描述 -->
|
||||
<view class="mar-x10 clips1 opc">{{item.content}}</view>
|
||||
<view class="disjbac">
|
||||
<view class="disac">
|
||||
<!-- 发布者头像 -->
|
||||
<image class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
|
||||
<!-- 发布者昵称 -->
|
||||
<view class="clips1 opc">{{item.name}}</view>
|
||||
</view>
|
||||
<text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs">视频</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="" style="display: flex;flex-direction: column;align-items: center;">
|
||||
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
|
||||
<!-- <view class="fon24 col3" style="margin-bottom: 60rpx;">暂无内容</view> -->
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 弹框授权 -->
|
||||
<empower :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empower from '@/components/empower.vue';
|
||||
export default {
|
||||
components:{
|
||||
empower
|
||||
},
|
||||
name:"list-pu",
|
||||
props:{
|
||||
list:{//数据
|
||||
type:Array,
|
||||
default:function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
nWidth:{
|
||||
type:String,
|
||||
default:'120'
|
||||
},
|
||||
nHeight:{
|
||||
type:String,
|
||||
default:'120'
|
||||
},
|
||||
nFon:{
|
||||
type:String,
|
||||
default:'15'
|
||||
},
|
||||
nmarz:{
|
||||
type:String,
|
||||
default:'10'
|
||||
},
|
||||
radiu:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
vision:false,
|
||||
isShowT:false,
|
||||
pu_content:'是否需要取消收藏?',
|
||||
current:'-1',
|
||||
jieDuan:false,
|
||||
isVedio:uni.getStorageSync('isVedio')
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
cancleEv(e){
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
goDetail(index){//查看详情
|
||||
if(this.jieDuan==false){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/problemDetail/problemDetail?id='+this.list[index].id+'&category_id='+this.list[index].category_id
|
||||
})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
chooseLike(index){//喜欢不喜欢事件
|
||||
// console.log('喜欢不喜欢:',index);
|
||||
if(this.jieDuan==false){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.$emit('chooseLike',index)
|
||||
this.current = index
|
||||
if(this.list[index].is_collected==1) {
|
||||
this.isShowT = true
|
||||
} else {
|
||||
let maiOjb = {
|
||||
e:3,//内容收藏
|
||||
c:this.list[index].id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
comfirmev(){
|
||||
// console.log('取消收藏成功');
|
||||
this.$emit('comfirmev',this.current)
|
||||
this.isShowT = false
|
||||
},
|
||||
cancleev(){
|
||||
// console.log('关闭弹框');
|
||||
this.isShowT = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<text :style="{ color: color, 'font-size': size + 'rpx' }" :class="{isTheme:isTheme}" class="lw-icons"
|
||||
@click="_onClick">{{icons[icon]}}</text>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import icons from './icons.js';
|
||||
// #ifdef APP-NVUE
|
||||
var domModule = weex.requireModule('dom');
|
||||
domModule.addRule('fontFace', {
|
||||
'fontFamily': 'iconfont',
|
||||
'src': 'url(\'https://at.alicdn.com/t/font_2294175_vq7ymlkpbtm.ttf\')',
|
||||
});
|
||||
// #endif
|
||||
export default {
|
||||
name: 'UniIcons',
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#333333'
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 50
|
||||
},
|
||||
isTheme: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
icons: icons
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_onClick() {
|
||||
this.$emit('click')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* #ifndef APP-NVUE */
|
||||
@font-face {
|
||||
font-family: iconfont;
|
||||
src: url('https://at.alicdn.com/t/font_2294175_vq7ymlkpbtm.ttf')
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
.lw-icons {
|
||||
font-family: iconfont;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,6 @@
|
|||
export default {
|
||||
'aixin':'\ue8ab',
|
||||
'rules':'\ue909',
|
||||
'sound':'\ue8ea',
|
||||
'arrowright':'\uee02'
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="contentBox" v-if="list.length" @click="toEmit()"
|
||||
:style="'color:' + color + ';background-color:' + backgroundColor + ';height:' + height+'rpx;'">
|
||||
<view v-if="showIcon" class="supBox">
|
||||
<lwIcon :size="32" :color="iconColor" icon="sound"></lwIcon>
|
||||
</view>
|
||||
<view v-if="list.length > 1" class="content">
|
||||
<view v-for="(item, index) in list" :key="index" @tap.stop="dangGao(index)">
|
||||
<view class="loopItemBase" :class="index==0&&firstIn?'fistInClass':''"
|
||||
:animation="realAnimation(index)" v-if="aindexArr.includes(index)"
|
||||
:style="'line-height:'+height+'rpx;'">
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length == 1" class="content">
|
||||
<view :style="'line-height:'+height+'rpx;'" @tap.stop="dangGao(0)" class="loopItemBaseShow">{{ list[0] }}</view>
|
||||
</view>
|
||||
<view v-if="showMore" class="offBox">
|
||||
<lwIcon :size="32" :color="moreColor" icon="arrowright"></lwIcon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/*
|
||||
lw-notice公告上下轮询组件(组件内依赖了自有的字体图标组件,可自行替换为uni或自身项目的图标组件)
|
||||
color:字体颜色
|
||||
backgroundColor:背景色
|
||||
list:要循环的列表数据
|
||||
height:组件高度
|
||||
showScale:是否有缩放动画
|
||||
runTime:间隔切换时间
|
||||
showIcon:是否显示头部小喇叭
|
||||
iconColor:小喇叭的颜色
|
||||
showMore:是否显示尾部更多
|
||||
moreColor:显示更多的颜色
|
||||
*/
|
||||
import lwIcon from './iconFont.vue'
|
||||
export default {
|
||||
components: {
|
||||
lwIcon
|
||||
},
|
||||
props: {
|
||||
color: {
|
||||
type: String,
|
||||
default: '#666666'
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: '#f5f5f5'
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 80
|
||||
},
|
||||
showScale: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
runTime: {
|
||||
type: Number,
|
||||
default: 4000
|
||||
},
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showMore: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: '#aaaaaa'
|
||||
},
|
||||
moreColor: {
|
||||
type: String,
|
||||
default: '#aaaaaa'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 第一次展示
|
||||
firstIn: true,
|
||||
// 当前显示的项
|
||||
aindexArr: [],
|
||||
// 创建动画的实例
|
||||
animation: null,
|
||||
// 动画对象一
|
||||
animationData: null,
|
||||
// 动画对象二
|
||||
animationDataTwo: null,
|
||||
// 显示项和动画之间的映射关系
|
||||
indexLinkAnimationObj: {},
|
||||
setTimerOne: null,
|
||||
setTimerTwo: null,
|
||||
setTimerThree: null,
|
||||
setTimerFour: null,
|
||||
setTimerFive: null
|
||||
};
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.resetPage()
|
||||
},
|
||||
computed: {
|
||||
// 计算展示项应该展示的动画
|
||||
realAnimation() {
|
||||
return function(value) {
|
||||
if (this.indexLinkAnimationObj[value]) {
|
||||
return this[this.indexLinkAnimationObj[value]]
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 开始 按3000毫秒的运行示例图
|
||||
// 1.a显示 执行动画1 锁定动画1 0ms
|
||||
// 2.b显示 执行动画2 锁定动画2 200ms
|
||||
// 3.a隐藏 停止动画1 释放动画1 300ms
|
||||
// 4.c显示 执行动画1 锁定动画1 400ms
|
||||
// 5.b隐藏 停止动画2 释放动画2 500ms
|
||||
// 6.a显示 执行动画2 锁定动画2 600ms
|
||||
// 7.c隐藏 停止动画1 释放动画1 700ms
|
||||
// 8.b显示 执行动画1 锁定动画1 800ms
|
||||
// 9.a隐藏 停止动画2 释放动画2 900ms
|
||||
// 10.c显示 执行动画2 锁定动画2 1000ms
|
||||
initPage() {
|
||||
this.resetPage();
|
||||
if (this.list && this.list.length) {
|
||||
if (this.list.length > 1) {
|
||||
this.aindexArr.push(0);
|
||||
this.animation = uni.createAnimation({
|
||||
timingFunction: 'linear',
|
||||
})
|
||||
// #ifdef H5
|
||||
this.animationDataH5 = this.animation.translateY(-100).step({
|
||||
duration: 10000
|
||||
}).export()
|
||||
// #endif
|
||||
this.runAnimation(0, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 重置页面动画
|
||||
resetPage() {
|
||||
// 移除所有定时器
|
||||
clearTimeout(this.setTimerOne);
|
||||
clearTimeout(this.setTimerTwo);
|
||||
clearTimeout(this.setTimerThree);
|
||||
clearTimeout(this.setTimerFour);
|
||||
clearTimeout(this.setTimerFive);
|
||||
// 重置页面属性
|
||||
this.aindexArr = [];
|
||||
this.animation = null;
|
||||
this.animationData = null;
|
||||
this.animationDataTwo = null;
|
||||
this.indexLinkAnimationObj = {};
|
||||
},
|
||||
// 执行动画方法(此方法内不要清除赋值的定时器)
|
||||
runAnimation(value, firstIn) {
|
||||
let that = this;
|
||||
if (!firstIn) {
|
||||
that.aindexArr.push(value);
|
||||
}
|
||||
// 获取执行动画对象
|
||||
let lockText = that.createAni(firstIn);
|
||||
// 延迟50毫秒执行(等待dom渲染)
|
||||
that.setTimerOne = setTimeout(() => {
|
||||
// 创建执行动画和执行方之间的映射关系
|
||||
that.indexLinkAnimationObj[value] = lockText;
|
||||
// console.log('已经创建完成绑定关系')
|
||||
// console.log(that.indexLinkAnimationObj)
|
||||
// 获取基础执行时间单位
|
||||
let unitRunTime = (that.runTime - 50) / 6;
|
||||
let waitTime = firstIn ? unitRunTime * 4 : unitRunTime * 5;
|
||||
let waitTimeTwo = firstIn ? (that.runTime - unitRunTime) : that.runTime;
|
||||
// #ifdef H5
|
||||
waitTimeTwo = firstIn ? (that.runTime - (1.5 * unitRunTime)) : that.runTime;
|
||||
//H5重新刷新一下动画绑定关系
|
||||
if (firstIn) {
|
||||
that.aindexArr.splice(0, 1);
|
||||
that.aindexArr.push(0);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 开启下一个动画
|
||||
that.setTimerTwo = setTimeout(() => {
|
||||
let Index = value == that.list.length - 1 ? 0 : value + 1;
|
||||
that.runAnimation(Index)
|
||||
}, waitTime)
|
||||
// 释放上一个执行方
|
||||
that.setTimerThree = setTimeout(() => {
|
||||
let index = that.aindexArr.indexOf(value);
|
||||
that.aindexArr.splice(index, 1)
|
||||
that.firstIn = false;
|
||||
delete that.indexLinkAnimationObj[value]
|
||||
}, waitTimeTwo)
|
||||
}, 50)
|
||||
},
|
||||
// 创建动画方法
|
||||
createAni(firstIn) {
|
||||
let that = this;
|
||||
let unitRunTime = (that.runTime - 50) / 6;
|
||||
|
||||
let delayTime = unitRunTime * 4;
|
||||
let durationTime = unitRunTime;
|
||||
let dispairTime = unitRunTime;
|
||||
// #ifdef H5
|
||||
delayTime = unitRunTime * 3.5;
|
||||
dispairTime = unitRunTime * 1.5;
|
||||
// #endif
|
||||
|
||||
let showTransformHeight = -uni.upx2px(that.height);
|
||||
let hideTransformHeight = showTransformHeight * 2;
|
||||
// 创建动画
|
||||
if (that.showScale) {
|
||||
if (firstIn) {
|
||||
// that.animation.translateY(1).scale(1,1).step({ duration: 5 });
|
||||
that.animation.translateY(showTransformHeight).scale(0.5, 0.5).step({
|
||||
delay: delayTime,
|
||||
duration: dispairTime
|
||||
});
|
||||
} else {
|
||||
that.animation.translateY(showTransformHeight).scale(1, 1).step({
|
||||
duration: durationTime
|
||||
});
|
||||
that.animation.translateY(hideTransformHeight).scale(0.5, 0.5).step({
|
||||
delay: delayTime,
|
||||
duration: dispairTime
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (firstIn) {
|
||||
// that.animation.translateY(1).step({ duration: 5 });
|
||||
that.animation.translateY(showTransformHeight).step({
|
||||
delay: delayTime,
|
||||
duration: dispairTime
|
||||
});
|
||||
} else {
|
||||
that.animation.translateY(showTransformHeight).step({
|
||||
duration: durationTime
|
||||
});
|
||||
that.animation.translateY(hideTransformHeight).step({
|
||||
delay: delayTime,
|
||||
duration: dispairTime
|
||||
});
|
||||
}
|
||||
}
|
||||
// 判断动画赋值项并赋值
|
||||
if (!that.animationData) {
|
||||
that.animationData = that.animation.export()
|
||||
that.setTimerFour = setTimeout(() => {
|
||||
clearTimeout(that.setTimerFour)
|
||||
that.animationData = false;
|
||||
}, that.runTime)
|
||||
return 'animationData'
|
||||
} else {
|
||||
that.animationDataTwo = that.animation.export()
|
||||
that.setTimerFive = setTimeout(() => {
|
||||
clearTimeout(that.setTimerFive)
|
||||
that.animationDataTwo = false;
|
||||
}, that.runTime)
|
||||
return 'animationDataTwo'
|
||||
}
|
||||
},
|
||||
// 抛出点击事件
|
||||
toEmit() {
|
||||
let that = this
|
||||
if (that.list.length == 1) {
|
||||
that.$emit('itemClick', that.list[0])
|
||||
} else {
|
||||
that.$emit('itemClick', that.list[that.aindexArr[0]])
|
||||
}
|
||||
},
|
||||
dangGao(index){
|
||||
let that = this
|
||||
if (that.list.length != 0) {
|
||||
that.$emit('dangGao', index)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// 判断list有值后开启动画
|
||||
// setTimeout()
|
||||
this.initPage()
|
||||
},
|
||||
watch: {
|
||||
list(value) {
|
||||
this.initPage()
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentBox {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
// padding: 0 20rpx;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
.supBox {
|
||||
width: 50rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.offBox {
|
||||
width: 50rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
|
||||
.loopItemBase {
|
||||
left: 0;
|
||||
top: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
align-items: center;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&.fistInClass {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.loopItemBaseShow {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
align-items: center;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<view class="nothing">
|
||||
<view class="nothing-box">
|
||||
<image :src="imgSrc" mode="aspectFill"></image>
|
||||
<view class="nothing-con">{{content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"nothing-page",
|
||||
props:{
|
||||
imgSrc:{
|
||||
type:String,
|
||||
default:'/static/public/nothing.png'
|
||||
},
|
||||
content:{
|
||||
type:String,
|
||||
default:'暂无内容'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.nothing{position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;}
|
||||
.nothing-box{display: flex;justify-content: center;flex-direction: column;align-items: center;}
|
||||
.nothing-box>image{width: 474rpx;height: 273rpx;}
|
||||
.nothing-con{font-size: 24rpx;font-family: PingFang SC;font-weight: 500;line-height: 33rpx;color: #333333;text-align: center;}
|
||||
</style>
|
|
@ -0,0 +1,54 @@
|
|||
<template>
|
||||
<view>
|
||||
<view @tap="lianK" :style="{background:publicColor,right:nright+'rpx',bottom:nbottom+'rpx'}" :class="isSmall?'smallImg':''" class="fw posir" style="position: fixed;z-index: 2; width: 120rpx;height: 120rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.22);">
|
||||
<image class="posia" src="/static/public/btnKF.png" style="width: 50rpx;height: 50rpx;top: 20rpx;" mode=""></image>
|
||||
<view class="colf fon20 posia" style="bottom: 20rpx;">在线客服</view>
|
||||
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"public-customer",
|
||||
props:{
|
||||
nright:{//距离右边多宽
|
||||
type:Number,
|
||||
default:30
|
||||
},
|
||||
nbottom:{//距离底部多高
|
||||
type:Number,
|
||||
default:260
|
||||
},
|
||||
isSmall:{//是否是大图
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
nid:{//内容id
|
||||
type:String,
|
||||
default:'0'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
lianK(){
|
||||
this.$requst.post('user/rand-bind-service').then(res=>{})
|
||||
this.$toolAll.tools.closeTimer()//清空埋点倒计时
|
||||
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
|
||||
let maiOjb = {
|
||||
e:5,//内容咨询
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.smallImg{transform: scale(.8);margin-right: -10rpx;}
|
||||
</style>
|
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<view v-if="isShowT" class="disjcac posAll" @tap="closeXial">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view v-if="isXiala" class="pad-x20">
|
||||
<view class="mar-s30 mar-x40 tc">请选择客服</view>
|
||||
<view @tap.stop="openXia" class="disjbac radius10 pad-zy20 mar-zy20 xialak mar-x50 posir">
|
||||
<view class="col3" v-if="!isTag">{{category[current].title}}</view>
|
||||
<view class="col3 disac width100" v-if="isTag"><input class="width100 mar-y20" disabled v-model="tagStr"></view>
|
||||
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<!-- 下拉列表 -->
|
||||
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
|
||||
<!-- 普通下拉 -->
|
||||
<view class="pad-zy20 xial-item-box" v-if="!isTag">
|
||||
<view @tap.stop="chooseXia(index)":class="current==index?'pcol':''" v-for="(item,index) in category" :key="index">{{item.title}}</view>
|
||||
</view>
|
||||
<!-- 标签下拉 -->
|
||||
<view class="pad-zy20 xial-item-box" v-if="isTag">
|
||||
<!-- <view class="disac" @tap.stop="quanEv" :class="isAll?'pcol':''">
|
||||
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :checked="isAll" />
|
||||
全选
|
||||
</view> -->
|
||||
<view @tap.stop="chooseXiaTag(index)" class="disac" :class="item.checked?'pcol':''" v-for="(item,index) in category" :key="index">
|
||||
<view v-if="" class="disac">
|
||||
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :data-id="item.id" :checked="item.checked" />
|
||||
</view>
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="tc tank-box-itemone">{{contentVal}}</view>
|
||||
<view :class="isCenter?'disjcac':'disjb'" class="fon28 colf pad-x30 pad-zy30 tc">
|
||||
<view @tap="cancleEv" v-if="!isCenter" class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">{{clearVal}}</view>
|
||||
<view @tap="comfirEv" :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn">{{comfrimVal}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"pupo",
|
||||
props:{
|
||||
isShowT:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
isCenter:{//按钮是否居中,或只显示蓝色按钮
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
contentVal:{
|
||||
type:String,
|
||||
default:'是否清除历史搜索?'
|
||||
},
|
||||
clearVal:{//取消文本
|
||||
type:String,
|
||||
default:'取消'
|
||||
},
|
||||
comfrimVal:{//确认文本
|
||||
type:String,
|
||||
default:'确认'
|
||||
},
|
||||
isXiala:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
category:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return ['许嵩']
|
||||
}
|
||||
},
|
||||
isTag:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
isZhuan:false,
|
||||
current:0,
|
||||
tagIds:[],
|
||||
tagVal:[],
|
||||
tagStr:'请选择',
|
||||
isAll:false
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
// 关闭下拉
|
||||
closeXial(){
|
||||
this.isZhuan = false;
|
||||
},
|
||||
comfirEv(){//确认事件
|
||||
this.isZhuan = false
|
||||
this.current = 0
|
||||
this.$emit('comfirmev')
|
||||
},
|
||||
cancleEv(){//取消事件
|
||||
this.isZhuan = false
|
||||
this.current = 0
|
||||
this.$emit('cancleev')
|
||||
},
|
||||
chooseXia(index){
|
||||
this.current = index
|
||||
this.$emit('chooseXiaT',this.category[index])
|
||||
},
|
||||
openXia(){
|
||||
this.isZhuan = !this.isZhuan
|
||||
},
|
||||
// 标签单选
|
||||
chooseXiaTag(index){
|
||||
let isexistence = this.tagIds.indexOf(this.category[index].id);
|
||||
this.category[index].checked = !this.category[index].checked;
|
||||
if(isexistence!=-1){
|
||||
this.tagIds.splice(isexistence,1);
|
||||
this.tagVal.splice(isexistence,1)
|
||||
} else {
|
||||
this.tagIds.push(this.category[index].id)
|
||||
this.tagVal.push(this.category[index].title)
|
||||
}
|
||||
this.tagStr = this.tagVal.join(',')
|
||||
// 单选时,控制全选按钮是否选中
|
||||
if(this.tagIds.length==this.category.length){
|
||||
this.isAll = true;
|
||||
} else this.isAll = false;
|
||||
if(!this.tagIds.length) {
|
||||
this.tagStr = '请选择'
|
||||
}
|
||||
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
|
||||
},
|
||||
// 标签全选
|
||||
quanEv(){
|
||||
this.isAll = !this.isAll;
|
||||
this.tagIds = [];
|
||||
this.tagVal = [];
|
||||
if(this.isAll){
|
||||
this.category.forEach(item=>{
|
||||
item.checked = true;
|
||||
this.tagIds.push(item.id)
|
||||
this.tagVal.push(item.title)
|
||||
})
|
||||
this.tagStr = this.tagVal.join(',')
|
||||
} else {
|
||||
this.category.forEach(item=>{item.checked = false;})
|
||||
this.tagStr = '请选择'
|
||||
}
|
||||
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,142 @@
|
|||
<template>
|
||||
<view class="htz-rate-main">
|
||||
<template v-for="(item,index) in count">
|
||||
<image @tap="checkItem((index+1))" class="htz-rate-image" :key="index"
|
||||
:style="{'width':size+'rpx','height':size+'rpx','padding-right':gutter+'rpx'}"
|
||||
:src="checkedVal<(index+1)?defImgSrc:selImgSrc"></image>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'htz-rate',
|
||||
props: {
|
||||
value: { //受控分值
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
count: { //数量
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
size: { //图标大小
|
||||
type: Number,
|
||||
default: 42,
|
||||
},
|
||||
gutter: { //图标间距
|
||||
type: Number,
|
||||
default: 15,
|
||||
},
|
||||
type: { //内置类型
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
disHref: { //自定义默认图片
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
checkedHref: { //自定义选中图片
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
readonly: { //是否只读
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ImgData: ['/static/img/rate/rate1_0.png', '/static/img/rate/rate2_0.png',
|
||||
'/static/img/rate/rate3_0.png', '/static/img/rate/rate4_0.png', '/static/img/rate/rate5_0.png',
|
||||
'/static/img/rate/rate6_0.png'
|
||||
],
|
||||
defImgSrc: '',
|
||||
selImgSrc: '',
|
||||
checkedVal: 0,
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.$nextTick(function() {
|
||||
this.checkedVal = this.value;
|
||||
if (this.disHref != '') {
|
||||
this.defImgSrc = this.disHref;
|
||||
this.selImgSrc = this.checkedHref;
|
||||
} else {
|
||||
//if (this.type != undefined) {
|
||||
this.defImgSrc = this.ImgData[this.type];
|
||||
this.selImgSrc = this.ImgData[this.type].replace('_0', '_1');
|
||||
//}
|
||||
}
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
value(val, oldVal) {
|
||||
this.checkedVal = this.value;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkItem(index) {
|
||||
if (!this.readonly) {
|
||||
this.checkedVal = index;
|
||||
this.$emit('input', index);
|
||||
this.$emit('change', index);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.htz-rate-main {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.htz-rate-image {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
.htz-image-upload-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.htz-image-upload-Item {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin: 13rpx;
|
||||
border-radius: 10rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.htz-image-upload-Item image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.htz-image-upload-Item-add {
|
||||
font-size: 105rpx;
|
||||
/* line-height: 160rpx; */
|
||||
text-align: center;
|
||||
border: 1px dashed #d9d9d9;
|
||||
color: #d9d9d9;
|
||||
}
|
||||
|
||||
.htz-image-upload-Item-del {
|
||||
background-color: #f5222d;
|
||||
font-size: 24rpx;
|
||||
position: absolute;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
line-height: 35rpx;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,127 @@
|
|||
<template>
|
||||
<view class="pad20 shop_list_box">
|
||||
<view style="width: 48.6%;float: left;">
|
||||
<view v-if="index1%2==0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col3 mar-s20">所有人可买</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isTuan || item1.isPing || item1.isXian" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 48.6%;float: right;">
|
||||
<view v-if="index1%2!=0" v-for="(item1,index1) in dataList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
|
||||
<image :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
|
||||
<view class="pad-zy20 pad-s10 pad-x30">
|
||||
<view class="fon28 bold col3 clips2">{{item1.title}}</view>
|
||||
<view class="disac fon20 mar-sx20" v-if="!item1.isIntegral">
|
||||
<view class="radius10 colf mar-y10" style="padding: 6rpx 10rpx;" :style="{background:publicColor}">{{item1.disease_name}}</view>
|
||||
<view class="radius10 colf" v-if="item1.isTuan" style="padding: 6rpx 10rpx;background: #F85050;">团购</view>
|
||||
<view class="radius10 colf" v-if="item1.isPing" style="padding: 6rpx 10rpx;background: #F85050;">拼团活动</view>
|
||||
<view class="radius10 colf" v-if="item1.isXian" style="padding: 6rpx 10rpx;background: #F85050;">限时促销</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view class="fon28 bold" style="color: #F85050;margin-right: 8rpx;">
|
||||
<view v-if="item1.isIntegral" class="mar-s20">
|
||||
<view>积分:{{item1.integral}}</view>
|
||||
<view class="disac mar-s20" v-if="item1.grade!=0">
|
||||
<image src="/static/public/huiy.png" style="width: 40rpx;height: 33rpx;" mode=""></image>
|
||||
<view class="fon24 col3 mar-z10">{{item1.level_text}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col3 mar-s20">所有人可买</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<span v-if="item1.isPing">拼团价</span>
|
||||
<span v-if="item1.isXian">促销价</span>
|
||||
¥{{item1.zhePrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isTuan || item1.isPing || item1.isXian" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view>
|
||||
</view>
|
||||
<view v-if="item1.isPing" class="disjbac mar-s20">
|
||||
<view class="fon24 col80">已拼团{{item1.activity_group_num}}组</view>
|
||||
<view class="disac">
|
||||
<image v-for="(itemm,indexm) in item1.activity_group_cover" :key="indexm" :src="itemm" mode="" style="width: 40rpx;height: 40rpx;border-radius: 100%;margin-left: -20rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item1.isXian" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"shop-list",
|
||||
props:{
|
||||
dataList:{
|
||||
type:Array,
|
||||
default:function(){
|
||||
return [
|
||||
{
|
||||
imgSrc:'/static/public/wen-one.png',//商品图片
|
||||
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',//标题
|
||||
zhePrice:'3888',//折扣价
|
||||
yuanPrice:'4205',//原价
|
||||
integral:'2888',//积分
|
||||
isTuan:false,//是否团购
|
||||
isPing:false,//是否拼团
|
||||
isXian:false,//是否限时促销
|
||||
isIntegral:false,//是否是积分
|
||||
grade:0,//等级
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
newList:[],
|
||||
timeList:[]//时间列表
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="showShare" @tap="closeShare" style="position: fixed;top: 0;right: 0;left: 0;bottom: 0;background-color: rgba(0,0,0,.5);z-index: 10;">
|
||||
</view>
|
||||
<view v-if="showShare" style="display: flex;flex-direction: column;justify-content: space-around;
|
||||
position: fixed;bottom: 0;left: 0;right: 0;z-index: 100; background-color: #FFFFFF;padding: 40rpx;">
|
||||
<view class="posir" v-for="(item,index) in cateArr" :key="index" style="display: flex;justify-content: center;align-items: center;flex-direction: column;width: 25%;">
|
||||
<image style="width: 100rpx;height: 100rpx;margin-bottom: 10rpx;" :src="item.src" mode=""></image>
|
||||
<view class="fon28 color33">{{item.title}}</view>
|
||||
<button data-name="shareBtn" open-type="share" plain="true" class="posia" style="top: 0;left: 0;right: 0;bottom: 0;opacity: 0;">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:'shareAll',
|
||||
props:{
|
||||
showShare:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cateArr:[
|
||||
{src:'/static/img/share/weix.png',title:'微信好友'},
|
||||
]
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
closeShare(){
|
||||
this.$emit('closeShare')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,166 @@
|
|||
<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 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>
|
||||
<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 || item1.isPing || item1.isTuan" 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 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>
|
||||
<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 || item1.isPing || item1.isTuan" 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 []
|
||||
}
|
||||
},
|
||||
iswhere:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
newList:[],
|
||||
timeList:[],//时间列表
|
||||
timer:''
|
||||
};
|
||||
},
|
||||
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){
|
||||
this.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:{
|
||||
destroyev(){
|
||||
uni.clearInterval(this.timer);
|
||||
this.$emit('destroyEv')
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
let is_activity = 0;
|
||||
let shopId = 0;
|
||||
if(this.dataList[index].isTuan==true || this.dataList[index].isPing==true || this.dataList[index].isXian==true) {
|
||||
is_activity = 1;
|
||||
shopId = this.dataList[index].activity_id;
|
||||
} else {
|
||||
shopId = id;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${shopId}&isIntegral=${this.dataList[index].isIntegral}&is_activity=${is_activity}`
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,143 @@
|
|||
/* eslint-disable */
|
||||
var provinceData = [{
|
||||
"label": "北京市",
|
||||
"value": "11"
|
||||
},
|
||||
{
|
||||
"label": "天津市",
|
||||
"value": "12"
|
||||
},
|
||||
{
|
||||
"label": "河北省",
|
||||
"value": "13"
|
||||
},
|
||||
{
|
||||
"label": "山西省",
|
||||
"value": "14"
|
||||
},
|
||||
{
|
||||
"label": "内蒙古自治区",
|
||||
"value": "15"
|
||||
},
|
||||
{
|
||||
"label": "辽宁省",
|
||||
"value": "21"
|
||||
},
|
||||
{
|
||||
"label": "吉林省",
|
||||
"value": "22"
|
||||
},
|
||||
{
|
||||
"label": "黑龙江省",
|
||||
"value": "23"
|
||||
},
|
||||
{
|
||||
"label": "上海市",
|
||||
"value": "31"
|
||||
},
|
||||
{
|
||||
"label": "江苏省",
|
||||
"value": "32"
|
||||
},
|
||||
{
|
||||
"label": "浙江省",
|
||||
"value": "33"
|
||||
},
|
||||
{
|
||||
"label": "安徽省",
|
||||
"value": "34"
|
||||
},
|
||||
{
|
||||
"label": "福建省",
|
||||
"value": "35"
|
||||
},
|
||||
{
|
||||
"label": "江西省",
|
||||
"value": "36"
|
||||
},
|
||||
{
|
||||
"label": "山东省",
|
||||
"value": "37"
|
||||
},
|
||||
{
|
||||
"label": "河南省",
|
||||
"value": "41"
|
||||
},
|
||||
{
|
||||
"label": "湖北省",
|
||||
"value": "42"
|
||||
},
|
||||
{
|
||||
"label": "湖南省",
|
||||
"value": "43"
|
||||
},
|
||||
{
|
||||
"label": "广东省",
|
||||
"value": "44"
|
||||
},
|
||||
{
|
||||
"label": "广西壮族自治区",
|
||||
"value": "45"
|
||||
},
|
||||
{
|
||||
"label": "海南省",
|
||||
"value": "46"
|
||||
},
|
||||
{
|
||||
"label": "重庆市",
|
||||
"value": "50"
|
||||
},
|
||||
{
|
||||
"label": "四川省",
|
||||
"value": "51"
|
||||
},
|
||||
{
|
||||
"label": "贵州省",
|
||||
"value": "52"
|
||||
},
|
||||
{
|
||||
"label": "云南省",
|
||||
"value": "53"
|
||||
},
|
||||
{
|
||||
"label": "西藏自治区",
|
||||
"value": "54"
|
||||
},
|
||||
{
|
||||
"label": "陕西省",
|
||||
"value": "61"
|
||||
},
|
||||
{
|
||||
"label": "甘肃省",
|
||||
"value": "62"
|
||||
},
|
||||
{
|
||||
"label": "青海省",
|
||||
"value": "63"
|
||||
},
|
||||
{
|
||||
"label": "宁夏回族自治区",
|
||||
"value": "64"
|
||||
},
|
||||
{
|
||||
"label": "新疆维吾尔自治区",
|
||||
"value": "65"
|
||||
},
|
||||
{
|
||||
"label": "台湾",
|
||||
"value": "66"
|
||||
},
|
||||
{
|
||||
"label": "香港",
|
||||
"value": "67"
|
||||
},
|
||||
{
|
||||
"label": "澳门",
|
||||
"value": "68"
|
||||
},
|
||||
{
|
||||
"label": "钓鱼岛",
|
||||
"value": "69"
|
||||
}
|
||||
]
|
||||
export default provinceData;
|
|
@ -0,0 +1,420 @@
|
|||
<template>
|
||||
<view class="simple-address" v-if="showPopup" @touchmove.stop.prevent="clear">
|
||||
<!-- 遮罩层 -->
|
||||
<view
|
||||
class="simple-address-mask"
|
||||
@touchmove.stop.prevent="clear"
|
||||
v-if="maskClick"
|
||||
:class="[ani + '-mask', animation ? 'mask-ani' : '']"
|
||||
:style="{
|
||||
'background-color': maskBgColor
|
||||
}"
|
||||
@tap="hideMask(true)"
|
||||
></view>
|
||||
|
||||
<view class="simple-address-content simple-address--fixed" :class="[type, ani + '-content', animation ? 'content-ani' : '']">
|
||||
<view class="simple-address__header">
|
||||
<view class="simple-address__header-btn-box" @click="pickerCancel">
|
||||
<text class="simple-address__header-text" :style="{ color: cancelColor, fontSize: btnFontSize }">取消</text>
|
||||
</view>
|
||||
<view class="simple-address__header-btn-box" @click="pickerConfirm">
|
||||
<text class="simple-address__header-text" :style="{ color: confirmColor || themeColor, fontSize: btnFontSize }">确定</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="simple-address__box">
|
||||
<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
|
||||
<picker-view-column>
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</text>
|
||||
<!-- #endif -->
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</text>
|
||||
<!-- #endif -->
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</text>
|
||||
<!-- #endif -->
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* Simple-addres 地址联动组件
|
||||
* @description 三级地址联动,支持(app)nvue、小程序、H5
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=1084
|
||||
* @property {String} animation 是否开启动画
|
||||
* @property {String} type = [bottom] 弹出层类型,暂时只支持底部弹出
|
||||
* @property {Boolean} maskClick = [true | false] 是否允许点击遮罩层关闭
|
||||
* @property {Boolean} show = [true | false] 显示或隐藏地址组件
|
||||
* @property {String} maskBgColor 遮罩层背景颜色
|
||||
* @property {String} cancelColor 取消按钮颜色,默认为:#1aad19
|
||||
* @property {String} confirmColor 确认按钮颜色,默认为:themeColor
|
||||
* @property {String} themeColor 主题颜色,后续会废弃该配置,建议使用`cancelColor`或`confirmColor`
|
||||
* @property {String} btnFontSize 取消、确认按钮字体大小,默认为`uni.scss里的 $uni-font-size-base `
|
||||
* @property {String} fontSize picker-item字体大小,默认为:28rpx
|
||||
* @property {Array} pickerValueDefault 默认值,可以通过function queryIndex 获取
|
||||
* @property {Function} queryIndex 根据自定义信息返回对应的index
|
||||
* @property {Function} open 打开
|
||||
* @example <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor='#007AFF'></simple-address>
|
||||
*/
|
||||
|
||||
import provinceData from './city-data/province.js';
|
||||
import cityData from './city-data/city.js';
|
||||
import areaData from './city-data/area.js';
|
||||
export default {
|
||||
name: 'simpleAddress',
|
||||
props: {
|
||||
mode: {
|
||||
// 地址类型
|
||||
// default 则代表老版本根据index索引获取数据
|
||||
//
|
||||
type: String,
|
||||
default: 'default'
|
||||
},
|
||||
// 开启动画
|
||||
animation: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
/* 弹出层类型,可选值;
|
||||
bottom:底部弹出层
|
||||
*/
|
||||
type: {
|
||||
type: String,
|
||||
default: 'bottom'
|
||||
},
|
||||
// maskClick
|
||||
maskClick: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
maskBgColor: {
|
||||
type: String,
|
||||
default: 'rgba(0, 0, 0, 0.4)' //背景颜色 rgba(0, 0, 0, 0.4) 为空则调用 uni.scss
|
||||
},
|
||||
themeColor: {
|
||||
type: String,
|
||||
default: '' // 确认按钮颜色(向下兼容)
|
||||
},
|
||||
cancelColor: {
|
||||
type: String,
|
||||
default: '' // 取消按钮颜色
|
||||
},
|
||||
confirmColor: {
|
||||
type: String,
|
||||
default: '' // 确认按钮颜色
|
||||
},
|
||||
fontSize: {
|
||||
type: String,
|
||||
default: '28rpx' // picker-item字体大小
|
||||
},
|
||||
btnFontSize: {
|
||||
type: String,
|
||||
default: '' // 按钮的字体大小
|
||||
},
|
||||
/* 默认值 */
|
||||
pickerValueDefault: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [0, 0, 0];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ani: '',
|
||||
showPopup: false,
|
||||
pickerValue: [0, 0, 0],
|
||||
provinceDataList: [],
|
||||
cityDataList: [],
|
||||
areaDataList: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show(newValue) {
|
||||
if (newValue) {
|
||||
this.open();
|
||||
} else {
|
||||
this.close();
|
||||
}
|
||||
},
|
||||
pickerValueDefault() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.handPickValueDefault(); // 对 pickerValueDefault 做兼容处理
|
||||
this.provinceDataList = provinceData;
|
||||
this.cityDataList = cityData[this.pickerValueDefault[0]];
|
||||
this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
|
||||
this.pickerValue = this.pickerValueDefault;
|
||||
},
|
||||
handPickValueDefault() {
|
||||
if (this.pickerValueDefault !== [0, 0, 0]) {
|
||||
if (this.pickerValueDefault[0] > provinceData.length - 1) {
|
||||
this.pickerValueDefault[0] = provinceData.length - 1;
|
||||
}
|
||||
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
|
||||
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
|
||||
}
|
||||
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
|
||||
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
pickerChange(e) {
|
||||
let changePickerValue = e.detail.value;
|
||||
if (this.pickerValue[0] !== changePickerValue[0]) {
|
||||
// 第一级发生滚动
|
||||
this.cityDataList = cityData[changePickerValue[0]];
|
||||
this.areaDataList = areaData[changePickerValue[0]][0];
|
||||
changePickerValue[1] = 0;
|
||||
changePickerValue[2] = 0;
|
||||
} else if (this.pickerValue[1] !== changePickerValue[1]) {
|
||||
// 第二级滚动
|
||||
this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]];
|
||||
changePickerValue[2] = 0;
|
||||
}
|
||||
this.pickerValue = changePickerValue;
|
||||
this._$emit('onChange');
|
||||
},
|
||||
_$emit(emitName) {
|
||||
let pickObj = {
|
||||
label: this._getLabel(),
|
||||
value: this.pickerValue,
|
||||
cityCode: this._getCityCode(),
|
||||
areaCode: this._getAreaCode(),
|
||||
provinceCode: this._getProvinceCode(),
|
||||
labelArr: this._getLabel().split('-')
|
||||
};
|
||||
this.$emit(emitName, pickObj);
|
||||
},
|
||||
_getLabel() {
|
||||
let pcikerLabel =
|
||||
this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label;
|
||||
return pcikerLabel;
|
||||
},
|
||||
_getCityCode() {
|
||||
return this.cityDataList[this.pickerValue[1]].value;
|
||||
},
|
||||
_getProvinceCode() {
|
||||
return this.provinceDataList[this.pickerValue[0]].value;
|
||||
},
|
||||
_getAreaCode() {
|
||||
return this.areaDataList[this.pickerValue[2]].value;
|
||||
},
|
||||
queryIndex(params = [], type = 'value') {
|
||||
// params = [ 11 ,1101,110101 ];
|
||||
// 1.获取省份的index
|
||||
let provinceIndex = provinceData.findIndex(res => res[type] == params[0]);
|
||||
let cityIndex = cityData[provinceIndex].findIndex(res => res[type] == params[1]);
|
||||
let areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] == params[2]);
|
||||
return {
|
||||
index: [provinceIndex, cityIndex, areaIndex],
|
||||
data: {
|
||||
province: provinceData[provinceIndex],
|
||||
city: cityData[provinceIndex][cityIndex],
|
||||
area: areaData[provinceIndex][cityIndex][areaIndex]
|
||||
}
|
||||
};
|
||||
},
|
||||
clear() {},
|
||||
hideMask() {
|
||||
this._$emit('onCancel');
|
||||
this.close();
|
||||
},
|
||||
pickerCancel() {
|
||||
this._$emit('onCancel');
|
||||
this.close();
|
||||
},
|
||||
pickerConfirm() {
|
||||
this._$emit('onConfirm');
|
||||
this.close();
|
||||
},
|
||||
open() {
|
||||
this.showPopup = true;
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.ani = 'simple-' + this.type;
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
close(type) {
|
||||
if (!this.maskClick && type) return;
|
||||
this.ani = '';
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.showPopup = false;
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.simple-address {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.simple-address-mask {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
transition-property: opacity;
|
||||
transition-duration: 0.3s;
|
||||
opacity: 0;
|
||||
/* #ifndef APP-NVUE */
|
||||
z-index: 99;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.mask-ani {
|
||||
transition-property: opacity;
|
||||
transition-duration: 0.2s;
|
||||
}
|
||||
|
||||
.simple-bottom-mask {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.simple-center-mask {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.simple-address--fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
transition-property: transform;
|
||||
transition-duration: 0.3s;
|
||||
transform: translateY(460rpx);
|
||||
/* #ifndef APP-NVUE */
|
||||
z-index: 99;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.simple-address-content {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.simple-content-bottom {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
transform: translateY(500rpx);
|
||||
}
|
||||
|
||||
.content-ani {
|
||||
transition-property: transform, opacity;
|
||||
transition-duration: 0.2s;
|
||||
}
|
||||
|
||||
.simple-bottom-content {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.simple-center-content {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.simple-address__header {
|
||||
position: relative;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
border-bottom-color: #f2f2f2;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1rpx;
|
||||
}
|
||||
|
||||
.simple-address--fixed-top {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
border-top-color: $uni-border-color;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1rpx;
|
||||
}
|
||||
|
||||
.simple-address__header-btn-box {
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 70rpx;
|
||||
}
|
||||
|
||||
.simple-address__header-text {
|
||||
text-align: center;
|
||||
font-size: $uni-font-size-base;
|
||||
color: #1aad19;
|
||||
line-height: 70rpx;
|
||||
padding-left: 40rpx;
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
|
||||
.simple-address__box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.simple-address-view {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
/* #ifndef APP-NVUE */
|
||||
width: 100%;
|
||||
/* #endif */
|
||||
/* #ifdef APP-NVUE */
|
||||
width: 750rpx;
|
||||
/* #endif */
|
||||
height: 408rpx;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.picker-item {
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,97 @@
|
|||
<template>
|
||||
<view class="status-box statusHNH">
|
||||
<!-- 网络、电量栏 start -->
|
||||
<view :style="{height:statusBarHeight+'px',background:backgroudColor}"></view>
|
||||
<!-- 网络、电量栏 end -->
|
||||
<!-- 头部状态栏 start -->
|
||||
<view class="status-nav" :style="{background:backgroudColor}">
|
||||
<!-- 返回键 -->
|
||||
<view @tap="backEvent" v-if="statusBack" style="height: 33rpx;width: 80rpx;flex-shrink: 0;position: absolute;">
|
||||
<image v-if="backColor==0" class="tab-back" src="/static/public/backBlackm.png"></image>
|
||||
<image v-if="backColor==1" class="tab-back" src="/static/public/videoBack.png"></image>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<!-- <view v-if="statusTitle" :class="statusBack ? 'tcenter' : 'tleft'" class="tab-title" :style="{color:tabcolor}">{{titleVal}}</view> -->
|
||||
<view v-if="statusTitle" class="tab-title tcenter" :style="{color:tabcolor}">{{titleVal}}</view>
|
||||
<view v-else class="tab-title tcenter" :style="{color:tabcolor}"> </view>
|
||||
</view>
|
||||
<!-- 头部状态栏 end -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:'status-nav',
|
||||
props:{
|
||||
statusTitle:{//是否显示标题
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
statusBack:{//是否显示返回键
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
backgroudColor:{//标题栏背景颜色
|
||||
type:String,
|
||||
default:'#FFFFFF'
|
||||
},
|
||||
tabcolor:{//标题颜色
|
||||
type:String,
|
||||
default:'#333333'
|
||||
},
|
||||
titleVal:{//标题内容
|
||||
type:String,
|
||||
default:'恒美植发'
|
||||
},
|
||||
whereCome:{//来自哪个页面
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
backColor:{//返回键颜色
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery().in(this)
|
||||
query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect.height);
|
||||
uni.setStorageSync('statusHNH',rect.height)
|
||||
}).exec()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,//获取手机状态栏高度
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
backEvent(){//返回事件
|
||||
if(this.whereCome==0 && uni.getStorageSync('firstTime')==''){
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
} else if(this.whereCome==1){
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
} else if(this.whereCome==2){
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/my/my'
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.status-box{position: fixed;top: 0;left: 0;right: 0;z-index: 10;}
|
||||
.status-nav{width: 100%;position: relative;padding: 30rpx 0;display: flex;align-items: center;}
|
||||
.tab-back{width: 33rpx;height: 33rpx;flex-shrink: 0;position: absolute;left: 20rpx;}
|
||||
.tab-title{font-size: 36rpx;font-weight: bold;color: #333333;width: 100%;}
|
||||
.tcenter{text-align: center;}
|
||||
.tleft{margin-left: 40rpx;}
|
||||
</style>
|
|
@ -0,0 +1,121 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="isDot" class="banner-box">
|
||||
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :autoplay="isplay" :circular="true" :interval="3000" :duration="500">
|
||||
<swiper-item v-for="(item,index) in bannerList" :key="index">
|
||||
<view @tap="chooseImg(index)" class="posir">
|
||||
<image :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
<image @tap.stop="playVideo(index)" v-if="item.isVideo && isVedio" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);width: 126rpx;height: 126rpx;z-index: 1;" src="/static/public/video.png" mode=""></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<!-- 指示点 -->
|
||||
<view class="dot-box" :style="{bottom:newBottom+'px'}">
|
||||
<view :class="bcurrent==indexd ? 'dotActive' : 'dotMo'" v-for="(itemd,indexd) in bannerList.length" :key="indexd"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"swiper-pu",
|
||||
props:{
|
||||
isplay:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
isDot:{//是否显示指示点
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
bannerList:{//默认轮播图片
|
||||
type:Array,
|
||||
default:function(){
|
||||
return [
|
||||
{imgSrc:'/static/public/banner.png',url:'',isVideo:false,poster:''},
|
||||
{imgSrc:'/static/public/banner.png',url:'',isVideo:false,poster:''},
|
||||
]
|
||||
}
|
||||
},
|
||||
newHeight:{//swiper的高
|
||||
type:String,
|
||||
default:'200'
|
||||
},
|
||||
newBottom:{//指示点距离底部位置
|
||||
type:String,
|
||||
default:'18'
|
||||
},
|
||||
newRadius:{//图片圆角
|
||||
type:String,
|
||||
default:'0'
|
||||
},
|
||||
browseP:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bcurrent:0,
|
||||
isShowVideo:false,
|
||||
autoplay:false,
|
||||
isVedio:uni.getStorageSync('isVedio')
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
chooseImg(index){
|
||||
// console.log('当前banner图',index);
|
||||
this.bcurrent = index
|
||||
if(this.browseP){
|
||||
let imgList = []
|
||||
this.bannerList.forEach(item=>{
|
||||
let nurl = ''
|
||||
let obj = {}
|
||||
if(this.isVedio) {
|
||||
item.url=='' ? nurl = item.imgSrc : nurl = item.url
|
||||
obj = {
|
||||
url:nurl,
|
||||
type:item.isVideo?'video':'image',
|
||||
poster:item.poster
|
||||
}
|
||||
} else {
|
||||
nurl = item.imgSrc
|
||||
obj = {
|
||||
url:nurl,
|
||||
type:'image',
|
||||
poster:item.poster
|
||||
}
|
||||
}
|
||||
imgList.push(obj)
|
||||
})
|
||||
uni.previewMedia({
|
||||
current:this.bcurrent,
|
||||
sources:imgList
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:this.bannerList[index].url
|
||||
})
|
||||
}
|
||||
},
|
||||
changeBanner(e){
|
||||
this.bcurrent = e.detail.current//当前的指示点下标
|
||||
},
|
||||
playVideo(index){
|
||||
// console.log('播放视频');
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/video/playVideo?src=${this.bannerList[index].url}&posterSrc=${this.bannerList[index].poster}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.banner-box{position: relative;}
|
||||
.img{width:100%;}
|
||||
.dot-box{position: absolute;bottom: 36rpx;display: flex;justify-content: center;width: 100%;}
|
||||
.dotActive{width: 22rpx;height: 12rpx;margin-right: 10rpx;border-radius: 20rpx; background-color: rgba(56, 117, 246, .5);}
|
||||
.dotMo{width: 12rpx;height: 12rpx;margin-right: 10rpx;border-radius: 100%;background-color: rgba(191, 191, 191, 0.5);}
|
||||
</style>
|
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<view>
|
||||
<view v-if="list.length==0" class="" style="display: flex;flex-direction: column;align-items: center;">
|
||||
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
|
||||
<view class="fon24 col3" style="margin-bottom: 60rpx;">暂无内容</view>
|
||||
</view>
|
||||
<view class="list-container">
|
||||
<view id="wf-list" class="list" v-for="(list,listIndex) of viewList" :key="listIndex">
|
||||
<view @tap="goDetail(listIndex,index)" class="item" style="position: relative;" v-for="(item,index) of list.list" :key="index">
|
||||
<image style="border-radius: 30rpx;min-height: 260rpx;" @load="handleViewRender(listIndex,index)" @error="handleViewRender(listIndex,index)" :src="item.main_img" mode="widthFix"></image>
|
||||
<view style="position: absolute;top: 18rpx;right: 18rpx;z-index: 3;" @tap.stop="chooseLike(listIndex,index)">
|
||||
<!-- <image src="/static/public/like.png" style="width: 69rpx;height: 69rpx;border-radius: 100%;" mode=""></image> -->
|
||||
<!-- 不喜欢 -->
|
||||
<image v-if="item.is_collected!=1" style="width: 69rpx;height: 69rpx;border-radius: 100%;" src="/static/public/no-like.png"></image>
|
||||
<!-- 喜欢 -->
|
||||
<image v-if="item.is_collected==1" :class="item.is_collected==1?'bounceIn':'bounceOut'" style="width: 69rpx;height: 69rpx;border-radius: 100%;" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view style="position: absolute;z-index: 1;bottom: 8rpx;color: #FFFFFF;background: -webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));width: 100%;padding-top: 100rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;">
|
||||
<view style="margin: 20rpx;font-size: 22rpx;line-height: 40rpx;">
|
||||
<view style="display: flex;align-items: center;font-size: 30rpx;">
|
||||
<view class="clips1 mar-y10">{{item.title}}</view>
|
||||
<text v-if="item.isVideo" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs fon30">视频</text>
|
||||
</view>
|
||||
<view class="clips1" style="opacity: .7;">{{item.content}}</view>
|
||||
<view style="display: flex;align-items: center;">
|
||||
<image :src="item.head_img" style="width: 28rpx;height: 28rpx;border-radius: 100%;" mode=""></image>
|
||||
<view class="mar-z10" style="opacity: .7;">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image v-if="item.isVideo" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);z-index: 3;" src="/static/public/video.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
list:{
|
||||
type:Array, //实际请求获取的列表数据
|
||||
},
|
||||
nWidth:{
|
||||
type:String,
|
||||
default:'120'
|
||||
},
|
||||
nHeight:{
|
||||
type:String,
|
||||
default:'120'
|
||||
},
|
||||
nFon:{
|
||||
type:String,
|
||||
default:'15'
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewList:[{list:[]},{list:[]}], //展示到视图的列表数据
|
||||
everyNum:2,
|
||||
jieDuan:false,
|
||||
pu_content:'是否需要取消收藏?',
|
||||
isShowT:false,
|
||||
current:{}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
list(oldVal,newVal){
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
comfirmev(){
|
||||
// console.log('取消收藏成功');
|
||||
this.$emit('comfirmev',this.current)
|
||||
this.isShowT = false
|
||||
},
|
||||
cancleev(){
|
||||
// console.log('关闭弹框');
|
||||
this.isShowT = false
|
||||
},
|
||||
chooseLike(index,indext){//喜欢不喜欢事件
|
||||
// console.log('喜欢不喜欢:',index);
|
||||
if(this.jieDuan==false){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
this.$emit('chooseLike',this.viewList[index].list[indext].id)
|
||||
this.current = this.viewList[index].list[indext].id
|
||||
if(this.viewList[index].list[indext].is_collected==1) {
|
||||
this.isShowT = true
|
||||
} else {
|
||||
let maiOjb = {
|
||||
e:3,//内容收藏
|
||||
c:this.viewList[index].list[indext].id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
goDetail(index,indext){//查看详情
|
||||
if(this.jieDuan==false){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
uni.navigateTo({
|
||||
// url:'/pagesB/problemDetail/problemDetail?isCate='+this.list[index].isCate
|
||||
url:'/pagesB/problemDetail/problemDetail?id='+this.viewList[index].list[indext].id+'&category_id='+this.viewList[index].list[indext].category_id
|
||||
})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
init(){
|
||||
this.viewList = [{list:[]},{list:[]}];
|
||||
setTimeout(()=>{
|
||||
this.handleViewRender(0,0)
|
||||
},0)
|
||||
},
|
||||
handleViewRender(x,y){
|
||||
const index = this.viewList.reduce((total,current)=>total + current.list.length,0)
|
||||
if(index>this.list.length-1) {
|
||||
// 加载完成触发事件并返回加载过的图片数
|
||||
return
|
||||
};
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
let listFlag = 0;
|
||||
query.selectAll('#wf-list').boundingClientRect(data => {
|
||||
listFlag = data[0].bottom - data[1].bottom<=0?0:1;
|
||||
this.viewList[listFlag].list.push(this.list[index])
|
||||
}).exec()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if(this.list.length){
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.list-container
|
||||
display flex
|
||||
justify-content space-between
|
||||
align-items:flex-start
|
||||
padding-top 20rpx
|
||||
.list
|
||||
width calc(48%)
|
||||
display flex
|
||||
flex-direction column
|
||||
.item
|
||||
margin-bottom 30rpx
|
||||
image
|
||||
width 100%
|
||||
.desc
|
||||
padding 20rpx
|
||||
font-size 22rpx
|
||||
</style>
|
|
@ -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()
|
||||
}, 0)
|
||||
},
|
||||
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>
|
|
@ -0,0 +1,201 @@
|
|||
function getLocalFilePath(path) {
|
||||
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf(
|
||||
'_downloads') === 0) {
|
||||
return path
|
||||
}
|
||||
if (path.indexOf('file://') === 0) {
|
||||
return path
|
||||
}
|
||||
if (path.indexOf('/storage/emulated/0/') === 0) {
|
||||
return path
|
||||
}
|
||||
if (path.indexOf('/') === 0) {
|
||||
var localFilePath = plus.io.convertAbsoluteFileSystem(path)
|
||||
if (localFilePath !== path) {
|
||||
return localFilePath
|
||||
} else {
|
||||
path = path.substr(1)
|
||||
}
|
||||
}
|
||||
return '_www/' + path
|
||||
}
|
||||
|
||||
function dataUrlToBase64(str) {
|
||||
var array = str.split(',')
|
||||
return array[array.length - 1]
|
||||
}
|
||||
|
||||
var index = 0
|
||||
|
||||
function getNewFileId() {
|
||||
return Date.now() + String(index++)
|
||||
}
|
||||
|
||||
function biggerThan(v1, v2) {
|
||||
var v1Array = v1.split('.')
|
||||
var v2Array = v2.split('.')
|
||||
var update = false
|
||||
for (var index = 0; index < v2Array.length; index++) {
|
||||
var diff = v1Array[index] - v2Array[index]
|
||||
if (diff !== 0) {
|
||||
update = diff > 0
|
||||
break
|
||||
}
|
||||
}
|
||||
return update
|
||||
}
|
||||
|
||||
export function pathToBase64(path) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (typeof window === 'object' && 'document' in window) {
|
||||
if (typeof FileReader === 'function') {
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', path, true)
|
||||
xhr.responseType = 'blob'
|
||||
xhr.onload = function() {
|
||||
if (this.status === 200) {
|
||||
let fileReader = new FileReader()
|
||||
fileReader.onload = function(e) {
|
||||
resolve(e.target.result)
|
||||
}
|
||||
fileReader.onerror = reject
|
||||
fileReader.readAsDataURL(this.response)
|
||||
}
|
||||
}
|
||||
xhr.onerror = reject
|
||||
xhr.send()
|
||||
return
|
||||
}
|
||||
var canvas = document.createElement('canvas')
|
||||
var c2x = canvas.getContext('2d')
|
||||
var img = new Image
|
||||
img.onload = function() {
|
||||
canvas.width = img.width
|
||||
canvas.height = img.height
|
||||
c2x.drawImage(img, 0, 0)
|
||||
resolve(canvas.toDataURL())
|
||||
canvas.height = canvas.width = 0
|
||||
}
|
||||
img.onerror = reject
|
||||
img.src = path
|
||||
return
|
||||
}
|
||||
if (typeof plus === 'object') {
|
||||
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
|
||||
entry.file(function(file) {
|
||||
var fileReader = new plus.io.FileReader()
|
||||
fileReader.onload = function(data) {
|
||||
resolve(data.target.result)
|
||||
}
|
||||
fileReader.onerror = function(error) {
|
||||
reject(error)
|
||||
}
|
||||
fileReader.readAsDataURL(file)
|
||||
}, function(error) {
|
||||
reject(error)
|
||||
})
|
||||
}, function(error) {
|
||||
reject(error)
|
||||
})
|
||||
return
|
||||
}
|
||||
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
||||
wx.getFileSystemManager().readFile({
|
||||
filePath: path,
|
||||
encoding: 'base64',
|
||||
success: function(res) {
|
||||
resolve('data:image/png;base64,' + res.data)
|
||||
},
|
||||
fail: function(error) {
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
reject(new Error('not support'))
|
||||
})
|
||||
}
|
||||
|
||||
export function base64ToPath(base64) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (typeof window === 'object' && 'document' in window) {
|
||||
base64 = base64.split(',')
|
||||
var type = base64[0].match(/:(.*?);/)[1]
|
||||
var str = atob(base64[1])
|
||||
var n = str.length
|
||||
var array = new Uint8Array(n)
|
||||
while (n--) {
|
||||
array[n] = str.charCodeAt(n)
|
||||
}
|
||||
return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
|
||||
type: type
|
||||
})))
|
||||
}
|
||||
var extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/)
|
||||
if (extName) {
|
||||
extName = extName[1]
|
||||
} else {
|
||||
reject(new Error('base64 error'))
|
||||
}
|
||||
var fileName = getNewFileId() + '.' + extName
|
||||
if (typeof plus === 'object') {
|
||||
var basePath = '_doc'
|
||||
var dirPath = 'uniapp_temp'
|
||||
var filePath = basePath + '/' + dirPath + '/' + fileName
|
||||
if (!biggerThan(plus.os.name === 'Android' ? '1.9.9.80627' : '1.9.9.80472', plus.runtime
|
||||
.innerVersion)) {
|
||||
plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
|
||||
entry.getDirectory(dirPath, {
|
||||
create: true,
|
||||
exclusive: false,
|
||||
}, function(entry) {
|
||||
entry.getFile(fileName, {
|
||||
create: true,
|
||||
exclusive: false,
|
||||
}, function(entry) {
|
||||
entry.createWriter(function(writer) {
|
||||
writer.onwrite = function() {
|
||||
resolve(filePath)
|
||||
}
|
||||
writer.onerror = reject
|
||||
writer.seek(0)
|
||||
writer.writeAsBinary(dataUrlToBase64(base64))
|
||||
}, reject)
|
||||
}, reject)
|
||||
}, reject)
|
||||
}, reject)
|
||||
return
|
||||
}
|
||||
var bitmap = new plus.nativeObj.Bitmap(fileName)
|
||||
bitmap.loadBase64Data(base64, function() {
|
||||
bitmap.save(filePath, {}, function() {
|
||||
bitmap.clear()
|
||||
resolve(filePath)
|
||||
}, function(error) {
|
||||
bitmap.clear()
|
||||
reject(error)
|
||||
})
|
||||
}, function(error) {
|
||||
bitmap.clear()
|
||||
reject(error)
|
||||
})
|
||||
return
|
||||
}
|
||||
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
||||
var filePath = wx.env.USER_DATA_PATH + '/' + fileName
|
||||
wx.getFileSystemManager().writeFile({
|
||||
filePath: filePath,
|
||||
data: dataUrlToBase64(base64),
|
||||
encoding: 'base64',
|
||||
success: function() {
|
||||
resolve(filePath)
|
||||
},
|
||||
fail: function(error) {
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
reject(new Error('not support'))
|
||||
})
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
const ENV = process.env.NODE_ENV;
|
||||
console.log('当前环境', process.env.NODE_ENV)
|
||||
|
||||
const apiHub = {
|
||||
//开发环境
|
||||
development: {
|
||||
BASE_URL: `${getApp().globalData.domainName}`,
|
||||
IMG_URL: "https://xx",
|
||||
BASE_UPLOAD_URL: "",
|
||||
},
|
||||
|
||||
//测试环境
|
||||
test: {
|
||||
BASE_URL: "https://xxx",
|
||||
IMG_URL: "https://xxx",
|
||||
BASE_UPLOAD_URL: "",
|
||||
},
|
||||
|
||||
//生产环境
|
||||
production: {
|
||||
BASE_URL: "https://xx",
|
||||
IMG_URL: "https://xx",
|
||||
BASE_UPLOAD_URL: "",
|
||||
}
|
||||
}
|
||||
|
||||
// 导出配置
|
||||
export default {
|
||||
ENV: ENV,
|
||||
...apiHub[ENV]
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
import requst from './requst.js';
|
||||
import toolAll from './tools.js';
|
||||
|
||||
export function collectionEV(data){//收藏事件
|
||||
return requst.post('archives/record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = '点赞成功'
|
||||
let num = 2
|
||||
if(data.action=='collect'){
|
||||
num = 3
|
||||
newMsg = '收藏成功'
|
||||
}
|
||||
let maiOjb = {
|
||||
e:num,//内容收藏
|
||||
c:data.archive_id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
toolAll.tools.maiDian(maiOjb)
|
||||
toolAll.tools.showToast(newMsg,'none',1500)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
export function cancleCollectionEV(data){//取消收藏事件
|
||||
return requst.post('archives/un-record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = '已取消点赞'
|
||||
if(data.action=='collect'){
|
||||
newMsg = '已取消收藏'
|
||||
}
|
||||
toolAll.tools.showToast(newMsg,'none',1500)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
// 商品收藏、积分收藏
|
||||
export function collectionShopEV(data){//收藏事件
|
||||
console.log(data);
|
||||
return requst.post('spu/record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = ''
|
||||
let num = 0
|
||||
if(data.action=='collect'){
|
||||
num = 3
|
||||
newMsg = '收藏成功'
|
||||
}
|
||||
let maiOjb = {
|
||||
e:num,//内容收藏
|
||||
c:data.id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
toolAll.tools.maiDian(maiOjb)
|
||||
toolAll.tools.showToast(newMsg,'none',1500)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
export function cancleCollectionShopEV(data){//取消收藏事件
|
||||
return requst.post('spu/un-record',data).then(res=>{
|
||||
if(res.code==0) {
|
||||
let newMsg = ''
|
||||
if(data.action=='collect'){
|
||||
newMsg = '已取消收藏'
|
||||
}
|
||||
toolAll.tools.showToast(newMsg,'none',1500)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
export function buriedPoint(){//查询埋点类型事件
|
||||
return requst.post('statistics/event').then(res=>{
|
||||
// console.log('查询所有需要埋点的类型:',res);
|
||||
if(res.code==0) uni.setStorageSync('buriedPoint',res.data)
|
||||
},error=>{})
|
||||
}
|
||||
export function reportBuriedPoint(data){//上报埋点事件
|
||||
// console.log('埋点的数据:',data);
|
||||
return requst.post('statistics/report',data).then(res=>{},error=>{})
|
||||
}
|
||||
// export function zhuColor(){//查询主题色
|
||||
// return requst.post('index/mini-program-setting').then(res=>{
|
||||
// if(res.code==0){
|
||||
// uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
|
||||
// // uni.setStorageSync('publicColor', '#2E8B57') //#3875F6 #2E8B57
|
||||
// }
|
||||
// },error=>{})
|
||||
// }
|
||||
export function checkSwip(){//查询主题色
|
||||
return requst.post('common/slide-positions').then(res=>{
|
||||
if(res.code==0){
|
||||
console.log(res);
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
export function checkBanner(data){//查询主题色
|
||||
return requst.post('common/slides',data)
|
||||
}
|
||||
export function 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);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
// 统一给参数
|
||||
const dataObj = (url, params) => {
|
||||
let options = params
|
||||
// #ifdef APP-PLUS
|
||||
// DOTO:暂时没处理过,只是放在这里
|
||||
let data = null; //业务数据
|
||||
let terminal = 1 //终端类型,web:0,app:1
|
||||
options = {
|
||||
...params,
|
||||
data,
|
||||
sign,
|
||||
terminal
|
||||
}
|
||||
// #endif
|
||||
return options
|
||||
}
|
||||
const goLogin = () => {
|
||||
// uni.clearStorageSync();
|
||||
console.log('token失效');
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/login/Login'
|
||||
// }) //未授权,请重新登录(401)
|
||||
}
|
||||
// 请求错误处理
|
||||
const checkError = (e, reject) => {
|
||||
// console.error("----接口错误----", e)
|
||||
if (e.data) {
|
||||
if (e.data.code) {
|
||||
switch (Number(e.data.code)) {
|
||||
case 4001:
|
||||
goLogin()
|
||||
break;
|
||||
}
|
||||
}
|
||||
reject(e.data)
|
||||
} else reject({msg:'接口错误'})
|
||||
}
|
||||
|
||||
// 封装请求
|
||||
const request = (method, url, options) => {
|
||||
let methods = '';
|
||||
let headers = {};
|
||||
switch (method) {
|
||||
case 'get':
|
||||
methods = 'GET'
|
||||
headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
}
|
||||
break;
|
||||
case 'post':
|
||||
methods = 'POST'
|
||||
headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
}
|
||||
break;
|
||||
case 'postForm':
|
||||
methods = 'POST'
|
||||
headers = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
}
|
||||
break;
|
||||
}
|
||||
let obj = {},
|
||||
hideLoading = false,
|
||||
loadingText = 'loading...';
|
||||
if (options) { //如果有options
|
||||
if (options.hideLoading) {
|
||||
hideLoading = options.hideLoading
|
||||
delete options.hideLoading
|
||||
}
|
||||
if (options.loadingText) {
|
||||
loadingText = options.loadingText
|
||||
delete options.loadingText
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}${url}`,
|
||||
method: methods,
|
||||
data: dataObj(url, options),
|
||||
header: headers,
|
||||
success: res => {
|
||||
// console.log('反的结果===>',res);
|
||||
if (res.statusCode == 200) {
|
||||
if (res.data.code == 0) {
|
||||
resolve(res.data)
|
||||
} else {
|
||||
resolve(res.data)
|
||||
}
|
||||
} else {
|
||||
reject(res.data)
|
||||
}
|
||||
},
|
||||
fail: e => {
|
||||
checkError(e, reject)
|
||||
},
|
||||
complete: rest => {
|
||||
// console.log(rest);
|
||||
!hideLoading && uni.hideToast()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 上传文件 封装请求
|
||||
const uploadFile = (url, options) => {
|
||||
let tempData = options || {}
|
||||
uni.showLoading({title: "上传中..."})
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${getApp().globalData.domainName}${url}`,
|
||||
filePath: tempData.file,
|
||||
name: 'image',
|
||||
fileType:'image',
|
||||
formData: tempData,
|
||||
header: {
|
||||
'Content-Type': 'multipart/form-data;charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: res => {
|
||||
if (res.statusCode == 200) {
|
||||
let temp = JSON.parse(res.data)
|
||||
if (temp.code == 0) {
|
||||
resolve(temp)
|
||||
} else {
|
||||
reject(temp)
|
||||
uni.showToast({
|
||||
title: temp.msg || '接口错误(' + temp.code + ')',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: `未知错误(${res.statusCode})`,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
fail(e) {
|
||||
// uni.showToast({
|
||||
// title: '接口请求超时',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// reject(e.data)
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
get: (url, options) => {
|
||||
return request('get', url, options)
|
||||
},
|
||||
// JOSN格式
|
||||
post: (url, options) => {
|
||||
return request('post', url, options)
|
||||
},
|
||||
// form-data格式
|
||||
postForm: (url, options) => {
|
||||
return request('postForm', url, options)
|
||||
},
|
||||
// 上传
|
||||
upload: (url, options) => {
|
||||
return uploadFile(url, options)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
export default {
|
||||
onShareAppMessage(res) { //发送给朋友
|
||||
return {}
|
||||
},
|
||||
onShareTimeline(res) {//分享到朋友圈
|
||||
return {}
|
||||
},
|
||||
}
|
|
@ -0,0 +1,418 @@
|
|||
import {buriedPoint,reportBuriedPoint,zhuColor,checkQuan} from './publicAPI.js';
|
||||
const tools = {
|
||||
timer:'',
|
||||
timerNot:'',
|
||||
// 埋点倒计时
|
||||
daoTime(){
|
||||
let daoTime = uni.getStorageSync('daoTime')
|
||||
if(daoTime==''){//初次判断倒计时是否为空
|
||||
uni.setStorageSync('daoTime',60)//设置倒计时
|
||||
daoTime = uni.getStorageSync('daoTime')
|
||||
this.timer = setInterval(()=>{
|
||||
uni.setStorageSync('daoTime',daoTime--)//设置倒计时
|
||||
// console.log('埋点倒计时初次:',daoTime);
|
||||
// console.log('埋点长度初次:',uni.getStorageSync('maiList').length);
|
||||
if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){
|
||||
uni.removeStorageSync('daoTime')//清空倒计时
|
||||
clearInterval(this.timer)//关闭倒计时
|
||||
// console.log('上/报,埋点');
|
||||
// reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
||||
uni.removeStorageSync('maiList')//清空上报参数
|
||||
this.daoTime()//重新倒计时
|
||||
}
|
||||
},1000)
|
||||
} else {//继续当前倒计时倒计
|
||||
this.timer = setInterval(()=>{
|
||||
uni.setStorageSync('daoTime',daoTime--)//设置倒计时
|
||||
// console.log('埋点倒计时:',daoTime);
|
||||
// console.log('埋点长度:',uni.getStorageSync('maiList').length);
|
||||
if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){
|
||||
uni.removeStorageSync('daoTime')//清空倒计时
|
||||
clearInterval(this.timer)//关闭倒计时
|
||||
// console.log('上报,埋点');
|
||||
// reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
|
||||
uni.removeStorageSync('maiList')//清空上报参数
|
||||
this.daoTime()//重新倒计时
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
},
|
||||
zhuColorT(){//调用主色调
|
||||
zhuColor()
|
||||
},
|
||||
// 查券
|
||||
checkQuan(){
|
||||
checkQuan();
|
||||
},
|
||||
networkStatus(){//检查网络状态
|
||||
uni.getNetworkType({
|
||||
success: function (res) {
|
||||
console.log('当前网络状态:',res.networkType);//none:当前无网络连接
|
||||
if(res.networkType=='none'){
|
||||
uni.setStorageSync('isNet',false)
|
||||
} else {
|
||||
uni.setStorageSync('isNet',true)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
closeTimer(){
|
||||
clearInterval(this.timer)//关闭倒计时
|
||||
console.log('倒计时清空了');
|
||||
clearInterval(this.timerNot)//关闭倒计时
|
||||
},
|
||||
buriedPointAll(){//查询埋点类型事件
|
||||
buriedPoint()
|
||||
},
|
||||
maiDian(data){//埋点事件
|
||||
let maiList = uni.getStorageSync('maiList')
|
||||
// console.log(maiList);
|
||||
if(maiList==''){
|
||||
maiList = [data]
|
||||
} else maiList.push(data)
|
||||
uni.setStorageSync('maiList',maiList)
|
||||
},
|
||||
weekDate(){//获取未来七天星期几,几号
|
||||
let date = new Date()
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth()+1
|
||||
let day = date.getDate()
|
||||
let nth = date.getDay()//星期几
|
||||
// console.log(year,month,day);
|
||||
let xingq = ['周一','周二','周三','周四','周五','周六','周日']
|
||||
|
||||
},
|
||||
// 手机号验证
|
||||
isPhone:function(phone){
|
||||
// 手机号正则表达式
|
||||
let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
||||
if(!reg_tel.test(phone)){
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
// 手机号中间四位用"****"带替
|
||||
hideMPhone(phone){
|
||||
return `${phone.substr(0, 3)}****${phone.substr(7)}`
|
||||
},
|
||||
// 只显示姓,名使用"*"代替
|
||||
// hideName(name,num){//苹果手机运行不起
|
||||
// let hname = ''
|
||||
// let reg = /(?<=.)./g;
|
||||
// if(num==1) hname = name.replace(reg, '*')
|
||||
// if(num==2) hname = `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
||||
// return hname
|
||||
// },
|
||||
hideName(name,num){
|
||||
let hname = ''
|
||||
hname = `${name.substr(0, 1)}****${name.substr(name.length-1)}`
|
||||
return hname
|
||||
},
|
||||
// 整数添加.00,小数就不添加
|
||||
addXiaoShu(num){
|
||||
let str = num.toString();
|
||||
return str.includes('.') ? num : num = num + '.00';
|
||||
},
|
||||
// 时间戳===>日期
|
||||
timestampToTime(timestamp) {
|
||||
var date = timestamp.toString().length==13 ? new Date(timestamp*1) : new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
||||
var Y = date.getFullYear();
|
||||
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
|
||||
var D = date.getDate() < 10 ? '0'+date.getDate() : date.getDate();
|
||||
var h = date.getHours() < 10 ? '0'+date.getHours() : date.getHours();
|
||||
var m = date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes();
|
||||
var s = date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds();
|
||||
return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' +s;
|
||||
},
|
||||
// 日期===>时间戳
|
||||
timeToTimestamp(time){
|
||||
var date = new Date(time);
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
return timestamp
|
||||
// var date = new Date('2014-04-23 18:55:49:123');
|
||||
// 有三种方式获取
|
||||
// var time1 = date.getTime();//精确到毫秒
|
||||
// var time2 = date.valueOf();//精确到毫秒
|
||||
// var time3 = Date.parse(date);//只能精确到秒,毫秒用000替代
|
||||
// console.log(time1);//1398250549123
|
||||
// console.log(time2);//1398250549123
|
||||
// console.log(time3);//1398250549000
|
||||
},
|
||||
// 随机数生成
|
||||
randomStr(){
|
||||
var strData = "";
|
||||
//如果觉得12个数太少也可以多放点,将i<4修改即可
|
||||
for(var i=0;i<4;i++){
|
||||
var num = random(0,9); //数字
|
||||
var upper = String.fromCharCode(random(65,90)); //大写字母
|
||||
var lower = String.fromCharCode(random(97,122)); //小写字母
|
||||
strData = strData+num+upper+lower; //将所有结果放进strData中
|
||||
|
||||
}
|
||||
var str = "";
|
||||
for (var i = 0; i < 4; i++) {
|
||||
str += strData[random(0,strData.length-1)]; //在strData里面随机抽取四个数
|
||||
}
|
||||
return str;
|
||||
},
|
||||
// 金额输入框验证
|
||||
checkPrice(number,zong){
|
||||
let reg = /^[0-9]*$/;//数字正则表达式
|
||||
let newObj = {}
|
||||
zong = parseInt(zong).toString()//取小数点左边的整数
|
||||
if(!reg.test(number)){//不是数字时
|
||||
newObj = {
|
||||
len:zong.length,//动态设置长度
|
||||
val:zong//动态设置值正整数的总金额
|
||||
}
|
||||
} else {//是数字时
|
||||
newObj = {
|
||||
len:zong.length,
|
||||
val:number//动态设置当前输入的值
|
||||
}
|
||||
if(number*1 > zong*1){//输入的金额大于总金额
|
||||
newObj.val = zong//赋值总金额
|
||||
}
|
||||
}
|
||||
return newObj
|
||||
},
|
||||
// 提示方法
|
||||
showToast: function(msg, icon,time) {
|
||||
// 弹框图标:none默认无图标、loading、success
|
||||
var newIncon = 'none';
|
||||
if (icon) {newIncon = icon;}
|
||||
// 弹框显示时间:默认2秒
|
||||
var newTime = 2000
|
||||
if (time) {newTime = time;}
|
||||
return uni.showToast({
|
||||
title: msg,
|
||||
icon: newIncon,
|
||||
duration:newTime
|
||||
})
|
||||
},
|
||||
formatDuring: function(mss) {
|
||||
// let dangTime = Math.round(new Date()/1000)//获取当前时间戳
|
||||
var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
|
||||
var seconds = (mss % (1000 * 60)) / 1000;
|
||||
hours = hours < 10 ? ('0' + hours) : hours;
|
||||
minutes = minutes < 10 ? ('0' + minutes) : minutes;
|
||||
seconds = seconds < 10 && seconds >= 1 ? ('0' + seconds) : seconds;
|
||||
return hours + ' : ' + minutes + ' : ' + seconds;
|
||||
},
|
||||
escape2Html(str) {//富文本
|
||||
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
|
||||
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; }).replace('<section', '<div').replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto" ').replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
|
||||
},
|
||||
setTime(url,title,time){
|
||||
// console.log(url,title,time);
|
||||
if(url=='' && title==''){
|
||||
setTimeout(function(){uni.navigateBack({delta:1,})},time)
|
||||
} else if(title==''){
|
||||
setTimeout(function(){
|
||||
uni.navigateTo({
|
||||
url:url
|
||||
})
|
||||
},time)
|
||||
}
|
||||
},
|
||||
updaX(){//检测小程序版本以及更新小程序
|
||||
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
|
||||
const accountInfo = wx.getAccountInfoSync();//使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
||||
var version = accountInfo.miniProgram.version
|
||||
console.log(version);
|
||||
// 检测小程序的更新
|
||||
const updateManager = wx.getUpdateManager()//以下使用详情:https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
// 请求完新版本信息的回调
|
||||
// console.log('检测是否有更新:',res.hasUpdate)
|
||||
})
|
||||
updateManager.onUpdateReady(function (res) {
|
||||
wx.showModal({
|
||||
title: '恒美植发客服代表提醒您',
|
||||
content: '新版本已经准备就绪,是否重启应用',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
updateManager.onUpdateFailed(function (res) {
|
||||
// 新版本下载失败
|
||||
// console.log('新版本下载失败:',res);
|
||||
})
|
||||
},
|
||||
clearClog(){//去除某环境下的所有console.log()//输出信息
|
||||
// uniapp性能优化
|
||||
// #ifdef APP-PLUS
|
||||
if(uni.getSystemInfoSync().platform != "devtool"){//devtools:开发版 值域为:ios、android、mac(3.1.10+)、windows(3.1.10+)、linux(3.1.10+)
|
||||
console.log = () =>{}
|
||||
}
|
||||
// #endif
|
||||
// 微信小程序原生API性能优化
|
||||
// #ifdef MP-WEIXIN
|
||||
let hInfo = wx.getAccountInfoSync();
|
||||
// console.log(hInfo.envVersion);//develop:开发版 trial:体验版 release:正式版
|
||||
if(hInfo.miniProgram.envVersion != "develop"){
|
||||
console.log = () =>{}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
overdue(){//查询过期时间和是否有token,并调用登录事件
|
||||
var date = new Date();
|
||||
var timestamp = date.getTime();//精确到毫秒
|
||||
if((uni.getStorageSync('expire')*1000) - 10000 < timestamp){
|
||||
this.loginEv()
|
||||
} else if(uni.getStorageSync('token')==''){
|
||||
this.loginEv()
|
||||
} else if(uni.getStorageSync('is_active')=='' || uni.getStorageSync('is_active')==0){
|
||||
this.loginEv()
|
||||
}
|
||||
},
|
||||
loginEv(){//执行登录事件
|
||||
let that = this;
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(res) {
|
||||
if (res.code) {
|
||||
let code = res.code;
|
||||
let obj = uni.getStorageSync('params')
|
||||
var params = {
|
||||
invite_code:'',
|
||||
code:code,
|
||||
nickname: obj.nickname,
|
||||
avatar: obj.avatarUrl,
|
||||
country: obj.country,
|
||||
province: obj.province,
|
||||
city: obj.city,
|
||||
gender: obj.gender,
|
||||
language:obj.language
|
||||
}
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}user/login`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
// "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: res => {
|
||||
if(res.data.data.token!=''){
|
||||
uni.setStorageSync('token',res.data.data.token)//缓存token
|
||||
uni.setStorageSync('openid',res.data.data.openid)//缓存Openid
|
||||
uni.setStorageSync('expire',res.data.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('phone_active',res.data.data.phone_active)//是否绑定手机号
|
||||
uni.setStorageSync('userId',res.data.data.account_id)
|
||||
uni.setStorageSync('invite_code',res.data.data.invite_code)
|
||||
// console.log('is_active',uni.getStorageSync('is_active'));
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
returnAuth(){//是否第一次授权
|
||||
let auth = false
|
||||
// if(uni.getStorageSync('is_active')==0 || uni.getStorageSync('phone_active')==0) {
|
||||
if(uni.getStorageSync('is_active')==0) {
|
||||
// this.showToast('您目前是游客,请授权登录')
|
||||
// setTimeout(()=>{
|
||||
uni.navigateTo({url:'/pages/login/login'})
|
||||
// },1500)
|
||||
auth = true
|
||||
}
|
||||
return auth
|
||||
},
|
||||
isLogin(){//是否已经登录
|
||||
if(uni.getStorageSync('is_active')!='' && uni.getStorageSync('is_active') !=0 && uni.getStorageSync('phone_active') !=0){
|
||||
this.overdue()
|
||||
}
|
||||
},
|
||||
clickCopy(data){
|
||||
uni.setClipboardData({
|
||||
data: data,
|
||||
success: function() {
|
||||
uni.showToast({
|
||||
title: '复制成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
dayTime(endTime,startTime=''){//开启倒计时
|
||||
let totalSecond = '';
|
||||
// 本地倒计时
|
||||
// if(startTime=='') totalSecond = Math.floor((new Date(endTime).getTime() - new Date().getTime())/1000);
|
||||
// 解决苹果手机问题
|
||||
let date = endTime;
|
||||
date = endTime.replace(/-/g,'/')
|
||||
// 服务器倒计时
|
||||
if(startTime!='') totalSecond = Math.floor((new Date(date).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;
|
||||
},
|
||||
isVedio(){//是否显示视频内容
|
||||
uni.request({
|
||||
url: `${getApp().globalData.domainName}index/base-config`,
|
||||
method: 'get',
|
||||
header: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
// "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: res => {
|
||||
if(res.data.code==0){
|
||||
if(res.data.data.v==0) {
|
||||
uni.setStorageSync('isVedio',false);
|
||||
} else {
|
||||
uni.setStorageSync('isVedio',true);
|
||||
}
|
||||
console.log(uni.getStorageSync('isVedio'));
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
tools
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import statusNav from './components/status-nav.vue';//引入状态栏组件
|
||||
Vue.component('status-nav',statusNav)//全局注册状态栏组件
|
||||
import footTab from './components/foot-tab.vue';//引入底部tab组件
|
||||
Vue.component('foot-tab',footTab)//全局注册底部tab组件
|
||||
import backTop from './components/backTop.vue';//引入返回顶部组件
|
||||
Vue.component('back-top',backTop)//全局注册返回顶部组件
|
||||
import catePu from './components/cate-items/cate-pu.vue';//引入分类组件
|
||||
Vue.component('cate-pu',catePu)//全局注册分类组件
|
||||
import listPu from './components/list-pu.vue';//引入视频、图片列表组件
|
||||
Vue.component('list-pu',listPu)//全局注册视频、图片列表组件
|
||||
import pupo from './components/pupo.vue';//引入弹框组件
|
||||
Vue.component('pu-po',pupo)//全局注册弹框组件
|
||||
import nothingPage from './components/nothing-page.vue'//引入无内容组件
|
||||
Vue.component('nothing-page',nothingPage)//全局注册无内容组件
|
||||
import publicCustomer from './components/public-customer.vue'//引入客服组件
|
||||
Vue.component('public-customer',publicCustomer)//全局注册客服组件
|
||||
import authPhone from './components/auth-phone.vue'//引入手机授权组件
|
||||
Vue.component('auth-phone',authPhone)//全局注册手机授权组件
|
||||
import empower from './components/empower.vue'//引入用户授权组件
|
||||
Vue.component('empower',empower)//全局注册用户授权组件
|
||||
import authUserInfoMobile from './components/auth-userInfo-mobile.vue'//引入授权用户信息,授权手机号组件
|
||||
Vue.component('auth-userInfo-mobile',authUserInfoMobile)//全局注册授权用户信息,授权手机号组件
|
||||
// 全局注册分享事件
|
||||
import share from './jsFile/share.js'
|
||||
Vue.mixin(share)
|
||||
|
||||
// 常用工具
|
||||
import tools from '@/jsFile/tools.js'
|
||||
Vue.prototype.$toolAll = tools;
|
||||
// 响应数据
|
||||
import requst from '@/jsFile/requst.js'
|
||||
Vue.prototype.$requst = requst;
|
||||
// 域名,专治后台仔没有返回http/https的图片
|
||||
// Vue.prototype.$http = 'https://hm.hmzfyy.cn'
|
||||
Vue.prototype.$http = 'https://oss.hmzfyy.cn';
|
||||
Vue.prototype.$hostapi = 'https://hengmei.scdxtc.cn/api/';
|
||||
|
||||
const {log} = console;
|
||||
Vue.prototype.$log = log
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
App.mpType = 'app'
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"name" : "恒美植发",
|
||||
"appid" : "__UNI__02EF3E2",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"compilerVersion" : 3,
|
||||
/* 5+App特有相关 */
|
||||
"modules" : {
|
||||
"Payment" : {},
|
||||
"Share" : {}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"distribute" : {
|
||||
/* 应用发布信息 */
|
||||
"android" : {
|
||||
/* android打包配置 */
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
"ios" : {},
|
||||
/* ios打包配置 */
|
||||
"sdkConfigs" : {
|
||||
"maps" : {},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appid" : "wxa02e44170bc722cd",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"push" : {},
|
||||
"geolocation" : {},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wxa02e44170bc722cd",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
/* 小程序特有相关 */
|
||||
"appid" : "wx987dc41899f719e8",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"es6" : false
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "您的位置信息将用于小程序位置接口的效果展示"
|
||||
}
|
||||
}
|
||||
},
|
||||
"h5" : {
|
||||
"sdkConfigs" : {
|
||||
"maps" : {}
|
||||
}
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"appid" : "24346353"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"id": "zhuge-swiper",
|
||||
"name": "轮播视频和图片",
|
||||
"version": "1.0.1",
|
||||
"description": "自动轮播视频和图片组件。播放视频时停止轮播,手动滑动swiper时视频停止播放",
|
||||
"keywords": [
|
||||
"vue",
|
||||
"swiper",
|
||||
"zhuge"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,294 @@
|
|||
{
|
||||
"pages": [
|
||||
{
|
||||
"path" : "pages/tabbar/pagehome/pagehome",
|
||||
"style" :{}
|
||||
},{
|
||||
"path" : "pages/tabbar/my/staffDuan",
|
||||
"style" :{}
|
||||
},{
|
||||
"path" : "pages/login/login",
|
||||
"style" :{
|
||||
"navigationBarTextStyle":"black" //状态栏字体颜色
|
||||
}
|
||||
},{
|
||||
"path" : "pages/tabbar/my/my",
|
||||
"style" :{}
|
||||
},
|
||||
{
|
||||
"path" : "pages/tabbar/shop/shop",
|
||||
"style" :{}
|
||||
},
|
||||
{
|
||||
"path" : "pages/tabbar/cate/cate",
|
||||
"style" : {}
|
||||
},
|
||||
|
||||
{
|
||||
"path":"pages/login/xiey",
|
||||
"style" :{}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{//A包
|
||||
"root": "pagesA",
|
||||
"pages": [
|
||||
{
|
||||
"path" : "nodifyData/nodifyData",//修改资料
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "makeAnPppointment/makeAnPppointment",//自主预约列表
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "ppointmentEv/ppointmentEv",//提交自主预约
|
||||
"style" :{}
|
||||
}
|
||||
,{
|
||||
"path" : "suggestions/suggestions",//投诉及建议
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "shopCart/shopCart",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "getReadyDan/getReadyDan",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "immediatePayment/immediatePayment",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "member/member",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "integralManage/integralManage",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "peacockCoin/peacockCoin",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "signIn/signIn",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "myOrder/myOrder",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "myAddress/myAddress",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "activityTask/activityTask",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "coupon/coupon",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "pointsMall/pointsMall",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "my-diary/my-diary",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "my-diary-edit/my-diary-edit",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
{//B包
|
||||
"root": "pagesB",
|
||||
"pages": [
|
||||
{
|
||||
"path" : "searchPage/searchPage",//搜索页
|
||||
"style" :{}
|
||||
}
|
||||
,{
|
||||
"path" : "mysharer/mysharer",//我的分享人
|
||||
"style" :{}
|
||||
}
|
||||
,{
|
||||
"path" : "messagecenter/messagecenter",//消息中心
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "myCollection/myCollection",//我的收藏
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "customerList/customerList",//客户列表
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "userFootprint/userFootprint",//用户足迹
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "personalPoster/personalPoster",//二维码海报
|
||||
"style" : {}
|
||||
},{
|
||||
"path" : "sharingCenter/sharingCenter",//分享中心
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "aboutUs/aboutUs",//关于我们
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "articleDetail/articleDetail",//详情
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "doctor/doctor",//医生列表
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "doctorDetail/doctorDetail",//医生详情
|
||||
"style" :{}
|
||||
}
|
||||
,{
|
||||
"path" : "problemDetail/problemDetail",//问题分类详情
|
||||
"style" : {}
|
||||
},
|
||||
{
|
||||
"path":"video/playVideo",
|
||||
"style":{}
|
||||
},
|
||||
{
|
||||
"path":"customer/customer",
|
||||
"style":{}
|
||||
}
|
||||
,{
|
||||
"path" : "shopDetail/shopDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "orderDetail/orderDetail",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "customerCheck/customerCheck",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
,{
|
||||
"path" : "shopSearch/shopSearch",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"preloadRule": {
|
||||
"pages/tabbar/pagehome/pagehome": {
|
||||
"network": "all",
|
||||
"packages": ["pagesA"]
|
||||
}
|
||||
},
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "恒美",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",//导航栏背景色
|
||||
"backgroundColor": "#FFFFFF",//窗口背景色
|
||||
"navigationStyle":"custom"//去掉所有原生导航栏
|
||||
}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
<template>
|
||||
<view>
|
||||
<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav>
|
||||
<view class='login-header'>
|
||||
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
|
||||
<view class="logo-name">恒美植发</view>
|
||||
</view>
|
||||
<view class="login-box">
|
||||
<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo">微信授权</button>
|
||||
<!--新版登录方式-->
|
||||
<!-- <button v-if="canIGetUserProfile" class='login-btn' type='primary' @click="bindGetUserInfo">授权登录</button> -->
|
||||
<!--旧版登录方式-->
|
||||
<!-- <button v-else class='login-btn' type='primary' open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="bindGetUserInfo">授权登录</button> -->
|
||||
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">《用户服务协议》</text></view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<view v-if="isShowP" class="disjcac posAll">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="tc tank-box-itemone">请授权绑定手机号</view>
|
||||
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
|
||||
<!-- <view @tap="refuse" class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view> -->
|
||||
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
|
||||
<view :style="{background:publicColor}" class="pad-sx10 radius10 tank-btn posir">
|
||||
立即绑定
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},//用户信息
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
canIGetUserProfile: false,
|
||||
imgSrc: '/static/public/logo.png',//默认logo头像
|
||||
isShowP:false,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// let ya = this;
|
||||
// // 微信扫码后会自动编码,所以需要解码
|
||||
// if (options && options.q) {
|
||||
// let arr = decodeURIComponent(options.q).split('?')[1].split('&')
|
||||
// let obj = {}
|
||||
// arr.forEach(item => {
|
||||
// let brr = item.split('=')
|
||||
// obj[brr[0]] = brr[1]
|
||||
// })
|
||||
// // console.log(obj) //得到参数组成的对象
|
||||
// ya.invite_code = obj.invite_code
|
||||
// }
|
||||
if (uni.getUserProfile) {
|
||||
this.canIGetUserProfile = true;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refuse(){//暂不绑定事件
|
||||
this.isShowP=false;
|
||||
this.$toolAll.tools.showToast('登录成功','success')
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
let ya = this;
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
console.log(e);
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success');
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
} else {
|
||||
// this.$toolAll.tools.showToast('登录成功','success')
|
||||
// uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
|
||||
}
|
||||
},
|
||||
goXie(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/xiey'
|
||||
})
|
||||
},
|
||||
//调起登录授权
|
||||
bindGetUserInfo(e) {
|
||||
let ya = this;
|
||||
//新版登录方式
|
||||
uni.getUserProfile({
|
||||
desc: '登录',
|
||||
lang: 'zh_CN',
|
||||
success: (res) => {
|
||||
console.log('res',res);
|
||||
ya.userInfo = res.userInfo;
|
||||
// console.log('可用用户信息:',ya.userInfo);
|
||||
try {
|
||||
ya.login();
|
||||
} catch (e) {}
|
||||
},
|
||||
fail: (res) => {}
|
||||
});
|
||||
},
|
||||
login() {
|
||||
let ya = this;
|
||||
// 获取登录用户code
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(res) {
|
||||
if (res.code) {
|
||||
let code = res.code;
|
||||
ya.updateUserInfo(code);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '登录失败!',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
//调用登录接口
|
||||
updateUserInfo(code) {
|
||||
let ya = this;
|
||||
uni.showToast({
|
||||
title: '登录中...',
|
||||
icon:'loading',
|
||||
duration:10000
|
||||
})
|
||||
var params = {
|
||||
code:code,
|
||||
nickname: ya.userInfo.nickName,//用户昵称
|
||||
headimgurl: ya.userInfo.avatarUrl,//用户头像
|
||||
country: ya.userInfo.country,//用户所在国家
|
||||
province: ya.userInfo.province,//用户所在省份
|
||||
city: ya.userInfo.city,//用户所在城市
|
||||
gender: ya.userInfo.gender,//用户性别
|
||||
language:ya.userInfo.language,//语言
|
||||
is_active:1
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
// console.log(res);
|
||||
if(res.data.token!=''){
|
||||
uni.setStorageSync('params',params)
|
||||
uni.setStorageSync('userId',res.data.account_id)
|
||||
uni.setStorageSync('token',res.data.token)//缓存token
|
||||
uni.setStorageSync('expire',res.data.expire)//缓存失效时间(时间戳格式)
|
||||
uni.setStorageSync('is_active',res.data.is_active)//是否第一次授权
|
||||
uni.setStorageSync('phone_active',res.data.phone_active)//是否第一次授权
|
||||
uni.setStorageSync('invite_code',res.data.invite_code)
|
||||
uni.hideToast()
|
||||
this.isShowP = true;
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
@tcolor:#333333;
|
||||
@tcolorp:#3875F6;
|
||||
.login-header {display: flex;justify-content: center;align-items: center;flex-direction: column;margin-top: 40%;}
|
||||
.infoImg {width: 192rpx;height: 192rpx;border-radius: 100%;}
|
||||
.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 20rpx;color: @tcolor;}
|
||||
.login-box {margin-top: 60rpx;text-align: center;}
|
||||
.login-btn {width: 80%;margin-top: 50%;}
|
||||
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
|
||||
.xieCon{color: @tcolorp;}
|
||||
</style>
|
|
@ -0,0 +1,26 @@
|
|||
<template>
|
||||
<view>
|
||||
<status-nav :titleVal="'协议'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="mar20">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
content:'<p>1.用户协议谢谢洗诶诶黑货币的宁波</p>'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$toolAll.tools.escape2Html(this.content)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,568 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :statusBack="false" :titleVal="'分类'" :statusTitle="true"></status-nav>
|
||||
<view class="disje mar-zy20" :style="{paddingTop: (statusHNH+10)+'px'}">
|
||||
<template v-if="cateList.length!=0">
|
||||
<view class="cate-box" :style="{paddingTop:statusHNH+'px'}" style="overflow: hidden;overflow-y: scroll;">
|
||||
<view class="fon26">
|
||||
<view class="mar-s20 flexs" :style="{color : ccurrent==indexc ? publicColor:''}"
|
||||
:class="ccurrent==indexc?'bold cateActive':'catemo'"
|
||||
v-for="(itemc,indexc) in cateList" :key="indexc"
|
||||
@tap="chooseCate(indexc)">{{itemc.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{width:cateW+'px'}" class="flexs" style="height: 10px;"></view>
|
||||
<view v-show="isLoading" class="pad-x260" style="width: 74%;">
|
||||
<!-- 热门推荐 -->
|
||||
<template v-if="ccurrent==0">
|
||||
<!-- 自定义轮播 -->
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'154'" :newRadius="'10'" :newBottom="'10'"></swiper-pu>
|
||||
<!-- 自定义二级分类 -->
|
||||
<view class="mar-x20 mar-s40">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<block v-if="!isHot">
|
||||
<view v-if="dataList.length!=0">
|
||||
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :nFon="'14'" :radiu="true" :nmarz="'6'" :nWidth="'90'" :nHeight="'90'" :list="dataList"></list-pu>
|
||||
</view>
|
||||
<view v-else style="padding-top: 150rpx;">
|
||||
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="dataList"></list-pu>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view v-if="dataShopList.length!=0" style="margin-top: -20rpx;">
|
||||
<view class="pad-sx20">
|
||||
<view style="width: 48.6%;float: left;">
|
||||
<view v-if="index1%2==0" v-for="(item1,index1) in dataShopList" :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="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.isXian || item1.isPing || item1.isTuan" 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 || item1.isPing || item1.isTuan" 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 dataShopList" :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="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 || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 34%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">暂无内容</view>
|
||||
</view>
|
||||
</block>
|
||||
</template>
|
||||
<!-- 秃顶种植 -->
|
||||
<template v-if="ccurrent!=0">
|
||||
<view v-if="tuList.length!=0">
|
||||
<cate-tu :isDetail="true" :list="tuList"></cate-tu>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 60%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">暂无内容</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='1'></foot-tab>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
cateTu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
ccurrent:0,
|
||||
cateList:[],
|
||||
cateListTwo:[//二级分类
|
||||
|
||||
],
|
||||
dataList:[//小课堂数据列表
|
||||
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
tuList:[],
|
||||
newCurrent:0,
|
||||
cateW:'',//分类宽度
|
||||
isLoading:false,
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
category_id:'',//栏目ID
|
||||
disease_id:'',//一级病种ID 可不填
|
||||
bannerList:[],
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
zanArr:[],
|
||||
dataShopList:[],
|
||||
timeList:[],
|
||||
isHot:false,
|
||||
isAutoPlay:false,
|
||||
optionObj:{}
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
if(!this.isHot){
|
||||
this.checkCate(this.category_id)//调用自主预约列表事件
|
||||
}
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pages/tabbar/cate/cate?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.optionObj = options;
|
||||
this.checkBZ()//调用病种列表事件
|
||||
let maiOjb = {
|
||||
e:7,//进入分类
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
this.checkSwi()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
// console.log(this.category_id);
|
||||
if(this.category_id!='') this.checkCate(this.category_id)//调用左侧列表点击事件
|
||||
this.isAutoPlay = true;
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
methods: {
|
||||
checkSwi(){
|
||||
checkBanner({position:'category-hot-banner'}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let isVideo = false
|
||||
if(item.type!='img') isVideo = true
|
||||
let banObj = {
|
||||
imgSrc:this.$http + item.src,
|
||||
url:item.url,
|
||||
isVideo:isVideo,
|
||||
poster:this.$http + item.src,
|
||||
}
|
||||
this.bannerList.push(banObj)
|
||||
})
|
||||
}
|
||||
//
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
this.dataList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
}
|
||||
},
|
||||
comfirmev(e){//确认取消收藏事件
|
||||
this.dataList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
},
|
||||
checkBZ(){//病种列表
|
||||
this.$requst.post('archives/disease').then(res=>{
|
||||
// console.log('病种列表:',res);
|
||||
if(res.code==0 && res.data.length!=0){
|
||||
this.cateList=[]
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.name,
|
||||
pid:item.pid,
|
||||
sort:item.sort
|
||||
}
|
||||
this.cateList.push(obj)
|
||||
})
|
||||
let reObj = {
|
||||
id:this.cateList[0].id,
|
||||
title:'热门推荐',
|
||||
pid:this.cateList[0].pid,
|
||||
sort:this.cateList[0].sort
|
||||
}
|
||||
this.cateList.unshift(reObj)
|
||||
this.checkCate(this.category_id)//调用分类列表事件
|
||||
if(this.cateList.length!=0){
|
||||
setTimeout(()=>{
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.cate-box').boundingClientRect((rect) => {
|
||||
// console.log('分类宽度:',rect.width);
|
||||
this.cateW = rect.width
|
||||
}).exec()
|
||||
},300)
|
||||
}
|
||||
setTimeout(()=>{this.isLoading = true},500)
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkCate(category_id){//分类列表事件
|
||||
this.dataShopList = [];
|
||||
// this.$toolAll.tools.showToast('加载中...')
|
||||
this.$requst.post('archives/hot',{category_id:category_id,page:this.page,size:this.size}).then(res=>{
|
||||
// console.log('分类列表:',res);
|
||||
if(res.code==0){
|
||||
if(this.category_id==''){
|
||||
if(res.data.category.length!=0){
|
||||
this.cateListTwo = []
|
||||
res.data.category.forEach(item=>{
|
||||
let cateObj = {
|
||||
id:item.id,
|
||||
model:item.model,
|
||||
model_id:item.model_id,
|
||||
sort:item.sort,
|
||||
title:item.title
|
||||
}
|
||||
this.cateListTwo.push(cateObj)
|
||||
})
|
||||
this.cateListTwo.push({title:'热门商品'})
|
||||
this.cateListTwo.push({title:'筛选'})
|
||||
this.category_id = this.cateListTwo[0].id
|
||||
}
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) {
|
||||
this.dataList = [];
|
||||
uni.pageScrollTo({
|
||||
scrollTop:0,
|
||||
duration:0
|
||||
})
|
||||
}
|
||||
if(res.data.list.list.length!=0){
|
||||
this.total = res.data.list.total
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkData(disease_id){//一级病种列表事件
|
||||
this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{
|
||||
// console.log('一级病种列表内容:',res);
|
||||
if(res.code==0){
|
||||
this.tuList = []
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let arr = []
|
||||
if(item.children.length!=0){
|
||||
item.children.forEach(itemt=>{
|
||||
let objt = {
|
||||
category_id:itemt.category_id,
|
||||
content:itemt.title,
|
||||
id:itemt.id,
|
||||
disease_id:itemt.disease_id,//一级病种ID 1
|
||||
disease_second_id:itemt.disease_second_id,//二级病种ID 12
|
||||
subtitle:itemt.subtitle//内容副标题
|
||||
}
|
||||
arr.push(objt)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
title:item.name,
|
||||
src:'',
|
||||
list:arr
|
||||
// {content:'秃顶种植保养周期'},
|
||||
// {content:'秃顶种植保养手册'},
|
||||
// {content:'秃顶种植保养项目'},
|
||||
// {content:'那些人需要保养'},
|
||||
// ]
|
||||
}
|
||||
this.tuList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseCate(index){//分类选中事件
|
||||
this.ccurrent = index
|
||||
this.checkData(this.cateList[index].id)
|
||||
// console.log('分类选中:',index);
|
||||
},
|
||||
chooseTwo(index){//二级分类选择
|
||||
this.newCurrent = index
|
||||
this.isZanw = true;
|
||||
this.isHot = false;
|
||||
this.page = 1
|
||||
this.category_id = this.cateListTwo[index].id
|
||||
// console.log('二级分类:',this.cateListTwo[index].title);
|
||||
if(this.cateListTwo[index].title=='筛选'){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage'
|
||||
})
|
||||
} else if(this.cateListTwo[index].title=='热门商品'){
|
||||
this.isHot = true;
|
||||
this.checkSotList()
|
||||
} else {
|
||||
this.checkCate(this.cateListTwo[index].id)
|
||||
}
|
||||
},
|
||||
checkSotList(){
|
||||
this.dataList = [];
|
||||
let params = {
|
||||
page:1,
|
||||
size:2000,
|
||||
is_hot:1
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
clearInterval(this.timer);
|
||||
// if(this.page==1) {
|
||||
this.zanArr = [];
|
||||
this.dataShopList = [];
|
||||
this.timeList = [];
|
||||
// }
|
||||
this.total = res.data.total;
|
||||
if(res.data.data.list.length!=0){
|
||||
res.data.data.list.forEach(item=>{
|
||||
let tuan = false,ping = false,xian = false,integral = false;
|
||||
if(item.activity_type=='group_make') ping = true;
|
||||
if(item.activity_type=='group_buy') tuan = true;
|
||||
if(item.activity_type=='limit_time') xian = true;
|
||||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc: this.$http + item.cover,
|
||||
title: item.name,
|
||||
zhePrice:item.price/100,
|
||||
yuanPrice:item.original_price/100,
|
||||
integral:'',
|
||||
isTuan:tuan,//是否是团购
|
||||
isPing:ping,//是否是拼团活动
|
||||
isXian:xian,//是否是限时活动
|
||||
isIntegral:integral,//是否是积分
|
||||
grade:'',
|
||||
disease_name:item.disease_name,//病种名称
|
||||
reponseTime:res.header.Date,//接口响应时间
|
||||
activity_end_at:item.activity_end_at,//限时结束时间
|
||||
activity_group_cover:group_cover,//参团人的头像
|
||||
activity_group_num:item.activity_group_num,//已经参团人数
|
||||
}
|
||||
this.zanArr.push(obj)
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.activity_end_at!='') {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
reponseTime:item.reponseTime,
|
||||
time:item.activity_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
this.$toolAll.tools.showToast('加载中...')
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
this.timeList[index].reponseTime = new Date(this.timeList[index].reponseTime).getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(this.timeList[index].reponseTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.zanArr[item.nIndex].activity_end_at = "活动已结束";
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
this.dataShopList = this.zanArr;
|
||||
},1000)
|
||||
} else {
|
||||
this.dataShopList = this.zanArr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataShopList[index].isIntegral}`
|
||||
})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,350 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<navigator open-type="navigateBack"/>
|
||||
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :statusBack="false"></status-nav>
|
||||
<view class="mar-zy32 posir pad-x260" :style="{paddingTop:statusHNH+'px'}">
|
||||
<view class="bacf radius20 posir gao" style="box-shadow: 0px 16rpx 30rpx rgba(141, 141, 141, 0.26);">
|
||||
<view class="posia" :style="{top:`-${gaoh*0.4}px`,height:gaoh+'px',background:publicColor}" style="left: -32rpx;right: -32rpx;z-index: -1;"></view>
|
||||
<view class="disjbac">
|
||||
<view class="disac">
|
||||
<!-- 头像 -->
|
||||
<image class="mar-sx30" :src="userInfo.headimgurl || ''" style="width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;" mode="aspectFill"></image>
|
||||
<view class="mar-z30">
|
||||
<!-- 昵称 -->
|
||||
<view class="fon36 bold">{{userInfo.nickname || ''}}</view>
|
||||
<view class="disac mar-s10" v-if="userInfo.mobile!==''">
|
||||
<image src="/static/public/phone.png" style="width: 14rpx;height: 20rpx;" mode=""></image>
|
||||
<!-- 手机号 -->
|
||||
<view class="fon24 col3 mar-z10">{{userInfo.mobile}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-y25 disac">
|
||||
<!-- 二维码 -->
|
||||
<image @tap="isQrcode=true" src="/static/public/eqr.png" style="width: 43rpx;height: 43rpx;z-index: 1;" mode=""></image>
|
||||
<!-- 前进键 -->
|
||||
<view @tap="goNodifyData" style="width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;" class="disac">
|
||||
<image class="" src="/static/public/nextM.png" style="width: 35rpx;height: 35rpx;z-index: 1;" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disja posir" style="z-index: 1;">
|
||||
<view @tap="choosesjf(indext)" class="disac fc flexs" style="width: 33%;" 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 mar-x25">{{itemt.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/mybt.png" mode=""></image>
|
||||
</view>
|
||||
<!-- 员工功能 v-if="userInfo.is_staff && yuanList.length!=0" -->
|
||||
<view v-if="userInfo.is_staff==1" class="bacf radius20 mar-s20 pad20">
|
||||
<view class="mar-x30 fon28 bold col3">员工功能</view>
|
||||
<view class="disac 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 class="disac fc">
|
||||
<image :src="itemy.src" style="width: 54rpx;height: 54rpx;" mode="aspectFill"></image>
|
||||
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
|
||||
</view>
|
||||
<view v-if="indexy<(yuanList.length-1)" style="height: 58rpx;border: 2rpx solid #E6E6E6;position: absolute;right: 0;"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 -->
|
||||
<image @tap="goPage" class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image>
|
||||
<!-- 功能列表 -->
|
||||
<view class="bacf radius20 pad-zy30">
|
||||
<view @tap="chooseItem(indexl)" class="disjbac pad-sx30 borbot" v-for="(iteml,indexl) in toolsList" :key="indexl">
|
||||
<view class="icon-box disac">
|
||||
<image class="mar-y20" :src="iteml.src" mode=""></image>
|
||||
<view class="fon26">{{iteml.title}}</view>
|
||||
</view>
|
||||
<view class="disac">
|
||||
<view v-if="iteml.num!='' && iteml.num!=0" style="width: 40rpx;height: 40rpx;border-radius: 100%;background-color: #F96969;font-size: 18rpx;text-align: center;line-height: 40rpx;color: #FFFFFF;">{{iteml.num}}</view>
|
||||
<image class="mar-z10" src="/static/public/nexth.png" style="width: 18rpx;height: 18rpx;" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 我的二维码弹框 -->
|
||||
<view v-if="isQrcode" class="posAll disjcac">
|
||||
<view>
|
||||
<view class="bacf radius20" style="margin: 0 130rpx;">
|
||||
<view class="fon28 col3 tc pad-s40">我的二维码</view>
|
||||
<image :src="myqr" style="width: 325rpx;height: 325rpx;margin: 30rpx 86rpx 68rpx 86rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
||||
<!-- 弹框授权 -->
|
||||
<empower :vision="vision" @cancleEv="cancleEv"></empower>
|
||||
<view v-if="isQian" style="position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);">
|
||||
<view style="padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;">签到成功</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
import empower from '@/components/empower.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{empower},
|
||||
data() {
|
||||
return {
|
||||
vision:false,
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
tongList:[
|
||||
{num:'0',title:'文章收藏'},
|
||||
{num:'0',title:'积分'},
|
||||
{num:'0',title:'我的分享'}
|
||||
],
|
||||
yuanList:[], //'customer-list','footmarks','scan'
|
||||
zanCyuanList:[
|
||||
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
|
||||
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
|
||||
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
|
||||
],
|
||||
toolsList:[
|
||||
{src:'/static/public/zyuy.png',title:'自助预约',num:''},
|
||||
{src:'/static/public/hb.png',title:'个人海报',num:''},
|
||||
{src:'/static/public/wsc.png',title:'文章收藏',num:''},
|
||||
{src:'/static/public/fx.png',title:'分享中心',num:''},
|
||||
{src:'/static/public/message.png',title:'消息通知',num:''},
|
||||
{src:'/static/public/ts.png',title:'投诉与建议',num:''},
|
||||
{src:'/static/public/aboutus.png',title:'关于我们',num:''},
|
||||
],
|
||||
isQrcode:false,//是否显示我的二维码
|
||||
userInfo:{},//用户信息
|
||||
gaoh:uni.getStorageSync('gao'),
|
||||
myqr:'/static/public/qrcode.png',
|
||||
is_worker:'',//是否为职工账号,0否(客户), 1是
|
||||
is_doctor:'',//是否为医生,0否,1是
|
||||
is_servicer:'',//是否为客服,0否,1是
|
||||
is_staff:'',//是否为普通员工,0否,1是
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
isQian:false,
|
||||
bannerList:[],
|
||||
guangImg:'',
|
||||
isAuth:'',
|
||||
guanggao:''
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
//相当于监听返回按钮
|
||||
let pages = getCurrentPages();
|
||||
// console.log('pages:',pages);
|
||||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkInfo()
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
onLoad() {
|
||||
if(uni.getStorageSync('gao')==''){
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.gao').boundingClientRect((rect) => {
|
||||
uni.setStorageSync('gao',rect.height)
|
||||
this.gaoh = rect.height
|
||||
}).exec()
|
||||
}
|
||||
this.checkSwi()
|
||||
this.checkGM()
|
||||
},
|
||||
methods: {
|
||||
goPage(){
|
||||
uni.navigateTo({
|
||||
url:this.guanggao
|
||||
})
|
||||
},
|
||||
checkSwi(){
|
||||
checkBanner({position:'personal-center-banner'}).then(res=>{
|
||||
// console.log('res',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
this.guangImg = this.$http + res.data[0].src
|
||||
this.guanggao = res.data[0].url
|
||||
// res.data.forEach(item=>{
|
||||
// let isVideo = false
|
||||
// if(item.type!='img') isVideo = true
|
||||
// let banObj = {
|
||||
// imgSrc:this.$http + item.src,
|
||||
// url:item.url,
|
||||
// isVideo:isVideo,
|
||||
// poster:this.$http + item.src,
|
||||
// }
|
||||
// this.bannerList.push(banObj)
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancleEv(e){
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
checkGM(){//查询个人二维码事件
|
||||
this.$requst.post('user/personal-qr').then(res=>{
|
||||
// console.log('个人二维码:',res);
|
||||
if(res.code==0){
|
||||
base64ToPath(res.data.qr).then(path => {
|
||||
this.myqr = path
|
||||
uni.setStorageSync('imgSrc',path)
|
||||
}).catch(error => {})
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkInfo(){
|
||||
this.$requst.post('user/info').then(res=>{
|
||||
// console.log('用户信息:',res);
|
||||
if(res.code==0 && res.data.length!=0) {
|
||||
this.userInfo = res.data;
|
||||
this.tongList[1].num = res.data.score//个人积分
|
||||
this.tongList[0].num = res.data.collects//收藏总数
|
||||
this.tongList[2].num = res.data.share_users.total//分享人总数
|
||||
this.toolsList[4].num = res.data.unread_messages//分享人总数
|
||||
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(this.toolsList.length!=8){
|
||||
this.toolsList.push({src:'/static/public/aboutus.png',title:'客服二维码',num:''})
|
||||
}
|
||||
}
|
||||
uni.setStorageSync('shareAll',res.data)
|
||||
if(res.data.rules.length!=0){
|
||||
let result = this.zanCyuanList.filter(item => res.data.rules.some(itemt => itemt===item.rule))
|
||||
this.yuanList = result
|
||||
uni.setStorageSync('rules',res.data.rules)
|
||||
} else this.yuanList = []
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseItem(index){//列表事件
|
||||
// console.log('当前选项:',this.toolsList[index].title);
|
||||
let newUrl = ''
|
||||
if(index==0) newUrl = '/pagesA/makeAnPppointment/makeAnPppointment'
|
||||
if(index==1) newUrl = '/pagesB/personalPoster/personalPoster'
|
||||
if(index==2) newUrl = '/pagesB/myCollection/myCollection'
|
||||
if(index==3) newUrl = '/pagesB/sharingCenter/sharingCenter'
|
||||
if(index==4) newUrl = '/pagesB/messagecenter/messagecenter'
|
||||
if(index==5) newUrl = '/pagesA/suggestions/suggestions'
|
||||
if(index==6) newUrl = '/pagesB/aboutUs/aboutUs'
|
||||
if(index==7) newUrl = '/pagesB/customer/customer'
|
||||
uni.navigateTo({
|
||||
url:newUrl
|
||||
})
|
||||
},
|
||||
chooseYitem(index){//员工功能事件
|
||||
// console.log('当前选项:',this.yuanList[index].title);
|
||||
switch (index){
|
||||
case 0:
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/customerList/customerList'
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/userFootprint/userFootprint'
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
||||
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
fail: (res) => {}, //接口调用失败的回调函数
|
||||
onlyFromCamera: false, //是否只能从相机扫码,不允许从相册选择图片,这里是只允许相机扫码
|
||||
scanType: ['qrCode'], // scanType:扫码类型 : 二维码
|
||||
success: (rt) => { // 接口调用成功的回调函数
|
||||
let uc = JSON.parse(rt.result).user_coding
|
||||
this.$requst.post('user/sign-in',{user_coding:uc}).then(res=>{
|
||||
// console.log('执行扫码事件:',res);
|
||||
if(res.code==0){
|
||||
this.isQian = true
|
||||
setTimeout(()=>{
|
||||
this.isQian = false
|
||||
},2000)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
choosesjf(index){//文章收藏事件、积分、我的分享
|
||||
// console.log('当前选项:',this.tongList[index].title);
|
||||
switch (index){
|
||||
case 0:
|
||||
uni.navigateTo({//我的收藏
|
||||
url:'/pagesB/myCollection/myCollection'
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
uni.navigateTo({//客户列表
|
||||
url:'/pagesB/mysharer/mysharer'
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
goNodifyData(){//去修改资料页面
|
||||
uni.setStorageSync('uinfo',this.userInfo)
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/nodifyData/nodifyData'
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,632 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :statusBack="false"></status-nav>
|
||||
<image src="/static/public/staff-head.png" class="blue-img"></image>
|
||||
<view class="mar-zy32 posir pad-x260" :style="{paddingTop:statusHNH+'px'}">
|
||||
<view class="radius20 posir gao">
|
||||
<view class="posia" :style="{top:`-${gaoh*0.4}px`,height:gaoh+'px'}"></view>
|
||||
<view class="disjbac">
|
||||
<view class="disac colf">
|
||||
<!-- 头像 -->
|
||||
<image @tap="openXiao" class="mar-sx30" :src="userInfo.headimgurl || ''" mode="aspectFill"></image>
|
||||
<view class="mar-z30">
|
||||
<!-- 昵称 -->
|
||||
<view class="disac">
|
||||
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || ''}}</view>
|
||||
<view class="gao-name">{{userInfo.level.name}}</view>
|
||||
</view>
|
||||
<view class="disac mar-s10" v-if="userPhone!==''">
|
||||
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
|
||||
<!-- 手机号 -->
|
||||
<view class="fon24 mar-z10">{{userPhone}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-y25 disac">
|
||||
<!-- 二维码 -->
|
||||
<image @tap="tuneUpqr" src="/static/public/staff-qro.png" class="gao-m" mode=""></image>
|
||||
<!-- 前进键 -->
|
||||
<view @tap="goNodifyData" class="disac gao-next-box">
|
||||
<!-- <image class="" src="/static/public/next-white.png" mode="aspectFill"></image> -->
|
||||
<image class="" src="/static/public/set-icon.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disjbac posir mar-s40 fon24 pad-zy50" style="z-index: 1;color: #F8CE59;">
|
||||
<view>
|
||||
<view class="disac"><span class="bold mar-y20">VIP</span>{{userInfo.level.name}}</view>
|
||||
</view>
|
||||
<navigator url="/pagesA/member/member" hover-class="none">
|
||||
<view class="disac">
|
||||
<view>更多权益</view>
|
||||
<image src="/static/public/next-yellow.png" class="white-next" mode=""></image>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disja posir" style="z-index: 1;margin-top: 75rpx;">
|
||||
<view @tap="chooseone(indext)" class="disac fc flexs width25" v-for="(itemt,indext) in tongList" :key="indext">
|
||||
<view class="fon28 bold mar-sx20 clips1">{{itemt.num}}<text v-if="indext==2">天</text><text v-if="indext==3">人</text></view>
|
||||
<view class="fon28 mar-x25">{{itemt.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 员工功能 v-if="userInfo.is_staff && yuanList.length!=0" -->
|
||||
<view v-if="userInfo.is_staff==1" class="bacf radius20 mar-s20 pad20">
|
||||
<view class="mar-x30 fon28 bold col3">员工功能</view>
|
||||
<view class="disja yuan-box">
|
||||
<view @tap="chooseYitem(indexy)" v-for="(itemy,indexy) in yuanList" :key="indexy">
|
||||
<view class="disac fc">
|
||||
<image :src="itemy.src" mode="aspectFill"></image>
|
||||
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
|
||||
</view>
|
||||
<block v-if="indexy<yuanList.length-1">
|
||||
<view class="xian-right"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的订单 -->
|
||||
<view class="bacf radius20 mar-s20 pad20">
|
||||
<view class="mar-x30 fon28 col3 disjbac">
|
||||
<view>我的订单</view>
|
||||
<navigator url="/pagesA/myOrder/myOrder?index=0" hover-class="none">
|
||||
<view class="disac">
|
||||
<view class="fon24 col9">全部</view>
|
||||
<image src="/static/public/nextM.png" class="white-next" mode=""></image>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="disja fon28 col3">
|
||||
<view @tap="chooseOrderStatus(indexo)" v-for="(itemo,indexo) in myOrderList" :key="indexo">
|
||||
<view class="disac fc posir">
|
||||
<image :src="itemo.src" class="icon-img" mode="aspectFill"></image>
|
||||
<view class="mar-s20 mar-x10">{{itemo.title}}</view>
|
||||
<view class="posia red-num" style="right: 0;top: 0;" v-if="itemo.num!=0">{{itemo.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 -->
|
||||
<image @tap="goPage" class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image>
|
||||
<!-- 功能列表① -->
|
||||
<view class="bacf radius20">
|
||||
<view class="disjbac fon28 col3 fw">
|
||||
<view @tap="goPageNew(indexm)" v-for="(itemm,indexm) in moneyList" :key="indexm" class="mar-s20 mar-x20 width25">
|
||||
<view class="disac fc">
|
||||
<image :src="itemm.src" class="icon-img" mode="aspectFill"></image>
|
||||
<view class="mar-s20 mar-x10">{{itemm.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 功能列表② -->
|
||||
<view class="bacf radius20 mar-s20">
|
||||
<view class="disac fon28 col3 fw">
|
||||
<view @tap="goPageTwo(indexf)" v-for="(itemf,indexf) in toolsList" :key="indexf" class="mar-s20 mar-x20 width25">
|
||||
<view class="disac fc posir">
|
||||
<image :src="itemf.src" class="icon-img" mode="aspectFill"></image>
|
||||
<view class="mar-s20 mar-x10">{{itemf.title}}</view>
|
||||
<view v-if="itemf.title=='消息通知' && itemf.num!=0" class="posia red-num">{{itemf.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 我的二维码弹框 -->
|
||||
<view v-if="isQrcode" class="posAll disjcac">
|
||||
<view>
|
||||
<view class="bacf radius20" style="margin: 0 130rpx;">
|
||||
<view class="fon28 col3 tc pad-s40">我的二维码</view>
|
||||
<image :src="myqr" class="person-m" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disjcac">
|
||||
<image @tap="closeqr" class="mar-s50 close-m" src="/static/public/qrcodec.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 专属客服 -->
|
||||
<view v-if="zCustomer" class="posAll disjcac">
|
||||
<view style="width: 80%;">
|
||||
<view class="bacf radius20 pad-sx40" style="">
|
||||
<view class="fon32 bold col3 tc pad-x40" v-if="customerInfo.service_name!=''">我的专属客服</view>
|
||||
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_name!=''">客服名称:{{customerInfo.service_name}}</view>
|
||||
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_phone!=''">客服手机号:{{customerInfo.service_phone}}<span @tap="countCustomer(customerInfo.service_phone)" class="pcol">联系客服</span></view>
|
||||
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_wechat!=''">客服微信号:{{customerInfo.service_wechat}}<span @tap="copyWechat" class="pcol">复制</span></view>
|
||||
<view style="display: flex;align-items: center;flex-direction: column;width: 100%;">
|
||||
<image v-if="customerImg!=''" :src="customerImg" class="person-m" style="margin-bottom: 40rpx;" mode="aspectFill"></image>
|
||||
<view class="fon28 colf tc radius10" @tap="saveImg" style="width: 200rpx; padding: 16rpx;background-color: #38CE51;margin: 0 auto;">保存</view>
|
||||
</view>
|
||||
<view class="fon28 col9 tc pad-s40" v-if="customerInfo.service_phone==''">暂无专属客服</view>
|
||||
</view>
|
||||
<view class="disjcac">
|
||||
<image @tap="closeCustomer" class="mar-s50 close-m" src="/static/public/qrcodec.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
||||
<!-- 签到弹框 -->
|
||||
<view v-if="isQian" class="sigin-box">
|
||||
<view>{{contentVal}}</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
import empower from '@/components/empower.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{empower},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
tongList:[
|
||||
{num:'0',title:'我的积分'},
|
||||
{num:'0',title:'孔雀币'},
|
||||
{num:'0',title:'连续签到'},
|
||||
{num:'0',title:'我的分享人'}
|
||||
],
|
||||
yuanList:[], //'customer-list','footmarks','scan'
|
||||
zanCyuanList:[
|
||||
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
|
||||
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
|
||||
{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:[//我的订单状态
|
||||
{src:'/static/public/dai-fu60.png',title:'待付款',num:0},
|
||||
{src:'/static/public/dai-fa60.png',title:'待发货',num:0},
|
||||
{src:'/static/public/dai-shou60.png',title:'待收货',num:0},
|
||||
{src:'/static/public/wan-60.png',title:'已完成',num:0},
|
||||
],
|
||||
moneyList:[
|
||||
{src:'/static/public/integral60.png',title:'积分商城'},
|
||||
{src:'/static/public/address60.png',title:'地址管理'},
|
||||
{src:'/static/public/day60.png',title:'日程提醒'},
|
||||
{src:'/static/public/ren60.png',title:'活动任务'},
|
||||
{src:'/static/public/quan60.png',title:'优惠券'},
|
||||
{src:'/static/public/kong60.png',title:'孔雀币'},
|
||||
{src:'/static/public/scor60.png',title:'积分管理'},
|
||||
{src:'/static/public/signIn.png',title:'积分签到'},
|
||||
],
|
||||
toolsList:[
|
||||
{src:'/static/public/staff-yue60.png',title:'自助预约',num:''},
|
||||
{src:'/static/public/staff-hai60.png',title:'个人海报',num:''},
|
||||
{src:'/static/public/staff-collection60.png',title:'收藏',num:''},
|
||||
{src:'/static/public/staff-share.png',title:'分享中心',num:''},
|
||||
{src:'/static/public/staff-msg60.png',title:'消息通知',num:''},
|
||||
{src:'/static/public/diary.png',title:'我的日记',num:''},
|
||||
{src:'/static/public/staff-about60.png',title:'关于我们',num:''},
|
||||
{src:'/static/public/staff-tou60.png',title:'投诉与建议',num:''},
|
||||
],
|
||||
isQrcode:false,//是否显示我的二维码
|
||||
userInfo:{},//用户信息
|
||||
gaoh:uni.getStorageSync('gao'),
|
||||
myqr:'/static/public/qrcode.png',
|
||||
is_worker:'',//是否为职工账号,0否(客户), 1是
|
||||
is_doctor:'',//是否为医生,0否,1是
|
||||
is_servicer:'',//是否为客服,0否,1是
|
||||
is_staff:'',//是否为普通员工,0否,1是
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
isQian:false,
|
||||
bannerList:[],
|
||||
guangImg:'',
|
||||
guanggao:'',
|
||||
userToken:'',
|
||||
contentVal:'',//扫码后的提示内容
|
||||
userPhone:'',
|
||||
timer:null,
|
||||
nonce_str:'',
|
||||
zCustomer:false,
|
||||
customerImg:'',
|
||||
customerInfo:'',
|
||||
times:0,
|
||||
openSettingBtnHidden: true,//是否授权
|
||||
optionObj:{},
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
//相当于监听返回按钮
|
||||
let pages = getCurrentPages();
|
||||
// console.log('pages:',pages);
|
||||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('uinfo')//清空用户缓存信息
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkInfo();
|
||||
uni.removeStorageSync('shareAll')//清空分享中心里的统计信息
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
onUnload() {
|
||||
// 关闭我的二维码弹框
|
||||
this.closeqr();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pages/tabbar/my/staffDuan?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.optionObj = options;
|
||||
uni.setStorageSync('channel',options.channel);
|
||||
if(uni.getStorageSync('gao')==''){
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.gao').boundingClientRect((rect) => {
|
||||
uni.setStorageSync('gao',rect.height)
|
||||
this.gaoh = rect.height
|
||||
}).exec()
|
||||
}
|
||||
this.checkSwi()
|
||||
},
|
||||
methods: {
|
||||
countCustomer(phone){//拨打电话
|
||||
const res = uni.getSystemInfoSync();
|
||||
if(res.platform=='ios'){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:phone,
|
||||
success: () => {},
|
||||
fail: () => {}
|
||||
})
|
||||
} else {
|
||||
uni.showActionSheet({
|
||||
itemList:[phone,'呼叫'],
|
||||
itemColor:'#3875F6',
|
||||
success: (res) => {
|
||||
if(res.tapIndex==1){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:phone
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
copyWechat(){//复制微信号
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
this.$toolAll.tools.clickCopy(this.customerInfo.service_wechat);
|
||||
this.$toolAll.tools.showToast('复制成功');
|
||||
setTimeout(()=>{
|
||||
this.times = 0;
|
||||
},2000)
|
||||
}
|
||||
},
|
||||
saveImg(e){//保存二维码
|
||||
//获取相册授权
|
||||
uni.getSetting({
|
||||
success:(res)=> {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success:()=> {
|
||||
//这里是用户同意授权后的回调
|
||||
this.saveImgToLocal();
|
||||
},
|
||||
fail:()=> {//这里是用户拒绝授权后的回调
|
||||
this.openSettingBtnHidden=false
|
||||
}
|
||||
})
|
||||
} else {//用户已经授权过了
|
||||
this.saveImgToLocal();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
saveImgToLocal(){//保存图片
|
||||
this.$toolAll.tools.showToast('正在保存','loading');
|
||||
uni.downloadFile({
|
||||
url: this.customerImg,//图片地址
|
||||
success: (res) =>{
|
||||
if (res.statusCode === 200){
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: ()=> {
|
||||
this.$toolAll.tools.showToast('保存成功');
|
||||
},
|
||||
fail: ()=> {
|
||||
this.$toolAll.tools.showToast('保存失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tuneUpqr(){//调起二维码弹框
|
||||
this.isQrcode = true;
|
||||
clearInterval(this.timer);
|
||||
this.myqr = '';
|
||||
this.nonce_str='';
|
||||
this.checkGM();
|
||||
this.timer = setInterval(()=>{
|
||||
if(this.nonce_str!=''){
|
||||
this.$requst.post('user/check-scan',{nonce_str:this.nonce_str}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.result==1){
|
||||
this.$toolAll.tools.showToast('已签到');
|
||||
this.isQrcode = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},3000)
|
||||
setTimeout(()=>{
|
||||
this.isQrcode = false;
|
||||
clearInterval(this.timer);
|
||||
},60000)
|
||||
},
|
||||
// 关闭我的二维码弹框
|
||||
closeqr(){
|
||||
this.isQrcode = false;
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
chooseone(index){
|
||||
if(index==2){uni.navigateTo({url:'/pagesA/signIn/signIn'})}
|
||||
if(index==3){uni.navigateTo({url:'/pagesB/mysharer/mysharer'})}
|
||||
},
|
||||
goPageNew(index){
|
||||
if(index==0){uni.navigateTo({url:'/pagesA/pointsMall/pointsMall'})}
|
||||
if(index==1){uni.navigateTo({url:'/pagesA/myAddress/myAddress'})}
|
||||
if(index==2){uni.navigateTo({url:'/pagesB/messagecenter/messagecenter?index=true&comeNum=0'})}
|
||||
if(index==3){uni.navigateTo({url:'/pagesA/activityTask/activityTask'})}
|
||||
if(index==4){uni.navigateTo({url:'/pagesA/coupon/coupon'})}
|
||||
if(index==5){uni.navigateTo({url:'/pagesA/peacockCoin/peacockCoin'})}
|
||||
if(index==6){uni.navigateTo({url:'/pagesA/integralManage/integralManage'})}
|
||||
if(index==7){uni.navigateTo({url:'/pagesA/signIn/signIn'})}
|
||||
},
|
||||
goPageTwo(index){//自助预约、个人海报、收藏、分享中心、消息通知、我的日记、投诉与建议、关于我们、专属客服
|
||||
let newUrl = ''
|
||||
if(this.toolsList[index].title=='自助预约') newUrl = '/pagesA/makeAnPppointment/makeAnPppointment'
|
||||
if(this.toolsList[index].title=='个人海报') newUrl = '/pagesB/personalPoster/personalPoster'
|
||||
if(this.toolsList[index].title=='收藏') newUrl = '/pagesB/myCollection/myCollection'
|
||||
if(this.toolsList[index].title=='分享中心') newUrl = '/pagesB/sharingCenter/sharingCenter'
|
||||
if(this.toolsList[index].title=='消息通知') newUrl = '/pagesB/messagecenter/messagecenter?comeNum=0'
|
||||
if(this.toolsList[index].title=='我的日记') newUrl = '/pagesA/my-diary/my-diary'
|
||||
if(this.toolsList[index].title=='关于我们') newUrl = '/pagesB/aboutUs/aboutUs'
|
||||
if(this.toolsList[index].title=='投诉与建议') newUrl = '/pagesA/suggestions/suggestions'
|
||||
if(this.toolsList[index].title=='专属客服'){
|
||||
this.$requst.post('user/my-service').then(res=>{
|
||||
if(res.code==0){
|
||||
this.customerInfo = res.data;
|
||||
if(this.customerInfo.service_qr!=''){
|
||||
this.customerImg = this.$http + this.customerInfo.service_qr;
|
||||
}
|
||||
this.zCustomer = true;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:newUrl
|
||||
})
|
||||
}
|
||||
},
|
||||
closeCustomer(){
|
||||
this.zCustomer = false;
|
||||
},
|
||||
chooseOrderStatus(index){
|
||||
let statusIndex = ''
|
||||
if(index==0) statusIndex = 1;
|
||||
if(index==1) statusIndex = 2;
|
||||
if(index==2) statusIndex = 4;
|
||||
if(index==3) statusIndex = 5;
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder?index='+statusIndex
|
||||
})
|
||||
},
|
||||
goPage(){
|
||||
uni.navigateTo({
|
||||
url:this.guanggao
|
||||
})
|
||||
},
|
||||
checkSwi(){
|
||||
checkBanner({position:'personal-center-banner'}).then(res=>{
|
||||
// console.log('res',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
this.guangImg = this.$http + res.data[0].src
|
||||
this.guanggao = res.data[0].url
|
||||
// res.data.forEach(item=>{
|
||||
// let isVideo = false
|
||||
// if(item.type!='img') isVideo = true
|
||||
// let banObj = {
|
||||
// imgSrc:this.$http + item.src,
|
||||
// url:item.url,
|
||||
// isVideo:isVideo,
|
||||
// poster:this.$http + item.src,
|
||||
// }
|
||||
// this.bannerList.push(banObj)
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkGM(){//查询个人二维码事件
|
||||
uni.showToast({
|
||||
title:'正在生成二维码',
|
||||
icon:'none',
|
||||
duration:100000
|
||||
})
|
||||
this.$requst.post('user/personal-qr').then(res=>{
|
||||
// console.log('个人二维码:',res);
|
||||
if(res.code==0){
|
||||
this.nonce_str = res.data.nonce_str;
|
||||
base64ToPath(res.data.qr).then(path => {
|
||||
this.myqr = path
|
||||
uni.hideToast();
|
||||
uni.setStorageSync('imgSrc',path)
|
||||
}).catch(error => {})
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkInfo(){
|
||||
this.$requst.post('user/info').then(res=>{
|
||||
// console.log('用户信息:',res);
|
||||
if(res.code==0 && res.data.length!=0) {
|
||||
this.userInfo = res.data;
|
||||
uni.setStorageSync('userId',res.data.id);
|
||||
uni.setStorageSync('phone',this.userInfo.mobile);
|
||||
this.userPhone = this.$toolAll.tools.hideMPhone(this.userInfo.mobile)
|
||||
this.tongList[0].num = res.data.score;//个人积分
|
||||
this.tongList[1].num = res.data.coin;//个人孔雀币
|
||||
this.tongList[2].num = res.data.continuity_sign;//个人连续签到
|
||||
this.tongList[3].num = res.data.share_users.total;//分享人总数
|
||||
this.toolsList[4].num = res.data.unread_messages;//消息总数
|
||||
this.toolsList[5].num = res.data.unread_messages;//消息总数
|
||||
this.myOrderList[0].num = res.data.order_count.waiting;//待支付总数
|
||||
this.myOrderList[1].num = res.data.order_count.paid;//待发货总数
|
||||
this.myOrderList[2].num = res.data.order_count.shipped;//待收货总数
|
||||
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.customer_service!=0 && this.toolsList.length==8){
|
||||
this.toolsList.unshift({src:'/static/public/customer-check.png',title:'专属客服',num:''})
|
||||
}
|
||||
uni.setStorageSync('shareAll',res.data)
|
||||
if(res.data.rules.length!=0){
|
||||
let result = this.zanCyuanList.filter(item => res.data.rules.some(itemt => itemt===item.rule))
|
||||
this.yuanList = result
|
||||
uni.setStorageSync('rules',res.data.rules)
|
||||
} else this.yuanList = []
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseYitem(index){//员工功能事件
|
||||
// console.log('当前选项:',this.yuanList[index].title);
|
||||
if(this.yuanList[index].title=='客户列表') {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/customerList/customerList'
|
||||
})
|
||||
}
|
||||
if(this.yuanList[index].title=='用户足迹') {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/userFootprint/userFootprint'
|
||||
})
|
||||
}
|
||||
if(this.yuanList[index].title=='扫码签到') {
|
||||
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
||||
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
fail: (res) => {}, //接口调用失败的回调函数
|
||||
onlyFromCamera: false, //是否只能从相机扫码,不允许从相册选择图片,这里是只允许相机扫码
|
||||
scanType: ['qrCode'], // scanType:扫码类型 : 二维码
|
||||
success: (rt) => { // 接口调用成功的回调函数
|
||||
if(rt.result.slice(0,1)=='{'){
|
||||
let uc = JSON.parse(rt.result).user_coding;
|
||||
let ns = JSON.parse(rt.result).nonce_str;//随机码
|
||||
console.log(rt);
|
||||
this.$requst.post('user/sign-in',{user_coding:uc,nonce_str:ns}).then(res=>{
|
||||
// console.log('执行扫码事件:',res);
|
||||
if(res.code==0){
|
||||
this.isQian = true;
|
||||
this.contentVal = "签到成功";
|
||||
setTimeout(()=>{
|
||||
this.isQian = false
|
||||
},2000)
|
||||
}
|
||||
},error=>{})
|
||||
} else this.$toolAll.tools.showToast('请出示正确的码');
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.yuanList[index].title=='核销扫码') {
|
||||
wx.scanCode({ // 微信扫码 调起客户端扫码界面进行扫码
|
||||
complete: (res) => {}, //接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
fail: (res) => {}, //接口调用失败的回调函数
|
||||
onlyFromCamera: false, //是否只能从相机扫码,不允许从相册选择图片,这里是只允许相机扫码
|
||||
scanType: ['qrCode'], // scanType:扫码类型 : 二维码
|
||||
success: (rt) => { // 接口调用成功的回调函数
|
||||
let narr = rt.result.split('H');
|
||||
if(narr[1]=='true'){//体验券核销
|
||||
this.$requst.post('staff/coupon/write-off-experience-coupon',{coupon_id:narr[0],secret:narr[2],account_id:narr[3]}).then(res=>{
|
||||
this.isQian = true
|
||||
if(res.code==0){
|
||||
this.contentVal = "核销成功";
|
||||
} else {
|
||||
this.contentVal = res.msg;
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.isQian = false
|
||||
},2000)
|
||||
},error=>{})
|
||||
} else {//订单核销
|
||||
this.$requst.post('order/check',{order_coding:narr[0],id:narr[1],check_user:this.userInfo.id}).then(res=>{
|
||||
this.isQian = true
|
||||
if(res.code==0){
|
||||
this.contentVal = "核销成功";
|
||||
} else {
|
||||
this.contentVal = res.msg;
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.isQian = false
|
||||
},2000)
|
||||
},error=>{})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if( this.yuanList[index].title=='客服查询') {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/customerCheck/customerCheck'
|
||||
})
|
||||
}
|
||||
},
|
||||
goNodifyData(){//去修改资料页面
|
||||
uni.setStorageSync('uinfo',this.userInfo)
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/nodifyData/nodifyData'
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,522 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<view class="status-box statusHNH">
|
||||
<view :style="{height:statusBarHeight+'px',background:publicColor}"></view>
|
||||
<view class="status-nav" :style="{background:publicColor}">
|
||||
<!-- 标题 -->
|
||||
<view class="tab-title tcenter" style="color: #FFFFFF;">首页</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList"></foot-tab>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const {log} = console;
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import wfallsFlow from '@/components/wfalls-flow'
|
||||
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
wfallsFlow
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
searchVal:'',//输入框的值
|
||||
publicColor:'',//主题颜色
|
||||
gonggList:[//九宫格列表
|
||||
],
|
||||
fwList:[//热搜关键词
|
||||
],
|
||||
kcurrent:0,//默认选中第一项
|
||||
ktList:[//恒美小课堂
|
||||
],
|
||||
dataList:[//小课堂数据列表
|
||||
],
|
||||
showTop:false,
|
||||
newCurrent:0,
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
course_id:0,
|
||||
isLoading:false,
|
||||
isShowT:true,
|
||||
titleList:[],//底部导航文字
|
||||
imgList:[],//底部导航图标
|
||||
gaoone:{},
|
||||
gaotwo:{},
|
||||
gaothree:{},
|
||||
isNet:true,
|
||||
wuNet:'当前无网络连接',
|
||||
refTime:'',
|
||||
reNum:0,
|
||||
bannerList:[],//轮播图
|
||||
isAutoPlay:false,
|
||||
jieDuan:false,
|
||||
isNewRenderDone:false ,//锁的作用
|
||||
isQuan:uni.getStorageSync('isQuan'),
|
||||
quanImg:uni.getStorageSync('quanImg'),
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkKT()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShow() {
|
||||
uni.setStorageSync('firstTime',1);
|
||||
log('输出的解构')
|
||||
this.checkNet()
|
||||
this.$toolAll.tools.isLogin()
|
||||
let maiOjb = {
|
||||
e:6,//进入首页
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if(uni.getStorageSync('token')!='' && uni.getStorageSync('chu')=='') {
|
||||
this.$toolAll.tools.daoTime()
|
||||
uni.setStorageSync('chu',1)
|
||||
}
|
||||
this.checkKT()//恒美课堂列表
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let maiOjb = {
|
||||
e:6,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: '成都恒美毛发', // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.$toolAll.tools.isVedio();
|
||||
if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv(options);
|
||||
} else if(options.q!=undefined){
|
||||
// 解码一:unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1");
|
||||
// 解码二:decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
|
||||
let str = unescape(options.q);
|
||||
// console.log(str);
|
||||
let len1 = str.indexOf('invite_code=');
|
||||
let len2 = str.indexOf('channel=');
|
||||
let len3 = str.indexOf('source_code=');
|
||||
let newInvite = '';
|
||||
let newChanel = '';
|
||||
let newsource_code = '';
|
||||
if(len1!=-1) newInvite = str.slice((len1+12),(len1+12+32));
|
||||
if(len2!=-1) newChanel = str.slice((len2+8),(len2+8+8));
|
||||
if(len3!=-1) newsource_code = str.slice((len3+12),(len3+12+32));
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:newInvite,//用户邀请码
|
||||
channel:newChanel,
|
||||
source_code:newsource_code
|
||||
}
|
||||
// console.log(params);
|
||||
this.$requst.post('user/login',params).then(res => {console.log('调用成功');},error => {})
|
||||
},
|
||||
});
|
||||
} else if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options);
|
||||
} else {
|
||||
this.$toolAll.tools.overdue()
|
||||
}
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// log('状态栏+标题栏:',rect.height);
|
||||
uni.setStorageSync('statusHNH',rect.height)
|
||||
this.statusHNH = rect.height
|
||||
}).exec()
|
||||
this.checkBCate();
|
||||
this.checkKey();
|
||||
this.checkSwi();//查询轮播图
|
||||
// this.checkBanner()//调用轮播图查询事件
|
||||
this.$toolAll.tools.buriedPointAll();//查询需要埋点的事件id
|
||||
// this.checkQ();
|
||||
setTimeout(()=>{
|
||||
this.quanImg= uni.getStorageSync('quanImg');
|
||||
this.quanId = uni.getStorageSync('quanId');
|
||||
},3000)
|
||||
this.checkUserInfo();
|
||||
},
|
||||
methods: {
|
||||
loginEv(option){
|
||||
console.log(option,'option');
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:option.invite_code || '',//用户邀请码
|
||||
source_code:option.source_code || '',
|
||||
channel:option.channel || ''
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {console.log('调用成功');},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
checkUserInfo(){
|
||||
this.$requst.post('user/info').then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.phone_active!=0){
|
||||
uni.setStorageSync('phone_active',res.data.phone_active);
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.isLogin()
|
||||
}
|
||||
})
|
||||
},
|
||||
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)
|
||||
}
|
||||
if(res.code==302){
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
},1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeEv(){
|
||||
this.isQuan = false;
|
||||
uni.setStorageSync('isQuan',false);
|
||||
},
|
||||
// 顶部轮播查询事件
|
||||
checkSwi(){
|
||||
checkBanner({position:'home-banner'}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let isVideo = false
|
||||
if(item.type!='img') isVideo = true
|
||||
let banObj = {
|
||||
imgSrc:this.$http + item.src,
|
||||
url:item.url,
|
||||
isVideo:isVideo,
|
||||
poster:this.$http + item.src,
|
||||
}
|
||||
this.bannerList.push(banObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkNet(){
|
||||
uni.getNetworkType({
|
||||
success: (res)=> {
|
||||
if(res.networkType=='none'){
|
||||
uni.setStorageSync('isNet',false)
|
||||
this.isNet = false
|
||||
if((this.reNum++)==5){
|
||||
clearInterval(this.refTime)
|
||||
this.wuNet = '刷新失败'
|
||||
this.reNum = 0
|
||||
}
|
||||
this.publicColor = uni.getStorageSync('publicColor')
|
||||
} else {
|
||||
uni.setStorageSync('isNet',true)
|
||||
this.isNet = true
|
||||
clearInterval(this.refTime)
|
||||
if(this.wuNet == '正在刷新...') {
|
||||
getCurrentPages()[getCurrentPages().length - 1].onLoad()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh(){
|
||||
this.wuNet = '正在刷新...'
|
||||
this.refTime = setInterval(()=>{
|
||||
this.checkNet()
|
||||
},1000)
|
||||
},
|
||||
bangd(){//绑定客服事件
|
||||
this.$requst.post('').then(res=>{log('绑定客服:',res);},error=>{})
|
||||
},
|
||||
tapChoose(index){//宫格下的,三张图点击事件
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
let newUrl = ''
|
||||
if(index==0) newUrl = this.gaoone.url
|
||||
if(index==1) newUrl = this.gaotwo.url
|
||||
if(index==2) newUrl = this.gaothree.url
|
||||
uni.navigateTo({
|
||||
url:newUrl
|
||||
})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
checkKey(){//查询热搜关键词事件
|
||||
this.$requst.get('index/hot-keywords').then(res=>{
|
||||
// log('关键词列表:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let reObj = {title:item.keyword}
|
||||
this.fwList.push(reObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkBCate(){//查询底部事件、八宫格、
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.recommend.length!=0){//宫格
|
||||
res.data.recommend.forEach(item=>{
|
||||
let bcObj = {
|
||||
src:this.$http + item.icon,
|
||||
url:item.link,
|
||||
title:item.name
|
||||
}
|
||||
this.gonggList.push(bcObj)
|
||||
})
|
||||
this.gonggList.push({src:this.$http + res.data.recommendMore,title:'更多'})
|
||||
}
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
}
|
||||
if(res.data.ad.length!=0){//三张图
|
||||
this.gaoone = {
|
||||
imgSrc:this.$http + res.data.ad[0].img,
|
||||
url:res.data.ad[0].link,
|
||||
}
|
||||
this.gaotwo = {
|
||||
imgSrc:this.$http + res.data.ad[1].img,
|
||||
url:res.data.ad[1].link,
|
||||
}
|
||||
this.gaothree = {
|
||||
imgSrc:this.$http + res.data.ad[2].img,
|
||||
url:res.data.ad[2].link,
|
||||
}
|
||||
}
|
||||
// this.publicColor = res.data.mainColor
|
||||
this.publicColor = uni.getStorageSync('publicColor')
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkKT(){//查询恒美小课堂
|
||||
let parmas = {
|
||||
course_id:this.course_id,//课堂ID
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/course',parmas).then(res=>{
|
||||
// log('恒美小课堂列表:',res);
|
||||
if(res.code==0){
|
||||
// 课堂栏目
|
||||
if(res.data.course.length!=0){
|
||||
this.ktList = []
|
||||
res.data.course.forEach(item=>{
|
||||
let lObj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
active:item.active
|
||||
}
|
||||
this.ktList.push(lObj)
|
||||
})
|
||||
}
|
||||
// 课堂列表
|
||||
if(this.page==1) this.dataList = []
|
||||
if(res.data.list.list.length!=0){
|
||||
this.total = res.data.list.total
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let ktObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏数量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//内容标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(ktObj)
|
||||
})
|
||||
}
|
||||
this.isLoading = true
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
this.dataList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
}
|
||||
},
|
||||
comfirmev(e){//确认取消收藏事件
|
||||
this.dataList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
},
|
||||
// chooseLike(e){//收藏事件
|
||||
// // log(this.dataList[e].is_collected);
|
||||
// let active = ''
|
||||
// this.dataList.forEach((item,index)=>{
|
||||
// if(e==item.id){
|
||||
// active = index
|
||||
// }
|
||||
// })
|
||||
// if(this.dataList[active].is_collected==0){
|
||||
// this.dataList[active].is_collected = 1
|
||||
// // 调用收藏事件
|
||||
// collectionEV({action:'collect',archive_id:e})
|
||||
// }
|
||||
// },
|
||||
// comfirmev(e){//确认取消收藏事件
|
||||
// let active = ''
|
||||
// this.dataList.forEach((item,index)=>{
|
||||
// if(e==item.id){
|
||||
// active = index
|
||||
// }
|
||||
// })
|
||||
// this.dataList[active].is_collected = 0
|
||||
// this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// // 调用取消收藏事件
|
||||
// cancleCollectionEV({action:'collect',archive_id:e})
|
||||
// },
|
||||
chooseGon(index){//宫格事件
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
if(index==(this.gonggList.length-1)){
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/cate/cate'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({url:this.gonggList[index].url})
|
||||
}
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
choosecateEv(e){//恒美小课堂选择事件
|
||||
// log('恒美小课堂:',e);
|
||||
this.newCurrent = e
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.course_id = this.ktList[e].id
|
||||
this.checkKT()
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
// log(this.searchVal);
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
|
||||
})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
},
|
||||
chooseReEv(index){
|
||||
if(!this.jieDuan){
|
||||
let isAuth = this.$toolAll.tools.returnAuth()
|
||||
if(!isAuth){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/searchPage/searchPage?keyWorld='+this.fwList[index].title
|
||||
})
|
||||
} else this.jieDuan = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,588 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'商城'" :statusBack="false" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义轮播 -->
|
||||
<view :style="{marginTop:statusHNH+'px'}">
|
||||
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay"></swiper-pu>
|
||||
</view>
|
||||
<!-- 搜索输入框 -->
|
||||
<view class="search-input-box bacf shop-nav-box" :style="{top: statusHNH+'px',position:positionMode}" style="padding-top: 10rpx;left: 0;right: 0;z-index: 3;">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<!-- 输入框 -->
|
||||
<input 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>
|
||||
<!-- 分类标题 -->
|
||||
<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-if="bingVal!=''">{{bingVal}}<view class="mar-z10" @tap="deleteSX(0)">×</view></view>
|
||||
<view v-if="doctorVal!=''">{{doctorVal}}<view class="mar-z10" @tap="deleteSX(1)">×</view></view>
|
||||
<view v-if="activityVal!=''">{{activityVal}}<view class="mar-z10" @tap="deleteSX(2)">×</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.stop="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>
|
||||
<view class="posir">
|
||||
<input disabled @tap="chooseEv" type="text" class="mar-x40" v-model="doctor_name" placeholder="请输入医生姓名并选择" />
|
||||
<view v-if="showDoctor" class="posia" style="top: 52px;left: 0;right: 0;border: 1rpx solid #E6E6E6;padding: 20rpx;background: #FFFFFF;">
|
||||
<view @tap="chooseDoctor(index)" class="disjbac fon28 col9" v-for="(item,index) in doctorList" :key="index">
|
||||
<span>姓名:{{item.doctor_extra.name}}</span>
|
||||
<!-- <span>部门:{{item.doctor_extra.skill}}</span> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 重置、筛选 -->
|
||||
<view class="disjbac pad-zy20 mar-s50 mar-x30 pad-s20">
|
||||
<view @tap="chongz">重置</view>
|
||||
<view @tap.stop="shaix">筛选</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isXiao" @tap="isXiao=false" class="moban"></view>
|
||||
<!-- 数据列表 -->
|
||||
<!-- <view v-if="loading" :style="{marginTop:statusHNH+titleHeight+(isClick?52:0)+'px'}"> -->
|
||||
<view v-if="loading" :style="{marginTop:(gaodu==200?titleHeight : 0)+'px'}">
|
||||
<view v-if="dataList.length!=0 && search_result" class="pad20 ">
|
||||
<view style="width: 48.6%;float: left;" class="pad-x180">
|
||||
<view v-if="index1%2==0" v-for="(item1,index1) in dataList" :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="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.isXian || item1.isPing || item1.isTuan" class="fon24" style="text-decoration: line-through;color: #C7C7C7;">¥{{item1.yuanPrice}}</view> -->
|
||||
<view 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 || item1.isPing || item1.isTuan" class="fon24 col80 mar-s20">结束时间:{{item1.activity_end_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 48.6%;float: right;" class="pad-x180">
|
||||
<view v-if="index1%2!=0" v-for="(item1,index1) in dataList" :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="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 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 || item1.isPing || item1.isTuan" 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>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多商品列表`"></nothing-page>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='3'></foot-tab>
|
||||
<!-- 购物车 -->
|
||||
<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>
|
||||
<!-- 弹框授权 -->
|
||||
<auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import shopList from '@/components/shop-list.vue';
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import {cartNum,checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
shopList,
|
||||
swiperPu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
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,
|
||||
doctorList:[],
|
||||
showDoctor:false,
|
||||
timeList:[],//时间列表
|
||||
zanArr:[],
|
||||
timer:null,
|
||||
search_result:false,
|
||||
bingVal:'',
|
||||
doctorVal:'',
|
||||
activityVal:'',
|
||||
bannerList:[],//轮播图
|
||||
isAutoPlay:false,
|
||||
optionObj:{},
|
||||
positionMode:'sticky',
|
||||
gaodu:0
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.cartNumEv();//查询购物车数量
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if(e.scrollTop>=200){
|
||||
this.positionMode = "fixed";
|
||||
this.gaodu = 200;
|
||||
} else {
|
||||
this.positionMode = "sticky";
|
||||
this.gaodu = 0;
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pages/tabbar/shop/shop?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.optionObj = options;
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect.height);
|
||||
this.titleHeight = rect.height;
|
||||
}).exec()
|
||||
this.checkSX();
|
||||
let maiOjb = {
|
||||
e:12,//进入商城
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
// 调用查询轮播事件
|
||||
this.checkSwi();
|
||||
},
|
||||
methods: {
|
||||
// 顶部轮播查询事件
|
||||
checkSwi(){
|
||||
checkBanner({position:'home-banner'}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let isVideo = false
|
||||
if(item.type!='img') isVideo = true
|
||||
let banObj = {
|
||||
imgSrc:this.$http + item.src,
|
||||
url:item.url,
|
||||
isVideo:isVideo,
|
||||
poster:this.$http + item.src,
|
||||
}
|
||||
this.bannerList.push(banObj)
|
||||
})
|
||||
console.log(this.bannerList);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseDoctor(index){//选择医生
|
||||
this.shaiList = [];
|
||||
this.doctor_name = this.doctorList[index].doctor_extra.name;
|
||||
this.shaiList.push(this.doctor_name);
|
||||
this.showDoctor = false;
|
||||
},
|
||||
chooseEv(){//查询医生列表
|
||||
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.doctor_name = '';
|
||||
if(res.data.list.length!=0){
|
||||
this.showDoctor = true;
|
||||
this.doctorList = res.data.list;
|
||||
} else this.$toolAll.tools.showToast('暂无医生可选');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
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.doctor_name = '';//清空医生列表
|
||||
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 keyWord = this.searchVal;
|
||||
if(this.shaiList.length!=0) keyWord = this.shaiList.filter(item=>item!=null).join(',');
|
||||
let params = {
|
||||
keyword:'',//商品关键字 支持模糊搜索
|
||||
page:1,
|
||||
size:2000,
|
||||
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:`${getApp().globalData.domainName}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
clearInterval(this.timer);
|
||||
// if(this.page==1) {
|
||||
this.zanArr = [];
|
||||
this.dataList = [];
|
||||
this.timeList = [];
|
||||
// }
|
||||
this.total = res.data.total;
|
||||
if(res.data.data.list.length!=0){
|
||||
res.data.data.list.forEach(item=>{
|
||||
let tuan = false,ping = false,xian = false,integral = false;
|
||||
if(item.activity_type=='group_make') ping = true;
|
||||
if(item.activity_type=='group_buy') tuan = true;
|
||||
if(item.activity_type=='limit_time') xian = true;
|
||||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc: this.$http + item.cover,
|
||||
title: item.name,
|
||||
zhePrice:item.price/100,
|
||||
yuanPrice:item.original_price/100,
|
||||
integral:'',
|
||||
isTuan:tuan,//是否是团购
|
||||
isPing:ping,//是否是拼团活动
|
||||
isXian:xian,//是否是限时活动
|
||||
isIntegral:integral,//是否是积分
|
||||
grade:'',
|
||||
disease_name:item.disease_name,//病种名称
|
||||
reponseTime:res.header.Date,//接口响应时间
|
||||
activity_end_at:item.activity_end_at,//限时结束时间
|
||||
activity_group_cover:group_cover,//参团人的头像
|
||||
activity_group_num:item.activity_group_num,//已经参团人数
|
||||
activity_id:item.activity_id,
|
||||
spu_type:item.spu_type//是否是虚拟商品
|
||||
}
|
||||
this.zanArr.push(obj)
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.activity_end_at!='') {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
reponseTime:item.reponseTime,
|
||||
time:item.activity_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList.length!=0){
|
||||
this.$toolAll.tools.showToast('加载中...')
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
this.timeList[index].reponseTime = new Date(this.timeList[index].reponseTime).getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(this.timeList[index].reponseTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.zanArr[item.nIndex].activity_end_at = "活动已结束";
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
this.dataList = this.zanArr;
|
||||
this.search_result = true;
|
||||
this.loading = true;
|
||||
},1000)
|
||||
} else {
|
||||
this.dataList = this.zanArr;
|
||||
this.search_result = true;
|
||||
this.loading = true;
|
||||
}
|
||||
} else {
|
||||
this.search_result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
let is_activity = 0;
|
||||
let shopId = 0;
|
||||
if(this.dataList[index].isTuan==true || this.dataList[index].isPing==true || this.dataList[index].isXian==true) {
|
||||
is_activity = 1;
|
||||
shopId = this.dataList[index].activity_id;
|
||||
} else {
|
||||
shopId = id;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${shopId}&isIntegral=${this.dataList[index].isIntegral}&is_activity=${is_activity}`
|
||||
})
|
||||
},
|
||||
chooseBing(index){//小分类选择事件
|
||||
this.bingzList.forEach(item=>{
|
||||
item.isActive = false;
|
||||
})
|
||||
this.bingzList[index].isActive = true;
|
||||
|
||||
// 病种id
|
||||
if(this.activeIndex===0) {
|
||||
this.disease_id = this.bingzList[index].id;
|
||||
this.bingVal = this.bingzList[index].title;
|
||||
}
|
||||
// 医生职位
|
||||
if(this.activeIndex===1) {
|
||||
this.doctor_role = this.bingzList[index].name;
|
||||
this.doctorVal = this.bingzList[index].title;
|
||||
}
|
||||
// 活动type
|
||||
if(this.activeIndex===2) {
|
||||
this.activity = this.bingzList[index].name;
|
||||
this.activityVal = this.bingzList[index].title;
|
||||
}
|
||||
},
|
||||
chongz(){//重置
|
||||
this.isClick = false;
|
||||
this.bingVal = '';
|
||||
this.doctorVal = '';
|
||||
this.activityVal = '';
|
||||
},
|
||||
shaix(){//筛选
|
||||
this.isXiao = false
|
||||
this.isClick = true;
|
||||
this.checkShopList();
|
||||
},
|
||||
deleteSX(index){//删除筛选
|
||||
if(index==0) {
|
||||
this.disease_id = '';
|
||||
this.bingVal = '';
|
||||
}
|
||||
if(index==1) {
|
||||
this.doctor_role = '';
|
||||
this.doctorVal = '';
|
||||
}
|
||||
if(index==2) {
|
||||
this.activity = '';
|
||||
this.activityVal = '';
|
||||
}
|
||||
if(this.activity=='' && this.doctorVal == '' && this.activityVal == ''){
|
||||
this.isClick = false;
|
||||
}
|
||||
this.checkShopList();
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopSearch/shopSearch?keyWorld=${this.searchVal}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{background: #F5F5F5;}
|
||||
.activecate,.shopMo{width: 216rpx;height: 65rpx;border-radius: 20rpx;line-height: 65rpx;text-align: center;background-color: #f2f2f2;color: #333333;}
|
||||
.activecate{color: #FFFFFF;}
|
||||
.shopMo span::after,.activecate span::after{display: inline-block;content: '';width: 16rpx;height: 13rpx;margin-left: 6rpx;}
|
||||
.shopMo span::after{background: url(/static/public/shopSJ.png) no-repeat;background-size: 100% 90%;}
|
||||
.activecate span::after{background: url(/static/public/shopSJ-active.png) no-repeat;background-size: 100% 90%;transform: rotate(180deg);background-position: 0 2rpx;}
|
||||
</style>
|
|
@ -0,0 +1,250 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'活动任务'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x20">
|
||||
<!-- 签到领积分 -->
|
||||
<view v-for="(item,index) in activityList" :key="index" class="bacf radius20 pad20 mar-s20">
|
||||
<view class="bold col3 disjbac">
|
||||
<view class="disac">
|
||||
<image :src="item.imgSrc" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
|
||||
<view class="fon28">{{item.title}}</view>
|
||||
</view>
|
||||
<view><span style="color: #3875F6;">{{item.danc}}</span>/{{item.allc}}</view>
|
||||
</view>
|
||||
<view class="fon24" style="color: #808080;">
|
||||
<view class="mar-s30">活动要求:{{item.description}}</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">开始时间:{{item.startTime}}</view>
|
||||
<view class="mar-s20">结束时间:{{item.endTime}}</view>
|
||||
</view>
|
||||
<view class="disjcac">
|
||||
<!-- 线上签到 -->
|
||||
<view v-if="item.ntype=='sign_in'" class="disja">
|
||||
<view v-if="item.danc!=item.allc" @tap="goTosigin" class="mar-s30 activity-dai">立即签到</view>
|
||||
<view v-if="item.danc==item.allc && item.account_status!=1" @tap="btnEv(index)" class="mar-s30 activity-mo" style="background: #f8bf2c;">立即完成</view>
|
||||
<view v-if="item.danc==item.allc && item.account_status==1" class="activity-mo mar-s30">已完成</view>
|
||||
</view>
|
||||
<!-- 分享截图任务 -->
|
||||
<view v-if="item.ntype=='share_screenshots'" class="disja">
|
||||
<!-- <view @tap="btnEv(index)" class="activity-dai mar-s30">立即完成</view> -->
|
||||
<view v-if="item.account_status==3 || item.account_status==4" @tap="btnEv(index)" class="activity-dai mar-s30">立即完成</view>
|
||||
<view v-if="item.account_status==0" class="activity-mo mar-s30">审核中...</view>
|
||||
<view v-if="item.account_status==2" @tap="btnEv(index)" class="activity-dai mar-s30">审核不通过,重新提交审核</view>
|
||||
<view v-if="item.account_status==1" class="activity-mo mar-s30">已完成</view>
|
||||
</view>
|
||||
<!-- 线下签到 -->
|
||||
<view v-if="item.ntype=='offline_sign_in'" class="disja">
|
||||
<view v-if="item.account_status==4" @tap="btnEv(index)" class="mar-s30 activity-dai">立即完成</view>
|
||||
<view v-else class="activity-mo mar-s30">已完成</view>
|
||||
</view>
|
||||
<!-- 分享注册任务 -->
|
||||
<view v-if="item.ntype=='share'">
|
||||
<view v-if="item.account_status==4" @tap="btnEv(index)" class="mar-s30 activity-dai">立即完成</view>
|
||||
<view v-else class="activity-mo mar-s30">已完成</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 上传截图弹框 -->
|
||||
<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=" disjcac fc">
|
||||
<view class="fon32 col3 mar-s30 mar-x40">截图上传</view>
|
||||
<view v-if="upImg==''" @tap="chooseImg" class="task-add-box disjcac fc">
|
||||
<view class="posir disjcac mar-s50">
|
||||
<view class="posia task-add" style="transform: rotate(90deg);"></view>
|
||||
<view class="posia task-add"></view>
|
||||
</view>
|
||||
<view class="fon28 col9" style="margin-top: 120rpx;">点击上传截图</view>
|
||||
</view>
|
||||
<image v-else @tap="chooseImg" class="imgIng" :src="upImg" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disjbac mar-x20 tc">
|
||||
<view @tap.stop="isScreenshot=false,upImg=''" class="task-cancle-btn">取消</view>
|
||||
<view @tap.stop="shareEv" class="task-confrim-btn">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isScreenshot:false,
|
||||
upImg:'',
|
||||
chooseIndex:0,
|
||||
activityList:[],//活动列表
|
||||
isNum:0,
|
||||
siginVal:'立即签到',
|
||||
partakeVal:'立即完成',
|
||||
optionObj:{},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkList();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pages/tabbar/shop/shop?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.optionObj = options;
|
||||
},
|
||||
methods: {
|
||||
btnEv(index){
|
||||
this.chooseIndex = index;
|
||||
if(this.activityList[index].ntype=='share_screenshots' && (this.activityList[index].account_status!=0 || this.activityList[index].account_status==2)){//分享截图测试
|
||||
this.isScreenshot = true;
|
||||
}
|
||||
if(this.activityList[index].ntype=='offline_sign_in' && this.activityList[index].account_status==4){//线下签到
|
||||
this.$toolAll.tools.showToast('请先完成任务,再来领取')
|
||||
}
|
||||
if(this.activityList[index].ntype=='share' && this.activityList[index].account_status==4){//分享注册任务
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/personalPoster/personalPoster'
|
||||
})
|
||||
}
|
||||
if(this.activityList[index].danc == this.activityList[index].allc) {
|
||||
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;
|
||||
this.checkList();
|
||||
} else {
|
||||
setTimeout(()=>{
|
||||
this.isNum = 0;
|
||||
},2000)
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.isNum = 0;
|
||||
},2000)
|
||||
},
|
||||
checkList(){//查询任务列表
|
||||
this.$requst.post('task/task/task-list').then(res=>{
|
||||
if(res.code==0){
|
||||
this.activityList = [];
|
||||
if(res.data.length!=0){
|
||||
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,
|
||||
startTime:item.start_at,//开始时间
|
||||
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'型 分享 签到 线下签到 分享截图
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseImg(){//选择图片事件
|
||||
uni.chooseImage({
|
||||
count:1,
|
||||
sourceType:['album'],
|
||||
success: (res) => {
|
||||
this.upImg = res.tempFilePaths[0];
|
||||
this.$requst.upload('file/upload/image',{file:this.upImg}).then(res=>{
|
||||
this.upImg = this.$http + res.data.src;
|
||||
this.$toolAll.tools.showToast('图片上传成功(*^▽^*)')
|
||||
this.isNum = 1;
|
||||
},error=>{})
|
||||
}
|
||||
})
|
||||
},
|
||||
shareEv(){//确认上传凭证
|
||||
if(this.isNum==1) {
|
||||
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>
|
||||
|
||||
<style>
|
||||
.isWen{color: #3875F6;}
|
||||
.isWen::after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 8rpx;
|
||||
width: 80%;
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #3875F6;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,199 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'优惠券'" :statusTitle="true"></status-nav>
|
||||
<view id="daoh" class="bacf pad-zy40 pad-sx20 isTopf fon28 col3 disjbac" :style="{top:statusHNH+'px'}">
|
||||
<view @tap="chooseNav(indexn)" :class="isStatus==indexn?'isWen bold':''" class="posir" v-for="(itemn,indexn) in navList" :key="indexn">{{itemn}}</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
||||
<view class="pad-x30">
|
||||
<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 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-else class="posia quan-img" src="/static/public/quan-left.png" mode=""></image>
|
||||
<view class="posir disjcac fc" style="z-index: 1;">
|
||||
<view class="fon28 mar-s20 mar-x36"><span v-if="!item.isTiyan && !item.isZhek">¥</span><span class="bold" style="font-size: 56rpx;">{{item.num}}</span></view>
|
||||
<view v-if="item.statusNum==0 || item.statusNum==2" @tap="useEv(index)" class="fon24 quan-btn">{{item.statusNum==2?'立即领取':'立即使用'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="quan-right-box">
|
||||
<view class="fon28 col3 mar-s20">{{item.title}}</view>
|
||||
<view class="fon24 col80">满{{item.manPrice}}元可使用</view>
|
||||
<view class="fon20 col80 mar-x20">有效期:{{item.startTime}}至{{item.endTime}}</view>
|
||||
</view>
|
||||
<image v-if="item.statusNum==1" class="posia quan-use" src="/static/public/quan-use.png" mode=""></image>
|
||||
<image v-if="item.statusNum==3" class="posia quan-use" src="/static/public/quan-over.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="loading">
|
||||
<nothing-page v-if="dataList.length==0" :content="['暂无可使用优惠券','暂无已使用优惠券','暂无可领取优惠券','暂无已过期优惠券'][isStatus]"></nothing-page>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 体验券使用弹框 -->
|
||||
<view v-if="isTY" @tap="isTY=false" class="disjcac tc quan-tk-box" catchtouchmove="return">
|
||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isTY=true">
|
||||
<view class="fon28 col3">体验券使用</view>
|
||||
<view class="mar-sx30">
|
||||
<!-- <image :src="tyImg" class="quan-tk-em" style="width: 325rpx;height: 325rpx;" mode="aspectFill"></image> -->
|
||||
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||
</view>
|
||||
<view class="fon24 col3 mar-s40 mar-x20">工作人员扫码使用体验券</view>
|
||||
<image @tap.stop="closeQuanEv" src="/static/public/closequan.png" class="posia quan-tk-btn" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
chuTop:'',
|
||||
navList:['未使用','已使用','可领取','已过期'],
|
||||
isStatus:0,
|
||||
dataList:[],
|
||||
zcList:[],
|
||||
isTY:false,
|
||||
page:1,
|
||||
size:10,
|
||||
quanStatus:'normal',//优惠券状态
|
||||
loading:false,
|
||||
tyImg:'',//立即使用体验券时,弹框中的img
|
||||
canvasQrPath: '',
|
||||
text: 'hello',
|
||||
size: 162,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
timer:null,
|
||||
secret:''
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.chuTop = rect.height;
|
||||
}).exec()
|
||||
this.checkAllList(0);
|
||||
},
|
||||
onUnload() {
|
||||
this.closeQuanEv();
|
||||
},
|
||||
methods: {
|
||||
checkAllList(index){//查询所有优惠券列表
|
||||
let params = {
|
||||
status: this.quanStatus,//留空默获取全部 normal=正常(未使用) used=已使用 invalid=已失效 waiting=待领取
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('user/get-coupon-list',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.dataList = [];
|
||||
this.zcList = [];
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let leix = false;
|
||||
if(item.type=='taste') leix = true;
|
||||
let obj = {
|
||||
id:item.id,
|
||||
num:item.amount/100,
|
||||
title:item.name,
|
||||
cover:this.$http + item.cover,
|
||||
manPrice:item.condition/100,
|
||||
startTime:item.begin_at.slice(0,10),
|
||||
endTime:item.end_at.slice(0,10),
|
||||
isTiyan:leix,
|
||||
isZhek:false,
|
||||
statusNum:index
|
||||
}
|
||||
this.dataList.push(obj);//渲染的列表
|
||||
this.zcList.push(obj);//暂存的列表
|
||||
})
|
||||
this.checkList(index);
|
||||
}
|
||||
this.loading = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseNav(index){
|
||||
this.isStatus = index;
|
||||
if(index==0) this.quanStatus = 'normal';//未使用
|
||||
if(index==1) this.quanStatus = 'used';//已使用
|
||||
if(index==2) this.quanStatus = 'waiting';//待领取
|
||||
if(index==3) this.quanStatus = 'invalid';//已过期
|
||||
this.loading = false;
|
||||
this.checkAllList(index);
|
||||
},
|
||||
checkList(index){
|
||||
this.dataList = this.zcList.filter(item=>item.statusNum==index);
|
||||
},
|
||||
useEv(index){
|
||||
if(this.dataList[index].statusNum==2) {
|
||||
this.$requst.post('user/get-coupon',{coupon_id:this.dataList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('领取成功');
|
||||
this.checkAllList(this.isStatus);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.dataList[index].isTiyan==false && this.dataList[index].statusNum==0) {
|
||||
uni.navigateTo({url:'/pages/tabbar/shop/shop'})
|
||||
}
|
||||
if(this.dataList[index].isTiyan==true && this.dataList[index].statusNum==0){
|
||||
this.tyImg = this.dataList[index].cover;
|
||||
this.$requst.post('user/exhibition-experience-coupon',{coupon_id:this.dataList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.isTY = true;
|
||||
this.text = `${this.dataList[index].id}HtrueH${res.data.secret}H${uni.getStorageSync('userId')}`;
|
||||
this.secret = res.data.secret;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
this.timer = setInterval(()=>{
|
||||
this.$requst.post('staff/coupon/write-off-experience-couponQuery',{coupon_id:this.dataList[index].id,secret:this.secret}).then(res=>{
|
||||
if(res.code==0){
|
||||
// if(res.data.result==0){
|
||||
this.$toolAll.tools.showToast('使用成功');
|
||||
this.isTY = false;
|
||||
clearInterval(this.timer);
|
||||
this.checkAllList(0);
|
||||
// }
|
||||
}
|
||||
})
|
||||
},3000)
|
||||
}
|
||||
|
||||
},
|
||||
closeQuanEv(){
|
||||
this.isTY = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.isWen{color: #3875F6;}
|
||||
.isWen::after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 8rpx;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
background: #3875F6;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,803 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
|
||||
<view v-if="loading" :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
|
||||
<view class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">配送方式</view>
|
||||
<view class="fon26 col3 disac">
|
||||
<view @tap="expressEv(1)" :class="!isExpress?'activeT':'expressT'" :style="{background:isExpress?'':publicColor}">自提</view>
|
||||
<view v-if="!isVirtual" @tap="expressEv(0)" :class="isExpress?'activeT':'expressT'" :style="{background:isExpress?publicColor:''}">快递</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址信息 -->
|
||||
<view v-if="isExpress" class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||
<view class="bold">收件人信息</view>
|
||||
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
|
||||
<view class="fon26 col3 disjbac pad-s50">
|
||||
<view v-if="addressInfo!=''">
|
||||
<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>
|
||||
<view v-else class="fon24 col9">请完善收件人信息</view>
|
||||
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<!-- 自提地址 -->
|
||||
<view v-else class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||
<view class="bold">自提地址</view>
|
||||
<input type="number" maxlength="11" :focus="isFocus" @blur="blurEv" v-model="zPhone" class="mar-s50 mar-x20" style="border: 2rpx solid #E0E0E0;padding: 20rpx;border-radius: 10rpx;font-size: 24rpx;" placeholder="请输入收货人手机号" />
|
||||
<view class="fon26 col3 disjbac">
|
||||
<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 class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||
<view class="bold">订单信息</view>
|
||||
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||
<image @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
||||
<view class="width100 disjb fw" style="height: 166rpx;">
|
||||
<view>
|
||||
<view @tap="goShopDetail(item.id)" class="fon28 col3 bold clips2">{{item.title}}</view>
|
||||
<view class="order-sy">{{item.sku_name}}</view>
|
||||
</view>
|
||||
<view class="disjbac mar-s10 width100">
|
||||
<view class="order-item-price" v-if="isNei!=3">¥{{item.price}}</view>
|
||||
<view class="order-item-price" v-else>积分:{{item.price}}</view>
|
||||
<view class="fon28 col6">x{{item.num}}</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 v-if="isNei!=3" class="bacf radius20 mar-s20 pad-sx27-zy20">
|
||||
<view class="bold">优惠</view>
|
||||
<view @tap="quanEv(1)" class="fon28 col3 disjbac mar-sx40">
|
||||
<view>优惠券</view>
|
||||
<view class="disac">
|
||||
<view class="colf8 bold">-¥{{youQuan.youPrice}}</view>
|
||||
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="fon28 col3 disjbac">
|
||||
<view>立减优惠</view>
|
||||
<view class="colf8 bold">-¥{{delPrice}}.00</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 快递费用 -->
|
||||
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">快递费用</view>
|
||||
<view class="fon28 colf8 bold">¥{{expressInfo.default_price}}</view>
|
||||
</view>
|
||||
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
|
||||
<!-- 去支付 -->
|
||||
<view class="fon36 colf8 bold" v-if="isNei!=3">合计:¥{{allPrice<0?0:allPrice}}<span v-if="isKq">+{{zf_kqPrice}}孔雀币</span><span v-if="isExpress && expressInfo.default_price!=0" style="font-size: 24rpx;color: #000;">+ ¥{{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="isDui=true" v-else class="goPayment">去兑换</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 class="pad-sx20 pad-zy50">
|
||||
<view class="disjbac">
|
||||
<view class="fon28 bold col3">可用优惠券({{quanList.length}})</view>
|
||||
<image @tap.stop="showQuan=false" src="/static/public/cha-close.png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- <view class="fon28 bold col3 disja pad-s50" style="padding-bottom: 16rpx;">
|
||||
<view class="posir" :class="switchQuan?'activeQuan':''" @tap="switchQuan=true">可用优惠券(1)</view>
|
||||
<view class="posir" :class="!switchQuan?'activeQuan':''" @tap="switchQuan=false">失效优惠券(0)</view>
|
||||
</view> -->
|
||||
<scroll-view scroll-y class="mar-s40 quan-list-box">
|
||||
<view @tap.stop="chooseQuan(index)" v-for="(item,index) in quanList" :key="index" class="mar-x40">
|
||||
<view class="disjbac quan-item-box">
|
||||
<view class="posir">
|
||||
<image class="posia" src="/static/public/quan-left.png" mode=""></image>
|
||||
<view class="posir" style="z-index: 1;">
|
||||
<view class="pad-s40 pad-x30 fon28">¥<span class="bold fon56">{{item.youPrice}}</span></view>
|
||||
<view class="fon24" style="padding-left: 12rpx;">满{{item.manPrice}}元可使用</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- <view class="fon28 col3 mar-s20">{{['黄金','白银'][item.isGrade]}}会员专属优惠券</view> -->
|
||||
<view class="fon28 col3 mar-s20">{{item.name}}</view>
|
||||
<view>
|
||||
<image v-if="item.isStatus" src="/static/public/chooseQuan.png"></image>
|
||||
<image v-else src="/static/public/cancleQuan.png"></image>
|
||||
</view>
|
||||
<view class="fon20 col3 mar-x20">有效期:{{item.startTime.slice(0,10)}}至{{item.endTime.slice(0,10)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 领取优惠券按钮 -->
|
||||
<view @tap.stop="goCoupon" class="ling-btn">领取优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 确认兑换弹框 -->
|
||||
<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="bold" style="margin: 0rpx 0 56rpx 0;">兑换商品</view>
|
||||
<view style="margin: 0rpx 0 66rpx 0;">您确定使用{{allPrice}}积分兑换吗?</view>
|
||||
<view class="disjbac mar-x20 pad-zy20 zhun-dui-btn">
|
||||
<view @tap.stop="isDui=false">暂不兑换</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<0?0: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 v-if="isfen" class="posAll disjcac" style="background-color: rgba(0,0,0,.25);z-index: 8;">
|
||||
<view class="bacf width100 radius20 posir" style="padding: 60rpx 50rpx;margin: 0 70rpx;text-align: center;">
|
||||
<image @tap="isfen=false" src="../../static/public/closequan.png" class="posia heyan-close" mode=""></image>
|
||||
<view style="color: #f55255;font-size: 36rpx;">立即完成拼单?</view>
|
||||
<view style="margin: 50rpx 0;font-size: 26rpx;">点击下方分享给朋友,完成拼单</view>
|
||||
<view class="posir radius15 disjcac pad-sx20" style="background-color: #22cc3e;color: #FFFFFF;font-size: 36rpx;">
|
||||
分享给朋友
|
||||
<button open-type="share" class="posia-op">分享给朋友</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isExpress:false,
|
||||
switchQuan:true,
|
||||
showQuan:false,//是否显示优惠券弹框
|
||||
isDui:false,
|
||||
orderList:uni.getStorageSync('orderList'),
|
||||
quanList:[],
|
||||
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||
youQuan:{
|
||||
id:0,
|
||||
youPrice:0
|
||||
},//优惠券
|
||||
delPrice:0,//立减优惠(限时活动的)
|
||||
allPrice:0,//合计
|
||||
allNum:0,//总数量
|
||||
zanAllPrice:0,//暂存合计
|
||||
isNei:0,
|
||||
expressInfo:{},//快递信息
|
||||
addressInfo:'',//地址信息
|
||||
userPphone:'请完善信息',
|
||||
zPhone:'',//自提时的手机号
|
||||
page:1,
|
||||
size:10,
|
||||
isFocus:false,
|
||||
loading:false,
|
||||
zf_allPrice:0,//实际付款
|
||||
zf_kqPrice:0,//孔雀币
|
||||
payFS:[
|
||||
{title:'微信支付',isActive:true,num:0},
|
||||
{title:'孔雀币',isActive:false,num:100},
|
||||
{title:'积分',isActive:false,num:100},
|
||||
],
|
||||
isKq:false,
|
||||
jsPrice:0,//结算时的金额,
|
||||
zc_allPrice:0,//暂存实际总金额
|
||||
coin_price:0,//孔雀币转换后的元
|
||||
isSuccess:false,//支付成功
|
||||
ntype:'money',//默认money孔雀币转钱 coin钱转孔雀币
|
||||
times:0,//点击次数
|
||||
isCurrent:2,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
isfen:false,
|
||||
checkGrounpId:0,
|
||||
expressInfo:{
|
||||
default_price:0
|
||||
},
|
||||
isVirtual:false//是否是虚拟商品
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderList[0].id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
c:this.orderList[0].id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
if(ya.addressInfo.share_img==null) ya.addressInfo.share_img = ya.addressInfo.cover;
|
||||
var shareObj = {
|
||||
title: `${ya.orderList[0].title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=${this.orderList[0].category_id}&share_id=${this.checkGrounpId}&invite_code=${uni.getStorageSync('invite_code')}&shareCate=${this.orderList[0].cateNum}&checkGrounpId=${this.orderList[0].checkGrounpId}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.orderList[0].imgSrc//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkChoose();//检测地址
|
||||
uni.removeStorageSync('orderInfo');
|
||||
},
|
||||
onLoad(options) {
|
||||
// 自提手机号
|
||||
this.zPhone = uni.getStorageSync('phone');
|
||||
// 判断是不是虚拟商品
|
||||
options.isVirtual == "virtual" ? this.isVirtual = true : this.isVirtual = false
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkexpress();//查询快递
|
||||
this.checkeList(options.isNei);//查询订单列表
|
||||
this.checkOrderDetail();//查询订单信息
|
||||
this.isNei = options.isNei;
|
||||
if(this.isNei==3) {
|
||||
this.payFS[0].isActive = false;
|
||||
this.payFS[2].isActive = true;
|
||||
this.isCurrent = 1;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkChoose(){
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
if(this.expressInfo.default_price==0){
|
||||
this.$toolAll.tools.showToast('暂不可微信支付');
|
||||
this.payFS[index].isActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.payFS[index].title=='孔雀币') {
|
||||
if(this.youQuan.youPrice!=0){
|
||||
this.payFS[1].isActive = false;
|
||||
this.$toolAll.tools.showToast('无法使用孔雀币支付');
|
||||
} else {
|
||||
if(this.coin_price!=0){
|
||||
//选择了微信支付+选择了孔雀币
|
||||
if(this.payFS[0].isActive && this.payFS[1].isActive) {
|
||||
if(this.zanAllPrice - this.coin_price<=0){//孔雀币足以抵扣
|
||||
this.ntype = 'coin';
|
||||
this.obtainCoin(this.zanAllPrice*100);
|
||||
this.allPrice = 0;
|
||||
} else {//孔雀币不足以抵扣
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//选择了微信支付+取消了孔雀币
|
||||
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
|
||||
this.isKq = false;
|
||||
this.zf_kqPrice = 0;
|
||||
// 如果优惠券金额等:0
|
||||
if(this.youQuan.youPrice==0){
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
|
||||
} else {
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.youQuan.youPrice)*1).toFixed(2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+选择了孔雀币
|
||||
if(!this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
if(this.zanAllPrice - this.coin_price<=0){//孔雀币足以抵扣应付款
|
||||
this.ntype = 'coin'
|
||||
this.obtainCoin(this.allPrice*100);
|
||||
this.allPrice = 0;
|
||||
}
|
||||
if(this.zanAllPrice - this.coin_price>0){//孔雀币不足以抵扣应付款
|
||||
this.$toolAll.tools.showToast('孔雀币不足')
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
|
||||
this.zf_kqPrice = this.payFS[1].num;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+取消了孔雀币
|
||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.isKq = false;
|
||||
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('暂无可用孔雀币');
|
||||
this.payFS[index].isActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.payFS[index].title=='积分') {
|
||||
|
||||
}
|
||||
},
|
||||
goPayment(){//去付款
|
||||
this.isFocus = false;
|
||||
this.isDui = false;
|
||||
let nphone = '';
|
||||
if(this.isExpress) {
|
||||
nphone = this.addressInfo.phone;//默认地址的手机号
|
||||
} else nphone = this.zPhone;//自提时的手机号
|
||||
let self = 0;//快递的配送方式
|
||||
if(!this.isExpress) self = 1;//自提的方式
|
||||
let nsku_list = [];
|
||||
let is_only = 0;
|
||||
this.orderList.forEach(item=>{
|
||||
let obj = {
|
||||
sku_coding:item.coding,
|
||||
num:item.num,
|
||||
group_id:item.pin_user_id
|
||||
}
|
||||
nsku_list.push(obj);
|
||||
is_only = item.is_only;
|
||||
})
|
||||
let is_score = 0;
|
||||
if(this.isNei == 3) {is_score = 1}
|
||||
if(this.zf_kqPrice!=0) {
|
||||
this.jsPrice = `${this.allPrice} +${this.zf_kqPrice}孔雀币`;
|
||||
} else {
|
||||
this.jsPrice = this.allPrice;
|
||||
}
|
||||
let parmas = {
|
||||
sku_list: nsku_list,//商品单号和数量数组
|
||||
total: this.allPrice*100,//总金额
|
||||
address_id: this.addressInfo.id || 0,//地址ID
|
||||
express_code: this.expressInfo.code || 0,//快递编码
|
||||
coupon_id: this.youQuan.id,//优惠券ID
|
||||
coupon_price: this.youQuan.youPrice*100,//优惠券可用
|
||||
pick_self: self,//是否自提0 快递, 1自提
|
||||
pick_self_phone: nphone,//联系电话
|
||||
original_total: this.zanAllPrice*100,//原价总金额
|
||||
freight: this.expressInfo.default_price || 0,//快递费
|
||||
remarks: "",//备注
|
||||
is_only:is_only,//是否是单独购买0 不是单独购买1,2是单独购买
|
||||
is_score:is_score,//是否是积分商品0 不是积分商品,1是积分商品
|
||||
coin:this.zf_kqPrice//孔雀币
|
||||
}
|
||||
if(this.addressInfo=='' && self!=1){
|
||||
this.$toolAll.tools.showToast('请完善收件人信息');
|
||||
} else if(nphone=='') {
|
||||
this.$toolAll.tools.showToast('请填写收货人手机号');
|
||||
this.focusEv();
|
||||
} else if(this.$toolAll.tools.isPhone(nphone)) {
|
||||
this.$toolAll.tools.showToast('请正确填写收货人手机号');
|
||||
this.focusEv();
|
||||
} else if(this.isNei == 3 && !this.payFS[2].isActive){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请选择积分付款方式');
|
||||
} else if(this.isNei == 3 && this.expressInfo.default_price!=0 && this.expressInfo.default_price!=undefined && !this.payFS[0].isActive){//积分判断条件
|
||||
this.$toolAll.tools.showToast('请添加微信支付方式');
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式')
|
||||
} else if(this.isNei != 3 && !this.payFS[0].isActive && this.allPrice*1 > this.coin_price*1){
|
||||
this.$toolAll.tools.showToast('孔雀币不足');
|
||||
} else {
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
if(this.allPrice==0){
|
||||
this.$toolAll.tools.showToast('正在支付','loading',1500);
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('正在调起支付','loading',1500);
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}order/create`,
|
||||
data:parmas,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
this.times = 0;
|
||||
this.payment(res.data.data);
|
||||
// uni.setStorageSync('orderList',this.orderList);
|
||||
// uni.setStorageSync('orderInfo',res.data.data);
|
||||
// uni.navigateTo({
|
||||
// url:`/pagesA/immediatePayment/immediatePayment?allPrice=${this.allPrice}&allNum=${this.allNum}&startTime=${new Date(res.header.Date).getTime()}`
|
||||
// })
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.data.msg,'none',3000);
|
||||
this.times = 0;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
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){
|
||||
this.suseeceEv(info.coding);
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
fail:()=> {
|
||||
this.$toolAll.tools.showToast('取消支付');
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/myOrder/myOrder'
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.suseeceEv(info.coding);
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
}
|
||||
},
|
||||
suseeceEv(coding){
|
||||
uni.removeStorageSync('chooseAddress')
|
||||
this.isSuccess = true;
|
||||
if(this.orderList[0].cateNum==1 && this.orderList.pin_user_id!=0){
|
||||
this.isfen = true;
|
||||
this.$requst.post('order/get-group-id',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.checkGrounpId = res.data.group_id;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
goThere(val){//去这里
|
||||
wx.getLocation({//获取当前经纬度
|
||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||
success: function (res) {
|
||||
wx.openLocation({//使用微信内置地图查看位置。
|
||||
latitude: 30.67554,//要去的纬度-地址
|
||||
longitude: 104.010642,//要去的经度-地址
|
||||
name: val,
|
||||
address: val
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
checkAddress(){//默认地址查询
|
||||
this.$requst.post('user/address').then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
if(item.is_default==1) {
|
||||
this.addressInfo = item;
|
||||
} else {
|
||||
if(res.data.length==1){
|
||||
this.addressInfo = item;
|
||||
}
|
||||
}
|
||||
})
|
||||
this.userPphone = this.$toolAll.tools.hideMPhone(this.addressInfo.phone);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkexpress(){//查询快递费
|
||||
if(this.isExpress) {
|
||||
this.$requst.post('common/express-list').then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
if(item.is_default==1){
|
||||
this.expressInfo = item;
|
||||
this.expressInfo.default_price = this.expressInfo.default_price/100;
|
||||
}
|
||||
})
|
||||
this.totalEv();
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.totalEv();
|
||||
}
|
||||
},
|
||||
expressEv(index){//快递自取切换事件
|
||||
if(index==0) {
|
||||
this.isExpress = true;
|
||||
this.checkexpress();
|
||||
if(this.addressInfo==''){this.$toolAll.tools.showToast('请完善收件人信息','none',1500);}
|
||||
}
|
||||
if(index==1) {
|
||||
this.isExpress = false;
|
||||
this.expressInfo.default_price = 0;
|
||||
}
|
||||
},
|
||||
totalEv(){//合计运算
|
||||
if(this.isNei!=3 && this.isExpress && !this.payFS[1].isActive){//普通商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||
}
|
||||
if(this.isNei!=3 && !this.isExpress){//普通商品无运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||
}
|
||||
this.allPrice = parseInt(this.$toolAll.tools.addXiaoShu(this.allPrice));
|
||||
if(this.isNei ==3 && this.isExpress){//积分商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券 + 快递费
|
||||
}
|
||||
if(this.isNei ==3 && !this.isExpress){//积分商品,有运费
|
||||
this.allPrice = this.zanAllPrice - this.youQuan.youPrice - this.delPrice;//合计 = 总价 - 优惠券 - 立减券
|
||||
}
|
||||
this.loading = true;
|
||||
},
|
||||
checkOrderDetail(){//查询订单准备信息
|
||||
let nsku_list = [];
|
||||
this.orderList.forEach(item=>{
|
||||
let obj = {
|
||||
sku_coding:item.coding,
|
||||
num:item.num
|
||||
}
|
||||
nsku_list.push(obj)
|
||||
})
|
||||
let parmas = {
|
||||
sku_list: nsku_list,
|
||||
pick_self: 0
|
||||
}
|
||||
this.$requst.post('order/prepare-info',parmas).then(res=>{
|
||||
if(res.code==0){
|
||||
this.payFS[1].num = res.data.account.coin;
|
||||
this.obtainCoin(res.data.account.coin);
|
||||
this.payFS[2].num = res.data.account.score;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
checkeList(isJfen){
|
||||
this.allPrice = this.allPrice*1;
|
||||
this.orderList.forEach(item=>{
|
||||
this.allPrice += item.price*item.num;
|
||||
this.allNum += item.num;
|
||||
})
|
||||
if(isJfen==3){
|
||||
this.zanAllPrice = this.allPrice;
|
||||
} else {
|
||||
this.zanAllPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
|
||||
}
|
||||
this.quanEv(0);//查询优惠券列表
|
||||
this.totalEv();
|
||||
},
|
||||
quanEv(index){//调起优惠券弹框事件
|
||||
if(this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('无法使用优惠券减免');
|
||||
// this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice*1 + this.expressInfo.default_price*1);
|
||||
} else {
|
||||
if(index==1){
|
||||
this.showQuan = true
|
||||
}
|
||||
this.youQuan.id = 0;
|
||||
this.youQuan.youPrice = 0;
|
||||
this.allPrice = (this.zanAllPrice*1 - this.expressInfo.default_price*1).toFixed(2);
|
||||
this.checkQuan();//查询可用优惠券事件
|
||||
}
|
||||
},
|
||||
checkQuan(){//查询可用优惠券事件
|
||||
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.quanList = [];
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
if(item.type!='taste'){//如果不等于体验券
|
||||
let obj = {
|
||||
id:item.id,
|
||||
youPrice:item.amount/100,
|
||||
manPrice:item.condition/100,
|
||||
isGrade:0,
|
||||
name:item.name,
|
||||
startTime:item.begin_at,
|
||||
endTime:item.end_at,
|
||||
isStatus:false
|
||||
}
|
||||
this.quanList.push(obj);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseQuan(index){//选择可用优惠券事件
|
||||
if(this.zanAllPrice <= this.quanList[index].manPrice){//如果满减大于合计
|
||||
this.$toolAll.tools.showToast('未达到使用条件')
|
||||
} else {
|
||||
if(this.allPrice==0){
|
||||
this.$toolAll.tools.showToast('此订单费用为 0');
|
||||
// this.$requst.post('user/get-coin-price',{amount:this.quanList[index].youPrice,get_type:'coin'}).then(res=>{
|
||||
// if(res.code==0){
|
||||
// this.zf_kqPrice = this.zf_kqPrice - res.data.amount;
|
||||
// this.showQuan = false;
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
this.quanList.forEach(item=>{
|
||||
item.isStatus = false;
|
||||
});
|
||||
this.quanList[index].isStatus = true;
|
||||
this.showQuan = false;
|
||||
this.quanList[index].youPrice = this.$toolAll.tools.addXiaoShu(this.quanList[index].youPrice);
|
||||
this.youQuan = this.quanList[index];
|
||||
this.allPrice = this.zanAllPrice*1 - this.quanList[index].youPrice*1 + this.expressInfo.default_price*1;//合计 = 暂存合计 - 选中的优惠券
|
||||
this.allPrice = this.allPrice.toFixed(2)*1;
|
||||
}
|
||||
}
|
||||
},
|
||||
goCoupon(){//去领取优惠券
|
||||
this.showQuan = false;
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/coupon/coupon'
|
||||
})
|
||||
},
|
||||
focusEv(){//获取焦点
|
||||
this.isFocus = true;
|
||||
},
|
||||
blurEv(){//失去焦点
|
||||
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>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,221 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'立即支付'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
|
||||
<view v-if="!isSuccess">
|
||||
<!-- 订单信息 -->
|
||||
<view class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||
<view class="bold fon28">订单支付</view>
|
||||
<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 :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
|
||||
</navigator>
|
||||
<view class="width100 disjb fw" style="height: 166rpx;">
|
||||
<view>
|
||||
<navigator url="/pagesB/shopDetail/shopDetail" hover-class="none">
|
||||
<view class="fon28 col3 bold clips2">{{item.title}}</view>
|
||||
</navigator>
|
||||
<view class="order-sy">试用</view>
|
||||
</view>
|
||||
<view class="disjbac mar-s10 width100">
|
||||
<view class="order-item-price">¥{{item.price}}</view>
|
||||
<view class="fon28 col6">x{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon28 disjbac mar-s50 pad-s10 mar-x20">
|
||||
<view class="col6">共{{zf_allNum}}件</view>
|
||||
<view class="bold colf8">应付款:{{zf_allPrice}}<span v-if="isKq">+{{zf_kqPrice}}孔雀币</span></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" 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 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>
|
||||
<!-- 支付成功 -->
|
||||
<view v-if="isSuccess" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;text-align: center;">
|
||||
<image src="/static/public/pay-success.png" style="width: 194rpx;height: 194rpx;" mode=""></image>
|
||||
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
|
||||
<view class="" style="font-size: 46rpx;margin-bottom: 120rpx;color: #F85050;">¥{{jsPrice}}</view>
|
||||
<view class="disja success-btn">
|
||||
<view @tap="goDetail" style="">查看订单</view>
|
||||
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isSuccess:false,
|
||||
orderList:uni.getStorageSync('orderList'),
|
||||
zf_allNum:0,//总数量
|
||||
zf_allPrice:0,//实际付款
|
||||
zf_kqPrice:0,//孔雀币
|
||||
payFS:[
|
||||
{title:'微信支付',isActive:true,num:0},
|
||||
{title:'孔雀币',isActive:false,num:3000},
|
||||
],
|
||||
isKq:false,
|
||||
jsPrice:0,//结算时的金额,
|
||||
zc_allPrice:0,//暂存实际总金额
|
||||
orderInfo:uni.getStorageSync('orderInfo'),
|
||||
daoTime:'',//支付倒计时
|
||||
isGuo:false//是否过期
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('orderInfo');
|
||||
},
|
||||
onLoad(options) {
|
||||
this.zc_allPrice = this.zf_allPrice = options.allPrice;
|
||||
this.zf_allPrice = this.$toolAll.tools.addXiaoShu(this.zf_allPrice);
|
||||
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: {
|
||||
chooseFS(index){
|
||||
this.payFS[index].isActive = !this.payFS[index].isActive;
|
||||
if(index==0){
|
||||
//选择了微信支付+选择了孔雀币
|
||||
if(this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
this.isKq = true;
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+选择了孔雀币
|
||||
if(!this.payFS[0].isActive && this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('孔雀币不足');
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+取消了孔雀币
|
||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
|
||||
this.$toolAll.tools.showToast('请选择支付方式');
|
||||
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(this.payFS[0].isActive && this.payFS[1].isActive) {
|
||||
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.isKq = false;
|
||||
this.zf_allPrice = this.zc_allPrice;
|
||||
return;
|
||||
}
|
||||
//取消了微信支付+选择了孔雀币+孔雀币不足以抵扣应付款
|
||||
if(!this.payFS[0].isActive && this.payFS[1].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){
|
||||
this.$toolAll.tools.showToast('孔雀币不足')
|
||||
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.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.isKq = false;
|
||||
this.zf_allPrice = this.zc_allPrice;
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
payment(){
|
||||
if(!this.payFS[0].isActive && !this.payFS[1].isActive) {
|
||||
this.$toolAll.tools.showToast('请选择支付方式')
|
||||
} else if(!this.payFS[0].isActive && this.zc_allPrice*1 > this.zf_kqPrice*1){
|
||||
this.$toolAll.tools.showToast('孔雀币不足')
|
||||
} else {
|
||||
console.log(this.orderInfo.needPay);
|
||||
if(this.orderInfo.needPay){
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
appId:this.orderInfo.payment_params.appId,//appId
|
||||
timeStamp: this.orderInfo.payment_params.timeStamp,//时间戳
|
||||
nonceStr: this.orderInfo.payment_params.nonceStr,//随机字符串
|
||||
package: this.orderInfo.payment_params.package,//package
|
||||
signType: this.orderInfo.payment_params.signType,//MD5
|
||||
paySign: this.orderInfo.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
this.isSuccess = true;
|
||||
},error=>{this.$toolAll.tools.showToast(res.msg);})
|
||||
},
|
||||
fail: (err)=> {}
|
||||
});
|
||||
} else {
|
||||
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
this.isSuccess = true;
|
||||
},error=>{this.$toolAll.tools.showToast(res.msg);})
|
||||
}
|
||||
}
|
||||
},
|
||||
goDetail(){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/orderDetail/orderDetail'
|
||||
})
|
||||
},
|
||||
goShop(){
|
||||
uni.reLaunch({
|
||||
url:'/pages/tabbar/shop/shop'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,189 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'积分管理'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3">
|
||||
<view class="mar-s20 bacf pad20 radius20 bold">
|
||||
<view class="mar-x30">当前积分</view>
|
||||
<view style="font-size: 56rpx;">{{dangScore}}</view>
|
||||
</view>
|
||||
<view class="mar-s20 disjbac">
|
||||
<view class="disjbac pad20 bacf radius20 width48" style="box-sizing: border-box;">
|
||||
<image src="../../static/public/integral-01-108.png" class="score-img" mode=""></image>
|
||||
<view class="width100 score-people-box">
|
||||
<view class="font4">我的分享人</view>
|
||||
<view class="fon36 bold">{{sharePeople}}<span class="fon26 font4">人</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disjbac pad20 bacf radius20" style="box-sizing: border-box;">
|
||||
<image src="../../static/public/integral-02-108.png" class="score-img" mode=""></image>
|
||||
<view class="width100 score-people-box">
|
||||
<view class="font4">签到记录</view>
|
||||
<view @tap="goSigin" class="score-sigin-btn">立即签到</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 积分列表,消费列表 -->
|
||||
<view class="mar-s20 bacf pad20 radius20">
|
||||
<view class="mar-x50 fon28 disja">
|
||||
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">积分列表</view>
|
||||
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">消费列表</view>
|
||||
</view>
|
||||
<!-- 积分列表 -->
|
||||
<block v-if="dataList.length!=0">
|
||||
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
||||
<view>
|
||||
<view class="fon26 col3">{{item.title}}</view>
|
||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||
</view>
|
||||
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
|
||||
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view v-if="isHave" class="disjcac fon24 col9 bold">暂无更多列表信息</view>
|
||||
</view>
|
||||
<!-- 分享按钮 -->
|
||||
<view class="disjcac score-share-box">
|
||||
<image src="/static/public/bottom-shear.png" mode=""></image>
|
||||
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
||||
<button class="posia-op" open-type="share"></button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
activeJF:true,
|
||||
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'},
|
||||
],
|
||||
dangScore:0,//当前积分
|
||||
sharePeople:0,//我的分享人
|
||||
page:1,
|
||||
size:10,
|
||||
total:0,
|
||||
isZanw:true,
|
||||
ntype:'in',
|
||||
isHave:false,
|
||||
vision:false,
|
||||
isShowP: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
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/integralManage/integralManage?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkInfo();
|
||||
this.checkList();
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkList(){//查询积分列表
|
||||
this.$requst.post('user/score-log',{page:this.page,size:this.size,type:this.ntype}).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);
|
||||
})
|
||||
}
|
||||
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'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,148 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'自主预约'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view v-if="isLoading" :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 160rpx;">
|
||||
<view v-if="dataList.length!=0" class="mar-s30 bacf pad20" v-for="(item,index) in dataList" :key="index" style="border-radius: 28rpx;">
|
||||
<view class="disjbac">
|
||||
<view class="disac">
|
||||
<image class="radius20 mar-y20 flexs" src="/static/public/logo.png" style="width: 98rpx;height: 98rpx;" mode=""></image>
|
||||
<view>
|
||||
<view class="fon36 col3 bold clips1">{{item.name}}</view>
|
||||
<view class="fon24 col3 mar-s10">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{background:[ingColor,publicColor,failColor,failColor,failColor][item.status]}" class="fon24 colf radius10 flexs" style="padding: 14rpx 24rpx;">{{['审核中...','预约成功','预约失败','预约取消','预约完成'][item.status]}}</view>
|
||||
</view>
|
||||
<view class="mar-s36 fon24 col3">预约时间:{{item.yuTime}}</view>
|
||||
<view class="disjbac fon24 col3 mar-s30">
|
||||
<!-- <view>联系人:{{item.lname}}</view> -->
|
||||
<view>联系电话:{{item.lphone}}</view>
|
||||
</view>
|
||||
<view @tap="quyuy(index)" class="disjcac mar-s40 width100 colf fon30 radius10 posir" :style="{background:[quColor,quColor,publicColor,publicColor,publicColor][item.status]}" style="height: 90rpx;line-height: 90rpx;">
|
||||
{{['取消预约','取消预约','重新预约','再次预约','再次预约'][item.status]}}
|
||||
<!-- <button :disabled="(item.status==2 || item.status==3 || item.status==4)?true:false" class="posia"
|
||||
style="top: 0;left: 0;right: 0;bottom: 0;background-color: #000000;opacity: 0;">{{['取消预约','取消预约','重新预约','再次预约','再次预约'][item.status]}}</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="'暂无更多预约内容'"></nothing-page>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="posixzy bacf pad-sx25">
|
||||
<view @tap="goYu" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">我要预约</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="'是否取消当前预约?'" :clearVal="'否'" :comfrimVal="'是'" @comfirmev="comfirmev" @cancleev="isShowT=false"></pu-po>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer></public-customer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
failColor:'#CCCCCC',//失败背景颜色
|
||||
ingColor:'#FFBE4D',//审核中背景颜色
|
||||
quColor:'#FF4D4D',//取消预约背景色
|
||||
dataList:[
|
||||
// {status:0,imgSrc:'',name:'陈高医生',content:'植发',yuTime:'2021年07月08日 14:30至15:30',lname:'甄先生',lphone:'18888888888'},
|
||||
// {status:1,imgSrc:'',name:'陈高医生',content:'植发',yuTime:'2021年07月08日 14:30至15:30',lname:'甄先生',lphone:'18888888888'},
|
||||
// {status:2,imgSrc:'',name:'陈高医生',content:'植发',yuTime:'2021年07月08日 14:30至15:30',lname:'甄先生',lphone:'18888888888'},
|
||||
],
|
||||
btnCon:'取消预约',//取消预约/重新预约
|
||||
page:1,
|
||||
size:20,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
isLoading:false,
|
||||
isShowT:false,
|
||||
zzId:''//自主预约ID
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkPoint()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多预约记录','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
this.checkPoint()//调用自主预约列表事件
|
||||
this.$toolAll.tools.showToast('加载中...','loading')
|
||||
},
|
||||
methods: {
|
||||
checkPoint(){//查询自主预约列表事件
|
||||
this.$requst.post('user/appointment-list',{page:this.page,size:this.size}).then(res=>{
|
||||
// console.log('查询自主预约列表:',res);
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = []
|
||||
if(res.data.list.length!=0){
|
||||
this.total = res.data.total
|
||||
res.data.list.forEach(item=>{
|
||||
let timeStr = item.appointment_at.slice(0,10).split('-')
|
||||
let timeZui = item.period.name.split('-')
|
||||
let newStatus = ''
|
||||
if(item.status_text=='审核中') newStatus = 0
|
||||
if(item.status_text=='预约成功') newStatus = 1
|
||||
if(item.status_text=='预约失败') newStatus = 2
|
||||
if(item.status_text=='预约取消') newStatus = 3
|
||||
if(item.status_text=='预约完成') newStatus = 4
|
||||
let obj = {
|
||||
id:item.id,
|
||||
status:newStatus,
|
||||
imgSrc: uni.getStorageSync('userLogo'),//缓存token,
|
||||
name:item.name,
|
||||
content:item.typeInfo.title,
|
||||
yuTime:`${timeStr[0]}年${timeStr[1]}月${timeStr[2]}日 ${timeZui[0]}至${timeZui[1]}`,
|
||||
lname:item.name,
|
||||
lphone:item.phone
|
||||
}
|
||||
this.dataList.push(obj)
|
||||
})
|
||||
}
|
||||
this.isLoading = true
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
goYu(){//去预约
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/ppointmentEv/ppointmentEv'
|
||||
})
|
||||
},
|
||||
quyuy(index){//取消预约事件
|
||||
if(this.dataList[index].status==0 || this.dataList[index].status==1){
|
||||
this.zzId = this.dataList[index].id
|
||||
this.isShowT = true
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/ppointmentEv/ppointmentEv'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
comfirmev(){
|
||||
this.isShowT = false
|
||||
this.$requst.post('user/appointment-cancel',{appointment_id:this.zzId}).then(res=>{
|
||||
// console.log('取消预约成功返回:',res);
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('取消预约成功')
|
||||
setTimeout(()=>{
|
||||
this.checkPoint()
|
||||
},1500)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,181 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :backColor="1"></status-nav>
|
||||
<image src="/static/public/member-head.png" style="position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;"></image>
|
||||
<view class="mar-zy32 posir" :style="{paddingTop:statusHNH+26+'px'}">
|
||||
<view class="radius30 posir gao mar-zy40 fon24 pad-x20" style="box-shadow: 0px 16rpx 30rpx rgba(141, 141, 141, 0.26);">
|
||||
<view class="posir pad-zy20" style="z-index: 2;">
|
||||
<view class="disjb">
|
||||
<view class="disac">
|
||||
<!-- 头像 -->
|
||||
<image class="mar-sx20" :src="levelInfo.headimgurl" style="width:90rpx;height: 90rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<view class="mar-z20">
|
||||
<!-- 昵称 -->
|
||||
<view class="fon28 bold disac">{{levelInfo.nickname}}<view style="background: #FFFFFF;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFBD39;padding: 5rpx 16rpx;margin-left: 10rpx;">VIP</view></view>
|
||||
<view class="mar-s10" style="color: #C27417;">{{levelInfo.level.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-s30 " style="color: #C27417;">当前等级</view>
|
||||
</view>
|
||||
<view style="margin-top: 62rpx;color: #C27417;">还差{{levelInfo.level.value}}积分升级</view>
|
||||
<view class="fon28 mar-s10" style="color: #C49F74;">升级到钻石会员享有更多权益</view>
|
||||
</view>
|
||||
<image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/member.png" mode=""></image>
|
||||
</view>
|
||||
<!-- 功能列表 -->
|
||||
<view class="bacf radius20 mar-s20">
|
||||
<view v-if="levelInfo.level.name!='普通会员'" class="disac fon28 fw pad-x20" style="color: #C27417;">
|
||||
<view v-if="levelInfo.level.rights[indexh]==itemh.ntype" v-for="(itemh,indexh) in huiList" :key="indexh" class="mar-s20" style="width: 25%;">
|
||||
<view class="disac fc">
|
||||
<image :src="itemh.src" style="width: 50rpx;height: 50rpx;" mode="aspectFill"></image>
|
||||
<view class="mar-s20 mar-x10">{{itemh.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 当前权益介绍 -->
|
||||
<view class="bacf radius20 mar-s20 pad20">
|
||||
<view class="mar-x30 fon32 bold" style="color: #C27417;">当前权益介绍</view>
|
||||
<rich-text :nodes="detailInfo"></rich-text>
|
||||
<!-- <image src="../../static/public/dang-quan.png" style="width: 100%;" mode="widthFix"></image> -->
|
||||
</view>
|
||||
<view class="fon30 bold tc mar-s50 mar-x30" :style="{color:publicColor}">积分兑换</view>
|
||||
</view>
|
||||
<scoreList :dataList="dataList"></scoreList>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scoreList from '@/components/score-list.vue';
|
||||
export default {
|
||||
components:{
|
||||
scoreList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
vision:false,
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
huiList:[
|
||||
{src:'/static/public/ru-hui50.png',title:'入会权益',ntype:'membership_interests'},
|
||||
{src:'/static/public/birthday50.png',title:'生日礼物',ntype:'birthday'},
|
||||
{src:'/static/public/member-scor50.png',title:'积分权益',ntype:'score'},
|
||||
{src:'/static/public/te-quan50.png',title:'特权日',ntype:'privilege_day'},
|
||||
{src:'/static/public/share-hai50.png',title:'分享海报',ntype:'poster'},
|
||||
],
|
||||
dataList:[],
|
||||
levelInfo:{},
|
||||
detailInfo:'',//富文本
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/member/member?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkList();
|
||||
this.checkInfo();
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkInfo(){
|
||||
this.$requst.post('level/index').then(res=>{
|
||||
if(res.code==0){
|
||||
this.levelInfo = res.data;
|
||||
// 富文本
|
||||
this.detailInfo = this.$toolAll.tools.escape2Html(this.levelInfo.level.content)
|
||||
}
|
||||
})
|
||||
},
|
||||
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>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- <auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile> -->
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'写日记'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy20">
|
||||
<view class="mar-s30 bacf pad20" style="border-radius: 20rpx 20rpx 0 0;">
|
||||
<!-- 日记标题 -->
|
||||
<view class="disac mar-s20">
|
||||
<view class="mar-y20 flexs titlel2">日记标题</view>
|
||||
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
|
||||
<input v-model="diary_title" class="fon28 height-68" type="text" value="" placeholder="今天是2021年的最后一天" placeholder-style="color:#999999;"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详细内容 -->
|
||||
<view class="dis mar-s20">
|
||||
<view class="mar-y20 flexs mar-s20 titlel2">详细内容</view>
|
||||
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
|
||||
<textarea v-model="diary_content" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请输入详细内容" placeholder-style="color:#999999;"/>
|
||||
<!-- <editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady"></editor> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 选择病种 -->
|
||||
<view class="disac pad-s32">
|
||||
<view class="flexs mar-y20 titlel2">选择病种</view>
|
||||
<!-- 下拉列表 -->
|
||||
<view @tap="openXial(0)" class="disjbac width100 radius10 pad-zy20 xiala posir">
|
||||
<view>{{disease}}</view>
|
||||
<image :class="isdisease?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<view v-if="isdisease" class="posia bacf radius10 xial-box mar-s20">
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXia(indexl,0)" :class="diseaseCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in diseaseArr" :key="indexl">{{iteml.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 关联医生 -->
|
||||
<view class="disac pad-s32">
|
||||
<view class="flexs mar-y20 titlel2">关联医生</view>
|
||||
<!-- 下拉列表 -->
|
||||
<view @tap="openXial(1)" class="disjbac width100 radius10 pad-zy20 xiala posir">
|
||||
<view>{{diary_doctor}}</view>
|
||||
<image :class="isdiary_doctor?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<view v-if="isdiary_doctor" class="posia bacf radius10 xial-box mar-s20">
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXia(indexl,1)" :class="diary_doctorCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in diary_doctorArr" :key="indexl">{{iteml.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加封面 -->
|
||||
<view class="dis mar-s20">
|
||||
<view class="mar-y20 flexs titlel2">添加封面</view>
|
||||
<view class="width100">
|
||||
<view v-if="fengImg!=''" class="posir" style="width: 32%;">
|
||||
<image :src="fengImg" class="diary-item-img" style="width: 100%;" mode="aspectFill"></image>
|
||||
<image @tap="clearfengImg" src="../../static/public/closequan.png" class="posia" style="width: 20px;height: 20px;right: 10rpx;top: 10rpx;" mode=""></image>
|
||||
</view>
|
||||
<image v-else @tap="updataImg(0)" class="diary-item-img" src="../../static/public/diary-add.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加图片 -->
|
||||
<view class="dis mar-s20">
|
||||
<view class="mar-y20 flexs titlel2">添加图片</view>
|
||||
<view class="width100 disac fw">
|
||||
<view v-for="(item,index) in imgArr" :key="index" class="diary-item-img posir">
|
||||
<image :src="item" mode="aspectFill" class="addImg"></image>
|
||||
<image @tap="clearaddImg(index)" src="../../static/public/closequan.png" class="posia" style="width: 20px;height: 20px;right: 10rpx;top: 10rpx;" mode=""></image>
|
||||
</view>
|
||||
<image v-if="imgArr.length!=9" @tap="updataImg(1)" class="diary-item-img" src="../../static/public/diary-add.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view style="margin-top: 87rpx;margin-bottom: 30rpx;">
|
||||
<view @tap="submit" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">立即提交</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
import empower from '@/components/empower.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{empower},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
optionObj:'',
|
||||
diary_title:'',//日记标题
|
||||
diary_content:'',//详细内容
|
||||
disease:'请选择病种',//病种
|
||||
disease_id:'',//病种id
|
||||
isdisease:false,
|
||||
diseaseArr:[],
|
||||
diseaseCurrent:0,
|
||||
diary_doctor:'请选择关联医生',//医生
|
||||
diary_doctor_id:'',//医生id
|
||||
isdiary_doctor:false,
|
||||
diary_doctorArr:[],
|
||||
diary_doctorCurrent:0,
|
||||
fengImg:'',
|
||||
imgArr:[],
|
||||
placeholder: '开始输入...'
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
this.diseaseEv();
|
||||
this.chooseEv();
|
||||
// 查询要编辑日记的信息
|
||||
if(options.id!=undefined){
|
||||
this.checkDiaryInfo(options.id);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
openXial(index){
|
||||
if(index==0) {
|
||||
this.isdisease = !this.isdisease
|
||||
}
|
||||
if(index==1) {
|
||||
this.isdiary_doctor = !this.isdiary_doctor
|
||||
}
|
||||
},
|
||||
chooseXia(index,num){//预约类别选择事件
|
||||
if(num==0){
|
||||
this.diseaseCurrent = index
|
||||
this.disease = this.diseaseArr[index].title
|
||||
this.disease_id = this.diseaseArr[index].id
|
||||
} else {
|
||||
this.diary_doctorCurrent = index
|
||||
this.diary_doctor = this.diary_doctorArr[index].title
|
||||
this.diary_doctor_id = this.diary_doctorArr[index].id
|
||||
}
|
||||
},
|
||||
// 病种列表事件
|
||||
diseaseEv(){
|
||||
this.$requst.post('archives/disease').then(res=>{
|
||||
// console.log('病种列表:',res);
|
||||
if(res.code==0 && res.data.length!=0){
|
||||
this.diseaseArr=[]
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.name,
|
||||
pid:item.pid,
|
||||
sort:item.sort
|
||||
}
|
||||
this.diseaseArr.push(obj)
|
||||
})
|
||||
// this.disease = this.diseaseArr[0].title;
|
||||
// this.disease_id = this.diseaseArr[0].id;
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseEv(){//查询医生列表
|
||||
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.diary_doctorArr = [];
|
||||
if(res.data.list.length){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.name
|
||||
}
|
||||
this.diary_doctorArr.push(obj)
|
||||
})
|
||||
// this.diary_doctor = this.diary_doctorArr[0].title
|
||||
// this.diary_doctor_id = this.diary_doctorArr[0].id
|
||||
} else this.$toolAll.tools.showToast('暂无医生可选');
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
// 图片上传
|
||||
updataImg(index){
|
||||
if(index==0){
|
||||
uni.chooseImage({
|
||||
count:1,
|
||||
sourceType:['album'],
|
||||
success: (res) => {
|
||||
let tempImg = res.tempFilePaths[0];
|
||||
this.$requst.upload('file/upload/image',{file:tempImg}).then(res=>{
|
||||
this.fengImg = this.$http + res.data.src;
|
||||
this.$toolAll.tools.showToast('图片上传成功(*^▽^*)')
|
||||
},error=>{})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.chooseImage({
|
||||
count:9,
|
||||
sourceType:['album'],
|
||||
success: (res) => {
|
||||
let tempImg = res.tempFilePaths;
|
||||
let num = 0;
|
||||
for (var i = 0; i < tempImg.length; i++) {
|
||||
num++;
|
||||
this.$requst.upload('file/upload/image',{file:tempImg[i]}).then(res=>{
|
||||
if(this.imgArr.length!=9){
|
||||
this.imgArr.push(this.$http + res.data.src);
|
||||
}
|
||||
if(num==tempImg.length){
|
||||
this.$toolAll.tools.showToast('上传成功(*^▽^*)')
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('上传中...')
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
clearfengImg(){
|
||||
this.fengImg = '';
|
||||
},
|
||||
clearaddImg(index){
|
||||
this.imgArr.splice(index,1);
|
||||
},
|
||||
// 保存图片
|
||||
submit(){
|
||||
if(this.diary_title==''){
|
||||
this.$toolAll.tools.showToast('请输入日记标题');
|
||||
} else if(this.diary_content==''){
|
||||
this.$toolAll.tools.showToast('请输入详细内容');
|
||||
} else if(this.disease_id==''){
|
||||
this.$toolAll.tools.showToast('请选择病种');
|
||||
} else if(this.diary_doctor_id==''){
|
||||
this.$toolAll.tools.showToast('请关联医生');
|
||||
} else if(this.fengImg==''){
|
||||
this.$toolAll.tools.showToast('请添加封面图');
|
||||
} else {
|
||||
let params = {
|
||||
title :this.diary_title,
|
||||
images:this.imgArr.join(','),
|
||||
cover:this.fengImg,
|
||||
disease_id:this.disease_id,
|
||||
disease_name:this.disease,
|
||||
content:this.diary_content,
|
||||
doctor_id:this.diary_doctor_id,
|
||||
doctor_name:this.diary_doctor,
|
||||
id:''
|
||||
}
|
||||
console.log(params);
|
||||
this.$requst.post('user/diary-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('保存成功');
|
||||
uni.navigateBack({delta:1})
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
}
|
||||
},
|
||||
// 查询要编辑日记的信息
|
||||
// checkDiaryInfo(id){
|
||||
// this.$requst.get('user/diary-info',{id:id}).then(res=>{
|
||||
// if(res.code==0){
|
||||
// if(this.page==1) this.dataList = [];
|
||||
// this.total = res.data.total;
|
||||
// } else this.$toolAll.tools.showToast(res.msg);
|
||||
// },error=>{})
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,116 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- <auth-userInfo-mobile :optionObj="optionObj"></auth-userInfo-mobile> -->
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'我的日记'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 160rpx;">
|
||||
<view v-if="dataList.length!=0" class="mar-s30 bacf pad20" v-for="(item,index) in dataList" :key="index" style="border-radius: 28rpx;">
|
||||
<view class="clips1">{{item.title}}</view>
|
||||
<view class="mar-s20 fon24 col9">{{item.content}}</view>
|
||||
<view class="disac fw mar-s20">
|
||||
<image class="diary-img mar-x10" @tap="preImg(index,index1)" :src="item1" v-for="(item1,index1) in item.imgArr" :key="index1" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disjbac mar-s20">
|
||||
<view class="fon28 pcol bold">{{item.doctorName}}</view>
|
||||
<view class="fon24 col9">{{item.creatTime}}</view>
|
||||
</view>
|
||||
<view @tap="delDiaryEv(item.id,index)" class="disac mar-s20 pad-s20" style="border-top: 2rpx solid #E6E6E6;">
|
||||
<image src="../../static/public/del-diary.png" style="width: 20px;height: 20px;vertical-align: bottom;" mode=""></image>
|
||||
<view class="fon28 colf8 bold" style="margin-top: -4rpx;">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="'暂无日记'"></nothing-page>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="posixzy pad-sx25">
|
||||
<view @tap="goAddDiary" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">添加日记</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
import empower from '@/components/empower.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{empower},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
optionObj:'',
|
||||
dataList:[],
|
||||
page:1,
|
||||
size:20,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkDiaryEv()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多日记','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
console.log(123);
|
||||
this.checkDiaryEv();
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goAddDiary(){
|
||||
uni.navigateTo({
|
||||
url:'/pagesA/my-diary-edit/my-diary-edit'
|
||||
})
|
||||
},
|
||||
checkDiaryEv(){
|
||||
this.$requst.get('user/diary',{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){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
content:item.content,
|
||||
imgArr:item.images.split(','),
|
||||
doctorName:item.doctor_name,
|
||||
creatTime:item.created_at,
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
}
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
},
|
||||
delDiaryEv(id,index){
|
||||
this.$requst.get('user/diary-del',{id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('删除成功');
|
||||
this.dataList.splice(index,1);
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
},error=>{})
|
||||
},
|
||||
preImg(index,num){
|
||||
console.log(this.dataList[index]);
|
||||
uni.previewImage({
|
||||
current:this.dataList[index].imgArr[num],
|
||||
urls:this.dataList[index].imgArr
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,360 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'地址管理'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop:statusHNH+'px'}" class="mar-sx20 pad-zy32" style="padding-bottom: 150rpx;">
|
||||
<view v-if="loading">
|
||||
<view @tap="goBack(index)" v-for="(item,index) in dataList" :key="index" class="bacf radius20 pad20 mar-x20">
|
||||
<view class="pad-y20 disjbac">
|
||||
<view class="fon28 col3 bold">{{item.userName}} {{item.userPhone}}</view>
|
||||
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
||||
</view>
|
||||
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
|
||||
<view class="disjbac fon28 col3 mar-s32">
|
||||
<view @tap.stop="setMo(index)" class="disac">
|
||||
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
|
||||
<image v-else src="/static/public/cancle-FS.png" class="address_active" mode=""></image>
|
||||
<view class="mar-z10" :class="item.isActive?'':'col9'">设为默认地址</view>
|
||||
</view>
|
||||
<view class="disac" style="color: #808080;">
|
||||
<view @tap.stop="editAddress(index)">编辑</view>
|
||||
<view @tap.stop="delAddress(index)" class="mar-y10 mar-z50">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap.stop="obtainLngLat" class="posixzy address_add" style="bottom: 20rpx;">添加地址</view>
|
||||
<nothing-page v-if="dataList.length==0" :content="'暂无可用地址'"></nothing-page>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加地址、修改地址 -->
|
||||
<view v-if="idEdit" @tap.stop="idEdit=false" class="posAll disjcac" style="padding: 0 46rpx;z-index: 3;">
|
||||
<view class="bacf width100" @tap.stop="idEdit=true" style="padding: 0 55rpx;border-radius: 23rpx;">
|
||||
<view class="pad-sx20 posir">
|
||||
<view class="fon28 bold col3 width100 tc">收件人地址</view>
|
||||
<image class="posia address-close-btn" @tap.stop="idEdit=false" src="/static/public/addressClose.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="pad-sx20 fon28 col3">
|
||||
<view class="fon26 col9 mar-s30">收件人</view>
|
||||
<view class="bbot mar-s30 pad-x10">
|
||||
<input type="text" class="width100" v-model="userName" placeholder="请输入姓名" />
|
||||
</view>
|
||||
<view class="fon26 col9 mar-s30">手机号码</view>
|
||||
<view class="bbot mar-s30 pad-x10">
|
||||
<input type="num" maxlength="11" class="width100" v-model="userPhone" placeholder="请输入联系电话" />
|
||||
</view>
|
||||
<view class="fon26 col9 mar-s30">地址</view>
|
||||
<view class="disjbac">
|
||||
<view class="bbot mar-s30 pad-x10 posir disac" @tap="chooseProvinceCityCounty(0)">
|
||||
<input type="text" class="width100 pad-y20" disabled v-model="userProvince" placeholder="四川" />
|
||||
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
|
||||
<image src="/static/public/address-top.png" mode=""></image>
|
||||
<image src="/static/public/address-down.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="isAddress==1?'dong':''" class="posia info-box">
|
||||
<view @tap.stop="chooseProvince(index)" class="clips1" v-for="(item,index) in provinceArr" :key="index">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bbot mar-s30 pad-x10 posir disac mar-zy30" @tap="chooseProvinceCityCounty(1)">
|
||||
<input type="text" class="width100 pad-y20" disabled v-model="userCity" placeholder="成都" />
|
||||
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
|
||||
<image src="/static/public/address-top.png" mode=""></image>
|
||||
<image src="/static/public/address-down.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="isAddress==2?'dong':''" class="posia info-box">
|
||||
<view @tap.stop="chooseCity(index)" class="clips1" v-for="(item,index) in cityArr" :key="index">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bbot mar-s30 pad-x10 posir disac" @tap="chooseProvinceCityCounty(2)">
|
||||
<input type="text" class="width100 pad-y20" disabled v-model="userCounty" placeholder="成华区" />
|
||||
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
|
||||
<image src="/static/public/address-top.png" mode=""></image>
|
||||
<image src="/static/public/address-down.png" mode=""></image>
|
||||
</view>
|
||||
<view :class="isAddress==3?'dong':''" class="posia info-box">
|
||||
<view @tap.stop="chooseCounty(index)" class="clips1" v-for="(item,index) in countyArr" :key="index">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon26 col9 mar-s30">详细地址</view>
|
||||
<view class="bbot mar-s30 pad-x10">
|
||||
<input type="text" class="width100" v-model="userAddress" placeholder="请输入详细地址" />
|
||||
</view>
|
||||
<!-- 确认保存按钮 -->
|
||||
<view @tap.stop="addAddress" class="address-btn-add">确认保存</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {lotusAddressJson} from '@/components/city/city.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[],
|
||||
idEdit:false,
|
||||
userName:'',
|
||||
userPhone:'',
|
||||
userProvince:'',
|
||||
userCity:'',
|
||||
userCounty:'',
|
||||
userAddress:'',
|
||||
isChoose:'',//选中的id
|
||||
delNum:0,//删除条件
|
||||
loading:false,
|
||||
provinceArr:[],
|
||||
cityArr:[],
|
||||
countyArr:[],
|
||||
isAddress:0,
|
||||
isWhere:1,
|
||||
isMo:0
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkList();
|
||||
this.isWhere = options.isWhere;
|
||||
},
|
||||
methods: {
|
||||
goBack(index){//返回到订单准备页
|
||||
if(this.isWhere==0) {
|
||||
uni.setStorageSync('chooseAddress',this.dataList[index]);
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},
|
||||
obtainLngLat(){//添加地址事件
|
||||
this.idEdit = true;
|
||||
this.isMo = 0;
|
||||
this.clearAll();
|
||||
// 获取当前位置的经纬度
|
||||
wx.getLocation({
|
||||
success:(res)=> {
|
||||
// 逆解析经纬度
|
||||
this.getDistrict(res.latitude, res.longitude)
|
||||
},
|
||||
})
|
||||
|
||||
},
|
||||
getDistrict(latitude, longitude) {//获取当前位置的省市区县
|
||||
let ya = this
|
||||
wx.request({
|
||||
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=B2ABZ-SIDKS-WD2O3-6CJ2U-CDZOT-U3FKF`,
|
||||
header: {
|
||||
'Content-Type':'application/json'
|
||||
},
|
||||
success:function(res) {
|
||||
// console.log('地址数据:',res)
|
||||
ya.userProvince = res.data.result.address_component.province
|
||||
ya.userCity = res.data.result.address_component.city
|
||||
ya.userCounty = res.data.result.address_component.district
|
||||
lotusAddressJson.forEach((itema,index)=>{
|
||||
if(ya.userProvince==itema.name) {
|
||||
ya.chooseProvinceCityCounty(0);
|
||||
ya.chooseProvince(index);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseProvinceCityCounty(index){
|
||||
if(index==0){//获取省数据
|
||||
this.isAddress = 1;
|
||||
this.provinceArr = []
|
||||
lotusAddressJson.forEach((item,index)=>{
|
||||
if(item.value.slice(2) =='0000'){
|
||||
this.provinceArr.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
if(index==1){//获取市数据
|
||||
if(this.cityArr.length!=0){
|
||||
this.isAddress = 2;
|
||||
}
|
||||
}
|
||||
if(index==2){//获取区数据
|
||||
if(this.countyArr.length==0){
|
||||
this.$toolAll.tools.showToast('暂无可选项');
|
||||
} else {
|
||||
this.isAddress = 3;
|
||||
}
|
||||
}
|
||||
},
|
||||
chooseProvince(index){//选择省
|
||||
this.countyArr = this.cityArr = [];
|
||||
this.userProvince = this.provinceArr[index].name;
|
||||
lotusAddressJson.forEach(itema=>{
|
||||
if(this.provinceArr[index].value==itema.parent) {
|
||||
this.cityArr.push(itema)
|
||||
}
|
||||
})
|
||||
this.isAddress = 0;
|
||||
this.userCity = this.cityArr[0].name;//默认市的第一个
|
||||
this.chooseCity(0);
|
||||
},
|
||||
chooseCity(index){//选择市
|
||||
this.countyArr = [];
|
||||
this.userCity = this.cityArr[index].name;
|
||||
lotusAddressJson.forEach(itema=>{
|
||||
if(this.cityArr[index].value==itema.parent) {
|
||||
this.countyArr.push(itema)
|
||||
}
|
||||
})
|
||||
this.isAddress = 0;
|
||||
if(this.countyArr.length!=0) {
|
||||
this.userCounty = this.countyArr[0].name;//默认选中第一个区
|
||||
} else this.userCounty = '未知';
|
||||
},
|
||||
chooseCounty(index){//选择区
|
||||
this.isAddress = 0;
|
||||
this.userCounty = this.countyArr[index].name;
|
||||
},
|
||||
async checkList(){//查询地址列表
|
||||
this.$requst.post('user/address').then(res=>{
|
||||
if(res.code==0){
|
||||
this.dataList = [];
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let newActive = false;
|
||||
if(item.is_default==1) newActive = true
|
||||
let obj = {
|
||||
id:item.id,
|
||||
user_id:item.user_id,
|
||||
userName:item.name,
|
||||
userPhone:item.phone,
|
||||
userAddress:item.province_str + item.city_str + item.county_str + item.address,
|
||||
province:item.province_str,
|
||||
city:item.city_str,
|
||||
county:item.county_str,
|
||||
address:item.address,
|
||||
isActive:newActive,
|
||||
is_default:item.is_default
|
||||
}
|
||||
this.dataList.push(obj);
|
||||
})
|
||||
this.checkActive();
|
||||
}
|
||||
this.loading = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
checkActive(){//把默认地址放到第一位
|
||||
let have = this.dataList.findIndex((res)=>{
|
||||
return res.isActive == true;
|
||||
});
|
||||
this.dataList.unshift(this.dataList[have]);
|
||||
this.dataList.splice(have+1,1);
|
||||
},
|
||||
async addAddress(){//新增编辑地址
|
||||
if(this.userName=='') {
|
||||
this.$toolAll.tools.showToast('请输入姓名');
|
||||
} else if(this.userPhone=='') {
|
||||
this.$toolAll.tools.showToast('请输入联系电话');
|
||||
} else if(this.$toolAll.tools.isPhone(this.userPhone)) {
|
||||
this.$toolAll.tools.showToast('请输入正确的联系电话');
|
||||
} else if(this.userAddress=='') {
|
||||
this.$toolAll.tools.showToast('请输入详细地址');
|
||||
} else {
|
||||
let params = {
|
||||
id:this.isChoose,
|
||||
name:this.userName,
|
||||
phone:this.userPhone,
|
||||
city:'',//城市编码
|
||||
county:'',//区县编码
|
||||
province_str:this.userProvince,//省
|
||||
city_str:this.userCity,//市
|
||||
county_str:this.userCounty,//区
|
||||
address:this.userAddress,
|
||||
is_default:this.isMo//是否默认
|
||||
}
|
||||
this.$requst.post('user/address-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.idEdit = false;
|
||||
if(this.isChoose!='') {
|
||||
this.$toolAll.tools.showToast('地址修改成功');
|
||||
} else {
|
||||
this.$toolAll.tools.showToast('新增地址成功');
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.checkList();
|
||||
this.clearAll();
|
||||
},1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
setMo(index){//设置默认地址
|
||||
let params = {
|
||||
id:this.dataList[index].id,
|
||||
name:this.dataList[index].userName,
|
||||
phone:this.dataList[index].userPhone,
|
||||
city:'',//城市编码
|
||||
county:'',//区县编码
|
||||
province_str:this.dataList[index].province,//省
|
||||
city_str:this.dataList[index].city,//市
|
||||
county_str:this.dataList[index].county,//区
|
||||
address:this.dataList[index].address,
|
||||
is_default:1//是否默认
|
||||
}
|
||||
this.$requst.post('user/address-save',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('设置默认地址成功');
|
||||
this.dataList.forEach(item=>{
|
||||
item.isActive = false;
|
||||
});
|
||||
this.dataList[index].isActive = true;
|
||||
this.dataList[index].is_default = 1;
|
||||
this.checkActive();
|
||||
}
|
||||
})
|
||||
},
|
||||
editAddress(index){//编辑按钮
|
||||
this.idEdit = true;
|
||||
this.isChoose = this.dataList[index].id,
|
||||
this.userName = this.dataList[index].userName;
|
||||
this.userPhone = this.dataList[index].userPhone;
|
||||
this.userProvince = this.dataList[index].province;
|
||||
this.userCity = this.dataList[index].city;
|
||||
this.userCounty = this.dataList[index].county;
|
||||
this.userAddress = this.dataList[index].address;
|
||||
this.isMo = this.dataList[index].is_default
|
||||
},
|
||||
delAddress(index){//删除地址事件
|
||||
this.delNum++
|
||||
setTimeout(()=>{
|
||||
this.delNum = 0;
|
||||
},3000)
|
||||
if(this.delNum==1) {
|
||||
this.$toolAll.tools.showToast('双击即可删除');
|
||||
}
|
||||
if(this.delNum==2) {
|
||||
this.$requst.post('user/address-del',{id:this.dataList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('删除成功');
|
||||
setTimeout(()=>{
|
||||
this.checkList();
|
||||
},1500)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
clearAll(){//清空输入框
|
||||
this.isChoose = '',
|
||||
this.userName = '';
|
||||
this.userPhone = '';
|
||||
this.userProvince = '';
|
||||
this.userCity = '';
|
||||
this.userCounty = '';
|
||||
this.userAddress = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,506 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'订单管理'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<view class="isTopf bacf pad-zy30" :style="{top:statusHNH+'px'}">
|
||||
<scroll-view scroll-x>
|
||||
<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>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view :style="{paddingTop:(statusHNH+12+chuTop)+'px'}" class="pad-sx20 pad-zy32 pad-x180">
|
||||
<view v-if="orderList.length!=0" v-for="(item,index) in orderList" :key="index" class="radius20 bacf pad20 mar-x20 order-item-box">
|
||||
<view @tap="goDetail(item.id)" class="bbot disjbac pad-x20 mar-x20"><view class="fon28 col3 bold">{{item.isShop==0?'商城订单':'积分商城订单'}}</view>
|
||||
<view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="fon24 col9">{{item.group_make_end_at}}</view>
|
||||
<view v-else class="fon24 col9">{{item.establish}}</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 posir" :style="{paddingBottom:itemc.is_virtual!=0?'70rpx':'50rpx'}">
|
||||
<image @tap="goDetail(item.id)" :src="itemc.imgSrc" class="flexs" mode="aspectFill"></image>
|
||||
<view @tap="goDetail(item.id)" class="width100 disjb fc" style="height: 166rpx;">
|
||||
<view>
|
||||
<view class="fon28 col3 bold clips2">{{itemc.title}}</view>
|
||||
<view class="order-sy">{{itemc.sku_name}}</view>
|
||||
</view>
|
||||
<view class="disjbac mar-s10">
|
||||
<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 @tap.stop="make(index,indexc)" v-if="itemc.is_virtual!=0 && itemc.check_type=='frontend' && itemc.not_check_num!=0 && item.orderStatus!=1" class="order-btn">线下核销</view>
|
||||
<view v-if="itemc.is_virtual!=0 && itemc.check_type!='frontend'" class="order-btn" style="background-color: #CCCCCC;">线上核销</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="itemc.is_virtual!=0 && itemc.not_check_num!=0" class="mar-s10 posia col6" style="bottom: 20rpx; right: 0rpx;">待核验 x{{itemc.not_check_num}}</view>
|
||||
</view>
|
||||
<!-- <view class="fon28 col3 pad-s20 disjbac">
|
||||
<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 @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5" class="order-cancle">取消订单</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 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="disjbac">
|
||||
<view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;">
|
||||
<image src="../../static/public/weix.png" mode="" class="flexs" style="width: 50rpx;height: 50rpx;"></image>
|
||||
分享给朋友
|
||||
<button open-type="share" :data-id="index" class="posia-op">分享给朋友</button>
|
||||
</view>
|
||||
<view class="width100 disje">
|
||||
<view @tap="comeing(item.orderNum)" v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="order-btn mar-y20">直接免拼</view>
|
||||
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5 && item.virtual_check==0 && item.orderStatus!=5" 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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nothing-page v-if="orderList.length==0" :content="`暂无更多订单列表`"></nothing-page>
|
||||
</view>
|
||||
<!-- 待核验弹框 -->
|
||||
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;" catchtouchmove="return">
|
||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
||||
<view class="fon28 col3">订单二维码</view>
|
||||
<view class="mar-sx30">
|
||||
<yz-qr ref="qrPath" :text="text" :size="qsize" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||
<!-- <image src="/static/public/member-head.png" class="order-hx-img" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
<view class="fon24 col3">
|
||||
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
||||
<view>订单未完成前请勿出示二维码</view>
|
||||
</view>
|
||||
<image @tap.stop="closeEv" src="/static/public/closequan.png" class="posia heyan-close" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 取消订单弹框 -->
|
||||
<view v-if="isCancle" @tap.stop="isCancle=false" class="posAll">
|
||||
<view class="bacf posixzy order-cancle-tk" @tap.stop="isCancle=true">
|
||||
<view>
|
||||
<view class="bbot pad-sx20 posir">
|
||||
<view class="fon28 bold col3 width100" style="text-align: center;">取消订单</view>
|
||||
<image class="posia order-close-btn" @tap.stop="isCancle=false" src="/static/public/cha-close.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="pad-zy32 pad-sx20 col5b">
|
||||
<view class="fon24 linh40">
|
||||
<view>温馨提示:</view>
|
||||
<view>订单取消需要提交工作人员审核,商品金额将原路径返还账户,订单一旦取消,系统无法恢复。</view>
|
||||
</view>
|
||||
<view @tap.stop="chooseReason(indexy)" v-for="(itemy,indexy) in reasonList" :key="indexy" class="disac mar-s40">
|
||||
<image v-if="itemy.isActive" src="/static/public/chooseFS.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
|
||||
<image v-else src="/static/public/cancle-FS.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
|
||||
<view class="mar-z20 fon28">{{itemy.title}}</view>
|
||||
</view>
|
||||
<!-- 确认取消按钮 -->
|
||||
<view @tap.stop="confirmEv" class="confirm-btn">确认取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
chuTop:'',//导航高度
|
||||
activeIndex:'',
|
||||
statusList:['全部','待付款','待发货','待核验','待收货','已完成'],
|
||||
// 取消订单原因
|
||||
reasonList:[
|
||||
{title:'不想要了/买多了/买错了',isActive:true},
|
||||
{title:'地址信息填写错误',isActive:false},
|
||||
{title:'其他原因',isActive:false},
|
||||
],
|
||||
isHeyan:false,//是否线下审核
|
||||
isCancle:false,//是否取消订单
|
||||
orderList:[],
|
||||
zanList:[],//暂存列表数据
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
tag:'',//默认全部 waiting=待付款 paid=已付款待发货 shipped=已发货 completed=已完成 check=待核验
|
||||
current:0,//选中的订单
|
||||
remarks:'',//原因
|
||||
times:0,//点击次数
|
||||
canvasQrPath: '',
|
||||
text: '',
|
||||
qsize: 162,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
timer:null,
|
||||
zanArr:[],
|
||||
timeList:[],
|
||||
orderInfo:{},
|
||||
checkGrounpId:0,
|
||||
titleList:[],//tab标题
|
||||
imgList:[],//tab图标
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let orderIndex = res.target.dataset.id;
|
||||
this.orderInfo = this.orderList[orderIndex];
|
||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderInfo.childrenList[0].spu_id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
c:this.orderInfo.childrenList[0].spu_id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
var shareObj = {
|
||||
title: `${ya.orderInfo.childrenList[0].title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=${ya.orderInfo.childrenList[0].spu_activity_id}&category_id=0&share_id=${ya.orderInfo.group_id}&invite_code=${uni.getStorageSync('invite_code')}&shareCate=1&checkGrounpId=${ya.orderInfo.childrenList[0].spu_activity_id}&is_activity=1`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.orderInfo.childrenList[0].imgSrc//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.closeEv();
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkZT(this.activeIndex);
|
||||
this.checkList(this.activeIndex);
|
||||
},
|
||||
onLoad(options) {
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.chuTop = rect.height
|
||||
}).exec()
|
||||
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
methods: {
|
||||
comeing(coding){
|
||||
this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('免拼成功');
|
||||
this.checkList(this.activeIndex);
|
||||
}
|
||||
})
|
||||
},
|
||||
make(index,index2){
|
||||
this.isHeyan = true;
|
||||
this.text = `${this.orderList[index].orderNum}H${this.orderList[index].childrenList[index2].id}`;
|
||||
let params = {
|
||||
order_coding:this.orderList[index].orderNum,
|
||||
id:this.orderList[index].childrenList[index2].id,
|
||||
not_check_num:this.orderList[index].childrenList[index2].not_check_num
|
||||
}
|
||||
this.timer = setInterval(()=>{
|
||||
this.$requst.post('order/check-result',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.result==1){
|
||||
this.isHeyan = false;
|
||||
this.$toolAll.tools.showToast('已完成');
|
||||
this.checkList(this.activeIndex);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
})
|
||||
},3000)
|
||||
// var that = this;
|
||||
// setTimeout(function() {
|
||||
// that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
|
||||
// console.log('获取二维码地址:', that.canvasQrPath)
|
||||
// }, 1000)
|
||||
},
|
||||
closeEv(){
|
||||
this.isHeyan = false;
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
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){
|
||||
this.page =1;
|
||||
this.activeIndex = index;
|
||||
this.checkZT(index);
|
||||
this.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.zanArr = [];
|
||||
this.timeList = [];
|
||||
}
|
||||
this.total = res.data.total;
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let statusNum = 0;
|
||||
if(item.status=="waiting") statusNum = 1;
|
||||
// if(item.status=="paid" && item.has_virtual==1) {
|
||||
// statusNum = 3;
|
||||
// }
|
||||
if(item.status=="paid") {
|
||||
statusNum = 2;
|
||||
}
|
||||
// if(item.status=="check")
|
||||
if(item.status=="shipped") statusNum = 4;
|
||||
if(item.status=="completed") statusNum = 5;
|
||||
let nprice = '';
|
||||
if(item.is_score==0) nprice = this.$toolAll.tools.addXiaoShu(item.price/100);
|
||||
if(item.is_score==1) nprice = item.score;
|
||||
let nchildren = [];
|
||||
item.skus.forEach(items=>{
|
||||
let childrenPrice = '';
|
||||
if(item.is_score==0) childrenPrice = items.price/100
|
||||
if(item.is_score==1) childrenPrice = items.score
|
||||
let objs = {
|
||||
id:items.id,
|
||||
imgSrc:this.$http + items.spu_cover,
|
||||
title:items.spu_name,
|
||||
sku_name:items.sku_name,
|
||||
price:childrenPrice,
|
||||
num:items.num,
|
||||
not_check_num:items.not_check_num,
|
||||
check_type:items.check_type,
|
||||
is_virtual:items.is_virtual,
|
||||
activity_type:items.activity_type,
|
||||
spu_id:items.spu_id,
|
||||
spu_activity_id:items.spu_activity_id
|
||||
}
|
||||
nchildren.push(objs);
|
||||
})
|
||||
let obj = {
|
||||
id:item.id,
|
||||
establish:item.created_at,//创建时间
|
||||
orderNum:item.coding,//订单号
|
||||
childrenList:nchildren,
|
||||
orderStatus:statusNum,//1 待付款,2 待发货,3 待核验,4 待收货,5 交易已完成
|
||||
isShop:item.is_score,//0 商城订单,1 积分商城订单
|
||||
total: nprice,//合计
|
||||
coin:item.coin,//孔雀币
|
||||
is_only:item.is_only,//是否单独购买,1、单独购买
|
||||
virtual_check:item.virtual_check,
|
||||
open_one:item.open_one,
|
||||
is_group_make:item.is_group_make,
|
||||
open_one_success:item.open_one_success,
|
||||
group_make_end_at:item.group_make_end_at,
|
||||
group_id:item.group_id
|
||||
}
|
||||
this.zanArr.push(obj);
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.group_make_end_at!='' && item.group_make_end_at!=null) {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
time:item.group_make_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
uni.showToast({
|
||||
title:'加载中...',
|
||||
icon:'none',
|
||||
duration:100000
|
||||
})
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
let startTime = new Date().getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(startTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
// this.checkList(this.activeIndex);
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].group_make_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,startTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
uni.hideToast();
|
||||
this.orderList = this.zanArr;
|
||||
// this.search_result = true;
|
||||
},1000)
|
||||
} else {
|
||||
uni.hideToast();
|
||||
this.orderList = this.zanArr;
|
||||
}
|
||||
this.zanList = this.orderList;
|
||||
if(index==0) {
|
||||
this.orderList = this.zanList;
|
||||
} else if(index==3){
|
||||
console.log(1234);
|
||||
} else {
|
||||
this.orderList = this.zanList.filter(item=>{
|
||||
return item.orderStatus==index;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
payMentEv(index){//付款
|
||||
this.$requst.post('order/pay',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
appId:res.data.payment_params.appId,//appId
|
||||
timeStamp: res.data.payment_params.timeStamp,//时间戳
|
||||
nonceStr: res.data.payment_params.nonceStr,//随机字符串
|
||||
package: res.data.payment_params.package,//package
|
||||
signType: res.data.payment_params.signType,//MD5
|
||||
paySign: res.data.payment_params.sign,//签名
|
||||
success:(res)=> {
|
||||
this.$requst.post('order/paid',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('付款成功');
|
||||
this.checkList(this.activeIndex)
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
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){//取消订单原因选择事件
|
||||
this.reasonList.forEach(item=>item.isActive = false);
|
||||
this.reasonList[index].isActive = true;
|
||||
this.remarks = this.reasonList[index].title;
|
||||
},
|
||||
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.orderList.splice(this.current,1);
|
||||
this.page = 1;
|
||||
this.checkList(this.activeIndex);
|
||||
this.$toolAll.tools.showToast('取消成功');
|
||||
this.times = 0;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
}
|
||||
},
|
||||
confirmReceipt(id){//确认收货事件
|
||||
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('收货成功');
|
||||
this.checkList(this.activeIndex);
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
goDetail(id){//去订单详情
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/orderDetail/orderDetail?id=${id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.activeD::after{
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 8rpx;
|
||||
background: #3875F6;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,284 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'修改资料'" :whereCome="whereCome" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="fon28 pad-x20">
|
||||
<view v-for="(itemd,indexd) in dataList" :key="indexd"
|
||||
class="disjbac borbot mar-zy40" :class="(indexd!=1 && indexd!=5 && indexd!=6) ? 'pad-sx40':''">
|
||||
<!-- 标题 -->
|
||||
<view class="col9 flexs" style="width: 17.8%;">
|
||||
<view v-if="indexd!=2 && indexd!=3 && indexd!=7">{{itemd.title}}:</view>
|
||||
<!-- 恒美ID -->
|
||||
<view v-if="indexd==2" class="disjb">
|
||||
<view class="disjb width100">
|
||||
<view>{{itemd.title.charAt(0)}}</view>
|
||||
<view>{{itemd.title.charAt(1)}}</view>
|
||||
<view>{{itemd.title.charAt(2)}}{{itemd.title.charAt(3)}}</view>
|
||||
</view>
|
||||
<view>:</view>
|
||||
</view>
|
||||
<!-- 性别、地址 -->
|
||||
<view v-if="indexd==3 || indexd==7" class="disjb">
|
||||
<view class="disjb width100">
|
||||
<view>{{itemd.title.charAt(0)}}</view>
|
||||
<view>{{itemd.title.charAt(1)}}</view>
|
||||
</view>
|
||||
<view>:</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disac fe width100 tright">
|
||||
<!-- 内容 -->
|
||||
<view v-if="itemd.content!='' && (indexd!=1 && indexd!=5 && indexd!=6)" :class="indexd==1?'nic':'col3'" class="mar-y20 width100" :style="{marginRight:indexd==2?'39rpx':''}">{{itemd.content}}</view>
|
||||
<!-- 性别下拉弹框 -->
|
||||
<picker v-if="indexd==3" class="col3 mar-y20 width100" @change="changePicker" :value="current" :range="pickerData">
|
||||
<view>{{pickerData[current]}}</view>
|
||||
</picker>
|
||||
<!-- 出生日期下拉框 -->
|
||||
<picker v-if="indexd==4" mode="date" class="col3 mar-y20 width100" @change="changeTime" :value="currentt" :range="pickerTime">
|
||||
<view>{{pickerTime[currentt]}}</view>
|
||||
</picker>
|
||||
<!-- 地址下拉框 -->
|
||||
<!-- <picker v-if="indexd==7" mode="multiSelector" class="col3 mar-y20 width100" @change="changeAddress" :value="currenta" :range="pickerAddress">
|
||||
<view>{{pickerAddress[0]}}{{pickerAddress[1]}}{{pickerAddress[2]}}</view>
|
||||
</picker> -->
|
||||
<!-- <view v-if="indexd==7" @tap="openPicker" class="width100 mar-y20">{{region}}</view> -->
|
||||
<view v-if="indexd==7" @tap="openAddres2" class="width100 mar-y20">{{pickerText}}</view>
|
||||
<!-- 用户昵称、真实姓名、联系电话输入框 -->
|
||||
<input @focus="inputFo(indexd)" @blur="inputB(indexd)" v-if="indexd==1 || indexd==5 || indexd==6" :disabled="indexd==6" :type="(indexd==1 || indexd==5)?'text':'number'" :maxlength="indexd==6?11:10" v-model="itemd.content" class="mar-y20 tright pad-sx40 width100" style="border: none;" :placeholder="itemd.fcon"/>
|
||||
<!-- 用户头像 -->
|
||||
<image v-if="indexd==0" :src="itemd.imgSrc || moHead" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image>
|
||||
<!-- <image @tap="chooseHead" v-if="itemd.imgSrc!=''" :src="itemd.imgSrc" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image> -->
|
||||
<!-- 前进键 -->
|
||||
<image v-if="indexd!=0 && indexd!=2" src="/static/public/nexth.png" class="head_next flexs"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" @tap="updataInfo" style="height: 90rpx;line-height: 90rpx;margin: 80rpx 100rpx 120rpx 100rpx;" class="radius20 fon40 bold colf tc" :style="{background:publicColor}">{{btnCon}}</view>
|
||||
<!-- 底部弹框 -->
|
||||
<!-- <city @choseVal="choseValue" :lotusAddressData="lotusAddressData"></city> -->
|
||||
<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#007AFF"></simple-address>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import city from '@/components/city/city.vue';
|
||||
import simpleAddress from '@/components/simple-address/simple-address.vue';
|
||||
export default {
|
||||
components:{
|
||||
// city,
|
||||
simpleAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
moHead:'/static/public/logo.png',
|
||||
dataList:[
|
||||
{title:'用户头像',content:'',imgSrc:'',fcon:''},
|
||||
{title:'用户昵称',content:'',imgSrc:'',fcon:'请输入用户昵称'},
|
||||
{title:'恒美ID',content:'',imgSrc:'',fcon:''},
|
||||
{title:'性别',content:'',imgSrc:'',fcon:''},
|
||||
{title:'出生日期',content:'',imgSrc:'',fcon:''},
|
||||
{title:'真实姓名',content:'',imgSrc:'',fcon:'请输入真实姓名'},
|
||||
{title:'联系电话',content:'',imgSrc:'',fcon:'请输入联系电话'},
|
||||
{title:'地址',content:'',imgSrc:'',fcon:''},
|
||||
],
|
||||
isKuang:true,
|
||||
current:0,
|
||||
pickerData:['未知','男','女'],
|
||||
currentt:0,
|
||||
pickerTime:['1997-01-01'],
|
||||
currenta:0,
|
||||
// pickerAddress:['四川省 ','成都市 ','青羊区'],
|
||||
// lotusAddressData:{
|
||||
// visible:false,
|
||||
// provinceName:'',
|
||||
// cityName:'',
|
||||
// townName:'',
|
||||
// },
|
||||
// region:'四川省成都市成华区',
|
||||
cityPickerValueDefault: [0, 0, 1],
|
||||
pickerText: '四川省成都市成华区',
|
||||
btnCon:'保存',
|
||||
uinfo:{},
|
||||
addressInfo:[],
|
||||
newProvice:'',//当前省份
|
||||
newCity:'',//当前城市
|
||||
newDistrict:'',//当前区县
|
||||
whereCome:0,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('firstInfo')
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.whereNum==2){
|
||||
this.whereCome = options.whereNum
|
||||
}
|
||||
let chuo = new Date().getTime()// 获取当前时间戳
|
||||
let time = this.$toolAll.tools.timestampToTime(chuo)// 转换日期格式为XXXX-XX-XX
|
||||
// 获取当前位置的经纬度
|
||||
wx.getLocation({
|
||||
success:(res)=> {
|
||||
// 逆解析经纬度
|
||||
this.getDistrict(res.latitude, res.longitude)
|
||||
},
|
||||
})
|
||||
let firstObj = uni.getStorageSync('firstInfo')
|
||||
if(firstObj==''){
|
||||
let obj = uni.getStorageSync('uinfo')
|
||||
console.log(obj);
|
||||
if(obj!='') this.uinfo = obj
|
||||
this.dataList[0].imgSrc = obj.headimgurl//用户头像
|
||||
this.dataList[1].content = obj.nickname//用户昵称
|
||||
this.dataList[2].content = obj.coding//恒美ID
|
||||
this.current = obj.gender//性别1男,2女,0未知
|
||||
obj.birthday!='' ? this.pickerTime = [obj.birthday.slice(0,10)] : this.pickerTime = [time.slice(0,10)]//出生日期
|
||||
obj.real_name!=null && obj.real_name !='' ? this.dataList[5].content = obj.real_name : this.dataList[5].fcon = '未知'//真实姓名
|
||||
obj.mobile!='' ? this.dataList[6].content = obj.mobile : this.dataList[6].fcon = '未知'//电话
|
||||
if(obj.county!='') this.pickerText = obj.province + obj.city + obj.county//省市区县
|
||||
} else {
|
||||
this.dataList[0].imgSrc = firstObj.headimgurl//用户头像
|
||||
this.dataList[1].content = firstObj.nickname//用户昵称
|
||||
this.dataList[2].content = firstObj.coding//恒美ID
|
||||
this.current = firstObj.gender//性别1男,2女,0未知
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancleEv(){
|
||||
uni.setStorageSync('bindPhone',false)
|
||||
},
|
||||
updataInfo(){//修改资料事件
|
||||
let params = {
|
||||
real_name:this.dataList[5].content,//姓名
|
||||
nickname:this.dataList[1].content,//昵称
|
||||
mobile:this.dataList[6].content,//手机号
|
||||
gender:this.current,//性别,0未知,1男,2女
|
||||
province:this.addressInfo[0],//省份
|
||||
city:this.addressInfo[1],//市
|
||||
county:this.addressInfo[2],//区县
|
||||
birthday:this.pickerTime[0]//生日(出生年月),日期格式:2021-08-10
|
||||
}
|
||||
this.$requst.post('user/edit-info',params).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('资料修改成功')
|
||||
setTimeout(()=>{
|
||||
if(this.whereCome==2){
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/my/my'
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
getDistrict(latitude, longitude) {//获取当前位置的省市区县
|
||||
let ya = this
|
||||
wx.request({
|
||||
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=B2ABZ-SIDKS-WD2O3-6CJ2U-CDZOT-U3FKF`,
|
||||
header: {
|
||||
'Content-Type':'application/json'
|
||||
},
|
||||
success:function(res) {
|
||||
// console.log('地址数据:',res)
|
||||
ya.newProvice = res.data.result.address_component.province
|
||||
ya.newCity = res.data.result.address_component.city
|
||||
ya.newDistrict = res.data.result.address_component.district
|
||||
if(ya.pickerText=='') ya.pickerText = ya.newProvice + ya.newCity + ya.newDistrict
|
||||
}
|
||||
})
|
||||
},
|
||||
openAddres2() {//地址弹框事件
|
||||
// 根据 label 获取
|
||||
var index = this.$refs.simpleAddress.queryIndex([this.newProvice, this.newCity, this.newDistrict], 'label');
|
||||
this.cityPickerValueDefault = index.index;
|
||||
this.$refs.simpleAddress.open();
|
||||
},
|
||||
onConfirm(e) {//地址确认事件
|
||||
this.pickerText = e.labelArr[0]+e.labelArr[1]+e.labelArr[2];
|
||||
this.addressInfo = [e.labelArr[0],e.labelArr[1],e.labelArr[2]]
|
||||
},
|
||||
chooseHead(){//选择头像事件
|
||||
uni.chooseImage({
|
||||
count:1,
|
||||
success: (res) => {
|
||||
this.dataList[0].imgSrc = res.tempFilePaths[0]
|
||||
}
|
||||
})
|
||||
},
|
||||
changePicker(e){//性别选择
|
||||
this.current = e.detail.value
|
||||
},
|
||||
changeTime(e){//出生日期选择
|
||||
this.pickerTime = [e.detail.value]
|
||||
},
|
||||
changeAddress(e){
|
||||
|
||||
},
|
||||
inputFo(index){//输入框获取焦点
|
||||
if(this.dataList[index].content!=''){
|
||||
this.dataList[index].fcon = this.dataList[index].content//将当前输入框的实际值赋值给当前输入框的placeholder属性
|
||||
this.dataList[index].content = ''//清空当前输入框的实际值
|
||||
}
|
||||
},
|
||||
inputB(index){//输入框失去焦点
|
||||
if(index==1){
|
||||
if(this.dataList[1].content==''){
|
||||
this.dataList[1].content = this.uinfo.nickname
|
||||
}
|
||||
}
|
||||
if(index==5){
|
||||
if(this.dataList[5].content==''){
|
||||
this.dataList[5].content = this.uinfo.real_name
|
||||
}
|
||||
}
|
||||
if(index==6){
|
||||
if(this.dataList[6].content==''){
|
||||
this.dataList[6].content = this.uinfo.mobile
|
||||
}
|
||||
}
|
||||
}
|
||||
//打开picker
|
||||
// openPicker() {
|
||||
// this.lotusAddressData.visible = true;
|
||||
// this.lotusAddressData.provinceName = this.newProvice;
|
||||
// this.lotusAddressData.cityName = this.newCity;
|
||||
// this.lotusAddressData.townName = this.newDistrict;
|
||||
// },
|
||||
//回传已选的省市区的值
|
||||
// choseValue(res){
|
||||
// //res数据源包括已选省市区与省市区code
|
||||
// // console.log(res);
|
||||
// this.lotusAddressData.visible = res.visible;//visible为显示与关闭组件标识true显示false隐藏
|
||||
// //res.isChose = 1省市区已选 res.isChose = 0;未选
|
||||
// if(res.isChose){
|
||||
// this.lotusAddressData.provinceName = res.province;//省
|
||||
// this.lotusAddressData.cityName = res.city;//市
|
||||
// this.lotusAddressData.townName = res.town;//区
|
||||
// this.region = `${res.province} ${res.city} ${res.town}`; //region为已选的省市区的值
|
||||
// this.regionObj = {
|
||||
// province:res.province,
|
||||
// provinceCode:res.provinceCode,
|
||||
// city:res.city,
|
||||
// cityCode:res.cityCode,
|
||||
// town:res.town,
|
||||
// townCode:res.townCode
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{background-color: #FFFFFF;}
|
||||
</style>
|
|
@ -0,0 +1,230 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'孔雀币管理'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 fon28 col3 pad-x180">
|
||||
<view class="mar-s20 bacf pad20 radius20">
|
||||
<view class="mar-x30">当前孔雀币</view>
|
||||
<view class="disjbac">
|
||||
<view class="disjcac fc width33" style="align-items: flex-start;">
|
||||
<view class="fon36 bold mar-z20">{{dangKQ}}</view>
|
||||
<view class="mar-s36 coin-tx-btn" @tap="isTiX=true">提现</view>
|
||||
</view>
|
||||
<view class="disjcac fc width33">
|
||||
<view class="fon36 bold">{{shenHZ}}<span class="coin-yuan">元</span></view>
|
||||
<view class="mar-s36 fon26 col3 coin-miao">审核中</view>
|
||||
</view>
|
||||
<view class="disjcac fc width33">
|
||||
<view class="fon36 bold">{{yiTKQ}}<span class="coin-yuan">元</span></view>
|
||||
<view class="mar-s36 fon26 col3 coin-miao">已提现</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 获取列表,提现列表 -->
|
||||
<view class="mar-s20 bacf pad20 radius20">
|
||||
<view class="mar-x50 fon28 disja">
|
||||
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">获取列表</view>
|
||||
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">支出列表</view>
|
||||
</view>
|
||||
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
||||
<view>
|
||||
<view class="fon26 col3">{{item.title}}</view>
|
||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||
</view>
|
||||
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
|
||||
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分享按钮 -->
|
||||
<view class="disjcac coin-share-box">
|
||||
<image src="/static/public/bottom-shear.png" mode=""></image>
|
||||
<view class="fon40 colf bold mar-z10">分享给好友</view>
|
||||
<button class="posia-op" open-type="share"></button>
|
||||
</view>
|
||||
<!-- 提现弹框 -->
|
||||
<view v-if="isTiX" @tap="isTiX=false" class="disjcac tc tx-tk-box">
|
||||
<view class="bacf width100 radius20 pad30 mar-zy85" @tap.stop="isTiX=true">
|
||||
<view class="fon28 bold col34">孔雀币提现</view>
|
||||
<view class="fon28 mar-s30 col34 font5">兑换比例{{kqbl}}孔雀币兑换{{whatPrice}}元人民币</view>
|
||||
<view class="fon24 mar-s10 mar-x30 colf8 font5">最低提现金额为:{{limit_price}}元。</view>
|
||||
<input type="number" v-model="kNum" placeholder="请输入孔雀币" class="width100 radius10"/>
|
||||
<view class="disjbac">
|
||||
<view @tap.stop="confrimT" class="tk-btn pbackc">立即提现</view>
|
||||
<view @tap.stop="isTiX=false" class="tk-btn">暂不提现</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
activeJF:true,
|
||||
kNum:'',//输入框孔雀币数量
|
||||
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'},
|
||||
],
|
||||
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,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
realPrice:0,//实际的钱
|
||||
limit_price:0//最低限制金额
|
||||
}
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/peacockCoin/peacockCoin?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkInfo();
|
||||
this.checkList(this.ntype);
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
confrimT(){//确定提现事件、
|
||||
this.realPrice = this.whatPrice / this.kqbl * this.kNum;
|
||||
if(this.kNum=='' || this.kNum<=0){
|
||||
this.$toolAll.tools.showToast('请输入孔雀币数量');
|
||||
} else if(this.kNum > this.dangKQ){
|
||||
this.$toolAll.tools.showToast('请输入正确的孔雀币数量');
|
||||
} else if((this.limit_price - this.realPrice) > 0 ){
|
||||
this.$toolAll.tools.showToast(`最低提现${this.limit_price}元`);
|
||||
} else {
|
||||
if(this.times==0){
|
||||
this.times++;
|
||||
this.$requst.post('user/withdrawal-coin',{coin:this.kNum}).then(res=>{
|
||||
if(res.code==0){
|
||||
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.limit_price = res.data.limit_price*1;//限制金额
|
||||
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>
|
|
@ -0,0 +1,228 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'积分商城'" :statusTitle="true"></status-nav>
|
||||
<!-- 搜索输入框 -->
|
||||
<view class="search-input-box bacf poszy jf-input-box" :style="{top: statusHNH+'px'}">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<!-- 输入框 -->
|
||||
<input class="width100 fon34 radius10" @confirm="searchKey" type="text" v-model="searchVal" placeholder="请输入商品名称"/>
|
||||
<!-- 搜索 -->
|
||||
<view class="flexs mar-z30 radius10 pad-zy40 fon34 colf" @tap="searchKey" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
<!-- 分类标题 -->
|
||||
<view class="disjbac pad-zy20 pad-s20 bacf fon24">
|
||||
<view v-for="(item,index) in shopCate" class="disjcac" @tap="chooseShopCate(index)" :class="activeIndex==index?'activecate':'shopMo'" :style="{background:activeIndex==index?publicColor:'#F2F2F2'}" :key="index">
|
||||
<span>{{item}}</span>
|
||||
<view class="disjcac fc mar-z10" v-if="index==2 || index==3">
|
||||
<image src="/static/public/address-top.png" mode=""></image>
|
||||
<image src="/static/public/address-down.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 数据列表 -->
|
||||
<view :style="{marginTop:statusHNH+titleHeight+'px'}">
|
||||
<score-list id="myComponent" :dataList="dataList" v-if="dataList.length!=0"></score-list>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}积分商品`"></nothing-page>
|
||||
</view>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
|
||||
<!-- 购物车 -->
|
||||
<navigator url="/pagesA/shopCart/shopCart?isScore=score" 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>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scoreList from '@/components/score-list.vue';
|
||||
export default {
|
||||
components:{
|
||||
scoreList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titleList:[],
|
||||
imgList:[],
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),
|
||||
activeIndex:0,
|
||||
shopCate:['综合','最新','兑换量','积分'],
|
||||
titleHeight:'',//标题高度
|
||||
dataList:[],
|
||||
searchVal:'',//关键词搜索
|
||||
type:'normal',//type=normal综合 newest=最新
|
||||
sort_field:'',//排序字段 score=积分 num=兑换量
|
||||
sort_value:'asc',//排序值 asc=升序 desc=降序
|
||||
cishu:0,
|
||||
cartNum:0,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.cartNumEv();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/pointsMall/pointsMall?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect.height);
|
||||
this.titleHeight = rect.height
|
||||
}).exec()
|
||||
this.checkList();
|
||||
let maiOjb = {
|
||||
e:12,//进入商城
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cartNumEv(){//购物车数量
|
||||
this.$requst.post('order/shopping-cart-count',{type:'score'}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.cartNum = res.data.count;
|
||||
}
|
||||
})
|
||||
},
|
||||
checkList(){//查询列表事件
|
||||
let params = {
|
||||
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||
page:1,
|
||||
size:10,
|
||||
type:this.type,//type=normal综合 newest=最新
|
||||
sort_field:this.sort_field,//排序字段 score=积分 num=兑换量
|
||||
sort_value:this.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('暂无更多积分商品')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
searchKey(){//搜索事件
|
||||
if(this.activeIndex==0) {
|
||||
this.clearVal();
|
||||
this.type = 'normal';
|
||||
}
|
||||
if(this.activeIndex==2 || this.activeIndex==3) this.sort_value = 'asc';
|
||||
this.checkList();
|
||||
},
|
||||
chooseShopCate(index){//大分类选择事件
|
||||
this.activeIndex = index;
|
||||
this.type = '';
|
||||
this.sort_field = '';
|
||||
if(index==0) this.type = 'normal';
|
||||
if(index==1) this.type = 'newest';
|
||||
this.cishu++
|
||||
if(index==2) {
|
||||
this.sort_field = 'amount';
|
||||
if(this.cishu%2==0) {
|
||||
this.sort_value = 'asc';
|
||||
} else this.sort_value = 'desc';
|
||||
}
|
||||
if(index==3) {
|
||||
this.sort_field = 'score';
|
||||
if(this.cishu%2==0) {
|
||||
this.sort_value = 'asc';
|
||||
} else this.sort_value = 'desc';
|
||||
}
|
||||
this.checkList();
|
||||
},
|
||||
clearVal(){
|
||||
this.type = '';
|
||||
this.sort_field = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{background: #F5F5F5;}
|
||||
.activecate,.shopMo{border-radius: 20rpx;text-align: center;background-color: #f2f2f2;color: #333333;padding: 16rpx 25rpx;width: 100rpx;}
|
||||
.activecate{color: #FFFFFF;}
|
||||
.activecate image{
|
||||
-webkit-filter: invert(1); /* Chrome, Safari, Opera */
|
||||
filter: invert(1);
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,301 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'自主预约'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy20">
|
||||
<view class="bacf mar-s25 pad-zy20 radius20 fon28 col3 pad-x40">
|
||||
<view class="disac pad-s32">
|
||||
<view class="flexs mar-y20">预约类别</view>
|
||||
<view @tap="openXial(0)" class="disjbac width100 radius10 pad-zy20 xiala posir">
|
||||
<view>{{category}}</view>
|
||||
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol pbord':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class=" disac pad-s32">
|
||||
<view class="flexs mar-y20">选择医生</view>
|
||||
<view @tap="openXial(1)" class="disjbac width100 radius10 pad-zy20 xiala posir">
|
||||
<view>{{categoryT}}</view>
|
||||
<image :class="isZhuanT?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<view v-if="isZhuanT" class="posia bacf radius10 xial-box">
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXiaT(indext)" :class="xialCT==indext?'pcol':''" v-for="(itemt,indext) in xialTwo" :key="indext">{{itemt}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 预约日期 -->
|
||||
<view class="mar-s20 mar-x30">预约日期</view>
|
||||
<scroll-view scroll-x >
|
||||
<view class="disac">
|
||||
<view @tap="chooseTime(index)" class="disjcac fc flexs radius20 mar-y20 yutime borbot-df" :class="item.status==0?'bcdb col3':'colc'" :style="{background:timeCurrent==index?publicColor:'',border:timeCurrent==index?`2rpx solid ${publicColor}`:''}" v-for="(item,index) in dataList" :key="index">
|
||||
<view :class="timeCurrent==index?'colf':'col3'" class="bold fon28">{{item.title}}</view>
|
||||
<view :class="timeCurrent==index?'colf':''" class="fon26 mar-s10">{{item.time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 时间段 -->
|
||||
<view class="mar-s20 mar-x10">时 间 段</view>
|
||||
<view class="disjb fw">
|
||||
<view @tap="chooseTD(indextd)" :style="{background:itemtd.tdStatus?publicColor:'',border:itemtd.tdStatus?`2rpx solid ${publicColor}`:''}" :class="itemtd.num==0?'bcdb':''" class="tc radius10 mar-x30 col3 timed borbot-df" v-for="(itemtd,indextd) in dataTD" :key="indextd">
|
||||
<view :class="itemtd.tdStatus?'colf':''">{{itemtd.ttime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系人 -->
|
||||
<view class="disac mar-s30">
|
||||
<view class="mar-y20 flexs titlel">联 系 人</view>
|
||||
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
|
||||
<input v-model="lname" maxlength="10" class="fon28 height-68" type="text" placeholder="请填写联系人姓名"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系方式 -->
|
||||
<view class="disac mar-s20">
|
||||
<view class="mar-y20 flexs titlel">联系方式</view>
|
||||
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
|
||||
<input v-model="lphone" maxlength="11" class="fon28 height-68" type="text" placeholder="请输入联系电话"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 留言信息 -->
|
||||
<view class="dis mar-s20">
|
||||
<view class="mar-y20 flexs mar-s20 titlel">留言信息</view>
|
||||
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
|
||||
<textarea v-model="lmsg" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请填写内容"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 立即提交底部按钮 -->
|
||||
<view @tap="submit" class="fon30 radius20 tc colf bold0 btnl" :style="{background:publicColor}">{{btnCon}}</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :isCenter="true" :contentVal="'提交成功!等待审核'" :comfrimVal="'好的'" @comfirmev="comfirmev"></pu-po>
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nright="20"></public-customer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
timeCurrent:0,
|
||||
dataList:[],//日期
|
||||
dataTD:[],//时间段
|
||||
isShowT:false,
|
||||
lname:'',//联系人姓名
|
||||
lphone:'',//联系方式
|
||||
lmsg:'',//留言信息
|
||||
isZhuan:false,
|
||||
xialCurrent:0,
|
||||
xialone:[],
|
||||
category:'',
|
||||
categoryT:'',
|
||||
isZhuanT:false,
|
||||
xialCT:0,
|
||||
xialTwo:['杨幂','周星驰'],
|
||||
type_id:'',//预约类别ID
|
||||
gday:'',//日期
|
||||
dtId:[],//暂存禁选时间段ID
|
||||
zanTimeD:[],//暂存时间段
|
||||
zanDay:[],//暂存日期
|
||||
dangId:'',//当前预约时间段ID
|
||||
btnCon:'立即提交'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.category = this.xialone[0]
|
||||
this.categoryT = this.xialTwo[0]
|
||||
this.checkZParmas();
|
||||
this.lphone = uni.getStorageSync('phone');
|
||||
// this.$toolAll.tools.weekDate()
|
||||
},
|
||||
methods: {
|
||||
gtimeD(id,gday){
|
||||
this.$requst.post('user/appointment-period-full',{type_id:id,day:gday}).then(res=>{
|
||||
// console.log('查询预约分类某天已约满的时间段:',res);
|
||||
if(res.code==0){
|
||||
this.dtId = res.data
|
||||
this.dataTD = []
|
||||
if(this.dtId.length!=0){
|
||||
this.zanTimeD.forEach((item,index)=>{
|
||||
let newNum = 1
|
||||
let newTdStatus = false
|
||||
this.dtId.forEach(item1=>{
|
||||
if(item.id==item1.id){
|
||||
newNum = 0
|
||||
newTdStatus = false
|
||||
}
|
||||
})
|
||||
let tdObj = {
|
||||
id:item.id,
|
||||
ttime:item.ttime,
|
||||
num:newNum,
|
||||
status:item.status,
|
||||
tdStatus:newTdStatus
|
||||
}
|
||||
this.dataTD.push(tdObj)
|
||||
})
|
||||
} else {
|
||||
this.zanTimeD.forEach(item=>{
|
||||
let tdObj = {
|
||||
id:item.id,
|
||||
ttime:item.ttime,
|
||||
num:1,
|
||||
status:item.status,
|
||||
tdStatus:false
|
||||
}
|
||||
this.dataTD.push(tdObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkZParmas(){//查询参数
|
||||
this.$requst.post('user/appointment-parameters',{page:1,size:20}).then(res=>{
|
||||
// console.log('查询自主预约列表:',res);
|
||||
if(res.code==0){
|
||||
this.gtimeD(res.data.types[0].id,res.data.days[0].day)
|
||||
// 预约类别
|
||||
if(res.data.types.length!=0){
|
||||
res.data.types.forEach(item=>{
|
||||
let ycateObj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
max:item.max
|
||||
}
|
||||
this.xialone.push(ycateObj)
|
||||
})
|
||||
this.type_id = this.xialone[0].id
|
||||
this.category = this.xialone[0].title
|
||||
}
|
||||
//预约日期
|
||||
if(res.data.days.length!=0){
|
||||
this.gday = res.data.days[0].day
|
||||
this.zanDay = res.data.days
|
||||
res.data.days.forEach(item=>{
|
||||
let arr = item.day.split('-')
|
||||
let newDay = arr[1]+'月'+arr[2]+'日'
|
||||
let dayObj = {
|
||||
title:item.week,
|
||||
time:newDay,
|
||||
status:item.status
|
||||
}
|
||||
this.dataList.push(dayObj)
|
||||
})
|
||||
}
|
||||
// 时间段
|
||||
if(res.data.times.length!=0){
|
||||
res.data.times.forEach((item,index)=>{
|
||||
let tdObj = {
|
||||
id:item.id,
|
||||
ttime:item.name,
|
||||
status:item.status,
|
||||
}
|
||||
// this.dataTD.push(tdObj)
|
||||
this.zanTimeD.push(tdObj)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
submit(){
|
||||
if(!this.lname){
|
||||
this.$toolAll.tools.showToast('请输入联系人姓名')
|
||||
} else if(!this.lphone){
|
||||
this.$toolAll.tools.showToast('请输入联系电话')
|
||||
} else if(this.$toolAll.tools.isPhone(this.lphone)){
|
||||
this.$toolAll.tools.showToast('请输入正确的联系电话')
|
||||
} else if(!this.dangId){
|
||||
this.$toolAll.tools.showToast('请选择时间段')
|
||||
} else {
|
||||
let parmas = {
|
||||
type_id:this.type_id,//预约类型ID
|
||||
day:this.gday,//预约日期,如:2021-08-11
|
||||
period_id:this.dangId,//预约时间段ID
|
||||
user_name:this.lname,//联系人姓名
|
||||
user_phone:this.lphone,//联系人电话
|
||||
remarks:this.lmsg//预约留言信息,(500字以内)
|
||||
}
|
||||
if(this.btnCon=='立即提交'){
|
||||
this.btnCon = "正在提交..."
|
||||
this.$requst.post('user/appointment-apply',parmas).then(res=>{
|
||||
// console.log('提交预约申请:',res);
|
||||
if(res.code==0){
|
||||
this.isShowT = true
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['uvGd7RqaegheGU-uVxR-uM3y2MadZeMOHdQaNiiWm8U'],
|
||||
success: (res)=> {
|
||||
console.log('res',res);
|
||||
this.isShowT = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.btnCon = "立即提交"
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
}
|
||||
},
|
||||
comfirmev(){
|
||||
this.isShowT = false
|
||||
uni.navigateBack({delta:1})
|
||||
},
|
||||
goYu(){//去预约
|
||||
uni.navigateTo({
|
||||
url:''
|
||||
})
|
||||
},
|
||||
chooseTime(index){
|
||||
if(this.dataList[index].status!=0){
|
||||
this.timeCurrent = index
|
||||
this.gday = this.zanDay[index].day
|
||||
this.gtimeD(this.type_id,this.gday)
|
||||
}
|
||||
},
|
||||
chooseTD(index){//时间段选择事件
|
||||
if(this.dataTD[index].num!=0){
|
||||
this.dangId = this.zanTimeD[index].id
|
||||
this.dataTD.forEach(item=>{//发现为true的改为false,即控制单选,注释就表示多选
|
||||
if(item.tdStatus==true) item.tdStatus = false
|
||||
})
|
||||
this.dataTD[index].tdStatus = !this.dataTD[index].tdStatus
|
||||
}
|
||||
},
|
||||
openXial(index){
|
||||
if(index==0) {
|
||||
this.isZhuanT = false
|
||||
this.isZhuan = !this.isZhuan
|
||||
}
|
||||
if(index==1) {
|
||||
this.isZhuan = false
|
||||
this.isZhuanT = !this.isZhuanT
|
||||
}
|
||||
},
|
||||
chooseXia(index){//预约类别选择事件
|
||||
this.xialCurrent = index
|
||||
this.category = this.xialone[index].title
|
||||
this.type_id = this.xialone[index].id
|
||||
this.gtimeD(this.type_id,this.gday)
|
||||
},
|
||||
chooseXiaT(index){
|
||||
this.xialCT = index
|
||||
this.categoryT = this.xialTwo[index]
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,310 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 pad-x160">
|
||||
<view class="bacf radius20 mar-s20 pad20" v-if="cartList.length!=0">
|
||||
<view class="fon28 col3 disjbac" style="height: 43rpx;">
|
||||
<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(1)" class="edit-btn">管理 ×</view>
|
||||
</view>
|
||||
<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 @tap="chooseItem(index)">
|
||||
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="flexs chooseDX" mode=""></image>
|
||||
<image v-else src="/static/public/cancle-FS.png" class="flexs chooseDX" mode=""></image>
|
||||
</view>
|
||||
<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">
|
||||
<view @tap="goShoptDetail(item.spu_id,item.spu_activity_id)" class="fon28 col3 bold clips2">{{item.title}}</view>
|
||||
<view class="order-sy">{{item.sku_name}}</view>
|
||||
</view>
|
||||
<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="fon26 col3 disac bold cart-input-box">
|
||||
<image @tap="deladdEvent(index , 0)" src="/static/public/del.png" mode=""></image>
|
||||
<input type="text" @input="inputNum($event,index)" v-model="item.num"/>
|
||||
<image @tap="deladdEvent(index , 1)" src="/static/public/add.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="showDel && isDang==index" @tap="deltItem(index)" class="item-del-btn">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<nothing-page v-if="cartList.length==0" :content="'暂无更多商品'"></nothing-page>
|
||||
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
|
||||
<view class="disac" @tap="chooseAll">
|
||||
<view class="chooseAll-box">
|
||||
<view v-if="isChooseAll"></view>
|
||||
</view>
|
||||
<view class="fon28 col3 mar-z10">全选</view>
|
||||
</view>
|
||||
<!-- 去支付 -->
|
||||
<view v-if="!cancle_del" class="disjbac">
|
||||
<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>
|
||||
<view @tap="goGetReadyDan" class="colf fon30 bold mar-z10 goBuy-btn" style="background: #3875F6;">{{cartList.length==0?'去购物':'去支付'}}</view>
|
||||
</view>
|
||||
<!-- 删除 -->
|
||||
<view @tap="delBtn" v-else class="colf fon28 bold goBuy-btn" style="background: #F85050;">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
showDel:false,
|
||||
startX:'',//开始位置
|
||||
endX:'',//结束位置
|
||||
cancle_del:false,
|
||||
cartList:[],//购物车列表
|
||||
isChooseAll:false,//是否全选
|
||||
isDang:0,//当前抹动的item
|
||||
newList:[],//暂存准备购买商品
|
||||
delIndex:[],//待删除商品的ID
|
||||
page:1,
|
||||
size:10,
|
||||
isScore:'',
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
timeout:null
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
uni.removeStorageSync('orderList');
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/shopCart/shopCart?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
options.isScore=='score' ? this.isScore = 'score' : ''
|
||||
this.checkList();
|
||||
},
|
||||
computed:{
|
||||
allPrice(){
|
||||
let sum = 0
|
||||
this.cartList.forEach(item=>{
|
||||
if(item.isActive) sum += item.price*1 * item.num
|
||||
})
|
||||
return sum;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 数量输入事件
|
||||
inputNum(e,index){
|
||||
clearTimeout(this.timeout);
|
||||
let str = e.detail.value;
|
||||
this.timeout = setTimeout(()=>{
|
||||
if(str=='' || str==0){
|
||||
this.cartList[index].num = 1;
|
||||
}
|
||||
},500)
|
||||
},
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkList(){//查询列表事件
|
||||
this.$requst.post('order/shopping-cart',{page:this.page,size:this.size,type:this.isScore}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let nprice = '';
|
||||
item.is_score ==1 ? nprice = item.score : nprice = item.sku.sku_price/100;
|
||||
let obj = {
|
||||
id:item.id,
|
||||
spu_id:item.spu.id,
|
||||
spu_activity_id:item.spu_activity_id,//活动商品id
|
||||
imgSrc:this.$http + item.spu.spu_cover,
|
||||
coding:item.sku.coding,
|
||||
title:item.spu_name,
|
||||
sku_name:item.sku.sku_name,
|
||||
price:nprice,//实际价格
|
||||
num:item.num,
|
||||
isActive:false,
|
||||
is_score:item.is_score,//是否是积分
|
||||
group_id:0//0发起拼团 1参与拼团 2单独购买
|
||||
}
|
||||
this.cartList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
deltItem(index){//删除购物车
|
||||
this.$requst.post('order/shopping-cart-del',{id:this.cartList[index].id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.cartList.splice(index,1);
|
||||
this.$toolAll.tools.showToast('删除成功');
|
||||
}
|
||||
})
|
||||
},
|
||||
deladdEvent(cur,index){//数量加减事件
|
||||
if(index==0){//减少数量
|
||||
if(this.cartList[cur].num>1) this.cartList[cur].num--;
|
||||
} else {//增加数量
|
||||
this.cartList[cur].num++;
|
||||
}
|
||||
this.$requst.post('order/shopping-cart-change-num',{id:this.cartList[cur].id,num:this.cartList[cur].num}).then(res=>{})
|
||||
this.zanList();
|
||||
},
|
||||
chooseItem(index){//单选事件
|
||||
this.cartList[index].isActive = !this.cartList[index].isActive;
|
||||
let one = this.cartList.filter(function(item){
|
||||
return item.isActive == false;
|
||||
})
|
||||
one.length==0 ? this.isChooseAll = true : this.isChooseAll = false
|
||||
this.zanList();
|
||||
},
|
||||
chooseAll(){//全选事件
|
||||
this.isChooseAll = !this.isChooseAll;
|
||||
this.cartList.forEach(item=>{
|
||||
this.isChooseAll ? item.isActive = true : item.isActive = false;
|
||||
})
|
||||
this.zanList();
|
||||
},
|
||||
zanList(){//暂存选中商品事件
|
||||
this.delIndex = []
|
||||
this.newList = this.cartList.filter(item=>item.isActive==true);
|
||||
if(this.cancle_del){
|
||||
this.cartList.filter((item,index)=>{
|
||||
if(item.isActive) {
|
||||
this.delIndex.push(item.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
delBtn(){//底部删除事件
|
||||
this.delIndex.forEach(item=>{
|
||||
this.cartList.forEach((item1,index)=>{
|
||||
if(item==item1.id){
|
||||
this.cartList.splice(index,1);
|
||||
this.$requst.post('order/shopping-cart-del',{id:item1.id}).then(res=>{
|
||||
if(res.code==0){
|
||||
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
this.isChooseAll = false;
|
||||
if(this.cartList.length==0){
|
||||
this.cancle_del = false;
|
||||
}
|
||||
},
|
||||
guanEv(index){//管理切换事件
|
||||
index==0 ? this.cancle_del = true : this.cancle_del = false;
|
||||
this.cartList.forEach(item=>item.isActive=false);
|
||||
this.isChooseAll = false;
|
||||
},
|
||||
moveStart(index,e){//移动开始
|
||||
this.isDang = index;
|
||||
this.startX = e.touches[0].pageX
|
||||
},
|
||||
moveEnd(e){//移动结束
|
||||
this.endX = e.changedTouches[0].pageX
|
||||
if(this.startX-this.endX>0){
|
||||
this.showDel = true;
|
||||
} else this.showDel = false;
|
||||
},
|
||||
goGetReadyDan(){
|
||||
let newUrl = '';
|
||||
let isNei = '';
|
||||
if(this.isScore=='score') {
|
||||
isNei = 3
|
||||
}
|
||||
if(this.cartList.length == 0) {
|
||||
if(isNei==3){
|
||||
newUrl = '/pagesA/pointsMall/pointsMall';
|
||||
} else {
|
||||
newUrl = '/pages/tabbar/shop/shop';
|
||||
}
|
||||
uni.navigateTo({
|
||||
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>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,189 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'签到管理'" :statusTitle="true"></status-nav>
|
||||
<view v-if="loading" :style="{paddingTop: statusHNH+'px'}" class=" fon28 col3">
|
||||
<view style="position: sticky;z-index: 3;background: #FFFFFF;padding-bottom: 20rpx;" :style="{top:statusHNH+'px'}">
|
||||
<view class="posir">
|
||||
<image class="posia width100" src="/static/public/sign-01.png" mode="widthFix"></image>
|
||||
<view class="posir tc pad-sx20" style="z-index: 5;">
|
||||
<image v-if="isSigin==0" @tap="siginEv" src="/static/public/sign-02.png" mode="" class="sigin-img"></image>
|
||||
<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">
|
||||
<image src="/static/public/sign-03.png" class="sigin-success" mode=""></image>
|
||||
<view class="bold colf mar-z10 fon56">{{user_score}}</view>
|
||||
</view>
|
||||
<view class="disjb pad-zy30">
|
||||
<view v-for="(item,index) in timeList" :key="index" class="disjcac fc">
|
||||
<view class="disjcac fon24 posir sigin-day" :style="{color:item.isSign?'#789CFB':'#FFFFFF',background:item.isSign?'#FFFFFF':''}">
|
||||
+{{item.num}}
|
||||
<image v-if="item.isSign==1" class="posia" src="/static/public/gou.png" mode=""></image>
|
||||
</view>
|
||||
<view class="fon28 colf mar-s20">{{item.day}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-s20 fon28 col3 bold mar-z50">积分签到</view>
|
||||
</view>
|
||||
<!-- 获取列表,提现列表 -->
|
||||
<view class="pad-zy30">
|
||||
<view class="bacf pad-zy20 pad-x20 radius20">
|
||||
<scroll-view scroll-y="true" v-if="dataList.length!=0">
|
||||
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
|
||||
<view>
|
||||
<view class="fon26 col3">{{item.title}}</view>
|
||||
<view class="mar-s10 fon20 col9">{{item.time}}</view>
|
||||
</view>
|
||||
<view class="fon36 bold pcol">+{{item.num}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-else class="fon24 col6 tc pad-s50">暂无积分签到</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
timeList:[],
|
||||
dataList:[
|
||||
// {title:'签到积分',time:'2021.09.06 10:30:10',num:'1'},
|
||||
],
|
||||
user_score:0,//账户余额
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
isSigin:0,
|
||||
loading:false,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkTime()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000,'bottom')
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesA/signIn/signIn?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.$toolAll.tools.isLogin();
|
||||
this.checkTime();
|
||||
this.checkList();
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
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){
|
||||
if(this.page==1) this.dataList = [];
|
||||
this.total = res.data.total;
|
||||
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>
|
||||
|
||||
<style>
|
||||
page{background-color: #FFFFFF;}
|
||||
</style>
|
|
@ -0,0 +1,213 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'投诉与建议'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy20">
|
||||
<view class="bacf mar-s25 pad-zy20 radius20 fon28 col3 pad-x40">
|
||||
<!-- 问题类型 -->
|
||||
<view class="disac pad-s32">
|
||||
<view class="flexs mar-y20 titlel">问题类型</view>
|
||||
<radio-group @change="changeCate" class="width100 disac">
|
||||
<label class="radio disac">
|
||||
<radio style="transform: scale(.7);" :value="2" checked color="#3875f6"/><text>改进意见/建议</text>
|
||||
</label>
|
||||
<label class="radio disac">
|
||||
<radio style="transform: scale(.7);" :value="1" color="#3875f6"/><text>投诉</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
<!-- <radio-group @change="changeCate" class="width100 disac">
|
||||
<label class="radio disac" v-for="(iteml,indexl) in xialone" :key="indexl">
|
||||
<radio style="transform: scale(.7);" :value="iteml.id" :checked="indexl==0" color="#3875f6"/><text>{{iteml.title}}</text>
|
||||
</label>
|
||||
</radio-group> -->
|
||||
<!-- 下拉列表 -->
|
||||
<!-- <view @tap="openXial" class="disjbac width100 radius10 pad-zy20 xiala posir">
|
||||
<view>{{category}}</view>
|
||||
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 建议意见 -->
|
||||
<view class="dis mar-s20">
|
||||
<view class="mar-y20 flexs mar-s20 titlel">意见建议</view>
|
||||
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
|
||||
<textarea v-model="tmsg" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请把您的意见及建议填写在这里" placeholder-style="color:#999999;"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 姓名 -->
|
||||
<view class="disac mar-s30">
|
||||
<view class="mar-y20 flexs titlel disjb">
|
||||
<view>称</view>
|
||||
<view class="mar-y10">呼</view>
|
||||
</view>
|
||||
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
|
||||
<input v-model="tname" class="fon28 height-68" type="text" value="" placeholder="我们怎么称呼您" placeholder-style="color:#999999;"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 联系电话 -->
|
||||
<view class="disac mar-s20">
|
||||
<view class="mar-y20 flexs titlel">联系电话</view>
|
||||
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
|
||||
<input v-model="tphone" maxlength="11" class="fon28 height-68" type="text" value="" placeholder="请输入联系电话" placeholder-style="color:#999999;"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view @tap="submit" class="fon30 radius20 tc colf bold0 btnl" :style="{background:publicColor}">{{btnCon}}</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :isCenter="true" :contentVal="'提交成功!等待审核'" :comfrimVal="'好的'" @comfirmev="comfirmev"></pu-po>
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nright="20" :nbottom="100"></public-customer> -->
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isShowT:false,
|
||||
category:'',
|
||||
tname:'',//联系人姓名
|
||||
tphone:'',//联系方式
|
||||
tmsg:'',//留言信息
|
||||
touId:'',
|
||||
isZhuan:false,
|
||||
xialCurrent:0,
|
||||
xialone:[],
|
||||
btnCon:'立即提交',
|
||||
titleList:[],//tab标题
|
||||
imgList:[],//tab图标
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkCate();
|
||||
this.tphone = uni.getStorageSync('phone');
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
methods: {
|
||||
changeCate(e){
|
||||
console.log(e.detail.value);
|
||||
this.touId = e.detail.value;
|
||||
},
|
||||
checkCate(){
|
||||
this.$requst.post('user/feedback-types').then(res=>{
|
||||
// console.log('问题类型列表:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
id:item.id,
|
||||
title:item.title
|
||||
}
|
||||
this.xialone.push(obj)
|
||||
})
|
||||
this.category = this.xialone[0].title
|
||||
this.touId = this.xialone[0].id
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
submit(){
|
||||
if(!this.tmsg){
|
||||
this.$toolAll.tools.showToast('请输入意见及建议')
|
||||
} else if(this.$toolAll.tools.isPhone(this.tphone)){
|
||||
this.$toolAll.tools.showToast('请输入正确的手机号')
|
||||
} else {
|
||||
this.eventEv();
|
||||
}
|
||||
},
|
||||
eventEv(){
|
||||
let parmas = {
|
||||
type_id:this.touId,
|
||||
content:this.tmsg,
|
||||
user_name:this.tname,
|
||||
user_phone:this.tphone
|
||||
}
|
||||
if(this.btnCon == '立即提交'){
|
||||
// this.$toolAll.tools.showToast('正在提交...')
|
||||
this.btnCon = '正在提交...'
|
||||
this.$requst.post('user/add-feedback',parmas).then(res=>{
|
||||
// uni.hideToast()
|
||||
if(res.code==0){
|
||||
this.isShowT = true
|
||||
} else {
|
||||
this.btnCon = '返回'
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
},
|
||||
comfirmev(){
|
||||
uni.navigateBack({delta:1})
|
||||
},
|
||||
openXial(){
|
||||
this.isZhuan = !this.isZhuan
|
||||
// console.log('开启下拉');
|
||||
},
|
||||
chooseXia(index){
|
||||
this.xialCurrent = index
|
||||
this.btnCon = '立即提交'
|
||||
this.category = this.xialone[index].title
|
||||
this.touId = this.xialone[index].id
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,240 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'关于我们'" :whereCome="whereCome*1" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x180">
|
||||
<!-- 自定义轮播 -->
|
||||
<view class="mar-s20">
|
||||
<swiper-pu :isplay="isAutoPlay" :bannerList="bannerList" :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view class="mar-s50 pad-s10">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="cateListTwo.length<=4?false:true" :newbmo="'#F5F5F5'" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view v-if="dataList.length!=0" class="mar-x20">
|
||||
<view @tap="goDetail(index)" class="pad-sx30 width100 disjb bbot" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="disjb fc">
|
||||
<view class="fon30 col3 clips2" style="height: 84rpx;">{{item.title}}</view>
|
||||
<view class="fon24 col9 mar-s25">{{item.time}}</view>
|
||||
</view>
|
||||
<image v-if="item.imgSrc!=''" class="flexs mar-z30" style="width: 140rpx;height: 140rpx;" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 20%;">
|
||||
<image class="zanw-img" src="/static/public/zanwn.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">暂无内容</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nbottom="100"></public-customer> -->
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部导航 -->
|
||||
<view class="posixzy">
|
||||
<bottom-tab></bottom-tab>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import {checkBanner} from '@/jsFile/publicAPI.js';
|
||||
import bottomTab from '@/components/bottom-tab.vue';
|
||||
export default {
|
||||
components:{
|
||||
swiperPu,
|
||||
bottomTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
cateListTwo:[
|
||||
// {title:'热门问题'},
|
||||
// {title:'公司新闻'},
|
||||
// {title:'热点资讯'},
|
||||
// {title:'热点资讯'},
|
||||
],
|
||||
dataList:[
|
||||
// {title:'网红水果排毒真的减脂排毒吗?',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
// {title:'网红水果排毒真的减脂排毒吗?美食创作人',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
|
||||
],
|
||||
showTop:false,
|
||||
newCurrent:0,
|
||||
category_id:'',
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
bannerList:[],
|
||||
isAutoPlay:false,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
whereCome:0
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkAbout(this.category_id)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/aboutUs/aboutUs?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;this.whereCome = 2;} else {this.$toolAll.tools.isLogin();}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkAbout(this.category_id)
|
||||
this.checkSwi()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkSwi(){
|
||||
checkBanner({position:'about-banner'}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let isVideo = false
|
||||
if(item.type!='img') isVideo = true
|
||||
let haveImg = ''
|
||||
if(item.src!='') haveImg = this.$http + item.src
|
||||
let banObj = {
|
||||
imgSrc:haveImg,
|
||||
url:item.url,
|
||||
isVideo:isVideo,
|
||||
poster:this.$http + item.src,
|
||||
}
|
||||
this.bannerList.push(banObj)
|
||||
})
|
||||
}
|
||||
//
|
||||
}
|
||||
})
|
||||
},
|
||||
checkAbout(category_id){
|
||||
let params = {
|
||||
category_id:category_id,
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/about',params).then(res=>{
|
||||
// console.log('关于我们:',res);
|
||||
if(res.code==0){
|
||||
if(this.cateListTwo.length==0){
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach(item=>{
|
||||
let cateObj = {
|
||||
id:item.id,
|
||||
mode_id:item.mode_id,
|
||||
title:item.title
|
||||
}
|
||||
this.cateListTwo.push(cateObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
if(this.page==1) this.dataList = []
|
||||
if(res.data.list.list.length!=0){
|
||||
this.total = res.data.list.total
|
||||
res.data.list.list.forEach(item=>{
|
||||
let newImg = ''
|
||||
if(item.cover=='') newImg = '/static/public/logo.png'
|
||||
else newImg = this.$http + item.cover
|
||||
let aobj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
time:item.published_at,
|
||||
imgSrc:newImg
|
||||
}
|
||||
this.dataList.push(aobj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseTwo(index){//二级分类选择
|
||||
this.newCurrent = index
|
||||
console.log('二级分类:',index);
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.category_id = this.cateListTwo[index].id
|
||||
this.checkAbout(this.cateListTwo[index].id)
|
||||
},
|
||||
goDetail(index){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/articleDetail/articleDetail?id='+this.dataList[index].id +"&category_id="+this.category_id
|
||||
})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,289 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'详情'" :statusTitle="true"></status-nav>
|
||||
<view v-if="isLoading" :style="{paddingTop: statusHNH+'px'}" class="pad-zy32 pad-x180">
|
||||
<view class="fon36 col3 bold mar-sx20" style="line-height: 50rpx;">{{detailObj.title}}</view>
|
||||
<view class="disac mar-x20">
|
||||
<image :src="headImg" style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<view class="mar-z10">
|
||||
<view class="fon28 col3">{{name}}</view>
|
||||
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 内容详情 -->
|
||||
<view class="fon28" style="color: #1A1A1A; line-height: 40rpx;">
|
||||
<!-- <image class="mar-x20" src="/static/public/banner.png" style="height: 400rpx;width: 100%;" mode=""></image> -->
|
||||
<!-- <view style="margin-bottom:50rpx;">屋基寨位于阿坝茂县松坪沟,是典型的羌族聚居区,有着鲜明的价值观和民族文化屋基寨美景屋基寨美景。</view>
|
||||
<view style="margin-bottom:50rpx;">山寨海拔3000米以上,有川西独特的自然景色,但是海拔高、地势陡,各类资源匮乏,居民收入单一屋基寨地貌屋基寨地貌。</view>
|
||||
<view style="margin-bottom:50rpx;">成都恒美毛发医疗美容总经理徐军挺,了解到当地居民希望发展旅游增加收入时,便立即驱车前往屋基寨村民着盛装迎接恒美一行村民着盛装迎接恒美一行。</view>
|
||||
<view style="margin-bottom:50rpx;">徐军挺总经理建议:做强乡村旅游,要完善基础设施,同时要保持乡村建筑风貌和地域文化特色;还要完善服务标准,提升消防安全水平;</view>
|
||||
<view style="margin-bottom:50rpx;">打造乡村旅游品牌,形成示范带动作用参观了解村民居住环境参观了解村民居住环境了解村民们的生活习俗风土人情了解村民们的生活习俗风土人情。</view> -->
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
<!-- 导航 -->
|
||||
<view class="mar-s50 pad-s10">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="cateListTwo.length<=4?false:true" :newbmo="'#F5F5F5'" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view v-if="dataList.length!=0" class="mar-x20">
|
||||
<view @tap="goDetail(index)" class="pad-sx30 width100 disjb bbot" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="disjb fc">
|
||||
<view class="fon30 col3 clips2" style="height: 84rpx;">{{item.title}}</view>
|
||||
<view class="fon24 col9 mar-s25">{{item.time}}</view>
|
||||
</view>
|
||||
<image v-if="item.imgSrc!=''" class="flexs mar-z30" style="width: 140rpx;height: 140rpx;" :src="item.imgSrc" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 20%;">
|
||||
<image class="zanw-img" src="/static/public/zanwn.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">暂无内容</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
|
||||
<view class="posir">
|
||||
<image @tap="backHome" class="posia backH" src="/static/public/back-home.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="disac fon28 colf">
|
||||
<view @tap="lianK" class="disac posir lianShare" style="background-color: #3875F6; border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;">
|
||||
<image src="/static/public/bottom-customer.png" class="mar-zy20" style="width: 47rpx;height: 47rpx;" mode="aspectFill"></image>
|
||||
<view>联系客服</view>
|
||||
<button v-if="haveImg" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
|
||||
</view>
|
||||
<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>
|
||||
<view>分享给好友</view>
|
||||
<button v-if="haveImg" class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
headImg:'/static/public/like.png',
|
||||
name:'恒美植发',
|
||||
time:'2021-07-14 08:22',
|
||||
showTop:false,
|
||||
detailObj:{},//详情
|
||||
content:'',//富文本详情
|
||||
isLoading:false,
|
||||
haveImg:true,
|
||||
detailId:'',//当前关于我们新闻ID
|
||||
invite_code:'',
|
||||
newCurrent:0,
|
||||
cateListTwo:[],
|
||||
dataList:[],
|
||||
category_id:0,
|
||||
size:10,
|
||||
page:1,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
c:this.detailObj.id*1,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: `${ya.detailObj.title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/articleDetail/articleDetail?id=${this.detailId}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ''//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
this.checkDetail(options.id)
|
||||
this.detailId = options.id
|
||||
this.category_id = options.category_id
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
console.log(options,'参数');
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkAbout(this.category_id)
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkAbout(this.category_id)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkAbout(category_id){
|
||||
let params = {
|
||||
category_id:category_id,
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/about',params).then(res=>{
|
||||
// console.log('关于我们:',res);
|
||||
if(res.code==0){
|
||||
if(this.cateListTwo.length==0){
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,
|
||||
mode_id:item.mode_id,
|
||||
title:item.title
|
||||
}
|
||||
this.cateListTwo.push(cateObj)
|
||||
if(this.category_id==item.id) this.newCurrent = index
|
||||
})
|
||||
}
|
||||
}
|
||||
if(this.page==1) this.dataList = []
|
||||
if(res.data.list.list.length!=0){
|
||||
this.total = res.data.list.total
|
||||
res.data.list.list.forEach(item=>{
|
||||
let newImg = ''
|
||||
if(item.cover=='') newImg = '/static/public/logo.png'
|
||||
else newImg = this.$http + item.cover
|
||||
let aobj = {
|
||||
id:item.id,
|
||||
title:item.title,
|
||||
time:item.published_at,
|
||||
imgSrc:newImg
|
||||
}
|
||||
if(this.detailId!=item.id) this.dataList.push(aobj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseTwo(index){//二级分类选择
|
||||
this.newCurrent = index
|
||||
// console.log('二级分类:',index);
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.category_id = this.cateListTwo[index].id
|
||||
this.checkAbout(this.cateListTwo[index].id)
|
||||
},
|
||||
goDetail(index){
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/articleDetail/articleDetail?id='+this.dataList[index].id +"&category_id="+this.category_id
|
||||
})
|
||||
},
|
||||
moveHandle(){//禁止底层滑动
|
||||
return false
|
||||
},
|
||||
getphonenumber(e){//授权绑定手机号
|
||||
if(e.detail.errMsg=="getPhoneNumber:ok"){
|
||||
this.$requst.post('user/bind-phone',{iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
|
||||
// console.log('手机号信息:',res);
|
||||
if(res.code==0){
|
||||
this.isShowP = false
|
||||
this.$toolAll.tools.showToast('手机号绑定成功','success')
|
||||
}
|
||||
},error=>{})
|
||||
} else {
|
||||
this.isShowP = false
|
||||
}
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cancleEv(e){//取消授权
|
||||
if(e==0) this.vision = false
|
||||
},
|
||||
backHome(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
lianK(){//客服
|
||||
// if(!this.jieDuan){
|
||||
// let isAuth = this.$toolAll.tools.returnAuth()
|
||||
// if(!isAuth){
|
||||
if(this.haveImg == false) {
|
||||
this.vision = true
|
||||
} else {
|
||||
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
|
||||
// }
|
||||
},
|
||||
shareEv(){
|
||||
if(this.haveImg == false) {
|
||||
this.vision = true
|
||||
}
|
||||
},
|
||||
checkDetail(id){
|
||||
this.$requst.post('archives/detail',{id:id}).then(res=>{
|
||||
// console.log('详情:',res);
|
||||
if(res.code==0){
|
||||
this.detailObj = res.data.detail
|
||||
this.content = this.$toolAll.tools.escape2Html(res.data.detail.content)
|
||||
uni.hideToast()
|
||||
this.isLoading = true
|
||||
}
|
||||
},error=>{})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,53 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'我的二维码'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
|
||||
<image :src="imgSrc" class="mar-s32" style="width: 100%;" mode="widthFix"></image>
|
||||
<view v-if="isBtn" @tap="sendImg" class="fon40 bold colf mar-z10 radius20 tc" style="height: 90rpx;margin: 80rpx;background-color: #38CE51;line-height: 90rpx;">发送二维码</view>
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
imgSrc:'',
|
||||
isBtn:false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkImg()
|
||||
},
|
||||
methods: {
|
||||
checkImg(){
|
||||
this.$requst.post('user/service-qr').then(res=>{
|
||||
// console.log('二维码:',res);
|
||||
if(res.code==0){
|
||||
base64ToPath(res.data.qr).then(path => {
|
||||
this.imgSrc = path
|
||||
this.isBtn = true
|
||||
}).catch(error => {})
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
sendImg(){
|
||||
wx.showShareImageMenu({
|
||||
path: this.imgSrc
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,171 @@
|
|||
<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 class="clips1">昵称:{{item.customer_name}}</text>
|
||||
<text class="flexs mar-z20"><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.service!=null" class="mar-s20 fon24 disjbac col6">
|
||||
<text class="clips1">昵称:{{item.service.name}}</text>
|
||||
<text class="flexs mar-z20" v-if="item.service.phone!=''">手机号:{{item.service.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>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</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=自己绑定的客户 否则是全部
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
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()
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/customerCheck/customerCheck?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkList()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
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.nickname,
|
||||
customer_phone:item.mobile,
|
||||
service:item.service,
|
||||
// staff:item.staff,//绑定的客服
|
||||
// account:item.account//备用:当staff不存在时调用,
|
||||
}
|
||||
this.dataList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,380 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'客户列表'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30 pad-x20">
|
||||
<view class="radius20 fon28 col3 mar-sx20">
|
||||
<view class="disac">
|
||||
<view @tap="openXial" class="disjbac width100 radius10 pad-zy20 xialak posir">
|
||||
<view class="" style="color: #B3B3B3;">{{category}}</view>
|
||||
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<!-- 下拉列表 -->
|
||||
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
|
||||
<input @tap.stop="entryEv" @confirm="searchEv" type="text" class="pad20" v-model="searchVal" placeholder="请输入昵称/姓名/手机" />
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<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>
|
||||
<view class="fon24 col3 width100 mar-x40" style="margin-bottom: 120rpx;">
|
||||
<view class="bold disjbac">
|
||||
<view class="fon28 clips1">{{item.name}}</view>
|
||||
<view class="flexs">来源:{{item.come}}</view>
|
||||
</view>
|
||||
<view style="margin: 15rpx 0;" @tap="copyPhone(item.phone)">联系方式:{{item.phone || '暂无'}}</view>
|
||||
<view>客服:{{item.service || '暂无'}}</view>
|
||||
<view class="col80 disjbac" style="margin: 15rpx 0 0 0;">
|
||||
<view>{{item.time}}</view>
|
||||
<view class="col3">{{item.qudao}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 真实姓名 -->
|
||||
<view class="posia col3 fon24 radius10 tc" style="left: 20rpx;bottom: 100rpx;">姓名:{{item.real_name || '暂无'}}</view>
|
||||
<!-- 分配客服 -->
|
||||
<!-- <view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;z-index: 1;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}">分配客服</view> -->
|
||||
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;z-index: 1;" :style="{background:publicColor}">分配客服</view>
|
||||
<!-- 设置标签 -->
|
||||
<view @tap="tuneUpTag(index)" v-if="item.isTag" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;bottom: 20rpx;z-index: 1;" :style="{background:publicColor}">设置标签</view>
|
||||
<view class="fon24 col3 posia bold disac" style="bottom: 60rpx;left: 20rpx;right: 20rpx;"><text class="flexs">标签:</text>
|
||||
<block v-if="item.tags.length">
|
||||
<scroll-view scroll-x style="max-width: 60%;">
|
||||
<view class="disac"><view v-for="(item1,tagIndex) in item.tags" :key="tagIndex" class="pcol pad-zy10 flexs">{{item1}}</view></view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<block v-else class="col9">无</block>
|
||||
</view>
|
||||
<view class="fon24 col3 posia clips1 bold" style="bottom: 20rpx;left: 20rpx;right: 20rpx;max-width: 70%;">详细来源:{{item.source_detail}}</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>
|
||||
<!-- 分配客服弹框 -->
|
||||
<pu-po :category="xialtList" @chooseXiaT="chooseXiaT" :isXiala="true" :isShowT="isShowT" :clearVal="'暂不分配'" :comfrimVal="'立即分配'" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 设置标签弹框 -->
|
||||
<!-- <pu-po :category="tagList" @chooseXiaT="chooseTag" :isXiala="true" :isTag="true" :isShowT="isShowTag" :clearVal="'暂不设置'" :comfrimVal="'立即设置'" @comfirmev="comfirmevTag" @cancleev="cancleevTag"></pu-po> -->
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
<view v-if="isShowTag" class="disjcac posAll" @tap="closeXial">
|
||||
<view class="bacf radius20 width100 tank-box">
|
||||
<view class="pad-x20">
|
||||
<view class="mar-s30 mar-x40 tc">请选择标签</view>
|
||||
<view @tap.stop="openXia" class="disjbac radius10 pad-zy20 mar-zy20 xialak mar-x50 posir">
|
||||
<view class="col3 disac width100"><input class="width100 mar-y20" disabled v-model="tagStr"></view>
|
||||
<image :class="isZhuan1?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
|
||||
<!-- 下拉列表 -->
|
||||
<view v-if="isZhuan1" class="posia bacf radius10 xial-box">
|
||||
<!-- 标签下拉 -->
|
||||
<view class="pad-zy20 xial-item-box">
|
||||
<view @tap.stop="chooseXiaTag(index)" class="disac" :class="item.checked?'pcol':''" v-for="(item,index) in tagList" :key="index">
|
||||
<view v-if="" class="disac">
|
||||
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :data-id="item.id" :checked="item.checked" />
|
||||
</view>
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disjb fon28 colf pad-x30 pad-zy30 tc">
|
||||
<view @tap="cancleevTag" class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不设置</view>
|
||||
<view @tap="comfirmevTag" :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn">立即设置</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
category:'',
|
||||
dataList:[],
|
||||
showTop:false,
|
||||
isShowT:false,
|
||||
isXiala:true,
|
||||
isZhuan:false,
|
||||
isZhuan1:false,
|
||||
xialCurrent:0,
|
||||
xialone:['全部'],
|
||||
xialtList:[],
|
||||
staff_id:'',//员工ID
|
||||
customer_id:'',//客户ID
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',
|
||||
isZanw:true,
|
||||
ntype:'all',
|
||||
tagList:[],
|
||||
tag_id:'',
|
||||
isShowTag:false,
|
||||
tagId:'',
|
||||
searchVal:'',
|
||||
tagIds:[],
|
||||
tagVal:[],
|
||||
tagStr:'',
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
// for (let i = 0; i < 4; i++) {
|
||||
// let obj = {imgSrc:'/static/public/like.png',name:'USER',come:'顾客分享',phone:'18888888888',customer:'恒美植发客服-01',time:'2021-07-15 14:25',qudao:'第二渠道'}
|
||||
// this.dataList.push(obj)
|
||||
// }
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkCL(this.ntype)
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表数据')
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
},
|
||||
onLoad() {
|
||||
this.checkKF()//查询客服列表
|
||||
this.checkCL()//客户列表
|
||||
this.checkLY()//渠道来源
|
||||
this.obtainTag();//获取标签列表
|
||||
},
|
||||
methods: {
|
||||
// 复制电话号码
|
||||
copyPhone(e){
|
||||
uni.setClipboardData({
|
||||
data: e,//要被复制的内容
|
||||
success:(res) => {
|
||||
uni.showToast({title:'复制成功' })
|
||||
}
|
||||
});
|
||||
},
|
||||
// 关闭下拉
|
||||
closeXial(){
|
||||
// this.isShowTag = false;
|
||||
this.isZhuan1 = false;
|
||||
},
|
||||
openXia(){
|
||||
this.isZhuan1 = !this.isZhuan1
|
||||
},
|
||||
// 标签单选
|
||||
chooseXiaTag(index){
|
||||
let isexistence = this.tagIds.indexOf(this.tagList[index].id);
|
||||
this.tagList[index].checked = !this.tagList[index].checked;
|
||||
if(isexistence!=-1){
|
||||
this.tagIds.splice(isexistence,1);
|
||||
this.tagVal.splice(isexistence,1)
|
||||
} else {
|
||||
this.tagIds.push(this.tagList[index].id)
|
||||
this.tagVal.push(this.tagList[index].title)
|
||||
}
|
||||
this.tagStr = this.tagVal.join(',');
|
||||
this.tagId = this.tagIds.join(',');
|
||||
// 单选时,控制全选按钮是否选中
|
||||
if(this.tagIds.length==this.tagList.length){
|
||||
this.isAll = true;
|
||||
} else this.isAll = false;
|
||||
if(!this.tagIds.length) {
|
||||
this.tagStr = '请选择'
|
||||
}
|
||||
},
|
||||
obtainTag(){//获取标签列表
|
||||
this.$requst.post('user/tag-list').then(res=>{
|
||||
// console.log('查询客户列表:',res);
|
||||
if(res.code==0){
|
||||
this.tagList = [];
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let xuan = false;
|
||||
let obj = {
|
||||
title:item.name,
|
||||
id:item.id,
|
||||
checked:xuan
|
||||
}
|
||||
this.tagList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
// 调起设置标签弹框
|
||||
tuneUpTag(index){
|
||||
// console.log('分配客服调起弹框');
|
||||
this.isShowTag = true
|
||||
this.tagStr = '';
|
||||
this.tagId = '';
|
||||
this.tagIds = [];
|
||||
this.tagVal = [];
|
||||
this.tagList.forEach((item,v)=>{
|
||||
item.checked = false;
|
||||
if(this.dataList[index].tags.length) {
|
||||
this.dataList[index].tags.forEach(item1=>{
|
||||
if(item.title == item1){
|
||||
this.tagList[v].checked = true;
|
||||
}
|
||||
})
|
||||
if(item.checked){
|
||||
this.tagIds.push(item.id);
|
||||
this.tagVal.push(item.title)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.tagStr = this.tagVal.join(',');
|
||||
this.tagId = this.tagIds.join(',');
|
||||
// 客服列表
|
||||
this.customer_id = this.dataList[index].id//客户ID
|
||||
if(this.tagList.length==0) this.tagList = ['暂无可设置的标签']
|
||||
},
|
||||
checkKF(){//查看客户列表
|
||||
this.$requst.post('user/servicer-list').then(res=>{
|
||||
// console.log('查询客户列表:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
res.data.forEach(item=>{
|
||||
let obj = {
|
||||
title:item.name,
|
||||
id:item.id
|
||||
}
|
||||
this.xialtList.push(obj)
|
||||
})
|
||||
this.staff_id = this.xialtList[0].id
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
this.page = 1;
|
||||
this.isZanw = true;
|
||||
this.checkCL(this.ntype)
|
||||
},
|
||||
checkLY(){//查询来源渠道事件
|
||||
this.$requst.post('user/channel').then(res=>{
|
||||
// console.log('来源渠道:',res);
|
||||
if(res.code==0){
|
||||
for (let key in res.data) {
|
||||
let lyObj = {
|
||||
title:res.data[key],
|
||||
name:key
|
||||
}
|
||||
this.xialone.push(lyObj)
|
||||
}
|
||||
this.xialone.unshift({title:"全部",name:'all'})
|
||||
this.category = this.xialone[0].title
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkCL(ntype){//查询客户列表事件
|
||||
this.$requst.post('user/customer',{page:this.page,size:this.size,type:ntype,keyword:this.searchVal}).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 cuObj = {
|
||||
id:item.id,
|
||||
imgSrc:item.headimgurl,
|
||||
name:item.nickname,
|
||||
come:item.channel_text,
|
||||
phone:item.mobile,
|
||||
customer:item.service[0],
|
||||
time:item.created_at,
|
||||
qudao:item.tag[0],
|
||||
service:item.service,
|
||||
source_detail:item.source_detail,
|
||||
tags:item.tag,
|
||||
isTag:!item.tag.includes('员工'),
|
||||
real_name:item.real_name
|
||||
}
|
||||
this.dataList.push(cuObj);
|
||||
})
|
||||
}
|
||||
this.isZhuan = false;
|
||||
} else this.$toolAll.tools.showToast(res.msg)
|
||||
},error=>{})
|
||||
},
|
||||
fenCustomer(index){//分配弹框调起事件
|
||||
// console.log('分配客服调起弹框');
|
||||
this.isShowT = true
|
||||
// 客服列表
|
||||
this.customer_id = this.dataList[index].id//客户ID
|
||||
if(this.xialtList.length==0) this.xialtList = ['暂无可分配客服']
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
comfirmev(){//立即分配执行事件
|
||||
// console.log('立即分配');
|
||||
this.isShowT = false
|
||||
this.$requst.post('user/customer-allot',{staff_id:this.staff_id,customer_id:this.customer_id}).then(res=>{
|
||||
// console.log('分配客服:',res);
|
||||
if(res.code==0){
|
||||
this.page = 1
|
||||
this.$toolAll.tools.showToast('分配成功')
|
||||
this.checkCL(this.ntype)//客户列表
|
||||
} else this.$toolAll.tools.showToast(res.msg)
|
||||
},error=>{})
|
||||
},
|
||||
// 立即设置标签
|
||||
comfirmevTag(){
|
||||
this.$toolAll.tools.showToast('设置中...')
|
||||
// console.log('立即分配');
|
||||
this.$requst.post('user/set-tags',{tag_ids:this.tagId,ids:this.customer_id}).then(res=>{
|
||||
// console.log('分配客服:',res);
|
||||
if(res.code==0){
|
||||
this.page = 1
|
||||
this.$toolAll.tools.showToast('设置成功')
|
||||
this.obtainTag();
|
||||
this.isShowTag = false
|
||||
this.checkCL(this.ntype)//客户列表
|
||||
} else this.$toolAll.tools.showToast(res.msg)
|
||||
},error=>{})
|
||||
},
|
||||
cancleev(){
|
||||
this.isShowT = false
|
||||
},
|
||||
// 暂不设置标签
|
||||
cancleevTag(){
|
||||
this.isShowTag = false
|
||||
},
|
||||
openXial(){
|
||||
this.isZhuan = !this.isZhuan
|
||||
this.searchVal = '';
|
||||
// console.log('开启下拉');
|
||||
},
|
||||
chooseXia(index){
|
||||
this.xialCurrent = index;
|
||||
this.ntype = this.xialone[index].name;
|
||||
this.category = this.xialone[index].title;
|
||||
},
|
||||
chooseXiaT(e){
|
||||
this.staff_id = e.id
|
||||
},
|
||||
entryEv(){
|
||||
this.isXiala = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,177 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'医生'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30">
|
||||
<view class="radius20 fon28 col3 mar-s20">
|
||||
<view class="disac">
|
||||
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
|
||||
<input class="fon28 width100" @confirm="searchEv" type="text" 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>
|
||||
<view class="pad-zy20 mar-sx30 pad-x180">
|
||||
<!-- 列表 -->
|
||||
<view class="fon28 col3 bold qdoctor disac">全部医生</view>
|
||||
<view class="mar-s30" v-if="dataList.length!=0">
|
||||
<!-- 医生列表 -->
|
||||
<list-doctor :list="dataList"></list-doctor>
|
||||
</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 v-if="keyword!=''" class="fon24 col3">您搜索的内容暂无结果,换个关键词试试吧</view>
|
||||
<view v-if="keyword==''" class="fon24 col3">暂无医生列表</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nbottom="120"></public-customer> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部导航 -->
|
||||
<view class="posixzy">
|
||||
<bottom-tab></bottom-tab>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listDoctor from '@/components/list-doctor.vue';
|
||||
import bottomTab from '@/components/bottom-tab.vue';
|
||||
export default {
|
||||
components:{
|
||||
listDoctor,
|
||||
bottomTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
// {imgSrc:'/static/public/doctor.png',name:'廖恒利医生',cyear:'16',bmen:'美容门诊部',zcheng:'主任医师',goodAt:'毛发种植'},
|
||||
],
|
||||
showTop:false,
|
||||
page:1,
|
||||
size:20,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
keyword:'',
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/doctor/doctor?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkDor()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkDor()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkDor(){//查询医生列表事件
|
||||
this.$requst.post('user/doctor-list',{page:this.page,size:this.size,keyword:this.keyword}).then(res=>{
|
||||
// console.log('医生列表:',res);
|
||||
if(res.code==0){
|
||||
if(this.page==1) this.dataList = []
|
||||
if(res.data.list.length!=0){
|
||||
this.total = res.data.total
|
||||
res.data.list.forEach(item=>{
|
||||
let newG = item.diseases
|
||||
let ndeptName = ''
|
||||
if(item.doctor_extra.dept_name==undefined || item.doctor_extra.dept_name=='') ndeptName = item.dept_name
|
||||
else ndeptName = item.doctor_extra.dept_name
|
||||
let dObj = {
|
||||
id:item.id,
|
||||
imgSrc:item.doctor_extra.headimg,//医生头像
|
||||
name:item.doctor_extra.name,//医生姓名
|
||||
cyear:parseFloat(item.doctor_extra.work_time),//工作年限
|
||||
bmen:ndeptName,//部门
|
||||
zcheng:'主任医师',
|
||||
goodAt:item.diseases,
|
||||
show_detail:item.doctor_extra.show_detail//是否可查看详情1是,0否
|
||||
}
|
||||
this.dataList.push(dObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
searchEv(){
|
||||
this.checkDor()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,279 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'医生'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class=" pad-x180">
|
||||
<view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-y32 pad-x40">
|
||||
<view class="disjb">
|
||||
<image class="radius10 flexs mar-z30" :src="doctorObj.doctor_extra.headimg || moImg" style="width: 300rpx;height: 300rpx;" mode="aspectFill"></image>
|
||||
<view class="pad-z20 width100">
|
||||
<view class="fon28 bold col3">{{doctorObj.doctor_extra.name}}</view>
|
||||
<!-- <view class="disac col80 fon24" style="margin: 6rpx 0;">
|
||||
<view>{{['未知','男','女'][doctorObj.gender]}}</view>
|
||||
<view class="doctorx"></view>
|
||||
<view>从业{{parseFloat(doctorObj.doctor_extra.work_time)}}年</view>
|
||||
<view v-if="doctorObj.doctor_extra.dept_name!='' && doctorObj.doctor_extra.dept_name!=undefined" class="doctorx"></view>
|
||||
<view>{{doctorObj.doctor_extra.dept_name}}</view>
|
||||
</view> -->
|
||||
<view class="col80 fon24">
|
||||
<view class="flexs">擅长领域:</view>
|
||||
<view class="dis fw">
|
||||
<view class="flexs" v-for="(item,index) in doctorObj.diseases" :key="index" style="background-color: #F5F5F5;border-radius: 10rpx;padding: 6rpx 10rpx;margin-top: 10rpx;margin-right: 10rpx;">
|
||||
<text class="bold pcol">{{item.disease_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-z32">
|
||||
<view class="bbot mar-s30"></view>
|
||||
<view class="fon28 bold col3 mar-sx20">医生简介</view>
|
||||
<rich-text class="fon26 col3" :nodes="peopleJian"></rich-text>
|
||||
</view>
|
||||
<view class="mar-z32">
|
||||
<view class="bbot mar-s30"></view>
|
||||
<view class="fon28 bold col3 mar-sx20">医生详情</view>
|
||||
<rich-text class="fon26 col3" :nodes="detailInfo"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<view id="daoh" :class="isTop?'isTop':''" class="isTops" :style="{top:(statusHNH-10)+'px'}">
|
||||
<view class="bacf pad-zy32 mar-s20 pad-sx20">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mar-zy32 mar-s20" v-if="dataList.length!=0"><list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="dataList"></list-pu></view>
|
||||
<view style="margin-top: 8%;" v-if="dataList.length==0"><list-pu :list="dataList"></list-pu></view>
|
||||
</view>
|
||||
<view class="pad-zy20 mar-sx30">
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
</view>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nbottom="100"></public-customer> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部导航 -->
|
||||
<view class="posixzy">
|
||||
<bottom-tab></bottom-tab>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
|
||||
import bottomTab from '@/components/bottom-tab.vue';
|
||||
export default {
|
||||
components:{
|
||||
bottomTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
cateList:[
|
||||
// {title:'问题'},
|
||||
// {title:'案例日记'},
|
||||
// {title:'效果模拟'},
|
||||
// {title:'科普视频'},
|
||||
],
|
||||
dataList:[
|
||||
|
||||
],
|
||||
showTop:false,
|
||||
newCurrent:0,
|
||||
category_id:0,//栏目ID
|
||||
moImg:'/static/public/logo.png',
|
||||
doctorObj:{},//医生详情
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
chuTop:'',
|
||||
isTop:false,
|
||||
isLoading:false,
|
||||
detailInfo:'',
|
||||
peopleJian:'',
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
doctorId:''//医生id
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/doctorDetail/doctorDetail?invite_code=${uni.getStorageSync('invite_code')}&doctor_id=${this.doctorId}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
if((this.chuTop - this.statusHNH) - e.scrollTop*1 <= 0) this.isTop = true
|
||||
else this.isTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
// console.log(this.total,this.dataList.length);
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
if(this.category_id==0) this.category_id = this.cateList[0].id
|
||||
this.checkConList(this.category_id)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.checkConList(this.category_id)
|
||||
},
|
||||
onLoad(options) {
|
||||
this.doctorId = options.doctor_id;
|
||||
this.checkDoD(this.doctorId)
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
this.chuTop = rect.top
|
||||
}).exec()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
this.dataList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
}
|
||||
},
|
||||
comfirmev(e){//确认取消收藏事件
|
||||
this.dataList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
},
|
||||
checkDoD(doctor_id){
|
||||
this.$requst.post('user/doctor-info',{doctor_id:doctor_id}).then(res=>{
|
||||
// console.log('医生详情:',res);
|
||||
if(res.code==0){
|
||||
this.doctorObj = res.data;
|
||||
// 富文本
|
||||
this.peopleJian = this.$toolAll.tools.escape2Html(this.doctorObj.doctor_extra.summary);
|
||||
this.detailInfo = this.$toolAll.tools.escape2Html(this.doctorObj.doctor_extra.content);
|
||||
this.isLoading = true;
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkConList(category_id){//查询收藏列表
|
||||
let params = {
|
||||
category_id:category_id,
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/hot',params).then(res=>{
|
||||
if(res.code==0){
|
||||
// 栏目类别
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort,
|
||||
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
}
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) {
|
||||
this.dataList = [];
|
||||
// uni.pageScrollTo({
|
||||
// scrollTop:0,
|
||||
// duration:0
|
||||
// })
|
||||
}
|
||||
this.total = res.data.list.total
|
||||
if(res.data.list.list.length!=0){
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img:fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
chooseTwo(index){
|
||||
this.newCurrent = index
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.category_id = this.cateList[index].id
|
||||
this.checkConList(this.category_id)
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,210 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'消息'" :whereCome="comeNum" :statusTitle="true"></status-nav>
|
||||
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
||||
<view @tap="switchEv(true)" :class="isWen?'isWen bold':'col9'" class="posir">日程提醒</view>
|
||||
<view @tap="switchEv(false)" :class="!isWen?'isWen bold':'col9'" class="posir">消息中心</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: (statusHNH+chuTop+15)+'px'}" class="pad-zy32">
|
||||
<view v-if="dataList.length!=0">
|
||||
<view v-for="(item,index) in dataList" :key="index">
|
||||
<view class="fon24 col6 tc mar-sx50">{{item.time}}</view>
|
||||
<view @tap="readMsg(index,indexl)" class="radius10 bacf pad20 mar-x20" v-for="(iteml,indexl) in item.list" :key="indexl">
|
||||
<view class="disac">
|
||||
<image v-if="iteml.is_read==0" class="message-img" src="/static/public/unread.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 :style="{background:iteml.is_read==1?'rgba(204, 204, 204,1)':'#FF4D4D'}" class="message-status">{{iteml.is_read==1?'已读':'未读'}}</view>
|
||||
</view>
|
||||
<view v-if="iteml.content!=''" class="fon26 col3 mar-s20">{{iteml.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 50%;">
|
||||
<image src="/static/public/nothingm.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">暂无消息</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
searchVal:'',//输入框的值
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[
|
||||
// {
|
||||
// time:'2021-07-15 14:25',
|
||||
// list:[
|
||||
// {is_read:0,title:'系统消息',content:''},
|
||||
// {is_read:0,title:'系统消息',content:'尊敬的用户XX您好,您预约已成功,请与2021年7月28 日14:30分准时到达“恒美植发”门店进行检查。'},
|
||||
// {is_read:0,title:'系统消息',content:'尊敬的用户XX您好,您预约已成功,请与2021年7月28 日14:30分准时到达“恒美植发”门店进行检查。'},
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// time:'2021-07-10 22:36',
|
||||
// list:[
|
||||
// {is_read:1,title:'系统消息',content:'尊敬的用户XX您好,您预约已成功,请与2021年7月28 日14:30分准时到达“恒美植发”门店进行检查。'},
|
||||
// {is_read:1,title:'系统消息',content:'尊敬的用户XX您好,您预约已成功,请与2021年7月28 日14:30分准时到达“恒美植发”门店进行检查。'},
|
||||
// {is_read:1,title:'系统消息',content:'尊敬的用户XX您好,您预约已成功,请与2021年7月28 日14:30分准时到达“恒美植发”门店进行检查。'},
|
||||
// ]
|
||||
// }
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
chuTop:'',
|
||||
isWen:true,
|
||||
page:1,
|
||||
size:10,
|
||||
total:0,
|
||||
isZanw:true,
|
||||
ntype:'reminders',//默认日程提醒
|
||||
comeNum:0
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkMsg()//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多消息','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin();
|
||||
},
|
||||
onLoad(options) {
|
||||
// 从其他方式进入当前页面,点击返回回到我的页面
|
||||
if(options.comeNum==undefined) this.comeNum = 2;
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.chuTop = rect.height
|
||||
}).exec()
|
||||
if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
|
||||
this.checkMsg();
|
||||
let that = this ;
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '为及时通知到您,需要向您申请消息发送权限,不会骚扰您的生活!',
|
||||
confirmText:"同意",
|
||||
cancelText:"拒绝",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
//调用订阅消息
|
||||
console.log('用户点击确定', '订阅消息授权成功');
|
||||
//调用订阅
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ['d0efR-Ga27c6eIvx9mAwJcnAqzhM_Sq68XiFvjvlBJM','eyxvInLLF3L_wmcSQc_O7XLKF7RoGK1dM3OwKj5fHio'],
|
||||
success: (res) => {
|
||||
console.log(res, 'success')
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res, 'fail')
|
||||
},
|
||||
complete: (res) => {
|
||||
wx.getSetting({
|
||||
withSubscriptions: true,
|
||||
success: (res) => {
|
||||
console.log(res, '获取设置信息')
|
||||
}
|
||||
})
|
||||
console.log(res, 'complete')
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消', '订阅消息授权');
|
||||
///显示第二个弹说明一下
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '拒绝后您将无法获得及时的消息通知哦',
|
||||
confirmText:"知道了",
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
///点击知道了的后续操作
|
||||
///如跳转首页面
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
readMsg(index1,index2){
|
||||
this.dataList[index1].list[index2].is_read = 1;
|
||||
},
|
||||
checkMsg(){
|
||||
this.$requst.post('user/messages',{page:this.page,size:this.size,type:this.ntype}).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 titleMsg = '';
|
||||
if(item.type=='notice') titleMsg = "通知";
|
||||
if(item.type=='system') titleMsg = "系统消息";
|
||||
let msgObj = {
|
||||
time:item.send_at,
|
||||
list:[
|
||||
{
|
||||
is_read:item.is_read,
|
||||
title:titleMsg,
|
||||
content:item.content,
|
||||
}
|
||||
]
|
||||
}
|
||||
this.dataList.push(msgObj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},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(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.isWen{color: #3875F6;}
|
||||
.isWen::after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 8rpx;
|
||||
width: 80%;
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: #3875F6;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,449 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'收藏'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view>
|
||||
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
|
||||
<view @tap="shopCollection(0)" :class="isWen?'isWen':''" class="posir">文章收藏</view>
|
||||
<view @tap="shopCollection(1)" :class="!isWen?'isWen':''" class="posir">商品收藏</view>
|
||||
</view>
|
||||
<view :style="{paddingTop:(statusHNH+chuTop+15)+'px'}">
|
||||
<view v-if="isWen">
|
||||
<view class="pad-zy32 mar-x20">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="false" :newbmo="'#F2F2F2'" @choosecateEv="chooseTwo" :newcateList="cateList"></cate-pu>
|
||||
</view>
|
||||
<view v-if="dataList.length!=0" class="pad-zy20 pad-s20">
|
||||
<list-pu :radiu="true" @comfirmev="comfirmev" :list="dataList"></list-pu>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 50%;">
|
||||
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">您还没有收藏,快去收藏吧</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view v-if="shopList.length!=0" style="margin-top: -20rpx;">
|
||||
<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 || item1.isPing || item1.isTuan" 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 v-else class="disjcac fc" style="margin-top: 50%;">
|
||||
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">您还没有收藏,快去收藏吧</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {cancleCollectionEV,cancleCollectionShopEV} from '@/jsFile/publicAPI.js';
|
||||
import shopList from '@/components/shop-list.vue';
|
||||
export default {
|
||||
components:{
|
||||
shopList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[],
|
||||
showTop:false,//是否显示返回顶部
|
||||
newCurrent:0,
|
||||
cateList:[//所以二级分类
|
||||
|
||||
],
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
category_id:0,//栏目ID
|
||||
chuTop:'',
|
||||
isWen:true,
|
||||
shopList:[],
|
||||
activeIndex:0,
|
||||
isShowT:false,
|
||||
pu_content:'是否需要取消收藏?',
|
||||
page:1,
|
||||
size:10,
|
||||
timeList:[],//时间列表
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
collectionTime:null
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkConList(this.category_id)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('cateList');
|
||||
clearInterval(this.collectionTime);
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.collectionTime);
|
||||
},
|
||||
onShow() {
|
||||
this.checkConList(this.category_id);
|
||||
this.shopCollection();
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/myCollection/myCollection?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('#daoh').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.chuTop = rect.height
|
||||
}).exec()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
if (res.code) {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
shopCollection(index){//查询商品的收藏列表
|
||||
clearInterval(this.collectionTime);
|
||||
if(index==1){
|
||||
this.isWen = false;
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}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;
|
||||
}
|
||||
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('加载中...')
|
||||
this.collectionTime = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
console.log(item.id,nArr[item.nIndex].id);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isWen = true;
|
||||
}
|
||||
},
|
||||
checkConList(category_id){//查询收藏列表
|
||||
// this.$toolAll.tools.showToast('加载中...')
|
||||
let params = {
|
||||
category_id:category_id,
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}
|
||||
this.$requst.post('archives/collects',params).then(res=>{
|
||||
if(res.code==0){
|
||||
// 栏目类别
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort,
|
||||
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
this.category_id = this.cateList[0].id
|
||||
}
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
}
|
||||
// 获取列表
|
||||
if(this.page==1) this.dataList = []
|
||||
this.total = res.data.list.total
|
||||
if(res.data.list.list.length!=0){
|
||||
uni.hideToast()
|
||||
res.data.list.list.forEach(item=>{
|
||||
let fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:1,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
comfirmev(e){//确认取消收藏事件
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
setTimeout(()=>{
|
||||
this.checkConList(this.category_id)
|
||||
},300)
|
||||
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){//二级分类选择
|
||||
this.newCurrent = index
|
||||
this.isZanw = true
|
||||
this.page = 1
|
||||
this.category_id = this.cateList[index].id
|
||||
this.checkConList(this.cateList[index].id)
|
||||
// console.log('二级分类:',index);
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.shopList[index].isIntegral}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.isWen{color: #3875F6;}
|
||||
.isWen::after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 4rpx;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: -20rpx;
|
||||
background: #3875F6;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'我的分享人'" :statusTitle="true"></status-nav>
|
||||
<!-- 输入框 -->
|
||||
<view class="bacf posiszy navHeight" :style="{paddingTop: statusHNH+'px'}">
|
||||
<view class="disja pad-sx30">
|
||||
<!-- <view @tap="chooseye(indexye)" :style="{color:flag==indexye?publicColor:''}" v-for="(itemye,indexye) in cateList" :key="indexye">{{itemye.title}}({{dataList[indexye].length}})</view> -->
|
||||
<view @tap="chooseye(indexye)" :style="{color:flag==indexye?publicColor:''}" v-for="(itemye,indexye) in cateList" :key="indexye">{{itemye.title}}({{itemye.num}})</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{paddingTop: navH+'px'}">
|
||||
<view v-if="dataList[flag].length!=0">
|
||||
<view class="disjbac bbot pad-sx40 mar-zy50" v-for="(iteml,indexl) in dataList[flag]" :key="indexl">
|
||||
<view class="disac">
|
||||
<!-- 头像 -->
|
||||
<image class="radius20" :src="iteml.src" style="width: 100rpx;height: 100rpx;" mode="aspectFill"></image>
|
||||
<view class="mar-z25">
|
||||
<!-- 昵称 -->
|
||||
<view class="fon32 bold">{{iteml.name}}</view>
|
||||
<!-- 时间 -->
|
||||
<view class="fon24 col80 mar-s10">{{iteml.time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tright">
|
||||
<!-- 方式 -->
|
||||
<view class="fon24 col80">{{iteml.action}}</view>
|
||||
<!-- 收益 -->
|
||||
<view class="fon28 bold mar-s10" style="color: #EB5929;">+{{iteml.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 40%;">
|
||||
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
|
||||
<view class="fon24 col3">您还没有分享人,快去分享吧</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 底部客服 -->
|
||||
<public-customer :nbottom="100"></public-customer>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
flag:0,
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
cateList:[
|
||||
{title:'一级',num:0,grade:'first'},
|
||||
{title:'二级',num:0,grade:'second'},
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
dataList:[
|
||||
[],
|
||||
[],
|
||||
],
|
||||
navH:uni.getStorageSync('navHeight'),
|
||||
page:1,
|
||||
size:20,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
if(this.total!=this.dataList.length){
|
||||
this.page++
|
||||
this.checkPeople()
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多分享人','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/mysharer/mysharer?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
if(uni.getStorageSync('navHeight')==''){
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.navHeight').boundingClientRect((rect) => {
|
||||
uni.setStorageSync('navHeight',rect.height)
|
||||
this.navH = rect.height
|
||||
}).exec()
|
||||
}
|
||||
this.checkShare()//查询一二级分享总人数
|
||||
this.checkPeople()//查询分享一二级列表人数
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
checkShare(){//查询一二级分享总人数
|
||||
this.$requst.post('user/share-count').then(res=>{
|
||||
// console.log('查询用户的分享统计记录:',res);
|
||||
if(res.code==0){
|
||||
this.cateList[0].num = res.data.user_count.first
|
||||
this.cateList[1].num = res.data.user_count.second
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
checkPeople(){//查询分享一二级列表人数
|
||||
this.$requst.post('user/share-users',{grade:this.cateList[this.flag].grade,page:this.page,size:this.size}).then(res=>{
|
||||
console.log('查询分享一二级列表人数列表:',res);
|
||||
if(this.flag){
|
||||
this.dataList[1] = [];
|
||||
} else {
|
||||
this.dataList[0] = [];
|
||||
}
|
||||
if(res.code==0){
|
||||
if(res.data.list.length!=0){
|
||||
res.data.list.forEach(item=>{
|
||||
let obj = {
|
||||
src:item.account.headimgurl,
|
||||
name:item.account.nickname,
|
||||
time:item.created_at,
|
||||
action:item.invite_source,
|
||||
num:item.score
|
||||
}
|
||||
this.dataList[this.flag].push(obj)
|
||||
})
|
||||
this.total = res.data.total
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
chooseye(index){
|
||||
this.flag = index;
|
||||
this.checkPeople();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,374 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'订单详情'" :statusTitle="true"></status-nav>
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
|
||||
<!-- 订单类型 -->
|
||||
<block v-if="loading">
|
||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||
<view class="disjbac">
|
||||
<view class="bold">{{['商城订单','积分商城订单'][orderInfo.is_score]}}</view>
|
||||
<view v-if="orderInfo.status=='waiting'" class="colf8 bold">待付款</view>
|
||||
<view v-if="orderInfo.status=='paid' && orderInfo.has_virtual!=1" class="colf8 bold">待发货</view>
|
||||
<view v-if="orderInfo.status=='shipped' && orderInfo.has_virtual!=1" class="colf8 bold">待收货</view>
|
||||
<view v-if="orderInfo.status=='completed'" class="col9 bold">已完成</view>
|
||||
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1" class="colf8 bold">待核验</view>
|
||||
<view v-if="orderInfo.virtual_check==1 && orderInfo.has_virtual==1" class="col9 bold">已核验</view>
|
||||
<view v-if="orderInfo.status=='closed'" class="col9 bold">订单已取消</view>
|
||||
</view>
|
||||
<view class="bold col3 mar-s40 mar-x20">订单号:{{orderInfo.coding}}</view>
|
||||
<view class="fon24 col9" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 ">{{daoTime}}</view>
|
||||
<view class="fon24 col9" v-else>{{orderInfo.created_at}}</view>
|
||||
</view>
|
||||
<!-- 物流信息 -->
|
||||
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
|
||||
<view class="bold">物流信息</view>
|
||||
<view class="bold col3 mar-s40 fon26 disjbac">
|
||||
<view>{{orderInfo.express_name}}:{{orderInfo.express_number||'暂无快递单号'}}</view>
|
||||
<view @tap="copyCont">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址信息 -->
|
||||
<view v-if="orderInfo.address!='自提'" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||
<view class="bold">收件人信息</view>
|
||||
<view class="fon26 col3">
|
||||
<view class="fon28 col3 bold" style="margin: 52rpx 0 20rpx 0;">{{addressInfo.userName}}<span class="mar-z10">{{addressInfo.userPhone}}</span></view>
|
||||
<view class="fon24 col9">{{addressInfo.userAddress}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
|
||||
<view class="bold">商家地址信息</view>
|
||||
<view 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 class="bacf radius20 mar-s20 orderDetail-box">
|
||||
<view v-for="(item,index) in orderInfo.skus" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
|
||||
<image :src="item.spu_cover" class="flexs" mode="aspectFill"></image>
|
||||
<view class="width100">
|
||||
<view class="fon28 col3 bold clips2">{{item.spu_name}}</view>
|
||||
<view class="orderDetail-sku">{{item.sku_name}}</view>
|
||||
<view class="disjbac mar-s10">
|
||||
<view class="colf8 fon32 bold"><span v-if="orderInfo.is_score==0">¥{{item.price/100}}</span><span v-else>积分:{{item.score}}</span><span class="fon28 col6 mar-z20 font4">x{{item.num}}</span></view>
|
||||
<view @tap.stop="make(index)" v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1 && item.check_type=='frontend'" class="order-btn">线下核销</view>
|
||||
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1 && item.check_type!='frontend'" class="order-btn" style="background-color: #CCCCCC;">线上核销</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fon28 disjbac mar-s40 mar-x20">
|
||||
<view class="col6">共{{allNum}}件</view>
|
||||
<view class="colf8 bold">共计:{{allPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 快递费用 -->
|
||||
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
|
||||
<view class="bold">快递费用</view>
|
||||
<view class="fon28 colf8 bold">¥{{orderInfo.freight}}.00</view>
|
||||
</view>
|
||||
<!-- 消费 -->
|
||||
<view class="fon28 col3 consumption-box">消费:<span class="fon36 bold colf8"><span v-if="orderInfo.is_score==0">¥{{orderInfo.price/100}}</span><span v-else>{{orderInfo.score}}积分</span> <span v-if="orderInfo.coin!=0">+{{orderInfo.coin}}孔雀币</span></span></view>
|
||||
<view class="disjbac posixzy bacf orderDetail-bottom-box">
|
||||
<view class="posir">
|
||||
<image src="/static/public/weix.png" mode=""></image>
|
||||
<view class="fon28 col3">分享</view>
|
||||
<button open-type="share" class="posia-op"></button>
|
||||
</view>
|
||||
<view @tap="comeing(orderInfo.coding)" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 " class="orderInfo-btn">直接免拼</view>
|
||||
<!-- 待付款 -->
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='waiting'">
|
||||
<view @tap="cancleEv">取消订单</view>
|
||||
<view @tap="paymentEv">立即支付</view>
|
||||
</view>
|
||||
<!-- 待发货 -->
|
||||
<view class="disac paid-btn-box" v-if="orderInfo.status=='paid' && orderInfo.virtual_check==0">
|
||||
<view @tap="cancleEv">取消订单</view>
|
||||
</view>
|
||||
<!-- 确认收货 -->
|
||||
<view @tap="confirmReceipt(orderInfo.id)" class="orderInfo-btn" v-if="orderInfo.status=='shipped'">确认收货</view>
|
||||
</view>
|
||||
<!-- 待核验弹框 -->
|
||||
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;" catchtouchmove="return">
|
||||
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isHeyan=true">
|
||||
<view class="fon28 col3">订单二维码</view>
|
||||
<view class="mar-sx30">
|
||||
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
|
||||
<!-- <image src="/static/public/member-head.png" class="order-hx-img" mode="aspectFill"></image> -->
|
||||
</view>
|
||||
<view class="fon24 col3">
|
||||
<view class=" mar-s40 mar-x20">工作人员扫码核销订单</view>
|
||||
<view>订单未完成前请勿出示二维码</view>
|
||||
</view>
|
||||
<image @tap.stop="closeEv" src="/static/public/closequan.png" class="posia heyan-close" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||||
export default {
|
||||
components:{
|
||||
yzQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
loading:false,
|
||||
isExpress:true,
|
||||
switchQuan:true,
|
||||
showQuan:false,
|
||||
express:'韵达快递:2983625984729',
|
||||
orderInfo:'',//订单信息
|
||||
addressInfo:'',//地址信息
|
||||
allPrice:0,//共计
|
||||
allNum:0,//共
|
||||
times:0,//点击次数
|
||||
goAddress:'四川省成都市青羊区青羊大道213号',
|
||||
isHeyan:false,
|
||||
canvasQrPath: '',
|
||||
text: 'hello',
|
||||
size: 162,
|
||||
colorDark: '#000000',
|
||||
colorLight: '#ffffff',
|
||||
timer:null,
|
||||
daoTime:'',
|
||||
timerDao:null,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
let maiOjb = {
|
||||
e:6,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: '成都恒美毛发', // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}}` // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onUnload() {
|
||||
this.closeEv();
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin();}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkInfo(options.id);
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
comeing(coding){
|
||||
this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('免拼成功');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
}
|
||||
})
|
||||
},
|
||||
confirmReceipt(id){//确认收货事件
|
||||
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.$toolAll.tools.showToast('收货成功');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
make(index){
|
||||
this.isHeyan = true;
|
||||
this.text = `${this.orderInfo.coding}H${this.orderInfo.skus[index].id}`;
|
||||
let params = {
|
||||
order_coding:this.orderInfo.coding,
|
||||
id:this.orderInfo.skus[index].id,
|
||||
not_check_num:this.orderInfo.skus[index].not_check_num
|
||||
}
|
||||
this.timer = setInterval(()=>{
|
||||
this.$requst.post('order/check-result',params).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.result==1){
|
||||
this.isHeyan = false;
|
||||
this.$toolAll.tools.showToast('已完成');
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
})
|
||||
},3000)
|
||||
},
|
||||
closeEv(){
|
||||
this.isHeyan = false;
|
||||
clearInterval(this.timer);
|
||||
clearInterval(this.timerDao);
|
||||
},
|
||||
cancleEv(){//取消订单
|
||||
this.times++;
|
||||
if(this.times==2){
|
||||
this.$requst.post('order/cancel',{order_coding:this.orderInfo.coding}).then(res=>{
|
||||
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;
|
||||
if(this.orderInfo.group_make_end_at!=null){
|
||||
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
|
||||
this.timerDao = setInterval(()=>{
|
||||
if(new Date().getTime()-new Date().getTime(this.orderInfo.group_make_end_at)>0){
|
||||
this.checkInfo(this.orderInfo.id);
|
||||
clearInterval(this.timerDao)
|
||||
} else {
|
||||
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
let naddress = this.orderInfo.address.split(',');
|
||||
if(naddress[0]!='自提'){
|
||||
let nphone = this.$toolAll.tools.hideMPhone(naddress[1].trim())
|
||||
this.addressInfo = {
|
||||
userName:naddress[0].trim(),
|
||||
userPhone:nphone,
|
||||
userAddress:naddress[2].trim()
|
||||
}
|
||||
}
|
||||
this.loading = true;
|
||||
}
|
||||
})
|
||||
},
|
||||
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({//获取当前经纬度
|
||||
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
|
||||
success: function (res) {
|
||||
wx.openLocation({//使用微信内置地图查看位置。
|
||||
latitude: 30.67554,//要去的纬度-地址
|
||||
longitude: 104.010642,//要去的经度-地址
|
||||
name: val,
|
||||
address: val
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,223 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'二维码海报'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy20 pad-x180">
|
||||
<view class="tc mar-s20 col6 fon28">请选择海报背景后分享</view>
|
||||
<view v-if="imgList.length!=0">
|
||||
<view class="mar-s20 disjbac fw">
|
||||
<image @tap="chooseImg(index)" v-for="(item,index) in imgList" :key="index" class="width100 radius20 mar-x20" :src="item" style="width: 48.5%;max-height: 474rpx" mode="aspectFill" lazy-load></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="disjcac fc" style="margin-top: 50%;">
|
||||
<image class="zanw-img mar-x50" src="/static/public/zanwn.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col3 mar-s50" style="margin-top: 30%;">暂无内容</view>
|
||||
</view>
|
||||
<!-- 预览弹框 -->
|
||||
<view v-if="showBtn" @tap.stop="showBtn=false" class="posAll disjcac fc pad-zy50" style="z-index: 3;">
|
||||
<image :src="imgSrc" @tap.stop="showBtn=true" class="radius20" style="width: 80%;" mode="widthFix"></image>
|
||||
<!-- 分享按钮 -->
|
||||
<view v-if="haved" @tap.stop="shareEv" class="disjcac radius20 posixzy" style="height: 90rpx;margin: 20rpx 80rpx;background-color: #38CE51;line-height: 90rpx;bottom: 40rpx;">
|
||||
<view class="disac">
|
||||
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
|
||||
<view class="fon40 bold colf mar-z10">分享给好友</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="imgList.length==0 && isHaib" :contentVal="'立即生成创意海报'" :clearVal="'暂不生成'" :comfrimVal="'立即生成'" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nbottom="100"></public-customer> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="tabimgList" :newcurrent='-1'></foot-tab>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {base64ToPath} from '@/jsFile/base64-src.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isShowT:true,
|
||||
imgList:uni.getStorageSync('imgSrcList'),
|
||||
imgSrc:'',
|
||||
showBtn:false,
|
||||
isHaib:false,
|
||||
haved:true,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
titleList:[],//tab标题
|
||||
tabimgList:[],//tab图标
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/personalPoster/personalPoster?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin() ;this.haved = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
// uni.removeStorageSync('imgSrcList')
|
||||
//如果还没有生成海报
|
||||
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//弹框关闭
|
||||
else this.imgList = []
|
||||
this.checkPoster();
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.tabimgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.tabimgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.tabimgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.tabimgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.tabimgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.tabimgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.tabimgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
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.imgSrc = '';
|
||||
this.haved = this.showBtn = true;
|
||||
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(){
|
||||
this.haved = false;
|
||||
wx.showShareImageMenu({
|
||||
path: this.imgSrc,
|
||||
success:(res=>{
|
||||
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
}),
|
||||
fail:(res=>{//取消分享
|
||||
this.haved = true
|
||||
})
|
||||
})
|
||||
},
|
||||
comfirmev(){//立即生成事件
|
||||
this.$toolAll.tools.showToast('生成中...')
|
||||
this.isShowT = false
|
||||
// 单张海报
|
||||
this.$requst.get('user/personal-poster').then(res=>{
|
||||
// console.log('生成个人海报成功:',res);
|
||||
if(res.code==0){
|
||||
let newArr = [];
|
||||
newArr.push(res.data.poster)
|
||||
uni.hideToast()
|
||||
newArr.forEach(item=>{
|
||||
base64ToPath(item).then(path => {
|
||||
this.imgList.push(path)
|
||||
uni.setStorageSync('imgSrcList',this.imgList)
|
||||
}).catch(error => {})
|
||||
})
|
||||
this.$toolAll.tools.showToast('生成海报成功');
|
||||
this.isHaib = false
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
cancleev(){//暂不生成事件
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,591 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav v-if="invite_code==''" :titleVal="'分类'" :statusTitle="true"></status-nav>
|
||||
<view v-if="invite_code!=''" class="status-box statusHNH" style="background-color: #FFFFFF;">
|
||||
<view :style="{height:statusBarHeight+'px'}"></view>
|
||||
<view class="status-nav">
|
||||
<!-- 标题 -->
|
||||
<view class="tab-title tcenter" style="color: #000000;">分类</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view :style="{top: statusHNH+'px'}" class="posiszy" style="height: 50px;">
|
||||
<view class="bacf pad-zy32 pad-sx20">
|
||||
<cate-pu @choosecateEv="choosecateEv" :activeb="invite_code!=''?'#3875F6':publicColor"
|
||||
:newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pad-x180" :style="{paddingTop: (statusHNH+50)+'px'}">
|
||||
<view v-if="isLoading" class="pad-s30">
|
||||
<view v-show="cateCurrent==isNum">
|
||||
<view class="pad-zy32">
|
||||
<!-- 自定义轮播 -->
|
||||
<swiper-pu :browseP="true" :isplay="isAutoPlay" :bannerList="bannerList" :newHeight="newHeight"
|
||||
:newRadius="'10'" :newBottom="'5'"></swiper-pu>
|
||||
<!-- 标题 -->
|
||||
<view class="fon36 col3 bold mar-sx20 clips2" style="line-height: 50rpx;">{{detailObj.title}}
|
||||
</view>
|
||||
<view class="disjbac">
|
||||
<view class="disac">
|
||||
<!-- 发布者头像 -->
|
||||
<image class="flexs" :src="fabImg || '/static/public/logo.png'"
|
||||
style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="aspectFill"></image>
|
||||
<view class="mar-z10">
|
||||
<!-- 发布者昵称 -->
|
||||
<view class="fon28 col3 clips1">{{detailObj.published_by || '恒美植发'}}</view>
|
||||
<!-- 发布时间 -->
|
||||
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="disac flexs">
|
||||
<view class="disac fc" @tap="tapLike" style="width: 60rpx;">
|
||||
<image v-if="isDetailLike" src="/static/public/detail-like.png"
|
||||
style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||
<image v-else src="/static/public/detail-nlike.png"
|
||||
style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||
<view class="fon24 col9 tc">{{likeCon}}</view>
|
||||
</view>
|
||||
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
||||
<image src="/static/public/weix.png" style="width: 42rpx;height: 42rpx;" mode=""></image>
|
||||
<view class="fon24 col9">分享</view>
|
||||
<button class="posia" open-type="share"
|
||||
style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
|
||||
</view>
|
||||
<view class="disac fc" @tap="tapConllection">
|
||||
<image v-if="isDetailConllection" src="/static/public/yconllection.png"
|
||||
style="width: 44rpx;height: 44rpx;" mode=""></image>
|
||||
<image v-else src="/static/public/conllection.png"
|
||||
style="width: 44rpx;height: 44rpx;" mode=""></image>
|
||||
<view class="fon24 col9">收藏</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 内容详情 -->
|
||||
<view class="fon28 mar-s20" style="color: #1A1A1A; line-height: 40rpx;">
|
||||
<rich-text :nodes="detailInfo"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pad-zy20">
|
||||
<view class="fon30 bold tc mar-sx40" :style="{color:publicColor}">相关推荐</view>
|
||||
<!-- 相关推荐列表 -->
|
||||
<list-pu @chooseLike="chooseLikex" @comfirmev="comfirmevx" :list="xgList"></list-pu>
|
||||
</view>
|
||||
<view class="tc fon28 bold" style="color: #fff;background-color: #3875f6;padding: 20rpx;" @tap="backEv">更多{{contentVal}}>></view>
|
||||
<view class="pad-zy20">
|
||||
<view class="fon30 bold tc mar-sx40" :style="{color:publicColor}">推荐医生</view>
|
||||
<!-- 推荐医生列表 -->
|
||||
<list-doctor v-if="dataList.length!=0" :list="dataList"></list-doctor>
|
||||
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 10%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="cateCurrent!=isNum">
|
||||
<view v-if="allList.length!=0" class="pad-zy20">
|
||||
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="allList"></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>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2" @cancleEv="cancleEv"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部导航 -->
|
||||
<view class="posixzy">
|
||||
<bottom-tab></bottom-tab>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listDoctor from '@/components/list-doctor.vue';
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import bottomTab from '@/components/bottom-tab.vue';
|
||||
import {
|
||||
collectionEV,
|
||||
cancleCollectionEV
|
||||
} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components: {
|
||||
listDoctor,
|
||||
swiperPu,
|
||||
bottomTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
|
||||
isLoading: false,
|
||||
vision: false,
|
||||
statusHNH: uni.getStorageSync('statusHNH'),
|
||||
publicColor: uni.getStorageSync('publicColor') || '#3875F6', //主题颜色
|
||||
cateCurrent: 0,
|
||||
haveImg: true,
|
||||
cateList: [],
|
||||
bannerList: [], //轮播
|
||||
xgList: [ //相关推荐
|
||||
],
|
||||
dataList: [ //推荐医生
|
||||
],
|
||||
showTop: false,
|
||||
isDetailLike: false, //是否喜欢
|
||||
likeCon: '点赞',
|
||||
isDetailConllection: false, //是否已收藏
|
||||
isNum: 0,
|
||||
listArrone: [], //问题
|
||||
listArrtwo: [ //案例日记
|
||||
],
|
||||
listArrthree: [ //效果模拟
|
||||
],
|
||||
listArrfour: [ //科普视频
|
||||
],
|
||||
detailObj: {}, //详情
|
||||
detailInfo: '', //富文本
|
||||
category_id: '', //栏目ID
|
||||
active: '', //是否是详情页
|
||||
// jieDuan:false,
|
||||
share_id: 0,
|
||||
invite_code: '',
|
||||
isShowP: false,
|
||||
bcurrent: 0,
|
||||
isAutoPlay: false,
|
||||
fabImg: '' ,//发布者头像
|
||||
allArr:[],
|
||||
page:1,
|
||||
size:20,
|
||||
total:0,
|
||||
isZanw:true,
|
||||
allList:[],
|
||||
contentVal:'',
|
||||
newHeight:'450'
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() { //触底事件
|
||||
if(this.cateCurrent!=this.isNum){
|
||||
if(this.total!=this.allList.length){
|
||||
this.page++
|
||||
this.checkList(this.cateCurrent)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
}
|
||||
},
|
||||
onShareTimeline() {},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
this.$requst.post('user/record', {
|
||||
type: 'content',
|
||||
action: 'share',
|
||||
id: this.detailObj.id
|
||||
}).then(res => {
|
||||
console.log('分享成功:', res);
|
||||
}, error => {})
|
||||
let maiOjb = {
|
||||
e: 4, //内容分享
|
||||
c: this.detailObj.id * 1,
|
||||
t: new Date().getTime() //当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
var shareObj = {
|
||||
title: `${ya.detailObj.title}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/problemDetail/problemDetail?id=${this.detailObj.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
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.category_id != undefined) {
|
||||
this.category_id = options.category_id
|
||||
if(options.invite_code!=undefined){this.invite_code = options.invite_code;}
|
||||
if (options.share_id != undefined){this.share_id = options.share_id;}
|
||||
this.checkDetail(options.id);
|
||||
let maiOjb = {
|
||||
e: 1, //内容访问
|
||||
c: options.id * 1,
|
||||
t: new Date().getTime() //当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb);
|
||||
if(uni.getStorageSync('phone_active')!=1){
|
||||
this.vision = true;
|
||||
this.loginEv(options);
|
||||
} else {
|
||||
//查询过期时间和是否有token,并调用登录事件
|
||||
this.$toolAll.tools.overdue();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loginEv(options) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res) => {
|
||||
var params = {
|
||||
code: res.code,
|
||||
invite_code: options.invite_code || '', //用户邀请码
|
||||
source_code: options.source_code || '',
|
||||
channel: options.channel || ''
|
||||
}
|
||||
this.$requst.post('user/login', params).then(res => {
|
||||
if (res.data.token != '') {
|
||||
if (res.data.is_active == 0) {
|
||||
this.haveImg = false;
|
||||
}
|
||||
}
|
||||
}, error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
chooseLike(e) { //收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if (this.allList[e].is_collected == 0) {
|
||||
this.allList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.allList[e].id
|
||||
})
|
||||
}
|
||||
},
|
||||
comfirmev(e) { //确认取消收藏事件
|
||||
this.allList[e].is_collected = 0;
|
||||
this.$toolAll.tools.showToast('正在取消...', 'loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.allList[e].id
|
||||
})
|
||||
},
|
||||
chooseLikex(e) { //收藏事件
|
||||
if (this.xgList[e].is_collected == 0) {
|
||||
this.xgList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.xgList[e].id
|
||||
})
|
||||
}
|
||||
},
|
||||
comfirmevx(e) { //确认取消收藏事件
|
||||
this.xgList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...', 'loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.xgList[e].id
|
||||
})
|
||||
},
|
||||
buttonH(e) { //授权成功
|
||||
this.haveImg = e
|
||||
if (e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cancleEv(e) { //取消授权
|
||||
if (e == 0) this.vision = false
|
||||
},
|
||||
checkDetail(newId) {
|
||||
this.$requst.post('archives/detail', {
|
||||
id: newId,
|
||||
share_id: this.share_id
|
||||
}).then(res => {
|
||||
// console.log('详情数据:',res);
|
||||
if (res.code == 0) {
|
||||
this.isLoading = true
|
||||
// 栏目类别
|
||||
if (res.data.category.length != 0) {
|
||||
res.data.category.forEach((item, index) => {
|
||||
let cateObj = {
|
||||
id: item.id, //栏目ID
|
||||
title: item.title, //栏目名称
|
||||
active: item.active, //是否选中
|
||||
model_id: item.model_id, //模型ID
|
||||
model_name: item.model_name, //模型标识
|
||||
sort: item.sort
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
this.allArr.push([]);
|
||||
// 默认选中的栏目
|
||||
if (item.active == 1) this.active = this.cateCurrent = index
|
||||
// 默认展示栏目详情
|
||||
if (this.category_id == item.id) this.isNum = index
|
||||
})
|
||||
this.contentVal = this.cateList[this.cateCurrent].title.slice(2);
|
||||
if(this.cateList[this.cateCurrent].title== '毛发百科' || this.cateList[this.cateCurrent].title== '科普视频') {
|
||||
this.newHeight = '200';
|
||||
}
|
||||
}
|
||||
if (this.invite_code != '' && this.invite_code != undefined) {
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.statusHNH = rect.height
|
||||
// console.log(this.statusHNH );
|
||||
}).exec()
|
||||
}
|
||||
// 详情
|
||||
this.detailObj = res.data.detail;
|
||||
if (this.detailObj.published_headimgurl != '') {
|
||||
this.fabImg = this.$http + this.detailObj.published_headimgurl;
|
||||
}
|
||||
let maiOjb = {
|
||||
e: 1, //内容访问
|
||||
c: this.detailObj.id * 1,
|
||||
t: new Date().getTime() //当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if (this.detailObj.is_liked == 1) {
|
||||
if (this.detailObj.likes >= 1000) this.likeCon = '999+'
|
||||
else this.likeCon = this.detailObj.likes
|
||||
}
|
||||
// 轮播
|
||||
// 图片字符串转数组
|
||||
let arrImg = this.detailObj.images.split(',')
|
||||
arrImg.forEach(item => {
|
||||
let newImgObj = {
|
||||
imgSrc: this.$http + item,
|
||||
url: '',
|
||||
isVideo: false,
|
||||
poster: '',
|
||||
}
|
||||
// 存图片
|
||||
this.bannerList.push(newImgObj)
|
||||
})
|
||||
// 存视频
|
||||
if (this.detailObj.video != '') {
|
||||
this.bannerList[0] = {
|
||||
imgSrc: this.$http + arrImg[0],
|
||||
url: this.$http + this.detailObj.video,
|
||||
isVideo: true,
|
||||
poster: '',
|
||||
}
|
||||
}
|
||||
// 默认显示是否收藏
|
||||
if (this.detailObj.is_collected == 0) this.isDetailConllection = false
|
||||
if (this.detailObj.is_collected == 1) this.isDetailConllection = true
|
||||
if (this.detailObj.is_liked == 0) this.isDetailLike = false
|
||||
if (this.detailObj.is_liked == 1) this.isDetailLike = true
|
||||
// 富文本
|
||||
this.detailInfo = this.$toolAll.tools.escape2Html(this.detailObj.content)
|
||||
// 相关推荐xgList
|
||||
if(this.cateList[this.cateCurrent].title=='日记分享') {
|
||||
if (res.data.diary.length != 0) {
|
||||
res.data.diary.forEach(item => {
|
||||
let fabImg = '';
|
||||
if (item.published_headimgurl != '' && item.published_headimgurl != null) {
|
||||
fabImg = this.$http + item.published_headimgurl
|
||||
}
|
||||
let tObj = {
|
||||
category_id: item.category_id, //栏目ID
|
||||
id: item.id,
|
||||
is_collected: item.is_collected, //是否已收藏
|
||||
collects: item.collects, //收藏量
|
||||
views: item.views, //查看量
|
||||
main_img: this.$http + item.cover, //封面图
|
||||
video: this.$http + item.video, //视频地址
|
||||
title: item.title, //标题
|
||||
content: item.subtitle, //副标题
|
||||
head_img: fabImg || '/static/public/logo.png', //发布者头像
|
||||
name: item.published_by || '恒美植发', //发布者昵称
|
||||
isVideo: item.video.includes(".mp4") //是否是视频
|
||||
}
|
||||
if (item.cover != '' && item.video == '') {
|
||||
this.xgList.push(tObj)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.relevant();
|
||||
}
|
||||
// 推荐医生
|
||||
if (res.data.doctor.length != 0) {
|
||||
res.data.doctor.forEach(item => {
|
||||
let doObj = {
|
||||
id: item.id,
|
||||
imgSrc: item.headimg != null ? item.headimg : '',
|
||||
name: item.name,
|
||||
cyear: parseFloat(item.work_time),
|
||||
bmen: item.dept_name,
|
||||
zcheng: '主任医师',
|
||||
goodAt: item.diseases,
|
||||
show_detail: item.show_detail
|
||||
}
|
||||
this.dataList.push(doObj)
|
||||
})
|
||||
}
|
||||
this.choosecateEv(this.cateCurrent)
|
||||
}
|
||||
}, error => {})
|
||||
},
|
||||
relevant(){
|
||||
this.$requst.post('archives/category', {
|
||||
category_id: this.cateList[this.cateCurrent].id,
|
||||
keyword: '',
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}).then(res => {
|
||||
if(res.code==0){
|
||||
if (res.data.list.list.length != 0) {
|
||||
res.data.list.list.forEach(item => {
|
||||
let fabImg = '';
|
||||
if (item.published_headimgurl != '' && item.published_headimgurl != null)
|
||||
fabImg = this.$http + item.published_headimgurl
|
||||
let tObj = {
|
||||
category_id: item.category_id, //栏目ID
|
||||
id: item.id,
|
||||
is_collected: item.is_collected, //是否已收藏
|
||||
collects: item.collects, //收藏量
|
||||
views: item.views, //查看量
|
||||
main_img: this.$http + item.cover, //封面图
|
||||
video: this.$http + item.video, //视频地址
|
||||
title: item.title, //标题
|
||||
content: item.subtitle, //副标题
|
||||
head_img: fabImg || '/static/public/logo.png', //发布者头像
|
||||
name: item.published_by || '恒美植发', //发布者昵称
|
||||
isVideo: item.video.includes(".mp4") //是否是视频
|
||||
}
|
||||
if (item.cover != '' && item.video == '') {
|
||||
this.xgList.push(tObj)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
choosecateEv(e) {
|
||||
this.page = 1;
|
||||
this.isZanw = true;
|
||||
this.checkList(e);
|
||||
},
|
||||
checkList(e){
|
||||
this.$requst.post('archives/category', {
|
||||
category_id: this.cateList[e].id,
|
||||
keyword: '',
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}).then(res => {
|
||||
// console.log('该分类下的列表:',res);
|
||||
if (res.code == 0) {
|
||||
if(this.page==1) {
|
||||
if(this.active != e) this.allList = [];
|
||||
uni.pageScrollTo({
|
||||
scrollTop:0,
|
||||
duration:0
|
||||
})
|
||||
}
|
||||
this.total = res.data.list.total;
|
||||
if (res.data.list.list.length != 0) {
|
||||
res.data.list.list.forEach(item => {
|
||||
let num = item.video.search(".mp4")
|
||||
let isVideo = false
|
||||
if (num != '-1') isVideo = true
|
||||
let fabImg = '';
|
||||
if (item.published_headimgurl != '' && item.published_headimgurl != null)
|
||||
fabImg = this.$http + item.published_headimgurl
|
||||
let arrObj = {
|
||||
category_id: item.category_id, //栏目ID
|
||||
id: item.id,
|
||||
is_collected: item.is_collected, //是否已收藏
|
||||
collects: item.collects, //收藏量
|
||||
views: item.views, //查看量
|
||||
main_img: this.$http + item.cover, //封面图
|
||||
video: this.$http + item.video, //视频地址
|
||||
title: item.title, //标题
|
||||
content: item.subtitle, //副标题
|
||||
head_img: fabImg || '/static/public/logo.png', //发布者头像
|
||||
name: item.published_by || '恒美植发', //发布者昵称
|
||||
isVideo: isVideo //是否是视频
|
||||
}
|
||||
if (item.cover != '') {
|
||||
this.allList.push(arrObj);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.cateCurrent = e;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
}, error => {})
|
||||
},
|
||||
tapLike() { //喜欢、不喜欢事件
|
||||
if(this.haveImg){
|
||||
this.isDetailLike = !this.isDetailLike
|
||||
if (this.isDetailLike) {
|
||||
this.detailObj.likes++
|
||||
this.likeCon = this.detailObj.likes
|
||||
if (this.likeCon >= 1000) this.likeCon = '999+'
|
||||
} else {
|
||||
this.detailObj.likes--
|
||||
this.likeCon = '喜欢'
|
||||
}
|
||||
let isLikeCon = 'like'
|
||||
//调用点赞事件
|
||||
if (this.isDetailLike) collectionEV({
|
||||
action: isLikeCon,
|
||||
archive_id: this.detailObj.id
|
||||
})
|
||||
//调用取消点赞事件
|
||||
else cancleCollectionEV({
|
||||
action: isLikeCon,
|
||||
archive_id: this.detailObj.id
|
||||
})
|
||||
} else {
|
||||
// 调起授权弹框
|
||||
this.vision = true;
|
||||
}
|
||||
},
|
||||
tapConllection() { //收藏、取消收藏事件
|
||||
let isLikeCon = 'collect'
|
||||
if(this.haveImg){
|
||||
// 调用收藏事件
|
||||
if (!this.isDetailConllection) collectionEV({
|
||||
action: isLikeCon,
|
||||
archive_id: this.detailObj.id
|
||||
})
|
||||
// 调用取消收藏事件
|
||||
else cancleCollectionEV({
|
||||
action: isLikeCon,
|
||||
archive_id: this.detailObj.id
|
||||
})
|
||||
this.isDetailConllection = !this.isDetailConllection
|
||||
} else {
|
||||
// 调起授权弹框
|
||||
this.vision = true;
|
||||
}
|
||||
},
|
||||
backTop() { //回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
backEv(){
|
||||
uni.navigateBack({delta:1})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,305 @@
|
|||
<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 class=" pad-zy20 mar-s40" v-if="!isList">
|
||||
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="false" :newbmo="'#E0E0E0'" @choosecateEv="chooseTwo" :newcateList="cateList"></cate-pu>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 历史搜索和热门搜索 -->
|
||||
<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">
|
||||
<list-pu :radiu="true" @chooseLike="chooseLike" @comfirmev="comfirmevl" :list="dataList"></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>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
|
||||
export default {
|
||||
components:{
|
||||
cateTu
|
||||
},
|
||||
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,//是否显示默认显示
|
||||
cateList:[//所以二级分类
|
||||
|
||||
],
|
||||
dataList:[//小课堂数据列表
|
||||
|
||||
],
|
||||
showTop:false,//是否显示返回顶部
|
||||
newCurrent:0,
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
category_id:'',//栏目ID
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.removeStorageSync('cateList')
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/searchPage/searchPage?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||
this.searchVal = options.keyWorld
|
||||
this.searchEv()
|
||||
}
|
||||
this.checkSearchHistory()
|
||||
this.checkKey()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
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=>{})
|
||||
},
|
||||
chooseLike(e){//收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if(this.dataList[e].is_collected==0){
|
||||
this.dataList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
}
|
||||
},
|
||||
comfirmevl(e){//确认取消收藏事件
|
||||
this.dataList[e].is_collected = 0
|
||||
this.$toolAll.tools.showToast('正在取消...','loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
|
||||
},
|
||||
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(){//搜索事件
|
||||
// console.log('栏目ID:',this.category_id,'关键词:',this.searchVal);
|
||||
this.$toolAll.tools.showToast('搜索中...')
|
||||
this.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{
|
||||
// console.log('搜索提交:',res);
|
||||
if(res.code==0){
|
||||
uni.hideToast()
|
||||
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
||||
if(res.data.category.length!=0){
|
||||
res.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
})
|
||||
uni.setStorageSync('cateList',this.cateList)
|
||||
}
|
||||
} else {
|
||||
//获取缓存中的栏目
|
||||
this.cateList = uni.getStorageSync('cateList')
|
||||
}
|
||||
// 获取列表
|
||||
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 fabImg = '';
|
||||
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
|
||||
let tObj = {
|
||||
category_id:item.category_id,//栏目ID
|
||||
id:item.id,
|
||||
is_collected:item.is_collected,//是否已收藏
|
||||
collects:item.collects,//收藏量
|
||||
views:item.views,//查看量
|
||||
main_img:this.$http + item.cover,//封面图
|
||||
video:this.$http + item.video,//视频地址
|
||||
title:item.title,//标题
|
||||
content:item.subtitle,//副标题
|
||||
head_img: fabImg || '/static/public/logo.png',//发布者头像
|
||||
name:item.published_by || '恒美植发',//发布者昵称
|
||||
isVideo:item.video.includes(".mp4")//是否是视频
|
||||
}
|
||||
this.dataList.push(tObj);
|
||||
// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)
|
||||
// if(this.newCurrent==3 && item.category_id==38) 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.category_id = this.cateList[index].id
|
||||
this.searchEv()
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,195 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'分享中心'" :statusTitle="true"></status-nav>
|
||||
<!-- 自定义二级分类 -->
|
||||
<!-- 列表 -->
|
||||
<view :style="{paddingTop: statusHNH+'px'}" class="pad-zy32">
|
||||
<view class="radius20 pad20 bacf mar-s20 col3">
|
||||
<view class="fon28 bold mar-x40 pad-z10">我的分享</view>
|
||||
<view class="disja">
|
||||
<view @tap="goPage(index)" class="disac fc flexs width33" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="fon36 bold clips1">{{item.num}}</view>
|
||||
<view class="fon26 mar-s25">{{item.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分享按钮 -->
|
||||
<view @tap="shareEv" class="disjcac radius20 posir" style="height: 90rpx;margin: 70rpx 80rpx;background-color: #38CE51;line-height: 90rpx;">
|
||||
<view class="disac">
|
||||
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
|
||||
<view class="fon40 bold colf mar-z10">分享给好友</view>
|
||||
</view>
|
||||
<!-- <button open-type="share" class="posia width100" style="opacity: 0;">分享给好友</button> -->
|
||||
<!-- <button @tap="shareEv" class="posia width100" style="opacity: 0;">分享给好友</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" :contentVal="'暂未开放此功能,请耐心等候'" :isCenter="true" :comfrimVal="'好的'" @comfirmev="isShowT=false"></pu-po>
|
||||
<!-- 底部客服 -->
|
||||
<!-- <public-customer :nbottom="100"></public-customer> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
<!-- 底部tab -->
|
||||
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
isShowT:false,
|
||||
imgSrc:'/static/public/shareh.png',
|
||||
dataList:[
|
||||
{num:'0',title:'积分'},
|
||||
{num:'0',title:'分享人'},
|
||||
{num:'0',title:'分享订单'},
|
||||
],
|
||||
imgSrcP:uni.getStorageSync('imgSrcP'),
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
titleList:[],//tab标题
|
||||
imgList:[],//tab图标
|
||||
}
|
||||
},
|
||||
onShareAppMessage(options) {
|
||||
var ya = this;
|
||||
var shareObj = {
|
||||
title: '恒美植发', // 默认是小程序的名称(可以写slogan等)
|
||||
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.imgSrc, //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
success: function(res){
|
||||
// 转发成功之后的回调
|
||||
if(res.errMsg == 'shareAppMessage:ok'){
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
},
|
||||
fail: function(res){
|
||||
// 转发失败之后的回调
|
||||
if(res.errMsg == 'shareAppMessage:fail cancel'){
|
||||
// 用户取消转发
|
||||
}else if(res.errMsg == 'shareAppMessage:fail'){
|
||||
// 转发失败,其中 detail message 为详细失败信息
|
||||
}
|
||||
}
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;} else {this.$toolAll.tools.isLogin()}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
|
||||
this.$requst.post('index/mini-program-setting').then(res=>{
|
||||
// log('数据:',res);
|
||||
if(res.code==0){
|
||||
if(res.data.length!=0){
|
||||
if(res.data.footBar.length!=0){//底部导航
|
||||
res.data.footBar.forEach(item=>{
|
||||
let newName = item.name
|
||||
let newObj = {
|
||||
iconPath:this.$http + item.icon[0],
|
||||
selectedIconPath:this.$http + item.icon[1],
|
||||
}
|
||||
if(item.key=="home"){
|
||||
this.imgList[0] = newObj
|
||||
this.titleList[0] = newName
|
||||
}
|
||||
if(item.key=="category"){
|
||||
this.imgList[1] = newObj
|
||||
this.titleList[1] = newName
|
||||
}
|
||||
if(item.key=="service"){
|
||||
this.imgList[2] = newObj
|
||||
this.titleList[2] = newName
|
||||
}
|
||||
if(item.key=="shop"){
|
||||
this.imgList[3] = newObj
|
||||
this.titleList[3] = newName
|
||||
}
|
||||
if(item.key=="my"){
|
||||
this.imgList[4] = newObj
|
||||
this.titleList[4] = newName
|
||||
}
|
||||
})
|
||||
uni.setStorageSync('footTitle',this.titleList)
|
||||
uni.setStorageSync('footimg',this.imgList)
|
||||
this.titleList = uni.getStorageSync('footTitle')
|
||||
this.imgList = uni.getStorageSync('footimg')
|
||||
}
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
shareEv(){//分享事件
|
||||
if(this.imgSrcP==''){
|
||||
this.$toolAll.tools.showToast('请先前往个人海报申请海报')
|
||||
} else {
|
||||
wx.showShareImageMenu({
|
||||
path: this.imgSrcP
|
||||
})
|
||||
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:4,//内容分享
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
},
|
||||
goPage(index){
|
||||
let newUrl = ''
|
||||
if(index==1) newUrl = '/pagesB/mysharer/mysharer'
|
||||
uni.navigateTo({
|
||||
url:newUrl
|
||||
})
|
||||
},
|
||||
// shareEv(){
|
||||
// this.isShowT = true
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,953 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav v-if="invite_code==''" :titleVal="'商品详情'" :statusTitle="true"></status-nav>
|
||||
<view v-if="invite_code!=''" class="status-box statusHNH" style="background-color: #FFFFFF;">
|
||||
<view :style="{height:statusBarHeight+'px'}"></view>
|
||||
<view class="status-nav">
|
||||
<!-- 标题 -->
|
||||
<view class="tab-title tcenter" style="color: #000000;">商品详情</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表 -->
|
||||
<view :style="{top: statusHNH+'px'}" v-if="isNei!=3" class="posiszy" style="height: 50px;">
|
||||
<view class="bacf pad-zy32 pad-sx20">
|
||||
<cate-pu @choosecateEv="choosecateEv" :activeb="invite_code!=''?'#3875F6':publicColor" :newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{top: statusHNH+'px'}" v-else class="posiszy" style="height: 50px;"></view>
|
||||
<view class="pad-x180" :style="{paddingTop: isNei!=3?(statusHNH+60)+'px':statusHNH+'px'}">
|
||||
<!-- 自定义轮播 -->
|
||||
<view v-if="isLoading">
|
||||
<swiper-pu v-if="cateCurrent==0" :isplay="isAutoPlay" :browseP="true" :bannerList="bannerList" :newHeight="swiperHeight" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
|
||||
<!-- <view v-if="isNei==3" class="score-box">积分:{{detailObj.score}}</view> -->
|
||||
<view v-show="cateCurrent==isNum">
|
||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<!-- 标题 -->
|
||||
<view class="mar-x20 fon36 col3 bold clips3 shop-title-box line-h50">
|
||||
<view style="margin-top: -8rpx;margin-right: 10rpx;">
|
||||
<span v-if="isNei!=3" class="radius15 colf fon20" :style="{background:publicColor}">{{detailObj.disease_name}}</span>
|
||||
<span v-if="isNei==0" class="radius15 colf fon20 mar-z10">团购</span>
|
||||
<span v-if="isNei==1" class="radius15 colf fon20 mar-z10">拼团活动</span>
|
||||
<span v-if="isNei==2" class="radius15 colf fon20 mar-z10">促销活动</span>
|
||||
</view>
|
||||
<span>{{detailObj.name}}</span>
|
||||
</view>
|
||||
<view class="fon24 col7D">无任何额外消费</view>
|
||||
<!-- 团购商品详情时显示 -->
|
||||
<view v-if="isNei==0" class="disjbac fon24 mar-s20 col7D">
|
||||
<view>团购累计参与人员:{{detailObj.activity_order_num}}人</view>
|
||||
<view>还剩余:{{detailObj.group_surplus_num}}人</view>
|
||||
</view>
|
||||
<!-- <view class="mar-s20 shop-price" v-if="isNei!=3"><span v-if="isNei==0">团购价:</span><span v-if="isNei==1">拼团价:</span>¥{{detailObj.price/100}} <span v-if="isNei!=10">¥{{detailObj.original_price/100}}</span></view> -->
|
||||
<view class="mar-s20 shop-price" v-if="isNei!=3"><span v-if="isNei==0">团购价:</span><span v-if="isNei==1">拼团价:</span>¥{{detailObj.price/100}} <span>¥{{detailObj.original_price/100}}</span></view>
|
||||
<view class="mar-s20 shop-price" v-else>积分:{{detailObj.score}}</view>
|
||||
<view class="disjbac shar-box" style="align-items: flex-end;">
|
||||
<view>
|
||||
<view class="disac" v-if="detailObj.level_text!=''">
|
||||
<image class="flexs" src="/static/public/huiy.png" mode="aspectFill"></image>
|
||||
<view class="fon24 col9">{{detailObj.level_text}}</view>
|
||||
</view>
|
||||
<view v-else class="fon24 col9">全部人员可买</view>
|
||||
</view>
|
||||
<view class="disac flexs">
|
||||
<view @tap="shareEv" class="disac fc mar-zy36 posir">
|
||||
<image src="/static/public/weix.png" class="wh42" mode=""></image>
|
||||
<view class="fon24 col9">分享</view>
|
||||
<button class="posia-op" open-type="share">分享</button>
|
||||
</view>
|
||||
<view class="disac fc" @tap="tapConllection">
|
||||
<image v-if="isDetailConllection" src="/static/public/yconllection.png" class="wh44" mode=""></image>
|
||||
<image v-else src="/static/public/conllection.png" class="wh44" mode=""></image>
|
||||
<view class="fon24 col9">收藏</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<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" v-if="daoTime!='活动已结束'">倒计时:{{daoTime}}</view>
|
||||
<view class="fon36 colf bold pbackc tc pad-sx20 radius45" v-else>{{daoTime}}</view>
|
||||
</view>
|
||||
<!-- 规格 -->
|
||||
<view class="dis tc mar-s20 fon28">
|
||||
<view class="col3 flexs" style="margin-top: 6rpx;">类型:</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="fon24 colB3">{{detailObj.param_maket_time||'今年'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="fon26 col3 mar-x20">有效期</view>
|
||||
<view class="fon24 colB3">{{detailObj.param_validity_time||'永久'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="fon26 col3 mar-x20">可用时间</view>
|
||||
<view class="fon24 colB3">{{detailObj.param_use_time||'长期'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="fon26 col3 mar-x20">术前须知</view>
|
||||
<view class="fon24 colB3">{{detailObj.param_notice||'无'}}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 销量,库存 -->
|
||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<view class="fon28 disjbac">
|
||||
<view class="col3">销量:</view>
|
||||
<view class="colB3">已售{{detailObj.amount}}件</view>
|
||||
</view>
|
||||
<view class="fon28 disjbac mar-s40">
|
||||
<view class="col3">库存:</view>
|
||||
<view class="colB3">剩余{{detailObj.stock}}件</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 拼团 -->
|
||||
<view v-if="isNei==1 && len!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<view class="fon28 col3">{{len}}人正在拼团,可以直接参与</view>
|
||||
<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-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">
|
||||
<image :src="itemt.imgSrc" mode="aspectFill" class="flexs big-img"></image>
|
||||
<view class="disjbac width100 mar-z20 pad-sx20">
|
||||
<view class="fon28 col3 width45">{{itemt.name}}</view>
|
||||
<view class="fon28 disjbac width100 col7D">
|
||||
<view class="flexs">
|
||||
<view>还差{{itemt.num}}人拼成</view>
|
||||
<view style="margin-top: 7rpx;">{{itemt.time_text}}</view>
|
||||
</view>
|
||||
<view @tap="comeTuan(itemt.id,index,indext)" class="colf bold flexs">去拼单</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 短线 -->
|
||||
<view class="duan-xian"></view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 去拼单弹框 -->
|
||||
<!-- <view v-if="showPD" class="pd-tk-box" @tap.stop="showPD=false"> -->
|
||||
<view v-if="showPD" class="pd-tk-box">
|
||||
<view class="bacf radius20 width100 posir">
|
||||
<view class="fon28 col3">参与{{pinInfo.name}}的拼单</view>
|
||||
<view class="fon24 col3">仅剩{{pinInfo.num}}个名额,{{pinDao}}后结束</view>
|
||||
<view class="disjcac">
|
||||
<image :src="pinInfo.imgSrc" mode="aspectFill"></image>
|
||||
<image src="/static/public/pin-jie.png" mode=""></image>
|
||||
<image src="/static/public/weiz.png" mode=""></image>
|
||||
</view>
|
||||
<view @tap="atOnceSpellOrder(1)">参与拼单</view>
|
||||
<image @tap="atOnceSpellOrder(0)" src="/static/public/pin-close.png" class="posia" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<view class="fon28 col3 bold">产品详情</view>
|
||||
<view class="fon28 mar-s20" style="color: #1A1A1A; line-height: 40rpx;">
|
||||
<rich-text :nodes="detailInfo"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 医生 -->
|
||||
<view v-if="doctorList.length!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
|
||||
<view class="fon28 col3 bold">医生</view>
|
||||
<!-- <view @tap="goDoctor(item.id)" v-for="(item,index) in doctorList" :key="index" class="disjbac posir pad-sx20">
|
||||
<image :src="item.imgSrc" mode="aspectFill" class="flexs big-img"></image>
|
||||
<view class="disjbac width100 mar-z20 pad-sx20">
|
||||
<view class="fon28 col3 width50">{{item.name}}</view>
|
||||
<view class="fon24 width50 col7D">擅长:{{item.goodAt}}</view>
|
||||
</view>
|
||||
<view v-if="(doctorList.length-1)!=index" class="duan-xian"></view>
|
||||
</view> -->
|
||||
<!-- 推荐医生列表 -->
|
||||
<list-doctor v-if="doctorList.length!=0" :list="doctorList"></list-doctor>
|
||||
<view v-if="doctorList.length==0" class="disjcac fc" style="margin-top: 10%;">
|
||||
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
|
||||
<!-- <view class="fon24 col3">暂无推荐医生</view> -->
|
||||
</view>
|
||||
</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>
|
||||
</view>
|
||||
<view v-if="cateCurrent!=isNum">
|
||||
<view v-if="allList.length!=0" class="pad-zy20">
|
||||
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="allList"></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 class="posixzy disjbac bacf pad-zy32 btnBKS">
|
||||
<view class="posir">
|
||||
<image @tap="backHome" class="posia backH" src="/static/public/back-home-02.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="disac fon26 colf">
|
||||
<view @tap="showTK = true" class="disjcac lianShare addCart-btn"><span v-if="isNei!=1">加入购物车</span><span v-else>单独购买</span></view>
|
||||
<view @tap="showTK = true" class="disjcac lianShare mai-btn"><span v-if="isNei!=1">立即购买</span><span v-else>发起拼团</span></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 购物车 -->
|
||||
<view @tap="goShopCart" class="detail-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>
|
||||
<!-- 客服 -->
|
||||
<view @tap="lianK" class="shopKf">
|
||||
<view class="posir">
|
||||
<image src="/static/public/kf-logo.png" mode="aspectFill" style="width: 142rpx;height: 142rpx;"></image>
|
||||
<button v-if="haveImg" open-type="contact" class="posia-op"></button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 立即购买,加入购物车弹框 -->
|
||||
<view v-if="showTK" class="posAll" style="z-index: 1000;" @tap="showTK=false">
|
||||
<view class="bacf posixzy bottom-popu" @tap.stop="showTK=true">
|
||||
<view class="disjb pad-zy50">
|
||||
<image :src="zhuImg" mode="aspectFill"></image>
|
||||
<view class="disjbac width100">
|
||||
<view v-if="isNei!=3">
|
||||
<view class="fon40 mar-sx10 colf8">¥{{skuDetail.price/100}}</view>
|
||||
<!-- <view v-if="isNei!=10"><span class="yuan-price">¥{{skuDetail.original_price/100}}</span></view> -->
|
||||
<view><span class="yuan-price">¥{{skuDetail.original_price/100}}</span></view>
|
||||
</view>
|
||||
<view v-else><view class="fon40 mar-sx10 colf8">积分:{{skuDetail.score}}</view></view>
|
||||
<image @tap.stop="showTK=false" src="/static/public/cha-close.png" style="margin-right: 0rpx;" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标题 -->
|
||||
<view class="fon36 col3 bold clips3 pad-zy30 mar-s20 shop-title-box line-h50">
|
||||
<view style="margin-top: -8rpx;margin-right: 10rpx;">
|
||||
<span class="radius15 colf fon20" :style="{background:publicColor}">{{detailObj.disease_name}}</span>
|
||||
<span class="radius15 colf fon20 mar-z10" v-if="isNei==0">团购</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>
|
||||
</view>
|
||||
<span>{{detailObj.name}}</span>
|
||||
</view>
|
||||
<view class="dis mar-sx40 pad-zy30 col3">
|
||||
<view class="fon28 flexs" style="margin-top: 6rpx;">类型:</view>
|
||||
<view class="fon26 disac fw width100" style="justify-content: flex-end;">
|
||||
<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 class="disjbac mar-sx40 pad-zy30 fon28">
|
||||
<view class="col3">库存:</view>
|
||||
<view class="fon26 col3" style="color: #5B5B5B;">{{skuDetail.stock}}件</view>
|
||||
</view>
|
||||
<view class="disjbac mar-sx40 pad-zy30 fon28">
|
||||
<view class="col3">购买数量:</view>
|
||||
<view class="fon26 col3 disac bold">
|
||||
<image @tap="buyNum!=1?buyNum--:''" src="/static/public/del.png" class="del-btn" mode=""></image>
|
||||
<input type="text" @input="inputNum" v-model="buyNum" class="num-input"/>
|
||||
<image @tap="buyNum++" src="/static/public/add.png" class="add-btn" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 加入购物车,立即购买 -->
|
||||
<view v-if="isNei!=1" class="disjbac pad-zy30 colf fon32 mar-x50">
|
||||
<view @tap="addCart" class="ev-btn pbackc">加入购物车</view>
|
||||
<view v-if="isNei!=3" @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">立即购买</view>
|
||||
<view v-else @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">立即兑换</view>
|
||||
</view>
|
||||
<!-- 单独购买,立即拼团 -->
|
||||
<view v-else class="disjbac pad-zy30 colf fon32 mar-x50">
|
||||
<view @tap.stop="goGetReadyDan(2)" class="ev-btn" style="background: #C8C8C8;">单独购买</view>
|
||||
<view @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">发起拼团</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listDoctor from '@/components/list-doctor.vue';
|
||||
import swiperPu from '@/components/swiper-pu.vue';
|
||||
import {cancleCollectionShopEV,collectionShopEV} from '@/jsFile/publicAPI.js';
|
||||
import shopList from '@/components/shop-list.vue';
|
||||
export default {
|
||||
components:{
|
||||
listDoctor,
|
||||
swiperPu,
|
||||
shopList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
|
||||
isLoading:false,
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor') || '#3875F6',//主题颜色
|
||||
cateCurrent:0,
|
||||
swiperHeight:uni.getSystemInfoSync().windowWidth,
|
||||
haveImg:true,
|
||||
cateList:[{
|
||||
id:1,
|
||||
title:'商品详情',
|
||||
pid:11,
|
||||
sort:4
|
||||
}],
|
||||
bannerList:[],//轮播
|
||||
//相关推荐
|
||||
xgList:[],
|
||||
//产品推荐
|
||||
dataList:[],
|
||||
showTop:false,
|
||||
isDetailConllection:false,//是否已收藏
|
||||
isNum:0,
|
||||
listArrone:[],//问题
|
||||
//案例日记
|
||||
listArrtwo:[],
|
||||
//效果模拟
|
||||
listArrthree:[],
|
||||
//科普视频
|
||||
listArrfour:[],
|
||||
//医生列表
|
||||
doctorList:[],
|
||||
detailObj:{},//详情
|
||||
detailInfo:'',//富文本
|
||||
category_id:'',//栏目ID
|
||||
active:'',//是否是详情页
|
||||
share_id:0,
|
||||
invite_code:'',
|
||||
showTK:false,
|
||||
leiIndex:0,
|
||||
showPD:false,
|
||||
isNei:'',//什么类型的商品
|
||||
pingArr:[],//拼团列表
|
||||
len:0,//正在拼团人数
|
||||
pinInfo:{},//拼单人信息
|
||||
allRes:{},//所有订单信息
|
||||
zhuImg:'',//cover图
|
||||
skuDetail:{},//sku详情
|
||||
buyNum:1,//购买数量
|
||||
daoTime:'',//储存倒计时
|
||||
csNum:0,//点击次数,
|
||||
isBuy:0,//
|
||||
ispt:0,//拼团的方式0默认发起拼团,1参与平台 2单独购买
|
||||
isScore:0,//是否是积分
|
||||
cartNum:0,
|
||||
skuCate:[],//类型
|
||||
pinDao:'',//平团倒计时
|
||||
serverTime:'',//服务器时间
|
||||
timerServer:null,
|
||||
timerp:null,
|
||||
timera:null,
|
||||
pinUserId:0,//发起拼单人ID
|
||||
isAutoPlay:false,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
page:1,
|
||||
size:20,
|
||||
total:0,
|
||||
isZanw:true,
|
||||
allList:[],
|
||||
isactivity:0,//是不是活动商品0:不是,1:是
|
||||
orderId:'',//商品id
|
||||
timeout:null,
|
||||
}
|
||||
},
|
||||
onReachBottom() { //触底事件
|
||||
if(this.cateCurrent!=this.isNum){
|
||||
if(this.total!=this.allList.length){
|
||||
this.page++
|
||||
this.checkList(this.cateCurrent)//调用自主预约列表事件
|
||||
} else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
||||
this.isZanw = false
|
||||
}
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var ya = this;
|
||||
this.$requst.post('user/record',{type:this.detailObj.is_activity==0 ? 'spu':'activity',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
|
||||
let maiOjb = {
|
||||
e:this.detailObj.is_activity==0 ? 10 : 11,//商品分享(10普通商品,11活动商品)
|
||||
c: this.detailObj.is_activity==0 ? this.detailObj.id*1 : this.detailObj.activity_id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
if(ya.detailObj.share_img==null) ya.detailObj.share_img = ya.detailObj.cover;
|
||||
var shareObj = {
|
||||
title: `${ya.detailObj.name}`, // 默认是小程序的名称(可以写slogan等)
|
||||
path: `/pagesB/shopDetail/shopDetail?id=${this.detailObj.is_activity==1?this.detailObj.activity_id:this.detailObj.id}&category_id=${this.category_id}&is_activity=${this.detailObj.is_activity==0 ? 0 : 1}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
imageUrl: ya.$http + ya.detailObj.share_img//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('chooseAddress');
|
||||
this.isAutoPlay = true;
|
||||
},
|
||||
onHide() {
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timera);
|
||||
clearInterval(this.timerp);
|
||||
clearInterval(this.timerServer);
|
||||
this.isAutoPlay = false;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){
|
||||
this.vision = true;
|
||||
this.loginEv(options);
|
||||
} else {
|
||||
this.checkDetail(options.id,options.is_activity);
|
||||
this.cartNumEv();
|
||||
//查询过期时间和是否有token,并调用登录事件
|
||||
this.$toolAll.tools.overdue();
|
||||
}
|
||||
if(options.category_id!=undefined) {
|
||||
this.category_id = options.category_id
|
||||
this.invite_code = options.invite_code
|
||||
}
|
||||
if(options.share_id!=undefined) this.share_id = options.share_id
|
||||
if(options.isIntegral=="true"){this.isScore = 3;}
|
||||
this.isactivity = options.is_activity;
|
||||
this.orderId = options.id;
|
||||
// 如果链接是拼团链接,则调起发起拼团人的商品
|
||||
if(options.shareCate==1) {
|
||||
// options.checkGrounpI商品id
|
||||
// options.share_id:拼团人id
|
||||
this.sharePin(options.checkGrounpId,options.share_id);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 数量输入事件
|
||||
inputNum(e){
|
||||
clearTimeout(this.timeout);
|
||||
let str = e.detail.value;
|
||||
this.timeout = setTimeout(()=>{
|
||||
if(str=='' || str==0){
|
||||
this.buyNum = 1;
|
||||
}
|
||||
},500)
|
||||
},
|
||||
sharePin(id,u_id){
|
||||
// id:商品id
|
||||
this.$requst.post('spu/group-list',{id:id}).then(res=>{
|
||||
if(res.code==0){
|
||||
if(res.data.length){
|
||||
res.data.forEach(item=>{
|
||||
console.log(item.id,u_id);
|
||||
if(item.id==u_id){
|
||||
this.pinInfo = {
|
||||
id:item.id,
|
||||
imgSrc:item.cover,
|
||||
name:item.name,
|
||||
num:item.num
|
||||
}
|
||||
this.showPD = true;
|
||||
this.detailPTime(item.time);
|
||||
}
|
||||
})
|
||||
}
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
})
|
||||
},
|
||||
loginEv(options){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:options.invite_code || '',//用户邀请码
|
||||
source_code:options.source_code || '',
|
||||
channel:options.channel || ''
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false;
|
||||
this.isShowP = true;
|
||||
this.checkDetail(this.orderId,this.isactivity);
|
||||
}
|
||||
},
|
||||
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){//查询正在拼团的人数
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/group-list`,
|
||||
data:{id:id},
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
let ntime = new Date(res.header.Date).getTime();//服务器时间
|
||||
this.timerServer = setInterval(()=>{
|
||||
ntime = ntime + 1000
|
||||
this.serverTime = new Date(ntime);
|
||||
},1000);
|
||||
if(res.data.data.length!=0){
|
||||
res.data.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;
|
||||
// {id:1,imgSrc:'/static/tabbar/mya.png',title:'【99皮皮节】【种植发际线】',price:3888,num:1,isActive:false},
|
||||
let nprice = '';
|
||||
if(this.isNei==3) {
|
||||
nprice = this.skuDetail.score;
|
||||
} else nprice = this.skuDetail.price/100;
|
||||
this.ispt = index;
|
||||
if(index==2){nprice = this.skuDetail.original_price/100;}
|
||||
let params = {
|
||||
id:this.detailObj.spu_id,
|
||||
imgSrc:this.$http + this.detailObj.cover,
|
||||
coding:this.skuDetail.coding,
|
||||
price:nprice,
|
||||
num:this.buyNum || 1,
|
||||
title:this.detailObj.name,
|
||||
sku_name:this.skuDetail.title,
|
||||
is_score:this.detailObj.is_score,
|
||||
group_id:this.ispt,//0发起拼团 1参与拼团 2单独购买
|
||||
is_only:this.ispt,
|
||||
pin_user_id:this.pinUserId,//发起拼单人ID
|
||||
category_id:this.category_id,//病种ID
|
||||
cateNum:this.isNei,
|
||||
checkGrounpId:this.detailObj.id,//查询拼团列表ID
|
||||
|
||||
}
|
||||
let newList = [params];
|
||||
uni.setStorageSync('orderList',newList);
|
||||
uni.navigateTo({
|
||||
url:`/pagesA/getReadyDan/getReadyDan?isNei=${this.isNei}&isVirtual=${this.detailObj.spu_type}`
|
||||
})
|
||||
},
|
||||
addCart(){//添加购物车事件
|
||||
if(this.csNum==0){
|
||||
this.csNum++;
|
||||
this.$toolAll.tools.showToast('正在加入购物车...');
|
||||
this.$requst.post('order/shopping-cart-add',{sku_id:this.skuDetail.id,num:this.buyNum}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.showTK = false;
|
||||
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
|
||||
this.cartNumEv();
|
||||
this.csNum = 0;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
comeTuan(pinId,index,index2){//去拼单
|
||||
this.showPD = true;
|
||||
this.pinInfo = this.pingArr[index][index2];
|
||||
this.pinDao = this.$toolAll.tools.dayTime(this.pinInfo.time,this.serverTime);
|
||||
this.timerp = setInterval(()=>{
|
||||
if((new Date(this.pinInfo.time).getTime()) - (new Date(this.serverTime).getTime())<=0){
|
||||
this.pinDao = '已结束';
|
||||
this.checkPTList(this.detailObj.id);
|
||||
this.showPD = false;
|
||||
clearInterval(this.timerp);
|
||||
} else {
|
||||
this.pinDao = this.$toolAll.tools.dayTime(this.pinInfo.time,this.serverTime);
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
detailPTime(endtime){
|
||||
this.pinDao = this.$toolAll.tools.dayTime(endtime,new Date());
|
||||
this.timerp = setInterval(()=>{
|
||||
if((new Date(endtime).getTime()) - (new Date().getTime())<=0){
|
||||
this.pinDao = '已结束';
|
||||
this.checkPTList(this.detailObj.id);
|
||||
this.showPD = false;
|
||||
clearInterval(this.timerp);
|
||||
} else {
|
||||
this.pinDao = this.$toolAll.tools.dayTime(endtime,new Date());
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
atOnceSpellOrder(index){//参与拼单
|
||||
if(index==1){
|
||||
this.showTK = true;
|
||||
this.pinUserId = this.pinInfo.id;
|
||||
}
|
||||
this.showPD = false;
|
||||
clearInterval(this.timerp);
|
||||
this.daoTime = '';
|
||||
},
|
||||
chooselei(index){//类型选择
|
||||
this.leiIndex = index;
|
||||
this.skuDetail = this.allRes.sku[index];
|
||||
},
|
||||
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:this.detailObj.is_activity==0 ? 13:14,//商品咨询(13普通商品,14活动商品)
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
}
|
||||
// } else this.jieDuan = true
|
||||
// }
|
||||
},
|
||||
chooseLike(e) { //收藏事件
|
||||
// console.log(this.dataList[e].is_collected);
|
||||
if (this.allList[e].is_collected == 0) {
|
||||
this.allList[e].is_collected = 1
|
||||
// 调用收藏事件
|
||||
collectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.allList[e].id
|
||||
})
|
||||
}
|
||||
},
|
||||
comfirmev(e) { //确认取消收藏事件
|
||||
this.allList[e].is_collected = 0;
|
||||
this.$toolAll.tools.showToast('正在取消...', 'loading')
|
||||
// 调用取消收藏事件
|
||||
cancleCollectionEV({
|
||||
action: 'collect',
|
||||
archive_id: this.allList[e].id
|
||||
})
|
||||
},
|
||||
backHome(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/tabbar/pagehome/pagehome'
|
||||
})
|
||||
},
|
||||
shareEv(){
|
||||
if(this.haveImg == false) {
|
||||
this.vision = true
|
||||
}
|
||||
},
|
||||
checkDetail(newId,is_activity){
|
||||
console.log(newId,is_activity,'参数');
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/detail`,
|
||||
data:{id:newId,is_activity:is_activity},
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res,'结果');
|
||||
if(res.data.code==0){
|
||||
this.allRes = res.data.data;
|
||||
this.zhuImg = this.$http + res.data.data.detail.cover;
|
||||
// 默认显示的sku
|
||||
if(res.data.data.sku.length!=0){
|
||||
res.data.data.sku.forEach(item=>{
|
||||
if(item.is_default==1) {
|
||||
this.skuDetail = item;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.isLoading = true;
|
||||
// 栏目类别
|
||||
if(res.data.data.category.length!=0){
|
||||
res.data.data.category.forEach((item,index)=>{
|
||||
let cateObj = {
|
||||
id:item.id,//栏目ID
|
||||
title:item.title,//栏目名称
|
||||
active:item.active,//是否选中
|
||||
model_id:item.model_id,//模型ID
|
||||
model_name:item.model_name,//模型标识
|
||||
sort:item.sort
|
||||
}
|
||||
this.cateList.push(cateObj)
|
||||
// 默认选中的栏目
|
||||
if(item.active==1) this.active = this.cateCurrent = index
|
||||
// 默认展示栏目详情
|
||||
if(this.category_id==item.id) this.isNum = index
|
||||
})
|
||||
}
|
||||
if(this.invite_code!='' && this.invite_code!=undefined){
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.statusHNH').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect);
|
||||
this.statusHNH = rect.height
|
||||
// console.log(this.statusHNH );
|
||||
}).exec()
|
||||
}
|
||||
// 详情
|
||||
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') {
|
||||
if(this.isScore==3) {
|
||||
this.isNei = this.isScore;
|
||||
} else this.isNei = 10;
|
||||
}
|
||||
if(res.data.data.detail.activity_end_at!=undefined){
|
||||
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 = "活动已结束";
|
||||
clearInterval(this.timera);
|
||||
} else {
|
||||
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);//初始化
|
||||
this.timera = setInterval(()=>{//倒计时赋值
|
||||
startTime = startTime + 1000;
|
||||
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
let maiOjb = {
|
||||
e:this.detailObj.is_activity==0 ? 8 : 9,//商品访问(8普通,9活动)
|
||||
c: this.detailObj.is_activity==0 ? this.detailObj.id*1 : this.detailObj.activity_id,
|
||||
t:new Date().getTime()//当前时间戳
|
||||
}
|
||||
this.$toolAll.tools.maiDian(maiOjb)
|
||||
// 轮播
|
||||
// 图片字符串转数组
|
||||
let arrImg = this.detailObj.images.split(',')
|
||||
arrImg.forEach(item=>{
|
||||
let newImgObj = {
|
||||
imgSrc:this.$http + item,
|
||||
url:'',
|
||||
isVideo:false,
|
||||
poster:'',
|
||||
}
|
||||
// 存图片
|
||||
this.bannerList.push(newImgObj)
|
||||
})
|
||||
// 存视频
|
||||
if(this.detailObj.video!=''){
|
||||
this.bannerList[0] = {
|
||||
imgSrc:this.$http + arrImg[0],
|
||||
url:this.$http + this.detailObj.video,
|
||||
isVideo:true,
|
||||
poster:'',
|
||||
}
|
||||
}
|
||||
// 默认显示是否收藏
|
||||
if(this.detailObj.is_collected==0) this.isDetailConllection = false
|
||||
if(this.detailObj.is_collected==1) this.isDetailConllection = true
|
||||
// 富文本
|
||||
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 != null ? item.headimg : '',
|
||||
name: item.name,
|
||||
cyear: parseFloat(item.work_time),
|
||||
bmen: item.dept_name,
|
||||
zcheng: '主任医师',
|
||||
goodAt: item.diseases,
|
||||
show_detail: item.show_detail
|
||||
}
|
||||
this.doctorList.push(docObj);
|
||||
})
|
||||
}
|
||||
// 正在平团人数
|
||||
if(this.isNei==1 && this.detailObj.activity_going.length!=0) {
|
||||
this.checkPTList(this.detailObj.id);//查询商品正在拼团列表
|
||||
}
|
||||
this.checkShopList();
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.data.msg);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
checkShopList(){// 产品推荐
|
||||
let params = {
|
||||
keyword:'',//商品关键字 支持模糊搜索
|
||||
page:1,
|
||||
size:10,
|
||||
doctor_role:'',//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||
doctor_name:'',//医生姓名 模糊搜索
|
||||
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||
disease_id:''//病种ID
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}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,//已经参团人数
|
||||
activity_id:item.activity_id
|
||||
}
|
||||
this.dataList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goShopCart(){//去购物车事件
|
||||
let isScore = '';
|
||||
if(this.isNei==3) isScore = 'score';
|
||||
uni.navigateTo({
|
||||
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
|
||||
})
|
||||
},
|
||||
goDoctor(id){
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/doctorDetail/doctorDetail?doctor_id=${id}`
|
||||
})
|
||||
},
|
||||
choosecateEv(e){//分类列表事件
|
||||
this.$requst.post('archives/category', {
|
||||
category_id: this.cateList[e].id,
|
||||
keyword: '',
|
||||
page:this.page,
|
||||
size:this.size
|
||||
}).then(res => {
|
||||
// console.log('该分类下的列表:',res);
|
||||
if (res.code == 0) {
|
||||
if(this.page==1) {
|
||||
if(this.active != e) this.allList = [];
|
||||
uni.pageScrollTo({
|
||||
scrollTop:0,
|
||||
duration:0
|
||||
})
|
||||
}
|
||||
this.total = res.data.list.total;
|
||||
if (res.data.list.list.length != 0) {
|
||||
res.data.list.list.forEach(item => {
|
||||
let num = item.video.search(".mp4")
|
||||
let isVideo = false
|
||||
if (num != '-1') isVideo = true
|
||||
let fabImg = '';
|
||||
if (item.published_headimgurl != '' && item.published_headimgurl != null)
|
||||
fabImg = this.$http + item.published_headimgurl
|
||||
let arrObj = {
|
||||
category_id: item.category_id, //栏目ID
|
||||
id: item.id,
|
||||
is_collected: item.is_collected, //是否已收藏
|
||||
collects: item.collects, //收藏量
|
||||
views: item.views, //查看量
|
||||
main_img: this.$http + item.cover, //封面图
|
||||
video: this.$http + item.video, //视频地址
|
||||
title: item.title, //标题
|
||||
content: item.subtitle, //副标题
|
||||
head_img: fabImg || '/static/public/logo.png', //发布者头像
|
||||
name: item.published_by || '恒美植发', //发布者昵称
|
||||
isVideo: isVideo //是否是视频
|
||||
}
|
||||
if (item.cover != '') {
|
||||
this.allList.push(arrObj);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.cateCurrent = e;
|
||||
} else this.$toolAll.tools.showToast(res.msg);
|
||||
}, error => {})
|
||||
},
|
||||
tapConllection(){//收藏、取消收藏事件
|
||||
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:nid})
|
||||
// 调用取消收藏事件
|
||||
else cancleCollectionShopEV({action:isLikeCon,id:nid})
|
||||
this.isDetailConllection = !this.isDetailConllection
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,438 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 状态栏 -->
|
||||
<status-nav :titleVal="'商品搜索'" :statusTitle="true"></status-nav>
|
||||
<!-- 输入框 -->
|
||||
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHNH+'px'}">
|
||||
<view class="disac pad-zy30 mar-s20">
|
||||
<!-- 输入框 -->
|
||||
<input @confirm="checkShopList" 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="checkShopList" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
|
||||
</view>
|
||||
<!-- 筛选结果 -->
|
||||
<view v-if="search_result" class="pad-z20 pad-x20">
|
||||
<view class="col3 fon28 mar-s30">搜索结果:</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 数据列表 -->
|
||||
<view v-if="search_result" :style="{marginTop:statusHNH+titleHeight+10+45+'px'}">
|
||||
<view v-if="dataList.length!=0" style="margin-top: -20rpx;">
|
||||
<view class="pad20">
|
||||
<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 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="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.isXian || item1.isPing || item1.isTuan" 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 || item1.isPing || item1.isTuan" 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 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="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 || item1.isPing || item1.isTuan" 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>
|
||||
<nothing-page v-if="dataList.length==0" :content="`暂无更多商品列表`"></nothing-page>
|
||||
</view>
|
||||
<!-- 历史搜索和热门搜索 -->
|
||||
<view v-if="!search_result" class="pad-z30 mar-s30" :style="{marginTop:statusHNH+titleHeight+10+'px'}">
|
||||
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
|
||||
</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>
|
||||
<!-- 弹框 -->
|
||||
<pu-po :isShowT="isShowT" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
|
||||
<!-- 返回顶部 -->
|
||||
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {cartNum} from '@/jsFile/publicAPI.js';
|
||||
import cateTu from '@/components/cate-items/cate-tu.vue';
|
||||
export default {
|
||||
components:{
|
||||
cateTu
|
||||
},
|
||||
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,//是否显示弹框
|
||||
showTop:false,//是否显示返回顶部
|
||||
newCurrent:0,
|
||||
page:1,
|
||||
size:200,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
activeIndex:'-1',
|
||||
shopCate:['全部病种','全部医生','全部活动'],
|
||||
cateTitle:'',
|
||||
bingzList:[],//小分类列表
|
||||
zanBingArr:[],//暂存小分类
|
||||
titleHeight:'',//标题高度
|
||||
shaiList:[],//筛选后的结果列表
|
||||
dataList:[],
|
||||
searchVal:'',//关键词
|
||||
doctor_role:'',//医生从职位标识 从商品筛选条件接口获取 目前为doctor=医生 design=设计师
|
||||
doctor_name:'',//医生姓名 模糊搜索
|
||||
activity:'',//活动类型 不填为普通商品+活动商品 normal=普通商品;group_make=拼团;group_buy=团购;limit_time=限时促销
|
||||
disease_id:'',//病种ID
|
||||
cartNum:0,
|
||||
search_result:false,
|
||||
timeList:[],
|
||||
zanArr:[],
|
||||
timer:'',
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
||||
},
|
||||
onReachBottom() {//触底事件
|
||||
// if(this.total!=this.dataList.length){
|
||||
// this.page++
|
||||
// this.checkShopList();
|
||||
// } else {
|
||||
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000);
|
||||
setTimeout(()=>{
|
||||
this.isZanw = true;
|
||||
},10000)
|
||||
// }
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/shopSearch/shopSearch?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(options.keyWorld!=undefined && options.keyWorld!='') {
|
||||
this.searchVal = options.keyWorld;
|
||||
this.checkShopList();
|
||||
} else {
|
||||
this.search_result = false;
|
||||
}
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkSearchHistory();
|
||||
this.checkKey();
|
||||
// 缓存状态栏+标题栏的高度
|
||||
const query = wx.createSelectorQuery()
|
||||
query.select('.search-input-box').boundingClientRect((rect) => {
|
||||
// console.log('状态栏+标题栏:',rect.height);
|
||||
this.titleHeight = rect.height
|
||||
}).exec()
|
||||
},
|
||||
onShow() {
|
||||
this.$toolAll.tools.isLogin()
|
||||
if(this.searchVal!=undefined && this.searchVal!='') this.checkShopList();
|
||||
this.cartNumEv();//查询购物车数量
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
cartNumEv(){//购物车数量
|
||||
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
|
||||
if(res.code==0){
|
||||
this.cartNum = res.data.count;
|
||||
}
|
||||
})
|
||||
},
|
||||
checkShopList(){
|
||||
this.isZanw = true;
|
||||
let params = {
|
||||
keyword:this.searchVal,//商品关键字 支持模糊搜索
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
}
|
||||
uni.request({
|
||||
url:`${getApp().globalData.domainName}spu/list`,
|
||||
data:params,
|
||||
method:'post',
|
||||
header:{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
|
||||
},
|
||||
success: (res) => {
|
||||
if(res.data.code==0){
|
||||
clearInterval(this.timer);
|
||||
// if(this.page==1) {
|
||||
this.zanArr = [];
|
||||
this.dataList = [];
|
||||
this.timeList = [];
|
||||
// }
|
||||
this.total = res.data.total;
|
||||
if(res.data.data.list.length!=0){
|
||||
res.data.data.list.forEach(item=>{
|
||||
let tuan = false,ping = false,xian = false,integral = false;
|
||||
if(item.activity_type=='group_make') ping = true;
|
||||
if(item.activity_type=='group_buy') tuan = true;
|
||||
if(item.activity_type=='limit_time') xian = true;
|
||||
let group_cover = [];
|
||||
if(item.activity_group_cover.length!=0) {
|
||||
item.activity_group_cover.forEach(item=>{
|
||||
group_cover.push(this.$http + item)
|
||||
})
|
||||
}
|
||||
let obj = {
|
||||
id:item.id,
|
||||
imgSrc: this.$http + item.cover,
|
||||
title: item.name,
|
||||
zhePrice:item.price/100,
|
||||
yuanPrice:item.original_price/100,
|
||||
integral:'',
|
||||
isTuan:tuan,//是否是团购
|
||||
isPing:ping,//是否是拼团活动
|
||||
isXian:xian,//是否是限时活动
|
||||
isIntegral:integral,//是否是积分
|
||||
grade:'',
|
||||
disease_name:item.disease_name,//病种名称
|
||||
reponseTime:res.header.Date,//接口响应时间
|
||||
activity_end_at:item.activity_end_at,//限时结束时间
|
||||
activity_group_cover:group_cover,//参团人的头像
|
||||
activity_group_num:item.activity_group_num,//已经参团人数
|
||||
}
|
||||
this.zanArr.push(obj)
|
||||
})
|
||||
this.zanArr.forEach((item,index)=>{
|
||||
if(item.activity_end_at!='') {
|
||||
let obj = {
|
||||
id:item.id,
|
||||
reponseTime:item.reponseTime,
|
||||
time:item.activity_end_at,
|
||||
nIndex:index
|
||||
}
|
||||
this.timeList.push(obj);
|
||||
}
|
||||
})
|
||||
if(this.timeList!=0){
|
||||
this.$toolAll.tools.showToast('加载中...')
|
||||
this.timer = setInterval(()=>{//定时器
|
||||
if(this.timeList.length!=0){
|
||||
this.timeList.forEach((item,index)=>{
|
||||
if(item.id==this.zanArr[item.nIndex].id){
|
||||
let endTime = new Date(this.timeList[index].time).getTime();//把结束时间转时间戳
|
||||
this.timeList[index].reponseTime = new Date(this.timeList[index].reponseTime).getTime() + 1000;//请求接口的时间递增,即:开始时间
|
||||
if(this.timeList[index].reponseTime - endTime >=0) {//如果开始时间的时间戳 - 结束时间的时间戳 >= 0 活动结束
|
||||
this.zanArr[item.nIndex].activity_end_at = "活动已结束";
|
||||
} else {
|
||||
// 继续进行倒计时
|
||||
this.zanArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
setTimeout(()=>{
|
||||
this.dataList = this.zanArr;
|
||||
this.search_result = true;
|
||||
},1000)
|
||||
} else {
|
||||
this.dataList = this.zanArr;
|
||||
}
|
||||
} else {
|
||||
this.search_result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goPage(id,index){//进入商品详情事件
|
||||
uni.navigateTo({
|
||||
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
|
||||
})
|
||||
},
|
||||
checkKey(){//查询热搜关键词事件
|
||||
this.$requst.get('index/hot-keywords',{type:'spu'}).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:1,size:100}).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=>{})
|
||||
},
|
||||
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
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,177 @@
|
|||
<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 @tap="chooseId(item.id)" v-if="item.name!=null" class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
|
||||
<view style="color: #B3B3B3;" class="disjbac">{{item.time}} <view>{{item.mobile}}</view></view>
|
||||
<view class="mar-s20">
|
||||
<text class="bold col3">{{item.name}}</text>
|
||||
<text style="color: #B3B3B3;">{{item.action}}</text>
|
||||
<text class="bold col3" v-if="item.title!=null && item.title!=''">【{{item.title}}】</text>
|
||||
<text style="color: #B3B3B3;" v-if="item.zwhat!=null && item.zwhat!=''">{{item.zwhat}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="dataList.length==0 && keyword!=''" 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>
|
||||
<!-- 弹框授权 -->
|
||||
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
|
||||
<!-- 弹框 -->
|
||||
<auth-phone v-if="isShowP"></auth-phone>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
||||
dataList:[],//数据列表
|
||||
showTop:false,//是否显示返回顶部的箭头
|
||||
customer_id:'',//客户ID
|
||||
keyword:'',//关键词
|
||||
page:1,
|
||||
size:10,
|
||||
total:'',//总数
|
||||
isZanw:true,
|
||||
vision:false,
|
||||
isShowP:false,
|
||||
}
|
||||
},
|
||||
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()
|
||||
},
|
||||
onShareAppMessage() {
|
||||
var shareObj = {
|
||||
path: `/pagesB/userFootprint/userFootprint?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||||
};
|
||||
return shareObj;
|
||||
},
|
||||
onLoad(options) {
|
||||
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
|
||||
if(options.invite_code!='' && options.invite_code!=undefined){
|
||||
this.loginEv(options.invite_code);
|
||||
} else if(options.source_code!='' && options.source_code!=undefined){
|
||||
this.loginEv('',options.source_code,options.channel);
|
||||
}
|
||||
this.checkList()
|
||||
},
|
||||
methods: {
|
||||
loginEv(invite_code='',source='',channel=''){
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (res)=> {
|
||||
var params = {
|
||||
code:res.code,
|
||||
invite_code:invite_code,//用户邀请码
|
||||
source_code:source,
|
||||
channel:channel
|
||||
}
|
||||
this.$requst.post('user/login',params).then(res => {
|
||||
if(res.data.token!=''){
|
||||
if(res.data.is_active==0) {
|
||||
this.haveImg = false;
|
||||
this.vision = true;
|
||||
}
|
||||
}
|
||||
},error => {})
|
||||
},
|
||||
});
|
||||
},
|
||||
buttonH(e){//授权成功
|
||||
this.haveImg = e
|
||||
if(e) {
|
||||
this.vision = false
|
||||
this.isShowP = true
|
||||
}
|
||||
},
|
||||
chooseId(id){
|
||||
this.backTop()
|
||||
this.page = 1
|
||||
this.isZanw = true
|
||||
this.customer_id = id
|
||||
this.keyword = ''
|
||||
this.checkList()
|
||||
},
|
||||
searchEv(){//搜索事件
|
||||
if(this.keyword!='') this.customer_id = ''
|
||||
this.page = 1
|
||||
this.isZanw = true
|
||||
this.checkList()
|
||||
},
|
||||
checkList(){//查询列表事件
|
||||
let params = {
|
||||
page:this.page,
|
||||
size:this.size,
|
||||
customer_id:this.customer_id,//客户ID
|
||||
keyword:this.keyword,
|
||||
// user_id:uni.getStorageSync('userId')
|
||||
}
|
||||
this.$requst.post('user/footmarks',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 newCate = ''
|
||||
if(item.content_id > 0) newCate = item.category
|
||||
else newCate = ''
|
||||
let obj = {
|
||||
id:item.account_id,
|
||||
name:item.nickname,
|
||||
action:item.action,
|
||||
title:item.title,
|
||||
time:item.created_at,
|
||||
zwhat:newCate,
|
||||
mobile:item.mobile
|
||||
}
|
||||
this.dataList.push(obj)
|
||||
})
|
||||
}
|
||||
}
|
||||
},error=>{})
|
||||
},
|
||||
backTop(){//回到顶部事件
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
|
@ -0,0 +1,64 @@
|
|||
<template>
|
||||
<div style="width:100%;overflow-x:hidden;">
|
||||
<image class="" @tap="backEv" :style="{top:statusHNH/2+'px'}" src="/static/public/videoBack.png" style="width: 33rpx;height: 33rpx;position: fixed;z-index: 10;left: 20rpx;" mode="aspectFill"></image>
|
||||
<video id="myVideo" style="width: 100%;" :style="{height:newHeight+'px'}" autoplay="true"
|
||||
:src="videoSrc" :enable-play-gesture="dans" :poster="posterSrc"
|
||||
:controls="isControls" :show-center-play-btn="isCenterImg" :show-play-btn="isBottomImg" :show-fullscreen-btn="isFull"
|
||||
@play="comePlay" @pause="comePause"></video>
|
||||
<!-- 封面图 -->
|
||||
<image v-if="isPlayImg" @tap="playEv" src="/static/public/video.png" style="position: fixed;top: 50%;left: 50%;
|
||||
width: 126rpx;height: 126rpx;transform: translate(-50%, -50%);" mode="aspectFill"></image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
statusHNH:uni.getStorageSync('statusHNH'),
|
||||
newHeight:uni.getSystemInfoSync().windowHeight,
|
||||
videoSrc:'',
|
||||
isPlayImg:false,
|
||||
autoplay:true,
|
||||
videoContext:'',
|
||||
title:'',//视频的标题,全屏时在顶部展示
|
||||
posterSrc:'',//视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
|
||||
isControls: false,//是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
|
||||
dans:true,//是否开启播放手势,即双击切换播放/暂停
|
||||
isCenterImg:false,//是否显示视频中间的播放按钮
|
||||
isBottomImg:true,//是否显示视频底部控制栏的播放按钮
|
||||
isFull:true//是否显示全屏按钮
|
||||
}
|
||||
},
|
||||
onReady: function (res) {
|
||||
this.videoContext = uni.createVideoContext('myVideo', this)
|
||||
},
|
||||
onLoad(options) {
|
||||
this.videoSrc = options.src
|
||||
this.posterSrc = options.posterSrc
|
||||
},
|
||||
methods:{
|
||||
backEv(){
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
},
|
||||
playEv(){
|
||||
this.isPlayImg = false;
|
||||
this.autoplay = false;
|
||||
this.videoContext.play();
|
||||
},
|
||||
comePlay(){//当开始/继续播放时触发play事件
|
||||
this.isControls = true;
|
||||
},
|
||||
comePause(){
|
||||
this.isPlayImg = true;
|
||||
this.isControls = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"description": "项目配置文件",
|
||||
"packOptions": {
|
||||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"postcss": true,
|
||||
"preloadBackgroundData": false,
|
||||
"minified": true,
|
||||
"newFeature": false,
|
||||
"coverView": true,
|
||||
"nodeModules": false,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false,
|
||||
"uglifyFileName": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"compileHotReLoad": false,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"useMultiFrameRuntime": true,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"useIsolateContext": false,
|
||||
"userConfirmedBundleSwitch": false,
|
||||
"packNpmManually": false,
|
||||
"packNpmRelationList": [],
|
||||
"minifyWXSS": true,
|
||||
"disableUseStrict": false,
|
||||
"minifyWXML": true,
|
||||
"showES6CompileOption": false,
|
||||
"useCompilerPlugins": false,
|
||||
"ignoreUploadUnusedFiles": true
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.22.0",
|
||||
"appid": "wx987dc41899f719e8",
|
||||
"projectname": "%E4%BD%A9%E4%B8%BD%E5%95%86%E5%9F%8E",
|
||||
"debugOptions": {
|
||||
"hidedInDevtools": []
|
||||
},
|
||||
"scripts": {},
|
||||
"staticServerOptions": {
|
||||
"baseURL": "",
|
||||
"servePath": ""
|
||||
},
|
||||
"isGameTourist": false,
|
||||
"condition": {
|
||||
"search": {
|
||||
"list": []
|
||||
},
|
||||
"conversation": {
|
||||
"list": []
|
||||
},
|
||||
"game": {
|
||||
"list": []
|
||||
},
|
||||
"plugin": {
|
||||
"list": []
|
||||
},
|
||||
"gamePlugin": {
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"list": []
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 383 B |
Binary file not shown.
After Width: | Height: | Size: 225 B |
Binary file not shown.
After Width: | Height: | Size: 217 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue