Browse Source

Merge branch 'master' of http://8.134.10.79:3000/Leadfyy.co/ec.uniapp-master

# Conflicts:
#	pages/shop/goodsdetail.vue
master
Enzo 4 years ago
parent
commit
ca089eb61b
  1. 235
      components/lf-jpCoded/lf-jpCoded.vue
  2. 8
      components/lf-payPassword/lf-payPassword.vue
  3. 105
      components/smh-pwd/smh-pwd.vue
  4. 2
      pages/article/details.vue
  5. 2
      pages/business/login/login.vue
  6. 8
      pages/index/index/index.vue
  7. 116
      pages/order/confirm/confirm.vue
  8. 6
      pages/point/shoppingMall/shoppingMall.vue
  9. 2
      pages/shop/goodsdetail.vue
  10. 2
      pages/user/loginType/loginType.vue

235
components/lf-jpCoded/lf-jpCoded.vue

@ -1,235 +0,0 @@
<template>
<view class="wallet_class">
<view class="pay-pwd-input" v-if="pawType==='one'" :style="'width:' + width + 'rpx'" @tap="tokey">
<view class="pay-pwd-grid uni-flex uni-row" v-for="(value, index) in payPwdGrid" :key="index">
<view :style="('width:'+ width1 + 'rpx;') + ((focusType&&(index==list.length))?borderCheckStyle:'') ">{{value.text}}</view>
</view>
</view>
<view class="input-row" v-if="pawType==='two'" :style="'width:' + width + 'rpx'" @tap="tokey">
<view class="pay-pwd-grid uni-flex uni-row" v-for="(value, index) in payPwdGrid" :key="index">
<view :class="'item'" :style="('width:'+ width1 + 'rpx;') + ((focusType&&(index==list.length))?borderCheckStyle:'') ">{{ value.text }}</view>
</view>
</view>
<input v-if="keyType" :type="inputType" :style="'width:' + width + 'rpx'" :maxlength="places" class="input_info" @input="inputVal"
@focus="focus" @blur="blur" />
</view>
</template>
<script>
export default {
name: 'wallet_category',
props: {
pawType: { //
type: String,
default: 'one'
},
places: { //
type: Number,
default: 6
},
width: {
type: Number,
default: 750
},
borderCheckStyle: {
type: String,
default: 'border: 1px solid #f00;'
},
codes: {
type: String,
default: ''
},
keyType: {
type: Boolean,
default: true
},
isPwy:{
type: Boolean,
default: true
},
inputType:{
type: String,
default: 'number'
}
},
data() {
return {
focusType: false,
width1: 110,
list: [],
payPwdGrid: []
}
},
mounted() {
// https://ext.dcloud.net.cn/plugin?id=2695
this.list = this.codes.split('')
this.width1 = (this.width - 90) / this.places
this.payPwdGrid = []
for (let a = 0; a < this.places; a++) {
this.payPwdGrid.push({
text: ''
})
}
if(this.isPwy){
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = '●'
}
}else{
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = this.list[a]
}
}
},
watch: {
places() {
this.list = this.codes.split('')
this.width1 = (this.width - 90) / this.places
this.payPwdGrid = []
for (let a = 0; a < this.places; a++) {
this.payPwdGrid.push({
text: ''
})
}
if(this.isPwy){
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = '●'
}
}else{
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = this.list[a]
}
}
},
codes() {
this.list = this.codes.split('')
this.payPwdGrid = []
for (let a = 0; a < this.places; a++) {
this.payPwdGrid.push({
text: ''
})
}
if(this.isPwy){
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = '●'
}
}else{
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = this.list[a]
}
}
this.$emit('inputVal', this.codes);
}
},
methods: {
focus() {
this.focusType = true
},
blur() {
this.focusType = false
},
tokey(){
this.$emit('tokey');
},
inputVal(e) {
let inputValues = e.detail.value;
this.list = inputValues.split('')
this.payPwdGrid = []
for (let a = 0; a < this.places; a++) {
this.payPwdGrid.push({
text: ''
})
}
if(this.isPwy){
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = '●'
}
}else{
for (let a = 0; a < this.list.length; a++) {
this.payPwdGrid[a].text = this.list[a]
}
}
this.$emit('inputVal', inputValues);
}
}
}
</script>
<style lang="scss" scoped>
.wallet_class {
position: relative;
height: 100%;
.pay-pwd-input {
height: 100%;
line-height: 100%;
display: flex;
justify-content: flex-start;
.pay-pwd-grid {
margin: 0upx auto;
height: 100%;
line-height: 100%;
display: flex;
justify-content: center;
view {
width: 110upx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border: #cececd solid 0.1upx;
border-radius: 10upx;
font-size: 36upx;
font-weight: 600;
}
.xaunz {
border: #f00 solid 0.1upx;
}
}
}
.input-row {
height: 100%;
line-height: 100%;
display: flex;
justify-content: flex-start;
.pay-pwd-grid {
margin: 0upx auto;
height: 100%;
line-height: 100%;
display: flex;
justify-content: center;
.item {
width: 110rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 36upx;
font-weight: 600;
border-bottom: 1px solid #c8c8c8;
}
.item-active {
position: relative;
transform: scale(1.2);
}
}
}
.input_info {
width: 1200rpx;
height: 100%;
line-height: 100%;
opacity: 0;
position: absolute;
top: 0rpx;
left: 0;
}
}
</style>

8
components/lf-payPassword/lf-payPassword.vue

@ -3,7 +3,7 @@
<view class="content">
<view class="title">{{ title }}</view>
<view class="password">
<lf-jp-coded :width="686" @inputVal="inputVal"></lf-jp-coded>
<smh-pwd :unit="6" :focus="true" :ontime="true" @change="inputVal"></smh-pwd>
</view>
<view class="lf-flex lf-m-t-45 lf-row-center" v-if="showCountdown">
<view class="lf-font-24 lf-m-r-10" style="color:#FF9D9D">
@ -27,11 +27,11 @@
<script>
import countdownTime from '@/components/uni-countdown/uni-countdown';
import lfJpCoded from '@/components/lf-jpCoded/lf-jpCoded.vue'
import smhPwd from '@/components/smh-pwd/smh-pwd.vue';
export default {
components: {
lfJpCoded,
countdownTime
countdownTime,
smhPwd
},
props: {
title: {

105
components/smh-pwd/smh-pwd.vue

@ -0,0 +1,105 @@
<template>
<view>
<view class="action">
<view class="pwd" @click="changeStatus">
<view v-for="(item,index) in unit"
:class="{pwd1:pwd.length>=(index+1), 'docus-border': (pwd.length == index) && inputStatus}"
class="number">
</view>
</view>
</view>
<view class="input1">
<input :maxlength="unit"
@input="change1"
v-model="pwd"
v-show="true"
type="number"
:focus="inputStatus"
@blur="inputStatus = false"
@focus="inputStatus = true"
/>
</view>
</view>
</template>
<script>
export default {
props:{
unit:{
type:Number,
default:6
},
focus:{
type:Boolean,
default:false
},
ontime:{
type:Boolean,
default:false
}
},
data(){
return {
inputStatus: this.focus,
pwd:"",
pwd1:[]
}
},
methods:{
changeStatus(){
this.inputStatus=!this.inputStatus
},
change1(e){
this.pwd1=String(e.target.value).split('')
if(this.ontime){
this.$emit('change',e.target.value)
}else{
if(this.pwd1.length==this.unit){
this.$emit('change',e.target.value)
}
}
}
}
}
</script>
<style lang="scss" scoped>
.action{
width:686rpx;
margin: 0 auto;
.pwd{
width:100%;
height: 100rpx;
margin: 20rpx auto;
display: flex;
margin-bottom: 40rpx;
justify-content: space-between;
.number{
height: 100%;
display: flex;
justify-content: center;
align-items: center;
width: 100rpx;
position: relative;
border: 1rpx solid #979797;
border-radius: 5rpx;
}
.pwd1{
&::after{
position: absolute;
content: "";
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background-color: #000;
}
}
.docus-border{
border: 4rpx solid #15716E;
}
}
}
.input1{
width: 0;
height: 0;
overflow: hidden;
}
</style>

2
pages/article/details.vue

@ -9,7 +9,7 @@
</view>
<view class="lf-flex lf-m-b-24">
<view class="lf-font-28" style="color: #2D6361;">
优选线上商城
优选线上商城
</view>
<view class="lf-color-777 lf-font-28 lf-m-l-25">
2021.09.01 16:28:22

2
pages/business/login/login.vue

@ -4,7 +4,7 @@
<view class="head">
<view class="head-content">
<image class="logo"></image>
<view class="title">欢迎来到金优选</view>
<view class="title">欢迎来到金优选</view>
</view>
</view>
<view class="content">

8
pages/index/index/index.vue

@ -80,8 +80,10 @@
<view class="fixed-cart" hover-class="lf-opacity" @click="$url('/pages/store/cart/cart')">
<text class="lf-iconfont icon-gouwulan icon-text"></text>
<text class="tips">购物车</text>
<view class="angle-mark" v-if="car_num<99">{{car_num || 0}}</view>
<view class="angle-mark" v-else>99+</view>
<block v-if="$isRight(car_num)">
<view class="angle-mark" v-if="car_num<99">{{car_num || 0}}</view>
<view class="angle-mark" v-else>99+</view>
</block>
</view>
</view>
<!-- ad广告弹出组件 -->
@ -852,7 +854,7 @@
},
onShareAppMessage(){
return {
title: '欢迎使用金优选小程序!',
title: '欢迎使用金优选小程序!',
path: '/pages/route/index?route=home'
}
}

116
pages/order/confirm/confirm.vue

@ -5,8 +5,8 @@
<view class="card head">
<view class="lf-font-32 lf-color-222">选择收货方式</view>
<view class="capsule">
<view class="item" :class="{'capsule-active': mode == 0}" @click="mode = 0">邮寄</view>
<view class="item" :class="{'capsule-active': mode == 1}" @click="mode = 1">自提</view>
<view class="item" :class="{'capsule-active': mode == 0}" @click="switchMode(0)">邮寄</view>
<view class="item" :class="{'capsule-active': mode == 1}" @click="switchMode(1)">自提</view>
</view>
</view>
<view class="card address" v-if="mode == 0">
@ -28,7 +28,7 @@
</view>
</view>
<view class="card address" v-else>
<view @click="$url('/pages/address/list/list?is_select=1')">
<view>
<text class="lf-font-28 lf-color-primary lf-m-r-10">店铺地址</text>
</view>
<view v-if="address">
@ -44,7 +44,7 @@
暂无收货地址,请前往添加
</view>
</view>
<view class="card goods">
<view class="card goods" v-if="$isRight(order_detail.order) && $isRight(order_detail.order.items)">
<view @click="$url('/pages/shop/shopdetail?id='+ order_detail.order.brand.id)">
<text class="lf-iconfont icon-Group- lf-font-30"></text>
<text class="shop-name">{{ order_detail.order.brand.name }}</text>
@ -56,7 +56,7 @@
<view class="lf-font-26 lf-color-333 lf-line-1">{{ item.item_name }}</view>
<view class="lf-font-24 lf-color-777">{{ item.item_meta.specs_text }}</view>
<view class="lf-row-between" style="line-height: 1;">
<text class="price"><text v-if="goods_type==1">¥</text>{{ item.total_yuan }}<text class="lf-font-24" v-if="goods_type==0">积分</text></text>
<text class="price"><text v-if="goods_type==1">¥</text>{{ unitConversion(item.unit_price) }}<text class="lf-font-24" v-if="goods_type==0">积分</text></text>
<text class="lf-font-28 lf-color-777">x {{ item.quantity }}</text>
</view>
</view>
@ -77,15 +77,15 @@
</view>
<view class="lf-row-between lf-m-t-20">
<view class="lf-font-28 lf-color-777">商品金额</view>
<view class="lf-font-26 lf-color-222"><text v-if="goods_type==1">¥</text>{{ order_detail.order.items_total_yuan }}<text v-if="goods_type==0">积分</text></view>
<view class="lf-font-26 lf-color-222"><text v-if="goods_type==1">¥</text>{{ itemsPrice }}<text v-if="goods_type==0">积分</text></view>
</view>
<view class="lf-row-between lf-m-t-20" v-if="mode == 0">
<view class="lf-font-28 lf-color-777">运费</view>
<view class="lf-font-26" style="color: #F63434;">+¥{{ order_detail.order.payable_freight_yuan }}</view>
<view class="lf-font-26" style="color: #F63434;">+¥{{ order_detail.order.payable_freight_yuan || 0 }}</view>
</view>
<view class="lf-row-between lf-m-t-20">
<view class="lf-font-28 lf-color-777">优惠</view>
<view class="lf-font-26" style="color: #F63434;">-¥{{ order_detail.order.adjustments_total_yuan }}</view>
<view class="lf-font-26" style="color: #F63434;">-¥{{ fullMinus(order_detail.discounts) }}</view>
</view>
</view>
<view class="spread-out"></view>
@ -169,33 +169,39 @@
token: '',
address: {},
address_id: null,
order_detail: {coupons: []},
order_detail: {},
show_coupon: false,
coupon_index: null,
goods_type: 1
goods_type: 1,
itemsPrice: 0, // ()
totalPrice: 0 //
}
},
computed: {
showCouponTitle(){
let order_detail = this.order_detail;
if(typeof order_detail.coupons == 'undefined'){
order_detail.coupons = [];
}
if(this.coupon_index != null){
return this.order_detail.coupons[this.coupon_index].discount.title;
return order_detail.coupons[this.coupon_index].discount.title;
}else{
if(this.order_detail.coupons.length){
if(order_detail.coupons.length){
return '不使用优惠券';
}else{
return '暂无可用优惠券';
}
}
},
totalPrice(){
let order = this.order_detail.order;
if(!this.$isRight(order)){
return 0;
}
if(this.mode){
return order.total_yuan;
}else{
return new Bigc(order.total_yuan).plus(order.payable_freight);
fullMinus(){
return function(arr){
if(this.$isRight(arr)){
let price = arr[0].adjustmentTotal;
let adjustmentTotal = new Bigc(price).div(100);
return Math.abs(adjustmentTotal);
}else{
return 0
}
}
}
},
@ -232,9 +238,54 @@
let detail = res.data.data;
this.order_detail = detail;
this.address = res.data.data.address;
if(this.$isRight(detail.coupons)){
this.coupon_index = 0;
}
this.calcAmount();
uni.hideLoading()
}).catch(err => uni.hideLoading())
},
//
unitConversion(price){
let newPrice = new Bigc(price).div(100);
return Math.abs(newPrice);
},
//
calcAmount(){
let detail = this.order_detail;
let items = detail.order.items || [];
let itemsPrice = new Bigc(0);
//
items.map(item => {
let price = new Bigc(item.unit_price).div(100);
let itemP = price.times(item.quantity);
itemsPrice = itemsPrice.plus(itemP);
})
this.itemsPrice = itemsPrice;
//
if(this.coupon_index != null){
let coupon = detail.coupons[this.coupon_index];
let adjustmentTotal = new Bigc(coupon.adjustmentTotal).div(100); //
itemsPrice = itemsPrice.plus(adjustmentTotal); //
}
//
if(this.$isRight(detail.discounts)){
let discount = detail.discounts[0];
let adjustmentTotal = new Bigc(discount.adjustmentTotal).div(100); //
itemsPrice = itemsPrice.plus(adjustmentTotal); //
}
//
if(this.mode == 0){
let payable_freight = new Bigc(detail.order.payable_freight).div(100);
itemsPrice = itemsPrice.plus(payable_freight);
}
this.totalPrice = itemsPrice; //
},
//
switchMode(mode){
this.mode = mode;
this.calcAmount();
},
//
getDefaultAddress(){
this.$http.get({
@ -272,15 +323,20 @@
this.$msg('请先添加收货地址!');
return
}
let par = {
order_no: this.order_detail.order.order_no,
pick_self: this.mode, // 0 1
address_id: this.address.id,
note: this.value
}
// TODO id
if(this.coupon_index != null){
par.coupon_id = this.order_detail.coupons[this.coupon_index].id;
}
this.$http.post({
api: 'api/shopping/order/confirm',
data: {
order_no: this.order_detail.order.order_no,
// discount_id: 0, // id? TODO
pick_self: this.mode, // 0 1
address_id: this.address.id,
note: this.value
},
data: par,
header: {
Authorization: this.token
}
@ -289,7 +345,7 @@
if(res.data.code == 200 || res.data.code == true){
let order = res.data.data.order;
let url = '/pages/order/cashier/cashier';
url += '?amount='+ order.total_yuan;
url += '?amount='+ this.totalPrice;
url += '&order_no='+ order.order_no;
this.$url(url, {type: 'redirect'});
}else{
@ -304,6 +360,8 @@
}else{
this.coupon_index = Number(event.detail.value);
}
this.show_coupon = false;
this.calcAmount();
}
}
}

6
pages/point/shoppingMall/shoppingMall.vue

@ -21,8 +21,10 @@
<view class="item" @click="$url('/pages/store/cart/cart')">
<text class="lf-iconfont icon-gouwulan lf-font-50"></text>
<text>购物车</text>
<view class="angle-mark" v-if="car_num<99">{{car_num}}</view>
<view class="angle-mark" v-else>99+</view>
<block v-if="$isRight(car_num)">
<view class="angle-mark" v-if="car_num<99">{{car_num}}</view>
<view class="angle-mark" v-else>99+</view>
</block>
</view>
</view>
</view>

2
pages/shop/goodsdetail.vue

@ -10,7 +10,7 @@
<view class="seckill-box" v-if="type == 'seckill' && $isRight(seckill.seckill.end_left_time)" style="z-index: 999;">
<view>距离结束还剩余</view>
<view v-if="$isRight(seckill.seckill.end_left_time)">
<countdown-time
<countdown-time
:day="seckill.seckill.end_left_time[0]"
:hour="seckill.seckill.end_left_time[1]"
:minute="seckill.seckill.end_left_time[2]"

2
pages/user/loginType/loginType.vue

@ -4,7 +4,7 @@
<view class="head">
<view class="head-content">
<image class="logo"></image>
<view class="title">欢迎来到金优选</view>
<view class="title">欢迎来到金优选</view>
</view>
</view>
<view class="content">

Loading…
Cancel
Save