Commit fb94f03f by liimin

feat: sales(miniprogram-scrm-carlife)物理迁入 apps/mp/sales

- 1950 个文件整仓迁入:app.js/app.json + pages/packageActivity/packageDiscovery/
  packageShopmall/packageStoreAssistant + api/components/lib/mixins/router/style/utils
- 去 glsx-common-sdk 依赖:Version 落到本地 utils/versionConfig.js(文件里点名了
  它是 SDK 的本地实现),签名/请求走 @uj/api-core;glsx-applet-component 与
  glsk-map-jssdk 是真实 npm 包,保留在 lane 依赖里(lockfile 已解析到
  1.1.29 / 0.1.1,声明的 ^1.1.25 因此只是下限)
- lane 依赖与脚手架同 store:package.json 补 @uj/api-core(workspace:*) 等声明,
  eslint.config.js 换 flat 版,lint 收窄为 eslint src
- 已知未决(交接):sales 没有自己的 .gitignore,日后 devtool「构建 npm」会把
  miniprogram_npm 落成未跟踪噪声,需要补一行;env 真源 index=1 写死在 utils 里,
  与 manifest.json 的口径待收敛
1 parent c28dd8ee
Showing 1000 changed files with 4747 additions and 4 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

import ActivityApi from './ActivityApi.js'
export default new ActivityApi()
\ No newline at end of file
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'
import busassistantApi from './busassistantApi'
const common = 'scrm.api.carlife.common.'
import { appId } from '~/utils/constantData'
import environment from '~/utils/request/environment.js'
import marketingApi from './marketingApi'
import solitaireApi from './solitaireApi'
import claimsApi from './claimsApi'
module.exports = {
ssoApi,
indexApi,
discoveryApi,
shopmallApi,
mineApi,
couponsApi,
equityApi,
entmicroApi,
boutiquecouponApi,
psdApi,
sopApi,
carlifeApi,
bigdatautilApi,
busassistantApi,
marketingApi,
solitaireApi,
claimsApi,
commonApi: {
/**上传图片
*/
uploadImg(data) {
return api.post({
method: `${common}uploadImg`,
...data,
noSignAttr: ['file']
})
},
/**视频上传
*/
uploadVideo(data) {
return api.post({
method: `${common}uploadVideo`,
...data,
noSignAttr: ['file']
})
},
// /**根据sceneId 查参数 */
// getSceneById(data) {
// return api.post('dj.api.smartcarlife.common.getSceneById', data)
// },
/** 首页、发现列表 搜索接口 */
search(data) {
return api.post({
method: 'scrm.api.carlife.weapp.homeSearch.search',
pageSize: 10,
...data
})
},
/**获取mock数据 */
getMockData() {
return api.getMock()
},
createQrcode(data) {
const envVersion = {
0:'develop',
1:'develop',
2:'trial',
3:'release',
4:'trial'
}[environment.index]
return api.post(
{
method: 'scrm.api.wechat.miniprogram.createQrcode',
appId,
envVersion,
...data
},
true
)
},
getQrcodeParams(data) {
return api.post(
{
method: 'scrm.api.wechat.get.scene.by.id',
...data
},
true
)
}
}
}
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
})
},
/**
* 门店助手精品礼券
*/
getMerchantCouponList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.merchant.coupon.list',
...data
}, true)
},
/**
* 门店助手精品礼券 核销记录
*/
getMerchantCustomerCouponList(data) {
data.pageSize = 10
return api.post({
method: 'scrm.api.boutiquecoupon.customer.coupon.search',
...data
}, true)
},
/**
* 根据门店ID获取4S店员工
*/
getMerchantEmployee(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.employee.getByMerchantId',
...data
}, true)
},
/**
* 保存商户券门店助手订阅通知信息
*
*/
saveSaNotifyInfo(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.merchantCoupon.saveSaNotifyInfo',
...data
})
},
/**
* 获取数据看板数据
*
*/
getBoardData(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.orderSummary.getShopMerchantOutputReport',
...data
})
},
/**
* 获取数据看板数据
*
*/
getvinSetting(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.servicemerchant.yqMerchantConfig.detail',
...data
})
}
}
\ No newline at end of file
import api from "~/utils/request/request";
module.exports = {
// 获取小程序首页数据列表
getDiscoverList(data) {
return api.post({
method: 'scrm.api.busassistant.discover.weapp.list',
...data
},
true
)
},
// 获取一级菜单下所在类别所有数据
getContentList(data) {
return api.post({
method: 'scrm.api.busassistant.discover.weapp.contentList',
...data
},
true
)
},
// 获取特色产品内容详情
getDiscoverDetail(data) {
return api.post({
method: 'scrm.api.busassistant.discover.content.detail',
...data
},
true
)
},
// 获取案例视频、操作指引详情
getDetailWithLike(data) {
return api.post({
method: 'scrm.api.busassistant.discover.content.detailWithLike',
...data
},
true
)
}
}
\ No newline at end of file
import api from '~/utils/request/request'
module.exports = {
/** 获取线索列表 */
getClueList(data) {
return api.post({
method: 'scrm.api.carlife.weapp.clue.listWithPage',
pageSize: 10,
channelType: 'DJ',
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.assistant.claims.merchant.'
module.exports = {
getClaimsListApi(data) {
return api.post({
method: `${path}list.claims.page`,
...data
}, true)
},
syncContractInfoApi(data) {
return api.post({
method: `${path}create.before.init`,
...data
})
},
saveDamageInfoApi(data) {
return api.post({
method: `${path}lossDeter.draft.or.commit`,
...data
})
},
getAreaDataApi(data) {
return api.post({
method: `scrm.api.equity.service.claims.area`,
...data
})
},
getCommonDataApi(data) {
return api.post({
method: `scrm.api.equity.service.claims.payee.select`,
...data
})
},
getAccountInfoApi(data) {
return api.post({
method: `scrm.api.equity.service.claims.merchant.account`,
...data
})
},
getListTotalApi(data) {
return api.post({
method: `${path}count.claims`,
...data
})
},
getDetailInfoApi(data) {
return api.post({
method: `${path}detail`,
...data
})
},
saveClaimsInfoApi(data) {
return api.post({
method: `${path}claims.draft.or.commit`,
...data
})
}
}
\ No newline at end of file
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]
})
},
//获取领券中心优惠券列表
getCarCenterdData(data){
return api.post({
method: `${path}user.receive.center.list`,
...data
})
},
/**获取卡券数量 */
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,
receiveSource: 3
})
},
/**领取中心优惠券 */
reciveCenterCouponApi(data){
return api.post({
method: `${path}user.receive.center.get`,
...data
})
},
/**卡券详情 */
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
})
},
// 获取优惠券详情--道路救援
getDigitalCoupons(data) {
return api.post({
method: `scrm.api.coupon.detail`,
...data
})
},
// 领取发现模块的优惠券
toReciveDiscoverCard(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: 9,
receiveSource: 3
})
},
// 门店发现商城优惠券列表
getMerchantCouponsListApi(data) {
return api.post({
method: `scrm.api.coupon.discover.goods.list`,
...data
})
},
//批量领取门店发现商城优惠券
batchGetMerchantCouponsApi(data) {
return api.post({
method: `scrm.api.coupon.discover.goods.list.batch.receive`,
...data
})
},
// 分页查询发现专区车主优选油劵列表(小程序)
getDiscoverOilList(data) {
return api.post({
method: `scrm.api.shopmall.goods.discover.oil.coupon.page`,
...data
})
},
getUserCouponCount(data) {
return api.post({
method: `scrm.api.shopmall.goods.oil.coupon.user.count`,
...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
})
},
getDiscoverConfig(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.discover.channel.merchant.getconfig',
...data
})
},
getDiscoverChannelDetail(data) {
wx.$api.showLoading('加载中...')
return api.post({
method: 'scrm.api.shopmall.weapp.discoverchannel.detail',
...data
})
},
/**判断用户是否有领过膜类专区的优惠券 */
judgeRecord(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.discoverchannel.coupon.record.get',
...data
})
},
/**发现列表视频直播 */
getDiscoverChannelVideo(data) {
return api.post({
method: 'scrm.api.busassistant.discover.channel.live',
...data
})
},
/**查询小程序发现频道-配置升级的分类列表 */
getDiscoverChannelCategory(data) {
return api.post({
method: 'scrm.api.shopmall.discover.category.merchant.list',
...data
})
},
/**查询小程序发现频道-配置升级的商品 */
getDiscoverChannelCategoryGoods(data) {
return api.post({
method: 'scrm.api.shopmall.goods.configuration.list.mini',
...data
})
},
/*获取商户详情 */
getMerchantDetail(data) {
return api.post({
method: 'scrm.api.carlife.merchant.detail',
...data
})
}
}
\ No newline at end of file
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,
});
},
// 首页--附近优惠 新接口
getLasteCommodity(data) {
return api.post({
method: `scrm.api.equity.main.page.carefully.chosen.page`,
...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.list`,
// 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,
});
},
// 根据merchantId查询服务条款
serviceTermsById(data) {
return api.post({
method: `scrm.api.equity.serviceterms.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,
});
},
// 购买商品获取订单号
getOrderCode(data) {
return api.post({
method: `scrm.api.equity.ordercode.get`,
...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,
});
},
// 服务项目详情
serviceDetailById(data) {
return api.post({
method: `scrm.api.equity.service.h5.bill.merchant.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,
});
},
// 新增救援服务线索
addClueRescue(data) {
return api.post({
method: `scrm.api.carlife.weapp.clue.rescue`,
...data,
});
},
// 订单详情
orderDetail(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.detail`,
...data,
});
},
// 获取优惠券兑换码
getExchangecode(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.exchangecode.get`,
...data,
});
},
// 客户赠送权益列表查询
getCustomerEquityList(data) {
return api.post({
method: `scrm.api.equity.renew.customer.list`,
...data,
});
},
// 客户赠送权益列表查询前注册
setCustomerEquity(data) {
return api.post({
method: `scrm.api.shopmall.weapp.get.equity`,
...data,
});
},
// 手机号码快速直充
toRechargeByPhone(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.charge`,
...data,
});
},
// 获取国任省市区列表
areaList(data) {
return api.post({
method: `scrm.api.equity.service.claims.area`,
...data,
});
},
// 未开通服务项目查询服务条款
notOpenTerms(data) {
return api.post({
method: `scrm.api.equity.service.items.grade.detail`,
...data,
});
},
getHwFirstPageApi(data){
return api.post({
method: `scrm.api.equity.hw.order.getIndex`,
...data,
});
},
getHwActiveDayApi(data){
return api.post({
method: `scrm.api.equity.hw.order.getLimitedTimeActivity`,
...data,
});
},
getAnshifuInfoApi(data){
return api.post({
method: `scrm.api.equity.service.h5.service.get.anShiFu.customer.coupon`,
...data,
});
},
// 获取案件记录数据
claimsList(data) {
return api.post({
method: `scrm.api.assistant.claims.customer.list.claims.record`,
...data
})
},
// 获取案件记录详情数据
getClaimsDetail(data) {
return api.post({
method: `scrm.api.assistant.claims.customer.get.claims.detail`,
...data
})
},
// 根据合同号获取核赔基础信息
getClaimsBaseInfo(data) {
return api.post({
method: `scrm.api.assistant.claims.customer.create.before.init`,
...data
}, true)
},
// 提交理赔服务申请
claimsSubmit(data) {
return api.post({
method: `scrm.api.assistant.claims.customer.save.claims`,
...data
})
},
// 校验服务项目是否终止
checkItemsApi(data) {
return api.post({
method: 'scrm.api.assistant.claims.customer.check.items.code',
...data
})
}
};
import api from "~/utils/request/request";
module.exports = {
//获取任务是否结束
taskCheck(data) {
return api.post(
{
method: "marketing.api.game.task.open.check",
projectName: 'marketing',
...data,
},
true
);
},
//用户行为埋点上报
taskInsert(data) {
return api.post(
{
method: "marketing.api.game.task.customer.behavior.insert",
...data,
},
true
);
},
//获取任务详情
taskDetail(data) {
return api.post(
{
method: "marketing.api.game.task.detail",
...data,
},
true
);
},
//发放奖励
taskRewards(data) {
return api.post(
{
method: "marketing.api.game.task.get.rewards",
...data,
},
true
);
},
}
\ No newline at end of file
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.stoassistant";
class IntentionApi {
// 保存用户跟进线索
saveMerchantUserFollowInfo(data) {
return api.post(
{
method: `stoassistant.api.mission.saveMerchantUserFollowInfo`,
...data,
},
false,
false
);
}
// 获取意向客户列表
getNotPayUser(data) {
return api.post(
{
method: `scrm.api.assistant.not.pay.user`,
...data,
},
false,
true
);
}
}
export default IntentionApi;
import IntentionApi from './IntentionApi.js'
export default new IntentionApi()
\ No newline at end of file
import api from '~/utils/request/request'
module.exports = {
/**
* 获取指定活动客户统计信息
*/
getSupermarketData(data) {
return api.post({
method: 'marketing.api.supermarket.customers.statistics',
...data,
// activityId: 10509 //开发调试用
})
},
/**
*获取指定活动客户列表
*/
getSupermarketCustomerList(data) {
return api.post({
method: 'marketing.api.supermarket.customers.page',
pageSize: 999999,
pageNum: 1,
...data
})
},
/**
* 获取活动客户标签列表
*/
getSupermarketTagList(data) {
return api.post({
method: 'marketing.api.supermarket.customers.listCustomerTags',
...data
})
},
/** 更新跟进结果*/
updateFollow(data) {
return api.post({
method: 'marketing.api.supermarket.customers.updateFollow',
...data
})
},
/**
*发起AI外呼
*/
invokeAICall(data) {
return api.post({
method: 'marketing.api.supermarket.bulge.invokeAICall',
...data
}, true)
},
/**
发送膨胀金短信 */
sendSms(data) {
return api.post({
method: 'marketing.api.supermarket.bulge.sendSms',
...data
}, true)
},
/**
* 通话详情
*/
getPhoneCallDetail(data) {
return api.post({
method: 'marketing.api.supermarket.customer.call.detail',
...data
}, true)
},
/** AI外呼任务添加客户 */
addAICallCustomer(data) {
return api.post({
method: 'marketing.api.supermarket.bulge.addAICallCustomer',
...data
}, true)
},
/** 批量发起AI外呼 */
batchInvokeAICall(data) {
return api.post({
method: 'marketing.api.supermarket.bulge.executeAICall',
...data
}, true)
}
}
\ No newline at end of file
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
},
true
)
},
/**新增用户车辆 */
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
)
},
/** 获取智享车生活APP二维码图片地址 */
getAppQrcode() {
return api.post({
method: `${carlife}config.getAppQrcode`
})
},
/** 预约历史 */
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: 99999,
...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
})
},
/** 嘀加通用版新增维保预约线索 */
createMaintainOrder(data) {
return api.post({
method: 'scrm.api.carlife.weapp.clue.maintain',
...data
})
},
// 获取订单状态数量
getOrderNumberList(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.order.statis',
...data
})
},
// 查询用户是否存在待领取的国壬积分
searchUserForGR(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.gr.integral.search',
...data
})
},
// 领取国任积分
getUserForGR(data) {
return api.post({
method: 'scrm.api.shopmall.weapp.gr.integral.get',
...data
})
},
/** 获取门店主营车品牌 */
getMerchantCarBrandList(merchantIdList) {
return api.post({
method: 'merchants.api.open.merchant.info',
projectName: 'rop-merchants',
merchantIdList,
merchantInfoSwitch: {
brandFlag: true
}
}, false, false, 'merchant')
}
}
\ No newline at end of file
import MineApi from './mineApi.js'
export default new MineApi()
\ No newline at end of file
import api from "~/utils/request/request";
// const { appId } = wx.getAccountInfoSync().miniProgram
// import {getAppId} from '~/utils/utils_wx'
class MineApi {
// 获取积分详情
getScoreDetailApi(data) {
return api.post({
method: "stoassistant.api.score.detail",
...data,
});
}
// 提现记录
getWithdrawalListApi(data) {
return api.post({
method: "stoassistant.api.withdrawal.list",
...data,
});
}
// 提现
WithdrawalApi(data) {
return api.post({
method: "stoassistant.api.withdrawal.insert",
...data,
},
true
);
}
// 获取员工详情
getStaffDetailApi(data, params) {
return api.post({
method: "scrm.api.sso.wechat.account.staff.detail",
...data,
},
false,
params && params.isShowLoading
);
}
// 更新员工信息
updateStaffDetailApi(data) {
return api.post({
method: "scrm.api.sso.wechat.account.staff.update",
...data,
});
}
// 退出登录
logoutApi(data) {
return api.post({
method: "scrm.api.sso.wechat.applets.logout",
...data,
},
true
);
}
// 微信绑定
wechatBindApi(data) {
return api.post({
method: "scrm.api.sso.wechat.account.binding.openId",
...data,
},
true
);
}
// 扫码识别优惠券详情
couponsDetailByScan(data) {
return api.post({
method: 'scrm.api.assistant.coupon.verification.scan',
...data
})
}
// 确认核销
comfirmHx(data) {
return api.post({
method: 'scrm.api.assistant.coupon.verification',
...data
})
}
// 判断该门店是否支持线下单补录
makeUpExchange(data) {
return api.post({
method: "scrm.api.stoassistant.crowd.activity.makeup.exchange",
...data,
},
true
);
}
//获取该门店下参与众筹活动的员工
getActivityStaffList(data) {
return api.post({
method: "scrm.api.stoassistant.crowd.activity.staff.list",
...data,
},
true
);
}
//众筹活动指派工单
orderSupplement(data) {
return api.post({
method: "scrm.api.stoassistant.crowd.activity.order.Supplement",
...data,
},
true
);
}
//众筹模式活动列表
getActivityList(data) {
return api.post({
method: "scrm.api.assistant.crowd.activity.simple.page",
...data,
});
}
//创建众筹活动员工
createStaff(data) {
return api.post({
method: "scrm.api.stoassistant.crowd.activity.create.staff",
...data,
},
true
);
}
// 获取收益明细列表
getScoreListApi(data) {
return api.post({
method: "stoassistant.api.score.list",
...data,
});
}
/**根据员工id查询员工银行卡列表 */
getStaffBankList(data) {
return api.post({
method: 'scrm.api.stoassistant.withdrawal.staff.bank.list',
...data,
});
}
/** 根据id查询银行卡详情 */
getStaffBankDetail(data) {
return api.post({
method: 'scrm.api.stoassistant.withdrawal.staff.bank.detail',
...data,
});
}
/** 插入或更新员工银行卡信息 */
insetorupdateStaffBank(data) {
return api.post({
method: 'scrm.api.stoassistant.withdrawal.staff.bank.insetorupdate',
...data,
}, true);
}
/** 获取手续费率 */
getRate(data) {
return api.post({
method: 'scrm.api.stoassistant.withdrawal.staff.rate',
...data,
});
}
/** 积分提现门店白名单配置校验 */
checkMerchantOfpoints(data) {
return api.post({
method: 'stoassistant.api.withdrawal.of.points.merchant.check',
...data,
});
}
/** 获取部门 */
findDictData(data) {
return api.post({
method: 'merchants.api.menu.findDictData',
projectName: 'rop-merchants',
...data,
},false,false,'merchant');
};
/** 个人中心-积分收益详情 */
getDetail(data) {
return api.post({
method: 'stoassistant.api.score.list.detail',
...data,
});
}
}
export default MineApi;
\ No newline at end of file
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
)
}
}
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-03 14:26:10
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-04 11:03:13
* @FilePath: \miniprogram\api\rescueApi.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import api from "~/utils/request/request";
module.exports = {
/** 获取道路救援卡小程序客户页面接口 */
getRescueCustomerView(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.getRescueCustomerView",
...data,
},
true
);
},
rescueSave(data) {
return api.post({
method: `entmicro.api.drac.rescue.card.scan.record.save`,
...data,
});
},
// 道路救援卡小程序重新定位接口
rescueReacquireLocation(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.rescueReacquireLocation",
...data,
},
true
);
},
/** 车主绑定挪车码 */
bindMovecode(data) {
return api.post({
method: "entmicro.api.drac.rescue.move.car.code.bind",
...data,
});
},
/** 挪车码校验是否被绑定 */
checkMovecode(data) {
return api.post({
method: "entmicro.api.drac.rescue.move.car.code.check",
...data,
});
},
/** 挪车码绑定信息获取 */
getRescueinfo(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.get",
...data,
},
true
);
},
/** 修改挪车码绑定信息 */
getUpdateRescueinfo(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.update",
...data,
},
true
);
},
// 调用百度接口绑定车主和X虚拟号码(返回值为虚拟号码X)
rescueMoveCarBindAx(data) {
return api.post(
{
method: "entmicro.api.drac.rescue.move.car.code.bind.ax",
...data,
},
true
);
},
};
import api from '~/utils/request/request'
const projectName = 'material'
module.exports = {
/**获取接龙抽奖详情 */
getSolitaireDetail(data) {
return api.post({
method: 'marketing.api.activityRedEnvelope.relay.lottery.detail',
projectName,
...data
})
},
/**
* 获取用户接龙信息
*/
getSolitaireUserInfo(data) {
return api.post({
method: 'marketing.api.activityRedEnvelope.relay.lottery.user.info',
projectName,
...data,
}, true)
},
/**
* 分页查询群接龙中奖明细列表
*/
getSolitaireAewardList(data) {
data.pageSize = 99999
data.pageNum = 1
return api.post({
method: 'marketing.api.activityRedEnvelope.relay.lottery.record.page',
projectName,
...data
})
},
/** 提交接龙 */
commitSolitaire(data) {
return api.post({
method: 'marketing.api.activityRedEnvelope.relay.lottery.user.commit',
projectName,
...data
}, true)
},
/**分页获取用户红包中奖记录 */
getRedEnvelopeRecordList(data = {}) {
return api.post({
method: 'marketing.api.activityRedEnvelope.user.winning.goods.record.page',
projectName,
pageSize: 10,
...data
})
},
/**
* 快递到家地址信息配置列表
*/
getDeliveryConfig(data = {}) {
return api.post({
method: 'marketing.api.self.red.envelope.customer.write.config.list',
projectName,
...data
})
},
submitDelivery(data) {
return api.post({
method: 'marketing.api.self.red.envelope.customer.write.detail.save',
projectName,
...data
}, true)
},
getActivityRedEnvelopeDetail(data = {}) {
return api.post({
method: 'marketing.api.activityRedEnvelope.findOne',
projectName,
...data
})
},
/**绑定红包 */
bindRedEnvelopeLink(data = {}) {
return api.post({
method: 'marketing.api.self.red.envelope.banding.link',
projectName,
...data
},true)
},
/** 开奖成功后记录信息 */
recordedPrizeInfo(data = {}) {
return api.post({
method: 'marketing.api.activityRedEnvelope.relay.user.claim',
projectName,
...data
})
},
/**分页获取用户红包中奖记录 */
getRedEnvelopeRecordList(data = {}) {
return api.post({
method: 'marketing.api.activityRedEnvelope.user.winning.goods.record.page',
projectName,
pageSize: 10,
...data
})
},
/**
* 快递到家地址信息配置列表
*/
getDeliveryConfig(data = {}) {
return api.post({
method: 'marketing.api.self.red.envelope.customer.write.config.list',
projectName,
...data
})
},
/**提交地址信息 */
submitDelivery(data) {
return api.post({
method: 'marketing.api.self.red.envelope.customer.write.detail.save',
projectName,
...data
}, true)
},
}
\ No newline at end of file
import api from '~/utils/request/request'
import {
getScene,
sopTrackPage,
sopTrackPageType
} from '~/utils/constantData'
const getDuration = page_show_time => (Date.now() - page_show_time) / 1e3
const reportClick = ({
thisPage,
options
}) => {
thisPage.options = {
...options,
...thisPage.options
}
reportSopCustomer(thisPage, 'PAGE_CLICK')
}
const reportHide = ({
thisPage
}) => {
reportSopCustomer(thisPage, 'PAGE_STOP')
}
const reportSopCustomer = async (thisPage, event_type) => {
const {
options,
route
} = thisPage
if (sopTrackPage.includes(route)) {
if (!sopTrackPage.includes(wx.$router.getPageInstance().route)) return
if (options && options.scene) {
const data = await getScene(options.scene)
thisPage.options = data
reportSopFun(thisPage, event_type)
} else reportSopFun(thisPage, event_type)
}
}
const reportSopFun = async (thisPage, event_type) => {
const {
options,
route
} = thisPage
if (!options.sopId) return
const userInfo = wx.$storage.get('srcm_shopmall_user_info') || wx.$storage.get("userInfo") || {},
pageType = sopTrackPageType[route] || '',
activityId = pageType == 4 ? options.couponId || '' : options.id || '', //商城券取couponId
merchantId = options.merchantId || '',
unionId = userInfo.unionId || wx.$storage.get('wx_user_info').unionId,
sopId = options.sopId || '',
extra = {
pageType,
activityId,
unionId,
merchantId,
sopId,
}
if (event_type == 'PAGE_STOP') extra.time = getDuration(thisPage.page_show_time)
const buryingPointList = [{
customer_phone: userInfo.phone,
add_way: 'SOP',
sopId,
// id_number: '',
// org_user_id: '',
// wechat_id: '',
wechat_union_id: unionId,
org_id: merchantId,
system_source: 'scrm',
platform: 'MimiProgram',
event_type,
event_time: new Date().format('yyyy-MM-dd hh:mm:ss'),
extra: JSON.stringify(extra)
}]
api.post({
method: 'marketing.api.sop.buryingPoint',
projectName: 'marketing',
buryingPointList
}, true)
}
module.exports = {
/**
* sop客户埋点上报
*/
reportSopCustomer,
reportClick,
reportHide,
/** sop用户行为记录(埋点调用)
*/
customerbehavior(data) {
return api.post({
method: 'scrm.api.sop.task.customerbehavior.add',
flag: 1,
...data
})
},
customerbehaviorByEventId(data) {
return api.post({
method: 'scrm.api.sop.event.customerbehavior.add',
...data
})
},
//sop概览
getSopOverview(data) {
return api.post({
method: 'scrm.api.marketing.sop.overview',
projectName: 'stoassistant',
...data
})
},
// sop任务客户列表
getSopTaskCustomer(data) {
return api.post({
method: 'scrm.api.sop.task.customer.page',
projectName: 'stoassistant',
...data
})
},
// sop客户智能档案
getSopArchives(data) {
return api.post({
method: 'scrm.api.sop.task.customer.archives',
projectName: 'stoassistant',
...data
})
},
// sop任务列表
getSopList(data) {
return api.post({
method: 'scrm.api.marketing.sop.list',
projectName: 'stoassistant',
...data
},
true)
},
// sop客户-更改旅程阶段
updateStage(data) {
return api.post({
method: 'scrm.api.sop.task.customer.stage.update',
projectName: 'stoassistant',
...data
})
},
}
\ No newline at end of file
import api from '~/utils/request/request'
const path = 'scrm.api.sso.weapp.'
module.exports = {
/**wx.login登录 */
jsCodeLogin(data) {
return api.post(
{
method: `${path}jscode.login`,
...data
},
true
)
},
/**授权用户信息 */
authUserInfo(data) {
return api.post({
method: `${path}auth.login`,
...data
})
},
/**授权手机号 */
authUserPhone(data) {
return api.post(
{
method: `${path}auth.phone`,
...data
},
true
)
},
/**退出 */
logout() {
return api.post(
{
method: `scrm.api.sso.user.logout`
},
true
)
},
//保存用户授权信息
saveuserProfile(data) {
return api.post(
{
method: `scrm.api.wechat.auth.userProfile.save`,
...data
},
true
)
},
/**更新客户手机号 */
updataCustomerPhone(data) {
return api.post({
method: `scrm.api.sso.weapp.mark.phone`,
...data
})
},
loginByOpenId(data){
return api.post({
method: `scrm.api.sso.weapp.auth.openIdLogin`,
...data
},
true)
},
}
import api from '~/utils/request/request'
// const { appId } = wx.getAccountInfoSync().miniProgram
import {
appId
} from '~/utils/constantData'
// console.log(appId, 'appId')
let loginCount = null,
loginCache = null,
loginTimer = null
class UsersApi {
/**调用后台接口获取用户信息 */
async login() {
const appEnter = wx.getEnterOptionsSync()
try {
if (appEnter.scene === 1154 && appEnter.mode === 'singlePage') throw 'login:fail rejected due to no permission currently'
if (!loginCount) {
loginCache = null
loginCount = Date.now()
const {
code
} = await this.getWxCode(),
data = await api.post({
method: 'scrm.api.sso.weapp.jscode.login',
appId,
code,
delSessionId: true
},
true
)
loginCache = data
loginCount = null
return Promise.resolve(data)
} else {
return new Promise((resolve) => {
loginTimer = setInterval(() => {
if (loginCache) {
clearInterval(loginTimer)
loginCount = null
resolve(loginCache)
}
}, 1e3)
})
}
} catch (error) {
if (loginTimer) clearInterval(loginTimer)
loginCount = null
return Promise.reject(error)
}
}
/**调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 */
getWxCode() {
return new Promise((resolve, reject) => {
wx.login({
success: res => resolve(res),
fail: err => reject(err)
})
})
}
/**授权手机号 */
async authUserPhone(detail, sessionId) {
if (!sessionId) {
wx.$api.showToast('缺少sessionId')
Promise.reject({
errMsg: '缺少sessionId'
})
}
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
wx.$storage.rm('userInfo')
wx.$storage.rm('sessionId')
return api.post({
method: 'scrm.api.sso.weapp.auth.phone',
...detail
},
true
)
} else Promise.reject(detail.errMsg)
}
/**更新客户手机号 */
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.$storage.rm('srcm_shopmall_customer_id')
})
}
/**调用后台接口获取用户信息js_code换取sessionId */
async wxCodeLogin() {
const appEnter = wx.getEnterOptionsSync()
try {
if (appEnter.scene === 1154 && appEnter.mode === 'singlePage') throw 'login:fail rejected due to no permission currently'
const {
code
} = await this.getWxCode()
return await api.post({
method: 'scrm.api.sso.wechat.applets.jscode.login',
appId,
code
},
true
)
} catch (error) {
return Promise.reject(error)
}
}
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
)
}
/**授权手机号登录 */
async authStorePhone(detail, loginToken) {
if (!loginToken) {
wx.$api.showToast('缺少loginToken')
Promise.reject({
errMsg: '缺少loginToken'
})
return
}
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject()
delete detail.errMsg
if (detail.iv && detail.encryptedData) {
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(detail.errMsg)
}
/**账号密码登录 */
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(data = {}) {
return api.post({
method: 'scrm.api.sso.login.status.check',
...data
},
true
)
}
/**获取微信用户信息 */
async getWXUserInfo() {
let wx_user_info = wx.$storage.get('wx_user_info')
if (!wx_user_info) {
try {
const data = await this.getUserProfile()
wx.$storage.set('wx_user_info', data)
return data
} catch (error) {
return {}
}
} else return wx_user_info
}
/** 手机号授权解析(单纯解析内容返回前端)
* 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号
*/
async getUserProfile(loginToken, detail = {}) {
if (detail.errMsg && detail.errMsg == 'getPhoneNumber:fail user deny') Promise.reject()
delete detail.errMsg
if (!loginToken) {
let res = await this.wxCodeLogin()
loginToken = res.data
}
detail.loginToken = loginToken
return api.post({
method: 'scrm.api.sso.wechat.applets.phone.grant.analysis',
...detail,
platformEntrance: 'STORE_ASSISTANT'
})
}
/**微信登录检查是否有门店账号
* single ? 手机号 : 加密信息
*
*/
checkUserPhone(data, single) {
const method = single ? 'scrm.api.sso.user.login.account.isStaffPhone' : 'scrm.api.sso.wechat.check.phone.have.store.assistant.account'
return api.post({
method,
...data,
}, true)
}
/**更新C端用户信息 */
//
async updateUserInfo(userInfo) {
try {
const {
openId,
unionId
} = await this.getWXUserInfo()
userInfo.openId = openId
userInfo.appId = appId
userInfo.unionId = unionId
return api.post({
method: 'scrm.api.wechat.auth.userProfile.updateUserInfo',
userInfo
})
} catch (error) {
return Promise.reject()
}
}
/**
* 选择账号登录(手机绑定多个账号时) */
selectAccountLoginByPassword(data) {
return api.post({
method: 'scrm.api.sso.wechat.applets.password.selectAccountLogin',
platformEntrance: 'STORE_ASSISTANT',
...data
},
true
)
}
/*
*C端手机号短信登录
*/
phoneLogin(data) {
return api.post({
method: 'scrm.api.sso.weapp.auth.phone.mini',
source: 'MINIAPP',
...data
}, true)
}
// 解析微信群的opengid
async getOpengid(data) {
const {
code
} = await this.getWxCode()
data.code = code
data.appId = appId
return api.post({
method: 'scrm.api.sso.wechat.convert.analysis.opengid',
...data
}, true)
}
/**opengid转chatId */
async openGIdtoChatId(data) {
data.projectName = 'entmicro'
return api.post({
method: 'entmicro.api.customer.base.chat.opengid.to.chantid',
...data
}, true)
}
}
export default UsersApi
\ No newline at end of file
import UsersApi from './UsersApi.js'
export default new UsersApi()
\ No newline at end of file
import api from '~/utils/request/request'
const serverApi = {
getActive: 'scrm.api.busassistant.activity.getActivityUrl' //获取活动配置
}
export const getActiveApi = data => {
return api.post(
{
method: serverApi.getActive,
...data
},
true
)
}
// 获取活动记录全集
export const getActivityRecord = (data)=> {
return api.post({
method: `entmicro.api.business.activityRecord.list`,
...data
}, true)
}
// 根据id查询
export const getActivityDetail = (data) => {
return api.post({
method: `entmicro.api.business.activityRecord.detail`,
...data
})
}
\ No newline at end of file
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-03 14:25:43
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-04 17:57:08
* @FilePath: \miniprogram\app.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// app.js
// 初始化sentry
// import sentryInit from "~/utils/sentryConfig/sentryInit";
// sentryInit();
import router from "./router/index.js";
import util from "./utils/util.js";
import eventbus from "./utils/evenbus";
// import USER from '~/api/usersApi/index'
import TRACK from "./utils/Track";
import Tracking from '~/utils/tracking'
const $Tracking = new Tracking()
import {
busassistantApi
} from './api/api'
// 判断小程序是否需要更新
import getUpdateManager from "./utils/lib/wxUpdateManager";
import {
setPageParams,
login
} from "~/utils/appFn/index";
import {
setSystem_info
} from "~/utils/cache/storageApi";
// 微信小程序异步使用 使用方法wx.pro+对应api即可 promisify 这个是配置单独某个api
// import { promisifyAll } from './utils/lib/wx-promise-pro'
// promisifyAll()
// 实例化对象存储
import {
Storage
} from "./utils/cache/storage";
const $Storage = new Storage();
import wxApi from "./utils/utils_wx";
const { createVersionConfig } = require('./utils/versionConfig.js')
import {
reportClick,
reportStop,
reportHide
} from './api/sopApi'
App({
onLaunch(options) {
/**挂载到wx对象 */
wx.$authStatus = false;
wx.$util = util;
wx.$router = router;
wx.$eventbus = eventbus;
wx.$storage = $Storage; /** 挂载全局缓存方法 */
wx.$api = wxApi;
wx.$imgUrl =
"https://img02.glsx.com.cn/weapp/resource/miniprogram-test/glsx/";
// wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/'
wx.$Track = new TRACK(options, {
onLoadFun: [
reportClick
],
onHideFun:[
reportHide
]
});
wx.$tracking = $Tracking
// wx.$imgUrl = 'https://img01.glsx.com.cn/weapp/resource/dj-shopmall/'
// 存储设备信息
wx.$versionConfig = createVersionConfig({
request: {
baseUrl: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config'
}
})
setSystem_info();
const {
scene,
query: {
pageType
}
} = wx.getEnterOptionsSync(),
userInfo = $Storage.get("userInfo");
if (userInfo && userInfo.userType && ![1011, 1012, 1013].includes(scene)) {
if (
(options.path.includes("shopMall") ||
options.path.includes("packageShopmall")) &&
!options.path.includes("packageExpandedGold") &&
!pageType && !options.path.includes("GHUserLogin") && !options.path.includes("ghEquity") && options.path != "packageShopmall/packageMine/pages/integral/index/index"
) {
setTimeout(() => {
wx.reLaunch({
url: "/packageStoreAssistant/packageAuth/pages/authentication/loading/loading",
});
}, 100);
}
}
},
onShow(options) {
console.log(options)
const {
path
} = options;
getUpdateManager();
setPageParams(options);
const noPath = ["pages/tab", "pages/crowdfunding", "packageStoreAssistant", "pages/blank/blank", "packageShopmall/packageRescue/pages/accident/index/index", 'packageShopmall/packageExpandedGold/pages/activity/index/index', 'packageShopmall/packageMine/pages/integral/index/index']
try {
noPath.map(e => {
if (path.startsWith(e)) throw true
})
} catch (error) {
return
}
login()
},
// 获取公共数据
getBaseData() {
console.log("method")
return new Promise((resolve, reject) => {
busassistantApi.getDiscoverList().then(res => {
console.log(res, '555');
resolve(res.data)
})
})
},
/**兼容旧链接 */
onPageNotFound(res) {
console.log(res, "不存在的页面");
wx.reLaunch({
url: `/pages/pageNotFound/pageNotFound?res=${encodeURIComponent(
JSON.stringify(res)
)}`,
});
},
async getVersionInfo(request) {
if (request) this.globalData.versionData = null
const {
versionData
} = this.globalData
if (versionData) return versionData
else {
const res = await wx.$versionConfig.get({
moduleUrl: 'mini-merchant',
env: 'update'
})
this.globalData.versionData = res
return res
}
},
globalData: {
merchantId: "101430",
cheapGoodsList: [],
isLoadingOver: false,
pageParam: {
appearance: 1,
pageSize: 0,
pageCount: 3
},
versionData: null,
ROUTE_QUERY: {},
},
onHide() {
util.customerbehavior(2)
}
})
\ No newline at end of file
@import "/style/common.wxss";
@import "/style/sprite.wxss";
page {
background-color: #F7F7F7;
color: #282829;
font-size: 28rpx;
--themeColor: #F13C3D;
--btnColor: #FC5B32;
--borderRadius: 8rpx;
--margin: 32rpx;
--storeBtnColor: #3666FE;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
}
image {
width: 100%;
height: 100%;
vertical-align: top;
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
transform: translateY(7rpx);
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
\ No newline at end of file
// components/LicensePlate/LicensePlate.js
const suffix = '港澳学挂',
city = '京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼',
platNumberRex = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学港澳])$/
let timer
Component({
options: {
styleIsolation: 'shared'
},
/**
* 组件的属性列表
*/
properties: {
showNavHeight:Boolean,
navheight:Number
},
/**
* 组件的初始数据
*/
data: {
plateNoErr: true,
plateIndex: 0,
plateNo: new Array(8).fill(''),
hidden: true
},
/**
* 组件的方法列表
*/
methods: {
noScroll(){},
changeIndex(e) {
let {
index
} = e.currentTarget.dataset, {
plateIndex
} = this.data
if (plateIndex == index) return
plateIndex = index
this.setData({
plateIndex
})
},
changePlateNo(e) {
let {
value
} = e.currentTarget.dataset, {
plateIndex
} = this.data
const index = plateIndex
if (plateIndex < 7) ++plateIndex
this.setData({
[`plateNo[${index}]`]: value,
plateIndex
})
this.check()
},
async paste() {
let {
data
} = await wx.getClipboardData(),
value = data.toUpperCase(),
plateNo = [...value].filter(e => e && e != '' && /[\u4e00-\u9fa5\w]/.test(e))
while (plateNo.length < 8) plateNo.push('')
plateNo = plateNo.splice(0, 8)
if (platNumberRex.test(plateNo.join(''))) {
this.setData({
plateNo
})
this.check()
}
},
del() {
let {
plateIndex,
plateNo
} = this.data
const index = plateIndex
if(!plateNo[index] && index == 0) return
if (plateIndex > 0) --plateIndex
this.setData({
[`plateNo[${index}]`]: '',
plateIndex
})
this.check()
},
check() {
let {
plateNo
} = this.data,
plateNoErr = false
/**车牌后缀 */
if (plateNo[6] && plateNo[7] && suffix.includes(plateNo[6])) this.setData({
[`plateNo[${7}]`]: ''
})
if (!platNumberRex.test(plateNo.join(''))) plateNoErr = true
this.setData({
plateNoErr,
keyboardDisabled: suffix.includes(plateNo[6])
})
wx.vibrateShort()
},
toggle() {
let {
hidden
} = this.data
this.setData({
hidden: !hidden
})
if (!hidden) {
if (timer) clearTimeout(timer)
this.setData({
animation: true
}, () => {
timer = setTimeout(() => {
this.setData({
animation: false
})
}, 500)
})
}
},
done() {
let {
plateNo
} = this.data,
value = plateNo.join('')
this.triggerEvent('done', {
value
})
this.toggle()
}
},
lifetimes: {
ready() {
this.setData({
cityList: [...city],
letter: [...'ABCDEFGHJKLMNPQRSTUVWXYZ'],
suffix: [...suffix]
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/LicensePlate/LicensePlate.wxss */
.license-plate {
width: 100vw;
height: 100vh;
position: fixed;
z-index: 8;
bottom: -100%;
left: 0;
&-box {
position: absolute;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
background-color: #fff;
}
&-title {
padding: 0 20rpx;
justify-content: space-between;
}
.cancel {
background-color: transparent !important;
}
.done {
background-color: #f13c3d;
color: #fff;
}
.btn {
height: 60rpx;
margin: 0 !important;
font-size: 28rpx;
display: flex;
align-items: center;
&::after {
display: none;
}
}
.btn-hover {
opacity: .75;
}
&-content {
.title {
font-size: 40rpx;
font-weight: 700;
text-align: center;
padding: 20rpx 0 40rpx;
}
.plate-box {
justify-content: center;
.item {
width: 60rpx;
height: 80rpx;
background: rgba($color: #B6B6B6, $alpha: .26);
border-radius: 8rpx;
border: 2rpx solid rgba($color: #B6B6B6, $alpha: .26);
margin-right: 10rpx;
justify-content: center;
}
.active {
border-color: #f13c3d;
}
.arc {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background-color: #000;
margin-right: 10rpx;
}
}
.paste {
background-color: #f13c3d;
color: #fff;
margin: 60rpx !important;
&::after {
display: none;
}
}
}
&-bottom{
position: absolute;
width: 100%;
min-height: 400rpx;
left: 0;
bottom: 0;
background: rgba($color: #B6B6B6, $alpha: .16);
}
&-keyboard {
padding: 20rpx;
display: flex;
.keyboard-del {
width: 120rpx;
height: auto;
margin-left: auto;
background-color: #fff;
justify-content: center;
border-radius: 8rpx;
.icon {
width: 60rpx;
height: 60rpx;
}
}
.city{
width: calc(100% - 140rpx);
grid-template-columns: repeat(6, 1fr);
}
.grid {
display: grid;
gap: 14rpx;
}
.letter {
grid-template-columns: repeat(7, 1fr);
}
.number {
grid-template-columns: repeat(10, 1fr);
margin-bottom: 14rpx;
}
.suffix {
grid-template-columns: repeat(4, 1fr);
margin-top: 14rpx;
}
.item {
height: 60rpx;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
padding: 0 !important;
font-size: 24rpx;
margin: 0 !important;
&::after {
display: none;
}
}
.disabled {
opacity: .2;
}
}
.type-2{
display: block;
position: relative;
.keyboard-left{
width: 100%;
}
.number{
width: 100%;
}
.letter,.suffix{
width: calc(100% - 140rpx);
}
.keyboard-del{
position: absolute;
right: 20rpx;
top: 94rpx;
height: calc(100% - 114rpx);
}
}
}
.license-plate.true{
animation: show-license-plate .25s forwards reverse;
}
.license-plate.show{
animation: show-license-plate .25s forwards;
}
@keyframes show-license-plate {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
\ No newline at end of file
<view class="license-plate {{hidden?'':'show'}} {{animation}}" catchtouchmove="noScroll">
<view class="license-plate-box">
<view wx:if="{{showNavHeight}}" style="height:{{navheight}}px"></view>
<view class="license-plate-title flex">
<button class="cancel btn" bindtap="toggle">
取消
</button>
<button class="done btn" disabled="{{plateNoErr}}" hover-class="btn-hover" bindtap="done">
完成
</button>
</view>
<view class="license-plate-content">
<view class="title">
请输入车牌号码
</view>
<view class="plate-box flex">
<block wx:for="{{plateNo}}" wx:key="{{index}}">
<view class="item flex {{index==plateIndex?'active':''}}" bindtap="changeIndex" data-index="{{index}}">
{{item}}
</view>
<block wx:if="{{index==1}}">
<view class="arc"></view>
</block>
</block>
</view>
<button class="paste" hover-class="btn-hover" bindtap="paste">
一键粘贴
</button>
</view>
<view class="license-plate-bottom isFullSucreen">
<view class="license-plate-keyboard {{plateIndex != 0?'type-2':''}}">
<block wx:if="{{plateIndex == 0}}">
<view class="grid city">
<block wx:for="{{cityList}}" wx:key="{{index}}">
<view class="item" data-value="{{item}}" bindtap="changePlateNo">
{{item}}
</view>
</block>
</view>
</block>
<block wx:else>
<view class="keyboard-left">
<view class="grid number">
<block wx:for="{{10}}" wx:key="{{index}}">
<button class="item" data-value="{{item}}" bindtap="changePlateNo" disabled="{{plateIndex == 1 || (keyboardDisabled && plateIndex == 7)}}" hover-class="btn-hover">
{{item}}
</button>
</block>
</view>
<view class="grid letter">
<block wx:for="{{letter}}" wx:key="{{index}}">
<button class="item" data-value="{{item}}" bindtap="changePlateNo" disabled="{{keyboardDisabled && plateIndex == 7}}" hover-class="btn-hover">
{{item}}
</button>
</block>
</view>
<view class="grid suffix">
<block wx:for="{{suffix}}" wx:key="{{index}}">
<button class="item" data-value="{{item}}" bindtap="changePlateNo" disabled="{{plateIndex < 6 || (keyboardDisabled && plateIndex == 7)}}" hover-class="btn-hover">
{{item}}
</button>
</block>
</view>
</view>
</block>
<view class="keyboard-del flex" bindtap="del">
<glsx-image class="icon" src="crowdfunding/KeyboardDeleteOutlined.png"></glsx-image>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
// components/PageLoading/PageLoading.js
Component({
/**
* 组件的属性列表
*/
properties: {
color: {
type: String,
value: '#f13c3d'
},
isFullScreen: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/PageLoading/PageLoading.wxss */
.nothing {
display: flex;
align-items: center;
justify-content: center;
aspect-ratio: 1/1;
flex-direction: column;
font-size: 28rpx;
color: rgb(40, 40, 41);
}
.nothing.true{
position: fixed;
top: 50%;
width: 100%;
transform: translateY(-50%);
}
.loading {
height: 48rpx;
margin-bottom: 16rpx;
}
.loading view {
width: 16rpx;
height: 100%;
display: inline-block;
animation: stretchdelay 1.2s infinite ease-in-out;
margin: 0 4rpx;
}
.loading view:nth-child(2) {
animation-delay: -1.1s;
}
.loading view:nth-child(3) {
animation-delay: -1s;
}
.loading view:nth-child(4) {
animation-delay: -.9s;
}
@keyframes stretchdelay {
0%,
100%,
40% {
transform: scaley(.33);
}
20% {
transform: scaley(1);
}
}
\ No newline at end of file
<view class="nothing {{isFullScreen}}">
<view class="loading ">
<block wx:for="{{4}}" wx:key="index">
<view style="background-color: {{color}};"></view>
</block>
</view>
<slot></slot>
</view>
\ No newline at end of file
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
observer: function (n, o) {
if (!n) {
this.setData({
close: true
})
setTimeout(() => {
this.setData({
showPopup: false
})
}, 0.25 * 1000)
} else {
this.setData({
showPopup: true,
close: false
})
}
}
},
title: String,
height: {
type: String,
value: '85%'
},
only: {
type: Boolean,
value: true
},
confirmText: {
type: String,
value: '确定'
},
confirmColor: String,
loading: Boolean
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
hidePopup() {
this.setData({
show: false
})
},
confirm() {
let { loading } = this.data
if (loading) return
this.triggerEvent('confirm')
}
},
attached() {
this.setData({
isFullSucreen: wx.$api.isFullSucreen()
})
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="popup " hidden="{{!showPopup}}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content {{close?'close':''}}" style="height:{{height}}">
<block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view>
</block>
<view class="popup-slot {{isFullSucreen?title?'isFullSucreen':'isFullSucreen-notitle':''}}">
<slot></slot>
</view>
<view class="popup-footer isFullSucreen" wx:if="{{only}}">
<button class="cancel btn text-center" hover-class="btn-hover" bindtap="hidePopup">取消</button>
<button class="confirm btn text-center" bindtap="confirm" hover-class="btn-hover" style="background-color: {{confirmColor}};" loading="{{loading}}">{{confirmText}}</button>
</view>
<view class="popup-footer isFullSucreen" wx:else>
<button class="confirm doubtn text-center" bindtap="confirm" hover-class="btn-hover" style="background-color: {{confirmColor}};" loading="{{loading}}">{{confirmText}}</button>
</view>
</view>
</view>
\ No newline at end of file
/* tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.wxss */
.popup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
}
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.popup-content {
position: absolute;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
animation: show-popup .5s forwards;
box-sizing: border-box;
}
.popup-content.close {
animation: hide-popup-box .25s forwards;
}
.popup-title {
height: 98rpx;
font-size: 32rpx;
color: #333333;
border-bottom: 2rpx solid #EBEDF0;
}
.popup-slot {
height: calc(100% - 200rpx);
}
.popup-slot.isFullSucreen {
height: calc(100% - 268rpx);
}
.popup-slot.isFullSucreen-notitle {
height: calc(100% - 170rpx);
}
.popup-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 32rpx;
position: relative;
background-color: #fff;
z-index: 2;
}
.popup-footer.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.popup-footer .btn {
width: 330rpx;
height: 88rpx;
box-sizing: border-box;
border-radius: 8rpx;
font-size: 28rpx;
}
.popup-footer .doubtn {
width: 100%;
height: 88rpx;
box-sizing: border-box;
border-radius: 8rpx;
font-size: 28rpx;
}
.popup-footer .cancel {
color: #323233;
border: 2rpx solid #DCDEE0;
}
.popup-footer .confirm {
background: var(--btnColor);
color: #fff;
}
@keyframes show-popup {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
@keyframes hide-popup-box {
0% {
bottom: 0;
}
100% {
bottom: -100%;
}
}
.btn-hover {
opacity: .75;
}
\ No newline at end of file
// components/Service/Service.js
// import { IMG_URL } from '~/utils/constantData'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
Component({
/**
* 组件的属性列表
*/
properties: {
isFixed: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
isShow: false,
showView:false
},
/**
* 组件的方法列表
*/
methods: {
getMockSetting(){
let merchantId = wx.getStorageSync('showServicesMerchantId');
wx.$util.getMockData().then(res=>{
if(res&&merchantId&&res.merchantId){
if(res.merchantId.includes(Number(merchantId))){
this.setData({
showView:true
})
}
}
})
},
handleShow() {
this.setData({
isShow: !this.data.isShow
})
}
},
lifetimes: {
attached() {
wx.$eventbus.on('SERVICES', ()=>{
this.getMockSetting()
})
this.getMockSetting()
},
},
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Service/Service.wxss */
.service {
position: fixed;
right: 0rpx;
top: 73%;
z-index: 999;
}
.icon {
width: 64px;
height: 64px;
}
.layout {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .8);
}
.poster {
width: 750rpx !important;
height: 720rpx !important;
border-radius: 0;
}
.close {
margin-top: 60rpx;
width: 64rpx;
height: 64rpx;
}
}
\ No newline at end of file
<!--components/Service/Service.wxml-->
<view wx:if="{{showView}}" class="{{isFixed ? 'service' : '' }}">
<image src="{{IMG_URL}}index/service.png" class="icon" bindtap="handleShow"></image>
<view wx:if="{{isShow}}" class="layout">
<view class="bg" bindtap="handleShow" />
<image class="poster" src="{{IMG_URL}}index/service-detail.png" show-menu-by-longpress="{{true}}"></image>
<image src="{{IMG_URL}}index/close.png" class="close" bindtap="handleShow"></image>
</view>
</view>
\ No newline at end of file
// components/TabBar/TabBar.js
Component({
options: {
styleIsolation: 'shared'
},
/**
* 组件的属性列表
*/
properties: {
list: {
type: Array,
value: [],
observer(n) {
n && n.length && this.setData({
tabList: JSON.parse(JSON.stringify(n))
})
}
},
color: {
type: String,
observer(_color) {
this.setData({
_color
})
}
},
selectedColor: {
type: String,
observer(_selectedColor) {
this.setData({
_selectedColor
})
}
},
tabIndex: Number,
show: Boolean
},
/**
* 组件的初始数据
*/
data: {
tabList: []
},
/**
* 组件的方法列表
*/
methods: {
init() {
wx.$api.getViewInfo(
'#tab-bar',
res => {
const thisPage = wx.$router.getPageInstance()
thisPage.setData({
tabBarHeight: res.height
})
wx.setStorageSync('tabBarHeight', res.height)
},
this
)
wx.$eventbus.on('changeTabBar', res => {
let {
tabList
} = this.data, {
_color,
tabStyle,
changeKeyList
} = res
tabList.map((e, index) => {
changeKeyList.map((key) => {
e[key] = res[key][index]
})
})
this.setData({
_color,
tabStyle,
tabList
})
})
wx.$eventbus.on('restoreTabBar', _ => {
this.restoreTabBar()
})
},
restoreTabBar() {
const {
list,
color
} = this.data
this.setData({
tabList: JSON.parse(JSON.stringify(list)),
tabStyle: '',
_color: color
})
},
change(e) {
let {
index
} = e.currentTarget.dataset, {
tabIndex
} = this.data
if (tabIndex == index) return
this.triggerEvent('change', index)
this.restoreTabBar()
}
},
lifetimes: {
attached() {
this.init()
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/TabBar/TabBar.wxss */
.tab-bar{
position: fixed;
left: 0;
background-color: #fff;
z-index: 99;
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24rpx;
animation: show-tab-bar .5s forwards;
border-top: 1rpx solid #F4F4F5;
.item{
flex: 1;
flex-shrink: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: all .5s;
.icon-box{
width: 44rpx;
height: 44rpx;
margin-bottom: 8rpx;
.active-icon{
animation: showicon .5s forwards;
}
}
}
}
@keyframes showicon {
0%{
transform: scale(.25);
}
100%{
transform: scale(1);
}
}
@keyframes show-tab-bar {
0%{
bottom: -100%;
}
100%{
bottom: 0;
}
}
\ No newline at end of file
<block wx:if="{{!show}}">
<view class="tab-bar isFullSucreen" id="tab-bar" style="{{tabStyle}}">
<block wx:for="{{tabList}}" wx:key="index">
<block wx:if="{{!item.hideTab}}">
<view class="item" style="color: {{tabIndex == index ? _selectedColor :_color}};" bindtap="change" data-index="{{index}}">
<view class="icon-box">
<block wx:if="{{tabIndex == index}}">
<image src="{{item.selectedIconPath}}" class="active-icon" />
</block>
<block wx:else>
<image src="{{item.iconPath}}" class="icon" />
</block>
</view>
{{item.name}}
</view>
</block>
</block>
</view>
</block>
\ No newline at end of file
// components/TimelineToast/TimelineToast.js
let timer
Component({
/**
* 组件的属性列表
*/
properties: {
src: {
type: String,
value: 'store-assistant/share/pyq_tip_to_mini.png'
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
showToastBox() {
this.setData({
showToast: true
})
if (timer) clearTimeout(timer)
timer = setTimeout(() => {
this.setData({
showToast: false
})
}, 1.5e3)
},
},
lifetimes: {
ready() {
wx.$eventbus.on('showTimeLineToast', _ => {
this.showToastBox()
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/TimelineToast/TimelineToast.wxss */
.showYDMini{
position: fixed;
bottom: 4px;
right: 32rpx;
z-index: 10088;
.toast{
width: 300rpx;
height: 134rpx;
animation: move-toast 1.5s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
}
@keyframes move-toast {
10%,
90% {
transform: translateY(-1px);
}
20%,
80% {
transform: translateY(2px);
}
30%,
50%,
70% {
transform: translateY(-4px);
}
40%,
60% {
transform: translateY(4px);
}
}
<block wx:if="{{showToast}}">
<view class="showYDMini">
<glsx-image class="toast" src="{{src}}" webp></glsx-image>
</view>
</block>
\ No newline at end of file
import {
mineApi,
} from '~/api/api'
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
userName:{
type:String,
observer(name){
this.handleName(name)
}
},
verifyId:Number
},
/**
* 组件的初始数据
*/
data: {
textList: [],
disable: true,
status: 0
},
/**
* 组件的方法列表
*/
methods: {
handleName(str) {
if (!str) return
const len = str.length
const arr = str.split('')
let temp = []
arr.forEach(el => {
let obj = {
text: el,
needFill: false,
verify: ''
}
temp.push(obj)
})
// 姓名为两个或三个字:展示第一和第三个字,第二个字需输入,
// 姓名为四个字:展示第一和第四个字,第二和第三个字需输入,
// 姓名为五个字或大于五个字,展示第一、第二、第五及以后的字,第三和第四个字需输入
if (len < 4) {
temp[1].needFill = true
} else if (len == 4) {
temp[1].needFill = true
temp[2].needFill = true
} else if (len > 4) {
temp[2].needFill = true
temp[3].needFill = true
}
this.setData({
textList: temp
})
},
intText(e) {
const { index } = e.currentTarget.dataset
const value = e.detail.value
const name = `textList[${index}].verify`
this.setData({
[name]: value
}, () => {
const { textList } = this.data
let flag = false
textList.forEach(el => {
if (el.needFill) {
if (!el.verify) {
flag = true
}
}
})
this.setData({
disable: flag
})
})
},
confirmText() {
const { textList, disable } = this.data
let success = true
if (disable) return
textList.forEach(el => {
if (el.needFill && el.verify != el.text) {
if (el.verify != el.text) {
success = false
}
}
})
if (!success) return this.setData({ status: 2 })
if (success) {
this.setData({ status: 1 })
this.toJumpMineJF()
setTimeout(() => {
this.setData({ status: 0 })
this.cancel()
}, 1500)
}
},
cancel() {
this.setData({
show: false
})
},
confirmCancel() {
this.setData({
status: 0,
disable: true
})
},
// 获取需要匹配账户的名称
async toJumpMineJF() {
const id = this.data.verifyId
const res = await mineApi.getUserForGR({id})
if(res){
wx.$router.go(`/packageShopmall/packageMine/pages/integral/index/index`,{source:'mine'})
}
}
},
lifetimes: {
// attached() {
// this.getMatchAcconut()
// },
}
})
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
.modal_container {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba($color: #000000, $alpha: 0.58);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.pannel {
width: 620rpx;
background: #FFFFFF;
border-radius: 16rpx;
position: relative;
.title {
padding: 40rpx 48rpx 16rpx 48rpx;
font-weight: 600;
font-size: 34rpx;
color: #000000;
text-align: center;
}
.fail_title{
padding: 40rpx 48rpx;
font-weight: 600;
}
.tip {
font-weight: 400;
font-size: 30rpx;
color: #0a111a80;
text-align: center;
padding-bottom: 40rpx;
}
.fill_wrap {
padding: 0 90rpx 40rpx;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
.text_c {
font-weight: 600;
font-size: 40rpx;
color: #282829;
margin-right: 24rpx;
margin-bottom: 20rpx;
}
.text_fill {
width: 80rpx;
height: 80rpx;
background: #327ffa1a;
border: 1rpx solid #327ffa26;
border-radius: 8rpx;
margin-right: 24rpx;
margin-bottom: 20rpx;
}
.int_fill {
width: 80rpx;
height: 80rpx;
color: #282829;
text-align: center;
font-weight: 600;
font-size: 40rpx;
}
}
.footer {
display: flex;
border-top: 1rpx solid #f1f1f1;
position: relative;
.btn {
width: 50%;
height: 102rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 34rpx;
color: #333333;
}
.confirm {
color: #2A69FF;
}
.line {
position: absolute;
left: 50%;
top: 0;
height: 102rpx;
transform: translateX(-50%);
width: 1rpx;
background: #f1f1f1;
}
.disable {
color: #999;
}
.btn_fail{
width: 100%;
}
}
.successToast {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 252rpx;
height: 252rpx;
background: #00000099;
border-radius: 24rpx;
z-index: 101;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.icon {
width: 96rpx;
height: 96rpx;
}
.text {
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
margin-top: 16rpx;
}
}
}
\ No newline at end of file
<view wx:if="{{show}}" class="modal_container">
<view class="pannel">
<block wx:if="{{status!=2}}">
<view class="title">确认身份</view>
<view class="tip">为保证积分准确发放,请输入名称</view>
<view class="fill_wrap">
<block wx:for="{{textList}}" wx:key="index">
<view wx:if="{{!item.needFill}}" class="text_c">{{item.text}}</view>
<view wx:else class="text_fill">
<input bindinput="intText" data-index="{{index}}" maxlength="1" class="int_fill" />
</view>
</block>
</view>
</block>
<block wx:if="{{status==2}}">
<view class="title fail_title">姓名与账户不匹配,请核对</view>
</block>
<view class="footer">
<block wx:if="{{status!=2}}">
<view bind:tap="cancel" class="btn">取消</view>
<view bind:tap="confirmText" class="btn confirm {{disable?'disable':''}}">确定</view>
<view class="line"></view>
</block>
<block wx:if="{{status==2}}">
<view bind:tap="confirmCancel" class="btn btn_fail confirm">确定</view>
</block>
</view>
<!-- 成功提示 -->
<view wx:if="{{status==1}}" class="successToast">
<glsx-image class="icon" webp src="glsx/mine/toast_success.png"></glsx-image>
<view class="text">身份校验成功</view>
</view>
</view>
</view>
\ No newline at end of file
// components/image/index.js
import {
IMG_URL,
IMG_VERSION
} from '../../utils/constantData'
Component({
externalClasses: ['custom-class', 'class'],
/**
* 组件的属性列表
*/
properties: {
src: {
type: String,
value: '',
observer: async function (url, o) {
if (url) {
let isWebp = url.includes('webp')
let checkList = ['https://', 'http://']
let isFullAdd = checkList.map(item => url.includes(item)).some(item => item)
this.setData({
isWebp,
imagePath: `${isFullAdd ? '' : IMG_URL}${url}?v=` + await IMG_VERSION()
})
}
}
},
mode: {
type: String,
value: 'scaleToFill'
},
webp: {
type: Boolean,
value: true
},
alt: {
type: String,
value: ''
},
showMenuByLongpress: Boolean
},
/**
* 组件的初始数据
*/
data: {
imagePath: '',
isWebp: false
},
// 组件生命周期
lifetimes: {
// 在组件实例进入页面节点树时执行
// attached: function () {
// let src = this.data.src
// let prefix = IMG_URL
// this.setData({
// imagePath: `${prefix}${src}?v=` + IMG_VERSION()
// })
// },
// 在组件实例被从页面节点树移除时执行
detached: function () {}
},
/**
* 组件的方法列表
*/
methods: {}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- components/image/index.wxml -->
<image src="{{imagePath}}" mode="{{mode}}" webp="{{webp||isWebp}}" alt="{{alt}}" lazy-load class="custom-class class" show-menu-by-longpress="{{showMenuByLongpress}}" />
\ No newline at end of file
/* components/image/index.wxss */
\ No newline at end of file
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-01-04 17:56:22
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-01-04 17:58:16
* @FilePath: \miniprogram\config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**
* 用来配置小程序项目的变量
* 统一管理
*/
// 配置预发布的小程序aapId
export const preReleaseAppId = "wx24ebae5768e74138";
// 小程序id
export const appId = "wx2c28337db96364d2";
// 开发环境
// 开发指定的小程序
// sentry Dsn 地址
export const dsnUrl =
"https://bab6664653a24cfcb3f4d9747f7ed652@sentry.glsx.com.cn/32";
import {
setSessionId,
setUserInfo
} from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import ActivityApi from '~/api/activityApi/index'
const setRouteData = targetPath => {
let [url, query] = targetPath.split('?'),
obj = {}
if (query) {
let arr = query.split('&')
arr.forEach(el => {
const [key, val] = el.split('=')
Object.assign(obj, {
[key]: val
})
})
// const [key, val] = query.split('=')
// obj = {
// [key]: val
// }
}
return {
url,
obj
}
}
/**选择账号登录 */
const selectAccountLogin = ({
id,
sessionId,
missionId,
tab,
merchantId,
pages,
tabType,
isGH,
ghPhone
}) => {
let para = {
id,
sessionId,
}
let apiName = 'selectAccountLogin'
if (ghPhone) {
para.phone = ghPhone
apiName = 'selectAccountLoginByPassword'
}
USERAPI[apiName](para).then(({
code,
data,
message
}) => {
if (code == '0') {
const userInfo = wx.$storage.get('userInfo') || {},
[info] = data.loginUserInfoList
if (userInfo.merchantId == info.merchantId && userInfo.uuid == info.uuid && userInfo.boutiqueCoupon_myself_status) info.boutiqueCoupon_myself_status = true
setLoginInfo(info, data.sessionId, missionId, tab, merchantId, pages, tabType, isGH)
} else wx.$api.showToast(message || '系统异常')
})
}
/**设置登录信息 */
const setLoginInfo = (userInfo, sessionId, missionId, tab, merchantId, pages, tabType, isGH) => {
setUserInfo(userInfo)
setSessionId(sessionId)
if (isGH) {
console.log(userInfo);
ActivityApi.findStaff({ staffUuid: userInfo.uuid }).then(res => {
if (res && res.length) {
const roleName = res[0].roleName
const merchantId = res[0].merchantNo
if (roleName === '售后专员') {
wx.navigateTo({
url: '/packageStoreAssistant/packageAuth/pages/GHStaff/StoreNote/index?merchantId='+merchantId,
});
} else if(roleName === '续保专员'){
wx.navigateTo({
url: '/packageStoreAssistant/packageAuth/pages/GHStaff/EquityRegister/index',
});
}else{
wx.$api.showToast('请使用有效账号进行登录')
}
} else {
wx.$api.showToast('请使用有效账号进行登录')
}
})
return
}
loginSuccess(missionId, tab, merchantId, pages, tabType)
}
/**成功跳转 */
const loginSuccess = (missionId, tab, merchantId, pages, tabType) => {
const {
options: {
targetPath
}
} = wx.$router.getPageInstance()
if (targetPath || missionId || pages) {
if (missionId) {
wx.nextTick(() => {
wx.$router.reLaunch('/packageStoreAssistant/packageActivity/pages/taskDetail/taskDetail', {
missionId,
tabType,
isCard:true
})
})
return
}
if (pages == 'addFLG' || pages == 'addFLGStep' || pages == 'myFollow') {
wx.nextTick(() => {
wx.$router.reLaunch(`/packageStoreAssistant/packageActivity/pages/${pages}/index`, {
open: 1
})
})
return
}
const {
url,
obj
} = setRouteData(targetPath)
wx.$router.reLaunch(url, obj)
} else wx.$router.reLaunch('/pages/tab/storeAssistant/index', {
notIntercept: true,
tab,
merchantId
})
}
module.exports = {
selectAccountLogin,
loginSuccess,
setRouteData,
setLoginInfo
}
\ No newline at end of file
import {IMG_URL} from '~/utils/constantData'
module.exports = Behavior({
data: {
IMGURL: IMG_URL
}
})
\ No newline at end of file
import imgUrlMixin from './imgUrl'
import jumpAuthMixin from './jumpAuthMixin'
module.exports = {
imgUrlMixin,
jumpAuthMixin
}
module.exports = Behavior({
methods: {
getNickNameAndHeadUrl() {
const redirectUrl = `https://scrm.glsx.com.cn/wy-wx-oauth`,
appid = 'wx1cf40dc91c28a7fd',
wxUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
wx.$router.jumpH5(wxUrl)
},
jumpLoading() {
const {
options
} = this
let query = ['isLogin=1'],
params = {
merchantId: options.merchantId || ''
}
Object.keys(options).map(key => {
if (key != 'scene') query.push(`${key}=${options[key]}`)
})
let url = encodeURIComponent(`/${this.route}?${query.join('&')}`)
params.url = url
if (options.scene) params.scene = options.scene
wx.$router.redirectTo('/pages/loading/loading', params)
},
}
})
\ No newline at end of file
module.exports = Behavior({
data: {
track_timerFlag: false,
track_batchId: null,
track_page_view_flag: false
},
methods: {
onHide() {
this.setData({
track_timerFlag: false,
track_batchId: null,
track_page_view_flag: false,
})
},
onPageShow() {
// debugger
if (this.data.track_page_view_flag) return
if (!this.data.track_batchId) this.setData({
track_batchId: wx.$tracking.setRandomId('batch')
})
this.setData({
track_page_view_flag: true,
track_timerFlag: true
})
this.setBrowseTrackData()
},
onPageHide() {
wx.$tracking.setTrackingData(2, this.data.track_event_code, this.track_businessParam, this.data.track_batchId, this.data.scene)
if (this.timer) clearTimeout(this.timer)
this.setData({
track_timerFlag: false,
track_batchId: null,
track_page_view_flag: false
})
this.timer = null
},
setBrowseTrackData() {
try {
if (!this.data.track_timerFlag) return this.onPageHide()
else this.timer = setTimeout(() => {
this.setBrowseTrackData()
}, 10e3)
wx.$tracking.setTrackingData(2, this.data.track_event_code, this.track_businessParam, this.data.track_batchId, this.data.scene)
} catch (error) {
console.log(error, 'error')
}
},
}
})
\ No newline at end of file
......@@ -2,18 +2,22 @@
"name": "@uj/mp-sales",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "eslint ."
"lint": "eslint src"
},
"dependencies": {
"@uj/api-core": "workspace:*"
"@uj/api-core": "workspace:*",
"@vant/weapp": "^1.10.5",
"glsx-applet-component": "^1.1.25",
"glsk-map-jssdk": "^0.1.1",
"number-precision": "^1.6.0"
},
"devDependencies": {
"@uj/contracts": "workspace:*",
"@uj/eslint-config": "workspace:*",
"@uj/typescript-config": "workspace:*",
"typescript": "catalog:"
}
},
"main": "app.js"
}
// packageActivity/pages/redEnvelope/index/index.js
import {
jumpAuthMixin
} from '~/mixins/index'
import {
solitaireApi,
} from "~/api/api"
import {
domain
} from '~/utils/request/environment'
Page({
behaviors: [jumpAuthMixin],
/**
* 页面的初始数据
*/
data: {
count: 3
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
const {
options
} = this
if (options.isLogin) this.getRedEnvelopeH5()
else this.jumpLoading() //直接打开时跳转、防止sessionId失效
},
async getRedEnvelopeH5() {
const res = await wx.$router.intercept()
if (!res) {
const {
userInfo
} = this.data
let {
id,
awardInfoId,
activityId,
businessId,
source,
linkId
} = this.options
if (!activityId) {
activityId = id
this.options.activityId = id
}
if (!userInfo.nickName) return this.getNickNameAndHeadUrl()
try {
const {
sourceType
} = await solitaireApi.getActivityRedEnvelopeDetail({
id: activityId
})
if (awardInfoId) jumpRedEnvelopeH5({
activityId
}, () => {
this.jump()
})
else {
if (linkId) this.jumpRedEnvelopeH5({
activityId,
linkId,
source
})
else {
const {
code,
data,
message
} = await solitaireApi.bindRedEnvelopeLink({
activityId,
bindingSource: source,
wechatName: userInfo.nickName,
businessId
})
if (code == 0) {
if (data.id && data.link) {
// /**sourceType 0-自研,1-外采 */
if (sourceType == 1) {
this.showRedModel()
this.jumpUrl = data.link
} else this.jumpRedEnvelopeH5({
activityId,
linkId: data.id,
source
})
} else throw {
message,
errId
}
} else throw {
message,
errId
}
}
}
} catch ({
message,
errId
}) {
console.log(message)
if (message) wx.showModal({
title: '温馨提示',
content: message,
confirmText: '知道了',
showCancel: false,
confirmColor: '#F13C3D',
success: function (res) {
if (res.confirm) {
if (errId == '202207218' || errId == '202207224') wx.$router.redirectTo('/packageActivity/pages/redEnvelope/record/record')
else wx.$router.redirectTo('/pages/tab/shopMall/index', {
tabIndex: 3
}) //错误统一跳转至我的
}
}
})
}
}
},
jumpRedEnvelopeH5({
activityId,
linkId,
source
}, callBack) {
const {
awardInfoId,
merchantId,
recordId
} = this.options, {
userInfo: {
accountId,
nickName,
unionId,
openid,
phone
},
userInfo
} = this.data, sessionId = wx.$util.getSessionId()
let user = encodeURIComponent(JSON.stringify({
accountId,
nickName,
unionId,
openid,
phone
})),
query = `activityId=${activityId}&merchantId=${merchantId || userInfo.merchantId}&sessionId=${sessionId}&userInfo=${user}`
if (linkId) query += `&linkId=${linkId}`
// 绑定来源 0:权益会员卡;1:调查问卷;2:群接龙
if (source > -1) query += `&source=${source}`
if (recordId) query += `&recordId=${recordId}`
if (awardInfoId) query += `&awardInfoId=${awardInfoId}`
this.linkQuery = query
if (callBack) callBack()
else this.showRedModel()
},
showRedModel() {
this.setData({
show: true
})
this.countDown()
},
countDown() {
let {
count,
isJump
} = this.data
let _this = this
if (count == 0) {
!isJump && this.jump()
if (this.timer) clearTimeout(this.timer)
return
}
this.timer = setTimeout(() => {
_this.setData({
count: count - 1
})
this.countDown()
}, 1e3)
},
jump() {
this.setData({
isJump: true,
show: false,
})
if (this.timer) clearTimeout(this.timer)
let url = this.jumpUrl ? this.jumpUrl : `${domain}/scrm-wx-red-packet/#/redEnvelope?${this.linkQuery}` //测试、预发布、生产
// url: `${domain}/dj-scrm-wx-work-main-lwk/#/?${this.linkQuery}` //开发环境
wx.$router.redirectToH5(url)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
/* packageActivity/pages/redEnvelope/index/index.wxss */
// 提示
.member-dialog {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.bg {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
background: rgba(0, 0, 0, .5);
}
.content {
position: relative;
text-align: center;
box-sizing: border-box;
.member-bg {
width: 550rpx;
height: 910rpx;
}
.count-down {
position: absolute;
top: 26rpx;
right: 26rpx;
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
background: #EA4D3A;
border-radius: 36rpx;
font-weight: 600;
font-size: 42rpx;
color: #FFFFFF;
}
.open-btn {
position: absolute;
bottom: 50rpx;
left: 28%;
width: 158rpx;
height: 158rpx;
}
}
}
\ 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!