Commit a2ce8d08 by 李伟康

commit 增加雪碧图

1 parent d1d7e5f0
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
/.vscode /.vscode
/.DS_Store /.DS_Store
/.hbuilderx /.hbuilderx
node_modules
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 418rpx 328rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -358rpx -70rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -276rpx 0rpx;}
.icon-icon-logout { width: 32rpx; height: 32rpx; background-position: -358rpx -112rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -358rpx -154rpx;}
.icon-icon-upload { width: 128rpx; height: 128rpx; background-position: 0rpx 0rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -358rpx -196rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: 0rpx -138rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -130rpx -138rpx;}
.icon-tool-1 { width: 60rpx; height: 60rpx; background-position: -276rpx -82rpx;}
.icon-tool-2 { width: 60rpx; height: 60rpx; background-position: -276rpx -152rpx;}
.icon-tool-3 { width: 60rpx; height: 60rpx; background-position: 0rpx -268rpx;}
.icon-tool-4 { width: 60rpx; height: 60rpx; background-position: -70rpx -268rpx;}
.icon-tool-5 { width: 60rpx; height: 60rpx; background-position: -140rpx -268rpx;}
.icon-tool-6 { width: 60rpx; height: 60rpx; background-position: -210rpx -268rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -280rpx -268rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -358rpx 0rpx;}
.icon-icon-avatar { width: 128rpx; height: 128rpx; background-position: -138rpx 0rpx;}
\ No newline at end of file \ No newline at end of file
...@@ -37,14 +37,6 @@ ...@@ -37,14 +37,6 @@
} }
}, },
{ {
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/common/nothing", "path": "pages/common/nothing",
"style": { "style": {
"navigationBarTitleText": "提示" "navigationBarTitleText": "提示"
......
...@@ -4,13 +4,11 @@ ...@@ -4,13 +4,11 @@
:class="['btn', {hideIcon:!show}]" :class="['btn', {hideIcon:!show}]"
@click="show = false" @click="show = false"
> >
<image <view class="icon sprite-icon icon-tool-file">
src="../../../assets/images/tool/file.png" </view>
class="icon"
/>
文件夹 文件夹
</view> </view>
<view :class="['list',{showList:!show},{preview: !show && type}]"> <view :class="['list',{showList:!show}]">
<view <view
class="title" class="title"
@click="show = true" @click="show = true"
...@@ -22,10 +20,7 @@ ...@@ -22,10 +20,7 @@
@click="jump(i)" @click="jump(i)"
> >
<view class="icon"> <view class="icon">
<image <view :class="['icon sprite-icon', i.icon]"> </view>
:src="i.icon"
class="icon"
/>
</view> </view>
{{i.label}} {{i.label}}
</view> </view>
...@@ -36,10 +31,7 @@ ...@@ -36,10 +31,7 @@
@click="finish" @click="finish"
> >
<view class="icon"> <view class="icon">
<image <view class="sprite-icon icon-tool-finish"></view>
src="../../../assets/images/tool/finish.png"
class="icon"
/>
</view> </view>
完成接待 完成接待
</view> </view>
...@@ -61,32 +53,32 @@ export default { ...@@ -61,32 +53,32 @@ export default {
{ {
id: 1, id: 1,
label: '交车告知书', label: '交车告知书',
icon: require('../../../assets/images/tool/1.png') icon: 'icon-tool-1'
}, },
{ {
id: 2, id: 2,
label: '延保明细', label: '延保明细',
icon: require('../../../assets/images/tool/2.png') icon: 'icon-tool-2'
}, },
{ {
id: 3, id: 3,
label: '保修告知书', label: '保修告知书',
icon: require('../../../assets/images/tool/3.png') icon: 'icon-tool-3'
}, },
{ {
id: 4, id: 4,
label: '三包政策', label: '三包政策',
icon: require('../../../assets/images/tool/4.png') icon: 'icon-tool-3'
}, },
{ {
id: 5, id: 5,
label: '质保升级', label: '质保升级',
icon: require('../../../assets/images/tool/5.png') icon: 'icon-tool-5'
}, },
{ {
id: 6, id: 6,
label: '历史成交', label: '历史成交',
icon: require('../../../assets/images/tool/6.png') icon: 'icon-tool-6'
}, },
] ]
} }
...@@ -109,10 +101,10 @@ export default { ...@@ -109,10 +101,10 @@ export default {
right: 40rpx; right: 40rpx;
top: calc(5% + 140rpx); top: calc(5% + 140rpx);
z-index: 998; z-index: 998;
width: 128rpx; width: 120rpx;
.btn { .btn {
width: 100%; width: 100%;
height: 128rpx; height: 120rpx;
background-image: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%); background-image: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
border: 2.08rpx solid #ffffff; border: 2.08rpx solid #ffffff;
box-shadow: 0 8rpx 24rpx 0 #00000033; box-shadow: 0 8rpx 24rpx 0 #00000033;
...@@ -151,7 +143,7 @@ export default { ...@@ -151,7 +143,7 @@ export default {
overflow: hidden; overflow: hidden;
opacity: 0; opacity: 0;
.title { .title {
width: 128rpx; width: 120rpx;
height: 56rpx; height: 56rpx;
background: #f4f4f5; background: #f4f4f5;
border: 2rpx solid #ffffff; border: 2rpx solid #ffffff;
...@@ -181,8 +173,5 @@ export default { ...@@ -181,8 +173,5 @@ export default {
height: 896rpx; height: 896rpx;
opacity: 1; opacity: 1;
} }
.preview {
height: 776rpx;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<template v-if="type != 'preview'"> <template v-if="type != 'preview'">
<tool-box :type="type" @choose="choose" @finish="open" /> <tool-box :type="type" @choose="choose" @finish="open" />
<view class="pen-box" @click="drawStatus = !drawStatus"> <view class="pen-box" @click="drawStatus = !drawStatus">
<image :src="!drawStatus ? defaulePen : activePen" /> <view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view> </view>
</template> </template>
<MessageBox <MessageBox
...@@ -199,8 +199,8 @@ export default { ...@@ -199,8 +199,8 @@ export default {
position: fixed; position: fixed;
right: 40rpx; right: 40rpx;
top: 5%; top: 5%;
width: 128rpx; width: 120rpx;
height: 128rpx; height: 120rpx;
z-index: 9; z-index: 9;
box-shadow: 0 4px 12px 0 #00000033; box-shadow: 0 4px 12px 0 #00000033;
border-radius: 16rpx; border-radius: 16rpx;
......
...@@ -10,29 +10,20 @@ ...@@ -10,29 +10,20 @@
<view class="left-side"> <view class="left-side">
<!-- 左侧内容 --> <!-- 左侧内容 -->
<view class="user-info"> <view class="user-info">
<image <view class="user-avatar sprite-icon icon-icon-avatar"></view>
class="user-avatar"
src="../../assets/images/home/icon-avatar.png"
mode="scaleToFill"
/>
<view class="user-name">{{ userInfo.name }}</view> <view class="user-name">{{ userInfo.name }}</view>
<view class="user-position">延保专员</view> <view class="user-position">延保专员</view>
</view> </view>
<view class="left-footer"> <view class="left-footer">
<view class="logout" @click="logout"> <view class="logout" @click="logout">
<image <view class="icon-logout sprite-icon icon-icon-logout"></view>
class="icon-logout"
src="../../assets/images/home/icon-logout.png"
mode="scaleToFill"
/>
<view>退出</view> <view>退出</view>
</view> </view>
<view class="store-addr"> <view class="store-addr">
<image <view class="icon-addr sprite-icon icon-icon-addr"></view>
class="icon-addr"
src="../../assets/images/home/icon-addr.png"
mode="scaleToFill"
/>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view> <view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view> </view>
</view> </view>
...@@ -41,11 +32,8 @@ ...@@ -41,11 +32,8 @@
<!-- 右侧内容 --> <!-- 右侧内容 -->
<view class="home-title">客户接待</view> <view class="home-title">客户接待</view>
<view class="start" @click="start"> <view class="start" @click="start">
<image <view class="icon-start sprite-icon icon-icon-handshake"></view>
class="icon-start"
src="../../assets/images/home/icon-handshake.png"
mode="scaleToFill"
/>
<view class="start-text">开始接待</view> <view class="start-text">开始接待</view>
</view> </view>
<!-- 各模块入口list --> <!-- 各模块入口list -->
......
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title"> {{ voicePath }} </text>
</view>
<view class="button-demo">
<u-button type="primary" plain @click="start()">开始</u-button>
<u-button type="primary" plain @click="go()">登录</u-button>
</view>
</view>
</template>
<script>
import myClick from "@/mixin/click";
export default {
mixins: [myClick],
data() {
return {
title: "Hello",
};
},
onLoad() {},
methods: {
go() {
uni.navigateTo({
url: "/pages/login/login",
success: function (res) {
// success
},
fail: function () {
// fail
},
complete: function () {
// complete
},
});
},
},
};
</script>
<style lang="scss" scoped>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40rpx;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 100rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 28rpx;
color: $u-content-color;
}
.button-demo {
margin-top: 80rpx;
}
</style>
...@@ -32,11 +32,8 @@ ...@@ -32,11 +32,8 @@
></uni-icons> --> ></uni-icons> -->
</view> </view>
<view v-else class="icon" @tap="choose(index)"> <view v-else class="icon" @tap="choose(index)">
<image <view class="icon-upload sprite-icon icon-icon-upload"></view>
class="icon-upload"
src="../../assets/images/detail/icon-upload.png"
mode="scaleToFill"
/>
</view> </view>
<view class="information-title">{{ item.title }} </view> <view class="information-title">{{ item.title }} </view>
</view> </view>
......
<template>
<view class="v1">
<view class="avatarUrl">
<image v-if="vuex_userInfo" :src="vuex_userInfo.avatar_url" mode="widthFix"></image>
<open-data v-else type="userAvatarUrl"></open-data>
</view>
<view class="content">
<view class="v2"></view>
<view v-if="isShowUserInfo" class="v3">申请获得以下权限</view>
<view v-if="isShowUserInfo" class="v4">获取你的公开信息(昵称、头像等)</view>
<view v-if="!isShowUserInfo" class="v3">手机号快捷登录</view>
<view v-if="!isShowUserInfo" class="v4">未注册的手机号登录后将自动注册</view>
<button v-if="isShowUserInfo" @click="getUserProfile" class="u-reset-button u-flex u-row-center btn1" type="default">
<u-icon size="40" name="weixin-fill"></u-icon>
<text class="u-margin-left-10">获取微信昵称头像</text>
</button>
<button v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="u-reset-button u-flex u-row-center btn1" type="default">
<u-icon size="40" name="weixin-fill"></u-icon>
<text class="u-margin-left-10">微信手机号快捷登录</text>
</button>
<button @click="noSignIn" class="u-reset-button u-flex u-row-center btn2" type="default">暂不登录</button>
</view>
</view>
</template>
<script>
import common from '@/utils/wxApplet/common.js'
export default {
data() {
return {
// 是否显示获取头像昵称按钮
isShowUserInfo: this.$store.state.vuex_userInfo ? false : true,
}
},
methods: {
// 获取昵称、头像等信息
getUserProfile() {
common.getUserProfile().then(res => {
if (res) {
this.isShowUserInfo = false;
}
})
},
// 手机号快捷登录
getPhoneNumber(e) {
common.getPhoneNumber(e).then(res => {
if (res) {
uni.showToast({
title: '登录成功',
icon: 'success'
})
setTimeout(() => {
this.noSignIn();
}, 1300)
}
})
},
// 暂不登录
noSignIn() {
let pages = getCurrentPages()
// 没有上级页面,直接返回首页
if (pages.length == 1) {
uni.reLaunch({
url: '/pages/index/index'
})
} else {
uni.navigateBack()
}
}
}
}
</script>
<style lang="scss" scoped>
.v1 {
width: 100%;
height: 100%;
overflow: hidden;
background: #ffffff;
padding-top: 100rpx;
}
.avatarUrl {
width: 200rpx;
margin: 0 auto;
height: 200rpx;
border-radius: 50%;
overflow: hidden;
border: 4rpx solid #fff;
box-shadow: 0rpx 0rpx 10rpx $u-light-color;
image {
width: 200rpx;
}
}
.content {
width: 84%;
margin: 0 auto;
}
.v2 {
width: 100%;
margin-top: 70rpx;
height: 2rpx;
background: $u-border-color;
}
.v3 {
margin-top: 50rpx;
font-weight: 600;
font-size: 34rpx;
color: $u-main-color;
}
.v4 {
margin: 30rpx 0 80rpx 0;
font-size: 28rpx;
color: $u-tips-color;
}
.btn1 {
margin-bottom: 24rpx;
background: #808003;
color: #fff;
height: 90rpx;
border-radius: 90rpx;
}
.btn2 {
background: $u-border-color;
color: #fff;
height: 90rpx;
border-radius: 90rpx;
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 09:43:06
-->
<template>
<view>
这是订单列表
</view>
</template>
<script>
export default {
data() {
return {
};
},
onLoad(options) {
const text = options.text
uni.setNavigationBarTitle({
title: text
});
}
}
</script>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* 下方引入的为uView UI的集成样式文件,为scss预处理器,其中包含了一些"u-"开头的自定义变量 * 下方引入的为uView UI的集成样式文件,为scss预处理器,其中包含了一些"u-"开头的自定义变量
* uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用 * uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用
*/ */
@import './assets/css/sprite.scss';
@keyframes show-view{ @keyframes show-view{
0%{ 0%{
opacity: 0; opacity: 0;
......
const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => {
// let { spritesheet, sprites } = data
// let shared = `.sprite-icon { background-image: url(${spritesheet.image});background-size: ${spritesheet.width}rpx ${spritesheet.height}rpx;}`
// let perSprite = sprites.map(sprite => {
// let { name, width, height, offset_x, offset_y } = sprite
// return `.icon-${name} { width: ${width}rpx; height: ${height}rpx; background-position: ${offset_x}rpx ${offset_y}rpx;}`
// }).join('\n')
// return `${shared}\n${perSprite}`
let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}rpx ${spritesheet.height / 2}rpx;}`
let perSprite = sprites
.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}rpx; height: ${height / 2}rpx; background-position: ${offset_x / 2}rpx ${offset_y / 2}rpx;}`
})
.join('\n')
return `${shared}\n${perSprite}`
}
const path = require('path')
module.exports = { module.exports = {
// 配置路径别名
configureWebpack: {
devServer: { devServer: {
disableHostCheck: true disableHostCheck: true
},
configureWebpack:{
plugins:[
new SpritesmithPlugin({
// 引入图片文件夹
src: {
cwd: path.resolve(__dirname, './assets/spritesmith'),
glob: ['*.png', '*.jpg']
},
// 生成图片的路径
target: {
image: path.resolve(__dirname, './assets/images/sprite.png'),
// 生成SCSS
css: [
[
path.resolve(__dirname, './assets/css/sprite.scss'),
{
format: 'function_based_template'
} }
]
]
},
customTemplates: {
function_based_template: spritesmithFunction
},
//background引用路径
apiOptions: {
cssImageRef: '@/assets/images/sprite.png'
},
// 每个图片间距
spritesmithOptions: {
padding: 20
} }
})
]
},
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!