Commit 01fed4f0 by 杨北旺

--

2 parents 78cd5e22 103a7d09
Showing 59 changed files with 1684 additions and 1665 deletions
import api from '~/utils/request/request' import api from '../utils/request/request'
import indexApi from './indexApi'
import ssoApi from './ssoApi' 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'
import activityApi from './activityApi'
const common = 'scrm.api.carlife.common.' const common = 'scrm.api.carlife.common.'
module.exports = { module.exports = {
ssoApi, ssoApi,
indexApi,
discoveryApi,
shopmallApi,
mineApi,
couponsApi,
equityApi,
entmicroApi,
boutiquecouponApi,
psdApi,
sopApi,
carlifeApi,
bigdatautilApi,
activityApi,
commonApi: { commonApi: {
/**上传图片 /**上传图片
*/ */
...@@ -48,31 +22,5 @@ module.exports = { ...@@ -48,31 +22,5 @@ module.exports = {
noSignAttr: ['file'] 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 '../api/request'
import api from '~/utils/request/request' import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram const {
appId
} = wx.getAccountInfoSync().miniProgram
class UsersApi { class UsersApi {
/**调用后台接口获取用户信息 */ /**调用后台接口获取用户信息js_code换取sessionId */
async login() { async wxCodeLogin() {
return this.getWxCode().then(({ code }) => { const {
return api.post( code
{ } = await this.getWxCode()
method: 'scrm.api.sso.weapp.jscode.login', return await api.post({
appId, method: 'scrm.api.sso.wechat.applets.jscode.login',
code appId,
}, code
true },
) true
}) )
}
register(data={}) {
return api.post({
method: 'scrm.api.sso.wechat.account.register',
...data,
platformEntrance:'STORE_ASSISTANT'
},
true
)
}
/**退出登录 */
logout() {
return api.post({
method: 'scrm.api.sso.wechat.applets.logout'
},
true
)
} }
/**调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 */ /**调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 */
getWxCode() { getWxCode() {
...@@ -24,39 +43,86 @@ class UsersApi { ...@@ -24,39 +43,86 @@ class UsersApi {
}) })
}) })
} }
/**授权手机号 */ /**授权手机号登录 */
async authUserPhone(detail, sessionId) { async authUserPhone(detail, loginToken) {
if (!sessionId) { console.log(221)
wx.$api.showToast('缺少sessionId') if (!loginToken) {
wx.$api.showToast('缺少loginToken')
Promise.reject() Promise.reject()
return
} }
console.log(111)
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject() if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject()
delete detail.errMsg delete detail.errMsg
if (detail.iv && detail.encryptedData) { if (detail.iv && detail.encryptedData) {
wx.$api.showLoading() detail.loginToken = loginToken
detail.sessionId = sessionId return api.post({
return api.post( method: 'scrm.api.sso.wechat.applets.auth.phone',
{ ...detail,
method: 'scrm.api.sso.weapp.auth.phone', platformEntrance: 'STORE_ASSISTANT', // 平台标识:生意助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT
...detail
}, },
true true
) )
} else Promise.reject() } else Promise.reject()
} }
/**更新客户手机号 */ /**账号密码登录 */
updataCustomerPhone() { accountLogin(data = {}) {
let customerId = wx.$storage.get('srcm_shopmall_customer_id'), return api.post({
merchantId = wx.$storage.get('srcm_shopmall_merchant_id') method: 'scrm.api.sso.wechat.applets.password.login',
api ...data,
.post({ platformEntrance: 'STORE_ASSISTANT',
method: 'scrm.api.sso.weapp.mark.phone', },
customerId, true
merchantId )
}) }
.then(() => { /** 手机号获取短信验证码 */
wx.removeStorageSync('srcm_shopmall_customer_id') getSmsCode(mobile) {
}) return api.post({
method: 'scrm.api.sso.wechat.applets.sms.get.code',
mobile
},
true
)
}
/** 手机号短信验证码登录 */
phoneSmsLogin(data = {}) {
return api.post({
method: 'scrm.api.sso.wechat.applets.sms.login',
...data,
source: 'MINIAPP',
platformEntrance: 'STORE_ASSISTANT'
},
true
)
}
/** 获取登录账号列表 */
getAccountList(sessionId) {
return api.post({
method: 'scrm.api.sso.wechat.applets.listSelectAccount',
platformEntrance: 'STORE_ASSISTANT',
sessionId
},
true
)
}
/**
* 选择账号登录(手机绑定多个账号时) */
selectAccountLogin(data) {
return api.post({
method: 'scrm.api.sso.wechat.applets.selectAccountLogin',
platformEntrance: 'STORE_ASSISTANT',
...data
},
true
)
}
/**检查sessionId 是否过期 */
checkSession() {
return api.post({
method: 'scrm.api.sso.login.status.check'
},
true
)
} }
} }
export default UsersApi export default UsersApi
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ import { setSystem_info } from '~/utils/cache/storageApi' ...@@ -9,7 +9,7 @@ import { setSystem_info } from '~/utils/cache/storageApi'
import getUpdateManager from './utils/lib/wxUpdateManager' import getUpdateManager from './utils/lib/wxUpdateManager'
// 埋点 // 埋点
import './utils/track/Track' // import './utils/track/Track'
import eventbus from './utils/evenbus' import eventbus from './utils/evenbus'
......
...@@ -4,9 +4,12 @@ ...@@ -4,9 +4,12 @@
"pages/tab/discovery/discovery", "pages/tab/discovery/discovery",
"pages/tab/mine/mine", "pages/tab/mine/mine",
"pages/webView/webView", "pages/webView/webView",
"pages/login/login/login", "pages/authentication/login/login",
"pages/login/register/register", "pages/authentication/register/register",
"pages/login/registerSuccess/registerSuccess" "pages/authentication/registerSuccess/registerSuccess",
"pages/authentication/registerInfo/registerInfo",
"pages/authentication/accountItems/accountItems",
"pages/authentication/customerService/customerService"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
...@@ -69,6 +72,7 @@ ...@@ -69,6 +72,7 @@
"usingComponents": { "usingComponents": {
"navigation-bar": "/components/NavigationBar/NavigationBar", "navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"install-popup": "/components/installPopup/installPopup", "install-popup": "/components/installPopup/installPopup",
"van-loading": "@vant/weapp/loading/index" "van-loading": "@vant/weapp/loading/index"
......
// pages/accountItems/accountItems.js
import USERAPI from '~/api/usersApi/index'
import {
selectAccountLogin
} from '../lib/index'
const navStyle = 'background-color: rgba(0,0,0,0)'
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
merchantLevel:['工厂','省代','市代','门店']
},
onRoute({
sessionId
}) {
this.getListSelectAccount(sessionId)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
onPageScroll({
scrollTop
}) {
let scrollTop_num = scrollTop / 100
if (scrollTop_num > 0 && scrollTop_num <= 1 && this.data.navStyle != 'background-color:#FFF;') this.setData({
navStyle: `background-color:#FFF;`
})
if (scrollTop_num == 0) this.setData({
navStyle
})
},
getListSelectAccount(sessionId) {
wx.$api.showLoading('加载中...')
USERAPI.getAccountList(sessionId).then(({
code,
data,
message
}) => {
wx.hideLoading()
if (code == 0) {
let {
loginUserInfoList,
sessionId
} = data
this.setData({
loginUserInfoList
})
this.sessionId = sessionId
} else wx.$api.showToast(message)
this.setData({
flag: true
})
})
},
chooseAccount(e) {
let {
index
} = e.currentTarget.dataset
let {
loginUserInfoList
} = this.data
this.setData({
checkedId: index
})
// wx.showModal({
// content: '是否确认选择',
// confirmText: '',
// confirmColor: '#3666FE',
// success(res) {
// if (res.confirm) resolve(res.confirm)
// if (res.cancel) reject(false)
// }
// })
this.choiceAccountLogin()
},
choiceAccountLogin() {
let { loginUserInfoList } = this.data, { sessionId } = this;
let id = loginUserInfoList[this.data.checkedId].uuid
if (!id) {
wx.$api.showToast('请选择账号')
return
}
console.log(sessionId,id,'sssss')
// wx.$api.showLoading()
selectAccountLogin({
id,
sessionId
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"navigation-bar": "/components/NavigationBar/NavigationBar"
}
}
\ No newline at end of file \ No newline at end of file
@keyframes opacity-view {
0% {
opacity: 0;
transform: scale(0.1);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.button {
width: 100% !important;
height: 88rpx;
background: var(--btnColor);
border-radius: 8rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
line-height: 88rpx;
padding: 0;
&[disabled]:not([type]){
background: #CCCED1 !important;
color: #fff !important;
}
}
.btn-hover {
opacity: .75;
}
page {
background-color: #F6F8FA;
}
.layout {
font-size: 28rpx;
letter-spacing: 0;
padding: 32rpx 24rpx;
position: relative;
}
.title {
font-weight: 600;
font-size: 32rpx;
color: #1B233D;
line-height: 48rpx;
margin-bottom: 24rpx;
}
.items {
width: 100%;
min-height: 144rpx;
box-shadow: 0 4rpx 16rpx 0 rgba(180, 186, 204, 0.32);
padding: 32rpx;
border-radius: 20rpx;
margin-bottom: 32rpx;
background-color: #fff;
display: flex;
align-items: center;
flex-wrap: nowrap;
box-sizing: border-box;
.info{
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
.buiss{
font-weight: 500;
font-size: 28rpx;
color: #1B233D;
}
.merchant{
font-size: 22rpx;
color: #9299AD;
}
}
.level{
width: 80rpx;
height: 48rpx;
line-height: 48rpx;
border-radius: 4rpx;
text-align: center;
font-weight: 400;
font-size: 24rpx;
flex-shrink: 0;
}
.level1{
background: rgba(235,78,78,0.10);
border: 2rpx solid rgba(235,78,78,0.47);
color: #EB4E4E;
}
.level2{
background: rgba(143,165,255,0.12);
border: 2rpx solid rgba(143,165,255,0.50);
color: #4466F0;
}
.level3{
background: rgba(63,207,119,0.13);
border: 2rpx solid rgba(63,207,119,0.50);
color: #3FCF77;
}
.level4{
background: rgba(245,162,25,0.12);
border: 2rpx solid rgba(245,162,25,0.50);
color: #E38E02;
}
.right_arrow{
width: 24rpx;
height: 24rpx;
margin-left: 48rpx;
flex-shrink: 0;
}
}
.items:last-of-type {
margin-bottom: 0;
}
.radio {
width: 28rpx;
height: 28rpx;
border: 2rpx solid #DDE3F0;
border-radius: 100%;
transition: all .2s;
box-sizing: border-box;
}
.icon {
width: 28rpx;
height: 28rpx;
transition: all .2s;
display: none;
}
.active .icon {
display: block;
}
.active .radio {
display: none;
}
.btn-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 140rpx;
display: flex;
justify-content: center;
align-items: center;
z-index: 20;
background-color: #fff;
color: #fff;
padding: 0 32rpx;
box-sizing: border-box;
}
.list-not {
height: calc(100vh - 159px);
font-size: 40rpx;
}
\ No newline at end of file \ No newline at end of file
<view class="layout">
<view class="title">请选择登录的账号</view>
<view class="list">
<block wx:if="{{flag}}">
<block wx:if="{{loginUserInfoList.length}}">
<block wx:for="{{loginUserInfoList}}" wx:key="index">
<view class="items {{item.active?'active':''}}" bindtap="chooseAccount" data-index="{{index}}">
<view class="info">
<view class="buiss"> {{item.merchantName}}</view>
<view class="merchant">商户号:{{item.merchantId || '--'}}</view>
</view>
<view class="level 'level{{item.accountLevel}}'">
{{merchantLevel[item.accountLevel-1]}}
</view>
<image class="right_arrow" src="{{IMGURL}}right_arrow_icon.png"></image>
</view>
</block>
</block>
<block wx:else>
<view class="list-not" bindtap="getListSelectAccount">
点击刷新
</view>
</block>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/login/register/register.js // pages/authentication/customerService/customerService.js
Page({ Page({
/** /**
...@@ -8,13 +8,6 @@ Page({ ...@@ -8,13 +8,6 @@ Page({
}, },
toRegister(){
wx.$router.go('/pages/login/registerSuccess/registerSuccess',{type:0})
},
toLoginPage(){
wx.$router.reLaunch('/pages/login/login/login')
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "联系客服"
} }
\ No newline at end of file \ No newline at end of file
/* pages/authentication/customerService/customerService.wxss */
.container{
background-color: #F6F8FA;
padding: 180rpx 32rpx;
height: 100vh;
.service-wrap{
width: 100%;
background-color: #fff;
text-align: center;
box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24);
border-radius: 20rpx 20rpx 0 0;
.qrcode{
margin-top: 100rpx;
height: 376rpx;
width: 376rpx;
}
.tip{
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
height: 44rpx;
line-height: 44rpx;
margin: 24rpx 0 32rpx;
}
.hotline{
width: 100%;
text-align: center;
height: 144rpx;
padding-top: 24rpx;
box-sizing: border-box;
background-image: linear-gradient(90deg, #F2F4FA 9%, #FCFDFF 100%);
box-shadow: 0 10rpx 20rpx 0 rgba(129,146,214,0.24), inset 0 -2rpx 6rpx 0 rgba(255,255,255,0.40);
border-radius: 0 0 20rpx 20rpx;
.title{
font-weight: 500;
font-size: 28rpx;
color: #1B233D;
margin-bottom: 8rpx;
}
.phone{
font-weight: 400;
font-size: 22rpx;
color: #9299AD;
line-height: 32rpx;
}
}
}
}
\ No newline at end of file \ No newline at end of file
<!--pages/authentication/customerService/customerService.wxml-->
<view class="container">
<view class="service-wrap">
<image class="qrcode" src="{{IMGURL}}register.png"></image>
<view class="tip">扫码添加客服企微</view>
<view class="hotline">
<view class="title">客服热线</view>
<view>
<text class="phone">400 xxx xxxx</text>
<image></image>
</view>
</view>
</view>
</view>
import {
setSessionId,
setUserInfo
} from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
const setRouteData = targetPath => {
let [url, query] = targetPath.split('?'),
obj = {}
if (query) {
const [key, val] = query.split('=')
obj = {
[key]: val
}
}
return {
url,
obj
}
}
/**选择账号登录 */
const selectAccountLogin = ({
id,
sessionId
}) => {
USERAPI.selectAccountLogin({
id,
sessionId
}).then(({
code,
data,
message
}) => {
if (code == '0') {
console.log('选择账号登录')
setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常')
})
}
/**设置登录信息 */
const setLoginInfo = (userInfo, sessionId) => {
console.log(111222222233333)
setUserInfo(userInfo)
setSessionId(sessionId)
loginSuccess()
}
/**成功跳转 */
const loginSuccess = () => {
const {
options: {
targetPath
}
} = wx.$router.getPageInstance()
if (targetPath) {
const {
url,
obj
} = setRouteData(targetPath)
wx.$router.reLaunch(url, obj)
} else wx.$router.go('pages.index')
}
module.exports = {
selectAccountLogin,
loginSuccess,
setRouteData,
setLoginInfo
}
\ No newline at end of file \ No newline at end of file
.login-bg{
position: absolute;
bottom: 0;
left: 0;
top: 0;
}
.container{ .container{
height: 100vh;
background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative;
.salutation-wrap{ .salutation-wrap{
padding: 112rpx 96rpx 0; padding: 96rpx 96rpx 0;
flex: 1; flex: 1;
.salutation{ .salutation{
height: 88rpx; height: 88rpx;
...@@ -24,18 +29,28 @@ ...@@ -24,18 +29,28 @@
color: #333333; color: #333333;
line-height: 64rpx; line-height: 64rpx;
} }
.logo{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 80rpx;
.logo-img{
width:480rpx;
height: 480rpx;
border: 1rpx dashed #E2E2E2;
}
}
} }
.footer{ .footer{
width: 100%; width: 100%;
height: 850rpx; margin-top: 120rpx;
background-size: 100% 100%;
.login-wrap{ .login-wrap{
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
margin-top: 500rpx;
.login-btn{ .login-btn{
width: 590rpx; width: 590rpx;
height: 88rpx; height: 88rpx;
...@@ -52,8 +67,9 @@ ...@@ -52,8 +67,9 @@
} }
.phone-btn{ .phone-btn{
margin-top: 40rpx; margin-top: 40rpx;
background: #F9F9F9; background: #fff;
color: #1B233D; color: #1B233D;
border: 2rpx solid #DCDFE6;
} }
} }
} }
......
const navStyle = "background-color: transparent;";
import USERAPI from '~/api/usersApi/index'
import WxValidate from '~/utils/WxValidate'
import {
selectAccountLogin,
setLoginInfo
} from '../lib/index'
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
padHeight:0,
headerHeight: 0,
loginMethod: 0,
formData:{
phone:'',
code:''
},
authorized: false,
phoneReady: false
},
navbarReady(e) {
let {
height
} = e.detail;
this.setData({
headerHeight: height,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.validate = new WxValidate()
},
onReady() {
this.init()
},
async init() {
try {
const {
data,
code,
message
} = await USERAPI.wxCodeLogin()
if (code == '0') {
this.setData({
disabled: false
})
this.loginToken = data
} else this.reLogin(message)
wx.hideLoading()
} catch ({
errMsg
}) {
console.error(errMsg)
this.reLogin()
}
},
/**获取loginToken */
reLogin(message) {
wx.showModal({
content: message || '获取loginToken失败',
confirmText: '重试',
confirmColor: '#3666FE'
}).then(({
confirm
}) => {
if (confirm) this.init()
})
},
// inputBindFocus(e){
// if(this.data.padHeight) return;
// this.setData({
// padHeight: e.detail.height
// })
// this.pageScrollToBottom()
// },
// inputBindBlur(){
// this.setData({
// padHeight: 0
// })
// },
// pageScrollToBottom() {
// wx.createSelectorQuery().select('.container').boundingClientRect(function(rect) {
// // 使页面滚动到底部
// wx.pageScrollTo({
// scrollTop: rect.height
// })
// }).exec()
// },
handleLogin(){
const {
formData
} = this.data,
obj = {
mobile: formData.phone,
code: formData.code
}
if(this.data.showLoading) return;
this.setShowLoading(true)
USERAPI.phoneSmsLogin(obj).then(({
code,
data,
message,
errId
}) => {
this.setShowLoading(false)
if (code == '0') {
this.checkLoginUserInfo(data)
} else if(errId=='30990103') {
this.setData({
authorized:true
})
}else{
wx.$api.showToast(message || '系统异常')
}
}).catch(err => {
this.setShowLoading(false)
wx.$api.showToast('系统异常')
})
},
/**手机号&微信登录:是否跳转登录列表页 */
checkLoginUserInfo({
loginUserInfoList,
sessionId
}) {
/**多个账号 */
console.log(loginUserInfoList,'loginUserInfoList')
if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', {
sessionId,
...this.options
})
/**只有一个账号 */
else selectAccountLogin({
id: loginUserInfoList[0].uuid,
sessionId
})
},
switchLoginMethod(e){
const {type} = e.target.dataset
this.setData({
loginMethod: type
})
},
input(e){
const {value} = e.detail
const {name} = e.target.dataset
console.log(e,this.data.formData,'88')
this.setData({
[`formData.${name}`] : value
})
if(this.validate.methods.tel(this.data.formData.phone)){
this.setData({
phoneReady: true
})
}
},
/**获取验证码 */
getSmsCode() {
const {
phoneReady,
formData,
count
} = this.data,
countDown = 60
if (count || !this.data.phoneReady) return
// this.setData({
// smsLoading: true
// })
USERAPI.getSmsCode(formData.phone).then(({
code,
message
}) => {
// this.setData({
// smsLoading: false
// })
if (code == '0') this.countDown(countDown)
else wx.$api.showToast(message || '发送验证码失败')
}).catch(err => {
// this.setData({
// smsLoading: false
// })
wx.$api.showToast(err || '发送验证码失败')
})
},
/**验证码倒计时 */
countDown(countDown) {
if (countDown) this.setData({
count: countDown
})
setTimeout(() => {
let {
count
} = this.data
this.setData({
count: --count
})
if (count > 0) this.countDown()
else this.setData({
count: null
})
}, 1e3)
},
setShowLoading(val){
this.setData({
showLoading: val
})
},
wxLogin({
detail
}) {
if (!detail.code || this.data.showLoading) return
this.setShowLoading(true)
USERAPI.authUserPhone(detail, this.loginToken).then(({
code,
data,
message,
errId
}) => {
this.setShowLoading(false)
if (code == '0'){
this.checkLoginUserInfo(data)
}else if(errId=='30990103'){
this.setData({
authorized:true
})
}else{
wx.$api.showToast(message || '系统异常')
}
}).catch(({
errMsg
}) => {
this.setShowLoading(false)
wx.$api.showToast('系统异常')
})
},
goServicePage(){
wx.$router.go('/pages/authentication/customerService/customerService')
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,15 @@ ...@@ -9,7 +9,15 @@
color: #333333; color: #333333;
} }
.login-input-wrap{ .login-input-wrap{
margin-top: 450rpx !important; .login-title{
width: 590rpx;
text-align: left;
font-weight: 500;
font-size: 48rpx;
color: #333333;
line-height: 64rpx;
margin-bottom: 80rpx;
}
.phone, .code{ .phone, .code{
background-color: #fff; background-color: #fff;
display: flex; display: flex;
...@@ -19,10 +27,10 @@ ...@@ -19,10 +27,10 @@
text-align: left!important; text-align: left!important;
} }
.phone{ .phone{
margin-bottom: 24rpx; margin-bottom: 48rpx;
} }
.code{ .code{
margin-bottom: 50rpx; margin-bottom: 128rpx;
} }
.code-btn{ .code-btn{
width: 180rpx; width: 180rpx;
...@@ -33,8 +41,21 @@ ...@@ -33,8 +41,21 @@
border-radius: 28rpx; border-radius: 28rpx;
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
border: none;
}
.code-btn::after{
border: none;
} }
.placeholderClass,.placeholder{ .placeholderClass,.placeholder{
color: #BCBCBC; color: #BCBCBC;
} }
.other{
margin-top: 64rpx;
font-size: 28rpx;
letter-spacing: 0;
color: #A8ABBC;
text{
color: #5570D4;
}
}
} }
<!--pages/login.wxml-->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="门店助手">
<text>门店助手</text>
</navigation-bar>
<image class="login-bg" src="{{IMGURL}}login.png"></image>
<view class="container" style="padding-top: {{headerHeight}}px;">
<view class="salutation-wrap" wx:if="{{loginMethod==0}}">
<view class="salutation">您好</view>
<view class="welcome">欢迎登录门店助手</view>
<view class="logo">
<image class="logo-img" src="{{IMGURL}}login-logo.png"></image>
</view>
</view>
<view class="footer">
<view class="login-wrap" wx:if="{{loginMethod==0}}">
<!-- <view class="wx-btn login-btn">微信授权登录</view> -->
<button class="wx-btn login-btn" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{showLoading}}">微信授权登录</button>
<view class="phone-btn login-btn" bindtap="switchLoginMethod" data-type="1">手机号码登录</view>
</view>
<block wx:else>
<view class="login-wrap login-input-wrap">
<view class="login-title">手机号码登录</view>
<view class="login-btn phone">
<input maxlength="11" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="请输入手机号码" bindinput="input" value="{{formData.phone}}" data-name="phone"/>
</view>
<view class="login-btn code">
<input maxlength="4" adjust-position="{{false}}" placeholder-class="placeholder" placeholder="请输入验证码"
bindinput="input" value="{{formData.code}}" data-name="code"/>
<button disabled="{{!phoneReady}}" class="code-btn" bindtap="getSmsCode">{{count? count + 's':'获取验证码'}}</button>
</view>
<view class="login-btn wx-btn" bindtap="handleLogin">登录</view>
<view class="other">或 <text bindtap="switchLoginMethod" data-type="0">微信登录</text></view>
</view>
</block>
</view>
<popup bindconfirm="goServicePage" show="{{authorized}}" confirmText="联系客服" title="提示" height="560rpx">
<view class="popup-content">当前登录手机号未认证,请联系客服处理</view>
</popup>
</view>
import USERAPI from '~/api/usersApi/index'
const navStyle = "background-color: transparent;";
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
headerHeight:0
},
navbarReady(e) {
let {
height
} = e.detail;
this.setData({
headerHeight: height,
});
},
async init() {
try {
const {
data,
code,
message
} = await USERAPI.wxCodeLogin()
if (code == '0') {
this.setData({
disabled: false
})
this.loginToken = data
} else this.reLogin(message)
wx.hideLoading()
} catch ({
errMsg
}) {
console.error(errMsg)
this.reLogin()
}
},
/**获取loginToken */
reLogin(message) {
wx.showModal({
content: message || '获取loginToken失败',
confirmText: '重试',
confirmColor: '#3666FE'
}).then(({
confirm
}) => {
if (confirm) this.init()
})
},
// toRegister(){
// console.log(this.loginToken)
// },
toRegister({
detail
}) {
if (!detail.code) return
USERAPI.authUserPhone(detail, this.loginToken).then(({
code,
data,
message,
errId
}) => {
if (code == '0'){
this.checkLoginUserInfo(data)
}else{
if(errId=='30990103'){
let params = {
staffName: 'zqqq',
merchantId: '44211227',
merchantFileRequest : { fileName: "bsg", fileUrl: 'https://img1.baidu.com/it/u=1755961019,1690032781&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1665766800&t=0b9617eab6fe013e35dc2e491e2e2100' }
}
wx.$router.go('/pages/authentication/registerInfo/registerInfo',params)
}else{
wx.$api.showToast(message || '系统异常')
}
}
}).catch(({
errMsg
}) => {
wx.$api.showToast(message || '系统异常')
})
},
checkLoginUserInfo({
loginUserInfoList,
sessionId
}) {
/**多个账号 */
console.log(loginUserInfoList,'loginUserInfoList')
if (loginUserInfoList.length > 1) wx.$router.go('/pages/authentication/accountItems/accountItems', {
sessionId,
...this.options
})
/**只有一个账号 */
else selectAccountLogin({
id: loginUserInfoList[0].uuid,
sessionId
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options,'options')
let data = decodeURIComponent(options.data)
console.log(data)
this.init()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
wx.hideHomeButton({
success: (res) => {},
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
<!--pages/login/register/register.wxml-->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="门店助手">
<text>门店助手</text>
</navigation-bar>
<image class="login-bg" src="{{IMGURL}}login.png"></image>
<view class="container" style="padding-top: {{headerHeight}}px;">
<view class="salutation-wrap">
<view class="salutation">您好</view>
<view class="welcome">欢迎注册门店助手</view>
<view class="logo">
<image class="logo-img" src="{{IMGURL}}login-logo.png"></image>
</view>
</view>
<view class="footer" style="background-image: url('{{IMGURL}}register.png');">
<view class="login-wrap">
<!-- <view class="wx-btn login-btn" bindtap="toRegister">微信授权一键注册</view> -->
<button class="wx-btn login-btn" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="toRegister">微信授权一键注册</button>
<!-- <view class="phone-btn login-btn" bindtap="toLoginPage">已有账号,返回登录</view> -->
</view>
</view>
</view>
// pages/authentication/registerInfo/registerInfo.js
import USERAPI from '~/api/usersApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
staffName: '',
department: {},
dataFromOptions:{},
departmentList: [{
id: 1,
name: '销售部',
}, {
id: 2,
name: '售后部',
}, {
id: 3,
name: '客服部',
}, {
id: 4,
name: '续保部',
}],
showModal: false
},
onRoute(options){
console.log(options,111)
this.setData({
dataFromOptions: options,
staffName: options.staffName
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.init()
},
async init() {
try {
const {
data,
code,
message
} = await USERAPI.wxCodeLogin()
if (code == '0') {
this.setData({
disabled: false
})
this.loginToken = data
} else this.reLogin(message)
wx.hideLoading()
} catch ({
errMsg
}) {
console.error(errMsg)
this.reLogin()
}
},
/**获取loginToken */
reLogin(message) {
wx.showModal({
content: message || '获取loginToken失败',
confirmText: '重试',
confirmColor: '#3666FE'
}).then(({
confirm
}) => {
if (confirm) this.init()
})
},
selectDepartment(){
this.setData({
showModal: true
})
},
onClose(){
this.setData({
showModal: !this.data.showModal
})
},
onConfirm(e){
console.log(e)
const {value} = e.detail
this.setData({
department: value
})
this.onClose()
},
handleRegister({detail}){
console.log(detail,'detaildetaildetail')
const { merchantId, merchantFileRequest } = this.data.dataFromOptions
let params = {
merchantId,
loginToken:this.loginToken,
encryptedData:detail.encryptedData,
iv:detail.iv,
department: this.data.department.id,
merchantFileRequest: JSON.stringify(merchantFileRequest),
staffName: this.data.staffName
}
console.log(params,'ddd')
USERAPI.register(params).then((res) => {
if (code == '0'){
wx.$router.go('/pages/authentication/registerSuccess/registerSuccess',{type:0})
}else{
wx.$api.showToast(message || '系统异常')
}
})
//
},
inputStaffNamme(e){
const {value} = e.detail
this.setData({
staffName: value
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "注册"
}
\ No newline at end of file \ No newline at end of file
/* pages/authentication/registerInfo/registerInfo.wxss */
.container{
.tip{
width: 308rpx;
height: 40rpx;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #333333;
margin: 32rpx 0;
}
.info{
background-color: #fff;
border-radius: 16rpx;
.info-item{
height: 107rpx;
padding: 35rpx 32rpx;
box-sizing: border-box;
font-weight: 500;
font-size: 28rpx;
color: #333333;
display: flex;
align-items: center;
&:first-child{
border-bottom: 2rpx solid #F0F0F0;
}
.placeholder{
margin-top: 2rpx;
}
.depart-name,input{
display: inline-block;
margin-left: 35rpx;
flex: 1;
}
.right-arrow{
width: 24rpx;
height: 24rpx;
}
}
}
.register{
padding: 0 13rpx;
margin-top: 120rpx;
.btn{
line-height: 88rpx;
width: 100%;
height: 88rpx;
background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 20rpx;
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0;
}
}
padding: 0 35rpx;
background-color: #F6F8FA;
}
.popclass {
position: relative;
border-radius: 24rpx 24rpx 0 0;
}
.active-class {
font-weight: 500 !important;
font-size: 32rpx !important;
color: #333333 !important;
}
\ No newline at end of file \ No newline at end of file
<!--pages/authentication/registerInfo/registerInfo.wxml-->
<view class="container">
<view class="tip">请完善个人资料完成注册</view>
<view class="info">
<view class="info-item">
<text>姓名</text>
<input type="text" placeholder-class="placeholder" placeholder="请输入您的姓名" bindinput="inputStaffNamme" value="{{staffName}}"/>
</view>
<view class="info-item" bindtap="selectDepartment">
<text class="label">部门</text>
<text class="depart-name">{{department.name}}</text>
<image class="right-arrow" src="{{IMGURL}}right_arrow_grey_icon.png"></image>
</view>
</view>
<view class="register">
<button class="btn" open-type="getPhoneNumber" bindgetphonenumber="handleRegister">立即注册</button>
</view>
</view>
<van-popup show="{{ showModal }}" custom-class="popclass" position="bottom" custom-style="height: 50%" >
<van-picker
title="选择部门"
show-toolbar
active-class="active-class"
value-key="name"
columns="{{ departmentList }}"
bind:cancel="onClose"
bind:confirm="onConfirm" />
</van-popup>
// pages/login/registerSuccess/registerSuccess.js
Page({ Page({
/** /**
...@@ -10,10 +9,6 @@ Page({ ...@@ -10,10 +9,6 @@ Page({
interval:null interval:null
}, },
onRoute(options){ onRoute(options){
console.log(options,111)
this.setData({
type: options.type
})
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -32,7 +27,7 @@ Page({ ...@@ -32,7 +27,7 @@ Page({
},1000) },1000)
}, },
goLogin(){ goLogin(){
wx.$router.reLaunch('/pages/login/login/login') wx.$router.reLaunch('/pages/authentication/login/login')
}, },
/** /**
......
{
"usingComponents": {},
"navigationBarTitleText": "注册"
}
\ No newline at end of file \ No newline at end of file
// pages/login.js
Page({
/**
* 页面的初始数据
*/
data: {
padHeight:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
inputBindFocus(e){
if(this.data.padHeight) return;
this.setData({
padHeight: e.detail.height
})
this.pageScrollToBottom()
},
inputBindBlur(){
this.setData({
padHeight: 0
})
},
pageScrollToBottom() {
wx.createSelectorQuery().select('.container').boundingClientRect(function(rect) {
// 使页面滚动到底部
wx.pageScrollTo({
scrollTop: rect.height
})
}).exec()
},
handleLogin(){
console.log(111)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
<!--pages/login.wxml-->
<view class="container" style="padding-bottom: {{padHeight}}px;">
<view class="salutation-wrap">
<view class="salutation">您好</view>
<view class="welcome">欢迎登录门店助手</view>
</view>
<view class="footer" style="background-image: url('{{IMGURL}}register.png');">
<!-- <view class="login-wrap">
<view class="wx-btn login-btn">微信授权登录</view>
<view class="phone-btn login-btn">手机号码登录</view>
</view> -->
<view class="login-wrap login-input-wrap">
<view class="login-btn phone">
<input maxlength="{{11}}" adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholderClass" placeholder="请输入手机号码"/>
</view>
<view class="login-btn code">
<input adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholder" placeholder="请输入验证码"/>
<view class="code-btn">获取验证码</view>
</view>
<view class="login-btn wx-btn" bindtap="handleLogin">登录</view>
</view>
</view>
<popup show="{{false}}" confirmText="联系客服" title="提示" height="560rpx">
<view class="popup-content">当前登录手机号未认证,请联系客服处理</view>
</popup>
</view>
<!--pages/login/register/register.wxml-->
<view class="container">
<view class="salutation-wrap">
<view class="salutation">您好</view>
<view class="welcome">欢迎登录门店助手</view>
</view>
<view class="footer" style="background-image: url('{{IMGURL}}register.png');">
<view class="login-wrap">
<view class="wx-btn login-btn" bindtap="toRegister">微信授权一键注册</view>
<view class="phone-btn login-btn" bindtap="toLoginPage">已有账号,返回登录</view>
</view>
</view>
</view>
...@@ -7,7 +7,7 @@ Component({ ...@@ -7,7 +7,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
btnHeight: Number
}, },
/** /**
...@@ -22,8 +22,9 @@ Component({ ...@@ -22,8 +22,9 @@ Component({
let { let {
height height
} = e.detail; } = e.detail;
console.log(height,'heightheightheight')
this.setData({ this.setData({
user_box_style: `padding-top:${height + 20}px`, btnHeight: `${height + 128}px`,
}); });
}, },
/** /**
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
.header{ .header{
position: relative; position: relative;
width: 100%; width: 100%;
height: 304rpx;
margin-bottom: 80rpx; margin-bottom: 80rpx;
box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6); box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6);
} }
......
<!--pages/tab/discovery/components/headerNav/headerNav.wxml--> <!--pages/tab/discovery/components/headerNav/headerNav.wxml-->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现"> <view style="height: {{btnHeight}}" class="header">
<text>发现</text>
</navigation-bar>
<view class="header">
<image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image> <image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image>
<scroll-view class="scene-wrap" scroll-x="{{true}}"> <scroll-view class="scene-wrap" scroll-x="{{true}}">
<block wx:for="{{sceneList}}" wx:key="index"> <block wx:for="{{sceneList}}" wx:key="index">
......
...@@ -6,13 +6,14 @@ Component({ ...@@ -6,13 +6,14 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
headerHeight: Number
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'], navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'],
activeNavIdx: 0, activeNavIdx: 0,
tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'], tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'],
...@@ -62,6 +63,23 @@ Component({ ...@@ -62,6 +63,23 @@ Component({
this.data.heightArr = heightArr this.data.heightArr = heightArr
console.log( this.data.heightArr) console.log( this.data.heightArr)
}).exec() }).exec()
} },
// 显示测算弹窗
showCalculate() {
this.setData({
visible: !this.data.visible,
isReset: false
});
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 352) {
this.setData({
visible: false,
isReset: false,
formData: this.data.lastFormData
});
}
},
} }
}) })
.scene-wrap{
white-space: nowrap;
height: 180rpx;
margin-bottom: 16rpx;
.scene-img{
width: 100%;
}
}
// 特色产品 // 特色产品
.prod-wrap .big-title{ .prod-wrap .big-title{
margin-left: 40rpx; margin-left: 40rpx;
...@@ -19,7 +27,7 @@ ...@@ -19,7 +27,7 @@
width: 188rpx; width: 188rpx;
height: 64rpx; height: 64rpx;
border-radius: 12rpx; border-radius: 12rpx;
font-weight: 600; font-weight: 500;
font-size: 24rpx; font-size: 24rpx;
letter-spacing: 0; letter-spacing: 0;
text-align: center; text-align: center;
...@@ -33,6 +41,7 @@ ...@@ -33,6 +41,7 @@
background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%); background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%);
border: 2rpx solid rgba(68,97,240,0.50); border: 2rpx solid rgba(68,97,240,0.50);
box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35); box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35);
color: #4466F0;
} }
.prod-wrap .nav-wrap .nav:last-child{ .prod-wrap .nav-wrap .nav:last-child{
margin-right: 0; margin-right: 0;
...@@ -70,7 +79,7 @@ ...@@ -70,7 +79,7 @@
background: #D7F5EB; background: #D7F5EB;
border-radius: 4rpx; border-radius: 4rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 600; font-weight: 500;
font-size: 24rpx; font-size: 24rpx;
color: #24B38C; color: #24B38C;
letter-spacing: 0; letter-spacing: 0;
...@@ -91,7 +100,7 @@ ...@@ -91,7 +100,7 @@
} }
.prod-info .title{ .prod-info .title{
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 600; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #323436; color: #323436;
} }
...@@ -137,9 +146,135 @@ ...@@ -137,9 +146,135 @@
} }
.project-img{ .project-img{
height: 500rpx;
white-space: nowrap; white-space: nowrap;
.img-item{ .img-item{
height: 300rpx; height: 300rpx;
} }
}
/* 测算 */
.calculate {
position: fixed;
right: 16rpx;
bottom: 160rpx;
}
.icon-calculate {
width: 216rpx;
height: 228rpx;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(45,45,51,0.50);
}
.dialog-box {
position: fixed;
bottom: 0;
width: 100%;
height: 744rpx;
background-color: #fff;
box-shadow: 0 -8rpx 20rpx 0 rgba(180,186,204,0.32);
border-radius: 32rpx 32rpx 0 0;
}
.dialog-header {
display: flex;
justify-content: space-between;
padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee;
}
.header-btn {
display: inline-block;
font-size: 32rpx;
line-height: 48rpx;
}
.btn-gray {
color: #6C737A;
}
.btn-primary {
background-color: #fff;
border: none;
margin: 0;
padding: 0;
font-weight: 500;
color: #5850FF;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
margin-bottom: 24rpx;
}
.dialog-form {
width: 100%;
height: 384rpx;
background-image: linear-gradient(179deg, rgba(123,112,255,0.02) 15%, rgba(99,92,255,0.10) 100%);
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 216rpx;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
margin-left: 64rpx;
margin-right: 16rpx;
}
.form-unit {
font-size: 28rpx;
color: #6E6E7A;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
line-height: 48rpx;
margin-top: 40rpx;
}
/* 了解更多 */
.understand-more {
position: absolute;
bottom: 0;
width: 100%;
height: 700rpx;
background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, #FFFFFF 68%);
border-radius: 0 0 12rpx 12rpx;
}
.understand-more .more-btn {
width: 100%;
position: absolute;
bottom: 104rpx;
} }
\ No newline at end of file \ No newline at end of file
<!--pages/tab/discovery/components/product/product.wxml--> <view class="header">
<swiper class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<block wx:for="{{sceneList}}" wx:key="index">
<swiper-item>
<image class="scene-img" src="{{IMGURL}}{{item}}"></image>
</swiper-item>
</block>
</swiper>
</view>
<view class="prod-wrap"> <view class="prod-wrap">
<text class="big-title">特色产品</text> <text class="big-title">特色产品</text>
<scroll-view class="nav-wrap" scroll-x="{{true}}"> <scroll-view class="nav-wrap" scroll-x="{{true}}">
...@@ -27,12 +35,46 @@ ...@@ -27,12 +35,46 @@
</view> </view>
</view> </view>
<view class="project-wrap"> <view class="project-wrap">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab> <view style="position: sticky;top: {{headerHeight}}px ;z-index: 1;">
<tab openScroll="{{true}}" tab="{{tab}}" index="{{curTabIdx}}" bindclick="changeTab"></tab>
</view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}"> <scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item"> <view id="to-{{index}}" class="img-item">
{{item}} {{item}}
</view>
</block>
</scroll-view>
</view>
<!-- 测算按钮 -->
<view class="calculate" bindtap="showCalculate">
<image class="icon-calculate" webp src="{{IMGURL}}customer_service.png"></image>
</view>
<!-- 测算弹窗 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view hidden="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view hidden="{{!isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
<view class="dialog-title">输入您门店的基本情况</view>
<view class="dialog-form">
<view class="form-item">
<view class="form-label">门店月平均新车销量</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="sales" value="{{formData.sales}}" type="number" />
<!-- <view class="form-unit">台</view> -->
</view>
<view class="form-item">
<view class="form-label">3年内售后存量用户</view>
<input class="form-input" bindfocus="focus" maxlength="8" name="flow" type="number" value="{{formData.flow}}" />
<!-- <view class="form-unit">人</view> -->
</view>
<button class="dialog-btn" form-type="submit">提交测算</button>
</view> </view>
</block> </view>
</scroll-view> </form>
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
// pages/tab/output/output.js // pages/tab/output/output.js
const navStyle = "background-color: transparent;";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
headerHeight: 0,
navStyle,
},
navbarReady(e) {
let {
height
} = e.detail;
this.setData({
headerHeight: height,
});
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
......
/* pages/tab/output/output.wxss */ /* pages/tab/output/output.wxss */
.container{
position: relative;
.bg-img{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 304rpx;
box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6);
}
}
<view style="background: #fff;"> <view style="background:#fff;" class="container">
<headerNav></headerNav> <image style="height: {{headerHeight+45}}px;" src="{{IMGURL}}discovery_center_bg.png" class="bg-img"></image>
<product></product> <navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text>
</navigation-bar>
<view style="padding-top: {{headerHeight}}px;">
<product headerHeight="{{headerHeight}}"></product>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -61,5 +61,5 @@ ...@@ -61,5 +61,5 @@
], ],
"include": [] "include": []
}, },
"appid": "wx570d9331f9ace0bd" "appid": "wxe10067a63c1856ac"
} }
\ No newline at end of file \ No newline at end of file
{ {
"setting": { "setting": {
"compileHotReLoad": false, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": false,
"lazyloadPlaceholderEnable": true "lazyloadPlaceholderEnable": true
}, },
...@@ -23,28 +23,35 @@ ...@@ -23,28 +23,35 @@
}, },
{ {
"name": "", "name": "",
"pathName": "pages/login/login/login", "pathName": "pages/authentication/login/login",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/login/register/register", "pathName": "pages/authentication/register/register",
"query": "data=%7B%22staffName%22%3A%22%E6%81%92%E6%B2%B3%E7%8C%B4%22%2C%22merchantId%22%3A44184606%2C%22fileUrl%22%3A%22https%3A%2F%2Fimg1.baidu.com%2Fit%2Fu%3D1755961019%2C1690032781%26fm%3D253%26app%3D138%26size%3Dw931%26n%3D0%26f%3DJPEG%26fmt%3Dauto%3Fsec%3D1665766800%26t%3D0b9617eab6fe013e35dc2e491e2e2100%22%7D",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/authentication/registerSuccess/registerSuccess",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/login/registerSuccess/registerSuccess", "pathName": "pages/authentication/registerInfo/registerInfo",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "packageActivity/pages/visitor/visitor", "pathName": "pages/authentication/customerService/customerService",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
......
...@@ -9,8 +9,5 @@ export const STORAGE_OBJECTkEY = { ...@@ -9,8 +9,5 @@ export const STORAGE_OBJECTkEY = {
sessionId: 'sessionId', sessionId: 'sessionId',
userInfo: 'userInfo', userInfo: 'userInfo',
system_info: 'systemInfo', system_info: 'systemInfo',
app_title: 'appTitle', app_title: 'appTitle'
auto_login_object: 'auto_login_object',
address_info: 'address_info',
srcm_shopmall_merchant_id: 'srcm_shopmall_merchant_id'
} }
...@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod'] ...@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试 2测试
3生产 3生产
*/ */
const index = 3 const index = 1
const secretKey = { const secretKey = {
ip: {}, ip: {},
dev: { dev: {
...@@ -32,7 +32,7 @@ const secretKey = { ...@@ -32,7 +32,7 @@ const secretKey = {
const domain = { const domain = {
// ip: 'http://192.168.2.94:8558', // ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315', // ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.3.181:8394', ip: 'http://192.168.1.170:8315',
/**登录: 192.168.2.3:8315 /**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
......
import { secretKey, pathEnum, domain, index, sign } from './http.js' import {
secretKey,
pathEnum,
domain,
sign
} from './http.js'
// import util from '../util' // import util from '../util'
import { getSessionId } from '~/utils/cache/storageApi' import {
let INTERRUPT = false getSessionId
} from '~/utils/cache/storageApi'
/**接口 */ /**接口 */
class Request { class Request {
get(params, returnAll = false) { get(params, returnAll = false) {
...@@ -10,20 +16,15 @@ class Request { ...@@ -10,20 +16,15 @@ class Request {
post(params, returnAll = false) { post(params, returnAll = false) {
return this.request('POST', params, returnAll) return this.request('POST', params, returnAll)
} }
reportTrack(params) {
return this.request('POST', params, true)
}
request(RequestMethods, params, returnAll) { request(RequestMethods, params, returnAll) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.showNavigationBarLoading() wx.showNavigationBarLoading()
let header = let header =
RequestMethods === 'POST' RequestMethods === 'POST' ?
? { {
'content-type': 'application/x-www-form-urlencoded' 'content-type': 'application/x-www-form-urlencoded'
} } :
: {} {}
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) header.merchantId = merchantId
let projectName = this.getRopProject(params.method) let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName] const path = pathEnum[projectName]
...@@ -38,33 +39,18 @@ class Request { ...@@ -38,33 +39,18 @@ class Request {
success(response) { success(response) {
/**业务代码 */ /**业务代码 */
let { let {
data: { code, message }, data: {
code,
message
},
data data
} = response } = response
if (code == 20 || code == 21) { if (code == 20 || code == 21) {
wx.hideLoading()
const thisPage = wx.$router.getPageInstance() const thisPage = wx.$router.getPageInstance()
if (thisPage && thisPage.pageRefresh) thisPage.pageRefresh() if(thisPage.route == 'login/loading/loading') {
if (!wx.$authStatus) { resolve(data)
if (INTERRUPT) return return
INTERRUPT = true } else wx.$router.reLaunch('login.index')
// wx.showLoading()
getApp()
.login()
.then(() => {
if (thisPage.init && thisPage.data.userInfo) thisPage.init()
if (thisPage.loginCallBack && thisPage.data.userInfo) thisPage.loginCallBack(thisPage.data.userInfo)
if (thisPage.onRoute) thisPage.onRoute()
thisPage.onLoad()
thisPage.onShow()
INTERRUPT = false
})
.catch(error => {
wx.hideLoading()
console.log('error', error)
})
// .finally(() => {})
}
} else { } else {
if (returnAll) { if (returnAll) {
resolve(data) resolve(data)
...@@ -125,22 +111,5 @@ class Request { ...@@ -125,22 +111,5 @@ class Request {
const projectName = method.split('.')[2] const projectName = method.split('.')[2]
return projectName return projectName
} }
getMock() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/config'
if (index == 3) url = 'https://oss-config.test.glsx.com.cn/mock/6274e3050da5034a58680aa6/config'
return new Promise(resolve => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!