Commit d8d3b63b by 前端

init

1 parent 51410f56
Showing 320 changed files with 2932 additions and 1534 deletions
project.config.json
project.private.config.json
sitemap.json
miniprogram_npm
node_modules
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
## 正式版appid wx2c28337db96364d2
## 体验版appid wx24ebae5768e74138
#### computed和watch方法使用
先导入并混合
```
// 注意: computed 函数中不能访问 this ,只有 data 对象可供访问
```
```js
// 导入方法
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
// 混入
behaviors: [computedBehavior],
// 使用
computed: {
test(data) {
return data.bgUrl + data.test
}
},
// 默认已深度监听
watch: {
'test, pages': function (a, b) {
console.log(a)
// this.setData({
// sum: a + b,
// })
}
},
```
File mode changed
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 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.'
import { mockUrl } from '~/utils/request/http'
/** mock */
function getMockApi() {
const url = mockUrl
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
module.exports = {
commonApi: {
/**上传图片
......@@ -32,9 +40,17 @@ module.exports = {
noSignAttr: ['file']
})
},
/**获取图片版本号 */
getImgVersion() {
return api.getMock()
}
/** mock */
getMock: getMockApi
},
/** 获取MOCK数据 */
getMockData: async function() {
let mock_data = wx.$storage.get('mock_data')
if (!mock_data) {
const data = await getMockApi()
wx.$storage.set('mock_data', data)
return data
} else return mock_data
}
}
import api from '~/utils/request/request'
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
}
class applyApi {
/**申请门店 */
merchantApply(data) {
return api.post(
{
method: 'scrm.api.busassistant.merchant.apply',
...data
}
// true
)
}
}
export default applyApi
import applyApi from './applyApi.js'
export default new applyApi()
import api from "~/utils/request/request";
const serverApi = {
getMerchantList: "scrm.api.busassistant.merchant.getMerchantListBySceneRemote", //根据场景值、服务商查询4s店
addCoProduct: "scrm.api.busassistant.merchant.addCoProduct", //申请合作产品
};
export const getMerchantListApi = (data) => {
return api.post(
{
method: serverApi.getMerchantList,
...data,
},
true
);
};
export const addCoProductApi = (data) => {
return api.post(
{
method: serverApi.addCoProduct,
...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
})
}
}
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 serverApi = {
//生成二维码
createQrCode: "scrm.api.wechat.miniprogram.createQrcode",
// 解析二维码参数
sceneById:'scrm.api.wechat.get.scene.by.id'
};
export const createQrCodeApi = (data) => {
return api.post(
{
method: serverApi.createQrCode,
...data,
},
true
);
};
export const sceneByIdApi = (data) => {
return api.post(
{
method: serverApi.sceneById,
...data,
}
);
};
\ No newline at end of file
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 serverApi = {
// 拓客户
productByscene: 'scrm.api.busassistant.activity.findSceneProductStatus',
// 看线索
unread: 'scrm.api.busassistant.clue.unread', //获取未读线索数量
page: 'scrm.api.busassistant.clue.page', //分页查询线索列表
read: 'scrm.api.busassistant.clue.read', //标记线索已读
tag: 'scrm.api.busassistant.clue.tag', //线索标记意向客户
battleMessage: 'scrm.api.busassistant.message.battleMessage' //获取最新战报消息
}
// 拓客户
const productBysceneApi = data => {
return api.post(
{
method: serverApi.productByscene,
...data
},
true
)
}
// 看线索
const unreadApi = data => {
return api.post(
{
method: serverApi.unread,
...data
},
true
)
}
const pageApi = data => {
return api.post(
{
method: serverApi.page,
...data
},
true
)
}
const readApi = data => {
return api.post(
{
method: serverApi.read,
...data
},
true
)
}
const tagApi = data => {
return api.post(
{
method: serverApi.tag,
...data
},
true
)
}
const battleMessageApi = data => {
return api.post({
method: serverApi.battleMessage,
...data
})
}
// 获取活动记录全集
const getActivityRecordApi = data => {
return api.post({
method: `entmicro.api.business.activityRecord.list`,
apiProjectName: 'drac',
...data
}, true)
}
// 根据id查询
const getActivityDetailApi = data => {
return api.post({
method: `entmicro.api.business.activityRecord.detail`,
apiProjectName: 'drac',
...data
})
}
module.exports = {
/** 线索埋点数据上报
* operationType 操作类型(0:分享 1:浏览 2:申请活动)
*/
reportData(data = {}, operationType = 0) {
return api.post({
method: 'scrm.api.busassistant.clue.report',
...data,
operationType,
operationDate: new Date().format('yyyy-MM-dd hh:mm:ss')
})
},
productBysceneApi,
unreadApi,
pageApi,
readApi,
tagApi,
battleMessageApi,
getActivityRecordApi,
getActivityDetailApi
}
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 mineApi from './mine.js'
export default new mineApi()
import api from '~/utils/request/request'
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
}
class mineApi {
/**分页查询客户列表 */
merchantCustomInfo(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.merchantCustomInfo.page',
...data
}
// true
)
}
/** 保存客户信息 */
saveMerchantCustomInfo(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.merchantCustomInfo.save',
...data
}
// true
)
}
/** 消息盒子列表 */
messageBoxPage(data) {
return api.post(
{
method: 'scrm.api.busassistant.messageBox.page',
...data
}
// true
)
}
/** 是否有未读消息 */
messageBoxPageIsRead(data) {
return api.post(
{
method: 'scrm.api.busassistant.messageBox.isread',
...data
}
// true
)
}
}
export default mineApi
import outputApi from './output.js'
export default new outputApi()
import api from '~/utils/request/request'
// const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
}
class outputApi {
/** 获取服务商(生意助手看产值)我的客户页总收益 */
getMerchantTotal(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.getMerchantTotal',
...data
})
}
/** 分页获取服务商(生意助手看产值)我的客户页数据 */
getCustomerPageList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.customerPageList',
...data
})
}
/** 服务商(生意助手看产值)我的客户详情数据 */
getCustomerDetail(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchant.getCustomerDetail',
...data
})
}
/**获取园区店开通场景数据 */
getSignMerchant(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.getSceneTotal.byYqMerchantId',
...data
}
// true
)
}
/**获取服务商(生意助手看产值)我的门店页数据 */
partnerMerchantTotal(data) {
return api.post(
{
method: 'scrm.api.boutiquecoupon.partnermerchant.yqList',
...data
},
true
)
}
/** 查找可开通的产品 */
getNoOpenPro(data) {
return api.post({
method: 'scrm.api.busassistant.activity.findNotOpenProducts',
...data
})
}
/**查询场景和产品的开通状态 */
getSceneProStatus(data) {
return api.post({
method: 'scrm.api.busassistant.activity.findSceneProductStatus',
...data
})
}
/** 申请开通活动*/
applyActivity(data) {
return api.post({
method: 'scrm.api.busassistant.activity.apply',
...data
})
}
/** 查询门店众筹活动产值 */
getActivityRevenue(data) {
return api.post({
method: 'scrm.api.busassistant.merchant.activity.Revenue',
...data
})
}
/** 查询门店权益订单数据统计-车险升级活动产值 */
getEquityRevenue(data) {
return api.post({
method: 'scrm.api.busassistant.merchant.equity.statistics',
...data
})
}
/** 店面汇总-下载海报 */
getPosterUrl(data) {
return api.post({
method: 'scrm.api.busassistant.crowdFunding.poster',
...data
})
}
/**长按海报埋点 */
reportPosterTrack(data) {
return api.post({
method: 'scrm.api.busassistant.crowdFunding.poster.shared.createRecord',
...data
})
}
/**获取活动最新战报 */
getNewReportUrl(data) {
return api.post({
method: 'scrm.api.stoassistant.crowd.activity.newest.report',
...data
})
}
/**获取最新喜报 */
getNewGoodUrl(data) {
return api.post({
method: 'scrm.api.busassistant.crowdFunding.good.report',
...data
})
}
}
export default outputApi
import api from '~/utils/request/request'
module.exports = {
/** 素材发送/阅读埋点 */
viewReadBuriedPoint(params) {
return api.post({
method: 'marketing.api.open.material.sendReadBuriedPoint',
list: [params],
projectName: 'material'
})
},
/** 素材详情 */
getPsdDetail(data) {
return api.post(
{
method: `marketing.api.material.detail`,
...data,
flag: 1
},
true
)
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.shopmall.weapp.'
const couponpath = 'scrm.api.coupon.'
const wechatPath = 'scrm.api.wechat.'
module.exports = {
/** 分页查询商城专区的商品信息 */
getGoodsList(data) {
return api.post({
method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage`,
pageNum: 1,
pageSize: 999,
...data
})
},
/** 根据商品ID获取商品 */
getGoodsDetail(id) {
return api.post(
{
method: `${path}goods.getById`,
id,
viewAmount: true
},
true
)
},
/** 添加购物车 */
addShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.add`,
...data
})
},
/** 购物车删除商品 */
delShoppingcart(id) {
return api.post({
method: `${path}shoppingcart.delete`,
id
})
},
/** 分页获取购物车 */
getShoppingcartList() {
return api.post({
method: `${path}shoppingcart.list`
})
},
/** 购物车商品变更(比如修改数量) */
updateShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.update`,
...data
})
},
/**购物车结算 */
settlementShoppingcart(data) {
return api.post({
method: `${path}shoppingcart.settlement`,
...data
})
},
/**根据规格值组合获取规格组合库存及零售价 */
getGoodsSpecificationExtra(data) {
return api.post({
method: `${path}goods.getGoodsSpecificationExtra`,
...data
})
},
/** 创建订单(立即购买) */
createOrder(data) {
return api.post({
method: `${path}order.create`,
...data
})
},
/**创建支付订单(去付款) */
payOrder(data) {
return api.post({
method: `${path}order.createPay`,
...data
})
},
/** 确认收货 */
confirmReceipt(orderCode) {
return api.post({
method: `${path}order.confirmReceipt`,
orderCode
})
},
/**订单详情 */
getOrderDetail(orderCode) {
return api.post({
method: `${path}order.detail`,
orderCode
})
},
/** 申请售后 */
afterSale(data) {
return api.post(
{
method: `${path}orderRefund.apply`,
...data
},
true
)
},
/**活动详情 */
getActivityDetail(id) {
return api.post(
{
method: `${path}activity.detail`,
id
},
true
)
},
/** 直播活动详情 */
getLiveActivityDetail(data) {
return api.post(
{
method: `${path}live.activity.detail`,
...data
},
true
)
},
/**获取订单的售后详情 */
getOrderRefundDetail(orderCode) {
return api.post({
method: `${path}orderRefund.detail`,
orderCode
})
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `${path}orderRefund.addDelivery`,
...data
})
},
/** 获取商品关联优惠券列表 */
getGoodscouponList(id) {
return api.post(
{
method: `${path}goods.user.coupons.get`,
...id
},
true
)
},
/** 领取商品详情优惠券 */
getCoupon(data) {
return api.post(
{
method: `${couponpath}customer.receive`,
...data
},
true
)
},
/** 领取确认订单最大优惠券 */
getMaxCoupon(orderGoods) {
return api.post(
{
method: `${path}order.coupons.get`,
orderGoods
},
true
)
},
/**更换优惠券*/
updateCoupon(orderGoods) {
return api.post(
{
method: `${path}order.coupons.change`,
orderGoods
},
true
)
},
//立即评价
addComment(data) {
return api.post(
{
method: `${path}orderGoodsComment.saveByOrder`,
...data
},
true
)
},
//评论列表
getCommentList(data) {
return api.post(
{
method: `${path}orderGoodsComment.page`,
...data
},
true
)
},
//获取订单的评论详情
getOrderCommentDetails(orderCode) {
return api.post(
{
method: `${path}orderGoodsComment.customerOrderGoodsComment`,
orderCode
},
true
)
},
//取消付款
cancelPay(orderCode) {
return api.post(
{
method: `${path}order.cancelPay`,
orderCode
},
true
)
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.post(
{
method: `${path}orderRefund.cancel`,
orderCode
},
true
)
},
/** 直播活动详情id */
getLiveActivityId(id) {
return api.post(
{
method: `${wechatPath}get.scene.by.id`,
...id
},
true
)
},
/** 获取活动分享链接 */
getActivitylink(id) {
return api.post(
{
method: `scrm.api.shopmall.activity.get.shared`,
id
},
true
)
},
/** 获取商品分享链接 */
getGoodslink(id) {
return api.post(
{
method: `scrm.api.shopmall.goods.get.shared`,
id
},
true
)
},
// scrm.api.shopmall.weapp.
requestSubscribeMessage() {
return api.post(
{
method: `scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds`
},
true
)
},
/** 小程序端根据优惠券id查询可使用商品列表(分页) */
getCouponGoodsPage(data) {
// let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// if (merchantId) data.merchantId = merchantId
data.pageSize = 8
return api.post({
method: 'scrm.app.shopmall.coupon.goods.page',
...data
})
}
}
import api from '~/utils/request/request'
module.exports = {
/** sop用户行为记录(埋点调用)
*/
customerBehavior(data) {
return api.post({
method: 'scrm.api.sop.task.customerBehavior.add',
flag: 1,
...data
})
}
}
import api from '~/utils/request/request'
const path = 'scrm.api.sso.weapp.'
module.exports = {
/**wx.login登录 */
jsCodeLogin(data) {
return api.post(
{
method: `${path}jscode.login`,
...data
},
true
)
},
/**授权用户信息 */
authUserInfo(data) {
return api.post(
{
method: 'scrm.api.sso.weapp.auth.userinfo',
...data
},
true
)
},
/**授权手机号 */
authUserPhone(data) {
return api.post(
{
method: `${path}auth.phone`,
...data
},
true
)
},
/**退出 */
logout() {
return api.post(
{
method: `scrm.api.sso.user.logout`
},
true
)
},
//保存用户授权信息
saveuserProfile(data) {
return api.post(
{
method: `scrm.api.wechat.auth.userProfile.save`,
...data
},
true
)
},
/**更新客户手机号 */
updataCustomerPhone(data) {
return api.post({
method: `scrm.api.sso.weapp.mark.phone`,
...data
})
}
}
// import api from '../api/request'
import api from '~/utils/request/request'
const { appId } = wx.getAccountInfoSync().miniProgram
const {
appId
} = wx.getAccountInfoSync().miniProgram
const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT',
productCode: 'PC00c3'
}
class UsersApi {
/**调用后台接口获取用户信息 */
async login() {
return this.getWxCode().then(({ code }) => {
return api.post(
{
method: 'scrm.api.sso.weapp.jscode.login',
/**调用后台接口获取用户信息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) {
console.log(error)
return Promise.reject()
}
}
/**退出登录 */
logout() {
return api.post({
method: 'scrm.api.sso.wechat.applets.logout'
},
true
)
}
/**调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台帐号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台帐号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 */
getWxCode() {
......@@ -24,39 +44,129 @@ 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: 'BUSINESS_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')
})
/**账号密码登录 */
async accountLogin(data = {}) {
return api.post({
method: 'scrm.api.sso.wechat.applets.password.login',
...data,
...CODE
},
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: 'BUSINESS_ASSISTANT'
},
true
)
}
/** 获取登录账号列表 */
getAccountList(sessionId) {
return api.post({
method: 'scrm.api.sso.wechat.applets.listSelectAccount',
...CODE,
sessionId
},
true
)
}
/**
* 选择账号登录(手机绑定多个账号时) */
selectAccountLogin(data) {
return api.post({
method: 'scrm.api.sso.wechat.applets.selectAccountLogin',
...CODE,
...data
},
true
)
}
/**检查sessionId 是否过期 */
checkSession() {
return api.post({
method: 'scrm.api.sso.login.status.check'
},
true
)
}
/** 超级管理员切换账号 */
adminSelectLogin(data) {
return api.post({
method: 'scrm.api.sso.super.administrator.select.login',
...CODE,
...data
}
// true
)
}
/** 超管切换子账号 */
switchSubLoginInfo(data) {
return api.post({
method: 'scrm.api.sso.wechat.applets.switch.subLoginInfo',
...CODE,
...data
})
}
/**获取微信用户信息 */
async getWXUserInfo() {
let wx_user_info = wx.$storage.get('wx_user_info')
if (!wx_user_info) {
const data = await this.getUserProfile()
wx.$storage.set('wx_user_info', data)
return data
} 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: 'BUSINESS_ASSISTANT'
})
}
}
export default UsersApi
export default 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
)
}
// app.js
// 初始化sentry
// import sentryInit from '~/utils/sentryConfig/sentryInit'
// sentryInit()
import sentryInit from '~/utils/sentryConfig/sentryInit'
sentryInit()
import util from './utils/util'
import wxApi from './utils/utils_wx'
import '~/router/routerBefore'
import router from './router/index'
import { setSystem_info } from '~/utils/cache/storageApi'
// 有问题 前后顺序不能随意调整
// console.log(test)
import { setSystem_info } from '~/utils/cache/storageApi'
// console.log(setSystem_info)
// 判断小程序是否需要更新
import getUpdateManager from './utils/lib/wxUpdateManager'
// 埋点 有需要再引入
// 埋点
// import './utils/track/Track'
import eventbus from './utils/evenbus'
......@@ -28,9 +31,16 @@ promisifyAll()
import { Storage } from './utils/cache/storage'
const $Storage = new Storage()
//全局分享
import './utils/share'
//监听网络状态
import './utils/network'
App({
onLaunch(options) {
/**挂载到wx对象 */
/**挂载到wx对象 */
wx.$authStatus = false
wx.$util = util
wx.$api = wxApi
......@@ -40,6 +50,7 @@ App({
// 存储设备信息
setSystem_info()
// console.log('test')
},
onShow(options) {
......@@ -49,6 +60,5 @@ App({
onPageNotFound(e) {
wx.$router.goHome()
},
onHide() {},
globalData: {}
onHide() {}
})
{
"pages": ["pages/index/index", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView"],
"pages": ["login/loading/loading", "pages/tab/index/index", "pages/tab/output/output", "pages/tab/mine/mine", "pages/webView/webView", "login/index/index", "login/accountItems/accountItems", "pages/viewVideo/index", "pages/viewProd/index", "pages/viewProdBanner/index", "pages/measure/measure/measure", "pages/measure/measureResult/measureResult"],
"requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents",
"window": {
......@@ -14,18 +14,18 @@
"borderStyle": "white",
"list": [
{
"pagePath": "pages/tab/output/output",
"text": "看产值",
"iconPath": "images/output.png",
"selectedIconPath": "images/output_active.png"
},
{
"pagePath": "pages/tab/index/index",
"text": "拓客户",
"text": "发现",
"iconPath": "images/home.png",
"selectedIconPath": "images/home_active.png"
},
{
"pagePath": "pages/tab/output/output",
"text": "看产值",
"iconPath": "images/mall.png",
"selectedIconPath": "images/mall_active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "个人中心",
"iconPath": "images/mine.png",
......@@ -33,12 +33,24 @@
}
]
},
"subpackages": [],
"preloadRule": {
"pages/tab/mine/mine": {
"network": "all",
"packages": ["mineDetail"]
},
"pages/tab/index/index": {
"network": "all",
"packages": ["apply", "packageOutput"]
}
},
"usingComponents": {
"calendar": "/components/Calendar/Calendar",
"NavigationBar": "/components/NavigationBar/NavigationBar"
"tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index"
},
"style": "v2",
"resolveAlias": {
"~/*": "/*"
},
......@@ -47,6 +59,5 @@
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins": {}
}
}
@import "/style/common.wxss";
/* @font-face {
font-family: "Gotham";
src: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/font/Gotham-Black.woff");
} */
/* @font-face {
font-family: "number";
src: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/font/Alimama_ShuHeiTi_Bold_Number.ttf");
} */
@font-face {
font-family: "number";
src: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/font/subset-AlimamaShuHeiTi-Bold.woff");
}
page {
background-color: #F7F7F7;
color: #282829;
font-size: 28rpx;
--themeColor: #F13C3D;
--btnColor: #FC5B32;
--btnColor: #3666FE;
--borderRadius: 8rpx;
--margin: 32rpx;
/* vant 样式覆盖 */
--tabs-bottom-bar-color:#3666FE;
--sidebar-selected-border-color:#3666FE;
--tree-select-nav-background-color:#f6f6f6;
}
image {
width: 100%;
height: 100%;
/* height: 100%; */
vertical-align: top;
}
.font-number {
font-family: 'number';
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
......
// components/Authorize/Authorize.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
......@@ -39,7 +35,7 @@ Component({
}
},
observers: {
'show': function (newVal) {
show: function (newVal) {
this.setData({
openSet: newVal
})
......@@ -48,9 +44,7 @@ Component({
/**
* 组件的初始数据
*/
data: {
},
data: {},
/**
* 组件的方法列表
*/
......@@ -58,15 +52,10 @@ Component({
/**
* 禁止滑动
*/
noScroll: wx.$util.noScroll(),
noScroll(){},
cancel(e) {
let {
confirm
} = e.currentTarget.dataset
let {
buttonType,
title
} = this.data
let { confirm } = e.currentTarget.dataset
let { buttonType, title } = this.data
let _this = this
if (buttonType == 'getUserInfo' && confirm) {
wx.getUserProfile({
......@@ -87,11 +76,7 @@ Component({
/**检验是否已授权位置 */
check() {
const _this = this
let {
buttonType,
scopeType,
autoOpen
} = this.properties
let { buttonType, scopeType, autoOpen } = this.properties
if (buttonType != 'getPhoneNumber') {
let type = `scope.${scopeType}`
buttonType = 'openSetting'
......@@ -128,12 +113,9 @@ Component({
}
})
}
},
/**授权手机号 */
getPhoneNumber({
detail
}) {
getPhoneNumber({ detail }) {
console.log(detail)
this.triggerEvent('getphonenumber', detail)
}
......@@ -144,4 +126,4 @@ Component({
},
hide: function () {}
}
})
\ No newline at end of file
})
......@@ -2,9 +2,7 @@
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
// import {componentsMixin } from '../../mixins/index'
Component({
// behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
......
// packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
import Draw from '~/utils/Draw'
Component({
/**
* 组件的属性列表
*/
properties: {
// 默认母链海报 不是须样式须单独处理 通过item.type 区分类型
item: {
type: Object,
observer(n) {
// 如果是喜报和战报就跳过图片生成
if (n.type == 'warReport') {
// n.posterUrl
wx.$api.showLoading('图片加载中')
return this.setData({
poster: n.posterUrl,
show: true
})
}
n.posterUrl &&
this.checkUrl()
.then(result => {
result &&
this.setData({
poster: result,
show: true
})
})
.catch(err => {
console.log(err)
this.begin()
})
}
},
scrollImg: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
_item_: null,
findKey: 'posterUrl',
height: '68%'
// poster: 'https://wx.glsx.com.cn/upload/biz/599036445419769856.png'
},
/**
* 组件的方法列表
*/
methods: {
successOnload() {
// debugger
// console.log('a123456')
wx.$api.hideLoading()
// this.setData({
// show: true
// })
},
// 图片缓存 有取小程序缓存图片
checkUrl() {
console.log('checkUrl')
let { item: postObj } = this.data
const fileList = wx.$storage.get('fileList') || [],
fn = wx.getFileSystemManager(),
{ findKey } = this.data
return new Promise((resolve, reject) => {
// return reject()
if (fileList.length) {
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({ files }) {
let obj = fileList.find(e => e[findKey] === postObj[findKey])
const poster = files.find(s => obj?.path.includes(s))
wx.hideLoading()
// console.log(poster)
// 处理图片文件缓存太多的问题
let filesLength = files.length
console.log(files)
if (filesLength > 21) {
files.map((e, index) => {
// debugger
// console.log(filesLength - index > 21)
filesLength - index > 21 &&
index != 0 &&
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`,
fail(res) {
console.error(res)
}
})
})
}
// console.log(poster)
if (poster) {
resolve(`${wx.env.USER_DATA_PATH}/${poster}`)
} else {
reject()
}
}
})
} else reject()
})
},
begin() {
let { item } = this.data
item.posterUrl && this.getImageInfo(item)
},
check(n) {
this.setData({
_item_: n
})
},
getImageInfo(n) {
// console.log(n)
wx.$api.showLoading('处理中')
let that = this
wx.getImageInfo({
src: `${n.posterUrl}?v=${Date.now()}`,
success: function (res) {
// console.log(res)
// w = res.width
// h = res.height
that.init(n, res.width, res.height)
},
fail: function (res) {
// console.log(res)
wx.$api.showToast('生成失败')
}
})
},
async init(n, ImgWidth, ImgHeight) {
const { findKey } = this.data
// debugger
// const {pixelRatio} = wx.getWindowInfo()
let actualWidth = 247 //默认宽度
let canvasHeight = 1959 //最大高度
let proportion = ImgWidth / actualWidth //图片实例化对应的比例
let actualHeight = ImgHeight / proportion //实际高度
// 解决 createOffscreenCanvas 最大高度不能超过4096的问题
// 这个 pixelRatio 不写是默认两倍 需转换计算
if (actualHeight > canvasHeight) {
actualWidth = actualWidth / (actualHeight / canvasHeight)
actualHeight = canvasHeight
}
// console.log(actualHeight)
// 默认母链海报 不是须单独处理
this.setData({
width: actualWidth + 32,
height: actualHeight + 82
})
const drawfun = new Draw( // 大画布
{
// height: 554
width: actualWidth + 32,
height: actualHeight + 82
// pixelRatio
},
this
),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName
console.log(merchantName)
// console.log(n.activityName)
let imageList = [],
textList = []
// debugger
if (n.type == 'warReport') {
imageList = [
{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}
]
textList = []
} else {
n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
imageList = [
{
x: 0,
y: 0,
width: 279,
height: 66,
url: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x: 16,
y: 70,
width: actualWidth,
height: actualHeight,
url: n.posterUrl
}
]
textList = [
{
x: 12,
y: 14,
fontSize: 14,
color: '#2D2D33',
text: merchantName,
textBaseline: 'top'
},
{
x: 12,
y: 36,
fontSize: 14,
color: '#1B233D',
text: n.activityName,
textBaseline: 'top',
fontWeight: 500
},
{
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
]
}
let res = await drawfun.begin({
imageList,
textList
})
// console.log(res)
wx.hideLoading()
this.setData({
poster: res.path,
show: true
})
let fileList = wx.$storage.get('fileList') || []
// console.log([findKey])
// this.setData({
// [findKey]: n[findKey]
// })
// 去重
// debugger
// let fileLength = fileList.length
let obj = {
fileId: res.fileId,
path: res.path,
[findKey]: n[findKey]
}
// console.log(fileLength)
// if (fileLength) {
// fileList.forEach((item, index) => {
// // console.log(index)
// console.log(condition.posterUrl == n.posterUrl)
// if (condition.posterUrl == n.posterUrl) {
// item = obj
// } else if (index == fileLength) {
// fileList.unshift(obj)
// }
// })
// } else {
// fileList.unshift(obj)
// }
fileList.unshift(obj)
// console.log(fileList)
// fileList = [...fileList, ...fileList]
fileList = fileList.slice(0, 21)
// console.log(fileList)
wx.$storage.set('fileList', fileList)
},
download() {
const filePath = this.data.poster,
_this = this
wx.saveImageToPhotosAlbum({
filePath,
success() {
wx.$api.showToast('保存成功')
},
fail(err) {
const auth = _this.selectComponent('#auth')
auth.check()
}
})
},
hide() {
console.log('hide')
this.setData({
show: false,
poster: ''
})
},
noScroll() {},
authFail(e) {
this.setData({
showAuth: true
})
},
longpress() {
let { item } = this.data
this.triggerEvent('longtouch', item)
}
}
})
{
"component": true
}
\ No newline at end of file
/* packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxss */
.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 {
box-sizing: border-box;
width: 500rpx;
max-height: 68%;
// height: 68%;
// height: 1108rpx;
overflow: scroll;
// smoo
// overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.pd {
padding: 32rpx;
background-color: #fff;
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 500rpx;
height: 90rpx;
background: #F7F8FA;
border-radius: 0 0 12rpx 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3666FE;
margin-top: -2rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
.tips {
margin: 40rpx 80rpx 0;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
.underline {
font-weight: 600;
text-decoration: underline;
}
}
}
.titleTime {
height: 64rpx;
line-height: 64rpx;
width: 100%;
// background-color: rgba(54, 102, 254, 0.08);
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24rpx;
color: #fff;
text-align: center;
}
\ No newline at end of file
<block wx:if="{{show}}">
<!-- catchtouchmove="noScroll" catchtouchmove="noScroll" -->
<view class="layout">
<view class="bg" bindtap="hide" />
<!-- style="height:{{height}}" -->
<view class="poster {{item.type == 'warReport'?'pd':''}}">
<block wx:if="{{scrollImg}}">
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<!-- mode="widthFix" -->
<image
bindload="successOnload"
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
bindlongpress="longpress" />
</scroll-view>
<!-- </view> -->
</block>
<block wx:else>
<!-- <view class="poster {{item.type == 'warReport'?'pd':''}}"> -->
<!-- mode="widthFix" -->
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<image
bindload="successOnload"
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
bindlongpress="longpress" />
</scroll-view>
<!-- </view> -->
`
</block>
</view>
<view class="btn">
<glsx-image src="output/longtap.png" class="icon" />
长按图片转发
</view>
<view wx:if="{{item.type == 'warReport'}}" class="titleTime">最近更新时间: {{item.updatedTime}}</view>
<view wx:else class="tips">
温馨提示:您可以转发到门店群,门店员工通过扫描海报二维码可以注册登录
<text class="underline">门店助手</text>
小程序,执行活动任务,转发活动链接促成订单。
</view>
</view>
</block>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
// components/FullscreenVideo/FullscreenVideo.js
Component({
/**
* 组件的属性列表
*/
properties: {
src:String,
title:String,
},
/**
* 组件的初始数据
*/
data: {
fullScreen: false,
},
lifetimes: {
ready() {
// this.play();
},
},
/**
* 组件的方法列表
*/
methods: {
/**播放视屏 */
play(e) {
//执行全屏方法
var videoContext = wx.createVideoContext("myvideo", this);
videoContext.requestFullScreen();
this.setData({
fullScreen: true,
});
},
/**关闭视屏 */
closeVideo() {
//执行退出全屏方法
var videoContext = wx.createVideoContext("myvideo", this);
videoContext.exitFullScreen();
this.setData({
fullScreen: false,
});
},
/**视屏进入、退出全屏 */
fullScreenFn(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
fullScreen: isFull,
});
},
},
});
/* components/FullscreenVideo/FullscreenVideo.wxss */
.show{
display:block;
}
.hide{
display:none;
}
\ No newline at end of file
<!-- components/FullscreenVideo/FullscreenVideo.wxml -->
<!-- -->
<video id='myvideo' class='{{fullScreen?"show":"hide"}}' src="{{src}}" title="{{title}}" autoplay="true" direction="{{0}}" bindfullscreenchange="fullScreenFn" bindended="closeVideo" controls></video>
\ No newline at end of file
// components/GlCell/GlCell.js
Component({
/**
* 组件的属性列表
*/
properties: {
label: String,
labelWidth: String,
border: Boolean,
haveArrow: Boolean,
value: String,
valueAlign: String,
required: Boolean,
placeholder: String,
iconSrc: String,
labelStyle: String,
cellHeight: {
type: Boolean,
value: true
},
requiredBefore: {
type: Boolean,
value: true
},
requiredAfter: {
type: Boolean,
value: false,
observer: function (n, o) {
if (n) {
this.setData({
requiredBefore: false
})
}
}
},
disabled: Boolean
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
click(e) {
if (this.data.disabled) return
this.triggerEvent('click')
},
titleClick() {
this.triggerEvent('titleClick')
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='cell-box'>
<view class="cell {{cellHeight?'cellHeight': ''}} {{border?'border':''}}" bindtap="click">
<view class='cell-label' style="width:{{labelWidth}};{{labelStyle}}" bindtap="titleClick">
<text wx:if='{{required&&requiredBefore}}' class='required'>*</text>
{{label||'标题'}}
<image class="titleIcon" wx:if="{{iconSrc}}" src="{{iconSrc}}" />
<text wx:if='{{required&&requiredAfter}}' class='required'>*</text>
</view>
<view class='cell-value ' style="width:calc(100% - {{labelWidth}});">
<view class='value {{valueAlign}} {{haveArrow}}'>
<view class='slot'>
<slot/>
</view>
<block wx:if="{{value}}">
<view class='details'>{{value}}</view>
</block>
<block wx:if="{{placeholder}}">
<view class='placeholder'>{{placeholder}}</view>
</block>
</view>
<image wx:if='{{haveArrow}}' class='arrow' src="../images/arrow-x.png" />
</view>
</view>
</view>
/* components/GlCell/GlCell.wxss */
.cell-box {
background: #fff;
font-size: 28rpx;
color: #333333;
box-sizing: border-box;
}
.cell {
width: 100%;
box-sizing: border-box;
display: flex;
/* padding-left: 40rpx; */
align-items: center;
}
.cellHeight {
height: 120rpx;
}
.cell.border {
border-bottom: 2rpx solid rgba(195, 195, 195, .3);
}
.cell-label {
width: 25%;
}
.titleIcon {
width: 34rpx;
height: 34rpx;
}
.cell-value {
width: 75%;
position: relative;
height: 100%;
}
.cell-value .false {
padding-right: 40rpx !important;
}
.value {
width: 100%;
height: 100%;
display: flex;
align-items: center;
padding-right: 70rpx;
box-sizing: border-box;
}
.required {
color: #f00;
}
.details,
.placeholder {
display: none;
}
.slot:empty+.details,
.slot:empty+.placeholder {
display: block;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.placeholder {
color: #C3C3C3;
}
.cell-value .right {
justify-content: flex-end;
height: 100%;
box-sizing: border-box;
}
.cell-value .right .details,
.cell-value .right .placeholder {
text-align: right;
}
.slot {
width: 100%;
}
.slot:empty {
display: none;
}
.arrow {
position: absolute;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
width: 28rpx;
height: 26rpx;
}
\ No newline at end of file
// components/navigationBar/navigationBar.js
// import {
// componentsMixin
// } from '../../mixins/index'
Component({
// behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
navStyle: String,
custom: Boolean,
showBack: Boolean,
pageTitle: {
type: String,
value: '',
......@@ -40,9 +37,24 @@ Component({
* 获取自定义导航栏信息
*/
wx.getSystemInfo().then(res => {
let { fontSizeSetting, statusBarHeight, screenWidth } = res
const { height, right, width, top } = wx.getMenuButtonBoundingClientRect()
let navigationBarHeight = height + (top - statusBarHeight) * 2 + 4 // 4
let {
fontSizeSetting,
statusBarHeight,
screenWidth
} = res
const {
height,
right,
width,
top
} = wx.getMenuButtonBoundingClientRect(),
currentPages = getCurrentPages(), {
showBack
} = this.data
if (showBack && currentPages.length > 1) this.setData({
SHOWBACK: true
})
let navigationBarHeight = height + ((top - statusBarHeight) * 2) + 4 // 4
let navigationBarPadding = screenWidth - right
let navigationBarWidth = screenWidth - (navigationBarPadding * 2 + width) - width
this.setData({
......@@ -57,10 +69,12 @@ Component({
})
})
},
emit({ navigationBarHeight, statusBarHeight }) {
emit({
navigationBarHeight,
statusBarHeight
}) {
let navHeight = navigationBarHeight + statusBarHeight
const thisPage = wx.$router.getPageInstance()
const currentPages = getCurrentPages()
this.triggerEvent('navbarReady', {
height: navHeight,
statusBarHeight
......@@ -72,10 +86,9 @@ Component({
navHeight,
statusBarHeight
})
if (currentPages.length == 1 && !thisPage.rootName)
thisPage.setData({
showHomeBtn: true
})
},
back() {
wx.$router.back()
}
},
lifetimes: {
......@@ -84,4 +97,4 @@ Component({
this.setPageTitle()
}
}
})
})
\ No newline at end of file
<view class="navigation-bar" id="navigation-bar"
style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}">
<slot></slot>
</view>
</view>
</block>
<block wx:else>
<slot></slot>
</block>
</view>
\ No newline at end of file
<view class="navigation-bar" id="navigation-bar" style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<block wx:if="{{SHOWBACK}}">
<view class="back " bindtap="back">
<image class="img" src="./images/icon-back.png" />
</view>
</block>
<view class="navigation-bar-titleText" style="{{navigationBarTextWidth}}">
<slot/>
</view>
</view>
</block>
<block wx:else>
<slot/>
</block>
</view>
/* components/navigationBar/navigationBar.wxss */
.navigation-bar{
.navigation-bar {
position: fixed;
top: 0;
left: 0;
......@@ -8,16 +8,18 @@
background-color: #fff;
transition: all .15s;
}
.navigation-bar-box{
.navigation-bar-box {
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.navigation-bar-titleText{
.navigation-bar-titleText {
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
......@@ -27,18 +29,29 @@
text-align: center;
letter-spacing: 1rpx;
}
.back-box{
.back-box {
width: 76rpx;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.back{
.back {
position: absolute;
left: 20rpx;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 36rpx;
height: 36rpx;
width: 100rpx;
/* height: 34rpx; */
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.back .img {
width: 16rpx;
height: 34rpx;
}
\ No newline at end of file
// components/Nothing-tips/nothingTips.js
Component({
/**
* 组件的属性列表
*/
properties: {
tips: String,
bg: String
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Nothing-tips/nothingTips.wxss */
.nothingCon {
width: 100vw;
height: 100vh;
background-color: #fff;
display: flex;
flex-direction: column;
align-items: center;
// justify-content: center;
.bg {
width: 512rpx;
height: 512rpx;
}
.tips {
margin-top: -15rpx;
font-size: 24rpx;
color: #CCCED1;
text-align: center;
}
}
\ No newline at end of file
<!-- components/Nothing-tips/nothingTips.wxml -->
<view class="nothingCon">
<image
wx:if="{{bg}}"
class="bg"
src="{{bg}}"
webp></image>
<view wx:if="{{tips}}" class="tips">{{tips}}</view>
<slot/>
</view>
/*
* @Description:
* @Author: huyue
* @Date: 2022-12-09 13:58:15
* @LastEditors: huyue
* @LastEditTime: 2022-12-13 10:36:15
*/
// components/Login/Login.js
import { ssoApi } from "../../api/api";
import { componentsMixin } from "../../mixins/index";
Component({
externalClasses: ['custom-class'],
behaviors: [componentsMixin],
// options: {
// styleIsolation: 'isolated'
// },
/**
* 组件的属性列表
*/
properties: {
phoneText: {
type: String,
value: '了解更多案例'
},
/**
* type: 场景类型: home.首页,整行;product.详情中的查看更多和申请合作切换;scenario场景详情:转发+合作申请;video 视频详情
*/
type: {
type: String
},
hasPhoneNumber: {
type: Boolean,
observer(n) {
this.setData({
hasPhone: n
})
}
}
},
/**
* 组件的初始数据
*/
data: {
hasPhone: false
},
/**
* 组件的方法列表
*/
methods: {
// 获取手机号
getPhoneNumber({detail}) {
if ( detail.errMsg && detail.errMsg.indexOf('user deny') !== -1 ) {
wx.hideLoading()
return;
}
wx.$util.showLoading('正在授权...')
delete detail.errMsg;
if (detail.iv && detail.encryptedData) {
ssoApi.authUserPhone(detail).then(({ data, code, message }) => {
wx.hideLoading()
if (code==0) {
wx.$util.setUserInfo(data);
// 其他操作
this.triggerEvent("updatePhoneNumber", data.phone);
this.setData({
hasPhone: true
})
} else {
wx.showToast({
title: message,
icon: 'none',
duration: 2000
})
}
});
}
},
jump() {
// this.triggerEvent('toApplication')
console.log(333);
wx.$router.go("/packagesList/pages/activityApply/activityApply");
},
forward() {
this.triggerEvent('toForward')
},
downVideo() {
let that = this
wx.showModal({
content: '是否下载视频',
success (res) {
if (res.confirm) {
that.triggerEvent('videodown')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
.fixBottom {
position: fixed;
display: flex;
bottom: 0;
width: 100%;
box-sizing: border-box;
background-color: #fff;
box-shadow: inset 0 2rpx 0 0 #F2F3F7;
padding: 16rpx 48rpx;
filter: blur(0);
.home-btn {
width: 100%;
}
.video-btn {
display: flex;
flex: 1;
}
.phoneNumber {
width: 100%;
color: #fff;
background-color: #5850FF;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0;
height: 72rpx;
line-height: 72rpx;
}
.forward-box {
width: 136rpx;
padding: 4rpx 44rpx;
height: 88rpx;
text-align: center;
margin-right: 40rpx;
margin-top: -16rpx;
box-shadow: 8rpx 0 16rpx 0 rgba(202,211,230,0.30);
.forward-text {
line-height: 32rpx;
}
.icon-forward {
width: 48rpx;
height: 48rpx;
}
}
button{
margin: 0;
line-height: 88rpx;
}
// 了解更多的样式
.phone-number {
display: flex;
width: 100%;
align-items: center;
justify-content: center;
// margin: 16rpx 48rpx;
color: #fff;
font-size: 28rpx;
letter-spacing: 0.8rpx;
background: #5850FF;
background-image: linear-gradient(180deg, #4791FF 0%, #5850FF 100%, #643DFF 100%);
border-radius: 8rpx;
line-height: 72rpx;
.icon-arrow {
width: 32rpx;
height: 32rpx;
}
.icon-arrow:first-child {
margin-right: 48rpx;
}
.icon-arrow:last-child {
margin-left: 48rpx;
}
}
.video-box {
display: inline-flex;
margin-right: 20rpx;
.btn-item {
width: 100rpx;
text-align: center;
.btn-text {
font-weight: 500;
font-size: 20rpx;
color: #5A6066;
}
}
.icon-forward {
width: 40rpx;
height: 40rpx;
}
.phoneNumber {
}
}
}
// .isFullSucreen {
// width: 100%;
// }
.product_full{
flex:1;
display: flex;
align-items: center;
}
<view class="fixBottom custom-class">
<view wx:if="{{type == 'home'}}" class="isFullSucreen home-btn">
<!-- <view class="isFullSucreen"> -->
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
<!-- </view> -->
</view>
<view wx:if="{{type == 'product'}}" class="isFullSucreen product_full">
<block wx:if="{{hasPhone}}">
<view class="forward-box">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="forward-text" bindtap="forward">转发</view>
</view>
<button class="phoneNumber" bindtap="jump">申请合作</button>
</block>
<block wx:else>
<button class="phone-number" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
{{phoneText}}
<image class="icon-arrow" webp src="{{IMGURL}}home/icon-arrow.png"></image>
</button>
</block>
</view>
<view wx:if="{{type == 'scenario'}}" class="isFullSucreen video-btn">
<view class="forward-box">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="forward-text" bindtap="forward">转发</view>
</view>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
<view wx:if="{{type == 'video'}}" class="isFullSucreen video-btn">
<view class="video-box">
<view class="btn-item">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-download.png"></image>
<view class="btn-text" bindtap="downVideo">下载</view>
</view>
<view class="btn-item">
<image class="icon-forward" webp src="{{IMGURL}}home/icon-forward.png"></image>
<view class="btn-text" bindtap="forward">转发</view>
</view>
</view>
<button wx:if="{{hasPhone}}" class="phoneNumber" bindtap="jump">合作申请1</button>
<button wx:else class="phoneNumber" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">合作申请</button>
</view>
</view>
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
import {
componentsMixin
} from '../../mixins/index'
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
......@@ -23,14 +19,13 @@ Component({
}, 0.2 * 1000)
} else {
let hideTab = wx.$hideTab
console.log(hideTab)
// console.log(hideTab)
this.setData({
showPopup: true,
close: false,
hideTab
})
}
}
},
title: String,
......@@ -48,7 +43,7 @@ Component({
* 组件的初始数据
*/
data: {
// hideTab: false
},
/**
......@@ -60,17 +55,16 @@ Component({
this.setData({
show: false
})
this.triggerEvent('hidePopup')
},
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
const {
isTab
} = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
this.setData({
isTab
})
},
})
\ No newline at end of file
}
})
......@@ -45,7 +45,7 @@
}
.popup-slot {
height: calc(100% - 200rpx);
height: calc(100% - 100rpx);
}
.popup-slot.isFullSucreen {
......
// pages/tab/output/components/sceneBox/sceneBox.js
import { IMG_URL } from '~/utils/constantData'
import { scenceList } from '~/pages/tab/index/constant/data'
Component({
/**
* 组件的属性列表
*/
properties: {
options: {
addGlobalClass: true
},
sceneActive: {
type: Number,
value: -1
},
sceneCodeActive: {
type: String,
value: ''
},
hasOpenIcon: {
type: Boolean,
value: true
},
hasLockIcon: {
type: Boolean,
value: true
},
sceneInfo: {
type: Object,
value: () => {},
observer(n) {
if(n.hasOwnProperty('sceneList')) {
this.findIsOpen()
}
}
},
scenePriceList: {
type: Array,
value: () => []
}
},
/**
* 组件的初始数据
*/
data: {
IMGURL: IMG_URL,
openedIcon: `${IMG_URL}/output/openedIcon.png`,
scenceList
// custSceneList: [
// {
// title: '新车洽谈场景',
// subTitle: '1.0新车权益升级'
// },
// {
// title: '新车交付场景',
// subTitle: '1.1新车精品升级'
// },
// {
// title: '0-6个月',
// subTitle: '1.2次新车膨胀金活动'
// },
// {
// title: '6个月以上',
// subTitle: '1.3售后直播众筹活动'
// }
// ]
},
lifetimes: {
attached() {
// console.log(this.data.sceneInfo, 'sceneInfo--')
// console.log(this.data.scenceList, 'scenceList--')
}
},
/**
* 组件的方法列表
*/
methods: {
findIsOpen() {
let list = JSON.parse(JSON.stringify(this.data.scenceList))
list.forEach(item => {
let obj = this.data.sceneInfo?.sceneList.find(k => k.sceneCode == item.sceneCode) || {}
item.isOpen = obj.flag || false
})
this.setData({
scenceList: list
})
},
handleClick(e) {
let { idx, scenecode } = e.currentTarget.dataset
this.triggerEvent('handleSceneChange', { sceneIdx: idx, sceneCode: scenecode })
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="/pages/tab/output/index.wxs" module="filter" />
<view class="flex scene">
<view class="scene-item {{ (item.isOpen && hasOpenIcon) ? 'open' : ''}} {{sceneCodeActive && (sceneCodeActive == item.sceneCode) ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}" data-scenecode="{{item.sceneCode}}">
<view wx:if="{{hasOpenIcon && item.isOpen}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{item.isOpen}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view wx:else class="no-open-img">
<image webp wx:if="{{hasLockIcon}}" class="lock-img" src="{{IMGURL}}output/carlock0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
</view>
<view class="title-box">
<view class="scene-title {{item.isOpen ? '' : 'on-open'}}">{{item.name}}</view>
</view>
<!-- <view>{{item.subTitle}}</view> -->
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{filter.money_three_for_two_thousands(item.isOpen ? (scenePriceList[index].total || 0.00) : 0.00)}}
</view>
</view>
</view>
\ No newline at end of file
/* pages/tab/output/components/sceneBox/sceneBox.wxss */
.flex {
display: flex;
}
.scene {
text-align: center;
width: 100%;
}
.scene-item {
box-sizing: border-box;
position: relative;
width: 25%;
/* flex: 1; */
background: #F7F8FC;
margin-right: 4rpx;
font-size: 18rpx;
color: #8A8C90;
/* padding: 32rpx 0 28rpx; */
padding: 24rpx 0 18rpx;
border-radius: 12rpx;
font-weight: 500;
border: 2rpx solid #F7F8FC;
/* margin-bottom: 20rpx; */
}
.scene-item:last-child {
margin-right: 0;
}
.scene-title {
width: 100rpx;
font-size: 24rpx;
font-weight: 600;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 已开通 - start */
.open.scene-item {
background: #F0F7FF;
}
.open-icon {
box-sizing: border-box;
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
/* left: 0.5rpx;
top: 0.5rpx;
width: 56rpx;
height: 32rpx;
line-height: 24rpx;
background: #FEEBD6;
border-radius: 6rpx 0 8rpx 0;
font-size: 18rpx;
font-weight: 600;
color: #EF971E;
padding: 4rpx; */
}
.open-icon image {
height: 100%;
}
/* 已开通 - end */
/* 选中 - start */
.active.scene-item {
background-image: linear-gradient(145deg, #F0F7FF 0%, #FFFFFF 73%);
border: 2rpx solid #3666FE;
/* box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32), 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.40); */
filter: drop-shadow(0 12rpx 12rpx rgba(180, 186, 204, 0.40));
}
.active::after {
position: absolute;
left: 50%;
bottom: -17rpx;
display: block;
content: "";
width: 16rpx;
height: 16rpx;
/* border-radius: 4rpx; */
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
/* 选中 - end */
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title.on-open {
color: #8A8C90;
}
.no-open-img {
position: relative;
}
.scene-img {
width: 92rpx;
height: 64rpx;
}
.lock-img {
width: 92rpx;
height: 64rpx;
}
.total-price {
height: 40rpx;
line-height: 40rpx;
margin-top: 22rpx;
font-size: 20rpx;
color: #3666FE;
/* font-weight: 600; */
font-family: 'number';
}
/* .notOpened {
color: #8A8C90;
} */
\ No newline at end of file
// components/SearchBox/SearchBox.js
import {componentsMixin } from '../../mixins/index';
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
placeholder: {
type: String,
value: "请输入搜索内容",
},
value: {
type: String,
value: "",
observer(n) {
this.setData({
inputValue: n,
});
},
},
searchType: {
type: Number,
value: 1,
},
couponDetails: Boolean,
},
/**
* 组件的初始数据
*/
data: {
inputValue: "",
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail;
this.setData({
inputValue: value,
});
},
blur(e) {
let { inputValue } = this.data;
this.setData({
inputValue,
});
},
clear() {
this.setData({
inputValue: "",
});
},
confirm(e) {
let { value } = e.detail;
this.triggerEvent("search", value);
},
search(e) {
let { value } = e.currentTarget.dataset;
this.triggerEvent("search", value);
},
},
});
<view class="search-box box-center">
<view class="search type-{{searchType}}">
<view class="input-box" style="{{couponDetails?'width: 528rpx;':''}}">
<view class="icon box-center">
<icon type="search" size="20"></icon>
</view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder" placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}">
<view class="clear-box" bindtap="clear">
<view class="sprite-icon icon-clear"></view>
</view>
</block>
</view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view>
</view>
</view>
\ No newline at end of file
/* components/SearchBox/SearchBox.wxss */
@import '/sprite.wxss';
.search-box {
height: 104rpx;
box-sizing: border-box;
padding: 0 var(--margin);
background-color: #fff;
}
.box-center {
display: flex;
align-items: center;
justify-content: center;
}
.search {
width: 100%;
height: 72rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.type-1 {
padding: 0 6rpx;
border-radius: 38px;
border: 3rpx solid var(--btnColor);
}
.type-1 .button {
width: 104rpx;
height: 60rpx;
border-radius: 38rpx;
background-color: var(--btnColor);
color: #fff;
font-size: var(--margin);
}
.type-1 .input-box {
width: calc(100% - 110rpx);
display: flex;
align-items: center;
}
.input-box .icon {
width: 58rpx;
}
.type-1 .input-box .input,
.type-2 .input-box .input {
width: calc(100% - 130rpx);
font-size: 28rpx;
}
.input-box .clear-box{
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.input-box .clear-box .icon-clear{
opacity: .7;
}
.type-2 .input-box {
display: flex;
align-items: center;
width: 592rpx;
height: 100%;
background: #F8F8F8;
border-radius: 38rpx;
}
.type-2 .button {
color: #656566;
font-size: var(--margin);
}
.input-placeholder {
color: #CFCFCF;
font-size: 28rpx;
}
\ No newline at end of file
// components/SearchInput/SearchInput.js
import {componentsMixin } from '../../mixins/index'
Component({
behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
......@@ -22,9 +20,7 @@ Component({
/**
* 组件的初始数据
*/
data: {
},
data: {},
/**
* 组件的方法列表
......@@ -39,9 +35,7 @@ Component({
})
},
input(e) {
let {
value
} = e.detail
let { value } = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
......@@ -55,9 +49,7 @@ Component({
},
emit(e) {
let {
detail:{
value
},
detail: { value },
type
} = e
this.setData({
......@@ -69,4 +61,4 @@ Component({
})
}
}
})
\ No newline at end of file
})
// components/Select/Select.js
Component({
properties: {
// 这里定义了innerText属性,属性值可以在组件使用时指定
innerText: {
type: String,
value: 'default value'
}
},
data: {
// 这里是一些组件内部数据
someData: {}
},
methods: {
// 这里是一个自定义方法
customMethod: function () {}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Select/Select.wxss */
.com-selectBox {
width: 200px;
}
.com-sContent {
border: 1px solid #e2e2e2;
background: white;
font-size: 16px;
position: relative;
height: 30px;
line-height: 30px;
}
.com-sImg {
position: absolute;
right: 10px;
top: 11px;
width: 16px;
height: 9px;
transition: all .3s ease;
}
.com-sTxt {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 20px 0 6px;
font-size: 14px;
}
.com-sList {
background: white;
width: inherit;
position: absolute;
border: 1px solid #e2e2e2;
border-top: none;
box-sizing: border-box;
z-index: 3;
max-height: 120px;
overflow: auto;
}
.com-sItem {
height: 30px;
line-height: 30px;
border-top: 1px solid #e2e2e2;
padding: 0 6px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
}
.com-sItem:first-child {
border-top: none;
}
\ No newline at end of file
<!-- components/Select/Select.wxml -->
<view class='com-selectBox'>
<view class='com-sContent' bindtap='selectToggle'>
<view class='com-sTxt'>{{nowText}}</view>
<image src='../../public/image/index/jinru1@2x.png' class='com-sImg' animation="{{animationData}}" />
</view>
<view class='com-sList' wx:if="{{selectShow}}">
<view
wx:for="{{propArray}}"
data-index="{{index}}"
wx:key=''
class='com-sItem'
bindtap='setText'>
{{item.text}}
</view>
</view>
</view>
// 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
},
/**
* 组件的方法列表
*/
methods: {
handleShow() {
this.setData({
isShow: !this.data.isShow
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/Service/Service.wxss */
.service {
position: fixed;
right: 0rpx;
top: 73%;
z-index: 120;
}
.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-->
<div 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>
</div>
\ No newline at end of file
// components/Tab/Tab.js
import {componentsMixin } from '../../mixins/index'
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({
behaviors:[componentsMixin],
behaviors: [imgUrlMixin],
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
outClassName:String,
tab: Array,
openScroll: Boolean,
tabHeight: {
type: Boolean,
value: false
},
productHeight: {
type: Boolean,
value: false
},
index: {
type: Number,
observer: function (n) {
......@@ -17,10 +30,16 @@ Component({
})
}
},
itemWidth: String,
align: {
type: String,
default: ''
}
value: ''
},
// 是否有红点
unreadClueCount: {
type: Number,
value: 0
},
},
/**
......@@ -30,20 +49,24 @@ Component({
count: 0,
to: ''
},
// lifetimes:{
// attached: function() {
// console.log('unreadClueCount',this.data.unreadClueCount)
// }
// },
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
count
} = e.currentTarget.dataset
let { count } = e.currentTarget.dataset
this.setData({
count,
to: `to-${count}`
to: `to-${count}`,
unreadClueCount:0
})
this.triggerEvent('click', count)
}
}
})
\ No newline at end of file
})
<wxs src="./Tab.wxs" module="filterUtils" />
<block wx:if="{{openScroll}}">
<scroll-view class="tab-box {{align}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}" >
<view class="text" >{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line"></view>
</view>
</block>
</scroll-view>
<scroll-view class="tab-box {{align}} {{outClassName}}" style="{{productHeight ? 'height: 72rpx;' : ''}}" scroll-x enable-flex scroll-with-animation scroll-into-view="{{to}}" enhanced="{{true}}" show-scrollbar="{{false}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}" id="to-{{index}}">
<view class="text" style="{{productHeight ? 'height: 60rpx;' : ''}}">{{item}}</view>
<!-- <view class="text" style="width:{{38 * item.length + 20}}rpx;">{{item}}</view> -->
<view class="line" style="{{productHeight ? 'height: 4rpx;' : ''}}" />
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="tab-box flex">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" bindtap="click" data-count="{{index}}">
<view class="text text-center">{{item}}</view>
<view class="line"></view>
</view>
</block>
</view>
<view class="tab-box flex" style="{{tabHeight ? 'height: 60rpx;' : ''}}">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index==count?'active':''}}" style="width:{{itemWidth}}; {{index == 0 ? 'margin-left: 32rpx;' : ''}}" bindtap="click" data-count="{{index}}">
<view class="text text-center" style="{{tabHeight ? 'height: 60rpx;' : ''}}">{{item}}</view>
<view class="line" style="{{tabHeight ? 'margin-top: 6rpx;' : ''}}" />
<!-- -->
<!-- <view wx:if="{{filterUtils.hasRedpoint(unreadClueCount)}}" class="redpoint" /> -->
</view>
</block>
</view>
</block>
\ No newline at end of file
var hasRedpoint = function (unreadClueCount) {
// console.log('unreadClueCount: ', unreadClueCount);
if(unreadClueCount>0){
return true
}else{
return false;
}
};
module.exports = {
hasRedpoint: hasRedpoint,
};
/* components/Tab/Tab.wxss */
@import "../../common.wxss";
.tab-box {
display: flex;
/* display: grid; */
width: 100%;
height: 92rpx;
box-sizing: border-box;
}
.tab-box.left{
.tab-box.left {
padding-left: 32rpx;
}
.left .tab{
padding-right:40rpx;
.left .tab {
padding-right: 40rpx;
}
.flex .tab {
/* .flex .tab {
flex: 1;
}
} */
.tab {
position: relative;
flex-shrink: 0;
}
.tab .text {
height: 84rpx;
display: flex;
......@@ -27,19 +32,26 @@
box-sizing: border-box;
color: #A9A9A9;
justify-content: center;
font-size: 28rpx;
}
.left .text{
.left .text {
justify-content: flex-start;
}
.flex .tab .text {
padding: 0;
}
.tab + .tab{
margin-left: 20rpx;
}
.tab.active .text {
font-weight: 500;
font-size: 28rpx;
/* font-weight: 500; */
font-weight: 600;
font-size: 38rpx;
transition: all .25s;
color: #2C2C2C;
font-family: PingFangSC-S0pxibold;
}
.tab .line {
......@@ -61,4 +73,39 @@
width: 0;
height: 0;
color: transparent;
}
.active .redpoint {
display: none;
}
.redpoint {
position: absolute;
top: 10px;
right: 5px;
/* top: 8px;
right: 10px; */
width: 10px;
height: 10px;
background: #EB4E4E;
border-radius: 50%;
}
/* 外部出进来的自定义样式 */
.project-tab {
padding-left: 20px;
padding-right: 20px;
}
.project-tab .tab {
margin-right: 28px;
}
.project-tab .tab.active .text {
font-size: 28rpx;
color: var(--btnColor);
}
.project-tab .tab .line {
width: auto;
}
\ 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: function (url, o) {
if (url) {
let isWebp = url.includes('webp')
this.setData({
isWebp,
imagePath: `${IMG_URL}${url}?v=` + IMG_VERSION()
})
}
}
},
mode: {
type: String,
value: 'scaleToFill'
},
webp: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
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: {}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/image/index.wxss */
\ No newline at end of file
<!-- components/image/index.wxml -->
<image
src="{{imagePath}}"
mode="{{mode}}"
webp="{{webp||isWebp}}"
lazy-load
class="custom-class class" />
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData } from '~/pages/tab/index/constant/senceData'
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
Component({
externalClasses: ['custom-class'],
/**
* 组件的属性列表
*/
properties: {
// 场景值下标
actNum: {
type: Number,
value: -1,
observer(n) {
this.getInfo()
if (n == 3) {
this.setVideoCtx()
}
}
},
// 选中的产品
activeNavIdx: {
type: Number,
value: 0
},
cardInfo: {
type: Object,
value: {}
},
// 配置url
activeUrl: {
type: String,
value: ''
},
sharephone: {
type: String,
value: ''
},
showLeftFlag: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/',
productData,
proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0,
scrollTop: 0,
showCard: false,
tabList: [],
imgTopArr: []
},
lifetimes: {
attached() {
wx.showLoading()
setTimeout(() => {
wx.hideLoading()
this.getImgHeight()
}, 800)
},
},
/**
* 组件的方法列表
*/
methods: {
setVideoCtx() {
this.setData({
videoCtx: wx.createVideoContext('video', this),
crowdVideoCtx: wx.createVideoContext('crowd-video', this)
})
},
handleVideoPlay(e) {
let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause()
},
getInfo() {
let { activeNavIdx, actNum } = this.data
const spcList = [99] // 订阅模块需要特殊处理
const senceList = this.data.productData[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ? item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
})
break
}
}
},
getImgHeight() {
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let imgTopArr = []
let s = 0
let top
let { scrollTop } = this.data
let _this = this
query
.selectAll('.img-item')
.boundingClientRect(react => {
react.forEach((item, index) => {
//44 tab的高度
s = item.top - 44 + scrollTop
imgTopArr.push(s)
})
_this.setData({
imgTopArr
})
})
.exec()
// setTimeout(() => {
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
},
// 1.3查看活动详情按钮
checkActive() {
let { activeUrl } = this.data
wx.$router.jumpH5(activeUrl);
},
onClickTab(event) {
// console.log('event: ', event);
let { index } = event.detail
// console.log('index: ', index);
this.setData({
tabAct: index
})
let { imgTopArr } = this.data
wx.pageScrollTo({
scrollTop: imgTopArr[index] + 5
})
},
pageSroll(e) {
let { imgTopArr } = this.data
wx.nextTick(() => {
let idx
if (imgTopArr[0] > e.scrollTop) {
idx = 0
} else if (imgTopArr[imgTopArr.length - 1] > e.scrollTop && imgTopArr[0] < e.scrollTop) {
idx = imgTopArr.findIndex(item => item > e.scrollTop) - 1
} else {
idx = imgTopArr.length - 1
}
this.setData({
tabAct: idx,
scrollTop: e.scrollTop
})
})
},
selectCard() {
//console.log(this.data.showCard)
this.setData({
showCard: !this.data.showCard
})
},
phoneCall(e) {
let { phone } = e.currentTarget.dataset;
wx.$api.phoneCall(phone);
},
getUserInfo(e) {
this.triggerEvent('getUserInfo', { detail: e.detail })
},
}
})
{
"component": true,
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index"
}
}
\ No newline at end of file
/* packagesList/pages/productDetail/components/proDetail/proDetail.wxss */
page {
background-color: #fff;
}
.view-prod {
.frame {
margin: 16rpx 32rpx;
width: calc(100% - 64rpx);
height: 422rpx;
border-radius: 16rpx;
box-sizing: border-box;
}
.title-wrap {
margin-bottom: 32rpx;
margin-left: 32rpx;
margin-right: 32rpx;
display: flex;
height: 104rpx;
align-items: center;
.title {
width: 564rpx;
height: 48rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
.check {
margin-left: 30rpx;
margin-right: 6rpx;
width: 28rpx;
height: 28rpx;
}
.num {
font-size: 24rpx;
color: #5a6066;
}
}
.no-video {
margin: 16rpx auto 32rpx;
display: block;
width: 686rpx;
height: 386rpx;
border-radius: 16rpx;
}
.tab-wrap {
position: sticky;
top: 0;
margin-bottom: 20rpx;
z-index: 1;
.tabs-index--van-tabs {
top: -1px
}
.van-tab {
font-size: 28rpx;
color: #5a6066;
}
.van-tab--active {
font-weight: 600;
font-size: 28rpx;
color: #3666fe;
}
frame .van-tabs__line {
width: 112rpx !important;
height: 4rpx !important;
}
}
.prod-detail {
.occupancy {
height: 120rpx;
}
.img-item {
position: relative;
}
.phone {
position: absolute;
top: 60rpx;
right: 32rpx;
font-weight: 400;
font-size: 24rpx;
color: #6C6C6C;
display: flex;
align-items: center;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 6rpx;
}
}
.check-act {
width: 100%;
text-align: center;
position: absolute;
bottom: 64rpx;
right: 0;
font-weight: 600;
font-size: 28rpx;
color: #3666FE;
text-decoration: underline;
}
.crowd-video {
width: calc(100% - 64rpx);
height: 386rpx;
position: absolute;
top: 264rpx;
margin: 0 32rpx;
border-radius: 16rpx;
}
.more-btn {
position: absolute;
left: 50%;
bottom: 50px;
transform: translateX(-50%);
width: 622rpx;
height: 96rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/btn.png");
background-size: 100% 100%;
font-weight: 500;
font-size: 16px;
color: #ffffff;
text-align: center;
line-height: 96rpx;
}
// .img-item0 {
// width: 100%;
// height: 2564rpx;
// }
// .img-item1 {
// width: 100%;
// height: 1812rpx;
// }
// .img-item2 {
// width: 100%;
// height: 620rpx;
// }
// .img-item3 {
// width: 100%;
// height: 2156rpx;
// }
// 流程图一
.img-item00 {
width: 100%;
height: 3308rpx;
}
.img-item01 {
width: 100%;
height: 2598rpx;
}
.img-item02 {
width: 100%;
height: 490rpx;
}
.img-item03 {
width: 100%;
height: 688rpx;
}
// // 流程图二
.img-item10 {
width: 100%;
height: 1488rpx;
}
.img-item11 {
width: 100%;
height: 2192rpx;
}
.img-item12 {
width: 100%;
height: 490rpx;
}
.img-item13 {
width: 100%;
height: 688rpx;
}
// // 流程图三
.img-item20 {
width: 100%;
height: 1488rpx;
}
.img-item21 {
width: 100%;
height: 570rpx;
}
.img-item22 {
width: 100%;
height: 490rpx;
}
.img-item23 {
width: 100%;
height: 864rpx;
}
// // 流程图四
.img-item30 {
width: 100%;
height: 5758rpx;
}
.img-item31 {
width: 100%;
height: 1812rpx;
}
.img-item32 {
width: 100%;
height: 490rpx;
}
.img-item46 {
width: 100%;
height: 1684rpx;
}
.img-item47 {
width: 100%;
height: 3688rpx;
}
// .img-item48 {
// width: 100%;
// height: 4004rpx;
// }
.img-item48 {
width: 100%;
height: 472rpx;
}
.img-item49 {
width: 100%;
height: 4594rpx;
}
.img-item50 {
width: 100%;
height: 1650rpx;
}
.img-item51 {
width: 100%;
height: 552rpx;
}
.img-item52 {
width: 100%;
height: 4360rpx;
}
.img-item53 {
width: 100%;
height: 1130rpx;
}
.img-item54 {
width: 100%;
height: 428rpx;
}
}
}
/* 用户授权 */
.user-profile {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 3;
background-color: transparent;
}
.pro-head {
position: relative;
.select-card {
position: absolute;
right: 0;
top: 26rpx;
width: 142rpx;
height: 68rpx;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 rgba(175, 175, 219, 0.65);
border-radius: 34rpx 0 0 34rpx;
z-index: 2;
display: flex;
align-items: center;
padding: 12rpx;
box-sizing: border-box;
font-weight: 600;
font-size: 26rpx;
color: #57578A;
.icon-card {
width: 48rpx;
height: 48rpx;
margin-right: 8rpx;
}
}
}
\ No newline at end of file

1.42 KB | W: | H:

2.64 KB | W: | H:

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

1.63 KB | W: | H:

2.88 KB | W: | H:

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

1.34 KB | W: | H:

2.59 KB | W: | H:

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

1.47 KB | W: | H:

2.84 KB | W: | H:

images/mine_active.png
images/mine_active.png
images/mine_active.png
images/mine_active.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed. Click to expand it.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!