Commit 7746aebc by 前端

Merge branch 'develop' into 'master'

Dev v3.2.0上线后,代码合并。

See merge request !19
2 parents b7debe51 72b1477b
Showing 203 changed files with 2997 additions and 841 deletions
project.config.json
project.private.config.json
sitemap.json
miniprogram_npm
node_modules
# local env files
.env.local
......
## 正式版appid wx2c28337db96364d2
## 体验版appid wx24ebae5768e74138
\ No newline at end of file
## 体验版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,
// })
}
},
```
/**
* 申请门店开通
*/
// import api from '~/utils/request/request'
// const serverApi = {
// productByscene:'scrm.api.busassistant.activity.productByscene'
// }
// export const productBysceneApi = (data) =>{
// return api.post(
// {
// method: serverApi.productByscene,
// ...data
// },
// true
// )
// }
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
);
};
......@@ -84,5 +84,28 @@ class outputApi {
...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'
const serverApi = {
getActive: 'scrm.api.busassistant.activity.getActivityUrl' //获取活动配置
}
export const getActiveApi = data => {
return api.post(
{
method: serverApi.getActive,
...data
},
true
)
}
......@@ -50,6 +50,7 @@ App({
// 存储设备信息
setSystem_info()
// console.log('test')
},
onShow(options) {
......@@ -59,6 +60,5 @@ App({
onPageNotFound(e) {
wx.$router.goHome()
},
onHide() {},
globalData: {}
onHide() {}
})
......@@ -5,16 +5,17 @@
"pages/tab/output/output",
"pages/tab/mine/mine",
"pages/webView/webView",
"pages/apply/apply",
"login/index/index",
"login/accountItems/accountItems",
"pages/checkProduct/checkProduct",
"packageOutput/pages/summary/summary",
"packageOutput/pages/openBusiness/openBusiness",
"pages/mineDetail/customerManagement/customerManagement",
"pages/mineDetail/messageBox/messageBox"
"pages/viewVideo/index",
"pages/viewProd/index",
"pages/viewProdBanner/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult"
],
"requiredPrivateInfos": [
"getLocation"
],
"requiredPrivateInfos": ["getLocation"],
"lazyCodeLoading": "requiredComponents",
"window": {
"backgroundTextStyle": "light",
......@@ -47,15 +48,61 @@
}
]
},
"subpackages": [],
"subpackages": [
{
"root": "packagesList/packageOutput",
"name": "packageOutput",
"pages": [
"pages/openBusiness",
"pages/summary"
]
},
{
"root": "packagesList/mineDetail",
"name": "mineDetail",
"pages": [
"pages/messageBox",
"pages/customerManagement"
]
},
{
"root": "packagesList/apply",
"name": "apply",
"pages": [
"pages/apply"
]
},
{
"root": "packagesList/applyProd",
"name": "applyProd",
"pages": [
"pages/apply"
]
}
],
"preloadRule": {
"pages/tab/mine/mine": {
"network": "all",
"packages": [
"mineDetail"
]
},
"pages/tab/index/index": {
"network": "all",
"packages": [
"apply",
"packageOutput"
]
}
},
"usingComponents": {
"tab": "/components/Tab/Tab",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"popup": "/components/Popup/Popup",
"nothing-tips": "/components/Nothing-tips/nothingTips",
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster"
"crowdfund-poster": "/components/CrowdfundPoster/CrowdfundPoster",
"glsx-image": "/components/image/index"
},
"style": "v2",
"resolveAlias": {
"~/*": "/*"
},
......@@ -65,4 +112,4 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
}
\ No newline at end of file
@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;
......@@ -8,6 +23,11 @@ page {
--btnColor: #3666FE;
--borderRadius: 8rpx;
--margin: 32rpx;
/* vant 样式覆盖 */
--tabs-bottom-bar-color:#3666FE;
--sidebar-selected-border-color:#3666FE;
--tree-select-nav-background-color:#f6f6f6;
}
image {
......@@ -16,6 +36,10 @@ image {
vertical-align: top;
}
.font-number {
font-family: 'number';
}
.icon-mine-arrow {
width: 16rpx !important;
height: 28rpx !important;
......
......@@ -6,114 +6,286 @@ Component({
* 组件的属性列表
*/
properties: {
// 默认母链海报 不是须样式须单独处理 通过item.type 区分类型
item: {
type: Object,
observer(n) {
console.log(n, '=================')
n.posterUrl && this.getImageInfo(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: {},
data: {
_item_: null,
findKey: 'posterUrl',
height: '68%'
// poster: 'https://wx.glsx.com.cn/upload/biz/599036445419769856.png'
},
/**
* 组件的方法列表
*/
methods: {
getImageInfo(n, width, height) {
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)
// console.log(res)
// w = res.width
// h = res.height
that.init(n, res.width, res.height)
},
fail: function (res) {
console.log(res)
// console.log(res)
wx.$api.showToast('生成失败')
}
})
},
async init(n, ImgWidth, ImgHeight) {
let proportion = ImgWidth / 247
let actualHeight = ImgHeight / proportion
console.log(actualHeight)
n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
const drawfun = new Draw(
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( // 大画布
{
width: 279,
// height: 554
height: 82 + actualHeight
width: actualWidth + 32,
height: actualHeight + 82
// pixelRatio
},
this
),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName,
res = await drawfun.begin({
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: 247,
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,
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',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
radius: 2,
padding: [2, 5],
opacity: 0.5
}
]
})
console.log(res)
}
]
}
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,
......@@ -130,6 +302,7 @@ Component({
})
},
hide() {
console.log('hide')
this.setData({
show: false,
poster: ''
......@@ -140,6 +313,10 @@ Component({
this.setData({
showAuth: true
})
},
longpress() {
let { item } = this.data
this.triggerEvent('longtouch', item)
}
}
})
{
"component": true,
"usingComponents": {
"authorize":"/components/Authorize/Authorize"
}
"component": true
}
\ No newline at end of file
......@@ -5,6 +5,8 @@
right: 0;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 998;
display: flex;
flex-direction: column;
......@@ -16,35 +18,67 @@
width: 100%;
height: 100%;
z-index: -1;
background: rgba(28, 27, 35, 0.60);
background: rgba(0, 0, 0, .8);
}
.poster {
width: 558rpx;
// height: 60%;
height: 1108rpx;
box-sizing: border-box;
width: 500rpx;
max-height: 68%;
// height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx;
// smoo
// overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.pd {
padding: 32rpx;
background-color: #fff;
}
.btn {
width: 320rpx;
height: 88rpx;
line-height: 88rpx;
background: #3666FE;
// background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius: 16rpx;
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: #FFFFFF;
text-align: center;
margin-top: 32rpx;
color: #3666FE;
margin-top: -2rpx;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 12rpx;
}
}
.tips {
margin: 16rpx 80rpx 0;
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" catchtouchmove="noScroll" -->
<view class="layout">
<view class="bg" bindtap="hide" />
<view class="poster">
<!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
<image src="{{poster}}" mode="widthFix" />
<!-- </scroll-view> -->
<!-- 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 class="btn" bindtap="download">保存至相册</view>
<view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view>
</view>
</block>
<authorize
scopeType="writePhotosAlbum"
bindfail="authFail"
show="{{showAuth}}"
isShowCheck="{{false}}"
id="auth" />
<!-- <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
......@@ -5,6 +5,9 @@ Component({
* 组件的属性列表
*/
properties: {
options: {
addGlobalClass: true
},
sceneActive: {
type: Number,
value: -1
......
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="/pages/tab/output/index.wxs" module="filter" />
<view class="flex scene">
<view
class="scene-item {{ (formData['scene' + (index + 1)] && hasOpenIcon) ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}"
wx:for="{{custSceneList}}"
wx:key="index"
bindtap="handleClick"
data-idx="{{index + 1}}">
<!-- && sceneActive != (index + 1) -->
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 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{{index + 1}}.png?v={{img_version}}" ></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/car0{{index + 1}}.png?v={{img_version}}" ></image>
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
</view>
<view>{{item.subTitle}}</view>
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{scenePriceList[index].total}}
</view>
</view>
</view>
<view class="scene-item {{ (formData['scene' + (index + 1)] && hasOpenIcon) ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}" wx:for="{{custSceneList}}" wx:key="index" bindtap="handleClick" data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)]}}" class="open-icon">
<image src="{{openedIcon}}" webp></image>
</view>
<image webp wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caracticon0{{index + 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{{index + 1}}.png?v={{img_version}}"></image>
<image webp wx:else="" class="scene-img" src="{{IMGURL}}output/icon-car0{{index + 1}}.png?v={{img_version}}"></image>
</view>
<view class="scene-title {{formData['scene' + (index + 1)] ? '' : 'on-open'}}">
{{item.title}}
</view>
<view>{{item.subTitle}}</view>
<view class="total-price" wx:if="{{scenePriceList.length}}">
¥ {{filter.money_three_for_two_thousands(scenePriceList[index].total || 0.00)}}
</view>
</view>
</view>
\ No newline at end of file
......@@ -16,11 +16,12 @@
background: #F7F8FC;
margin-right: 4rpx;
font-size: 18rpx;
/* color: #8A8C90; */
color: #323436;
padding: 32rpx 0 28rpx;
color: #8A8C90;
/* padding: 32rpx 0 28rpx; */
padding: 24rpx 0 18rpx;
border-radius: 12rpx;
font-weight: 500;
border: 2rpx solid #F7F8FC;
/* margin-bottom: 20rpx; */
}
......@@ -33,6 +34,7 @@
height: 44rpx;
line-height: 44rpx;
margin: 10rpx 0 4rpx;
font-weight: 600;
}
/* 已开通 - start */
......@@ -66,7 +68,8 @@
.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);
/* 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 {
......@@ -90,17 +93,17 @@
color: #323436;
}
/* .scene-title.on-open {
.scene-title.on-open {
color: #8A8C90;
} */
}
.no-open-img {
position: relative;
}
.scene-img {
width: 56rpx;
height: 56rpx;
width: 92rpx;
height: 64rpx;
}
.lock-img {
......@@ -114,9 +117,10 @@
margin-top: 22rpx;
font-size: 24rpx;
color: #3666FE;
font-weight: 600;
/* font-weight: 600; */
font-family: 'number';
}
.notOpened {
/* .notOpened {
color: #8A8C90;
}
\ No newline at end of file
} */
\ No newline at end of file
// components/SearchBox/SearchBox.js
Component({
/**
* 组件的属性列表
*/
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
......@@ -42,11 +42,13 @@
.flex .tab .text {
padding: 0;
}
.tab + .tab{
margin-left: 20rpx;
}
.tab.active .text {
/* font-weight: 500; */
font-weight: 600;
font-size: 44rpx;
font-size: 38rpx;
transition: all .25s;
color: #2C2C2C;
font-family: PingFangSC-S0pxibold;
......
// 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: {}
})
/* 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" />
......@@ -6,5 +6,12 @@
// 配置预发布的小程序aapId
export const preReleaseAppId = 'wx24ebae5768e74138'
// 小程序id
export const appId = 'wx2c28337db96364d2'
// 开发环境
// 开发指定的小程序
// sentry Dsn 地址
export const dsnUrl = 'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
// login/index/components/LoginBox.js
import USERAPI from '~/api/usersApi/index'
import {
checkLoginUserInfo,
setLoginInfo,
loginModal
} from '~/login/lib/index'
import { checkLoginUserInfo, setLoginInfo, loginModal } from '~/login/lib/index'
import md5 from '~/utils/lib/md5'
import network from '~/utils/network'
import {
imgUrlMixin
} from '~/mixins/index'
import { imgUrlMixin } from '~/mixins/index'
let thisPage
Component({
behaviors: [imgUrlMixin],
......@@ -32,6 +26,8 @@ Component({
code: '',
account: '',
password: ''
// account: 'bb123456',
// password: 'bb123456'
},
phoneReady: false,
countDown: null
......@@ -49,11 +45,8 @@ Component({
},
/**输入回调 */
input(e) {
const {
value
} = e.detail, {
name
} = e.currentTarget.dataset
const { value } = e.detail,
{ name } = e.currentTarget.dataset
this.setData({
[`formData.${name}`]: value
})
......@@ -66,9 +59,7 @@ Component({
},
/**清除input value */
clear(e) {
const {
name
} = e.currentTarget.dataset
const { name } = e.currentTarget.dataset
this.setData({
[`formData.${name}`]: ''
})
......@@ -77,21 +68,14 @@ Component({
},
/**获取验证码 */
getSmsCode() {
const {
phoneReady,
formData,
count
} = this.data,
const { phoneReady, formData, count } = this.data,
countDown = 60
if (!phoneReady || count) return
this.setData({
smsLoading: true
})
USERAPI.getSmsCode(formData.phone)
.then(({
code,
message
}) => {
.then(({ code, message }) => {
this.setData({
smsLoading: false
})
......@@ -112,9 +96,7 @@ Component({
count: countDown
})
setTimeout(() => {
let {
count
} = this.data
let { count } = this.data
this.setData({
count: --count
})
......@@ -127,13 +109,11 @@ Component({
},
/**检查输入框内容 */
checkFormData() {
const {
loginType,
formData
} = this.data
const { loginType, formData } = this.data
if (loginType != 0) {
if (loginType == 1) {
this.setData({
this.setData(
{
phoneReady: formData.phone && thisPage.validate.methods.tel(formData.phone)
},
() => {
......@@ -151,39 +131,30 @@ Component({
},
/**手机号&帐号密码登录 */
login() {
const {
formData,
loginType
} = this.data,
const { formData, loginType } = this.data,
target = {
1: 'phoneSmsLogin',
2: 'accountLogin'
} [loginType],
}[loginType],
obj =
loginType == 1 ? {
mobile: formData.phone,
code: formData.code
} : {
userName: formData.account,
password: md5(formData.password)
}
loginType == 1
? {
mobile: formData.phone,
code: formData.code
}
: {
userName: formData.account,
password: md5(formData.password)
}
this.setBtnLoading()
USERAPI[target](obj)
.then(({
code,
data,
message
}) => {
.then(({ code, data, message }) => {
this.setBtnLoading(false)
if (code == '0') {
if (loginType == 1) checkLoginUserInfo(data)
else {
const {
autoLogin
} = thisPage.data, {
sessionId,
loginUserInfoList
} = data,
const { autoLogin } = thisPage.data,
{ sessionId, loginUserInfoList } = data,
validTime = 3600 * 24 * 7 * 1e3,
autoLoginFailureTime = Date.now() + validTime
if (autoLogin && loginUserInfoList[0]) {
......@@ -209,17 +180,14 @@ Component({
})
},
/**微信登录 */
wxLogin({
detail
}) {
if (!detail.code) return
wxLogin({ detail }) {
if (!detail.code) {
wx.$api.showToast('当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。')
return
}
this.setBtnLoading()
USERAPI.authUserPhone(detail, this.loginToken)
.then(({
code,
data,
message
}) => {
.then(({ code, data, message }) => {
if (code == '0') checkLoginUserInfo(data)
else {
wx.$api.showToast(message || '系统异常')
......@@ -227,9 +195,7 @@ Component({
}
this.setBtnLoading(false)
})
.catch(({
errMsg
}) => {
.catch(({ errMsg }) => {
wx.$api.showToast(errMsg || '系统异常')
this.setBtnLoading(false)
this.init()
......@@ -249,11 +215,7 @@ Component({
network.getNetworkType()
thisPage = wx.$router.getPageInstance()
try {
const {
data,
code,
message
} = await USERAPI.wxCodeLogin()
const { data, code, message } = await USERAPI.wxCodeLogin()
if (code == '0') {
thisPage.setData({
disabled: false
......@@ -261,10 +223,8 @@ Component({
this.loginToken = data
} else this.reLogin(message)
wx.hideLoading()
} catch ({
errMsg
}) {
console.error(errMsg)
} catch ({ errMsg }) {
// console.error(errMsg)
this.reLogin()
}
},
......@@ -276,4 +236,4 @@ Component({
if (reload) this.init()
}
}
})
\ No newline at end of file
})
/* login/index/components/LoginBox.wxss */
.box {
// height: 800rpx;
height: 750rpx;
.wx {
height: 922rpx;
.title {
font-weight: 600;
font-size: 60rpx;
color: #323436;
padding: 216rpx 0 24rpx;
}
.opacity-view {
animation: opacity-view .5s forwards;
.subtitle {
font-size: 44rpx;
color: #323436;
margin-bottom: 120rpx;
}
.img {
width: 472rpx;
height: 458rpx;
position: absolute;
left: 151rpx;
// top: 264rpx;
top: 214rpx;
width: 378rpx;
height: 364rpx;
display: block;
margin: 0 auto;
}
}
.opacity-view {
animation: opacity-view .5s forwards;
}
.box {
// height: 800rpx;
height: 750rpx;
.input-box {
width: 540rpx;
// padding-top: 352rpx;
......@@ -57,6 +72,7 @@
padding: 0;
text-align: right;
transition: all .25s;
&[disabled]:not([type]) {
color: #CCCED1;
}
......
<view class="box">
<block wx:if="{{loginType == 0}}">
<image webp class="img opacity-view" src="{{IMGURL}}login/login.webp" />
</block>
<block wx:else>
<block wx:if="{{loginType == 0}}">
<view class="wx opacity-view">
<view class="title">
您好
</view>
<view class="subtitle">
欢迎登录生意助手
</view>
<image webp class="img" src="{{IMGURL}}login/login-2.webp" />
</view>
</block>
<block wx:else>
<view class="box">
<view class="input-box opacity-view">
<view class="title">{{loginType == 1?'手机号':'账号'}}登录</view>
<block wx:if="{{loginType == 1}}">
......@@ -33,8 +41,8 @@
</view>
</block>
</view>
</block>
</view>
</view>
</block>
<block wx:if="{{loginType == 0}}">
<button class="button" disabled="{{disabled}}" hover-class="btn-hover" open-type="getPhoneNumber" bindgetphonenumber="wxLogin" loading="{{loading}}">微信登录</button>
</block>
......
......@@ -18,7 +18,7 @@
flex-direction: column;
width: 100rpx;
animation: btn-move .25s forwards;
margin:0 59rpx;
margin:0 79rpx;
.icon {
width: 68rpx;
height: 68rpx;
......
.layout {
position: relative;
padding: 0 32rpx;
padding: 0 80rpx;
font-size: 24rpx;
color: #8A8C90;
&::after {
&::before {
content: '';
width: 100%;
height: 486rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg.webp') no-repeat;
background-size: 100% 486rpx;
position: absolute;
height: 264rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-top.webp') no-repeat;
background-size: 100% 264rpx;
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
&::after {
content: '';
width: 100%;
height: 472rpx;
background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg-bottom.webp') no-repeat;
background-size: 100% 472rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: -1;
}
}
@keyframes opacity-view {
0% {
......@@ -31,7 +41,7 @@
width: 100% !important;
height: 88rpx;
background: var(--btnColor);
border-radius: 8rpx;
border-radius: 16rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
......
import {
checkLoginUserInfo,
setRouteData,
setLoginInfo,
loginModal
} from '../lib/index'
import {
getSessionId,
} from '~/utils/cache/storageApi'
import { checkLoginUserInfo, setRouteData, setLoginInfo, loginModal } from '../lib/index'
import { getSessionId } from '~/utils/cache/storageApi'
import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onLoad(options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
......@@ -39,9 +27,7 @@ Page({
const appEnter = wx.getEnterOptionsSync()
if (appEnter.scene == 1037) {
if (Object.keys(appEnter.referrerInfo).length) {
const {
extraData
} = appEnter.referrerInfo
const { extraData } = appEnter.referrerInfo
if (extraData && Object.keys(extraData).length) this.phoneSmsLogin(extraData)
else this.init()
} else this.init()
......@@ -51,44 +37,31 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
init() {
wx.nextTick(() => {
const sessionId = getSessionId(),
{
url,
targetPath = url ? decodeURIComponent(url) : ''
} = this.options
{ url, targetPath = url ? decodeURIComponent(url) : '' } = this.options
let path = 'pages.index',
obj = {}
if (targetPath) obj.targetPath = targetPath
if (sessionId) {
USERAPI.checkSession().then(({
code
}) => {
USERAPI.checkSession().then(({ code }) => {
if (code == '0') {
if (targetPath) {
path = setRouteData(targetPath).url
......@@ -103,25 +76,14 @@ Page({
autoLogin(obj) {
const autoLoginObject = wx.$storage.get('auto_login_object')
if (autoLoginObject) {
const {
failureTime,
userName,
password
} = autoLoginObject
const { failureTime, userName, password } = autoLoginObject
if (Date.now() < failureTime) {
USERAPI.accountLogin({
userName,
password
}).then(async ({
data,
code,
message
}) => {
}).then(async ({ data, code, message }) => {
if (code == '0' && data.loginUserInfoList.length) {
const {
sessionId,
loginUserInfoList
} = data
const { sessionId, loginUserInfoList } = data
setLoginInfo(loginUserInfoList[0], sessionId)
} else {
try {
......@@ -142,13 +104,10 @@ Page({
phoneSmsLogin(extraData) {
console.log(extraData)
USERAPI.phoneSmsLogin({
mobile: extraData.phone,
code: extraData.smscode
}).then(({
code,
data,
message
}) => {
mobile: extraData.phone,
code: extraData.smscode
})
.then(({ code, data, message }) => {
if (code == '0') checkLoginUserInfo(data)
else {
wx.$api.showToast(message || '系统异常')
......@@ -164,4 +123,4 @@ Page({
}, 1e3)
})
}
})
\ No newline at end of file
})
{
"name": "business-assistant",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@vant/weapp": {
"version": "1.10.7",
"resolved": "https://registry.npmmirror.com/@vant/weapp/-/weapp-1.10.7.tgz",
"integrity": "sha512-R2FyCk0mK2xvUX2dMgVZjVG512RKBj7ELMDxjRJjhQWtw4495WBgbl5Yb4v2A6d4vWJe6z9toKgDJTciN0Bo9A=="
}
}
}
{
"name": "business-assistant",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.7"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://luyt@192.168.3.233:8090/saas_plus/business-assistant.git"
},
"author": "",
"license": "ISC"
}
......@@ -115,5 +115,5 @@
</view>
</view>
</view>
<crowdfund-poster item="{{posterItem}}" />
<crowdfund-poster item="{{posterItem}}" id="poster" />
// pages/apply/apply.js
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import applyApi from '~/api/applyApi/index'
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = '../../images/'
import { senceData } from '~/pages/tab/index/constant/data'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
Page({
/**
* 页面的初始数据
*/
behaviors: [computedBehavior],
data: {
senceData,
// navStyle,
IMG_URL,
carObj: {
name: '',
model: '',
selNum: '',
contact: '',
phone: ''
},
actNum:0, //选中的场景
selectProdArr:[] //选中的产品数组
},
// computed: {
// hasProdAct(data) {
// return data.selectProdArr.
// }
// },
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
selectCar(e) {
// console.log('e: ', e);
let {num} = e.currentTarget.dataset
this.setData({
actNum:num
})
},
selectProd(e){
console.log('e: ', e);
let item = e.currentTarget.dataset.item
let productName = item.productName
let {selectProdArr} = this.data;
let searchIndex = selectProdArr.findIndex((item)=>item.productName == productName)
if(searchIndex != -1){
// 找到item、删除
selectProdArr.splice(searchIndex, 1)
}else{
selectProdArr.push(item)
}
this.setData({
selectProdArr
})
},
// 提交信息
applyFn() {
let { name } = this.data.carObj
// console.log('name: ', name)
if (!name) {
wx.pro.showToast({
title: '请输入开店名称',
icon: 'error'
})
return
}
this.submitForm()
// console.log(123)
},
submitForm() {
let { carObj, clueId,selectProdArr } = this.data
let selectProdArrStr = ''
selectProdArr.forEach((item,index)=>{selectProdArrStr+=`${item.productName}${selectProdArr.length-1 == index?'':';'}`})
let { userInfo } = wx.$storage.get()
let MerchantInfo = userInfo.subLoginUser
let params = {
serviceMerchantId: MerchantInfo.merchantId,
serviceMerchantName: MerchantInfo.merchantName,
serviceMerchantPhone: MerchantInfo.phone,
merchantContact: carObj.contact,
phone: carObj.phone,
applyMerchantName: carObj.name,
carType: carObj.model,
baseCustomer: carObj.selNum,
clueId,
intentProducts:selectProdArrStr
}
// return wx.$api.showToast('申请成功')
applyApi
.merchantApply(params)
.then(result => {
// console.log(result)
if (result) {
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
let node = page.selectComponent('#indexclue')
node && node.getClueInit()
})
}, 1000)
}
})
.catch(err => {})
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name
let content = e.detail.value
this.setData({
[`carObj.${name}`]: content
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onRoute(params) {
// 线索id
this.setData({
clueId: params
})
// console.log('params: ', params)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
/* pages/apply/apply.wxss */
page {
background: white;
// height: 100%;
position: relative;
}
.apply {
padding-bottom: 64rpx;
.head {
position: sticky;
top: 0;
width: 100%;
}
.introduce {
height: 320rpx;
}
.content-wrap{
background-image:linear-gradient(to bottom,#D0E5FE,#fff);
}
.content {
margin-left: 24rpx;
margin-right: 24rpx;
padding-top: 16px;
// padding: 16px 17px 0;
background: #ffffff;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.4);
border-radius: 16rpx;
.item {
}
.top {
margin-bottom: 32rpx;
display: flex;
align-items: center;
.line {
// width: 3px;
// height: 14px;
// background:var(--btnColor);
width: 6rpx;
height: 36rpx;
background: #3666fe;
border-radius: 0 8rpx 8rpx 0;
}
.title {
margin-left: 26rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
}
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 500;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip{
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name {
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select{
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item{
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act{
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img{
display: block;
}
}
.act-img{
display: none;
position:absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
}
.btn {
margin: 64rpx auto 0;
width: 648rpx;
font-weight: 500;
font-size: 17px;
color: #ffffff;
background: var(--btnColor);
// position: absolute;
// bottom: 40rpx;
// left: 50%;
// transform: translateX(-50%);
}
}
<!-- pages/apply/apply.wxml -->
<wxs module="filter" src="./apply.wxs"></wxs>
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
开店名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="营业执照上的公司名称" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="主营品牌/车型" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面新车销量/基盘客户</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入数字" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">门店联系人</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人手机号</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" placeholder="请输入手机号" />
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">业务场景</view>
<view class="content-product">
<view class="scene">
<!-- wx:if="{{item.sceneStatus == 1}}" -->
<scroll-view scroll-x="{{true}}">
<view class="scene-wrap">
<view class="item-wrap {{actNum== index ? 'act':''}}" data-num="{{index}}" data-scenestatus="{{item.sceneStatus}}" bindtap="selectCar" wx:for="{{senceData}}" wx:key="name">
<view class="item">
<!-- <image class="open-img" wx:if="{{item.sceneStatus == 1}}" src="{{IMG_URL}}/output/openedIcon.png" /> -->
<image webp class="img" src="{{item.src}}" />
<view class="name">{{item.name}}</view>
<view class="msg">{{item.msg}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="scene-title" hover-class="none" hover-stop-propagation="false">
业务场景
<view class="tip" hover-class="none" hover-stop-propagation="false">(可多选)</view>
</view>
<view class="scene-select">
<view class="scene-item {{filter.hasProdAct(item,selectProdArr)?'act':''}}" wx:for="{{senceData[actNum]['productList']}}" wx:key="index" data-item="{{item}}" data-index="{{index}}" bindtap="selectProd">
<glsx-image webp class="act-img" src="index/act-img.png"></glsx-image>
{{item.productName}}
</view>
</view>
</view>
</view>
<button class="btn" bindtap="applyFn">提交开店信息</button>
</view>
\ No newline at end of file
//查询是否选中
function hasProdAct(prod,selectProdArr) {
// console.log('prod: ', JSON.stringify(prod));
// console.log('selectProdArr: ', JSON.stringify(selectProdArr));
if(!selectProdArr || selectProdArr.length === 0) return
console.log('selectProdArr: ', selectProdArr);
var resIndex = -1
for(var i = 0;i<selectProdArr.length;i++){
if(selectProdArr[i].productName == prod.productName){
resIndex = i
}
}
if(resIndex == -1){
return false
}
return true;
}
// 导出对外暴露的属性
module.exports = {
hasProdAct: hasProdAct
}
\ No newline at end of file
// pages/apply/apply.js
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import {getMerchantListApi,addCoProductApi} from '~/api/applyProd.js'
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import utils from '~/utils/util.js'
Page({
/**
* 页面的初始数据
*/
behaviors: [computedBehavior],
data: {
IMG_URL,
// navStyle,
prodName:'',
cooperativeStore:'',
storeShow: false,
actions: [
// {
// "merchantId": 0,
// "merchantName": "选项1"
// },
// {
// "merchantId": 1,
// "merchantName": "选项2"
// },
],
selectStoreItem:{},
scene:'' //场景值
},
computed: {
selectStoreValue(data) {
return data.selectStoreItem.name || '请输入合作门店'
}
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
// 选择门店
selectStore(){
this.setData({ storeShow: true });
},
onStoreClose() {
this.setData({ storeShow: false });
},
onStoreSelect(event) {
console.log(event.detail);
let selectStoreItem = event.detail
this.setData({ selectStoreItem})
this.onStoreClose()
},
// 提交信息
applyFn() {
let {prodName,selectStoreItem} = this.data
if (!prodName) {
wx.pro.showToast({
title: '请输入产品名称',
icon: 'error'
})
return
}
if(utils.isEmptyObj(selectStoreItem)){
wx.pro.showToast({
title: '请选择合作门店',
icon: 'error'
})
return
}
this.submitForm()
// console.log(123)
},
async submitForm() {
let {prodName,selectStoreItem} = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
...selectStoreItem,
serviceMerchantId:userInfo.merchantId,
serviceMerchantName:userInfo.merchantName,
coProduct:prodName
}
let {code} = await addCoProductApi(params)
// console.log('res: ', res);
if(code == 0){
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
let node = page.selectComponent('#indexclue')
node && node.getClueInit()
})
}, 1000)
}
// // return wx.$api.showToast('申请成功')
// applyApi
// .merchantApply(params)
// .then(result => {
// console.log(result)
// if (result) {
// wx.$api.showToast('申请成功')
// setTimeout(() => {
// wx.$router.back(page => {
// let node = page.selectComponent('#indexclue')
// node && node.getClueInit()
// })
// }, 1000)
// }
// })
// .catch(err => {})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onRoute(params) {
// console.log('params: ', params.scene)
this.setData({
scene:params.scene
})
this.getMerchantListFn()
},
//获取门店
async getMerchantListFn(){
let {scene} = this.data
let userInfo = wx.$storage.get('userInfo')
let params = {
// scene,
serviceMerchantId:userInfo.merchantId
}
let {code,data} = await getMerchantListApi(params)
if(code== 0 && data.length != 0){
data = data.map(item=>{
item.name = item.merchantName
return item
} )
// console.log('data: ', data);
this.setData({
actions:data
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"usingComponents": {
"van-action-sheet": "@vant/weapp/action-sheet/index",
"van-cell": "@vant/weapp/cell/index"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
\ No newline at end of file
/* pages/apply/apply.wxss */
page {
background: white;
// height: 100%;
position: relative;
}
.apply {
padding-bottom: 64rpx;
.head {
position: sticky;
top: 0;
width: 100%;
}
.introduce {
height: 320rpx;
}
.content-wrap{
background-image:linear-gradient(to bottom,#D0E5FE,#fff);
}
.content {
margin-left: 24rpx;
margin-right: 24rpx;
padding-top: 16px;
// padding: 16px 17px 0;
background: #ffffff;
box-shadow: 0 6rpx 24rpx 0 rgba(175, 181, 219, 0.4);
border-radius: 16rpx;
.item {
}
.top {
margin-bottom: 32rpx;
display: flex;
align-items: center;
.line {
// width: 3px;
// height: 14px;
// background:var(--btnColor);
width: 6rpx;
height: 36rpx;
background: #3666fe;
border-radius: 0 8rpx 8rpx 0;
}
.title {
margin-left: 26rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
// line-height: 48rpx;
}
}
.inp-wrap {
margin-left: 32rpx;
display: flex;
align-items: center;
height: 112rpx;
border-bottom: 1px solid #f3f3f3;
.title {
margin-right: 64rpx;
// margin-top: 8px;
// margin-bottom: 8px;
font-weight: 500;
font-size: 14px;
color: #323436;
.point {
color: #f35251;
}
}
.inp {
flex: 1;
height: 112rpx;
// padding: 7px 12px;
// border: 1px solid #E3E4E8;
// border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8a8c90;
}
.out-van-cell{
flex: 1;
.inp-van-cell{
&.van-cell{
height: 112rpx;
line-height: 112rpx;
padding:0;
flex: 1;
.point {
color: #f35251;
}
// line-height: 1;
}
&:after{
display:none;
}
.van-cell__title{
flex: none;
width:184rpx;
}
.van-cell__value{
text-align:left;
}
.van-cell__right-icon-wrap{
margin-right: 32rpx;
height: 112rpx;
line-height: 112rpx;
}
}
}
}
.scene-title {
display: flex;
align-items: center;
margin-left: 32rpx;
margin-top: 48rpx;
margin-bottom: 36rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
.tip{
font-size: 22rpx;
color: #6E6E7A;
}
}
.content-product {
.scene {
// margin-top: 32rpx;
// margin-left: 20rpx;
// margin-right: 20rpx;
// margin-bottom: 10rpx;
margin: 32rpx 16rpx 0;
.scene-wrap {
display: flex;
}
.item-wrap {
margin-right: 8rpx;
margin-bottom: 40rpx;
position: relative;
width: 160rpx;
height: 180rpx;
border-radius: 8rpx;
border: 1px solid #f7f8fc;
box-sizing: border-box;
}
.item {
position: relative;
// padding-top: 10px;
width: 160rpx;
height: 180rpx;
background: #f7f8fc;
border-radius: 8rpx;
box-sizing: border-box;
// border: 1px solid #f7f8fc;
}
.open-img {
position: absolute;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
box-sizing: border-box;
}
.act {
// background-image: url("https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/act.png");
// background-size: 100% 100%;
border: 1px solid var(--btnColor);
// box-shadow: 0 2rpx 4rpx 0 rgba(180, 186, 204, 0.4);
background-image: linear-gradient(145deg, #f0f7ff 0%, #ffffff 73%);
box-shadow: 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32),
0 8rpx 20rpx 0 rgba(180, 186, 204, 0.4);
&::after {
position: absolute;
left: 50%;
bottom: -7px;
display: block;
content: "";
width: 6px;
height: 6px;
border-bottom: 1px solid var(--btnColor);
border-right: 1px solid var(--btnColor);
transform: rotate(45deg) translateX(-50%);
background-color: #fff;
}
// .open-img{
// display: none;
// }
.item {
background: transparent;
}
}
.img {
padding-top: 10px;
display: block;
margin: 0 auto 2px;
width: 28px;
height: 28px;
}
.name {
margin-bottom: 2px;
font-weight: 500;
font-size: 12px;
color: #323436;
text-align: center;
}
.msg {
font-weight: 500;
font-size: 18rpx;
// color: #323436;
color: #8A8C90;
text-align: center;
}
}
}
.scene-select{
display: flex;
flex-wrap: wrap;
padding: 0 16rpx 32rpx;
.scene-item{
&:nth-child(3n+3) {
margin-right: 0;
}
position: relative;
margin-right: 10rpx;
margin-bottom: 20rpx;
width: 216rpx;
height: 64rpx;
background: #F5F5FA;
border-radius: 8rpx;
font-size: 28rpx;
color: #323436;
text-align: center;
line-height: 64rpx;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
}
.act{
background: #F0F7FF;
border: 2rpx solid #3E71FE;
border-radius: 8rpx;
font-weight: 500;
color: #3666FE;
.act-img{
display: block;
}
}
.act-img{
display: none;
position:absolute;
top: 0;
right: 0;
width: 30rpx;
height: 22rpx;
}
}
}
.btn {
position: fixed;
bottom: 60rpx;
left: 50%;
transform: translateX(-50%);
// margin: 64rpx auto 0;
width: 648rpx;
font-weight: 500;
font-size: 17px;
color: #ffffff;
background: var(--btnColor);
}
}
.list-sheet-wrap{
max-height: 60vh;
overflow-y: auto;
}
<!-- pages/apply/apply.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请合作产品
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/apply-prod.png" />
<view class="content-wrap">
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">申请合作</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">
您的产品名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" model:value="{{prodName}}" maxlength="{{10}}" placeholder="请输入产品名称" />
</view>
<view class="inp-wrap">
<!-- <view class="title" hover-class="none" hover-stop-propagation="false">
合作门店
<text class="point">*</text>
</view> -->
<!-- <input class="inp" placeholder-class="inp-placeholder" model:value="{{cooperativeStore}}" maxlength="{{30}}" placeholder="营业执照上的公司名称" /> -->
<view class="out-van-cell">
<van-cell custom-class="inp-van-cell" value="{{selectStoreValue}}" is-link bind:click="selectStore">
<view slot="title">
<view class="van-cell-text">
合作门店
<text class="point">*</text>
</view>
</view>
</van-cell>
</view>
</view>
</view>
</view>
<button class="btn" bindtap="applyFn">申请合作产品</button>
</view>
<view>
<van-action-sheet show="{{ storeShow }}" cancel-text="取消" actions="{{ actions }}" list-class="list-sheet-wrap" bind:cancel="onStoreClose" bind:close="onStoreClose" bind:select="onStoreSelect" />
</view>
\ No newline at end of file
//查询是否选中
function hasProdAct(prod,selectProdArr) {
// console.log('prod: ', JSON.stringify(prod));
// console.log('selectProdArr: ', JSON.stringify(selectProdArr));
if(!selectProdArr || selectProdArr.length === 0) return
console.log('selectProdArr: ', selectProdArr);
var resIndex = -1
for(var i = 0;i<selectProdArr.length;i++){
if(selectProdArr[i].productName == prod.productName){
resIndex = i
}
}
if(resIndex == -1){
return false
}
return true;
}
// 导出对外暴露的属性
module.exports = {
hasProdAct: hasProdAct
}
\ No newline at end of file
/* pages/mineDetail/messageBox/components/messageBox.wxss */
.msgBox {
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #fff;
// width: 100%;
border-radius: 8rpx;
padding: 20rpx;
margin-bottom: 20rpx;
// height: 200rpx;
.title {
// display: flex;
// flex-wrap: wrap;
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
margin-bottom: 8rpx;
view {
// word-break: break-all;
display: inline-block;
white-space: pre-wrap
}
.name {
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
// font-face: PingFangSC;
font-weight: 600;
}
}
.time {
font-size: 24rpx;
color: #8A8C90;
text-align: right;
}
/* pages/mineDetail/messageBox/components/messageBox.wxss */
.msgBox {
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #fff;
// width: 100%;
border-radius: 8rpx;
padding: 20rpx;
margin-bottom: 20rpx;
// height: 200rpx;
.title {
// display: flex;
// flex-wrap: wrap;
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
margin-bottom: 8rpx;
view {
// word-break: break-all;
display: inline-block;
white-space: pre-wrap
}
.name {
color: rgba(50, 52, 54, 1);
font-size: 28rpx;
// font-face: PingFangSC;
font-weight: 600;
}
}
.time {
font-size: 24rpx;
color: #8A8C90;
text-align: right;
}
}
\ No newline at end of file
<!-- pages/mineDetail/messageBox/components/messageBox.wxml -->
<!-- <view>pages/mineDetail/messageBox/components/messageBox.wxml</view> -->
<view class="msgBox">
<view class="title">
<text>{{titleObj[messageType]['label']}}</text>
<text class="name">{{merchantName}}</text>
<text>{{titleObj[messageType]['sceneLabel']}}</text>
</view>
<!-- <view class="title" wx:if="{{messageType == 1}}">
<view class="title">
<text>{{titleObj[messageType]['label']}}</text>
<text class="name">{{merchantName}}</text>
<text>{{titleObj[messageType]['sceneLabel']}}</text>
</view>
<!-- <view class="title" wx:if="{{messageType == 1}}">
<text>您好,您的客户</text>
<text class="name">{{merchantName}}</text>
<text>门店活动已开通,活动信息如下:</text>
......@@ -26,7 +26,16 @@
<text class="name">{{merchantName}}</text>
<text>门店场景已开通,待开展业务,信息如下:</text>
</view> -->
<slot/>
<view class="time">{{time}}</view>
<slot />
<view class="time">{{filter.timeformat(time)}}</view>
</view>
<wxs module="filter">
module.exports = {
timeformat: function (time) {
time = time.slice(0,-3)
return time
}
}
</wxs>
\ No newline at end of file
......@@ -2,7 +2,7 @@
import mineApi from '~/api/mineApi/index'
// import USERAPI from '~/api/usersApi/index'
import { IMG_URL } from '~/utils/constantData'
console.log(IMG_URL)
const listObj = Object.freeze([
{
key: 'merchantId',
......@@ -10,6 +10,11 @@ const listObj = Object.freeze([
editLabel: '商户号'
},
{
key: 'actualAccountName',
label: '商户账号:',
editLabel: '商户账号'
},
{
key: 'merchantName',
label: '门店名称:',
placeholder: '请输入您的客户门店简称',
......@@ -78,6 +83,11 @@ Component({
customerList: [{}],
listObj,
isSuper: false,
testData: [
{
a: 1
}
],
bgUrl: `${IMG_URL}/output/empty.png`
},
attached() {
......@@ -93,14 +103,14 @@ Component({
*/
methods: {
restPageNum() {
console.log('restPageNum')
// console.log('restPageNum')
this.setData({
pageNum: 1
})
this.getMerchantCustomInfoList()
this.getMerchantCustomInfoList('reset')
},
scrollonReachBottom() {
console.log('scrollonReachBottom')
// console.log('scrollonReachBottom')
let { pages, pageNum } = this.data
// 判断当前页是否是末页
if (pages == pageNum) return wx.$api.showToast('列表已到底')
......@@ -111,7 +121,7 @@ Component({
this.getMerchantCustomInfoList()
},
// 分页查询客户列表
getMerchantCustomInfoList() {
getMerchantCustomInfoList(type) {
wx.$api.showLoading('加载中...')
let { pageNum, pageSize, customerList } = this.data
let params = {
......@@ -123,10 +133,15 @@ Component({
.then(result => {
console.log(result)
let { pages, list, total } = result
console.log(list)
list = list.map(item => {
item.merchantName = item.merchantName || item.actualMerchantName
item.phone = item.phone || item.actualPhone
// || item.actualContactName
item.contactName = item.contactName || item.actualContactName
return item
})
console.log(list)
this.setData({
customerList: pageNum == 1 ? list : [...customerList, ...list],
triggered: false,
......@@ -135,7 +150,14 @@ Component({
})
.catch(err => {})
.finally(() => {
wx.$api.hideLoading()
if (type == 'reset') {
wx.$api.showToast({
title: '刷新成功',
icon: 'success'
})
} else {
wx.$api.hideLoading()
}
})
},
submit(data) {
......@@ -149,11 +171,12 @@ Component({
mineApi
.saveMerchantCustomInfo(objList)
.then(result => {
console.log(result)
this.setData({
pageNum: 1
})
this.getMerchantCustomInfoList()
wx.$api.showToast('更新成功')
// console.log(result)
// this.setData({
// pageNum: 1
// })
// this.getMerchantCustomInfoList()
})
.catch(err => {})
},
......@@ -164,23 +187,21 @@ Component({
// let
let status = customerList[index].isEdit
// console.log(isEdit)
// customerList[index]['isEdit'] = !customerList[index]['isEdit']
if (item.isEdit) {
// 提交客户信息更新
// this.checkout(customerList[index])
// console.log('customerList[index]', customerList[index])
// let {} =
!isSuper && this.submit(customerList[index])
} else {
customerList[index]['isEdit'] = true
this.setData({
customerList
})
}
console.log(index)
// let indexEdit = console.log(!status)
this.setData({
[`customerList[${index}].isEdit`]: !status
})
},
input(e) {
let { index, name } = e.currentTarget.dataset
console.log(index)
console.log(name)
// console.log(index)
// console.log(name)
let { customerList, listObj } = this.data
let { value } = e.detail
// listObj
......
/* pages/mineDetail/customerManagement/customerManagement.wxss */
page {
background-color: #F2F3F7;
}
.customerManagementCon {
width: 100%;
height: 100%;
// width: 100vw;
// height: 100vh;
}
.input {
text-align: left;
font-size: 28rpx;
caret-color: #3666FE;
width: 430rpx;
}
.customerBox {
box-sizing: border-box;
margin: 20rpx 20rpx 0;
padding: 32rpx;
background: #FFFFFF;
border-radius: 8rpx;
.titleCon {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2rpx dashed #CCCED1;
padding-bottom: 20rpx;
.name {
font-size: 28rpx;
color: #323436;
max-width: 90%;
}
.statusBtn {
font-size: 24rpx;
color: #3666FE;
}
}
}
.list {
overflow: scroll;
}
.cellSty {
display: block;
height: 80rpx;
line-height: 80rpx;
}
.placeholder-class {
color: #C3C3C3;
// font-size: 20rpx;
/* pages/mineDetail/customerManagement/customerManagement.wxss */
page {
background-color: #F2F3F7;
}
.customerManagementCon {
width: 100%;
height: 100%;
// width: 100vw;
// height: 100vh;
}
.input {
text-align: left;
font-size: 28rpx;
caret-color: #3666FE;
width: 430rpx;
}
.disabled {
// color: #333;
color: #a6a9ad;
}
.customerBox {
box-sizing: border-box;
margin: 20rpx 20rpx 0;
padding: 32rpx;
background: #FFFFFF;
border-radius: 8rpx;
.titleCon {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2rpx dashed #CCCED1;
padding-bottom: 20rpx;
.name {
font-size: 28rpx;
color: #323436;
max-width: 90%;
}
.statusBtn {
font-size: 24rpx;
color: #3666FE;
}
}
}
.list {
overflow: scroll;
}
.cellSty {
display: block;
height: 80rpx;
line-height: 80rpx;
}
.placeholder-class {
color: #C3C3C3;
// font-size: 20rpx;
}
\ No newline at end of file
......@@ -39,7 +39,7 @@
<!-- type="number" -->
<input
placeholder="{{item.isEdit? childItem['placeholder']:''}}"
class="input"
class="input {{item.isEdit&&(ind == 0|| ind == 1) ? 'disabled':''}}"
placeholder-class="placeholder-class"
maxlength="{{childItem.maxLength}}"
value="{{item[childItem['key']] }}"
......@@ -48,7 +48,7 @@
data-index="{{index}}"
data-name="{{childItem['key']}}"
data-reg="{{childItem['reg']}}"
disabled="{{!item.isEdit || ind == 0 }}"
disabled="{{!item.isEdit || ind == 0|| ind == 1 }}"
always-embed></input>
</gl-cell>
<!-- <gl-cell
......
// pages/mineDetail/messageBox/messageBox.js
import mineApi from '~/api/mineApi/index'
// import { handleCopy } from '~/utils/utils_wx'
let drawQrcode = require('~/utils/lib/weapp-qrcode.js')
import outputApi from '~/api/outputApi/index'
import { deleteSecond } from '~/utils/format'
// import drawQrcode from '~/utils/lib/weapp-qrcode.js'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
......@@ -32,12 +37,13 @@ Component({
list: 'messageList'
}
},
// findKey: '',
warReportList: [],
messageList: [],
serviceMerchantId: ''
},
attached() {
this.ewmChange()
// this.ewmChange()
// this.initTime()
let { userInfo } = wx.$storage.get()
let merchantId = userInfo.subLoginUser.merchantId
......@@ -53,20 +59,20 @@ Component({
*/
methods: {
// 实例化二维码canvas
ewmChange(url) {
let size = {}
size.w = (wx.getSystemInfoSync().windowWidth / 750) * 600
size.h = size.w
var that = this
// ewmChange(url) {
// let size = {}
// size.w = (wx.getSystemInfoSync().windowWidth / 750) * 600
// size.h = size.w
// var that = this
drawQrcode({
width: size.w,
height: size.h,
canvasId: 'myQrcode',
text: url || that.data.text
// v1.0.0+版本支持在二维码上绘制图片
})
},
// drawQrcode({
// width: size.w,
// height: size.h,
// canvasId: 'myQrcode',
// text: url || that.data.text
// // v1.0.0+版本支持在二维码上绘制图片
// })
// },
preView(e) {
let { valueurl } = e.currentTarget.dataset
// console.log(e)
......@@ -81,25 +87,53 @@ Component({
current: valueurl
})
},
downLoad(e) {
showPoster(e) {
const { item } = e.currentTarget.dataset
let updatedTime = deleteSecond(item.createdTime)
this.setData({
// findKey: 'crowdFundActivityId',
posterItem: {
activityName: item.activityName,
posterUrl: item.valueUrl
posterUrl: item.valueUrl,
updatedTime,
// crowdFundActivityId: item.valueUrl,
type: 'warReport'
}
})
},
copyLink(e) {
console.log(e)
let that = this
let { url } = e.currentTarget.dataset
this.ewmChange(url)
setTimeout(() => {
this.share()
}, 100)
async copyLink(e) {
const { item } = e.currentTarget.dataset
// posterObj = this.selectComponent('#poster')
// this.setData({
// findKey: 'activityId'
// })
// try {
// let flag = await posterObj.check(item)
// posterObj.setData({
// poster: flag,
// show: true
// })
// } catch (error) {
wx.$api.showLoading('加载中...')
outputApi
.getPosterUrl({
id: item.crowdFundActivityId
})
.then(res => {
item.posterUrl = res
item.type = 'motherChainPoster'
console.log(item)
this.setData({
posterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
// }
},
share(e) {
// console.log(e)
let that = this
......@@ -138,12 +172,26 @@ Component({
tabBarStyle: height / 2 + statusBarHeight
})
},
refreshList(e) {
// console.log(e)
async refreshList(e) {
console.log(e)
let { type } = this.data
let { typename } = e.currentTarget.dataset
type[typename].pageNum = 1
this.getMessageList(typename)
let res = await this.getMessageList(typename)
let toastObj = {
success: {
title: '刷新成功',
icon: 'success'
},
fail: {
title: '刷新失败',
icon: 'error'
}
}
wx.$api.showToast({
...toastObj[res],
duration: 1000
})
},
scrollonReachBottom(e) {
console.log(e)
......@@ -169,35 +217,40 @@ Component({
},
getMessageList(typeName) {
let that = this
let { serviceMerchantId, type, warReportList, messageList } = this.data
let list = type[typeName]['list']
// console.log('list', this.data[list])
// return
let params = {
serviceMerchantId: serviceMerchantId,
...type[typeName]
}
// console.log(Math.ceil(2.8))
wx.$api.showLoading('加载中...')
mineApi
.messageBoxPage(params)
.then(result => {
console.log(result)
let { count, data, pageSize, pageNum, pages } = result
const listName = `${type[typeName]['list']}`
type[typeName]['pages'] = pages
type[typeName]['pageNum'] = pageNum
console.log(listName)
this.setData({
[listName]: type[typeName].pageNum == 1 ? data : [...this.data[list], ...data],
type,
triggered: false
return new Promise((resolve, reject) => {
let { serviceMerchantId, type, warReportList, messageList } = this.data
let list = type[typeName]['list']
// console.log('list', this.data[list])
// return
let params = {
serviceMerchantId: serviceMerchantId,
...type[typeName]
}
// console.log(Math.ceil(2.8))
wx.$api.showLoading('加载中...')
mineApi
.messageBoxPage(params)
.then(result => {
console.log(result)
let { count, data, pageSize, pageNum, pages } = result
const listName = `${type[typeName]['list']}`
type[typeName]['pages'] = pages
type[typeName]['pageNum'] = pageNum
console.log(listName)
this.setData({
[listName]: type[typeName].pageNum == 1 ? data : [...this.data[list], ...data],
type,
triggered: false
})
resolve('success')
})
})
.catch(err => {})
.finally(() => {
wx.$api.hideLoading()
})
.catch(err => {
reject('fail')
})
.finally(() => {
wx.$api.hideLoading()
})
})
}
}
})
{
"component": true,
"usingComponents": {
"msg-box": "./components/msgBox/msgBox",
"tab": "./components/Tab/Tab"
"msg-box": "../components/msgBox/msgBox",
"tab": "../components/Tab/Tab"
},
"navigationStyle": "custom"
}
......@@ -19,7 +19,7 @@
&::after {
content: '';
width: 100%;
height: 264rpx;
height: 265rpx;
// background: url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/login/bg.webp') no-repeat;
background-color: #fff;
// background-size: 100% 486rpx;
......@@ -31,7 +31,7 @@
.tabContainer {
height: 100rpx;
background-color: #fff;
}
.list {
......
......@@ -14,8 +14,10 @@
index="{{tabIndx}}"
bindclick="changeTabIndx"
class="tabContainer" />
<view hidden="{{tabIndx==1}}" class="scrollCon">
<!-- -->
<view class="scrollCon" hidden="{{tabIndx==1}}">
<scroll-view
wx:if="{{tabBarStyle}}"
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
......@@ -24,30 +26,29 @@
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class=" list"
class="list"
data-typeName="warReport"
refresher-triggered="{{triggered}}">
<!-- -->
<msg-box
wx:for="{{warReportList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
<view class="num">{{item.currentValue||'0.0'}}元</view>
<view class="num font-number">{{item.currentValue||'0.0'}}元</view>
</view>
</view>
<view class="warReportBox" wx:if="{{item.messageType == 3}}">
<view class="item">
<view class="label">总产值</view>
<view class="num">{{item.totalValue}}元</view>
<view class="num font-number">{{item.totalValue}}元</view>
</view>
<view class="item">
<view class="label">完成目标</view>
<view class="num">{{item.completeRate}}</view>
<view class="num font-number">{{item.completeRate}}</view>
</view>
</view>
<view class="warReportLink">
......@@ -57,7 +58,7 @@
wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
data-item="{{item}}"
bind:tap="downLoad">
bind:tap="showPoster">
战报详情
</view>
</view>
......@@ -74,20 +75,19 @@
refresher-threshold="104"
style="height:100%;"
scroll-top="{{scrollTop}}"
class=" list"
class="list"
data-typeName="message"
refresher-triggered="{{triggered}}">
<!-- -->
<msg-box
wx:for="{{messageList}}"
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell">
<view class="label">开始时间:</view>
......@@ -97,33 +97,28 @@
<view class="label">结算时间:</view>
<view class="value">{{item.activityEndTime||'-'}}</view>
</view>
<!-- <view class="cell">
<view class="label">活动链接:</view>
<view
class="link"
wx:if="{{item.activityUrl}}"
bind:tap="copyLink"
data-url="{{item.activityUrl}}">
下载海报
</view>
</view> -->
<view class="cell" wx:if="{{item.crowdFundActivityId}}">
<view class="label">母链海报:</view>
<view class="link" bind:tap="copyLink" data-item="{{item}}">下载母链海报分享给门店开展活动</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
</msg-box>
</scroll-view>
</view>
</view>
<crowdfund-poster item="{{posterItem}}" />
<!-- findKey="{{findKey}}" -->
<crowdfund-poster id="poster" item="{{posterItem}}" />
<canvas class="erweimaCanvas" style="width: 600rpx; height: 600rpx;" canvas-id="myQrcode" />
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import wxqrcode from '~/utils/lib/wxqrcode'
import { IMG_URL } from '~/utils/constantData'
import { deleteSecond } from '~/utils/format'
import outputApi from '~/api/outputApi/index'
const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp`
......@@ -30,6 +31,7 @@ Component({
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
isShowPoster: false,
orderFormList: [
{
label: '总场次',
......@@ -47,30 +49,37 @@ Component({
],
merchantFormList: [
{
label: '活动时间',
label: '预计活动时间',
name: 'time'
},
{
label: '实际活动时间',
name: 'realTime'
},
{
label: '订单数',
name: 'orderCount'
name: 'orderCount',
className: 'font-number'
},
{
label: '产值',
name: 'realAmount',
className: 'red',
prefix: '¥'
className: 'red font-number',
prefix: '¥',
isNumber: true
},
{
label: '预估产值',
name: 'predictAmount',
prefix: '¥'
className: 'font-number',
prefix: '¥',
isNumber: true
}
],
tableHeadList: [
{
label: '',
width: '',
width: '28rpx'
label: 'rankIdx',
width: '40rpx'
},
{
label: '业务员',
......@@ -105,8 +114,8 @@ Component({
var list = this.data.orderObj
list &&
list.activityList?.forEach(item => {
// 0-未开始;1-活动中;2-已结束
let sliceNum = item.actStatus == 2 ? 3 : 10
// 1-未开始;2-活动中;3-已结束
let sliceNum = item.activityStatus == 3 ? 3 : 10
item.showStaffList = item.staffList.length > sliceNum ? item.staffList.slice(0, sliceNum) : item.staffList
item.staffList = item.staffList.length > sliceNum ? item.staffList.slice(sliceNum) : []
})
......@@ -163,16 +172,121 @@ Component({
// const { item } = e.currentTarget.dataset
// wx.$router.jumpH5(item.activityUrl)
},
download(e) {
async download(e) {
const { item } = e.currentTarget.dataset
// posterObj = this.selectComponent('#crowdPoster'),
// { options } = wx.$router.getPageInstance()
// const { options } = wx.$router.getPageInstance()
// console.log(options)
// try {
// let flag = await posterObj.check(item)
// posterObj.setData({
// poster: flag,
// show: true
// })
// } catch (error) {
wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({ id: item.activityId }).then(res => {
item.posterUrl = res
this.setData({
posterItem: item,
isShowTip: false
outputApi
.getPosterUrl({
id: item.activityId
})
.then(res => {
item.posterUrl = res
this.setData({
crowdPosterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
// }
},
/**长按海报 */
async longtouch(e) {
console.log('长按海报', e)
let { activityId } = e.detail
const res = await outputApi.reportPosterTrack({
activityId
})
this.triggerEvent('posterTrack')
},
/**长按战报/喜报 */
async handlePosterTouch(e) {},
/**战报 */
handleReport(e) {
const { item, idx } = e.currentTarget.dataset
wx.$api.showLoading('战报生成中')
outputApi
.getNewReportUrl({ activityId: item.activityId })
.then(res => {
// console.log(res)
if (!res.url) {
wx.$api.showToast('战报生成失败')
return true
}
var posterItem = {
...item,
posterUrl: res.url,
updatedTime: deleteSecond(res.updatedDate),
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
})
},
/**喜报 */
handleXiReport(e) {
const { item } = e.currentTarget.dataset
wx.$api.showLoading('喜报生成中')
outputApi
.getNewGoodUrl({ activityId: item.activityId })
.then(res => {
if (!res.goodUrl) {
wx.$api.showToast('暂无喜报')
return true
}
var posterItem = {
...item,
posterUrl: res.goodUrl,
updatedTime: res.goodReportDate ? deleteSecond(res.goodReportDate) : '',
type: 'warReport'
}
this.setData({
crowdPosterItem: posterItem
})
wx.$api.hideLoading()
})
.catch(() => {
wx.$api.showToast('下载喜报失败')
})
.finally(() => {
// wx.$api.hideLoading()
})
// var posterItem = {
// ...item,
// posterUrl: item.goodUrl,
// // date: item.goodReportDate,
// updatedTime: deleteSecond(item.goodReportDate),
// type: 'warReport'
// }
// this.setData({
// // posterItem: posterItem,
// // isShowPoster: true,
// crowdPosterItem: posterItem,
// isShowTip: false
// })
}
}
})
/* packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxss */
.crowdfund-layout {
margin: 20rpx 20rpx;
padding-bottom: 136rpx;
.box {
background-color: #FFFFFF;
......@@ -30,7 +31,8 @@
height: 40rpx;
line-height: 40rpx;
margin-bottom: 14rpx;
font-weight: 600;
// font-weight: 600;
// font-family: 'number';
}
&-label {
......@@ -114,7 +116,7 @@
}
&-label {
width: 104rpx;
width: 156rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
......@@ -132,47 +134,173 @@
background: #F7F8FC;
border-radius: 20rpx;
margin-top: 16rpx;
padding: 0 12rpx;
.rank-head {
.rank-title {
position: relative;
height: 52rpx;
line-height: 52rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
font-size: 20rpx;
font-size: 26rpx;
color: #5A6066;
margin-bottom: 20rpx;
font-weight: 600;
border-bottom: 1rpx solid rgba(204, 206, 209, 0.50);
.activity-status {
position: absolute;
top: 0;
right: 22rpx;
font-size: 24rpx;
}
// .activity-status {
// position: absolute;
// top: 0;
// right: 22rpx;
// font-size: 24rpx;
// }
}
.rank-table {
color: #5A6066;
font-size: 20rpx;
padding-left: 20rpx;
.tr {
.rank {
display: flex;
height: 32rpx;
line-height: 32rpx;
padding-bottom: 16rpx;
justify-content: space-between;
height: 64rpx;
padding: 20rpx 16rpx;
border-bottom: 1rpx dotted rgba(204, 206, 209, 0.50);
.th,
.td {
width: calc((100% - 116rpx) / 4);
.rank-left {
display: flex;
}
.icon-rank {
width: 24rpx;
height: 24rpx;
vertical-align: middle;
padding-right: 4rpx;
&-num {
width: 40rpx;
line-height: 64rpx;
text-align: center;
}
.rank-head {
position: relative;
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
.icon-wechat {
position: absolute;
bottom: -4rpx;
right: -4rpx;
width: 40rpx;
height: 40rpx;
}
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.rank-content {
font-size: 20rpx;
.rank-row {
position: relative;
display: flex;
height: 32rpx;
line-height: 32rpx;
margin-bottom: 8rpx;
.down-tips {
position: absolute;
left: -116rpx;
top: -60rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.60);
padding: 0 16rpx;
border-radius: 12rpx;
font-weight: 500;
&::after {
display: inline-block;
content: '';
position: absolute;
bottom: -27rpx;
right: 67rpx;
width: 0;
height: 0;
border: 18rpx solid;
border-color: #686868 transparent transparent;
}
}
.rank-row-name {
max-width: 200rpx;
font-size: 24rpx;
color: #3666FE;
margin-right: 12rpx;
}
.name-disabled {
max-width: 200rpx;
font-size: 24rpx;
color: #5A6066;
margin-right: 12rpx;
}
&-dept {
color: #8A8C90;
}
&-txt {
color: rgba(90, 96, 102, 1);
padding: 0 10rpx 0 0;
}
&-txt::after {
display: inline-block;
content: '';
background-color: #CCCED1;
width: 1.2rpx;
height: 54%;
margin-left: 10rpx;
}
&-txt:last-child::after {
background-color: transparent;
}
}
.rank-row:last-child {
margin-bottom: 0;
}
}
.rank-price {
text-align: right;
font-size: 26rpx;
color: #8A8C90;
height: 64rpx;
line-height: 64rpx;
}
.txt-red {
color: #F35251;
}
// .th,
// .td {
// width: calc((100% - 116rpx) / 4);
// .icon-rank {
// width: 24rpx;
// height: 24rpx;
// vertical-align: middle;
// padding-right: 4rpx;
// }
// }
}
.rank:last-child {
border: none;
}
.tr-no-data {
......@@ -185,11 +313,16 @@
.btn-more {
height: 56rpx;
line-height: 56rpx;
color: #5A6066;
border: 2rpx solid #EEEEEE;
border-radius: 28rpx;
// color: #5A6066;
// border: 2rpx solid #EEEEEE;
// border-radius: 28rpx;
text-align: center;
margin: 0 20rpx 16rpx;
margin: 0 20rpx;
.icon-more {
width: 92rpx;
height: 36rpx;
}
}
}
}
......@@ -240,6 +373,36 @@
}
}
}
// 战报
.new-report {
display: flex;
margin-top: 20rpx;
height: 52rpx;
line-height: 52rpx;
font-size: 20rpx;
color: #5A6066;
.report-left {
box-sizing: border-box;
display: flex;
font-size: 20rpx;
color: #3666FE;
padding: 0 20rpx;
height: 100%;
background: rgba(54, 102, 254, 0.06);
border: 2rpx solid rgba(62,113,254,0.70);
border-radius: 30rpx;
margin-right: 4rpx;
.icon-report {
width: 32rpx;
height: 32rpx;
vertical-align: middle;
margin-top: -2rpx;
}
}
}
}
}
}
......@@ -247,4 +410,8 @@
.downloadIcon {
width: 40rpx;
height: 40rpx;
}
\ No newline at end of file
}
// .totalAmount{
// font-family: 'number';
// }
\ No newline at end of file
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="crowdfund-layout">
<view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view>
<view class="order-label">{{item.label}}</view>
</view>
</view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}}
</view>
<view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报
</view>
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view>
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
</view>
</view>
<!-- 排名 -->
<view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view>
<view class="rank-table">
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="rank">
<view class="rank-left">
<view class="rank-num">{{idx + 1}}</view>
<view class="rank-head">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<glsx-image wx:else src="output/icon-head.webp" />
</view>
<view class="rank-content">
<view class="rank-row">
<!-- <text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text> -->
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name text-hide">{{subItem.shareName}}</text>
<text wx:else class="name-disabled text-hide">{{subItem.shareName}}</text>
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
</view>
<view class="rank-row">
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view>
</view>
</view>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
</view>
<view wx:else class="rank-price">暂无业绩</view>
</view>
</view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}">
<glsx-image class="icon-more" src="output/icon-more.webp" />
</view>
</view>
</view>
<!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
<view class="suggest-block">
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view>
</view>
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}">生成最新战报</view>
<view class="report-left" bindtap="handleXiReport" data-item="{{item}}" data-idx="{{index}}">生成最新喜报</view>
</view>
</view>
</view>
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<!-- <poster
posterItem="{{posterItem}}"
id="poster"
show="{{isShowPoster}}"
bindlongtouch="handlePosterTouch" /> -->
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
// packagesList/packageOutput/components/poster/poster.js
Component({
/**
* 组件的属性列表
*/
properties: {
posterItem: {
type: Object,
value: {}
},
show: {
type: Boolean,
value: false
},
scrollImg: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
hide() {
this.setData({
show: false,
poster: ''
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packagesList/packageOutput/components/poster/poster.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);
}
.bg-white {
padding: 32rpx 32rpx 0 32rpx;
background-color: #FFFFFF;
}
.poster {
width: 500rpx;
height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
}
.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;
}
}
}
\ No newline at end of file
<!--packagesList/packageOutput/components/poster/poster.wxml-->
<block wx:if="{{show}}">
<!-- catchtouchmove="noScroll" -->
<view class="layout">
<view class="bg" bindtap="hide" />
<block wx:if="{{scrollImg}}">
<view class="poster">
<!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
<image src="{{posterItem.posterUrl}}" mode="widthFix" show-menu-by-longpress />
<!-- </scroll-view> -->
</view>
</block>
<block wx:else>
<image src="{{posterItem.posterUrl}}" class="poster" mode="widthFix" show-menu-by-longpress bindlongpress="longpress" />
</block>
<view class="btn">
<glsx-image src="output/longtap.png" class="icon"></glsx-image>
长按图片转发
</view>
<view class="tips">最近更新时间:{{posterItem.date}} </view>
</view>
</block>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
/**设置千分位 */
var setPrice = function (n = 0.0) {
if ((typeof n == 'string' || typeof n == 'number') && !isNaN(n)) {
n = parseFloat(n).toFixed(2)
var r = getRegExp('(d{1,3})(?=(d{3})+(?:.))', 'g')
var p = n.replace(r, ',')
return p
// var r = getRegExp('/./', 'g')
// var p = n.replace(r, 'test')
// return n
} else {
console.log(n, '不是一个数字', !isNaN(n))
}
}
var threeNumForTwo = {
money_three_for_two_thousands: function (num) {
//num = parseInt(num);
// return num
var num = num + ''
var d = ''
if (num.slice(0, 1) == '-') {
d = num.slice(0, 1)
num = num.slice(1)
}
var len = num.length
var index = num.indexOf('.')
if (index == -1) {
num = num + '.00'
} else if (index + 2 == len) {
num = num + '0'
}
var index = num.indexOf('.') // 字符出现的位置
var num2 = num.slice(-3)
num = num.slice(0, index)
var result = ''
while (num.length > 3) {
result = ',' + num.slice(-3) + result
num = num.slice(0, num.length - 3)
}
if (num) {
result = num + result
}
// return result
return d + (result + num2)
}
}
/*
* 导出
*/
module.exports = {
setPrice: setPrice,
money_three_for_two_thousands: threeNumForTwo.money_three_for_two_thousands //暴露接口调用
}
......@@ -36,7 +36,6 @@ Page({
outputApi.getSceneProStatus(params).then(res => {
var proList = res.find(item => item.sceneCode == sceneCode)
this.setData({
// ['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList.filter(item => item.openFlag == 0)
['sceneActivityObj.scene' + this.data.sceneActive]: proList.productList
})
this.setCurActivity()
......@@ -79,7 +78,10 @@ Page({
// wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
page.getClueInit && page.getClueInit()
let node = page.selectComponent('#indexclue')
// console.log(node)
node.getClueInit && node.getClueInit()
// page.getClueInit && page.getClueInit()
})
}, 1000)
},
......@@ -102,7 +104,7 @@ Page({
wx.showToast({
title: '提交成功',
icon: 'success',
duration: 3000,
duration: 2000,
mask: true,
success: () => {
this.handleJump()
......@@ -129,8 +131,11 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
onReady() {
wx.setNavigationBarTitle({
title: '开通店面业务',
})
},
/**
* 生命周期函数--监听页面显示
*/
......
......@@ -65,6 +65,7 @@ page {
flex-wrap: wrap;
.activity-item {
position: relative;
box-sizing: border-box;
width: calc((100% - 40rpx) / 3);
height: 64rpx;
......@@ -74,6 +75,14 @@ page {
font-size: 28rpx;
margin: 0 20rpx 16rpx 0;
border-radius: 4rpx;
.icon-mark {
position: absolute;
top: 0;
right: 0;
width: 60rpx;
height: 60rpx;
}
}
.activity-item:nth-child(3n) {
......
......@@ -17,6 +17,11 @@
<view class="box-title">产品/活动<text class="title-tip">(可多选)</text></view>
<view class="activity-box" wx:if="{{sceneActive != 1}}">
<view wx:for="{{activityList}}" wx:key="index" class="activity-item">
<!-- productStatus:0未申请;1申请中;2已开通;3:已结束 -->
<view wx:if="{{item.openFlag != 0 && item.productStatus == 2}}">
<glsx-image wx:if="{{sceneActive == 4}}" src="output/mark-active.webp" class="icon-mark"></glsx-image>
<glsx-image wx:if="{{sceneActive == 2 || sceneActive == 3}}" src="output/mark-open.webp" class="icon-mark"></glsx-image>
</view>
<view wx:if="{{item.openFlag == 0}}" class="text-hide {{ item.checked ? 'active' : '' }}" bindtap="handleActClick" data-idx="{{index}}">{{item.productName}}</view>
<view class="text-hide item-disabled" wx:else>{{item.productName}}</view>
</view>
......
{
"enablePullDownRefresh": true,
"usingComponents": {
"scene-box": "../../../components/SceneBox/SceneBox",
"output-transform": "./components/outputTransform/outputTransform",
"output-crowdfund": "./components/outputCrowdfund/outputCrowdfund"
"output-transform": "../components//outputTransform/outputTransform",
"output-crowdfund": "../components/outputCrowdfund/outputCrowdfund"
}
}
\ No newline at end of file
}
......@@ -38,6 +38,18 @@
border-bottom: 1rpx dashed #CCCED1;
}
.title-open {
float: right;
font-size: 28rpx;
color: #3666FE;
font-weight: 400;
}
.icon-open {
width: 38rpx;
height: 38rpx;
}
.scene-box {
padding: 27rpx 0 24rpx;
}
......@@ -80,11 +92,21 @@
}
.activity-item.active {
background: #3666FE;
// background: #3666FE;
box-shadow: 0 8rpx 20rpx 0 rgba(180, 186, 204, 0.40), 0 4rpx 8rpx 0 rgba(180, 186, 204, 0.32);
color: #FFFFFF;
// color: #FFFFFF;
border-width: 0;
}
.activity-item.open.active {
background: #3666FE;
color: #FFFFFF;
}
.activity-item.no-open.active {
background: #CCCED1;
color: #323436;
}
}
.activity-content {
......@@ -129,17 +151,27 @@
}
}
.btn {
.btn-box {
position: fixed;
bottom: 16rpx;
bottom: 0;
left: 0;
width: 100%;
height: 116rpx;
background-color: #FFFFFF;
}
.btn-box.shadow {
box-shadow: 0 -2rpx 2rpx 0 rgba(0, 0, 0, 0.08);
}
.btn {
width: calc(100% - 64rpx);
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 28rpx;
color: #FFFFFF;
margin: 0 32rpx;
margin: 14rpx 32rpx;
.btn-blue {
background: #3666FE;
......@@ -150,6 +182,34 @@
background: #CCCED1;
border-radius: 8rpx;
}
.btn-share {
background: #3666FE;
border-radius: 12rpx;
// animation: xing ease-in-out 2s infinite;
}
}
}
@keyframes xing {
0% {
transform: scale(0.85);
}
25% {
transform: scale(1);
}
50% {
transform: scale(0.85);
}
75% {
transform: scale(1);
}
100% {
transform: scale(0.85);
}
}
......
<!-- packageOutput/pages/summary/summary.wxml -->
<view class="summary">
<view class="layout {{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? 'm-rl-20' : ''}}">
<view class="title bg-white ">选产品/活动</view>
<view class="scene-box bg-white">
<scene-box
formData="{{sceneObj}}"
scenePriceList="{{scenePriceList}}"
sceneActive="{{sceneActive}}"
bindhandleSceneChange="handleSceneChange" />
</view>
</view>
</view>
<!-- 活动 -->
<view class="p-rl-20 bg-white">
<scroll-view
scroll-x="{{true}}"
enable-flex
class="activity-box"
scroll-with-animation
scroll-left="{{scrollLeft}}">
<view class="flex">
<view
class="activity-item {{ activityActive == index ? 'active' : ''}} {{item.productStatus == 2 ? 'open' : 'no-open'}}"
wx:for="{{activityList}}"
wx:key="index"
bindtap="handleActChange"
data-idx="{{index}}">
{{item.productName}}
</view>
</view>
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content {{ (sceneActive != 1 && activityList[activityActive].productStatus == 2) ? '' : 'p-rl-20'}}">
<view wx:if="{{activityList[activityActive].productStatus == 2 && sceneActive != 1}}">
<view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
<view wx:if="{{sceneActive == 2 || sceneActive == 3}}" class="select-txt">
{{baseData.timeList[sceneActive == 2 ? searchForm.scene2Idx : searchForm.scene3Idx]}}
</view>
<view wx:if="{{sceneActive == 4}}" class="select-txt">
{{baseData.actStatusList[searchForm.scene4Idx]}}
</view>
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" />
</view>
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
</view>
</view>
</view>
<view wx:if="{{sceneActive != 1}}">
<view class="isFullSucreen btn" wx:if="{{ activityList[activityActive].productStatus != 2 && !merchantInfo.isSuper}}">
<view class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
</view>
<view class="isFullSucreen btn" wx:if="{{sceneActive == 1}}">
<view class="btn-disabled">点击开通</view>
</view>
<view class="layout {{ (sceneActive != 1 && isShowData) ? 'bg-grey' : 'bg-white'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'bg-white' : 'p-rl-20'}}">
<view class="{{ (sceneActive != 1 && isShowData) ? 'm-rl-20' : ''}}">
<view class="title bg-white">
选产品/活动
<view class="title-open" bindtap="handleJump">
<glsx-image class="icon-open" :webp="{{true}}" src="output/icon-open.webp"></glsx-image>
开通活动
</view>
</view>
<view class="scene-box bg-white">
<scene-box formData="{{sceneObj}}" scenePriceList="{{scenePriceList}}" sceneActive="{{sceneActive}}" bindhandleSceneChange="handleSceneChange" />
</view>
</view>
</view>
<!-- 活动 -->
<view class="p-rl-20 bg-white">
<scroll-view scroll-x="{{true}}" enable-flex class="activity-box" scroll-with-animation scroll-left="{{scrollLeft}}">
<view class="flex">
<view class="activity-item {{ activityActive == index ? 'active' : ''}} {{(item.productStatus == 2 || item.productStatus == 3) ? 'open' : 'no-open'}}" wx:for="{{activityList}}" wx:key="index" bindtap="handleActChange" data-idx="{{index}}">
{{item.productName}}
</view>
</view>
</scroll-view>
</view>
<!-- 活动内容 -->
<view class="activity-content {{ (sceneActive != 1 && isShowData) ? '' : 'p-rl-20'}}">
<view wx:if="{{isShowData && sceneActive != 1}}">
<view class="activity-title title bg-white p-l-20 no-border">
<view>看产值</view>
<view class="select" bindtap="handleSearch">
<view wx:if="{{sceneActive == 2 || sceneActive == 3}}" class="select-txt">
{{baseData.timeList[sceneActive == 2 ? searchForm.scene2Idx : searchForm.scene3Idx]}}
</view>
<view wx:if="{{sceneActive == 4}}" class="select-txt">
{{baseData.actStatusList[searchForm.scene4Idx]}}
</view>
<image class="icon-arrow" src="{{IMGURL}}output/arrow.png?v={{img_version}}" />
</view>
</view>
<output-transform wx:if="{{sceneActive == 2 || sceneActive == 3}}" formData="{{activityList[activityActive].orderTotal}}" />
<output-crowdfund wx:if="{{sceneActive == 4}}" orderObj="{{activityList[activityActive].outputData}}" bind:handleZhanReport="handleZhanReport" bind:posterTrack="posterTrack"/>
</view>
<view wx:else class="content-empty bg-white">
<image class="img-empty" src="{{IMGURL}}output/sum-empty.png?v={{img_version}}" />
</view>
</view>
</view>
<view wx:if="{{sceneActive != 1 && activityList.length}}">
<view class="isFullSucreen btn-box" wx:if="{{ !isShowData && !merchantInfo.isSuper}}">
<view class="btn">
<view class="btn-blue" bindtap="handleJump">点击开通</view>
</view>
</view>
</view>
<view wx:if="{{sceneActive == 1}}" class="isFullSucreen btn-box">
<view class="btn">
<view class="btn-disabled">点击开通</view>
</view>
</view>
<view wx:if="{{sceneActive == 4 && activityList.length && isShowData && activityList[activityActive].outputData.shareBtnIdx && activityList[activityActive].outputData.shareBtnIdx != -1}}" class="isFullSucreen btn-box shadow" bindtap="handleBtnShare">
<view class="btn">
<view class="btn-share">活动进行中,分享母链海报开展活动</view>
</view>
</view>
</view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{true}}" bindlongtouch="longtouch" />
\ No newline at end of file
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!