Commit 73da95f7 by 李伟康

提交代码

0 parents
Showing 117 changed files with 5168 additions and 0 deletions
import api from '~/utils/request/request'
import indexApi from './indexApi'
import ssoApi from './ssoApi'
import discoveryApi from './discoveryApi'
import shopmallApi from './shopmallApi'
import mineApi from './mineApi'
import couponsApi from './coupons'
import equityApi from './equity'
import entmicroApi from './entmicroApi'
import boutiquecouponApi from './boutiquecouponApi'
import psdApi from './psdApi'
import sopApi from './sopApi'
import carlifeApi from './carlifeApi'
import bigdatautilApi from './bigdatautil'
const common = 'scrm.api.carlife.common.'
module.exports = {
ssoApi,
indexApi,
discoveryApi,
shopmallApi,
mineApi,
couponsApi,
equityApi,
entmicroApi,
boutiquecouponApi,
psdApi,
sopApi,
carlifeApi,
bigdatautilApi,
commonApi: {
/**上传图片
*/
uploadImg(data) {
return api.post({
method: `${common}uploadImg`,
...data,
noSignAttr: ['file']
})
},
/**视频上传
*/
uploadVideo(data) {
return api.post({
method: `${common}uploadVideo`,
...data,
noSignAttr: ['file']
})
},
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return api.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */
search(data) {
return api.post({
method: 'scrm.api.carlife.weapp.homeSearch.search',
pageSize: 10,
...data
})
},
/** 根据sap编码获取商户详情 */
getBySapCode(data) {
return api.post(
{
method: `scrm.api.carlife.merchant.getBySapCode`,
...data
},
true
)
},
/**获取图片版本号 */
getImgVersion() {
return api.getMock()
}
}
}
import api from '~/utils/request/request'
module.exports = {
/**埋点 数据上报*/
reportCustomer(params) {
return api.post({
method: 'entmicro.api.customercollect.reportCustomer',
...params,
projectName: 'customercollect'
})
}
}
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
})
}
}
import api from '~/utils/request/request'
module.exports = {
/** 获取用户绑定设备信息 */
getUserDevInfo() {
return api.post({
method: 'scrm.api.carlife.devicebind.get.accountbinding',
deviceType: 'GPS'
})
},
/** 绑定设备 */
bindDev(data) {
return api.post(
{
method: 'scrm.api.carlife.devicebind.binding',
appType: 'CgacarMiniprogram',
...data
},
true
)
},
/** 解绑设备 */
unbindDev(data) {
return api.post({
method: 'scrm.api.carlife.devicebind.unbinding',
...data
})
},
/**获取设备最新位置信息 */
getCarPosition(data) {
return api.post({
method: 'scrm.api.carlife.deviceposition.get.vehicle.position',
...data
})
},
/**获取设备最近行程 */
getPathList(data) {
return api.post({
method: 'scrm.api.carlife.deviceposition.get.recently.journey',
pageSize: 10,
...data
})
},
/** 获取设备总里程 */
getDevMileage(data) {
return api.post({
method: 'scrm.api.carlife.deviceposition.get.total.mileage',
...data
})
},
/** 获取线索列表 */
getClueList(data) {
return api.post({
method: 'scrm.api.carlife.weapp.clue.listWithPage',
pageSize: 10,
channelType: 'GH',
...data
})
},
/**获取设备日行程 */
getPathListByDay(data) {
return api.post({
method: 'scrm.api.carlife.deviceposition.get.journey.bydate',
pageSize: 10,
...data
})
},
/**获取指定行程信息 */
getPathDetail(journeyId) {
return api.post(
{
method: 'scrm.api.carlife.deviceposition.get.journey.by.id',
journeyId
},
true
)
},
/**底部商城导航栏跳转至第三方倍礼安商城 */
getBizjiaUrl(data) {
return api.post({
method: `scrm.api.carlife.cgacar.api.shopmall`,
...data
})
},
/**判断是否绑定车架号 */
checkBindVIN(data) {
return api.post({
method: `scrm.api.carlife.cgacar.commom.list.veh`,
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.coupon.'
const ghPath = 'scrm.api.carlife.cgacar.'
import { defaultMerchantId } from '~/utils/request/environment'
module.exports = {
/**获取卡券列表 */
getCardData(data) {
return api.post({
method: `${path}app.list`,
...data
// discountTypes: [3, 7]
})
},
/**获取卡券数量 */
getCouponNum() {
return api.post({
method: 'scrm.api.coupon.list.by.account.id',
useMemberType: 0
})
},
/**获取首页可以领取的券 */
getHomeCardData(data) {
let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
}
if (merchantId) {
data.merchantId = merchantId
}
return api.post({
method: `${path}list.merchant.account`,
...data
})
},
/**领取优惠券 */
toReciveCard(data) {
let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) {
merchantId = Number(JSON.parse(merchantId))
data.merchantId = merchantId
} else {
data.merchantId = defaultMerchantId
}
return api.post({
method: `${path}customer.receive`,
...data,
receiveWay: 1,
receiveSource: 3
})
},
/**卡券详情 */
couponsDetail(data) {
return api.post({
method: `${path}verification.code.detail`,
...data
})
},
/**广汇卡券 卡券全部列表 */
ghCouponsData() {
return api.post({
method: `${ghPath}coupon.list.benefits`
})
},
/**广汇卡券 抵用记录列表 */
ghDealNote() {
return api.post({
method: `${ghPath}coupon.list.credit.cards`
})
},
/**广汇卡券 发布确认列表 */
ghDealPublish() {
return api.post({
method: `${ghPath}coupon.list.card.deal`
})
},
/**广汇卡券 抵用确认列表 */
ghDealResist() {
return api.post({
method: `${ghPath}coupon.list.resist.deal`
})
},
/**抵用确认提交 */
ghSumbitResist(data) {
return api.post({
method: `${ghPath}coupon.resist.deal`,
...data
})
},
/**发布确认提交 */
ghSumbitPublish(data) {
return api.post({
method: `${ghPath}coupon.card.deal`,
...data
})
},
/**免费领取体验卡 */
tolqFreecard(data) {
return api.post(
{
method: `scrm.api.equity.h5.free.card.receive`,
...data
},
true
)
},
/**获取体验卡天数 */
getFreeCardDay(data) {
return api.post({
method: `scrm.api.equity.class.free.day.get`,
...data
})
},
/** 获取企微分享优惠卷信息 */
getCouponInfo(data) {
return api.post({
method: `${path}share.info`,
...data
})
},
/**领取优惠券 */
receiveCoupon(data) {
return api.post(
{
method: `${path}share.receive`,
...data,
receiveSource: 4
},
true
)
},
/**获取套餐详情(权益) */
packageInfo(data) {
return api.post({
method: `scrm.api.equity.main.page.package.detail.get`,
...data
})
},
/**获取门店单号(权益) */
createOrderNum(data) {
return api.post({
method: `scrm.api.equity.merchant.order.code.create`,
...data
})
},
/**创建门店订单(权益) */
createOrder(data) {
return api.post({
method: `scrm.api.equity.merchant.order.create`,
...data
})
},
/**获取折扣券 兑换券详情 */
getWWCoupon(data) {
return api.post({
method: `scrm.api.coupon.verification.code.detail`,
...data
})
},
/** 检查是否领取优惠券 */
checkCoupon(data) {
return api.post({
method: `scrm.api.coupon.share.receive.check`,
...data
})
},
// 定向礼包详情
giftsDetail(data) {
return api.post({
method: `scrm.api.coupon.directional.gift.detail`,
...data
})
},
// 定向礼包领取
giftsRecive(data) {
return api.post({
method: `scrm.api.coupon.user.directional.gift.create`,
...data
})
},
/**查询会员开通的套餐列表 */
getVipList(data) {
return api.post({
method: `scrm.api.equity.package.info.list.with.account`,
pageSize: 9999,
...data
})
},
/** 查询包含已使用卡券的会员套餐列表 */
getVipUsedList(data) {
return api.post({
method: `scrm.api.equity.package.info.list.with.used.service`,
pageSize: 9999,
...data
})
},
/** 查询包含失效卡券的会员套餐列表 */
getVipFailList(data) {
return api.post({
method: `scrm.api.equity.package.info.list.with.invalid.service`,
pageSize: 9999,
...data
})
},
// 获取优惠券详情--道路救援
getDigitalCoupons(data) {
return api.post({
method: `scrm.api.coupon.detail`,
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.zoneInfo.weapp.'
module.exports = {
/**查询商户的指定类型专区列表 */
getZoneInfo(zoneType) {
return api.post({
method: `${path}listByMerchantId`,
zoneType //专区类型(1发现频道,2商城专区)
})
},
/** 晒单详情 */
getOrderShareRecordDetail(id) {
return api.post({
method: 'scrm.api.shopmall.weapp.orderShareRecord.detail',
id
})
}
}
import api from '~/utils/request/request'
module.exports = {
getServiceCode(data) {
return api.post(
{
method: 'dracIm.api.entmicro.findMiniProgramIm',
...data
},
true
)
},
/**数字化道路救援 */
getDigitalPageInfo(data) {
return api.post({
method: 'entmicro.api.drac.rescue.getRescueCustomerView',
...data
})
},
/**刷新数字化道路救援二维码 */
toFreshCode(data) {
return api.post({
method: 'entmicro.api.drac.rescue.getRescueStaffCode',
...data
})
},
/**重新定位获取数据 */
toRegetDigitalData(data) {
return api.post({
method: 'entmicro.api.drac.rescue.rescueReacquireLocation',
...data
})
},
/**智能外呼-联系人 */
findByActivityIdAndPhone(data) {
return api.post(
{
method: 'dracIm.api.entmicro.findByActivityIdAndPhone',
...data
},
true
)
}
}
import api from '~/utils/request/request'
module.exports = {
/**激活卡(权益) */
activeEquity(data) {
return api.post({
method: `scrm.api.equity.open.card.by.cardno`,
...data
})
},
/**获取代驾服务接口*/
getEdjurl(data) {
return api.post({
method: `scrm.api.equity.edj.url`,
...data
})
},
/**获取所有权益 */
getAllEquity(data) {
return api.post({
method: `scrm.api.equity.third.get`,
...data
})
},
//查询是否开通会员
checkOpenMember(data) {
return api.post(
{
method: `scrm.api.equity.info`,
...data
},
true
)
},
// 获取商品信息
commodityMsg(data) {
return api.post({
method: `scrm.api.equity.coupon.detail`,
...data
})
},
// 查询商品库存
checkStock(data) {
return api.post(
{
method: `scrm.api.equity.goods.stock.get`,
...data
},
true
)
},
// 首页--附近优惠
lasteCommodity(data) {
return api.post({
method: `scrm.api.equity.main.page.carefully.chosen.get`,
...data
})
},
// 首页--门店套餐
storePackage(data) {
return api.post({
method: `scrm.api.equity.main.page.merchant.package.get`,
...data
})
},
// 首页--获取会员卡信息
memberCard(data) {
return api.post({
method: `scrm.api.equity.open.card.price.get.by.merchantid`,
...data
})
},
// 购买权益卡
buyMemberCard(data) {
return api.post({
method: `scrm.api.equity.open.card.to.buy`,
...data
})
},
// 首页--获取养车服务
serviceDataOfhome(data) {
return api.post({
method: `scrm.api.equity.service.h5.main.page.service.get`,
...data
})
},
// 查询服务条款
serviceTerms(data) {
return api.post({
method: `scrm.api.equity.service.h5.items.terms.get`,
...data
})
},
// 根据身份证查询订单
checkOrderByIdcard(data) {
return api.post({
method: `scrm.api.equity.service.h5.order.by.card`,
...data
})
},
// 首页--检测是否领取了权益卡
checkCustomCardNote(data) {
return api.post({
method: `scrm.api.equity.service.h5.customer.equity.card.get`,
...data
})
},
// 通过购买售前权益套餐后领卡
openCardByPreSale(data) {
return api.post(
{
method: `scrm.api.equity.open.card.receive.by.package`,
...data
},
true
)
},
// 购买商品获取订单号
getOrderCode(data) {
return api.post({
method: `scrm.api.equity.ordercode.get`,
...data
})
},
/** 会员商城商品数据 */
getMerchantGoodsList(data) {
return api.post({
method: `scrm.api.shopmall.goods.page.curMerchant.wechat`,
pageNum: 1,
pageSize: 999,
...data
})
},
// 支付订单号
payGoodsOrder(data) {
return api.post({
method: `scrm.api.equity.create.order`,
...data
})
},
// 服务项目详情
serviceDetailMsg(data) {
return api.post({
method: `scrm.api.equity.service.h5.bill.detail.get`,
...data
})
},
// 门店订单套餐详情
packageOrderDetail(data) {
return api.post({
method: `scrm.api.equity.h5.package.order.detail.get`,
...data
})
},
// 获取直充商品数据
chargeData(data) {
return api.post({
method: `scrm.api.equity.charge.detail`,
...data
})
},
// 获取订单详情
orderDetailData(data) {
return api.post({
method: `scrm.api.equity.h5.order.detail.get`,
...data
})
},
// 创建售后
createdSale(data) {
return api.post({
method: `scrm.api.equity.order.refund.detail.create`,
...data
})
},
// 获取售后详情
saleDetailInfo(data) {
return api.post({
method: `scrm.api.equity.h5.order.refund.detail.get`,
...data
})
},
// 套餐申请售后
packageApply(data) {
return api.post({
method: `scrm.api.equity.merchant.order.refund`,
...data
})
},
// 我的卡券
cardListData(data) {
return api.post({
method: `scrm.api.equity.h5.order.list.get`,
...data
})
},
// 确认收货
comfirmRevice(data) {
return api.post({
method: `scrm.api.equity.h5.order.finish.confirm`,
...data
})
},
// 查询热线电话
hotLine(data) {
return api.post({
method: `scrm.api.equity.service.package.merchant.hotline.get`,
...data
})
},
// 查询商户信息
getMerchantInfo(data) {
return api.post({
method: `scrm.api.equity.common.merchant.detail.det`,
...data
})
},
// 查询是否开通售前权益配置
preSaleSetting(data) {
return api.post({
method: `scrm.api.equity.service.merchant.config.get`,
...data
})
},
// 生成理赔核销码
createdQrCode(data) {
return api.post({
method: `scrm.api.equity.service.order.h5.writeOff.code.generate`,
...data
})
},
// 新增救援服务线索
addClueRescue(data) {
return api.post({
method: `scrm.api.carlife.weapp.clue.rescue`,
...data
})
},
// 获取权益功能菜单
equityFnMenu(data) {
return api.post({
method: `scrm.api.equity.main.page.third.equity.get`,
...data
})
},
// 会员套餐列表
equityPacks(data) {
return api.post({
method: `scrm.api.equity.main.page.group.package.get`,
...data
})
},
// 会员开通记录
equityOpenNote(data) {
return api.post({
method: `scrm.api.equity.card.user.record`,
...data
})
},
// 会员套餐服务列表
equityServices(data) {
return api.post({
method: `scrm.api.equity.package.service.list`,
...data
})
},
// 新版购买权益卡+套餐
equityBuy(data) {
return api.post({
method: `scrm.api.equity.merchant.order.gh.create`,
...data
})
},
// 新版查看已购买套餐
checkHaveBuyPackage(data) {
return api.post({
method: `scrm.api.equity.package.info.list.with.account`,
...data
})
},
// 会员商城专区
getZoneInfo(data) {
return api.post({
method: `scrm.api.shopmall.zoneInfo.weapp.listByMerchantId`,
...data
})
},
// 购买套餐默认回显上次填写的车牌号(只查车牌号不查车架号)
getLastBindPlatNum(data) {
return api.post(
{
method: `scrm.api.equity.merchant.order.bind.car.record`,
...data
},
true
)
},
// 集团套餐详情
equityJTpackageDetail(data) {
return api.post({
method: `scrm.api.equity.main.page.group.package.detail`,
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.'
module.exports = {
/**获取商户小程序首页配置 */
getHomeConfig(data) {
return api.post({ method: `${path}weapp.homeConfig.getByMerchant`, ...data })
},
/**查询当前商户的分类列表 */
getClassifyList(data) {
return api.post({ method: `${path}classify.weapp.listByMerchantId`, ...data })
},
/**获取附近商户接口 */
getMerchantList(data) {
return api.post({ method: `scrm.api.carlife.merchant.recently.merchant`, storeCount: 10, ...data })
},
/** 分页查询活动 */
getActivityList(data) {
return api.post({ method: `${path}weapp.activity.page`, pageSize: 10, ...data })
},
/**分页查询直播 */
getLiveList(data) {
return api.post({ method: `scrm.api.live.weapp.live.page`, pageSize: 10, ...data })
},
/** 广汇获取城市列表 */
getCityList() {
return api.post({ method: 'scrm.api.carlife.cgacar.api.cities' })
},
/** 广汇获取车辆品牌列表 */
getBrandList() {
return api.post({ method: 'scrm.api.carlife.cgacar.api.brands' })
},
/** 广汇获取门店列表 */
getGHStoreList(data) {
return api.post({ method: 'scrm.api.carlife.cgacar.api.stores', pageSize: 10, ...data })
},
/** 创建维保预约单接口 */
createMaintainOrder(data) {
return api.post({ method: 'scrm.api.carlife.cgacar.commom.maintain.create', ...data })
},
/**新车频道 */
/**获取品牌列表 */
newBrandList(data) {
return api.post({ method: 'scrm.api.carlife.weapp.clue.vehicle.brandList', ...data })
},
/**获取车系列表 */
newCarSeriesList(data) {
return api.post({ method: 'scrm.api.carlife.weapp.clue.vehicle.seriesList', ...data })
},
/**获取车型列表 */
newCarTypeList(data) {
return api.post({ method: 'scrm.api.carlife.weapp.clue.vehicle.shapeList', ...data })
},
/**新增试驾预约 */
addAppointment(data) {
return api.post({ method: 'scrm.api.carlife.weapp.clue.drive.add', ...data })
},
/**新增新车询价 */
addNewCarEnquiry(data) {
return api.post({ method: 'scrm.api.carlife.weapp.clue.newCar', ...data })
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.weapp.'
const carlife = 'scrm.api.carlife.weapp.'
const carlifeApi = {
/** 获取车品牌列表 */
getCarBrandList() {
return api.post({
method: 'scrm.api.carlife.common.getOnlyCarBrandList'
})
},
/** 获取车系列表 */
getCarSeriesList(data) {
return api.post({
method: 'scrm.api.carlife.common.getCarSeriesList',
...data
})
},
/** 获取车型 */
getCarTypeList(carSeriesId) {
return api.post({
method: 'scrm.api.carlife.common.getCarTypeList',
carSeriesId
})
},
/** 获取当前用户的车辆列表 */
getUserCarList(data) {
return api.post({
method: `${carlife}userCar.list`,
...data
})
},
/**新增用户车辆 */
addUserCar(data) {
return api.post({
method: `${carlife}userCar.add`,
...data
})
},
/** 更新用户车辆 */
updateUserCar(data) {
return api.post({
method: `${carlife}userCar.update`,
...data
})
},
/** 获取用户车辆 */
getUserCar(carId) {
return api.post({
method: `${carlife}userCar.getById`,
carId
})
},
/**删除用户车辆 */
delUserCar(carId) {
return api.post({
method: `${carlife}userCar.delete`,
carId
})
},
/**获取当前用户的收货地址列表 */
getUserAddressList(data) {
return api.post({
method: `${carlife}userAddress.list`,
...data
})
},
/**根据ID获取用户收货地址 */
getUserAddress(data) {
return api.post({
method: `${carlife}userAddress.getById`,
...data
})
},
/** 新增用户收货地址 */
addUserAddress(data) {
return api.post({
method: `${carlife}userAddress.add`,
...data
})
},
/**编辑用户收货地址 */
updateUserAddress(data) {
return api.post({
method: `${carlife}userAddress.update`,
...data
})
},
/** 更改为默认收货地址 */
setUserAddressDefault(data) {
return api.post({
method: `${carlife}userAddress.updateDefault`,
...data
})
},
/** 删除用户收货地址 */
delUserAddress(data) {
return api.post({
method: `${carlife}userAddress.delete`,
...data
})
},
/** 获取用户默认收货地址 */
getUserAddressDefault() {
return api.post(
{
method: `${carlife}userAddress.getDefault`
},
true
)
},
/** 预约历史 */
getAppointmentList(pageNum) {
return api.post({
method: 'scrm.api.carlife.cgacar.commom.list.appointment',
pageNum
})
}
}
module.exports = {
...carlifeApi,
/**获取集团或者门店详细信息 */
getMerchantDetail(data) {
return api.post({
method: 'scrm.api.carlife.merchant.detail',
...data
})
},
/**. 分页查询订单 */
getOrderList(data) {
return api.post({
method: `${path}order.page`,
pageSize: 9999,
...data
})
},
/** 获取用户卷列表 */
getUserCouponList() {
return api.post({
method: 'scrm.api.coupon.user.list',
discountTypes: [3, 7]
})
},
/** 广汇车辆列表接口 */
getGHUserCarList() {
return api.post(
{
method: 'scrm.api.carlife.cgacar.commom.list.veh'
},
true
)
},
/** 广汇客户车辆绑定接口 */
bindGHVehicle(data) {
return api.post(
{
method: 'scrm.api.carlife.cgacar.commom.vehicle.bind',
...data
},
true
)
},
/** 获取广汇用户信息 */
getGHUserInfo() {
return api.post(
{
method: 'scrm.api.carlife.cgacar.commom.user.info.get'
},
true
)
},
/** 获取当前用户顾问配置 */
getConsultantInfo(data) {
return api.post(
{
method: 'scrm.api.carlife.config.consultant.get',
...data
},
true
)
},
/** 获取顾问列表*/
getConsultantList(data) {
return api.post(
{
method: 'scrm.api.carlife.config.consultant.list',
...data
},
true
)
},
// 服务顾问配置更新
updateConsultant(data) {
return api.post({
method: 'scrm.api.carlife.config.consultant.update',
...data
})
}
}
import api from '~/utils/request/request'
module.exports = {
/** 素材发送/阅读埋点 */
viewReadBuriedPoint(params) {
return api.post({
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params],
projectName: 'material'
})
},
/** 素材详情 */
getPsdDetail(data) {
return api.post(
{
method: `marketing.api.material.detail`,
...data,
flag: 1
},
true
)
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.weapp.'
const couponpath = 'scrm.api.coupon.'
const wechatPath = 'scrm.api.wechat.'
module.exports = {
/** 分页查询商城专区的商品信息 */
getGoodsList(data) {
return api.post({
method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage`,
pageNum: 1,
pageSize: 999,
...data
})
},
/** 根据商品ID获取商品 */
getGoodsDetail(id) {
return api.post(
{
method: `${path}goods.getById`,
id,
viewAmount: true
},
true
)
},
/** 添加购物车 */
addShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.add`,
...data
})
},
/** 购物车删除商品 */
delShoppingcart(id) {
return api.post({
method: `${path}shoppingcart.delete`,
id
})
},
/** 分页获取购物车 */
getShoppingcartList() {
return api.post({
method: `${path}shoppingcart.list`
})
},
/** 购物车商品变更(比如修改数量) */
updateShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.update`,
...data
})
},
/**购物车结算 */
settlementShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.settlement`,
...data
})
},
/**根据规格值组合获取规格组合库存及零售价 */
getGoodsSpecificationExtra(data) {
return api.post({
method: `${path}goods.getGoodsSpecificationExtra`,
...data
})
},
/** 创建订单(立即购买) */
createOrder(data) {
return api.post({
method: `${path}order.create`,
...data
})
},
/**创建支付订单(去付款) */
payOrder(data) {
return api.post({
method: `${path}order.createPay`,
...data
})
},
/** 确认收货 */
confirmReceipt(orderCode) {
return api.post({
method: `${path}order.confirmReceipt`,
orderCode
})
},
/**订单详情 */
getOrderDetail(orderCode) {
return api.post({
method: `${path}order.detail`,
orderCode
})
},
/** 申请售后 */
afterSale(data) {
return api.post(
{
method: `${path}orderRefund.apply`,
...data
},
true
)
},
/**活动详情 */
getActivityDetail(id) {
return api.post(
{
method: `${path}activity.detail`,
id
},
true
)
},
/** 直播活动详情 */
getLiveActivityDetail(data) {
return api.post(
{
method: `${path}live.activity.detail`,
...data
},
true
)
},
/**获取订单的售后详情 */
getOrderRefundDetail(orderCode) {
return api.post({
method: `${path}orderRefund.detail`,
orderCode
})
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `${path}orderRefund.addDelivery`,
...data
})
},
/** 获取商品关联优惠券列表 */
getGoodscouponList(id) {
return api.post(
{
method: `${path}goods.user.coupons.get`,
...id
},
true
)
},
/** 领取商品详情优惠券 */
getCoupon(data) {
return api.post(
{
method: `${couponpath}customer.receive`,
...data
},
true
)
},
/** 领取确认订单最大优惠券 */
getMaxCoupon(orderGoods) {
return api.post(
{
method: `${path}order.coupons.get`,
orderGoods
},
true
)
},
/**更换优惠券*/
updateCoupon(orderGoods) {
return api.post(
{
method: `${path}order.coupons.change`,
orderGoods
},
true
)
},
//立即评价
addComment(data) {
return api.post(
{
method: `${path}orderGoodsComment.saveByOrder`,
...data
},
true
)
},
//评论列表
getCommentList(data) {
return api.post(
{
method: `${path}orderGoodsComment.page`,
...data
},
true
)
},
//获取订单的评论详情
getOrderCommentDetails(orderCode) {
return api.post(
{
method: `${path}orderGoodsComment.customerOrderGoodsComment`,
orderCode
},
true
)
},
//取消付款
cancelPay(orderCode) {
return api.post(
{
method: `${path}order.cancelPay`,
orderCode
},
true
)
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.post(
{
method: `${path}orderRefund.cancel`,
orderCode
},
true
)
},
/** 直播活动详情id */
getLiveActivityId(id) {
return api.post(
{
method: `${wechatPath}get.scene.by.id`,
...id
},
true
)
},
/** 获取活动分享链接 */
getActivitylink(id) {
return api.post(
{
method: `scrm.api.shopmall.activity.get.shared`,
id
},
true
)
},
/** 获取商品分享链接 */
getGoodslink(id) {
return api.post(
{
method: `scrm.api.shopmall.goods.get.shared`,
id
},
true
)
},
// scrm.api.shopmall.weapp.
requestSubscribeMessage() {
return api.post(
{
method: `scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds`
},
true
)
},
/** 小程序端根据优惠券id查询可使用商品列表(分页) */
getCouponGoodsPage(data) {
// let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// if (merchantId) data.merchantId = merchantId
data.pageSize = 8
return api.post({
method: 'scrm.app.shopmall.coupon.goods.page',
...data
})
}
}
import api from '~/utils/request/request'
module.exports = {
/** sop用户行为记录(埋点调用)
*/
customerBehavior(data) {
return api.post({
method: 'scrm.api.sop.task.customerBehavior.add',
flag: 1,
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.sso.weapp.'
module.exports = {
/**wx.login登录 */
jsCodeLogin(data) {
return api.post(
{
method: `${path}jscode.login`,
...data
},
true
)
},
/**授权用户信息 */
authUserInfo(data) {
return api.post(
{
method: 'scrm.api.sso.weapp.auth.userinfo',
...data
},
true
)
},
/**授权手机号 */
authUserPhone(data) {
return api.post(
{
method: `${path}auth.phone`,
...data
},
true
)
},
/**退出 */
logout() {
return api.post(
{
method: `scrm.api.sso.user.logout`
},
true
)
},
//保存用户授权信息
saveuserProfile(data) {
return api.post(
{
method: `scrm.api.wechat.auth.userProfile.save`,
...data
},
true
)
},
/**更新客户手机号 */
updataCustomerPhone(data) {
return api.post({
method: `scrm.api.sso.weapp.mark.phone`,
...data
})
}
}
// import api from '../api/request'
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
class UsersApi {
/**调用后台接口获取用户信息 */
async login() {
return this.getWxCode().then(({ code }) => {
return api.post(
{
method: 'scrm.api.sso.weapp.jscode.login',
appId,
code
},
true
)
})
}
/**调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 */
getWxCode() {
return new Promise((resolve, reject) => {
wx.login({
success: res => resolve(res),
fail: err => reject(err)
})
})
}
/**授权手机号 */
async authUserPhone(detail, sessionId) {
if (!sessionId) {
wx.$util.showToast('缺少sessionId')
Promise.reject()
}
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject()
delete detail.errMsg
if (detail.iv && detail.encryptedData) {
wx.$util.showLoading()
detail.sessionId = sessionId
return api.post(
{
method: 'scrm.api.sso.weapp.auth.phone',
...detail
},
true
)
} else Promise.reject()
}
/**更新客户手机号 */
updataCustomerPhone() {
let customerId = wx.$storage.get('srcm_shopmall_customer_id'),
merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
api
.post({
method: 'scrm.api.sso.weapp.mark.phone',
customerId,
merchantId
})
.then(() => {
wx.removeStorageSync('srcm_shopmall_customer_id')
})
}
}
export default UsersApi
import UsersApi from './UsersApi.js'
export default new UsersApi()
\ No newline at end of file
// app.js
import util from './utils/util.js'
import '~/router/routerBefore.js'
import router from './router/index.js'
// 有问题 前后顺序不能随意调整
import { ssoApi, commonApi, shopmallApi } from './api/api'
import { filterUrlParam } from '~/utils/routerApi'
import { setUserInfo, setSessionId } from '~/utils/cache/userInfo'
import { setSystem_info } from '~/utils/cache/storageApi'
// console.log(setSystem_info)
// 判断小程序是否需要更新
import getUpdateManager from './utils/lib/wxUpdateManager'
// 埋点
import './utils/track/Track'
import eventbus from './utils/evenbus'
// 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api
import { promisifyAll } from './utils/lib/wx-promise-pro'
promisifyAll()
// promisify(wx.getSystemInfo)().then(console.log)
// 实例化对象存储
import { Storage } from './utils/cache/storage'
const $Storage = new Storage()
App({
onLaunch(options) {
/**挂载到wx对象 */
wx.$authStatus = false
wx.$util = util
wx.$router = router
wx.$storage = $Storage /** 挂载全局缓存方法 */
wx.$eventbus = eventbus
// 存储设备信息
setSystem_info()
},
onShow(options) {
getUpdateManager()
},
/**页面不存在时触发 */
onPageNotFound(e) {
wx.$router.goHome()
},
onHide() {},
globalData: {
}
})
{
"pages": ["pages/tab/index/index", "pages/tab/equity/equity", "pages/tab/discovery/discovery", "pages/tab/mall/mall", "pages/tab/mine/mine", "pages/webView/webView", "pages/h5Pay/h5Pay", "pages/blank/blank", "pages/relogin/relogin", "pages/serviceCode/serviceCode", "pages/psdView/psdView"],
"requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#979899",
"selectedColor": "#FC5B32",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home_active.png",
"rootName": "packageIndex"
},
{
"pagePath": "pages/tab/equity/equity",
"text": "权益",
"iconPath": "images/equity.png",
"selectedIconPath": "images/equity_active.png",
"rootName": "packageEquity"
},
{
"pagePath": "pages/tab/mall/mall",
"text": "商城",
"iconPath": "images/mall.png",
"selectedIconPath": "images/mall_active.png",
"rootName": "packageMall"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/mine.png",
"selectedIconPath": "images/mine_active.png",
"rootName": "packageMine"
}
]
},
"subpackages": [],
"usingComponents": {
"upload": "/components/Upload/Upload",
"coupon-goods": "/components/CouponGoods/CouponGoods",
"store": "/components/Store/Store",
"marquee": "components/Marquee/Marquee",
"tab-view": "components/TabView/TabView",
"authorize": "components/Authorize/Authorize",
"gl-textarea": "/components/GlTextarea/GlTextarea",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"search-box": "/components/SearchBox/SearchBox",
"goods": "/components/Goods/Goods",
"activity": "/components/Activity/Activity",
"tab": "/components/Tab/Tab",
"live": "/components/Live/Live",
"posts": "/components/Posts/Posts",
"goods-action": "/components/GoodsAction/GoodsAction",
"sku": "/components/Sku/Sku",
"stepper": "/components/Stepper/Stepper",
"gh-car-card": "/components/GHCarCard/GHCarCard",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"index-list": "/components/IndexList/IndexList",
"login": "/components/Login/Login",
"license-plate": "/components/LicensePlate/LicensePlate",
"calendar": "/components/Calendar/Calendar",
"merchant-list": "/components/MerchantList/MerchantList",
"various-pop": "/components/VariousPop/VariousPop"
},
"style": "v2",
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins": {}
}
@import "/common.wxss";
@import "/sprite.wxss";
page {
background-color: #F7F7F7;
color: #282829;
font-size: 28rpx;
--themeColor: #F13C3D;
--btnColor: #FC5B32;
--borderRadius: 8rpx;
--margin: 32rpx;
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
transform: translateY(7rpx);
}
\ No newline at end of file
/**app.wxss**/
.sticky {
position: sticky;
top: 0;
left: 0;
z-index: 2;
background-color: #fff;
}
.flex-center {
display: flex;
align-items: center;
justify-content: start;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.isFullSucreen {
/* padding-bottom: 34px !important; */
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen-bottom {
bottom: constant(safe-area-inset-bottom) !important;
bottom: env(safe-area-inset-bottom) !important;
}
.default-btn {
width: 686rpx;
height: 88rpx;
background: var(--btnColor);
border-radius: var(--borderRadius);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--margin);
}
.list-nothing {
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 28rpx;
color: #C1C2C3;
}
.list-nothing .icon {
width: 320rpx;
height: 320rpx;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: 24rpx;
height: 100%;
}
@keyframes show-box {
0% {
opacity: 0;
transform: scale(2.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes show-box-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
\ No newline at end of file
// components/Authorize/Authorize.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
scopeType: String,
/**是否自动打开 */
autoOpen: Boolean,
show: Boolean,
title: {
type: String,
value: '是否打开授权设置?'
},
confirmText: {
type: String,
value: '确定'
},
cancelText: {
type: String,
value: '取消'
},
buttonType: String,
confirmColor: String,
cancelColor: String,
isShowCheck: {
type: Boolean,
value: true
},
init: {
type: Boolean,
observer(n) {
if (n) this.check()
}
}
},
observers: {
'show': function (newVal) {
this.setData({
openSet: newVal
})
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
/**
* 禁止滑动
*/
noScroll: wx.$util.noScroll(),
cancel(e) {
let {
confirm
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let _this = this
if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({
desc: title,
success(res) {
_this.triggerEvent('success', {
message: '授权成功',
data: res
})
}
})
}
this.setData({
openSet: false
})
this.triggerEvent('cancel')
},
/**检验是否已授权位置 */
check() {
const _this = this
let {
buttonType,
scopeType,
autoOpen
} = this.properties
if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}`
buttonType = 'openSetting'
if (type === 'scope.userInfo') buttonType = 'getUserInfo'
this.setData({
buttonType
})
wx.getSetting({
success(res) {
if (!res.authSetting[type]) {
wx.authorize({
scope: type,
success() {
_this.triggerEvent('success', {
message: '授权成功'
})
},
fail() {
_this.triggerEvent('fail', {
message: '未授权'
})
if (autoOpen) {
_this.setData({
openSet: true
})
}
}
})
} else {
_this.triggerEvent('success', {
message: '已授权'
})
}
}
})
}
},
/**授权手机号 */
getPhoneNumber({
detail
}) {
console.log(detail)
this.triggerEvent('getphonenumber', detail)
}
},
pageLifetimes: {
show: function () {
if (this.data.isShowCheck || this.data.init) this.check()
},
hide: function () {}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="open-seting-bg text-center" wx:if="{{openSet}}" catchtap="cancel" catchtouchmove="noScroll">
<view class="open-set-inner">
<view class="set-title"><text>{{title}}</text></view>
<view class="btn-openset">
<view catchtap="cancel" class="btn text-center" style="color:{{cancelColor}};">{{cancelText}}</view>
<view class="btn text-center" style="color:{{confirmColor}};">
{{confirmText}}
<block wx:if="{{buttonType == 'getPhoneNumber'}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-style"></button>
</block>
<block wx:else>
<button open-type="{{buttonType}}" class="button-style" catchtap="cancel" data-confirm></button>
</block>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/Authorize/Authorize.wxss */
.open-seting-bg {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 998;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.open-set-inner {
width: 564rpx;
height: 400rpx;
background: #FFFFFF;
border-radius: 16px;
}
@keyframes show-auth-box {
0% {
opacity: 0;
transform: scale(2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.set-title {
font-size: 36rpx;
min-height: 286rpx;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
flex-direction: column;
}
.btn-openset {
display: flex;
font-size: 36rpx;
height: 112rpx;
border-top: 2rpx solid #E5E5E5;
font-weight: 500;
letter-spacing: 1rpx;
}
.btn {
flex: 1;
height: 100%;
position: relative;
}
.button-style {
position: absolute;
width: 100% !important;
height: 100%;
box-sizing: border-box;
opacity: 0;
top: 0;
left: 0;
}
\ No newline at end of file
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
import {componentsMixin } from '../../mixins/index'
Component({
behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = e && e.currentTarget && e.currentTarget.dataset.type || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
},
dateChange(e) {
let {
current
} = e.detail
this.setData({
current
})
},
choose(e) {
let {
dateType,
minDate,
maxDate
} = this.data
let {
data
} = e.currentTarget.dataset
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
done() {
let {
dateType
} = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
this.setData({
current: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
}
},
attached() {
this[CalendarFunction] = new Calendar(this)
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<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
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 99;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 24rpx;
transform: translateY(-50%);
font-size: 20rpx;
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: rgba(0, 0, 0, .1);
text-shadow: 0 4rpx 20rpx rgba(0, 0, 0, .1);
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 8rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file
const _CalendarObject_ = Symbol('_CalendarObject_')
const _nowDate_ = Symbol('_nowDate_')
const _separator_ = Symbol('_separator_')
class Calendar {
[_CalendarObject_] = {};
[_nowDate_] = new Date();
[_separator_] = '-';
constructor(calendarObject) {
this[_CalendarObject_] = calendarObject
this[_separator_] = calendarObject.data.separator
this.setCalenderHeight()
this.setMonthList()
let {
weekdays,
firstDayOfWeek
} = calendarObject.data
let firstDay = weekdays[firstDayOfWeek - 1]
let [last, first] = weekdays.join('').split(firstDay)
calendarObject.setData({
weekdays: [firstDay, ...first, ...last]
})
}
/**设置日历高度 */
setCalenderHeight() {
let _this = this[_CalendarObject_]
let {
data: calenderHeight
} = _this
let height = '80%'
if (typeof calenderHeight === 'number') {
wx.$util.getPhoneInfo(res => {
let {
windowHeight
} = res
if (calenderHeight > windowHeight) calenderHeight = windowHeight
if (calenderHeight < windowHeight * 0.5) calenderHeight = windowHeight * 0.5
height = `${calenderHeight}px`
})
}
if (typeof calenderHeight === 'string') {
if (calenderHeight.includes('%')) {
height = calenderHeight
let [num] = calenderHeight.split('%')
if (num < 50) height = '50%'
if (num > 100) height = '80%'
} else {
if (calenderHeight < 50) calenderHeight = '50'
if (calenderHeight > 100) calenderHeight = '80'
height = `${calenderHeight}%`
}
}
_this.setData({
height
})
}
/**设置日期高度 */
setCalenderBodyHeight() {
let _this = this[_CalendarObject_]
wx.$util.getViewInfo('.calender-header', header => {
wx.$util.getViewInfo('.calender-footer', footer => {
let headerHeight = header.height
let footerHeight = footer && footer.height || 0
_this.setData({
calenderBodyHeight: `${headerHeight + footerHeight}px`
})
}, _this)
}, _this)
}
/**设置日期列表 */
setMonthList() {
let {
separator,
previous,
minDate,
maxDate,
next
} = this[_CalendarObject_].data
if (maxDate || minDate) {
if (!minDate) {
let nowMonth = new Date().getMonth()
minDate = new Date(new Date().setMonth(nowMonth - previous)).format(`yyyy${separator}MM${separator}dd`)
}
if (!maxDate) {
maxDate = this[_nowDate_].format(`yyyy${separator}MM${separator}dd`)
}
previous = this.getMonthDifference(minDate, this[_nowDate_].format(`yyyy${separator}MM${separator}dd`))
next = this.getMonthDifference(this[_nowDate_].format(`yyyy${separator}MM${separator}dd`), maxDate)
} else {
previous = previous < 0 ? 0 : previous
next = next < 0 ? 0 : next
}
let nowMonth = this[_nowDate_].getMonth()
let now = new Date().setDate(1)
for (let i = nowMonth - previous; i <= nowMonth + next; i++) {
this.init(new Date(now).setMonth(i))
}
}
/**初始化日期 */
init(date) {
let _this = this[_CalendarObject_]
let {
firstDayOfWeek,
allowSameDay,
multipleDate,
monthList,
rangeDate,
dateList,
dateType,
current,
minDate,
maxDate,
value,
} = _this.data
let separator = this[_separator_]
let [year, month] = new Date(date).format(`yyyy${separator}MM`).split(separator)
let days = this.getDayNumber(year, Number(month))
let week = new Date(year, Number(month) - 1, 1).getDay()
let dateFormat = `yyyy${separator}MM${separator}dd`
let today = value || this[_nowDate_].format(dateFormat)
let nextDay = ''
let arr = []
dateList.push(`${year}${separator}${month}`)
if (dateType === 'range') {
nextDay = new Date(new Date().setDate(new Date(new Date(today)).getDate() + 1)).format(dateFormat)
}
let [now_year, now_month, now_day] = today.split(separator)
let [next_year, next_month, next_day] = allowSameDay ? today.split(separator) : nextDay.split(separator)
for (let i = 1; i <= days; i++) {
let todayStr = `${year}${separator}${month}${separator}${now_day}`
let dayStr = `${year}${separator}${month}${separator}${i < 10 ? `0${i}`:i}`
let obj = {
day: i,
data: dayStr,
active: now_year == year && now_month == month && i == Number(now_day)
}
if ((minDate && Date.parse(minDate) > Date.parse(dayStr)) || (maxDate && Date.parse(maxDate) < Date.parse(dayStr))) obj.disable = true
if (dateType === 'multiple') multipleDate.push(todayStr)
if (nextDay) {
if (now_year == year && now_month == month && i == Number(now_day)) {
obj.start = true
rangeDate.start = todayStr
}
if (next_year == year && next_month == month && i == Number(next_day)) {
obj.active = true
obj.end = true
rangeDate.end = `${year}${separator}${next_month}${separator}${next_day}`
}
}
firstDayOfWeek = firstDayOfWeek == 7 ? 0 : firstDayOfWeek
if (i === 1) obj.week = `week-${week - firstDayOfWeek}`
arr.push(obj)
}
monthList.push({
data: arr,
mark: Number(month)
})
if (current <= 1) {
let [nowYear, nowMonth] = today.split(separator)
current = dateList.findIndex(e => e === `${nowYear}${separator}${nowMonth}`)
}
_this.setData({
multipleDate,
date: today,
rangeDate,
monthList,
dateList,
current
})
}
/**当设置最小日期或者最大日期时 自动设置前后月份 */
getMonthDifference(date1, date2) {
let separator = this[_separator_]
//获取年,月数
let [year1, month1] = date1.split(separator)
let [year2, month2] = date2.split(separator)
let months = (parseInt(year2) - parseInt(year1)) * 12 + (parseInt(month2) - parseInt(month1))
return months
}
/**单选 */
single(e) {
let _this = this[_CalendarObject_]
let {
index,
data,
ind
} = e.currentTarget.dataset
let {
showConfirm,
monthList
} = _this.data
monthList.map(x => {
x.data.map(i => i.active = false)
})
monthList[index].data[ind].active = true
_this.setData({
monthList,
date: data
})
if (!showConfirm) this.done()
}
/**多选 */
multiple(e) {
let _this = this[_CalendarObject_]
let {
index,
ind,
} = e.currentTarget.dataset
let {
monthList
} = _this.data
let arr = []
monthList[index].data[ind].active = !monthList[index].data[ind].active
monthList.map(x => x.data.map(i => {
if (i.active) arr.push(i.data)
}))
_this.setData({
[`monthList[${index}].data`]: monthList[index].data,
multipleDate: arr
})
}
/**范围选择 */
range(e) {
const _this = this[_CalendarObject_]
let {
index,
data,
ind
} = e.currentTarget.dataset
let {
allowSameDay,
showConfirm,
monthList,
rangeDate
} = _this.data
const start = Date.parse(rangeDate.start)
if (rangeDate.end || start > Date.parse(data)) {
monthList = this.clearStatus({
monthList,
index,
ind
})
rangeDate.start = data
rangeDate.end = ''
} else {
if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return
monthList[index].data[ind].active = true
monthList[index].data[ind].end = true
rangeDate.end = data
monthList.map(x => {
x.data.map(i => {
let day = Date.parse(i.data)
i.middle = day > start && day < Date.parse(data)
})
})
}
_this.setData({
monthList,
rangeDate
})
if (!showConfirm && rangeDate.end) this.done()
}
/**点击完成 */
done() {
let _this = this[_CalendarObject_]
let {
multipleDate,
rangeDate,
dateType,
date
} = _this.data
let targer = {
'single': date,
'multiple': multipleDate,
'range': rangeDate
}
if ((dateType === 'multiple' && multipleDate.length < 1) || (dateType === 'range' && !rangeDate.end)) return
_this.triggerEvent('select', {
date: targer[dateType]
})
_this.showCalendar()
}
/**清空范围选择状态 */
clearStatus(params) {
let {
monthList,
index,
ind
} = params
monthList.map(x => x.data.map(i => {
i.active = false
i.start = false
i.end = false
i.middle = false
}))
monthList[index].data[ind].active = true
monthList[index].data[ind].start = true
return monthList
}
/**
* 获取月份天数
*/
getDayNumber(year, month) {
let days = 31
switch (month) {
case 2:
days = (year % 4 == 0 && year % 100 !== 0) || year % 400 == 0 ? 29 : 28
break;
case 4:
case 6:
case 9:
case 11:
days = 30
break;
}
return days
}
/**日期范围 点击全选 */
chooseAll() {
let _this = this[_CalendarObject_]
let {
monthList,
minDate,
maxDate
} = _this.data
monthList.map((e, index) => {
e.data.map((i, ind) => {
let obj = {
currentTarget: {
dataset: {
index,
ind,
data: i.data
}
}
}
if (i.data == minDate) this.range(obj)
if(i.data == maxDate) this.range(obj)
})
})
}
}
export default Calendar
\ No newline at end of file
export default {
properties: {
calenderHeight: {
type:String
// type: [String,Number], 企微暂不支持
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#FC5B32'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single 单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
type: Number,
// type: [Number, String], 企微暂不支持
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: []
}
}
\ No newline at end of file
// components/navigationBar/navigationBar.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
navStyle: String,
custom: Boolean,
pageTitle: {
type: String,
value: '',
observer(n) {
if (n) {
this.title = n
this.setPageTitle()
}
}
}
},
title: '',
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
setPageTitle() {
let thisPage = wx.$router.getPageInstance()
if (thisPage) thisPage.navigationBarTitleText = this.title
},
init() {
/**
* 获取自定义导航栏信息
*/
wx.getSystemInfo().then(res => {
let {
fontSizeSetting,
statusBarHeight,
screenWidth
} = res
const {
height,
right,
width,
top
} = wx.getMenuButtonBoundingClientRect()
let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4
let navigationBarPadding = screenWidth - right
let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width
this.setData({
statusBarHeight,
navigationBarHeight,
navigationBarStyle: `font-size:${fontSizeSetting}px;`,
navigationBarTextWidth: `width:${navigationBarWidth}px;padding:0 ${navigationBarPadding}px;`
})
this.emit({
navigationBarHeight,
statusBarHeight
})
})
},
emit({
navigationBarHeight,
statusBarHeight
}) {
let navHeight = navigationBarHeight + statusBarHeight
const thisPage = wx.$router.getPageInstance()
const currentPages = getCurrentPages()
this.triggerEvent('navbarReady', {
height: navHeight,
statusBarHeight
})
this.setData({
showNavBar: true
})
thisPage.setData({
navHeight,
statusBarHeight
})
if (currentPages.length == 1 && !thisPage.rootName) thisPage.setData({
showHomeBtn: true
})
}
},
lifetimes: {
attached() {
this.init()
this.setPageTitle()
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="navigation-bar" id="navigation-bar"
style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}">
<slot></slot>
</view>
</view>
</block>
<block wx:else>
<slot></slot>
</block>
</view>
\ No newline at end of file
/* components/navigationBar/navigationBar.wxss */
.navigation-bar{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99;
background-color: #fff;
transition: all .15s;
}
.navigation-bar-box{
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.navigation-bar-titleText{
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
box-sizing: border-box;
text-align: center;
letter-spacing: 1rpx;
}
.back-box{
width: 76rpx;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.back{
position: absolute;
left: 20rpx;
top: 50%;
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
}
\ No newline at end of file
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
observer: function (n, o) {
if (!n) {
this.setData({
close: true
})
setTimeout(() => {
this.setData({
showPopup: false
})
}, 0.2 * 1000)
} else {
let hideTab = wx.$hideTab
console.log(hideTab)
this.setData({
showPopup: true,
close: false,
hideTab
})
}
}
},
title: String,
height: {
type: String,
value: '85%'
},
only: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
hidePopup() {
this.setData({
show: false
})
},
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
const {
isTab
} = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
this.setData({
isTab
})
},
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="popup " hidden="{{!showPopup}}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content {{close?'close':''}}" style="height:{{height}}">
<block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view>
</block>
<view class="popup-slot {{isTab && !hideTab? '': title?'isFullSucreen':'isFullSucreen-notitle'}}">
<slot></slot>
</view>
<view class="popup-footer {{isTab && !hideTab?'':'isFullSucreen'}}" wx:if="{{only}}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确认</view>
</view>
<view class="popup-footer {{isTab && !hideTabb?'':'isFullSucreen'}}" wx:else>
<view class="confirm doubtn text-center" bindtap="confirm">确认</view>
</view>
</view>
</view>
\ No newline at end of file
/* tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.wxss */
.popup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
}
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.popup-content {
position: absolute;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
animation: show-popup .2s forwards;
box-sizing: border-box;
}
.popup-content.close {
animation: hide-popup-box .5s forwards;
}
.popup-title {
height: 98rpx;
font-size: 32rpx;
color: #333333;
border-bottom: 2rpx solid #EBEDF0;
}
.popup-slot {
height: calc(100% - 200rpx);
}
.popup-slot.isFullSucreen {
height: calc(100% - 258rpx);
}
.popup-slot.isFullSucreen-notitle {
height: calc(100% - 158rpx);
}
.popup-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 32rpx;
position: relative;
background-color: #fff;
z-index: 2;
}
.popup-footer.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.popup-footer .btn {
width: 330rpx;
height: 80rpx;
box-sizing: border-box;
border-radius: 12rpx;
font-size: 28rpx;
}
.popup-footer .doubtn {
width: 670rpx;
height: 80rpx;
box-sizing: border-box;
border-radius: 12rpx;
font-size: 28rpx;
}
.popup-footer .cancel {
color: #323233;
border: 2rpx solid #DCDEE0;
}
.popup-footer .confirm {
background: var(--btnColor);
color: #fff;
}
@keyframes show-popup {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
@keyframes hide-popup-box {
0% {
bottom: 0;
}
100% {
bottom: -100%;
}
}
\ No newline at end of file
// components/SearchBox/SearchBox.js
import {componentsMixin } from '../../mixins/index';
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
placeholder: {
type: String,
value: "请输入搜索内容",
},
value: {
type: String,
value: "",
observer(n) {
this.setData({
inputValue: n,
});
},
},
searchType: {
type: Number,
value: 1,
},
couponDetails: Boolean,
},
/**
* 组件的初始数据
*/
data: {
inputValue: "",
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail;
this.setData({
inputValue: value,
});
},
blur(e) {
let { inputValue } = this.data;
this.setData({
inputValue,
});
},
clear() {
this.setData({
inputValue: "",
});
},
confirm(e) {
let { value } = e.detail;
this.triggerEvent("search", value);
},
search(e) {
let { value } = e.currentTarget.dataset;
this.triggerEvent("search", value);
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="search-box box-center">
<view class="search type-{{searchType}}">
<view class="input-box" style="{{couponDetails?'width: 528rpx;':''}}">
<view class="icon box-center">
<icon type="search" size="20"></icon>
</view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder" placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}">
<view class="clear-box" bindtap="clear">
<view class="sprite-icon icon-clear"></view>
</view>
</block>
</view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view>
</view>
</view>
\ No newline at end of file
/* components/SearchBox/SearchBox.wxss */
@import '/sprite.wxss';
.search-box {
height: 104rpx;
box-sizing: border-box;
padding: 0 var(--margin);
background-color: #fff;
}
.box-center {
display: flex;
align-items: center;
justify-content: center;
}
.search {
width: 100%;
height: 72rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.type-1 {
padding: 0 6rpx;
border-radius: 38px;
border: 3rpx solid var(--btnColor);
}
.type-1 .button {
width: 104rpx;
height: 60rpx;
border-radius: 38rpx;
background-color: var(--btnColor);
color: #fff;
font-size: var(--margin);
}
.type-1 .input-box {
width: calc(100% - 110rpx);
display: flex;
align-items: center;
}
.input-box .icon {
width: 58rpx;
}
.type-1 .input-box .input,
.type-2 .input-box .input {
width: calc(100% - 130rpx);
font-size: 28rpx;
}
.input-box .clear-box{
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.input-box .clear-box .icon-clear{
opacity: .7;
}
.type-2 .input-box {
display: flex;
align-items: center;
width: 592rpx;
height: 100%;
background: #F8F8F8;
border-radius: 38rpx;
}
.type-2 .button {
color: #656566;
font-size: var(--margin);
}
.input-placeholder {
color: #CFCFCF;
font-size: 28rpx;
}
\ No newline at end of file
// components/SearchInput/SearchInput.js
import {componentsMixin } from '../../mixins/index'
Component({
behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
properties: {
maxlength: {
type: Number,
value: -1
},
placeholder: String,
disabled: Boolean,
value: String,
filterEmoji: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
setValue(value) {
if (this.properties.filterEmoji) {
if (wx.$util.haveEmoji(value)) value = wx.$util.replaceEmoji(value)
}
this.setData({
value
})
},
input(e) {
let {
value
} = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
},
inputBlur(e) {
this.emit(e)
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail:{
value
},
type
} = e
this.setData({
edit: false
})
this.setValue(value)
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', {
value
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="search-box">
<view class="search-input">
<input type="text" maxlength="{{maxlength}}" class="input" value='{{value}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm" placeholder=" {{placeholder||'查找'}}" placeholder-class="placeholder" />
<block wx:if="{{!value}}">
<view class="icon">
<icon type="search" size="14"></icon>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* components/SearchInput/SearchInput.wxss */
.search-box {
height: 104rpx;
border-bottom: 2rpx solid #EBEDF0;
margin: 0 32rpx;
font-size: 28rpx;
padding-top: 16rpx;
box-sizing: border-box;
}
.search-box .search-input {
width: 686rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 38rpx;
color: #333;
position: relative;
}
.search-input .input {
height: 100%;
width: 100%;
text-align: center;
}
.search-input .icon {
width: 28rpx;
height: 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-200%, -50%);
}
.search-input .placeholder {
color: #C8C9CC;
text-align: center;
}
\ No newline at end of file
// components/Tab/Tab.js
import {componentsMixin } from '../../mixins/index'
Component({
behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
properties: {
tab: Array,
openScroll: Boolean,
index: {
type: Number,
observer: function (n) {
this.setData({
count: n,
to: `to-${n}`
})
}
},
align: {
type: String,
default: ''
}
},
/**
* 组件的初始数据
*/
data: {
count: 0,
to: ''
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
count
} = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`
})
this.triggerEvent('click', count)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" >
<view class="text" >{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line"></view>
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="tab-box flex">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}">
<view class="text text-center">{{item}}</view>
<view class="line"></view>
</view>
</block>
</view>
</block>
\ No newline at end of file
/* components/Tab/Tab.wxss */
@import "../../common.wxss";
.tab-box {
display: flex;
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left{
padding-left: 32rpx;
}
.left .tab{
padding-right:40rpx;
}
.flex .tab {
flex: 1;
}
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
align-items: center;
box-sizing: border-box;
color: #A9A9A9;
justify-content: center;
}
.left .text{
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab.active .text {
font-weight: 500;
font-size: 28rpx;
transition: all .25s;
color: #2C2C2C;
}
.tab .line {
width: 48rpx;
height: var(--borderRadius);
background: var(--btnColor);
border-radius: 2rpx;
margin: 0 auto;
transform: scale(0);
transition: all .25s;
}
.tab.active .line {
transform: scale(1);
}
.tab-box::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
\ No newline at end of file
images/mall.png

928 Bytes

module.exports = {
}
\ No newline at end of file
{
"usingComponents": {
"coupons-dialog": "../../../components/CouponsDialog/index",
"index-merchant": "../../../components/IndexMerchant/IndexMerchant"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"backgroundColor": "#FC5B32",
"enablePullDownRefresh": true
}
/* pages/tab/index/index.wxss */
// @import "index.skeleton.wxss";
page {
background-color: #fff;
height: 101%;
.logo {
position: absolute;
width: 218rpx;
height: 50rpx;
top: 50%;
left: 26rpx;
}
}
.flex {
display: flex;
align-items: center;
}
.merchant-switch {
position: absolute;
width: 128rpx;
height: 36rpx;
background: rgb(255, 255, 255, .2);
border-radius: 4rpx;
font-size: 22rpx;
color: #FFFFFF;
top: 50%;
left: 256rpx;
justify-content: center;
.icon {
margin-left: 4rpx;
width: 16rpx;
height: 16rpx;
}
}
// .merchant-switch
.layout {
padding-bottom: 40rpx;
position: relative;
}
.bg-box {
width: 100%;
height: 446rpx;
overflow: hidden;
position: absolute;
left: 0;
}
.bg-box .merchant-name {
font-size: 28rpx;
color: #FFFFFF;
position: absolute;
left: 32rpx;
}
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
.banner {
padding: 60rpx 32rpx 12rpx;
position: relative;
height: 300rpx;
overflow: hidden;
position: relative;
border-radius: 16rpx;
}
.banner .swiper {
height: 100%;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
position: relative;
transform: translateY(0);
}
.banner .swiper.border {
border: 16rpx solid #fff;
box-sizing: border-box;
background: #D6D6D6;
height: 300rpx;
}
.banner .swiper .logo {
left: 50%;
}
.banner .swiper-item,
.banner .banner-img {
border-radius: 16rpx;
overflow: hidden;
}
.banner .banner-dots {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 44rpx;
left: 0;
}
.banner .banner-dots .dots {
width: 12rpx;
height: 4rpx;
margin: 0 6rpx;
background-color: rgba(255, 255, 255, .3);
transition: all .5s;
}
.banner .banner-dots .dots.active {
background-color: #fff;
}
.marquee {
color: #414142;
height: 74rpx;
}
.util-box {
display: grid;
align-items: center;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx 0;
padding-bottom: 48rpx;
}
.util-box .item {
display: flex;
align-items: center;
flex-direction: column;
font-size: 24rpx;
color: #282829;
}
.util-box .item .sprite-icon {
margin-bottom: 12rpx;
}
.tips-box {
justify-content: center;
margin-bottom: 32rpx;
color: rgba(33, 33, 33, .6);
font-size: 24rpx;
}
.tips-box .item {
margin: 0 20rpx;
}
.tips-box .sprite-icon {
margin-right: 10rpx;
}
.equity-banner {
height: 230rpx;
margin: 0 32rpx 24rpx;
border-radius: 8rpx;
overflow: hidden;
}
.activity-box,
.goods-box .goods-content .goods-item {
padding: 32rpx 32rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.goods-box .goods-content .goods {
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.live-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 22rpx;
padding: 20rpx 0;
}
.live-item .live-preview {
position: relative;
width: 332rpx;
height: 168rpx;
border-radius: var(--borderRadius);
overflow: hidden;
}
.live-item .live-preview .tips {
position: absolute;
left: 0;
top: 0;
height: 24rpx;
display: flex;
align-items: center;
color: #FFFFFF;
border-radius: 0 0 8rpx 0;
overflow: hidden;
}
.live-item .live-preview .tips .value {
height: 24rpx;
font-size: 20rpx;
padding: 0 8rpx;
background: rgba(0, 0, 0, .59);
}
.live-item .live-preview .tips .label {
width: 64rpx;
font-size: 20rpx;
height: 100%;
}
.live-item .live-preview .in-live .label {
font-size: 16rpx;
background-color: var(--themeColor);
}
.live-item .live-preview .prediction .label {
background-color: var(--btnColor);
}
.live-item .live-preview .in-live .label image {
width: 10rpx;
height: 10rpx;
margin-right: 6rpx;
}
.live-item .live-info {
display: flex;
align-items: center;
margin-top: 20rpx;
}
.live-item .live-info .icon {
width: 48rpx;
height: 48rpx;
overflow: hidden;
border-radius: 100%;
margin-right: 24rpx;
}
.live-item .live-info .live-title {
width: 258rpx;
}
.goods-box,
.goods-box .goods-content .goods-item {
animation: show-box-opacity .5s forwards;
position: relative;
}
.anchor {
position: absolute;
}
.goods-box .goods-content {
/* min-height: 1254rpx; */
padding-bottom: 60rpx;
}
.goods-box .goods-content .page {
display: flex;
}
.goods-box .goods-content swiper {
height: 1104rpx;
}
.goods-box .btn {
margin: 60rpx auto 0;
border: 2rpx solid #979797;
border-radius: 4rpx;
width: 182rpx;
height: 54rpx;
font-size: 24rpx;
color: #656566;
}
.goods-box .btn .icon-mine-arrow {
margin-left: 12rpx;
}
.nothing {
flex-direction: column;
font-size: 28rpx;
color: #C1C2C3;
}
.nothing .icon {
width: 320rpx;
height: 320rpx;
margin-bottom: 8rpx;
}
.widget-box {
position: fixed;
right: 40rpx;
bottom: 232rpx;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: flex-end;
}
.widget {
height: 140rpx;
width: 112rpx;
box-sizing: border-box;
}
.widget-box .open {
position: relative;
z-index: 2;
}
/* @keyframes move {
0% {
transform: translateX(320rpx);
}
100% {
transform: translateX(80rpx);
}
} */
.widget .icon {
width: 100%;
height: 200%;
position: relative;
}
.online-text {
position: absolute;
top: 74rpx;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 28rpx;
font-size: 20rpx;
}
.widget-box .flex-box {
position: relative;
display: flex;
border-radius: var(--borderRadius);
padding: 10rpx 20rpx 10rpx 100rpx;
/* background: linear-gradient(201deg, #7BA6FF 0%, #1C72FB 100%); */
box-sizing: border-box;
animation: showFlex .5s forwards;
font-size: 20rpx;
justify-content: space-between;
width: 320rpx;
}
.widget-box .flex-box .view {
opacity: 0;
animation: showView .1s forwards .5s;
}
@keyframes showFlex {
0% {
right: -1000%;
}
100% {
right: 0;
}
}
@keyframes showView {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.close-icon {
width: 48rpx;
height: 48rpx;
position: absolute;
right: 90rpx;
top: 260rpx;
}
.close-icon image {
width: 48rpx;
height: 48rpx;
}
.model .bgkf {
width: 602rpx;
height: 862rpx;
position: absolute;
top: 328rpx;
left: 50%;
transform: translateX(-50%);
z-index: 99999;
}
.model .qr-box {
height: 686rpx;
width: 418rpx;
bottom: 96rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
}
.model .bgkf .icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.model .bgkf .icon image {
border-radius: 50%;
}
.userinfo-wrap {
position: absolute;
top: 0rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
flex-direction: column
}
.qr-box .text {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.qr-box .name {
font-size: 28rpx;
font-weight: 400;
color: #282829;
line-height: 40rpx;
margin: 8rpx 0 0 0;
text-align: center;
}
.qr-box .qr-icon {
width: 418rpx;
height: 492rpx;
margin-top: 50rpx;
position: relative;
}
.qr-box .qr-code {
width: 220rpx;
height: 220rpx;
margin-top: 104rpx;
}
.kf-text {
width: 348rpx;
height: 112rpx;
position: absolute;
z-index: 999998;
margin-top: 30rpx;
}
.kf-text image {
widows: 100%;
height: 100%;
}
\ No newline at end of file
<!--
此文件为开发者工具生成,生成时间: 2022/5/27 下午4:06:14
使用方法:
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxml 引入模板
```
<import src="index.skeleton.wxml"/>
<template is="skeleton" wx:if="{{loading}}" />
```
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
-->
<template name="skeleton">
<view class="sk-container">
<view is="components/NavigationBar/NavigationBar">
<view class="NavigationBar--navigation-bar" id="b58dacbb--navigation-bar" style="padding-top:44px;height:44px;background-color: transparent;">
<view class="NavigationBar--navigation-bar-box" style="font-size:16px;">
<view class="NavigationBar--navigation-bar-titleText" style="width:187px;padding:0 7px;">
<view class="logo y-center" hidden="{{skeletonData.logo}}">
<image webp="true" data-name="logo" class="sk-image"></image>
</view>
</view>
</view>
</view>
</view>
<view class="layout" style="top:{{navHeight}}px">
<view class="bg-box" style="height:{{270 + navHeight * 2}}rpx;top:-{{navHeight}}px" hidden="{{skeletonData.bg}}">
<view class="bg">
<image webp="true" data-name="bg" class="sk-image"></image>
</view>
</view>
<view class="banner" hidden="{{skeletonData.homeConfig}}">
<swiper autoplay="false" circular="true" class="swiper" interval="5000" current="0"></swiper>
<view class="banner-dots">
<view class="dots"></view>
<view class="dots"></view>
<view class="dots active"></view>
<view class="dots"></view>
<view class="dots"></view>
</view>
</view>
<view class="tips-box flex" hidden="{{skeletonData.utilList}}">
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-0 sk-image"></view>
品质无忧
</view>
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-1 sk-image"></view>
服务保障
</view>
<view class="item flex sk-transparent">
<view class="sprite-icon icon-home-tips-2 sk-image"></view>
省时省心
</view>
</view>
<view class="util-box" hidden="{{skeletonData.utilList}}">
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-shopmall sk-image"></view>
汇划算商城
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-coupon sk-image"></view>
门店卡券
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-navigation sk-image"></view>
服务网点
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-gps sk-image"></view>
爱车保镖
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-road sk-image"></view>
救援服务
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-reservation sk-image"></view>
维保预约
</view>
<view class="item sk-transparent" data-item="[object Object]">
<view class="sprite-icon icon-home-newCars sk-image"></view>
新车频道
</view>
</view>
<view class="equity-banner x-center" hidden="{{skeletonData.equity}}">
<image webp="true" data-name="equity" class="sk-image"></image>
</view>
<view class="goods-box" hidden="{{skeletonData.goods}}">
<view class="sticky" style="top:88px;">
<view is="components/Tab/Tab">
<scroll-view enable-flex="true" scroll-with-animation="true" scroll-x="true" class="Tab--tab-box Tab--left" scroll-into-view="true">
<view class="Tab--tab Tab--active" data-count="0" id="9dff8c7d--to-0">
<view class="Tab--text sk-transparent sk-text-14-2857-28 sk-text">秒杀</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="1" id="9dff8c7d--to-1">
<view class="Tab--text sk-transparent sk-text-14-2857-764 sk-text">新品驾到</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="2" id="9dff8c7d--to-2">
<view class="Tab--text sk-transparent sk-text-14-2857-318 sk-text">智能硬件</view>
<view class="Tab--line"></view>
</view>
<view class="Tab--tab" data-count="3" id="9dff8c7d--to-3">
<view class="Tab--text sk-transparent sk-text-14-2857-940 sk-text">导航车机</view>
<view class="Tab--line"></view>
</view>
</scroll-view>
</view>
</view>
<view class="goods-content activity-box">
<view is="components/Activity/Activity">
<view class="Activity--item Activity--activity" data-id="109">
<view class="Activity--img">
<image webp="true" class="sk-image"></image>
</view>
</view>
</view>
<view is="components/Activity/Activity">
<view class="Activity--item Activity--activity" data-id="108">
<view class="Activity--img">
<image webp="true" class="sk-image"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
\ No newline at end of file
/*
此文件为开发者工具生成,生成时间: 2022/5/27 下午4:06:14
在 D:\2022\05\miniprogram-scrm-shopmall\pages\tab\index\index.wxss 中引入样式
```
@import "./index.skeleton.wxss";
```
更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html
*/
.sk-transparent {
color: transparent !important;
}
.sk-text-14-2857-847 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 33.6000rpx;
position: absolute !important;
}
.sk-text {
background-origin: content-box !important;
background-clip: content-box !important;
background-color: transparent !important;
color: transparent !important;
background-repeat: repeat-y !important;
}
.sk-text-14-2857-28 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-764 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-318 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-text-14-2857-940 {
background-image: linear-gradient(transparent 14.2857%, #EEEEEE 0%, #EEEEEE 85.7143%, transparent 0%) !important;
background-size: 100% 36.4000rpx;
position: relative !important;
}
.sk-image {
background: #EFEFEF !important;
}
.sk-container {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: transparent;
}
.sk-container .equity-banner{
position: absolute;
width: calc(100% - 64rpx);
margin: 0;
top: 846rpx;
}
.sk-container .goods-box {
position: absolute;
top: 1100rpx;
}
\ No newline at end of file
<import src="index.skeleton.wxml" />
<template is="skeleton" data="{{skeletonData,navHeight}}" wx:if="{{!hideSkeleton}}" />
<navigation-bar navStyle="{{navStyle}}" page-title="首页">
<block wx:if="{{IMGURL}}">
<view class="logo y-center" data-skeleton-hide="{{skeletonData.logo}}">
<image
webp
src="{{IMGURL}}index/gh-logo.png?v={{img_version}}"
bindload="imgSuccess"
data-name="logo" />
</view>
<view class="merchant-switch y-center flex" bindtap="marchantSwitch">
切换门店
<view class="icon">
<image webp src="{{IMGURL}}index/merchant-switch.png?v={{img_version}}" />
</view>
</view>
</block>
</navigation-bar>
<block wx:if="{{navHeight}}">
<view class="layout" style="top:{{navHeight}}px">
<view class="bg-box" style="height:{{270 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<block wx:if="{{userInfo && userInfo.group == false && merchantName}}">
<view class="merchant-name" style="top:{{navHeight}}px">{{merchantName}}</view>
</block>
<view class="bg">
<image
webp
src="{{IMGURL}}index/bg.png?v={{img_version}}"
data-skeleton-hide="{{skeletonData.bg}}"
bindload="imgSuccess"
data-name="bg" />
</view>
</view>
<!-- <search-box bindsearch="search"></search-box> -->
<view class="banner" data-skeleton-hide="{{skeletonData.homeConfig}}">
<block wx:if="{{bannerList}}">
<swiper
class="swiper"
bindchange="changePage"
interval="5000"
circular
autoplay>
<block wx:for="{{bannerList}}" wx:key="index">
<swiper-item class="swiper-item">
<image
webp
src="{{item.bannerImg}}"
class="banner-img"
bindtap="jumpGoods"
data-url="{{item.url}}"
data-id="{{item.goods.id}}"
data-link="{{item.linkUrl}}"
data></image>
</swiper-item>
</block>
</swiper>
</block>
<block wx:else>
<view class="swiper border">
<view class="logo box-center">
<image webp src="{{IMGURL}}index/gh-logo.png?v={{img_version}}" />
</view>
</view>
</block>
<block wx:if="{{bannerList.length > 1}}">
<view class="banner-dots">
<block wx:for="{{bannerList}}" wx:key="index">
<view class="dots {{bannerIndex == index?'active':''}}" />
</block>
</view>
</block>
</view>
<view class="tips-box flex" data-skeleton-hide="{{skeletonData.homeConfig}}">
<block wx:for="{{tipsList}}" wx:key="index">
<view class="item flex">
<view class="sprite-icon icon-home-tips-{{index}}" />
{{item}}
</view>
</block>
</view>
<block wx:if="{{noticeContent}}">
<view class="marquee" data-skeleton-hide="{{skeletonData.homeConfig}}">
<marquee data="{{noticeContent}}" speed="7500" />
</view>
</block>
<view class="util-box" data-skeleton-hide="{{skeletonData.utilList}}">
<block wx:for="{{utilList}}" wx:key="index">
<view class="item" bindtap="jump" data-item="{{item}}">
<view class="sprite-icon icon-home-{{item.icon}}" />
{{item.name}}
</view>
</block>
</view>
<view class="equity-banner" bindtap="jumpEquity" data-skeleton-hide="{{skeletonData.equity}}">
<image
webp
src="{{IMGURL}}index/equity-banner.png?v={{img_version}}"
bindload="imgSuccess"
data-name="equity" />
</view>
<block wx:if="{{goodsFlag}}">
<view wx:if="{{classifyList.length}}">
<view class="goods-box" data-skeleton-hide="{{skeletonData.goods}}">
<view class="sticky" style="top:{{navHeight}}px;">
<tab
tab="{{tab}}"
align="left"
openScroll
bindclick="changeTab"
index="{{goodsIndex}}" />
</view>
<view class="goods-content {{classifyList[goodsIndex].classifyName == '秒杀'?'activity-box':''}}">
<block wx:if="{{classifyList.length}}">
<block wx:for="{{classifyList}}" wx:key="index">
<block
wx:for="{{item.goodsList}}"
wx:for-item="i"
wx:for-index="ind"
wx:key="ind">
<block wx:if="{{index == goodsIndex}}">
<block wx:if="{{item.classifyName == '秒杀'}}">
<block wx:if="{{ind < 6}}">
<activity item="{{i}}" />
</block>
</block>
<block wx:else>
<view class="goods-item">
<block
wx:for="{{i}}"
wx:key="cind"
wx:for-item="c"
wx:for-index="cind">
<view class="goods">
<goods item="{{c.goods}}" indexStyle></goods>
</view>
</block>
</view>
</block>
</block>
</block>
</block>
</block>
</view>
<block wx:if="{{classifyList[goodsIndex].classifyName == '秒杀'}}">
<view class="btn text-center" bindtap="jump" data-url="activity.index">
查看更多
<view class="sprite-icon icon-mine-arrow" />
</view>
</block>
</view>
</view>
<block wx:else>
<view class="nothing flex">
<view class="icon">
<image webp src="{{IMGURL}}index/index-nothing.png?v={{img_version}}" />
</view>
当前门店暂无优惠活动
</view>
</block>
</block>
</view>
</block>
<view class="widget-box" wx:if="{{showKF}}">
<view class="widget {{widgetStatus?'open':''}}" bindtap="openKF">
<image webp src="{{IMGURL}}index/kf.png?v={{img_version}}" />
<view class="online-text">在线客服</view>
</view>
</view>
<!-- <view class="widget-box" wx:if="{{!widgetStatus&&customerlist.length>0}}">
<view class="widget {{widgetStatus?'open':''}}" bindtap="showFlex">
<image webp src="{{IMGURL}}index/kf.png?v={{img_version}}"></image>
<view class="online-text">在线客服</view>
</view>
</view> -->
<view class="model" catchtouchmove="noScroll" wx:if="{{widgetStatus}}">
<view class="close-icon" bindtap="showFlex">
<image webp src="{{IMGURL}}index/kf-close.png?v={{img_version}}" />
</view>
<view class="bgkf">
<image webp src="{{IMGURL}}index/kfbg.png?v={{img_version}}" />
<view class="qr-box">
<view class="qr-icon">
<image webp src="{{IMGURL}}index/qr-bg.png?v={{img_version}}" />
</view>
<view class="userinfo-wrap">
<view class="icon">
<image webp src="{{customerlist[0].thumbAvatar|| 'https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/user.png'}}" />
</view>
<view class="name">{{customerlist[0].staffName}}</view>
<view class="qr-code">
<image webp src="{{customerlist[0].qrCode || 'https://img02.glsx.com.cn/weapp/resource/miniprogram/cgacar/index/qr.png'}}" show-menu-by-longpress="{{customerlist[0].qrCode}}" />
</view>
</view>
<view class="kf-text">
<image webp src="{{IMGURL}}index/kf-text.png?v={{img_version}}" />
</view>
</view>
</view>
</view>
<!-- <coupons-dialog requestFlag="{{isLogin}}"></coupons-dialog> -->
<login show="{{showLogin}}" bindloginInfo="LOGIN" />
<!-- 选择门店 -->
<index-merchant merchantSwitch="{{showMerchant}}" init="{{isLogin}}" storeCode="{{userInfo.sapCode}}" />
/* pages/tab/index/index.wxss */
@import "index.skeleton.wxss";
page {
background-color: #fff;
height: 101%;
}
.flex {
display: flex;
align-items: center;
}
.logo {
position: absolute;
width: 218rpx;
height: 50rpx;
top: 50%;
left: 26rpx;
}
.merchant-switch {
position: absolute;
width: 128rpx;
height: 36rpx;
background: rgb(255, 255, 255, .2);
border-radius: 4rpx;
font-size: 22rpx;
color: #FFFFFF;
top: 50%;
left: 256rpx;
justify-content: center;
}
.merchant-switch .icon {
margin-left: 4rpx;
width: 16rpx;
height: 16rpx;
}
.layout {
padding-bottom: 40rpx;
position: relative;
}
.bg-box {
width: 100%;
height: 446rpx;
overflow: hidden;
position: absolute;
left: 0;
}
.bg-box .merchant-name {
font-size: 28rpx;
color: #FFFFFF;
position: absolute;
left: 32rpx;
}
.bg {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
top: 0;
left: 0;
}
.banner {
padding: 60rpx 32rpx 12rpx;
position: relative;
height: 300rpx;
overflow: hidden;
position: relative;
border-radius: 16rpx;
}
.banner .swiper {
height: 100%;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
position: relative;
transform: translateY(0);
}
.banner .swiper.border {
border: 16rpx solid #fff;
box-sizing: border-box;
background: #D6D6D6;
height: 300rpx;
}
.banner .swiper .logo {
left: 50%;
}
.banner .swiper-item,
.banner .banner-img {
border-radius: 16rpx;
overflow: hidden;
}
.banner .banner-dots {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
width: 100%;
bottom: 44rpx;
left: 0;
}
.banner .banner-dots .dots {
width: 12rpx;
height: 4rpx;
margin: 0 6rpx;
background-color: rgba(255, 255, 255, .3);
transition: all .5s;
}
.banner .banner-dots .dots.active {
background-color: #fff;
}
.marquee {
color: #414142;
height: 74rpx;
}
.util-box {
display: grid;
align-items: center;
grid-template-columns: repeat(4, 1fr);
gap: 32rpx 0;
padding-bottom: 48rpx;
}
.util-box .item {
display: flex;
align-items: center;
flex-direction: column;
font-size: 24rpx;
color: #282829;
}
.util-box .item .sprite-icon {
margin-bottom: 12rpx;
}
.tips-box {
justify-content: center;
margin-bottom: 32rpx;
color: rgba(33, 33, 33, .6);
font-size: 24rpx;
}
.tips-box .item {
margin: 0 20rpx;
}
.tips-box .sprite-icon {
margin-right: 10rpx;
}
.equity-banner {
height: 230rpx;
margin: 0 32rpx 24rpx;
border-radius: 8rpx;
overflow: hidden;
}
.activity-box,
.goods-box .goods-content .goods-item {
padding: 32rpx 32rpx 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.goods-box .goods-content .goods {
width: 328rpx;
height: 520rpx;
margin-bottom: 32rpx;
position: relative;
}
.live-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 0 22rpx;
padding: 20rpx 0;
}
.live-item .live-preview {
position: relative;
width: 332rpx;
height: 168rpx;
border-radius: var(--borderRadius);
overflow: hidden;
}
.live-item .live-preview .tips {
position: absolute;
left: 0;
top: 0;
height: 24rpx;
display: flex;
align-items: center;
color: #FFFFFF;
border-radius: 0 0 8rpx 0;
overflow: hidden;
}
.live-item .live-preview .tips .value {
height: 24rpx;
font-size: 20rpx;
padding: 0 8rpx;
background: rgba(0, 0, 0, .59);
}
.live-item .live-preview .tips .label {
width: 64rpx;
font-size: 20rpx;
height: 100%;
}
.live-item .live-preview .in-live .label {
font-size: 16rpx;
background-color: var(--themeColor);
}
.live-item .live-preview .prediction .label {
background-color: var(--btnColor);
}
.live-item .live-preview .in-live .label image {
width: 10rpx;
height: 10rpx;
margin-right: 6rpx;
}
.live-item .live-info {
display: flex;
align-items: center;
margin-top: 20rpx;
}
.live-item .live-info .icon {
width: 48rpx;
height: 48rpx;
overflow: hidden;
border-radius: 100%;
margin-right: 24rpx;
}
.live-item .live-info .live-title {
width: 258rpx;
}
.goods-box,
.goods-box .goods-content .goods-item {
animation: show-box-opacity .5s forwards;
position: relative;
}
.anchor {
position: absolute;
}
.goods-box .goods-content {
/* min-height: 1254rpx; */
padding-bottom: 60rpx;
}
.goods-box .goods-content .page {
display: flex;
}
.goods-box .goods-content swiper {
height: 1104rpx;
}
.goods-box .btn {
margin: 60rpx auto 0;
border: 2rpx solid #979797;
border-radius: 4rpx;
width: 182rpx;
height: 54rpx;
font-size: 24rpx;
color: #656566;
}
.goods-box .btn .icon-mine-arrow {
margin-left: 12rpx;
}
.nothing {
flex-direction: column;
font-size: 28rpx;
color: #C1C2C3;
}
.nothing .icon {
width: 320rpx;
height: 320rpx;
margin-bottom: 8rpx;
}
.widget-box {
position: fixed;
right: 40rpx;
bottom: 232rpx;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: flex-end;
}
.widget {
height: 140rpx;
width: 112rpx;
box-sizing: border-box;
}
.widget-box .open {
position: relative;
z-index: 2;
}
/* @keyframes move {
0% {
transform: translateX(320rpx);
}
100% {
transform: translateX(80rpx);
}
} */
.widget .icon {
width: 100%;
height: 200%;
position: relative;
}
.online-text {
position: absolute;
top: 74rpx;
left: 50%;
transform: translateX(-50%);
width: 80rpx;
height: 28rpx;
font-size: 20rpx;
}
.widget-box .flex-box {
position: relative;
display: flex;
border-radius: var(--borderRadius);
padding: 10rpx 20rpx 10rpx 100rpx;
/* background: linear-gradient(201deg, #7BA6FF 0%, #1C72FB 100%); */
box-sizing: border-box;
animation: showFlex .5s forwards;
font-size: 20rpx;
justify-content: space-between;
width: 320rpx;
}
.widget-box .flex-box .view {
opacity: 0;
animation: showView .1s forwards .5s;
}
@keyframes showFlex {
0% {
right: -1000%;
}
100% {
right: 0;
}
}
@keyframes showView {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 999999;
}
.close-icon {
width: 48rpx;
height: 48rpx;
position: absolute;
right: 90rpx;
top: 260rpx;
}
.close-icon image {
width: 48rpx;
height: 48rpx;
}
.model .bgkf {
width: 602rpx;
height: 862rpx;
position: absolute;
top: 328rpx;
left: 50%;
transform: translateX(-50%);
z-index: 99999;
}
.model .qr-box {
height: 686rpx;
width: 418rpx;
bottom: 96rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
}
.model .bgkf .icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.model .bgkf .icon image {
border-radius: 50%;
}
.userinfo-wrap {
position: absolute;
top: 0rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
flex-direction: column
}
.qr-box .text {
font-size: 32rpx;
font-weight: 500;
color: #282829;
line-height: 44rpx;
}
.qr-box .name {
font-size: 28rpx;
font-weight: 400;
color: #282829;
line-height: 40rpx;
margin: 8rpx 0 0 0;
text-align: center;
}
.qr-box .qr-icon {
width: 418rpx;
height: 492rpx;
margin-top: 50rpx;
position: relative;
}
.qr-box .qr-code {
width: 220rpx;
height: 220rpx;
margin-top: 104rpx;
}
.kf-text {
width: 348rpx;
height: 112rpx;
position: absolute;
z-index: 999998;
margin-top: 30rpx;
}
.kf-text image {
widows: 100%;
height: 100%;
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!