Commit 48ae36b3 by 前端

Merge branch 'v3.9.0' into 'master'

V3.9.0

See merge request !1
2 parents 323ac314 501732c5
Showing 393 changed files with 1595 additions and 385 deletions
## 正式版appid wx2c28337db96364d2 ## 正式版appid wx2c28337db96364d2
## 体验版appid wx24ebae5768e74138 ## 体验版appid wxc50d04ae5aa9984a
......
import api from "~/utils/request/request";
const path = "scrm.api.stoassistant";
class ActivityApi {
// 获取活动列表数据
// getActivityList(data) {
// return api.post({
// // method: `scrm.api.assistant.activity.page`,
// method: `scrm.api.assistant.activity.staff.page`,
// ...data,
// },
// false
// );
// }
// 获取活动中任务内容
getActiveTaskList(data, params) {
return api.post({
method: `stoassistant.api.mission.findStaffMissionList`,
...data,
},
false,
);
}
// 获取单个任务详情内容
getActiveTaskDetail(data) {
return api.post({
method: "stoassistant.api.mission.getMissionById",
...data,
});
}
// 获取被分享者打开分享内容数据
getTaskShareDetail(data) {
return api.post({
method: "stoassistant.api.mission.getMissionByIdAndNoSession",
...data,
});
}
// 获取申请活动已开通场景
getOpenSceneList(data) {
return api.post({
method: "scrm.api.busassistant.activity.SceneOpenStatus.stoAss",
...data,
}, true);
}
// 获取申请活动可开通的产品
getNotOpenProductsList(data) {
return api.post({
method: "scrm.api.busassistant.activity.productOpenStatus.stoAss",
...data,
});
}
// 获取我的订单数据
getActivityOrderList(data) {
return api.post({
method: `${path}.user.activity.order.list`,
...data,
});
}
// 获取活动诊断待预约安装订单数据
getActivityEndInstallOrderList(data, params) {
return api.post({
method: `${path}.user.activity.to.be.installed.list`,
...data,
},
false
);
}
// 获取我的访客数据
getActivityVisitorList(data) {
return api.post({
method: `${path}.user.activity.visitor.list`,
...data,
});
}
// 救援码扫码信息分页查询
rescuePage(data) {
return api.post({
method: `entmicro.api.drac.rescue.card.scan.record.page`,
projectName: "entmicro",
...data,
});
}
// 获取当前活动的海报
getActivityPosters(data) {
return api.post({
method: `scrm.api.assistant.crowdFunding.poster`,
...data,
});
}
// 获取活动短链接
getActivityUrl(data) {
return api.post({
method: `scrm.api.assistant.activity.poster`,
...data,
});
}
// 任务分享埋点
taskShareReport(data) {
return api.post({
method: "entmicro.api.customercollect.reportCustomerList",
...data,
});
}
/** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
*/
reportData(data = {}, operationType = 0) {
return api.post({
method: "scrm.api.busassistant.clue.report",
...data,
operationType,
operationDate: new Date().format("yyyy-MM-dd hh:mm:ss"),
});
}
// 确认安装
comfirmInstall(data) {
return api.post({
method: `scrm.api.stoassistant.user.activity.confirm.install`,
...data,
});
}
// 获取膨胀金活动
getPengZApi(data) {
return api.post({
method: `scrm.api.assistant.bulge.staff.page`,
...data,
});
}
// 获取订阅配置
getSubscribeConfigApi(data) {
return api.post({
method: `entmicro.api.system.subscribe.findActivityIdList`,
...data
})
}
// 获取定保/救援车活动列表
getSubscribeListByIdsApi(data) {
return api.post({
method: `scrm.api.assistant.activity.bulge.staff.page.byIds`,
...data
})
}
// 查询福利官
getWelfareInfo(data) {
return api.post({
method: `entmicro.api.system.subscribe.findMerchantWelfareInfo`,
...data
})
}
// 查询订阅服务
checkSubcribe(data) {
return api.post({
method: `entmicro.api.system.subscribe.getOpenedMerchant`,
...data
})
}
// 私域客户看板
praviteBoradData(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.statics`,
...data
})
}
// 私域客户群里列表
praviteGroups(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.group`,
...data
})
}
// 私域访客列表
praviteVistitor(data) {
return api.post({
method: `scrm.api.stoassistant.wechat.cloud.welfare.customerVisit`,
...data
})
}
/**
* 活动中-订单列表-上传支付凭证
*/
uploadPaymentVoucher(data) {
return api.post({
method: 'scrm.api.stoassistant.user.activity.uploadPaymentVoucher',
...data
}, true)
}
/**
* 根据活动id查询任务详情 */
getFindMissionByActiviyId(activityId) {
const {
merchantId
} = wx.$storage.get('userInfo')
return api.post({
method: 'stoassistant.api.mission.findMissionByActiviyId',
bussinessType: 3,
merchantNo: merchantId,
activityId
})
}
/** 根据订阅类型查询膨胀金活动列表(包含当前员工统计数据*/
getActivityPageBySubscribe(data) {
return api.post({
method: `scrm.api.assistant.activity.bulge.staff.page.bySubscribe`,
...data
})
}
/**获取跟进分页列表 */
getFollowData(data) {
return api.post({
method: `stoassistant.api.follow.page`,
...data
})
}
/**完成跟进 */
finishFollow(data) {
return api.post({
method: `stoassistant.api.follow.finish`,
...data
})
}
/**创建广汇续保权益登记订单 */
sendEquity(data) {
return api.post({
method: `scrm.api.stoassistant.gh.expanded.gold.activity.order.create`,
...data
})
}
/**看产值-车损权益升级-产值总览 */
merchantsOutput(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.statistics`,
...data
})
}
/**看产值-车损权益升级-产值总览当日 */
merchantsOutputToday(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.statistics.today`,
...data
})
}
/**看产值-车损权益升级-产值报表 */
merchantsOutputReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.report.forms`,
...data
})
}
/**看产值-车损权益升级-柱状图 */
merchantsHistogram(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.histogram.chart`,
...data
})
}
/**看产值-车损权益升级-趋势图 */
merchantsTrend(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.output.value.trend.chart`,
...data
})
}
/**看产值-车损权益升级-员工排行分页列表 */
merchantsStaffOutput(data) {
return api.post({
method: `scrm.api.boutiquecoupon.store.assistant.merchants.total.staff.output.value.statistics.page`,
...data
})
}
/**查询4s店商户产值总览、当日新增产值 --精品升级 */
boutiquecouponOutputValue(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.overview`,
...data
})
}
/**查询4s店商户查询员工产值排行信息--精品升级 */
boutiquecouponQueryEmployeeRankList(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryEmployeeRankList`,
...data
})
}
/**查询4s店商户查询发券量营业额统计数据--精品升级 */
boutiquecouponQueryCouponCountAndOrderMoney(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryCouponCountAndOrderMoney`,
...data
})
}
/**查询4s店商户查询营业额到店量统计数据--精品升级 */
boutiquecouponQueryOrderMoneyTotalAndToShopCount(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryOrderMoneyTotalAndToShopCount`,
...data
})
}
/**查询4s店商户日报表--精品升级 */
boutiquecouponQueryByDayReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryByDayReport`,
...data
})
}
/**查询4s店商户月报表--精品升级 */
boutiquecouponQueryByMonthReport(data) {
return api.post({
method: `scrm.api.boutiquecoupon.outputValue.queryByMonthReport`,
...data
})
}
activityStaffRank(data) {
return api.post({
method: `scrm.api.assistant.activity.staff.rank`,
...data
})
}
/*门店助手-店总版售后众筹活动相关统计*/
getActivityList(data) {
return api.post({
method: `scrm.api.assistant.activity.statics`,
...data
})
}
}
export default ActivityApi;
\ No newline at end of file \ No newline at end of file
import ActivityApi from './ActivityApi.js'
export default new ActivityApi()
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
module.exports = {
/**分页查询核销用户券 */
getBoutiquecouponList(data) {
return api.post({
method: `scrm.api.boutiquecoupon.customer.coupon.search`,
...data
})
},
/**获取商户券详情 */
getMerchantCoupon(id) {
return api.post({
method: `scrm.api.boutiquecoupon.merchantCoupon.getById`,
id
})
},
/** 获取精品礼券详情 */
getCouponDetail(id) {
return api.post({
method: 'scrm.api.boutiquecoupon.customer.coupon.detail',
id
})
},
/** 领取礼券 生成待核销码 */
getCoupon(data) {
return api.post({
method: `scrm.api.boutiquecoupon.customer.coupon.add`,
...data
})
},
/**获取园区店信息 */
getYqInfo(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.serviceMerchant.getByMerchantId',
...data
})
},
/** 精品交付单列表 */
getUserBoutiqueList(data) {
data.pageSize = 10
return api.post({
method: 'scrm.api.boutiquecoupon.goodsOrder.listMyOrder',
...data
},
true
)
},
/**扫码后根据订单号获取订单详情 */
scanGetDetailByOrderCode(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.order.detailScan',
...data
})
},
/**根据订单号获取订单详情 */
getDetailByOrderCode(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.order.detail',
...data
})
},
/**评价 */
addComment(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.orderComment.add',
...data
})
},
/**
* 门店助手精品礼券
*/
getMerchantCouponList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.merchant.coupon.list',
...data
}, true)
},
/**
* 门店助手精品礼券 核销记录
*/
getMerchantCustomerCouponList(data) {
data.pageSize = 10
return api.post({
method: 'scrm.api.boutiquecoupon.customer.coupon.search',
...data
}, true)
},
/**
* 根据门店ID获取4S店员工
*/
getMerchantEmployee(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.employee.getByMerchantId',
...data
}, true)
},
}
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
module.exports = {
/**根据商户查询商户下级列表 */
findSubordinateListByPage(data) {
return api.post({
method: `merchants.api.open.findSubordinateListByPage`,
...data
})
}
}
\ No newline at end of file \ No newline at end of file
...@@ -46,5 +46,52 @@ class mineApi { ...@@ -46,5 +46,52 @@ class mineApi {
// true // true
) )
} }
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 获取员工列表
getStaffListAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.searchStaffPage',
...data
}
)
}
// 创建员工
createStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.createStaff',
...data
}
)
}
// 更新员工
updateStaffAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.staff.updateStaff',
...data
}
)
}
// 获取当前服务中心下的客户列表
getConnectionListByServiceAPI(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId',
...data
}
)
}
} }
export default mineApi export default mineApi
import api from '~/utils/request/request'
// 分页查询客户管理列表
const getCustomerList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.page',
...data
}
)
}
// 保存客户管理信息
const saveCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.save',
...data
},
true
)
}
// 修改客户管理信息
const updateCustomer = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.update',
...data
},
true
)
}
// 查询客户销售顾问列表
const getEmployeeList = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.employee.list',
...data
}
)
}
// 创建邀请销售顾问二维码
const getInviteCode = data => {
return api.post(
{
method: 'scrm.api.busassistant.merchantCustomer.inviteCode',
...data
}
)
}
export default {
getCustomerList,
saveCustomer,
updateCustomer,
getEmployeeList,
getInviteCode
}
\ No newline at end of file \ No newline at end of file
import api from '~/utils/request/request'
// 查询服务中心列表-不分页
const getAllServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId',
...data
}
)
}
// 分页查询服务中心列表
const getServiceList = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.page',
...data
}
)
}
// 保存服务中心信息
const saveService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.save',
...data
},
true
)
}
// 修改服务中心信息
const updateService = data => {
return api.post(
{
method: 'scrm.api.busassistant.serviceCenter.update',
...data
},
true
)
}
// 分页查询技师列表
const getTechnicianList = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.page',
...data
}
)
}
// 新增技师信息
const addTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.add',
...data
},
true
)
}
// 修改技师信息
const updateTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.update',
...data
},
true
)
}
// 删除技师
const deleteTechnician = data => {
return api.post(
{
method: 'scrm.api.busassistant.technicianConfig.delete',
...data
},
true
)
}
export default {
getAllServiceList,
getServiceList,
saveService,
updateService,
getTechnicianList,
addTechnician,
updateTechnician,
deleteTechnician
}
\ No newline at end of file \ No newline at end of file
...@@ -80,9 +80,10 @@ class outputApi { ...@@ -80,9 +80,10 @@ class outputApi {
/** 查询门店权益订单数据统计-车险升级活动产值 */ /** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) { getEquityRevenue(data) {
return api.post({ return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics', // method: 'scrm.api.busassistant.merchant.equity.statistics',
method: 'dj.api.smartcarlife.vd.quotation.merchant.statistics',
...data ...data
}) }, false, 'dj')
} }
/** 店面汇总-下载海报 */ /** 店面汇总-下载海报 */
...@@ -115,5 +116,31 @@ class outputApi { ...@@ -115,5 +116,31 @@ class outputApi {
...data ...data
}) })
} }
/** 根据场景查询产品 */
findProByScene(data) {
return api.post({
method: 'scrm.api.busassistant.activity.productByscene',
...data
})
}
/** 业务经营汇总列表查询 */
getBusiStatistics(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.store.assistant.merchants.total.statistics',
...data
})
}
// 我的员工
/** 服务商查询园区店员工产值统计 */
getStaffList(data) {
data.routerMethod = 'dj.api.smarcarlife.yquser.stat.byPartnerMerchant'
return api.post({
method: 'scrm.api.boutiquecoupon.rop.boutique.router.withoutLogin',
...data
})
}
} }
export default outputApi export default outputApi
...@@ -13,3 +13,18 @@ export const getActiveApi = data => { ...@@ -13,3 +13,18 @@ export const getActiveApi = data => {
true true
) )
} }
// 获取活动记录全集
export const getActivityRecord = (data)=> {
return api.post({
method: `entmicro.api.business.activityRecord.list`,
...data
}, true)
}
// 根据id查询
export const getActivityDetail = (data) => {
return api.post({
method: `entmicro.api.business.activityRecord.detail`,
...data
})
}
\ No newline at end of file \ No newline at end of file
// app.js // app.js
// 初始化sentry // 初始化sentry
import sentryInit from '~/utils/sentryConfig/sentryInit' // import sentryInit from '~/utils/sentryConfig/sentryInit'
sentryInit() // sentryInit()
import util from './utils/util' import util from './utils/util'
import wxApi from './utils/utils_wx' import wxApi from './utils/utils_wx'
...@@ -36,7 +36,6 @@ import './utils/share' ...@@ -36,7 +36,6 @@ import './utils/share'
//监听网络状态 //监听网络状态
import './utils/network' import './utils/network'
App({ App({
onLaunch(options) { onLaunch(options) {
/**挂载到wx对象 */ /**挂载到wx对象 */
......
{ {
"pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index", "login/accountItems/accountItems", "pages/viewVideo/index", "pages/viewProd/index", "pages/viewProdBanner/index", "pages/measure/measure/measure", "pages/measure/measureResult/measureResult", "packagesList/activityDetail/activityDetail"], "pages": [
"requiredPrivateInfos": ["getLocation"], "login/loading/loading",
"pages/tab/discovery/discovery",
"pages/tab/output/output",
"pages/tab/mine/mine",
"pages/webView/webView",
"login/index/index",
"login/accountItems/accountItems",
"packagesList/activityDetail/activityDetail",
"pages/tab/logout/logout"
],
"requiredPrivateInfos": [
"getLocation"
],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff", "navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
}, },
"tabBar": { "tabBar": {
"color": "#5A6066", "color": "#5A6066",
"selectedColor": "#3666FE", "selectedColor": "#3666FE",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [
{
"pagePath": "pages/tab/output/output",
"text": "看产值",
"iconPath": "images/output.png",
"selectedIconPath": "images/output_active.png"
},
{
"pagePath": "pages/tab/discovery/discovery",
"text": "发现",
"iconPath": "images/home.png",
"selectedIconPath": "images/home_active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "个人中心",
"iconPath": "images/mine.png",
"selectedIconPath": "images/mine_active.png"
}
]
},
"subpackages": [
{
"root": "packagesList/packageDiscovery",
"name": "packageDiscovery",
"pages": [
"pages/scenarioDetail/scenarioDetail",
"pages/productDetail/productDetail",
"pages/videoDetail/videoDetail",
"pages/activityDetail/activityDetail",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult"
]
},
{
"root": "packagesList/packageActivity",
"name": "packageActivity",
"pages": [
"pages/applyActivity/applyActivity",
"pages/applySuccess/applySuccess"
]
},
{ {
"pagePath": "pages/tab/output/output", "root": "packagesList/outDetail",
"text": "看产值", "name": "outDetail",
"iconPath": "images/output.png", "pages": [
"selectedIconPath": "images/output_active.png" "index"
]
}, },
{ {
"pagePath": "pages/tab/index/index", "root": "packagesList/packageOutput",
"text": "发现", "name": "packageOutput",
"iconPath": "images/home.png", "pages": [
"selectedIconPath": "images/home_active.png" "pages/shareWebview/shareWebview",
"pages/warReport/warReport",
"pages/visitor/visitor",
"pages/monthReport/monthReport",
"pages/crowdDetail/crowdDetail"
]
}, },
{ {
"pagePath": "pages/tab/mine/mine", "root": "packagesList/apply",
"text": "个人中心", "name": "apply",
"iconPath": "images/mine.png", "pages": [
"selectedIconPath": "images/mine_active.png" "pages/apply"
]
},
{
"root": "packagesList/applyProd",
"name": "applyProd",
"pages": [
"pages/apply"
]
} }
]
},
"subpackages": [
{
"root": "packagesList/pages",
"name": "packagesList",
"pages": ["videoDetal/videoDetal", "productDetail/productDetail", "scenarioDetail/scenarioDetail"]
},
{
"root": "packagesList/packageOutput",
"name": "packageOutput",
"pages": ["pages/openBusiness", "pages/summary"]
},
{
"root": "packagesList/mineDetail",
"name": "mineDetail",
"pages": ["pages/messageBox", "pages/customerManagement", "pages/clue"]
},
{
"root": "packagesList/apply",
"name": "apply",
"pages": ["pages/apply"]
},
{
"root": "packagesList/applyProd",
"name": "applyProd",
"pages": ["pages/apply"]
}
], ],
"preloadRule": { "preloadRule": {
"pages/tab/mine/mine": { "pages/tab/discovery/discovery": {
"network": "all", "network": "all",
"packages": ["mineDetail"] "packages": [
}, "packageOutput",
"pages/tab/index/index": { "outDetail"
"network": "all", ]
"packages": ["apply", "packageOutput"] },
} "pages/tab/output/output": {
"network": "all",
"packages": [
"outDetail",
"packageOutput"
]
}
}, },
"usingComponents": { "usingComponents": {
"tab": "/components/Tab/Tab", "tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar", "navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips", "nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster", "crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index" "glsx-image": "/components/image/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-calendar": "@vant/weapp/calendar/index"
}, },
"resolveAlias": { "resolveAlias": {
"~/*": "/*" "~/*": "/*"
}, },
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ page { ...@@ -20,7 +20,7 @@ page {
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
--themeColor: #F13C3D; --themeColor: #F13C3D;
--btnColor: #3666FE; --btnColor: linear-gradient(-84deg, #556AF5 0%, #7197FF 100%);
--borderRadius: 8rpx; --borderRadius: 8rpx;
--margin: 32rpx; --margin: 32rpx;
/* vant 样式覆盖 */ /* vant 样式覆盖 */
......
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot></slot>
</view>
<!-- 弹框模式 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar"></view>
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{!showConfirm?"isFullSucreen":""}}' style="height:{{height}}">
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<block wx:if="{{rangeAll && dateType == 'range'}}">
<view class="calender-all" style="color:{{calenderColor}};" bindtap="chooseAll">全选</view>
</block>
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image webp src="./images/close.png?v={{img_version}}" class='calender-close-image'></image>
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}'></view>
</view>
</picker>
<view class='calender-subtitle' wx:else>{{dateList[current]}}</view>
</block>
<view class='calendar-weekdays'>
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<swiper class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}'></view>
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class='calender-footer isFullSucreen' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
font-weight: 500; font-weight: 600;
box-sizing: border-box; box-sizing: border-box;
text-align: center; text-align: center;
letter-spacing: 1rpx; letter-spacing: 1rpx;
......
// components/image/index.js // components/image/index.js
import { IMG_URL, IMG_VERSION } from '~/utils/constantData' import { IMG_URL, IMG_VERSION ,IMG_URL_STORE} from '~/utils/constantData'
Component({ Component({
externalClasses: ['custom-class', 'class'], externalClasses: ['custom-class', 'class'],
/** /**
...@@ -12,9 +12,10 @@ Component({ ...@@ -12,9 +12,10 @@ Component({
observer: function (url, o) { observer: function (url, o) {
if (url) { if (url) {
let isWebp = url.includes('webp') let isWebp = url.includes('webp')
const isStore = url.startsWith('store-assistant')
this.setData({ this.setData({
isWebp, isWebp,
imagePath: `${IMG_URL}${url}?v=` + IMG_VERSION() imagePath: `${isStore?IMG_URL_STORE:IMG_URL}${url}?v=` + IMG_VERSION()
}) })
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
export const preReleaseAppId = 'wxc50d04ae5aa9984a' export const preReleaseAppId = 'wx96c8f2a3e76907cb'
// 小程序id // 小程序id
export const appId = 'wxc50d04ae5aa9984a' export const appId = 'wxc50d04ae5aa9984a'
......

2.64 KB | W: | H:

2.02 KB | W: | H:

images/home.png
images/home.png
images/home.png
images/home.png
  • 2-up
  • Swipe
  • Onion skin

2.88 KB | W: | H:

3.5 KB | W: | H:

images/home_active.png
images/home_active.png
images/home_active.png
images/home_active.png
  • 2-up
  • Swipe
  • Onion skin

2.59 KB | W: | H:

2.02 KB | W: | H:

images/mine.png
images/mine.png
images/mine.png
images/mine.png
  • 2-up
  • Swipe
  • Onion skin

2.84 KB | W: | H:

3.41 KB | W: | H:

images/mine_active.png
images/mine_active.png
images/mine_active.png
images/mine_active.png
  • 2-up
  • Swipe
  • Onion skin
images/ok.png

905 Bytes

876 Bytes | W: | H:

1.67 KB | W: | H:

images/output.png
images/output.png
images/output.png
images/output.png
  • 2-up
  • Swipe
  • Onion skin

1.1 KB | W: | H:

2.7 KB | W: | H:

images/output_active.png
images/output_active.png
images/output_active.png
images/output_active.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{{item.merchantName}}{{item.isSuper?'(超管)':item.userType==1?'(商户号)':'(员工号)'}} {{item.merchantName}}{{item.isSuper?'(超管)':item.userType==1?'(商户号)':'(员工号)'}}
</view> </view>
<view class="icon"> <view class="icon">
<image src="{{IMG_URL}}login/radio.png" /> <image src="../../images/ok.png" class="icon"/>
</view> </view>
<view class='radio' /> <view class='radio' />
</view> </view>
......
...@@ -30,12 +30,19 @@ Component({ ...@@ -30,12 +30,19 @@ Component({
// password: 'bb123456' // password: 'bb123456'
}, },
phoneReady: false, phoneReady: false,
countDown: null countDown: null,
agree: false
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
authChoose(e) {
let { detail: agree } = e
this.setData({
agree
})
},
/**隐藏验证码错误 */ /**隐藏验证码错误 */
hideError(name) { hideError(name) {
if (name == 'code') if (name == 'code')
...@@ -129,8 +136,19 @@ Component({ ...@@ -129,8 +136,19 @@ Component({
showPwd: !this.data.showPwd showPwd: !this.data.showPwd
}) })
}, },
checkAgree() {
let { agree } = this.data
console.log('agree', agree)
if (!agree) {
wx.$api.showToast('请同意用户协议')
return true
}
return false
},
/**手机号&帐号密码登录 */ /**手机号&帐号密码登录 */
login() { login() {
const checkAgree = this.checkAgree()
if (checkAgree) return false
const { formData, loginType } = this.data, const { formData, loginType } = this.data,
target = { target = {
1: 'phoneSmsLogin', 1: 'phoneSmsLogin',
......
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"input-icon":"../InputIcon/InputIcon" "input-icon": "../InputIcon/InputIcon",
"auth-setting": "../authSetting/authSetting"
} }
}
\ No newline at end of file \ No newline at end of file
}
/* login/index/components/LoginBox.wxss */ /* login/index/components/LoginBox.wxss */
.wx { .wx {
height: 922rpx; height: 63vh;
.title { .title {
font-weight: 600; font-weight: 600;
font-size: 60rpx; font-size: 60rpx;
color: #323436; color: #333333;
padding: 216rpx 0 24rpx; padding: 13vh 0 24rpx;
} }
.subtitle { .subtitle {
font-size: 44rpx; font-size: 48rpx;
color: #323436; color: #323436;
margin-bottom: 120rpx; margin-bottom: 60rpx;
} }
.img { .img {
width: 378rpx; width: 480rpx;
height: 364rpx; height: 480rpx;
display: block; display: block;
margin: 0 auto; margin: 0 auto 40rpx;
} }
} }
.opacity-view { .opacity-view {
animation: opacity-view .5s forwards; // animation: opacity-view .5s forwards;
} }
.box { .box {
// height: 800rpx; z-index: 100;
height: 750rpx; height: 700rpx;
.input-box { .input-box {
width: 540rpx; width: 540rpx;
...@@ -46,13 +46,12 @@ ...@@ -46,13 +46,12 @@
.input { .input {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 33rpx; margin-top: 20rpx;
border-bottom: 1rpx solid #E3E3E6; border-bottom: 1rpx solid #E3E3E6;
padding: 24rpx 0; padding: 24rpx 0;
height: 64rpx;
position: relative; position: relative;
input { input {
flex: 1; flex: 1;
color: #323436; color: #323436;
...@@ -67,14 +66,14 @@ ...@@ -67,14 +66,14 @@
.sms { .sms {
width: 160rpx; width: 160rpx;
flex-shrink: 0; flex-shrink: 0;
color: #5092FF; color: #CCCED1;
font-size: 24rpx; font-size: 24rpx;
padding: 0; padding: 0;
text-align: right; text-align: right;
transition: all .25s; transition: all .25s;
border: none;
&[disabled]:not([type]) { &.click-sms {
color: #CCCED1; color: #5092FF;
} }
} }
......
<block wx:if="{{loginType == 0}}"> <block wx:if="{{loginType == 0}}">
<view class="wx opacity-view"> <view class="wx opacity-view">
<view class="title"> <view class="title">
您好 您好
</view> </view>
<view class="subtitle"> <view class="subtitle">
欢迎登录生意助手 欢迎登录门店助手
</view> </view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" /> <image webp class="img" src="{{IMG_URL_STORE}}store-assistant-assemble/login/login-logo.png" />
</view> </view>
</block> </block>
<block wx:else> <block wx:else>
<view class="box"> <view class="box">
<view class="input-box opacity-view"> <view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view> <view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}"> <block wx:if="{{loginType == 1}}">
<view class="input"> <view class="input">
<input type="number" placeholder="填写手机号" placeholder-class="placeholder" bindinput="input" data-name="phone" value="{{formData.phone}}" maxlength="11" /> <input
<input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" /> type="number"
</view> placeholder="填写手机号"
<view class="input"> placeholder-class="placeholder"
<input type="number" placeholder="填写验证码" placeholder-class="placeholder" bindinput="input" data-name="code" value="{{formData.code}}" maxlength="4" /> bindinput="input"
<input-icon show="{{formData.code}}" bindtap="clear" data-name="code" /> data-name="phone"
<button class="sms text-center " bindtap="getSmsCode" disabled="{{count || !phoneReady}}" loading="{{smsLoading}}">{{ value="{{formData.phone}}"
count? count + 's':'获取验证码' maxlength="11" />
}}</button> <input-icon show="{{formData.phone}}" bindtap="clear" data-name="phone" />
<block wx:if="{{smsError}}"> </view>
<view class="error">验证码错误</view> <view class="input">
</block> <input
</view> type="number"
</block> placeholder="填写验证码"
<block wx:else> placeholder-class="placeholder"
<view class="input"> bindinput="input"
<input type="text" placeholder="填写账号" placeholder-class="placeholder" bindinput="input" data-name="account" value="{{formData.account}}" maxlength="15" /> data-name="code"
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" /> value="{{formData.code}}"
</view> maxlength="4" />
<view class="input"> <input-icon show="{{formData.code}}" bindtap="clear" data-name="code" />
<input type="text" placeholder="填写密码" placeholder-class="placeholder" bindinput="input" data-name="password" value="{{formData.password}}" maxlength="20" password='{{!showPwd}}' /> <view
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" /> class="sms text-center {{(!count&&phoneReady)?'click-sms':''}}"
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" /> bindtap="getSmsCode"
</view> loading="{{smsLoading}}">{{
</block> count? count + 's':'获取验证码'
</view> }}
</view> </view>
<block wx:if="{{smsError}}">
<view class="error">验证码错误</view>
</block>
</view>
</block>
<block wx:else>
<view class="input">
<input
type="text"
placeholder="填写账号"
placeholder-class="placeholder"
bindinput="input"
data-name="account"
value="{{formData.account}}"
maxlength="15" />
<input-icon show="{{formData.account}}" bindtap="clear" data-name="account" />
</view>
<view class="input">
<input
type="text"
placeholder="填写密码"
placeholder-class="placeholder"
bindinput="input"
data-name="password"
value="{{formData.password}}"
maxlength="20"
password='{{!showPwd}}' />
<input-icon show bindtap="pwdSwitch" type="{{showPwd?'showPwd':'hidePwd'}}" />
<input-icon show="{{formData.password}}" bindtap="clear" data-name="password" />
</view>
</block>
</view>
</view>
</block> </block>
<block wx:if="{{loginType == 0}}"> <block wx:if="{{loginType == 0 &&agree}}">
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">微信登录</button> <button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
open-type="getPhoneNumber"
bindgetphonenumber="wxLogin"
loading="{{loading}}">微信登录
</button>
</block> </block>
<block wx:else> <block wx:else>
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" bindtap="login" loading="{{loading}}">登录</button>
</block>
\ No newline at end of file \ No newline at end of file
<button
class="button"
disabled="{{disabled}}"
hover-class="btn-hover"
bindtap="login"
loading="{{loading}}">登录
</button>
</block>
<auth-setting bind:choose="authChoose" />
/* login/index/components/Clear/Clear.wxss */ /* login/index/components/Clear/Clear.wxss */
.icon-box { .icon-box {
width: 44rpx; width: 64rpx;
height: 40rpx; height: 60rpx;
padding: 0 10rpx; padding: 0 10rpx;
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
width: 100rpx; width: 100rpx;
animation: btn-move .25s forwards; // animation: btn-move .25s forwards;
margin:0 79rpx; margin:0 79rpx;
.icon { .icon {
width: 68rpx; width: 68rpx;
......
// components/authSetting/authSetting.js
// const restapi = require('../../utils/restapi.js')
// var appInstance = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
// auth: {
// type: Boolean,
// value: true,
// observer: function (newVal, oldVal) {
// this.getHeadImage()
// }
// },
// type: {
// type: Boolean,
// value: true
// },
// special: {
// type: Boolean,
// value: false
// },
// index: {
// type: Boolean,
// value: false
// }
},
/**
* 组件的初始数据
*/
data: {
agree: false
// auth: true,
// type: true,
// appLogo: '',
// appName: '',
// merchantName: '',
// gender: 1
},
ready() {
// this.getHeadImage()
},
/**
* 组件的方法列表
*/
methods: {
choose() {
this.setData({
agree: !this.data.agree
})
this.triggerEvent('choose', this.data.agree)
},
jump(e) {
console.log(e)
let { url } = e.currentTarget.dataset
const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const path = `${baseUrl}${url}.html`
// private user
wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
})
// var globalData = appInstance.globalData.extConfig
// restapi.getMerchantBussiness(globalData.merchantId, function (res) {
// console.log(res);
// if (res.returnCode == '0') {
// let path = `https://dj.glsx.com.cn/agreement/djUserPolicy.html?merchantName=${globalData.merchantName}&phone=${res.data.phone}`
// wx.navigateTo({
// url: `/pages/webpage/webpage?path=${encodeURIComponent(path)}`
// })
// }
// }, function (res) {
// console.log(res);
// })
},
noScroll() {}
}
})
<view class='tips'>
<view class='choose-box' bindtap="choose">
<view class='icon'>
<icon wx:if="{{agree}}" class="icon-small" type="success" size="14" color="#4466F0"></icon>
<icon wx:else class="icon-small" type="circle" size="14" color="#4466F0"></icon>
</view>
</view>
阅读并同意以下协议
<!-- <text catchtap="jump" data-url="agree">《服务协议》</text> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
/* components/authSetting/authSetting.wxss */
.tips {
position: fixed;
width: 100%;
left: 0;
bottom: 60rpx;
font-size: 24rpx;
color: #999;
letter-spacing: 2rpx;
padding-left: 28rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.tips text {
color: #4466F0;
}
.tips .icon {
position: absolute;
top: 50%;
left: 50%;
width: 24rpx;
height: 24rpx;
border-radius: 2rpx;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
.tips .icon .check-img {
vertical-align: top;
width: 100%;
height: 100%;
}
.tips .choose-box {
width: 80rpx;
height: 80rpx;
position: relative;
}
\ No newline at end of file \ No newline at end of file
...@@ -28,7 +28,6 @@ Page({ ...@@ -28,7 +28,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow(options, refresh) { onShow(options, refresh) {
1
if (refresh) { if (refresh) {
this.setData({ this.setData({
disabled: true disabled: true
......
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
}
\ No newline at end of file \ No newline at end of file
}
.layout { .layout {
position: relative; position: relative;
padding: 0 80rpx; padding: 0 95rpx;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
// background: #FAFBFF;
// z-index: -2;
&::before { &::before {
content: ''; content: '';
width: 100%; width: 100%;
height: 264rpx; height: 864rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-top.webp') no-repeat; background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/bg-top.webp') no-repeat;
background-size: 100% 264rpx; background-size: 100% 864rpx;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
...@@ -17,9 +19,9 @@ ...@@ -17,9 +19,9 @@
&::after { &::after {
content: ''; content: '';
width: 100%; width: 100%;
height: 472rpx; height: 864rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat; background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant-assemble/login/bg-bottom.webp') no-repeat;
background-size: 100% 472rpx; background-size: 100% 864rpx;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
......
<view class="layout"> <view class="layout">
<mask show="{{loading}}"></mask> <mask show="{{loading}}"></mask>
<navigation-bar navStyle="background-color: rgba(0,0,0,0)">生意助手</navigation-bar> <navigation-bar navStyle="background-color: rgba(0,0,0,0)">门店助手</navigation-bar>
<box loginType="{{loginType}}" disabled="{{disabled}}" id="box" /> <box loginType="{{loginType}}" disabled="{{disabled}}" id="box" />
<agree show="{{loginType == 2}}" text="7天内免登陆" value="{{autoLogin}}" bindchange="changeAgree" /> <agree show="{{loginType == 2}}" text="7天内免登陆" value="{{autoLogin}}" bindchange="changeAgree" />
<type-list loginType="{{loginType}}" /> <type-list loginType="{{loginType}}" />
......
import { import {
setSessionId, setSessionId,
setUserInfo setUserInfo,
setSubMerchant
} from '~/utils/cache/storageApi' } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index' import USERAPI from '~/api/usersApi/index'
const setRouteData = targetPath => { const setRouteData = targetPath => {
...@@ -32,21 +33,39 @@ const selectAccountLogin = ({ ...@@ -32,21 +33,39 @@ const selectAccountLogin = ({
message message
}) => { }) => {
if (code == '0') { if (code == '0') {
console.log(data)
setLoginInfo(data.loginUserInfoList[0], data.sessionId) setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常') } else wx.$api.showToast(message || '系统异常')
}) })
} }
/**获取门店号下的全部门店 */
const findSubordinateListByPage = (userInfo)=> {
return new Promise(resolve=>{
USERAPI.findSubordinateListByPage({pageSize:10000,pageNum:1,merchantId:userInfo.merchantId,apiProjectName:'rop-merchants'}).then(res=>{
const list = res.data||[]
const merchant = list.map(i=>i.merchantNo)
setSubMerchant(merchant)
resolve()
})
})
}
/**设置登录信息 */ /**设置登录信息 */
const setLoginInfo = (userInfo, sessionId) => { const setLoginInfo = async (userInfo, sessionId) => {
if (!userInfo) { if (!userInfo) {
wx.$api.showToast('仅支持服务商类型账户登录') wx.$api.showToast('请使用商户账号登陆')
return return
} }
setUserInfo(userInfo) setUserInfo(userInfo)
setSessionId(sessionId) setSessionId(sessionId)
try {
await findSubordinateListByPage(userInfo)
} catch (error) {
}
loginSuccess() loginSuccess()
} }
const initServiceCenter = () => {
USERAPI.initServiceCenter({})
}
/**成功跳转 */ /**成功跳转 */
const loginSuccess = () => { const loginSuccess = () => {
const { const {
...@@ -54,13 +73,14 @@ const loginSuccess = () => { ...@@ -54,13 +73,14 @@ const loginSuccess = () => {
targetPath targetPath
} }
} = wx.$router.getPageInstance() } = wx.$router.getPageInstance()
console.log(targetPath)
if (targetPath) { if (targetPath) {
const { const {
url, url,
obj obj
} = setRouteData(targetPath) } = setRouteData(targetPath)
wx.$router.reLaunch(url, obj) wx.$router.reLaunch(url, obj)
} else wx.$router.go('pages.index') } else wx.reLaunch({url:"/pages/tab/output/output"})
} }
const loginModal = async ({ const loginModal = async ({
message, message,
...@@ -105,5 +125,6 @@ module.exports = { ...@@ -105,5 +125,6 @@ module.exports = {
loginSuccess, loginSuccess,
setRouteData, setRouteData,
setLoginInfo, setLoginInfo,
loginModal loginModal,
initServiceCenter
} }
\ No newline at end of file \ No newline at end of file
...@@ -94,7 +94,7 @@ Page({ ...@@ -94,7 +94,7 @@ Page({
wx.nextTick(() => { wx.nextTick(() => {
const sessionId = getSessionId(), const sessionId = getSessionId(),
{ url, targetPath = url ? decodeURIComponent(url) : '' } = this.options { url, targetPath = url ? decodeURIComponent(url) : '' } = this.options
let path = 'pages.index', let path = 'pages.output',
obj = {} obj = {}
if (targetPath) obj.targetPath = targetPath if (targetPath) obj.targetPath = targetPath
if (sessionId) { if (sessionId) {
......
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
type="danger" type="danger"
color="{{ color }}" color="{{ color }}"
custom-class="van-calendar__confirm" custom-class="van-calendar__confirm"
disabled="{{ computed.getButtonDisabled(type, currentDate) }}" disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}"
nativeType="text" nativeType="text"
bind:click="onConfirm" bind:click="onConfirm"
> >
{{ {{
computed.getButtonDisabled(type, currentDate) computed.getButtonDisabled(type, currentDate, minRange)
? confirmDisabledText ? confirmDisabledText
: confirmText : confirmText
}} }}
......
...@@ -119,6 +119,10 @@ var getTime = function (date) { ...@@ -119,6 +119,10 @@ var getTime = function (date) {
type: null, type: null,
value: null, value: null,
}, },
minRange: {
type: Number,
value: 1,
},
firstDayOfWeek: { firstDayOfWeek: {
type: Number, type: Number,
value: 0, value: 0,
...@@ -180,7 +184,7 @@ var getTime = function (date) { ...@@ -180,7 +184,7 @@ var getTime = function (date) {
getInitialDate: function (defaultDate) { getInitialDate: function (defaultDate) {
var _this = this; var _this = this;
if (defaultDate === void 0) { defaultDate = null; } if (defaultDate === void 0) { defaultDate = null; }
var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate; var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay;
var now = (0, utils_1.getToday)().getTime(); var now = (0, utils_1.getToday)().getTime();
if (type === 'range') { if (type === 'range') {
if (!Array.isArray(defaultDate)) { if (!Array.isArray(defaultDate)) {
...@@ -188,7 +192,8 @@ var getTime = function (date) { ...@@ -188,7 +192,8 @@ var getTime = function (date) {
} }
var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; var _b = defaultDate || [], startDay = _b[0], endDay = _b[1];
var start = this.limitDateRange(startDay || now, minDate, (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); var start = this.limitDateRange(startDay || now, minDate, (0, utils_1.getPrevDay)(new Date(maxDate)).getTime());
var end = this.limitDateRange(endDay || now, (0, utils_1.getNextDay)(new Date(minDate)).getTime()); var date = getTime(endDay || now);
var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime());
return [start, end]; return [start, end];
} }
if (type === 'multiple') { if (type === 'multiple') {
...@@ -262,7 +267,7 @@ var getTime = function (date) { ...@@ -262,7 +267,7 @@ var getTime = function (date) {
this.select([date, null]); this.select([date, null]);
} }
else if (allowSameDay) { else if (allowSameDay) {
this.select([date, date]); this.select([date, date], true);
} }
} }
else { else {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
position="{{ position }}" position="{{ position }}"
closeable="{{ showTitle || showSubtitle }}" closeable="{{ showTitle || showSubtitle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
bind:enter="onOpen" bind:enter="onOpen"
bind:close="onClose" bind:close="onClose"
bind:after-enter="onOpened" bind:after-enter="onOpened"
......
...@@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) { ...@@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) {
return months; return months;
} }
function getButtonDisabled(type, currentDate) { function getButtonDisabled(type, currentDate, minRange) {
if (currentDate == null) { if (currentDate == null) {
return true; return true;
} }
...@@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) { ...@@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) {
} }
if (type === 'multiple') { if (type === 'multiple') {
return !currentDate.length; return currentDate.length < minRange;
} }
return !currentDate; return !currentDate;
......
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
declare type CanvasContext = WechatMiniprogram.CanvasContext; type CanvasContext = WechatMiniprogram.CanvasContext;
export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext; export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext;
export {}; export {};
...@@ -14,6 +14,7 @@ function VantComponent(vantOptions) { ...@@ -14,6 +14,7 @@ function VantComponent(vantOptions) {
mapKeys(vantOptions, options, { mapKeys(vantOptions, options, {
data: 'data', data: 'data',
props: 'properties', props: 'properties',
watch: 'observers',
mixins: 'behaviors', mixins: 'behaviors',
methods: 'methods', methods: 'methods',
beforeCreate: 'created', beforeCreate: 'created',
......
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
relations: { relations: {
[x: string]: WechatMiniprogram.Component.RelationOption; [x: string]: WechatMiniprogram.Component.RelationOption;
......
...@@ -8,7 +8,7 @@ export { getSystemInfoSync } from './version'; ...@@ -8,7 +8,7 @@ export { getSystemInfoSync } from './version';
export declare function range(num: number, min: number, max: number): number; export declare function range(num: number, min: number, max: number): number;
export declare function nextTick(cb: (...args: any[]) => void): void; export declare function nextTick(cb: (...args: any[]) => void): void;
export declare function addUnit(value?: string | number): string | undefined; export declare function addUnit(value?: string | number): string | undefined;
export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout | WechatMiniprogram.NodesRef; export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout;
export declare function pickExclude(obj: unknown, keys: string[]): {}; export declare function pickExclude(obj: unknown, keys: string[]): {};
export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>; export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>; export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
......
...@@ -31,19 +31,9 @@ function addUnit(value) { ...@@ -31,19 +31,9 @@ function addUnit(value) {
} }
exports.addUnit = addUnit; exports.addUnit = addUnit;
function requestAnimationFrame(cb) { function requestAnimationFrame(cb) {
var systemInfo = (0, version_1.getSystemInfoSync)(); return setTimeout(function () {
if (systemInfo.platform === 'devtools') {
return setTimeout(function () {
cb();
}, 1000 / 30);
}
return wx
.createSelectorQuery()
.selectViewport()
.boundingClientRect()
.exec(function () {
cb(); cb();
}); }, 1000 / 30);
} }
exports.requestAnimationFrame = requestAnimationFrame; exports.requestAnimationFrame = requestAnimationFrame;
function pickExclude(obj, keys) { function pickExclude(obj, keys) {
......
export declare type TimeData = { export type TimeData = {
days: number; days: number;
hours: number; hours: number;
minutes: number; minutes: number;
......
...@@ -5,7 +5,7 @@ interface VantComponentInstance { ...@@ -5,7 +5,7 @@ interface VantComponentInstance {
index: number; index: number;
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
} }
export declare type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = { export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
data?: Data; data?: Data;
field?: boolean; field?: boolean;
classes?: string[]; classes?: string[];
...@@ -15,6 +15,7 @@ export declare type VantComponentOptions<Data extends WechatMiniprogram.Componen ...@@ -15,6 +15,7 @@ export declare type VantComponentOptions<Data extends WechatMiniprogram.Componen
relations: Record<string, WechatMiniprogram.Component.RelationOption>; relations: Record<string, WechatMiniprogram.Component.RelationOption>;
mixin: string; mixin: string;
}; };
watch?: Record<string, (...args: any[]) => any>;
methods?: Methods; methods?: Methods;
beforeCreate?: () => void; beforeCreate?: () => void;
created?: () => void; created?: () => void;
......
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
export declare type Action = 'confirm' | 'cancel' | 'overlay'; export type Action = 'confirm' | 'cancel' | 'overlay';
declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
interface DialogOptions { interface DialogOptions {
lang?: string; lang?: string;
show?: boolean; show?: boolean;
...@@ -14,6 +14,9 @@ interface DialogOptions { ...@@ -14,6 +14,9 @@ interface DialogOptions {
overlay?: boolean; overlay?: boolean;
selector?: string; selector?: string;
ariaLabel?: string; ariaLabel?: string;
/**
* @deprecated use custom-class instead
*/
className?: string; className?: string;
customStyle?: string; customStyle?: string;
transition?: string; transition?: string;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
z-index="{{ zIndex }}" z-index="{{ zIndex }}"
overlay="{{ overlay }}" overlay="{{ overlay }}"
transition="{{ transition }}" transition="{{ transition }}"
custom-class="van-dialog van-dialog--{{ theme }} {{ className }}" custom-class="van-dialog van-dialog--{{ theme }}{{ className }} custom-class"
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}" custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
overlay-style="{{ overlayStyle }}" overlay-style="{{ overlayStyle }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</van-goods-action-button> </van-goods-action-button>
</van-goods-action> </van-goods-action>
<view wx:else class="van-hairline--top van-dialog__footer"> <view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
<van-button <van-button
wx:if="{{ showCancelButton }}" wx:if="{{ showCancelButton }}"
size="large" size="large"
......
...@@ -28,12 +28,21 @@ var component_1 = require("../common/component"); ...@@ -28,12 +28,21 @@ var component_1 = require("../common/component");
observer: 'rerender', observer: 'rerender',
}, },
popupStyle: String, popupStyle: String,
useBeforeToggle: {
type: Boolean,
value: false,
},
rootPortal: {
type: Boolean,
value: false,
},
}, },
data: { data: {
transition: true, transition: true,
showPopup: false, showPopup: false,
showWrapper: false, showWrapper: false,
displayTitle: '', displayTitle: '',
safeAreaTabBar: false,
}, },
methods: { methods: {
rerender: function () { rerender: function () {
...@@ -45,13 +54,14 @@ var component_1 = require("../common/component"); ...@@ -45,13 +54,14 @@ var component_1 = require("../common/component");
}, },
updateDataFromParent: function () { updateDataFromParent: function () {
if (this.parent) { if (this.parent) {
var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction; var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar;
this.setData({ this.setData({
overlay: overlay, overlay: overlay,
duration: duration, duration: duration,
activeColor: activeColor, activeColor: activeColor,
closeOnClickOverlay: closeOnClickOverlay, closeOnClickOverlay: closeOnClickOverlay,
direction: direction, direction: direction,
safeAreaTabBar: safeAreaTabBar,
}); });
} }
}, },
...@@ -81,7 +91,6 @@ var component_1 = require("../common/component"); ...@@ -81,7 +91,6 @@ var component_1 = require("../common/component");
}, },
toggle: function (show, options) { toggle: function (show, options) {
var _this = this; var _this = this;
var _a;
if (options === void 0) { options = {}; } if (options === void 0) { options = {}; }
var showPopup = this.data.showPopup; var showPopup = this.data.showPopup;
if (typeof show !== 'boolean') { if (typeof show !== 'boolean') {
...@@ -90,19 +99,38 @@ var component_1 = require("../common/component"); ...@@ -90,19 +99,38 @@ var component_1 = require("../common/component");
if (show === showPopup) { if (show === showPopup) {
return; return;
} }
this.setData({ this.onBeforeToggle(show).then(function (status) {
transition: !options.immediate, var _a;
showPopup: show, if (!status) {
}); return;
if (show) { }
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then(function (wrapperStyle) { _this.setData({
_this.setData({ wrapperStyle: wrapperStyle, showWrapper: true }); transition: !options.immediate,
_this.rerender(); showPopup: show,
}); });
if (show) {
(_a = _this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then(function (wrapperStyle) {
_this.setData({ wrapperStyle: wrapperStyle, showWrapper: true });
_this.rerender();
});
}
else {
_this.rerender();
}
});
},
onBeforeToggle: function (status) {
var _this = this;
var useBeforeToggle = this.data.useBeforeToggle;
if (!useBeforeToggle) {
return Promise.resolve(true);
} }
else { return new Promise(function (resolve) {
this.rerender(); _this.$emit('before-toggle', {
} status: status,
callback: function (value) { return resolve(value); },
});
});
}, },
}, },
}); });
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
overlay="{{ overlay }}" overlay="{{ overlay }}"
position="{{ direction === 'down' ? 'top' : 'bottom' }}" position="{{ direction === 'down' ? 'top' : 'bottom' }}"
duration="{{ transition ? duration : 0 }}" duration="{{ transition ? duration : 0 }}"
safe-area-tab-bar="{{ safeAreaTabBar }}"
close-on-click-overlay="{{ closeOnClickOverlay }}" close-on-click-overlay="{{ closeOnClickOverlay }}"
rootPortal="{{ rootPortal }}"
bind:enter="onOpen" bind:enter="onOpen"
bind:leave="onClose" bind:leave="onClose"
bind:close="toggle" bind:close="toggle"
......
...@@ -34,6 +34,10 @@ var ARRAY = []; ...@@ -34,6 +34,10 @@ var ARRAY = [];
value: 'down', value: 'down',
observer: 'updateChildrenData', observer: 'updateChildrenData',
}, },
safeAreaTabBar: {
type: Boolean,
value: false,
},
closeOnClickOverlay: { closeOnClickOverlay: {
type: Boolean, type: Boolean,
value: true, value: true,
......
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:-4px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
\ No newline at end of file \ No newline at end of file
...@@ -35,6 +35,9 @@ var props_1 = require("./props"); ...@@ -35,6 +35,9 @@ var props_1 = require("./props");
}, clearIcon: { }, clearIcon: {
type: String, type: String,
value: 'clear', value: 'clear',
}, extraEventParams: {
type: Boolean,
value: false,
} }), } }),
data: { data: {
focused: false, focused: false,
...@@ -50,7 +53,7 @@ var props_1 = require("./props"); ...@@ -50,7 +53,7 @@ var props_1 = require("./props");
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
this.value = value; this.value = value;
this.setShowClear(); this.setShowClear();
this.emitChange(); this.emitChange(event.detail);
}, },
onFocus: function (event) { onFocus: function (event) {
this.focused = true; this.focused = true;
...@@ -74,7 +77,7 @@ var props_1 = require("./props"); ...@@ -74,7 +77,7 @@ var props_1 = require("./props");
this.value = ''; this.value = '';
this.setShowClear(); this.setShowClear();
(0, utils_1.nextTick)(function () { (0, utils_1.nextTick)(function () {
_this.emitChange(); _this.emitChange({ value: '' });
_this.$emit('clear', ''); _this.$emit('clear', '');
}); });
}, },
...@@ -90,7 +93,7 @@ var props_1 = require("./props"); ...@@ -90,7 +93,7 @@ var props_1 = require("./props");
if (value === '') { if (value === '') {
this.setData({ innerValue: '' }); this.setData({ innerValue: '' });
} }
this.emitChange(); this.emitChange({ value: value });
}, },
onLineChange: function (event) { onLineChange: function (event) {
this.$emit('linechange', event.detail); this.$emit('linechange', event.detail);
...@@ -98,12 +101,14 @@ var props_1 = require("./props"); ...@@ -98,12 +101,14 @@ var props_1 = require("./props");
onKeyboardHeightChange: function (event) { onKeyboardHeightChange: function (event) {
this.$emit('keyboardheightchange', event.detail); this.$emit('keyboardheightchange', event.detail);
}, },
emitChange: function () { emitChange: function (detail) {
var _this = this; var _this = this;
this.setData({ value: this.value }); var extraEventParams = this.data.extraEventParams;
this.setData({ value: detail.value });
(0, utils_1.nextTick)(function () { (0, utils_1.nextTick)(function () {
_this.$emit('input', _this.value); var data = extraEventParams ? detail : detail.value;
_this.$emit('change', _this.value); _this.$emit('input', data);
_this.$emit('change', data);
}); });
}, },
setShowClear: function () { setShowClear: function () {
......
...@@ -11,6 +11,7 @@ var link_1 = require("../mixins/link"); ...@@ -11,6 +11,7 @@ var link_1 = require("../mixins/link");
dot: Boolean, dot: Boolean,
info: String, info: String,
icon: String, icon: String,
color: String,
classPrefix: { classPrefix: {
type: String, type: String,
value: 'van-icon', value: 'van-icon',
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
name="{{ icon }}" name="{{ icon }}"
dot="{{ dot }}" dot="{{ dot }}"
info="{{ info }}" info="{{ info }}"
color="{{ color }}"
class-prefix="{{ classPrefix }}" class-prefix="{{ classPrefix }}"
class="van-goods-action-icon__icon" class="van-goods-action-icon__icon"
custom-class="icon-class" custom-class="icon-class"
......
...@@ -13,6 +13,10 @@ function rootClass(data) { ...@@ -13,6 +13,10 @@ function rootClass(data) {
classes.push(data.classPrefix); classes.push(data.classPrefix);
} }
if (data.classPrefix !== 'van-icon') {
classes.push('van-icon')
}
if (isImage(data.name)) { if (isImage(data.name)) {
classes.push('van-icon--image'); classes.push('van-icon--image');
} else if (data.classPrefix != null) { } else if (data.classPrefix != null) {
......
...@@ -27,6 +27,10 @@ var button_1 = require("../mixins/button"); ...@@ -27,6 +27,10 @@ var button_1 = require("../mixins/button");
type: String, type: String,
value: 'fill', value: 'fill',
}, },
webp: {
type: Boolean,
value: false,
},
showError: { showError: {
type: Boolean, type: Boolean,
value: true, value: true,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
src="{{ src }}" src="{{ src }}"
mode="{{ computed.mode(fit) }}" mode="{{ computed.mode(fit) }}"
lazy-load="{{ lazyLoad }}" lazy-load="{{ lazyLoad }}"
webp="{{ webp }}"
class="image-class van-image__img" class="image-class van-image__img"
show-menu-by-longpress="{{ showMenuByLongpress }}" show-menu-by-longpress="{{ showMenuByLongpress }}"
bind:load="onLoad" bind:load="onLoad"
......
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption;
declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void;
export declare function pageScrollMixin(scroller: Scroller): string; export declare function pageScrollMixin(scroller: Scroller): string;
export {}; export {};
...@@ -21,7 +21,7 @@ function pageScrollMixin(scroller) { ...@@ -21,7 +21,7 @@ function pageScrollMixin(scroller) {
} }
var _scroller = scroller.bind(this); var _scroller = scroller.bind(this);
var _a = page.vanPageScroller, vanPageScroller = _a === void 0 ? [] : _a; var _a = page.vanPageScroller, vanPageScroller = _a === void 0 ? [] : _a;
if (!vanPageScroller.length && (0, validator_1.isFunction)(page.onPageScroll)) { if ((0, validator_1.isFunction)(page.onPageScroll) && page.onPageScroll !== onPageScroll) {
vanPageScroller.push(page.onPageScroll.bind(page)); vanPageScroller.push(page.onPageScroll.bind(page));
} }
vanPageScroller.push(_scroller); vanPageScroller.push(_scroller);
......
...@@ -53,6 +53,9 @@ function transition(showDefaultValue) { ...@@ -53,6 +53,9 @@ function transition(showDefaultValue) {
var _a = this.data, duration = _a.duration, name = _a.name; var _a = this.data, duration = _a.duration, name = _a.name;
var classNames = getClassNames(name); var classNames = getClassNames(name);
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration; var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
if (this.status === 'enter') {
return;
}
this.status = 'enter'; this.status = 'enter';
this.$emit('before-enter'); this.$emit('before-enter');
(0, utils_1.requestAnimationFrame)(function () { (0, utils_1.requestAnimationFrame)(function () {
......
...@@ -17,6 +17,10 @@ var component_1 = require("../common/component"); ...@@ -17,6 +17,10 @@ var component_1 = require("../common/component");
type: Boolean, type: Boolean,
value: true, value: true,
}, },
rootPortal: {
type: Boolean,
value: false,
},
}, },
methods: { methods: {
onClick: function () { onClick: function () {
......
<van-transition <import src="./overlay.wxml" />
wx:if="{{ lockScroll }}"
show="{{ show }}" <root-portal wx:if="{{ rootPortal }}">
custom-class="van-overlay custom-class" <include src="./overlay.wxml" />
custom-style="z-index: {{ zIndex }}; {{ customStyle }}" </root-portal>
duration="{{ duration }}"
bind:tap="onClick" <include wx:else src="./overlay.wxml" />
catch:touchmove="noop"
>
<slot></slot>
</van-transition>
<van-transition
wx:else
show="{{ show }}"
custom-class="van-overlay custom-class"
custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
duration="{{ duration }}"
bind:tap="onClick"
>
<slot></slot>
</van-transition>
...@@ -55,10 +55,18 @@ var transition_1 = require("../mixins/transition"); ...@@ -55,10 +55,18 @@ var transition_1 = require("../mixins/transition");
type: Boolean, type: Boolean,
value: false, value: false,
}, },
safeAreaTabBar: {
type: Boolean,
value: false,
},
lockScroll: { lockScroll: {
type: Boolean, type: Boolean,
value: true, value: true,
}, },
rootPortal: {
type: Boolean,
value: false,
},
}, },
created: function () { created: function () {
this.observeClass(); this.observeClass();
......
<wxs src="../wxs/utils.wxs" module="utils" /> <wxs src="../wxs/utils.wxs" module="utils" />
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<import src="./popup.wxml" />
<van-overlay <van-overlay
wx:if="{{ overlay }}" wx:if="{{ overlay }}"
show="{{ show }}" show="{{ show }}"
...@@ -9,18 +11,11 @@ ...@@ -9,18 +11,11 @@
duration="{{ duration }}" duration="{{ duration }}"
bind:click="onClickOverlay" bind:click="onClickOverlay"
lock-scroll="{{ lockScroll }}" lock-scroll="{{ lockScroll }}"
root-portal="{{ rootPortal }}"
/> />
<view
wx:if="{{ inited }}" <root-portal wx:if="{{ rootPortal }}">
class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop }]) }}" <include src="./popup.wxml" />
style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}" </root-portal>
bind:transitionend="onTransitionEnd"
> <include wx:else src="./popup.wxml" />
<slot />
<van-icon
wx:if="{{ closeable }}"
name="{{ closeIcon }}"
class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
bind:tap="onClickCloseIcon"
/>
</view>
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar,.van-popup--top.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:1em}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:100%}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)}
\ No newline at end of file \ No newline at end of file
...@@ -48,6 +48,6 @@ ...@@ -48,6 +48,6 @@
hover-stay-time="70" hover-stay-time="70"
> >
<slot wx:if="{{ useActionSlot }}" name="action" /> <slot wx:if="{{ useActionSlot }}" name="action" />
<view wx:else bind:tap="onCancel" class="cancel-class">{{ actionText }}</view> <view wx:else bind:tap="onCancel" class="van-search__action-button cancel-class">{{ actionText }}</view>
</view> </view>
</view> </view>
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-action-padding,0 8px)}.van-search__action--hover{background-color:#f2f3f5}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px)}.van-search__action--hover{background-color:#f2f3f5}.van-search__action-button{padding:var(--search-action-padding,0 8px)}
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,11 @@ var component_1 = require("../common/component"); ...@@ -4,6 +4,11 @@ var component_1 = require("../common/component");
var touch_1 = require("../mixins/touch"); var touch_1 = require("../mixins/touch");
var version_1 = require("../common/version"); var version_1 = require("../common/version");
var utils_1 = require("../common/utils"); var utils_1 = require("../common/utils");
var DRAG_STATUS = {
START: 'start',
MOVING: 'moving',
END: 'end',
};
(0, component_1.VantComponent)({ (0, component_1.VantComponent)({
mixins: [touch_1.touch], mixins: [touch_1.touch],
props: { props: {
...@@ -57,17 +62,17 @@ var utils_1 = require("../common/utils"); ...@@ -57,17 +62,17 @@ var utils_1 = require("../common/utils");
else { else {
this.startValue = this.format(this.newValue); this.startValue = this.format(this.newValue);
} }
this.dragStatus = 'start'; this.dragStatus = DRAG_STATUS.START;
}, },
onTouchMove: function (event) { onTouchMove: function (event) {
var _this = this; var _this = this;
if (this.data.disabled) if (this.data.disabled)
return; return;
if (this.dragStatus === 'start') { if (this.dragStatus === DRAG_STATUS.START) {
this.$emit('drag-start'); this.$emit('drag-start');
} }
this.touchMove(event); this.touchMove(event);
this.dragStatus = 'draging'; this.dragStatus = DRAG_STATUS.MOVING;
(0, utils_1.getRect)(this, '.van-slider').then(function (rect) { (0, utils_1.getRect)(this, '.van-slider').then(function (rect) {
var vertical = _this.data.vertical; var vertical = _this.data.vertical;
var delta = vertical ? _this.deltaY : _this.deltaX; var delta = vertical ? _this.deltaY : _this.deltaX;
...@@ -84,11 +89,15 @@ var utils_1 = require("../common/utils"); ...@@ -84,11 +89,15 @@ var utils_1 = require("../common/utils");
}); });
}, },
onTouchEnd: function () { onTouchEnd: function () {
var _this = this;
if (this.data.disabled) if (this.data.disabled)
return; return;
if (this.dragStatus === 'draging') { if (this.dragStatus === DRAG_STATUS.MOVING) {
this.updateValue(this.newValue, true); this.dragStatus = DRAG_STATUS.END;
this.$emit('drag-end'); (0, utils_1.nextTick)(function () {
_this.updateValue(_this.newValue, true);
_this.$emit('drag-end');
});
} }
}, },
onClick: function (event) { onClick: function (event) {
...@@ -164,7 +173,7 @@ var utils_1 = require("../common/utils"); ...@@ -164,7 +173,7 @@ var utils_1 = require("../common/utils");
getOffsetWidth: function (current, min) { getOffsetWidth: function (current, min) {
var scope = this.getScope(); var scope = this.getScope();
// 避免最小值小于最小step时出现负数情况 // 避免最小值小于最小step时出现负数情况
return "".concat(Math.max((current - min) * 100 / scope, 0), "%"); return "".concat(Math.max(((current - min) * 100) / scope, 0), "%");
}, },
// 计算选中条的长度百分比 // 计算选中条的长度百分比
calcMainAxis: function () { calcMainAxis: function () {
......
...@@ -29,7 +29,6 @@ function equal(value1, value2) { ...@@ -29,7 +29,6 @@ function equal(value1, value2) {
props: { props: {
value: { value: {
type: null, type: null,
observer: 'observeValue',
}, },
integer: { integer: {
type: Boolean, type: Boolean,
...@@ -79,6 +78,11 @@ function equal(value1, value2) { ...@@ -79,6 +78,11 @@ function equal(value1, value2) {
data: { data: {
currentValue: '', currentValue: '',
}, },
watch: {
value: function () {
this.observeValue();
},
},
created: function () { created: function () {
this.setData({ this.setData({
currentValue: this.format(this.data.value), currentValue: this.format(this.data.value),
...@@ -86,10 +90,8 @@ function equal(value1, value2) { ...@@ -86,10 +90,8 @@ function equal(value1, value2) {
}, },
methods: { methods: {
observeValue: function () { observeValue: function () {
var _a = this.data, value = _a.value, currentValue = _a.currentValue; var value = this.data.value;
if (!equal(value, currentValue)) { this.setData({ currentValue: this.format(value) });
this.setData({ currentValue: this.format(value) });
}
}, },
check: function () { check: function () {
var val = this.format(this.data.currentValue); var val = this.format(this.data.currentValue);
...@@ -109,6 +111,7 @@ function equal(value1, value2) { ...@@ -109,6 +111,7 @@ function equal(value1, value2) {
}, },
onBlur: function (event) { onBlur: function (event) {
var value = this.format(event.detail.value); var value = this.format(event.detail.value);
this.setData({ currentValue: value });
this.emitChange(value); this.emitChange(value);
this.$emit('blur', __assign(__assign({}, event.detail), { value: value })); this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
}, },
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<slot name="minus" /> <slot name="minus" />
</view> </view>
<input <input
always-embed="{{ false }}"
type="{{ integer ? 'number' : 'digit' }}" type="{{ integer ? 'number' : 'digit' }}"
class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}" class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}" style="{{ computed.inputStyle({ buttonSize, inputWidth }) }}"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
wx:if="{{ item.inactiveIcon || inactiveIcon }}" wx:if="{{ item.inactiveIcon || inactiveIcon }}"
color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}" color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}"
name="{{ item.inactiveIcon || inactiveIcon }}" name="{{ item.inactiveIcon || inactiveIcon }}"
custom-class="van-step__icon" class="van-step__icon"
/> />
<view <view
wx:else wx:else
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/> />
</block> </block>
<van-icon wx:else name="{{ item.activeIcon || activeIcon }}" color="{{ activeColor }}" custom-class="van-step__icon" /> <van-icon wx:else name="{{ item.activeIcon || activeIcon }}" color="{{ activeColor }}" class="van-step__icon" />
</view> </view>
<view <view
wx:if="{{ index !== steps.length - 1 }}" wx:if="{{ index !== steps.length - 1 }}"
......
...@@ -8,6 +8,14 @@ var relation_1 = require("../common/relation"); ...@@ -8,6 +8,14 @@ var relation_1 = require("../common/relation");
name: null, name: null,
icon: String, icon: String,
dot: Boolean, dot: Boolean,
url: {
type: String,
value: '',
},
linkType: {
type: String,
value: 'redirectTo',
},
iconPrefix: { iconPrefix: {
type: String, type: String,
value: 'van-icon', value: 'van-icon',
...@@ -29,6 +37,10 @@ var relation_1 = require("../common/relation"); ...@@ -29,6 +37,10 @@ var relation_1 = require("../common/relation");
parent.$emit('change', active); parent.$emit('change', active);
} }
} }
var _a = this.data, url = _a.url, linkType = _a.linkType;
if (url && wx[linkType]) {
return wx[linkType]({ url: url });
}
this.$emit('click'); this.$emit('click');
}, },
updateFromParent: function () { updateFromParent: function () {
......
"use strict"; "use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require("../common/component"); var component_1 = require("../common/component");
var touch_1 = require("../mixins/touch"); var touch_1 = require("../mixins/touch");
...@@ -7,7 +18,13 @@ var validator_1 = require("../common/validator"); ...@@ -7,7 +18,13 @@ var validator_1 = require("../common/validator");
var relation_1 = require("../common/relation"); var relation_1 = require("../common/relation");
(0, component_1.VantComponent)({ (0, component_1.VantComponent)({
mixins: [touch_1.touch], mixins: [touch_1.touch],
classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class'], classes: [
'nav-class',
'tab-class',
'tab-active-class',
'line-class',
'wrap-class',
],
relation: (0, relation_1.useChildren)('tab', function () { relation: (0, relation_1.useChildren)('tab', function () {
this.updateTabs(); this.updateTabs();
}), }),
...@@ -78,6 +95,10 @@ var relation_1 = require("../common/relation"); ...@@ -78,6 +95,10 @@ var relation_1 = require("../common/relation");
type: Boolean, type: Boolean,
value: true, value: true,
}, },
useBeforeChange: {
type: Boolean,
value: false,
},
}, },
data: { data: {
tabs: [], tabs: [],
...@@ -88,6 +109,7 @@ var relation_1 = require("../common/relation"); ...@@ -88,6 +109,7 @@ var relation_1 = require("../common/relation");
skipTransition: true, skipTransition: true,
scrollWithAnimation: false, scrollWithAnimation: false,
lineOffsetLeft: 0, lineOffsetLeft: 0,
inited: false,
}, },
mounted: function () { mounted: function () {
var _this = this; var _this = this;
...@@ -111,15 +133,11 @@ var relation_1 = require("../common/relation"); ...@@ -111,15 +133,11 @@ var relation_1 = require("../common/relation");
}, },
trigger: function (eventName, child) { trigger: function (eventName, child) {
var currentIndex = this.data.currentIndex; var currentIndex = this.data.currentIndex;
var currentChild = child || this.children[currentIndex]; var data = this.getChildData(currentIndex, child);
if (!(0, validator_1.isDef)(currentChild)) { if (!(0, validator_1.isDef)(data)) {
return; return;
} }
this.$emit(eventName, { this.$emit(eventName, data);
index: currentChild.index,
name: currentChild.getComputedName(),
title: currentChild.data.title,
});
}, },
onTap: function (event) { onTap: function (event) {
var _this = this; var _this = this;
...@@ -127,13 +145,14 @@ var relation_1 = require("../common/relation"); ...@@ -127,13 +145,14 @@ var relation_1 = require("../common/relation");
var child = this.children[index]; var child = this.children[index];
if (child.data.disabled) { if (child.data.disabled) {
this.trigger('disabled', child); this.trigger('disabled', child);
return;
} }
else { this.onBeforeChange(index).then(function () {
this.setCurrentIndex(index); _this.setCurrentIndex(index);
(0, utils_1.nextTick)(function () { (0, utils_1.nextTick)(function () {
_this.trigger('click'); _this.trigger('click');
}); });
} });
}, },
// correct the index of active tab // correct the index of active tab
setCurrentIndexByName: function (name) { setCurrentIndexByName: function (name) {
...@@ -201,12 +220,13 @@ var relation_1 = require("../common/relation"); ...@@ -201,12 +220,13 @@ var relation_1 = require("../common/relation");
.reduce(function (prev, curr) { return prev + curr.width; }, 0); .reduce(function (prev, curr) { return prev + curr.width; }, 0);
lineOffsetLeft += lineOffsetLeft +=
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8); (rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
_this.setData({ lineOffsetLeft: lineOffsetLeft }); _this.setData({ lineOffsetLeft: lineOffsetLeft, inited: true });
_this.swiping = true; _this.swiping = true;
if (skipTransition) { if (skipTransition) {
(0, utils_1.nextTick)(function () { // waiting transition end
setTimeout(function () {
_this.setData({ skipTransition: false }); _this.setData({ skipTransition: false });
}); }, _this.data.duration);
} }
}); });
}, },
...@@ -252,14 +272,15 @@ var relation_1 = require("../common/relation"); ...@@ -252,14 +272,15 @@ var relation_1 = require("../common/relation");
}, },
// watch swipe touch end // watch swipe touch end
onTouchEnd: function () { onTouchEnd: function () {
var _this = this;
if (!this.data.swipeable || !this.swiping) if (!this.data.swipeable || !this.swiping)
return; return;
var _a = this, direction = _a.direction, deltaX = _a.deltaX, offsetX = _a.offsetX; var _a = this, direction = _a.direction, deltaX = _a.deltaX, offsetX = _a.offsetX;
var minSwipeDistance = 50; var minSwipeDistance = 50;
if (direction === 'horizontal' && offsetX >= minSwipeDistance) { if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
var index = this.getAvaiableTab(deltaX); var index_1 = this.getAvaiableTab(deltaX);
if (index !== -1) { if (index_1 !== -1) {
this.setCurrentIndex(index); this.onBeforeChange(index_1).then(function () { return _this.setCurrentIndex(index_1); });
} }
} }
this.swiping = false; this.swiping = false;
...@@ -278,5 +299,26 @@ var relation_1 = require("../common/relation"); ...@@ -278,5 +299,26 @@ var relation_1 = require("../common/relation");
} }
return -1; return -1;
}, },
onBeforeChange: function (index) {
var _this = this;
var useBeforeChange = this.data.useBeforeChange;
if (!useBeforeChange) {
return Promise.resolve();
}
return new Promise(function (resolve, reject) {
_this.$emit('before-change', __assign(__assign({}, _this.getChildData(index)), { callback: function (status) { return (status ? resolve() : reject()); } }));
});
},
getChildData: function (index, child) {
var currentChild = child || this.children[index];
if (!(0, validator_1.isDef)(currentChild)) {
return;
}
return {
index: currentChild.index,
name: currentChild.getComputedName(),
title: currentChild.data.title,
};
},
}, },
}); });
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
container="{{ container }}" container="{{ container }}"
bind:scroll="onTouchScroll" bind:scroll="onTouchScroll"
> >
<view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }}"> <view class="{{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'van-hairline--top-bottom' : '' }} wrap-class">
<slot name="nav-left" /> <slot name="nav-left" />
<scroll-view <scroll-view
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
style="{{ color ? 'border-color: ' + color : '' }}" style="{{ color ? 'border-color: ' + color : '' }}"
> >
<view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}"> <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" /> <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth, inited }) }}" />
<view <view
wx:for="{{ tabs }}" wx:for="{{ tabs }}"
wx:key="index" wx:key="index"
......
...@@ -60,6 +60,7 @@ function trackStyle(data) { ...@@ -60,6 +60,7 @@ function trackStyle(data) {
function lineStyle(data) { function lineStyle(data) {
return style({ return style({
width: utils.addUnit(data.lineWidth), width: utils.addUnit(data.lineWidth),
opacity: data.inited ? 1 : 0,
transform: 'translateX(' + data.lineOffsetLeft + 'px)', transform: 'translateX(' + data.lineOffsetLeft + 'px)',
'-webkit-transform': 'translateX(' + data.lineOffsetLeft + 'px)', '-webkit-transform': 'translateX(' + data.lineOffsetLeft + 'px)',
'background-color': data.color, 'background-color': data.color,
......
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
\ No newline at end of file \ No newline at end of file
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
\ No newline at end of file \ No newline at end of file
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
/// <reference types="miniprogram-api-typings" /> /// <reference types="miniprogram-api-typings" />
declare type ToastMessage = string | number; type ToastMessage = string | number;
declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance;
interface ToastOptions { interface ToastOptions {
show?: boolean; show?: boolean;
type?: string; type?: string;
......
...@@ -16,7 +16,7 @@ var utils_1 = require("./utils"); ...@@ -16,7 +16,7 @@ var utils_1 = require("./utils");
var shared_1 = require("./shared"); var shared_1 = require("./shared");
var validator_1 = require("../common/validator"); var validator_1 = require("../common/validator");
(0, component_1.VantComponent)({ (0, component_1.VantComponent)({
props: __assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: { props: __assign(__assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
type: null, type: null,
value: 80, value: 80,
}, name: { }, name: {
...@@ -53,7 +53,7 @@ var validator_1 = require("../common/validator"); ...@@ -53,7 +53,7 @@ var validator_1 = require("../common/validator");
}, uploadIcon: { }, uploadIcon: {
type: String, type: String,
value: 'photograph', value: 'photograph',
} }, shared_1.chooseImageProps), shared_1.chooseVideoProps), } }, shared_1.imageProps), shared_1.videoProps), shared_1.mediaProps), shared_1.messageFileProps),
data: { data: {
lists: [], lists: [],
isInCount: true, isInCount: true,
...@@ -129,11 +129,12 @@ var validator_1 = require("../common/validator"); ...@@ -129,11 +129,12 @@ var validator_1 = require("../common/validator");
if (!this.data.previewFullImage) if (!this.data.previewFullImage)
return; return;
var index = event.currentTarget.dataset.index; var index = event.currentTarget.dataset.index;
var lists = this.data.lists; var _a = this.data, lists = _a.lists, showmenu = _a.showmenu;
var item = lists[index]; var item = lists[index];
wx.previewImage({ wx.previewImage({
urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }), urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }),
current: item.url, current: item.url,
showmenu: showmenu,
fail: function () { fail: function () {
wx.showToast({ title: '预览图片失败', icon: 'none' }); wx.showToast({ title: '预览图片失败', icon: 'none' });
}, },
...@@ -144,11 +145,20 @@ var validator_1 = require("../common/validator"); ...@@ -144,11 +145,20 @@ var validator_1 = require("../common/validator");
return; return;
var index = event.currentTarget.dataset.index; var index = event.currentTarget.dataset.index;
var lists = this.data.lists; var lists = this.data.lists;
var sources = [];
var current = lists.reduce(function (sum, cur, curIndex) {
if (!(0, utils_1.isVideoFile)(cur)) {
return sum;
}
sources.push(__assign(__assign({}, cur), { type: 'video' }));
if (curIndex < index) {
sum++;
}
return sum;
}, 0);
wx.previewMedia({ wx.previewMedia({
sources: lists sources: sources,
.filter(function (item) { return (0, utils_1.isVideoFile)(item); }) current: current,
.map(function (item) { return (__assign(__assign({}, item), { type: 'video' })); }),
current: index,
fail: function () { fail: function () {
wx.showToast({ title: '预览视频失败', icon: 'none' }); wx.showToast({ title: '预览视频失败', icon: 'none' });
}, },
......
export declare const chooseImageProps: { export declare const imageProps: {
sizeType: { sizeType: {
type: ArrayConstructor; type: ArrayConstructor;
value: string[]; value: string[];
...@@ -7,8 +7,12 @@ export declare const chooseImageProps: { ...@@ -7,8 +7,12 @@ export declare const chooseImageProps: {
type: ArrayConstructor; type: ArrayConstructor;
value: string[]; value: string[];
}; };
showmenu: {
type: BooleanConstructor;
value: boolean;
};
}; };
export declare const chooseVideoProps: { export declare const videoProps: {
capture: { capture: {
type: ArrayConstructor; type: ArrayConstructor;
value: string[]; value: string[];
...@@ -26,3 +30,24 @@ export declare const chooseVideoProps: { ...@@ -26,3 +30,24 @@ export declare const chooseVideoProps: {
value: string; value: string;
}; };
}; };
export declare const mediaProps: {
capture: {
type: ArrayConstructor;
value: string[];
};
mediaType: {
type: ArrayConstructor;
value: string[];
};
maxDuration: {
type: NumberConstructor;
value: number;
};
camera: {
type: StringConstructor;
value: string;
};
};
export declare const messageFileProps: {
extension: null;
};
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.chooseVideoProps = exports.chooseImageProps = void 0; exports.messageFileProps = exports.mediaProps = exports.videoProps = exports.imageProps = void 0;
// props for choose image // props for image
exports.chooseImageProps = { exports.imageProps = {
sizeType: { sizeType: {
type: Array, type: Array,
value: ['original', 'compressed'], value: ['original', 'compressed'],
...@@ -11,9 +11,13 @@ exports.chooseImageProps = { ...@@ -11,9 +11,13 @@ exports.chooseImageProps = {
type: Array, type: Array,
value: ['album', 'camera'], value: ['album', 'camera'],
}, },
showmenu: {
type: Boolean,
value: true,
},
}; };
// props for choose video // props for video
exports.chooseVideoProps = { exports.videoProps = {
capture: { capture: {
type: Array, type: Array,
value: ['album', 'camera'], value: ['album', 'camera'],
...@@ -31,3 +35,26 @@ exports.chooseVideoProps = { ...@@ -31,3 +35,26 @@ exports.chooseVideoProps = {
value: 'back', value: 'back',
}, },
}; };
// props for media
exports.mediaProps = {
capture: {
type: Array,
value: ['album', 'camera'],
},
mediaType: {
type: Array,
value: ['image', 'video'],
},
maxDuration: {
type: Number,
value: 60,
},
camera: {
type: String,
value: 'back',
},
};
// props for file
exports.messageFileProps = {
extension: null,
};
...@@ -10,7 +10,7 @@ export interface File { ...@@ -10,7 +10,7 @@ export interface File {
} }
export declare function isImageFile(item: File): boolean; export declare function isImageFile(item: File): boolean;
export declare function isVideoFile(item: File): boolean; export declare function isVideoFile(item: File): boolean;
export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, }: { export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, mediaType, extension, }: {
accept: any; accept: any;
multiple: any; multiple: any;
capture: any; capture: any;
...@@ -19,4 +19,6 @@ export declare function chooseFile({ accept, multiple, capture, compressed, maxD ...@@ -19,4 +19,6 @@ export declare function chooseFile({ accept, multiple, capture, compressed, maxD
sizeType: any; sizeType: any;
camera: any; camera: any;
maxCount: any; maxCount: any;
mediaType: any;
extension: any;
}): Promise<File | File[]>; }): Promise<File | File[]>;
...@@ -55,7 +55,7 @@ function formatFile(res) { ...@@ -55,7 +55,7 @@ function formatFile(res) {
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { url: item.path })); }); return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { url: item.path })); });
} }
function chooseFile(_a) { function chooseFile(_a) {
var accept = _a.accept, multiple = _a.multiple, capture = _a.capture, compressed = _a.compressed, maxDuration = _a.maxDuration, sizeType = _a.sizeType, camera = _a.camera, maxCount = _a.maxCount; var accept = _a.accept, multiple = _a.multiple, capture = _a.capture, compressed = _a.compressed, maxDuration = _a.maxDuration, sizeType = _a.sizeType, camera = _a.camera, maxCount = _a.maxCount, mediaType = _a.mediaType, extension = _a.extension;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
switch (accept) { switch (accept) {
case 'image': case 'image':
...@@ -70,6 +70,7 @@ function chooseFile(_a) { ...@@ -70,6 +70,7 @@ function chooseFile(_a) {
case 'media': case 'media':
wx.chooseMedia({ wx.chooseMedia({
count: multiple ? Math.min(maxCount, 9) : 1, count: multiple ? Math.min(maxCount, 9) : 1,
mediaType: mediaType,
sourceType: capture, sourceType: capture,
maxDuration: maxDuration, maxDuration: maxDuration,
sizeType: sizeType, sizeType: sizeType,
...@@ -89,12 +90,7 @@ function chooseFile(_a) { ...@@ -89,12 +90,7 @@ function chooseFile(_a) {
}); });
break; break;
default: default:
wx.chooseMessageFile({ wx.chooseMessageFile(__assign(__assign({ count: multiple ? maxCount : 1, type: accept }, (extension ? { extension: extension } : {})), { success: function (res) { return resolve(formatFile(res)); }, fail: reject }));
count: multiple ? maxCount : 1,
type: accept,
success: function (res) { return resolve(formatFile(res)); },
fail: reject,
});
break; break;
} }
}); });
......
import { IMG_URL, IMG_VERSION } from '~/utils/constantData' import { IMG_URL, IMG_VERSION,IMG_URL_STORE } from '~/utils/constantData'
module.exports = Behavior({ module.exports = Behavior({
data: { data: {
IMGURL: IMG_URL, IMGURL: IMG_URL,
IMG_URL_STORE,
IMG_VERSION: IMG_VERSION() IMG_VERSION: IMG_VERSION()
} }
}) })
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@vant/weapp": { "@vant/weapp": {
"version": "1.10.7", "version": "1.10.15",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.7.tgz", "resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.10.15.tgz",
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A==" "integrity": "sha512-swM4k3pVwt/6Tnijvq86paLiKE1CzbrBQ4lR7+9uRhwKOM0HS3ooK1Q4IjSEyxQ59ZFKmYYvZln77RZcnSDqmA=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.1.3", "version": "1.1.3",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.7", "@vant/weapp": "^1.10.7",
"glsx-applet-component": "^1.0.50" "glsx-applet-component": "^1.1.3"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://luyt@192.168.3.233:8090/saas_plus/business-assistant.git" "url": "http://yangming@192.168.3.233:8090/saas_plus/store-assistant-assemble.git"
}, },
"author": "", "author": "",
"license": "ISC" "license": "ISC"
......
Component({
properties: {
data: {
type: Object,
value: {},
observer(v) {
if(!v)return
let s = v.statics
if (s) {
v.numList = [
{title: '浏览量', num: s.browseCount},
{title: '访客量', num: s.fansCount},
{title: '订单量', num: s.orderCount}
]
v.sortList = [
{title: '访客率', sort: s.fansRate},
{title: '转化率', sort: s.conversionRate}
]
}
this.setData({data: v})
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
/* pages/tab/index/components/invertAnalyse/invertAnalyse.wxss */
.title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
}
.funnel-box {
padding: 40rpx 0;
position: relative;
.funnel-bg {
position: absolute;
top: 40rpx;
left: 50%;
transform: translate(-50%);
width: 458.18rpx;
height: 298rpx;
image {
width: 458.18rpx;
height: 298rpx;
}
}
.funnel-content {
display: flex;
justify-content: center;
height: 248rpx;
width: 100%;
padding-top: 40rpx;
.left,
.right {
display: flex;
}
.left {
flex: 0 0 406rpx;
flex-flow: column;
justify-content: space-around;
align-items: flex-end;
// align-items: center;
z-index: 1;
font-size: 22rpx;
color: #2D2D33;
box-sizing: border-box;
padding-right: 20rpx;
view {
display: flex;
align-items: center;
margin-right: 28rpx;
text {
font-size: 28rpx;
font-weight: bold;
margin-left: 4rpx;
}
}
}
.right {
flex: 1;
flex-flow: column;
align-items: flex-start;
margin-left: 130rpx;
color: #4466F0;
padding-top: 20rpx;
font-size: 24rpx;
position: relative;
.sort-box:last-child {
position: absolute;
left: -46rpx;
top: 50%;
}
.sort {
font-size: 40rpx;
font-weight: bold;
margin-top: 4rpx;
}
}
}
}
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!