[init]能辉材料小程序商城

main
huyuanxiang 2 years ago
parent dfbaa472ac
commit 453c3d6c97

5
.idea/.gitignore vendored

@ -0,0 +1,5 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/nherp-shop.iml" filepath="$PROJECT_DIR$/.idea/nherp-shop.iml" />
</modules>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,95 @@
<script>
import { getConfig, setConfig, getCart, getToken ,getCartNumber } from "./utils/auth";
import myconfig from "./utils/config";
import request from "./utils/request";
import {setTabBarBadge } from'./utils/util.js'
let colors = getConfig();
let nowColor = ''
if(colors){
nowColor = colors.color
}
uni.$ajax = request; //
export default {
onLaunch: function () {
// #ifdef MP-WEIXIN
uni.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// getUserInfo
uni.getUserInfo({
success: res => {
// res unionId
this.globalData.userInfo = res.userInfo; // getUserInfo Page.onLoad
// callback
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res);
}
}
});
}
}
});
// #endif
uni.getSystemInfo({ //
complete: res => {
this.globalData.statusHeight = res.statusBarHeight;
if (res.platform == "ios") {
this.globalData.toBar = 44;
} else if (res.platform == "android") {
this.globalData.toBar = 48;
} else {
this.globalData.toBar = 44;
}
}
}); //
let config = getConfig();
if (config && config.color !== '') {
// 使
uni.setTabBarStyle({
selectedColor: config.color
});
let tabList = config.tabList;
if (config.tabList) {
for (var i = 0; i < tabList.length; i++) {
let img = tabList[i];
uni.setTabBarItem({
//tabBar
index: i,
selectedIconPath: img
});
}
}
} else {
// 使
let fristColor = {};
fristColor.color = '#39b54a';
fristColor.name = "green";
setConfig(fristColor);
uni.setTabBarStyle({
selectedColor: '#39b54a'
});
}
/**
* 模拟获取购物车的数量 getCart
*/
let cart = getCart()
let length = ''
if(cart && getToken()){
length = cart.length
// length = getCartNumber()
setTabBarBadge(length)
}
},
globalData: {
userInfo: null,
statusHeight: '20', //
toBar: '44', //
newColor: nowColor || '#39b54a', //
config: myconfig.themeList //
},
methods: {}
};
</script>
<style>
@import "./app.css";
</style>

@ -0,0 +1,20 @@
import request from "@/utils/request";
export const getGoodsList = (params) => request('/erp/goods/list', params, 'get')
export const getAddrList = (params) => request('/erp/addrManager/list', params, 'get')
export const getOrderList = (params) => request('/erp/order/list', params, 'get')
export const addOrder = (params) => request('/erp/order/add', params, 'post')
export const editOrder = (params) => request('/erp/order/edit', params, 'post')
export const addAddr = (params) => request('/erp/addrManager/add', params, 'post')
export const editAddr = (params) => request('/erp/addrManager/edit', params, 'post')
export const delAddr = (params) => request('/erp/addrManager/delete?id='+params, {} , 'delete')
export const getCode = (params) => request('/sys/randomImage/' + params, {}, 'get')
export const login = (params) => request('/sys/login', params, 'POST')

File diff suppressed because one or more lines are too long

@ -0,0 +1,184 @@
/*
Animation
ColorUI by 201932619:52:28
*/
/* css 滤镜 控制黑白底色gif的 */
.gif-black{
mix-blend-mode: screen;
}
.gif-white{
mix-blend-mode: multiply;
}
/* Animation css */
[class*=animation-] {
animation-duration: .5s;
animation-timing-function: ease-out;
animation-fill-mode: both
}
.animation-fade {
animation-name: fade;
animation-duration: .8s;
animation-timing-function: linear
}
.animation-scale-up {
animation-name: scale-up
}
.animation-scale-down {
animation-name: scale-down
}
.animation-slide-top {
animation-name: slide-top
}
.animation-slide-bottom {
animation-name: slide-bottom
}
.animation-slide-left {
animation-name: slide-left
}
.animation-slide-right {
animation-name: slide-right
}
.animation-shake {
animation-name: shake
}
.animation-reverse {
animation-direction: reverse
}
@keyframes fade {
0% {
opacity: 0
}
100% {
opacity: 1
}
}
@keyframes scale-up {
0% {
opacity: 0;
transform: scale(.2)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes scale-down {
0% {
opacity: 0;
transform: scale(1.8)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes slide-top {
0% {
opacity: 0;
transform: translateY(-100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes slide-bottom {
0% {
opacity: 0;
transform: translateY(100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes shake {
0%,
100% {
transform: translateX(0)
}
10% {
transform: translateX(-9px)
}
20% {
transform: translateX(8px)
}
30% {
transform: translateX(-7px)
}
40% {
transform: translateX(6px)
}
50% {
transform: translateX(-5px)
}
60% {
transform: translateX(4px)
}
70% {
transform: translateX(-3px)
}
80% {
transform: translateX(2px)
}
90% {
transform: translateX(-1px)
}
}
@keyframes slide-left {
0% {
opacity: 0;
transform: translateX(-100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}
@keyframes slide-right {
0% {
opacity: 0;
transform: translateX(100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}

@ -0,0 +1 @@
/* colorui/components/cu-custom.wxss */

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

@ -0,0 +1,77 @@
<template>
<view class="cu-custom" :style="'height:' + CustomBar + 'px'">
<view :class="'cu-bar fixed ' + (bgImage!=''?'none-bg text-white bg-img':'') + ' ' + bgColor" :style="'height:' + CustomBar + 'px;padding-top:' + StatusBar + 'px;' + (bgImage?'background-image:url(' + bgImage+')':'')">
<view class="action" @tap="BackPage" v-if="isBack">
<text class="cuIcon-back"></text>
<slot name="backText"></slot>
</view>
<view class="action border-custom" v-if="isCustom" :style="'width:' + Custom.width + 'px;height:' + Custom.height + 'px;margin-left:calc(750upx - ' + Custom.right + 'px)'">
<text class="cuIcon-back" @tap="BackPage"></text>
<text class="cuIcon-homefill" @tap="toHome"></text>
</view>
<view class="content" :style="'top:' + StatusBar + 'px'">
<slot name="content"></slot>
</view>
<slot name="right"></slot>
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
StatusBar: app.globalData.StatusBar,
CustomBar: app.globalData.CustomBar,
Custom: app.globalData.Custom
};
},
components: {},
props: {
bgColor: {
type: String,
default: ''
},
isCustom: {
type: [Boolean, String],
default: false
},
isBack: {
type: [Boolean, String],
default: false
},
bgImage: {
type: String,
default: ''
}
},
/**
* 组件的一些选项
*/
options: {
addGlobalClass: true,
multipleSlots: true
},
methods: {
BackPage() {
uni.navigateBack({
delta: 1
});
},
toHome() {
uni.reLaunch({
url: '/pages/index/index'
});
}
}
};
</script>
<style>
@import "./cu-custom.css";
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -0,0 +1,22 @@
export default {
created() {
if (this.type === 'message') {
// 不显示遮罩
this.maskShow = false
// 获取子组件对象
this.childrenMsg = null
}
},
methods: {
customOpen() {
if (this.childrenMsg) {
this.childrenMsg.open()
}
},
customClose() {
if (this.childrenMsg) {
this.childrenMsg.close()
}
}
}
}

@ -0,0 +1,25 @@
import message from './message.js';
// 定义 type 类型:弹出类型top/bottom/center
const config = {
// 顶部弹出
top:'top',
// 底部弹出
bottom:'bottom',
// 居中弹出
center:'center',
// 消息提示
message:'top',
// 对话框
dialog:'center',
// 分享
share:'bottom',
}
export default {
data(){
return {
config:config
}
},
mixins: [message],
}

@ -0,0 +1,243 @@
<template>
<view class="uni-popup-dialog">
<view class="uni-dialog-title">
<text class="uni-dialog-title-text" :class="['uni-popup__'+dialogType]">{{title}}</text>
</view>
<view class="uni-dialog-content">
<text class="uni-dialog-content-text" v-if="mode === 'base'">{{content}}</text>
<input v-else class="uni-dialog-input" v-model="val" type="text" :placeholder="placeholder" :focus="focus" >
</view>
<view class="uni-dialog-button-group">
<view class="uni-dialog-button" @click="close">
<text class="uni-dialog-button-text">取消</text>
</view>
<view class="uni-dialog-button uni-border-left" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">确定</text>
</view>
</view>
</view>
</template>
<script>
/**
* PopUp 弹出层-对话框样式
* @description 弹出层-对话框样式
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} value input 模式下的默认值
* @property {String} placeholder input 模式下输入提示
* @property {String} type = [success|warning|info|error] 主题样式
* @value success 成功
* @value warning 提示
* @value info 消息
* @value error 错误
* @property {String} mode = [base|input] 模式
* @value base 基础对话框
* @value input 可输入对话框
* @property {String} content 对话框内容
* @property {Boolean} beforeClose 是否拦截取消事件
* @event {Function} confirm 点击确认按钮触发
* @event {Function} close 点击取消按钮触发
*/
export default {
name: "uniPopupDialog",
props: {
value: {
type: [String, Number],
default: ''
},
placeholder: {
type: [String, Number],
default: '请输入内容'
},
/**
* 对话框主题 success/warning/info/error 默认 success
*/
type: {
type: String,
default: 'error'
},
/**
* 对话框模式 base/input
*/
mode: {
type: String,
default: 'base'
},
/**
* 对话框标题
*/
title: {
type: String,
default: '提示'
},
/**
* 对话框内容
*/
content: {
type: String,
default: ''
},
/**
* 拦截取消事件 如果拦截取消事件必须监听close事件执行 done()
*/
beforeClose: {
type: Boolean,
default: false
}
},
data() {
return {
dialogType: 'error',
focus: false,
val: ""
}
},
inject: ['popup'],
watch: {
type(val) {
this.dialogType = val
},
mode(val) {
if (val === 'input') {
this.dialogType = 'info'
}
},
value(val) {
this.val = val
}
},
created() {
//
this.popup.mkclick = false
if (this.mode === 'input') {
this.dialogType = 'info'
this.val = this.value
} else {
this.dialogType = this.type
}
},
mounted() {
this.focus = true
},
methods: {
/**
* 点击确认按钮
*/
onOk() {
this.$emit('confirm', () => {
this.popup.close()
if (this.mode === 'input') this.val = this.value
}, this.mode === 'input' ? this.val : '')
},
/**
* 点击取消按钮
*/
close() {
if (this.beforeClose) {
this.$emit('close', () => {
this.popup.close()
})
return
}
this.popup.close()
}
}
}
</script>
<style lang="scss" scoped>
.uni-popup-dialog {
width: 300px;
border-radius: 15px;
background-color: #fff;
}
.uni-dialog-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 15px;
padding-bottom: 5px;
}
.uni-dialog-title-text {
font-size: 16px;
font-weight: 500;
}
.uni-dialog-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 15px 15px 15px;
}
.uni-dialog-content-text {
font-size: 14px;
color: #6e6e6e;
}
.uni-dialog-button-group {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
border-top-color: #f5f5f5;
border-top-style: solid;
border-top-width: 1px;
}
.uni-dialog-button {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 45px;
}
.uni-border-left {
border-left-color: #f0f0f0;
border-left-style: solid;
border-left-width: 1px;
}
.uni-dialog-button-text {
font-size: 14px;
}
.uni-button-color {
color: $uni-color-primary;
}
.uni-dialog-input {
flex: 1;
font-size: 14px;
}
.uni-popup__success {
color: $uni-color-success;
}
.uni-popup__warn {
color: $uni-color-warning;
}
.uni-popup__error {
color: $uni-color-error;
}
.uni-popup__info {
color: #909399;
}
</style>

@ -0,0 +1,116 @@
<template>
<view class="uni-popup-message" :class="'uni-popup__'+[type]">
<text class="uni-popup-message-text" :class="'uni-popup__'+[type]+'-text'">{{message}}</text>
</view>
</template>
<script>
/**
* PopUp 弹出层-消息提示
* @description 弹出层-消息提示
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [success|warning|info|error] 主题样式
* @value success 成功
* @value warning 提示
* @value info 消息
* @value error 错误
* @property {String} message 消息提示文字
* @property {String} duration 显示时间设置为 0 则不会自动关闭
*/
export default {
name: 'UniPopupMessage',
props: {
/**
* 主题 success/warning/info/error 默认 success
*/
type: {
type: String,
default: 'success'
},
/**
* 消息文字
*/
message: {
type: String,
default: ''
},
/**
* 显示时间设置为 0 则不会自动关闭
*/
duration: {
type: Number,
default: 3000
}
},
inject: ['popup'],
data() {
return {}
},
created() {
this.popup.childrenMsg = this
},
methods: {
open() {
if (this.duration === 0) return
clearTimeout(this.popuptimer)
this.popuptimer = setTimeout(() => {
this.popup.close()
}, this.duration)
},
close() {
clearTimeout(this.popuptimer)
}
}
}
</script>
<style lang="scss" scoped>
.uni-popup-message {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
background-color: #e1f3d8;
padding: 10px 15px;
border-color: #eee;
border-style: solid;
border-width: 1px;
}
.uni-popup-message-text {
font-size: 14px;
padding: 0;
}
.uni-popup__success {
background-color: #e1f3d8;
}
.uni-popup__success-text {
color: #67C23A;
}
.uni-popup__warn {
background-color: #faecd8;
}
.uni-popup__warn-text {
color: #E6A23C;
}
.uni-popup__error {
background-color: #fde2e2;
}
.uni-popup__error-text {
color: #F56C6C;
}
.uni-popup__info {
background-color: #F2F6FC;
}
.uni-popup__info-text {
color: #909399;
}
</style>

@ -0,0 +1,165 @@
<template>
<view class="uni-popup-share">
<view class="uni-share-title"><text class="uni-share-title-text">{{title}}</text></view>
<view class="uni-share-content">
<view class="uni-share-content-box">
<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
<text class="uni-share-text">{{item.text}}</text>
</view>
</view>
</view>
<view class="uni-share-button-box">
<button class="uni-share-button" @click="close"></button>
</view>
</view>
</template>
<script>
export default {
name: 'UniPopupShare',
props: {
title: {
type: String,
default: '分享到'
}
},
inject: ['popup'],
data() {
return {
bottomData: [{
text: '微信',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-2.png',
name: 'wx'
},
{
text: '支付宝',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-8.png',
name: 'wx'
},
{
text: 'QQ',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/gird-3.png',
name: 'qq'
},
{
text: '新浪',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-1.png',
name: 'sina'
},
{
text: '百度',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-7.png',
name: 'copy'
},
{
text: '其他',
icon: 'https://img-cdn-qiniu.dcloud.net.cn/uni-ui/grid-5.png',
name: 'more'
}
]
}
},
created() {},
methods: {
/**
* 选择内容
*/
select(item, index) {
this.$emit('select', {
item,
index
}, () => {
this.popup.close()
})
},
/**
* 关闭窗口
*/
close() {
this.popup.close()
}
}
}
</script>
<style lang="scss" scoped>
.uni-popup-share {
background-color: #fff;
}
.uni-share-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
height: 40px;
}
.uni-share-title-text {
font-size: 14px;
color: #666;
}
.uni-share-content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: center;
padding-top: 10px;
}
.uni-share-content-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: wrap;
width: 360px;
}
.uni-share-content-item {
width: 90px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
padding: 10px 0;
align-items: center;
}
.uni-share-content-item:active {
background-color: #f5f5f5;
}
.uni-share-image {
width: 30px;
height: 30px;
}
.uni-share-text {
margin-top: 10px;
font-size: 14px;
color: #3B4144;
}
.uni-share-button-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
padding: 10px 15px;
}
.uni-share-button {
flex: 1;
border-radius: 50px;
color: #666;
font-size: 16px;
}
.uni-share-button::after {
border-radius: 50px;
}
</style>

@ -0,0 +1,294 @@
<template>
<view v-if="showPopup" class="uni-popup" :class="[popupstyle]" @touchmove.stop.prevent="clear">
<uni-transition v-if="maskShow" :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans"
@click="onTap" />
<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
<view class="uni-popup__wrapper-box" @click.stop="clear">
<slot />
</view>
</uni-transition>
</view>
</template>
<script>
import uniTransition from '../uni-transition/uni-transition.vue'
import popup from './popup.js'
/**
* PopUp 弹出层
* @description 弹出层组件为了解决遮罩弹层的问题
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [top|center|bottom] 弹出方式
* @value top 顶部弹出
* @value center 中间弹出
* @value bottom 底部弹出
* @value message 消息提示
* @value dialog 对话框
* @value share 底部分享示例
* @property {Boolean} animation = [ture|false] 是否开启动画
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
* @event {Function} change 打开关闭弹窗触发e={show: false}
*/
export default {
name: 'UniPopup',
components: {
uniTransition
},
props: {
//
animation: {
type: Boolean,
default: true
},
// top: bottomcenter
// message: ; dialog :
type: {
type: String,
default: 'center'
},
// maskClick
maskClick: {
type: Boolean,
default: true
}
},
provide() {
return {
popup: this
}
},
mixins: [popup],
watch: {
/**
* 监听type类型
*/
type: {
handler: function(newVal) {
this[this.config[newVal]]()
},
immediate: true
},
/**
* 监听遮罩是否可点击
* @param {Object} val
*/
maskClick(val) {
this.mkclick = val
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
maskClass: {
'position': 'fixed',
'bottom': 0,
'top': 0,
'left': 0,
'right': 0,
'backgroundColor': 'rgba(0, 0, 0, 0.4)'
},
transClass: {
'position': 'fixed',
'left': 0,
'right': 0,
},
maskShow: true,
mkclick: true,
popupstyle: 'top'
}
},
created() {
this.mkclick = this.maskClick
if (this.animation) {
this.duration = 300
} else {
this.duration = 0
}
},
methods: {
clear(e) {
// TODO nvue
e.stopPropagation()
},
open() {
this.showPopup = true
this.$nextTick(() => {
new Promise(resolve => {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.showTrans = true
// fixed by mehaotian app
this.$nextTick(() => {
resolve();
})
}, 50);
}).then(res => {
//
clearTimeout(this.msgtimer)
this.msgtimer = setTimeout(() => {
this.customOpen && this.customOpen()
}, 100)
this.$emit('change', {
show: true,
type: this.type
})
})
})
},
close(type) {
this.showTrans = false
this.$nextTick(() => {
this.$emit('change', {
show: false,
type: this.type
})
clearTimeout(this.timer)
//
this.customOpen && this.customClose()
this.timer = setTimeout(() => {
this.showPopup = false
}, 300)
})
},
onTap() {
if (!this.mkclick) return
this.close()
},
/**
* 顶部弹出样式处理
*/
top() {
this.popupstyle = 'top'
this.ani = ['slide-top']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
}
},
/**
* 底部弹出样式处理
*/
bottom() {
this.popupstyle = 'bottom'
this.ani = ['slide-bottom']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
'bottom': 0
}
},
/**
* 中间弹出样式处理
*/
center() {
this.popupstyle = 'center'
this.ani = ['zoom-out', 'fade']
this.transClass = {
'position': 'fixed',
/* #ifndef APP-NVUE */
'display': 'flex',
'flexDirection': 'column',
/* #endif */
'bottom': 0,
'left': 0,
'right': 0,
'top': 0,
'justifyContent': 'center',
'alignItems': 'center'
}
}
}
}
</script>
<style lang="scss" scoped>
.uni-popup {
position: fixed;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-popup__mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: $uni-bg-color-mask;
opacity: 0;
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.uni-top-mask {
opacity: 1;
}
.uni-bottom-mask {
opacity: 1;
}
.uni-center-mask {
opacity: 1;
}
.uni-popup__wrapper {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: absolute;
}
.top {
/* #ifdef H5 */
top: var(--window-top);
/* #endif */
/* #ifndef H5 */
top: 0;
/* #endif */
}
.bottom {
bottom: 0;
}
.uni-popup__wrapper-box {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: relative;
/* iphonex 等安全区设置,底部安全区适配 */
/* #ifndef APP-NVUE */
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
}
.content-ani {
// transition: transform 0.3s;
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.uni-top-content {
transform: translateY(0);
}
.uni-bottom-content {
transform: translateY(0);
}
.uni-center-content {
transform: scale(1);
opacity: 1;
}
</style>

@ -0,0 +1,279 @@
<template>
<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject"
@click="change">
<slot></slot>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
/**
* Transition 过渡动画
* @description 简单过渡动画组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
* @value fade 渐隐渐出过渡
* @value slide-top 由上至下过渡
* @value slide-right 由右至左过渡
* @value slide-bottom 由下至上过渡
* @value slide-left 由左至右过渡
* @value zoom-in 由小到大过渡
* @value zoom-out 由大到小过渡
* @property {Number} duration 过渡动画持续时间
* @property {Object} styles 组件样式 css 样式注意带-连接符的属性需要使用小驼峰写法如`backgroundColor:red`
*/
export default {
name: 'uniTransition',
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: Array,
default () {
return []
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default () {
return {}
}
}
},
data() {
return {
isShow: false,
transform: '',
ani: { in: '',
active: ''
}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open()
} else {
this.close()
}
},
immediate: true
}
},
computed: {
stylesObject() {
let styles = {
...this.styles,
'transition-duration': this.duration / 1000 + 's'
}
let transfrom = ''
for (let i in styles) {
let line = this.toLine(i)
transfrom += line + ':' + styles[i] + ';'
}
return transfrom
}
},
created() {
// this.timer = null
// this.nextTick = (time = 50) => new Promise(resolve => {
// clearTimeout(this.timer)
// this.timer = setTimeout(resolve, time)
// return this.timer
// });
},
methods: {
change() {
this.$emit('click', {
detail: this.isShow
})
},
open() {
clearTimeout(this.timer)
this.isShow = true
this.transform = ''
this.ani.in = ''
for (let i in this.getTranfrom(false)) {
if (i === 'opacity') {
this.ani.in = 'fade-in'
} else {
this.transform += `${this.getTranfrom(false)[i]} `
}
}
this.$nextTick(() => {
setTimeout(() => {
this._animation(true)
}, 50)
})
},
close(type) {
clearTimeout(this.timer)
this._animation(false)
},
_animation(type) {
let styles = this.getTranfrom(type)
// #ifdef APP-NVUE
if(!this.$refs['ani']) return
animation.transition(this.$refs['ani'].ref, {
styles,
duration: this.duration, //ms
timingFunction: 'ease',
needLayout: false,
delay: 0 //ms
}, () => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
})
// #endif
// #ifndef APP-NVUE
this.transform = ''
for (let i in styles) {
if (i === 'opacity') {
this.ani.in = `fade-${type?'out':'in'}`
} else {
this.transform += `${styles[i]} `
}
}
this.timer = setTimeout(() => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
}, this.duration)
// #endif
},
getTranfrom(type) {
let styles = {
transform: ''
}
this.modeClass.forEach((mode) => {
switch (mode) {
case 'fade':
styles.opacity = type ? 1 : 0
break;
case 'slide-top':
styles.transform += `translateY(${type?'0':'-100%'}) `
break;
case 'slide-right':
styles.transform += `translateX(${type?'0':'100%'}) `
break;
case 'slide-bottom':
styles.transform += `translateY(${type?'0':'100%'}) `
break;
case 'slide-left':
styles.transform += `translateX(${type?'0':'-100%'}) `
break;
case 'zoom-in':
styles.transform += `scale(${type?1:0.8}) `
break;
case 'zoom-out':
styles.transform += `scale(${type?1:1.2}) `
break;
}
})
return styles
},
_modeClassArr(type) {
let mode = this.modeClass
if (typeof(mode) !== "string") {
let modestr = ''
mode.forEach((item) => {
modestr += (item + '-' + type + ',')
})
return modestr.substr(0, modestr.length - 1)
} else {
return mode + '-' + type
}
},
// getEl(el) {
// console.log(el || el.ref || null);
// return el || el.ref || null
// },
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
}
</script>
<style>
.uni-transition {
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: transform, opacity;
}
.fade-in {
opacity: 0;
}
.fade-active {
opacity: 1;
}
.slide-top-in {
/* transition-property: transform, opacity; */
transform: translateY(-100%);
}
.slide-top-active {
transform: translateY(0);
/* opacity: 1; */
}
.slide-right-in {
transform: translateX(100%);
}
.slide-right-active {
transform: translateX(0);
}
.slide-bottom-in {
transform: translateY(100%);
}
.slide-bottom-active {
transform: translateY(0);
}
.slide-left-in {
transform: translateX(-100%);
}
.slide-left-active {
transform: translateX(0);
opacity: 1;
}
.zoom-in-in {
transform: scale(0.8);
}
.zoom-out-active {
transform: scale(1);
}
.zoom-out-in {
transform: scale(1.2);
}
</style>

@ -0,0 +1,36 @@
export const ORDER_NAVS = [
{
name: '全部',
icon: 'icon-daifukuan',
url: '',
id: -1
},
{
name: '待支付',
icon: 'icon-daifukuan',
url: '',
id: 0
}, {
name: '待发货',
icon: 'icon-daifahuo',
url: '',
id: 1
}, {
name: '待收货',
icon: 'icon-daishouhuo1',
url: '',
id: 2
},
{
name: '已收货',
icon: 'icon-daipingjia',
url: '',
id: 3
},
// {
// name: '退款/售后',
// icon: 'icon-shouhou',
// url: '/pages/views/order/afterSaleList',
// id: 4
// },
]

4731
json.js

File diff suppressed because it is too large Load Diff

@ -0,0 +1,70 @@
import Vue from 'vue';
import App from './App';
import nodata from "./pages/commponent/public/nodata";
import request from 'utils/request.js' //引入异步请求函数
import json from './json' //测试用数据
Vue.prototype.request = request.request //挂载到全局
Vue.component("nodata", nodata);
Vue.config.productionTip = false;
Vue.mixin({
methods: {
setData: function(obj, callback) {
let that = this;
const handleData = (tepData, tepKey, afterKey) => {
tepKey = tepKey.split('.');
tepKey.forEach(item => {
if (tepData[item] === null || tepData[item] === undefined) {
let reg = /^[0-9]+$/;
tepData[item] = reg.test(afterKey) ? [] : {};
tepData = tepData[item];
} else {
tepData = tepData[item];
}
});
return tepData;
};
const isFn = function(value) {
return typeof value == 'function' || false;
};
Object.keys(obj).forEach(function(key) {
let val = obj[key];
key = key.replace(/\]/g, '').replace(/\[/g, '.');
let front, after;
let index_after = key.lastIndexOf('.');
if (index_after != -1) {
after = key.slice(index_after + 1);
front = handleData(that, key.slice(0, index_after), after);
} else {
after = key;
front = that;
}
if (front.$data && front.$data[after] === undefined) {
Object.defineProperty(front, after, {
get() {
return front.$data[after];
},
set(newValue) {
front.$data[after] = newValue;
that.$forceUpdate();
},
enumerable: true,
configurable: true
});
front[after] = val;
} else {
that.$set(front, after, val);
}
});
isFn(callback) && this.$nextTick(callback);
}
}
});
App.mpType = 'app';
const app = new Vue({
...App
});
app.$mount();

@ -0,0 +1,92 @@
{
"name" : "商城模板",
"appid" : "__UNI__8A51802",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"modules" : {},
"distribute" : {
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
"sdkConfigs" : {}
}
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wxa8d0f5e27ea959d2",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins" : {}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"h5" : {
"devServer" : {
"disableHostCheck" : true,
"proxy" : "https://mall.meituan.com"
},
"router" : {
"mode" : "history",
"base" : "./"
},
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "BIUBZ-UWKW3-FK53E-YIPVT-R4KG5-3DBA3"
}
}
},
"title" : "jiahui-yang商城模板"
}
}

@ -0,0 +1,365 @@
{
"pages": [{
"path": "pages/views/tabBar/category",
"style": {
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#FFFFFF",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/login/login",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "登录",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/login/index1",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "登录",
"app-plus": {
"titleNView": false
}
}
},
// {
// "path" : "pages/views/tabBar/category",
// "style" : {
// "navigationBarTitleText" : "分类",
// "app-plus" : {
// "titleNView" : false,
// "bounce":"none"
// }
// }
// },
{
"path": "pages/views/tabBar/cart",
"style": {
"navigationBarTitleText": "购物车",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/views/tabBar/user",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom",
"onReachBottomDistance": 50,
"app-plus": {
"bounce": "none",
"titleNView": false
}
}
},
{
"path": "pages/views/setting/index",
"style": {
"navigationBarTitleText": "设置"
}
},
{
"path": "pages/views/home/classList",
"style": {
"navigationBarTitleText": "商品列表",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/views/goods/goodsDetails",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "商品详情"
}
},
{
"path": "pages/views/goods/goodsEvaluate",
"style": {
"navigationBarTitleText": "所有评价",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/order/evaluate/evaluate",
"style": {
"navigationBarTitleText": "商品评价",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/confirmOrder",
"style": {
"navigationBarTitleText": "确认订单",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/success",
"style": {
"navigationBarTitleText": "支付结果",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false
}
}
},
{
"path": "pages/views/user/mycoupon",
"style": {
"navigationBarTitleText": "优惠券",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/user/mycollection",
"style": {
"navigationBarTitleText": "我的收藏",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/views/user/myaddress",
"style": {
"navigationBarTitleText": "收货地址",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/user/address/edit",
"style": {
"navigationBarTitleText": "编辑收货地址",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/user/mypoints",
"style": {
"navigationBarTitleText": "我的积分",
"navigationBarTextStyle": "white",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/user/exchange/exchange",
"style": {
"navigationBarTitleText": "兑换礼品",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/user/mydistribution",
"style": {
"navigationBarTitleText": "分销中心",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/views/order/orderList",
"style": {
"navigationBarTitleText": "我的订单",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/views/order/orderDetails",
"style": {
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/cancelOrder",
"style": {
"navigationBarTitleText": "申请退款",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/afterSaleList",
"style": {
"navigationBarTitleText": "退换/售后",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
},
{
"path": "pages/views/order/afterType",
"style": {
"navigationBarTitleText": "选择售后类型",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/afterSale",
"style": {
"navigationBarTitleText": "申请售后",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/location/location",
"style": {
"navigationBarTitleText": "编辑取件地址",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/afterSaleDetails",
"style": {
"navigationBarTitleText": "服务单详情",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/order/stepDetails",
"style": {
"navigationBarTitleText": "进度详情",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/withdrawal/withdrawal",
"style": {
"navigationBarTitleText": "提现",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/withdrawal/withdrawalrecord",
"style": {
"navigationBarTitleText": "提现明细",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/user/mysubordinate",
"style": {
"navigationBarTitleText": "我的下级",
"navigationBarBackgroundColor": "#F8F8F8",
"app-plus": {
"bounce": "none"
}
}
},
{
"path": "pages/views/user/extension",
"style": {
"navigationBarTitleText": "推广海报",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/home/search",
"style": {
"navigationBarTitleText": "搜索",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/home/h5map",
"style": {
"navigationBarTitleText": "选择位置",
"navigationBarBackgroundColor": "#F8F8F8"
}
},
{
"path": "pages/views/user/allFootprint",
"style": {
"navigationBarTitleText": "我的足迹",
"navigationStyle": "custom",
"app-plus": {
"titleNView": false,
"bounce": "none"
}
}
}
],
"style": "v2",
"sitemapLocation": "sitemap.json",
"tabBar": {
"backgroundColor": "#ffffff",
"borderStyle": "white",
"selectedColor": "#3B7A86",
"color": "#666666",
"list": [
// {
// "pagePath" : "pages/views/tabBar/home",
// "iconPath" : "/static/images/tabBar/home.png",
// "selectedIconPath" : "/static/images/tabBar/tab-home-green.png",
// "text" : "首页"
// },
{
"pagePath": "pages/views/tabBar/category",
"iconPath": "/static/images/tabBar/class.png",
"selectedIconPath": "/static/images/tabBar/tab-cate-green.png",
"text": "首页"
},
{
"pagePath": "pages/views/tabBar/cart",
"iconPath": "/static/images/tabBar/cart.png",
"selectedIconPath": "/static/images/tabBar/tab-cart-green.png",
"text": "购物车"
},
{
"pagePath": "pages/views/tabBar/user",
"iconPath": "/static/images/tabBar/user.png",
"selectedIconPath": "/static/images/tabBar/tab-user-green.png",
"text": "我的"
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"globalStyle": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black"
},
"subPackages": []
}

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,361 @@
<template>
<view>
<canvas class="mycanvas" canvas-id="mycanvas" :style="'width:' + (windowWidth-60) + 'px;height:520px'"></canvas>
<block>
<image class="imgs" :style="'width:' + (windowWidth-60) + 'px;height:520px'" :src="imgUrl" mode=""></image>
</block>
<!-- #ifndef H5 -->
<view class="saveImg" @tap="saveImg" :style="'background:' + colors">
保存图片
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<p class="tips">长按图片进行保存</p>
<!-- #endif -->
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
windowWidth: '',
windowHeight: '',
colors: "",
ctx: '',
imgUrl: '',
userInfo: {
name: '反转',
logo: '/static/images/face.jpg',
goodsImg: '/static/images/goods/one.jpg',
price: '3599.00',
goodsName: '魅族17 8GB+128GB 十七度灰 骁龙865 旗舰5G手机 30W快充 6400W后置主摄 90Hz屏幕 支持NFC 智能拍照游戏手机'
}
};
},
components: {
loading
},
props: {
posterData:{
type:Object
}
},
created() {
this.getSystem();
this.setData({
colors: app.globalData.newColor
});
this.setPoster();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
getSystem() {
let that = this;
uni.getSystemInfo({
success: function(res) {
console.log(res);
that.setData({
windowHeight: res.windowHeight,
windowWidth: res.windowWidth
});
}
});
},
setPoster() {
uni.showLoading({
title:'海报生成中...'
})
let ctx = uni.createCanvasContext('mycanvas', this); //
ctx.fillStyle = "#FFFFFF"
ctx.fillRect(0, 0, this.windowWidth - 60, 520)
/**
* 绘制名称
*/
const setText = (context, fs, color, x, y, c, bold) => {
context.setFillStyle(color);
context.setTextAlign('left');
if (bold) {
context.font = 'normal bold 20px Arial,sans-serif';
} else {
context.font = 'normal 20px Arial,sans-serif';
}
context.setFontSize(fs);
context.fillText(c, x, y);
context.restore();
};
setText(ctx, 14, '#333', 85, 35, this.userInfo.name, 'bold');
setText(ctx, 12, '#999', 85, 58, '为您挑选了一个好礼物');
ctx.save();
/**
* 绘制头像
*/
ctx.beginPath();
let avatar_width = 60; //
let avatar_height = 60; //
let avatar_x = 15; //x
let avatar_y = 15; //y
let radius = 8 //
//
this.setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius)
//
// this.setCircular(ctx, avatar_width, avatar_height, avatar_x, avatar_y)
//
this.setGoodsImg(ctx)
//
let pirce = ' ' + this.posterData.money
this.setGoodsPrice(ctx, 20, this.colors, 15, 410, pirce)
//
this.setGoodsName(ctx)
},
setEwm(ctx) {
console.log('生成二维码')
let code_widht = 100; //
let code_height = 100; //
let x = this.windowWidth -170
ctx.drawImage("/static/images/ewm.png", x, 410, code_widht, code_height);
setTimeout(() => { // h5
ctx.save();
ctx.draw(false,()=>{
setTimeout(()=>{
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: (res) => {
console.log(res)
this.imgUrl = res.tempFilePath
}
},this)
}, 200)
})
uni.hideLoading()
}, 1000)
},
setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius) {
/**
* 绘制圆角
*/
ctx.arc(avatar_x + radius, avatar_y + radius, radius, Math.PI, Math.PI * 3 / 2);
ctx.lineTo(avatar_width - radius + avatar_x, avatar_y);
ctx.arc(avatar_width - radius + avatar_x, radius + avatar_y, radius, Math.PI * 3 / 2, Math.PI * 2);
ctx.lineTo(avatar_width + avatar_x, avatar_height + avatar_y - radius);
ctx.arc(avatar_width - radius + avatar_x, avatar_height - radius + avatar_y, radius, 0, Math.PI * 1 / 2);
ctx.lineTo(radius + avatar_x, avatar_height + avatar_y);
ctx.arc(radius + avatar_x, avatar_height - radius + avatar_y, radius, Math.PI * 1 / 2, Math.PI);
//
ctx.strokeStyle = "#fff";
ctx.fill() //bug
ctx.clip(); //
ctx.drawImage(this.userInfo.logo, avatar_x, avatar_y, avatar_width, avatar_height);
ctx.closePath()
ctx.restore();
},
setCircular(ctx, avatar_width, avatar_height, avatar_x, avatar_y) { //
/**
* 绘制圆形
*/
// x,y false
ctx.arc(avatar_width / 2 + avatar_x, avatar_height / 2 + avatar_y, avatar_width / 2, 0, Math.PI * 2, false); //
//
ctx.strokeStyle = "#fff";
ctx.fill() //bug
ctx.clip(); //
ctx.drawImage(this.userInfo.logo, avatar_x, avatar_y, avatar_width, avatar_height);
ctx.closePath()
ctx.restore();
},
setGoodsImg(ctx) { //
let width = this.windowWidth - 90
ctx.drawImage(this.posterData.img, 15, 95, width, width);
ctx.save();
},
setGoodsPrice(ctx, fs, color, x, y, c, bold) { //
ctx.setFillStyle(color);
ctx.setTextAlign('left');
if (bold) {
ctx.font = 'normal bold 20px Arial,sans-serif';
} else {
ctx.font = 'normal 20px Arial,sans-serif';
}
ctx.setFontSize(fs);
ctx.fillText(c, x, y);
ctx.restore();
},
setGoodsName(ctx) { //
let obj = {
x: 20, //x
y: 440, //y
width: 210,
height: 20,
line: 2,
color: '#202020',
size: 14, //
align: 'left',
baseline: 'top',
text: this.posterData.title,
bold: true
};
var td = Math.ceil(obj.width / (obj.size));
var tr = Math.ceil(obj.text.length / td);
for (var i = 0; i < tr; i++) {
var txt = {
x: obj.x,
y: obj.y + (i * obj.height),
color: obj.color,
size: obj.size,
align: obj.align,
baseline: obj.baseline,
text: obj.text.substring(i * td, (i + 1) * td),
bold: obj.bold
};
if (i < obj.line) {
if (i == obj.line - 1) {
txt.text = txt.text.substring(0, txt.text.length - 3) + '......';
}
this.drawText(ctx, txt);
}
}
//
this.setEwm(ctx);
},
/**
* 渲染文字
*
* @param {Object} obj
*/
drawText: function(ctx, obj) {
console.log('渲染文字', obj)
ctx.save();
ctx.setFillStyle(obj.color);
ctx.setFontSize(obj.size);
ctx.setTextAlign(obj.align);
ctx.setTextBaseline(obj.baseline);
if (obj.bold) {
console.log('字体加粗')
ctx.fillText(obj.text, obj.x, obj.y - 0.1);
ctx.fillText(obj.text, obj.x - 0.1, obj.y);
}
ctx.fillText(obj.text, obj.x, obj.y);
if (obj.bold) {
ctx.fillText(obj.text, obj.x, obj.y + 0.1);
ctx.fillText(obj.text, obj.x + 0.1, obj.y);
}
ctx.restore();
},
saveImg() {
//
uni.showLoading({
title: '保存中...'
});
let that = this;
// #ifdef MP
uni.getSetting({
success(res) {
uni.hideLoading();
console.log(res)
if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success: (res) => {
console.log(res)
}
})
} else {
setTimeout(() => {
uni.saveImageToPhotosAlbum({
filePath: that.imgUrl,
success(re) {
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
console.log(err);
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
}, 1000);
}
}
});
// #endif
// #ifdef APP-PLUS
setTimeout(() => {
uni.saveImageToPhotosAlbum({
filePath: that.imgUrl,
success(re) {
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
console.log(err);
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
}, 1000);
// #endif
}
}
};
</script>
<style scoped>
.mycanvas {
margin: 0 auto;
border-radius: 10upx;
overflow: hidden;
}
.saveImg{
width: 70%;
height: 80upx;
line-height: 80upx;
text-align: center;
color: #fff;
background-color: #4DB8E4;
border-radius: 10upx;
margin: 40upx auto 20upx;
}
.imgs{
position: absolute;
top: 0;
left: 50%;
border-radius: 10upx;
transform: translateX(-50%);
}
.tips{
text-align: center;
color: #fff;
font-size: 24upx;
margin-top: 20upx;
}
</style>

@ -0,0 +1,107 @@
<template>
<view class="flex flex-wrap justify-center m-3">
<image :src="list[0].pic" class="w-100" style=" height: 150rpx;" mode=""></image>
<view class="flex w-100 bg-100 padding-xs" :style="{backgroundImage:'url('+bgi+')'}" mode="aspectFill" style="height: 230rpx;justify-content: space-evenly; ">
<view class="good_item h-100 bg-100 " style="width: 23%;" v-for="(item,index) in list[0].childrenResource" :key="index" :style="{backgroundImage:'url('+item.bgPic+')'}">
<image :src="item.pic" style="width: 100%; height: 65%; border-radius: 15%;" mode="aspectFill"></image>
<view class="text-white text-center">
<view class="text-sm">{{item.title}}</view>
<view class="text-xs">{{item.subTitle}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import indexBackgroundImage from "@/static/images/new/pingjia.gif"
export default {
data() {
return {
bgi:indexBackgroundImage,
list: [{
"id": 12355,
"pic": "https://p0.meituan.net/mallimages/22b17afae7865debcb8bb69606fc19ae147034.gif",
"jumpTargetType": 16,
"needClip": false,
"name": "1.18-1.19-广州年货节",
"contentType": 1,
"styleMap": {},
"bgPic": "https://p0.meituan.net/mallimages/68839887f09ca0843be0661ba84f4de111227.gif",
"childrenResource": [{
"id": 12356,
"pic": "https://p0.meituan.net/mallimages/7b69114101c5dc35ada290c89e581ce5260727.jpg",
"jumpTargetType": 16,
"targetUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2Fc0f017575182d9def2af%2F103435%2Findex.html%3FpoiId%3D1865",
"needClip": false,
"name": "",
"title": "1.89元秒杀",
"subTitle": "御寒滋补",
"contentType": 1,
"styleMap": {},
"bgPic": "https://p0.meituan.net/mallimages/fde33b41cd967b40c33cae3e3b488b9f4892.png"
},
{
"id": 12357,
"pic": "https://p0.meituan.net/mallimages/b8e703d16a7a1cb491d3374962c44d51571511.png",
"jumpTargetType": 16,
"targetUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2Ff564e719cb80c51429f3%2F103673%2Findex.html%3FpoiId%3D1865",
"needClip": false,
"name": "",
"title": "低至3.99元",
"subTitle": "甜蜜水果",
"contentType": 1,
"styleMap": {},
"bgPic": "https://p0.meituan.net/mallimages/fde33b41cd967b40c33cae3e3b488b9f4892.png"
},
{
"id": 12358,
"pic": "https://p0.meituan.net/mallimages/8773dc1fb4eb103ea36b3b3c6f57689b169059.jpg",
"jumpTargetType": 16,
"targetUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2F21556a8f83f1b45fc05f%2F103579%2Findex.html%3FpoiId%3D1865",
"needClip": false,
"name": "",
"title": "两件85折",
"subTitle": "品牌坚果",
"contentType": 1,
"styleMap": {},
"bgPic": "https://p0.meituan.net/mallimages/fde33b41cd967b40c33cae3e3b488b9f4892.png"
},
{
"id": 12359,
"pic": "https://p0.meituan.net/mallimages/39b735d7804efdcc6a32bd90cc6b925f668358.png",
"jumpTargetType": 16,
"targetUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2F5e005b672f5681df12e2%2F103679%2Findex.html%3FpoiId%3D1865",
"needClip": false,
"name": "",
"title": "买2送1",
"subTitle": "人气酒饮",
"contentType": 1,
"styleMap": {},
"bgPic": "https://p0.meituan.net/mallimages/fde33b41cd967b40c33cae3e3b488b9f4892.png"
}
]
}],
}
},
created() {
},
components: {},
props: {},
mounted() {
},
methods: {
}
}
</script>
<style>
</style>

@ -0,0 +1,197 @@
<template>
<view class="chaozhi" :style="{'background-image':'url('+ list.bgi +')'}">
<view style="height: 30%;" class="flex justify-between padding-top-xs align-center">
<view class="flex padding-l" style="width:80%;line-height: 60rpx;">
<image :src="list.logo" class="logo"></image>
<image :src="list.title" class="title"></image>
<view class="padding-left-xs text-orange text-xs">|</view>
<!-- :circular="true" 设置无缝滚动 -->
<swiper class="notice_swiper padding-left-xs" :circular="true" vertical easing-function="easeInOutCubic" autoplay interval="3000">
<swiper-item v-for="(item,index) in list.noticeList" :key="index" class="sw_item">
<text class="sw_text " style="font-weight: 900;">{{item.title}}</text>
</swiper-item>
</swiper>
</view>
<view class="radius chaozhi_button text-center margin-xs">
<view style="border: 1px solid #FFEB8F;padding:2px;border-radius: 20px;">
<text class=" border">去抢购</text> <text class="cuIcon-right text-orange"></text>
</view>
</view>
</view>
<swiper class="chaozhi_list" @change="Swiper" :circular="true" vertical easing-function="easeInOutCubic" autoplay interval="3000">
<swiper-item v-for="(item,index) in list.list_good" :key="index" class="grid col-4 ">
<view class="flex justify-center" v-for="(good_item,index) in item" :key="index">
<image :src="good_item.img" class="h-100 padding-xs sw_img" style="position: relative; padding-bottom: 30rpx;" mode="aspectFill"></image>
<view class="text-bold flex align-end" style=" position: absolute; bottom:0; margin-bottom: 10rpx;">
<view class="bg-gradual-orange text-price flex" style="border-radius: 10rpx 10rpx 0 6rpx;padding:0rpx 4rpx 0rpx 2rpx;">
<view class=" text-l" style="padding:2rpx 8rpx;" v-html="good_item.price" ></view>
</view>
<view class="oldprice text-price "v-if="good_item.oldPrice!=''">
{{good_item.oldPrice}}
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
import indexBackgroundImage from "@/static/images/new/chaozhi_bgi.png"
export default {
data() {
return {
list:{
bgi:indexBackgroundImage,
logo:'/static/images/new/chaozhi_logo.png',
title:'/static/images/new/chaozhi_title.png',
noticeList: [
{title: '32324465人正在抢购'},
{title: '宋**婷刚刚下单啦'},
{title: '尚**际刚刚下单啦'},
{title: '付**白刚刚下单啦'},
{title: '海**海刚刚下单啦'}
],
sw_select:0,
list_good:[
{img:"https://p0.meituan.net/mallimages/2fd33f00df1266428c446ab0544f170b105276.jpg",price:"9.5",oldPrice:"",},
{img:"https://p0.meituan.net/mallimages/2bf56ad37cd865c9b936de355ac703da291588.jpg",price:"2.5",oldPrice:"3.0",},
{img:"https://p0.meituan.net/mallimages/9a4786e764d0f53318a42d0df8628e7f516056.png",price:"9.99",oldPrice:"12.0",},
{img:"https://p0.meituan.net/mallimages/965103a1fe16a42ce9e9e525382490be247677.jpg",price:"7.9",oldPrice:"9.0",},
{img:"https://p0.meituan.net/mallimages/d4bfebff42d203e6ef8df97dc9c4c53e243115.jpg",price:"19.9",oldPrice:"23.5",},
{img:"https://p0.meituan.net/mallimages/f724bb1033b0bf84ddda34a72af89468302986.jpg",price:"6.99",oldPrice:"",},
{img:"https://p1.meituan.net/mallimages/f9d4e9fd6e59a028f95461fcac070926829853.png",price:"0.99",oldPrice:"1.5",},
{img:"https://p0.meituan.net/mallimages/5c71f2f5a30ea1ba19e0261796abbb4760368.jpg",price:"0.99",oldPrice:"1.2",}
],
},
};
},
created() {
},
components: {},
props: {
},
mounted(){
//
this.arrgood()
},
methods: {
//
arrgood(){
for(var i=0;i< this.list.list_good.length;i++){
var price = this.list.list_good[i].price
let splitPrice = price.split(".");
//2.
this.list.list_good[i].price = `${splitPrice[0]}.<span style="font-size:12px;">${splitPrice[1]}</span>`;
}
this.list.list_good = this.arrTrans(4,this.list.list_good);
},
Swiper(e) {
this.sw_select = e.detail.current
},
arrTrans(num, arr) { //
const iconsArr = []; //
arr.forEach((item, index) => {
const page = Math.floor(index / num); //
if (!iconsArr[page]) { //
iconsArr[page] = [];
}
iconsArr[page].push(item);
});
return iconsArr;
}
}
};
</script>
<style>
.chaozhi{
width: 94%;
height: 285upx;
background-size: 100% 100%;
margin: 0 3%;
padding-bottom: 20rpx;
}
.logo{
width: 65rpx;
height: 65rpx;
}
.title{
width: 140rpx;
height: 60rpx;
}
.notice_swiper{
width: 50%;
height: 50upx;
}
.notice_swiper .sw_item{
height: 80upx;
}
.notice_swiper .sw_item .sw_text{
font-size: 24upx;
color: #EE5D37;
display: inline-block;
}
.notice_swiper .sw_image{
width: 40upx;
height: 40upx;
float: right;
margin-top: 20upx;
}
.chaozhi_button{
width: 17%;
height: 50rpx;
text-align: center;
background: linear-gradient(155deg, #fffbeb 0%, #FFEB8F 100%);
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin-right: 3%;
font-size: 13px;
color: #FF3B3B;
}
.chaozhi_list{
height: 70%;
background-color: #FFFFFF;
margin: 10rpx;
border-radius: 10rpx;
}
.sw_img{
position: relative;
}
.text-price::before{padding-top: 10%;padding-left: 5%;margin-right:0;}
.oldprice{
background-color: #FFE26A;
color: #9D4900;
text-decoration: line-through;
font-size: 12px;
padding-right: 10rpx;
border-radius: 0 10rpx 6rpx 0;
}
</style>

@ -0,0 +1,170 @@
<template>
<view class="category-list">
<view v-for="(item, index) in homepageCategoryList" :key="index" class="category" @tap="jumpList(item)">
<view class="class_img"><image :class="item.jumpTargetType==16? 'mix':''" :src="item.iconUrl" class="imgs "></image></view>
<view class="text" :style="item.jumpTargetType==16? 'font-size:11px':''" >{{ item.name }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
"homepageCategoryList": [
{
"iconUrl": "https://p0.meituan.net/mallimages/7725f825efb14c613a7ef53882bf2fc342550.png",
"name": "蔬菜豆制品",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40488",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/65a404f1fb66da5eae1b43adac8794da41080.png",
"name": "肉禽蛋",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40581",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/2a9d96c2b396d97e425d60e182a5a8da13882.png",
"name": "海鲜水产",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40652",
"jumpTargetType": 3,
"bubble": {
"id": 1011,
"type": 1,
"text": "抢波龙",
"priority": 1,
"utime": 1610624525256
}
},
{
"iconUrl": "https://p0.meituan.net/mallimages/8bf2a444e426d0205f1e7a50a034e2d234560.png",
"name": "水果",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40532",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/6a5bba31dd8720e66ac5c90399b647f430483.png",
"name": "乳品烘焙",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40461",
"jumpTargetType": 3
},
{
"iconUrl": "https://p1.meituan.net/mallimages/752d4d5ed15ea9b418268dbbb58f730838543.png",
"name": "速食冻品",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40478",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/cc71321c6617da6b7b941763208a011332548.png",
"name": "粮油调味",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40472",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/ac948daefceb0c71735868d1accbe22031714.png",
"name": "酒水饮料",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40455",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/a59a09667218f46722803f78ef720e5910801.png",
"name": "休闲零食",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40485",
"jumpTargetType": 3
},
{
"iconUrl": "https://p1.meituan.net/mallimages/4f6e7f3657a9741571ad809c021ad98b48763.png",
"name": "餐饮熟食",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40916",
"jumpTargetType": 3
},
{
"iconUrl": "https://p0.meituan.net/mallimages/61c91165616fcecb6148f841b35c85c46003.png",
"name": "年货大街",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=41755",
"jumpTargetType": 16
},
{
"iconUrl": "https://p0.meituan.net/mallimages/5d24618a6160c550ccfe13942ba620c36288.png",
"name": "美团奶站",
"jumpUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2Fe7b70154317467246531%2F93534%2Findex.html%3FpoiId%3D1865",
"jumpTargetType": 16
},
{
"iconUrl": "https://p1.meituan.net/mallimages/4799fc4c5ed9e7b06e3eb01d5f73ae0432224.png",
"name": "打边炉",
"jumpUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2F56eae497a65b9470558c%2F97032%2Findex.html%3FpoiId%3D1865",
"jumpTargetType": 16
},
{
"iconUrl": "https://p0.meituan.net/mallimages/adf27d98c79b4ee210381b85bdb0121228333.png",
"name": "煲靓汤",
"jumpUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2F121e7c13425aa76e8d97%2F97034%2Findex.html%3FpoiId%3D1865",
"jumpTargetType": 16
},
{
"iconUrl": "https://p0.meituan.net/mallimages/36d8e40e80ead870bce26f6a5311c4996010.png",
"name": "家居个护",
"jumpUrl": "imaicai://www.maicai.com/category_list?category_id=40482",
"jumpTargetType": 16
}
],
};
},
props: {
},
methods: {
jumpList(item) {
uni.navigateTo({
url: '/pages/views/home/classList?classId=' + item.id
});
}
}
};
</script>
<style scoped lang="scss">
.category-list {
width: 94%;
margin: 0 3%;
padding: 0 0 30upx 0;
border-bottom: solid 2rpx #f6f6f6;
display: flex;
flex-wrap: wrap;
box-shadow: 0upx 0upx 10rpx #d0d0d0;
margin-top: 20upx;
border-radius: 10upx;
}
.category {
width: 20%;
margin-top: 50upx;
display: flex;
flex-wrap: wrap;
}
.category:active{
opacity: 0.8;
}
.category .class_img {
width: 100%;
display: flex;
justify-content: center;
.imgs {
width: 12vw;
height: 12vw;
}
}
.mix{
width: 9vw !important;
height: 9vw !important;
}
.text {
margin-top: 16upx;
width: 100%;
display: flex;
justify-content: center;
font-size: 24upx;
color: #3c3c3c;
font-weight: 500;
}
</style>

@ -0,0 +1,179 @@
<template>
<view class="grid col-2 h-100 m-3 justify-between" style=" height: 500rpx;margin-top: 20rpx;box-shadow: 0px 0px 5px #d0d0d0;border-radius: 20rpx;">
<view class="flex flex-wrap item" v-for="(item,index) in tileList" :key="index" style="flex-direction: row; justify-content: space-between;">
<view class="w-100 text-lg">{{item.title}}</view>
<view class="w-100 text-sm" v-if="item.subTitle" :style="{color:item.subTitleColor}">{{item.subTitle}}</view>
<view class="grid col-2 w-100">
<view class="w-100 " v-for="(good,index) in item.itemList" :key="index">
<image style="height: 120rpx; " :src="good.picUrl" mode="aspectFit"></image>
<view class="padding-left-xs">
<text v-if="good.sellPrice" class="text-bold" style="color: #FF1929;">{{good.sellPrice.text}}</text>
<text v-if="good.dashPrice" class="text-gray text-xs padding-left-xs" style="text-decoration: line-through;">{{good.dashPrice.text}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tileList: [
{
"tileId": 0,
"title": "秒杀",
"jumpUrl": "imaicai://www.maicai.com/web?wkwebview=1&future=1&url=https%3A%2F%2Fmall.meituan.com%2Ffe%2Fc%2Factivity%2Fseckill.html",
"appletJumpUrl": "",
"subjectId": 0,
"position": 3,
"titleColor": "#121924",
"subTitleColor": "#FF1929",
"tagPic": "",
"itemList": [
{
"skuId": 75121,
"picUrl": "https://p1.meituan.net/mallimages/afc8635ad295f03c99d50945f35544e0158519.jpg",
"tagType": 4,
"sellPrice": {
"text": "¥22.7"
},
"dashPrice": {
"text": "¥25.9",
"styleId": "dp"
},
"baseCategoryId": 57
},
{
"skuId": 92874,
"picUrl": "https://p0.meituan.net/mallimages/ce107e631de932c7a572f9bfd7fe296c240498.png",
"tagType": 4,
"sellPrice": {
"text": "¥7.7"
},
"dashPrice": {
"text": "¥11.8",
"styleId": "dp"
},
"baseCategoryId": 23
}
],
"tagType": 4,
"seckillVO": {
"timeInterval": 1610985599000,
"seckillingType": 1
},
"jumpTargetType": 10
},
{
"tileId": 1152,
"title": "新品发现",
"subTitle": "精选好货抢鲜购",
"jumpUrl": "imaicai://www.maicai.com/web?wkwebview=1&url=https%3A%2F%2Fmall.meituan.com%2Ffe%2Fc%2Fseasonal-skus.html",
"appletJumpUrl": "",
"subjectId": 0,
"position": 5,
"titleColor": "#121924",
"subTitleColor": "#CC6A00",
"tagPic": "",
"itemList": [{
"skuId": 61006,
"picUrl": "https://p0.meituan.net/mallimages/275b1af3fc453162b7e405ceb38c4806241570.jpg",
"tagType": 1,
"baseCategoryId": 311
},
{
"skuId": 1949,
"picUrl": "https://p1.meituan.net/waimaidpoipicmining/ea9cff3d5456a862eb23e03f9f704b1a102360.jpg",
"tagType": 1,
"baseCategoryId": 448
}
],
"tagType": 1,
"jumpTargetType": 27
},
{
"tileId": 1156,
"title": "品质肉蛋",
"subTitle": "猪汤骨17.9元",
"jumpUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2F8d3f7baded5060a2964b%2F103729%2Findex.html%3FpoiId%3D2423",
"appletJumpUrl": "",
"subjectId": 0,
"position": 6,
"titleColor": "#121924",
"subTitleColor": "#158A50",
"tagPic": "",
"itemList": [{
"skuId": 93724,
"picUrl": "https://p1.meituan.net/mallimages/4c7592faa7245c9518779b2ed036ca6f959671.png",
"tagType": 1,
"baseCategoryId": 568
},
{
"skuId": 84873,
"picUrl": "https://p1.meituan.net/mallimages/c8dfdf4fb55a839b61f25640287e2bee277992.png",
"tagType": 1,
"baseCategoryId": 55
}
],
"tagType": 1,
"jumpTargetType": 16
},
{
"tileId": 1155,
"title": "大寒节气餐单",
"subTitle": "应季而食必吃榜",
"jumpUrl": "imaicai://www.maicai.com/web?future=1&url=https%3A%2F%2Fi.meituan.com%2Fawp%2Fhfe%2Fblock%2Fe9105f026a8f066445b0%2F103559%2Findex.html%3FpoiId%3D2423",
"appletJumpUrl": "",
"subjectId": 0,
"position": 7,
"titleColor": "#121924",
"subTitleColor": "#FF1929",
"tagPic": "",
"itemList": [{
"skuId": 74132,
"picUrl": "https://p1.meituan.net/mallimages/d4ca8cb05b0f8bdce33c11a657c222d591452.jpg",
"tagType": 1,
"baseCategoryId": 36
},
{
"skuId": 67612,
"picUrl": "https://p0.meituan.net/mallimages/92ee6d6f97d72a79af056df53fcfcce5152802.jpg",
"tagType": 1,
"baseCategoryId": 39
}
],
"tagType": 1,
"jumpTargetType": 16
}
],
}
}
}
</script>
<style>
.item{
position: relative;
padding: 15rpx 15rpx;
}
.item:after{
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
width: 200%;
height: 200%;
border-right: 1px solid rgba(0,0,0,.1);
border-bottom: 1px solid rgba(0,0,0,.1);
border-radius: inherit;
content: " ";
-webkit-transform: scale(.5);
transform: scale(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
pointer-events: none;
}
</style>

@ -0,0 +1,364 @@
<template>
<view class="goodList">
<view v-for="(item, index) in list" :key="index" class="goods">
<view class="top" @tap="jumpDetails(item)">
<image class="cover" lazy-load="true" :src="item.url" mode="scaleToFill"></image>
</view>
<view class="bottom padding-lr-sm" >
<!-- <view v-if="item.goodsName" class="text-xs good_skuSubTitle" style="color: #009125;">
{{item.goodsName}}
</view> -->
<view class="goods_name text-df">
{{item.goodsName}}
</view>
<!-- <view v-if="item.goodsName" class="text-sm good_skuSubTitle padding-bottom-xs" style="color: #D5A94D;">
{{item.goodsName}}
</view> -->
<view>
<!-- <text class="tag1" v-if="item.skuItem.v2Tags&&item.skuItem.v2Tags[0].styleText&&item.skuItem.v2Tags[0].tagType==0">
{{item.skuItem.v2Tags[0].styleText.text}}
</text>
<view class="" style="width: 82rpx; height: 30rpx;" v-else-if="item.skuItem.v2Tags&&item.skuItem.v2Tags[0].image&&item.skuItem.v2Tags[0].tagType==1">
<image :src="item.skuItem.v2Tags[0].image.url" class="w-100 h-100" mode="aspectFit"></image>
</view> -->
</view>
<view class="goumai margin-top-xs flex justify-between align-center">
<view class="g_left price">
<text v-if="item.price" class="text1 text-bold text-sm"> {{item.price}} </text>
<text style="color: #222">/{{ item.unit}}</text>
<!-- <text v-if="item.skuItem.dashPrice" class="text2 text-xs"> {{item.skuItem.dashPrice.text}}</text> -->
</view>
<!-- <view class="g_right" @tap="addCart(item)">
<image src="/static/images/new/jiagou.png" style=" width: 28px;height: 28px;" mode="aspectFill"></image>
</view> -->
</view>
</view>
<!-- <view v-if="item.type==4" class="cboardVO padding-xs" :style="{backgroundImage:'url('+item.cboardVO.cboardBackGroundPic.url+')'}">
<view class="padding-left-sm w-100" style="height: 20%;">
<image :src="item.cboardVO.cboardNamePic.url" style="width: 75%;height:50%;" mode="aspectFit"></image>
<view class="text-white text-sm" style="height: 40%;">{{item.cboardVO.cboardDesc.text}}</view>
</view>
<view class="bg-white w-100 flex flex-direction justify-around padding-sm " style="height: 80%;border-radius: 4%;" >
<view class="flex" style="height: 30%;position: relative;" v-for="(good_item ,index) in item.cboardVO.cboardTabVO.skuItems">
<view class="h-100" style="width: 50%;">
<image :src="good_item.picUrl" style="width: 100%;" class="h-100" mode="aspectFit"></image>
<image :src="'/static/images/new/tag'+index+'.png'" class="cboardVO_tag" mode="aspectFit"></image>
</view>
<view class="h-100 flex flex-wrap flex-direction justify-center" style="width: 50%;">
<view class="w-100 priceColor">{{good_item.sellPrice.text}}</view>
<view class="w-100 text-gray text-sm padding-top-xs">日售{{good_item.dailySales}}</view>
</view>
</view>
</view>
</view> -->
</view>
<view class="place">
</view>
</view>
</template>
<script>
import { setTabBarBadge } from '@/utils/util.js'
import {getCart, setCart ,resetCart, getCartNumber,setGoodsData, setGoodsHistory, setCartDetails, setGoodsDetails,getToken} from '@/utils/auth.js'
export default {
data() {
return {
good_data:{
number: 1,
imgList:[],
selectSku:{},
sku: [{
sku_id: 1,
skuname: '规格',
child: [{
tagname: '测试规格1',
id: 2011,
imgs: '',
money: ''
},
{
tagname: '测试规格2',
id: 2012,
imgs: '',
money: ''
}
]
}],
skuArr: [{
goods_sku_arr: ['2011'],
goods_sku_text: '醇黑巧克力【20枚】',
img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78',
stock: 345
},
{
goods_sku_arr: ['2012'],
goods_sku_text: '草莓味【8枚】',
img: 'http://img11.360buyimg.com/n1/jfs/t1/74434/3/6892/331750/5d512febE54e891c4/0096ad20c3c20d23.jpg',
money: '35.90',
stock: 255
},
]
},
list: [],
}
},
props:{
propsList:{
type:Array
}
},
created() {
// if(this.propsList){
// this.list = this.propsList
// }
},
watch: {
propsList: function(newVal,oldVal){
console.log('newVal', newVal)
this.list = newVal; //newValchartData
}
},
methods: {
jumpDetails(item) {
setGoodsHistory(item)
setGoodsDetails(item)
uni.navigateTo({
url: '/pages/views/goods/goodsDetails?id=' + item.id
});
},
addCart(e) {
console.log(e)
//
if(!getToken()){
uni.navigateTo({ //
url:'/pages/login/index1'
})
return
}
setCartDetails(e.skuItem)
setGoodsDetails(e.skuItem)
var data = this.good_data
data.status= 0;
data.img = e.skuItem.picUrl;
data.title = e.skuItem.skuTitle.text;
data.money = parseFloat(e.skuItem.sellPrice.text.substr(1));
data.imgList.push(e.skuItem.picUrl);
data.imgList.push(e.skuItem.detailPagePic);
data.xiaoliang = e.skuItem.skuId;
data.goods_id = e.skuItem.skuId;
if(data.skuArr){
let sku = data.skuArr
for(let i=0;i<sku.length;i++){
sku[i].img = data.img
sku[i].goods_sku_text = data.title+"测试规格"+i;
sku[i].money = data.money
}
}
if(data.sku){
let sku = data.sku[0].child
for(let i=0;i<sku.length;i++){
sku[i].imgs = data.img
sku[i].tagname = data.title+"测试规格"+i;
sku[i].money = data.money
}
}
data.selectSku.goods_sku_text = data.skuArr[0].goods_sku_text
data.selectSku.img = data.skuArr[0].img
data.selectSku.money = data.skuArr[0].money
let colCart = getCart();
if(colCart.length){
const hasItem = colCart.some(v => v.goods_id === data.goods_id)
if (!hasItem) {
colCart.push(data)
} else {
for(let y = 0;y < colCart.length; y++){
const item = colCart[y]
if (data.goods_id === item.goods_id) {
item.number ++
break
}
}
}
} else {
colCart = [data]
}
resetCart(colCart)
/**
* 模拟获取购物车的数量 getCart
*/
// let cartNum = getCart()
setTabBarBadge(colCart.length)
//
uni.showToast({
title: '加入购物车成功 !',
icon: 'none'
});
},
},
}
</script>
<style scoped lang="scss">
.good_skuSubTitle {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.goodList {
padding: 20rpx;
column-count: 2;
/*分为两列 用于瀑布流*/
column-gap: 20rpx;
background: #F8F8F8;
overflow: hidden;
}
.tag1 {
font-size: 20rpx;
border: 1px solid #FF5560;
color: #FF5560;
border-radius: 15%;
padding: 0 4rpx;
}
.cboardVO{
height: 65vw;
background-size: 100% 100%;
}
.cboardVO_tag{
width: 50rpx;height: 50rpx;position: absolute;
left: 0;top: 0;
}
.loading {
height: 80upx;
line-height: 80upx;
text-align: center;
color: #ccc;
font-size: 24upx;
width: 100%;
margin-bottom: 20upx;
}
.goods {
height: 100%;
overflow: auto;
margin-bottom: 20upx;
break-inside: avoid;
/*用于瀑布流*/
border-radius: 10upx;
box-sizing: content-box;
&:first-child {
margin-top: 0;
}
}
.goods .top {
width: 100%;
height: 0;
padding-bottom: 100%;
position: relative;
overflow: hidden;
background-color: #ffffff;
}
.top .cover {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
}
.top .tags {
width: 65upx;
height: 65upx;
position: absolute;
top: 0;
left: 0;
}
.bottom {
background-color: #ffffff;
overflow: hidden;
}
.goods_name {
/* height: 66upx; */
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
font-weight: bold;
line-height: 48rpx;
}
.bottom .price .text1 {
font-size: 36upx;
font-weight: bold;
color: $mycolor;
}
.bottom .price .text2 {
font-size: 22upx;
color: #a0a0a0;
text-decoration: line-through;
padding-left: 15upx;
}
.g_left {
font-size: 24upx;
align-items: center;
}
.g_left text {
display: inline-block;
height: 35upx;
line-height: 35upx;
border-radius: 10upx;
color: $mycolor;
}
.g_right {
font-size: 28upx;
color: $mycolor;
}
</style>

@ -0,0 +1,419 @@
<template>
<view class="header">
<!-- 头部 -->
<!-- #ifdef APP-PLUS -->
<div class="status-bar" :style="{height:statusBarHeight+'px'}"></div>
<!-- #endif -->
<view class="place">
</view>
<view style="position: absolute;top: 0;right: 3%;left: 3%;z-index: 99;">
<view class="text-lg">
<view class="left" @tap="nearAddress">
<image src="/static/images/home/weizhi.png"></image>
<view style="font-weight: 800;">{{'送至:'+city || '请选择位置'}} <text class="cuIcon-right" style="padding-left:10upx">
</text>
</view>
</view>
<view class="right" v-if="weatherName && weatherName!==''">
<image :src="todyWeather.img"></image>
<text>{{ weatherName }} /{{ high }}</text>
</view>
</view>
<!-- 搜索 -->
<search style="width: 100%;"></search>
</view>
<!-- 轮播图 -->
<swiper class="screen-swiper square-dot" :indicator-dots="false" :circular="true" :autoplay="true" interval="5000"
duration="500" @change="Swiper">
<swiper-item v-for="(item,index) in swiperList" :key="index">
<image :src="item.img" mode="aspectFill"></image>
</swiper-item>
</swiper>
<view class="indicator">
<view v-for="(item, index) in swiperList" :key="index" :class="currentSwiper == index ? 'on' : 'dots'"></view>
</view>
</view>
</template>
<script>
import qqmapsdk from "../../../utils/qqmap-wx-jssdk.min";
import search from "../public/search";
import {
hfKey,
txMapKey
} from '../../../utils/keys.js'
export default {
data() {
return {
currentSwiper: 0,
city: '北京',
weatherData: [{
type: '阴',
img: "/static/images/weather/yin.png"
}, {
type: '晴',
img: "/static/images/weather/qing.png"
}, {
type: '多云',
img: "/static/images/weather/duoyun.png"
}, {
type: '雨',
img: "/static/images/weather/xiaoyu.png"
}, {
type: '小雨',
img: "/static/images/weather/xiaoyu.png"
}, {
type: '中雨',
img: "/static/images/weather/xiaoyu.png"
}, {
type: '大雨',
img: "/static/images/weather/dayu.png"
}, {
type: '暴雨',
img: "/static/images/weather/leiyu.png"
}, {
type: '雷阵雨',
img: "/static/images/weather/leiyu.png"
}, {
type: '雨夹雪',
img: "/static/images/weather/xiaoxue.png"
}, {
type: '雪',
img: "/static/images/weather/xue.png"
}, {
type: '小雪',
img: "/static/images/weather/xue.png"
}, {
type: '中雪',
img: "/static/images/weather/xiaoxue.png"
}, {
type: '大雪',
img: "/static/images/weather/daxue.png"
}],
high: '',
weatherName: '',
latitude: '',
longitude: '',
todyWeather: {},
statusBarHeight: 20
};
},
components: {
search
},
props: {
colors: {
type: String
},
locations: {
type: Object
},
swiperList: {
type: Array
},
},
created() {
console.log('key', hfKey, txMapKey)
// #ifndef H5
this.getUserPosition();
// #endif
// #ifdef H5
if (this.locations.latlng) {
this.latitude = this.locations.latlng.lat || ''
this.longitude = this.locations.latlng.lng || ''
this.city = this.locations.poiname
this.getWeather(this.latitude, this.longitude);
}
// #endif
},
watch: {
locations(value) {
this.latitude = this.locations.latlng.lat || ''
this.longitude = this.locations.latlng.lng || ''
this.city = this.locations.poiname
this.getWeather(this.latitude, this.longitude);
}
},
mounted() {
},
methods: {
//
Swiper(e) {
// console.log(e)
this.currentSwiper = e.detail.current
},
getUserPosition() {
/**
* 在这里执行获取用户的位置
*/
//
let that = this;
uni.getLocation({
type: 'wgs84',
geocode: true,
success: res => {
console.log('获取经纬度成功', res);
that.setData({
latitude: res.latitude,
longitude: res.longitude
});
},
fail: () => {
that.setData({
latitude: '',
longitude: ''
});
},
complete: () => {
//
that.getCity();
}
});
},
getCity() {
const QQMapWX = new qqmapsdk({
// key
key: txMapKey
});
let that = this;
QQMapWX.reverseGeocoder({
location: {
latitude: that.latitude,
longitude: that.longitude
},
success: function(res) {
console.log('解析地址成功', res);
let province = res.result.ad_info.province; //
let city = res.result.address;
that.setData({
city: city
});
let position = {};
position.lat = that.latitude;
position.lng = that.longitude;
position.name = city;
that.getWeather(that.latitude, that.longitude);
},
fail: function(res) {
console.log(res);
},
complete: function(res) {
console.log(res);
}
});
},
getWeather(la, lo) { //
let url = 'https://free-api.heweather.net/s6/weather/now?key=' + hfKey + '&location=' + lo + ',' + la;
uni.request({
url: url,
method: 'GET',
success: res => {
console.log(res);
let today = res.data.HeWeather6[0].now; //
let h = today.fl;
this.setData({
high: h,
//
weatherName: today.cond_txt
});
this.weatherData.forEach(e => {
if (e.type == today.cond_txt) {
this.setData({
todyWeather: e
});
}
});
if (this.todyWeather.type == '' || !this.todyWeather.type) {
let data = this.weatherData[0];
this.setData({
todyWeather: data
});
}
},
fail: () => {},
complete: () => {}
});
},
nearAddress() { //
// #ifdef MP
const _this = this; //
uni.getSetting({
success(res) {
if (res && res.authSetting && res.authSetting.hasOwnProperty('scope.userLocation')) {
uni.openSetting({
success() {
_this.getUserPosition();
}
});
}
}
});
// #endif
// #ifdef H5
uni.navigateTo({
url: '/pages/views/home/h5map'
})
// #endif
},
swiperChange(e) {
this.setData({
currentSwiper: e.detail.current,
});
}
}
};
</script>
<style scoped lang="scss">
.header {
line-height: 80upx;
overflow: hidden;
color: #fff;
position: relative;
}
.place {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, .3), rgba(255, 255, 255, .5), #ffffff);
}
.left {
color: #333;
float: left;
height: 80upx;
color: #fff;
display: flex;
align-items: center;
align-items: center;
z-index: 800;
}
.left image {
width: 30upx;
height: 30upx;
float: left;
margin-right: 6upx;
}
.left view {
width: 60vw;
height: 40upx;
line-height: 40upx;
position: relative;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.right {
height: 80upx;
float: right;
font-size: 26upx;
display: flex;
align-items: center;
}
.right image {
width: 40upx;
height: 40upx;
}
.right text {
margin-left: 10upx;
}
.swiper {
width: 100%;
margin-top: 10upx;
display: flex;
justify-content: center;
}
.swiper-box {
width: 100%;
height: 45vw;
overflow: hidden;
/* border-radius: 15upx; */
/* box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2); */
position: relative;
z-index: 1;
}
.swiper-box swiper {
width: 100%;
height: 45vw;
}
.swiper-box swiper swiper-item {
display: flex;
align-items: center;
justify-content: center;
}
.swiper-box swiper swiper-item image {
width: 95%;
height: 45vw;
margin: 0 auto;
display: block;
border-radius: 10px;
transition: height .3s;
}
.swiper-item-side {
width: 95%;
height: 40vw !important;
transition: height .3s;
}
.indicator {
position: absolute;
bottom: 20upx;
left: 20upx;
right: 20upx;
// background-color: rgba(255, 255, 255, 0.4);
border-radius: 3upx;
overflow: hidden;
display: flex;
justify-content: center;
}
.dots {
width: 12upx;
height: 12upx;
border-radius: 100%;
margin: 0 10upx;
background-color: rgba(255, 255, 255, 0.4);
transition: all 0.3s ease-out;
}
.on {
width: 30upx;
height: 12upx;
border-radius: 20upx;
margin: 0 10upx;
background-color: rgba(255, 255, 255, 1);
transition: all 0.3s ease-out;
}
</style>

@ -0,0 +1,503 @@
<template>
<view style="background: #F8F8F8;overflow: hidden;">
<!-- 宫格类样式 -->
<view class="recommend_goods" v-if="modes == true">
<view v-for="(item, index) in newList" :key="index" class="goods">
<view class="top" @tap="jumpDetails(item)" >
<image class="cover" lazy-load="true" :src="item.img" mode="scaleToFill"></image>
<image class="tags" lazy-load="true" v-if="item.baoyou" :src="tagImg[0]"></image>
</view>
<view class="bottom">
<view class="goods_name" @tap="jumpDetails(item)">
{{item.title}}
</view>
<view class="price">
<text class="text1"> {{item.money}}</text>
<text class="text2"> {{item.hmoney}}</text>
</view>
<view class="goumai">
<view class="g_left">
<text v-if="item.youhui == true" >优惠券</text>
<text v-if="item.baoyou == true" >包邮</text>
</view>
<view class="g_right" @tap="addCart(item)">
<text class="iconfont icon-gouwuche"></text>
</view>
</view>
</view>
</view>
<view class="place">
</view>
</view>
<!-- 列表类样式 -->
<view class="list_mode" v-if="modes == false">
<view class="goods_list" v-if="newList.length !== 0">
<view v-for="(item, index) in newList" :key="index" class="goods_item">
<image :src="item.img" lazy-load="true" @tap="jumpDetails(item)"></image>
<!-- 商品标签 -->
<image class="tags" :src="tagImg[item.type-1]"></image>
<view class="goods_right">
<view class="goods_name" @tap="jumpDetails(item)">{{item.title}}</view>
<view class="numbers">
<text v-if="item.youhui == true" >优惠券</text>
<text v-if="item.baoyou == true" >包邮</text>
</view>
<view class="price">
<text class="money">{{item.money}}</text>
<text class="hx_money">{{item.hmoney}}</text>
<text class="iconfont icon-gouwuche gouwuche" @tap="addCart(item)"></text>
</view>
</view>
</view>
</view>
</view>
<nodata :colors="colors" title="暂无分类商品" v-if="newList.length == 0"></nodata>
<view class="loading" v-if="loading == true">...</view>
<view class="loading" v-if="loading == false"> </view>
<!-- 选择规格 -->
<sku :skuList="nowList" :showModal="showModal" :colors="colors" @onhide="onhide" :bottoms="bottoms"></sku>
</view>
</template>
<script>
const app = getApp();
import {setCart, getCart} from '@/utils/auth.js'
import sku from '../public/sku.vue'
export default {
components:{
sku
},
data() {
return {
showModal: false,
nowList: {},
newList: [],
sku: "",
tagImg:[
'/static/images/home/five.png',
],
};
},
props: {
colors: {
type: String
},
dataList: {
type: Array
},
modes: {
//
type: Boolean,
default: true
},
loading:{
type:Boolean,
default: true
},
bottoms:{
type:String,
default: '0'
}
},
created() {
this.setDataList(this.dataList)
},
watch:{
dataList(value){
this.setDataList(value)
}
},
methods: {
setDataList(newVal){
const newList = [].concat(...Array.from(newVal.reduce((total, cur, index) => { //
total[index % 2].push(cur);
return total;
}, {
0: [],
1: [],
length: 2
})));
this.setData({
newList: newList
});
},
onhide(){
this.showModal = false
},
addCart(item) {
//
console.log('点击了',item)
this.showModal = true
this.nowList = item
},
jumpDetails(e) {
uni.navigateTo({
url: '/pages/views/goods/goodsDetails'
});
}
}
};
</script>
<style scoped lang="scss">
.recommend_goods {
padding: 20upx;
column-count: 2; /*分为两列 用于瀑布流*/
column-gap: 20upx;
}
.loading{
height: 80upx;
line-height: 80upx;
text-align: center;
color: #ccc;
font-size: 24upx;
width: 100%;
margin-bottom: 20upx;
}
.goods {
height: 100%;
overflow: auto;
margin-bottom: 20upx;
break-inside: avoid; /*用于瀑布流*/
border-radius: 10upx;
box-sizing: content-box;
&:first-child{
margin-top: 0;
}
}
.goods .top {
height: 45vw;
overflow: hidden;
position: relative;
background-color: #ffffff;
}
.top .cover {
width: 100%;
height: 100%;
display: flex;
align-items: center;
}
.top .tags {
width: 65upx;
height: 65upx;
position: absolute;
top: 0;
left: 0;
}
.bottom {
padding: 15upx;
background-color: #ffffff;
overflow: hidden;
}
.goods_name {
/* height: 66upx; */
font-size: 24upx;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
font-weight: bold;
}
.bottom .price{
margin-top: 15upx;
}
.bottom .price .text1{
font-size: 32upx;
font-weight: bold;
color: $mycolor;
}
.bottom .price .text2{
font-size: 22upx;
color: #a0a0a0;
text-decoration: line-through;
padding-left: 15upx;
}
.goumai{
margin-top: 10upx;
}
.g_left{
font-size: 24upx;
float: left;
align-items: center;
}
.g_left text{
display: inline-block;
height: 35upx;
line-height: 35upx;
padding: 0 10upx;
background-color: #FAEFF7;
border-radius: 10upx;
margin-right: 20upx;
color: $mycolor;
}
.g_right{
float: right;
font-size: 28upx;
color: $mycolor;
}
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 900;
opacity: 0.7;
}
.sku{
width: 100vw;
min-height: 30vh;
position: fixed;
bottom: -100%;
z-index: 910;
left: 0;
background-color: #ffffff;
padding: 20upx 4%;
border-top-left-radius: 10upx;
border-top-right-radius: 10upx;
border-bottom: 1upx solid #eee;
transition: all 0.3s;
}
.shows{
/* #ifdef MP */
bottom: 0!important;
/* #endif */
/* #ifdef H5 */
bottom: 100upx!important;
/* #endif */
transition: all 0.3s;
}
.sku_top{
overflow: hidden;
}
.sku_top image{
height: 170upx;
width: 170upx;
float: left;
margin-right: 15upx;
border-radius: 8upx;
}
.sku_top .sku_title{
font-size: 24upx;
line-height: 35upx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
font-weight: bold;
}
.sku_top .moneys{
font-size: 28upx;
line-height: 40upx;
overflow: hidden;
margin-top: 20upx;
}
.sku_top .kucun{
font-size: 24upx;
color: #999;
overflow: hidden;
}
.sku_list{
margin-top: 20upx;
overflow: hidden;
margin-bottom: 40upx;
}
.sku_name{
font-size: 24upx;
color: #666;
overflow: hidden;
}
.sku_tag{
overflow: hidden;
margin-top: 20upx;
}
.sku_tag .tag_s{
height: 50upx;
line-height: 50upx;
padding: 0 20upx;
text-align: center;
font-size: 22upx;
color: #333;
background-color: #F5F5F5;
border: 1upx solid rgba(0, 0, 0, .05);
float: left;
border-radius: 30upx;
margin-right: 20upx;
transition: all 0.2s;
margin-bottom: 20upx;
}
.number{
margin-top: 10upx;
border-top: 1upx solid #ccc;
width: 100%;
height: 80upx;
line-height: 80upx;
padding-top: 10upx;
}
.number .n_left{
float: left;
font-size: 28upx;
color: #333;
}
.number .n_right{
float: right;
height: 60upx;
width: 200upx;
background-color: #F5F5F5;
margin-top: 10upx;
border-radius: 5upx;
}
.n_right .jian,.jia{
width: 60upx;
height: 60upx;
text-align: center;
line-height: 60upx;
font-size: 42upx;
}
.jian{
float: left;
}
.jia{
float: right;
}
.jian:active{
background-color: #eee;
}
.jia:active{
background-color: #eee;
}
.n_right input{
width: 76upx;
float: left;
text-align: center;
margin-top: 6upx;
}
.btn_box{
margin-top: 40upx;
}
.btn_box .addcart_btn, .submit{
width: 40vw;
height: 56upx;
line-height: 56upx;
border-radius: 42upx;
font-size: 24upx;
text-align: center;
color: #ffffff;
float: left;
margin-left: 30upx;
margin-bottom: 30upx;
}
.btn_box view:active{
opacity: 0.8;
}
/* 列表类样式 */
.list_mode{
padding: 20upx 4% 0upx;
z-index: 10;
background-color: #FFFFFF;
}
.goods_list {
overflow: hidden;
}
.goods_list .goods_item {
align-items: center;
border-bottom: 1upx solid #eee;
padding-bottom: 10upx;
margin-bottom: 15upx;
overflow: hidden;
position: relative;
&:last-of-type{
border-bottom: none;
}
}
.goods_item image {
width: 200upx;
height: 200upx;
float: left;
border-radius: 10upx;
margin-right: 5upx;
}
.goods_item .tags{
width: 60upx;
height: 60upx;
position: absolute;
top: 0;
left: 0;
}
.goods_right {
/* float: left; */
padding: 0 10upx;
overflow: hidden;
}
.goods_right .goods_name {
font-size: 28upx;
overflow: hidden;
font-weight: bold;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
color: #333;
min-height: 50upx;
}
.goods_right .numbers{
font-size: 20upx;
line-height: 30upx;
overflow: hidden;
margin-top: 30upx;
display: flex;
align-content: center;
}
.goods_right .numbers text{
display: inline-block;
height: 35upx;
line-height: 35upx;
padding: 0 10upx;
background-color: #FAEFF7;
border-radius: 10upx;
margin-right: 20upx;
color: $mycolor;
}
.goods_right .price{
line-height: 40upx;
font-size: 24upx;
overflow: hidden;
margin-top: 20upx;
}
.price .money{
margin-right: 20upx;
font-size: 32upx;
font-weight: bold;
color: $mycolor;
}
.hx_money{
text-decoration: line-through;
color: #999;
font-size: 22upx;
}
.gouwuche{
font-size: 32upx;
float: right;
margin-right: 20upx;
color: $mycolor;
}
.nodata{
color: #999;
text-align: center;
font-size: 24upx;
margin-top: 20upx;
height: 80upx;
line-height: 80upx;
}
</style>

@ -0,0 +1,244 @@
<template>
<view class="set_time">
<uni-popup ref="popup" type="bottom" @change="onhide">
<view class="popup_box">
<image class="close" @click="closePopup" src="/static/images/search/close.png" mode=""></image>
<view class="box">
<view class="left">
<p :class="[timeCurrent == index?'timeCurrent':'']" v-for="(item,index) in dateList" :key="index" @click="setTimeCurrent(item,index)">{{item.month}}月{{item.day}}日(<text v-if="index == 0"></text><text v-else>{{item.week}}</text>)</p>
</view>
<view class="right">
<view class="a_p_m" v-for="(item,index) in nowList" :key="index">
<p>{{item.name}}</p>
<view :class="['tag',tagCurrent == index ?'tag_active':'']" @click="setTagCurrent(item,index)">
{{item.time}}
</view>
</view>
<view style="font-size: 24upx;color: #999;line-height: 60upx;" v-if="nowList.length == 0">
请您预定明天~
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue'
export default{
name:'set-time',
data(){
return{
dateList:[],
ApmList:[
{name:'上午',time:'09:00-15:00',status: 0},
{name:'下午',time:'15:00-21:00',status: 1},
],
nowList:[],
timeCurrent: 0,
tagCurrent: 0,
nowTime:'',
day:'' ,//
}
},
props:{
shows:{
type:Boolean,
default:false
}
},
components:{
uniPopup
},
watch:{
shows(value){
console.log(value)
value == true&&this.$refs.popup.open()
}
},
mounted() {
this.getNowDate()
this.setTimeCurrent(this.dateList[0],0) //
},
methods:{
closePopup(){
this.$refs.popup.close()
this.$emit('onClose')
},
onhide(e){ //
if(e.show == false){
this.$emit('onClose')
}
},
setTimeCurrent(item,index){
this.nowList = []
var dd = new Date();
//
let nowTime = dd.getHours()
//
this.timeCurrent = index
if(index == 0){
this.setNowTime(nowTime)
}else{
this.nowList = this.ApmList
}
let week = index == 0 ?'今天':'星期'+item.week
this.day = item.month+'月'+item.day+'日'+week
let time = ''
if(this.nowList.length == 0){ //
let items = this.dateList[index+1]
let weeks = index+1 == 0 ?'今天':'星期'+items.week
time = items.month+'月'+items.day+'日'+ weeks + this.ApmList[0].time //
console.log('执行了')
/**
* 过了当天的设定的时间点之后 就不允许再点击了
*/
this.timeCurrent = 1
this.nowList = this.ApmList
}else{
time = this.day+' '+ this.nowList[0].time
}
this.$emit('onComplete',time) //
},
setTagCurrent(item,index){
this.tagCurrent = index
let time = this.day+' '+item.time
this.$emit('onComplete',time)
this.$emit('onClose')
this.$refs.popup.close()
},
getNowDate(){ //
var dd = new Date();
//
let nowTime = dd.getHours()
//
this.setNowTime(nowTime)
var arr=[];
for(var i=0;i<7;i++){
let m = dd.getMonth()+1
let month = m < 10 ? '0' + m: m;
let d = dd.getDate()
let day = d < 10 ? '0' + d: d;
let week = dd.getDay()
let time = {}
time.day = day
time.month = month
time.week = this.setWeek(week)
arr.push(time)
dd.setDate(dd.getDate()+1);
}
this.dateList = arr
},
setNowTime(value){
if(value <= 12){ // 9-15
this.nowList = this.ApmList
}else if(value <= 17){ // 15-21
this.nowList.push(this.ApmList[1])
}else{
this.nowList = []
}
},
setWeek(value){
switch (value){
case 0:
return '日';
break;
case 1:
return '一';
break;
case 2:
return '二';
break;
case 3:
return '三';
break;
case 4:
return '四';
break;
case 5:
return '五';
break;
case 6:
return '六';
break;
default:
return '一'
}
}
}
}
</script>
<style lang="scss" scoped>
.popup_box{
// height: 50vh;
width: 100vw;
background-color: #FFFFFF;
border-radius: 20upx 20upx 0 0;
position: relative;
.close{
width: 40upx;
height: 40upx;
position: absolute;
top: 20upx;
right: 20upx;
background-color: #DDDDDD;
border-radius: 50%;
}
.box{
display: flex;
padding: 20upx 0;
.left{
overflow: hidden;
margin-top: 70upx;
padding-bottom: 30upx;
width: 260upx;
height: calc(55vh - 70upx);
display: flex;
flex-direction: column;
background-color: #F8F8F8;
p{
padding: 0 20upx;
min-width: 100%;
height: 80upx;
line-height: 80upx;
font-size: 26upx;
color: #8D8D8D;
transition: all 0.3s;
}
.timeCurrent{
background-color: #FFFFFF;
color: #202020;
transition: all 0.3s;
}
}
.right{
margin-top: 70upx;
margin-left: 10upx;
.a_p_m{
margin-bottom: 20upx;
p{
font-size: 26upx;
color: #8D8D8D;
height: 80upx;
line-height: 80upx;
transition: all 0.3s;
}
.tag{
height: 80upx;
line-height: 70upx;
padding: 5upx 20upx;
color: #000000;
border-radius: 8upx;
background-color: #F7F7F7;
}
.tag_active{
background-color: #FDF3F2;
color: #F40603;
transition: all 0.3s;
}
}
}
}
}
</style>

@ -0,0 +1,144 @@
<template>
<view>
<view v-for="(item, index) in couponList" :key="index" class="coupon_box" @tap="onreceive(item, index)" >
<view class="left">
<view class="left_top">
<text class="hui"></text>
<text class="hui_name">{{item.money}}{{item.reduce}}</text>
</view>
<view class="left_bottom">
<text>有效日期{{item.date}}</text>
</view>
<image src="/static/images/goods/ylq.png" v-if="item.status == 1" class="ylq"></image>
</view>
<view class="right">
<view class="money">{{item.reduce}}</view>
<text>{{item.money}}可用</text>
</view>
<view class="bottom">
<view v-for="(row, indexs) in item.condition" :key="indexs">
{{indexs+1}}.{{row}}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
components: {},
props: {
colors: {
type: String
},
couponList: {
type: Array
}
},
methods: {
onreceive(item, index) { //
let that = this
if (item.status == 1) {
return;
} else {
//
this.$emit('onReceive', item, index)
}
}
}
};
</script>
<style lang="scss" scoped>
.coupon_box{
margin: 20upx;
padding: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
position: relative;
border-radius: 10upx;
padding-bottom: 10upx;
overflow: hidden;
}
.coupon_box .left{
display: flex;
align-items: center;
flex-wrap: wrap;
border-bottom: 1upx solid #eee;
padding-bottom: 20upx;
position: relative;
}
.coupon_box .left .ylq{
width: 60upx;
height: 45upx;
position: absolute;
top: 0;
right: 140upx;
}
.coupon_box .left .hui{
width: 40upx;
height: 40upx;
font-size: 22upx;
color: #fff;
background-color: rgba(255, 84, 110,.8);
border-radius: 8upx;
line-height: 40upx;
text-align: center;
display: inline-block;
transform: translateY(-5upx);
}
.coupon_box .left .left_top{
width: 80vw;
display: block;
font-size: 26upx;
font-weight: bold;
}
.left_top .hui_name{
line-height: 60upx;
height: 60upx;
margin-left: 20upx;
display: inline-block;
font-size: 28upx;
}
.left_bottom{
font-size: 24upx;
font-weight: 500;
color: #333;
height: 60upx;
line-height: 60upx;
}
.coupon_box .right{
position: absolute;
right: 20upx;
top: 25upx;
text-align: center;
}
.coupon_box .right .money{
font-size: 45upx;
margin-bottom: 10upx;
}
.coupon_box .right text{
font-size: 24upx;
color: #999;
}
.coupon_box .bottom{
height: 60upx;
line-height: 60upx;
display: flex;
align-content: flex-start;
font-size: 24upx;
margin-top: 10upx;
}
.coupon_box .bottom view{
margin-right: 20upx;
color: #888;
}
</style>

@ -0,0 +1,41 @@
<template>
<view class="loading">
<view class="bg-white">
<image src="https://image.weilanwl.com/gif/loading-white.gif" mode="aspectFit" class="gif-white response"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {},
methods: {}
};
</script>
<style scoped lang="scss">
.loading{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 999;
background-color: #fff;
opacity: 0.9;
}
.bg-white{
width: 100%;
height: 100%;
}
.bg-white image{
width: 100%;
height: 60%;
display: block;
}
</style>

@ -0,0 +1,110 @@
<template>
<view class="nav_abr" :style="{background:bgColor}">
<view class="status_bar" :style="'height: '+ statusBarHeight"></view>
<view class="toBar" :style="'height:'+toBarHeight">
<block v-if="showLeft == true">
<image src="/static/images/home/lefts.png" v-if="leftBg == true" class="left_img" @tap="toback"></image>
<text class="iconfont icon-fanhui left_icon" @tap="toback" v-if="leftBg == false" style="color: #202020;"></text>
</block>
<!-- #ifndef H5 -->
<text class="title" :style="'color:' + textcolor" v-if="showTitle == true">{{navTitle}}</text>
<!-- #endif -->
<!-- #ifdef H5 -->
<text class="title bolds" :style="'color:' + textcolor" v-if="showTitle == true">{{navTitle}}</text>
<!-- #endif -->
</view>
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
statusBarHeight: app.globalData.statusHeight + 'px',
toBarHeight: app.globalData.toBar + 'px'
};
},
components: {},
props: {
textcolor: {
type: String,
default: '#fff'
},
bgColor:{
type:String,
default:''
},
showTitle: {
type: Boolean,
default: true
},
showLeft: {
type: Boolean,
default: false
},
navTitle: {
type: String,
default: '登录'
},
leftBg:{
type: Boolean,
default: true
}
},
methods: {
toback() {
uni.navigateBack({
delta: 1
});
}
}
};
</script>
<style lang="scss" scoped>
.status_bar{
width: 100vw;
overflow: hidden;
display: block;
}
.toBar{
width: 100vw;
position: relative;
display: flex;
align-items: center;
}
.left_icon{
font-size: 32upx;
position: absolute;
left: 20upx;
font-weight: 500;
width: 50upx;
height: 50upx;
line-height: 50upx;
}
.toBar .title{
text-align: center;
color: #fff;
font-size: 30upx;
display: block;
margin: 0 auto;
}
.left_img{
width: 50upx;
height: 50upx;
position: absolute;
padding: 10upx;
left: 20upx;
top: 50%;
transform: translateY(-50%);
z-index: 100;
background-color: rgba(0, 0, 0, 0.4);
border-radius: 50%;
}
.bolds{
font-weight: bold;
}
</style>

@ -0,0 +1,52 @@
<template>
<view class="nodata">
<text class="iconfont icon-zanwushuju" :style="'color:' + colors"></text>
<view class="texts">
{{title}}
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {
title: {
type: String,
default: '暂无数据'
},
colors: {
type: String
}
},
methods: {}
};
</script>
<style scoped lang="scss">
.nodata{
width: 100vw;
height: 50vw;
}
.nodata .iconfont{
display: inline-block;
text-align: center;
font-size: 160upx;
color: pink;
width: 100%;
margin-top: 100upx;
}
.texts{
margin-top: 20upx;
height: 40upx;
line-height: 40upx;
text-align: center;
color: #9c9c9c;
font-size: 24upx;
letter-spacing: 5upx;
}
</style>

@ -0,0 +1,73 @@
<template>
<view class="search">
<view class="input-box" @tap="jumpSearch">
<input placeholder="搜索关键词" class="inputs" disabled placeholder-style="color:#c0c0c0;font-size:24upx;"></input>
<view class="icon search">
<image src="/static/images/home/search.png" class="search_img"></image>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {},
methods: {
jumpSearch() {
uni.showToast({
icon: 'none',
title: '功能开发中,敬请期待'
})
return
uni.navigateTo({
url: '/pages/views/home/search'
});
}
}
};
</script>
<style lang="scss" scoped>
.search{
z-index: 900;
}
.input-box {
width: 100%;
height: 60upx;
background-color: #f5f5f5;
position: relative;
display: flex;
align-items: center;
border-radius: 30upx;
margin-bottom: 20upx;
z-index: 900;
}
.input-box .icon {
display: flex;
align-items: center;
position: absolute;
top: 10upx;
right: 20upx;
width: 40upx;
height: 40upx;
font-size: 32upx;
color: #c0c0c0;
}
.search .search_img{
width: 40upx;
height: 40upx;
display: block;
}
.input-box .inputs {
padding-left: 28upx;
height: 28upx;
font-size: 28upx;
}
</style>

@ -0,0 +1,203 @@
<template>
<view>
<!--自定义地址选择器-->
<view class="nyz_area_mask" v-if="show == true"></view>
<view :class="'nyz_area_view ' + (show ? 'show':'hide')">
<view class="nyz_area_view_btns">
<text class="nyz_area_view_btn_cancle" @tap="handleNYZAreaCancle"></text>
<text class="nyz_area_view_btn_sure" @tap="handleNYZAreaSelect" :data-province="province" :data-city="city" :data-area="area">确定</text>
</view>
<picker-view class="nyz_area_pick_view" indicator-style="height: 35px;" @change="handleNYZAreaChange" :value="value">
<picker-view-column>
<view v-for="(item, index) in provinces" :key="index" class="nyz_area_colum_view">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view v-for="(item, index) in citys" :key="index" class="nyz_area_colum_view">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view v-for="(item, index) in areas" :key="index" class="nyz_area_colum_view">{{item}}</view>
</picker-view-column>
</picker-view>
</view>
</view>
</template>
<script>
var areaTool = require("@/utils/area.js");
var index = [0, 0, 0];
var provinces = areaTool.getProvinces();
var citys = areaTool.getCitys(index[0]);
var areas = areaTool.getAreas(index[0], index[1]);
export default {
data() {
return {
provinces: provinces,
citys: areaTool.getCitys(index[0]),
areas: areaTool.getAreas(index[0], index[1]),
value: [0, 0, 0],
province: '北京市',
city: '北京市',
area: '东城区'
};
},
components: {},
props: {
show: {
//area_select
type: Boolean,
default: false
},
maskShow: {
//
type: Boolean,
default: true
}
},
methods: {
handleNYZAreaChange: function (e) {
var that = this;
console.log("e:" + JSON.stringify(e));
var value = e.detail.value;
/**
* 滚动的是省
* 省改变 区都不变
*/
if (index[0] != value[0]) {
index = [value[0], 0, 0];
let selectCitys = areaTool.getCitys(index[0]);
let selectAreas = areaTool.getAreas(index[0], 0);
that.setData({
citys: selectCitys,
areas: selectAreas,
value: [index[0], 0, 0],
province: provinces[index[0]],
city: selectCitys[0],
area: selectAreas[0]
});
} else if (index[1] != value[1]) {
/**
* 市改变了 省不变 区变
*/
index = [value[0], value[1], 0];
let selectCitys = areaTool.getCitys(index[0]);
let selectAreas = areaTool.getAreas(index[0], value[1]);
that.setData({
citys: selectCitys,
areas: selectAreas,
value: [index[0], index[1], 0],
province: provinces[index[0]],
city: selectCitys[index[1]],
area: selectAreas[0]
});
} else if (index[2] != value[2]) {
/**
* 区改变了
*/
index = [value[0], value[1], value[2]];
let selectCitys = areaTool.getCitys(index[0]);
let selectAreas = areaTool.getAreas(index[0], value[1]);
that.setData({
citys: selectCitys,
areas: selectAreas,
value: [index[0], index[1], index[2]],
province: provinces[index[0]],
city: selectCitys[index[1]],
area: selectAreas[index[2]]
});
}
},
/**
* 确定按钮的点击事件
*/
handleNYZAreaSelect: function (e) {
var myEventDetail = e; // detail
var myEventOption = {}; //
this.$emit('sureSelectArea', {
detail: myEventDetail
}, myEventOption);
},
/**
* 取消按钮的点击事件
*/
handleNYZAreaCancle: function (e) {
var that = this;
console.log("e:" + JSON.stringify(e));
this.$emit('hideShow', {
detail: false
});
}
}
};
</script>
<style scoped lang="scss">
.nyz_area_view{
width: 100%;
position: fixed;
bottom:-1000px;
left: 0px;
background-color: #fff;
z-index: 21;
transition: all 0.3s;
}
.nyz_area_pick_view{
height: 200px;
width: 100%;
}
.nyz_area_colum_view{
line-height: 35px;
text-align: center;
font-size: 28upx;
}
.hide{
bottom: -1000upx;
transition: all 0.3s;
}
.show{
bottom: 0upx;
transition: all 0.3s;
}
.nyz_area_view_btns{
background-color: #fff;
border-bottom: 1px solid #eeeeee;
font-size: 30upx;
padding: 18upx 0upx;
}
.nyz_area_view_btns>text{
display: inline-block;
word-spacing: 4upx;
letter-spacing: 4upx;
}
.nyz_area_view_btn_cancle{
color: #939393;
padding-right: 20upx;
padding-left: 25upx;
}
.nyz_area_view_btn_sure{
float: right;
padding-left: 20upx;
padding-right: 25upx;
}
.nyz_area_mask{
width: 100%;
height: 100vh;
background-color: rgba(8, 8, 8, 0.8);
position: absolute;
top: 0upx;
left: 0upx;
z-index: 20;
}
</style>

@ -0,0 +1,519 @@
<template>
<!-- 弹出规格选项 -->
<view class="popup">
<view class="mask" @touchmove.stop.prevent="moveHandle" v-if="showModal" @tap="onhide"></view>
<view @touchmove.stop.prevent="moveHandle" :class="'sku ' + (showModal==true ? 'shows':'')" :style="{bottom: showModal == true ? bottoms+'upx': ''}">
<view class="sku_top">
<image :src="currentSku.img" class="top_img"></image>
<view class="sku_title">
{{nowList.title}}
</view>
<view class="moneys">
<!-- 这里的价格是选择完规格后计算的价格 -->
{{(Number(currentSku.money) * number).toFixed(2)}}
</view>
<view class="kucun">
<!-- 这里的价格是选择完规格后计算的库存 -->
库存: {{currentSku.stock}}
</view>
</view>
<block v-if="nowList.sku && nowList.sku.length > 0">
<view v-for="(item, index) in nowList.sku"
:key="index"
class="sku_list">
<view class="sku_name">
{{item.skuname}}
</view>
<view class="sku_tag">
<view v-for="(row, sIndex) in item.child"
:key="row.id"
class="tag_s"
:class="[currentArr['' + index] == row.id ? ' active' : '']"
@tap="setTag(item, index, sIndex, row)"
>
{{row.tagname}}
</view>
</view>
</view>
</block>
<view class="number">
<view class="n_left">购买数量</view>
<view class="n_right">
<text class="jian" @tap="onreduce"></text>
<input :value="number" disabled type="number" maxlength="2" class="inputs"></input>
<text class="jia" @tap="onadd"></text>
</view>
</view>
<view class="btn_box">
<view class="addcart_btn" :style="'background-color:' + colors" @tap="onsubmit('add')"></view>
<view class="submit" :style="'background-color:' + colors" @tap="onsubmit('pay')"></view>
</view>
</view>
</view>
</template>
<script>
import { setTabBarBadge } from'@/utils/util.js'
import {getCart, setCart ,resetCart, setGoodsData,getCartNumber, getToken} from '@/utils/auth.js'
export default {
data() {
return {
number: 1,
current: "",
currentArr: {}, //
currentSku:{}, //
skulength: 0, //
issku: false ,//
update: true,
nowList:{},
};
},
components: {},
props: {
colors: {
type: String
},
showModal: {
type: Boolean,
default: false
},
skuList: {
type: Object
},
bottoms:{
type: String,
default: 0
}
},
computed:{
skuArr() {
return this.skuList.skuArr;
}
},
watch:{
skuList(value){//
value.sku.forEach((v, index) => {
this.$set(this.currentArr, index, v.child[0].id)
})
this.issku = false //
this.number = 1 //
this.skulength = 0 //
this.currentSku = value
this.nowList = value
}
},
methods: {
moveHandle(){
return
},
setTag(items, current, indexs,row) {
console.log(items, current, indexs,row)
//
let that = this
let item = items
let pid = items.sku_id
let isChecked = true; // or
// const findIndex = this.currentArr.findIndex(v => v === row.id)
// if (findIndex > -1) {
// this.currentArr.splice(findIndex, 1, '');
// isChecked = false
// } else {
// this.$set(this.currentArr, current, row.id)
// }
// this.currentArr[current + ''] = row.id
this.$set(this.currentArr, current, row.id)
const chooseSkuId = Object.values(this.currentArr).filter(v => !!v);
let newSku = this.getAllSku() //
that.skulength = chooseSkuId.length
if(chooseSkuId.length == that.nowList.sku.length && newSku.length){
//
that.currentSku = newSku[0]
that.issku = true //
}else{
that.currentSku = that.nowList;
}
//
that.changeDisabled(isChecked,row.id, pid)
},
changeDisabled(isChecked=false,skuId=0, pid=0){ //
let newSku = []
if (isChecked) {
for(let key of this.skuArr){ //
if(key.stock <= 0){ //0
continue
}
if(key.goods_sku_arr.indexOf(skuId.toString()) >= 0){ //
newSku.push(key)
}
}
}else{
newSku = this.getAllSku()
}
// id
let noChooseSkuIds = [];
for (let price of newSku) {
noChooseSkuIds = noChooseSkuIds.concat(price.goods_sku_arr);
}
//
noChooseSkuIds = Array.from(new Set(noChooseSkuIds));
if (isChecked) {
//
let index = noChooseSkuIds.indexOf(skuId.toString());
noChooseSkuIds.splice(index, 1);
} else {
//
// this.currentArr.forEach(sku => {
// if (sku.toString() != '') {
// // sku
// let index = noChooseSkuIds.indexOf(sku.toString());
// if (index >= 0) {
// // sku noChooseSkuIds
// noChooseSkuIds.splice(index, 1);
// }
// }
// });
}
//
let chooseSkuKey = [];
if (!isChecked) {
//
// this.currentArr.forEach((sku, key) => {
// if (sku != '') {
// // sku
// chooseSkuKey.push(key);
// }
// });
} else {
//
chooseSkuKey = [pid];
}
let skuid = this.currentArr[pid]
for(let i in this.nowList.sku){
//
for (var x in this.nowList.sku[i]['child']) {
// id
if (chooseSkuKey.indexOf(this.nowList.sku[i]['sku_id']) >= 0) {
if(this.nowList.sku[i]['child'][x]['id'] == skuid){
continue
}else{
if(!isChecked){
this.nowList.sku[i]['child'][x]['disabled'] = false;
}
}
}else{
if (noChooseSkuIds.indexOf(this.nowList.sku[i]['child'][x]['id'].toString()) >= 0) {
this.nowList.sku[i]['child'][x]['disabled'] = false;
} else {
this.nowList.sku[i]['child'][x]['disabled'] = true;
}
}
}
}
},
onhide() {
//
this.$emit('onhide')
},
onadd() {
//
let data = this.number + 1;
this.setData({
number: data
});
},
onreduce() {
//
if (this.number <= 1) {
return;
} else {
let data = this.number - 1;
this.setData({
number: data
});
}
},
onsubmit(value) {
//
if(!getToken()){
uni.navigateTo({ //
url:'/pages/login/index1'
})
return
}
//
if(Object.keys(this.currentArr).length != this.nowList.sku.length){ //
uni.showToast({
title: '请选择规格',
icon: 'none'
});
}else {
//
var data = this.nowList
if(this.issku == true){ //
data.selectSku = this.currentSku
}
const selectedSku = []
Object.keys(this.currentArr).forEach(key => {
const item = this.currentArr[key]
if (item) {
const sku = this.nowList.sku[key].child[item -1 ]
selectedSku.push(sku)
}
})
data._selectedSku = selectedSku
data.number = this.number
if(value == 'add'){ //
let colCart = getCart();
if(colCart.length){
const hasItem = colCart.some(v => v.goods_id === data.goods_id)
if (!hasItem) {
colCart.push(data)
} else {
for(let y = 0;y < colCart.length; y++){
const item = colCart[y]
if (data.goods_id === item.goods_id) {
item.number ++
item._selectedSku = selectedSku
break
}
}
}
} else {
colCart = [data]
}
resetCart(colCart)
//
uni.showToast({
title: '加入购物车成功 !',
icon: 'none'
});
/**
* 模拟获取购物车的数量 getCart
*/
let cartNum = getCartNumber()
setTabBarBadge(cartNum)
}else{ //
let goods = []
goods.push(data)
setGoodsData(goods) //
uni.navigateTo({ //
url:'/pages/views/order/confirmOrder'
})
}
setTimeout(() => {
this.$emit('onhide')
}, 800);
}
},
//
getAllSku(){
let newSku = []
for(let key of this.skuArr){ //
if(key.stock <= 0){ //0
continue
}
var isOk = true
// this.currentArr.forEach((sku)=>{
// // sku skuPrice ,
// if(sku.toString() !== '' && key.goods_sku_arr.indexOf(sku.toString()) < 0){
// isOk = false
// }
// })
if(isOk == true){
newSku.push(key)
}
}
return newSku
}
}
};
</script>
<style scoped lang="scss">
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 900;
opacity: 0.7;
}
.sku{
width: 100vw;
min-height: 30vh;
position: fixed;
bottom: -100%;
z-index: 910;
left: 0;
background-color: #ffffff;
padding: 20upx 4%;
border-top-left-radius: 10upx;
border-top-right-radius: 10upx;
border-bottom: 1upx solid #eee;
transition: all 0.3s;
}
.shows{
bottom: 0;
transition: all 0.3s;
}
.sku_top{
overflow: hidden;
margin-top: 20upx;
}
.sku_top .top_img{
height: 170upx;
width: 170upx;
float: left;
margin-right: 15upx;
border-radius: 8upx;
}
.sku_top .sku_title{
font-size: 30upx;
line-height: 35upx;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.sku_top .moneys{
font-size: 30upx;
line-height: 40upx;
overflow: hidden;
margin-top: 20upx;
font-weight: bold;
color: $mycolor;
}
.sku_top .kucun{
font-size: 24upx;
color: #999;
overflow: hidden;
}
.sku_list{
margin-top: 20upx;
overflow: hidden;
margin-bottom: 40upx;
}
.sku_name{
font-size: 24upx;
color: #666;
overflow: hidden;
}
.sku_tag{
overflow: hidden;
margin-top: 20upx;
}
.sku_tag .tag_s{
height: 60upx;
line-height: 60upx;
align-items: center;
padding: 0 20upx;
text-align: center;
font-size: 26upx;
color: #202020;
background-color: #F5F5F5;
border: 1upx solid #F5F5F5;
float: left;
border-radius: 40upx;
margin-right: 20upx;
transition: all 0.2s;
margin-bottom: 20upx;
font-weight: 500;
&::after{
border: none;
}
}
.sku_tag .tag_s.active {
color: rgb(57, 181, 74);
background: rgb(255, 255, 255);
border-color: rgb(57, 181, 74);
}
.number{
margin-top: 10upx;
border-top: 1upx solid #ccc;
width: 100%;
height: 80upx;
line-height: 80upx;
padding-top: 10upx;
}
.number .n_left{
float: left;
font-size: 28upx;
color: #333;
}
.number .n_right{
float: right;
height: 60upx;
width: 200upx;
background-color: #F5F5F5;
margin-top: 10upx;
border-radius: 5upx;
}
.n_right .jian,.jia{
width: 60upx;
height: 60upx;
text-align: center;
line-height: 60upx;
font-size: 42upx;
}
.jian{
float: left;
}
.jia{
float: right;
}
.jian:active{
background-color: #eee;
}
.jia:active{
background-color: #eee;
}
.n_right .inputs{
width: 76upx;
float: left;
text-align: center;
margin-top: 6upx;
}
.btn_box{
margin-top: 40upx;
}
.btn_box .addcart_btn, .submit{
width: 40vw;
height: 60upx;
line-height: 60upx;
border-radius: 42upx;
font-size: 26upx;
text-align: center;
color: #ffffff;
float: left;
margin-left: 30upx;
margin-bottom: 30upx;
}
.btn_box .addcart_btn:active{
opacity: 0.8;
}
.btn_box .submit:active{
opacity: 0.8;
}
.ondisabled{
background-color: #F9F9F9;
opacity: 0.5;
}
</style>

@ -0,0 +1,67 @@
<template>
<view class="tabs">
<view v-for="(item, index) in tabList" :key="index" class="tabs_list" @tap="setTabs(item,index)"
:style="'color:' + (active == index ?colors :'') + ';font-weight:' + (active == index ?'bold' : '500')">
{{item.name}}
<view class="active" :style="'background:' + colors" v-if="active == index"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {
colors: {
type: String
},
tabList: {
type: Array
},
active: {
type: Number,
default: 0
}
},
methods: {
setTabs(item,index) {
this.$emit('setTabs',item,index);
}
}
};
</script>
<style scoped lang="scss">
.tabs{
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: flex-start;
align-items: center;
background-color: #fff;
}
.tabs_list{
flex: 1;
text-align: center;
font-size: 28upx;
position: relative;
color: #333;
}
.active{
font-weight: bold;
color: #DD4F42;
width: 50upx;
height: 5upx;
border-radius: 20upx;
background-color: #DD4F42;
position: absolute;
bottom: 10upx;
left: 50%;
transform: translateX(-50%);
transition: all 0.3s;
}
</style>

@ -0,0 +1,64 @@
<template>
<view class="item_cell">
<view>
{{cellname}}
</view>
<image src="/static/images/home/right.png"></image>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {
cellname: {
type: String
},
linkUrl: {
type: String
}
},
methods: {}
};
</script>
<style lang="scss" scoped>
.item_cell{
background-color: #fff;
height: 80upx;
line-height: 80upx;
padding: 0 4%;
display: flex;
align-items: center;
position: relative;
}
.item_cell:after{
position: absolute;
z-index: 3;
left: 0;
right: 0;
height: 0;
bottom: 0;
left: 4%;
content: "";
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
border-bottom: 1px solid #e4e7ed;
}
.item_cell:active{
background-color: #f5f5f5;
}
.item_cell view{
width: 93%;
float: left;
}
.item_cell image{
width: 40upx;
height: 40upx;
float: right;
}
</style>

@ -0,0 +1,90 @@
<template>
<view class="top_nav" @tap="jumpNext">
<text :class="'iconfont ' + icons + ' icon'" :style="'color:' + colors"></text>
<text class="name"><slot></slot></text>
<image src="/static/images/home/right.png" class="right_icon" v-if="rightshow == true"></image>
</view>
</template>
<script>
export default {
data() {
return {};
},
components: {},
props: {
icons: {
type: String
},
linkUrl: {
type: String //
},
colors: {
type: String
},
rightshow: {
type: Boolean,
default: true
}
},
methods: {
jumpNext() {
console.log(this.linkUrl);
if (this.linkUrl && this.linkUrl !== '') {
uni.navigateTo({
url: this.linkUrl
});
}
}
}
};
</script>
<style scoped lang="scss">
.top_nav {
line-height: 60upx;
padding: 20upx 30upx;
display: flex;
align-items: baseline;
position: relative;
}
.top_nav::after {
position: absolute;
left: 30upx;
right: 0;
height: 0;
content: '';
bottom: 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
border-bottom: 1px solid #E4E7ED;
}
.top_nav:active {
background-color: #fafafa;
}
.top_nav .icon {
align-self: center;
width: 56upx;
max-height: 60upx;
font-size: 38upx;
}
.top_nav .name {
flex: 1;
font-size: 28upx;
color: #303133;
}
.top_nav .right_icon {
float: right;
width: 40upx;
height: 40upx;
align-self: center;
}
</style>

@ -0,0 +1,97 @@
<template>
<view class="my_money">
<list-cell icons="icon-qianbao" :colors="colors" :rightshow="false">我的账户</list-cell>
<view class="menu_btnbox">
<view class="menu_btns" @tap="withdrawa">
<view class="p1">{{balance}}</view>
<view class="p2">余额</view>
</view>
<view class="menu_btns" @tap="mycoupon">
<view class="p1">{{coupon}}</view>
<view class="p2">优惠券</view>
</view>
<view class="menu_btns" @tap="mypoints">
<view class="p1">{{integral}}</view>
<view class="p2">积分</view>
</view>
</view>
</view>
</template>
<script>
import listCell from "./list-cell";
export default {
data() {
return {};
},
components: {
listCell
},
props: {
balance: {
//
type: Number,
default: 0
},
coupon: {
//
type: Number,
default: 0
},
integral: {
//
type: Number,
default: 0
},
colors: {
type: String
}
},
methods: {
mycoupon() {
uni.navigateTo({
url: '/pages/views/user/mycoupon'
});
},
mypoints() {
uni.navigateTo({
url: '/pages/views/user/mypoints'
});
},
withdrawa(){
uni.navigateTo({
url: '/pages/views/withdrawal/withdrawal'
});
}
}
};
</script>
<style lang="scss" scoped>
.my_money {
background-color: #fff;
margin-bottom: 20upx;
}
.menu_btnbox {
display: flex;
align-items: center;
}
.menu_btns {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
margin: 30upx 0;
font-size: 24upx;
color: #75787d;
line-height: 40upx;
}
.menu_btns .p1{
font-size: 30upx;
font-weight: bold;
}
</style>

@ -0,0 +1,105 @@
<template>
<view class="footprint">
<list-cell icons="icon-zuji" linkUrl="/pages/views/user/allFootprint" :rightshow="true" :colors="colors">浏览历史</list-cell>
<view class="footprint_box">
<view class="nodata" v-if="logList.length == 0">
<view>
<text class="iconfont icon-zanwu1" :style="'color:' + colors"></text>
</view>
<view class="tips">先去浏览一些吧</view>
</view>
<scroll-view scroll-x class="footprint_scroll">
<view v-for="(item, index) in logList" :key="index" @click="jumpNext(item)" class="scroll_box">
<image :src="item.url" mode="aspectFill"></image>
<view>{{item.goodsName}}</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import listCell from "./list-cell";
export default {
data() {
return {};
},
components: {
listCell
},
props: {
logList: {
type: Array
},
colors: {
type: String
}
},
methods: {
jumpNext(item){
uni.navigateTo({
url:'/pages/views/goods/goodsDetails'
})
}
}
};
</script>
<style lang="scss" scoped>
/*我的足迹*/
.footprint {
background-color: #fff;
margin-bottom: 20upx;
}
.footprint .nodata {
padding: 48upx 0;
text-align: center;
}
.footprint .nodata text {
font-size: 40upx;
}
.footprint .nodata .tips {
font-size: 24upx;
color: #999;
padding-top: 20upx;
}
.footprint_scroll {
background-color: #F8F8F8;
width: auto;
overflow-x: scroll;
white-space: nowrap;
}
.scroll_box {
width: 152upx;
background-color: #fff;
margin-top: 10upx;
margin-right: 10upx;
border-radius: 8upx;
overflow: hidden;
display: inline-block;
}
.scroll_box:active {
opacity: 0.8;
}
.scroll_box image {
width: 152upx;
height: 152upx;
display: block;
}
.scroll_box view {
font-size: 24upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 40upx;
padding: 10upx 5upx;
}
</style>

@ -0,0 +1,73 @@
<template>
<view class="my_order">
<list-cell icons="icon-order" linkUrl="/pages/views/order/orderList" :colors="colors">全部订单</list-cell>
<view class="order_btnbox">
<view v-for="(item, index) in orderText" :key="index" class="order_btns" @tap="jumpOrder(item,index)">
<view>
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text>
</view>
<view style="color:#666">{{item.name}}</view>
</view>
</view>
</view>
</template>
<script>
import listCell from "./list-cell";
export default {
data() {
return {};
},
components: {
listCell
},
props: {
orderText: {
type: Array
},
colors: {
type: String
}
},
methods: {
jumpOrder(item,index) {
if(item.url !== ''){
uni.navigateTo({
url: item.url
});
}else{
uni.navigateTo({
url: '/pages/views/order/orderList?tabIndex=' + (index + 1)
});
}
}
}
};
</script>
<style lang="scss" scoped>
.my_order{
background-color: #fff;
margin-bottom: 20upx;
}
.order_btnbox {
display: flex;
align-items: center;
}
.order_btns {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
margin: 10upx 0 20upx;
padding: 20upx 0 10upx;
font-size: 24upx;
color: #75787d;
line-height: 40upx;
}
.order_btns text{
font-size: 36upx;
}
</style>

@ -0,0 +1,99 @@
<template>
<view class="my_server">
<list-cell :icons="'iconfont ' + icons" :colors="colors" :rightshow="false">{{titles}}</list-cell>
<view class="server_box">
<view v-for="(item, index) in serverList" :key="index" class="server_list" @tap="jumpLink(item)">
<view>
<text :class="'iconfont ' + item.icon" :style="'color:' + colors"></text>
</view>
<view class="server_text">
{{item.name}}
</view>
</view>
</view>
</view>
</template>
<script>
import listCell from "./list-cell";
export default {
data() {
return {};
},
components: {
listCell
},
props: {
serverList: {
type: Array
},
colors: {
type: String
},
titles: {
type: String,
default: '我的服务'
},
icons: {
type: String,
default: 'icon-fuwu'
}
},
methods: {
jumpLink(row) {
const whiteUrls = ['pages/views/user/myaddress', 'setting/index']
if (!whiteUrls.some(v => row.url.includes(v))) {
uni.showToast({
icon:'none',
title: '功能正在开发中,敬请期待'
})
return
}
//
uni.navigateTo({
url: row.url
});
}
}
};
</script>
<style scoped lang="scss">
/* 我的服务 */
.my_server {
background-color: #fff;
margin-bottom: 20upx;
}
.server_box {
display: flex;
align-items: center;
flex-direction: row;
flex-wrap: wrap;
padding-bottom: 30upx;
}
.server_box::after{
width: 25%;
content: '';
border:1px solid transparent;
}
.server_list {
max-width: 25%;
min-width: 25%;
text-align: center;
margin-top: 30upx;
}
.server_list:active{
opacity: 0.8;
}
.server_list text{
font-size: 56upx;
line-height: 60upx;
display: inline-block;
}
.server_text{
font-size: 24upx;
color: #3c3c3c;
margin-top: 15upx;
}
</style>

@ -0,0 +1,468 @@
<!-- 蓝色简洁登录页面 -->
<template>
<view class="t-login">
<!-- 页面装饰图片 -->
<image class="img-a" src="https://zhoukaiwen.com/img/loginImg/2.png"></image>
<image class="img-b" src="https://zhoukaiwen.com/img/loginImg/3.png"></image>
<!-- 标题 -->
<view class="t-b">{{ title }}</view>
<!-- <view class="t-b2">欢迎使用前端铺子样式组件</view> -->
<form class="cl">
<view class="t-a">
<image src="https://zhoukaiwen.com/img/loginImg/sj.png"></image>
<view class="line"></view>
<input type="text" name="phone" placeholder="请填写账号" maxlength="11" v-model="tel" />
</view>
<view class="t-a">
<image src="https://zhoukaiwen.com/img/loginImg/yz.png"></image>
<view class="line"></view>
<input name='password' type="password" v-model="password" placeholder="请填写密码" />
<input type="text" name="code" maxlength="6" placeholder="请输入验证码" v-model="yzm" />
<!-- <view v-if="showText" class="t-c" @tap="getCode()"></view> -->
<view v-if="showText" class="t-c1" @tap="getImgCode()">
<image :src="codeImg" mode="scaleToFill"></image>
</view>
<!-- <view v-else class="t-c" style="background-color: #A7A7A7;">重新发送({{ second }})</view> -->
</view>
<button @tap="onlogin()"> </button>
</form>
<!-- <view class="t-f"><text> 第三方账号登录 </text></view>
<view class="t-e cl">
<view class="t-g" @tap="wxLogin()"><image src="https://zhoukaiwen.com/img/loginImg/wx.png"></image></view>
<view class="t-g" @tap="zfbLogin()"><image src="https://zhoukaiwen.com/img/loginImg/qq.png"></image></view>
</view> -->
</view>
</template>
<script>
import { setUserInfo,setToken } from "@/utils/auth";
import { getCode, login} from '@/api/index.js'
export default {
data() {
return {
title: '能辉在线订货系统', //logoapp
second: 60, //60
showText: true, //
phone: '', //
yzm: '', //
password: '',
isCanUse: uni.getStorageSync('isCanUse'),
nickName: '',
avatarUrl: '',
bgImg: ['https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_4.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_1.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_3.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_2.jpg'],
imgTime: '',
imgIndex: 0,
codeName: '验证码',
isCode: true,
tel:'',
smscode:'123456',
codeImg: '',
currentTime: new Date().getTime()
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// #ifdef MP-WEIXIN
this.wxlogin(); //code
// #endif
},
onShow: function () {
this.setbImg(); //
this.getImgCode()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearInterval(this.imgTime);
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
clearInterval(this.imgTime);
},
methods: {
getImgCode() {
this.currentTime = new Date().getTime()
getCode(this.currentTime).then( res => {
this.codeImg = res.result
})
},
getUserInfo() {
console.log('点了');
let _this = this;
uni.getUserInfo({
provider: 'weixin',
success: function (infoRes) {
console.log(infoRes);
_this.setData({
nickName: infoRes.userInfo.nickName,
//
avatarUrl: infoRes.userInfo.avatarUrl //
});
let date = new Date().getTime()
setToken(date) //token
setUserInfo(infoRes.userInfo); //
try {
uni.setStorageSync('isCanUse', 1); // false:
uni.switchTab({
url: '/pages/views/tabBar/home'
});
} catch (e) {
console.log('缓存失败');
}
},
fail(res) {}
});
},
setbImg() {
clearInterval(this.imgTime);
let that = this;
console.log('执行了');
let imgTime = setInterval(() => {
let imgIndex = that.imgIndex + 1;
if (imgIndex >= that.bgImg.length) {
imgIndex = 0;
}
that.setData({
imgIndex: imgIndex
});
}, 15000);
this.setData({
imgTime: imgTime
});
},
onlogin(){ // token
if (!this.tel || !this.password || !this.yzm) {
uni.showToast({
icon:'none',
title: '填写信息'
})
return
}
const params = {
"username": this.tel,
"password": this.password,
"captcha": this.yzm,
"checkKey": this.currentTime,
"remember_me": true
}
uni.showLoading({
title:'登录中...'
})
login(params).then(res => {
const result = res.result
setToken(result.token)
setUserInfo(result.userInfo)
setTimeout(()=>{
uni.hideLoading()
uni.showToast({
title:'登陆成功'
})
}, 500)
uni.navigateBack(-1)
})
},
getCode() { //
if(this.isCode == false){
return
}
if (this.tel == '') {
uni.showToast({
title: '请输入手机号',
icon: 'none'
})
return
}
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.tel)) {
uni.showToast({
title: '请填写正确手机号码',
icon: 'none'
});
return false;
}
this.getPhoneCode()
},
getPhoneCode() {
let timer = ''
let date = 120
let that = this
if (that.isCode == true) {
uni.showToast({
title: '验证码发送成功~',
icon: 'none'
})
clearInterval(timer)
setInterval(() => {
if (date >= 1) {
date--
that.codeName = date + '秒重试'
that.isCode = false
} else {
that.isCode = true
that.codeName = '验证码'
clearInterval(timer)
}
}, 1000)
}
},
wxlogin() {
// 1.wxcode
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log('这是用户的code', loginRes);
}
});
},
onAuthorize(){ //
uni.showToast({
title:'对接你的公众号登录方法',
icon:"none"
})
},
//
login() {
let date = new Date().getTime()
setToken(date)
let user = { //
avatarUrl: '/static/images/face.jpg',
nickName: '用户2020'
}
setUserInfo(user)
uni.showLoading({
title:'登录中...'
})
setTimeout(()=>{
uni.hideLoading()
uni.showToast({
title:'登陆成功'
})
}, 500)
setTimeout(()=>{
uni.navigateBack(-1)
},1500)
var that = this;
if (!that.phone) {
uni.showToast({ title: '请输入手机号', icon: 'none' });
return;
}
if (!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(that.phone)) {
uni.showToast({ title: '请输入正确手机号', icon: 'none' });
return;
}
if (!that.yzm) {
uni.showToast({ title: '请输入验证码', icon: 'none' });
return;
}
//....
uni.showToast({ title: '登录成功!', icon: 'none' });
},
//
getCode() {
var that = this;
var interval = setInterval(() => {
that.showText = false;
var times = that.second - 1;
//that.second = times<10?'0'+times:times ;//10 0
that.second = times;
console.log(times);
}, 1000);
setTimeout(() => {
clearInterval(interval);
that.second = 60;
that.showText = true;
}, 60000);
//
uni.request({
//......//
success: function(res) {
that.showText = false;
}
});
},
//
wxLogin() {
uni.showToast({ title: '微信登录', icon: 'none' });
},
//
zfbLogin() {
uni.showToast({ title: '支付宝登录', icon: 'none' });
}
}
};
</script>
<style>
.img-a {
position: absolute;
width: 100%;
top: -150rpx;
right: 0;
}
.img-b {
position: absolute;
width: 50%;
bottom: 0;
left: -50rpx;
/* margin-bottom: -200rpx; */
}
.t-login {
width: 650rpx;
margin: 0 auto;
font-size: 28rpx;
color: #000;
}
.t-login button {
font-size: 28rpx;
background: #5677fc;
color: #fff;
height: 90rpx;
line-height: 90rpx;
border-radius: 50rpx;
box-shadow: 0 5px 7px 0 rgba(86, 119, 252, 0.2);
}
.t-login input {
padding: 0 20rpx 0 120rpx;
height: 90rpx;
line-height: 90rpx;
margin-bottom: 50rpx;
background: #f8f7fc;
border: 1px solid #e9e9e9;
font-size: 28rpx;
border-radius: 50rpx;
}
.t-login .t-a {
position: relative;
}
.t-login .t-a image {
width: 40rpx;
height: 40rpx;
position: absolute;
left: 40rpx;
top: 28rpx;
/* border-right: 2rpx solid #dedede; */
margin-right: 20rpx;
}
.t-login .t-a .line{
width: 2rpx;
height: 40rpx;
background-color: #dedede;
position: absolute;
top: 28rpx;
left: 98rpx;
}
.t-login .t-b {
text-align: left;
font-size: 46rpx;
color: #000;
padding: 300rpx 0 30rpx 0;
font-weight: bold;
}
.t-login .t-b2 {
text-align: left;
font-size: 32rpx;
color: #aaaaaa;
padding: 0rpx 0 120rpx 0;
}
.t-login .t-c {
position: absolute;
right: 22rpx;
top: 160rpx;
background: #5677fc;
color: #fff;
font-size: 24rpx;
border-radius: 50rpx;
height: 50rpx;
line-height: 50rpx;
padding: 0 25rpx;
}
.t-login .t-c1 {
position: absolute;
right: 22rpx;
top: 140rpx;
width: 160rpx;
height: 80rpx;
background: #5677fc;
color: #fff;
font-size: 24rpx;
border-radius: 50rpx;
}
.t-login .t-c1 image {
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.t-login .t-d {
text-align: center;
color: #999;
margin: 80rpx 0;
}
.t-login .t-e {
text-align: center;
width: 250rpx;
margin: 80rpx auto 0;
}
.t-login .t-g {
float: left;
width: 50%;
}
.t-login .t-e image {
width: 50rpx;
height: 50rpx;
}
.t-login .t-f {
text-align: center;
margin: 200rpx 0 0 0;
color: #666;
}
.t-login .t-f text {
margin-left: 20rpx;
color: #aaaaaa;
font-size: 27rpx;
}
.t-login .uni-input-placeholder {
color: #000;
}
.cl {
zoom: 1;
}
.cl:after {
clear: both;
display: block;
visibility: hidden;
height: 0;
content: '\20';
}
</style>

@ -0,0 +1,331 @@
<template>
<view class="login" :style="'background: url(' + bgImg[imgIndex] + '); background-size: cover;background-repeat:no-repeat; background-position: center;'">
<view class="logo">
<image src="/static/images/log.png"></image>
</view>
<view class="login_from">
<input placeholder="请输入手机号" v-model="tel" type="number" maxlength="11" placeholder-style="color: #333"></input>
<view class="codes">
<input placeholder="请输入短信验证码" v-model="smscode" maxlength="6" type="number" placeholder-style="color: #333"></input>
<view @click="getCode" :style="{opacity: isCode == true ? '1':'0.8'}">{{codeName}}</view>
</view>
<view class="login_btn" @click="onlogin"></view>
</view>
<view class="wxLogin">
<view> 快速登录 </view>
<image src="/static/images/wx.png"></image>
<!-- #ifdef MP -->
<button open-type="getUserInfo" @getuserinfo="getUserInfo">1</button>
<!-- #endif -->
<!-- #ifndef MP -->
<button open-type="getUserInfo" @click="onAuthorize"></button>
<!-- #endif -->
</view>
</view>
</template>
<script>
import { setUserInfo,setToken } from "../../utils/auth";
export default {
data() {
return {
isCanUse: uni.getStorageSync('isCanUse'),
nickName: '',
avatarUrl: '',
bgImg: ['https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_4.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_1.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_3.jpg', 'https://6d61-matchbox-79a395-1302390714.tcb.qcloud.la/matchbox/img_flower_2.jpg'],
imgTime: '',
imgIndex: 0,
codeName: '验证码',
isCode: true,
tel:'12345678912',
smscode:'123456'
};
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// #ifdef MP-WEIXIN
this.wxlogin(); //code
// #endif
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setbImg(); //
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearInterval(this.imgTime);
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
clearInterval(this.imgTime);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
getUserInfo() {
console.log('点了');
let _this = this;
uni.getUserInfo({
provider: 'weixin',
success: function (infoRes) {
console.log(infoRes);
_this.setData({
nickName: infoRes.userInfo.nickName,
//
avatarUrl: infoRes.userInfo.avatarUrl //
});
let date = new Date().getTime()
setToken(date) //token
setUserInfo(infoRes.userInfo); //
try {
uni.setStorageSync('isCanUse', 1); // false:
uni.switchTab({
url: '/pages/views/tabBar/home'
});
} catch (e) {
console.log('缓存失败');
}
},
fail(res) {}
});
},
setbImg() {
clearInterval(this.imgTime);
let that = this;
console.log('执行了');
let imgTime = setInterval(() => {
let imgIndex = that.imgIndex + 1;
if (imgIndex >= that.bgImg.length) {
imgIndex = 0;
}
that.setData({
imgIndex: imgIndex
});
}, 15000);
this.setData({
imgTime: imgTime
});
},
onlogin(){ // token
let date = new Date().getTime()
setToken(date)
let user = { //
avatarUrl: '/static/images/face.jpg',
nickName: '用户2020'
}
setUserInfo(user)
uni.showLoading({
title:'登录中...'
})
setTimeout(()=>{
uni.hideLoading()
uni.showToast({
title:'登陆成功'
})
}, 500)
setTimeout(()=>{
uni.navigateBack(-1)
},1500)
},
getCode() { //
if(this.isCode == false){
return
}
if (this.tel == '') {
uni.showToast({
title: '请输入手机号',
icon: 'none'
})
return
}
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.tel)) {
uni.showToast({
title: '请填写正确手机号码',
icon: 'none'
});
return false;
}
this.getPhoneCode()
},
getPhoneCode() {
let timer = ''
let date = 120
let that = this
if (that.isCode == true) {
uni.showToast({
title: '验证码发送成功~',
icon: 'none'
})
clearInterval(timer)
setInterval(() => {
if (date >= 1) {
date--
that.codeName = date + '秒重试'
that.isCode = false
} else {
that.isCode = true
that.codeName = '验证码'
clearInterval(timer)
}
}, 1000)
}
},
wxlogin() {
// 1.wxcode
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log('这是用户的code', loginRes);
}
});
},
onAuthorize(){ //
uni.showToast({
title:'对接你的公众号登录方法',
icon:"none"
})
}
}
};
</script>
<style scoped lang="scss">
.login{
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
transition: all 0.6s ease-in-out;
background-color: #333;
}
.logo image{
height: 160upx;
width: 160upx;
display: block;
border-radius: 50%;
margin: 0 auto;
margin-top: 150upx;
}
.login_from{
width: 80vw;
margin: 0 auto;
margin-top: 10vh;
}
.login_from .codes{
display: flex;
align-items: center;
align-content: center;
justify-content: space-between;
}
.login_from input{
height: 80upx;
line-height: 80upx;
margin-bottom: 60upx;
background-color: rgba(255, 255, 255, 0.8);
box-sizing: border-box;
padding: 0 30upx;
border-radius: 10upx;
font-size: 26upx;
color: #333;
}
.codes input{
width: 75%;
}
.codes view{
height: 80upx;
line-height: 80upx;
width: 130upx;
margin-bottom: 60upx;
color: #FFFFFF;
background-color: rgba(70, 143, 152, 0.8);
text-align: center;
font-size: 24upx;
border-radius: 10upx;
}
.login_btn{
width: 500upx;
height: 80upx;
margin: 0 auto;
background-color: rgba(70, 143, 152, 0.8);
margin-top: 60px;
text-align: center;
line-height: 80upx;
border-radius: 40upx;
color: #fff;
}
.login_btn:active{
opacity: 0.9;
}
.wxLogin{
height: 200upx;
width: 300upx;
display: block;
margin: 0 auto;
border-radius: 50%;
position: fixed;
bottom: 5vh;
left: 50%;
transform: translateX(-50%);
}
.wxLogin view{
text-align: center;
color: #FFFFFF;
font-size: 24upx;
margin-bottom: 20upx;
}
.wxLogin image{
height: 100upx;
width: 100upx;
display: block;
z-index: 10;
margin: 0 auto;
}
.wxLogin button{
width: 100upx!important;
height: 100upx;
position: absolute;
border-radius: 50%;
text-align: center;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
opacity: 0;
z-index: 10;
padding: 0!important;
}
</style>

@ -0,0 +1,647 @@
.carousel {
height: 100vw;
width: 100vw;
position: absolute;
top: 0upx;
left: 0;
overflow: hidden;
z-index: 10;
}
.carousel swiper {
height: 100%;
}
.top_nav{
position: fixed;
top: 0;
left: 0;
z-index: 80;
}
.image-wrapper {
width: 100%;
height: 100%;
overflow: hidden;
}
.swiper-item {
display: flex;
justify-content: center;
align-content: center;
height: 100vw;
overflow: hidden;
border-bottom: 1upx solid rgba(0, 0, 0, 0.01);
position: relative;
}
.swiper-item image {
width: 100%;
height: 100%;
}
.place {
height: 100vw;
position: relative;
top: 0;
left: 0;
overflow: hidden;
}
.goods_info {
padding: 30upx 4%;
padding-bottom: 20upx;
position: relative;
}
.goods_info .goods_name {
font-size: 30upx;
font-weight: bold;
color: #333;
width: 100%;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods_info .goods_price {
height: 80upx;
line-height: 80upx;
display: flex;
align-items: center;
}
.goods_price .money {
font-size: 42upx;
font-weight: bold;
color: $mycolor;
}
.goods_price .h_money {
font-size: 28upx;
margin-left: 20upx;
text-decoration: line-through;
color: #999;
}
.other{
padding: 0 4%;
height: 60upx;
line-height: 60upx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 24upx;
color: #999;
}
.baoyou {
height: 30upx;
font-size: 20upx;
/* #ifdef MP */
line-height: 30upx;
/* #endif */
/* #ifdef H5 */
line-height: 35upx;
/* #endif */
background-color: #FF546E;
padding: 0 10upx;
color: #FFFFFF;
margin-left: 30upx;
border-radius: 4upx;
}
.shoucang,
.go_btn {
width: 80upx;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
position: absolute;
right: 20upx;
top: 74%;
transform: translateY(-50%);
}
.go_btn {
top: 50% !important;
}
.shoucang .sc_icons text {
font-size: 45upx;
color: #999;
}
.shoucang .sc_text {
font-size: 22upx;
color: #333;
font-weight: 500;
}
.share {
display: flex;
padding: 0 4%;
background-color: #FAEFF7;
font-size: 24upx;
justify-content: space-between;
}
.share_btn {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
}
.share view {
display: flex;
align-items: center;
height: 80upx;
line-height: 80upx;
position: relative;
align-content: center;
}
.share view text {
margin-right: 10upx;
}
.shop {
padding: 20upx 4%;
display: flex;
justify-content: flex-start;
border-bottom: 1upx dashed #eee;
position: relative;
}
.shop .shop_img {
width: 140upx;
height: 120upx;
display: block;
overflow: hidden;
box-sizing: border-box;
border-radius: 8upx;
}
.shop_center {
overflow: hidden;
margin-left: 20upx;
}
.shop_center .shop_name {
font-size: 28upx;
color: #333;
font-weight: bold;
}
.shop_center .shop_address {
font-size: 24upx;
color: #666;
margin-top: 20upx;
width: 80%;
}
.sku_pon {
padding: 0 4%;
}
.cell {
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: flex-start;
align-items: center;
border-bottom: 1upx solid #eee;
}
.cell .text1 {
width: 30%;
color: #999;
font-size: 24upx;
}
.cell .text2 {
width: 65%;
color: #999;
font-size: 24upx;
}
.cell image {
width: 40upx;
height: 40upx;
/* display: block; */
float: right;
}
.details {
padding: 20upx 4%;
margin-top: 20upx;
border-top: 10upx solid #ddd;
margin-bottom: 120upx;
}
.details_title {
text-align: center;
color: #999;
}
.details_content {
margin-top: 30upx;
margin-bottom: 50upx;
}
.operation {
height: 100upx;
width: 100vw;
line-height: 100upx;
display: flex;
justify-content: flex-start;
align-content: center;
align-items: center;
background-color: #F0F0F0;
position: fixed;
bottom: 0;
left: 0;
padding: 0 20upx;
z-index: 90;
}
.operation .home,
.cart {
width: 80upx;
height: 80upx;
line-height: 80upx;
text-align: center;
margin-right: 20upx;
}
.operation .home text,
.cart text {
font-size: 40upx;
font-weight: bold;
color: #666;
}
.operation .btns {
display: flex;
width: 70vw;
justify-content: flex-end;
}
.operation .btns .addcart {
height: 70upx;
line-height: 70upx;
text-align: center;
border: 2upx solid #A160F0;
padding: 0 40upx;
border-radius: 40upx 0 0 40upx;
font-size: 24upx;
color: #A160F0;
font-weight: bold;
}
.operation .btns .dingjin {
height: 70upx;
line-height: 70upx;
text-align: center;
padding: 0 40upx;
border-radius: 0 40upx 40upx 0;
border-left: none;
font-size: 24upx;
color: #fff;
background-color: #A160F0;
font-weight: bold;
}
/* 优惠券 */
.coupon {
background-color: #fff;
border-radius: 10upx 10upx 0 0;
position: fixed;
left: 0;
bottom: -1000upx;
z-index: 999;
transition: all 0.3s;
}
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 900;
opacity: 0.7;
}
.scrolls {
width: 100vw;
height: 60vh;
padding-top: 10upx;
z-index: 500;
}
/* 播放视频的轮播图样式 */
.place_tow {
width: 100vw;
height: 100vw;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
}
.place_tow .videocover {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 5;
}
.playbtn {
width: 100upx!important;
height: 100upx!important;
display: block;
background-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
z-index: 999;
overflow: hidden;
image{
width: 100%;
height: 100%;
display: block;
}
}
/* 静音按钮 */
.shengyin {
position: absolute;
bottom: 40upx;
right: 40upx;
z-index: 10;
width: 50upx;
height: 50upx;
}
.shengyin image {
width: 50upx;
height: 50upx;
display: block;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.2);
}
//
.evaluate{
padding: 0 4%;
border-top: 10upx solid #ddd;
.eva_title{
height: 70upx;
margin-top: 10upx;
line-height: 70upx;
font-size: 30upx;
font-weight: bold;
color: #202020;
text{
font-weight: normal;
}
.seeAll{
float: right;
font-size: 24upx;
color: #999999;
transform: translateY(6upx);
&:active{
opacity: 0.8;
}
}
}
.evaluate_box{
.pingjia {
background-color: #ffffff;
overflow: hidden;
.pingjia_box {
overflow: hidden;
margin-top: 20upx;
padding-bottom: 20upx;
overflow: hidden;
border-bottom: 1upx solid #f2f2f2;
&:last-child {
border-bottom: none;
padding-bottom: 10upx;
}
.box_top {
display: flex;
.head {
height: 80upx;
max-width: 80upx;
min-width: 80upx;
flex: 1;
border-radius: 50%;
float: left;
}
.right {
flex: 1;
margin-left: 20upx;
position: relative;
.name {
font-size: 26upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(0, 0, 0, 1);
}
.p2 {
margin-top: 20upx;
font-size: 24upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(156, 156, 156, 1);
.text2 {
margin-left: 50upx;
}
}
.p3 {
height: 35upx;
position: absolute;
right: 0;
width: 200upx;
top: 8upx;
image {
width: 35upx;
height: 35upx;
float: left;
margin-left: 5upx;
}
}
}
}
.tag_box {
margin-top: 20upx;
overflow: hidden;
.tags {
font-size: 22upx;
font-family: Source Han Sans CN;
font-weight: 400;
background-color: #FAEFF7;
color: #FF546E;
float: left;
height: 50upx;
line-height: 50upx;
padding: 0 15upx;
border-radius: 25upx;
text-align: center;
margin-right: 20upx;
}
}
.ping_neirong {
font-size: 28upx;
margin-top: 20upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: rgba(0, 0, 0, 1);
line-height: 50upx;
}
.ping_img {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
justify-content: space-between;
margin-top: 20upx;
&::after {
content: '';
max-width: 29vw;
min-width: 29vw;
}
image {
max-width: 29vw;
min-width: 29vw;
height: 29vw;
border-radius: 10upx;
margin-bottom: 20upx;
}
}
.huifu {
padding: 20upx;
background-color: #f3f3f3;
border-radius: 10upx;
font-size: 24upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(77, 77, 77, 1);
}
}
}
}
}
.go_top{
position: fixed;
bottom: 12vh;
right: -200upx;
width: 80upx;
z-index: 200;
transition: all 0.3s;
.ontop {
width: 70upx;
height: 70upx;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 50%;
transition: all 0.3s;
}
.ontop:active {
opacity: 0.8;
}
.ontop image {
width: 45upx;
height: 55upx;
display: block;
margin: 0 auto;
padding-top: 15upx;
overflow: hidden;
}
}
.center_poter{
position: relative;
z-index: 999;
.close_btn{
width: 40upx;
height: 40upx;
background-color: rgba($color: #000000, $alpha: .3);
position: absolute;
top: 5upx;
right: 5upx;
z-index: 500;
padding: 5upx;
border-radius: 6upx;
z-index: 999;
text-align: center;
}
}
/* 预览视频弹窗 */
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .8);
z-index: 200;
}
.previewvideo {
width: 100vw;
height: 100vw;
position: fixed;
top: 50%;
left: 0;
transform: translateY(-50%);
background-color: #000;
z-index: 900;
opacity: 1;
}
.close {
display: flex;
align-content: center;
align-items: flex-end;
position: absolute;
top: 140upx;
right: 20upx;
z-index: 900;
image {
width: 50upx;
height: 50upx;
display: block;
justify-content: center;
margin-left: 30upx;
margin-bottom: 20upx;
border-radius: 50%;
padding: 10upx;
background-color: rgba(0, 0, 0, 0.2);
}
}
.videos {
height: 100vw;
width: 100vw;
z-index: 10;
position: relative;
video {
width: 100%;
height: 100%;
}
}
.nowvideos {
width: 100%;
height: 100%;
margin: 0 auto;
}

@ -0,0 +1,643 @@
<template>
<view class="goodsDetails">
<!-- 顶部自定义导航栏 -->
<view class="top_nav">
<navBar textcolor="#000" :showLeft="true" :showTitle="false"></navBar>
</view>
<!-- 轮播图 -->
<swipers :goodsData="goodsData" @setShowVideo="setShowVideo"></swipers>
<!-- 占位 -->
<!-- #ifndef MP -->
<view class="place" :style="'top:-' + toBar"></view>
<!-- #endif -->
<!-- 商品信息 -->
<view class="goods_info">
<view class="goods_name">
{{goodsData.title}}
</view>
<view class="text-gray text-sm padding-top-xs">
{{goodsData.skuSubTitle}}
</view>
<view class="goods_price">
<text class="money text-lg">¥{{goodsData.money}}</text>
<text>/{{ goods.unit }}</text>
<text class="h_money">{{goodsData.hmoney}}</text>
</view>
<!-- <view class="shoucang">
<view class="sc_icons" @tap="setisColl">
<text :class="['iconfont',isColl == true?'icon-shoucang1':'icon-shoucang'] " :style="{color: isColl == true? colors :''}"></text>
</view>
<view class="sc_text" :style="{color: isColl == true? colors :''}">收藏</view>
</view> -->
</view>
<view class="other">
<!-- v-if="goodsData.baoyou == true" -->
<p>快递: 包邮</p>
<!-- <p v-else>:10</p> -->
<!-- <p>销量:{{goodsData.xiaoliang}}</p> -->
</view>
<view class="other">
<p >分类: {{ goods.category }}</p>
</view>
<view class="other">
<p >厂商: {{ goods.factory }}</p>
</view>
<!-- 分享按钮 -->
<view class="share">
<!-- <view class="tips" style="color: #666;">
<text class="iconfont icon-zuanshi" style="color: #FF546E;font-size: 38upx;font-weight: 600;"></text>
分享商品可获得商城积分
</view> -->
<!-- #ifdef MP -->
<!-- <view class="onshare" style="color: #FF546E;">
<text class="iconfont icon-fenxiang"></text>
<button open-type="share" class="share_btn">1</button>
立即分享
</view> -->
<!-- #endif -->
<!-- <view class="poster" style="color: #FF546E;" @tap="openPoster">
<text class="iconfont icon-CombinedShape"></text>
生成海报
</view> -->
</view>
<!-- 店铺信息 -->
<!-- <view class="shop">
<image class="shop_img" src="/static/images/log.png" mode="aspectFill"></image>
<view class="shop_center" style="width: 65%;">
<view class="shop_name">社区团购自营店</view>
<view class="shop_address">{{goodsData.stallAddress}}</view>
</view> -->
<!-- #ifdef MP -->
<!-- <view class="shoucang go_btn" @tap="nearAddress">
<view class="sc_icons">
<text class="iconfont icon-dizhi"></text>
</view>
<view class="sc_text">到这去</view>
</view> -->
<!-- #endif -->
<!-- #ifndef MP -->
<!-- 直接打开地图需要传递店铺的经纬度 来获取店铺的位置 -->
<!-- <view class="shoucang go_btn" @tap="openMap">
<view class="sc_icons">
<text class="iconfont icon-dizhi"></text>
</view>
<view class="sc_text">到这去</view>
</view> -->
<!-- #endif -->
<!-- </view> -->
<!-- 选择规格和优惠券 -->
<view class="sku_pon">
<view class="cell" @tap="openSku">
<text class="text1">商品规格</text>
<text class="text2">{{ goods.specs }}</text>
<image src="/static/images/home/right.png"></image>
</view>
<!-- <view class="cell" style="border:none" @tap="opencoupon">
<text class="text1"> </text>
<text class="text2" :style="{color: colors}">领取优惠券</text>
<image src="/static/images/home/right.png"></image>
</view> -->
</view>
<!-- 商品评价 -->
<!-- view class="evaluate">
<p class="eva_title">
商品评价<text>(10)</text>
<text class="seeAll" @click="seeAll"></text>
</p>
<view class="evaluate_box">
<view class="pingjia">
<view v-if="goodsEva.length !== 0">
<view class="pingjia_box" v-for="(row, index) in goodsEva" :key="index">
<view class="box_top">
<image :src="row.headimg" mode="" class="head"></image>
<view class="right">
<p class="name">{{ row.nickname }}</p>
<p class="p2">
<text class="text1">{{ row.create_time }}</text>
<text class="text2">{{ row.goods_name }}</text>
</p>
<p class="p3">
<image src="/static/images/home/stars.png" v-for="s in row.score" :key="s" mode=""></image>
<block v-if="row.score !== 5">
<image src="/static/images/home/star-no.png" v-for="(s,h) in (5-row.score)" :key="h" mode=""></image>
</block>
</p>
</view>
</view>
<view class="tag_box" v-if="row.tags.length !== 0">
<view class="tags" v-for="(s,x) in row.tags" :key="x">{{s}}</view>
</view>
<view class="ping_neirong">{{ row.comment }}</view>
<view class="ping_img" v-if="row.images.length !== 0">
<image :src="s" mode="" v-for="(s,x) in row.images" :key="x" @click="preview(row.images, x)"></image>
</view>
<view class="huifu" v-if="row.reply && row.reply !== ''">{{ row.reply }}</view>
</view>
</view>
</view>
</view>
</view> -->
<!-- 商品详情 -->
<view class="details">
<view class="details_title">
<text style="color: #666666;margin: 0 20upx;"> 商品详情 </text>
</view>
<view class="details_content">
<rich-text :nodes="htmlNode"></rich-text>
</view>
</view>
<!-- 底部操作栏 -->
<view class="operation">
<view class="home" @tap="toHome">
<text class="iconfont icon-shouye"></text>
</view>
<view class="cart" @tap="toCart">
<text class="iconfont icon-gouwuche1"></text>
</view>
<view class="btns">
<view class="addcart" :style="'border-color:' + colors + ';color:' + colors" @tap="openSku">
加入购物车
</view>
<view class="dingjin" :style="'background:' + colors" @tap="openSku">
</view>
</view>
</view>
<!-- 规格弹出层 -->
<sku :skuList="nowList" :showModal="showModal" :colors="colors" bottoms="0" @onhide="onhide"></sku>
<!-- 选择优惠券弹出层 -->
<view class="mask" catchtouchmove="preventTouchMove" v-if="couponshow == true" @tap="hidecoupon"></view>
<view class="coupon" :style="'bottom:' + (couponshow == true ? '0px':'')">
<scroll-view class="scrolls" scroll-y>
<coupon :colors="colors" :couponList="couponList" @onReceive="onReceive"></coupon>
</scroll-view>
</view>
<!-- 返回顶部按钮 -->
<view class="go_top" :style="'right: ' + (scrollShow == true ? '3%':'-200upx')">
<view class="ontop" @tap="goTop">
<image src="/static/images/home/TOP.png"></image>
</view>
</view>
<uni-popup ref="popup" type="center">
<view class="center_poter" style="margin: 0 auto;" v-if="shows">
<!-- #ifndef MP -->
<image class="close_btn" src="/static/images/goods/close.png" @click="hidePoster">
</image>
<!-- #endif -->
<!-- #ifdef MP -->
<cover-image class="close_btn" src="/static/images/goods/close.png" @click="hidePoster">
</cover-image>
<!-- #endif -->
<poster :posterData="goodsData"></poster>
</view>
</uni-popup>
<!-- 预览视频弹窗 -->
<view class="mask" v-if="showVideo == true" @touchmove.stop.prevent="ondefault" @click="hideShow">
<view class="close">
<image src="/static/images/goods/close.png"></image>
</view>
</view>
<view class="previewvideo" v-if="showVideo == true">
<view class="videos">
<video class="nowvideos" id="nowVideo" v-if="showVideo == true" :src="goodsData.videos" :autoplay="showVideo"
:show-center-play-btn="true" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
</view>
<!-- 用来承载H5预览视频的 -->
<view style="position: absolute;top: -999upx;left: -999upx;">
<video ref="newVideo" id="newVideo" :src="goodsData.videos"
:autoplay="showVideo"
:show-center-play-btn="false" :show-mute-btn="true" :show-fullscreen-btn="false" @fullscreenchange="hideShow"></video>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import uniPopup from '@/components/uni-popup/uni-popup.vue'
import navBar from "../../commponent/public/navBar";
import sku from "../../commponent/public/sku";
import coupon from "../../commponent/public/coupon";
import loading from "../../commponent/public/loading";
import poster from '../../commponent/goods/poster.vue'
import swipers from './swiper/swiper.vue'
import {getGoodsDetails,getlocation} from '@/utils/auth.js'
export default {
data() {
return {
good:{}, //
colors: '',
shows: false,
statusBarHeight: app.globalData.statusHeight + 'px',
toBar: app.globalData.toBar+ 'px',
showdots: false,
swiperList: [],
isColl: false,
latitude: '',
longitude: '',
nowList: {},
goods: {},
goodsData: {
title: '',
skuSubTitle:'',
type: 1,
goods_id: 201,
money: 0,
number: 1,
hmoney: '',
img: '',
youhui: true,
baoyou: true,
status: 0, // 0 1
stock: 600,
xiaoliang:'',//
videos: '',
imgList: [],
stallAddress:"社区团购模拟地址",//
sku: [],
skuArr: []
},
showModal: false,
couponshow: false,
isshowVideo: true,
voice: false,
showVideo: false,
isShow: true,
couponList: [ //
{
money: 100,
reduce: 10,
date: '2020-02-09 2020-10-02',
id: 1,
status: 0,
condition: ['新人专享', '仅在支付时使用', '可与其他产品共享']
}, {
money: 100,
reduce: 20,
date: '2020-02-09 2020-10-02',
id: 2,
status: 0,
condition: ['新人专享']
}, {
money: 100,
reduce: 30,
date: '2020-02-09 2020-10-02',
id: 3,
status: 0,
condition: ['仅在支付时使用', '可与其他产品共享']
}, {
money: 100,
reduce: 40,
date: '2020-02-09 2020-10-02',
id: 4,
status: 0,
condition: ['新人专享', '可与其他产品共享']
}, {
money: 100,
reduce: 50,
date: '2020-02-09 2020-10-02',
id: 5,
status: 0,
condition: ['新人专享', '仅在支付时使用']
}
],
htmlNode: '',
//
descriptionStr: '<div id="commDesc" hasdata="1" style="line-height: 2; transform-origin: 0px 0px; font-size: 30px;width:100%;"><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/99519/11/4669/136444/5de8bbdbE0cba049d/517f1fb75b582456.jpg!q70.dpg.webp" loaded="17"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/92267/13/4771/160442/5de8bbdbE50655175/7dd51e0b966aba15.jpg!q70.dpg.webp" loaded="16"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/93624/28/4672/131382/5de8bbdbE65d14e5d/81bc1227ec775788.jpg!q70.dpg.webp" loaded="15"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/97366/21/4817/101042/5de8bbdbE8854b673/7c4ce7faa45a418b.jpg!q70.dpg.webp" loaded="14"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/98311/21/4778/122770/5de8bbdcE13375754/f4324ca9294eef4c.jpg!q70.dpg.webp" loaded="13"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/103373/15/4747/118973/5de8bbdcE2058ee8e/d921d5f1a4aa5c89.jpg!q70.dpg.webp" loaded="12"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/88841/34/4711/84977/5de8bbdeE0b691b9a/e69796d32a63bbaa.jpg!q70.dpg.webp" loaded="11"><div class="for_separator"></div><img style="max-width:640px;" src="https://img30.360buyimg.com/popWaterMark/jfs/t1/95248/2/4771/99041/5de8bbdfE06b41b3b/3c4a2b1cb97a5262.jpg!q70.dpg.webp" loaded="10"></div>',
goodsEva: [ //
{
headimg: '/static/images/face.jpg',
nickname: '反转',
create_time: '2020-09-10 15:36',
goods_name: '测试规格1',
score: 5,
comment: '产品很不错,赞',
images: ['/static/images/goods/two.jpg', '/static/images/goods/one.jpg'],
reply: '感谢您的支持',
tags: ['价格合理', '味道好', '价格优惠', '态度好']
},
{
headimg: '/static/images/face.jpg',
nickname: '清风',
create_time: '2020-09-10 13:36',
goods_name: '测试规格2',
score: 4,
comment: '味道还不错~',
images: [],
reply: '',
tags: []
}
],
scrollShow: false
};
},
components: {
navBar,
sku,
coupon,
loading,
poster,
uniPopup,
swipers
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({ //
colors: app.globalData.newColor
});
this.getLocation(); //
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
// #ifdef APP-PLUS
this.toBar = app.globalData.toBar + 25 + 'px'
// #endif
this.newVideo = uni.createVideoContext('newVideo');
this.goods = getGoodsDetails();
this.good = this.goods
this.setFrom(this.goods.url); //
this.goodsData.title = this.goods.goodsName;
// this.goodsData.skuSubTitle = this.goods.skuSubTitle.text;
// if(this.goods.dashPrice)
// {this.goodsData.hmoney = this.goods.dashPrice.text;}
this.goodsData.money = parseFloat(this.goods.price);
this.goodsData.img = this.goods.url;
this.goodsData.imgList.push(this.goods.url);
// this.goodsData.imgList.push(this.good.detailPagePic);
this.goodsData.xiaoliang = this.goods.id;
this.goodsData.goods_id = this.goods.id;
if(this.goods.specs){
const specs = this.goods.specs.split('|')
this.goodsData.sku = [{
sku_id: this.goods.id,
skuname: '规格',
child: specs.map((v, index) => {
return {
tagname: v,
id: index + 1,
imgs: '',
money: this.goods.price
}
})
}]
this.goodsData.skuArr = specs.map(v => {
return {
"goods_sku_arr": [
"2011"
],
"goods_sku_text": v,
"img": this.goods.url,
"money": this.goodsData.money,
"stock": 999
}
})
}
if(getlocation()){this.goodsData.stallAddress = getlocation().poiaddress}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面滚动
*/
onPageScroll: function(e) {
if (e.scrollTop >= 400) {
this.scrollShow = true
} else {
this.scrollShow = false
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: this.goodsData.title,
path: '/pages/views/goods/goodsDetails',
imageUrl: this.goodsData.img
}
},
/**
* 用户点击右上角分享到朋友圈
*/
onShareTimeline: function() {
return {
title: this.goodsData.title,
path: '/pages/views/goods/goodsDetails',
imageUrl: this.goodsData.img
}
},
methods: {
getLocation() {
let that = this;
uni.getLocation({
type: 'wgs84',
geocode: true,
success: res => {
console.log('获取经纬度成功', res);
that.setData({
latitude: res.latitude,
longitude: res.longitude
});
},
fail: () => {
console.log('获取经纬度失败');
that.setData({
latitude: '',
longitude: ''
});
},
complete: () => { //
}
});
},
setFrom(html) {
let _html = `<div> <img src="${html}" /> </div>`
//
let newContent = _html.replace(/\<img/gi, '<img class="rich-img" ');
this.setData({
htmlNode: newContent
});
},
openPoster() { //
this.shows = false
uni.showLoading({
title: '海报绘制中..'
})
this.$refs.popup.open()
setTimeout(() => {
uni.hideLoading()
this.shows = true
}, 600)
},
hidePoster(){//
this.$refs.popup.close()
},
setisColl() {
//
let iscoll = !this.isColl;
this.setData({
isColl: iscoll
});
},
openMap() {
//
let that = this;
uni.openLocation({
latitude: 39.90,
longitude: 116.40,
success: e => {
}
});
},
nearAddress() {
if (this.longitude !== '') {
this.openMap();
} else {
const _this = this; //
uni.getSetting({
success(res) {
if (res && res.authSetting && res.authSetting.hasOwnProperty('scope.userLocation')) {
uni.openSetting({
success() {
_this.getLocation();
}
});
}
}
});
}
},
setShowVideo(showVideo, isH5){ //
this.showVideo = showVideo
if(isH5 == true){
this.newVideo.play()
}
},
hideShow(){
this.showVideo = false
},
ondefault(){ //
},
onhide() {
this.showModal = false
},
openSku() {
this.nowList = this.goodsData
console.log(this.nowList)
this.showModal = true
},
opencoupon() {
this.couponshow = true
},
hidecoupon() {
this.couponshow = false
},
toHome() {
uni.switchTab({
url: '/pages/views/tabBar/category'
});
},
toCart() {
uni.switchTab({
url: '/pages/views/tabBar/cart'
});
},
goTop() { //
uni.pageScrollTo({
scrollTop: 0
});
},
onReceive(item, index) { //
console.log(item, index)
if (item.status == 1) {
return
} else {
this.couponList[index].status = 1 //
uni.showToast({
title: '领取成功',
icon: 'none'
})
}
},
seeAll() { //
uni.navigateTo({
url: '/pages/views/goods/goodsEvaluate'
})
}
}
};
</script>
<style scoped lang="scss">
@import "./goodsDetails.scss";
/deep/.rich-img {
width: 100%;
height: auto;
}
</style>

@ -0,0 +1,448 @@
<template>
<!-- 商品评价 -->
<view class="evaluate">
<!-- 顶部tab -->
<view class="tabs">
<view v-for="(item, index) in tabList" :key="index" class="tabs_list" @tap="setTabs(item, index)"
:style="'color:' + (active == index ?colors :'') + ';font-weight:' + (active == index ?'bold' : '500')">
{{item.name}}({{item.number}})
<view class="active" :style="'background:' + colors" v-if="active == index"></view>
</view>
</view>
<!-- 评价列表 -->
<view class="my_evaluate" >
<view class="evaluate_box">
<view class="pingjia">
<view v-if="goodsEva.length !== 0">
<view class="pingjia_box" v-for="(row, indexs) in goodsEva" :key="indexs">
<view class="box_top">
<image :src="row.headimg" mode="" class="head"></image>
<view class="right">
<p class="name">{{ row.nickname }}</p>
<p class="p2">
<text class="text1">{{ row.create_time }}</text>
<text class="text2">{{ row.goods_name }}</text>
</p>
<p class="p3">
<!-- 循环遍历星星 -->
<image src="/static/images/home/stars.png" v-for="i in row.score" :key="i" mode="" ></image>
<block v-if="row.score !== 5">
<image src="/static/images/home/star-no.png" v-for="(s,h) in (5-row.score)" :key="h" mode="" ></image>
</block>
</p>
</view>
</view>
<view class="tag_box" v-if="row.tags.length !== 0">
<view class="tags" v-for="(s,x) in row.tags" :key="x">{{s}}</view>
</view>
<view class="ping_neirong">{{ row.comment }}</view>
<view class="ping_img" v-if="row.images.length !== 0 || row.video.length !== 0">
<image :src="s" mode="" v-for="(s,x) in row.images" :key="x" @click="preview(row.images, x)"></image>
<view class="video" v-for="(video, videos) in row.video" :key="String(videos+1)">
<!-- 建议设置视频封面 封面壁纸为https网络图片 video层级高会覆盖loading 所以先隐藏-->
<video v-if="isShow == false" :controls="false" id="coverVideo" :src="video.videourl" :poster="video.poster" :show-center-play-btn="false" :show-play-btn="false" :enable-progress-gesture="false">
<cover-view class="covers"></cover-view>
<cover-image class="imgs" v-if="showVideo == false" src="/static/images/goods/bofang.png" mode="" @click="onplayVideos" :data-videos="video.videourl"></cover-image>
</video>
</view>
</view>
<!-- 回复 -->
<view class="huifu" v-if="row.reply && row.reply !== ''">{{ row.reply }}</view>
</view>
<p class="onbottom"> 到底了 </p>
</view>
</view>
</view>
</view>
<!-- 预览视频弹窗 -->
<view class="mask" v-if="showVideo == true" @touchmove.stop.prevent="ondefault" @click="closeVideo">
<view class="close">
<image src="/static/images/goods/close.png"></image>
</view>
</view>
<view class="previewvideo" v-if="showVideo == true">
<view class="videos">
<video class="nowvideos" id="nowVideo" v-if="showVideo == true" :src="videos" :autoplay="showVideo"
:show-center-play-btn="false" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
</view>
<!-- 用来兼容H5操作的 -->
<view style="position: absolute;top: -999upx;left: -999upx;">
<video ref="nowVideo" id="newVideo" :src="videos"
:autoplay="showVideo"
:show-center-play-btn="true" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
<nodata v-if="goodsEva.length == 0" :colors="colors"></nodata>
<loading v-if="isShow == true"></loading>
</video>
</view>
</template>
<script>
let app = getApp()
import loading from "../../commponent/public/loading";
import tabs from '../../commponent/public/tabs.vue'
export default {
components: {
tabs,
loading
},
data() {
return {
colors: '',
temporary:[],
platform:'',
isShow:true,
videos:'',
showVideo:false,
tabList: [{
name: '最新',
number: 10,
id: 0
}, {
name: '好评',
number: 8,
id: 1
}, {
name: '中评',
number: 8,
id: 2
}, {
name: '差评',
number: 6,
id: 3
}, {
name: '有图',
number: 5,
id: 4
}],
active: 0,
goodsEva:[ //
{headimg:'/static/images/face.jpg',nickname:'反转',create_time:'2020-09-10 15:36',goods_name:'测试规格1', score:5,comment:'产品很不错,赞',images:['/static/images/goods/two.jpg','/static/images/goods/one.jpg'],reply:'感谢您的支持',tags:['价格合理','味道好','价格优惠','态度好'],video:[]},
{headimg:'/static/images/face.jpg',nickname:'清风',create_time:'2020-09-10 13:36',goods_name:'测试规格2', score:4,comment:'针不戳,住在山里面针不戳~',images:['/static/images/goods/two.jpg'],reply:'',tags:[],video:[{vid:1,videourl:'https://fzdz.soft.haoyangsoft.com/uploads/system/videos/20200813/6c819d24ee6868aee33e150c4333329b.mp4',poster:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603080909940&di=ac10c5f2c952dd1b40441bb696c55a88&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn%2Fw640h640%2F20180127%2F369b-fyqzcxh1087346.jpg"}]},
{headimg:'/static/images/face.jpg',nickname:'明月',create_time:'2020-09-10 15:36',goods_name:'测试规格2', score:5,comment:'产品很不错,赞',images:['/static/images/goods/two.jpg','/static/images/goods/one.jpg'],reply:'感谢您的支持',tags:['价格合理','态度好'],video:[]},
]
}
},
onReady() {
this.newVideo = uni.createVideoContext('newVideo');
this.nowVideo = uni.createVideoContext('nowVideo');
},
onLoad() {
this.platform = uni.getSystemInfoSync().platform //ios
this.colors = app.globalData.newColor; //
this.temporary = this.goodsEva
setTimeout(()=>{
this.isShow = false
},600)
},
methods:{
ondefault(){ //
},
setTabs(item,index){ //
this.active = index
this.goodsEva = index == 0 ? this.temporary : []
},
preview(imgs, index){ //
uni.previewImage({
current:index,
urls:imgs
})
},
onplayVideos(video){
this.videos = video.currentTarget.dataset.videos
// #ifdef MP
// ,H5
this.showVideo = true
setTimeout(()=>{
// this.nowVideo.play()
},300)
// #endif
// #ifdef APP-PLUS
// APP
this.showVideo = true
// #endif
// #ifdef H5
// H5video
if(this.platform == 'android'){
this.newVideo.play();
}else{
this.showVideo = true
}
// #endif
},
closeVideo(){
this.showVideo = false
}
}
}
</script>
<style lang="scss" scoped>
.tabs {
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: flex-start;
align-items: center;
background-color: #fff;
border-bottom: 1upx solid rgba($color: #eee, $alpha: 0.5);
.tabs_list {
flex: 1;
text-align: center;
font-size: 28upx;
position: relative;
color: #333;
}
.active {
font-weight: bold;
color: #DD4F42;
width: 50upx;
height: 4upx;
border-radius: 20upx;
background-color: #DD4F42;
position: absolute;
bottom: 0upx;
left: 50%;
transform: translateX(-50%);
transition: all 0.3s;
}
}
.my_evaluate{
padding: 20upx 4%;
.eva_title{
height: 70upx;
margin-top: 10upx;
line-height: 70upx;
font-size: 30upx;
font-weight: bold;
color: #202020;
text{
font-weight: normal;
}
.seeAll{
float: right;
font-size: 24upx;
color: #999999;
transform: translateY(6upx);
&:active{
opacity: 0.8;
}
}
}
.evaluate_box{
.pingjia {
background-color: #ffffff;
overflow: hidden;
.pingjia_box {
overflow: hidden;
margin-top: 20upx;
padding-bottom: 20upx;
overflow: hidden;
border-bottom: 1upx solid #f2f2f2;
&:last-child {
border-bottom: none;
padding-bottom: 10upx;
}
.box_top {
display: flex;
.head {
height: 80upx;
max-width: 80upx;
min-width: 80upx;
flex: 1;
border-radius: 50%;
float: left;
}
.right {
flex: 1;
margin-left: 20upx;
position: relative;
.name {
font-size: 26upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(0, 0, 0, 1);
}
.p2 {
margin-top: 20upx;
font-size: 24upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(156, 156, 156, 1);
.text2 {
margin-left: 50upx;
}
}
.p3 {
height: 35upx;
position: absolute;
right: 0;
width: 200upx;
top: 8upx;
image {
width: 35upx;
height: 35upx;
float: left;
margin-left: 5upx;
}
}
}
}
.tag_box {
margin-top: 20upx;
overflow: hidden;
.tags {
font-size: 22upx;
font-family: Source Han Sans CN;
font-weight: 400;
background-color: #FAEFF7;
color: #FF546E;
float: left;
height: 50upx;
line-height: 50upx;
padding: 0 15upx;
border-radius: 25upx;
text-align: center;
margin-right: 20upx;
}
}
.ping_neirong {
font-size: 28upx;
margin-top: 20upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: rgba(0, 0, 0, 1);
line-height: 50upx;
}
.ping_img {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
justify-content: space-between;
margin-top: 20upx;
&::after {
content: '';
max-width: 29vw;
min-width: 29vw;
}
image,video {
max-width: 29vw;
min-width: 29vw;
height: 29vw;
border-radius: 5upx;
margin-bottom: 20upx;
}
.video{
position: relative;
max-width: 29vw;
min-width: 29vw;
height: 29vw;
overflow: hidden;
border-radius: 5upx;
video{
overflow: hidden;
position: relative;
border-radius: 5upx;
.covers{ //
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 9990;
}
.imgs{
width: 72upx;
height: 72upx;
position: absolute;
top: 50%;
left: 50%;
z-index: 9999;
transform: translate(-50% ,-50%);
}
}
}
}
.huifu {
padding: 20upx;
background-color: #f3f3f3;
border-radius: 10upx;
font-size: 24upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(77, 77, 77, 1);
}
}
}
}
}
.onbottom{
height: 80upx;
line-height: 80upx;
text-align: center;
font-size: 24upx;
color: #ccc;
}
/* 预览视频弹窗 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0,0,0,.8);
z-index: 200;
}
.previewvideo {
width: 100vw;
height: 100vw;
position: fixed;
top: 50%;
left: 0;
transform: translateY(-50%);
background-color: #000;
z-index: 900;
opacity: 1;
}
.close {
display: flex;
align-content: center;
align-items: flex-end;
position: absolute;
top: 100upx;
left: 20upx;
z-index: 900;
image {
width: 50upx;
height: 50upx;
display: block;
justify-content: center;
margin-left: 30upx;
margin-bottom: 20upx;
border-radius: 50%;
padding: 10upx;
background-color: rgba(0, 0, 0, 0.2);
}
}
.videos {
height: 100vw;
width: 100vw;
z-index: 10;
position: relative;
video{
width: 100%;
height: 100%;
}
}
.nowvideos {
width: 100%;
height: 100%;
margin: 0 auto;
}
</style>

File diff suppressed because one or more lines are too long

@ -0,0 +1,901 @@
<template>
<view class="classList">
<view class="top_nav">
<!-- #ifndef H5 -->
<view class="status_bar" :style="'height: '+ statusBarHeight"></view>
<!-- #endif -->
<!-- 搜索框 -->
<view class="search_box">
<view class="backTo" @click="backTo">
<text class="iconfont icon-fanhui"></text>
</view>
<view class="search">
<view class="input-box" >
<input placeholder="搜索关键词" placeholder-style="color:#c0c0c0;font-size:24upx;"></input>
<view class="icon search">
<image src="/static/images/home/search.png"></image>
</view>
</view>
</view>
<view class="bg"></view>
</view>
<!-- 条件筛选框 -->
<view class="screen">
<view class="screen_list" @tap="openScreen" :style="'color:' + (current == 0 ? colors:'')" data-index="0">
{{screenName}}
<text class="iconfont icon-xiasanjiao down" :style="'color:' + (current == 0 ? colors:'')"></text>
</view>
<view class="screen_list" @tap="setCurrent" :style="'color:' + (current == 1 ? colors:'')" data-index="1">
销量
</view>
<view class="screen_list" @tap="setList">
<text class="iconfont icon-gongge" :style="'font-size:30upx;font-weight:bold;color:' + (current == 2 ? colors:'#333')" v-if="modes == true"></text>
<text class="iconfont icon-liebiao" :style="'font-size:30upx;font-weight:bold;color:' + (current == 2 ? colors:'#333')" v-if="modes == false"></text>
</view>
<view class="screen_list" @tap="openPop" :style="'color:' + (current == 3 ? colors:'')" data-index="3">
筛选
</view>
<!-- 弹出筛选框 -->
<view class="more_screen" :style="'opacity:' + (isMaskShow == true?'1':'0') + ';display:' + (isMaskShow == true?'block':'none')">
<view v-for="(item, index) in screenList" :key="index" class="more_list" @tap="setScreen(item,index)">
<text :style="'font-weight:' + (onscreen == index ? 'bold':'500')">{{item.name}}</text>
<text v-if="onscreen == index" class="iconfont icon-duihao" :style="'color:' + colors + ';'"></text>
</view>
</view>
</view>
<!-- 弹出遮罩层 -->
<view class="mask" @tap="closeScreen" catchtouchmove="true" v-if="isMaskShow == true" :style="'top:'+statusBarHeight+';'"></view>
<view class="mask" @tap="hideright" catchtouchmove="true" v-if="popShow == true"></view>
<!-- 点击筛选弹出的右侧弹出窗口 -->
<view :class="popShow == true ? 'right_popup':'hide_popup'" catchtouchmove="true">
<scroll-view class="pop_scroll">
<view class="top_price">
<text> </text>
<text :style="'color:' + colors">请输入价格区间</text>
</view>
<view class="input_box">
<input placeholder="最低价"></input>
<text>-</text>
<input placeholder="最高价"></input>
</view>
<view v-for="(item, index) in classList" :key="index" class="allClass">
<view class="classtext">{{item.name}}</view>
<view class="class_box">
<!-- 选中分类条件 -->
<view v-for="(row, indexs) in item.child" :key="indexs" class="class_tag" :style="'color:' + (row.current == true ? '#fff':'#333') + ';background:' + (row.current == true ? colors:'') + ';border-color:' + (row.current == true ? colors:'') + ';'" @tap="setClass(item,row,index,indexs)">{{row.name}}</view>
</view>
</view>
</scroll-view>
<view class="bottom_btn">
<view class="reset" :style="'color:' + colors + ';border-color:' + colors" @tap="onreset"></view>
<view class="enter" :style="'background:' + colors" @tap="onenter"></view>
</view>
</view>
<!-- 二级条件选择 -->
<scroll-view scroll-x="true" class="tow_scroll" :scroll-with-animation="true" :scroll-left="scrollLeft">
<view class="scroll_tags" :style="{color:tagCurrent==index?'#ffffff':'#202020',background:tagCurrent==index?colors:'#F5F5F5'}" v-for="(item,index) in tagsList" :key="index" @click="setTags(item,index)">
{{item}}
</view>
</scroll-view>
</view>
<view class="space">
<!-- 占位 -->
</view>
<!-- 商品列表 -->
<view>
<recommend :colors="colors" :dataList="dataList" :modes="modes" :loading="loading"></recommend>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import search from "../../commponent/public/search";
import recommend from "../../commponent/home/recommend";
import loading from "../../commponent/public/loading";
export default {
data() {
return {
statusBarHeight: app.globalData.statusHeight + 'px',
toBarHeight: app.globalData.toBar + 'px',
colors: '',
classId: '',
isShow: true,
current: 0,
isMaskShow: false,
modes: true,
onscreen: 0,
scrollLeft: 0,
tagCurrent: 999,
loading: false,
screenList: [{
name: '综合',
id: 0
}, {
name: '价格升序',
id: 1
}, {
name: '价格降序',
id: 2
}],
screenName: '综合',
popShow: false,
classList: [{
name: '全部分类',
id: 1,
child: [{
name: '资源类',
id: 2
}, {
name: '工具类',
id: 3
}]
}, {
name: '品牌',
id: 2,
child: [{
name: '苹果',
id: 1
}, {
name: '华为',
id: 2
}, {
name: '小米',
id: 2
}]
}],
newdata: "",
tagsList:[
'奥利给','三只松鼠','良品铺子','达利园','稻香村','百草味','盼盼','徐福记','雀巢','蒙牛','巴莉甜甜'
],
//
dataList: [{
title: 'DUNKINDONUTS唐恩都乐美国甜甜圈6个礼盒装 随机搭配6款',
type: 1,
goods_id: 201,
money: '35.90',
number: 1,
hmoney: '45.90',
img: '/static/images/goods/one.jpg',
youhui: true,
baoyou: false,
status: 1, // 0 1
stock: 600,
sku: [{
sku_id: 1,
skuname: '口味',
child: [{
tagname: '醇黑巧克力【20枚】',
id: 2011,
imgs: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78'
},
{
tagname: '草莓味【8枚】',
id: 2012,
imgs: 'http://img11.360buyimg.com/n1/jfs/t1/74434/3/6892/331750/5d512febE54e891c4/0096ad20c3c20d23.jpg',
money: '35.90'
}
]
}],
skuArr: [{
goods_sku_arr: ['2011'],
goods_sku_text: '醇黑巧克力【20枚】',
img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78',
stock: 345
},
{
goods_sku_arr: ['2012'],
goods_sku_text: '草莓味【8枚】',
img: 'http://img11.360buyimg.com/n1/jfs/t1/74434/3/6892/331750/5d512febE54e891c4/0096ad20c3c20d23.jpg',
money: '35.90',
stock: 255
},
]
},
{
title: '真巧 巧克力涂层甜甜圈 早餐蛋糕手撕面包休闲小零食办公室小吃零嘴下午茶点心 500g甜甜圈拉花款',
type: 2,
goods_id: 202,
money: '29.9',
number: 75,
hmoney: '39.90',
img: '/static/images/goods/two.jpg',
youhui: false,
baoyou: true,
status: 0, // 0 1
stock: 100,
sku: [{
sku_id: 1,
skuname: '口味',
child: [{
tagname: '500g甜甜圈彩针款',
id: 2021,
imgs: 'http://img14.360buyimg.com/n1/jfs/t1/72185/1/7121/222065/5d5377d5E46e681fa/6f100c77965b9165.jpg',
money: '39.90'
},
{
tagname: '500g甜甜圈拉花款',
id: 2022,
imgs: 'http://img14.360buyimg.com/n1/jfs/t1/72191/2/6973/239664/5d5377d5Ef952d7d9/606e70d2b6dd44d2.jpg',
money: '39.90'
}
]
}],
skuArr: [{
goods_sku_arr: ['2021'],
goods_sku_text: '500g甜甜圈彩针款',
img: 'http://img14.360buyimg.com/n1/jfs/t1/72185/1/7121/222065/5d5377d5E46e681fa/6f100c77965b9165.jpg',
money: '39.90',
stock: 50
},
{
goods_sku_arr: ['2022'],
goods_sku_text: '500g甜甜圈拉花款',
img: 'http://img14.360buyimg.com/n1/jfs/t1/72191/2/6973/239664/5d5377d5Ef952d7d9/606e70d2b6dd44d2.jpg',
money: '39.90',
stock: 50
},
]
},
{
title: '钟薛高 钟意你系列 特牛乳*4片 丝绒可可*4片 半巧主义*2 冰淇淋生鲜雪糕 10片装',
type: 3,
goods_id: 203,
money: '152.00 ',
number: 1,
hmoney: '162.00',
img: '/static/images/goods/there.jpg',
youhui: true,
baoyou: true,
status: 0, // 0 1
stock: 200,
sku: [],
skuArr: []
},
{
title: '农谣人 原味火山石烤肠1000g/约16根台式原味肠地道肠纯肉肠热狗肠台湾烤肠香肠烧烤肠半熟食火腿肠 台式原味地道肠1kg',
type: 6,
goods_id: 204,
money: '52.00 ',
number: 1,
hmoney: '99.00 ',
youhui: false,
baoyou: false,
stock: 100,
img: '/static/images/goods/six.jpg',
status: 0, // 0 1
sku: [{
skuname: '口味',
sku_id: 1,
child: [{
tagname: '台式原味地道肠1kg',
id: 2041,
imgs: 'http://img10.360buyimg.com/n1/jfs/t1/118993/11/329/175715/5e8ac0afE94234346/3ceb1344cf34d655.jpg',
money: '52.00 '
},
{
tagname: '台式黑椒味地道肠1kg',
id: 2042,
imgs: 'http://img11.360buyimg.com/n1/jfs/t1/114876/9/17594/220403/5f5ae35bEc7bb735b/bcf0c1017e86894c.png',
money: '53.50'
}
]
}, ],
skuArr: [{
goods_sku_arr: ['2041'],
goods_sku_text: '台式原味地道肠1kg',
img: 'http://img10.360buyimg.com/n1/jfs/t1/118993/11/329/175715/5e8ac0afE94234346/3ceb1344cf34d655.jpg',
money: '52.00',
stock: 50
},
{
goods_sku_arr: ['2042'],
goods_sku_text: '台式黑椒味地道肠1kg',
img: 'http://img11.360buyimg.com/n1/jfs/t1/114876/9/17594/220403/5f5ae35bEc7bb735b/bcf0c1017e86894c.png',
money: '53.50',
stock: 50
},
]
},
{
title: '巧妈妈 鸡蛋布甸 下午茶休闲零食儿童果冻布丁125g双层果酱味smzdm 4杯鸡蛋布甸双层',
type: 4,
goods_id: 205,
money: '25.80',
number: 1,
hmoney: 35.00,
img: '/static/images/goods/four.jpg',
youhui: true,
baoyou: false,
stock: 500,
status: 0, // 0 1
skuArr: [{
goods_sku_arr: ['10', '40'],
goods_sku_text: '鸡蛋布旬 4杯装',
img: '/static/images/goods/four.jpg',
money: '25.80',
stock: 50
},
{
goods_sku_arr: ['10', '50'],
goods_sku_text: '鸡蛋布旬 6杯装',
img: '/static/images/goods/four.jpg',
money: '32.80',
stock: 10
},
{
goods_sku_arr: ['10', '60'],
goods_sku_text: '鸡蛋布旬 8杯装',
img: '/static/images/goods/four.jpg',
money: '52.80',
stock: 60
},
{
goods_sku_arr: ['20', '60'],
goods_sku_text: '乳酸菌布甸(草莓酱 8杯装',
img: 'http://img11.360buyimg.com/n1/jfs/t1/97403/35/15115/138620/5e6eeae8E8dbb7c3b/90a57a2a3e696b80.jpg',
money: '52.80',
stock: 100
},
{
goods_sku_arr: ['30', '50'],
goods_sku_text: '乳酸菌布甸(蓝莓酱 8杯装',
img: 'http://img12.360buyimg.com/n1/jfs/t1/127005/26/7147/367042/5f0eb18cE9efa12ea/1a8363f7ce5a06cb.jpg',
money: '32.80',
stock: 1300
},
],
sku: [{
sku_id: 1,
skuname: '口味',
child: [{
tagname: '鸡蛋布旬',
id: 10,
imgs: '/static/images/goods/four.jpg',
money: '25.80'
},
{
tagname: '乳酸菌布甸(草莓酱)',
id: 20,
imgs: 'http://img11.360buyimg.com/n1/jfs/t1/97403/35/15115/138620/5e6eeae8E8dbb7c3b/90a57a2a3e696b80.jpg',
money: '14.80'
},
{
tagname: '乳酸菌布甸(蓝莓酱)',
id: 30,
imgs: 'http://img12.360buyimg.com/n1/jfs/t1/127005/26/7147/367042/5f0eb18cE9efa12ea/1a8363f7ce5a06cb.jpg',
money: '30.80'
}
]
},
{
sku_id: 2,
skuname: '数量',
child: [{
tagname: '4杯装',
id: 40,
imgs: '',
money: '25.80'
},
{
tagname: '6杯装',
id: 50,
imgs: '',
money: '32.80'
},
{
tagname: '8杯装',
id: 60,
imgs: '',
money: '52.80'
}
]
},
]
},
{
title: '草莓云南夏季草莓新鲜水果3斤礼盒装 露天种植现摘现发 3斤精品装4盒顺丰空运',
type: 5,
goods_id: 206,
money: '59.90',
number: 200,
hmoney: '70.90',
youhui: true,
baoyou: true,
img: '/static/images/goods/five.jpg',
status: 0, // 0 1
stock: 140,
sku: [{
sku_id: 1,
skuname: '种类',
child: [{
tagname: '3斤精品装',
id: 2061,
imgs: 'http://img10.360buyimg.com/n1/jfs/t1/71401/15/15968/470755/5ddb8ecaEe6a5ce65/140942226e7c7551.jpg',
money: '59.90'
},
{
tagname: '5斤精品装',
id: 2062,
imgs: 'http://img10.360buyimg.com/n1/jfs/t1/82339/35/16255/632261/5ddb8ecdE628ab494/cacc1d2241e9f65f.jpg',
money: '82.90'
},
]
}, ],
skuArr: [{
goods_sku_arr: ['2061'],
goods_sku_text: '3斤精品装',
img: 'http://img10.360buyimg.com/n1/jfs/t1/71401/15/15968/470755/5ddb8ecaEe6a5ce65/140942226e7c7551.jpg',
money: '59.90',
stock: 80
},
{
goods_sku_arr: ['2062'],
goods_sku_text: '5斤精品装',
img: 'http://img10.360buyimg.com/n1/jfs/t1/82339/35/16255/632261/5ddb8ecdE628ab494/cacc1d2241e9f65f.jpg',
money: '82.90',
stock: 60
}
],
}
],
};
},
components: {
search,
recommend,
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let classId = options.classId;
this.setData({
colors: app.globalData.newColor,
classId: classId
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
setCurrent(e) {
console.log(e);
let index = e.currentTarget.dataset.index;
this.setData({
current: index
});
},
openScreen(e) {
let index = e.currentTarget.dataset.index;
console.log(e)
this.setData({
current: index,
isMaskShow: !this.isMaskShow
});
},
closeScreen() {
this.setData({
isMaskShow: false
});
},
setList() {
this.setData({
modes: !this.modes
});
},
setScreen(item,index) {
this.setData({
onscreen: index,
screenName: item.name,
isMaskShow: false
});
},
openPop() {
this.setData({
popShow: true
});
},
hideright() {
this.setData({
popShow: false
});
},
setClass(item,row,index,indexs) { //
row.current = row.current == true ? false : true
item.child[indexs] = row;
let data = item;
let newdata = 'classList[' + index + ']';
this.setData({
[newdata]: data
});
},
onreset() { //
let data = this.classList;
data.forEach(e => {
e.child.forEach(ele => {
ele.current = false;
});
});
this.setData({
classList: data,
popShow: false
});
},
onenter() { //
this.setData({
popShow: false
});
let select = []
this.classList.forEach(e=>{
e.child.forEach(ele => {
if(ele.current == true){
select.push(ele)
}
});
})
console.log('选中的项', select)
},
backTo(){
uni.navigateBack(-1)
},
setTags(item, index){ //tag
this.tagCurrent = index
this.isShow = true
let scrollLeft = index * 38;
if (index <= 2) {
scrollLeft = 0;
}
this.scrollLeft = scrollLeft
setTimeout(()=>{
this.isShow = false
},500)
}
}
};
</script>
<style scoped lang="scss">
.classList{
width: 100%;
height: 100%;
}
.top_nav{
min-height: 240upx;
width: 100%;
background-color: #FFFFFF;
border-bottom: 1upx solid rgba($color: #eee, $alpha: 0.6);
position: fixed;
top: 0;
left: 0;
z-index: 200;
}
.space{
width: 100%;
height: 240upx;
background-color: #F8F8F8;
/* #ifdef APP-PLUS */
height: 280upx;
/* #endif */
}
.status_bar{
width: 100vw;
overflow: hidden;
display: block;
background-color: #FFFFFF;
z-index: 900;
}
.scroll_box{
height: calc(100vh - 260upx);
}
.search_box{
padding: 0 20upx;
z-index:900;
height: 80upx;
width: 100%;
padding-top: 30upx;
position: relative;
display: flex;
align-items: center;
.backTo{
color: #202020;
z-index: 20;
margin-right: 30upx;
width: 8%;
text-align: center;
text{
font-size: 34upx;
}
}
.search{
/* #ifndef MP */
width: 90%;
/* #endif */
/* #ifdef MP */
width: 60%;
/* #endif */
z-index: 900;
.input-box {
width: 100%;
height: 60upx;
background-color: #f5f5f5;
position: relative;
display: flex;
align-items: center;
border-radius: 30upx;
z-index: 900;
}
.input-box .icon {
display: flex;
align-items: center;
position: absolute;
top: 10upx;
right: 20upx;
width: 40upx;
height: 40upx;
font-size: 32upx;
color: #c0c0c0;
}
.search image{
width: 40upx;
height: 40upx;
display: block;
}
.input-box input {
padding-left: 28upx;
height: 28upx;
font-size: 28upx;
}
}
}
.search_box .bg{
width: 100%;
height: 100%;
background-color: #fff;
position: absolute;
top: 0;
left: 0;
}
.screen{
height: 80upx;
line-height: 80upx;
display: flex;
align-items: center;
padding: 0 10upx;
z-index: 900;
position: relative;
background-color: #fff;
}
.screen .screen_list {
flex: 1;
text-align: center;
font-size: 28upx;
color: #333;
font-weight: 500;
.down{
margin-left: 10upx;
}
}
.screen_list text{
font-size: 24upx;
font-weight: normal;
}
.more_screen{
width: 100%;
padding: 0 60upx;
border-bottom-left-radius: 20upx;
border-bottom-right-radius: 20upx;
position: absolute;
background-color: #fff;
top: 80upx;
left: 0;
padding-bottom: 20upx;
opacity: 0;
transition: all 0.3s;
}
.more_list{
height: 80upx;
line-height: 80upx;
}
.more_list .iconfont{
float: right;
}
.mask{
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 800;
}
/* 右侧弹出框 */
.right_popup{
width: 85%;
height: 100%;
position: fixed;
right: 0;
top: 0;
background-color: #fff;
z-index: 920;
transition: all 0.3s;
}
.hide_popup{
transition: all 0.3s;
width: 85%;
height: 100%;
position: fixed;
right: -100%;
top: 0;
z-index: 920;
transition: all 0.3s;
background-color: #fff;
}
.pop_scroll{
/* #ifndef H5 */
height: calc(90% - 120upx);
margin-top: 120upx;
/* #endif */
/* #ifdef H5 */
height: 90%;
margin-top: 20upx;
/* #endif */
}
.top_price{
height: 80upx;
line-height: 80upx;
display: flex;
padding: 0 20upx;
}
.top_price text{
flex: 1;
text-align: center;
font-size: 28upx;
font-weight: bold;
color: #333;
}
.input_box{
padding: 0 30upx;
height: 60upx;
line-height: 60upx;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30upx;
}
.input_box text{
color: #999;
}
.input_box input{
flex: 1;
max-width: 45%;
height: 100%;
background-color: #F7F7F7;
border-radius: 40upx;
box-sizing: border-box;
text-align: center;
font-size: 24upx;
}
.allClass{
margin-top: 50upx;
padding: 0 30upx;
}
.allClass .classtext{
font-size: 28upx;
font-weight: bold;
color: #333;
}
.allClass .class_box{
margin-top: 30upx;
overflow: hidden;
}
.class_box .class_tag{
height: 60upx;
line-height: 60upx;
padding: 0 20upx;
font-size: 26upx;
color: #333;
border: 1upx solid #999;
text-align: center;
border-radius: 30upx;
float: left;
margin-right: 20upx;
}
.bottom_btn{
height: 10%;
display: flex;
align-items: center;
align-items: center;
justify-content: space-between;
padding: 0 30upx;
}
.bottom_btn view{
max-width: 45%;
min-width: 45%;
height: 60upx;
line-height: 60upx;
background-color: #FA436A;
text-align: center;
border-radius: 35upx;
color: #fff;
}
.bottom_btn .reset{
background-color: #fff;
color: #FA436A;
border: 1upx solid #FA436A;
}
.tow_scroll{
height: 80upx;
line-height: 80upx;
padding: 0 10upx;
white-space: nowrap;
.scroll_tags{
display: inline-block;
background-color: #FFF8F5;
color: #202020;
height: 50upx;
line-height: 50upx;
padding: 0 25upx;
text-align: center;
font-size: 24upx;
border-radius: 30upx;
margin: 0 10upx;
}
}
</style>

@ -0,0 +1,31 @@
<template>
<view class="map">
<!-- h5项目下 获取个人位置(选择提货点) -->
<web-view src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=7JFBZ-V2EH4-3CCU2-DL5N2-DZQL7-RTBOJ&referer=myapp"></web-view>
</view>
</template>
<script>
import {setlocation} from '@/utils/auth.js'
// #ifdef H5
window.addEventListener('message', event=> {
//
var loc = event.data;
console.log(loc)
if (loc && loc.module == 'locationPicker') {
//postmodule'locationPicker'
let location = {
poiaddress: loc.poiaddress,
poiname: loc.poiname,
latlng: loc.latlng,
}
setlocation(location)
uni.switchTab({
url:'/pages/views/tabBar/home'
})
}
}, false);
// #endif
</script>
<style></style>

@ -0,0 +1,343 @@
<template>
<view class="content">
<view class="search-box">
<view class="input-box">
<input type="text" adjust-position="true" v-model="keyword"
:placeholder="defaultKeyword"
placeholder-class="search_text"
@confirm="doSearch"
data-key="false" confirm-type="search"
@input="onclear"></input>
<image src="/static/images/search/close.png" @tap="clears" v-if="shows == true"></image>
</view>
<view class="search-btn" @tap="doSearch" data-key="false" :style="'background:' + colors">搜索</view>
</view>
<view class="search-keyword">
<scroll-view class="keyword-list-box" v-if="isShowKeywordList" scroll-y>
<view v-for="(row, index) in keywordList" :key="index">
<view class="keyword-entry" hover-class="keyword-entry-tap">
<view class="keyword-text" @tap="jumpData(row.goods_id)">
<text style="font-size:24upx">{{row.goods_name}}</text>
</view>
</view>
</view>
</scroll-view>
<view class="keyword-box" v-if="!isShowKeywordList">
<view class="keyword-block" v-if="oldKeywordList.length>0">
<view class="keyword-list-header">
<view>历史搜索</view>
<view>
<image @tap="oldDelete" src="/static/images/search/delete.png"></image>
</view>
</view>
<scroll-view scroll-x="true" class="">
<view class="keyword">
<view v-for="(item, index) in oldKeywordList" :key="index" @tap="ondoSearch(item)">{{item}}</view>
</view>
</scroll-view>
</view>
<scroll-view scroll-y="true" >
<view class="goods-box">
123
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import { getGoodsList } from '@/api/index.js'
var app = getApp();
export default {
data() {
return {
defaultKeyword: "",
keyword: "",
oldKeywordList: [],
hotKeywordList: [],
keywordList: [],
forbid: '',
isShowKeywordList: false,
shows: false,
colors: '',
goodsList: []
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
this.init();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
methods: {
getGoodsList(val = '') {
const s = [
{
"rule": "eq",
"type": "string",
"dictCode": "",
"val": "1",
"field": "ifSale"
},
{
"rule": "like",
"type": "string",
"dictCode": "",
"val": val,
"field": "goodsName"
},
{
"rule": "like",
"type": "string",
"dictCode": "",
"val": val,
"field": "category"
},
{
"rule": "like",
"type": "string",
"dictCode": "",
"val": val,
"field": "factory"
}
]
const params = {
pageNo:1,
pageSize: 100,
superQueryParams: encodeURI(JSON.stringify(s)),
superQueryMatchType: 'or'
}
getGoodsList(params).then(res => {
this.goodsList = res.result.records
uni.hideLoading()
})
},
init() {
this.loadDefaultKeyword();
this.loadOldKeyword();
},
loadDefaultKeyword() {
//ajax,
this.setData({
defaultKeyword: "请输入您想搜索的内容"
});
},
//,Storage
loadOldKeyword() {
uni.getStorage({
key: 'OldKeys',
success: res => {
var OldKeys = JSON.parse(res.data);
this.setData({
oldKeywordList: OldKeys
});
}
});
},
doSearch() {
if (this.keyword == '') {
uni.showToast({
title: '请输入要搜索的内容',
icon: 'none'
});
return;
}
if (this.keyword && this.keyword !== '') {
this.saveKeyword(this.keyword); //
}
uni.showLoading({
title: '搜索中...'
});
this.setData({
keywordList: []
});
this.getGoodsList(this.keyword);
},
onclear(e) {
this.setData({
keyword: e.detail.value,
shows: !!e.detail.value
});
},
//
saveKeyword(keyword) {
uni.getStorage({
key: 'OldKeys',
success: res => {
var OldKeys = JSON.parse(res.data);
var findIndex = OldKeys.indexOf(keyword);
if (findIndex == -1) {
OldKeys.unshift(keyword);
} else {
OldKeys.splice(findIndex, 1);
OldKeys.unshift(keyword);
} //10
OldKeys.length > 10 && OldKeys.pop();
uni.setStorage({
key: 'OldKeys',
data: JSON.stringify(OldKeys)
});
this.setData({
oldKeywordList: OldKeys //
});
},
fail: e => {
var OldKeys = [keyword];
uni.setStorage({
key: 'OldKeys',
data: JSON.stringify(OldKeys)
});
this.setData({
oldKeywordList: OldKeys //
});
}
});
},
oldDelete() {
uni.showModal({
content: '确定清除历史搜索记录?',
success: res => {
if (res.confirm) {
console.log('用户点击确定');
this.setData({
oldKeywordList: []
});
uni.removeStorage({
key: 'OldKeys'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
onsearch() { //
},
clears() {
this.setData({
keyword: '',
keywordList: [],
isShowKeywordList: false
});
},
ondoSearch(item) { //
console.log(item)
},
jumpData(value) {
uni.navigateTo({
url: '/pages/views/goods/goodsDetails?goodsId'
});
}
}
};
</script>
<style scoped lang="scss">
view{display:block;}
.search-box {background-color:rgb(242,242,242);padding:15upx 2.5%;display:flex;justify-content:space-between;position:sticky;top: 0;}
.search-box .mSearch-input-box{width: 100%;}
.search-box .input-box {width:85%;flex-shrink:1;display:flex;justify-content:center;align-items:center;}
.search-box .search-btn {width:15%;margin:0 0 0 2%;display:flex;justify-content:center;align-items:center;flex-shrink:0;font-size:24upx;color:#fff;background:linear-gradient(to right,#4492EB,#3F92EE);border-radius:60upx;}
.search-box .input-box>input {width:95%;height:60upx;font-size:24upx;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;background-color:#ffffff;}
.placeholder-class {color:#9e9e9e;}
.search-keyword {width:100%;background-color:rgb(242,242,242);}
.keyword-list-box {height:calc(100vh - 110upx);padding-top:10upx;border-radius:20upx 20upx 0 0;background-color:#fff;}
.keyword-entry-tap {background-color:#eee;}
.keyword-entry {width:94%;height:80upx;margin:0 3%;font-size:30upx;color:#333;display:flex;justify-content:space-between;align-items:center;border-bottom:solid 1upx #e7e7e7;}
.keyword-entry image {width:60upx;height:60upx;}
.keyword-entry .keyword-text,.keyword-entry .keyword-img {height:80upx;display:flex;align-items:center;}
.keyword-entry .keyword-text {width:90%;}
.keyword-entry .keyword-img {width:10%;justify-content:center;}
.keyword-box {height:calc(100vh - 110upx);border-radius:20upx 20upx 0 0;background-color:#fff;}
.keyword-box .keyword-block {padding:10upx 0;}
.keyword-box .keyword-block .keyword-list-header {width:94%;padding:10upx 3%;font-size:27upx;color:#333;display:flex;justify-content:space-between;}
.keyword-box .keyword-block .keyword-list-header image {width:40upx;height:40upx;}
.keyword-box .keyword-block .keyword {width:94%;padding:3px 3%;display:flex;flex-flow:wrap;justify-content:flex-start;}
.keyword-box .keyword-block .hide-hot-tis {display:flex;justify-content:center;font-size:28upx;color:#6b6b6b;}
.keyword-box .keyword-block .keyword>view {display:flex;justify-content:center;align-items:center;border-radius:38upx;padding:0 20upx;margin:10upx 20upx 10upx 0;height:60upx;font-size:24upx;background-color:rgb(242,242,242);color:#6b6b6b;line-height: 60upx;}
.search_text{
font-size: 24upx;
color: #B6B6C6;
}
.input-box{
position: relative;
height: 60upx;
font-size: 24upx;
border: 0;
border-radius: 60upx;
-webkit-appearance: none;
appearance: none;
padding: 0 3%;
margin: 0;
background-color: #ffffff;
}
.input-box image{
height: 40upx;
width: 40upx;
float: right;
position: absolute;
right: 2%;
top: 50%;
transform: translateY(-50%);
z-index: 100;
}
</style>

@ -0,0 +1,928 @@
<template>
<view class="cencal_order">
<view class="goods_data">
<image :src="goodData.img" mode=""></image>
<view class="right">
<p class="goods_name">{{goodData.title}}</p>
<p class="goods_sku">{{goodData.goods_sku_text}}</p>
<p class="goods_price">
<text :style="{color:colors}">{{goodData.money}}</text>
<text style="font-size: 24upx;color: #333333;">数量 x {{goodData.number}}</text>
</p>
</view>
</view>
<!-- 退货理由 -->
<view class="other">
<view class="remark">
<textarea maxlength="-1" placeholder="请在此处输入您的退单理由" placeholder-class="textarea_p"></textarea>
</view>
<view class="tag_box">
<view v-for="(item, index) in remarkList" :key="index" class="tag_list" @tap="setCurrent(index)">
<view :style="'color:' + (item.current == true ?'#fff':'') + ';background:' + (item.current == true ? colors:'') + ';border:' + (item.current == true ? 'none':'')">
{{item.name}}
</view>
</view>
</view>
<p class="youhui" style="border-bottom: none;">
<text class="text1">上传凭证</text>
<text class="text3">(最多3张)</text>
</p>
<view class="img_box">
<view class="img_list" v-for="(item, index) in imgUrl" :key="index">
<block v-if="item.type == 1">
<image :src="item.url" mode="" @click="previewImg(item.url)" class="imgs"></image>
<image z-index="9999" src="/static/images/search/close.png" mode="" class="close" @tap="delImg(index)"></image>
</block>
<block v-if="item.type == 2">
<video :src="item.url" :poster="item.poster" :controls="false" :show-center-play-btn="false" :show-play-btn="false"
:enable-progress-gesture="false">
<cover-view class="covers"></cover-view>
<cover-image v-if="showVideo == false" class="imgs" src="/static/images/goods/bofang.png" mode="" @click="onshowVideo(item.url)"></cover-image>
<cover-image z-index="900" v-if="showVideo == false" src="/static/images/search/close.png" mode="" class="video_close" @tap="delImg(index)"></cover-image>
</video>
</block>
</view>
<view class="addImg" v-if="imgUrl.length < 3" @tap="onChoose">
<image src="/static/images/shexiang.png" mode=""></image>
<p>添加图片/视频</p>
</view>
</view>
</view>
<!-- 退货的返回方式以及收件地址 -->
<view class="address">
<view class="address_type">
<text class="type_text">返回方式</text>
<view class="type_right" @click="setReturn">
<text>{{types}}</text>
<image src="/static/images/home/dian.png" class="more" mode=""></image>
</view>
</view>
<view class="rule">
<view class="rule_left">如因个人原因退/换货将在换新商品签收时收取8元运费</view>
<view class="rule_right">
运费规则
</view>
</view>
<block v-if="tapIndex == 0">
<view class="user_address" @click="setLocation(0)" :style="{borderBottom:tapIndex== 0?'1upx solid #eee':'none'}">
<view>
<view class="u_a_top">
<text class="iconfont icon-dizhi"></text>
<text class="name">{{Pickaddress.name}}</text>
<text>{{Pickaddress.phone | formatPhone}}</text>
</view>
<view class="u_a_bottom">
地址: {{Pickaddress.address}}{{Pickaddress.moreAddres}}
</view>
</view>
<image src="/static/images/home/right.png" mode=""></image>
</view>
<view class="times" @click="openPopup">
<image class="rili" src="/static/images/home/riil.png" mode=""></image>
<view class="times_title">
{{pickTime}}
</view>
<image src="/static/images/home/dian.png" class="more" mode=""></image>
</view>
</block>
</view>
<!-- 收货地址 只有在换货和维修时才显示 -->
<view class="address" v-if="type != 1">
<p class="m_a_title">收货地址<text>(该地址是商家回寄给您的地址)</text></p>
<view class="user_address" @click="setLocation(1)" style="border-bottom: none;">
<view>
<view class="u_a_top">
<text class="iconfont icon-dizhi"></text>
<text class="name">{{Toaddress.name}}</text>
<text>{{Toaddress.phone | formatPhone}}</text>
</view>
<view class="u_a_bottom">
地址: {{Toaddress.address}}{{Toaddress.moreAddres}}
</view>
</view>
<image src="/static/images/home/right.png" mode=""></image>
</view>
</view>
<!-- 联系人信息 -->
<view class="contacts">
<view class="user_cell">
<image src="/static/images/home/cat.png" mode=""></image>
<text>{{Toaddress.name}}</text>
</view>
<view class="user_cell">
<image src="/static/images/home/phone.png" mode=""></image>
<text>{{Toaddress.phone | formatPhone}}</text>
</view>
</view>
<p class="tips">
提交服务单后售后专员可能与您电话沟通请保持手机畅通
</p>
<view class="btns" :style="{background: colors}" @click="onsubmit">
确认提交
</view>
<!-- 预览视频弹窗APP 小程序 -->
<view class="mask" v-if="showVideo == true" @touchmove.stop.prevent="ondefault" @click="hideShow">
<view class="close">
<image src="/static/images/goods/close.png"></image>
</view>
</view>
<view class="previewvideo" v-if="showVideo == true">
<view class="videos">
<video class="nowvideos" id="nowVideo" v-if="showVideo == true" :src="videos" :autoplay="showVideo"
:show-center-play-btn="true" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
</view>
<!-- 用来承载H5预览视频的 -->
<view style="position: absolute;top: -999upx;left: -999upx;">
<video ref="newVideo" id="newVideo" :src="videos" :autoplay="showVideo" :show-center-play-btn="false" :show-mute-btn="true"
:show-fullscreen-btn="false"></video>
</view>
<set-times @onComplete="onComplete" @onClose="onClose" :shows="shows"></set-times>
</view>
</template>
<script>
var app = getApp();
import setTimes from '@/pages/commponent/order/setTime.vue'
import {
getPickaddress,
getToaddress,
removePickaddress,
removeToaddress
} from '@/utils/auth.js'
export default {
data() {
return {
colors: '',
type: 1,
platform:'',
types: '上门取件',
tapIndex: 0,
shows: false,
showVideo: false,
videos: '',
pickTime: '', //
remarkList: [{
name: '个人原因'
}, {
name: '性价比太低'
}, {
name: '态度不好'
}, {
name: '价格不合理'
}, {
name: '做工不行'
}, {
name: '物流时间长'
}, {
name: '价格优惠低'
}, {
name: '其他原因'
}],
data: "",
imgUrl: [],
goodData: {},
Pickaddress: {
name: '反转',
phone: '17712333156',
address: '安徽省合肥市庐阳区',
moreAddres: '逍遥津',
address_id: 1
},
Toaddress: {
name: '反转',
phone: '17712333156',
address: '安徽省合肥市庐阳区',
moreAddres: '逍遥津',
address_id: 1
}
};
},
filters: {
formatPhone(value) {
var reg = /(\d{3})\d{4}(\d{4})/; //
var phone = value.replace(reg, "$1****$2")
return phone
}
},
components: {
setTimes
},
props: {},
created() {
this.platform = uni.getSystemInfoSync().platform //ios
this.newVideo = uni.createVideoContext('newVideo');
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
removePickaddress() //
removeToaddress() //
//
let goodData = JSON.parse(uni.getStorageSync('goodData')) //
let type = options.type || 1
uni.setNavigationBarTitle({
title: options.typeText
})
this.setData({
colors: app.globalData.newColor,
goodData: goodData,
type: type
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() { //
if (getPickaddress()) {
this.Pickaddress = getPickaddress()
}
if (getToaddress()) {
this.Toaddress = getToaddress()
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
setCurrent(index) {
let remark = this.remarkList[index];
remark.current = !remark.current
let data = 'remarkList[' + index + ']';
this.setData({
[data]: remark
});
let arr = [];
this.remarkList.forEach(e => {
if (e.current == true) {
arr.push(e);
}
});
console.log(arr);
},
onChoose() {
uni.showActionSheet({
title: "选择上传类型",
itemList: ['图片', '视频'],
success: (res) => {
if (res.tapIndex == 0) {
this.chooseImages()
} else {
this.chooseVideo()
}
}
})
},
chooseImages() { //
let that = this;
uni.chooseImage({
//
count: 1, //
sizeType: ['original', 'compressed'], //
success: function(res) {
//
// imgUrl
if (that.imgUrl.length >= 3) { //3
uni.showToast({
title: '最多上传3个',
icon: 'none'
})
} else { //
let img = {
url: '/static/images/goods/four.jpg',
type: 1
}
that.imgUrl.push(img)
}
}
});
},
chooseVideo() { //
let that = this;
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
console.log(res) //
//
if (that.imgUrl.length >= 3) { //3
uni.showToast({
title: '最多上传3个',
icon: 'none'
})
} else { //
/**
* ***重点注意
* 视频的封面图因为需要做多端兼容 并且只允许是网络图片
* 所有建议是上传视频给后端之后然后由后端对视频进行截取
* 建议截取视频的第5帧来生成图片并返回给前端
* 下面的poster是模拟后台返回的封面
*/
let video = {
url: 'https://fzdz.soft.haoyangsoft.com/uploads/system/videos/20200813/6c819d24ee6868aee33e150c4333329b.mp4',
type: 2,
poster: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603080909940&di=ac10c5f2c952dd1b40441bb696c55a88&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn%2Fw640h640%2F20180127%2F369b-fyqzcxh1087346.jpg'
}
that.imgUrl.push(video)
}
}
});
},
delImg(index) {
//
this.imgUrl.splice(index, 1);
},
previewImg(url){ //
let arr = []
arr[0] = url
uni.previewImage({
urls:arr
})
},
onshowVideo(video) { //
this.videos = video
// #ifndef H5
this.showVideo = true
// #endif
// #ifdef H5
// h5
if(this.platform == 'android'){ //ios
this.isH5 = true
this.newVideo.play()
}else{
this.showVideo = true
}
// #endif
},
hideShow() { //
this.showVideo = false
},
ondefault() {
//
},
setReturn() { //
uni.showActionSheet({
title: "选择返回方式",
itemList: ['上门取件', '到店邮寄'],
success: (res) => {
this.types = res.tapIndex == 0 ? '上门取件' : '到店邮寄'
this.tapIndex = res.tapIndex
}
})
},
openPopup() { //
this.shows = true
},
onClose() {
this.shows = false
},
setLocation(status) { //0 : 1 : status
let address = status == 0 ? this.Pickaddress : this.Toaddress
uni.navigateTo({
url: '/pages/views/order/location/location?status=' + status + '&address=' + JSON.stringify(address)
})
},
onComplete(value) { //
console.log('取货时间', value)
this.pickTime = value
},
onsubmit(){
uni.showToast({
title:'提交成功'
})
setTimeout(()=>{
uni.navigateBack({
delta:2
})
},1500)
}
}
};
</script>
<style lang="scss" scoped>
page {
background-color: #FFFFFF;
}
.cencal_order {
padding: 20upx 4%;
background-color: #fff;
}
.goods_data {
display: flex;
align-items: center;
justify-content: flex-start;
overflow: hidden;
background-color: #FFFFFF;
image {
width: 140upx;
height: 140upx;
border-radius: 8upx;
}
.right {
margin-left: 20upx;
width: 80%;
.goods_name {
font-size: 26upx;
overflow: hidden;
font-weight: bold;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods_sku {
font-size: 24upx;
color: #999999;
margin-top: 5upx;
}
.goods_price {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28upx;
text-align: right;
color: #999;
margin-top: 5upx;
}
}
}
.youhui {
height: 40upx;
line-height: 40upx;
padding: 20upx 0;
border-bottom: 1upx solid #f2f2f2;
box-sizing: content-box;
.text1 {
font-size: 28upx;
color: #333333;
}
.text2 {
float: right;
color: #999999;
font-size: 28upx;
margin-right: 5upx;
margin-top: 2upx;
}
.text3 {
font-size: 24upx;
color: #999999;
margin-left: 10upx;
}
image {
float: right;
width: 12upx;
height: 22upx;
margin-top: 12upx;
margin-left: 10upx;
}
}
/* 预览视频弹窗 */
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .8);
z-index: 910;
}
.previewvideo {
width: 100vw;
height: 100vw;
position: fixed;
top: 50%;
left: 0;
transform: translateY(-50%);
background-color: #000;
z-index: 920;
opacity: 1;
}
.close {
display: flex;
align-content: center;
align-items: flex-end;
position: absolute;
top: 100upx;
right: 20upx;
z-index: 900;
image {
width: 50upx;
height: 50upx;
display: block;
justify-content: center;
margin-left: 30upx;
margin-bottom: 20upx;
border-radius: 50%;
padding: 10upx;
background-color: rgba(0, 0, 0, 0.2);
}
}
.videos {
height: 100vw;
width: 100vw;
z-index: 10;
position: relative;
video {
width: 100%;
height: 100%;
}
}
.nowvideos {
width: 100%;
height: 100%;
margin: 0 auto;
}
.img_box {
overflow: hidden;
padding: 20upx 0;
.addImg {
width: 184upx;
height: 184upx;
background: #f2f2f2;
border-radius: 20upx;
overflow: hidden;
transition: all 0.3s;
image {
width: 51upx;
height: 42upx;
display: block;
margin: 0 auto;
margin-top: 45upx;
}
p {
font-size: 24upx;
font-family: Microsoft YaHei;
font-weight: 400;
color: rgba(255, 94, 102, 1);
text-align: center;
margin-top: 20upx;
}
&:active {
transform: scaleX(0.96);
}
}
}
.img_list {
width: 184upx;
height: 184upx;
border-radius: 20upx;
float: left;
margin-right: 30upx;
position: relative;
image,
video {
width: 100%;
height: 100%;
display: block;
}
video {
position: relative;
border-radius: 5upx;
overflow: hidden;
overflow: visible !important;
.covers {
//
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 9990;
}
.imgs {
width: 72upx;
height: 72upx;
position: absolute;
top: 50%;
left: 50%;
z-index: 9999;
transform: translate(-50%, -50%);
}
.video_close {
width: 40upx;
height: 40upx;
position: absolute;
display: block;
top: -6upx;
left: -6upx;
border-radius: 50%;
z-index: 9999;
}
}
.close {
width: 40upx;
height: 40upx;
position: absolute;
box-sizing: border-box;
top: -6upx;
left: -6upx;
border-radius: 50%;
}
}
.other {
margin-top: 30upx;
box-shadow: 0upx 0upx 10upx #ddd;
padding: 10upx 20upx;
border-radius: 20upx;
.remark {
background-color: #F5F5F5;
border-radius: 10upx;
height: 200upx;
padding: 20upx;
margin-top: 20upx;
textarea {
font-size: 24upx;
color: #797979;
height: 100%;
}
}
.textarea_p {
font-size: 24upx;
color: #797979;
}
.tag_box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 40upx;
}
.tag_box::after {
content: '';
width: 30%;
}
.tag_list {
max-width: 24%;
min-width: 24%;
text-align: center;
margin-bottom: 30upx;
}
.tag_list view {
height: 60upx;
line-height: 60upx;
border-radius: 30upx;
border: 1upx solid #ddd;
font-size: 22upx;
color: #303030;
}
}
.address {
margin-top: 30upx;
box-shadow: 0upx 0upx 10upx #ddd;
padding: 20upx;
border-radius: 20upx;
.address_type {
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: space-between;
.type_text {
font-size: 28upx;
color: #8D8D8D;
}
.type_right {
font-size: 28upx;
color: #000000;
font-weight: bold;
display: flex;
align-items: center;
.more {
width: 40upx;
height: 40upx;
display: block;
margin-left: 20upx;
}
}
}
.rule {
background-color: #FCF9E5;
padding: 20upx;
font-size: 24upx;
display: flex;
align-items: center;
justify-content: space-between;
.rule_left {
width: 70%;
color: #8D8D8D;
}
.rule_right {
color: #E1251B;
}
}
.user_address {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 20upx;
margin-top: 30upx;
border-bottom: 1upx solid #EEEEEE;
.u_a_top {
height: 60upx;
line-height: 60upx;
font-size: 28upx;
color: #000000;
font-weight: bold;
display: flex;
align-content: center;
.iconfont {
font-weight: 500;
margin-right: 20upx;
font-size: 38upx;
color: #666666;
}
.name {
margin-right: 10upx;
font-size: 30upx;
}
}
.u_a_bottom {
font-size: 24upx;
color: #8D8D8D;
margin-left: 55upx;
margin-top: 10upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
image {
width: 40upx;
height: 40upx;
display: block;
}
&:active {
opacity: .8;
}
}
.times {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30upx 0;
.rili {
width: 35upx;
height: 35upx;
padding: 5upx;
box-sizing: content-box;
}
.times_title {
width: 84%;
text-align: left;
color: #000000;
}
.more {
height: 40upx;
width: 40upx;
display: block;
}
}
.m_a_title {
font-size: 28upx;
color: #8D8D8D;
height: 80upx;
line-height: 80upx;
text {
margin-left: 20upx;
font-size: 22upx;
}
}
}
.contacts {
margin-top: 30upx;
box-shadow: 0upx 0upx 10upx #ddd;
padding: 20upx;
border-radius: 20upx;
.user_cell {
height: 80upx;
line-height: 80upx;
display: flex;
align-items: center;
image {
width: 40upx;
height: 40upx;
display: block;
}
text {
font-size: 28upx;
color: #000000;
font-weight: bold;
margin-left: 20upx;
}
}
}
.tips {
font-size: 24upx;
color: #999999;
height: 40upx;
line-height: 40upx;
margin-top: 100upx;
text-align: center;
}
.btns {
width: 100%;
height: 80upx;
line-height: 80upx;
font-size: 30upx;
color: #FFFFFF;
text-align: center;
margin: 20upx 0;
border-radius: 8upx;
&:active {
opacity: .8;
}
}
</style>

@ -0,0 +1,429 @@
<template>
<view class="after_sale_details">
<!-- 服务单步骤 -->
<view class="top_step" :style="{background:colors}">
<view class="mask">
</view>
<view class="step_box">
<p class="status">{{details.order_type}}</p>
<view class="step_list">
<view class="top_x">
</view>
<view class="setp_all">
<view class="setp_title" v-for="(item,index) in stepData" :key="index">
<text class="dian" :style="{color:item.type==1 ||item.isNow==1 ?colors:'#eee'}"></text>
<text class="text" :style="{fontWeight:item.isNow == 1?'bold':'none'}">{{item.name}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 服务介绍 -->
<view class="service_box" @click="jumpStepDetail">
<view class="left">
<p class="left_js">服务已完成,感谢您的支持</p>
<p class="left_des">问题描述尊敬的客户您好,您的服务单已为您审核换货成功</p>
</view>
<image src="/static/images/home/right.png" mode=""></image>
</view>
<!-- 商品信息 -->
<view class="goods_details">
<p class="details_title">商品信息</p>
<view class="goods_box">
<image :src="details.img" class="cover" mode=""></image>
<view class="goods_right">
<p class="goods_name">{{details.title}}</p>
<view class="sku">规格{{details.goods_sku_text || '暂无规格'}}</view>
<view class="price">
<view class="t1">{{details.money}}</view>
<view class="t3">
x{{details.number}}
</view>
</view>
</view>
</view>
</view>
<!-- 服务单信息 -->
<view class="service_details">
<view class="cell_box">
<text class="cell_text">服务单号</text>
<text class="cell_content">{{serviceData.service_no}}</text>
<text class="cell_btn" @click="onCopy(serviceData.service_no)"></text>
</view>
<view class="cell_box">
<text class="cell_text">申请时间</text>
<text class="cell_content">{{serviceData.create_time}}</text>
</view>
<view class="cell_box">
<text class="cell_text">服务类型</text>
<text class="cell_content">{{serviceData.fw_type}}</text>
</view>
<view class="cell_box">
<text class="cell_text">商品退回</text>
<text class="cell_content">{{serviceData.th_type}}</text>
</view>
<view class="cell_box">
<text class="cell_text">取件地址</text>
<text class="cell_content">{{serviceData.qj_address}}</text>
</view>
<view class="cell_box">
<text class="cell_text">收货地址</text>
<text class="cell_content">{{serviceData.sh_address}}</text>
</view>
<view class="cell_box">
<text class="cell_text">联系人</text>
<text class="cell_content">{{serviceData.realname}}</text>
</view>
</view>
<view class="del_btn">
<text @click="delService"></text>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
components:{
loading
},
data(){
return{
colors:'',
isShow: true,
details:{},
stepData:[ //
/**
* isNow1 代表当前step 走到了这一步
* type1 代表当前该步骤已经完成
*/
{step_id: 1, name:'提交申请',isNow:0, type: 1},
{step_id: 2, name:'商家审核',isNow:0, type: 1},
{step_id: 3, name:'商家收货',isNow:0,type:1},
{step_id: 4, name:'换新',isNow:0, type: 1},
{step_id: 5, name:'完成',isNow:1, type: 1},
],
serviceData:{
service_no:'782260533',
create_time:'2020-05-09 20:01:48',
fw_type:'换货', //
th_type:'上门取件', //
qj_address:'安徽省合肥市包河区望湖街道马鞍山路',//
sh_address:'安徽省合肥市包河区望湖街道马鞍山路', //
realname:'反转'
}
}
},
onLoad(options) {
this.setData({
colors: app.globalData.newColor,
details: JSON.parse(options.details) // 使Id
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
methods:{
delService(){
uni.showModal({
title:'确认要删除该服务单吗?',
confirmColor: this.colors,
success: (res) => {
if(res.confirm){
console.log('删除订单')
}
}
})
},
onCopy(value){ //
// #ifdef H5
var input = document.createElement('input'); // input
input.value = value; //
document.body.appendChild(input); //
input.select(); //
document.execCommand('Copy'); //
document.body.removeChild(input); //
uni.showToast({
title:'复制成功~',
icon:'none'
})
// #endif
// #ifndef H5
uni.setClipboardData({
data:value,
success:function(){
uni.showToast({
title:'复制成功~',
icon:'none'
})
}
})
// #endif
},
jumpStepDetail(){ //
uni.navigateTo({
url:'/pages/views/order/stepDetails'
})
}
}
}
</script>
<style lang="scss" scoped>
.top_step{
height: 240upx;
background-color: pink;
position: relative;
.mask{
width: 100%;
height: 100%;
background: linear-gradient(to right,rgba(255,255,255,.1),rgba(255,255,255,.2));
}
.step_box{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
padding: 20upx 40upx;
.status{
height: 60upx;
line-height: 60upx;
color: #FFFFFF;
font-size: 32upx;
font-weight: bold;
}
.step_list{
margin-top: 30upx;
display: inline-block;
.top_x{
height: 4upx;
background-color: #FFFFFF;
}
.setp_all{
display: flex;
align-items: center;
.setp_title{
transform: translateY(-18upx);
margin-right: 40upx;
.dian{
width: 30upx;
height: 30upx;
display: block;
background-color: #FFFFFF;
border-radius: 50%;
margin: 0 auto;
text-align: center;
line-height: 30upx;
font-size: 26upx;
}
.text{
font-size: 24upx;
color: #FFFFFF;
display: block;
height: 40upx;
line-height: 40upx;
margin-top: 10upx;
}
&:first-of-type{
.dian{
margin-left: 0;
}
}
&:last-of-type{
margin-right: 0;
.dian{
margin-left: 100%;
transform: translateX(-100%);
}
}
}
}
}
}
}
.service_box{
padding: 30upx;
background-color: #FFFFFF;
margin: 0 20upx;
transform: translateY(-50upx);
border-radius: 15upx;
display: flex;
align-items: center;
.left{
.left_js{
height: 60upx;
line-height: 60upx;
color: #000000;
font-weight: bold;
}
.left_des{
height: 40upx;
width: 90%;
line-height: 40upx;
font-size: 24upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
image{
width: 40upx;
height: 40upx;
display: block;
}
}
.goods_details{
padding: 30upx;
background-color: #FFFFFF;
margin: 0 20upx;
transform: translateY(-25upx);
border-radius: 15upx;
.details_title{
font-size: 30upx;
color: #999999;
font-weight: bold;
height: 40upx;
line-height: 40upx;
}
.goods_box{
display: flex;
align-items: center;
margin-top: 10upx;
.cover{
height: 140upx;
width: 140upx;
display: block;
margin-right: 20upx;
border-radius: 8upx;
}
.goods_right{
flex: 1;
.goods_name{
font-size: 24upx;
color: #000;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.sku {
height: 40upx;
line-height: 40upx;
font-size: 24upx;
border-radius: 8upx;
padding: 0 10upx;
color: #A7A7A7;
margin-top: 5upx;
background-color: #F7F7F7;
}
.price {
width: 100%;
display: flex;
align-items: center;
height: 40upx;
line-height: 40upx;
margin-top: 5upx;
position: relative;
.t1 {
font-size: 30upx;
display: block;
color: $mycolor;
}
.t2 {
font-size: 24upx;
margin-left: 15upx;
display: block;
color: #C5C5C5;
text-decoration: line-through;
}
.t3 {
float: right;
font-size: 28upx;
color: #999;
position: absolute;
right: 0upx;
top: 0;
}
}
.goods_other{
display: flex;
align-items: center;
height: 50upx;
line-height: 50upx;
margin-top: 15upx;
font-size: 24upx;
color: #000000;
.goods_price,.number{
margin-right: 30upx;
text{
font-weight: bold;
font-size: 30upx;
}
}
}
}
}
}
.service_details{
padding: 30upx;
background-color: #FFFFFF;
margin: 0 20upx;
border-radius: 15upx;
.cell_box{
display: flex;
margin: 30upx 0;
.cell_text{
font-size: 28upx;
color: #8d8d8d;
width: 120upx;
}
.cell_content{
margin-left: 30upx;
font-size: 26upx;
color: #000000;
flex: 1;
line-height: 36upx;
}
.cell_btn{
padding: 5upx 26upx;
border: 1upx solid #ddd;
margin-left: 30upx;
border-radius: 30upx;
font-size: 24upx;
color: #202020;
&:active{
opacity: .8;
}
}
}
}
.del_btn{
font-size: 24upx;
color: #8d8d8d;
height: 160upx;
line-height: 100upx;
text-align: center;
padding-top: 20px;
text{
padding: 10upx 20upx;
border-radius: 30upx;
border: 1upx solid #ddd;
&:active{
opacity: .8;
}
}
}
</style>
<style>
page{
background-color: #F8F8F8;
}
</style>

@ -0,0 +1,471 @@
<template>
<view>
<view class="order_list">
<view class="top_nav">
<view style="background-color: #FFFFFF;">
<navBar :showLeft="true" navTitle="退换/售后" textcolor="#000" :leftBg="false"></navBar>
</view>
<!-- 顶部tab -->
<view class="nav_top" style="border-bottom: 1upx solid #F8F8F8;">
<tabs :colors="colors" :tabList="tabList" :active="active" @setTabs="setTabs"></tabs>
</view>
</view>
<!-- 占位 -->
<view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view>
<!-- 订单列表 -->
<view class="list_box">
<block v-if="active !== 2">
<view v-for="(item, index) in orderList" :key="index" class="lists">
<view v-for="(row, index2) in item.goods" :key="index2" class="top">
<view class="top_box">
<image class="cover" :src="row.img" mode="aspectFill"></image>
<view class="top_right">
<view class="order_name">{{row.title}}</view>
<view class="sku">规格{{row.goods_sku_text || '暂无规格'}}</view>
<view class="price">
<view class="t1">{{row.money}}</view>
<view class="t3">
x{{row.number}}
</view>
</view>
</view>
</view>
<view class="bottom" v-if="active == 1">
<view class="success" @click="jumpDetails(row)">
<text class="success_type">{{row.order_type}}</text>
<text class="success_t2">{{row.order_type_title}}</text>
<image class="right_img" src="../../../static/images/home/right.png" mode=""></image>
</view>
</view>
<view class="bottom">
<block v-if="active == 0">
<view @click="onafterSale(row)" :style="'color:' + colors + ';border-color:' + colors">
申请售后
</view>
</block>
<block v-if="active == 1">
<view @click="onwithdraw(row)" :style="'color:' + colors + ';border-color:' + colors">
取消申请
</view>
</block>
</view>
</view>
</view>
<view class="nodata" v-if="orderList.length >= 3"> </view>
<nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata>
</block>
<block v-if="active == 2">
<view v-for="(item, index) in afterList" :key="index" class="lists">
<view class="top">
<view class="top_box">
<image class="cover" :src="item.img" mode="aspectFill"></image>
<view class="top_right">
<view class="order_name">{{item.title}}</view>
<view class="sku">规格{{item.goods_sku_text || '暂无规格'}}</view>
<view class="price">
<view class="t1">{{item.money}}</view>
<view class="t3">
x{{item.number}}
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="success" @click="jumpDetails(item)">
<text class="success_type">完成</text>
<text class="success_t2">服务已完成感谢您的支持</text>
<image class="right_img" src="../../../static/images/home/right.png" mode=""></image>
</view>
</view>
</view>
</view>
<view class="nodata" v-if="afterList.length >= 3"> </view>
<nodata :colors="colors" title="暂无订单信息" v-if="afterList.length == 0"></nodata>
</block>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import tabs from "../../commponent/public/tabs";
import loading from "../../commponent/public/loading";
import navBar from '../../commponent/public/navBar.vue'
export default {
data() {
return {
statusBarHeight: app.globalData.statusHeight,
toBarHeight: app.globalData.toBar,
tabList: [{
name: '售后申请',
id: 0
}, {
name: '处理中',
id: 1
}, {
name: '申请记录',
id: 2
}],
active: 0,
orderList: [{
goods: [{
title: 'DUNKINDONUTS唐恩都乐美国甜甜圈6个礼盒装 随机搭配6款',
type: 1,
goods_id: 201,
number: 1,
goods_sku_text: '醇黑巧克力【20枚】',
img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78',
order_type:'待审核',
order_status: 0,
order_type_title:'您的订单已提交,请等待审核'
},
{
title: '农谣人 原味火山石烤肠1000g/约16根台式原味肠地道肠纯肉肠热狗肠台湾烤肠香肠烧烤肠半熟食火腿肠 台式原味地道肠1kg',
type: 1,
goods_id: 204,
number: 1,
goods_sku_text: '台式原味地道肠1kg',
img: 'http://img10.360buyimg.com/n1/jfs/t1/118993/11/329/175715/5e8ac0afE94234346/3ceb1344cf34d655.jpg',
money: '52.00 ',
order_type:'待审核',
order_status: 0,
order_type_title:'您的订单已提交,请等待审核'
},
],
type: 1,
status: 0,
order_No: 'AQWEAD45648974974456',
shopp_Address: '北京市海淀区苏家坨乡前沙涧村'
},
{
goods: [{
title: '钟薛高 钟意你系列 特牛乳*4片 丝绒可可*4片 半巧主义*2 冰淇淋生鲜雪糕 10片装',
img: '/static/images/goods/there.jpg',
goods_id: 203,
money: '152.00 ',
sku: '',
number: 1,
order_type:'待审核',
order_status: 0,
order_type_title:'您的订单已提交,请等待审核'
}, ],
type: 1,
status: 0,
order_No: 'AQWEAD45648974974456',
shopp_Address: '北京市海淀区苏家坨乡前沙涧村'
}
],
afterList: [{
title: 'DUNKINDONUTS唐恩都乐美国甜甜圈6个礼盒装 随机搭配6款',
type: 1,
goods_id: 201,
number: 1,
goods_sku_text: '醇黑巧克力【20枚】',
img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78',
order_type:'完成',
order_status: 5,
order_type_title:'服务已完成,感谢您的支持'
},
{
title: '钟薛高 钟意你系列 特牛乳*4片 丝绒可可*4片 半巧主义*2 冰淇淋生鲜雪糕 10片装',
img: '/static/images/goods/there.jpg',
goods_id: 203,
money: '152.00 ',
sku: '',
number: 1,
order_type:'完成',
order_status: 5,
order_type_title:'服务已完成,感谢您的支持'
},
],
isShow: true,
colors: ""
};
},
components: {
tabs,
loading,
navBar
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
setTabs(item, index) {
this.setData({
active: item.id
});
},
onafterSale(item) { //
uni.navigateTo({
url: '/pages/views/order/afterType?goodData=' + JSON.stringify(item)
})
},
onwithdraw() { //
uni.showModal({
title: '确认要取消该售后申请吗?',
confirmColor: this.colors,
success: (res) => {
if (res.confirm) {
console.log('取消成功')
}
}
})
},
jumpDetails(item){
let data = JSON.stringify(item) // 使Id
uni.navigateTo({
url:'/pages/views/order/afterSaleDetails?details='+data
})
}
}
};
</script>
<style>
page{
background-color: #F8F8F8;
}
</style>
<style scoped lang="scss">
.order_list {
width: 100%;
height: 100%;
overflow: hidden;
}
.top_nav{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 200;
}
.space{
height: 160upx;
}
.list_box {
padding: 0 3%;
box-sizing: border-box;
overflow: hidden;
/* #ifdef MP */
padding-bottom: 50upx;
/* #endif */
width: 100%;
padding-top: 20upx;
}
.lists {
margin: 0 auto;
padding: 20upx;
margin-top: 5upx;
background-color: #ffffff;
border-radius: 10upx;
margin-bottom: 20upx;
box-shadow: 0upx 0upx 10upx #EDEDED;
box-sizing: border-box;
width: 98%;
}
.type {
height: 50upx;
font-size: 26upx;
line-height: 50upx;
font-weight: bold;
text-align: right;
display: flex;
justify-content: space-between;
}
.type .order_id {
font-weight: 600;
color: #999;
font-size: 24upx;
}
.lists .top {
margin-bottom: 20upx;
border-bottom: 1upx dashed #F8F8F8;
.top_box {
display: flex;
align-content: center;
}
&:last-of-type {
margin-bottom: 0;
border-bottom: none;
}
}
.lists .top .cover {
min-width: 180upx;
max-width: 180upx;
height: 180upx;
display: block;
border-radius: 10upx;
}
.lists .top .top_right {
margin-left: 20upx;
width: 100%;
}
.lists .top .order_name {
line-height: 40upx;
height: 80upx;
font-size: 26upx;
font-weight: bold;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.lists .top .sku {
height: 40upx;
line-height: 40upx;
font-size: 24upx;
border-radius: 8upx;
padding: 0 10upx;
color: #A7A7A7;
background-color: #F7F7F7;
}
.lists .top .price {
width: 100%;
display: flex;
align-items: center;
height: 40upx;
line-height: 40upx;
margin-top: 20upx;
position: relative;
}
.bottom {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 10upx;
margin-bottom: 10upx;
view {
padding: 8upx 15upx;
border-radius: 8upx;
text-align: center;
font-size: 24upx;
border: 1upx solid #eee;
overflow: hidden;
}
.success {
border: none;
width: 100%;
background-color: #F7F7F7;
height: 80upx;
line-height: 80upx;
display: flex;
align-items: center;
margin-top: 10upx;
justify-content: space-between;
.success_type {
margin-right: 30upx;
}
.success_t2 {
color: #999;
transform: translateX(-100upx);
}
.right_img{
width: 40upx;
height: 40upx;
float: right;
}
&:active{
opacity: 0.8;
}
}
}
.price .t1 {
font-size: 30upx;
display: block;
color: $mycolor;
}
.price .t2 {
font-size: 24upx;
margin-left: 15upx;
display: block;
color: #C5C5C5;
text-decoration: line-through;
}
.price .t3 {
float: right;
font-weight: bold;
font-size: 28upx;
color: #999;
position: absolute;
right: 0upx;
top: 0;
}
.nodata {
color: #ccc;
text-align: center;
font-size: 24upx;
margin-bottom: 30upx;
height: 80upx;
line-height: 80upx;
}
</style>

@ -0,0 +1,193 @@
<template>
<view class="after_type">
<view class="goods_data">
<image :src="goodData.img" mode=""></image>
<view class="right">
<p class="goods_name">{{goodData.title}}</p>
<p class="goods_sku">{{goodData.goods_sku_text}}</p>
<p class="goods_price">
<text :style="{color:colors}">{{goodData.money}}</text>
<text style="font-size: 24upx;color: #333333;">数量 x {{goodData.number}}</text>
</p>
</view>
</view>
<!-- 分割线 -->
<view class="place"></view>
<!-- 选择退货类型 -->
<view class="_type">
<!-- 退货 -->
<view class="type_list" @click="jumpNext(1,'退货')">
<view class="type_left">
<image class="type_img" src="/static/images/after/tuihuo.png" mode=""></image>
<text class="type_text">退货</text>
</view>
<view class="type_right">
<view class="left_p">
<p style="text-align: right;">退回收到的商品</p>
<p style="color:#E1251B">支持7天无理由退货</p>
<p style="color:#E1251B">(拆封后不支持)</p>
</view>
<image src="/static/images/home/right.png" mode=""></image>
</view>
</view>
<!-- 换货 -->
<view class="type_list" v-for="(item,index) in lists" :key="index" @click="jumpNext(item.type,item.name)">
<view class="type_left">
<image class="type_img" :src="item.icon" mode=""></image>
<text class="type_text">{{item.name}}</text>
</view>
<view class="type_right">
<view class="left_p">
<p>{{item.tips}}</p>
</view>
<image src="/static/images/home/right.png" mode=""></image>
</view>
</view>
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
colors:"",
goodData: {},
lists:[
{name:'换货',type: 2,icon:'/static/images/after/huanhuo.png',tips:'更换收到的商品'},
{name:'维修',type: 3,icon:'/static/images/after/weixiu.png',tips:'维修收到的商品'},
]
}
},
onLoad(option) {
let goodData = JSON.parse(option.goodData)
this.setData({
goodData: goodData,
colors: app.globalData.newColor
});
},
methods:{
jumpNext(index,typeText){
uni.setStorageSync('goodData',JSON.stringify(this.goodData)) //
uni.navigateTo({
url: '/pages/views/order/afterSale?type='+index+'&typeText='+typeText
})
}
}
}
</script>
<style lang="scss" scoped>
.after_type {
padding: 20upx 0;
background-color: #fff;
}
.goods_data {
display: flex;
align-items: center;
justify-content: flex-start;
overflow: hidden;
padding: 0 4%;
image {
width: 140upx;
height: 140upx;
border-radius: 8upx;
}
.right {
margin-left: 20upx;
width: 80%;
.goods_name {
font-size: 26upx;
font-weight: bold;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods_sku {
font-size: 24upx;
color: #999999;
margin-top: 5upx;
}
.goods_price {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28upx;
color: #999;
margin-top: 5upx;
}
}
}
.place{
height: 20upx;
width: 100%;
margin-top: 20upx;
border-bottom: 2upx dashed #EEEEEE;
}
._type{
margin: 0 4%;
border-radius: 20upx;
box-shadow: 0upx 0upx 10upx #DDDDDD;
margin-top: 30upx;
box-sizing: border-box;
padding: 20upx;
.type_list{
height: 152upx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1upx solid #EEEEEE;
padding: 20upx 0;
&:last-of-type{
border-bottom: none;
}
&:active{
opacity: .8;
}
.type_left{
display: flex;
align-items: center;
.type_img{
width: 50upx;
height: 50upx;
display: block;
}
.type_text{
font-size: 30upx;
font-weight: bold;
color: #202020;
margin-left: 20upx;
}
}
.type_right{
display: flex;
align-items: center;
.left_p{
margin-right: 10upx;
p{
height: 30upx;
line-height: 30upx;
font-size: 24upx;
text-align: center;
color: #999999;
}
}
image{
width: 40upx;
height: 40upx;
display: block;
float: right;
}
}
}
}
</style>

@ -0,0 +1,169 @@
<template>
<view class="cencal_order">
<view class="remark">
<textarea maxlength="-1" placeholder="请在此处输入您的退单理由" placeholder-class="textarea_p"></textarea>
</view>
<view class="tag_box">
<view v-for="(item, index) in remarkList" :key="index" class="tag_list" @tap="setCurrent(index)">
<view :style="'color:' + (item.current == true ?'#fff':'') + ';background:' + (item.current == true ? colors:'') + ';border:' + (item.current == true ? 'none':'')">
{{item.name}}
</view>
</view>
</view>
<view class="btns" :style="{background: colors}">
确认提交
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
colors: '',
remarkList: [{
name: '图案不好看'
}, {
name: '性价比太低'
}, {
name: '态度不好'
}, {
name: '价格不合理'
}, {
name: '做工不行'
}, {
name: '物流时间长'
}, {
name: '价格优惠低'
}, {
name: '其他原因'
}],
data: ""
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
setCurrent(index) {
let remark = this.remarkList[index];
remark.current = !remark.current
let data = 'remarkList[' + index + ']';
this.setData({
[data]: remark
});
let arr = [];
this.remarkList.forEach(e => {
if (e.current == true) {
arr.push(e);
}
});
console.log(arr);
}
}
};
</script>
<style lang="scss" scoped>
page{
background-color: #F5F5FA;
}
.cencal_order{
padding: 20upx 4%;
background-color: #fff;
}
.remark{
background-color: #F5F5F5;
border-radius: 10upx;
height: 60vw;
padding: 20upx;
margin-top: 20upx;
textarea{
font-size: 26upx;
color: #797979;
}
}
.textarea_p{
font-size: 24upx;
color: #797979;
}
.tag_box{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 40upx;
}
.tag_box::after{
content: '';
width: 30%;
}
.tag_list{
max-width: 24%;
min-width: 24%;
text-align: center;
margin-bottom: 30upx;
}
.tag_list view{
height: 60upx;
line-height: 60upx;
border-radius: 30upx;
border: 1upx solid #ddd;
font-size: 22upx;
color: #303030;
}
.btns{
width: 100%;
height: 80upx;
line-height: 80upx;
font-size: 30upx;
color: #FFFFFF;
text-align: center;
margin-top: 100upx;
border-radius: 8upx;
}
</style>

@ -0,0 +1,637 @@
<template>
<view class="order">
<!-- 选择配送方式 -->
<!-- @tap="selectMode" -->
<view class="mode" >
<text class="text1">配送方式</text>
<text class="text2">{{modes || "请选择配送方式"}}</text>
<image src="/static/images/home/right.png"></image>
</view>
<!-- 收货地址 -->
<view class="order_address" v-if="tapIndex == 0">
<image src="/static/images/home/bottom.png"></image>
<view class="address_box" @tap="setAddress">
<view class="weizhi_icon">
<text class="iconfont icon-dizhi" :style="'color:' + colors"></text>
</view>
<block v-if="address">
<view class="center">
<view class="name">
<text class="text1">{{address.recipient}}</text>
<text class="phones">{{address.telephone}}</text>
</view>
<view class="address_name">{{address.detail}}</view>
</view>
</block>
<view class="noaddress" v-else>
请添加收货地址
</view>
</view>
</view>
<!-- 商品详情 -->
<view v-for="(item, index) in goodsList" :key="index" class="goods">
<view class="goods_data">
<image :src="item.selectSku.img" mode="widthFix" v-if="item.selectSku"></image>
<image :src="item.img" mode="widthFix" ></image>
<view class="goods_title">
<view class="g_name">
{{item.title}}
</view>
<view class="goods_sku">
<!-- 判断当前商品是否存在规格 -->
规格: <text style="margin-right: 10upx;" v-if="item._selectedSku.length">
<text v-for="_it in item._selectedSku" :key="_it.tagname">{{_it.tagname}}</text>
</text>
<text style="margin-right: 10upx;" v-else></text>
</view>
<view class="price">
<view class="t1" :style="'color:' + colors">{{item.money}}</view>
<view class="t2" v-if="item.hmoney">
<text>{{item.hmoney}}</text>
</view>
<view class="t3">
x{{item.number}}
</view>
</view>
</view>
</view>
<!-- <view class="morelist" style="border-bottom:none">
<view class="title">
<text class="quan" :style="'background:' + colors"></text>
<text>优惠券</text>
</view>
<view class="right_title" :style="'color:' + colors + ';font-size:24upx'" @tap="openCoupon(index)">
{{item.couponName || '请选择优惠券'}}
</view>
</view> -->
</view>
<!-- 订单详情 -->
<view class="order_more">
<view class="morelist">
<text class="title">商品总价</text>
<view class="right_title">
{{sumprice}}
</view>
</view>
<view class="morelist">
<view class="title">
<text class="quan" :style="'background:' + colors"></text>
<text>运费</text>
</view>
<view class="right_title">
{{ freight }}
</view>
</view>
<view class="morelist">
<text class="title">实付款</text>
<view class="right_title" :style="'color:' + colors + ';'">
{{sumprice}}
</view>
</view>
<view class="tips">
<view class="tips_name">备注信息</view>
<view class="textarea_box">
<textarea placeholder="请输入备注信息" v-model="remark" placeholder-class="font-size: 24upx" maxlength="-1" v-if="couponshow == false"></textarea>
</view>
</view>
</view>
<view class="bottom_btn">
<view class="moneys">
合计: <text :style="'color:' + colors + ';'">{{sumprice}}</text>
</view>
<view class="btns" :style="'background:' + colors + ';'" @tap="submit">
提交订单
</view>
</view>
<!-- 优惠券弹出层 -->
<view class="mask" catchtouchmove="preventTouchMove" v-if="couponshow == true" @tap="hidecoupon"></view>
<view class="coupon" :style="'bottom:' + (couponshow == true ? '0':'')">
<view class="buyong" @click="notUsed()">使</view>
<scroll-view class="scrolls" scroll-y>
<coupon :couponList="couponList" @onReceive="onReceive"></coupon>
</scroll-view>
</view>
</view>
</template>
<script>
var app = getApp();
import coupon from "../../commponent/public/coupon";
import {getGoodsData,getAddress,removeAddress, getCart, resetCart, getUserInfo} from '@/utils/auth.js'
import {resetNum, setTabBarBadge } from '@/utils/util.js'
import { addOrder } from "../../../api";
export default {
data() {
return {
colors: '',
couponshow: false,
modes: '物流寄送',
tapIndex: 0,
goodsList:getGoodsData(),
couponIndex: 0,
freight: 0,
nowprice: 0, //
sumprice: 0,
address: null,
remark: '',
couponList: [ //
{
money: 30,
reduce: 5,
date: '2020-02-09 2020-10-02',
id: 1,
status: 0,
condition: ['新人专享', '仅在支付时使用', '可与其他产品共享']
}, {
money: 30,
reduce: 5,
date: '2020-02-09 2020-10-02',
id: 2,
status: 0,
condition: ['新人专享']
}
]
};
},
components: {
coupon
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
removeAddress() //
//
this.getSumPrice()
this.setData({
colors: app.globalData.newColor
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let address = getAddress() //
if(address){
this.address = address
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
getSumPrice(){
let sumprice = 0
this.goodsList.forEach(e=>{
sumprice += e.number * resetNum(e.money)
})
sumprice += resetNum(this.freight)
this.sumprice = resetNum(sumprice, 'end')
this.nowprice = resetNum(sumprice, 'end')
},
openCoupon(index) {
this.setData({
couponshow: true,
couponIndex: index
});
},
hidecoupon() {
this.setData({
couponshow: false
});
},
submit() {
if (!this.address) {
uni.showToast({
icon: 'none',
title: '请先选择地址'
})
return
}
const cartList = getCart()
const goodsIds = this.goodsList.map(v => v.goods_id)
const newCartList = cartList.filter(v => !goodsIds.includes(v.goods_id))
const params = {
"recipient": this.address.recipient,
"addr": this.address.detail,
"mobile": this.address.telephone,
"orderDetailList": this.goodsList.map(v => {
return {
goodsId: v.goods_id,
goodsName: v.title,
goodsNo: v.number,
goodsPrice: v.money
}
}),
state: 0,
"remark": this.remark,
"totalAmount": this.sumprice,
"userId": getUserInfo().id
}
console.log(params)
addOrder(params).then(res => {
if (res.result) {
uni.showToast({
icon: 'none',
title: '添加成功'
})
resetCart(newCartList)
setTabBarBadge(newCartList.length)
//
uni.redirectTo({
url: '/pages/views/order/success'
});
}
})
},
selectMode() {
let that = this;
let list = ['物流寄送', '到店自提']
uni.showActionSheet({
itemList: list,
success: function (res) {
that.setData({
modes: list[res.tapIndex],
tapIndex: res.tapIndex
});
}
});
},
setAddress() {
uni.navigateTo({
url: '/pages/views/user/myaddress'
});
},
onReceive(item, index){ //
this.couponshow = false
/**
* 自定义变量 到goodsList中 用户计算合计金额与优惠券
*/
this.goodsList[this.couponIndex].couponName = '满'+item.money+'减'+item.reduce
this.goodsList[this.couponIndex].couponReduce = item.reduce //
this.sumprice = this.sumprice - item.reduce
},
notUsed(){ //使
this.couponshow = false
this.goodsList[this.couponIndex].couponName = ''
if(this.goodsList[this.couponIndex].couponReduce){
this.sumprice = this.sumprice + Number(this.goodsList[this.couponIndex].couponReduce)
}
}
}
};
</script>
<style lang="scss" scoped>
page {
background-color: #FFFFFF;
}
.order {
padding: 20upx 4%;
}
.mode{
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: space-between;
background-color: #fff;
padding: 0 20upx;
border-radius: 10upx;
align-items: center;
margin-bottom: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
}
.mode:active{
background-color: #f5f5f5;
}
.mode .text1{
color: #999;
font-size: 24upx;
}
.mode .text2{
font-size: 24upx;
color: #333;
display: block;
width: 50%;
font-weight: bold;
}
.mode image{
width: 40upx;
height: 40upx;
display: block;
}
.order_address {
height: 150upx;
width: 100%;
background-color: #fff;
border-radius: 10upx;
overflow: hidden;
position: relative;
box-shadow: 0upx 0upx 10upx #ddd;
}
.order_address image {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
.address_box {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 10;
box-sizing: border-box;
padding: 20upx;
display: flex;
align-items: center;
}
.weizhi_icon text {
font-size: 40upx;
margin-left: 10upx;
}
.address_box .center {
margin-left: 20upx;
}
.address_box .center .name {
height: 60upx;
line-height: 60upx;
}
.address_box .center .name .text1 {
font-size: 26upx;
font-weight: bold;
color: #333;
display: inline-block;
margin-right: 20upx;
}
.phones {
font-size: 24upx;
color: #999;
z-index: 0;
}
.address_box .address_name {
font-size: 26upx;
font-weight: bold;
color: #333;
}
.noaddress {
margin-left: 40upx;
font-weight: bold;
color: #333;
font-size: 26upx;
}
.goods {
background-color: #fff;
margin-top: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
padding: 20upx;
padding-bottom: 10upx;
}
.goods_data {
width: 100%;
display: flex;
margin-bottom: 15upx;
}
.goods_data image {
min-width: 150upx;
max-width: 150upx;
height: 150upx;
display: block;
border-radius: 10upx;
}
.goods_title {
margin-left: 20upx;
line-height: 40upx;
width: 100%;
}
.goods_title .price{
width: 100%;
display: flex;
height: 40upx;
line-height: 40upx;
margin-top: 20upx;
position: relative;
}
.goods_title .price .t1{
font-size: 30upx;
font-weight: bold;
display: block;
}
.goods_title .price .t2{
font-size: 24upx;
margin-left: 15upx;
display: block;
color: #999;
text-decoration: line-through;
}
.goods_title .price .t3{
float: right;
font-weight: bold;
font-size: 28upx;
color: #999;
position: absolute;
right: 0upx;
top: 0;
}
.goods_title .g_name {
font-size: 26upx;
font-weight: bold;
max-height: 80upx;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods_title .goods_sku{
color: #999;
/* margin-top: 20upx; */
}
.numbers{
/* text-align: right; */
}
.shop{
margin-top: 20upx;
font-size: 24upx;
color: #333;
display: flex;
align-content: center;
}
.shop .iconfont{
margin-right: 20upx;
}
.order_more{
padding: 0 2%;
margin-top: 20upx;
}
.morelist{
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: space-between;
border-bottom: 1upx dashed #eee;
}
.morelist .title{
color: #333;
font-size: 26upx;
font-weight: bold;
display: flex;
align-items: center;
}
.morelist .title .quan{
font-size: 20upx;
width: 35upx;
height: 35upx;
line-height: 36upx;
text-align: center;
border-radius: 8upx;
margin-right: 10upx;
align-items: center;
color: #fff;
}
.morelist .right_title{
color: #999;
}
.tips{
padding: 10upx 0;
margin-bottom: 120upx;
}
.tips .tips_name{
font-size: 26upx;
font-weight: bold;
line-height: 60upx;
}
.textarea_box{
min-height: 100upx;
width: 100%;
border: 1upx solid #eee;
border-radius: 10upx;
padding: 20upx;
}
.textarea_box textarea{
font-size: 24upx;
height: 150upx;
}
.bottom_btn{
height: 100upx;
width: 100vw;
background-color: #fff;
position: fixed;
left: 0;
bottom: 0;
line-height: 100upx;
display: flex;
justify-content: flex-end;
padding: 0 30upx;
z-index: 100;
font-weight: bold;
}
.bottom_btn .moneys{
font-size: 28upx;
font-weight: bold;
margin-right: 100upx;
}
.bottom_btn .btns{
font-size: 28upx;
color: #fff;
height: 60upx;
line-height: 60upx;
padding: 0 25upx;
text-align: center;
border-radius: 40upx;
margin-top: 20upx;
font-weight: bold;
}
/* 优惠券 */
.coupon{
background-color: #fff;
border-radius: 10upx 10upx 0 0;
position: fixed;
left: 0;
bottom: -1000upx;
z-index: 150;
transition: all 0.3s;
}
.coupon .buyong{
line-height: 80upx;
padding: 0 4%;
text-align: right;
color: #999;
}
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 10;
opacity: 0.7;
}
.scrolls{
width: 100vw;
height: 55vh;
z-index: 500;
}
</style>

@ -0,0 +1,421 @@
.evaluate {
margin:0 4%;
background-color: #FFFFFF;
box-shadow: 0upx 0upx 10upx #DDDDDD;
border-radius: 8upx;
position: relative;
top: 20upx;
.goods_data{
padding: 20upx 30upx;
display: flex;
align-items: center;
justify-content: flex-start;
overflow: hidden;
image{
width: 120upx;
height: 120upx;
border-radius: 8upx;
}
.right{
margin-left: 20upx;
width: 80%;
.goods_name{
font-size: 24upx;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient: vertical;
}
.goods_sku{
font-size: 24upx;
color: #999999;
margin-top: 5upx;
}
.goods_price{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28upx;
text-align: right;
color: #999;
margin-top: 5upx;
}
}
}
.Rate {
padding: 0upx 30upx 30upx;
background-color: #FFFFFF;
border-bottom: 1upx solid #eee;
p {
height: 60upx;
line-height: 60upx;
font-size: 30upx;
color: #333;
}
.star {
margin-top: 30upx;
display: flex;
align-items: center;
margin-left: 20upx;
image{
height: 40upx;
width: 40upx;
display: inline-block;
margin-right: 20upx;
}
}
}
.pingjia_box {
min-height: 300upx;
box-sizing: border-box;
background-color: #FFFFFF;
padding: 20upx 30upx;
border-bottom: 1upx solid #eee;
p{
font-size: 28upx;
color: #999;
margin-bottom: 20upx;
}
textarea {
min-height: 200upx;
width: 100%;
border-radius: 8upx;
overflow: hidden;
padding: 0 20upx;
box-sizing: border-box;
font-size: 26upx;
}
}
}
.btns {
width: 80%;
margin: 0 auto;
border-radius: 10upx;
height: 80upx;
color: #FFFFFF;
font-size: 30upx;
line-height: 80upx;
text-align: center;
margin-top: 100upx;
margin-bottom: 50upx;
}
.used {
overflow: hidden;
background-color: #ffffff;
margin-top: 20upx;
}
.historylist {
background-color: #ffffff;
padding: 30upx;
border-radius: 15upx;
.left {
height: 160upx;
border-radius: 8upx;
overflow: hidden;
width: 200upx;
position: relative;
float: left;
.fm {
height: 160upx;
width: 200upx;
}
.zzc {
height: 140upx;
width: 180upx;
position: absolute;
background-color: rgba($color: #000000, $alpha: 0.4);
top: 0;
left: 0;
}
.bf {
height: 30upx;
width: 30upx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.right {
padding-left: 20upx;
overflow: hidden;
.p1 {
font-size: 28upx;
color: #000;
height: 50upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.p2 {
width: 60upx;
float: left;
.text1 {
font-size: 32upx;
color: rgba(255,94,102,1);
font-weight: bold;
}
.text2 {
font-size: 24upx;
color: rgba(255,94,102,1);
margin-left: 10upx;
}
}
.p3 {
// float: right;
margin-top: 10upx;
margin-bottom: 10upx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
image {
height: 30upx;
width: 30upx;
float: left;
}
text {
font-size: 24upx;
color: #a1a1a1;
margin-left: 10upx;
float: left;
}
}
.p4 {
width: 100%;
overflow: hidden;
height: 60upx;
padding-top: 20upx;
.text1 {
padding: 6upx 16upx;
border: 1px solid #f64031;
color: rgba(255,94,102,1);
width: 160upx;
font-weight: bold;
float: left;
height: 60upx;
text-align: center;
line-height: 50upx;
box-sizing: border-box;
border-radius: 15upx;
font-size: 24upx;
background-color: #ffffff;
margin-left: 80upx;
}
.text2 {
padding: 6upx 16upx;
border: 1px solid rgba(255,94,102,1);
color: rgba(255,94,102,1);
width: 160upx;
float: right;
font-weight: bold;
height: 60upx;
text-align: center;
line-height: 50upx;
box-sizing: border-box;
border-radius: 15upx;
font-size: 24upx;
background-color: #ffffff;
}
}
}
.top {
/deep/.van-cell {
padding: 0;
}
/deep/.van-cell__value {
text-align: left;
font-size: 30upx;
color: #000000;
font-weight: bold;
margin-left: 20upx;
}
margin-bottom: 20upx;
image {
width: 50upx;
height: 50upx;
float: left;
border-radius: 50%;
transform: translateY(-5upx);
}
}
}
.youhui {
height: 40upx;
line-height: 40upx;
padding: 20upx 30upx;
border-bottom: 1upx solid #f2f2f2;
box-sizing: content-box;
.text1 {
font-size: 28upx;
color: #333333;
}
.text2 {
float: right;
color: #999999;
font-size: 28upx;
margin-right: 5upx;
margin-top: 2upx;
}
.text3 {
font-size: 24upx;
color: #999999;
margin-left: 10upx;
}
image {
float: right;
width: 12upx;
height: 22upx;
margin-top: 12upx;
margin-left: 10upx;
}
}
.img_box {
overflow: hidden;
padding: 20upx 30upx;
.addImg {
width: 184upx;
height: 184upx;
background: #f2f2f2;
// background-color: pink;
border-radius: 20upx;
overflow: hidden;
transition: all 0.3s;
image {
width: 51upx;
height: 42upx;
display: block;
margin: 0 auto;
margin-top: 45upx;
}
p {
font-size: 24upx;
font-family: Microsoft YaHei;
font-weight: 400;
color: rgba(255,94,102,1);
text-align: center;
margin-top: 20upx;
}
&:active {
transform: scaleX(0.96);
}
}
}
.img_list {
width: 184upx;
height: 184upx;
float: left;
margin-right: 20upx;
position: relative;
overflow: hidden;
margin-bottom: 20upx;
image,video {
width: 100%;
height: 100%;
display: block;
}
video{
position: relative;
border-radius: 5upx;
overflow: hidden;
overflow: visible!important;
.covers{ //
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 9990;
}
.imgs{
width: 72upx;
height: 72upx;
position: absolute;
top: 50%;
left: 50%;
z-index: 9999;
transform: translate(-50% ,-50%);
}
.video_close{
width: 40upx;
height: 40upx;
position: absolute;
display: block;
top: -6upx;
left: -6upx;
border-radius: 50%;
z-index: 9999;
}
}
.close {
width: 40upx;
height: 40upx;
position: absolute;
box-sizing: border-box;
top: -6upx;
left: -6upx;
border-radius: 50%;
}
}
/* 预览视频弹窗 */
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .8);
z-index: 200;
}
.previewvideo {
width: 100vw;
height: 100vw;
position: fixed;
top: 50%;
left: 0;
transform: translateY(-50%);
background-color: #000;
z-index: 900;
opacity: 1;
}
.close {
display: flex;
align-content: center;
align-items: flex-end;
position: absolute;
top: 100upx;
right: 20upx;
z-index: 900;
image {
width: 50upx;
height: 50upx;
display: block;
justify-content: center;
margin-left: 30upx;
margin-bottom: 20upx;
border-radius: 50%;
padding: 10upx;
background-color: rgba(0, 0, 0, 0.2);
}
}
.videos {
height: 100vw;
width: 100vw;
z-index: 10;
position: relative;
video {
width: 100%;
height: 100%;
}
}
.nowvideos {
width: 100%;
height: 100%;
margin: 0 auto;
}

@ -0,0 +1,254 @@
<template>
<view>
<view class="evaluate">
<view class="goods_data">
<image :src="goodData.img" mode=""></image>
<view class="right">
<p class="goods_name">{{goodData.title}}</p>
<p class="goods_sku">{{goodData.goods_sku_text}}</p>
<p class="goods_price">
<text style="font-size: 24upx;">数量x{{goodData.number}}</text>
<text :style="{color:colors}">{{goodData.money}}</text>
</p>
</view>
</view>
<view class="Rate">
<p>整体评价</p>
<view class="star">
<image :src="item.img" mode="" v-for="(item,index) in stars" :key="index" @click="setStar(item,index)"></image>
</view>
</view>
<view class="pingjia_box">
<textarea placeholder="说说您的感受..." maxlength="-1" v-model="comment" />
</view>
<p class="youhui" style="border-bottom: none;">
<text class="text1">上传图片</text>
<text class="text3">(最多3张)</text>
</p>
<view class="img_box" >
<view class="img_list" v-for="(item, index) in imgUrl" :key="index">
<block v-if="item.type == 1">
<image :src="item.url" mode="" class="imgs" @click="previewImg(item.url)"></image>
<image z-index="9999" src="/static/images/search/close.png" mode="" class="close" @tap="delImg(index)"></image>
</block>
<block v-if="item.type == 2">
<video :src="item.url" :poster="item.poster" :controls="false" :show-center-play-btn="false" :show-play-btn="false" :enable-progress-gesture="false">
<cover-view class="covers"></cover-view>
<cover-image v-if="showVideo == false" class="imgs" src="/static/images/goods/bofang.png" mode="" @click="onshowVideo(item.url)"></cover-image>
<cover-image v-if="showVideo == false" src="/static/images/search/close.png" mode="" class="video_close" @tap="delImg(index)"></cover-image>
</video>
</block>
</view>
<view class="addImg"v-if="imgUrl.length < 3" @tap="onChoose">
<image src="/static/images/shexiang.png" mode=""></image>
<p>添加图片/视频</p>
</view>
</view>
</view>
<view class="btns" :style="{background:colors}" @click="submit"></view>
<!-- 预览视频弹窗APP 小程序 -->
<view class="mask" v-if="showVideo == true" @touchmove.stop.prevent="ondefault" @click="hideShow">
<view class="close">
<image src="/static/images/goods/close.png"></image>
</view>
</view>
<view class="previewvideo" v-if="showVideo == true">
<view class="videos">
<video class="nowvideos" id="nowVideo" v-if="showVideo == true" :src="videos" :autoplay="showVideo"
:show-center-play-btn="true" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
</view>
<!-- 用来承载H5预览视频的 -->
<view style="position: absolute;top: -999upx;left: -999upx;">
<video ref="newVideo" id="newVideo" :src="videos"
:autoplay="showVideo"
:show-center-play-btn="false" :show-mute-btn="true" :show-fullscreen-btn="false"></video>
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
value: 5,
showVideo:false,
isH5: false,
videos:'',
comment:'',
platform:'',
imgUrl:[],//
goodData:{},
colors:'',
stars: [
{id: 1,types: true,img:'/static/images/home/stars.png'},
{id: 2,types: true,img:'/static/images/home/stars.png'},
{id: 3,types: true,img:'/static/images/home/stars.png'},
{id: 4,types: true,img:'/static/images/home/stars.png'},
{id: 5,types: true,img:'/static/images/home/stars.png'},
],
starNoImg:'/static/images/home/star-no.png',
starImg:'/static/images/home/stars.png',
starValue: 5
};
},
created() {
this.platform = uni.getSystemInfoSync().platform //ios
this.newVideo = uni.createVideoContext('newVideo');
},
onLoad(options) {
let goodData = JSON.parse(options.goodData)
this.setData({
colors: app.globalData.newColor,
goodData:goodData
});
},
methods: {
delImg(index) {
//
this.imgUrl.splice(index, 1);
},
onChoose(){
uni.showActionSheet({
title:"选择上传类型",
itemList: ['图片','视频'],
success: (res) => {
console.log(res)
if(res.tapIndex == 0){
this.chooseImages()
} else {
this.chooseVideo()
}
}
})
},
chooseImages() { //
let that = this;
uni.chooseImage({
//
count: 1, //
sizeType: ['original', 'compressed'], //
success: function(res) {
//
console.log(res);
// imgUrl
if(that.imgUrl.length >= 3){ //3
uni.showToast({
title:'最多上传3个',
icon:'none'
})
}else{ //
let img = {url:'/static/images/goods/four.jpg',type: 1}
that.imgUrl.push(img)
}
}
});
},
chooseVideo(){ //
let that = this;
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function (res) {
console.log(res) //
//
if(that.imgUrl.length >= 3){ //3
uni.showToast({
title:'最多上传3个',
icon:'none'
})
}else{ //
/**
* ***重点注意
* 视频的封面图因为需要做多端兼容 并且只允许是网络图片
* 所有建议是上传视频给后端之后然后由后端对视频进行截取
* 建议截取视频的第5帧来生成图片并返回给前端
* 下面的poster是模拟后台返回的封面
*/
let video = {url:'https://fzdz.soft.haoyangsoft.com/uploads/system/videos/20200813/6c819d24ee6868aee33e150c4333329b.mp4',type: 2,poster:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1603080909940&di=ac10c5f2c952dd1b40441bb696c55a88&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn%2Fw640h640%2F20180127%2F369b-fyqzcxh1087346.jpg'}
that.imgUrl.push(video)
}
}
});
},
setStar(item,index){ //
let that = this
if(item.types == false){
for(var i = 0; i<=index;i++){
console.log(that.stars[i].types)
that.stars[i].types = true
that.stars[i].img = that.starImg
}
}else{
for(var i = index+1; i<that.stars.length;i++){
console.log(that.stars[i].types)
that.stars[i].types = false
that.stars[i].img = that.starNoImg
}
}
this.$forceUpdate() //
let value = this.stars.filter((e)=>{
return e.types == true
})
this.starValue = value.length
},
previewImg(url){ //
let arr = []
arr[0] = url
uni.previewImage({
urls:arr
})
},
onshowVideo(video) { //
this.videos = video
// #ifndef H5
this.showVideo = true
// #endif
// #ifdef H5
// h5
if(this.platform == 'android'){ //ios
this.isH5 = true
this.newVideo.play()
}else{
this.showVideo = true
}
// #endif
},
hideShow(){ //
this.showVideo = false
},
submit(){ //
let imgs = this.imgUrl.filter((e)=>{ //
return e.type == 1
})
let videos = this.imgUrl.filter((e)=>{
return e.type == 2
})
uni.showToast({
title:'提交成功'
})
setTimeout(()=>{
uni.navigateBack({
delta:2
})
},1500)
},
ondefault(){
//
}
},
onShow() {
}
};
</script>
<style lang="scss" scoped>
@import "./evaluate.scss";
</style>
<style>
page{
background-color: #F8F8F8;
}
</style>

@ -0,0 +1,276 @@
<template>
<view>
<view class="editaddress">
<view class="content">
<view class="row">
<view class="nominal">收件人</view>
<view class="input"><input placeholder="请输入收件人姓名" v-model="addressData.name" type="text"></input></view>
</view>
<view class="row">
<view class="nominal">电话号码</view>
<view class="input"><input placeholder="请输入收件人电话号码" v-model="addressData.phone" type="number" maxlength="11"></input></view>
</view>
<view class="row">
<view class="nominal">所在地区</view>
<view class="input selectcity" @tap="openPicker">
<input placeholder="请选择省市区" disabled type="text" v-model="addressData.address"></input>
<image src="/static/images/home/right.png" class="rights"></image>
</view>
</view>
<view class="row">
<view class="nominal">详细地址</view>
<view class="input"><textarea style="font-size: 28upx;" v-model="addressData.moreAddres" auto-height="true" placeholder="输入详细地址" v-if="show == false"></textarea></view>
</view>
</view>
<view class="save"><view class="btn" :style="'background:' + colors" @click="saveAddress"></view></view>
<!-- 省市区选择 -->
<setcity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></setcity>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import setcity from "../../../commponent/public/setCity/nyz_area_picker";
import loading from "../../../commponent/public/loading";
import {setPickaddress,setToaddress} from '@/utils/auth.js'
export default {
data() {
return {
colors: '',
status:'',
show: false,
checked: false,
isShow: true,
addressData:{}
};
},
components: {
setcity,
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor,
status: options.status,
addressData: JSON.parse(options.address)
});
uni.setNavigationBarTitle({ //status
title: options.status==0?'编辑取件地址':'编辑收件地址'
})
setTimeout(() => {
this.setData({
isShow: false
});
}, 500);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
openPicker() { //
this.show = true
},
onhideShow() {
this.show = false
},
onsetCity(e) { //
let data = e.detail.target.dataset;
let address = data.province + data.city + data.area;
this.show = false
this.addressData.address = address
},
saveAddress(){ //
if(this.addressData.name == ''){
uni.showToast({
title:'姓名不能为空',
icon:'none'
})
return
}else if(this.addressData.phone == ''){
uni.showToast({
title:'手机号不能为空',
icon:'none'
})
return
}else if(this.addressData.address == ''){
uni.showToast({
title:'所在地区不能为空',
icon:'none'
})
return
}else if(this.addressData.moreAddres == ''){
uni.showToast({
title:'详细地址不能为空',
icon:'none'
})
return
}
uni.showToast({ //
title:'保存成功'
})
setTimeout(()=>{
// status
if(this.status == 0){ //
setPickaddress(this.addressData)
}else{//
setToaddress(this.addressData)
}
uni.navigateBack(-1)
},1500)
}
}
};
</script>
<style lang="scss" scoped>
.save {
position: fixed;
bottom: 0;
width: 100%;
height: 120upx;
display: flex;
justify-content: center;
align-items: center;
}
.save view {
display: flex;
}
.save .btn {
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.4);
width: 70%;
height: 80upx;
border-radius: 80upx;
background-color: #f23a3a;
color: #fff;
justify-content: center;
align-items: center;
font-size: 30upx;
}
.save .btn .icon {
height: 80upx;
color: #fff;
font-size: 30upx;
justify-content: center;
align-items: center;
}
.content {
display: flex;
flex-wrap: wrap;
margin-top: 40upx;
}
.content view {
display: flex;
}
.content .row {
width: 92%;
margin: 0 4%;
border-bottom: solid 1upx #eee;
}
.content .row .nominal {
width: 30%;
height: 80upx;
font-size: 28upx;
font-family: Droid Sans Fallback;
font-weight: 400;
color: rgba(51, 51, 51, 1);
align-items: center;
}
.content .row .input {
width: 70%;
padding: 20upx 0;
align-items: center;
font-size: 28upx;
}
.content .row .input input {
font-size: 28upx;
color: #333333;
}
.content .row .switch {
justify-content: flex-end;
}
.content .row .input textarea {
min-height: 40upx;
line-height: 40upx;
}
.content .del_box {
width: 100%;
display: block;
overflow: hidden;
margin-right: 30upx;
}
.content .del {
width: 240upx;
height: 80upx;
float: right;
justify-content: center;
align-items: center;
font-size: 28upx;
color: #F23A3A;
margin: 0 auto;
margin-top: 50upx;
border-radius: 38upx;
background-color: rgba(255, 0, 0, 0.05);
border-bottom: solid 1upx #eee;
}
.selectcity input{
width: 90%;
}
.selectcity image{
width: 40upx;
height: 40upx;
float: right;
}
</style>

@ -0,0 +1,735 @@
<template>
<view>
<view class="order">
<!-- 收货地址 -->
<view class="order_address">
<image src="/static/images/home/bottom.png"></image>
<view class="address_box">
<view class="weizhi_icon">
<text class="iconfont icon-dizhi" :style="'color:' + colors"></text>
</view>
<block>
<view class="center">
<view class="name">
<text class="text1">张飞</text>
<text class="phones">1829445646451</text>
</view>
<view class="address_name">北京市海淀区苏家坨乡前沙涧村15号</view>
</view>
</block>
</view>
</view>
<!-- 商品详情 -->
<view v-for="(item, index) in orderList.goods" :key="index" class="goods">
<view class="goods_data">
<image :src="item.img"></image>
<view class="goods_title">
<view class="g_name">
{{item.title}}
</view>
<view class="goods_sku">
规格: {{item.goods_sku_text}}
</view>
<view class="price">
<view class="t1" :style="'color:' + colors">{{item.money}}</view>
<view class="t3">
x{{item.number}}
</view>
</view>
</view>
</view>
<view class="morelist" style="border-bottom:none">
<view class="title">
<text class="quan" :style="'background:' + colors"></text>
<text>优惠券</text>
</view>
<view class="right_title" :style="'color:' + colors + ';font-size:24upx'">
减20
</view>
</view>
<!-- 单商品操作按钮 在订单状态为待评价时才会显示-->
<view class="goods_btns" v-if="status == 3">
<view class="btns" style="margin-right: 40upx;" @click="onafterSale(item)">
申请售后
</view>
<view class="btns" @click="onevaluate(item)" :style="{borderColor:colors,color:colors}">
去评价
</view>
</view>
</view>
<!-- 核销码 -->
<view class="order_ewm">
<view class="ewm_title">我的核销码</view>
<view class="center_ewm">
<image src="/static/images/ewm.png"></image>
</view>
</view>
<!-- 订单详情 -->
<view class="order_more">
<view class="morelist">
<text class="title">商品总价</text>
<view class="right_title">
{{orderList.sumprice}}
</view>
</view>
<view class="morelist">
<view class="title">
<text class="quan" :style="'background:' + colors"></text>
<text>运费</text>
</view>
<view class="right_title">
0
</view>
</view>
<view class="morelist">
<text class="title">实付款</text>
<view class="right_title" :style="'color:' + colors + ';'">
{{orderList.sumprice}}
</view>
</view>
<view class="morelist">
<text class="title">订单编号</text>
<view class="right_title">
{{orderList.order_No}}
<text class="copy" @click="onCopy(orderList.order_No)"></text>
</view>
</view>
<view class="morelist">
<text class="title">创建时间</text>
<view class="right_title">
2020-08-02 21:09:26
</view>
</view>
<view class="tips">
<view class="tips_name">备注信息</view>
<view class="textarea_box">
<textarea placeholder="请输入备注信息" disabled="true" placeholder-class="font-size: 24upx" maxlength="-1" v-model="orderList.tips"></textarea>
</view>
</view>
</view>
<view class="bottom_btn" >
<block v-if="status == 0">
<view class="moneys">
合计: <text :style="'color:' + colors + ';'">{{orderList.sumprice}}</text>
</view>
<view class="btns" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" @tap="cencalOrder">
取消订单
</view>
<view class="btns" :style="'background:' + colors + ';'">
继续支付
</view>
</block>
<block v-if="status == 1">
<view class="btns" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" @tap="onRefund">
申请退款
</view>
</block>
<block v-if="status == 2">
<view class="btns" :style="'color:' + colors + ';border:1upx solid ' + colors + ';margin-right:20upx'" @tap="onRefund">
申请退款
</view>
<view class="btns" :style="'background:' + colors + ';'">
确认收货
</view>
</block>
<block v-if="status == 3">
<view class="btns shouhou" @click="jumpSale">退/</view>
<view class="btns" :style="'background:' + colors + ';margin-left:20upx;'">再次购买</view>
</block>
<block v-if="status == 4">
<view class="btns shouhou" @click="delOrder"></view>
</block>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
colors: '',
status: 0,
//
isShow: true,
orderList: {
goods: [{
title: 'DUNKINDONUTS唐恩都乐美国甜甜圈6个礼盒装 随机搭配6款',
type: 1,
goods_id: 201,
number: 1,
goods_sku_text: '醇黑巧克力【20枚】',
img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
money: '175.78',
},
{
title: '农谣人 原味火山石烤肠1000g/约16根台式原味肠地道肠纯肉肠热狗肠台湾烤肠香肠烧烤肠半熟食火腿肠 台式原味地道肠1kg',
type: 1,
goods_id: 204,
number: 1,
goods_sku_text: '台式原味地道肠1kg',
img: 'http://img10.360buyimg.com/n1/jfs/t1/118993/11/329/175715/5e8ac0afE94234346/3ceb1344cf34d655.jpg',
money: '52.00 '
},
],
type: 1,
status: 0,
order_No: 'AQWEAD45648974974456',
shopp_Address: '北京市海淀区苏家坨乡前沙涧村',
sumprice:'227.78',
tips:"尽快发货"
},
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let status = 0;
if (options.status) {
status = options.status;
}
this.setData({
colors: app.globalData.newColor,
status: status
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
cencalOrder(item) {
//
uni.showModal({
title:'确认要取消该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
console.log('取消成功')
}
}
})
},
onRefund(item){
// 退
uni.navigateTo({
url: '/pages/views/order/cancelOrder?orderId'
});
},
onCopy(value){ //
// #ifdef H5
var input = document.createElement('input'); // input
input.value = value; //
document.body.appendChild(input); //
input.select(); //
document.execCommand('Copy'); //
document.body.removeChild(input); //
uni.showToast({
title:'复制成功~',
icon:'none'
})
// #endif
// #ifndef H5
uni.setClipboardData({
data:value,
success:function(){
uni.showToast({
title:'复制成功~',
icon:'none'
})
}
})
// #endif
},
onafterSale(item){ //
uni.navigateTo({
url:'/pages/views/order/afterType?goodData='+JSON.stringify(item)
})
},
onevaluate(item){ //
uni.navigateTo({
url:'/pages/views/order/evaluate/evaluate?goodData='+JSON.stringify(item)
})
},
jumpSale(){ //退
uni.navigateTo({
url:'/pages/views/order/afterSaleList'
})
},
delOrder(){ //
uni.showModal({
title:'确认要删除该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
console.log('删除成功')
}
}
})
},
}
};
</script>
<style lang="scss" scoped>
page {
background-color: #F9F9F9;
}
.order {
padding: 20upx 4%;
}
.mode{
height: 80upx;
line-height: 80upx;
display: flex;
justify-content: space-between;
background-color: #fff;
padding: 0 20upx;
border-radius: 10upx;
align-items: center;
margin-bottom: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
}
.mode:active{
background-color: #f5f5f5;
}
.mode .text1{
color: #999;
font-size: 24upx;
}
.mode .text2{
font-size: 24upx;
color: #333;
display: block;
width: 50%;
font-weight: bold;
}
.mode image{
width: 40upx;
height: 40upx;
display: block;
}
.order_address {
height: 150upx;
width: 100%;
background-color: #fff;
border-radius: 10upx;
overflow: hidden;
position: relative;
box-shadow: 0upx 0upx 10upx #ddd;
}
.order_address image {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
.address_box {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 10;
box-sizing: border-box;
padding: 20upx;
display: flex;
align-items: center;
}
.weizhi_icon text {
font-size: 40upx;
margin-left: 10upx;
}
.address_box .center {
margin-left: 20upx;
}
.address_box .center .name {
height: 60upx;
line-height: 60upx;
}
.address_box .center .name .text1 {
font-size: 26upx;
font-weight: bold;
color: #333;
display: inline-block;
margin-right: 20upx;
}
.phones {
font-size: 24upx;
color: #999;
z-index: 0;
}
.address_box .address_name {
font-size: 26upx;
font-weight: bold;
color: #333;
}
.noaddress {
margin-left: 40upx;
font-weight: bold;
color: #333;
font-size: 26upx;
}
.goods {
background-color: #fff;
margin-top: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
padding: 30upx 20upx;
padding-bottom: 10upx;
}
.goods_data {
width: 100%;
display: flex;
}
.goods_data image {
min-width: 150upx;
max-width: 150upx;
height: 150upx;
display: block;
border-radius: 10upx;
}
.goods_title {
margin-left: 20upx;
line-height: 40upx;
width: 100%;
}
.goods_title .price{
width: 100%;
display: flex;
align-items: center;
height: 40upx;
line-height: 40upx;
margin-top: 20upx;
position: relative;
}
.goods_title .price .t1{
font-size: 30upx;
display: block;
}
.goods_title .price .t2{
font-size: 24upx;
margin-left: 15upx;
display: block;
color: #999;
}
.goods_title .price .t3{
float: right;
font-size: 26upx;
color: #999;
position: absolute;
right: 0upx;
top: 0;
}
.goods_title .g_name {
font-size: 26upx;
font-weight: bold;
max-height: 80upx;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.goods_title .goods_sku{
color: #999;
/* margin-top: 20upx; */
}
.numbers{
/* text-align: right; */
}
.shop{
margin-top: 20upx;
font-size: 24upx;
color: #333;
display: flex;
align-content: center;
}
.order_more{
padding: 0 2%;
margin-top: 20upx;
background-color: #fff;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
}
.morelist{
height: 70upx;
line-height: 70upx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1upx dashed #eee;
}
.morelist .title{
color: #333;
font-size: 26upx;
font-weight: bold;
display: flex;
align-items: center;
}
.morelist .title .quan{
font-size: 20upx;
width: 35upx;
height: 35upx;
line-height: 36upx;
text-align: center;
border-radius: 8upx;
margin-right: 10upx;
align-items: center;
color: #fff;
}
.morelist .right_title{
color: #999;
font-size: 26upx;
}
.morelist .copy{
font-size: 22upx;
color: #888;
background-color: #eee;
height: 50upx;
line-height: 50upx;
padding: 0 20upx;
border-radius: 10upx;
margin-left: 20upx;
display: inline-block;
}
.goods_btns{
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 10upx;
.btns{
font-size: 24upx;
text-align: center;
color: #999999;
padding: 5upx 15upx;
border-radius: 8upx;
border: 1upx solid #DDDDDD;
}
}
.tips{
padding: 10upx 0;
margin-bottom: 120upx;
padding-bottom: 20upx;
}
.tips .tips_name{
font-size: 26upx;
font-weight: bold;
line-height: 60upx;
}
.textarea_box{
min-height: 100upx;
width: 100%;
border: 1upx solid #eee;
border-radius: 10upx;
padding: 20upx;
}
.textarea_box textarea{
font-size: 24upx;
height: 150upx;
}
.bottom_btn{
height: 100upx;
width: 100vw;
background-color: #fff;
position: fixed;
left: 0;
bottom: 0;
line-height: 100upx;
display: flex;
justify-content: flex-end;
padding: 0 30upx;
z-index: 100;
}
.bottom_btn .moneys{
font-size: 32upx;
margin-right: 100upx;
}
.bottom_btn .btns{
font-size: 26upx;
height: 50upx;
line-height: 50upx;
padding: 0 20upx;
text-align: center;
border-radius: 8upx;
margin-top: 30upx;
color: #FFFFFF;
}
/* 优惠券 */
.coupon{
background-color: #fff;
border-radius: 10upx 10upx 0 0;
position: fixed;
left: 0;
bottom: -1000upx;
z-index: 150;
transition: all 0.3s;
}
.coupon .buyong{
line-height: 80upx;
padding: 0 4%;
text-align: right;
color: #999;
}
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 10;
opacity: 0.7;
}
.scrolls{
width: 100vw;
height: 55vh;
z-index: 500;
}
.shop{
padding: 20upx;
display: flex;
justify-content: flex-start;
position: relative;
background-color: #fff;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
}
.shop .shop_img{
width: 120upx;
height: 120upx;
display: block;
overflow: hidden;
box-sizing: border-box;
border-radius: 8upx;
}
.shop_center{
overflow: hidden;
margin-left: 20upx;
}
.shop_center .shop_name{
font-size: 28upx;
color: #333;
font-weight: bold;
}
.shop_center .shop_address{
font-size: 24upx;
color: #333;
margin-top: 40upx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.shoucang{
width: 80upx;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
position:absolute;
right: 20upx;
top: 50%;
transform: translateY(-50%);
}
.shoucang .sc_icons text{
font-size: 45upx;
color: #999;
}
.shoucang .sc_text{
font-size: 22upx;
color: #333;
font-weight: bold;
}
.order_ewm{
width: 100%;
height: 380upx;
padding: 20upx 10upx;
background-color: #fff;
border-radius: 10upx;
box-shadow: 0upx 0upx 10upx #ddd;
margin-top: 20upx;
}
.ewm_title{
height: 40upx;
line-height: 40upx;
font-size: 26upx;
font-weight: bold;
}
.center_ewm{
height: 300upx;
width: 300upx;
margin: 0 auto;
}
.center_ewm image{
width: 100%;
height: 100%;
display: block;
}
.shouhou {
border: 1upx solid #ddd;
color: #999!important;
font-weight: normal!important;
}
</style>

@ -0,0 +1,448 @@
<template>
<view>
<view class="order_list">
<view class="top_nav">
<view style="background-color: #FFFFFF;">
<navBar :showLeft="true" navTitle="订单列表" textcolor="#000" :leftBg="false"></navBar>
</view>
<!-- 顶部tab -->
<view class="nav_top" style="border-bottom: 1upx solid #F8F8F8;">
<tabs :colors="colors" :tabList="tabList" :active="active" @setTabs="setTabs"></tabs>
</view>
</view>
<!-- 占位 -->
<view :style="{height: 35+statusBarHeight+toBarHeight+'px'}"></view>
<view class="list_box">
<view v-for="(item, index) in orderList" :key="index" class="lists">
<view class="type">
<text class="order_id">订单编号:{{item.id}}</text>
<text class="order_type" :style="'color:' + colors">
{{ item.state | setStatus }}
</text>
</view>
<view v-for="(row, index2) in item.orderDetailList" :key="index2" class="top" @tap="jumpDetails(item)">
<image :src="row.url" mode="aspectFill"></image>
<view class="top_right">
<view class="order_name">{{row.goodsName}}</view>
<view class="sku">规格{{row.specs || '暂无规格'}}</view>
<view class="price">
<view class="t1">{{row.price}}</view>
<view class="t3">
x{{row.goodsNo}}
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="address">总计<text style="color: #FF1929;font-size: 36upx;">{{item.totalAmount}}</text> </view>
<!-- <view class="address">店铺地址北京市海淀区苏家坨乡前沙涧村</view> -->
<view class="btns">
<block v-if="item.state == 0">
<!-- <view class="pay" :style="'color:#fff;background:' + colors+ ';border-color:' + colors" @tap="jumpDetails(item)"></view> -->
<view class="pay shouhou" :style="'color:' + colors + ';border-color:' + colors" @tap="cencalOrder(item)"></view>
</block>
<block v-if="item.state == 1">
<!-- <view class="pay shouhou" @tap="onRefund(item)"></view> -->
</block>
<block v-if="item.state == 2">
<view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view>
<!-- <view class="pay shouhou" @tap="onRefund(item)">退</view> -->
</block>
<block v-if="item.state == 3">
<!-- <view class="pay shouhou" :style="'color:' + colors + ';border-color:' + colors" @tap="jumpDetails(item)"></view> -->
<view class="pay shouhou" @tap="jumpDetails(item)"></view>
</block>
<!-- <view class="pay shouhou" v-if="item.state == 4" @click="delOrder(item)"></view> -->
</view>
</view>
</view>
<view class="nodata" v-if="orderList.length >= 3"> </view>
<nodata :colors="colors" title="暂无订单信息" v-if="orderList.length == 0"></nodata>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
import { getOrderList, editOrder } from '@/api/index.js'
var app = getApp();
import tabs from "../../commponent/public/tabs";
import loading from "../../commponent/public/loading";
import navBar from '../../commponent/public/navBar.vue'
import { ORDER_NAVS } from '@/config/order.js'
import { getUserInfo } from '@/utils/auth';
export default {
data() {
return {
statusBarHeight: app.globalData.statusHeight,
toBarHeight: app.globalData.toBar,
tabList: ORDER_NAVS,
active: 0,
orderList: [],
isShow: true,
colors: ""
};
},
filters: {
setStatus(value) {
console.log(value)
if (value == 0) {
return '待付款'
} else if (value == 1) {
return '待发货'
} else if (value == 2) {
return '待收货'
} else if (value == 3) {
return '已收货'
}
else if (value == 4) {
return '退换'
}
else if (value == 5) {
return '已取消'
}
}
},
components: {
tabs,
loading,
navBar
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
if (options.tabIndex) {
this.setData({
active: Number(options.tabIndex)
});
}
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
this.getOrderList(ORDER_NAVS[this.active].id)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
onConfirmOrder(item) {
uni.showModal({
title:'确认要确认收货?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
item.state = 3
editOrder(item).then(res => {
uni.showToast({
icon: 'none',
title: '操作成功'
})
this.getOrderList(ORDER_NAVS[this.active].id)
})
}
}
})
},
// 0 1 2 3 4 退 . -1
getOrderList(val = -1) {
let s = [
{
"rule": "eq",
"type": "int",
"dictCode": "",
"val": getUserInfo().id,
"field": "userId"
}
]
s = val !== -1 ? [...s, {
"rule": "eq",
"type": "string",
"dictCode": "",
"val": val,
"field": "state"
}] : s
const params = {
pageNo:1,
pageSize: 100,
superQueryParams: s,
superQueryMatchType: 'and',
"column": "createTime",
order: "desc",
}
params.superQueryParams = encodeURI(JSON.stringify(s))
getOrderList(params).then(res => {
const result = res.result.records
this.orderList = result
})
},
setTabs(item, index) {
this.setData({
active: index
});
this.getOrderList(item.id)
},
jumpDetails() { //
return
uni.navigateTo({
url: '/pages/views/order/orderDetails?status=' + this.active
});
},
cencalOrder(item) {
//
uni.showModal({
title:'确认要取消该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
item.state = 5
editOrder(item).then(res => {
uni.showToast({
icon: 'none',
title: '操作成功'
})
this.getOrderList(ORDER_NAVS[this.active].id)
})
console.log('取消成功')
}
}
})
},
onRefund(item){
// 退
uni.navigateTo({
url: '/pages/views/order/cancelOrder?orderId'
});
},
delOrder(item){
uni.showModal({
title:'确认要删除该订单吗?',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
console.log('删除成功')
}
}
})
}
}
};
</script>
<style>
page{
background-color: #F8F8F8;
}
</style>
<style scoped lang="scss">
.order_list {
width: 100%;
height: 100%;
overflow: hidden;
}
.top_nav{
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 200;
}
.list_box {
padding: 0 3%;
box-sizing: border-box;
overflow: hidden;
/* #ifdef MP */
padding-bottom: 50upx;
/* #endif */
width: 100%;
padding-top: 20upx;
}
.lists {
margin: 0 auto;
padding: 20upx;
margin-top: 5upx;
background-color: #ffffff;
border-radius: 10upx;
margin-bottom: 20upx;
box-shadow: 0upx 0upx 10upx #EDEDED;
box-sizing: border-box;
width: 98%;
}
.type {
height: 50upx;
font-size: 26upx;
line-height: 50upx;
font-weight: bold;
text-align: right;
display: flex;
justify-content: space-between;
}
.type .order_id {
font-weight: 600;
color: #999;
font-size: 24upx;
}
.lists .top {
display: flex;
align-content: center;
margin-bottom: 20upx;
}
.lists .top image {
min-width: 180upx;
max-width: 180upx;
height: 180upx;
display: block;
border-radius: 10upx;
}
.lists .top .top_right {
margin-left: 20upx;
width: 100%;
}
.lists .top .order_name {
line-height: 40upx;
height: 80upx;
font-size: 26upx;
font-weight: bold;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.lists .top .sku {
height: 40upx;
line-height: 40upx;
font-size: 24upx;
border-radius: 8upx;
padding: 0 10upx;
color: #A7A7A7;
background-color: #F7F7F7;
}
.lists .top .price {
width: 100%;
display: flex;
align-items: center;
height: 40upx;
line-height: 40upx;
margin-top: 20upx;
position: relative;
}
.price .t1 {
font-size: 30upx;
// font-weight: bold;
display: block;
color: $mycolor;
}
.price .t2 {
font-size: 24upx;
margin-left: 15upx;
display: block;
color: #C5C5C5;
text-decoration: line-through;
}
.price .t3 {
float: right;
font-weight: bold;
font-size: 28upx;
color: #999;
position: absolute;
right: 0upx;
top: 0;
}
.list_box .bottom {
margin-top: 20upx;
}
.list_box .bottom .address {
font-size: 24upx;
color: #696969;
}
.list_box .bottom .btns {
margin-top: 15upx;
overflow: hidden;
}
.list_box .bottom .btns .pay {
padding: 8upx 15upx;
border-radius: 8upx;
text-align: center;
font-size: 24upx;
float: right;
margin-left: 20upx;
box-sizing: border-box;
border: 1upx solid #ddd;
}
.pay:active {
opacity: .8;
}
.nodata {
color: #ccc;
text-align: center;
font-size: 24upx;
margin-bottom: 30upx;
// height: 80upx;
// line-height: 80upx;
}
</style>

@ -0,0 +1,133 @@
<template>
<view class="step">
<view class="step_box">
<!-- 左侧进度线 -->
<view class="step_left">
</view>
<view class="step_right">
<view class="right_content" v-for="(item,index) in stepData" :key="index">
<!-- 进度名称 -->
<block v-if="item.isNow == 0">
<p class="title" :style="{color:item.type == 1? '#202020':'#999'}">{{item.name}}</p>
</block>
<block v-if="item.isNow == 1">
<p class="title" :style="{color:item.type == 1? colors:'#999'}">{{item.name}}</p>
</block>
<!-- 进度时间 -->
<p class="times" v-if="item.type == 1">{{item.time}}</p>
<!-- 进度详情备注 -->
<p class="result" v-if="item.desc && item.desc !== ''"><text style="color: #202020;">{{item.desc}}</text></p>
<!-- 右侧的进度点 -->
<p class="status" :style="{background: item.isNow == 1?colors:'#ccc',borderColor: item.isNow == 1?colors:'#ccc'}"></p>
</view>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
components:{
loading
},
data(){
return{
isShow: true,
stepData:[ //
{name:'提交申请',time:'2020-05-09 20:01:49',isNow:0,type: 1,desc:'不想要了'},
{name:'等待审核',time:'2020-05-09 20:01:49',isNow:0,type: 1,desc:'您的服务单已申请成功,待售后审核中'},
{name:'审核意见',time:'2020-05-09 20:13:49',isNow:0,type: 1,desc:'您的售后单已收到会在24小时与您联系。'},
{name:'审核上门取件',time:'2020-05-09 20:13:49',isNow:0,type: 1,desc:'您的服务单已预约时间2020-05-10(周日) 15:00-20:00'},
{name:'取件成功',time:'2020-05-10 18:54:55',isNow:0,type: 1,desc:'您的商品已取件成功'},
{name:'商家售后已收到',time:'2020-05-12 09:01:49',isNow:0,type: 1,desc:'您的服务单商品已收到'},
{name:'返修换新订单生产',time:'2020-05-12 13:19:49',isNow:0,type: 1,desc:'您的服务订单已生成新的订单'},
{name:'返修换新完成',time:'2020-05-13 12:12:49',isNow:1,type: 1,desc:'您的服务单已完成,如有疑问请反馈,谢谢~'},
]
}
},
onLoad() {
this.setData({
colors: app.globalData.newColor,
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
}
}
</script>
<style lang="scss" scoped>
.step{
padding: 40upx 20upx;
margin-bottom: 20upx;
}
.step_box{
margin: 0 20upx;
margin-left: 20upx;
display: flex;
.step_left{
width: 2upx;
display: block;
background-color: #DDDDDD;
overflow: hidden;
}
.step_right{
margin-left: 20upx;
margin-top: -10upx;
.right_content{
position: relative;
margin-bottom: 30upx;
.title{
font-size: 28upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
}
.times{
font-size: 22upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
line-height: 36upx;
}
.status{
width: 12upx;
height: 12upx;
border-radius: 50%;
border: 2upx solid #ccc;
position: absolute;
top: 10upx;
background-color: #ccc;
left: -28upx;
}
.result{
padding: 10upx 15upx;
background-color: #F6F6F6;
font-size: 22upx;
margin-top: 10upx;
border: 1upx dashed #ddd;
}
&:last-of-type{
margin-bottom: 0;
.status{
top: 14upx;
}
&::before{
content: '';
width: 6upx;
height: 100%;
background-color: #FFFFFF;
position: absolute;
top: 22upx;
left: -24upx;
}
}
}
}
}
</style>

@ -0,0 +1,158 @@
<template>
<view class="jieguo" :style="{background: colors}">
<view class="place">
</view>
<view class="jieguo_box">
<view class="success">
<text class="iconfont icon-chenggong" :style="'color:' + colors"></text>
</view>
<view class="texts">
<!-- 支付成功 -->
订单创建成功
</view>
<!-- <view class="moneys">35.9</view> -->
<view class="wancheng" @tap="onsuccess" :style="'color:' + colors + ';border-color:' + colors">完成</view>
<view class="ewm" @tap="jumpUser">>>></view>
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
colors: ""
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
onsuccess() {
uni.switchTab({
url: '/pages/views/tabBar/category'
});
},
jumpUser() {
uni.switchTab({
url: '/pages/views/tabBar/user'
});
}
}
};
</script>
<style>
.jieguo{
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
padding: 0 8%;
overflow: hidden;
}
.place{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.3), rgba(255,255,255,.5),#ffffff);
z-index: 10;
}
.jieguo_box{
width: 88%;
background-color: #fff;
height: 90vw;
border-radius: 10upx;
box-shadow: 0upx 0upx 10upx #999;
padding: 20upx;
z-index: 900;
position: absolute;
top: 150upx;
left: 50%;
transform: translateX(-50%);
}
.success{
text-align: center;
margin-top: 50upx;
}
.success text{
font-size: 140upx;
}
.jieguo .texts, .moneys{
text-align: center;
font-size: 32upx;
margin-top: 20upx;
font-weight: bold;
}
.wancheng{
width: 80%;
height: 80upx;
border: 2upx solid #3E7E8B;
color: #3E7E8B;
text-align: center;
line-height: 80upx;
border-radius: 10upx;
margin: 0 auto;
margin-top: 150upx;
font-weight: bold;
}
.ewm{
margin-top: 20upx;
height: 40upx;
line-height: 40upx;
text-align: center;
font-size: 24upx;
color: #999;
}
</style>

@ -0,0 +1,383 @@
<template>
<view>
<canvas class="mycanvas" canvas-id="mycanvas" :style="'width:' + (windowWidth-60) + 'px;height:520px'"></canvas>
<!-- #ifdef H5 -->
<block>
<image class="imgs" :style="'width:' + (windowWidth-60) + 'px;height:520px'" :src="imgUrl" mode=""></image>
</block>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="saveImg" v-if="shows == true" @tap="saveImg" :style="'background:' + colors">
保存图片
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<p class="tips" v-if="shows == true"></p>
<!-- #endif -->
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
windowWidth: '',
windowHeight: '',
isShow: true,
colors: "",
ctx: '',
imgUrl: '',
shows:false,
userInfo: {
name: '反转',
logo: '/static/images/face.jpg',
goodsImg: '/static/images/goods/one.jpg',
price: '3599.00',
goodsName: '魅族17 8GB+128GB 十七度灰 骁龙865 旗舰5G手机 30W快充 6400W后置主摄 90Hz屏幕 支持NFC 智能拍照游戏手机'
}
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getSystem();
this.setData({
colors: app.globalData.newColor
});
this.setPoster();
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
getSystem() {
let that = this;
uni.getSystemInfo({
success: function(res) {
that.setData({
windowHeight: res.windowHeight,
windowWidth: res.windowWidth
});
}
});
},
setPoster() {
let ctx = uni.createCanvasContext('mycanvas', this); //
ctx.fillStyle = "#FFFFFF"
ctx.fillRect(0, 0, this.windowWidth - 60, 520)
/**
* 绘制名称
*/
const setText = (context, fs, color, x, y, c, bold) => {
context.setFillStyle(color);
context.setTextAlign('left');
if (bold) {
context.font = 'normal bold 20px Arial,sans-serif';
} else {
context.font = 'normal 20px Arial,sans-serif';
}
context.setFontSize(fs);
context.fillText(c, x, y);
context.restore();
};
setText(ctx, 14, '#333', 85, 35, this.userInfo.name, 'bold');
setText(ctx, 12, '#999', 85, 58, '为您挑选了一个好礼物');
ctx.save();
/**
* 绘制头像
*/
ctx.beginPath();
let avatar_width = 60; //
let avatar_height = 60; //
let avatar_x = 15; //x
let avatar_y = 15; //y
let radius = 8 //
//
this.setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius)
//
// this.setCircular(ctx, avatar_width, avatar_height, avatar_x, avatar_y)
//
this.setGoodsImg(ctx)
//
let pirce = '¥ ' + this.userInfo.price
this.setGoodsPrice(ctx, 20, this.colors, 15, 410, pirce)
//
this.setGoodsName(ctx)
//
this.setEwm(ctx);
},
setEwm(ctx) {
console.log('生成二维码')
let code_widht = 100; //
let code_height = 100; //
let x = this.windowWidth -170
ctx.drawImage("/static/images/ewm.png", x, 410, code_widht, code_height);
// #ifdef MP
setTimeout(() => { // h5
ctx.save();
ctx.draw()
this.shows = true
}, 200)
// #endif
// #ifdef H5
setTimeout(() => { // h5
ctx.save();
ctx.draw(true,()=>{
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: (res) => {
console.log(res)
this.imgUrl = res.tempFilePath
}
})
})
this.shows = true
}, 200)
// #endif
},
setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius) {
/**
* 绘制圆角
*/
ctx.arc(avatar_x + radius, avatar_y + radius, radius, Math.PI, Math.PI * 3 / 2);
ctx.lineTo(avatar_width - radius + avatar_x, avatar_y);
ctx.arc(avatar_width - radius + avatar_x, radius + avatar_y, radius, Math.PI * 3 / 2, Math.PI * 2);
ctx.lineTo(avatar_width + avatar_x, avatar_height + avatar_y - radius);
ctx.arc(avatar_width - radius + avatar_x, avatar_height - radius + avatar_y, radius, 0, Math.PI * 1 / 2);
ctx.lineTo(radius + avatar_x, avatar_height + avatar_y);
ctx.arc(radius + avatar_x, avatar_height - radius + avatar_y, radius, Math.PI * 1 / 2, Math.PI);
//
ctx.strokeStyle = "#fff";
ctx.fill() //bug
ctx.clip(); //
ctx.drawImage(this.userInfo.logo, avatar_x, avatar_y, avatar_width, avatar_height);
ctx.closePath()
ctx.restore();
},
setCircular(ctx, avatar_width, avatar_height, avatar_x, avatar_y) { //
/**
* 绘制圆形
*/
// x,y false
ctx.arc(avatar_width / 2 + avatar_x, avatar_height / 2 + avatar_y, avatar_width / 2, 0, Math.PI * 2, false); //
//
ctx.strokeStyle = "#fff";
ctx.fill() //bug
ctx.clip(); //
ctx.drawImage(this.userInfo.logo, avatar_x, avatar_y, avatar_width, avatar_height);
ctx.closePath()
ctx.restore();
},
setGoodsImg(ctx) { //
let width = this.windowWidth - 90
ctx.drawImage(this.userInfo.goodsImg, 15, 95, width, width);
ctx.save();
},
setGoodsPrice(ctx, fs, color, x, y, c, bold) { //
ctx.setFillStyle(color);
ctx.setTextAlign('left');
if (bold) {
ctx.font = 'normal bold 20px Arial,sans-serif';
} else {
ctx.font = 'normal 20px Arial,sans-serif';
}
ctx.setFontSize(fs);
ctx.fillText(c, x, y);
ctx.restore();
ctx.save();
},
setGoodsName(ctx) { //
let obj = {
x: 20, //x
y: 440, //y
width: 240,
height: 20,
line: 2,
color: '#202020',
size: 14, //
align: 'left',
baseline: 'top',
text: this.userInfo.goodsName,
bold: true
};
var td = Math.ceil(obj.width / (obj.size));
var tr = Math.ceil(obj.text.length / td);
for (var i = 0; i < tr; i++) {
var txt = {
x: obj.x,
y: obj.y + (i * obj.height),
color: obj.color,
size: obj.size,
align: obj.align,
baseline: obj.baseline,
text: obj.text.substring(i * td, (i + 1) * td),
bold: obj.bold
};
if (i < obj.line) {
if (i == obj.line - 1) {
txt.text = txt.text.substring(0, txt.text.length - 3) + '......';
}
this.drawText(ctx, txt);
}
}
},
/**
* 渲染文字
*
* @param {Object} obj
*/
drawText: function(ctx, obj) {
console.log('渲染文字', obj)
ctx.save();
ctx.setFillStyle(obj.color);
ctx.setFontSize(obj.size);
ctx.setTextAlign(obj.align);
ctx.setTextBaseline(obj.baseline);
if (obj.bold) {
ctx.fillText(obj.text, obj.x, obj.y - 0.1);
ctx.fillText(obj.text, obj.x - 0.1, obj.y);
}
ctx.fillText(obj.text, obj.x, obj.y);
if (obj.bold) {
ctx.fillText(obj.text, obj.x, obj.y + 0.1);
ctx.fillText(obj.text, obj.x + 0.1, obj.y);
}
ctx.restore();
},
saveImg() {
//
uni.showLoading({
title: '保存中...'
});
let that = this;
uni.getSetting({
success(res) {
uni.hideLoading();
if (!res.authSetting['scope.writePhotosAlbum']) {
uni.openSetting({
success(res) { //
}
});
} else {
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
console.log(res);
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(re) {
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
console.log(err);
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
}
});
}, 1000);
}
}
});
}
}
};
</script>
<style scoped lang="scss">
.mycanvas {
margin: 20upx auto 0;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
overflow: hidden;
}
.saveImg{
width: 80%;
height: 80upx;
line-height: 80upx;
text-align: center;
color: #fff;
background-color: #4DB8E4;
border-radius: 10upx;
margin: 40upx auto 20upx;
}
.imgs{
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
.tips{
text-align: center;
color: #999;
font-size: 24upx;
margin-top: 20upx;
}
</style>

@ -0,0 +1,206 @@
<template>
<view class="setting">
<view class="cell_box" @tap="goItem">
<item-cell cellname="关于商城" ></item-cell>
<item-cell cellname="站点帮助" ></item-cell>
<item-cell cellname="意见反馈"></item-cell>
</view>
<!-- 选择主题 -->
<view class="cu-list menu sm-border card-menu">
<view class="cu-item">
<view class="content flex align-center">
<text :class="'cuIcon-colorlens text-' + themeColor.name"></text>
<view :class="'padding solid radius shadow-blur bg-' + themeColor.name"></view>
<view class="title">商城主题色<text :class="'text-' + themeColor.name">{{themeColor.title}}</text></view>
</view>
<view class="action">
<button @tap="showColorModal" :class="'cu-btn round shadow bg-' + themeColor.name">
<text class="cuIcon-colorlens"></text> 选择主题
</button>
</view>
</view>
</view>
<!-- 选择颜色模态框 -->
<view :class="'cu-modal ' + (colorModal == true?'show':'')">
<view class="cu-dialog">
<view class="cu-bar justify-end solid-bottom">
<view class="content">选择颜色</view>
<view class="action" @tap="closeColor">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="grid col-5 padding">
<view v-for="(item, index) in themeList" :key="index" class="padding-xs" @tap="SetColor(item)">
<view :class="'padding-tb radius bg-' + item.name" style="color:#ffffff">
{{ item.title }}
</view>
</view>
</view>
</view>
</view>
<!-- 退出登录 -->
<view class="exit" :style="'color:' + themeColor.color" @tap="onexit">
退出登录
</view>
</view>
</template>
<script>
var app = getApp();
import { log } from "util";
import { setConfig, getConfig, removeToken,removeUserInfo } from "../../../utils/auth";
import { setTabBarBadge } from "@/utils/util";
import itemCell from "../../commponent/setting/item-cell";
export default {
data() {
return {
themeColor: {},
colorModal: false,
themeList: app.globalData.config
};
},
components: {
itemCell
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let config = getConfig();
this.setData({
themeColor: config
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
goItem() {
uni.showToast({
icon:'none',
title: '功能正在开发中,敬请期待'
})
},
showColorModal() {
this.setData({
colorModal: true
});
},
closeColor() {
this.setData({
colorModal: false
});
},
SetColor(item) {
setConfig(item);
this.setData({
themeColor: item,
colorModal: false
});
app.globalData.newColor = item.color;
},
onexit() {
//退
uni.showModal({
cancelColor: '#999',
content: '确认要退出登录吗?',
confirmColor: this.themeColor.color,
success: function (res) {
if (res.confirm) {
removeToken();
removeUserInfo()
uni.showToast({
title: '退出成功',
icon: 'none'
});
setTabBarBadge(0)
setTimeout(() => {
uni.switchTab({
url: '/pages/views/tabBar/category'
});
}, 1500);
}
}
});
}
}
};
</script>
<style scoped lang="scss">
.bg-default{
background-color: #fa436a;
color: #fff;
}
.text-default{
color: #fa436a;
}
.cu-item .title{
margin-left: 20upx;
font-size: 28upx;
}
.action button{
width: 200upx!important;
font-size: 24upx;
color: #fff;
}
.card-menu{
margin: 0!important;
padding-top: 20upx;
}
.cell_box{
padding-top: 20upx;
}
.exit{
width: 100%;
height: 80upx;
line-height: 80upx;
text-align: center;
background-color: #FFFFFF;
font-size: 30upx;
position: fixed;
left: 0;
bottom: 50upx;
}
</style>
<style>
page{
background-color: #F8F8F8!important;
}
</style>

@ -0,0 +1,779 @@
<template>
<view class="cart" style="background-color: #5f6f7;min-height: 100vh;">
<!-- #ifdef APP-PLUS -->
<div class="status-bar" :style="{height:statusBarHeight+'px'}"></div>
<!-- #endif -->
<block v-if="cartList.length !== 0">
<view class="clearCart" :style="{top:showHeader==true?statusBarHeight+'px':'0upx'}" @click="clearInvalid"></view>
<!-- <view class="clearCart" :style="{color:colors,top:showHeader==true?statusBarHeight+'px':'0upx'}" @click="clearInvalid"></view> -->
<view class="cart_box">
<view v-for="(item, index) in cartList" :key="index" class="cart_list"
@longpress.stop="onshowDel(item,index)"
@touchend="ontouchend">
<view class="checkbox-box" @tap="setCurrent(item,index)">
<view class="checkbox text-xxl" style="border: 0px;" v-if="item.status !== 1 ">
<text class="cuIcon-roundcheckfill "
:class="item.current == true ? 'text-green':'text-gray'" ></text>
</view>
<view class="checkbox" style="border-color:#ccc" v-else>
<view></view>
</view>
</view>
<view class="cover" @tap="jumpDetails(item,index)">
<image :src="item.selectSku.img" mode="aspectFill" v-if="item.selectSku"></image>
<image :src="item.img" mode="aspectFill" v-else></image>
<text class="masks"></text>
<text class="mask" v-if="item.status == 1"></text>
</view>
<view class="right">
<view class="goods_name" @tap="jumpDetails(item,index)">
{{item.title}}
</view>
<view class="sku">
<block v-if="item._selectedSku.length">
<text style="margin-left: 10upx;" v-for="_it in item._selectedSku" key="it">{{
_it.tagname
}}</text>
</block>
<block v-else>
<text>暂无规格</text>
</block>
</view>
<view class="numbers">
<text class="price" v-if="item.selectSku">
{{ item.selectSku.money }}
</text>
<text class="price" v-else>
{{(Number(item.money) * item.number).toFixed(2)}}
</text>
<view class="right_btn">
<view class="sub" @tap="onsub(item,index)" :style="'color:' + (item.num == 1?'#ccc':'')">-</view>
<view class="input">
<input :value="item.number" maxlength="2" disabled></input>
</view>
<view class="add" @tap="onadd(item,index)">+</view>
</view>
</view>
</view>
<!-- 删除的遮罩层 长按触发 -->
<view class="del_mask" v-if="current == index" :style="'z-index:' + (current == index ?'99':'-21')" @tap="oncencal">
</view>
<view class="dask_del" :style="'opacity:' + (current == index ?'1':'0') + ';z-index:' + (current == index ?'100':'-20')+';left:'+(current == index?'0':'-100%')">
<text class="del" @tap="delItem(item,index)"></text>
<text class="cencal" @tap="oncencal"></text>
</view>
</view>
<view class="daodi" v-if="cartList.length >= 5"> </view>
</view>
<!-- 全选 -->
<view class="bottom_all" :style="{marginBottom: bottomShow}">
<view class="left">
<view class="checkbox-box" @tap="setAllCurrent">
<view class="checkbox text-xxl" :style="'border-color:' + colors">
<view class="cuIcon-roundcheckfill "
:class="allCurrent ? 'text-green':'text-gray'" ></view>
</view>
<view class="text" style="margin-left: 8upx;">全选</view>
</view>
<view class="delAll" @click="delectAll" :style="'border-color:' + colors + ';color:' + colors" v-if="allCurrent == true"></view>
</view>
<view class="rights">
<view class="jiesuan" :style="'background-color:' + colors" @click="settlement">({{sum}})</view>
<view class="sum">合计<text style="font-size: 30upx;">{{sumPrice || 0}}</text></view>
</view>
</view>
</block>
<!-- 如果购物车没有数据 -->
<view class="nocart" v-if="cartList.length == 0">
<text class="iconfont icon-gouwuche1" :style="'color:' + colors"></text>
<view>空空如也,<text :style="'color:' + colors" @tap="onStroll">便 ></text></view>
</view>
</view>
</template>
<script>
var app = getApp();
import {
setGoodsDetails,getCartNumber,
getCartDetails_goods_id,
getCart,
setGoodsData,
resetCart,
removeCart,
getToken
} from '@/utils/auth.js'
import {resetNum, setTabBarBadge} from '@/utils/util.js'
export default {
data() {
return {
colors: '',
statusBarHeight:20,
cartList: [],
current: 99999,
allCurrent: false,
sum: 0,
sumPrice: 0,
lock: false,
bottomShow: '',
showHeader: false
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// #ifdef MP
this.bottomShow = 0
// #endif
// #ifdef H5
this.bottomShow = '100upx'
// #endif
// #ifdef APP-PLUS
this.showHeader = true //APP
// #endif
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
if (!getToken()) {
uni.navigateTo({
url: '/pages/login/index1'
})
return
}
let cart = getCart() || []
this.setData({
colors: app.globalData.newColor,
current: '99999',
cartList: cart,
allCurrent: false,
sum: 0,
sumPrice: 0
});
setTabBarBadge(cart.length)
this.setAllCurrent(false)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
setCurrent(item, index) {
if (item.status == 1) { //status 1
return
}
//
let cartList = this.cartList;
let dataList = this.cartList[index];
dataList.current = !dataList.current;
let datas = 'cartList[' + index + ']';
let currentAll = false;
let count = [];
cartList.forEach(e => {
if (e.current == true) {
count.push(e);
}
});
if (count.length == cartList.length) { //
currentAll = true;
}
this.setData({
[datas]: dataList,
allCurrent: currentAll,
});
console.log(cartList)
resetCart(cartList)
this.getSumprice()
},
onshowDel(item, index) {
//
this.setData({
current: index,
lock: true
});
return;
},
delItem(item, index) {
//
this.cartList.splice(index, 1)
this.setData({
current: '9999',
lock: false
})
uni.showToast({
title: '删除成功',
icon: 'none'
})
this.getSumprice() //
resetCart(this.cartList)
setTabBarBadge(this.cartList.length)
},
oncencal() {
//
this.setData({
current: '99999'
});
},
onsub(item, index) {
// //
if (item.status == 1 || item.number <= 1) {
return
}
let number = item.number - 1
this.$set(item, 'number', number)
resetCart(this.cartList)
this.getSumprice() //
},
onadd(item, index) {
if (item.status == 1) { //
return
}
//
let num = item.number + 1;
this.$set(item, 'number', num)
resetCart(this.cartList)
this.getSumprice() //
},
setAllCurrent(isClick = true) {
//
let dataList = this.cartList;
let allCurrent = this.allCurrent;
let sumPrice = 0;
//
const isOff = dataList.some(v => v.status == 1)
if (isOff) {
uni.showToast({
title: '存在失效商品',
icon: 'none'
})
return
}
if (isClick) {
dataList.forEach(element => { //
element.current = !allCurrent;
});
allCurrent = !allCurrent;
} else {
allCurrent = dataList.every(v => v.current)
}
this.setData({
cartList: dataList,
allCurrent: allCurrent,
});
this.getSumprice()
},
getSumprice() { //
let sumPrice = 0;
const list = this.cartList.filter(v => v.current)
list.forEach(v => {
if (v.selectSku) {
sumPrice += resetNum(v.selectSku.money * v.number)
} else {
sumPrice += resetNum(v.money * v.number)
}
})
this.sum = list.length
this.sumPrice = resetNum(sumPrice, 'end')
},
ontouchend() { //
console.log('触发了touch');
if (this.lock) {
setTimeout(() => {
this.setData({
lock: false
});
}, 100);
}
},
clearInvalid() { // status
this.cartList.forEach((e, index) => {
if (e.status == 1) {
this.cartList.splice(index, 1)
}
e.current = false
})
uni.showToast({
title: '清空成功~',
icon: 'none'
})
setTabBarBadge(this.cartList.length)
},
delectAll() { //
this.cartList = []
removeCart()
setTabBarBadge(this.cartList.length)
},
jumpDetails(item, index) {
if (item.status == 1 || this.lock) { //
return
}
let cartD = getCartDetails_goods_id(item.goods_id)
setGoodsDetails(cartD)
uni.navigateTo({
url: '/pages/views/goods/goodsDetails'
});
},
settlement() { //
if (this.sum == 0) {
return
}
//
uni.showLoading({
title: '提交中...'
})
let arr = []
this.cartList.forEach(e => {
if (e.current == true) {
arr.push(e)
}
})
setGoodsData(arr) //
setTimeout(() => {
uni.hideLoading()
uni.navigateTo({
url: '/pages/views/order/confirmOrder'
})
}, 1000)
},
onStroll() { //便
uni.switchTab({
url: '/pages/views/tabBar/category'
});
}
}
};
</script>
<style lang="scss" scoped>
.cart {
padding: 10rpx 4%;
background-color: #F5F6F7;
}
.clearCart {
height: 80rpx;
font-size: 40rpx;
text-align: left;
line-height: 80rpx;
position: fixed;
left: 0;
width: 100vw;
padding: 0 4%;
background-color: #FFFFFF;
z-index: 100;
letter-spacing: 1px;
}
.cart_box {
margin-top: 80rpx;
padding-bottom: 100rpx;
}
.cart_list {
width: 92vw;
height: calc(22vw + 34rpx);
border-radius: 12rpx;
box-shadow: 0px 4rpx 16rpx rgba(0, 0, 0, .1);
overflow: hidden;
border: 0;
display: flex;
align-items: center;
position: relative;
margin-bottom: 20rpx;
background-color: #FFFFFF;
}
.cart_list .checkbox-box {
padding-left: 16rpx;
flex-shrink: 0;
height: 22vw;
margin-right: 16rpx;
align-items: center;
position: relative;
width: 50rpx;
}
.cart_list .checkbox-box .checkbox {
width: 28rpx;
height: 28rpx;
border-radius: 100%;
border: solid 1rpx;
position: absolute;
top: 50%;
left: 20rpx;
display: flex;
align-items: center;
justify-content: center;
transform: translateY(-50%);
}
.cart_list .checkbox-box .checkbox .on {
width: 20rpx;
height: 20rpx;
border-radius: 100%;
align-items: center;
}
.cart_list .cover {
width: 22vw;
height: 22vw;
flex-shrink: 0;
margin-left: 10rpx;
border-radius: 8rpx;
overflow: hidden;
margin-right: 10rpx;
position: relative;
}
.cart_list .cover .mask {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .6);
position: absolute;
top: 0;
left: 0;
text-align: center;
color: #ddd;
font-size: 24upx;
line-height: 22vw;
}
.cart_list .cover .masks {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.cart_list .cover image {
width: 100%;
height: 100%;
display: block;
}
.daodi {
text-align: center;
font-size: 24rpx;
color: #ccc;
margin-top: 30rpx;
}
.right {
height: 22vw;
width: 100%;
/* overflow: hidden; */
display: flex;
flex-wrap: wrap;
padding-right: 15rpx;
position: relative;
}
.right .goods_name {
width: 100%;
font-size: 24rpx;
line-height: 34rpx;
max-height: 68rpx;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.sku {
font-size: 22rpx;
background-color: #f3f3f3;
border-radius: 10rpx;
height: 40rpx;
line-height: 40rpx;
padding: 0 10rpx;
color: #a7a7a7;
margin-bottom: 40rpx;
}
.numbers {
position: absolute;
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: flex-end;
height: 50rpx;
bottom: -5rpx;
}
.numbers .price {
font-size: 30rpx;
line-height: 50rpx;
color: $mycolor;
}
.numbers .right_btn {
display: flex;
justify-content: center;
align-items: flex-end;
margin-right: 20rpx;
}
.right_btn .sub {
width: 40rpx;
height: 40rpx;
font-size: 40rpx;
background-color: #f3f3f3;
border-radius: 4rpx;
text-align: center;
line-height: 40rpx;
}
.right_btn .sub:active {
background-color: #f8f8f8;
}
.right_btn .input {
width: 50rpx;
height: 50rpx;
margin: 0 8rpx;
background-color: #f3f3f3;
}
.right_btn .input input {
width: 50rpx;
height: 50rpx;
display: flex;
font-size: 22rpx;
text-align: center;
align-items: center;
justify-content: center;
color: $mycolor;
}
.right_btn .add {
width: 40rpx;
height: 40rpx;
font-size: 40rpx;
background-color: #f3f3f3;
border-radius: 4rpx;
text-align: center;
line-height: 40rpx;
}
.right_btn .add:active {
background-color: #f8f8f8;
}
.del_mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: -21;
}
.dask_del {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .5);
z-index: -20;
display: flex;
align-items: center;
opacity: 0;
transition: all 0.3s;
}
.dask_del .del,
.cencal {
width: 100rpx;
height: 100rpx;
display: flex;
justify-content: center;
line-height: 100rpx;
border-radius: 100%;
text-align: center;
font-size: 24rpx;
background: linear-gradient(#FF5D39, #FFAF48);
color: #ffffff;
font-weight: 500;
margin: 0 auto;
}
.dask_del text:active {
opacity: 0.9;
}
.cencal {
background: linear-gradient(#FFE846, #FFCD43);
}
.bottom_all {
height: 100rpx;
width: 100%;
padding: 0 2%;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0;
left: 0;
background-color: #fdfdfd;
z-index: 11;
border-top: 1upx solid #F8F8F8;
}
.bottom_all .left {
float: left;
width: 40vw;
font-size: 24rpx;
position: relative;
}
.bottom_all .left .delAll {
height: 40rpx;
border-radius: 20rpx;
font-size: 22rpx;
line-height: 38rpx;
border: solid 1rpx;
text-align: center;
width: 92rpx;
position: absolute;
right: 50rpx;
top: 50%;
transform: translateY(-50%);
}
.bottom_all .left .text {
position: absolute;
left: 60rpx;
top: 50%;
transform: translateY(-52%);
}
.bottom_all .checkbox-box {
padding-left: 16rpx;
flex-shrink: 0;
height: 100rpx;
margin-right: 16rpx;
align-items: center;
position: relative;
}
.bottom_all .checkbox-box .checkbox {
width: 40rpx;
height: 40rpx;
border-radius: 100%;
border: solid 1rpx;
position: absolute;
top: 50%;
left: 20rpx;
display: flex;
align-items: center;
justify-content: center;
transform: translateY(-50%);
}
.bottom_all .checkbox-box .checkbox .on {
// width: 20rpx;
// height: 20rpx;
border-radius: 100%;
align-items: center;
}
.bottom_all .rights {
float: right;
width: 56vw;
line-height: 100rpx;
font-size: 24rpx;
}
.bottom_all .rights view {
float: right;
}
.bottom_all .rights .sum {
font-weight: bold;
margin-right: 20rpx;
}
.bottom_all .rights .jiesuan {
padding: 0 22rpx;
border-radius: 24rpx;
background-color: pink;
height: 50rpx;
line-height: 50rpx;
color: #ffffff;
font-size: 24rpx;
margin-top: 28rpx;
margin-left: 40rpx;
}
/* 购物车为空的样式} */
.nocart {
text-align: center;
margin-top: 30vh;
}
.nocart .iconfont {
font-size: 80rpx;
text-align: center;
}
.nocart view {
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
color: #999;
margin-top: 20rpx;
}
</style>

@ -0,0 +1,325 @@
<template>
<view class="category">
<!-- 搜索 -->
<!-- #ifdef APP-PLUS -->
<div class="status-bar" :style="{height:statusBarHeight+'px'}"></div>
<!-- #endif -->
<view class="search">
<search class="w-100"></search>
</view>
<view class="VerticalBox">
<scroll-view class="VerticalNav nav" scroll-y scroll-with-animation
:scroll-top="verticalNavTop" style="height:calc(100vh - 140px)">
<view class="cu-item text-sm"
:class="index==tabCur?'text-green cur':''"
v-for="(categoryType_item,index) in categoryType" :key="index" @tap="TabSelect"
:data-id="index">
{{categoryType_item.name}}
</view>
</scroll-view>
<scroll-view class="padding-sm" scroll-y scroll-with-animation style="width: calc(100% - 110px); height:calc(100vh - 140px)"
:scroll-into-view="'main-'+mainCur" @scroll="VerticalMain">
<view class="type_head">
<view class="type_head_item text-center text-xs" v-for="(type,index) in subPoiCategories"
:class="type.id==tabTypeCur?'type_head_item_cur':''" @tap="TabTypeSelect" :key="index":data-id="type.id">
<view class="">{{type.name}}</view>
</view>
</view>
<view class="type_good">
<goodList style="width: 100%; background-color: #FFFFFF;" :propsList = "cateGood" ></goodList>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import { getGoodsList } from '@/api/index.js'
import search from "../../commponent/public/search";
import goodList from '../../commponent/home/goodList';
import jsonData from "../../../json.js"
import { getCart, getToken } from '../../../utils/auth';
import { setTabBarBadge } from '@/utils/util.js'
var app = getApp();
export default {
data() {
return {
mainCur: 0,
tabCur: 0,
categoryType:[], //
verticalNavTop: 0,
subPoiCategories:[], //
tabTypeCur:0, //id
cateGood:[],
bottoms: '100',
showHeader: false, //APPh5
classLevel: true, // true false
colors: "",
current: "",
scrollTop: "",
statusBarHeight: 20,
currentTwo: 0,
currentThere: 0,
_goods: []
};
},
components: {
search,
goodList
},
mounted() {
this.getGoodsList()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// #ifdef APP-PLUS
this.showHeader = true //APP
this.bottoms = '0' //APP
// #endif
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
if (getToken()) {
const carts = getCart()
setTabBarBadge(carts.length)
} else {
setTabBarBadge(0)
}
this.setData({
colors: app.globalData.newColor
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
getGoodsList() {
const s = [
{
"rule": "eq",
"type": "string",
"dictCode": "",
"val": "1",
"field": "ifSale"
}
]
const params = {
pageNo:1,
pageSize: 100,
superQueryParams: encodeURI(JSON.stringify(s)),
superQueryMatchType: 'and'
}
getGoodsList(params).then(res => {
const result = res.result.records.reduce((c,v) => {
c[v.category] = c[v.category] || []
c[v.category].push(v)
return c
}, {})
const data = Object.keys(result).map((v, index) => {
return {
name: v,
id: index,
children: result[v],
"leaf": 0,
"type": 100,
"subPoiCategories": []
}
})
this._goods = data
this.categoryType = data
this.subPoiCategories = []
this.cateGood = data[this.tabCur].children
})
},
TabSelect(e) {
this.tabCur = e.currentTarget.dataset.id;
this.mainCur = e.currentTarget.dataset.id;
this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50;
this.subPoiCategories = []
this.cateGood = this._goods[this.tabCur].children
},
TabTypeSelect(e) {
this.tabTypeCur = e.currentTarget.dataset.id;
},
VerticalMain(e) {
// #ifdef MP-ALIPAY
return false //
// #endif
let that = this;
let tabHeight = 0;
if (this.load) {
for (let i = 0; i < this.categoryType.length; i++) {
let view = uni.createSelectorQuery().select("#main-" + this.categoryType[i].id);
view.fields({
size: true
}, data => {
this.categoryType[i].top = tabHeight;
tabHeight = tabHeight + data.height;
this.categoryType[i].bottom = tabHeight;
}).exec();
}
this.load = false
}
let scrollTop = e.detail.scrollTop + 10;
for (let i = 0; i < this.categoryType.length; i++) {
if (scrollTop > this.categoryType[i].top && scrollTop < this.categoryType[i].bottom) {
this.verticalNavTop = (this.categoryType[i].id - 1) * 50
this.tabCur = this.categoryType[i].id
console.log(scrollTop)
return false
}
}
}
}
};
</script>
<style scoped lang="scss">
.fixed {
position: fixed;
z-index: 99;
}
.VerticalNav.nav {
width: 200upx;
white-space: initial;
background-color: #f1f1f1;
}
.VerticalNav.nav .cu-item {
width: 100%;
text-align: center;
background-color: #f1f1f1 ;
margin: 0;
border: none;
height: 50px;
position: relative;
}
.VerticalNav.nav .cu-item.cur {
background-color: #fff;
}
.VerticalNav.nav .cu-item.cur::after {
content: "";
width: 8upx;
height: 50upx;
border-radius: 0 10upx 10upx 0 ;
position: absolute;
background-color: #4BDA4D;
top: 0;
left: 0;
bottom: 0;
margin: auto;
}
.VerticalBox {
display: flex;
}
.VerticalMain {
background-color: #fff;
flex: 1;
}
.category {
background-color: #ffffff;
position: fixed;
width: 100%;
height: 100%;
box-sizing: border-box;
top: 0;
bottom: 0;
z-index: 10;
}
.search {
height: 70px;
padding: 10upx 10upx;
padding-left: 10upx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
}
.type_head{
display: grid;
grid-template-columns: repeat(3,33.33%);
grid-gap: 10rpx;
}
.type_head_item{
line-height: 65rpx;
color: #000000;
background-color: #F5F6F7;
border-radius: 15rpx;
}
.type_head_item_cur{
line-height: 65rpx;
color: #1E9C3D;
background-color: #E4FCDE;
border-radius: 15rpx;
}
</style>

@ -0,0 +1,190 @@
<template>
<view class="home">
<!-- 顶部 -->
<headers :colors="colors" :locations="locations" :swiperList="swiperList" ></headers>
<!-- title -->
<view class="home-title grid col-3 text-center padding-top-sm text-sm">
<view v-for="(item,index) in gridList" :ukey="index">
<text class="cuIcon-evaluate_fill padding-right-xs "></text>
{{item.tilte}}
</view>
</view>
<!-- 超值卖场 -->
<chaozhi></chaozhi>
<!-- 推荐分类菜单 与tab分类中不同 -->
<classList></classList>
<!-- 推销活动 -->
<activity></activity>
<!-- 秒杀四方格 -->
<fourSquares></fourSquares>
<view class="m-3 text-lg padding-tb-sm">猜你喜欢</view>
<goodList></goodList>
<image class="bottomTap" src="/static/images/new/caomei.gif" ></image>
</view>
</template>
<script>
import {getCartNumber} from '@/utils/auth.js'
import { setTabBarBadge } from'@/utils/util.js'
var app = getApp();
import headers from '../../commponent/home/header';
import chaozhi from '../../commponent/home/chaozhi';
import classList from '../../commponent/home/classList';
import activity from '../../commponent/home/activity';
import fourSquares from '../../commponent/home/fourSquares';
import goodList from '../../commponent/home/goodList';
import {
getlocation
} from '@/utils/auth.js'
export default {
data() {
return {
gridList:[{tilte:"新鲜食材"},{tilte:"天天低价"},{tilte:"售后无忧"}],
swiperList: [{
img: '/static/images/new/banner11.jpg'
},{
img: '/static/images/new/banner22.png'
},{
img: '/static/images/new/banner33.png'
},{
img: '/static/images/new/banner44.png'
}],
colors: '',
bottoms: '100',
scrollShow: false, //
locations: {
},
loading: true,
};
},
components: {
headers,
chaozhi,
classList,
activity,
fourSquares,
goodList,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// #ifdef APP-PLUS
this.bottoms = '0' //APP
// #endif
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
colors: app.globalData.newColor
});
uni.setNavigationBarColor({ //
// backgroundColor: app.globalData.newColor,
// frontColor: '#ffffff'
});
// #ifdef H5
let locations = getlocation() //
if (locations) {
this.locations = locations
}
// #endif
let cartNumber = getCartNumber()|| 0
setTabBarBadge(cartNumber)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
// if (this.dataList.length >= 30) { //
// this.loading = false
// return
// }
// let data = this.dataList;
// setTimeout(() => {
// this.loading = true
// this.dataList.push(...data);
// }, 500)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
onPageScroll: function(e) {
if (e.scrollTop >= 500) {
this.setData({
scrollShow: true
});
} else {
this.setData({
scrollShow: false
});
}
}
}
};
</script>
<style scoped lang="scss">
.home {
margin-bottom: 40rpx;
}
.home-title{
color: rgb(158, 160, 166);
border-radius-top: 20px;
border-radius: 20px 20px 0 0;
background-color: #fff;
position: relative;
z-index: 99999;
top: -10px;
}
.bottomTap{
width: 75px;
height: 75px;
position: fixed;
bottom: 80px;
right: 3%;
z-index: 200;
}
</style>

@ -0,0 +1,397 @@
<template>
<view class="userbox">
<!-- 头部个人信息 不变-->
<view class="userHeader" :style="{background:colors}">
<image src="/static/images/user/user-bg.png" class="user_bg"></image>
<view class="nav">
<view class="user" @click="onLogin">
<image :src="userdata.avatar" v-if="userdata.avatar"></image>
<image src="../../../static/images/face.jpg" v-else></image>
<text>{{userdata.username || '登录'}}</text>
</view>
</view>
<view class="vip">
<image src="/static/images/user/vip-card.png" class="vip_bg"></image>
<view class="vipname">
<text class="iconfont icon-zuanshi zuanshi"></text>
<text class="names">
商城尊享会员
</text>
<text class="vip_level">会员</text>
</view>
<view class="banquan">
商城版权所有©
</view>
</view>
</view>
<!-- 中间菜单栏 -->
<!-- #ifndef H5 -->
<view class="userMenu" @touchstart="coverTouchStart" @touchmove="coverTouchMove" @touchend="coverTouchEnd" :style="'transform:' + coverTransform + ';transition:' + coverTransition">
<image src="/static/images/user/arc.png" class="arc"></image>
<!-- 我的账户 -->
<my-account :colors="colors"></my-account>
<!-- 全部订单 -->
<my-order :orderText="orderText" :colors="colors"></my-order>
<!-- 我的足迹 -->
<my-footprint :logList="logList" :colors="colors"></my-footprint>
<!-- 我的服务 -->
<my-server :serverList="serverList" :colors="colors" :userinfo="userdata"></my-server>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="userMenu" @touchmove.stop.prevent="moveHandle" @touchstart="coverTouchStart" @touchmove="coverTouchMove" @touchend="coverTouchEnd" :style="'transform:' + coverTransform + ';transition:' + coverTransition">
<image src="/static/images/user/arc.png" class="arc"></image>
<!-- 我的账户 -->
<!-- <my-account :colors="colors"></my-account> -->
</view>
<view class="place" >
<!-- 全部订单 -->
<my-order :orderText="orderText" :colors="colors"></my-order>
<!-- 我的足迹 -->
<my-footprint :logList="logList" :colors="colors"></my-footprint>
<!-- 我的服务 -->
<my-server :serverList="serverList" :colors="colors"></my-server>
</view>
<!-- #endif -->
</view>
</template>
<script>
let app = getApp();
import { getConfig, getUserInfo,getToken, getGoodsHistory } from '@/utils/auth';
import myAccount from "../../commponent/user/my-account";
import listCell from "../../commponent/user/list-cell";
import myOrder from "../../commponent/user/my-order";
import myFootprint from "../../commponent/user/my-footprint";
import myServer from "../../commponent/user/my-server";
import { ORDER_NAVS } from '../../../config/order.js'
export default {
data() {
return {
colors: '',
startY: 0,
//
moving: false,
//
coverTransform: 'translateY(0px)',
//
coverTransition: '0s',
//
orderText: ORDER_NAVS.slice(1),
logList:getGoodsHistory(),
serverList: [{
name: '我的收藏',
icon: 'icon-shoucang',
url: '/pages/views/user/mycollection',
id: 1,
elseUrl: ''
}, {
name: '地址管理',
icon: 'icon-dizhi',
url: '/pages/views/user/myaddress',
id: 2,
elseUrl: ''
},{
name: '分销中心',
icon: 'icon-fenxiao',
url: '/pages/views/user/mydistribution',
id: 6,
elseUrl: ''
}, {
name: '分享',
icon: 'icon-fenxiang1',
url: '/pages/views/user/extension',
id: 7,
elseUrl: ''
}, {
name: '联系我们',
icon: 'icon-kefu1',
url: '',
id: 8,
elseUrl: ''
}, {
name: '设置',
icon: 'icon-shezhi2',
url: '../setting/index',
id: 9,
elseUrl: ''
}],
oldcolor: '',
userdata: {}
};
},
components: {
myAccount,
listCell,
myOrder,
myFootprint,
myServer
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if (!getToken()) {
uni.navigateTo({
url: '/pages/login/index1'
})
return
}
let colors = app.globalData.newColor;
let oldcolor = this.colors;
let userdata = getUserInfo() || {};
this.setData({
colors: colors,
userdata: userdata
});
if (oldcolor !== colors) {
//
let config = getConfig();
let tabList = config.tabList;
uni.setTabBarStyle({
selectedColor: colors
});
if(tabList){
for (var i = 0; i < tabList.length; i++) {
let img = tabList[i];
uni.setTabBarItem({
//tabBar
index: i,
selectedIconPath: img
});
}
}
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
onLogin(){
let token = getToken()
if(getToken()){
return
}
uni.navigateTo({
url:'../../login/login'
})
},
coverTouchStart(e) {
//
this.setData({
startY: e.touches[0].clientY,
coverTransition: 'transform .2s linear'
});
},
moveHandle(){ //
},
coverTouchMove(e) {
//
let moveY = e.touches[0].clientY; //
let startY = this.startY;
let moveDistance = moveY - startY; //
if (moveDistance < 0) {
//0
this.setData({
moving: false
});
return;
}
this.setData({
moving: true
});
if (moveDistance >= 60) {
//
moveDistance = 60;
}
if (moveDistance > 0 && moveDistance <= 60) {
this.setData({
coverTransform: `translateY(${moveDistance}px)`
});
}
},
coverTouchEnd(e) {
//
if (this.moving == false) {
return;
}
this.setData({
coverTransform: 'translateY(0px)',
moving: false,
coverTransition: 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)'
});
},
}
};
</script>
<style scoped lang="scss">
.userHeader {
height: 520upx;
width: 100vw;
position: relative;
padding: 50upx 4%;
}
.userHeader .user_bg {
height: 100%;
width: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
}
.userHeader .nav {
height: 180upx;
display: flex;
align-items: center;
justify-content: space-between;
}
.user {
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
overflow: hidden;
z-index: 200;
}
.user image {
width: 130upx;
height: 130upx;
border: 5upx solid #fff;
border-radius: 50%;
}
.user text {
font-size: 38upx;
color: #fff;
margin-left: 20upx;
}
.vip {
height: 240upx;
position: relative;
display: flex;
padding: 20upx 24upx;
border-radius: 16upx 16upx 0 0;
width: 100%;
overflow: hidden;
}
.banquan {
position: absolute;
color: #f6e5a3;
top: 100upx;
left: 24upx;
font-size: 24upx;
}
.vip .vip_bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.vipname {
z-index: 5;
display: flex;
width: 100%;
height: 60upx;
position: relative;
align-items: center;
}
.vipname .zuanshi {
color: #f6e5a3;
font-size: 42upx;
line-height: 60upx;
}
.vipname .names {
color: #f6e5a3;
line-height: 20upx;
font-size: 24upx;
margin-left: 20upx;
}
.vip_level {
width: 115upx;
height: 35upx;
text-align: center;
line-height: 35upx;
font-size: 20upx;
color: #333;
background: linear-gradient(270deg, #f9e6af, #ffd465);
border-radius: 20upx;
position: absolute;
top: 12upx;
right: 10upx;
}
/* 中间菜单栏 */
.userMenu {
margin-top: -178upx;
padding: 0 4%;
position: relative;
background-color: #f8f8f8;
padding-bottom: 10upx;
}
.userMenu .arc {
width: 100%;
height: 36upx;
position: absolute;
top: -34upx;
left: 0;
}
.place{
padding: 0 4%;
position: relative;
background-color: #f8f8f8;
padding-bottom: 40upx;
}
</style>

@ -0,0 +1,323 @@
<template>
<view>
<view class="editaddress">
<view class="content">
<view class="row">
<view class="nominal">收件人</view>
<view class="input"><input placeholder="请输入收件人姓名" v-model="addressData.recipient" type="text"></input></view>
</view>
<view class="row">
<view class="nominal">电话号码</view>
<view class="input"><input placeholder="请输入收件人电话号码" v-model="addressData.telephone" type="number" maxlength="11"></input></view>
</view>
<view class="row">
<view class="nominal">所在地区</view>
<view class="input selectcity" @tap="openPicker">
<input placeholder="请选择省市区" disabled type="text" v-model="addressData.address"></input>
<image src="/static/images/home/right.png" class="rights"></image>
</view>
</view>
<view class="row">
<view class="nominal">详细地址</view>
<view class="input"><textarea style="font-size: 28upx;" v-model="addressData.moreAddres" auto-height="true" placeholder="输入详细地址" v-if="show == false"></textarea></view>
</view>
<view class="row">
<view class="nominal" style="color: #999;margin-top: 10upx;">设为默认地址</view>
<view class="input switch"><switch :color="colors" style="transform:scale(0.8)" @change="switchChange" :checked="addressData.isDefault == 1"></switch></view>
</view>
</view>
<view class="save" @tap="addAddr"><view class="btn" :style="'background:' + colors">保存地址</view></view>
<!-- 省市区选择 -->
<setcity :show="show" @sureSelectArea="onsetCity" @hideShow="onhideShow"></setcity>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import setcity from "../../../commponent/public/setCity/nyz_area_picker";
import loading from "../../../commponent/public/loading";
import { addAddr, editAddr} from '@/api/index.js'
import { getUserInfo } from "@/utils/auth";
export default {
data() {
return {
colors: '',
show: false,
addressData: {
"province": '',
"city":'',
"county": '',
"detail": '',
"isDefault": 0 ,
"recipient": '',
// "remark": "",
"telephone": '',
name:'',
phone:'',
address:'',
moreAddres:'',
isdefult: 0,
id:0
},
address: [],
isShow: true
};
},
components: {
setcity,
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type == 'edit'){ //
this.addressData = Object.assign(this.addressData, JSON.parse(options.address))
this.addressData.moreAddres = this.addressData.detail.split(',')[1]
this.addressData.address = this.addressData.detail.split(',')[0]
this.address = [this.addressData.province, this.addressData.city, this.addressData.county]
this.checked = this.addressData.isDefault == 1
}
setTimeout(() => {
this.setData({
isShow: false,
colors: app.globalData.newColor
});
}, 500);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
addAddr() {
if ( this.address.length < 1 || !this.addressData.moreAddres || !this.addressData.recipient ||
!this.addressData.telephone) {
uni.showToast({
icon: 'none',
title: '请填写信息'
})
return
}
const telReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
if (!telReg.test(this.addressData.telephone)) {
uni.showToast({
icon: 'none',
title: '请填写正确手机号'
})
return
}
const params = {
"province": this.address[0],
"city": this.address[1],
"county": this.address[2],
"detail": this.address.join('') + ',' +this.addressData.moreAddres,
"isDefault": this.checked ? 1 : 0 ,
"recipient": this.addressData.recipient,
// "remark": "",
"telephone": this.addressData.telephone,
"userId": getUserInfo().id
}
if (this.addressData.id) {
params.id = this.addressData.id
editAddr(params).then(res => {
if (res.result) {
uni.showToast({
icon: 'none',
title: '操作成功'
})
}
uni.navigateBack()
})
return
}
addAddr(params).then(res => {
if (res.result) {
uni.showToast({
icon: 'none',
title: '操作成功'
})
}
uni.navigateBack()
})
},
openPicker() {
console.log('执行')
this.show = true
},
onhideShow() {
this.show = false
console.log('执行了')
},
onsetCity(e) { //
let data = e.detail.target.dataset;
this.address = [data.province ,data.city, data.area]
this.show = false
this.addressData.address = this.address.join('')
},
switchChange(e) {
this.setData({
checked: e.detail.value
});
}
}
};
</script>
<style lang="scss" scoped>
.save {
position: fixed;
bottom: 0;
width: 100%;
height: 120upx;
display: flex;
justify-content: center;
align-items: center;
}
.save view {
display: flex;
}
.save .btn {
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.4);
width: 70%;
height: 80upx;
border-radius: 80upx;
background-color: #f23a3a;
color: #fff;
justify-content: center;
align-items: center;
font-size: 30upx;
}
.save .btn .icon {
height: 80upx;
color: #fff;
font-size: 30upx;
justify-content: center;
align-items: center;
}
.content {
display: flex;
flex-wrap: wrap;
margin-top: 40upx;
}
.content view {
display: flex;
}
.content .row {
width: 92%;
margin: 0 4%;
border-bottom: solid 1upx #eee;
}
.content .row .nominal {
width: 30%;
height: 80upx;
font-size: 28upx;
font-family: Droid Sans Fallback;
font-weight: 400;
color: rgba(51, 51, 51, 1);
align-items: center;
}
.content .row .input {
width: 70%;
padding: 20upx 0;
align-items: center;
font-size: 28upx;
}
.content .row .input input {
font-size: 28upx;
color: #333333;
}
.content .row .switch {
justify-content: flex-end;
}
.content .row .input textarea {
min-height: 40upx;
line-height: 40upx;
}
.content .del_box {
width: 100%;
display: block;
overflow: hidden;
margin-right: 30upx;
}
.content .del {
width: 240upx;
height: 80upx;
float: right;
justify-content: center;
align-items: center;
font-size: 28upx;
color: #F23A3A;
margin: 0 auto;
margin-top: 50upx;
border-radius: 38upx;
background-color: rgba(255, 0, 0, 0.05);
border-bottom: solid 1upx #eee;
}
.selectcity input{
width: 90%;
}
.selectcity image{
width: 40upx;
height: 40upx;
float: right;
}
</style>

@ -0,0 +1,346 @@
<template>
<!-- 我的足迹 -->
<view>
<navBar :showLeft="true" navTitle="浏览历史" bgColor="#f8f8f8" textcolor="#000" :leftBg="false"></navBar>
<view class="mycollection">
<view class="cart_box">
<view v-for="(item, index) in dataList" :key="index" class="cart_list">
<view class="cover" @tap="jumpDetails(item,index)" >
<image :src="item.url" mode="aspectFill"></image>
</view>
<view class="right">
<view class="goods_name" @tap="jumpDetails(item,index)">
{{item.goodsName}}
</view>
<view class="sku">
<!-- 浏览时间2020-08-05 14:15 -->
</view>
<view class="numbers">
<view>
<text class="price" >{{item.price}}</text>
<text>/{{item.unit}}</text>
</view>
<!-- <text class="browse">
浏览15
</text> -->
</view>
</view>
</view>
<view class="daodi" v-if="dataList.length >= 5"> </view>
<nodata :colors="colors" title="暂无收藏" v-if="dataList.length == 0"></nodata>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
import navBar from '../../commponent/public/navBar.vue'
import { getGoodsHistory } from '@/utils/auth';
export default {
data() {
return {
colors: '',
dataList: getGoodsHistory(),
isShow: true
};
},
components: {
loading,
navBar
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
jumpDetails(item,index) {
//
uni.navigateTo({
url: '/pages/views/goods/goodsDetails?id=' + item.skuId
});
},
}
};
</script>
<style scoped lang="scss">
.mycollection {
padding: 10upx 4%;
}
.cart_box {
margin-top: 20upx;
padding-bottom: 100upx;
}
.cart_list {
width: 92vw;
height: calc(22vw + 34upx);
border-radius: 12upx;
box-shadow: 0px 4upx 16upx rgba(0, 0, 0, .1);
z-index: 4;
overflow: hidden;
border: 0;
display: flex;
align-items: center;
position: relative;
margin-bottom: 20upx;
}
.cart_list .checkbox-box {
padding-left: 16upx;
flex-shrink: 0;
height: 22vw;
margin-right: 16upx;
align-items: center;
position: relative;
width: 50upx;
}
.cart_list .checkbox-box .checkbox {
width: 28upx;
height: 28upx;
border-radius: 100%;
border: solid 1upx;
position: absolute;
top: 50%;
left: 20upx;
display: flex;
align-items: center;
justify-content: center;
transform: translateY(-50%);
}
.cart_list .checkbox-box .checkbox .on {
width: 20upx;
height: 20upx;
border-radius: 100%;
align-items: center;
}
.cart_list .cover {
width: 22vw;
height: 22vw;
flex-shrink: 0;
margin-left: 10upx;
border-radius: 8upx;
overflow: hidden;
margin-right: 20upx;
}
.cart_list .cover image {
width: 100%;
height: 100%;
display: block;
}
.daodi {
text-align: center;
font-size: 24upx;
color: #ccc;
margin-top: 30upx;
}
.right {
height: 22vw;
width: 100%;
/* overflow: hidden; */
display: flex;
flex-wrap: wrap;
padding-right: 15upx;
position: relative;
}
.right .goods_name {
width: 100%;
font-size: 24upx;
line-height: 34upx;
max-height: 68upx;
color: #333;
overflow: hidden;
font-weight: bold;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.sku {
font-size: 22upx;
height: 50upx;
line-height: 50upx;
color: #a7a7a7;
margin-bottom: 40upx;
}
.numbers {
position: absolute;
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
height: 50upx;
bottom: -5upx;
.browse{
font-size: 24upx;
color: #999;
margin-right: 20upx;
}
}
.numbers .price {
font-size: 30upx;
line-height: 50upx;
color: $mycolor;
}
.numbers .right_btn {
display: flex;
justify-content: center;
align-items: flex-end;
margin-right: 20upx;
}
.right_btn .sub {
width: 40upx;
height: 40upx;
font-size: 40upx;
background-color: #f3f3f3;
border-radius: 4upx;
text-align: center;
line-height: 40upx;
}
.right_btn .sub:active {
background-color: #f8f8f8;
}
.right_btn .input {
width: 50upx;
height: 50upx;
margin: 0 8upx;
background-color: #f3f3f3;
}
.right_btn .input input {
width: 50upx;
height: 50upx;
display: flex;
font-size: 22upx;
text-align: center;
align-items: center;
justify-content: center;
}
.right_btn .add {
width: 40upx;
height: 40upx;
font-size: 40upx;
background-color: #f3f3f3;
border-radius: 4upx;
text-align: center;
line-height: 40upx;
}
.right_btn .add:active {
background-color: #f8f8f8;
}
.del_mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: -21;
}
.dask_del {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .5);
z-index: -20;
display: flex;
align-items: center;
opacity: 0;
transition: all 0.3s;
}
.dask_del .del,
.cencal {
width: 100upx;
height: 100upx;
display: flex;
justify-content: center;
line-height: 100upx;
border-radius: 100%;
text-align: center;
font-size: 24upx;
background: linear-gradient(#FF5D39, #FFAF48);
color: #ffffff;
font-weight: 500;
margin: 0 auto;
}
.dask_del text:active {
opacity: 0.9;
}
.cencal {
background: linear-gradient(#FFE846, #FFCD43);
}
</style>

@ -0,0 +1,132 @@
<template>
<view class="exchange" :style="{background:colors}">
<view class="place">
</view>
<view class="ewm_box">
<view class="titles">
核销二维码
</view>
<view class="ewm_img">
<image src="../../../../static/images/ewm.png"></image>
</view>
<view class="jiefen">我的剩余积分<text :style="'color:' + colors">1120</text></view>
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
colors: ""
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
uni.setNavigationBarColor({
backgroundColor: app.globalData.newColor,
frontColor: '#ffffff'
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {}
};
</script>
<style scoped lang="scss">
.exchange{
position: fixed;
width: 100%;
height: 100%;
bottom: 0;
top: 0;
padding: 20upx 4%;
}
.place{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: linear-gradient(to bottom, rgba(255,255,255,0),rgba(255,255,255,.5));
z-index: -10;
}
.ewm_box{
width: 100%;
height: 100vw;
background-color: #fff;
margin-top: 140upx;
border-radius: 10upx;
overflow: hidden;
}
.ewm_box .titles{
height: 80upx;
line-height: 80upx;
padding: 0 30upx;
background-color: #E8E8E8;
font-size: 28upx;
font-weight: bold;
}
.ewm_img{
margin-top: 50upx;
}
.ewm_img image{
width: 400upx;
height: 400upx;
display: block;
margin: 0 auto;
}
.jiefen{
height: 100upx;
line-height: 100upx;
text-align: center;
font-size: 28upx;
margin-top: 100upx;
border-top: 1upx solid #eee;
font-weight: bold;
}
</style>

@ -0,0 +1,281 @@
<template>
<!-- 推广海报 -->
<view>
<view class="myextension">
<canvas class="mycanvas" canvas-id="mycanvas" :style="'width:' + (windowWidth-30) + 'px;height:560px'"></canvas>
<!-- #ifdef H5 -->
<block>
<image class="imgs" :style="'width:' + (windowWidth-30) + 'px;height:560px'" :src="imgUrl" mode=""></image>
</block>
<!-- #endif -->
<!-- #ifndef H5 -->
<view class="saveImg" @tap="saveImg" :style="'background:' + colors">保存海报</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<p class="tips">长按图片进行保存</p>
<!-- #endif -->
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
isShow: true,
colors: '',
windowHeight: '',
windowWidth: '',
imgUrl: ''
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
colors: app.globalData.newColor
});
this.getSystem()
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
getSystem() {
let that = this;
uni.getSystemInfo({
success: function(res) {
that.setData({
windowHeight: res.windowHeight,
windowWidth: res.windowWidth
});
that.createPoster()
}
});
},
createPoster() { //
var ctx = uni.createCanvasContext('mycanvas', this)
ctx.fillStyle = '#FFFFFF'
ctx.fillRect(0, 0, this.windowWidth - 30, 560)
//
ctx.drawImage('/static/images/user/poster.jpg', 0, 0, this.windowWidth - 30, 560)
ctx.save()
//
let avatar_width = 60; //
let avatar_height = 60; //
let avatar_x = 15; //x
let avatar_y = 15; //y
let radius = 8 //
this.setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius)
// #ifndef H5
setTimeout(() => { // h5
ctx.save();
ctx.draw()
}, 200)
// #endif
// #ifdef H5
setTimeout(() => { // h5
ctx.save();
ctx.draw(true, () => {
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: (res) => {
this.imgUrl = res.tempFilePath
}
})
})
}, 500)
// #endif
},
setRadius(ctx, avatar_width, avatar_height, avatar_x, avatar_y, radius) {
/**
* 绘制圆角
*/
ctx.arc(avatar_x + radius, avatar_y + radius, radius, Math.PI, Math.PI * 3 / 2);
ctx.lineTo(avatar_width - radius + avatar_x, avatar_y);
ctx.arc(avatar_width - radius + avatar_x, radius + avatar_y, radius, Math.PI * 3 / 2, Math.PI * 2);
ctx.lineTo(avatar_width + avatar_x, avatar_height + avatar_y - radius);
ctx.arc(avatar_width - radius + avatar_x, avatar_height - radius + avatar_y, radius, 0, Math.PI * 1 / 2);
ctx.lineTo(radius + avatar_x, avatar_height + avatar_y);
ctx.arc(radius + avatar_x, avatar_height - radius + avatar_y, radius, Math.PI * 1 / 2, Math.PI);
//
ctx.strokeStyle = "#fff";
ctx.fill() //bug
ctx.clip(); //
ctx.drawImage('/static/images/ewm.png', avatar_x, avatar_y, avatar_width, avatar_height);
ctx.closePath()
ctx.restore();
},
saveImg() {
//
uni.showLoading({
title: '保存中...'
});
let that = this;
// #ifdef MP
uni.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
uni.hideLoading();
uni.openSetting({
success(res) { //
}
});
} else {
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
console.log(res);
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(re) {
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
}
});
}, 1000);
}
}
});
// #endif
// #ifdef APP-PLUS
setTimeout(() => {
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
success: function(res) {
console.log(res);
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(re) {
uni.hideLoading();
uni.showToast({
title: '保存成功',
icon: 'success'
});
},
fail(err) {
uni.showToast({
title: '保存失败',
icon: 'none'
});
}
});
}
});
}, 1000);
// #endif
}
}
};
</script>
<style lang="scss" scoped>
.myextension {
background-color: #FFFFFF;
overflow: hidden;
padding-bottom: 100upx;
}
.myextension image {
width: 100%;
height: 100%;
display: block;
}
.saveImg {
width: 300upx;
height: 80upx;
border-radius: 40upx;
box-shadow: 0 10upx 10upx #ddd;
background-color: pink;
line-height: 80upx;
text-align: center;
color: #fff;
margin: 0 auto;
margin-top: 60upx;
}
.mycanvas {
margin: 0 auto;
transform: translateY(30upx);
border-radius: 10upx;
overflow: hidden;
}
.imgs {
position: absolute;
top: 30upx;
left: 50%;
transform: translateX(-50%);
border-radius: 10upx;
overflow: hidden;
}
.tips{
text-align: center;
color: #999;
font-size: 24upx;
margin-top: 50upx;
}
</style>

@ -0,0 +1,315 @@
<template>
<view>
<view class="myaddress">
<view v-for="(item, index) in addressList" :key="index" class="order_address">
<view class="address_box">
<view class="weizhi_icon">
<text class="iconfont icon-dizhi" :style="'color:' + colors"></text>
</view>
<view @click="onsetAddress(item)">
<view class="center">
<!-- v-if="item.isDefault == 1" -->
<view class="moren">
<text class="iconfont icon-moren" :style="'color:' + colors"></text>
</view>
<view class="name">
<text class="text1">{{item.recipient}}</text>
<text class="phones">{{item.telephone}}</text>
</view>
<view class="address_name">{{item.detail.split(',').join('')}}</view>
</view>
</view>
<view class="caozuo">
<view class="del" @tap="delAddress(item,index)">
<text class="iconfont icon-shanchu"></text>
删除
</view>
<view class="edit" @tap="editAddress(item)">
<text class="iconfont icon-bianji"></text>
编辑
</view>
</view>
</view>
</view>
<nodata :colors="colors" title="暂无收货地址" v-if="addressList.length == 0"></nodata>
</view>
<view class="save">
<view class="btn" :style="'background:' + colors" @tap="addAddress"></view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import { getAddrList, delAddr } from '@/api/index.js'
import loading from "../../commponent/public/loading";
import {
getUserInfo,
setAddress
} from '@/utils/auth.js'
export default {
data() {
return {
colors: '',
addressList: [],
isShow: true,
type:''
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let type = options.type || ''
this.setData({
colors: app.globalData.newColor,
type: type
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getAddrList()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
getAddrList() {
const s = [
{
"rule": "eq",
"type": "string",
"dictCode": "",
"val": getUserInfo().id,
"field": "userId"
}
]
const params = {
pageNo:1,
pageSize: 10,
superQueryParams: encodeURI(JSON.stringify(s)),
superQueryMatchType: 'and'
}
getAddrList(params).then(res => {
this.addressList = res.result.records
})
},
editAddress(item) {
//
uni.navigateTo({
url: '/pages/views/user/address/edit?type=edit&address=' + JSON.stringify(item)
});
},
addAddress() {
//
uni.navigateTo({
url: '/pages/views/user/address/edit?type=add'
});
},
onsetAddress(item){ //
if(this.type="select"){
setAddress(item)
uni.navigateBack(-1)
}
},
delAddress(item,index){
uni.showModal({
title:'提示',
content:'确认要删除该地址吗?',
confirmText:'删除',
confirmColor:this.colors,
success: (res) => {
if(res.confirm){
delAddr(item.id).then( res=> {
uni.showToast({
title:'删除成功~',
icon:'none'
})
this.addressList.splice(index, 1)
})
}
}
})
}
}
};
</script>
<style lang="scss" scoped>
.myaddress {
padding: 10upx 4%;
padding-bottom: 140upx;
margin-top: 10upx;
}
.order_address {
height: 180upx;
width: 100%;
background-color: #fff;
border-radius: 10upx;
position: relative;
box-shadow: 0upx 0upx 10upx #ddd;
margin-bottom: 20upx;
}
.order_address image {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
.address_box {
width: 100%;
height: 100%;
display: block;
z-index: 10;
box-sizing: border-box;
padding: 20upx;
display: flex;
align-items: center;
}
.weizhi_icon text {
font-size: 40upx;
margin-left: 10upx;
}
.address_box .center {
margin-left: 20upx;
}
.address_box .center .name {
height: 60upx;
line-height: 60upx;
}
.address_box .center .name .text1 {
font-size: 26upx;
font-weight: bold;
color: #333;
display: inline-block;
margin-right: 20upx;
}
.phones {
font-size: 24upx;
color: #999;
z-index: 0;
}
.address_box .address_name {
font-size: 26upx;
font-weight: bold;
color: #333;
}
.noaddress {
margin-left: 40upx;
font-weight: bold;
color: #333;
font-size: 26upx;
}
.caozuo {
position: absolute;
right: 20upx;
display: flex;
top: 20upx;
}
.caozuo view {
font-size: 24upx;
color: #666;
margin-left: 30upx;
}
.caozuo view text {
font-size: 24upx;
}
.moren {
position: absolute;
top: 0;
left: 0;
}
.moren text {
font-size: 60upx;
}
.save {
position: fixed;
bottom: 0;
width: 100%;
height: 120upx;
display: flex;
justify-content: center;
align-items: center;
}
.save view {
display: flex;
}
.save .btn {
box-shadow: 0upx 5upx 10upx rgba(0, 0, 0, 0.4);
width: 70%;
height: 80upx;
border-radius: 80upx;
background-color: #f23a3a;
color: #fff;
justify-content: center;
align-items: center;
font-size: 30upx;
}
</style>

@ -0,0 +1,372 @@
<template>
<view>
<navBar :showLeft="true" navTitle="我的收藏" textcolor="#000" bgColor="#f8f8f8" :leftBg="false"></navBar>
<view class="mycollection">
<view class="cart_box">
<view v-for="(item, index) in dataList" :key="index" class="cart_list" @longtap="onshowDel(item,index)" @touchend="ontouchend">
<view class="cover" @tap="jumpDetails(item,index)" >
<image :src="item.img" mode="aspectFill"></image>
</view>
<view class="right">
<view class="goods_name" @tap="jumpDetails(item,index)">
{{item.name}}
</view>
<view class="sku">
收藏于2020-08-05 14:15
</view>
<view class="numbers">
<text class="price" >
{{item.money}}
</text>
</view>
</view>
<!-- 删除的遮罩层 长按触发 -->
<view class="del_mask" v-if="current == index" :style="'z-index:' + (current == index ?'99':'-21')" @tap="oncencal">
</view>
<view class="dask_del" :style="'opacity:' + (current == index ?'1':'0') + ';z-index:' + (current == index ?'20':'-20')+';left:'+(current == index?'0':'-100%')">
<text class="del" @tap="delItem(item,index)"></text>
<text class="cencal" @tap="oncencal"></text>
</view>
</view>
<view class="daodi" v-if="dataList.length >= 5"> </view>
<nodata :colors="colors" title="暂无收藏" v-if="dataList.length == 0"></nodata>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
import navBar from '../../commponent/public/navBar.vue'
export default {
data() {
return {
colors: '',
dataList: [{
name: '钟薛高 钟意你系列 特牛乳*4片 丝绒可可*4片 半巧主义*2 冰淇淋生鲜雪糕 10片装',
img: "/static/images/goods/there.jpg",
money: '152.00',
}, {
name: '巧妈妈 鸡蛋布甸 下午茶休闲零食儿童果冻布丁125g双层果酱味smzdm 4杯鸡蛋布甸双层',
img: "/static/images/goods/four.jpg",
money: '25.80',
}, {
name: '草莓云南夏季草莓新鲜水果3斤礼盒装 露天种植现摘现发 3斤精品装4盒顺丰空运',
img: "/static/images/goods/five.jpg",
money: '59.90'
}, {
name: 'DUNKINDONUTS唐恩都乐美国甜甜圈6个礼盒装 随机搭配6款',
img: "/static/images/goods/one.jpg",
money: '35.90',
}],
current: '99999',
lock: false,
isShow: true
};
},
components: {
loading,
navBar
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
onshowDel(item,index) {
//
this.setData({
current: index,
lock: true
});
return;
},
delItem(item,index) {
//
console.log('删除成功');
},
oncencal() {
//
this.setData({
current: '99999'
});
},
ontouchend() {
if (this.lock) {
setTimeout(() => {
this.setData({
lock: false
});
}, 100);
}
},
jumpDetails(item,index) {
//
if (this.lock) {
return;
}
uni.navigateTo({
url: '/pages/views/goods/goodsDetails'
});
},
}
};
</script>
<style scoped lang="scss">
.mycollection{
padding: 10upx 4%;
}
.cart_box {
margin-top: 20upx;
padding-bottom: 100upx;
}
.cart_list {
width: 92vw;
height: calc(22vw + 34upx);
border-radius: 12upx;
box-shadow: 0px 4upx 16upx rgba(0, 0, 0, .1);
z-index: 4;
overflow: hidden;
border: 0;
display: flex;
align-items: center;
position: relative;
margin-bottom: 20upx;
}
.cart_list .checkbox-box {
padding-left: 16upx;
flex-shrink: 0;
height: 22vw;
margin-right: 16upx;
align-items: center;
position: relative;
width: 50upx;
}
.cart_list .checkbox-box .checkbox {
width: 28upx;
height: 28upx;
border-radius: 100%;
border: solid 1upx;
position: absolute;
top: 50%;
left: 20upx;
display: flex;
align-items: center;
justify-content: center;
transform: translateY(-50%);
}
.cart_list .checkbox-box .checkbox .on {
width: 20upx;
height: 20upx;
border-radius: 100%;
align-items: center;
}
.cart_list .cover {
width: 22vw;
height: 22vw;
flex-shrink: 0;
margin-left: 10upx;
border-radius: 8upx;
overflow: hidden;
margin-right: 20upx;
}
.cart_list .cover image {
width: 100%;
height: 100%;
display: block;
}
.daodi{
text-align: center;
font-size: 24upx;
color: #ccc;
margin-top: 30upx;
}
.right {
height: 22vw;
width: 100%;
display: flex;
flex-wrap: wrap;
padding-right: 15upx;
position: relative;
}
.right .goods_name{
width: 100%;
font-size: 24upx;
line-height: 34upx;
max-height: 68upx;
color: #333;
overflow: hidden;
font-weight: bold;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.sku{
font-size: 22upx;
height: 50upx;
line-height: 50upx;
color: #a7a7a7;
margin-bottom: 40upx;
}
.numbers{
position: absolute;
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: flex-end;
height: 50upx;
bottom: -5upx;
}
.numbers .price{
font-size: 30upx;
line-height: 50upx;
color: $mycolor;
}
.numbers .right_btn{
display: flex;
justify-content: center;
align-items: flex-end;
margin-right: 20upx;
}
.right_btn .sub{
width: 40upx;
height: 40upx;
font-size: 40upx;
background-color: #f3f3f3;
border-radius: 4upx;
text-align: center;
line-height: 40upx;
}
.right_btn .sub:active{
background-color: #f8f8f8;
}
.right_btn .input{
width: 50upx;
height: 50upx;
margin: 0 8upx;
background-color: #f3f3f3;
}
.right_btn .input input{
width: 50upx;
height: 50upx;
display: flex;
font-size: 22upx;
text-align: center;
align-items: center;
justify-content: center;
}
.right_btn .add{
width: 40upx;
height: 40upx;
font-size: 40upx;
background-color: #f3f3f3;
border-radius: 4upx;
text-align: center;
line-height: 40upx;
}
.right_btn .add:active{
background-color: #f8f8f8;
}
.del_mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: -21;
}
.dask_del{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .5);
z-index: -20;
display: flex;
align-items: center;
opacity: 0;
transition: all 0.3s;
}
.dask_del .del , .cencal{
width: 100upx;
height: 100upx;
display: flex;
justify-content: center;
line-height: 100upx;
border-radius: 100%;
text-align: center;
font-size: 24upx;
background: linear-gradient(#FF5D39,#FFAF48);
color: #ffffff;
font-weight: 500;
margin: 0 auto;
}
.dask_del text:active{
opacity: 0.9;
}
.cencal{
background: linear-gradient(#FFE846, #FFCD43);
}
</style>

@ -0,0 +1,210 @@
<template>
<view>
<view v-for="(item, index) in couponList" :key="index" class="coupon_box">
<view class="left">
<view class="left_top">
<text class="hui" :style="'background:' + colors"></text>
<text class="hui_name">{{item.name}}</text>
</view>
<view class="left_bottom">
<text>有效日期{{item.dates}}</text>
</view>
</view>
<image src="/static/images/user/ysy.png" class="ysy" v-if="item.status == 1"></image>
<view class="right" :style="'background:' + (item.status == 0 ? colors:'')">
<view class="money">{{item.sub}}</view>
<text>{{item.money}}可用</text>
<text class="shiyong" v-if="item.status == 0" @click="jumpNext(item)">使</text>
</view>
</view>
<nodata :colors="colors" title="暂无优惠券" v-if="couponList.length == 0"></nodata>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
colors: '',
couponList: [{
name: '满100减10',
dates: '2020-02-09 2020-03-02',
status: 0,
money: 100,
sub: 10
}, {
name: '满100减10',
dates: '2020-02-09 2020-03-02',
status: 1,
money: 100,
sub: 10
}],
isShow: true
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
jumpNext(){
uni.showToast({
title:'根据需求进行跳转~',
icon:'none'
})
}
}
};
</script>
<style lang="scss" scoped>
.coupon_box{
margin: 20upx;
box-shadow: 0upx 0upx 10upx #ddd;
position: relative;
border-radius: 10upx;
overflow: hidden;
}
.coupon_box .left{
width: 70%;
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 20upx;
float: left;
}
.coupon_box .left .hui{
width: 40upx;
height: 40upx;
font-size: 20upx;
color: #fff;
background-color: #EC1818;
border-radius: 8upx;
line-height: 40upx;
text-align: center;
display: inline-block;
transform: translateY(-5upx);
}
.coupon_box .left .left_top{
width: 60vw;
display: block;
font-size: 26upx;
font-weight: bold;
}
.left_top .hui_name{
line-height: 60upx;
height: 60upx;
margin-left: 20upx;
display: inline-block;
}
.left_bottom{
font-size: 24upx;
font-weight: bold;
color: #333;
height: 60upx;
line-height: 60upx;
}
.coupon_box .right{
text-align: center;
height: 160upx;
width: 180upx;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-content: center;
background-color: #A8A8A8;
float: right;
}
.coupon_box .right .shiyong{
height: 40upx;
line-height: 40upx;
background-color: #fff;
border-radius: 20upx;
padding: 0 20upx;
color: #A8A8A8;
}
.coupon_box .right .money{
font-size: 45upx;
color: #fff;
}
.coupon_box .right text{
font-size: 24upx;
color: #fff;
height: 40upx;
line-height: 34upx;
}
.coupon_box .bottom{
height: 60upx;
line-height: 60upx;
display: flex;
align-content: flex-start;
font-size: 24upx;
margin-top: 10upx;
}
.coupon_box .bottom view{
margin-right: 20upx;
color: #888;
font-weight: bold;
}
.ysy{
width: 80upx;
height: 80upx;
position: absolute;
top: 20upx;
right: 200upx;
}
</style>

@ -0,0 +1,183 @@
<template>
<view>
<view class="distribution">
<view class="userinfo" :style="'background:' + colors">
<image :src="userinfo.avatarUrl" v-if="userinfo.avatarUrl"></image>
<image src="../../../static/images/face.jpg" v-else></image>
<view class="user_name">
<view class="p1">{{userinfo.nickName || '张三'}}</view>
<view class="p2">推荐人李四</view>
</view>
</view>
<view class="top_box" :style="'background:' + colors">
<view class="left">
<view class="p1">总积分</view>
<view class="p2">1273</view>
</view>
<view class="right">
<view @tap="onexchange">
兑换礼品
</view>
</view>
</view>
<view class="myfunction">
<my-server :serverList="serverList" :colors="colors" titles="常用功能" icons="icon-icon_type"></my-server>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import myServer from "../../commponent/user/my-server";
import loading from "../../commponent/public/loading";
import {getUserInfo} from '../../../utils/auth.js'
export default {
data() {
return {
colors: '',
serverList: [{
name: '我的下级',
icon: 'icon-fenxiao',
url: '/pages/views/user/mysubordinate'
}, {
name: '推广分享',
icon: 'icon-fenxiang1',
url: '/pages/views/user/extension'
}],
isShow: true,
userinfo: getUserInfo() || {}
};
},
components: {
myServer,
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
uni.setNavigationBarColor({
backgroundColor: app.globalData.newColor,
frontColor: '#ffffff'
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
onexchange() {
uni.navigateTo({
url: '/pages/views/user/exchange/exchange'
});
}
}
};
</script>
<style lang="scss" scoped>
.userinfo{
display: flex;
justify-content: flex-start;
padding: 20upx 4%;
border-bottom: 1upx solid rgba(208, 205, 205, 0.5);
}
.userinfo image{
width: 120upx;
height: 120upx;
display: block;
border-radius: 50%;
margin-right: 20upx;
}
.userinfo .user_name .p1{
height: 60upx;
line-height: 60upx;
color: #fff;
font-weight: bold;
font-size: 28upx;
}
.userinfo .user_name .p2{
font-weight: bold;
color: #fff;
font-size: 24upx;
}
.top_box{
width: 100vw;
height: 28vw;
display: flex;
justify-content: space-between;
padding: 0 4%;
align-items: center;
}
.top_box .left .p1{
font-size: 26upx;
color: #fff;
line-height: 60upx;
}
.top_box .left .p2{
font-size: 36upx;
color: #fff;
line-height: 80upx;
}
.top_box .right{
display: flex;
}
.top_box .right view{
padding:8upx 20upx;
font-size: 24upx;
color: #fff;
border: 1upx solid #fff;
border-radius: 40upx;
margin-top: 60upx;
}
.myfunction{
margin: 0 4%;
margin-top: 30upx;
box-shadow: 0upx 0upx 10upx #ddd;
border-radius: 10upx;
}
</style>

@ -0,0 +1,225 @@
<template>
<view>
<view class="mypoints">
<view class="top_box" :style="'background:' + colors">
<view class="left">
<view class="p1">总积分</view>
<view class="p2">1273</view>
</view>
<view class="right">
<view @tap="onexchange">
兑换礼品
</view>
</view>
</view>
<view class="jilu">
<view class="jilu_title">
<view class="place" :style="'background:' + colors"></view>
<view class="texts">消费记录</view>
</view>
<view class="jilu_box">
<view v-for="(item, index) in logList" :key="index" class="jilu_list">
<view class="list_left">
<text style="color:#333">{{item.name}}</text>
<text style="color: #999;font-size:24upx">2020-08-025 1952</text>
</view>
<view class="list_right" style="font-size:30upx; color: #10D3EA" v-if="item.type == 0">+{{item.number}}</view>
<view class="list_right" style="font-size:30upx; color: #EC1818" v-if="item.type == 1">-{{item.number}}</view>
</view>
<view class="daodi" v-if="logList.length >= 5"> </view>
<nodata :colors="colors" title="暂无消费记录" v-if="logList.length == 0"></nodata>
</view>
</view>
</view>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
logList: [{
name: '购买商品',
type: 0,
number: 18
}, {
name: '兑换商品',
type: 1,
number: 18
}, {
name: '兑换商品',
type: 1,
number: 18
}, {
name: '兑换商品',
type: 1,
number: 18
}, {
name: '兑换商品',
type: 1,
number: 18
}, {
name: '兑换商品',
type: 1,
number: 18
}],
isShow: true,
colors: ""
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
uni.setNavigationBarColor({
backgroundColor: app.globalData.newColor,
frontColor: '#ffffff'
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
onexchange() {
uni.navigateTo({
url: '/pages/views/user/exchange/exchange'
});
}
}
};
</script>
<style lang="scss" scoped>
.mypoints{
padding-bottom: 20upx;
}
.top_box{
width: 100vw;
height: 28vw;
display: flex;
justify-content: space-between;
padding: 0 4%;
align-items: center;
}
.top_box .left .p1{
font-size: 26upx;
color: #fff;
line-height: 60upx;
}
.top_box .left .p2{
font-size: 36upx;
color: #fff;
line-height: 80upx;
}
.top_box .right{
display: flex;
}
.top_box .right view{
height: 60upx;
line-height: 60upx;
padding:0 20upx;
color: #fff;
border: 1upx solid #fff;
border-radius: 40upx;
margin-top: 60upx;
}
.jilu{
margin: 0 4%;
padding: 20upx;
box-shadow: 0upx 0upx 10upx #aaa;
border-radius: 10upx;
margin-top: 20upx;
}
.jilu_title{
display: flex;
height: 80upx;
line-height: 80upx;
align-items: center;
border-bottom: 1upx solid #eee;
}
.jilu_title .place{
width: 10upx;
height: 50upx;
background-color: #3E7E8B;
margin-right: 20upx;
border-radius: 15upx;
}
.jilu_title .texts{
font-size: 30upx;
color: #333;
font-weight: 500;
}
.jilu_box{
min-height: 220upx;
padding-bottom: 20upx;
}
.jilu_box .jilu_list{
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 20upx 0;
border-bottom: 1upx solid #eee;
}
.jilu_list text{
display: block;
height: 50upx;
line-height: 50upx;
}
.daodi{
text-align: center;
color: #ccc;
font-size: 24upx;
margin-top: 20upx;
}
</style>

@ -0,0 +1,127 @@
<template>
<view>
<!-- 我的下级 -->
<view class="mysubordinate">
<view class="mysubordinate_list" v-for="(item, index) in subordinateList" :key="index">
<image :src="item.headimg"></image>
<view class="center">
<view class="name">{{item.name}}</view>
<view class="times">{{item.date}}</view>
</view>
</view>
<view class="nodata"> 到底啦 </view>
</view>
<nodata v-if="subordinateList.length == 0" :colors="colors" title="暂无下级"></nodata>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
var app = getApp();
import loading from "../../commponent/public/loading";
export default {
data() {
return {
isShow: true,
colors: '',
subordinateList:[
{name:'清风', date:'2019-01-19 1829',headimg:'https://sf3-ttcdn-tos.pstatp.com/img/user-avatar/18dd30f2613eca73ec247619c0da776c~120x256.image'},
{name:'良辰美景奈何天', date:'2019-02-19 1829',headimg:'https://sf3-ttcdn-tos.pstatp.com/img/mosaic-legacy/3796/2975850990~120x256.image'},
{name:'流光忆暖', date:'2019-03-19 1829',headimg:'https://sf1-ttcdn-tos.pstatp.com/img/user-avatar/413f21c22ea3b361678a6c6a734b2853~120x256.image'},
]
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {}
};
</script>
<style scoped lang="scss">
.mysubordinate{
margin-top: 10upx;
}
.mysubordinate_list{
padding: 30upx 4%;
background-color: #fff;
display: flex;
align-items: center;
border-bottom: 1upx solid #eee;
}
.mysubordinate_list image{
width: 100upx;
height: 100upx;
border-radius: 50%;
margin-right: 20upx;
}
.mysubordinate_list .name{
height: 60upx;
line-height: 60upx;
font-size: 28upx;
font-weight: bold;
color: #333;
}
.mysubordinate_list .times{
color: #999;
font-size: 24upx;
}
.nodata{
color: #ccc;
text-align: center;
font-size: 24upx;
margin-top: 20upx;
margin-bottom: 20upx;
}
</style>

@ -0,0 +1,202 @@
<template>
<view class="withdrawal">
<view class="withdrawl_top">
<image src="/static/images/user/qb.png"></image>
<view class="money">56.00</view>
<view class="tips">(我的账户余额)</view>
</view>
<view class="minmoney">
当前最小提现金额为150元
</view>
<view class="t_input">
<view class="title">提现金额</view>
<view class="inputs">
<input placeholder="请输入提现金额" placeholder-style="font-size: 28upx; color: #999"></input>
</view>
<view class="all_btn" :style="'color:' + colors">全部提现</view>
</view>
<view class="jilu" @tap="jumprecord">
查看提现记录>>
</view>
<view class="addclerk" :style="'background:' + colors" @tap="openEwm">
确认提现
</view>
</view>
</template>
<script>
var app = getApp();
export default {
data() {
return {
colors: ''
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
colors: app.globalData.newColor
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {
jumprecord() {
uni.navigateTo({
url: '/pages/views/withdrawal/withdrawalrecord'
});
}
}
};
</script>
<style lang="scss" scoped>
page {
background-color: #F5F5FA;
}
.withdrawl_top {
height: 408upx;
width: 100%;
background: rgba(255, 255, 255, 1);
overflow: hidden;
}
.withdrawl_top image {
width: 220upx;
height: 190upx;
display: block;
margin: 0 auto;
margin-top: 60upx;
}
.withdrawl_top .money {
text-align: center;
height: 60upx;
line-height: 60upx;
font-size: 50upx;
color: #FF4643;
margin-top: 20upx;
}
.withdrawl_top .tips {
text-align: center;
font-size: 24upx;
color: #7C7C7C;
line-height: 50upx;
}
.minmoney {
padding: 0 4%;
height: 80upx;
line-height: 80upx;
font-size: 26upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: rgba(124, 124, 124, 1);
opacity: 0.6;
}
.t_input{
padding: 20upx 4%;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.t_input .title{
height: 80upx;
line-height: 80upx;
color: #333;
font-weight: bold;
width: 200upx;
}
.t_input .inputs{
color: #333;
font-size: 32upx;
}
.inputs input{
height: 80upx;
line-height: 80upx;
width: 100%;
display: block;
}
.all_btn{
font-size:24upx;
font-family:Source Han Sans CN;
font-weight:400;
width: 150upx;
}
.jilu{
height: 60upx;
line-height: 60upx;
padding: 0 4%;
font-size:24upx;
color: #999;
font-family:Source Han Sans CN;
font-weight:400;
margin-top: 10upx;
}
.addclerk {
width: 80%;
height: 82upx;
line-height: 82upx;
border-radius: 15upx;
font-size: 32upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: rgba(255, 255, 255, 1);
text-align: center;
position: fixed;
bottom: 30upx;
left: 50%;
transform: translateX(-50%);
background-color: pink;
}
.addclerk:active{
opacity: 0.8;
}
</style>
<style>
page {
background-color: #F5F5FA;
}
</style>

@ -0,0 +1,125 @@
<template>
<view>
<view class="withdrawalrecord">
<view v-for="(item, index) in logList" :key="index" class="record_list">
<view class="left">
<view class="title">余额提现</view>
<view class="time">2019-01-02 19:12:09</view>
</view>
<view class="right">
-8000
</view>
</view>
<view class="nodata" v-if="logList.length >= 6"> </view>
</view>
<nodata :colors="colors" title="暂无明细" v-if="logList.length == 0"></nodata>
<loading v-if="isShow == true"></loading>
</view>
</template>
<script>
import loading from "../../commponent/public/loading";
export default {
data() {
return {
logList: [1, 2, 3, 4, 5],
isShow: true
};
},
components: {
loading
},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
setTimeout(() => {
this.setData({
isShow: false
});
}, 600);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
methods: {}
};
</script>
<style scoped lang="scss">
page {
background-color: #F7F4F8;
}
.withdrawalrecord{
margin-top: 10upx;
}
.record_list {
padding: 30upx 4%;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1upx solid #eee;
}
.record_list .title {
font-size: 28upx;
font-weight: bold;
color: #333;
line-height: 60upx;
height: 60upx;
}
.record_list .time {
font-size: 24upx;
color: #7C7C7C;
}
.record_list .right {
font-size: 36upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #FF4643;
}
.nodata{
color: #ccc;
text-align: center;
font-size: 24upx;
margin-top: 20upx;
margin-bottom: 20upx;
}
</style>

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save