Commit 12f9acd3 by 张立顺

样式修改

1 parent 9c39825b
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
})
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import wxqrcode from '~/utils/lib/wxqrcode'
import {
IMG_URL
} from '~/utils/constantData'
import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index'
const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp`
......@@ -32,7 +30,8 @@ Component({
IMGURL: IMG_URL,
IMAGES,
isShowTip: true,
orderFormList: [{
orderFormList: [
{
label: '总场次',
name: 'totalNum'
},
......@@ -46,7 +45,8 @@ Component({
prefix: '¥'
}
],
merchantFormList: [{
merchantFormList: [
{
label: '活动时间',
name: 'time'
},
......@@ -66,7 +66,8 @@ Component({
prefix: '¥'
}
],
tableHeadList: [{
tableHeadList: [
{
label: '',
width: '',
width: '28rpx'
......@@ -75,12 +76,12 @@ Component({
label: '业务员',
name: 'shareName'
},
// {
// label: '转发',
// name: 'shareCount'
// },
{
label: '转发',
name: 'shareCount'
},
{
label: '浏览',
label: '访客',
name: 'browseCount'
},
{
......@@ -114,9 +115,7 @@ Component({
})
},
handleMore(e) {
var {
idx
} = e.currentTarget.dataset
var { idx } = e.currentTarget.dataset
var list = this.data.orderObj
var item = list.activityList[idx]
list.activityList[idx].showStaffList = list.activityList[idx].showStaffList.concat(item.staffList.length > 10 ? item.staffList.slice(0, 10) : item.staffList)
......@@ -126,9 +125,7 @@ Component({
})
},
handleCopy(e) {
var {
idx
} = e.currentTarget.dataset
var { idx } = e.currentTarget.dataset
var currentItem = this.data.orderObj.activityList[idx]
var qr = wxqrcode.createQrCodeImg(currentItem.activityUrl)
const base64src = function (base64data) {
......@@ -167,9 +164,7 @@ Component({
// wx.$router.jumpH5(item.activityUrl)
},
async download(e) {
const {
item
} = e.currentTarget.dataset,
const { item } = e.currentTarget.dataset,
posterObj = this.selectComponent('#poster')
try {
let flag = await posterObj.check(item)
......@@ -179,18 +174,21 @@ Component({
})
} 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({
posterItem: item,
isShowTip: false
})
})
.catch(() => {
wx.$api.showToast('下载海报失败')
})
}).catch(()=>{
wx.$api.showToast('下载海报失败')
})
}
}
}
})
\ No newline at end of file
})
......@@ -18,7 +18,8 @@
align-items: center;
&-block {
width: 33.3%;
// width: 33.3%;
width: 50%;
text-align: center;
font-weight: 500;
font-size: 26rpx;
......
<!-- pages/tab/output/components/sceneBox/sceneBox.wxml -->
<wxs src="../../index.wxs" module="filter" />
<view class="flex scene">
<view
class="scene-item {{ formData['scene' + (index + 1)] ? 'open' : ''}} {{ (sceneActive != -1 && sceneActive == index + 1) ? 'active' : ''}}"
......@@ -14,7 +15,9 @@
<view class="scene-title {{formData['showList'][index]?'':'notOpened'}}">{{item.title}}</view>
<view>{{item.subTitle}}</view>
<!-- wx:if="{{scenePriceList.length}}" -->
<view class="total-price">¥ {{formData['showList'][index].totalMoney||0}}</view>
<view class="total-price">
¥ {{filter.money_three_for_two_thousands(formData['showList'][index].totalMoney||0)}}
</view>
</view>
</view>
.swiper {
/* test */
color: aquamarine;
}
\ No newline at end of file
// pages/tab/output/components/merchant/mrechant.js
import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData'
import { setPrice } from '~/utils/format'
import { getNowMonth } from '~/utils/format'
const IMAGES = {
arrow: `${IMG_URL}/output/arrow.png`,
......@@ -8,7 +9,10 @@ const IMAGES = {
money: `${IMG_URL}/output/money.png`,
paper: `${IMG_URL}/output/paper.png`,
link: `${IMG_URL}/output/link.webp`,
empty: `${IMG_URL}/output/empty.png`
empty: `${IMG_URL}/output/empty.png`,
funnelNew: `${IMG_URL}/output/funnelNew.webp`,
funnelNewSm: `${IMG_URL}/output/funnelNewSm.webp`,
totalIcon: `${IMG_URL}/output/totalIcon.webp`
}
Component({
/**
......@@ -47,15 +51,15 @@ Component({
funnelList: {
start: [
{ label: '到店量', key: 'toShopCount' },
{ label: '核销数', key: 'couponUsedCount' },
// { label: '核销数', key: 'couponUsedCount' },
{ label: '体验数', key: 'experienceCount' },
{ label: '订单成交', key: 'upgradeCount' }
{ label: '成交量', key: 'upgradeCount' }
],
end: [
{ label: '转发量', key: 'shareCount' },
// { label: '转发量', key: 'shareCount' },
{ label: '访客数', key: 'visitCount' },
{ label: '成交数', key: 'dealCount' },
{ label: '产值', key: 'totalMoney' }
{ label: '成交数', key: 'dealCount' }
// { label: '产值', key: 'totalMoney' }
]
}
// showNothingSceneCon: false
......@@ -207,7 +211,7 @@ Component({
let { dataList, yqMerchantIds } = data
const list = yqMerchantIds.reduce((list, item, index) => {
let obj = {}
obj.totalMoney = dataList[index]?.totalMoney || 0
obj.totalMoney = setPrice(dataList[index]?.totalMoney || 0)
obj.totalOrder = dataList[index]?.totalOrder || 0
obj.merchantName = dataList[index]?.merchantName
obj.merchantId = item
......@@ -237,12 +241,12 @@ Component({
} else if ([1, 2].includes(index)) {
console.log(list[current])
if (list[current]['showList'][index]['diagnoseList']) {
swiperHeight = 735
swiperHeight = 600
} else {
swiperHeight = 686
swiperHeight = 555
}
} else {
swiperHeight = 590
swiperHeight = 485
}
// console.log('swiperHeight', swiperHeight)
this.setData({
......@@ -280,12 +284,12 @@ Component({
// console.log(item['diagnoseList'])
// item['showList'][index]['diagnoseList']
if (item['showList'][sceneIdx]?.diagnoseList) {
swiperHeight = 735
swiperHeight = 600
} else {
swiperHeight = 686
swiperHeight = 555
}
} else {
swiperHeight = 590
swiperHeight = 485
}
// let value = list[index][sceneIdx]
// console.log(list[index]['showList'][sceneIdx - 1])
......@@ -319,7 +323,7 @@ Component({
item = item[0]
let obj = {}
obj.selectName = selectName || oldItem.selectName
obj.totalMoney = item?.totalMoney || 0
obj.totalMoney = setPrice(item?.totalMoney || 0)
obj.totalOrder = item?.totalOrder || 0
obj.merchantName = item?.merchantName
// obj.merchantId = item
......@@ -357,12 +361,12 @@ Component({
let subscript = list[current]['startInd']
let item = list[current]['showList']
if (item[subscript]?.diagnoseList) {
swiperHeight = 735
swiperHeight = 600
} else {
swiperHeight = 686
swiperHeight = 555
}
} else {
swiperHeight = 590
swiperHeight = 485
}
// console.log(swiperHeight)
this.setData({
......
......@@ -108,9 +108,12 @@
}
.bg-image {
width: 100%;
height: 100%;
// width: 100%;
width: 440rpx;
// height: 100%;
position: absolute;
left: 50%;
transform: translateX(-50%);
// width: 670rpx;
// height: 550rpx;
// z-index: -0;
......@@ -118,18 +121,35 @@
}
.longHeight {
height: 284rpx;
}
.shortHeight {
height: 200rpx;
}
.funneItem {
box-sizing: border-box;
position: relative;
display: flex;
align-items: center;
margin-top: 36rpx;
z-index: 999;
width: 100%;
height: 400rpx;
height: 40rpx;
font-size: 24rpx;
color: #323436;
padding-left: 20rpx;
.label {
background: #F0F7FF;
border-radius: 4rpx;
width: 112rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
}
.num {
position: absolute;
......@@ -149,9 +169,13 @@
box-sizing: border-box;
width: 100%;
padding: 20rpx;
border: 2rpx dashed #CCCED1;
// border: 2rpx dashed #CCCED1;
border-radius: 8rpx;
display: flex;
// width: 670rpx;
// height: 104rpx;
background: #F7F8FC;
border-radius: 8rpx;
.tipsIcon {
box-sizing: border-box;
......@@ -177,6 +201,12 @@
}
}
.statisticsCon {
width: 100%;
}
.swiper-item {
padding: 32rpx 20rpx 24rpx;
display: flex;
......@@ -184,31 +214,36 @@
align-items: center;
.merchantCount {
position: relative;
box-sizing: border-box;
display: flex;
margin: 32rpx 0;
margin-top: 32rpx;
// width: 670rpx;
width: 100%;
height: 126rpx;
padding: 22rpx;
background: #FFFFFF;
box-shadow: 0 0 8rpx 0 rgba(180, 186, 204, 0.32), 0 8rpx 32rpx 0 rgba(180, 186, 204, 0.40);
border-radius: 8rpx;
z-index: 2;
.turnover,
.customerUnitPrice {
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
align-items: start;
flex-wrap: wrap;
justify-content: center;
width: 328rpx;
height: 128rpx;
padding-left: 110rpx;
background-image: linear-gradient(90deg, #FFFFFF 3%, #F7F8FC 100%);
align-items: center;
align-content: space-between;
width: 50%;
height: 100%;
text-align-last: left;
.img {
position: absolute;
top: 24rpx;
left: 36rpx;
width: 60rpx;
height: 60rpx;
width: 32rpx;
height: 32rpx;
margin-right: 5rpx;
}
.num {
......@@ -216,18 +251,35 @@
font-weight: 600;
font-size: 32rpx;
color: #323436;
margin-bottom: 14rpx;
// margin-bottom: 14rpx;
// text-align: right;
// text-align: center;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
}
.label {
font-weight: 400;
font-size: 24rpx;
color: #323436;
height: 34rpx;
}
}
.customerUnitPrice {
margin-left: 6rpx;
// margin-left: 6rpx;
border-left: 1rpx solid #D8D8D8;
}
}
.crowdFundingTotal {
width: 50%;
margin: 32rpx auto 0;
.turnover {
width: 100%;
}
}
}
......@@ -242,22 +294,25 @@
.funneItem:nth-of-type(1) {
box-sizing: border-box;
padding-top: 30rpx;
margin-top: 25rpx;
// padding-top: 30rpx;
margin-top: 64rpx;
}
.funneItem:nth-of-type(1) .num {
transform: translate(-50%, calc(-50% - -15rpx));
}
.navOhterApp {
display: flex;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
font-size: 24rpx;
color: #5C7097;
margin-top: 28rpx;
width: 100%;
// margin-left: auto;
// text-align: right;
// margin: 50rpx 20rpx 0;
margin-bottom: 100rpx;
// margin-bottom: 100rpx;
.linkImg {
width: 20rpx;
......@@ -278,21 +333,4 @@
width: 500rpx;
height: 500rpx;
}
}
// .swiper .wx-swiper-dot {
// width: 40rpx !important;
// height: 10rpx !important;
// background-color: aqua;
// // margin-left: 0 10rpx;
// // display: inline-flex;
// // justify-content: space-between;
// }
// swiper .wx-swiper-dot {
// width: 35rpx;
// height: 7rpx;
// border-radius: 50%;
// display: inline-flex;
// margin-left: 19rpx;
// justify-content: space-between;
// }
\ No newline at end of file
}
\ No newline at end of file
/**设置千分位 */
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 //暴露接口调用
}
......@@ -9,7 +9,7 @@ Page({
navStyle: 'background-color: rgba(0,0,0,0);',
loginType: 0,
agree: true,
tabIndx: 0,
tabIndx: 1,
tabList: ['我的客户', '我的门店', '我的员工'],
popupShow: false,
subIndex: -1,
......
......@@ -79,4 +79,16 @@
.navigation-title .move {
transform: rotate(-180deg) translateY(0);
}
// 圆点样式
.wx-swiper-dots .wx-swiper-dot {
width: 8rpx;
height: 8rpx;
background: #CCCED1;
}
// 当前选中圆点样式
.wx-swiper-dots .wx-swiper-dot.wx-swiper-dot-active {
background: #8A8C90;
}
\ No newline at end of file
......@@ -151,3 +151,34 @@ export function setPrice(price) {
if (!decimal) decimal = '00'
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}`
}
export function formatNum(str) {
var newStr = ''
var count = 0
// 当数字是整数
if (str.indexOf('.') == -1) {
for (var i = str.length - 1; i >= 0; i--) {
if (count % 3 == 0 && count != 0) {
newStr = str.charAt(i) + ',' + newStr
} else {
newStr = str.charAt(i) + newStr
}
count++
}
str = newStr + '.00' //自动补小数点后两位
return str
}
// 当数字带有小数
else {
for (var i = str.indexOf('.') - 1; i >= 0; i--) {
if (count % 3 == 0 && count != 0) {
newStr = str.charAt(i) + ',' + newStr
} else {
newStr = str.charAt(i) + newStr //逐个字符相接起来
}
count++
}
str = newStr + (str + '00').substr((str + '00').indexOf('.'), 3)
return str
}
}
......@@ -17,7 +17,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 3
let index = 2
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!