Commit 79e4eec5 by wangjian

添加

parent e1ee1876
......@@ -133,14 +133,7 @@ export function tokenDiffTIme (tokenStr) {
// 重新获取token 并记录
export function refreshToken (token) {
post('/user/refresh/token', {'token':token,'resetToken':'not'}).then((res) => {
if (res.code == 200) {
let dataRes = res.data
let token = dataRes.token
tokenSave(token)
}
}).catch((e) => {
})
}
export function uploadImage (image, name, type) {
......
<template>
<view class="content">
<view class="alert">
<view class="text local-title">
{{text}}
</view>
<view class="only-certain-btn" @click="$emit('clickCertain')">确定</view>
</view>
</view>
</template>
<script>
export default {
name:"Alert",
data() {
return {
};
},
props: {
alertOneLine:{
type:Boolean,
default:true
},
text:{
type:String,
default:''
},
showButtonNum:{
type:Number,
default:1
}
}
}
</script>
<style lang="scss" scoped>
.content {
position: fixed;
z-index: 9999999;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
background-color: rgba($color: #000000, $alpha: 0.6);
.alert {
margin: auto;
margin-top: 70%;
width: 600rpx;
background-color: #FFFFFF;
border-radius: 24rpx;
opacity: 1;
padding-bottom: 48rpx;
.title {
padding: 48rpx 48rpx 64rpx;
text-align: center;
font-size: 28rpx;
color: #686868;
line-height: 50rpx;
width: 504rpx;
}
.local-title {
padding: 78rpx 40rpx;
color: #252525;
font-size: 32rpx;
text-align: center;
line-height: 48rpx;
}
.only-certain-btn {
margin: 0 60rpx;
border-radius: 40rpx;
height: 80rpx;
width: 480rpx;
background-color: #FF0520;
color: #FFFFFF;
line-height: 82rpx;
font-size: 32rpx;
text-align: center;
}
.bottom-two-btn {
display: flex;
padding: 0 40rpx;
justify-content: space-between;
align-items: center;
.left {
height: 76rpx;
width: 240rpx;
border-radius: 40rpx;
border: 2rpx solid #C9C9C9;
font-size: 32rpx;
color: #848689;
line-height: 78rpx;
text-align: center;
}
.right {
height: 80rpx;
width: 240rpx;
border-radius: 40rpx;
background-color: #FF0520;
font-size: 32rpx;
color: #FFFFFF;
line-height: 82rpx;
text-align: center;
}
}
}
}
</style>
<template>
<view class="container">
<view class="content">
<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
<view class="top">
<image class="img" :src="selectImg" mode=""></image>
<view class="integral">{{selectSkuIntegral}}</view>
</view>
<view class="attr">
<view class="title">{{goodsData.specsName || '1111'}}</view>
<view class="item-content">
<view @click="clickItem(item)" class="item" :class="selectSkuNo===item.skuNo?'active':''" v-for="(item, index) in goodsData.skuList" :key="index">
{{item.skuName}}
</view>
</view>
</view>
<view class="info">
<view class="left">购买数量:</view>
<view class="buy-button">
<image v-if="goodsNum===1" class="reduce" src="../../static/reduce.png" mode="" @click="reduce()"></image>
<image v-else class="reduce" src="../../static/reduce-h.png" mode="" @click="reduce()"></image>
<view class="goods-num">{{goodsNum}}</view>
<image class="plus" src="../../static/add.png" mode="" @click="add()"></image>
</view>
</view>
<view class="info pay-integral">
<view class="left">支付积分:</view>
<view class="pay-integral-right">{{payIntegral}}积分</view>
</view>
<view class="buy-bottom" @click="buyGoods()">
确定
</view>
</view>
</view>
</template>
<script>
export default {
name:"goodsSelect",
data() {
return {
selectItem: {},
selectSkuNo: '',
selectSkuIntegral: '',
selectImg: '',
goodsNum: 1,
goodsData: {}
};
},
props: {
goods: {
type: Object
},
closeName: {
type: String
}
},
watch: {
goods(newVal, oldVal) {
this.goodsData = newVal
this.selectItem = newVal.skuDetail
this.selectItem.coverImg = newVal.skuDetail.spuImg
this.selectSkuNo = newVal.skuDetail.skuNo
this.selectSkuIntegral = newVal.skuDetail.sellingPrice
this.selectImg = newVal.skuDetail.spuImg
}
},
computed: {
payIntegral() {
return this.$numUtils.numMulti(this.selectSkuIntegral, this.goodsNum)
}
},
methods: {
clickItem(item) {
this.selectItem = item
this.goodsNum = 1
this.selectSkuNo = item.skuNo
this.selectSkuIntegral = item.sellingPrice
this.selectImg = item.coverImg
},
add() {
if (this.payIntegral > Number(this.$store.state.userInfo.surplusIntegral)) {
this.toast('积分不够')
return
}
this.goodsNum++
},
reduce() {
if (this.goodsNum === 1) {
return
}
this.goodsNum--
},
close() {
this.$parent[this.closeName] = false
},
buyGoods() {
this.$emit('certain', {'goodsNum': this.goodsNum, 'goods': this.selectItem})
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
border-radius: 24rpx 24rpx 0 0;
background-color: #FFFFFF;
padding: 32rpx;
position: fixed;
bottom: 0;
.top {
display: flex;
height: 192rpx;
border-bottom: 2rpx solid #F5F5F5;
.img {
display: block;
height: 160rpx;
width: 160rpx;
border-radius: 16rpx;
}
.integral {
margin-top: 110rpx;
line-height: 50rpx;
color: #FF0520;
font-size: 36rpx;
font-weight: bolder;
margin-left: 20rpx;
}
}
.close {
position: absolute;
top: 24rpx;
right: 24rpx;
height: 36rpx;
width: 36rpx;
}
.attr {
padding: 32rpx 0;
border-bottom: 2rpx solid #F5F5F5;
.title {
font-size: 28rpx;
color: #333333;
}
.item-content {
display: flex;
width: 100%;
flex-flow: wrap;
.item {
padding: 12rpx 62rpx;
color: #666666;
background-color: #F5F5F5;
margin-top: 28rpx;
border-radius: 8rpx;
margin-right: 44rpx;
max-width: 686rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 28rpx;
}
.active {
color: #FF0520;
background-color: #FFF7F8;
border: 2rpx solid #FF0520;
}
}
}
.info {
display: flex;
justify-content: space-between;
margin-top: 32rpx;
.left {
font-size: 28rpx;
color: #333333;
}
.buy-button {
position: relative;
display: flex;
width: 160rpx;
height: 40rpx;
font-size: 28rpx;
align-items: center;
.reduce {
width: 40rpx;
height: 40rpx;
}
.goods-num {
width: 78rpx;
text-align: center;
color: #333333;
}
.plus {
position: absolute;
top: 0;
left: 118rpx;
width: 40rpx;
height: 40rpx;
}
}
}
.pay-integral {
margin-top: 40rpx;
.pay-integral-right {
font-size: 28rpx;
color: #FF0520;
}
}
.buy-bottom {
margin-top: 96rpx;
border-radius: 40rpx;
height: 80rpx;
width: 686rpx;
background-color: #FF0520;
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
</style>
<template>
<view class="previewImg">
<view class="mask">
<swiper class="my_swiper" @change="swiperChange" :autoplay="false">
<swiper-item @click="dissmiss" v-for="(x, y) in picList" :key="y"><view class="bg_img" :style="{ backgroundImage: 'url(' + x + ')' }"></view></swiper-item>
</swiper>
</view>
<view class="page" v-if="picList.length > 0">{{ currentPosition }} / {{ picList.length }}</view>
</view>
</template>
<script>
export default {
name: 'previewImages',
props:{
current:{
type:Number,
default:0
},
indicatorDots:{ //是否展示推荐菜单
type: Boolean,
default: true
},
picList: { //图片列表
type: Array,
default () {
return []
}
},
},
data() {
return {
currentPosition: this.current,
circular: true,
isShowSwiper: false
};
},
mounted() {
console.log(this.picList)
},
methods: {
swiperChange(e) {
this.currentPosition = e.detail.current + 1
},
dissmiss() {
console.log('dissmiss')
this.$parent.dissmissPreviewImages()
}
}
};
</script>
<style lang="scss" scoped>
.page {
position: fixed;
z-index: 6;
color: #fff;
bottom: 20rpx;
text-align: center;
width: 100%;
}
.mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
z-index: 5;
> .my_swiper {
width: 100%;
height: 60vh;
.bg_img {
background-size: 100% auto;
background-repeat: no-repeat;
background-position:center;
width: 100%;
height: 100%;
}
}
}
.pic_list {
display: flex;
flex-flow: row wrap;
> view {
flex: 0 0 33.3vw;
height: 33.3vw;
padding: 1vw;
> image {
width: 100%;
height: 100%;
}
}
}
</style>
<template>
<view class="container">
<view class="content">
<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
<view class="title">请输入支付密码</view>
<view class="subTitle">您即将支付</view>
<view class="integral">{{integral}}<text>积分</text></view>
<validCode :maxlength="6" :isPwd="true" @finish="getPwd" @inputChange="inputChange"></validCode>
<view @click="submit()" class="buy-bottom" :style="{'background-color':btnActive?'#FF0520':''}">确认支付</view>
</view>
</view>
</template>
<script>
import validCode from '../validCode/validCode'
export default {
name:"setPwdAlert",
components: {validCode},
data() {
return {
pwd: '',
};
},
computed: {
btnActive() {
return this.pwd.length === 6
}
},
props: {
closeName: {
type: String
},
integral: {
type:String
}
},
methods: {
getPwd(e) {
this.pwd = e
},
inputChange(e) {
this.pwd = e
},
submit() {
if (!this.btnActive) {
return
}
this.$emit('pwdSubmit', this.pwd)
},
close() {
this.$parent[this.closeName] = false
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
margin: 50% 55rpx;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 48rpx 40rpx;
// width: 640rpx;
position: relative;
.close {
position: absolute;
top: 24rpx;
right: 24rpx;
height: 36rpx;
width: 36rpx;
}
.title {
font-size: 32rpx;
font-weight: bolder;
color: #333333;
line-height: 44rpx;
text-align: center;
}
.subTitle {
margin-top: 24rpx;
font-size: 32rpx;
color: #666666;
line-height: 44rpx;
text-align: center;
}
.integral {
margin-top: 32rpx;
margin-bottom: 48rpx;
font-size: 60rpx;
color: #FF0520;
font-weight: bolder;
text-align: center;
text {
font-size: 40rpx;
}
}
.buy-bottom {
margin-top: 96rpx;
border-radius: 40rpx;
height: 80rpx;
width: 560rpx;
background-color: rgba($color: #FF0520, $alpha: 0.5);
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
</style>
<template>
<view class="container">
<view class="content">
<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
<view class="title">设置支付密码</view>
<view class="subTitle">为保障您的积分安全,请先设置支付密码</view>
<view class="item first-item">
<view>设置支付密码:</view>
<view class="input-content">
<input class="input" :password="!firstOpen" :value="firstPwd" placeholder="请输入6位数字密码" placeholder-style="color:#999999" />
<image class="eye" @click="clickEye(1)" :src="firstOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image>
</view>
</view>
<view class="item">
<view>确认支付密码:</view>
<view class="input-content">
<input class="input" :password="!secondOpen" :value="secondPwd" placeholder="再次输入密码" placeholder-style="color:#999999" />
<image class="eye" @click="clickEye(2)" :src="secondOpen?'../../static/eye-open.png':'../../static/eye-off.png'" mode=""></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"setPwdAlert",
data() {
return {
firstPwd: '',
secondPwd: '',
firstOpen: false,
secondOpen: false
};
},
props: {
closeName: {
type: String
}
},
methods: {
clickEye(index) {
if (index === 1) {
this.firstOpen = !this.firstOpen
} else {
this.secondOpen = !this.secondOpen
}
},
submit() {
if (this.firstPwd.length<6) {
this.toast('请输入6位数密码')
return
}
if (this.firstPwd !== this.secondPwd) {
this.toast('两次输入密码不一致')
return
}
this.$net.post('/staff/password/setting', {'from': 'order', 'pwd': this.firstPwd}).then(res => {
if (res.code === 200) {
this.getUserInfo()
} else {
this.toast(res.message)
}
})
},
close() {
this.$parent[this.closeName] = false
},
getUserInfo() {
this.$net.get('/staff/detail').then(res => {
if (res.code === 200) {
this.$store.commit('refreshUserInfo', this.userInfo)
this.toast('设置密码成功')
this.close()
} else {
this.toast(res.message)
}
})
}
},
watch: {
firstOpen(newVal, oldVal) {
console.log(newVal);
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
margin: 50% auto;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 48rpx 40rpx;
width: 640rpx;
position: relative;
.close {
position: absolute;
top: 24rpx;
right: 24rpx;
height: 36rpx;
width: 36rpx;
}
.title {
font-size: 32rpx;
font-weight: bolder;
color: #333333;
line-height: 44rpx;
text-align: center;
}
.subTitle {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
line-height: 34rpx;
text-align: center;
}
.first-item {
margin-top: 48rpx;
}
.item {
margin-top: 40rpx;
font-size: 28rpx;
color: #333333;
.input-content {
padding-left: 16rpx;
margin-top: 24rpx;
height: 80rpx;
width: 100%;
border-radius: 8rpx;
background-color: #F8F8F8;
position: relative;
.input {
height: 100%;
width: 100%;
}
.eye {
position: absolute;
top: 16rpx;
right: 16rpx;
height: 48rpx;
width: 48rpx;
z-index: 9999;
}
}
}
.buy-bottom {
margin-top: 96rpx;
border-radius: 40rpx;
height: 80rpx;
width: 686rpx;
background-color: #FF0520;
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
</style>
<template>
<view class="container">
<view class="content">
<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
<view class="title">短信验证</view>
<view class="subTitle">已向<text>{{getPhone}}</text>手机号发送了一条验证短信,请将验证码填写进输入框中。</view>
<view class="code-content">
<validCode :maxlength="4" @finish="getPwd" @inputChange="inputChange"></validCode>
</view>
<view @click="submit()" class="buy-bottom" :style="{'background-color':btnActive?'#FF0520':''}">确认支付</view>
</view>
</view>
</template>
<script>
import validCode from '../validCode/validCode'
export default {
name:"setPwdAlert",
components: {validCode},
data() {
return {
phone: this.$store.state.userInfo.mobile,
code: ''
};
},
props: {
closeName: {
type: String
}
},
computed: {
getPhone() {
let middle = this.phone.substr(3, 4)
return this.phone.replace(middle,'****');
},
btnActive() {
return this.code.length === 4
}
},
methods: {
getPwd(e) {
this.code = e
},
inputChange(e) {
this.code = e
},
submit() {
if (!this.btnActive) {
return
}
this.$emit('smsCodeSubmit', this.code)
},
close() {
this.$parent[this.closeName] = false
}
},
watch: {
firstOpen(newVal, oldVal) {
console.log(newVal);
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: 0.7);
z-index: 99999;
.content {
margin: 50% 55rpx;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 48rpx 40rpx;
// width: 640rpx;
position: relative;
.close {
position: absolute;
top: 24rpx;
right: 24rpx;
height: 36rpx;
width: 36rpx;
}
.title {
font-size: 32rpx;
font-weight: bolder;
color: #333333;
line-height: 44rpx;
text-align: center;
}
.subTitle {
margin-top: 24rpx;
font-size: 32rpx;
color: #666666;
line-height: 48rpx;
text-align: center;
text {
color: #338AFF;
}
}
.code-content {
margin-top: 48rpx;
padding: 0 60rpx;
}
.buy-bottom {
margin-top: 64rpx;
border-radius: 40rpx;
height: 80rpx;
width: 560rpx;
background-color: rgba($color: #FF0520, $alpha: 0.5);
line-height: 82rpx;
text-align: center;
color: #FFFFFF;
font-size: 32rpx;
z-index: 99999;
margin-bottom: 32rpx;
}
}
}
</style>
<!--
自定义验证码输入、密码输入使用
使用方法:
maxlength:输入最大长度
isPwd:是否是密码模式
@finish:回调函数
<validcode :maxlength="4" :isPwd="false" @finish="finish"></validcode>
-->
<template>
<view class="code-area">
<view class="flex-box">
<input
:value="val"
type="number"
focus="true"
:maxlength="maxlength"
class="hide-input"
@input="getVal"
/>
<view v-bind:class="['item', { active: codeIndex == 1, 'code-item': !isPwd}]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 1">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[0] ? codeArr[0] : ''}}</block>
</view>
<view v-bind:class="['item', { active: codeIndex == 2, 'code-item': !isPwd }]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 2">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[1] ? codeArr[1] : ''}}</block>
</view>
<view v-bind:class="['item', { active: codeIndex == 3, 'code-item': !isPwd }]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 3">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[2] ? codeArr[2] : ''}}</block>
</view>
<view v-bind:class="['item', { active: codeIndex == 4, 'code-item': !isPwd }]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 4">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[3] ? codeArr[3] : ''}}</block>
</view>
<block v-if="maxlength === 6">
<view v-bind:class="['item', { active: codeIndex == 5 }]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 5">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[4] ? codeArr[4] : ''}}</block>
</view>
<view v-bind:class="['item', { active: codeIndex == 6 }]">
<view class="line"></view>
<block v-if="isPwd && codeArr.length >= 6">
<text class="dot">.</text>
</block>
<block v-else> {{ codeArr[5] ? codeArr[5] : ''}}</block>
</view>
</block>
</view>
</view>
</template>
<script>
export default {
props: {
//最大长度 值为4或者6
maxlength: {
type: Number,
default: 4
},
//是否是密码
isPwd: {
type: Boolean,
default: false
}
},
data() {
return {
codeIndex: 1, //下标
codeArr: [],
val:'',//输入框的值
};
},
methods: {
//取值
getVal(e) {
let { value } = e.detail;
this.val=value;
// console.log('验证码:', value);
let arr = value.split('');
this.codeIndex = arr.length + 1;
this.codeArr = arr;
// console.log(this.codeIndex, this.pwdArr);
if (this.codeIndex > Number(this.maxlength)) {
//输入完成
this.$emit('finish',this.codeArr.join(''));
}
this.$emit('inputChange',value);
},
//清除验证码或者密码
clear(){
this.codeIndex=1;
this.codeArr=[];
this.val="";
}
}
};
</script>
<style lang="scss" scoped>
.code-area {
text-align: center;
.flex-box {
display: flex;
flex-wrap: wrap;
position: relative;
justify-content: space-between;
}
.item {
position: relative;
width: 80upx;
height: 112upx;
// margin-right: 16upx;
font-size: 64upx;
font-weight: bold;
color: #333333;
box-sizing: border-box;
border: 2upx solid #C9C9C9;
border-radius: 8rpx;
}
.code-item {
line-height: 114rpx;
}
.item:last-child {
margin-right: 0;
}
.active {
// border-color: #ff4b4b;
}
.active .line {
display: block;
}
.line {
display: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 2upx;
height: 40upx;
background: #ff4b4b;
animation: twinkling 1s infinite ease;
}
.hide-input {
position: absolute;
top: 0;
left: -100%;
width: 200%;
height: 100%;
text-align: left;
z-index: 9;
opacity: 1;
}
@keyframes twinkling {
0% {
opacity: 0.2;
}
50% {
opacity: 0.5;
}
100% {
opacity: 0.2;
}
}
.dot{
font-size: 80upx;
line-height: 40upx;
}
}
</style>
......@@ -57,6 +57,24 @@
}
}
,{
"path" : "goods/goods",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "submitOrder/submitOrder",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}],
"preloadRule":{
......
......@@ -6,7 +6,7 @@
<view class="nav-bar" :style="{ height: height + 'px', 'padding-top': statusBarHeight + 'px' }"><text class="person-center">我的</text></view>
<view class="user-info">
<view class="top">
<image class="avator" :src="userInfo.avatar" mode=""></image>
<image @click="getImg()" class="avator" :src="userInfo.avatar" mode=""></image>
<view class="info">
<view class="name">{{userInfo.staffName}}</view>
<view class="shop">{{userInfo.accountName}}</view>
......@@ -34,28 +34,28 @@
</view>
</view>
<view class="bottom-setting">
<view class="item">
<view class="item" @click="clickItem(1)">
<view class="left">
<image class="left-img" src="../../static/coupon.png" mode=""></image>
<view class="title">卡片回收</view>
</view>
<image class="right-arrow" src="../../static/arrow-right.png" mode=""></image>
</view>
<view class="item">
<view class="item" @click="clickItem(2)">
<view class="left">
<image class="left-img" src="../../static/integral.png" mode=""></image>
<view class="title">积分明细</view>
</view>
<image class="right-arrow" src="../../static/arrow-right.png" mode=""></image>
</view>
<view class="item">
<view class="item" @click="clickItem(3)">
<view class="left">
<image class="left-img" src="../../static/customer.png" mode=""></image>
<view class="title">联系客服</view>
</view>
<image class="right-arrow" src="../../static/arrow-right.png" mode=""></image>
</view>
<view class="item last-item">
<view class="item last-item" @click="clickItem(4)">
<view class="left">
<image class="left-img" src="../../static/setting.png" mode=""></image>
<view class="title">设置</view>
......@@ -102,6 +102,9 @@
}
});
},
clickItem(index) {
this.$router.push('GoodsDetail', {'spuNo':'50125','skuNo':'21'})
}
}
}
</script>
......
<template>
<view class="container">
<view class="goods">
<view class="title">商品信息</view>
<view class="info">
<image class="img" :src="goods.img" mode=""></image>
<view class="right">
<view class="goods-title">{{goods.title}}</view>
<view class="bottom-info">
<view class="integral">{{goods.sellingPrice}}</view>
<view class="buy-button">
<image v-if="goodsNum===1" class="reduce" src="../../static/reduce.png" mode="" @click="reduce()"></image>
<image v-else class="reduce" src="../../static/reduce-h.png" mode="" @click="reduce()"></image>
<view class="goods-num">{{goodsNum}}</view>
<image class="plus" src="../../static/add.png" mode="" @click="add()"></image>
</view>
</view>
</view>
</view>
</view>
<view class="bottom" :style="{'height':safeAreaBottom+120+'rpx'}">
<view class="left">
<text class="title">支付积分:<text class="num">{{payIntegral}}积分</text></text>
</view>
<view class="right" @click="goSubmit()">
立即兑换
</view>
</view>
<pwdCodeAlert closeName="showPwdAlert" v-show="showPwdAlert" :integral="payIntegral" @pwdSubmit="pwdSubmit"></pwdCodeAlert>
<smsCodeAlert closeName="showSmsCodeAlert" v-show="showSmsCodeAlert" @smsCodeSubmit="smsCodeSubmit"></smsCodeAlert>
<Alert v-show="errorAlert" :text="errorAlertText" @clickCertain="clickAlert" @clickCancel="clickAlert"/>
</view>
</template>
<script>
export default {
data() {
return {
goods: {},
goodsNum: 1,
safeAreaBottom: this.SafeAreaBottom,
showPwdAlert: false,
showSmsCodeAlert: false,
errorAlert: false,
errorAlertText: '',
orderId: ''
};
},
onLoad(options) {
console.log(this.$store.state);
this.goods = this.$store.state.submitGoods || {}
this.goodsNum = this.goods.num
},
computed: {
payIntegral() {
return this.$numUtils.numMulti(this.goods.sellingPrice+'', this.goodsNum+'')
}
},
methods: {
add() {
if (this.payIntegral > Number(this.$store.state.userInfo.surplusIntegral)) {
this.toast('积分不够')
return
}
this.goodsNum++
},
reduce() {
if (this.goodsNum === 1) {
return
}
this.goodsNum--
},
goSubmit() {
let params = {
'payIntegral':this.payIntegral,
'payDetail':[
{
'spuId': this.goods.spuNo,
'skuId': this.goods.skuNo,
'payNumber': this.goodsNum
}
]
}
this.$net.post('/submit', params).then(res=>{
if (res.code === 200) {
this.orderId = res.data.orderId
if (res.data.isSendSms === 1) {
this.showSmsCodeAlert = true
} else {
this.showPwdAlert = true
}
} else {
this.errorAlertText = res.message
this.errorAlert = true
}
})
},
clickAlert() {
this.errorAlert = false
},
smsCodeSubmit(e) {
this.$net.post('/payment/validation', {'orderId':this.orderId,'smsCode':e}).then(res=>{
if (res.code === 200) {
this.showSmsCodeAlert = false
this.showPwdAlert = true
} else {
this.toast(res.message)
}
})
},
pwdSubmit(e) {
this.$net.post('/payment', {'orderId':this.orderId,'payPasswd':e}).then(res=>{
if (res.code === 200) {
this.showPwdAlert = false
} else {
this.toast(res.message)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #F5F5F5;
.goods {
margin: 24rpx;
border-radius: 16rpx;
background-color: #FFFFFF;
padding: 24rpx;
.title {
font-size: 32rpx;
font-weight: bolder;
color: #333333;
line-height: 44rpx;
}
.info {
display: flex;
margin-top: 28rpx;
.img {
height: 200rpx;
width: 200rpx;
display: block;
border-radius: 8rpx;
}
.right {
margin-left: 16rpx;
.goods-title {
font-size: 28rpx;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
height: 80rpx;
line-height: 40rpx;
width: 438rpx;
}
.attr {
margin-top: 8rpx;
font-size: 26rpx;
color: #666666;
line-height: 36rpx;
}
.bottom-info {
margin-top: 76rpx;
display: flex;
align-items: center;
width: 438rpx;
justify-content: space-between;
.integral {
font-size: 32rpx;
height: 36rpx;
line-height: 36rpx;
color: #FF0520;
}
.buy-button {
position: relative;
display: flex;
width: 160rpx;
height: 40rpx;
font-size: 28rpx;
align-items: center;
.reduce {
width: 40rpx;
height: 40rpx;
}
.goods-num {
width: 78rpx;
text-align: center;
color: #333333;
}
.plus {
position: absolute;
top: 0;
left: 118rpx;
width: 40rpx;
height: 40rpx;
}
}
}
}
}
}
.bottom {
// height: 120rpx;
bottom: 0;
background-color: #FFFFFF;
display: flex;
padding: 0 24rpx;
// align-items: center;
justify-content: space-between;
position: fixed;
left: 0;
right: 0;
.left {
margin-top: 32rpx;
.title {
font-size: 28rpx;
color: #252525;
}
.num {
font-size: 28rpx;
font-weight: bolder;
color: #FF0520;
}
}
.right {
margin-top: 20rpx;
height: 80rpx;
border-radius: 40rpx;
width: 256rpx;
background-color: #FF0520;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 82rpx;
}
}
}
</style>
......@@ -5,7 +5,9 @@ const routers = {
'Home': '/pages/home/home',
'Order': '/pages/order/order',
'Mine': '/pages/mine/mine',
'SelectAccount': '/pagesA/selectAccount/selectAccount'
'SelectAccount': '/pagesA/selectAccount/selectAccount',
'GoodsDetail': '/pagesA/goods/goods',
'SubmitOrder': '/pagesA/submitOrder/submitOrder'
}
export function push(routerName, params, events) {
......
static/add.png

882 Bytes

......@@ -11,7 +11,8 @@ const store = createStore({
// #endif
state: {
isLogin: false,
userInfo: {}
userInfo: {},
submitGoods: {}
},
mutations: {
refreshUserLogin(state, isLogin) {
......@@ -19,7 +20,10 @@ const store = createStore({
},
refreshUserInfo(state, info) {
state.userInfo = info
},
},
refreshSubmitGoods(state, info) {
state.submitGoods = info
}
},
getters: {
......
......@@ -471,6 +471,7 @@ export default {
that.outFoStock = false;
that.shopItemInfo = {};
let specListName = that.specListName;
console.log(specListName, that.goodsInfo);
that.goodsInfo[specListName].map(item => {
that.selectArr.push('');
that.subIndex.push(-1);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,7 +10,9 @@
"pages": [
"login/login",
"integral/integral",
"selectAccount/selectAccount"
"selectAccount/selectAccount",
"goods/goods",
"submitOrder/submitOrder"
]
}
],
......
......@@ -2363,14 +2363,7 @@ function tokenDiffTIme(tokenStr) {
// 重新获取token 并记录
function refreshToken(token) {
post('/user/refresh/token', { 'token': token, 'resetToken': 'not' }).then(function (res) {
if (res.code == 200) {
var dataRes = res.data;
var _token = dataRes.token;
tokenSave(_token);
}
}).catch(function (e) {
});
}
function uploadImage(image, name, type) {
......@@ -2424,7 +2417,8 @@ var store = new _vuex.default.Store({
state: {
isLogin: false,
userInfo: {} },
userInfo: {},
submitGoods: {} },
mutations: {
refreshUserLogin: function refreshUserLogin(state, isLogin) {
......@@ -2432,6 +2426,9 @@ var store = new _vuex.default.Store({
},
refreshUserInfo: function refreshUserInfo(state, info) {
state.userInfo = info;
},
refreshSubmitGoods: function refreshSubmitGoods(state, info) {
state.submitGoods = info;
} },
getters: {},
......@@ -3835,7 +3832,9 @@ var routers = {
'Home': '/pages/home/home',
'Order': '/pages/order/order',
'Mine': '/pages/mine/mine',
'SelectAccount': '/pagesA/selectAccount/selectAccount' };
'SelectAccount': '/pagesA/selectAccount/selectAccount',
'GoodsDetail': '/pagesA/goods/goods',
'SubmitOrder': '/pagesA/submitOrder/submitOrder' };
function push(routerName, params, events) {
......@@ -10544,7 +10543,7 @@ function resolveLocaleChain(locale) {
/***/ }),
/***/ 70:
/***/ 86:
/*!******************************************************************************************************************!*\
!*** /Users/wangjian/Desktop/HBuilder/FuLiMini/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
\******************************************************************************************************************/
......@@ -10552,9 +10551,9 @@ function resolveLocaleChain(locale) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 71));
var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 72));
var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 73));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 87));
var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 88));
var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 89));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
{
en: _en.default,
'zh-Hans': _zhHans.default,
......@@ -10562,7 +10561,7 @@ var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 7
/***/ }),
/***/ 71:
/***/ 87:
/*!*****************************************************************************************************************!*\
!*** /Users/wangjian/Desktop/HBuilder/FuLiMini/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
\*****************************************************************************************************************/
......@@ -10573,7 +10572,7 @@ module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"下拉加载更多
/***/ }),
/***/ 72:
/***/ 88:
/*!**********************************************************************************************************************!*\
!*** /Users/wangjian/Desktop/HBuilder/FuLiMini/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
\**********************************************************************************************************************/
......@@ -10584,7 +10583,7 @@ module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多
/***/ }),
/***/ 73:
/***/ 89:
/*!**********************************************************************************************************************!*\
!*** /Users/wangjian/Desktop/HBuilder/FuLiMini/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
\**********************************************************************************************************************/
......
......@@ -96,7 +96,7 @@ var components
try {
components = {
uniLoadMore: function() {
return Promise.all(/*! import() | uni_modules/uni-load-more/components/uni-load-more/uni-load-more */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-load-more/components/uni-load-more/uni-load-more")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue */ 65))
return Promise.all(/*! import() | uni_modules/uni-load-more/components/uni-load-more/uni-load-more */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-load-more/components/uni-load-more/uni-load-more")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue */ 81))
}
}
} catch (e) {
......
......@@ -233,6 +233,9 @@ var _default =
that.imgArr = res.tempFilePaths;
} });
},
clickItem: function clickItem(index) {
this.$router.push('GoodsDetail', { 'spuNo': '50125', 'skuNo': '21' });
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
......
<view class="container data-v-dcbcfe34"><view class="mine-header data-v-dcbcfe34"><view class="header-top data-v-dcbcfe34"><view class="nav-bar data-v-dcbcfe34" style="{{'height:'+(height+'px')+';'+('padding-top:'+(statusBarHeight+'px')+';')}}"><text class="person-center data-v-dcbcfe34">我的</text></view><view class="user-info data-v-dcbcfe34"><view class="top data-v-dcbcfe34"><image class="avator data-v-dcbcfe34" src="{{userInfo.avatar}}" mode></image><view class="info data-v-dcbcfe34"><view class="name data-v-dcbcfe34">{{userInfo.staffName}}</view><view class="shop data-v-dcbcfe34">{{userInfo.accountName}}</view></view><block wx:if="{{userInfo.allowSwitching>0}}"><view class="select-acccount data-v-dcbcfe34">切换行号<image class="img data-v-dcbcfe34" src="../../static/arrow-right-w.png" mode></image></view></block></view><view class="line data-v-dcbcfe34"></view><view class="user-integral data-v-dcbcfe34"><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.allIntegral}}</view><view class="bottom data-v-dcbcfe34">累计积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.surplusIntegral}}</view><view class="bottom data-v-dcbcfe34">当前积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.consumeIntegral}}</view><view class="bottom data-v-dcbcfe34">消费积分</view></view></view></view></view><view class="bottom-setting data-v-dcbcfe34"><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/coupon.png" mode></image><view class="title data-v-dcbcfe34">卡片回收</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/integral.png" mode></image><view class="title data-v-dcbcfe34">积分明细</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/customer.png" mode></image><view class="title data-v-dcbcfe34">联系客服</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item last-item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/setting.png" mode></image><view class="title data-v-dcbcfe34">设置</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view></view></view></view>
\ No newline at end of file
<view class="container data-v-dcbcfe34"><view class="mine-header data-v-dcbcfe34"><view class="header-top data-v-dcbcfe34"><view class="nav-bar data-v-dcbcfe34" style="{{'height:'+(height+'px')+';'+('padding-top:'+(statusBarHeight+'px')+';')}}"><text class="person-center data-v-dcbcfe34">我的</text></view><view class="user-info data-v-dcbcfe34"><view class="top data-v-dcbcfe34"><image class="avator data-v-dcbcfe34" src="{{userInfo.avatar}}" mode data-event-opts="{{[['tap',[['getImg']]]]}}" bindtap="__e"></image><view class="info data-v-dcbcfe34"><view class="name data-v-dcbcfe34">{{userInfo.staffName}}</view><view class="shop data-v-dcbcfe34">{{userInfo.accountName}}</view></view><block wx:if="{{userInfo.allowSwitching>0}}"><view class="select-acccount data-v-dcbcfe34">切换行号<image class="img data-v-dcbcfe34" src="../../static/arrow-right-w.png" mode></image></view></block></view><view class="line data-v-dcbcfe34"></view><view class="user-integral data-v-dcbcfe34"><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.allIntegral}}</view><view class="bottom data-v-dcbcfe34">累计积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.surplusIntegral}}</view><view class="bottom data-v-dcbcfe34">当前积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.consumeIntegral}}</view><view class="bottom data-v-dcbcfe34">消费积分</view></view></view></view></view><view class="bottom-setting data-v-dcbcfe34"><view data-event-opts="{{[['tap',[['clickItem',[1]]]]]}}" class="item data-v-dcbcfe34" bindtap="__e"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/coupon.png" mode></image><view class="title data-v-dcbcfe34">卡片回收</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view data-event-opts="{{[['tap',[['clickItem',[2]]]]]}}" class="item data-v-dcbcfe34" bindtap="__e"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/integral.png" mode></image><view class="title data-v-dcbcfe34">积分明细</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view data-event-opts="{{[['tap',[['clickItem',[3]]]]]}}" class="item data-v-dcbcfe34" bindtap="__e"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/customer.png" mode></image><view class="title data-v-dcbcfe34">联系客服</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view data-event-opts="{{[['tap',[['clickItem',[4]]]]]}}" class="item last-item data-v-dcbcfe34" bindtap="__e"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/setting.png" mode></image><view class="title data-v-dcbcfe34">设置</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view></view></view></view>
\ No newline at end of file
......@@ -96,7 +96,7 @@ var components
try {
components = {
uniLoadMore: function() {
return Promise.all(/*! import() | uni_modules/uni-load-more/components/uni-load-more/uni-load-more */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-load-more/components/uni-load-more/uni-load-more")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue */ 65))
return Promise.all(/*! import() | uni_modules/uni-load-more/components/uni-load-more/uni-load-more */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-load-more/components/uni-load-more/uni-load-more")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue */ 81))
}
}
} catch (e) {
......
......@@ -5,7 +5,41 @@
},
"setting": {
"urlCheck": false,
"minified": true
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true,
"minifyWXML": true
},
"compileType": "miniprogram",
"libVersion": "",
......@@ -13,19 +47,15 @@
"projectname": "FuLiMini",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment