Commit f242494c by zhangquan

注册登录接口联调

1 parent 888c3f4b
Showing 54 changed files with 1284 additions and 1542 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: {
/**上传图片
*/
......@@ -46,31 +22,5 @@ module.exports = {
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'
const { appId } = wx.getAccountInfoSync().miniProgram
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
)
})
/**调用后台接口获取用户信息js_code换取sessionId */
async wxCodeLogin() {
const {
code
} = await this.getWxCode()
return await api.post({
method: 'scrm.api.sso.wechat.applets.jscode.login',
appId,
code
},
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)等。用户数据的加解密通讯需要依赖会话密钥完成。 */
getWxCode() {
......@@ -24,39 +43,84 @@ class UsersApi {
})
})
}
/**授权手机号 */
async authUserPhone(detail, sessionId) {
if (!sessionId) {
wx.$api.showToast('缺少sessionId')
/**授权手机号登录 */
async authUserPhone(detail, loginToken) {
if (!loginToken) {
wx.$api.showToast('缺少loginToken')
Promise.reject()
return
}
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject()
delete detail.errMsg
if (detail.iv && detail.encryptedData) {
wx.$api.showLoading()
detail.sessionId = sessionId
return api.post(
{
method: 'scrm.api.sso.weapp.auth.phone',
...detail
detail.loginToken = loginToken
return api.post({
method: 'scrm.api.sso.wechat.applets.auth.phone',
...detail,
platformEntrance: 'STORE_ASSISTANT', // 平台标识:生意助手-BUSINESS_ASSISTANT,门店助手-STORE_ASSISTANT
},
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')
})
/**账号密码登录 */
accountLogin(data = {}) {
return api.post({
method: 'scrm.api.sso.wechat.applets.password.login',
...data,
platformEntrance: 'STORE_ASSISTANT',
},
true
)
}
/** 手机号获取短信验证码 */
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
......@@ -9,7 +9,7 @@ import { setSystem_info } from '~/utils/cache/storageApi'
import getUpdateManager from './utils/lib/wxUpdateManager'
// 埋点
import './utils/track/Track'
// import './utils/track/Track'
import eventbus from './utils/evenbus'
......
......@@ -4,9 +4,12 @@
"pages/tab/discovery/discovery",
"pages/tab/mine/mine",
"pages/webView/webView",
"pages/login/login/login",
"pages/login/register/register",
"pages/login/registerSuccess/registerSuccess"
"pages/authentication/login/login",
"pages/authentication/register/register",
"pages/authentication/registerSuccess/registerSuccess",
"pages/authentication/registerInfo/registerInfo",
"pages/authentication/accountItems/accountItems",
"pages/authentication/customerService/customerService"
],
"requiredPrivateInfos": [
"getLocation"
......@@ -46,9 +49,10 @@
"subpackages": [],
"usingComponents": {
"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"
},
"resolveAlias": {
"~/*": "/*"
},
......
// 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]
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
{
"usingComponents": {
"navigation-bar": "/components/NavigationBar/NavigationBar"
}
}
\ 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
<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
// pages/login/register/register.js
// pages/authentication/customerService/customerService.js
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
/* 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
<!--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') {
setLoginInfo(data.loginUserInfoList[0], data.sessionId)
} else wx.$api.showToast(message || '系统异常')
})
}
/**设置登录信息 */
const setLoginInfo = (userInfo, sessionId) => {
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
// pages/login.js
import USERAPI from '~/api/usersApi/index'
import {
selectAccountLogin,
setLoginInfo
} from '../lib/index'
Page({
/**
* 页面的初始数据
*/
data: {
padHeight:0,
loginMethod: 0,
formData:{
phone:'18778545361',
code:'8888'
},
authorized: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
}
USERAPI.phoneSmsLogin(obj).then(({
code,
data,
message,
errId
}) => {
if (code == '0') {
this.checkLoginUserInfo(data)
} else if(errId=='30990103') {
this.setData({
authorized:true
})
}else{
wx.$api.showToast(message || '系统异常')
}
}).catch(err => {
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(){
this.setData({
loginMethod: 1
})
},
input(e){
const {value} = e.detail
const {name} = e.target.dataset
console.log(e,this.data.formData,'88')
},
/**获取验证码 */
getSmsCode() {
const {
phoneReady,
formData,
count
} = this.data,
countDown = 60
if (count) 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)
},
wxLogin({
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'){
this.setData({
authorized:true
})
}else{
wx.$api.showToast(message || '系统异常')
}
}).catch(({
errMsg
}) => {
wx.$api.showToast('系统异常')
})
},
goServicePage(){
wx.$router.go('/pages/authentication/customerService/customerService')
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "登录"
}
\ No newline at end of file
......@@ -5,22 +5,24 @@
<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-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">微信授权登录</button>
<view class="phone-btn login-btn" bindtap="switchLoginMethod">手机号码登录</view>
</view>
<view class="login-wrap login-input-wrap" wx:else>
<view class="login-btn phone">
<input maxlength="{{11}}" adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholderClass" placeholder="请输入手机号码"/>
<input maxlength="11" adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholderClass" placeholder="请输入手机号码" bindinput="input" value="{{formData.phone}}" data-name="phone"/>
</view>
<view class="login-btn code">
<input adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholder" placeholder="请输入验证码"/>
<view class="code-btn">获取验证码</view>
<input maxlength="4" adjust-position="{{false}}" bindfocus="inputBindFocus" bindblur="inputBindBlur" placeholder-class="placeholder" placeholder="请输入验证码"
bindinput="input" value="{{formData.code}}" data-name="code"/>
<view class="code-btn" bindtap="getSmsCode">{{count? count + 's':'获取验证码'}}</view>
</view>
<view class="login-btn wx-btn" bindtap="handleLogin">登录</view>
</view>
</view>
<popup show="{{false}}" confirmText="联系客服" title="提示" height="560rpx">
<popup bindconfirm="goServicePage" show="{{authorized}}" confirmText="联系客服" title="提示" height="560rpx">
<view class="popup-content">当前登录手机号未认证,请联系客服处理</view>
</popup>
</view>
// pages/login.js
import USERAPI from '~/api/usersApi/index'
Page({
/**
* 页面的初始数据
*/
data: {
padHeight:0
},
},
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
}) {
console.log(detail,'detaildetail')
if (!detail.code) return
USERAPI.authUserPhone(detail, this.loginToken).then(({
code,
data,
message,
errId
}) => {
if (code == '0'){
wx.$router.reLaunch('/pages/tab/index/index')
}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 || '系统异常')
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options,'options')
let data = decodeURIComponent(options.data)
console.log(data)
this.init()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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() {
wx.hideHomeButton({
success: (res) => {},
})
},
/**
......
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "注册"
}
\ No newline at end of file
......@@ -2,12 +2,13 @@
<view class="container">
<view class="salutation-wrap">
<view class="salutation">您好</view>
<view class="welcome">欢迎登录门店助手</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 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) => {
console.log(res,'paramsparams')
})
// wx.$router.go('/pages/authentication/registerSuccess/registerSuccess',{type:0})
},
inputStaffNamme(e){
const {value} = e.detail
this.setData({
staffName: value
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "注册"
}
\ 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
<!--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({
/**
......@@ -32,7 +31,7 @@ Page({
},1000)
},
goLogin(){
wx.$router.reLaunch('/pages/login/login/login')
wx.$router.reLaunch('/pages/authentication/login/login')
},
/**
......
{
"usingComponents": {},
"navigationBarTitleText": "注册"
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ Component({
* 组件的属性列表
*/
properties: {
btnHeight: Number
},
/**
......@@ -22,8 +22,9 @@ Component({
let {
height
} = e.detail;
console.log(height,'heightheightheight')
this.setData({
user_box_style: `padding-top:${height + 20}px`,
btnHeight: `${height + 128}px`,
});
},
/**
......
......@@ -2,7 +2,6 @@
.header{
position: relative;
width: 100%;
height: 304rpx;
margin-bottom: 80rpx;
box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6);
}
......
<!--pages/tab/discovery/components/headerNav/headerNav.wxml-->
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text>
</navigation-bar>
<view class="header">
<view style="height: {{btnHeight}}" class="header">
<image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image>
<scroll-view class="scene-wrap" scroll-x="{{true}}">
<block wx:for="{{sceneList}}" wx:key="index">
......
......@@ -13,6 +13,7 @@ Component({
* 组件的初始数据
*/
data: {
sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'],
activeNavIdx: 0,
tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'],
......
.header{
position: relative;
width: 100%;
margin-bottom: 80rpx;
box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6);
}
.scene-wrap{
position: absolute;
bottom: 0;
transform: translateY(75rpx);
white-space: nowrap;
}
.scene-item{
width: 672rpx;
height: 180rpx;
}
// 特色产品
.prod-wrap .big-title{
margin-left: 40rpx;
......
<!--pages/tab/discovery/components/product/product.wxml-->
<view style="height: {{btnHeight}}" class="header">
<image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image>
<scroll-view class="scene-wrap" scroll-x="{{true}}">
<block wx:for="{{sceneList}}" wx:key="index">
<image class="scene-item" src="{{IMGURL}}{{item}}"></image>
</block>
</scroll-view>
</view>
<view class="prod-wrap">
<text class="big-title">特色产品</text>
<scroll-view class="nav-wrap" scroll-x="{{true}}">
......
// pages/tab/output/output.js
const navStyle = "background-color: transparent;";
Page({
/**
* 页面的初始数据
*/
data: {
btnHeight: 0,
navStyle,
},
navbarReady(e) {
let {
height
} = e.detail;
this.setData({
btnHeight: height,
});
},
/**
* 生命周期函数--监听页面加载
......
<view style="background: #fff;">
<headerNav></headerNav>
<product></product>
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}" page-title="发现">
<text>发现</text>
</navigation-bar>
<view>
<product></product>
</view>
</view>
\ No newline at end of file
......@@ -63,7 +63,7 @@
],
"include": []
},
"appid": "wxfe82b8d65d07808f",
"appid": "wxe10067a63c1856ac",
"projectname": "miniprogram-scrm-shopmall",
"condition": {}
}
\ No newline at end of file
{
"setting": {
"compileHotReLoad": true,
"compileHotReLoad": false,
"urlCheck": false,
"lazyloadPlaceholderEnable": true
},
......@@ -65,24 +65,45 @@
},
{
"name": "",
"pathName": "pages/login/login/login",
"pathName": "pages/authentication/login/login",
"query": "",
"launchMode": "default",
"scene": null
},
{
"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": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/authentication/registerInfo/registerInfo",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/login/registerSuccess/registerSuccess",
"pathName": "pages/authentication/customerService/customerService",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/authentication/accountItems/accountItems",
"query": "sessionId=mini-3c6766f3-f734-4a64-8fd2-3f0224ffa9dd-rop",
"launchMode": "default",
"scene": null
}
]
}
......
......@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试
3生产
*/
const index = 3
const index = 1
const secretKey = {
ip: {},
dev: {
......
import { secretKey, pathEnum, domain, index, sign } from './http.js'
import {
secretKey,
pathEnum,
domain,
sign
} from './http.js'
// import util from '../util'
import { getSessionId } from '~/utils/cache/storageApi'
let INTERRUPT = false
import {
getSessionId
} from '~/utils/cache/storageApi'
/**接口 */
class Request {
get(params, returnAll = false) {
......@@ -10,20 +16,15 @@ class Request {
post(params, returnAll = false) {
return this.request('POST', params, returnAll)
}
reportTrack(params) {
return this.request('POST', params, true)
}
request(RequestMethods, params, returnAll) {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
let header =
RequestMethods === 'POST'
? {
'content-type': 'application/x-www-form-urlencoded'
}
: {}
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
if (merchantId) header.merchantId = merchantId
RequestMethods === 'POST' ?
{
'content-type': 'application/x-www-form-urlencoded'
} :
{}
let projectName = this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName]
......@@ -38,33 +39,18 @@ class Request {
success(response) {
/**业务代码 */
let {
data: { code, message },
data: {
code,
message
},
data
} = response
if (code == 20 || code == 21) {
wx.hideLoading()
const thisPage = wx.$router.getPageInstance()
if (thisPage && thisPage.pageRefresh) thisPage.pageRefresh()
if (!wx.$authStatus) {
if (INTERRUPT) return
INTERRUPT = true
// 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(() => {})
}
if(thisPage.route == 'login/loading/loading') {
resolve(data)
return
} else wx.$router.reLaunch('login.index')
} else {
if (returnAll) {
resolve(data)
......@@ -125,22 +111,5 @@ class Request {
const projectName = method.split('.')[2]
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!